@flyfish-group/file-viewer 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
2
|
var n = (e, r, o) => r in e ? s(e, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[r] = o;
|
|
3
|
-
var
|
|
4
|
-
const u = "/node_modules/file-viewer/dist/worker/";
|
|
5
|
-
class
|
|
3
|
+
var l = (e, r, o) => (n(e, typeof r != "symbol" ? r + "" : r, o), o);
|
|
4
|
+
const u = "/node_modules/@flyfish-group/file-viewer/dist/worker/";
|
|
5
|
+
class i {
|
|
6
6
|
constructor(r) {
|
|
7
|
-
|
|
7
|
+
l(this, "worker", null);
|
|
8
8
|
this.worker = r;
|
|
9
9
|
}
|
|
10
10
|
defaults(r) {
|
|
11
11
|
return this.worker || r();
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function c(e, r = !1) {
|
|
15
15
|
let o = null;
|
|
16
|
-
const
|
|
17
|
-
return o = new Worker(new URL(
|
|
16
|
+
const t = `${u}${e}`;
|
|
17
|
+
return o = new Worker(new URL(t, import.meta.url), { type: r ? "module" : "classic" }), new i(o);
|
|
18
18
|
}
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
c as r
|
|
21
21
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -77,7 +77,7 @@ section.${e}>footer { z-index: 1; }
|
|
|
77
77
|
`).concat(c.replace(/(url\()[^#]+/g,"$1"),`
|
|
78
78
|
</foreignObject></svg>`);return"data:image/svg+xml;base64,".concat(b64EncodeUnicode(h))}function getCoords(t,e){var r=e.top,n=e.left,i=t.getBBox(),s=i.x,a=i.y,o=t.getScreenCTM(),l=o.a,c=o.b,u=o.c,d=o.d,h=o.e,f=o.f,g=t.getBoundingClientRect(),p=g.width,m=g.height;return{x:l*s+u*a+h-n,y:c*s+d*a+f-r+(m-Math.round(m/4)),width:p,height:m}}function getGlyph(t){var e=t.getBoundingClientRect(),r=e.left,n=e.top,i=function(a){return a.textContent||a.childElementCount},s=[];return toArray$1(t.querySelectorAll("text")).filter(i).forEach(function(a){var o=function(c){var u,d=win.getComputedStyle(c),h=d.fill,f=d.fontFamily,g=d.fontSize,p=d.textAnchor,m=d.transform,v=getCoords(c,{left:r,top:n}),_=v.x,b=v.y,C=v.width,S=v.height;return u={},u[c.textContent]={x:_,y:b,width:C,height:S,fill:h,fontFamily:f,fontSize:g,textAnchor:p,transform:m},u};if(a.childElementCount>1){var l=[];return toArray$1(a.querySelectorAll("tspan")).filter(i).forEach(function(c){s.push(o(c))}),l}else s.push(o(a))}),s}function renderText(t,e){e.forEach(function(r){Object.keys(r).forEach(function(n){var i=r[n],s=i.x,a=i.y,o=i.width,l=i.height,c=i.fill,u=i.fontFamily,d=i.fontSize,h=i.transform;if(t.save(),t.font="".concat(d," ").concat(u),t.fillStyle=c,h==="none")t.fillText(n,s,a);else{var f=h.replace(/(matrix|\(|\))/g,"").split(",");f.splice(4).every(function(g){return+g==0})?(f.push(s+o-o/4),f.push(a-l+l/3)):(f.push(s),f.push(a)),t.transform.apply(t,f),t.fillText(n,0,0)}t.restore()})})}var apiExport={export:function(t,e){var r=this,n=this.internal,i=n.state,s=n.$el,a=s.chart,o=s.svg,l=i.current,c=l.width,u=l.height,d=mergeObj({width:c,height:u,preserveAspectRatio:!0,preserveFontStyle:!1,mimeType:"image/png"},t),h=nodeToSvgDataUrl(a.node(),d,{width:c,height:u}),f=d.preserveFontStyle?getGlyph(o.node()):[];if(e&&isFunction$4(e)){var g=new Image;g.crossOrigin="Anonymous",g.onload=function(){var p=doc.createElement("canvas"),m=p.getContext("2d");p.width=d.width||c,p.height=d.height||u,m.drawImage(g,0,0),f.length&&(renderText(m,f),f.length=0),e.bind(r)(p.toDataURL(d.mimeType))},g.src=h}return h}},apiFocus={focus:function(t){var e=this.internal,r=e.state,n=e.mapToTargetIds(t),i=e.$el.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),i.classed($FOCUS.focused,!0).classed($FOCUS.defocused,!1),e.hasArcType()&&!r.hasRadar&&(e.expandArc(n),e.hasType("gauge")&&e.markOverlapped(t,e,".".concat($GAUGE.gaugeValue))),e.toggleFocusLegend(n,!0),r.focusedTargetIds=n,r.defocusedTargetIds=r.defocusedTargetIds.filter(function(s){return n.indexOf(s)<0})},defocus:function(t){var e=this.internal,r=e.state,n=e.mapToTargetIds(t),i=e.$el.svg.selectAll(e.selectorTargets(n.filter(e.isTargetToShow,e)));i.classed($FOCUS.focused,!1).classed($FOCUS.defocused,!0),e.hasArcType(null,["polar"])&&(e.unexpandArc(n),e.hasType("gauge")&&e.undoMarkOverlapped(e,".".concat($GAUGE.gaugeValue))),e.toggleFocusLegend(n,!1),r.focusedTargetIds=r.focusedTargetIds.filter(function(s){return n.indexOf(s)<0}),r.defocusedTargetIds=n},revert:function(t){var e=this.internal,r=e.config,n=e.state,i=e.$el,s=e.mapToTargetIds(t),a=i.svg.selectAll(e.selectorTargets(s));a.classed($FOCUS.focused,!1).classed($FOCUS.defocused,!1),e.hasArcType(null,["polar"])&&e.unexpandArc(s),r.legend_show&&(e.showLegend(s.filter(e.isLegendToShow.bind(e))),i.legend.selectAll(e.selectorLegends(s)).filter(function(){return select(this).classed($FOCUS.legendItemFocused)}).classed($FOCUS.legendItemFocused,!1)),n.focusedTargetIds=[],n.defocusedTargetIds=[]}},legend={show:function(t){var e=this.internal;e.showLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})},hide:function(t){var e=this.internal;e.hideLegend(e.mapToTargetIds(t)),e.updateAndRedraw({withLegend:!0})}},apiLegend={legend},apiLoad={load:function(t){var e=this.internal,r=e.config;t.xs&&e.addXs(t.xs),"names"in t&&this.data.names(t.names),"classes"in t&&Object.keys(t.classes).forEach(function(n){r.data_classes[n]=t.classes[n]}),"categories"in t&&e.axis.isCategorized()&&(r.axis_x_categories=t.categories),"axes"in t&&Object.keys(t.axes).forEach(function(n){r.data_axes[n]=t.axes[n]}),"colors"in t&&Object.keys(t.colors).forEach(function(n){r.data_colors[n]=t.colors[n]}),"unload"in t&&t.unload!==!1?e.unload(e.mapToTargetIds(t.unload===!0?null:t.unload),function(){requestIdleCallback(function(){return e.loadFromArgs(t)})}):e.loadFromArgs(t)},unload:function(t){var e=this.internal,r=t||{};isEmpty$1(r)&&this.tooltip.hide(),isArray$7(r)?r={ids:r}:isString$2(r)&&(r={ids:[r]});var n=e.mapToTargetIds(r.ids);e.unload(n,function(){e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.cache.remove(n),callDone.call(e,r.done,r.resizeAfter)})}};function showHide(t,e,r){var n=this,i=this.internal,s=i.mapToTargetIds(e),a=i.state.hiddenTargetIds.map(function(c){return s.indexOf(c)>-1&&c}).filter(Boolean);i.state.toggling=!0,i["".concat(t?"remove":"add","HiddenTargetIds")](s);var o=i.$el.svg.selectAll(i.selectorTargets(s)),l=t?null:"0";t&&a.length&&(o.style("display",null),callFn(i.config.data_onshown,this,a)),i.$T(o).style("opacity",l,"important").call(endall,function(){!t&&a.length===0&&(o.style("display","none"),callFn(i.config.data_onhidden,n,s)),o.style("opacity",l)}),r.withLegend&&i["".concat(t?"show":"hide","Legend")](s),i.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),i.state.toggling=!1}var apiShow={show:function(t,e){e===void 0&&(e={}),showHide.call(this,!0,t,e)},hide:function(t,e){e===void 0&&(e={}),showHide.call(this,!1,t,e)},toggle:function(t,e){var r=this;e===void 0&&(e={});var n=this.internal,i={show:[],hide:[]};n.mapToTargetIds(t).forEach(function(s){return i[n.isTargetToShow(s)?"hide":"show"].push(s)}),i.show.length&&this.show(i.show,e),i.hide.length&&setTimeout(function(){return r.hide(i.hide,e)},0)}},tooltip={show:function(t){var e,r,n,i=this.internal,s=i.$el,a=i.config,o=i.state,l=o.eventReceiver,c=o.hasTreemap,u=o.inputType,d,h;if(t.mouse&&(h=t.mouse),t.data){var f=t.data,g=(e=i.getYScaleById(f.id))===null||e===void 0?void 0:e(f.value);c&&f.id?l.rect=s.main.select("".concat(i.selectorTarget(f.id,void 0,"rect"))):i.isMultipleX()?h=[i.xx(f),g]:(a.tooltip_grouped||(h=[0,g]),d=(r=f.index)!==null&&r!==void 0?r:i.hasArcType()&&f.id?(n=i.getArcElementByIdOrIndex(f.id))===null||n===void 0?void 0:n.datum().index:i.getIndexByX(f.x))}else isDefined$1(t.x)?d=i.getIndexByX(t.x):isDefined$1(t.index)&&(d=t.index);(u==="mouse"?["mouseover","mousemove"]:["touchstart"]).forEach(function(p){i.dispatchEvent(p,d,h)})},hide:function(){var t,e,r,n=this.internal,i=n.state.inputType,s=n.$el.tooltip,a=s==null?void 0:s.datum();if(a){var o=JSON.parse(a.current)[0].index;(i==="mouse"?["mouseout"]:["touchend"]).forEach(function(l){n.dispatchEvent(l,o)})}i==="touch"&&n.callOverOutForTouch(),n.hideTooltip(!0),(t=n.hideGridFocus)===null||t===void 0||t.call(n),(e=n.unexpandCircles)===null||e===void 0||e.call(n),(r=n.expandBarTypeShapes)===null||r===void 0||r.call(n,!1)}},apiTooltip={tooltip},Chart=function(){function t(e){this.plugins=[];var r=new ChartInternal(this);this.internal=r,function n(i,s,a){Object.keys(i).forEach(function(o){var l=isFunction$4(i[o]),c=s!==a,u=notEmpty(i[o]),d=u&&Object.keys(i[o]).length>0;l&&(!c&&d||c)?s[o]=i[o].bind(a):u&&!l?s[o]={}:s[o]=i[o],d&&n(i[o],s[o],a)})}(t.prototype,this,this),loadConfig.call(r,e),r.beforeInit(),r.init()}return t}();extend$3(Chart.prototype,[apiChart,apiColor,apiData,apiExport,apiFocus,apiLegend,apiLoad,apiShow,apiTooltip]);function setMinMax(t,e,r){var n=t.config,i=function(s,a){var o=isNumber$2(a)?a:a===!1?void 0:null;o!==null&&(n["axis_".concat(s,"_").concat(e)]=o)};isDefined$1(r)&&(isObjectType(r)?Object.keys(r).forEach(function(s){i(s,r[s])}):(isNumber$2(r)||r===!1)&&["y","y2"].forEach(function(s){i(s,r)}),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))}function getMinMax(t,e){var r=t.config;return{x:r["axis_x_".concat(e)],y:r["axis_y_".concat(e)],y2:r["axis_y2_".concat(e)]}}var axis$1={labels:function(t){var e=this.internal,r;return t&&(Object.keys(t).forEach(function(n){e.axis.setLabelText(n,t[n])}),e.axis.updateLabels()),["x","y","y2"].forEach(function(n){var i=e.axis.getLabelText(n);i&&(!r&&(r={}),r[n]=i)}),r},min:function(t){var e=this.internal;return isValue(t)||t===!1?setMinMax(e,"min",t):getMinMax(e,"min")},max:function(t){var e=this.internal;return isValue(t)||t===!1?setMinMax(e,"max",t):getMinMax(e,"max")},range:function(t){var e=this.axis;if(arguments.length){var r=t.min,n=t.max;isDefined$1(n)&&e.max(n),isDefined$1(r)&&e.min(r)}else return{max:e.max(),min:e.min()}}},apiAxis={axis:axis$1},apiCategory={category:function(t,e){var r=this.internal,n=r.config;return arguments.length>1&&(n.axis_x_categories[t]=e,r.redraw()),n.axis_x_categories[t]},categories:function(t){var e=this.internal,r=e.config;if(!t||!Array.isArray(t)){var n=r.axis_x_categories;return isEmpty$1(n)?Object.values(e.data.xs)[0]:n}return r.axis_x_categories=t,e.redraw(),r.axis_x_categories}};function grid$1(t,e){var r=this.internal,n=r.config,i=n.transition_duration&&isTabVisible(),s="grid_".concat(e,"_lines");return t&&(n[s]=t,r.updateGrid(),r.redrawGrid(i)),n[s]}function add$2(t,e){var r="grid_".concat(e,"_lines");return grid$1.bind(this)(this.internal.config[r].concat(t||[]),e)}function remove(t,e){this.internal.removeGridLines(t,e)}var xgrids=function(t){return grid$1.bind(this)(t,"x")};extend$3(xgrids,{add:function(t){return add$2.bind(this)(t,"x")},remove:function(t){return remove.bind(this)(t,!0)}});var ygrids=function(t){return grid$1.bind(this)(t,"y")};extend$3(ygrids,{add:function(t){return add$2.bind(this)(t,"y")},remove:function(t){return remove.bind(this)(t,!1)}});var apiGrid={xgrids,ygrids},apiGroup={groups:function(t){var e=this.internal,r=e.config;return isUndefined$3(t)||(r.data_groups=t,e.redraw()),r.data_groups}};function regionsFn(t,e){e===void 0&&(e=!1);var r=this.internal,n=r.config,i=n.transition_duration&&isTabVisible();return t?(n.regions=e?n.regions.concat(t):t,r.updateRegion(),r.redrawRegion(i),e?n.regions:t):n.regions}var regions=function(t){return regionsFn.bind(this)(t)};extend$3(regions,{add:function(t){return regionsFn.bind(this)(t,!0)},remove:function(t){var e=this.internal,r=e.config,n=e.$T,i=t||{},s=getOption(i,"classes",[$REGION.region]),a=e.$el.main.select(".".concat($REGION.regions)).selectAll(s.map(function(o){return".".concat(o)}));return n(a).style("opacity","0").remove(),a=r.regions,Object.keys(i).length?(a=a.filter(function(o){var l=!1;return o.class?(o.class.split(" ").forEach(function(c){s.indexOf(c)>=0&&(l=!0)}),!l):!0}),r.regions=a):r.regions=[],a}});var apiRegion={regions},apiX={x:function(t){var e=this.internal,r=e.axis,n=e.data,i=r.isCustomX()&&r.isCategorized();return isArray$7(t)&&(i?this.categories(t):(e.updateTargetX(n.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0}))),i?this.categories():n.xs},xs:function(t){var e=this.internal;return isObject$c(t)&&(e.updateTargetXs(e.data.targets,t),e.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),e.data.xs}},apiFlow={flow:function(t){var e=this.internal,r;(t.json||t.rows||t.columns)&&e.convertData(t,function(i){r=i,n()});function n(){var i,s=0,a=0,o,l;if(!(e.state.redrawing||!r||!isTabVisible())){var c=[],u=e.getMaxDataCount(),d=e.convertDataToTargets(r,!0),h=e.axis.isTimeSeries();e.data.targets.forEach(function(p){for(var m=!1,v=0;v<d.length;v++)if(p.id===d[v].id){m=!0,p.values[p.values.length-1]&&(a=p.values[p.values.length-1].index+1),s=d[v].values.length;for(var _=0;_<s;_++)d[v].values[_].index=a+_,h||(d[v].values[_].x=a+_);p.values=p.values.concat(d[v].values),d.splice(v,1);break}!m&&c.push(p.id)}),e.data.targets.forEach(function(p){for(var m=0;m<c.length;m++)if(p.id===c[m]){a=p.values[p.values.length-1].index+1;for(var v=0;v<s;v++)p.values.push({id:p.id,index:a+v,x:h?e.getOtherTargetX(a+v):a+v,value:null})}}),e.data.targets.length&&d.forEach(function(p){for(var m=[],v=e.data.targets[0].values[0].index;v<a;v++)m.push({id:p.id,index:v,x:h?e.getOtherTargetX(v):v,value:null});p.values.forEach(function(_){_.index+=a,h||(_.x+=a)}),p.values=m.concat(p.values)}),e.data.targets=e.data.targets.concat(d);var f=e.data.targets[0],g=f.values[0];isDefined$1(t.to)?(s=0,l=h?parseDate.call(e,t.to):t.to,f.values.forEach(function(p){p.x<l&&s++})):isDefined$1(t.length)&&(s=t.length),u?u===1&&h&&(o=(f.values[f.values.length-1].x-g.x)/2,i=[new Date(+g.x-o),new Date(+g.x+o)]):(h?o=f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-e.getXDomain(e.data.targets)[0]:o=1,i=[g.x-o,g.x]),i&&e.updateXDomain(null,!0,!0,!1,i),e.updateTargets(e.data.targets),e.redraw({flow:{index:g.index,length:s,duration:isValue(t.duration)?t.duration:e.config.transition_duration,done:t.done,orgDataCount:u},withLegend:!0,withTransition:u>1,withTrimXDomain:!1,withUpdateXAxis:!0})}}}},AxisRendererHelper=function(){function t(e){var r=getScale(),n=e.config,i=e.params;this.owner=e,this.config=n,this.scale=r,(n.noTransition||!i.config.transition_duration)&&(n.withoutTransition=!0),n.range=this.scaleExtent((i.orgXScale||r).range())}return t.getSizeFor1Char=function(e){var r={w:5.5,h:11.5};return!e.empty()&&e.select("text").text("0").call(function(n){try{var i=n.node().getBBox(),s=i.width,a=i.height;s&&a&&(r.w=s,r.h=a)}catch(o){}finally{n.text("")}}),this.getSizeFor1Char=function(){return r},r},t.prototype.getTickTransformSetter=function(e){var r=this.config,n=e==="x"?function(i){return"translate(".concat(i+r.tickOffset,",0)")}:function(i){return"translate(0,".concat(i,")")};return function(i,s){i.attr("transform",function(a){return isValue(a)?n(Math.ceil(s(a))):null})}},t.prototype.scaleExtent=function(e){var r=e[0],n=e[e.length-1];return r<n?[r,n]:[n,r]},t.prototype.generateTicks=function(e,r){var n=this.owner.params.tickStepSize,i=e.domain(),s=i[0],a=i[1],o=[];if(r&&n)for(var l=Math.round(s);l<=a;)o.push(l),l+=n;else if(e.ticks){var c=this.config.tickArguments;if(e.type==="log"&&!c){var u=getScale("_log").domain([s>0?s:1,a]).range(e.range());o=u.ticks();for(var d=a.toFixed().length;o.length>15;d--)o=u.ticks(d);o.splice(0,1,s),o.splice(o.length-1,1,a)}else o=e.ticks.apply(e,this.config.tickArguments||[]);o=o.map(function(h){var f=isString$2(h)&&isNumber$2(h)&&!isNaN(h)&&Math.round(h*10)/10||h;return f})}return o},t.prototype.copyScale=function(){var e=this.scale.copy();return e.domain().length||e.domain(this.scale.domain()),e.type=this.scale.type,e},t.prototype.textFormatted=function(e){var r=this.config.tickFormat,n=/\d+\.\d+0{5,}\d$/.test(e)?+String(e).replace(/0+\d$/,""):e,i=r?r(n):n;return isDefined$1(i)?i:""},t.prototype.transitionise=function(e){var r=this.config,n=e;if(r.withoutTransition)n=e.interrupt();else if(r.transition||!this.owner.params.noTransition)try{n=e.transition(r.transition)}catch(i){}return n},t}(),AxisRenderer=function(){function t(e){e===void 0&&(e={});var r={innerTickSize:6,outerTickSize:e.outerTick?6:0,orient:"bottom",range:[],tickArguments:null,tickCentered:null,tickCulling:!0,tickFormat:null,tickLength:9,tickOffset:0,tickPadding:3,tickValues:null,transition:null,noTransition:e.noTransition};r.tickLength=Math.max(r.innerTickSize,0)+r.tickPadding,this.config=r,this.params=e,this.helper=new AxisRendererHelper(this)}return t.prototype.create=function(e){var r=this,n=r.config,i=r.helper,s=r.params,a=i.scale,o=n.orient,l=this.splitTickText.bind(r),c=/^(left|right)$/.test(o),u=/^(top|bottom)$/.test(o),d=i.getTickTransformSetter(u?"x":"y"),h=d===i.axisX?"y":"x",f=/^(top|left)$/.test(o)?-1:1,g=s.tickTextRotate;this.config.range=a.rangeExtent?a.rangeExtent():i.scaleExtent((s.orgXScale||a).range());var p=n.innerTickSize,m=n.tickLength,v=n.range,_=s.id,b=_&&/^(x|y|y2)$/.test(_)?s.config["axis_".concat(_,"_tick_text_position")]:{x:0,y:0},C=_==="subX"?"subchart_axis_x":"axis_".concat(_),S=s.config["".concat(C,"_show")],w={tick:S?s.config["".concat(C,"_tick_show")]:!1,text:S?s.config["".concat(C,"_tick_text_show")]:!1},A;e.each(function(){var O=select(this),T=this.__chart__||a,H=i.copyScale();A=O,this.__chart__=H,n.tickOffset=s.isCategory?Math.ceil((H(1)-H(0))/2):0;var k=O.selectAll(".domain").data([0]);if(k.enter().append("path").attr("class","domain").merge(k).attr("d",function(){var M=n.outerTickSize*f;return u?"M".concat(v[0],",").concat(M,"V0H").concat(v[1],"V").concat(M):"M".concat(M,",").concat(v[0],"H0V").concat(v[1],"H").concat(M)}),w.tick||w.text){var G=n.tickValues||i.generateTicks(H,c);r.generatedTicks=G;var X=O.selectAll(".tick").data(G,H),I=X.enter().insert("g",".domain").attr("class","tick"),ce=X.exit().remove();X=I.merge(X),w.tick&&I.append("line"),w.text&&I.append("text");var be=AxisRendererHelper.getSizeFor1Char(X),ae=[],se=X.select("text").selectAll("tspan").data(function(M,U){var L=s.tickMultiline?l(M,H,G,c,be.w):isArray$7(i.textFormatted(M))?i.textFormatted(M).concat():[i.textFormatted(M)];return ae[U]=L.length,L.map(function(Y){return{index:U,splitted:Y}})});se.exit().remove(),se=se.enter().append("tspan").merge(se).text(function(M){return M.splitted}),se.attr("x",u?0:m*f).attr("dx",function(){var M=0;return/(top|bottom)/.test(o)&&g&&(M=8*Math.sin(Math.PI*(g/180))*(o==="top"?-1:1)),M+(b.x||0)}()).attr("dy",function(M,U){var L=".71em",Y=0;return o!=="top"&&(Y=be.h,U===0&&(Y=c?-((ae[M.index]-1)*(be.h/2)-3):b.y===0?L:0)),isNumber$2(Y)&&b.y?Y+b.y:Y||L});var P=X.select("line"),B=X.select("text");if(I.select("line").attr("".concat(h,"2"),p*f),I.select("text").attr(h,m*f),r.setTickLineTextPosition(P,B),s.tickTitle){var V=B.select("title");(V.empty()?B.append("title"):V).text(function(M){return s.tickTitle[M]})}if(H.bandwidth){var ie=H,F=ie.bandwidth()/2;T=function(M){return ie(M)+F},H=T}else T.bandwidth?T=H:d(ce,H);X=s.owner.state.flowing?i.transitionise(X):s.owner.$T(X),d(I,T),d(X.style("opacity",null),H)}}),this.g=A},t.prototype.getGeneratedTicks=function(e){var r,n=((r=this.generatedTicks)===null||r===void 0?void 0:r.length)-1,i=this.generatedTicks;if(n>e){var s=Math.round(n/e+.1);i=this.generatedTicks.map(function(a,o){return o%s===0?a:null}).filter(function(a){return a!==null}).splice(0,e)}return i},t.prototype.getTickXY=function(){var e=this.config,r={x:0,y:0};return this.params.isCategory&&(r.x=e.tickCentered?0:e.tickOffset,r.y=e.tickCentered?e.tickOffset:0),r},t.prototype.getTickSize=function(e){var r=this.helper.scale,n=this.config,i=n.innerTickSize,s=n.range,a=r(e)+(n.tickCentered?0:n.tickOffset);return s[0]<a&&a<s[1]?i:0},t.prototype.setTickLineTextPosition=function(e,r){var n=this.getTickXY(),i=this.config,s=i.innerTickSize,a=i.orient,o=i.tickLength,l=i.tickOffset,c=this.params.tickTextRotate,u=function(f){var g=["start","end"];return a==="top"&&g.reverse(),f?g[f>0?0:1]:"middle"},d=function(f){return f?"rotate(".concat(f,")"):null},h=function(f){var g=f/(a==="bottom"?15:23);return f?11.5-2.5*g*(f>0?1:-1):o};switch(a){case"bottom":e.attr("x1",n.x).attr("x2",n.x).attr("y2",this.getTickSize.bind(this)),r.attr("x",0).attr("y",h(c)).style("text-anchor",u(c)).attr("transform",d(c));break;case"top":e.attr("x2",0).attr("y2",-s),r.attr("x",0).attr("y",-h(c)*2).style("text-anchor",u(c)).attr("transform",d(c));break;case"left":e.attr("x2",-s).attr("y1",n.y).attr("y2",n.y),r.attr("x",-o).attr("y",l).style("text-anchor","end");break;case"right":e.attr("x2",s).attr("y2",0),r.attr("x",o).attr("y",0).style("text-anchor","start")}},t.prototype.splitTickText=function(e,r,n,i,s){var a=this.params,o=this.helper.textFormatted(e),l=isString$2(o)&&o.indexOf(`
|
|
79
79
|
`)>-1?o.split(`
|
|
80
|
-
`):[];if(l.length)return l;if(isArray$7(o))return o;var c=a.tickWidth;(!c||c<=0)&&(c=i?95:a.isCategory?Math.ceil(a.isInverted?r(n[0])-r(n[1]):r(n[1])-r(n[0]))-12:110);function u(d,h){for(var f,g,p,m=1;m<h.length;m++)if(h.charAt(m)===" "&&(g=m),f=h.substr(0,m+1),p=s*f.length,c<p)return u(d.concat(h.substr(0,g||m)),h.slice(g?g+1:m));return d.concat(h)}return u(l,String(o))},t.prototype.scale=function(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale},t.prototype.orient=function(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient},t.prototype.tickFormat=function(e){var r=this.config;return arguments.length?(r.tickFormat=e,this):r.tickFormat},t.prototype.tickCentered=function(e){var r=this.config;return arguments.length?(r.tickCentered=e,this):r.tickCentered},t.prototype.tickOffset=function(){return this.config.tickOffset},t.prototype.tickInterval=function(e){var r=this,n=this.config,i=n.outerTickSize,s=n.tickOffset,a=n.tickValues,o;if(this.params.isCategory)o=s*2;else{var l=this.g.select("path.domain").node().getTotalLength()-i*2;o=l/(e||this.g.selectAll("line").size());var c=a?a.map(function(u,d,h){var f=d+1;return f<h.length?r.helper.scale(h[f])-r.helper.scale(u):null}).filter(Boolean):[];o=Math.min.apply(Math,__spreadArray(__spreadArray([],c,!1),[o],!1))}return o===1/0?0:o},t.prototype.ticks=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.config;return e.length?(n.tickArguments=toArray$1(e),this):n.tickArguments},t.prototype.tickCulling=function(e){var r=this.config;return arguments.length?(r.tickCulling=e,this):r.tickCulling},t.prototype.tickValues=function(e){var r=this,n=this.config;if(isFunction$4(e))n.tickValues=function(){return e(r.helper.scale.domain())};else{if(!arguments.length)return n.tickValues;n.tickValues=e}return this},t.prototype.setTransition=function(e){return this.config.transition=e,this},t}(),axis={getAxisInstance:function(){return this.axis||new Axis(this)}},Axis=function(){function t(e){this.axesList={},this.tick={x:null,y:null,y2:null},this.xs=[],this.orient={x:"bottom",y:"left",y2:"right",subX:"bottom"},this.owner=e,this.setOrient()}return t.prototype.getAxisClassName=function(e){return"".concat($AXIS.axis," ").concat($AXIS["axis".concat(capitalize(e))])},t.prototype.isHorizontal=function(e,r){var n=e.config.axis_rotated;return r?n:!n},t.prototype.isCategorized=function(){var e=this.owner,r=e.config,n=e.state;return r.axis_x_type.indexOf("category")>=0||n.hasRadar},t.prototype.isCustomX=function(){var e=this.owner.config;return!this.isTimeSeries()&&(e.data_x||notEmpty(e.data_xs))},t.prototype.isTimeSeries=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="timeseries"},t.prototype.isLog=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="log"},t.prototype.isTimeSeriesY=function(){return this.isTimeSeries("y")},t.prototype.getAxisType=function(e){e===void 0&&(e="x");var r="linear";return this.isTimeSeries(e)?r=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(r="log"),r},t.prototype.init=function(){var e=this,r=this.owner,n=r.config,i=r.$el,s=i.main,a=i.axis,o=r.state.clip,l=n.axis_rotated,c=["x","y"];n.axis_y2_show&&c.push("y2"),c.forEach(function(u){var d=e.getAxisClassName(u),h=$AXIS["axis".concat(u.toUpperCase(),"Label")];a[u]=s.append("g").attr("class",d).attr("clip-path",function(){var f=null;return u==="x"?f=o.pathXAxis:u==="y"&&(f=o.pathYAxis),f}).attr("transform",r.getTranslate(u)).style("visibility",n["axis_".concat(u,"_show")]?null:"hidden"),a[u].append("text").attr("class",h).attr("transform",["rotate(-90)",null][u==="x"?+!l:+l]).style("text-anchor",function(){return e.textAnchorForAxisLabel(u)}),e.generateAxes(u)})},t.prototype.setOrient=function(){var e=this.owner,r=e.config,n=r.axis_rotated,i=r.axis_y_inner,s=r.axis_y2_inner;this.orient={x:n?"left":"bottom",y:n?i?"top":"bottom":i?"right":"left",y2:n?s?"bottom":"top":s?"left":"right",subX:n?"left":"bottom"}},t.prototype.generateAxes=function(e){var r=this.owner,n=r.config,i=[],s=n["axis_".concat(e,"_axes")],a=n.axis_rotated,o;e==="x"?o=a?axisLeft:axisBottom:e==="y"?o=a?axisBottom:axisLeft:e==="y2"&&(o=a?axisTop:axisRight),s.length&&s.forEach(function(l){var c=l.tick||{},u=r.scale[e].copy();l.domain&&u.domain(l.domain),i.push(o(u).ticks(c.count).tickFormat(isFunction$4(c.format)?c.format.bind(r.api):function(d){return d}).tickValues(c.values).tickSizeOuter(c.outer===!1?0:6))}),this.axesList[e]=i},t.prototype.updateAxes=function(){var e=this,r=this.owner,n=r.config,i=r.$el.main,s=r.$T;Object.keys(this.axesList).forEach(function(a){var o=n["axis_".concat(a,"_axes")],l=r.scale[a].copy(),c=l.range();e.axesList[a].forEach(function(u,d){var h=u.scale().range();c.every(function(p,m){return p===h[m]})||u.scale().range(c);var f="".concat(e.getAxisClassName(a),"-").concat(d+1),g=i.select(".".concat(f.replace(/\s/,".")));g.empty()?g=i.append("g").attr("class",f).style("visibility",n["axis_".concat(a,"_show")]?null:"hidden").call(u):(o[d].domain&&l.domain(o[d].domain),s(g).call(u.scale(l))),g.attr("transform",r.getTranslate(a,d+1))})})},t.prototype.setAxis=function(e,r,n,i){var s=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,r,n,e==="x"&&(s.scale.zoom||s.config.subchart_show||s.state.resizing)?!0:i)},t.prototype.getAxis=function(e,r,n,i,s){var a=this.owner,o=a.config,l=/^(x|subX)$/.test(e),c=l?"x":e,u=l&&this.isCategorized(),d=this.orient[e],h=s?0:a.getAxisTickRotate(c),f;if(l)f=e==="subX"?a.format.subXAxisTick:a.format.xAxisTick;else{var g=o["axis_".concat(e,"_tick_format")];isFunction$4(g)&&(f=g.bind(a.api))}var p=this.tick[c],m=mergeObj({outerTick:n,noTransition:i,config:o,id:e,tickTextRotate:h,owner:a},l&&{isCategory:u,isInverted:o.axis_x_inverted,tickMultiline:o.axis_x_tick_multiline,tickWidth:o.axis_x_tick_width,tickTitle:u&&o.axis_x_tick_tooltip&&a.api.categories(),orgXScale:a.scale.x});l||(m.tickStepSize=o["axis_".concat(c,"_tick_stepSize")]);var v=new AxisRenderer(m).scale(l&&a.scale.zoom||r).orient(d);if(l&&this.isTimeSeries()&&p&&!isFunction$4(p)){var _=parseDate.bind(a);p=p.map(function(C){return _(C)})}else!l&&this.isTimeSeriesY()&&(v.ticks(o.axis_y_tick_time_value),p=null);p&&v.tickValues(p),v.tickFormat(f||!l&&a.isStackNormalized()&&function(C){return"".concat(C,"%")}),u&&(v.tickCentered(o.axis_x_tick_centered),isEmpty$1(o.axis_x_tick_culling)&&(o.axis_x_tick_culling=!1));var b=o["axis_".concat(c,"_tick_count")];return b&&v.ticks(b),v},t.prototype.updateXAxisTickValues=function(e,r){var n,i=this.owner,s=i.config,a=s.axis_x_tick_fit,o=s.axis_x_tick_count,l;return(a||o&&a)&&(l=i.mapTargetsToUniqueXs(e),this.isCategorized()&&o>l.length&&(o=l.length),l=this.generateTickValues(l,o,this.isTimeSeries())),r?r.tickValues(l):this.x&&(this.x.tickValues(l),(n=this.subX)===null||n===void 0||n.tickValues(l)),l},t.prototype.getId=function(e){var r=this.owner,n=r.config,i=r.scale,s=n.data_axes[e];return(!s||!i[s])&&(s="y"),s},t.prototype.getXAxisTickFormat=function(e){var r=this.owner,n=r.config,i=r.format,s=e&&n.subchart_axis_x_tick_format||n.axis_x_tick_format,a=this.isTimeSeries(),o=this.isCategorized(),l;return s?isFunction$4(s)?l=s.bind(r.api):a&&(l=function(c){return c?i.axisTime(s)(c):""}):l=a?i.defaultAxisTime:o?r.categoryName:function(c){return c<0?c.toFixed(0):c},isFunction$4(l)?function(c){return l.apply(r,o?[c,r.categoryName(c)]:[c])}:l},t.prototype.getTickValues=function(e){var r=this.owner,n=r.config["axis_".concat(e,"_tick_values")],i=r["".concat(e,"Axis")];return(isFunction$4(n)?n.call(r.api):n)||(i?i.tickValues():void 0)},t.prototype.getLabelOptionByAxisId=function(e){return this.owner.config["axis_".concat(e,"_label")]},t.prototype.getLabelText=function(e){var r=this.getLabelOptionByAxisId(e);return isString$2(r)?r:r?r.text:null},t.prototype.setLabelText=function(e,r){var n=this.owner,i=n.config,s=this.getLabelOptionByAxisId(e);isString$2(s)?i["axis_".concat(e,"_label")]=r:s&&(s.text=r)},t.prototype.getLabelPosition=function(e,r){var n=this.owner.config.axis_rotated,i=this.getLabelOptionByAxisId(e),s=isObjectType(i)&&i.position?i.position:r[+!n],a=function(o){return!!~s.indexOf(o)};return{isInner:a("inner"),isOuter:a("outer"),isLeft:a("left"),isCenter:a("center"),isRight:a("right"),isTop:a("top"),isMiddle:a("middle"),isBottom:a("bottom")}},t.prototype.getAxisLabelPosition=function(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])},t.prototype.getLabelPositionById=function(e){return this.getAxisLabelPosition(e)},t.prototype.xForAxisLabel=function(e){var r=this.owner,n=r.state,i=n.width,s=n.height,a=this.getAxisLabelPosition(e),o=a.isMiddle?-s/2:0;return this.isHorizontal(r,e!=="x")?o=a.isLeft?0:a.isCenter?i/2:i:a.isBottom&&(o=-s),o},t.prototype.dxForAxisLabel=function(e){var r=this.owner,n=this.getAxisLabelPosition(e),i=n.isBottom?"0.5em":"0";return this.isHorizontal(r,e!=="x")?i=n.isLeft?"0.5em":n.isRight?"-0.5em":"0":n.isTop&&(i="-0.5em"),i},t.prototype.textAnchorForAxisLabel=function(e){var r=this.owner,n=this.getAxisLabelPosition(e),i=n.isMiddle?"middle":"end";return this.isHorizontal(r,e!=="x")?i=n.isLeft?"start":n.isCenter?"middle":"end":n.isBottom&&(i="start"),i},t.prototype.dyForAxisLabel=function(e){var r=this.owner,n=r.config,i=n.axis_rotated,s=this.getAxisLabelPosition(e).isInner,a=n["axis_".concat(e,"_tick_rotate")]?r.getHorizontalAxisHeight(e):0,o=this.getMaxTickSize(e).width,l;if(e==="x"){var c=n.axis_x_height;i?l=s?"1.2em":-25-o:s?l="-0.5em":c?l=c-10:a?l=a-10:l="3em"}else l={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],i?s?l=l[0]:a?l=a*(e==="y2"?-1:1)-l[1]:l=l[2]:l=s?l[3]:(l[4]+(n["axis_".concat(e,"_inner")]?0:o+l[4]))*(e==="y"?-1:1);return l},t.prototype.getMaxTickSize=function(e,r){var n=this.owner,i=n.config,s=n.state.current,a=n.$el,o=a.svg,l=a.chart,c=s.maxTickSize[e],u="axis_".concat(e),d={width:0,height:0};if(r||!i["".concat(u,"_show")]||c.width>0&&n.filterTargetsToShow().length===0)return c;if(o){var h=/^y2?$/.test(e),f=n.filterTargetsToShow(n.data.targets),g=n.scale[e].copy().domain(n["get".concat(h?"Y":"X","Domain")](f,e)),p=g.domain(),m=p[0]===p[1]&&p.every(function(A){return A>0}),v=isArray$7(c.domain)&&c.domain[0]===c.domain[1]&&c.domain.every(function(A){return A>0});if(m||v)return c.size;c.domain=p,h||c.ticks.splice(0);var _=this.getAxis(e,g,!1,!1,!0),b=i["".concat(u,"_tick_rotate")],C=i["".concat(u,"_tick_count")],S=i["".concat(u,"_tick_values")];!S&&C&&_.tickValues(this.generateTickValues(p,C,h?this.isTimeSeriesY():this.isTimeSeries())),!h&&this.updateXAxisTickValues(f,_);var w=l.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0");_.create(w),w.selectAll("text").attr("transform",isNumber$2(b)?"rotate(".concat(b,")"):null).each(function(A,O){var T=this.getBoundingClientRect(),H=T.width,k=T.height;d.width=Math.max(d.width,H),d.height=Math.max(d.height,k),h||(c.ticks[O]=H)}),w.remove()}return Object.keys(d).forEach(function(A){d[A]>0&&(c[A]=d[A])}),c},t.prototype.getXAxisTickTextY2Overflow=function(e){var r=this.owner,n=r.axis,i=r.config,s=r.state,a=r.getAxisTickRotate("x"),o=a>0&&a<90;if((n.isCategorized()||n.isTimeSeries())&&i.axis_x_tick_fit&&(!i.axis_x_tick_culling||isEmpty$1(i.axis_x_tick_culling))&&!i.axis_x_tick_multiline&&o){var l=s.current.width-r.getCurrentPaddingByDirection("left"),c=this.getXAxisTickMaxOverflow(a,l-e),u=Math.max(0,c)+e;return Math.min(u,l/2)}return 0},t.prototype.getXAxisTickMaxOverflow=function(e,r){for(var n=this.owner,i=n.axis,s=n.config,a=n.state,o=i.isTimeSeries(),l=a.current.maxTickSize.x.ticks,c=l.length,u=a.axis.x.padding,d=u.left,h=u.right,f=0,g=c-(o&&s.axis_x_tick_fit?.5:0),p=0;p<c;p++){var m=p+1,v=Math.cos(Math.PI*e/180)*l[p],_=m-(o?1:.5)+d;if(!(_<=0)){var b=r-v,C=b/_,S=g-m,w=h*C,A=S*C+w,O=v-C/2-A;f=Math.max(f,O)}}var T=n.filterTargetsToShow(n.data.targets),H=0;if(!o&&s.axis_x_tick_count<=T.length&&T[0].values.length){var k=getScale(n.axis.getAxisType("x"),0,r-f).domain([d*-1,n.getXDomainMax(n.data.targets)+1+h]);H=Math.ceil((k(1)-k(0))/2)}return f+H},t.prototype.updateLabels=function(e){var r=this,n=this.owner,i=n.$el.main,s=n.$T,a={x:i.select(".".concat($AXIS.axisX," .").concat($AXIS.axisXLabel)),y:i.select(".".concat($AXIS.axisY," .").concat($AXIS.axisYLabel)),y2:i.select(".".concat($AXIS.axisY2," .").concat($AXIS.axisY2Label))};Object.keys(a).filter(function(o){return!a[o].empty()}).forEach(function(o){var l=a[o];s(l,e).attr("x",function(){return r.xForAxisLabel(o)}).attr("dx",function(){return r.dxForAxisLabel(o)}).attr("dy",function(){return r.dyForAxisLabel(o)}).text(function(){return r.getLabelText(o)})})},t.prototype.getPadding=function(e,r,n,i){var s=isNumber$2(e)?e:e[r];return isValue(s)?this.owner.convertPixelToScale(/(bottom|top)/.test(r)?"y":"x",s,i):n},t.prototype.generateTickValues=function(e,r,n){var i=e;if(r){var s=isFunction$4(r)?r():r;if(s===1)i=[e[0]];else if(s===2)i=[e[0],e[e.length-1]];else if(s>2){var a=this.isCategorized(),o=s-2,l=e[0],c=e[e.length-1],u=(c-l)/(o+1),d=void 0;i=[l];for(var h=0;h<o;h++)d=+l+u*(h+1),i.push(n?new Date(d):a?Math.round(d):d);i.push(c)}}return n||(i=i.sort(function(f,g){return f-g})),i},t.prototype.generateTransitions=function(e){var r=this.owner,n=r.$el.axis,i=r.$T,s=["x","y","y2","subX"].map(function(u){return i(n[u],e)}),a=s[0],o=s[1],l=s[2],c=s[3];return{axisX:a,axisY:o,axisY2:l,axisSubX:c}},t.prototype.redraw=function(e,r,n){var i=this,s=this.owner,a=s.config,o=s.$el,l=r?"0":null;["x","y","y2","subX"].forEach(function(c){var u=i[c],d=o.axis[c];u&&d&&(!n&&!a.transition_duration&&(u.config.withoutTransition=!0),d.style("opacity",l),u.create(e["axis".concat(capitalize(c))]))}),this.updateAxes()},t.prototype.redrawAxis=function(e,r,n,i,s){var a=this,o,l,c,u=this.owner,d=u.config,h=u.scale,f=u.$el,g=!!h.zoom,p;!g&&this.isCategorized()&&e.length===0&&h.x.domain([0,f.axis.x.selectAll(".tick").size()]),h.x&&e.length?(!g&&u.updateXDomain(e,r.UpdateXDomain,r.UpdateOrgXDomain,r.TrimXDomain),d.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(o=this.subX)===null||o===void 0||o.tickValues([])),d.zoom_rescale&&!i&&(p=h.x.orgDomain()),["y","y2"].forEach(function(m){var v="axis_".concat(m,"_"),_=h[m];if(_){var b=d["".concat(v,"tick_values")],C=d["".concat(v,"tick_count")];if(_.domain(u.getYDomain(e,m,p)),!b&&C){var S=u.axis[m],w=_.domain();S.tickValues(a.generateTickValues(w,w.every(function(A){return A===0})?1:C,a.isTimeSeriesY()))}}}),this.redraw(n,u.hasArcType(),s),this.updateLabels(r.Transition),(r.UpdateXDomain||r.UpdateXAxis||r.Y)&&e.length&&this.setCulling(),r.Y&&((l=h.subY)===null||l===void 0||l.domain(u.getYDomain(e,"y")),(c=h.subY2)===null||c===void 0||c.domain(u.getYDomain(e,"y2")))},t.prototype.setCulling=function(){var e=this.owner,r=e.config,n=e.state,i=n.clip,s=n.current,a=e.$el;["subX","x","y","y2"].forEach(function(o){var l=a.axis[o],c=o==="subX"?"x":o,u="axis_".concat(c,"_tick_culling"),d=r[u];if(l&&d){var h=l.selectAll(".tick"),f=sortValue(h.data()),g=f.length,p=r["".concat(u,"_max")],m=r["".concat(u,"_lines")],v;if(g){for(var _=1;_<g;_++)if(g/_<p){v=_;break}h.each(function(C){var S=m?this.querySelector("text"):this;S&&(S.style.display=f.indexOf(C)%v?"none":null)})}else h.style("display",null);if(o==="x"){var b=s.maxTickSize.x.clipPath?i.pathXAxisTickTexts:null;a.svg.selectAll(".".concat($AXIS.axisX," .tick text")).attr("clip-path",b)}}})},t}(),eventrect={initEventRect:function(){var t=this;t.$el.main.select(".".concat($COMMON.chart)).append("g").attr("class",$EVENT.eventRects).style("fill-opacity","0")},redrawEventRect:function(){var t,e=this,r=e.config,n=e.state,i=e.$el,s=e.isMultipleX(),a=r.axis_x_inverted;if(i.eventRect)e.updateEventRect(i.eventRect,!0);else if(e.data.targets.length){var o=e.$el.main.select(".".concat($EVENT.eventRects)).style("cursor",r.zoom_enabled&&r.zoom_type!=="drag"?r.axis_rotated?"ns-resize":"ew-resize":null).classed($EVENT.eventRectsMultiple,s).classed($EVENT.eventRectsSingle,!s),l=o.selectAll(".".concat($EVENT.eventRect)).data([0]).enter().append("rect");e.updateEventRect(l),s?e.generateEventRectsForMultipleXs(l):e.generateEventRectsForSingleX(l),l.call(e.getDraggableSelection()),i.eventRect=l,e.state.inputType==="touch"&&!i.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(),n.rendered&&e.updateEventRect(i.eventRect,!0)}if(!s){var c=e.getMaxDataCountTarget();(!r.data_xSort||a)&&c.sort(function(u,d){return a?d.x-u.x:u.x-d.x}),e.updateDataIndexByX(c),e.updateXs(c),(t=e.updatePointClass)===null||t===void 0||t.call(e,!0),n.eventReceiver.data=c}e.updateEventRectData()},bindTouchOnEventRect:function(){var t=this,e=t.config,r=t.state,n=t.$el,i=n.eventRect,s=n.svg,a=function(f){if(t.isMultipleX())t.selectRectForMultipleXs(f);else{var g=t.getDataIndexFromEvent(r.event);t.callOverOutForTouch(g),g===-1?t.unselectRect():t.selectRectForSingle(f,g)}},o=function(){t.unselectRect(),t.callOverOutForTouch()},l=e.interaction_inputType_touch.preventDefault,c=isboolean(l)&&l||!1,u=!isNaN(l)&&l||null,d,h=function(f){var g=f.type,p=f.changedTouches[0],m=p["client".concat(e.axis_rotated?"Y":"X")];g==="touchstart"?c?f.preventDefault():u!==null&&(d=m):g==="touchmove"&&(c||d===!0||u!==null&&Math.abs(d-m)>=u)&&(d=!0,f.preventDefault())};i.on("touchstart",function(f){r.event=f,t.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",function(f){if(r.event=f,!i.empty()&&i.classed($EVENT.eventRect)){if(r.dragging||r.flowing||t.hasArcType()||f.touches.length>1)return;h(f),a(i.node())}else o()},!0).on("touchend.eventRect",function(f){r.event=f,!i.empty()&&i.classed($EVENT.eventRect)&&(t.hasArcType()||!t.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)},!0),s.on("touchstart",function(f){r.event=f;var g=f.target;g&&g!==i.node()&&o()})},updateEventRect:function(t,e){e===void 0&&(e=!1);var r=this,n=r.state,i=r.$el,s=n.eventReceiver,a=n.width,o=n.height,l=n.rendered,c=n.resizing,u=t||i.eventRect,d=function(){s&&(s.rect=u.node().getBoundingClientRect())};(!l||c||e)&&(u.attr("x",0).attr("y",0).attr("width",a).attr("height",o),(!l||e)&&u.classed($EVENT.eventRect,!0)),d()},updateEventRectData:function(){var t=this,e=t.config,r=t.scale,n=t.state,i=r.zoom||r.x,s=e.axis_rotated,a,o,l,c;if(t.isMultipleX())a=0,o=0,l=n.width,c=n.height;else{var u,d=void 0;if(t.axis.isCategorized())u=t.getEventRectWidth(),d=function(p){return i(p.x)-u/2};else{var h=function(p){var m=p.index;return{prev:t.getPrevX(m),next:t.getNextX(m)}};u=function(p){var m=h(p),v=i.domain(),_;return m.prev===null&&m.next===null?_=s?n.height:n.width:m.prev===null?_=(i(m.next)+i(p.x))/2:m.next===null?_=i(v[1])-(i(m.prev)+i(p.x))/2:(Object.keys(m).forEach(function(b,C){var S;m[b]=(S=m[b])!==null&&S!==void 0?S:v[C]}),_=Math.max(0,(i(m.next)-i(m.prev))/2)),_},d=function(p){var m=h(p),v;return m.prev===null&&m.next===null?v=0:m.prev===null?v=i(i.domain()[0]):v=(i(p.x)+i(m.prev))/2,v}}a=s?0:d,o=s?d:0,l=s?n.width:u,c=s?u:n.height}var f=n.eventReceiver,g=function(p,m){return isFunction$4(p)?p(m):p};f.coords.splice(f.data.length),f.data.forEach(function(p,m){f.coords[m]={x:g(a,p),y:g(o,p),w:g(l,p),h:g(c,p)}})},selectRectForSingle:function(t,e){var r,n,i=this,s=i.config,a=i.$el,o=a.main,l=a.circle,c=s.data_selection_enabled,u=s.data_selection_grouped,d=s.data_selection_isselectable,h=s.tooltip_grouped,f=i.getAllValuesOnIndex(e);if(!(h&&(i.showTooltip(f,t),(r=i.showGridFocus)===null||r===void 0||r.call(i,f),!c||u))){!l&&o.selectAll(".".concat($COMMON.EXPANDED,":not(.").concat($SHAPE.shape,"-").concat(e,")")).classed($COMMON.EXPANDED,!1);var g=o.selectAll(".".concat($SHAPE.shape,"-").concat(e)).classed($COMMON.EXPANDED,!0).style("cursor",d?"pointer":null).filter(function(p){return i.isWithinShape(this,p)});g.empty()&&!h&&((n=i.hideGridFocus)===null||n===void 0||n.call(i),i.hideTooltip(),!u&&i.setExpand(e)),g.call(function(p){var m,v,_=p.data();c&&(u||d!=null&&d.bind(i.api)(_))&&(t.style.cursor="pointer"),h||(i.showTooltip(_,t),(m=i.showGridFocus)===null||m===void 0||m.call(i,_),(v=i.unexpandCircles)===null||v===void 0||v.call(i),p.each(function(b){return i.setExpand(e,b.id)}))})}},selectRectForMultipleXs:function(t,e){e===void 0&&(e=!0);var r=this,n=r.config,i=r.state,s=r.filterTargetsToShow(r.data.targets);if(!(i.dragging||r.hasArcType(s))){var a=getPointer$1(i.event,t),o=r.findClosestFromTargets(s,a);if(e&&i.mouseover&&(!o||o.id!==i.mouseover.id)&&(n.data_onout.call(r.api,i.mouseover),i.mouseover=void 0),!o){r.unselectRect();return}var l=r.isBubbleType(o)||r.isScatterType(o)||!n.tooltip_grouped?[o]:r.filterByX(s,o.x),c=l.map(function(d){return r.addName(d)});r.showTooltip(c,t),r.setExpand(o.index,o.id,!0),r.showGridFocus(c);var u=r.dist(o,a);(r.isBarType(o.id)||u<r.getPointSensitivity(o))&&(r.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor","pointer"),e&&!i.mouseover&&(n.data_onover.call(r.api,o),i.mouseover=o))}},unselectRect:function(){var t=this,e=t.$el,r=e.circle,n=e.tooltip;t.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor",null),t.hideGridFocus(),n&&(t.hideTooltip(),t._handleLinkedCharts(!1)),r&&!t.isPointFocusOnly()&&t.unexpandCircles(),t.expandBarTypeShapes(!1)},generateEventRectsForSingleX:function(t){var e=this,r=e.config,n=e.state,i=n.eventReceiver,s=t.style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("click",function(o){n.event=o;var l=i.currentIdx,c=i.data,u=c[l===-1?e.getDataIndexFromEvent(o):l];e.clickHandlerForSingleX.bind(this)(u,e)});if(n.inputType==="mouse"){var a=function(o){var l=o?e.getDataIndexFromEvent(o):i.currentIdx;return l>-1?i.data[l]:null};s.on("mouseover",function(o){n.event=o,e.updateEventRect()}).on("mousemove",function(o){var l=a(o);if(n.event=o,!!l){var c=l.index,u=r.line_step_type;if(r.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(u)){var d=e.scale.zoom||e.scale.x,h=e.axis.xs[c],f=d.invert(getPointer$1(o,this)[0]);u==="step-after"&&f<h?c-=1:u==="step-before"&&f>h&&(c+=1)}var g=r.tooltip_grouped&&c===i.currentIdx;if(n.dragging||n.flowing||e.hasArcType()||g){r.tooltip_show&&g&&e.setTooltipPosition();return}c!==i.currentIdx&&(e.setOverOut(!1,i.currentIdx),i.currentIdx=c),c===-1?e.unselectRect():e.selectRectForSingle(this,c),e.setOverOut(c!==-1,c)}}).on("mouseout",function(o){n.event=o,!(!r||e.hasArcType()||i.currentIdx===-1)&&(e.unselectRect(),e.setOverOut(!1,i.currentIdx),i.currentIdx=-1)})}return s},clickHandlerForSingleX:function(t,e){var r=e,n=r.config,i=r.state,s=r.$el.main;if(!t||r.hasArcType()||i.cancelClick){i.cancelClick&&(i.cancelClick=!1);return}var a=t.index;s.selectAll(".".concat($SHAPE.shape,"-").concat(a)).each(function(o){var l;(n.data_selection_grouped||r.isWithinShape(this,o))&&((l=r.toggleShape)===null||l===void 0||l.call(r,this,o,a),n.data_onclick.bind(r.api)(o,this))})},generateEventRectsForMultipleXs:function(t){var e=this,r=e.state;t.on("click",function(n){r.event=n,e.clickHandlerForMultipleXS.bind(this)(e)}),r.inputType==="mouse"&&t.on("mouseover mousemove",function(n){r.event=n,e.selectRectForMultipleXs(this)}).on("mouseout",function(n){r.event=n,!(!e.config||e.hasArcType())&&e.unselectRect()})},clickHandlerForMultipleXS:function(t){var e=t,r=e.config,n=e.state,i=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(i)){var s=getPointer$1(n.event,this),a=e.findClosestFromTargets(i,s),o=r.point_sensitivity==="radius"?a.r:r.point_sensitivity;a&&(e.isBarType(a.id)||e.dist(a,s)<o)&&e.$el.main.selectAll(".".concat($SHAPE.shapes).concat(e.getTargetSelectorSuffix(a.id))).selectAll(".".concat($SHAPE.shape,"-").concat(a.index)).each(function(){var l;(r.data_selection_grouped||e.isWithinShape(this,a))&&((l=e.toggleShape)===null||l===void 0||l.call(e,this,a,a.index),r.data_onclick.bind(e.api)(a,this))})}}},flow={generateFlow:function(t){var e=this,r=e.data,n=e.state,i=e.$el;return function(){var s=t.flow.length;n.flowing=!0,r.targets.forEach(function(o){o.values.splice(0,s)}),e.updateXGrid&&e.updateXGrid(!0);var a={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(function(o){var l=o.split("."),c=i[l[0]];c&&l.length>1&&(c=c[l[1]]),c!=null&&c.size()&&(a[o]=c)}),e.hideGridFocus(),e.setFlowList(a,t)}},setFlowList:function(t,e){var r=this,n=e.flow,i=e.targets,s=n.duration,a=s===void 0?e.duration:s,o=n.index,l=n.length,c=n.orgDataCount,u=r.getFlowTransform(i,c,o,l),d=generateWait(),h;d.add(Object.keys(t).map(function(f){return h=t[f].transition().ease(linear$1).duration(a),f==="axis.x"?h=h.call(function(g){r.axis.x.setTransition(g).create(g)}):f==="region.list"?h=h.filter(r.isRegionOnX).attr("transform",u):h=h.attr("transform",u),h})),h.call(d,function(){r.cleanUpFlow(t,e)})},cleanUpFlow:function(t,e){var r=this,n=r.config,i=r.state,s=r.$el.svg,a=n.axis_rotated,o=e.flow,l=e.shape,c=e.xv,u=l.pos,d=u.cx,h=u.cy,f=u.xForText,g=u.yForText,p=o.done,m=p===void 0?function(){}:p,v=o.length;v&&(["circle","text","shape","eventRect"].forEach(function(_){for(var b=[],C=0;C<v;C++)b.push(".".concat(CLASS[_],"-").concat(C));s.selectAll(".".concat(CLASS["".concat(_,"s")])).selectAll(b).remove()}),s.select(".".concat(CLASS.xgrid)).remove()),Object.keys(t).forEach(function(_){var b=t[_];if(_!=="axis.x"&&b.attr("transform",null),_==="grid.x")b.attr(i.xgridAttr);else if(_==="gridLines.x")b.attr("x1",a?0:c).attr("x2",a?i.width:c),b.select("text").attr("x",a?i.width:0).attr("y",c);else if(/^(area|bar|line)$/.test(_))b.attr("d",l.type[_]);else if(_==="text")b.attr("x",f).attr("y",g).style("fill-opacity",r.opacityForText.bind(r));else if(_==="circle")if(r.isCirclePoint())b.attr("cx",d).attr("cy",h);else{var C=function(w){return d(w)-n.point_r},S=function(w){return h(w)-n.point_r};b.attr("x",C).attr("y",S)}else _==="region.list"&&b.select("rect").filter(r.isRegionOnX).attr("x",r.regionX.bind(r)).attr("width",r.regionWidth.bind(r))}),n.interaction_enabled&&r.redrawEventRect(),m.call(r.api),i.flowing=!1},getFlowTransform:function(t,e,r,n){var i=this,s=i.data,a=i.scale.x,o=s.targets[0].values,l=i.getValueOnIndex(o,r),c=i.getValueOnIndex(o,r+n),u,d=a.domain(),h=i.updateXDomain(t,!0,!0);e?e===1||(l==null?void 0:l.x)===(c==null?void 0:c.x)?u=a(d[0])-a(h[0]):u=i.axis.isTimeSeries()?a(d[0])-a(h[0]):a((l==null?void 0:l.x)||0)-a(c.x):o.length!==1?u=a(d[0])-a(h[0]):i.axis.isTimeSeries()?(l=i.getValueOnIndex(o,0),c=i.getValueOnIndex(o,o.length-1),u=a(l.x)-a(c.x)):u=diffDomain(h)/2;var f=diffDomain(d)/diffDomain(h);return"translate(".concat(u,",0) scale(").concat(f,",1)")}},clip={initClip:function(){var t=this,e=t.state,r=e.clip,n=e.datetimeId;r.id="".concat(n,"-clip"),r.idXAxis="".concat(r.id,"-xaxis"),r.idYAxis="".concat(r.id,"-yaxis"),r.idGrid="".concat(r.id,"-grid"),r.path=t.getClipPath(r.id),r.pathXAxis=t.getClipPath(r.idXAxis),r.pathYAxis=t.getClipPath(r.idYAxis),r.pathGrid=t.getClipPath(r.idGrid)},getClipPath:function(t){var e=this,r=e.config;if(!r.clipPath&&/-clip$/.test(t)||!r.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!r.axis_y_clipPath&&/-clip-yaxis$/.test(t))return null;var n=win.navigator?win.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0:!1;return"url(".concat(n?"":doc.URL.split("#")[0],"#").concat(t,")")},appendClip:function(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath:function(t){var e=this,r=e.config,n=e.state,i=n.margin,s=n.width,a=n.height,o=r.axis_rotated,l=Math.max(30,i.left)-(o?0:20),c=(o?i.top+a+10:i.bottom)+20,u=o?-(1+l):-(l-1),d=-15,h=o?i.left+20:s+10+l;t.attr("x",u).attr("y",d).attr("width",h).attr("height",c)},setYAxisClipPath:function(t){var e=this,r=e.config,n=e.state,i=n.margin,s=n.width,a=n.height,o=r.axis_rotated,l=Math.max(30,i.left)-(o?20:0),c=r.axis_y_inner,u=c&&!o?r.axis_y_label.text?-20:-1:o?-(1+l):-(l-1),d=-(o?20:i.top),h=(o?s+15+l:i.left+20)+(c?20:0),f=(o?i.bottom+10:i.top+a)+10;t.attr("x",u).attr("y",d).attr("width",h).attr("height",f)},updateXAxisTickClip:function(){var t=this,e=t.config,r=t.state,n=r.clip,i=r.xAxisHeight,s=t.$el.defs,a=t.getHorizontalAxisHeight("x");if(s&&!n.idXAxisTickTexts){var o="".concat(n.id,"-xaxisticktexts");t.appendClip(s,o),n.pathXAxisTickTexts=t.getClipPath(n.idXAxisTickTexts),n.idXAxisTickTexts=o}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&a!==i&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=a},setXAxisTickClipWidth:function(){var t=this,e=t.config,r=t.state.current.maxTickSize,n=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&n){var i=Math.sin(Math.PI/180*Math.abs(n));r.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/i}else r.x.clipPath=null},setXAxisTickTextClipPathWidth:function(){var t=this,e=t.state,r=e.clip,n=e.current,i=t.$el.svg;i&&i.select("#".concat(r.idXAxisTickTexts," rect")).attr("width",n.maxTickSize.x.clipPath).attr("height",30)}},getGridTextAnchor=function(t){return isValue(t.position)||"end"},getGridTextDx=function(t){return t.position==="start"?4:t.position==="middle"?0:-4};function getGridTextX(t,e,r){return function(n){var i=t?0:e;return n.position==="start"?i=t?-r:0:n.position==="middle"&&(i=(t?-r:e)/2),i}}function smoothLines(t,e){e==="grid"&&t.each(function(){var r=select(this);["x1","x2","y1","y2"].forEach(function(n){return r.attr(n,Math.ceil(+r.attr(n)))})})}var grid={hasGrid:function(){var t=this.config;return["x","y"].some(function(e){return t["grid_".concat(e,"_show")]||t["grid_".concat(e,"_lines")].length})},initGrid:function(){var t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines:function(){var t=this,e=t.config,r=t.state.clip,n=t.$el;(e.grid_x_lines.length||e.grid_y_lines.length)&&(n.gridLines.main=n.main.insert("g",".".concat($COMMON.chart).concat(e.grid_lines_front?" + *":"")).attr("clip-path",r.pathGrid).attr("class","".concat($GRID.grid," ").concat($GRID.gridLines)),n.gridLines.main.append("g").attr("class",$GRID.xgridLines),n.gridLines.main.append("g").attr("class",$GRID.ygridLines),n.gridLines.x=selectAll([]))},updateXGrid:function(t){var e=this,r=e.config,n=e.scale,i=e.state,s=e.$el,a=s.main,o=s.grid,l=r.axis_rotated,c=e.generateGridData(r.grid_x_type,n.x),u=e.axis.isCategorized()?e.axis.x.tickOffset():0,d=function(h){return(n.zoom||n.x)(h)+u*(l?-1:1)};i.xgridAttr=l?{x1:0,x2:i.width,y1:d,y2:d}:{x1:d,x2:d,y1:0,y2:i.height},o.x=a.select(".".concat($GRID.xgrids)).selectAll(".".concat($GRID.xgrid)).data(c),o.x.exit().remove(),o.x=o.x.enter().append("line").attr("class",$GRID.xgrid).merge(o.x),t||o.x.each(function(){var h=select(this);Object.keys(i.xgridAttr).forEach(function(f){h.attr(f,i.xgridAttr[f]).style("opacity",function(){return h.attr(l?"y1":"x1")===(l?i.height:0)?"0":null})})})},updateYGrid:function(){var t=this,e=t.axis,r=t.config,n=t.scale,i=t.state,s=t.$el,a=s.grid,o=s.main,l=r.axis_rotated,c=function(d){return Math.ceil(n.y(d))},u=e.y.getGeneratedTicks(r.grid_y_ticks)||t.scale.y.ticks(r.grid_y_ticks);a.y=o.select(".".concat($GRID.ygrids)).selectAll(".".concat($GRID.ygrid)).data(u),a.y.exit().remove(),a.y=a.y.enter().append("line").attr("class",$GRID.ygrid).merge(a.y),a.y.attr("x1",l?c:0).attr("x2",l?c:i.width).attr("y1",l?0:c).attr("y2",l?i.height:c),smoothLines(a.y,"grid")},updateGrid:function(){var t=this,e=t.$el,r=e.grid,n=e.gridLines;!n.main&&t.initGridLines(),r.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateGridLines("x"),t.updateGridLines("y")},updateGridLines:function(t){var e=this,r=e.config,n=e.$el,i=n.gridLines,s=n.main,a=e.$T,o=r.axis_rotated,l=t==="x";r["grid_".concat(t,"_show")]&&e["update".concat(t.toUpperCase(),"Grid")]();var c=s.select(".".concat($GRID["".concat(t,"gridLines")])).selectAll(".".concat($GRID["".concat(t,"gridLine")])).data(r["grid_".concat(t,"_lines")]);a(c.exit()).style("opacity","0").remove();var u=c.enter().append("g");u.append("line").style("opacity","0"),c=u.merge(c),c.each(function(d){var h=select(this);h.select("text").empty()&&d.text&&h.append("text").style("opacity","0")}),a(c.attr("class",function(d){return"".concat($GRID["".concat(t,"gridLine")]," ").concat(d.class||"").trim()}).select("text").attr("text-anchor",getGridTextAnchor).attr("transform",function(){return l?o?null:"rotate(-90)":o?"rotate(-90)":null}).attr("dx",getGridTextDx).attr("dy",-5)).text(function(d){var h;return(h=d.text)!==null&&h!==void 0?h:this.remove()}),i[t]=c},redrawGrid:function(t){var e=this,r=e.config.axis_rotated,n=e.state,i=n.width,s=n.height,a=e.$el.gridLines,o=e.$T,l=e.xv.bind(e),c=e.yv.bind(e),u=a.x.select("line"),d=a.x.select("text"),h=a.y.select("line"),f=a.y.select("text");return u=o(u,t).attr("x1",r?0:l).attr("x2",r?i:l).attr("y1",r?l:0).attr("y2",r?l:s),d=o(d,t).attr("x",getGridTextX(!r,i,s)).attr("y",l),h=o(h,t).attr("x1",r?c:0).attr("x2",r?c:i).attr("y1",r?0:c).attr("y2",r?s:c),f=o(f,t).attr("x",getGridTextX(r,i,s)).attr("y",c),[u.style("opacity",null),d.style("opacity",null),h.style("opacity",null),f.style("opacity",null)]},initFocusGrid:function(){var t=this,e=t.config,r=t.state.clip,n=t.$el,i=e.grid_front,s=".".concat(i&&n.gridLines.main?$GRID.gridLines:$COMMON.chart).concat(i?" + *":""),a=n.main.insert("g",s).attr("clip-path",r.pathGrid).attr("class",$GRID.grid);n.grid.main=a,e.grid_x_show&&a.append("g").attr("class",$GRID.xgrids),e.grid_y_show&&a.append("g").attr("class",$GRID.ygrids),e.interaction_enabled&&e.grid_focus_show&&(a.append("g").attr("class",$FOCUS.xgridFocus).append("line").attr("class",$FOCUS.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&a.append("g").attr("class",$FOCUS.ygridFocus).append("line").attr("class",$FOCUS.ygridFocus))},showGridFocus:function(t){var e,r=this,n=r.config,i=r.state,s=i.width,a=i.height,o=n.axis_rotated,l=r.$el.main.selectAll("line.".concat($FOCUS.xgridFocus,", line.").concat($FOCUS.ygridFocus)),c=(t||[l.datum()]).filter(function(h){return h&&isValue(r.getBaseValue(h))});if(!(!n.tooltip_show||c.length===0||r.hasType("bubble")||r.hasArcType())){var u=n.grid_focus_edge&&!n.tooltip_grouped,d=r.xx.bind(r);l.style("visibility",null).data(c.concat(c)).each(function(h){var f=select(this),g={x:d(h),y:r.getYScaleById(h.id)(h.value)},p;if(f.classed($FOCUS.xgridFocus))p=o?[null,g.x,u?g.y:s,g.x]:[g.x,u?g.y:null,g.x,a];else{var m=r.axis.getId(h.id)==="y2";p=o?[g.y,u&&!m?g.x:null,g.y,u&&m?g.x:a]:[u&&m?g.x:null,g.y,u&&!m?g.x:s,g.y]}["x1","y1","x2","y2"].forEach(function(v,_){return f.attr(v,p[_])})}),smoothLines(l,"grid"),(e=r.showCircleFocus)===null||e===void 0||e.call(r,t)}},hideGridFocus:function(){var t,e=this,r=e.state,n=r.inputType,i=r.resizing,s=e.$el.main;(n==="mouse"||!i)&&(s.selectAll("line.".concat($FOCUS.xgridFocus,", line.").concat($FOCUS.ygridFocus)).style("visibility","hidden"),(t=e.hideCircleFocus)===null||t===void 0||t.call(e))},updateGridFocus:function(){var t,e=this,r=e.state,n=r.inputType,i=r.width,s=r.height,a=r.resizing,o=e.$el.grid,l=o.main.select("line.".concat($FOCUS.xgridFocus));if(n==="touch")l.empty()?a&&((t=e.showCircleFocus)===null||t===void 0||t.call(e)):e.showGridFocus();else{var c=e.config.axis_rotated;l.attr("x1",c?0:-10).attr("x2",c?i:-10).attr("y1",c?-10:0).attr("y2",c?-10:s)}return!0},generateGridData:function(t,e){var r=this,n=r.$el.main.select(".".concat($AXIS.axisX)).selectAll(".tick").size(),i=[];if(t==="year")for(var s=r.getXDomain(),a=s.map(function(u){return u.getFullYear()}),o=a[0],l=a[1],c=o;c<=l;c++)i.push(new Date("".concat(c,"-01-01 00:00:00")));else i=e.ticks(10),i.length>n&&(i=i.filter(function(u){return String(u).indexOf(".")<0}));return i},getGridFilterToRemove:function(t){return t?function(e){var r=!1;return(isArray$7(t)?t.concat():[t]).forEach(function(n){("value"in n&&e.value===n.value||"class"in n&&e.class===n.class)&&(r=!0)}),r}:function(){return!0}},removeGridLines:function(t,e){var r=this,n=r.config,i=r.$T,s=r.getGridFilterToRemove(t),a=function(u){return!s(u)},o=e?$GRID.xgridLines:$GRID.ygridLines,l=e?$GRID.xgridLine:$GRID.ygridLine;i(r.$el.main.select(".".concat(o)).selectAll(".".concat(l)).filter(s)).style("opacity","0").remove();var c="grid_".concat(e?"x":"y","_lines");n[c]=n[c].filter(a)}},region={initRegion:function(){var t=this,e=t.$el;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",$REGION.regions)},updateRegion:function(){var t=this,e=t.config,r=t.$el.region,n=t.$T;r.main||t.initRegion(),r.main.style("visibility",t.hasArcType()?"hidden":null);var i=r.main.selectAll(".".concat($REGION.region)).data(e.regions);n(i.exit()).style("opacity","0").remove();var s=i.enter().append("g");s.append("rect").style("fill-opacity","0"),r.list=s.merge(i).attr("class",t.classRegion.bind(t)),r.list.each(function(a){var o,l=select(this);l.select("text").empty()&&(!((o=a.label)===null||o===void 0)&&o.text)&&select(this).append("text").style("opacity","0")})},redrawRegion:function(t){var e=this,r=e.$el.region,n=e.$T,i=r.list.select("rect"),s=r.list.selectAll("text");return i=n(i,t).attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),s=n(s,t).attr("transform",function(a){var o,l=(o=a.label)!==null&&o!==void 0?o:{},c=l.x,u=c===void 0?0:c,d=l.y,h=d===void 0?0:d,f=l.rotated,g=f===void 0?!1:f;return"translate(".concat(e.regionX.bind(e)(a)+u,", ").concat(e.regionY.bind(e)(a)+h,")").concat(g?" rotate(-90)":"")}).attr("text-anchor",function(a){var o;return!((o=a.label)===null||o===void 0)&&o.rotated?"end":null}).attr("dy","1em").style("fill",function(a){var o,l;return(l=(o=a.label)===null||o===void 0?void 0:o.color)!==null&&l!==void 0?l:null}).text(function(a){var o;return(o=a.label)===null||o===void 0?void 0:o.text}),[i.style("fill-opacity",function(a){return isValue(a.opacity)?a.opacity:null}).on("end",function(){select(this.parentNode).selectAll("rect:not([x])").remove()}),s.style("opacity",null)]},getRegionXY:function(t,e){var r=this,n=r.config,i=r.scale,s=n.axis_rotated,a=t==="x",o="start",l,c=0;return e.axis==="y"||e.axis==="y2"?(a||(o="end"),(a?s:!s)&&o in e&&(l=i[e.axis],c=l(e[o]))):(a?!s:s)&&o in e&&(l=i.zoom||i.x,c=l(r.axis.isTimeSeries()?parseDate.call(r,e[o]):e[o])),c},regionX:function(t){return this.getRegionXY("x",t)},regionY:function(t){return this.getRegionXY("y",t)},getRegionSize:function(t,e){var r=this,n=r.config,i=r.scale,s=r.state,a=n.axis_rotated,o=t==="width",l=r[o?"regionX":"regionY"](e),c,u="end",d=s[t];return e.axis==="y"||e.axis==="y2"?(o||(u="start"),(o?a:!a)&&u in e&&(c=i[e.axis],d=c(e[u]))):(o?!a:a)&&u in e&&(c=i.zoom||i.x,d=c(r.axis.isTimeSeries()?parseDate.call(r,e[u]):e[u])),d<l?0:d-l},regionWidth:function(t){return this.getRegionSize("width",t)},regionHeight:function(t){return this.getRegionSize("height",t)},isRegionOnX:function(t){return!t.axis||t.axis==="x"}},sizeAxis={getAxisSize:function(t){var e=this,r=e.config.axis_rotated;return r&&t==="x"||!r&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId:function(t,e){var r,n,i=this;if(i.axis){var s=(r=i.axis)===null||r===void 0?void 0:r.getLabelPositionById(t),a=i.axis.getMaxTickSize(t,e).width,o=a===0?.5:0;return a+(((n=i.config.padding)===null||n===void 0?void 0:n.mode)==="fit"?s.isInner?10+o:10:s.isInner?20+o:40)}else return 40},getHorizontalAxisHeight:function(t){var e,r,n=this,i=n.config,s=n.state,a=s.rotatedPadding,o=s.isLegendRight,l=s.isLegendInset,c=i.axis_rotated,u=((e=i.padding)===null||e===void 0?void 0:e.mode)==="fit",d=i["axis_".concat(t,"_inner")],h=i["axis_".concat(t,"_label")].text,f=13,g=((r=i.padding)===null||r===void 0?void 0:r.mode)==="fit"?d&&!h?t==="y"?1:0:20:30;if(t==="x"&&!i.axis_x_show)return 8;if(t==="x"&&isNumber$2(i.axis_x_height))return i.axis_x_height;if(t==="y"&&!i.axis_y_show)return i.legend_show&&!o&&!l?10:1;if(t==="y2"&&!i.axis_y2_show)return u?0:a.top;var p=n.axis.getMaxTickSize(t);return p.height>f&&(g+=p.height-f),g+(n.axis.getLabelPositionById(t).isInner?0:10)+(t==="y2"&&!c?-10:0)},getEventRectWidth:function(){var t=this,e=t.config,r=t.axis,n=e.axis_x_inverted,i=r.x.tickInterval();return Math.max(0,n?Math.abs(i):i)},getAxisTickRotate:function(t){var e=this,r=e.axis,n=e.config,i=e.state,s=e.$el,a=n["axis_".concat(t,"_tick_rotate")];if(t==="x"){var o=r.isCategorized()||r.isTimeSeries();if(n.axis_x_tick_fit&&o){var l=n.axis_x_tick_count,c=i.current.maxTickSize.x.ticks.length,u=0;if(l?u=l>c?c:l:c&&(u=c),u!==i.axis.x.tickCount){var d=e.data.targets;i.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(d,"min"),e.getXDomainMinMax(d,"max")],u)}i.axis.x.tickCount=u}s.svg&&n.axis_x_tick_autorotate&&n.axis_x_tick_fit&&!n.axis_x_tick_multiline&&!n.axis_x_tick_culling&&o&&(a=e.needToRotateXAxisTickTexts()?n.axis_x_tick_rotate:0)}return a},needToRotateXAxisTickTexts:function(){var t=this,e=t.state,r=e.axis,n=e.current,i=n.width-t.getCurrentPaddingByDirection("left")-t.getCurrentPaddingByDirection("right"),s=r.x.tickCount+r.x.padding.left+r.x.padding.right,a=t.axis.getMaxTickSize("x").width,o=s?i/s:0;return a>o}},optDataAxis={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1},x={axis_x_clipPath:!0,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_culling_lines:!0,axis_x_tick_count:void 0,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_inverted:!1,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},y={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},y2={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},optAxis=_assign(_assign(_assign({axis_rotated:!1},x),y),y2),optGrid={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},api=[apiAxis,apiCategory,apiFlow,apiGrid,apiGroup,apiRegion,apiX],internal=[axis,clip,eventrect,flow,grid,region,sizeAxis],options=[optDataAxis,optAxis,optGrid];function getRadiusFn(t){t===void 0&&(t=0);var e=this,r=e.config,n=e.state,i=e.hasMultiArcGauge(),s=n.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,a=t?Math.min(n.radiusExpanded*t-n.radius,s*.8-(1-t)*100):0;return{inner:function(o){var l=e.getRadius(o).innerRadius;return i?n.radius-s*(o.index+1):isNumber$2(l)?l:0},outer:function(o){var l=e.getRadius(o).outerRadius,c;if(i)c=n.radius-s*o.index+a;else if(e.hasType("polar")&&!t)c=e.getPolarOuterRadius(o,l);else if(c=l,t){var u=n.radiusExpanded;n.radius!==l&&(u-=Math.abs(n.radius-l)),c=u*t}return c},corner:function(o,l){var c=r.arc_cornerRadius_ratio,u=c===void 0?0:c,d=r.arc_cornerRadius,h=d===void 0?0:d,f=o.data.id,g=o.value,p=0;return u?p=u*l:p=isNumber$2(h)?h:h.call(e.api,f,g,l),p}}}function getAttrTweenFn(t){return function(e){var r=function(i){var s=i.startAngle,a=s===void 0?0:s,o=i.endAngle,l=o===void 0?0:o,c=i.padAngle,u=c===void 0?0:c;return{startAngle:a,endAngle:l,padAngle:u}},n=interpolate$1(r(this._current),r(e));return this._current=e,function(i){var s=n(i),a=e.data,o=e.index,l=e.value;return t(_assign(_assign({},s),{data:a,index:o,value:l}))}}}var shapeArc={initPie:function(){var t=this,e=t.config,r=e.data_type,n=e["".concat(r,"_padding")],i=e["".concat(r,"_startingAngle")]||0,s=(n?n*.01:e["".concat(r,"_padAngle")])||0;t.pie=pie$1().startAngle(i).endAngle(i+2*Math.PI).padAngle(s).value(function(a){return a.values.reduce(function(o,l){return o+l.value},0)}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius:function(){var t=this,e=t.config,r=t.state,n=e.data_type,i=e["".concat(n,"_padding")],s=e.gauge_width||e.donut_width,a=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;r.radiusExpanded=Math.min(r.arcWidth,r.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?.85:1),r.radius=r.radiusExpanded*.95,r.innerRadiusRatio=s?(r.radius-s)/r.radius:.6,r.gaugeArcWidth=s||(a<=r.radius-r.innerRadius?r.radius-r.innerRadius:a<=r.radius?a:r.radius);var o=e.pie_innerRadius||(i?i*(r.innerRadiusRatio+.1):0);r.outerRadius=e.pie_outerRadius,r.innerRadius=t.hasType("donut")||t.hasType("gauge")?r.radius*r.innerRadiusRatio:o},getRadius:function(t){var e=this,r=t==null?void 0:t.data,n=e.state,i=n.innerRadius,s=n.outerRadius;return!isNumber$2(i)&&r&&(i=i[r.id]||0),isObject$c(s)&&r&&r.id in s?s=s[r.id]:isNumber$2(s)||(s=e.state.radius),{innerRadius:i,outerRadius:s}},updateArc:function(){var t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength:function(){var t=this,e=t.config,r=e.gauge_arcLength*3.6,n=2*(r/360);return r<-360?n=-2:r>360&&(n=2),n*Math.PI},getGaugeStartAngle:function(){var t=this,e=t.config,r=e.gauge_fullCircle,n=-1*Math.PI/2,i=Math.PI/2,s=e.gauge_startingAngle;return!r&&s<=n?s=n:!r&&s>=i?s=i:(s>Math.PI||s<-1*Math.PI)&&(s=Math.PI),s},updateAngle:function(t){var e=this,r=e.config,n=e.state,i=e.pie,s=t,a=!1;if(!r)return null;var o=e.getGaugeStartAngle(),l=r.gauge_fullCircle?e.getArcLength():o*-2;if(s.data&&e.isGaugeType(s.data)&&!e.hasMultiArcGauge()){var c=r.gauge_min,u=r.gauge_max,d=e.getTotalDataSum(n.rendered),h=l*((d-c)/(u-c));i=i.startAngle(o).endAngle(h+o)}if(i(e.filterTargetsToShow()).forEach(function(v,_){var b;!a&&v.data.id===((b=s.data)===null||b===void 0?void 0:b.id)&&(a=!0,s=v,s.index=_)}),isNaN(s.startAngle)&&(s.startAngle=0),isNaN(s.endAngle)&&(s.endAngle=s.startAngle),s.data&&e.hasMultiArcGauge()){var f=r.gauge_min,g=r.gauge_max,p=l/(g-f),m=s.value<f?0:s.value<g?s.value-f:g-f;s.startAngle=o,s.endAngle=o+p*m}return a?s:null},getSvgArc:function(){var t=this,e=getRadiusFn.call(t),r=e.inner,n=e.outer,i=e.corner,s=arc().innerRadius(r).outerRadius(n),a=function(o,l){var c,u="M 0 0";if(o.value||o.data){var d=l?o:(c=t.updateAngle(o))!==null&&c!==void 0?c:null;d&&(u=s.cornerRadius(i(d,n(d)))(d))}return u};return a.centroid=s.centroid,a},getSvgArcExpanded:function(t){t===void 0&&(t=1);var e=this,r=getRadiusFn.call(e,t),n=r.inner,i=r.outer,s=r.corner,a=arc().innerRadius(n).outerRadius(i);return function(o){var l=e.updateAngle(o),c=i(l),u=0;return l&&(u=s(l,c)),l?a.cornerRadius(u)(l):"M 0 0"}},getArc:function(t,e,r){return r||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function(t){var e,r=this,n=r.config,i=r.state.radiusExpanded,s=r.updateAngle(t),a="";if(s){if(r.hasMultiArcGauge()){var o=Math.sin(s.endAngle-Math.PI/2),l=Math.cos(s.endAngle-Math.PI/2)*(i+25),c=o*(i+15-Math.abs(o*10))+3;a="translate(".concat(l,",").concat(c,")")}else if(!r.hasType("gauge")||r.data.targets.length>1){var u=r.getRadius(t).outerRadius;r.hasType("polar")&&(u=r.getPolarOuterRadius(t,u));var d=this.svgArc.centroid(s),h=d.map(function(v){return isNaN(v)?0:v}),l=h[0],c=h[1],f=Math.sqrt(l*l+c*c),g=(e=["donut","pie","polar"].filter(r.hasType.bind(r)).map(function(v){return n["".concat(v,"_label_ratio")]}))===null||e===void 0?void 0:e[0];g?g=isFunction$4(g)?g.bind(r.api)(t,u,f):g:g=u&&(f?(36/u>.375?1.175-36/u:.8)*u/f:0),a="translate(".concat(l*g,",").concat(c*g,")")}}return a},convertToArcData:function(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function(t){var e=this,r=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",e.updateTextBackgroundColor.bind(e)).each(function(n){var i,s=select(this),a=e.updateAngle(n),o=e.getRatio("arc",a),l=e.meetsLabelThreshold(o,(i=["donut","gauge","pie","polar"].filter(e.hasType.bind(e)))===null||i===void 0?void 0:i[0]);if(l){var c=(a||n).value,u=(e.getArcLabelFormat()||e.defaultArcValueFormat)(c,o,n.data.id).toString();setTextValue(s,u,[-1,1],r)}else s.text("")})},expandArc:function(t){var e=this,r=e.state.transiting,n=e.$el;if(r){var i=setInterval(function(){r||(clearInterval(i),n.legend.selectAll(".".concat($FOCUS.legendItemFocused)).size()>0&&e.expandArc(t))},10);return}var s=e.mapToTargetIds(t);n.svg.selectAll(e.selectorTargets(s,".".concat($ARC.chartArc))).each(function(a){if(e.shouldExpand(a.data.id)){var o=e.getExpandConfig(a.data.id,"duration"),l=e.getSvgArcExpanded(e.getExpandConfig(a.data.id,"rate"));select(this).selectAll("path").transition().duration(o).attrTween("d",getAttrTweenFn(e.svgArcExpanded.bind(e))).transition().duration(o*2).attrTween("d",getAttrTweenFn(l.bind(e)))}})},unexpandArc:function(t){var e=this,r=e.state.transiting,n=e.$el.svg;if(!r){var i=e.mapToTargetIds(t);n.selectAll(e.selectorTargets(i,".".concat($ARC.chartArc))).selectAll("path").transition().duration(function(s){return e.getExpandConfig(s.data.id,"duration")}).attrTween("d",getAttrTweenFn(e.svgArc.bind(e))),n.selectAll("".concat($ARC.arc)).style("opacity",null)}},getExpandConfig:function(t,e){var r=this,n=r.config,i={duration:50,rate:.98},s;return r.isDonutType(t)?s="donut":r.isGaugeType(t)?s="gauge":r.isPieType(t)&&(s="pie"),s?n["".concat(s,"_expand_").concat(e)]:i[e]},shouldExpand:function(t){var e=this,r=e.config;return e.isDonutType(t)&&r.donut_expand||e.isGaugeType(t)&&r.gauge_expand||e.isPieType(t)&&r.pie_expand},shouldShowArcLabel:function(){var t=this,e=t.config;return["donut","gauge","pie","polar"].some(function(r){return t.hasType(r)&&e["".concat(r,"_label_show")]})},getArcLabelFormat:function(){var t=this,e=t.config,r=function(n){return n};return["donut","gauge","pie","polar"].filter(t.hasType.bind(t)).forEach(function(n){r=e["".concat(n,"_label_format")]}),isFunction$4(r)?r.bind(t.api):r},updateTargetsForArc:function(t){var e=this,r=e.$el,n=e.hasType("gauge"),i=e.getChartClass("Arc"),s=e.getClass("arcs",!0),a=e.classFocus.bind(e),o=r.main.select(".".concat($ARC.chartArcs)),l=o.selectAll(".".concat($ARC.chartArc)).data(e.pie(t)).attr("class",function(u){return i(u)+a(u.data)}),c=l.enter().append("g").attr("class",i).call(this.setCssRule(!1,".".concat($ARC.chartArcs," text"),["pointer-events:none","text-anchor:middle"]));c.append("g").attr("class",s).merge(l),c.append("text").attr("dy",n&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",e.getStylePropValue("middle")).style("pointer-events",e.getStylePropValue("none")),r.text=o.selectAll(".".concat($COMMON.target," text"))},initArc:function(){var t=this,e=t.$el;e.arcs=e.main.select(".".concat($COMMON.chart)).append("g").attr("class",$ARC.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle:function(t){var e=this,r=t||e.getArcTitle(),n=e.hasType("gauge");if(r){var i=n?$GAUGE.chartArcsGaugeTitle:$ARC.chartArcsTitle,s=e.$el.arcs.select(".".concat(i));s.empty()&&(s=e.$el.arcs.append("text").attr("class",i).style("text-anchor","middle")),n&&s.attr("dy","-0.3em"),setTextValue(s,r,n?void 0:[-.6,1.35],!0)}},getArcTitle:function(){var t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config["".concat(e,"_title")]:""},getArcTitleWithNeedleValue:function(){var t=this,e=t.config,r=t.state,n=t.getArcTitle();if(n&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(n)){var i=r.current.needle;return isNumber$2(i)||(i=e.arc_needle_value),tplProcess(n,{NEEDLE_VALUE:isNumber$2(i)?i:0})}return!1},redrawArc:function(t,e,r){var n=this,i=n.config,s=n.state,a=n.$el.main,o=i.interaction_enabled,l=o&&i.data_selection_isselectable,c=a.selectAll(".".concat($ARC.arcs)).selectAll(".".concat($ARC.arc)).data(n.arcData.bind(n));c.exit().transition().duration(e).style("opacity","0").remove(),c=c.enter().append("path").attr("class",n.getClass("arc",!0)).style("fill",function(u){return n.color(u.data)}).style("cursor",function(u){var d;return!((d=l==null?void 0:l.bind)===null||d===void 0)&&d.call(l,n.api)(u)?"pointer":null}).style("opacity","0").each(function(u){n.isGaugeType(u.data)&&(u.startAngle=i.gauge_startingAngle,u.endAngle=i.gauge_startingAngle),this._current=u}).merge(c),n.hasType("gauge")&&(n.updateGaugeMax(),n.hasMultiArcGauge()&&n.redrawMultiArcGauge()),c.attr("transform",function(u){return!n.isGaugeType(u.data)&&r?"scale(0)":""}).style("opacity",function(u){return u===this._current?"0":null}).each(function(){s.transiting=!0}).transition().duration(t).attrTween("d",function(u){var d=n.updateAngle(u);if(!d)return function(){return"M 0 0"};isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var h=interpolate$1(this._current,d);return this._current=h(0),function(f){var g=h(f);return g.data=u.data,n.getArc(g,!0)}}).attr("transform",r?"scale(1)":"").style("fill",function(u){var d;return n.levelColor?(d=n.levelColor(u.data.values[0].value),i.data_colors[u.data.id]=d):d=n.color(u.data),d}).style("opacity",null).call(endall,function(){if(n.levelColor){var u=select(this),d=u.datum(this._current);n.updateLegendItemColor(d.data.id,u.style("fill"))}s.transiting=!1,callFn(i.onrendered,n.api)}),o&&n.bindArcEvent(c),n.hasType("polar")&&n.redrawPolar(),n.hasType("gauge")&&n.redrawBackgroundArcs(),i.arc_needle_show&&n.redrawNeedle(),n.redrawArcText(t)},redrawNeedle:function(){var t=this,e=t.$el,r=t.config,n=t.state,i=n.hiddenTargetIds,s=n.radius,a=(s-1)/100*r.arc_needle_length,o=i.length!==t.data.targets.length,l=t.$el.arcs.select(".".concat($ARC.needle)),c=r.arc_needle_path,u=r.arc_needle_bottom_width/2,d=r.arc_needle_top_width/2,h=r.arc_needle_top_rx,f=r.arc_needle_top_ry,g=r.arc_needle_bottom_len,p=r.arc_needle_bottom_rx,m=r.arc_needle_bottom_ry,v=t.getNeedleAngle(),_=function(){var C=t.getArcTitleWithNeedleValue();C&&t.setArcTitle(C)};if(_(),l.empty()&&(l=e.arcs.append("path").classed($ARC.needle,!0),e.needle=l,e.needle.updateHelper=function(C,S){S===void 0&&(S=!1),e.needle.style("display")!=="none"&&t.$T(e.needle).style("transform","rotate(".concat(t.getNeedleAngle(C),"deg)")).call(endall,function(){S&&(r.arc_needle_value=C),_()})}),o){var b=isFunction$4(c)?c.call(t,a):"M-".concat(u," ").concat(g," A").concat(p," ").concat(m," 0 0 0 ").concat(u," ").concat(g," L").concat(d," -").concat(a," A").concat(h," ").concat(f," 0 0 0 -").concat(d," -").concat(a," L-").concat(u," ").concat(g," Z");t.$T(l).attr("d",b).style("fill",r.arc_needle_color).style("display",null).style("transform","rotate(".concat(v,"deg)"))}else l.style("display","none")},getNeedleAngle:function(t){var e=this,r=e.config,n=e.state,i=e.getArcLength(),s=e.hasType("gauge"),a=e.getTotalDataSum(!0),o=isDefined$1(t)?t:r.arc_needle_value,l=r["".concat(r.data_type,"_startingAngle")]||0,c=0;if(isNumber$2(o)||(o=s&&e.data.targets.length===1?a:0),n.current.needle=o,s){l=e.getGaugeStartAngle();var u=r.gauge_fullCircle?i:l*-2,d=r.gauge_min,h=r.gauge_max;c=u*((o-d)/(h-d))}else c=i*(o/a);return(l+c)*(180/Math.PI)},redrawBackgroundArcs:function(){var t=this,e=t.config,r=t.state,n=t.hasMultiArcGauge(),i=e.gauge_fullCircle,s=t.filterTargetsToShow(t.data.targets).length===0&&!!e.data_empty_label_text,a=t.getGaugeStartAngle(),o=i?a+t.getArcLength():a*-1,l=t.$el.arcs.select("".concat(n?"g":"",".").concat($ARC.chartArcsBackground));if(n){var c=0;l=l.selectAll("path.".concat($ARC.chartArcsBackground)).data(t.data.targets),l.enter().append("path").attr("class",function(u,d){return"".concat($ARC.chartArcsBackground," ").concat($ARC.chartArcsBackground,"-").concat(d)}).merge(l).style("fill",e.gauge_background||null).attr("d",function(u){var d=u.id;if(s||r.hiddenTargetIds.indexOf(d)>=0)return"M 0 0";var h={data:[{value:e.gauge_max}],startAngle:a,endAngle:o,index:c++};return t.getArc(h,!0,!0)}),l.exit().remove()}else l.attr("d",s?"M 0 0":function(){var u={data:[{value:e.gauge_max}],startAngle:a,endAngle:o};return t.getArc(u,!0,!0)})},bindArcEvent:function(t){var e=this,r=e.config,n=e.state,i=n.inputType==="touch",s=n.inputType==="mouse";function a(c,u,d){e.expandArc(d),e.api.focus(d),e.toggleFocusLegend(d,!0),e.showTooltip([u],c)}function o(c){var u=(c==null?void 0:c.id)||void 0;e.unexpandArc(u),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(c,u,d){var h,f=e.updateAngle(u),g;f&&(g=e.convertToArcData(f),(h=e.toggleShape)===null||h===void 0||h.call(e,this,g,d),r.data_onclick.bind(e.api)(g,this))}),s&&t.on("mouseover",function(c,u){if(!n.transiting){n.event=c;var d=e.updateAngle(u),h=d?e.convertToArcData(d):null,f=(h==null?void 0:h.id)||void 0;a(this,h,f),e.setOverOut(!0,h)}}).on("mouseout",function(c,u){if(!n.transiting){n.event=c;var d=e.updateAngle(u),h=d?e.convertToArcData(d):null;o(),e.setOverOut(!1,h)}}).on("mousemove",function(c,u){var d=e.updateAngle(u),h=d?e.convertToArcData(d):null;n.event=c,e.showTooltip([h],this)}),i&&e.hasArcType()&&!e.radars){var l=function(c){var u,d,h=(d=(u=c.changedTouches)===null||u===void 0?void 0:u[0])!==null&&d!==void 0?d:{clientX:0,clientY:0},f=h.clientX,g=h.clientY,p=select(doc.elementFromPoint(f,g));return p};e.$el.svg.on("touchstart touchmove",function(c){if(!n.transiting){n.event=c;var u=l(c),d=u.datum(),h=d!=null&&d.data&&d.data.id?e.updateAngle(d):null,f=h?e.convertToArcData(h):null,g=(f==null?void 0:f.id)||void 0;e.callOverOutForTouch(f),isUndefined$3(g)?o():a(this,f,g)}})}},redrawArcText:function(t){var e=this,r=e.config,n=e.state,i=e.$el,s=i.main,a=i.arcs,o=e.hasType("gauge"),l=e.hasMultiArcGauge(),c;if(o&&e.data.targets.length===1&&r.gauge_title||(c=s.selectAll(".".concat($ARC.chartArc)).select("text").style("opacity","0").attr("class",function(d){return e.isGaugeType(d.data)?$GAUGE.gaugeValue:null}).call(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(d){return e.isGaugeType(d.data)&&e.data.targets.length===1&&!l?"".concat(Math.round(n.radius/5),"px"):null}).transition().duration(t).style("opacity",function(d){return e.isTargetToShow(d.data.id)&&e.isArcType(d.data)?null:"0"}),l&&c.attr("dy","-.1em")),s.select(".".concat($ARC.chartArcsTitle)).style("opacity",e.hasType("donut")||o?null:"0"),o){var u=r.gauge_fullCircle;u&&(c==null||c.attr("dy","".concat(l?0:Math.round(n.radius/14)))),r.gauge_label_show&&(a.select(".".concat($GAUGE.chartArcsGaugeUnit)).attr("dy","".concat(u?1.5:.75,"em")).text(r.gauge_units),a.select(".".concat($GAUGE.chartArcsGaugeMin)).attr("dx","".concat(-1*(n.innerRadius+(n.radius-n.innerRadius)/(u?1:2)),"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_min,!1)),!u&&a.select(".".concat($GAUGE.chartArcsGaugeMax)).attr("dx","".concat(n.innerRadius+(n.radius-n.innerRadius)/2,"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_max,!0)))}},getArcElementByIdOrIndex:function(t){var e=this,r=e.$el.arcs,n=isNumber$2(t)?function(i){return i.index===t}:function(i){return i.data.id===t};return r==null?void 0:r.selectAll(".".concat($COMMON.target," path")).filter(n)}},shapeArea={initArea:function(t){var e=this,r=e.config;t.insert("g",".".concat(r.area_front?$CIRCLE.circles:$LINE.lines)).attr("class",e.getClass("areas",!0))},updateAreaColor:function(t){var e=this;return e.config.area_linearGradient?e.getGradienColortUrl(t.id):e.color(t)},updateArea:function(t,e){e===void 0&&(e=!1);var r=this,n=r.config,i=r.state,s=r.$el,a=r.$T,o=e?s.subchart:s;n.area_linearGradient&&r.updateLinearGradient();var l=o.main.selectAll(".".concat($AREA.areas)).selectAll(".".concat($AREA.area)).data(r.lineData.bind(r));a(l.exit(),t).style("opacity","0").remove(),o.area=l.enter().append("path").attr("class",r.getClass("area",!0)).style("fill",r.updateAreaColor.bind(r)).style("opacity",function(){return i.orgAreaOpacity=select(this).style("opacity"),"0"}).merge(l),l.style("opacity",i.orgAreaOpacity),r.setRatioForGroupedData(o.area.data())},redrawArea:function(t,e,r){r===void 0&&(r=!1);var n=this,i=(r?this.$el.subchart:this.$el).area,s=n.state.orgAreaOpacity;return[n.$T(i,e,getRandom()).attr("d",t).style("fill",n.updateAreaColor.bind(n)).style("opacity",function(a){return String(n.isAreaRangeType(a)?s/1.75:s)})]},generateDrawArea:function(t,e){var r=this,n=r.config,i=n.line_connectNull,s=n.axis_rotated,a=r.generateGetAreaPoints(t,e),o=r.getYScaleById.bind(r),l=function(d){return(e?r.subxx:r.xx).call(r,d)},c=function(d,h){return r.isGrouped(d.id)?a(d,h)[0][1]:o(d.id,e)(r.isAreaRangeType(d)?r.getRangedData(d,"high"):r.getShapeYMin(d.id))},u=function(d,h){return r.isGrouped(d.id)?a(d,h)[1][1]:o(d.id,e)(r.isAreaRangeType(d)?r.getRangedData(d,"low"):d.value)};return function(d){var h=i?r.filterRemoveNull(d.values):d.values,f=0,g=0,p;if(r.isAreaType(d)){var m=area$1();m=s?m.y(l).x0(c).x1(u):m.x(l).y0(n.area_above?0:n.area_below?r.state.height:c).y1(u),i||(m=m.defined(function(v){return r.getBaseValue(v)!==null})),r.isStepType(d)&&(h=r.convertValuesToStep(h)),p=m.curve(r.getCurve(d))(h)}else h[0]&&(f=r.scale.x(h[0].x),g=r.getYScaleById(d.id)(h[0].value)),p=s?"M ".concat(g," ").concat(f):"M ".concat(f," ").concat(g);return p||"M 0 0"}},generateGetAreaPoints:function(t,e){var r=this,n=r.config,i=r.getShapeX(0,t,e),s=r.getShapeY(!!e),a=r.getShapeOffset(r.isAreaType,t,e),o=r.getYScaleById.bind(r);return function(l,c){var u=o.call(r,l.id,e)(r.getShapeYMin(l.id)),d=a(l,c)||u,h=i(l),f=l.value,g=s(l);return n.axis_rotated&&(f>0&&g<u||f<0&&u<g)&&(g=u),[[h,d],[h,g-(u-d)],[h,g-(u-d)],[h,d]]}}},shapeBar={initBar:function(){var t=this,e=t.$el,r=t.config,n=t.state.clip;e.bar=e.main.select(".".concat($COMMON.chart)),e.bar=r.bar_front?e.bar.append("g"):e.bar.insert("g",":first-child"),e.bar.attr("class",$BAR.chartBars).call(this.setCssRule(!1,".".concat($BAR.chartBars),["pointer-events:none"])),r.clipPath===!1&&(r.bar_radius||r.bar_radius_ratio)&&e.bar.attr("clip-path",n.pathXAxis.replace(/#[^)]*/,"#".concat(n.id)))},updateTargetsForBar:function(t){var e=this,r=e.config,n=e.$el,i=e.getChartClass("Bar"),s=e.getClass("bars",!0),a=e.classFocus.bind(e),o=r.interaction_enabled&&r.data_selection_isselectable;n.bar||e.initBar();var l=n.main.select(".".concat($BAR.chartBars)).selectAll(".".concat($BAR.chartBar)).data(t.filter(function(u){return u.values.some(function(d){return isNumber$2(d.value)||e.isBarRangeType(d)})})).attr("class",function(u){return i(u)+a(u)}),c=l.enter().append("g").attr("class",i).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));c.append("g").attr("class",s).style("cursor",function(u){var d;return!((d=o==null?void 0:o.bind)===null||d===void 0)&&d.call(o,e.api)(u)?"pointer":null}).call(e.setCssRule(!0," .".concat($BAR.bar),["fill"],e.color))},updateBar:function(t,e){e===void 0&&(e=!1);var r=this,n=r.config,i=r.$el,s=r.$T,a=e?i.subchart:i,o=r.getClass("bar",!0),l=r.initialOpacity.bind(r);n.bar_linearGradient&&r.updateLinearGradient();var c=a.main.selectAll(".".concat($BAR.bars)).selectAll(".".concat($BAR.bar)).data(r.labelishData.bind(r));s(c.exit(),t).style("opacity","0").remove(),a.bar=c.enter().append("path").attr("class",o).style("fill",r.updateBarColor.bind(r)).merge(c).style("opacity",l),r.setRatioForGroupedData(a.bar.data())},updateBarColor:function(t){var e=this,r=e.getStylePropValue(e.color);return e.config.bar_linearGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawBar:function(t,e,r){r===void 0&&(r=!1);var n=this,i=(r?n.$el.subchart:n.$el).bar;return[n.$T(i,e,getRandom()).attr("d",function(s){return(isNumber$2(s.value)||n.isBarRangeType(s))&&t(s)}).style("fill",n.updateBarColor.bind(n)).style("opacity",null)]},generateDrawBar:function(t,e){var r=this,n=r.config,i=r.generateGetBarPoints(t,e),s=n.axis_rotated,a=n.bar_radius,o=n.bar_radius_ratio,l=isNumber$2(a)&&a>0?function(){return a}:isNumber$2(o)?function(c){return c*o}:null;return function(c,u){var d=i(c,u),h=+s,f=+!h,g=c.value<0,p=n["axis_".concat(r.axis.getId(c.id),"_inverted")],m=!p&&g||p&&!g,v=["",""],_=0,b=r.isGrouped(c.id),C=l&&b?r.isStackingRadiusData(c):!1;if(l){var S=s?f:h,w=d[2][S]-d[0][S];_=!b||C?l(w):0;var A="a".concat(_,",").concat(_," ").concat(m?"1 0 0":"0 0 1"," ");v[+!s]="".concat(A).concat(_,",").concat(_),v[+s]="".concat(A).concat([-_,_][s?"sort":"reverse"]()),m&&v.reverse()}var O=s?"H".concat(d[1][h]+(m?_:-_)," ").concat(v[0],"V").concat(d[2][f]-_," ").concat(v[1],"H").concat(d[3][h]):"V".concat(d[1][f]+(m?-_:_)," ").concat(v[0],"H").concat(d[2][h]-_," ").concat(v[1],"V").concat(d[3][f]);return"M".concat(d[0][h],",").concat(d[0][f]).concat(O,"z")}},isStackingRadiusData:function(t){var e=this,r=e.$el,n=e.config,i=e.data,s=e.state,a=t.id,o=t.index,l=t.value;if(s.hiddenTargetIds.indexOf(a)>-1){var c=r.bar.filter(function(f){return f.id===a&&f.value===l});return!c.empty()&&/a\d+/i.test(c.attr("d"))}var u=n.data_groups.find(function(f){return f.indexOf(a)>-1}),d=e.orderTargets(e.filterTargetsToShow(i.targets.filter(e.isBarType,e))).filter(function(f){return u.indexOf(f.id)>-1}),h=d.map(function(f){return f.values.filter(function(g){return g.index===o&&(isNumber$2(l)&&l>0?g.value>0:g.value<0)})[0]}).filter(Boolean).map(function(f){return f.id});return l!==0&&h.indexOf(a)===h.length-1},generateGetBarPoints:function(t,e){var r=this,n=r.config,i=e?r.axis.subX:r.axis.x,s=r.getIndicesMax(t)+1,a=r.getBarW("bar",i,s),o=r.getShapeX(a,t,!!e),l=r.getShapeY(!!e),c=r.getShapeOffset(r.isBarType,t,!!e),u=r.getYScaleById.bind(r);return function(d,h){var f=d.id,g=u.call(r,f,e)(r.getShapeYMin(f)),p=c(d,h)||g,m=isNumber$2(a)?a:a[d.id]||a._$width,v=n["axis_".concat(r.axis.getId(f),"_inverted")],_=d.value,b=o(d),C=l(d);n.axis_rotated&&!v&&(_>0&&C<g||_<0&&g<C)&&(C=g),r.isBarRangeType(d)||(C-=g-p);var S=b+m;return[[b,p],[b,C],[S,C],[S,p]]}}},shapeLine={initLine:function(){var t=this.$el;t.line=t.main.select(".".concat($COMMON.chart)).append("g").attr("class",$LINE.chartLines).call(this.setCssRule(!1,".".concat($LINE.chartLines),["pointer-events:none"]))},updateTargetsForLine:function(t){var e=this,r=e.$el,n=r.area,i=r.line,s=r.main,a=e.getChartClass("Line"),o=e.getClass("lines",!0),l=e.classFocus.bind(e);i||e.initLine();var c=t.filter(function(f){return!(e.isScatterType(f)||e.isBubbleType(f))}),u=s.select(".".concat($LINE.chartLines)).selectAll(".".concat($LINE.chartLine)).data(c).attr("class",function(f){return a(f)+l(f)}),d=u.enter().append("g").attr("class",a).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));if(d.append("g").attr("class",o),e.hasTypeOf("Area")){var h=(!n&&d.empty()?u:d).filter(e.isAreaType.bind(e));e.initArea(h)}e.updateTargetForCircle(c,d)},updateLine:function(t,e){e===void 0&&(e=!1);var r=this,n=r.format.extraLineClasses,i=r.$el,s=r.$T,a=e?i.subchart:i,o=a.main.selectAll(".".concat($LINE.lines)).selectAll(".".concat($LINE.line)).data(r.lineData.bind(r));s(o.exit(),t).style("opacity","0").remove(),a.line=o.enter().append("path").attr("class",function(l){return"".concat(r.getClass("line",!0)(l)," ").concat(n(l)||"")}).style("stroke",r.color).merge(o).style("opacity",r.initialOpacity.bind(r)).attr("transform",null)},redrawLine:function(t,e,r){r===void 0&&(r=!1);var n=this,i=n.$el,s=n.$T,a=(r?i.subchart:i).line;return[s(a,e,getRandom()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve:function(t){var e=this,r=e.config.axis_rotated&&e.isStepType(t);return r?function(n){var i=e.getInterpolate(t)(n);return i.orgPoint=i.point,i.pointRotated=function(s,a){this._point===1&&(this._point=2);var o=this._y*(1-this._t)+a*this._t;this._context.lineTo(this._x,o),this._context.lineTo(s,o),this._x=s,this._y=a},i.point=function(s,a){this._point===0?this.orgPoint(s,a):this.pointRotated(s,a)},i}:e.getInterpolate(t)},generateDrawLine:function(t,e){var r=this,n=r.config,i=r.scale,s=n.line_connectNull,a=n.axis_rotated,o=r.generateGetLinePoints(t,e),l=r.getYScaleById.bind(r),c=function(f){return(e?r.subxx:r.xx).call(r,f)},u=function(f,g){return r.isGrouped(f.id)?o(f,g)[0][1]:l(f.id,e)(r.getBaseValue(f))},d=line$1();d=a?d.x(u).y(c):d.x(c).y(u),s||(d=d.defined(function(f){return r.getBaseValue(f)!==null}));var h=e?i.subX:i.x;return function(f){var g=l(f.id,e),p=s?r.filterRemoveNull(f.values):f.values,m=0,v=0,_;if(r.isLineType(f)){var b=n.data_regions[f.id];b?_=r.lineWithRegions(p,i.zoom||h,g,b):(r.isStepType(f)&&(p=r.convertValuesToStep(p)),_=d.curve(r.getCurve(f))(p))}else p[0]&&(m=h(p[0].x),v=g(p[0].value)),_=a?"M ".concat(v," ").concat(m):"M ".concat(m," ").concat(v);return _||"M 0 0"}},lineWithRegions:function(t,e,r,n){var i=this,s=i.config,a=s.axis_rotated,o=i.axis.isTimeSeries(),l=[],c="2 2",u,d,h,f;if(isDefined$1(n))for(var g=function(ae,se){return isUndefined$3(ae)?se:o?parseDate.call(i,ae):ae},p=0,m=void 0;m=n[p];p++){var v=g(m.start,t[0].x),_=g(m.end,t[t.length-1].x),b=m.style||{dasharray:c};l[p]={start:v,end:_,style:b}}for(var C=a?function(ae){return r(ae.value)}:function(ae){return e(ae.x)},S=a?function(ae){return e(ae.x)}:function(ae){return r(ae.value)},w=function(ae){return"M".concat(ae[0][0],",").concat(ae[0][1],"L").concat(ae[1][0],",").concat(ae[1][1])},A=o?function(ae,se,P,B){var V=ae.x.getTime(),ie=se.x-ae.x,F=new Date(V+ie*P),M=new Date(V+ie*(P+B)),U=a?[[r(d(P)),e(F)],[r(d(P+h)),e(M)]]:[[e(F),r(d(P))],[e(M),r(d(P+h))]];return w(U)}:function(ae,se,P,B){var V=a?[[r(d(P),!0),e(u(P))],[r(d(P+B),!0),e(u(P+B))]]:[[e(u(P),!0),r(d(P))],[e(u(P+B),!0),r(d(P+B))]];return w(V)},O={x:i.axis.getAxisType("x"),y:i.axis.getAxisType("y")},T="",p=0,H=void 0;H=t[p];p++){var k=t[p-1],G=k&&isValue(k.value),b=i.isWithinRegions(H.x,l);if(isValue(H.value)){if(isUndefined$3(l)||!b||!G)T+="".concat(p&&G?"L":"M").concat(C(H),",").concat(S(H));else if(G){try{b=b.dasharray.split(" ")}catch(P){b=c.split(" ")}u=getScale(O.x,k.x,H.x),d=getScale(O.y,k.value,H.value);var X=e(H.x)-e(k.x),I=r(H.value)-r(k.value),ce=Math.sqrt(Math.pow(X,2)+Math.pow(I,2));h=b[0]/ce,f=h*b[1];for(var be=h;be<=1;be+=f)T+=A(k,H,be,h),be+f>=1&&(T+=A(k,H,1,0))}}}return T},isWithinRegions:function(t,e){for(var r=0,n=void 0;n=e[r];r++)if(n.start<t&&t<=n.end)return n.style;return!1},isWithinStep:function(t,e){return Math.abs(e-getPointer$1(this.state.event,t)[1])<30},shouldDrawPointsForLine:function(t){var e=this.config.line_point;return e===!0||isArray$7(e)&&e.indexOf(t.id)!==-1}},getTransitionName=function(){return getRandom()},shapePoint={hasValidPointType:function(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasValidPointDrawMethods:function(t){var e=t||this.config.point_type;return isObjectType(e)&&isFunction$4(e.create)&&isFunction$4(e.update)},initialOpacityForCircle:function(t){var e=this,r=e.config,n=e.state.withoutFadeIn,i=r.point_opacity;return isUndefined$3(i)&&(i=this.getBaseValue(t)!==null&&n[t.id]?this.opacityForCircle(t):"0"),i},opacityForCircle:function(t){var e,r=this.config,n=r.point_opacity;return isUndefined$3(n)&&(n=r.point_show&&!(!((e=this.isPointFocusOnly)===null||e===void 0)&&e.call(this))?null:"0",n=isValue(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":n:"0"),n},initCircle:function(){var t=this,e=t.$el.main;t.point=t.generatePoint(),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(".".concat($CIRCLE.chartCircles)).empty()&&e.select(".".concat($COMMON.chart)).append("g").attr("class",$CIRCLE.chartCircles)},updateTargetForCircle:function(t,e){var r=this,n=this,i=n.config,s=n.data,a=n.$el,o=i.interaction_enabled&&i.data_selection_enabled,l=o&&i.data_selection_isselectable,c=n.getClass("circles",!0);if(i.point_show){!a.circle&&n.initCircle();var u=t,d=e;if(!u){u=s.targets.filter(function(f){return r.isScatterType(f)||r.isBubbleType(f)});var h=a.main.select(".".concat($CIRCLE.chartCircles)).style("pointer-events","none").selectAll(".".concat($CIRCLE.circles)).data(u);h.exit().remove(),d=h.enter()}o&&d.append("g").attr("class",function(f){return n.generateClass($SELECT.selectedCircles,f.id)}),d.append("g").attr("class",c).call(function(f){n.setCssRule(!0,".".concat($CIRCLE.circles),["cursor:pointer"],l)(f),n.setCssRule(!0," .".concat($CIRCLE.circle),["fill","stroke"],n.color)(f)}).style("opacity",function(){var f=select(this.parentNode);return f.attr("class").indexOf($CIRCLE.chartCircles)>-1?"0":null}),o&&u.forEach(function(f){a.main.selectAll(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(f.id))).selectAll("".concat($SELECT.selectedCircle)).each(function(g){g.value=f.values[g.index].value})})}},updateCircle:function(t){t===void 0&&(t=!1);var e=this,r=e.config,n=e.state,i=e.$el,s=e.isPointFocusOnly(),a=t?i.subchart:i;if(r.point_show&&!n.toggling){r.point_radialGradient&&e.updateLinearGradient();var o=a.main.selectAll(".".concat($CIRCLE.circles)).selectAll(".".concat($CIRCLE.circle)).data(function(l){return e.isLineType(l)&&e.shouldDrawPointsForLine(l)||e.isBubbleType(l)||e.isRadarType(l)||e.isScatterType(l)?s?[l.values[0]]:l.values:[]});o.exit().remove(),o.enter().filter(Boolean).append(e.point("create",this,e.pointR.bind(e),e.updateCircleColor.bind(e))),a.circle=a.main.selectAll(".".concat($CIRCLE.circles," .").concat($CIRCLE.circle)).style("stroke",e.getStylePropValue(e.color)).style("opacity",e.initialOpacityForCircle.bind(e))}},updateCircleColor:function(t){var e=this,r=e.getStylePropValue(e.color);return e.config.point_radialGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawCircle:function(t,e,r,n,i){i===void 0&&(i=!1);var s=this,a=s.state.rendered,o=s.$el,l=s.$T,c=i?o.subchart:o,u=c.main.selectAll(".".concat($SELECT.selectedCircle));if(!s.config.point_show)return[];var d=s.point("update",s,t,e,s.updateCircleColor.bind(s),r,n,u),h=s.isCirclePoint()?"c":"",f=getRandom(),g=s.opacityForCircle.bind(s),p=[];return c.circle.each(function(m){var v=d.bind(this)(m);v=l(v,r||!a,f).style("opacity",g),p.push(v)}),[p,l(u,r).attr("".concat(h,"x"),t).attr("".concat(h,"y"),e)]},showCircleFocus:function(t){var e=this,r=e.state,n=r.hasRadar,i=r.resizing,s=r.toggling,a=r.transiting,o=e.$el,l=o.circle;if(a===!1&&l&&e.isPointFocusOnly()){var c=(n?e.radarCircleX:e.circleX).bind(e),u=(n?e.radarCircleY:e.circleY).bind(e),d=s||isUndefined$3(t),h=e.point("update",e,c,u,e.getStylePropValue(e.color),i?!1:d);t&&(l=l.filter(function(f){var g,p=(g=t.filter)===null||g===void 0?void 0:g.call(t,function(m){return m.id===f.id});return p.length?select(this).datum(p[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(f){var g=f.id,p=f.index,m=f.value,v="hidden";isValue(m)&&(h.bind(this)(f),e.expandCircles(p,g),v=""),this.style.visibility=v})}},hideCircleFocus:function(){var t=this,e=t.$el.circle;t.isPointFocusOnly()&&e&&(t.unexpandCircles(),e.style("visibility","hidden"))},circleX:function(t){return this.xx(t)},updateCircleY:function(t){t===void 0&&(t=!1);var e=this,r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType),t);return function(n,i){var s=n.id;return e.isGrouped(s)?r(n,i)[0][1]:e.getYScaleById(s,t)(e.getBaseValue(n))}},expandCircles:function(t,e,r){var n=this,i=n.pointExpandedR.bind(n);r&&n.unexpandCircles();var s=n.getShapeByIndex("circle",t,e).classed($COMMON.EXPANDED,!0),a=i(s)/n.config.point_r,o=1-a;n.isCirclePoint()?s.attr("r",i):s.each(function(){var l=select(this);if(this.tagName==="circle")l.attr("r",i);else{var c=this.getBBox(),u=c.width,d=c.height,h=o*(+l.attr("x")+u/2),f=o*(+l.attr("y")+d/2);l.attr("transform","translate(".concat(h," ").concat(f,") scale(").concat(a,")"))}})},unexpandCircles:function(t){var e=this,r=e.pointR.bind(e),n=e.getShapeByIndex("circle",t).filter(function(){return select(this).classed($COMMON.EXPANDED)}).classed($COMMON.EXPANDED,!1);if(n.attr("r",r),!e.isCirclePoint()){var i=r(n)/e.config.point_r;n.attr("transform",i!==1?"scale(".concat(i,")"):null)}},pointR:function(t){var e=this,r=e.config,n=r.point_r,i=n;return e.isBubbleType(t)?i=e.getBubbleR(t):isFunction$4(n)&&(i=n.bind(e.api)(t)),t.r=i,i},pointExpandedR:function(t){var e=this,r=e.config,n=e.isBubbleType(t)?1.15:1.75;return r.point_focus_expand_enabled?r.point_focus_expand_r||e.pointR(t)*n:e.pointR(t)},pointSelectR:function(t){var e=this,r=e.config.point_select_r;return isFunction$4(r)?r(t):r||e.pointR(t)*4},isPointFocusOnly:function(){var t=this;return t.config.point_focus_only&&!t.hasType("bubble")&&!t.hasType("scatter")&&!t.hasArcType(null,["radar"])},isWithinCircle:function(t,e){var r=this,n=r.config,i=r.state,s=getPointer$1(i.event,t),a=select(t),o=this.isCirclePoint(t)?"c":"",l=n.point_sensitivity==="radius"?t.getAttribute("r"):n.point_sensitivity,c=+a.attr("".concat(o,"x")),u=+a.attr("".concat(o,"y"));if(!(c||u)&&t.nodeType===1){var d=getBoundingRect(t),h=d.x,f=d.y;c=h,u=f}return Math.sqrt(Math.pow(c-s[0],2)+Math.pow(u-s[1],2))<(e||l)},getPointSensitivity:function(t){var e=this,r=e.config.point_sensitivity;return isFunction$4(r)?r=r.call(e.api,t):r==="radius"&&(r=t.r),r},insertPointInfoDefs:function(t,e){var r,n=this,i=function(c,u){for(var d=c.attributes,h=0,f;f=d[h];h++)f=f.name,u.setAttribute(f,c.getAttribute(f))},s=new DOMParser().parseFromString(t,"image/svg+xml"),a=s.documentElement,o=doc.createElementNS(namespaces.svg,a.nodeName.toLowerCase());if(o.id=e,o.style.fill="inherit",o.style.stroke="inherit",i(a,o),!((r=a.childNodes)===null||r===void 0)&&r.length){var l=select(o);"innerHTML"in o?l.html(a.innerHTML):toArray$1(a.childNodes).forEach(function(c){i(c,l.append(c.tagName).node())})}n.$el.defs.node().appendChild(o)},pointFromDefs:function(t){return this.$el.defs.select("#".concat(t))},updatePointClass:function(t){var e=this,r=e.$el.circle,n=!1;return(isObject$c(t)||r)&&(n=t===!0?r.each(function(i){var s=e.getClass("circle",!0)(i);this.getAttribute("class").indexOf($COMMON.EXPANDED)>-1&&(s+=" ".concat($COMMON.EXPANDED)),this.setAttribute("class",s)}):e.getClass("circle",!0)(t)),n},generateGetLinePoints:function(t,e){var r=this,n=r.config,i=r.getShapeX(0,t,e),s=r.getShapeY(e),a=r.getShapeOffset(r.isLineType,t,e),o=r.getYScaleById.bind(r);return function(l,c){var u=o.call(r,l.id,e)(r.getShapeYMin(l.id)),d=a(l,c)||u,h=i(l),f=s(l);n.axis_rotated&&(l.value>0&&f<u||l.value<0&&u<f)&&(f=u);var g=[h,f-(u-d)];return[g,g,g,g]}},generatePoint:function(){var t=this,e=t.config,r=t.state.datetimeId,n=[],i=notEmpty(e.point_pattern)?e.point_pattern:[e.point_type];return function(s,a){for(var o=[],l=2;l<arguments.length;l++)o[l-2]=arguments[l];return function(c){var u,d=t.getTargetSelectorSuffix(c.id||((u=c.data)===null||u===void 0?void 0:u.id)||c),h=select(this);n.indexOf(d)<0&&n.push(d);var f=i[n.indexOf(d)%i.length];if(t.hasValidPointType(f))f=t[f];else if(!t.hasValidPointDrawMethods(f)){var g="".concat(r,"-point").concat(d),p=t.pointFromDefs(g);if(p.size()<1&&t.insertPointInfoDefs(f,g),s==="create")return t.custom.create.bind(a).apply(void 0,__spreadArray([h,g],o,!1));if(s==="update")return t.custom.update.bind(a).apply(void 0,__spreadArray([h],o,!1))}return f[s].bind(a).apply(void 0,__spreadArray([h],o,!1))}}},custom:{create:function(t,e,r){return t.append("use").attr("xlink:href","#".concat(e)).attr("class",this.updatePointClass.bind(this)).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=t.node().getBBox(),c=l.width,u=l.height,d=function(g){return isValue(g.value)?e(g)-c/2:0},h=function(g){return isValue(g.value)?r(g)-u/2:0},f=t;return i&&(s&&f.attr("x",d),f=o.$T(f,i,getTransitionName()),a&&o.$T(a,i,getTransitionName())),f.attr("x",d).attr("y",h).style("fill",n)}},circle:{create:function(t,e,r){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=t;return o.hasType("bubble")&&l.attr("r",o.pointR.bind(o)),i&&(s&&l.attr("cx",e),l.attr("cx")&&(l=o.$T(l,i,getTransitionName())),a&&o.$T(l,i,getTransitionName())),l.attr("cx",e).attr("cy",r).style("fill",n)}},rectangle:{create:function(t,e,r){var n=function(i){return e(i)*2};return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",n).attr("height",n).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=o.config.point_r,c=function(h){return e(h)-l},u=function(h){return r(h)-l},d=t;return i&&(s&&d.attr("x",c),d=o.$T(d,i,getTransitionName()),a&&o.$T(a,i,getTransitionName())),d.attr("x",c).attr("y",u).style("fill",n)}}},optPoint={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},optArea={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},optBar={bar_front:!1,bar_indices_removeNull:!1,bar_label_threshold:0,bar_linearGradient:!1,bar_overlap:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},optLine={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},optScatter={scatter_zerobased:!1},optArc={arc_cornerRadius:0,arc_cornerRadius_ratio:0,arc_needle_show:!1,arc_needle_color:void 0,arc_needle_value:void 0,arc_needle_path:void 0,arc_needle_length:100,arc_needle_top_rx:0,arc_needle_top_ry:0,arc_needle_top_width:0,arc_needle_bottom_rx:1,arc_needle_bottom_ry:1,arc_needle_bottom_width:15,arc_needle_bottom_len:0},optPie={pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0};function extendAxis(t,e){extend$3(ChartInternal.prototype,internal.concat(t)),extend$3(Chart.prototype,api),Options.setOptions(options.concat(e||[]))}function extendLine(t,e){extendAxis([shapePoint,shapeLine].concat(t||[])),Options.setOptions([optPoint,optLine].concat(e||[]))}function extendArc(t,e){extend$3(ChartInternal.prototype,[shapeArc].concat(t||[])),Options.setOptions(e)}var area=function(){return extendLine(shapeArea,[optArea]),(area=function(){return TYPE.AREA})()},line=function(){return extendLine(),(line=function(){return TYPE.LINE})()},pie=function(){return extendArc(void 0,[optArc,optPie]),(pie=function(){return TYPE.PIE})()},bar=function(){return extendAxis([shapeBar],optBar),(bar=function(){return TYPE.BAR})()},scatter=function(){return extendAxis([shapePoint],[optPoint,optScatter]),(scatter=function(){return TYPE.SCATTER})()},subchart$1=function(t){var e,r=this.internal,n=r.axis,i=r.brush,s=r.config,a=r.scale,o=a.x,l=a.subX,c=r.state,u;if(s.subchart_show)if(u=t,Array.isArray(u)){n.isTimeSeries()&&(u=u.map(function(h){return parseDate.bind(r)(h)}));var d=r.withinRange(u,r.getZoomDomain("subX",!0),r.getZoomDomain("subX"));d&&(c.domain=u,i.move(i.getSelection(),u.map(l)))}else u=(e=c.domain)!==null&&e!==void 0?e:o.orgDomain();return u};extend$3(subchart$1,{show:function(){var t,e,r=this.internal,n=r.$el.subchart,i=r.config,s=i.subchart_show;if(!s){r.unbindZoomEvent(),i.subchart_show=!s,!n.main&&r.initSubchart();var a=n.main.selectAll(".".concat($COMMON.target));r.data.targets.length!==a.size()&&(r.updateSizes(),r.updateTargetsForSubchart(r.data.targets),a=(t=n.main)===null||t===void 0?void 0:t.selectAll(".".concat($COMMON.target))),a==null||a.style("opacity",null),(e=n.main)===null||e===void 0||e.style("display",null),this.resize()}},hide:function(){var t=this.internal,e=t.$el.subchart.main,r=t.config;r.subchart_show&&(e==null?void 0:e.style("display"))!=="none"&&(r.subchart_show=!1,e.style("display","none"),this.resize())},toggle:function(){var t=this.internal,e=t.config;this.subchart[e.subchart_show?"hide":"show"]()},reset:function(){var t=this.internal,e=t.brush;e.clear(e.getSelection())}});var zoom$1=function(t){var e,r,n=this.internal,i=n.$el,s=n.axis,a=n.config,o=n.org,l=n.scale,c=n.state,u=a.axis_rotated,d=s.isCategorized(),h;if(a.zoom_enabled)if(h=t,Array.isArray(h)){s.isTimeSeries()&&(h=h.map(function(v){return parseDate.bind(n)(v)}));var f=n.withinRange(h,n.getZoomDomain("zoom",!0),n.getZoomDomain("zoom"));if(f){if(c.domain=h,d&&(h=h.map(function(v,_){return Number(v)+(_===0?0:1)})),n.api.tooltip.hide(),a.subchart_show){var g=l.zoom||l.x;n.brush.getSelection().call(n.brush.move,h.map(g))}else{var g=d?l.x.orgScale():o.xScale||l.x,p=[-g(h[0]),0],m=(e=identity$1.scale(g.range()[1]/(g(h[1])-g(h[0])))).translate.apply(e,u?p.reverse():p);i.eventRect.call(n.zoom.transform,m)}n.setZoomResetButton()}}else h=n.zoom.getDomain();return(r=c.domain)!==null&&r!==void 0?r:h};extend$3(zoom$1,{enable:function(t){var e=this.internal,r=e.config;/^(drag|wheel)$/.test(t)&&(r.zoom_type=t),r.zoom_enabled=!!t,e.zoom?t===!1&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max:function(t){var e=this.internal,r=e.config,n=e.org.xDomain;return(t===0||t)&&(r.zoom_x_max=getMinMax$1("max",[n[1],t])),r.zoom_x_max},min:function(t){var e=this.internal,r=e.config,n=e.org.xDomain;return(t===0||t)&&(r.zoom_x_min=getMinMax$1("min",[n[0],t])),r.zoom_x_min},range:function(t){var e=this.zoom;if(isObject$c(t)){var r=t.min,n=t.max;isDefined$1(r)&&e.min(r),isDefined$1(n)&&e.max(n)}return{min:e.min(),max:e.max()}}});var drag={drag:function(t){var e=this,r=e.config,n=e.state,i=e.$el.main,s=r.data_selection_grouped,a=r.interaction_enabled&&r.data_selection_isselectable;if(!(e.hasArcType()||!r.data_selection_enabled||r.zoom_enabled&&!e.zoom.altDomain||!r.data_selection_multiple)){var o=n.dragStart||[0,0],l=o[0],c=o[1],u=t[0],d=t[1],h=Math.min(l,u),f=Math.max(l,u),g=s?n.margin.top:Math.min(c,d),p=s?n.height:Math.max(c,d);i.select(".".concat($DRAG.dragarea)).attr("x",h).attr("y",g).attr("width",f-h).attr("height",p-g),i.selectAll(".".concat($SHAPE.shapes)).selectAll(".".concat($SHAPE.shape)).filter(function(m){return a==null?void 0:a.bind(e.api)(m)}).each(function(m,v){var _=select(this),b=_.classed($SELECT.SELECTED),C=_.classed($DRAG.INCLUDED),S=!1,w;if(_.classed($CIRCLE.circle)){var A=+_.attr("cx")*1,O=+_.attr("cy")*1;w=e.togglePoint,S=h<A&&A<f&&g<O&&O<p}else if(_.classed($BAR.bar)){var T=getPathBox(this),A=T.x,O=T.y,H=T.width,k=T.height;w=e.togglePath,S=!(f<A||A+H<h)&&!(p<O||O+k<g)}else return;S^C&&(_.classed($DRAG.INCLUDED,!C),_.classed($SELECT.SELECTED,!b),w.call(e,!b,_,m,v))})}},dragstart:function(t){var e=this,r=e.config,n=e.state,i=e.$el.main;e.hasArcType()||!r.data_selection_enabled||(n.dragStart=t,i.select(".".concat($COMMON.chart)).append("rect").attr("class",$DRAG.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend:function(){var t=this,e=t.config,r=t.$el.main,n=t.$T;t.hasArcType()||!e.data_selection_enabled||(n(r.select(".".concat($DRAG.dragarea))).style("opacity","0").remove(),r.selectAll(".".concat($SHAPE.shape)).classed($DRAG.INCLUDED,!1),t.setDragStatus(!1))}};_assign(_assign({},drag),{selectPoint:function(t,e,r){var n=this,i=n.config,s=n.$el.main,a=n.$T,o=i.axis_rotated,l=(o?n.circleY:n.circleX).bind(n),c=(o?n.circleX:n.circleY).bind(n),u=n.pointSelectR.bind(n);callFn(i.data_onselected,n.api,e,t.node()),a(s.select(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(e.id))).selectAll(".".concat($SELECT.selectedCircle,"-").concat(r)).data([e]).enter().append("circle").attr("class",function(){return n.generateClass($SELECT.selectedCircle,r)}).attr("cx",l).attr("cy",c).attr("stroke",n.color).attr("r",function(d){return n.pointSelectR(d)*1.4})).attr("r",u)},unselectPoint:function(t,e,r){var n=this,i=n.config,s=n.$el.main,a=n.$T;callFn(i.data_onunselected,n.api,e,t==null?void 0:t.node()),a(s.select(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(e.id))).selectAll(".".concat($SELECT.selectedCircle,"-").concat(r))).attr("r",0).remove()},togglePoint:function(t,e,r,n){var i="".concat(t?"":"un","selectPoint");this[i](e,r,n)},selectPath:function(t,e){var r=this,n=r.config;callFn(n.data_onselected,r.api,e,t.node()),n.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath:function(t,e){var r=this,n=r.config;callFn(n.data_onunselected,r.api,e,t.node()),n.interaction_brighten&&t.style("filter",null)},togglePath:function(t,e,r,n){this["".concat(t?"":"un","selectPath")](e,r,n)},getToggle:function(t,e){var r=this;return t.nodeName==="path"?r.togglePath:r.isStepType(e)?function(){}:r.togglePoint},toggleShape:function(t,e,r){var n,i=this,s=i.config,a=i.$el.main;if(s.data_selection_enabled&&s.data_selection_isselectable.bind(i.api)(e)){var o=select(t),l=o.classed($SELECT.SELECTED),c=i.getToggle(t,e).bind(i),u;if(!s.data_selection_multiple){var d=(n=i.isPointFocusOnly)===null||n===void 0?void 0:n.call(i),h=".".concat(d?$SELECT.selectedCircles:$SHAPE.shapes);s.data_selection_grouped&&(h+=i.getTargetSelectorSuffix(e.id)),a.selectAll(h).selectAll(d?".".concat($SELECT.selectedCircle):".".concat($SHAPE.shape,".").concat($SELECT.SELECTED)).classed($SELECT.SELECTED,!1).each(function(f){var g=select(this);u=g,c(!1,g,f,f.index)})}(!u||u.node()!==o.node())&&(o.classed($SELECT.SELECTED,!l),c(!l,o,e,r))}}});var defaults$2={},bb={version:"3.10.3",generate:function(t){var e=mergeObj({},defaults$2,t),r=new Chart(e);return r.internal.charts=this.instance,this.instance.push(r),r},defaults:function(t){return isObject$c(t)&&(defaults$2=t),defaults$2},instance:[],plugin:{}};const insight="",displayChart=t=>{processMsgQueue(t.MsgQueue),setNumericBullets($$8(".block")),setNumericBullets($$8("table td"))};function processMsgQueue(t){t.forEach(e=>processSingleMsg(e==null?void 0:e.data))}const generalAxis=(t,e=r=>{})=>({axis:(n=>(e(n),n))({x:{tick:{format(n){return t[0].xlabels[n]||n}}}})});function processSingleMsg(t){if(!t)return;const{chartID:e,chartType:r,chartData:n}=t,i={bindto:`#${e}`};switch(r){case"lineChart":Object.assign(i,Kt(Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:line()}},generalAxis(n)),{interaction:{enabled:!0}}));break;case"barChart":Object.assign(i,Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:bar()}},generalAxis(n,s=>s.x.tick.multiline=!0)));break;case"pieChart":case"pie3DChart":Object.assign(i,{data:{columns:Object.values(n[0].xlabels).map((s,a)=>[s,n[0].values[a].y]),type:pie()}});break;case"areaChart":Object.assign(i,Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:area()},interaction:{enabled:!0}},generalAxis(n)));break;case"scatterChart":Object.assign(i,{data:{xs:{y:"x"},columns:n.map((s,a)=>[a?"y":"x",...s]),type:scatter()},axis:{x:{label:"X",showDist:!0,tick:{format:format$2(".02f")}},y:{label:"Y",showDist:!0,tick:{format:format$2(".02f")}}}});break}i.data&&bb.generate(i)}function setNumericBullets(t){const e=t;for(let r=0;r<e.length;r++){const n=$$8(e[r]).find(".numeric-bullet-style");if(n.length>0){let i="",s="",a=0;const o=[];let l=0;const c=[];for(let u=0;u<n.length;u++){const d=$$8(n[u]).data("bulltname"),h=$$8(n[u]).data("bulltlvl");a==0?(i=d,s=h,o[l]=a,c[l]=d,a++):d==i&&h==s?(i=d,s=h,a++,o[l]=a,c[l]=d):d!=i&&h==s||d!=i&&Number(h)>Number(s)?(i=d,s=h,l++,o[l]=a,c[l]=d,a=1):d!=i&&Number(h)<Number(s)&&(i=d,s=h,l--,a=o[l]+1);const f=getNumTypeNum(c[l],a);$$8(n[u]).html(f)}}}}function getNumTypeNum(t,e){let r="";switch(t){case"arabicPeriod":r=e+". ";break;case"arabicParenR":r=e+") ";break;case"alphaLcParenR":r=alphaNumeric(e,"lowerCase")+") ";break;case"alphaLcPeriod":r=alphaNumeric(e,"lowerCase")+". ";break;case"alphaUcParenR":r=alphaNumeric(e,"upperCase")+") ";break;case"alphaUcPeriod":r=alphaNumeric(e,"upperCase")+". ";break;case"romanUcPeriod":r=romanize(e)+". ";break;case"romanLcParenR":r=romanize(e)+") ";break;case"hebrew2Minus":r=hebrew2Minus.format(e)+"-";break;default:r=String(e)}return r}function romanize(t){var s;if(!+t)return!1;const e=String(+t).split(""),r=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];let n="",i=3;for(;i--;)n=(r[+((s=e.pop())!=null?s:"")+i*10]||"")+n;return Array(+e.join("")+1).join("M")+n}const hebrew2Minus=archaicNumbers([[1e3,""],[400,"ת"],[300,"ש"],[200,"ר"],[100,"ק"],[90,"צ"],[80,"פ"],[70,"ע"],[60,"ס"],[50,"נ"],[40,"מ"],[30,"ל"],[20,"כ"],[10,"י"],[9,"ט"],[8,"ח"],[7,"ז"],[6,"ו"],[5,"ה"],[4,"ד"],[3,"ג"],[2,"ב"],[1,"א"],[/יה/,"ט״ו"],[/יו/,"ט״ז"],[/([א-ת])([א-ת])$/,"$1״$2"],[/^([א-ת])$/,"$1׳"]]);function archaicNumbers(t){return t.slice().sort(function(e,r){return r[1].length-e[1].length}),{format:function(e){let r="";return $$8.each(t,function(){const n=this[0];if(parseInt(n)>0)for(;e>=n;e-=n)r+=this[1];else r=r.replace(n,this[1])}),r}}}function alphaNumeric(t,e){t=Number(t)-1;let r="";return e=="upperCase"?r=((t/26>=1?String.fromCharCode(t/26+64):"")+String.fromCharCode(t%26+65)).toUpperCase():e=="lowerCase"&&(r=((t/26>=1?String.fromCharCode(t/26+64):"")+String.fromCharCode(t%26+65)).toLowerCase()),r}const BASE_PATH="/node_modules/file-viewer/dist/worker/";class WorkerRefImpl{constructor(e){$t(this,"worker",null);this.worker=e}defaults(e){return this.worker||e()}}function refWorker(t,e=!1){let r=null;const n=`${BASE_PATH}${t}`;return r=new Worker(new URL(n,typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__filename).href:typeof document=="undefined"?location.href:_documentCurrentScript&&_documentCurrentScript.src||new URL("index.umd.js",document.baseURI).href),{type:e?"module":"classic"}),new WorkerRefImpl(r)}const PptxWorker={create(){return refWorker("pptx.worker.js").defaults(()=>new Worker(new URL(""+(typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__dirname+"/worker/pptx.worker.js").href:new URL("worker/pptx.worker.js",typeof document=="undefined"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),self.location),{type:"module"}))}},_sfc_main$4=Vue.defineComponent({__name:"PptxRender",props:{data:null,options:{type:Function,default:DefaultOptions}},setup(t){const e=t,r=Vue.ref(null);return(()=>{const n={isDone:!1,thumbElement:null,worker:null,timer:null},i={startWorker(){n.worker&&n.worker.terminate(),n.timer&&clearInterval(n.timer);const s=n.worker=PptxWorker.create();s.addEventListener("message",a=>{this.processMessage(a.data)},!1),s.addEventListener("error",a=>{console.error(a)},!1),s.postMessage({type:"processPPTX",data:e.data,IE11:"MSInputMethodContext"in window&&"documentMode"in document,options:e.options()}),n.timer=setInterval(this.stopWorker,500)},stopWorker(){var s;n.isDone&&((s=n.worker)==null||s.terminate(),console.log("worker terminated"),n.timer&&clearInterval(n.timer))},resize(){if(r.value){const s=$$8(r.value),a=Math.max(...Array.from(s.children("section")).map(l=>l.offsetWidth)),o=s[0].offsetWidth;s.css({transform:`scale(${o/a})`,"transform-origin":"top left"})}},processMessage(s){if(n.isDone||!r.value)return;const a=$$8(r.value),{thumbElement:o}=n;switch(s.type){case"slide":console.log("正在处理:",s.slide_num),a.append(s.data);break;case"pptx-thumb":o&&$$8(o).attr("src",`data:image/jpeg;base64,${s.data}`);break;case"slideSize":break;case"globalCSS":a.append(`<style>${s.data}</style>`);break;case"ExecutionTime":case"Done":console.log("pptx渲染完成,耗时",s.data),displayChart(s.charts),n.isDone=!0;break;case"WARN":console.warn("PPTX processing warning: ",s.data);break;case"ERROR":n.isDone=!0,console.error("PPTX processing error: ",s.data);break;case"DEBUG":console.debug("Worker: ",s.data);break;case"INFO":default:console.info("Worker: ",s.data)}}};Vue.onMounted(()=>{i.startWorker()})})(),{__sfc:!0,props:e,wrapper:r}}}),PptxRender_vue_vue_type_style_index_0_scoped_1b0d57cb_lang="";var _sfc_render$4=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{ref:"wrapper",staticClass:"pptx-wrapper"})},_sfc_staticRenderFns$4=[],__component__$5=normalizeComponent$2(_sfc_main$4,_sfc_render$4,_sfc_staticRenderFns$4,!1,null,"1b0d57cb",null,null);const PptxRender=__component__$5.exports,PptxRender$1=Object.freeze(Object.defineProperty({__proto__:null,default:PptxRender},Symbol.toStringTag,{value:"Module"}));var check=function(t){return t&&t.Math===Math&&t},global$h=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal$1=="object"&&commonjsGlobal$1)||check(typeof commonjsGlobal$1=="object"&&commonjsGlobal$1)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$c=function(t){try{return!!t()}catch(e){return!0}},fails$b=fails$c,descriptors=!fails$b(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),fails$a=fails$c,functionBindNative=!fails$a(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,call$9=Function.prototype.call,functionCall=NATIVE_BIND$3?call$9.bind(call$9):function(){return call$9.apply(call$9,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var r=getOwnPropertyDescriptor$3(this,e);return!!r&&r.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$4=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$8=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$8,call$8),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(t){return function(){return call$8.apply(t,arguments)}},uncurryThis$f=functionUncurryThis,toString$5=uncurryThis$f({}.toString),stringSlice$1=uncurryThis$f("".slice),classofRaw$2=function(t){return stringSlice$1(toString$5(t),8,-1)},uncurryThis$e=functionUncurryThis,fails$9=fails$c,classof$6=classofRaw$2,$Object$3=Object,split=uncurryThis$e("".split),indexedObject=fails$9(function(){return!$Object$3("z").propertyIsEnumerable(0)})?function(t){return classof$6(t)==="String"?split(t,""):$Object$3(t)}:$Object$3,isNullOrUndefined$3=function(t){return t==null},isNullOrUndefined$2=isNullOrUndefined$3,$TypeError$c=TypeError,requireObjectCoercible$2=function(t){if(isNullOrUndefined$2(t))throw new $TypeError$c("Can't call method on "+t);return t},IndexedObject=indexedObject,requireObjectCoercible$1=requireObjectCoercible$2,toIndexedObject$4=function(t){return IndexedObject(requireObjectCoercible$1(t))},documentAll$2=typeof document=="object"&&document.all,IS_HTMLDDA=typeof documentAll$2=="undefined"&&documentAll$2!==void 0,documentAll_1={all:documentAll$2,IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$h=$documentAll$1.IS_HTMLDDA?function(t){return typeof t=="function"||t===documentAll$1}:function(t){return typeof t=="function"},isCallable$g=isCallable$h,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$b=$documentAll.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:isCallable$g(t)||t===documentAll}:function(t){return typeof t=="object"?t!==null:isCallable$g(t)},global$g=global$h,isCallable$f=isCallable$h,aFunction=function(t){return isCallable$f(t)?t:void 0},getBuiltIn$5=function(t,e){return arguments.length<2?aFunction(global$g[t]):global$g[t]&&global$g[t][e]},uncurryThis$d=functionUncurryThis,objectIsPrototypeOf=uncurryThis$d({}.isPrototypeOf),engineUserAgent=typeof navigator!="undefined"&&String(navigator.userAgent)||"",global$f=global$h,userAgent$1=engineUserAgent,process$3=global$f.process,Deno$1=global$f.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version$1;v8&&(match=v8.split("."),version$1=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$1&&(match=userAgent$1.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$1.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var engineV8Version=version$1,V8_VERSION=engineV8Version,fails$8=fails$c,global$e=global$h,$String$6=global$e.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$8(function(){var t=Symbol("symbol detection");return!$String$6(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41}),NATIVE_SYMBOL$2=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",getBuiltIn$4=getBuiltIn$5,isCallable$e=isCallable$h,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$2=Object,isSymbol$3=USE_SYMBOL_AS_UID$1?function(t){return typeof t=="symbol"}:function(t){var e=getBuiltIn$4("Symbol");return isCallable$e(e)&&isPrototypeOf$2(e.prototype,$Object$2(t))},$String$5=String,tryToString$4=function(t){try{return $String$5(t)}catch(e){return"Object"}},isCallable$d=isCallable$h,tryToString$3=tryToString$4,$TypeError$b=TypeError,aCallable$4=function(t){if(isCallable$d(t))return t;throw new $TypeError$b(tryToString$3(t)+" is not a function")},aCallable$3=aCallable$4,isNullOrUndefined$1=isNullOrUndefined$3,getMethod$3=function(t,e){var r=t[e];return isNullOrUndefined$1(r)?void 0:aCallable$3(r)},call$7=functionCall,isCallable$c=isCallable$h,isObject$a=isObject$b,$TypeError$a=TypeError,ordinaryToPrimitive$1=function(t,e){var r,n;if(e==="string"&&isCallable$c(r=t.toString)&&!isObject$a(n=call$7(r,t))||isCallable$c(r=t.valueOf)&&!isObject$a(n=call$7(r,t))||e!=="string"&&isCallable$c(r=t.toString)&&!isObject$a(n=call$7(r,t)))return n;throw new $TypeError$a("Can't convert object to primitive value")},shared$3={exports:{}},global$d=global$h,defineProperty$5=Object.defineProperty,defineGlobalProperty$3=function(t,e){try{defineProperty$5(global$d,t,{value:e,configurable:!0,writable:!0})}catch(r){global$d[t]=e}return e},global$c=global$h,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$c[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$3.exports=function(t,e){return store$2[t]||(store$2[t]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.3",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$3.exports,requireObjectCoercible=requireObjectCoercible$2,$Object$1=Object,toObject$5=function(t){return $Object$1(requireObjectCoercible(t))},uncurryThis$c=functionUncurryThis,toObject$4=toObject$5,hasOwnProperty$a=uncurryThis$c({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,r){return hasOwnProperty$a(toObject$4(e),r)},uncurryThis$b=functionUncurryThis,id=0,postfix=Math.random(),toString$4=uncurryThis$b(1 .toString),uid$2=function(t){return"Symbol("+(t===void 0?"":t)+")_"+toString$4(++id+postfix,36)},global$b=global$h,shared$2=sharedExports,hasOwn$8=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL$1=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$3=global$b.Symbol,WellKnownSymbolsStore=shared$2("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$3.for||Symbol$3:Symbol$3&&Symbol$3.withoutSetter||uid$1,wellKnownSymbol$6=function(t){return hasOwn$8(WellKnownSymbolsStore,t)||(WellKnownSymbolsStore[t]=NATIVE_SYMBOL$1&&hasOwn$8(Symbol$3,t)?Symbol$3[t]:createWellKnownSymbol("Symbol."+t)),WellKnownSymbolsStore[t]},call$6=functionCall,isObject$9=isObject$b,isSymbol$2=isSymbol$3,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$5=wellKnownSymbol$6,$TypeError$9=TypeError,TO_PRIMITIVE=wellKnownSymbol$5("toPrimitive"),toPrimitive$1=function(t,e){if(!isObject$9(t)||isSymbol$2(t))return t;var r=getMethod$2(t,TO_PRIMITIVE),n;if(r){if(e===void 0&&(e="default"),n=call$6(r,t,e),!isObject$9(n)||isSymbol$2(n))return n;throw new $TypeError$9("Can't convert object to primitive value")}return e===void 0&&(e="number"),ordinaryToPrimitive(t,e)},toPrimitive=toPrimitive$1,isSymbol$1=isSymbol$3,toPropertyKey$3=function(t){var e=toPrimitive(t,"string");return isSymbol$1(e)?e:e+""},global$a=global$h,isObject$8=isObject$b,document$1=global$a.document,EXISTS$1=isObject$8(document$1)&&isObject$8(document$1.createElement),documentCreateElement$1=function(t){return EXISTS$1?document$1.createElement(t):{}},DESCRIPTORS$9=descriptors,fails$7=fails$c,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$9&&!fails$7(function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}),DESCRIPTORS$8=descriptors,call$5=functionCall,propertyIsEnumerableModule=objectPropertyIsEnumerable,createPropertyDescriptor$3=createPropertyDescriptor$4,toIndexedObject$3=toIndexedObject$4,toPropertyKey$2=toPropertyKey$3,hasOwn$7=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$8?$getOwnPropertyDescriptor$1:function(e,r){if(e=toIndexedObject$3(e),r=toPropertyKey$2(r),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,r)}catch(n){}if(hasOwn$7(e,r))return createPropertyDescriptor$3(!call$5(propertyIsEnumerableModule.f,e,r),e[r])};var objectDefineProperty={},DESCRIPTORS$7=descriptors,fails$6=fails$c,v8PrototypeDefineBug=DESCRIPTORS$7&&fails$6(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),isObject$7=isObject$b,$String$4=String,$TypeError$8=TypeError,anObject$8=function(t){if(isObject$7(t))return t;throw new $TypeError$8($String$4(t)+" is not an object")},DESCRIPTORS$6=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$7=anObject$8,toPropertyKey$1=toPropertyKey$3,$TypeError$7=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$6?V8_PROTOTYPE_DEFINE_BUG$1?function(e,r,n){if(anObject$7(e),r=toPropertyKey$1(r),anObject$7(n),typeof e=="function"&&r==="prototype"&&"value"in n&&WRITABLE in n&&!n[WRITABLE]){var i=$getOwnPropertyDescriptor(e,r);i&&i[WRITABLE]&&(e[r]=n.value,n={configurable:CONFIGURABLE$1 in n?n[CONFIGURABLE$1]:i[CONFIGURABLE$1],enumerable:ENUMERABLE in n?n[ENUMERABLE]:i[ENUMERABLE],writable:!1})}return $defineProperty(e,r,n)}:$defineProperty:function(e,r,n){if(anObject$7(e),r=toPropertyKey$1(r),anObject$7(n),IE8_DOM_DEFINE)try{return $defineProperty(e,r,n)}catch(i){}if("get"in n||"set"in n)throw new $TypeError$7("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var DESCRIPTORS$5=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$4,createNonEnumerableProperty$5=DESCRIPTORS$5?function(t,e,r){return definePropertyModule$4.f(t,e,createPropertyDescriptor$2(1,r))}:function(t,e,r){return t[e]=r,t},makeBuiltIn$2={exports:{}},DESCRIPTORS$4=descriptors,hasOwn$6=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$4&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$6(FunctionPrototype$1,"name"),PROPER=EXISTS&&function(){}.name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$4||DESCRIPTORS$4&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$a=functionUncurryThis,isCallable$b=isCallable$h,store$1=sharedStore,functionToString=uncurryThis$a(Function.toString);isCallable$b(store$1.inspectSource)||(store$1.inspectSource=function(t){return functionToString(t)});var inspectSource$1=store$1.inspectSource,global$9=global$h,isCallable$a=isCallable$h,WeakMap$2=global$9.WeakMap,weakMapBasicDetection=isCallable$a(WeakMap$2)&&/native code/.test(String(WeakMap$2)),shared$1=sharedExports,uid=uid$2,keys$2=shared$1("keys"),sharedKey$2=function(t){return keys$2[t]||(keys$2[t]=uid(t))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$8=global$h,isObject$6=isObject$b,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$5=hasOwnProperty_1,shared=sharedStore,sharedKey$1=sharedKey$2,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$1=global$8.TypeError,WeakMap$1=global$8.WeakMap,set$3,get$3,has,enforce=function(t){return has(t)?get$3(t):set$3(t,{})},getterFor=function(t){return function(e){var r;if(!isObject$6(e)||(r=get$3(e)).type!==t)throw new TypeError$1("Incompatible receiver, "+t+" required");return r}};if(NATIVE_WEAK_MAP||shared.state){var store=shared.state||(shared.state=new WeakMap$1);store.get=store.get,store.has=store.has,store.set=store.set,set$3=function(t,e){if(store.has(t))throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);return e.facade=t,store.set(t,e),e},get$3=function(t){return store.get(t)||{}},has=function(t){return store.has(t)}}else{var STATE=sharedKey$1("state");hiddenKeys$3[STATE]=!0,set$3=function(t,e){if(hasOwn$5(t,STATE))throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);return e.facade=t,createNonEnumerableProperty$4(t,STATE,e),e},get$3=function(t){return hasOwn$5(t,STATE)?t[STATE]:{}},has=function(t){return hasOwn$5(t,STATE)}}var internalState={set:set$3,get:get$3,has,enforce,getterFor},uncurryThis$9=functionUncurryThis,fails$5=fails$c,isCallable$9=isCallable$h,hasOwn$4=hasOwnProperty_1,DESCRIPTORS$3=descriptors,CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,inspectSource=inspectSource$1,InternalStateModule=internalState,enforceInternalState=InternalStateModule.enforce,getInternalState=InternalStateModule.get,$String$3=String,defineProperty$4=Object.defineProperty,stringSlice=uncurryThis$9("".slice),replace$2=uncurryThis$9("".replace),join=uncurryThis$9([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$3&&!fails$5(function(){return defineProperty$4(function(){},"length",{value:8}).length!==8}),TEMPLATE$1=String(String).split("String"),makeBuiltIn$1=makeBuiltIn$2.exports=function(t,e,r){stringSlice($String$3(e),0,7)==="Symbol("&&(e="["+replace$2($String$3(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!hasOwn$4(t,"name")||CONFIGURABLE_FUNCTION_NAME&&t.name!==e)&&(DESCRIPTORS$3?defineProperty$4(t,"name",{value:e,configurable:!0}):t.name=e),CONFIGURABLE_LENGTH&&r&&hasOwn$4(r,"arity")&&t.length!==r.arity&&defineProperty$4(t,"length",{value:r.arity});try{r&&hasOwn$4(r,"constructor")&&r.constructor?DESCRIPTORS$3&&defineProperty$4(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var n=enforceInternalState(t);return hasOwn$4(n,"source")||(n.source=join(TEMPLATE$1,typeof e=="string"?e:"")),t};Function.prototype.toString=makeBuiltIn$1(function(){return isCallable$9(this)&&getInternalState(this).source||inspectSource(this)},"toString");var makeBuiltInExports=makeBuiltIn$2.exports,isCallable$8=isCallable$h,definePropertyModule$3=objectDefineProperty,makeBuiltIn=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$1=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(isCallable$8(r)&&makeBuiltIn(r,s,n),n.global)i?t[e]=r:defineGlobalProperty$1(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(a){}i?t[e]=r:definePropertyModule$3.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},objectGetOwnPropertyNames={},ceil=Math.ceil,floor=Math.floor,mathTrunc=Math.trunc||function(e){var r=+e;return(r>0?floor:ceil)(r)},trunc=mathTrunc,toIntegerOrInfinity$3=function(t){var e=+t;return e!==e||e===0?0:trunc(e)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max$1=Math.max,min$2=Math.min,toAbsoluteIndex$1=function(t,e){var r=toIntegerOrInfinity$2(t);return r<0?max$1(r+e,0):min$2(r,e)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min$1=Math.min,toLength$1=function(t){return t>0?min$1(toIntegerOrInfinity$1(t),9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$5=function(t){return toLength(t.length)},toIndexedObject$2=toIndexedObject$4,toAbsoluteIndex=toAbsoluteIndex$1,lengthOfArrayLike$4=lengthOfArrayLike$5,createMethod=function(t){return function(e,r,n){var i=toIndexedObject$2(e),s=lengthOfArrayLike$4(i),a=toAbsoluteIndex(n,s),o;if(t&&r!==r){for(;s>a;)if(o=i[a++],o!==o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},arrayIncludes={includes:createMethod(!0),indexOf:createMethod(!1)},uncurryThis$8=functionUncurryThis,hasOwn$3=hasOwnProperty_1,toIndexedObject$1=toIndexedObject$4,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$1=uncurryThis$8([].push),objectKeysInternal=function(t,e){var r=toIndexedObject$1(t),n=0,i=[],s;for(s in r)!hasOwn$3(hiddenKeys$2,s)&&hasOwn$3(r,s)&&push$1(i,s);for(;e.length>n;)hasOwn$3(r,s=e[n++])&&(~indexOf$1(i,s)||push$1(i,s));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$3=getBuiltIn$5,uncurryThis$7=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,anObject$6=anObject$8,concat=uncurryThis$7([].concat),ownKeys$3=getBuiltIn$3("Reflect","ownKeys")||function(e){var r=getOwnPropertyNamesModule.f(anObject$6(e)),n=getOwnPropertySymbolsModule.f;return n?concat(r,n(e)):r},hasOwn$2=hasOwnProperty_1,ownKeys$2=ownKeys$3,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$2=objectDefineProperty,copyConstructorProperties$2=function(t,e,r){for(var n=ownKeys$2(e),i=definePropertyModule$2.f,s=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var o=n[a];!hasOwn$2(t,o)&&!(r&&hasOwn$2(r,o))&&i(t,o,s(e,o))}},fails$4=fails$c,isCallable$7=isCallable$h,replacement=/#|\.prototype\./,isForced$1=function(t,e){var r=data[normalize(t)];return r===POLYFILL?!0:r===NATIVE?!1:isCallable$7(e)?fails$4(e):!!e},normalize=isForced$1.normalize=function(t){return String(t).replace(replacement,".").toLowerCase()},data=isForced$1.data={},NATIVE=isForced$1.NATIVE="N",POLYFILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$7=global$h,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn=defineBuiltIn$1,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced=isForced_1,_export=function(t,e){var r=t.target,n=t.global,i=t.stat,s,a,o,l,c,u;if(n?a=global$7:i?a=global$7[r]||defineGlobalProperty(r,{}):a=(global$7[r]||{}).prototype,a)for(o in e){if(c=e[o],t.dontCallGetSet?(u=getOwnPropertyDescriptor$2(a,o),l=u&&u.value):l=a[o],s=isForced(n?o:r+(i?".":"#")+o,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;copyConstructorProperties$1(c,l)}(t.sham||l&&l.sham)&&createNonEnumerableProperty$3(c,"sham",!0),defineBuiltIn(a,o,c,t)}},classof$5=classofRaw$2,isArray$6=Array.isArray||function(e){return classof$5(e)==="Array"},DESCRIPTORS$2=descriptors,isArray$5=isArray$6,$TypeError$6=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$2&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(t,e){if(isArray$5(t)&&!getOwnPropertyDescriptor$1(t,"length").writable)throw new $TypeError$6("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},$TypeError$5=TypeError,MAX_SAFE_INTEGER$2=9007199254740991,doesNotExceedSafeInteger$2=function(t){if(t>MAX_SAFE_INTEGER$2)throw $TypeError$5("Maximum allowed index exceeded");return t},$$7=_export,toObject$3=toObject$5,lengthOfArrayLike$3=lengthOfArrayLike$5,setArrayLength$1=arraySetLength,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,fails$3=fails$c,INCORRECT_TO_LENGTH=fails$3(function(){return[].push.call({length:4294967296},1)!==4294967297}),properErrorOnNonWritableLength$1=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},FORCED$2=INCORRECT_TO_LENGTH||!properErrorOnNonWritableLength$1();$$7({target:"Array",proto:!0,arity:1,forced:FORCED$2},{push:function(e){var r=toObject$3(this),n=lengthOfArrayLike$3(r),i=arguments.length;doesNotExceedSafeInteger$1(n+i);for(var s=0;s<i;s++)r[n]=arguments[s],n++;return setArrayLength$1(r,n),n}});var NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$6=FunctionPrototype.apply,call$4=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND$1?call$4.bind(apply$6):function(){return call$4.apply(apply$6,arguments)}),uncurryThis$6=functionUncurryThis,aCallable$2=aCallable$4,functionUncurryThisAccessor=function(t,e,r){try{return uncurryThis$6(aCallable$2(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(n){}},isCallable$6=isCallable$h,$String$2=String,$TypeError$4=TypeError,aPossiblePrototype$1=function(t){if(typeof t=="object"||isCallable$6(t))return t;throw new $TypeError$4("Can't set "+$String$2(t)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$5=anObject$8,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=uncurryThisAccessor(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch(n){}return function(i,s){return anObject$5(i),aPossiblePrototype(s),t?r(i,s):i.__proto__=s,i}}():void 0),defineProperty$3=objectDefineProperty.f,proxyAccessor$1=function(t,e,r){r in t||defineProperty$3(t,r,{configurable:!0,get:function(){return e[r]},set:function(n){e[r]=n}})},isCallable$5=isCallable$h,isObject$5=isObject$b,setPrototypeOf$2=objectSetPrototypeOf,inheritIfRequired$1=function(t,e,r){var n,i;return setPrototypeOf$2&&isCallable$5(n=e.constructor)&&n!==r&&isObject$5(i=n.prototype)&&i!==r.prototype&&setPrototypeOf$2(t,i),t},wellKnownSymbol$4=wellKnownSymbol$6,TO_STRING_TAG$1=wellKnownSymbol$4("toStringTag"),test={};test[TO_STRING_TAG$1]="z";var toStringTagSupport=String(test)==="[object z]",TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$4=isCallable$h,classofRaw$1=classofRaw$2,wellKnownSymbol$3=wellKnownSymbol$6,TO_STRING_TAG=wellKnownSymbol$3("toStringTag"),$Object=Object,CORRECT_ARGUMENTS=classofRaw$1(function(){return arguments}())==="Arguments",tryGet=function(t,e){try{return t[e]}catch(r){}},classof$4=TO_STRING_TAG_SUPPORT?classofRaw$1:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=tryGet(e=$Object(t),TO_STRING_TAG))=="string"?r:CORRECT_ARGUMENTS?classofRaw$1(e):(n=classofRaw$1(e))==="Object"&&isCallable$4(e.callee)?"Arguments":n},classof$3=classof$4,$String$1=String,toString$3=function(t){if(classof$3(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String$1(t)},toString$2=toString$3,normalizeStringArgument$1=function(t,e){return t===void 0?arguments.length<2?"":e:toString$2(t)},isObject$4=isObject$b,createNonEnumerableProperty$2=createNonEnumerableProperty$5,installErrorCause$1=function(t,e){isObject$4(e)&&"cause"in e&&createNonEnumerableProperty$2(t,"cause",e.cause)},uncurryThis$5=functionUncurryThis,$Error=Error,replace$1=uncurryThis$5("".replace),TEST=function(t){return String(new $Error(t).stack)}("zxcasd"),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(t,e){if(IS_V8_OR_CHAKRA_STACK&&typeof t=="string"&&!$Error.prepareStackTrace)for(;e--;)t=replace$1(t,V8_OR_CHAKRA_STACK_ENTRY,"");return t},fails$2=fails$c,createPropertyDescriptor$1=createPropertyDescriptor$4,errorStackInstallable=!fails$2(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",createPropertyDescriptor$1(1,7)),t.stack!==7):!0}),createNonEnumerableProperty$1=createNonEnumerableProperty$5,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(t,e,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(t,e):createNonEnumerableProperty$1(t,"stack",clearErrorStack(r,n)))},getBuiltIn$2=getBuiltIn$5,hasOwn$1=hasOwnProperty_1,createNonEnumerableProperty=createNonEnumerableProperty$5,isPrototypeOf$1=objectIsPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$2,proxyAccessor=proxyAccessor$1,inheritIfRequired=inheritIfRequired$1,normalizeStringArgument=normalizeStringArgument$1,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,DESCRIPTORS$1=descriptors,wrapErrorConstructorWithCause$1=function(t,e,r,n){var i="stackTraceLimit",s=n?2:1,a=t.split("."),o=a[a.length-1],l=getBuiltIn$2.apply(null,a);if(l){var c=l.prototype;if(hasOwn$1(c,"cause")&&delete c.cause,!r)return l;var u=getBuiltIn$2("Error"),d=e(function(h,f){var g=normalizeStringArgument(n?f:h,void 0),p=n?new l(h):new l;return g!==void 0&&createNonEnumerableProperty(p,"message",g),installErrorStack(p,d,p.stack,2),this&&isPrototypeOf$1(c,this)&&inheritIfRequired(p,this,d),arguments.length>s&&installErrorCause(p,arguments[s]),p});d.prototype=c,o!=="Error"?setPrototypeOf$1?setPrototypeOf$1(d,u):copyConstructorProperties(d,u,{name:!0}):DESCRIPTORS$1&&i in l&&(proxyAccessor(d,l,i),proxyAccessor(d,l,"prepareStackTrace")),copyConstructorProperties(d,l);try{c.name!==o&&createNonEnumerableProperty(c,"name",o),c.constructor=d}catch(h){}return d}},$$6=_export,global$6=global$h,apply$5=functionApply,wrapErrorConstructorWithCause=wrapErrorConstructorWithCause$1,WEB_ASSEMBLY="WebAssembly",WebAssembly=global$6[WEB_ASSEMBLY],FORCED$1=new Error("e",{cause:7}).cause!==7,exportGlobalErrorCauseWrapper=function(t,e){var r={};r[t]=wrapErrorConstructorWithCause(t,e,FORCED$1),$$6({global:!0,constructor:!0,arity:1,forced:FORCED$1},r)},exportWebAssemblyErrorCauseWrapper=function(t,e){if(WebAssembly&&WebAssembly[t]){var r={};r[t]=wrapErrorConstructorWithCause(WEB_ASSEMBLY+"."+t,e,FORCED$1),$$6({target:WEB_ASSEMBLY,stat:!0,constructor:!0,arity:1,forced:FORCED$1},r)}};exportGlobalErrorCauseWrapper("Error",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("EvalError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("RangeError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("ReferenceError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("SyntaxError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("TypeError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("URIError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("CompileError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("LinkError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("RuntimeError",function(t){return function(r){return apply$5(t,this,arguments)}});var classofRaw=classofRaw$2,uncurryThis$4=functionUncurryThis,functionUncurryThisClause=function(t){if(classofRaw(t)==="Function")return uncurryThis$4(t)},uncurryThis$3=functionUncurryThisClause,aCallable$1=aCallable$4,NATIVE_BIND=functionBindNative,bind$2=uncurryThis$3(uncurryThis$3.bind),functionBindContext=function(t,e){return aCallable$1(t),e===void 0?t:NATIVE_BIND?bind$2(t,e):function(){return t.apply(e,arguments)}},getBuiltIn$1=getBuiltIn$5,html$4=getBuiltIn$1("document","documentElement"),uncurryThis$2=functionUncurryThis,arraySlice$3=uncurryThis$2([].slice),$TypeError$3=TypeError,validateArgumentsLength$2=function(t,e){if(t<e)throw new $TypeError$3("Not enough arguments");return t},userAgent=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent),global$5=global$h,classof$2=classofRaw$2,engineIsNode=classof$2(global$5.process)==="process",global$4=global$h,apply$4=functionApply,bind$1=functionBindContext,isCallable$3=isCallable$h,hasOwn=hasOwnProperty_1,fails$1=fails$c,html$3=html$4,arraySlice$2=arraySlice$3,createElement=documentCreateElement$1,validateArgumentsLength$1=validateArgumentsLength$2,IS_IOS=engineIsIos,IS_NODE=engineIsNode,set$2=global$4.setImmediate,clear=global$4.clearImmediate,process$2=global$4.process,Dispatch=global$4.Dispatch,Function$2=global$4.Function,MessageChannel$1=global$4.MessageChannel,String$1=global$4.String,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;fails$1(function(){$location=global$4.location});var run=function(t){if(hasOwn(queue,t)){var e=queue[t];delete queue[t],e()}},runner=function(t){return function(){run(t)}},eventListener=function(t){run(t.data)},globalPostMessageDefer=function(t){global$4.postMessage(String$1(t),$location.protocol+"//"+$location.host)};(!set$2||!clear)&&(set$2=function(e){validateArgumentsLength$1(arguments.length,1);var r=isCallable$3(e)?e:Function$2(e),n=arraySlice$2(arguments,1);return queue[++counter]=function(){apply$4(r,void 0,n)},defer(counter),counter},clear=function(e){delete queue[e]},IS_NODE?defer=function(t){process$2.nextTick(runner(t))}:Dispatch&&Dispatch.now?defer=function(t){Dispatch.now(runner(t))}:MessageChannel$1&&!IS_IOS?(channel=new MessageChannel$1,port=channel.port2,channel.port1.onmessage=eventListener,defer=bind$1(port.postMessage,port)):global$4.addEventListener&&isCallable$3(global$4.postMessage)&&!global$4.importScripts&&$location&&$location.protocol!=="file:"&&!fails$1(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$4.addEventListener("message",eventListener,!1)):ONREADYSTATECHANGE in createElement("script")?defer=function(t){html$3.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$3.removeChild(this),run(t)}}:defer=function(t){setTimeout(runner(t),0)});var task={set:set$2,clear},$$5=_export,global$3=global$h,clearImmediate$1=task.clear;$$5({global:!0,bind:!0,enumerable:!0,forced:global$3.clearImmediate!==clearImmediate$1},{clearImmediate:clearImmediate$1});var engineIsBun=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",global$2=global$h,apply$3=functionApply,isCallable$2=isCallable$h,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$1=arraySlice$3,validateArgumentsLength=validateArgumentsLength$2,Function$1=global$2.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var t=global$2.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),schedulersFix$1=function(t,e){var r=e?2:1;return WRAP?function(n,i){var s=validateArgumentsLength(arguments.length,1)>r,a=isCallable$2(n)?n:Function$1(n),o=s?arraySlice$1(arguments,r):[],l=s?function(){apply$3(a,this,o)}:a;return e?t(l,i):t(l)}:t},$$4=_export,global$1=global$h,setTask=task.set,schedulersFix=schedulersFix$1,setImmediate$1=global$1.setImmediate?schedulersFix(setTask,!1):setTask;$$4({global:!0,bind:!0,enumerable:!0,forced:global$1.setImmediate!==setImmediate$1},{setImmediate:setImmediate$1});/*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */function _typeof$3(t){"@babel/helpers - typeof";return _typeof$3=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},_typeof$3(t)}function _setPrototypeOf$1(t,e){return _setPrototypeOf$1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_setPrototypeOf$1(t,e)}function _isNativeReflectConstruct$1(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _construct(t,e,r){return _isNativeReflectConstruct$1()?_construct=Reflect.construct:_construct=function(i,s,a){var o=[null];o.push.apply(o,s);var l=Function.bind.apply(i,o),c=new l;return a&&_setPrototypeOf$1(c,a.prototype),c},_construct.apply(null,arguments)}function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_unsupportedIterableToArray(t)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray$1(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _unsupportedIterableToArray(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(t,e)}}function _arrayLikeToArray(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
80
|
+
`):[];if(l.length)return l;if(isArray$7(o))return o;var c=a.tickWidth;(!c||c<=0)&&(c=i?95:a.isCategory?Math.ceil(a.isInverted?r(n[0])-r(n[1]):r(n[1])-r(n[0]))-12:110);function u(d,h){for(var f,g,p,m=1;m<h.length;m++)if(h.charAt(m)===" "&&(g=m),f=h.substr(0,m+1),p=s*f.length,c<p)return u(d.concat(h.substr(0,g||m)),h.slice(g?g+1:m));return d.concat(h)}return u(l,String(o))},t.prototype.scale=function(e){return arguments.length?(this.helper.scale=e,this):this.helper.scale},t.prototype.orient=function(e){return arguments.length?(this.config.orient=e in{top:1,right:1,bottom:1,left:1}?String(e):"bottom",this):this.config.orient},t.prototype.tickFormat=function(e){var r=this.config;return arguments.length?(r.tickFormat=e,this):r.tickFormat},t.prototype.tickCentered=function(e){var r=this.config;return arguments.length?(r.tickCentered=e,this):r.tickCentered},t.prototype.tickOffset=function(){return this.config.tickOffset},t.prototype.tickInterval=function(e){var r=this,n=this.config,i=n.outerTickSize,s=n.tickOffset,a=n.tickValues,o;if(this.params.isCategory)o=s*2;else{var l=this.g.select("path.domain").node().getTotalLength()-i*2;o=l/(e||this.g.selectAll("line").size());var c=a?a.map(function(u,d,h){var f=d+1;return f<h.length?r.helper.scale(h[f])-r.helper.scale(u):null}).filter(Boolean):[];o=Math.min.apply(Math,__spreadArray(__spreadArray([],c,!1),[o],!1))}return o===1/0?0:o},t.prototype.ticks=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=this.config;return e.length?(n.tickArguments=toArray$1(e),this):n.tickArguments},t.prototype.tickCulling=function(e){var r=this.config;return arguments.length?(r.tickCulling=e,this):r.tickCulling},t.prototype.tickValues=function(e){var r=this,n=this.config;if(isFunction$4(e))n.tickValues=function(){return e(r.helper.scale.domain())};else{if(!arguments.length)return n.tickValues;n.tickValues=e}return this},t.prototype.setTransition=function(e){return this.config.transition=e,this},t}(),axis={getAxisInstance:function(){return this.axis||new Axis(this)}},Axis=function(){function t(e){this.axesList={},this.tick={x:null,y:null,y2:null},this.xs=[],this.orient={x:"bottom",y:"left",y2:"right",subX:"bottom"},this.owner=e,this.setOrient()}return t.prototype.getAxisClassName=function(e){return"".concat($AXIS.axis," ").concat($AXIS["axis".concat(capitalize(e))])},t.prototype.isHorizontal=function(e,r){var n=e.config.axis_rotated;return r?n:!n},t.prototype.isCategorized=function(){var e=this.owner,r=e.config,n=e.state;return r.axis_x_type.indexOf("category")>=0||n.hasRadar},t.prototype.isCustomX=function(){var e=this.owner.config;return!this.isTimeSeries()&&(e.data_x||notEmpty(e.data_xs))},t.prototype.isTimeSeries=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="timeseries"},t.prototype.isLog=function(e){return e===void 0&&(e="x"),this.owner.config["axis_".concat(e,"_type")]==="log"},t.prototype.isTimeSeriesY=function(){return this.isTimeSeries("y")},t.prototype.getAxisType=function(e){e===void 0&&(e="x");var r="linear";return this.isTimeSeries(e)?r=this.owner.config.axis_x_localtime?"time":"utc":this.isLog(e)&&(r="log"),r},t.prototype.init=function(){var e=this,r=this.owner,n=r.config,i=r.$el,s=i.main,a=i.axis,o=r.state.clip,l=n.axis_rotated,c=["x","y"];n.axis_y2_show&&c.push("y2"),c.forEach(function(u){var d=e.getAxisClassName(u),h=$AXIS["axis".concat(u.toUpperCase(),"Label")];a[u]=s.append("g").attr("class",d).attr("clip-path",function(){var f=null;return u==="x"?f=o.pathXAxis:u==="y"&&(f=o.pathYAxis),f}).attr("transform",r.getTranslate(u)).style("visibility",n["axis_".concat(u,"_show")]?null:"hidden"),a[u].append("text").attr("class",h).attr("transform",["rotate(-90)",null][u==="x"?+!l:+l]).style("text-anchor",function(){return e.textAnchorForAxisLabel(u)}),e.generateAxes(u)})},t.prototype.setOrient=function(){var e=this.owner,r=e.config,n=r.axis_rotated,i=r.axis_y_inner,s=r.axis_y2_inner;this.orient={x:n?"left":"bottom",y:n?i?"top":"bottom":i?"right":"left",y2:n?s?"bottom":"top":s?"left":"right",subX:n?"left":"bottom"}},t.prototype.generateAxes=function(e){var r=this.owner,n=r.config,i=[],s=n["axis_".concat(e,"_axes")],a=n.axis_rotated,o;e==="x"?o=a?axisLeft:axisBottom:e==="y"?o=a?axisBottom:axisLeft:e==="y2"&&(o=a?axisTop:axisRight),s.length&&s.forEach(function(l){var c=l.tick||{},u=r.scale[e].copy();l.domain&&u.domain(l.domain),i.push(o(u).ticks(c.count).tickFormat(isFunction$4(c.format)?c.format.bind(r.api):function(d){return d}).tickValues(c.values).tickSizeOuter(c.outer===!1?0:6))}),this.axesList[e]=i},t.prototype.updateAxes=function(){var e=this,r=this.owner,n=r.config,i=r.$el.main,s=r.$T;Object.keys(this.axesList).forEach(function(a){var o=n["axis_".concat(a,"_axes")],l=r.scale[a].copy(),c=l.range();e.axesList[a].forEach(function(u,d){var h=u.scale().range();c.every(function(p,m){return p===h[m]})||u.scale().range(c);var f="".concat(e.getAxisClassName(a),"-").concat(d+1),g=i.select(".".concat(f.replace(/\s/,".")));g.empty()?g=i.append("g").attr("class",f).style("visibility",n["axis_".concat(a,"_show")]?null:"hidden").call(u):(o[d].domain&&l.domain(o[d].domain),s(g).call(u.scale(l))),g.attr("transform",r.getTranslate(a,d+1))})})},t.prototype.setAxis=function(e,r,n,i){var s=this.owner;e!=="subX"&&(this.tick[e]=this.getTickValues(e)),this[e]=this.getAxis(e,r,n,e==="x"&&(s.scale.zoom||s.config.subchart_show||s.state.resizing)?!0:i)},t.prototype.getAxis=function(e,r,n,i,s){var a=this.owner,o=a.config,l=/^(x|subX)$/.test(e),c=l?"x":e,u=l&&this.isCategorized(),d=this.orient[e],h=s?0:a.getAxisTickRotate(c),f;if(l)f=e==="subX"?a.format.subXAxisTick:a.format.xAxisTick;else{var g=o["axis_".concat(e,"_tick_format")];isFunction$4(g)&&(f=g.bind(a.api))}var p=this.tick[c],m=mergeObj({outerTick:n,noTransition:i,config:o,id:e,tickTextRotate:h,owner:a},l&&{isCategory:u,isInverted:o.axis_x_inverted,tickMultiline:o.axis_x_tick_multiline,tickWidth:o.axis_x_tick_width,tickTitle:u&&o.axis_x_tick_tooltip&&a.api.categories(),orgXScale:a.scale.x});l||(m.tickStepSize=o["axis_".concat(c,"_tick_stepSize")]);var v=new AxisRenderer(m).scale(l&&a.scale.zoom||r).orient(d);if(l&&this.isTimeSeries()&&p&&!isFunction$4(p)){var _=parseDate.bind(a);p=p.map(function(C){return _(C)})}else!l&&this.isTimeSeriesY()&&(v.ticks(o.axis_y_tick_time_value),p=null);p&&v.tickValues(p),v.tickFormat(f||!l&&a.isStackNormalized()&&function(C){return"".concat(C,"%")}),u&&(v.tickCentered(o.axis_x_tick_centered),isEmpty$1(o.axis_x_tick_culling)&&(o.axis_x_tick_culling=!1));var b=o["axis_".concat(c,"_tick_count")];return b&&v.ticks(b),v},t.prototype.updateXAxisTickValues=function(e,r){var n,i=this.owner,s=i.config,a=s.axis_x_tick_fit,o=s.axis_x_tick_count,l;return(a||o&&a)&&(l=i.mapTargetsToUniqueXs(e),this.isCategorized()&&o>l.length&&(o=l.length),l=this.generateTickValues(l,o,this.isTimeSeries())),r?r.tickValues(l):this.x&&(this.x.tickValues(l),(n=this.subX)===null||n===void 0||n.tickValues(l)),l},t.prototype.getId=function(e){var r=this.owner,n=r.config,i=r.scale,s=n.data_axes[e];return(!s||!i[s])&&(s="y"),s},t.prototype.getXAxisTickFormat=function(e){var r=this.owner,n=r.config,i=r.format,s=e&&n.subchart_axis_x_tick_format||n.axis_x_tick_format,a=this.isTimeSeries(),o=this.isCategorized(),l;return s?isFunction$4(s)?l=s.bind(r.api):a&&(l=function(c){return c?i.axisTime(s)(c):""}):l=a?i.defaultAxisTime:o?r.categoryName:function(c){return c<0?c.toFixed(0):c},isFunction$4(l)?function(c){return l.apply(r,o?[c,r.categoryName(c)]:[c])}:l},t.prototype.getTickValues=function(e){var r=this.owner,n=r.config["axis_".concat(e,"_tick_values")],i=r["".concat(e,"Axis")];return(isFunction$4(n)?n.call(r.api):n)||(i?i.tickValues():void 0)},t.prototype.getLabelOptionByAxisId=function(e){return this.owner.config["axis_".concat(e,"_label")]},t.prototype.getLabelText=function(e){var r=this.getLabelOptionByAxisId(e);return isString$2(r)?r:r?r.text:null},t.prototype.setLabelText=function(e,r){var n=this.owner,i=n.config,s=this.getLabelOptionByAxisId(e);isString$2(s)?i["axis_".concat(e,"_label")]=r:s&&(s.text=r)},t.prototype.getLabelPosition=function(e,r){var n=this.owner.config.axis_rotated,i=this.getLabelOptionByAxisId(e),s=isObjectType(i)&&i.position?i.position:r[+!n],a=function(o){return!!~s.indexOf(o)};return{isInner:a("inner"),isOuter:a("outer"),isLeft:a("left"),isCenter:a("center"),isRight:a("right"),isTop:a("top"),isMiddle:a("middle"),isBottom:a("bottom")}},t.prototype.getAxisLabelPosition=function(e){return this.getLabelPosition(e,e==="x"?["inner-top","inner-right"]:["inner-right","inner-top"])},t.prototype.getLabelPositionById=function(e){return this.getAxisLabelPosition(e)},t.prototype.xForAxisLabel=function(e){var r=this.owner,n=r.state,i=n.width,s=n.height,a=this.getAxisLabelPosition(e),o=a.isMiddle?-s/2:0;return this.isHorizontal(r,e!=="x")?o=a.isLeft?0:a.isCenter?i/2:i:a.isBottom&&(o=-s),o},t.prototype.dxForAxisLabel=function(e){var r=this.owner,n=this.getAxisLabelPosition(e),i=n.isBottom?"0.5em":"0";return this.isHorizontal(r,e!=="x")?i=n.isLeft?"0.5em":n.isRight?"-0.5em":"0":n.isTop&&(i="-0.5em"),i},t.prototype.textAnchorForAxisLabel=function(e){var r=this.owner,n=this.getAxisLabelPosition(e),i=n.isMiddle?"middle":"end";return this.isHorizontal(r,e!=="x")?i=n.isLeft?"start":n.isCenter?"middle":"end":n.isBottom&&(i="start"),i},t.prototype.dyForAxisLabel=function(e){var r=this.owner,n=r.config,i=n.axis_rotated,s=this.getAxisLabelPosition(e).isInner,a=n["axis_".concat(e,"_tick_rotate")]?r.getHorizontalAxisHeight(e):0,o=this.getMaxTickSize(e).width,l;if(e==="x"){var c=n.axis_x_height;i?l=s?"1.2em":-25-o:s?l="-0.5em":c?l=c-10:a?l=a-10:l="3em"}else l={y:["-0.5em",10,"3em","1.2em",10],y2:["1.2em",-20,"-2.2em","-0.5em",15]}[e],i?s?l=l[0]:a?l=a*(e==="y2"?-1:1)-l[1]:l=l[2]:l=s?l[3]:(l[4]+(n["axis_".concat(e,"_inner")]?0:o+l[4]))*(e==="y"?-1:1);return l},t.prototype.getMaxTickSize=function(e,r){var n=this.owner,i=n.config,s=n.state.current,a=n.$el,o=a.svg,l=a.chart,c=s.maxTickSize[e],u="axis_".concat(e),d={width:0,height:0};if(r||!i["".concat(u,"_show")]||c.width>0&&n.filterTargetsToShow().length===0)return c;if(o){var h=/^y2?$/.test(e),f=n.filterTargetsToShow(n.data.targets),g=n.scale[e].copy().domain(n["get".concat(h?"Y":"X","Domain")](f,e)),p=g.domain(),m=p[0]===p[1]&&p.every(function(A){return A>0}),v=isArray$7(c.domain)&&c.domain[0]===c.domain[1]&&c.domain.every(function(A){return A>0});if(m||v)return c.size;c.domain=p,h||c.ticks.splice(0);var _=this.getAxis(e,g,!1,!1,!0),b=i["".concat(u,"_tick_rotate")],C=i["".concat(u,"_tick_count")],S=i["".concat(u,"_tick_values")];!S&&C&&_.tickValues(this.generateTickValues(p,C,h?this.isTimeSeriesY():this.isTimeSeries())),!h&&this.updateXAxisTickValues(f,_);var w=l.append("svg").style("visibility","hidden").style("position","fixed").style("top","0").style("left","0");_.create(w),w.selectAll("text").attr("transform",isNumber$2(b)?"rotate(".concat(b,")"):null).each(function(A,O){var T=this.getBoundingClientRect(),H=T.width,k=T.height;d.width=Math.max(d.width,H),d.height=Math.max(d.height,k),h||(c.ticks[O]=H)}),w.remove()}return Object.keys(d).forEach(function(A){d[A]>0&&(c[A]=d[A])}),c},t.prototype.getXAxisTickTextY2Overflow=function(e){var r=this.owner,n=r.axis,i=r.config,s=r.state,a=r.getAxisTickRotate("x"),o=a>0&&a<90;if((n.isCategorized()||n.isTimeSeries())&&i.axis_x_tick_fit&&(!i.axis_x_tick_culling||isEmpty$1(i.axis_x_tick_culling))&&!i.axis_x_tick_multiline&&o){var l=s.current.width-r.getCurrentPaddingByDirection("left"),c=this.getXAxisTickMaxOverflow(a,l-e),u=Math.max(0,c)+e;return Math.min(u,l/2)}return 0},t.prototype.getXAxisTickMaxOverflow=function(e,r){for(var n=this.owner,i=n.axis,s=n.config,a=n.state,o=i.isTimeSeries(),l=a.current.maxTickSize.x.ticks,c=l.length,u=a.axis.x.padding,d=u.left,h=u.right,f=0,g=c-(o&&s.axis_x_tick_fit?.5:0),p=0;p<c;p++){var m=p+1,v=Math.cos(Math.PI*e/180)*l[p],_=m-(o?1:.5)+d;if(!(_<=0)){var b=r-v,C=b/_,S=g-m,w=h*C,A=S*C+w,O=v-C/2-A;f=Math.max(f,O)}}var T=n.filterTargetsToShow(n.data.targets),H=0;if(!o&&s.axis_x_tick_count<=T.length&&T[0].values.length){var k=getScale(n.axis.getAxisType("x"),0,r-f).domain([d*-1,n.getXDomainMax(n.data.targets)+1+h]);H=Math.ceil((k(1)-k(0))/2)}return f+H},t.prototype.updateLabels=function(e){var r=this,n=this.owner,i=n.$el.main,s=n.$T,a={x:i.select(".".concat($AXIS.axisX," .").concat($AXIS.axisXLabel)),y:i.select(".".concat($AXIS.axisY," .").concat($AXIS.axisYLabel)),y2:i.select(".".concat($AXIS.axisY2," .").concat($AXIS.axisY2Label))};Object.keys(a).filter(function(o){return!a[o].empty()}).forEach(function(o){var l=a[o];s(l,e).attr("x",function(){return r.xForAxisLabel(o)}).attr("dx",function(){return r.dxForAxisLabel(o)}).attr("dy",function(){return r.dyForAxisLabel(o)}).text(function(){return r.getLabelText(o)})})},t.prototype.getPadding=function(e,r,n,i){var s=isNumber$2(e)?e:e[r];return isValue(s)?this.owner.convertPixelToScale(/(bottom|top)/.test(r)?"y":"x",s,i):n},t.prototype.generateTickValues=function(e,r,n){var i=e;if(r){var s=isFunction$4(r)?r():r;if(s===1)i=[e[0]];else if(s===2)i=[e[0],e[e.length-1]];else if(s>2){var a=this.isCategorized(),o=s-2,l=e[0],c=e[e.length-1],u=(c-l)/(o+1),d=void 0;i=[l];for(var h=0;h<o;h++)d=+l+u*(h+1),i.push(n?new Date(d):a?Math.round(d):d);i.push(c)}}return n||(i=i.sort(function(f,g){return f-g})),i},t.prototype.generateTransitions=function(e){var r=this.owner,n=r.$el.axis,i=r.$T,s=["x","y","y2","subX"].map(function(u){return i(n[u],e)}),a=s[0],o=s[1],l=s[2],c=s[3];return{axisX:a,axisY:o,axisY2:l,axisSubX:c}},t.prototype.redraw=function(e,r,n){var i=this,s=this.owner,a=s.config,o=s.$el,l=r?"0":null;["x","y","y2","subX"].forEach(function(c){var u=i[c],d=o.axis[c];u&&d&&(!n&&!a.transition_duration&&(u.config.withoutTransition=!0),d.style("opacity",l),u.create(e["axis".concat(capitalize(c))]))}),this.updateAxes()},t.prototype.redrawAxis=function(e,r,n,i,s){var a=this,o,l,c,u=this.owner,d=u.config,h=u.scale,f=u.$el,g=!!h.zoom,p;!g&&this.isCategorized()&&e.length===0&&h.x.domain([0,f.axis.x.selectAll(".tick").size()]),h.x&&e.length?(!g&&u.updateXDomain(e,r.UpdateXDomain,r.UpdateOrgXDomain,r.TrimXDomain),d.axis_x_tick_values||this.updateXAxisTickValues(e)):this.x&&(this.x.tickValues([]),(o=this.subX)===null||o===void 0||o.tickValues([])),d.zoom_rescale&&!i&&(p=h.x.orgDomain()),["y","y2"].forEach(function(m){var v="axis_".concat(m,"_"),_=h[m];if(_){var b=d["".concat(v,"tick_values")],C=d["".concat(v,"tick_count")];if(_.domain(u.getYDomain(e,m,p)),!b&&C){var S=u.axis[m],w=_.domain();S.tickValues(a.generateTickValues(w,w.every(function(A){return A===0})?1:C,a.isTimeSeriesY()))}}}),this.redraw(n,u.hasArcType(),s),this.updateLabels(r.Transition),(r.UpdateXDomain||r.UpdateXAxis||r.Y)&&e.length&&this.setCulling(),r.Y&&((l=h.subY)===null||l===void 0||l.domain(u.getYDomain(e,"y")),(c=h.subY2)===null||c===void 0||c.domain(u.getYDomain(e,"y2")))},t.prototype.setCulling=function(){var e=this.owner,r=e.config,n=e.state,i=n.clip,s=n.current,a=e.$el;["subX","x","y","y2"].forEach(function(o){var l=a.axis[o],c=o==="subX"?"x":o,u="axis_".concat(c,"_tick_culling"),d=r[u];if(l&&d){var h=l.selectAll(".tick"),f=sortValue(h.data()),g=f.length,p=r["".concat(u,"_max")],m=r["".concat(u,"_lines")],v;if(g){for(var _=1;_<g;_++)if(g/_<p){v=_;break}h.each(function(C){var S=m?this.querySelector("text"):this;S&&(S.style.display=f.indexOf(C)%v?"none":null)})}else h.style("display",null);if(o==="x"){var b=s.maxTickSize.x.clipPath?i.pathXAxisTickTexts:null;a.svg.selectAll(".".concat($AXIS.axisX," .tick text")).attr("clip-path",b)}}})},t}(),eventrect={initEventRect:function(){var t=this;t.$el.main.select(".".concat($COMMON.chart)).append("g").attr("class",$EVENT.eventRects).style("fill-opacity","0")},redrawEventRect:function(){var t,e=this,r=e.config,n=e.state,i=e.$el,s=e.isMultipleX(),a=r.axis_x_inverted;if(i.eventRect)e.updateEventRect(i.eventRect,!0);else if(e.data.targets.length){var o=e.$el.main.select(".".concat($EVENT.eventRects)).style("cursor",r.zoom_enabled&&r.zoom_type!=="drag"?r.axis_rotated?"ns-resize":"ew-resize":null).classed($EVENT.eventRectsMultiple,s).classed($EVENT.eventRectsSingle,!s),l=o.selectAll(".".concat($EVENT.eventRect)).data([0]).enter().append("rect");e.updateEventRect(l),s?e.generateEventRectsForMultipleXs(l):e.generateEventRectsForSingleX(l),l.call(e.getDraggableSelection()),i.eventRect=l,e.state.inputType==="touch"&&!i.svg.on("touchstart.eventRect")&&!e.hasArcType()&&e.bindTouchOnEventRect(),n.rendered&&e.updateEventRect(i.eventRect,!0)}if(!s){var c=e.getMaxDataCountTarget();(!r.data_xSort||a)&&c.sort(function(u,d){return a?d.x-u.x:u.x-d.x}),e.updateDataIndexByX(c),e.updateXs(c),(t=e.updatePointClass)===null||t===void 0||t.call(e,!0),n.eventReceiver.data=c}e.updateEventRectData()},bindTouchOnEventRect:function(){var t=this,e=t.config,r=t.state,n=t.$el,i=n.eventRect,s=n.svg,a=function(f){if(t.isMultipleX())t.selectRectForMultipleXs(f);else{var g=t.getDataIndexFromEvent(r.event);t.callOverOutForTouch(g),g===-1?t.unselectRect():t.selectRectForSingle(f,g)}},o=function(){t.unselectRect(),t.callOverOutForTouch()},l=e.interaction_inputType_touch.preventDefault,c=isboolean(l)&&l||!1,u=!isNaN(l)&&l||null,d,h=function(f){var g=f.type,p=f.changedTouches[0],m=p["client".concat(e.axis_rotated?"Y":"X")];g==="touchstart"?c?f.preventDefault():u!==null&&(d=m):g==="touchmove"&&(c||d===!0||u!==null&&Math.abs(d-m)>=u)&&(d=!0,f.preventDefault())};i.on("touchstart",function(f){r.event=f,t.updateEventRect()}).on("touchstart.eventRect touchmove.eventRect",function(f){if(r.event=f,!i.empty()&&i.classed($EVENT.eventRect)){if(r.dragging||r.flowing||t.hasArcType()||f.touches.length>1)return;h(f),a(i.node())}else o()},!0).on("touchend.eventRect",function(f){r.event=f,!i.empty()&&i.classed($EVENT.eventRect)&&(t.hasArcType()||!t.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)},!0),s.on("touchstart",function(f){r.event=f;var g=f.target;g&&g!==i.node()&&o()})},updateEventRect:function(t,e){e===void 0&&(e=!1);var r=this,n=r.state,i=r.$el,s=n.eventReceiver,a=n.width,o=n.height,l=n.rendered,c=n.resizing,u=t||i.eventRect,d=function(){s&&(s.rect=u.node().getBoundingClientRect())};(!l||c||e)&&(u.attr("x",0).attr("y",0).attr("width",a).attr("height",o),(!l||e)&&u.classed($EVENT.eventRect,!0)),d()},updateEventRectData:function(){var t=this,e=t.config,r=t.scale,n=t.state,i=r.zoom||r.x,s=e.axis_rotated,a,o,l,c;if(t.isMultipleX())a=0,o=0,l=n.width,c=n.height;else{var u,d=void 0;if(t.axis.isCategorized())u=t.getEventRectWidth(),d=function(p){return i(p.x)-u/2};else{var h=function(p){var m=p.index;return{prev:t.getPrevX(m),next:t.getNextX(m)}};u=function(p){var m=h(p),v=i.domain(),_;return m.prev===null&&m.next===null?_=s?n.height:n.width:m.prev===null?_=(i(m.next)+i(p.x))/2:m.next===null?_=i(v[1])-(i(m.prev)+i(p.x))/2:(Object.keys(m).forEach(function(b,C){var S;m[b]=(S=m[b])!==null&&S!==void 0?S:v[C]}),_=Math.max(0,(i(m.next)-i(m.prev))/2)),_},d=function(p){var m=h(p),v;return m.prev===null&&m.next===null?v=0:m.prev===null?v=i(i.domain()[0]):v=(i(p.x)+i(m.prev))/2,v}}a=s?0:d,o=s?d:0,l=s?n.width:u,c=s?u:n.height}var f=n.eventReceiver,g=function(p,m){return isFunction$4(p)?p(m):p};f.coords.splice(f.data.length),f.data.forEach(function(p,m){f.coords[m]={x:g(a,p),y:g(o,p),w:g(l,p),h:g(c,p)}})},selectRectForSingle:function(t,e){var r,n,i=this,s=i.config,a=i.$el,o=a.main,l=a.circle,c=s.data_selection_enabled,u=s.data_selection_grouped,d=s.data_selection_isselectable,h=s.tooltip_grouped,f=i.getAllValuesOnIndex(e);if(!(h&&(i.showTooltip(f,t),(r=i.showGridFocus)===null||r===void 0||r.call(i,f),!c||u))){!l&&o.selectAll(".".concat($COMMON.EXPANDED,":not(.").concat($SHAPE.shape,"-").concat(e,")")).classed($COMMON.EXPANDED,!1);var g=o.selectAll(".".concat($SHAPE.shape,"-").concat(e)).classed($COMMON.EXPANDED,!0).style("cursor",d?"pointer":null).filter(function(p){return i.isWithinShape(this,p)});g.empty()&&!h&&((n=i.hideGridFocus)===null||n===void 0||n.call(i),i.hideTooltip(),!u&&i.setExpand(e)),g.call(function(p){var m,v,_=p.data();c&&(u||d!=null&&d.bind(i.api)(_))&&(t.style.cursor="pointer"),h||(i.showTooltip(_,t),(m=i.showGridFocus)===null||m===void 0||m.call(i,_),(v=i.unexpandCircles)===null||v===void 0||v.call(i),p.each(function(b){return i.setExpand(e,b.id)}))})}},selectRectForMultipleXs:function(t,e){e===void 0&&(e=!0);var r=this,n=r.config,i=r.state,s=r.filterTargetsToShow(r.data.targets);if(!(i.dragging||r.hasArcType(s))){var a=getPointer$1(i.event,t),o=r.findClosestFromTargets(s,a);if(e&&i.mouseover&&(!o||o.id!==i.mouseover.id)&&(n.data_onout.call(r.api,i.mouseover),i.mouseover=void 0),!o){r.unselectRect();return}var l=r.isBubbleType(o)||r.isScatterType(o)||!n.tooltip_grouped?[o]:r.filterByX(s,o.x),c=l.map(function(d){return r.addName(d)});r.showTooltip(c,t),r.setExpand(o.index,o.id,!0),r.showGridFocus(c);var u=r.dist(o,a);(r.isBarType(o.id)||u<r.getPointSensitivity(o))&&(r.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor","pointer"),e&&!i.mouseover&&(n.data_onover.call(r.api,o),i.mouseover=o))}},unselectRect:function(){var t=this,e=t.$el,r=e.circle,n=e.tooltip;t.$el.svg.select(".".concat($EVENT.eventRect)).style("cursor",null),t.hideGridFocus(),n&&(t.hideTooltip(),t._handleLinkedCharts(!1)),r&&!t.isPointFocusOnly()&&t.unexpandCircles(),t.expandBarTypeShapes(!1)},generateEventRectsForSingleX:function(t){var e=this,r=e.config,n=e.state,i=n.eventReceiver,s=t.style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("click",function(o){n.event=o;var l=i.currentIdx,c=i.data,u=c[l===-1?e.getDataIndexFromEvent(o):l];e.clickHandlerForSingleX.bind(this)(u,e)});if(n.inputType==="mouse"){var a=function(o){var l=o?e.getDataIndexFromEvent(o):i.currentIdx;return l>-1?i.data[l]:null};s.on("mouseover",function(o){n.event=o,e.updateEventRect()}).on("mousemove",function(o){var l=a(o);if(n.event=o,!!l){var c=l.index,u=r.line_step_type;if(r.line_step_tooltipMatch&&e.hasType("step")&&/^step\-(before|after)$/.test(u)){var d=e.scale.zoom||e.scale.x,h=e.axis.xs[c],f=d.invert(getPointer$1(o,this)[0]);u==="step-after"&&f<h?c-=1:u==="step-before"&&f>h&&(c+=1)}var g=r.tooltip_grouped&&c===i.currentIdx;if(n.dragging||n.flowing||e.hasArcType()||g){r.tooltip_show&&g&&e.setTooltipPosition();return}c!==i.currentIdx&&(e.setOverOut(!1,i.currentIdx),i.currentIdx=c),c===-1?e.unselectRect():e.selectRectForSingle(this,c),e.setOverOut(c!==-1,c)}}).on("mouseout",function(o){n.event=o,!(!r||e.hasArcType()||i.currentIdx===-1)&&(e.unselectRect(),e.setOverOut(!1,i.currentIdx),i.currentIdx=-1)})}return s},clickHandlerForSingleX:function(t,e){var r=e,n=r.config,i=r.state,s=r.$el.main;if(!t||r.hasArcType()||i.cancelClick){i.cancelClick&&(i.cancelClick=!1);return}var a=t.index;s.selectAll(".".concat($SHAPE.shape,"-").concat(a)).each(function(o){var l;(n.data_selection_grouped||r.isWithinShape(this,o))&&((l=r.toggleShape)===null||l===void 0||l.call(r,this,o,a),n.data_onclick.bind(r.api)(o,this))})},generateEventRectsForMultipleXs:function(t){var e=this,r=e.state;t.on("click",function(n){r.event=n,e.clickHandlerForMultipleXS.bind(this)(e)}),r.inputType==="mouse"&&t.on("mouseover mousemove",function(n){r.event=n,e.selectRectForMultipleXs(this)}).on("mouseout",function(n){r.event=n,!(!e.config||e.hasArcType())&&e.unselectRect()})},clickHandlerForMultipleXS:function(t){var e=t,r=e.config,n=e.state,i=e.filterTargetsToShow(e.data.targets);if(!e.hasArcType(i)){var s=getPointer$1(n.event,this),a=e.findClosestFromTargets(i,s),o=r.point_sensitivity==="radius"?a.r:r.point_sensitivity;a&&(e.isBarType(a.id)||e.dist(a,s)<o)&&e.$el.main.selectAll(".".concat($SHAPE.shapes).concat(e.getTargetSelectorSuffix(a.id))).selectAll(".".concat($SHAPE.shape,"-").concat(a.index)).each(function(){var l;(r.data_selection_grouped||e.isWithinShape(this,a))&&((l=e.toggleShape)===null||l===void 0||l.call(e,this,a,a.index),r.data_onclick.bind(e.api)(a,this))})}}},flow={generateFlow:function(t){var e=this,r=e.data,n=e.state,i=e.$el;return function(){var s=t.flow.length;n.flowing=!0,r.targets.forEach(function(o){o.values.splice(0,s)}),e.updateXGrid&&e.updateXGrid(!0);var a={};["axis.x","grid.x","gridLines.x","region.list","text","bar","line","area","circle"].forEach(function(o){var l=o.split("."),c=i[l[0]];c&&l.length>1&&(c=c[l[1]]),c!=null&&c.size()&&(a[o]=c)}),e.hideGridFocus(),e.setFlowList(a,t)}},setFlowList:function(t,e){var r=this,n=e.flow,i=e.targets,s=n.duration,a=s===void 0?e.duration:s,o=n.index,l=n.length,c=n.orgDataCount,u=r.getFlowTransform(i,c,o,l),d=generateWait(),h;d.add(Object.keys(t).map(function(f){return h=t[f].transition().ease(linear$1).duration(a),f==="axis.x"?h=h.call(function(g){r.axis.x.setTransition(g).create(g)}):f==="region.list"?h=h.filter(r.isRegionOnX).attr("transform",u):h=h.attr("transform",u),h})),h.call(d,function(){r.cleanUpFlow(t,e)})},cleanUpFlow:function(t,e){var r=this,n=r.config,i=r.state,s=r.$el.svg,a=n.axis_rotated,o=e.flow,l=e.shape,c=e.xv,u=l.pos,d=u.cx,h=u.cy,f=u.xForText,g=u.yForText,p=o.done,m=p===void 0?function(){}:p,v=o.length;v&&(["circle","text","shape","eventRect"].forEach(function(_){for(var b=[],C=0;C<v;C++)b.push(".".concat(CLASS[_],"-").concat(C));s.selectAll(".".concat(CLASS["".concat(_,"s")])).selectAll(b).remove()}),s.select(".".concat(CLASS.xgrid)).remove()),Object.keys(t).forEach(function(_){var b=t[_];if(_!=="axis.x"&&b.attr("transform",null),_==="grid.x")b.attr(i.xgridAttr);else if(_==="gridLines.x")b.attr("x1",a?0:c).attr("x2",a?i.width:c),b.select("text").attr("x",a?i.width:0).attr("y",c);else if(/^(area|bar|line)$/.test(_))b.attr("d",l.type[_]);else if(_==="text")b.attr("x",f).attr("y",g).style("fill-opacity",r.opacityForText.bind(r));else if(_==="circle")if(r.isCirclePoint())b.attr("cx",d).attr("cy",h);else{var C=function(w){return d(w)-n.point_r},S=function(w){return h(w)-n.point_r};b.attr("x",C).attr("y",S)}else _==="region.list"&&b.select("rect").filter(r.isRegionOnX).attr("x",r.regionX.bind(r)).attr("width",r.regionWidth.bind(r))}),n.interaction_enabled&&r.redrawEventRect(),m.call(r.api),i.flowing=!1},getFlowTransform:function(t,e,r,n){var i=this,s=i.data,a=i.scale.x,o=s.targets[0].values,l=i.getValueOnIndex(o,r),c=i.getValueOnIndex(o,r+n),u,d=a.domain(),h=i.updateXDomain(t,!0,!0);e?e===1||(l==null?void 0:l.x)===(c==null?void 0:c.x)?u=a(d[0])-a(h[0]):u=i.axis.isTimeSeries()?a(d[0])-a(h[0]):a((l==null?void 0:l.x)||0)-a(c.x):o.length!==1?u=a(d[0])-a(h[0]):i.axis.isTimeSeries()?(l=i.getValueOnIndex(o,0),c=i.getValueOnIndex(o,o.length-1),u=a(l.x)-a(c.x)):u=diffDomain(h)/2;var f=diffDomain(d)/diffDomain(h);return"translate(".concat(u,",0) scale(").concat(f,",1)")}},clip={initClip:function(){var t=this,e=t.state,r=e.clip,n=e.datetimeId;r.id="".concat(n,"-clip"),r.idXAxis="".concat(r.id,"-xaxis"),r.idYAxis="".concat(r.id,"-yaxis"),r.idGrid="".concat(r.id,"-grid"),r.path=t.getClipPath(r.id),r.pathXAxis=t.getClipPath(r.idXAxis),r.pathYAxis=t.getClipPath(r.idYAxis),r.pathGrid=t.getClipPath(r.idGrid)},getClipPath:function(t){var e=this,r=e.config;if(!r.clipPath&&/-clip$/.test(t)||!r.axis_x_clipPath&&/-clip-xaxis$/.test(t)||!r.axis_y_clipPath&&/-clip-yaxis$/.test(t))return null;var n=win.navigator?win.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0:!1;return"url(".concat(n?"":doc.URL.split("#")[0],"#").concat(t,")")},appendClip:function(t,e){e&&t.append("clipPath").attr("id",e).append("rect")},setXAxisClipPath:function(t){var e=this,r=e.config,n=e.state,i=n.margin,s=n.width,a=n.height,o=r.axis_rotated,l=Math.max(30,i.left)-(o?0:20),c=(o?i.top+a+10:i.bottom)+20,u=o?-(1+l):-(l-1),d=-15,h=o?i.left+20:s+10+l;t.attr("x",u).attr("y",d).attr("width",h).attr("height",c)},setYAxisClipPath:function(t){var e=this,r=e.config,n=e.state,i=n.margin,s=n.width,a=n.height,o=r.axis_rotated,l=Math.max(30,i.left)-(o?20:0),c=r.axis_y_inner,u=c&&!o?r.axis_y_label.text?-20:-1:o?-(1+l):-(l-1),d=-(o?20:i.top),h=(o?s+15+l:i.left+20)+(c?20:0),f=(o?i.bottom+10:i.top+a)+10;t.attr("x",u).attr("y",d).attr("width",h).attr("height",f)},updateXAxisTickClip:function(){var t=this,e=t.config,r=t.state,n=r.clip,i=r.xAxisHeight,s=t.$el.defs,a=t.getHorizontalAxisHeight("x");if(s&&!n.idXAxisTickTexts){var o="".concat(n.id,"-xaxisticktexts");t.appendClip(s,o),n.pathXAxisTickTexts=t.getClipPath(n.idXAxisTickTexts),n.idXAxisTickTexts=o}!e.axis_x_tick_multiline&&t.getAxisTickRotate("x")&&a!==i&&(t.setXAxisTickClipWidth(),t.setXAxisTickTextClipPathWidth()),t.state.xAxisHeight=a},setXAxisTickClipWidth:function(){var t=this,e=t.config,r=t.state.current.maxTickSize,n=t.getAxisTickRotate("x");if(!e.axis_x_tick_multiline&&n){var i=Math.sin(Math.PI/180*Math.abs(n));r.x.clipPath=(t.getHorizontalAxisHeight("x")-20)/i}else r.x.clipPath=null},setXAxisTickTextClipPathWidth:function(){var t=this,e=t.state,r=e.clip,n=e.current,i=t.$el.svg;i&&i.select("#".concat(r.idXAxisTickTexts," rect")).attr("width",n.maxTickSize.x.clipPath).attr("height",30)}},getGridTextAnchor=function(t){return isValue(t.position)||"end"},getGridTextDx=function(t){return t.position==="start"?4:t.position==="middle"?0:-4};function getGridTextX(t,e,r){return function(n){var i=t?0:e;return n.position==="start"?i=t?-r:0:n.position==="middle"&&(i=(t?-r:e)/2),i}}function smoothLines(t,e){e==="grid"&&t.each(function(){var r=select(this);["x1","x2","y1","y2"].forEach(function(n){return r.attr(n,Math.ceil(+r.attr(n)))})})}var grid={hasGrid:function(){var t=this.config;return["x","y"].some(function(e){return t["grid_".concat(e,"_show")]||t["grid_".concat(e,"_lines")].length})},initGrid:function(){var t=this;t.hasGrid()&&t.initGridLines(),t.initFocusGrid()},initGridLines:function(){var t=this,e=t.config,r=t.state.clip,n=t.$el;(e.grid_x_lines.length||e.grid_y_lines.length)&&(n.gridLines.main=n.main.insert("g",".".concat($COMMON.chart).concat(e.grid_lines_front?" + *":"")).attr("clip-path",r.pathGrid).attr("class","".concat($GRID.grid," ").concat($GRID.gridLines)),n.gridLines.main.append("g").attr("class",$GRID.xgridLines),n.gridLines.main.append("g").attr("class",$GRID.ygridLines),n.gridLines.x=selectAll([]))},updateXGrid:function(t){var e=this,r=e.config,n=e.scale,i=e.state,s=e.$el,a=s.main,o=s.grid,l=r.axis_rotated,c=e.generateGridData(r.grid_x_type,n.x),u=e.axis.isCategorized()?e.axis.x.tickOffset():0,d=function(h){return(n.zoom||n.x)(h)+u*(l?-1:1)};i.xgridAttr=l?{x1:0,x2:i.width,y1:d,y2:d}:{x1:d,x2:d,y1:0,y2:i.height},o.x=a.select(".".concat($GRID.xgrids)).selectAll(".".concat($GRID.xgrid)).data(c),o.x.exit().remove(),o.x=o.x.enter().append("line").attr("class",$GRID.xgrid).merge(o.x),t||o.x.each(function(){var h=select(this);Object.keys(i.xgridAttr).forEach(function(f){h.attr(f,i.xgridAttr[f]).style("opacity",function(){return h.attr(l?"y1":"x1")===(l?i.height:0)?"0":null})})})},updateYGrid:function(){var t=this,e=t.axis,r=t.config,n=t.scale,i=t.state,s=t.$el,a=s.grid,o=s.main,l=r.axis_rotated,c=function(d){return Math.ceil(n.y(d))},u=e.y.getGeneratedTicks(r.grid_y_ticks)||t.scale.y.ticks(r.grid_y_ticks);a.y=o.select(".".concat($GRID.ygrids)).selectAll(".".concat($GRID.ygrid)).data(u),a.y.exit().remove(),a.y=a.y.enter().append("line").attr("class",$GRID.ygrid).merge(a.y),a.y.attr("x1",l?c:0).attr("x2",l?c:i.width).attr("y1",l?0:c).attr("y2",l?i.height:c),smoothLines(a.y,"grid")},updateGrid:function(){var t=this,e=t.$el,r=e.grid,n=e.gridLines;!n.main&&t.initGridLines(),r.main.style("visibility",t.hasArcType()?"hidden":null),t.hideGridFocus(),t.updateGridLines("x"),t.updateGridLines("y")},updateGridLines:function(t){var e=this,r=e.config,n=e.$el,i=n.gridLines,s=n.main,a=e.$T,o=r.axis_rotated,l=t==="x";r["grid_".concat(t,"_show")]&&e["update".concat(t.toUpperCase(),"Grid")]();var c=s.select(".".concat($GRID["".concat(t,"gridLines")])).selectAll(".".concat($GRID["".concat(t,"gridLine")])).data(r["grid_".concat(t,"_lines")]);a(c.exit()).style("opacity","0").remove();var u=c.enter().append("g");u.append("line").style("opacity","0"),c=u.merge(c),c.each(function(d){var h=select(this);h.select("text").empty()&&d.text&&h.append("text").style("opacity","0")}),a(c.attr("class",function(d){return"".concat($GRID["".concat(t,"gridLine")]," ").concat(d.class||"").trim()}).select("text").attr("text-anchor",getGridTextAnchor).attr("transform",function(){return l?o?null:"rotate(-90)":o?"rotate(-90)":null}).attr("dx",getGridTextDx).attr("dy",-5)).text(function(d){var h;return(h=d.text)!==null&&h!==void 0?h:this.remove()}),i[t]=c},redrawGrid:function(t){var e=this,r=e.config.axis_rotated,n=e.state,i=n.width,s=n.height,a=e.$el.gridLines,o=e.$T,l=e.xv.bind(e),c=e.yv.bind(e),u=a.x.select("line"),d=a.x.select("text"),h=a.y.select("line"),f=a.y.select("text");return u=o(u,t).attr("x1",r?0:l).attr("x2",r?i:l).attr("y1",r?l:0).attr("y2",r?l:s),d=o(d,t).attr("x",getGridTextX(!r,i,s)).attr("y",l),h=o(h,t).attr("x1",r?c:0).attr("x2",r?c:i).attr("y1",r?0:c).attr("y2",r?s:c),f=o(f,t).attr("x",getGridTextX(r,i,s)).attr("y",c),[u.style("opacity",null),d.style("opacity",null),h.style("opacity",null),f.style("opacity",null)]},initFocusGrid:function(){var t=this,e=t.config,r=t.state.clip,n=t.$el,i=e.grid_front,s=".".concat(i&&n.gridLines.main?$GRID.gridLines:$COMMON.chart).concat(i?" + *":""),a=n.main.insert("g",s).attr("clip-path",r.pathGrid).attr("class",$GRID.grid);n.grid.main=a,e.grid_x_show&&a.append("g").attr("class",$GRID.xgrids),e.grid_y_show&&a.append("g").attr("class",$GRID.ygrids),e.interaction_enabled&&e.grid_focus_show&&(a.append("g").attr("class",$FOCUS.xgridFocus).append("line").attr("class",$FOCUS.xgridFocus),e.grid_focus_y&&!e.tooltip_grouped&&a.append("g").attr("class",$FOCUS.ygridFocus).append("line").attr("class",$FOCUS.ygridFocus))},showGridFocus:function(t){var e,r=this,n=r.config,i=r.state,s=i.width,a=i.height,o=n.axis_rotated,l=r.$el.main.selectAll("line.".concat($FOCUS.xgridFocus,", line.").concat($FOCUS.ygridFocus)),c=(t||[l.datum()]).filter(function(h){return h&&isValue(r.getBaseValue(h))});if(!(!n.tooltip_show||c.length===0||r.hasType("bubble")||r.hasArcType())){var u=n.grid_focus_edge&&!n.tooltip_grouped,d=r.xx.bind(r);l.style("visibility",null).data(c.concat(c)).each(function(h){var f=select(this),g={x:d(h),y:r.getYScaleById(h.id)(h.value)},p;if(f.classed($FOCUS.xgridFocus))p=o?[null,g.x,u?g.y:s,g.x]:[g.x,u?g.y:null,g.x,a];else{var m=r.axis.getId(h.id)==="y2";p=o?[g.y,u&&!m?g.x:null,g.y,u&&m?g.x:a]:[u&&m?g.x:null,g.y,u&&!m?g.x:s,g.y]}["x1","y1","x2","y2"].forEach(function(v,_){return f.attr(v,p[_])})}),smoothLines(l,"grid"),(e=r.showCircleFocus)===null||e===void 0||e.call(r,t)}},hideGridFocus:function(){var t,e=this,r=e.state,n=r.inputType,i=r.resizing,s=e.$el.main;(n==="mouse"||!i)&&(s.selectAll("line.".concat($FOCUS.xgridFocus,", line.").concat($FOCUS.ygridFocus)).style("visibility","hidden"),(t=e.hideCircleFocus)===null||t===void 0||t.call(e))},updateGridFocus:function(){var t,e=this,r=e.state,n=r.inputType,i=r.width,s=r.height,a=r.resizing,o=e.$el.grid,l=o.main.select("line.".concat($FOCUS.xgridFocus));if(n==="touch")l.empty()?a&&((t=e.showCircleFocus)===null||t===void 0||t.call(e)):e.showGridFocus();else{var c=e.config.axis_rotated;l.attr("x1",c?0:-10).attr("x2",c?i:-10).attr("y1",c?-10:0).attr("y2",c?-10:s)}return!0},generateGridData:function(t,e){var r=this,n=r.$el.main.select(".".concat($AXIS.axisX)).selectAll(".tick").size(),i=[];if(t==="year")for(var s=r.getXDomain(),a=s.map(function(u){return u.getFullYear()}),o=a[0],l=a[1],c=o;c<=l;c++)i.push(new Date("".concat(c,"-01-01 00:00:00")));else i=e.ticks(10),i.length>n&&(i=i.filter(function(u){return String(u).indexOf(".")<0}));return i},getGridFilterToRemove:function(t){return t?function(e){var r=!1;return(isArray$7(t)?t.concat():[t]).forEach(function(n){("value"in n&&e.value===n.value||"class"in n&&e.class===n.class)&&(r=!0)}),r}:function(){return!0}},removeGridLines:function(t,e){var r=this,n=r.config,i=r.$T,s=r.getGridFilterToRemove(t),a=function(u){return!s(u)},o=e?$GRID.xgridLines:$GRID.ygridLines,l=e?$GRID.xgridLine:$GRID.ygridLine;i(r.$el.main.select(".".concat(o)).selectAll(".".concat(l)).filter(s)).style("opacity","0").remove();var c="grid_".concat(e?"x":"y","_lines");n[c]=n[c].filter(a)}},region={initRegion:function(){var t=this,e=t.$el;e.region.main=e.main.insert("g",":first-child").attr("clip-path",t.state.clip.path).attr("class",$REGION.regions)},updateRegion:function(){var t=this,e=t.config,r=t.$el.region,n=t.$T;r.main||t.initRegion(),r.main.style("visibility",t.hasArcType()?"hidden":null);var i=r.main.selectAll(".".concat($REGION.region)).data(e.regions);n(i.exit()).style("opacity","0").remove();var s=i.enter().append("g");s.append("rect").style("fill-opacity","0"),r.list=s.merge(i).attr("class",t.classRegion.bind(t)),r.list.each(function(a){var o,l=select(this);l.select("text").empty()&&(!((o=a.label)===null||o===void 0)&&o.text)&&select(this).append("text").style("opacity","0")})},redrawRegion:function(t){var e=this,r=e.$el.region,n=e.$T,i=r.list.select("rect"),s=r.list.selectAll("text");return i=n(i,t).attr("x",e.regionX.bind(e)).attr("y",e.regionY.bind(e)).attr("width",e.regionWidth.bind(e)).attr("height",e.regionHeight.bind(e)),s=n(s,t).attr("transform",function(a){var o,l=(o=a.label)!==null&&o!==void 0?o:{},c=l.x,u=c===void 0?0:c,d=l.y,h=d===void 0?0:d,f=l.rotated,g=f===void 0?!1:f;return"translate(".concat(e.regionX.bind(e)(a)+u,", ").concat(e.regionY.bind(e)(a)+h,")").concat(g?" rotate(-90)":"")}).attr("text-anchor",function(a){var o;return!((o=a.label)===null||o===void 0)&&o.rotated?"end":null}).attr("dy","1em").style("fill",function(a){var o,l;return(l=(o=a.label)===null||o===void 0?void 0:o.color)!==null&&l!==void 0?l:null}).text(function(a){var o;return(o=a.label)===null||o===void 0?void 0:o.text}),[i.style("fill-opacity",function(a){return isValue(a.opacity)?a.opacity:null}).on("end",function(){select(this.parentNode).selectAll("rect:not([x])").remove()}),s.style("opacity",null)]},getRegionXY:function(t,e){var r=this,n=r.config,i=r.scale,s=n.axis_rotated,a=t==="x",o="start",l,c=0;return e.axis==="y"||e.axis==="y2"?(a||(o="end"),(a?s:!s)&&o in e&&(l=i[e.axis],c=l(e[o]))):(a?!s:s)&&o in e&&(l=i.zoom||i.x,c=l(r.axis.isTimeSeries()?parseDate.call(r,e[o]):e[o])),c},regionX:function(t){return this.getRegionXY("x",t)},regionY:function(t){return this.getRegionXY("y",t)},getRegionSize:function(t,e){var r=this,n=r.config,i=r.scale,s=r.state,a=n.axis_rotated,o=t==="width",l=r[o?"regionX":"regionY"](e),c,u="end",d=s[t];return e.axis==="y"||e.axis==="y2"?(o||(u="start"),(o?a:!a)&&u in e&&(c=i[e.axis],d=c(e[u]))):(o?!a:a)&&u in e&&(c=i.zoom||i.x,d=c(r.axis.isTimeSeries()?parseDate.call(r,e[u]):e[u])),d<l?0:d-l},regionWidth:function(t){return this.getRegionSize("width",t)},regionHeight:function(t){return this.getRegionSize("height",t)},isRegionOnX:function(t){return!t.axis||t.axis==="x"}},sizeAxis={getAxisSize:function(t){var e=this,r=e.config.axis_rotated;return r&&t==="x"||!r&&/y2?/.test(t)?e.getAxisWidthByAxisId(t,!0):e.getHorizontalAxisHeight(t)},getAxisWidthByAxisId:function(t,e){var r,n,i=this;if(i.axis){var s=(r=i.axis)===null||r===void 0?void 0:r.getLabelPositionById(t),a=i.axis.getMaxTickSize(t,e).width,o=a===0?.5:0;return a+(((n=i.config.padding)===null||n===void 0?void 0:n.mode)==="fit"?s.isInner?10+o:10:s.isInner?20+o:40)}else return 40},getHorizontalAxisHeight:function(t){var e,r,n=this,i=n.config,s=n.state,a=s.rotatedPadding,o=s.isLegendRight,l=s.isLegendInset,c=i.axis_rotated,u=((e=i.padding)===null||e===void 0?void 0:e.mode)==="fit",d=i["axis_".concat(t,"_inner")],h=i["axis_".concat(t,"_label")].text,f=13,g=((r=i.padding)===null||r===void 0?void 0:r.mode)==="fit"?d&&!h?t==="y"?1:0:20:30;if(t==="x"&&!i.axis_x_show)return 8;if(t==="x"&&isNumber$2(i.axis_x_height))return i.axis_x_height;if(t==="y"&&!i.axis_y_show)return i.legend_show&&!o&&!l?10:1;if(t==="y2"&&!i.axis_y2_show)return u?0:a.top;var p=n.axis.getMaxTickSize(t);return p.height>f&&(g+=p.height-f),g+(n.axis.getLabelPositionById(t).isInner?0:10)+(t==="y2"&&!c?-10:0)},getEventRectWidth:function(){var t=this,e=t.config,r=t.axis,n=e.axis_x_inverted,i=r.x.tickInterval();return Math.max(0,n?Math.abs(i):i)},getAxisTickRotate:function(t){var e=this,r=e.axis,n=e.config,i=e.state,s=e.$el,a=n["axis_".concat(t,"_tick_rotate")];if(t==="x"){var o=r.isCategorized()||r.isTimeSeries();if(n.axis_x_tick_fit&&o){var l=n.axis_x_tick_count,c=i.current.maxTickSize.x.ticks.length,u=0;if(l?u=l>c?c:l:c&&(u=c),u!==i.axis.x.tickCount){var d=e.data.targets;i.axis.x.padding=e.getXDomainPadding([e.getXDomainMinMax(d,"min"),e.getXDomainMinMax(d,"max")],u)}i.axis.x.tickCount=u}s.svg&&n.axis_x_tick_autorotate&&n.axis_x_tick_fit&&!n.axis_x_tick_multiline&&!n.axis_x_tick_culling&&o&&(a=e.needToRotateXAxisTickTexts()?n.axis_x_tick_rotate:0)}return a},needToRotateXAxisTickTexts:function(){var t=this,e=t.state,r=e.axis,n=e.current,i=n.width-t.getCurrentPaddingByDirection("left")-t.getCurrentPaddingByDirection("right"),s=r.x.tickCount+r.x.padding.left+r.x.padding.right,a=t.axis.getMaxTickSize("x").width,o=s?i/s:0;return a>o}},optDataAxis={data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_axes:{},data_regions:{},data_stack_normalize:!1},x={axis_x_clipPath:!0,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_culling_lines:!0,axis_x_tick_count:void 0,axis_x_tick_show:!0,axis_x_tick_text_show:!0,axis_x_tick_text_position:{x:0,y:0},axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_autorotate:!1,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_tick_tooltip:!1,axis_x_max:void 0,axis_x_min:void 0,axis_x_inverted:!1,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_x_axes:[]},y={axis_y_clipPath:!0,axis_y_show:!0,axis_y_type:"indexed",axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:!1,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_culling:!1,axis_y_tick_culling_max:5,axis_y_tick_culling_lines:!0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_show:!0,axis_y_tick_stepSize:null,axis_y_tick_text_show:!0,axis_y_tick_text_position:{x:0,y:0},axis_y_tick_time_value:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y_axes:[]},y2={axis_y2_show:!1,axis_y2_type:"indexed",axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:!1,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_culling:!1,axis_y2_tick_culling_max:5,axis_y2_tick_culling_lines:!0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_rotate:0,axis_y2_tick_count:void 0,axis_y2_tick_show:!0,axis_y2_tick_stepSize:null,axis_y2_tick_text_show:!0,axis_y2_tick_text_position:{x:0,y:0},axis_y2_padding:{},axis_y2_default:void 0,axis_y2_axes:[]},optAxis=_assign(_assign(_assign({axis_rotated:!1},x),y),y2),optGrid={grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:void 0,grid_focus_edge:!1,grid_focus_show:!0,grid_focus_y:!1,grid_front:!1,grid_lines_front:!0},api=[apiAxis,apiCategory,apiFlow,apiGrid,apiGroup,apiRegion,apiX],internal=[axis,clip,eventrect,flow,grid,region,sizeAxis],options=[optDataAxis,optAxis,optGrid];function getRadiusFn(t){t===void 0&&(t=0);var e=this,r=e.config,n=e.state,i=e.hasMultiArcGauge(),s=n.gaugeArcWidth/e.filterTargetsToShow(e.data.targets).length,a=t?Math.min(n.radiusExpanded*t-n.radius,s*.8-(1-t)*100):0;return{inner:function(o){var l=e.getRadius(o).innerRadius;return i?n.radius-s*(o.index+1):isNumber$2(l)?l:0},outer:function(o){var l=e.getRadius(o).outerRadius,c;if(i)c=n.radius-s*o.index+a;else if(e.hasType("polar")&&!t)c=e.getPolarOuterRadius(o,l);else if(c=l,t){var u=n.radiusExpanded;n.radius!==l&&(u-=Math.abs(n.radius-l)),c=u*t}return c},corner:function(o,l){var c=r.arc_cornerRadius_ratio,u=c===void 0?0:c,d=r.arc_cornerRadius,h=d===void 0?0:d,f=o.data.id,g=o.value,p=0;return u?p=u*l:p=isNumber$2(h)?h:h.call(e.api,f,g,l),p}}}function getAttrTweenFn(t){return function(e){var r=function(i){var s=i.startAngle,a=s===void 0?0:s,o=i.endAngle,l=o===void 0?0:o,c=i.padAngle,u=c===void 0?0:c;return{startAngle:a,endAngle:l,padAngle:u}},n=interpolate$1(r(this._current),r(e));return this._current=e,function(i){var s=n(i),a=e.data,o=e.index,l=e.value;return t(_assign(_assign({},s),{data:a,index:o,value:l}))}}}var shapeArc={initPie:function(){var t=this,e=t.config,r=e.data_type,n=e["".concat(r,"_padding")],i=e["".concat(r,"_startingAngle")]||0,s=(n?n*.01:e["".concat(r,"_padAngle")])||0;t.pie=pie$1().startAngle(i).endAngle(i+2*Math.PI).padAngle(s).value(function(a){return a.values.reduce(function(o,l){return o+l.value},0)}).sort(t.getSortCompareFn.bind(t)(!0))},updateRadius:function(){var t=this,e=t.config,r=t.state,n=e.data_type,i=e["".concat(n,"_padding")],s=e.gauge_width||e.donut_width,a=t.filterTargetsToShow(t.data.targets).length*e.gauge_arcs_minWidth;r.radiusExpanded=Math.min(r.arcWidth,r.arcHeight)/2*(t.hasMultiArcGauge()&&e.gauge_label_show?.85:1),r.radius=r.radiusExpanded*.95,r.innerRadiusRatio=s?(r.radius-s)/r.radius:.6,r.gaugeArcWidth=s||(a<=r.radius-r.innerRadius?r.radius-r.innerRadius:a<=r.radius?a:r.radius);var o=e.pie_innerRadius||(i?i*(r.innerRadiusRatio+.1):0);r.outerRadius=e.pie_outerRadius,r.innerRadius=t.hasType("donut")||t.hasType("gauge")?r.radius*r.innerRadiusRatio:o},getRadius:function(t){var e=this,r=t==null?void 0:t.data,n=e.state,i=n.innerRadius,s=n.outerRadius;return!isNumber$2(i)&&r&&(i=i[r.id]||0),isObject$c(s)&&r&&r.id in s?s=s[r.id]:isNumber$2(s)||(s=e.state.radius),{innerRadius:i,outerRadius:s}},updateArc:function(){var t=this;t.updateRadius(),t.svgArc=t.getSvgArc(),t.svgArcExpanded=t.getSvgArcExpanded()},getArcLength:function(){var t=this,e=t.config,r=e.gauge_arcLength*3.6,n=2*(r/360);return r<-360?n=-2:r>360&&(n=2),n*Math.PI},getGaugeStartAngle:function(){var t=this,e=t.config,r=e.gauge_fullCircle,n=-1*Math.PI/2,i=Math.PI/2,s=e.gauge_startingAngle;return!r&&s<=n?s=n:!r&&s>=i?s=i:(s>Math.PI||s<-1*Math.PI)&&(s=Math.PI),s},updateAngle:function(t){var e=this,r=e.config,n=e.state,i=e.pie,s=t,a=!1;if(!r)return null;var o=e.getGaugeStartAngle(),l=r.gauge_fullCircle?e.getArcLength():o*-2;if(s.data&&e.isGaugeType(s.data)&&!e.hasMultiArcGauge()){var c=r.gauge_min,u=r.gauge_max,d=e.getTotalDataSum(n.rendered),h=l*((d-c)/(u-c));i=i.startAngle(o).endAngle(h+o)}if(i(e.filterTargetsToShow()).forEach(function(v,_){var b;!a&&v.data.id===((b=s.data)===null||b===void 0?void 0:b.id)&&(a=!0,s=v,s.index=_)}),isNaN(s.startAngle)&&(s.startAngle=0),isNaN(s.endAngle)&&(s.endAngle=s.startAngle),s.data&&e.hasMultiArcGauge()){var f=r.gauge_min,g=r.gauge_max,p=l/(g-f),m=s.value<f?0:s.value<g?s.value-f:g-f;s.startAngle=o,s.endAngle=o+p*m}return a?s:null},getSvgArc:function(){var t=this,e=getRadiusFn.call(t),r=e.inner,n=e.outer,i=e.corner,s=arc().innerRadius(r).outerRadius(n),a=function(o,l){var c,u="M 0 0";if(o.value||o.data){var d=l?o:(c=t.updateAngle(o))!==null&&c!==void 0?c:null;d&&(u=s.cornerRadius(i(d,n(d)))(d))}return u};return a.centroid=s.centroid,a},getSvgArcExpanded:function(t){t===void 0&&(t=1);var e=this,r=getRadiusFn.call(e,t),n=r.inner,i=r.outer,s=r.corner,a=arc().innerRadius(n).outerRadius(i);return function(o){var l=e.updateAngle(o),c=i(l),u=0;return l&&(u=s(l,c)),l?a.cornerRadius(u)(l):"M 0 0"}},getArc:function(t,e,r){return r||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function(t){var e,r=this,n=r.config,i=r.state.radiusExpanded,s=r.updateAngle(t),a="";if(s){if(r.hasMultiArcGauge()){var o=Math.sin(s.endAngle-Math.PI/2),l=Math.cos(s.endAngle-Math.PI/2)*(i+25),c=o*(i+15-Math.abs(o*10))+3;a="translate(".concat(l,",").concat(c,")")}else if(!r.hasType("gauge")||r.data.targets.length>1){var u=r.getRadius(t).outerRadius;r.hasType("polar")&&(u=r.getPolarOuterRadius(t,u));var d=this.svgArc.centroid(s),h=d.map(function(v){return isNaN(v)?0:v}),l=h[0],c=h[1],f=Math.sqrt(l*l+c*c),g=(e=["donut","pie","polar"].filter(r.hasType.bind(r)).map(function(v){return n["".concat(v,"_label_ratio")]}))===null||e===void 0?void 0:e[0];g?g=isFunction$4(g)?g.bind(r.api)(t,u,f):g:g=u&&(f?(36/u>.375?1.175-36/u:.8)*u/f:0),a="translate(".concat(l*g,",").concat(c*g,")")}}return a},convertToArcData:function(t){return this.addName({id:"data"in t?t.data.id:t.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function(t){var e=this,r=e.hasType("gauge");e.shouldShowArcLabel()&&t.style("fill",e.updateTextColor.bind(e)).attr("filter",e.updateTextBackgroundColor.bind(e)).each(function(n){var i,s=select(this),a=e.updateAngle(n),o=e.getRatio("arc",a),l=e.meetsLabelThreshold(o,(i=["donut","gauge","pie","polar"].filter(e.hasType.bind(e)))===null||i===void 0?void 0:i[0]);if(l){var c=(a||n).value,u=(e.getArcLabelFormat()||e.defaultArcValueFormat)(c,o,n.data.id).toString();setTextValue(s,u,[-1,1],r)}else s.text("")})},expandArc:function(t){var e=this,r=e.state.transiting,n=e.$el;if(r){var i=setInterval(function(){r||(clearInterval(i),n.legend.selectAll(".".concat($FOCUS.legendItemFocused)).size()>0&&e.expandArc(t))},10);return}var s=e.mapToTargetIds(t);n.svg.selectAll(e.selectorTargets(s,".".concat($ARC.chartArc))).each(function(a){if(e.shouldExpand(a.data.id)){var o=e.getExpandConfig(a.data.id,"duration"),l=e.getSvgArcExpanded(e.getExpandConfig(a.data.id,"rate"));select(this).selectAll("path").transition().duration(o).attrTween("d",getAttrTweenFn(e.svgArcExpanded.bind(e))).transition().duration(o*2).attrTween("d",getAttrTweenFn(l.bind(e)))}})},unexpandArc:function(t){var e=this,r=e.state.transiting,n=e.$el.svg;if(!r){var i=e.mapToTargetIds(t);n.selectAll(e.selectorTargets(i,".".concat($ARC.chartArc))).selectAll("path").transition().duration(function(s){return e.getExpandConfig(s.data.id,"duration")}).attrTween("d",getAttrTweenFn(e.svgArc.bind(e))),n.selectAll("".concat($ARC.arc)).style("opacity",null)}},getExpandConfig:function(t,e){var r=this,n=r.config,i={duration:50,rate:.98},s;return r.isDonutType(t)?s="donut":r.isGaugeType(t)?s="gauge":r.isPieType(t)&&(s="pie"),s?n["".concat(s,"_expand_").concat(e)]:i[e]},shouldExpand:function(t){var e=this,r=e.config;return e.isDonutType(t)&&r.donut_expand||e.isGaugeType(t)&&r.gauge_expand||e.isPieType(t)&&r.pie_expand},shouldShowArcLabel:function(){var t=this,e=t.config;return["donut","gauge","pie","polar"].some(function(r){return t.hasType(r)&&e["".concat(r,"_label_show")]})},getArcLabelFormat:function(){var t=this,e=t.config,r=function(n){return n};return["donut","gauge","pie","polar"].filter(t.hasType.bind(t)).forEach(function(n){r=e["".concat(n,"_label_format")]}),isFunction$4(r)?r.bind(t.api):r},updateTargetsForArc:function(t){var e=this,r=e.$el,n=e.hasType("gauge"),i=e.getChartClass("Arc"),s=e.getClass("arcs",!0),a=e.classFocus.bind(e),o=r.main.select(".".concat($ARC.chartArcs)),l=o.selectAll(".".concat($ARC.chartArc)).data(e.pie(t)).attr("class",function(u){return i(u)+a(u.data)}),c=l.enter().append("g").attr("class",i).call(this.setCssRule(!1,".".concat($ARC.chartArcs," text"),["pointer-events:none","text-anchor:middle"]));c.append("g").attr("class",s).merge(l),c.append("text").attr("dy",n&&!e.hasMultiTargets()?"-.1em":".35em").style("opacity","0").style("text-anchor",e.getStylePropValue("middle")).style("pointer-events",e.getStylePropValue("none")),r.text=o.selectAll(".".concat($COMMON.target," text"))},initArc:function(){var t=this,e=t.$el;e.arcs=e.main.select(".".concat($COMMON.chart)).append("g").attr("class",$ARC.chartArcs).attr("transform",t.getTranslate("arc")),t.setArcTitle()},setArcTitle:function(t){var e=this,r=t||e.getArcTitle(),n=e.hasType("gauge");if(r){var i=n?$GAUGE.chartArcsGaugeTitle:$ARC.chartArcsTitle,s=e.$el.arcs.select(".".concat(i));s.empty()&&(s=e.$el.arcs.append("text").attr("class",i).style("text-anchor","middle")),n&&s.attr("dy","-0.3em"),setTextValue(s,r,n?void 0:[-.6,1.35],!0)}},getArcTitle:function(){var t=this,e=t.hasType("donut")&&"donut"||t.hasType("gauge")&&"gauge";return e?t.config["".concat(e,"_title")]:""},getArcTitleWithNeedleValue:function(){var t=this,e=t.config,r=t.state,n=t.getArcTitle();if(n&&t.config.arc_needle_show&&/{=[A-Z_]+}/.test(n)){var i=r.current.needle;return isNumber$2(i)||(i=e.arc_needle_value),tplProcess(n,{NEEDLE_VALUE:isNumber$2(i)?i:0})}return!1},redrawArc:function(t,e,r){var n=this,i=n.config,s=n.state,a=n.$el.main,o=i.interaction_enabled,l=o&&i.data_selection_isselectable,c=a.selectAll(".".concat($ARC.arcs)).selectAll(".".concat($ARC.arc)).data(n.arcData.bind(n));c.exit().transition().duration(e).style("opacity","0").remove(),c=c.enter().append("path").attr("class",n.getClass("arc",!0)).style("fill",function(u){return n.color(u.data)}).style("cursor",function(u){var d;return!((d=l==null?void 0:l.bind)===null||d===void 0)&&d.call(l,n.api)(u)?"pointer":null}).style("opacity","0").each(function(u){n.isGaugeType(u.data)&&(u.startAngle=i.gauge_startingAngle,u.endAngle=i.gauge_startingAngle),this._current=u}).merge(c),n.hasType("gauge")&&(n.updateGaugeMax(),n.hasMultiArcGauge()&&n.redrawMultiArcGauge()),c.attr("transform",function(u){return!n.isGaugeType(u.data)&&r?"scale(0)":""}).style("opacity",function(u){return u===this._current?"0":null}).each(function(){s.transiting=!0}).transition().duration(t).attrTween("d",function(u){var d=n.updateAngle(u);if(!d)return function(){return"M 0 0"};isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle);var h=interpolate$1(this._current,d);return this._current=h(0),function(f){var g=h(f);return g.data=u.data,n.getArc(g,!0)}}).attr("transform",r?"scale(1)":"").style("fill",function(u){var d;return n.levelColor?(d=n.levelColor(u.data.values[0].value),i.data_colors[u.data.id]=d):d=n.color(u.data),d}).style("opacity",null).call(endall,function(){if(n.levelColor){var u=select(this),d=u.datum(this._current);n.updateLegendItemColor(d.data.id,u.style("fill"))}s.transiting=!1,callFn(i.onrendered,n.api)}),o&&n.bindArcEvent(c),n.hasType("polar")&&n.redrawPolar(),n.hasType("gauge")&&n.redrawBackgroundArcs(),i.arc_needle_show&&n.redrawNeedle(),n.redrawArcText(t)},redrawNeedle:function(){var t=this,e=t.$el,r=t.config,n=t.state,i=n.hiddenTargetIds,s=n.radius,a=(s-1)/100*r.arc_needle_length,o=i.length!==t.data.targets.length,l=t.$el.arcs.select(".".concat($ARC.needle)),c=r.arc_needle_path,u=r.arc_needle_bottom_width/2,d=r.arc_needle_top_width/2,h=r.arc_needle_top_rx,f=r.arc_needle_top_ry,g=r.arc_needle_bottom_len,p=r.arc_needle_bottom_rx,m=r.arc_needle_bottom_ry,v=t.getNeedleAngle(),_=function(){var C=t.getArcTitleWithNeedleValue();C&&t.setArcTitle(C)};if(_(),l.empty()&&(l=e.arcs.append("path").classed($ARC.needle,!0),e.needle=l,e.needle.updateHelper=function(C,S){S===void 0&&(S=!1),e.needle.style("display")!=="none"&&t.$T(e.needle).style("transform","rotate(".concat(t.getNeedleAngle(C),"deg)")).call(endall,function(){S&&(r.arc_needle_value=C),_()})}),o){var b=isFunction$4(c)?c.call(t,a):"M-".concat(u," ").concat(g," A").concat(p," ").concat(m," 0 0 0 ").concat(u," ").concat(g," L").concat(d," -").concat(a," A").concat(h," ").concat(f," 0 0 0 -").concat(d," -").concat(a," L-").concat(u," ").concat(g," Z");t.$T(l).attr("d",b).style("fill",r.arc_needle_color).style("display",null).style("transform","rotate(".concat(v,"deg)"))}else l.style("display","none")},getNeedleAngle:function(t){var e=this,r=e.config,n=e.state,i=e.getArcLength(),s=e.hasType("gauge"),a=e.getTotalDataSum(!0),o=isDefined$1(t)?t:r.arc_needle_value,l=r["".concat(r.data_type,"_startingAngle")]||0,c=0;if(isNumber$2(o)||(o=s&&e.data.targets.length===1?a:0),n.current.needle=o,s){l=e.getGaugeStartAngle();var u=r.gauge_fullCircle?i:l*-2,d=r.gauge_min,h=r.gauge_max;c=u*((o-d)/(h-d))}else c=i*(o/a);return(l+c)*(180/Math.PI)},redrawBackgroundArcs:function(){var t=this,e=t.config,r=t.state,n=t.hasMultiArcGauge(),i=e.gauge_fullCircle,s=t.filterTargetsToShow(t.data.targets).length===0&&!!e.data_empty_label_text,a=t.getGaugeStartAngle(),o=i?a+t.getArcLength():a*-1,l=t.$el.arcs.select("".concat(n?"g":"",".").concat($ARC.chartArcsBackground));if(n){var c=0;l=l.selectAll("path.".concat($ARC.chartArcsBackground)).data(t.data.targets),l.enter().append("path").attr("class",function(u,d){return"".concat($ARC.chartArcsBackground," ").concat($ARC.chartArcsBackground,"-").concat(d)}).merge(l).style("fill",e.gauge_background||null).attr("d",function(u){var d=u.id;if(s||r.hiddenTargetIds.indexOf(d)>=0)return"M 0 0";var h={data:[{value:e.gauge_max}],startAngle:a,endAngle:o,index:c++};return t.getArc(h,!0,!0)}),l.exit().remove()}else l.attr("d",s?"M 0 0":function(){var u={data:[{value:e.gauge_max}],startAngle:a,endAngle:o};return t.getArc(u,!0,!0)})},bindArcEvent:function(t){var e=this,r=e.config,n=e.state,i=n.inputType==="touch",s=n.inputType==="mouse";function a(c,u,d){e.expandArc(d),e.api.focus(d),e.toggleFocusLegend(d,!0),e.showTooltip([u],c)}function o(c){var u=(c==null?void 0:c.id)||void 0;e.unexpandArc(u),e.api.revert(),e.revertLegend(),e.hideTooltip()}if(t.on("click",function(c,u,d){var h,f=e.updateAngle(u),g;f&&(g=e.convertToArcData(f),(h=e.toggleShape)===null||h===void 0||h.call(e,this,g,d),r.data_onclick.bind(e.api)(g,this))}),s&&t.on("mouseover",function(c,u){if(!n.transiting){n.event=c;var d=e.updateAngle(u),h=d?e.convertToArcData(d):null,f=(h==null?void 0:h.id)||void 0;a(this,h,f),e.setOverOut(!0,h)}}).on("mouseout",function(c,u){if(!n.transiting){n.event=c;var d=e.updateAngle(u),h=d?e.convertToArcData(d):null;o(),e.setOverOut(!1,h)}}).on("mousemove",function(c,u){var d=e.updateAngle(u),h=d?e.convertToArcData(d):null;n.event=c,e.showTooltip([h],this)}),i&&e.hasArcType()&&!e.radars){var l=function(c){var u,d,h=(d=(u=c.changedTouches)===null||u===void 0?void 0:u[0])!==null&&d!==void 0?d:{clientX:0,clientY:0},f=h.clientX,g=h.clientY,p=select(doc.elementFromPoint(f,g));return p};e.$el.svg.on("touchstart touchmove",function(c){if(!n.transiting){n.event=c;var u=l(c),d=u.datum(),h=d!=null&&d.data&&d.data.id?e.updateAngle(d):null,f=h?e.convertToArcData(h):null,g=(f==null?void 0:f.id)||void 0;e.callOverOutForTouch(f),isUndefined$3(g)?o():a(this,f,g)}})}},redrawArcText:function(t){var e=this,r=e.config,n=e.state,i=e.$el,s=i.main,a=i.arcs,o=e.hasType("gauge"),l=e.hasMultiArcGauge(),c;if(o&&e.data.targets.length===1&&r.gauge_title||(c=s.selectAll(".".concat($ARC.chartArc)).select("text").style("opacity","0").attr("class",function(d){return e.isGaugeType(d.data)?$GAUGE.gaugeValue:null}).call(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(d){return e.isGaugeType(d.data)&&e.data.targets.length===1&&!l?"".concat(Math.round(n.radius/5),"px"):null}).transition().duration(t).style("opacity",function(d){return e.isTargetToShow(d.data.id)&&e.isArcType(d.data)?null:"0"}),l&&c.attr("dy","-.1em")),s.select(".".concat($ARC.chartArcsTitle)).style("opacity",e.hasType("donut")||o?null:"0"),o){var u=r.gauge_fullCircle;u&&(c==null||c.attr("dy","".concat(l?0:Math.round(n.radius/14)))),r.gauge_label_show&&(a.select(".".concat($GAUGE.chartArcsGaugeUnit)).attr("dy","".concat(u?1.5:.75,"em")).text(r.gauge_units),a.select(".".concat($GAUGE.chartArcsGaugeMin)).attr("dx","".concat(-1*(n.innerRadius+(n.radius-n.innerRadius)/(u?1:2)),"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_min,!1)),!u&&a.select(".".concat($GAUGE.chartArcsGaugeMax)).attr("dx","".concat(n.innerRadius+(n.radius-n.innerRadius)/2,"px")).attr("dy","1.2em").text(e.textForGaugeMinMax(r.gauge_max,!0)))}},getArcElementByIdOrIndex:function(t){var e=this,r=e.$el.arcs,n=isNumber$2(t)?function(i){return i.index===t}:function(i){return i.data.id===t};return r==null?void 0:r.selectAll(".".concat($COMMON.target," path")).filter(n)}},shapeArea={initArea:function(t){var e=this,r=e.config;t.insert("g",".".concat(r.area_front?$CIRCLE.circles:$LINE.lines)).attr("class",e.getClass("areas",!0))},updateAreaColor:function(t){var e=this;return e.config.area_linearGradient?e.getGradienColortUrl(t.id):e.color(t)},updateArea:function(t,e){e===void 0&&(e=!1);var r=this,n=r.config,i=r.state,s=r.$el,a=r.$T,o=e?s.subchart:s;n.area_linearGradient&&r.updateLinearGradient();var l=o.main.selectAll(".".concat($AREA.areas)).selectAll(".".concat($AREA.area)).data(r.lineData.bind(r));a(l.exit(),t).style("opacity","0").remove(),o.area=l.enter().append("path").attr("class",r.getClass("area",!0)).style("fill",r.updateAreaColor.bind(r)).style("opacity",function(){return i.orgAreaOpacity=select(this).style("opacity"),"0"}).merge(l),l.style("opacity",i.orgAreaOpacity),r.setRatioForGroupedData(o.area.data())},redrawArea:function(t,e,r){r===void 0&&(r=!1);var n=this,i=(r?this.$el.subchart:this.$el).area,s=n.state.orgAreaOpacity;return[n.$T(i,e,getRandom()).attr("d",t).style("fill",n.updateAreaColor.bind(n)).style("opacity",function(a){return String(n.isAreaRangeType(a)?s/1.75:s)})]},generateDrawArea:function(t,e){var r=this,n=r.config,i=n.line_connectNull,s=n.axis_rotated,a=r.generateGetAreaPoints(t,e),o=r.getYScaleById.bind(r),l=function(d){return(e?r.subxx:r.xx).call(r,d)},c=function(d,h){return r.isGrouped(d.id)?a(d,h)[0][1]:o(d.id,e)(r.isAreaRangeType(d)?r.getRangedData(d,"high"):r.getShapeYMin(d.id))},u=function(d,h){return r.isGrouped(d.id)?a(d,h)[1][1]:o(d.id,e)(r.isAreaRangeType(d)?r.getRangedData(d,"low"):d.value)};return function(d){var h=i?r.filterRemoveNull(d.values):d.values,f=0,g=0,p;if(r.isAreaType(d)){var m=area$1();m=s?m.y(l).x0(c).x1(u):m.x(l).y0(n.area_above?0:n.area_below?r.state.height:c).y1(u),i||(m=m.defined(function(v){return r.getBaseValue(v)!==null})),r.isStepType(d)&&(h=r.convertValuesToStep(h)),p=m.curve(r.getCurve(d))(h)}else h[0]&&(f=r.scale.x(h[0].x),g=r.getYScaleById(d.id)(h[0].value)),p=s?"M ".concat(g," ").concat(f):"M ".concat(f," ").concat(g);return p||"M 0 0"}},generateGetAreaPoints:function(t,e){var r=this,n=r.config,i=r.getShapeX(0,t,e),s=r.getShapeY(!!e),a=r.getShapeOffset(r.isAreaType,t,e),o=r.getYScaleById.bind(r);return function(l,c){var u=o.call(r,l.id,e)(r.getShapeYMin(l.id)),d=a(l,c)||u,h=i(l),f=l.value,g=s(l);return n.axis_rotated&&(f>0&&g<u||f<0&&u<g)&&(g=u),[[h,d],[h,g-(u-d)],[h,g-(u-d)],[h,d]]}}},shapeBar={initBar:function(){var t=this,e=t.$el,r=t.config,n=t.state.clip;e.bar=e.main.select(".".concat($COMMON.chart)),e.bar=r.bar_front?e.bar.append("g"):e.bar.insert("g",":first-child"),e.bar.attr("class",$BAR.chartBars).call(this.setCssRule(!1,".".concat($BAR.chartBars),["pointer-events:none"])),r.clipPath===!1&&(r.bar_radius||r.bar_radius_ratio)&&e.bar.attr("clip-path",n.pathXAxis.replace(/#[^)]*/,"#".concat(n.id)))},updateTargetsForBar:function(t){var e=this,r=e.config,n=e.$el,i=e.getChartClass("Bar"),s=e.getClass("bars",!0),a=e.classFocus.bind(e),o=r.interaction_enabled&&r.data_selection_isselectable;n.bar||e.initBar();var l=n.main.select(".".concat($BAR.chartBars)).selectAll(".".concat($BAR.chartBar)).data(t.filter(function(u){return u.values.some(function(d){return isNumber$2(d.value)||e.isBarRangeType(d)})})).attr("class",function(u){return i(u)+a(u)}),c=l.enter().append("g").attr("class",i).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));c.append("g").attr("class",s).style("cursor",function(u){var d;return!((d=o==null?void 0:o.bind)===null||d===void 0)&&d.call(o,e.api)(u)?"pointer":null}).call(e.setCssRule(!0," .".concat($BAR.bar),["fill"],e.color))},updateBar:function(t,e){e===void 0&&(e=!1);var r=this,n=r.config,i=r.$el,s=r.$T,a=e?i.subchart:i,o=r.getClass("bar",!0),l=r.initialOpacity.bind(r);n.bar_linearGradient&&r.updateLinearGradient();var c=a.main.selectAll(".".concat($BAR.bars)).selectAll(".".concat($BAR.bar)).data(r.labelishData.bind(r));s(c.exit(),t).style("opacity","0").remove(),a.bar=c.enter().append("path").attr("class",o).style("fill",r.updateBarColor.bind(r)).merge(c).style("opacity",l),r.setRatioForGroupedData(a.bar.data())},updateBarColor:function(t){var e=this,r=e.getStylePropValue(e.color);return e.config.bar_linearGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawBar:function(t,e,r){r===void 0&&(r=!1);var n=this,i=(r?n.$el.subchart:n.$el).bar;return[n.$T(i,e,getRandom()).attr("d",function(s){return(isNumber$2(s.value)||n.isBarRangeType(s))&&t(s)}).style("fill",n.updateBarColor.bind(n)).style("opacity",null)]},generateDrawBar:function(t,e){var r=this,n=r.config,i=r.generateGetBarPoints(t,e),s=n.axis_rotated,a=n.bar_radius,o=n.bar_radius_ratio,l=isNumber$2(a)&&a>0?function(){return a}:isNumber$2(o)?function(c){return c*o}:null;return function(c,u){var d=i(c,u),h=+s,f=+!h,g=c.value<0,p=n["axis_".concat(r.axis.getId(c.id),"_inverted")],m=!p&&g||p&&!g,v=["",""],_=0,b=r.isGrouped(c.id),C=l&&b?r.isStackingRadiusData(c):!1;if(l){var S=s?f:h,w=d[2][S]-d[0][S];_=!b||C?l(w):0;var A="a".concat(_,",").concat(_," ").concat(m?"1 0 0":"0 0 1"," ");v[+!s]="".concat(A).concat(_,",").concat(_),v[+s]="".concat(A).concat([-_,_][s?"sort":"reverse"]()),m&&v.reverse()}var O=s?"H".concat(d[1][h]+(m?_:-_)," ").concat(v[0],"V").concat(d[2][f]-_," ").concat(v[1],"H").concat(d[3][h]):"V".concat(d[1][f]+(m?-_:_)," ").concat(v[0],"H").concat(d[2][h]-_," ").concat(v[1],"V").concat(d[3][f]);return"M".concat(d[0][h],",").concat(d[0][f]).concat(O,"z")}},isStackingRadiusData:function(t){var e=this,r=e.$el,n=e.config,i=e.data,s=e.state,a=t.id,o=t.index,l=t.value;if(s.hiddenTargetIds.indexOf(a)>-1){var c=r.bar.filter(function(f){return f.id===a&&f.value===l});return!c.empty()&&/a\d+/i.test(c.attr("d"))}var u=n.data_groups.find(function(f){return f.indexOf(a)>-1}),d=e.orderTargets(e.filterTargetsToShow(i.targets.filter(e.isBarType,e))).filter(function(f){return u.indexOf(f.id)>-1}),h=d.map(function(f){return f.values.filter(function(g){return g.index===o&&(isNumber$2(l)&&l>0?g.value>0:g.value<0)})[0]}).filter(Boolean).map(function(f){return f.id});return l!==0&&h.indexOf(a)===h.length-1},generateGetBarPoints:function(t,e){var r=this,n=r.config,i=e?r.axis.subX:r.axis.x,s=r.getIndicesMax(t)+1,a=r.getBarW("bar",i,s),o=r.getShapeX(a,t,!!e),l=r.getShapeY(!!e),c=r.getShapeOffset(r.isBarType,t,!!e),u=r.getYScaleById.bind(r);return function(d,h){var f=d.id,g=u.call(r,f,e)(r.getShapeYMin(f)),p=c(d,h)||g,m=isNumber$2(a)?a:a[d.id]||a._$width,v=n["axis_".concat(r.axis.getId(f),"_inverted")],_=d.value,b=o(d),C=l(d);n.axis_rotated&&!v&&(_>0&&C<g||_<0&&g<C)&&(C=g),r.isBarRangeType(d)||(C-=g-p);var S=b+m;return[[b,p],[b,C],[S,C],[S,p]]}}},shapeLine={initLine:function(){var t=this.$el;t.line=t.main.select(".".concat($COMMON.chart)).append("g").attr("class",$LINE.chartLines).call(this.setCssRule(!1,".".concat($LINE.chartLines),["pointer-events:none"]))},updateTargetsForLine:function(t){var e=this,r=e.$el,n=r.area,i=r.line,s=r.main,a=e.getChartClass("Line"),o=e.getClass("lines",!0),l=e.classFocus.bind(e);i||e.initLine();var c=t.filter(function(f){return!(e.isScatterType(f)||e.isBubbleType(f))}),u=s.select(".".concat($LINE.chartLines)).selectAll(".".concat($LINE.chartLine)).data(c).attr("class",function(f){return a(f)+l(f)}),d=u.enter().append("g").attr("class",a).style("opacity","0").style("pointer-events",e.getStylePropValue("none"));if(d.append("g").attr("class",o),e.hasTypeOf("Area")){var h=(!n&&d.empty()?u:d).filter(e.isAreaType.bind(e));e.initArea(h)}e.updateTargetForCircle(c,d)},updateLine:function(t,e){e===void 0&&(e=!1);var r=this,n=r.format.extraLineClasses,i=r.$el,s=r.$T,a=e?i.subchart:i,o=a.main.selectAll(".".concat($LINE.lines)).selectAll(".".concat($LINE.line)).data(r.lineData.bind(r));s(o.exit(),t).style("opacity","0").remove(),a.line=o.enter().append("path").attr("class",function(l){return"".concat(r.getClass("line",!0)(l)," ").concat(n(l)||"")}).style("stroke",r.color).merge(o).style("opacity",r.initialOpacity.bind(r)).attr("transform",null)},redrawLine:function(t,e,r){r===void 0&&(r=!1);var n=this,i=n.$el,s=n.$T,a=(r?i.subchart:i).line;return[s(a,e,getRandom()).attr("d",t).style("stroke",this.color).style("opacity",null)]},getCurve:function(t){var e=this,r=e.config.axis_rotated&&e.isStepType(t);return r?function(n){var i=e.getInterpolate(t)(n);return i.orgPoint=i.point,i.pointRotated=function(s,a){this._point===1&&(this._point=2);var o=this._y*(1-this._t)+a*this._t;this._context.lineTo(this._x,o),this._context.lineTo(s,o),this._x=s,this._y=a},i.point=function(s,a){this._point===0?this.orgPoint(s,a):this.pointRotated(s,a)},i}:e.getInterpolate(t)},generateDrawLine:function(t,e){var r=this,n=r.config,i=r.scale,s=n.line_connectNull,a=n.axis_rotated,o=r.generateGetLinePoints(t,e),l=r.getYScaleById.bind(r),c=function(f){return(e?r.subxx:r.xx).call(r,f)},u=function(f,g){return r.isGrouped(f.id)?o(f,g)[0][1]:l(f.id,e)(r.getBaseValue(f))},d=line$1();d=a?d.x(u).y(c):d.x(c).y(u),s||(d=d.defined(function(f){return r.getBaseValue(f)!==null}));var h=e?i.subX:i.x;return function(f){var g=l(f.id,e),p=s?r.filterRemoveNull(f.values):f.values,m=0,v=0,_;if(r.isLineType(f)){var b=n.data_regions[f.id];b?_=r.lineWithRegions(p,i.zoom||h,g,b):(r.isStepType(f)&&(p=r.convertValuesToStep(p)),_=d.curve(r.getCurve(f))(p))}else p[0]&&(m=h(p[0].x),v=g(p[0].value)),_=a?"M ".concat(v," ").concat(m):"M ".concat(m," ").concat(v);return _||"M 0 0"}},lineWithRegions:function(t,e,r,n){var i=this,s=i.config,a=s.axis_rotated,o=i.axis.isTimeSeries(),l=[],c="2 2",u,d,h,f;if(isDefined$1(n))for(var g=function(ae,se){return isUndefined$3(ae)?se:o?parseDate.call(i,ae):ae},p=0,m=void 0;m=n[p];p++){var v=g(m.start,t[0].x),_=g(m.end,t[t.length-1].x),b=m.style||{dasharray:c};l[p]={start:v,end:_,style:b}}for(var C=a?function(ae){return r(ae.value)}:function(ae){return e(ae.x)},S=a?function(ae){return e(ae.x)}:function(ae){return r(ae.value)},w=function(ae){return"M".concat(ae[0][0],",").concat(ae[0][1],"L").concat(ae[1][0],",").concat(ae[1][1])},A=o?function(ae,se,P,B){var V=ae.x.getTime(),ie=se.x-ae.x,F=new Date(V+ie*P),M=new Date(V+ie*(P+B)),U=a?[[r(d(P)),e(F)],[r(d(P+h)),e(M)]]:[[e(F),r(d(P))],[e(M),r(d(P+h))]];return w(U)}:function(ae,se,P,B){var V=a?[[r(d(P),!0),e(u(P))],[r(d(P+B),!0),e(u(P+B))]]:[[e(u(P),!0),r(d(P))],[e(u(P+B),!0),r(d(P+B))]];return w(V)},O={x:i.axis.getAxisType("x"),y:i.axis.getAxisType("y")},T="",p=0,H=void 0;H=t[p];p++){var k=t[p-1],G=k&&isValue(k.value),b=i.isWithinRegions(H.x,l);if(isValue(H.value)){if(isUndefined$3(l)||!b||!G)T+="".concat(p&&G?"L":"M").concat(C(H),",").concat(S(H));else if(G){try{b=b.dasharray.split(" ")}catch(P){b=c.split(" ")}u=getScale(O.x,k.x,H.x),d=getScale(O.y,k.value,H.value);var X=e(H.x)-e(k.x),I=r(H.value)-r(k.value),ce=Math.sqrt(Math.pow(X,2)+Math.pow(I,2));h=b[0]/ce,f=h*b[1];for(var be=h;be<=1;be+=f)T+=A(k,H,be,h),be+f>=1&&(T+=A(k,H,1,0))}}}return T},isWithinRegions:function(t,e){for(var r=0,n=void 0;n=e[r];r++)if(n.start<t&&t<=n.end)return n.style;return!1},isWithinStep:function(t,e){return Math.abs(e-getPointer$1(this.state.event,t)[1])<30},shouldDrawPointsForLine:function(t){var e=this.config.line_point;return e===!0||isArray$7(e)&&e.indexOf(t.id)!==-1}},getTransitionName=function(){return getRandom()},shapePoint={hasValidPointType:function(t){return/^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(t||this.config.point_type)},hasValidPointDrawMethods:function(t){var e=t||this.config.point_type;return isObjectType(e)&&isFunction$4(e.create)&&isFunction$4(e.update)},initialOpacityForCircle:function(t){var e=this,r=e.config,n=e.state.withoutFadeIn,i=r.point_opacity;return isUndefined$3(i)&&(i=this.getBaseValue(t)!==null&&n[t.id]?this.opacityForCircle(t):"0"),i},opacityForCircle:function(t){var e,r=this.config,n=r.point_opacity;return isUndefined$3(n)&&(n=r.point_show&&!(!((e=this.isPointFocusOnly)===null||e===void 0)&&e.call(this))?null:"0",n=isValue(this.getBaseValue(t))?this.isBubbleType(t)||this.isScatterType(t)?"0.5":n:"0"),n},initCircle:function(){var t=this,e=t.$el.main;t.point=t.generatePoint(),(t.hasType("bubble")||t.hasType("scatter"))&&e.select(".".concat($CIRCLE.chartCircles)).empty()&&e.select(".".concat($COMMON.chart)).append("g").attr("class",$CIRCLE.chartCircles)},updateTargetForCircle:function(t,e){var r=this,n=this,i=n.config,s=n.data,a=n.$el,o=i.interaction_enabled&&i.data_selection_enabled,l=o&&i.data_selection_isselectable,c=n.getClass("circles",!0);if(i.point_show){!a.circle&&n.initCircle();var u=t,d=e;if(!u){u=s.targets.filter(function(f){return r.isScatterType(f)||r.isBubbleType(f)});var h=a.main.select(".".concat($CIRCLE.chartCircles)).style("pointer-events","none").selectAll(".".concat($CIRCLE.circles)).data(u);h.exit().remove(),d=h.enter()}o&&d.append("g").attr("class",function(f){return n.generateClass($SELECT.selectedCircles,f.id)}),d.append("g").attr("class",c).call(function(f){n.setCssRule(!0,".".concat($CIRCLE.circles),["cursor:pointer"],l)(f),n.setCssRule(!0," .".concat($CIRCLE.circle),["fill","stroke"],n.color)(f)}).style("opacity",function(){var f=select(this.parentNode);return f.attr("class").indexOf($CIRCLE.chartCircles)>-1?"0":null}),o&&u.forEach(function(f){a.main.selectAll(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(f.id))).selectAll("".concat($SELECT.selectedCircle)).each(function(g){g.value=f.values[g.index].value})})}},updateCircle:function(t){t===void 0&&(t=!1);var e=this,r=e.config,n=e.state,i=e.$el,s=e.isPointFocusOnly(),a=t?i.subchart:i;if(r.point_show&&!n.toggling){r.point_radialGradient&&e.updateLinearGradient();var o=a.main.selectAll(".".concat($CIRCLE.circles)).selectAll(".".concat($CIRCLE.circle)).data(function(l){return e.isLineType(l)&&e.shouldDrawPointsForLine(l)||e.isBubbleType(l)||e.isRadarType(l)||e.isScatterType(l)?s?[l.values[0]]:l.values:[]});o.exit().remove(),o.enter().filter(Boolean).append(e.point("create",this,e.pointR.bind(e),e.updateCircleColor.bind(e))),a.circle=a.main.selectAll(".".concat($CIRCLE.circles," .").concat($CIRCLE.circle)).style("stroke",e.getStylePropValue(e.color)).style("opacity",e.initialOpacityForCircle.bind(e))}},updateCircleColor:function(t){var e=this,r=e.getStylePropValue(e.color);return e.config.point_radialGradient?e.getGradienColortUrl(t.id):r?r(t):null},redrawCircle:function(t,e,r,n,i){i===void 0&&(i=!1);var s=this,a=s.state.rendered,o=s.$el,l=s.$T,c=i?o.subchart:o,u=c.main.selectAll(".".concat($SELECT.selectedCircle));if(!s.config.point_show)return[];var d=s.point("update",s,t,e,s.updateCircleColor.bind(s),r,n,u),h=s.isCirclePoint()?"c":"",f=getRandom(),g=s.opacityForCircle.bind(s),p=[];return c.circle.each(function(m){var v=d.bind(this)(m);v=l(v,r||!a,f).style("opacity",g),p.push(v)}),[p,l(u,r).attr("".concat(h,"x"),t).attr("".concat(h,"y"),e)]},showCircleFocus:function(t){var e=this,r=e.state,n=r.hasRadar,i=r.resizing,s=r.toggling,a=r.transiting,o=e.$el,l=o.circle;if(a===!1&&l&&e.isPointFocusOnly()){var c=(n?e.radarCircleX:e.circleX).bind(e),u=(n?e.radarCircleY:e.circleY).bind(e),d=s||isUndefined$3(t),h=e.point("update",e,c,u,e.getStylePropValue(e.color),i?!1:d);t&&(l=l.filter(function(f){var g,p=(g=t.filter)===null||g===void 0?void 0:g.call(t,function(m){return m.id===f.id});return p.length?select(this).datum(p[0]):!1})),l.attr("class",this.updatePointClass.bind(this)).style("opacity",null).each(function(f){var g=f.id,p=f.index,m=f.value,v="hidden";isValue(m)&&(h.bind(this)(f),e.expandCircles(p,g),v=""),this.style.visibility=v})}},hideCircleFocus:function(){var t=this,e=t.$el.circle;t.isPointFocusOnly()&&e&&(t.unexpandCircles(),e.style("visibility","hidden"))},circleX:function(t){return this.xx(t)},updateCircleY:function(t){t===void 0&&(t=!1);var e=this,r=e.generateGetLinePoints(e.getShapeIndices(e.isLineType),t);return function(n,i){var s=n.id;return e.isGrouped(s)?r(n,i)[0][1]:e.getYScaleById(s,t)(e.getBaseValue(n))}},expandCircles:function(t,e,r){var n=this,i=n.pointExpandedR.bind(n);r&&n.unexpandCircles();var s=n.getShapeByIndex("circle",t,e).classed($COMMON.EXPANDED,!0),a=i(s)/n.config.point_r,o=1-a;n.isCirclePoint()?s.attr("r",i):s.each(function(){var l=select(this);if(this.tagName==="circle")l.attr("r",i);else{var c=this.getBBox(),u=c.width,d=c.height,h=o*(+l.attr("x")+u/2),f=o*(+l.attr("y")+d/2);l.attr("transform","translate(".concat(h," ").concat(f,") scale(").concat(a,")"))}})},unexpandCircles:function(t){var e=this,r=e.pointR.bind(e),n=e.getShapeByIndex("circle",t).filter(function(){return select(this).classed($COMMON.EXPANDED)}).classed($COMMON.EXPANDED,!1);if(n.attr("r",r),!e.isCirclePoint()){var i=r(n)/e.config.point_r;n.attr("transform",i!==1?"scale(".concat(i,")"):null)}},pointR:function(t){var e=this,r=e.config,n=r.point_r,i=n;return e.isBubbleType(t)?i=e.getBubbleR(t):isFunction$4(n)&&(i=n.bind(e.api)(t)),t.r=i,i},pointExpandedR:function(t){var e=this,r=e.config,n=e.isBubbleType(t)?1.15:1.75;return r.point_focus_expand_enabled?r.point_focus_expand_r||e.pointR(t)*n:e.pointR(t)},pointSelectR:function(t){var e=this,r=e.config.point_select_r;return isFunction$4(r)?r(t):r||e.pointR(t)*4},isPointFocusOnly:function(){var t=this;return t.config.point_focus_only&&!t.hasType("bubble")&&!t.hasType("scatter")&&!t.hasArcType(null,["radar"])},isWithinCircle:function(t,e){var r=this,n=r.config,i=r.state,s=getPointer$1(i.event,t),a=select(t),o=this.isCirclePoint(t)?"c":"",l=n.point_sensitivity==="radius"?t.getAttribute("r"):n.point_sensitivity,c=+a.attr("".concat(o,"x")),u=+a.attr("".concat(o,"y"));if(!(c||u)&&t.nodeType===1){var d=getBoundingRect(t),h=d.x,f=d.y;c=h,u=f}return Math.sqrt(Math.pow(c-s[0],2)+Math.pow(u-s[1],2))<(e||l)},getPointSensitivity:function(t){var e=this,r=e.config.point_sensitivity;return isFunction$4(r)?r=r.call(e.api,t):r==="radius"&&(r=t.r),r},insertPointInfoDefs:function(t,e){var r,n=this,i=function(c,u){for(var d=c.attributes,h=0,f;f=d[h];h++)f=f.name,u.setAttribute(f,c.getAttribute(f))},s=new DOMParser().parseFromString(t,"image/svg+xml"),a=s.documentElement,o=doc.createElementNS(namespaces.svg,a.nodeName.toLowerCase());if(o.id=e,o.style.fill="inherit",o.style.stroke="inherit",i(a,o),!((r=a.childNodes)===null||r===void 0)&&r.length){var l=select(o);"innerHTML"in o?l.html(a.innerHTML):toArray$1(a.childNodes).forEach(function(c){i(c,l.append(c.tagName).node())})}n.$el.defs.node().appendChild(o)},pointFromDefs:function(t){return this.$el.defs.select("#".concat(t))},updatePointClass:function(t){var e=this,r=e.$el.circle,n=!1;return(isObject$c(t)||r)&&(n=t===!0?r.each(function(i){var s=e.getClass("circle",!0)(i);this.getAttribute("class").indexOf($COMMON.EXPANDED)>-1&&(s+=" ".concat($COMMON.EXPANDED)),this.setAttribute("class",s)}):e.getClass("circle",!0)(t)),n},generateGetLinePoints:function(t,e){var r=this,n=r.config,i=r.getShapeX(0,t,e),s=r.getShapeY(e),a=r.getShapeOffset(r.isLineType,t,e),o=r.getYScaleById.bind(r);return function(l,c){var u=o.call(r,l.id,e)(r.getShapeYMin(l.id)),d=a(l,c)||u,h=i(l),f=s(l);n.axis_rotated&&(l.value>0&&f<u||l.value<0&&u<f)&&(f=u);var g=[h,f-(u-d)];return[g,g,g,g]}},generatePoint:function(){var t=this,e=t.config,r=t.state.datetimeId,n=[],i=notEmpty(e.point_pattern)?e.point_pattern:[e.point_type];return function(s,a){for(var o=[],l=2;l<arguments.length;l++)o[l-2]=arguments[l];return function(c){var u,d=t.getTargetSelectorSuffix(c.id||((u=c.data)===null||u===void 0?void 0:u.id)||c),h=select(this);n.indexOf(d)<0&&n.push(d);var f=i[n.indexOf(d)%i.length];if(t.hasValidPointType(f))f=t[f];else if(!t.hasValidPointDrawMethods(f)){var g="".concat(r,"-point").concat(d),p=t.pointFromDefs(g);if(p.size()<1&&t.insertPointInfoDefs(f,g),s==="create")return t.custom.create.bind(a).apply(void 0,__spreadArray([h,g],o,!1));if(s==="update")return t.custom.update.bind(a).apply(void 0,__spreadArray([h],o,!1))}return f[s].bind(a).apply(void 0,__spreadArray([h],o,!1))}}},custom:{create:function(t,e,r){return t.append("use").attr("xlink:href","#".concat(e)).attr("class",this.updatePointClass.bind(this)).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=t.node().getBBox(),c=l.width,u=l.height,d=function(g){return isValue(g.value)?e(g)-c/2:0},h=function(g){return isValue(g.value)?r(g)-u/2:0},f=t;return i&&(s&&f.attr("x",d),f=o.$T(f,i,getTransitionName()),a&&o.$T(a,i,getTransitionName())),f.attr("x",d).attr("y",h).style("fill",n)}},circle:{create:function(t,e,r){return t.append("circle").attr("class",this.updatePointClass.bind(this)).attr("r",e).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=t;return o.hasType("bubble")&&l.attr("r",o.pointR.bind(o)),i&&(s&&l.attr("cx",e),l.attr("cx")&&(l=o.$T(l,i,getTransitionName())),a&&o.$T(l,i,getTransitionName())),l.attr("cx",e).attr("cy",r).style("fill",n)}},rectangle:{create:function(t,e,r){var n=function(i){return e(i)*2};return t.append("rect").attr("class",this.updatePointClass.bind(this)).attr("width",n).attr("height",n).style("fill",r).node()},update:function(t,e,r,n,i,s,a){var o=this,l=o.config.point_r,c=function(h){return e(h)-l},u=function(h){return r(h)-l},d=t;return i&&(s&&d.attr("x",c),d=o.$T(d,i,getTransitionName()),a&&o.$T(a,i,getTransitionName())),d.attr("x",c).attr("y",u).style("fill",n)}}},optPoint={point_show:!0,point_r:2.5,point_radialGradient:!1,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_focus_only:!1,point_opacity:void 0,point_pattern:[],point_select_r:void 0,point_type:"circle"},optArea={area_above:!1,area_below:!1,area_front:!0,area_linearGradient:!1,area_zerobased:!0},optBar={bar_front:!1,bar_indices_removeNull:!1,bar_label_threshold:0,bar_linearGradient:!1,bar_overlap:!1,bar_padding:0,bar_radius:void 0,bar_radius_ratio:void 0,bar_sensitivity:2,bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0},optLine={line_connectNull:!1,line_step_type:"step",line_step_tooltipMatch:!1,line_zerobased:!1,line_classes:void 0,line_point:!0},optScatter={scatter_zerobased:!1},optArc={arc_cornerRadius:0,arc_cornerRadius_ratio:0,arc_needle_show:!1,arc_needle_color:void 0,arc_needle_value:void 0,arc_needle_path:void 0,arc_needle_length:100,arc_needle_top_rx:0,arc_needle_top_ry:0,arc_needle_top_width:0,arc_needle_bottom_rx:1,arc_needle_bottom_ry:1,arc_needle_bottom_width:15,arc_needle_bottom_len:0},optPie={pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_rate:.98,pie_expand_duration:50,pie_innerRadius:0,pie_outerRadius:void 0,pie_padAngle:0,pie_padding:0,pie_startingAngle:0};function extendAxis(t,e){extend$3(ChartInternal.prototype,internal.concat(t)),extend$3(Chart.prototype,api),Options.setOptions(options.concat(e||[]))}function extendLine(t,e){extendAxis([shapePoint,shapeLine].concat(t||[])),Options.setOptions([optPoint,optLine].concat(e||[]))}function extendArc(t,e){extend$3(ChartInternal.prototype,[shapeArc].concat(t||[])),Options.setOptions(e)}var area=function(){return extendLine(shapeArea,[optArea]),(area=function(){return TYPE.AREA})()},line=function(){return extendLine(),(line=function(){return TYPE.LINE})()},pie=function(){return extendArc(void 0,[optArc,optPie]),(pie=function(){return TYPE.PIE})()},bar=function(){return extendAxis([shapeBar],optBar),(bar=function(){return TYPE.BAR})()},scatter=function(){return extendAxis([shapePoint],[optPoint,optScatter]),(scatter=function(){return TYPE.SCATTER})()},subchart$1=function(t){var e,r=this.internal,n=r.axis,i=r.brush,s=r.config,a=r.scale,o=a.x,l=a.subX,c=r.state,u;if(s.subchart_show)if(u=t,Array.isArray(u)){n.isTimeSeries()&&(u=u.map(function(h){return parseDate.bind(r)(h)}));var d=r.withinRange(u,r.getZoomDomain("subX",!0),r.getZoomDomain("subX"));d&&(c.domain=u,i.move(i.getSelection(),u.map(l)))}else u=(e=c.domain)!==null&&e!==void 0?e:o.orgDomain();return u};extend$3(subchart$1,{show:function(){var t,e,r=this.internal,n=r.$el.subchart,i=r.config,s=i.subchart_show;if(!s){r.unbindZoomEvent(),i.subchart_show=!s,!n.main&&r.initSubchart();var a=n.main.selectAll(".".concat($COMMON.target));r.data.targets.length!==a.size()&&(r.updateSizes(),r.updateTargetsForSubchart(r.data.targets),a=(t=n.main)===null||t===void 0?void 0:t.selectAll(".".concat($COMMON.target))),a==null||a.style("opacity",null),(e=n.main)===null||e===void 0||e.style("display",null),this.resize()}},hide:function(){var t=this.internal,e=t.$el.subchart.main,r=t.config;r.subchart_show&&(e==null?void 0:e.style("display"))!=="none"&&(r.subchart_show=!1,e.style("display","none"),this.resize())},toggle:function(){var t=this.internal,e=t.config;this.subchart[e.subchart_show?"hide":"show"]()},reset:function(){var t=this.internal,e=t.brush;e.clear(e.getSelection())}});var zoom$1=function(t){var e,r,n=this.internal,i=n.$el,s=n.axis,a=n.config,o=n.org,l=n.scale,c=n.state,u=a.axis_rotated,d=s.isCategorized(),h;if(a.zoom_enabled)if(h=t,Array.isArray(h)){s.isTimeSeries()&&(h=h.map(function(v){return parseDate.bind(n)(v)}));var f=n.withinRange(h,n.getZoomDomain("zoom",!0),n.getZoomDomain("zoom"));if(f){if(c.domain=h,d&&(h=h.map(function(v,_){return Number(v)+(_===0?0:1)})),n.api.tooltip.hide(),a.subchart_show){var g=l.zoom||l.x;n.brush.getSelection().call(n.brush.move,h.map(g))}else{var g=d?l.x.orgScale():o.xScale||l.x,p=[-g(h[0]),0],m=(e=identity$1.scale(g.range()[1]/(g(h[1])-g(h[0])))).translate.apply(e,u?p.reverse():p);i.eventRect.call(n.zoom.transform,m)}n.setZoomResetButton()}}else h=n.zoom.getDomain();return(r=c.domain)!==null&&r!==void 0?r:h};extend$3(zoom$1,{enable:function(t){var e=this.internal,r=e.config;/^(drag|wheel)$/.test(t)&&(r.zoom_type=t),r.zoom_enabled=!!t,e.zoom?t===!1&&e.bindZoomEvent(!1):(e.initZoom(),e.bindZoomEvent()),e.updateAndRedraw()},max:function(t){var e=this.internal,r=e.config,n=e.org.xDomain;return(t===0||t)&&(r.zoom_x_max=getMinMax$1("max",[n[1],t])),r.zoom_x_max},min:function(t){var e=this.internal,r=e.config,n=e.org.xDomain;return(t===0||t)&&(r.zoom_x_min=getMinMax$1("min",[n[0],t])),r.zoom_x_min},range:function(t){var e=this.zoom;if(isObject$c(t)){var r=t.min,n=t.max;isDefined$1(r)&&e.min(r),isDefined$1(n)&&e.max(n)}return{min:e.min(),max:e.max()}}});var drag={drag:function(t){var e=this,r=e.config,n=e.state,i=e.$el.main,s=r.data_selection_grouped,a=r.interaction_enabled&&r.data_selection_isselectable;if(!(e.hasArcType()||!r.data_selection_enabled||r.zoom_enabled&&!e.zoom.altDomain||!r.data_selection_multiple)){var o=n.dragStart||[0,0],l=o[0],c=o[1],u=t[0],d=t[1],h=Math.min(l,u),f=Math.max(l,u),g=s?n.margin.top:Math.min(c,d),p=s?n.height:Math.max(c,d);i.select(".".concat($DRAG.dragarea)).attr("x",h).attr("y",g).attr("width",f-h).attr("height",p-g),i.selectAll(".".concat($SHAPE.shapes)).selectAll(".".concat($SHAPE.shape)).filter(function(m){return a==null?void 0:a.bind(e.api)(m)}).each(function(m,v){var _=select(this),b=_.classed($SELECT.SELECTED),C=_.classed($DRAG.INCLUDED),S=!1,w;if(_.classed($CIRCLE.circle)){var A=+_.attr("cx")*1,O=+_.attr("cy")*1;w=e.togglePoint,S=h<A&&A<f&&g<O&&O<p}else if(_.classed($BAR.bar)){var T=getPathBox(this),A=T.x,O=T.y,H=T.width,k=T.height;w=e.togglePath,S=!(f<A||A+H<h)&&!(p<O||O+k<g)}else return;S^C&&(_.classed($DRAG.INCLUDED,!C),_.classed($SELECT.SELECTED,!b),w.call(e,!b,_,m,v))})}},dragstart:function(t){var e=this,r=e.config,n=e.state,i=e.$el.main;e.hasArcType()||!r.data_selection_enabled||(n.dragStart=t,i.select(".".concat($COMMON.chart)).append("rect").attr("class",$DRAG.dragarea).style("opacity","0.1"),e.setDragStatus(!0))},dragend:function(){var t=this,e=t.config,r=t.$el.main,n=t.$T;t.hasArcType()||!e.data_selection_enabled||(n(r.select(".".concat($DRAG.dragarea))).style("opacity","0").remove(),r.selectAll(".".concat($SHAPE.shape)).classed($DRAG.INCLUDED,!1),t.setDragStatus(!1))}};_assign(_assign({},drag),{selectPoint:function(t,e,r){var n=this,i=n.config,s=n.$el.main,a=n.$T,o=i.axis_rotated,l=(o?n.circleY:n.circleX).bind(n),c=(o?n.circleX:n.circleY).bind(n),u=n.pointSelectR.bind(n);callFn(i.data_onselected,n.api,e,t.node()),a(s.select(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(e.id))).selectAll(".".concat($SELECT.selectedCircle,"-").concat(r)).data([e]).enter().append("circle").attr("class",function(){return n.generateClass($SELECT.selectedCircle,r)}).attr("cx",l).attr("cy",c).attr("stroke",n.color).attr("r",function(d){return n.pointSelectR(d)*1.4})).attr("r",u)},unselectPoint:function(t,e,r){var n=this,i=n.config,s=n.$el.main,a=n.$T;callFn(i.data_onunselected,n.api,e,t==null?void 0:t.node()),a(s.select(".".concat($SELECT.selectedCircles).concat(n.getTargetSelectorSuffix(e.id))).selectAll(".".concat($SELECT.selectedCircle,"-").concat(r))).attr("r",0).remove()},togglePoint:function(t,e,r,n){var i="".concat(t?"":"un","selectPoint");this[i](e,r,n)},selectPath:function(t,e){var r=this,n=r.config;callFn(n.data_onselected,r.api,e,t.node()),n.interaction_brighten&&t.style("filter","brightness(1.25)")},unselectPath:function(t,e){var r=this,n=r.config;callFn(n.data_onunselected,r.api,e,t.node()),n.interaction_brighten&&t.style("filter",null)},togglePath:function(t,e,r,n){this["".concat(t?"":"un","selectPath")](e,r,n)},getToggle:function(t,e){var r=this;return t.nodeName==="path"?r.togglePath:r.isStepType(e)?function(){}:r.togglePoint},toggleShape:function(t,e,r){var n,i=this,s=i.config,a=i.$el.main;if(s.data_selection_enabled&&s.data_selection_isselectable.bind(i.api)(e)){var o=select(t),l=o.classed($SELECT.SELECTED),c=i.getToggle(t,e).bind(i),u;if(!s.data_selection_multiple){var d=(n=i.isPointFocusOnly)===null||n===void 0?void 0:n.call(i),h=".".concat(d?$SELECT.selectedCircles:$SHAPE.shapes);s.data_selection_grouped&&(h+=i.getTargetSelectorSuffix(e.id)),a.selectAll(h).selectAll(d?".".concat($SELECT.selectedCircle):".".concat($SHAPE.shape,".").concat($SELECT.SELECTED)).classed($SELECT.SELECTED,!1).each(function(f){var g=select(this);u=g,c(!1,g,f,f.index)})}(!u||u.node()!==o.node())&&(o.classed($SELECT.SELECTED,!l),c(!l,o,e,r))}}});var defaults$2={},bb={version:"3.10.3",generate:function(t){var e=mergeObj({},defaults$2,t),r=new Chart(e);return r.internal.charts=this.instance,this.instance.push(r),r},defaults:function(t){return isObject$c(t)&&(defaults$2=t),defaults$2},instance:[],plugin:{}};const insight="",displayChart=t=>{processMsgQueue(t.MsgQueue),setNumericBullets($$8(".block")),setNumericBullets($$8("table td"))};function processMsgQueue(t){t.forEach(e=>processSingleMsg(e==null?void 0:e.data))}const generalAxis=(t,e=r=>{})=>({axis:(n=>(e(n),n))({x:{tick:{format(n){return t[0].xlabels[n]||n}}}})});function processSingleMsg(t){if(!t)return;const{chartID:e,chartType:r,chartData:n}=t,i={bindto:`#${e}`};switch(r){case"lineChart":Object.assign(i,Kt(Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:line()}},generalAxis(n)),{interaction:{enabled:!0}}));break;case"barChart":Object.assign(i,Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:bar()}},generalAxis(n,s=>s.x.tick.multiline=!0)));break;case"pieChart":case"pie3DChart":Object.assign(i,{data:{columns:Object.values(n[0].xlabels).map((s,a)=>[s,n[0].values[a].y]),type:pie()}});break;case"areaChart":Object.assign(i,Pt({data:{columns:n.map(s=>[s.key,...s.values.map(({y:a})=>a)]),type:area()},interaction:{enabled:!0}},generalAxis(n)));break;case"scatterChart":Object.assign(i,{data:{xs:{y:"x"},columns:n.map((s,a)=>[a?"y":"x",...s]),type:scatter()},axis:{x:{label:"X",showDist:!0,tick:{format:format$2(".02f")}},y:{label:"Y",showDist:!0,tick:{format:format$2(".02f")}}}});break}i.data&&bb.generate(i)}function setNumericBullets(t){const e=t;for(let r=0;r<e.length;r++){const n=$$8(e[r]).find(".numeric-bullet-style");if(n.length>0){let i="",s="",a=0;const o=[];let l=0;const c=[];for(let u=0;u<n.length;u++){const d=$$8(n[u]).data("bulltname"),h=$$8(n[u]).data("bulltlvl");a==0?(i=d,s=h,o[l]=a,c[l]=d,a++):d==i&&h==s?(i=d,s=h,a++,o[l]=a,c[l]=d):d!=i&&h==s||d!=i&&Number(h)>Number(s)?(i=d,s=h,l++,o[l]=a,c[l]=d,a=1):d!=i&&Number(h)<Number(s)&&(i=d,s=h,l--,a=o[l]+1);const f=getNumTypeNum(c[l],a);$$8(n[u]).html(f)}}}}function getNumTypeNum(t,e){let r="";switch(t){case"arabicPeriod":r=e+". ";break;case"arabicParenR":r=e+") ";break;case"alphaLcParenR":r=alphaNumeric(e,"lowerCase")+") ";break;case"alphaLcPeriod":r=alphaNumeric(e,"lowerCase")+". ";break;case"alphaUcParenR":r=alphaNumeric(e,"upperCase")+") ";break;case"alphaUcPeriod":r=alphaNumeric(e,"upperCase")+". ";break;case"romanUcPeriod":r=romanize(e)+". ";break;case"romanLcParenR":r=romanize(e)+") ";break;case"hebrew2Minus":r=hebrew2Minus.format(e)+"-";break;default:r=String(e)}return r}function romanize(t){var s;if(!+t)return!1;const e=String(+t).split(""),r=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];let n="",i=3;for(;i--;)n=(r[+((s=e.pop())!=null?s:"")+i*10]||"")+n;return Array(+e.join("")+1).join("M")+n}const hebrew2Minus=archaicNumbers([[1e3,""],[400,"ת"],[300,"ש"],[200,"ר"],[100,"ק"],[90,"צ"],[80,"פ"],[70,"ע"],[60,"ס"],[50,"נ"],[40,"מ"],[30,"ל"],[20,"כ"],[10,"י"],[9,"ט"],[8,"ח"],[7,"ז"],[6,"ו"],[5,"ה"],[4,"ד"],[3,"ג"],[2,"ב"],[1,"א"],[/יה/,"ט״ו"],[/יו/,"ט״ז"],[/([א-ת])([א-ת])$/,"$1״$2"],[/^([א-ת])$/,"$1׳"]]);function archaicNumbers(t){return t.slice().sort(function(e,r){return r[1].length-e[1].length}),{format:function(e){let r="";return $$8.each(t,function(){const n=this[0];if(parseInt(n)>0)for(;e>=n;e-=n)r+=this[1];else r=r.replace(n,this[1])}),r}}}function alphaNumeric(t,e){t=Number(t)-1;let r="";return e=="upperCase"?r=((t/26>=1?String.fromCharCode(t/26+64):"")+String.fromCharCode(t%26+65)).toUpperCase():e=="lowerCase"&&(r=((t/26>=1?String.fromCharCode(t/26+64):"")+String.fromCharCode(t%26+65)).toLowerCase()),r}const BASE_PATH="/node_modules/@flyfish-group/file-viewer/dist/worker/";class WorkerRefImpl{constructor(e){$t(this,"worker",null);this.worker=e}defaults(e){return this.worker||e()}}function refWorker(t,e=!1){let r=null;const n=`${BASE_PATH}${t}`;return r=new Worker(new URL(n,typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__filename).href:typeof document=="undefined"?location.href:_documentCurrentScript&&_documentCurrentScript.src||new URL("index.umd.js",document.baseURI).href),{type:e?"module":"classic"}),new WorkerRefImpl(r)}const PptxWorker={create(){return refWorker("pptx.worker.js").defaults(()=>new Worker(new URL(""+(typeof document=="undefined"&&typeof location=="undefined"?require("url").pathToFileURL(__dirname+"/worker/pptx.worker.js").href:new URL("worker/pptx.worker.js",typeof document=="undefined"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),self.location),{type:"module"}))}},_sfc_main$4=Vue.defineComponent({__name:"PptxRender",props:{data:null,options:{type:Function,default:DefaultOptions}},setup(t){const e=t,r=Vue.ref(null);return(()=>{const n={isDone:!1,thumbElement:null,worker:null,timer:null},i={startWorker(){n.worker&&n.worker.terminate(),n.timer&&clearInterval(n.timer);const s=n.worker=PptxWorker.create();s.addEventListener("message",a=>{this.processMessage(a.data)},!1),s.addEventListener("error",a=>{console.error(a)},!1),s.postMessage({type:"processPPTX",data:e.data,IE11:"MSInputMethodContext"in window&&"documentMode"in document,options:e.options()}),n.timer=setInterval(this.stopWorker,500)},stopWorker(){var s;n.isDone&&((s=n.worker)==null||s.terminate(),console.log("worker terminated"),n.timer&&clearInterval(n.timer))},resize(){if(r.value){const s=$$8(r.value),a=Math.max(...Array.from(s.children("section")).map(l=>l.offsetWidth)),o=s[0].offsetWidth;s.css({transform:`scale(${o/a})`,"transform-origin":"top left"})}},processMessage(s){if(n.isDone||!r.value)return;const a=$$8(r.value),{thumbElement:o}=n;switch(s.type){case"slide":console.log("正在处理:",s.slide_num),a.append(s.data);break;case"pptx-thumb":o&&$$8(o).attr("src",`data:image/jpeg;base64,${s.data}`);break;case"slideSize":break;case"globalCSS":a.append(`<style>${s.data}</style>`);break;case"ExecutionTime":case"Done":console.log("pptx渲染完成,耗时",s.data),displayChart(s.charts),n.isDone=!0;break;case"WARN":console.warn("PPTX processing warning: ",s.data);break;case"ERROR":n.isDone=!0,console.error("PPTX processing error: ",s.data);break;case"DEBUG":console.debug("Worker: ",s.data);break;case"INFO":default:console.info("Worker: ",s.data)}}};Vue.onMounted(()=>{i.startWorker()})})(),{__sfc:!0,props:e,wrapper:r}}}),PptxRender_vue_vue_type_style_index_0_scoped_1b0d57cb_lang="";var _sfc_render$4=function(){var e=this,r=e._self._c;return e._self._setupProxy,r("div",{ref:"wrapper",staticClass:"pptx-wrapper"})},_sfc_staticRenderFns$4=[],__component__$5=normalizeComponent$2(_sfc_main$4,_sfc_render$4,_sfc_staticRenderFns$4,!1,null,"1b0d57cb",null,null);const PptxRender=__component__$5.exports,PptxRender$1=Object.freeze(Object.defineProperty({__proto__:null,default:PptxRender},Symbol.toStringTag,{value:"Module"}));var check=function(t){return t&&t.Math===Math&&t},global$h=check(typeof globalThis=="object"&&globalThis)||check(typeof window=="object"&&window)||check(typeof self=="object"&&self)||check(typeof commonjsGlobal$1=="object"&&commonjsGlobal$1)||check(typeof commonjsGlobal$1=="object"&&commonjsGlobal$1)||function(){return this}()||Function("return this")(),objectGetOwnPropertyDescriptor={},fails$c=function(t){try{return!!t()}catch(e){return!0}},fails$b=fails$c,descriptors=!fails$b(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),fails$a=fails$c,functionBindNative=!fails$a(function(){var t=function(){}.bind();return typeof t!="function"||t.hasOwnProperty("prototype")}),NATIVE_BIND$3=functionBindNative,call$9=Function.prototype.call,functionCall=NATIVE_BIND$3?call$9.bind(call$9):function(){return call$9.apply(call$9,arguments)},objectPropertyIsEnumerable={},$propertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor$3=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor$3&&!$propertyIsEnumerable.call({1:2},1);objectPropertyIsEnumerable.f=NASHORN_BUG?function(e){var r=getOwnPropertyDescriptor$3(this,e);return!!r&&r.enumerable}:$propertyIsEnumerable;var createPropertyDescriptor$4=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}},NATIVE_BIND$2=functionBindNative,FunctionPrototype$2=Function.prototype,call$8=FunctionPrototype$2.call,uncurryThisWithBind=NATIVE_BIND$2&&FunctionPrototype$2.bind.bind(call$8,call$8),functionUncurryThis=NATIVE_BIND$2?uncurryThisWithBind:function(t){return function(){return call$8.apply(t,arguments)}},uncurryThis$f=functionUncurryThis,toString$5=uncurryThis$f({}.toString),stringSlice$1=uncurryThis$f("".slice),classofRaw$2=function(t){return stringSlice$1(toString$5(t),8,-1)},uncurryThis$e=functionUncurryThis,fails$9=fails$c,classof$6=classofRaw$2,$Object$3=Object,split=uncurryThis$e("".split),indexedObject=fails$9(function(){return!$Object$3("z").propertyIsEnumerable(0)})?function(t){return classof$6(t)==="String"?split(t,""):$Object$3(t)}:$Object$3,isNullOrUndefined$3=function(t){return t==null},isNullOrUndefined$2=isNullOrUndefined$3,$TypeError$c=TypeError,requireObjectCoercible$2=function(t){if(isNullOrUndefined$2(t))throw new $TypeError$c("Can't call method on "+t);return t},IndexedObject=indexedObject,requireObjectCoercible$1=requireObjectCoercible$2,toIndexedObject$4=function(t){return IndexedObject(requireObjectCoercible$1(t))},documentAll$2=typeof document=="object"&&document.all,IS_HTMLDDA=typeof documentAll$2=="undefined"&&documentAll$2!==void 0,documentAll_1={all:documentAll$2,IS_HTMLDDA},$documentAll$1=documentAll_1,documentAll$1=$documentAll$1.all,isCallable$h=$documentAll$1.IS_HTMLDDA?function(t){return typeof t=="function"||t===documentAll$1}:function(t){return typeof t=="function"},isCallable$g=isCallable$h,$documentAll=documentAll_1,documentAll=$documentAll.all,isObject$b=$documentAll.IS_HTMLDDA?function(t){return typeof t=="object"?t!==null:isCallable$g(t)||t===documentAll}:function(t){return typeof t=="object"?t!==null:isCallable$g(t)},global$g=global$h,isCallable$f=isCallable$h,aFunction=function(t){return isCallable$f(t)?t:void 0},getBuiltIn$5=function(t,e){return arguments.length<2?aFunction(global$g[t]):global$g[t]&&global$g[t][e]},uncurryThis$d=functionUncurryThis,objectIsPrototypeOf=uncurryThis$d({}.isPrototypeOf),engineUserAgent=typeof navigator!="undefined"&&String(navigator.userAgent)||"",global$f=global$h,userAgent$1=engineUserAgent,process$3=global$f.process,Deno$1=global$f.Deno,versions=process$3&&process$3.versions||Deno$1&&Deno$1.version,v8=versions&&versions.v8,match,version$1;v8&&(match=v8.split("."),version$1=match[0]>0&&match[0]<4?1:+(match[0]+match[1])),!version$1&&userAgent$1&&(match=userAgent$1.match(/Edge\/(\d+)/),(!match||match[1]>=74)&&(match=userAgent$1.match(/Chrome\/(\d+)/),match&&(version$1=+match[1])));var engineV8Version=version$1,V8_VERSION=engineV8Version,fails$8=fails$c,global$e=global$h,$String$6=global$e.String,symbolConstructorDetection=!!Object.getOwnPropertySymbols&&!fails$8(function(){var t=Symbol("symbol detection");return!$String$6(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&V8_VERSION&&V8_VERSION<41}),NATIVE_SYMBOL$2=symbolConstructorDetection,useSymbolAsUid=NATIVE_SYMBOL$2&&!Symbol.sham&&typeof Symbol.iterator=="symbol",getBuiltIn$4=getBuiltIn$5,isCallable$e=isCallable$h,isPrototypeOf$2=objectIsPrototypeOf,USE_SYMBOL_AS_UID$1=useSymbolAsUid,$Object$2=Object,isSymbol$3=USE_SYMBOL_AS_UID$1?function(t){return typeof t=="symbol"}:function(t){var e=getBuiltIn$4("Symbol");return isCallable$e(e)&&isPrototypeOf$2(e.prototype,$Object$2(t))},$String$5=String,tryToString$4=function(t){try{return $String$5(t)}catch(e){return"Object"}},isCallable$d=isCallable$h,tryToString$3=tryToString$4,$TypeError$b=TypeError,aCallable$4=function(t){if(isCallable$d(t))return t;throw new $TypeError$b(tryToString$3(t)+" is not a function")},aCallable$3=aCallable$4,isNullOrUndefined$1=isNullOrUndefined$3,getMethod$3=function(t,e){var r=t[e];return isNullOrUndefined$1(r)?void 0:aCallable$3(r)},call$7=functionCall,isCallable$c=isCallable$h,isObject$a=isObject$b,$TypeError$a=TypeError,ordinaryToPrimitive$1=function(t,e){var r,n;if(e==="string"&&isCallable$c(r=t.toString)&&!isObject$a(n=call$7(r,t))||isCallable$c(r=t.valueOf)&&!isObject$a(n=call$7(r,t))||e!=="string"&&isCallable$c(r=t.toString)&&!isObject$a(n=call$7(r,t)))return n;throw new $TypeError$a("Can't convert object to primitive value")},shared$3={exports:{}},global$d=global$h,defineProperty$5=Object.defineProperty,defineGlobalProperty$3=function(t,e){try{defineProperty$5(global$d,t,{value:e,configurable:!0,writable:!0})}catch(r){global$d[t]=e}return e},global$c=global$h,defineGlobalProperty$2=defineGlobalProperty$3,SHARED="__core-js_shared__",store$3=global$c[SHARED]||defineGlobalProperty$2(SHARED,{}),sharedStore=store$3,store$2=sharedStore;(shared$3.exports=function(t,e){return store$2[t]||(store$2[t]=e!==void 0?e:{})})("versions",[]).push({version:"3.33.3",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE",source:"https://github.com/zloirock/core-js"});var sharedExports=shared$3.exports,requireObjectCoercible=requireObjectCoercible$2,$Object$1=Object,toObject$5=function(t){return $Object$1(requireObjectCoercible(t))},uncurryThis$c=functionUncurryThis,toObject$4=toObject$5,hasOwnProperty$a=uncurryThis$c({}.hasOwnProperty),hasOwnProperty_1=Object.hasOwn||function(e,r){return hasOwnProperty$a(toObject$4(e),r)},uncurryThis$b=functionUncurryThis,id=0,postfix=Math.random(),toString$4=uncurryThis$b(1 .toString),uid$2=function(t){return"Symbol("+(t===void 0?"":t)+")_"+toString$4(++id+postfix,36)},global$b=global$h,shared$2=sharedExports,hasOwn$8=hasOwnProperty_1,uid$1=uid$2,NATIVE_SYMBOL$1=symbolConstructorDetection,USE_SYMBOL_AS_UID=useSymbolAsUid,Symbol$3=global$b.Symbol,WellKnownSymbolsStore=shared$2("wks"),createWellKnownSymbol=USE_SYMBOL_AS_UID?Symbol$3.for||Symbol$3:Symbol$3&&Symbol$3.withoutSetter||uid$1,wellKnownSymbol$6=function(t){return hasOwn$8(WellKnownSymbolsStore,t)||(WellKnownSymbolsStore[t]=NATIVE_SYMBOL$1&&hasOwn$8(Symbol$3,t)?Symbol$3[t]:createWellKnownSymbol("Symbol."+t)),WellKnownSymbolsStore[t]},call$6=functionCall,isObject$9=isObject$b,isSymbol$2=isSymbol$3,getMethod$2=getMethod$3,ordinaryToPrimitive=ordinaryToPrimitive$1,wellKnownSymbol$5=wellKnownSymbol$6,$TypeError$9=TypeError,TO_PRIMITIVE=wellKnownSymbol$5("toPrimitive"),toPrimitive$1=function(t,e){if(!isObject$9(t)||isSymbol$2(t))return t;var r=getMethod$2(t,TO_PRIMITIVE),n;if(r){if(e===void 0&&(e="default"),n=call$6(r,t,e),!isObject$9(n)||isSymbol$2(n))return n;throw new $TypeError$9("Can't convert object to primitive value")}return e===void 0&&(e="number"),ordinaryToPrimitive(t,e)},toPrimitive=toPrimitive$1,isSymbol$1=isSymbol$3,toPropertyKey$3=function(t){var e=toPrimitive(t,"string");return isSymbol$1(e)?e:e+""},global$a=global$h,isObject$8=isObject$b,document$1=global$a.document,EXISTS$1=isObject$8(document$1)&&isObject$8(document$1.createElement),documentCreateElement$1=function(t){return EXISTS$1?document$1.createElement(t):{}},DESCRIPTORS$9=descriptors,fails$7=fails$c,createElement$1=documentCreateElement$1,ie8DomDefine=!DESCRIPTORS$9&&!fails$7(function(){return Object.defineProperty(createElement$1("div"),"a",{get:function(){return 7}}).a!==7}),DESCRIPTORS$8=descriptors,call$5=functionCall,propertyIsEnumerableModule=objectPropertyIsEnumerable,createPropertyDescriptor$3=createPropertyDescriptor$4,toIndexedObject$3=toIndexedObject$4,toPropertyKey$2=toPropertyKey$3,hasOwn$7=hasOwnProperty_1,IE8_DOM_DEFINE$1=ie8DomDefine,$getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor;objectGetOwnPropertyDescriptor.f=DESCRIPTORS$8?$getOwnPropertyDescriptor$1:function(e,r){if(e=toIndexedObject$3(e),r=toPropertyKey$2(r),IE8_DOM_DEFINE$1)try{return $getOwnPropertyDescriptor$1(e,r)}catch(n){}if(hasOwn$7(e,r))return createPropertyDescriptor$3(!call$5(propertyIsEnumerableModule.f,e,r),e[r])};var objectDefineProperty={},DESCRIPTORS$7=descriptors,fails$6=fails$c,v8PrototypeDefineBug=DESCRIPTORS$7&&fails$6(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),isObject$7=isObject$b,$String$4=String,$TypeError$8=TypeError,anObject$8=function(t){if(isObject$7(t))return t;throw new $TypeError$8($String$4(t)+" is not an object")},DESCRIPTORS$6=descriptors,IE8_DOM_DEFINE=ie8DomDefine,V8_PROTOTYPE_DEFINE_BUG$1=v8PrototypeDefineBug,anObject$7=anObject$8,toPropertyKey$1=toPropertyKey$3,$TypeError$7=TypeError,$defineProperty=Object.defineProperty,$getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,ENUMERABLE="enumerable",CONFIGURABLE$1="configurable",WRITABLE="writable";objectDefineProperty.f=DESCRIPTORS$6?V8_PROTOTYPE_DEFINE_BUG$1?function(e,r,n){if(anObject$7(e),r=toPropertyKey$1(r),anObject$7(n),typeof e=="function"&&r==="prototype"&&"value"in n&&WRITABLE in n&&!n[WRITABLE]){var i=$getOwnPropertyDescriptor(e,r);i&&i[WRITABLE]&&(e[r]=n.value,n={configurable:CONFIGURABLE$1 in n?n[CONFIGURABLE$1]:i[CONFIGURABLE$1],enumerable:ENUMERABLE in n?n[ENUMERABLE]:i[ENUMERABLE],writable:!1})}return $defineProperty(e,r,n)}:$defineProperty:function(e,r,n){if(anObject$7(e),r=toPropertyKey$1(r),anObject$7(n),IE8_DOM_DEFINE)try{return $defineProperty(e,r,n)}catch(i){}if("get"in n||"set"in n)throw new $TypeError$7("Accessors not supported");return"value"in n&&(e[r]=n.value),e};var DESCRIPTORS$5=descriptors,definePropertyModule$4=objectDefineProperty,createPropertyDescriptor$2=createPropertyDescriptor$4,createNonEnumerableProperty$5=DESCRIPTORS$5?function(t,e,r){return definePropertyModule$4.f(t,e,createPropertyDescriptor$2(1,r))}:function(t,e,r){return t[e]=r,t},makeBuiltIn$2={exports:{}},DESCRIPTORS$4=descriptors,hasOwn$6=hasOwnProperty_1,FunctionPrototype$1=Function.prototype,getDescriptor=DESCRIPTORS$4&&Object.getOwnPropertyDescriptor,EXISTS=hasOwn$6(FunctionPrototype$1,"name"),PROPER=EXISTS&&function(){}.name==="something",CONFIGURABLE=EXISTS&&(!DESCRIPTORS$4||DESCRIPTORS$4&&getDescriptor(FunctionPrototype$1,"name").configurable),functionName={EXISTS,PROPER,CONFIGURABLE},uncurryThis$a=functionUncurryThis,isCallable$b=isCallable$h,store$1=sharedStore,functionToString=uncurryThis$a(Function.toString);isCallable$b(store$1.inspectSource)||(store$1.inspectSource=function(t){return functionToString(t)});var inspectSource$1=store$1.inspectSource,global$9=global$h,isCallable$a=isCallable$h,WeakMap$2=global$9.WeakMap,weakMapBasicDetection=isCallable$a(WeakMap$2)&&/native code/.test(String(WeakMap$2)),shared$1=sharedExports,uid=uid$2,keys$2=shared$1("keys"),sharedKey$2=function(t){return keys$2[t]||(keys$2[t]=uid(t))},hiddenKeys$4={},NATIVE_WEAK_MAP=weakMapBasicDetection,global$8=global$h,isObject$6=isObject$b,createNonEnumerableProperty$4=createNonEnumerableProperty$5,hasOwn$5=hasOwnProperty_1,shared=sharedStore,sharedKey$1=sharedKey$2,hiddenKeys$3=hiddenKeys$4,OBJECT_ALREADY_INITIALIZED="Object already initialized",TypeError$1=global$8.TypeError,WeakMap$1=global$8.WeakMap,set$3,get$3,has,enforce=function(t){return has(t)?get$3(t):set$3(t,{})},getterFor=function(t){return function(e){var r;if(!isObject$6(e)||(r=get$3(e)).type!==t)throw new TypeError$1("Incompatible receiver, "+t+" required");return r}};if(NATIVE_WEAK_MAP||shared.state){var store=shared.state||(shared.state=new WeakMap$1);store.get=store.get,store.has=store.has,store.set=store.set,set$3=function(t,e){if(store.has(t))throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);return e.facade=t,store.set(t,e),e},get$3=function(t){return store.get(t)||{}},has=function(t){return store.has(t)}}else{var STATE=sharedKey$1("state");hiddenKeys$3[STATE]=!0,set$3=function(t,e){if(hasOwn$5(t,STATE))throw new TypeError$1(OBJECT_ALREADY_INITIALIZED);return e.facade=t,createNonEnumerableProperty$4(t,STATE,e),e},get$3=function(t){return hasOwn$5(t,STATE)?t[STATE]:{}},has=function(t){return hasOwn$5(t,STATE)}}var internalState={set:set$3,get:get$3,has,enforce,getterFor},uncurryThis$9=functionUncurryThis,fails$5=fails$c,isCallable$9=isCallable$h,hasOwn$4=hasOwnProperty_1,DESCRIPTORS$3=descriptors,CONFIGURABLE_FUNCTION_NAME=functionName.CONFIGURABLE,inspectSource=inspectSource$1,InternalStateModule=internalState,enforceInternalState=InternalStateModule.enforce,getInternalState=InternalStateModule.get,$String$3=String,defineProperty$4=Object.defineProperty,stringSlice=uncurryThis$9("".slice),replace$2=uncurryThis$9("".replace),join=uncurryThis$9([].join),CONFIGURABLE_LENGTH=DESCRIPTORS$3&&!fails$5(function(){return defineProperty$4(function(){},"length",{value:8}).length!==8}),TEMPLATE$1=String(String).split("String"),makeBuiltIn$1=makeBuiltIn$2.exports=function(t,e,r){stringSlice($String$3(e),0,7)==="Symbol("&&(e="["+replace$2($String$3(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),r&&r.getter&&(e="get "+e),r&&r.setter&&(e="set "+e),(!hasOwn$4(t,"name")||CONFIGURABLE_FUNCTION_NAME&&t.name!==e)&&(DESCRIPTORS$3?defineProperty$4(t,"name",{value:e,configurable:!0}):t.name=e),CONFIGURABLE_LENGTH&&r&&hasOwn$4(r,"arity")&&t.length!==r.arity&&defineProperty$4(t,"length",{value:r.arity});try{r&&hasOwn$4(r,"constructor")&&r.constructor?DESCRIPTORS$3&&defineProperty$4(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var n=enforceInternalState(t);return hasOwn$4(n,"source")||(n.source=join(TEMPLATE$1,typeof e=="string"?e:"")),t};Function.prototype.toString=makeBuiltIn$1(function(){return isCallable$9(this)&&getInternalState(this).source||inspectSource(this)},"toString");var makeBuiltInExports=makeBuiltIn$2.exports,isCallable$8=isCallable$h,definePropertyModule$3=objectDefineProperty,makeBuiltIn=makeBuiltInExports,defineGlobalProperty$1=defineGlobalProperty$3,defineBuiltIn$1=function(t,e,r,n){n||(n={});var i=n.enumerable,s=n.name!==void 0?n.name:e;if(isCallable$8(r)&&makeBuiltIn(r,s,n),n.global)i?t[e]=r:defineGlobalProperty$1(e,r);else{try{n.unsafe?t[e]&&(i=!0):delete t[e]}catch(a){}i?t[e]=r:definePropertyModule$3.f(t,e,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return t},objectGetOwnPropertyNames={},ceil=Math.ceil,floor=Math.floor,mathTrunc=Math.trunc||function(e){var r=+e;return(r>0?floor:ceil)(r)},trunc=mathTrunc,toIntegerOrInfinity$3=function(t){var e=+t;return e!==e||e===0?0:trunc(e)},toIntegerOrInfinity$2=toIntegerOrInfinity$3,max$1=Math.max,min$2=Math.min,toAbsoluteIndex$1=function(t,e){var r=toIntegerOrInfinity$2(t);return r<0?max$1(r+e,0):min$2(r,e)},toIntegerOrInfinity$1=toIntegerOrInfinity$3,min$1=Math.min,toLength$1=function(t){return t>0?min$1(toIntegerOrInfinity$1(t),9007199254740991):0},toLength=toLength$1,lengthOfArrayLike$5=function(t){return toLength(t.length)},toIndexedObject$2=toIndexedObject$4,toAbsoluteIndex=toAbsoluteIndex$1,lengthOfArrayLike$4=lengthOfArrayLike$5,createMethod=function(t){return function(e,r,n){var i=toIndexedObject$2(e),s=lengthOfArrayLike$4(i),a=toAbsoluteIndex(n,s),o;if(t&&r!==r){for(;s>a;)if(o=i[a++],o!==o)return!0}else for(;s>a;a++)if((t||a in i)&&i[a]===r)return t||a||0;return!t&&-1}},arrayIncludes={includes:createMethod(!0),indexOf:createMethod(!1)},uncurryThis$8=functionUncurryThis,hasOwn$3=hasOwnProperty_1,toIndexedObject$1=toIndexedObject$4,indexOf$1=arrayIncludes.indexOf,hiddenKeys$2=hiddenKeys$4,push$1=uncurryThis$8([].push),objectKeysInternal=function(t,e){var r=toIndexedObject$1(t),n=0,i=[],s;for(s in r)!hasOwn$3(hiddenKeys$2,s)&&hasOwn$3(r,s)&&push$1(i,s);for(;e.length>n;)hasOwn$3(r,s=e[n++])&&(~indexOf$1(i,s)||push$1(i,s));return i},enumBugKeys$3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],internalObjectKeys$1=objectKeysInternal,enumBugKeys$2=enumBugKeys$3,hiddenKeys$1=enumBugKeys$2.concat("length","prototype");objectGetOwnPropertyNames.f=Object.getOwnPropertyNames||function(e){return internalObjectKeys$1(e,hiddenKeys$1)};var objectGetOwnPropertySymbols={};objectGetOwnPropertySymbols.f=Object.getOwnPropertySymbols;var getBuiltIn$3=getBuiltIn$5,uncurryThis$7=functionUncurryThis,getOwnPropertyNamesModule=objectGetOwnPropertyNames,getOwnPropertySymbolsModule=objectGetOwnPropertySymbols,anObject$6=anObject$8,concat=uncurryThis$7([].concat),ownKeys$3=getBuiltIn$3("Reflect","ownKeys")||function(e){var r=getOwnPropertyNamesModule.f(anObject$6(e)),n=getOwnPropertySymbolsModule.f;return n?concat(r,n(e)):r},hasOwn$2=hasOwnProperty_1,ownKeys$2=ownKeys$3,getOwnPropertyDescriptorModule=objectGetOwnPropertyDescriptor,definePropertyModule$2=objectDefineProperty,copyConstructorProperties$2=function(t,e,r){for(var n=ownKeys$2(e),i=definePropertyModule$2.f,s=getOwnPropertyDescriptorModule.f,a=0;a<n.length;a++){var o=n[a];!hasOwn$2(t,o)&&!(r&&hasOwn$2(r,o))&&i(t,o,s(e,o))}},fails$4=fails$c,isCallable$7=isCallable$h,replacement=/#|\.prototype\./,isForced$1=function(t,e){var r=data[normalize(t)];return r===POLYFILL?!0:r===NATIVE?!1:isCallable$7(e)?fails$4(e):!!e},normalize=isForced$1.normalize=function(t){return String(t).replace(replacement,".").toLowerCase()},data=isForced$1.data={},NATIVE=isForced$1.NATIVE="N",POLYFILL=isForced$1.POLYFILL="P",isForced_1=isForced$1,global$7=global$h,getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,createNonEnumerableProperty$3=createNonEnumerableProperty$5,defineBuiltIn=defineBuiltIn$1,defineGlobalProperty=defineGlobalProperty$3,copyConstructorProperties$1=copyConstructorProperties$2,isForced=isForced_1,_export=function(t,e){var r=t.target,n=t.global,i=t.stat,s,a,o,l,c,u;if(n?a=global$7:i?a=global$7[r]||defineGlobalProperty(r,{}):a=(global$7[r]||{}).prototype,a)for(o in e){if(c=e[o],t.dontCallGetSet?(u=getOwnPropertyDescriptor$2(a,o),l=u&&u.value):l=a[o],s=isForced(n?o:r+(i?".":"#")+o,t.forced),!s&&l!==void 0){if(typeof c==typeof l)continue;copyConstructorProperties$1(c,l)}(t.sham||l&&l.sham)&&createNonEnumerableProperty$3(c,"sham",!0),defineBuiltIn(a,o,c,t)}},classof$5=classofRaw$2,isArray$6=Array.isArray||function(e){return classof$5(e)==="Array"},DESCRIPTORS$2=descriptors,isArray$5=isArray$6,$TypeError$6=TypeError,getOwnPropertyDescriptor$1=Object.getOwnPropertyDescriptor,SILENT_ON_NON_WRITABLE_LENGTH_SET=DESCRIPTORS$2&&!function(){if(this!==void 0)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}(),arraySetLength=SILENT_ON_NON_WRITABLE_LENGTH_SET?function(t,e){if(isArray$5(t)&&!getOwnPropertyDescriptor$1(t,"length").writable)throw new $TypeError$6("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},$TypeError$5=TypeError,MAX_SAFE_INTEGER$2=9007199254740991,doesNotExceedSafeInteger$2=function(t){if(t>MAX_SAFE_INTEGER$2)throw $TypeError$5("Maximum allowed index exceeded");return t},$$7=_export,toObject$3=toObject$5,lengthOfArrayLike$3=lengthOfArrayLike$5,setArrayLength$1=arraySetLength,doesNotExceedSafeInteger$1=doesNotExceedSafeInteger$2,fails$3=fails$c,INCORRECT_TO_LENGTH=fails$3(function(){return[].push.call({length:4294967296},1)!==4294967297}),properErrorOnNonWritableLength$1=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},FORCED$2=INCORRECT_TO_LENGTH||!properErrorOnNonWritableLength$1();$$7({target:"Array",proto:!0,arity:1,forced:FORCED$2},{push:function(e){var r=toObject$3(this),n=lengthOfArrayLike$3(r),i=arguments.length;doesNotExceedSafeInteger$1(n+i);for(var s=0;s<i;s++)r[n]=arguments[s],n++;return setArrayLength$1(r,n),n}});var NATIVE_BIND$1=functionBindNative,FunctionPrototype=Function.prototype,apply$6=FunctionPrototype.apply,call$4=FunctionPrototype.call,functionApply=typeof Reflect=="object"&&Reflect.apply||(NATIVE_BIND$1?call$4.bind(apply$6):function(){return call$4.apply(apply$6,arguments)}),uncurryThis$6=functionUncurryThis,aCallable$2=aCallable$4,functionUncurryThisAccessor=function(t,e,r){try{return uncurryThis$6(aCallable$2(Object.getOwnPropertyDescriptor(t,e)[r]))}catch(n){}},isCallable$6=isCallable$h,$String$2=String,$TypeError$4=TypeError,aPossiblePrototype$1=function(t){if(typeof t=="object"||isCallable$6(t))return t;throw new $TypeError$4("Can't set "+$String$2(t)+" as a prototype")},uncurryThisAccessor=functionUncurryThisAccessor,anObject$5=anObject$8,aPossiblePrototype=aPossiblePrototype$1,objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,e={},r;try{r=uncurryThisAccessor(Object.prototype,"__proto__","set"),r(e,[]),t=e instanceof Array}catch(n){}return function(i,s){return anObject$5(i),aPossiblePrototype(s),t?r(i,s):i.__proto__=s,i}}():void 0),defineProperty$3=objectDefineProperty.f,proxyAccessor$1=function(t,e,r){r in t||defineProperty$3(t,r,{configurable:!0,get:function(){return e[r]},set:function(n){e[r]=n}})},isCallable$5=isCallable$h,isObject$5=isObject$b,setPrototypeOf$2=objectSetPrototypeOf,inheritIfRequired$1=function(t,e,r){var n,i;return setPrototypeOf$2&&isCallable$5(n=e.constructor)&&n!==r&&isObject$5(i=n.prototype)&&i!==r.prototype&&setPrototypeOf$2(t,i),t},wellKnownSymbol$4=wellKnownSymbol$6,TO_STRING_TAG$1=wellKnownSymbol$4("toStringTag"),test={};test[TO_STRING_TAG$1]="z";var toStringTagSupport=String(test)==="[object z]",TO_STRING_TAG_SUPPORT=toStringTagSupport,isCallable$4=isCallable$h,classofRaw$1=classofRaw$2,wellKnownSymbol$3=wellKnownSymbol$6,TO_STRING_TAG=wellKnownSymbol$3("toStringTag"),$Object=Object,CORRECT_ARGUMENTS=classofRaw$1(function(){return arguments}())==="Arguments",tryGet=function(t,e){try{return t[e]}catch(r){}},classof$4=TO_STRING_TAG_SUPPORT?classofRaw$1:function(t){var e,r,n;return t===void 0?"Undefined":t===null?"Null":typeof(r=tryGet(e=$Object(t),TO_STRING_TAG))=="string"?r:CORRECT_ARGUMENTS?classofRaw$1(e):(n=classofRaw$1(e))==="Object"&&isCallable$4(e.callee)?"Arguments":n},classof$3=classof$4,$String$1=String,toString$3=function(t){if(classof$3(t)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return $String$1(t)},toString$2=toString$3,normalizeStringArgument$1=function(t,e){return t===void 0?arguments.length<2?"":e:toString$2(t)},isObject$4=isObject$b,createNonEnumerableProperty$2=createNonEnumerableProperty$5,installErrorCause$1=function(t,e){isObject$4(e)&&"cause"in e&&createNonEnumerableProperty$2(t,"cause",e.cause)},uncurryThis$5=functionUncurryThis,$Error=Error,replace$1=uncurryThis$5("".replace),TEST=function(t){return String(new $Error(t).stack)}("zxcasd"),V8_OR_CHAKRA_STACK_ENTRY=/\n\s*at [^:]*:[^\n]*/,IS_V8_OR_CHAKRA_STACK=V8_OR_CHAKRA_STACK_ENTRY.test(TEST),errorStackClear=function(t,e){if(IS_V8_OR_CHAKRA_STACK&&typeof t=="string"&&!$Error.prepareStackTrace)for(;e--;)t=replace$1(t,V8_OR_CHAKRA_STACK_ENTRY,"");return t},fails$2=fails$c,createPropertyDescriptor$1=createPropertyDescriptor$4,errorStackInstallable=!fails$2(function(){var t=new Error("a");return"stack"in t?(Object.defineProperty(t,"stack",createPropertyDescriptor$1(1,7)),t.stack!==7):!0}),createNonEnumerableProperty$1=createNonEnumerableProperty$5,clearErrorStack=errorStackClear,ERROR_STACK_INSTALLABLE=errorStackInstallable,captureStackTrace=Error.captureStackTrace,errorStackInstall=function(t,e,r,n){ERROR_STACK_INSTALLABLE&&(captureStackTrace?captureStackTrace(t,e):createNonEnumerableProperty$1(t,"stack",clearErrorStack(r,n)))},getBuiltIn$2=getBuiltIn$5,hasOwn$1=hasOwnProperty_1,createNonEnumerableProperty=createNonEnumerableProperty$5,isPrototypeOf$1=objectIsPrototypeOf,setPrototypeOf$1=objectSetPrototypeOf,copyConstructorProperties=copyConstructorProperties$2,proxyAccessor=proxyAccessor$1,inheritIfRequired=inheritIfRequired$1,normalizeStringArgument=normalizeStringArgument$1,installErrorCause=installErrorCause$1,installErrorStack=errorStackInstall,DESCRIPTORS$1=descriptors,wrapErrorConstructorWithCause$1=function(t,e,r,n){var i="stackTraceLimit",s=n?2:1,a=t.split("."),o=a[a.length-1],l=getBuiltIn$2.apply(null,a);if(l){var c=l.prototype;if(hasOwn$1(c,"cause")&&delete c.cause,!r)return l;var u=getBuiltIn$2("Error"),d=e(function(h,f){var g=normalizeStringArgument(n?f:h,void 0),p=n?new l(h):new l;return g!==void 0&&createNonEnumerableProperty(p,"message",g),installErrorStack(p,d,p.stack,2),this&&isPrototypeOf$1(c,this)&&inheritIfRequired(p,this,d),arguments.length>s&&installErrorCause(p,arguments[s]),p});d.prototype=c,o!=="Error"?setPrototypeOf$1?setPrototypeOf$1(d,u):copyConstructorProperties(d,u,{name:!0}):DESCRIPTORS$1&&i in l&&(proxyAccessor(d,l,i),proxyAccessor(d,l,"prepareStackTrace")),copyConstructorProperties(d,l);try{c.name!==o&&createNonEnumerableProperty(c,"name",o),c.constructor=d}catch(h){}return d}},$$6=_export,global$6=global$h,apply$5=functionApply,wrapErrorConstructorWithCause=wrapErrorConstructorWithCause$1,WEB_ASSEMBLY="WebAssembly",WebAssembly=global$6[WEB_ASSEMBLY],FORCED$1=new Error("e",{cause:7}).cause!==7,exportGlobalErrorCauseWrapper=function(t,e){var r={};r[t]=wrapErrorConstructorWithCause(t,e,FORCED$1),$$6({global:!0,constructor:!0,arity:1,forced:FORCED$1},r)},exportWebAssemblyErrorCauseWrapper=function(t,e){if(WebAssembly&&WebAssembly[t]){var r={};r[t]=wrapErrorConstructorWithCause(WEB_ASSEMBLY+"."+t,e,FORCED$1),$$6({target:WEB_ASSEMBLY,stat:!0,constructor:!0,arity:1,forced:FORCED$1},r)}};exportGlobalErrorCauseWrapper("Error",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("EvalError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("RangeError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("ReferenceError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("SyntaxError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("TypeError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportGlobalErrorCauseWrapper("URIError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("CompileError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("LinkError",function(t){return function(r){return apply$5(t,this,arguments)}}),exportWebAssemblyErrorCauseWrapper("RuntimeError",function(t){return function(r){return apply$5(t,this,arguments)}});var classofRaw=classofRaw$2,uncurryThis$4=functionUncurryThis,functionUncurryThisClause=function(t){if(classofRaw(t)==="Function")return uncurryThis$4(t)},uncurryThis$3=functionUncurryThisClause,aCallable$1=aCallable$4,NATIVE_BIND=functionBindNative,bind$2=uncurryThis$3(uncurryThis$3.bind),functionBindContext=function(t,e){return aCallable$1(t),e===void 0?t:NATIVE_BIND?bind$2(t,e):function(){return t.apply(e,arguments)}},getBuiltIn$1=getBuiltIn$5,html$4=getBuiltIn$1("document","documentElement"),uncurryThis$2=functionUncurryThis,arraySlice$3=uncurryThis$2([].slice),$TypeError$3=TypeError,validateArgumentsLength$2=function(t,e){if(t<e)throw new $TypeError$3("Not enough arguments");return t},userAgent=engineUserAgent,engineIsIos=/(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent),global$5=global$h,classof$2=classofRaw$2,engineIsNode=classof$2(global$5.process)==="process",global$4=global$h,apply$4=functionApply,bind$1=functionBindContext,isCallable$3=isCallable$h,hasOwn=hasOwnProperty_1,fails$1=fails$c,html$3=html$4,arraySlice$2=arraySlice$3,createElement=documentCreateElement$1,validateArgumentsLength$1=validateArgumentsLength$2,IS_IOS=engineIsIos,IS_NODE=engineIsNode,set$2=global$4.setImmediate,clear=global$4.clearImmediate,process$2=global$4.process,Dispatch=global$4.Dispatch,Function$2=global$4.Function,MessageChannel$1=global$4.MessageChannel,String$1=global$4.String,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",$location,defer,channel,port;fails$1(function(){$location=global$4.location});var run=function(t){if(hasOwn(queue,t)){var e=queue[t];delete queue[t],e()}},runner=function(t){return function(){run(t)}},eventListener=function(t){run(t.data)},globalPostMessageDefer=function(t){global$4.postMessage(String$1(t),$location.protocol+"//"+$location.host)};(!set$2||!clear)&&(set$2=function(e){validateArgumentsLength$1(arguments.length,1);var r=isCallable$3(e)?e:Function$2(e),n=arraySlice$2(arguments,1);return queue[++counter]=function(){apply$4(r,void 0,n)},defer(counter),counter},clear=function(e){delete queue[e]},IS_NODE?defer=function(t){process$2.nextTick(runner(t))}:Dispatch&&Dispatch.now?defer=function(t){Dispatch.now(runner(t))}:MessageChannel$1&&!IS_IOS?(channel=new MessageChannel$1,port=channel.port2,channel.port1.onmessage=eventListener,defer=bind$1(port.postMessage,port)):global$4.addEventListener&&isCallable$3(global$4.postMessage)&&!global$4.importScripts&&$location&&$location.protocol!=="file:"&&!fails$1(globalPostMessageDefer)?(defer=globalPostMessageDefer,global$4.addEventListener("message",eventListener,!1)):ONREADYSTATECHANGE in createElement("script")?defer=function(t){html$3.appendChild(createElement("script"))[ONREADYSTATECHANGE]=function(){html$3.removeChild(this),run(t)}}:defer=function(t){setTimeout(runner(t),0)});var task={set:set$2,clear},$$5=_export,global$3=global$h,clearImmediate$1=task.clear;$$5({global:!0,bind:!0,enumerable:!0,forced:global$3.clearImmediate!==clearImmediate$1},{clearImmediate:clearImmediate$1});var engineIsBun=typeof Bun=="function"&&Bun&&typeof Bun.version=="string",global$2=global$h,apply$3=functionApply,isCallable$2=isCallable$h,ENGINE_IS_BUN=engineIsBun,USER_AGENT=engineUserAgent,arraySlice$1=arraySlice$3,validateArgumentsLength=validateArgumentsLength$2,Function$1=global$2.Function,WRAP=/MSIE .\./.test(USER_AGENT)||ENGINE_IS_BUN&&function(){var t=global$2.Bun.version.split(".");return t.length<3||t[0]==="0"&&(t[1]<3||t[1]==="3"&&t[2]==="0")}(),schedulersFix$1=function(t,e){var r=e?2:1;return WRAP?function(n,i){var s=validateArgumentsLength(arguments.length,1)>r,a=isCallable$2(n)?n:Function$1(n),o=s?arraySlice$1(arguments,r):[],l=s?function(){apply$3(a,this,o)}:a;return e?t(l,i):t(l)}:t},$$4=_export,global$1=global$h,setTask=task.set,schedulersFix=schedulersFix$1,setImmediate$1=global$1.setImmediate?schedulersFix(setTask,!1):setTask;$$4({global:!0,bind:!0,enumerable:!0,forced:global$1.setImmediate!==setImmediate$1},{setImmediate:setImmediate$1});/*! @license DOMPurify 2.4.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.4.7/LICENSE */function _typeof$3(t){"@babel/helpers - typeof";return _typeof$3=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},_typeof$3(t)}function _setPrototypeOf$1(t,e){return _setPrototypeOf$1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},_setPrototypeOf$1(t,e)}function _isNativeReflectConstruct$1(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}function _construct(t,e,r){return _isNativeReflectConstruct$1()?_construct=Reflect.construct:_construct=function(i,s,a){var o=[null];o.push.apply(o,s);var l=Function.bind.apply(i,o),c=new l;return a&&_setPrototypeOf$1(c,a.prototype),c},_construct.apply(null,arguments)}function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_unsupportedIterableToArray(t)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _iterableToArray$1(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _unsupportedIterableToArray(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _arrayLikeToArray(t,e)}}function _arrayLikeToArray(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
81
81
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var hasOwnProperty$9=Object.hasOwnProperty,setPrototypeOf=Object.setPrototypeOf,isFrozen=Object.isFrozen,getPrototypeOf=Object.getPrototypeOf,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,freeze=Object.freeze,seal=Object.seal,create$1=Object.create,_ref=typeof Reflect!="undefined"&&Reflect,apply$2=_ref.apply,construct=_ref.construct;apply$2||(apply$2=function(e,r,n){return e.apply(r,n)}),freeze||(freeze=function(e){return e}),seal||(seal=function(e){return e}),construct||(construct=function(e,r){return _construct(e,_toConsumableArray$1(r))});var arrayForEach=unapply(Array.prototype.forEach),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(t){return function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return apply$2(t,e,n)}}function unconstruct(t){return function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return construct(t,r)}}function addToSet(t,e,r){var n;r=(n=r)!==null&&n!==void 0?n:stringToLowerCase,setPrototypeOf&&setPrototypeOf(t,null);for(var i=e.length;i--;){var s=e[i];if(typeof s=="string"){var a=r(s);a!==s&&(isFrozen(e)||(e[i]=a),s=a)}t[s]=!0}return t}function clone$2(t){var e=create$1(null),r;for(r in t)apply$2(hasOwnProperty$9,t,[r])===!0&&(e[r]=t[r]);return e}function lookupGetter(t,e){for(;t!==null;){var r=getOwnPropertyDescriptor(t,e);if(r){if(r.get)return unapply(r.get);if(typeof r.value=="function")return unapply(r.value)}t=getPrototypeOf(t)}function n(i){return console.warn("fallback value for",i),null}return n}var html$1$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text=freeze(["#text"]),html$2=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\${[\w\W]*}/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),getGlobal=function(){return typeof window=="undefined"?null:window},_createTrustedTypesPolicy=function(e,r){if(_typeof$3(e)!=="object"||typeof e.createPolicy!="function")return null;var n=null,i="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(i)&&(n=r.currentScript.getAttribute(i));var s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:function(o){return o},createScriptURL:function(o){return o}})}catch(a){return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function createDOMPurify(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal(),e=function(He){return createDOMPurify(He)};if(e.version="2.4.7",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;var r=t.document,n=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,a=t.Node,o=t.Element,l=t.NodeFilter,c=t.NamedNodeMap,u=c===void 0?t.NamedNodeMap||t.MozNamedAttrMap:c,d=t.HTMLFormElement,h=t.DOMParser,f=t.trustedTypes,g=o.prototype,p=lookupGetter(g,"cloneNode"),m=lookupGetter(g,"nextSibling"),v=lookupGetter(g,"childNodes"),_=lookupGetter(g,"parentNode");if(typeof s=="function"){var b=n.createElement("template");b.content&&b.content.ownerDocument&&(n=b.content.ownerDocument)}var C=_createTrustedTypesPolicy(f,r),S=C?C.createHTML(""):"",w=n,A=w.implementation,O=w.createNodeIterator,T=w.createDocumentFragment,H=w.getElementsByTagName,k=r.importNode,G={};try{G=clone$2(n).documentMode?n.documentMode:{}}catch(lt){}var X={};e.isSupported=typeof _=="function"&&A&&A.createHTMLDocument!==void 0&&G!==9;var I=MUSTACHE_EXPR,ce=ERB_EXPR,be=TMPLIT_EXPR,ae=DATA_ATTR,se=ARIA_ATTR,P=IS_SCRIPT_OR_DATA,B=ATTR_WHITESPACE,V=IS_ALLOWED_URI,ie=null,F=addToSet({},[].concat(_toConsumableArray$1(html$1$1),_toConsumableArray$1(svg$1),_toConsumableArray$1(svgFilters),_toConsumableArray$1(mathMl$1),_toConsumableArray$1(text))),M=null,U=addToSet({},[].concat(_toConsumableArray$1(html$2),_toConsumableArray$1(svg),_toConsumableArray$1(mathMl),_toConsumableArray$1(xml))),L=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Y=null,K=null,j=!0,J=!0,ye=!1,ve=!0,Se=!1,N=!1,de=!1,Ae=!1,oe=!1,ue=!1,Pe=!1,q=!0,le=!1,z="user-content-",te=!0,ne=!1,ee={},_e=null,Re=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Me=null,De=addToSet({},["audio","video","img","source","image","track"]),Ue=null,Qe=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),rt="http://www.w3.org/1998/Math/MathML",et="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xhtml",ct=ht,fe=!1,ge=null,we=addToSet({},[rt,et,ht],stringToString),Ne,Ke=["application/xhtml+xml","text/html"],xe="text/html",he,Ie=null,ze=n.createElement("form"),Ve=function(He){return He instanceof RegExp||He instanceof Function},Ze=function(He){Ie&&Ie===He||((!He||_typeof$3(He)!=="object")&&(He={}),He=clone$2(He),Ne=Ke.indexOf(He.PARSER_MEDIA_TYPE)===-1?Ne=xe:Ne=He.PARSER_MEDIA_TYPE,he=Ne==="application/xhtml+xml"?stringToString:stringToLowerCase,ie="ALLOWED_TAGS"in He?addToSet({},He.ALLOWED_TAGS,he):F,M="ALLOWED_ATTR"in He?addToSet({},He.ALLOWED_ATTR,he):U,ge="ALLOWED_NAMESPACES"in He?addToSet({},He.ALLOWED_NAMESPACES,stringToString):we,Ue="ADD_URI_SAFE_ATTR"in He?addToSet(clone$2(Qe),He.ADD_URI_SAFE_ATTR,he):Qe,Me="ADD_DATA_URI_TAGS"in He?addToSet(clone$2(De),He.ADD_DATA_URI_TAGS,he):De,_e="FORBID_CONTENTS"in He?addToSet({},He.FORBID_CONTENTS,he):Re,Y="FORBID_TAGS"in He?addToSet({},He.FORBID_TAGS,he):{},K="FORBID_ATTR"in He?addToSet({},He.FORBID_ATTR,he):{},ee="USE_PROFILES"in He?He.USE_PROFILES:!1,j=He.ALLOW_ARIA_ATTR!==!1,J=He.ALLOW_DATA_ATTR!==!1,ye=He.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=He.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Se=He.SAFE_FOR_TEMPLATES||!1,N=He.WHOLE_DOCUMENT||!1,oe=He.RETURN_DOM||!1,ue=He.RETURN_DOM_FRAGMENT||!1,Pe=He.RETURN_TRUSTED_TYPE||!1,Ae=He.FORCE_BODY||!1,q=He.SANITIZE_DOM!==!1,le=He.SANITIZE_NAMED_PROPS||!1,te=He.KEEP_CONTENT!==!1,ne=He.IN_PLACE||!1,V=He.ALLOWED_URI_REGEXP||V,ct=He.NAMESPACE||ht,L=He.CUSTOM_ELEMENT_HANDLING||{},He.CUSTOM_ELEMENT_HANDLING&&Ve(He.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(L.tagNameCheck=He.CUSTOM_ELEMENT_HANDLING.tagNameCheck),He.CUSTOM_ELEMENT_HANDLING&&Ve(He.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(L.attributeNameCheck=He.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),He.CUSTOM_ELEMENT_HANDLING&&typeof He.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(L.allowCustomizedBuiltInElements=He.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Se&&(J=!1),ue&&(oe=!0),ee&&(ie=addToSet({},_toConsumableArray$1(text)),M=[],ee.html===!0&&(addToSet(ie,html$1$1),addToSet(M,html$2)),ee.svg===!0&&(addToSet(ie,svg$1),addToSet(M,svg),addToSet(M,xml)),ee.svgFilters===!0&&(addToSet(ie,svgFilters),addToSet(M,svg),addToSet(M,xml)),ee.mathMl===!0&&(addToSet(ie,mathMl$1),addToSet(M,mathMl),addToSet(M,xml))),He.ADD_TAGS&&(ie===F&&(ie=clone$2(ie)),addToSet(ie,He.ADD_TAGS,he)),He.ADD_ATTR&&(M===U&&(M=clone$2(M)),addToSet(M,He.ADD_ATTR,he)),He.ADD_URI_SAFE_ATTR&&addToSet(Ue,He.ADD_URI_SAFE_ATTR,he),He.FORBID_CONTENTS&&(_e===Re&&(_e=clone$2(_e)),addToSet(_e,He.FORBID_CONTENTS,he)),te&&(ie["#text"]=!0),N&&addToSet(ie,["html","head","body"]),ie.table&&(addToSet(ie,["tbody"]),delete Y.tbody),freeze&&freeze(He),Ie=He)},Xe=addToSet({},["mi","mo","mn","ms","mtext"]),ft=addToSet({},["foreignobject","desc","title","annotation-xml"]),tt=addToSet({},["title","style","font","a","script"]),pt=addToSet({},svg$1);addToSet(pt,svgFilters),addToSet(pt,svgDisallowed);var gt=addToSet({},mathMl$1);addToSet(gt,mathMlDisallowed);var Oe=function(He){var nt=_(He);(!nt||!nt.tagName)&&(nt={namespaceURI:ct,tagName:"template"});var yt=stringToLowerCase(He.tagName),It=stringToLowerCase(nt.tagName);return ge[He.namespaceURI]?He.namespaceURI===et?nt.namespaceURI===ht?yt==="svg":nt.namespaceURI===rt?yt==="svg"&&(It==="annotation-xml"||Xe[It]):!!pt[yt]:He.namespaceURI===rt?nt.namespaceURI===ht?yt==="math":nt.namespaceURI===et?yt==="math"&&ft[It]:!!gt[yt]:He.namespaceURI===ht?nt.namespaceURI===et&&!ft[It]||nt.namespaceURI===rt&&!Xe[It]?!1:!gt[yt]&&(tt[yt]||!pt[yt]):!!(Ne==="application/xhtml+xml"&&ge[He.namespaceURI]):!1},Z=function(He){arrayPush(e.removed,{element:He});try{He.parentNode.removeChild(He)}catch(nt){try{He.outerHTML=S}catch(yt){He.remove()}}},Ee=function(He,nt){try{arrayPush(e.removed,{attribute:nt.getAttributeNode(He),from:nt})}catch(yt){arrayPush(e.removed,{attribute:null,from:nt})}if(nt.removeAttribute(He),He==="is"&&!M[He])if(oe||ue)try{Z(nt)}catch(yt){}else try{nt.setAttribute(He,"")}catch(yt){}},ke=function(He){var nt,yt;if(Ae)He="<remove></remove>"+He;else{var It=stringMatch(He,/^[\r\n\t ]+/);yt=It&&It[0]}Ne==="application/xhtml+xml"&&ct===ht&&(He='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+He+"</body></html>");var Dt=C?C.createHTML(He):He;if(ct===ht)try{nt=new h().parseFromString(Dt,Ne)}catch(Xt){}if(!nt||!nt.documentElement){nt=A.createDocument(ct,"template",null);try{nt.documentElement.innerHTML=fe?S:Dt}catch(Xt){}}var zt=nt.body||nt.documentElement;return He&&yt&&zt.insertBefore(n.createTextNode(yt),zt.childNodes[0]||null),ct===ht?H.call(nt,N?"html":"body")[0]:N?nt.documentElement:zt},Be=function(He){return O.call(He.ownerDocument||He,He,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,null,!1)},Ye=function(He){return He instanceof d&&(typeof He.nodeName!="string"||typeof He.textContent!="string"||typeof He.removeChild!="function"||!(He.attributes instanceof u)||typeof He.removeAttribute!="function"||typeof He.setAttribute!="function"||typeof He.namespaceURI!="string"||typeof He.insertBefore!="function"||typeof He.hasChildNodes!="function")},Je=function(He){return _typeof$3(a)==="object"?He instanceof a:He&&_typeof$3(He)==="object"&&typeof He.nodeType=="number"&&typeof He.nodeName=="string"},at=function(He,nt,yt){X[He]&&arrayForEach(X[He],function(It){It.call(e,nt,yt,Ie)})},_t=function(He){var nt;if(at("beforeSanitizeElements",He,null),Ye(He)||regExpTest(/[\u0080-\uFFFF]/,He.nodeName))return Z(He),!0;var yt=he(He.nodeName);if(at("uponSanitizeElement",He,{tagName:yt,allowedTags:ie}),He.hasChildNodes()&&!Je(He.firstElementChild)&&(!Je(He.content)||!Je(He.content.firstElementChild))&®ExpTest(/<[/\w]/g,He.innerHTML)&®ExpTest(/<[/\w]/g,He.textContent)||yt==="select"&®ExpTest(/<template/i,He.innerHTML))return Z(He),!0;if(!ie[yt]||Y[yt]){if(!Y[yt]&&Rt(yt)&&(L.tagNameCheck instanceof RegExp&®ExpTest(L.tagNameCheck,yt)||L.tagNameCheck instanceof Function&&L.tagNameCheck(yt)))return!1;if(te&&!_e[yt]){var It=_(He)||He.parentNode,Dt=v(He)||He.childNodes;if(Dt&&It)for(var zt=Dt.length,Xt=zt-1;Xt>=0;--Xt)It.insertBefore(p(Dt[Xt],!0),m(He))}return Z(He),!0}return He instanceof o&&!Oe(He)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&®ExpTest(/<\/no(script|embed|frames)/i,He.innerHTML)?(Z(He),!0):(Se&&He.nodeType===3&&(nt=He.textContent,nt=stringReplace(nt,I," "),nt=stringReplace(nt,ce," "),nt=stringReplace(nt,be," "),He.textContent!==nt&&(arrayPush(e.removed,{element:He.cloneNode()}),He.textContent=nt)),at("afterSanitizeElements",He,null),!1)},dt=function(He,nt,yt){if(q&&(nt==="id"||nt==="name")&&(yt in n||yt in ze))return!1;if(!(J&&!K[nt]&®ExpTest(ae,nt))){if(!(j&®ExpTest(se,nt))){if(!M[nt]||K[nt]){if(!(Rt(He)&&(L.tagNameCheck instanceof RegExp&®ExpTest(L.tagNameCheck,He)||L.tagNameCheck instanceof Function&&L.tagNameCheck(He))&&(L.attributeNameCheck instanceof RegExp&®ExpTest(L.attributeNameCheck,nt)||L.attributeNameCheck instanceof Function&&L.attributeNameCheck(nt))||nt==="is"&&L.allowCustomizedBuiltInElements&&(L.tagNameCheck instanceof RegExp&®ExpTest(L.tagNameCheck,yt)||L.tagNameCheck instanceof Function&&L.tagNameCheck(yt))))return!1}else if(!Ue[nt]){if(!regExpTest(V,stringReplace(yt,B,""))){if(!((nt==="src"||nt==="xlink:href"||nt==="href")&&He!=="script"&&stringIndexOf(yt,"data:")===0&&Me[He])){if(!(ye&&!regExpTest(P,stringReplace(yt,B,"")))){if(yt)return!1}}}}}}return!0},Rt=function(He){return He.indexOf("-")>0},bt=function(He){var nt,yt,It,Dt;at("beforeSanitizeAttributes",He,null);var zt=He.attributes;if(zt){var Xt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M};for(Dt=zt.length;Dt--;){nt=zt[Dt];var rr=nt,Zt=rr.name,Wr=rr.namespaceURI;if(yt=Zt==="value"?nt.value:stringTrim(nt.value),It=he(Zt),Xt.attrName=It,Xt.attrValue=yt,Xt.keepAttr=!0,Xt.forceKeepAttr=void 0,at("uponSanitizeAttribute",He,Xt),yt=Xt.attrValue,!Xt.forceKeepAttr&&(Ee(Zt,He),!!Xt.keepAttr)){if(!ve&®ExpTest(/\/>/i,yt)){Ee(Zt,He);continue}Se&&(yt=stringReplace(yt,I," "),yt=stringReplace(yt,ce," "),yt=stringReplace(yt,be," "));var Or=he(He.nodeName);if(dt(Or,It,yt)){if(le&&(It==="id"||It==="name")&&(Ee(Zt,He),yt=z+yt),C&&_typeof$3(f)==="object"&&typeof f.getAttributeType=="function"&&!Wr)switch(f.getAttributeType(Or,It)){case"TrustedHTML":{yt=C.createHTML(yt);break}case"TrustedScriptURL":{yt=C.createScriptURL(yt);break}}try{Wr?He.setAttributeNS(Wr,Zt,yt):He.setAttribute(Zt,yt),arrayPop(e.removed)}catch(os){}}}}at("afterSanitizeAttributes",He,null)}},wt=function lt(He){var nt,yt=Be(He);for(at("beforeSanitizeShadowDOM",He,null);nt=yt.nextNode();)at("uponSanitizeShadowNode",nt,null),!_t(nt)&&(nt.content instanceof i&<(nt.content),bt(nt));at("afterSanitizeShadowDOM",He,null)};return e.sanitize=function(lt){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},nt,yt,It,Dt,zt;if(fe=!lt,fe&&(lt="<!-->"),typeof lt!="string"&&!Je(lt))if(typeof lt.toString=="function"){if(lt=lt.toString(),typeof lt!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!e.isSupported){if(_typeof$3(t.toStaticHTML)==="object"||typeof t.toStaticHTML=="function"){if(typeof lt=="string")return t.toStaticHTML(lt);if(Je(lt))return t.toStaticHTML(lt.outerHTML)}return lt}if(de||Ze(He),e.removed=[],typeof lt=="string"&&(ne=!1),ne){if(lt.nodeName){var Xt=he(lt.nodeName);if(!ie[Xt]||Y[Xt])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(lt instanceof a)nt=ke("<!---->"),yt=nt.ownerDocument.importNode(lt,!0),yt.nodeType===1&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?nt=yt:nt.appendChild(yt);else{if(!oe&&!Se&&!N&<.indexOf("<")===-1)return C&&Pe?C.createHTML(lt):lt;if(nt=ke(lt),!nt)return oe?null:Pe?S:""}nt&&Ae&&Z(nt.firstChild);for(var rr=Be(ne?lt:nt);It=rr.nextNode();)It.nodeType===3&&It===Dt||_t(It)||(It.content instanceof i&&wt(It.content),bt(It),Dt=It);if(Dt=null,ne)return lt;if(oe){if(ue)for(zt=T.call(nt.ownerDocument);nt.firstChild;)zt.appendChild(nt.firstChild);else zt=nt;return(M.shadowroot||M.shadowrootmod)&&(zt=k.call(r,zt,!0)),zt}var Zt=N?nt.outerHTML:nt.innerHTML;return N&&ie["!doctype"]&&nt.ownerDocument&&nt.ownerDocument.doctype&&nt.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,nt.ownerDocument.doctype.name)&&(Zt="<!DOCTYPE "+nt.ownerDocument.doctype.name+`>
|
|
82
82
|
`+Zt),Se&&(Zt=stringReplace(Zt,I," "),Zt=stringReplace(Zt,ce," "),Zt=stringReplace(Zt,be," ")),C&&Pe?C.createHTML(Zt):Zt},e.setConfig=function(lt){Ze(lt),de=!0},e.clearConfig=function(){Ie=null,de=!1},e.isValidAttribute=function(lt,He,nt){Ie||Ze({});var yt=he(lt),It=he(He);return dt(yt,It,nt)},e.addHook=function(lt,He){typeof He=="function"&&(X[lt]=X[lt]||[],arrayPush(X[lt],He))},e.removeHook=function(lt){if(X[lt])return arrayPop(X[lt])},e.removeHooks=function(lt){X[lt]&&(X[lt]=[])},e.removeAllHooks=function(){X={}},e}var purify=createDOMPurify();//! moment.js
|
|
83
83
|
//! version : 2.29.4
|