@hpcc-js/eclwatch 3.6.12 → 3.7.0
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 +7835 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +13 -2
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +14 -14
- package/types/WUGraph.d.ts +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):"function"==typeof define&&define.amd?define(["exports","@hpcc-js/codemirror","@hpcc-js/comms","@hpcc-js/phosphor","@hpcc-js/tree","@hpcc-js/util","@hpcc-js/common","@hpcc-js/dgrid","@hpcc-js/graph","@hpcc-js/layout","@hpcc-js/timeline"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["@hpcc-js/eclwatch"]={},t["@hpcc-js/codemirror"],t["@hpcc-js/comms"],t["@hpcc-js/phosphor"],t["@hpcc-js/tree"],t["@hpcc-js/util"],t["@hpcc-js/common"],t["@hpcc-js/dgrid"],t["@hpcc-js/graph"],t["@hpcc-js/layout"],t["@hpcc-js/timeline"])}(this,function(t,e,i,n,o,a,s,r,l,h,c){"use strict";var u,p,d,f,y,_,x,m,g,b,v,w,S,k,A,C,M,T,P,I,E,F,D,R,z,O,j=Object.defineProperty,L=(t,e)=>j(t,"name",{value:e,configurable:!0});const N=class _ECLArchiveViewer extends n.SplitPanel{_prevHash;_contentStr;_directoryPane=new o.DirectoryTree;_fileEditorPane=(new e.Editor).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=a.xml2json(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 n=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==n||void 0===this._contentStr?i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(t=>{this._contentStr=t,this.updateDirectoryPane(this._contentStr),this._prevHash=n}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};L(N,"ECLArchiveViewer");let B=N;B.prototype._class+=" eclwatch_ECLArchiveViewer",B.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),B.prototype.publish("wuid","","string","Workunit ID"),B.prototype.publish("directoryWidthRatio",.38,"number","Default directory panel width ratio relative to the full width"),B.prototype.publish("contentString",null,"string","XML/JSON archive content string"),B.prototype.publishProxy("directoryPaneColor","_directoryPane","backgroundColor"),B.prototype.publishProxy("directoryPaneHoverColor","_directoryPane","hoverBackgroundColor"),B.prototype.publishProxy("iconSize","_directoryPane"),B.prototype.publishProxy("fontColor","_directoryPane"),B.prototype.publishProxy("fontFamily","_directoryPane"),B.prototype.publishProxy("fontSize","_directoryPane"),B.prototype.publishProxy("folderIconOpen","_directoryPane"),B.prototype.publishProxy("folderIconClosed","_directoryPane"),B.prototype.publishProxy("textFileIcon","_directoryPane"),B.prototype.publishProxy("codeFileIcon","_directoryPane"),B.prototype.publishProxy("verticalScroll","_directoryPane");const V=class _LegendVertex extends l.Vertex{constructor(){super()}enter(t,e){super.enter(t,e),this._icon.on("click",()=>{this.click(this.data())})}click(t){}};L(V,"LegendVertex");let H=V;const W=class _WUGraphLegend extends h.Legend{icon=s.local();_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 H).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();s.select(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){}};L(W,"WUGraphLegend");let $=W;function q(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""}$.prototype._class+=" eclwatch_WUGraphLegend",L(q,"faCharFactory");const G=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 a.Subgraph);else if(t instanceof a.Vertex){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 a.Subgraph){const i=this.appendSubgraph(t,e.hierarchy,e.subgraphs);i.showMinMax(t.vertices.length>3||"normal"!==i.minState())}else t instanceof a.Vertex?this.appendVertex(t,e.hierarchy,e.vertices):t instanceof a.Edge&&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 l.Subgraph).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 s.Icon).shape_colorFill("darkred").shape_colorStroke("darkred").image_colorFill("white").faChar("").on("click",()=>{i.minState("normal"),this.minClick(i)})}else{e=(new l.Vertex).icon_shape_colorFill("#1f77b4").icon_image_colorFill("white").faChar(q(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 h=null,c=100;i.IsDependency?(c=10,h="1,5"):i._childGraph?h="5,5":a?(c=25,h="5,5,10,5"):s&&(c=5,h="5,5"),e=(new l.Edge).sourceVertex(n).targetVertex(o).sourceMarker("circle").targetMarker("arrow").weight(c).strokeDasharray(h).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 n=t.vertices[e],o=n._.attr("Kind").RawValue;this._disabled[o]&&n.remove(!1,(t,e)=>new i.BaseScope({ScopeName:n._.ScopeName+":in",Id:t.Id+"->"+e.Id,ScopeType:"dummy-edge",Properties:{Property:[n._.attr("Label")]},Notes:{Note:[]},SinkActivity:""}))}}filterPartial(t){for(const e of t.subgraphs){if("partial"===this.subgraphsMap[e._.Id].minState()){const t=e.vertices,n=[],o=[];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)?n.push(e):o.push(e);if(o.length>1){const t={ScopeName:e._.ScopeName,Id:e._.Id+":dummy",ScopeType:"dummy",Properties:{Property:[{Name:"Activities",RawValue:""+o.length,Formatted:""+o.length,Measure:"count",Creator:"",CreatorType:""}]},Notes:{Note:[]},SinkActivity:""},a=new i.BaseScope(t),s=e.createVertex(a);for(const r of o){for(const t of r.inEdges)if(n.indexOf(t.source)>=0){const n=new i.BaseScope({ScopeName:t.source._.ScopeName,Id:t.source._.Id+"->"+s._.Id,ScopeType:"dummy-in",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(t.source,s,n)}for(const t of r.outEdges)if(n.indexOf(t.target)>=0){const n=new i.BaseScope({ScopeName:t.target._.ScopeName,Id:s._.Id+"->"+t.target._.Id,ScopeType:"dummy-out",Properties:{Property:[]},Notes:{Note:[]},SinkActivity:""});e.createEdge(s,t.target,n)}}o.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:q(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 l.Subgraph){const n=this.rSubgraphsMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Vertex||t instanceof s.Icon){const n=this.rVerticesMap[t.id()];e=n._,i=n.parent._}else if(t instanceof l.Edge){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){}};L(G,"WUScopeController");let U=G;const X=class _WUGraph extends h.ChartPanel{_partialAll=(new s.Button).faChar("fa-window-restore").tooltip("Partial All").on("click",()=>{this.stateClick(this._partialAll)});_maxAll=(new s.Button).faChar("fa-window-maximize").tooltip("Max All").on("click",()=>{this.stateClick(this._maxAll)});_toggleGraph=(new s.ToggleButton).faChar("fa-chain").tooltip("Graph").selected(!0).on("click",()=>{this.viewClick(this._toggleGraph)});_toggleActivities=(new s.ToggleButton).faChar("fa-table").tooltip("Activitiies").selected(!1).on("click",()=>{this.viewClick(this._toggleActivities)});_toggleEdges=(new s.ToggleButton).faChar("fa-table").tooltip("Edges").selected(!1).on("click",()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=(new s.ToggleButton).faChar("fa-table").tooltip("Subgraphs").selected(!1).on("click",()=>{this.viewClick(this._toggleSubgraphs)});_graph=(new l.Graph).layout("Hierarchy").applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=(new r.Table).pagination(!1);_edges=(new r.Table).pagination(!1);_subgraphs=(new r.Table).pagination(!1);_legend=new $(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 h.Carousel).widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new U;constructor(){super(),this.topOverlay(!1),this.widget(this._view);const t=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new s.Spacer,this._partialAll,this._maxAll,new s.Spacer,...this._graph.iconBarButtons(),new s.Spacer];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=a.hashSum({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 i.Workunit.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}};L(X,"WUGraph");let Y=X;function Q(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Z(t){switch(Object.prototype.toString.call(t)){case"[object Undefined]":case"[object Boolean]":case"[object Number]":return t;case"[object String]":return Q(t);default:console.warn("Unknown cell type: "+Object.prototype.toString.call(t))}return t}Y.prototype._class+=" eclwatch_WUGraph",Y.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Y.prototype.publish("wuid","","string","Workunit ID"),Y.prototype.publish("graphID","","string","Graph ID"),Y.prototype.publish("subgraphID","","string","Subgraph ID"),L(Q,"entitiesEncode"),L(Z,"safeEncode");const J=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 r.RowFormatter(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=r.domConstruct.create("table",{border:1,cellspacing:0,width:"100%"},i);switch(Object.prototype.toString.call(t)){case"[object Object]":let o=r.domConstruct.create("tr",null,n);for(const e in t)r.domConstruct.create("th",{innerHTML:Z(e)},o);o=r.domConstruct.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:r.domConstruct.create("td",{innerHTML:Z(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=r.domConstruct.create("tr",null,n);r.domConstruct.create("td",{innerHTML:Z(t[e])},i);break;default:if(0===e){const i=r.domConstruct.create("tr",null,n);for(const n in t[e])r.domConstruct.create("th",{innerHTML:Z(n)},i)}r.domConstruct.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=r.domConstruct.create("td",null,i);this.rowToTable(t[e][n],t[e],o)}else if(-1!==n.indexOf("__html",n.length-6))r.domConstruct.create("td",{innerHTML:t[e][n]},i);else if(-1!==n.indexOf("__javascript",n.length-12))r.domConstruct.create("td",null,i);else{const o=t[e][n];r.domConstruct.create("td",{innerHTML:Z(o)},i)}else r.domConstruct.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 r.Deferred;return this._request(t.start,t.end).then(t=>e.resolve(t)),new r.QueryResults(e.then(t=>t.data),{totalLength:e.then(t=>t.totalLength)})}};L(J,"Store");let K=J;const tt=class _WUResult extends r.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(t={}){return a.hashSum({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=i.Result.attach(e,this.wuid(),this.resultName()):this.wuid()&&void 0!==this.sequence()?this._result=i.Result.attach(e,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=i.Result.attachLogicalFile(e,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=i.Result.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 K(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){}};L(tt,"WUResult");let et=tt;et.prototype._class+=" eclwatch_WUResult",et.prototype.publish("baseUrl","","string","URL to WsWorkunits"),et.prototype.publish("user","","string","User ID"),et.prototype.publish("password","","string","Password"),et.prototype.publish("wuid","","string","Workunit ID"),et.prototype.publish("resultName","","string","Result Name"),et.prototype.publish("sequence",void 0,"number","Sequence Number"),et.prototype.publish("nodeGroup","","string","NodeGroup"),et.prototype.publish("logicalFile","","string","Logical File Name"),et.prototype.publish("filter",{},"object","Filter"),et.prototype.publish("bypassCache",!1,"boolean","Bypass cached results");var it=(t=>(t.CREATE="Created",t.COMPILE="Compiled",t.EXECUTE="Executed",t.COMPLETE="Completed",t))(it||{}),nt=(t=>(t.CREATE="Creating",t.COMPILE="Compiling",t.EXECUTE="Executing",t.COMPLETE="Completed",t))(nt||{});const ot=class _WUStatus extends l.Graph{_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=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==t&&(this._prevHash=t,this._wu=i.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(t=>{this.lazyRender()}))}createVertex(t){return(new l.Vertex).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 l.Edge).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 i.WUStateID.Blocked:case i.WUStateID.Wait:case i.WUStateID.Scheduled:case i.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case i.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case i.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case i.WUStateID.Compiled:this.updateVertexStatus(2);break;case i.WUStateID.Aborting:case i.WUStateID.Running:this.updateVertexStatus(3,!0);break;case i.WUStateID.Aborted:case i.WUStateID.Archived:case i.WUStateID.Completed:this.updateVertexStatus(4);break;case i.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case i.WUStateID.DebugPaused:case i.WUStateID.DebugRunning:case i.WUStateID.Paused:case i.WUStateID.Unknown:default:this.updateVertexStatus(0)}super.update(t,e),this.zoomToFit()}exit(t,e){this._wuHandle&&this._wuHandle.release(),super.exit(t,e)}};L(ot,"WUStatus");let at=ot;at.prototype._class+=" eclwatch_WUStatus",at.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),at.prototype.publish("wuid","","string","Workunit ID");var st=Object.defineProperty,rt=L((t,e)=>st(t,"name",{value:e,configurable:!0}),"o");function lt(){}function ht(){}function ct(){}function ut(){}function pt(t){return"function"==typeof t.highlightColumn}function dt(){}function ft(){}function yt(){let t=c,e=u,i=p,n=M(document.body),o=S(),a=null,r=null,l=null;const h=rt(function(t){if(a=k(t),!a)return;r=a.createSVGPoint();const e=n();e&&o&&e.appendChild(o)},"tip2");function c(){return"n"}function u(){return[0,0]}function p(){return" "}L(c,"h"),L(u,"y"),L(p,"d"),h.show=function(t,o,a){l=a[o];const s=Array.prototype.slice.call(arguments),r=i.apply(this,s);if(null===r)return h;const c=e.apply(this,s),u=A();let p,y=f.length;const _=n().getBoundingClientRect();for(u.html(r).style("opacity",1).style("pointer-events","all");y--;)u.classed(f[y],!1);let x=!1;const m={};let g=f[0];for(let e=0;e<f.length&&(x=w(f[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 h;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"),p=d.get(t).apply(this),u.classed(t,!0).style("top",p.top+c[0]-e+"px").style("left",p.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}},h.hide=function(){return A().style("opacity",0).style("pointer-events","none"),h},h.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().attr(t);const i=Array.prototype.slice.call(arguments);return s.selection.prototype.attr.apply(A(),i),h},h.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return A().style(t);const i=Array.prototype.slice.call(arguments);return s.selection.prototype.style.apply(A(),i),h},h.direction=function(e){return arguments.length?(t=null==e?e:M(e),h):t},h.offset=function(t){return arguments.length?(e=null==t?t:M(t),h):e},h.html=function(t){return arguments.length?(i=null==t?t:M(t),h):i},h.rootElement=function(t){return arguments.length?(n=M(t),h):n},h.destroy=function(){return o&&(A().remove(),o=null),h},rt(c,"d3TipDirection"),rt(u,"d3TipOffset"),rt(p,"d3TipHTML");const d=s.map({n:y,s:_,e:x,w:m,nw:g,ne:b,sw:v,se:w}),f=d.keys();function y(){const t=C(window);return{top:t.n.y-o.offsetHeight,left:t.n.x-o.offsetWidth/2}}function _(){const t=C(window);return{top:t.s.y+8,left:t.s.x-o.offsetWidth/2}}function x(){const t=C(window);return{top:t.e.y-o.offsetHeight/2,left:t.e.x+8}}function m(){const t=C(window);return{top:t.w.y-o.offsetHeight/2,left:t.w.x-o.offsetWidth-8}}function g(){const t=C(window);return{top:t.nw.y-o.offsetHeight,left:t.nw.x-o.offsetWidth}}function b(){const t=C(window);return{top:t.ne.y-o.offsetHeight,left:t.ne.x}}function v(){const t=C(window);return{top:t.sw.y,left:t.sw.x-o.offsetWidth}}function w(){const t=C(window);return{top:t.se.y,left:t.se.x}}function S(){const t=s.select(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 k(t){const e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}function A(){return null==o&&(o=S(),n().appendChild(o)),s.select(o)}function C(t){let e=l||t;for(;null==e.getCTM&&null!=e.parentNode;)e=e.parentNode;const i={},n=e.getCTM(),o=e.getBBox(),a=o.width,s=o.height,h=o.x,c=o.y;return r.x=h,r.y=c,i.nw=r.matrixTransform(n),r.x+=a,i.ne=r.matrixTransform(n),r.y+=s,i.se=r.matrixTransform(n),r.x-=a,i.sw=r.matrixTransform(n),r.y-=s/2,i.w=r.matrixTransform(n),r.x+=a,i.e=r.matrixTransform(n),r.x-=a/2,r.y-=s/2,i.n=r.matrixTransform(n),r.y+=s,i.s=r.matrixTransform(n),i}function M(t){return"function"==typeof t?t:function(){return t}}return L(y,"g"),L(_,"v"),L(x,"x"),L(m,"w"),L(g,"C"),L(b,"_"),L(v,"k"),L(w,"F"),L(S,"E"),L(k,"T"),L(A,"V"),L(C,"S"),L(M,"I"),rt(y,"directionNorth"),rt(_,"directionSouth"),rt(x,"directionEast"),rt(m,"directionWest"),rt(g,"directionNorthWest"),rt(b,"directionNorthEast"),rt(v,"directionSouthWest"),rt(w,"directionSouthEast"),rt(S,"initNode"),rt(k,"getSVGNode"),rt(A,"getNodeEl"),rt(C,"getScreenBBox"),rt(M,"functor"),h}function _t(){if(this.tooltip=yt(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=s.format(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=s.format(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)}}}L(lt,"f"),L(ht,"h"),L(ct,"y"),L(ut,"d"),L(pt,"b"),L(dt,"m"),L(ft,"g"),L(yt,"v"),L(_t,"x"),rt(lt,"I1DChart"),lt.prototype._dataFamily="1D",lt.prototype._palette=s.Palette.rainbow("default"),lt.prototype.click=function(t,e,i){},lt.prototype.dblclick=function(t,e,i){},rt(ht,"I2DChart"),ht.prototype._dataFamily="2D",ht.prototype._palette=s.Palette.ordinal("default"),ht.prototype.fillColor=function(t,e,i,n){return this._palette(t[0])},ht.prototype.strokeColor=function(t,e,i,n){return s.hsl(this.fillColor(t,e,i,n)).darker().toString()},ht.prototype.textColor=function(t,e,i,n){return s.Palette.textColor(this.fillColor(t,e,i,n))},ht.prototype.click=function(t,e,i){},ht.prototype.dblclick=function(t,e,i){},rt(ct,"I2DAggrChart"),ct.prototype._palette=s.Palette.rainbow("default"),ct.prototype.fillColor=function(t,e,i){return this._palette(t.length)},ct.prototype.strokeColor=function(t,e,i){return s.hsl(this.fillColor(t,e,i)).darker().toString()},ct.prototype.textColor=function(t,e,i){return s.Palette.textColor(this.fillColor(t,e,i))},ct.prototype.click=function(t,e,i){},ct.prototype.dblclick=function(t,e,i){},rt(ut,"IGraph"),ut.prototype._dataFamily="graph",ut.prototype.vertex_click=function(t,e,i,n){n&&n.vertex},ut.prototype.vertex_dblclick=function(t,e,i,n){n&&n.vertex},ut.prototype.edge_click=function(t,e,i,n){n&&n.edge},ut.prototype.edge_dblclick=function(t,e,i,n){n&&n.edge},rt(pt,"instanceOfIHighlight"),rt(dt,"IInput"),dt.prototype=Object.create(s.Widget.prototype),dt.prototype.constructor=dt,dt.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},dt.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()},dt.prototype.blur=function(t){},dt.prototype.keyup=function(t){},dt.prototype.focus=function(t){},dt.prototype.click=function(t){},dt.prototype.dblclick=function(t){},dt.prototype.change=function(t,e){},dt.prototype.resetValue=function(t){t.value(t._inputElement[0].node().value)},dt.prototype.disable=function(t){this._inputElement.forEach(function(e,i){e.attr("disabled",t?"disabled":null)})},dt.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},dt.prototype.publish("name","","string","HTML name for the input"),dt.prototype.publish("label","","string","Descriptive label"),dt.prototype.publish("value","","string","Input Current Value"),dt.prototype.publish("validate",null,"string","Input Validation"),rt(ft,"INDChart"),ft.prototype._dataFamily="ND",ft.prototype._palette=s.Palette.ordinal("default"),ft.prototype.fillColor=function(t,e,i,n){return this._palette(e)},ft.prototype.strokeColor=function(t,e,i,n){return s.hsl(this.fillColor(t,e,i,n)).darker().toString()},ft.prototype.textColor=function(t,e,i,n){return s.Palette.textColor(this.fillColor(t,e,i,n))},ft.prototype.click=function(t,e,i){},ft.prototype.dblclick=function(t,e,i){},rt(yt,"tip"),rt(_t,"ITooltip"),_t.prototype=Object.create(s.Widget.prototype),_t.prototype.constructor=_t,_t.prototype.tooltipEnter=function(t){const e=this.parentOverlay();e.empty()||this.tooltip.rootElement(e.node().parentNode),t.call(this.tooltip)},_t.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))},_t.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},_t.prototype._tooltipHTML=function(t){return t},_t.prototype.tooltipHTML=function(t){return this.tooltip.html(t)},_t.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>"}},_t.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>`},_t.prototype.publish("tooltipStyle","default","set","Style mode",["default","none","series-table"],{}),_t.prototype.publish("tooltipFollowMouse",!1,"boolean","If true, the tooltip will follow mouse movement",null,{}),_t.prototype.publish("tooltipLabelFormat",void 0,"string","Format of tooltip label(s) (the domain axis)",null,{}),_t.prototype.publish("tooltipValueFormat",void 0,"string","Number format of tooltip value(s)",null,{}),_t.prototype.publish("tooltipSeriesColor","#EAFFFF","html-color","Color of tooltip series text",null,{}),_t.prototype.publish("tooltipLabelColor","#CCFFFF","html-color","Color of tooltip label text (the domain axis)",null,{}),_t.prototype.publish("tooltipValueColor","white","html-color","Color of tooltip value(s)",null,{}),_t.prototype.publish("tooltipTick",!0,"boolean","Show tooltip tick",null,{}),_t.prototype.publish("tooltipOffset",8,"number","Offset from the cursor",null,{});const xt=_t.prototype.tooltipLabelFormat;_t.prototype.tooltipLabelFormat=function(t){const e=xt.apply(this,arguments);return arguments.length&&(this._labelFormatter=s.format(t)),e};const mt=_t.prototype.tooltipValueFormat;function gt(){}L(gt,"_"),_t.prototype.tooltipValueFormat=function(t){const e=mt.apply(this,arguments);return arguments.length&&(this._valueFormatter=s.format(t)),e},rt(gt,"ITree"),gt.prototype.constructor=gt,gt.prototype.click=function(t,e,i){},gt.prototype.dblclick=function(t,e,i){},gt.prototype._palette=s.Palette.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 bt=Object.defineProperty,vt=L((t,e)=>bt(t,"name",{value:e,configurable:!0}),"e"),wt=L((t,e,i)=>{return a=i,(o=e+"")in(n=t)?bt(n,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[o]=a;var n,o,a},"i"),St=Math.PI,kt=2*St,At=1e-6,Ct=kt-At;function Mt(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function Tt(){return new Mt}function Pt(t){return vt(function(){return t},"constant")}L(Mt,"et"),L(Tt,"it"),L(Pt,"nt"),vt(Mt,"Path"),vt(Tt,"path"),Mt.prototype=Tt.prototype={constructor:Mt,moveTo:vt(function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},"moveTo"),closePath:vt(function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},"closePath"),lineTo:vt(function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},"lineTo"),quadraticCurveTo:vt(function(t,e,i,n){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+n)},"quadraticCurveTo"),bezierCurveTo:vt(function(t,e,i,n,o,a){this._+="C"+ +t+","+ +e+","+ +i+","+ +n+","+(this._x1=+o)+","+(this._y1=+a)},"bezierCurveTo"),arcTo:vt(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>At)if(Math.abs(c*r-l*h)>At&&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((St-Math.acos((f+u-y)/(2*_*x)))/2),g=m/x,b=m/_;Math.abs(g-1)>At&&(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:vt(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)>At||Math.abs(this._y1-h)>At)&&(this._+="L"+l+","+h),i&&(u<0&&(u=u%kt+kt),u>Ct?this._+="A"+i+","+i+",0,1,"+c+","+(t-s)+","+(e-r)+"A"+i+","+i+",0,1,"+c+","+(this._x1=l)+","+(this._y1=h):u>At&&(this._+="A"+i+","+i+",0,"+ +(u>=St)+","+c+","+(this._x1=t+i*Math.cos(o))+","+(this._y1=e+i*Math.sin(o))))},"arc"),rect:vt(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:vt(function(){return this._},"toString")},vt(Pt,"constant$3");var It=Math.abs,Et=Math.atan2,Ft=Math.cos,Dt=Math.max,Rt=Math.min,zt=Math.sin,Ot=Math.sqrt,jt=1e-12,Lt=Math.PI,Nt=Lt/2,Bt=2*Lt;function Vt(t){return t>1?0:t<-1?Lt:Math.acos(t)}function Ht(t){return t>=1?Nt:t<=-1?-Nt:Math.asin(t)}function Wt(t){return t.innerRadius}function $t(t){return t.outerRadius}function qt(t){return t.startAngle}function Gt(t){return t.endAngle}function Ut(t){return t&&t.padAngle}function Xt(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<jt))return[t+(p=(c*(e-a)-u*(t-o))/p)*l,e+p*h]}function Yt(t,e,i,n,o,a,s){var r=t-i,l=e-n,h=(s?a:-a)/Ot(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)*Ot(Dt(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,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>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 Qt(){var t=Wt,e=$t,i=Pt(0),n=null,o=qt,a=Gt,s=Ut,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-Nt,d=a.apply(this,arguments)-Nt,f=It(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>jt)if(f>Bt-jt)r.moveTo(u*Ft(p),u*zt(p)),r.arc(0,0,u,p,d,!y),c>jt&&(r.moveTo(c*Ft(d),c*zt(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>jt&&(n?+n.apply(this,arguments):Ot(c*c+u*u)),C=Rt(It(u-c)/2,+i.apply(this,arguments)),M=C,T=C;if(A>jt){var P=Ht(A/c*zt(k)),I=Ht(A/u*zt(k));(w-=2*P)>jt?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>jt?(m+=I*=y?1:-1,g-=I):(S=0,m=g=(p+d)/2)}var E=u*Ft(m),F=u*zt(m),D=c*Ft(v),R=c*zt(v);if(C>jt){var z,O=u*Ft(g),j=u*zt(g),L=c*Ft(b),N=c*zt(b);if(f<Lt&&(z=Xt(E,F,L,N,O,j,D,R))){var B=E-z[0],V=F-z[1],H=O-z[0],W=j-z[1],$=1/zt(Vt((B*H+V*W)/(Ot(B*B+V*V)*Ot(H*H+W*W)))/2),q=Ot(z[0]*z[0]+z[1]*z[1]);M=Rt(C,(c-q)/($-1)),T=Rt(C,(u-q)/($+1))}}S>jt?T>jt?(_=Yt(L,N,E,F,u,T,y),x=Yt(O,j,D,R,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,u,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),!y),r.arc(x.cx,x.cy,T,Et(x.y11,x.x11),Et(x.y01,x.x01),!y))):(r.moveTo(E,F),r.arc(0,0,u,m,g,!y)):r.moveTo(E,F),c>jt&&w>jt?M>jt?(_=Yt(D,R,O,j,c,-M,y),x=Yt(E,F,L,N,c,-M,y),r.lineTo(_.cx+_.x01,_.cy+_.y01),M<C?r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,M,Et(_.y01,_.x01),Et(_.y11,_.x11),!y),r.arc(0,0,c,Et(_.cy+_.y11,_.cx+_.x11),Et(x.cy+x.y11,x.cx+x.x11),y),r.arc(x.cx,x.cy,M,Et(x.y11,x.x11),Et(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 L(l,"h"),vt(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-Lt/2;return[Ft(n)*i,zt(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Pt(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:Pt(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function Zt(t){this._context=t}function Jt(t){return new Zt(t)}function Kt(t){return t[0]}function te(t){return t[1]}function ee(){var t=Kt,e=te,i=Pt(!0),n=null,o=Jt,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Tt())),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 L(s,"r"),vt(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Pt(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:Pt(!!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 ie(){var t=Kt,e=null,i=Pt(0),n=te,o=Pt(!0),a=null,s=Jt,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=Tt())),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 ee().defined(o).curve(s).context(a)}return L(l,"h"),L(h,"c"),vt(l,"area"),vt(h,"arealine"),l.x=function(i){return arguments.length?(t="function"==typeof i?i:Pt(+i),e=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+e),l):t},l.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:Pt(+t),l):e},l.y=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),n=null,l):i},l.y0=function(t){return arguments.length?(i="function"==typeof t?t:Pt(+t),l):i},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Pt(+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:Pt(!!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 ne(t,e){return e<t?-1:e>t?1:e>=t?0:NaN}function oe(t){return t}function ae(){var t=oe,e=ne,i=null,n=Pt(0),o=Pt(Bt),a=Pt(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(Bt,Math.max(-Bt,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 L(s,"r"),vt(s,"pie"),s.value=function(e){return arguments.length?(t="function"==typeof e?e:Pt(+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:Pt(+t),s):n},s.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Pt(+t),s):o},s.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Pt(+t),s):a},s}function se(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 re(t){this._context=t}function le(t){return new re(t)}function he(t,e){this._basis=new re(t),this._beta=e}L(Vt,"yt"),L(Ht,"_t"),L(Wt,"xt"),L($t,"mt"),L(qt,"gt"),L(Gt,"bt"),L(Ut,"vt"),L(Xt,"wt"),L(Yt,"St"),L(Qt,"At"),L(Zt,"kt"),L(Jt,"Mt"),L(Kt,"Pt"),L(te,"Tt"),L(ee,"Ct"),L(ie,"zt"),L(ne,"Ft"),L(oe,"It"),L(ae,"Et"),L(se,"Rt"),L(re,"Dt"),L(le,"Ot"),L(he,"jt"),vt(Vt,"acos"),vt(Ht,"asin$1"),vt(Wt,"arcInnerRadius$1"),vt($t,"arcOuterRadius$1"),vt(qt,"arcStartAngle$1"),vt(Gt,"arcEndAngle$1"),vt(Ut,"arcPadAngle$1"),vt(Xt,"intersect$1"),vt(Yt,"cornerTangents$1"),vt(Qt,"d3Arc"),vt(Zt,"Linear$1"),Zt.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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")},vt(Jt,"d3CurveLinear"),vt(Kt,"x$1"),vt(te,"y$1"),vt(ee,"d3Line"),vt(ie,"d3Area"),vt(ne,"descending"),vt(oe,"identity$2"),vt(ae,"d3Pie"),vt(se,"point$7"),vt(re,"Basis$1"),re.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:se(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:vt(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:se(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(le,"d3CurveBasis"),vt(he,"Bundle$1"),he.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(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:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")};const ce=vt(L(function t(e){function i(t){return 1===e?new re(t):new he(t,e)}return L(i,"n"),vt(i,"bundle"),i.beta=function(e){return t(+e)},i},"t"),"custom")(.85);function ue(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 pe(t,e){this._context=t,this._k=(1-e)/6}L(ue,"Lt"),L(pe,"Bt"),vt(ue,"point$6"),vt(pe,"Cardinal$1"),pe.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:ue(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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:ue(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 de=vt(L(function t(e){function i(t){return new pe(t,e)}return L(i,"n"),vt(i,"cardinal"),i.tension=function(e){return t(+e)},i},"t"),"custom")(0);function fe(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>jt){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>jt){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 ye(t,e){this._context=t,this._alpha=e}L(fe,"Ht"),L(ye,"Vt"),vt(fe,"point$5"),vt(ye,"CatmullRom$1"),ye.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(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:vt(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:vt(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:fe(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 _e=vt(L(function t(e){function i(t){return e?new ye(t,e):new pe(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function xe(t){return t<0?-1:1}function me(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(xe(a)+xe(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function ge(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function be(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 ve(t){this._context=t}function we(t){return new ve(t)}function Se(t){this._context=t}function ke(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 Ae(t){return new Se(t)}function Ce(t,e){this._context=t,this._t=e}function Me(t){return new Ce(t,.5)}function Te(t){return new Ce(t,0)}function Pe(t){return new Ce(t,1)}L(xe,"Wt"),L(me,"Gt"),L(ge,"Xt"),L(be,"Yt"),L(ve,"Ut"),L(we,"Qt"),L(Se,"Zt"),L(ke,"Jt"),L(Ae,"Kt"),L(Ce,"te"),L(Me,"ee"),L(Te,"ie"),L(Pe,"ne"),vt(xe,"sign$1"),vt(me,"slope3$1"),vt(ge,"slope2$1"),vt(be,"point$4"),vt(ve,"MonotoneX$1"),ve.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:be(this,this._t0,ge(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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,be(this,ge(this,i=me(this,t,e)),i);break;default:be(this,this._t0,i=me(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(ve.prototype).point=function(t,e){ve.prototype.point.call(this,e,t)},vt(we,"monotoneX"),vt(Se,"Natural"),Se.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=[],this._y=[]},"lineStart"),lineEnd:vt(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=ke(t),o=ke(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:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(ke,"controlPoints"),vt(Ae,"d3CurveNatural"),vt(Ce,"Step$1"),Ce.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x=this._y=NaN,this._point=0},"lineStart"),lineEnd:vt(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:vt(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")},vt(Me,"d3CurveStep"),vt(Te,"stepBefore"),vt(Pe,"stepAfter");var Ie=Array.prototype.slice;function Ee(t){return t}L(Ee,"ae"),vt(Ee,"identity$1");var Fe=1e-6;function De(t){return"translate("+(t+.5)+",0)"}function Re(t){return"translate(0,"+(t+.5)+")"}function ze(t){return function(e){return+t(e)}}function Oe(t){var e=Math.max(0,t.bandwidth()-1)/2;return t.round()&&(e=Math.round(e)),function(i){return+t(i)+e}}function je(){return!this.__axis}function Le(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?De:Re;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):Ee:o,f=Math.max(a,0)+r,y=e.range(),_=+y[0]+.5,x=+y[y.length-1]+.5,m=(e.bandwidth?Oe:ze)(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",Fe).attr("transform",function(t){return isFinite(t=m(t))?c(t):this.getAttribute("transform")}),S.attr("opacity",Fe).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(je).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 L(u,"p"),vt(u,"axis"),u.scale=function(t){return arguments.length?(e=t,u):e},u.ticks=function(){return i=Ie.call(arguments),u},u.tickArguments=function(t){return arguments.length?(i=null==t?[]:Ie.call(t),u):i.slice()},u.tickValues=function(t){return arguments.length?(n=null==t?null:Ie.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 Ne(t){return Le(1,t)}function Be(t){return Le(2,t)}function Ve(t){return Le(3,t)}function He(t){return Le(4,t)}L(De,"re"),L(Re,"le"),L(ze,"he"),L(Oe,"ce"),L(je,"ue"),L(Le,"pe"),L(Ne,"de"),L(Be,"fe"),L(Ve,"ye"),L(He,"_e"),vt(De,"translateX"),vt(Re,"translateY"),vt(ze,"number"),vt(Oe,"center"),vt(je,"entering"),vt(Le,"axis"),vt(Ne,"axisTop"),vt(Be,"axisRight"),vt(Ve,"axisBottom"),vt(He,"axisLeft");const We=(u=class extends s.SVGWidget{_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=s.select(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=s.scaleBand().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=s.scaleLinear(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?s.format(this.tickFormat()):null;break;case"pow":this.d3Scale=s.scalePow().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?s.format(this.tickFormat()):null;break;case"log":this.d3Scale=s.scaleLog().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?s.format(this.tickFormat()):null;break;case"time":this.d3Scale=s.scaleTime(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?s.timeParse(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?s.timeFormat(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?s.timeFormat(this.tickFormat()):null}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case"left":this.d3Axis=He(this.d3Scale),this.d3Guides=He(this.d3Scale);break;case"top":this.d3Axis=Ne(this.d3Scale),this.d3Guides=Ne(this.d3Scale);break;case"right":this.d3Axis=Be(this.d3Scale),this.d3Guides=Be(this.d3Scale);break;default:this.d3Axis=Ve(this.d3Scale),this.d3Guides=Ve(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,r=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()&&r.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if("wrap"===this.overlapMode())"ordinal"===this.type()&&r.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(i?this.overlapMode():"none"){case"stagger":r.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":r.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){r.each(function(){const e=s.select(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:r.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=s.select(this),o=t.text().split(i).reverse();let a=[],r=0;const l=t.attr("x"),h=t.attr("y"),c=parseFloat(t.style("font-size"))||10,u=Math.floor(e/(1.1*c))-1,p=n.isHorizontal()?1:Math.ceil(o.length/u),d=parseFloat(t.attr("dy"));let f=t.text(null).append("tspan").attr("x",l).attr("y",h).attr("dy",d+"em"),y=0,_=o.pop();for(;_;)a.push(_),f.text(a.join(" ")),y++,f.node().getComputedTextLength()>e&&y>=p&&(a.pop(),f.text(a.join(" ")),a=[_],f=t.append("tspan").attr("x",l).attr("y",h).attr("dy",1.1*++r+d+"em").text(_),y=0),_=o.pop();n.isHorizontal()||t.selectAll("tspan").attr("y",-r/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)"})}L(s,"r"),vt(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"))}},L(u,"_Axis"),u);vt(We,"Axis");let $e=We;$e.prototype._class+=" chart_Axis",$e.prototype.publish("type","linear","set","Type",["none","ordinal","linear","pow","log","time"]),$e.prototype.publish("timePattern","%Y-%m-%d","string","Time Series Pattern",null,{disable:vt(t=>"time"!==t.type(),"disable")}),$e.prototype.publish("reverse",!1,"boolean","Reverse"),$e.prototype.publish("title",null,"string","Title"),$e.prototype.publish("orientation","bottom","set","Placement/orientation of the axis",["left","top","right","bottom"]),$e.prototype.publish("powExponent",2,"number","Power exponent (disabled when type is not 'pow')",null,{disable:vt(t=>"pow"!==t.type(),"disable")}),$e.prototype.publish("logBase",10,"number","Logarithmic base (disabled when type is not 'log')",null,{disable:vt(t=>"log"!==t.type(),"disable")}),$e.prototype.publish("ordinals",[],"array","Array of ordinal values to display (disabled when type is not 'ordinal')",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("fontSize",null,"number","Size of tick label font (pixels)",null,{optional:!0}),$e.prototype.publish("fontFamily",null,"string","Font family of tick labels",null,{optional:!0}),$e.prototype.publish("tickCount",null,"number","Number of ticks to display (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickFormat",null,"string","Format rules for tick text (disabled when type is 'ordinal')",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("tickLength",null,"number","Height (or width for left/right orientations) of the axis ticks (in pixels)",null,{optional:!0}),$e.prototype.publish("ticks",[],"array","Custom tick labels",null,{optional:!0}),$e.prototype.publish("low",null,"any","Minimum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("high",null,"any","Maximum tick value (disabled when type is ordinal)",null,{optional:!0,disable:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("overlapMode","none","set","Specifies the behavior when tick labels overlap",["none","stagger","hide","rotate","linebreak","wrap"]),$e.prototype.publish("labelRotation",33,"number","Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')",null,{optional:!0,disable:vt(t=>"rotate"!==t.overlapMode(),"disable")}),$e.prototype.publish("shrinkToFit","both","set","shrinkToFit",["none","low","high","both"]),$e.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:vt(t=>"ordinal"===t.type(),"disable")}),$e.prototype.publish("hidden",!1,"boolean","Hides axis when 'true'"),$e.prototype.publish("ordinalPaddingInner",.1,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)",null,{disable:vt(t=>"ordinal"!==t.type(),"disable")}),$e.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:vt(t=>"ordinal"!==t.type(),"disable")}),$e.prototype.publish("ordinalMappings",null,"object","Alternative label mappings (icons)",null,{optional:!0}),$e.prototype.publish("padding",0,"number","Padding space at top of axis (pixels)",null,{optional:!0}),$e.prototype._origType=$e.prototype.type,$e.prototype.type=function(t){const e=$e.prototype._origType.apply(this,arguments);return void 0!==t&&(this._type=t,this.updateScale()),e},$e.prototype._origTimePattern=$e.prototype.timePattern,$e.prototype.timePattern=function(t){const e=$e.prototype._origTimePattern.apply(this,arguments);return void 0!==t&&(this._timePattern=t,this.updateScale()),e};const qe=(p=class extends s.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),s.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.domainAxis=(new $e).classed({domain:!0}).orientation_default("bottom").type("ordinal").overlapMode_default("stagger").shrinkToFit_default("high").extend_default(0),this.valueAxis=(new $e).classed({value:!0}).orientation_default("left").type("linear").shrinkToFit_default("high"),this.xyBrush=s.brush().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.xBrush=s.brushX().on("end",()=>this.brushMoved()).on("start.handle brush.handle end.handle",()=>this.brushMoved2()),this.yBrush=s.brushY().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=s.brushSelection(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=s.d3Event()?.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 s.hsl(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 s.hsl(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(s.min(this.parsedData(),function(t){return t[0]})),e=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert(s.max(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(s.min(this.parsedData(),function(t){return s.min(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(s.max(this.parsedData(),function(t){return s.max(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 r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let l=this.height()-this.margin.top-this.margin.bottom;l<0&&(l=0);const h=n?r:l,c=n?l:r;if(this.domainAxis.tickLength(this.xAxisGuideLines()?c:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?h:0).render(),this.svgDataClipRect.attr("width",r).attr("height",l),this.svgData.transition().attr("transform","translate("+this.margin.left+","+this.margin.top+")"),this.updateBrush(r,l,h,n),this.updateFocusChart(t,e,this.margin,r,l,n),this.chartsUpdate(r,l,250),this.selectionMode())return this.brushMoved()}updateBrush(t,e,i,n){const o=this.use2dSelection()?this.xyBrush:n?this.xBrush:this.yBrush,a=s.brushSelection(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 r=this.use2dSelection()?[]:n?[{type:"w"},{type:"e"}]:[{type:"n"},{type:"s"}],l=this.svgBrush.selectAll(".handle--custom").data(r);if(l.enter().append("path").attr("class","handle--custom").merge(l).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=s.brushSelection(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;s.select(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},L(p,"_XYAxis"),p);vt(qe,"XYAxis");let Ge=qe;Ge.prototype._class+=" chart_XYAxis",Ge.prototype.mixin(s.Utility.SimpleSelectionMixin),Ge.prototype.publish("orientation","horizontal","set","Selects orientation for the axis",["horizontal","vertical"]),Ge.prototype.publish("pointSizeColumn",null,"string","pointSizeColumn",null,{optional:!0}),Ge.prototype.publish("minPointSize",6,"number","minPointSize"),Ge.prototype.publish("maxPointSize",26,"number","maxPointSize"),Ge.prototype.publish("use2dSelection",!1,"boolean","2D Range Selector"),Ge.prototype.publish("selectionMode",!1,"boolean","Range Selector"),Ge.prototype.publishProxy("xAxisTitle","domainAxis","title"),Ge.prototype.publishProxy("xAxisTickCount","domainAxis","tickCount"),Ge.prototype.publishProxy("xAxisTickFormat","domainAxis","tickFormat"),Ge.prototype.publishProxy("xAxisTicks","domainAxis","ticks"),Ge.prototype.publishProxy("xAxisType","domainAxis","type"),Ge.prototype.publishProxy("xAxisTypeTimePattern","domainAxis","timePattern"),Ge.prototype.publish("xAxisDomainLow",null,"string","X-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publish("xAxisDomainHigh",null,"string","X-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.xAxisType(),"disable")}),Ge.prototype.publishProxy("xAxisFontSize","domainAxis","fontSize"),Ge.prototype.publishProxy("xAxisFontFamily","domainAxis","fontFamily"),Ge.prototype.publishProxy("xAxisOrdinalPaddingInner","domainAxis","ordinalPaddingInner"),Ge.prototype.publishProxy("xAxisOrdinalPaddingOuter","domainAxis","ordinalPaddingOuter"),Ge.prototype.publishProxy("xAxisOverlapMode","domainAxis","overlapMode"),Ge.prototype.publishProxy("xAxisLabelRotation","domainAxis","labelRotation"),Ge.prototype.publishProxy("xAxisDomainPadding","domainAxis","extend"),Ge.prototype.publish("xAxisGuideLines",!1,"boolean","Y-Axis Guide Lines"),Ge.prototype.publish("xAxisFocus",!1,"boolean","X-Axis Focus",null,{disable:vt(t=>"horizontal"!==t.orientation(),"disable")}),Ge.prototype.publish("xAxisFocusHeight",80,"number","X-Axis Focus Height",null,{disable:vt(t=>!t.xAxisFocus(),"disable")}),Ge.prototype.publishProxy("xAxisHidden","domainAxis","hidden"),Ge.prototype.publishProxy("yAxisFontSize","valueAxis","fontSize"),Ge.prototype.publishProxy("yAxisFontFamily","valueAxis","fontFamily"),Ge.prototype.publishProxy("yAxisTitle","valueAxis","title"),Ge.prototype.publishProxy("yAxisTickCount","valueAxis","tickCount"),Ge.prototype.publishProxy("yAxisTickFormat","valueAxis","tickFormat"),Ge.prototype.publishProxy("yAxisTicks","valueAxis","ticks"),Ge.prototype.publishProxy("yAxisType","valueAxis","type"),Ge.prototype.publishProxy("yAxisTypeTimePattern","valueAxis","timePattern"),Ge.prototype.publishProxy("yAxisTypePowExponent","valueAxis","powExponent"),Ge.prototype.publishProxy("yAxisTypeLogBase","valueAxis","logBase"),Ge.prototype.publish("yAxisStacked",!1,"boolean","Stacked Chart",null,{tags:["Basic"],disable:vt(t=>"ordinal"!==t.xAxisType()||t._class.indexOf("chart_Column")<0,"disable")}),Ge.prototype.publish("yAxisDomainLow",null,"string","Y-Axis Low",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publish("yAxisDomainHigh",null,"string","Y-Axis High",null,{optional:!0,disable:vt(t=>"ordinal"===t.yAxisType(),"disable")}),Ge.prototype.publishProxy("yAxisDomainPadding","valueAxis","extend"),Ge.prototype.publish("yAxisGuideLines",!0,"boolean","Y-Axis Guide Lines"),Ge.prototype.publishProxy("yAxisHidden","valueAxis","hidden"),Ge.prototype.publish("regions",[],"array","Regions"),Ge.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1}),Ge.prototype.publishProxy("xAxisPadding","domainAxis","padding"),Ge.prototype.publishProxy("yAxisPadding","valueAxis","padding"),Ge.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const Ue=(d=class extends Ge{constructor(){super(),ft.call(this),_t.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 Jt;case"step":return Me;case"step-before":return Te;case"step-after":return Pe;case"basis":return le;case"bundle":return ce;case"cardinal":return de;case"catmullRom":return _e;case"natural":return Ae;default:return we}}getScale(){switch(this.pointSizeScale()){case"linear":return s.scaleLinear();case"pow":return s.scalePow().exponent(2);case"log":return s.scaleLog();case"sqrt":return s.scaleSqrt()}}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 r(t){switch(t){case"rectangle":return"rect";case"circle":return"circle";case"cross":return"path"}}let l,h,c;L(r,"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()),vt(r,"mapShape"),this.pointSizeColumn_exists()&&(l=this.columns().indexOf(this.pointSizeColumn()),h=s.extent(this.data(),t=>t[l]),c=this.getScale().domain(h));const u=this.layerColumns(t),p=this.layerData(t),d=this.flattenData(u,p).map(function(t){return t.shape=r(a.pointShape()),t.column=u[t.colIdx],t.row=p[t.rowIdx],t.origRow=p[t.rowIdx].__hpcc_origRow,h?(t.size=c(t.row[l])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),t.column!==a.pointSizeColumn()&&t):(t.size=a.pointSize(),t)}).filter(t=>t),f=e.selectAll(".area").data(u.filter(function(t,e){return a.interpolate()&&a.interpolateFill()&&e>0})),y=f.enter().append("path"),_=ie().curve(this.curve());n?_.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(function(e){return a.yPos(t,e)}).x0(Math.max(0,this.xPos(t,{value:0}))).x1(function(e){return a.xPos(t,e)}),y.merge(f).attr("class",t=>"area series series-"+this.cssTag(t)).each(function(t,e){s.select(this).attr("d",_(d.filter(function(t){return t.colIdx===e+1}))).style("opacity",a.interpolateFillOpacity()).style("stroke","none").style("fill",a.areaColor([],t,void 0,[]))}),f.exit().remove();const x=e.selectAll(".line").data(u.filter(function(t,e){return a.interpolate()&&e>0})),m=x.enter().append("path"),g=ee().x(function(e){return a.xPos(t,e)}).y(function(e){return a.yPos(t,e)}).curve(this.curve());m.merge(x).attr("class",t=>"line series series-"+this.cssTag(t)).each(function(t,e){const i=s.select(this),n=d.filter(function(t){return t.colIdx===e+1});i.attr("d",g(n)).style("stroke",a.lineColor([],t,void 0,[])).style("fill","none")}),x.exit().remove();const b=e.selectAll(".point").data(d,function(t,e){return t.shape+"_"+e});b.enter().append("g").each(function(e){const i=s.select(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=s.d3Event();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}})}).merge(b).attr("class",t=>"point series series-"+this.cssTag(t.column)).each(function(e){s.select(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}),s.select(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=s.select(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))}}),b.exit().remove()}exit(t,e){super.exit(t,e)}},L(d,"_Scatter"),d);vt(Ue,"Scatter"),wt(Ue,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number",multi:!0}]);let Xe=Ue;Xe.prototype._class+=" chart_Scatter",Xe.prototype.implements(ft.prototype),Xe.prototype.implements(_t.prototype),Xe.prototype.publish("paletteID","default","set","Color palette for this widget",Xe.prototype._palette.switch(),{tags:["Basic","Shared"]}),Xe.prototype.publish("pointSizeScale","linear","set","pointSizeScale",["linear","pow","log","sqrt"]),Xe.prototype.publish("pointShape","cross","set","Shape of the data points",["circle","rectangle","cross"]),Xe.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),Xe.prototype.publish("interpolate","","set","Interpolate Data",["","linear","step","step-before","step-after","basis","bundle","cardinal","catmullRom","natural","monotone"]),Xe.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:vt(t=>!t.interpolate(),"disable")}),Xe.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:vt(t=>!t.interpolateFill(),"disable")}),Xe.prototype.publish("interpolateFill",!1,"boolean","If true, the area between the line and zero will be filled"),Xe.prototype.publish("interpolateFillOpacity",.66,"number","Fill interpolation Opacity",null,{range:{min:0,step:.01,max:1}}),Xe.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Xe.prototype.publish("showValue",!1,"boolean"),Xe.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Xe.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 Ye=(L(f=class extends Xe{constructor(){super(),this.interpolate_default("linear").interpolateFill_default(!0)}},"_Area"),f);vt(Ye,"Area"),Ye.prototype._class+=" chart_Area";const Qe=(y=class extends Ge{_linearGap;textLocal=s.local();stackedTextLocal=s.local();isHorizontal;constructor(){super(),ft.call(this),_t.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=s.format(o.showValueAsPercentFormat());let r=10,l=0;switch(t.xAxisType()){case"ordinal":r=t.bandwidth(),l=-r/2;break;case"linear":case"time":r=Math.max(Math.abs(t.dataPos(2)-t.dataPos(1))*(100-this._linearGap)/100,r),l=-r/2}this.tooltip.direction(n?"n":"e");const h=s.scaleBand().domain(o.layerColumns(t).filter(function(t,e){return e>0})).rangeRound(n?[0,r]:[r,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0);let c=[];const u=[],p=this.columns().length,d=this.data();this.showValue()&&"series"===this.showValueAsPercent()&&d.forEach(t=>{t.filter((t,e)=>e>0&&e<p).forEach((t,e)=>{void 0===u[e+1]&&(u[e+1]=0),u[e+1]+=t})}),(this.showDomainTotal()||this.showValue()&&"domain"===this.showValueAsPercent())&&(c=d.map(t=>t.filter((t,e)=>e>0&&e<p).reduce((t,e)=>t+e,0)));const f=e.selectAll(".dataRow").data(this.adjustedData(t)),y=t.data(),_=this.getAxisSize(t);f.enter().append("g").attr("class","dataRow").merge(f).each(function(e,d){const f=s.select(this),x=f.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:y[d],value:i,idx:n}}).filter(function(t){return null!==t.value&&t.idx>0}),t=>t.column),m=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=s.d3Event();"Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),t._selection.click(this))}}).style("opacity",0).each(function(t){const e=s.select(this);e.append("rect").attr("class","columnRect series series-"+o.cssTag(t.column)),e.append("text").attr("class","columnRectText").style("stroke","transparent")});m.transition().duration(i).style("opacity",1);const g=t.yAxisStacked()?r:h.bandwidth();m.merge(x).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(r){const f=s.select(this),y=t.dataPos(e[0])+(t.yAxisStacked()?0:h(r.column))+l,x=r.value instanceof Array?r.value[1]:r.value;let m=r.origRow[r.idx];if(o.showValue()){const t=o.dataMeta();switch(o.showValueAsPercent()){case"series":const e=void 0!==t.sum?t.sum:u[r.idx];m=a(m/e);break;case"domain":const i=void 0!==t.sum?t.sum:c[d];m=a(m/i);break;default:m=s.format(o.showValueFormat())(m)}}const b=t.valuePos(x),v=t.valuePos(r.value instanceof Array?r.value[0]:0),w=Math.min(v,b),S=Math.abs(b-v),k=o.innerTextFontSize(),A=o.innerTextPadding_exists()?o.innerTextPadding():k/2.5,C=o.intersectRectRect({x:n?y:w,y:n?w:y,width:n?g:S,height:n?S:g},{x:0,y:0,width:_.width,height:_.height}),M=f.select("rect").transition().duration(i).style("fill",t=>o.fillColor(t.row,t.column,t.value,t.origRow));n?M.attr("x",y).attr("y",w).attr("width",g).attr("height",S):M.attr("y",y).attr("x",w).attr("height",g).attr("width",S);const T=f.select("text").transition().duration(i).style("font-size",k+"px").style("fill",t=>o.textColor(t.row,t.column,t.value,t.origRow));T.style("font-family",o.innerTextFontFamily_exists()?o.innerTextFontFamily():null);const P=o.innerTextPadding_exists()?o.innerTextPadding():8,I=k/2.7;if(n){const t=C.y+C.height-A;T.attr("x",y+g/2).attr("y",t+I).attr("transform",`rotate(-90, ${y+g/2}, ${t})`)}else T.attr("x",C.x+P).attr("y",y+g/2+I);T.attr("height",g).attr("width",S),o.showInnerText()&&T.text(t=>{const e=o.innerText(t.origRow,t.origRow[p],t.idx);if(e){const i=n?C.height:C.width,a=o.calcInnerText(i,e,m);return t.innerTextObj=a,a.text}return""});const E=f.selectAll(".dataText").data(o.showValue()?[`${x}`]:[]);E.enter().append("g").attr("class","dataText").each(function(t){o.textLocal.set(this,(new s.Text).target(this).colorStroke_default("transparent"))}).merge(E).each(function(){const t={x:0,y:0},e=o.valueFontFamily(),i=o.valueFontSize(),a=o.textSize(m,e,i),s=parseFloat(m)>=0;let l=o.valueAnchor()?o.valueAnchor():n?"middle":"start";const h=C.x,c=_.width-(C.x+C.width),u=C.y,p=_.height-(C.y+C.height);let d,f,x;if(r.innerTextObj){const{padding:e,valueTextWidth:o}=r.innerTextObj;f=!1,n?(l="middle",t.x=y+g/2,4===r.innerTextObj.category?(f=!0,t.y=w-e-i/2):t.y=w+e+i/2):(l="start",4===r.innerTextObj.category?(f=!0,t.x=S+w+e):t.x=S+w-o-e,t.y=y+g/2)}else n?(d=C.height<a.height,f=!o.valueCentered()||d,t.x=C.x+C.width/2,f?s?(x=u<a.height+P,x?d?t.y=C.y+C.height+a.height:(f=!1,t.y=C.y+C.height/2):t.y=C.y-a.height/2-P):(x=p<a.height,x?d?t.y=C.y-a.height/2-P:(f=!1,t.y=C.y+C.height/2):t.y=C.y+a.height+P):t.y=C.y+C.height/2):(d=C.width<a.width,f=!o.valueCentered()||d,t.y=C.y+C.height/2,f?s?(x=c<a.width+P,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x-(a.width-P):t.x=C.x+C.width+a.width/2+P):(x=h<a.width,x?o.showInnerText()||!d?(f=!1,t.x=C.x+C.width/2):t.x=C.x+C.width+(a.width-P):t.x=C.x-(a.width-P)):t.x=C.x+C.width/2);const b=f?null:o.textColor(r.row,r.column,r.value,r.origRow),v=o.columns(),k=o.yAxisStacked()&&d||f&&o.yAxisStacked()&&v.indexOf(r.column)!==v.length-1;o.textLocal.get(this).pos(t).anchor(l).fontFamily(e).fontSize(i).text(`${m}`).colorFill(b).visible(o.showValue()&&!k).render()}),E.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),x.exit().transition().duration(i).style("opacity",0).remove();const b=t.yAxisStacked()?c[d]:Math.max(...e.filter((t,e)=>e>0&&e<p)),v=f.selectAll(".stackedTotalText").data(o.showDomainTotal()?[c[d]]:[]);v.enter().append("g").attr("class","stackedTotalText").each(function(t){o.stackedTextLocal.set(this,(new s.Text).target(this).colorStroke_default("transparent"))}).merge(v).each(function(i){const a={x:0,y:0},s=t.dataPos(e[0]),r=t.valuePos(b),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()}),v.exit().each(function(t){o.textLocal.get(this).target(null)}).remove()}),f.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]}},L(y,"_Column"),y);vt(Qe,"Column"),wt(Qe,"__inputs",[{id:"label",type:"string"},{id:"values",type:"number",multi:!0}]);let Ze=Qe;Ze.prototype._class+=" chart_Column",Ze.prototype.implements(ft.prototype),Ze.prototype.implements(_t.prototype),Ze.prototype.publish("valueFontFamily",null,"string","Font family of value text",null,{optional:!0}),Ze.prototype.publish("valueFontSize",12,"number","Height of value text (pixels)"),Ze.prototype.publish("innerTextFontFamily",null,"string","Font family of inner text",null,{optional:!0}),Ze.prototype.publish("innerTextPadding",8,"number","Offset of inner text (pixels)",null,{optional:!0}),Ze.prototype.publish("innerTextFontSize",12,"number","Height of inner text (pixels)"),Ze.prototype.publish("paletteID","default","set","Color palette for this widget",()=>Ze.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ze.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ze.prototype.publish("showValue",!1,"boolean","Show Value in column"),Ze.prototype.publish("showInnerText",!1,"boolean","Show Label in column"),Ze.prototype.publish("showValueFormat",",","string","D3 Format for Value",null,{disable:vt(t=>!t.showValue()||!!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showValueAsPercent",null,"set","If showValue is true, optionally show value as a percentage by Series or Domain",[null,"series","domain"],{disable:vt(t=>!t.showValue(),"disable"),optional:!0}),Ze.prototype.publish("showValueAsPercentFormat",".0%","string","D3 Format for %",null,{disable:vt(t=>!t.showValue()||!t.showValueAsPercent(),"disable")}),Ze.prototype.publish("showDomainTotal",!1,"boolean","Show Total Value for Stacked Columns",null),Ze.prototype.publish("valueCentered",!1,"boolean","Show Value in center of column"),Ze.prototype.publish("valueAnchor","middle","set","text-anchor for shown value text",["start","middle","end"]),Ze.prototype.publish("xAxisSeriesPaddingInner",0,"number","Determines the ratio of the range that is reserved for blank space between band (0->1)"),Ze.prototype.publish("tooltipInnerTextEllipsedOnly",!1,"boolean","Show tooltip only when inner text is truncated with an ellipsis");const Je=(L(_=class extends Ze{constructor(){super(),this.orientation_default("vertical")}},"_Bar"),_);vt(Je,"Bar");let Ke=Je;function ti(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 ei(){return this.eachAfter(ti)}function ii(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 ni(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 oi(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 ai(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 si(t){return this.eachBefore(function(e){e.children&&e.children.sort(t)})}function ri(t){for(var e=this,i=li(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 li(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 hi(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e}function ci(){var t=[];return this.each(function(e){t.push(e)}),t}function ui(){var t=[];return this.eachBefore(function(e){e.children||t.push(e)}),t}function pi(){var t=this,e=[];return t.each(function(i){i!==t&&e.push({source:i.parent,target:i})}),e}function di(t,e){var i,n,o,a,s,r=new mi(t),l=+t.value&&(r.value=t.value),h=[r];for(null==e&&(e=yi);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 mi(o[a])),n.parent=i,n.depth=i.depth+1;return r.eachBefore(xi)}function fi(){return di(this).eachBefore(_i)}function yi(t){return t.children}function _i(t){t.data=t.data.data}function xi(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function mi(t){this.data=t,this.depth=this.height=0,this.parent=null}L(ti,"Ce"),L(ei,"ze"),L(ii,"Fe"),L(ni,"Ie"),L(oi,"Ee"),L(ai,"Re"),L(si,"De"),L(ri,"Oe"),L(li,"je"),L(hi,"Ne"),L(ci,"Le"),L(ui,"Be"),L(pi,"$e"),L(di,"He"),L(fi,"Ve"),L(yi,"qe"),L(_i,"We"),L(xi,"Ge"),L(mi,"Xe"),Ke.prototype._class+=" chart_Bar",vt(ti,"count"),vt(ei,"node_count"),vt(ii,"node_each"),vt(ni,"node_eachBefore"),vt(oi,"node_eachAfter"),vt(ai,"node_sum"),vt(si,"node_sort"),vt(ri,"node_path"),vt(li,"leastCommonAncestor"),vt(hi,"node_ancestors"),vt(ci,"node_descendants"),vt(ui,"node_leaves"),vt(pi,"node_links"),vt(di,"hierarchy"),vt(fi,"node_copy"),vt(yi,"defaultChildren"),vt(_i,"copyData"),vt(xi,"computeHeight"),vt(mi,"Node$1"),mi.prototype=di.prototype={constructor:mi,count:ei,each:ii,eachAfter:oi,eachBefore:ni,sum:ai,sort:si,path:ri,ancestors:hi,descendants:ci,leaves:ui,links:pi,copy:fi};var gi=Array.prototype.slice;function bi(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 vi(t){for(var e,i,n=0,o=(t=bi(gi.call(t))).length,a=[];n<o;)e=t[n],i&&ki(i,e)?++n:(i=Ci(a=wi(a,e)),n=0);return i}function wi(t,e){var i,n;if(Ai(e,t))return[e];for(i=0;i<t.length;++i)if(Si(e,t[i])&&Ai(Ti(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(Si(Ti(t[i],t[n]),e)&&Si(Ti(t[i],e),t[n])&&Si(Ti(t[n],e),t[i])&&Ai(Pi(t[i],t[n],e),t))return[t[i],t[n],e];throw new Error}function Si(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 ki(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 Ai(t,e){for(var i=0;i<e.length;++i)if(!ki(t,e[i]))return!1;return!0}function Ci(t){switch(t.length){case 1:return Mi(t[0]);case 2:return Ti(t[0],t[1]);case 3:return Pi(t[0],t[1],t[2])}}function Mi(t){return{x:t.x,y:t.y,r:t.r}}function Ti(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 Pi(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),T=w*w+k*k-a*a,P=-(C?(M+Math.sqrt(M*M-4*C*T))/(2*C):T/M);return{x:n+w+S*P,y:o+k+A*P,r:P}}function Ii(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 Ei(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 Fi(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 Di(t){this._=t,this.next=null,this.previous=null}function Ri(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;Ii(i,e,n=t[2]),e=new Di(e),i=new Di(i),n=new Di(n),e.next=n.previous=i,i.next=e.previous=n,n.next=i.previous=e;t:for(r=3;r<o;++r){Ii(e._,i._,n=t[r]),n=new Di(n),l=i.next,h=e.previous,c=i._.r,u=e._.r;do{if(c<=u){if(Ei(l._,n._)){i=l,e.next=i,i.previous=e,--r;continue t}c+=l._.r,l=l.next}else{if(Ei(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=Fi(e);(n=n.next)!==i;)(s=Fi(n))<a&&(e=n,a=s);i=e.next}for(e=[i._],n=i;(n=n.next)!==i;)e.push(n._);for(n=vi(e),r=0;r<o;++r)(e=t[r]).x-=n.x,e.y-=n.y;return n.r}function zi(t){return null==t?null:Oi(t)}function Oi(t){if("function"!=typeof t)throw new Error;return t}function ji(){return 0}function Li(t){return function(){return t}}function Ni(t){return Math.sqrt(t.value)}function Bi(){var t=null,e=1,i=1,n=ji;function o(o){return o.x=e/2,o.y=i/2,t?o.eachBefore(Vi(t)).eachAfter(Hi(n,.5)).eachBefore(Wi(1)):o.eachBefore(Vi(Ni)).eachAfter(Hi(ji,1)).eachAfter(Hi(n,o.r/Math.min(e,i))).eachBefore(Wi(Math.min(e,i)/(2*o.r))),o}return L(o,"a"),vt(o,"pack"),o.radius=function(e){return arguments.length?(t=zi(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:Li(+t),o):n},o}function Vi(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function Hi(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=Ri(n),r)for(o=0;o<s;++o)n[o].r-=r;i.r=a+r}}}function Wi(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)}}L(bi,"Ue"),L(vi,"Qe"),L(wi,"Ze"),L(Si,"Je"),L(ki,"Ke"),L(Ai,"ti"),L(Ci,"ei"),L(Mi,"ii"),L(Ti,"ni"),L(Pi,"oi"),L(Ii,"ai"),L(Ei,"si"),L(Fi,"ri"),L(Di,"li"),L(Ri,"hi"),L(zi,"ci"),L(Oi,"ui"),L(ji,"pi"),L(Li,"di"),L(Ni,"fi"),L(Bi,"yi"),L(Vi,"_i"),L(Hi,"xi"),L(Wi,"mi"),vt(bi,"shuffle"),vt(vi,"enclose"),vt(wi,"extendBasis"),vt(Si,"enclosesNot"),vt(ki,"enclosesWeak"),vt(Ai,"enclosesWeakAll"),vt(Ci,"encloseBasis"),vt(Mi,"encloseBasis1"),vt(Ti,"encloseBasis2"),vt(Pi,"encloseBasis3"),vt(Ii,"place"),vt(Ei,"intersects"),vt(Fi,"score"),vt(Di,"Node"),vt(Ri,"packEnclose"),vt(zi,"optional"),vt(Oi,"required"),vt(ji,"constantZero"),vt(Li,"constant$2"),vt(Ni,"defaultRadius"),vt(Bi,"d3Pack"),vt(Vi,"radiusLeaf"),vt(Hi,"packChildren"),vt(Wi,"translateChild");const $i=(x=class extends s.SVGWidget{labelWidgets;d3Pack;constructor(){super(),ht.call(this),_t.call(this),s.Utility.SimpleSelectionMixin.call(this),this._drawStartPos="origin",this.labelWidgets={},this.d3Pack=Bi().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=di({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=s.select(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 s.FAChar).char(t.__viz_faChar).target(this).render():i.labelWidgets[t.data[0]]=(new s.Text).text(t.data[0]).target(this).render()}).merge(o).transition().attr("opacity",1).each(function(t){const e=s.select(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)}},L(x,"_Bubble"),x);vt($i,"Bubble"),wt($i,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let qi=$i;qi.prototype._class+=" chart_Bubble",qi.prototype.implements(ht.prototype),qi.prototype.implements(_t.prototype),qi.prototype.mixin(s.Utility.SimpleSelectionMixin),qi.prototype.publish("paletteID","default","set","Color palette for this widget",qi.prototype._palette.switch(),{tags:["Basic","Shared"]}),qi.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]});const Gi=(L(m=class extends Xe{constructor(){super()}enter(t,e){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(t,e)}},"_BubbleXY"),m);vt(Gi,"BubbleXY"),Gi.prototype._class+=" chart_BubbleXY";var Ui,Xi,Yi=0,Qi=0,Zi=0,Ji=0,Ki=0,tn=0,en="object"==typeof performance&&performance.now?performance:Date,nn="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function on(){return Ki||(nn(an),Ki=en.now()+tn)}function an(){Ki=0}function sn(){this._call=this._time=this._next=null}function rn(){on(),++Yi;for(var t,e=Ui;e;)(t=Ki-e._time)>=0&&e._call.call(null,t),e=e._next;--Yi}function ln(){Ki=(Ji=en.now())+tn,Yi=Qi=0;try{rn()}finally{Yi=0,cn(),Ki=0}}function hn(){var t=en.now(),e=t-Ji;e>1e3&&(tn-=e,Ji=t)}function cn(){for(var t,e,i=Ui,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:Ui=e);Xi=t,un(n)}function un(t){Yi||(Qi&&(Qi=clearTimeout(Qi)),t-Ki>24?(t<1/0&&(Qi=setTimeout(ln,t-en.now()-tn)),Zi&&(Zi=clearInterval(Zi))):(Zi||(Ji=en.now(),Zi=setInterval(hn,1e3)),Yi=1,nn(ln)))}function pn(){var t="left",e=!1,i=!1,n=dn,o=fn,a=yn,r=380,l=30,h=He();function c(t){t.each(function(t,c){var u,p,d=n.call(this,t,c).slice().sort(s.descending),f=o.call(this,t,c).slice().sort(s.descending),y=a.call(this,t,c).slice().sort(s.descending),_=s.select(this),x=_.select("g.wrap");x.empty()&&(x=_.append("g").attr("class","wrap")),i?(u=l,p=r,x.attr("transform","rotate(90)translate(0,"+-r+")")):(u=r,p=l,x.attr("transform",null));var m=s.scaleLinear().domain([0,Math.max(d[0],f[0],y[0])]).range(e?[u,0]:[0,u]),g=this.__chart__||s.scaleLinear().domain([0,1/0]).range(m.range());this.__chart__=m;var b=_n(g),v=_n(m),w=x.selectAll("rect.range").data(d);w.enter().append("rect").attr("class",function(t,e){return"range s"+e}).attr("width",b).attr("height",p).attr("x",e?g:0).merge(w).transition(w).attr("x",e?m:0).attr("width",v).attr("height",p);var S=x.selectAll("rect.measure").data(y);S.enter().append("rect").attr("class",function(t,e){return"measure s"+e}).attr("width",b).attr("height",p/3).attr("x",e?g:0).attr("y",p/3).merge(S).transition(S).attr("width",v).attr("height",p/3).attr("x",e?m:0).attr("y",p/3);var k=x.selectAll("line.marker").data(f);k.enter().append("line").attr("class","marker").attr("x1",g).attr("x2",g).attr("y1",p/6).attr("y2",5*p/6).merge(k).transition(k).attr("x1",m).attr("x2",m).attr("y1",p/6).attr("y2",5*p/6);var A=_.selectAll("g.axis").data([0]);A.enter().append("g").attr("class","axis"),A.attr("transform",i?null:"translate(0,"+p+")").call(h.scale(m))}),rn()}return L(c,"u"),vt(c,"bulvar"),c.orient=function(n){return arguments.length?(e="right"==(t=n+"")||"bottom"===t,h.orient((i="top"===t||"bottom"===t)?"left":"bottom"),c):t},c.ranges=function(t){return arguments.length?(n=t,c):n},c.markers=function(t){return arguments.length?(o=t,c):o},c.measures=function(t){return arguments.length?(a=t,c):a},c.width=function(t){return arguments.length?(r=+t,c):r},c.height=function(t){return arguments.length?(l=+t,c):l},c.tickFormat=function(t){return arguments.length?(h.tickFormat(t),c):h.tickFormat()},c}function dn(t){return t.ranges}function fn(t){return t.markers}function yn(t){return t.measures}function _n(t){var e=t(0);return function(i){return Math.abs(t(i)-e)}}L(on,"Ei"),L(an,"Ri"),L(sn,"Di"),L(rn,"Oi"),L(ln,"ji"),L(hn,"Ni"),L(cn,"Li"),L(un,"Bi"),L(pn,"$i"),L(dn,"Hi"),L(fn,"Vi"),L(yn,"qi"),L(_n,"Wi"),vt(on,"now"),vt(an,"clearNow"),vt(sn,"Timer"),sn.prototype={constructor:sn,restart:vt(function(t,e,i){if("function"!=typeof t)throw new TypeError("callback is not a function");i=(null==i?on():+i)+(null==e?0:+e),this._next||Xi===this||(Xi?Xi._next=this:Ui=this,Xi=this),this._call=t,this._time=i,un()},"restart"),stop:vt(function(){this._call&&(this._call=null,this._time=1/0,un())},"stop")},vt(rn,"timerFlush"),vt(ln,"wake"),vt(hn,"poke"),vt(cn,"nap"),vt(un,"sleep"),vt(pn,"d3Bullet"),vt(dn,"bulvarRanges"),vt(fn,"bulvarMarkers"),vt(yn,"bulvarMeasures"),vt(_n,"bulvarWidth");const xn=(g=class extends s.HTMLWidget{_hiddenColumns={};constructor(){super(),s.Utility.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),s.select(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=s.select(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),r=a.select(".bulletTitle").style("text-anchor","end").attr("transform","translate(-6,12)");r.select(".title").text(function(t){return t.title}),r.select(".subtitle").text(function(t){return t.subtitle});let l=0;r.each(function(){const t=this.getBBox();t.width>l&&(l=t.width)});const h=pn().width(n-l-6).height(24);a.attr("width",n).attr("height",40).style("margin-left","2px"),a.select(".bulletBar").attr("transform","translate("+(l+6)+",8)").call(h),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},L(g,"_Bullet"),g);vt(xn,"Bullet");let mn=xn;mn.prototype._class+=" chart_Bullet",mn.prototype.publish("titleColumn",null,"set","Title Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("subtitleColumn",null,"set","Subtitle Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("rangesColumn",null,"set","Ranges Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("measuresColumn",null,"set","Measures Column",function(){return this.columns()},{optional:!0}),mn.prototype.publish("markersColumn",null,"set","Markers Column",function(){return this.columns()},{optional:!0});var gn=Array.prototype.slice;function bn(t,e){return t-e}function vn(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 wn(t){return function(){return t}}function Sn(t,e){for(var i,n=-1,o=e.length;++n<o;)if(i=kn(t,e[n]))return i;return 0}function kn(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(An(l,u,e))return 0;c>n!=d>n&&i<(p-h)*(n-c)/(d-c)+h&&(o=-o)}return o}function An(t,e,i){var n;return Cn(t,e,i)&&Mn(t[n=+(t[0]===e[0])],i[n],e[n])}function Cn(t,e,i){return(e[0]-t[0])*(i[1]-t[1])===(i[0]-t[0])*(e[1]-t[1])}function Mn(t,e,i){return t<=e&&e<=i||i<=e&&e<=t}function Tn(){}L(bn,"Ui"),L(vn,"Qi"),L(wn,"Zi"),L(Sn,"Ji"),L(kn,"Ki"),L(An,"tn"),L(Cn,"en"),L(Mn,"nn"),L(Tn,"on"),vt(bn,"ascending"),vt(vn,"area"),vt(wn,"constant$1"),vt(Sn,"contains"),vt(kn,"ringContains"),vt(An,"segmentContains"),vt(Cn,"collinear"),vt(Mn,"within"),vt(Tn,"noop$2");var Pn=[[],[[[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 In(){var t=1,e=1,i=s.thresholdSturges,n=h;function o(t){var e=i(t);if(Array.isArray(e))e=e.slice().sort(bn);else{var n=s.extent(t),o=n[0],r=n[1];e=s.tickStep(o,r,e),e=s.range(Math.floor(o/e)*e,Math.floor(r/e)*e,e)}return e.map(function(e){return a(t,e)})}function a(t,e){var i=[],o=[];return r(t,e,function(a){n(a,t,e),vn(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!==Sn((e=i[n])[0],t))return void e.push(t)}),{type:"MultiPolygon",value:e,coordinates:i}}function r(i,n,o){var a,s,r,h,c,u,p=new Array,d=new Array;for(a=s=-1,h=i[0]>=n,Pn[h<<1].forEach(f);++a<t-1;)r=h,h=i[a+1]>=n,Pn[r|h<<1].forEach(f);for(Pn[0|h].forEach(f);++s<e-1;){for(a=-1,h=i[s*t+t]>=n,c=i[s*t]>=n,Pn[h<<1|c<<2].forEach(f);++a<t-1;)r=h,h=i[s*t+t+a+1]>=n,u=c,c=i[s*t+a+1]>=n,Pn[r|h<<1|c<<2|u<<3].forEach(f);Pn[h|c<<3].forEach(f)}for(a=-1,c=i[s*t]>=n,Pn[c<<2].forEach(f);++a<t-1;)u=c,c=i[s*t+a+1]>=n,Pn[c<<2|u<<3].forEach(f);function f(t){var e,i,n=[t[0][0]+a,t[0][1]+s],r=[t[1][0]+a,t[1][1]+s],h=l(n),c=l(r);(e=d[h])?(i=p[c])?(delete d[e.end],delete p[i.start],e===i?(e.ring.push(r),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(r),d[e.end=c]=e):(e=p[c])?(i=d[h])?(delete p[e.start],delete d[i.end],e===i?(e.ring.push(r),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,r]}}L(f,"y"),Pn[c<<3].forEach(f),vt(f,"stitch")}function l(e){return 2*e[0]+e[1]*(t+1)*4}function h(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 L(o,"a"),L(a,"s"),L(r,"r"),L(l,"l"),L(h,"h"),vt(o,"contours"),vt(a,"contour"),vt(r,"isorings"),vt(l,"index"),vt(h,"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)?wn(gn.call(t)):wn(t),o):i},o.smooth=function(t){return arguments.length?(n=t?h:Tn,o):n===h},o}function En(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 Fn(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 Dn(t){return t[0]}function Rn(t){return t[1]}function zn(){return 1}function On(){var t=Dn,e=Rn,i=zn,n=960,o=500,a=20,r=2,l=3*a,h=n+2*l>>r,c=o+2*l>>r,u=wn(20);function p(n){var o=new Float32Array(h*c),p=new Float32Array(h*c);n.forEach(function(n,a,s){var u=+t(n,a,s)+l>>r,p=+e(n,a,s)+l>>r,d=+i(n,a,s);u>=0&&u<h&&p>=0&&p<c&&(o[u+p*h]+=d)}),En({width:h,height:c,data:o},{data:p},a>>r),Fn({width:h,height:c,data:p},{data:o},a>>r),En({width:h,height:c,data:o},{data:p},a>>r),Fn({width:h,height:c,data:p},{data:o},a>>r),En({width:h,height:c,data:o},{data:p},a>>r),Fn({width:h,height:c,data:p},{data:o},a>>r);var f=u(o);if(!Array.isArray(f)){var y=s.max(o);f=s.tickStep(0,y,f),(f=s.range(0,Math.floor(y/f)*f,f)).shift()}return In().thresholds(f).size([h,c])(o).map(d)}function d(t){return t.value*=Math.pow(2,-2*r),t.coordinates.forEach(f),t}function f(t){t.forEach(y)}function y(t){t.forEach(_)}function _(t){t[0]=t[0]*Math.pow(2,r)-l,t[1]=t[1]*Math.pow(2,r)-l}function x(){return h=n+2*(l=3*a)>>r,c=o+2*l>>r,p}return L(p,"p"),L(d,"d"),L(f,"f"),L(y,"y"),L(_,"_"),L(x,"x"),vt(p,"density"),vt(d,"transform"),vt(f,"transformPolygon"),vt(y,"transformRing"),vt(_,"transformPoint"),vt(x,"resize"),p.x=function(e){return arguments.length?(t="function"==typeof e?e:wn(+e),p):t},p.y=function(t){return arguments.length?(e="function"==typeof t?t:wn(+t),p):e},p.weight=function(t){return arguments.length?(i="function"==typeof t?t:wn(+t),p):i},p.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,x()},p.cellSize=function(t){if(!arguments.length)return 1<<r;if(!((t=+t)>=1))throw new Error("invalid cell size");return r=Math.floor(Math.log(t)/Math.LN2),x()},p.thresholds=function(t){return arguments.length?(u="function"==typeof t?t:Array.isArray(t)?wn(gn.call(t)):wn(t),p):u},p.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),x()},p}function jn(){return new Ln}function Ln(){this.reset()}L(In,"sn"),L(En,"rn"),L(Fn,"ln"),L(Dn,"hn"),L(Rn,"cn"),L(zn,"un"),L(On,"pn"),L(jn,"dn"),L(Ln,"fn"),vt(In,"contours"),vt(En,"blurX"),vt(Fn,"blurY"),vt(Dn,"defaultX"),vt(Rn,"defaultY"),vt(zn,"defaultWeight"),vt(On,"d3ContourDensity"),vt(jn,"adder"),vt(Ln,"Adder"),Ln.prototype={constructor:Ln,reset:vt(function(){this.s=this.t=0},"reset"),add:vt(function(t){Bn(Nn,t,this.t),Bn(this,Nn.s,this.s),this.s?this.t+=Nn.t:this.s=Nn.t},"add"),valueOf:vt(function(){return this.s},"valueOf")};var Nn=new Ln;function Bn(t,e,i){var n=t.s=e+i,o=n-e,a=n-o;t.t=e-a+(i-o)}L(Bn,"_n"),vt(Bn,"add");var Vn=2*Math.PI,Hn=Math.abs,Wn=Math.sqrt;function $n(){}function qn(t,e){t&&Un.hasOwnProperty(t.type)&&Un[t.type](t,e)}L($n,"bn"),L(qn,"vn"),vt($n,"noop$1"),vt(qn,"streamGeometry");var Gn={Feature:vt(function(t,e){qn(t.geometry,e)},"Feature"),FeatureCollection:vt(function(t,e){for(var i=t.features,n=-1,o=i.length;++n<o;)qn(i[n].geometry,e)},"FeatureCollection")},Un={Sphere:vt(function(t,e){e.sphere()},"Sphere"),Point:vt(function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},"Point"),MultiPoint:vt(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:vt(function(t,e){Xn(t.coordinates,e,0)},"LineString"),MultiLineString:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Xn(i[n],e,0)},"MultiLineString"),Polygon:vt(function(t,e){Yn(t.coordinates,e)},"Polygon"),MultiPolygon:vt(function(t,e){for(var i=t.coordinates,n=-1,o=i.length;++n<o;)Yn(i[n],e)},"MultiPolygon"),GeometryCollection:vt(function(t,e){for(var i=t.geometries,n=-1,o=i.length;++n<o;)qn(i[n],e)},"GeometryCollection")};function Xn(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 Yn(t,e){var i=-1,n=t.length;for(e.polygonStart();++i<n;)Xn(t[i],e,1);e.polygonEnd()}function Qn(t,e){t&&Gn.hasOwnProperty(t.type)?Gn[t.type](t,e):qn(t,e)}function Zn(t){return t}L(Xn,"An"),L(Yn,"kn"),L(Qn,"Mn"),L(Zn,"Pn"),vt(Xn,"streamLine"),vt(Yn,"streamPolygon"),vt(Qn,"geoStream"),vt(Zn,"identity");var Jn,Kn,to,eo,io=jn(),no=jn(),oo={point:$n,lineStart:$n,lineEnd:$n,polygonStart:vt(function(){oo.lineStart=ao,oo.lineEnd=lo},"polygonStart"),polygonEnd:vt(function(){oo.lineStart=oo.lineEnd=oo.point=$n,io.add(Hn(no)),no.reset()},"polygonEnd"),result:vt(function(){var t=io/2;return io.reset(),t},"result")};function ao(){oo.point=so}function so(t,e){oo.point=ro,Jn=to=t,Kn=eo=e}function ro(t,e){no.add(eo*t-to*e),to=t,eo=e}function lo(){ro(Jn,Kn)}L(ao,"Dn"),L(so,"On"),L(ro,"jn"),L(lo,"Nn"),vt(ao,"areaRingStart"),vt(so,"areaPointFirst"),vt(ro,"areaPoint"),vt(lo,"areaRingEnd");var ho=1/0,co=ho,uo=-ho,po=uo,fo={point:yo,lineStart:$n,lineEnd:$n,polygonStart:$n,polygonEnd:$n,result:vt(function(){var t=[[ho,co],[uo,po]];return uo=po=-(co=ho=1/0),t},"result")};function yo(t,e){t<ho&&(ho=t),t>uo&&(uo=t),e<co&&(co=e),e>po&&(po=e)}L(yo,"qn"),vt(yo,"boundsPoint");var _o,xo,mo,go,bo=0,vo=0,wo=0,So=0,ko=0,Ao=0,Co=0,Mo=0,To=0,Po={point:Io,lineStart:Eo,lineEnd:Ro,polygonStart:vt(function(){Po.lineStart=zo,Po.lineEnd=Oo},"polygonStart"),polygonEnd:vt(function(){Po.point=Io,Po.lineStart=Eo,Po.lineEnd=Ro},"polygonEnd"),result:vt(function(){var t=To?[Co/To,Mo/To]:Ao?[So/Ao,ko/Ao]:wo?[bo/wo,vo/wo]:[NaN,NaN];return bo=vo=wo=So=ko=Ao=Co=Mo=To=0,t},"result")};function Io(t,e){bo+=t,vo+=e,++wo}function Eo(){Po.point=Fo}function Fo(t,e){Po.point=Do,Io(mo=t,go=e)}function Do(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Io(mo=t,go=e)}function Ro(){Po.point=Io}function zo(){Po.point=jo}function Oo(){Lo(_o,xo)}function jo(t,e){Po.point=Lo,Io(_o=mo=t,xo=go=e)}function Lo(t,e){var i=t-mo,n=e-go,o=Wn(i*i+n*n);So+=o*(mo+t)/2,ko+=o*(go+e)/2,Ao+=o,Co+=(o=go*t-mo*e)*(mo+t),Mo+=o*(go+e),To+=3*o,Io(mo=t,go=e)}function No(t){this._context=t}L(Io,"ao"),L(Eo,"so"),L(Fo,"ro"),L(Do,"lo"),L(Ro,"ho"),L(zo,"co"),L(Oo,"uo"),L(jo,"po"),L(Lo,"fo"),L(No,"yo"),vt(Io,"centroidPoint"),vt(Eo,"centroidLineStart"),vt(Fo,"centroidPointFirstLine"),vt(Do,"centroidPointLine"),vt(Ro,"centroidLineEnd"),vt(zo,"centroidRingStart"),vt(Oo,"centroidRingEnd"),vt(jo,"centroidPointFirstRing"),vt(Lo,"centroidPointRing"),vt(No,"PathContext"),No.prototype={_radius:4.5,pointRadius:vt(function(t){return this._radius=t,this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._context.closePath(),this._point=NaN},"lineEnd"),point:vt(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,Vn)}},"point"),result:$n};var Bo,Vo,Ho,Wo,$o,qo=jn(),Go={point:$n,lineStart:vt(function(){Go.point=Uo},"lineStart"),lineEnd:vt(function(){Bo&&Xo(Vo,Ho),Go.point=$n},"lineEnd"),polygonStart:vt(function(){Bo=!0},"polygonStart"),polygonEnd:vt(function(){Bo=null},"polygonEnd"),result:vt(function(){var t=+qo;return qo.reset(),t},"result")};function Uo(t,e){Go.point=Xo,Vo=Wo=t,Ho=$o=e}function Xo(t,e){Wo-=t,$o-=e,qo.add(Wn(Wo*Wo+$o*$o)),Wo=t,$o=e}function Yo(){this._string=[]}function Qo(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Zo(t,e){var i,n,o=4.5;function a(t){return t&&("function"==typeof o&&n.pointRadius(+o.apply(this,arguments)),Qn(t,i(n))),n.result()}return L(a,"s"),vt(a,"path"),a.area=function(t){return Qn(t,i(oo)),oo.result()},a.measure=function(t){return Qn(t,i(Go)),Go.result()},a.bounds=function(t){return Qn(t,i(fo)),fo.result()},a.centroid=function(t){return Qn(t,i(Po)),Po.result()},a.projection=function(e){return arguments.length?(i=null==e?(t=null,Zn):(t=e).stream,a):t},a.context=function(t){return arguments.length?(n=null==t?(e=null,new Yo):new No(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)}L(Uo,"So"),L(Xo,"Ao"),L(Yo,"ko"),L(Qo,"Mo"),L(Zo,"Po"),vt(Uo,"lengthPointFirst"),vt(Xo,"lengthPoint"),vt(Yo,"PathString"),Yo.prototype={_radius:4.5,_circle:Qo(4.5),pointRadius:vt(function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},"pointRadius"),polygonStart:vt(function(){this._line=0},"polygonStart"),polygonEnd:vt(function(){this._line=NaN},"polygonEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){0===this._line&&this._string.push("Z"),this._point=NaN},"lineEnd"),point:vt(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=Qo(this._radius)),this._string.push("M",t,",",e,this._circle)}},"point"),result:vt(function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null},"result")},vt(Qo,"circle"),vt(Zo,"geoPath");const Jo=(L(b=class extends Ge{_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=On().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",Zo()).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"),b);vt(Jo,"Contour"),wt(Jo,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ko=Jo;Ko.prototype._class+=" chart_Contour",Ko.prototype.implements(lt.prototype),Ko.prototype.publish("paletteID","YlGnBu","string","Color palette for this widget"),Ko.prototype.publish("useClonedPalette",!0,"boolean","Enable or disable using a cloned palette"),Ko.prototype.publish("showContourFill",!0,"boolean","Show/hide the contour background colors"),Ko.prototype.publish("showContour",!0,"boolean","Show/hide the contour border lines"),Ko.prototype.publish("contourBandwidth",40,"number","Controls the sensitivity of the contour grouping algorithm"),Ko.prototype.publish("contourStrokeColor","#2C3A47","html-color","Color of the contour border lines"),Ko.prototype.publish("contourStrokeWidth",1,"number","Width of the contour border lines");const ta=(L(v=class extends Ke{constructor(){super(),this.orientation_default("vertical").xAxisType_default("ordinal").yAxisType_default("time")}},"_Gantt"),v);vt(ta,"Gantt");let ea=ta;function ia(t){return vt(function(){return t},"constant")}L(ia,"Io"),ea.prototype._class+=" chart_Gantt",vt(ia,"constant");var na=1e-12,oa=Math.PI,aa=oa/2,sa=2*oa;function ra(t){return t.innerRadius}function la(t){return t.outerRadius}function ha(t){return t.startAngle}function ca(t){return t.endAngle}function ua(t){return t&&t.padAngle}function pa(t){return t>=1?aa:t<=-1?-aa:Math.asin(t)}function da(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 fa(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,T=k-_,P=A-x,I=C-_,E=M-x;return T*T+P*P>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 ya(){var t=ra,e=la,i=ia(0),n=null,o=ha,a=ca,s=ua,r=null;function l(){var l,h,c=+t.apply(this,arguments),u=+e.apply(this,arguments),p=o.apply(this,arguments)-aa,d=a.apply(this,arguments)-aa,f=Math.abs(d-p),y=d>p;if(r||(r=l=Tt()),u<c&&(h=u,u=c,c=h),u>na)if(f>sa-na)r.moveTo(u*Math.cos(p),u*Math.sin(p)),r.arc(0,0,u,p,d,!y),c>na&&(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>na&&(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,T=C;if(A>na){var P=pa(A/c*Math.sin(k)),I=pa(A/u*Math.sin(k));(w-=2*P)>na?(b+=P*=y?1:-1,v-=P):(w=0,b=v=(p+d)/2),(S-=2*I)>na?(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>na){var z=u*Math.cos(g),O=u*Math.sin(g),j=c*Math.cos(b),L=c*Math.sin(b);if(f<oa){var N=w>na?da(E,F,j,L,z,O,D,R):[D,R],B=E-N[0],V=F-N[1],H=z-N[0],W=O-N[1],$=1/Math.sin(Math.acos((B*H+V*W)/(Math.sqrt(B*B+V*V)*Math.sqrt(H*H+W*W)))/2),q=Math.sqrt(N[0]*N[0]+N[1]*N[1]);M=Math.min(C,(c-q)/($-1)),T=Math.min(C,(u-q)/($+1))}}S>na?T>na?(_=fa(j,L,E,F,u,T,y),x=fa(z,O,D,R,u,T,y),r.moveTo(_.cx+_.x01,_.cy+_.y01),T<C?r.arc(_.cx,_.cy,T,Math.atan2(_.y01,_.x01),Math.atan2(x.y01,x.x01),!y):(r.arc(_.cx,_.cy,T,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,T,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>na&&w>na?M>na?(_=fa(D,R,z,O,c,-M,y),x=fa(E,F,j,L,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 L(l,"h"),vt(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-oa/2;return[Math.cos(n)*i,Math.sin(n)*i]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:ia(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:ia(+t),l):e},l.cornerRadius=function(t){return arguments.length?(i="function"==typeof t?t:ia(+t),l):i},l.padRadius=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ia(+t),l):n},l.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:ia(+t),l):o},l.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:ia(+t),l):a},l.padAngle=function(t){return arguments.length?(s="function"==typeof t?t:ia(+t),l):s},l.context=function(t){return arguments.length?(r=null==t?null:t,l):r},l}function _a(t){this._context=t}function xa(t){return new _a(t)}function ma(t){return t[0]}function ga(t){return t[1]}function ba(){var t=ma,e=ga,i=ia(!0),n=null,o=xa,a=null;function s(s){var r,l,h,c=s.length,u=!1;for(null==n&&(a=o(h=Tt())),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 L(s,"r"),vt(s,"line"),s.x=function(e){return arguments.length?(t="function"==typeof e?e:ia(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:ia(+t),s):e},s.defined=function(t){return arguments.length?(i="function"==typeof t?t:ia(!!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 va(){}function wa(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 Sa(t){this._context=t}function ka(t,e){this._basis=new Sa(t),this._beta=e}function Aa(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 Ca(t,e){this._context=t,this._k=(1-e)/6}function Ma(t,e){this._context=t,this._k=(1-e)/6}function Ta(t,e){this._context=t,this._k=(1-e)/6}function Pa(t,e,i){var n=t._x1,o=t._y1,a=t._x2,s=t._y2;if(t._l01_a>na){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>na){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 Ia(t,e){this._context=t,this._alpha=e}L(ra,"jo"),L(la,"No"),L(ha,"Lo"),L(ca,"Bo"),L(ua,"$o"),L(pa,"Ho"),L(da,"Vo"),L(fa,"qo"),L(ya,"Wo"),L(_a,"Go"),L(xa,"Xo"),L(ma,"Yo"),L(ga,"Uo"),L(ba,"Qo"),L(va,"Zo"),L(wa,"Jo"),L(Sa,"Ko"),L(ka,"ta"),L(Aa,"ea"),L(Ca,"ia"),L(Ma,"na"),L(Ta,"oa"),L(Pa,"aa"),L(Ia,"sa"),vt(ra,"arcInnerRadius"),vt(la,"arcOuterRadius"),vt(ha,"arcStartAngle"),vt(ca,"arcEndAngle"),vt(ua,"arcPadAngle"),vt(pa,"asin"),vt(da,"intersect"),vt(fa,"cornerTangents"),vt(ya,"arc"),vt(_a,"Linear"),_a.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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")},vt(xa,"curveLinear"),vt(ma,"x"),vt(ga,"y"),vt(ba,"line"),vt(va,"noop"),vt(wa,"point$3"),vt(Sa,"Basis"),Sa.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 3:wa(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:vt(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:wa(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e},"point")},vt(ka,"Bundle"),ka.prototype={lineStart:vt(function(){this._x=[],this._y=[],this._basis.lineStart()},"lineStart"),lineEnd:vt(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:vt(function(t,e){this._x.push(+t),this._y.push(+e)},"point")},vt(Aa,"point$2"),vt(Ca,"Cardinal"),Ca.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Aa(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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:Aa(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")},vt(Ma,"CardinalClosed"),Ma.prototype={areaStart:va,areaEnd:va,lineStart:vt(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:vt(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:vt(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:Aa(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")},vt(Ta,"CardinalOpen"),Ta.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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:Aa(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")},vt(Pa,"point$1"),vt(Ia,"CatmullRom"),Ia.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(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:vt(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:vt(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:Pa(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 Ea=vt(L(function t(e){function i(t){return e?new Ia(t,e):new Ca(t,0)}return L(i,"n"),vt(i,"catmullRom"),i.alpha=function(e){return t(+e)},i},"t"),"custom")(.5);function Fa(t,e){this._context=t,this._alpha=e}function Da(t,e){this._context=t,this._alpha=e}function Ra(t){return t<0?-1:1}function za(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(Ra(a)+Ra(s))*Math.min(Math.abs(a),Math.abs(s),.5*Math.abs(r))||0}function Oa(t,e){var i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function ja(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 La(t){this._context=t}L(Fa,"la"),L(Da,"ha"),L(Ra,"ca"),L(za,"ua"),L(Oa,"pa"),L(ja,"da"),L(La,"fa"),vt(Fa,"CatmullRomClosed"),Fa.prototype={areaStart:va,areaEnd:va,lineStart:vt(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:vt(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:vt(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:Pa(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")},vt(Da,"CatmullRomOpen"),Da.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(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:vt(function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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:Pa(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")},vt(Ra,"sign"),vt(za,"slope3"),vt(Oa,"slope2"),vt(ja,"point"),vt(La,"MonotoneX"),La.prototype={areaStart:vt(function(){this._line=0},"areaStart"),areaEnd:vt(function(){this._line=NaN},"areaEnd"),lineStart:vt(function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},"lineStart"),lineEnd:vt(function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:ja(this,this._t0,Oa(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},"lineEnd"),point:vt(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,ja(this,Oa(this,i=za(this,t,e)),i);break;default:ja(this,this._t0,i=za(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=i}},"point")},Object.create(La.prototype).point=function(t,e){La.prototype.point.call(this,e,t)};var Na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ba=vt(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},"classCallCheck"),Va=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 L(t,"t"),vt(t,"defineProperties"),function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),Ha=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},Wa=vt(L(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"),$a=vt(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"),qa=vt(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"),Ga=vt(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"),Ua=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;Ba(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 L(t,"t"),vt(t,"Annotation"),Va(t,[{key:"updatePosition",value:vt(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:vt(function(){this.type.clearComponents&&this.type.clearComponents()},"clearComponents")},{key:"updateOffset",value:vt(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:vt(function(){return this._className},"get$$1"),set:vt(function(t){this._className=t,this.type.setClassName&&this.type.setClassName()},"set$$1")},{key:"type",get:vt(function(){return this._type},"get$$1"),set:vt(function(t){this._type=t,this.clearComponents()},"set$$1")},{key:"x",get:vt(function(){return this._x},"get$$1"),set:vt(function(t){this._x=t,this.updatePosition()},"set$$1")},{key:"y",get:vt(function(){return this._y},"get$$1"),set:vt(function(t){this._y=t,this.updatePosition()},"set$$1")},{key:"color",get:vt(function(){return this._color},"get$$1"),set:vt(function(t){this._color=t,this.updatePosition()},"set$$1")},{key:"dx",get:vt(function(){return this._dx},"get$$1"),set:vt(function(t){this._dx=t,this.updateOffset()},"set$$1")},{key:"dy",get:vt(function(){return this._dy},"get$$1"),set:vt(function(t){this._dy=t,this.updateOffset()},"set$$1")},{key:"nx",set:vt(function(t){this._dx=t-this._x,this.updateOffset()},"set$$1")},{key:"ny",set:vt(function(t){this._dy=t-this._y,this.updateOffset()},"set$$1")},{key:"offset",get:vt(function(){return{x:this._dx,y:this._dy}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._dx=e,this._dy=i,this.updateOffset()},"set$$1")},{key:"position",get:vt(function(){return{x:this._x,y:this._y}},"get$$1"),set:vt(function(t){var e=t.x,i=t.y;this._x=e,this._y=i,this.updatePosition()},"set$$1")},{key:"translation",get:vt(function(){return{x:this._x+this._dx,y:this._y+this._dy}},"get$$1")},{key:"json",get:vt(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}(),Xa=function(){function t(e){var i=e.annotations,n=e.accessors,o=e.accessorsInverse;Ba(this,t),this.accessors=n,this.accessorsInverse=o,this.annotations=i}return L(t,"t"),vt(t,"AnnotationCollection"),Va(t,[{key:"clearTypes",value:vt(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:vt(function(){var t=this;this.annotations.forEach(function(e){e.type.setPositionWithAccessors(t.accessors)})},"setPositionWithAccessors")},{key:"editMode",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.editMode=t,e.type.updateEditMode())})},"editMode")},{key:"updateDisable",value:vt(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:vt(function(t){this.annotations.forEach(function(e){e.type&&e.type.updateTextWrap&&e.type.updateTextWrap(t)})},"updateTextWrap")},{key:"updateText",value:vt(function(){this.annotations.forEach(function(t){t.type&&t.type.drawText&&t.type.drawText()})},"updateText")},{key:"updateNotePadding",value:vt(function(t){this.annotations.forEach(function(e){e.type&&(e.type.notePadding=t)})},"updateNotePadding")},{key:"json",get:vt(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:vt(function(){return this.annotations.map(function(t){return Ha({},t.type.getNoteBBoxOffset(),{positionX:t.x,positionY:t.y})})},"get$$1")}]),t}(),Ya=vt(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"),Qa=vt(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"),Za=vt(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(s.drag().container(s.select("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"),Ja=vt(function(t,e){return"dynamic"!==t&&"left"!==t&&"right"!==t||(t=e<0?"top":"bottom"),t},"leftRightDynamic"),Ka=vt(function(t,e){return"dynamic"!==t&&"top"!==t&&"bottom"!==t||(t=e<0?"right":"left"),t},"topBottomDynamic"),ts=["topBottom","top","bottom"],es=["leftRight","left","right"],is=vt(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!==ts.indexOf(s)?(a=Ka(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!==es.indexOf(s)&&(a=Ja(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"),ns=vt(function(t){var e=t.data,i=t.curve,n=void 0===i?xa:i,o=t.canvasContext,a=t.className,s=t.classID,r=ba().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"),os=vt(function(t){var e=t.data,i=t.canvasContext,n={type:"path",className:t.className,classID:t.classID,data:e},o=ya().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"),as=vt(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=Ja(e,r.y))?a-=s.height:"middle"===e&&(a-=s.height/2);var l=[[n,a],[n,a+s.height]];return{components:[ns({data:l,className:"note-line"})]}},"noteVertical"),ss=vt(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=Ka(e,s.x))?n-=r.width:"middle"===e&&(n-=r.width/2);var l=[[n,a],[n+r.width,a]];return{components:[ns({data:l,className:"note-line"})]}},"noteHorizontal"),rs=vt(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"),ls=vt(function(t){var e=rs(t);return{components:[ns({data:e,className:"connector"})]}},"connectorLine"),hs=vt(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:[ns({data:p,className:"connector"})]}},"connectorElbow"),cs=vt(function(t){var e=t.type,i=t.connectorData,n=t.subjectType;i||(i={}),i.points&&"number"!=typeof i.points||(i.points=us(e.annotation.offset,i.points)),i.curve||(i.curve=Ea);var o=[];if(e.editMode){var a=i.points.map(function(t,e){return Ha({},Ya({cx:t[0],cy:t[1]}),{index:e})}),r=vt(function(t){i.points[t][0]+=s.event.dx,i.points[t][1]+=s.event.dy,e.redrawConnector()},"updatePoint");o=e.mapHandles(a.map(function(t){return Ha({},t.move,{drag:r.bind(e,t.index)})}))}var l=rs({type:e,subjectType:n});return l=[l[0]].concat(Ga(i.points),[l[1]]),{components:[ns({data:l,curve:i.curve,className:"connector"})],handles:o}},"connectorCurve"),us=vt(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"),ps=vt(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:[ns({data:f,className:"connector-end connector-arrow",classID:"connector-end"})]}},"connectorArrow"),ds=vt(function(t){var e=t.line,i=t.scale,n=void 0===i?1:i,o=os({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"),fs=vt(function(t){var e=t.subjectData,i=t.type;e.radius||e.outerRadius||(e.radius=20);var n=[],o=os({data:e,className:"subject"});if(i.editMode){var a=Qa({r1:o.data.outerRadius||o.data.radius,r2:o.data.innerRadius,padding:e.radiusPadding}),r=vt(function(t){var n=e[t]+s.event.dx*Math.sqrt(2);e[t]=n,i.redrawSubject(),i.redrawConnector()},"updateRadius"),l=[Ha({},a.r1,{drag:r.bind(i,void 0!==e.outerRadius?"outerRadius":"radius")})];e.innerRadius&&l.push(Ha({},a.r2,{drag:r.bind(i,"innerRadius")})),n=i.mapHandles(l)}return o.attrs["fill-opacity"]=0,{components:[o],handles:n}},"subjectCircle"),ys=vt(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,r=ns({data:[[0,0],[o,0],[o,a],[0,a],[0,0]],className:"subject"});if(i.editMode){var l=vt(function(){e.width=s.event.x,i.redrawSubject(),i.redrawConnector()},"updateWidth"),h=vt(function(){e.height=s.event.y,i.redrawSubject(),i.redrawConnector()},"updateHeight"),c=[{x:o,y:a/2,drag:l.bind(i)},{x:o/2,y:a,drag:h.bind(i)}];n=i.mapHandles(c)}return r.attrs["fill-opacity"]=.1,{components:[r],handles:n}},"subjectRect"),_s=vt(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:[ns({data:[[n,a],[o,s]],className:"subject"})]}},"subjectThreshold"),xs=vt(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]:{},r=o.typeSettings&&o.typeSettings.subject;i.radius||(r&&r.radius?i.radius=r.radius:i.radius=14),i.x||r&&r.x&&(i.x=r.x),i.y||r&&r.y&&(i.y=r.y);var l=[],h=[],c=i.radius,u=.7*c,p=0,d=0,f=Math.sqrt(2)*c,y={xleftcorner:-c,xrightcorner:c,ytopcorner:-c,ybottomcorner:c,xleft:-f,xright:f,ytop:-f,ybottom:f};i.x&&!i.y?p=y["x"+i.x]:i.y&&!i.x?d=y["y"+i.y]:i.x&&i.y&&(p=y["x"+i.x+"corner"],d=y["y"+i.y+"corner"]);var _="translate("+p+", "+d+")",x=os({className:"subject",data:{radius:c}});x.attrs.transform=_,x.attrs.fill=a.color,x.attrs["stroke-linecap"]="round",x.attrs["stroke-width"]="3px";var m=os({className:"subject-ring",data:{outerRadius:c,innerRadius:u}});m.attrs.transform=_,m.attrs["stroke-width"]="3px",m.attrs.fill="white";var g=void 0;if(p&&d||!p&&!d)g=ns({className:"subject-pointer",data:[[0,0],[p||0,0],[0,d||0],[0,0]]});else if(p||d){var b=vt(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t&&t/Math.sqrt(2)/Math.sqrt(2)||e*c/Math.sqrt(2)},"notCornerPointerXY");g=ns({className:"subject-pointer",data:[[0,0],[b(p),b(d)],[b(p,-1),b(d,-1)],[0,0]]})}if(g&&(g.attrs.fill=a.color,g.attrs["stroke-linecap"]="round",g.attrs["stroke-width"]="3px",h.push(g)),o.editMode){var v={x:2*p,y:2*d,drag:vt(function(){i.x=s.event.x<2*-c?"left":s.event.x>2*c?"right":void 0,i.y=s.event.y<2*-c?"top":s.event.y>2*c?"bottom":void 0,o.redrawSubject()},"dragBadge").bind(o)};v.x||v.y||(v.y=-c),l=o.mapHandles([v])}var w=void 0;return i.text&&(w={type:"text",className:"badge-text",attrs:{fill:"white",stroke:"none","font-size":".7em",text:i.text,"text-anchor":"middle",dy:".25em",x:p,y:d}}),h.push(x),h.push(m),h.push(w),{components:h,handles:l}},"subjectBadge"),ms=function(){function t(e){var i=e.a,n=e.annotation,o=e.editMode,a=e.dispatcher,s=e.notePadding,r=e.accessors;if(Ba(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=ks.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 L(t,"t"),vt(t,"Type"),Va(t,[{key:"init",value:vt(function(t){this.annotation.x||this.mapX(t),this.annotation.y||this.mapY(t)},"init")},{key:"mapY",value:vt(function(t){t.y&&(this.annotation.y=t.y(this.annotation.data))},"mapY")},{key:"mapX",value:vt(function(t){t.x&&(this.annotation.x=t.x(this.annotation.data))},"mapX")},{key:"updateEditMode",value:vt(function(){this.a.selectAll("circle.handle").remove()},"updateEditMode")},{key:"drawOnSVG",value:vt(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)Za({group:t,r:a&&a.r,handles:s});else{Ss(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:vt(function(){return Cs(this.note,".annotation-note-content text")},"getNoteBBox")},{key:"getNoteBBoxOffset",value:vt(function(){var t=Cs(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:vt(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=fs(o):"rect"===n?a=ys(o):"threshold"===n?a=_s(o):"badge"===n&&(a=xs(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:vt(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?cs(o):"elbow"===n?hs(o):ls(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=ps({annotation:this.annotation,start:d,end:f,scale:i.endScale})}else"dot"===u?p=ds({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:vt(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,r={};"vertical"===a?r=as(o):"horizontal"===a&&(r=ss(o));var l=r,h=l.components,c=void 0===h?[]:h,u=l.handles,p=void 0===u?[]:u;if(c.forEach(function(e){e.attrs.stroke=t.annotation.color}),this.editMode){p=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),c.push({type:"handle",handles:p});var d=this.dragNote.bind(this),f=this.dragstarted.bind(this),y=this.dragended.bind(this);this.note.call(s.drag().container(s.select("g.annotations").node()).on("start",function(t){return f(t)}).on("drag",function(t){return d(t)}).on("end",function(t){return y(t)}))}else this.note.on("mousedown.drag",null);return c},"drawNote")},{key:"drawNoteContent",value:vt(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=is(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:vt(function(t,e){return this.drawOnSVG(t,e)},"drawOnScreen")},{key:"redrawSubject",value:vt(function(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())},"redrawSubject")},{key:"redrawConnector",value:vt(function(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())},"redrawConnector")},{key:"redrawNote",value:vt(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:vt(function(){var t=this.annotation.position;this.a.attr("transform","translate("+t.x+", "+t.y+")")},"setPosition")},{key:"clearComponents",value:vt(function(){this.subject&&this.subject.select("*").remove(),this.connector&&this.connector.select("*").remove()},"clearComponents")},{key:"setOffset",value:vt(function(){if(this.note){var t=this.annotation.offset;this.note.attr("transform","translate("+t.x+", "+t.y+")")}},"setOffset")},{key:"setPositionWithAccessors",value:vt(function(t){t&&this.annotation.data&&(this.mapX(t),this.mapY(t)),this.setPosition()},"setPositionWithAccessors")},{key:"setClassName",value:vt(function(){this.a.attr("class","annotation "+(this.className&&this.className())+" "+(this.editMode?"editable":"")+" "+(this.annotation.className||""))},"setClassName")},{key:"draw",value:vt(function(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()},"draw")},{key:"dragstarted",value:vt(function(){s.event.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:vt(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:vt(function(){var t=this.annotation.position;t.x+=s.event.dx,t.y+=s.event.dy,this.annotation.position=t},"dragSubject")},{key:"dragNote",value:vt(function(){var t=this.annotation.offset;t.x+=s.event.dx,t.y+=s.event.dy,this.annotation.offset=t},"dragNote")},{key:"mapHandles",value:vt(function(t){var e=this;return t.map(function(t){return Ha({},t,{start:e.dragstarted.bind(e),end:e.dragended.bind(e)})})},"mapHandles")}]),t}(),gs=vt(function(t,e,i){return function(t){function n(t){Ba(this,n);var i=qa(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 L(n,"o"),$a(n,t),vt(n,"customType"),Va(n,[{key:"className",value:vt(function(){return""+(e.className||Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this)&&Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"className",this).call(this)||"")},"className")},{key:"drawSubject",value:vt(function(t){return this.typeSettings.subject=Ha({},e.subject,this.typeSettings.subject),Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawSubject",this).call(this,Ha({},t,this.typeSettings.subject))},"drawSubject")},{key:"drawConnector",value:vt(function(t){return this.typeSettings.connector=Ha({},e.connector,this.typeSettings.connector),Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawConnector",this).call(this,Ha({},t,e.connector,this.typeSettings.connector))},"drawConnector")},{key:"drawNote",value:vt(function(t){return this.typeSettings.note=Ha({},e.note,this.typeSettings.note),Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNote",this).call(this,Ha({},t,e.note,this.typeSettings.note))},"drawNote")},{key:"drawNoteContent",value:vt(function(t){return Wa(n.prototype.__proto__||Object.getPrototypeOf(n.prototype),"drawNoteContent",this).call(this,Ha({},t,e.note,this.typeSettings.note))},"drawNoteContent")}],[{key:"init",value:vt(function(t,e){return Wa(n.__proto__||Object.getPrototypeOf(n),"init",this).call(this,t,e),i&&(t=i(t,e)),t},"init")}]),n}(t)},"customType"),bs=function(){function t(e){Ba(this,t);var i=qa(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return i.textWrap=e.textWrap||120,i.drawText(),i}return L(t,"t"),$a(t,ms),vt(t,"d3NoteText"),Va(t,[{key:"updateTextWrap",value:vt(function(t){this.textWrap=t,this.drawText()},"updateTextWrap")},{key:"drawText",value:vt(function(){if(this.note){Ss(this.note,[this.annotation],"g","annotation-note-content");var t=this.note.select("g.annotation-note-content");Ss(t,[this.annotation],"rect","annotation-note-bg"),Ss(t,[this.annotation],"text","annotation-note-label"),Ss(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":Na(a))&&(s=Ha(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(As,n,o),e=r.node().getBBox()}i.text(this.annotation.note.label).attr("dx","0"),i.call(As,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}();gs(bs,{className:"label",note:{align:"middle"}});var vs=gs(bs,{className:"callout",note:{lineType:"horizontal"}}),ws=gs(vs,{className:"callout elbow",connector:{type:"elbow"}});gs(vs,{className:"callout curve",connector:{type:"curve"}}),gs(ms,{className:"badge",subject:{type:"badge"},disable:["connector","note"]}),gs(bs,{className:"callout circle",subject:{type:"circle"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),gs(bs,{className:"callout rect",subject:{type:"rect"},note:{lineType:"horizontal"},connector:{type:"elbow"}}),gs(function(){function t(){return Ba(this,t),qa(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return L(t,"t"),$a(t,vs),vt(t,"ThresholdMap"),Va(t,[{key:"mapY",value:vt(function(e){Wa(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:vt(function(e){Wa(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 Ss=vt(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"),ks=vt(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"),As=vt(function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.2;t.each(function(){for(var t=s.select(this),o=t.text().split(i||/[ \t\r\n]+/).reverse().filter(function(t){return""!==t}),a=void 0,r=[],l=t.text(null).append("tspan").attr("x",0).attr("dy","0.8em");a=o.pop();)r.push(a),l.text(r.join(" ")),l.node().getComputedTextLength()>e&&r.length>1&&(r.pop(),l.text(r.join(" ")),r=[a],l=t.append("tspan").attr("x",0).attr("dy",n+"em").text(a))})},"wrap"),Cs=vt(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 Ms(){var t=[],e=void 0,i=void 0,n=[],o={},a={},r=!1,l=void 0,h=vs,c=void 0,u=void 0,p=s.dispatch("subjectover","subjectout","subjectclick","connectorover","connectorout","connectorclick","noteover","noteout","noteclick","dragend","dragstart"),d=void 0,f=vt(function(i){d=i,r||i.selectAll("circle.handle").remove();var f=t.map(function(t){return t.type||(t.type=h),t.disable||(t.disable=n),new Ua(t)});e=e||new Xa({annotations:f,accessors:o,accessorsInverse:a,ids:l}),i.selectAll("g").data([e]).enter().append("g").attr("class","annotations");var y=i.select("g.annotations");Ss(y,e.annotations,"g","annotation"),y.selectAll("g.annotation").each(function(t){var e=s.select(this);e.attr("class","annotation"),Ss(e,[t],"g","annotation-connector"),Ss(e,[t],"g","annotation-subject"),Ss(e,[t],"g","annotation-note"),Ss(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:c,notePadding:u,editMode:r,dispatcher:p,accessors:o}),t.type.draw(),t.type.drawText&&t.type.drawText()})},"annotation");return f.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}))),f},f.update=function(){return t&&e&&(t=e.annotations.map(function(t){return t.type.draw(),t})),f},f.updateText=function(){return e&&(e.updateText(c),t=e.annotations),f},f.updatedAccessors=function(){return e.setPositionWithAccessors(),t=e.annotations,f},f.disable=function(i){return arguments.length?(n=i,e&&(e.updateDisable(n),t=e.annotations),f):n},f.textWrap=function(i){return arguments.length?(c=i,e&&(e.updateTextWrap(c),t=e.annotations),f):c},f.notePadding=function(i){return arguments.length?(u=i,e&&(e.updateNotePadding(u),t=e.annotations),f):u},f.type=function(i,n){return arguments.length?(h=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=h,t.subject=n&&n.subject||t.subject,t.connector=n&&n.connector||t.connector,t.note=n&&n.note||t.note}),t=e.annotations),f):h},f.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,f(d)):e.annotations=t),f):e&&e.annotations||t},f.context=function(t){return arguments.length?(i=t,f):i},f.accessors=function(t){return arguments.length?(o=t,f):o},f.accessorsInverse=function(t){return arguments.length?(a=t,f):a},f.ids=function(t){return arguments.length?(l=t,f):l},f.editMode=function(i){return arguments.length?(r=i,d&&d.selectAll("g.annotation").classed("editable",r),e&&(e.editMode(r),t=e.annotations),f):r},f.collection=function(t){return arguments.length?(e=t,f):e},f.on=function(){var t=p.on.apply(p,arguments);return t===p?f:t},f}function Ts(t){return.65*(t-.5)*2*Math.PI}function Ps(t,e){return{x:Math.cos(t-Math.PI/2)*e,y:Math.sin(t-Math.PI/2)*e}}function Is(t,e,i=!1){const n=Ps(t,e),o=180*t/Math.PI+(!0===i?180:0);return`translate(${n.x}, ${n.y}) rotate(${o})`}function Es(t,e,i=!1){return function(n){const o=s.interpolate(n.angle,t);return n.angle=t,function(t){return Is(o(t),e,i)}}}function Fs(t,e,i){return function(n){const o=s.interpolate(n.startAngle,t),a=s.interpolate(n.endAngle,e);return function(t){return n.startAngle=o(t),n.endAngle=a(t),i(n)}}}L(Ms,"ns"),L(Ts,"os"),L(Ps,"as"),L(Is,"ss"),L(Es,"rs"),L(Fs,"ls"),vt(Ms,"annotation"),vt(Ts,"value2Angle"),vt(Ps,"pointOnArc"),vt(Is,"indicatorTranslate"),vt(Es,"indicatorTween"),vt(Fs,"arcTween");const Ds=(w=class extends s.SVGWidget{_d3Arc=Qt().innerRadius(85).outerRadius(100);_colorScale=s.scaleLinear().interpolate(s.interpolateHcl);_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=Ms().type(ws).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:vt(t=>t.x,"x"),y:vt(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:Ts(0),endAngle:Ts(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:Ts(0),endAngle:Ts(1)}).style("fill","lightGrey"),this._meanArc=e.append("path").datum({startAngle:Ts(0),endAngle:Ts(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:Ts(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)})}L(n,"o"),vt(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!==w.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",Fs(Ts(0),Ts(o),this._d3Arc)),this._freeArc.style("fill",this.emptyColor()).transition().duration(750).attrTween("d",Fs(Ts(o),Ts(1),this._d3Arc)),this._meanArc.style("fill",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("d",Fs(Ts(a-.001),Ts(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",Es(Ts(a),i,!0)),this._indOuter.style("fill",this.tickColor()).style("stroke",this.tickColor()).style("visibility",this.showTick()?"visible":"hidden").transition().duration(750).attrTween("transform",Es(Ts(a),n)),this._centerText.style("fill",this._colorScale(o)).text(s.format(".0%")(o)),this._bottomText.style("fill",this.click!==w.prototype.click?this.titleClickColor():this.titleColor()).style("text-decoration",this.click!==w.prototype.click?"underline":null).text(this.title());const r=Ps(Ts(1),i-8);this.updateText(this._centerText,-r.x,-r.y,2*r.x,2*r.y);const l=Ps(Ts(1),n);l.y+=5;const h=this.calcWidth()-20,c=this.calcWidth()/2-l.y-5;this.updateText(this._bottomText,-h/2,l.y,h,c),this._mainTooltip.text(this.tooltip())}click(t){}},L(w,"_Gauge"),w);vt(Ds,"Gauge");let Rs=Ds;Rs.prototype._class+=" chart_Gauge",Rs.prototype.publish("title","","string","Title"),Rs.prototype.publish("titleDescription","","string","Title Description"),Rs.prototype.publish("titleColor","black","html-color","Color of the title text"),Rs.prototype.publish("titleClickColor","blue","html-color","Color of the title text when clickable"),Rs.prototype.publish("maxDiameter",128,"number","Max Diameter"),Rs.prototype.publish("value",0,"number","Value"),Rs.prototype.publish("valueDescription","","string","Value Description"),Rs.prototype.publish("showTick",!1,"boolean","Show Tick"),Rs.prototype.publish("tickValue",0,"number","Tick Value"),Rs.prototype.publish("tickValueDescription","","string","Tick Value Description"),Rs.prototype.publish("tooltip","","string","Tooltip"),Rs.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."),Rs.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."),Rs.prototype.publish("emptyColor","lightgrey","html-color","Color of the empty portion of the gauge"),Rs.prototype.publish("tickColor","black","html-color","Color of the tick");const zs=vt((t,e)=>t[1]-e[1]>0?1:-1,"sortAscending"),Os=vt((t,e)=>t[1]-e[1]>0?-1:1,"sortDescending"),js=(S=class extends s.SVGWidget{_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),ht.call(this),_t.call(this),s.Utility.SimpleSelectionMixin.call(this),this.d3Pie=ae(),this.d3Arc=Qt(),this.d3LabelArc=Qt(),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=s.format(this.seriesValueFormat()),this._seriesPercentageFormatter=s.format(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 r=[...this.data()];switch(this.sortDataByValue()){case"ascending":r.sort(zs);break;case"descending":r.sort(Os)}const l=this._slices.selectAll(".arc").data(this.d3Pie(r),t=>t.data[0]);this._labelPositions=[],l.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=s.d3Event();!i.tabNavigation()||"Space"!==n.code&&"Enter"!==n.key||(n.preventDefault(),i._selection.click(this))}).each(function(t,e){s.select(this).append("path").on("mouseout.tooltip",i.tooltip.hide).on("mousemove.tooltip",i.tooltip.show).on("mouseover",d(0,0)).on("mouseout",d(-5,150))}).merge(l).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(p(t));i._quadIdxArr[o].push(e),t.outerRadius=n-5,s.select(this).select("path").transition().attr("d",i.d3Arc).style("fill",i.fillColor(t.data,i.columns()[1],t.data[1]))}),l.exit().transition().style("opacity",0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);const h=this._labels.selectAll("text").data(this.showLabels()?this.d3Pie(r):[],t=>t.data[0]),c=h.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(h).text(t=>this.getLabelText(t,!0)).each(function(t,e){const n=i.d3LabelArc.centroid(t),o=p(t);n[0]=a*(i.isLeftSide(o)?1:-1),i._labelPositions.push({top:n[1],bottom:n[1]+i.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),c.transition().style("font-size",this.labelHeight()+"px").attr("transform",(t,e)=>{const n=i.d3LabelArc.centroid(t);return n[0]=a*(i.isLeftSide(p(t))?1:-1),n[1]=i._labelPositions[e].top,"translate("+n+")"}).style("text-anchor",t=>this.isLeftSide(p(t))?"start":"end")),h.exit().remove();const u=this._labels.selectAll("polyline").data(this.showLabels()?this.d3Pie(r):[],t=>this.getLabelText(t,!0));function p(t){return t.startAngle+(t.endAngle-t.startAngle)/2}function d(t,e){return function(){s.select(this).transition().delay(e).attrTween("d",function(e){const o=s.interpolate(e.outerRadius,n+t);return function(t){return e.outerRadius=o(t),i.d3Arc(e)}})}}L(p,"d"),L(d,"y"),u.enter().append("polyline").merge(u).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(p(t))?1:-1),n[1]=i._labelPositions[e].top,[o,s,n]}),u.exit().remove(),this.showLabels()&&this.centerOnLabels(),vt(p,"midAngle"),vt(d,"arcTween")}isLeftSide(t){return(t=a.normalizeRadians(t))>2*Math.PI?t:t<Math.PI&&t>0}getQuadrant(t){let e=0;const i=a.normalizeRadians(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=a.normalizeRadians(a.degreesToRadians(this.startAngle()));switch(this.sortDataByValue()){case"ascending":this.d3Pie.sort(zs);break;case"descending":this.d3Pie.sort(Os);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(t).endAngle(2*Math.PI+t).value(function(t){return t[1]})}},L(S,"_Pie"),S);vt(js,"Pie"),wt(js,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Ls=js;Ls.prototype._class+=" chart_Pie",Ls.prototype.implements(ht.prototype),Ls.prototype.implements(_t.prototype),Ls.prototype.mixin(s.Utility.SimpleSelectionMixin),Ls.prototype.publish("showLabels",!0,"boolean","If true, wedge labels will display"),Ls.prototype.publish("showSeriesValue",!1,"boolean","Append data series value next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),Ls.prototype.publish("seriesValueFormat",",.0f","string","Number format used for formatting series values",null,{disable:vt(t=>!t.showSeriesValue(),"disable")}),Ls.prototype.publish("showSeriesPercentage",!1,"boolean","Append data series percentage next to label",null,{disable:vt(t=>!t.showLabels(),"disable")}),Ls.prototype.publish("seriesPercentageFormat",",.0f","string","Number format used for formatting series percentages",null,{disable:vt(t=>!t.showSeriesPercentage(),"disable")}),Ls.prototype.publish("paletteID","default","set","Color palette for this widget",Ls.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ls.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ls.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}}),Ls.prototype.publish("minOuterRadius",20,"number","Minimum outer radius (pixels)"),Ls.prototype.publish("startAngle",0,"number","Starting angle of the first (and largest) wedge (degrees)"),Ls.prototype.publish("labelHeight",12,"number","Font size of labels (pixels)",null,{disable:vt(t=>!t.showLabels(),"disable")}),Ls.prototype.publish("slicePadding",.01,"number","Padding between pie slices (converted to pixels)",null,{tags:["Basic"],range:{min:0,step:.01,max:.2}}),Ls.prototype.publish("sortDataByValue","descending","set","Sort data by value",["none","ascending","descending"]),Ls.prototype.publish("tabNavigation",!1,"boolean","Enable or disable tab navigation");const Ns=(L(k=class extends Ls{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"),k);vt(Ns,"HalfPie"),Ns.prototype._class+=" chart_HalfPie";const Bs=(L(A=class extends Ge{_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=Hs(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]]),r=this.maxWeight_exists()?this.maxWeight():s.max(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 l=this.radiusAsPercent()?this.radiusX()*n/100:this.radiusX(),h=this.radiusAsPercent()?this.radiusY()*o/100:this.radiusY();this._heat.clear().radius(l,h,this.blur()).max(r).data(a).draw(this.minOpacity())}},"_Heat"),A);vt(Bs,"Heat");let Vs=Bs;function Hs(t){if(!(this instanceof Hs))return new Hs(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=[]}L(Hs,"gs"),Vs.prototype._class+=" chart_Heat",Vs.prototype._palette=s.Palette.rainbow("default"),Vs.prototype.publish("paletteID","default","set","Color palette for this widget",Vs.prototype._palette.switch(),{tags:["Basic"]}),Vs.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Vs.prototype.publish("reversePalette",!1,"boolean","Reverse Palette Colors",null,{disable:vt(t=>"default"===t.paletteID(),"disable")}),Vs.prototype.publish("radiusX",25,"number","Point X radius (25 by default)"),Vs.prototype.publish("radiusY",25,"number","Point Y radius (25 by default)"),Vs.prototype.publish("radiusAsPercent",!1,"boolean","Calculate RadiusX + RadiusY as % of size"),Vs.prototype.publish("blur",15,"number","Point blur radius (15 by default)"),Vs.prototype.publish("maxWeight",void 0,"number","Clamp max weight to value (optional), omitting uses max data point",void 0,{optional:!0}),Vs.prototype.publish("minOpacity",.05,"number","Minimum point opacity (0.05 by default)"),vt(Hs,"simpleheat"),Hs.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:vt(function(t){return this._data=t,this},"data"),max:vt(function(t){return this._max=t,this},"max"),add:vt(function(t){return this._data.push(t),this},"add"),clear:vt(function(){return this._data=[],this},"clear"),radius:vt(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:vt(function(){this._width=this._canvas.width,this._height=this._canvas.height},"resize"),gradient:vt(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:vt(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:vt(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:vt(function(){return"undefined"!=typeof document?document.createElement("canvas"):new this._canvas.constructor},"_createCanvas")};var Ws=Math.PI/3,$s=[0,Ws,2*Ws,3*Ws,4*Ws,5*Ws];function qs(t){return t[0]}function Gs(t){return t[1]}function Us(){var t,e,i,n=0,o=0,a=1,s=1,r=qs,l=Gs;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 $s.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 L(h,"c"),L(c,"u"),vt(h,"hexbin"),vt(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(Ws),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)}L(qs,"ws"),L(Gs,"Ss"),L(Us,"As"),vt(qs,"pointX"),vt(Gs,"pointY"),vt(Us,"d3HexBin");const Xs=(L(C=class extends Ge{_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),ct.call(this),this.tooltipValueFormat_default(",.0f"),_t.call(this),this.tooltipHTML(t=>{const e=s.extent(t,t=>t.label),i=s.extent(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=Us().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),r=s.min(a,function(t){return t.length}),l=s.max(a,function(t){return t.length});this._dataMinWeight=r,this._dataMaxWeight=l;const h=e.selectAll(".hexagon").data(a,function(t){return t.i+"_"+t.j});h.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(h).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,r,l)}),h.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"),C);vt(Xs,"HexBin"),wt(Xs,"__inputs",[{id:"x",type:"any"},{id:"y",type:"number"}]);let Ys=Xs;Ys.prototype._class+=" chart_HexBin",Ys.prototype.implements(ct.prototype),Ys.prototype.implements(_t.prototype),Ys.prototype.publish("paletteID","Blues","set","Color palette for this widget",Ys.prototype._palette.switch(),{tags:["Basic","Shared"]}),Ys.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Ys.prototype.publish("binSize",20,"number","Bin radius",null,{range:{min:1,max:300,step:1}});const Qs=(L(M=class extends Xe{constructor(){super(),this.interpolate_default("linear")}},"_Line"),M);vt(Qs,"Line"),Qs.prototype._class+=" chart_Line";const Zs=(L(T=class extends Ls{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"),T);vt(Zs,"QuarterPie");let Js=Zs;Js.prototype._class+=" chart_QuarterPie",Js.prototype.publish("orientation","left","set","Determines the placement and start/end angle.",["left","right"]);const Ks=(P=class extends s.SVGWidget{_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=s.scaleLinear().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),i-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():n,r=this.lineWidth(),l=this.lineColor(),h=this.roundedCorners(),c=this.edgePadding();let u=o(this.data()[1]),p=o(this.data()[2]),d=o(this.data()[3]);const f=-a/2,y=a/2,_=this.upperTextRotation(),x=this.lowerTextRotation(),m=this.textPadding(),g=this.labelFontSize(),b=this.valueFontSize(),v=Math.max(g,b),w=i-c;if(v>0){for(;u-c<v;)u+=v;for(;p-u<v;)p+=v;for(;d-p<v;)d+=v;for(;w-d<v;)d-=v;for(;d-p<v;)p-=v;for(;p-u<v;)u-=v}let S=-i/2-this.lineWidth()/2,k=0,A=0,C=1,M="start",T="end";"vertical"===this.orientation()&&(S=0,k=i/2+this.lineWidth()/2,A=-90,M="end",T="start",C=-1),this._g.style("shape-rendering","crispEdges").attr("transform",`translate(${S},${k})rotate(${A})scale(1)`),this._leftLine.attr("fill",l).attr("height",a).attr("width",r).attr("x",c).attr("y",f).attr("rx",h).attr("ry",h),this._rightLine.attr("class","right-line").attr("fill",l).attr("height",a).attr("width",r).attr("x",w).attr("y",f).attr("rx",h).attr("ry",h),this._midLine.attr("fill",l).attr("height",r).attr("width",w-c).attr("x",c).attr("y",-r/2),this._midOuterRect.attr("fill",l).attr("height",a).attr("width",d-u).attr("x",u).attr("y",f).attr("rx",h).attr("ry",h),this._midInnerRect1.attr("fill",this.innerRectColor()).attr("height",a-2*r).attr("width",p-(u+2*r)).attr("x",u+r).attr("y",r-a/2).attr("rx",.618*h).attr("ry",.618*h),this._midInnerRect2.attr("fill",this.innerRectColor()).attr("height",a-2*r).attr("width",d-p-r).attr("x",p).attr("y",r-a/2).attr("rx",.618*h).attr("ry",.618*h),this._q0text.attr("height",a).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","hanging").text(this.columns()[0]),this._q1text.attr("height",a).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[1]),this._q2text.attr("height",a).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[2]),this._q3text.attr("height",a).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","middle").text(this.columns()[3]),this._q4text.attr("height",a).attr("width",d-u).attr("display",this.showLabels()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${f-m})rotate(${_})scale(${C})`).attr("font-size",g).attr("text-anchor",M).attr("alignment-baseline","baseline").text(this.columns()[4]),this._q0val.attr("height",a).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${c}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","hanging").text(this.data()[0]),this._q1val.attr("height",a).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${u}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[1]),this._q2val.attr("height",a).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${p}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[2]),this._q3val.attr("height",a).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${d}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","middle").text(this.data()[3]),this._q4val.attr("height",a).attr("width",d-u).attr("display",this.showValues()?null:"none").attr("fill",this.textColor()).attr("x",0).attr("y",0).attr("transform",`translate(${w+r}, ${y+m})rotate(${x})scale(${C})`).attr("font-size",b).attr("text-anchor",T).attr("alignment-baseline","baseline").text(this.data()[4])}},L(P,"_QuartileCandlestick"),P);vt(Ks,"QuartileCandlestick");let tr=Ks;tr.prototype._class+=" chart_QuartileCandlestick",tr.prototype.publish("textColor","black","html-color","Color of label and value text"),tr.prototype.publish("showLabels",!0,"boolean","If true, labels will be shown"),tr.prototype.publish("showValues",!0,"boolean","If true, values will be shown"),tr.prototype.publish("orientation","horizontal","set","Determines layout",["horizontal","vertical"]),tr.prototype.publish("valueFontSize",12,"number","Font size of value text (pixels)"),tr.prototype.publish("labelFontSize",12,"number","Font size of label text (pixels)"),tr.prototype.publish("roundedCorners",8,"number","Radius of rounded rect corners (pixels)"),tr.prototype.publish("lineWidth",4,"number","Width of lines (pixels)"),tr.prototype.publish("candleWidth",null,"number","Height of outer rect (pixels)",null,{optional:!0}),tr.prototype.publish("textPadding",8,"number","Padding between outer rect and text (pixels)"),tr.prototype.publish("edgePadding",30,"number","Padding between outer rect and left/right sides (pixels)"),tr.prototype.publish("lineColor","#333","html-color","Color of outer rect and lines"),tr.prototype.publish("innerRectColor","white","html-color","Color of the inner rects"),tr.prototype.publish("upperTextRotation",-60,"number","Rotation of label text (degrees)"),tr.prototype.publish("lowerTextRotation",-60,"number","Rotation of value text (degrees)");const er=(I=class extends s.SVGWidget{constructor(){super(),ft.call(this),_t.call(this),s.Utility.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(),r=this.data(),l=this.flattenData(a,r).map((t,e)=>(t.shape=this.mapShape(this.pointShape()),t.column=a[t.colIdx],t.row=r[e],t)),h=[],c=this.degrees2radians(360/this.data().length),u=this.fontSize();let p=0;l.filter(t=>1===t.colIdx).forEach(t=>{const e=super.textSize(t.label,`${this.fontFamily()}`,this.fontSize());p<e.width&&(p=e.width)});const d=Math.min(n-u,o-p),f=e.selectAll(".label").data(l.filter(t=>1===t.colIdx)),y=Math.max.apply(i,l.map(t=>t.value));f.enter().append("text").attr("class","label").attr("text-anchor","middle").merge(f).attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).each(function(t,e){const n=i.polar2cartesian(d,e*c-Math.PI/2);h.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,s.select(this).attr("text-anchor",o).attr("x",n[0]).attr("y",n[1])}).text(t=>t.label),f.exit().remove();const _=e.selectAll(".domain").data(l.filter(t=>1===t.colIdx));_.enter().append("line").classed("domain",!0).style("stroke","#000").style("stroke-opacity","0.75").style("stroke-width","1px").merge(_).attr("x1",0).attr("y1",0).attr("x2",(t,e)=>h[e][0]).attr("y2",(t,e)=>h[e][1]),_.exit().remove();const x=e.selectAll(".value_guide").data(this.valueGuideRatios());x.enter().append("polygon").classed("value_guide",!0).style("stroke","grey").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(x).each(function(t,e){const i=[];h.forEach((e,n)=>{i.push([e[0]*t,e[1]*t])}),s.select(this).attr("points",i.join(" ")).attr("stroke","rgb(0, 0, 0)").attr("stroke-opacity",.75).attr("stroke-width",.3).attr("fill-opacity",0)}),x.exit().remove();const m=e.selectAll(".value_guide_text").data(this.valueGuideRatios());m.enter().append("text").attr("class","value_guide_text").attr("text-anchor","start").attr("font-size",this.fontSize()).attr("font-family",this.fontFamily()).merge(m).attr("x",2).attr("y",t=>h[0][1]*t).text((t,e)=>Math.round(t*y)),x.exit().remove();const g=e.selectAll(".area").data(a.filter((t,e)=>e>0));g.enter().append("polygon").attr("class","area").style("stroke-opacity","0.75").style("stroke-width","0.3px").merge(g).style("stroke",t=>this.strokeColor([],t,0)).style("fill",t=>this.fillColor([],t,0)).style("fill-opacity",this.fillOpacity()).attr("points",(t,e)=>h.map((t,i)=>{const n=r[i][e+1],o=0===n?0:n/y;return t[0]*o+","+t[1]*o}).join(" ")),g.exit().remove();const b=e.selectAll(".point").data(l);b.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=s.select(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(b).each(function(t){const e=s.select(this),n=0===t.value?0:t.value/y,o=h[t.rowIdx][0]*n,a=h[t.rowIdx][1]*n;e.select(".pointSelection").attr("cx",o).attr("cy",a);const r=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(r,o,a)}),b.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}},L(I,"_Radar"),I);vt(er,"Radar");let ir=er;ir.prototype._class+=" chart_Radar",ir.prototype.implements(ft.prototype),ir.prototype.implements(_t.prototype),ir.prototype.mixin(s.Utility.SimpleSelectionMixin),ir.prototype.publish("paletteID","default","set","Color palette for this widget",ir.prototype._palette.switch()),ir.prototype.publish("pointShape","cross","set","pointShape",["circle","rectangle","cross"]),ir.prototype.publish("pointSize",6,"number","Point Size",null,{range:{min:1,step:1,max:200}}),ir.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"),ir.prototype.publish("fillOpacity",.66,"number","Opacity of the data polygon(s)"),ir.prototype.publish("fontFamily","","string","fontFamily"),ir.prototype.publish("fontSize",16,"number","fontSize"),ir.prototype.publish("labelPaddingRatio",.9,"number","labelPaddingRatio");const nr=(E=class extends s.SVGWidget{_domainScale=s.scaleBand();_valueScale=s.scaleLinear();_d3Arc=Qt().startAngle(0).endAngle(t=>this._valueScale(t[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),ft.call(this),_t.call(this),s.Utility.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,r=Math.min(this.width()-2*(10+a),this.height()-44)/2,l=this.data().map(t=>t[0]);this._domainScale.domain(l).range([0,r]).padding(this.domainPadding());const h=this._domainScale.step()*this._domainScale.padding(),c=this._radialAxis.selectAll("circle").data(l);c.enter().append("circle").attr("fill","transparent").merge(c).attr("r",t=>this._domainScale(t)+this._domainScale.step()-h/2),c.exit().remove();const u=this._radialAxis.selectAll(".arc-text").data(l);u.enter().append("text").attr("class","arc-text").attr("x",-4).attr("alignment-baseline","middle").attr("text-anchor","end").merge(u).attr("y",t=>-this._domainScale(t)-this._domainScale.bandwidth()/2).text(t=>t),u.exit().remove();const p=this._axialAxis.selectAll("line").data(o);p.enter().append("line").merge(p).attr("x2",t=>r*Math.cos(this._valueScale(t)-this.radians(90))).attr("y2",t=>r*Math.sin(this._valueScale(t)-this.radians(90))),p.exit().remove();const d=this._axialAxis.selectAll("text").data(o);d.enter().append("text").style("dominant-baseline","central").merge(d).attr("x",t=>(r+10)*Math.cos(this._valueScale(t)-this.radians(90))).attr("y",t=>(r+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),d.exit().remove();const f=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 y=this._arcs.selectAll("path").data(this.data(),t=>t[0]);y.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),f,i._selection.selected(this))}).on("dblclick",function(t,e){i.dblclick(i.rowToObj(t),f,i._selection.selected(this))}).merge(y).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=s.interpolate(t._current||0,t[1]);return t._current=t[1],n=>this._d3Arc([t[0],i(n)],e)}),y.exit().remove()}degrees(t){return 180*t/Math.PI}radians(t){return t*Math.PI/180}},L(E,"_RadialBar"),E);vt(nr,"RadialBar"),wt(nr,"__inputs",[{id:"label",type:"any"},{id:"values",type:"number"}]);let or=nr;or.prototype._class+=" chart_RadialBar",or.prototype.implements(ft.prototype),or.prototype.implements(_t.prototype),or.prototype.mixin(s.Utility.SimpleSelectionMixin),or.prototype.publish("paletteID","default","set","Color palette for this widget",or.prototype._palette.switch()),or.prototype.publish("tickCount",10,"number","Number of ticks to display"),or.prototype.publish("domainPadding",.25,"number","Padding between chart edge and container edge (0..1)"),or.prototype.publish("valueMaxAngle",270,"number","Maximum angular length of a bar (degrees)"),or.prototype.publish("valueDomainHigh",null,"number","Value domain high",void 0,{optional:!0}),or.prototype.publish("transitionDelay",100,"number","Delay between the start of each row animation (ms)"),or.prototype.publish("transitionDuration",750,"number","Duration of a row's animation (ms)");const ar=s.Palette.rainbow("Blues"),sr=s.Palette.ordinal("Quartile",[ar(100,0,100),ar(50,0,100),ar(50,0,100),ar(75,0,100)]);function rr(t){const e=s.format(t);return function(t){const i=(Math.round(100*t)/100).toString();return i.length<=4?i:e(t)}}L(rr,"Ls"),sr("Std. Dev."),sr("MinMax"),sr("25%"),sr("50%"),vt(rr,"myFormatter");const lr=(F=class extends s.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=(new Xe).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 tr).columns(["Min","25%","50%","75%","Max"]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(ar(90,0,100)).innerRectColor(ar(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=rr(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)}},L(F,"_StatChart"),F);vt(lr,"StatChart");let hr=lr;hr.prototype._class+=" chart_StatChart",hr.prototype.publish("view","min_max","set","View",["min_max","25_75","normal"]),hr.prototype.publish("tickFormat",".2e","string","X-Axis Tick Format"),hr.prototype.publish("candleHeight",20,"number","Height of candle widget (pixels)"),hr.prototype.publish("domainPadding",10,"number","Domain value padding"),hr.prototype.publish("mean",.5,"number","Mean"),hr.prototype.publish("standardDeviation",.125,"number","Standard Deviation (σ)"),hr.prototype.publish("quartiles",[0,.25,.5,.75,1],"object","Quartiles (Min, 25%, 50%, 75%, Max)");const cr=(L(D=class extends Xe{constructor(){super(),this.interpolate_default("step")}},"_Step"),D);vt(cr,"Step"),cr.prototype._class+=" chart_Step";const ur="text",pr="html",dr=(R=class extends s.HTMLWidget{_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()?pr:ur](n.value),this._textDiv.style("font-size",this.textFontSize()+"px")[this.labelHTML()?pr:ur](n.label);const o=this,a=this._mainDiv.selectAll(".more").data([n]),r=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=s.select(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",s.rgb(n.fill).darker(.75).toString());r.select("i").attr("class",function(t){return"fa "+t.moreIcon}),this.moreTextHTML()?r.select("span").each(function(t){this.innerHTML=t.moreText}):r.select("span").text(t=>t.moreText),a.exit().remove()}exit(t,e){super.exit(t,e)}},L(R,"_Summary"),R);vt(dr,"Summary");let fr=dr;fr.prototype._class+=" chart_Summary",fr.prototype.implements(ht.prototype),fr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),fr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),fr.prototype.publish("headerFontSize",null,"number","headerFontSize"),fr.prototype.publish("textFontSize",null,"number","textFontSize"),fr.prototype.publish("moreFontSize",null,"number","moreFontSize"),fr.prototype.publish("iconFontSize",null,"number","iconFontSize"),fr.prototype.publish("hideLabel",!1,"boolean","Hide label column"),fr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("labelHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideLabel(),"disable")}),fr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),fr.prototype.publish("valueHTML",!1,"boolean","Allow HTML"),fr.prototype.publish("hideMore",!1,"boolean","Hide More Information"),fr.prototype.publish("hideMoreWrapper",!1,"boolean","Hide More Information Wrapper"),fr.prototype.publish("moreWrapperHeight",null,"number","Height of the 'more' text wrapper (pixels)"),fr.prototype.publish("moreIconColumn",null,"set","Select More Icon Column",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreIcon","fa-info-circle","string","FA Char icon class",null,{disable:vt(t=>t.hideMore()||t.moreIconColumn(),"disable")}),fr.prototype.publish("moreTextColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0,disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("moreText","More Info","string","More text",null,{disable:vt(t=>t.hideMore()||t.moreTextColumn(),"disable")}),fr.prototype.publish("moreTextHTML",!1,"boolean","Allow HTML",null,{disable:vt(t=>t.hideMore(),"disable")}),fr.prototype.publish("colorFillColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorFill","#3498db","html-color","Fill Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),fr.prototype.publish("colorStrokeColumn",null,"set","Column for color",function(){return this.columns()},{optional:!0}),fr.prototype.publish("colorStroke","#ffffff","html-color","Fill Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),fr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),fr.prototype.publish("minWidth",225,"number","Minimum Width"),fr.prototype.publish("minHeight",150,"number","Minimum Height"),fr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0});const yr=fr.prototype.playInterval;fr.prototype.playInterval=function(t){const e=yr.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 _r=(z=class extends s.CanvasWidget{_playIntervalIdx=0;constructor(){super(),ht.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(),r=this.columns().indexOf(this.labelColumn()),l=this.columns().indexOf(this.valueColumn()),h=this.columns().indexOf(this.colorFillColumn()),c=this.columns().indexOf(this.colorStrokeColumn()),u=this.columns().indexOf(this.iconColumn()),p=-1!==u?this.currentRow()[u]:this.icon(),d=-1!==r?this.currentRow()[r]:"",f=-1!==l?this.currentRow()[l]:"",y=-1!==h?this.currentRow()[h]:this.colorFill(),_=-1!==c?this.currentRow()[c]:this.colorStroke();let x=n.height*(a-this.paddingSizeRatio());const m=n.height*(1-a-this.paddingSizeRatio()),g=n.height*(this.iconSizeRatio()-this.paddingSizeRatio()),b=o*this.paddingSizeRatio(),v=t.getContext("2d");v.clearRect(0,0,n.width,n.height);const w=i.fontFamily();function S(t,e,i,o){v.textBaseline="top",v.font=`${i}px ${w}`,v.fillStyle=_;let a=v.measureText(t);a.width>n.width-2*b&&(i*=(n.width-2*b)/a.width,v.font=`${i}px ${w}`,a=v.measureText(t));const s=A(a.width,o);return v.fillText(t,s,e),i}function k(t,e,o){if(void 0===t)return;v.textBaseline=i.iconBaseline(),v.font=`${e}px FontAwesome`,v.fillStyle=_;let a=v.measureText(t);if(a.width>n.width-2*b){const i=(n.width-2*b)/a.width;v.font=e*i+"px FontAwesome",a=v.measureText(t)}const s=A(a.width,o),r=C(i.iconBaseline());v.fillText(t,s,r)}function A(t,e){switch(e){case"start":return b;case"middle":return n.width/2-t/2;case"end":return n.width-t-b}}function C(t){switch(t){case"top":return b;case"middle":return n.height/2;case"bottom":return n.height-b}}L(S,"A"),L(k,"k"),L(A,"M"),L(C,"P"),v.fillStyle=y,v.fillRect(0,0,n.width,n.height),v.globalAlpha=this.iconOpacity(),k(s.Utility.faChar(p),g,i.iconAnchor()),v.globalAlpha=this.valueOpacity(),x=S(f,b,x,i.valueAnchor()),v.globalAlpha=this.labelOpacity(),S(d,x+b,m,i.labelAnchor()),vt(S,"drawText"),vt(k,"drawIcon"),vt(A,"getTextOffsetX"),vt(C,"getTextOffsetY")}},L(z,"_SummaryC"),z);vt(_r,"SummaryC");let xr=_r;xr.prototype._class+=" chart_SummaryC",xr.prototype.implements(ht.prototype),xr.prototype.publish("iconBaseline","bottom","string","Text baseline for the icon",["top","middle","bottom"]),xr.prototype.publish("iconAnchor","end","set","Anchors the icon either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("valueAnchor","start","set","Anchors the value either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("labelAnchor","start","set","Anchors the label either at the start, middle, or end of the summary",["start","middle","end"]),xr.prototype.publish("iconColumn",null,"set","Select Icon Column",function(){return this.columns()},{optional:!0}),xr.prototype.publish("icon","fa-briefcase","string","FA Char icon class",null,{disable:vt(t=>t.iconColumn(),"disable")}),xr.prototype.publish("fontFamily","Arial","string","Font Family"),xr.prototype.publish("labelColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("valueColumn",null,"set","Select display value",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFillColumn",null,"set","Column for background color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorFill","#0097e6","html-color","Background Color",null,{disable:vt(t=>t.colorFillColumn(),"disable")}),xr.prototype.publish("colorStrokeColumn",null,"set","Column for font color",function(){return this.columns()},{optional:!0}),xr.prototype.publish("colorStroke","#2f3640","html-color","Font Color",null,{disable:vt(t=>t.colorStrokeColumn(),"disable")}),xr.prototype.publish("fixedSize",!0,"boolean","Fix Size to Min Width/Height"),xr.prototype.publish("minWidth",225,"number","Minimum Width"),xr.prototype.publish("minHeight",150,"number","Minimum Height"),xr.prototype.publish("playInterval",null,"number","Play Interval",null,{optional:!0}),xr.prototype.publish("fontSizeRatio",.618,"number","Ratio between widget height and value font size"),xr.prototype.publish("valueOpacity",1,"number","Opacity of value text (0..1)"),xr.prototype.publish("labelOpacity",.9,"number","Opacity of label text (0..1)"),xr.prototype.publish("iconOpacity",.3,"number","Opacity of icon text (0..1)"),xr.prototype.publish("paddingSizeRatio",.1,"number","Ratio of the smallest dimension for edge padding (0..1)"),xr.prototype.publish("iconSizeRatio",.9,"number","Ratio of the height for icon size (0..1)");const mr=xr.prototype.playInterval;xr.prototype.playInterval=function(t){const e=mr.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 gr=Math.PI/180,br=2048;function vr(){const t=s.dispatch("word","end"),e={};let i=[256,256],n=wr,o=Sr,a=Ar,r=kr,l=kr,h=Cr,c=Mr,u=[],p=Fr,d=1/0,f=null,y=Math.random,_=zr;function x(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=br/e;const i=t.getContext("2d");return i.fillStyle=i.strokeStyle="red",i.textAlign="center",{context:i,ratio:e}}function m(t,e,n){const o=e.x,a=e.y,s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),r=p(i),l=y()<.5?1:-1;let h,c,u,d=-l;for(;(h=r(d+=l))&&(c=~~h[0],u=~~h[1],!(Math.min(Math.abs(c),Math.abs(u))>=s));)if(e.x=o+c,e.y=a+u,!(e.x+e.x0<0||e.y+e.y0<0||e.x+e.x1>i[0]||e.y+e.y1>i[1])&&(!n||!Pr(e,t,i[0]))&&(!n||Er(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 L(x,"x"),L(m,"m"),e.canvas=function(t){return arguments.length?(_=Or(t),e):_},e.start=function(){const s=x(_()),p=Rr((i[0]>>5)*i[1]);let g=null;const b=u.length;let v=-1;const w=[],S=u.map(function(t,e){return t.text=n.call(this,t,e),t.font=o.call(this,t,e),t.style=r.call(this,t,e),t.weight=l.call(this,t,e),t.rotate=h.call(this,t,e),t.size=~~a.call(this,t,e),t.padding=c.call(this,t,e),t}).sort(function(t,e){return e.size-t.size});return f&&clearInterval(f),f=setInterval(k,0),k(),e;function k(){const n=Date.now();for(;Date.now()-n<d&&++v<b&&f;){const n=S[v];n.x=i[0]*(y()+.5)>>1,n.y=i[1]*(y()+.5)>>1,Tr(s,n,S,v),n.hasText&&m(p,n,g)&&(w.push(n),t.call("word",e,n),g?Ir(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 f&&(clearInterval(f),f=null),e},vt(x,"getContext"),vt(m,"place"),e.timeInterval=function(t){return arguments.length?(d=null==t?1/0:t,e):d},e.words=function(t){return arguments.length?(u=t,e):u},e.size=function(t){return arguments.length?(i=[+t[0],+t[1]],e):i},e.font=function(t){return arguments.length?(o=Or(t),e):o},e.fontStyle=function(t){return arguments.length?(r=Or(t),e):r},e.fontWeight=function(t){return arguments.length?(l=Or(t),e):l},e.rotate=function(t){return arguments.length?(h=Or(t),e):h},e.text=function(t){return arguments.length?(n=Or(t),e):n},e.spiral=function(t){return arguments.length?(p=jr[t]||t,e):p},e.fontSize=function(t){return arguments.length?(a=Or(t),e):a},e.padding=function(t){return arguments.length?(c=Or(t),e):c},e.random=function(t){return arguments.length?(y=t,e):y},e.on=function(){const i=t.on.apply(t,arguments);return i===t?e:i},e}function wr(t){return t.text}function Sr(){return"serif"}function kr(){return"normal"}function Ar(t){return Math.sqrt(t.value)}function Cr(){return 30*(~~(6*Math.random())-3)}function Mr(){return 1}function Tr(t,e,i,n){if(e.sprite)return;const o=t.context,a=t.ratio;o.clearRect(0,0,2048/a,br/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*gr),n=Math.cos(e.rotate*gr),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>=br)break;o.translate((s+(t>>1))/a,(r+(h>>1))/a),e.rotate&&o.rotate(e.rotate*gr),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,br/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 Pr(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 Ir(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 Er(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 Fr(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function Dr(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 Rr(t){const e=[];let i=-1;for(;++i<t;)e[i]=0;return e}function zr(){return document.createElement("canvas")}function Or(t){return"function"==typeof t?t:function(){return t}}L(vr,"tr"),L(wr,"er"),L(Sr,"ir"),L(kr,"nr"),L(Ar,"or"),L(Cr,"ar"),L(Mr,"sr"),L(Tr,"rr"),L(Pr,"lr"),L(Ir,"hr"),L(Er,"cr"),L(Fr,"ur"),L(Dr,"pr"),L(Rr,"dr"),L(zr,"fr"),L(Or,"yr"),vt(vr,"d3Cloud"),vt(wr,"cloudText"),vt(Sr,"cloudFont"),vt(kr,"cloudFontNormal"),vt(Ar,"cloudFontSize"),vt(Cr,"cloudRotate"),vt(Mr,"cloudPadding"),vt(Tr,"cloudSprite"),vt(Pr,"cloudCollide"),vt(Ir,"cloudBounds"),vt(Er,"collideRects"),vt(Fr,"archimedeanSpiral"),vt(Dr,"rectangularSpiral"),vt(Rr,"zeroArray"),vt(zr,"cloudCanvas"),vt(Or,"functor");const jr={archimedean:Fr,rectangular:Dr},Lr=(O=class extends s.SVGWidget{_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),ht.call(this),_t.call(this),s.Utility.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=s.zoom().scaleExtent([.1,10]),this._d3Zoom.on("zoom",function(t){const e=s.d3Event();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=vr().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());const i=this.calcData(),n=this,o=s.extent(i,function(t){return t.__viz_weight});let a;switch(this.scaleMode()){case"log":a=s.scaleLog;break;case"sqrt":a=s.scaleSqrt;break;case"pow":a=s.scalePow;break;default:a=s.scaleLinear}const r=a().domain(o).range([this.fontSizeFrom(),this.fontSizeTo()]),l=s.scaleLinear().domain([0,n.angleCount()-1]).range([n.angleFrom(),n.angleTo()]);function h(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 r(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()}L(h,"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 r(t.__viz_weight)}).rotate((t,e)=>l(e%n.angleCount())).on("word",t=>{}).on("end",h).start(),vt(h,"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}}},L(O,"_WordCloud"),O);vt(Lr,"WordCloud"),wt(Lr,"__inputs",[{id:"label",type:"string"},{id:"value",type:"number"}]);let Nr=Lr;function Br(){const t=s.timeFormat(".%L"),e=s.timeFormat(":%S"),i=s.timeFormat("%H:%M"),n=s.timeFormat("%H:00"),o=s.timeFormat("%b %d"),a=s.timeFormat("%b"),r=s.timeFormat("%Y");return s=>0!==s.getMilliseconds()?t(s):0!==s.getSeconds()?e(s):0!==s.getMinutes()?i(s):0!==s.getHours()?n(s):1!==s.getDate()?o(s):0!==s.getMonth()?a(s):r(s)}L(Br,"gr"),Nr.prototype._class+=" chart_WordCloud",Nr.prototype.implements(ht.prototype),Nr.prototype.implements(_t.prototype),Nr.prototype.mixin(s.Utility.SimpleSelectionMixin),Nr.prototype.publish("paletteID","default","set","Color palette for this widget",Nr.prototype._palette.switch(),{tags:["Basic","Shared"]}),Nr.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Nr.prototype.publish("fontFamily","Impact","string","Font Name",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeFrom",6,"number","Minimum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("fontSizeTo",48,"number","Maximum font size (pixels)",null,{tags:["Basic"]}),Nr.prototype.publish("angleFrom",-60,"number","Minimum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleTo",60,"number","Maximum angle (degrees)",null,{tags:["Basic"]}),Nr.prototype.publish("angleCount",5,"number","Number of different angles",null,{tags:["Basic"]}),Nr.prototype.publish("padding",0,"number","Padding between words (pixels)",null,{tags:["Intermediate"]}),Nr.prototype.publish("scaleMode","linear","set","Text scaling mode",["linear","log","sqrt","pow"],{tags:["Intermediate"]}),Nr.prototype.publish("spiral","archimedean","set","Text scaling mode",["archimedean","rectangular"],{tags:["Intermediate"]}),Nr.prototype.publish("offsetX",0,"number","X offset",null,{tags:["Advanced"]}),Nr.prototype.publish("offsetY",0,"number","Y offset",null,{tags:["Advanced"]}),Nr.prototype.publish("zoom",1,"number","Zoom",null,{tags:["Advanced"]}),vt(Br,"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 Vr=["label","start","end","icon","color","series"],Hr=class _WUTimeline extends c.ReactTimelineSeries{_palette=s.Palette.ordinal("default");constructor(){super(),this.columns(Vr).titleColumn("label").iconColumn("icon").colorColumn("color").seriesColumn("series").timePattern("%Y-%m-%dT%H:%M:%S.%LZ").tickFormatFunc(Br()).tooltipTimeFormat("%H:%M:%S.%L").tooltipHTML(t=>t[Vr.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){const t=a.hashSum({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});if(this._prevHashSum!==t){this._prevHashSum=t;i.Workunit.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)}};L(Hr,"WUTimeline");let Wr=Hr;Wr.prototype._class+=" eclwatch_WUTimeline",Wr.prototype.publish("baseUrl","","string","HPCC Platform Base URL"),Wr.prototype.publish("wuid","","string","Workunit ID"),Wr.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"),t.BUILD_VERSION="3.25.0",t.ECLArchiveViewer=B,t.PKG_NAME="@hpcc-js/eclwatch",t.PKG_VERSION="3.6.12",t.STATUS=it,t.STATUS_ACTIVE=nt,t.WUGraph=Y,t.WUResult=et,t.WUScopeController=U,t.WUStatus=at,t.WUTimeline=Wr,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hpcc-js/codemirror"),require("@hpcc-js/comms"),require("@hpcc-js/phosphor"),require("@hpcc-js/tree"),require("@hpcc-js/util"),require("@hpcc-js/common"),require("@hpcc-js/dgrid"),require("@hpcc-js/graph"),require("@hpcc-js/layout"),require("@hpcc-js/timeline")):typeof define==`function`&&define.amd?define([`exports`,`@hpcc-js/codemirror`,`@hpcc-js/comms`,`@hpcc-js/phosphor`,`@hpcc-js/tree`,`@hpcc-js/util`,`@hpcc-js/common`,`@hpcc-js/dgrid`,`@hpcc-js/graph`,`@hpcc-js/layout`,`@hpcc-js/timeline`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`@hpcc-js/eclwatch`]={},e[`@hpcc-js/codemirror`],e[`@hpcc-js/comms`],e[`@hpcc-js/phosphor`],e[`@hpcc-js/tree`],e[`@hpcc-js/util`],e[`@hpcc-js/common`],e[`@hpcc-js/dgrid`],e[`@hpcc-js/graph`],e[`@hpcc-js/layout`],e[`@hpcc-js/timeline`]))})(this,function(e,t,n,r,i,a,o,s,c,l,u){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var d=`@hpcc-js/eclwatch`,f=`3.7.0`,p=`3.26.0`,ECLArchiveViewer=class extends r.SplitPanel{_prevHash;_contentStr;_directoryPane=new i.DirectoryTree;_fileEditorPane=new t.Editor().text(``);constructor(){super(`horizontal`),this._directoryPane.rowClick=e=>{this._fileEditorPane.text(e).render()}}transformArchiveTreeData(e){let t={label:e.name,children:e._children.map(transformNode).filter(e=>e)};if(t.children&&t.children[0]&&t.children[0].label===`html`)return{label:`root`,children:[{label:`error`,content:JSON.stringify(t,null,4)}]};return t;function transformNode(e){let t={};if(t.label=e.name+(e.$&&e.$.key?` (${e.$.key})`:``),e._children&&e._children.length>0)t.children=e._children.map(e=>transformNode(e)).filter(e=>e);else if(typeof e.content==`string`&&e.content.trim())t.content=e.content;else return!1;return t}}updateDirectoryPane(e){let t;if(e)try{t=JSON.parse(e)}catch{t=(0,a.xml2json)(e)}if(t){let e=this.transformArchiveTreeData(t);this._directoryPane.data(e).render()}}enter(e,t){super.enter(e,t),this.addWidget(this._directoryPane).addWidget(this._fileEditorPane)}update(e,t){super.update(e,t);let r=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==r||this._contentStr===void 0?n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchArchive().then(e=>{this._contentStr=e,this.updateDirectoryPane(this._contentStr),this._prevHash=r}):this.updateDirectoryPane(this._contentStr),this.relativeSizes([this.directoryWidthRatio(),1-this.directoryWidthRatio()])}};ECLArchiveViewer.prototype._class+=` eclwatch_ECLArchiveViewer`,ECLArchiveViewer.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),ECLArchiveViewer.prototype.publish(`wuid`,``,`string`,`Workunit ID`),ECLArchiveViewer.prototype.publish(`directoryWidthRatio`,.38,`number`,`Default directory panel width ratio relative to the full width`),ECLArchiveViewer.prototype.publish(`contentString`,null,`string`,`XML/JSON archive content string`),ECLArchiveViewer.prototype.publishProxy(`directoryPaneColor`,`_directoryPane`,`backgroundColor`),ECLArchiveViewer.prototype.publishProxy(`directoryPaneHoverColor`,`_directoryPane`,`hoverBackgroundColor`),ECLArchiveViewer.prototype.publishProxy(`iconSize`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontColor`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontFamily`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`fontSize`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`folderIconOpen`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`folderIconClosed`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`textFileIcon`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`codeFileIcon`,`_directoryPane`),ECLArchiveViewer.prototype.publishProxy(`verticalScroll`,`_directoryPane`);var LegendVertex=class extends c.Vertex{constructor(){super()}enter(e,t){super.enter(e,t),this._icon.on(`click`,()=>{this.click(this.data())})}click(e){}},WUGraphLegend=class extends l.Legend{icon=(0,o.local)();_disabled2={};disabled(e){if(!arguments.length){let e=[];for(let t in this._disabled2)this._disabled2[t]&&e.push(t);return e}return this._disabled2={},e.forEach(e=>this._disabled2[e]=!0),this}toggle(e){this._disabled2[e]=!this._disabled2[e]}update(e,t){super.update(e,t);let n=this,r=this._g.selectAll(`.legendItem`).data(this.data(),e=>e.kind);r.enter().append(`g`).attr(`class`,`legendItem`).each(function(e){n.icon.set(this,new LegendVertex().target(this).data(e.kind).textbox_shape_colorStroke(`none`).textbox_shape_colorFill(`none`).iconAnchor(`left`).faChar(e.faChar).text(`${e.label} (${e.count})`).tooltip(`${e.kind} - ${e.label}`).on(`click`,e=>{n.toggle(e),n.render(),n.click(e)}).on(`mouseover`,e=>{n.mouseover(e)}).on(`mouseout`,e=>{n.mouseout(e)}))}).merge(r).each(function(e,t){let r=n.icon.get(this).icon_shape_colorFill(n._disabled2[e.kind]?`gray`:null).render().getBBox();(0,o.select)(this).attr(`transform`,`translate(${r.width/2}, ${t*30})`)}),r.exit().each(function(e){n.icon.get(this).target(null).render()}).remove();let i=this.getBBox(!0,!0);this._g.attr(`transform`,`translate(16, ${this.height()/2-i.height/2})`)}click(e){}mouseover(e){}mouseout(e){}};WUGraphLegend.prototype._class+=` eclwatch_WUGraphLegend`;function faCharFactory(e){switch(e){case`2`:return``;case`3`:return``;case`5`:return``;case`6`:return``;case`12`:return``;case`15`:return``;case`17`:return``;case`22`:return``;case`23`:return``;case`25`:return``;case`26`:return``;case`29`:return``;case`36`:return``;case`44`:return``;case`47`:return``;case`54`:return``;case`56`:return``;case`59`:return``;case`61`:return``;case`82`:return``;case`88`:return``;case`92`:return``;case`93`:return``;case`99`:return``;case`105`:return``;case`7`:return``;case`9`:return``;case`16`:return``;case`19`:return``;case`21`:return``;case`35`:return``;case`37`:return``;case`71`:return``;case`133`:return``;case`148`:return``;case`168`:return``}return``}var WUScopeController=class{graphDB;subgraphsMap={};rSubgraphsMap={};verticesMap={};rVerticesMap={};edgesMap={};rEdgesMap={};kindMap={};_disabled={};constructor(){}clear(){this.subgraphsMap={},this.rSubgraphsMap={},this.verticesMap={},this.rVerticesMap={},this.edgesMap={},this.rEdgesMap={}}set(e){this.graphDB=e,this.graphGui(this.graphDB),this.kindMap={},this.graphDB.walk(e=>{if(!(e instanceof a.Subgraph))if(e instanceof a.Vertex){let t=e._.attr(`Kind`).RawValue;this.kindMap[t]||(this.kindMap[t]=[]),this.kindMap[t].push(e)}else e instanceof a.Edge})}disabled(e){if(!arguments.length){let e=[];for(let t in this._disabled)this._disabled[t]&&e.push(t);return e}return this._disabled={},e.forEach(e=>this._disabled[e]=!0),this}graphGui(e){let t={subgraphs:[],vertices:[],edges:[],hierarchy:[]};return e.walk(e=>{if(e instanceof a.Subgraph){let n=this.appendSubgraph(e,t.hierarchy,t.subgraphs);n.showMinMax(e.vertices.length>3||n.minState()!==`normal`)}else e instanceof a.Vertex?this.appendVertex(e,t.hierarchy,t.vertices):e instanceof a.Edge&&this.appendEdge(e,t.edges)}),t}format(e,t){let n=``,r=e.indexOf(`%`),i=-1;for(;r>=0;){if(n+=e.substring(i+1,r),i=e.indexOf(`%`,r+1),i<0){console.warn(`Invalid Label Template`);break}let a=e.substring(r+1,i);n+=a?t[e.substring(r+1,i)]||``:`%`,r=e.indexOf(`%`,i+1)}return n+=e.substring(i+1,e.length),n.split(`\\n`).join(`
|
|
2
|
+
`)}createSubgraph(e){let t=this.subgraphsMap[e._.Id];return t||(t=new c.Subgraph().title(e._.Id).on(`minClick`,()=>{this.minClick(t)}),this.subgraphsMap[e._.Id]=t,this.rSubgraphsMap[t.id()]=e),t}createVertex(e){let t=this.verticesMap[e._.Id];if(!t){let n=e._.rawAttrs();if(e._.ScopeType===`dummy`){let n=this.subgraphsMap[e.parent._.Id];t=new o.Icon().shape_colorFill(`darkred`).shape_colorStroke(`darkred`).image_colorFill(`white`).faChar(``).on(`click`,()=>{n.minState(`normal`),this.minClick(n)})}else{t=new c.Vertex().icon_shape_colorFill(`#1f77b4`).icon_image_colorFill(`white`).faChar(faCharFactory(n.Kind)).text(n.Label);let r=[];e._.hasAttr(`Definition`)&&r.push({faChar:``,tooltip:`Definition`,shape_colorFill:`lightgray`,shape_colorStroke:`lightgray`,image_colorFill:`black`}),e._.hasAttr(`IsInternal`)&&r.push({faChar:``,tooltip:`IsInternal`,shape_colorFill:`red`,shape_colorStroke:`red`,image_colorFill:`white`}),t.annotationIcons(r)}this.verticesMap[e._.Id]=t,this.rVerticesMap[t.id()]=e}return t}isSpill(e){let t=e.source._.attr(`Kind`).RawValue,n=e.target._.attr(`Kind`).RawValue;return t===`2`||n===`71`}spansSubgraph(e){return e.source.parent._.Id!==e.target.parent._.Id}createEdge(e){let t=this.edgesMap[e._.Id];if(!t){let n=e._.rawAttrs(),r=this.verticesMap[e.source._.Id],i=this.verticesMap[e.target._.Id];if(r&&i){let a=this.isSpill(e),o=this.spansSubgraph(e),s=this.format(`%Label%
|
|
3
|
+
%NumRowsProcessed%`,n),l=null,u=100;n.IsDependency?(u=10,l=`1,5`):n._childGraph?l=`5,5`:a?(u=25,l=`5,5,10,5`):o&&(u=5,l=`5,5`),t=new c.Edge().sourceVertex(r).targetVertex(i).sourceMarker(`circle`).targetMarker(`arrow`).weight(u).strokeDasharray(l).text(s),this.edgesMap[e._.Id]=t,this.rEdgesMap[t.id()]=e}}return t}appendSubgraph(e,t,n){let r=this.createSubgraph(e);n.push(r);let i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendVertex(e,t,n){let r=this.createVertex(e);n.push(r);let i=this.subgraphsMap[e.parent._.Id];return i&&t.push({parent:i,child:r}),r}appendEdge(e,t){let n=this.createEdge(e);return n&&t.push(n),n}filterLegend(e){for(let t=e.vertices.length-1;t>=0;--t){let r=e.vertices[t],i=r._.attr(`Kind`).RawValue;this._disabled[i]&&r.remove(!1,(e,t)=>new n.BaseScope({ScopeName:r._.ScopeName+`:in`,Id:e.Id+`->`+t.Id,ScopeType:`dummy-edge`,Properties:{Property:[r._.attr(`Label`)]},Notes:{Note:[]},SinkActivity:``}))}}filterPartial(e){for(let t of e.subgraphs)switch(this.subgraphsMap[t._.Id].minState()){case`partial`:let e=t.vertices,r=[],i=[];for(let t of e)t.inEdges.length===0||t.inEdges.some(e=>e.source.parent!==e.target.parent)||t.outEdges.length===0||t.outEdges.some(e=>e.source.parent!==e.target.parent)?r.push(t):i.push(t);if(i.length>1){let e=new n.BaseScope({ScopeName:t._.ScopeName,Id:t._.Id+`:dummy`,ScopeType:`dummy`,Properties:{Property:[{Name:`Activities`,RawValue:``+i.length,Formatted:``+i.length,Measure:`count`,Creator:``,CreatorType:``}]},Notes:{Note:[]},SinkActivity:``}),a=t.createVertex(e);for(let e of i){for(let i of e.inEdges)if(r.indexOf(i.source)>=0){let e=new n.BaseScope({ScopeName:i.source._.ScopeName,Id:i.source._.Id+`->`+a._.Id,ScopeType:`dummy-in`,Properties:{Property:[]},Notes:{Note:[]},SinkActivity:``});t.createEdge(i.source,a,e)}for(let i of e.outEdges)if(r.indexOf(i.target)>=0){let e=new n.BaseScope({ScopeName:i.target._.ScopeName,Id:a._.Id+`->`+i.target._.Id,ScopeType:`dummy-out`,Properties:{Property:[]},Notes:{Note:[]},SinkActivity:``});t.createEdge(a,i.target,e)}}i.forEach(e=>e.remove(!0))}break}}filterEmptySubgraphs(e){for(;;){let t=e.subgraphs.filter(e=>e.subgraphs.length===0&&e.vertices.length===0);if(t.length===0)break;t.forEach(e=>e.remove(!0))}}removeObsoleteSubgraphs(e){for(let t of[...e.subgraphs])t.vertices.length===0&&t.remove(!1)}graphData(){let e=this.graphDB.clone();return this.filterLegend(e),this.filterPartial(e),this.filterEmptySubgraphs(e),this.removeObsoleteSubgraphs(e),this.graphGui(e)}calcLegend(){let e=[];for(let t in this.kindMap)e.push({kind:parseInt(t),faChar:faCharFactory(t),label:this.kindMap[t][0]._.attr(`Label`).RawValue.split(`
|
|
4
|
+
`)[0],count:this.kindMap[t].length});return e}vertices(e){let t=[];for(let n of this.kindMap[e])t.push(this.verticesMap[n._.Id]);return t}formatRow(e,t,n){let r=e._.formattedAttrs();for(let e in r){let i=t.indexOf(e);i===-1?(t.push(e),n.push(r[e])):n[i]=r[e]}for(let e=0;e<100;++e)n[e]===void 0&&(n[e]=``);return n}activityData(){let e=[`Id`,`Kind`,`Label`];return{columns:e,data:this.graphDB.vertices.map(t=>{let n=[parseInt(t._.Id.split(`a`)[1])];return this.formatRow(t,e,n)})}}edgeData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.edges.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}subgraphData(){let e=[`Id`,`Label`];return{columns:e,data:this.graphDB.subgraphs.map(t=>{let n=[t._.Id];return this.formatRow(t,e,n)})}}calcGraphTooltip(e){let t,n;if(e instanceof c.Subgraph){let r=this.rSubgraphsMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Vertex||e instanceof o.Icon){let r=this.rVerticesMap[e.id()];t=r._,n=r.parent._}else if(e instanceof c.Edge){let r=this.rEdgesMap[e.id()];t=r._,n=r.parent._}return t?t.calcTooltip(n):``}subgraph(e){return this.subgraphsMap[e]}vertex(e){return this.verticesMap[e]}edge(e){return this.edgesMap[e]}minClick(e){}},WUGraph=class extends l.ChartPanel{_partialAll=new o.Button().faChar(`fa-window-restore`).tooltip(`Partial All`).on(`click`,()=>{this.stateClick(this._partialAll)});_maxAll=new o.Button().faChar(`fa-window-maximize`).tooltip(`Max All`).on(`click`,()=>{this.stateClick(this._maxAll)});_toggleGraph=new o.ToggleButton().faChar(`fa-chain`).tooltip(`Graph`).selected(!0).on(`click`,()=>{this.viewClick(this._toggleGraph)});_toggleActivities=new o.ToggleButton().faChar(`fa-table`).tooltip(`Activitiies`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleActivities)});_toggleEdges=new o.ToggleButton().faChar(`fa-table`).tooltip(`Edges`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleEdges)});_toggleSubgraphs=new o.ToggleButton().faChar(`fa-table`).tooltip(`Subgraphs`).selected(!1).on(`click`,()=>{this.viewClick(this._toggleSubgraphs)});_graph=new c.Graph().layout(`Hierarchy`).applyScaleOnLayout(!0).showToolbar(!1).allowDragging(!1);_activities=new s.Table().pagination(!1);_edges=new s.Table().pagination(!1);_subgraphs=new s.Table().pagination(!1);_legend=new WUGraphLegend(this).on(`click`,e=>{this.render()}).on(`mouseover`,e=>{let t={};for(let n of this._gc.vertices(e))t[n.id()]=!0;this._graph.highlightVerticies(t)}).on(`mouseout`,e=>{this._graph.highlightVerticies()});_view=new l.Carousel().widgets([this._graph,this._activities,this._edges,this._subgraphs]);_gc=new WUScopeController;constructor(){super(),this.topOverlay(!1),this.widget(this._view);let e=[this._toggleGraph,this._toggleActivities,this._toggleEdges,this._toggleSubgraphs,new o.Spacer,this._partialAll,this._maxAll,new o.Spacer,...this._graph.iconBarButtons(),new o.Spacer];this.buttons(e.concat(this.buttons())),this._gc.minClick=e=>{this.loadGraph(),this._graph.render(t=>{this._graph.selection([e]).centerOnItem(e)})},this._graph.tooltipHTML(e=>this._gc.calcGraphTooltip(e))}stateClick(e){switch(e){case this._partialAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`partial`)});break;case this._maxAll:this._graph.data().subgraphs.forEach(e=>{e.minState(`normal`)});break}this.render()}viewClick(e){switch(this._toggleGraph.selected(e===this._toggleGraph),this._toggleActivities.selected(e===this._toggleActivities),this._toggleEdges.selected(e===this._toggleEdges),this._toggleSubgraphs.selected(e===this._toggleSubgraphs),e){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);break}this.render(e=>{})}_prevHashSum;_prevScopeGraph;fetchScopeGraph(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),graphID:this.graphID(),subgraphID:this.subgraphID()});return!this._prevScopeGraph||this._prevHashSum!==e?(this.startProgress(),this._prevHashSum=e,this._gc.clear(),n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchGraphs().then(e=>{for(let t of e)if(t.Name===this.graphID())return this.finishProgress(),t.fetchScopeGraph(this.subgraphID())}).then(e=>(this._prevScopeGraph=e,this._prevScopeGraph))):Promise.resolve(this._prevScopeGraph)}enter(e,t){super.enter(e,t)}update(e,t){super.update(e,t)}exit(e,t){super.exit(e,t)}loadGraph(){this._gc.disabled(this._legend.disabled()),this._graph.data(this._gc.graphData(),!0);{let{columns:e,data:t}=this._gc.activityData();this._activities.columns(e).data(t)}{let{columns:e,data:t}=this._gc.edgeData();this._edges.columns(e).data(t)}{let{columns:e,data:t}=this._gc.subgraphData();this._subgraphs.columns(e).data(t)}}render(e){return this.wuid()&&this.graphID()?this.fetchScopeGraph().then(t=>{this._gc.set(t),this._legend.data(this._gc.calcLegend()),this.loadGraph(),super.render(e)}):super.render(e),this}selection(e){if(!arguments.length)return this._graph.selection();let t=this._gc.vertex(e)||this._gc.edge(e)||this._gc.subgraph(e);return t&&this._graph.selection([t]),this}};WUGraph.prototype._class+=` eclwatch_WUGraph`,WUGraph.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUGraph.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUGraph.prototype.publish(`graphID`,``,`string`,`Graph ID`),WUGraph.prototype.publish(`subgraphID`,``,`string`,`Subgraph ID`);function entitiesEncode(e){return String(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function safeEncode(e){switch(Object.prototype.toString.call(e)){case`[object Undefined]`:case`[object Boolean]`:case`[object Number]`:return e;case`[object String]`:return entitiesEncode(e);default:console.warn(`Unknown cell type: `+Object.prototype.toString.call(e))}return e}var Store=class{wuResult;schema;_columns;_cache={};rowFormatter;_filter={};onError;constructor(e,t,n,r={},i){this.wuResult=e,this.schema=t,this._columns=this.schema2Columns(this.schema.root),this.rowFormatter=new s.RowFormatter(this._columns,n),this._filter=r,this.onError=i}columns(){return this._columns}schema2Columns(e,t=``){return e?e.children().filter(e=>e.name.indexOf(`__hidden`,e.name.length-8)===-1).map((e,n)=>{let r=e.name,i=e.attrs[`hpcc:keyed`],a={field:t+r,leafID:r,idx:n,label:r+(i?` (i)`:``),className:`resultGridCell`,hidden:!1,sortable:!1,width:i?16:0,isSet:e.isSet},o=this.schema2Columns(e,t+r+`_`);return o.length?(a.width+=10+o.reduce((e,t)=>e+t.width,0),a.children=o):(a.width+=e.charWidth()*9,a.formatter=(e,t)=>{switch(typeof e){case`string`:return{html:e.replace(/\t/g,` `).trim()};case`undefined`:return``}return e}),a}):[]}isChildDataset(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=0,n=null;for(let r in e)n||=Object.prototype.toString.call(e[r]),t++;return t===1&&n===`[object Array]`}rowToTable(e,t,n){if(this.isChildDataset(e)){for(let r in e)this.rowToTable(e[r],t,n);return}let r=s.domConstruct.create(`table`,{border:1,cellspacing:0,width:`100%`},n);switch(Object.prototype.toString.call(e)){case`[object Object]`:let i=s.domConstruct.create(`tr`,null,r);for(let t in e)s.domConstruct.create(`th`,{innerHTML:safeEncode(t)},i);i=s.domConstruct.create(`tr`,null,r);for(let r in e)switch(Object.prototype.toString.call(e[r])){case`[object Object]`:case`[object Array]`:this.rowToTable(e[r],t,n);break;default:s.domConstruct.create(`td`,{innerHTML:safeEncode(e[r])},i);break}break;case`[object Array]`:for(let t=0;t<e.length;++t)switch(Object.prototype.toString.call(e[t])){case`[object Boolean]`:case`[object Number]`:case`[object String]`:let n=s.domConstruct.create(`tr`,null,r);s.domConstruct.create(`td`,{innerHTML:safeEncode(e[t])},n);break;default:if(t===0){let n=s.domConstruct.create(`tr`,null,r);for(let r in e[t])s.domConstruct.create(`th`,{innerHTML:safeEncode(r)},n)}s.domConstruct.create(`tr`,null,r);for(let r in e[t])if(e[t][r])if(Object.prototype.toString.call(e[t][r])===`[object Object]`||Object.prototype.toString.call(e[t][r])===`[object Array]`){let i=s.domConstruct.create(`td`,null,n);this.rowToTable(e[t][r],e[t],i)}else if(r.indexOf(`__html`,r.length-6)!==-1)s.domConstruct.create(`td`,{innerHTML:e[t][r]},n);else if(r.indexOf(`__javascript`,r.length-12)!==-1)s.domConstruct.create(`td`,null,n);else{let i=e[t][r];s.domConstruct.create(`td`,{innerHTML:safeEncode(i)},n)}else s.domConstruct.create(`td`,{innerHTML:``},n)}break}}getIdentity(e){return e.__hpcc_id}_request(e,t){if(!this.wuResult)return Promise.resolve({totalLength:0,data:[]});let n=`${e}->${t}`;if(this._cache[n])return this._cache[n];let r=this.wuResult.fetchRows(e,t-e,!1,this._filter).then(t=>({totalLength:this.wuResult.Total,data:t.map((t,n)=>{let r=this.rowFormatter.format(t);return r.__hpcc_id=e+n,r.__hpcc_orig=t,r})})).catch(e=>(this.onError(e.Message||`An exception has occurred`),{totalLength:0,data:[]}));return this._cache[n]=r,r}fetchRange(e){let t=new s.Deferred;return this._request(e.start,e.end).then(e=>t.resolve(e)),new s.QueryResults(t.then(e=>e.data),{totalLength:t.then(e=>e.totalLength)})}},WUResult=class extends s.Common{_result;_localStore;constructor(){super(),this.renderHtml(!1)}hashSum(e={}){return(0,a.hashSum)({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(),...e})}_prevResultHash;calcResult(){let e=this.hashSum();if(this._prevResultHash!==e){this._prevResultHash=e;let t={baseUrl:this.baseUrl(),userID:this.user(),password:this.password()};this.wuid()&&this.resultName()?this._result=n.Result.attach(t,this.wuid(),this.resultName()):this.wuid()&&this.sequence()!==void 0?this._result=n.Result.attach(t,this.wuid(),this.sequence()):this.logicalFile()&&this.nodeGroup()?this._result=n.Result.attachLogicalFile(t,this.nodeGroup(),this.logicalFile()):this.logicalFile()&&(this._result=n.Result.attachLogicalFile(t,``,this.logicalFile())),this._result&&this.bypassCache()&&this._result.bypassCache(this.bypassCache())}return this._result}fetch(e,t,n=new AbortController){let r=this.calcResult();return r?r.fetchRows(e,t,!1,{},n.signal):Promise.resolve([])}_prevStoreHash;_prevQueryHash;update(e,t){super.update(e,t);let n=this.hashSum({renderHtml:this.renderHtml(),filter:this.filter()});if(this._prevStoreHash!==n){this._prevStoreHash=n;let e=this.calcResult();e&&e.fetchXMLSchema().then(t=>{this._localStore=new Store(e,t,this.renderHtml(),this.filter(),e=>{this._dgrid&&(this._dgrid.noDataMessage=`<span class='dojoxGridNoData'>${e}</span>`,this._dgrid.refresh())}),this._dgrid?.set(`columns`,this._localStore.columns()),this._dgrid?.set(`collection`,this._localStore)})}}click(e,t,n){}};WUResult.prototype._class+=` eclwatch_WUResult`,WUResult.prototype.publish(`baseUrl`,``,`string`,`URL to WsWorkunits`),WUResult.prototype.publish(`user`,``,`string`,`User ID`),WUResult.prototype.publish(`password`,``,`string`,`Password`),WUResult.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUResult.prototype.publish(`resultName`,``,`string`,`Result Name`),WUResult.prototype.publish(`sequence`,void 0,`number`,`Sequence Number`),WUResult.prototype.publish(`nodeGroup`,``,`string`,`NodeGroup`),WUResult.prototype.publish(`logicalFile`,``,`string`,`Logical File Name`),WUResult.prototype.publish(`filter`,{},`object`,`Filter`),WUResult.prototype.publish(`bypassCache`,!1,`boolean`,`Bypass cached results`);var m=function(e){return e.CREATE=`Created`,e.COMPILE=`Compiled`,e.EXECUTE=`Executed`,e.COMPLETE=`Completed`,e}({}),h=function(e){return e.CREATE=`Creating`,e.COMPILE=`Compiling`,e.EXECUTE=`Executing`,e.COMPLETE=`Completed`,e}({}),WUStatus=class extends c.Graph{_wu;_wuHandle;_create;_compile;_execute;_complete;constructor(){super(),this.zoomable(!1).zoomToFitLimit(1).layout(`Hierarchy`).hierarchyRankDirection(`LR`).showToolbar(!1).allowDragging(!1)}_prevHash;attachWorkunit(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid()});this._prevHash!==e&&(this._prevHash=e,this._wu=n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()),this._wuHandle&&this._wuHandle.release(),this._wuHandle=this._wu.watch(e=>{this.lazyRender()}))}createVertex(e){return new c.Vertex().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(e)}updateVertex(e,t){e.icon_image_colorFill(t).textbox_text_colorFill(t)}updateVertexStatus(e,t=!1){let n=this._wu.isFailed()?`darkred`:`darkgreen`;switch(this._create.text(`Created`),this._compile.text(`Compiled`),this._execute.text(`Executed`),this._complete.text(`Completed`),e){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,t?`orange`:n),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,n),this.updateVertex(this._compile,t?`orange`:n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,`darkgray`);break;case 3:this._execute.text(`Executing`),this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,t?`orange`:n),this.updateVertex(this._complete,`darkgray`);break;case 4:this.updateVertex(this._create,n),this.updateVertex(this._compile,n),this.updateVertex(this._execute,n),this.updateVertex(this._complete,n);break}}createEdge(e,t){return new c.Edge().sourceVertex(e).targetVertex(t).strokeColor(`black`).showArc(!1)}enter(e,t){super.enter(e,t),this._create=this.createVertex(``),this._compile=this.createVertex(``),this._execute=this.createVertex(``),this._complete=this.createVertex(``);let n=this.createEdge(this._create,this._compile),r=this.createEdge(this._compile,this._execute),i=this.createEdge(this._execute,this._complete);this.data({vertices:[this._create,this._compile,this._execute,this._complete],edges:[n,r,i]})}update(e,t){switch(this.attachWorkunit(),this._wu.StateID){case n.WUStateID.Blocked:case n.WUStateID.Wait:case n.WUStateID.Scheduled:case n.WUStateID.UploadingFiled:this.updateVertexStatus(1);break;case n.WUStateID.Compiling:this.updateVertexStatus(2,!0);break;case n.WUStateID.Submitted:this.updateVertexStatus(1,!0);break;case n.WUStateID.Compiled:this.updateVertexStatus(2);break;case n.WUStateID.Aborting:case n.WUStateID.Running:this.updateVertexStatus(3,!0);break;case n.WUStateID.Aborted:case n.WUStateID.Archived:case n.WUStateID.Completed:this.updateVertexStatus(4);break;case n.WUStateID.Failed:this.updateVertexStatus(4,!1);break;case n.WUStateID.DebugPaused:case n.WUStateID.DebugRunning:case n.WUStateID.Paused:case n.WUStateID.Unknown:default:this.updateVertexStatus(0);break}super.update(e,t),this.zoomToFit()}exit(e,t){this._wuHandle&&this._wuHandle.release(),super.exit(e,t)}};WUStatus.prototype._class+=` eclwatch_WUStatus`,WUStatus.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUStatus.prototype.publish(`wuid`,``,`string`,`Workunit ID`);function I1DChart(){}I1DChart.prototype._dataFamily=`1D`,I1DChart.prototype._palette=o.Palette.rainbow(`default`),I1DChart.prototype.click=function(e,t,n){},I1DChart.prototype.dblclick=function(e,t,n){};function I2DChart(){}I2DChart.prototype._dataFamily=`2D`,I2DChart.prototype._palette=o.Palette.ordinal(`default`),I2DChart.prototype.fillColor=function(e,t,n,r){return this._palette(e[0])},I2DChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},I2DChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},I2DChart.prototype.click=function(e,t,n){},I2DChart.prototype.dblclick=function(e,t,n){};function I2DAggrChart(){}I2DAggrChart.prototype._palette=o.Palette.rainbow(`default`),I2DAggrChart.prototype.fillColor=function(e,t,n){return this._palette(e.length)},I2DAggrChart.prototype.strokeColor=function(e,t,n){return(0,o.hsl)(this.fillColor(e,t,n)).darker().toString()},I2DAggrChart.prototype.textColor=function(e,t,n){return o.Palette.textColor(this.fillColor(e,t,n))},I2DAggrChart.prototype.click=function(e,t,n){},I2DAggrChart.prototype.dblclick=function(e,t,n){};function IGraph(){}IGraph.prototype._dataFamily=`graph`,IGraph.prototype.vertex_click=function(e,t,n,r){r&&r.vertex},IGraph.prototype.vertex_dblclick=function(e,t,n,r){r&&r.vertex},IGraph.prototype.edge_click=function(e,t,n,r){r&&r.edge},IGraph.prototype.edge_dblclick=function(e,t,n,r){r&&r.edge};function IInput(){}IInput.prototype=Object.create(o.Widget.prototype),IInput.prototype.constructor=IInput,IInput.prototype.isValid=function(){return!(this.validate()&&!new RegExp(this.validate()).test(this.value()))},IInput.prototype.hasValue=function(){if(typeof this.type==`function`){switch(this.type()){case`radio`:case`checkbox`:if(this.value()&&this.value()!==`false`)return!0;break;default:if(this.value())return!0;break}return!1}return this.value()!==``},IInput.prototype.blur=function(e){},IInput.prototype.keyup=function(e){},IInput.prototype.focus=function(e){},IInput.prototype.click=function(e){},IInput.prototype.dblclick=function(e){},IInput.prototype.change=function(e,t){},IInput.prototype.resetValue=function(e){e.value(e._inputElement[0].node().value)},IInput.prototype.disable=function(e){this._inputElement.forEach(function(t,n){t.attr(`disabled`,e?`disabled`:null)})},IInput.prototype.setFocus=function(){this._inputElement.length&&this._inputElement[0].node().focus()},IInput.prototype.publish(`name`,``,`string`,`HTML name for the input`),IInput.prototype.publish(`label`,``,`string`,`Descriptive label`),IInput.prototype.publish(`value`,``,`string`,`Input Current Value`),IInput.prototype.publish(`validate`,null,`string`,`Input Validation`);function INDChart(){}INDChart.prototype._dataFamily=`ND`,INDChart.prototype._palette=o.Palette.ordinal(`default`),INDChart.prototype.fillColor=function(e,t,n,r){return this._palette(t)},INDChart.prototype.strokeColor=function(e,t,n,r){return(0,o.hsl)(this.fillColor(e,t,n,r)).darker().toString()},INDChart.prototype.textColor=function(e,t,n,r){return o.Palette.textColor(this.fillColor(e,t,n,r))},INDChart.prototype.click=function(e,t,n){},INDChart.prototype.dblclick=function(e,t,n){};function tip(){let e=d3TipDirection,t=d3TipOffset,n=d3TipHTML,r=functor(document.body),i=initNode(),a=null,s=null,c=null,tip=function(e){if(a=getSVGNode(e),!a)return;s=a.createSVGPoint();let t=r();t&&i&&t.appendChild(i)};tip.show=function(e,i,a){c=a[i];let o=Array.prototype.slice.call(arguments),s=n.apply(this,o);if(s===null)return tip;let d=t.apply(this,o),f=getNodeEl(),p=u.length,m,h=r().getBoundingClientRect();for(f.html(s).style(`opacity`,1).style(`pointer-events`,`all`);p--;)f.classed(u[p],!1);let g=!1,_={},v=u[0];for(let e=0;e<u.length&&(g=_placement_attempt(u[e]),!g);e++);if(g)f.classed(`notick`,!1);else{f.classed(`notick`,!0);let e=_vertical_adjustment(_[v]),t=_horizontal_adjustment(_[v]);_placement_attempt(v,e,t)}return tip;function _horizontal_adjustment(e){return e.left>e.right?e.left>0?-e.left:0:e.right>0?e.right:0}function _vertical_adjustment(e){return e.top>e.bottom?e.top>0?-e.top:0:e.bottom}function _placement_attempt(e,t,n){t||=0,n||=0,f.style(`white-space`,`nowrap`),m=l.get(e).apply(this),f.classed(e,!0).style(`top`,m.top+d[0]-t+`px`).style(`left`,m.left+d[1]-n+`px`);let r=f.node().getBoundingClientRect(),i=r.top>h.top&&r.left>h.left&&r.bottom<h.bottom&&r.right<h.right;return _[e]={top:h.top-r.top,right:r.right-h.right,bottom:r.bottom-h.bottom,left:h.left-r.left},f.style(`white-space`,`normal`),_[e].total_overflow=Object.keys(_[e]).filter(t=>_[e][t]>0).reduce((t,n)=>t+_[e][n],0),_[v].total_overflow>_[e].total_overflow&&(v=e),i||f.classed(e,!1),i}},tip.hide=function(){return getNodeEl().style(`opacity`,0).style(`pointer-events`,`none`),tip},tip.attr=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().attr(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.attr.apply(getNodeEl(),n),tip},tip.style=function(e,t){if(arguments.length<2&&typeof e==`string`)return getNodeEl().style(e);let n=Array.prototype.slice.call(arguments);return o.selection.prototype.style.apply(getNodeEl(),n),tip},tip.direction=function(t){return arguments.length?(e=t==null?t:functor(t),tip):e},tip.offset=function(e){return arguments.length?(t=e==null?e:functor(e),tip):t},tip.html=function(e){return arguments.length?(n=e==null?e:functor(e),tip):n},tip.rootElement=function(e){return arguments.length?(r=functor(e),tip):r},tip.destroy=function(){return i&&=(getNodeEl().remove(),null),tip};function d3TipDirection(){return`n`}function d3TipOffset(){return[0,0]}function d3TipHTML(){return` `}let l=(0,o.map)({n:directionNorth,s:directionSouth,e:directionEast,w:directionWest,nw:directionNorthWest,ne:directionNorthEast,sw:directionSouthWest,se:directionSouthEast}),u=l.keys();function directionNorth(){let e=getScreenBBox(window);return{top:e.n.y-i.offsetHeight,left:e.n.x-i.offsetWidth/2}}function directionSouth(){let e=getScreenBBox(window);return{top:e.s.y+8,left:e.s.x-i.offsetWidth/2}}function directionEast(){let e=getScreenBBox(window);return{top:e.e.y-i.offsetHeight/2,left:e.e.x+8}}function directionWest(){let e=getScreenBBox(window);return{top:e.w.y-i.offsetHeight/2,left:e.w.x-i.offsetWidth-8}}function directionNorthWest(){let e=getScreenBBox(window);return{top:e.nw.y-i.offsetHeight,left:e.nw.x-i.offsetWidth}}function directionNorthEast(){let e=getScreenBBox(window);return{top:e.ne.y-i.offsetHeight,left:e.ne.x}}function directionSouthWest(){let e=getScreenBBox(window);return{top:e.sw.y,left:e.sw.x-i.offsetWidth}}function directionSouthEast(){let e=getScreenBBox(window);return{top:e.se.y,left:e.se.x}}function initNode(){let e=(0,o.select)(document.createElement(`div`));return e.attr(`class`,`d3-tip`).style(`position`,`absolute`).style(`top`,`0px`).style(`opacity`,0).style(`pointer-events`,`none`).style(`box-sizing`,`border-box`),e.node()}function getSVGNode(e){let t=e.node();return t?t.tagName.toLowerCase()===`svg`?t:t.ownerSVGElement:null}function getNodeEl(){return i??(i=initNode(),r().appendChild(i)),(0,o.select)(i)}function getScreenBBox(e){let t=c||e;for(;t.getCTM==null&&t.parentNode!=null;)t=t.parentNode;let n={},r=t.getCTM(),i=t.getBBox(),a=i.width,o=i.height,l=i.x,u=i.y;return s.x=l,s.y=u,n.nw=s.matrixTransform(r),s.x+=a,n.ne=s.matrixTransform(r),s.y+=o,n.se=s.matrixTransform(r),s.x-=a,n.sw=s.matrixTransform(r),s.y-=o/2,n.w=s.matrixTransform(r),s.x+=a,n.e=s.matrixTransform(r),s.x-=a/2,s.y-=o/2,n.n=s.matrixTransform(r),s.y+=o,n.s=s.matrixTransform(r),n}function functor(e){return typeof e==`function`?e:function(){return e}}return tip}function ITooltip(){if(this.tooltip=tip(),this.tooltipLabelFormat_exists()&&(this._labelFormatter=(0,o.format)(this.tooltipLabelFormat())),this.tooltipValueFormat_exists()&&(this._valueFormatter=(0,o.format)(this.tooltipValueFormat())),this.layerEnter){let e=this.layerEnter;this.layerEnter=function(t,n,r){this._parentOverlay||=t._parentOverlay,this.tooltipEnter(n),e.apply(this,arguments)};let t=this.layerUpdate;this.layerUpdate=function(e){t.apply(this,arguments),this.tooltipUpdate()};let n=this.layerExit;this.layerExit=function(e){this.tooltipExit(),n.apply(this,arguments)}}else{let e=this.enter;this.enter=function(t,n){this.tooltipEnter(n),e.apply(this,arguments)};let t=this.update;this.update=function(e,n){t.apply(this,arguments),this.tooltipUpdate()};let n=this.exit;this.exit=function(e,t){this.tooltipExit(),n.apply(this,arguments)}}}ITooltip.prototype=Object.create(o.Widget.prototype),ITooltip.prototype.constructor=ITooltip,ITooltip.prototype.tooltipEnter=function(e){let t=this.parentOverlay();t.empty()||this.tooltip.rootElement(t.node().parentNode),e.call(this.tooltip)},ITooltip.prototype.tooltipUpdate=function(){this.tooltip.offset(()=>{if(event&&this.tooltipFollowMouse()){let e=document.querySelector(`.d3-tip`);return e.style.display=`block`,e.style.left=this.tooltipOffset()+event.clientX+`px`,e.style.top=event.clientY+`px`,[]}switch(this.tooltip.direction()()){case`e`:return[0,this.tooltipOffset()];default:return[-this.tooltipOffset(),0]}});let e=this.tooltip.attr(`class`);e&&(e=e.split(` notick`).join(``)+(this.tooltipTick()?``:` notick`)+(this.tooltipStyle()===`none`?` hidden`:``),e=e.split(` `).filter(function(e){return e.indexOf(`ITooltip-tooltipStyle-`)!==0}).join(` `),e+=` ITooltip-tooltipStyle-`+this.tooltipStyle(),this.tooltip.attr(`class`,e))},ITooltip.prototype.tooltipExit=function(){this.tooltip&&this.tooltip.destroy()},ITooltip.prototype._tooltipHTML=function(e){return e},ITooltip.prototype.tooltipHTML=function(e){return this.tooltip.html(e)},ITooltip.prototype.tooltipFormat=function(e={}){switch(e.label=e.label===void 0?``:e.label,this._labelFormatter?e.label=this._labelFormatter(e.label)||``:this.formatData&&this.parseData&&(e.label=this.formatData(this.parseData(e.label))),e.series=e.series||``,e.value instanceof Date?e.value=e.value||``:this._valueFormatter?e.value=this._valueFormatter(e.value)||``:this.formatValue&&this.parseValue&&(e.value=this.formatValue(this.parseValue(e.value))),this.tooltipStyle()){case`none`:break;case`series-table`:let t=`<table class="ITooltip-series-table"><thead><tr><th colspan="2">`+e.label+`</th></tr></thead><tbody>`;return e.arr.forEach(function(e){t+=`<tr>`,t+=`<td>`,t+=`<div class="series-table-row-color" style="background-color:`+e.color+`"></div>`,t+=`<div class="series-table-row-label">`+e.label+`</div>`,t+=`</td>`,t+=`<td><div class="series-table-row-value">`+e.value+`</div></td>`,t+=`</tr>`}),t+=`</tbody>`,t+=`</table>`,t;default:return e.series?`<span style='color:`+this.tooltipSeriesColor()+`'>`+e.series+`</span> / <span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:e.label===``?`<span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`:`<span style='color:`+this.tooltipLabelColor()+`'>`+e.label+`</span>: <span style='color:`+this.tooltipValueColor()+`'>`+e.value+`</span>`}},ITooltip.prototype.tooltipKeyValueFormat=function(e,t){let n=``;for(let r in t)if(r!==e){let e=t&&t[r]?t[r]:``;n+=`<tr><td style="${this.tooltipLabelColor_exists()?`color:`+this.tooltipLabelColor():``}">${r}</td><td style="font-weight:normal">${e}</td></tr>`}return`<table>
|
|
5
|
+
<thead>
|
|
6
|
+
<tr><th colspan="2" style="font-weight:bold;font-size:16px">${t[e]}</th></tr>
|
|
7
|
+
</thead>
|
|
8
|
+
<tbody>
|
|
9
|
+
${n}
|
|
10
|
+
</tbody>
|
|
11
|
+
</table>`},ITooltip.prototype.publish(`tooltipStyle`,`default`,`set`,`Style mode`,[`default`,`none`,`series-table`],{}),ITooltip.prototype.publish(`tooltipFollowMouse`,!1,`boolean`,`If true, the tooltip will follow mouse movement`,null,{}),ITooltip.prototype.publish(`tooltipLabelFormat`,void 0,`string`,`Format of tooltip label(s) (the domain axis)`,null,{}),ITooltip.prototype.publish(`tooltipValueFormat`,void 0,`string`,`Number format of tooltip value(s)`,null,{}),ITooltip.prototype.publish(`tooltipSeriesColor`,`#EAFFFF`,`html-color`,`Color of tooltip series text`,null,{}),ITooltip.prototype.publish(`tooltipLabelColor`,`#CCFFFF`,`html-color`,`Color of tooltip label text (the domain axis)`,null,{}),ITooltip.prototype.publish(`tooltipValueColor`,`white`,`html-color`,`Color of tooltip value(s)`,null,{}),ITooltip.prototype.publish(`tooltipTick`,!0,`boolean`,`Show tooltip tick`,null,{}),ITooltip.prototype.publish(`tooltipOffset`,8,`number`,`Offset from the cursor`,null,{});var g=ITooltip.prototype.tooltipLabelFormat;ITooltip.prototype.tooltipLabelFormat=function(e){let t=g.apply(this,arguments);return arguments.length&&(this._labelFormatter=(0,o.format)(e)),t};var _=ITooltip.prototype.tooltipValueFormat;ITooltip.prototype.tooltipValueFormat=function(e){let t=_.apply(this,arguments);return arguments.length&&(this._valueFormatter=(0,o.format)(e)),t};function ITree(){}ITree.prototype.constructor=ITree,ITree.prototype.click=function(e,t,n){},ITree.prototype.dblclick=function(e,t,n){},ITree.prototype._palette=o.Palette.ordinal(`default`),(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.d3-tip{color:#fff;z-index:10;background:#000000a8;border-radius:2px;padding:12px;font-weight:700;line-height:1;pointer-events:none!important}.d3-tip.hidden{visibility:hidden}.d3-tip:after{content:" ";box-sizing:border-box;border:4px solid #000000a8;width:8px;height:8px;margin:0;display:inline-block;position:absolute;pointer-events:none!important}.d3-tip.n:after{border-top-width:8px;border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%;left:calc(50% - 4px)}.d3-tip.e:after{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;border-right-width:8px;top:calc(50% - 4px);left:-12px}.d3-tip.s{margin-top:8px}.d3-tip.s:after{border-top-color:#0000;border-bottom-width:8px;border-left-color:#0000;border-right-color:#0000;top:-12px;left:calc(50% - 4px)}.d3-tip.w:after{border-top-color:#0000;border-bottom-color:#0000;border-left-width:8px;border-right-color:#0000;top:calc(50% - 4px);left:100%}.d3-tip.notick:after{border-color:#0000!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{text-align:left;border:1px solid #d1d1d1;padding:6px}.d3-tip .ITooltip-series-table .series-table-row-color{width:10px;height:10px;margin-right:10px;display:inline-block}.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{color:#555;background-color:#fff;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}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var v=Object.defineProperty,__name=(e,t)=>v(e,`name`,{value:t,configurable:!0}),b=Math.PI,S=2*b,C=1e-6,w=S-C;function Path(){this._x0=this._y0=this._x1=this._y1=null,this._=``}function path(){return new Path}Path.prototype=path.prototype={constructor:Path,moveTo:function(e,t){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+=`Z`)},lineTo:function(e,t){this._+=`L`+(this._x1=+e)+`,`+(this._y1=+t)},quadraticCurveTo:function(e,t,n,r){this._+=`Q`+ +e+`,`+ +t+`,`+(this._x1=+n)+`,`+(this._y1=+r)},bezierCurveTo:function(e,t,n,r,i,a){this._+=`C`+ +e+`,`+ +t+`,`+ +n+`,`+ +r+`,`+(this._x1=+i)+`,`+(this._y1=+a)},arcTo:function(e,t,n,r,i){e=+e,t=+t,n=+n,r=+r,i=+i;var a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(i<0)throw Error(`negative radius: `+i);if(this._x1===null)this._+=`M`+(this._x1=e)+`,`+(this._y1=t);else if(d>C)if(!(Math.abs(u*s-c*l)>C)||!i)this._+=`L`+(this._x1=e)+`,`+(this._y1=t);else{var f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((b-Math.acos((m+d-h)/(2*g*_)))/2),S=v/_,w=v/g;Math.abs(S-1)>C&&(this._+=`L`+(e+S*l)+`,`+(t+S*u)),this._+=`A`+i+`,`+i+`,0,0,`+ +(u*f>l*p)+`,`+(this._x1=e+w*s)+`,`+(this._y1=t+w*c)}},arc:function(e,t,n,r,i,a){e=+e,t=+t,n=+n,a=!!a;var o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;if(n<0)throw Error(`negative radius: `+n);this._x1===null?this._+=`M`+c+`,`+l:(Math.abs(this._x1-c)>C||Math.abs(this._y1-l)>C)&&(this._+=`L`+c+`,`+l),n&&(d<0&&(d=d%S+S),d>w?this._+=`A`+n+`,`+n+`,0,1,`+u+`,`+(e-o)+`,`+(t-s)+`A`+n+`,`+n+`,0,1,`+u+`,`+(this._x1=c)+`,`+(this._y1=l):d>C&&(this._+=`A`+n+`,`+n+`,0,`+ +(d>=b)+`,`+u+`,`+(this._x1=e+n*Math.cos(i))+`,`+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+=`M`+(this._x0=this._x1=+e)+`,`+(this._y0=this._y1=+t)+`h`+ +n+`v`+ +r+`h`+-n+`Z`},toString:function(){return this._}};function constant_default$3(e){return function constant(){return e}}__name(constant_default$3,`default`);var T=Math.abs,E=Math.atan2,D=Math.cos,O=Math.max,k=Math.min,A=Math.sin,j=Math.sqrt,M=Math.PI,N=M/2,P=2*M;function acos(e){return e>1?0:e<-1?M:Math.acos(e)}function asin$1(e){return e>=1?N:e<=-1?-N:Math.asin(e)}__name(asin$1,`asin`);function arcInnerRadius$1(e){return e.innerRadius}__name(arcInnerRadius$1,`arcInnerRadius`);function arcOuterRadius$1(e){return e.outerRadius}__name(arcOuterRadius$1,`arcOuterRadius`);function arcStartAngle$1(e){return e.startAngle}__name(arcStartAngle$1,`arcStartAngle`);function arcEndAngle$1(e){return e.endAngle}__name(arcEndAngle$1,`arcEndAngle`),__name(arc_default$1,`default`);function arcPadAngle$1(e){return e&&e.padAngle}__name(arcPadAngle$1,`arcPadAngle`);function intersect$1(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}__name(intersect$1,`intersect`);function cornerTangents$1(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/j(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*j(O(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,k=(w*b+v*T)/S,A=(-w*v+b*T)/S,M=E-g,N=D-_,P=k-g,F=A-_;return M*M+N*N>P*P+F*F&&(E=k,D=A),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}__name(cornerTangents$1,`cornerTangents`);function arc_default$1(){var e=arcInnerRadius$1,t=arcOuterRadius$1,n=constant_default$3(0),r=null,i=arcStartAngle$1,a=arcEndAngle$1,o=arcPadAngle$1,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-N,p=a.apply(this,arguments)-N,m=T(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>P-1e-12)s.moveTo(d*D(f),d*A(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*D(p),u*A(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,O=w>1e-12&&(r?+r.apply(this,arguments):j(u*u+d*d)),F=k(T(d-u)/2,+n.apply(this,arguments)),I=F,L=F,R,z;if(O>1e-12){var B=asin$1(O/u*A(w)),V=asin$1(O/d*A(w));(S-=B*2)>1e-12?(B*=h?1:-1,v+=B,b-=B):(S=0,v=b=(f+p)/2),(C-=V*2)>1e-12?(V*=h?1:-1,g+=V,_-=V):(C=0,g=_=(f+p)/2)}var H=d*D(g),U=d*A(g),ee=u*D(b),W=u*A(b);if(F>1e-12){var G=d*D(_),te=d*A(_),ne=u*D(v),re=u*A(v),K;if(m<M&&(K=intersect$1(H,U,ne,re,G,te,ee,W))){var ie=H-K[0],ae=U-K[1],oe=G-K[0],se=te-K[1],ce=1/A(acos((ie*oe+ae*se)/(j(ie*ie+ae*ae)*j(oe*oe+se*se)))/2),le=j(K[0]*K[0]+K[1]*K[1]);I=k(F,(u-le)/(ce-1)),L=k(F,(d-le)/(ce+1))}}C>1e-12?L>1e-12?(R=cornerTangents$1(ne,re,H,U,d,L,h),z=cornerTangents$1(G,te,ee,W,d,L,h),s.moveTo(R.cx+R.x01,R.cy+R.y01),L<F?s.arc(R.cx,R.cy,L,E(R.y01,R.x01),E(z.y01,z.x01),!h):(s.arc(R.cx,R.cy,L,E(R.y01,R.x01),E(R.y11,R.x11),!h),s.arc(0,0,d,E(R.cy+R.y11,R.cx+R.x11),E(z.cy+z.y11,z.cx+z.x11),!h),s.arc(z.cx,z.cy,L,E(z.y11,z.x11),E(z.y01,z.x01),!h))):(s.moveTo(H,U),s.arc(0,0,d,g,_,!h)):s.moveTo(H,U),!(u>1e-12)||!(S>1e-12)?s.lineTo(ee,W):I>1e-12?(R=cornerTangents$1(ee,W,G,te,u,-I,h),z=cornerTangents$1(H,U,ne,re,u,-I,h),s.lineTo(R.cx+R.x01,R.cy+R.y01),I<F?s.arc(R.cx,R.cy,I,E(R.y01,R.x01),E(z.y01,z.x01),!h):(s.arc(R.cx,R.cy,I,E(R.y01,R.x01),E(R.y11,R.x11),!h),s.arc(0,0,u,E(R.cy+R.y11,R.cx+R.x11),E(z.cy+z.y11,z.cx+z.x11),h),s.arc(z.cx,z.cy,I,E(z.y11,z.x11),E(z.y01,z.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-M/2;return[D(r)*n,A(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default$3(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}function Linear$1(e){this._context=e}__name(Linear$1,`Linear`),Linear$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}},__name(linear_default$1,`default`);function linear_default$1(e){return new Linear$1(e)}function x$1(e){return e[0]}__name(x$1,`x`);function y$1(e){return e[1]}__name(y$1,`y`);function line_default$1(){var e=x$1,t=y$1,n=constant_default$3(!0),r=null,i=linear_default$1,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$3(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default$1,`default`);function area_default$1(){var e=x$1,t=null,n=constant_default$3(0),r=y$1,i=constant_default$3(!0),a=null,o=linear_default$1,s=null;function area(c){var l,u,d,f=c.length,p,m=!1,h,g=Array(f),_=Array(f);for(a??(s=o(h=path())),l=0;l<=f;++l){if(!(l<f&&i(p=c[l],l,c))===m)if(m=!m)u=l,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=l-1;d>=u;--d)s.point(g[d],_[d]);s.lineEnd(),s.areaEnd()}m&&(g[l]=+e(p,l,c),_[l]=+n(p,l,c),s.point(t?+t(p,l,c):g[l],r?+r(p,l,c):_[l]))}if(h)return s=null,h+``||null}function arealine(){return line_default$1().defined(i).curve(o).context(a)}return area.x=function(n){return arguments.length?(e=typeof n==`function`?n:constant_default$3(+n),t=null,area):e},area.x0=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),area):e},area.x1=function(e){return arguments.length?(t=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):t},area.y=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),r=null,area):n},area.y0=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$3(+e),area):n},area.y1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default$3(+e),area):r},area.lineX0=area.lineY0=function(){return arealine().x(e).y(n)},area.lineY1=function(){return arealine().x(e).y(r)},area.lineX1=function(){return arealine().x(t).y(n)},area.defined=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(!!e),area):i},area.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),area):o},area.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),area):a},area}__name(area_default$1,`default`);function descending_default(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}__name(descending_default,`default`);function identity_default$2(e){return e}__name(identity_default$2,`default`);function pie_default(){var e=identity_default$2,t=descending_default,n=null,r=constant_default$3(0),i=constant_default$3(P),a=constant_default$3(0);function pie(o){var s,c=o.length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(P,Math.max(-P,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),b;for(s=0;s<c;++s)(b=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=b);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],b=p[l],g=m+(b>0?b*u:0)+v,p[l]={data:o[l],index:s,value:b,startAngle:m,endAngle:g,padAngle:_};return p}return pie.value=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$3(+t),pie):e},pie.sortValues=function(e){return arguments.length?(t=e,n=null,pie):t},pie.sort=function(e){return arguments.length?(n=e,t=null,pie):n},pie.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$3(+e),pie):r},pie.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default$3(+e),pie):i},pie.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default$3(+e),pie):a},pie}__name(pie_default,`default`);function point$7(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$7,`point`);function Basis$1(e){this._context=e}__name(Basis$1,`Basis`),__name(basis_default,`default`),Basis$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$7(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:point$7(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function basis_default(e){return new Basis$1(e)}function Bundle$1(e,t){this._basis=new Basis$1(e),this._beta=t}__name(Bundle$1,`Bundle`),Bundle$1.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var F=(function custom(e){function bundle(t){return e===1?new Basis$1(t):new Bundle$1(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$6(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$6,`point`);function Cardinal$1(e,t){this._context=e,this._k=(1-t)/6}__name(Cardinal$1,`Cardinal`),Cardinal$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$6(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$6(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var I=(function custom(e){function cardinal(t){return new Cardinal$1(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$5(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$5,`point`);function CatmullRom$1(e,t){this._context=e,this._alpha=t}__name(CatmullRom$1,`CatmullRom`),CatmullRom$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$5(this,e,t);break}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var L=(function custom(e){function catmullRom(t){return e?new CatmullRom$1(t,e):new Cardinal$1(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function sign$1(e){return e<0?-1:1}__name(sign$1,`sign`);function slope3$1(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign$1(a)+sign$1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}__name(slope3$1,`slope3`);function slope2$1(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}__name(slope2$1,`slope2`);function point$4(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}__name(point$4,`point`);function MonotoneX$1(e){this._context=e}__name(MonotoneX$1,`MonotoneX`),MonotoneX$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$4(this,this._t0,slope2$1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point$4(this,slope2$1(this,n=slope3$1(this,e,t)),n);break;default:point$4(this,this._t0,n=slope3$1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY$1(e){this._context=new ReflectContext$1(e)}__name(MonotoneY$1,`MonotoneY`),(MonotoneY$1.prototype=Object.create(MonotoneX$1.prototype)).point=function(e,t){MonotoneX$1.prototype.point.call(this,t,e)};function ReflectContext$1(e){this._context=e}__name(ReflectContext$1,`ReflectContext`),ReflectContext$1.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function monotoneX(e){return new MonotoneX$1(e)}function Natural$1(e){this._context=e}__name(Natural$1,`Natural`),Natural$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints$1(e),i=controlPoints$1(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints$1(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}__name(natural_default,`default`),__name(controlPoints$1,`controlPoints`);function natural_default(e){return new Natural$1(e)}function Step$2(e,t){this._context=e,this._t=t}__name(Step$2,`Step`),Step$2.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},__name(step_default,`default`);function step_default(e){return new Step$2(e,.5)}function stepBefore(e){return new Step$2(e,0)}function stepAfter(e){return new Step$2(e,1)}var R=Array.prototype.slice;function identity_default$1(e){return e}__name(identity_default$1,`default`);var z=1,B=2,V=3,H=4,U=1e-6;function translateX(e){return`translate(`+(e+.5)+`,0)`}function translateY(e){return`translate(0,`+(e+.5)+`)`}function number(e){return function(t){return+e(t)}}function center(e){var t=Math.max(0,e.bandwidth()-1)/2;return e.round()&&(t=Math.round(t)),function(n){return+e(n)+t}}function entering(){return!this.__axis}function axis(e,t){var n=[],r=null,i=null,a=6,o=6,s=3,c=e===z||e===H?-1:1,l=e===H||e===B?`x`:`y`,u=e===z||e===V?translateX:translateY;function axis(d){var f=r??(t.ticks?t.ticks.apply(t,n):t.domain()),p=i??(t.tickFormat?t.tickFormat.apply(t,n):identity_default$1),m=Math.max(a,0)+s,h=t.range(),g=+h[0]+.5,_=+h[h.length-1]+.5,v=(t.bandwidth?center:number)(t.copy()),b=d.selection?d.selection():d,S=b.selectAll(`.domain`).data([null]),C=b.selectAll(`.tick`).data(f,t).order(),w=C.exit(),T=C.enter().append(`g`).attr(`class`,`tick`),E=C.select(`line`),D=C.select(`text`);S=S.merge(S.enter().insert(`path`,`.tick`).attr(`class`,`domain`).attr(`stroke`,`currentColor`)),C=C.merge(T),E=E.merge(T.append(`line`).attr(`stroke`,`currentColor`).attr(l+`2`,c*a)),D=D.merge(T.append(`text`).attr(`fill`,`currentColor`).attr(l,c*m).attr(`dy`,e===z?`0em`:e===V?`0.71em`:`0.32em`)),d!==b&&(S=S.transition(d),C=C.transition(d),E=E.transition(d),D=D.transition(d),w=w.transition(d).attr(`opacity`,U).attr(`transform`,function(e){return isFinite(e=v(e))?u(e):this.getAttribute(`transform`)}),T.attr(`opacity`,U).attr(`transform`,function(e){var t=this.parentNode.__axis;return u(t&&isFinite(t=t(e))?t:v(e))})),w.remove(),S.attr(`d`,e===H||e==B?o?`M`+c*o+`,`+g+`H0.5V`+_+`H`+c*o:`M0.5,`+g+`V`+_:o?`M`+g+`,`+c*o+`V0.5H`+_+`V`+c*o:`M`+g+`,0.5H`+_),C.attr(`opacity`,1).attr(`transform`,function(e){return u(v(e))}),E.attr(l+`2`,c*a),D.attr(l,c*m).text(p),b.filter(entering).attr(`fill`,`none`).attr(`font-size`,10).attr(`font-family`,`sans-serif`).attr(`text-anchor`,e===B?`start`:e===H?`end`:`middle`),b.each(function(){this.__axis=v})}return axis.scale=function(e){return arguments.length?(t=e,axis):t},axis.ticks=function(){return n=R.call(arguments),axis},axis.tickArguments=function(e){return arguments.length?(n=e==null?[]:R.call(e),axis):n.slice()},axis.tickValues=function(e){return arguments.length?(r=e==null?null:R.call(e),axis):r&&r.slice()},axis.tickFormat=function(e){return arguments.length?(i=e,axis):i},axis.tickSize=function(e){return arguments.length?(a=o=+e,axis):a},axis.tickSizeInner=function(e){return arguments.length?(a=+e,axis):a},axis.tickSizeOuter=function(e){return arguments.length?(o=+e,axis):o},axis.tickPadding=function(e){return arguments.length?(s=+e,axis):s},axis}function axisTop(e){return axis(z,e)}function axisRight(e){return axis(B,e)}function axisBottom(e){return axis(V,e)}function axisLeft(e){return axis(H,e)}var Axis=class extends o.SVGWidget{_origType;_origTimePattern;parser;parserInvert;formatter;d3Scale;d3Axis;d3Guides;_guideElement;svg;svgAxis;svgGuides;_tickFormatFunc;constructor(e=`origin`){super(),this._drawStartPos=e,this.updateScale()}lowValue(){return this.parse(this.low())}highValue(){return this.parse(this.high())}parse(e,t){if(e instanceof Array)return e.map(function(e){return this.parse(e)},this);if(e!=null){if(this.parser)return this.parser(typeof e==`number`?e.toString():e);if(t&&typeof e==`string`)return+e}return e}parseInvert(e){return e instanceof Array?e.map(function(e){return this.parseInvert(e)},this):this.parserInvert&&e?this.parserInvert(e):e}format(e){return e instanceof Array?e.map(function(e){return this.format(e)},this):e!=null&&this.formatter?this.formatter(e):e}parseFormat(e){return this.format(this.parse(e))}tickFormatFunc(e){return arguments.length?(this._tickFormatFunc=e,this.updateScale(),this):this._tickFormatFunc}scalePos(e){let t=this.d3Scale(this.parse(e));return this.type()===`ordinal`&&(t+=this.bandwidth()/2),t}bandwidth(){return this.d3Scale.bandwidth?this.d3Scale.bandwidth():0}isHorizontal(){switch(this.orientation()){case`left`:case`right`:return!1;default:}return!0}domain(e){return arguments.length?(this.d3Scale.domain(e),this):this.d3Scale.domain()}range(e){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(e,.1):this.d3Scale.rangeRound&&this.d3Scale.range(e),this}invert(e){return this.d3Scale.invert(e)}guideTarget(e){return this._guideElement=(0,o.select)(e).attr(`class`,this._class),this}enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgAxis=this.svg.append(`g`).attr(`class`,`axis`),this.svgGuides=(this._guideElement||t).append(`g`).attr(`class`,`guide`)}_prevOrientation;updateScale(){switch(this.type()){case`ordinal`:if(this.d3Scale=(0,o.scaleBand)().paddingInner(this.ordinalPaddingInner()).paddingOuter(this.ordinalPaddingOuter()),this.ordinals_exists()&&this.d3Scale.domain(this.ordinals()),this.parser=null,this.ordinalMappings_exists()){let e=this.ordinalMappings();this.formatter=t=>e[t]||t}else this.formatter=null;break;case`linear`:this.d3Scale=(0,o.scaleLinear)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`pow`:this.d3Scale=(0,o.scalePow)().exponent(this.powExponent()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`log`:this.d3Scale=(0,o.scaleLog)().base(this.logBase()),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=null,this.formatter=this.tickFormat_exists()?(0,o.format)(this.tickFormat()):null;break;case`time`:this.d3Scale=(0,o.scaleTime)(),this.low_exists()&&this.high_exists()&&this.d3Scale.domain([this.lowValue(),this.highValue()]),this.parser=this.timePattern_exists()?(0,o.timeParse)(this.timePattern()):null,this.parserInvert=this.timePattern_exists()?(0,o.timeFormat)(this.timePattern()):null,this._tickFormatFunc?this.formatter=this._tickFormatFunc:this.formatter=this.tickFormat_exists()?(0,o.timeFormat)(this.tickFormat()):null;break;default:}if(this._prevOrientation!==this.orientation()){switch(this.orientation()){case`left`:this.d3Axis=axisLeft(this.d3Scale),this.d3Guides=axisLeft(this.d3Scale);break;case`top`:this.d3Axis=axisTop(this.d3Scale),this.d3Guides=axisTop(this.d3Scale);break;case`right`:this.d3Axis=axisRight(this.d3Scale),this.d3Guides=axisRight(this.d3Scale);break;default:this.d3Axis=axisBottom(this.d3Scale),this.d3Guides=axisBottom(this.d3Scale);break}this._prevOrientation=this.orientation(),this.svgAxis&&this.svgAxis.html(``),this.svgGuides&&this.svgGuides.html(``)}if(this.extend())switch(this.type()){case`ordinal`:break;default:let e,t,n,r,i,a;this.isHorizontal()?(e=this.width(),this.d3Scale.range([0,e]),t=e*this.extend()/100,n=this.d3Scale.invert(0),i=this.d3Scale.invert(-t),r=this.d3Scale.invert(e),a=this.d3Scale.invert(e+t)):(e=this.height(),this.d3Scale.range([e,0]),t=e*this.extend()/100,n=this.d3Scale.invert(e),i=this.d3Scale.invert(e+t),r=this.d3Scale.invert(0),a=this.d3Scale.invert(-t)),i===n&&(i=n-n*this.extend()/100),a===r&&(a=r+r*this.extend()/100),Math.sign(n)!==Math.sign(i)&&(i=0),Math.sign(r)!==Math.sign(a)&&(a=0),this.d3Scale.domain([i,a]);break}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());let e=this.ticks();return e.length&&(this.d3Axis.tickValues(e.map(e=>this.parse(e.value))).tickFormat((t,n)=>e[n].label),this.d3Guides.tickValues(e.map(e=>this.parse(e.value)))),this}adjustText(e,t){let n=this.isHorizontal(),r=this.orientation()===`left`,i=this.orientation()===`bottom`,a=this,s=e.selectAll(`.tick > text`).style(`font-family`,this.fontFamily()).style(`font-size`,this.fontSize_exists()?this.fontSize()+`px`:null);if(this.overlapMode()===`linebreak`)this.type()===`ordinal`&&s.call(function(){return a.linebreak.apply(a,arguments)},this.bandwidth());else if(this.overlapMode()===`wrap`)this.type()===`ordinal`&&s.call(function(){return a.wrap.apply(a,arguments)},this.bandwidth());else switch(n?this.overlapMode():`none`){case`stagger`:s.style(`text-anchor`,`middle`).attr(`dy`,function(e,n){return(i?1:-1)*((i?.71:0)+n%t)+`em`}).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`);break;case`hide`:s.style(`text-anchor`,`middle`).attr(`dy`,(i?.71:0)+`em`).attr(`dx`,0).attr(`visibility`,function(e,n){return n%t?`hidden`:null}).attr(`transform`,`rotate(0)`);break;case`rotate`:let e=-this.labelRotation()||0;if(e!==0&&t>1){s.each(function(){let t=(0,o.select)(this),n=t.node().getBBox(),r=(i?1:-1)*Math.sin(Math.PI*(-Math.abs(e)/180));t.style(`text-anchor`,e>0?i?`start`:`end`:i?`end`:`start`).attr(`dy`,n.height/2*r+`px`).attr(`dx`,e>0?i?`0.71em`:`-0.71em`:i?`-0.71em`:`0.71em`).attr(`transform`,`rotate(`+e+`)`).attr(`visibility`,null)});break}default:s.style(`text-anchor`,n?`middle`:r?`end`:`start`).attr(`dy`,n?(i?.71:0)+`em`:`0.32em`).attr(`dx`,0).attr(`visibility`,null).attr(`transform`,`rotate(0)`)}}calcTickOverlapModulus(e){let t=1;switch(this.overlapMode()){case`rotate`:case`stagger`:case`hide`:let n=[];e.selectAll(`.tick > text`).each(function(){let e=this.getBoundingClientRect();for(let r=n.length-1;r>=0&&!(n[r].right<e.left);--r)n.length+1-r>t&&(t=n.length+1-r);n.push(e)});break;default:}return t}calcOverflow(e,t){if(this.updateScale(),this.hidden())return{left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:1};let n=this.isHorizontal();this.range(n?[0,this.width()]:[this.height(),0]);let r=e.append(`g`).attr(`class`,this.classID()),i=r.append(`g`);i.attr(`class`,n?`x`:`y`).call(this.d3Axis),t&&e.selectAll(`.tick > text`).remove();let a={left:0,top:0,right:0,bottom:0,depth:0,tickOverlapModulus:this.calcTickOverlapModulus(i)};this.adjustText(i,a.tickOverlapModulus);let o=i.node().getBBox();switch(a.depth=n?o.height:o.width,this.shrinkToFit()){case`low`:case`both`:a.left=n?-o.x:0,a.bottom=n?0:-(this.height()-(o.height+o.y));break;default:}switch(this.shrinkToFit()){case`high`:case`both`:a.top=n?0:-o.y,a.right=n?-(this.width()-o.x-o.width):0;break;default:}return r.remove(),a}wrap(e,t,n){n||=/\s+/;let r=this;e.each(function(){let e=(0,o.select)(this),i=e.text().split(n).reverse(),a=[],s=0,c=1.1,l=e.attr(`x`),u=e.attr(`y`),d=parseFloat(e.style(`font-size`))||10,f=Math.floor(t/(d*c))-1,p=r.isHorizontal()?1:Math.ceil(i.length/f),m=parseFloat(e.attr(`dy`)),h=e.text(null).append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,m+`em`),g=0,_=i.pop();for(;_;)a.push(_),h.text(a.join(` `)),g++,h.node().getComputedTextLength()>t&&g>=p&&(a.pop(),h.text(a.join(` `)),a=[_],h=e.append(`tspan`).attr(`x`,l).attr(`y`,u).attr(`dy`,++s*c+m+`em`).text(_),g=0),_=i.pop();r.isHorizontal()||e.selectAll(`tspan`).attr(`y`,-s/2+`em`)})}linebreak(e,t){this.wrap(e,t,`
|
|
12
|
+
`)}update(e,t){super.update(e,t),this.svg.style(`display`,this.hidden()?`none`:null);let n=this.calcOverflow(t),r=this.isHorizontal()?n.left:this.height()-n.top-n.bottom,i=this.isHorizontal()?this.width()-n.right-this.padding():0+this.padding();this.range(this.reverse()?[i,r]:[r,i]);let a=this;function doPosition(e){e.attr(`transform`,function(){switch(a.orientation()){case`left`:return`translate(`+n.depth+`, `+n.top+`)`;case`top`:return`translate(0,`+n.depth+`)`;case`right`:return`translate(`+(a.width()-n.depth)+`, `+n.top+`)`;case`bottom`:return`translate(0,`+(a.height()-n.depth)+`)`;default:}return`translate(0,0)`})}this.svg.style(`visibility`,this.type()===`none`?`hidden`:null).transition().call(doPosition),this._guideElement&&this.svgGuides.transition().call(doPosition),this.svgAxis.call(this.d3Axis),this.adjustText(this.svgAxis,n.tickOverlapModulus);let o={x:this.pos().x,width:this.width()},s=this.svgAxis.selectAll(`.axisTitle`).data(this.title()?[this.title()]:[]),c=s.enter().append(`text`).attr(`class`,`axisTitle`).merge(s).transition().attr(`dx`,null).style(`text-anchor`,`end`);switch(this.orientation()){case`left`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,2).attr(`dy`,`.71em`);break;case`right`:c.attr(`transform`,`rotate(-90)`).attr(`x`,-2).attr(`y`,4).attr(`dx`,null).attr(`dy`,`-.71em`);break;case`top`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,2).attr(`dx`,null).attr(`dy`,`.71em`);break;case`bottom`:c.attr(`transform`,`rotate(0)`).attr(`x`,o.width-2).attr(`y`,-2).attr(`dy`,null);break;default:}c.text(this.title_exists()?this.title():``),s.exit().remove(),this.svgGuides.call(this.d3Guides).selectAll(`.tick`).classed(`guide-0`,e=>e===0&&this.low()<0)}rerender(){this.svgAxis.call(this.d3Axis),this.svgGuides.call(this.d3Guides)}postUpdate(e,t){super.postUpdate(e,t),this._guideElement&&this._guideElement.attr(`transform`,this._element.attr(`transform`))}};Axis.prototype._class+=` chart_Axis`,Axis.prototype.publish(`type`,`linear`,`set`,`Type`,[`none`,`ordinal`,`linear`,`pow`,`log`,`time`]),Axis.prototype.publish(`timePattern`,`%Y-%m-%d`,`string`,`Time Series Pattern`,null,{disable:e=>e.type()!==`time`}),Axis.prototype.publish(`reverse`,!1,`boolean`,`Reverse`),Axis.prototype.publish(`title`,null,`string`,`Title`),Axis.prototype.publish(`orientation`,`bottom`,`set`,`Placement/orientation of the axis`,[`left`,`top`,`right`,`bottom`]),Axis.prototype.publish(`powExponent`,2,`number`,`Power exponent (disabled when type is not 'pow')`,null,{disable:e=>e.type()!==`pow`}),Axis.prototype.publish(`logBase`,10,`number`,`Logarithmic base (disabled when type is not 'log')`,null,{disable:e=>e.type()!==`log`}),Axis.prototype.publish(`ordinals`,[],`array`,`Array of ordinal values to display (disabled when type is not 'ordinal')`,null,{disable:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`fontSize`,null,`number`,`Size of tick label font (pixels)`,null,{optional:!0}),Axis.prototype.publish(`fontFamily`,null,`string`,`Font family of tick labels`,null,{optional:!0}),Axis.prototype.publish(`tickCount`,null,`number`,`Number of ticks to display (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickFormat`,null,`string`,`Format rules for tick text (disabled when type is 'ordinal')`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`tickLength`,null,`number`,`Height (or width for left/right orientations) of the axis ticks (in pixels)`,null,{optional:!0}),Axis.prototype.publish(`ticks`,[],`array`,`Custom tick labels`,null,{optional:!0}),Axis.prototype.publish(`low`,null,`any`,`Minimum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`high`,null,`any`,`Maximum tick value (disabled when type is ordinal)`,null,{optional:!0,disable:e=>e.type()===`ordinal`}),Axis.prototype.publish(`overlapMode`,`none`,`set`,`Specifies the behavior when tick labels overlap`,[`none`,`stagger`,`hide`,`rotate`,`linebreak`,`wrap`]),Axis.prototype.publish(`labelRotation`,33,`number`,`Angle of rotation for tick labels (disabled when overlapMode is not 'rotate')`,null,{optional:!0,disable:e=>e.overlapMode()!==`rotate`}),Axis.prototype.publish(`shrinkToFit`,`both`,`set`,`shrinkToFit`,[`none`,`low`,`high`,`both`]),Axis.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:e=>e.type()===`ordinal`}),Axis.prototype.publish(`hidden`,!1,`boolean`,`Hides axis when 'true'`),Axis.prototype.publish(`ordinalPaddingInner`,.1,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`,null,{disable:e=>e.type()!==`ordinal`}),Axis.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:e=>e.type()!==`ordinal`}),Axis.prototype.publish(`ordinalMappings`,null,`object`,`Alternative label mappings (icons)`,null,{optional:!0}),Axis.prototype.publish(`padding`,0,`number`,`Padding space at top of axis (pixels)`,null,{optional:!0}),Axis.prototype._origType=Axis.prototype.type,Axis.prototype.type=function(e){let t=Axis.prototype._origType.apply(this,arguments);return e!==void 0&&(this._type=e,this.updateScale()),t},Axis.prototype._origTimePattern=Axis.prototype.timePattern,Axis.prototype.timePattern=function(e){let t=Axis.prototype._origTimePattern.apply(this,arguments);return e!==void 0&&(this._timePattern=e,this.updateScale()),t};var XYAxis=class extends o.SVGWidget{domainAxis;valueAxis;xAxis;yAxis;xyBrush;xBrush;yBrush;margin;focusChart;constructor(){super(),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.domainAxis=new Axis().classed({domain:!0}).orientation_default(`bottom`).type(`ordinal`).overlapMode_default(`stagger`).shrinkToFit_default(`high`).extend_default(0),this.valueAxis=new Axis().classed({value:!0}).orientation_default(`left`).type(`linear`).shrinkToFit_default(`high`),this.xyBrush=(0,o.brush)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.xBrush=(0,o.brushX)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2()),this.yBrush=(0,o.brushY)().on(`end`,()=>this.brushMoved()).on(`start.handle brush.handle end.handle`,()=>this.brushMoved2())}_prevBrush;resetSelection(){return this._prevBrush=null,this}parseData(e){return this.domainAxis.parse(e)}parseValue(e){return this.valueAxis.parse(e,!0)}formatData(e){return this.domainAxis.format(e)}formatValue(e){return this.valueAxis.format(e)}parsedData(){return this.data().map(function(e){let t=0;return e.map(function(e,n){if(n===0)return this.parseData(e);if(n>=this.columns().length)return e;let r=this.yAxisStacked()?[t,t+this.parseValue(e)]:this.parseValue(e);return t+=this.parseValue(e),r},this)},this)}bandwidth(){return this.domainAxis.bandwidth()}svg;svgRegions;svgDomainGuide;svgValueGuide;svgData;svgDataClipRect;svgFocus;svgBrush;enter(e,t){super.enter(e,t),this.svg=t.append(`g`),this.svgRegions=t.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=t.append(`g`),this.domainAxis.target(this.svg.node()).guideTarget(this.svgDomainGuide.node()),this.valueAxis.target(this.svg.node()).guideTarget(this.svgValueGuide.node()),this.svgBrush=t.append(`g`).attr(`class`,`brush`),this.chartsEnter(this,this.svgData,250)}resizeBrushHandle(e,t,n){let r,i,a;return e.type===`e`||e.type===`w`?(r=+(e.type===`e`),i=r?1:-1,a=n/3,`M`+.5*i+`,`+a+`A6,6 0 0 `+r+` `+6.5*i+`,`+(a+6)+`V`+(2*a-6)+`A6,6 0 0 `+r+` `+.5*i+`,`+2*a+`ZM`+2.5*i+`,`+(a+8)+`V`+(2*a-8)+`M`+4.5*i+`,`+(a+8)+`V`+(2*a-8)):(r=+(e.type===`s`),a=r?1:-1,i=t/3,`M`+i+`, `+.5*a+`A6,6 0 0 `+(r+1)%2+` `+(i+6)+`,`+6.5*a+`H`+(2*i-6)+`A6,6 0 0 `+(r+1)%2+` `+2*i+`,`+.5*a+`ZM`+(i+8)+`,`+2.5*a+`H`+(2*i-8)+`M`+(i+8)+`,`+4.5*a+`H`+(2*i-8))}_skipSelection=!1;skipSelection(e){return arguments.length?(this._skipSelection=e,this):this._skipSelection}brushMoved(){if(this._skipSelection)return;let e=[],t=this,n=(0,o.brushSelection)(this.svgBrush.node());n&&(e=this.data().filter(function(e){let r=t.dataPos(e[0]);if(t.use2dSelection()){let i=t.valuePos(e[1])+t.valueAxis.bandwidth()/2;return r>=n[0][0]&&r<=n[1][0]&&i>=n[0][1]&&i<=n[1][1]}else return r>=n[0]&&r<=n[1]})),this.selection(e)}brushMoved2(){let e=this.orientation()===`horizontal`,t=this.use2dSelection()?[]:e?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],n=this.svgBrush.selectAll(`.handle--custom`).data(t),r=(0,o.d3Event)()?.selection;r==null?n.attr(`display`,`none`):e?n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(`+r[t]+`,0)`):n.attr(`display`,null).attr(`transform`,(e,t)=>`translate(0, `+r[t]+`)`)}dataPos(e){return this.domainAxis.scalePos(e)}valuePos(e){return this.valueAxis.scalePos(e)}getAxisSize(e){return{width:this.xAxis?this.xAxis.width():e.xAxis.width(),height:this.yAxis?this.yAxis.height():e.yAxis.width()}}calcMargin(e,t,n){let r={top:!n&&this.selectionMode()?10:2,right:n&&(this.selectionMode()||this.xAxisFocus())?10:2,bottom:(this.xAxisFocus()?this.xAxisFocusHeight():0)+2,left:2},i=this.width()-r.left-r.right,a=this.height()-r.top-r.bottom,o=0,s=30,c=0,l=30;for(let e=0;e<10;++e){this.xAxis.width(i-l).height(0);let e=this.xAxis.calcOverflow(t),n=e.depth;this.yAxis.width(0).height(a-s);let r=this.yAxis.calcOverflow(t),u=r.depth;if(o=e.right,c=r.top,n===s&&u===l)break;s=n,l=u}return this.xAxis.x(i/2+l/2+r.left).y(a+r.top).width(i-l),this.yAxis.x(r.left).y(a/2-s/2+r.top).height(a-s),r.left+=l,r.top+=c,r.right+=o,r.bottom+=s,r}updateRegions(e,t,n){let r=this,i=this.svgRegions.selectAll(`.region`).data(this.regions());i.enter().append(`rect`).attr(`class`,`region`),n?i.attr(`x`,function(e){return r.dataPos(e.x0)}).attr(`y`,0).attr(`width`,function(e){return r.dataPos(e.x1)-r.dataPos(e.x0)}).attr(`height`,this.height()).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}):i.attr(`x`,0).attr(`y`,function(e){return r.dataPos(e.x0)}).attr(`width`,this.width()).attr(`height`,function(e){return r.dataPos(e.x0)-r.dataPos(e.x1)}).style(`stroke`,function(e){return r._palette(e.colorID)}).style(`fill`,function(e){return(0,o.hsl)(r._palette(e.colorID)).brighter()}),i.exit().remove()}_prevXAxisType;update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this,r=this.orientation()===`horizontal`;switch(this.updateRegions(e,t,r),this.domainAxis.orientation(r?`bottom`:`left`).title(this.xAxisTitle_exists()?this.xAxisTitle():this.columns()[0]),this.valueAxis.orientation(r?`left`:`bottom`),this.xAxis=r?this.domainAxis:this.valueAxis,this.yAxis=r?this.valueAxis:this.domainAxis,this.xAxisType()){case`ordinal`:let e=this.columns().length,t={};this.domainAxis.ordinals(this.data().map(function(r){return t[r[0]]=n.xAxisOrdinalMapping(r,r[e]),r[0]})).ordinalMappings(t);break;default:let r=this.xAxisDomainLow()?this.xAxisDomainLow():this.domainAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return e[0]})),i=this.xAxisDomainHigh()?this.xAxisDomainHigh():this.domainAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return e[0]}));r!==void 0&&i!==void 0&&this.domainAxis.low(r).high(i);break}let i=this.yAxisDomainLow()?this.yAxisDomainLow():this.valueAxis.parseInvert((0,o.min)(this.parsedData(),function(e){return(0,o.min)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[0]:e})})),a=this.yAxisDomainHigh()?this.yAxisDomainHigh():this.valueAxis.parseInvert((0,o.max)(this.parsedData(),function(e){return(0,o.max)(e.filter(function(e,t){return t>0&&n.columns()[t]&&n.columns()[t].indexOf(`__`)!==0&&e!==null}),function(e){return e instanceof Array?e[1]:e})}));this.valueAxis.low(i).high(a),this.margin=this.calcMargin(e,t,r);let s=this.width()-this.margin.left-this.margin.right;s<0&&(s=0);let c=this.height()-this.margin.top-this.margin.bottom;c<0&&(c=0);let l=r?s:c,u=r?c:s;if(this.domainAxis.tickLength(this.xAxisGuideLines()?u:0).render(),this.valueAxis.tickLength(this.yAxisGuideLines()?l:0).render(),this.svgDataClipRect.attr(`width`,s).attr(`height`,c),this.svgData.transition().attr(`transform`,`translate(`+this.margin.left+`,`+this.margin.top+`)`),this.updateBrush(s,c,l,r),this.updateFocusChart(e,t,this.margin,s,c,r),this.chartsUpdate(s,c,250),this.selectionMode())return this.brushMoved()}updateBrush(e,t,n,r){let i=this.use2dSelection()?this.xyBrush:r?this.xBrush:this.yBrush,a=(0,o.brushSelection)(this.svgBrush.node());i.extent([[0,0],[e,t]]),this.svgBrush.attr(`transform`,`translate(`+this.margin.left+`, `+this.margin.top+`)`).style(`display`,this.selectionMode()?null:`none`).call(i);let s=this.use2dSelection()?[]:r?[{type:`w`},{type:`e`}]:[{type:`n`},{type:`s`}],c=this.svgBrush.selectAll(`.handle--custom`).data(s);if(c.enter().append(`path`).attr(`class`,`handle--custom`).merge(c).attr(`cursor`,r?`ew-resize`:`ns-resize`).attr(`d`,n=>this.resizeBrushHandle(n,e,t)),this.selectionMode()){if(this._prevXAxisType!==this.xAxisType()&&(this._prevXAxisType=this.xAxisType(),this._prevBrush=null),this._prevBrush){if(a){if(this._prevBrush.orientation!==this.orientation()){let e=a[0];a[0]=this._prevBrush.maxCurrExtent-a[1],a[1]=this._prevBrush.maxCurrExtent-e}let e=n/this._prevBrush.maxCurrExtent;e!==1&&this.svgBrush.transition().on(`start`,function(){i.on(`end`,null)}).call(i.move,[a[0]*e,a[1]*e]).on(`end`,()=>{i.on(`end`,()=>this.brushMoved())})}}else this.svgBrush.call(i.move,[0,n]);this._prevBrush={orientation:this.orientation(),maxCurrExtent:n}}}updateFocusChart(e,t,n,r,i,a){let o=this,s=this.svgFocus.selectAll(`#`+this.id()+`_focusChart`).data(this.xAxisFocus()?[!0]:[]);s.enter().append(`g`).attr(`id`,this.id()+`_focusChart`).attr(`class`,`focus`).each(function(){o.focusChart=new o.constructor().target(this),o.focusChart.xBrush.on(`brush.focus`,function(){o.syncAxis(r),o.chartsUpdate(r,i,0)}),o.focusChart.layers(o.layers().map(e=>new e.constructor))}).merge(s).each(function(){o.copyPropsTo(o.focusChart,[`layers`]);let e=0;for(let t of o.layers())t.copyPropsTo(o.focusChart.layers()[e]),e++;o.focusChart.xAxisFocus(!1).selectionMode(!0).skipSelection(!0).orientation(`horizontal`).xAxisGuideLines(!1).xAxisDomainLow(null).xAxisDomainHigh(null).yAxisGuideLines(!1).x(o.width()/2).y(o.height()-o.xAxisFocusHeight()/2).width(o.width()).height(o.xAxisFocusHeight()).columns(o.columns()).data(o.data()).render(),o.syncAxis(r)}),s.exit().each(function(){o.focusChart&&(o.focusChart.target(null),delete o.focusChart)}).remove()}syncAxis(e){let t=(0,o.brushSelection)(this.focusChart.svgBrush.node());if(t){if(this.focusChart.xAxisType()!==`ordinal`)this.xAxis.domain([this.focusChart.xAxis.invert(t[0]),this.focusChart.xAxis.invert(t[1])]);else{let n=(t[1]-t[0])/e;this.xAxis.range([-t[0]/n,(e-t[0])/n])}this.xAxis.rerender()}}layerColumns(e){let t=e.columns(),n=super.columns().filter(e=>e!==t[0]);return n.length?[t[0],...n]:t}layerColumnIndices(e){let t=e.columns();return this.layerColumns(e).map(e=>t.indexOf(e))}layerColumnIndex(e,t){return e.columns().indexOf(t)}layerData(e){if(arguments.length===1){let t=this.layerColumnIndices(e);return e.data().map(e=>{let n=t.map(t=>e[t]);return n.__hpcc_origRow=e,n})}throw Error(`Setting data on XYAxisLayer is not supported.`)}layerEnter(e,t,n=250){}layerUpdate(e,t,n=250){}layerExit(e,t,n=250){}chartsEnter(e,t,n=250){this.layerEnter(this,t,n);for(let e of this.layers())e.__xyAxisElement=t.append(`g`).attr(`class`,e.class()),e.target(e.__xyAxisElement.node()).layerEnter(this,t,n)}chartsUpdate(e,t,n){this.layerUpdate(this,this.svgData,n);for(let r of this.layers())r.resize({width:e,height:t}).layerUpdate(this,r.__xyAxisElement,n)}exit(e,t){this.valueAxis.target(null),this.domainAxis.target(null),super.exit(e,t)}selection(e){let t=this;this._selection.widgetElement().selectAll(`.selected,.deselected`).each(function(n){let r=e.indexOf(n.origRow)>=0;(0,o.select)(this).classed(`selected`,r).classed(`deselected`,!r).attr(`filter`,t._selection.svgGlowID()&&r?`url(#${t._selection.svgGlowID()})`:null)});let n=e.map(e=>this.rowToObj(e));setTimeout(()=>{this.click(n,``,!0)},0)}xAxisOrdinalMapping(e,t){return e[0]}click(e,t,n){}_selection};XYAxis.prototype._class+=` chart_XYAxis`,XYAxis.prototype.mixin(o.Utility.SimpleSelectionMixin),XYAxis.prototype.publish(`orientation`,`horizontal`,`set`,`Selects orientation for the axis`,[`horizontal`,`vertical`]),XYAxis.prototype.publish(`pointSizeColumn`,null,`string`,`pointSizeColumn`,null,{optional:!0}),XYAxis.prototype.publish(`minPointSize`,6,`number`,`minPointSize`),XYAxis.prototype.publish(`maxPointSize`,26,`number`,`maxPointSize`),XYAxis.prototype.publish(`use2dSelection`,!1,`boolean`,`2D Range Selector`),XYAxis.prototype.publish(`selectionMode`,!1,`boolean`,`Range Selector`),XYAxis.prototype.publishProxy(`xAxisTitle`,`domainAxis`,`title`),XYAxis.prototype.publishProxy(`xAxisTickCount`,`domainAxis`,`tickCount`),XYAxis.prototype.publishProxy(`xAxisTickFormat`,`domainAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`xAxisTicks`,`domainAxis`,`ticks`),XYAxis.prototype.publishProxy(`xAxisType`,`domainAxis`,`type`),XYAxis.prototype.publishProxy(`xAxisTypeTimePattern`,`domainAxis`,`timePattern`),XYAxis.prototype.publish(`xAxisDomainLow`,null,`string`,`X-Axis Low`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publish(`xAxisDomainHigh`,null,`string`,`X-Axis High`,null,{optional:!0,disable:e=>e.xAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`xAxisFontSize`,`domainAxis`,`fontSize`),XYAxis.prototype.publishProxy(`xAxisFontFamily`,`domainAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingInner`,`domainAxis`,`ordinalPaddingInner`),XYAxis.prototype.publishProxy(`xAxisOrdinalPaddingOuter`,`domainAxis`,`ordinalPaddingOuter`),XYAxis.prototype.publishProxy(`xAxisOverlapMode`,`domainAxis`,`overlapMode`),XYAxis.prototype.publishProxy(`xAxisLabelRotation`,`domainAxis`,`labelRotation`),XYAxis.prototype.publishProxy(`xAxisDomainPadding`,`domainAxis`,`extend`),XYAxis.prototype.publish(`xAxisGuideLines`,!1,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publish(`xAxisFocus`,!1,`boolean`,`X-Axis Focus`,null,{disable:e=>e.orientation()!==`horizontal`}),XYAxis.prototype.publish(`xAxisFocusHeight`,80,`number`,`X-Axis Focus Height`,null,{disable:e=>!e.xAxisFocus()}),XYAxis.prototype.publishProxy(`xAxisHidden`,`domainAxis`,`hidden`),XYAxis.prototype.publishProxy(`yAxisFontSize`,`valueAxis`,`fontSize`),XYAxis.prototype.publishProxy(`yAxisFontFamily`,`valueAxis`,`fontFamily`),XYAxis.prototype.publishProxy(`yAxisTitle`,`valueAxis`,`title`),XYAxis.prototype.publishProxy(`yAxisTickCount`,`valueAxis`,`tickCount`),XYAxis.prototype.publishProxy(`yAxisTickFormat`,`valueAxis`,`tickFormat`),XYAxis.prototype.publishProxy(`yAxisTicks`,`valueAxis`,`ticks`),XYAxis.prototype.publishProxy(`yAxisType`,`valueAxis`,`type`),XYAxis.prototype.publishProxy(`yAxisTypeTimePattern`,`valueAxis`,`timePattern`),XYAxis.prototype.publishProxy(`yAxisTypePowExponent`,`valueAxis`,`powExponent`),XYAxis.prototype.publishProxy(`yAxisTypeLogBase`,`valueAxis`,`logBase`),XYAxis.prototype.publish(`yAxisStacked`,!1,`boolean`,`Stacked Chart`,null,{tags:[`Basic`],disable:e=>e.xAxisType()!==`ordinal`||e._class.indexOf(`chart_Column`)<0}),XYAxis.prototype.publish(`yAxisDomainLow`,null,`string`,`Y-Axis Low`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publish(`yAxisDomainHigh`,null,`string`,`Y-Axis High`,null,{optional:!0,disable:e=>e.yAxisType()===`ordinal`}),XYAxis.prototype.publishProxy(`yAxisDomainPadding`,`valueAxis`,`extend`),XYAxis.prototype.publish(`yAxisGuideLines`,!0,`boolean`,`Y-Axis Guide Lines`),XYAxis.prototype.publishProxy(`yAxisHidden`,`valueAxis`,`hidden`),XYAxis.prototype.publish(`regions`,[],`array`,`Regions`),XYAxis.prototype.publish(`layers`,[],`widgetArray`,`Layers`,null,{render:!1}),XYAxis.prototype.publishProxy(`xAxisPadding`,`domainAxis`,`padding`),XYAxis.prototype.publishProxy(`yAxisPadding`,`valueAxis`,`padding`),XYAxis.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var Scatter=class extends XYAxis{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`,multi:!0}];constructor(){super(),INDChart.call(this),ITooltip.call(this),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}curve(){switch(this.interpolate()){case`linear`:return linear_default$1;case`step`:return step_default;case`step-before`:return stepBefore;case`step-after`:return stepAfter;case`basis`:return basis_default;case`bundle`:return F;case`cardinal`:return I;case`catmullRom`:return L;case`natural`:return natural_default;default:return monotoneX}}getScale(){switch(this.pointSizeScale()){case`linear`:return(0,o.scaleLinear)();case`pow`:return(0,o.scalePow)().exponent(2);case`log`:return(0,o.scaleLog)();case`sqrt`:return(0,o.scaleSqrt)()}}pointColor(e,t,n,r){return this.interpolate()&&this.pointDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}lineColor(e,t,n,r){return this.interpolateFill()&&this.interpolateDarken()?this.strokeColor(e,t,n,r):this.fillColor(e,t,n,r)}areaColor(e,t,n,r){return this.fillColor(e,t,n,r)}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(e){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:e.label,arr:r.columns().slice(1).map(function(t,n){return{label:t,color:r._palette(t),value:r.data()[e.rowIdx][n+1]}})});default:return r.tooltipFormat({label:e.label,series:e.column,value:e.value})}})}_prevPointShape;layerUpdate(e,t,n=250){super.layerUpdate(e,t);let r=e.orientation()===`horizontal`,i=r?this.height():this.width(),a=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.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()&&(t.selectAll(`.data`).remove(),this._prevPointShape=this.pointShape());function mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}let s=this.pointSizeColumn_exists(),c,l,u;s&&(c=this.columns().indexOf(this.pointSizeColumn()),l=(0,o.extent)(this.data(),e=>e[c]),u=this.getScale().domain(l));let d=this.layerColumns(e),f=this.layerData(e),p=this.flattenData(d,f).map(function(e){return e.shape=mapShape(a.pointShape()),e.column=d[e.colIdx],e.row=f[e.rowIdx],e.origRow=f[e.rowIdx].__hpcc_origRow,l?(e.size=u(e.row[c])*(a.maxPointSize()-a.minPointSize())+a.minPointSize(),e.column===a.pointSizeColumn()?!1:e):(e.size=a.pointSize(),e)}).filter(e=>e),m=t.selectAll(`.area`).data(d.filter(function(e,t){return a.interpolate()&&a.interpolateFill()&&t>0})),h=m.enter().append(`path`),g=area_default$1().curve(this.curve());r?g.x(function(t){return a.xPos(e,t)}).y0(Math.min(i,this.yPos(e,{value:0}))).y1(function(t){return a.yPos(e,t)}):g.y(function(t){return a.yPos(e,t)}).x0(Math.max(0,this.xPos(e,{value:0}))).x1(function(t){return a.xPos(e,t)}),h.merge(m).attr(`class`,e=>`area series series-`+this.cssTag(e)).each(function(e,t){(0,o.select)(this).attr(`d`,g(p.filter(function(e){return e.colIdx===t+1}))).style(`opacity`,a.interpolateFillOpacity()).style(`stroke`,`none`).style(`fill`,a.areaColor([],e,void 0,[]))}),m.exit().remove();let _=t.selectAll(`.line`).data(d.filter(function(e,t){return a.interpolate()&&t>0})),v=_.enter().append(`path`),b=line_default$1().x(function(t){return a.xPos(e,t)}).y(function(t){return a.yPos(e,t)}).curve(this.curve());v.merge(_).attr(`class`,e=>`line series series-`+this.cssTag(e)).each(function(e,t){let n=(0,o.select)(this),r=p.filter(function(e){return e.colIdx===t+1});n.attr(`d`,b(r)).style(`stroke`,a.lineColor([],e,void 0,[])).style(`fill`,`none`)}),_.exit().remove();let S=t.selectAll(`.point`).data(p,function(e,t){return e.shape+`_`+t});S.enter().append(`g`).each(function(t){let n=(0,o.select)(this);n.append(t.shape).attr(`class`,`pointShape`),n.append(`text`).attr(`class`,`pointValue`).style(`display`,`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).attr(`fill`,function(e,t){return a.valueBaseline()===`middle`||a.valueBaseline()===`central`?a.textColor(e.row,e.column,e.value,e.origRow):null}),n.append(`circle`).attr(`class`,`pointSelection`).on(`mouseout.tooltip`,a.tooltip.hide).on(`mousemove.tooltip`,a.tooltip.show).call(e._selection.enter.bind(e._selection)).on(`click`,function(t,n){a.click(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`dblclick`,function(t,n){a.dblclick(e.rowToObj(e.data()[t.rowIdx]),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(a.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}})}).merge(S).attr(`class`,e=>`point series series-`+this.cssTag(e.column)).each(function(t){(0,o.select)(this).select(`.pointValue`).attr(`x`,function(t){return a.xPos(e,t)}).attr(`y`,function(t){return a.yPos(e,t)}).style(`display`,a.showValue()?`block`:`none`).attr(`text-anchor`,a.valueAnchor()).attr(`alignment-baseline`,a.valueBaseline()).text(function(e){return e.value}),(0,o.select)(this).select(`.pointSelection`).attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size).attr(`tabindex`,a.tabNavigation()?0:null).attr(`role`,a.tabNavigation()?`button`:null).attr(`aria-label`,a.tabNavigation()?e=>`${e.column||`Value`}: ${e.value} @ ${e.label}`:null);let n=(0,o.select)(this).select(`.pointShape`);switch(t.shape){case`rect`:n.attr(`x`,function(n){return a.xPos(e,n)-t.size/2}).attr(`y`,function(n){return a.yPos(e,n)-t.size/2}).attr(`width`,t.size).attr(`height`,t.size).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`circle`:n.attr(`cx`,function(t){return a.xPos(e,t)}).attr(`cy`,function(t){return a.yPos(e,t)}).attr(`r`,t.size*.9).style(`fill`,a.pointColor(t.row,t.column,t.value,t.origRow));break;case`path`:n.attr(`d`,function(n){return`M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)-t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` M`+(a.xPos(e,n)-t.size/2)+` `+(a.yPos(e,n)+t.size/2)+` L`+(a.xPos(e,n)+t.size/2)+` `+(a.yPos(e,n)-t.size/2)}).style(`stroke`,a.pointColor(t.row,t.column,t.value,t.origRow));break;default:}}),S.exit().remove()}exit(e,t){super.exit(e,t)}};Scatter.prototype._class+=` chart_Scatter`,Scatter.prototype.implements(INDChart.prototype),Scatter.prototype.implements(ITooltip.prototype),Scatter.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Scatter.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Scatter.prototype.publish(`pointSizeScale`,`linear`,`set`,`pointSizeScale`,[`linear`,`pow`,`log`,`sqrt`]),Scatter.prototype.publish(`pointShape`,`cross`,`set`,`Shape of the data points`,[`circle`,`rectangle`,`cross`]),Scatter.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Scatter.prototype.publish(`interpolate`,``,`set`,`Interpolate Data`,[``,`linear`,`step`,`step-before`,`step-after`,`basis`,`bundle`,`cardinal`,`catmullRom`,`natural`,`monotone`]),Scatter.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:e=>!e.interpolate()}),Scatter.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:e=>!e.interpolateFill()}),Scatter.prototype.publish(`interpolateFill`,!1,`boolean`,`If true, the area between the line and zero will be filled`),Scatter.prototype.publish(`interpolateFillOpacity`,.66,`number`,`Fill interpolation Opacity`,null,{range:{min:0,step:.01,max:1}}),Scatter.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Scatter.prototype.publish(`showValue`,!1,`boolean`),Scatter.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Scatter.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`]);var Area=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`).interpolateFill_default(!0)}};Area.prototype._class+=` chart_Area`;var Column=class extends XYAxis{static __inputs=[{id:`label`,type:`string`},{id:`values`,type:`number`,multi:!0}];_linearGap;textLocal=(0,o.local)();stackedTextLocal=(0,o.local)();isHorizontal;constructor(){super(),INDChart.call(this),ITooltip.call(this),this._selection.skipBringToTop(!0),this._linearGap=25}layerEnter(e,t,n=250){super.layerEnter(e,t,n);let r=this;this.tooltipHTML(function(t){switch(r.tooltipStyle()){case`series-table`:return r.tooltipFormat({label:t.row[0],arr:r.columns().slice(1).map(function(e,n){return{label:e,color:r._palette(e),value:t.row[n+1]}})});default:let n=t.row[t.idx];return n instanceof Array&&(n=n[1]-n[0]),r.tooltipFormat({label:t.row[0],series:r.layerColumns(e)[t.idx],value:n})}})}adjustedData(e){return this.layerData(e).map(t=>{let n=0;return t.map((t,r)=>{if(r===0||r>=this.layerColumns(e).length)return t;let i=e.yAxisStacked()?[n,n+t]:t;return n+=t,i},this)},this)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=e.orientation()===`horizontal`;this.isHorizontal=r;let i=this;this.tabNavigation()&&e.parentRelativeDiv?e.parentRelativeDiv.attr(`tabindex`,`0`).attr(`role`,`group`).attr(`aria-label`,`${this.columns()[0]||`Chart`} data`):e.parentRelativeDiv&&e.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()));let a=(0,o.format)(i.showValueAsPercentFormat()),s=10,c=0;switch(e.xAxisType()){case`ordinal`:s=e.bandwidth(),c=-s/2;break;case`linear`:case`time`:s=Math.max(Math.abs(e.dataPos(2)-e.dataPos(1))*(100-this._linearGap)/100,s),c=-s/2;break;default:}this.tooltip.direction(r?`n`:`e`);let l=(0,o.scaleBand)().domain(i.layerColumns(e).filter(function(e,t){return t>0})).rangeRound(r?[0,s]:[s,0]).paddingInner(Math.max(this.xAxisSeriesPaddingInner(),.05)).paddingOuter(0),u=[],d=[],f=this.columns().length,p=this.data();this.showValue()&&this.showValueAsPercent()===`series`&&p.forEach(e=>{e.filter((e,t)=>t>0&&t<f).forEach((e,t)=>{d[t+1]===void 0&&(d[t+1]=0),d[t+1]+=e})}),(this.showDomainTotal()||this.showValue()&&this.showValueAsPercent()===`domain`)&&(u=p.map(e=>e.filter((e,t)=>t>0&&t<f).reduce((e,t)=>e+t,0)));let m=t.selectAll(`.dataRow`).data(this.adjustedData(e)),h=e.data(),g=this.getAxisSize(e);m.enter().append(`g`).attr(`class`,`dataRow`).merge(m).each(function(t,p){let m=(0,o.select)(this),_=m.selectAll(`.dataCell`).data(t.filter(function(t,n){return n<i.layerColumns(e).length}).map(function(n,r){return{column:i.layerColumns(e)[r],row:t,origRow:h[p],value:n,idx:r}}).filter(function(e){return e.value!==null&&e.idx>0}),e=>e.column),v=_.enter().append(`g`).attr(`class`,`dataCell`).on(`mouseout.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.hide.apply(i,arguments)}).on(`mousemove.tooltip`,function(e){(!i.tooltipInnerTextEllipsedOnly()||e.innerTextObj&&e.innerTextObj.isTruncated)&&i.tooltip.show.apply(i,arguments)}).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){i.click(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`dblclick`,function(t){i.dblclick(e.rowToObj(t.origRow),t.column,e._selection.selected(this))}).on(`keydown`,function(t,n){if(i.tabNavigation()){let t=(0,o.d3Event)();(t.code===`Space`||t.key===`Enter`)&&(t.preventDefault(),e._selection.click(this))}}).style(`opacity`,0).each(function(e){let t=(0,o.select)(this);t.append(`rect`).attr(`class`,`columnRect series series-`+i.cssTag(e.column)),t.append(`text`).attr(`class`,`columnRectText`).style(`stroke`,`transparent`)});v.transition().duration(n).style(`opacity`,1);let b=e.yAxisStacked()?s:l.bandwidth();v.merge(_).attr(`tabindex`,i.tabNavigation()?0:null).attr(`role`,i.tabNavigation()?`button`:null).attr(`aria-label`,i.tabNavigation()?e=>`${e.origRow[0]} - ${e.column}: ${e.value instanceof Array?e.value[1]-e.value[0]:e.value}`:null).each(function(s){let m=(0,o.select)(this),h=e.dataPos(t[0])+(e.yAxisStacked()?0:l(s.column))+c,_=s.value instanceof Array?s.value[1]:s.value,v=s.origRow[s.idx];if(i.showValue()){let e=i.dataMeta();switch(i.showValueAsPercent()){case`series`:let t=e.sum===void 0?d[s.idx]:e.sum;v=a(v/t);break;case`domain`:let n=e.sum===void 0?u[p]:e.sum;v=a(v/n);break;default:v=(0,o.format)(i.showValueFormat())(v);break}}let S=e.valuePos(_),C=e.valuePos(s.value instanceof Array?s.value[0]:0),w=Math.min(C,S),T=Math.abs(S-C),E=i.innerTextFontSize(),D=i.innerTextPadding_exists()?i.innerTextPadding():E/2.5,O=i.intersectRectRect({x:r?h:w,y:r?w:h,width:r?b:T,height:r?T:b},{x:0,y:0,width:g.width,height:g.height}),k=m.select(`rect`).transition().duration(n).style(`fill`,e=>i.fillColor(e.row,e.column,e.value,e.origRow));r?k.attr(`x`,h).attr(`y`,w).attr(`width`,b).attr(`height`,T):k.attr(`y`,h).attr(`x`,w).attr(`height`,b).attr(`width`,T);let A=m.select(`text`).transition().duration(n).style(`font-size`,E+`px`).style(`fill`,e=>i.textColor(e.row,e.column,e.value,e.origRow));A.style(`font-family`,i.innerTextFontFamily_exists()?i.innerTextFontFamily():null);let j=i.innerTextPadding_exists()?i.innerTextPadding():8,M=E/2.7;if(r){let e=O.y+O.height-D;A.attr(`x`,h+b/2).attr(`y`,e+M).attr(`transform`,`rotate(-90, ${h+b/2}, ${e})`)}else A.attr(`x`,O.x+j).attr(`y`,h+b/2+M);A.attr(`height`,b).attr(`width`,T),i.showInnerText()&&A.text(e=>{let t=i.innerText(e.origRow,e.origRow[f],e.idx);if(t){let n=r?O.height:O.width,a=i.calcInnerText(n,t,v);return e.innerTextObj=a,a.text}return``});let N=m.selectAll(`.dataText`).data(i.showValue()?[`${_}`]:[]);N.enter().append(`g`).attr(`class`,`dataText`).each(function(e){i.textLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(N).each(function(){let e={x:0,y:0},t=i.valueFontFamily(),n=i.valueFontSize(),a=i.textSize(v,t,n),o=parseFloat(v)>=0,c=i.valueAnchor()?i.valueAnchor():r?`middle`:`start`,l=O.x,u=g.width-(O.x+O.width),d=O.y,f=g.height-(O.y+O.height),p,m,_;if(s.innerTextObj){let{padding:t,valueTextWidth:i}=s.innerTextObj;m=!1,r?(c=`middle`,e.x=h+b/2,s.innerTextObj.category===4?(m=!0,e.y=w-t-n/2):e.y=w+t+n/2):(c=`start`,s.innerTextObj.category===4?(m=!0,e.x=T+w+t):e.x=T+w-i-t,e.y=h+b/2)}else r?(p=O.height<a.height,m=!i.valueCentered()||p,e.x=O.x+O.width/2,m?o?(_=d<a.height+j,_?p?e.y=O.y+O.height+a.height:(m=!1,e.y=O.y+O.height/2):e.y=O.y-a.height/2-j):(_=f<a.height,_?p?e.y=O.y-a.height/2-j:(m=!1,e.y=O.y+O.height/2):e.y=O.y+a.height+j):e.y=O.y+O.height/2):(p=O.width<a.width,m=!i.valueCentered()||p,e.y=O.y+O.height/2,m?o?(_=u<a.width+j,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x-(a.width-j):e.x=O.x+O.width+a.width/2+j):(_=l<a.width,_?i.showInnerText()||!p?(m=!1,e.x=O.x+O.width/2):e.x=O.x+O.width+(a.width-j):e.x=O.x-(a.width-j)):e.x=O.x+O.width/2);let S=m?null:i.textColor(s.row,s.column,s.value,s.origRow),C=i.columns(),E=i.yAxisStacked()&&p||m&&i.yAxisStacked()&&C.indexOf(s.column)!==C.length-1;i.textLocal.get(this).pos(e).anchor(c).fontFamily(t).fontSize(n).text(`${v}`).colorFill(S).visible(i.showValue()&&!E).render()}),N.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),_.exit().transition().duration(n).style(`opacity`,0).remove();let S=e.yAxisStacked()?u[p]:Math.max(...t.filter((e,t)=>t>0&&t<f)),C=m.selectAll(`.stackedTotalText`).data(i.showDomainTotal()?[u[p]]:[]);C.enter().append(`g`).attr(`class`,`stackedTotalText`).each(function(e){i.stackedTextLocal.set(this,new o.Text().target(this).colorStroke_default(`transparent`))}).merge(C).each(function(n){let a={x:0,y:0},o=e.dataPos(t[0]),s=e.valuePos(S),c=i.valueFontFamily(),l=i.valueFontSize(),u=i.textSize(n,c,l),d=parseFloat(n)>=0,f=`middle`;r?(a.x=o,d?a.y=s-u.height/2:a.y=s+u.height/2):(f=`start`,a.y=o,d?a.x=s+u.width/2:a.x=s-u.width/2),i.stackedTextLocal.get(this).pos(a).anchor(f).fontFamily(c).fontSize(l).text(n).render()}),C.exit().each(function(e){i.textLocal.get(this).target(null)}).remove()}),m.exit().transition().duration(n).remove()}calcInnerText(e,t,n){let r=this.innerTextFontFamily_exists()?this.innerTextFontFamily():`Verdana`,i=this.innerTextFontSize(),a=this.valueFontFamily_exists()?this.valueFontFamily():`Verdana`,o=this.valueFontSize(),s=this.innerTextPadding_exists()?this.innerTextPadding():i/2.5,c=this.isHorizontal?o:this.textSize(n,a,o).width,l=this.textSize(`...`,r,i).width,u=this.textSize(t,r,i).width,d=t,f=s*3+u+c,p=s*3+l+c,m=s*1+c,h=4;if(f<e)h=1;else if(p<e){let n=e-p,a=``;for(let e of t)if(this.textSize(a+e,r,i).width>n){t=a+`...`;break}else a+=e;h=2}else m<e?(t=``,h=3):t=``;return{text:t,isTruncated:d!==t,padding:s,category:h,valueTextWidth:c}}innerText(e,t,n){return e[0]}};Column.prototype._class+=` chart_Column`,Column.prototype.implements(INDChart.prototype),Column.prototype.implements(ITooltip.prototype),Column.prototype.publish(`valueFontFamily`,null,`string`,`Font family of value text`,null,{optional:!0}),Column.prototype.publish(`valueFontSize`,12,`number`,`Height of value text (pixels)`),Column.prototype.publish(`innerTextFontFamily`,null,`string`,`Font family of inner text`,null,{optional:!0}),Column.prototype.publish(`innerTextPadding`,8,`number`,`Offset of inner text (pixels)`,null,{optional:!0}),Column.prototype.publish(`innerTextFontSize`,12,`number`,`Height of inner text (pixels)`),Column.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,()=>Column.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Column.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Column.prototype.publish(`showValue`,!1,`boolean`,`Show Value in column`),Column.prototype.publish(`showInnerText`,!1,`boolean`,`Show Label in column`),Column.prototype.publish(`showValueFormat`,`,`,`string`,`D3 Format for Value`,null,{disable:e=>!e.showValue()||!!e.showValueAsPercent()}),Column.prototype.publish(`showValueAsPercent`,null,`set`,`If showValue is true, optionally show value as a percentage by Series or Domain`,[null,`series`,`domain`],{disable:e=>!e.showValue(),optional:!0}),Column.prototype.publish(`showValueAsPercentFormat`,`.0%`,`string`,`D3 Format for %`,null,{disable:e=>!e.showValue()||!e.showValueAsPercent()}),Column.prototype.publish(`showDomainTotal`,!1,`boolean`,`Show Total Value for Stacked Columns`,null),Column.prototype.publish(`valueCentered`,!1,`boolean`,`Show Value in center of column`),Column.prototype.publish(`valueAnchor`,`middle`,`set`,`text-anchor for shown value text`,[`start`,`middle`,`end`]),Column.prototype.publish(`xAxisSeriesPaddingInner`,0,`number`,`Determines the ratio of the range that is reserved for blank space between band (0->1)`),Column.prototype.publish(`tooltipInnerTextEllipsedOnly`,!1,`boolean`,`Show tooltip only when inner text is truncated with an ellipsis`);var Bar=class extends Column{constructor(){super(),this.orientation_default(`vertical`)}};Bar.prototype._class+=` chart_Bar`;function count(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function count_default(){return this.eachAfter(count)}__name(count_default,`default`);function each_default(e){var t=this,n,r=[t],i,a,o;do for(n=r.reverse(),r=[];t=n.pop();)if(e(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)r.push(i[a]);while(r.length);return this}__name(each_default,`default`);function eachBefore_default(e){for(var t=this,n=[t],r,i;t=n.pop();)if(e(t),r=t.children,r)for(i=r.length-1;i>=0;--i)n.push(r[i]);return this}__name(eachBefore_default,`default`);function eachAfter_default(e){for(var t=this,n=[t],r=[],i,a,o;t=n.pop();)if(r.push(t),i=t.children,i)for(a=0,o=i.length;a<o;++a)n.push(i[a]);for(;t=r.pop();)e(t);return this}__name(eachAfter_default,`default`);function sum_default(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}__name(sum_default,`default`);function sort_default(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}__name(sort_default,`default`);function path_default$1(e){for(var t=this,n=leastCommonAncestor(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}__name(path_default$1,`default`);function leastCommonAncestor(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function ancestors_default(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}__name(ancestors_default,`default`);function descendants_default(){var e=[];return this.each(function(t){e.push(t)}),e}__name(descendants_default,`default`);function leaves_default(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}__name(leaves_default,`default`);function links_default(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}__name(links_default,`default`);function hierarchy(e,t){var n=new Node$1(e),r=+e.value&&(n.value=e.value),i,a=[n],o,s,c,l;for(t??=defaultChildren;i=a.pop();)if(r&&(i.value=+i.data.value),(s=t(i.data))&&(l=s.length))for(i.children=Array(l),c=l-1;c>=0;--c)a.push(o=i.children[c]=new Node$1(s[c])),o.parent=i,o.depth=i.depth+1;return n.eachBefore(computeHeight)}function node_copy(){return hierarchy(this).eachBefore(copyData)}function defaultChildren(e){return e.children}function copyData(e){e.data=e.data.data}function computeHeight(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function Node$1(e){this.data=e,this.depth=this.height=0,this.parent=null}__name(Node$1,`Node`),Node$1.prototype=hierarchy.prototype={constructor:Node$1,count:count_default,each:each_default,eachAfter:eachAfter_default,eachBefore:eachBefore_default,sum:sum_default,sort:sort_default,path:path_default$1,ancestors:ancestors_default,descendants:descendants_default,leaves:leaves_default,links:links_default,copy:node_copy};var ee=Array.prototype.slice;function shuffle(e){for(var t=e.length,n,r;t;)r=Math.random()*t--|0,n=e[t],e[t]=e[r],e[r]=n;return e}function enclose_default(e){for(var t=0,n=(e=shuffle(ee.call(e))).length,r=[],i,a;t<n;)i=e[t],a&&enclosesWeak(a,i)?++t:(a=encloseBasis(r=extendBasis(r,i)),t=0);return a}__name(enclose_default,`default`);function extendBasis(e,t){var n,r;if(enclosesWeakAll(t,e))return[t];for(n=0;n<e.length;++n)if(enclosesNot(t,e[n])&&enclosesWeakAll(encloseBasis2(e[n],t),e))return[e[n],t];for(n=0;n<e.length-1;++n)for(r=n+1;r<e.length;++r)if(enclosesNot(encloseBasis2(e[n],e[r]),t)&&enclosesNot(encloseBasis2(e[n],t),e[r])&&enclosesNot(encloseBasis2(e[r],t),e[n])&&enclosesWeakAll(encloseBasis3(e[n],e[r],t),e))return[e[n],e[r],t];throw Error()}function enclosesNot(e,t){var n=e.r-t.r,r=t.x-e.x,i=t.y-e.y;return n<0||n*n<r*r+i*i}function enclosesWeak(e,t){var n=e.r-t.r+1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function enclosesWeakAll(e,t){for(var n=0;n<t.length;++n)if(!enclosesWeak(e,t[n]))return!1;return!0}function encloseBasis(e){switch(e.length){case 1:return encloseBasis1(e[0]);case 2:return encloseBasis2(e[0],e[1]);case 3:return encloseBasis3(e[0],e[1],e[2])}}function encloseBasis1(e){return{x:e.x,y:e.y,r:e.r}}function encloseBasis2(e,t){var n=e.x,r=e.y,i=e.r,a=t.x,o=t.y,s=t.r,c=a-n,l=o-r,u=s-i,d=Math.sqrt(c*c+l*l);return{x:(n+a+c/d*u)/2,y:(r+o+l/d*u)/2,r:(d+i+s)/2}}function encloseBasis3(e,t,n){var r=e.x,i=e.y,a=e.r,o=t.x,s=t.y,c=t.r,l=n.x,u=n.y,d=n.r,f=r-o,p=r-l,m=i-s,h=i-u,g=c-a,_=d-a,v=r*r+i*i-a*a,b=v-o*o-s*s+c*c,S=v-l*l-u*u+d*d,C=p*m-f*h,w=(m*S-h*b)/(C*2)-r,T=(h*g-m*_)/C,E=(p*b-f*S)/(C*2)-i,D=(f*_-p*g)/C,O=T*T+D*D-1,k=2*(a+w*T+E*D),A=w*w+E*E-a*a,j=-(O?(k+Math.sqrt(k*k-4*O*A))/(2*O):A/k);return{x:r+w+T*j,y:i+E+D*j,r:j}}function place(e,t,n){var r=e.x-t.x,i,a,o=e.y-t.y,s,c,l=r*r+o*o;l?(a=t.r+n.r,a*=a,c=e.r+n.r,c*=c,a>c?(i=(l+c-a)/(2*l),s=Math.sqrt(Math.max(0,c/l-i*i)),n.x=e.x-i*r-s*o,n.y=e.y-i*o+s*r):(i=(l+a-c)/(2*l),s=Math.sqrt(Math.max(0,a/l-i*i)),n.x=t.x+i*r-s*o,n.y=t.y+i*o+s*r)):(n.x=t.x+n.r,n.y=t.y)}function intersects(e,t){var n=e.r+t.r-1e-6,r=t.x-e.x,i=t.y-e.y;return n>0&&n*n>r*r+i*i}function score(e){var t=e._,n=e.next._,r=t.r+n.r,i=(t.x*n.r+n.x*t.r)/r,a=(t.y*n.r+n.y*t.r)/r;return i*i+a*a}function Node(e){this._=e,this.next=null,this.previous=null}function packEnclose(e){if(!(i=e.length))return 0;var t=e[0],n,r,i,a,o,s,c,l,u,d;if(t.x=0,t.y=0,!(i>1))return t.r;if(n=e[1],t.x=-n.r,n.x=t.r,n.y=0,!(i>2))return t.r+n.r;place(n,t,r=e[2]),t=new Node(t),n=new Node(n),r=new Node(r),t.next=r.previous=n,n.next=t.previous=r,r.next=n.previous=t;pack:for(s=3;s<i;++s){place(t._,n._,r=e[s]),r=new Node(r),c=n.next,l=t.previous,u=n._.r,d=t._.r;do if(u<=d){if(intersects(c._,r._)){n=c,t.next=n,n.previous=t,--s;continue pack}u+=c._.r,c=c.next}else{if(intersects(l._,r._)){t=l,t.next=n,n.previous=t,--s;continue pack}d+=l._.r,l=l.previous}while(c!==l.next);for(r.previous=t,r.next=n,t.next=n.previous=n=r,a=score(t);(r=r.next)!==n;)(o=score(r))<a&&(t=r,a=o);n=t.next}for(t=[n._],r=n;(r=r.next)!==n;)t.push(r._);for(r=enclose_default(t),s=0;s<i;++s)t=e[s],t.x-=r.x,t.y-=r.y;return r.r}function optional(e){return e==null?null:required(e)}function required(e){if(typeof e!=`function`)throw Error();return e}function constantZero(){return 0}function constant_default$2(e){return function(){return e}}__name(constant_default$2,`default`);function defaultRadius(e){return Math.sqrt(e.value)}function pack_default(){var e=null,t=1,n=1,r=constantZero;function pack(i){return i.x=t/2,i.y=n/2,e?i.eachBefore(radiusLeaf(e)).eachAfter(packChildren(r,.5)).eachBefore(translateChild(1)):i.eachBefore(radiusLeaf(defaultRadius)).eachAfter(packChildren(constantZero,1)).eachAfter(packChildren(r,i.r/Math.min(t,n))).eachBefore(translateChild(Math.min(t,n)/(2*i.r))),i}return pack.radius=function(t){return arguments.length?(e=optional(t),pack):e},pack.size=function(e){return arguments.length?(t=+e[0],n=+e[1],pack):[t,n]},pack.padding=function(e){return arguments.length?(r=typeof e==`function`?e:constant_default$2(+e),pack):r},pack}__name(pack_default,`default`);function radiusLeaf(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function packChildren(e,t){return function(n){if(r=n.children){var r,i,a=r.length,o=e(n)*t||0,s;if(o)for(i=0;i<a;++i)r[i].r+=o;if(s=packEnclose(r),o)for(i=0;i<a;++i)r[i].r-=o;n.r=s+o}}}function translateChild(e){return function(t){var n=t.parent;t.r*=e,n&&(t.x=n.x+e*t.x,t.y=n.y+e*t.y)}}var Bubble=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];labelWidgets;d3Pack;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._drawStartPos=`origin`,this.labelWidgets={},this.d3Pack=pack_default().size([this.width(),this.height()]).padding(1.5)}size(e){let t=super.size.apply(this,arguments);return arguments.length&&this.d3Pack.size([this.width(),this.height()]),t}enter(e,t){super.enter(e,t),this._selection.widgetElement(t);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e[0]),value:e[1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){super.update(e,t);let n=this;this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id()));let r=hierarchy({children:this.cloneData()}).sum(function(e){return e[1]}).sort(function(e,t){return t[1]<e[1]?-1:+(t[1]>e[1])});this.d3Pack(r);let i=t.selectAll(`.node`).data(r.children||[],e=>e.data[0]);i.enter().append(`g`).attr(`class`,(e,t)=>`node series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.append(`circle`).attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).attr(`r`,0).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show),e.__viz_faChar?n.labelWidgets[e.data[0]]=new o.FAChar().char(e.__viz_faChar).target(this).render():n.labelWidgets[e.data[0]]=new o.Text().text(e.data[0]).target(this).render()}).merge(i).transition().attr(`opacity`,1).each(function(e){let t=(0,o.select)(this),r={x:e.x,y:e.y};t.select(`circle`).transition().attr(`transform`,`translate(`+r.x+`,`+r.y+`)`).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1])).attr(`r`,e.r).select(`title`).text(e.data[0]+` (`+e.data[1]+`)`),e.__viz_faChar?n.labelWidgets[e.data[0]].pos(r).render():n.labelWidgets[e.data[0]].pos(r).colorFill_default(n.textColor(e.data,n.columns()[1],e.data[1])).width(e.r*2).text(e.data[0]).render()}),i.exit().transition().style(`opacity`,0).remove()}exit(e,t){super.exit(e,t)}};Bubble.prototype._class+=` chart_Bubble`,Bubble.prototype.implements(I2DChart.prototype),Bubble.prototype.implements(ITooltip.prototype),Bubble.prototype.mixin(o.Utility.SimpleSelectionMixin),Bubble.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Bubble.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Bubble.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]});var BubbleXY=class extends Scatter{constructor(){super()}enter(e,t){this.pointSizeColumn_exists()||this.pointSizeColumn(this.columns()[this.columns().length-1]),super.enter(e,t)}};BubbleXY.prototype._class+=` chart_BubbleXY`;var W=0,G=0,te=0,ne=1e3,re,K,ie=0,ae=0,oe=0,se=typeof performance==`object`&&performance.now?performance:Date,ce=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function now(){return ae||=(ce(clearNow),se.now()+oe)}function clearNow(){ae=0}function Timer(){this._call=this._time=this._next=null}Timer.prototype=timer.prototype={constructor:Timer,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?now():+n)+(t==null?0:+t),!this._next&&K!==this&&(K?K._next=this:re=this,K=this),this._call=e,this._time=n,sleep()},stop:function(){this._call&&(this._call=null,this._time=1/0,sleep())}};function timer(e,t,n){var r=new Timer;return r.restart(e,t,n),r}function timerFlush(){now(),++W;for(var e=re,t;e;)(t=ae-e._time)>=0&&e._call.call(null,t),e=e._next;--W}function wake(){ae=(ie=se.now())+oe,W=G=0;try{timerFlush()}finally{W=0,nap(),ae=0}}function poke(){var e=se.now(),t=e-ie;t>ne&&(oe-=t,ie=e)}function nap(){for(var e,t=re,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:re=n);K=e,sleep(r)}function sleep(e){W||(G&&=clearTimeout(G),e-ae>24?(e<1/0&&(G=setTimeout(wake,e-se.now()-oe)),te&&=clearInterval(te)):(te||=(ie=se.now(),setInterval(poke,ne)),W=1,ce(wake)))}function bullet_default(){var e=`left`,t=!1,n=!1,r=bulvarRanges,i=bulvarMarkers,a=bulvarMeasures,s=380,c=30,l=axisLeft();function bulvar(e){e.each(function(e,u){var d=r.call(this,e,u).slice().sort(o.descending),f=i.call(this,e,u).slice().sort(o.descending),p=a.call(this,e,u).slice().sort(o.descending),m=(0,o.select)(this),h,g,_=m.select(`g.wrap`);_.empty()&&(_=m.append(`g`).attr(`class`,`wrap`)),n?(h=c,g=s,_.attr(`transform`,`rotate(90)translate(0,`+-s+`)`)):(h=s,g=c,_.attr(`transform`,null));var v=(0,o.scaleLinear)().domain([0,Math.max(d[0],f[0],p[0])]).range(t?[h,0]:[0,h]),b=this.__chart__||(0,o.scaleLinear)().domain([0,1/0]).range(v.range());this.__chart__=v;var S=bulvarWidth(b),C=bulvarWidth(v),w=_.selectAll(`rect.range`).data(d);w.enter().append(`rect`).attr(`class`,function(e,t){return`range s`+t}).attr(`width`,S).attr(`height`,g).attr(`x`,t?b:0).merge(w).transition(w).attr(`x`,t?v:0).attr(`width`,C).attr(`height`,g);var T=_.selectAll(`rect.measure`).data(p);T.enter().append(`rect`).attr(`class`,function(e,t){return`measure s`+t}).attr(`width`,S).attr(`height`,g/3).attr(`x`,t?b:0).attr(`y`,g/3).merge(T).transition(T).attr(`width`,C).attr(`height`,g/3).attr(`x`,t?v:0).attr(`y`,g/3);var E=_.selectAll(`line.marker`).data(f);E.enter().append(`line`).attr(`class`,`marker`).attr(`x1`,b).attr(`x2`,b).attr(`y1`,g/6).attr(`y2`,g*5/6).merge(E).transition(E).attr(`x1`,v).attr(`x2`,v).attr(`y1`,g/6).attr(`y2`,g*5/6);var D=m.selectAll(`g.axis`).data([0]);D.enter().append(`g`).attr(`class`,`axis`),D.attr(`transform`,n?null:`translate(0,`+g+`)`).call(l.scale(v))}),timerFlush()}return bulvar.orient=function(r){return arguments.length?(e=r+``,t=e===`right`||e===`bottom`,l.orient((n=e===`top`||e===`bottom`)?`left`:`bottom`),bulvar):e},bulvar.ranges=function(e){return arguments.length?(r=e,bulvar):r},bulvar.markers=function(e){return arguments.length?(i=e,bulvar):i},bulvar.measures=function(e){return arguments.length?(a=e,bulvar):a},bulvar.width=function(e){return arguments.length?(s=+e,bulvar):s},bulvar.height=function(e){return arguments.length?(c=+e,bulvar):c},bulvar.tickFormat=function(e){return arguments.length?(l.tickFormat(e),bulvar):l.tickFormat()},bulvar}__name(bullet_default,`default`);function bulvarRanges(e){return e.ranges}function bulvarMarkers(e){return e.markers}function bulvarMeasures(e){return e.measures}function bulvarWidth(e){var t=e(0);return function(n){return Math.abs(e(n)-t)}}var Bullet=class extends o.HTMLWidget{_hiddenColumns={};constructor(){super(),o.Utility.SimpleSelectionMixin.call(this,!0)}bulletData(){let e=this;this._hiddenColumns={};let t=this.columns();return this.data().map(function(e){return{title:valueOf(e,this.titleColumn()),subtitle:valueOf(e,this.subtitleColumn()),ranges:valueOf(e,this.rangesColumn(),`range`),measures:valueOf(e,this.measuresColumn(),`measure`),markers:valueOf(e,this.markersColumn(),`marker`),origRow:e}},this);function valueOf(n,r,i){let a=t.indexOf(r);return a>=0?n[a]instanceof Array?n[a]:[n[a]]:(i&&(e._hiddenColumns[i]=!0),[0])}}enter(e,t){super.enter(e,t),(0,o.select)(e.parentNode).style(`overflow`,`auto`),this._selection.widgetElement(t)}update(e,t){super.update(e,t);let n=this;t.selectAll(`.axis`).style(`display`,`none`),t.selectAll(`.range,.measure,.marker`).style(`display`,null);let r={left:2,top:8,right:2,bottom:8},i=this.width()-r.left-r.right,a=40-r.top-r.bottom,s=t.selectAll(`svg`).data(this.bulletData()),c=s.enter().append(`svg`).attr(`class`,`bullet`).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.origRow),n.titleColumn(),n._selection.selected(this))}).each(function(){let e=(0,o.select)(this).append(`g`).attr(`class`,(e,t)=>`bulletBar series series-`+n.cssTag(n.titleColumn())).append(`g`).attr(`class`,`bulletTitle`);e.append(`text`).attr(`class`,`title`),e.append(`text`).attr(`class`,`subtitle`).attr(`dy`,`1em`)}).merge(s),l=c.select(`.bulletTitle`).style(`text-anchor`,`end`).attr(`transform`,`translate(-6,`+a/2+`)`);l.select(`.title`).text(function(e){return e.title}),l.select(`.subtitle`).text(function(e){return e.subtitle});let u=0;l.each(function(){let e=this.getBBox();e.width>u&&(u=e.width)});let d=bullet_default().width(i-u-6).height(a);c.attr(`width`,i).attr(`height`,a+r.top+r.bottom).style(`margin-left`,`${r.left}px`),c.select(`.bulletBar`).attr(`transform`,`translate(`+(u+6)+`,`+r.top+`)`).call(d),s.exit().remove(),Object.keys(this._hiddenColumns).length>0&&t.selectAll(`.${Object.keys(this._hiddenColumns).join(`,.`)}`).style(`display`,`none`)}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}_selection};Bullet.prototype._class+=` chart_Bullet`,Bullet.prototype.publish(`titleColumn`,null,`set`,`Title Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`subtitleColumn`,null,`set`,`Subtitle Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`rangesColumn`,null,`set`,`Ranges Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`measuresColumn`,null,`set`,`Measures Column`,function(){return this.columns()},{optional:!0}),Bullet.prototype.publish(`markersColumn`,null,`set`,`Markers Column`,function(){return this.columns()},{optional:!0});var le=Array.prototype.slice;function ascending_default(e,t){return e-t}__name(ascending_default,`default`);function area_default(e){for(var t=0,n=e.length,r=e[n-1][1]*e[0][0]-e[n-1][0]*e[0][1];++t<n;)r+=e[t-1][1]*e[t][0]-e[t-1][0]*e[t][1];return r}__name(area_default,`default`);function constant_default$1(e){return function(){return e}}__name(constant_default$1,`default`);function contains_default(e,t){for(var n=-1,r=t.length,i;++n<r;)if(i=ringContains(e,t[n]))return i;return 0}__name(contains_default,`default`);function ringContains(e,t){for(var n=t[0],r=t[1],i=-1,a=0,o=e.length,s=o-1;a<o;s=a++){var c=e[a],l=c[0],u=c[1],d=e[s],f=d[0],p=d[1];if(segmentContains(c,d,t))return 0;u>r!=p>r&&n<(f-l)*(r-u)/(p-u)+l&&(i=-i)}return i}function segmentContains(e,t,n){var r;return collinear(e,t,n)&&within(e[r=+(e[0]===t[0])],n[r],t[r])}function collinear(e,t,n){return(t[0]-e[0])*(n[1]-e[1])===(n[0]-e[0])*(t[1]-e[1])}function within(e,t,n){return e<=t&&t<=n||n<=t&&t<=e}function noop_default$1(){}__name(noop_default$1,`default`);var ue=[[],[[[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 contours_default(){var e=1,t=1,n=o.thresholdSturges,r=smoothLinear;function contours(e){var t=n(e);if(Array.isArray(t))t=t.slice().sort(ascending_default);else{var r=(0,o.extent)(e),i=r[0],a=r[1];t=(0,o.tickStep)(i,a,t),t=(0,o.range)(Math.floor(i/t)*t,Math.floor(a/t)*t,t)}return t.map(function(t){return contour(e,t)})}function contour(e,t){var n=[],i=[];return isorings(e,t,function(a){r(a,e,t),area_default(a)>0?n.push([a]):i.push(a)}),i.forEach(function(e){for(var t=0,r=n.length,i;t<r;++t)if(contains_default((i=n[t])[0],e)!==-1){i.push(e);return}}),{type:`MultiPolygon`,value:t,coordinates:n}}function isorings(n,r,i){var a=[],o=[],s=c=-1,c,l,u=n[0]>=r,d,f;for(ue[u<<1].forEach(stitch);++s<e-1;)l=u,u=n[s+1]>=r,ue[l|u<<1].forEach(stitch);for(ue[u<<0].forEach(stitch);++c<t-1;){for(s=-1,u=n[c*e+e]>=r,d=n[c*e]>=r,ue[u<<1|d<<2].forEach(stitch);++s<e-1;)l=u,u=n[c*e+e+s+1]>=r,f=d,d=n[c*e+s+1]>=r,ue[l|u<<1|d<<2|f<<3].forEach(stitch);ue[u|d<<3].forEach(stitch)}for(s=-1,d=n[c*e]>=r,ue[d<<2].forEach(stitch);++s<e-1;)f=d,d=n[c*e+s+1]>=r,ue[d<<2|f<<3].forEach(stitch);ue[d<<3].forEach(stitch);function stitch(e){var t=[e[0][0]+s,e[0][1]+c],n=[e[1][0]+s,e[1][1]+c],r=index(t),l=index(n),u,d;(u=o[r])?(d=a[l])?(delete o[u.end],delete a[d.start],u===d?(u.ring.push(n),i(u.ring)):a[u.start]=o[d.end]={start:u.start,end:d.end,ring:u.ring.concat(d.ring)}):(delete o[u.end],u.ring.push(n),o[u.end=l]=u):(u=a[l])?(d=o[r])?(delete a[u.start],delete o[d.end],u===d?(u.ring.push(n),i(u.ring)):a[d.start]=o[u.end]={start:d.start,end:u.end,ring:d.ring.concat(u.ring)}):(delete a[u.start],u.ring.unshift(t),a[u.start=r]=u):a[r]=o[l]={start:r,end:l,ring:[t,n]}}}function index(t){return t[0]*2+t[1]*(e+1)*4}function smoothLinear(n,r,i){n.forEach(function(n){var a=n[0],o=n[1],s=a|0,c=o|0,l,u=r[c*e+s];a>0&&a<e&&s===a&&(l=r[c*e+s-1],n[0]=a+(i-l)/(u-l)-.5),o>0&&o<t&&c===o&&(l=r[(c-1)*e+s],n[1]=o+(i-l)/(u-l)-.5)})}return contours.contour=contour,contours.size=function(n){if(!arguments.length)return[e,t];var r=Math.ceil(n[0]),i=Math.ceil(n[1]);if(!(r>0)||!(i>0))throw Error(`invalid size`);return e=r,t=i,contours},contours.thresholds=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),contours):n},contours.smooth=function(e){return arguments.length?(r=e?smoothLinear:noop_default$1,contours):r===smoothLinear},contours}__name(contours_default,`default`);function blurX(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<i;++o)for(var s=0,c=0;s<r+n;++s)s<r&&(c+=e.data[s+o*r]),s>=n&&(s>=a&&(c-=e.data[s-a+o*r]),t.data[s-n+o*r]=c/Math.min(s+1,r-1+a-s,a))}function blurY(e,t,n){for(var r=e.width,i=e.height,a=(n<<1)+1,o=0;o<r;++o)for(var s=0,c=0;s<i+n;++s)s<i&&(c+=e.data[o+s*r]),s>=n&&(s>=a&&(c-=e.data[o+(s-a)*r]),t.data[o+(s-n)*r]=c/Math.min(s+1,i-1+a-s,a))}function defaultX(e){return e[0]}function defaultY(e){return e[1]}function defaultWeight(){return 1}function density_default(){var e=defaultX,t=defaultY,n=defaultWeight,r=960,i=500,a=20,s=2,c=a*3,l=r+c*2>>s,u=i+c*2>>s,d=constant_default$1(20);function density(r){var i=new Float32Array(l*u),f=new Float32Array(l*u);r.forEach(function(r,a,o){var d=+e(r,a,o)+c>>s,f=+t(r,a,o)+c>>s,p=+n(r,a,o);d>=0&&d<l&&f>=0&&f<u&&(i[d+f*l]+=p)}),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s),blurX({width:l,height:u,data:i},{width:l,height:u,data:f},a>>s),blurY({width:l,height:u,data:f},{width:l,height:u,data:i},a>>s);var p=d(i);if(!Array.isArray(p)){var m=(0,o.max)(i);p=(0,o.tickStep)(0,m,p),p=(0,o.range)(0,Math.floor(m/p)*p,p),p.shift()}return contours_default().thresholds(p).size([l,u])(i).map(transform)}function transform(e){return e.value*=2**(-2*s),e.coordinates.forEach(transformPolygon),e}function transformPolygon(e){e.forEach(transformRing)}function transformRing(e){e.forEach(transformPoint)}function transformPoint(e){e[0]=e[0]*2**s-c,e[1]=e[1]*2**s-c}function resize(){return c=a*3,l=r+c*2>>s,u=i+c*2>>s,density}return density.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default$1(+t),density):e},density.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default$1(+e),density):t},density.weight=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default$1(+e),density):n},density.size=function(e){if(!arguments.length)return[r,i];var t=Math.ceil(e[0]),n=Math.ceil(e[1]);if(!(t>=0)&&!(t>=0))throw Error(`invalid size`);return r=t,i=n,resize()},density.cellSize=function(e){if(!arguments.length)return 1<<s;if(!((e=+e)>=1))throw Error(`invalid cell size`);return s=Math.floor(Math.log(e)/Math.LN2),resize()},density.thresholds=function(e){return arguments.length?(d=typeof e==`function`?e:constant_default$1(Array.isArray(e)?le.call(e):e),density):d},density.bandwidth=function(e){if(!arguments.length)return Math.sqrt(a*(a+1));if(!((e=+e)>=0))throw Error(`invalid bandwidth`);return a=Math.round((Math.sqrt(4*e*e+1)-1)/2),resize()},density}__name(density_default,`default`);function adder_default(){return new Adder}__name(adder_default,`default`);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(de,e,this.t),add(this,de.s,this.s),this.s?this.t+=de.t:this.s=de.t},valueOf:function(){return this.s}};var de=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var fe=Math.PI;fe/2,fe/4;var pe=fe*2;180/fe,fe/180;var me=Math.abs,he=Math.sqrt;function noop(){}function streamGeometry(e,t){e&&_e.hasOwnProperty(e.type)&&_e[e.type](e,t)}var ge={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)streamGeometry(n[r].geometry,t)}},_e={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){streamLine(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamLine(n[r],t,0)},Polygon:function(e,t){streamPolygon(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)streamPolygon(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)streamGeometry(n[r],t)}};function streamLine(e,t,n){var r=-1,i=e.length-n,a;for(t.lineStart();++r<i;)a=e[r],t.point(a[0],a[1],a[2]);t.lineEnd()}function streamPolygon(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)streamLine(e[n],t,1);t.polygonEnd()}function stream_default(e,t){e&&ge.hasOwnProperty(e.type)?ge[e.type](e,t):streamGeometry(e,t)}__name(stream_default,`default`);function identity_default(e){return e}__name(identity_default,`default`);var ve=adder_default(),ye=adder_default(),be,xe,Se,Ce,we={point:noop,lineStart:noop,lineEnd:noop,polygonStart:function(){we.lineStart=areaRingStart,we.lineEnd=areaRingEnd},polygonEnd:function(){we.lineStart=we.lineEnd=we.point=noop,ve.add(me(ye)),ye.reset()},result:function(){var e=ve/2;return ve.reset(),e}};function areaRingStart(){we.point=areaPointFirst}function areaPointFirst(e,t){we.point=areaPoint,be=Se=e,xe=Ce=t}function areaPoint(e,t){ye.add(Ce*e-Se*t),Se=e,Ce=t}function areaRingEnd(){areaPoint(be,xe)}var Te=1/0,Ee=Te,De=-Te,Oe=De,ke={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result:function(){var e=[[Te,Ee],[De,Oe]];return De=Oe=-(Ee=Te=1/0),e}};function boundsPoint(e,t){e<Te&&(Te=e),e>De&&(De=e),t<Ee&&(Ee=t),t>Oe&&(Oe=t)}var Ae=0,je=0,Me=0,Ne=0,Pe=0,Fe=0,Ie=0,Le=0,Re=0,ze,Be,q,J,Y={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){Y.lineStart=centroidRingStart,Y.lineEnd=centroidRingEnd},polygonEnd:function(){Y.point=centroidPoint,Y.lineStart=centroidLineStart,Y.lineEnd=centroidLineEnd},result:function(){var e=Re?[Ie/Re,Le/Re]:Fe?[Ne/Fe,Pe/Fe]:Me?[Ae/Me,je/Me]:[NaN,NaN];return Ae=je=Me=Ne=Pe=Fe=Ie=Le=Re=0,e}};function centroidPoint(e,t){Ae+=e,je+=t,++Me}function centroidLineStart(){Y.point=centroidPointFirstLine}function centroidPointFirstLine(e,t){Y.point=centroidPointLine,centroidPoint(q=e,J=t)}function centroidPointLine(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,centroidPoint(q=e,J=t)}function centroidLineEnd(){Y.point=centroidPoint}function centroidRingStart(){Y.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(ze,Be)}function centroidPointFirstRing(e,t){Y.point=centroidPointRing,centroidPoint(ze=q=e,Be=J=t)}function centroidPointRing(e,t){var n=e-q,r=t-J,i=he(n*n+r*r);Ne+=i*(q+e)/2,Pe+=i*(J+t)/2,Fe+=i,i=J*e-q*t,Ie+=i*(q+e),Le+=i*(J+t),Re+=i*3,centroidPoint(q=e,J=t)}function PathContext(e){this._context=e}PathContext.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,pe);break}},result:noop};var Ve=adder_default(),He,Ue,We,Ge,Ke,qe={point:noop,lineStart:function(){qe.point=lengthPointFirst},lineEnd:function(){He&&lengthPoint(Ue,We),qe.point=noop},polygonStart:function(){He=!0},polygonEnd:function(){He=null},result:function(){var e=+Ve;return Ve.reset(),e}};function lengthPointFirst(e,t){qe.point=lengthPoint,Ue=Ge=e,We=Ke=t}function lengthPoint(e,t){Ge-=e,Ke-=t,Ve.add(he(Ge*Ge+Ke*Ke)),Ge=e,Ke=t}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push(`Z`),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push(`M`,e,`,`,t),this._point=1;break;case 1:this._string.push(`L`,e,`,`,t);break;default:this._circle??=circle(this._radius),this._string.push(`M`,e,`,`,t,this._circle);break}},result:function(){if(this._string.length){var e=this._string.join(``);return this._string=[],e}else return null}};function circle(e){return`m0,`+e+`a`+e+`,`+e+` 0 1,1 0,`+-2*e+`a`+e+`,`+e+` 0 1,1 0,`+2*e+`z`}function path_default(e,t){var n=4.5,r,i;function path(e){return e&&(typeof n==`function`&&i.pointRadius(+n.apply(this,arguments)),stream_default(e,r(i))),i.result()}return path.area=function(e){return stream_default(e,r(we)),we.result()},path.measure=function(e){return stream_default(e,r(qe)),qe.result()},path.bounds=function(e){return stream_default(e,r(ke)),ke.result()},path.centroid=function(e){return stream_default(e,r(Y)),Y.result()},path.projection=function(t){return arguments.length?(r=t==null?(e=null,identity_default):(e=t).stream,path):e},path.context=function(e){return arguments.length?(i=e==null?(t=null,new PathString):new PathContext(t=e),typeof n!=`function`&&i.pointRadius(n),path):t},path.pointRadius=function(e){return arguments.length?(n=typeof e==`function`?e:(i.pointRadius(+e),+e),path):n},path.projection(e).context(t)}__name(path_default,`default`);var Contour=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_dataMinWeight;_dataMaxWeight;constructor(){super(),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerEnter(e,t,n=250){super.layerEnter(e,t,n)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n),this._palette=this._palette.switch(this.paletteID());let r=this.flattenData(this.layerColumns(e),this.layerData(e)),i=density_default().x(t=>this.xPos(e,t)).y(t=>this.yPos(e,t)).size([this.width(),this.height()]).bandwidth(this.contourBandwidth())(r),a=i.map(e=>e.value),o=Math.min.apply(this,a),s=Math.max.apply(this,a);this._dataMinWeight=o,this._dataMaxWeight=s;let c=t.selectAll(`path`).data(i);c.enter().append(`path`).merge(c).attr(`d`,path_default()).attr(`fill`,e=>this.showContourFill()?this._palette(e.value,o,s):`none`).attr(`stroke`,this.contourStrokeColor()).attr(`stroke-linejoin`,`round`).attr(`stroke-width`,this.contourStrokeWidth()),c.exit().remove()}exit(e,t){super.exit(e,t)}};Contour.prototype._class+=` chart_Contour`,Contour.prototype.implements(I1DChart.prototype),Contour.prototype.publish(`paletteID`,`YlGnBu`,`string`,`Color palette for this widget`),Contour.prototype.publish(`useClonedPalette`,!0,`boolean`,`Enable or disable using a cloned palette`),Contour.prototype.publish(`showContourFill`,!0,`boolean`,`Show/hide the contour background colors`),Contour.prototype.publish(`showContour`,!0,`boolean`,`Show/hide the contour border lines`),Contour.prototype.publish(`contourBandwidth`,40,`number`,`Controls the sensitivity of the contour grouping algorithm`),Contour.prototype.publish(`contourStrokeColor`,`#2C3A47`,`html-color`,`Color of the contour border lines`),Contour.prototype.publish(`contourStrokeWidth`,1,`number`,`Width of the contour border lines`);var Gantt=class extends Bar{constructor(){super(),this.orientation_default(`vertical`).xAxisType_default(`ordinal`).yAxisType_default(`time`)}};Gantt.prototype._class+=` chart_Gantt`;function constant_default(e){return function constant(){return e}}__name(constant_default,`default`);var Je=Math.PI,Ye=Je/2,Xe=2*Je;function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function asin(e){return e>=1?Ye:e<=-1?-Ye:Math.asin(e)}function intersect(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=(u*(t-a)-d*(e-i))/(d*c-u*l);return[e+f*c,t+f*l]}function cornerTangents(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/Math.sqrt(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,b=h-p,S=v*v+b*b,C=i-a,w=f*h-m*p,T=(b<0?-1:1)*Math.sqrt(Math.max(0,C*C*S-w*w)),E=(w*b-v*T)/S,D=(-w*v-b*T)/S,O=(w*b+v*T)/S,k=(-w*v+b*T)/S,A=E-g,j=D-_,M=O-g,N=k-_;return A*A+j*j>M*M+N*N&&(E=O,D=k),{cx:E,cy:D,x01:-u,y01:-d,x11:E*(i/C-1),y11:D*(i/C-1)}}function arc_default(){var e=arcInnerRadius,t=arcOuterRadius,n=constant_default(0),r=null,i=arcStartAngle,a=arcEndAngle,o=arcPadAngle,s=null;function arc(){var c,l,u=+e.apply(this,arguments),d=+t.apply(this,arguments),f=i.apply(this,arguments)-Ye,p=a.apply(this,arguments)-Ye,m=Math.abs(p-f),h=p>f;if(s||=c=path(),d<u&&(l=d,d=u,u=l),!(d>1e-12))s.moveTo(0,0);else if(m>Xe-1e-12)s.moveTo(d*Math.cos(f),d*Math.sin(f)),s.arc(0,0,d,f,p,!h),u>1e-12&&(s.moveTo(u*Math.cos(p),u*Math.sin(p)),s.arc(0,0,u,p,f,h));else{var g=f,_=p,v=f,b=p,S=m,C=m,w=o.apply(this,arguments)/2,T=w>1e-12&&(r?+r.apply(this,arguments):Math.sqrt(u*u+d*d)),E=Math.min(Math.abs(d-u)/2,+n.apply(this,arguments)),D=E,O=E,k,A;if(T>1e-12){var j=asin(T/u*Math.sin(w)),M=asin(T/d*Math.sin(w));(S-=j*2)>1e-12?(j*=h?1:-1,v+=j,b-=j):(S=0,v=b=(f+p)/2),(C-=M*2)>1e-12?(M*=h?1:-1,g+=M,_-=M):(C=0,g=_=(f+p)/2)}var N=d*Math.cos(g),P=d*Math.sin(g),F=u*Math.cos(b),I=u*Math.sin(b);if(E>1e-12){var L=d*Math.cos(_),R=d*Math.sin(_),z=u*Math.cos(v),B=u*Math.sin(v);if(m<Je){var V=S>1e-12?intersect(N,P,z,B,L,R,F,I):[F,I],H=N-V[0],U=P-V[1],ee=L-V[0],W=R-V[1],G=1/Math.sin(Math.acos((H*ee+U*W)/(Math.sqrt(H*H+U*U)*Math.sqrt(ee*ee+W*W)))/2),te=Math.sqrt(V[0]*V[0]+V[1]*V[1]);D=Math.min(E,(u-te)/(G-1)),O=Math.min(E,(d-te)/(G+1))}}C>1e-12?O>1e-12?(k=cornerTangents(z,B,N,P,d,O,h),A=cornerTangents(L,R,F,I,d,O,h),s.moveTo(k.cx+k.x01,k.cy+k.y01),O<E?s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,O,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,d,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),!h),s.arc(A.cx,A.cy,O,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):(s.moveTo(N,P),s.arc(0,0,d,g,_,!h)):s.moveTo(N,P),!(u>1e-12)||!(S>1e-12)?s.lineTo(F,I):D>1e-12?(k=cornerTangents(F,I,L,R,u,-D,h),A=cornerTangents(N,P,z,B,u,-D,h),s.lineTo(k.cx+k.x01,k.cy+k.y01),D<E?s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(A.y01,A.x01),!h):(s.arc(k.cx,k.cy,D,Math.atan2(k.y01,k.x01),Math.atan2(k.y11,k.x11),!h),s.arc(0,0,u,Math.atan2(k.cy+k.y11,k.cx+k.x11),Math.atan2(A.cy+A.y11,A.cx+A.x11),h),s.arc(A.cx,A.cy,D,Math.atan2(A.y11,A.x11),Math.atan2(A.y01,A.x01),!h))):s.arc(0,0,u,b,v,h)}if(s.closePath(),c)return s=null,c+``||null}return arc.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Je/2;return[Math.cos(r)*n,Math.sin(r)*n]},arc.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),arc):e},arc.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),arc):t},arc.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(+e),arc):n},arc.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:constant_default(+e),arc):r},arc.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:constant_default(+e),arc):i},arc.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:constant_default(+e),arc):a},arc.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:constant_default(+e),arc):o},arc.context=function(e){return arguments.length?(s=e??null,arc):s},arc}__name(arc_default,`default`);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function linear_default(e){return new Linear(e)}__name(linear_default,`default`);function x(e){return e[0]}function y(e){return e[1]}function line_default(){var e=x,t=y,n=constant_default(!0),r=null,i=linear_default,a=null;function line(o){var s,c=o.length,l,u=!1,d;for(r??(a=i(d=path())),s=0;s<=c;++s)!(s<c&&n(l=o[s],s,o))===u&&((u=!u)?a.lineStart():a.lineEnd()),u&&a.point(+e(l,s,o),+t(l,s,o));if(d)return a=null,d+``||null}return line.x=function(t){return arguments.length?(e=typeof t==`function`?t:constant_default(+t),line):e},line.y=function(e){return arguments.length?(t=typeof e==`function`?e:constant_default(+e),line):t},line.defined=function(e){return arguments.length?(n=typeof e==`function`?e:constant_default(!!e),line):n},line.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),line):i},line.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),line):r},line}__name(line_default,`default`),curveRadial(linear_default);function Radial(e){this._curve=e}Radial.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function curveRadial(e){function radial(t){return new Radial(e(t))}return radial._curve=e,radial}Math.sqrt(1/3)*2;var Ze=Math.sin(Je/10)/Math.sin(7*Je/10);Math.sin(Xe/10)*Ze,-Math.cos(Xe/10)*Ze,Math.sqrt(3)/2,(1/Math.sqrt(12)/2+1)*3;function noop_default(){}__name(noop_default,`default`);function point$3(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}__name(point$3,`point`);function Basis(e){this._context=e}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$3(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);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:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisClosed(e){this._context=e}BasisClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function BasisOpen(e){this._context=e}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:point$3(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Bundle(e,t){this._basis=new Basis(e),this._beta=t}Bundle.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,n=e.length-1;if(n>0)for(var r=e[0],i=t[0],a=e[n]-r,o=t[n]-i,s=-1,c;++s<=n;)c=s/n,this._basis.point(this._beta*e[s]+(1-this._beta)*(r+c*a),this._beta*t[s]+(1-this._beta)*(i+c*o));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}},(function custom(e){function bundle(t){return e===1?new Basis(t):new Bundle(t,e)}return bundle.beta=function(e){return custom(+e)},bundle})(.85);function point$2(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}__name(point$2,`point`);function Cardinal(e,t){this._context=e,this._k=(1-t)/6}Cardinal.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:point$2(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new Cardinal(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalClosed(e,t){this._context=e,this._k=(1-t)/6}CardinalClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalClosed(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function CardinalOpen(e,t){this._context=e,this._k=(1-t)/6}CardinalOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,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:point$2(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function cardinal(t){return new CardinalOpen(t,e)}return cardinal.tension=function(e){return custom(+e)},cardinal})(0);function point$1(e,t,n){var r=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>1e-12){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,c=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/c,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/c}if(e._l23_a>1e-12){var l=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*l+e._x1*e._l23_2a-t*e._l12_2a)/u,o=(o*l+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,a,o,e._x2,e._y2)}__name(point$1,`point`);function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:point$1(this,e,t);break}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Qe=(function custom(e){function catmullRom(t){return e?new CatmullRom(t,e):new Cardinal(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+this._alpha)}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:point$1(this,e,t);break}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomClosed(t,e):new CardinalClosed(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=(n*n+r*r)**+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:point$1(this,e,t);break}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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},(function custom(e){function catmullRom(t){return e?new CatmullRomOpen(t,e):new CardinalOpen(t,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom})(.5);function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:noop_default,areaEnd:noop_default,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function sign(e){return e<0?-1:1}function slope3(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(sign(a)+sign(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function point(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function MonotoneX(e){this._context=e}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,point(this,slope2(this,n=slope3(this,e,t)),n);break;default:point(this,this._t0,n=slope3(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MonotoneY(e){this._context=new ReflectContext(e)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(e,t){MonotoneX.prototype.point.call(this,t,e)};function ReflectContext(e){this._context=e}ReflectContext.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Natural(e){this._context=e}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=controlPoints(e),i=controlPoints(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function controlPoints(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Step$1(e,t){this._context=e,this._t=t}__name(Step$1,`Step`),Step$1.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}this._x=e,this._y=t}},Array.prototype.slice;var $e=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},classCallCheck=function(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)},et=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tt=function get(e,t,n){e===null&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);if(r===void 0){var i=Object.getPrototypeOf(e);return i===null?void 0:get(i,t,n)}else if(`value`in r)return r.value;else{var a=r.get;return a===void 0?void 0:a.call(n)}},inherits=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},possibleConstructorReturn=function(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e},toConsumableArray=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}else return Array.from(e)},nt=function(){function Annotation(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.nx,o=e.ny,s=e.dy,c=s===void 0?0:s,l=e.dx,u=l===void 0?0:l,d=e.color,f=d===void 0?`grey`:d,p=e.data,m=e.type,h=e.subject,g=e.connector,_=e.note,v=e.disable,b=e.id,S=e.className;classCallCheck(this,Annotation),this._dx=a===void 0?u:a-n,this._dy=o===void 0?c:o-i,this._x=n,this._y=i,this._color=f,this.id=b,this._className=S||``,this._type=m||``,this.data=p,this.note=_||{},this.connector=g||{},this.subject=h||{},this.disable=v||[]}return et(Annotation,[{key:`updatePosition`,value:function updatePosition(){this.type.setPosition&&(this.type.setPosition(),this.type.subject&&this.type.subject.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawSubject())}},{key:`clearComponents`,value:function clearComponents(){this.type.clearComponents&&this.type.clearComponents()}},{key:`updateOffset`,value:function updateOffset(){this.type.setOffset&&(this.type.setOffset(),this.type.connector.selectAll(`:not(.handle)`).nodes().length!==0&&this.type.redrawConnector(),this.type.redrawNote())}},{key:`className`,get:function get$$1(){return this._className},set:function set$$1(e){this._className=e,this.type.setClassName&&this.type.setClassName()}},{key:`type`,get:function get$$1(){return this._type},set:function set$$1(e){this._type=e,this.clearComponents()}},{key:`x`,get:function get$$1(){return this._x},set:function set$$1(e){this._x=e,this.updatePosition()}},{key:`y`,get:function get$$1(){return this._y},set:function set$$1(e){this._y=e,this.updatePosition()}},{key:`color`,get:function get$$1(){return this._color},set:function set$$1(e){this._color=e,this.updatePosition()}},{key:`dx`,get:function get$$1(){return this._dx},set:function set$$1(e){this._dx=e,this.updateOffset()}},{key:`dy`,get:function get$$1(){return this._dy},set:function set$$1(e){this._dy=e,this.updateOffset()}},{key:`nx`,set:function set$$1(e){this._dx=e-this._x,this.updateOffset()}},{key:`ny`,set:function set$$1(e){this._dy=e-this._y,this.updateOffset()}},{key:`offset`,get:function get$$1(){return{x:this._dx,y:this._dy}},set:function set$$1(e){var t=e.x,n=e.y;this._dx=t,this._dy=n,this.updateOffset()}},{key:`position`,get:function get$$1(){return{x:this._x,y:this._y}},set:function set$$1(e){var t=e.x,n=e.y;this._x=t,this._y=n,this.updatePosition()}},{key:`translation`,get:function get$$1(){return{x:this._x+this._dx,y:this._y+this._dy}}},{key:`json`,get:function get$$1(){var e={x:this._x,y:this._y,dx:this._dx,dy:this._dy};return this.data&&Object.keys(this.data).length>0&&(e.data=this.data),this.type&&(e.type=this.type),this._className&&(e.className=this._className),Object.keys(this.connector).length>0&&(e.connector=this.connector),Object.keys(this.subject).length>0&&(e.subject=this.subject),Object.keys(this.note).length>0&&(e.note=this.note),e}}]),Annotation}(),rt=function(){function AnnotationCollection(e){var t=e.annotations,n=e.accessors,r=e.accessorsInverse;classCallCheck(this,AnnotationCollection),this.accessors=n,this.accessorsInverse=r,this.annotations=t}return et(AnnotationCollection,[{key:`clearTypes`,value:function clearTypes(e){this.annotations.forEach(function(t){t.type=void 0,t.subject=e&&e.subject||t.subject,t.connector=e&&e.connector||t.connector,t.note=e&&e.note||t.note})}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(){var e=this;this.annotations.forEach(function(t){t.type.setPositionWithAccessors(e.accessors)})}},{key:`editMode`,value:function editMode(e){this.annotations.forEach(function(t){t.type&&(t.type.editMode=e,t.type.updateEditMode())})}},{key:`updateDisable`,value:function updateDisable(e){this.annotations.forEach(function(t){t.disable=e,t.type&&e.forEach(function(e){t.type[e]&&(t.type[e].remove&&t.type[e].remove(),t.type[e]=void 0)})})}},{key:`updateTextWrap`,value:function updateTextWrap(e){this.annotations.forEach(function(t){t.type&&t.type.updateTextWrap&&t.type.updateTextWrap(e)})}},{key:`updateText`,value:function updateText(){this.annotations.forEach(function(e){e.type&&e.type.drawText&&e.type.drawText()})}},{key:`updateNotePadding`,value:function updateNotePadding(e){this.annotations.forEach(function(t){t.type&&(t.type.notePadding=e)})}},{key:`json`,get:function get$$1(){var e=this;return this.annotations.map(function(t){var n=t.json;return e.accessorsInverse&&t.data&&(n.data={},Object.keys(e.accessorsInverse).forEach(function(r){n.data[r]=e.accessorsInverse[r]({x:t.x,y:t.y})})),n})}},{key:`noteNodes`,get:function get$$1(){return this.annotations.map(function(e){return X({},e.type.getNoteBBoxOffset(),{positionX:e.x,positionY:e.y})})}}]),AnnotationCollection}(),it=function pointHandle(e){var t=e.cx,n=t===void 0?0:t,r=e.cy;return{move:{x:n,y:r===void 0?0:r}}},at=function circleHandles(e){var t=e.cx,n=t===void 0?0:t,r=e.cy,i=r===void 0?0:r,a=e.r1,o=e.r2,s=e.padding,c={move:{x:n,y:i}};return a!==void 0&&(c.r1={x:n+a/Math.sqrt(2),y:i+a/Math.sqrt(2)}),o!==void 0&&(c.r2={x:n+o/Math.sqrt(2),y:i+o/Math.sqrt(2)}),s!==void 0&&(c.padding={x:n+a+s,y:i}),c},ot=function addHandles(e){var t=e.group,n=e.handles,r=e.r,i=r===void 0?10:r,a=t.selectAll(`circle.handle`).data(n);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((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return e.start&&e.start(e)}).on(`drag`,function(e){return e.drag&&e.drag(e)}).on(`end`,function(e){return e.end&&e.end(e)})),t.selectAll(`circle.handle`).attr(`cx`,function(e){return e.x}).attr(`cy`,function(e){return e.y}).attr(`r`,function(e){return e.r||i}).attr(`class`,function(e){return`handle `+(e.className||``)}),a.exit().remove()},st=function leftRightDynamic(e,t){return(e===`dynamic`||e===`left`||e===`right`)&&(e=t<0?`top`:`bottom`),e},ct=function topBottomDynamic(e,t){return(e===`dynamic`||e===`top`||e===`bottom`)&&(e=t<0?`right`:`left`),e},lt=[`topBottom`,`top`,`bottom`],ut=[`leftRight`,`left`,`right`],noteAlignment=(function(e){var t=e.padding,n=t===void 0?0:t,r=e.bbox,i=r===void 0?{x:0,y:0,width:0,height:0}:r,a=e.align,o=e.orientation,s=e.offset,c=s===void 0?{x:0,y:0}:s,l=-i.x,u=0;return lt.indexOf(o)===-1?ut.indexOf(o)!==-1&&(a=st(a,c.y),c.x<0&&o===`leftRight`||o===`left`?l-=i.width+n:l+=n,a===`middle`?u-=i.height/2:a===`top`&&(u-=i.height)):(a=ct(a,c.x),c.y<0&&o===`topBottom`||o===`top`?u-=i.height+n:u+=n,a===`middle`?l-=i.width/2:a===`right`&&(l-=i.width)),{x:l,y:u}}),Z=function lineBuilder(e){var t=e.data,n=e.curve,r=n===void 0?linear_default:n,i=e.canvasContext,a=e.className,o=e.classID,s=line_default().curve(r),c={type:`path`,className:a,classID:o,data:t};return i?(s.context(i),c.pathMethods=s):c.attrs={d:s(t)},c},dt=function arcBuilder(e){var t=e.data,n=e.canvasContext,r={type:`path`,className:e.className,classID:e.classID,data:t},i=arc_default().innerRadius(t.innerRadius||0).outerRadius(t.outerRadius||t.radius||2).startAngle(t.startAngle||0).endAngle(t.endAngle||2*Math.PI);return n?(i.context(n),r.pathMethods=lineGen):r.attrs={d:i()},r},noteVertical=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.bbox,s=e.offset;return t=st(t,s.y),t===`top`?a-=o.height:t===`middle`&&(a-=o.height/2),{components:[Z({data:[[r,a],[r,a+o.height]],className:`note-line`})]}}),noteHorizontal=(function(e){var t=e.align,n=e.x,r=n===void 0?0:n,i=e.y,a=i===void 0?0:i,o=e.offset,s=e.bbox;return t=ct(t,o.x),t===`right`?r-=s.width:t===`middle`&&(r-=s.width/2),{components:[Z({data:[[r,a],[r+s.width,a]],className:`note-line`})]}}),ft=function lineSetup(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`circle`&&(l.outerRadius||l.radius)){var u=Math.sqrt((a-o)*(a-o)+(s-c)*(s-c)),d=Math.asin(-c/u),f=l.outerRadius||l.radius+(l.radiusPadding||0);a=Math.abs(Math.cos(d)*f)*(o<0?-1:1),s=Math.abs(Math.sin(d)*f)*(c<0?-1:1)}if(n===`rect`){var p=l.width,m=l.height;(p>0&&r.dx>0||p<0&&r.dx<0)&&(a=Math.abs(p)>Math.abs(r.dx)?p/2:p),(m>0&&r.dy>0||m<0&&r.dy<0)&&(s=Math.abs(m)>Math.abs(r.dy)?m/2:m),a===p/2&&s===m/2&&(a=o,s=c)}return[[a,s],[o,c]]},connectorLine=(function(e){return{components:[Z({data:ft(e),className:`connector`})]}}),connectorElbow=(function(e){var t=e.type,n=e.subjectType,r=t.annotation,i=r.position,a=r.x-i.x,o=a+r.dx,s=r.y-i.y,c=s+r.dy,l=r.subject;if(n===`rect`){var u=l.width,d=l.height;(u>0&&r.dx>0||u<0&&r.dx<0)&&(a=Math.abs(u)>Math.abs(r.dx)?u/2:u),(d>0&&r.dy>0||d<0&&r.dy<0)&&(s=Math.abs(d)>Math.abs(r.dy)?d/2:d),a===u/2&&s===d/2&&(a=o,s=c)}var f=[[a,s],[o,c]],p=c-s,m=o-a,h=o,g=c,_=c<s&&o>a||o<a&&c>s?-1:1;if(Math.abs(m)<Math.abs(p)?(h=o,g=s+m*_):(g=c,h=a+p*_),n===`circle`&&(l.outerRadius||l.radius)){var v=(l.outerRadius||l.radius)+(l.radiusPadding||0),b=v/Math.sqrt(2);if(Math.abs(m)>b&&Math.abs(p)>b)a=b*(o<0?-1:1),s=b*(c<0?-1:1),f=[[a,s],[h,g],[o,c]];else if(Math.abs(m)>Math.abs(p)){var S=Math.asin(-c/v);a=Math.abs(Math.cos(S)*v)*(o<0?-1:1),f=[[a,c],[o,c]]}else{var C=Math.acos(o/v);s=Math.abs(Math.sin(C)*v)*(c<0?-1:1),f=[[o,s],[o,c]]}}else f=[[a,s],[h,g],[o,c]];return{components:[Z({data:f,className:`connector`})]}}),connectorCurve=(function(e){var t=e.type,n=e.connectorData,r=e.subjectType;n||={},(!n.points||typeof n.points==`number`)&&(n.points=pt(t.annotation.offset,n.points)),n.curve||=Qe;var i=[];if(t.editMode){var a=n.points.map(function(e,t){return X({},it({cx:e[0],cy:e[1]}),{index:t})}),s=function updatePoint(e){n.points[e][0]+=o.event.dx,n.points[e][1]+=o.event.dy,t.redrawConnector()};i=t.mapHandles(a.map(function(e){return X({},e.move,{drag:s.bind(t,e.index)})}))}var c=ft({type:t,subjectType:r});return c=[c[0]].concat(toConsumableArray(n.points),[c[1]]),{components:[Z({data:c,curve:n.curve,className:`connector`})],handles:i}}),pt=function createPoints(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n={x:e.x/(t+1),y:e.y/(t+1)},r=[],i=1;i<=t;i++)r.push([n.x*i+i%2*20,n.y*i-i%2*20]);return r},connectorArrow=(function(e){var t=e.annotation,n=e.start,r=e.end,i=e.scale,a=i===void 0?1:i,o=t.position;n=n?[-r[0]+n[0],-r[1]+n[1]]:[t.dx,t.dy],r||=[t.x-o.x,t.y-o.y];var s=r[0],c=r[1],l=n[0],u=n[1],d=10*a,f=16/180*Math.PI,p=Math.atan(u/l);return l<0&&(p+=Math.PI),{components:[Z({data:[[s,c],[Math.cos(p+f)*d+s,Math.sin(p+f)*d+c],[Math.cos(p-f)*d+s,Math.sin(p-f)*d+c],[s,c]],className:`connector-end connector-arrow`,classID:`connector-end`})]}}),connectorDot=(function(e){var t=e.line,n=e.scale,r=dt({className:`connector-end connector-dot`,classID:`connector-end`,data:{radius:3*Math.sqrt(n===void 0?1:n)}});return r.attrs.transform=`translate(`+t.data[0][0]+`, `+t.data[0][1]+`)`,{components:[r]}}),subjectCircle=(function(e){var t=e.subjectData,n=e.type;!t.radius&&!t.outerRadius&&(t.radius=20);var r=[],i=dt({data:t,className:`subject`});if(n.editMode){var a=at({r1:i.data.outerRadius||i.data.radius,r2:i.data.innerRadius,padding:t.radiusPadding}),s=function updateRadius(e){t[e]=t[e]+o.event.dx*Math.sqrt(2),n.redrawSubject(),n.redrawConnector()},c=[X({},a.r1,{drag:s.bind(n,t.outerRadius===void 0?`radius`:`outerRadius`)})];t.innerRadius&&c.push(X({},a.r2,{drag:s.bind(n,`innerRadius`)})),r=n.mapHandles(c)}return i.attrs[`fill-opacity`]=0,{components:[i],handles:r}}),subjectRect=(function(e){var t=e.subjectData,n=e.type;t.width||=100,t.height||=100;var r=[],i=t.width,a=t.height,s=Z({data:[[0,0],[i,0],[i,a],[0,a],[0,0]],className:`subject`});if(n.editMode){var c=[{x:i,y:a/2,drag:function updateWidth(){t.width=o.event.x,n.redrawSubject(),n.redrawConnector()}.bind(n)},{x:i/2,y:a,drag:function updateHeight(){t.height=o.event.y,n.redrawSubject(),n.redrawConnector()}.bind(n)}];r=n.mapHandles(c)}return s.attrs[`fill-opacity`]=.1,{components:[s],handles:r}}),subjectThreshold=(function(e){var t=e.subjectData,n=e.type.annotation.position,r=(t.x1===void 0?n.x:t.x1)-n.x,i=(t.x2===void 0?n.x:t.x2)-n.x,a=(t.y1===void 0?n.y:t.y1)-n.y,o=(t.y2===void 0?n.y:t.y2)-n.y;return{components:[Z({data:[[r,a],[i,o]],className:`subject`})]}}),subjectBadge=(function(e){var t=e.subjectData,n=t===void 0?{}:t,r=e.type,i=r===void 0?{}:r,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.typeSettings&&i.typeSettings.subject;n.radius||(s&&s.radius?n.radius=s.radius:n.radius=14),n.x||s&&s.x&&(n.x=s.x),n.y||s&&s.y&&(n.y=s.y);var c=[],l=[],u=n.radius,d=u*.7,f=0,p=0,m=Math.sqrt(2)*u,h={xleftcorner:-u,xrightcorner:u,ytopcorner:-u,ybottomcorner:u,xleft:-m,xright:m,ytop:-m,ybottom:m};n.x&&!n.y?f=h[`x`+n.x]:n.y&&!n.x?p=h[`y`+n.y]:n.x&&n.y&&(f=h[`x`+n.x+`corner`],p=h[`y`+n.y+`corner`]);var g=`translate(`+f+`, `+p+`)`,_=dt({className:`subject`,data:{radius:u}});_.attrs.transform=g,_.attrs.fill=a.color,_.attrs[`stroke-linecap`]=`round`,_.attrs[`stroke-width`]=`3px`;var v=dt({className:`subject-ring`,data:{outerRadius:u,innerRadius:d}});v.attrs.transform=g,v.attrs[`stroke-width`]=`3px`,v.attrs.fill=`white`;var b=void 0;if(f&&p||!f&&!p)b=Z({className:`subject-pointer`,data:[[0,0],[f||0,0],[0,p||0],[0,0]]});else if(f||p){var S=function notCornerPointerXY(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return e&&e/Math.sqrt(2)/Math.sqrt(2)||t*u/Math.sqrt(2)};b=Z({className:`subject-pointer`,data:[[0,0],[S(f),S(p)],[S(f,-1),S(p,-1)],[0,0]]})}if(b&&(b.attrs.fill=a.color,b.attrs[`stroke-linecap`]=`round`,b.attrs[`stroke-width`]=`3px`,l.push(b)),i.editMode){var C={x:f*2,y:p*2,drag:function dragBadge(){n.x=o.event.x<-u*2?`left`:o.event.x>u*2?`right`:void 0,n.y=o.event.y<-u*2?`top`:o.event.y>u*2?`bottom`:void 0,i.redrawSubject()}.bind(i)};!C.x&&!C.y&&(C.y=-u),c=i.mapHandles([C])}var w=void 0;return n.text&&(w={type:`text`,className:`badge-text`,attrs:{fill:`white`,stroke:`none`,"font-size":`.7em`,text:n.text,"text-anchor":`middle`,dy:`.25em`,x:f,y:p}}),l.push(_),l.push(v),l.push(w),{components:l,handles:c}}),mt=function(){function Type(e){var t=e.a,n=e.annotation,r=e.editMode,i=e.dispatcher,a=e.notePadding,o=e.accessors;if(classCallCheck(this,Type),this.a=t,this.note=n.disable.indexOf(`note`)===-1&&t.select(`g.annotation-note`),this.noteContent=this.note&&t.select(`g.annotation-note-content`),this.connector=n.disable.indexOf(`connector`)===-1&&t.select(`g.annotation-connector`),this.subject=n.disable.indexOf(`subject`)===-1&&t.select(`g.annotation-subject`),this.dispatcher=i,i){var s=yt.bind(null,i,n);s({component:this.note,name:`note`}),s({component:this.connector,name:`connector`}),s({component:this.subject,name:`subject`})}this.annotation=n,this.editMode=n.editMode||r,this.notePadding=a===void 0?3:a,this.offsetCornerX=0,this.offsetCornerY=0,o&&n.data&&this.init(o)}return et(Type,[{key:`init`,value:function init(e){this.annotation.x||this.mapX(e),this.annotation.y||this.mapY(e)}},{key:`mapY`,value:function mapY(e){e.y&&(this.annotation.y=e.y(this.annotation.data))}},{key:`mapX`,value:function mapX(e){e.x&&(this.annotation.x=e.x(this.annotation.data))}},{key:`updateEditMode`,value:function updateEditMode(){this.a.selectAll(`circle.handle`).remove()}},{key:`drawOnSVG`,value:function drawOnSVG(e,t){var n=this;Array.isArray(t)||(t=[t]),t.filter(function(e){return e}).forEach(function(t){var r=t.type,i=t.className,a=t.attrs,o=t.handles,s=t.classID;if(r===`handle`)ot({group:e,r:a&&a.r,handles:o});else{Q(e,[n.annotation],r,i,s);for(var c=e.select(r+`.`+(s||i)),l=Object.keys(a),u=[],d=c.node().attributes,f=d.length-1;f>=0;f--){var p=d[f].name;l.indexOf(p)===-1&&p!==`class`&&u.push(p)}l.forEach(function(e){e===`text`?c.text(a[e]):c.attr(e,a[e])}),u.forEach(function(e){return c.attr(e,null)})}})}},{key:`getNoteBBox`,value:function getNoteBBox(){return xt(this.note,`.annotation-note-content text`)}},{key:`getNoteBBoxOffset`,value:function getNoteBBoxOffset(){var e=xt(this.note,`.annotation-note-content`),t=this.noteContent.attr(`transform`).split(/\(|\,|\)/g);return e.offsetCornerX=parseFloat(t[1])+this.annotation.dx,e.offsetCornerY=parseFloat(t[2])+this.annotation.dy,e.offsetX=this.annotation.dx,e.offsetY=this.annotation.dy,e}},{key:`drawSubject`,value:function drawSubject(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.subject,r=t.type,i={type:this,subjectData:n},a={};r===`circle`?a=subjectCircle(i):r===`rect`?a=subjectRect(i):r===`threshold`?a=subjectThreshold(i):r===`badge`&&(a=subjectBadge(i,this.annotation));var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l;return c.forEach(function(t){t&&t.attrs&&!t.attrs.stroke&&(t.attrs.stroke=e.annotation.color)}),this.editMode&&(u=u.concat(this.mapHandles([{drag:this.dragSubject.bind(this)}])),c.push({type:`handle`,handles:u})),c}},{key:`drawConnector`,value:function drawConnector(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.connector,r=n.type||t.type,i={type:this,connectorData:n};i.subjectType=this.typeSettings&&this.typeSettings.subject&&this.typeSettings.subject.type;var a={};a=r===`curve`?connectorCurve(i):r===`elbow`?connectorElbow(i):connectorLine(i);var o=a,s=o.components,c=s===void 0?[]:s,l=o.handles,u=l===void 0?[]:l,d=c[0];d&&(d.attrs.stroke=this.annotation.color,d.attrs.fill=`none`);var f=n.end||t.end,p={};if(f===`arrow`){var m=d.data[1],h=d.data[0];Math.sqrt((m[0]-h[0])**2+(m[1]-h[1])**2)<5&&d.data[2]&&(m=d.data[2]),p=connectorArrow({annotation:this.annotation,start:m,end:h,scale:n.endScale})}else f===`dot`?p=connectorDot({line:d,scale:n.endScale}):(!f||f===`none`)&&this.connector&&this.connector.select(`.connector-end`).remove();return p.components&&(p.components.forEach(function(t){t.attrs.fill=e.annotation.color,t.attrs.stroke=e.annotation.color}),c=c.concat(p.components)),this.editMode&&u.length!==0&&c.push({type:`handle`,handles:u}),c}},{key:`drawNote`,value:function drawNote(){var e=this,t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=this.annotation.note,r=n.align||t.align||`dynamic`,i={bbox:t.bbox,align:r,offset:this.annotation.offset},a=n.lineType||t.lineType,s={};a===`vertical`?s=noteVertical(i):a===`horizontal`&&(s=noteHorizontal(i));var c=s,l=c.components,u=l===void 0?[]:l,d=c.handles,f=d===void 0?[]:d;if(u.forEach(function(t){t.attrs.stroke=e.annotation.color}),this.editMode){f=this.mapHandles([{x:0,y:0,drag:this.dragNote.bind(this)}]),u.push({type:`handle`,handles:f});var p=this.dragNote.bind(this),m=this.dragstarted.bind(this),h=this.dragended.bind(this);this.note.call((0,o.drag)().container((0,o.select)(`g.annotations`).node()).on(`start`,function(e){return m(e)}).on(`drag`,function(e){return p(e)}).on(`end`,function(e){return h(e)}))}else this.note.on(`mousedown.drag`,null);return u}},{key:`drawNoteContent`,value:function drawNoteContent(e){var t=this.annotation.note,n=t.padding===void 0?this.notePadding:t.padding,r=t.orientation||e.orientation||`topBottom`,i=t.lineType||e.lineType,a=t.align||e.align||`dynamic`;i===`vertical`?r=`leftRight`:i===`horizontal`&&(r=`topBottom`);var o=noteAlignment({padding:n,bbox:e.bbox,offset:this.annotation.offset,orientation:r,align:a}),s=o.x,c=o.y;return this.offsetCornerX=s+this.annotation.dx,this.offsetCornerY=c+this.annotation.dy,this.note&&this.noteContent.attr(`transform`,`translate(`+s+`, `+c+`)`),[]}},{key:`drawOnScreen`,value:function drawOnScreen(e,t){return this.drawOnSVG(e,t)}},{key:`redrawSubject`,value:function redrawSubject(){this.subject&&this.drawOnScreen(this.subject,this.drawSubject())}},{key:`redrawConnector`,value:function redrawConnector(){this.connector&&this.drawOnScreen(this.connector,this.drawConnector())}},{key:`redrawNote`,value:function redrawNote(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getNoteBBox();this.noteContent&&this.drawOnScreen(this.noteContent,this.drawNoteContent({bbox:e})),this.note&&this.drawOnScreen(this.note,this.drawNote({bbox:e}))}},{key:`setPosition`,value:function setPosition(){var e=this.annotation.position;this.a.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}},{key:`clearComponents`,value:function clearComponents(){this.subject&&this.subject.select(`*`).remove(),this.connector&&this.connector.select(`*`).remove()}},{key:`setOffset`,value:function setOffset(){if(this.note){var e=this.annotation.offset;this.note.attr(`transform`,`translate(`+e.x+`, `+e.y+`)`)}}},{key:`setPositionWithAccessors`,value:function setPositionWithAccessors(e){e&&this.annotation.data&&(this.mapX(e),this.mapY(e)),this.setPosition()}},{key:`setClassName`,value:function setClassName(){this.a.attr(`class`,`annotation `+(this.className&&this.className())+` `+(this.editMode?`editable`:``)+` `+(this.annotation.className||``))}},{key:`draw`,value:function draw(){this.setClassName(),this.setPosition(),this.setOffset(),this.redrawSubject(),this.redrawConnector(),this.redrawNote()}},{key:`dragstarted`,value:function dragstarted(){o.event.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`)}},{key:`dragended`,value:function dragended(){this.dispatcher&&this.dispatcher.call(`dragend`,this.a,this.annotation),this.a.classed(`dragging`,!1),this.a.selectAll(`circle.handle`).style(`pointer-events`,`all`)}},{key:`dragSubject`,value:function dragSubject(){var e=this.annotation.position;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.position=e}},{key:`dragNote`,value:function dragNote(){var e=this.annotation.offset;e.x+=o.event.dx,e.y+=o.event.dy,this.annotation.offset=e}},{key:`mapHandles`,value:function mapHandles(e){var t=this;return e.map(function(e){return X({},e,{start:t.dragstarted.bind(t),end:t.dragended.bind(t)})})}}]),Type}(),ht=function customType(e,t,n){return function(e){inherits(customType,e);function customType(e){classCallCheck(this,customType);var n=possibleConstructorReturn(this,(customType.__proto__||Object.getPrototypeOf(customType)).call(this,e));return n.typeSettings=t,t.disable&&t.disable.forEach(function(e){n[e]&&n[e].remove(),n[e]=void 0,e===`note`&&(n.noteContent=void 0)}),n}return et(customType,[{key:`className`,value:function className(){return``+(t.className||tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this)&&tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`className`,this).call(this)||``)}},{key:`drawSubject`,value:function drawSubject(e){return this.typeSettings.subject=X({},t.subject,this.typeSettings.subject),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawSubject`,this).call(this,X({},e,this.typeSettings.subject))}},{key:`drawConnector`,value:function drawConnector(e){return this.typeSettings.connector=X({},t.connector,this.typeSettings.connector),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawConnector`,this).call(this,X({},e,t.connector,this.typeSettings.connector))}},{key:`drawNote`,value:function drawNote(e){return this.typeSettings.note=X({},t.note,this.typeSettings.note),tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNote`,this).call(this,X({},e,t.note,this.typeSettings.note))}},{key:`drawNoteContent`,value:function drawNoteContent(e){return tt(customType.prototype.__proto__||Object.getPrototypeOf(customType.prototype),`drawNoteContent`,this).call(this,X({},e,t.note,this.typeSettings.note))}}],[{key:`init`,value:function init(e,t){return tt(customType.__proto__||Object.getPrototypeOf(customType),`init`,this).call(this,e,t),n&&(e=n(e,t)),e}}]),customType}(e)},gt=function(e){inherits(d3NoteText,e);function d3NoteText(e){classCallCheck(this,d3NoteText);var t=possibleConstructorReturn(this,(d3NoteText.__proto__||Object.getPrototypeOf(d3NoteText)).call(this,e));return t.textWrap=e.textWrap||120,t.drawText(),t}return et(d3NoteText,[{key:`updateTextWrap`,value:function updateTextWrap(e){this.textWrap=e,this.drawText()}},{key:`drawText`,value:function drawText(){if(this.note){Q(this.note,[this.annotation],`g`,`annotation-note-content`);var e=this.note.select(`g.annotation-note-content`);Q(e,[this.annotation],`rect`,`annotation-note-bg`),Q(e,[this.annotation],`text`,`annotation-note-label`),Q(e,[this.annotation],`text`,`annotation-note-title`);var t={height:0},n=this.a.select(`text.annotation-note-label`),r=this.annotation.note&&this.annotation.note.wrap||this.typeSettings&&this.typeSettings.note&&this.typeSettings.note.wrap||this.textWrap,i=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,o={top:0,bottom:0,left:0,right:0};if(typeof a==`number`?o={top:a,bottom:a,left:a,right:a}:a&&(a===void 0?`undefined`:$e(a))===`object`&&(o=X(o,a)),this.annotation.note.title){var s=this.a.select(`text.annotation-note-title`);s.text(this.annotation.note.title),s.attr(`fill`,this.annotation.color),s.attr(`font-weight`,`bold`),s.call(bt,r,i),t=s.node().getBBox()}n.text(this.annotation.note.label).attr(`dx`,`0`),n.call(bt,r,i),n.attr(`y`,t.height*1.1||0),n.attr(`fill`,this.annotation.color);var c=this.getNoteBBox();this.a.select(`rect.annotation-note-bg`).attr(`width`,c.width+o.left+o.right).attr(`height`,c.height+o.top+o.bottom).attr(`x`,c.x-o.left).attr(`y`,-o.top).attr(`fill`,`white`).attr(`fill-opacity`,0)}}}]),d3NoteText}(mt);ht(gt,{className:`label`,note:{align:`middle`}});var _t=ht(gt,{className:`callout`,note:{lineType:`horizontal`}}),vt=ht(_t,{className:`callout elbow`,connector:{type:`elbow`}});ht(_t,{className:`callout curve`,connector:{type:`curve`}}),ht(mt,{className:`badge`,subject:{type:`badge`},disable:[`connector`,`note`]}),ht(gt,{className:`callout circle`,subject:{type:`circle`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(gt,{className:`callout rect`,subject:{type:`rect`},note:{lineType:`horizontal`},connector:{type:`elbow`}}),ht(function(e){inherits(ThresholdMap,e);function ThresholdMap(){return classCallCheck(this,ThresholdMap),possibleConstructorReturn(this,(ThresholdMap.__proto__||Object.getPrototypeOf(ThresholdMap)).apply(this,arguments))}return et(ThresholdMap,[{key:`mapY`,value:function mapY(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapY`,this).call(this,e);var t=this.annotation;(t.subject.x1||t.subject.x2)&&t.data&&e.y&&(t.y=e.y(t.data)),(t.subject.x1||t.subject.x2)&&!t.x&&(t.x=t.subject.x1||t.subject.x2)}},{key:`mapX`,value:function mapX(e){tt(ThresholdMap.prototype.__proto__||Object.getPrototypeOf(ThresholdMap.prototype),`mapX`,this).call(this,e);var t=this.annotation;(t.subject.y1||t.subject.y2)&&t.data&&e.x&&(t.x=e.x(t.data)),(t.subject.y1||t.subject.y2)&&!t.y&&(t.y=t.subject.y1||t.subject.y2)}}]),ThresholdMap}(_t),{className:`callout xythreshold`,subject:{type:`threshold`}});var Q=function newWithClass(e,t,n,r,i){var a=e.selectAll(n+`.`+(i||r)).data(t);return a.enter().append(n).merge(a).attr(`class`,r),a.exit().remove(),e},yt=function addHandlers(e,t,n){var r=n.component,i=n.name;r&&r.on(`mouseover.annotations`,function(){e.call(i+`over`,r,t)}).on(`mouseout.annotations`,function(){return e.call(i+`out`,r,t)}).on(`click.annotations`,function(){return e.call(i+`click`,r,t)})},bt=function wrap(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1.2;e.each(function(){for(var e=(0,o.select)(this),i=e.text().split(n||/[ \t\r\n]+/).reverse().filter(function(e){return e!==``}),a=void 0,s=[],c=e.text(null).append(`tspan`).attr(`x`,0).attr(`dy`,`0.8em`);a=i.pop();)s.push(a),c.text(s.join(` `)),c.node().getComputedTextLength()>t&&s.length>1&&(s.pop(),c.text(s.join(` `)),s=[a],c=e.append(`tspan`).attr(`x`,0).attr(`dy`,r+`em`).text(a))})},xt=function bboxWithoutHandles(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`:not(.handle)`;return e?e.selectAll(t).nodes().reduce(function(e,t){var n=t.getBBox();e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),e.width=Math.max(e.width,n.width);var r=t&&t.attributes&&t.attributes.y;return e.height=Math.max(e.height,(r&&parseFloat(r.value)||0)+n.height),e},{x:0,y:0,width:0,height:0}):{x:0,y:0,width:0,height:0}};function annotation(){var e=[],t=void 0,n=void 0,r=[],i={},a={},s=!1,c=void 0,l=_t,u=void 0,d=void 0,f=(0,o.dispatch)(`subjectover`,`subjectout`,`subjectclick`,`connectorover`,`connectorout`,`connectorclick`,`noteover`,`noteout`,`noteclick`,`dragend`,`dragstart`),p=void 0,m=function annotation(n){p=n,s||n.selectAll(`circle.handle`).remove();var m=e.map(function(e){return e.type||=l,e.disable||=r,new nt(e)});t||=new rt({annotations:m,accessors:i,accessorsInverse:a,ids:c}),n.selectAll(`g`).data([t]).enter().append(`g`).attr(`class`,`annotations`);var h=n.select(`g.annotations`);Q(h,t.annotations,`g`,`annotation`),h.selectAll(`g.annotation`).each(function(e){var t=(0,o.select)(this);t.attr(`class`,`annotation`),Q(t,[e],`g`,`annotation-connector`),Q(t,[e],`g`,`annotation-subject`),Q(t,[e],`g`,`annotation-note`),Q(t.select(`g.annotation-note`),[e],`g`,`annotation-note-content`),e.type=e.type.toString()===`[object Object]`?e.type:new e.type({a:t,annotation:e,textWrap:u,notePadding:d,editMode:s,dispatcher:f,accessors:i}),e.type.draw(),e.type.drawText&&e.type.drawText()})};return m.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.`,t.json),window.copy(JSON.stringify(t.json.map(function(e){return delete e.type,e}))),m},m.update=function(){return e&&t&&(e=t.annotations.map(function(e){return e.type.draw(),e})),m},m.updateText=function(){return t&&(t.updateText(u),e=t.annotations),m},m.updatedAccessors=function(){return t.setPositionWithAccessors(),e=t.annotations,m},m.disable=function(n){return arguments.length?(r=n,t&&(t.updateDisable(r),e=t.annotations),m):r},m.textWrap=function(n){return arguments.length?(u=n,t&&(t.updateTextWrap(u),e=t.annotations),m):u},m.notePadding=function(n){return arguments.length?(d=n,t&&(t.updateNotePadding(d),e=t.annotations),m):d},m.type=function(n,r){return arguments.length?(l=n,t&&(t.annotations.map(function(e){e.type.note&&e.type.note.selectAll(`*:not(.annotation-note-content)`).remove(),e.type.noteContent&&e.type.noteContent.selectAll(`*`).remove(),e.type.subject&&e.type.subject.selectAll(`*`).remove(),e.type.connector&&e.type.connector.selectAll(`*`).remove(),e.type.typeSettings={},e.type=l,e.subject=r&&r.subject||e.subject,e.connector=r&&r.connector||e.connector,e.note=r&&r.note||e.note}),e=t.annotations),m):l},m.annotations=function(n){return arguments.length?(e=n,t&&t.annotations&&(e.some(function(e){return!e.type||e.type.toString()!==`[object Object]`})?(t=null,m(p)):t.annotations=e),m):t&&t.annotations||e},m.context=function(e){return arguments.length?(n=e,m):n},m.accessors=function(e){return arguments.length?(i=e,m):i},m.accessorsInverse=function(e){return arguments.length?(a=e,m):a},m.ids=function(e){return arguments.length?(c=e,m):c},m.editMode=function(n){return arguments.length?(s=n,p&&p.selectAll(`g.annotation`).classed(`editable`,s),t&&(t.editMode(s),e=t.annotations),m):s},m.collection=function(e){return arguments.length?(t=e,m):t},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m}function value2Angle(e){return(e-.5)*.65*2*Math.PI}function pointOnArc(e,t){return{x:Math.cos(e-Math.PI/2)*t,y:Math.sin(e-Math.PI/2)*t}}function indicatorTranslate(e,t,n=!1){let r=pointOnArc(e,t),i=e*180/Math.PI+(n===!0?180:0);return`translate(${r.x}, ${r.y}) rotate(${i})`}function indicatorTween(e,t,n=!1){return function(r){let i=(0,o.interpolate)(r.angle,e);return r.angle=e,function(e){return indicatorTranslate(i(e),t,n)}}}function arcTween(e,t,n){return function(r){let i=(0,o.interpolate)(r.startAngle,e),a=(0,o.interpolate)(r.endAngle,t);return function(e){return r.startAngle=i(e),r.endAngle=a(e),n(r)}}}var $=class Gauge extends o.SVGWidget{_d3Arc=arc_default$1().innerRadius(85).outerRadius(100);_colorScale=(0,o.scaleLinear)().interpolate(o.interpolateHcl);_usageArc;_meanArc;_freeArc;_indInner;_indOuter;_centerTextG;_centerText;_bottomText;_tooltipG;_mainTooltip;constructor(){super()}tip(e){if(e===null||e.label===``)this._tooltipG.transition().style(`opacity`,0).on(`interrupt end`,()=>{this._tooltipG.selectAll(`g`).remove()});else{this._tooltipG.interrupt().style(`opacity`,1),e.w=this._centerText.datum().w+10;let t=`horizontal`,n=0,r=5,i=5;e.y>=5&&e.y<=25?(n=e.x<0?-e.w/2:e.w/2,r=12.5,i=void 0,t=`vertical`):e.y>25&&(r=25,i=0);let a=annotation().type(vt).annotations([{data:e,dx:-e.x+n,dy:-e.y+r,color:`black`,note:{label:e.label,lineType:t,padding:i,align:`middle`}}]).accessors({x:e=>e.x,y:e=>e.y});this._tooltipG.call(a)}}calcSize(e,t,n){let r=e.node().getBBox(),i=t/r.width,a=n/r.height,o=i<a?i:a;return{width:r.width,height:r.height,scale:o}}updateText(e,t,n,r,i){e.datum({x:t,y:n,w:r,h:i}).attr(`transform`,null);let a=this.calcSize(e,r,i),o=t+r/2-a.width/2*a.scale,s=n+i/2-a.height/2*a.scale;e.attr(`transform`,`translate(${o}, ${s}) scale(${a.scale})`)}calcWidth(){return Math.min(this.width(),this.height(),this.maxDiameter())}enter(e,t){super.enter(e,t),t.on(`click`,e=>{this.click(e)}),this._usageArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`green`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._freeArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(1)}).style(`fill`,`lightGrey`),this._meanArc=t.append(`path`).datum({startAngle:value2Angle(0),endAngle:value2Angle(0)}).style(`fill`,`black`).on(`mousemove`,e=>{let[t,n]=this._d3Arc.centroid(e);this.tip({x:t,y:n,label:this.tickValueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._mainTooltip=t.append(`title`);let n=this;function appendIndicator(){return t.append(`path`).datum({angle:value2Angle(0)}).style(`fill`,`black`).style(`stroke`,`black`).attr(`d`,`M 0 0 l -3 -3 l 6 0 z`).on(`mousemove`,e=>{let[t,r]=n._d3Arc.centroid(n._meanArc.datum());n.tip({x:t,y:r,label:n.tickValueDescription()})}).on(`mouseout`,e=>{n.tip(null)})}this._indInner=appendIndicator(),this._indOuter=appendIndicator(),this._centerText=t.append(`text`).attr(`dy`,`.66em`).style(`fill`,`green`).on(`mousemove`,e=>{this.tip({x:0,y:0,label:this.valueDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._bottomText=t.append(`text`).attr(`dy`,`.66em`).on(`mousemove`,e=>{this.tip({x:0,y:e.y,label:this.titleDescription()})}).on(`mouseout`,e=>{this.tip(null)}),this._tooltipG=t.append(`g`).attr(`class`,`annotation-tip`)}update(e,t){super.update(e,t),this._colorScale.domain(this.colorDomain()).range(this.colorRange()),t.attr(`title`,this.tooltip()).style(`cursor`,this.click===Gauge.prototype.click?null:`pointer`);let n=this.calcWidth()/3,r=this.calcWidth()/2-5;this._d3Arc.innerRadius(n).outerRadius(r);let i=this.value(),a=this.tickValue();this._usageArc.style(`fill`,this._colorScale(i)).transition().duration(750).attrTween(`d`,arcTween(value2Angle(0),value2Angle(i),this._d3Arc)),this._freeArc.style(`fill`,this.emptyColor()).transition().duration(750).attrTween(`d`,arcTween(value2Angle(i),value2Angle(1),this._d3Arc)),this._meanArc.style(`fill`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`d`,arcTween(value2Angle(a-.001),value2Angle(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`,indicatorTween(value2Angle(a),n,!0)),this._indOuter.style(`fill`,this.tickColor()).style(`stroke`,this.tickColor()).style(`visibility`,this.showTick()?`visible`:`hidden`).transition().duration(750).attrTween(`transform`,indicatorTween(value2Angle(a),r)),this._centerText.style(`fill`,this._colorScale(i)).text((0,o.format)(`.0%`)(i)),this._bottomText.style(`fill`,this.click===Gauge.prototype.click?this.titleColor():this.titleClickColor()).style(`text-decoration`,this.click===Gauge.prototype.click?null:`underline`).text(this.title());let s=pointOnArc(value2Angle(1),n-8);this.updateText(this._centerText,-s.x,-s.y,2*s.x,2*s.y);let c=pointOnArc(value2Angle(1),r);c.y+=5;let l=this.calcWidth()-20,u=this.calcWidth()/2-c.y-5;this.updateText(this._bottomText,-l/2,c.y,l,u),this._mainTooltip.text(this.tooltip())}click(e){}};$.prototype._class+=` chart_Gauge`,$.prototype.publish(`title`,``,`string`,`Title`),$.prototype.publish(`titleDescription`,``,`string`,`Title Description`),$.prototype.publish(`titleColor`,`black`,`html-color`,`Color of the title text`),$.prototype.publish(`titleClickColor`,`blue`,`html-color`,`Color of the title text when clickable`),$.prototype.publish(`maxDiameter`,128,`number`,`Max Diameter`),$.prototype.publish(`value`,0,`number`,`Value`),$.prototype.publish(`valueDescription`,``,`string`,`Value Description`),$.prototype.publish(`showTick`,!1,`boolean`,`Show Tick`),$.prototype.publish(`tickValue`,0,`number`,`Tick Value`),$.prototype.publish(`tickValueDescription`,``,`string`,`Tick Value Description`),$.prototype.publish(`tooltip`,``,`string`,`Tooltip`),$.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.`),$.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.`),$.prototype.publish(`emptyColor`,`lightgrey`,`html-color`,`Color of the empty portion of the gauge`),$.prototype.publish(`tickColor`,`black`,`html-color`,`Color of the tick`);var sortAscending=(e,t)=>e[1]-t[1]>0?1:-1,sortDescending=(e,t)=>e[1]-t[1]>0?-1:1,Pie=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_totalValue;d3Pie;d3Arc;d3LabelArc;_labelPositions;_smallValueLabelHeight;_labelWidthLimit;_quadIdxArr;_minLabelTop=0;_maxLabelBottom=0;_seriesValueFormatter;_seriesPercentageFormatter;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this.d3Pie=pie_default(),this.d3Arc=arc_default$1(),this.d3LabelArc=arc_default$1(),this.tooltipTick_default(!1).tooltipOffset_default(0)}intersection(e,t){return this.intersectCircle(this.calcOuterRadius(),e,t)}calcInnerRadius(){return this.innerRadius_exists()?this.calcOuterRadius()*this.innerRadius()/100:0}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e},!1)),`Verdana`,12).width,t=this._size.width-(this.showLabels()?e*2:0)-20,n=this._size.height-36-(this.showLabels()?this._smallValueLabelHeight:0),r=Math.min(t,n)/2-2;return t/2-2<this.minOuterRadius()?this._labelWidthLimit=e-(this.minOuterRadius()-(t/2-2)):this._labelWidthLimit=e,r<this.minOuterRadius()?this.minOuterRadius():r}calcSmallValueLabelHeight(){let e=this.data().reduce((e,t)=>e+t[1],0),t=0;return this.data().forEach(n=>{n[1]/e<.1&&t++}),this.labelHeight()*t}calcTotalValue(){return this.data().reduce((e,t)=>e+t[1],0)}calcPadAngleRadians(){let e=this.slicePadding();return e>0?Math.min(e,.05):0}getLabelText(e,t){let n,r=e.data[0];if(this._labelWidthLimit!==void 0&&t){let e=this.textSize(r,`Verdana`,this.labelHeight()).width;this._labelWidthLimit<e&&(n=r.length*(this._labelWidthLimit/e)-3,r=n<r.length?r.slice(0,n)+`...`:r)}if(this.showSeriesValue()&&(r+=` : ${this._seriesValueFormatter(e.data[1])}`),this.showSeriesPercentage()){let t=this._totalValue,n=this.dataMeta();n.sum!==void 0&&(t=n.sum);let i=e.data[1]/t*100;r+=` : ${this._seriesPercentageFormatter(i)}%`}return r}selection(e){if(!arguments.length)try{return this._selection.selection2()[0]?.data}catch{return}let t=JSON.stringify(e);this._selection.selection2(e=>t===JSON.stringify(e.data))}selectByLabel(e){let t=this.data().filter(t=>t[0]===e)[0];t&&this.selection(t)}_slices;_labels;enter(e,t){super.enter(e,t),this._selection.widgetElement(t).skipBringToTop(!0),this._slices=t.append(`g`),this._labels=t.append(`g`);let n=this;this.tooltipHTML(function(e){switch(n.tooltipStyle()){case`series-table`:return n.tooltipFormat({label:e.data[0],arr:n.columns().slice(1).map(function(t,r){return{label:t,color:n._palette(e.data[0]),value:e.data[r+1]}})});default:return n.tooltipFormat({label:e.data[0],value:e.data[1]})}})}update(e,t){this.selectionGlow(!this.tabNavigation()),super.update(e,t);let n=this;this.updateD3Pie(),this._palette=this._palette.switch(this.paletteID()),this._seriesValueFormatter=(0,o.format)(this.seriesValueFormat()),this._seriesPercentageFormatter=(0,o.format)(this.seriesPercentageFormat()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._smallValueLabelHeight=this.calcSmallValueLabelHeight(),this._totalValue=this.calcTotalValue();let r=this.calcOuterRadius(),i=Math.max(this.calcInnerRadius(),Math.min(r/30,6)),a=r+12;this.d3Arc.innerRadius(i).padRadius(r).outerRadius(r).padAngle(this.calcPadAngleRadians()),this._quadIdxArr=[[],[],[],[]];let s=[...this.data()];switch(this.sortDataByValue()){case`ascending`:s.sort(sortAscending);break;case`descending`:s.sort(sortDescending);break}let c=this._slices.selectAll(`.arc`).data(this.d3Pie(s),e=>e.data[0]);this._labelPositions=[],c.enter().append(`g`).attr(`class`,(e,t)=>`arc series series-`+this.cssTag(e.data[0])).attr(`opacity`,0).call(this._selection.enter.bind(this._selection)).on(`click`,function(e){n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`dblclick`,function(e){n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))}).on(`keydown`,function(e,t){let r=(0,o.d3Event)();n.tabNavigation()&&(r.code===`Space`||r.key===`Enter`)&&(r.preventDefault(),n._selection.click(this))}).each(function(e,t){(0,o.select)(this).append(`path`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`mouseover`,arcTween(0,0)).on(`mouseout`,arcTween(-5,150))}).merge(c).transition().attr(`opacity`,1).attr(`tabindex`,n.tabNavigation()?`0`:null).attr(`role`,n.tabNavigation()?`button`:null).attr(`aria-label`,n.tabNavigation()?e=>`${e.data[0]}: ${e.data[1]}`:null).each(function(e,t){let i=n.getQuadrant(midAngle(e));n._quadIdxArr[i].push(t),e.outerRadius=r-5,(0,o.select)(this).select(`path`).transition().attr(`d`,n.d3Arc).style(`fill`,n.fillColor(e.data,n.columns()[1],e.data[1]))}),c.exit().transition().style(`opacity`,0).remove(),this.d3LabelArc.innerRadius(a).outerRadius(a);let l=this._labels.selectAll(`text`).data(this.showLabels()?this.d3Pie(s):[],e=>e.data[0]),u=l.enter().append(`text`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).attr(`dy`,`.5em`).on(`click`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&(n._selection.click(this),n.click(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this)))})}).on(`dblclick`,function(e){n._slices.selectAll(`g`).filter(function(t){e.data===t.data&&n.dblclick(n.rowToObj(e.data),n.columns()[1],n._selection.selected(this))})}).merge(l).text(e=>this.getLabelText(e,!0)).each(function(e,t){let r=n.d3LabelArc.centroid(e),i=midAngle(e);r[0]=a*(n.isLeftSide(i)?1:-1),n._labelPositions.push({top:r[1],bottom:r[1]+n.labelHeight()})});this.showLabels()&&(this.adjustForOverlap(),u.transition().style(`font-size`,this.labelHeight()+`px`).attr(`transform`,(e,t)=>{let r=n.d3LabelArc.centroid(e);return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,`translate(`+r+`)`}).style(`text-anchor`,e=>this.isLeftSide(midAngle(e))?`start`:`end`)),l.exit().remove();let d=this._labels.selectAll(`polyline`).data(this.showLabels()?this.d3Pie(s):[],e=>this.getLabelText(e,!0));d.enter().append(`polyline`).merge(d).transition().attr(`points`,function(e,t){let r=n.d3LabelArc.centroid(e),i=n.d3Arc.centroid(e),o=[...r];return r[0]=a*(n.isLeftSide(midAngle(e))?1:-1),r[1]=n._labelPositions[t].top,[i,o,r]}),d.exit().remove(),this.showLabels()&&this.centerOnLabels();function midAngle(e){return e.startAngle+(e.endAngle-e.startAngle)/2}function arcTween(e,t){return function(){(0,o.select)(this).transition().delay(t).attrTween(`d`,function(t){let i=(0,o.interpolate)(t.outerRadius,r+e);return function(e){return t.outerRadius=i(e),n.d3Arc(t)}})}}}isLeftSide(e){return e=(0,a.normalizeRadians)(e),e>Math.PI*2?e:e<Math.PI&&e>0}getQuadrant(e){let t=0,n=(0,a.normalizeRadians)(e);return t=n<=Math.PI*1&&n>=Math.PI*.5?3:t,t=n<=Math.PI*.5&&n>=Math.PI*0?2:t,t=n<=Math.PI*0&&n>=Math.PI*-.5?1:t,t}centerOnLabels(){let e=this.pos().y,t=e*2,n=this.calcOuterRadius(),r=Math.min(this._minLabelTop,-n),i=Math.max(this._maxLabelBottom,n),a=t-(i-r),o=Math.abs(this._minLabelTop),s=0;i>e?(s=e-i+this.labelHeight()/2,s-=a/2):r<0&&o>e&&(s=o-e+this.labelHeight()/2,s+=a/2);let c=this.pos();this.pos({y:c.y+s,x:c.x})}adjustForOverlap(){let e=this.labelHeight();this._quadIdxArr.forEach((t,n)=>{this._quadIdxArr[n].sort((e,t)=>{if(n===1||n===2)return this._labelPositions[e].top>this._labelPositions[t].top?-1:1;if(n===0||n===3)return this._labelPositions[e].top>this._labelPositions[t].top?1:-1});let r;this._quadIdxArr[n].forEach((t,i)=>{if(i>0){if(n===1||n===2){if(r<this._labelPositions[t].bottom){let e=this._labelPositions[t].bottom-r;this._labelPositions[t].top-=e,this._labelPositions[t].bottom-=e}}else if((n===0||n===3)&&r+e>this._labelPositions[t].top){let n=Math.abs(this._labelPositions[t].top)-Math.abs(r+e);this._labelPositions[t].top-=n,this._labelPositions[t].bottom-=n}}r=this._labelPositions[t].top})}),this._minLabelTop=0,this._maxLabelBottom=0,this._quadIdxArr.forEach((e,t)=>{this._quadIdxArr[t].forEach((e,t)=>{this._minLabelTop>this._labelPositions[e].top&&(this._minLabelTop=this._labelPositions[e].top),this._maxLabelBottom<this._labelPositions[e].bottom&&(this._maxLabelBottom=this._labelPositions[e].bottom)})})}exit(e,t){super.exit(e,t)}updateD3Pie(){let e=(0,a.normalizeRadians)((0,a.degreesToRadians)(this.startAngle()));switch(this.sortDataByValue()){case`ascending`:this.d3Pie.sort(sortAscending);break;case`descending`:this.d3Pie.sort(sortDescending);break;default:this.d3Pie.sort(null)}this.d3Pie.padAngle(this.calcPadAngleRadians()).startAngle(e).endAngle(2*Math.PI+e).value(function(e){return e[1]})}};Pie.prototype._class+=` chart_Pie`,Pie.prototype.implements(I2DChart.prototype),Pie.prototype.implements(ITooltip.prototype),Pie.prototype.mixin(o.Utility.SimpleSelectionMixin),Pie.prototype.publish(`showLabels`,!0,`boolean`,`If true, wedge labels will display`),Pie.prototype.publish(`showSeriesValue`,!1,`boolean`,`Append data series value next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesValueFormat`,`,.0f`,`string`,`Number format used for formatting series values`,null,{disable:e=>!e.showSeriesValue()}),Pie.prototype.publish(`showSeriesPercentage`,!1,`boolean`,`Append data series percentage next to label`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`seriesPercentageFormat`,`,.0f`,`string`,`Number format used for formatting series percentages`,null,{disable:e=>!e.showSeriesPercentage()}),Pie.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Pie.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),Pie.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Pie.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}}),Pie.prototype.publish(`minOuterRadius`,20,`number`,`Minimum outer radius (pixels)`),Pie.prototype.publish(`startAngle`,0,`number`,`Starting angle of the first (and largest) wedge (degrees)`),Pie.prototype.publish(`labelHeight`,12,`number`,`Font size of labels (pixels)`,null,{disable:e=>!e.showLabels()}),Pie.prototype.publish(`slicePadding`,.01,`number`,`Padding between pie slices (converted to pixels)`,null,{tags:[`Basic`],range:{min:0,step:.01,max:.2}}),Pie.prototype.publish(`sortDataByValue`,`descending`,`set`,`Sort data by value`,[`none`,`ascending`,`descending`]),Pie.prototype.publish(`tabNavigation`,!1,`boolean`,`Enable or disable tab navigation`);var HalfPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this._pos.x,r=this._pos.y;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),r+=this._size.height/4,this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(-Math.PI/2).endAngle(Math.PI/2)}};HalfPie.prototype._class+=` chart_HalfPie`;var Heat=class extends XYAxis{_domForeignObject;_domCanvas;_heat;constructor(){super(),this.xAxisGuideLines_default(!0).yAxisGuideLines_default(!0)}radius(e){return this.radiusX(e),this.radiusY(e),this}layerEnter(e,t,n=250){super.layerEnter(e,t,n),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=simpleheat(this._domCanvas.node())}layerUpdate(e,t,n=250){super.layerUpdate(e,t),this._palette=this._palette.switch(this.paletteID());let r=this.width()-this.margin.left-this.margin.right;r<0&&(r=0);let i=this.height()-this.margin.top-this.margin.bottom;i<0&&(i=0),this._domForeignObject.attr(`x`,this.margin.left).attr(`y`,this.margin.top).attr(`width`,r).attr(`height`,i),this._domCanvas.attr(`width`,r).attr(`height`,i);let a=e.orientation()===`horizontal`?this.data().map(t=>[e.dataPos(t[0]),e.valuePos(t[1]),t[2]]):this.data().map(t=>[e.valuePos(t[1]),e.dataPos(t[0]),t[2]]),s=this.maxWeight_exists()?this.maxWeight():(0,o.max)(a,e=>e[2]);if(this.paletteID()!==`default`){let e={},t=this.reversePalette();for(let n=0;n<8;++n)e[n/8]=this._palette((t?8-n:n)/8,0,1);this._heat.gradient(e)}else this._heat.gradient(this._heat.defaultGradient);this._heat.resize();let c=this.radiusAsPercent()?this.radiusX()*r/100:this.radiusX(),l=this.radiusAsPercent()?this.radiusY()*i/100:this.radiusY();this._heat.clear().radius(c,l,this.blur()).max(s).data(a).draw(this.minOpacity())}};Heat.prototype._class+=` chart_Heat`,Heat.prototype._palette=o.Palette.rainbow(`default`),Heat.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Heat.prototype._palette.switch(),{tags:[`Basic`]}),Heat.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),Heat.prototype.publish(`reversePalette`,!1,`boolean`,`Reverse Palette Colors`,null,{disable:e=>e.paletteID()===`default`}),Heat.prototype.publish(`radiusX`,25,`number`,`Point X radius (25 by default)`),Heat.prototype.publish(`radiusY`,25,`number`,`Point Y radius (25 by default)`),Heat.prototype.publish(`radiusAsPercent`,!1,`boolean`,`Calculate RadiusX + RadiusY as % of size`),Heat.prototype.publish(`blur`,15,`number`,`Point blur radius (15 by default)`),Heat.prototype.publish(`maxWeight`,void 0,`number`,`Clamp max weight to value (optional), omitting uses max data point`,void 0,{optional:!0}),Heat.prototype.publish(`minOpacity`,.05,`number`,`Minimum point opacity (0.05 by default)`);function simpleheat(e){if(!(this instanceof simpleheat))return new simpleheat(e);this._canvas=e=typeof e==`string`?document.getElementById(e):e,this._ctx=e.getContext(`2d`),this._width=e.width,this._height=e.height,this._max=1,this._data=[]}simpleheat.prototype={defaultRadius:25,defaultGradient:{.4:`blue`,.6:`cyan`,.7:`lime`,.8:`yellow`,1:`red`},data:function(e){return this._data=e,this},max:function(e){return this._max=e,this},add:function(e){return this._data.push(e),this},clear:function(){return this._data=[],this},radius:function(e,t,n){n=n===void 0?15:n;let r=this._ellipse=this._createCanvas(),i=r.getContext(`2d`),a=this._r=e+n,o=this._r=t+n;return r.width=a*2,r.height=o*2,i.shadowOffsetX=i.shadowOffsetY=a*2,i.shadowOffsetY=i.shadowOffsetY=o*2,i.shadowBlur=n,i.shadowColor=`black`,i.beginPath(),i.ellipse(-a,-o,e,t,0,0,Math.PI*2,!0),i.closePath(),i.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(e){let t=this._createCanvas(),n=t.getContext(`2d`),r=n.createLinearGradient(0,0,0,256);t.width=1,t.height=256;for(let t in e)r.addColorStop(+t,e[t]);return n.fillStyle=r,n.fillRect(0,0,1,256),this._grad=n.getImageData(0,0,1,256).data,this},draw:function(e){this._ellipse||this.radius(this.defaultRadius,this.defaultRadius),this._grad||this.gradient(this.defaultGradient);let t=this._ctx;t.clearRect(0,0,this._width,this._height);for(let n=0,r=this._data.length,i;n<r;n++)i=this._data[n],i[2]<0?i[2]=0:i[2]>this._max&&(i[2]=this._max),t.globalAlpha=Math.max(i[2]/this._max,e===void 0?.05:e),t.drawImage(this._ellipse,i[0]-this._r,i[1]-this._r);let n=t.getImageData(0,0,this._width,this._height);return this._colorize(n.data,this._grad),t.putImageData(n,0,0),this},_colorize:function(e,t){for(let n=0,r=e.length,i;n<r;n+=4)i=e[n+3]*4,i&&(e[n]=t[i],e[n+1]=t[i+1],e[n+2]=t[i+2])},_createCanvas:function(){return typeof document<`u`?document.createElement(`canvas`):new this._canvas.constructor}};var St=Math.PI/3,Ct=[0,St,2*St,3*St,4*St,5*St];function pointX(e){return e[0]}function pointY(e){return e[1]}function hexbin_default(){var e=0,t=0,n=1,r=1,i=pointX,a=pointY,o,s,c;function hexbin(e){var t={},n=[],r,o=e.length;for(r=0;r<o;++r)if(!(isNaN(u=+i.call(null,l=e[r],r,e))||isNaN(d=+a.call(null,l,r,e)))){var l,u,d,f=Math.round(d/=c),p=Math.round(u=u/s-(f&1)/2),m=d-f;if(Math.abs(m)*3>1){var h=u-p,g=p+(u<p?-1:1)/2,_=f+(d<f?-1:1),v=u-g,b=d-_;h*h+m*m>v*v+b*b&&(p=g+(f&1?1:-1)/2,f=_)}var S=p+`-`+f,C=t[S];C?C.push(l):(n.push(C=t[S]=[l]),C.x=(p+(f&1)/2)*s,C.y=f*c)}return n}function hexagon(e){var t=0,n=0;return Ct.map(function(r){var i=Math.sin(r)*e,a=-Math.cos(r)*e,o=i-t,s=a-n;return t=i,n=a,[o,s]})}return hexbin.hexagon=function(e){return`m`+hexagon(e==null?o:+e).join(`l`)+`z`},hexbin.centers=function(){for(var i=[],a=Math.round(t/c),l=Math.round(e/s),u=a*c;u<r+o;u+=c,++a)for(var d=l*s+(a&1)*s/2;d<n+s/2;d+=s)i.push([d,u]);return i},hexbin.mesh=function(){var e=hexagon(o).slice(0,4).join(`l`);return hexbin.centers().map(function(t){return`M`+t+`m`+e}).join(``)},hexbin.x=function(e){return arguments.length?(i=e,hexbin):i},hexbin.y=function(e){return arguments.length?(a=e,hexbin):a},hexbin.radius=function(e){return arguments.length?(o=+e,s=o*2*Math.sin(St),c=o*1.5,hexbin):o},hexbin.size=function(i){return arguments.length?(e=t=0,n=+i[0],r=+i[1],hexbin):[n-e,r-t]},hexbin.extent=function(i){return arguments.length?(e=+i[0][0],t=+i[0][1],n=+i[1][0],r=+i[1][1],hexbin):[[e,t],[n,r]]},hexbin.radius(1)}__name(hexbin_default,`default`);var HexBin=class extends XYAxis{static __inputs=[{id:`x`,type:`any`},{id:`y`,type:`number`}];_hexbin;_dataMinWeight;_dataMaxWeight;constructor(){super(),I2DAggrChart.call(this),this.tooltipValueFormat_default(`,.0f`),ITooltip.call(this),this.tooltipHTML(e=>{let t=(0,o.extent)(e,e=>e.label),n=(0,o.extent)(e,e=>e.value);return this.tooltipFormat({series:t[0]===t[1]?t[0]:`${t[0]} -> ${t[1]}`,label:n[0]===n[1]?n[0]:`${n[0]} -> ${n[1]}`,value:e.length})}),this._hexbin=hexbin_default().x(e=>e.x).y(e=>e.y),this.xAxisGuideLines_default(!1).yAxisGuideLines_default(!1).xAxisType_default(`linear`)}xPos(e,t){return e.orientation()===`horizontal`?e.dataPos(t.label):e.valuePos(t.value)}yPos(e,t){return e.orientation()===`horizontal`?e.valuePos(t.value):e.dataPos(t.label)}layerUpdate(e,t,n=250){super.layerUpdate(e,t,n);let r=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());let i=this.flattenData().map(t=>({x:r.xPos(e,t),y:r.yPos(e,t),label:e.parseData(t.label),value:e.parseValue(t.value),origRow:t})),a=this._hexbin(i),s=(0,o.min)(a,function(e){return e.length}),c=(0,o.max)(a,function(e){return e.length});this._dataMinWeight=s,this._dataMaxWeight=c;let l=t.selectAll(`.hexagon`).data(a,function(e){return e.i+`_`+e.j});l.enter().append(`path`).attr(`class`,`hexagon`).call(e._selection.enter.bind(e._selection)).on(`click`,function(t){let n=r.data();r.click(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`dblclick`,function(t){let n=r.data();r.dblclick(t.map(t=>e.rowToObj(n[t.origRow.rowIdx])),r.columns()[1],e._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).merge(l).transition().duration(n).attr(`d`,this._hexbin.hexagon()).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(1)`}).style(`fill`,function(e){return r._palette(e.length,s,c)}),l.exit().transition().duration(n).attr(`transform`,function(e){return`translate(`+e.x+`,`+e.y+`)scale(0)`}).remove()}exit(e,t){super.exit(e,t)}click(e,t,n){}dblclick(e,t,n){}};HexBin.prototype._class+=` chart_HexBin`,HexBin.prototype.implements(I2DAggrChart.prototype),HexBin.prototype.implements(ITooltip.prototype),HexBin.prototype.publish(`paletteID`,`Blues`,`set`,`Color palette for this widget`,HexBin.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),HexBin.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),HexBin.prototype.publish(`binSize`,20,`number`,`Bin radius`,null,{range:{min:1,max:300,step:1}});var Line=class extends Scatter{constructor(){super(),this.interpolate_default(`linear`)}};Line.prototype._class+=` chart_Line`;var QuarterPie=class extends Pie{constructor(){super()}postUpdate(e,t){super.postUpdate(e,t);let n=this.orientation()===`left`?0:this._size.width,r=this._size.height;this._drawStartPos===`origin`&&this._target instanceof SVGElement&&(n-=this._size.width/2,r-=this._size.height/2),this._element.attr(`transform`,`translate(`+n+`,`+r+`)scale(`+this._widgetScale+`)`)}updateD3Pie(){super.updateD3Pie(),this.d3Pie.startAngle(this.orientation()===`left`?0:-Math.PI/2).endAngle(this.orientation()===`left`?Math.PI/2:0)}calcOuterRadius(){let e=this.textSize(this.data().map(e=>this.getLabelText({data:e})),`Verdana`,12).width;return Math.min(this._size.width-e-10,this._size.height-36)-2}};QuarterPie.prototype._class+=` chart_QuarterPie`,QuarterPie.prototype.publish(`orientation`,`left`,`set`,`Determines the placement and start/end angle.`,[`left`,`right`]);var QuartileCandlestick=class extends o.SVGWidget{_g;_leftLine;_rightLine;_midLine;_midOuterRect;_midInnerRect1;_midInnerRect2;_q0text;_q1text;_q2text;_q3text;_q4text;_q0val;_q1val;_q2val;_q3val;_q4val;constructor(){super()}enter(e,t){super.enter(e,t),this._g=t.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(e,t){super.update(e,t);let n=(this.orientation()===`horizontal`?this.width():this.height())-this.lineWidth(),r=this.orientation()===`horizontal`?this.height():this.width(),i=(0,o.scaleLinear)().domain([this.data()[0],this.data()[4]]).range([this.edgePadding(),n-this.edgePadding()]),a=this.candleWidth_exists()?this.candleWidth():r,s=this.lineWidth(),c=this.lineColor(),l=this.roundedCorners(),u=this.edgePadding(),d=i(this.data()[1]),f=i(this.data()[2]),p=i(this.data()[3]),m=-a/2,h=a/2,g=this.upperTextRotation(),_=this.lowerTextRotation(),v=this.textPadding(),b=this.labelFontSize(),S=this.valueFontSize(),C=Math.max(b,S),w=n-u;if(C>0){for(;d-u<C;)d+=C;for(;f-d<C;)f+=C;for(;p-f<C;)p+=C;for(;w-p<C;)p-=C;for(;p-f<C;)f-=C;for(;f-d<C;)d-=C}let T=-n/2-this.lineWidth()/2,E=0,D=0,O=1,k=`start`,A=`end`;this.orientation()===`vertical`&&(T=0,E=n/2+this.lineWidth()/2,D=-90,k=`end`,A=`start`,O=-1),this._g.style(`shape-rendering`,`crispEdges`).attr(`transform`,`translate(${T},${E})rotate(${D})scale(1)`),this._leftLine.attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,u).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._rightLine.attr(`class`,`right-line`).attr(`fill`,c).attr(`height`,a).attr(`width`,s).attr(`x`,w).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midLine.attr(`fill`,c).attr(`height`,s).attr(`width`,w-u).attr(`x`,u).attr(`y`,-s/2),this._midOuterRect.attr(`fill`,c).attr(`height`,a).attr(`width`,p-d).attr(`x`,d).attr(`y`,m).attr(`rx`,l).attr(`ry`,l),this._midInnerRect1.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,f-(d+s*2)).attr(`x`,d+s).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._midInnerRect2.attr(`fill`,this.innerRectColor()).attr(`height`,a-s*2).attr(`width`,p-f-s).attr(`x`,f).attr(`y`,s-a/2).attr(`rx`,l*.618).attr(`ry`,l*.618),this._q0text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`hanging`).text(this.columns()[0]),this._q1text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[1]),this._q2text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[2]),this._q3text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`middle`).text(this.columns()[3]),this._q4text.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showLabels()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${m-v})rotate(${g})scale(${O})`).attr(`font-size`,b).attr(`text-anchor`,k).attr(`alignment-baseline`,`baseline`).text(this.columns()[4]),this._q0val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${u}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`hanging`).text(this.data()[0]),this._q1val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${d}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[1]),this._q2val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${f}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[2]),this._q3val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${p}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`middle`).text(this.data()[3]),this._q4val.attr(`height`,a).attr(`width`,p-d).attr(`display`,this.showValues()?null:`none`).attr(`fill`,this.textColor()).attr(`x`,0).attr(`y`,0).attr(`transform`,`translate(${w+s}, ${h+v})rotate(${_})scale(${O})`).attr(`font-size`,S).attr(`text-anchor`,A).attr(`alignment-baseline`,`baseline`).text(this.data()[4])}};QuartileCandlestick.prototype._class+=` chart_QuartileCandlestick`,QuartileCandlestick.prototype.publish(`textColor`,`black`,`html-color`,`Color of label and value text`),QuartileCandlestick.prototype.publish(`showLabels`,!0,`boolean`,`If true, labels will be shown`),QuartileCandlestick.prototype.publish(`showValues`,!0,`boolean`,`If true, values will be shown`),QuartileCandlestick.prototype.publish(`orientation`,`horizontal`,`set`,`Determines layout`,[`horizontal`,`vertical`]),QuartileCandlestick.prototype.publish(`valueFontSize`,12,`number`,`Font size of value text (pixels)`),QuartileCandlestick.prototype.publish(`labelFontSize`,12,`number`,`Font size of label text (pixels)`),QuartileCandlestick.prototype.publish(`roundedCorners`,8,`number`,`Radius of rounded rect corners (pixels)`),QuartileCandlestick.prototype.publish(`lineWidth`,4,`number`,`Width of lines (pixels)`),QuartileCandlestick.prototype.publish(`candleWidth`,null,`number`,`Height of outer rect (pixels)`,null,{optional:!0}),QuartileCandlestick.prototype.publish(`textPadding`,8,`number`,`Padding between outer rect and text (pixels)`),QuartileCandlestick.prototype.publish(`edgePadding`,30,`number`,`Padding between outer rect and left/right sides (pixels)`),QuartileCandlestick.prototype.publish(`lineColor`,`#333`,`html-color`,`Color of outer rect and lines`),QuartileCandlestick.prototype.publish(`innerRectColor`,`white`,`html-color`,`Color of the inner rects`),QuartileCandlestick.prototype.publish(`upperTextRotation`,-60,`number`,`Rotation of label text (degrees)`),QuartileCandlestick.prototype.publish(`lowerTextRotation`,-60,`number`,`Rotation of value text (degrees)`);var Radar=class extends o.SVGWidget{constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}mapShape(e){switch(e){case`rectangle`:return`rect`;case`circle`:return`circle`;case`cross`:return`path`;default:}}setPointAttributes(e,t,n){let r=this.mapShape(this.pointShape()),i=this;switch(r){case`rect`:e.attr(`width`,i.pointSize()).attr(`height`,i.pointSize()).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`circle`:e.attr(`r`,i.pointSize()/2).attr(`cx`,t).attr(`cy`,n).style(`fill`,e=>this.strokeColor(e.data,e.column,e.value));break;case`path`:let r=i.pointSize()/2;e.attr(`d`,function(e){return`M`+(t-r)+` `+(n-r)+` L`+(t+r)+` `+(n+r)+` M`+(t-r)+` `+(n+r)+` L`+(t+r)+` `+(n-r)}).style(`stroke`,e=>this.strokeColor(e.data,e.column,e.value));break;default:}}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e.label,series:e.column,value:e.value}))}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID());let n=this,r=this.height(),i=this.width(),a=r/2,s=i/2,c=this.columns(),l=this.data(),u=this.flattenData(c,l).map((e,t)=>(e.shape=this.mapShape(this.pointShape()),e.column=c[e.colIdx],e.row=l[t],e)),d=[],f=this.degrees2radians(360/this.data().length),p=this.fontSize(),m=0;u.filter(e=>e.colIdx===1).forEach(e=>{let t=super.textSize(e.label,`${this.fontFamily()}`,this.fontSize());m<t.width&&(m=t.width)});let h=Math.min(a-p,s-m),g=t.selectAll(`.label`).data(u.filter(e=>e.colIdx===1)),_=Math.max.apply(n,u.map(e=>e.value));g.enter().append(`text`).attr(`class`,`label`).attr(`text-anchor`,`middle`).merge(g).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).each(function(e,t){let r=n.polar2cartesian(h,t*f-Math.PI/2);d.push(r.map(e=>e*n.labelPaddingRatio()));let i=`middle`,a=Math.round(r[0]);i=a>0?`start`:i,i=a<0?`end`:i,(0,o.select)(this).attr(`text-anchor`,i).attr(`x`,r[0]).attr(`y`,r[1])}).text(e=>e.label),g.exit().remove();let v=t.selectAll(`.domain`).data(u.filter(e=>e.colIdx===1));v.enter().append(`line`).classed(`domain`,!0).style(`stroke`,`#000`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`1px`).merge(v).attr(`x1`,0).attr(`y1`,0).attr(`x2`,(e,t)=>d[t][0]).attr(`y2`,(e,t)=>d[t][1]),v.exit().remove();let b=t.selectAll(`.value_guide`).data(this.valueGuideRatios());b.enter().append(`polygon`).classed(`value_guide`,!0).style(`stroke`,`grey`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(b).each(function(e,t){let n=[];d.forEach((t,r)=>{n.push([t[0]*e,t[1]*e])}),(0,o.select)(this).attr(`points`,n.join(` `)).attr(`stroke`,`rgb(0, 0, 0)`).attr(`stroke-opacity`,.75).attr(`stroke-width`,.3).attr(`fill-opacity`,0)}),b.exit().remove();let S=t.selectAll(`.value_guide_text`).data(this.valueGuideRatios());S.enter().append(`text`).attr(`class`,`value_guide_text`).attr(`text-anchor`,`start`).attr(`font-size`,this.fontSize()).attr(`font-family`,this.fontFamily()).merge(S).attr(`x`,2).attr(`y`,e=>d[0][1]*e).text((e,t)=>Math.round(e*_)),b.exit().remove();let C=t.selectAll(`.area`).data(c.filter((e,t)=>t>0));C.enter().append(`polygon`).attr(`class`,`area`).style(`stroke-opacity`,`0.75`).style(`stroke-width`,`0.3px`).merge(C).style(`stroke`,e=>this.strokeColor([],e,0)).style(`fill`,e=>this.fillColor([],e,0)).style(`fill-opacity`,this.fillOpacity()).attr(`points`,(e,t)=>d.map((e,n)=>{let r=l[n][t+1],i=r===0?0:r/_;return e[0]*i+`,`+e[1]*i}).join(` `)),C.exit().remove();let w=t.selectAll(`.point`).data(u);w.enter().append(`g`).attr(`class`,`point`).on(`mouseout.tooltip`,n.tooltip.hide).on(`mousemove.tooltip`,n.tooltip.show).on(`click`,function(e,t){let r=n.data()[e.rowIdx],i=n.rowToObj(r),a=n._selection.selected(this);n.click(i,n.columns()[e.colIdx],a)}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(n.data()[e.rowIdx]),e.column,n._selection.selected(this))}).each(function(e){let t=(0,o.select)(this);t.append(`circle`).attr(`class`,`pointSelection`).attr(`r`,n.pointSize()).call(n._selection.enter.bind(n._selection)),t.append(n.mapShape(n.pointShape())).attr(`class`,`pointShape`)}).merge(w).each(function(e){let t=(0,o.select)(this),r=e.value===0?0:e.value/_,i=d[e.rowIdx][0]*r,a=d[e.rowIdx][1]*r;t.select(`.pointSelection`).attr(`cx`,i).attr(`cy`,a);let s=t.select(`.pointShape`).style(`stroke`,n.strokeColor(e.row,e.column,e.value)).style(`fill`,n.fillColor(e.row,e.column,e.value));n.setPointAttributes(s,i,a)}),w.exit().remove()}polar2cartesian(e,t){return[e*Math.cos(t),e*Math.sin(t)]}cartesian2polar(e,t){return[Math.atan2(t,e),Math.sqrt(e*e+t*t)]}degrees2radians(e){return e/57.295779513}radians2degrees(e){return e*57.295779513}point_in_polygon(e,t){let n=e[0],r=e[1],i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e][0],s=t[e][1],c=t[a][0],l=t[a][1];s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}};Radar.prototype._class+=` chart_Radar`,Radar.prototype.implements(INDChart.prototype),Radar.prototype.implements(ITooltip.prototype),Radar.prototype.mixin(o.Utility.SimpleSelectionMixin),Radar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,Radar.prototype._palette.switch()),Radar.prototype.publish(`pointShape`,`cross`,`set`,`pointShape`,[`circle`,`rectangle`,`cross`]),Radar.prototype.publish(`pointSize`,6,`number`,`Point Size`,null,{range:{min:1,step:1,max:200}}),Radar.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`),Radar.prototype.publish(`fillOpacity`,.66,`number`,`Opacity of the data polygon(s)`),Radar.prototype.publish(`fontFamily`,``,`string`,`fontFamily`),Radar.prototype.publish(`fontSize`,16,`number`,`fontSize`),Radar.prototype.publish(`labelPaddingRatio`,.9,`number`,`labelPaddingRatio`);var RadialBar=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`any`},{id:`values`,type:`number`}];_domainScale=(0,o.scaleBand)();_valueScale=(0,o.scaleLinear)();_d3Arc=arc_default$1().startAngle(0).endAngle(e=>this._valueScale(e[1]));_arcs;_axialAxis;_radialAxis;constructor(){super(),INDChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this)}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this.tooltipHTML(e=>this.tooltipFormat({label:e[0],value:e[1]})),this._radialAxis=t.append(`g`).attr(`class`,`r axis`),this._axialAxis=t.append(`g`).attr(`class`,`a axis`),this._arcs=t.append(`g`).attr(`class`,`data`)}update(e,t){super.update(e,t);let n=this,r=Math.max(this.valueDomainHigh_exists()?this.valueDomainHigh():0,...this.data().map(e=>e[1]));this._valueScale.domain([0,r]).range([0,this.radians(this.valueMaxAngle())]);let i=this._valueScale.ticks(this.tickCount()),a=this.textSize(i.map(e=>``+e),`Verdana`,12).width,s=Math.min(this.width()-(10+a)*2,this.height()-44)/2,c=this.data().map(e=>e[0]);this._domainScale.domain(c).range([0,s]).padding(this.domainPadding());let l=this._domainScale.step()*this._domainScale.padding(),u=this._radialAxis.selectAll(`circle`).data(c);u.enter().append(`circle`).attr(`fill`,`transparent`).merge(u).attr(`r`,e=>this._domainScale(e)+this._domainScale.step()-l/2),u.exit().remove();let d=this._radialAxis.selectAll(`.arc-text`).data(c);d.enter().append(`text`).attr(`class`,`arc-text`).attr(`x`,-4).attr(`alignment-baseline`,`middle`).attr(`text-anchor`,`end`).merge(d).attr(`y`,e=>-this._domainScale(e)-this._domainScale.bandwidth()/2).text(e=>e),d.exit().remove();let f=this._axialAxis.selectAll(`line`).data(i);f.enter().append(`line`).merge(f).attr(`x2`,e=>s*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y2`,e=>s*Math.sin(this._valueScale(e)-this.radians(90))),f.exit().remove();let p=this._axialAxis.selectAll(`text`).data(i);p.enter().append(`text`).style(`dominant-baseline`,`central`).merge(p).attr(`x`,e=>(s+10)*Math.cos(this._valueScale(e)-this.radians(90))).attr(`y`,e=>(s+10)*Math.sin(this._valueScale(e)-this.radians(90))).style(`text-anchor`,e=>{let t=this.degrees(this._valueScale(e));return t>=0&&t<=20||t>=160&&t<=200||t>=340&&t<=360?`middle`:t>=180&&t<=360?`end`:null}).text(e=>e),p.exit().remove();let m=this.columns().length>1?this.columns()[1]:``;this._d3Arc.innerRadius(e=>this._domainScale(e[0])).outerRadius(e=>this._domainScale(e[0])+this._domainScale.bandwidth());let h=this._arcs.selectAll(`path`).data(this.data(),e=>e[0]);h.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(e,t){n.click(n.rowToObj(e),m,n._selection.selected(this))}).on(`dblclick`,function(e,t){n.dblclick(n.rowToObj(e),m,n._selection.selected(this))}).merge(h).style(`fill`,(e,t)=>this.fillColor(e,e[0],e[1])).transition().delay((e,t)=>t*this.transitionDelay()).duration(this.transitionDuration()).attrTween(`d`,(e,t)=>{let n=(0,o.interpolate)(e._current||0,e[1]);return e._current=e[1],r=>this._d3Arc([e[0],n(r)],t)}),h.exit().remove()}degrees(e){return e*180/Math.PI}radians(e){return e*Math.PI/180}};RadialBar.prototype._class+=` chart_RadialBar`,RadialBar.prototype.implements(INDChart.prototype),RadialBar.prototype.implements(ITooltip.prototype),RadialBar.prototype.mixin(o.Utility.SimpleSelectionMixin),RadialBar.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,RadialBar.prototype._palette.switch()),RadialBar.prototype.publish(`tickCount`,10,`number`,`Number of ticks to display`),RadialBar.prototype.publish(`domainPadding`,.25,`number`,`Padding between chart edge and container edge (0..1)`),RadialBar.prototype.publish(`valueMaxAngle`,270,`number`,`Maximum angular length of a bar (degrees)`),RadialBar.prototype.publish(`valueDomainHigh`,null,`number`,`Value domain high`,void 0,{optional:!0}),RadialBar.prototype.publish(`transitionDelay`,100,`number`,`Delay between the start of each row animation (ms)`),RadialBar.prototype.publish(`transitionDuration`,750,`number`,`Duration of a row's animation (ms)`);var wt=o.Palette.rainbow(`Blues`),Tt=o.Palette.ordinal(`Quartile`,[wt(100,0,100),wt(50,0,100),wt(50,0,100),wt(75,0,100)]);Tt(`Std. Dev.`),Tt(`MinMax`),Tt(`25%`),Tt(`50%`);function myFormatter(e){let t=(0,o.format)(e);return function(e){let n=(Math.round(e*100)/100).toString();return n.length<=4?n:t(e)}}var StatChart=class extends o.HTMLWidget{_selectElement;_tickFormatter;_bellCurve=new Scatter().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 QuartileCandlestick().columns([`Min`,`25%`,`50%`,`75%`,`Max`]).edgePadding(0).roundedCorners(1).lineWidth(1).upperTextRotation(-90).lowerTextRotation(-90).labelFontSize(0).valueFontSize(0).lineColor(wt(90,0,100)).innerRectColor(wt(10,0,100));constructor(){super(),this.columns([`Min`,`25%`,`50%`,`75%`,`Max`,`Mean`,`Std. Dev.`])}stdDev(e){return this.mean()+e*this.standardDeviation()}formatStdDev(e){return this._tickFormatter(this.stdDev(e))}quartile(e){return this.quartiles()[e]}formatQ(e){return this._tickFormatter(this.quartile(e))}domain(e){switch(e){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(e){if(!arguments.length)return[[...this.quartiles(),this.mean(),this.standardDeviation()]];let t=e[0];return this.quartiles([t[0],t[1],t[2],t[3],t[4]]),this.mean(t[5]),this.standardDeviation(t[6]),this}enter(e,t){super.enter(e,t),this._bellCurve.target(t.append(`div`).node()),this._candle.target(t.append(`div`).node()),this._selectElement=t.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(e){let t;switch(e){case`25_75`:t=[{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`:t=[{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:t=[{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)}]}let[n,r]=this.domain(this._selectElement.node().value);return t.filter(e=>e.value>=n&&e.value<=r).map(e=>({label:e.label,value:e.value.toString()}))}updateScatter(){let e=this._selectElement.node().value,[t,n]=this.domain(e),r=(n-t)*(this.domainPadding()/100);this._bellCurve.xAxisDomainLow(t-r).xAxisDomainHigh(n+r).xAxisTicks(this.bellTicks(e)).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(){let e=this._bellCurve.dataPos(this.quartile(0)),t=this._bellCurve.dataPos(this.quartile(4))-e;this._candle.resize({width:this.width(),height:this.candleHeight()}).pos({x:e+t/2+2,y:this.candleHeight()/2}).width(t).candleWidth(this.candleHeight()).data(this.quartiles()).render()}update(e,t){super.update(e,t),this._tickFormatter=myFormatter(this.tickFormat()),this._selectElement.node().value=this.view(),this.updateScatter(),this.updateCandle()}exit(e,t){this._bellCurve.target(null),this._candle.target(null),this._selectElement.remove(),super.exit(e,t)}};StatChart.prototype._class+=` chart_StatChart`,StatChart.prototype.publish(`view`,`min_max`,`set`,`View`,[`min_max`,`25_75`,`normal`]),StatChart.prototype.publish(`tickFormat`,`.2e`,`string`,`X-Axis Tick Format`),StatChart.prototype.publish(`candleHeight`,20,`number`,`Height of candle widget (pixels)`),StatChart.prototype.publish(`domainPadding`,10,`number`,`Domain value padding`),StatChart.prototype.publish(`mean`,.5,`number`,`Mean`),StatChart.prototype.publish(`standardDeviation`,.125,`number`,`Standard Deviation (σ)`),StatChart.prototype.publish(`quartiles`,[0,.25,.5,.75,1],`object`,`Quartiles (Min, 25%, 50%, 75%, Max)`);var Step=class extends Scatter{constructor(){super(),this.interpolate_default(`step`)}};Step.prototype._class+=` chart_Step`;var Et=`text`,Dt=`html`,Summary=class extends o.HTMLWidget{_playIntervalIdx=0;_mainDiv;_headerDiv;_textDiv;constructor(){super(),this._tag=`div`,this._drawStartPos=`center`,this.playInterval(this.playInterval())}lookupFieldIdx(e,t){let n=t;if(!(this[e+`_exists`]()&&(n=this.columns().indexOf(this[e]()),n<0)))return n}lookupFieldText(e,t){return this[e+`_exists`]()?this[e]():t===void 0?``:this.columns()[t]||``}currentRow(){return this.data()[this._playIntervalIdx]}summaryData(){let e;this.hideLabel()||(e=this.lookupFieldIdx(`labelColumn`,0));let t=this.lookupFieldIdx(`iconColumn`),n=this.lookupFieldIdx(`valueColumn`,1),r,i;this.hideMore()||(r=this.lookupFieldIdx(`moreIconColumn`),i=this.lookupFieldIdx(`moreTextColumn`));let a=this.lookupFieldIdx(`colorFillColumn`),o=this.lookupFieldIdx(`colorStrokeColumn`);return this.formattedData().map(function(s){return{icon:t===void 0?this.icon():s[t],label:e===void 0?``:s[e],value:s[n],moreIcon:r===void 0?this.hideMore()?``:this.moreIcon():s[r],moreText:i===void 0?this.hideMore()?``:this.moreText():s[i],fill:a===void 0?this.colorFill():s[a],stroke:o===void 0?this.colorStroke():s[o]}},this)}enter(e,t){super.enter(e,t),this._mainDiv=t.append(`div`);let n=this;this._headerDiv=this._mainDiv.append(`h2`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`valueColumn`,1),!0)}),this._textDiv=this._mainDiv.append(`div`).attr(`class`,`text`).on(`click`,function(){n.click(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)}).on(`dblclick`,function(){n.dblclick(n.rowToObj(n.currentRow()),n.lookupFieldText(`labelColumn`,0),!0)})}update(e,t){super.update(e,t),this.data().length;let n=this.summaryData();this._playIntervalIdx>=n.length&&(this._playIntervalIdx=0);let r=this._playIntervalIdx<n.length?n[this._playIntervalIdx]:[``,``];t.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 `+r.icon).transition().style(`background-color`,r.fill).style(`color`,r.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`,r.stroke).style(`font-size`,this.headerFontSize()+`px`)[this.valueHTML()?Dt:Et](r.value),this._textDiv.style(`font-size`,this.textFontSize()+`px`)[this.labelHTML()?Dt:Et](r.label);let i=this,a=this._mainDiv.selectAll(`.more`).data([r]),s=a.enter().append(`div`).attr(`class`,`more`).on(`click`,function(e){i.click(i.rowToObj(i.currentRow()),i.lookupFieldText(`moreTextColumn`)||`more`,!0)}).each(function(){let e=(0,o.select)(this);e.append(`i`),e.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`,(0,o.rgb)(r.fill).darker(.75).toString());s.select(`i`).attr(`class`,function(e){return`fa `+e.moreIcon}),this.moreTextHTML()?s.select(`span`).each(function(e){this.innerHTML=e.moreText}):s.select(`span`).text(e=>e.moreText),a.exit().remove()}exit(e,t){super.exit(e,t)}};Summary.prototype._class+=` chart_Summary`,Summary.prototype.implements(I2DChart.prototype),Summary.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),Summary.prototype.publish(`headerFontSize`,null,`number`,`headerFontSize`),Summary.prototype.publish(`textFontSize`,null,`number`,`textFontSize`),Summary.prototype.publish(`moreFontSize`,null,`number`,`moreFontSize`),Summary.prototype.publish(`iconFontSize`,null,`number`,`iconFontSize`),Summary.prototype.publish(`hideLabel`,!1,`boolean`,`Hide label column`),Summary.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideLabel()}),Summary.prototype.publish(`labelHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideLabel()}),Summary.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`valueHTML`,!1,`boolean`,`Allow HTML`),Summary.prototype.publish(`hideMore`,!1,`boolean`,`Hide More Information`),Summary.prototype.publish(`hideMoreWrapper`,!1,`boolean`,`Hide More Information Wrapper`),Summary.prototype.publish(`moreWrapperHeight`,null,`number`,`Height of the 'more' text wrapper (pixels)`),Summary.prototype.publish(`moreIconColumn`,null,`set`,`Select More Icon Column`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreIcon`,`fa-info-circle`,`string`,`FA Char icon class`,null,{disable:e=>e.hideMore()||e.moreIconColumn()}),Summary.prototype.publish(`moreTextColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0,disable:e=>e.hideMore()}),Summary.prototype.publish(`moreText`,`More Info`,`string`,`More text`,null,{disable:e=>e.hideMore()||e.moreTextColumn()}),Summary.prototype.publish(`moreTextHTML`,!1,`boolean`,`Allow HTML`,null,{disable:e=>e.hideMore()}),Summary.prototype.publish(`colorFillColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorFill`,`#3498db`,`html-color`,`Fill Color`,null,{disable:e=>e.colorFillColumn()}),Summary.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for color`,function(){return this.columns()},{optional:!0}),Summary.prototype.publish(`colorStroke`,`#ffffff`,`html-color`,`Fill Color`,null,{disable:e=>e.colorStrokeColumn()}),Summary.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),Summary.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),Summary.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),Summary.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0});var Ot=Summary.prototype.playInterval;Summary.prototype.playInterval=function(e){let t=Ot.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var SummaryC=class extends o.CanvasWidget{_playIntervalIdx=0;constructor(){super(),I2DChart.call(this),this.playInterval(this.playInterval())}currentRow(){return this.data()[this._playIntervalIdx]}enter(e,t){super.enter.apply(this,arguments);let{width:n,height:r}=this.size();e.height=r,e.width=n}update(e,t){super.update.apply(this,arguments);let n=this;this._playIntervalIdx>=this.data().length&&(this._playIntervalIdx=0);let r=this.size(),i=Math.min(r.width,r.height),a=this.fontSizeRatio(),s=this.columns().indexOf(this.labelColumn()),c=this.columns().indexOf(this.valueColumn()),l=this.columns().indexOf(this.colorFillColumn()),u=this.columns().indexOf(this.colorStrokeColumn()),d=this.columns().indexOf(this.iconColumn()),f=d===-1?this.icon():this.currentRow()[d],p=s===-1?``:this.currentRow()[s],m=c===-1?``:this.currentRow()[c],h=l===-1?this.colorFill():this.currentRow()[l],g=u===-1?this.colorStroke():this.currentRow()[u],_=r.height*(a-this.paddingSizeRatio()),v=r.height*(1-a-this.paddingSizeRatio()),b=r.height*(this.iconSizeRatio()-this.paddingSizeRatio()),S=i*this.paddingSizeRatio(),C=e.getContext(`2d`);C.clearRect(0,0,r.width,r.height);let w=n.fontFamily();C.fillStyle=h,C.fillRect(0,0,r.width,r.height),C.globalAlpha=this.iconOpacity(),drawIcon(o.Utility.faChar(f),b,n.iconAnchor()),C.globalAlpha=this.valueOpacity(),_=drawText(m,S,_,n.valueAnchor()),C.globalAlpha=this.labelOpacity(),drawText(p,_+S,v,n.labelAnchor());function drawText(e,t,n,i){C.textBaseline=`top`,C.font=`${n}px ${w}`,C.fillStyle=g;let a=C.measureText(e);if(a.width>r.width-S*2){let t=(r.width-S*2)/a.width;n*=t,C.font=`${n}px ${w}`,a=C.measureText(e)}let o=getTextOffsetX(a.width,i);return C.fillText(e,o,t),n}function drawIcon(e,t,i){if(e===void 0)return;C.textBaseline=n.iconBaseline(),C.font=`${t}px FontAwesome`,C.fillStyle=g;let a=C.measureText(e);a.width>r.width-S*2&&(C.font=`${t*((r.width-S*2)/a.width)}px FontAwesome`,a=C.measureText(e));let o=getTextOffsetX(a.width,i),s=getTextOffsetY(n.iconBaseline());C.fillText(e,o,s)}function getTextOffsetX(e,t){switch(t){case`start`:return S;case`middle`:return r.width/2-e/2;case`end`:return r.width-e-S}}function getTextOffsetY(e){switch(e){case`top`:return S;case`middle`:return r.height/2;case`bottom`:return r.height-S}}}};SummaryC.prototype._class+=` chart_SummaryC`,SummaryC.prototype.implements(I2DChart.prototype),SummaryC.prototype.publish(`iconBaseline`,`bottom`,`string`,`Text baseline for the icon`,[`top`,`middle`,`bottom`]),SummaryC.prototype.publish(`iconAnchor`,`end`,`set`,`Anchors the icon either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`valueAnchor`,`start`,`set`,`Anchors the value either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`labelAnchor`,`start`,`set`,`Anchors the label either at the start, middle, or end of the summary`,[`start`,`middle`,`end`]),SummaryC.prototype.publish(`iconColumn`,null,`set`,`Select Icon Column`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`icon`,`fa-briefcase`,`string`,`FA Char icon class`,null,{disable:e=>e.iconColumn()}),SummaryC.prototype.publish(`fontFamily`,`Arial`,`string`,`Font Family`),SummaryC.prototype.publish(`labelColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`valueColumn`,null,`set`,`Select display value`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFillColumn`,null,`set`,`Column for background color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorFill`,`#0097e6`,`html-color`,`Background Color`,null,{disable:e=>e.colorFillColumn()}),SummaryC.prototype.publish(`colorStrokeColumn`,null,`set`,`Column for font color`,function(){return this.columns()},{optional:!0}),SummaryC.prototype.publish(`colorStroke`,`#2f3640`,`html-color`,`Font Color`,null,{disable:e=>e.colorStrokeColumn()}),SummaryC.prototype.publish(`fixedSize`,!0,`boolean`,`Fix Size to Min Width/Height`),SummaryC.prototype.publish(`minWidth`,225,`number`,`Minimum Width`),SummaryC.prototype.publish(`minHeight`,150,`number`,`Minimum Height`),SummaryC.prototype.publish(`playInterval`,null,`number`,`Play Interval`,null,{optional:!0}),SummaryC.prototype.publish(`fontSizeRatio`,.618,`number`,`Ratio between widget height and value font size`),SummaryC.prototype.publish(`valueOpacity`,1,`number`,`Opacity of value text (0..1)`),SummaryC.prototype.publish(`labelOpacity`,.9,`number`,`Opacity of label text (0..1)`),SummaryC.prototype.publish(`iconOpacity`,.3,`number`,`Opacity of icon text (0..1)`),SummaryC.prototype.publish(`paddingSizeRatio`,.1,`number`,`Ratio of the smallest dimension for edge padding (0..1)`),SummaryC.prototype.publish(`iconSizeRatio`,.9,`number`,`Ratio of the height for icon size (0..1)`);var kt=SummaryC.prototype.playInterval;SummaryC.prototype.playInterval=function(e){let t=kt.apply(this,arguments);if(arguments.length){this._playIntervalHandle&&clearInterval(this._playIntervalHandle);let t=this;e&&(this._playIntervalHandle=setInterval(function(){t._playIntervalIdx++,t._renderCount&&t.data().length&&t.render()},e))}return t};var At=Math.PI/180,jt=64,Mt=2048;function d3Cloud(){let e=(0,o.dispatch)(`word`,`end`),t={},n=[256,256],r=cloudText,i=cloudFont,a=cloudFontSize,s=cloudFontNormal,c=cloudFontNormal,l=cloudRotate,u=cloudPadding,d=[],f=archimedeanSpiral,p=1/0,m=null,h=Math.random,g=cloudCanvas;t.canvas=function(e){return arguments.length?(g=functor(e),t):g},t.start=function(){let o=getContext(g()),f=zeroArray((n[0]>>5)*n[1]),_=null,v=d.length,b=-1,S=[],C=d.map(function(e,t){return e.text=r.call(this,e,t),e.font=i.call(this,e,t),e.style=s.call(this,e,t),e.weight=c.call(this,e,t),e.rotate=l.call(this,e,t),e.size=~~a.call(this,e,t),e.padding=u.call(this,e,t),e}).sort(function(e,t){return t.size-e.size});return m&&clearInterval(m),m=setInterval(step,0),step(),t;function step(){let r=Date.now();for(;Date.now()-r<p&&++b<v&&m;){let r=C[b];r.x=n[0]*(h()+.5)>>1,r.y=n[1]*(h()+.5)>>1,cloudSprite(o,r,C,b),r.hasText&&place(f,r,_)&&(S.push(r),e.call(`word`,t,r),_?cloudBounds(_,r):_=[{x:r.x+r.x0,y:r.y+r.y0},{x:r.x+r.x1,y:r.y+r.y1}],r.x-=n[0]>>1,r.y-=n[1]>>1)}b>=v&&(t.stop(),e.call(`end`,t,S,_))}},t.stop=function(){return m&&=(clearInterval(m),null),t};function getContext(e){e.width=e.height=1;let t=Math.sqrt(e.getContext(`2d`).getImageData(0,0,1,1).data.length>>2);e.width=(jt<<5)/t,e.height=Mt/t;let n=e.getContext(`2d`);return n.fillStyle=n.strokeStyle=`red`,n.textAlign=`center`,{context:n,ratio:t}}function place(e,t,r){let i=t.x,a=t.y,o=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=f(n),c=h()<.5?1:-1,l=-c,u,d,p;for(;(u=s(l+=c))&&(d=~~u[0],p=~~u[1],!(Math.min(Math.abs(d),Math.abs(p))>=o));)if(t.x=i+d,t.y=a+p,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>n[0]||t.y+t.y1>n[1])&&(!r||!cloudCollide(t,e,n[0]))&&(!r||collideRects(t,r))){let r=t.sprite,i=t.width>>5,a=n[0]>>5,o=t.x-(i<<4),s=o&127,c=32-s,l=t.y1-t.y0,u=(t.y+t.y0)*a+(o>>5),d;for(let t=0;t<l;t++){d=0;for(let n=0;n<=i;n++)e[u+n]|=d<<c|(n<i?(d=r[t*i+n])>>>s:0);u+=a}return delete t.sprite,!0}return!1}return t.timeInterval=function(e){return arguments.length?(p=e??1/0,t):p},t.words=function(e){return arguments.length?(d=e,t):d},t.size=function(e){return arguments.length?(n=[+e[0],+e[1]],t):n},t.font=function(e){return arguments.length?(i=functor(e),t):i},t.fontStyle=function(e){return arguments.length?(s=functor(e),t):s},t.fontWeight=function(e){return arguments.length?(c=functor(e),t):c},t.rotate=function(e){return arguments.length?(l=functor(e),t):l},t.text=function(e){return arguments.length?(r=functor(e),t):r},t.spiral=function(e){return arguments.length?(f=Nt[e]||e,t):f},t.fontSize=function(e){return arguments.length?(a=functor(e),t):a},t.padding=function(e){return arguments.length?(u=functor(e),t):u},t.random=function(e){return arguments.length?(h=e,t):h},t.on=function(){let n=e.on.apply(e,arguments);return n===e?t:n},t}function cloudText(e){return e.text}function cloudFont(){return`serif`}function cloudFontNormal(){return`normal`}function cloudFontSize(e){return Math.sqrt(e.value)}function cloudRotate(){return(~~(Math.random()*6)-3)*30}function cloudPadding(){return 1}function cloudSprite(e,t,n,r){if(t.sprite)return;let i=e.context,a=e.ratio;i.clearRect(0,0,(jt<<5)/a,Mt/a);let o=0,s=0,c=0,l=n.length;for(--r;++r<l;){t=n[r],i.save(),i.font=t.style+` `+t.weight+` `+~~((t.size+1)/a)+`px `+t.font;let e=i.measureText(t.text+`m`).width*a,l=t.size<<1;if(t.rotate){let n=Math.sin(t.rotate*At),r=Math.cos(t.rotate*At),i=e*r,a=e*n,o=l*r,s=l*n;e=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(a+o),Math.abs(a-o))}else e=e+31>>5<<5;if(l>c&&(c=l),o+e>=jt<<5&&(o=0,s+=c,c=0),s+l>=Mt)break;i.translate((o+(e>>1))/a,(s+(l>>1))/a),t.rotate&&i.rotate(t.rotate*At),i.fillText(t.text,0,0),t.padding&&(i.lineWidth=2*t.padding,i.strokeText(t.text,0,0)),i.restore(),t.width=e,t.height=l,t.xoff=o,t.yoff=s,t.x1=e>>1,t.y1=l>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,o+=e}let u=i.getImageData(0,0,(jt<<5)/a,Mt/a).data,d=[];for(;--r>=0;){if(t=n[r],!t.hasText)continue;let e=t.width,i=e>>5,a=t.y1-t.y0;for(let e=0;e<a*i;e++)d[e]=0;if(o=t.xoff,o==null)return;s=t.yoff;let c=0,l=-1;for(let n=0;n<a;n++){for(let t=0;t<e;t++){let e=i*n+(t>>5),r=u[(s+n)*(jt<<5)+(o+t)<<2]?1<<31-t%32:0;d[e]|=r,c|=r}c?l=n:(t.y0++,a--,n--,s++)}t.y1=t.y0+l,t.sprite=d.slice(0,(t.y1-t.y0)*i)}}function cloudCollide(e,t,n){n>>=5;let r=e.sprite,i=e.width>>5,a=e.x-(i<<4),o=a&127,s=32-o,c=e.y1-e.y0,l=(e.y+e.y0)*n+(a>>5),u;for(let e=0;e<c;e++){u=0;for(let n=0;n<=i;n++)if((u<<s|(n<i?(u=r[e*i+n])>>>o:0))&t[l+n])return!0;l+=n}return!1}function cloudBounds(e,t){let n=e[0],r=e[1];t.x+t.x0<n.x&&(n.x=t.x+t.x0),t.y+t.y0<n.y&&(n.y=t.y+t.y0),t.x+t.x1>r.x&&(r.x=t.x+t.x1),t.y+t.y1>r.y&&(r.y=t.y+t.y1)}function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0<t[1].x&&e.y+e.y1>t[0].y&&e.y+e.y0<t[1].y}function archimedeanSpiral(e){let t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function rectangularSpiral(e){let t=4*e[0]/e[1],n=0,r=0;return function(e){let i=e<0?-1:1;switch(Math.sqrt(1+4*i*e)-i&3){case 0:n+=t;break;case 1:r+=4;break;case 2:n-=t;break;default:r-=4;break}return[n,r]}}function zeroArray(e){let t=[],n=-1;for(;++n<e;)t[n]=0;return t}function cloudCanvas(){return document.createElement(`canvas`)}function functor(e){return typeof e==`function`?e:function(){return e}}var Nt={archimedean:archimedeanSpiral,rectangular:rectangularSpiral},WordCloud=class extends o.SVGWidget{static __inputs=[{id:`label`,type:`string`},{id:`value`,type:`number`}];_prevOffsetX;_prevOffsetY;_prevZoom;_root;_canvas;_d3Cloud;_d3Zoom;constructor(){super(),I2DChart.call(this),ITooltip.call(this),o.Utility.SimpleSelectionMixin.call(this),this._prevOffsetX=this.offsetX(),this._prevOffsetY=this.offsetY(),this._prevZoom=this.zoom()}calcData(){return this.data().map(e=>({__viz_label:e[0],__viz_weight:e[1],__viz_row:e}))}enter(e,t){super.enter(e,t),this._selection.widgetElement(t),this._root=t.append(`g`),this._canvas=document.createElement(`canvas`);let n=this;this._d3Zoom=(0,o.zoom)().scaleExtent([.1,10]),this._d3Zoom.on(`zoom`,function(e){let t=(0,o.d3Event)();t&&t.transform&&n.zoomed(n._d3Zoom,[t.transform.x,t.transform.y],t.transform.k)}),t.call(this._d3Zoom),this.tooltipHTML(function(e){let t=n.columns(),r=t&&t.length?t[0]:`Word`;return n.tooltipFormat({label:e.__viz_label,series:r,value:e.__viz_weight})})}update(e,t){super.update(e,t),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+`_`+this.id())),this._d3Cloud=d3Cloud().canvas(()=>this._canvas),this.zoomed(this,[this.offsetX(),this.offsetY()],this.zoom());let n=this.calcData(),r=this,i=(0,o.extent)(n,function(e){return e.__viz_weight}),a;switch(this.scaleMode()){case`log`:a=o.scaleLog;break;case`sqrt`:a=o.scaleSqrt;break;case`pow`:a=o.scalePow;break;default:a=o.scaleLinear;break}let s=a().domain(i).range([this.fontSizeFrom(),this.fontSizeTo()]),c=(0,o.scaleLinear)().domain([0,r.angleCount()-1]).range([r.angleFrom(),r.angleTo()]);this._d3Cloud.stop().size([this.width(),this.height()]).words(n).font(this.fontFamily()).padding(this.padding()).spiral(this.spiral()).text(function(e){return e.__viz_label.trim()}).fontSize(function(e){return s(e.__viz_weight)}).rotate((e,t)=>c(t%r.angleCount())).on(`word`,e=>{}).on(`end`,draw).start();function draw(e,t){let n=r._root.selectAll(`text`).data(e,function(e){return e.__viz_label?e.__viz_label.toLowerCase():``});n.enter().append(`text`).attr(`text-anchor`,`middle`).call(r._selection.enter.bind(r._selection)).text(function(e){return e.__viz_label}).on(`click`,function(e){r.click(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`dblclick`,function(e){r.dblclick(r.rowToObj(e.__viz_row),r.columns()[1],r._selection.selected(this))}).on(`mouseout.tooltip`,r.tooltip.hide).on(`mousemove.tooltip`,r.tooltip.show).style(`opacity`,1e-6).merge(n).style(`font-size`,function(e){return s(e.__viz_weight)+`px`}).style(`font-family`,r.fontFamily()).transition().duration(1e3).attr(`transform`,function(e){return`translate(`+[e.x,e.y]+`)rotate(`+e.rotate+`)`}).style(`fill`,function(e){return r._palette(e.__viz_label?e.__viz_label.toLowerCase():``)}).style(`opacity`,1),n.exit().transition().duration(1e3).style(`opacity`,1e-4).remove()}}zoomed(e,t,n){if(t[0]!==this._prevOffsetX||t[1]!==this._prevOffsetY||n!==this._prevZoom){switch(this._root.attr(`transform`,t),e){case this:break;case this._d3Zoom:this.offsetX(t[0]),this.offsetY(t[1]),this.zoom(n);break}this._prevOffsetX=t[0],this._prevOffsetY=t[1],this._prevZoom=n}}};WordCloud.prototype._class+=` chart_WordCloud`,WordCloud.prototype.implements(I2DChart.prototype),WordCloud.prototype.implements(ITooltip.prototype),WordCloud.prototype.mixin(o.Utility.SimpleSelectionMixin),WordCloud.prototype.publish(`paletteID`,`default`,`set`,`Color palette for this widget`,WordCloud.prototype._palette.switch(),{tags:[`Basic`,`Shared`]}),WordCloud.prototype.publish(`useClonedPalette`,!1,`boolean`,`Enable or disable using a cloned palette`,null,{tags:[`Intermediate`,`Shared`]}),WordCloud.prototype.publish(`fontFamily`,`Impact`,`string`,`Font Name`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeFrom`,6,`number`,`Minimum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`fontSizeTo`,48,`number`,`Maximum font size (pixels)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleFrom`,-60,`number`,`Minimum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleTo`,60,`number`,`Maximum angle (degrees)`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`angleCount`,5,`number`,`Number of different angles`,null,{tags:[`Basic`]}),WordCloud.prototype.publish(`padding`,0,`number`,`Padding between words (pixels)`,null,{tags:[`Intermediate`]}),WordCloud.prototype.publish(`scaleMode`,`linear`,`set`,`Text scaling mode`,[`linear`,`log`,`sqrt`,`pow`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`spiral`,`archimedean`,`set`,`Text scaling mode`,[`archimedean`,`rectangular`],{tags:[`Intermediate`]}),WordCloud.prototype.publish(`offsetX`,0,`number`,`X offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`offsetY`,0,`number`,`Y offset`,null,{tags:[`Advanced`]}),WordCloud.prototype.publish(`zoom`,1,`number`,`Zoom`,null,{tags:[`Advanced`]});function multiScale24Hours(){let e=(0,o.timeFormat)(`.%L`),t=(0,o.timeFormat)(`:%S`),n=(0,o.timeFormat)(`%H:%M`),r=(0,o.timeFormat)(`%H:00`),i=(0,o.timeFormat)(`%b %d`),a=(0,o.timeFormat)(`%b`),s=(0,o.timeFormat)(`%Y`);return o=>o.getMilliseconds()===0?o.getSeconds()===0?o.getMinutes()===0?o.getHours()===0?o.getDate()===1?o.getMonth()===0?s(o):a(o):i(o):r(o):n(o):t(o):e(o)}(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.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:1px;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:#0000;stroke-width:2px;pointer-events:all;transition:all .2s}.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:#0000;border-width:2px}.chart_Column .dataCell.selected .columnRect{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.chart_Column .dataCell:hover .columnRect{stroke:#6c757d99;stroke-width:2px;filter:brightness(1.05)}.chart_Column .dataCell:focus .columnRect{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.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:1px solid #0000;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,.chart_Pie>g>text{cursor:pointer}.chart_Pie .arc path{stroke:#0000;stroke-width:2px}.chart_Pie .arc.selected path{transition:all .2s;stroke:#dc3545!important;stroke-width:3px!important;paint-order:fill stroke!important}.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{transition:all .2s;stroke:#007bff!important;stroke-width:3px!important;paint-order:fill stroke!important}.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{margin-top:10px;margin-bottom:10px;margin-left:10px;font-size:3em;font-weight:700}.chart_Summary .bgIcon:before{opacity:.4;font-family:FontAwesome;font-size:5.5em;position:absolute;top:.5em;right:15px}.chart_Summary .bgIcon{position:relative}.chart_Summary .content{float:left;background-color:#efd752;width:100%;height:100%}.chart_Summary .content div{opacity:.8;margin-top:-1.1em;font-size:1.1em}.chart_Summary .content .text{padding-left:10px}.chart_Summary .content .more{width:100%;height:3em;line-height:3em;position:absolute;bottom:0}.chart_Summary .content .more i{padding-left:10px;padding-right:.5em}.other_Wordcloud text{cursor:pointer}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var Pt=[`label`,`start`,`end`,`icon`,`color`,`series`],WUTimeline=class extends u.ReactTimelineSeries{_palette=o.Palette.ordinal(`default`);constructor(){super(),this.columns(Pt).titleColumn(`label`).iconColumn(`icon`).colorColumn(`color`).seriesColumn(`series`).timePattern(`%Y-%m-%dT%H:%M:%S.%LZ`).tickFormatFunc(multiScale24Hours()).tooltipTimeFormat(`%H:%M:%S.%L`).tooltipHTML(e=>e[Pt.length].calcTooltip())}_prevHashSum;clear(){return delete this._prevHashSum,this}fetchScopes(){let e=(0,a.hashSum)({baseUrl:this.baseUrl(),wuid:this.wuid(),request:this.request()});this._prevHashSum!==e&&(this._prevHashSum=e,n.Workunit.attach({baseUrl:this.baseUrl()},this.wuid()).fetchDetails(this.request()).then(e=>e.filter(e=>e.Id&&e.attr(`WhenStarted`).RawValue).map(e=>{let t=e.attr(`WhenStarted`).RawValue/1e3,n=e.attr(`TimeElapsed`).RawValue/1e6;return[e.Id,new Date(t).toISOString(),n?new Date(t+n).toISOString():void 0,null,this._palette(e.ScopeType),e.ScopeName.split(`::`).join(`:`).split(`:`).slice(0,1),e]})).then(e=>{this.data(e).render()}))}enter(e,t){super.enter(e,t)}update(e,t){this.fetchScopes(),super.update(e,t)}exit(e,t){super.exit(e,t)}};WUTimeline.prototype._class+=` eclwatch_WUTimeline`,WUTimeline.prototype.publish(`baseUrl`,``,`string`,`HPCC Platform Base URL`),WUTimeline.prototype.publish(`wuid`,``,`string`,`Workunit ID`),WUTimeline.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`),e.BUILD_VERSION=p,e.ECLArchiveViewer=ECLArchiveViewer,e.PKG_NAME=d,e.PKG_VERSION=f,e.STATUS=m,e.STATUS_ACTIVE=h,e.WUGraph=WUGraph,e.WUResult=WUResult,e.WUScopeController=WUScopeController,e.WUStatus=WUStatus,e.WUTimeline=WUTimeline});
|
|
2
13
|
//# sourceMappingURL=index.umd.cjs.map
|
|
3
|
-
|
|
14
|
+
(function(){try{if(typeof document<`u`){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}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|