Files
Electron_Test/front/assets/index.bb5f1b0a.js
2024-04-07 09:46:14 +08:00

62 lines
590 KiB
JavaScript

const Jn=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return oe},get Circle(){return uC},get Ellipse(){return fC},get Image(){return pC},get Line(){return dC},get Marker(){return xC},get Path(){return zs},get Polygon(){return EC},get Polyline(){return kC},get Rect(){return OC},get Text(){return RC}},Symbol.toStringTag,{value:"Module"})),ta=Object.freeze(Object.defineProperty({__proto__:null,get Base(){return Jt},get Circle(){return $C},get Dom(){return jC},get Ellipse(){return qC},get Image(){return QC},get Line(){return JC},get Marker(){return e1},get Path(){return i1},get Polygon(){return a1},get Polyline(){return s1},get Rect(){return u1},get Text(){return g1}},Symbol.toStringTag,{value:"Module"}));var fo=function(i,r){return fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},fo(i,r)};function E(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");fo(i,r);function t(){this.constructor=i}i.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var w=function(){return w=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},w.apply(this,arguments)};function mt(i,r){var t={};for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&r.indexOf(e)<0&&(t[e]=i[e]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,e=Object.getOwnPropertySymbols(i);n<e.length;n++)r.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(i,e[n])&&(t[e[n]]=i[e[n]]);return t}function xi(i,r,t,e){function n(a){return a instanceof t?a:new t(function(o){o(a)})}return new(t||(t=Promise))(function(a,o){function s(u){try{h(e.next(u))}catch(c){o(c)}}function l(u){try{h(e.throw(u))}catch(c){o(c)}}function h(u){u.done?a(u.value):n(u.value).then(s,l)}h((e=e.apply(i,r||[])).next())})}function wi(i,r){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(h){return function(u){return l([h,u])}}function l(h){if(e)throw new TypeError("Generator is already executing.");for(;t;)try{if(e=1,n&&(a=h[0]&2?n.return:h[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,h[1])).done)return a;switch(n=0,a&&(h=[h[0]&2,a.value]),h[0]){case 0:case 1:a=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,n=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!a||h[1]>a[0]&&h[1]<a[3])){t.label=h[1];break}if(h[0]===6&&t.label<a[1]){t.label=a[1],a=h;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(h);break}a[2]&&t.ops.pop(),t.trys.pop();continue}h=r.call(i,t)}catch(u){h=[6,u],n=0}finally{e=a=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function $(i){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&i[r],e=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&e>=i.length&&(i=void 0),{value:i&&i[e++],done:!i}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(i,r){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var e=t.call(i),n,a=[],o;try{for(;(r===void 0||r-- >0)&&!(n=e.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(t=e.return)&&t.call(e)}finally{if(o)throw o.error}}return a}function Ci(){for(var i=0,r=0,t=arguments.length;r<t;r++)i+=arguments[r].length;for(var e=Array(i),n=0,r=0;r<t;r++)for(var a=arguments[r],o=0,s=a.length;o<s;o++,n++)e[n]=a[o];return e}function et(i,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,a;e<n;e++)(a||!(e in r))&&(a||(a=Array.prototype.slice.call(r,0,e)),a[e]=r[e]);return i.concat(a||Array.prototype.slice.call(r))}var Wt=function(i){return i!==null&&typeof i!="function"&&isFinite(i.length)},rr=function(i,r){return Wt(i)?i.indexOf(r)>-1:!1},Qt=function(i,r){if(!Wt(i))return i;for(var t=[],e=0;e<i.length;e++){var n=i[e];r(n,e)&&t.push(n)}return t},ep=function(i,r){return r===void 0&&(r=[]),Qt(i,function(t){return!rr(r,t)})},rp={}.toString,gr=function(i,r){return rp.call(i)==="[object "+r+"]"};const G=function(i){return gr(i,"Function")};var I=function(i){return i==null};const P=function(i){return Array.isArray?Array.isArray(i):gr(i,"Array")},rt=function(i){var r=typeof i;return i!==null&&r==="object"||r==="function"};function M(i,r){if(!!i){var t;if(P(i))for(var e=0,n=i.length;e<n&&(t=r(i[e],e),t!==!1);e++);else if(rt(i)){for(var a in i)if(i.hasOwnProperty(a)&&(t=r(i[a],a),t===!1))break}}}var Vi=Object.keys?function(i){return Object.keys(i)}:function(i){var r=[];return M(i,function(t,e){G(i)&&e==="prototype"||r.push(e)}),r};function ip(i,r){var t=Vi(r),e=t.length;if(I(i))return!e;for(var n=0;n<e;n+=1){var a=t[n];if(r[a]!==i[a]||!(a in i))return!1}return!0}var vo=function(i){return typeof i=="object"&&i!==null},ce=function(i){if(!vo(i)||!gr(i,"Object"))return!1;if(Object.getPrototypeOf(i)===null)return!0;for(var r=i;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(i)===r};function Ce(i,r){if(!P(i))return null;var t;if(G(r)&&(t=r),ce(r)&&(t=function(n){return ip(n,r)}),t){for(var e=0;e<i.length;e+=1)if(t(i[e]))return i[e]}return null}var np=function(i,r){for(var t=null,e=0;e<i.length;e++){var n=i[e],a=n[r];if(!I(a)){P(a)?t=a[0]:t=a;break}}return t},$t=function(i){if(!P(i))return[];for(var r=[],t=0;t<i.length;t++)r=r.concat(i[t]);return r};const Lt=function(i){if(!!P(i))return i.reduce(function(r,t){return Math.max(r,t)},i[0])},Yt=function(i){if(!!P(i))return i.reduce(function(r,t){return Math.min(r,t)},i[0])};var ap=function(i){var r=i.filter(function(o){return!isNaN(o)});if(!r.length)return{min:0,max:0};if(P(i[0])){for(var t=[],e=0;e<i.length;e++)t=t.concat(i[e]);r=t}var n=Lt(r),a=Yt(r);return{min:a,max:n}},op=Array.prototype.splice,sp=function(r,t){if(!Wt(r))return[];for(var e=r?t.length:0,n=e-1;e--;){var a=void 0,o=t[e];(e===n||o!==a)&&(a=o,op.call(r,o,1))}return r},Gu=function(i,r,t){if(!P(i)&&!ce(i))return i;var e=t;return M(i,function(n,a){e=r(e,n,a)}),e},lp=function(i,r){var t=[];if(!Wt(i))return t;for(var e=-1,n=[],a=i.length;++e<a;){var o=i[e];r(o,e,i)&&(t.push(o),n.push(e))}return sp(i,n),t};const N=function(i){return gr(i,"String")};function Hu(i,r){r===void 0&&(r=new Map);var t=[];if(Array.isArray(i))for(var e=0,n=i.length;e<n;e++){var a=i[e];r.has(a)||(t.push(a),r.set(a,!0))}return t}const Me=function(i,r){for(var t=[],e={},n=0;n<i.length;n++){var a=i[n],o=a[r];if(!I(o)){P(o)||(o=[o]);for(var s=0;s<o.length;s++){var l=o[s];e[l]||(t.push(l),e[l]=!0)}}}return t};function zt(i){if(Wt(i))return i[0]}function Ct(i){if(Wt(i)){var r=i;return r[r.length-1]}}var hp=function(i,r){for(var t=0;t<i.length;t++)if(!r(i[t],t))return!1;return!0},ea=function(i,r){for(var t=0;t<i.length;t++)if(r(i[t],t))return!0;return!1},up=Object.prototype.hasOwnProperty;function Ue(i,r){if(!r||!P(i))return{};for(var t={},e=G(r)?r:function(s){return s[r]},n,a=0;a<i.length;a++){var o=i[a];n=e(o),up.call(t,n)?t[n].push(o):t[n]=[o]}return t}function Vu(i,r){if(!r)return{0:i};if(!G(r)){var t=P(r)?r:r.replace(/\s+/g,"").split("*");r=function(e){for(var n="_",a=0,o=t.length;a<o;a++)n+=e[t[a]]&&e[t[a]].toString();return n}}return Ue(i,r)}const cp=function(i,r){if(!r)return[i];var t=Vu(i,r),e=[];for(var n in t)e.push(t[n]);return e};var at=function(i,r,t){return i<r?r:i>t?t:i},Ra=function(i,r){var t=r.toString(),e=t.indexOf(".");if(e===-1)return Math.round(i);var n=t.substr(e+1).length;return n>20&&(n=20),parseFloat(i.toFixed(n))},U=function(i){return gr(i,"Number")},fp=1e-5;function xt(i,r,t){return t===void 0&&(t=fp),Math.abs(i-r)<t}var Jo=function(i,r){return(i%r+r)%r},vp=Math.PI/180,ts=function(i){return vp*i};const Or=function(i,r){return i.hasOwnProperty(r)};var es=Object.values?function(i){return Object.values(i)}:function(i){var r=[];return M(i,function(t,e){G(i)&&e==="prototype"||r.push(t)}),r};const ra=function(i){return I(i)?"":i.toString()};var Xr=function(i){return ra(i).toLowerCase()};function Nu(i,r){return!i||!r?i:i.replace(/\\?\{([^{}]+)\}/g,function(t,e){return t.charAt(0)==="\\"?t.slice(1):r[e]===void 0?"":r[e]})}var dr=function(i){var r=ra(i);return r.charAt(0).toUpperCase()+r.substring(1)},pp={}.toString,gp=function(i){return pp.call(i).replace(/^\[object /,"").replace(/]$/,"")},Mi=function(i){return gr(i,"Boolean")},Xu=function(i){return gr(i,"Date")},dp=function(i){return i===null},yp=Object.prototype,mp=function(i){var r=i&&i.constructor,t=typeof r=="function"&&r.prototype||yp;return i===t},br=function(i){return i===void 0},zu=function(i){return i instanceof Element||i instanceof HTMLDocument};function xp(i){var r=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return setTimeout(t,16)};return r(i)}function wp(i){var r=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;r(i)}function Ya(i,r){for(var t in r)r.hasOwnProperty(t)&&t!=="constructor"&&r[t]!==void 0&&(i[t]=r[t])}function ot(i,r,t,e){return r&&Ya(i,r),t&&Ya(i,t),e&&Ya(i,e),i}var Xt=function(i){if(typeof i!="object"||i===null)return i;var r;if(P(i)){r=[];for(var t=0,e=i.length;t<e;t++)typeof i[t]=="object"&&i[t]!=null?r[t]=Xt(i[t]):r[t]=i[t]}else{r={};for(var n in i)typeof i[n]=="object"&&i[n]!=null?r[n]=Xt(i[n]):r[n]=i[n]}return r};function Wu(i,r,t){var e;return function(){var n=this,a=arguments,o=function(){e=null,t||i.apply(n,a)},s=t&&!e;clearTimeout(e),e=setTimeout(o,r),s&&i.apply(n,a)}}const ia=function(i,r){if(!G(i))throw new TypeError("Expected a function");var t=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var a=r?r.apply(this,e):e[0],o=t.cache;if(o.has(a))return o.get(a);var s=i.apply(this,e);return o.set(a,s),s};return t.cache=new Map,t};var Cp=5;function $u(i,r,t,e){t=t||0,e=e||Cp;for(var n in r)if(r.hasOwnProperty(n)){var a=r[n];a!==null&&ce(a)?(ce(i[n])||(i[n]={}),t<e?$u(i[n],a,t+1,e):i[n]=r[n]):P(a)?(i[n]=[],i[n]=i[n].concat(a)):a!==void 0&&(i[n]=a)}}var D=function(i){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var e=0;e<r.length;e+=1)$u(i,r[e]);return i},_u=function(i,r){if(!Wt(i))return-1;var t=Array.prototype.indexOf;if(t)return t.call(i,r);for(var e=-1,n=0;n<i.length;n++)if(i[n]===r){e=n;break}return e},Mp=Object.prototype.hasOwnProperty;function pe(i){if(I(i))return!0;if(Wt(i))return!i.length;var r=gp(i);if(r==="Map"||r==="Set")return!i.size;if(mp(i))return!Object.keys(i).length;for(var t in i)if(Mp.call(i,t))return!1;return!0}var gt=function(i,r){if(i===r)return!0;if(!i||!r||N(i)||N(r))return!1;if(Wt(i)||Wt(r)){if(i.length!==r.length)return!1;for(var t=!0,e=0;e<i.length&&(t=gt(i[e],r[e]),!!t);e++);return t}if(vo(i)||vo(r)){var n=Object.keys(i),a=Object.keys(r);if(n.length!==a.length)return!1;for(var t=!0,e=0;e<n.length&&(t=gt(i[n[e]],r[n[e]]),!!t);e++);return t}return!1},Et=function(i,r){if(!Wt(i))return i;for(var t=[],e=0;e<i.length;e++){var n=i[e];t.push(r(n,e))}return t},Sp=function(i){return i};const bp=function(i,r){r===void 0&&(r=Sp);var t={};return rt(i)&&!I(i)&&Object.keys(i).forEach(function(e){t[e]=r(i[e],e)}),t},T=function(i,r,t){for(var e=0,n=N(r)?r.split("."):r;i&&e<n.length;)i=i[n[e++]];return i===void 0||e<n.length?t:i},pt=function(i,r,t){var e=i,n=N(r)?r.split("."):r;return n.forEach(function(a,o){o<n.length-1?(rt(e[a])||(e[a]=U(n[o+1])?[]:{}),e=e[a]):e[a]=t}),i};var Ap=Object.prototype.hasOwnProperty;const rs=function(i,r){if(i===null||!ce(i))return{};var t={};return M(r,function(e){Ap.call(i,e)&&(t[e]=i[e])}),t},is=function(i,r,t){var e,n,a,o,s=0;t||(t={});var l=function(){s=t.leading===!1?0:Date.now(),e=null,o=i.apply(n,a),e||(n=a=null)},h=function(){var u=Date.now();!s&&t.leading===!1&&(s=u);var c=r-(u-s);return n=this,a=arguments,c<=0||c>r?(e&&(clearTimeout(e),e=null),s=u,o=i.apply(n,a),e||(n=a=null)):!e&&t.trailing!==!1&&(e=setTimeout(l,c)),o};return h.cancel=function(){clearTimeout(e),s=0,e=n=a=null},h},Tp=function(i){return Wt(i)?Array.prototype.slice.call(i):[]};var Qi={};const qe=function(i){return i=i||"g",Qi[i]?Qi[i]+=1:Qi[i]=1,i+Qi[i]},Ye=function(){};function Gt(i){return I(i)?0:Wt(i)?i.length:Object.keys(i).length}var Ki;const Ji=ia(function(i,r){r===void 0&&(r={});var t=r.fontSize,e=r.fontFamily,n=r.fontWeight,a=r.fontStyle,o=r.fontVariant;return Ki||(Ki=document.createElement("canvas").getContext("2d")),Ki.font=[a,o,n,t+"px",e].join(" "),Ki.measureText(N(i)?i:"").width},function(i,r){return r===void 0&&(r={}),Ci([i],es(r)).join("")}),Lp=function(i,r,t,e){e===void 0&&(e="...");var n=16,a=Ji(e,t),o=N(i)?i:ra(i),s=r,l=[],h,u;if(Ji(i,t)<=r)return i;for(;h=o.substr(0,n),u=Ji(h,t),!(u+a>s&&u>s);)if(l.push(h),s-=u,o=o.substr(n),!o)return l.join("");for(;h=o.substr(0,1),u=Ji(h,t),!(u+a>s);)if(l.push(h),s-=u,o=o.substr(1),!o)return l.join("");return""+l.join("")+e};var Ep=function(){function i(){this.map={}}return i.prototype.has=function(r){return this.map[r]!==void 0},i.prototype.get=function(r,t){var e=this.map[r];return e===void 0?t:e},i.prototype.set=function(r,t){this.map[r]=t},i.prototype.clear=function(){this.map={}},i.prototype.delete=function(r){delete this.map[r]},i.prototype.size=function(){return Object.keys(this.map).length},i}(),st;(function(i){i.FORE="fore",i.MID="mid",i.BG="bg"})(st||(st={}));var F;(function(i){i.TOP="top",i.TOP_LEFT="top-left",i.TOP_RIGHT="top-right",i.RIGHT="right",i.RIGHT_TOP="right-top",i.RIGHT_BOTTOM="right-bottom",i.LEFT="left",i.LEFT_TOP="left-top",i.LEFT_BOTTOM="left-bottom",i.BOTTOM="bottom",i.BOTTOM_LEFT="bottom-left",i.BOTTOM_RIGHT="bottom-right",i.RADIUS="radius",i.CIRCLE="circle",i.NONE="none"})(F||(F={}));var dt;(function(i){i.AXIS="axis",i.GRID="grid",i.LEGEND="legend",i.TOOLTIP="tooltip",i.ANNOTATION="annotation",i.SLIDER="slider",i.SCROLLBAR="scrollbar",i.OTHER="other"})(dt||(dt={}));var Br={FORE:3,MID:2,BG:1},tt;(function(i){i.BEFORE_RENDER="beforerender",i.AFTER_RENDER="afterrender",i.BEFORE_PAINT="beforepaint",i.AFTER_PAINT="afterpaint",i.BEFORE_CHANGE_DATA="beforechangedata",i.AFTER_CHANGE_DATA="afterchangedata",i.BEFORE_CLEAR="beforeclear",i.AFTER_CLEAR="afterclear",i.BEFORE_DESTROY="beforedestroy",i.BEFORE_CHANGE_SIZE="beforechangesize",i.AFTER_CHANGE_SIZE="afterchangesize"})(tt||(tt={}));var Ne;(function(i){i.BEFORE_DRAW_ANIMATE="beforeanimate",i.AFTER_DRAW_ANIMATE="afteranimate",i.BEFORE_RENDER_LABEL="beforerenderlabel",i.AFTER_RENDER_LABEL="afterrenderlabel"})(Ne||(Ne={}));var It;(function(i){i.MOUSE_ENTER="plot:mouseenter",i.MOUSE_DOWN="plot:mousedown",i.MOUSE_MOVE="plot:mousemove",i.MOUSE_UP="plot:mouseup",i.MOUSE_LEAVE="plot:mouseleave",i.TOUCH_START="plot:touchstart",i.TOUCH_MOVE="plot:touchmove",i.TOUCH_END="plot:touchend",i.TOUCH_CANCEL="plot:touchcancel",i.CLICK="plot:click",i.DBLCLICK="plot:dblclick",i.CONTEXTMENU="plot:contextmenu",i.LEAVE="plot:leave",i.ENTER="plot:enter"})(It||(It={}));var Pn;(function(i){i.ACTIVE="active",i.INACTIVE="inactive",i.SELECTED="selected",i.DEFAULT="default"})(Pn||(Pn={}));var Ar=["color","shape","size"],Z="_origin",sl=1,ll=1,hl=.25,ju={};function Bp(i){var r=ju[i];if(!r)throw new Error("G engine '".concat(i,"' is not exist, please register it at first."));return r}function Uu(i,r){ju[i]=r}function xr(i,r,t){if(i){if(typeof i.addEventListener=="function")return i.addEventListener(r,t,!1),{remove:function(){i.removeEventListener(r,t,!1)}};if(typeof i.attachEvent=="function")return i.attachEvent("on"+r,t),{remove:function(){i.detachEvent("on"+r,t)}}}}var ai,Ga,qu,po;function kp(){ai=document.createElement("table"),Ga=document.createElement("tr"),qu=/^\s*<(\w+|!)[^>]*>/,po={tr:document.createElement("tbody"),tbody:ai,thead:ai,tfoot:ai,td:Ga,th:Ga,"*":document.createElement("div")}}function Xe(i){ai||kp();var r=qu.test(i)&&RegExp.$1;(!r||!(r in po))&&(r="*");var t=po[r];i=typeof i=="string"?i.replace(/(^\s*)|(\s*$)/g,""):i,t.innerHTML=""+i;var e=t.childNodes[0];return e&&t.contains(e)&&t.removeChild(e),e}function Rt(i,r,t){var e;try{e=window.getComputedStyle?window.getComputedStyle(i,null)[r]:i.style[r]}catch{}finally{e=e===void 0?t:e}return e}function Ip(i,r){var t=Rt(i,"height",r);return t==="auto"&&(t=i.offsetHeight),parseFloat(t)}function Pp(i,r){var t=Ip(i,r),e=parseFloat(Rt(i,"borderTopWidth"))||0,n=parseFloat(Rt(i,"paddingTop"))||0,a=parseFloat(Rt(i,"paddingBottom"))||0,o=parseFloat(Rt(i,"borderBottomWidth"))||0,s=parseFloat(Rt(i,"marginTop"))||0,l=parseFloat(Rt(i,"marginBottom"))||0;return t+e+o+n+a+s+l}function Fp(i,r){var t=Rt(i,"width",r);return t==="auto"&&(t=i.offsetWidth),parseFloat(t)}function Op(i,r){var t=Fp(i,r),e=parseFloat(Rt(i,"borderLeftWidth"))||0,n=parseFloat(Rt(i,"paddingLeft"))||0,a=parseFloat(Rt(i,"paddingRight"))||0,o=parseFloat(Rt(i,"borderRightWidth"))||0,s=parseFloat(Rt(i,"marginRight"))||0,l=parseFloat(Rt(i,"marginLeft"))||0;return t+e+o+n+a+l+s}function bt(i,r){if(i)for(var t in r)r.hasOwnProperty(t)&&(i.style[t]=r[t]);return i}function Dp(i){var r=getComputedStyle(i);return{width:(i.clientWidth||parseInt(r.width,10))-parseInt(r.paddingLeft,10)-parseInt(r.paddingRight,10),height:(i.clientHeight||parseInt(r.height,10))-parseInt(r.paddingTop,10)-parseInt(r.paddingBottom,10)}}function ul(i){return typeof i=="number"&&!isNaN(i)}function cl(i,r,t,e){var n=t,a=e;if(r){var o=Dp(i);n=o.width?o.width:n,a=o.height?o.height:a}return{width:Math.max(ul(n)?n:sl,sl),height:Math.max(ul(a)?a:ll,ll)}}function Rp(i){var r=i.parentNode;r&&r.removeChild(i)}var Yp="*",Zu=function(){function i(){this._events={}}return i.prototype.on=function(r,t,e){return this._events[r]||(this._events[r]=[]),this._events[r].push({callback:t,once:!!e}),this},i.prototype.once=function(r,t){return this.on(r,t,!0)},i.prototype.emit=function(r){for(var t=this,e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var a=this._events[r]||[],o=this._events[Yp]||[],s=function(l){for(var h=l.length,u=0;u<h;u++)if(!!l[u]){var c=l[u],f=c.callback,v=c.once;v&&(l.splice(u,1),l.length===0&&delete t._events[r],h--,u--),f.apply(t,e)}};s(a),s(o)},i.prototype.off=function(r,t){if(!r)this._events={};else if(!t)delete this._events[r];else{for(var e=this._events[r]||[],n=e.length,a=0;a<n;a++)e[a].callback===t&&(e.splice(a,1),n--,a--);e.length===0&&delete this._events[r]}return this},i.prototype.getEvents=function(){return this._events},i}(),ns=function(i){E(r,i);function r(t){var e=i.call(this)||this;e.destroyed=!1;var n=t.visible,a=n===void 0?!0:n;return e.visible=a,e}return r.prototype.show=function(){var t=this.visible;t||this.changeVisible(!0)},r.prototype.hide=function(){var t=this.visible;t&&this.changeVisible(!1)},r.prototype.destroy=function(){this.off(),this.destroyed=!0},r.prototype.changeVisible=function(t){this.visible!==t&&(this.visible=t)},r}(Zu),ui=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,Gp=new RegExp("([a-z])["+ui+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+ui+"]*,?["+ui+"]*)+)","ig"),Hp=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+ui+"]*,?["+ui+"]*","ig"),Tr=function(i){if(!i)return null;if(P(i))return i;var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(i).replace(Gp,function(e,n,a){var o=[],s=n.toLowerCase();if(a.replace(Hp,function(l,h){h&&o.push(+h)}),s==="m"&&o.length>2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=r[s]&&(t.push([n].concat(o.splice(0,r[s]))),!!r[s]););return i}),t},go=function(i,r){for(var t=[],e=0,n=i.length;n-2*!r>e;e+=2){var a=[{x:+i[e-2],y:+i[e-1]},{x:+i[e],y:+i[e+1]},{x:+i[e+2],y:+i[e+3]},{x:+i[e+4],y:+i[e+5]}];r?e?n-4===e?a[3]={x:+i[0],y:+i[1]}:n-2===e&&(a[2]={x:+i[0],y:+i[1]},a[3]={x:+i[2],y:+i[3]}):a[0]={x:+i[n-2],y:+i[n-1]}:n-4===e?a[3]=a[2]:e||(a[0]={x:+i[e],y:+i[e+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},tn=function(i,r,t,e,n){var a=[];if(n===null&&e===null&&(e=t),i=+i,r=+r,t=+t,e=+e,n!==null){var o=Math.PI/180,s=i+t*Math.cos(-e*o),l=i+t*Math.cos(-n*o),h=r+t*Math.sin(-e*o),u=r+t*Math.sin(-n*o);a=[["M",s,h],["A",t,t,0,+(n-e>180),0,l,u]]}else a=[["M",i,r],["m",0,-e],["a",t,e,0,1,1,0,2*e],["a",t,e,0,1,1,0,-2*e],["z"]];return a},yo=function(i){if(i=Tr(i),!i||!i.length)return[["M",0,0]];var r=[],t=0,e=0,n=0,a=0,o=0,s,l;i[0][0]==="M"&&(t=+i[0][1],e=+i[0][2],n=t,a=e,o++,r[0]=["M",t,e]);for(var h=i.length===3&&i[0][0]==="M"&&i[1][0].toUpperCase()==="R"&&i[2][0].toUpperCase()==="Z",u=void 0,c=void 0,f=o,v=i.length;f<v;f++){if(r.push(u=[]),c=i[f],s=c[0],s!==s.toUpperCase())switch(u[0]=s.toUpperCase(),u[0]){case"A":u[1]=c[1],u[2]=c[2],u[3]=c[3],u[4]=c[4],u[5]=c[5],u[6]=+c[6]+t,u[7]=+c[7]+e;break;case"V":u[1]=+c[1]+e;break;case"H":u[1]=+c[1]+t;break;case"R":l=[t,e].concat(c.slice(1));for(var p=2,g=l.length;p<g;p++)l[p]=+l[p]+t,l[++p]=+l[p]+e;r.pop(),r=r.concat(go(l,h));break;case"O":r.pop(),l=tn(t,e,c[1],c[2]),l.push(l[0]),r=r.concat(l);break;case"U":r.pop(),r=r.concat(tn(t,e,c[1],c[2],c[3])),u=["U"].concat(r[r.length-1].slice(-2));break;case"M":n=+c[1]+t,a=+c[2]+e;break;default:for(var p=1,g=c.length;p<g;p++)u[p]=+c[p]+(p%2?t:e)}else if(s==="R")l=[t,e].concat(c.slice(1)),r.pop(),r=r.concat(go(l,h)),u=["R"].concat(c.slice(-2));else if(s==="O")r.pop(),l=tn(t,e,c[1],c[2]),l.push(l[0]),r=r.concat(l);else if(s==="U")r.pop(),r=r.concat(tn(t,e,c[1],c[2],c[3])),u=["U"].concat(r[r.length-1].slice(-2));else for(var d=0,y=c.length;d<y;d++)u[d]=c[d];if(s=s.toUpperCase(),s!=="O")switch(u[0]){case"Z":t=+n,e=+a;break;case"H":t=u[1];break;case"V":e=u[1];break;case"M":n=u[u.length-2],a=u[u.length-1];break;default:t=u[u.length-2],e=u[u.length-1]}}return r},en=function(i,r,t,e){return[i,r,t,e,t,e]},fl=function(i,r,t,e,n,a){var o=.3333333333333333,s=2/3;return[o*i+s*t,o*r+s*e,o*n+s*t,o*a+s*e,n,a]},Qu=function(i,r,t,e,n,a,o,s,l,h){t===e&&(t+=1);var u=Math.PI*120/180,c=Math.PI/180*(+n||0),f=[],v,p,g,d,y,C=function(qr,Zi,Te){var Oa=qr*Math.cos(Te)-Zi*Math.sin(Te),Zr=qr*Math.sin(Te)+Zi*Math.cos(Te);return{x:Oa,y:Zr}};if(h)p=h[0],g=h[1],d=h[2],y=h[3];else{v=C(i,r,-c),i=v.x,r=v.y,v=C(s,l,-c),s=v.x,l=v.y,i===s&&r===l&&(s+=1,l+=1);var m=(i-s)/2,x=(r-l)/2,S=m*m/(t*t)+x*x/(e*e);S>1&&(S=Math.sqrt(S),t=S*t,e=S*e);var b=t*t,A=e*e,L=(a===o?-1:1)*Math.sqrt(Math.abs((b*A-b*x*x-A*m*m)/(b*x*x+A*m*m)));d=L*t*x/e+(i+s)/2,y=L*-e*m/t+(r+l)/2,p=Math.asin(((r-y)/e).toFixed(9)),g=Math.asin(((l-y)/e).toFixed(9)),p=i<d?Math.PI-p:p,g=s<d?Math.PI-g:g,p<0&&(p=Math.PI*2+p),g<0&&(g=Math.PI*2+g),o&&p>g&&(p=p-Math.PI*2),!o&&g>p&&(g=g-Math.PI*2)}var k=g-p;if(Math.abs(k)>u){var B=g,O=s,R=l;g=p+u*(o&&g>p?1:-1),s=d+t*Math.cos(g),l=y+e*Math.sin(g),f=Qu(s,l,t,e,n,0,o,O,R,[g,B,d,y])}k=g-p;var H=Math.cos(p),z=Math.sin(p),_=Math.cos(g),K=Math.sin(g),nt=Math.tan(k/4),ht=4/3*t*nt,Q=4/3*e*nt,ut=[i,r],vt=[i+ht*z,r-Q*H],te=[s+ht*K,l-Q*_],mr=[s,l];if(vt[0]=2*ut[0]-vt[0],vt[1]=2*ut[1]-vt[1],h)return[vt,te,mr].concat(f);f=[vt,te,mr].concat(f).join().split(",");for(var qi=[],ee=0,Ur=f.length;ee<Ur;ee++)qi[ee]=ee%2?C(f[ee-1],f[ee],c).y:C(f[ee],f[ee+1],c).x;return qi},mo=function(i,r){var t=yo(i),e=r&&yo(r),n={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o=[],s=[],l="",h="",u,c=function(m,x,S){var b,A;if(!m)return["C",x.x,x.y,x.x,x.y,x.x,x.y];switch(!(m[0]in{T:1,Q:1})&&(x.qx=x.qy=null),m[0]){case"M":x.X=m[1],x.Y=m[2];break;case"A":m=["C"].concat(Qu.apply(0,[x.x,x.y].concat(m.slice(1))));break;case"S":S==="C"||S==="S"?(b=x.x*2-x.bx,A=x.y*2-x.by):(b=x.x,A=x.y),m=["C",b,A].concat(m.slice(1));break;case"T":S==="Q"||S==="T"?(x.qx=x.x*2-x.qx,x.qy=x.y*2-x.qy):(x.qx=x.x,x.qy=x.y),m=["C"].concat(fl(x.x,x.y,x.qx,x.qy,m[1],m[2]));break;case"Q":x.qx=m[1],x.qy=m[2],m=["C"].concat(fl(x.x,x.y,m[1],m[2],m[3],m[4]));break;case"L":m=["C"].concat(en(x.x,x.y,m[1],m[2]));break;case"H":m=["C"].concat(en(x.x,x.y,m[1],x.y));break;case"V":m=["C"].concat(en(x.x,x.y,x.x,m[1]));break;case"Z":m=["C"].concat(en(x.x,x.y,x.X,x.Y));break}return m},f=function(m,x){if(m[x].length>7){m[x].shift();for(var S=m[x];S.length;)o[x]="A",e&&(s[x]="A"),m.splice(x++,0,["C"].concat(S.splice(0,6)));m.splice(x,1),u=Math.max(t.length,e&&e.length||0)}},v=function(m,x,S,b,A){m&&x&&m[A][0]==="M"&&x[A][0]!=="M"&&(x.splice(A,0,["M",b.x,b.y]),S.bx=0,S.by=0,S.x=m[A][1],S.y=m[A][2],u=Math.max(t.length,e&&e.length||0))};u=Math.max(t.length,e&&e.length||0);for(var p=0;p<u;p++){t[p]&&(l=t[p][0]),l!=="C"&&(o[p]=l,p&&(h=o[p-1])),t[p]=c(t[p],n,h),o[p]!=="A"&&l==="C"&&(o[p]="C"),f(t,p),e&&(e[p]&&(l=e[p][0]),l!=="C"&&(s[p]=l,p&&(h=s[p-1])),e[p]=c(e[p],a,h),s[p]!=="A"&&l==="C"&&(s[p]="C"),f(e,p)),v(t,e,n,a,p),v(e,t,a,n,p);var g=t[p],d=e&&e[p],y=g.length,C=e&&d.length;n.x=g[y-2],n.y=g[y-1],n.bx=parseFloat(g[y-4])||n.x,n.by=parseFloat(g[y-3])||n.y,a.bx=e&&(parseFloat(d[C-4])||a.x),a.by=e&&(parseFloat(d[C-3])||a.y),a.x=e&&d[C-2],a.y=e&&d[C-1]}return e?[t,e]:t},Vp=/,?([a-z]),?/gi,Ku=function(i){return i.join(",").replace(Vp,"$1")},vl=function(i,r,t,e,n){var a=-3*r+9*t-9*e+3*n,o=i*a+6*r-12*t+6*e;return i*o-3*r+3*t},pl=function(i,r,t,e,n,a,o,s,l){l===null&&(l=1),l=l>1?1:l<0?0:l;for(var h=l/2,u=12,c=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],v=0,p=0;p<u;p++){var g=h*c[p]+h,d=vl(g,i,t,n,o),y=vl(g,r,e,a,s),C=d*d+y*y;v+=f[p]*Math.sqrt(C)}return h*v},Np=function(i,r,t,e,n,a,o,s){for(var l=[],h=[[],[]],u,c,f,v,p=0;p<2;++p){if(p===0?(c=6*i-12*t+6*n,u=-3*i+9*t-9*n+3*o,f=3*t-3*i):(c=6*r-12*e+6*a,u=-3*r+9*e-9*a+3*s,f=3*e-3*r),Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;v=-f/c,v>0&&v<1&&l.push(v);continue}var g=c*c-4*f*u,d=Math.sqrt(g);if(!(g<0)){var y=(-c+d)/(2*u);y>0&&y<1&&l.push(y);var C=(-c-d)/(2*u);C>0&&C<1&&l.push(C)}}for(var m=l.length,x=m,S;m--;)v=l[m],S=1-v,h[0][m]=S*S*S*i+3*S*S*v*t+3*S*v*v*n+v*v*v*o,h[1][m]=S*S*S*r+3*S*S*v*e+3*S*v*v*a+v*v*v*s;return h[0][x]=i,h[1][x]=r,h[0][x+1]=o,h[1][x+1]=s,h[0].length=h[1].length=x+2,{min:{x:Math.min.apply(0,h[0]),y:Math.min.apply(0,h[1])},max:{x:Math.max.apply(0,h[0]),y:Math.max.apply(0,h[1])}}},Xp=function(i,r,t,e,n,a,o,s){if(!(Math.max(i,t)<Math.min(n,o)||Math.min(i,t)>Math.max(n,o)||Math.max(r,e)<Math.min(a,s)||Math.min(r,e)>Math.max(a,s))){var l=(i*e-r*t)*(n-o)-(i-t)*(n*s-a*o),h=(i*e-r*t)*(a-s)-(r-e)*(n*s-a*o),u=(i-t)*(a-s)-(r-e)*(n-o);if(!!u){var c=l/u,f=h/u,v=+c.toFixed(2),p=+f.toFixed(2);if(!(v<+Math.min(i,t).toFixed(2)||v>+Math.max(i,t).toFixed(2)||v<+Math.min(n,o).toFixed(2)||v>+Math.max(n,o).toFixed(2)||p<+Math.min(r,e).toFixed(2)||p>+Math.max(r,e).toFixed(2)||p<+Math.min(a,s).toFixed(2)||p>+Math.max(a,s).toFixed(2)))return{x:c,y:f}}}},Ee=function(i,r,t){return r>=i.x&&r<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},Ju=function(i,r,t,e,n){if(n)return[["M",+i+ +n,r],["l",t-n*2,0],["a",n,n,0,0,1,n,n],["l",0,e-n*2],["a",n,n,0,0,1,-n,n],["l",n*2-t,0],["a",n,n,0,0,1,-n,-n],["l",0,n*2-e],["a",n,n,0,0,1,n,-n],["z"]];var a=[["M",i,r],["l",t,0],["l",0,e],["l",-t,0],["z"]];return a.parsePathArray=Ku,a},xo=function(i,r,t,e){return i===null&&(i=r=t=e=0),r===null&&(r=i.y,t=i.width,e=i.height,i=i.x),{x:i,y:r,width:t,w:t,height:e,h:e,x2:i+t,y2:r+e,cx:i+t/2,cy:r+e/2,r1:Math.min(t,e)/2,r2:Math.max(t,e)/2,r0:Math.sqrt(t*t+e*e)/2,path:Ju(i,r,t,e),vb:[i,r,t,e].join(" ")}},zp=function(i,r){return i=xo(i),r=xo(r),Ee(r,i.x,i.y)||Ee(r,i.x2,i.y)||Ee(r,i.x,i.y2)||Ee(r,i.x2,i.y2)||Ee(i,r.x,r.y)||Ee(i,r.x2,r.y)||Ee(i,r.x,r.y2)||Ee(i,r.x2,r.y2)||(i.x<r.x2&&i.x>r.x||r.x<i.x2&&r.x>i.x)&&(i.y<r.y2&&i.y>r.y||r.y<i.y2&&r.y>i.y)},gl=function(i,r,t,e,n,a,o,s){P(i)||(i=[i,r,t,e,n,a,o,s]);var l=Np.apply(null,i);return xo(l.min.x,l.min.y,l.max.x-l.min.x,l.max.y-l.min.y)},dl=function(i,r,t,e,n,a,o,s,l){var h=1-l,u=Math.pow(h,3),c=Math.pow(h,2),f=l*l,v=f*l,p=u*i+c*3*l*t+h*3*l*l*n+v*o,g=u*r+c*3*l*e+h*3*l*l*a+v*s,d=i+2*l*(t-i)+f*(n-2*t+i),y=r+2*l*(e-r)+f*(a-2*e+r),C=t+2*l*(n-t)+f*(o-2*n+t),m=e+2*l*(a-e)+f*(s-2*a+e),x=h*i+l*t,S=h*r+l*e,b=h*n+l*o,A=h*a+l*s,L=90-Math.atan2(d-C,y-m)*180/Math.PI;return{x:p,y:g,m:{x:d,y},n:{x:C,y:m},start:{x,y:S},end:{x:b,y:A},alpha:L}},Wp=function(i,r,t){var e=gl(i),n=gl(r);if(!zp(e,n))return t?0:[];for(var a=pl.apply(0,i),o=pl.apply(0,r),s=~~(a/8),l=~~(o/8),h=[],u=[],c={},f=t?0:[],v=0;v<s+1;v++){var p=dl.apply(0,i.concat(v/s));h.push({x:p.x,y:p.y,t:v/s})}for(var v=0;v<l+1;v++){var p=dl.apply(0,r.concat(v/l));u.push({x:p.x,y:p.y,t:v/l})}for(var v=0;v<s;v++)for(var g=0;g<l;g++){var d=h[v],y=h[v+1],C=u[g],m=u[g+1],x=Math.abs(y.x-d.x)<.001?"y":"x",S=Math.abs(m.x-C.x)<.001?"y":"x",b=Xp(d.x,d.y,y.x,y.y,C.x,C.y,m.x,m.y);if(b){if(c[b.x.toFixed(4)]===b.y.toFixed(4))continue;c[b.x.toFixed(4)]=b.y.toFixed(4);var A=d.t+Math.abs((b[x]-d[x])/(y[x]-d[x]))*(y.t-d.t),L=C.t+Math.abs((b[S]-C[S])/(m[S]-C[S]))*(m.t-C.t);A>=0&&A<=1&&L>=0&&L<=1&&(t?f+=1:f.push({x:b.x,y:b.y,t1:A,t2:L}))}}return f},$p=function(i,r,t){i=mo(i),r=mo(r);for(var e,n,a,o,s,l,h,u,c,f,v=t?0:[],p=0,g=i.length;p<g;p++){var d=i[p];if(d[0]==="M")e=s=d[1],n=l=d[2];else{d[0]==="C"?(c=[e,n].concat(d.slice(1)),e=c[6],n=c[7]):(c=[e,n,e,n,s,l,s,l],e=s,n=l);for(var y=0,C=r.length;y<C;y++){var m=r[y];if(m[0]==="M")a=h=m[1],o=u=m[2];else{m[0]==="C"?(f=[a,o].concat(m.slice(1)),a=f[6],o=f[7]):(f=[a,o,a,o,h,u,h,u],a=h,o=u);var x=Wp(c,f,t);if(t)v+=x;else{for(var S=0,b=x.length;S<b;S++)x[S].segment1=p,x[S].segment2=y,x[S].bez1=c,x[S].bez2=f;v=v.concat(x)}}}}}return v},_p=function(i,r){return $p(i,r)};function jp(i,r){var t=[],e=[];function n(a,o){if(a.length===1)t.push(a[0]),e.push(a[0]);else{for(var s=[],l=0;l<a.length-1;l++)l===0&&t.push(a[0]),l===a.length-2&&e.push(a[l+1]),s[l]=[(1-o)*a[l][0]+o*a[l+1][0],(1-o)*a[l][1]+o*a[l+1][1]];n(s,o)}}return i.length&&n(i,r),{left:t,right:e.reverse()}}function Up(i,r,t){var e=[[i[1],i[2]]];t=t||2;var n=[];r[0]==="A"?(e.push(r[6]),e.push(r[7])):r[0]==="C"?(e.push([r[1],r[2]]),e.push([r[3],r[4]]),e.push([r[5],r[6]])):r[0]==="S"||r[0]==="Q"?(e.push([r[1],r[2]]),e.push([r[3],r[4]])):e.push([r[1],r[2]]);for(var a=e,o=1/t,s=0;s<t-1;s++){var l=o/(1-o*s),h=jp(a,l);n.push(h.left),a=h.right}n.push(a);var u=n.map(function(c){var f=[];return c.length===4&&(f.push("C"),f=f.concat(c[2])),c.length>=3&&(c.length===3&&f.push("Q"),f=f.concat(c[1])),c.length===2&&f.push("L"),f=f.concat(c[c.length-1]),f});return u}var qp=function(i,r,t){if(t===1)return[[].concat(i)];var e=[];if(r[0]==="L"||r[0]==="C"||r[0]==="Q")e=e.concat(Up(i,r,t));else{var n=[].concat(i);n[0]==="M"&&(n[0]="L");for(var a=0;a<=t-1;a++)e.push(n)}return e},Zp=function(i,r){if(i.length===1)return i;var t=i.length-1,e=r.length-1,n=t/e,a=[];if(i.length===1&&i[0][0]==="M"){for(var o=0;o<e-t;o++)i.push(i[0]);return i}for(var o=0;o<e;o++){var s=Math.floor(n*o);a[s]=(a[s]||0)+1}var l=a.reduce(function(h,u,c){return c===t?h.concat(i[t]):h.concat(qp(i[c],i[c+1],u))},[]);return l.unshift(i[0]),(r[e]==="Z"||r[e]==="z")&&l.push("Z"),l},Qp=function(i,r){if(i.length!==r.length)return!1;var t=!0;return M(i,function(e,n){if(e!==r[n])return t=!1,!1}),t};function Kp(i,r,t){var e=null,n=t;return r<n&&(n=r,e="add"),i<n&&(n=i,e="del"),{type:e,min:n}}var Jp=function(i,r){var t=i.length,e=r.length,n,a,o=0;if(t===0||e===0)return null;for(var s=[],l=0;l<=t;l++)s[l]=[],s[l][0]={min:l};for(var h=0;h<=e;h++)s[0][h]={min:h};for(var l=1;l<=t;l++){n=i[l-1];for(var h=1;h<=e;h++){a=r[h-1],Qp(n,a)?o=0:o=1;var u=s[l-1][h].min+1,c=s[l][h-1].min+1,f=s[l-1][h-1].min+o;s[l][h]=Kp(u,c,f)}}return s},tc=function(i,r){var t=Jp(i,r),e=i.length,n=r.length,a=[],o=1,s=1;if(t[e][n].min!==e){for(var l=1;l<=e;l++){var h=t[l][l].min;s=l;for(var u=o;u<=n;u++)t[l][u].min<h&&(h=t[l][u].min,s=u);o=s,t[l][o].type&&a.push({index:l-1,type:t[l][o].type})}for(var l=a.length-1;l>=0;l--)o=a[l].index,a[l].type==="add"?i.splice(o,0,[].concat(i[o])):i.splice(o,1)}e=i.length;var c=n-e;if(e<n)for(var l=0;l<c;l++)i[e-1][0]==="z"||i[e-1][0]==="Z"?i.splice(e-2,0,i[e-2]):i.push(i[e-1]),e+=1;return i};function Ha(i,r,t){for(var e=[].concat(i),n,a=1/(t+1),o=ec(r)[0],s=1;s<=t;s++)a*=s,n=Math.floor(i.length*a),n===0?e.unshift([o[0]*a+i[n][0]*(1-a),o[1]*a+i[n][1]*(1-a)]):e.splice(n,0,[o[0]*a+i[n][0]*(1-a),o[1]*a+i[n][1]*(1-a)]);return e}function ec(i){var r=[];switch(i[0]){case"M":r.push([i[1],i[2]]);break;case"L":r.push([i[1],i[2]]);break;case"A":r.push([i[6],i[7]]);break;case"Q":r.push([i[3],i[4]]),r.push([i[1],i[2]]);break;case"T":r.push([i[1],i[2]]);break;case"C":r.push([i[5],i[6]]),r.push([i[1],i[2]]),r.push([i[3],i[4]]);break;case"S":r.push([i[3],i[4]]),r.push([i[1],i[2]]);break;case"H":r.push([i[1],i[1]]);break;case"V":r.push([i[1],i[1]]);break}return r}var wo=function(i,r){if(i.length<=1)return i;for(var t,e=0;e<r.length;e++)if(i[e][0]!==r[e][0])switch(t=ec(i[e]),r[e][0]){case"M":i[e]=["M"].concat(t[0]);break;case"L":i[e]=["L"].concat(t[0]);break;case"A":i[e]=[].concat(r[e]),i[e][6]=t[0][0],i[e][7]=t[0][1];break;case"Q":if(t.length<2)if(e>0)t=Ha(t,i[e-1],1);else{i[e]=r[e];break}i[e]=["Q"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"T":i[e]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(e>0)t=Ha(t,i[e-1],2);else{i[e]=r[e];break}i[e]=["C"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"S":if(t.length<2)if(e>0)t=Ha(t,i[e-1],1);else{i[e]=r[e];break}i[e]=["S"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;default:i[e]=r[e]}return i};const as=Object.freeze(Object.defineProperty({__proto__:null,catmullRomToBezier:go,fillPath:Zp,fillPathByDiff:tc,formatPath:wo,intersection:_p,parsePathArray:Ku,parsePathString:Tr,pathToAbsolute:yo,pathToCurve:mo,rectPath:Ju},Symbol.toStringTag,{value:"Module"}));var Ni=function(){function i(r,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=r,this.name=r,this.originalEvent=t,this.timeStamp=t.timeStamp}return i.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i.prototype.toString=function(){var r=this.type;return"[Event (type="+r+")]"},i.prototype.save=function(){},i.prototype.restore=function(){},i}();function rc(i,r){var t=i.indexOf(r);t!==-1&&i.splice(t,1)}var yl=typeof window<"u"&&typeof window.document<"u";function ic(i,r){if(i.isCanvas())return!0;for(var t=r.getParent(),e=!1;t;){if(t===i){e=!0;break}t=t.getParent()}return e}function Si(i){return i.cfg.visible&&i.cfg.capture}var na=function(i){E(r,i);function r(t){var e=i.call(this)||this;e.destroyed=!1;var n=e.getDefaultCfg();return e.cfg=ot(n,t),e}return r.prototype.getDefaultCfg=function(){return{}},r.prototype.get=function(t){return this.cfg[t]},r.prototype.set=function(t,e){this.cfg[t]=e},r.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},r}(Zu),ml=globalThis&&globalThis.__spreadArray||function(i,r,t){if(t||arguments.length===2)for(var e=0,n=r.length,a;e<n;e++)(a||!(e in r))&&(a||(a=Array.prototype.slice.call(r,0,e)),a[e]=r[e]);return i.concat(a||Array.prototype.slice.call(r))},tg=function(){function i(r,t,e){this.name=r,this.version=t,this.os=e,this.type="browser"}return i}(),eg=function(){function i(r){this.version=r,this.type="node",this.name="node",this.os=process.platform}return i}(),rg=function(){function i(r,t,e,n){this.name=r,this.version=t,this.os=e,this.bot=n,this.type="bot-device"}return i}(),ig=function(){function i(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return i}(),ng=function(){function i(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return i}(),ag=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,og=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,xl=3,sg=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",ag]],wl=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function nc(i){return i?Cl(i):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ng:typeof navigator<"u"?Cl(navigator.userAgent):ug()}function lg(i){return i!==""&&sg.reduce(function(r,t){var e=t[0],n=t[1];if(r)return r;var a=n.exec(i);return!!a&&[e,a]},!1)}function Cl(i){var r=lg(i);if(!r)return null;var t=r[0],e=r[1];if(t==="searchbot")return new ig;var n=e[1]&&e[1].split(".").join("_").split("_").slice(0,3);n?n.length<xl&&(n=ml(ml([],n,!0),cg(xl-n.length),!0)):n=[];var a=n.join("."),o=hg(i),s=og.exec(i);return s&&s[1]?new rg(t,a,o,s[1]):new tg(t,a,o)}function hg(i){for(var r=0,t=wl.length;r<t;r++){var e=wl[r],n=e[0],a=e[1],o=a.exec(i);if(o)return n}return null}function ug(){var i=typeof process<"u"&&process.version;return i?new eg(process.version.slice(1)):null}function cg(i){for(var r=[],t=0;t<i;t++)r.push("0");return r}var Fn=typeof Float32Array<"u"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var i=0,r=arguments.length;r--;)i+=arguments[r]*arguments[r];return Math.sqrt(i)});function fg(i,r){var t=r[0],e=r[1],n=r[2],a=r[3],o=r[4],s=r[5],l=r[6],h=r[7],u=r[8],c=u*o-s*h,f=-u*a+s*l,v=h*a-o*l,p=t*c+e*f+n*v;return p?(p=1/p,i[0]=c*p,i[1]=(-u*e+n*h)*p,i[2]=(s*e-n*o)*p,i[3]=f*p,i[4]=(u*t-n*l)*p,i[5]=(-s*t+n*a)*p,i[6]=v*p,i[7]=(-h*t+e*l)*p,i[8]=(o*t-e*a)*p,i):null}function aa(i,r,t){var e=r[0],n=r[1],a=r[2],o=r[3],s=r[4],l=r[5],h=r[6],u=r[7],c=r[8],f=t[0],v=t[1],p=t[2],g=t[3],d=t[4],y=t[5],C=t[6],m=t[7],x=t[8];return i[0]=f*e+v*o+p*h,i[1]=f*n+v*s+p*u,i[2]=f*a+v*l+p*c,i[3]=g*e+d*o+y*h,i[4]=g*n+d*s+y*u,i[5]=g*a+d*l+y*c,i[6]=C*e+m*o+x*h,i[7]=C*n+m*s+x*u,i[8]=C*a+m*l+x*c,i}function vg(i,r){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=1,i[5]=0,i[6]=r[0],i[7]=r[1],i[8]=1,i}function pg(i,r){var t=Math.sin(r),e=Math.cos(r);return i[0]=e,i[1]=t,i[2]=0,i[3]=-t,i[4]=e,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i}function gg(i,r){return i[0]=r[0],i[1]=0,i[2]=0,i[3]=0,i[4]=r[1],i[5]=0,i[6]=0,i[7]=0,i[8]=1,i}function dg(){var i=new Fn(3);return Fn!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function bi(i,r,t){var e=r[0],n=r[1],a=r[2];return i[0]=e*t[0]+n*t[3]+a*t[6],i[1]=e*t[1]+n*t[4]+a*t[7],i[2]=e*t[2]+n*t[5]+a*t[8],i}(function(){var i=dg();return function(r,t,e,n,a,o){var s,l;for(t||(t=3),e||(e=0),n?l=Math.min(n*t+e,r.length):l=r.length,s=e;s<l;s+=t)i[0]=r[s],i[1]=r[s+1],i[2]=r[s+2],a(i,i,o),r[s]=i[0],r[s+1]=i[1],r[s+2]=i[2];return r}})();function yg(){var i=new Fn(2);return Fn!=Float32Array&&(i[0]=0,i[1]=0),i}function Ge(i,r,t){return i[0]=r[0]+t[0],i[1]=r[1]+t[1],i}function ac(i,r,t){return i[0]=r[0]-t[0],i[1]=r[1]-t[1],i}function Ot(i,r,t){return i[0]=Math.min(r[0],t[0]),i[1]=Math.min(r[1],t[1]),i}function Dt(i,r,t){return i[0]=Math.max(r[0],t[0]),i[1]=Math.max(r[1],t[1]),i}function qt(i,r,t){return i[0]=r[0]*t,i[1]=r[1]*t,i}function On(i,r){var t=r[0]-i[0],e=r[1]-i[1];return Math.hypot(t,e)}function Lr(i){var r=i[0],t=i[1];return Math.hypot(r,t)}function oc(i,r){var t=r[0],e=r[1],n=t*t+e*e;return n>0&&(n=1/Math.sqrt(n)),i[0]=r[0]*n,i[1]=r[1]*n,i}function mg(i,r){return i[0]*r[0]+i[1]*r[1]}function xg(i,r,t){var e=r[0],n=r[1];return i[0]=t[0]*e+t[3]*n+t[6],i[1]=t[1]*e+t[4]*n+t[7],i}function Co(i,r){var t=i[0],e=i[1],n=r[0],a=r[1],o=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+a*a),s=o&&(t*n+e*a)/o;return Math.acos(Math.min(Math.max(s,-1),1))}function wg(i,r){return i[0]===r[0]&&i[1]===r[1]}var kr=ac;(function(){var i=yg();return function(r,t,e,n,a,o){var s,l;for(t||(t=2),e||(e=0),n?l=Math.min(n*t+e,r.length):l=r.length,s=e;s<l;s+=t)i[0]=r[s],i[1]=r[s+1],a(i,i,o),r[s]=i[0],r[s+1]=i[1];return r}})();function Sr(i,r,t){var e=[0,0,0,0,0,0,0,0,0];return vg(e,t),aa(i,e,r)}function os(i,r,t){var e=[0,0,0,0,0,0,0,0,0];return pg(e,t),aa(i,e,r)}function sc(i,r,t){var e=[0,0,0,0,0,0,0,0,0];return gg(e,t),aa(i,e,r)}function Cg(i,r,t){return aa(i,t,r)}function ct(i,r){for(var t=i?[].concat(i):[1,0,0,0,1,0,0,0,1],e=0,n=r.length;e<n;e++){var a=r[e];switch(a[0]){case"t":Sr(t,t,[a[1],a[2]]);break;case"s":sc(t,t,[a[1],a[2]]);break;case"r":os(t,t,a[1]);break;case"m":Cg(t,t,a[1]);break}}return t}function Mg(i,r){return i[0]*r[1]-r[0]*i[1]}function ss(i,r,t){var e=Co(i,r),n=Mg(i,r)>=0;return t?n?Math.PI*2-e:e:n?e:Math.PI*2-e}function Ml(i,r){var t=[],e=i[0],n=i[1],a=i[2],o=i[3],s=i[4],l=i[5],h=i[6],u=i[7],c=i[8],f=r[0],v=r[1],p=r[2],g=r[3],d=r[4],y=r[5],C=r[6],m=r[7],x=r[8];return t[0]=f*e+v*o+p*h,t[1]=f*n+v*s+p*u,t[2]=f*a+v*l+p*c,t[3]=g*e+d*o+y*h,t[4]=g*n+d*s+y*u,t[5]=g*a+d*l+y*c,t[6]=C*e+m*o+x*h,t[7]=C*n+m*s+x*u,t[8]=C*a+m*l+x*c,t}function xe(i,r){var t=[],e=r[0],n=r[1];return t[0]=i[0]*e+i[3]*n+i[6],t[1]=i[1]*e+i[4]*n+i[7],t}function oa(i){var r=[],t=i[0],e=i[1],n=i[2],a=i[3],o=i[4],s=i[5],l=i[6],h=i[7],u=i[8],c=u*o-s*h,f=-u*a+s*l,v=h*a-o*l,p=t*c+e*f+n*v;return p?(p=1/p,r[0]=c*p,r[1]=(-u*e+n*h)*p,r[2]=(s*e-n*o)*p,r[3]=f*p,r[4]=(u*t-n*l)*p,r[5]=(-s*t+n*a)*p,r[6]=v*p,r[7]=(-h*t+e*l)*p,r[8]=(o*t-e*a)*p,r):null}var Kr=ct,Va="matrix",Sg=["zIndex","capture","visible","type"],bg=["repeat"],Ag=":",Tg="*";function Lg(i){for(var r=[],t=0;t<i.length;t++)P(i[t])?r.push([].concat(i[t])):r.push(i[t]);return r}function Eg(i,r){var t={},e=r.attrs;for(var n in i)t[n]=e[n];return t}function Bg(i,r){var t={},e=r.attr();return M(i,function(n,a){bg.indexOf(a)===-1&&!gt(e[a],n)&&(t[a]=n)}),t}function kg(i,r){if(r.onFrame)return i;var t=r.startTime,e=r.delay,n=r.duration,a=Object.prototype.hasOwnProperty;return M(i,function(o){t+e<o.startTime+o.delay+o.duration&&n>o.delay&&M(r.toAttrs,function(s,l){a.call(o.toAttrs,l)&&(delete o.toAttrs[l],delete o.fromAttrs[l])})}),i}var lc=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.attrs={};var n=e.getDefaultAttrs();return ot(n,t.attrs),e.attrs=n,e.initAttrs(n),e.initAnimate(),e}return r.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},r.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},r.prototype.onCanvasChange=function(t){},r.prototype.initAttrs=function(t){},r.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},r.prototype.isGroup=function(){return!1},r.prototype.getParent=function(){return this.get("parent")},r.prototype.getCanvas=function(){return this.get("canvas")},r.prototype.attr=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var a=e[0],o=e[1];if(!a)return this.attrs;if(rt(a)){for(var s in a)this.setAttr(s,a[s]);return this.afterAttrsChange(a),this}return e.length===2?(this.setAttr(a,o),this.afterAttrsChange((t={},t[a]=o,t)),this):this.attrs[a]},r.prototype.isClipped=function(t,e){var n=this.getClip();return n&&!n.isHit(t,e)},r.prototype.setAttr=function(t,e){var n=this.attrs[t];n!==e&&(this.attrs[t]=e,this.onAttrChange(t,e,n))},r.prototype.onAttrChange=function(t,e,n){t==="matrix"&&this.set("totalMatrix",null)},r.prototype.afterAttrsChange=function(t){if(this.cfg.isClipShape){var e=this.cfg.applyTo;e&&e.onCanvasChange("clip")}else this.onCanvasChange("attr")},r.prototype.show=function(){return this.set("visible",!0),this.onCanvasChange("show"),this},r.prototype.hide=function(){return this.set("visible",!1),this.onCanvasChange("hide"),this},r.prototype.setZIndex=function(t){this.set("zIndex",t);var e=this.getParent();return e&&e.sort(),this},r.prototype.toFront=function(){var t=this.getParent();if(!!t){var e=t.getChildren();this.get("el");var n=e.indexOf(this);e.splice(n,1),e.push(this),this.onCanvasChange("zIndex")}},r.prototype.toBack=function(){var t=this.getParent();if(!!t){var e=t.getChildren();this.get("el");var n=e.indexOf(this);e.splice(n,1),e.unshift(this),this.onCanvasChange("zIndex")}},r.prototype.remove=function(t){t===void 0&&(t=!0);var e=this.getParent();e?(rc(e.getChildren(),this),e.get("clearing")||this.onCanvasChange("remove")):this.onCanvasChange("remove"),t&&this.destroy()},r.prototype.resetMatrix=function(){this.attr(Va,this.getDefaultMatrix()),this.onCanvasChange("matrix")},r.prototype.getMatrix=function(){return this.attr(Va)},r.prototype.setMatrix=function(t){this.attr(Va,t),this.onCanvasChange("matrix")},r.prototype.getTotalMatrix=function(){var t=this.cfg.totalMatrix;if(!t){var e=this.attr("matrix"),n=this.cfg.parentMatrix;n&&e?t=Ml(n,e):t=e||n,this.set("totalMatrix",t)}return t},r.prototype.applyMatrix=function(t){var e=this.attr("matrix"),n=null;t&&e?n=Ml(t,e):n=e||t,this.set("totalMatrix",n),this.set("parentMatrix",t)},r.prototype.getDefaultMatrix=function(){return null},r.prototype.applyToMatrix=function(t){var e=this.attr("matrix");return e?xe(e,t):t},r.prototype.invertFromMatrix=function(t){var e=this.attr("matrix");if(e){var n=oa(e);if(n)return xe(n,t)}return t},r.prototype.setClip=function(t){var e=this.getCanvas(),n=null;if(t){var a=this.getShapeBase(),o=dr(t.type),s=a[o];s&&(n=new s({type:t.type,isClipShape:!0,applyTo:this,attrs:t.attrs,canvas:e}))}return this.set("clipShape",n),this.onCanvasChange("clip"),n},r.prototype.getClip=function(){var t=this.cfg.clipShape;return t||null},r.prototype.clone=function(){var t=this,e=this.attrs,n={};M(e,function(s,l){P(e[l])?n[l]=Lg(e[l]):n[l]=e[l]});var a=this.constructor,o=new a({attrs:n});return M(Sg,function(s){o.set(s,t.get(s))}),o},r.prototype.destroy=function(){var t=this.destroyed;t||(this.attrs={},i.prototype.destroy.call(this))},r.prototype.isAnimatePaused=function(){return this.get("_pause").isPaused},r.prototype.animate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!(!this.get("timeline")&&!this.get("canvas"))){this.set("animating",!0);var n=this.get("timeline");n||(n=this.get("canvas").get("timeline"),this.set("timeline",n));var a=this.get("animations")||[];n.timer||n.initTimer();var o=t[0],s=t[1],l=t[2],h=l===void 0?"easeLinear":l,u=t[3],c=u===void 0?Ye:u,f=t[4],v=f===void 0?0:f,p,g,d,y,C;G(o)?(p=o,o={}):rt(o)&&o.onFrame&&(p=o.onFrame,g=o.repeat),rt(s)?(C=s,s=C.duration,h=C.easing||"easeLinear",v=C.delay||0,g=C.repeat||g||!1,c=C.callback||Ye,d=C.pauseCallback||Ye,y=C.resumeCallback||Ye):(U(c)&&(v=c,c=null),G(h)?(c=h,h="easeLinear"):h=h||"easeLinear");var m=Bg(o,this),x={fromAttrs:Eg(m,this),toAttrs:m,duration:s,easing:h,repeat:g,callback:c,pauseCallback:d,resumeCallback:y,delay:v,startTime:n.getTime(),id:qe(),onFrame:p,pathFormatted:!1};a.length>0?a=kg(a,x):n.addAnimator(this),a.push(x),this.set("animations",a),this.set("_pause",{isPaused:!1})}},r.prototype.stopAnimate=function(t){var e=this;t===void 0&&(t=!0);var n=this.get("animations");M(n,function(a){t&&(a.onFrame?e.attr(a.onFrame(1)):e.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},r.prototype.pauseAnimate=function(){var t=this.get("timeline"),e=this.get("animations"),n=t.getTime();return M(e,function(a){a._paused=!0,a._pauseTime=n,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:n}),this},r.prototype.resumeAnimate=function(){var t=this.get("timeline"),e=t.getTime(),n=this.get("animations"),a=this.get("_pause").pauseTime;return M(n,function(o){o.startTime=o.startTime+(e-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},r.prototype.emitDelegation=function(t,e){var n=this,a=e.propagationPath;this.getEvents();var o;t==="mouseenter"?o=e.fromShape:t==="mouseleave"&&(o=e.toShape);for(var s=function(c){var f=a[c],v=f.get("name");if(v){if((f.isGroup()||f.isCanvas&&f.isCanvas())&&o&&ic(f,o))return"break";P(v)?M(v,function(p){n.emitDelegateEvent(f,p,e)}):l.emitDelegateEvent(f,v,e)}},l=this,h=0;h<a.length;h++){var u=s(h);if(u==="break")break}},r.prototype.emitDelegateEvent=function(t,e,n){var a=this.getEvents(),o=e+Ag+n.type;(a[o]||a[Tg])&&(n.name=o,n.currentTarget=t,n.delegateTarget=this,n.delegateObject=t.get("delegateObject"),this.emit(o,n))},r.prototype.translate=function(t,e){t===void 0&&(t=0),e===void 0&&(e=0);var n=this.getMatrix(),a=Kr(n,[["t",t,e]]);return this.setMatrix(a),this},r.prototype.move=function(t,e){var n=this.attr("x")||0,a=this.attr("y")||0;return this.translate(t-n,e-a),this},r.prototype.moveTo=function(t,e){return this.move(t,e)},r.prototype.scale=function(t,e){var n=this.getMatrix(),a=Kr(n,[["s",t,e||t]]);return this.setMatrix(a),this},r.prototype.rotate=function(t){var e=this.getMatrix(),n=Kr(e,[["r",t]]);return this.setMatrix(n),this},r.prototype.rotateAtStart=function(t){var e=this.attr(),n=e.x,a=e.y,o=this.getMatrix(),s=Kr(o,[["t",-n,-a],["r",t],["t",n,a]]);return this.setMatrix(s),this},r.prototype.rotateAtPoint=function(t,e,n){var a=this.getMatrix(),o=Kr(a,[["t",-t,-e],["r",n],["t",t,e]]);return this.setMatrix(o),this},r}(na),Sl={},Mo="_INDEX";function hc(i,r){if(i.set("canvas",r),i.isGroup()){var t=i.get("children");t.length&&t.forEach(function(e){hc(e,r)})}}function uc(i,r){if(i.set("timeline",r),i.isGroup()){var t=i.get("children");t.length&&t.forEach(function(e){uc(e,r)})}}function Ig(i,r,t){t===void 0&&(t=!0),t?r.destroy():(r.set("parent",null),r.set("canvas",null)),rc(i.getChildren(),r)}function Pg(i){return function(r,t){var e=i(r,t);return e===0?r[Mo]-t[Mo]:e}}var cc=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isCanvas=function(){return!1},r.prototype.getBBox=function(){var t=1/0,e=-1/0,n=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});l.length>0?(M(l,function(u){var c=u.getBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=Yt(o),e=Lt(o),n=Yt(s),a=Lt(s)):(t=0,e=0,n=0,a=0);var h={x:t,y:n,minX:t,minY:n,maxX:e,maxY:a,width:e-t,height:a-n};return h},r.prototype.getCanvasBBox=function(){var t=1/0,e=-1/0,n=1/0,a=-1/0,o=[],s=[],l=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});l.length>0?(M(l,function(u){var c=u.getCanvasBBox();o.push(c.minX,c.maxX),s.push(c.minY,c.maxY)}),t=Yt(o),e=Lt(o),n=Yt(s),a=Lt(s)):(t=0,e=0,n=0,a=0);var h={x:t,y:n,minX:t,minY:n,maxX:e,maxY:a,width:e-t,height:a-n};return h},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.children=[],t},r.prototype.onAttrChange=function(t,e,n){if(i.prototype.onAttrChange.call(this,t,e,n),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},r.prototype.applyMatrix=function(t){var e=this.getTotalMatrix();i.prototype.applyMatrix.call(this,t);var n=this.getTotalMatrix();n!==e&&this._applyChildrenMarix(n)},r.prototype._applyChildrenMarix=function(t){var e=this.getChildren();M(e,function(n){n.applyMatrix(t)})},r.prototype.addShape=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],a=t[1];rt(n)?a=n:a.type=n;var o=Sl[a.type];o||(o=dr(a.type),Sl[a.type]=o);var s=this.getShapeBase(),l=new s[o](a);return this.add(l),l},r.prototype.addGroup=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[0],a=t[1],o;if(G(n))a?o=new n(a):o=new n({parent:this});else{var s=n||{},l=this.getGroupBase();o=new l(s)}return this.add(o),o},r.prototype.getCanvas=function(){var t;return this.isCanvas()?t=this:t=this.get("canvas"),t},r.prototype.getShape=function(t,e,n){if(!Si(this))return null;var a=this.getChildren(),o;if(this.isCanvas())o=this._findShape(a,t,e,n);else{var s=[t,e,1];s=this.invertFromMatrix(s),this.isClipped(s[0],s[1])||(o=this._findShape(a,s[0],s[1],n))}return o},r.prototype._findShape=function(t,e,n,a){for(var o=null,s=t.length-1;s>=0;s--){var l=t[s];if(Si(l)&&(l.isGroup()?o=l.getShape(e,n,a):l.isHit(e,n)&&(o=l)),o)break}return o},r.prototype.add=function(t){var e=this.getCanvas(),n=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&Ig(o,t,!1),t.set("parent",this),e&&hc(t,e),a&&uc(t,a),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},r.prototype._applyElementMatrix=function(t){var e=this.getTotalMatrix();e&&t.applyMatrix(e)},r.prototype.getChildren=function(){return this.get("children")},r.prototype.sort=function(){var t=this.getChildren();M(t,function(e,n){return e[Mo]=n,e}),t.sort(Pg(function(e,n){return e.get("zIndex")-n.get("zIndex")})),this.onCanvasChange("sort")},r.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),e=t.length-1;e>=0;e--)t[e].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},r.prototype.destroy=function(){this.get("destroyed")||(this.clear(),i.prototype.destroy.call(this))},r.prototype.getFirst=function(){return this.getChildByIndex(0)},r.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},r.prototype.getChildByIndex=function(t){var e=this.getChildren();return e[t]},r.prototype.getCount=function(){var t=this.getChildren();return t.length},r.prototype.contain=function(t){var e=this.getChildren();return e.indexOf(t)>-1},r.prototype.removeChild=function(t,e){e===void 0&&(e=!0),this.contain(t)&&t.remove(e)},r.prototype.findAll=function(t){var e=[],n=this.getChildren();return M(n,function(a){t(a)&&e.push(a),a.isGroup()&&(e=e.concat(a.findAll(t)))}),e},r.prototype.find=function(t){var e=null,n=this.getChildren();return M(n,function(a){if(t(a)?e=a:a.isGroup()&&(e=a.find(t)),e)return!1}),e},r.prototype.findById=function(t){return this.find(function(e){return e.get("id")===t})},r.prototype.findByClassName=function(t){return this.find(function(e){return e.get("className")===t})},r.prototype.findAllByName=function(t){return this.findAll(function(e){return e.get("name")===t})},r}(lc),Dr=0,oi=0,Jr=0,fc=1e3,Dn,si,Rn=0,fr=0,sa=0,Ai=typeof performance=="object"&&performance.now?performance:Date,vc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(i){setTimeout(i,17)};function pc(){return fr||(vc(Fg),fr=Ai.now()+sa)}function Fg(){fr=0}function So(){this._call=this._time=this._next=null}So.prototype=gc.prototype={constructor:So,restart:function(i,r,t){if(typeof i!="function")throw new TypeError("callback is not a function");t=(t==null?pc():+t)+(r==null?0:+r),!this._next&&si!==this&&(si?si._next=this:Dn=this,si=this),this._call=i,this._time=t,bo()},stop:function(){this._call&&(this._call=null,this._time=1/0,bo())}};function gc(i,r,t){var e=new So;return e.restart(i,r,t),e}function Og(){pc(),++Dr;for(var i=Dn,r;i;)(r=fr-i._time)>=0&&i._call.call(null,r),i=i._next;--Dr}function bl(){fr=(Rn=Ai.now())+sa,Dr=oi=0;try{Og()}finally{Dr=0,Rg(),fr=0}}function Dg(){var i=Ai.now(),r=i-Rn;r>fc&&(sa-=r,Rn=i)}function Rg(){for(var i,r=Dn,t,e=1/0;r;)r._call?(e>r._time&&(e=r._time),i=r,r=r._next):(t=r._next,r._next=null,r=i?i._next=t:Dn=t);si=i,bo(e)}function bo(i){if(!Dr){oi&&(oi=clearTimeout(oi));var r=i-fr;r>24?(i<1/0&&(oi=setTimeout(bl,i-Ai.now()-sa)),Jr&&(Jr=clearInterval(Jr))):(Jr||(Rn=Ai.now(),Jr=setInterval(Dg,fc)),Dr=1,vc(bl))}}function ls(i,r,t){i.prototype=r.prototype=t,t.constructor=i}function dc(i,r){var t=Object.create(i.prototype);for(var e in r)t[e]=r[e];return t}function Xi(){}var Ti=.7,Yn=1/Ti,Ir="\\s*([+-]?\\d+)\\s*",Li="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Yg=/^#([0-9a-f]{3,8})$/,Gg=new RegExp(`^rgb\\(${Ir},${Ir},${Ir}\\)$`),Hg=new RegExp(`^rgb\\(${fe},${fe},${fe}\\)$`),Vg=new RegExp(`^rgba\\(${Ir},${Ir},${Ir},${Li}\\)$`),Ng=new RegExp(`^rgba\\(${fe},${fe},${fe},${Li}\\)$`),Xg=new RegExp(`^hsl\\(${Li},${fe},${fe}\\)$`),zg=new RegExp(`^hsla\\(${Li},${fe},${fe},${Li}\\)$`),Al={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ls(Xi,Ei,{copy(i){return Object.assign(new this.constructor,this,i)},displayable(){return this.rgb().displayable()},hex:Tl,formatHex:Tl,formatHex8:Wg,formatHsl:$g,formatRgb:Ll,toString:Ll});function Tl(){return this.rgb().formatHex()}function Wg(){return this.rgb().formatHex8()}function $g(){return yc(this).formatHsl()}function Ll(){return this.rgb().formatRgb()}function Ei(i){var r,t;return i=(i+"").trim().toLowerCase(),(r=Yg.exec(i))?(t=r[1].length,r=parseInt(r[1],16),t===6?El(r):t===3?new Ht(r>>8&15|r>>4&240,r>>4&15|r&240,(r&15)<<4|r&15,1):t===8?rn(r>>24&255,r>>16&255,r>>8&255,(r&255)/255):t===4?rn(r>>12&15|r>>8&240,r>>8&15|r>>4&240,r>>4&15|r&240,((r&15)<<4|r&15)/255):null):(r=Gg.exec(i))?new Ht(r[1],r[2],r[3],1):(r=Hg.exec(i))?new Ht(r[1]*255/100,r[2]*255/100,r[3]*255/100,1):(r=Vg.exec(i))?rn(r[1],r[2],r[3],r[4]):(r=Ng.exec(i))?rn(r[1]*255/100,r[2]*255/100,r[3]*255/100,r[4]):(r=Xg.exec(i))?Il(r[1],r[2]/100,r[3]/100,1):(r=zg.exec(i))?Il(r[1],r[2]/100,r[3]/100,r[4]):Al.hasOwnProperty(i)?El(Al[i]):i==="transparent"?new Ht(NaN,NaN,NaN,0):null}function El(i){return new Ht(i>>16&255,i>>8&255,i&255,1)}function rn(i,r,t,e){return e<=0&&(i=r=t=NaN),new Ht(i,r,t,e)}function _g(i){return i instanceof Xi||(i=Ei(i)),i?(i=i.rgb(),new Ht(i.r,i.g,i.b,i.opacity)):new Ht}function Ao(i,r,t,e){return arguments.length===1?_g(i):new Ht(i,r,t,e==null?1:e)}function Ht(i,r,t,e){this.r=+i,this.g=+r,this.b=+t,this.opacity=+e}ls(Ht,Ao,dc(Xi,{brighter(i){return i=i==null?Yn:Math.pow(Yn,i),new Ht(this.r*i,this.g*i,this.b*i,this.opacity)},darker(i){return i=i==null?Ti:Math.pow(Ti,i),new Ht(this.r*i,this.g*i,this.b*i,this.opacity)},rgb(){return this},clamp(){return new Ht(or(this.r),or(this.g),or(this.b),Gn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bl,formatHex:Bl,formatHex8:jg,formatRgb:kl,toString:kl}));function Bl(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}`}function jg(){return`#${ir(this.r)}${ir(this.g)}${ir(this.b)}${ir((isNaN(this.opacity)?1:this.opacity)*255)}`}function kl(){const i=Gn(this.opacity);return`${i===1?"rgb(":"rgba("}${or(this.r)}, ${or(this.g)}, ${or(this.b)}${i===1?")":`, ${i})`}`}function Gn(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function or(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function ir(i){return i=or(i),(i<16?"0":"")+i.toString(16)}function Il(i,r,t,e){return e<=0?i=r=t=NaN:t<=0||t>=1?i=r=NaN:r<=0&&(i=NaN),new ne(i,r,t,e)}function yc(i){if(i instanceof ne)return new ne(i.h,i.s,i.l,i.opacity);if(i instanceof Xi||(i=Ei(i)),!i)return new ne;if(i instanceof ne)return i;i=i.rgb();var r=i.r/255,t=i.g/255,e=i.b/255,n=Math.min(r,t,e),a=Math.max(r,t,e),o=NaN,s=a-n,l=(a+n)/2;return s?(r===a?o=(t-e)/s+(t<e)*6:t===a?o=(e-r)/s+2:o=(r-t)/s+4,s/=l<.5?a+n:2-a-n,o*=60):s=l>0&&l<1?0:o,new ne(o,s,l,i.opacity)}function Ug(i,r,t,e){return arguments.length===1?yc(i):new ne(i,r,t,e==null?1:e)}function ne(i,r,t,e){this.h=+i,this.s=+r,this.l=+t,this.opacity=+e}ls(ne,Ug,dc(Xi,{brighter(i){return i=i==null?Yn:Math.pow(Yn,i),new ne(this.h,this.s,this.l*i,this.opacity)},darker(i){return i=i==null?Ti:Math.pow(Ti,i),new ne(this.h,this.s,this.l*i,this.opacity)},rgb(){var i=this.h%360+(this.h<0)*360,r=isNaN(i)||isNaN(this.s)?0:this.s,t=this.l,e=t+(t<.5?t:1-t)*r,n=2*t-e;return new Ht(Na(i>=240?i-240:i+120,n,e),Na(i,n,e),Na(i<120?i+240:i-120,n,e),this.opacity)},clamp(){return new ne(Pl(this.h),nn(this.s),nn(this.l),Gn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const i=Gn(this.opacity);return`${i===1?"hsl(":"hsla("}${Pl(this.h)}, ${nn(this.s)*100}%, ${nn(this.l)*100}%${i===1?")":`, ${i})`}`}}));function Pl(i){return i=(i||0)%360,i<0?i+360:i}function nn(i){return Math.max(0,Math.min(1,i||0))}function Na(i,r,t){return(i<60?r+(t-r)*i/60:i<180?t:i<240?r+(t-r)*(240-i)/60:r)*255}const hs=i=>()=>i;function qg(i,r){return function(t){return i+t*r}}function Zg(i,r,t){return i=Math.pow(i,t),r=Math.pow(r,t)-i,t=1/t,function(e){return Math.pow(i+e*r,t)}}function Qg(i){return(i=+i)==1?mc:function(r,t){return t-r?Zg(r,t,i):hs(isNaN(r)?t:r)}}function mc(i,r){var t=r-i;return t?qg(i,t):hs(isNaN(i)?r:i)}const Fl=function i(r){var t=Qg(r);function e(n,a){var o=t((n=Ao(n)).r,(a=Ao(a)).r),s=t(n.g,a.g),l=t(n.b,a.b),h=mc(n.opacity,a.opacity);return function(u){return n.r=o(u),n.g=s(u),n.b=l(u),n.opacity=h(u),n+""}}return e.gamma=i,e}(1);function xc(i,r){r||(r=[]);var t=i?Math.min(r.length,i.length):0,e=r.slice(),n;return function(a){for(n=0;n<t;++n)e[n]=i[n]*(1-a)+r[n]*a;return e}}function wc(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function Kg(i,r){return(wc(r)?xc:Cc)(i,r)}function Cc(i,r){var t=r?r.length:0,e=i?Math.min(t,i.length):0,n=new Array(e),a=new Array(t),o;for(o=0;o<e;++o)n[o]=Hn(i[o],r[o]);for(;o<t;++o)a[o]=r[o];return function(s){for(o=0;o<e;++o)a[o]=n[o](s);return a}}function Jg(i,r){var t=new Date;return i=+i,r=+r,function(e){return t.setTime(i*(1-e)+r*e),t}}function To(i,r){return i=+i,r=+r,function(t){return i*(1-t)+r*t}}function td(i,r){var t={},e={},n;(i===null||typeof i!="object")&&(i={}),(r===null||typeof r!="object")&&(r={});for(n in r)n in i?t[n]=Hn(i[n],r[n]):e[n]=r[n];return function(a){for(n in t)e[n]=t[n](a);return e}}var Lo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xa=new RegExp(Lo.source,"g");function ed(i){return function(){return i}}function rd(i){return function(r){return i(r)+""}}function id(i,r){var t=Lo.lastIndex=Xa.lastIndex=0,e,n,a,o=-1,s=[],l=[];for(i=i+"",r=r+"";(e=Lo.exec(i))&&(n=Xa.exec(r));)(a=n.index)>t&&(a=r.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(e=e[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:To(e,n)})),t=Xa.lastIndex;return t<r.length&&(a=r.slice(t),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?rd(l[0].x):ed(r):(r=l.length,function(h){for(var u=0,c;u<r;++u)s[(c=l[u]).i]=c.x(h);return s.join("")})}function Hn(i,r){var t=typeof r,e;return r==null||t==="boolean"?hs(r):(t==="number"?To:t==="string"?(e=Ei(r))?(r=e,Fl):id:r instanceof Ei?Fl:r instanceof Date?Jg:wc(r)?xc:Array.isArray(r)?Cc:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?td:To)(i,r)}function nd(i){return+i}function ad(i){return i*i}function od(i){return i*(2-i)}function Ol(i){return((i*=2)<=1?i*i:--i*(2-i)+1)/2}function sd(i){return i*i*i}function ld(i){return--i*i*i+1}function Dl(i){return((i*=2)<=1?i*i*i:(i-=2)*i*i+2)/2}var us=3,hd=function i(r){r=+r;function t(e){return Math.pow(e,r)}return t.exponent=i,t}(us),ud=function i(r){r=+r;function t(e){return 1-Math.pow(1-e,r)}return t.exponent=i,t}(us),Rl=function i(r){r=+r;function t(e){return((e*=2)<=1?Math.pow(e,r):2-Math.pow(2-e,r))/2}return t.exponent=i,t}(us),Mc=Math.PI,Sc=Mc/2;function cd(i){return+i==1?1:1-Math.cos(i*Sc)}function fd(i){return Math.sin(i*Sc)}function Yl(i){return(1-Math.cos(Mc*i))/2}function We(i){return(Math.pow(2,-10*i)-.0009765625)*1.0009775171065494}function vd(i){return We(1-+i)}function pd(i){return 1-We(i)}function Gl(i){return((i*=2)<=1?We(1-i):2-We(i-1))/2}function gd(i){return 1-Math.sqrt(1-i*i)}function dd(i){return Math.sqrt(1- --i*i)}function Hl(i){return((i*=2)<=1?1-Math.sqrt(1-i*i):Math.sqrt(1-(i-=2)*i)+1)/2}var Eo=4/11,yd=6/11,md=8/11,xd=3/4,wd=9/11,Cd=10/11,Md=15/16,Sd=21/22,bd=63/64,an=1/Eo/Eo;function Ad(i){return 1-Bi(1-i)}function Bi(i){return(i=+i)<Eo?an*i*i:i<md?an*(i-=yd)*i+xd:i<Cd?an*(i-=wd)*i+Md:an*(i-=Sd)*i+bd}function Td(i){return((i*=2)<=1?1-Bi(1-i):Bi(i-1)+1)/2}var cs=1.70158,Ld=function i(r){r=+r;function t(e){return(e=+e)*e*(r*(e-1)+e)}return t.overshoot=i,t}(cs),Ed=function i(r){r=+r;function t(e){return--e*e*((e+1)*r+e)+1}return t.overshoot=i,t}(cs),Vl=function i(r){r=+r;function t(e){return((e*=2)<1?e*e*((r+1)*e-r):(e-=2)*e*((r+1)*e+r)+2)/2}return t.overshoot=i,t}(cs),Rr=2*Math.PI,fs=1,vs=.3,Bd=function i(r,t){var e=Math.asin(1/(r=Math.max(1,r)))*(t/=Rr);function n(a){return r*We(- --a)*Math.sin((e-a)/t)}return n.amplitude=function(a){return i(a,t*Rr)},n.period=function(a){return i(r,a)},n}(fs,vs),Nl=function i(r,t){var e=Math.asin(1/(r=Math.max(1,r)))*(t/=Rr);function n(a){return 1-r*We(a=+a)*Math.sin((a+e)/t)}return n.amplitude=function(a){return i(a,t*Rr)},n.period=function(a){return i(r,a)},n}(fs,vs),kd=function i(r,t){var e=Math.asin(1/(r=Math.max(1,r)))*(t/=Rr);function n(a){return((a=a*2-1)<0?r*We(-a)*Math.sin((e-a)/t):2-r*We(a)*Math.sin((e+a)/t))/2}return n.amplitude=function(a){return i(a,t*Rr)},n.period=function(a){return i(r,a)},n}(fs,vs);const Id=Object.freeze(Object.defineProperty({__proto__:null,easeLinear:nd,easeQuad:Ol,easeQuadIn:ad,easeQuadOut:od,easeQuadInOut:Ol,easeCubic:Dl,easeCubicIn:sd,easeCubicOut:ld,easeCubicInOut:Dl,easePoly:Rl,easePolyIn:hd,easePolyOut:ud,easePolyInOut:Rl,easeSin:Yl,easeSinIn:cd,easeSinOut:fd,easeSinInOut:Yl,easeExp:Gl,easeExpIn:vd,easeExpOut:pd,easeExpInOut:Gl,easeCircle:Hl,easeCircleIn:gd,easeCircleOut:dd,easeCircleInOut:Hl,easeBounce:Bi,easeBounceIn:Ad,easeBounceOut:Bi,easeBounceInOut:Td,easeBack:Vl,easeBackIn:Ld,easeBackOut:Ed,easeBackInOut:Vl,easeElastic:Nl,easeElasticIn:Bd,easeElasticOut:Nl,easeElasticInOut:kd},Symbol.toStringTag,{value:"Module"}));var bc={};function Pd(i){return bc[i.toLowerCase()]||Id[i]}function Ac(i,r){bc[i.toLowerCase()]=r}var Fd=function(i){return["fill","stroke","fillStyle","strokeStyle"].includes(i)},Od=function(i){return/^[r,R,L,l]{1}[\s]*\(/.test(i)},Xl=[1,0,0,0,1,0,0,0,1];function Dd(i,r,t){var e={},n=r.fromAttrs,a=r.toAttrs;if(!i.destroyed){var o;for(var s in a)if(!gt(n[s],a[s]))if(s==="path"){var l=a[s],h=n[s];l.length>h.length?(l=Tr(a[s]),h=Tr(n[s]),h=tc(h,l),h=wo(h,l),r.fromAttrs.path=h,r.toAttrs.path=l):r.pathFormatted||(l=Tr(a[s]),h=Tr(n[s]),h=wo(h,l),r.fromAttrs.path=h,r.toAttrs.path=l,r.pathFormatted=!0),e[s]=[];for(var u=0;u<l.length;u++){for(var c=l[u],f=h[u],v=[],p=0;p<c.length;p++)U(c[p])&&f&&U(f[p])?(o=Hn(f[p],c[p]),v.push(o(t))):v.push(c[p]);e[s].push(v)}}else if(s==="matrix"){var g=Kg(n[s]||Xl,a[s]||Xl),d=g(t);e[s]=d}else Fd(s)&&Od(a[s])?e[s]=a[s]:G(a[s])||(o=Hn(n[s],a[s]),e[s]=o(t));i.attr(e)}}function Rd(i,r,t){var e=r.startTime,n=r.delay;if(t<e+n||r._paused)return!1;var a,o=r.duration,s=r.easing,l=Pd(s);if(t=t-e-r.delay,r.repeat)a=t%o/o,a=l(a);else if(a=t/o,a<1)a=l(a);else return r.onFrame?i.attr(r.onFrame(1)):i.attr(r.toAttrs),!0;if(r.onFrame){var h=r.onFrame(a);i.attr(h)}else Dd(i,r,a);return!1}var Yd=function(){function i(r){this.animators=[],this.current=0,this.timer=null,this.canvas=r}return i.prototype.initTimer=function(){var r=this,t=!1,e,n,a;this.timer=gc(function(o){if(r.current=o,r.animators.length>0){for(var s=r.animators.length-1;s>=0;s--){if(e=r.animators[s],e.destroyed){r.removeAnimator(s);continue}if(!e.isAnimatePaused()){n=e.get("animations");for(var l=n.length-1;l>=0;l--)a=n[l],t=Rd(e,a,o),t&&(n.splice(l,1),t=!1,a.callback&&a.callback())}n.length===0&&r.removeAnimator(s)}var h=r.canvas.get("autoDraw");h||r.canvas.draw()}})},i.prototype.addAnimator=function(r){this.animators.push(r)},i.prototype.removeAnimator=function(r){this.animators.splice(r,1)},i.prototype.isAnimating=function(){return!!this.animators.length},i.prototype.stop=function(){this.timer&&this.timer.stop()},i.prototype.stopAllAnimations=function(r){r===void 0&&(r=!0),this.animators.forEach(function(t){t.stopAnimate(r)}),this.animators=[],this.canvas.draw()},i.prototype.getTime=function(){return this.current},i}(),Gd=40,zl=0,Wl=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function $l(i,r,t){t.name=r,t.target=i,t.currentTarget=i,t.delegateTarget=i,i.emit(r,t)}function Hd(i,r,t){if(t.bubbles){var e=void 0,n=!1;if(r==="mouseenter"?(e=t.fromShape,n=!0):r==="mouseleave"&&(n=!0,e=t.toShape),i.isCanvas()&&n)return;if(e&&ic(i,e)){t.bubbles=!1;return}t.name=r,t.currentTarget=i,t.delegateTarget=i,i.emit(r,t)}}var Vd=function(){function i(r){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(e){var n=e.type;t._triggerEvent(n,e)},this._onDocumentMove=function(e){var n=t.canvas,a=n.get("el");if(a!==e.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(e);t.dragging&&t._emitEvent("drag",e,o,t.draggingShape)}},this._onDocumentMouseUp=function(e){var n=t.canvas,a=n.get("el");if(a!==e.target&&t.dragging){var o=t._getPointInfo(e);t.draggingShape&&t._emitEvent("drop",e,o,null),t._emitEvent("dragend",e,o,t.draggingShape),t._afterDrag(t.draggingShape,o,e)}},this.canvas=r.canvas}return i.prototype.init=function(){this._bindEvents()},i.prototype._bindEvents=function(){var r=this,t=this.canvas.get("el");M(Wl,function(e){t.addEventListener(e,r._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._clearEvents=function(){var r=this,t=this.canvas.get("el");M(Wl,function(e){t.removeEventListener(e,r._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._getEventObj=function(r,t,e,n,a,o){var s=new Ni(r,t);return s.fromShape=a,s.toShape=o,s.x=e.x,s.y=e.y,s.clientX=e.clientX,s.clientY=e.clientY,s.propagationPath.push(n),s},i.prototype._getShape=function(r,t){return this.canvas.getShape(r.x,r.y,t)},i.prototype._getPointInfo=function(r){var t=this.canvas,e=t.getClientByEvent(r),n=t.getPointByEvent(r);return{x:n.x,y:n.y,clientX:e.x,clientY:e.y}},i.prototype._triggerEvent=function(r,t){var e=this._getPointInfo(t),n=this._getShape(e,t),a=this["_on"+r],o=!1;if(a)a.call(this,e,n,t);else{var s=this.currentShape;r==="mouseenter"||r==="dragenter"||r==="mouseover"?(this._emitEvent(r,t,e,null,null,n),n&&this._emitEvent(r,t,e,n,null,n),r==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,e,null)):r==="mouseleave"||r==="dragleave"||r==="mouseout"?(o=!0,s&&this._emitEvent(r,t,e,s,s,null),this._emitEvent(r,t,e,null,s,null),r==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,e,null)):this._emitEvent(r,t,e,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var l=this.canvas,h=l.get("el");h.style.cursor=n.attr("cursor")||l.get("cursor")}},i.prototype._onmousedown=function(r,t,e){e.button===zl&&(this.mousedownShape=t,this.mousedownPoint=r,this.mousedownTimeStamp=e.timeStamp),this._emitEvent("mousedown",e,r,t,null,null)},i.prototype._emitMouseoverEvents=function(r,t,e,n){var a=this.canvas.get("el");e!==n&&(e&&(this._emitEvent("mouseout",r,t,e,e,n),this._emitEvent("mouseleave",r,t,e,e,n),(!n||n.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",r,t,n,e,n),this._emitEvent("mouseenter",r,t,n,e,n)))},i.prototype._emitDragoverEvents=function(r,t,e,n,a){n?(n!==e&&(e&&this._emitEvent("dragleave",r,t,e,e,n),this._emitEvent("dragenter",r,t,n,e,n)),a||this._emitEvent("dragover",r,t,n)):e&&this._emitEvent("dragleave",r,t,e,e,n),a&&this._emitEvent("dragover",r,t,n)},i.prototype._afterDrag=function(r,t,e){r&&(r.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(t,e);n!==r&&this._emitMouseoverEvents(e,t,r,n),this.currentShape=n},i.prototype._onmouseup=function(r,t,e){if(e.button===zl){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",e,r,t),this._emitEvent("dragend",e,r,n),this._afterDrag(n,r,e)):(this._emitEvent("mouseup",e,r,t),t===this.mousedownShape&&this._emitEvent("click",e,r,t),this.mousedownShape=null,this.mousedownPoint=null)}},i.prototype._ondragover=function(r,t,e){e.preventDefault();var n=this.currentShape;this._emitDragoverEvents(e,r,n,t,!0)},i.prototype._onmousemove=function(r,t,e){var n=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(e,r,a,t,!1),this._emitEvent("drag",e,r,o);else{var s=this.mousedownPoint;if(s){var l=this.mousedownShape,h=e.timeStamp,u=h-this.mousedownTimeStamp,c=s.clientX-r.clientX,f=s.clientY-r.clientY,v=c*c+f*f;u>120||v>Gd?l&&l.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",e,r,o),this.mousedownShape=null,this.mousedownPoint=null):!l&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",e,r,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t)):(this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t))}else this._emitMouseoverEvents(e,r,a,t),this._emitEvent("mousemove",e,r,t)}},i.prototype._emitEvent=function(r,t,e,n,a,o){var s=this._getEventObj(r,t,e,n,a,o);if(n){s.shape=n,$l(n,r,s);for(var l=n.getParent();l;)l.emitDelegation(r,s),s.propagationStopped||Hd(l,r,s),s.propagationPath.push(l),l=l.getParent()}else{var h=this.canvas;$l(h,r,s)}},i.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},i}(),_l="px",jl=nc(),Nd=jl&&jl.name==="firefox",la=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.initContainer(),e.initDom(),e.initEvents(),e.initTimeline(),e}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},r.prototype.initContainer=function(){var t=this.get("container");N(t)&&(t=document.getElementById(t),this.set("container",t))},r.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var e=this.get("container");e.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},r.prototype.initEvents=function(){var t=new Vd({canvas:this});t.init(),this.set("eventController",t)},r.prototype.initTimeline=function(){var t=new Yd(this);this.set("timeline",t)},r.prototype.setDOMSize=function(t,e){var n=this.get("el");yl&&(n.style.width=t+_l,n.style.height=e+_l)},r.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},r.prototype.getRenderer=function(){return this.get("renderer")},r.prototype.getCursor=function(){return this.get("cursor")},r.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");yl&&e&&(e.style.cursor=t)},r.prototype.getPointByEvent=function(t){var e=this.get("supportCSSTransform");if(e){if(Nd&&!I(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!I(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var n=this.getClientByEvent(t),a=n.x,o=n.y;return this.getPointByClient(a,o)},r.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(t.type==="touchend"?e=t.changedTouches[0]:e=t.touches[0]),{x:e.clientX,y:e.clientY}},r.prototype.getPointByClient=function(t,e){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t-a.left,y:e-a.top}},r.prototype.getClientByPoint=function(t,e){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t+a.left,y:e+a.top}},r.prototype.draw=function(){},r.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},r.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},r.prototype.isCanvas=function(){return!0},r.prototype.getParent=function(){return null},r.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),i.prototype.destroy.call(this))},r}(cc),ha=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isGroup=function(){return!0},r.prototype.isEntityGroup=function(){return!1},r.prototype.clone=function(){for(var t=i.prototype.clone.call(this),e=this.getChildren(),n=0;n<e.length;n++){var a=e[n];t.add(a.clone())}return t},r}(cc),ua=function(i){E(r,i);function r(t){return i.call(this,t)||this}return r.prototype._isInBBox=function(t,e){var n=this.getBBox();return n.minX<=t&&n.maxX>=t&&n.minY<=e&&n.maxY>=e},r.prototype.afterAttrsChange=function(t){i.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},r.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},r.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},r.prototype.applyMatrix=function(t){i.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},r.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),e=this.getTotalMatrix(),n=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(e){var l=xe(e,[t.minX,t.minY]),h=xe(e,[t.maxX,t.minY]),u=xe(e,[t.minX,t.maxY]),c=xe(e,[t.maxX,t.maxY]);n=Math.min(l[0],h[0],u[0],c[0]),o=Math.max(l[0],h[0],u[0],c[0]),a=Math.min(l[1],h[1],u[1],c[1]),s=Math.max(l[1],h[1],u[1],c[1])}var f=this.attrs;if(f.shadowColor){var v=f.shadowBlur,p=v===void 0?0:v,g=f.shadowOffsetX,d=g===void 0?0:g,y=f.shadowOffsetY,C=y===void 0?0:y,m=n-p+d,x=o+p+d,S=a-p+C,b=s+p+C;n=Math.min(n,m),o=Math.max(o,x),a=Math.min(a,S),s=Math.max(s,b)}return{x:n,y:a,minX:n,minY:a,maxX:o,maxY:s,width:o-n,height:s-a}},r.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},r.prototype.isClipShape=function(){return this.get("isClipShape")},r.prototype.isInShape=function(t,e){return!1},r.prototype.isOnlyHitBox=function(){return!1},r.prototype.isHit=function(t,e){var n=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,e,1];o=this.invertFromMatrix(o);var s=o[0],l=o[1],h=this._isInBBox(s,l);return this.isOnlyHitBox()?h:!!(h&&!this.isClipped(s,l)&&(this.isInShape(s,l)||n&&n.isHit(s,l)||a&&a.isHit(s,l)))},r}(lc),Tc=new Map;function Kt(i,r){Tc.set(i,r)}function ca(i){return Tc.get(i)}function Lc(i){var r=i.attr(),t=r.x,e=r.y,n=r.width,a=r.height;return{x:t,y:e,width:n,height:a}}function Ec(i){var r=i.attr(),t=r.x,e=r.y,n=r.r;return{x:t-n,y:e-n,width:n*2,height:n*2}}function Tt(i,r,t,e){var n=i-t,a=r-e;return Math.sqrt(n*n+a*a)}function En(i,r){return Math.abs(i-r)<.001}function zr(i,r){var t=Yt(i),e=Yt(r),n=Lt(i),a=Lt(r);return{x:t,y:e,width:n-t,height:a-e}}function fa(i){return(i+Math.PI*2)%(Math.PI*2)}const wt={box:function(i,r,t,e){return zr([i,t],[r,e])},length:function(i,r,t,e){return Tt(i,r,t,e)},pointAt:function(i,r,t,e,n){return{x:(1-n)*i+n*t,y:(1-n)*r+n*e}},pointDistance:function(i,r,t,e,n,a){var o=(t-i)*(n-i)+(e-r)*(a-r);if(o<0)return Tt(i,r,n,a);var s=(t-i)*(t-i)+(e-r)*(e-r);return o>s?Tt(t,e,n,a):this.pointToLine(i,r,t,e,n,a)},pointToLine:function(i,r,t,e,n,a){var o=[t-i,e-r];if(wg(o,[0,0]))return Math.sqrt((n-i)*(n-i)+(a-r)*(a-r));var s=[-o[1],o[0]];oc(s,s);var l=[n-i,a-r];return Math.abs(mg(l,s))},tangentAngle:function(i,r,t,e){return Math.atan2(e-r,t-i)}};var Xd=1e-4;function Bc(i,r,t,e,n,a){var o,s=1/0,l=[t,e],h=20;a&&a>200&&(h=a/10);for(var u=1/h,c=u/10,f=0;f<=h;f++){var v=f*u,p=[n.apply(null,i.concat([v])),n.apply(null,r.concat([v]))],g=Tt(l[0],l[1],p[0],p[1]);g<s&&(o=v,s=g)}if(o===0)return{x:i[0],y:r[0]};if(o===1){var d=i.length;return{x:i[d-1],y:r[d-1]}}s=1/0;for(var f=0;f<32&&!(c<Xd);f++){var y=o-c,C=o+c,p=[n.apply(null,i.concat([y])),n.apply(null,r.concat([y]))],g=Tt(l[0],l[1],p[0],p[1]);if(y>=0&&g<s)o=y,s=g;else{var m=[n.apply(null,i.concat([C])),n.apply(null,r.concat([C]))],x=Tt(l[0],l[1],m[0],m[1]);C<=1&&x<s?(o=C,s=x):c*=.5}}return{x:n.apply(null,i.concat([o])),y:n.apply(null,r.concat([o]))}}function zd(i,r){for(var t=0,e=i.length,n=0;n<e;n++){var a=i[n],o=r[n],s=i[(n+1)%e],l=r[(n+1)%e];t+=Tt(a,o,s,l)}return t/2}function Fe(i,r,t,e){var n=1-e;return n*n*i+2*e*n*r+e*e*t}function Ul(i,r,t){var e=i+t-2*r;if(En(e,0))return[.5];var n=(i-r)/e;return n<=1&&n>=0?[n]:[]}function ql(i,r,t,e){return 2*(1-e)*(r-i)+2*e*(t-r)}function kc(i,r,t,e,n,a,o){var s=Fe(i,t,n,o),l=Fe(r,e,a,o),h=wt.pointAt(i,r,t,e,o),u=wt.pointAt(t,e,n,a,o);return[[i,r,h.x,h.y,s,l],[s,l,u.x,u.y,n,a]]}function Bo(i,r,t,e,n,a,o){if(o===0)return(Tt(i,r,t,e)+Tt(t,e,n,a)+Tt(i,r,n,a))/2;var s=kc(i,r,t,e,n,a,.5),l=s[0],h=s[1];return l.push(o-1),h.push(o-1),Bo.apply(null,l)+Bo.apply(null,h)}const Ic={box:function(i,r,t,e,n,a){var o=Ul(i,t,n)[0],s=Ul(r,e,a)[0],l=[i,n],h=[r,a];return o!==void 0&&l.push(Fe(i,t,n,o)),s!==void 0&&h.push(Fe(r,e,a,s)),zr(l,h)},length:function(i,r,t,e,n,a){return Bo(i,r,t,e,n,a,3)},nearestPoint:function(i,r,t,e,n,a,o,s){return Bc([i,t,n],[r,e,a],o,s,Fe)},pointDistance:function(i,r,t,e,n,a,o,s){var l=this.nearestPoint(i,r,t,e,n,a,o,s);return Tt(l.x,l.y,o,s)},interpolationAt:Fe,pointAt:function(i,r,t,e,n,a,o){return{x:Fe(i,t,n,o),y:Fe(r,e,a,o)}},divide:function(i,r,t,e,n,a,o){return kc(i,r,t,e,n,a,o)},tangentAngle:function(i,r,t,e,n,a,o){var s=ql(i,t,n,o),l=ql(r,e,a,o),h=Math.atan2(l,s);return fa(h)}};function Oe(i,r,t,e,n){var a=1-n;return a*a*a*i+3*r*n*a*a+3*t*n*n*a+e*n*n*n}function Zl(i,r,t,e,n){var a=1-n;return 3*(a*a*(r-i)+2*a*n*(t-r)+n*n*(e-t))}function za(i,r,t,e){var n=-3*i+9*r-9*t+3*e,a=6*i-12*r+6*t,o=3*r-3*i,s=[],l,h,u;if(En(n,0))En(a,0)||(l=-o/a,l>=0&&l<=1&&s.push(l));else{var c=a*a-4*n*o;En(c,0)?s.push(-a/(2*n)):c>0&&(u=Math.sqrt(c),l=(-a+u)/(2*n),h=(-a-u)/(2*n),l>=0&&l<=1&&s.push(l),h>=0&&h<=1&&s.push(h))}return s}function Pc(i,r,t,e,n,a,o,s,l){var h=Oe(i,t,n,o,l),u=Oe(r,e,a,s,l),c=wt.pointAt(i,r,t,e,l),f=wt.pointAt(t,e,n,a,l),v=wt.pointAt(n,a,o,s,l),p=wt.pointAt(c.x,c.y,f.x,f.y,l),g=wt.pointAt(f.x,f.y,v.x,v.y,l);return[[i,r,c.x,c.y,p.x,p.y,h,u],[h,u,g.x,g.y,v.x,v.y,o,s]]}function ko(i,r,t,e,n,a,o,s,l){if(l===0)return zd([i,t,n,o],[r,e,a,s]);var h=Pc(i,r,t,e,n,a,o,s,.5),u=h[0],c=h[1];return u.push(l-1),c.push(l-1),ko.apply(null,u)+ko.apply(null,c)}const ci={extrema:za,box:function(i,r,t,e,n,a,o,s){for(var l=[i,o],h=[r,s],u=za(i,t,n,o),c=za(r,e,a,s),f=0;f<u.length;f++)l.push(Oe(i,t,n,o,u[f]));for(var f=0;f<c.length;f++)h.push(Oe(r,e,a,s,c[f]));return zr(l,h)},length:function(i,r,t,e,n,a,o,s){return ko(i,r,t,e,n,a,o,s,3)},nearestPoint:function(i,r,t,e,n,a,o,s,l,h,u){return Bc([i,t,n,o],[r,e,a,s],l,h,Oe,u)},pointDistance:function(i,r,t,e,n,a,o,s,l,h,u){var c=this.nearestPoint(i,r,t,e,n,a,o,s,l,h,u);return Tt(c.x,c.y,l,h)},interpolationAt:Oe,pointAt:function(i,r,t,e,n,a,o,s,l){return{x:Oe(i,t,n,o,l),y:Oe(r,e,a,s,l)}},divide:function(i,r,t,e,n,a,o,s,l){return Pc(i,r,t,e,n,a,o,s,l)},tangentAngle:function(i,r,t,e,n,a,o,s,l){var h=Zl(i,t,n,o,l),u=Zl(r,e,a,s,l);return fa(Math.atan2(u,h))}};function Ql(i,r){var t=Math.abs(i);return r>0?t:t*-1}const Wd={box:function(i,r,t,e){return{x:i-t,y:r-e,width:t*2,height:e*2}},length:function(i,r,t,e){return Math.PI*(3*(t+e)-Math.sqrt((3*t+e)*(t+3*e)))},nearestPoint:function(i,r,t,e,n,a){var o=t,s=e;if(o===0||s===0)return{x:i,y:r};for(var l=n-i,h=a-r,u=Math.abs(l),c=Math.abs(h),f=o*o,v=s*s,p=Math.PI/4,g,d,y=0;y<4;y++){g=o*Math.cos(p),d=s*Math.sin(p);var C=(f-v)*Math.pow(Math.cos(p),3)/o,m=(v-f)*Math.pow(Math.sin(p),3)/s,x=g-C,S=d-m,b=u-C,A=c-m,L=Math.hypot(S,x),k=Math.hypot(A,b),B=L*Math.asin((x*A-S*b)/(L*k)),O=B/Math.sqrt(f+v-g*g-d*d);p+=O,p=Math.min(Math.PI/2,Math.max(0,p))}return{x:i+Ql(g,l),y:r+Ql(d,h)}},pointDistance:function(i,r,t,e,n,a){var o=this.nearestPoint(i,r,t,e,n,a);return Tt(o.x,o.y,n,a)},pointAt:function(i,r,t,e,n){var a=2*Math.PI*n;return{x:i+t*Math.cos(a),y:r+e*Math.sin(a)}},tangentAngle:function(i,r,t,e,n){var a=2*Math.PI*n,o=Math.atan2(e*Math.cos(a),-t*Math.sin(a));return fa(o)}};function $d(i,r,t,e,n,a,o,s){return-1*t*Math.cos(n)*Math.sin(s)-e*Math.sin(n)*Math.cos(s)}function _d(i,r,t,e,n,a,o,s){return-1*t*Math.sin(n)*Math.sin(s)+e*Math.cos(n)*Math.cos(s)}function jd(i,r,t){return Math.atan(-r/i*Math.tan(t))}function Ud(i,r,t){return Math.atan(r/(i*Math.tan(t)))}function Kl(i,r,t,e,n,a){return t*Math.cos(n)*Math.cos(a)-e*Math.sin(n)*Math.sin(a)+i}function Jl(i,r,t,e,n,a){return t*Math.sin(n)*Math.cos(a)+e*Math.cos(n)*Math.sin(a)+r}function qd(i,r,t,e){var n=Math.atan2(e*i,t*r);return(n+Math.PI*2)%(Math.PI*2)}function th(i,r,t){return{x:i*Math.cos(t),y:r*Math.sin(t)}}function eh(i,r,t){var e=Math.cos(t),n=Math.sin(t);return[i*e-r*n,i*n+r*e]}const Zd={box:function(i,r,t,e,n,a,o){for(var s=jd(t,e,n),l=1/0,h=-1/0,u=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var f=s+c;a<o?a<f&&f<o&&u.push(f):o<f&&f<a&&u.push(f)}for(var c=0;c<u.length;c++){var v=Kl(i,r,t,e,n,u[c]);v<l&&(l=v),v>h&&(h=v)}for(var p=Ud(t,e,n),g=1/0,d=-1/0,y=[a,o],c=-Math.PI*2;c<=Math.PI*2;c+=Math.PI){var C=p+c;a<o?a<C&&C<o&&y.push(C):o<C&&C<a&&y.push(C)}for(var c=0;c<y.length;c++){var m=Jl(i,r,t,e,n,y[c]);m<g&&(g=m),m>d&&(d=m)}return{x:l,y:g,width:h-l,height:d-g}},length:function(i,r,t,e,n,a,o){},nearestPoint:function(i,r,t,e,n,a,o,s,l){var h=eh(s-i,l-r,-n),u=h[0],c=h[1],f=Wd.nearestPoint(0,0,t,e,u,c),v=qd(t,e,f.x,f.y);v<a?f=th(t,e,a):v>o&&(f=th(t,e,o));var p=eh(f.x,f.y,n);return{x:p[0]+i,y:p[1]+r}},pointDistance:function(i,r,t,e,n,a,o,s,l){var h=this.nearestPoint(i,r,t,e,s,l);return Tt(h.x,h.y,s,l)},pointAt:function(i,r,t,e,n,a,o,s){var l=(o-a)*s+a;return{x:Kl(i,r,t,e,n,l),y:Jl(i,r,t,e,n,l)}},tangentAngle:function(i,r,t,e,n,a,o,s){var l=(o-a)*s+a,h=$d(i,r,t,e,n,a,o,l),u=_d(i,r,t,e,n,a,o,l);return fa(Math.atan2(u,h))}};function Fc(i){for(var r=0,t=[],e=0;e<i.length-1;e++){var n=i[e],a=i[e+1],o=Tt(n[0],n[1],a[0],a[1]),s={from:n,to:a,length:o};t.push(s),r+=o}return{segments:t,totalLength:r}}function Qd(i){if(i.length<2)return 0;for(var r=0,t=0;t<i.length-1;t++){var e=i[t],n=i[t+1];r+=Tt(e[0],e[1],n[0],n[1])}return r}function Kd(i,r){if(r>1||r<0||i.length<2)return null;var t=Fc(i),e=t.segments,n=t.totalLength;if(n===0)return{x:i[0][0],y:i[0][1]};for(var a=0,o=null,s=0;s<e.length;s++){var l=e[s],h=l.from,u=l.to,c=l.length/n;if(r>=a&&r<=a+c){var f=(r-a)/c;o=wt.pointAt(h[0],h[1],u[0],u[1],f);break}a+=c}return o}function Jd(i,r){if(r>1||r<0||i.length<2)return 0;for(var t=Fc(i),e=t.segments,n=t.totalLength,a=0,o=0,s=0;s<e.length;s++){var l=e[s],h=l.from,u=l.to,c=l.length/n;if(r>=a&&r<=a+c){o=Math.atan2(u[1]-h[1],u[0]-h[0]);break}a+=c}return o}function ty(i,r,t){for(var e=1/0,n=0;n<i.length-1;n++){var a=i[n],o=i[n+1],s=wt.pointDistance(a[0],a[1],o[0],o[1],r,t);s<e&&(e=s)}return e}const Oc={box:function(i){for(var r=[],t=[],e=0;e<i.length;e++){var n=i[e];r.push(n[0]),t.push(n[1])}return zr(r,t)},length:function(i){return Qd(i)},pointAt:function(i,r){return Kd(i,r)},pointDistance:function(i,r,t){return ty(i,r,t)},tangentAngle:function(i,r){return Jd(i,r)}};function rh(i,r){return!i||!r?i||r:{minX:Math.min(i.minX,r.minX),minY:Math.min(i.minY,r.minY),maxX:Math.max(i.maxX,r.maxX),maxY:Math.max(i.maxY,r.maxY)}}function ps(i,r){var t=i.get("startArrowShape"),e=i.get("endArrowShape"),n=null,a=null;return t&&(n=t.getCanvasBBox(),r=rh(r,n)),e&&(a=e.getCanvasBBox(),r=rh(r,a)),r}function ey(i){for(var r=i.attr(),t=r.points,e=[],n=[],a=0;a<t.length;a++){var o=t[a];e.push(o[0]),n.push(o[1])}var s=zr(e,n),l=s.x,h=s.y,u=s.width,c=s.height,f={minX:l,minY:h,maxX:l+u,maxY:h+c};return f=ps(i,f),{x:f.minX,y:f.minY,width:f.maxX-f.minX,height:f.maxY-f.minY}}function ry(i){for(var r=i.attr(),t=r.points,e=[],n=[],a=0;a<t.length;a++){var o=t[a];e.push(o[0]),n.push(o[1])}return zr(e,n)}var Wa=null;function va(){if(!Wa){var i=document.createElement("canvas");i.width=1,i.height=1,Wa=i.getContext("2d")}return Wa}function pa(i,r,t){var e=1;if(N(i)&&(e=i.split(`
`).length),e>1){var n=iy(r,t);return r*e+n*(e-1)}return r}function iy(i,r){return r?r-i:i*.14}function ny(i,r){var t=va(),e=0;if(I(i)||i==="")return e;if(t.save(),t.font=r,N(i)&&i.includes(`
`)){var n=i.split(`
`);M(n,function(a){var o=t.measureText(a).width;e<o&&(e=o)})}else e=t.measureText(i).width;return t.restore(),e}function ga(i){var r=i.fontSize,t=i.fontFamily,e=i.fontWeight,n=i.fontStyle,a=i.fontVariant;return[n,a,e,r+"px",t].join(" ").trim()}function ay(i){var r=i.attr(),t=r.x,e=r.y,n=r.text,a=r.fontSize,o=r.lineHeight,s=r.font;s||(s=ga(r));var l=ny(n,s),h;if(!l)h={x:t,y:e,width:0,height:0};else{var u=r.textAlign,c=r.textBaseline,f=pa(n,a,o),v={x:t,y:e-f};u&&(u==="end"||u==="right"?v.x-=l:u==="center"&&(v.x-=l/2)),c&&(c==="top"?v.y+=f:c==="middle"&&(v.y+=f/2)),h={x:v.x,y:v.y,width:l,height:f}}return h}var oy=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig,sy=/[^\s\,]+/ig;function ly(i){var r=i||[];if(P(r))return r;if(N(r))return r=r.match(oy),M(r,function(t,e){if(t=t.match(sy),t[0].length>1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}M(t,function(a,o){isNaN(a)||(t[o]=+a)}),r[e]=t}),r}function hy(i,r,t,e){var n=[],a=!!e,o,s,l,h,u,c,f;if(a){l=e[0],h=e[1];for(var v=0,p=i.length;v<p;v+=1){var g=i[v];l=Ot([0,0],l,g),h=Dt([0,0],h,g)}}for(var v=0,d=i.length;v<d;v+=1){var g=i[v];if(v===0&&!t)f=g;else if(v===d-1&&!t)c=g,n.push(f),n.push(c);else{var y=[v?v-1:d-1,v-1][t?0:1];o=i[y],s=i[t?(v+1)%d:v+1];var C=[0,0];C=kr(C,s,o),C=qt(C,C,r);var m=On(g,o),x=On(g,s),S=m+x;S!==0&&(m/=S,x/=S);var b=qt([0,0],C,-m),A=qt([0,0],C,x);c=Ge([0,0],g,b),u=Ge([0,0],g,A),u=Ot([0,0],u,Dt([0,0],s,g)),u=Dt([0,0],u,Ot([0,0],s,g)),b=kr([0,0],u,g),b=qt([0,0],b,-m/x),c=Ge([0,0],g,b),c=Ot([0,0],c,Dt([0,0],o,g)),c=Dt([0,0],c,Ot([0,0],o,g)),A=kr([0,0],g,c),A=qt([0,0],A,x/m),u=Ge([0,0],g,A),a&&(c=Dt([0,0],c,l),c=Ot([0,0],c,h),u=Dt([0,0],u,l),u=Ot([0,0],u,h)),n.push(f),n.push(c),f=u}}return t&&n.push(n.shift()),n}function uy(i,r,t){r===void 0&&(r=!1),t===void 0&&(t=[[0,0],[1,1]]);for(var e=!!r,n=[],a=0,o=i.length;a<o;a+=2)n.push([i[a],i[a+1]]);for(var s=hy(n,.4,e,t),l=n.length,h=[],u,c,f,a=0;a<l-1;a+=1)u=s[a*2],c=s[a*2+1],f=n[a+1],h.push(["C",u[0],u[1],c[0],c[1],f[0],f[1]]);return e&&(u=s[l],c=s[l+1],f=n[0],h.push(["C",u[0],u[1],c[0],c[1],f[0],f[1]])),h}var fi=`
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029`,cy=new RegExp("([a-z])["+fi+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+fi+"]*,?["+fi+"]*)+)","ig"),fy=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+fi+"]*,?["+fi+"]*","ig");function Dc(i){if(!i)return null;if(P(i))return i;var r={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},t=[];return String(i).replace(cy,function(e,n,a){var o=[],s=n.toLowerCase();if(a.replace(fy,function(l,h){h&&o.push(+h)}),s==="m"&&o.length>2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=r[s]&&(t.push([n].concat(o.splice(0,r[s]))),!!r[s]););return""}),t}var vy=/[a-z]/;function ih(i,r){return[r[0]+(r[0]-i[0]),r[1]+(r[1]-i[1])]}function Rc(i){var r=Dc(i);if(!r||!r.length)return[["M",0,0]];for(var t=!1,e=0;e<r.length;e++){var n=r[e][0];if(vy.test(n)||["V","H","T","S"].indexOf(n)>=0){t=!0;break}}if(!t)return r;var a=[],o=0,s=0,l=0,h=0,u=0,c=r[0];(c[0]==="M"||c[0]==="m")&&(o=+c[1],s=+c[2],l=o,h=s,u++,a[0]=["M",o,s]);for(var e=u,f=r.length;e<f;e++){var v=r[e],p=a[e-1],g=[],n=v[0],d=n.toUpperCase();if(n!==d)switch(g[0]=d,d){case"A":g[1]=v[1],g[2]=v[2],g[3]=v[3],g[4]=v[4],g[5]=v[5],g[6]=+v[6]+o,g[7]=+v[7]+s;break;case"V":g[1]=+v[1]+s;break;case"H":g[1]=+v[1]+o;break;case"M":l=+v[1]+o,h=+v[2]+s,g[1]=l,g[2]=h;break;default:for(var y=1,C=v.length;y<C;y++)g[y]=+v[y]+(y%2?o:s)}else g=r[e];switch(d){case"Z":o=+l,s=+h;break;case"H":o=g[1],g=["L",o,s];break;case"V":s=g[1],g=["L",o,s];break;case"T":o=g[1],s=g[2];var m=ih([p[1],p[2]],[p[3],p[4]]);g=["Q",m[0],m[1],o,s];break;case"S":o=g[g.length-2],s=g[g.length-1];var x=p.length,S=ih([p[x-4],p[x-3]],[p[x-2],p[x-1]]);g=["C",S[0],S[1],g[1],g[2],o,s];break;case"M":l=g[g.length-2],h=g[g.length-1];break;default:o=g[g.length-2],s=g[g.length-1]}a.push(g)}return a}function on(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function Io(i,r){return on(i)*on(r)?(i[0]*r[0]+i[1]*r[1])/(on(i)*on(r)):1}function nh(i,r){return(i[0]*r[1]<i[1]*r[0]?-1:1)*Math.acos(Io(i,r))}function Po(i,r){return i[0]===r[0]&&i[1]===r[1]}function py(i,r){var t=r[1],e=r[2],n=Jo(ts(r[3]),Math.PI*2),a=r[4],o=r[5],s=i[0],l=i[1],h=r[6],u=r[7],c=Math.cos(n)*(s-h)/2+Math.sin(n)*(l-u)/2,f=-1*Math.sin(n)*(s-h)/2+Math.cos(n)*(l-u)/2,v=c*c/(t*t)+f*f/(e*e);v>1&&(t*=Math.sqrt(v),e*=Math.sqrt(v));var p=t*t*(f*f)+e*e*(c*c),g=p?Math.sqrt((t*t*(e*e)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var d=e?g*t*f/e:0,y=t?g*-e*c/t:0,C=(s+h)/2+Math.cos(n)*d-Math.sin(n)*y,m=(l+u)/2+Math.sin(n)*d+Math.cos(n)*y,x=[(c-d)/t,(f-y)/e],S=[(-1*c-d)/t,(-1*f-y)/e],b=nh([1,0],x),A=nh(x,S);return Io(x,S)<=-1&&(A=Math.PI),Io(x,S)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:C,cy:m,rx:Po(i,[h,u])?0:t,ry:Po(i,[h,u])?0:e,startAngle:b,endAngle:b+A,xRotation:n,arcFlag:a,sweepFlag:o}}function ah(i,r){return[r[0]+(r[0]-i[0]),r[1]+(r[1]-i[1])]}function Yc(i){i=ly(i);for(var r=[],t=null,e=null,n=null,a=0,o=i.length,s=0;s<o;s++){var l=i[s];e=i[s+1];var h=l[0],u={command:h,prePoint:t,params:l,startTangent:null,endTangent:null};switch(h){case"M":n=[l[1],l[2]],a=s;break;case"A":var c=py(t,l);u.arcParams=c;break}if(h==="Z")t=n,e=i[a+1];else{var f=l.length;t=[l[f-2],l[f-1]]}e&&e[0]==="Z"&&(e=i[a],r[a]&&(r[a].prePoint=t)),u.currentPoint=t,r[a]&&Po(t,r[a].currentPoint)&&(r[a].prePoint=u.prePoint);var v=e?[e[e.length-2],e[e.length-1]]:null;u.nextPoint=v;var p=u.prePoint;if(["L","H","V"].includes(h))u.startTangent=[p[0]-t[0],p[1]-t[1]],u.endTangent=[t[0]-p[0],t[1]-p[1]];else if(h==="Q"){var g=[l[1],l[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[t[0]-g[0],t[1]-g[1]]}else if(h==="T"){var d=r[s-1],g=ah(d.currentPoint,p);d.command==="Q"?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[t[0]-g[0],t[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-t[0],p[1]-t[1]],u.endTangent=[t[0]-p[0],t[1]-p[1]])}else if(h==="C"){var y=[l[1],l[2]],C=[l[3],l[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[t[0]-C[0],t[1]-C[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[y[0]-C[0],y[1]-C[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[C[0]-y[0],C[1]-y[1]])}else if(h==="S"){var d=r[s-1],y=ah(d.currentPoint,p),C=[l[1],l[2]];d.command==="C"?(u.command="C",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[t[0]-C[0],t[1]-C[1]]):(u.command="SQ",u.startTangent=[p[0]-C[0],p[1]-C[1]],u.endTangent=[t[0]-C[0],t[1]-C[1]])}else if(h==="A"){var m=.001,x=u.arcParams||{},S=x.cx,b=S===void 0?0:S,A=x.cy,L=A===void 0?0:A,k=x.rx,B=k===void 0?0:k,O=x.ry,R=O===void 0?0:O,H=x.sweepFlag,z=H===void 0?0:H,_=x.startAngle,K=_===void 0?0:_,nt=x.endAngle,ht=nt===void 0?0:nt;z===0&&(m*=-1);var Q=B*Math.cos(K-m)+b,ut=R*Math.sin(K-m)+L;u.startTangent=[Q-n[0],ut-n[1]];var vt=B*Math.cos(K+ht+m)+b,te=R*Math.sin(K+ht-m)+L;u.endTangent=[p[0]-vt,p[1]-te]}r.push(u)}return r}var oh=function(i,r,t){return i>=r&&i<=t};function gy(i,r,t,e){var n=.001,a={x:t.x-i.x,y:t.y-i.y},o={x:r.x-i.x,y:r.y-i.y},s={x:e.x-t.x,y:e.y-t.y},l=o.x*s.y-o.y*s.x,h=l*l,u=o.x*o.x+o.y*o.y,c=s.x*s.x+s.y*s.y,f=null;if(h>n*u*c){var v=(a.x*s.y-a.y*s.x)/l,p=(a.x*o.y-a.y*o.x)/l;oh(v,0,1)&&oh(p,0,1)&&(f={x:i.x+v*o.x,y:i.y+v*o.y})}return f}var dy=1e-6;function $a(i){return Math.abs(i)<dy?0:i<0?-1:1}function yy(i,r,t){return(t[0]-i[0])*(r[1]-i[1])===(r[0]-i[0])*(t[1]-i[1])&&Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0])&&Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1])}function sh(i,r,t){var e=!1,n=i.length;if(n<=2)return!1;for(var a=0;a<n;a++){var o=i[a],s=i[(a+1)%n];if(yy(o,s,[r,t]))return!0;$a(o[1]-t)>0!=$a(s[1]-t)>0&&$a(r-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(e=!e)}return e}function lh(i){for(var r=[],t=i.length,e=0;e<t-1;e++){var n=i[e],a=i[e+1];r.push({from:{x:n[0],y:n[1]},to:{x:a[0],y:a[1]}})}if(r.length>1){var o=i[0],s=i[t-1];r.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return r}function my(i,r){var t=!1;return M(i,function(e){if(gy(e.from,e.to,r.from,r.to))return t=!0,!1}),t}function hh(i){var r=i.map(function(e){return e[0]}),t=i.map(function(e){return e[1]});return{minX:Math.min.apply(null,r),maxX:Math.max.apply(null,r),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function xy(i,r){return!(r.minX>i.maxX||r.maxX<i.minX||r.minY>i.maxY||r.maxY<i.minY)}function wy(i,r){if(i.length<2||r.length<2)return!1;var t=hh(i),e=hh(r);if(!xy(t,e))return!1;var n=!1;if(M(r,function(l){if(sh(i,l[0],l[1]))return n=!0,!1}),n||(M(i,function(l){if(sh(r,l[0],l[1]))return n=!0,!1}),n))return!0;var a=lh(i),o=lh(r),s=!1;return M(o,function(l){if(my(a,l))return s=!0,!1}),s}function Cy(i,r){for(var t=[],e=[],n=[],a=0;a<i.length;a++){var o=i[a],s=o.currentPoint,l=o.params,h=o.prePoint,u=void 0;switch(o.command){case"Q":u=Ic.box(h[0],h[1],l[1],l[2],l[3],l[4]);break;case"C":u=ci.box(h[0],h[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var c=o.arcParams;u=Zd.box(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:t.push(s[0]),e.push(s[1]);break}u&&(o.box=u,t.push(u.x,u.x+u.width),e.push(u.y,u.y+u.height)),r&&(o.command==="L"||o.command==="M")&&o.prePoint&&o.nextPoint&&n.push(o)}t=t.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0}),e=e.filter(function(y){return!Number.isNaN(y)&&y!==1/0&&y!==-1/0});var f=Yt(t),v=Yt(e),p=Lt(t),g=Lt(e);if(n.length===0)return{x:f,y:v,width:p-f,height:g-v};for(var a=0;a<n.length;a++){var o=n[a],s=o.currentPoint,d=void 0;s[0]===f?(d=sn(o,r),f=f-d.xExtra):s[0]===p&&(d=sn(o,r),p=p+d.xExtra),s[1]===v?(d=sn(o,r),v=v-d.yExtra):s[1]===g&&(d=sn(o,r),g=g+d.yExtra)}return{x:f,y:v,width:p-f,height:g-v}}function sn(i,r){var t=i.prePoint,e=i.currentPoint,n=i.nextPoint,a=Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2),o=Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2),s=Math.pow(t[0]-n[0],2)+Math.pow(t[1]-n[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||Math.sin(l)===0||xt(l,0))return{xExtra:0,yExtra:0};var h=Math.abs(Math.atan2(n[1]-e[1],n[0]-e[0])),u=Math.abs(Math.atan2(n[0]-e[0],n[1]-e[1]));h=h>Math.PI/2?Math.PI-h:h,u=u>Math.PI/2?Math.PI-u:u;var c={xExtra:Math.cos(l/2-h)*(r/2*(1/Math.sin(l/2)))-r/2||0,yExtra:Math.cos(u-l/2)*(r/2*(1/Math.sin(l/2)))-r/2||0};return c}function My(i){var r=i.attr(),t=r.path,e=r.stroke,n=e?r.lineWidth:0,a=i.get("segments")||Yc(t),o=Cy(a,n),s=o.x,l=o.y,h=o.width,u=o.height,c={minX:s,minY:l,maxX:s+h,maxY:l+u};return c=ps(i,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function Sy(i){var r=i.attr(),t=r.x1,e=r.y1,n=r.x2,a=r.y2,o=Math.min(t,n),s=Math.max(t,n),l=Math.min(e,a),h=Math.max(e,a),u={minX:o,maxX:s,minY:l,maxY:h};return u=ps(i,u),{x:u.minX,y:u.minY,width:u.maxX-u.minX,height:u.maxY-u.minY}}function by(i){var r=i.attr(),t=r.x,e=r.y,n=r.rx,a=r.ry;return{x:t-n,y:e-a,width:n*2,height:a*2}}Kt("rect",Lc);Kt("image",Lc);Kt("circle",Ec);Kt("marker",Ec);Kt("polyline",ey);Kt("polygon",ry);Kt("text",ay);Kt("path",My);Kt("line",Sy);Kt("ellipse",by);var uh=0,Ay=1/2,Ty=1/2,Ly=.05,da=function(){function i(r){var t=r.xField,e=r.yField,n=r.adjustNames,a=n===void 0?["x","y"]:n,o=r.dimValuesMap;this.adjustNames=a,this.xField=t,this.yField=e,this.dimValuesMap=o}return i.prototype.isAdjust=function(r){return this.adjustNames.indexOf(r)>=0},i.prototype.getAdjustRange=function(r,t,e){var n=this.yField,a=e.indexOf(t),o=e.length,s,l;return!n&&this.isAdjust("y")?(s=0,l=1):o>1?(s=e[a===0?0:a-1],l=e[a===o-1?o-1:a+1],a!==0?s+=(t-s)/2:s-=(l-t)/2,a!==o-1?l-=(l-t)/2:l+=(t-e[o-2])/2):(s=t===0?0:t-.5,l=t===0?1:t+.5),{pre:s,next:l}},i.prototype.adjustData=function(r,t){var e=this,n=this.getDimValues(t);M(r,function(a,o){M(n,function(s,l){e.adjustDim(l,s,a,o)})})},i.prototype.groupData=function(r,t){return M(r,function(e){e[t]===void 0&&(e[t]=uh)}),Ue(r,t)},i.prototype.adjustDim=function(r,t,e,n){},i.prototype.getDimValues=function(r){var t=this,e=t.xField,n=t.yField,a=ot({},this.dimValuesMap),o=[];if(e&&this.isAdjust("x")&&o.push(e),n&&this.isAdjust("y")&&o.push(n),o.forEach(function(l){a&&a[l]||(a[l]=Me(r,l).sort(function(h,u){return h-u}))}),!n&&this.isAdjust("y")){var s="y";a[s]=[uh,1]}return a},i}(),Gc={},Hc=function(i){return Gc[i.toLowerCase()]},ya=function(i,r){if(Hc(i))throw new Error("Adjust type '"+i+"' existed.");Gc[i.toLowerCase()]=r};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Fo=function(i,r){return Fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},Fo(i,r)};function ma(i,r){Fo(i,r);function t(){this.constructor=i}i.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var ue=function(){return ue=Object.assign||function(r){for(var t,e=1,n=arguments.length;e<n;e++){t=arguments[e];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(r[a]=t[a])}return r},ue.apply(this,arguments)},Ey=function(i){ma(r,i);function r(t){var e=i.call(this,t)||this;e.cacheMap={},e.adjustDataArray=[],e.mergeData=[];var n=t.marginRatio,a=n===void 0?Ay:n,o=t.dodgeRatio,s=o===void 0?Ty:o,l=t.dodgeBy,h=t.intervalPadding,u=t.dodgePadding,c=t.xDimensionLength,f=t.groupNum,v=t.defaultSize,p=t.maxColumnWidth,g=t.minColumnWidth,d=t.columnWidthRatio,y=t.customOffset;return e.marginRatio=a,e.dodgeRatio=s,e.dodgeBy=l,e.intervalPadding=h,e.dodgePadding=u,e.xDimensionLegenth=c,e.groupNum=f,e.defaultSize=v,e.maxColumnWidth=p,e.minColumnWidth=g,e.columnWidthRatio=d,e.customOffset=y,e}return r.prototype.process=function(t){var e=Xt(t),n=$t(e),a=this.dodgeBy,o=a?cp(n,a):e;return this.cacheMap={},this.adjustDataArray=o,this.mergeData=n,this.adjustData(o,n),this.adjustDataArray=[],this.mergeData=[],e},r.prototype.adjustDim=function(t,e,n,a){var o=this,s=this.customOffset,l=this.getDistribution(t),h=this.groupData(n,t);return M(h,function(u,c){var f;e.length===1?f={pre:e[0]-1,next:e[0]+1}:f=o.getAdjustRange(t,parseFloat(c),e),M(u,function(v){var p=v[t],g=l[p],d=g.indexOf(a);if(I(s))v[t]=o.getDodgeOffset(f,d,g.length);else{var y=f.pre,C=f.next;v[t]=G(s)?s(v,f):(y+C)/2+s}})}),[]},r.prototype.getDodgeOffset=function(t,e,n){var a=this,o=a.dodgeRatio,s=a.marginRatio,l=a.intervalPadding,h=a.dodgePadding,u=t.pre,c=t.next,f=c-u,v;if(!I(l)&&I(h)&&l>=0){var p=this.getIntervalOnlyOffset(n,e);v=u+p}else if(!I(h)&&I(l)&&h>=0){var p=this.getDodgeOnlyOffset(n,e);v=u+p}else if(!I(l)&&!I(h)&&l>=0&&h>=0){var p=this.getIntervalAndDodgeOffset(n,e);v=u+p}else{var g=f*o/n,d=s*g,p=1/2*(f-n*g-(n-1)*d)+((e+1)*g+e*d)-1/2*g-1/2*f;v=(u+c)/2+p}return v},r.prototype.getIntervalOnlyOffset=function(t,e){var n=this,a=n.defaultSize,o=n.intervalPadding,s=n.xDimensionLegenth,l=n.groupNum,h=n.dodgeRatio,u=n.maxColumnWidth,c=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,p=(1-(l-1)*v)/l*h/(t-1),g=((1-v*(l-1))/l-p*(t-1))/t;if(g=I(f)?g:1/l/t*f,!I(u)){var d=u/s;g=Math.min(g,d)}if(!I(c)){var y=c/s;g=Math.max(g,y)}g=a?a/s:g,p=((1-(l-1)*v)/l-t*g)/(t-1);var C=((1/2+e)*g+e*p+1/2*v)*l-v/2;return C},r.prototype.getDodgeOnlyOffset=function(t,e){var n=this,a=n.defaultSize,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,h=n.marginRatio,u=n.maxColumnWidth,c=n.minColumnWidth,f=n.columnWidthRatio,v=o/s,p=1*h/(l-1),g=((1-p*(l-1))/l-v*(t-1))/t;if(g=f?1/l/t*f:g,!I(u)){var d=u/s;g=Math.min(g,d)}if(!I(c)){var y=c/s;g=Math.max(g,y)}g=a?a/s:g,p=(1-(g*t+v*(t-1))*l)/(l-1);var C=((1/2+e)*g+e*v+1/2*p)*l-p/2;return C},r.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.xDimensionLegenth,l=n.groupNum,h=a/s,u=o/s,c=((1-h*(l-1))/l-u*(t-1))/t,f=((1/2+e)*c+e*u+1/2*h)*l-h/2;return f},r.prototype.getDistribution=function(t){var e=this.adjustDataArray,n=this.cacheMap,a=n[t];return a||(a={},M(e,function(o,s){var l=Me(o,t);l.length||l.push(0),M(l,function(h){a[h]||(a[h]=[]),a[h].push(s)})}),n[t]=a),a},r}(da);function By(i,r){return(r-i)*Math.random()+i}var ky=function(i){ma(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.process=function(t){var e=Xt(t),n=$t(e);return this.adjustData(e,n),e},r.prototype.adjustDim=function(t,e,n){var a=this,o=this.groupData(n,t);return M(o,function(s,l){return a.adjustGroup(s,t,parseFloat(l),e)})},r.prototype.getAdjustOffset=function(t){var e=t.pre,n=t.next,a=(n-e)*Ly;return By(e+a,n-a)},r.prototype.adjustGroup=function(t,e,n,a){var o=this,s=this.getAdjustRange(e,n,a);return M(t,function(l){l[e]=o.getAdjustOffset(s)}),t},r}(da),_a=Ep,Iy=function(i){ma(r,i);function r(t){var e=i.call(this,t)||this,n=t.adjustNames,a=n===void 0?["y"]:n,o=t.height,s=o===void 0?NaN:o,l=t.size,h=l===void 0?10:l,u=t.reverseOrder,c=u===void 0?!1:u;return e.adjustNames=a,e.height=s,e.size=h,e.reverseOrder=c,e}return r.prototype.process=function(t){var e=this,n=e.yField,a=e.reverseOrder,o=n?this.processStack(t):this.processOneDimStack(t);return a?this.reverse(o):o},r.prototype.reverse=function(t){return t.slice(0).reverse()},r.prototype.processStack=function(t){var e=this,n=e.xField,a=e.yField,o=e.reverseOrder,s=o?this.reverse(t):t,l=new _a,h=new _a;return s.map(function(u){return u.map(function(c){var f,v=T(c,n,0),p=T(c,[a]),g=v.toString();if(p=P(p)?p[1]:p,!I(p)){var d=p>=0?l:h;d.has(g)||d.set(g,0);var y=d.get(g),C=p+y;return d.set(g,C),ue(ue({},c),(f={},f[a]=[y,C],f))}return c})})},r.prototype.processOneDimStack=function(t){var e=this,n=this,a=n.xField,o=n.height,s=n.reverseOrder,l="y",h=s?this.reverse(t):t,u=new _a;return h.map(function(c){return c.map(function(f){var v,p=e.size,g=f[a],d=p*2/o;u.has(g)||u.set(g,d/2);var y=u.get(g);return u.set(g,y+d),ue(ue({},f),(v={},v[l]=y,v))})})},r}(da),Py=function(i){ma(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.process=function(t){var e=$t(t),n=this,a=n.xField,o=n.yField,s=this.getXValuesMaxMap(e),l=Math.max.apply(Math,Object.keys(s).map(function(h){return s[h]}));return Et(t,function(h){return Et(h,function(u){var c,f,v=u[o],p=u[a];if(P(v)){var g=(l-s[p])/2;return ue(ue({},u),(c={},c[o]=Et(v,function(y){return g+y}),c))}var d=(l-v)/2;return ue(ue({},u),(f={},f[o]=[d,v+d],f))})})},r.prototype.getXValuesMaxMap=function(t){var e=this,n=this,a=n.xField,o=n.yField,s=Ue(t,function(l){return l[a]});return bp(s,function(l){return e.getDimMaxValue(l,o)})},r.prototype.getDimMaxValue=function(t,e){var n=Et(t,function(o){return T(o,e,[])}),a=$t(n);return Math.max.apply(Math,a)},r}(da);ya("Dodge",Ey);ya("Jitter",ky);ya("Stack",Iy);ya("Symmetric",Py);var ch=function(i,r){return N(r)?r:i.invert(i.scale(r))},zi=function(){function i(r){this.names=[],this.scales=[],this.linear=!1,this.values=[],this.callback=function(){return[]},this._parseCfg(r)}return i.prototype.mapping=function(){for(var r=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.map(function(a,o){return r._toOriginParam(a,r.scales[o])});return this.callback.apply(this,n)},i.prototype.getLinearValue=function(r){var t=this.values.length-1,e=Math.floor(t*r),n=t*r-e,a=this.values[e],o=e===t?a:this.values[e+1];return a+(o-a)*n},i.prototype.getNames=function(){for(var r=this.scales,t=this.names,e=Math.min(r.length,t.length),n=[],a=0;a<e;a+=1)n.push(t[a]);return n},i.prototype.getFields=function(){return this.scales.map(function(r){return r.field})},i.prototype.getScale=function(r){return this.scales[this.names.indexOf(r)]},i.prototype.defaultCallback=function(){for(var r=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===0?this.values:t.map(function(n,a){var o=r.scales[a];return o.type==="identity"?o.values[0]:r._getAttributeValue(o,n)})},i.prototype._parseCfg=function(r){var t=this,e=r.type,n=e===void 0?"base":e,a=r.names,o=a===void 0?[]:a,s=r.scales,l=s===void 0?[]:s,h=r.values,u=h===void 0?[]:h,c=r.callback;this.type=n,this.scales=l,this.values=u,this.names=o,this.callback=function(){for(var f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];if(c){var p=c.apply(void 0,f);if(!I(p))return[p]}return t.defaultCallback.apply(t,f)}},i.prototype._getAttributeValue=function(r,t){if(r.isCategory&&!this.linear){var e=r.translate(t);return this.values[e%this.values.length]}var n=r.scale(t);return this.getLinearValue(n)},i.prototype._toOriginParam=function(r,t){return t.isLinear?r:P(r)?r.map(function(e){return ch(t,e)}):ch(t,r)},i}();/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var Oo=function(i,r){return Oo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},Oo(i,r)};function Wi(i,r){Oo(i,r);function t(){this.constructor=i}i.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var Fy=/rgba?\(([\s.,0-9]+)\)/,Oy=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Dy=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Ry=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,Yy=function(i){return/^[r,R,L,l]{1}[\s]*\(/.test(i)},Gy=function(){var i=document.createElement("i");return i.title="Web Colour Picker",i.style.display="none",document.body.appendChild(i),i},ja=function(i,r,t,e){return i[e]+(r[e]-i[e])*t};function Vc(i){return"#"+Ua(i[0])+Ua(i[1])+Ua(i[2])}var Nc=function(i){return[parseInt(i.substr(1,2),16),parseInt(i.substr(3,2),16),parseInt(i.substr(5,2),16)]},Ua=function(i){var r=Math.round(i).toString(16);return r.length===1?"0"+r:r},Hy=function(i,r){var t=isNaN(Number(r))||r<0?0:r>1?1:Number(r),e=i.length-1,n=Math.floor(e*t),a=e*t-n,o=i[n],s=n===e?o:i[n+1];return Vc([ja(o,s,a,0),ja(o,s,a,1),ja(o,s,a,2)])},ln,Xc=function(i){if(i[0]==="#"&&i.length===7)return i;ln||(ln=Gy()),ln.style.color=i;var r=document.defaultView.getComputedStyle(ln,"").getPropertyValue("color"),t=Fy.exec(r),e=t[1].split(/\s*,\s*/).map(function(n){return Number(n)});return r=Vc(e),r},Vy=function(i){var r=N(i)?i.split("-"):i,t=Et(r,function(e){return Nc(e.indexOf("#")===-1?Xc(e):e)});return function(e){return Hy(t,e)}},Ny=function(i){if(Yy(i)){var r,t=void 0;if(i[0]==="l"){var e=Oy.exec(i),n=+e[1]+90;t=e[2],r="linear-gradient("+n+"deg, "}else if(i[0]==="r"){r="radial-gradient(";var e=Dy.exec(i);t=e[4]}var a=t.match(Ry);return M(a,function(o,s){var l=o.split(":");r+=l[1]+" "+l[0]*100+"%",s!==a.length-1&&(r+=", ")}),r+=")",r}return i};const ki={rgb2arr:Nc,gradient:Vy,toRGB:ia(Xc),toCSSGradient:Ny};var Xy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="color",e.names=["color"],N(e.values)&&(e.linear=!0),e.gradient=ki.gradient(e.values),e}return r.prototype.getLinearValue=function(t){return this.gradient(t)},r}(zi),zy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="opacity",e.names=["opacity"],e}return r}(zi),Wy=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.names=["x","y"],e.type="position",e}return r.prototype.mapping=function(t,e){var n=this.scales,a=n[0],o=n[1];return I(t)||I(e)?[]:[P(t)?t.map(function(s){return a.scale(s)}):a.scale(t),P(e)?e.map(function(s){return o.scale(s)}):o.scale(e)]},r}(zi),$y=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="shape",e.names=["shape"],e}return r.prototype.getLinearValue=function(t){var e=Math.round((this.values.length-1)*t);return this.values[e]},r}(zi),_y=function(i){Wi(r,i);function r(t){var e=i.call(this,t)||this;return e.type="size",e.names=["size"],e}return r}(zi),zc={};function jy(i){return zc[i]}function ge(i,r){zc[i]=r}var gs=function(){function i(r){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=r,this.initCfg(),this.init()}return i.prototype.translate=function(r){return r},i.prototype.change=function(r){ot(this.__cfg__,r),this.init()},i.prototype.clone=function(){return this.constructor(this.__cfg__)},i.prototype.getTicks=function(){var r=this;return Et(this.ticks,function(t,e){return rt(t)?t:{text:r.getText(t,e),tickValue:t,value:r.scale(t)}})},i.prototype.getText=function(r,t){var e=this.formatter,n=e?e(r,t):r;return I(n)||!G(n.toString)?"":n.toString()},i.prototype.getConfig=function(r){return this.__cfg__[r]},i.prototype.init=function(){ot(this,this.__cfg__),this.setDomain(),pe(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},i.prototype.initCfg=function(){},i.prototype.setDomain=function(){},i.prototype.calculateTicks=function(){var r=this.tickMethod,t=[];if(N(r)){var e=jy(r);if(!e)throw new Error("There is no method to to calculate ticks!");t=e(this)}else G(r)&&(t=r(this));return t},i.prototype.rangeMin=function(){return this.range[0]},i.prototype.rangeMax=function(){return this.range[1]},i.prototype.calcPercent=function(r,t,e){return U(r)?(r-t)/(e-t):NaN},i.prototype.calcValue=function(r,t,e){return t+r*(e-t)},i}(),xa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="cat",t.isCategory=!0,t}return r.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;t<this.values.length;t++)this.translateIndexMap.set(this.values[t],t)}},r.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return e===void 0&&(e=U(t)?t:NaN),e},r.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},r.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),a=Math.round(e*n)+this.min;return a<this.min||a>this.max?NaN:this.values[a]},r.prototype.getText=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var a=t;return U(t)&&!this.values.includes(t)&&(a=this.values[a]),i.prototype.getText.apply(this,Ci([a],e))},r.prototype.initCfg=function(){this.tickMethod="cat"},r.prototype.setDomain=function(){if(I(this.getConfig("min"))&&(this.min=0),I(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},r}(gs),Wc=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Pe="\\d\\d?",Be="\\d\\d",Uy="\\d{3}",qy="\\d{4}",vi="[^\\s]+",$c=/\[([^]*?)\]/gm;function _c(i,r){for(var t=[],e=0,n=i.length;e<n;e++)t.push(i[e].substr(0,r));return t}var fh=function(i){return function(r,t){var e=t[i].map(function(a){return a.toLowerCase()}),n=e.indexOf(r.toLowerCase());return n>-1?n:null}};function $e(i){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var e=0,n=r;e<n.length;e++){var a=n[e];for(var o in a)i[o]=a[o]}return i}var jc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Uc=["January","February","March","April","May","June","July","August","September","October","November","December"],Zy=_c(Uc,3),Qy=_c(jc,3),ds={dayNamesShort:Qy,dayNames:jc,monthNamesShort:Zy,monthNames:Uc,amPm:["am","pm"],DoFn:function(i){return i+["th","st","nd","rd"][i%10>3?0:(i-i%10!==10?1:0)*i%10]}},Vn=$e({},ds),qc=function(i){return Vn=$e(Vn,i)},vh=function(i){return i.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},kt=function(i,r){for(r===void 0&&(r=2),i=String(i);i.length<r;)i="0"+i;return i},Ky={D:function(i){return String(i.getDate())},DD:function(i){return kt(i.getDate())},Do:function(i,r){return r.DoFn(i.getDate())},d:function(i){return String(i.getDay())},dd:function(i){return kt(i.getDay())},ddd:function(i,r){return r.dayNamesShort[i.getDay()]},dddd:function(i,r){return r.dayNames[i.getDay()]},M:function(i){return String(i.getMonth()+1)},MM:function(i){return kt(i.getMonth()+1)},MMM:function(i,r){return r.monthNamesShort[i.getMonth()]},MMMM:function(i,r){return r.monthNames[i.getMonth()]},YY:function(i){return kt(String(i.getFullYear()),4).substr(2)},YYYY:function(i){return kt(i.getFullYear(),4)},h:function(i){return String(i.getHours()%12||12)},hh:function(i){return kt(i.getHours()%12||12)},H:function(i){return String(i.getHours())},HH:function(i){return kt(i.getHours())},m:function(i){return String(i.getMinutes())},mm:function(i){return kt(i.getMinutes())},s:function(i){return String(i.getSeconds())},ss:function(i){return kt(i.getSeconds())},S:function(i){return String(Math.round(i.getMilliseconds()/100))},SS:function(i){return kt(Math.round(i.getMilliseconds()/10),2)},SSS:function(i){return kt(i.getMilliseconds(),3)},a:function(i,r){return i.getHours()<12?r.amPm[0]:r.amPm[1]},A:function(i,r){return i.getHours()<12?r.amPm[0].toUpperCase():r.amPm[1].toUpperCase()},ZZ:function(i){var r=i.getTimezoneOffset();return(r>0?"-":"+")+kt(Math.floor(Math.abs(r)/60)*100+Math.abs(r)%60,4)},Z:function(i){var r=i.getTimezoneOffset();return(r>0?"-":"+")+kt(Math.floor(Math.abs(r)/60),2)+":"+kt(Math.abs(r)%60,2)}},ph=function(i){return+i-1},gh=[null,Pe],dh=[null,vi],yh=["isPm",vi,function(i,r){var t=i.toLowerCase();return t===r.amPm[0]?0:t===r.amPm[1]?1:null}],mh=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(i){var r=(i+"").match(/([+-]|\d\d)/gi);if(r){var t=+r[1]*60+parseInt(r[2],10);return r[0]==="+"?t:-t}return 0}],Jy={D:["day",Pe],DD:["day",Be],Do:["day",Pe+vi,function(i){return parseInt(i,10)}],M:["month",Pe,ph],MM:["month",Be,ph],YY:["year",Be,function(i){var r=new Date,t=+(""+r.getFullYear()).substr(0,2);return+(""+(+i>68?t-1:t)+i)}],h:["hour",Pe,void 0,"isPm"],hh:["hour",Be,void 0,"isPm"],H:["hour",Pe],HH:["hour",Be],m:["minute",Pe],mm:["minute",Be],s:["second",Pe],ss:["second",Be],YYYY:["year",qy],S:["millisecond","\\d",function(i){return+i*100}],SS:["millisecond",Be,function(i){return+i*10}],SSS:["millisecond",Uy],d:gh,dd:gh,ddd:dh,dddd:dh,MMM:["month",vi,fh("monthNamesShort")],MMMM:["month",vi,fh("monthNames")],a:yh,A:yh,ZZ:mh,Z:mh},Nn={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Zc=function(i){return $e(Nn,i)},Qc=function(i,r,t){if(r===void 0&&(r=Nn.default),t===void 0&&(t={}),typeof i=="number"&&(i=new Date(i)),Object.prototype.toString.call(i)!=="[object Date]"||isNaN(i.getTime()))throw new Error("Invalid Date pass to format");r=Nn[r]||r;var e=[];r=r.replace($c,function(a,o){return e.push(o),"@@@"});var n=$e($e({},Vn),t);return r=r.replace(Wc,function(a){return Ky[a](i,n)}),r.replace(/@@@/g,function(){return e.shift()})};function Kc(i,r,t){if(t===void 0&&(t={}),typeof r!="string")throw new Error("Invalid format in fecha parse");if(r=Nn[r]||r,i.length>1e3)return null;var e=new Date,n={year:e.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=r.replace($c,function(x,S){return o.push(vh(S)),"@@@"}),l={},h={};s=vh(s).replace(Wc,function(x){var S=Jy[x],b=S[0],A=S[1],L=S[3];if(l[b])throw new Error("Invalid format. "+b+" specified twice in format");return l[b]=!0,L&&(h[L]=!0),a.push(S),"("+A+")"}),Object.keys(h).forEach(function(x){if(!l[x])throw new Error("Invalid format. "+x+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var u=i.match(new RegExp(s,"i"));if(!u)return null;for(var c=$e($e({},Vn),t),f=1;f<u.length;f++){var v=a[f-1],p=v[0],g=v[2],d=g?g(u[f],c):+u[f];if(d==null)return null;n[p]=d}n.isPm===1&&n.hour!=null&&+n.hour!=12?n.hour=+n.hour+12:n.isPm===0&&+n.hour==12&&(n.hour=0);var y;if(n.timezoneOffset==null){y=new Date(n.year,n.month,n.day,n.hour,n.minute,n.second,n.millisecond);for(var C=[["month","getMonth"],["day","getDate"],["hour","getHours"],["minute","getMinutes"],["second","getSeconds"]],f=0,m=C.length;f<m;f++)if(l[C[f][0]]&&n[C[f][0]]!==y[C[f][1]]())return null}else if(y=new Date(Date.UTC(n.year,n.month,n.day,n.hour,n.minute-n.timezoneOffset,n.second,n.millisecond)),n.month>11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return y}var Jc={format:Qc,parse:Kc,defaultI18n:ds,setGlobalDateI18n:qc,setGlobalDateMasks:Zc};const tm=Object.freeze(Object.defineProperty({__proto__:null,default:Jc,assign:$e,format:Qc,parse:Kc,defaultI18n:ds,setGlobalDateI18n:qc,setGlobalDateMasks:Zc},Symbol.toStringTag,{value:"Module"}));function em(i){return function(r,t,e,n){for(var a=I(e)?0:e,o=I(n)?r.length:n;a<o;){var s=a+o>>>1;i(r[s])>t?o=s:a=s+1}return a}}var xh="format";function tf(i,r){var t=tm[xh]||Jc[xh];return t(i,r)}function Xn(i){return N(i)&&(i.indexOf("T")>0?i=new Date(i).getTime():i=new Date(i.replace(/-/gi,"/")).getTime()),Xu(i)&&(i=i.getTime()),i}var ie=1e3,sr=60*ie,lr=60*sr,we=24*lr,pi=we*31,wh=we*365,ti=[["HH:mm:ss",ie],["HH:mm:ss",ie*10],["HH:mm:ss",ie*30],["HH:mm",sr],["HH:mm",sr*10],["HH:mm",sr*30],["HH",lr],["HH",lr*6],["HH",lr*12],["YYYY-MM-DD",we],["YYYY-MM-DD",we*4],["YYYY-WW",we*7],["YYYY-MM",pi],["YYYY-MM",pi*4],["YYYY-MM",pi*6],["YYYY",we*380]];function rm(i,r,t){var e=(r-i)/t,n=em(function(o){return o[1]})(ti,e)-1,a=ti[n];return n<0?a=ti[0]:n>=ti.length&&(a=Ct(ti)),a}var im=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="timeCat",t}return r.prototype.translate=function(t){t=Xn(t);var e=this.values.indexOf(t);return e===-1&&(U(t)&&t<this.values.length?e=t:e=NaN),e},r.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var a=this.values[n],o=this.formatter;return a=o?o(a,e):tf(a,this.mask),a}return t},r.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},r.prototype.setDomain=function(){var t=this.values;M(t,function(e,n){t[n]=Xn(e)}),t.sort(function(e,n){return e-n}),i.prototype.setDomain.call(this)},r}(xa),wa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.isContinuous=!0,t}return r.prototype.scale=function(t){if(I(t))return NaN;var e=this.rangeMin(),n=this.rangeMax(),a=this.max,o=this.min;if(a===o)return e;var s=this.getScalePercent(t);return e+s*(n-e)},r.prototype.init=function(){i.prototype.init.call(this);var t=this.ticks,e=zt(t),n=Ct(t);e<this.min&&(this.min=e),n>this.max&&(this.max=n),I(this.minLimit)||(this.min=e),I(this.maxLimit)||(this.max=n)},r.prototype.setDomain=function(){var t=ap(this.values),e=t.min,n=t.max;I(this.min)&&(this.min=e),I(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},r.prototype.calculateTicks=function(){var t=this,e=i.prototype.calculateTicks.call(this);return this.nice||(e=Qt(e,function(n){return n>=t.min&&n<=t.max})),e},r.prototype.getScalePercent=function(t){var e=this.max,n=this.min;return(t-n)/(e-n)},r.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},r}(gs),Ca=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return r.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},r.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},r}(wa);function De(i,r){var t=Math.E,e;return r>=0?e=Math.pow(t,Math.log(r)/i):e=Math.pow(t,Math.log(-r)/i)*-1,e}function Ut(i,r){return i===1?1:Math.log(r)/Math.log(i)}function ef(i,r,t){I(t)&&(t=Math.max.apply(null,i));var e=t;return M(i,function(n){n>0&&n<e&&(e=n)}),e===t&&(e=t/r),e>1&&(e=1),e}var nm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="log",t}return r.prototype.invert=function(t){var e=this.base,n=Ut(e,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,l=this.positiveMin;if(l){if(t===0)return 0;s=Ut(e,l/e);var h=1/(n-s)*o;if(t<h)return t/h*l}else s=Ut(e,this.min);var u=(t-a)/o,c=u*(n-s)+s;return Math.pow(e,c)},r.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},r.prototype.setDomain=function(){i.prototype.setDomain.call(this);var t=this.min;if(t<0)throw new Error("When you use log scale, the minimum value must be greater than zero!");t===0&&(this.positiveMin=ef(this.values,this.base,this.max))},r.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n||t<=0)return 0;var a=this.base,o=this.positiveMin;o&&(n=o*1/a);var s;return t<o?s=t/o/(Ut(a,e)-Ut(a,n)):s=(Ut(a,t)-Ut(a,n))/(Ut(a,e)-Ut(a,n)),s},r}(wa),am=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="pow",t}return r.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,a=De(n,this.max),o=De(n,this.min),s=e*(a-o)+o,l=s>=0?1:-1;return Math.pow(s,n)*l},r.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},r.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var a=this.exponent,o=(De(a,t)-De(a,n))/(De(a,e)-De(a,n));return o},r}(wa),om=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="time",t}return r.prototype.getText=function(t,e){var n=this.translate(t),a=this.formatter;return a?a(n,e):tf(n,this.mask)},r.prototype.scale=function(t){var e=t;return(N(e)||Xu(e))&&(e=this.translate(e)),i.prototype.scale.call(this,e)},r.prototype.translate=function(t){return Xn(t)},r.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},r.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if((!I(e)||!U(e))&&(this.min=this.translate(this.min)),(!I(n)||!U(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,l=0;M(t,function(h){var u=Xn(h);if(isNaN(u))throw new TypeError("Invalid Time: "+h+" in time scale!");o>u?(s=o,o=u):s>u&&(s=u),l<u&&(l=u),a.push(u)}),t.length>1&&(this.minTickInterval=s-o),I(e)&&(this.min=o),I(n)&&(this.max=l)}},r}(Ca),rf=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantize",t}return r.prototype.invert=function(t){var e=this.ticks,n=e.length,a=this.getInvertPercent(t),o=Math.floor(a*(n-1));if(o>=n-1)return Ct(e);if(o<0)return zt(e);var s=e[o],l=e[o+1],h=o/(n-1),u=(o+1)/(n-1);return s+(a-h)/(u-h)*(l-s)},r.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},r.prototype.calculateTicks=function(){var t=i.prototype.calculateTicks.call(this);return this.nice||(Ct(t)!==this.max&&t.push(this.max),zt(t)!==this.min&&t.unshift(this.min)),t},r.prototype.getScalePercent=function(t){var e=this.ticks;if(t<zt(e))return 0;if(t>Ct(e))return 1;var n=0;return M(e,function(a,o){if(t>=a)n=o;else return!1}),n/(e.length-1)},r}(wa),sm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantile",t}return r.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},r}(rf),nf={};function Do(i){return nf[i]}function de(i,r){if(Do(i))throw new Error("type '"+i+"' existed.");nf[i]=r}var lm=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return r.prototype.calculateTicks=function(){return this.values},r.prototype.scale=function(t){return this.values[0]!==t&&U(t)?t:this.range[0]},r.prototype.invert=function(t){var e=this.range;return t<e[0]||t>e[1]?NaN:this.values[0]},r}(gs);function af(i){var r=i.values,t=i.tickInterval,e=i.tickCount,n=i.showLast;if(U(t)){var a=Qt(r,function(p,g){return g%t===0}),o=Ct(r);return n&&Ct(a)!==o&&a.push(o),a}var s=r.length,l=i.min,h=i.max;if(I(l)&&(l=0),I(h)&&(h=r.length-1),!U(e)||e>=s)return r.slice(l,h+1);if(e<=0||h<=0)return[];for(var u=e===1?s:Math.floor(s/(e-1)),c=[],f=l,v=0;v<e&&!(f>=h);v++)f=Math.min(l+v*u,h),v===e-1&&n?c.push(r[h]):c.push(r[f]);return c}function hm(i){var r=i.min,t=i.max,e=i.nice,n=i.tickCount,a=new um;return a.domain([r,t]),e&&a.nice(n),a.ticks(n)}var qa=5,Ch=Math.sqrt(50),Mh=Math.sqrt(10),Sh=Math.sqrt(2),um=function(){function i(){this._domain=[0,1]}return i.prototype.domain=function(r){return r?(this._domain=Array.from(r,Number),this):this._domain.slice()},i.prototype.nice=function(r){var t,e;r===void 0&&(r=qa);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],l=this._domain[o],h;return l<s&&(t=[l,s],s=t[0],l=t[1],e=[o,a],a=e[0],o=e[1]),h=Bn(s,l,r),h>0?(s=Math.floor(s/h)*h,l=Math.ceil(l/h)*h,h=Bn(s,l,r)):h<0&&(s=Math.ceil(s*h)/h,l=Math.floor(l*h)/h,h=Bn(s,l,r)),h>0?(n[a]=Math.floor(s/h)*h,n[o]=Math.ceil(l/h)*h,this.domain(n)):h<0&&(n[a]=Math.ceil(s*h)/h,n[o]=Math.floor(l*h)/h,this.domain(n)),this},i.prototype.ticks=function(r){return r===void 0&&(r=qa),cm(this._domain[0],this._domain[this._domain.length-1],r||qa)},i}();function cm(i,r,t){var e,n=-1,a,o,s;if(r=+r,i=+i,t=+t,i===r&&t>0)return[i];if((e=r<i)&&(a=i,i=r,r=a),(s=Bn(i,r,t))===0||!isFinite(s))return[];if(s>0)for(i=Math.ceil(i/s),r=Math.floor(r/s),o=new Array(a=Math.ceil(r-i+1));++n<a;)o[n]=(i+n)*s;else for(i=Math.floor(i*s),r=Math.ceil(r*s),o=new Array(a=Math.ceil(i-r+1));++n<a;)o[n]=(i-n)/s;return e&&o.reverse(),o}function Bn(i,r,t){var e=(r-i)/Math.max(0,t),n=Math.floor(Math.log(e)/Math.LN10),a=e/Math.pow(10,n);return n>=0?(a>=Ch?10:a>=Mh?5:a>=Sh?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Ch?10:a>=Mh?5:a>=Sh?2:1)}function bh(i,r,t){var e;return t==="ceil"?e=Math.ceil(i/r):t==="floor"?e=Math.floor(i/r):e=Math.round(i/r),e*r}function ys(i,r,t){var e=bh(i,t,"floor"),n=bh(r,t,"ceil");e=Ra(e,t),n=Ra(n,t);for(var a=[],o=Math.max((n-e)/(Math.pow(2,12)-1),t),s=e;s<=n;s=s+o){var l=Ra(s,o);a.push(l)}return{min:e,max:n,ticks:a}}function ms(i,r,t){var e,n=i.minLimit,a=i.maxLimit,o=i.min,s=i.max,l=i.tickCount,h=l===void 0?5:l,u=I(n)?I(r)?o:r:n,c=I(a)?I(t)?s:t:a;if(u>c&&(e=[u,c],c=e[0],u=e[1]),h<=2)return[u,c];for(var f=(c-u)/(h-1),v=[],p=0;p<h;p++)v.push(u+f*p);return v}function fm(i){var r=i.min,t=i.max,e=i.tickInterval,n=i.minLimit,a=i.maxLimit,o=hm(i);return!I(n)||!I(a)?ms(i,zt(o),Ct(o)):e?ys(r,t,e).ticks:o}function tr(i){return Math.abs(i)<1e-15?i:parseFloat(i.toFixed(15))}var vm=[1,5,2,2.5,4,3],Ah=Number.EPSILON*100;function pm(i,r){return(i%r+r)%r}function gm(i){return Math.round(i*1e12)/1e12}function dm(i,r,t,e,n,a){var o=Gt(r),s=_u(r,i),l=0,h=pm(e,a);return(h<Ah||a-h<Ah)&&e<=0&&n>=0&&(l=1),1-s/(o-1)-t+l}function ym(i,r,t){var e=Gt(r),n=_u(r,i),a=1;return 1-n/(e-1)-t+a}function mm(i,r,t,e,n,a){var o=(i-1)/(a-n),s=(r-1)/(Math.max(a,e)-Math.min(t,n));return 2-Math.max(o/s,s/o)}function xm(i,r){return i>=r?2-(i-1)/(r-1):1}function wm(i,r,t,e){var n=r-i;return 1-.5*(Math.pow(r-e,2)+Math.pow(i-t,2))/Math.pow(.1*n,2)}function Cm(i,r,t){var e=r-i;if(t>e){var n=(t-e)/2;return 1-Math.pow(n,2)/Math.pow(.1*e,2)}return 1}function Mm(){return 1}function Sm(i,r,t,e,n,a){t===void 0&&(t=5),e===void 0&&(e=!0),n===void 0&&(n=vm),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(i)||Number.isNaN(r)||typeof i!="number"||typeof r!="number"||!o)return{min:0,max:0,ticks:[]};if(r-i<1e-15||o===1)return{min:i,max:r,ticks:[i]};if(r-i>1e148){var s=t||5,l=(r-i)/s;return{min:i,max:r,ticks:Array(s).fill(null).map(function(vt,te){return tr(i+l*te)})}}for(var h={score:-2,lmin:0,lmax:0,lstep:0},u=1;u<1/0;){for(var c=0;c<n.length;c+=1){var f=n[c],v=ym(f,n,u);if(a[0]*v+a[1]+a[2]+a[3]<h.score){u=1/0;break}for(var p=2;p<1/0;){var g=xm(p,o);if(a[0]*v+a[1]+a[2]*g+a[3]<h.score)break;for(var d=(r-i)/(p+1)/u/f,y=Math.ceil(Math.log10(d));y<1/0;){var C=u*f*Math.pow(10,y),m=Cm(i,r,C*(p-1));if(a[0]*v+a[1]*m+a[2]*g+a[3]<h.score)break;var x=Math.floor(r/C)*u-(p-1)*u,S=Math.ceil(i/C)*u;if(x<=S)for(var s=S-x,b=0;b<=s;b+=1){var A=x+b,L=A*(C/u),k=L+C*(p-1),B=C,O=dm(f,n,u,L,k,B),R=wm(i,r,L,k),H=mm(p,o,i,r,L,k),z=Mm(),_=a[0]*O+a[1]*R+a[2]*H+a[3]*z;_>h.score&&(!e||L<=i&&k>=r)&&(h.lmin=L,h.lmax=k,h.lstep=B,h.score=_)}y+=1}p+=1}}u+=1}var K=tr(h.lmax),nt=tr(h.lmin),ht=tr(h.lstep),Q=Math.floor(gm((K-nt)/ht))+1,ut=new Array(Q);ut[0]=tr(nt);for(var c=1;c<Q;c++)ut[c]=tr(ut[c-1]+ht);return{min:Math.min(i,zt(ut)),max:Math.max(r,Ct(ut)),ticks:ut}}function bm(i){var r=i.min,t=i.max,e=i.tickCount,n=i.nice,a=i.tickInterval,o=i.minLimit,s=i.maxLimit,l=Sm(r,t,e,n).ticks;return!I(o)||!I(s)?ms(i,zt(l),Ct(l)):a?ys(r,t,a).ticks:l}function Am(i){var r=i.base,t=i.tickCount,e=i.min,n=i.max,a=i.values,o,s=Ut(r,n);if(e>0)o=Math.floor(Ut(r,e));else{var l=ef(a,r,n);o=Math.floor(Ut(r,l))}for(var h=s-o,u=Math.ceil(h/t),c=[],f=o;f<s+u;f=f+u)c.push(Math.pow(r,f));return e<=0&&c.unshift(0),c}function of(i,r,t){if(t===void 0&&(t=5),i===r)return{max:r,min:i,ticks:[i]};var e=t<0?0:Math.round(t);if(e===0)return{max:r,min:i,ticks:[]};var n=1.5,a=.5+1.5*n,o=r-i,s=o/e,l=Math.pow(10,Math.floor(Math.log10(s))),h=l;2*l-s<n*(s-h)&&(h=2*l,5*l-s<a*(s-h)&&(h=5*l,10*l-s<n*(s-h)&&(h=10*l)));for(var u=Math.ceil(r/h),c=Math.floor(i/h),f=Math.max(u*h,r),v=Math.min(c*h,i),p=Math.floor((f-v)/h)+1,g=new Array(p),d=0;d<p;d++)g[d]=tr(v+d*h);return{min:v,max:f,ticks:g}}function Tm(i){var r=i.exponent,t=i.tickCount,e=Math.ceil(De(r,i.max)),n=Math.floor(De(r,i.min)),a=of(n,e,t).ticks;return a.map(function(o){var s=o>=0?1:-1;return Math.pow(o,r)*s})}function Lm(i,r){var t=i.length*r;return r===1?i[i.length-1]:r===0?i[0]:t%1!==0?i[Math.ceil(t)-1]:i.length%2===0?(i[t-1]+i[t])/2:i[t]}function Em(i){var r=i.tickCount,t=i.values;if(!t||!t.length)return[];for(var e=t.slice().sort(function(s,l){return s-l}),n=[],a=0;a<r;a++){var o=a/(r-1);n.push(Lm(e,o))}return n}function Bm(i){var r=i.min,t=i.max,e=i.tickCount,n=i.tickInterval,a=i.minLimit,o=i.maxLimit,s=of(r,t,e).ticks;return!I(a)||!I(o)?ms(i,zt(s),Ct(s)):n?ys(r,t,n).ticks:s}function km(i){var r=i.min,t=i.max,e=i.minTickInterval,n=i.tickInterval,a=i.tickCount;if(n)a=Math.ceil((t-r)/n);else{n=rm(r,t,a)[1];var o=(t-r)/n,s=o/a;s>1&&(n=n*Math.ceil(s)),e&&n<e&&(n=e)}n=Math.max(Math.floor((t-r)/(Math.pow(2,12)-1)),n);for(var l=[],h=r;h<t+n;h+=n)l.push(h);return l}function Im(i){var r=af(w({showLast:!0},i));return r}function zn(i){return new Date(i).getFullYear()}function Pm(i){return new Date(i,0,1).getTime()}function Ro(i){return new Date(i).getMonth()}function Fm(i,r){var t=zn(i),e=zn(r),n=Ro(i),a=Ro(r);return(e-t)*12+(a-n)%12}function Om(i,r){return new Date(i,r,1).getTime()}function Dm(i,r){return Math.ceil((r-i)/we)}function Rm(i,r){return Math.ceil((r-i)/lr)}function Ym(i,r){return Math.ceil((r-i)/(60*1e3))}function Gm(i){var r=i.min,t=i.max,e=i.minTickInterval,n=i.tickCount,a=i.tickInterval,o=[];a||(a=(t-r)/n,e&&a<e&&(a=e)),a=Math.max(Math.floor((t-r)/(Math.pow(2,12)-1)),a);var s=zn(r);if(a>wh)for(var l=zn(t),h=Math.ceil(a/wh),u=s;u<=l+h;u=u+h)o.push(Pm(u));else if(a>pi)for(var c=Math.ceil(a/pi),f=Ro(r),v=Fm(r,t),u=0;u<=v+c;u=u+c)o.push(Om(s,u+f));else if(a>we)for(var p=new Date(r),g=p.getFullYear(),d=p.getMonth(),y=p.getDate(),C=Math.ceil(a/we),m=Dm(r,t),u=0;u<m+C;u=u+C)o.push(new Date(g,d,y+u).getTime());else if(a>lr)for(var p=new Date(r),g=p.getFullYear(),d=p.getMonth(),C=p.getDate(),x=p.getHours(),S=Math.ceil(a/lr),b=Rm(r,t),u=0;u<=b+S;u=u+S)o.push(new Date(g,d,C,x+u).getTime());else if(a>sr)for(var A=Ym(r,t),L=Math.ceil(a/sr),u=0;u<=A+L;u=u+L)o.push(r+u*sr);else{var k=a;k<ie&&(k=ie);for(var B=Math.floor(r/ie)*ie,O=Math.ceil((t-r)/ie),R=Math.ceil(k/ie),u=0;u<O+R;u=u+R)o.push(B+u*ie)}return o.length>=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}ge("cat",af);ge("time-cat",Im);ge("wilkinson-extended",bm);ge("r-pretty",Bm);ge("time",km);ge("time-pretty",Gm);ge("log",Am);ge("pow",Tm);ge("quantile",Em);ge("d3-linear",fm);de("cat",xa);de("category",xa);de("identity",lm);de("linear",Ca);de("log",nm);de("pow",am);de("time",om);de("timeCat",im);de("quantize",rf);de("quantile",sm);var sf={},lf=function(i){return sf[i.toLowerCase()]},$i=function(i,r){if(lf(i))throw new Error("Attribute type '"+i+"' existed.");sf[i.toLowerCase()]=r};$i("Color",Xy);$i("Opacity",zy);$i("Position",Wy);$i("Shape",$y);$i("Size",_y);var xs=function(){function i(r){this.type="coordinate",this.isRect=!1,this.isHelix=!1,this.isPolar=!1,this.isReflectX=!1,this.isReflectY=!1;var t=r.start,e=r.end,n=r.matrix,a=n===void 0?[1,0,0,0,1,0,0,0,1]:n,o=r.isTransposed,s=o===void 0?!1:o;this.start=t,this.end=e,this.matrix=a,this.originalMatrix=et([],a),this.isTransposed=s}return i.prototype.initial=function(){this.center={x:(this.start.x+this.end.x)/2,y:(this.start.y+this.end.y)/2},this.width=Math.abs(this.end.x-this.start.x),this.height=Math.abs(this.end.y-this.start.y)},i.prototype.update=function(r){ot(this,r),this.initial()},i.prototype.convertDim=function(r,t){var e,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(e=[o,a],a=e[0],o=e[1]),a+r*(o-a)},i.prototype.invertDim=function(r,t){var e,n=this[t],a=n.start,o=n.end;return this.isReflect(t)&&(e=[o,a],a=e[0],o=e[1]),(r-a)/(o-a)},i.prototype.applyMatrix=function(r,t,e){e===void 0&&(e=0);var n=this.matrix,a=[r,t,e];return bi(a,a,n),a},i.prototype.invertMatrix=function(r,t,e){e===void 0&&(e=0);var n=this.matrix,a=fg([0,0,0,0,0,0,0,0,0],n),o=[r,t,e];return a&&bi(o,o,a),o},i.prototype.convert=function(r){var t=this.convertPoint(r),e=t.x,n=t.y,a=this.applyMatrix(e,n,1);return{x:a[0],y:a[1]}},i.prototype.invert=function(r){var t=this.invertMatrix(r.x,r.y,1);return this.invertPoint({x:t[0],y:t[1]})},i.prototype.rotate=function(r){var t=this.matrix,e=this.center;return Sr(t,t,[-e.x,-e.y]),os(t,t,r),Sr(t,t,[e.x,e.y]),this},i.prototype.reflect=function(r){return r==="x"?this.isReflectX=!this.isReflectX:this.isReflectY=!this.isReflectY,this},i.prototype.scale=function(r,t){var e=this.matrix,n=this.center;return Sr(e,e,[-n.x,-n.y]),sc(e,e,[r,t]),Sr(e,e,[n.x,n.y]),this},i.prototype.translate=function(r,t){var e=this.matrix;return Sr(e,e,[r,t]),this},i.prototype.transpose=function(){return this.isTransposed=!this.isTransposed,this},i.prototype.getCenter=function(){return this.center},i.prototype.getWidth=function(){return this.width},i.prototype.getHeight=function(){return this.height},i.prototype.getRadius=function(){return this.radius},i.prototype.isReflect=function(r){return r==="x"?this.isReflectX:this.isReflectY},i.prototype.resetMatrix=function(r){this.matrix=r||et([],this.originalMatrix)},i}(),hf=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.isRect=!0,e.type="cartesian",e.initial(),e}return r.prototype.initial=function(){i.prototype.initial.call(this);var t=this.start,e=this.end;this.x={start:t.x,end:e.x},this.y={start:t.y,end:e.y}},r.prototype.convertPoint=function(t){var e,n=t.x,a=t.y;return this.isTransposed&&(e=[a,n],n=e[0],a=e[1]),{x:this.convertDim(n,"x"),y:this.convertDim(a,"y")}},r.prototype.invertPoint=function(t){var e,n=this.invertDim(t.x,"x"),a=this.invertDim(t.y,"y");return this.isTransposed&&(e=[a,n],n=e[0],a=e[1]),{x:n,y:a}},r}(xs),Hm=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.isHelix=!0,e.type="helix";var n=t.startAngle,a=n===void 0?1.25*Math.PI:n,o=t.endAngle,s=o===void 0?7.25*Math.PI:o,l=t.innerRadius,h=l===void 0?0:l,u=t.radius;return e.startAngle=a,e.endAngle=s,e.innerRadius=h,e.radius=u,e.initial(),e}return r.prototype.initial=function(){i.prototype.initial.call(this);var t=(this.endAngle-this.startAngle)/(2*Math.PI)+1,e=Math.min(this.width,this.height)/2;this.radius&&this.radius>=0&&this.radius<=1&&(e=e*this.radius),this.d=Math.floor(e*(1-this.innerRadius)/t),this.a=this.d/(Math.PI*2),this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*e,end:this.innerRadius*e+this.d*.99}},r.prototype.convertPoint=function(t){var e,n=t.x,a=t.y;this.isTransposed&&(e=[a,n],n=e[0],a=e[1]);var o=this.convertDim(n,"x"),s=this.a*o,l=this.convertDim(a,"y");return{x:this.center.x+Math.cos(o)*(s+l),y:this.center.y+Math.sin(o)*(s+l)}},r.prototype.invertPoint=function(t){var e,n=this.d+this.y.start,a=ac([0,0],[t.x,t.y],[this.center.x,this.center.y]),o=ss(a,[1,0],!0),s=o*this.a;Lr(a)<s&&(s=Lr(a));var l=Math.floor((Lr(a)-s)/n);o=2*l*Math.PI+o;var h=this.a*o,u=Lr(a)-h;u=xt(u,0)?0:u;var c=this.invertDim(o,"x"),f=this.invertDim(u,"y");return c=xt(c,0)?0:c,f=xt(f,0)?0:f,this.isTransposed&&(e=[f,c],c=e[0],f=e[1]),{x:c,y:f}},r}(xs),Vm=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.isPolar=!0,e.type="polar";var n=t.startAngle,a=n===void 0?-Math.PI/2:n,o=t.endAngle,s=o===void 0?Math.PI*3/2:o,l=t.innerRadius,h=l===void 0?0:l,u=t.radius;return e.startAngle=a,e.endAngle=s,e.innerRadius=h,e.radius=u,e.initial(),e}return r.prototype.initial=function(){for(i.prototype.initial.call(this);this.endAngle<this.startAngle;)this.endAngle+=Math.PI*2;var t=this.getOneBox(),e=t.maxX-t.minX,n=t.maxY-t.minY,a=Math.abs(t.minX)/e,o=Math.abs(t.minY)/n,s;this.height/n>this.width/e?(s=this.width/e,this.circleCenter={x:this.center.x-(.5-a)*this.width,y:this.center.y-(.5-o)*s*n}):(s=this.height/n,this.circleCenter={x:this.center.x-(.5-a)*s*e,y:this.center.y-(.5-o)*this.height}),this.polarRadius=this.radius,this.radius?this.radius>0&&this.radius<=1?this.polarRadius=s*this.radius:(this.radius<=0||this.radius>s)&&(this.polarRadius=s):this.polarRadius=s,this.x={start:this.startAngle,end:this.endAngle},this.y={start:this.innerRadius*this.polarRadius,end:this.polarRadius}},r.prototype.getRadius=function(){return this.polarRadius},r.prototype.convertPoint=function(t){var e,n=this.getCenter(),a=t.x,o=t.y;return this.isTransposed&&(e=[o,a],a=e[0],o=e[1]),a=this.convertDim(a,"x"),o=this.convertDim(o,"y"),{x:n.x+Math.cos(a)*o,y:n.y+Math.sin(a)*o}},r.prototype.invertPoint=function(t){var e,n=this.getCenter(),a=[t.x-n.x,t.y-n.y],o=this,s=o.startAngle,l=o.endAngle;this.isReflect("x")&&(e=[l,s],s=e[0],l=e[1]);var h=[1,0,0,0,1,0,0,0,1];os(h,h,s);var u=[1,0,0];bi(u,u,h);var c=[u[0],u[1]],f=ss(c,a,l<s);xt(f,Math.PI*2)&&(f=0);var v=Lr(a),p=f/(l-s);p=l-s>0?p:-p;var g=this.invertDim(v,"y"),d={x:0,y:0};return d.x=this.isTransposed?g:p,d.y=this.isTransposed?p:g,d},r.prototype.getCenter=function(){return this.circleCenter},r.prototype.getOneBox=function(){var t=this.startAngle,e=this.endAngle;if(Math.abs(e-t)>=Math.PI*2)return{minX:-1,maxX:1,minY:-1,maxY:1};for(var n=[0,Math.cos(t),Math.cos(e)],a=[0,Math.sin(t),Math.sin(e)],o=Math.min(t,e);o<Math.max(t,e);o+=Math.PI/18)n.push(Math.cos(o)),a.push(Math.sin(o));return{minX:Math.min.apply(Math,n),maxX:Math.max.apply(Math,n),minY:Math.min.apply(Math,a),maxY:Math.max.apply(Math,a)}},r}(xs),uf={},Nm=function(i){return uf[i.toLowerCase()]},Ma=function(i,r){uf[i.toLowerCase()]=r};Ma("rect",hf);Ma("cartesian",hf);Ma("polar",Vm);Ma("helix",Hm);function cf(i,r,t){var e=new Ni(r,t);e.target=i,e.propagationPath.push(i),i.emitDelegation(r,e);for(var n=i.getParent();n;)n.emitDelegation(r,e),e.propagationPath.push(n),n=n.getParent()}var ff=[1,0,0,0,1,0,0,0,1];function vr(i,r,t){if(t===void 0&&(t=ff),!r)return null;var e=ct(t,[["t",-i.x,-i.y],["r",r],["t",i.x,i.y]]);return e}function ws(i,r){return!i.x&&!i.y?null:ct(r||ff,[["t",i.x,i.y]])}function Xm(i){var r=[1,0,0],t=[0,0,0];return bi(t,r,i),Math.atan2(t[1],t[0])}function hn(i,r){var t=[0,0];return xg(t,r,i),t}function zm(i,r){var t=hn(i,[r.minX,r.minY]),e=hn(i,[r.maxX,r.minY]),n=hn(i,[r.minX,r.maxY]),a=hn(i,[r.maxX,r.maxY]),o=Math.min(t[0],e[0],n[0],a[0]),s=Math.max(t[0],e[0],n[0],a[0]),l=Math.min(t[1],e[1],n[1],a[1]),h=Math.max(t[1],e[1],n[1],a[1]);return{x:o,y:l,minX:o,minY:l,maxX:s,maxY:h,width:s-o,height:h-l}}function vf(i,r,t,e){if(r){var n=vr({x:t,y:e},r,i.getMatrix());i.setMatrix(n)}}function gi(i,r,t){var e=ws({x:r,y:t});i.attr("matrix",e)}function Wn(i){var r=0,t=0,e=0,n=0;return U(i)?r=t=e=n=i:P(i)&&(r=i[0],e=I(i[1])?i[0]:i[1],n=I(i[2])?i[0]:i[2],t=I(i[3])?e:i[3]),[r,e,n,t]}function Cs(i){for(var r=i.childNodes,t=r.length,e=t-1;e>=0;e--)i.removeChild(r[e])}function Wm(i,r){return!!i.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))}function Ii(i){var r=i.start,t=i.end,e=Math.min(r.x,t.x),n=Math.min(r.y,t.y),a=Math.max(r.x,t.x),o=Math.max(r.y,t.y);return{x:e,y:n,minX:e,minY:n,maxX:a,maxY:o,width:a-e,height:o-n}}function $m(i){var r=i.map(function(s){return s.x}),t=i.map(function(s){return s.y}),e=Math.min.apply(Math,r),n=Math.min.apply(Math,t),a=Math.max.apply(Math,r),o=Math.max.apply(Math,t);return{x:e,y:n,minX:e,minY:n,maxX:a,maxY:o,width:a-e,height:o-n}}function Sa(i,r,t,e){var n=i+t,a=r+e;return{x:i,y:r,width:t,height:e,minX:i,minY:r,maxX:isNaN(n)?0:n,maxY:isNaN(a)?0:a}}function hr(i,r,t){return(1-t)*i+r*t}function Pr(i,r,t){return{x:i.x+Math.cos(t)*r,y:i.y+Math.sin(t)*r}}function _m(i,r){var t=r.x-i.x,e=r.y-i.y;return Math.sqrt(t*t+e*e)}var $n=function(i,r,t){return t===void 0&&(t=Math.pow(Number.EPSILON,.5)),[i,r].includes(1/0)?Math.abs(i)===Math.abs(r):Math.abs(i-r)<t};function jm(i,r){var t=Math.max(i.minX,r.minX),e=Math.max(i.minY,r.minY),n=Math.min(i.maxX,r.maxX),a=Math.min(i.maxY,r.maxY);return Sa(t,e,n-t,a-e)}function pf(i){var r=i.getClip(),t=r&&r.getBBox(),e;if(!i.isGroup())e=i.getBBox();else{var n=1/0,a=-1/0,o=1/0,s=-1/0,l=i.getChildren();l.length>0?M(l,function(h){if(h.get("visible")){if(h.isGroup()&&h.get("children").length===0)return!0;var u=pf(h),c=h.applyToMatrix([u.minX,u.minY,1]),f=h.applyToMatrix([u.minX,u.maxY,1]),v=h.applyToMatrix([u.maxX,u.minY,1]),p=h.applyToMatrix([u.maxX,u.maxY,1]),g=Math.min(c[0],f[0],v[0],p[0]),d=Math.max(c[0],f[0],v[0],p[0]),y=Math.min(c[1],f[1],v[1],p[1]),C=Math.max(c[1],f[1],v[1],p[1]);g<n&&(n=g),d>a&&(a=d),y<o&&(o=y),C>s&&(s=C)}}):(n=0,a=0,o=0,s=0),e=Sa(n,o,a-n,s-o)}return t?jm(e,t):e}function Um(i,r){if(!(!i.getClip()&&!r.getClip())){var t=r.getClip();if(!t){i.setClip(null);return}var e={type:t.get("type"),attrs:t.attr()};i.setClip(e)}}function Pt(i){return i+"px"}function gf(i,r,t,e){var n=_m(i,r),a=e/n,o=0;return t==="start"?o=0-a:t==="end"&&(o=1+a),{x:hr(i.x,r.x,o),y:hr(i.y,r.y,o)}}var qm={none:[],point:["x","y"],region:["start","end"],points:["points"],circle:["center","radius","startAngle","endAngle"]},df=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.initCfg(),e}return r.prototype.getDefaultCfg=function(){return{id:"",name:"",type:"",locationType:"none",offsetX:0,offsetY:0,animate:!1,capture:!0,updateAutoRender:!1,animateOption:{appear:null,update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},events:null,defaultCfg:{},visible:!0}},r.prototype.clear=function(){},r.prototype.update=function(t){var e=this,n=this.get("defaultCfg")||{};M(t,function(a,o){var s=e.get(o),l=a;s!==a&&(rt(a)&&n[o]&&(l=D({},n[o],a)),e.set(o,l))}),this.updateInner(t),this.afterUpdate(t)},r.prototype.updateInner=function(t){},r.prototype.afterUpdate=function(t){Or(t,"visible")&&(t.visible?this.show():this.hide()),Or(t,"capture")&&this.setCapture(t.capture)},r.prototype.getLayoutBBox=function(){return this.getBBox()},r.prototype.getLocationType=function(){return this.get("locationType")},r.prototype.getOffset=function(){return{offsetX:this.get("offsetX"),offsetY:this.get("offsetY")}},r.prototype.setOffset=function(t,e){this.update({offsetX:t,offsetY:e})},r.prototype.setLocation=function(t){var e=w({},t);this.update(e)},r.prototype.getLocation=function(){var t=this,e={},n=this.get("locationType"),a=qm[n];return M(a,function(o){e[o]=t.get(o)}),e},r.prototype.isList=function(){return!1},r.prototype.isSlider=function(){return!1},r.prototype.init=function(){},r.prototype.initCfg=function(){var t=this,e=this.get("defaultCfg");M(e,function(n,a){var o=t.get(a);if(rt(o)){var s=D({},n,o);t.set(a,s)}})},r}(na),Ke="update_status",Zm=["visible","tip","delegateObject"],Qm=["container","group","shapesMap","isRegister","isUpdating","destroyed"],St=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{container:null,shapesMap:{},group:null,capture:!0,isRegister:!1,isUpdating:!1,isInit:!0})},r.prototype.remove=function(){this.clear();var t=this.get("group");t.remove()},r.prototype.clear=function(){var t=this.get("group");t.clear(),this.set("shapesMap",{}),this.clearOffScreenCache(),this.set("isInit",!0)},r.prototype.getChildComponentById=function(t){var e=this.getElementById(t),n=e&&e.get("component");return n},r.prototype.getElementById=function(t){return this.get("shapesMap")[t]},r.prototype.getElementByLocalId=function(t){var e=this.getElementId(t);return this.getElementById(e)},r.prototype.getElementsByName=function(t){var e=[];return M(this.get("shapesMap"),function(n){n.get("name")===t&&e.push(n)}),e},r.prototype.getContainer=function(){return this.get("container")},r.prototype.updateInner=function(t){this.offScreenRender(),this.get("updateAutoRender")&&this.render()},r.prototype.render=function(){var t=this.get("offScreenGroup");t||(t=this.offScreenRender());var e=this.get("group");this.updateElements(t,e),this.deleteElements(),this.applyOffset(),this.get("eventInitted")||(this.initEvent(),this.set("eventInitted",!0)),this.set("isInit",!1)},r.prototype.show=function(){var t=this.get("group");t.show(),this.set("visible",!0)},r.prototype.hide=function(){var t=this.get("group");t.hide(),this.set("visible",!1)},r.prototype.setCapture=function(t){var e=this.get("group");e.set("capture",t),this.set("capture",t)},r.prototype.destroy=function(){this.removeEvent(),this.remove(),i.prototype.destroy.call(this)},r.prototype.getBBox=function(){return this.get("group").getCanvasBBox()},r.prototype.getLayoutBBox=function(){var t=this.get("group"),e=this.getInnerLayoutBBox(),n=t.getTotalMatrix();return n&&(e=zm(n,e)),e},r.prototype.on=function(t,e,n){var a=this.get("group");return a.on(t,e,n),this},r.prototype.off=function(t,e){var n=this.get("group");return n&&n.off(t,e),this},r.prototype.emit=function(t,e){var n=this.get("group");n.emit(t,e)},r.prototype.init=function(){i.prototype.init.call(this),this.get("group")||this.initGroup(),this.offScreenRender()},r.prototype.getInnerLayoutBBox=function(){return this.get("offScreenBBox")||this.get("group").getBBox()},r.prototype.delegateEmit=function(t,e){var n=this.get("group");e.target=n,n.emit(t,e),cf(n,t,e)},r.prototype.createOffScreenGroup=function(){var t=this.get("group"),e=t.getGroupBase(),n=new e({delegateObject:this.getDelegateObject()});return n},r.prototype.applyOffset=function(){var t=this.get("offsetX"),e=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t,y:e})},r.prototype.initGroup=function(){var t=this.get("container");this.set("group",t.addGroup({id:this.get("id"),name:this.get("name"),capture:this.get("capture"),visible:this.get("visible"),isComponent:!0,component:this,delegateObject:this.getDelegateObject()}))},r.prototype.offScreenRender=function(){this.clearOffScreenCache();var t=this.createOffScreenGroup();return this.renderInner(t),this.set("offScreenGroup",t),this.set("offScreenBBox",pf(t)),t},r.prototype.addGroup=function(t,e){this.appendDelegateObject(t,e);var n=t.addGroup(e);return this.get("isRegister")&&this.registerElement(n),n},r.prototype.addShape=function(t,e){this.appendDelegateObject(t,e);var n=t.addShape(e);return this.get("isRegister")&&this.registerElement(n),n},r.prototype.addComponent=function(t,e){var n=e.id,a=e.component,o=mt(e,["id","component"]),s=new a(w(w({},o),{id:n,container:t,updateAutoRender:this.get("updateAutoRender")}));return s.init(),s.render(),this.get("isRegister")&&this.registerElement(s.get("group")),s},r.prototype.initEvent=function(){},r.prototype.removeEvent=function(){var t=this.get("group");t.off()},r.prototype.getElementId=function(t){var e=this.get("id"),n=this.get("name");return e+"-"+n+"-"+t},r.prototype.registerElement=function(t){var e=t.get("id");this.get("shapesMap")[e]=t},r.prototype.unregisterElement=function(t){var e=t.get("id");delete this.get("shapesMap")[e]},r.prototype.moveElementTo=function(t,e){var n=ws(e);t.attr("matrix",n)},r.prototype.addAnimation=function(t,e,n){var a=e.attr("opacity");I(a)&&(a=1),e.attr("opacity",0),e.animate({opacity:a},n)},r.prototype.removeAnimation=function(t,e,n){e.animate({opacity:0},n)},r.prototype.updateAnimation=function(t,e,n,a){e.animate(n,a)},r.prototype.updateElements=function(t,e){var n=this,a=this.get("animate"),o=this.get("animateOption"),s=t.getChildren().slice(0),l;M(s,function(h){var u=h.get("id"),c=n.getElementById(u),f=h.get("name");if(c)if(h.get("isComponent")){var v=h.get("component"),p=c.get("component"),g=rs(v.cfg,ep(Vi(v.cfg),Qm));p.update(g),c.set(Ke,"update")}else{var d=n.getReplaceAttrs(c,h);a&&o.update?n.updateAnimation(f,c,d,o.update):c.attr(d),h.isGroup()&&n.updateElements(h,c),M(Zm,function(x){c.set(x,h.get(x))}),Um(c,h),l=c,c.set(Ke,"update")}else{e.add(h);var y=e.getChildren();if(y.splice(y.length-1,1),l){var C=y.indexOf(l);y.splice(C+1,0,h)}else y.unshift(h);if(n.registerElement(h),h.set(Ke,"add"),h.get("isComponent")){var v=h.get("component");v.set("container",e)}else h.isGroup()&&n.registerNewGroup(h);if(l=h,a){var m=n.get("isInit")?o.appear:o.enter;m&&n.addAnimation(f,h,m)}}})},r.prototype.clearUpdateStatus=function(t){var e=t.getChildren();M(e,function(n){n.set(Ke,null)})},r.prototype.clearOffScreenCache=function(){var t=this.get("offScreenGroup");t&&t.destroy(),this.set("offScreenGroup",null),this.set("offScreenBBox",null)},r.prototype.getDelegateObject=function(){var t,e=this.get("name"),n=(t={},t[e]=this,t.component=this,t);return n},r.prototype.appendDelegateObject=function(t,e){var n=t.get("delegateObject");e.delegateObject||(e.delegateObject={}),ot(e.delegateObject,n)},r.prototype.getReplaceAttrs=function(t,e){var n=t.attr(),a=e.attr();return M(n,function(o,s){a[s]===void 0&&(a[s]=void 0)}),a},r.prototype.registerNewGroup=function(t){var e=this,n=t.getChildren();M(n,function(a){e.registerElement(a),a.set(Ke,"add"),a.isGroup()&&e.registerNewGroup(a)})},r.prototype.deleteElements=function(){var t=this,e=this.get("shapesMap"),n=[];M(e,function(s,l){!s.get(Ke)||s.destroyed?n.push([l,s]):s.set(Ke,null)});var a=this.get("animate"),o=this.get("animateOption");M(n,function(s){var l=s[0],h=s[1];if(!h.destroyed){var u=h.get("name");if(a&&o.leave){var c=ot({callback:function(){t.removeElement(h)}},o.leave);t.removeAnimation(u,h,c)}else t.removeElement(h)}delete e[l]})},r.prototype.removeElement=function(t){if(t.get("isGroup")){var e=t.get("component");e&&e.destroy()}t.remove()},r}(df),Za="\u2026";function Km(i){for(var r=0,t=0;t<i.length;t++)r+=er(i,t);return r}function er(i,r){return i.charCodeAt(r)>0&&i.charCodeAt(r)<128?1:2}function Jm(i,r,t){t===void 0&&(t="tail");var e=i.length,n="";if(t==="tail"){for(var a=0,o=0;a<r;){var s=er(i,o);if(a+s<=r)n+=i[o],a+=er(i,o),o++;else break}n+=Za}else if(t==="head"){for(var a=0,o=e-1;a<r;){var s=er(i,o);if(a+s<=r)n+=i[o],a+=er(i,o),o--;else break}n=Za+n}else{for(var l="",h="",a=0,u=0,c=e-1;a<r;){var f=er(i,u),v=!1;f+a<=r&&(l+=i[u],u++,a+=f,v=!0);var p=er(i,c);if(p+a<=r&&(h=i[c]+h,a+=p,c--,v=!0),!v)break}n=l+Za+h}return n}var t0="\u2026",e0=2,r0=400;function i0(i){for(var r=i.map(function(l){var h=l.attr("text");return I(h)?"":""+h}),t=0,e=0,n=0;n<r.length;n+=1){for(var a=0,o=0;o<=r[n].length;o+=1){var s=r[n].charCodeAt(o);s>=19968&&s<=40869?a+=2:a+=1}a>t&&(t=a,e=n)}return i[e].getBBox().width}function Yo(i){if(i.length>r0)return i0(i);var r=0;return M(i,function(t){var e=t.getBBox(),n=e.width;r<n&&(r=n)}),r}function n0(i,r){var t=r.getCanvasBBox();return i?t.width:t.height}function di(i,r,t,e){var n;e===void 0&&(e="tail");var a=(n=r.attr("text"))!==null&&n!==void 0?n:"";if(e==="tail"){var o=rs(r.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),s=Lp(a,t,o,"\u2026");return a!==s?(r.attr("text",s),r.set("tip",a),!0):(r.set("tip",null),!1)}var l=n0(i,r),h=Km(a),u=!1;if(t<l){var c=Math.floor(t/l*h)-e0,f=void 0;c>=0?f=Jm(a,c,e):f=t0,f&&(r.attr("text",f),u=!0)}return u?r.set("tip",a):r.set("tip",null),u}function ba(i,r){var t=r.x,e=r.y,n=r.content,a=r.style,o=r.id,s=r.name,l=r.rotate,h=r.maxLength,u=r.autoEllipsis,c=r.isVertical,f=r.ellipsisPosition,v=r.background,p=i.addGroup({id:o+"-group",name:s+"-group",attrs:{x:t,y:e}}),g=p.addShape({type:"text",id:o,name:s,attrs:w({x:0,y:0,text:n},a)}),d=Wn(T(v,"padding",0));if(h&&u){var y=h-(d[1]+d[3]);di(!c,g,y,f)}if(v){var C=T(v,"style",{}),m=g.getCanvasBBox(),x=m.minX,S=m.minY,b=m.width,A=m.height,L=p.addShape("rect",{id:o+"-bg",name:o+"-bg",attrs:w({x:x-d[3],y:S-d[0],width:b+d[1]+d[3],height:A+d[0]+d[2]},C)});L.toBack()}gi(p,t,e),vf(p,l,t,e)}const X={fontFamily:`
BlinkMacSystemFont, "Segoe UI", Roboto,"Helvetica Neue",
Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
SimSun, "sans-serif"`,textColor:"#2C3542",activeTextColor:"#333333",uncheckedColor:"#D8D8D8",lineColor:"#416180",regionColor:"#CCD7EB",verticalAxisRotate:-Math.PI/4,horizontalAxisRotate:Math.PI/4,descriptionIconStroke:"#fff",descriptionIconFill:"rgba(58, 73, 101, .25)"};var a0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"line",locationType:"region",start:null,end:null,style:{},text:null,defaultCfg:{style:{fill:X.textColor,fontSize:12,textAlign:"center",textBaseline:"bottom",fontFamily:X.fontFamily},text:{position:"center",autoRotate:!0,content:null,offsetX:0,offsetY:0,style:{stroke:X.lineColor,lineWidth:1}}}})},r.prototype.renderInner=function(t){this.renderLine(t),this.get("text")&&this.renderLabel(t)},r.prototype.renderLine=function(t){var e=this.get("start"),n=this.get("end"),a=this.get("style");this.addShape(t,{type:"line",id:this.getElementId("line"),name:"annotation-line",attrs:w({x1:e.x,y1:e.y,x2:n.x,y2:n.y},a)})},r.prototype.getLabelPoint=function(t,e,n){var a;return n==="start"?a=0:n==="center"?a=.5:N(n)&&n.indexOf("%")!==-1?a=parseInt(n,10)/100:U(n)?a=n:a=1,(a>1||a<0)&&(a=1),{x:hr(t.x,e.x,a),y:hr(t.y,e.y,a)}},r.prototype.renderLabel=function(t){var e=this.get("text"),n=this.get("start"),a=this.get("end"),o=e.position,s=e.content,l=e.style,h=e.offsetX,u=e.offsetY,c=e.autoRotate,f=e.maxLength,v=e.autoEllipsis,p=e.ellipsisPosition,g=e.background,d=e.isVertical,y=d===void 0?!1:d,C=this.getLabelPoint(n,a,o),m=C.x+h,x=C.y+u,S={id:this.getElementId("line-text"),name:"annotation-line-text",x:m,y:x,content:s,style:l,maxLength:f,autoEllipsis:v,ellipsisPosition:p,background:g,isVertical:y};if(c){var b=[a.x-n.x,a.y-n.y];S.rotate=Math.atan2(b[1],b[0])}ba(t,S)},r}(St),o0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"text",locationType:"point",x:0,y:0,content:"",rotate:null,style:{},background:null,maxLength:null,autoEllipsis:!0,isVertical:!1,ellipsisPosition:"tail",defaultCfg:{style:{fill:X.textColor,fontSize:12,textAlign:"center",textBaseline:"middle",fontFamily:X.fontFamily}}})},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},r.prototype.renderInner=function(t){var e=this.getLocation(),n=e.x,a=e.y,o=this.get("content"),s=this.get("style"),l=this.getElementId("text"),h=this.get("name")+"-text",u=this.get("maxLength"),c=this.get("autoEllipsis"),f=this.get("isVertical"),v=this.get("ellipsisPosition"),p=this.get("background"),g=this.get("rotate"),d={id:l,name:h,x:n,y:a,content:o,style:s,maxLength:u,autoEllipsis:c,isVertical:f,ellipsisPosition:v,background:p,rotate:g};ba(t,d)},r.prototype.resetLocation=function(){var t=this.getElementByLocalId("text-group");if(t){var e=this.getLocation(),n=e.x,a=e.y,o=this.get("rotate");gi(t,n,a),vf(t,o,n,a)}},r}(St),s0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"arc",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2,style:{stroke:"#999",lineWidth:1}})},r.prototype.renderInner=function(t){this.renderArc(t)},r.prototype.getArcPath=function(){var t=this.getLocation(),e=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=Pr(e,n,a),l=Pr(e,n,o),h=o-a>Math.PI?1:0,u=[["M",s.x,s.y]];if(o-a===Math.PI*2){var c=Pr(e,n,a+Math.PI);u.push(["A",n,n,0,h,1,c.x,c.y]),u.push(["A",n,n,0,h,1,l.x,l.y])}else u.push(["A",n,n,0,h,1,l.x,l.y]);return u},r.prototype.renderArc=function(t){var e=this.getArcPath(),n=this.get("style");this.addShape(t,{type:"path",id:this.getElementId("arc"),name:"annotation-arc",attrs:w({path:e},n)})},r}(St),l0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"region",locationType:"region",start:null,end:null,style:{},defaultCfg:{style:{lineWidth:0,fill:X.regionColor,opacity:.4}}})},r.prototype.renderInner=function(t){this.renderRegion(t)},r.prototype.renderRegion=function(t){var e=this.get("start"),n=this.get("end"),a=this.get("style"),o=Ii({start:e,end:n});this.addShape(t,{type:"rect",id:this.getElementId("region"),name:"annotation-region",attrs:w({x:o.x,y:o.y,width:o.width,height:o.height},a)})},r}(St),h0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"image",locationType:"region",start:null,end:null,src:null,style:{}})},r.prototype.renderInner=function(t){this.renderImage(t)},r.prototype.getImageAttrs=function(){var t=this.get("start"),e=this.get("end"),n=this.get("style"),a=Ii({start:t,end:e}),o=this.get("src");return w({x:a.x,y:a.y,img:o,width:a.width,height:a.height},n)},r.prototype.renderImage=function(t){this.addShape(t,{type:"image",id:this.getElementId("image"),name:"annotation-image",attrs:this.getImageAttrs()})},r}(St),u0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"dataMarker",locationType:"point",x:0,y:0,point:{},line:{},text:{},direction:"upward",autoAdjust:!0,coordinateBBox:null,defaultCfg:{point:{display:!0,style:{r:3,fill:"#FFFFFF",stroke:"#1890FF",lineWidth:2}},line:{display:!0,length:20,style:{stroke:X.lineColor,lineWidth:1}},text:{content:"",display:!0,style:{fill:X.textColor,opacity:.65,fontSize:12,textAlign:"start",fontFamily:X.fontFamily}}}})},r.prototype.renderInner=function(t){T(this.get("line"),"display")&&this.renderLine(t),T(this.get("text"),"display")&&this.renderText(t),T(this.get("point"),"display")&&this.renderPoint(t),this.get("autoAdjust")&&this.autoAdjust(t)},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x")+this.get("offsetX"),y:this.get("y")+this.get("offsetY")})},r.prototype.renderPoint=function(t){var e=this.getShapeAttrs().point;this.addShape(t,{type:"circle",id:this.getElementId("point"),name:"annotation-point",attrs:e})},r.prototype.renderLine=function(t){var e=this.getShapeAttrs().line;this.addShape(t,{type:"path",id:this.getElementId("line"),name:"annotation-line",attrs:e})},r.prototype.renderText=function(t){var e=this.getShapeAttrs().text,n=e.x,a=e.y,o=e.text,s=mt(e,["x","y","text"]),l=this.get("text"),h=l.background,u=l.maxLength,c=l.autoEllipsis,f=l.isVertival,v=l.ellipsisPosition,p={x:n,y:a,id:this.getElementId("text"),name:"annotation-text",content:o,style:s,background:h,maxLength:u,autoEllipsis:c,isVertival:f,ellipsisPosition:v};ba(t,p)},r.prototype.autoAdjust=function(t){var e=this.get("direction"),n=this.get("x"),a=this.get("y"),o=T(this.get("line"),"length",0),s=this.get("coordinateBBox"),l=t.getBBox(),h=l.minX,u=l.maxX,c=l.minY,f=l.maxY,v=t.findById(this.getElementId("text-group")),p=t.findById(this.getElementId("text")),g=t.findById(this.getElementId("line"));if(!!s){if(v){if(n+h<=s.minX){var d=s.minX-(n+h);gi(v,v.attr("x")+d,v.attr("y"))}if(n+u>=s.maxX){var d=n+u-s.maxX;gi(v,v.attr("x")-d,v.attr("y"))}}if(e==="upward"&&a+c<=s.minY||e!=="upward"&&a+f>=s.maxY){var y=void 0,C=void 0;e==="upward"&&a+c<=s.minY?(y="top",C=1):(y="bottom",C=-1),p.attr("textBaseline",y),g&&g.attr("path",[["M",0,0],["L",0,o*C]]),gi(v,v.attr("x"),(o+2)*C)}}},r.prototype.getShapeAttrs=function(){var t=T(this.get("line"),"display"),e=T(this.get("point"),"style",{}),n=T(this.get("line"),"style",{}),a=T(this.get("text"),"style",{}),o=this.get("direction"),s=t?T(this.get("line"),"length",0):0,l=o==="upward"?-1:1;return{point:w({x:0,y:0},e),line:w({path:[["M",0,0],["L",0,s*l]]},n),text:w({x:0,y:(s+2)*l,text:T(this.get("text"),"content",""),textBaseline:o==="upward"?"bottom":"top"},a)}},r}(St),c0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"dataRegion",locationType:"points",points:[],lineLength:0,region:{},text:{},defaultCfg:{region:{style:{lineWidth:0,fill:X.regionColor,opacity:.4}},text:{content:"",style:{textAlign:"center",textBaseline:"bottom",fontSize:12,fill:X.textColor,fontFamily:X.fontFamily}}}})},r.prototype.renderInner=function(t){var e=T(this.get("region"),"style",{});T(this.get("text"),"style",{});var n=this.get("lineLength")||0,a=this.get("points");if(!!a.length){var o=$m(a),s=[];s.push(["M",a[0].x,o.minY-n]),a.forEach(function(h){s.push(["L",h.x,h.y])}),s.push(["L",a[a.length-1].x,a[a.length-1].y-n]),this.addShape(t,{type:"path",id:this.getElementId("region"),name:"annotation-region",attrs:w({path:s},e)});var l=w({id:this.getElementId("text"),name:"annotation-text",x:(o.minX+o.maxX)/2,y:o.minY-n},this.get("text"));ba(t,l)}},r}(St),f0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"regionFilter",locationType:"region",start:null,end:null,color:null,shape:[]})},r.prototype.renderInner=function(t){var e=this,n=this.get("start"),a=this.get("end"),o=this.addGroup(t,{id:this.getElementId("region-filter"),capture:!1});M(this.get("shapes"),function(l,h){var u=l.get("type"),c=Xt(l.attr());e.adjustShapeAttrs(c),e.addShape(o,{id:e.getElementId("shape-"+u+"-"+h),capture:!1,type:u,attrs:c})});var s=Ii({start:n,end:a});o.setClip({type:"rect",attrs:{x:s.minX,y:s.minY,width:s.width,height:s.height}})},r.prototype.adjustShapeAttrs=function(t){var e=this.get("color");t.fill&&(t.fill=t.fillStyle=e),t.stroke=t.strokeStyle=e},r}(St),v0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"shape",draw:Ye})},r.prototype.renderInner=function(t){var e=this.get("render");G(e)&&e(t)},r}(St),Ms=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{container:null,containerTpl:"<div></div>",updateAutoRender:!0,containerClassName:"",parent:null})},r.prototype.getContainer=function(){return this.get("container")},r.prototype.show=function(){var t=this.get("container");t.style.display="",this.set("visible",!0)},r.prototype.hide=function(){var t=this.get("container");t.style.display="none",this.set("visible",!1)},r.prototype.setCapture=function(t){var e=this.getContainer(),n=t?"auto":"none";e.style.pointerEvents=n,this.set("capture",t)},r.prototype.getBBox=function(){var t=this.getContainer(),e=parseFloat(t.style.left)||0,n=parseFloat(t.style.top)||0;return Sa(e,n,t.clientWidth,t.clientHeight)},r.prototype.clear=function(){var t=this.get("container");Cs(t)},r.prototype.destroy=function(){this.removeEvent(),this.removeDom(),i.prototype.destroy.call(this)},r.prototype.init=function(){i.prototype.init.call(this),this.initContainer(),this.initDom(),this.resetStyles(),this.applyStyles(),this.initEvent(),this.initCapture(),this.initVisible()},r.prototype.initCapture=function(){this.setCapture(this.get("capture"))},r.prototype.initVisible=function(){this.get("visible")?this.show():this.hide()},r.prototype.initDom=function(){},r.prototype.initContainer=function(){var t=this.get("container");if(I(t)){t=this.createDom();var e=this.get("parent");N(e)&&(e=document.getElementById(e),this.set("parent",e)),e.appendChild(t),this.get("containerId")&&t.setAttribute("id",this.get("containerId")),this.set("container",t)}else N(t)&&(t=document.getElementById(t),this.set("container",t));this.get("parent")||this.set("parent",t.parentNode)},r.prototype.resetStyles=function(){var t=this.get("domStyles"),e=this.get("defaultStyles");t?t=D({},e,t):t=e,this.set("domStyles",t)},r.prototype.applyStyles=function(){var t=this.get("domStyles");if(!!t){var e=this.getContainer();this.applyChildrenStyles(e,t);var n=this.get("containerClassName");if(n&&Wm(e,n)){var a=t[n];bt(e,a)}}},r.prototype.applyChildrenStyles=function(t,e){M(e,function(n,a){var o=t.getElementsByClassName(a);M(o,function(s){bt(s,n)})})},r.prototype.applyStyle=function(t,e){var n=this.get("domStyles");bt(e,n[t])},r.prototype.createDom=function(){var t=this.get("containerTpl");return Xe(t)},r.prototype.initEvent=function(){},r.prototype.removeDom=function(){var t=this.get("container");t&&t.parentNode&&t.parentNode.removeChild(t)},r.prototype.removeEvent=function(){},r.prototype.updateInner=function(t){Or(t,"domStyles")&&(this.resetStyles(),this.applyStyles()),this.resetPosition()},r.prototype.resetPosition=function(){},r}(df),p0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"annotation",type:"html",locationType:"point",x:0,y:0,containerTpl:'<div class="g2-html-annotation" style="position:absolute"></div>',alignX:"left",alignY:"top",html:"",zIndex:7})},r.prototype.render=function(){var t=this.getContainer(),e=this.get("html");Cs(t);var n=G(e)?e(t):e;if(zu(n))t.appendChild(n);else if(N(n)||U(n)){var a=Xe(""+n);a&&t.appendChild(a)}this.resetPosition()},r.prototype.resetPosition=function(){var t=this.getContainer(),e=this.getLocation(),n=e.x,a=e.y,o=this.get("alignX"),s=this.get("alignY"),l=this.get("offsetX"),h=this.get("offsetY"),u=Op(t),c=Pp(t),f={x:n,y:a};o==="middle"?f.x-=Math.round(u/2):o==="right"&&(f.x-=Math.round(u)),s==="middle"?f.y-=Math.round(c/2):s==="bottom"&&(f.y-=Math.round(c)),l&&(f.x+=l),h&&(f.y+=h),bt(t,{position:"absolute",left:f.x+"px",top:f.y+"px",zIndex:this.get("zIndex")})},r}(Ms);const g0=Object.freeze(Object.defineProperty({__proto__:null,Line:a0,Text:o0,Arc:s0,Region:l0,Image:h0,DataMarker:u0,DataRegion:c0,RegionFilter:f0,Shape:v0,Html:p0},Symbol.toStringTag,{value:"Module"}));function li(i,r,t){var e=r+"Style",n=null;return M(t,function(a,o){i[o]&&a[e]&&(n||(n={}),ot(n,a[e]))}),n}var yf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"axis",ticks:[],line:{},tickLine:{},subTickLine:null,title:null,label:{},verticalFactor:1,verticalLimitLength:null,overlapOrder:["autoRotate","autoEllipsis","autoHide"],tickStates:{},optimize:{},defaultCfg:{line:{style:{lineWidth:1,stroke:X.lineColor}},tickLine:{style:{lineWidth:1,stroke:X.lineColor},alignTick:!0,length:5,displayWithLabel:!0},subTickLine:{style:{lineWidth:1,stroke:X.lineColor},count:4,length:2},label:{autoRotate:!0,autoHide:!1,autoEllipsis:!1,style:{fontSize:12,fill:X.textColor,fontFamily:X.fontFamily,fontWeight:"normal"},offset:10,offsetX:0,offsetY:0},title:{autoRotate:!0,spacing:5,position:"center",style:{fontSize:12,fill:X.textColor,textBaseline:"middle",fontFamily:X.fontFamily,textAlign:"center"},iconStyle:{fill:X.descriptionIconFill,stroke:X.descriptionIconStroke},description:""},tickStates:{active:{labelStyle:{fontWeight:500},tickLineStyle:{lineWidth:2}},inactive:{labelStyle:{fill:X.uncheckedColor}}},optimize:{enable:!0,threshold:400}},theme:{}})},r.prototype.renderInner=function(t){this.get("line")&&this.drawLine(t),this.drawTicks(t),this.get("title")&&this.drawTitle(t)},r.prototype.isList=function(){return!0},r.prototype.getItems=function(){return this.get("ticks")},r.prototype.setItems=function(t){this.update({ticks:t})},r.prototype.updateItem=function(t,e){ot(t,e),this.clear(),this.render()},r.prototype.clearItems=function(){var t=this.getElementByLocalId("label-group");t&&t.clear()},r.prototype.setItemState=function(t,e,n){t[e]=n,this.updateTickStates(t)},r.prototype.hasState=function(t,e){return!!t[e]},r.prototype.getItemStates=function(t){var e=this.get("tickStates"),n=[];return M(e,function(a,o){t[o]&&n.push(o)}),n},r.prototype.clearItemsState=function(t){var e=this,n=this.getItemsByState(t);M(n,function(a){e.setItemState(a,t,!1)})},r.prototype.getItemsByState=function(t){var e=this,n=this.getItems();return Qt(n,function(a){return e.hasState(a,t)})},r.prototype.getSidePoint=function(t,e){var n=this,a=n.getSideVector(e,t);return{x:t.x+a[0],y:t.y+a[1]}},r.prototype.getTextAnchor=function(t){var e;return xt(t[0],0)?e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e},r.prototype.getTextBaseline=function(t){var e;return xt(t[1],0)?e="middle":t[1]>0?e="top":t[1]<0&&(e="bottom"),e},r.prototype.processOverlap=function(t){},r.prototype.drawLine=function(t){var e=this.getLinePath(),n=this.get("line");this.addShape(t,{type:"path",id:this.getElementId("line"),name:"axis-line",attrs:ot({path:e},n.style)})},r.prototype.getTickLineItems=function(t){var e=this,n=[],a=this.get("tickLine"),o=a.alignTick,s=a.length,l=1,h=t.length;return h>=2&&(l=t[1].value-t[0].value),M(t,function(u){var c=u.point;o||(c=e.getTickPoint(u.value-l/2));var f=e.getSidePoint(c,s);n.push({startPoint:c,tickValue:u.value,endPoint:f,tickId:u.id,id:"tickline-"+u.id})}),n},r.prototype.getSubTickLineItems=function(t){var e=[],n=this.get("subTickLine"),a=n.count,o=t.length;if(o>=2)for(var s=0;s<o-1;s++)for(var l=t[s],h=t[s+1],u=0;u<a;u++){var c=(u+1)/(a+1),f=(1-c)*l.tickValue+c*h.tickValue,v=this.getTickPoint(f),p=this.getSidePoint(v,n.length);e.push({startPoint:v,endPoint:p,tickValue:f,id:"sub-"+l.id+"-"+u})}return e},r.prototype.getTickLineAttrs=function(t,e,n,a){var o=this.get(e).style,s={points:[t.startPoint,t.endPoint]},l=T(this.get("theme"),["tickLine","style"],{});o=G(o)?ot({},l,o(s,n,a)):o;var h=t.startPoint,u=t.endPoint;return w({x1:h.x,y1:h.y,x2:u.x,y2:u.y},o)},r.prototype.drawTick=function(t,e,n,a,o){this.addShape(e,{type:"line",id:this.getElementId(t.id),name:"axis-"+n,attrs:this.getTickLineAttrs(t,n,a,o)})},r.prototype.drawTickLines=function(t){var e=this,n=this.get("ticks"),a=this.get("subTickLine"),o=this.getTickLineItems(n),s=this.addGroup(t,{name:"axis-tickline-group",id:this.getElementId("tickline-group")}),l=this.get("tickLine");if(M(o,function(u,c){if(l.displayWithLabel){var f=e.getElementId("label-"+u.tickId);t.findById(f)&&e.drawTick(u,s,"tickLine",c,o)}else e.drawTick(u,s,"tickLine",c,o)}),a){var h=this.getSubTickLineItems(o);M(h,function(u,c){e.drawTick(u,s,"subTickLine",c,h)})}},r.prototype.processTicks=function(){var t=this,e=this.get("ticks");M(e,function(n){n.point=t.getTickPoint(n.value),I(n.id)&&(n.id=n.name)})},r.prototype.drawTicks=function(t){var e=this;this.optimizeTicks(),this.processTicks(),this.get("label")&&this.drawLabels(t),this.get("tickLine")&&this.drawTickLines(t);var n=this.get("ticks");M(n,function(a){e.applyTickStates(a,t)})},r.prototype.optimizeTicks=function(){var t=this.get("optimize"),e=this.get("ticks");if(t&&t.enable&&t.threshold>0){var n=Gt(e);if(n>t.threshold){var a=Math.ceil(n/t.threshold),o=e.filter(function(s,l){return l%a===0});this.set("ticks",o),this.set("originalTicks",e)}}},r.prototype.getLabelAttrs=function(t,e,n){var a=this.get("label"),o=a.offset,s=a.offsetX,l=a.offsetY,h=a.rotate,u=a.formatter,c=this.getSidePoint(t.point,o),f=this.getSideVector(o,c),v=u?u(t.name,t,e):t.name,p=a.style;p=G(p)?T(this.get("theme"),["label","style"],{}):p;var g=ot({x:c.x+s,y:c.y+l,text:v,textAlign:this.getTextAnchor(f),textBaseline:this.getTextBaseline(f)},p);return h&&(g.matrix=vr(c,h)),g},r.prototype.drawLabels=function(t){var e=this,n=this.get("ticks"),a=this.addGroup(t,{name:"axis-label-group",id:this.getElementId("label-group")});M(n,function(f,v){e.addShape(a,{type:"text",name:"axis-label",id:e.getElementId("label-"+f.id),attrs:e.getLabelAttrs(f,v,n),delegateObject:{tick:f,item:f,index:v}})}),this.processOverlap(a);var o=a.getChildren(),s=T(this.get("theme"),["label","style"],{}),l=this.get("label"),h=l.style,u=l.formatter;if(G(h)){var c=o.map(function(f){return T(f.get("delegateObject"),"tick")});M(o,function(f,v){var p=f.get("delegateObject").tick,g=u?u(p.name,p,v):p.name,d=ot({},s,h(g,v,c));f.attr(d)})}},r.prototype.getTitleAttrs=function(){var t=this.get("title"),e=t.style,n=t.position,a=t.offset,o=t.spacing,s=o===void 0?0:o,l=t.autoRotate,h=e.fontSize,u=.5;n==="start"?u=0:n==="end"&&(u=1);var c=this.getTickPoint(u),f=this.getSidePoint(c,a||s+h/2),v=ot({x:f.x,y:f.y,text:t.text},e),p=t.rotate,g=p;if(I(p)&&l){var d=this.getAxisVector(c),y=[1,0];g=ss(d,y,!0)}if(g){var C=vr(f,g);v.matrix=C}return v},r.prototype.drawTitle=function(t){var e,n=this.getTitleAttrs(),a=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"axis-title",attrs:n});!((e=this.get("title"))===null||e===void 0)&&e.description&&this.drawDescriptionIcon(t,a,n.matrix)},r.prototype.drawDescriptionIcon=function(t,e,n){var a=this.addGroup(t,{name:"axis-description",id:this.getElementById("description")}),o=e.getBBox(),s=o.maxX,l=o.maxY,h=o.height,u=this.get("title").iconStyle,c=4,f=h/2,v=f/6,p=s+c,g=l-h/2,d=[p+f,g-f],y=d[0],C=d[1],m=[y+f,C+f],x=m[0],S=m[1],b=[y,S+f],A=b[0],L=b[1],k=[p,C+f],B=k[0],O=k[1],R=[p+f,g-h/4],H=R[0],z=R[1],_=[H,z+v],K=_[0],nt=_[1],ht=[K,nt+v],Q=ht[0],ut=ht[1],vt=[Q,ut+f*3/4],te=vt[0],mr=vt[1];this.addShape(a,{type:"path",id:this.getElementId("title-description-icon"),name:"axis-title-description-icon",attrs:w({path:[["M",y,C],["A",f,f,0,0,1,x,S],["A",f,f,0,0,1,A,L],["A",f,f,0,0,1,B,O],["A",f,f,0,0,1,y,C],["M",H,z],["L",K,nt],["M",Q,ut],["L",te,mr]],lineWidth:v,matrix:n},u)}),this.addShape(a,{type:"rect",id:this.getElementId("title-description-rect"),name:"axis-title-description-rect",attrs:{x:p,y:g-h/2,width:h,height:h,stroke:"#000",fill:"#000",opacity:0,matrix:n,cursor:"pointer"}})},r.prototype.applyTickStates=function(t,e){var n=this.getItemStates(t);if(n.length){var a=this.get("tickStates"),o=this.getElementId("label-"+t.id),s=e.findById(o);if(s){var l=li(t,"label",a);l&&s.attr(l)}var h=this.getElementId("tickline-"+t.id),u=e.findById(h);if(u){var c=li(t,"tickLine",a);c&&u.attr(c)}}},r.prototype.updateTickStates=function(t){var e=this.getItemStates(t),n=this.get("tickStates"),a=this.get("label"),o=this.getElementByLocalId("label-"+t.id),s=this.get("tickLine"),l=this.getElementByLocalId("tickline-"+t.id);if(e.length){if(o){var h=li(t,"label",n);h&&o.attr(h)}if(l){var u=li(t,"tickLine",n);u&&l.attr(u)}}else o&&o.attr(a.style),l&&l.attr(s.style)},r}(St);function Ss(i,r,t,e){var n=r.getChildren(),a=!1;return M(n,function(o){var s=di(i,o,t,e);a=a||s}),a}function d0(){return mf}function y0(i,r,t){return Ss(i,r,t,"head")}function mf(i,r,t){return Ss(i,r,t,"tail")}function m0(i,r,t){return Ss(i,r,t,"middle")}const x0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:d0,ellipsisHead:y0,ellipsisTail:mf,ellipsisMiddle:m0},Symbol.toStringTag,{value:"Module"}));function w0(i){var r=i.attr("matrix");return r&&r[0]!==1}function xf(i){var r=w0(i)?Xm(i.attr("matrix")):0;return r%360}function Go(i,r,t,e){var n=!1,a=xf(r),o=Math.abs(i?t.attr("y")-r.attr("y"):t.attr("x")-r.attr("x")),s=(i?t.attr("y")>r.attr("y"):t.attr("x")>r.attr("x"))?r.getBBox():t.getBBox();if(i){var l=Math.abs(Math.cos(a));$n(l,0,Math.PI/180)?n=s.width+e>o:n=s.height/l+e>o}else{var l=Math.abs(Math.sin(a));$n(l,0,Math.PI/180)?n=s.width+e>o:n=s.height/l+e>o}return n}function Pi(i,r,t,e){var n=(e==null?void 0:e.minGap)||0,a=r.getChildren().slice().filter(function(v){return v.get("visible")});if(!a.length)return!1;var o=!1;t&&a.reverse();for(var s=a.length,l=a[0],h=l,u=1;u<s;u++){var c=a[u];c.getBBox();var f=Go(i,h,c,n);f?(c.hide(),o=!0):h=c}return o}function wf(i,r,t){var e=(t==null?void 0:t.minGap)||0,n=r.getChildren().slice();if(n.length<2)return!1;var a=!1,o=n[0],s=o.getBBox(),l=n[1],h=n.length,u=xf(o),c=Math.abs(i?l.attr("y")-o.attr("y"):l.attr("x")-o.attr("x")),f=0;if(i){var v=Math.abs(Math.cos(u));if($n(v,0,Math.PI/180)){var p=Yo(n);f=(p+e)/c}else f=(s.height/v+e)/c}else{var v=Math.abs(Math.sin(u));if($n(v,0,Math.PI/180)){var p=Yo(n);f=(p+e)/c}else f=(s.height/v+e)/c}if(f>1){f=Math.ceil(f);for(var g=0;g<h;g++)g%f!==0&&(n[g].hide(),a=!0)}return a}function C0(){return Cf}function M0(i,r,t,e){return Pi(i,r,!1,e)}function S0(i,r,t,e){return Pi(i,r,!0,e)}function b0(i,r,t,e){var n=(e==null?void 0:e.minGap)||0,a=r.getChildren().slice();if(a.length<=2)return!1;for(var o=!1,s=a.length,l=a[0],h=a[s-1],u=l,c=1;c<s-1;c++){var f=a[c];f.getBBox();var v=Go(i,u,f,n);v?(f.hide(),o=!0):u=f}var p=Go(i,u,h,n);return p&&(u.hide(),o=!0),o}function Cf(i,r,t,e){var n=wf(i,r,e);return Pi(i,r,!1)&&(n=!0),n}function A0(i,r,t,e){var n=r.getChildren().slice(),a=wf(i,r,e);if(n.length>2){var o=n[0],s=n[n.length-1];o.get("visible")||(o.show(),Pi(i,r,!1,e)&&(a=!0)),s.get("visible")||(s.show(),Pi(i,r,!0,e)&&(a=!0))}return a}const T0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:C0,reserveFirst:M0,reserveLast:S0,reserveBoth:b0,equidistance:Cf,equidistanceWithReverseBoth:A0},Symbol.toStringTag,{value:"Module"}));function L0(i,r){M(i,function(t){var e=t.attr("x"),n=t.attr("y"),a=vr({x:e,y:n},r);t.attr("matrix",a)})}function Mf(i,r,t,e){var n=r.getChildren();if(!n.length||!i&&n.length<2)return!1;var a=Yo(n),o=!1;if(i)o=!!t&&a>t;else{var s=Math.abs(n[1].attr("x")-n[0].attr("x"));o=a>s}if(o){var l=e(t,a);L0(n,l)}return o}function E0(){return Sf}function Sf(i,r,t,e){return Mf(i,r,t,function(){return U(e)?e:i?X.verticalAxisRotate:X.horizontalAxisRotate})}function B0(i,r,t){return Mf(i,r,t,function(e,n){if(!e)return i?X.verticalAxisRotate:X.horizontalAxisRotate;if(i)return-Math.acos(e/n);var a=0;return e>n?a=Math.PI/4:(a=Math.asin(e/n),a>Math.PI/4&&(a=Math.PI/4)),a})}const k0=Object.freeze(Object.defineProperty({__proto__:null,getDefault:E0,fixedAngle:Sf,unfixedAngle:B0},Symbol.toStringTag,{value:"Module"})),bf=Object.freeze(Object.defineProperty({__proto__:null,autoHide:T0,autoRotate:k0,autoEllipsis:x0},Symbol.toStringTag,{value:"Module"}));var I0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line",locationType:"region",start:null,end:null})},r.prototype.getLinePath=function(){var t=this.get("start"),e=this.get("end"),n=[];return n.push(["M",t.x,t.y]),n.push(["L",e.x,e.y]),n},r.prototype.getInnerLayoutBBox=function(){var t=this.get("start"),e=this.get("end"),n=i.prototype.getInnerLayoutBBox.call(this),a=Math.min(t.x,e.x,n.x),o=Math.min(t.y,e.y,n.y),s=Math.max(t.x,e.x,n.maxX),l=Math.max(t.y,e.y,n.maxY);return{x:a,y:o,minX:a,minY:o,maxX:s,maxY:l,width:s-a,height:l-o}},r.prototype.isVertical=function(){var t=this.get("start"),e=this.get("end");return xt(t.x,e.x)},r.prototype.isHorizontal=function(){var t=this.get("start"),e=this.get("end");return xt(t.y,e.y)},r.prototype.getTickPoint=function(t){var e=this,n=e.get("start"),a=e.get("end"),o=a.x-n.x,s=a.y-n.y;return{x:n.x+o*t,y:n.y+s*t}},r.prototype.getSideVector=function(t){var e=this.getAxisVector(),n=oc([0,0],e),a=this.get("verticalFactor"),o=[n[1],n[0]*-1];return qt([0,0],o,t*a)},r.prototype.getAxisVector=function(){var t=this.get("start"),e=this.get("end");return[e.x-t.x,e.y-t.y]},r.prototype.processOverlap=function(t){var e=this,n=this.isVertical(),a=this.isHorizontal();if(!(!n&&!a)){var o=this.get("label"),s=this.get("title"),l=this.get("verticalLimitLength"),h=o.offset,u=l,c=0,f=0;s&&(c=s.style.fontSize,f=s.spacing),u&&(u=u-h-f-c);var v=this.get("overlapOrder");if(M(v,function(d){o[d]&&e.canProcessOverlap(d)&&e.autoProcessOverlap(d,o[d],t,u)}),s&&I(s.offset)){var p=t.getCanvasBBox(),g=n?p.width:p.height;s.offset=h+g+f+c/2}}},r.prototype.canProcessOverlap=function(t){var e=this.get("label");return t==="autoRotate"?I(e.rotate):!0},r.prototype.autoProcessOverlap=function(t,e,n,a){var o=this,s=this.isVertical(),l=!1,h=bf[t];if(e===!0)this.get("label"),l=h.getDefault()(s,n,a);else if(G(e))l=e(s,n,a);else if(rt(e)){var u=e;h[u.type]&&(l=h[u.type](s,n,a,u.cfg))}else h[e]&&(l=h[e](s,n,a));if(t==="autoRotate"){if(l){var c=n.getChildren(),f=this.get("verticalFactor");M(c,function(p){var g=p.attr("textAlign");if(g==="center"){var d=f>0?"end":"start";p.attr("textAlign",d)}})}}else if(t==="autoHide"){var v=n.getChildren().slice(0);M(v,function(p){p.get("visible")||(o.get("isRegister")&&o.unregisterElement(p),p.remove())})}},r}(yf),P0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",locationType:"circle",center:null,radius:null,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},r.prototype.getLinePath=function(){var t=this.get("center"),e=t.x,n=t.y,a=this.get("radius"),o=a,s=this.get("startAngle"),l=this.get("endAngle"),h=[];if(Math.abs(l-s)===Math.PI*2)h=[["M",e,n-o],["A",a,o,0,1,1,e,n+o],["A",a,o,0,1,1,e,n-o],["Z"]];else{var u=this.getCirclePoint(s),c=this.getCirclePoint(l),f=Math.abs(l-s)>Math.PI?1:0,v=s>l?0:1;h=[["M",e,n],["L",u.x,u.y],["A",a,o,0,f,v,c.x,c.y],["L",e,n]]}return h},r.prototype.getTickPoint=function(t){var e=this.get("startAngle"),n=this.get("endAngle"),a=e+(n-e)*t;return this.getCirclePoint(a)},r.prototype.getSideVector=function(t,e){var n=this.get("center"),a=[e.x-n.x,e.y-n.y],o=this.get("verticalFactor"),s=Lr(a);return qt(a,a,o*t/s),a},r.prototype.getAxisVector=function(t){var e=this.get("center"),n=[t.x-e.x,t.y-e.y];return[n[1],-1*n[0]]},r.prototype.getCirclePoint=function(t,e){var n=this.get("center");return e=e||this.get("radius"),{x:n.x+Math.cos(t)*e,y:n.y+Math.sin(t)*e}},r.prototype.canProcessOverlap=function(t){var e=this.get("label");return t==="autoRotate"?I(e.rotate):!0},r.prototype.processOverlap=function(t){var e=this,n=this.get("label"),a=this.get("title"),o=this.get("verticalLimitLength"),s=n.offset,l=o,h=0,u=0;a&&(h=a.style.fontSize,u=a.spacing),l&&(l=l-s-u-h);var c=this.get("overlapOrder");if(M(c,function(v){n[v]&&e.canProcessOverlap(v)&&e.autoProcessOverlap(v,n[v],t,l)}),a&&I(a.offset)){var f=t.getCanvasBBox().height;a.offset=s+f+u+h/2}},r.prototype.autoProcessOverlap=function(t,e,n,a){var o=this,s=!1,l=bf[t];if(a>0)if(e===!0)s=l.getDefault()(!1,n,a);else if(G(e))s=e(!1,n,a);else if(rt(e)){var h=e;l[h.type]&&(s=l[h.type](!1,n,a,h.cfg))}else l[e]&&(s=l[e](!1,n,a));if(t==="autoRotate"){if(s){var u=n.getChildren(),c=this.get("verticalFactor");M(u,function(v){var p=v.attr("textAlign");if(p==="center"){var g=c>0?"end":"start";v.attr("textAlign",g)}})}}else if(t==="autoHide"){var f=n.getChildren().slice(0);M(f,function(v){v.get("visible")||(o.get("isRegister")&&o.unregisterElement(v),v.remove())})}},r}(yf),bs=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"crosshair",type:"base",line:{},text:null,textBackground:{},capture:!1,defaultCfg:{line:{style:{lineWidth:1,stroke:X.lineColor}},text:{position:"start",offset:10,autoRotate:!1,content:null,style:{fill:X.textColor,textAlign:"center",textBaseline:"middle",fontFamily:X.fontFamily}},textBackground:{padding:5,style:{stroke:X.lineColor}}}})},r.prototype.renderInner=function(t){this.get("line")&&this.renderLine(t),this.get("text")&&(this.renderText(t),this.renderBackground(t))},r.prototype.renderText=function(t){var e=this.get("text"),n=e.style,a=e.autoRotate,o=e.content;if(!I(o)){var s=this.getTextPoint(),l=null;if(a){var h=this.getRotateAngle();l=vr(s,h)}this.addShape(t,{type:"text",name:"crosshair-text",id:this.getElementId("text"),attrs:w(w(w({},s),{text:o,matrix:l}),n)})}},r.prototype.renderLine=function(t){var e=this.getLinePath(),n=this.get("line"),a=n.style;this.addShape(t,{type:"path",name:"crosshair-line",id:this.getElementId("line"),attrs:w({path:e},a)})},r.prototype.renderBackground=function(t){var e=this.getElementId("text"),n=t.findById(e),a=this.get("textBackground");if(a&&n){var o=n.getBBox(),s=Wn(a.padding),l=a.style,h=this.addShape(t,{type:"rect",name:"crosshair-text-background",id:this.getElementId("text-background"),attrs:w({x:o.x-s[3],y:o.y-s[0],width:o.width+s[1]+s[3],height:o.height+s[0]+s[2],matrix:n.attr("matrix")},l)});h.toBack()}},r}(St),Af=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line",locationType:"region",start:null,end:null})},r.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text").position,o=Math.atan2(n.y-e.y,n.x-e.x),s=a==="start"?o-Math.PI/2:o+Math.PI/2;return s},r.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return gf(e,n,o,s)},r.prototype.getLinePath=function(){var t=this.getLocation(),e=t.start,n=t.end;return[["M",e.x,e.y],["L",n.x,n.y]]},r}(bs),F0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",locationType:"circle",center:null,radius:100,startAngle:-Math.PI/2,endAngle:Math.PI*3/2})},r.prototype.getRotateAngle=function(){var t=this.getLocation(),e=t.startAngle,n=t.endAngle,a=this.get("text").position,o=a==="start"?e+Math.PI/2:n-Math.PI/2;return o},r.prototype.getTextPoint=function(){var t=this.get("text"),e=t.position,n=t.offset,a=this.getLocation(),o=a.center,s=a.radius,l=a.startAngle,h=a.endAngle,u=e==="start"?l:h,c=this.getRotateAngle()-Math.PI,f=Pr(o,s,u),v=Math.cos(c)*n,p=Math.sin(c)*n;return{x:f.x+v,y:f.y+p}},r.prototype.getLinePath=function(){var t=this.getLocation(),e=t.center,n=t.radius,a=t.startAngle,o=t.endAngle,s=null;if(o-a===Math.PI*2){var l=e.x,h=e.y;s=[["M",l,h-n],["A",n,n,0,1,1,l,h+n],["A",n,n,0,1,1,l,h-n],["Z"]]}else{var u=Pr(e,n,a),c=Pr(e,n,o),f=Math.abs(o-a)>Math.PI?1:0,v=a>o?0:1;s=[["M",u.x,u.y],["A",n,n,0,f,v,c.x,c.y]]}return s},r}(bs),Fi="g2-crosshair",Ho=Fi+"-line",Vo=Fi+"-text",ei;const O0=(ei={},ei[""+Fi]={position:"relative"},ei[""+Ho]={position:"absolute",backgroundColor:"rgba(0, 0, 0, 0.25)"},ei[""+Vo]={position:"absolute",color:X.textColor,fontFamily:X.fontFamily},ei);var D0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"crosshair",type:"html",locationType:"region",start:{x:0,y:0},end:{x:0,y:0},capture:!1,text:null,containerTpl:'<div class="'+Fi+'"></div>',crosshairTpl:'<div class="'+Ho+'"></div>',textTpl:'<span class="'+Vo+'">{content}</span>',domStyles:null,containerClassName:Fi,defaultStyles:O0,defaultCfg:{text:{position:"start",content:null,align:"center",offset:10}}})},r.prototype.render=function(){this.resetText(),this.resetPosition()},r.prototype.initCrossHair=function(){var t=this.getContainer(),e=this.get("crosshairTpl"),n=Xe(e);t.appendChild(n),this.applyStyle(Ho,n),this.set("crosshairEl",n)},r.prototype.getTextPoint=function(){var t=this.getLocation(),e=t.start,n=t.end,a=this.get("text"),o=a.position,s=a.offset;return gf(e,n,o,s)},r.prototype.resetText=function(){var t=this.get("text"),e=this.get("textEl");if(t){var n=t.content;if(!e){var a=this.getContainer(),o=Nu(this.get("textTpl"),t);e=Xe(o),a.appendChild(e),this.applyStyle(Vo,e),this.set("textEl",e)}e.innerHTML=n}else e&&e.remove()},r.prototype.isVertical=function(t,e){return t.x===e.x},r.prototype.resetPosition=function(){var t=this.get("crosshairEl");t||(this.initCrossHair(),t=this.get("crosshairEl"));var e=this.get("start"),n=this.get("end"),a=Math.min(e.x,n.x),o=Math.min(e.y,n.y);this.isVertical(e,n)?bt(t,{width:"1px",height:Pt(Math.abs(n.y-e.y))}):bt(t,{height:"1px",width:Pt(Math.abs(n.x-e.x))}),bt(t,{top:Pt(o),left:Pt(a)}),this.alignText()},r.prototype.alignText=function(){var t=this.get("textEl");if(t){var e=this.get("text").align,n=t.clientWidth,a=this.getTextPoint();switch(e){case"center":a.x=a.x-n/2;break;case"right":a.x=a.x-n}bt(t,{top:Pt(a.y),left:Pt(a.x)})}},r.prototype.updateInner=function(t){Or(t,"text")&&this.resetText(),i.prototype.updateInner.call(this,t)},r}(Ms);const Th=Object.freeze(Object.defineProperty({__proto__:null,Line:Af,Circle:F0,Base:bs,Html:D0},Symbol.toStringTag,{value:"Module"}));var Tf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"grid",line:{},alternateColor:null,capture:!1,items:[],closed:!1,defaultCfg:{line:{type:"line",style:{lineWidth:1,stroke:X.lineColor}}}})},r.prototype.getLineType=function(){var t=this.get("line")||this.get("defaultCfg").line;return t.type},r.prototype.renderInner=function(t){this.drawGrid(t)},r.prototype.getAlternatePath=function(t,e){var n=this.getGridPath(t),a=e.slice(0).reverse(),o=this.getGridPath(a,!0),s=this.get("closed");return s?n=n.concat(o):(o[0][0]="L",n=n.concat(o),n.push(["Z"])),n},r.prototype.getPathStyle=function(){return this.get("line").style},r.prototype.drawGrid=function(t){var e=this,n=this.get("line"),a=this.get("items"),o=this.get("alternateColor"),s=null;M(a,function(l,h){var u=l.id||h;if(n){var c=e.getPathStyle();c=G(c)?c(l,h,a):c;var f=e.getElementId("line-"+u),v=e.getGridPath(l.points);e.addShape(t,{type:"path",name:"grid-line",id:f,attrs:ot({path:v},c)})}if(o&&h>0){var p=e.getElementId("region-"+u),g=h%2===0;if(N(o))g&&e.drawAlternateRegion(p,t,s.points,l.points,o);else{var d=g?o[1]:o[0];e.drawAlternateRegion(p,t,s.points,l.points,d)}}s=l})},r.prototype.drawAlternateRegion=function(t,e,n,a,o){var s=this.getAlternatePath(n,a);this.addShape(e,{type:"path",id:t,name:"grid-region",attrs:{path:s,fill:o}})},r}(St);function R0(i,r,t,e){var n=t-i,a=e-r;return Math.sqrt(n*n+a*a)}var Y0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"circle",center:null,closed:!0})},r.prototype.getGridPath=function(t,e){var n=this.getLineType(),a=this.get("closed"),o=[];if(t.length)if(n==="circle"){var s=this.get("center"),l=t[0],h=R0(s.x,s.y,l.x,l.y),u=e?0:1;a?(o.push(["M",s.x,s.y-h]),o.push(["A",h,h,0,0,u,s.x,s.y+h]),o.push(["A",h,h,0,0,u,s.x,s.y-h]),o.push(["Z"])):M(t,function(c,f){f===0?o.push(["M",c.x,c.y]):o.push(["A",h,h,0,0,u,c.x,c.y])})}else M(t,function(c,f){f===0?o.push(["M",c.x,c.y]):o.push(["L",c.x,c.y])}),a&&o.push(["Z"]);return o},r}(Tf),G0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"line"})},r.prototype.getGridPath=function(t){var e=[];return M(t,function(n,a){a===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e},r}(Tf),Lf=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"legend",layout:"horizontal",locationType:"point",x:0,y:0,offsetX:0,offsetY:0,title:null,background:null})},r.prototype.getLayoutBBox=function(){var t=i.prototype.getLayoutBBox.call(this),e=this.get("maxWidth"),n=this.get("maxHeight"),a=t.width,o=t.height;return e&&(a=Math.min(a,e)),n&&(o=Math.min(o,n)),Sa(t.minX,t.minY,a,o)},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetLocation()},r.prototype.resetLocation=function(){var t=this.get("x"),e=this.get("y"),n=this.get("offsetX"),a=this.get("offsetY");this.moveElementTo(this.get("group"),{x:t+n,y:e+a})},r.prototype.applyOffset=function(){this.resetLocation()},r.prototype.getDrawPoint=function(){return this.get("currentPoint")},r.prototype.setDrawPoint=function(t){return this.set("currentPoint",t)},r.prototype.renderInner=function(t){this.resetDraw(),this.get("title")&&this.drawTitle(t),this.drawLegendContent(t),this.get("background")&&this.drawBackground(t)},r.prototype.drawBackground=function(t){var e=this.get("background"),n=t.getBBox(),a=Wn(e.padding),o=w({x:0,y:0,width:n.width+a[1]+a[3],height:n.height+a[0]+a[2]},e.style),s=this.addShape(t,{type:"rect",id:this.getElementId("background"),name:"legend-background",attrs:o});s.toBack()},r.prototype.drawTitle=function(t){var e=this.get("currentPoint"),n=this.get("title"),a=n.spacing,o=n.style,s=n.text,l=this.addShape(t,{type:"text",id:this.getElementId("title"),name:"legend-title",attrs:w({text:s,x:e.x,y:e.y},o)}),h=l.getBBox();this.set("currentPoint",{x:e.x,y:h.maxY+a})},r.prototype.resetDraw=function(){var t=this.get("background"),e={x:0,y:0};if(t){var n=Wn(t.padding);e.x=n[3],e.y=n[0]}this.set("currentPoint",e)},r}(St),Qa={marker:{style:{inactiveFill:"#000",inactiveOpacity:.45,fill:"#000",opacity:1,size:12}},text:{style:{fill:"#ccc",fontSize:12}}},un={fill:X.textColor,fontSize:12,textAlign:"start",textBaseline:"middle",fontFamily:X.fontFamily,fontWeight:"normal",lineHeight:12},Ka="navigation-arrow-right",Ja="navigation-arrow-left",Lh={right:90*Math.PI/180,left:(360-90)*Math.PI/180,up:0,down:180*Math.PI/180},H0=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.currentPageIndex=1,t.totalPagesCnt=1,t.pageWidth=0,t.pageHeight=0,t.startX=0,t.startY=0,t.onNavigationBack=function(){var e=t.getElementByLocalId("item-group");if(t.currentPageIndex>1){t.currentPageIndex-=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?e.animate({matrix:n},100):e.attr({matrix:n})}},t.onNavigationAfter=function(){var e=t.getElementByLocalId("item-group");if(t.currentPageIndex<t.totalPagesCnt){t.currentPageIndex+=1,t.updateNavigation();var n=t.getCurrentNavigationMatrix();t.get("animate")?e.animate({matrix:n},100):e.attr({matrix:n})}},t}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"legend",type:"category",itemSpacing:24,itemMarginBottom:8,maxItemWidth:null,itemWidth:null,itemHeight:null,itemName:{},itemValue:null,maxWidth:null,maxHeight:null,marker:{},radio:null,items:[],itemStates:{},itemBackground:{},pageNavigator:{},defaultCfg:{title:{spacing:5,style:{fill:X.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}},background:{padding:5,style:{stroke:X.lineColor}},itemBackground:{style:{opacity:0,fill:"#fff"}},pageNavigator:Qa,itemName:{spacing:16,style:un},marker:{spacing:8,style:{r:6,symbol:"circle"}},itemValue:{alignRight:!1,formatter:null,style:un,spacing:6},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:X.uncheckedColor},markerStyle:{fill:X.uncheckedColor,stroke:X.uncheckedColor}},inactive:{nameStyle:{fill:X.uncheckedColor},markerStyle:{opacity:.2}}}}})},r.prototype.isList=function(){return!0},r.prototype.getItems=function(){return this.get("items")},r.prototype.setItems=function(t){this.update({items:t})},r.prototype.updateItem=function(t,e){ot(t,e),this.clear(),this.render()},r.prototype.clearItems=function(){var t=this.getElementByLocalId("item-group");t&&t.clear()},r.prototype.setItemState=function(t,e,n){t[e]=n;var a=this.getElementByLocalId("item-"+t.id);if(a){var o=this.getItems(),s=o.indexOf(t),l=this.createOffScreenGroup(),h=this.drawItem(t,s,this.getItemHeight(),l);this.updateElements(h,a),this.clearUpdateStatus(a)}},r.prototype.hasState=function(t,e){return!!t[e]},r.prototype.getItemStates=function(t){var e=this.get("itemStates"),n=[];return M(e,function(a,o){t[o]&&n.push(o)}),n},r.prototype.clearItemsState=function(t){var e=this,n=this.getItemsByState(t);M(n,function(a){e.setItemState(a,t,!1)})},r.prototype.getItemsByState=function(t){var e=this,n=this.getItems();return Qt(n,function(a){return e.hasState(a,t)})},r.prototype.drawLegendContent=function(t){this.processItems(),this.drawItems(t)},r.prototype.processItems=function(){var t=this.get("items");M(t,function(e){e.id||(e.id=e.name)})},r.prototype.drawItems=function(t){var e=this,n=this.addGroup(t,{id:this.getElementId("item-container-group"),name:"legend-item-container-group"}),a=this.addGroup(n,{id:this.getElementId("item-group"),name:"legend-item-group"}),o=this.getItemHeight(),s=this.get("itemWidth"),l=this.get("itemSpacing"),h=this.get("itemMarginBottom"),u=this.get("currentPoint"),c=u.x,f=u.y,v=this.get("layout"),p=this.get("items"),g=!1,d=0,y=this.get("maxWidth"),C=this.get("maxHeight");M(p,function(m,x){var S=e.drawItem(m,x,o,a),b=S.getBBox(),A=s||b.width;A>d&&(d=A),v==="horizontal"?(y&&y<u.x+A-c&&(g=!0,u.x=c,u.y+=o+h),e.moveElementTo(S,u),u.x+=A+l):(C&&C<u.y+o+h-f&&(g=!0,u.x+=d+l,u.y=f,d=0),e.moveElementTo(S,u),u.y+=o+h)}),g&&this.get("flipPage")&&(this.pageHeight=0,this.pageWidth=0,this.totalPagesCnt=1,this.startX=c,this.startY=f,this.adjustNavigation(t,a))},r.prototype.getItemHeight=function(){var t=this.get("itemHeight");if(!t){var e=(this.get("itemName")||{}).style;if(G(e)){var n=this.getItems();n.forEach(function(a,o){var s=w(w({},un),e(a,o,n)).fontSize;t<s&&(t=s)})}else e&&(t=e.fontSize)}return t},r.prototype.drawMarker=function(t,e,n,a){var o=w(w(w({x:0,y:a/2},e.style),{symbol:T(n.marker,"symbol","circle")}),T(n.marker,"style",{})),s=this.addShape(t,{type:"marker",id:this.getElementId("item-"+n.id+"-marker"),name:"legend-item-marker",attrs:o}),l=s.getBBox();s.attr("x",l.width/2);var h=s.attr(),u=h.stroke,c=h.fill;return u&&s.set("isStroke",!0),c&&s.set("isFill",!0),s},r.prototype.drawItemText=function(t,e,n,a,o,s,l){var h=n.formatter,u=n.style,c=w(w({x:s,y:o/2,text:h?h(a[e],a,l):a[e]},un),G(u)?u(a,l,this.getItems()):u);return this.addShape(t,{type:"text",id:this.getElementId("item-"+a.id+"-"+e),name:"legend-item-"+e,attrs:c})},r.prototype.drawRadio=function(t,e,n,a,o){var s,l,h=e.style||{},u=(s=h.r)!==null&&s!==void 0?s:a/2,c=u*3.6/8,f=[o+u,a/2-u],v=f[0],p=f[1],g=[v+u,p+u],d=g[0],y=g[1],C=[v,y+u],m=C[0],x=C[1],S=[o,p+u],b=S[0],A=S[1],L=n.showRadio,k=w(w({path:[["M",v,p],["A",u,u,0,0,1,d,y],["L",d-c,y],["L",d,y],["A",u,u,0,0,1,m,x],["L",m,x-c],["L",m,x],["A",u,u,0,0,1,b,A],["L",b+c,A],["L",b,A],["A",u,u,0,0,1,v,p],["L",v,p+c]],stroke:"#000000",fill:"#ffffff"},h),{opacity:L?(l=h==null?void 0:h.opacity)!==null&&l!==void 0?l:.45:0}),B=this.addShape(t,{type:"path",id:this.getElementId("item-"+n.id+"-radio"),name:"legend-item-radio",attrs:k});return B.set("tip",e.tip),B},r.prototype.drawItem=function(t,e,n,a){var o="item-"+t.id,s=this.addGroup(a,{name:"legend-item-container",id:this.getElementId("item-container-"+o),delegateObject:{item:t,index:e}}),l=this.addGroup(s,{name:"legend-item",id:this.getElementId(o),delegateObject:{item:t,index:e}}),h=this.get("marker"),u=this.get("itemName"),c=this.get("itemValue"),f=this.get("itemBackground"),v=this.get("radio"),p=this.getLimitItemWidth(),g=0;if(h){var d=this.drawMarker(l,h,t,n),y=h.spacing,C=T(t,["marker","spacing"]);U(C)&&(y=C),g=d.getBBox().maxX+y}if(u){var m=this.drawItemText(l,"name",u,t,n,g,e);p&&di(!0,m,at(p-g,0,p)),g=m.getBBox().maxX+u.spacing}if(c){var x=this.drawItemText(l,"value",c,t,n,g,e);p&&(c.alignRight?(x.attr({textAlign:"right",x:p}),di(!0,x,at(p-g,0,p),"head")):di(!0,x,at(p-g,0,p))),g=x.getBBox().maxX+c.spacing}if(v&&this.drawRadio(l,v,t,n,g),f){var S=l.getBBox(),b=this.addShape(l,{type:"rect",name:"legend-item-background",id:this.getElementId(o+"-background"),attrs:w({x:0,y:0,width:S.width,height:n},f.style)});b.toBack()}return this.applyItemStates(t,l),l},r.prototype.adjustNavigation=function(t,e){var n=this,a=this.startX,o=this.startY,s=this.get("layout"),l=e.findAll(function(B){return B.get("name")==="legend-item"}),h=this.get("maxWidth"),u=this.get("maxHeight"),c=this.get("itemWidth"),f=this.get("itemSpacing"),v=this.getItemHeight(),p=D({},Qa,this.get("pageNavigator")),g=this.drawNavigation(t,s,"00/00",p),d=g.getBBox(),y={x:a,y:o},C=1,m=0,x=0,S=0,b=this.get("itemMarginBottom");if(s==="horizontal"){var A=this.get("maxRow")||1,L=v+(A===1?0:b);this.pageHeight=L*A,M(l,function(B){var O=B.getBBox(),R=c||O.width;(m&&m<y.x+R+f||h<y.x+R+f+d.width)&&(C===1&&(m=y.x+f,n.pageWidth=m,n.moveElementTo(g,{x:h-f-d.width-d.minX,y:y.y+v/2-d.height/2-d.minY})),C+=1,y.x=a,y.y+=L),n.moveElementTo(B,y),B.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:R+f,height:v}}),y.x+=R+f})}else{M(l,function(B){var O=B.getBBox();O.width>x&&(x=O.width)}),S=x,x+=f,h&&(x=Math.min(h,x),S=Math.min(h,S)),this.pageWidth=x,this.pageHeight=u-Math.max(d.height,v+b);var k=Math.floor(this.pageHeight/(v+b));M(l,function(B,O){O!==0&&O%k===0&&(C+=1,y.x+=x,y.y=o),n.moveElementTo(B,y),B.getParent().setClip({type:"rect",attrs:{x:y.x,y:y.y,width:x,height:v}}),y.y+=v+b}),this.totalPagesCnt=C,this.moveElementTo(g,{x:a+S/2-d.width/2-d.minX,y:u-d.height-d.minY})}this.pageHeight&&this.pageWidth&&e.getParent().setClip({type:"rect",attrs:{x:this.startX,y:this.startY,width:this.pageWidth,height:this.pageHeight}}),s==="horizontal"&&this.get("maxRow")?this.totalPagesCnt=Math.ceil(C/this.get("maxRow")):this.totalPagesCnt=C,this.currentPageIndex>this.totalPagesCnt&&(this.currentPageIndex=1),this.updateNavigation(g),e.attr("matrix",this.getCurrentNavigationMatrix())},r.prototype.drawNavigation=function(t,e,n,a){var o={x:0,y:0},s=this.addGroup(t,{id:this.getElementId("navigation-group"),name:"legend-navigation"}),l=T(a.marker,"style",{}),h=l.size,u=h===void 0?12:h,c=mt(l,["size"]),f=this.drawArrow(s,o,Ja,e==="horizontal"?"up":"left",u,c);f.on("click",this.onNavigationBack);var v=f.getBBox();o.x+=v.width+2;var p=this.addShape(s,{type:"text",id:this.getElementId("navigation-text"),name:"navigation-text",attrs:w({x:o.x,y:o.y+u/2,text:n,textBaseline:"middle"},T(a.text,"style"))}),g=p.getBBox();o.x+=g.width+2;var d=this.drawArrow(s,o,Ka,e==="horizontal"?"down":"right",u,c);return d.on("click",this.onNavigationAfter),s},r.prototype.updateNavigation=function(t){var e=D({},Qa,this.get("pageNavigator")),n=e.marker.style,a=n.fill,o=n.opacity,s=n.inactiveFill,l=n.inactiveOpacity,h=this.currentPageIndex+"/"+this.totalPagesCnt,u=t?t.getChildren()[1]:this.getElementByLocalId("navigation-text"),c=t?t.findById(this.getElementId(Ja)):this.getElementByLocalId(Ja),f=t?t.findById(this.getElementId(Ka)):this.getElementByLocalId(Ka);u.attr("text",h),c.attr("opacity",this.currentPageIndex===1?l:o),c.attr("fill",this.currentPageIndex===1?s:a),c.attr("cursor",this.currentPageIndex===1?"not-allowed":"pointer"),f.attr("opacity",this.currentPageIndex===this.totalPagesCnt?l:o),f.attr("fill",this.currentPageIndex===this.totalPagesCnt?s:a),f.attr("cursor",this.currentPageIndex===this.totalPagesCnt?"not-allowed":"pointer");var v=c.getBBox().maxX+2;u.attr("x",v),v+=u.getBBox().width+2,this.updateArrowPath(f,{x:v,y:0})},r.prototype.drawArrow=function(t,e,n,a,o,s){var l=e.x,h=e.y,u=this.addShape(t,{type:"path",id:this.getElementId(n),name:n,attrs:w({size:o,direction:a,path:[["M",l+o/2,h],["L",l,h+o],["L",l+o,h+o],["Z"]],cursor:"pointer"},s)});return u.attr("matrix",vr({x:l+o/2,y:h+o/2},Lh[a])),u},r.prototype.updateArrowPath=function(t,e){var n=e.x,a=e.y,o=t.attr(),s=o.size,l=o.direction,h=vr({x:n+s/2,y:a+s/2},Lh[l]);t.attr("path",[["M",n+s/2,a],["L",n,a+s],["L",n+s,a+s],["Z"]]),t.attr("matrix",h)},r.prototype.getCurrentNavigationMatrix=function(){var t=this,e=t.currentPageIndex,n=t.pageWidth,a=t.pageHeight,o=this.get("layout"),s=o==="horizontal"?{x:0,y:a*(1-e)}:{x:n*(1-e),y:0};return ws(s)},r.prototype.applyItemStates=function(t,e){var n=this.getItemStates(t),a=n.length>0;if(a){var o=e.getChildren(),s=this.get("itemStates");M(o,function(l){var h=l.get("name"),u=h.split("-")[2],c=li(t,u,s);c&&(l.attr(c),u==="marker"&&!(l.get("isStroke")&&l.get("isFill"))&&(l.get("isStroke")&&l.attr("fill",null),l.get("isFill")&&l.attr("stroke",null)))})}},r.prototype.getLimitItemWidth=function(){var t=this.get("itemWidth"),e=this.get("maxItemWidth");return e?t&&(e=t<=e?t:e):t&&(e=t),e},r}(Lf),V0=1.4,Eh=.4,N0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{type:"continue",min:0,max:100,value:null,colors:[],track:{},rail:{},label:{},handler:{},slidable:!0,tip:null,step:null,maxWidth:null,maxHeight:null,defaultCfg:{label:{align:"rail",spacing:5,formatter:null,style:{fontSize:12,fill:X.textColor,textBaseline:"middle",fontFamily:X.fontFamily}},handler:{size:10,style:{fill:"#fff",stroke:"#333"}},track:{},rail:{type:"color",size:20,defaultLength:100,style:{fill:"#DCDEE2"}},title:{spacing:5,style:{fill:X.textColor,fontSize:12,textAlign:"start",textBaseline:"top"}}}})},r.prototype.isSlider=function(){return!0},r.prototype.getValue=function(){return this.getCurrentValue()},r.prototype.getRange=function(){return{min:this.get("min"),max:this.get("max")}},r.prototype.setRange=function(t,e){this.update({min:t,max:e})},r.prototype.setValue=function(t){var e=this.getValue();this.set("value",t);var n=this.get("group");this.resetTrackClip(),this.get("slidable")&&this.resetHandlers(n),this.delegateEmit("valuechanged",{originValue:e,value:t})},r.prototype.initEvent=function(){var t=this.get("group");this.bindSliderEvent(t),this.bindRailEvent(t),this.bindTrackEvent(t)},r.prototype.drawLegendContent=function(t){this.drawRail(t),this.drawLabels(t),this.fixedElements(t),this.resetTrack(t),this.resetTrackClip(t),this.get("slidable")&&this.resetHandlers(t)},r.prototype.bindSliderEvent=function(t){this.bindHandlersEvent(t)},r.prototype.bindHandlersEvent=function(t){var e=this;t.on("legend-handler-min:drag",function(n){var a=e.getValueByCanvasPoint(n.x,n.y),o=e.getCurrentValue(),s=o[1];s<a&&(s=a),e.setValue([a,s])}),t.on("legend-handler-max:drag",function(n){var a=e.getValueByCanvasPoint(n.x,n.y),o=e.getCurrentValue(),s=o[0];s>a&&(s=a),e.setValue([s,a])})},r.prototype.bindRailEvent=function(t){},r.prototype.bindTrackEvent=function(t){var e=this,n=null;t.on("legend-track:dragstart",function(a){n={x:a.x,y:a.y}}),t.on("legend-track:drag",function(a){if(!!n){var o=e.getValueByCanvasPoint(n.x,n.y),s=e.getValueByCanvasPoint(a.x,a.y),l=e.getCurrentValue(),h=l[1]-l[0],u=e.getRange(),c=s-o;c<0?l[0]+c>u.min?e.setValue([l[0]+c,l[1]+c]):e.setValue([u.min,u.min+h]):c>0&&(c>0&&l[1]+c<u.max?e.setValue([l[0]+c,l[1]+c]):e.setValue([u.max-h,u.max])),n={x:a.x,y:a.y}}}),t.on("legend-track:dragend",function(a){n=null})},r.prototype.drawLabels=function(t){this.drawLabel("min",t),this.drawLabel("max",t)},r.prototype.drawLabel=function(t,e){var n=this.get("label"),a=n.style,o=n.align,s=n.formatter,l=this.get(t),h=this.getLabelAlignAttrs(t,o),u="label-"+t;this.addShape(e,{type:"text",id:this.getElementId(u),name:"legend-label-"+t,attrs:w(w({x:0,y:0,text:G(s)?s(l):l},a),h)})},r.prototype.getLabelAlignAttrs=function(t,e){var n=this.isVertical(),a="center",o="middle";return n?(a="start",e!=="rail"?t==="min"?o="top":o="bottom":o="top"):e!=="rail"?(o="top",t==="min"?a="start":a="end"):(a="start",o="middle"),{textAlign:a,textBaseline:o}},r.prototype.getRailPath=function(t,e,n,a){var o=this.get("rail"),s=o.size,l=o.defaultLength,h=o.type,u=this.isVertical(),c=l,f=n,v=a;f||(f=u?s:c),v||(v=u?c:s);var p=[];return h==="color"?(p.push(["M",t,e]),p.push(["L",t+f,e]),p.push(["L",t+f,e+v]),p.push(["L",t,e+v]),p.push(["Z"])):(p.push(["M",t+f,e]),p.push(["L",t+f,e+v]),p.push(["L",t,e+v]),p.push(["Z"])),p},r.prototype.drawRail=function(t){var e=this.get("rail"),n=e.style;this.addShape(t,{type:"path",id:this.getElementId("rail"),name:"legend-rail",attrs:w({path:this.getRailPath(0,0)},n)})},r.prototype.getTrackColor=function(t){var e=t.length;if(!e)return null;if(e===1)return t[0];var n;this.isVertical()?n="l(90)":n="l(0)";for(var a=0;a<e;a++){var o=a/(e-1);n+=" "+o+":"+t[a]}return n},r.prototype.getTrackPath=function(t){var e=this.getRailShape(t),n=e.attr("path");return Xt(n)},r.prototype.getClipTrackAttrs=function(t){var e=this.getCurrentValue(),n=e[0],a=e[1],o=this.getRailBBox(t),s=this.getPointByValue(n,t),l=this.getPointByValue(a,t),h=this.isVertical(),u,c,f,v;return h?(u=o.minX,c=s.y,f=o.width,v=l.y-s.y):(u=s.x,c=o.minY,f=l.x-s.x,v=o.height),{x:u,y:c,width:f,height:v}},r.prototype.getTrackAttrs=function(t){var e=this.get("track"),n=this.get("colors"),a=this.getTrackPath(t);return ot({path:a,fill:this.getTrackColor(n)},e.style)},r.prototype.resetTrackClip=function(t){var e=t||this.get("group"),n=this.getElementId("track"),a=e.findById(n),o=a.getClip(),s=this.getClipTrackAttrs(t);o?o.attr(s):a.setClip({type:"rect",attrs:s})},r.prototype.resetTrack=function(t){var e=this.getElementId("track"),n=t.findById(e),a=this.getTrackAttrs(t);n?n.attr(a):this.addShape(t,{type:"path",id:e,draggable:this.get("slidable"),name:"legend-track",attrs:a})},r.prototype.getPointByValue=function(t,e){var n=this.getRange(),a=n.min,o=n.max,s=(t-a)/(o-a),l=this.getRailBBox(e),h=this.isVertical(),u={x:0,y:0};return h?(u.x=l.minX+l.width/2,u.y=hr(l.minY,l.maxY,s)):(u.x=hr(l.minX,l.maxX,s),u.y=l.minY+l.height/2),u},r.prototype.getRailShape=function(t){var e=t||this.get("group");return e.findById(this.getElementId("rail"))},r.prototype.getRailBBox=function(t){var e=this.getRailShape(t),n=e.getBBox();return n},r.prototype.getRailCanvasBBox=function(){var t=this.get("group"),e=t.findById(this.getElementId("rail")),n=e.getCanvasBBox();return n},r.prototype.isVertical=function(){return this.get("layout")==="vertical"},r.prototype.getValueByCanvasPoint=function(t,e){var n=this.getRange(),a=n.min,o=n.max,s=this.getRailCanvasBBox(),l=this.isVertical(),h=this.get("step"),u;l?u=(e-s.minY)/s.height:u=(t-s.minX)/s.width;var c=hr(a,o,u);if(h){var f=Math.round((c-a)/h);c=a+f*h}return c>o&&(c=o),c<a&&(c=a),c},r.prototype.getCurrentValue=function(){var t=this.get("value");if(!t){var e=this.get("values");return e?[Math.max(Math.min.apply(Math,Ci(e,[this.get("max")])),this.get("min")),Math.min(Math.max.apply(Math,Ci(e,[this.get("min")])),this.get("max"))]:[this.get("min"),this.get("max")]}return t},r.prototype.resetHandlers=function(t){var e=this.getCurrentValue(),n=e[0],a=e[1];this.resetHandler(t,"min",n),this.resetHandler(t,"max",a)},r.prototype.getHandlerPath=function(t,e){var n=this.isVertical(),a=[],o=t.size,s=e.x,l=e.y,h=o*V0,u=o/2,c=o/6;if(n){var f=s+h*Eh;a.push(["M",s,l]),a.push(["L",f,l+u]),a.push(["L",s+h,l+u]),a.push(["L",s+h,l-u]),a.push(["L",f,l-u]),a.push(["Z"]),a.push(["M",f,l+c]),a.push(["L",s+h-2,l+c]),a.push(["M",f,l-c]),a.push(["L",s+h-2,l-c])}else{var v=l+h*Eh;a.push(["M",s,l]),a.push(["L",s-u,v]),a.push(["L",s-u,l+h]),a.push(["L",s+u,l+h]),a.push(["L",s+u,v]),a.push(["Z"]),a.push(["M",s-c,v]),a.push(["L",s-c,l+h-2]),a.push(["M",s+c,v]),a.push(["L",s+c,l+h-2])}return a},r.prototype.resetHandler=function(t,e,n){var a=this.getPointByValue(n,t),o=this.get("handler"),s=this.getHandlerPath(o,a),l=this.getElementId("handler-"+e),h=t.findById(l),u=this.isVertical();h?h.attr("path",s):this.addShape(t,{type:"path",name:"legend-handler-"+e,draggable:!0,id:l,attrs:w(w({path:s},o.style),{cursor:u?"ns-resize":"ew-resize"})})},r.prototype.fixedElements=function(t){var e=t.findById(this.getElementId("rail")),n=t.findById(this.getElementId("label-min")),a=t.findById(this.getElementId("label-max")),o=this.getDrawPoint();this.isVertical()?this.fixedVertail(n,a,e,o):this.fixedHorizontal(n,a,e,o)},r.prototype.fitRailLength=function(t,e,n,a){var o=this.isVertical(),s=o?"height":"width",l=this.get("label"),h=l.align,u=l.spacing,c=this.get("max"+dr(s));if(c){var f=h==="rail"?n[s]+t[s]+e[s]+u*2:n[s],v=f-c;v>0&&this.changeRailLength(a,s,n[s]-v)}},r.prototype.changeRailLength=function(t,e,n){var a=t.getBBox(),o;e==="height"?o=this.getRailPath(a.x,a.y,a.width,n):o=this.getRailPath(a.x,a.y,n,a.height),t.attr("path",o)},r.prototype.changeRailPosition=function(t,e,n){var a=t.getBBox(),o=this.getRailPath(e,n,a.width,a.height);t.attr("path",o)},r.prototype.fixedHorizontal=function(t,e,n,a){var o=this.get("label"),s=o.align,l=o.spacing,h=n.getBBox(),u=t.getBBox(),c=e.getBBox(),f=h.height;this.fitRailLength(u,c,h,n),h=n.getBBox(),s==="rail"?(t.attr({x:a.x,y:a.y+f/2}),this.changeRailPosition(n,a.x+u.width+l,a.y),e.attr({x:a.x+u.width+h.width+l*2,y:a.y+f/2})):s==="top"?(t.attr({x:a.x,y:a.y}),e.attr({x:a.x+h.width,y:a.y}),this.changeRailPosition(n,a.x,a.y+u.height+l)):(this.changeRailPosition(n,a.x,a.y),t.attr({x:a.x,y:a.y+h.height+l}),e.attr({x:a.x+h.width,y:a.y+h.height+l}))},r.prototype.fixedVertail=function(t,e,n,a){var o=this.get("label"),s=o.align,l=o.spacing,h=n.getBBox(),u=t.getBBox(),c=e.getBBox();if(this.fitRailLength(u,c,h,n),h=n.getBBox(),s==="rail")t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x,a.y+u.height+l),e.attr({x:a.x,y:a.y+u.height+h.height+l*2});else if(s==="right")t.attr({x:a.x+h.width+l,y:a.y}),this.changeRailPosition(n,a.x,a.y),e.attr({x:a.x+h.width+l,y:a.y+h.height});else{var f=Math.max(u.width,c.width);t.attr({x:a.x,y:a.y}),this.changeRailPosition(n,a.x+f+l,a.y),e.attr({x:a.x,y:a.y+h.height})}},r}(Lf),Se="g2-tooltip",be="g2-tooltip-title",Oi="g2-tooltip-list",Aa="g2-tooltip-list-item",Ta="g2-tooltip-marker",La="g2-tooltip-value",Ef="g2-tooltip-name",As="g2-tooltip-crosshair-x",Ts="g2-tooltip-crosshair-y";const X0=Object.freeze(Object.defineProperty({__proto__:null,CONTAINER_CLASS:Se,TITLE_CLASS:be,LIST_CLASS:Oi,LIST_ITEM_CLASS:Aa,MARKER_CLASS:Ta,VALUE_CLASS:La,NAME_CLASS:Ef,CROSSHAIR_X:As,CROSSHAIR_Y:Ts},Symbol.toStringTag,{value:"Module"}));var le;const z0=(le={},le[""+Se]={position:"absolute",visibility:"visible",zIndex:8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)",backgroundColor:"rgba(255, 255, 255, 0.9)",boxShadow:"0px 0px 10px #aeaeae",borderRadius:"3px",color:"rgb(87, 87, 87)",fontSize:"12px",fontFamily:X.fontFamily,lineHeight:"20px",padding:"10px 10px 6px 10px"},le[""+be]={marginBottom:"4px"},le[""+Oi]={margin:"0px",listStyleType:"none",padding:"0px"},le[""+Aa]={listStyleType:"none",marginBottom:"4px"},le[""+Ta]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},le[""+La]={display:"inline-block",float:"right",marginLeft:"30px"},le[""+As]={position:"absolute",width:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},le[""+Ts]={position:"absolute",height:"1px",backgroundColor:"rgba(0, 0, 0, 0.25)"},le);function W0(i,r,t,e,n){var a={left:i<n.x,right:i+t>n.x+n.width,top:r<n.y,bottom:r+e>n.y+n.height};return a}function $0(i,r,t,e,n,a){var o=i,s=r;switch(a){case"left":o=i-e-t,s=r-n/2;break;case"right":o=i+t,s=r-n/2;break;case"top":o=i-e/2,s=r-n-t;break;case"bottom":o=i-e/2,s=r+t;break;default:o=i+t,s=r-n-t;break}return{x:o,y:s}}function _0(i,r,t,e,n,a,o){var s=$0(i,r,t,e,n,a);if(o){var l=W0(s.x,s.y,e,n,o);a==="auto"?(l.right&&(s.x=Math.max(0,i-e-t)),l.top&&(s.y=Math.max(0,r-n-t))):a==="top"||a==="bottom"?(l.left&&(s.x=o.x),l.right&&(s.x=o.x+o.width-e),a==="top"&&l.top&&(s.y=r+t),a==="bottom"&&l.bottom&&(s.y=r-n-t)):(l.top&&(s.y=o.y),l.bottom&&(s.y=o.y+o.height-n),a==="left"&&l.left&&(s.x=i+t),a==="right"&&l.right&&(s.x=i-e-t))}return s}function j0(i,r){var t=!1;return M(r,function(e){if(Or(i,e))return t=!0,!1}),t}var U0=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"tooltip",type:"html",x:0,y:0,items:[],customContent:null,containerTpl:'<div class="'+Se+'"><div class="'+be+'"></div><ul class="'+Oi+'"></ul></div>',itemTpl:'<li class="'+Aa+`" data-index={index}>
<span class="`+Ta+`" style="background:{color}"></span>
<span class="`+Ef+`">{name}</span>:
<span class="`+La+`">{value}</span>
</li>`,xCrosshairTpl:'<div class="'+As+'"></div>',yCrosshairTpl:'<div class="'+Ts+'"></div>',title:null,showTitle:!0,region:null,crosshairsRegion:null,containerClassName:Se,crosshairs:null,offset:10,position:"right",domStyles:null,defaultStyles:z0})},r.prototype.render=function(){this.get("customContent")?this.renderCustomContent():(this.resetTitle(),this.renderItems()),this.resetPosition()},r.prototype.clear=function(){this.clearCrosshairs(),this.setTitle(""),this.clearItemDoms()},r.prototype.show=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!0),bt(t,{visibility:"visible"}),this.setCrossHairsVisible(!0))},r.prototype.hide=function(){var t=this.getContainer();!t||this.destroyed||(this.set("visible",!1),bt(t,{visibility:"hidden"}),this.setCrossHairsVisible(!1))},r.prototype.getLocation=function(){return{x:this.get("x"),y:this.get("y")}},r.prototype.setLocation=function(t){this.set("x",t.x),this.set("y",t.y),this.resetPosition()},r.prototype.setCrossHairsVisible=function(t){var e=t?"":"none",n=this.get("xCrosshairDom"),a=this.get("yCrosshairDom");n&&bt(n,{display:e}),a&&bt(a,{display:e})},r.prototype.initContainer=function(){if(i.prototype.initContainer.call(this),this.get("customContent")){this.get("container")&&this.get("container").remove();var t=this.getHtmlContentNode();this.get("parent").appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()}},r.prototype.updateInner=function(t){this.get("customContent")?this.renderCustomContent():(j0(t,["title","showTitle"])&&this.resetTitle(),Or(t,"items")&&this.renderItems()),i.prototype.updateInner.call(this,t)},r.prototype.initDom=function(){this.cacheDoms()},r.prototype.removeDom=function(){i.prototype.removeDom.call(this),this.clearCrosshairs()},r.prototype.resetPosition=function(){var t=this.get("x"),e=this.get("y"),n=this.get("offset"),a=this.getOffset(),o=a.offsetX,s=a.offsetY,l=this.get("position"),h=this.get("region"),u=this.getContainer(),c=this.getBBox(),f=c.width,v=c.height,p;h&&(p=Ii(h));var g=_0(t,e,n,f,v,l,p);bt(u,{left:Pt(g.x+o),top:Pt(g.y+s)}),this.resetCrosshairs()},r.prototype.renderCustomContent=function(){var t=this.getHtmlContentNode(),e=this.get("parent"),n=this.get("container");n&&n.parentNode===e?e.replaceChild(t,n):e.appendChild(t),this.set("container",t),this.resetStyles(),this.applyStyles()},r.prototype.getHtmlContentNode=function(){var t,e=this.get("customContent");if(e){var n=e(this.get("title"),this.get("items"));zu(n)?t=n:t=Xe(n)}return t},r.prototype.cacheDoms=function(){var t=this.getContainer(),e=t.getElementsByClassName(be)[0],n=t.getElementsByClassName(Oi)[0];this.set("titleDom",e),this.set("listDom",n)},r.prototype.resetTitle=function(){var t=this.get("title"),e=this.get("showTitle");e&&t?this.setTitle(t):this.setTitle("")},r.prototype.setTitle=function(t){var e=this.get("titleDom");e&&(e.innerText=t)},r.prototype.resetCrosshairs=function(){var t=this.get("crosshairsRegion"),e=this.get("crosshairs");if(!t||!e)this.clearCrosshairs();else{var n=Ii(t),a=this.get("xCrosshairDom"),o=this.get("yCrosshairDom");e==="x"?(this.resetCrosshair("x",n),o&&(o.remove(),this.set("yCrosshairDom",null))):e==="y"?(this.resetCrosshair("y",n),a&&(a.remove(),this.set("xCrosshairDom",null))):(this.resetCrosshair("x",n),this.resetCrosshair("y",n)),this.setCrossHairsVisible(this.get("visible"))}},r.prototype.resetCrosshair=function(t,e){var n=this.checkCrosshair(t),a=this.get(t);t==="x"?bt(n,{left:Pt(a),top:Pt(e.y),height:Pt(e.height)}):bt(n,{top:Pt(a),left:Pt(e.x),width:Pt(e.width)})},r.prototype.checkCrosshair=function(t){var e=t+"CrosshairDom",n=t+"CrosshairTpl",a="CROSSHAIR_"+t.toUpperCase(),o=X0[a],s=this.get(e),l=this.get("parent");return s||(s=Xe(this.get(n)),this.applyStyle(o,s),l.appendChild(s),this.set(e,s)),s},r.prototype.renderItems=function(){this.clearItemDoms();var t=this.get("items"),e=this.get("itemTpl"),n=this.get("listDom");n&&(M(t,function(a){var o=ki.toCSSGradient(a.color),s=w(w({},a),{color:o}),l=Nu(e,s),h=Xe(l);n.appendChild(h)}),this.applyChildrenStyles(n,this.get("domStyles")))},r.prototype.clearItemDoms=function(){this.get("listDom")&&Cs(this.get("listDom"))},r.prototype.clearCrosshairs=function(){var t=this.get("xCrosshairDom"),e=this.get("yCrosshairDom");t&&t.remove(),e&&e.remove(),this.set("xCrosshairDom",null),this.set("yCrosshairDom",null)},r}(Ms),q0={opacity:0},Z0={stroke:"#C5C5C5",strokeOpacity:.85},Q0={fill:"#CACED4",opacity:.85};function K0(i){return Et(i,function(r,t){var e=t===0?"M":"L",n=r[0],a=r[1];return[e,n,a]})}function Bf(i){return K0(i)}function J0(i){if(i.length<=2)return Bf(i);var r=[];M(i,function(o){gt(o,r.slice(r.length-2))||r.push(o[0],o[1])});var t=uy(r,!1),e=zt(i),n=e[0],a=e[1];return t.unshift(["M",n,a]),t}function tx(i,r,t,e){e===void 0&&(e=!0);var n=new Ca({values:i}),a=new xa({values:Et(i,function(s,l){return l})}),o=Et(i,function(s,l){return[a.scale(l)*r,t-n.scale(s)*t]});return e?J0(o):Bf(o)}function ex(i,r){var t=new Ca({values:i}),e=t.max<0?t.max:Math.max(0,t.min);return r-t.scale(e)*r}function rx(i,r,t,e){var n=Ci(i),a=ex(e,t);return n.push(["L",r,a]),n.push(["L",0,a]),n.push(["Z"]),n}var ix=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"trend",x:0,y:0,width:200,height:16,smooth:!0,isArea:!1,data:[],backgroundStyle:q0,lineStyle:Z0,areaStyle:Q0})},r.prototype.renderInner=function(t){var e=this.cfg,n=e.width,a=e.height,o=e.data,s=e.smooth,l=e.isArea,h=e.backgroundStyle,u=e.lineStyle,c=e.areaStyle;this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:w({x:0,y:0,width:n,height:a},h)});var f=tx(o,n,a,s);if(this.addShape(t,{id:this.getElementId("line"),type:"path",attrs:w({path:f},u)}),l){var v=rx(f,n,a,o);this.addShape(t,{id:this.getElementId("area"),type:"path",attrs:w({path:v},c)})}},r.prototype.applyOffset=function(){var t=this.cfg,e=t.x,n=t.y;this.moveElementTo(this.get("group"),{x:e,y:n})},r}(St),kf={fill:"#F7F7F7",stroke:"#BFBFBF",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#FFF"},Bh=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"handler",x:0,y:0,width:10,height:24,style:kf})},r.prototype.renderInner=function(t){var e=this.cfg,n=e.width,a=e.height,o=e.style,s=o.fill,l=o.stroke,h=o.radius,u=o.opacity,c=o.cursor;this.addShape(t,{type:"rect",id:this.getElementId("background"),attrs:{x:0,y:0,width:n,height:a,fill:s,stroke:l,radius:h,opacity:u,cursor:c}});var f=1/3*n,v=2/3*n,p=1/4*a,g=3/4*a;this.addShape(t,{id:this.getElementId("line-left"),type:"line",attrs:{x1:f,y1:p,x2:f,y2:g,stroke:l,cursor:c}}),this.addShape(t,{id:this.getElementId("line-right"),type:"line",attrs:{x1:v,y1:p,x2:v,y2:g,stroke:l,cursor:c}})},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.bindEvents=function(){var t=this;this.get("group").on("mouseenter",function(){var e=t.get("style").highLightFill;t.getElementByLocalId("background").attr("fill",e),t.draw()}),this.get("group").on("mouseleave",function(){var e=t.get("style").fill;t.getElementByLocalId("background").attr("fill",e),t.draw()})},r.prototype.draw=function(){var t=this.get("container").get("canvas");t&&t.draw()},r}(St),nx={fill:"#416180",opacity:.05},ax={fill:"#5B8FF9",opacity:.15,cursor:"move"},kn=10,ox={width:kn,height:24},sx={textBaseline:"middle",fill:"#000",opacity:.45},lx="sliderchange",hx=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.onMouseDown=function(e){return function(n){t.currentTarget=e;var a=n.originalEvent;a.stopPropagation(),a.preventDefault(),t.prevX=T(a,"touches.0.pageX",a.pageX),t.prevY=T(a,"touches.0.pageY",a.pageY);var o=t.getContainerDOM();o.addEventListener("mousemove",t.onMouseMove),o.addEventListener("mouseup",t.onMouseUp),o.addEventListener("mouseleave",t.onMouseUp),o.addEventListener("touchmove",t.onMouseMove),o.addEventListener("touchend",t.onMouseUp),o.addEventListener("touchcancel",t.onMouseUp)}},t.onMouseMove=function(e){var n=t.cfg.width,a=[t.get("start"),t.get("end")];e.stopPropagation(),e.preventDefault();var o=T(e,"touches.0.pageX",e.pageX),s=T(e,"touches.0.pageY",e.pageY),l=o-t.prevX,h=t.adjustOffsetRange(l/n);t.updateStartEnd(h),t.updateUI(t.getElementByLocalId("foreground"),t.getElementByLocalId("minText"),t.getElementByLocalId("maxText")),t.prevX=o,t.prevY=s,t.draw(),t.emit(lx,[t.get("start"),t.get("end")].sort()),t.delegateEmit("valuechanged",{originValue:a,value:[t.get("start"),t.get("end")]})},t.onMouseUp=function(){t.currentTarget&&(t.currentTarget=void 0);var e=t.getContainerDOM();e&&(e.removeEventListener("mousemove",t.onMouseMove),e.removeEventListener("mouseup",t.onMouseUp),e.removeEventListener("mouseleave",t.onMouseUp),e.removeEventListener("touchmove",t.onMouseMove),e.removeEventListener("touchend",t.onMouseUp),e.removeEventListener("touchcancel",t.onMouseUp))},t}return r.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.get("start"),a=this.get("end"),o=at(n,t,e),s=at(a,t,e);!this.get("isInit")&&(n!==o||a!==s)&&this.setValue([o,s])},r.prototype.getRange=function(){return{min:this.get("minLimit")||0,max:this.get("maxLimit")||1}},r.prototype.setValue=function(t){var e=this.getRange();if(P(t)&&t.length===2){var n=[this.get("start"),this.get("end")];this.update({start:at(t[0],e.min,e.max),end:at(t[1],e.min,e.max)}),this.get("updateAutoRender")||this.render(),this.delegateEmit("valuechanged",{originValue:n,value:t})}},r.prototype.getValue=function(){return[this.get("start"),this.get("end")]},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"slider",x:0,y:0,width:100,height:16,backgroundStyle:{},foregroundStyle:{},handlerStyle:{},textStyle:{},defaultCfg:{backgroundStyle:nx,foregroundStyle:ax,handlerStyle:ox,textStyle:sx}})},r.prototype.update=function(t){var e=t.start,n=t.end,a=w({},t);I(e)||(a.start=at(e,0,1)),I(n)||(a.end=at(n,0,1)),i.prototype.update.call(this,a),this.minHandler=this.getChildComponentById(this.getElementId("minHandler")),this.maxHandler=this.getChildComponentById(this.getElementId("maxHandler")),this.trend=this.getChildComponentById(this.getElementId("trend"))},r.prototype.init=function(){this.set("start",at(this.get("start"),0,1)),this.set("end",at(this.get("end"),0,1)),i.prototype.init.call(this)},r.prototype.render=function(){i.prototype.render.call(this),this.updateUI(this.getElementByLocalId("foreground"),this.getElementByLocalId("minText"),this.getElementByLocalId("maxText"))},r.prototype.renderInner=function(t){var e=this.cfg;e.start,e.end;var n=e.width,a=e.height,o=e.trendCfg,s=o===void 0?{}:o,l=e.minText,h=e.maxText,u=e.backgroundStyle,c=u===void 0?{}:u,f=e.foregroundStyle,v=f===void 0?{}:f,p=e.textStyle,g=p===void 0?{}:p,d=D({},kf,this.cfg.handlerStyle);Gt(T(s,"data"))&&(this.trend=this.addComponent(t,w({component:ix,id:this.getElementId("trend"),x:0,y:0,width:n,height:a},s))),this.addShape(t,{id:this.getElementId("background"),type:"rect",attrs:w({x:0,y:0,width:n,height:a},c)}),this.addShape(t,{id:this.getElementId("minText"),type:"text",attrs:w({y:a/2,textAlign:"right",text:l,silent:!1},g)}),this.addShape(t,{id:this.getElementId("maxText"),type:"text",attrs:w({y:a/2,textAlign:"left",text:h,silent:!1},g)}),this.addShape(t,{id:this.getElementId("foreground"),name:"foreground",type:"rect",attrs:w({y:0,height:a},v)});var y=T(d,"width",kn),C=T(d,"height",24);this.minHandler=this.addComponent(t,{component:Bh,id:this.getElementId("minHandler"),name:"handler-min",x:0,y:(a-C)/2,width:y,height:C,cursor:"ew-resize",style:d}),this.maxHandler=this.addComponent(t,{component:Bh,id:this.getElementId("maxHandler"),name:"handler-max",x:0,y:(a-C)/2,width:y,height:C,cursor:"ew-resize",style:d})},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.updateUI=function(t,e,n){var a=this.cfg,o=a.start,s=a.end,l=a.width,h=a.minText,u=a.maxText,c=a.handlerStyle,f=a.height,v=o*l,p=s*l;this.trend&&(this.trend.update({width:l,height:f}),this.get("updateAutoRender")||this.trend.render()),t.attr("x",v),t.attr("width",p-v);var g=T(c,"width",kn);e.attr("text",h),n.attr("text",u);var d=this._dodgeText([v,p],e,n),y=d[0],C=d[1];this.minHandler&&(this.minHandler.update({x:v-g/2}),this.get("updateAutoRender")||this.minHandler.render()),M(y,function(m,x){return e.attr(x,m)}),this.maxHandler&&(this.maxHandler.update({x:p-g/2}),this.get("updateAutoRender")||this.maxHandler.render()),M(C,function(m,x){return n.attr(x,m)})},r.prototype.bindEvents=function(){var t=this.get("group");t.on("handler-min:mousedown",this.onMouseDown("minHandler")),t.on("handler-min:touchstart",this.onMouseDown("minHandler")),t.on("handler-max:mousedown",this.onMouseDown("maxHandler")),t.on("handler-max:touchstart",this.onMouseDown("maxHandler"));var e=t.findById(this.getElementId("foreground"));e.on("mousedown",this.onMouseDown("foreground")),e.on("touchstart",this.onMouseDown("foreground"))},r.prototype.adjustOffsetRange=function(t){var e=this.cfg,n=e.start,a=e.end;switch(this.currentTarget){case"minHandler":{var o=0-n,s=1-n;return Math.min(s,Math.max(o,t))}case"maxHandler":{var o=0-a,s=1-a;return Math.min(s,Math.max(o,t))}case"foreground":{var o=0-n,s=1-a;return Math.min(s,Math.max(o,t))}}},r.prototype.updateStartEnd=function(t){var e=this.cfg,n=e.start,a=e.end;switch(this.currentTarget){case"minHandler":n+=t;break;case"maxHandler":a+=t;break;case"foreground":n+=t,a+=t;break}this.set("start",n),this.set("end",a)},r.prototype._dodgeText=function(t,e,n){var a,o,s=this.cfg,l=s.handlerStyle,h=s.width,u=2,c=T(l,"width",kn),f=t[0],v=t[1],p=!1;f>v&&(a=[v,f],f=a[0],v=a[1],o=[n,e],e=o[0],n=o[1],p=!0);var g=e.getBBox(),d=n.getBBox(),y=g.width>f-u?{x:f+c/2+u,textAlign:"left"}:{x:f-c/2-u,textAlign:"right"},C=d.width>h-v-u?{x:v-c/2-u,textAlign:"right"}:{x:v+c/2+u,textAlign:"left"};return p?[C,y]:[y,C]},r.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},r.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},r}(St),ux={trackColor:"rgba(0,0,0,0)",thumbColor:"rgba(0,0,0,0.15)",size:8,lineCap:"round"},to={default:ux,hover:{thumbColor:"rgba(0,0,0,0.2)"}},cx=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.clearEvents=Ye,t.onStartEvent=function(e){return function(n){t.isMobile=e,n.originalEvent.preventDefault();var a=e?T(n.originalEvent,"touches.0.clientX"):n.clientX,o=e?T(n.originalEvent,"touches.0.clientY"):n.clientY;t.startPos=t.cfg.isHorizontal?a:o,t.bindLaterEvent()}},t.bindLaterEvent=function(){var e=t.getContainerDOM(),n=[];t.isMobile?n=[xr(e,"touchmove",t.onMouseMove),xr(e,"touchend",t.onMouseUp),xr(e,"touchcancel",t.onMouseUp)]:n=[xr(e,"mousemove",t.onMouseMove),xr(e,"mouseup",t.onMouseUp),xr(e,"mouseleave",t.onMouseUp)],t.clearEvents=function(){n.forEach(function(a){a.remove()})}},t.onMouseMove=function(e){var n=t.cfg,a=n.isHorizontal,o=n.thumbOffset;e.preventDefault();var s=t.isMobile?T(e,"touches.0.clientX"):e.clientX,l=t.isMobile?T(e,"touches.0.clientY"):e.clientY,h=a?s:l,u=h-t.startPos;t.startPos=h,t.updateThumbOffset(o+u)},t.onMouseUp=function(e){e.preventDefault(),t.clearEvents()},t.onTrackClick=function(e){var n=t.cfg,a=n.isHorizontal,o=n.x,s=n.y,l=n.thumbLen,h=t.getContainerDOM(),u=h.getBoundingClientRect(),c=e.clientX,f=e.clientY,v=a?c-u.left-o-l/2:f-u.top-s-l/2,p=t.validateRange(v);t.updateThumbOffset(p)},t.onThumbMouseOver=function(){var e=t.cfg.theme.hover.thumbColor;t.getElementByLocalId("thumb").attr("stroke",e),t.draw()},t.onThumbMouseOut=function(){var e=t.cfg.theme.default.thumbColor;t.getElementByLocalId("thumb").attr("stroke",e),t.draw()},t}return r.prototype.setRange=function(t,e){this.set("minLimit",t),this.set("maxLimit",e);var n=this.getValue(),a=at(n,t,e);n!==a&&!this.get("isInit")&&this.setValue(a)},r.prototype.getRange=function(){var t=this.get("minLimit")||0,e=this.get("maxLimit")||1;return{min:t,max:e}},r.prototype.setValue=function(t){var e=this.getRange(),n=this.getValue();this.update({thumbOffset:(this.get("trackLen")-this.get("thumbLen"))*at(t,e.min,e.max)}),this.delegateEmit("valuechange",{originalValue:n,value:this.getValue()})},r.prototype.getValue=function(){return at(this.get("thumbOffset")/(this.get("trackLen")-this.get("thumbLen")),0,1)},r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return w(w({},t),{name:"scrollbar",isHorizontal:!0,minThumbLen:20,thumbOffset:0,theme:to})},r.prototype.renderInner=function(t){this.renderTrackShape(t),this.renderThumbShape(t)},r.prototype.applyOffset=function(){this.moveElementTo(this.get("group"),{x:this.get("x"),y:this.get("y")})},r.prototype.initEvent=function(){this.bindEvents()},r.prototype.renderTrackShape=function(t){var e=this.cfg,n=e.trackLen,a=e.theme,o=a===void 0?{default:{}}:a,s=D({},to,o).default,l=s.lineCap,h=s.trackColor,u=s.size,c=T(this.cfg,"size",u),f=this.get("isHorizontal")?{x1:0+c/2,y1:c/2,x2:n-c/2,y2:c/2,lineWidth:c,stroke:h,lineCap:l}:{x1:c/2,y1:0+c/2,x2:c/2,y2:n-c/2,lineWidth:c,stroke:h,lineCap:l};return this.addShape(t,{id:this.getElementId("track"),name:"track",type:"line",attrs:f})},r.prototype.renderThumbShape=function(t){var e=this.cfg,n=e.thumbOffset,a=e.thumbLen,o=e.theme,s=D({},to,o).default,l=s.size,h=s.lineCap,u=s.thumbColor,c=T(this.cfg,"size",l),f=this.get("isHorizontal")?{x1:n+c/2,y1:c/2,x2:n+a-c/2,y2:c/2,lineWidth:c,stroke:u,lineCap:h,cursor:"default"}:{x1:c/2,y1:n+c/2,x2:c/2,y2:n+a-c/2,lineWidth:c,stroke:u,lineCap:h,cursor:"default"};return this.addShape(t,{id:this.getElementId("thumb"),name:"thumb",type:"line",attrs:f})},r.prototype.bindEvents=function(){var t=this.get("group");t.on("mousedown",this.onStartEvent(!1)),t.on("mouseup",this.onMouseUp),t.on("touchstart",this.onStartEvent(!0)),t.on("touchend",this.onMouseUp);var e=t.findById(this.getElementId("track"));e.on("click",this.onTrackClick);var n=t.findById(this.getElementId("thumb"));n.on("mouseover",this.onThumbMouseOver),n.on("mouseout",this.onThumbMouseOut)},r.prototype.getContainerDOM=function(){var t=this.get("container"),e=t&&t.get("canvas");return e&&e.get("container")},r.prototype.validateRange=function(t){var e=this.cfg,n=e.thumbLen,a=e.trackLen,o=t;return t+n>a?o=a-n:t+n<n&&(o=0),o},r.prototype.draw=function(){var t=this.get("container"),e=t&&t.get("canvas");e&&e.draw()},r.prototype.updateThumbOffset=function(t){var e=this.cfg,n=e.thumbOffset,a=e.isHorizontal,o=e.thumbLen,s=e.size,l=this.validateRange(t);if(l!==n){var h=this.getElementByLocalId("thumb");a?h.attr({x1:l+s/2,x2:l+o-s/2}):h.attr({y1:l+s/2,y2:l+o-s/2}),this.emitOffsetChange(l)}},r.prototype.emitOffsetChange=function(t){var e=this.cfg,n=e.thumbOffset,a=e.trackLen,o=e.thumbLen;this.cfg.thumbOffset=t,this.emit("scrollchange",{thumbOffset:t,ratio:at(t/(a-o),0,1)}),this.delegateEmit("valuechange",{originalValue:n,value:t})},r}(St),fx=I0,vx=P0,px=G0,gx=Y0,kh=H0,dx=N0,Ea=U0;function yx(i){if(pe(i))return null;var r=i[0].x,t=i[0].x,e=i[0].y,n=i[0].y;return M(i,function(a){r=r>a.x?a.x:r,t=t<a.x?a.x:t,e=e>a.y?a.y:e,n=n<a.y?a.y:n}),{minX:r,maxX:t,minY:e,maxY:n,centerX:(r+t)/2,centerY:(e+n)/2}}function Ih(i){return Array.from(new Set(i)).length===1}function Ph(i){return(Yt(i)+Lt(i))/2}function ft(i,r,t,e){return{x:i+t*Math.cos(e),y:r+t*Math.sin(e)}}function ur(i,r,t,e,n,a){a===void 0&&(a=0);var o=ft(i,r,t,e),s=ft(i,r,t,n),l=ft(i,r,a,e),h=ft(i,r,a,n);if(n-e===Math.PI*2){var u=ft(i,r,t,e+Math.PI),c=ft(i,r,a,e+Math.PI),f=[["M",o.x,o.y],["A",t,t,0,1,1,u.x,u.y],["A",t,t,0,1,1,s.x,s.y],["M",l.x,l.y]];return a&&(f.push(["A",a,a,0,1,0,c.x,c.y]),f.push(["A",a,a,0,1,0,h.x,h.y])),f.push(["M",o.x,o.y]),f.push(["Z"]),f}var v=n-e<=Math.PI?0:1,p=[["M",o.x,o.y],["A",t,t,0,v,1,s.x,s.y],["L",h.x,h.y]];return a&&p.push(["A",a,a,0,v,0,l.x,l.y]),p.push(["L",o.x,o.y]),p.push(["Z"]),p}function If(i,r,t,e,n){var a=ft(i,r,t,e),o=ft(i,r,t,n);if(xt(n-e,Math.PI*2)){var s=ft(i,r,t,e+Math.PI);return[["M",a.x,a.y],["A",t,t,0,1,1,s.x,s.y],["A",t,t,0,1,1,a.x,a.y],["A",t,t,0,1,0,s.x,s.y],["A",t,t,0,1,0,a.x,a.y],["Z"]]}var l=n-e<=Math.PI?0:1;return[["M",a.x,a.y],["A",t,t,0,l,1,o.x,o.y]]}function _n(i,r){var t=i.points,e=yx(t),n,a,o=r.startAngle,s=r.endAngle,l=s-o;return r.isTransposed?(n=e.maxY*l,a=e.minY*l):(n=e.maxX*l,a=e.minX*l),n+=o,a+=o,{startAngle:a,endAngle:n}}function mx(i,r){if(U(i)&&U(r))return[i,r];if(i=i,r=r,Ih(i)||Ih(r))return[Ph(i),Ph(r)];for(var t=-1,e=0,n=0,a,o=i.length-1,s,l=0;++t<i.length;)a=o,o=t,l+=s=i[a]*r[o]-i[o]*r[a],e+=(i[a]+i[o])*s,n+=(r[a]+r[o])*s;return l*=3,[e/l,n/l]}function Pf(i,r){var t=i.attr(),e=r.attr();return M(t,function(n,a){e[a]===void 0&&(e[a]=void 0)}),e}function Er(i,r,t){var e=Math.min(r,t),n=Math.max(r,t);return i>=e&&i<=n}function xx(i,r,t){if(N(i))return i.padEnd(r,t);if(P(i)){var e=i.length;if(e<r)for(var n=r-e,a=0;a<n;a++)i.push(t)}return i}function Ft(i,r){return typeof i=="object"&&r.forEach(function(t){delete i[t]}),i}function Re(i,r,t){var e,n;r===void 0&&(r=[]),t===void 0&&(t=new Map);try{for(var a=$(i),o=a.next();!o.done;o=a.next()){var s=o.value;t.has(s)||(r.push(s),t.set(s,!0))}}catch(l){e={error:l}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return r}var Bt=function(){function i(r,t,e,n){r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),this.x=r,this.y=t,this.height=n,this.width=e}return i.fromRange=function(r,t,e,n){return new i(r,t,e-r,n-t)},i.fromObject=function(r){return new i(r.minX,r.minY,r.width,r.height)},Object.defineProperty(i.prototype,"minX",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxX",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"minY",{get:function(){return this.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"maxY",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tl",{get:function(){return{x:this.x,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"tr",{get:function(){return{x:this.maxX,y:this.y}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bl",{get:function(){return{x:this.x,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"br",{get:function(){return{x:this.maxX,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"top",{get:function(){return{x:this.x+this.width/2,y:this.minY}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"right",{get:function(){return{x:this.maxX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"bottom",{get:function(){return{x:this.x+this.width/2,y:this.maxY}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"left",{get:function(){return{x:this.minX,y:this.y+this.height/2}},enumerable:!1,configurable:!0}),i.prototype.isEqual=function(r){return this.x===r.x&&this.y===r.y&&this.width===r.width&&this.height===r.height},i.prototype.contains=function(r){return r.minX>=this.minX&&r.maxX<=this.maxX&&r.minY>=this.minY&&r.maxY<=this.maxY},i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.add=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=this.clone();return M(r,function(n){e.x=Math.min(n.x,e.x),e.y=Math.min(n.y,e.y),e.width=Math.max(n.maxX,e.maxX)-e.x,e.height=Math.max(n.maxY,e.maxY)-e.y}),e},i.prototype.merge=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];var e=this.clone();return M(r,function(n){e.x=Math.max(n.x,e.x),e.y=Math.max(n.y,e.y),e.width=Math.min(n.maxX,e.maxX)-e.x,e.height=Math.min(n.maxY,e.maxY)-e.y}),e},i.prototype.cut=function(r,t){var e=r.width,n=r.height;switch(t){case F.TOP:case F.TOP_LEFT:case F.TOP_RIGHT:return i.fromRange(this.minX,this.minY+n,this.maxX,this.maxY);case F.RIGHT:case F.RIGHT_TOP:case F.RIGHT_BOTTOM:return i.fromRange(this.minX,this.minY,this.maxX-e,this.maxY);case F.BOTTOM:case F.BOTTOM_LEFT:case F.BOTTOM_RIGHT:return i.fromRange(this.minX,this.minY,this.maxX,this.maxY-n);case F.LEFT:case F.LEFT_TOP:case F.LEFT_BOTTOM:return i.fromRange(this.minX+e,this.minY,this.maxX,this.maxY);default:return this}},i.prototype.shrink=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return new i(this.x+o,this.y+e,this.width-o-n,this.height-e-a)},i.prototype.expand=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return new i(this.x-o,this.y-e,this.width+o+n,this.height+e+a)},i.prototype.exceed=function(r){return[Math.max(-this.minY+r.minY,0),Math.max(this.maxX-r.maxX,0),Math.max(this.maxY-r.maxY,0),Math.max(-this.minX+r.minX,0)]},i.prototype.collide=function(r){return this.minX<r.maxX&&this.maxX>r.minX&&this.minY<r.maxY&&this.maxY>r.minY},i.prototype.size=function(){return this.width*this.height},i.prototype.isPointIn=function(r){return r.x>=this.minX&&r.x<=this.maxX&&r.y>=this.minY&&r.y<=this.maxY},i}();function wx(i){return[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}function _i(i){if(i.isPolar&&!i.isTransposed)return(i.endAngle-i.startAngle)*i.getRadius();var r=i.convert({x:0,y:0}),t=i.convert({x:1,y:0});return Math.sqrt(Math.pow(t.x-r.x,2)+Math.pow(t.y-r.y,2))}function Cx(i){if(i.isPolar){var r=i.startAngle,t=i.endAngle;return t-r===Math.PI*2}return!1}function Ba(i,r){var t=i.getCenter();return Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2))}function Mx(i,r){var t=!1;if(i)if(i.type==="theta"){var e=i.start,n=i.end;t=Er(r.x,e.x,n.x)&&Er(r.y,e.y,n.y)}else{var a=i.invert(r);t=Er(a.x,0,1)&&Er(a.y,0,1)}return t}function Yr(i,r){var t=i.getCenter();return Math.atan2(r.y-t.y,r.x-t.x)}function Ls(i,r){r===void 0&&(r=0);var t=i.start,e=i.end,n=i.getWidth(),a=i.getHeight();if(i.isPolar){var o=i.startAngle,s=i.endAngle,l=i.getCenter(),h=i.getRadius();return{type:"path",startState:{path:ur(l.x,l.y,h+r,o,o)},endState:function(c){var f=(s-o)*c+o,v=ur(l.x,l.y,h+r,o,f);return{path:v}},attrs:{path:ur(l.x,l.y,h+r,o,s)}}}var u;return i.isTransposed?u={height:a+r*2}:u={width:n+r*2},{type:"rect",startState:{x:t.x-r,y:e.y-r,width:i.isTransposed?n+r*2:0,height:i.isTransposed?0:a+r*2},endState:u,attrs:{x:t.x-r,y:e.y-r,width:n+r*2,height:a+r*2}}}function Sx(i,r){r===void 0&&(r=0);var t=i.start,e=i.end,n=i.getWidth(),a=i.getHeight(),o=Math.min(t.x,e.x),s=Math.min(t.y,e.y);return Bt.fromRange(o-r,s-r,o+n+r,s+a+r)}var bx=/^(?:(?!0000)[0-9]{4}([-/.]+)(?:(?:0?[1-9]|1[0-2])\1(?:0?[1-9]|1[0-9]|2[0-8])|(?:0?[13-9]|1[0-2])\1(?:29|30)|(?:0?[13578]|1[02])\1(?:31))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)([-/.]+)0?2\2(?:29))(\s+([01]|([01][0-9]|2[0-3])):([0-9]|[0-5][0-9]):([0-9]|[0-5][0-9]))?$/;function Ax(i){var r="linear";return bx.test(i)?r="timeCat":N(i)&&(r="cat"),r}function Ff(i,r,t,e){return r===void 0&&(r={}),r.type?r.type:i.type!=="identity"&&Ar.includes(t)&&["interval"].includes(e)||i.isCategory?"cat":i.type}function Tx(i,r,t){var e=r||[];if(U(i)||I(np(e,i))&&pe(t)){var n=Do("identity");return new n({field:i.toString(),values:[i]})}var a=Me(e,i),o=T(t,"type",Ax(a[0])),s=Do(o);return new s(w({field:i,values:a},t))}function Lx(i,r){if(i.type!=="identity"&&r.type!=="identity"){var t={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e]);i.change(t)}}function Di(i){return i.alias||i.field}function Of(i,r,t){var e=i.values,n=e.length,a;if(n===1)a=[.5,1];else{var o=1,s=0;Cx(r)?r.isTransposed?(o=T(t,"widthRatio.multiplePie",1/1.3),s=1/n*o,a=[s/2,1-s/2]):a=[0,1-1/n]:(s=1/n/2,a=[s,1-s])}return a}function Ex(i){var r=i.values.filter(function(t){return!I(t)&&!isNaN(t)});return Math.max.apply(Math,et(et([],Y(r),!1),[I(i.max)?-1/0:i.max],!1))}function Bx(i){var r,t;switch(i){case F.TOP:r={x:0,y:1},t={x:1,y:1};break;case F.RIGHT:r={x:1,y:0},t={x:1,y:1};break;case F.BOTTOM:r={x:0,y:0},t={x:1,y:0};break;case F.LEFT:r={x:0,y:0},t={x:0,y:1};break;default:r=t={x:0,y:0}}return{start:r,end:t}}function kx(i){var r,t;return i.isTransposed?(r={x:0,y:0},t={x:1,y:0}):(r={x:0,y:0},t={x:0,y:1}),{start:r,end:t}}function cn(i,r){var t={start:{x:0,y:0},end:{x:0,y:0}};i.isRect?t=Bx(r):i.isPolar&&(t=kx(i));var e=t.start,n=t.end;return{start:i.convert(e),end:i.convert(n)}}function Df(i){var r=i.start,t=i.end;return r.x===t.x}function Fh(i,r){var t=i.start,e=i.end,n=Df(i);return n?(t.y-e.y)*(r.x-t.x)>0?1:-1:(e.x-t.x)*(t.y-r.y)>0?-1:1}function fn(i,r){var t=T(i,["components","axis"],{});return D({},T(t,["common"],{}),D({},T(t,[r],{})))}function Oh(i,r,t){var e=T(i,["components","axis"],{});return D({},T(e,["common","title"],{}),D({},T(e,[r,"title"],{})),t)}function eo(i){var r=i.x,t=i.y,e=i.circleCenter,n=t.start>t.end,a=i.isTransposed?i.convert({x:n?0:1,y:0}):i.convert({x:0,y:n?0:1}),o=[a.x-e.x,a.y-e.y],s=[1,0],l=a.y>e.y?Co(o,s):Co(o,s)*-1,h=l+(r.end-r.start),u=Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2));return{center:e,radius:u,startAngle:l,endAngle:h}}function jn(i,r){return Mi(i)?i===!1?!1:{}:T(i,[r])}function Dh(i,r){return T(i,"position",r)}function Rh(i,r){return T(r,["title","text"],Di(i))}var Wr=function(){function i(r,t){this.destroyed=!1,this.facets=[],this.view=r,this.cfg=D({},this.getDefaultCfg(),t)}return i.prototype.init=function(){this.container||(this.container=this.createContainer());var r=this.view.getData();this.facets=this.generateFacets(r)},i.prototype.render=function(){this.renderViews()},i.prototype.update=function(){},i.prototype.clear=function(){this.clearFacetViews()},i.prototype.destroy=function(){this.clear(),this.container&&(this.container.remove(!0),this.container=void 0),this.destroyed=!0,this.view=void 0,this.facets=[]},i.prototype.facetToView=function(r){var t=r.region,e=r.data,n=r.padding,a=n===void 0?this.cfg.padding:n,o=this.view.createView({region:t,padding:a});o.data(e||[]),r.view=o,this.beforeEachView(o,r);var s=this.cfg.eachView;return s&&s(o,r),this.afterEachView(o,r),o},i.prototype.createContainer=function(){var r=this.view.getLayer(st.FORE);return r.addGroup()},i.prototype.renderViews=function(){this.createFacetViews()},i.prototype.createFacetViews=function(){var r=this;return this.facets.map(function(t){return r.facetToView(t)})},i.prototype.clearFacetViews=function(){var r=this;M(this.facets,function(t){t.view&&(r.view.removeView(t.view),t.view=void 0)})},i.prototype.parseSpacing=function(){var r=this.view.viewBBox,t=r.width,e=r.height,n=this.cfg.spacing;return n.map(function(a,o){return U(a)?a/(o===0?t:e):parseFloat(a)/100})},i.prototype.getFieldValues=function(r,t){var e=[],n={};return M(r,function(a){var o=a[t];!I(o)&&!n[o]&&(e.push(o),n[o]=!0)}),e},i.prototype.getRegion=function(r,t,e,n){var a=Y(this.parseSpacing(),2),o=a[0],s=a[1],l=(1+o)/(t===0?1:t)-o,h=(1+s)/(r===0?1:r)-s,u={x:(l+o)*e,y:(h+s)*n},c={x:u.x+l,y:u.y+h};return{start:u,end:c}},i.prototype.getDefaultCfg=function(){return{eachView:void 0,showTitle:!0,spacing:[0,0],padding:10,fields:[]}},i.prototype.getDefaultTitleCfg=function(){var r=this.view.getTheme().fontFamily;return{style:{fontSize:14,fill:"#666",fontFamily:r}}},i.prototype.processAxis=function(r,t){var e=r.getOptions(),n=e.coordinate,a=r.geometries,o=T(n,"type","rect");if(o==="rect"&&a.length){I(e.axes)&&(e.axes={});var s=e.axes,l=Y(a[0].getXYFields(),2),h=l[0],u=l[1],c=jn(s,h),f=jn(s,u);c!==!1&&(e.axes[h]=this.getXAxisOption(h,s,c,t)),f!==!1&&(e.axes[u]=this.getYAxisOption(u,s,f,t))}},i.prototype.getFacetDataFilter=function(r){return function(t){return hp(r,function(e){var n=e.field,a=e.value;return!I(a)&&n?t[n]===a:!0})}},i}(),Rf={},Ix=function(i){return Rf[Xr(i)]},$r=function(i,r){Rf[Xr(i)]=r},yt=function(){function i(r,t){this.context=r,this.cfg=t,r.addAction(this)}return i.prototype.applyCfg=function(r){ot(this,r)},i.prototype.init=function(){this.applyCfg(this.cfg)},i.prototype.destroy=function(){this.context.removeAction(this),this.context=null},i}(),Px=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.execute=function(){this.callback&&this.callback(this.context)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.callback=null},r}(yt),Yf={};function Fx(i,r){var t=Yf[i],e=null;if(t){var n=t.ActionClass,a=t.cfg;e=new n(r,a),e.name=i,e.init()}return e}function V(i,r,t){Yf[i]={ActionClass:r,cfg:t}}function Ox(i,r){var t=new Px(r);return t.callback=i,t.name="callback",t}function Dx(i,r){var t=[];if(i.length){t.push(["M",i[0].x,i[0].y]);for(var e=1,n=i.length;e<n;e+=1){var a=i[e];t.push(["L",a.x,a.y])}r&&t.push(["Z"])}return t}function No(i,r){for(var t=[i[0]],e=1,n=i.length;e<n;e=e+2){var a=r.convert({x:i[e],y:i[e+1]});t.push(a.x,a.y)}return t}function Gf(i,r){var t=r.isTransposed,e=i[1],n=i[6],a=i[7],o=r.convert({x:n,y:a}),s=t?0:1;return["A",e,e,0,0,s,o.x,o.y]}function Rx(i,r,t){var e=t.isTransposed,n=t.startAngle,a=t.endAngle,o=i[0].toLowerCase()==="a"?{x:i[6],y:i[7]}:{x:i[1],y:i[2]},s={x:r[1],y:r[2]},l=[],h=e?"y":"x",u=Math.abs(s[h]-o[h])*(a-n),c=s[h]>=o[h]?1:0,f=u>Math.PI?1:0,v=t.convert(s),p=Ba(t,v);if(p>=.5)if(u===Math.PI*2){var g={x:(s.x+o.x)/2,y:(s.y+o.y)/2},d=t.convert(g);l.push(["A",p,p,0,f,c,d.x,d.y]),l.push(["A",p,p,0,f,c,v.x,v.y])}else l.push(["A",p,p,0,f,c,v.x,v.y]);return l}function Yx(i){M(i,function(r,t){var e=r;if(e[0].toLowerCase()==="a"){var n=i[t-1],a=i[t+1];a&&a[0].toLowerCase()==="a"?n&&n[0].toLowerCase()==="l"&&(n[0]="M"):n&&n[0].toLowerCase()==="a"&&a&&a[0].toLowerCase()==="l"&&(a[0]="M")}})}var Gx=function(i,r,t,e){var n,a=[],o=!!e,s,l,h,u,c,f,v;if(o){n=Y(e,2),h=n[0],u=n[1];for(var p=0,g=i.length;p<g;p++){var d=i[p];h=Ot([0,0],h,d),u=Dt([0,0],u,d)}}for(var p=0,y=i.length;p<y;p++){var d=i[p];if(p===0&&!t)v=d;else if(p===y-1&&!t)f=d,a.push(v),a.push(f);else{s=i[t?p?p-1:y-1:p-1],l=i[t?(p+1)%y:p+1];var C=[0,0];C=kr(C,l,s),C=qt(C,C,r);var m=On(d,s),x=On(d,l),S=m+x;S!==0&&(m/=S,x/=S);var b=qt([0,0],C,-m),A=qt([0,0],C,x);f=Ge([0,0],d,b),c=Ge([0,0],d,A),c=Ot([0,0],c,Dt([0,0],l,d)),c=Dt([0,0],c,Ot([0,0],l,d)),b=kr([0,0],c,d),b=qt([0,0],b,-m/x),f=Ge([0,0],d,b),f=Ot([0,0],f,Dt([0,0],s,d)),f=Dt([0,0],f,Ot([0,0],s,d)),A=kr([0,0],d,f),A=qt([0,0],A,x/m),c=Ge([0,0],d,A),o&&(f=Dt([0,0],f,h),f=Ot([0,0],f,u),c=Dt([0,0],c,h),c=Ot([0,0],c,u)),a.push(v),a.push(f),v=c}}return t&&a.push(a.shift()),a};function Hf(i,r,t){for(var e=!!r,n=[],a=0,o=i.length;a<o;a+=2)n.push([i[a],i[a+1]]);for(var s=Gx(n,.4,e,t),l=n.length,h=[],u,c,f,a=0;a<l-1;a++)u=s[a*2],c=s[a*2+1],f=n[a+1],h.push(["C",u[0],u[1],c[0],c[1],f[0],f[1]]);return e&&(u=s[l],c=s[l+1],f=n[0],h.push(["C",u[0],u[1],c[0],c[1],f[0],f[1]])),h}function ji(i,r){return Dx(i,r)}function Un(i,r,t){var e=[],n=i[0],a=null;if(i.length<=2)return ji(i,r);for(var o=0,s=i.length;o<s;o++){var l=i[o];(!a||!(a.x===l.x&&a.y===l.y))&&(e.push(l.x),e.push(l.y),a=l)}var h=t||[[0,0],[1,1]],u=Hf(e,r,h);return u.unshift(["M",n.x,n.y]),u}function Hx(i,r){var t=[];return M(r,function(e){var n=e[0];switch(n.toLowerCase()){case"m":case"l":case"c":t.push(No(e,i));break;case"a":t.push(Gf(e,i));break;case"z":default:t.push(e);break}}),t}function Vx(i,r){var t=[],e,n,a,o;return M(r,function(s,l){var h=s[0];switch(h.toLowerCase()){case"m":case"c":case"q":t.push(No(s,i));break;case"l":e=r[l-1],n=s,a=i.isTransposed,o=a?e[e.length-2]===n[1]:e[e.length-1]===n[2],o?t=t.concat(Rx(e,n,i)):t.push(No(s,i));break;case"a":t.push(Gf(s,i));break;case"z":default:t.push(s);break}}),Yx(t),t}function Vf(i,r){var t=i.event,e=t.target,n=e.getCanvasBBox();return n.width>=r||n.height>=r?n:null}function Nx(i,r){var t=i.event,e=t.target,n=e.getCanvasBBox();return n.width>=r||n.height>=r?e.attr("path"):null}function _e(i){var r=i.event,t,e=r.target;return e&&(t=e.get("element")),t}function Gr(i){var r=i.event,t=r.target,e;return t&&(e=t.get("delegateObject")),e}function Nf(i){var r=i.event.gEvent;return!(r&&r.fromShape&&r.toShape&&r.fromShape.get("element")===r.toShape.get("element"))}function Ri(i){return i&&i.component&&i.component.isList()}function Xf(i){return i&&i.component&&i.component.isSlider()}function Yi(i){var r=i.event,t=r.target;return t&&t.get("name")==="mask"}function Es(i,r){var t=i.event.target;if(t.get("type")==="path"){var e=Nx(i,r);return e?Wx(i.view,e):void 0}var n=Vf(i,r);return n?Bs(i.view,n):null}function zf(i,r,t){var e=Vf(i,t);if(!e)return null;var n=i.view,a=Xo(n,r,{x:e.x,y:e.y}),o=Xo(n,r,{x:e.maxX,y:e.maxY}),s={minX:a.x,minY:a.y,maxX:o.x,maxY:o.y};return Bs(r,s)}function Mt(i){var r=i.geometries,t=[];return M(r,function(e){var n=e.elements;t=t.concat(n)}),i.views&&i.views.length&&M(i.views,function(e){t=t.concat(Mt(e))}),t}function Xx(i,r,t){var e=Mt(i);return e.filter(function(n){return ae(n,r)===t})}function Wf(i,r){var t=i.geometries,e=[];return M(t,function(n){var a=n.getElementsBy(function(o){return o.hasState(r)});e=e.concat(a)}),e}function ae(i,r){var t=i.getModel(),e=t.data,n;return P(e)?n=e[0][r]:n=e[r],n}function zx(i,r){return!(r.minX>i.maxX||r.maxX<i.minX||r.minY>i.maxY||r.maxY<i.minY)}function Bs(i,r){var t=Mt(i),e=[];return M(t,function(n){var a=n.shape,o=a.getCanvasBBox();zx(r,o)&&e.push(n)}),e}function Yh(i){var r=[];return M(i,function(t){var e=t[0];if(e!=="A")for(var n=1;n<t.length;n=n+2)r.push([t[n],t[n+1]]);else{var a=t.length;r.push([t[a-2],t[a-1]])}}),r}function Wx(i,r){var t=Mt(i),e=Yh(r),n=t.filter(function(a){var o=a.shape,s;if(o.get("type")==="path")s=Yh(o.attr("path"));else{var l=o.getCanvasBBox();s=wx(l)}return wy(e,s)});return n}function $f(i){return i.getComponents().map(function(r){return r.component})}function ks(i,r){var t=r.x-i.x,e=r.y-i.y;return Math.sqrt(t*t+e*e)}function $x(i,r){if(i.length<=2)return ji(i,!1);var t=i[0],e=[];M(i,function(a){e.push(a.x),e.push(a.y)});var n=Hf(e,r,null);return n.unshift(["M",t.x,t.y]),n}function Gh(i,r){return i.x<=r.x&&i.maxX>=r.x&&i.y<=r.y&&i.maxY>r.y}function ve(i){var r=i.parent,t=null;return r&&(t=r.views.filter(function(e){return e!==i})),t}function _x(i,r){var t=i.getCoordinate();return t.invert(r)}function Xo(i,r,t){var e=_x(i,t);return r.getCoordinate().convert(e)}function _f(i,r,t,e){var n=!1;return M(i,function(a){if(a[t]===r[t]&&a[e]===r[e])return n=!0,!1}),n}function Hr(i,r){var t=i.getScaleByField(r);return!t&&i.views&&M(i.views,function(e){if(t=Hr(e,r),t)return!1}),t}var jx=function(){function i(r){this.actions=[],this.event=null,this.cacheMap={},this.view=r}return i.prototype.cache=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];if(r.length===1)return this.cacheMap[r[0]];r.length===2&&(this.cacheMap[r[0]]=r[1])},i.prototype.getAction=function(r){return this.actions.find(function(t){return t.name===r})},i.prototype.addAction=function(r){this.actions.push(r)},i.prototype.removeAction=function(r){var t=this.actions,e=this.actions.indexOf(r);e>=0&&t.splice(e,1)},i.prototype.getCurrentPoint=function(){var r=this.event;if(r)if(r.target instanceof HTMLElement){var t=this.view.getCanvas(),e=t.getPointByClient(r.clientX,r.clientY);return e}else return{x:r.x,y:r.y};return null},i.prototype.getCurrentShape=function(){return T(this.event,["gEvent","shape"])},i.prototype.isInPlot=function(){var r=this.getCurrentPoint();return r?this.view.isPointInPlot(r):!1},i.prototype.isInShape=function(r){var t=this.getCurrentShape();return t?t.get("name")===r:!1},i.prototype.isInComponent=function(r){var t=$f(this.view),e=this.getCurrentPoint();return e?!!t.find(function(n){var a=n.getBBox();return r?n.get("name")===r&&Gh(a,e):Gh(a,e)}):!1},i.prototype.destroy=function(){M(this.actions.slice(),function(r){r.destroy()}),this.view=null,this.event=null,this.actions=null,this.cacheMap=null},i}(),Ux=function(){function i(r,t){this.view=r,this.cfg=t}return i.prototype.init=function(){this.initEvents()},i.prototype.initEvents=function(){},i.prototype.clearEvents=function(){},i.prototype.destroy=function(){this.clearEvents()},i}();function Hh(i,r,t){var e=i.split(":"),n=e[0],a=r.getAction(n)||Fx(n,r);if(!a)throw new Error("There is no action named ".concat(n));var o=e[1];return{action:a,methodName:o,arg:t}}function Vh(i){var r=i.action,t=i.methodName,e=i.arg;if(r[t])r[t](e);else throw new Error("Action(".concat(r.name,") doesn't have a method called ").concat(t))}var Nt={START:"start",SHOW_ENABLE:"showEnable",END:"end",ROLLBACK:"rollback",PROCESSING:"processing"},qx=function(i){E(r,i);function r(t,e){var n=i.call(this,t,e)||this;return n.callbackCaches={},n.emitCaches={},n.steps=e,n}return r.prototype.init=function(){this.initContext(),i.prototype.init.call(this)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.steps=null,this.context&&(this.context.destroy(),this.context=null),this.callbackCaches=null,this.view=null},r.prototype.initEvents=function(){var t=this;M(this.steps,function(e,n){M(e,function(a){var o=t.getActionCallback(n,a);o&&t.bindEvent(a.trigger,o)})})},r.prototype.clearEvents=function(){var t=this;M(this.steps,function(e,n){M(e,function(a){var o=t.getActionCallback(n,a);o&&t.offEvent(a.trigger,o)})})},r.prototype.initContext=function(){var t=this.view,e=new jx(t);this.context=e;var n=this.steps;M(n,function(a){M(a,function(o){if(G(o.action))o.actionObject={action:Ox(o.action,e),methodName:"execute"};else if(N(o.action))o.actionObject=Hh(o.action,e,o.arg);else if(P(o.action)){var s=o.action,l=P(o.arg)?o.arg:[o.arg];o.actionObject=[],M(s,function(h,u){o.actionObject.push(Hh(h,e,l[u]))})}})})},r.prototype.isAllowStep=function(t){var e=this.currentStepName,n=this.steps;if(e===t||t===Nt.SHOW_ENABLE)return!0;if(t===Nt.PROCESSING)return e===Nt.START;if(t===Nt.START)return e!==Nt.PROCESSING;if(t===Nt.END)return e===Nt.PROCESSING||e===Nt.START;if(t===Nt.ROLLBACK){if(n[Nt.END])return e===Nt.END;if(e===Nt.START)return!0}return!1},r.prototype.isAllowExecute=function(t,e){if(this.isAllowStep(t)){var n=this.getKey(t,e);return e.once&&this.emitCaches[n]?!1:e.isEnable?e.isEnable(this.context):!0}return!1},r.prototype.enterStep=function(t){this.currentStepName=t,this.emitCaches={}},r.prototype.afterExecute=function(t,e){t!==Nt.SHOW_ENABLE&&this.currentStepName!==t&&this.enterStep(t);var n=this.getKey(t,e);this.emitCaches[n]=!0},r.prototype.getKey=function(t,e){return t+e.trigger+e.action},r.prototype.getActionCallback=function(t,e){var n=this,a=this.context,o=this.callbackCaches,s=e.actionObject;if(e.action&&s){var l=this.getKey(t,e);if(!o[l]){var h=function(u){a.event=u,n.isAllowExecute(t,e)?(P(s)?M(s,function(c){a.event=u,Vh(c)}):(a.event=u,Vh(s)),n.afterExecute(t,e),e.callback&&(a.event=u,e.callback(a))):a.event=null};e.debounce?o[l]=Wu(h,e.debounce.wait,e.debounce.immediate):e.throttle?o[l]=is(h,e.throttle.wait,{leading:e.throttle.leading,trailing:e.throttle.trailing}):o[l]=h}return o[l]}return null},r.prototype.bindEvent=function(t,e){var n=t.split(":");n[0]==="window"?window.addEventListener(n[1],e):n[0]==="document"?document.addEventListener(n[1],e):this.view.on(t,e)},r.prototype.offEvent=function(t,e){var n=t.split(":");n[0]==="window"?window.removeEventListener(n[1],e):n[0]==="document"?document.removeEventListener(n[1],e):this.view.off(t,e)},r}(Ux),jf={};function Zx(i){return jf[Xr(i)]}function it(i,r){jf[Xr(i)]=r}function Qx(i,r,t){var e=Zx(i);if(!e)return null;if(ce(e)){var n=ot(Xt(e),t);return new qx(r,n)}else{var a=e;return new a(r,t)}}function Kx(i){return{title:{autoRotate:!0,position:"center",spacing:i.axisTitleSpacing,style:{fill:i.axisTitleTextFillColor,fontSize:i.axisTitleTextFontSize,lineHeight:i.axisTitleTextLineHeight,textBaseline:"middle",fontFamily:i.fontFamily},iconStyle:{fill:i.axisDescriptionIconFillColor}},label:{autoRotate:!1,autoEllipsis:!1,autoHide:{type:"equidistance",cfg:{minGap:6}},offset:i.axisLabelOffset,style:{fill:i.axisLabelFillColor,fontSize:i.axisLabelFontSize,lineHeight:i.axisLabelLineHeight,fontFamily:i.fontFamily}},line:{style:{lineWidth:i.axisLineBorder,stroke:i.axisLineBorderColor}},grid:{line:{type:"line",style:{stroke:i.axisGridBorderColor,lineWidth:i.axisGridBorder,lineDash:i.axisGridLineDash}},alignTick:!0,animate:!0},tickLine:{style:{lineWidth:i.axisTickLineBorder,stroke:i.axisTickLineBorderColor},alignTick:!0,length:i.axisTickLineLength},subTickLine:null,animate:!0}}function Jx(i){return{title:null,marker:{symbol:"circle",spacing:i.legendMarkerSpacing,style:{r:i.legendCircleMarkerSize,fill:i.legendMarkerColor}},itemName:{spacing:5,style:{fill:i.legendItemNameFillColor,fontFamily:i.fontFamily,fontSize:i.legendItemNameFontSize,lineHeight:i.legendItemNameLineHeight,fontWeight:i.legendItemNameFontWeight,textAlign:"start",textBaseline:"middle"}},itemStates:{active:{nameStyle:{opacity:.8}},unchecked:{nameStyle:{fill:"#D8D8D8"},markerStyle:{fill:"#D8D8D8",stroke:"#D8D8D8"}},inactive:{nameStyle:{fill:"#D8D8D8"},markerStyle:{opacity:.2}}},flipPage:!0,pageNavigator:{marker:{style:{size:i.legendPageNavigatorMarkerSize,inactiveFill:i.legendPageNavigatorMarkerInactiveFillColor,inactiveOpacity:i.legendPageNavigatorMarkerInactiveFillOpacity,fill:i.legendPageNavigatorMarkerFillColor,opacity:i.legendPageNavigatorMarkerFillOpacity}},text:{style:{fill:i.legendPageNavigatorTextFillColor,fontSize:i.legendPageNavigatorTextFontSize}}},animate:!1,maxItemWidth:200,itemSpacing:i.legendItemSpacing,itemMarginBottom:i.legendItemMarginBottom,padding:i.legendPadding}}function Uf(i){var r,t={point:{default:{fill:i.pointFillColor,r:i.pointSize,stroke:i.pointBorderColor,lineWidth:i.pointBorder,fillOpacity:i.pointFillOpacity},active:{stroke:i.pointActiveBorderColor,lineWidth:i.pointActiveBorder},selected:{stroke:i.pointSelectedBorderColor,lineWidth:i.pointSelectedBorder},inactive:{fillOpacity:i.pointInactiveFillOpacity,strokeOpacity:i.pointInactiveBorderOpacity}},hollowPoint:{default:{fill:i.hollowPointFillColor,lineWidth:i.hollowPointBorder,stroke:i.hollowPointBorderColor,strokeOpacity:i.hollowPointBorderOpacity,r:i.hollowPointSize},active:{stroke:i.hollowPointActiveBorderColor,strokeOpacity:i.hollowPointActiveBorderOpacity},selected:{lineWidth:i.hollowPointSelectedBorder,stroke:i.hollowPointSelectedBorderColor,strokeOpacity:i.hollowPointSelectedBorderOpacity},inactive:{strokeOpacity:i.hollowPointInactiveBorderOpacity}},area:{default:{fill:i.areaFillColor,fillOpacity:i.areaFillOpacity,stroke:null},active:{fillOpacity:i.areaActiveFillOpacity},selected:{fillOpacity:i.areaSelectedFillOpacity},inactive:{fillOpacity:i.areaInactiveFillOpacity}},hollowArea:{default:{fill:null,stroke:i.hollowAreaBorderColor,lineWidth:i.hollowAreaBorder,strokeOpacity:i.hollowAreaBorderOpacity},active:{fill:null,lineWidth:i.hollowAreaActiveBorder},selected:{fill:null,lineWidth:i.hollowAreaSelectedBorder},inactive:{strokeOpacity:i.hollowAreaInactiveBorderOpacity}},interval:{default:{fill:i.intervalFillColor,fillOpacity:i.intervalFillOpacity},active:{stroke:i.intervalActiveBorderColor,lineWidth:i.intervalActiveBorder},selected:{stroke:i.intervalSelectedBorderColor,lineWidth:i.intervalSelectedBorder},inactive:{fillOpacity:i.intervalInactiveFillOpacity,strokeOpacity:i.intervalInactiveBorderOpacity}},hollowInterval:{default:{fill:i.hollowIntervalFillColor,stroke:i.hollowIntervalBorderColor,lineWidth:i.hollowIntervalBorder,strokeOpacity:i.hollowIntervalBorderOpacity},active:{stroke:i.hollowIntervalActiveBorderColor,lineWidth:i.hollowIntervalActiveBorder,strokeOpacity:i.hollowIntervalActiveBorderOpacity},selected:{stroke:i.hollowIntervalSelectedBorderColor,lineWidth:i.hollowIntervalSelectedBorder,strokeOpacity:i.hollowIntervalSelectedBorderOpacity},inactive:{stroke:i.hollowIntervalInactiveBorderColor,lineWidth:i.hollowIntervalInactiveBorder,strokeOpacity:i.hollowIntervalInactiveBorderOpacity}},line:{default:{stroke:i.lineBorderColor,lineWidth:i.lineBorder,strokeOpacity:i.lineBorderOpacity,fill:null,lineAppendWidth:10,lineCap:"round",lineJoin:"round"},active:{lineWidth:i.lineActiveBorder},selected:{lineWidth:i.lineSelectedBorder},inactive:{strokeOpacity:i.lineInactiveBorderOpacity}}},e=Kx(i),n=Jx(i);return{background:i.backgroundColor,defaultColor:i.brandColor,subColor:i.subColor,semanticRed:i.paletteSemanticRed,semanticGreen:i.paletteSemanticGreen,padding:"auto",fontFamily:i.fontFamily,columnWidthRatio:1/2,maxColumnWidth:null,minColumnWidth:null,roseWidthRatio:.9999999,multiplePieWidthRatio:1/1.3,colors10:i.paletteQualitative10,colors20:i.paletteQualitative20,sequenceColors:i.paletteSequence,shapes:{point:["hollow-circle","hollow-square","hollow-bowtie","hollow-diamond","hollow-hexagon","hollow-triangle","hollow-triangle-down","circle","square","bowtie","diamond","hexagon","triangle","triangle-down","cross","tick","plus","hyphen","line"],line:["line","dash","dot","smooth"],area:["area","smooth","line","smooth-line"],interval:["rect","hollow-rect","line","tick"]},sizes:[1,10],geometries:{interval:{rect:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:function(a){var o=a.geometry.coordinate;if(o.isPolar&&o.isTransposed){var s=_n(a.getModel(),o),l=s.startAngle,h=s.endAngle,u=(l+h)/2,c=7.5,f=c*Math.cos(u),v=c*Math.sin(u);return{matrix:ct(null,[["t",f,v]])}}return t.interval.selected}}},"hollow-rect":{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},line:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},tick:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},funnel:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}},pyramid:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},line:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},dot:{default:{style:w(w({},t.line.default),{lineCap:null,lineDash:[1,1]})},active:{style:w(w({},t.line.active),{lineCap:null,lineDash:[1,1]})},inactive:{style:w(w({},t.line.inactive),{lineCap:null,lineDash:[1,1]})},selected:{style:w(w({},t.line.selected),{lineCap:null,lineDash:[1,1]})}},dash:{default:{style:w(w({},t.line.default),{lineCap:null,lineDash:[5.5,1]})},active:{style:w(w({},t.line.active),{lineCap:null,lineDash:[5.5,1]})},inactive:{style:w(w({},t.line.inactive),{lineCap:null,lineDash:[5.5,1]})},selected:{style:w(w({},t.line.selected),{lineCap:null,lineDash:[5.5,1]})}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hvh:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},polygon:{polygon:{default:{style:t.interval.default},active:{style:t.interval.active},inactive:{style:t.interval.inactive},selected:{style:t.interval.selected}}},point:{circle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},square:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},bowtie:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},diamond:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},hexagon:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},triangle:{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"triangle-down":{default:{style:t.point.default},active:{style:t.point.active},inactive:{style:t.point.inactive},selected:{style:t.point.selected}},"hollow-circle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-square":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-bowtie":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-diamond":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-hexagon":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},"hollow-triangle-down":{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},cross:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},tick:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},plus:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},hyphen:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}},line:{default:{style:t.hollowPoint.default},active:{style:t.hollowPoint.active},inactive:{style:t.hollowPoint.inactive},selected:{style:t.hollowPoint.selected}}},area:{area:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},smooth:{default:{style:t.area.default},active:{style:t.area.active},inactive:{style:t.area.inactive},selected:{style:t.area.selected}},line:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"smooth-line":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}},schema:{candle:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}},box:{default:{style:t.hollowInterval.default},active:{style:t.hollowInterval.active},inactive:{style:t.hollowInterval.inactive},selected:{style:t.hollowInterval.selected}}},edge:{line:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},vhv:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},arc:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}}},violin:{violin:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},smooth:{default:{style:t.line.default},active:{style:t.line.active},inactive:{style:t.line.inactive},selected:{style:t.line.selected}},hollow:{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}},"hollow-smooth":{default:{style:t.hollowArea.default},active:{style:t.hollowArea.active},inactive:{style:t.hollowArea.inactive},selected:{style:t.hollowArea.selected}}}},components:{axis:{common:e,top:{position:"top",grid:null,title:null,verticalLimitLength:1/2},bottom:{position:"bottom",grid:null,title:null,verticalLimitLength:1/2},left:{position:"left",title:null,line:null,tickLine:null,verticalLimitLength:1/3},right:{position:"right",title:null,line:null,tickLine:null,verticalLimitLength:1/3},circle:{title:null,grid:D({},e.grid,{line:{type:"line"}})},radius:{title:null,grid:D({},e.grid,{line:{type:"circle"}})}},legend:{common:n,right:{layout:"vertical",padding:i.legendVerticalPadding},left:{layout:"vertical",padding:i.legendVerticalPadding},top:{layout:"horizontal",padding:i.legendHorizontalPadding},bottom:{layout:"horizontal",padding:i.legendHorizontalPadding},continuous:{title:null,background:null,track:{},rail:{type:"color",size:i.sliderRailHeight,defaultLength:i.sliderRailWidth,style:{fill:i.sliderRailFillColor,stroke:i.sliderRailBorderColor,lineWidth:i.sliderRailBorder}},label:{align:"rail",spacing:4,formatter:null,style:{fill:i.sliderLabelTextFillColor,fontSize:i.sliderLabelTextFontSize,lineHeight:i.sliderLabelTextLineHeight,textBaseline:"middle",fontFamily:i.fontFamily}},handler:{size:i.sliderHandlerWidth,style:{fill:i.sliderHandlerFillColor,stroke:i.sliderHandlerBorderColor}},slidable:!0,padding:n.padding}},tooltip:{showContent:!0,follow:!0,showCrosshairs:!1,showMarkers:!0,shared:!1,enterable:!1,position:"auto",marker:{symbol:"circle",stroke:"#fff",shadowBlur:10,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"rgba(0,0,0,0.09)",lineWidth:2,r:4},crosshairs:{line:{style:{stroke:i.tooltipCrosshairsBorderColor,lineWidth:i.tooltipCrosshairsBorder}},text:null,textBackground:{padding:2,style:{fill:"rgba(0, 0, 0, 0.25)",lineWidth:0,stroke:null}},follow:!1},domStyles:(r={},r["".concat(Se)]={position:"absolute",visibility:"hidden",zIndex:8,transition:"left 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s, top 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0s",backgroundColor:i.tooltipContainerFillColor,opacity:i.tooltipContainerFillOpacity,boxShadow:i.tooltipContainerShadow,borderRadius:"".concat(i.tooltipContainerBorderRadius,"px"),color:i.tooltipTextFillColor,fontSize:"".concat(i.tooltipTextFontSize,"px"),fontFamily:i.fontFamily,lineHeight:"".concat(i.tooltipTextLineHeight,"px"),padding:"0 12px 0 12px"},r["".concat(be)]={marginBottom:"12px",marginTop:"12px"},r["".concat(Oi)]={margin:0,listStyleType:"none",padding:0},r["".concat(Aa)]={listStyleType:"none",padding:0,marginBottom:"12px",marginTop:"12px",marginLeft:0,marginRight:0},r["".concat(Ta)]={width:"8px",height:"8px",borderRadius:"50%",display:"inline-block",marginRight:"8px"},r["".concat(La)]={display:"inline-block",float:"right",marginLeft:"30px"},r)},annotation:{arc:{style:{stroke:i.annotationArcBorderColor,lineWidth:i.annotationArcBorder},animate:!0},line:{style:{stroke:i.annotationLineBorderColor,lineDash:i.annotationLineDash,lineWidth:i.annotationLineBorder},text:{position:"start",autoRotate:!0,style:{fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,textAlign:"start",fontFamily:i.fontFamily,textBaseline:"bottom"}},animate:!0},text:{style:{fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,textBaseline:"middle",textAlign:"start",fontFamily:i.fontFamily},animate:!0},region:{top:!1,style:{lineWidth:i.annotationRegionBorder,stroke:i.annotationRegionBorderColor,fill:i.annotationRegionFillColor,fillOpacity:i.annotationRegionFillOpacity},animate:!0},image:{top:!1,animate:!0},dataMarker:{top:!0,point:{style:{r:3,stroke:i.brandColor,lineWidth:2}},line:{style:{stroke:i.annotationLineBorderColor,lineWidth:i.annotationLineBorder},length:i.annotationDataMarkerLineLength},text:{style:{textAlign:"start",fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,fontFamily:i.fontFamily}},direction:"upward",autoAdjust:!0,animate:!0},dataRegion:{style:{region:{fill:i.annotationRegionFillColor,fillOpacity:i.annotationRegionFillOpacity},text:{textAlign:"center",textBaseline:"bottom",fill:i.annotationTextFillColor,stroke:i.annotationTextBorderColor,lineWidth:i.annotationTextBorder,fontSize:i.annotationTextFontSize,fontFamily:i.fontFamily}},animate:!0}},slider:{common:{padding:[8,8,8,8],backgroundStyle:{fill:i.cSliderBackgroundFillColor,opacity:i.cSliderBackgroundFillOpacity},foregroundStyle:{fill:i.cSliderForegroundFillColor,opacity:i.cSliderForegroundFillOpacity},handlerStyle:{width:i.cSliderHandlerWidth,height:i.cSliderHandlerHeight,fill:i.cSliderHandlerFillColor,opacity:i.cSliderHandlerFillOpacity,stroke:i.cSliderHandlerBorderColor,lineWidth:i.cSliderHandlerBorder,radius:i.cSliderHandlerBorderRadius,highLightFill:i.cSliderHandlerHighlightFillColor},textStyle:{fill:i.cSliderTextFillColor,opacity:i.cSliderTextFillOpacity,fontSize:i.cSliderTextFontSize,lineHeight:i.cSliderTextLineHeight,fontWeight:i.cSliderTextFontWeight,stroke:i.cSliderTextBorderColor,lineWidth:i.cSliderTextBorder}}},scrollbar:{common:{padding:[8,8,8,8]},default:{style:{trackColor:i.scrollbarTrackFillColor,thumbColor:i.scrollbarThumbFillColor}},hover:{style:{thumbColor:i.scrollbarThumbHighlightFillColor}}}},labels:{offset:12,style:{fill:i.labelFillColor,fontSize:i.labelFontSize,fontFamily:i.fontFamily,stroke:i.labelBorderColor,lineWidth:i.labelBorder},fillColorDark:i.labelFillColorDark,fillColorLight:i.labelFillColorLight,autoRotate:!0},innerLabels:{style:{fill:i.innerLabelFillColor,fontSize:i.innerLabelFontSize,fontFamily:i.fontFamily,stroke:i.innerLabelBorderColor,lineWidth:i.innerLabelBorder},autoRotate:!0},overflowLabels:{style:{fill:i.overflowLabelFillColor,fontSize:i.overflowLabelFontSize,fontFamily:i.fontFamily,stroke:i.overflowLabelBorderColor,lineWidth:i.overflowLabelBorder}},pieLabels:{labelHeight:14,offset:10,labelLine:{style:{lineWidth:i.labelLineBorder}},autoRotate:!0}}}var j={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},wr={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},tw=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],ew=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],rw=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],qf=function(i){i===void 0&&(i={});var r=i.paletteQualitative10,t=r===void 0?tw:r,e=i.paletteQualitative20,n=e===void 0?ew:e,a=i.brandColor,o=a===void 0?t[0]:a,s={backgroundColor:"transparent",brandColor:o,subColor:"rgba(0,0,0,0.05)",paletteQualitative10:t,paletteQualitative20:n,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:rw,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial,
"Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"`,axisLineBorderColor:j[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:j[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:wr[85],axisTickLineBorderColor:j[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:j[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:j[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:j[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:j[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:o,legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:j[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:j[100],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:j[100],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:j[45],legendPageNavigatorTextFontSize:12,sliderRailFillColor:j[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:j[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:j[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:j[25],annotationArcBorderColor:j[15],annotationArcBorder:1,annotationLineBorderColor:j[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:j[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:j[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:j[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"rgb(255, 255, 255)",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 0px 10px #aeaeae",tooltipContainerBorderRadius:3,tooltipTextFillColor:j[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:j[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:wr[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:j[65],overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:wr[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:j[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#000",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(0,0,0,0)",scrollbarThumbFillColor:"rgba(0,0,0,0.15)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.2)",pointFillColor:o,pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:wr[100],pointBorderOpacity:1,pointActiveBorderColor:j[100],pointSelectedBorder:2,pointSelectedBorderColor:j[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:o,hollowPointBorderOpacity:.95,hollowPointFillColor:wr[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:j[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:j[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:o,lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:o,areaFillOpacity:.25,areaActiveFillColor:o,areaActiveFillOpacity:.5,areaSelectedFillColor:o,areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:o,hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:j[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:j[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:o,intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:j[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:j[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:o,hollowIntervalBorderOpacity:1,hollowIntervalFillColor:wr[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:j[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:j[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return w(w({},s),i)};qf();function qn(i){var r=i.styleSheet,t=r===void 0?{}:r,e=mt(i,["styleSheet"]),n=qf(t);return D({},Uf(n),e)}var iw=qn({}),zo={default:iw};function ro(i){return T(zo,Xr(i),zo.default)}function nw(i,r){zo[Xr(i)]=qn(r)}function Nh(i,r,t){var e=t.translate(i),n=t.translate(r);return xt(e,n)}function aw(i,r){var t=r.coordinate,e=r.getXScale(),n=e.range,a=n[n.length-1],o=n[0],s=t.invert(i),l=s.x;return t.isPolar&&l>(1+a)/2&&(l=o),e.translate(e.invert(l))}function Xh(i,r,t){var e=t.coordinate,n=t.getYScale(),a=n.field,o=e.invert(r),s=n.invert(o.y),l=Ce(i,function(h){var u=h[Z];return u[a][0]<=s&&u[a][1]>=s});return l||i[i.length-1]}var ow=ia(function(i){if(i.isCategory)return 1;for(var r=i.values,t=r.length,e=i.translate(r[0]),n=e,a=0;a<t;a++){var o=r[a],s=i.translate(o);s<e&&(e=s),s>n&&(n=s)}return(n-e)/(t-1)});function sw(i,r,t){var e=r.getAttribute("position"),n=e.getFields(),a=r.scales,o=G(t)||!t?n[0]:t,s=a[o],l=s?s.getText(i[o]):i[o]||o;return G(t)?t(l,i):l}function lw(i){var r=es(i.attributes);return Qt(r,function(t){return rr(Ar,t.type)})}function Zf(i){var r,t,e=lw(i),n;try{for(var a=$(e),o=a.next();!o.done;o=a.next()){var s=o.value,l=s.getScale(s.type);if(l&&l.isLinear){var h=T(i.scaleDefs,l.field),u=Ff(l,h,s.type,i.type);if(u!=="cat"){n=l;break}}}}catch(v){r={error:v}}finally{try{o&&!o.done&&(t=a.return)&&t.call(a)}finally{if(r)throw r.error}}var c=i.getXScale(),f=i.getYScale();return n||f||c}function hw(i,r){var t=r.field,e=i[t];if(P(e)){var n=e.map(function(a){return r.getText(a)});return n.join("-")}return r.getText(e)}function uw(i,r){var t,e=r.getGroupScales();if(e.length&&(t=e[0]),t){var n=t.field;return t.getText(i[n])}var a=Zf(r);return Di(a)}function Qf(i,r,t){if(r.length===0)return null;var e=t.type,n=t.getXScale(),a=t.getYScale(),o=n.field,s=a.field,l=null;if(e==="heatmap"||e==="point"){for(var h=t.coordinate,u=h.invert(i),c=n.invert(u.x),f=a.invert(u.y),v=1/0,p=0;p<r.length;p++){var g=r[p],d=g[Z],y=Math.pow(d[o]-c,2)+Math.pow(d[s]-f,2);y<v&&(v=y,l=g)}return l}var C=r[0],m=r[r.length-1],x=aw(i,t),S=C[Z][o],b=C[Z][s],A=m[Z][o],L=a.isLinear&&P(b);if(P(S)){for(var p=0;p<r.length;p++){var k=r[p],d=k[Z];if(n.translate(d[o][0])<=x&&n.translate(d[o][1])>=x)if(L)P(l)||(l=[]),l.push(k);else{l=k;break}}P(l)&&(l=Xh(l,i,t))}else{var B=void 0;if(!n.isLinear&&n.type!=="timeCat"){for(var p=0;p<r.length;p++){var k=r[p],d=k[Z];if(Nh(d[o],x,n))if(L)P(l)||(l=[]),l.push(k);else{l=k;break}else n.translate(d[o])<=x&&(m=k,B=r[p+1])}P(l)&&(l=Xh(l,i,t))}else{if((x>n.translate(A)||x<n.translate(S))&&(x>n.max||x<n.min))return null;for(var O=0,R=r.length-1,H=void 0;O<=R;){H=Math.floor((O+R)/2);var z=r[H][Z][o];if(Nh(z,x,n))return r[H];n.translate(z)<=n.translate(x)?(O=H+1,m=r[H],B=r[H+1]):(R===0&&(m=r[0]),R=H-1)}}m&&B&&Math.abs(n.translate(m[Z][o])-x)>Math.abs(n.translate(B[Z][o])-x)&&(m=B)}var _=ow(t.getXScale());return!l&&Math.abs(n.translate(m[Z][o])-x)<=_/2&&(l=m),l}function Kf(i,r,t,e){var n,a;t===void 0&&(t=""),e===void 0&&(e=!1);var o=i[Z],s=sw(o,r,t),l=r.tooltipOption,h=r.theme.defaultColor,u=[],c,f;function v(k,B){if(e||!I(B)&&B!==""){var O={title:s,data:o,mappingData:i,name:k,value:B,color:i.color||h,marker:!0};u.push(O)}}if(rt(l)){var p=l.fields,g=l.callback;if(g){var d=p.map(function(k){return i[Z][k]}),y=g.apply(void 0,et([],Y(d),!1)),C=w({data:i[Z],mappingData:i,title:s,color:i.color||h,marker:!0},y);u.push(C)}else{var m=r.scales;try{for(var x=$(p),S=x.next();!S.done;S=x.next()){var b=S.value;if(!I(o[b])){var A=m[b];c=Di(A),f=A.getText(o[b]),v(c,f)}}}catch(k){n={error:k}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(n)throw n.error}}}}else{var L=Zf(r);f=hw(o,L),c=uw(o,r),v(c,f)}return u}function zh(i,r,t,e){var n,a,o=e.showNil,s=[],l=i.dataArray;if(!pe(l)){i.sort(l);try{for(var h=$(l),u=h.next();!u.done;u=h.next()){var c=u.value,f=Qf(r,c,i);if(f){var v=i.getElementId(f),p=i.elementsMap[v];if(i.type==="heatmap"||p.visible){var g=Kf(f,i,t,o);g.length&&s.push(g)}}}}catch(d){n={error:d}}finally{try{u&&!u.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}}return s}function Wh(i,r,t,e){var n=e.showNil,a=[],o=i.container,s=o.getShape(r.x,r.y);if(s&&s.get("visible")&&s.get("origin")){var l=s.get("origin").mappingData,h=Kf(l,i,t,n);h.length&&a.push(h)}return a}function Wo(i,r,t){var e,n,a=[],o=i.geometries,s=t.shared,l=t.title,h=t.reversed;try{for(var u=$(o),c=u.next();!c.done;c=u.next()){var f=c.value;if(f.visible&&f.tooltipOption!==!1){var v=f.type,p=void 0;["point","edge","polygon"].includes(v)?p=Wh(f,r,l,t):["area","line","path","heatmap"].includes(v)||s!==!1?p=zh(f,r,l,t):p=Wh(f,r,l,t),p.length&&(h&&p.reverse(),a.push(p))}}}catch(g){e={error:g}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return a}function cw(i,r,t){var e,n,a=Wo(i,r,t);try{for(var o=$(i.views),s=o.next();!s.done;s=o.next()){var l=s.value;a=a.concat(Wo(l,r,t))}}catch(h){e={error:h}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return a}function fw(i){return!U(i)&&!P(i)}function Is(i){i===void 0&&(i=0);var r=P(i)?i:[i];switch(r.length){case 0:r=[0,0,0,0];break;case 1:r=new Array(4).fill(r[0]);break;case 2:r=et(et([],Y(r),!1),Y(r),!1);break;case 3:r=et(et([],Y(r),!1),[r[1]],!1);break;default:r=r.slice(0,4);break}return r}var Ps={};function _r(i,r){Ps[i]=r}function vw(){return Object.keys(Ps)}function pw(i){return Ps[i]}var gw=function(){function i(r){this.option=this.wrapperOption(r)}return i.prototype.update=function(r){return this.option=this.wrapperOption(r),this},i.prototype.hasAction=function(r){var t=this.option.actions;return ea(t,function(e){return e[0]===r})},i.prototype.create=function(r,t){var e=this.option,n=e.type,a=e.cfg,o=n==="theta",s=w({start:r,end:t},a),l=Nm(o?"polar":n);return this.coordinate=new l(s),this.coordinate.type=n,o&&(this.hasAction("transpose")||this.transpose()),this.execActions(),this.coordinate},i.prototype.adjust=function(r,t){return this.coordinate.update({start:r,end:t}),this.coordinate.resetMatrix(),this.execActions(["scale","rotate","translate"]),this.coordinate},i.prototype.rotate=function(r){return this.option.actions.push(["rotate",r]),this},i.prototype.reflect=function(r){return this.option.actions.push(["reflect",r]),this},i.prototype.scale=function(r,t){return this.option.actions.push(["scale",r,t]),this},i.prototype.transpose=function(){return this.option.actions.push(["transpose"]),this},i.prototype.getOption=function(){return this.option},i.prototype.getCoordinate=function(){return this.coordinate},i.prototype.wrapperOption=function(r){return w({type:"rect",actions:[],cfg:{}},r)},i.prototype.execActions=function(r){var t=this,e=this.option.actions;M(e,function(n){var a,o=Y(n),s=o[0],l=o.slice(1),h=I(r)?!0:r.includes(s);h&&(a=t.coordinate)[s].apply(a,et([],Y(l),!1))})},i}(),At=function(){function i(r,t,e){this.view=r,this.gEvent=t,this.data=e,this.type=t.type}return i.fromData=function(r,t,e){return new i(r,new Ni(t,{}),e)},Object.defineProperty(i.prototype,"target",{get:function(){return this.gEvent.target},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"event",{get:function(){return this.gEvent.originalEvent},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this.gEvent.x},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"y",{get:function(){return this.gEvent.y},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clientX",{get:function(){return this.gEvent.clientX},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clientY",{get:function(){return this.gEvent.clientY},enumerable:!1,configurable:!0}),i.prototype.toString=function(){return"[Event (type=".concat(this.type,")]")},i.prototype.clone=function(){return new i(this.view,this.gEvent,this.data)},i}();function dw(i){var r=i.getController("axis"),t=i.getController("legend"),e=i.getController("annotation"),n=i.getController("slider"),a=i.getController("scrollbar");[r,n,a,t,e].forEach(function(o){o&&o.layout()})}var yw=function(){function i(){this.scales=new Map,this.syncScales=new Map}return i.prototype.createScale=function(r,t,e,n){var a=e,o=this.getScaleMeta(n);if(t.length===0&&o){var s=o.scale,l={type:s.type};s.isCategory&&(l.values=s.values),a=D(l,o.scaleDef,e)}var h=Tx(r,t,a);return this.cacheScale(h,e,n),h},i.prototype.sync=function(r,t){var e=this;this.syncScales.forEach(function(n,a){var o=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,l=[];M(n,function(h){var u=e.getScale(h);s=U(u.max)?Math.max(s,u.max):s,o=U(u.min)?Math.min(o,u.min):o,M(u.values,function(c){l.includes(c)||l.push(c)})}),M(n,function(h){var u=e.getScale(h);if(u.isContinuous)u.change({min:o,max:s,values:l});else if(u.isCategory){var c=u.range,f=e.getScaleMeta(h);l&&!T(f,["scaleDef","range"])&&(c=Of(D({},u,{values:l}),r,t)),u.change({values:l,range:c})}})})},i.prototype.cacheScale=function(r,t,e){var n=this.getScaleMeta(e);n&&n.scale.type===r.type?(Lx(n.scale,r),n.scaleDef=t):(n={key:e,scale:r,scaleDef:t},this.scales.set(e,n));var a=this.getSyncKey(n);if(n.syncKey=a,this.removeFromSyncScales(e),a){var o=this.syncScales.get(a);o||(o=[],this.syncScales.set(a,o)),o.push(e)}},i.prototype.getScale=function(r){var t=this.getScaleMeta(r);if(!t){var e=Ct(r.split("-")),n=this.syncScales.get(e);n&&n.length&&(t=this.getScaleMeta(n[0]))}return t&&t.scale},i.prototype.deleteScale=function(r){var t=this.getScaleMeta(r);if(t){var e=t.syncKey,n=this.syncScales.get(e);if(n&&n.length){var a=n.indexOf(r);a!==-1&&n.splice(a,1)}}this.scales.delete(r)},i.prototype.clear=function(){this.scales.clear(),this.syncScales.clear()},i.prototype.removeFromSyncScales=function(r){var t=this;this.syncScales.forEach(function(e,n){var a=e.indexOf(r);if(a!==-1)return e.splice(a,1),e.length===0&&t.syncScales.delete(n),!1})},i.prototype.getSyncKey=function(r){var t=r.scale,e=r.scaleDef,n=t.field,a=T(e,["sync"]);return a===!0?n:a===!1?void 0:a},i.prototype.getScaleMeta=function(r){return this.scales.get(r)},i}(),In=function(){function i(r,t,e,n){r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),this.top=r,this.right=t,this.bottom=e,this.left=n}return i.instance=function(r,t,e,n){return r===void 0&&(r=0),t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=0),new i(r,t,e,n)},i.prototype.max=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return this.top=Math.max(this.top,e),this.right=Math.max(this.right,n),this.bottom=Math.max(this.bottom,a),this.left=Math.max(this.left,o),this},i.prototype.shrink=function(r){var t=Y(r,4),e=t[0],n=t[1],a=t[2],o=t[3];return this.top+=e,this.right+=n,this.bottom+=a,this.left+=o,this},i.prototype.inc=function(r,t){var e=r.width,n=r.height;switch(t){case F.TOP:case F.TOP_LEFT:case F.TOP_RIGHT:this.top+=n;break;case F.RIGHT:case F.RIGHT_TOP:case F.RIGHT_BOTTOM:this.right+=e;break;case F.BOTTOM:case F.BOTTOM_LEFT:case F.BOTTOM_RIGHT:this.bottom+=n;break;case F.LEFT:case F.LEFT_TOP:case F.LEFT_BOTTOM:this.left+=e;break}return this},i.prototype.getPadding=function(){return[this.top,this.right,this.bottom,this.left]},i.prototype.clone=function(){return new(i.bind.apply(i,et([void 0],Y(this.getPadding()),!1)))},i}();function mw(i){var r=i.padding;if(!fw(r))return new(In.bind.apply(In,et([void 0],Y(Is(r)),!1)));var t=i.viewBBox,e=new In,n=[],a=[],o=[];return M(i.getComponents(),function(s){var l=s.type;l===dt.AXIS?n.push(s):[dt.LEGEND,dt.SLIDER,dt.SCROLLBAR].includes(l)?a.push(s):l!==dt.GRID&&l!==dt.TOOLTIP&&o.push(s)}),M(n,function(s){var l=s.component,h=l.getLayoutBBox(),u=new Bt(h.x,h.y,h.width,h.height),c=u.exceed(t);e.max(c)}),M(a,function(s){var l=s.component,h=s.direction,u=l.getLayoutBBox(),c=l.get("padding"),f=new Bt(u.x,u.y,u.width,u.height).expand(c);e.inc(f,h)}),M(o,function(s){var l=s.component,h=s.direction,u=l.getLayoutBBox(),c=new Bt(u.x,u.y,u.width,u.height);e.inc(c,h)}),e}function xw(i,r,t){var e=t.instance();r.forEach(function(n){n.autoPadding=e.max(n.autoPadding.getPadding())})}var Jf=function(i){E(r,i);function r(t){var e=i.call(this,{visible:t.visible})||this;e.views=[],e.geometries=[],e.controllers=[],e.interactions={},e.limitInPlot=!1,e.options={data:[],animate:!0},e.usedControllers=vw(),e.scalePool=new yw,e.layoutFunc=dw,e.isPreMouseInPlot=!1,e.isDataChanged=!1,e.isCoordinateChanged=!1,e.createdScaleKeys=new Map,e.onCanvasEvent=function(m){var x=m.name;if(!x.includes(":")){var S=e.createViewEvent(m);e.doPlotEvent(S),e.emit(x,S)}},e.onDelegateEvents=function(m){var x=m.name;if(!!x.includes(":")){var S=e.createViewEvent(m);e.emit(x,S)}};var n=t.id,a=n===void 0?qe("view"):n,o=t.parent,s=t.canvas,l=t.backgroundGroup,h=t.middleGroup,u=t.foregroundGroup,c=t.region,f=c===void 0?{start:{x:0,y:0},end:{x:1,y:1}}:c,v=t.padding,p=t.appendPadding,g=t.theme,d=t.options,y=t.limitInPlot,C=t.syncViewPadding;return e.parent=o,e.canvas=s,e.backgroundGroup=l,e.middleGroup=h,e.foregroundGroup=u,e.region=f,e.padding=v,e.appendPadding=p,e.options=w(w({},e.options),d),e.limitInPlot=y,e.id=a,e.syncViewPadding=C,e.themeObject=rt(g)?D({},ro("default"),qn(g)):ro(g),e.init(),e}return r.prototype.setLayout=function(t){this.layoutFunc=t},r.prototype.init=function(){this.calculateViewBBox(),this.initEvents(),this.initComponentController(),this.initOptions()},r.prototype.render=function(t,e){t===void 0&&(t=!1),this.emit(tt.BEFORE_RENDER,At.fromData(this,tt.BEFORE_RENDER,e)),this.paint(t),this.emit(tt.AFTER_RENDER,At.fromData(this,tt.AFTER_RENDER,e)),this.visible===!1&&this.changeVisible(!1)},r.prototype.clear=function(){var t=this;this.emit(tt.BEFORE_CLEAR),this.filteredData=[],this.coordinateInstance=void 0,this.isDataChanged=!1,this.isCoordinateChanged=!1;for(var e=this.geometries,n=0;n<e.length;n++)e[n].clear(),e[n].container.remove(!0),e[n].labelsContainer.remove(!0);this.geometries=[];for(var a=this.controllers,n=0;n<a.length;n++)a[n].name==="annotation"?a[n].clear(!0):a[n].clear();this.createdScaleKeys.forEach(function(s,l){t.getRootView().scalePool.deleteScale(l)}),this.createdScaleKeys.clear();for(var o=this.views,n=0;n<o.length;n++)o[n].clear();this.emit(tt.AFTER_CLEAR)},r.prototype.destroy=function(){this.emit(tt.BEFORE_DESTROY);var t=this.interactions;M(t,function(s){s&&s.destroy()}),this.clear();for(var e=this.controllers,n=0,a=e.length;n<a;n++){var o=e[n];o.destroy()}this.backgroundGroup.remove(!0),this.middleGroup.remove(!0),this.foregroundGroup.remove(!0),i.prototype.destroy.call(this)},r.prototype.changeVisible=function(t){i.prototype.changeVisible.call(this,t);for(var e=this.geometries,n=0,a=e.length;n<a;n++){var o=e[n];o.changeVisible(t)}for(var s=this.controllers,n=0,a=s.length;n<a;n++){var l=s[n];l.changeVisible(t)}return this.foregroundGroup.set("visible",t),this.middleGroup.set("visible",t),this.backgroundGroup.set("visible",t),this.getCanvas().draw(),this},r.prototype.data=function(t){return pt(this.options,"data",t),this.isDataChanged=!0,this},r.prototype.source=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.data() instead."),this.data(t)},r.prototype.filter=function(t,e){return G(e)?(pt(this.options,["filters",t],e),this):(!e&&T(this.options,["filters",t])&&delete this.options.filters[t],this)},r.prototype.axis=function(t,e){return Mi(t)?pt(this.options,["axes"],t):pt(this.options,["axes",t],e),this},r.prototype.legend=function(t,e){return Mi(t)?pt(this.options,["legends"],t):N(t)?(pt(this.options,["legends",t],e),ce(e)&&(e==null?void 0:e.selected)&&pt(this.options,["filters",t],function(n){var a;return(a=e==null?void 0:e.selected[n])!==null&&a!==void 0?a:!0})):pt(this.options,["legends"],t),this},r.prototype.scale=function(t,e){var n=this;return N(t)?pt(this.options,["scales",t],e):rt(t)&&M(t,function(a,o){pt(n.options,["scales",o],a)}),this},r.prototype.tooltip=function(t){return pt(this.options,"tooltip",t),this},r.prototype.annotation=function(){return this.getController("annotation")},r.prototype.guide=function(){return console.warn("This method will be removed at G2 V4.1. Please use chart.annotation() instead."),this.annotation()},r.prototype.coordinate=function(t,e){return N(t)?pt(this.options,"coordinate",{type:t,cfg:e}):pt(this.options,"coordinate",t),this.coordinateController.update(this.options.coordinate),this.coordinateController},r.prototype.coord=function(t,e){return console.warn("This method will be removed at G2 V4.1. Please use chart.coordinate() instead."),this.coordinate(t,e)},r.prototype.facet=function(t,e){this.facetInstance&&this.facetInstance.destroy();var n=Ix(t);if(!n)throw new Error("facet '".concat(t,"' is not exist!"));return this.facetInstance=new n(this,w(w({},e),{type:t})),this},r.prototype.animate=function(t){return pt(this.options,"animate",t),this},r.prototype.updateOptions=function(t){return this.clear(),ot(this.options,t),this.views.forEach(function(e){return e.destroy()}),this.views=[],this.initOptions(),this.coordinateBBox=this.viewBBox,this},r.prototype.option=function(t,e){if(r.prototype[t])throw new Error(`Can't use built in variable name "`.concat(t,'", please change another one.'));return pt(this.options,t,e),this},r.prototype.theme=function(t){return this.themeObject=rt(t)?D({},this.themeObject,qn(t)):ro(t),this},r.prototype.interaction=function(t,e){var n=this.interactions[t];n&&n.destroy();var a=Qx(t,this,e);return a&&(a.init(),this.interactions[t]=a),this},r.prototype.removeInteraction=function(t){var e=this.interactions[t];e&&(e.destroy(),this.interactions[t]=void 0)},r.prototype.changeData=function(t){this.isDataChanged=!0,this.emit(tt.BEFORE_CHANGE_DATA,At.fromData(this,tt.BEFORE_CHANGE_DATA,null)),this.data(t),this.paint(!0);for(var e=this.views,n=0,a=e.length;n<a;n++){var o=e[n];o.changeData(t)}this.emit(tt.AFTER_CHANGE_DATA,At.fromData(this,tt.AFTER_CHANGE_DATA,null))},r.prototype.createView=function(t){this.parent&&this.parent.parent&&console.warn("The view nesting recursive feature will be removed at G2 V4.1. Please avoid to use it.");var e={data:this.options.data,scales:Xt(this.options.scales),axes:Xt(this.options.axes),coordinate:Xt(this.coordinateController.getOption()),tooltip:Xt(this.options.tooltip),legends:Xt(this.options.legends),animate:this.options.animate,visible:this.visible},n=new r(w(w({parent:this,canvas:this.canvas,backgroundGroup:this.backgroundGroup.addGroup({zIndex:Br.BG}),middleGroup:this.middleGroup.addGroup({zIndex:Br.MID}),foregroundGroup:this.foregroundGroup.addGroup({zIndex:Br.FORE}),theme:this.themeObject,padding:this.padding},t),{options:w(w({},e),T(t,"options",{}))}));return this.views.push(n),n},r.prototype.view=function(t){return console.warn("This method will be removed at G2 V4.1. Please use chart.createView() instead."),this.createView(t)},r.prototype.removeView=function(t){var e=lp(this.views,function(n){return n===t})[0];return e&&e.destroy(),e},r.prototype.getCoordinate=function(){return this.coordinateInstance},r.prototype.getTheme=function(){return this.themeObject},r.prototype.getXScale=function(){var t=this.geometries[0];return t?t.getXScale():null},r.prototype.getYScales=function(){var t={},e=[];return this.geometries.forEach(function(n){var a=n.getYScale(),o=a.field;t[o]||(t[o]=!0,e.push(a))}),e},r.prototype.getScalesByDim=function(t){for(var e=this.geometries,n={},a=0,o=e.length;a<o;a++){var s=e[a],l=t==="x"?s.getXScale():s.getYScale();l&&!n[l.field]&&(n[l.field]=l)}return n},r.prototype.getScale=function(t,e){var n=e||this.getScaleKey(t);return this.getRootView().scalePool.getScale(n)},r.prototype.getScaleByField=function(t,e){return this.getScale(t,e)},r.prototype.getOptions=function(){return this.options},r.prototype.getData=function(){return this.filteredData},r.prototype.getOriginalData=function(){return this.options.data},r.prototype.getPadding=function(){return this.autoPadding.getPadding()},r.prototype.getGeometries=function(){return this.geometries},r.prototype.getElements=function(){return Gu(this.geometries,function(t,e){return t.concat(e.getElements())},[])},r.prototype.getElementsBy=function(t){return this.getElements().filter(function(e){return t(e)})},r.prototype.getLayer=function(t){return t===st.BG?this.backgroundGroup:t===st.MID?this.middleGroup:t===st.FORE?this.foregroundGroup:this.foregroundGroup},r.prototype.isPointInPlot=function(t){return Mx(this.getCoordinate(),t)},r.prototype.getLegendAttributes=function(){return $t(this.geometries.map(function(t){return t.getGroupAttributes()}))},r.prototype.getGroupScales=function(){var t=this.geometries.map(function(e){return e.getGroupScales()});return Re($t(t))},r.prototype.getCanvas=function(){return this.getRootView().canvas},r.prototype.getRootView=function(){for(var t=this;;){if(t.parent){t=t.parent;continue}break}return t},r.prototype.getXY=function(t){var e=this.getCoordinate(),n=this.getScalesByDim("x"),a=this.getScalesByDim("y"),o,s;if(M(t,function(l,h){n[h]&&(o=n[h].scale(l)),a[h]&&(s=a[h].scale(l))}),!I(o)&&!I(s))return e.convert({x:o,y:s})},r.prototype.getController=function(t){return Ce(this.controllers,function(e){return e.name===t})},r.prototype.showTooltip=function(t){var e=this.getController("tooltip");return e&&e.showTooltip(t),this},r.prototype.hideTooltip=function(){var t=this.getController("tooltip");return t&&t.hideTooltip(),this},r.prototype.lockTooltip=function(){var t=this.getController("tooltip");return t&&t.lockTooltip(),this},r.prototype.unlockTooltip=function(){var t=this.getController("tooltip");return t&&t.unlockTooltip(),this},r.prototype.isTooltipLocked=function(){var t=this.getController("tooltip");return t&&t.isTooltipLocked()},r.prototype.getTooltipItems=function(t){var e=this.getController("tooltip");return e?e.getTooltipItems(t):[]},r.prototype.getSnapRecords=function(t){for(var e=this.geometries,n=[],a=0,o=e.length;a<o;a++){var s=e[a],l=s.dataArray;s.sort(l);for(var h=void 0,u=0,c=l.length;u<c;u++){var f=l[u];h=Qf(t,f,s),h&&n.push(h)}}for(var v=this.views,a=0,o=v.length;a<o;a++){var p=v[a],g=p.getSnapRecords(t);n=n.concat(g)}return n},r.prototype.getComponents=function(){for(var t=[],e=this.controllers,n=0,a=e.length;n<a;n++){var o=e[n];t=t.concat(o.getComponents())}return t},r.prototype.filterData=function(t){var e=this.options.filters;return Gt(e)===0?t:Qt(t,function(n,a){var o=Object.keys(e);return o.every(function(s){var l=e[s];return l(n[s],n,a)})})},r.prototype.filterFieldData=function(t,e){var n=this.options.filters,a=T(n,t);return br(a)?e:e.filter(function(o,s){return a(o[t],o,s)})},r.prototype.adjustCoordinate=function(){var t=this.getCoordinate(),e=t.start,n=t.end,a=this.coordinateBBox.bl,o=this.coordinateBBox.tr;if(gt(e,a)&&gt(n,o)){this.isCoordinateChanged=!1;return}this.isCoordinateChanged=!0,this.coordinateInstance=this.coordinateController.adjust(a,o)},r.prototype.paint=function(t){this.renderDataRecursive(t),this.syncScale(),this.emit(tt.BEFORE_PAINT),this.renderPaddingRecursive(t),this.renderLayoutRecursive(t),this.renderBackgroundStyleShape(),this.renderPaintRecursive(t),this.emit(tt.AFTER_PAINT),this.isDataChanged=!1},r.prototype.renderBackgroundStyleShape=function(){if(!this.parent){var t=T(this.themeObject,"background");if(t){this.backgroundStyleRectShape||(this.backgroundStyleRectShape=this.backgroundGroup.addShape("rect",{attrs:{},zIndex:-1,capture:!1}),this.backgroundStyleRectShape.toBack());var e=this.viewBBox,n=e.x,a=e.y,o=e.width,s=e.height;this.backgroundStyleRectShape.attr({fill:t,x:n,y:a,width:o,height:s})}else this.backgroundStyleRectShape&&(this.backgroundStyleRectShape.remove(!0),this.backgroundStyleRectShape=void 0)}},r.prototype.renderPaddingRecursive=function(t){this.calculateViewBBox(),this.adjustCoordinate(),this.initComponents(t),this.autoPadding=mw(this).shrink(Is(this.appendPadding)),this.coordinateBBox=this.viewBBox.shrink(this.autoPadding.getPadding()),this.adjustCoordinate();var e=this.controllers.find(function(l){return l.name==="tooltip"});e.update();for(var n=this.views,a=0,o=n.length;a<o;a++){var s=n[a];s.renderPaddingRecursive(t)}},r.prototype.renderLayoutRecursive=function(t){var e=this.syncViewPadding===!0?xw:G(this.syncViewPadding)?this.syncViewPadding:void 0;e&&(e(this,this.views,In),this.views.forEach(function(l){l.coordinateBBox=l.viewBBox.shrink(l.autoPadding.getPadding()),l.adjustCoordinate()})),this.doLayout();for(var n=this.views,a=0,o=n.length;a<o;a++){var s=n[a];s.renderLayoutRecursive(t)}},r.prototype.renderPaintRecursive=function(t){var e=this.middleGroup;if(this.limitInPlot){var n=Ls(this.coordinateInstance),a=n.type,o=n.attrs;e.setClip({type:a,attrs:o})}else e.setClip(void 0);this.paintGeometries(t),this.renderComponents(t);for(var s=this.views,l=0,h=s.length;l<h;l++){var u=s[l];u.renderPaintRecursive(t)}},r.prototype.createScale=function(t,e,n,a){var o=T(this.options.scales,[t]),s=w(w({},o),n);return this.parent?this.parent.createScale(t,e,s,a):this.scalePool.createScale(t,e,s,a)},r.prototype.renderDataRecursive=function(t){this.doFilterData(),this.createCoordinate(),this.initGeometries(t),this.renderFacet(t);for(var e=this.views,n=0,a=e.length;n<a;n++){var o=e[n];o.renderDataRecursive(t)}},r.prototype.calculateViewBBox=function(){var t,e,n,a;if(this.parent){var o=this.parent.coordinateBBox;t=o.x,e=o.y,n=o.width,a=o.height}else t=0,e=0,n=this.canvas.get("width"),a=this.canvas.get("height");var s=this.region,l=s.start,h=s.end,u=new Bt(t+n*l.x,e+a*l.y,n*(h.x-l.x),a*(h.y-l.y));(!this.viewBBox||!this.viewBBox.isEqual(u))&&(this.viewBBox=new Bt(t+n*l.x,e+a*l.y,n*(h.x-l.x),a*(h.y-l.y))),this.coordinateBBox=this.viewBBox},r.prototype.initEvents=function(){this.foregroundGroup.on("*",this.onDelegateEvents),this.middleGroup.on("*",this.onDelegateEvents),this.backgroundGroup.on("*",this.onDelegateEvents),this.canvas.on("*",this.onCanvasEvent)},r.prototype.initComponentController=function(){for(var t=this.usedControllers,e=0,n=t.length;e<n;e++){var a=t[e],o=pw(a);o&&this.controllers.push(new o(this))}},r.prototype.createViewEvent=function(t){var e=t.shape,n=t.name,a=e?e.get("origin"):null,o=new At(this,t,a);return o.type=n,o},r.prototype.doPlotEvent=function(t){var e=t.type,n=t.x,a=t.y,o={x:n,y:a},s=["mousedown","mouseup","mousemove","mouseleave","mousewheel","touchstart","touchmove","touchend","touchcancel","click","dblclick","contextmenu"];if(s.includes(e)){var l=this.isPointInPlot(o),h=t.clone();if(l){var u="plot:".concat(e);h.type=u,this.emit(u,h),(e==="mouseleave"||e==="touchend")&&(this.isPreMouseInPlot=!1)}e==="mousemove"||e==="touchmove"?(this.isPreMouseInPlot&&!l?(e==="mousemove"&&(h.type=It.MOUSE_LEAVE,this.emit(It.MOUSE_LEAVE,h)),h.type=It.LEAVE,this.emit(It.LEAVE,h)):!this.isPreMouseInPlot&&l&&(e==="mousemove"&&(h.type=It.MOUSE_ENTER,this.emit(It.MOUSE_ENTER,h)),h.type=It.ENTER,this.emit(It.ENTER,h)),this.isPreMouseInPlot=l):(e==="mouseleave"||e==="touchend")&&this.isPreMouseInPlot&&(e==="mouseleave"&&(h.type=It.MOUSE_LEAVE,this.emit(It.MOUSE_LEAVE,h)),h.type=It.LEAVE,this.emit(It.LEAVE,h),this.isPreMouseInPlot=!1)}},r.prototype.doFilterData=function(){var t=this.options.data;this.filteredData=this.filterData(t)},r.prototype.initGeometries=function(t){this.createOrUpdateScales();for(var e=this.getCoordinate(),n=T(this.options,"scales",{}),a=this.geometries,o=0,s=a.length;o<s;o++){var l=a[o];l.scales=this.getGeometryScales();var h={coordinate:e,scaleDefs:n,data:this.filteredData,theme:this.themeObject,isDataChanged:this.isDataChanged,isCoordinateChanged:this.isCoordinateChanged};t?l.update(h):l.init(h)}this.adjustScales()},r.prototype.createOrUpdateScales=function(){for(var t=this.getScaleFields(),e=this.getGroupedFields(),n=this.getOptions(),a=n.data,o=n.scales,s=o===void 0?{}:o,l=this.filteredData,h=0,u=t.length;h<u;h++){var c=t[h],f=s[c],v=this.getScaleKey(c);this.createScale(c,e.includes(c)?a:l,f,v),this.createdScaleKeys.set(v,!0)}},r.prototype.syncScale=function(){this.getRootView().scalePool.sync(this.getCoordinate(),this.theme)},r.prototype.getGeometryScales=function(){for(var t=this.getScaleFields(),e={},n=0;n<t.length;n++){var a=t[n];e[a]=this.getScaleByField(a)}return e},r.prototype.getScaleFields=function(){for(var t=[],e=new Map,n=this.geometries,a=0;a<n.length;a++){var o=n[a],s=o.getScaleFields();Re(s,t,e)}return t},r.prototype.getGroupedFields=function(){for(var t=[],e=new Map,n=this.geometries,a=0;a<n.length;a++){var o=n[a],s=o.getGroupFields();Re(s,t,e)}return t},r.prototype.adjustScales=function(){this.adjustCategoryScaleRange()},r.prototype.adjustCategoryScaleRange=function(){var t=this,e=et([this.getXScale()],Y(this.getYScales()),!1).filter(function(o){return!!o}),n=this.getCoordinate(),a=this.options.scales;M(e,function(o){var s=o.field,l=o.values,h=o.isCategory,u=o.isIdentity;(h||u)&&l&&!T(a,[s,"range"])&&(o.range=Of(o,n,t.theme))})},r.prototype.initComponents=function(t){for(var e=this.controllers,n=0;n<e.length;n++){var a=e[n];t?a.update():(a.clear(),a.render())}},r.prototype.doLayout=function(){this.layoutFunc(this)},r.prototype.createCoordinate=function(){var t=this.coordinateBBox.bl,e=this.coordinateBBox.tr;this.coordinateInstance=this.coordinateController.create(t,e)},r.prototype.paintGeometries=function(t){for(var e=this.options.animate,n=this.getCoordinate(),a={x:this.viewBBox.x,y:this.viewBBox.y,minX:this.viewBBox.minX,minY:this.viewBBox.minY,maxX:this.viewBBox.maxX,maxY:this.viewBBox.maxY,width:this.viewBBox.width,height:this.viewBBox.height},o=this.geometries,s=0;s<o.length;s++){var l=o[s];l.coordinate=n,l.canvasRegion=a,e||l.animate(!1),l.paint(t)}},r.prototype.renderComponents=function(t){for(var e=this.getComponents(),n=0;n<e.length;n++){var a=e[n];a.component.render()}},r.prototype.renderFacet=function(t){this.facetInstance&&(t?this.facetInstance.update():(this.facetInstance.clear(),this.facetInstance.init(),this.facetInstance.render()))},r.prototype.initOptions=function(){var t=this,e=this.options,n=e.geometries,a=n===void 0?[]:n,o=e.interactions,s=o===void 0?[]:o,l=e.views,h=l===void 0?[]:l,u=e.annotations,c=u===void 0?[]:u,f=e.coordinate,v=e.events,p=e.facets;this.coordinateController?f&&this.coordinateController.update(f):this.coordinateController=new gw(f);for(var g=0;g<a.length;g++){var d=a[g];this.createGeometry(d)}for(var y=0;y<s.length;y++){var C=s[y],m=C.type,x=C.cfg;this.interaction(m,x)}for(var S=0;S<h.length;S++){var b=h[S];this.createView(b)}for(var A=this.getController("annotation"),L=0;L<c.length;L++){var k=c[L];A.annotation(k)}v&&M(v,function(B,O){t.on(O,B)}),p&&M(p,function(B){var O=B.type,R=mt(B,["type"]);t.facet(O,R)})},r.prototype.createGeometry=function(t){var e=t.type,n=t.cfg,a=n===void 0?{}:n;if(this[e]){var o=this[e](a);M(t,function(s,l){G(o[l])&&o[l](s)})}},r.prototype.getScaleKey=function(t){return"".concat(this.id,"-").concat(t)},r}(ns);function ye(i,r){Jf.prototype[i.toLowerCase()]=function(t){t===void 0&&(t={});var e=w({container:this.middleGroup.addGroup(),labelsContainer:this.foregroundGroup.addGroup()},t),n=new r(e);return this.geometries.push(n),n}}var pb=function(i){E(r,i);function r(t){var e=this,n=t.container,a=t.width,o=t.height,s=t.autoFit,l=s===void 0?!1:s,h=t.padding,u=t.appendPadding,c=t.renderer,f=c===void 0?"canvas":c,v=t.pixelRatio,p=t.localRefresh,g=p===void 0?!0:p,d=t.visible,y=d===void 0?!0:d,C=t.supportCSSTransform,m=C===void 0?!1:C,x=t.defaultInteractions,S=x===void 0?["tooltip","legend-filter","legend-active","continuous-filter","ellipsis-text","axis-description"]:x,b=t.options,A=t.limitInPlot,L=t.theme,k=t.syncViewPadding,B=N(n)?document.getElementById(n):n,O=Xe('<div style="position:relative;"></div>');B.appendChild(O);var R=cl(B,l,a,o),H=Bp(f),z=new H.Canvas(w({container:O,pixelRatio:v,localRefresh:g,supportCSSTransform:m},R));return e=i.call(this,{parent:null,canvas:z,backgroundGroup:z.addGroup({zIndex:Br.BG}),middleGroup:z.addGroup({zIndex:Br.MID}),foregroundGroup:z.addGroup({zIndex:Br.FORE}),padding:h,appendPadding:u,visible:y,options:b,limitInPlot:A,theme:L,syncViewPadding:k})||this,e.onResize=Wu(function(){e.forceFit()},300),e.ele=B,e.canvas=z,e.width=R.width,e.height=R.height,e.autoFit=l,e.localRefresh=g,e.renderer=f,e.wrapperElement=O,e.updateCanvasStyle(),e.bindAutoFit(),e.initDefaultInteractions(S),e}return r.prototype.initDefaultInteractions=function(t){var e=this;M(t,function(n){e.interaction(n)})},r.prototype.aria=function(t){var e="aria-label";t===!1?this.ele.removeAttribute(e):this.ele.setAttribute(e,t.label)},r.prototype.changeSize=function(t,e){return this.width===t&&this.height===e?this:(this.emit(tt.BEFORE_CHANGE_SIZE),this.width=t,this.height=e,this.canvas.changeSize(t,e),this.render(!0),this.emit(tt.AFTER_CHANGE_SIZE),this)},r.prototype.clear=function(){i.prototype.clear.call(this),this.aria(!1)},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.unbindAutoFit(),this.canvas.destroy(),Rp(this.wrapperElement),this.wrapperElement=null},r.prototype.changeVisible=function(t){return i.prototype.changeVisible.call(this,t),this.wrapperElement.style.display=t?"":"none",this},r.prototype.forceFit=function(){if(!this.destroyed){var t=cl(this.ele,!0,this.width,this.height),e=t.width,n=t.height;this.changeSize(e,n)}},r.prototype.updateCanvasStyle=function(){bt(this.canvas.get("el"),{display:"inline-block",verticalAlign:"middle"})},r.prototype.bindAutoFit=function(){this.autoFit&&window.addEventListener("resize",this.onResize)},r.prototype.unbindAutoFit=function(){this.autoFit&&window.removeEventListener("resize",this.onResize)},r}(Jf),jr=function(){function i(r){this.visible=!0,this.components=[],this.view=r}return i.prototype.clear=function(r){M(this.components,function(t){t.component.destroy()}),this.components=[]},i.prototype.destroy=function(){this.clear()},i.prototype.getComponents=function(){return this.components},i.prototype.changeVisible=function(r){this.visible!==r&&(this.components.forEach(function(t){r?t.component.show():t.component.hide()}),this.visible=r)},i}();function ww(i){for(var r=[],t=function(n){var a=i[n],o=Ce(r,function(s){return s.color===a.color&&s.name===a.name&&s.value===a.value&&s.title===a.title});o||r.push(a)},e=0;e<i.length;e++)t(e);return r}var Cw=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.isLocked=!1,t}return Object.defineProperty(r.prototype,"name",{get:function(){return"tooltip"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.isVisible=function(){var t=this.view.getOptions().tooltip;return t!==!1},r.prototype.render=function(){},r.prototype.showTooltip=function(t){if(this.point=t,!!this.isVisible()){var e=this.view,n=this.getTooltipItems(t);if(!n.length){this.hideTooltip();return}var a=this.getTitle(n),o={x:n[0].x,y:n[0].y};e.emit("tooltip:show",At.fromData(e,"tooltip:show",w({items:n,title:a},t)));var s=this.getTooltipCfg(),l=s.follow,h=s.showMarkers,u=s.showCrosshairs,c=s.showContent,f=s.marker,v=this.items,p=this.title;if(!gt(p,a)||!gt(v,n)?(e.emit("tooltip:change",At.fromData(e,"tooltip:change",w({items:n,title:a},t))),(G(c)?c(n):c)&&(this.tooltip||this.renderTooltip(),this.tooltip.update(ot({},s,{items:this.getItemsAfterProcess(n),title:a},l?t:{})),this.tooltip.show()),h&&this.renderTooltipMarkers(n,f)):(this.tooltip&&l&&(this.tooltip.update(t),this.tooltip.show()),this.tooltipMarkersGroup&&this.tooltipMarkersGroup.show()),this.items=n,this.title=a,u){var g=T(s,["crosshairs","follow"],!1);this.renderCrosshairs(g?t:o,s)}}},r.prototype.hideTooltip=function(){var t=this.getTooltipCfg().follow;if(!t){this.point=null;return}var e=this.tooltipMarkersGroup;e&&e.hide();var n=this.xCrosshair,a=this.yCrosshair;n&&n.hide(),a&&a.hide();var o=this.tooltip;o&&o.hide(),this.view.emit("tooltip:hide",At.fromData(this.view,"tooltip:hide",{})),this.point=null},r.prototype.lockTooltip=function(){this.isLocked=!0,this.tooltip&&this.tooltip.setCapture(!0)},r.prototype.unlockTooltip=function(){this.isLocked=!1;var t=this.getTooltipCfg();this.tooltip&&this.tooltip.setCapture(t.capture)},r.prototype.isTooltipLocked=function(){return this.isLocked},r.prototype.clear=function(){var t=this,e=t.tooltip,n=t.xCrosshair,a=t.yCrosshair,o=t.tooltipMarkersGroup;e&&(e.hide(),e.clear()),n&&n.clear(),a&&a.clear(),o&&o.clear(),e!=null&&e.get("customContent")&&(this.tooltip.destroy(),this.tooltip=null),this.title=null,this.items=null},r.prototype.destroy=function(){this.tooltip&&this.tooltip.destroy(),this.xCrosshair&&this.xCrosshair.destroy(),this.yCrosshair&&this.yCrosshair.destroy(),this.guideGroup&&this.guideGroup.remove(!0),this.reset()},r.prototype.reset=function(){this.items=null,this.title=null,this.tooltipMarkersGroup=null,this.tooltipCrosshairsGroup=null,this.xCrosshair=null,this.yCrosshair=null,this.tooltip=null,this.guideGroup=null,this.isLocked=!1,this.point=null},r.prototype.changeVisible=function(t){if(this.visible!==t){var e=this,n=e.tooltip,a=e.tooltipMarkersGroup,o=e.xCrosshair,s=e.yCrosshair;t?(n&&n.show(),a&&a.show(),o&&o.show(),s&&s.show()):(n&&n.hide(),a&&a.hide(),o&&o.hide(),s&&s.hide()),this.visible=t}},r.prototype.getTooltipItems=function(t){var e,n,a,o,s,l,h=this.findItemsFromView(this.view,t);if(h.length){h=$t(h);try{for(var u=$(h),c=u.next();!c.done;c=u.next()){var f=c.value;try{for(var v=(a=void 0,$(f)),p=v.next();!p.done;p=v.next()){var g=p.value,d=g.mappingData,y=d.x,C=d.y;g.x=P(y)?y[y.length-1]:y,g.y=P(C)?C[C.length-1]:C}}catch(B){a={error:B}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(B){e={error:B}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var m=this.getTooltipCfg().shared;if(m===!1&&h.length>1){var x=h[0],S=Math.abs(t.y-x[0].y);try{for(var b=$(h),A=b.next();!A.done;A=b.next()){var L=A.value,k=Math.abs(t.y-L[0].y);k<=S&&(x=L,S=k)}}catch(B){s={error:B}}finally{try{A&&!A.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}h=[x]}return ww($t(h))}return[]},r.prototype.layout=function(){},r.prototype.update=function(){if(this.point&&this.showTooltip(this.point),this.tooltip){var t=this.view.getCanvas();this.tooltip.set("region",{start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}})}},r.prototype.isCursorEntered=function(t){if(this.tooltip){var e=this.tooltip.getContainer(),n=this.tooltip.get("capture");if(e&&n){var a=e.getBoundingClientRect(),o=a.x,s=a.y,l=a.width,h=a.height;return new Bt(o,s,l,h).isPointIn(t)}}return!1},r.prototype.getTooltipCfg=function(){var t=this.view,e=t.getOptions().tooltip,n=this.processCustomContent(e),a=t.getTheme(),o=T(a,["components","tooltip"],{}),s=T(n,"enterable",o.enterable);return D({},o,n,{capture:!!(s||this.isLocked)})},r.prototype.processCustomContent=function(t){if(Mi(t)||!T(t,"customContent"))return t;var e=t.customContent,n=function(a,o){var s=e(a,o)||"";return N(s)?'<div class="g2-tooltip">'+s+"</div>":s};return w(w({},t),{customContent:n})},r.prototype.getTitle=function(t){var e=t[0].title||t[0].name;return this.title=e,e},r.prototype.renderTooltip=function(){var t=this.view.getCanvas(),e={start:{x:0,y:0},end:{x:t.get("width"),y:t.get("height")}},n=this.getTooltipCfg(),a=new Ea(w(w({parent:t.get("el").parentNode,region:e},n),{visible:!1,crosshairs:null}));a.init(),this.tooltip=a},r.prototype.renderTooltipMarkers=function(t,e){var n,a,o=this.getTooltipMarkersGroup(),s=this.view.getRootView(),l=s.limitInPlot;try{for(var h=$(t),u=h.next();!u.done;u=h.next()){var c=u.value,f=c.x,v=c.y;if(l||(o==null?void 0:o.getClip())){var p=Ls(s.getCoordinate()),g=p.type,d=p.attrs;o==null||o.setClip({type:g,attrs:d})}else o==null||o.setClip(void 0);var y=this.view.getTheme(),C=T(y,["components","tooltip","marker"],{}),m=w(w({fill:c.color,symbol:"circle",shadowColor:c.color},G(e)?w(w({},C),e(c)):e),{x:f,y:v});o.addShape("marker",{attrs:m})}}catch(x){n={error:x}}finally{try{u&&!u.done&&(a=h.return)&&a.call(h)}finally{if(n)throw n.error}}},r.prototype.renderCrosshairs=function(t,e){var n=T(e,["crosshairs","type"],"x");n==="x"?(this.yCrosshair&&this.yCrosshair.hide(),this.renderXCrosshairs(t,e)):n==="y"?(this.xCrosshair&&this.xCrosshair.hide(),this.renderYCrosshairs(t,e)):n==="xy"&&(this.renderXCrosshairs(t,e),this.renderYCrosshairs(t,e))},r.prototype.renderXCrosshairs=function(t,e){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect)n.isTransposed?(a={x:n.start.x,y:t.y},o={x:n.end.x,y:t.y}):(a={x:t.x,y:n.end.y},o={x:t.x,y:n.start.y});else{var s=Yr(n,t),l=n.getCenter(),h=n.getRadius();o=ft(l.x,l.y,h,s),a=l}var u=D({start:a,end:o,container:this.getTooltipCrosshairsGroup()},T(e,"crosshairs",{}),this.getCrosshairsText("x",t,e));delete u.type;var c=this.xCrosshair;c?c.update(u):(c=new Af(u),c.init()),c.render(),c.show(),this.xCrosshair=c},r.prototype.renderYCrosshairs=function(t,e){var n=this.getViewWithGeometry(this.view).getCoordinate(),a,o;if(n.isRect){var s=void 0,l=void 0;n.isTransposed?(s={x:t.x,y:n.end.y},l={x:t.x,y:n.start.y}):(s={x:n.start.x,y:t.y},l={x:n.end.x,y:t.y}),a={start:s,end:l},o="Line"}else a={center:n.getCenter(),radius:Ba(n,t),startAngle:n.startAngle,endAngle:n.endAngle},o="Circle";a=D({container:this.getTooltipCrosshairsGroup()},a,T(e,"crosshairs",{}),this.getCrosshairsText("y",t,e)),delete a.type;var h=this.yCrosshair;h?n.isRect&&h.get("type")==="circle"||!n.isRect&&h.get("type")==="line"?(h=new Th[o](a),h.init()):h.update(a):(h=new Th[o](a),h.init()),h.render(),h.show(),this.yCrosshair=h},r.prototype.getCrosshairsText=function(t,e,n){var a=T(n,["crosshairs","text"]),o=T(n,["crosshairs","follow"]),s=this.items;if(a){var l=this.getViewWithGeometry(this.view),h=s[0],u=l.getXScale(),c=l.getYScales()[0],f=void 0,v=void 0;if(o){var p=this.view.getCoordinate().invert(e);f=u.invert(p.x),v=c.invert(p.y)}else f=h.data[u.field],v=h.data[c.field];var g=t==="x"?f:v;return G(a)?a=a(t,g,s,e):a.content=g,{text:a}}},r.prototype.getGuideGroup=function(){if(!this.guideGroup){var t=this.view.foregroundGroup;this.guideGroup=t.addGroup({name:"tooltipGuide",capture:!1})}return this.guideGroup},r.prototype.getTooltipMarkersGroup=function(){var t=this.tooltipMarkersGroup;return t&&!t.destroyed?(t.clear(),t.show()):(t=this.getGuideGroup().addGroup({name:"tooltipMarkersGroup"}),t.toFront(),this.tooltipMarkersGroup=t),t},r.prototype.getTooltipCrosshairsGroup=function(){var t=this.tooltipCrosshairsGroup;return t||(t=this.getGuideGroup().addGroup({name:"tooltipCrosshairsGroup",capture:!1}),t.toBack(),this.tooltipCrosshairsGroup=t),t},r.prototype.findItemsFromView=function(t,e){var n,a;if(t.getOptions().tooltip===!1)return[];var o=this.getTooltipCfg(),s=Wo(t,e,o);try{for(var l=$(t.views),h=l.next();!h.done;h=l.next()){var u=h.value;s=s.concat(this.findItemsFromView(u,e))}}catch(c){n={error:c}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(n)throw n.error}}return s},r.prototype.getViewWithGeometry=function(t){var e=this;return t.geometries.length?t:Ce(t.views,function(n){return e.getViewWithGeometry(n)})},r.prototype.getItemsAfterProcess=function(t){var e=this.getTooltipCfg().customItems,n=e||function(a){return a};return n(t)},r}(jr),tv={};function ev(i){return tv[i.toLowerCase()]}function _t(i,r){tv[i.toLowerCase()]=r}var Vr={appear:{duration:450,easing:"easeQuadOut"},update:{duration:400,easing:"easeQuadInOut"},enter:{duration:400,easing:"easeQuadInOut"},leave:{duration:350,easing:"easeQuadIn"}},Mw={interval:function(i){return{enter:{animation:i.isRect?i.isTransposed?"scale-in-x":"scale-in-y":"fade-in"},update:{animation:i.isPolar&&i.isTransposed?"sector-path-update":null},leave:{animation:"fade-out"}}},line:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},path:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},point:{appear:{animation:"zoom-in"},enter:{animation:"zoom-in"},leave:{animation:"zoom-out"}},area:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},polygon:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},schema:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},edge:{enter:{animation:"fade-in"},leave:{animation:"fade-out"}},label:{appear:{animation:"fade-in",delay:450},enter:{animation:"fade-in"},update:{animation:"position-update"},leave:{animation:"fade-out"}}},$h={line:function(){return{animation:"wave-in"}},area:function(){return{animation:"wave-in"}},path:function(){return{animation:"fade-in"}},interval:function(i){var r;return i.isRect?r=i.isTransposed?"grow-in-x":"grow-in-y":(r="grow-in-xy",i.isPolar&&i.isTransposed&&(r="wave-in")),{animation:r}},schema:function(i){var r;return i.isRect?r=i.isTransposed?"grow-in-x":"grow-in-y":r="grow-in-xy",{animation:r}},polygon:function(){return{animation:"fade-in",duration:500}},edge:function(){return{animation:"fade-in"}}};function Sw(i,r){return{delay:G(i.delay)?i.delay(r):i.delay,easing:G(i.easing)?i.easing(r):i.easing,duration:G(i.duration)?i.duration(r):i.duration,callback:i.callback,repeat:i.repeat}}function rv(i,r,t){var e=Mw[i];return e&&(G(e)&&(e=e(r)),e=D({},Vr,e),t)?e[t]:e}function Fr(i,r,t){var e=T(i.get("origin"),"data",Z),n=r.animation,a=Sw(r,e);if(n){var o=ev(n);o&&o(i,a,t)}else i.animate(t.toAttrs,a)}function bw(i,r,t,e,n){if($h[t]){var a=$h[t](e),o=ev(T(a,"animation",""));if(o){var s=w(w(w({},Vr.appear),a),r);i.stopAnimate(),o(i,s,{coordinate:e,minYPoint:n,toAttrs:null})}}}var Fs="element-background",iv=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.labelShape=[],e.states=[];var n=t.shapeFactory,a=t.container,o=t.offscreenGroup,s=t.elementIndex,l=t.visible,h=l===void 0?!0:l;return e.shapeFactory=n,e.container=a,e.offscreenGroup=o,e.visible=h,e.elementIndex=s,e}return r.prototype.draw=function(t,e){e===void 0&&(e=!1),this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.drawShape(t,e),this.visible===!1&&this.changeVisible(!1)},r.prototype.update=function(t){var e=this,n=e.shapeFactory,a=e.shape;if(!!a){this.model=t,this.data=t.data,this.shapeType=this.getShapeType(t),this.setShapeInfo(a,t);var o=this.getOffscreenGroup(),s=n.drawShape(this.shapeType,t,o);s.cfg.data=this.data,s.cfg.origin=t,s.cfg.element=this,this.syncShapeStyle(a,s,this.getStates(),this.getAnimateCfg("update"))}},r.prototype.destroy=function(){var t=this,e=t.shapeFactory,n=t.shape;if(n){var a=this.getAnimateCfg("leave");a?Fr(n,a,{coordinate:e.coordinate,toAttrs:w({},n.attr())}):n.remove(!0)}this.states=[],this.shapeFactory=void 0,this.container=void 0,this.shape=void 0,this.animate=void 0,this.geometry=void 0,this.labelShape=[],this.model=void 0,this.data=void 0,this.offscreenGroup=void 0,this.statesStyle=void 0,i.prototype.destroy.call(this)},r.prototype.changeVisible=function(t){i.prototype.changeVisible.call(this,t),t?(this.shape&&this.shape.show(),this.labelShape&&this.labelShape.forEach(function(e){e.show()})):(this.shape&&this.shape.hide(),this.labelShape&&this.labelShape.forEach(function(e){e.hide()}))},r.prototype.setState=function(t,e){var n=this,a=n.states,o=n.shapeFactory,s=n.model,l=n.shape,h=n.shapeType,u=a.indexOf(t);if(e){if(u>-1)return;a.push(t),(t==="active"||t==="selected")&&(l==null||l.toFront())}else{if(u===-1)return;if(a.splice(u,1),t==="active"||t==="selected"){var c=this.geometry,f=c.sortZIndex,v=c.zIndexReversed,p=v?this.geometry.elements.length-this.elementIndex:this.elementIndex;f?l.setZIndex(p):l.set("zIndex",p)}}var g=o.drawShape(h,s,this.getOffscreenGroup());a.length?this.syncShapeStyle(l,g,a,null):this.syncShapeStyle(l,g,["reset"],null),g.remove(!0);var d={state:t,stateStatus:e,element:this,target:this.container};this.container.emit("statechange",d),cf(this.shape,"statechange",d)},r.prototype.clearStates=function(){var t=this,e=this.states;M(e,function(n){t.setState(n,!1)}),this.states=[]},r.prototype.hasState=function(t){return this.states.includes(t)},r.prototype.getStates=function(){return this.states},r.prototype.getData=function(){return this.data},r.prototype.getModel=function(){return this.model},r.prototype.getBBox=function(){var t=this,e=t.shape,n=t.labelShape,a={x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0};return e&&(a=e.getCanvasBBox()),n&&n.forEach(function(o){var s=o.getCanvasBBox();a.x=Math.min(s.x,a.x),a.y=Math.min(s.y,a.y),a.minX=Math.min(s.minX,a.minX),a.minY=Math.min(s.minY,a.minY),a.maxX=Math.max(s.maxX,a.maxX),a.maxY=Math.max(s.maxY,a.maxY)}),a.width=a.maxX-a.minX,a.height=a.maxY-a.minY,a},r.prototype.getStatesStyle=function(){if(!this.statesStyle){var t=this,e=t.shapeType,n=t.geometry,a=t.shapeFactory,o=n.stateOption,s=a.defaultShapeType,l=a.theme[e]||a.theme[s];this.statesStyle=D({},l,o)}return this.statesStyle},r.prototype.getStateStyle=function(t,e){var n=this.getStatesStyle(),a=T(n,[t,"style"],{}),o=a[e]||a;return G(o)?o(this):o},r.prototype.getAnimateCfg=function(t){var e=this,n=this.animate;if(n){var a=n[t];return a&&w(w({},a),{callback:function(){var o;G(a.callback)&&a.callback(),(o=e.geometry)===null||o===void 0||o.emit(Ne.AFTER_DRAW_ANIMATE)}})}return null},r.prototype.drawShape=function(t,e){var n;e===void 0&&(e=!1);var a=this,o=a.shapeFactory,s=a.container,l=a.shapeType;if(this.shape=o.drawShape(l,t,s),this.shape){this.setShapeInfo(this.shape,t);var h=this.shape.cfg.name;h?N(h)&&(this.shape.cfg.name=["element",h]):this.shape.cfg.name=["element",this.shapeFactory.geometryType];var u=e?"enter":"appear",c=this.getAnimateCfg(u);c&&((n=this.geometry)===null||n===void 0||n.emit(Ne.BEFORE_DRAW_ANIMATE),Fr(this.shape,c,{coordinate:o.coordinate,toAttrs:w({},this.shape.attr())}))}},r.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},r.prototype.setShapeInfo=function(t,e){var n=this;if(t.cfg.origin=e,t.cfg.element=this,t.isGroup()){var a=t.get("children");a.forEach(function(o){n.setShapeInfo(o,e)})}},r.prototype.syncShapeStyle=function(t,e,n,a,o){var s=this,l;if(n===void 0&&(n=[]),o===void 0&&(o=0),!(!t||!e)){var h=t.get("clipShape"),u=e.get("clipShape");if(this.syncShapeStyle(h,u,n,a),t.isGroup())for(var c=t.get("children"),f=e.get("children"),v=0;v<c.length;v++)this.syncShapeStyle(c[v],f[v],n,a,o+v);else{if(!pe(n)&&!gt(n,["reset"])){var p=t.get("name");P(p)&&(p=p[1]),M(n,function(d){if(e.get("name")!==Fs){var y=s.getStateStyle(d,p||o);e.attr(y)}})}var g=Pf(t,e);this.animate?a?((l=this.geometry)===null||l===void 0||l.emit(Ne.BEFORE_DRAW_ANIMATE),Fr(t,a,{coordinate:this.shapeFactory.coordinate,toAttrs:g,shapeModel:this.model})):pe(n)?t.attr(g):(t.stopAnimate(),t.animate(g,{duration:300})):t.attr(g)}}},r.prototype.getShapeType=function(t){var e=T(t,"shape");return P(e)?e[0]:e},r}(ns),nv={},av={};function Aw(i){return nv[i.toLowerCase()]}function ka(i,r){nv[i.toLowerCase()]=r}function Tw(i){return av[i.toLowerCase()]}function Vt(i,r){av[i.toLowerCase()]=r}var Lw={coordinate:null,defaultShapeType:null,theme:null,getShapePoints:function(i,r){var t=this.getShape(i);return t.getPoints?t.getPoints(r):this.getDefaultPoints(r)},getShape:function(i){var r=this[i]||this[this.defaultShapeType];return r.coordinate=this.coordinate,r},getDefaultPoints:function(){return[]},getDefaultStyle:function(i){return T(i,[this.defaultShapeType,"default","style"],{})},getMarker:function(i,r){var t=this.getShape(i);if(!t.getMarker){var e=this.defaultShapeType;t=this.getShape(e)}var n=this.theme,a=T(n,[i,"default"],{}),o=t.getMarker(r);return D({},a,o)},drawShape:function(i,r,t){var e=this.getShape(i);return e.draw(r,t)}},Ew={coordinate:null,parsePath:function(i){var r=this.coordinate,t=Dc(i);return r.isPolar?t=Vx(r,t):t=Hx(r,t),t},parsePoint:function(i){var r=this.coordinate;return r.convert(i)},parsePoints:function(i){var r=this.coordinate;return i.map(function(t){return r.convert(t)})},draw:function(i,r){}},Os={};function Ze(i,r){var t=dr(i),e=w(w(w({},Lw),r),{geometryType:i});return Os[t]=e,e}function J(i,r,t){var e=dr(i),n=Os[e],a=w(w({},Ew),t);return n[r]=a,a}function _h(i){var r=dr(i);return Os[r]}function Bw(i,r,t){var e,n;if(t===void 0&&(t={}),!r)return[i];var a=Vu(i,r),o=[];if(r.length===1&&t[r[0]]){var s=t[r[0]];try{for(var l=$(s),h=l.next();!h.done;h=l.next()){var u=h.value,c=a["_".concat(u)];c&&o.push(c)}}catch(p){e={error:p}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}}else for(var f in a)if(a.hasOwnProperty(f)){var v=a[f];o.push(v)}return o}function ov(i,r){return ea(["color","shape","size","x","y","isInCircle","data","style","defaultStyle","points","mappingData"],function(t){return!gt(i[t],r[t])})}function ri(i){return P(i)?i:i.split("*")}function sv(i,r){for(var t=[],e=[],n=[],a=new Map,o=0;o<r.length;o++){var s=r[o];i[s]?e.push(s):t.push(s),a.set(s,!0)}return Object.keys(i).forEach(function(l){a.has(l)||n.push(l)}),{added:t,updated:e,removed:n}}var Qe=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="base",e.attributes={},e.elements=[],e.elementsMap={},e.animateOption=!0,e.attributeOption={},e.lastElementsMap={},e.generatePoints=!1,e.beforeMappingData=null,e.adjusts={},e.idFields=[],e.hasSorted=!1,e.isCoordinateChanged=!1;var n=t.container,a=t.labelsContainer,o=t.coordinate,s=t.data,l=t.sortable,h=l===void 0?!1:l,u=t.visible,c=u===void 0?!0:u,f=t.theme,v=t.scales,p=v===void 0?{}:v,g=t.scaleDefs,d=g===void 0?{}:g,y=t.intervalPadding,C=t.dodgePadding,m=t.maxColumnWidth,x=t.minColumnWidth,S=t.columnWidthRatio,b=t.roseWidthRatio,A=t.multiplePieWidthRatio,L=t.zIndexReversed,k=t.sortZIndex,B=t.useDeferredLabel;return e.container=n,e.labelsContainer=a,e.coordinate=o,e.data=s,e.sortable=h,e.visible=c,e.userTheme=f,e.scales=p,e.scaleDefs=d,e.intervalPadding=y,e.dodgePadding=C,e.maxColumnWidth=m,e.minColumnWidth=x,e.columnWidthRatio=S,e.roseWidthRatio=b,e.multiplePieWidthRatio=A,e.zIndexReversed=L,e.sortZIndex=k,e.useDeferredLabel=B?typeof B=="number"?B:1/0:null,e}return r.prototype.position=function(t){var e=t;ce(t)||(e={fields:ri(t)});var n=T(e,"fields");return n.length===1&&(n.unshift("1"),pt(e,"fields",n)),pt(this.attributeOption,"position",e),this},r.prototype.color=function(t,e){return this.createAttrOption("color",t,e),this},r.prototype.shape=function(t,e){return this.createAttrOption("shape",t,e),this},r.prototype.size=function(t,e){return this.createAttrOption("size",t,e),this},r.prototype.adjust=function(t){var e=t;return(N(t)||ce(t))&&(e=[t]),M(e,function(n,a){rt(n)||(e[a]={type:n})}),this.adjustOption=e,this},r.prototype.style=function(t,e){if(N(t)){var n=ri(t);this.styleOption={fields:n,callback:e}}else{var a=t,n=a.fields,o=a.callback,s=a.cfg;n||o||s?this.styleOption=t:this.styleOption={cfg:t}}return this},r.prototype.tooltip=function(t,e){if(N(t)){var n=ri(t);this.tooltipOption={fields:n,callback:e}}else this.tooltipOption=t;return this},r.prototype.animate=function(t){return this.animateOption=t,this},r.prototype.label=function(t,e,n){if(N(t)){var a={},o=ri(t);a.fields=o,G(e)?a.callback=e:ce(e)&&(a.cfg=e),n&&(a.cfg=n),this.labelOption=a}else this.labelOption=t;return this},r.prototype.state=function(t){return this.stateOption=t,this},r.prototype.customInfo=function(t){return this.customOption=t,this},r.prototype.init=function(t){t===void 0&&(t={}),this.setCfg(t),this.initAttributes(),this.processData(this.data),this.adjustScale()},r.prototype.update=function(t){t===void 0&&(t={});var e=t.data,n=t.isDataChanged,a=t.isCoordinateChanged,o=this,s=o.attributeOption,l=o.lastAttributeOption;gt(s,l)?e&&(n||!gt(e,this.data))?(this.setCfg(t),this.initAttributes(),this.processData(e)):this.setCfg(t):this.init(t),this.adjustScale(),this.isCoordinateChanged=a},r.prototype.paint=function(t){var e=this;t===void 0&&(t=!1),this.animateOption&&(this.animateOption=D({},rv(this.type,this.coordinate),this.animateOption)),this.defaultSize=void 0,this.elementsMap={},this.elements=[];var n=this.getOffscreenGroup();n.clear();var a=this.beforeMappingData,o=this.beforeMapping(a);this.dataArray=new Array(o.length);for(var s=0;s<o.length;s++){var l=o[s];this.dataArray[s]=this.mapping(l)}if(this.updateElements(this.dataArray,t),this.lastElementsMap=this.elementsMap,this.canDoGroupAnimation(t)){var h=this.container,u=this.type,c=this.coordinate,f=T(this.animateOption,"appear"),v=this.getYScale(),p=c.convert({x:0,y:v.scale(this.getYMinValue())});bw(h,f,u,c,p)}if(this.labelOption){var g=this.useDeferredLabel,d=function(){return e.renderLabels($t(e.dataArray),t)}.bind(this);if(typeof g=="number"){var y=typeof g=="number"&&g!==1/0?g:0;if(!window.requestIdleCallback)setTimeout(d,y);else{var C=y&&y!==1/0?{timeout:y}:void 0;window.requestIdleCallback(d,C)}}else d()}this.lastAttributeOption=w({},this.attributeOption),this.visible===!1&&this.changeVisible(!1)},r.prototype.clear=function(){var t=this,e=t.container,n=t.geometryLabel,a=t.offscreenGroup;e&&e.clear(),n&&n.clear(),a&&a.clear(),this.scaleDefs=void 0,this.attributes={},this.scales={},this.elementsMap={},this.lastElementsMap={},this.elements=[],this.adjusts={},this.dataArray=null,this.beforeMappingData=null,this.lastAttributeOption=void 0,this.defaultSize=void 0,this.idFields=[],this.groupScales=void 0,this.hasSorted=!1,this.isCoordinateChanged=!1},r.prototype.destroy=function(){this.clear();var t=this.container;t.remove(!0),this.offscreenGroup&&(this.offscreenGroup.remove(!0),this.offscreenGroup=null),this.geometryLabel&&(this.geometryLabel.destroy(),this.geometryLabel=null),this.theme=void 0,this.shapeFactory=void 0,i.prototype.destroy.call(this)},r.prototype.getGroupScales=function(){return this.groupScales},r.prototype.getAttribute=function(t){return this.attributes[t]},r.prototype.getXScale=function(){return this.getAttribute("position").scales[0]},r.prototype.getYScale=function(){return this.getAttribute("position").scales[1]},r.prototype.getGroupAttributes=function(){var t=[];return M(this.attributes,function(e){Ar.includes(e.type)&&t.push(e)}),t},r.prototype.getDefaultValue=function(t){var e,n=this.getAttribute(t);return n&&pe(n.scales)&&(e=n.values[0]),e},r.prototype.getAttributeValues=function(t,e){for(var n=[],a=t.scales,o=0,s=a.length;o<s;o++){var l=a[o],h=l.field;l.isIdentity?n.push(l.values):n.push(e[h])}return t.mapping.apply(t,et([],Y(n),!1))},r.prototype.getAdjust=function(t){return this.adjusts[t]},r.prototype.getCoordinate=function(){return this.coordinate},r.prototype.getData=function(){return this.data},r.prototype.getShapeMarker=function(t,e){var n=this.getShapeFactory();return n.getMarker(t,e)},r.prototype.getElementsBy=function(t){return this.elements.filter(function(e){return t(e)})},r.prototype.getElements=function(){return this.elements},r.prototype.getElementId=function(t){t=P(t)?t[0]:t;var e=t[Z];if(this.idFields.length){for(var n=e[this.idFields[0]],a=1;a<this.idFields.length;a++)n+="-"+e[this.idFields[a]];return n}var o=this.type,s=this.getXScale(),l=this.getYScale(),h=s.field||"x",u=l.field||"y",c=e[u],f;s.type==="identity"?f=s.values[0]:f=e[h];var v;o==="interval"||o==="schema"?v="".concat(f):o==="line"||o==="area"||o==="path"?v=o:v="".concat(f,"-").concat(c);for(var p=this.groupScales,a=0,g=p.length;a<g;a++){var d=p[a],y=d.field;v="".concat(v,"-").concat(e[y])}var C=this.getAdjust("dodge");if(C){var m=C.dodgeBy;m&&(v="".concat(v,"-").concat(e[m]))}return this.getAdjust("jitter")&&(v="".concat(v,"-").concat(t.x,"-").concat(t.y)),v},r.prototype.getScaleFields=function(){var t=[],e=new Map,n=this,a=n.attributeOption,o=n.labelOption,s=n.tooltipOption;for(var l in a)if(a.hasOwnProperty(l)){var h=a[l];h.fields?Re(h.fields,t,e):h.values&&Re(h.values,t,e)}return o&&o.fields&&Re(o.fields,t,e),rt(s)&&s.fields&&Re(s.fields,t,e),t},r.prototype.changeVisible=function(t){i.prototype.changeVisible.call(this,t);for(var e=this.elements,n=0,a=e.length;n<a;n++){var o=e[n];o.changeVisible(t)}t?(this.container&&this.container.show(),this.labelsContainer&&this.labelsContainer.show()):(this.container&&this.container.hide(),this.labelsContainer&&this.labelsContainer.hide())},r.prototype.getFields=function(){var t=new Map,e=[];return Object.values(this.attributeOption).forEach(function(n){var a=(n==null?void 0:n.fields)||[];a.forEach(function(o){t.has(o)||e.push(o),t.set(o,!0)})},[]),e},r.prototype.getGroupFields=function(){for(var t=[],e=new Map,n=0,a=Ar.length;n<a;n++){var o=Ar[n],s=this.attributeOption[o];s&&s.fields&&Re(s.fields,t,e)}return t},r.prototype.getXYFields=function(){var t=Y(this.attributeOption.position.fields,2),e=t[0],n=t[1];return[e,n]},r.prototype.getXField=function(){return T(this.getXYFields(),[0])},r.prototype.getYField=function(){return T(this.getXYFields(),[1])},r.prototype.getShapes=function(){return this.elements.map(function(t){return t.shape})},r.prototype.getOffscreenGroup=function(){if(!this.offscreenGroup){var t=this.container.getGroupBase();this.offscreenGroup=new t({})}return this.offscreenGroup},r.prototype.sort=function(t){if(!this.hasSorted)for(var e=this.getXScale(),n=e.field,a=0;a<t.length;a++){var o=t[a];o.sort(function(s,l){return e.translate(s[Z][n])-e.translate(l[Z][n])})}this.hasSorted=!0},r.prototype.adjustScale=function(){var t=this.getYScale();t&&this.getAdjust("stack")&&this.updateStackRange(t,this.beforeMappingData)},r.prototype.getShapeFactory=function(){var t=this.shapeType;if(!!_h(t))return this.shapeFactory||(this.shapeFactory=Xt(_h(t))),this.shapeFactory.coordinate=this.coordinate,this.shapeFactory.theme=this.theme.geometries[t]||{},this.shapeFactory},r.prototype.createShapePointsCfg=function(t){var e=this.getXScale(),n=this.getYScale(),a=this.normalizeValues(t[e.field],e),o;return n?o=this.normalizeValues(t[n.field],n):o=t.y?t.y:.1,{x:a,y:o,y0:n?n.scale(this.getYMinValue()):void 0}},r.prototype.createElement=function(t,e,n){n===void 0&&(n=!1);var a=this.container,o=this.getDrawCfg(t),s=this.getShapeFactory(),l=new iv({shapeFactory:s,container:a,offscreenGroup:this.getOffscreenGroup(),elementIndex:e});return l.animate=this.animateOption,l.geometry=this,l.draw(o,n),l},r.prototype.getDrawCfg=function(t){var e=t[Z],n={mappingData:t,data:e,x:t.x,y:t.y,color:t.color,size:t.size,isInCircle:this.coordinate.isPolar,customInfo:this.customOption},a=t.shape;!a&&this.getShapeFactory()&&(a=this.getShapeFactory().defaultShapeType),n.shape=a;var o=this.theme.geometries[this.shapeType];n.defaultStyle=T(o,[a,"default"],{}).style,!n.defaultStyle&&this.getShapeFactory()&&(n.defaultStyle=this.getShapeFactory().getDefaultStyle(o));var s=this.styleOption;return s&&(n.style=this.getStyleCfg(s,e)),this.generatePoints&&(n.points=t.points,n.nextPoints=t.nextPoints),n},r.prototype.updateElements=function(t,e){var n,a,o,s,l,h;e===void 0&&(e=!1);for(var u=new Map,c=[],f=new Map,v=0,p=0;p<t.length;p++)for(var g=t[p],d=0;d<g.length;d++){var y=g[d],C=this.getElementId(y),m=u.has(C)?"".concat(C,"-").concat(p,"-").concat(d):C;c.push(m),u.set(m,y),f.set(m,v),v++}this.elements=new Array(v);var x=sv(this.lastElementsMap,c),S=x.added,b=x.updated,A=x.removed;try{for(var L=$(S),k=L.next();!k.done;k=L.next()){var C=k.value,y=u.get(C),p=f.get(C),B=this.createElement(y,p,e);this.elements[p]=B,this.elementsMap[C]=B,B.shape&&B.shape.set("zIndex",this.zIndexReversed?this.elements.length-p:p)}}catch(nt){n={error:nt}}finally{try{k&&!k.done&&(a=L.return)&&a.call(L)}finally{if(n)throw n.error}}try{for(var O=$(b),R=O.next();!R.done;R=O.next()){var C=R.value,B=this.lastElementsMap[C],y=u.get(C),H=this.getDrawCfg(y),z=B.getModel(),p=f.get(C);(this.isCoordinateChanged||ov(H,z))&&(B.animate=this.animateOption,B.update(H)),this.elements[p]=B,this.elementsMap[C]=B,B.shape&&B.shape.set("zIndex",this.zIndexReversed?this.elements.length-p:p)}}catch(nt){o={error:nt}}finally{try{R&&!R.done&&(s=O.return)&&s.call(O)}finally{if(o)throw o.error}}this.container&&this.container.sort();try{for(var _=$(A),K=_.next();!K.done;K=_.next()){var C=K.value,B=this.lastElementsMap[C];B.animate=this.animateOption,B.destroy()}}catch(nt){l={error:nt}}finally{try{K&&!K.done&&(h=_.return)&&h.call(_)}finally{if(l)throw l.error}}},r.prototype.getLabelType=function(){var t=this,e=t.labelOption,n=t.coordinate,a=t.type,o=n.type,s=n.isTransposed,l=T(e,["cfg","type"]);return l||(o==="polar"?l=s?"pie":"polar":o==="theta"?l="pie":a==="interval"||a==="polygon"?l="interval":l="base"),l},r.prototype.getYMinValue=function(){var t=this.getYScale(),e=t.min,n=t.max,a;return e>=0?a=e:n<=0?a=n:a=0,a},r.prototype.createAttrOption=function(t,e,n){if(I(e)||rt(e))rt(e)&&gt(Object.keys(e),["values"])?pt(this.attributeOption,t,{fields:e.values}):pt(this.attributeOption,t,e);else{var a={};U(e)?a.values=[e]:a.fields=ri(e),n&&(G(n)?a.callback=n:a.values=n),pt(this.attributeOption,t,a)}},r.prototype.initAttributes=function(){var t=this,e=this,n=e.attributes,a=e.attributeOption,o=e.theme,s=e.shapeType;this.groupScales=[];var l={},h=function(f){if(a.hasOwnProperty(f)){var v=a[f];if(!v)return{value:void 0};var p=w({},v),g=p.callback,d=p.values,y=p.fields,C=y===void 0?[]:y,m=C.map(function(S){var b=t.scales[S];if(!l[S]&&Ar.includes(f)){var A=Ff(b,T(t.scaleDefs,S),f,t.type);A==="cat"&&(t.groupScales.push(b),l[S]=!0)}return b});p.scales=m,f!=="position"&&m.length===1&&m[0].type==="identity"?p.values=m[0].values:!g&&!d&&(f==="size"?p.values=o.sizes:f==="shape"?p.values=o.shapes[s]||[]:f==="color"&&(m.length?p.values=m[0].values.length<=10?o.colors10:o.colors20:p.values=o.colors10));var x=lf(f);n[f]=new x(p)}};for(var u in a){var c=h(u);if(typeof c=="object")return c.value}},r.prototype.processData=function(t){var e,n;this.hasSorted=!1;for(var a=this.getAttribute("position").scales,o=a.filter(function(A){return A.isCategory}),s=this.groupData(t),l=[],h=0,u=s.length;h<u;h++){for(var c=s[h],f=[],v=0,p=c.length;v<p;v++){var g=c[v],d={};for(var y in g)d[y]=g[y];d[Z]=g;try{for(var C=(e=void 0,$(o)),m=C.next();!m.done;m=C.next()){var x=m.value,S=x.field;d[S]=x.translate(d[S])}}catch(A){e={error:A}}finally{try{m&&!m.done&&(n=C.return)&&n.call(C)}finally{if(e)throw e.error}}f.push(d)}l.push(f)}var b=this.adjustData(l);return this.beforeMappingData=b,b},r.prototype.adjustData=function(t){var e=this.adjustOption,n=this,a=n.intervalPadding,o=n.dodgePadding,s=n.theme,l=this.maxColumnWidth||s.maxColumnWidth,h=this.minColumnWidth||s.minColumnWidth,u=this.columnWidthRatio||s.columnWidthRatio,c=t;if(e){var f=this.getXScale(),v=this.getYScale(),p=f.field,g=v?v.field:null,d=_i(this.coordinate),y=f.values.length,C=this.getAttribute("size"),m=void 0;C&&(m=C.values[0]);for(var x=0,S=e.length;x<S;x++){var b=e[x],A=w({xField:p,yField:g,intervalPadding:a,dodgePadding:o,xDimensionLength:d,groupNum:y,defaultSize:m,maxColumnWidth:l,minColumnWidth:h,columnWidthRatio:u},b),L=b.type;if(L==="dodge"){var k=[];if(f.isCategory||f.type==="identity")k.push("x");else if(!v)k.push("y");else throw new Error("dodge is not support linear attribute, please use category attribute!");A.adjustNames=k,A.dodgeRatio=u}else if(L==="stack"){var B=this.coordinate;if(!v){A.height=B.getHeight();var O=this.getDefaultValue("size")||3;A.size=O}!B.isTransposed&&I(A.reverseOrder)&&(A.reverseOrder=!0)}var R=Hc(L);A.dimValuesMap={},f&&f.values&&(A.dimValuesMap[f.field]=f.values.map(function(z){return f.translate(z)}));var H=new R(A);c=H.process(c),this.adjusts[L]=H}}return c},r.prototype.groupData=function(t){for(var e=this.getGroupScales(),n=this.scaleDefs,a={},o=[],s=0;s<e.length;s++){var l=e[s],h=l.field;o.push(h),T(n,[h,"values"])&&(a[h]=n[h].values)}return Bw(t,o,a)},r.prototype.updateStackRange=function(t,e){for(var n=$t(e),a=t.field,o=t.min,s=t.max,l=0;l<n.length;l++){var h=n[l],u=Math.min.apply(null,h[a]),c=Math.max.apply(null,h[a]);u<o&&(o=u),c>s&&(s=c)}var f=this.scaleDefs,v={};o<t.min&&!T(f,[a,"min"])&&(v.min=o),s>t.max&&!T(f,[a,"max"])&&(v.max=s),t.change(v)},r.prototype.beforeMapping=function(t){var e=t;if(this.sortable&&this.sort(e),this.generatePoints)for(var n=0,a=e.length;n<a;n++){var o=e[n];this.generateShapePoints(o);var s=e[n+1];s&&(this.generateShapePoints(s),o[0].nextPoints=s[0].points)}return e},r.prototype.generateShapePoints=function(t){for(var e=this.getShapeFactory(),n=this.getAttribute("shape"),a=0;a<t.length;a++){var o=t[a],s=this.createShapePointsCfg(o),l=n?this.getAttributeValues(n,o):null,h=e.getShapePoints(l,s);o.points=h}},r.prototype.normalizeValues=function(t,e){var n=[];if(P(t))for(var a=0;a<t.length;a++){var o=t[a];n.push(e.scale(o))}else n=e.scale(t);return n},r.prototype.mapping=function(t){for(var e=this.attributes,n=[],a=0;a<t.length;a++){var o=t[a],s={_origin:o[Z],points:o.points,nextPoints:o.nextPoints};for(var l in e)if(e.hasOwnProperty(l)){var h=e[l],u=h.names,c=this.getAttributeValues(h,o);if(u.length>1)for(var f=0;f<c.length;f+=1){var v=c[f],p=u[f];s[p]=P(v)&&v.length===1?v[0]:v}else s[u[0]]=c.length===1?c[0]:c}this.convertPoint(s),n.push(s)}return n},r.prototype.convertPoint=function(t){var e=t.x,n=t.y,a,o,s,l=this.coordinate;if(P(e)&&P(n)){a=[],o=[];for(var h=0,u=0,c=e.length,f=n.length;h<c&&u<f;h+=1,u+=1)s=l.convert({x:e[h],y:n[u]}),a.push(s.x),o.push(s.y)}else if(P(n)){o=[];for(var v=0;v<n.length;v++){var p=n[v];s=l.convert({x:e,y:p}),a&&a!==s.x?(P(a)||(a=[a]),a.push(s.x)):a=s.x,o.push(s.y)}}else if(P(e)){a=[];for(var v=0;v<e.length;v++){var g=e[v];s=l.convert({x:g,y:n}),o&&o!==s.y?(P(o)||(o=[o]),o.push(s.y)):o=s.y,a.push(s.x)}}else{var d=l.convert({x:e,y:n});a=d.x,o=d.y}t.x=a,t.y=o},r.prototype.getStyleCfg=function(t,e){var n=t.fields,a=n===void 0?[]:n,o=t.callback,s=t.cfg;if(s)return s;var l=a.map(function(h){return e[h]});return o.apply(void 0,et([],Y(l),!1))},r.prototype.setCfg=function(t){var e=this,n=t.coordinate,a=t.data,o=t.theme,s=t.scaleDefs;n&&(this.coordinate=n),a&&(this.data=a),s&&(this.scaleDefs=s,this.idFields=[],M(s,function(l,h){l&&l.key&&e.idFields.push(h)})),o&&(this.theme=this.userTheme?D({},o,this.userTheme):o)},r.prototype.renderLabels=function(t,e){return e===void 0&&(e=!1),xi(this,void 0,void 0,function(){var n,a,o,s,l,h,u,c,f,v,p,g,d=this;return wi(this,function(y){switch(y.label){case 0:return n=this.geometryLabel,this.emit(Ne.BEFORE_RENDER_LABEL),n||(a=this.getLabelType(),o=Aw(a),n=new o(this),this.geometryLabel=n),[4,n.render(t,e)];case 1:y.sent(),s=n.labelsRenderer.shapesMap,l=new Map,M(s,function(C,m){for(var x=C.getChildren()||[],S=0;S<x.length;S++){var b=x[S],A=d.elementsMap[b.get("elementId")||m.split(" ")[0]];if(A){b.cfg.name=["element","label"],b.cfg.element=A;var L=l.get(A)||new Set;L.add(C),l.set(A,L)}}});try{for(h=$(l.entries()),u=h.next();!u.done;u=h.next())c=Y(u.value,2),f=c[0],v=c[1],f.labelShape=et([],Y(v),!1)}catch(C){p={error:C}}finally{try{u&&!u.done&&(g=h.return)&&g.call(h)}finally{if(p)throw p.error}}return this.emit(Ne.AFTER_RENDER_LABEL),[2]}})})},r.prototype.canDoGroupAnimation=function(t){return!t&&this.animateOption&&(T(this.animateOption,"appear")===void 0||T(this.animateOption,"appear")&&T(this.animateOption,["appear","animation"])===void 0)},r}(ns),lv=ct;function Ia(i,r,t){var e=lv(i.getMatrix(),[["t",r,t]]);i.setMatrix(e)}function kw(i,r){var t=i.attr(),e=t.x,n=t.y,a=lv(i.getMatrix(),[["t",-e,-n],["r",r],["t",e,n]]);return a}function hv(i,r){var t=kw(i,r);i.setMatrix(t)}function je(i){return i.find(function(r){return r.get("type")==="text"})}function uv(i,r,t){t===void 0&&(t=[0,0,0,0]);var e=i&&i.getChildren()[0];if(e){var n=e.clone();r!=null&&r.rotate&&hv(n,-r.rotate);var a=n.getCanvasBBox(),o=a.x,s=a.y,l=a.width,h=a.height;n.destroy();var u=t;return I(u)?u=[2,2,2,2]:U(u)&&(u=new Array(4).fill(u)),{x:o-u[3],y:s-u[0],width:l+u[1]+u[3],height:h+u[0]+u[2],rotation:(r==null?void 0:r.rotate)||0}}return{x:0,y:0,width:0,height:0,rotation:0}}function Iw(i,r,t){t===void 0&&(t=0);var e=Math.max(0,Math.min(i.x+i.width+t,r.x+r.width+t)-Math.max(i.x-t,r.x-t)),n=Math.max(0,Math.min(i.y+i.height+t,r.y+r.height+t)-Math.max(i.y-t,r.y-t));return e*n}function Pw(i,r){var t=i.getBBox();return ea(r,function(e){var n=e.getBBox();return Iw(t,n,2)>0})}function cv(i,r,t){var e=t.data,n=t.origin,a=t.animateCfg,o=t.coordinate,s=T(a,"update");i.set("data",e),i.set("origin",n),i.set("animateCfg",a),i.set("coordinate",o),i.set("visible",r.get("visible")),(i.getChildren()||[]).forEach(function(l,h){var u=r.getChildByIndex(h);if(!u)i.removeChild(l),l.remove(!0);else{l.set("data",e),l.set("origin",n),l.set("animateCfg",a),l.set("coordinate",o);var c=Pf(l,u);s?Fr(l,s,{toAttrs:c,coordinate:o}):l.attr(c),u.isGroup()&&cv(l,u,t)}}),M(r.getChildren(),function(l,h){h>=i.getCount()&&(l.destroyed||i.add(l))})}var Fw=function(){function i(r){this.shapesMap={};var t=r.layout,e=r.container;this.layout=t,this.container=e}return i.prototype.render=function(r,t,e){return e===void 0&&(e=!1),xi(this,void 0,void 0,function(){var n,a,o,s,l,h,u,c,f=this;return wi(this,function(v){switch(v.label){case 0:if(n={},a=this.createOffscreenGroup(),!r.length)return[3,2];try{for(o=$(r),s=o.next();!s.done;s=o.next())l=s.value,l&&(n[l.id]=this.renderLabel(l,a))}catch(p){u={error:p}}finally{try{s&&!s.done&&(c=o.return)&&c.call(o)}finally{if(u)throw u.error}}return[4,this.doLayout(r,t,n)];case 1:v.sent(),this.renderLabelLine(r,n),this.renderLabelBackground(r,n),this.adjustLabel(r,n),v.label=2;case 2:return h=this.shapesMap,M(n,function(p,g){if(p.destroyed)delete n[g];else{if(h[g]){var d=p.get("data"),y=p.get("origin"),C=p.get("coordinate"),m=p.get("animateCfg"),x=h[g];cv(x,n[g],{data:d,origin:y,animateCfg:m,coordinate:C}),n[g]=x}else{if(f.container.destroyed)return;f.container.add(p);var S=T(p.get("animateCfg"),e?"enter":"appear");S&&Fr(p,S,{toAttrs:w({},p.attr()),coordinate:p.get("coordinate")})}delete h[g]}}),M(h,function(p){var g=T(p.get("animateCfg"),"leave");g?Fr(p,g,{toAttrs:null,coordinate:p.get("coordinate")}):p.remove(!0)}),this.shapesMap=n,a.destroy(),[2]}})})},i.prototype.clear=function(){this.container.clear(),this.shapesMap={}},i.prototype.destroy=function(){this.container.destroy(),this.shapesMap=null},i.prototype.renderLabel=function(r,t){var e=r.id,n=r.elementId,a=r.data,o=r.mappingData,s=r.coordinate,l=r.animate,h=r.content,u=r.capture,c={id:e,elementId:n,capture:u,data:a,origin:w(w({},o),{data:o[Z]}),coordinate:s},f=t.addGroup(w({name:"label",animateCfg:this.animate===!1||l===null||l===!1?!1:D({},this.animate,l)},c)),v;if(h.isGroup&&h.isGroup()||h.isShape&&h.isShape()){var p=h.getCanvasBBox(),g=p.width,d=p.height,y=T(r,"textAlign","left"),C=r.x,m=r.y-d/2;y==="center"?C=C-g/2:(y==="right"||y==="end")&&(C=C-g),Ia(h,C,m),v=h,f.add(h)}else{var x=T(r,["style","fill"]);v=f.addShape("text",w({attrs:w(w({x:r.x,y:r.y,textAlign:r.textAlign,textBaseline:T(r,"textBaseline","middle"),text:r.content},r.style),{fill:dp(x)?r.color:x})},c))}return r.rotate&&hv(v,r.rotate),f},i.prototype.doLayout=function(r,t,e){return xi(this,void 0,void 0,function(){var n,a=this;return wi(this,function(o){switch(o.label){case 0:return this.layout?(n=P(this.layout)?this.layout:[this.layout],[4,Promise.all(n.map(function(s){var l=Tw(T(s,"type",""));if(!!l){var h=[],u=[];return M(e,function(c,f){h.push(c),u.push(t[c.get("elementId")])}),l(r,h,u,a.region,s.cfg)}}))]):[3,2];case 1:o.sent(),o.label=2;case 2:return[2]}})})},i.prototype.renderLabelLine=function(r,t){M(r,function(e){var n=T(e,"coordinate");if(!(!e||!n)){var a=n.getCenter(),o=n.getRadius();if(!!e.labelLine){var s=T(e,"labelLine",{}),l=e.id,h=s.path;if(!h){var u=ft(a.x,a.y,o,e.angle);h=[["M",u.x,u.y],["L",e.x,e.y]]}var c=t[l];c.destroyed||c.addShape("path",{capture:!1,attrs:w({path:h,stroke:e.color?e.color:T(e,["style","fill"],"#000"),fill:null},s.style),id:l,origin:e.mappingData,data:e.data,coordinate:e.coordinate})}}})},i.prototype.renderLabelBackground=function(r,t){M(r,function(e){var n=T(e,"coordinate"),a=T(e,"background");if(!(!a||!n)){var o=e.id,s=t[o];if(!s.destroyed){var l=s.getChildren()[0];if(l){var h=uv(s,e,a.padding),u=h.rotation,c=mt(h,["rotation"]),f=s.addShape("rect",{attrs:w(w({},c),a.style||{}),id:o,origin:e.mappingData,data:e.data,coordinate:e.coordinate});if(f.setZIndex(-1),u){var v=l.getMatrix();f.setMatrix(v)}}}}})},i.prototype.createOffscreenGroup=function(){var r=this.container,t=r.getGroupBase(),e=new t({});return e},i.prototype.adjustLabel=function(r,t){M(r,function(e){if(e){var n=e.id,a=t[n];if(!a.destroyed){var o=a.findAll(function(s){return s.get("type")!=="path"});M(o,function(s){s&&(e.offsetX&&s.attr("x",s.attr("x")+e.offsetX),e.offsetY&&s.attr("y",s.attr("y")+e.offsetY))})}}})},i}();function jh(i){var r=0;return M(i,function(t){r+=t}),r/i.length}var Ds=function(){function i(r){this.geometry=r}return i.prototype.getLabelItems=function(r){var t=this,e=[],n=this.getLabelCfgs(r);return M(r,function(a,o){var s=n[o];if(!s||I(a.x)||I(a.y)){e.push(null);return}var l=P(s.content)?s.content:[s.content];s.content=l;var h=l.length;M(l,function(u,c){if(I(u)||u===""){e.push(null);return}var f=w(w({},s),t.getLabelPoint(s,a,c));f.textAlign||(f.textAlign=t.getLabelAlign(f,c,h)),f.offset<=0&&(f.labelLine=null),e.push(f)})}),e},i.prototype.render=function(r,t){return t===void 0&&(t=!1),xi(this,void 0,void 0,function(){var e,n,a;return wi(this,function(o){switch(o.label){case 0:return e=this.getLabelItems(r),n=this.getLabelsRenderer(),a=this.getGeometryShapes(),[4,n.render(e,a,t)];case 1:return o.sent(),[2]}})})},i.prototype.clear=function(){var r=this.labelsRenderer;r&&r.clear()},i.prototype.destroy=function(){var r=this.labelsRenderer;r&&r.destroy(),this.labelsRenderer=null},i.prototype.getCoordinate=function(){return this.geometry.coordinate},i.prototype.getDefaultLabelCfg=function(r,t){var e=this.geometry,n=e.type,a=e.theme;return n==="polygon"||n==="interval"&&t==="middle"||r<0&&!["line","point","path"].includes(n)?T(a,"innerLabels",{}):T(a,"labels",{})},i.prototype.getThemedLabelCfg=function(r){var t=this.geometry,e=this.getDefaultLabelCfg(),n=t.type,a=t.theme,o;return n==="polygon"||r.offset<0&&!["line","point","path"].includes(n)?o=D({},e,a.innerLabels,r):o=D({},e,a.labels,r),o},i.prototype.setLabelPosition=function(r,t,e,n){},i.prototype.getLabelOffset=function(r){var t=this.getCoordinate(),e=this.getOffsetVector(r);return t.isTransposed?e[0]:e[1]},i.prototype.getLabelOffsetPoint=function(r,t,e){var n=r.offset,a=this.getCoordinate(),o=a.isTransposed,s=o?"x":"y",l=o?1:-1,h={x:0,y:0};return t>0||e===1?h[s]=n*l:h[s]=n*l*-1,h},i.prototype.getLabelPoint=function(r,t,e){var n=this.getCoordinate(),a=r.content.length;function o(d,y,C){C===void 0&&(C=!1);var m=d;return P(m)&&(r.content.length===1?C?m=jh(m):m.length<=2?m=m[d.length-1]:m=jh(m):m=m[y]),m}var s={content:r.content[e],x:0,y:0,start:{x:0,y:0},color:"#fff"},l=P(t.shape)?t.shape[0]:t.shape,h=l==="funnel"||l==="pyramid";if(this.geometry.type==="polygon"){var u=mx(t.x,t.y);s.x=u[0],s.y=u[1]}else this.geometry.type==="interval"&&!h?(s.x=o(t.x,e,!0),s.y=o(t.y,e)):(s.x=o(t.x,e),s.y=o(t.y,e));if(h){var c=T(t,"nextPoints"),f=T(t,"points");if(c){var v=n.convert(f[1]),p=n.convert(c[1]);s.x=(v.x+p.x)/2,s.y=(v.y+p.y)/2}else if(l==="pyramid"){var v=n.convert(f[1]),p=n.convert(f[2]);s.x=(v.x+p.x)/2,s.y=(v.y+p.y)/2}}r.position&&this.setLabelPosition(s,t,e,r.position);var g=this.getLabelOffsetPoint(r,e,a);return s.start={x:s.x,y:s.y},s.x+=g.x,s.y+=g.y,s.color=t.color,s},i.prototype.getLabelAlign=function(r,t,e){var n="center",a=this.getCoordinate();if(a.isTransposed){var o=r.offset;o<0?n="right":o===0?n="center":n="left",e>1&&t===0&&(n==="right"?n="left":n==="left"&&(n="right"))}return n},i.prototype.getLabelId=function(r){var t=this.geometry,e=t.type,n=t.getXScale(),a=t.getYScale(),o=r[Z],s=t.getElementId(r);return e==="line"||e==="area"?s+=" ".concat(o[n.field]):e==="path"&&(s+=" ".concat(o[n.field],"-").concat(o[a.field])),s},i.prototype.getLabelsRenderer=function(){var r=this.geometry,t=r.labelsContainer,e=r.labelOption,n=r.canvasRegion,a=r.animateOption,o=this.geometry.coordinate,s=this.labelsRenderer;return s||(s=new Fw({container:t,layout:T(e,["cfg","layout"],{type:this.defaultLayout})}),this.labelsRenderer=s),s.region=n,s.animate=a?rv("label",o):!1,s},i.prototype.getLabelCfgs=function(r){var t=this,e=this.geometry,n=e.labelOption,a=e.scales,o=e.coordinate,s=n,l=s.fields,h=s.callback,u=s.cfg,c=l.map(function(v){return a[v]}),f=[];return M(r,function(v,p){var g=v[Z],d=t.getLabelText(g,c),y;if(h){var C=l.map(function(A){return g[A]});if(y=h.apply(void 0,et([],Y(C),!1)),I(y)){f.push(null);return}}var m=w(w({id:t.getLabelId(v),elementId:t.geometry.getElementId(v),data:g,mappingData:v,coordinate:o},u),y);G(m.position)&&(m.position=m.position(g,v,p));var x=t.getLabelOffset(m.offset||0),S=t.getDefaultLabelCfg(x,m.position);m=D({},S,m),m.offset=t.getLabelOffset(m.offset||0);var b=m.content;G(b)?m.content=b(g,v,p):br(b)&&(m.content=d[0]),f.push(m)}),f},i.prototype.getLabelText=function(r,t){var e=[];return M(t,function(n){var a=r[n.field];P(a)?a=a.map(function(o){return n.getText(o)}):a=n.getText(a),I(a)||a===""?e.push(null):e.push(a)}),e},i.prototype.getOffsetVector=function(r){r===void 0&&(r=0);var t=this.getCoordinate(),e=0;return U(r)&&(e=r),t.isTransposed?t.applyMatrix(e,0):t.applyMatrix(0,e)},i.prototype.getGeometryShapes=function(){var r=this.geometry,t={};return M(r.elementsMap,function(e,n){t[n]=e.shape}),M(r.getOffscreenGroup().getChildren(),function(e){var n=r.getElementId(e.get("origin").mappingData);t[n]=e}),t},i}();function Uh(i,r,t){if(!i)return t;var e;if(i.callback&&i.callback.length>1){var n=Array(i.callback.length-1).fill("");e=i.mapping.apply(i,et([r],Y(n),!1)).join("")}else e=i.mapping(r).join("");return e||t}var pr={hexagon:function(i,r,t){var e=t/2*Math.sqrt(3);return[["M",i,r-t],["L",i+e,r-t/2],["L",i+e,r+t/2],["L",i,r+t],["L",i-e,r+t/2],["L",i-e,r-t/2],["Z"]]},bowtie:function(i,r,t){var e=t-1.5;return[["M",i-t,r-e],["L",i+t,r+e],["L",i+t,r-e],["L",i-t,r+e],["Z"]]},cross:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r+t],["M",i+t,r-t],["L",i-t,r+t]]},tick:function(i,r,t){return[["M",i-t/2,r-t],["L",i+t/2,r-t],["M",i,r-t],["L",i,r+t],["M",i-t/2,r+t],["L",i+t/2,r+t]]},plus:function(i,r,t){return[["M",i-t,r],["L",i+t,r],["M",i,r-t],["L",i,r+t]]},hyphen:function(i,r,t){return[["M",i-t,r],["L",i+t,r]]},line:function(i,r,t){return[["M",i,r-t],["L",i,r+t]]}},Ow=["line","cross","tick","plus","hyphen"];function Dw(i,r){return G(r)?r(i):D({},i,r)}function Rw(i,r){var t=i.symbol;if(N(t)&&Ow.indexOf(t)!==-1){var e=T(i,"style",{}),n=T(e,"lineWidth",1),a=e.stroke||e.fill||r;i.style=D({},i.style,{lineWidth:n,stroke:a,fill:null})}}function fv(i){var r=i.symbol;N(r)&&pr[r]&&(i.symbol=pr[r])}function io(i){return i.startsWith(F.LEFT)||i.startsWith(F.RIGHT)?"vertical":"horizontal"}function Yw(i,r,t,e,n){var a=t.getScale(t.type);if(a.isCategory){var o=a.field,s=r.getAttribute("color"),l=r.getAttribute("shape"),h=i.getTheme().defaultColor,u=r.coordinate.isPolar;return a.getTicks().map(function(c,f){var v,p=c.text,g=c.value,d=p,y=a.invert(g),C=i.filterFieldData(o,[(v={},v[o]=y,v)]).length===0;M(i.views,function(A){var L;A.filterFieldData(o,[(L={},L[o]=y,L)]).length||(C=!0)});var m=Uh(s,y,h),x=Uh(l,y,"point"),S=r.getShapeMarker(x,{color:m,isInPolar:u}),b=n;return G(b)&&(b=b(d,f,w({name:d,value:y},D({},e,S)))),S=D({},e,S,Ft(w({},b),["style"])),Rw(S,m),b&&b.style&&(S.style=Dw(S.style,b.style)),fv(S),{id:y,name:d,value:y,marker:S,unchecked:C}})}return[]}function Gw(i,r,t){return t.map(function(e,n){var a=r;G(a)&&(a=a(e.name,n,D({},i,e)));var o=G(e.marker)?e.marker(e.name,n,D({},i,e)):e.marker,s=D({},i,a,o);return fv(s),e.marker=s,e})}function qh(i,r){var t=T(i,["components","legend"],{});return D({},T(t,["common"],{}),D({},T(t,[r],{})))}function no(i){return i?!1:i==null||isNaN(i)}function Zh(i){if(P(i))return no(i[1].y);var r=i.y;return P(r)?no(r[0]):no(r)}function Rs(i,r,t){if(r===void 0&&(r=!1),t===void 0&&(t=!0),!i.length||i.length===1&&!t)return[];if(r){for(var e=[],n=0,a=i.length;n<a;n++){var o=i[n];Zh(o)||e.push(o)}return[e]}for(var s=[],l=[],n=0,a=i.length;n<a;n++){var o=i[n];Zh(o)?l.length&&(l.length===1&&!t||s.push(l),l=[]):l.push(o)}return l.length&&s.push(l),s}function vv(i){for(var r=[],t=0;t<i.length;t++){var e=i[t];if(e){var n=t===0?"M":"L";r.push([n,e.x,e.y])}}var a=i[0];return a&&(r.push(["L",a.x,a.y]),r.push(["z"])),r}function pv(i){for(var r=i.length/2,t=[],e=[],n=0;n<i.length;n++)n<r?t.push(i[n]):e.push(i[n]);var a=Un(t,!1),o=Un(e,!1);e.length&&a.push(["L",e[0].x,e[0].y]),o.shift();var s=a.concat(o);return t.length&&s.push(["L",t[0].x,t[0].y]),s.push(["z"]),s}function lt(i,r,t,e){e===void 0&&(e="");var n=i.style,a=n===void 0?{}:n,o=i.defaultStyle,s=i.color,l=i.size,h=w(w({},o),a);return s&&(r&&(a.stroke||(h.stroke=s)),t&&(a.fill||(h.fill=s))),e&&I(a[e])&&!I(l)&&(h[e]=l),h}function gv(i){return D({},{fill:"#CCD6EC",fillOpacity:.3},T(i,["background","style"]))}function Ys(i){var r=i.x,t=P(i.y)?i.y:[i.y];return t.map(function(e,n){return{x:P(r)?r[n]:r,y:e}})}var Hw={line:function(i,r,t){return[["M",i-t,r],["L",i+t,r]]},dot:function(i,r,t){return[["M",i-t,r],["L",i+t,r]]},dash:function(i,r,t){return[["M",i-t,r],["L",i+t,r]]},smooth:function(i,r,t){return[["M",i-t,r],["A",t/2,t/2,0,1,1,i,r],["A",t/2,t/2,0,1,0,i+t,r]]},hv:function(i,r,t){return[["M",i-t-1,r-2.5],["L",i,r-2.5],["L",i,r+2.5],["L",i+t+1,r+2.5]]},vh:function(i,r,t){return[["M",i-t-1,r+2.5],["L",i,r+2.5],["L",i,r-2.5],["L",i+t+1,r-2.5]]},hvh:function(i,r,t){return[["M",i-(t+1),r+2.5],["L",i-t/2,r+2.5],["L",i-t/2,r-2.5],["L",i+t/2,r-2.5],["L",i+t/2,r+2.5],["L",i+t+1,r+2.5]]},vhv:function(i,r){return[["M",i-5,r+2.5],["L",i-5,r],["L",i,r],["L",i,r-3],["L",i,r+3],["L",i+6.5,r+3]]}};function dv(i,r){var t=i.color;return{symbol:Hw[r],style:{lineWidth:2,r:6,stroke:t}}}function Vw(i,r,t){for(var e=i.isStack,n=i.connectNulls,a=i.isInCircle,o=i.showSinglePoint,s=lt(i,!0,!1,"lineWidth"),l=Rs(i.points,n,o),h=[],u=0,c=l.length;u<c;u++){var f=l[u];h=h.concat(Xw(f,a,e,r,t,s))}return s.path=h,s}function $o(i,r,t,e,n){if(i.length===1)return[["M",i[0].x,i[0].y-n.lineWidth/2],["L",i[0].x,i[0].y],["L",i[0].x,i[0].y+n.lineWidth/2]];var a;return t?(r&&i.length&&i.push({x:i[0].x,y:i[0].y}),a=Un(i,!1,e)):(a=ji(i,!1),r&&a.push(["Z"])),a}function Nw(i,r,t,e,n,a){var o=[],s=[];M(i,function(u){var c=Ys(u);o.push(c[1]),s.push(c[0])});var l=$o(o,r,e,n,a),h=$o(s,r,e,n,a);return t?l:l.concat(h)}function Xw(i,r,t,e,n,a){if(i.length){var o=i[0];return P(o.y)?Nw(i,r,t,e,n,a):$o(i,r,e,n,a)}return[]}Ze("line",{defaultShapeType:"line"});M(["line","dot","dash","smooth"],function(i){J("line",i,{draw:function(r,t){var e=i==="smooth",n;if(e){var a=this.coordinate,o=a.start,s=a.end;n=[[o.x,s.y],[s.x,o.y]]}var l=Vw(r,e,n),h=t.addShape({type:"path",attrs:l,name:"line",capture:!e});return h},getMarker:function(r){return dv(r,i)}})});var ke={100:"#000",95:"#0D0D0D",85:"#262626",65:"#595959",45:"#8C8C8C",25:"#BFBFBF",15:"#D9D9D9",6:"#F0F0F0"},q={100:"#FFFFFF",95:"#F2F2F2",85:"#D9D9D9",65:"#A6A6A6",45:"#737373",25:"#404040",15:"#262626",6:"#0F0F0F"},re=["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#E86452","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"],zw=["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#E86452","#F8D0CB","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"],Ww=["#B8E1FF","#9AC5FF","#7DAAFF","#5B8FF9","#3D76DD","#085EC0","#0047A5","#00318A","#001D70"],$w=function(i){i===void 0&&(i={});var r=i.paletteQualitative10,t=r===void 0?re:r,e=i.paletteQualitative20,n=e===void 0?zw:e,a=i.brandColor,o=a===void 0?t[0]:a,s={backgroundColor:"#141414",brandColor:o,subColor:"rgba(255,255,255,0.05)",paletteQualitative10:t,paletteQualitative20:n,paletteSemanticRed:"#F4664A",paletteSemanticGreen:"#30BF78",paletteSemanticYellow:"#FAAD14",paletteSequence:Ww,fontFamily:`"Segoe UI", Roboto, "Helvetica Neue", Arial,
"Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji"`,axisLineBorderColor:q[25],axisLineBorder:1,axisLineDash:null,axisTitleTextFillColor:q[65],axisTitleTextFontSize:12,axisTitleTextLineHeight:12,axisTitleTextFontWeight:"normal",axisTitleSpacing:12,axisDescriptionIconFillColor:ke[85],axisTickLineBorderColor:q[25],axisTickLineLength:4,axisTickLineBorder:1,axisSubTickLineBorderColor:q[15],axisSubTickLineLength:2,axisSubTickLineBorder:1,axisLabelFillColor:q[45],axisLabelFontSize:12,axisLabelLineHeight:12,axisLabelFontWeight:"normal",axisLabelOffset:8,axisGridBorderColor:q[15],axisGridBorder:1,axisGridLineDash:null,legendTitleTextFillColor:q[45],legendTitleTextFontSize:12,legendTitleTextLineHeight:21,legendTitleTextFontWeight:"normal",legendMarkerColor:re[0],legendMarkerSpacing:8,legendMarkerSize:4,legendCircleMarkerSize:4,legendSquareMarkerSize:4,legendLineMarkerSize:5,legendItemNameFillColor:q[65],legendItemNameFontSize:12,legendItemNameLineHeight:12,legendItemNameFontWeight:"normal",legendItemSpacing:24,legendItemMarginBottom:12,legendSpacing:16,legendPadding:[8,8,8,8],legendHorizontalPadding:[8,0,8,0],legendVerticalPadding:[0,8,0,8],legendPageNavigatorMarkerSize:12,legendPageNavigatorMarkerInactiveFillColor:q[45],legendPageNavigatorMarkerInactiveFillOpacity:.45,legendPageNavigatorMarkerFillColor:q[45],legendPageNavigatorMarkerFillOpacity:1,legendPageNavigatorTextFillColor:q[65],legendPageNavigatorTextFontSize:12,sliderRailFillColor:q[15],sliderRailBorder:0,sliderRailBorderColor:null,sliderRailWidth:100,sliderRailHeight:12,sliderLabelTextFillColor:q[45],sliderLabelTextFontSize:12,sliderLabelTextLineHeight:12,sliderLabelTextFontWeight:"normal",sliderHandlerFillColor:ke[6],sliderHandlerWidth:10,sliderHandlerHeight:14,sliderHandlerBorder:1,sliderHandlerBorderColor:ke[25],annotationArcBorderColor:q[15],annotationArcBorder:1,annotationLineBorderColor:q[25],annotationLineBorder:1,annotationLineDash:null,annotationTextFillColor:q[65],annotationTextFontSize:12,annotationTextLineHeight:12,annotationTextFontWeight:"normal",annotationTextBorderColor:null,annotationTextBorder:0,annotationRegionFillColor:q[100],annotationRegionFillOpacity:.06,annotationRegionBorder:0,annotationRegionBorderColor:null,annotationDataMarkerLineLength:16,tooltipCrosshairsBorderColor:q[25],tooltipCrosshairsBorder:1,tooltipCrosshairsLineDash:null,tooltipContainerFillColor:"#1f1f1f",tooltipContainerFillOpacity:.95,tooltipContainerShadow:"0px 2px 4px rgba(0,0,0,.5)",tooltipContainerBorderRadius:3,tooltipTextFillColor:q[65],tooltipTextFontSize:12,tooltipTextLineHeight:12,tooltipTextFontWeight:"bold",labelFillColor:q[65],labelFillColorDark:"#2c3542",labelFillColorLight:"#ffffff",labelFontSize:12,labelLineHeight:12,labelFontWeight:"normal",labelBorderColor:null,labelBorder:0,innerLabelFillColor:ke[100],innerLabelFontSize:12,innerLabelLineHeight:12,innerLabelFontWeight:"normal",innerLabelBorderColor:null,innerLabelBorder:0,overflowLabelFillColor:q[65],overflowLabelFillColorDark:"#2c3542",overflowLabelFillColorLight:"#ffffff",overflowLabelFontSize:12,overflowLabelLineHeight:12,overflowLabelFontWeight:"normal",overflowLabelBorderColor:ke[100],overflowLabelBorder:1,labelLineBorder:1,labelLineBorderColor:q[25],cSliderRailHieght:16,cSliderBackgroundFillColor:"#416180",cSliderBackgroundFillOpacity:.05,cSliderForegroundFillColor:"#5B8FF9",cSliderForegroundFillOpacity:.15,cSliderHandlerHeight:24,cSliderHandlerWidth:10,cSliderHandlerFillColor:"#F7F7F7",cSliderHandlerFillOpacity:1,cSliderHandlerHighlightFillColor:"#FFF",cSliderHandlerBorderColor:"#BFBFBF",cSliderHandlerBorder:1,cSliderHandlerBorderRadius:2,cSliderTextFillColor:"#fff",cSliderTextFillOpacity:.45,cSliderTextFontSize:12,cSliderTextLineHeight:12,cSliderTextFontWeight:"normal",cSliderTextBorderColor:null,cSliderTextBorder:0,scrollbarTrackFillColor:"rgba(255,255,255,0.65)",scrollbarThumbFillColor:"rgba(0,0,0,0.35)",scrollbarThumbHighlightFillColor:"rgba(0,0,0,0.45)",pointFillColor:re[0],pointFillOpacity:.95,pointSize:4,pointBorder:1,pointBorderColor:ke[100],pointBorderOpacity:1,pointActiveBorderColor:q[100],pointSelectedBorder:2,pointSelectedBorderColor:q[100],pointInactiveFillOpacity:.3,pointInactiveBorderOpacity:.3,hollowPointSize:4,hollowPointBorder:1,hollowPointBorderColor:re[0],hollowPointBorderOpacity:.95,hollowPointFillColor:ke[100],hollowPointActiveBorder:1,hollowPointActiveBorderColor:q[100],hollowPointActiveBorderOpacity:1,hollowPointSelectedBorder:2,hollowPointSelectedBorderColor:q[100],hollowPointSelectedBorderOpacity:1,hollowPointInactiveBorderOpacity:.3,lineBorder:2,lineBorderColor:re[0],lineBorderOpacity:1,lineActiveBorder:3,lineSelectedBorder:3,lineInactiveBorderOpacity:.3,areaFillColor:re[0],areaFillOpacity:.25,areaActiveFillColor:re[0],areaActiveFillOpacity:.5,areaSelectedFillColor:re[0],areaSelectedFillOpacity:.5,areaInactiveFillOpacity:.3,hollowAreaBorderColor:re[0],hollowAreaBorder:2,hollowAreaBorderOpacity:1,hollowAreaActiveBorder:3,hollowAreaActiveBorderColor:q[100],hollowAreaSelectedBorder:3,hollowAreaSelectedBorderColor:q[100],hollowAreaInactiveBorderOpacity:.3,intervalFillColor:re[0],intervalFillOpacity:.95,intervalActiveBorder:1,intervalActiveBorderColor:q[100],intervalActiveBorderOpacity:1,intervalSelectedBorder:2,intervalSelectedBorderColor:q[100],intervalSelectedBorderOpacity:1,intervalInactiveBorderOpacity:.3,intervalInactiveFillOpacity:.3,hollowIntervalBorder:2,hollowIntervalBorderColor:re[0],hollowIntervalBorderOpacity:1,hollowIntervalFillColor:ke[100],hollowIntervalActiveBorder:2,hollowIntervalActiveBorderColor:q[100],hollowIntervalSelectedBorder:3,hollowIntervalSelectedBorderColor:q[100],hollowIntervalSelectedBorderOpacity:1,hollowIntervalInactiveBorderOpacity:.3};return w(w({},s),i)},_w=$w();function jw(){return window?window.devicePixelRatio:1}function yv(i,r,t,e){var n=i-t,a=r-e;return Math.sqrt(n*n+a*a)}function nr(i,r,t,e,n,a){return n>=i&&n<=i+t&&a>=r&&a<=r+e}function Gi(i,r){return!(r.minX>i.maxX||r.maxX<i.minX||r.minY>i.maxY||r.maxY<i.minY)}function Uw(i,r){return!i||!r?i||r:{minX:Math.min(i.minX,r.minX),minY:Math.min(i.minY,r.minY),maxX:Math.max(i.maxX,r.maxX),maxY:Math.max(i.maxY,r.maxY)}}function Qh(i,r){return i[0]===r[0]&&i[1]===r[1]}var qw=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Zw=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Qw=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,mv=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function xv(i,r){var t=i.match(mv);M(t,function(e){var n=e.split(":");r.addColorStop(n[0],n[1])})}function Kw(i,r,t){var e=qw.exec(t),n=parseFloat(e[1])%360*(Math.PI/180),a=e[2],o=r.getBBox(),s,l;n>=0&&n<1/2*Math.PI?(s={x:o.minX,y:o.minY},l={x:o.maxX,y:o.maxY}):1/2*Math.PI<=n&&n<Math.PI?(s={x:o.maxX,y:o.minY},l={x:o.minX,y:o.maxY}):Math.PI<=n&&n<3/2*Math.PI?(s={x:o.maxX,y:o.maxY},l={x:o.minX,y:o.minY}):(s={x:o.minX,y:o.maxY},l={x:o.maxX,y:o.minY});var h=Math.tan(n),u=h*h,c=(l.x-s.x+h*(l.y-s.y))/(u+1)+s.x,f=h*(l.x-s.x+h*(l.y-s.y))/(u+1)+s.y,v=i.createLinearGradient(s.x,s.y,c,f);return xv(a,v),v}function Jw(i,r,t){var e=Zw.exec(t),n=parseFloat(e[1]),a=parseFloat(e[2]),o=parseFloat(e[3]),s=e[4];if(o===0){var l=s.match(mv);return l[l.length-1].split(":")[1]}var h=r.getBBox(),u=h.maxX-h.minX,c=h.maxY-h.minY,f=Math.sqrt(u*u+c*c)/2,v=i.createRadialGradient(h.minX+u*n,h.minY+c*a,0,h.minX+u/2,h.minY+c/2,o*f);return xv(s,v),v}function tC(i,r,t){if(r.get("patternSource")&&r.get("patternSource")===t)return r.get("pattern");var e,n,a=Qw.exec(t),o=a[1],s=a[2];function l(){e=i.createPattern(n,o),r.set("pattern",e),r.set("patternSource",t)}switch(o){case"a":o="repeat";break;case"x":o="repeat-x";break;case"y":o="repeat-y";break;case"n":o="no-repeat";break;default:o="no-repeat"}return n=new Image,s.match(/^data:/i)||(n.crossOrigin="Anonymous"),n.src=s,n.complete?l():(n.onload=l,n.src=n.src),e}function eC(i,r,t){var e=r.getBBox();if(isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))return t;if(N(t)){if(t[1]==="("||t[2]==="("){if(t[0]==="l")return Kw(i,r,t);if(t[0]==="r")return Jw(i,r,t);if(t[0]==="p")return tC(i,r,t)}return t}if(t instanceof CanvasPattern)return t}function rC(i){var r=0,t=0,e=0,n=0;return P(i)?i.length===1?r=t=e=n=i[0]:i.length===2?(r=e=i[0],t=n=i[1]):i.length===3?(r=i[0],t=n=i[1],e=i[2]):(r=i[0],t=i[1],e=i[2],n=i[3]):r=t=e=n=i,[r,t,e,n]}function vn(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function _o(i,r){return vn(i)*vn(r)?(i[0]*r[0]+i[1]*r[1])/(vn(i)*vn(r)):1}function Kh(i,r){return(i[0]*r[1]<i[1]*r[0]?-1:1)*Math.acos(_o(i,r))}function Zn(i,r){var t=r[1],e=r[2],n=Jo(ts(r[3]),Math.PI*2),a=r[4],o=r[5],s=i[0],l=i[1],h=r[6],u=r[7],c=Math.cos(n)*(s-h)/2+Math.sin(n)*(l-u)/2,f=-1*Math.sin(n)*(s-h)/2+Math.cos(n)*(l-u)/2,v=c*c/(t*t)+f*f/(e*e);v>1&&(t*=Math.sqrt(v),e*=Math.sqrt(v));var p=t*t*(f*f)+e*e*(c*c),g=p?Math.sqrt((t*t*(e*e)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var d=e?g*t*f/e:0,y=t?g*-e*c/t:0,C=(s+h)/2+Math.cos(n)*d-Math.sin(n)*y,m=(l+u)/2+Math.sin(n)*d+Math.cos(n)*y,x=[(c-d)/t,(f-y)/e],S=[(-1*c-d)/t,(-1*f-y)/e],b=Kh([1,0],x),A=Kh(x,S);return _o(x,S)<=-1&&(A=Math.PI),_o(x,S)>=1&&(A=0),o===0&&A>0&&(A=A-2*Math.PI),o===1&&A<0&&(A=A+2*Math.PI),{cx:C,cy:m,rx:Qh(i,[h,u])?0:t,ry:Qh(i,[h,u])?0:e,startAngle:b,endAngle:b+A,xRotation:n,arcFlag:a,sweepFlag:o}}var Qn=Math.sin,Kn=Math.cos,Gs=Math.atan2,pn=Math.PI;function wv(i,r,t,e,n,a,o){var s=r.stroke,l=r.lineWidth,h=t-n,u=e-a,c=Gs(u,h),f=new zs({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*Kn(pn/6)+","+10*Qn(pn/6)+" L0,0 L"+10*Kn(pn/6)+",-"+10*Qn(pn/6),stroke:s,lineWidth:l}});f.translate(n,a),f.rotateAtPoint(n,a,c),i.set(o?"startArrowShape":"endArrowShape",f)}function Cv(i,r,t,e,n,a,o){var s=r.startArrow,l=r.endArrow,h=r.stroke,u=r.lineWidth,c=o?s:l,f=c.d,v=c.fill,p=c.stroke,g=c.lineWidth,d=mt(c,["d","fill","stroke","lineWidth"]),y=t-n,C=e-a,m=Gs(C,y);f&&(n=n-Kn(m)*f,a=a-Qn(m)*f);var x=new zs({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:w(w({},d),{stroke:p||h,lineWidth:g||u,fill:v})});x.translate(n,a),x.rotateAtPoint(n,a,m),i.set(o?"startArrowShape":"endArrowShape",x)}function cr(i,r,t,e,n){var a=Gs(e-r,t-i);return{dx:Kn(a)*n,dy:Qn(a)*n}}function Hs(i,r,t,e,n,a){typeof r.startArrow=="object"?Cv(i,r,t,e,n,a,!0):r.startArrow?wv(i,r,t,e,n,a,!0):i.set("startArrowShape",null)}function Vs(i,r,t,e,n,a){typeof r.endArrow=="object"?Cv(i,r,t,e,n,a,!1):r.endArrow?wv(i,r,t,e,n,a,!1):i.set("startArrowShape",null)}var Jh={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function Nr(i,r){var t=r.attr();for(var e in t){var n=t[e],a=Jh[e]?Jh[e]:e;a==="matrix"&&n?i.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&i.setLineDash?P(n)&&i.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=eC(i,r,n):a==="globalAlpha"&&(n=n*i.globalAlpha),i[a]=n)}}function jo(i,r,t){for(var e=0;e<r.length;e++){var n=r[e];n.cfg.visible?n.draw(i,t):n.skipDraw()}}function iC(i,r,t){var e=i.get("refreshElements");M(e,function(n){if(n!==i)for(var a=n.cfg.parent;a&&a!==i&&!a.cfg.refresh;)a.cfg.refresh=!0,a=a.cfg.parent}),e[0]===i?Ns(r):Uo(r,t)}function Uo(i,r){for(var t=0;t<i.length;t++){var e=i[t];if(e.cfg.visible)if(e.cfg.hasChanged)e.cfg.refresh=!0,e.isGroup()&&Ns(e.cfg.children);else if(e.cfg.refresh)e.isGroup()&&Uo(e.cfg.children,r);else{var n=nC(e,r);e.cfg.refresh=n,n&&e.isGroup()&&Uo(e.cfg.children,r)}}}function Mv(i){for(var r=0;r<i.length;r++){var t=i[r];t.cfg.hasChanged=!1,t.isGroup()&&!t.destroyed&&Mv(t.cfg.children)}}function Ns(i,r){for(var t=0;t<i.length;t++){var e=i[t];e.cfg.refresh=!0,e.isGroup()&&Ns(e.get("children"))}}function nC(i,r){var t=i.cfg.cacheCanvasBBox,e=i.cfg.isInView&&t&&Gi(t,r);return e}function Sv(i,r,t,e){var n=t.path,a=t.startArrow,o=t.endArrow;if(!!n){var s=[0,0],l=[0,0],h={dx:0,dy:0};r.beginPath();for(var u=0;u<n.length;u++){var c=n[u],f=c[0];if(u===0&&a&&a.d){var v=i.getStartTangent();h=cr(v[0][0],v[0][1],v[1][0],v[1][1],a.d)}else if(u===n.length-2&&n[u+1][0]==="Z"&&o&&o.d){var p=n[u+1];if(p[0]==="Z"){var v=i.getEndTangent();h=cr(v[0][0],v[0][1],v[1][0],v[1][1],o.d)}}else if(u===n.length-1&&o&&o.d&&n[0]!=="Z"){var v=i.getEndTangent();h=cr(v[0][0],v[0][1],v[1][0],v[1][1],o.d)}var g=h.dx,d=h.dy;switch(f){case"M":r.moveTo(c[1]-g,c[2]-d),l=[c[1],c[2]];break;case"L":r.lineTo(c[1]-g,c[2]-d);break;case"Q":r.quadraticCurveTo(c[1],c[2],c[3]-g,c[4]-d);break;case"C":r.bezierCurveTo(c[1],c[2],c[3],c[4],c[5]-g,c[6]-d);break;case"A":{var y=void 0;e?(y=e[u],y||(y=Zn(s,c),e[u]=y)):y=Zn(s,c);var C=y.cx,m=y.cy,x=y.rx,S=y.ry,b=y.startAngle,A=y.endAngle,L=y.xRotation,k=y.sweepFlag;if(r.ellipse)r.ellipse(C,m,x,S,L,b,A,1-k);else{var B=x>S?x:S,O=x>S?1:x/S,R=x>S?S/x:1;r.translate(C,m),r.rotate(L),r.scale(O,R),r.arc(0,0,B,b,A,1-k),r.scale(1/O,1/R),r.rotate(-L),r.translate(-C,-m)}break}case"Z":r.closePath();break}if(f==="Z")s=l;else{var H=c.length;s=[c[H-2],c[H-1]]}}}}function bv(i,r){var t=i.get("canvas");t&&(r==="remove"&&(i._cacheCanvasBBox=i.get("cacheCanvasBBox")),i.get("hasChanged")||(i.set("hasChanged",!0),i.cfg.parent&&i.cfg.parent.get("hasChanged")||(t.refreshElement(i,r,t),t.get("autoDraw")&&t.draw())))}function aC(i){var r;if(i.destroyed)r=i._cacheCanvasBBox;else{var t=i.get("cacheCanvasBBox"),e=t&&!!(t.width&&t.height),n=i.getCanvasBBox(),a=n&&!!(n.width&&n.height);e&&a?r=Uw(t,n):e?r=t:a&&(r=n)}return r}function oC(i){if(!i.length)return null;var r=[],t=[],e=[],n=[];return M(i,function(a){var o=aC(a);o&&(r.push(o.minX),t.push(o.minY),e.push(o.maxX),n.push(o.maxY))}),{minX:Yt(r),minY:Yt(t),maxX:Lt(e),maxY:Lt(n)}}function sC(i,r){return!i||!r||!Gi(i,r)?null:{minX:Math.max(i.minX,r.minX),minY:Math.max(i.minY,r.minY),maxX:Math.min(i.maxX,r.maxX),maxY:Math.min(i.maxY,r.maxY)}}var Xs=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.onCanvasChange=function(t){bv(this,t)},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return r},r.prototype._applyClip=function(t,e){e&&(t.save(),Nr(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},r.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,e=[],n=[];M(t,function(f){var v=f.cfg.cacheCanvasBBox;v&&f.cfg.isInView&&(e.push(v.minX,v.maxX),n.push(v.minY,v.maxY))});var a=null;if(e.length){var o=Yt(e),s=Lt(e),l=Yt(n),h=Lt(n);a={minX:o,minY:l,x:o,y:l,maxX:s,maxY:h,width:s-o,height:h-l};var u=this.cfg.canvas;if(u){var c=u.getViewRange();this.set("isInView",Gi(a,c))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},r.prototype.draw=function(t,e){var n=this.cfg.children,a=e?this.cfg.refresh:!0;n.length&&a&&(t.save(),Nr(t,this),this._applyClip(t,this.getClip()),jo(t,n,e),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},r.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},r}(ha),lC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return Xs},r.prototype.onCanvasChange=function(t){bv(this,t)},r.prototype.calculateBBox=function(){var t=this.get("type"),e=this.getHitLineWidth(),n=ca(t),a=n(this),o=e/2,s=a.x-o,l=a.y-o,h=a.x+a.width+o,u=a.y+a.height+o;return{x:s,minX:s,y:l,minY:l,width:a.width+e,height:a.height+e,maxX:h,maxY:u}},r.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},r.prototype.isStroke=function(){return!!this.attrs.stroke},r.prototype._applyClip=function(t,e){e&&(t.save(),Nr(t,e),e.createPath(t),t.restore(),t.clip(),e._afterDraw())},r.prototype.draw=function(t,e){var n=this.cfg.clipShape;if(e){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!Gi(e,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),Nr(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},r.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},r.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var e=this.getCanvasBBox(),n=Gi(e,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",e):this.set("cacheCanvasBBox",null)}},r.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},r.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},r.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},r.prototype.fill=function(t){t.fill()},r.prototype.stroke=function(t){t.stroke()},r.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,a=e.opacity,o=e.strokeOpacity,s=e.fillOpacity;this.isFill()&&(!I(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!I(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},r.prototype.createPath=function(t){},r.prototype.afterDrawPath=function(t){},r.prototype.isInShape=function(t,e){var n=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,e,n,a,o)},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){return!1},r.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},r}(ua);const oe=lC;var hC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,r:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=s.x,h=s.y,u=s.r,c=o/2,f=yv(l,h,t,e);return a&&n?f<=u+c:a?f<=u:n?f>=u-c&&f<=u+c:!1},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.r;t.beginPath(),t.arc(n,a,o,0,Math.PI*2,!1),t.closePath()},r}(oe);const uC=hC;function gn(i,r,t,e){return i/(t*t)+r/(e*e)}var cC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,rx:0,ry:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=o/2,h=s.x,u=s.y,c=s.rx,f=s.ry,v=(t-h)*(t-h),p=(e-u)*(e-u);return a&&n?gn(v,p,c+l,f+l)<=1:a?gn(v,p,c,f)<=1:n?gn(v,p,c-l,f-l)>=1&&gn(v,p,c+l,f+l)<=1:!1},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.rx,s=e.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,a,o,s,0,0,Math.PI*2,!1);else{var l=o>s?o:s,h=o>s?1:o/s,u=o>s?s/o:1;t.save(),t.translate(n,a),t.scale(h,u),t.arc(0,0,l,0,Math.PI*2),t.restore(),t.closePath()}},r}(oe);const fC=cC;function tu(i){return i instanceof HTMLElement&&N(i.nodeName)&&i.nodeName.toUpperCase()==="CANVAS"}var vC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0})},r.prototype.initAttrs=function(t){this._setImage(t.img)},r.prototype.isStroke=function(){return!1},r.prototype.isOnlyHitBox=function(){return!0},r.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},r.prototype._setImage=function(t){var e=this,n=this.attrs;if(N(t)){var a=new Image;a.onload=function(){if(e.destroyed)return!1;e.attr("img",a),e.set("loading",!1),e._afterLoading();var o=e.get("callback");o&&o.call(e)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):tu(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),t==="img"&&this._setImage(e)},r.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var e=this.attr(),n=e.x,a=e.y,o=e.width,s=e.height,l=e.sx,h=e.sy,u=e.swidth,c=e.sheight,f=e.img;(f instanceof Image||tu(f))&&(!I(l)&&!I(h)&&!I(u)&&!I(c)?t.drawImage(f,l,h,u,c,n,a,o,s):t.drawImage(f,n,a,o,s))},r}(oe);const pC=vC;function He(i,r,t,e,n,a,o){var s=Math.min(i,t),l=Math.max(i,t),h=Math.min(r,e),u=Math.max(r,e),c=n/2;return a>=s-c&&a<=l+c&&o>=h-c&&o<=u+c?wt.pointToLine(i,r,t,e,a,o)<=n/2:!1}var gC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},r.prototype.initAttrs=function(t){this.setArrow()},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),this.setArrow()},r.prototype.setArrow=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2,s=t.startArrow,l=t.endArrow;s&&Hs(this,t,a,o,e,n),l&&Vs(this,t,e,n,a,o)},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){if(!n||!o)return!1;var s=this.attr(),l=s.x1,h=s.y1,u=s.x2,c=s.y2;return He(l,h,u,c,o,t,e)},r.prototype.createPath=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.startArrow,h=e.endArrow,u={dx:0,dy:0},c={dx:0,dy:0};l&&l.d&&(u=cr(n,a,o,s,e.startArrow.d)),h&&h.d&&(c=cr(n,a,o,s,e.endArrow.d)),t.beginPath(),t.moveTo(n+u.dx,a+u.dy),t.lineTo(o-c.dx,s-c.dy)},r.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},r.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2;return wt.length(e,n,a,o)},r.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2;return wt.pointAt(n,a,o,s,t)},r}(oe);const dC=gC;var yC={circle:function(i,r,t){return[["M",i-t,r],["A",t,t,0,1,0,i+t,r],["A",t,t,0,1,0,i-t,r]]},square:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r-t],["L",i+t,r+t],["L",i-t,r+t],["Z"]]},diamond:function(i,r,t){return[["M",i-t,r],["L",i,r-t],["L",i+t,r],["L",i,r+t],["Z"]]},triangle:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r+e],["L",i,r-e],["L",i+t,r+e],["Z"]]},"triangle-down":function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r-e],["L",i+t,r-e],["L",i,r+e],["Z"]]}},mC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.initAttrs=function(t){this._resetParamsCache()},r.prototype._resetParamsCache=function(){this.set("paramsCache",{})},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},r.prototype.isOnlyHitBox=function(){return!0},r.prototype._getR=function(t){return I(t.r)?t.radius:t.r},r.prototype._getPath=function(){var t=this.attr(),e=t.x,n=t.y,a=t.symbol||"circle",o=this._getR(t),s,l;if(G(a))s=a,l=s(e,n,o),l=Rc(l);else{if(s=r.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;l=s(e,n,o)}return l},r.prototype.createPath=function(t){var e=this._getPath(),n=this.get("paramsCache");Sv(this,t,{path:e},n)},r.Symbols=yC,r}(oe);const xC=mC;function Av(i,r,t){var e=va();return i.createPath(e),e.isPointInPath(r,t)}var wC=1e-6;function ao(i){return Math.abs(i)<wC?0:i<0?-1:1}function CC(i,r,t){return(t[0]-i[0])*(r[1]-i[1])===(r[0]-i[0])*(t[1]-i[1])&&Math.min(i[0],r[0])<=t[0]&&t[0]<=Math.max(i[0],r[0])&&Math.min(i[1],r[1])<=t[1]&&t[1]<=Math.max(i[1],r[1])}function Tv(i,r,t){var e=!1,n=i.length;if(n<=2)return!1;for(var a=0;a<n;a++){var o=i[a],s=i[(a+1)%n];if(CC(o,s,[r,t]))return!0;ao(o[1]-t)>0!=ao(s[1]-t)>0&&ao(r-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(e=!e)}return e}function hi(i,r,t,e,n,a,o,s){var l=(Math.atan2(s-r,o-i)+Math.PI*2)%(Math.PI*2);if(l<e||l>n)return!1;var h={x:i+t*Math.cos(l),y:r+t*Math.sin(l)};return yv(h.x,h.y,o,s)<=a/2}var MC=ct;function SC(i){for(var r=!1,t=i.length,e=0;e<t;e++){var n=i[e],a=n[0];if(a==="C"||a==="A"||a==="Q"){r=!0;break}}return r}function bC(i,r,t,e,n){for(var a=!1,o=r/2,s=0;s<i.length;s++){var l=i[s],h=l.currentPoint,u=l.params,c=l.prePoint,f=l.box;if(!(f&&!nr(f.x-o,f.y-o,f.width+r,f.height+r,t,e))){switch(l.command){case"L":case"Z":a=He(c[0],c[1],h[0],h[1],r,t,e);break;case"Q":var v=Ic.pointDistance(c[0],c[1],u[1],u[2],u[3],u[4],t,e);a=v<=r/2;break;case"C":var p=ci.pointDistance(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6],t,e,n);a=p<=r/2;break;case"A":var g=l.arcParams,d=g.cx,y=g.cy,C=g.rx,m=g.ry,x=g.startAngle,S=g.endAngle,b=g.xRotation,A=[t,e,1],L=C>m?C:m,k=C>m?1:C/m,B=C>m?m/C:1,O=MC(null,[["t",-d,-y],["r",-b],["s",1/k,1/B]]);bi(A,A,O),a=hi(0,0,L,x,S,r,A[0],A[1]);break}if(a)break}}return a}function AC(i){for(var r=i.length,t=[],e=[],n=[],a=0;a<r;a++){var o=i[a],s=o[0];s==="M"?(n.length&&(e.push(n),n=[]),n.push([o[1],o[2]])):s==="Z"?n.length&&(t.push(n),n=[]):n.push([o[1],o[2]])}return n.length>0&&e.push(n),{polygons:t,polylines:e}}const dn=w({hasArc:SC,extractPolygons:AC,isPointInStroke:bC},as);function eu(i,r,t){for(var e=!1,n=0;n<i.length;n++){var a=i[n];if(e=Tv(a,r,t),e)break}return e}var TC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.initAttrs=function(t){this._setPathArr(t.path),this.setArrow()},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),t==="path"&&this._setPathArr(e),this.setArrow()},r.prototype._setPathArr=function(t){this.attrs.path=Rc(t);var e=dn.hasArc(t);this.set("hasArc",e),this.set("paramsCache",{}),this.set("segments",null),this.set("curve",null),this.set("tCache",null),this.set("totalLength",null)},r.prototype.getSegments=function(){var t=this.get("segements");return t||(t=Yc(this.attr("path")),this.set("segments",t)),t},r.prototype.setArrow=function(){var t=this.attr(),e=t.startArrow,n=t.endArrow;if(e){var a=this.getStartTangent();Hs(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}if(n){var a=this.getEndTangent();Vs(this,t,a[0][0],a[0][1],a[1][0],a[1][1])}},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.getSegments(),l=this.get("hasArc"),h=!1;if(n){var u=this.getTotalLength();h=dn.isPointInStroke(s,o,t,e,u)}if(!h&&a)if(l)h=Av(this,t,e);else{var c=this.attr("path"),f=dn.extractPolygons(c);h=eu(f.polygons,t,e)||eu(f.polylines,t,e)}return h},r.prototype.createPath=function(t){var e=this.attr(),n=this.get("paramsCache");Sv(this,t,e,n)},r.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},r.prototype.getTotalLength=function(){var t=this.get("totalLength");return I(t)?(this._calculateCurve(),this._setTcache(),this.get("totalLength")):t},r.prototype.getPoint=function(t){var e=this.get("tCache");e||(this._calculateCurve(),this._setTcache(),e=this.get("tCache"));var n,a,o=this.get("curve");if(!e||e.length===0)return o?{x:o[0][1],y:o[0][2]}:null;M(e,function(u,c){t>=u[0]&&t<=u[1]&&(n=(t-u[0])/(u[1]-u[0]),a=c)});var s=o[a];if(I(s)||I(a))return null;var l=s.length,h=o[a+1];return ci.pointAt(s[l-2],s[l-1],h[1],h[2],h[3],h[4],h[5],h[6],n)},r.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",dn.pathToCurve(t))},r.prototype._setTcache=function(){var t=0,e=0,n=[],a,o,s,l,h=this.get("curve");if(!!h){if(M(h,function(u,c){s=h[c+1],l=u.length,s&&(t+=ci.length(u[l-2],u[l-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}M(h,function(u,c){s=h[c+1],l=u.length,s&&(a=[],a[0]=e/t,o=ci.length(u[l-2],u[l-1],s[1],s[2],s[3],s[4],s[5],s[6]),e+=o||0,a[1]=e/t,n.push(a))}),this.set("tCache",n)}},r.prototype.getStartTangent=function(){var t=this.getSegments(),e;if(t.length>1){var n=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;e=[],o?(e.push([n[0]-o[0],n[1]-o[1]]),e.push([n[0],n[1]])):(e.push([a[0],a[1]]),e.push([n[0],n[1]]))}return e},r.prototype.getEndTangent=function(){var t=this.getSegments(),e=t.length,n;if(e>1){var a=t[e-2].currentPoint,o=t[e-1].currentPoint,s=t[e-1].endTangent;n=[],s?(n.push([o[0]-s[0],o[1]-s[1]]),n.push([o[0],o[1]])):(n.push([a[0],a[1]]),n.push([o[0],o[1]]))}return n},r}(oe);const zs=TC;function Lv(i,r,t,e,n){var a=i.length;if(a<2)return!1;for(var o=0;o<a-1;o++){var s=i[o][0],l=i[o][1],h=i[o+1][0],u=i[o+1][1];if(He(s,l,h,u,r,t,e))return!0}if(n){var c=i[0],f=i[a-1];if(He(c[0],c[1],f[0],f[1],r,t,e))return!0}return!1}var LC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr().points,l=!1;return n&&(l=Lv(s,o,t,e,!0)),!l&&a&&(l=Tv(s,t,e)),l},r.prototype.createPath=function(t){var e=this.attr(),n=e.points;if(!(n.length<2)){t.beginPath();for(var a=0;a<n.length;a++){var o=n[a];a===0?t.moveTo(o[0],o[1]):t.lineTo(o[0],o[1])}t.closePath()}},r}(oe);const EC=LC;var BC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.initAttrs=function(t){this.setArrow()},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),this.setArrow(),["points"].indexOf(t)!==-1&&this._resetCache()},r.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},r.prototype.setArrow=function(){var t=this.attr(),e=this.attrs,n=e.points,a=e.startArrow,o=e.endArrow,s=n.length,l=n[0][0],h=n[0][1],u=n[s-1][0],c=n[s-1][1];a&&Hs(this,t,n[1][0],n[1][1],l,h),o&&Vs(this,t,n[s-2][0],n[s-2][1],u,c)},r.prototype.isFill=function(){return!1},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){if(!n||!o)return!1;var s=this.attr().points;return Lv(s,o,t,e,!1)},r.prototype.isStroke=function(){return!0},r.prototype.createPath=function(t){var e=this.attr(),n=e.points,a=e.startArrow,o=e.endArrow,s=n.length;if(!(n.length<2)){var l=n[0][0],h=n[0][1],u=n[s-1][0],c=n[s-1][1];if(a&&a.d){var f=cr(l,h,n[1][0],n[1][1],a.d);l+=f.dx,h+=f.dy}if(o&&o.d){var f=cr(n[s-2][0],n[s-2][1],u,c,o.d);u-=f.dx,c-=f.dy}t.beginPath(),t.moveTo(l,h);for(var v=0;v<s-1;v++){var p=n[v];t.lineTo(p[0],p[1])}t.lineTo(u,c)}},r.prototype.afterDrawPath=function(t){var e=this.get("startArrowShape"),n=this.get("endArrowShape");e&&e.draw(t),n&&n.draw(t)},r.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return I(e)?(this.set("totalLength",Oc.length(t)),this.get("totalLength")):e},r.prototype.getPoint=function(t){var e=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return M(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),wt.pointAt(e[o][0],e[o][1],e[o+1][0],e[o+1][1],a)},r.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var e=this.getTotalLength();if(!(e<=0)){var n=0,a=[],o,s;M(t,function(l,h){t[h+1]&&(o=[],o[0]=n/e,s=wt.length(l[0],l[1],t[h+1][0],t[h+1][1]),n+=s,o[1]=n/e,a.push(o))}),this.set("tCache",a)}}},r.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},r}(oe);const kC=BC;function IC(i,r,t,e,n,a,o){var s=n/2;return nr(i-s,r-s,t,n,a,o)||nr(i+t-s,r-s,n,e,a,o)||nr(i+s,r+e-s,t,n,a,o)||nr(i-s,r+s,n,e,a,o)}function PC(i,r,t,e,n,a,o,s){return He(i+n,r,i+t-n,r,a,o,s)||He(i+t,r+n,i+t,r+e-n,a,o,s)||He(i+t-n,r+e,i+n,r+e,a,o,s)||He(i,r+e-n,i,r+n,a,o,s)||hi(i+t-n,r+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||hi(i+t-n,r+e-n,n,0,.5*Math.PI,a,o,s)||hi(i+n,r+e-n,n,.5*Math.PI,Math.PI,a,o,s)||hi(i+n,r+n,n,Math.PI,1.5*Math.PI,a,o,s)}var FC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0,radius:0})},r.prototype.isInStrokeOrPath=function(t,e,n,a,o){var s=this.attr(),l=s.x,h=s.y,u=s.width,c=s.height,f=s.radius;if(f){var p=!1;return n&&(p=PC(l,h,u,c,f,o,t,e)),!p&&a&&(p=Av(this,t,e)),p}else{var v=o/2;if(a&&n)return nr(l-v,h-v,u+v,c+v,t,e);if(a)return nr(l,h,u,c,t,e);if(n)return IC(l,h,u,c,o,t,e)}},r.prototype.createPath=function(t){var e=this.attr(),n=e.x,a=e.y,o=e.width,s=e.height,l=e.radius;if(t.beginPath(),l===0)t.rect(n,a,o,s);else{var h=rC(l),u=h[0],c=h[1],f=h[2],v=h[3];t.moveTo(n+u,a),t.lineTo(n+o-c,a),c!==0&&t.arc(n+o-c,a+c,c,-Math.PI/2,0),t.lineTo(n+o,a+s-f),f!==0&&t.arc(n+o-f,a+s-f,f,0,Math.PI/2),t.lineTo(n+v,a+s),v!==0&&t.arc(n+v,a+s-v,v,Math.PI/2,Math.PI),t.lineTo(n,a+u),u!==0&&t.arc(n+u,a+u,u,Math.PI,Math.PI*1.5),t.closePath()}},r}(oe);const OC=FC;var DC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},r.prototype.isOnlyHitBox=function(){return!0},r.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},r.prototype._assembleFont=function(){var t=this.attrs;t.font=ga(t)},r.prototype._setText=function(t){var e=null;N(t)&&t.indexOf(`
`)!==-1&&(e=t.split(`
`)),this.set("textArr",e)},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(e)},r.prototype._getSpaceingY=function(){var t=this.attrs,e=t.lineHeight,n=t.fontSize*1;return e?e-n:n*.14},r.prototype._drawTextArr=function(t,e,n){var a=this.attrs,o=a.textBaseline,s=a.x,l=a.y,h=a.fontSize*1,u=this._getSpaceingY(),c=pa(a.text,a.fontSize,a.lineHeight),f;M(e,function(v,p){f=l+p*(u+h)-c+h,o==="middle"&&(f+=c-h-(c-h)/2),o==="top"&&(f+=c-h),I(v)||(n?t.fillText(v,s,f):t.strokeText(v,s,f))})},r.prototype._drawText=function(t,e){var n=this.attr(),a=n.x,o=n.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,e);else{var l=n.text;I(l)||(e?t.fillText(l,a,o):t.strokeText(l,a,o))}},r.prototype.strokeAndFill=function(t){var e=this.attrs,n=e.lineWidth,a=e.opacity,o=e.strokeOpacity,s=e.fillOpacity;this.isStroke()&&n>0&&(!I(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!I(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},r.prototype.fill=function(t){this._drawText(t,!0)},r.prototype.stroke=function(t){this._drawText(t,!1)},r}(oe);const RC=DC;function YC(i,r){if(r){var t=oa(r);return xe(t,i)}return i}function Ev(i,r,t){var e=i.getTotalMatrix();if(e){var n=YC([r,t,1],e),a=n[0],o=n[1];return[a,o]}return[r,t]}function ru(i,r,t){if(i.isCanvas&&i.isCanvas())return!0;if(!Si(i)||i.cfg.isInView===!1)return!1;if(i.cfg.clipShape){var e=Ev(i,r,t),n=e[0],a=e[1];if(i.isClipped(n,a))return!1}var o=i.cfg.cacheCanvasBBox||i.getCanvasBBox();return r>=o.minX&&r<=o.maxX&&t>=o.minY&&t<=o.maxY}function Bv(i,r,t){if(!ru(i,r,t))return null;for(var e=null,n=i.getChildren(),a=n.length,o=a-1;o>=0;o--){var s=n[o];if(s.isGroup())e=Bv(s,r,t);else if(ru(s,r,t)){var l=s,h=Ev(s,r,t),u=h[0],c=h[1];l.isInShape(u,c)&&(e=s)}if(e)break}return e}var GC=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},r.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},r.prototype.getShapeBase=function(){return Jn},r.prototype.getGroupBase=function(){return Xs},r.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||jw();return t>=1?Math.ceil(t):1},r.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},r.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},r.prototype.setDOMSize=function(t,e){i.prototype.setDOMSize.call(this,t,e);var n=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*e,o>1&&n.scale(o,o)},r.prototype.clear=function(){i.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),e=this.get("el");t.clearRect(0,0,e.width,e.height)},r.prototype.getShape=function(t,e){var n;return this.get("quickHit")?n=Bv(this,t,e):n=i.prototype.getShape.call(this,t,e,null),n},r.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),e=this.getViewRange(),n;if(t.length&&t[0]===this)n=e;else if(n=oC(t),n){n.minX=Math.floor(n.minX),n.minY=Math.floor(n.minY),n.maxX=Math.ceil(n.maxX),n.maxY=Math.ceil(n.maxY),n.maxY+=1;var a=this.get("clipView");a&&(n=sC(n,e))}return n},r.prototype.refreshElement=function(t){var e=this.get("refreshElements");e.push(t)},r.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(wp(t),this.set("drawFrame",null),this.set("refreshElements",[]))},r.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},r.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Nr(t,this),jo(t,n),this.set("refreshElements",[])},r.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),Nr(t,this),iC(this,n,a),jo(t,n,a),t.restore()):e.length&&Mv(e),M(e,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},r.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=xp(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",e))},r.prototype.skipDraw=function(){},r.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},r}(la),HC="0.5.12";const VC=Object.freeze(Object.defineProperty({__proto__:null,Shape:Jn,version:HC,Canvas:GC,Group:Xs,getArcParams:Zn,Event:Ni,Base:na,AbstractCanvas:la,AbstractGroup:ha,AbstractShape:ua,getBBoxMethod:ca,registerBBox:Kt,getTextHeight:pa,assembleFont:ga,isAllowCapture:Si,multiplyVec2:xe,invert:oa,getOffScreenContext:va,registerEasing:Ac,PathUtil:as},Symbol.toStringTag,{value:"Module"}));var qo={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},W={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"};function Zt(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function kv(i){var r=qo[i.type],t=i.getParent();if(!r)throw new Error("the type "+i.type+" is not supported by svg");var e=Zt(r);if(i.get("id")&&(e.id=i.get("id")),i.set("el",e),i.set("attrs",{}),t){var n=t.get("el");n||(n=t.createDom(),t.set("el",n)),n.appendChild(e)}return e}function Iv(i,r){var t=i.get("el"),e=Tp(t.children).sort(r),n=document.createDocumentFragment();e.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function NC(i,r){var t=i.parentNode,e=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),n=e[r],a=e.indexOf(i);if(n){if(a>r)t.insertBefore(i,n);else if(a<r){var o=e[r+1];o?t.insertBefore(i,o):t.appendChild(i)}}else t.appendChild(i)}function XC(i,r){var t=i.cfg.el,e=i.attr(),n={dx:e.shadowOffsetX,dy:e.shadowOffsetY,blur:e.shadowBlur,color:e.shadowColor};if(!n.dx&&!n.dy&&!n.blur&&!n.color)t.removeAttribute("filter");else{var a=r.find("filter",n);a||(a=r.addShadow(n)),t.setAttribute("filter","url(#"+a+")")}}function Ui(i){var r=i.attr().matrix;if(r){for(var t=i.cfg.el,e=[],n=0;n<9;n+=3)e.push(r[n]+","+r[n+1]);e=e.join(","),e.indexOf("NaN")===-1?t.setAttribute("transform","matrix("+e+")"):console.warn("invalid matrix:",r)}}function Hi(i,r){var t=i.getClip(),e=i.get("el");if(!t)e.removeAttribute("clip-path");else if(t&&!e.hasAttribute("clip-path")){kv(t),t.createPath(r);var n=r.addClip(t);e.setAttribute("clip-path","url(#"+n+")")}}function Pv(i,r){r.forEach(function(t){t.draw(i)})}function Fv(i,r){var t=i.get("canvas");if(t&&t.get("autoDraw")){var e=t.get("context"),n=i.getParent(),a=n?n.getChildren():[t],o=i.get("el");if(r==="remove"){var s=i.get("isClipShape");if(s){var l=o&&o.parentNode,h=l&&l.parentNode;l&&h&&h.removeChild(l)}else o&&o.parentNode&&o.parentNode.removeChild(o)}else if(r==="show")o.setAttribute("visibility","visible");else if(r==="hide")o.setAttribute("visibility","hidden");else if(r==="zIndex")NC(o,a.indexOf(i));else if(r==="sort"){var u=i.get("children");u&&u.length&&Iv(i,function(c,f){return u.indexOf(c)-u.indexOf(f)?1:0})}else r==="clear"?o&&(o.innerHTML=""):r==="matrix"?Ui(i):r==="clip"?Hi(i,e):r==="attr"||r==="add"&&i.draw(e)}}var Ws=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.isEntityGroup=function(){return!0},r.prototype.createDom=function(){var t=Zt("g");this.set("el",t);var e=this.getParent();if(e){var n=e.get("el");n||(n=e.createDom(),e.set("el",n)),n.appendChild(t)}return t},r.prototype.afterAttrsChange=function(t){i.prototype.afterAttrsChange.call(this,t);var e=this.get("canvas");if(e&&e.get("autoDraw")){var n=e.get("context");this.createPath(n,t)}},r.prototype.onCanvasChange=function(t){Fv(this,t)},r.prototype.getShapeBase=function(){return ta},r.prototype.getGroupBase=function(){return r},r.prototype.draw=function(t){var e=this.getChildren(),n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||this.createDom(),Hi(this,t),this.createPath(t),e.length&&Pv(t,e))},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){W[s]&&a.setAttribute(W[s],o)}),Ui(this)},r}(ha),zC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="svg",t.canFill=!1,t.canStroke=!1,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},r.prototype.afterAttrsChange=function(t){i.prototype.afterAttrsChange.call(this,t);var e=this.get("canvas");if(e&&e.get("autoDraw")){var n=e.get("context");this.draw(n,t)}},r.prototype.getShapeBase=function(){return ta},r.prototype.getGroupBase=function(){return Ws},r.prototype.onCanvasChange=function(t){Fv(this,t)},r.prototype.calculateBBox=function(){var t=this.get("el"),e=null;if(t)e=t.getBBox();else{var n=ca(this.get("type"));n&&(e=n(this))}if(e){var a=e.x,o=e.y,s=e.width,l=e.height,h=this.getHitLineWidth(),u=h/2,c=a-u,f=o-u,v=a+s+u,p=o+l+u;return{x:c,y:f,minX:c,minY:f,maxX:v,maxY:p,width:s+h,height:l+h}}return{x:0,y:0,minX:0,minY:0,maxX:0,maxY:0,width:0,height:0}},r.prototype.isFill=function(){var t=this.attr(),e=t.fill,n=t.fillStyle;return(e||n||this.isClipShape())&&this.canFill},r.prototype.isStroke=function(){var t=this.attr(),e=t.stroke,n=t.strokeStyle;return(e||n)&&this.canStroke},r.prototype.draw=function(t,e){var n=this.get("el");this.get("destroyed")?n&&n.parentNode.removeChild(n):(n||kv(this),Hi(this,t),this.createPath(t,e),this.shadow(t,e),this.strokeAndFill(t,e),this.transform(e))},r.prototype.createPath=function(t,e){},r.prototype.strokeAndFill=function(t,e){var n=e||this.attr(),a=n.fill,o=n.fillStyle,s=n.stroke,l=n.strokeStyle,h=n.fillOpacity,u=n.strokeOpacity,c=n.lineWidth,f=this.get("el");this.canFill&&(e?"fill"in n?this._setColor(t,"fill",a):"fillStyle"in n&&this._setColor(t,"fill",o):this._setColor(t,"fill",a||o),h&&f.setAttribute(W.fillOpacity,h)),this.canStroke&&c>0&&(e?"stroke"in n?this._setColor(t,"stroke",s):"strokeStyle"in n&&this._setColor(t,"stroke",l):this._setColor(t,"stroke",s||l),u&&f.setAttribute(W.strokeOpacity,u),c&&f.setAttribute(W.lineWidth,c))},r.prototype._setColor=function(t,e,n){var a=this.get("el");if(!n){a.setAttribute(W[e],"none");return}if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var o=t.find("gradient",n);o||(o=t.addGradient(n)),a.setAttribute(W[e],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(W[e],"url(#"+o+")")}else a.setAttribute(W[e],n)},r.prototype.shadow=function(t,e){var n=this.attr(),a=e||n,o=a.shadowOffsetX,s=a.shadowOffsetY,l=a.shadowBlur,h=a.shadowColor;(o||s||l||h)&&XC(this,t)},r.prototype.transform=function(t){var e=this.attr(),n=(t||e).matrix;n&&Ui(this)},r.prototype.isInShape=function(t,e){return this.isPointInPath(t,e)},r.prototype.isPointInPath=function(t,e){var n=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,l=e+o.top,h=document.elementFromPoint(s,l);return!!(h&&h.isEqualNode(n))},r.prototype.getHitLineWidth=function(){var t=this.attrs,e=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?e+n:0},r}(ua);const Jt=zC;var WC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,r:0})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const $C=WC;var _C=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");if(M(e||n,function(h,u){W[u]&&a.setAttribute(W[u],h)}),typeof n.html=="function"){var o=n.html.call(this,n);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,l=s.length-1;l>=0;l--)a.removeChild(s[l]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=n.html},r}(Jt);const jC=_C;var UC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,rx:0,ry:0})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const qC=UC;var ZC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");M(e||a,function(s,l){l==="img"?n._setImage(a.img):W[l]&&o.setAttribute(W[l],s)})},r.prototype.setAttr=function(t,e){this.attrs[t]=e,t==="img"&&this._setImage(e)},r.prototype._setImage=function(t){var e=this.attr(),n=this.get("el");if(N(t))n.setAttribute("href",t);else if(t instanceof window.Image)e.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&N(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),e.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),e.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",a.toDataURL())}},r}(Jt);const QC=ZC;var KC=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var l=rt(o)?t.addArrow(n,W[s]):t.getDefaultArrow(n,W[s]);a.setAttribute(W[s],"url(#"+l+")")}else a.removeAttribute(W[s]);else W[s]&&a.setAttribute(W[s],o)})},r.prototype.getTotalLength=function(){var t=this.attr(),e=t.x1,n=t.y1,a=t.x2,o=t.y2;return wt.length(e,n,a,o)},r.prototype.getPoint=function(t){var e=this.attr(),n=e.x1,a=e.y1,o=e.x2,s=e.y2;return wt.pointAt(n,a,o,s,t)},r}(Jt);const JC=KC;var yn={circle:function(i,r,t){return[["M",i,r],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(i,r,t){return[["M",i-t,r-t],["L",i+t,r-t],["L",i+t,r+t],["L",i-t,r+t],["Z"]]},diamond:function(i,r,t){return[["M",i-t,r],["L",i,r-t],["L",i+t,r],["L",i,r+t],["Z"]]},triangle:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r+e],["L",i,r-e],["L",i+t,r+e],["z"]]},triangleDown:function(i,r,t){var e=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,r-e],["L",i+t,r-e],["L",i,r+e],["Z"]]}};const iu={get:function(i){return yn[i]},register:function(i,r){yn[i]=r},remove:function(i){delete yn[i]},getAll:function(){return yn}};var t1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return r.prototype.createPath=function(t){var e=this.get("el");e.setAttribute("d",this._assembleMarker())},r.prototype._assembleMarker=function(){var t=this._getPath();return P(t)?t.map(function(e){return e.join(" ")}).join(""):t},r.prototype._getPath=function(){var t=this.attr(),e=t.x,n=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return G(o)?s=o:s=iu.get(o),s?s(e,n,a):(console.warn(s+" symbol is not exist."),null)},r.symbolsFactory=iu,r}(Jt);const e1=t1;var r1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");M(e||a,function(s,l){if(l==="path"&&P(s))o.setAttribute("d",n._formatPath(s));else if(l==="startArrow"||l==="endArrow")if(s){var h=rt(s)?t.addArrow(a,W[l]):t.getDefaultArrow(a,W[l]);o.setAttribute(W[l],"url(#"+h+")")}else o.removeAttribute(W[l]);else W[l]&&o.setAttribute(W[l],s)})},r.prototype._formatPath=function(t){var e=t.map(function(n){return n.join(" ")}).join("");return~e.indexOf("NaN")?"":e},r.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},r.prototype.getPoint=function(t){var e=this.get("el"),n=this.getTotalLength();if(n===0)return null;var a=e?e.getPointAtLength(t*n):null;return a?{x:a.x,y:a.y}:null},r}(Jt);const i1=r1;var n1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="points"&&P(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):W[s]&&a.setAttribute(W[s],o)})},r}(Jt);const a1=n1;var o1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{startArrow:!1,endArrow:!1})},r.prototype.onAttrChange=function(t,e,n){i.prototype.onAttrChange.call(this,t,e,n),["points"].indexOf(t)!==-1&&this._resetCache()},r.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},r.prototype.createPath=function(t,e){var n=this.attr(),a=this.get("el");M(e||n,function(o,s){s==="points"&&P(o)&&o.length>=2?a.setAttribute("points",o.map(function(l){return l[0]+","+l[1]}).join(" ")):W[s]&&a.setAttribute(W[s],o)})},r.prototype.getTotalLength=function(){var t=this.attr().points,e=this.get("totalLength");return I(e)?(this.set("totalLength",Oc.length(t)),this.get("totalLength")):e},r.prototype.getPoint=function(t){var e=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return M(n,function(s,l){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=l)}),wt.pointAt(e[o][0],e[o][1],e[o+1][0],e[o+1][1],a)},r.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var e=this.getTotalLength();if(!(e<=0)){var n=0,a=[],o,s;M(t,function(l,h){t[h+1]&&(o=[],o[0]=n/e,s=wt.length(l[0],l[1],t[h+1][0],t[h+1][1]),n+=s,o[1]=n/e,a.push(o))}),this.set("tCache",a)}}},r.prototype.getStartTangent=function(){var t=this.attr().points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.prototype.getEndTangent=function(){var t=this.attr().points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},r}(Jt);const s1=o1;function l1(i){var r=0,t=0,e=0,n=0;return P(i)?i.length===1?r=t=e=n=i[0]:i.length===2?(r=e=i[0],t=n=i[1]):i.length===3?(r=i[0],t=n=i[1],e=i[2]):(r=i[0],t=i[1],e=i[2],n=i[3]):r=t=e=n=i,{r1:r,r2:t,r3:e,r4:n}}var h1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,width:0,height:0,radius:0})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el"),s=!1,l=["x","y","width","height","radius"];M(e||a,function(h,u){l.indexOf(u)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):l.indexOf(u)===-1&&W[u]&&o.setAttribute(W[u],h)})},r.prototype._assembleRect=function(t){var e=t.x,n=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+e+","+n+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var l=l1(s);P(s)?s.length===1?l.r1=l.r2=l.r3=l.r4=s[0]:s.length===2?(l.r1=l.r3=s[0],l.r2=l.r4=s[1]):s.length===3?(l.r1=s[0],l.r2=l.r4=s[1],l.r3=s[2]):(l.r1=s[0],l.r2=s[1],l.r3=s[2],l.r4=s[3]):l.r1=l.r2=l.r3=l.r4=s;var h=[["M "+(e+l.r1)+","+n],["l "+(a-l.r1-l.r2)+",0"],["a "+l.r2+","+l.r2+",0,0,1,"+l.r2+","+l.r2],["l 0,"+(o-l.r2-l.r3)],["a "+l.r3+","+l.r3+",0,0,1,"+-l.r3+","+l.r3],["l "+(l.r3+l.r4-a)+",0"],["a "+l.r4+","+l.r4+",0,0,1,"+-l.r4+","+-l.r4],["l 0,"+(l.r4+l.r1-o)],["a "+l.r1+","+l.r1+",0,0,1,"+l.r1+","+-l.r1],["z"]];return h.join(" ")},r}(Jt);const u1=h1;var nu=.3,c1={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},f1={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},v1={left:"left",start:"left",center:"middle",right:"end",end:"end"},p1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return r.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return w(w({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},r.prototype.createPath=function(t,e){var n=this,a=this.attr(),o=this.get("el");this._setFont(),M(e||a,function(s,l){l==="text"?n._setText(""+s):l==="matrix"&&s?Ui(n):W[l]&&o.setAttribute(W[l],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},r.prototype._setFont=function(){var t=this.get("el"),e=this.attr(),n=e.textBaseline,a=e.textAlign,o=nc();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",f1[n]||"alphabetic"):t.setAttribute("alignment-baseline",c1[n]||"baseline"),t.setAttribute("text-anchor",v1[a]||"left")},r.prototype._setText=function(t){var e=this.get("el"),n=this.attr(),a=n.x,o=n.textBaseline,s=o===void 0?"bottom":o;if(!t)e.innerHTML="";else if(~t.indexOf(`
`)){var l=t.split(`
`),h=l.length-1,u="";M(l,function(c,f){f===0?s==="alphabetic"?u+='<tspan x="'+a+'" dy="'+-h+'em">'+c+"</tspan>":s==="top"?u+='<tspan x="'+a+'" dy="0.9em">'+c+"</tspan>":s==="middle"?u+='<tspan x="'+a+'" dy="'+-(h-1)/2+'em">'+c+"</tspan>":s==="bottom"?u+='<tspan x="'+a+'" dy="-'+(h+nu)+'em">'+c+"</tspan>":s==="hanging"&&(u+='<tspan x="'+a+'" dy="'+(-(h-1)-nu)+'em">'+c+"</tspan>"):u+='<tspan x="'+a+'" dy="1em">'+c+"</tspan>"}),e.innerHTML=u}else e.innerHTML=t},r}(Jt);const g1=p1;var d1=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,y1=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,m1=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Ov(i){var r=i.match(m1);if(!r)return"";var t="";return r.sort(function(e,n){return e=e.split(":"),n=n.split(":"),Number(e[0])-Number(n[0])}),M(r,function(e){e=e.split(":"),t+='<stop offset="'+e[0]+'" stop-color="'+e[1]+'"></stop>'}),t}function x1(i,r){var t=d1.exec(i),e=Jo(ts(parseFloat(t[1])),Math.PI*2),n=t[2],a,o;e>=0&&e<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=e&&e<Math.PI?(a={x:1,y:0},o={x:0,y:1}):Math.PI<=e&&e<1.5*Math.PI?(a={x:1,y:1},o={x:0,y:0}):(a={x:0,y:1},o={x:1,y:0});var s=Math.tan(e),l=s*s,h=(o.x-a.x+s*(o.y-a.y))/(l+1)+a.x,u=s*(o.x-a.x+s*(o.y-a.y))/(l+1)+a.y;r.setAttribute("x1",a.x),r.setAttribute("y1",a.y),r.setAttribute("x2",h),r.setAttribute("y2",u),r.innerHTML=Ov(n)}function w1(i,r){var t=y1.exec(i),e=parseFloat(t[1]),n=parseFloat(t[2]),a=parseFloat(t[3]),o=t[4];r.setAttribute("cx",e),r.setAttribute("cy",n),r.setAttribute("r",a),r.innerHTML=Ov(o)}var C1=function(){function i(r){this.cfg={};var t=null,e=qe("gradient_");return r.toLowerCase()[0]==="l"?(t=Zt("linearGradient"),x1(r,t)):(t=Zt("radialGradient"),w1(r,t)),t.setAttribute("id",e),this.el=t,this.id=e,this.cfg=r,this}return i.prototype.match=function(r,t){return this.cfg===t},i}(),M1={shadowColor:"color",shadowOpacity:"opacity",shadowBlur:"blur",shadowOffsetX:"dx",shadowOffsetY:"dy"},S1={x:"-40%",y:"-40%",width:"200%",height:"200%"},b1=function(){function i(r){this.type="filter",this.cfg={},this.type="filter";var t=Zt("filter");return M(S1,function(e,n){t.setAttribute(n,e)}),this.el=t,this.id=qe("filter_"),this.el.id=this.id,this.cfg=r,this._parseShadow(r,t),this}return i.prototype.match=function(r,t){if(this.type!==r)return!1;var e=!0,n=this.cfg;return M(Object.keys(n),function(a){if(n[a]!==t[a])return e=!1,!1}),e},i.prototype.update=function(r,t){var e=this.cfg;return e[M1[r]]=t,this._parseShadow(e,this.el),this},i.prototype._parseShadow=function(r,t){var e=`<feDropShadow
dx="`+(r.dx||0)+`"
dy="`+(r.dy||0)+`"
stdDeviation="`+(r.blur?r.blur/10:0)+`"
flood-color="`+(r.color?r.color:"#000")+`"
flood-opacity="`+(r.opacity?r.opacity:1)+`"
/>`;t.innerHTML=e},i}(),au=function(){function i(r,t){this.cfg={};var e=Zt("marker"),n=qe("marker_");e.setAttribute("id",n);var a=Zt("path");a.setAttribute("stroke",r.stroke||"none"),a.setAttribute("fill",r.fill||"none"),e.appendChild(a),e.setAttribute("overflow","visible"),e.setAttribute("orient","auto-start-reverse"),this.el=e,this.child=a,this.id=n;var o=r[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=r.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(r.lineWidth,a)),this}return i.prototype.match=function(){return!1},i.prototype._setDefaultPath=function(r,t){var e=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),e.setAttribute("refX",""+10*Math.cos(Math.PI/6)),e.setAttribute("refY",""+5)},i.prototype._setMarker=function(r,t){var e=this.el,n=this.cfg.path,a=this.cfg.d;P(n)&&(n=n.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",n),e.appendChild(t),a&&e.setAttribute("refX",""+a/r)},i.prototype.update=function(r){var t=this.child;t.attr?t.attr("fill",r):t.setAttribute("fill",r)},i}(),A1=function(){function i(r){this.type="clip",this.cfg={};var t=Zt("clipPath");this.el=t,this.id=qe("clip_"),t.id=this.id;var e=r.cfg.el;return t.appendChild(e),this.cfg=r,this}return i.prototype.match=function(){return!1},i.prototype.remove=function(){var r=this.el;r.parentNode.removeChild(r)},i}(),T1=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,L1=function(){function i(r){this.cfg={};var t=Zt("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var e=Zt("image");t.appendChild(e);var n=qe("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=r;var a=T1.exec(r),o=a[2];e.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function l(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?l():(s.onload=l,s.src=s.src),this}return i.prototype.match=function(r,t){return this.cfg===t},i}(),E1=function(){function i(r){var t=Zt("defs"),e=qe("defs_");t.id=e,r.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=r}return i.prototype.find=function(r,t){for(var e=this.children,n=null,a=0;a<e.length;a++)if(e[a].match(r,t)){n=e[a].id;break}return n},i.prototype.findById=function(r){for(var t=this.children,e=null,n=0;n<t.length;n++)if(t[n].id===r){e=t[n];break}return e},i.prototype.add=function(r){this.children.push(r),r.canvas=this.canvas,r.parent=this},i.prototype.getDefaultArrow=function(r,t){var e=r.stroke||r.strokeStyle;if(this.defaultArrow[e])return this.defaultArrow[e].id;var n=new au(r,t);return this.defaultArrow[e]=n,this.el.appendChild(n.el),this.add(n),n.id},i.prototype.addGradient=function(r){var t=new C1(r);return this.el.appendChild(t.el),this.add(t),t.id},i.prototype.addArrow=function(r,t){var e=new au(r,t);return this.el.appendChild(e.el),this.add(e),e.id},i.prototype.addShadow=function(r){var t=new b1(r);return this.el.appendChild(t.el),this.add(t),t.id},i.prototype.addPattern=function(r){var t=new L1(r);return this.el.appendChild(t.el),this.add(t),t.id},i.prototype.addClip=function(r){var t=new A1(r);return this.el.appendChild(t.el),this.add(t),t.id},i}(),B1=function(i){E(r,i);function r(t){return i.call(this,w(w({},t),{autoDraw:!0,renderer:"svg"}))||this}return r.prototype.getShapeBase=function(){return ta},r.prototype.getGroupBase=function(){return Ws},r.prototype.getShape=function(t,e,n){var a=n.target||n.srcElement;if(!qo[a.tagName]){for(var o=a.parentNode;o&&!qo[o.tagName];)o=o.parentNode;a=o}return this.find(function(s){return s.get("el")===a})},r.prototype.createDom=function(){var t=Zt("svg"),e=new E1(t);return t.setAttribute("width",""+this.get("width")),t.setAttribute("height",""+this.get("height")),this.set("context",e),t},r.prototype.onCanvasChange=function(t){var e=this.get("context"),n=this.get("el");if(t==="sort"){var a=this.get("children");a&&a.length&&Iv(this,function(s,l){return a.indexOf(s)-a.indexOf(l)?1:0})}else if(t==="clear"){if(n){n.innerHTML="";var o=e.el;o.innerHTML="",n.appendChild(o)}}else t==="matrix"?Ui(this):t==="clip"?Hi(this,e):t==="changeSize"&&(n.setAttribute("width",""+this.get("width")),n.setAttribute("height",""+this.get("height")))},r.prototype.draw=function(){var t=this.get("context"),e=this.getChildren();Hi(this,t),e.length&&Pv(t,e)},r}(la),k1="0.5.6";const I1=Object.freeze(Object.defineProperty({__proto__:null,Shape:ta,version:k1,Canvas:B1,Group:Ws,Event:Ni,Base:na,AbstractCanvas:la,AbstractGroup:ha,AbstractShape:ua,getBBoxMethod:ca,registerBBox:Kt,getTextHeight:pa,assembleFont:ga,isAllowCapture:Si,multiplyVec2:xe,invert:oa,getOffScreenContext:va,registerEasing:Ac,PathUtil:as},Symbol.toStringTag,{value:"Module"}));var $s=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="path",e.shapeType="line";var n=t.connectNulls,a=n===void 0?!1:n,o=t.showSinglePoint,s=o===void 0?!0:o;return e.connectNulls=a,e.showSinglePoint=s,e}return r.prototype.updateElements=function(t,e){var n,a,o,s,l,h;e===void 0&&(e=!1);for(var u=new Map,c=new Map,f=[],v=0,p=0;p<t.length;p++){var g=t[p],d=this.getElementId(g);f.push(d),u.set(d,g),c.set(d,v),v++}this.elements=new Array(v);var y=sv(this.lastElementsMap,f),C=y.added,m=y.updated,x=y.removed;try{for(var S=$(C),b=S.next();!b.done;b=S.next()){var d=b.value,g=u.get(d),A=this.getShapeFactory(),L=this.getShapeInfo(g),p=c.get(d),k=new iv({shapeFactory:A,container:this.container,offscreenGroup:this.getOffscreenGroup(),elementIndex:p});k.geometry=this,k.animate=this.animateOption,k.draw(L,e),this.elementsMap[d]=k,this.elements[p]=k}}catch(_){n={error:_}}finally{try{b&&!b.done&&(a=S.return)&&a.call(S)}finally{if(n)throw n.error}}try{for(var B=$(m),O=B.next();!O.done;O=B.next()){var d=O.value,g=u.get(d),k=this.lastElementsMap[d],p=c.get(d),L=this.getShapeInfo(g),R=k.getModel();(this.isCoordinateChanged||ov(R,L))&&(k.animate=this.animateOption,k.update(L)),this.elementsMap[d]=k,this.elements[p]=k}}catch(_){o={error:_}}finally{try{O&&!O.done&&(s=B.return)&&s.call(B)}finally{if(o)throw o.error}}try{for(var H=$(x),z=H.next();!z.done;z=H.next()){var d=z.value,k=this.lastElementsMap[d];k.animate=this.animateOption,k.destroy()}}catch(_){l={error:_}}finally{try{z&&!z.done&&(h=H.return)&&h.call(H)}finally{if(l)throw l.error}}},r.prototype.getPointsAndData=function(t){for(var e=[],n=[],a=0,o=t.length;a<o;a++){var s=t[a];e.push({x:s.x,y:s.y}),n.push(s[Z])}return{points:e,data:n}},r.prototype.getShapeInfo=function(t){var e=this.getDrawCfg(t[0]),n=this.getPointsAndData(t),a=n.points,o=n.data;return e.mappingData=t,e.data=o,e.isStack=!!this.getAdjust("stack"),e.points=a,e.connectNulls=this.connectNulls,e.showSinglePoint=this.showSinglePoint,e},r}(Qe);function P1(i,r,t,e,n){var a=[];if(i.length){for(var o=[],s=[],l=0,h=i.length;l<h;l++){var u=i[l];o.push(u[1]),s.push(u[0])}s=s.reverse(),M([o,s],function(c,f){var v=[],p=e.parsePoints(c),g=p[0];o.length===1&&s.length===1?v=f===0?[["M",g.x-.5,g.y],["L",g.x+.5,g.y]]:[["L",g.x+.5,g.y],["L",g.x-.5,g.y]]:(r&&p.push({x:g.x,y:g.y}),t?v=Un(p,!1,n):v=ji(p,!1),f>0&&(v[0][0]="L")),a=a.concat(v)}),a.push(["Z"])}return a}function Pa(i,r,t,e,n){for(var a=lt(i,r,!r,"lineWidth"),o=i.connectNulls,s=i.isInCircle,l=i.points,h=i.showSinglePoint,u=Rs(l,o,h),c=[],f=0,v=u.length;f<v;f++){var p=u[f];c=c.concat(P1(p,s,t,e,n))}return a.path=c,a}function Dv(i){var r=i.start,t=i.end;return[[r.x,t.y],[t.x,r.y]]}Ze("area",{defaultShapeType:"area",getDefaultPoints:function(i){var r=i.x,t=i.y0,e=P(i.y)?i.y:[t,i.y];return e.map(function(n){return{x:r,y:n}})}});J("area","area",{draw:function(i,r){var t=Pa(i,!1,!1,this),e=r.addShape({type:"path",attrs:t,name:"area"});return e},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return n===void 0&&(n=5.5),[["M",t-n,e-4],["L",t+n,e-4],["L",t+n,e+4],["L",t-n,e+4],["Z"]]},style:{r:5,fill:r,fillOpacity:1}}}});var F1=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="area",e.shapeType="area",e.generatePoints=!0,e.startOnZero=!0;var n=t.startOnZero,a=n===void 0?!0:n,o=t.sortable,s=o===void 0?!1:o,l=t.showSinglePoint,h=l===void 0?!1:l;return e.startOnZero=a,e.sortable=s,e.showSinglePoint=h,e}return r.prototype.getPointsAndData=function(t){for(var e=[],n=[],a=0,o=t.length;a<o;a++){var s=t[a];e.push(s.points),n.push(s[Z])}return{points:e,data:n}},r.prototype.getYMinValue=function(){if(this.startOnZero)return i.prototype.getYMinValue.call(this);var t=this.getYScale();return t.min},r}($s);Ze("edge",{defaultShapeType:"line",getDefaultPoints:function(i){return Ys(i)}});J("edge","line",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=ji(this.parsePoints(i.points),this.coordinate.isPolar);return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});var O1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="edge",t.shapeType="edge",t.generatePoints=!0,t}return r}(Qe),D1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="heatmap",t.paletteCache={},t}return r.prototype.updateElements=function(t,e){for(var n=0;n<t.length;n++){var a=t[n],o=this.prepareRange(a),s=this.prepareSize(),l=T(this.styleOption,["cfg","shadowBlur"]);U(l)||(l=s/2),this.prepareGreyScaleBlurredCircle(s,l),this.drawWithRange(a,o,s,l)}},r.prototype.color=function(t,e){return this.createAttrOption("color",t,typeof e!="function"?e:""),this},r.prototype.clear=function(){i.prototype.clear.call(this),this.clearShadowCanvasCtx(),this.paletteCache={}},r.prototype.prepareRange=function(t){var e=this.getAttribute("color"),n=e.getFields()[0],a=1/0,o=-1/0;return t.forEach(function(s){var l=s[Z][n];l>o&&(o=l),l<a&&(a=l)}),a===o&&(a=o-1),[a,o]},r.prototype.prepareSize=function(){var t=this.getDefaultValue("size");return U(t)||(t=this.getDefaultSize()),t},r.prototype.prepareGreyScaleBlurredCircle=function(t,e){var n=this.getGrayScaleBlurredCanvas(),a=t+e,o=n.getContext("2d");n.width=n.height=a*2,o.clearRect(0,0,n.width,n.height),o.shadowOffsetX=o.shadowOffsetY=a*2,o.shadowBlur=e,o.shadowColor="black",o.beginPath(),o.arc(-a,-a,t,0,Math.PI*2,!0),o.closePath(),o.fill()},r.prototype.drawWithRange=function(t,e,n,a){var o,s,l=this.coordinate,h=l.start,u=l.end,c=this.coordinate.getWidth(),f=this.coordinate.getHeight(),v=this.getAttribute("color"),p=v.getFields()[0];this.clearShadowCanvasCtx();var g=this.getShadowCanvasCtx();e&&(t=t.filter(function(B){return B[Z][p]<=e[1]&&B[Z][p]>=e[0]}));var d=this.scales[p];try{for(var y=$(t),C=y.next();!C.done;C=y.next()){var m=C.value,x=this.getDrawCfg(m),S=x.x,b=x.y,A=d.scale(m[Z][p]);this.drawGrayScaleBlurredCircle(S-h.x,b-u.y,n+a,A,g)}}catch(B){o={error:B}}finally{try{C&&!C.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}var L=g.getImageData(0,0,c,f);this.clearShadowCanvasCtx(),this.colorize(L),g.putImageData(L,0,0);var k=this.getImageShape();k.attr("x",h.x),k.attr("y",u.y),k.attr("width",c),k.attr("height",f),k.attr("img",g.canvas),k.set("origin",this.getShapeInfo(t))},r.prototype.getDefaultSize=function(){var t=this.getAttribute("position"),e=this.coordinate;return Math.min(e.getWidth()/(t.scales[0].ticks.length*4),e.getHeight()/(t.scales[1].ticks.length*4))},r.prototype.clearShadowCanvasCtx=function(){var t=this.getShadowCanvasCtx();t.clearRect(0,0,t.canvas.width,t.canvas.height)},r.prototype.getShadowCanvasCtx=function(){var t=this.shadowCanvas;return t||(t=document.createElement("canvas"),this.shadowCanvas=t),t.width=this.coordinate.getWidth(),t.height=this.coordinate.getHeight(),t.getContext("2d")},r.prototype.getGrayScaleBlurredCanvas=function(){return this.grayScaleBlurredCanvas||(this.grayScaleBlurredCanvas=document.createElement("canvas")),this.grayScaleBlurredCanvas},r.prototype.drawGrayScaleBlurredCircle=function(t,e,n,a,o){var s=this.getGrayScaleBlurredCanvas();o.globalAlpha=a,o.drawImage(s,t-n,e-n)},r.prototype.colorize=function(t){for(var e=this.getAttribute("color"),n=t.data,a=this.paletteCache,o=3;o<n.length;o+=4){var s=n[o];if(U(s)){var l=a[s]?a[s]:ki.rgb2arr(e.gradient(s/256));n[o-3]=l[0],n[o-2]=l[1],n[o-1]=l[2],n[o]=s}}},r.prototype.getImageShape=function(){var t=this.imageShape;if(t)return t;var e=this.container;return t=e.addShape({type:"image",attrs:{}}),this.imageShape=t,t},r.prototype.getShapeInfo=function(t){var e=this.getDrawCfg(t[0]),n=t.map(function(a){return a[Z]});return w(w({},e),{mappingData:t,data:n})},r}(Qe);function _s(i){var r,t,e=i.x,n=i.y,a=i.y0,o=i.size,s,l;P(n)?(r=Y(n,2),s=r[0],l=r[1]):(s=a,l=n);var h,u;P(e)?(t=Y(e,2),h=t[0],u=t[1]):(h=e-o/2,u=e+o/2);var c=[{x:h,y:s},{x:h,y:l}];return c.push({x:u,y:l},{x:u,y:s}),c}function js(i,r){r===void 0&&(r=!0);var t=[],e=i[0];t.push(["M",e.x,e.y]);for(var n=1,a=i.length;n<a;n++)t.push(["L",i[n].x,i[n].y]);return r&&(t.push(["L",e.x,e.y]),t.push(["z"])),t}function Rv(i,r){var t=0,e=0,n=0,a=0;return P(i)?i.length===1?t=e=n=a=i[0]:i.length===2?(t=n=i[0],e=a=i[1]):i.length===3?(t=i[0],e=a=i[1],n=i[2]):(t=i[0],e=i[1],n=i[2],a=i[3]):t=e=n=a=i,t+e>r&&(t=t?r/(1+e/t):0,e=r-t),n+a>r&&(n=n?r/(1+a/n):0,a=r-n),[t||0,e||0,n||0,a||0]}function Yv(i,r,t){var e=[];if(t.isRect){var n=t.isTransposed?{x:t.start.x,y:r[0].y}:{x:r[0].x,y:t.start.y},a=t.isTransposed?{x:t.end.x,y:r[2].y}:{x:r[3].x,y:t.end.y},o=T(i,["background","style","radius"]);if(o){var s=t.isTransposed?Math.abs(r[0].y-r[2].y):r[2].x-r[1].x,l=t.isTransposed?t.getWidth():t.getHeight(),h=Y(Rv(o,Math.min(s,l)),4),u=h[0],c=h[1],f=h[2],v=h[3],p=t.isTransposed&&t.isReflect("y"),g=p?0:1,d=function(b){return p?-b:b};e.push(["M",n.x,a.y+d(u)]),u!==0&&e.push(["A",u,u,0,0,g,n.x+u,a.y]),e.push(["L",a.x-c,a.y]),c!==0&&e.push(["A",c,c,0,0,g,a.x,a.y+d(c)]),e.push(["L",a.x,n.y-d(f)]),f!==0&&e.push(["A",f,f,0,0,g,a.x-f,n.y]),e.push(["L",n.x+v,n.y]),v!==0&&e.push(["A",v,v,0,0,g,n.x,n.y-d(v)])}else e.push(["M",n.x,n.y]),e.push(["L",a.x,n.y]),e.push(["L",a.x,a.y]),e.push(["L",n.x,a.y]),e.push(["L",n.x,n.y]);e.push(["z"])}if(t.isPolar){var y=t.getCenter(),C=_n(i,t),m=C.startAngle,x=C.endAngle;if(t.type!=="theta"&&!t.isTransposed)e=ur(y.x,y.y,t.getRadius(),m,x);else{var S=function(L){return Math.pow(L,2)},u=Math.sqrt(S(y.x-r[0].x)+S(y.y-r[0].y)),c=Math.sqrt(S(y.x-r[2].x)+S(y.y-r[2].y));e=ur(y.x,y.y,u,t.startAngle,t.endAngle,c)}}return e}function R1(i,r,t){var e=t.getWidth(),n=t.getHeight(),a=t.type==="rect",o=[],s=(i[2].x-i[1].x)/2,l=t.isTransposed?s*n/e:s*e/n;return r==="round"?(a?(o.push(["M",i[0].x,i[0].y+l]),o.push(["L",i[1].x,i[1].y-l]),o.push(["A",s,s,0,0,1,i[2].x,i[2].y-l]),o.push(["L",i[3].x,i[3].y+l]),o.push(["A",s,s,0,0,1,i[0].x,i[0].y+l])):(o.push(["M",i[0].x,i[0].y]),o.push(["L",i[1].x,i[1].y]),o.push(["A",s,s,0,0,1,i[2].x,i[2].y]),o.push(["L",i[3].x,i[3].y]),o.push(["A",s,s,0,0,1,i[0].x,i[0].y])),o.push(["z"])):o=js(i),o}function Gv(i,r,t){var e=[];return I(r)?t?e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",(i[2].x+i[3].x)/2,(i[2].y+i[3].y)/2],["Z"]):e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",i[2].x,i[2].y],["L",i[3].x,i[3].y],["Z"]):e.push(["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["L",r[1].x,r[1].y],["L",r[0].x,r[0].y],["Z"]),e}function ii(i,r){return[r,i]}function Y1(i,r,t){var e,n,a,o,s,l,h,u=Y(et([],Y(i),!1),4),c=u[0],f=u[1],v=u[2],p=u[3],g=Y(typeof t=="number"?Array(4).fill(t):t,4),d=g[0],y=g[1],C=g[2],m=g[3];r.isTransposed&&(e=Y(ii(f,p),2),f=e[0],p=e[1]),r.isReflect("y")&&(n=Y(ii(c,f),2),c=n[0],f=n[1],a=Y(ii(v,p),2),v=a[0],p=a[1]),r.isReflect("x")&&(o=Y(ii(c,p),2),c=o[0],p=o[1],s=Y(ii(f,v),2),f=s[0],v=s[1]);var x=[],S=function(b){return Math.abs(b)};return l=Y(Rv([d,y,C,m],Math.min(S(p.x-c.x),S(f.y-c.y))).map(function(b){return S(b)}),4),d=l[0],y=l[1],C=l[2],m=l[3],r.isTransposed&&(h=Y([m,d,y,C],4),d=h[0],y=h[1],C=h[2],m=h[3]),c.y<f.y?(x.push(["M",p.x,p.y+C]),C!==0&&x.push(["A",C,C,0,0,0,p.x-C,p.y]),x.push(["L",c.x+m,c.y]),m!==0&&x.push(["A",m,m,0,0,0,c.x,c.y+m]),x.push(["L",f.x,f.y-d]),d!==0&&x.push(["A",d,d,0,0,0,f.x+d,f.y]),x.push(["L",v.x-y,v.y]),y!==0&&x.push(["A",y,y,0,0,0,v.x,v.y-y]),x.push(["L",p.x,p.y+C]),x.push(["z"])):p.x<c.x?(x.push(["M",v.x+y,v.y]),y!==0&&x.push(["A",y,y,0,0,0,v.x,v.y+y]),x.push(["L",p.x,p.y-C]),C!==0&&x.push(["A",C,C,0,0,0,p.x+C,p.y]),x.push(["L",c.x-m,c.y]),m!==0&&x.push(["A",m,m,0,0,0,c.x,c.y-m]),x.push(["L",f.x,f.y+d]),d!==0&&x.push(["A",d,d,0,0,0,f.x-d,f.y]),x.push(["L",v.x+y,v.y]),x.push(["z"])):(x.push(["M",f.x,f.y+d]),d!==0&&x.push(["A",d,d,0,0,1,f.x+d,f.y]),x.push(["L",v.x-y,v.y]),y!==0&&x.push(["A",y,y,0,0,1,v.x,v.y+y]),x.push(["L",p.x,p.y-C]),C!==0&&x.push(["A",C,C,0,0,1,p.x-C,p.y]),x.push(["L",c.x+m,c.y]),m!==0&&x.push(["A",m,m,0,0,1,c.x,c.y-m]),x.push(["L",f.x,f.y+d]),x.push(["z"])),x}Ze("interval",{defaultShapeType:"rect",getDefaultPoints:function(i){return _s(i)}});J("interval","rect",{draw:function(i,r){var t=lt(i,!1,!0),e=r,n=i==null?void 0:i.background;if(n){e=r.addGroup({name:"interval-group"});var a=gv(i),o=Yv(i,this.parsePoints(i.points),this.coordinate);e.addShape("path",{attrs:w(w({},a),{path:o}),zIndex:-1,name:Fs})}var s;t.radius&&this.coordinate.isRect?s=Y1(this.parsePoints(i.points),this.coordinate,t.radius):s=this.parsePath(R1(i.points,t.lineCap,this.coordinate));var l=e.addShape("path",{attrs:w(w({},t),{path:s}),name:"interval"});return n?e:l},getMarker:function(i){var r=i.color,t=i.isInPolar;return t?{symbol:"circle",style:{r:4.5,fill:r}}:{symbol:"square",style:{r:4,fill:r}}}});function G1(i,r){var t=i.length,e=i;N(e[0])&&(e=i.map(function(s){return r.translate(s)}));for(var n=e[1]-e[0],a=2;a<t;a++){var o=e[a]-e[a-1];n>o&&(n=o)}return n}function H1(i,r){if(r){var t=$t(i),e=Me(t,r);return e.length}return i.length}function Us(i){var r=i.theme,t=i.coordinate,e=i.getXScale(),n=e.values,a=i.beforeMappingData,o=n.length,s=_i(i.coordinate),l=i.intervalPadding,h=i.dodgePadding,u=i.maxColumnWidth||r.maxColumnWidth,c=i.minColumnWidth||r.minColumnWidth,f=i.columnWidthRatio||r.columnWidthRatio,v=i.multiplePieWidthRatio||r.multiplePieWidthRatio,p=i.roseWidthRatio||r.roseWidthRatio;if(e.isLinear&&n.length>1){n.sort();var g=G1(n,e);o=(e.max-e.min)/g,n.length>o&&(o=n.length)}var d=e.range,y=1/o,C=1;if(t.isPolar?t.isTransposed&&o>1?C=v:C=p:(e.isLinear&&(y*=d[1]-d[0]),C=f),!I(l)&&l>=0){var m=l/s;y=(1-(o-1)*m)/o}else y*=C;if(i.getAdjust("dodge")){var x=i.getAdjust("dodge"),S=x.dodgeBy,b=H1(a,S);if(!I(h)&&h>=0){var A=h/s;y=(y-A*(b-1))/b}else!I(l)&&l>=0&&(y*=C),y=y/b;y=y>=0?y:0}if(!I(u)&&u>=0){var L=u/s;y>L&&(y=L)}if(!I(c)&&c>=0){var k=c/s;y<k&&(y=k)}return y}var V1=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="interval",e.shapeType="interval",e.generatePoints=!0;var n=t.background;return e.background=n,e}return r.prototype.createShapePointsCfg=function(t){var e=i.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_i(o);n=n/s}else this.defaultSize||(this.defaultSize=Us(this)),n=this.defaultSize;return e.size=n,e},r.prototype.adjustScale=function(){i.prototype.adjustScale.call(this);var t=this.getYScale();if(this.coordinate.type==="theta")t.change({nice:!1,min:0,max:Ex(t)});else{var e=this.scaleDefs,n=t.field,a=t.min,o=t.max,s=t.type;s!=="time"&&(a>0&&!T(e,[n,"min"])&&t.change({min:0}),o<=0&&!T(e,[n,"max"])&&t.change({max:0}))}},r.prototype.getDrawCfg=function(t){var e=i.prototype.getDrawCfg.call(this,t);return e.background=this.background,e},r}(Qe),N1=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;e.type="line";var n=t.sortable,a=n===void 0?!1:n;return e.sortable=a,e}return r}($s),Hv=["circle","square","bowtie","diamond","hexagon","triangle","triangle-down"],X1=["cross","tick","plus","hyphen","line"];function qs(i,r,t,e,n){var a,o,s=lt(r,n,!n,"r"),l=i.parsePoints(r.points),h=l[0];if(r.isStack)h=l[1];else if(l.length>1){var u=t.addGroup();try{for(var c=$(l),f=c.next();!f.done;f=c.next()){var v=f.value;u.addShape({type:"marker",attrs:w(w(w({},s),{symbol:pr[e]||e}),v)})}}catch(p){a={error:p}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}return u}return t.addShape({type:"marker",attrs:w(w(w({},s),{symbol:pr[e]||e}),h)})}Ze("point",{defaultShapeType:"hollow-circle",getDefaultPoints:function(i){return Ys(i)}});M(Hv,function(i){J("point","hollow-".concat(i),{draw:function(r,t){return qs(this,r,t,i,!0)},getMarker:function(r){var t=r.color;return{symbol:pr[i]||i,style:{r:4.5,stroke:t,fill:null}}}})});var z1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="point",t.shapeType="point",t.generatePoints=!0,t}return r.prototype.getDrawCfg=function(t){var e=i.prototype.getDrawCfg.call(this,t);return w(w({},e),{isStack:!!this.getAdjust("stack")})},r}(Qe);function W1(i){for(var r=i[0],t=1,e=[["M",r.x,r.y]];t<i.length;){var n=i[t];(n.x!==i[t-1].x||n.y!==i[t-1].y)&&(e.push(["L",n.x,n.y]),n.x===r.x&&n.y===r.y&&t<i.length-1&&(r=i[t+1],e.push(["Z"]),e.push(["M",r.x,r.y]),t++)),t++}return gt(Ct(e),r)||e.push(["L",r.x,r.y]),e.push(["Z"]),e}Ze("polygon",{defaultShapeType:"polygon",getDefaultPoints:function(i){var r=[];return M(i.x,function(t,e){var n=i.y[e];r.push({x:t,y:n})}),r}});J("polygon","polygon",{draw:function(i,r){if(!pe(i.points)){var t=lt(i,!0,!0),e=this.parsePath(W1(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e}),name:"polygon"})}},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});var $1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polygon",t.shapeType="polygon",t.generatePoints=!0,t}return r.prototype.createShapePointsCfg=function(t){var e=i.prototype.createShapePointsCfg.call(this,t),n=e.x,a=e.y,o;if(!(P(n)&&P(a))){var s=this.getXScale(),l=this.getYScale(),h=s.values.length,u=l.values.length,c=.5*1/h,f=.5*1/u;s.isCategory&&l.isCategory?(n=[n-c,n-c,n+c,n+c],a=[a-f,a+f,a+f,a-f]):P(n)?(o=n,n=[o[0],o[0],o[1],o[1]],a=[a-f/2,a+f/2,a+f/2,a-f/2]):P(a)&&(o=a,a=[o[0],o[1],o[1],o[0]],n=[n-c/2,n-c/2,n+c/2,n+c/2]),e.x=n,e.y=a}return e},r}(Qe);Ze("schema",{defaultShapeType:""});var _1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="schema",t.shapeType="schema",t.generatePoints=!0,t}return r.prototype.createShapePointsCfg=function(t){var e=i.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_i(o);n=n/s}else this.defaultSize||(this.defaultSize=Us(this)),n=this.defaultSize;return e.size=n,e},r}(Qe);function j1(i){if(!P(i))return[];var r=Lt(i);return Et(i,function(t){return t/r})}Ze("violin",{defaultShapeType:"violin",getDefaultPoints:function(i){var r=i.size/2,t=[],e=j1(i._size);return M(i.y,function(n,a){var o=e[a]*r,s=a===0,l=a===i.y.length-1;t.push({isMin:s,isMax:l,x:i.x-o,y:n}),t.unshift({isMin:s,isMax:l,x:i.x+o,y:n})}),t}});J("violin","violin",{draw:function(i,r){var t=lt(i,!0,!0),e=this.parsePath(vv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e}),name:"violin"})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4,fill:r}}}});var U1=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="violin",t.shapeType="violin",t.generatePoints=!0,t}return r.prototype.createShapePointsCfg=function(t){var e=i.prototype.createShapePointsCfg.call(this,t),n,a=this.getAttribute("size");if(a){n=this.getAttributeValues(a,t)[0];var o=this.coordinate,s=_i(o);n=n/s}else this.defaultSize||(this.defaultSize=Us(this)),n=this.defaultSize;return e.size=n,e._size=T(t[Z],[this._sizeField]),e},r.prototype.initAttributes=function(){var t=this.attributeOption,e=t.size?t.size.fields[0]:this._sizeField?this._sizeField:"size";this._sizeField=e,delete t.size,i.prototype.initAttributes.call(this)},r}(Qe);J("area","line",{draw:function(i,r){var t=Pa(i,!0,!1,this),e=r.addShape({type:"path",attrs:t,name:"area"});return e},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return n===void 0&&(n=5.5),[["M",t-n,e-4],["L",t+n,e-4],["L",t+n,e+4],["L",t-n,e+4],["Z"]]},style:{r:5,stroke:r,fill:null}}}});J("area","smooth",{draw:function(i,r){var t=this.coordinate,e=Pa(i,!1,!0,this,Dv(t)),n=r.addShape({type:"path",attrs:e,name:"area"});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return n===void 0&&(n=5.5),[["M",t-n,e-4],["L",t+n,e-4],["L",t+n,e+4],["L",t-n,e+4],["Z"]]},style:{r:5,fill:r,fillOpacity:1}}}});J("area","smooth-line",{draw:function(i,r){var t=this.coordinate,e=Pa(i,!0,!0,this,Dv(t)),n=r.addShape({type:"path",attrs:e,name:"area"});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return n===void 0&&(n=5.5),[["M",t-n,e-4],["L",t+n,e-4],["L",t+n,e+4],["L",t-n,e+4],["Z"]]},style:{r:5,stroke:r,fill:null}}}});function Zo(i,r){return["C",i.x*1/2+r.x*1/2,i.y,i.x*1/2+r.x*1/2,r.y,r.x,r.y]}function Qo(i,r){var t=[];t.push({x:r.x,y:r.y}),t.push(i);var e=["Q"];return M(t,function(n){e.push(n.x,n.y)}),e}function q1(i,r,t){var e=Qo(r,t),n=[["M",i.x,i.y]];return n.push(e),n}function Z1(i,r){var t=Qo(i[1],r),e=Qo(i[3],r),n=[["M",i[0].x,i[0].y]];return n.push(e),n.push(["L",i[3].x,i[3].y]),n.push(["L",i[2].x,i[2].y]),n.push(t),n.push(["L",i[1].x,i[1].y]),n.push(["L",i[0].x,i[0].y]),n.push(["Z"]),n}J("edge","arc",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=i.points,n=e.length>2?"weight":"normal",a;if(i.isInCircle){var o={x:0,y:1};return n==="normal"?a=q1(e[0],e[1],o):(t.fill=t.stroke,a=Z1(e,o)),a=this.parsePath(a),r.addShape("path",{attrs:w(w({},t),{path:a})})}else{if(n==="normal")return e=this.parsePoints(e),a=If((e[1].x+e[0].x)/2,e[0].y,Math.abs(e[1].x-e[0].x)/2,Math.PI,Math.PI*2),r.addShape("path",{attrs:w(w({},t),{path:a})});var s=Zo(e[1],e[3]),l=Zo(e[2],e[0]);return a=[["M",e[0].x,e[0].y],["L",e[1].x,e[1].y],s,["L",e[3].x,e[3].y],["L",e[2].x,e[2].y],l,["Z"]],a=this.parsePath(a),t.fill=t.stroke,r.addShape("path",{attrs:w(w({},t),{path:a})})}},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});function Q1(i,r){var t=Zo(i,r),e=[["M",i.x,i.y]];return e.push(t),e}J("edge","smooth",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=i.points,n=this.parsePath(Q1(e[0],e[1]));return r.addShape("path",{attrs:w(w({},t),{path:n})})},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});var mn=1/3;function K1(i,r){var t=[];t.push({x:i.x,y:i.y*(1-mn)+r.y*mn}),t.push({x:r.x,y:i.y*(1-mn)+r.y*mn}),t.push(r);var e=[["M",i.x,i.y]];return M(t,function(n){e.push(["L",n.x,n.y])}),e}J("edge","vhv",{draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=i.points,n=this.parsePath(K1(e[0],e[1]));return r.addShape("path",{attrs:w(w({},t),{path:n})})},getMarker:function(i){return{symbol:"circle",style:{r:4.5,fill:i.color}}}});J("interval","funnel",{getPoints:function(i){return i.size=i.size*2,_s(i)},draw:function(i,r){var t=lt(i,!1,!0),e=this.parsePath(Gv(i.points,i.nextPoints,!1)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});J("interval","hollow-rect",{draw:function(i,r){var t=lt(i,!0,!1),e=r,n=i==null?void 0:i.background;if(n){e=r.addGroup();var a=gv(i),o=Yv(i,this.parsePoints(i.points),this.coordinate);e.addShape("path",{attrs:w(w({},a),{path:o}),zIndex:-1,name:Fs})}var s=this.parsePath(js(i.points)),l=e.addShape("path",{attrs:w(w({},t),{path:s}),name:"interval"});return n?e:l},getMarker:function(i){var r=i.color,t=i.isInPolar;return t?{symbol:"circle",style:{r:4.5,stroke:r,fill:null}}:{symbol:"square",style:{r:4,stroke:r,fill:null}}}});function J1(i){var r=i.x,t=i.y,e=i.y0;return P(t)?t.map(function(n,a){return{x:P(r)?r[a]:r,y:n}}):[{x:r,y:e},{x:r,y:t}]}J("interval","line",{getPoints:function(i){return J1(i)},draw:function(i,r){var t=lt(i,!0,!1,"lineWidth"),e=Ft(w({},t),["fill"]),n=this.parsePath(js(i.points,!1)),a=r.addShape("path",{attrs:w(w({},e),{path:n}),name:"interval"});return a},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return[["M",t,e-n],["L",t,e+n]]},style:{r:5,stroke:r}}}});J("interval","pyramid",{getPoints:function(i){return i.size=i.size*2,_s(i)},draw:function(i,r){var t=lt(i,!1,!0),e=this.parsePath(Gv(i.points,i.nextPoints,!0)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});function tM(i){var r,t=i.x,e=i.y,n=i.y0,a=i.size,o,s;P(e)?(r=Y(e,2),o=r[0],s=r[1]):(o=n,s=e);var l=t+a/2,h=t-a/2;return[{x:t,y:o},{x:t,y:s},{x:h,y:o},{x:l,y:o},{x:h,y:s},{x:l,y:s}]}function eM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y]]}J("interval","tick",{getPoints:function(i){return tM(i)},draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(eM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e}),name:"interval"});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]},style:{r:5,stroke:r}}}});var rM=function(i,r,t){var e=i.x,n=i.y,a=r.x,o=r.y,s;switch(t){case"hv":s=[{x:a,y:n}];break;case"vh":s=[{x:e,y:o}];break;case"hvh":var l=(a+e)/2;s=[{x:l,y:n},{x:l,y:o}];break;case"vhv":var h=(n+o)/2;s=[{x:e,y:h},{x:a,y:h}];break}return s};function iM(i,r){var t=[];return M(i,function(e,n){var a=i[n+1];if(t.push(e),a){var o=rM(e,a,r);t=t.concat(o)}}),t}function nM(i){return i.map(function(r,t){return t===0?["M",r.x,r.y]:["L",r.x,r.y]})}function aM(i,r){var t=Rs(i.points,i.connectNulls,i.showSinglePoint),e=[];return M(t,function(n){var a=iM(n,r);e=e.concat(nM(a))}),w(w({},lt(i,!0,!1,"lineWidth")),{path:e})}M(["hv","vh","hvh","vhv"],function(i){J("line",i,{draw:function(r,t){var e=aM(r,i),n=t.addShape({type:"path",attrs:e,name:"line"});return n},getMarker:function(r){return dv(r,i)}})});M(X1,function(i){J("point",i,{draw:function(r,t){return qs(this,r,t,i,!0)},getMarker:function(r){var t=r.color;return{symbol:pr[i],style:{r:4.5,stroke:t,fill:null}}}})});J("point","image",{draw:function(i,r){var t,e,n=lt(i,!1,!1,"r").r,a=this.parsePoints(i.points),o=a[0];if(i.isStack)o=a[1];else if(a.length>1){var s=r.addGroup();try{for(var l=$(a),h=l.next();!h.done;h=l.next()){var u=h.value;s.addShape("image",{attrs:{x:u.x-n/2,y:u.y-n,width:n,height:n,img:i.shape[1]}})}}catch(c){t={error:c}}finally{try{h&&!h.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}return s}return r.addShape("image",{attrs:{x:o.x-n/2,y:o.y-n,width:n,height:n,img:i.shape[1]}})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4.5,fill:r}}}});M(Hv,function(i){J("point",i,{draw:function(r,t){return qs(this,r,t,i,!1)},getMarker:function(r){var t=r.color;return{symbol:pr[i]||i,style:{r:4.5,fill:t}}}})});function ou(i){var r=P(i)?i:[i],t=r[0],e=r[r.length-1],n=r.length>1?r[1]:t,a=r.length>3?r[3]:e,o=r.length>2?r[2]:n;return{min:t,max:e,min1:n,max1:a,median:o}}function su(i,r,t){var e=t/2,n;if(P(r)){var a=ou(r),o=a.min,s=a.max,l=a.median,h=a.min1,u=a.max1,c=i-e,f=i+e;n=[[c,s],[f,s],[i,s],[i,u],[c,h],[c,u],[f,u],[f,h],[i,h],[i,o],[c,o],[f,o],[c,l],[f,l]]}else{r=I(r)?.5:r;var v=ou(i),o=v.min,s=v.max,l=v.median,h=v.min1,u=v.max1,p=r-e,g=r+e;n=[[o,p],[o,g],[o,r],[h,r],[h,p],[h,g],[u,g],[u,p],[u,r],[s,r],[s,p],[s,g],[l,p],[l,g]]}return n.map(function(d){return{x:d[0],y:d[1]}})}function oM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["M",i[4].x,i[4].y],["L",i[5].x,i[5].y],["L",i[6].x,i[6].y],["L",i[7].x,i[7].y],["L",i[4].x,i[4].y],["Z"],["M",i[8].x,i[8].y],["L",i[9].x,i[9].y],["M",i[10].x,i[10].y],["L",i[11].x,i[11].y],["M",i[12].x,i[12].y],["L",i[13].x,i[13].y]]}J("schema","box",{getPoints:function(i){var r=i.x,t=i.y,e=i.size;return su(r,t,e)},draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(oM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e,name:"schema"})});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){var a=[e-6,e-3,e,e+3,e+6],o=su(t,a,n);return[["M",o[0].x+1,o[0].y],["L",o[1].x-1,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["M",o[4].x,o[4].y],["L",o[5].x,o[5].y],["L",o[6].x,o[6].y],["L",o[7].x,o[7].y],["L",o[4].x,o[4].y],["Z"],["M",o[8].x,o[8].y],["L",o[9].x,o[9].y],["M",o[10].x+1,o[10].y],["L",o[11].x-1,o[11].y],["M",o[12].x,o[12].y],["L",o[13].x,o[13].y]]},style:{r:6,lineWidth:1,stroke:r}}}});function sM(i){var r=P(i)?i:[i],t=r.sort(function(e,n){return n-e});return xx(t,4,t[t.length-1])}function lu(i,r,t){var e=sM(r);return[{x:i,y:e[0]},{x:i,y:e[1]},{x:i-t/2,y:e[2]},{x:i-t/2,y:e[1]},{x:i+t/2,y:e[1]},{x:i+t/2,y:e[2]},{x:i,y:e[2]},{x:i,y:e[3]}]}function lM(i){return[["M",i[0].x,i[0].y],["L",i[1].x,i[1].y],["M",i[2].x,i[2].y],["L",i[3].x,i[3].y],["L",i[4].x,i[4].y],["L",i[5].x,i[5].y],["Z"],["M",i[6].x,i[6].y],["L",i[7].x,i[7].y]]}J("schema","candle",{getPoints:function(i){var r=i.x,t=i.y,e=i.size;return lu(r,t,e)},draw:function(i,r){var t=lt(i,!0,!0),e=this.parsePath(lM(i.points)),n=r.addShape("path",{attrs:w(w({},t),{path:e,name:"schema"})});return n},getMarker:function(i){var r=i.color;return{symbol:function(t,e,n){var a=[e+7.5,e+3,e-3,e-7.5],o=lu(t,a,n);return[["M",o[0].x,o[0].y],["L",o[1].x,o[1].y],["M",o[2].x,o[2].y],["L",o[3].x,o[3].y],["L",o[4].x,o[4].y],["L",o[5].x,o[5].y],["Z"],["M",o[6].x,o[6].y],["L",o[7].x,o[7].y]]},style:{lineWidth:1,stroke:r,fill:r,r:6}}}});function hM(i,r){var t=Math.abs(i[0].x-i[2].x),e=Math.abs(i[0].y-i[2].y),n=Math.min(t,e);r&&(n=at(r,0,Math.min(t,e))),n=n/2;var a=(i[0].x+i[2].x)/2,o=(i[0].y+i[2].y)/2;return{x:a-n,y:o-n,width:n*2,height:n*2}}J("polygon","square",{draw:function(i,r){if(!pe(i.points)){var t=lt(i,!0,!0),e=this.parsePoints(i.points);return r.addShape("rect",{attrs:w(w({},t),hM(e,i.size)),name:"polygon"})}},getMarker:function(i){var r=i.color;return{symbol:"square",style:{r:4,fill:r}}}});J("violin","smooth",{draw:function(i,r){var t=lt(i,!0,!0),e=this.parsePath(pv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{stroke:null,r:4,fill:r}}}});J("violin","hollow",{draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(vv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4,fill:null,stroke:r}}}});J("violin","hollow-smooth",{draw:function(i,r){var t=lt(i,!0,!1),e=this.parsePath(pv(i.points));return r.addShape("path",{attrs:w(w({},t),{path:e})})},getMarker:function(i){var r=i.color;return{symbol:"circle",style:{r:4,fill:null,stroke:r}}}});var uM=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getLabelValueDir=function(t){var e="y",n=t.points;return n[0][e]<=n[2][e]?1:-1},r.prototype.getLabelOffsetPoint=function(t,e,n,a){var o,s=i.prototype.getLabelOffsetPoint.call(this,t,e,n),l=this.getCoordinate(),h=l.isTransposed,u=h?"x":"y",c=this.getLabelValueDir(t.mappingData);return s=w(w({},s),(o={},o[u]=s[u]*c,o)),l.isReflect("x")&&(s=w(w({},s),{x:s.x*-1})),l.isReflect("y")&&(s=w(w({},s),{y:s.y*-1})),s},r.prototype.getThemedLabelCfg=function(t){var e=this.geometry,n=this.getDefaultLabelCfg(),a=e.theme;return D({},n,a.labels,t.position==="middle"?{offset:0}:{},t)},r.prototype.setLabelPosition=function(t,e,n,a){var o=this.getCoordinate(),s=o.isTransposed,l=e.points,h=o.convert(l[0]),u=o.convert(l[2]),c=this.getLabelValueDir(e),f,v,p,g,d=P(e.shape)?e.shape[0]:e.shape;if(d==="funnel"||d==="pyramid"){var y=T(e,"nextPoints"),C=T(e,"points");if(y){var m=o.convert(C[0]),x=o.convert(C[1]),S=o.convert(y[0]),b=o.convert(y[1]);s?(f=Math.min(S.y,m.y),p=Math.max(S.y,m.y),v=(x.x+b.x)/2,g=(m.x+S.x)/2):(f=Math.min((x.y+b.y)/2,(m.y+S.y)/2),p=Math.max((x.y+b.y)/2,(m.y+S.y)/2),v=b.x,g=m.x)}else f=Math.min(u.y,h.y),p=Math.max(u.y,h.y),v=u.x,g=h.x}else f=Math.min(u.y,h.y),p=Math.max(u.y,h.y),v=u.x,g=h.x;switch(a){case"right":t.x=v,t.y=(f+p)/2,t.textAlign=T(t,"textAlign",c>0?"left":"right");break;case"left":t.x=g,t.y=(f+p)/2,t.textAlign=T(t,"textAlign",c>0?"left":"right");break;case"bottom":s&&(t.x=(v+g)/2),t.y=p,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline",c>0?"bottom":"top");break;case"middle":s&&(t.x=(v+g)/2),t.y=(f+p)/2,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline","middle");break;case"top":s&&(t.x=(v+g)/2),t.y=f,t.textAlign=T(t,"textAlign","center"),t.textBaseline=T(t,"textBaseline",c>0?"bottom":"top");break}},r}(Ds),xn=Math.PI/2,Vv=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getLabelOffset=function(t){var e=this.getCoordinate(),n=0;if(U(t))n=t;else if(N(t)&&t.indexOf("%")!==-1){var a=e.getRadius();e.innerRadius>0&&(a=a*(1-e.innerRadius)),n=parseFloat(t)*.01*a}return n},r.prototype.getLabelItems=function(t){var e=i.prototype.getLabelItems.call(this,t),n=this.geometry.getYScale();return Et(e,function(a){if(a&&n){var o=n.scale(T(a.data,n.field));return w(w({},a),{percent:o})}return a})},r.prototype.getLabelAlign=function(t){var e=this.getCoordinate(),n;if(t.labelEmit)n=t.angle<=Math.PI/2&&t.angle>=-Math.PI/2?"left":"right";else if(!e.isTransposed)n="center";else{var a=e.getCenter(),o=t.offset;Math.abs(t.x-a.x)<1?n="center":t.angle>Math.PI||t.angle<=0?n=o>0?"left":"right":n=o>0?"right":"left"}return n},r.prototype.getLabelPoint=function(t,e,n){var a=1,o,s=t.content[n];this.isToMiddle(e)?o=this.getMiddlePoint(e.points):(t.content.length===1&&n===0?n=1:n===0&&(a=-1),o=this.getArcPoint(e,n));var l=t.offset*a,h=this.getPointAngle(o),u=t.labelEmit,c=this.getCirclePoint(h,l,o,u);return c.r===0?c.content="":(c.content=s,c.angle=h,c.color=e.color),c.rotate=t.autoRotate?this.getLabelRotate(h,l,u):t.rotate,c.start={x:o.x,y:o.y},c},r.prototype.getArcPoint=function(t,e){return e===void 0&&(e=0),!P(t.x)&&!P(t.y)?{x:t.x,y:t.y}:{x:P(t.x)?t.x[e]:t.x,y:P(t.y)?t.y[e]:t.y}},r.prototype.getPointAngle=function(t){return Yr(this.getCoordinate(),t)},r.prototype.getCirclePoint=function(t,e,n,a){var o=this.getCoordinate(),s=o.getCenter(),l=Ba(o,n);if(l===0)return w(w({},s),{r:l});var h=t;if(o.isTransposed&&l>e&&!a){var u=Math.asin(e/(2*l));h=t+u*2}else l=l+e;return{x:s.x+l*Math.cos(h),y:s.y+l*Math.sin(h),r:l}},r.prototype.getLabelRotate=function(t,e,n){var a=t+xn;return n&&(a-=xn),a&&(a>xn?a=a-Math.PI:a<-xn&&(a=a+Math.PI)),a},r.prototype.getMiddlePoint=function(t){var e=this.getCoordinate(),n=t.length,a={x:0,y:0};return M(t,function(o){a.x+=o.x,a.y+=o.y}),a.x/=n,a.y/=n,a=e.convert(a),a},r.prototype.isToMiddle=function(t){return t.x.length>2},r}(Ds),cM=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.defaultLayout="distribute",t}return r.prototype.getDefaultLabelCfg=function(t,e){var n=i.prototype.getDefaultLabelCfg.call(this,t,e);return D({},n,T(this.geometry.theme,"pieLabels",{}))},r.prototype.getLabelOffset=function(t){return i.prototype.getLabelOffset.call(this,t)||0},r.prototype.getLabelRotate=function(t,e,n){var a;return e<0&&(a=t,a>Math.PI/2&&(a=a-Math.PI),a<-Math.PI/2&&(a=a+Math.PI)),a},r.prototype.getLabelAlign=function(t){var e=this.getCoordinate(),n=e.getCenter(),a;return t.angle<=Math.PI/2&&t.x>=n.x?a="left":a="right",t.offset<=0&&(a==="right"?a="left":a="right"),a},r.prototype.getArcPoint=function(t){return t},r.prototype.getPointAngle=function(t){var e=this.getCoordinate(),n={x:P(t.x)?t.x[0]:t.x,y:t.y[0]},a={x:P(t.x)?t.x[1]:t.x,y:t.y[1]},o,s=Yr(e,n);if(t.points&&t.points[0].y===t.points[1].y)o=s;else{var l=Yr(e,a);s>=l&&(l=l+Math.PI*2),o=s+(l-s)/2}return o},r.prototype.getCirclePoint=function(t,e){var n=this.getCoordinate(),a=n.getCenter(),o=n.getRadius()+e;return w(w({},ft(a.x,a.y,o,t)),{angle:t,r:o})},r}(Vv),hu=4;function fM(i,r,t,e,n,a){var o,s,l=!0,h=e.start,u=e.end,c=Math.min(h.y,u.y),f=Math.abs(h.y-u.y),v,p=0,g=Number.MIN_VALUE,d=r.map(function(A){return A.y>p&&(p=A.y),A.y<g&&(g=A.y),{size:t,targets:[A.y-c]}});for(g-=c,p-c>f&&(f=p-c);l;)for(d.forEach(function(A){var L=(Math.min.apply(g,A.targets)+Math.max.apply(g,A.targets))/2;A.pos=Math.min(Math.max(g,L-A.size/2),f-A.size)}),l=!1,v=d.length;v--;)if(v>0){var y=d[v-1],C=d[v];y.pos+y.size>C.pos&&(y.size+=C.size,y.targets=y.targets.concat(C.targets),y.pos+y.size>f&&(y.pos=f-y.size),d.splice(v,1),l=!0)}v=0,d.forEach(function(A){var L=c+t/2;A.targets.forEach(function(){r[v].y=A.pos+L,L+=t,v++})});var m={};try{for(var x=$(i),S=x.next();!S.done;S=x.next()){var b=S.value;m[b.get("id")]=b}}catch(A){o={error:A}}finally{try{S&&!S.done&&(s=x.return)&&s.call(x)}finally{if(o)throw o.error}}r.forEach(function(A){var L=A.r*A.r,k=Math.pow(Math.abs(A.y-n.y),2);if(L<k)A.x=n.x;else{var B=Math.sqrt(L-k);a?A.x=n.x+B:A.x=n.x-B}var O=m[A.id];O.attr("x",A.x),O.attr("y",A.y);var R=Ce(O.getChildren(),function(H){return H.get("type")==="text"});R&&(R.attr("y",A.y),R.attr("x",A.x))})}function vM(i,r,t,e){if(!(!i.length||!r.length)){var n=i[0]?i[0].offset:0,a=r[0].get("coordinate"),o=a.getRadius(),s=a.getCenter();if(n>0){var l=14,h=o+n,u=h*2+l*2,c={start:a.start,end:a.end},f=[[],[]];i.forEach(function(v){!v||(v.textAlign==="right"?f[0].push(v):f[1].push(v))}),f.forEach(function(v,p){var g=u/l;v.length>g&&(v.sort(function(d,y){return y["..percent"]-d["..percent"]}),v.splice(g,v.length-g)),v.sort(function(d,y){return d.y-y.y}),fM(r,v,l,c,s,p)})}M(i,function(v){if(v&&v.labelLine){var p=v.offset,g=v.angle,d=ft(s.x,s.y,o,g),y=ft(s.x,s.y,o+p/2,g),C=v.x+T(v,"offsetX",0),m=v.y+T(v,"offsetY",0),x={x:C-Math.cos(g)*hu,y:m-Math.sin(g)*hu};rt(v.labelLine)||(v.labelLine={}),v.labelLine.path=["M ".concat(d.x),"".concat(d.y," Q").concat(y.x),"".concat(y.y," ").concat(x.x),x.y].join(",")}})}}function Nv(i,r,t){var e=i.filter(function(p){return!p.invisible});e.sort(function(p,g){return p.y-g.y});var n=!0,a=t.minY,o=t.maxY,s=Math.abs(a-o),l,h=0,u=Number.MIN_VALUE,c=e.map(function(p){return p.y>h&&(h=p.y),p.y<u&&(u=p.y),{content:p.content,size:r,targets:[p.y-a],pos:null}});for(u-=a,h-a>s&&(s=h-a);n;)for(c.forEach(function(p){var g=(Math.min.apply(u,p.targets)+Math.max.apply(u,p.targets))/2;p.pos=Math.min(Math.max(u,g-p.size/2),s-p.size),p.pos=Math.max(0,p.pos)}),n=!1,l=c.length;l--;)if(l>0){var f=c[l-1],v=c[l];f.pos+f.size>v.pos&&(f.size+=v.size,f.targets=f.targets.concat(v.targets),f.pos+f.size>s&&(f.pos=s-f.size),c.splice(l,1),n=!0)}l=0,c.forEach(function(p){var g=a+r/2;p.targets.forEach(function(){e[l].y=p.pos+g,g+=r,l++})})}var uu=4;function pM(i,r){var t=r.getCenter(),e=r.getRadius();if(i&&i.labelLine){var n=i.angle,a=i.offset,o=ft(t.x,t.y,e,n),s=i.x+T(i,"offsetX",0)*(Math.cos(n)>0?1:-1),l=i.y+T(i,"offsetY",0)*(Math.sin(n)>0?1:-1),h={x:s-Math.cos(n)*uu,y:l-Math.sin(n)*uu},u=i.labelLine.smooth,c=[],f=h.x-t.x,v=h.y-t.y,p=Math.atan(v/f);if(f<0&&(p+=Math.PI),u===!1){rt(i.labelLine)||(i.labelLine={});var g=0;(n<0&&n>-Math.PI/2||n>Math.PI*1.5)&&h.y>o.y&&(g=1),n>=0&&n<Math.PI/2&&h.y>o.y&&(g=1),n>=Math.PI/2&&n<Math.PI&&o.y>h.y&&(g=1),(n<-Math.PI/2||n>=Math.PI&&n<Math.PI*1.5)&&o.y>h.y&&(g=1);var d=a/2>4?4:Math.max(a/2-1,0),y=ft(t.x,t.y,e+d,n),C=ft(t.x,t.y,e+a/2,p),m=0;c.push("M ".concat(o.x," ").concat(o.y)),c.push("L ".concat(y.x," ").concat(y.y)),c.push("A ".concat(t.x," ").concat(t.y," 0 ").concat(m," ").concat(g," ").concat(C.x," ").concat(C.y)),c.push("L ".concat(h.x," ").concat(h.y))}else{var y=ft(t.x,t.y,e+(a/2>4?4:Math.max(a/2-1,0)),n),x=o.x<t.x?1:-1;c.push("M ".concat(h.x," ").concat(h.y));var S=(o.y-t.y)/(o.x-t.x),b=(h.y-t.y)/(h.x-t.x);Math.abs(S-b)>Math.pow(Math.E,-16)&&c.push.apply(c,["C",h.x+x*4,h.y,2*y.x-o.x,2*y.y-o.y,o.x,o.y]),c.push("L ".concat(o.x," ").concat(o.y))}i.labelLine.path=c.join(" ")}}function gM(i,r,t,e){var n,a,o=Qt(i,function(L){return!I(L)}),s=r[0]&&r[0].get("coordinate");if(!!s){var l=s.getCenter(),h=s.getRadius(),u={};try{for(var c=$(r),f=c.next();!f.done;f=c.next()){var v=f.value;u[v.get("id")]=v}}catch(L){n={error:L}}finally{try{f&&!f.done&&(a=c.return)&&a.call(c)}finally{if(n)throw n.error}}var p=T(o[0],"labelHeight",14),g=T(o[0],"offset",0);if(!(g<=0)){var d="left",y="right",C=Ue(o,function(L){return L.x<l.x?d:y}),m=s.start,x=s.end,S=Math.min((h+g+p)*2,s.getHeight()),b=S/2,A={minX:m.x,maxX:x.x,minY:l.y-b,maxY:l.y+b};M(C,function(L,k){var B=Math.floor(S/p);L.length>B&&(L.sort(function(O,R){return R.percent-O.percent}),M(L,function(O,R){R+1>B&&(u[O.id].set("visible",!1),O.invisible=!0)})),Nv(L,p,A)}),M(C,function(L,k){M(L,function(B){var O=k===y,R=u[B.id],H=R.getChildByIndex(0);if(H){var z=h+g,_=B.y-l.y,K=Math.pow(z,2),nt=Math.pow(_,2),ht=K-nt>0?K-nt:0,Q=Math.sqrt(ht),ut=Math.abs(Math.cos(B.angle)*z);O?B.x=l.x+Math.max(Q,ut):B.x=l.x-Math.max(Q,ut)}H&&(H.attr("y",B.y),H.attr("x",B.x)),pM(B,s)})})}}}var Ko=4,dM=4,cu=4;function yM(i,r,t){var e=r.getCenter(),n=r.getRadius(),a={x:i.x-(t?cu:-cu),y:i.y},o=ft(e.x,e.y,n+Ko,i.angle),s={x:a.x,y:a.y},l={x:o.x,y:o.y},h=ft(e.x,e.y,n,i.angle),u="";if(a.y!==o.y){var c=t?4:-4;s.y=a.y,i.angle<0&&i.angle>=-Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),i.angle>0&&i.angle<Math.PI/2&&(s.x=Math.max(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.max(l.x,s.x-c))),i.angle>Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y>o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c))),i.angle<-Math.PI/2&&(s.x=Math.min(o.x,a.x-c),a.y<o.y?l.y=s.y:(l.y=o.y,l.x=Math.min(l.x,s.x-c)))}u=["M ".concat(a.x,",").concat(a.y),"L ".concat(s.x,",").concat(s.y),"L ".concat(l.x,",").concat(l.y),"L ".concat(o.x,",").concat(o.y),"L ".concat(h.x,",").concat(h.y)].join(" "),i.labelLine=D({},i.labelLine,{path:u})}function mM(i,r,t,e){var n,a,o=r[0]&&r[0].get("coordinate");if(!!o){var s=o.getCenter(),l=o.getRadius(),h={};try{for(var u=$(r),c=u.next();!c.done;c=u.next()){var f=c.value;h[f.get("id")]=f}}catch(L){n={error:L}}finally{try{c&&!c.done&&(a=u.return)&&a.call(u)}finally{if(n)throw n.error}}var v=T(i[0],"labelHeight",14),p=Math.max(T(i[0],"offset",0),Ko);M(i,function(L){if(!!L){var k=T(h,[L.id]);if(!!k){var B=L.x>s.x||L.x===s.x&&L.y>s.y,O=I(L.offsetX)?dM:L.offsetX,R=ft(s.x,s.y,l+Ko,L.angle),H=p+O;L.x=s.x+(B?1:-1)*(l+H),L.y=R.y}}});var g=o.start,d=o.end,y="left",C="right",m=Ue(i,function(L){return L.x<s.x?y:C}),x=(l+p)*2+v;M(m,function(L){var k=L.length*v;k>x&&(x=Math.min(k,Math.abs(g.y-d.y)))});var S={minX:g.x,maxX:d.x,minY:s.y-x/2,maxY:s.y+x/2};M(m,function(L,k){var B=x/v;L.length>B&&(L.sort(function(O,R){return R.percent-O.percent}),M(L,function(O,R){R>B&&(h[O.id].set("visible",!1),O.invisible=!0)})),Nv(L,v,S)});var b=S.minY,A=S.maxY;M(m,function(L,k){var B=k===C;M(L,function(O){var R=T(h,O&&[O.id]);if(!!R){if(O.y<b||O.y>A){R.set("visible",!1);return}var H=R.getChildByIndex(0),z=H.getCanvasBBox(),_={x:B?z.x:z.maxX,y:z.y+z.height/2};Ia(H,O.x-_.x,O.y-_.y),O.labelLine&&yM(O,o,B)}})})}}function xM(i,r,t,e){M(r,function(n){var a=e.minX,o=e.minY,s=e.maxX,l=e.maxY,h=n.getCanvasBBox(),u=h.minX,c=h.minY,f=h.maxX,v=h.maxY,p=h.x,g=h.y,d=h.width,y=h.height,C=p,m=g;(u<a||f<a)&&(C=a),(c<o||v<o)&&(m=o),u>s?C=s-d:f>s&&(C=C-(f-s)),c>l?m=l-y:v>l&&(m=m-(v-l)),(C!==p||m!==g)&&Ia(n,C-p,m-g)})}function wM(i,r,t,e){M(r,function(n,a){var o=n.getCanvasBBox(),s=t[a].getBBox();(o.minX<s.minX||o.minY<s.minY||o.maxX>s.maxX||o.maxY>s.maxY)&&n.remove(!0)})}var CM=100,Xv=function(){function i(r){r===void 0&&(r={}),this.bitmap={};var t=r.xGap,e=t===void 0?1:t,n=r.yGap,a=n===void 0?8:n;this.xGap=e,this.yGap=a}return i.prototype.hasGap=function(r){for(var t=!0,e=this.bitmap,n=Math.round(r.minX),a=Math.round(r.maxX),o=Math.round(r.minY),s=Math.round(r.maxY),l=n;l<=a;l+=1){if(!e[l]){e[l]={};continue}if(l===n||l===a){for(var h=o;h<=s;h++)if(e[l][h]){t=!1;break}}else if(e[l][o]||e[l][s]){t=!1;break}}return t},i.prototype.fillGap=function(r){for(var t=this.bitmap,e=Math.round(r.minX),n=Math.round(r.maxX),a=Math.round(r.minY),o=Math.round(r.maxY),s=e;s<=n;s+=1)t[s]||(t[s]={});for(var s=e;s<=n;s+=this.xGap){for(var l=a;l<=o;l+=this.yGap)t[s][l]=!0;t[s][o]=!0}if(this.yGap!==1)for(var s=a;s<=o;s+=1)t[e][s]=!0,t[n][s]=!0;if(this.xGap!==1)for(var s=e;s<=n;s+=1)t[s][a]=!0,t[s][o]=!0},i.prototype.destroy=function(){this.bitmap={}},i}();function MM(i,r,t){t===void 0&&(t=CM);var e=-1,n=i.attr(),a=n.x,o=n.y,s=i.getCanvasBBox(),l=Math.sqrt(s.width*s.width+s.height*s.height),h,u=-e,c=0,f=0,v=function(y){var C=y*.1;return[C*Math.cos(C),C*Math.sin(C)]};if(r.hasGap(s))return r.fillGap(s),!0;for(var p=!1,g=0,d={};Math.min(Math.abs(c),Math.abs(f))<l&&g<t;)if(h=v(u+=e),c=~~h[0],f=~~h[1],!(!c&&!f||d["".concat(c,"-").concat(f)])&&(i.attr({x:a+c,y:o+f}),c+f<0&&i.attr("textAlign","right"),g++,r.hasGap(i.getCanvasBBox()))){r.fillGap(i.getCanvasBBox()),p=!0,d["".concat(c,"-").concat(f)]=!0;break}return p}function SM(i,r,t,e){var n=i.getCanvasBBox(),a=n.width,o=n.height,s={x:r,y:t,textAlign:"center"};switch(e){case 0:s.y-=o+1,s.x+=1,s.textAlign="left";break;case 1:s.y-=o+1,s.x-=1,s.textAlign="right";break;case 2:s.y+=o+1,s.x-=1,s.textAlign="right";break;case 3:s.y+=o+1,s.x+=1,s.textAlign="left";break;case 5:s.y-=o*2+2;break;case 6:s.y+=o*2+2;break;case 7:s.x+=a+1,s.textAlign="left";break;case 8:s.x-=a+1,s.textAlign="right";break}return i.attr(s),i.getCanvasBBox()}function bM(i,r,t,e){var n=new Xv;M(r,function(a){var o=a.find(function(s){return s.get("type")==="text"});MM(o,n)||a.remove(!0)}),n.destroy()}function AM(i,r,t,e){var n=new Xv;M(r,function(a){for(var o=a.find(function(v){return v.get("type")==="text"}),s=o.attr(),l=s.x,h=s.y,u=!1,c=0;c<=8;c++){var f=SM(o,l,h,c);if(n.hasGap(f)){n.fillGap(f),u=!0;break}}u||a.remove(!0)}),n.destroy()}function TM(i,r){return(i[0]||0)*(r[0]||0)+(i[1]||0)*(r[1]||0)+(i[2]||0)*(r[2]||0)}function fu(i){if(i.length>4)return[];var r=function(n,a){return[a.x-n.x,a.y-n.y]},t=r(i[0],i[1]),e=r(i[1],i[2]);return[t,e]}function wn(i,r,t){r===void 0&&(r=0),t===void 0&&(t={x:0,y:0});var e=i.x,n=i.y;return{x:(e-t.x)*Math.cos(-r)+(n-t.y)*Math.sin(-r)+t.x,y:(t.x-e)*Math.sin(-r)+(n-t.y)*Math.cos(-r)+t.y}}function vu(i){var r=[{x:i.x,y:i.y},{x:i.x+i.width,y:i.y},{x:i.x+i.width,y:i.y+i.height},{x:i.x,y:i.y+i.height}],t=i.rotation;return t?[wn(r[0],t,r[0]),wn(r[1],t,r[0]),wn(r[2],t,r[0]),wn(r[3],t,r[0])]:r}function pu(i,r){if(i.length>4)return{min:0,max:0};var t=[];return i.forEach(function(e){t.push(TM([e.x,e.y],r))}),{min:Math.min.apply(Math,et([],Y(t),!1)),max:Math.max.apply(Math,et([],Y(t),!1))}}function LM(i,r){return i.max>r.min&&i.min<r.max}function EM(i){return typeof i=="number"&&!Number.isNaN(i)&&i!==1/0&&i!==-1/0}function gu(i){return["x","y","width","height"].every(function(r){return EM(i[r])})}function BM(i,r,t){return t===void 0&&(t=0),!(r.x>i.x+i.width+t||r.x+r.width<i.x-t||r.y>i.y+i.height+t||r.y+r.height<i.y-t)}function kM(i,r,t){if(t===void 0&&(t=0),!gu(i)||!gu(r))return!1;if(!i.rotation&&!r.rotation)return BM(i,r,t);for(var e=vu(i),n=vu(r),a=fu(e).concat(fu(n)),o=0;o<a.length;o++){var s=a[o],l=pu(e,s),h=pu(n,s);if(!LM(l,h))return!1}return!0}var IM=function(){function i(r){var t=this;this.queue=[],this.worker=new Worker(r),this.worker.onmessage=function(e){var n;(n=t.queue.shift())===null||n===void 0||n.resolve(e)},this.worker.onmessageerror=function(e){var n;console.warn("[AntV G2] Web worker is not available"),(n=t.queue.shift())===null||n===void 0||n.reject(e)}}return i.prototype.post=function(r,t){var e=this;return new Promise(function(n,a){e.queue.push({resolve:n,reject:a});try{e.worker.postMessage(r)}catch{console.warn("[AntV G2] Web worker is not available"),G(t)&&t()}})},i.prototype.destroy=function(){this.worker.terminate()},i}();function PM(i){if(!(typeof window>"u")){var r;try{r=new Blob([i.toString()],{type:"application/javascript"})}catch{r=new window.BlobBuilder,r.append(i.toString()),r=r.getBlob()}return new IM(URL.createObjectURL(r))}}var FM=function(i){function r(){function h(m,x){return(m[0]||0)*(x[0]||0)+(m[1]||0)*(x[1]||0)+(m[2]||0)*(x[2]||0)}function u(m){if(m.length>4)return[];var x=function(A,L){return[L.x-A.x,L.y-A.y]},S=x(m[0],m[1]),b=x(m[1],m[2]);return[S,b]}function c(m,x,S){x===void 0&&(x=0),S===void 0&&(S={x:0,y:0});var b=m.x,A=m.y;return{x:(b-S.x)*Math.cos(-x)+(A-S.y)*Math.sin(-x)+S.x,y:(S.x-b)*Math.sin(-x)+(A-S.y)*Math.cos(-x)+S.y}}function f(m){var x=[{x:m.x,y:m.y},{x:m.x+m.width,y:m.y},{x:m.x+m.width,y:m.y+m.height},{x:m.x,y:m.y+m.height}],S=m.rotation;return S?[c(x[0],S,x[0]),c(x[1],S,x[0]),c(x[2],S,x[0]),c(x[3],S,x[0])]:x}function v(m,x){if(m.length>4)return{min:0,max:0};var S=[];return m.forEach(function(b){S.push(h([b.x,b.y],x))}),{min:Math.min.apply(null,S),max:Math.max.apply(null,S)}}function p(m,x){return m.max>x.min&&m.min<x.max}function g(m){return typeof m=="number"&&!Number.isNaN(m)&&m!==1/0&&m!==-1/0}function d(m){return["x","y","width","height"].every(function(x){return g(m[x])})}function y(m,x,S){return S===void 0&&(S=0),!(x.x>m.x+m.width+S||x.x+x.width<m.x-S||x.y>m.y+m.height+S||x.y+x.height<m.y-S)}function C(m,x,S){if(S===void 0&&(S=0),!d(m)||!d(x))return!1;if(!m.rotation&&!x.rotation)return y(m,x,S);for(var b=f(m),A=f(x),L=u(b).concat(u(A)),k=0;k<L.length;k++){var B=L[k],O=v(b,B),R=v(A,B);if(!p(O,R))return!1}return!0}return{intersect:C}}var t=r().intersect;function e(h){for(var u=h.slice(),c=0;c<u.length;c++){var f=u[c];if(f.visible)for(var v=c+1;v<u.length;v++){var p=u[v];f!==p&&p.visible&&t(f,p)&&(p.visible=!1)}}return u}var n={"hide-overlap":e};try{var a=JSON.parse(i.data);if(!a||!a.type||!n[a.type])return;var o=a.type,s=a.items,l=n[o](s);self.postMessage(l)}catch(h){throw h}},OM=`
self.onmessage = `.concat(FM.toString(),`
`),oo=function(i){for(var r=i.slice(),t=0;t<r.length;t++){var e=r[t];if(e.visible)for(var n=t+1;n<r.length;n++){var a=r[n];e!==a&&a.visible&&kM(e,a)&&(a.visible=!1)}}return r},so=new Map,du=PM(OM);function DM(i,r,t,e){return xi(this,void 0,void 0,function(){var n,a,o,s,l,h;return wi(this,function(u){switch(u.label){case 0:return n=r.map(function(c,f){return w(w({},uv(c,i[f],T(i[f],"background.padding"))),{visible:!0})}),a=JSON.stringify(n),o=function(c){return so.set(a,c),M(c,function(f,v){var p=f.visible,g=r[v];p?g==null||g.show():g==null||g.hide()}),c},so.get(a)?(o(so.get(a)),[3,7]):[3,1];case 1:if(!du)return[3,6];u.label=2;case 2:return u.trys.push([2,4,,5]),s=JSON.stringify({type:"hide-overlap",items:n}),[4,du.post(s,function(){return o(oo(n))})];case 3:return l=u.sent(),o(Array.isArray(l.data)?l.data:[]),[3,5];case 4:return h=u.sent(),console.error(h),o(oo(n)),[3,5];case 5:return[3,7];case 6:o(oo(n)),u.label=7;case 7:return[2]}})})}var yu={"#5B8FF9":!0},RM=function(i){var r=ki.toRGB(i).toUpperCase();if(yu[r])return yu[r];var t=Y(ki.rgb2arr(r),3),e=t[0],n=t[1],a=t[2],o=(e*299+n*587+a*114)/1e3<128;return o};function YM(i,r,t){if(t.length!==0){var e=t[0].get("element"),n=e.geometry.theme,a=n.labels||{},o=a.fillColorLight,s=a.fillColorDark;t.forEach(function(l,h){var u=r[h],c=u.find(function(y){return y.get("type")==="text"}),f=Bt.fromObject(l.getBBox()),v=Bt.fromObject(c.getCanvasBBox()),p=!f.contains(v),g=l.attr("fill"),d=RM(g);p?c.attr(n.overflowLabels.style):d?o&&c.attr("fill",o):s&&c.attr("fill",s)})}}function GM(i,r,t){var e=i.coordinate,n=je(r),a=Bt.fromObject(n.getCanvasBBox()),o=Bt.fromObject(t.getBBox());return e.isTransposed?o.height>=a.height:o.width>=a.width}function HM(i,r,t){var e=!!i.getAdjust("stack");return e||r.every(function(n,a){var o=t[a];return GM(i,n,o)})}function VM(i,r,t){var e=i.coordinate,n=Bt.fromObject(t.getBBox()),a=je(r);e.isTransposed?a.attr({x:n.minX+n.width/2,textAlign:"center"}):a.attr({y:n.minY+n.height/2,textBaseline:"middle"})}function NM(i,r,t){var e;if(t.length!==0){var n=(e=t[0])===null||e===void 0?void 0:e.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=HM(a,r,t);o&&t.forEach(function(s,l){var h=r[l];VM(a,h,s)})}}}function XM(i){var r=500,t=[],e=Math.max(Math.floor(i.length/r),1);return M(i,function(n,a){a%e===0?t.push(n):n.set("visible",!1)}),t}function zM(i,r,t){var e;if(t.length!==0){var n=(e=t[0])===null||e===void 0?void 0:e.get("element"),a=n==null?void 0:n.geometry;if(!(!a||a.type!=="interval")){var o=XM(r),s=Y(a.getXYFields(),1),l=s[0],h=[],u=[],c=Ue(o,function(d){return d.get("data")[l]}),f=Hu(Et(o,function(d){return d.get("data")[l]})),v;o.forEach(function(d){d.set("visible",!0)});var p=function(d){d&&(d.length&&u.push(d.pop()),u.push.apply(u,et([],Y(d),!1)))};for(Gt(f)>0&&(v=f.shift(),p(c[v])),Gt(f)>0&&(v=f.pop(),p(c[v])),M(f.reverse(),function(d){p(c[d])});u.length>0;){var g=u.shift();g.get("visible")&&(Pw(g,h)?g.set("visible",!1):h.push(g))}}}}function WM(i,r){var t=i.getXYFields()[1],e=[],n=r.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&e.push(n.shift()),n.length>0&&e.push(n.pop()),e.push.apply(e,et([],Y(n),!1)),e}function zv(i,r,t){return i.some(function(e){return t(e,r)})}function $M(i,r,t){t===void 0&&(t=0);var e=Math.max(0,Math.min(i.x+i.width+t,r.x+r.width+t)-Math.max(i.x-t,r.x-t)),n=Math.max(0,Math.min(i.y+i.height+t,r.y+r.height+t)-Math.max(i.y-t,r.y-t));return e*n}function mu(i,r){return zv(i,r,function(t,e){var n=je(t),a=je(e);return $M(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function _M(i,r,t,e,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||l.type!=="point")){var h=Y(l.getXYFields(),2),u=h[0],c=h[1],f=Ue(r,function(g){return g.get("data")[u]}),v=[],p=n&&n.offset||((o=i[0])===null||o===void 0?void 0:o.offset)||12;Et(Vi(f).reverse(),function(g){for(var d=WM(l,f[g]);d.length;){var y=d.shift(),C=je(y);if(zv(v,y,function(S,b){return S.get("data")[u]===b.get("data")[u]&&S.get("data")[c]===b.get("data")[c]})){C.set("visible",!1);continue}var m=mu(v,y),x=!1;if(m&&(C.attr("y",C.attr("y")+2*p),x=mu(v,y)),x){C.set("visible",!1);continue}v.push(y)}})}}}function jM(i,r){var t=i.getXYFields()[1],e=[],n=r.sort(function(a,o){return a.get("data")[t]-a.get("data")[t]});return n.length>0&&e.push(n.shift()),n.length>0&&e.push(n.pop()),e.push.apply(e,et([],Y(n),!1)),e}function Wv(i,r,t){return i.some(function(e){return t(e,r)})}function UM(i,r,t){t===void 0&&(t=0);var e=Math.max(0,Math.min(i.x+i.width+t,r.x+r.width+t)-Math.max(i.x-t,r.x-t)),n=Math.max(0,Math.min(i.y+i.height+t,r.y+r.height+t)-Math.max(i.y-t,r.y-t));return e*n}function xu(i,r){return Wv(i,r,function(t,e){var n=je(t),a=je(e);return UM(n.getCanvasBBox(),a.getCanvasBBox(),2)>0})}function qM(i,r,t,e,n){var a,o;if(t.length!==0){var s=(a=t[0])===null||a===void 0?void 0:a.get("element"),l=s==null?void 0:s.geometry;if(!(!l||["path","line","area"].indexOf(l.type)<0)){var h=Y(l.getXYFields(),2),u=h[0],c=h[1],f=Ue(r,function(g){return g.get("data")[u]}),v=[],p=n&&n.offset||((o=i[0])===null||o===void 0?void 0:o.offset)||12;Et(Vi(f).reverse(),function(g){for(var d=jM(l,f[g]);d.length;){var y=d.shift(),C=je(y);if(Wv(v,y,function(S,b){return S.get("data")[u]===b.get("data")[u]&&S.get("data")[c]===b.get("data")[c]})){C.set("visible",!1);continue}var m=xu(v,y),x=!1;if(m&&(C.attr("y",C.attr("y")+2*p),x=xu(v,y)),x){C.set("visible",!1);continue}v.push(y)}})}}}var lo;function ZM(){return lo||(lo=document.createElement("canvas").getContext("2d")),lo}var Cn=ia(function(i,r){r===void 0&&(r={});var t=r.fontSize,e=r.fontFamily,n=r.fontWeight,a=r.fontStyle,o=r.fontVariant,s=ZM();return s.font=[a,o,n,"".concat(t,"px"),e].join(" "),s.measureText(N(i)?i:"").width},function(i,r){return r===void 0&&(r={}),et([i],Y(es(r)),!1).join("")}),QM=function(i,r,t){var e=16,n=Cn("...",t),a;N(i)?a=i:a=ra(i);var o=r,s=[],l,h;if(Cn(i,t)<=r)return i;for(;l=a.substr(0,e),h=Cn(l,t),!(h+n>o&&h>o);)if(s.push(l),o-=h,a=a.substr(e),!a)return s.join("");for(;l=a.substr(0,1),h=Cn(l,t),!(h+n>o);)if(s.push(l),o-=h,a=a.substr(1),!a)return s.join("");return"".concat(s.join(""),"...")};function KM(i,r,t,e,n){if(!(r.length<=0)){var a=(n==null?void 0:n.direction)||["top","right","bottom","left"],o=(n==null?void 0:n.action)||"translate",s=(n==null?void 0:n.margin)||0,l=r[0].get("coordinate");if(!!l){var h=Sx(l,s),u=h.minX,c=h.minY,f=h.maxX,v=h.maxY;M(r,function(p){var g=p.getCanvasBBox(),d=g.minX,y=g.minY,C=g.maxX,m=g.maxY,x=g.x,S=g.y,b=g.width,A=g.height,L=x,k=S;if(a.indexOf("left")>=0&&(d<u||C<u)&&(L=u),a.indexOf("top")>=0&&(y<c||m<c)&&(k=c),a.indexOf("right")>=0&&(d>f?L=f-b:C>f&&(L=L-(C-f))),a.indexOf("bottom")>=0&&(y>v?k=v-A:m>v&&(k=k-(m-v))),L!==x||k!==S){var B=L-x;if(o==="translate")Ia(p,B,k-S);else if(o==="ellipsis"){var O=p.findAll(function(R){return R.get("type")==="text"});O.forEach(function(R){var H=rs(R.attr(),["fontSize","fontFamily","fontWeight","fontStyle","fontVariant"]),z=R.getCanvasBBox(),_=QM(R.attr("text"),z.width-Math.abs(B),H);R.attr("text",_)})}else p.hide()}})}}}function JM(i,r,t){var e={fillOpacity:I(i.attr("fillOpacity"))?1:i.attr("fillOpacity"),strokeOpacity:I(i.attr("strokeOpacity"))?1:i.attr("strokeOpacity"),opacity:I(i.attr("opacity"))?1:i.attr("opacity")};i.attr({fillOpacity:0,strokeOpacity:0,opacity:0}),i.animate(e,r)}function tS(i,r,t){var e={fillOpacity:0,strokeOpacity:0,opacity:0},n=r.easing,a=r.duration,o=r.delay;i.animate(e,a,n,function(){i.remove(!0)},o)}function eS(i,r,t){var e,n=Y(r,2),a=n[0],o=n[1];return i.applyToMatrix([a,o,1]),t==="x"?(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",.01,1],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",100,1],["t",a,o]])):t==="y"?(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",1,.01],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",1,100],["t",a,o]])):t==="xy"&&(i.setMatrix(ct(i.getMatrix(),[["t",-a,-o],["s",.01,.01],["t",a,o]])),e=ct(i.getMatrix(),[["t",-a,-o],["s",100,100],["t",a,o]])),e}function Zs(i,r,t,e,n){var a=t.start,o=t.end,s=t.getWidth(),l=t.getHeight(),h,u;n==="y"?(h=a.x+s/2,u=e.y<a.y?e.y:a.y):n==="x"?(h=e.x>a.x?e.x:a.x,u=a.y+l/2):n==="xy"&&(t.isPolar?(h=t.getCenter().x,u=t.getCenter().y):(h=(a.x+o.x)/2,u=(a.y+o.y)/2));var c=eS(i,[h,u],n);i.animate({matrix:c},r)}function rS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"x")}function iS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"y")}function nS(i,r,t){var e=t.coordinate,n=t.minYPoint;Zs(i,r,e,n,"xy")}function aS(i,r,t){var e=i.getTotalLength();i.attr("lineDash",[e]),i.animate(function(n){return{lineDashOffset:(1-n)*e}},r)}function oS(i,r,t){var e=t.toAttrs,n=e.x,a=e.y;delete e.x,delete e.y,i.attr(e),i.animate({x:n,y:a},r)}function sS(i,r,t){var e=i.getBBox(),n=i.get("origin").mappingData,a=n.points,o=a[0].y-a[1].y>0?e.maxX:e.minX,s=(e.minY+e.maxY)/2;i.applyToMatrix([o,s,1]);var l=ct(i.getMatrix(),[["t",-o,-s],["s",.01,1],["t",o,s]]);i.setMatrix(l),i.animate({matrix:ct(i.getMatrix(),[["t",-o,-s],["s",100,1],["t",o,s]])},r)}function lS(i,r,t){var e=i.getBBox(),n=i.get("origin").mappingData,a=(e.minX+e.maxX)/2,o=n.points,s=o[0].y-o[1].y<=0?e.maxY:e.minY;i.applyToMatrix([a,s,1]);var l=ct(i.getMatrix(),[["t",-a,-s],["s",1,.01],["t",a,s]]);i.setMatrix(l),i.animate({matrix:ct(i.getMatrix(),[["t",-a,-s],["s",1,100],["t",a,s]])},r)}function wu(i,r){var t,e=Zn(i,r),n=e.startAngle,a=e.endAngle;return!xt(n,-Math.PI*.5)&&n<-Math.PI*.5&&(n+=Math.PI*2),!xt(a,-Math.PI*.5)&&a<-Math.PI*.5&&(a+=Math.PI*2),r[5]===0&&(t=Y([a,n],2),n=t[0],a=t[1]),xt(n,Math.PI*1.5)&&(n=Math.PI*-.5),xt(a,Math.PI*-.5)&&!xt(n,a)&&(a=Math.PI*1.5),{startAngle:n,endAngle:a}}function Cu(i){var r;return i[0]==="M"||i[0]==="L"?r=[i[1],i[2]]:(i[0]==="a"||i[0]==="A"||i[0]==="C")&&(r=[i[i.length-2],i[i.length-1]]),r}function Mu(i){var r,t,e,n=i.filter(function(m){return m[0]==="A"||m[0]==="a"});if(n.length===0)return{startAngle:0,endAngle:0,radius:0,innerRadius:0};var a=n[0],o=n.length>1?n[1]:n[0],s=i.indexOf(a),l=i.indexOf(o),h=Cu(i[s-1]),u=Cu(i[l-1]),c=wu(h,a),f=c.startAngle,v=c.endAngle,p=wu(u,o),g=p.startAngle,d=p.endAngle;xt(f,g)&&xt(v,d)?(t=f,e=v):(t=Math.min(f,g),e=Math.max(v,d));var y=a[1],C=n[n.length-1][1];return y<C?(r=Y([C,y],2),y=r[0],C=r[1]):y===C&&(C=0),{startAngle:t,endAngle:e,radius:y,innerRadius:C}}function hS(i,r,t){var e=t.toAttrs,n=t.coordinate,a=e.path||[],o=a.map(function(C){return C[0]});if(!(a.length<1)){var s=Mu(a),l=s.startAngle,h=s.endAngle,u=s.radius,c=s.innerRadius,f=Mu(i.attr("path")),v=f.startAngle,p=f.endAngle,g=n.getCenter(),d=l-v,y=h-p;if(d===0&&y===0){i.attr("path",a);return}i.animate(function(C){var m=v+C*d,x=p+C*y;return w(w({},e),{path:gt(o,["M","A","A","Z"])?If(g.x,g.y,u,m,x):ur(g.x,g.y,u,m,x,c)})},w(w({},r),{callback:function(){i.attr("path",a)}}))}}function uS(i,r,t){var e=Ls(t.coordinate,20),n=e.type,a=e.startState,o=e.endState,s=i.setClip({type:n,attrs:a});t.toAttrs&&i.attr(t.toAttrs),s.animate(o,w(w({},r),{callback:function(){i&&!i.get("destroyed")&&i.set("clipShape",null),s.remove(!0)}}))}function Qs(i,r,t){if(i.isGroup())M(i.getChildren(),function(s){Qs(s,r,t)});else{var e=i.getBBox(),n=(e.minX+e.maxX)/2,a=(e.minY+e.maxY)/2;if(i.applyToMatrix([n,a,1]),t==="zoomIn"){var o=ct(i.getMatrix(),[["t",-n,-a],["s",.01,.01],["t",n,a]]);i.setMatrix(o),i.animate({matrix:ct(i.getMatrix(),[["t",-n,-a],["s",100,100],["t",n,a]])},r)}else i.animate({matrix:ct(i.getMatrix(),[["t",-n,-a],["s",.01,.01],["t",n,a]])},w(w({},r),{callback:function(){i.remove(!0)}}))}}function cS(i,r,t){Qs(i,r,"zoomIn")}function fS(i,r,t){Qs(i,r,"zoomOut")}function Ae(i){return[F.TOP,F.BOTTOM].includes(i)?{offsetX:0,offsetY:i===F.TOP?-8:8,style:{textAlign:"center",textBaseline:i===F.TOP?"bottom":"top"}}:[F.LEFT,F.RIGHT].includes(i)?{offsetX:i===F.LEFT?-8:8,offsetY:0,style:{textAlign:i===F.LEFT?"right":"left",textBaseline:"middle",rotate:Math.PI/2}}:{}}function ho(i,r,t){return{x:i.x+r*Math.cos(t),y:i.y+r*Math.sin(t)}}var vS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"circle",showTitle:!0,title:i.prototype.getDefaultTitleCfg.call(this)})},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.getRegion=function(t,e){var n=.5,a={x:.5,y:.5},o=Math.PI*2/t,s=-1*Math.PI/2+o*e,l=n/(1+1/Math.sin(o/2)),h=ho(a,n-l,s),u=Math.PI*5/4,c=Math.PI*1/4;return{start:ho(h,l,u),end:ho(h,l,c)}},r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.beforeEachView=function(t,e){},r.prototype.generateFacets=function(t){var e=this,n=this.cfg,a=n.fields,o=n.type,s=Y(a,1),l=s[0];if(!l)throw new Error("No `fields` specified!");var h=this.getFieldValues(t,l),u=h.length,c=[];return h.forEach(function(f,v){var p=[{field:l,value:f,values:h}],g=Qt(t,e.getFacetDataFilter(p)),d={type:o,data:g,region:e.getRegion(u,v),columnValue:f,columnField:l,columnIndex:v,columnValuesLength:u,rowValue:null,rowField:null,rowIndex:0,rowValuesLength:1};c.push(d)}),c},r.prototype.getXAxisOption=function(t,e,n,a){return n},r.prototype.getYAxisOption=function(t,e,n,a){return n},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e){var n=e.columnValue,a=e.view,o=T(t.cfg.title,"formatter"),s=D({position:["50%","0%"],content:o?o(n):n},Ae(F.TOP),t.cfg.title);a.annotation().text(s)})},r}(Wr),pS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"list",cols:null,showTitle:!0,title:i.prototype.getDefaultTitleCfg.call(this)})},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.beforeEachView=function(t,e){},r.prototype.generateFacets=function(t){var e=this,n=this.cfg.fields,a=this.cfg.cols,o=Y(n,1),s=o[0];if(!s)throw new Error("No `fields` specified!");var l=this.getFieldValues(t,s),h=l.length;a=a||h;var u=this.getPageCount(h,a),c=[];return l.forEach(function(f,v){var p=e.getRowCol(v,a),g=p.row,d=p.col,y=[{field:s,value:f,values:l}],C=Qt(t,e.getFacetDataFilter(y)),m={type:e.cfg.type,data:C,region:e.getRegion(u,a,d,g),columnValue:f,rowValue:f,columnField:s,rowField:null,columnIndex:d,rowIndex:g,columnValuesLength:a,rowValuesLength:u,total:h};c.push(m)}),c},r.prototype.getXAxisOption=function(t,e,n,a){return a.rowIndex!==a.rowValuesLength-1&&a.columnValuesLength*a.rowIndex+a.columnIndex+1+a.columnValuesLength<=a.total?w(w({},n),{label:null,title:null}):n},r.prototype.getYAxisOption=function(t,e,n,a){return a.columnIndex!==0?w(w({},n),{title:null,label:null}):n},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e){var n=e.columnValue,a=e.view,o=T(t.cfg.title,"formatter"),s=D({position:["50%","0%"],content:o?o(n):n},Ae(F.TOP),t.cfg.title);a.annotation().text(s)})},r.prototype.getPageCount=function(t,e){return Math.floor((t+e-1)/e)},r.prototype.getRowCol=function(t,e){var n=Math.floor(t/e),a=t%e;return{row:n,col:a}},r}(Wr),gS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"matrix",showTitle:!1,columnTitle:w({},i.prototype.getDefaultTitleCfg.call(this)),rowTitle:w({},i.prototype.getDefaultTitleCfg.call(this))})},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.beforeEachView=function(t,e){},r.prototype.generateFacets=function(t){for(var e=this.cfg,n=e.fields,a=e.type,o=n.length,s=o,l=[],h=0;h<s;h++)for(var u=n[h],c=0;c<o;c++){var f=n[c],v={type:a,data:t,region:this.getRegion(o,s,h,c),columnValue:u,rowValue:f,columnField:u,rowField:f,columnIndex:h,rowIndex:c,columnValuesLength:s,rowValuesLength:o};l.push(v)}return l},r.prototype.getXAxisOption=function(t,e,n,a){return a.rowIndex!==a.rowValuesLength-1?w(w({},n),{label:null,title:null}):n},r.prototype.getYAxisOption=function(t,e,n,a){return a.columnIndex!==0?w(w({},n),{title:null,label:null}):n},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e,n){var a=e.columnIndex,o=e.rowIndex,s=e.columnValuesLength;e.rowValuesLength;var l=e.columnValue,h=e.rowValue,u=e.view;if(o===0){var c=T(t.cfg.columnTitle,"formatter"),f=D({position:["50%","0%"],content:c?c(l):l},Ae(F.TOP),t.cfg.columnTitle);u.annotation().text(f)}if(a===s-1){var c=T(t.cfg.rowTitle,"formatter"),f=D({position:["100%","50%"],content:c?c(h):h},Ae(F.RIGHT),t.cfg.rowTitle);u.annotation().text(f)}})},r}(Wr),dS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"mirror",showTitle:!0,title:i.prototype.getDefaultTitleCfg.call(this),transpose:!1})},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.beforeEachView=function(t,e){this.cfg.transpose?e.columnIndex%2===0?t.coordinate().transpose().reflect("x"):t.coordinate().transpose():e.rowIndex%2!==0&&t.coordinate().reflect("y")},r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.generateFacets=function(t){var e=this,n=Y(this.cfg.fields,1),a=n[0],o=[],s=1,l=1,h=[""],u=[""],c,f;return this.cfg.transpose?(c=a,h=this.getFieldValues(t,c).slice(0,2),s=h.length):(f=a,u=this.getFieldValues(t,f).slice(0,2),l=u.length),h.forEach(function(v,p){u.forEach(function(g,d){var y=[{field:c,value:v,values:h},{field:f,value:g,values:u}],C=Qt(t,e.getFacetDataFilter(y)),m={type:e.cfg.type,data:C,region:e.getRegion(l,s,p,d),columnValue:v,rowValue:g,columnField:c,rowField:f,columnIndex:p,rowIndex:d,columnValuesLength:s,rowValuesLength:l};o.push(m)})}),o},r.prototype.getXAxisOption=function(t,e,n,a){return a.columnIndex===1||a.rowIndex===1?w(w({},n),{label:null,title:null}):n},r.prototype.getYAxisOption=function(t,e,n,a){return n},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e,n){var a=e.columnValue,o=e.rowValue,s=e.view,l=T(t.cfg.title,"formatter");if(t.cfg.transpose){var h=D({position:["50%","0%"],content:l?l(a):a},Ae(F.TOP),t.cfg.title);s.annotation().text(h)}else{var h=D({position:["100%","50%"],content:l?l(o):o},Ae(F.RIGHT),t.cfg.title);s.annotation().text(h)}})},r}(Wr),yS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.beforeEachView=function(t,e){},r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"rect",columnTitle:w({},i.prototype.getDefaultTitleCfg.call(this)),rowTitle:w({},i.prototype.getDefaultTitleCfg.call(this))})},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.generateFacets=function(t){var e=this,n=Y(this.cfg.fields,2),a=n[0],o=n[1],s=[],l=1,h=1,u=[""],c=[""];return a&&(u=this.getFieldValues(t,a),l=u.length),o&&(c=this.getFieldValues(t,o),h=c.length),u.forEach(function(f,v){c.forEach(function(p,g){var d=[{field:a,value:f,values:u},{field:o,value:p,values:c}],y=Qt(t,e.getFacetDataFilter(d)),C={type:e.cfg.type,data:y,region:e.getRegion(h,l,v,g),columnValue:f,rowValue:p,columnField:a,rowField:o,columnIndex:v,rowIndex:g,columnValuesLength:l,rowValuesLength:h};s.push(C)})}),s},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e,n){var a=e.columnIndex,o=e.rowIndex,s=e.columnValuesLength,l=e.columnValue,h=e.rowValue,u=e.view;if(o===0){var c=T(t.cfg.columnTitle,"formatter"),f=D({position:["50%","0%"],content:c?c(l):l},Ae(F.TOP),t.cfg.columnTitle);u.annotation().text(f)}if(a===s-1){var c=T(t.cfg.rowTitle,"formatter"),f=D({position:["100%","50%"],content:c?c(h):h},Ae(F.RIGHT),t.cfg.rowTitle);u.annotation().text(f)}})},r.prototype.getXAxisOption=function(t,e,n,a){return a.rowIndex!==a.rowValuesLength-1?w(w({},n),{title:null,label:null}):a.columnIndex!==Math.floor((a.columnValuesLength-1)/2)?w(w({},n),{title:null}):n},r.prototype.getYAxisOption=function(t,e,n,a){return a.columnIndex!==0?w(w({},n),{title:null,label:null}):a.rowIndex!==Math.floor((a.rowValuesLength-1)/2)?w(w({},n),{title:null}):n},r}(Wr),mS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.afterChartRender=function(){t.facets&&t.cfg.line&&(t.container.clear(),t.drawLines(t.facets))},t}return r.prototype.afterEachView=function(t,e){this.processAxis(t,e)},r.prototype.beforeEachView=function(t,e){},r.prototype.init=function(){i.prototype.init.call(this),this.view.on(tt.AFTER_RENDER,this.afterChartRender)},r.prototype.getDefaultCfg=function(){return D({},i.prototype.getDefaultCfg.call(this),{type:"tree",line:{style:{lineWidth:1,stroke:"#ddd"},smooth:!1},showTitle:!0,title:i.prototype.getDefaultTitleCfg.call(this)})},r.prototype.generateFacets=function(t){var e=this.cfg.fields;if(!e.length)throw new Error("Please specify for the fields for rootFacet!");var n=[],a={type:this.cfg.type,data:t,region:null,rowValuesLength:this.getRows(),columnValuesLength:1,rowIndex:0,columnIndex:0,rowField:"",columnField:"",rowValue:"",columnValue:""};return n.push(a),a.children=this.getChildFacets(t,1,n),this.setRegion(n),n},r.prototype.setRegion=function(t){var e=this;this.forceColIndex(t),t.forEach(function(n){n.region=e.getRegion(n.rowValuesLength,n.columnValuesLength,n.columnIndex,n.rowIndex)})},r.prototype.getRegion=function(t,e,n,a){var o=1/e,s=1/t,l={x:o*n,y:s*a},h={x:l.x+o,y:l.y+s*2/3};return{start:l,end:h}},r.prototype.forceColIndex=function(t){var e,n,a=this,o=[],s=0;t.forEach(function(p){a.isLeaf(p)&&(o.push(p),p.columnIndex=s,s++)}),o.forEach(function(p){p.columnValuesLength=o.length});for(var l=this.cfg.fields.length,h=l-1;h>=0;h--){var u=this.getFacetsByLevel(t,h);try{for(var c=(e=void 0,$(u)),f=c.next();!f.done;f=c.next()){var v=f.value;this.isLeaf(v)||(v.originColIndex=v.columnIndex,v.columnIndex=this.getRegionIndex(v.children),v.columnValuesLength=o.length)}}catch(p){e={error:p}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}}},r.prototype.getFacetsByLevel=function(t,e){var n=[];return t.forEach(function(a){a.rowIndex===e&&n.push(a)}),n},r.prototype.getRegionIndex=function(t){var e=t[0],n=t[t.length-1];return(n.columnIndex-e.columnIndex)/2+e.columnIndex},r.prototype.isLeaf=function(t){return!t.children||!t.children.length},r.prototype.getRows=function(){return this.cfg.fields.length+1},r.prototype.getChildFacets=function(t,e,n){var a=this,o=this.cfg.fields,s=o.length;if(!(s<e)){var l=[],h=o[e-1],u=this.getFieldValues(t,h);return u.forEach(function(c,f){var v=[{field:h,value:c,values:u}],p=t.filter(a.getFacetDataFilter(v));if(p.length){var g={type:a.cfg.type,data:p,region:null,columnValue:c,rowValue:"",columnField:h,rowField:"",columnIndex:f,rowValuesLength:a.getRows(),columnValuesLength:1,rowIndex:e,children:a.getChildFacets(p,e+1,n)};l.push(g),n.push(g)}}),l}},r.prototype.render=function(){i.prototype.render.call(this),this.cfg.showTitle&&this.renderTitle()},r.prototype.renderTitle=function(){var t=this;M(this.facets,function(e){var n=e.columnValue,a=e.view,o=T(t.cfg.title,"formatter"),s=D({position:["50%","0%"],content:o?o(n):n},Ae(F.TOP),t.cfg.title);a.annotation().text(s)})},r.prototype.drawLines=function(t){var e=this;t.forEach(function(n){if(!e.isLeaf(n)){var a=n.children;e.addFacetLines(n,a)}})},r.prototype.addFacetLines=function(t,e){var n=this,a=t.view,o=a.coordinateBBox,s={x:o.x+o.width/2,y:o.y+o.height};e.forEach(function(l){var h=l.view.coordinateBBox,u={x:h.bl.x+(h.tr.x-h.bl.x)/2,y:h.tr.y},c={x:s.x,y:s.y+(u.y-s.y)/2},f={x:u.x,y:c.y};n.drawLine([s,c,f,u])})},r.prototype.getPath=function(t){var e=[],n=this.cfg.line.smooth;return n?(e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y])):t.forEach(function(a,o){o===0?e.push(["M",a.x,a.y]):e.push(["L",a.x,a.y])}),e},r.prototype.drawLine=function(t){var e=this.getPath(t),n=this.cfg.line.style;this.container.addShape("path",{attrs:ot({path:e},n)})},r.prototype.getXAxisOption=function(t,e,n,a){return a.rowIndex!==a.rowValuesLength-1?w(w({},n),{title:null,label:null}):n},r.prototype.getYAxisOption=function(t,e,n,a){return a.originColIndex!==0&&a.columnIndex!==0?w(w({},n),{title:null,label:null}):n},r}(Wr);function Su(i){var r=et([],Y(i),!1);r.sort(function(e,n){return e-n});var t=r.length;return t===0?0:t%2===1?r[(t-1)/2]:(r[t/2]+r[t/2-1])/2}function xS(i){var r=Gu(i,function(t,e){return t+=isNaN(e)||!U(e)?0:e},0);return i.length===0?0:r/i.length}function Mn(i,r){if(!r)return null;var t;switch(i){case"start":return 0;case"center":return .5;case"end":return 1;case"median":{t=r.isCategory?Su(r.values.map(function(e,n){return n})):Su(r.values);break}case"mean":{t=r.isCategory?(r.values.length-1)/2:xS(r.values);break}case"min":t=r.isCategory?0:r[i];break;case"max":t=r.isCategory?r.values.length-1:r[i];break;default:t=i;break}return r.scale(t)}var Sn=["regionFilter","shape"],wS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.cache=new Map,e.foregroundContainer=e.view.getLayer(st.FORE).addGroup(),e.backgroundContainer=e.view.getLayer(st.BG).addGroup(),e.option=[],e}return Object.defineProperty(r.prototype,"name",{get:function(){return"annotation"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.layout=function(){this.update()},r.prototype.render=function(){},r.prototype.update=function(){var t=this;this.onAfterRender(function(){var n=new Map;M(t.option,function(a){if(rr(Sn,a.type)){var o=t.updateOrCreate(a);o&&n.set(t.getCacheKey(a),o)}}),t.cache=t.syncCache(n)});var e=new Map;M(this.option,function(n){if(!rr(Sn,n.type)){var a=t.updateOrCreate(n);a&&e.set(t.getCacheKey(n),a)}}),this.cache=this.syncCache(e)},r.prototype.clear=function(t){t===void 0&&(t=!1),i.prototype.clear.call(this),this.clearComponents(),this.foregroundContainer.clear(),this.backgroundContainer.clear(),t&&(this.option=[])},r.prototype.destroy=function(){this.clear(!0),this.foregroundContainer.remove(!0),this.backgroundContainer.remove(!0)},r.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},r.prototype.clearComponents=function(){this.getComponents().forEach(function(t){t.component.destroy()}),this.cache.clear()},r.prototype.onAfterRender=function(t){var e=!1;this.view.getOptions().animate&&this.view.geometries.forEach(function(n){n.animateOption&&(n.once(Ne.AFTER_DRAW_ANIMATE,function(){t()}),e=!0)}),e||this.view.getRootView().once(tt.AFTER_RENDER,function(){t()})},r.prototype.createAnnotation=function(t){var e=t.type,n=g0[dr(e)];if(n){var a=this.getAnnotationTheme(e),o=this.getAnnotationCfg(e,t,a);if(!o)return null;var s=new n(o);return{component:s,layer:this.isTop(o)?st.FORE:st.BG,direction:F.NONE,type:dt.ANNOTATION,extra:t}}},r.prototype.annotation=function(t){this.option.push(t)},r.prototype.arc=function(t){return this.annotation(w({type:"arc"},t)),this},r.prototype.image=function(t){return this.annotation(w({type:"image"},t)),this},r.prototype.line=function(t){return this.annotation(w({type:"line"},t)),this},r.prototype.region=function(t){return this.annotation(w({type:"region"},t)),this},r.prototype.text=function(t){return this.annotation(w({type:"text"},t)),this},r.prototype.dataMarker=function(t){return this.annotation(w({type:"dataMarker"},t)),this},r.prototype.dataRegion=function(t){this.annotation(w({type:"dataRegion"},t))},r.prototype.regionFilter=function(t){this.annotation(w({type:"regionFilter"},t))},r.prototype.shape=function(t){this.annotation(w({type:"shape"},t))},r.prototype.html=function(t){this.annotation(w({type:"html"},t))},r.prototype.parsePosition=function(t){var e,n,a=this.view.getXScale(),o=this.view.getScalesByDim("y"),s=G(t)?t.call(null,a,o):t,l=0,h=0;if(P(s)){var u=Y(s,2),c=u[0],f=u[1];if(N(c)&&c.indexOf("%")!==-1&&!isNaN(c.slice(0,-1)))return this.parsePercentPosition(s);l=Mn(c,a),h=Mn(f,Object.values(o)[0])}else if(!I(s))try{for(var v=$(Vi(s)),p=v.next();!p.done;p=v.next()){var g=p.value,d=s[g];g===a.field&&(l=Mn(d,a)),o[g]&&(h=Mn(d,o[g]))}}catch(y){e={error:y}}finally{try{p&&!p.done&&(n=v.return)&&n.call(v)}finally{if(e)throw e.error}}return isNaN(l)||isNaN(h)?null:this.view.getCoordinate().convert({x:l,y:h})},r.prototype.getRegionPoints=function(t,e){var n=this,a=this.view.getXScale(),o=this.view.getScalesByDim("y"),s=Object.values(o)[0],l=a.field,h=this.view.getData(),u=P(t)?t[0]:t[l],c=P(e)?e[0]:e[l],f=[],v;return M(h,function(p,g){if(p[l]===u&&(v=g),g>=v){var d=n.parsePosition([p[l],p[s.field]]);d&&f.push(d)}if(p[l]===c)return!1}),f},r.prototype.parsePercentPosition=function(t){var e=parseFloat(t[0])/100,n=parseFloat(t[1])/100,a=this.view.getCoordinate(),o=a.start,s=a.end,l={x:Math.min(o.x,s.x),y:Math.min(o.y,s.y)},h=a.getWidth()*e+l.x,u=a.getHeight()*n+l.y;return{x:h,y:u}},r.prototype.getCoordinateBBox=function(){var t=this.view.getCoordinate(),e=t.start,n=t.end,a=t.getWidth(),o=t.getHeight(),s={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y)};return{x:s.x,y:s.y,minX:s.x,minY:s.y,maxX:s.x+a,maxY:s.y+o,width:a,height:o}},r.prototype.getAnnotationCfg=function(t,e,n){var a=this,o=this.view.getCoordinate(),s=this.view.getCanvas(),l={};if(I(e))return null;var h=e.start,u=e.end,c=e.position,f=this.parsePosition(h),v=this.parsePosition(u),p=this.parsePosition(c);if(["arc","image","line","region","regionFilter"].includes(t)&&(!f||!v))return null;if(["text","dataMarker","html"].includes(t)&&!p)return null;if(t==="arc"){var g=e;g.start,g.end;var d=mt(g,["start","end"]),y=Yr(o,f),C=Yr(o,v);y>C&&(C=Math.PI*2+C),l=w(w({},d),{center:o.getCenter(),radius:Ba(o,f),startAngle:y,endAngle:C})}else if(t==="image"){var m=e;m.start,m.end;var d=mt(m,["start","end"]);l=w(w({},d),{start:f,end:v,src:e.src})}else if(t==="line"){var x=e;x.start,x.end;var d=mt(x,["start","end"]);l=w(w({},d),{start:f,end:v,text:T(e,"text",null)})}else if(t==="region"){var S=e;S.start,S.end;var d=mt(S,["start","end"]);l=w(w({},d),{start:f,end:v})}else if(t==="text"){var b=this.view.getData(),A=e;A.position;var L=A.content,d=mt(A,["position","content"]),k=L;G(L)&&(k=L(b)),l=w(w(w({},p),d),{content:k})}else if(t==="dataMarker"){var B=e;B.position;var O=B.point,R=B.line,H=B.text,z=B.autoAdjust,_=B.direction,d=mt(B,["position","point","line","text","autoAdjust","direction"]);l=w(w(w({},d),p),{coordinateBBox:this.getCoordinateBBox(),point:O,line:R,text:H,autoAdjust:z,direction:_})}else if(t==="dataRegion"){var K=e,nt=K.start,ht=K.end,Q=K.region,H=K.text,ut=K.lineLength,d=mt(K,["start","end","region","text","lineLength"]);l=w(w({},d),{points:this.getRegionPoints(nt,ht),region:Q,text:H,lineLength:ut})}else if(t==="regionFilter"){var vt=e;vt.start,vt.end;var te=vt.apply,mr=vt.color,d=mt(vt,["start","end","apply","color"]),qi=this.view.geometries,ee=[],Ur=function(se){!se||(se.isGroup()?se.getChildren().forEach(function(Qr){return Ur(Qr)}):ee.push(se))};M(qi,function(se){te?rr(te,se.type)&&M(se.elements,function(Qr){Ur(Qr.shape)}):M(se.elements,function(Qr){Ur(Qr.shape)})}),l=w(w({},d),{color:mr,shapes:ee,start:f,end:v})}else if(t==="shape"){var qr=e,Zi=qr.render,Te=mt(qr,["render"]),Oa=function(tp){if(G(e.render))return Zi(tp,a.view,{parsePosition:a.parsePosition.bind(a)})};l=w(w({},Te),{render:Oa})}else if(t==="html"){var Zr=e,Da=Zr.html;Zr.position;var Te=mt(Zr,["html","position"]),Jv=function(se){return G(Da)?Da(se,a.view):Da};l=w(w(w({},Te),p),{parent:s.get("el").parentNode,html:Jv})}var Le=D({},n,w(w({},l),{top:e.top,style:e.style,offsetX:e.offsetX,offsetY:e.offsetY}));return t!=="html"&&(Le.container=this.getComponentContainer(Le)),Le.animate=this.view.getOptions().animate&&Le.animate&&T(e,"animate",Le.animate),Le.animateOption=D({},Vr,Le.animateOption,e.animateOption),Le},r.prototype.isTop=function(t){return T(t,"top",!0)},r.prototype.getComponentContainer=function(t){return this.isTop(t)?this.foregroundContainer:this.backgroundContainer},r.prototype.getAnnotationTheme=function(t){return T(this.view.getTheme(),["components","annotation",t],{})},r.prototype.updateOrCreate=function(t){var e=this.cache.get(this.getCacheKey(t));if(e){var n=t.type,a=this.getAnnotationTheme(n),o=this.getAnnotationCfg(n,t,a);o&&Ft(o,["container"]),e.component.update(w(w({},o||{}),{visible:!!o})),rr(Sn,t.type)&&e.component.render()}else e=this.createAnnotation(t),e&&(e.component.init(),rr(Sn,t.type)&&e.component.render());return e},r.prototype.syncCache=function(t){var e=this,n=new Map(this.cache);return t.forEach(function(a,o){n.set(o,a)}),n.forEach(function(a,o){Ce(e.option,function(s){return o===e.getCacheKey(s)})||(a.component.destroy(),n.delete(o))}),n},r.prototype.getCacheKey=function(t){return t},r}(jr);function bu(i,r){var t=D({},T(i,["components","axis","common"]),T(i,["components","axis",r]));return T(t,["grid"],{})}function bn(i,r,t,e){var n=[],a=r.getTicks();return i.isPolar&&a.push({value:1,text:"",tickValue:""}),a.reduce(function(o,s,l){var h=s.value;if(e)n.push({points:[i.convert(t==="y"?{x:0,y:h}:{x:h,y:0}),i.convert(t==="y"?{x:1,y:h}:{x:h,y:1})]});else if(l){var u=o.value,c=(u+h)/2;n.push({points:[i.convert(t==="y"?{x:0,y:c}:{x:c,y:0}),i.convert(t==="y"?{x:1,y:c}:{x:c,y:1})]})}return s},a[0]),n}function uo(i,r,t,e,n){var a=r.values.length,o=[],s=t.getTicks();return s.reduce(function(l,h){var u=l?l.value:h.value,c=h.value,f=(u+c)/2;return n==="x"?o.push({points:[i.convert({x:e?c:f,y:0}),i.convert({x:e?c:f,y:1})]}):o.push({points:Et(Array(a+1),function(v,p){return i.convert({x:p/a,y:e?c:f})})}),h},s[0]),o}function Au(i,r){var t=T(r,"grid");if(t===null)return!1;var e=T(i,"grid");return!(t===void 0&&e===null)}var Ie=["container"],Tu=w(w({},Vr),{appear:null}),CS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.cache=new Map,e.gridContainer=e.view.getLayer(st.BG).addGroup(),e.gridForeContainer=e.view.getLayer(st.FORE).addGroup(),e.axisContainer=e.view.getLayer(st.BG).addGroup(),e.axisForeContainer=e.view.getLayer(st.FORE).addGroup(),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"axis"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.render=function(){this.update()},r.prototype.layout=function(){var t=this,e=this.view.getCoordinate();M(this.getComponents(),function(n){var a=n.component,o=n.direction,s=n.type,l=n.extra,h=l.dim,u=l.scale,c=l.alignTick,f;if(s===dt.AXIS)e.isPolar?h==="x"?f=e.isTransposed?cn(e,o):eo(e):h==="y"&&(f=e.isTransposed?eo(e):cn(e,o)):f=cn(e,o);else if(s===dt.GRID)if(e.isPolar){var v=void 0;e.isTransposed?v=h==="x"?uo(e,t.view.getYScales()[0],u,c,h):bn(e,u,h,c):v=h==="x"?bn(e,u,h,c):uo(e,t.view.getXScale(),u,c,h),f={items:v,center:t.view.getCoordinate().getCenter()}}else f={items:bn(e,u,h,c)};a.update(f)})},r.prototype.update=function(){this.option=this.view.getOptions().axes;var t=new Map;this.updateXAxes(t),this.updateYAxes(t);var e=new Map;this.cache.forEach(function(n,a){t.has(a)?e.set(a,n):n.component.destroy()}),this.cache=e},r.prototype.clear=function(){i.prototype.clear.call(this),this.cache.clear(),this.gridContainer.clear(),this.gridForeContainer.clear(),this.axisContainer.clear(),this.axisForeContainer.clear()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.gridContainer.remove(!0),this.gridForeContainer.remove(!0),this.axisContainer.remove(!0),this.axisForeContainer.remove(!0)},r.prototype.getComponents=function(){var t=[];return this.cache.forEach(function(e){t.push(e)}),t},r.prototype.updateXAxes=function(t){var e=this.view.getXScale();if(!(!e||e.isIdentity)){var n=jn(this.option,e.field);if(n!==!1){var a=Dh(n,F.BOTTOM),o=st.BG,s="x",l=this.view.getCoordinate(),h=this.getId("axis",e.field),u=this.getId("grid",e.field);if(l.isRect){var c=this.cache.get(h);if(c){var f=this.getLineAxisCfg(e,n,a);Ft(f,Ie),c.component.update(f),t.set(h,c)}else c=this.createLineAxis(e,n,o,a,s),this.cache.set(h,c),t.set(h,c);var v=this.cache.get(u);if(v){var f=this.getLineGridCfg(e,n,a,s);Ft(f,Ie),v.component.update(f),t.set(u,v)}else v=this.createLineGrid(e,n,o,a,s),v&&(this.cache.set(u,v),t.set(u,v))}else if(l.isPolar){var c=this.cache.get(h);if(c){var f=l.isTransposed?this.getLineAxisCfg(e,n,F.RADIUS):this.getCircleAxisCfg(e,n,a);Ft(f,Ie),c.component.update(f),t.set(h,c)}else{if(l.isTransposed){if(br(n))return;c=this.createLineAxis(e,n,o,F.RADIUS,s)}else c=this.createCircleAxis(e,n,o,a,s);this.cache.set(h,c),t.set(h,c)}var v=this.cache.get(u);if(v){var f=l.isTransposed?this.getCircleGridCfg(e,n,F.RADIUS,s):this.getLineGridCfg(e,n,F.CIRCLE,s);Ft(f,Ie),v.component.update(f),t.set(u,v)}else{if(l.isTransposed){if(br(n))return;v=this.createCircleGrid(e,n,o,F.RADIUS,s)}else v=this.createLineGrid(e,n,o,F.CIRCLE,s);v&&(this.cache.set(u,v),t.set(u,v))}}}}},r.prototype.updateYAxes=function(t){var e=this,n=this.view.getYScales();M(n,function(a,o){if(!(!a||a.isIdentity)){var s=a.field,l=jn(e.option,s);if(l!==!1){var h=st.BG,u="y",c=e.getId("axis",s),f=e.getId("grid",s),v=e.view.getCoordinate();if(v.isRect){var p=Dh(l,o===0?F.LEFT:F.RIGHT),g=e.cache.get(c);if(g){var d=e.getLineAxisCfg(a,l,p);Ft(d,Ie),g.component.update(d),t.set(c,g)}else g=e.createLineAxis(a,l,h,p,u),e.cache.set(c,g),t.set(c,g);var y=e.cache.get(f);if(y){var d=e.getLineGridCfg(a,l,p,u);Ft(d,Ie),y.component.update(d),t.set(f,y)}else y=e.createLineGrid(a,l,h,p,u),y&&(e.cache.set(f,y),t.set(f,y))}else if(v.isPolar){var g=e.cache.get(c);if(g){var d=v.isTransposed?e.getCircleAxisCfg(a,l,F.CIRCLE):e.getLineAxisCfg(a,l,F.RADIUS);Ft(d,Ie),g.component.update(d),t.set(c,g)}else{if(v.isTransposed){if(br(l))return;g=e.createCircleAxis(a,l,h,F.CIRCLE,u)}else g=e.createLineAxis(a,l,h,F.RADIUS,u);e.cache.set(c,g),t.set(c,g)}var y=e.cache.get(f);if(y){var d=v.isTransposed?e.getLineGridCfg(a,l,F.CIRCLE,u):e.getCircleGridCfg(a,l,F.RADIUS,u);Ft(d,Ie),y.component.update(d),t.set(f,y)}else{if(v.isTransposed){if(br(l))return;y=e.createLineGrid(a,l,h,F.CIRCLE,u)}else y=e.createCircleGrid(a,l,h,F.RADIUS,u);y&&(e.cache.set(f,y),t.set(f,y))}}}}})},r.prototype.createLineAxis=function(t,e,n,a,o){var s={component:new fx(this.getLineAxisCfg(t,e,a)),layer:n,direction:a===F.RADIUS?F.NONE:a,type:dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},r.prototype.createLineGrid=function(t,e,n,a,o){var s=this.getLineGridCfg(t,e,a,o);if(s){var l={component:new px(s),layer:n,direction:F.NONE,type:dt.GRID,extra:{dim:o,scale:t,alignTick:T(s,"alignTick",!0)}};return l.component.init(),l}},r.prototype.createCircleAxis=function(t,e,n,a,o){var s={component:new vx(this.getCircleAxisCfg(t,e,a)),layer:n,direction:a,type:dt.AXIS,extra:{dim:o,scale:t}};return s.component.set("field",t.field),s.component.init(),s},r.prototype.createCircleGrid=function(t,e,n,a,o){var s=this.getCircleGridCfg(t,e,a,o);if(s){var l={component:new gx(s),layer:n,direction:F.NONE,type:dt.GRID,extra:{dim:o,scale:t,alignTick:T(s,"alignTick",!0)}};return l.component.init(),l}},r.prototype.getLineAxisCfg=function(t,e,n){var a=T(e,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=cn(o,n),l=Rh(t,e),h=fn(this.view.getTheme(),n),u=T(e,["title"])?D({title:{style:{text:l}}},{title:Oh(this.view.getTheme(),n,e.title)},e):e,c=D(w(w({container:a},s),{ticks:t.getTicks().map(function(m){return{id:"".concat(m.tickValue),name:m.text,value:m.value}}),verticalFactor:o.isPolar?Fh(s,o.getCenter())*-1:Fh(s,o.getCenter()),theme:h}),h,u),f=this.getAnimateCfg(c),v=f.animate,p=f.animateOption;c.animateOption=p,c.animate=v;var g=Df(s),d=T(c,"verticalLimitLength",g?1/3:1/2);if(d<=1){var y=this.view.getCanvas().get("width"),C=this.view.getCanvas().get("height");c.verticalLimitLength=d*(g?y:C)}return c},r.prototype.getLineGridCfg=function(t,e,n,a){if(!!Au(fn(this.view.getTheme(),n),e)){var o=bu(this.view.getTheme(),n),s=D({container:T(e,["top"])?this.gridForeContainer:this.gridContainer},o,T(e,"grid"),this.getAnimateCfg(e));return s.items=bn(this.view.getCoordinate(),t,a,T(s,"alignTick",!0)),s}},r.prototype.getCircleAxisCfg=function(t,e,n){var a=T(e,["top"])?this.axisForeContainer:this.axisContainer,o=this.view.getCoordinate(),s=t.getTicks().map(function(g){return{id:"".concat(g.tickValue),name:g.text,value:g.value}});!t.isCategory&&Math.abs(o.endAngle-o.startAngle)===Math.PI*2&&s.pop();var l=Rh(t,e),h=fn(this.view.getTheme(),F.CIRCLE),u=T(e,["title"])?D({title:{style:{text:l}}},{title:Oh(this.view.getTheme(),n,e.title)},e):e,c=D(w(w({container:a},eo(this.view.getCoordinate())),{ticks:s,verticalFactor:1,theme:h}),h,u),f=this.getAnimateCfg(c),v=f.animate,p=f.animateOption;return c.animate=v,c.animateOption=p,c},r.prototype.getCircleGridCfg=function(t,e,n,a){if(!!Au(fn(this.view.getTheme(),n),e)){var o=bu(this.view.getTheme(),F.RADIUS),s=D({container:T(e,["top"])?this.gridForeContainer:this.gridContainer,center:this.view.getCoordinate().getCenter()},o,T(e,"grid"),this.getAnimateCfg(e)),l=T(s,"alignTick",!0),h=a==="x"?this.view.getYScales()[0]:this.view.getXScale();return s.items=uo(this.view.getCoordinate(),h,t,l,a),s}},r.prototype.getId=function(t,e){var n=this.view.getCoordinate();return"".concat(t,"-").concat(e,"-").concat(n.type)},r.prototype.getAnimateCfg=function(t){return{animate:this.view.getOptions().animate&&T(t,"animate"),animateOption:t&&t.animateOption?D({},Tu,t.animateOption):Tu}},r}(jr);function Ve(i,r,t){return t===F.TOP?[i.minX+i.width/2-r.width/2,i.minY]:t===F.BOTTOM?[i.minX+i.width/2-r.width/2,i.maxY-r.height]:t===F.LEFT?[i.minX,i.minY+i.height/2-r.height/2]:t===F.RIGHT?[i.maxX-r.width,i.minY+i.height/2-r.height/2]:t===F.TOP_LEFT||t===F.LEFT_TOP?[i.tl.x,i.tl.y]:t===F.TOP_RIGHT||t===F.RIGHT_TOP?[i.tr.x-r.width,i.tr.y]:t===F.BOTTOM_LEFT||t===F.LEFT_BOTTOM?[i.bl.x,i.bl.y-r.height]:t===F.BOTTOM_RIGHT||t===F.RIGHT_BOTTOM?[i.br.x-r.width,i.br.y-r.height]:[0,0]}function Lu(i,r){return Mi(i)?i===!1?!1:{}:T(i,[r],i)}function An(i){return T(i,"position",F.BOTTOM)}var MS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.container=e.view.getLayer(st.FORE).addGroup(),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"legend"},enumerable:!1,configurable:!0}),r.prototype.init=function(){},r.prototype.render=function(){this.update()},r.prototype.layout=function(){var t=this;this.layoutBBox=this.view.viewBBox,M(this.components,function(e){var n=e.component,a=e.direction,o=io(a),s=n.get("maxWidthRatio"),l=n.get("maxHeightRatio"),h=t.getCategoryLegendSizeCfg(o,s,l),u=n.get("maxWidth"),c=n.get("maxHeight");n.update({maxWidth:Math.min(h.maxWidth,u||0),maxHeight:Math.min(h.maxHeight,c||0)});var f=n.get("padding"),v=n.getLayoutBBox(),p=new Bt(v.x,v.y,v.width,v.height).expand(f),g=Y(Ve(t.view.viewBBox,p,a),2),d=g[0],y=g[1],C=Y(Ve(t.layoutBBox,p,a),2),m=C[0],x=C[1],S=0,b=0;a.startsWith("top")||a.startsWith("bottom")?(S=d,b=x):(S=m,b=y),n.setLocation({x:S+f[3],y:b+f[0]}),t.layoutBBox=t.layoutBBox.cut(p,a)})},r.prototype.update=function(){var t=this;this.option=this.view.getOptions().legends;var e={},n=function(f,v,p){var g=t.getId(p.field),d=t.getComponentById(g);if(d){var y=void 0,C=Lu(t.option,p.field);C!==!1&&(T(C,"custom")?y=t.getCategoryCfg(f,v,p,C,!0):p.isLinear?y=t.getContinuousCfg(f,v,p,C):p.isCategory&&(y=t.getCategoryCfg(f,v,p,C))),y&&(Ft(y,["container"]),d.direction=An(C),d.component.update(y),e[g]=!0)}else{var m=t.createFieldLegend(f,v,p);m&&(m.component.init(),t.components.push(m),e[g]=!0)}};if(T(this.option,"custom")){var a="global-custom",o=this.getComponentById(a);if(o){var s=this.getCategoryCfg(void 0,void 0,void 0,this.option,!0);Ft(s,["container"]),o.component.update(s),e[a]=!0}else{var l=this.createCustomLegend(void 0,void 0,void 0,this.option);if(l){l.init();var h=st.FORE,u=An(this.option);this.components.push({id:a,component:l,layer:h,direction:u,type:dt.LEGEND,extra:void 0}),e[a]=!0}}}else this.loopLegends(n);var c=[];M(this.getComponents(),function(f){e[f.id]?c.push(f):f.component.destroy()}),this.components=c},r.prototype.clear=function(){i.prototype.clear.call(this),this.container.clear()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.container.remove(!0)},r.prototype.getGeometries=function(t){var e=this,n=t.geometries;return M(t.views,function(a){n=n.concat(e.getGeometries(a))}),n},r.prototype.loopLegends=function(t){var e=this.view.getRootView()===this.view;if(!!e){var n=this.getGeometries(this.view),a={};M(n,function(o){var s=o.getGroupAttributes();M(s,function(l){var h=l.getScale(l.type);!h||h.type==="identity"||a[h.field]||(t(o,l,h),a[h.field]=!0)})})}},r.prototype.createFieldLegend=function(t,e,n){var a,o=Lu(this.option,n.field),s=st.FORE,l=An(o);if(o!==!1&&(T(o,"custom")?a=this.createCustomLegend(t,e,n,o):n.isLinear?a=this.createContinuousLegend(t,e,n,o):n.isCategory&&(a=this.createCategoryLegend(t,e,n,o))),a)return a.set("field",n.field),{id:this.getId(n.field),component:a,layer:s,direction:l,type:dt.LEGEND,extra:{scale:n}}},r.prototype.createCustomLegend=function(t,e,n,a){var o=this.getCategoryCfg(t,e,n,a,!0);return new kh(o)},r.prototype.createContinuousLegend=function(t,e,n,a){var o=this.getContinuousCfg(t,e,n,Ft(a,["value"]));return new dx(o)},r.prototype.createCategoryLegend=function(t,e,n,a){var o=this.getCategoryCfg(t,e,n,a);return new kh(o)},r.prototype.getContinuousCfg=function(t,e,n,a){var o=n.getTicks(),s=Ce(o,function(g){return g.value===0}),l=Ce(o,function(g){return g.value===1}),h=o.map(function(g){var d=g.value,y=g.tickValue,C=e.mapping(n.invert(d)).join("");return{value:y,attrValue:C,color:C,scaleValue:d}});s||h.push({value:n.min,attrValue:e.mapping(n.invert(0)).join(""),color:e.mapping(n.invert(0)).join(""),scaleValue:0}),l||h.push({value:n.max,attrValue:e.mapping(n.invert(1)).join(""),color:e.mapping(n.invert(1)).join(""),scaleValue:1}),h.sort(function(g,d){return g.value-d.value});var u={min:zt(h).value,max:Ct(h).value,colors:[],rail:{type:e.type},track:{}};e.type==="size"&&(u.track={style:{fill:e.type==="size"?this.view.getTheme().defaultColor:void 0}}),e.type==="color"&&(u.colors=h.map(function(g){return g.attrValue}));var c=this.container,f=An(a),v=io(f),p=T(a,"title");return p&&(p=D({text:Di(n)},p)),u.container=c,u.layout=v,u.title=p,u.animateOption=Vr,this.mergeLegendCfg(u,a,"continuous")},r.prototype.getCategoryCfg=function(t,e,n,a,o){var s=this.container,l=T(a,"position",F.BOTTOM),h=qh(this.view.getTheme(),l),u=T(h,["marker"]),c=T(a,"marker"),f=io(l),v=T(h,["pageNavigator"]),p=T(a,"pageNavigator"),g=o?Gw(u,c,a.items):Yw(this.view,t,e,u,c),d=T(a,"title");d&&(d=D({text:n?Di(n):""},d));var y=T(a,"maxWidthRatio"),C=T(a,"maxHeightRatio"),m=this.getCategoryLegendSizeCfg(f,y,C);m.container=s,m.layout=f,m.items=g,m.title=d,m.animateOption=Vr,m.pageNavigator=D({},v,p);var x=this.mergeLegendCfg(m,a,l);x.reversed&&x.items.reverse();var S=T(x,"maxItemWidth");return S&&S<=1&&(x.maxItemWidth=this.view.viewBBox.width*S),x},r.prototype.mergeLegendCfg=function(t,e,n){var a=n.split("-")[0],o=qh(this.view.getTheme(),a);return D({},o,t,e)},r.prototype.getId=function(t){return"".concat(this.name,"-").concat(t)},r.prototype.getComponentById=function(t){return Ce(this.components,function(e){return e.id===t})},r.prototype.getCategoryLegendSizeCfg=function(t,e,n){e===void 0&&(e=hl),n===void 0&&(n=hl);var a=this.view.viewBBox,o=a.width,s=a.height;return t==="vertical"?{maxWidth:o*e,maxHeight:s}:{maxWidth:o,maxHeight:s*n}},r}(jr),SS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.onChangeFn=Ye,e.resetMeasure=function(){e.clear()},e.onValueChange=function(n){var a=Y(n,2),o=a[0],s=a[1];e.start=o,e.end=s,e.changeViewData(o,s)},e.container=e.view.getLayer(st.FORE).addGroup(),e.onChangeFn=is(e.onValueChange,20,{leading:!0}),e.width=0,e.view.on(tt.BEFORE_CHANGE_DATA,e.resetMeasure),e.view.on(tt.BEFORE_CHANGE_SIZE,e.resetMeasure),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"slider"},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){i.prototype.destroy.call(this),this.view.off(tt.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(tt.BEFORE_CHANGE_SIZE,this.resetMeasure)},r.prototype.init=function(){},r.prototype.render=function(){this.option=this.view.getOptions().slider;var t=this.getSliderCfg(),e=t.start,n=t.end;I(this.start)&&(this.start=e,this.end=n);var a=this.view.getOptions().data;this.option&&!pe(a)?this.slider?this.slider=this.updateSlider():(this.slider=this.createSlider(),this.slider.component.on("sliderchange",this.onChangeFn)):this.slider&&(this.slider.component.destroy(),this.slider=void 0)},r.prototype.layout=function(){var t=this;if(this.option&&!this.width&&(this.measureSlider(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.start,t.end)},0)),this.slider){var e=this.view.coordinateBBox.width,n=this.slider.component.get("padding"),a=Y(n,4),o=a[0];a[1],a[2];var s=a[3],l=this.slider.component.getLayoutBBox(),h=new Bt(l.x,l.y,Math.min(l.width,e),l.height).expand(n),u=this.getMinMaxText(this.start,this.end),c=u.minText,f=u.maxText,v=Y(Ve(this.view.viewBBox,h,F.BOTTOM),2);v[0];var p=v[1],g=Y(Ve(this.view.coordinateBBox,h,F.BOTTOM),2),d=g[0];g[1],this.slider.component.update(w(w({},this.getSliderCfg()),{x:d+s,y:p+o,width:this.width,start:this.start,end:this.end,minText:c,maxText:f})),this.view.viewBBox=this.view.viewBBox.cut(h,F.BOTTOM)}},r.prototype.update=function(){this.render()},r.prototype.createSlider=function(){var t=this.getSliderCfg(),e=new hx(w({container:this.container},t));return e.init(),{component:e,layer:st.FORE,direction:F.BOTTOM,type:dt.SLIDER}},r.prototype.updateSlider=function(){var t=this.getSliderCfg();if(this.width){var e=this.getMinMaxText(this.start,this.end),n=e.minText,a=e.maxText;t=w(w({},t),{width:this.width,start:this.start,end:this.end,minText:n,maxText:a})}return this.slider.component.update(t),this.slider},r.prototype.measureSlider=function(){var t=this.getSliderCfg().width;this.width=t},r.prototype.getSliderCfg=function(){var t={height:16,start:0,end:1,minText:"",maxText:"",x:0,y:0,width:this.view.coordinateBBox.width};if(rt(this.option)){var e=w({data:this.getData()},T(this.option,"trendCfg",{}));t=D({},t,this.getThemeOptions(),this.option),t=w(w({},t),{trendCfg:e})}return t.start=at(Math.min(I(t.start)?0:t.start,I(t.end)?1:t.end),0,1),t.end=at(Math.max(I(t.start)?0:t.start,I(t.end)?1:t.end),0,1),t},r.prototype.getData=function(){var t=this.view.getOptions().data,e=Y(this.view.getYScales(),1),n=e[0],a=this.view.getGroupScales();if(a.length){var o=a[0],s=o.field,l=o.ticks;return t.reduce(function(h,u){return u[s]===l[0]&&h.push(u[n.field]),h},[])}return t.map(function(h){return h[n.field]||0})},r.prototype.getThemeOptions=function(){var t=this.view.getTheme();return T(t,["components","slider","common"],{})},r.prototype.getMinMaxText=function(t,e){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Me(n,a.field);a.isLinear&&(o=o.sort());var s=o,l=Gt(n);if(!a||!l)return{};var h=Gt(s),u=Math.round(t*(h-1)),c=Math.round(e*(h-1)),f=T(s,[u]),v=T(s,[c]),p=this.getSliderCfg().formatter;return p&&(f=p(f,n[u],u),v=p(v,n[c],c)),{minText:f,maxText:v}},r.prototype.changeViewData=function(t,e){var n=this.view.getOptions().data,a=this.view.getXScale(),o=Gt(n);if(!(!a||!o)){var s=Me(n,a.field),l=this.view.getXScale().isLinear?s.sort(function(v,p){return Number(v)-Number(p)}):s,h=l,u=Gt(h),c=Math.round(t*(u-1)),f=Math.round(e*(u-1));this.view.filter(a.field,function(v,p){var g=h.indexOf(v);return g>-1?Er(g,c,f):!0}),this.view.render(!0)}},r.prototype.getComponents=function(){return this.slider?[this.slider]:[]},r.prototype.clear=function(){this.slider&&(this.slider.component.destroy(),this.slider=void 0),this.width=0,this.start=void 0,this.end=void 0},r}(jr),Tn=0,Eu=8,bS=32,AS=20,TS=function(i){E(r,i);function r(t){var e=i.call(this,t)||this;return e.onChangeFn=Ye,e.resetMeasure=function(){e.clear()},e.onValueChange=function(n){var a=n.ratio,o=e.getValidScrollbarCfg().animate;e.ratio=at(a,0,1);var s=e.view.getOptions().animate;o||e.view.animate(!1),e.changeViewData(e.getScrollRange(),!0),e.view.animate(s)},e.container=e.view.getLayer(st.FORE).addGroup(),e.onChangeFn=is(e.onValueChange,20,{leading:!0}),e.trackLen=0,e.thumbLen=0,e.ratio=0,e.view.on(tt.BEFORE_CHANGE_DATA,e.resetMeasure),e.view.on(tt.BEFORE_CHANGE_SIZE,e.resetMeasure),e}return Object.defineProperty(r.prototype,"name",{get:function(){return"scrollbar"},enumerable:!1,configurable:!0}),r.prototype.destroy=function(){i.prototype.destroy.call(this),this.view.off(tt.BEFORE_CHANGE_DATA,this.resetMeasure),this.view.off(tt.BEFORE_CHANGE_SIZE,this.resetMeasure)},r.prototype.init=function(){},r.prototype.render=function(){this.option=this.view.getOptions().scrollbar,this.option?this.scrollbar?this.scrollbar=this.updateScrollbar():(this.scrollbar=this.createScrollbar(),this.scrollbar.component.on("scrollchange",this.onChangeFn)):this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0)},r.prototype.layout=function(){var t=this;if(this.option&&!this.trackLen&&(this.measureScrollbar(),setTimeout(function(){t.view.destroyed||t.changeViewData(t.getScrollRange(),!0)})),this.scrollbar){var e=this.view.coordinateBBox.width,n=this.scrollbar.component.get("padding"),a=this.scrollbar.component.getLayoutBBox(),o=new Bt(a.x,a.y,Math.min(a.width,e),a.height).expand(n),s=this.getScrollbarComponentCfg(),l=void 0,h=void 0;if(s.isHorizontal){var u=Y(Ve(this.view.viewBBox,o,F.BOTTOM),2);u[0];var c=u[1],f=Y(Ve(this.view.coordinateBBox,o,F.BOTTOM),2),v=f[0];f[1],l=v,h=c}else{var p=Y(Ve(this.view.viewBBox,o,F.RIGHT),2);p[0];var c=p[1],g=Y(Ve(this.view.viewBBox,o,F.RIGHT),2),v=g[0];g[1],l=v,h=c}l+=n[3],h+=n[0],this.trackLen?this.scrollbar.component.update(w(w({},s),{x:l,y:h,trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio})):this.scrollbar.component.update(w(w({},s),{x:l,y:h})),this.view.viewBBox=this.view.viewBBox.cut(o,s.isHorizontal?F.BOTTOM:F.RIGHT)}},r.prototype.update=function(){this.render()},r.prototype.getComponents=function(){return this.scrollbar?[this.scrollbar]:[]},r.prototype.clear=function(){this.scrollbar&&(this.scrollbar.component.destroy(),this.scrollbar=void 0),this.trackLen=0,this.thumbLen=0,this.ratio=0,this.cnt=0,this.step=0,this.data=void 0,this.xScaleCfg=void 0,this.yScalesCfg=[]},r.prototype.setValue=function(t){this.onValueChange({ratio:t})},r.prototype.getValue=function(){return this.ratio},r.prototype.getThemeOptions=function(){var t=this.view.getTheme();return T(t,["components","scrollbar","common"],{})},r.prototype.getScrollbarTheme=function(t){var e=T(this.view.getTheme(),["components","scrollbar"]),n=t||{},a=n.thumbHighlightColor,o=mt(n,["thumbHighlightColor"]);return{default:D({},T(e,["default","style"],{}),o),hover:D({},T(e,["hover","style"],{}),{thumbColor:a})}},r.prototype.measureScrollbar=function(){var t=this.view.getXScale(),e=this.view.getYScales().slice();this.data=this.getScrollbarData(),this.step=this.getStep(),this.cnt=this.getCnt();var n=this.getScrollbarComponentCfg(),a=n.trackLen,o=n.thumbLen;this.trackLen=a,this.thumbLen=o,this.xScaleCfg={field:t.field,values:t.values||[]},this.yScalesCfg=e},r.prototype.getScrollRange=function(){var t=Math.floor((this.cnt-this.step)*at(this.ratio,0,1)),e=Math.min(t+this.step-1,this.cnt-1);return[t,e]},r.prototype.changeViewData=function(t,e){var n=this,a=Y(t,2),o=a[0],s=a[1],l=this.getValidScrollbarCfg().type,h=l!=="vertical",u=Me(this.data,this.xScaleCfg.field),c=this.view.getXScale().isLinear?u.sort(function(v,p){return Number(v)-Number(p)}):u,f=h?c:c.reverse();this.yScalesCfg.forEach(function(v){n.view.scale(v.field,{formatter:v.formatter,type:v.type,min:v.min,max:v.max,tickMethod:v.tickMethod})}),this.view.filter(this.xScaleCfg.field,function(v){var p=f.indexOf(v);return p>-1?Er(p,o,s):!0}),this.view.render(!0)},r.prototype.createScrollbar=function(){var t=this.getValidScrollbarCfg().type,e=t!=="vertical",n=new cx(w(w({container:this.container},this.getScrollbarComponentCfg()),{x:0,y:0}));return n.init(),{component:n,layer:st.FORE,direction:e?F.BOTTOM:F.RIGHT,type:dt.SCROLLBAR}},r.prototype.updateScrollbar=function(){var t=this.getScrollbarComponentCfg(),e=this.trackLen?w(w({},t),{trackLen:this.trackLen,thumbLen:this.thumbLen,thumbOffset:(this.trackLen-this.thumbLen)*this.ratio}):w({},t);return this.scrollbar.component.update(e),this.scrollbar},r.prototype.getStep=function(){if(this.step)return this.step;var t=this.view.coordinateBBox,e=this.getValidScrollbarCfg(),n=e.type,a=e.categorySize,o=n!=="vertical";return Math.floor((o?t.width:t.height)/a)},r.prototype.getCnt=function(){if(this.cnt)return this.cnt;var t=this.view.getXScale(),e=this.getScrollbarData(),n=Me(e,t.field);return Gt(n)},r.prototype.getScrollbarComponentCfg=function(){var t=this.view,e=t.coordinateBBox,n=t.viewBBox,a=this.getValidScrollbarCfg(),o=a.type,s=a.padding,l=a.width,h=a.height,u=a.style,c=o!=="vertical",f=Y(s,4),v=f[0],p=f[1],g=f[2],d=f[3],y=c?{x:e.minX+d,y:n.maxY-h-g}:{x:n.maxX-l-p,y:e.minY+v},C=this.getStep(),m=this.getCnt(),x=c?e.width-d-p:e.height-v-g,S=Math.max(x*at(C/m,0,1),AS);return w(w({},this.getThemeOptions()),{x:y.x,y:y.y,size:c?h:l,isHorizontal:c,trackLen:x,thumbLen:S,thumbOffset:0,theme:this.getScrollbarTheme(u)})},r.prototype.getValidScrollbarCfg=function(){var t={type:"horizontal",categorySize:bS,width:Eu,height:Eu,padding:[0,0,0,0],animate:!0,style:{}};return rt(this.option)&&(t=w(w({},t),this.option)),(!rt(this.option)||!this.option.padding)&&(t.padding=t.type==="horizontal"?[Tn,0,Tn,0]:[0,Tn,0,Tn]),t},r.prototype.getScrollbarData=function(){var t=this.view.getCoordinate(),e=this.getValidScrollbarCfg(),n=this.view.getOptions().data||[];return t.isReflect("y")&&e.type==="vertical"&&(n=et([],Y(n),!1).reverse()),n},r}(jr),LS={fill:"#CCD6EC",opacity:.3};function ES(i,r,t){var e,n,a,o,s,l,h=cw(i,r,t);if(h.length){h=$t(h);try{for(var u=$(h),c=u.next();!c.done;c=u.next()){var f=c.value;try{for(var v=(a=void 0,$(f)),p=v.next();!p.done;p=v.next()){var g=p.value,d=g.mappingData,y=d.x,C=d.y;g.x=P(y)?y[y.length-1]:y,g.y=P(C)?C[C.length-1]:C}}catch(B){a={error:B}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}}}catch(B){e={error:B}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var m=t.shared;if(m===!1&&h.length>1){var x=h[0],S=Math.abs(r.y-x[0].y);try{for(var b=$(h),A=b.next();!A.done;A=b.next()){var L=A.value,k=Math.abs(r.y-L[0].y);k<=S&&(x=L,S=k)}}catch(B){s={error:B}}finally{try{A&&!A.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}h=[x]}return Hu($t(h))}return[]}var BS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.show=function(t){var e=this.context.view,n=this.context.event,a=e.getController("tooltip").getTooltipCfg(),o=ES(e,{x:n.x,y:n.y},a);if(!gt(o,this.items)&&(this.items=o,o.length)){var s=e.getXScale().field,l=o[0].data[s],h=[],u=e.geometries;if(M(u,function(ht){if(ht.type==="interval"||ht.type==="schema"){var Q=ht.getElementsBy(function(ut){var vt=ut.getData();return vt[s]===l});h=h.concat(Q)}}),h.length){var c=e.getCoordinate(),f=h[0].shape.getCanvasBBox(),v=h[0].shape.getCanvasBBox(),p=f;M(h,function(ht){var Q=ht.shape.getCanvasBBox();c.isTransposed?(Q.minY<f.minY&&(f=Q),Q.maxY>v.maxY&&(v=Q)):(Q.minX<f.minX&&(f=Q),Q.maxX>v.maxX&&(v=Q)),p.x=Math.min(Q.minX,p.minX),p.y=Math.min(Q.minY,p.minY),p.width=Math.max(Q.maxX,p.maxX)-p.x,p.height=Math.max(Q.maxY,p.maxY)-p.y});var g=e.backgroundGroup,d=e.coordinateBBox,y=void 0;if(c.isRect){var C=e.getXScale(),m=t||{},x=m.appendRatio,S=m.appendWidth;I(S)&&(x=I(x)?C.isLinear?0:.25:x,S=c.isTransposed?x*v.height:x*f.width);var b=void 0,A=void 0,L=void 0,k=void 0;c.isTransposed?(b=d.minX,A=Math.min(v.minY,f.minY)-S,L=d.width,k=p.height+S*2):(b=Math.min(f.minX,v.minX)-S,A=d.minY,L=p.width+S*2,k=d.height),y=[["M",b,A],["L",b+L,A],["L",b+L,A+k],["L",b,A+k],["Z"]]}else{var B=zt(h),O=Ct(h),R=_n(B.getModel(),c).startAngle,H=_n(O.getModel(),c).endAngle,z=c.getCenter(),_=c.getRadius(),K=c.innerRadius*_;y=ur(z.x,z.y,_,R,H,K)}if(this.regionPath)this.regionPath.attr("path",y),this.regionPath.show();else{var nt=T(t,"style",LS);this.regionPath=g.addShape({type:"path",name:"active-region",capture:!1,attrs:w(w({},nt),{path:y})})}}}},r.prototype.hide=function(){this.regionPath&&this.regionPath.hide(),this.items=null},r.prototype.destroy=function(){this.hide(),this.regionPath&&this.regionPath.remove(!0),i.prototype.destroy.call(this)},r}(yt),$v=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.show=function(){var t=this.context,e=t.event,n=t.view,a=n.isTooltipLocked();if(!a){var o=this.timeStamp,s=+new Date,l=T(t.view.getOptions(),"tooltip.showDelay",16);if(s-o>l){var h=this.location,u={x:e.x,y:e.y};(!h||!gt(h,u))&&this.showTooltip(n,u),this.timeStamp=s,this.location=u}}},r.prototype.hide=function(){var t=this.context.view,e=t.getController("tooltip"),n=this.context.event,a=n.clientX,o=n.clientY;e.isCursorEntered({x:a,y:o})||t.isTooltipLocked()||(this.hideTooltip(t),this.location=null)},r.prototype.showTooltip=function(t,e){t.showTooltip(e)},r.prototype.hideTooltip=function(t){t.hideTooltip()},r}(yt),kS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.showTooltip=function(t,e){var n=ve(t);M(n,function(a){var o=Xo(t,a,e);a.showTooltip(o)})},r.prototype.hideTooltip=function(t){var e=ve(t);M(e,function(n){n.hideTooltip()})},r}($v),IS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.show=function(){var t=this.context,e=t.event,n=this.timeStamp,a=+new Date;if(a-n>16){var o=this.location,s={x:e.x,y:e.y};(!o||!gt(o,s))&&this.showTooltip(s),this.timeStamp=a,this.location=s}},r.prototype.hide=function(){this.hideTooltip(),this.location=null},r.prototype.showTooltip=function(t){var e=this.context,n=e.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=a.get("tip");this.tooltip.update(w({title:o},t)),this.tooltip.show()}},r.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=this.context.view,n=e.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=e.getTheme(),s=T(o,["components","tooltip","domStyles"],{}),l=new Ea({parent:n.get("el").parentNode,region:a,visible:!1,crosshairs:null,domStyles:w({},D({},s,(t={},t[Se]={"max-width":"50%"},t[be]={"word-break":"break-all"},t)))});l.init(),l.setCapture(!1),this.tooltip=l},r}(yt),Ks=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="",t}return r.prototype.hasState=function(t){return t.hasState(this.stateName)},r.prototype.setElementState=function(t,e){t.setState(this.stateName,e)},r.prototype.setState=function(){this.setStateEnable(!0)},r.prototype.clear=function(){var t=this.context.view;this.clearViewState(t)},r.prototype.clearViewState=function(t){var e=this,n=Wf(t,this.stateName);M(n,function(a){e.setElementState(a,!1)})},r}(yt);function Bu(i){return T(i.get("delegateObject"),"item")}var Js=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.ignoreListItemStates=["unchecked"],t}return r.prototype.isItemIgnore=function(t,e){var n=this.ignoreListItemStates,a=n.filter(function(o){return e.hasState(t,o)});return!!a.length},r.prototype.setStateByComponent=function(t,e,n){var a=this.context.view,o=t.get("field"),s=Mt(a);this.setElementsStateByItem(s,o,e,n)},r.prototype.setStateByElement=function(t,e){this.setElementState(t,e)},r.prototype.isMathItem=function(t,e,n){var a=this.context.view,o=Hr(a,e),s=ae(t,e);return!I(s)&&n.name===o.getText(s)},r.prototype.setElementsStateByItem=function(t,e,n,a){var o=this;M(t,function(s){o.isMathItem(s,e,n)&&s.setState(o.stateName,a)})},r.prototype.setStateEnable=function(t){var e=_e(this.context);if(e)Nf(this.context)&&this.setStateByElement(e,t);else{var n=Gr(this.context);if(Ri(n)){var a=n.item,o=n.component;if(a&&o&&!this.isItemIgnore(a,o)){var s=this.context.event.gEvent;if(s&&s.fromShape&&s.toShape&&Bu(s.fromShape)===Bu(s.toShape))return;this.setStateByComponent(o,a,t)}}}},r.prototype.toggle=function(){var t=_e(this.context);if(t){var e=t.hasState(this.stateName);this.setElementState(t,!e)}},r.prototype.reset=function(){this.setStateEnable(!1)},r}(Ks),PS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(Js),FS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.cache={},t}return r.prototype.getColorScale=function(t,e){var n=e.geometry.getAttribute("color");if(!n)return null;var a=t.getScaleByField(n.getFields()[0]);return a},r.prototype.getLinkPath=function(t,e){var n=this.context.view,a=n.getCoordinate().isTransposed,o=t.shape.getCanvasBBox(),s=e.shape.getCanvasBBox(),l=a?[["M",o.minX,o.minY],["L",s.minX,s.maxY],["L",s.maxX,s.maxY],["L",o.maxX,o.minY],["Z"]]:[["M",o.maxX,o.minY],["L",s.minX,s.minY],["L",s.minX,s.maxY],["L",o.maxX,o.maxY],["Z"]];return l},r.prototype.addLinkShape=function(t,e,n,a){var o={opacity:.4,fill:e.shape.attr("fill")};t.addShape({type:"path",attrs:w(w({},D({},o,G(a)?a(o,e):a)),{path:this.getLinkPath(e,n)})})},r.prototype.linkByElement=function(t,e){var n=this,a=this.context.view,o=this.getColorScale(a,t);if(!!o){var s=ae(t,o.field);if(!this.cache[s]){var l=Xx(a,o.field,s),h=this.linkGroup,u=h.addGroup();this.cache[s]=u;var c=l.length;M(l,function(f,v){if(v<c-1){var p=l[v+1];n.addLinkShape(u,f,p,e)}})}}},r.prototype.removeLink=function(t){var e=this.getColorScale(this.context.view,t);if(!!e){var n=ae(t,e.field);this.cache[n]&&(this.cache[n].remove(),this.cache[n]=null)}},r.prototype.link=function(t){var e=this.context;this.linkGroup||(this.linkGroup=e.view.foregroundGroup.addGroup({id:"link-by-color-group",capture:!1}));var n=_e(e);n&&this.linkByElement(n,t==null?void 0:t.style)},r.prototype.unlink=function(){var t=_e(this.context);t&&this.removeLink(t)},r.prototype.clear=function(){this.linkGroup&&this.linkGroup.clear(),this.cache={}},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.linkGroup&&this.linkGroup.remove()},r}(yt),tl=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.startPoint=null,t.endPoint=null,t.isStarted=!1,t.effectSiblings=!1,t.effectByRecord=!1,t}return r.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},r.prototype.start=function(){this.clear(),this.startPoint=this.getCurrentPoint(),this.isStarted=!0},r.prototype.getIntersectElements=function(){var t=null;if(Yi(this.context))t=Es(this.context,10);else{var e=this.startPoint,n=this.isStarted?this.getCurrentPoint():this.endPoint;if(!e||!n)return;var a={minX:Math.min(e.x,n.x),minY:Math.min(e.y,n.y),maxX:Math.max(e.x,n.x),maxY:Math.max(e.y,n.y)},o=this.context.view;t=Bs(o,a)}return t},r.prototype.setStateEnable=function(t){if(this.effectSiblings&&!this.effectByRecord)this.setSiblingsState(t);else{var e=Mt(this.context.view),n=this.getIntersectElements();n&&n.length?this.effectByRecord?this.setSiblingsStateByRecord(n,t):this.setElementsState(n,t,e):this.clear()}},r.prototype.setSiblingsStateByRecord=function(t,e){var n=this,a=this.context.view,o=ve(a),s=t.map(function(u){return u.getModel().data}),l=a.getXScale().field,h=a.getYScales()[0].field;M(o,function(u){var c=Mt(u),f=c.filter(function(v){var p=v.getModel().data;return _f(s,p,l,h)});n.setElementsState(f,e,c)})},r.prototype.setSiblingsState=function(t){var e=this,n=this.context.view,a=ve(n);Yi(this.context)&&M(a,function(o){var s=Mt(o),l=zf(e.context,o,10);l&&l.length?e.setElementsState(l,t,s):e.clearViewState(o)})},r.prototype.setElementsState=function(t,e,n){var a=this;M(n,function(o){t.includes(o)?a.setElementState(o,e):a.setElementState(o,!1)})},r.prototype.end=function(){this.isStarted=!1,this.endPoint=this.getCurrentPoint()},r.prototype.clear=function(){var t=this,e=this.context.view;if(this.effectSiblings){var n=ve(e);M(n,function(a){t.clearViewState(a)})}else this.clearViewState(e)},r}(Ks),OS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(tl),el=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.setStateEnable=function(t){var e=_e(this.context);if(e){if(!Nf(this.context))return;t?(this.clear(),this.setElementState(e,!0)):this.hasState(e)&&this.setElementState(e,!1)}},r.prototype.toggle=function(){var t=_e(this.context);if(t){var e=this.hasState(t);e||this.clear(),this.setElementState(t,!e)}},r.prototype.reset=function(){this.setStateEnable(!1)},r}(Ks),DS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(el),yi="inactive",mi="active";function rl(i){var r=Mt(i);M(r,function(t){t.hasState(mi)&&t.setState(mi,!1),t.hasState(yi)&&t.setState(yi,!1)})}function _v(i,r,t){M(i,function(e){r(e)?(e.hasState(yi)&&e.setState(yi,!1),e.setState(mi,t)):(e.hasState(mi)&&e.setState(mi,!1),e.setState(yi,t))})}var ar=Pn.INACTIVE,me=Pn.ACTIVE,il=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName=me,t}return r.prototype.setElementsStateByItem=function(t,e,n,a){var o=this,s=function(l){return o.isMathItem(l,e,n)};this.setHighlightBy(t,s,a)},r.prototype.setElementHighlight=function(t,e){e(t)?(t.hasState(ar)&&t.setState(ar,!1),t.setState(me,!0)):t.hasState(me)||t.setState(ar,!0)},r.prototype.setHighlightBy=function(t,e,n){var a=this;if(n)M(t,function(l){a.setElementHighlight(l,e)});else{var o=Wf(this.context.view,me),s=!0;M(o,function(l){if(!e(l))return s=!1,!1}),s?this.clear():M(t,function(l){e(l)&&(l.hasState(me)&&l.setState(me,!1),l.setState(ar,!0))})}},r.prototype.setElementState=function(t,e){var n=this.context.view,a=Mt(n);this.setHighlightBy(a,function(o){return t===o},e)},r.prototype.highlight=function(){this.setState()},r.prototype.clear=function(){var t=this.context.view;rl(t)},r}(Js),RS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.setStateByElement=function(t,e){var n=this.context.view,a=t.geometry.getAttribute("color");if(!!a){var o=n.getScaleByField(a.getFields()[0]),s=ae(t,o.field),l=Mt(n),h=l.filter(function(u){return ae(u,o.field)===s});this.setHighlightBy(l,function(u){return h.includes(u)},e)}},r}(il),YS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.setElementHighlight=function(t,e){e(t)?(t.hasState(ar)&&t.setState(ar,!1),t.setState(me,!0)):(t.setState(ar,!0),t.hasState(me)&&t.setState(me,!1))},r.prototype.setStateByElement=function(t,e){var n=this.context.view,a=n.getXScale(),o=ae(t,a.field),s=Mt(n),l=s.filter(function(h){return ae(h,a.field)===o});this.setHighlightBy(s,function(h){return l.includes(h)},e)},r.prototype.toggle=function(){var t=_e(this.context);if(t){var e=t.hasState(this.stateName);this.setStateByElement(t,!e)}},r}(il),he;(function(i){i.BEFORE_HIGHLIGHT="element-range-highlight:beforehighlight",i.AFTER_HIGHLIGHT="element-range-highlight:afterhighlight",i.BEFORE_CLEAR="element-range-highlight:beforeclear",i.AFTER_CLEAR="element-range-highlight:afterclear"})(he||(he={}));var jv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.clearViewState=function(t){rl(t)},r.prototype.highlight=function(){var t=this.context,e=t.view,n=t.event,a=this.getIntersectElements(),o={view:e,event:n,highlightElements:a};e.emit(he.BEFORE_HIGHLIGHT,At.fromData(e,he.BEFORE_HIGHLIGHT,o)),this.setState(),e.emit(he.AFTER_HIGHLIGHT,At.fromData(e,he.AFTER_HIGHLIGHT,o))},r.prototype.clear=function(){var t=this.context.view;t.emit(he.BEFORE_CLEAR,At.fromData(t,he.BEFORE_CLEAR,{})),i.prototype.clear.call(this),t.emit(he.AFTER_CLEAR,At.fromData(t,he.AFTER_CLEAR,{}))},r.prototype.setElementsState=function(t,e,n){_v(n,function(a){return t.indexOf(a)>=0},e)},r}(tl),GS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.highlight=function(){this.setState()},r.prototype.setElementState=function(t,e){var n=this.context.view,a=Mt(n);_v(a,function(o){return t===o},e)},r.prototype.clear=function(){var t=this.context.view;rl(t)},r}(el),HS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(tl),VS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(Js),NS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(el),yr=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="",t.ignoreItemStates=[],t}return r.prototype.getTriggerListInfo=function(){var t=Gr(this.context),e=null;return Ri(t)&&(e={item:t.item,list:t.component}),e},r.prototype.getAllowComponents=function(){var t=this,e=this.context.view,n=$f(e),a=[];return M(n,function(o){o.isList()&&t.allowSetStateByElement(o)&&a.push(o)}),a},r.prototype.hasState=function(t,e){return t.hasState(e,this.stateName)},r.prototype.clearAllComponentsState=function(){var t=this,e=this.getAllowComponents();M(e,function(n){n.clearItemsState(t.stateName)})},r.prototype.allowSetStateByElement=function(t){var e=t.get("field");if(!e)return!1;if(this.cfg&&this.cfg.componentNames){var n=t.get("name");if(this.cfg.componentNames.indexOf(n)===-1)return!1}var a=this.context.view,o=Hr(a,e);return o&&o.isCategory},r.prototype.allowSetStateByItem=function(t,e){var n=this.ignoreItemStates;if(n.length){var a=n.filter(function(o){return e.hasState(t,o)});return a.length===0}return!0},r.prototype.setStateByElement=function(t,e,n){var a=t.get("field"),o=this.context.view,s=Hr(o,a),l=ae(e,a),h=s.getText(l);this.setItemsState(t,h,n)},r.prototype.setStateEnable=function(t){var e=this,n=_e(this.context);if(n){var a=this.getAllowComponents();M(a,function(h){e.setStateByElement(h,n,t)})}else{var o=Gr(this.context);if(Ri(o)){var s=o.item,l=o.component;this.allowSetStateByElement(l)&&this.allowSetStateByItem(s,l)&&this.setItemState(l,s,t)}}},r.prototype.setItemsState=function(t,e,n){var a=this,o=t.getItems();M(o,function(s){s.name===e&&a.setItemState(t,s,n)})},r.prototype.setItemState=function(t,e,n){t.setItemState(e,this.stateName,n)},r.prototype.setState=function(){this.setStateEnable(!0)},r.prototype.reset=function(){this.setStateEnable(!1)},r.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item,a=this.hasState(e,n);this.setItemState(e,n,!a)}},r.prototype.clear=function(){var t=this.getTriggerListInfo();t?t.list.clearItemsState(this.stateName):this.clearAllComponentsState()},r}(yt),XS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="active",t}return r.prototype.active=function(){this.setState()},r}(yr),ku="inactive",Iu="active";function zS(i){var r=i.getItems();M(r,function(t){i.hasState(t,Iu)&&i.setItemState(t,Iu,!1),i.hasState(t,ku)&&i.setItemState(t,ku,!1)})}var ni="inactive",Je="active",nl=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName=Je,t.ignoreItemStates=["unchecked"],t}return r.prototype.setItemsState=function(t,e,n){this.setHighlightBy(t,function(a){return a.name===e},n)},r.prototype.setItemState=function(t,e,n){t.getItems(),this.setHighlightBy(t,function(a){return a===e},n)},r.prototype.setHighlightBy=function(t,e,n){var a=t.getItems();if(n)M(a,function(l){e(l)?(t.hasState(l,ni)&&t.setItemState(l,ni,!1),t.setItemState(l,Je,!0)):t.hasState(l,Je)||t.setItemState(l,ni,!0)});else{var o=t.getItemsByState(Je),s=!0;M(o,function(l){if(!e(l))return s=!1,!1}),s?this.clear():M(a,function(l){e(l)&&(t.hasState(l,Je)&&t.setItemState(l,Je,!1),t.setItemState(l,ni,!0))})}},r.prototype.highlight=function(){this.setState()},r.prototype.clear=function(){var t=this.getTriggerListInfo();if(t)zS(t.list);else{var e=this.getAllowComponents();M(e,function(n){n.clearItemsState(Je),n.clearItemsState(ni)})}},r}(yr),WS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="selected",t}return r.prototype.selected=function(){this.setState()},r}(yr),$S=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName="unchecked",t}return r.prototype.unchecked=function(){this.setState()},r}(yr),Cr="unchecked",Ln="checked",_S=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.stateName=Ln,t}return r.prototype.setItemState=function(t,e,n){this.setCheckedBy(t,function(a){return a===e},n)},r.prototype.setCheckedBy=function(t,e,n){var a=t.getItems();n&&M(a,function(o){e(o)?(t.hasState(o,Cr)&&t.setItemState(o,Cr,!1),t.setItemState(o,Ln,!0)):t.hasState(o,Ln)||t.setItemState(o,Cr,!0)})},r.prototype.toggle=function(){var t=this.getTriggerListInfo();if(t&&t.item){var e=t.list,n=t.item,a=!ea(e.getItems(),function(o){return e.hasState(o,Cr)});a||e.hasState(n,Cr)?this.setItemState(e,n,!0):this.reset()}},r.prototype.checked=function(){this.setState()},r.prototype.reset=function(){var t=this.getAllowComponents();M(t,function(e){e.clearItemsState(Ln),e.clearItemsState(Cr)})},r}(yr),Mr="unchecked",jS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.toggle=function(){var t,e,n,a,o,s,l,h,u=this.getTriggerListInfo();if(u!=null&&u.item){var c=u.list,f=u.item,v=c.getItems(),p=v.filter(function(B){return!c.hasState(B,Mr)}),g=v.filter(function(B){return c.hasState(B,Mr)}),d=p[0];if(v.length===p.length)try{for(var y=$(v),C=y.next();!C.done;C=y.next()){var m=C.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){t={error:B}}finally{try{C&&!C.done&&(e=y.return)&&e.call(y)}finally{if(t)throw t.error}}else if(v.length-g.length===1)if(d.id===f.id)try{for(var x=$(v),S=x.next();!S.done;S=x.next()){var m=S.value;c.setItemState(m,Mr,!1)}}catch(B){n={error:B}}finally{try{S&&!S.done&&(a=x.return)&&a.call(x)}finally{if(n)throw n.error}}else try{for(var b=$(v),A=b.next();!A.done;A=b.next()){var m=A.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){o={error:B}}finally{try{A&&!A.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}else try{for(var L=$(v),k=L.next();!k.done;k=L.next()){var m=k.value;c.setItemState(m,Mr,m.id!==f.id)}}catch(B){l={error:B}}finally{try{k&&!k.done&&(h=L.return)&&h.call(L)}finally{if(l)throw l.error}}}},r}(yr),Pu="showRadio",co="legend-radio-tip",US=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.timeStamp=0,t}return r.prototype.show=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var e=t.list,n=t.item;e.setItemState(n,Pu,!0)}},r.prototype.hide=function(){var t=this.getTriggerListInfo();if(t!=null&&t.item){var e=t.list,n=t.item;e.setItemState(n,Pu,!1)}},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.showTip=function(){var t=this.context,e=t.event,n=this.timeStamp,a=+new Date,o=this.context.event.target;if(a-n>16&&o.get("name")==="legend-item-radio"){var s=this.location,l={x:e.x,y:e.y};this.timeStamp=a,this.location=l,(!s||!gt(s,l))&&this.showTooltip(l)}},r.prototype.hideTip=function(){this.hideTooltip(),this.location=null},r.prototype.showTooltip=function(t){var e=this.context,n=e.event,a=n.target;if(a&&a.get("tip")){this.tooltip||this.renderTooltip();var o=e.view.getCanvas().get("el").getBoundingClientRect(),s=o.x,l=o.y;this.tooltip.update(w(w({title:a.get("tip")},t),{x:t.x+s,y:t.y+l})),this.tooltip.show()}},r.prototype.hideTooltip=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=(t={},t[Se]={padding:"6px 8px",transform:"translate(-50%, -80%)",background:"rgba(0,0,0,0.75)",color:"#fff","border-radius":"2px","z-index":100},t[be]={"font-size":"12px","line-height":"14px","margin-bottom":0,"word-break":"break-all"},t);document.getElementById(co)&&document.body.removeChild(document.getElementById(co));var n=new Ea({parent:document.body,region:null,visible:!1,crosshairs:null,domStyles:e,containerId:co});n.init(),n.setCapture(!1),this.tooltip=n},r}(yr),al=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.maskShape=null,t.points=[],t.starting=!1,t.moving=!1,t.preMovePoint=null,t.shapeType="path",t}return r.prototype.getCurrentPoint=function(){var t=this.context.event;return{x:t.x,y:t.y}},r.prototype.emitEvent=function(t){var e="mask:".concat(t),n=this.context.view,a=this.context.event;n.emit(e,{target:this.maskShape,shape:this.maskShape,points:this.points,x:a.x,y:a.y})},r.prototype.createMask=function(){var t=this.context.view,e=this.getMaskAttrs(),n=t.foregroundGroup.addShape({type:this.shapeType,name:"mask",draggable:!0,attrs:w({fill:"#C5D4EB",opacity:.3},e)});return n},r.prototype.getMaskPath=function(){return[]},r.prototype.show=function(){this.maskShape&&(this.maskShape.show(),this.emitEvent("show"))},r.prototype.start=function(t){this.starting=!0,this.moving=!1,this.points=[this.getCurrentPoint()],this.maskShape||(this.maskShape=this.createMask(),this.maskShape.set("capture",!1)),this.updateMask(t==null?void 0:t.maskStyle),this.emitEvent("start")},r.prototype.moveStart=function(){this.moving=!0,this.preMovePoint=this.getCurrentPoint()},r.prototype.move=function(){if(!(!this.moving||!this.maskShape)){var t=this.getCurrentPoint(),e=this.preMovePoint,n=t.x-e.x,a=t.y-e.y,o=this.points;M(o,function(s){s.x+=n,s.y+=a}),this.updateMask(),this.emitEvent("change"),this.preMovePoint=t}},r.prototype.updateMask=function(t){var e=D({},this.getMaskAttrs(),t);this.maskShape.attr(e)},r.prototype.moveEnd=function(){this.moving=!1,this.preMovePoint=null},r.prototype.end=function(){this.starting=!1,this.emitEvent("end"),this.maskShape&&this.maskShape.set("capture",!0)},r.prototype.hide=function(){this.maskShape&&(this.maskShape.hide(),this.emitEvent("hide"))},r.prototype.resize=function(){this.starting&&this.maskShape&&(this.points.push(this.getCurrentPoint()),this.updateMask(),this.emitEvent("change"))},r.prototype.destroy=function(){this.points=[],this.maskShape&&this.maskShape.remove(),this.maskShape=null,this.preMovePoint=null,i.prototype.destroy.call(this)},r}(yt),qS=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.shapeType="circle",t}return r.prototype.getMaskAttrs=function(){var t=this.points,e=Ct(this.points),n=0,a=0,o=0;if(t.length){var s=t[0];n=ks(s,e)/2,a=(e.x+s.x)/2,o=(e.y+s.y)/2}return{x:a,y:o,r:n}},r}(al),Uv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.shapeType="rect",t}return r.prototype.getRegion=function(){var t=this.points;return{start:zt(t),end:Ct(t)}},r.prototype.getMaskAttrs=function(){var t=this.getRegion(),e=t.start,n=t.end,a=Math.min(e.x,n.x),o=Math.min(e.y,n.y),s=Math.abs(n.x-e.x),l=Math.abs(n.y-e.y);return{x:a,y:o,width:s,height:l}},r}(al);function Fu(i){i.x=at(i.x,0,1),i.y=at(i.y,0,1)}var qv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dim="x",t.inPlot=!0,t}return r.prototype.getRegion=function(){var t=null,e=null,n=this.points,a=this.dim,o=this.context.view.getCoordinate(),s=o.invert(zt(n)),l=o.invert(Ct(n));return this.inPlot&&(Fu(s),Fu(l)),a==="x"?(t=o.convert({x:s.x,y:0}),e=o.convert({x:l.x,y:1})):(t=o.convert({x:0,y:s.y}),e=o.convert({x:1,y:l.y})),{start:t,end:e}},r}(Uv),Zv=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getMaskPath=function(){var t=this.points,e=[];return t.length&&(M(t,function(n,a){a===0?e.push(["M",n.x,n.y]):e.push(["L",n.x,n.y])}),e.push(["L",t[0].x,t[0].y])),e},r.prototype.getMaskAttrs=function(){return{path:this.getMaskPath()}},r.prototype.addPoint=function(){this.resize()},r}(al),ZS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.getMaskPath=function(){var t=this.points;return $x(t,!0)},r}(Zv),QS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.setCursor=function(t){var e=this.context.view;e.getCanvas().setCursor(t)},r.prototype.default=function(){this.setCursor("default")},r.prototype.pointer=function(){this.setCursor("pointer")},r.prototype.move=function(){this.setCursor("move")},r.prototype.crosshair=function(){this.setCursor("crosshair")},r.prototype.wait=function(){this.setCursor("wait")},r.prototype.help=function(){this.setCursor("help")},r.prototype.text=function(){this.setCursor("text")},r.prototype.eResize=function(){this.setCursor("e-resize")},r.prototype.wResize=function(){this.setCursor("w-resize")},r.prototype.nResize=function(){this.setCursor("n-resize")},r.prototype.sResize=function(){this.setCursor("s-resize")},r.prototype.neResize=function(){this.setCursor("ne-resize")},r.prototype.nwResize=function(){this.setCursor("nw-resize")},r.prototype.seResize=function(){this.setCursor("se-resize")},r.prototype.swResize=function(){this.setCursor("sw-resize")},r.prototype.nsResize=function(){this.setCursor("ns-resize")},r.prototype.ewResize=function(){this.setCursor("ew-resize")},r.prototype.zoomIn=function(){this.setCursor("zoom-in")},r.prototype.zoomOut=function(){this.setCursor("zoom-out")},r}(yt),KS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filterView=function(t,e,n){var a=this;t.getScaleByField(e)&&t.filter(e,n),t.views&&t.views.length&&M(t.views,function(o){a.filterView(o,e,n)})},r.prototype.filter=function(){var t=Gr(this.context);if(t){var e=this.context.view,n=t.component,a=n.get("field");if(Ri(t)){if(a){var o=n.getItemsByState("unchecked"),s=Hr(e,a),l=o.map(function(v){return v.name});l.length?this.filterView(e,a,function(v){var p=s.getText(v);return!l.includes(p)}):this.filterView(e,a,null),e.render(!0)}}else if(Xf(t)){var h=n.getValue(),u=Y(h,2),c=u[0],f=u[1];this.filterView(e,a,function(v){return v>=c&&v<=f}),e.render(!0)}}},r}(yt);function Ou(i,r,t,e){var n=Math.min(t[r],e[r]),a=Math.max(t[r],e[r]),o=Y(i.range,2),s=o[0],l=o[1];if(n<s&&(n=s),a>l&&(a=l),n===l&&a===l)return null;var h=i.invert(n),u=i.invert(a);if(i.isCategory){var c=i.values.indexOf(h),f=i.values.indexOf(u),v=i.values.slice(c,f+1);return function(p){return v.includes(p)}}else return function(p){return p>=h&&p<=u}}var jt;(function(i){i.FILTER="brush-filter-processing",i.RESET="brush-filter-reset",i.BEFORE_FILTER="brush-filter:beforefilter",i.AFTER_FILTER="brush-filter:afterfilter",i.BEFORE_RESET="brush-filter:beforereset",i.AFTER_RESET="brush-filter:afterreset"})(jt||(jt={}));var Fa=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dims=["x","y"],t.startPoint=null,t.isStarted=!1,t}return r.prototype.hasDim=function(t){return this.dims.includes(t)},r.prototype.start=function(){var t=this.context;this.isStarted=!0,this.startPoint=t.getCurrentPoint()},r.prototype.filter=function(){var t,e;if(Yi(this.context)){var n=this.context.event.target,a=n.getCanvasBBox();t={x:a.x,y:a.y},e={x:a.maxX,y:a.maxY}}else{if(!this.isStarted)return;t=this.startPoint,e=this.context.getCurrentPoint()}if(!(Math.abs(t.x-e.x)<5||Math.abs(t.x-e.y)<5)){var o=this.context,s=o.view,l=o.event,h={view:s,event:l,dims:this.dims};s.emit(jt.BEFORE_FILTER,At.fromData(s,jt.BEFORE_FILTER,h));var u=s.getCoordinate(),c=u.invert(e),f=u.invert(t);if(this.hasDim("x")){var v=s.getXScale(),p=Ou(v,"x",c,f);this.filterView(s,v.field,p)}if(this.hasDim("y")){var g=s.getYScales()[0],p=Ou(g,"y",c,f);this.filterView(s,g.field,p)}this.reRender(s,{source:jt.FILTER}),s.emit(jt.AFTER_FILTER,At.fromData(s,jt.AFTER_FILTER,h))}},r.prototype.end=function(){this.isStarted=!1},r.prototype.reset=function(){var t=this.context.view;if(t.emit(jt.BEFORE_RESET,At.fromData(t,jt.BEFORE_RESET,{})),this.isStarted=!1,this.hasDim("x")){var e=t.getXScale();this.filterView(t,e.field,null)}if(this.hasDim("y")){var n=t.getYScales()[0];this.filterView(t,n.field,null)}this.reRender(t,{source:jt.RESET}),t.emit(jt.AFTER_RESET,At.fromData(t,jt.AFTER_RESET,{}))},r.prototype.filterView=function(t,e,n){t.filter(e,n)},r.prototype.reRender=function(t,e){t.render(!0,e)},r}(yt),ol=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filterView=function(t,e,n){var a=ve(t);M(a,function(o){o.filter(e,n)})},r.prototype.reRender=function(t){var e=ve(t);M(e,function(n){n.render(!0)})},r}(Fa),JS=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.filter=function(){var t=Gr(this.context),e=this.context.view,n=Mt(e);if(Yi(this.context)){var a=Es(this.context,10);a&&M(n,function(g){a.includes(g)?g.show():g.hide()})}else if(t){var o=t.component,s=o.get("field");if(Ri(t)){if(s){var l=o.getItemsByState("unchecked"),h=Hr(e,s),u=l.map(function(g){return g.name});M(n,function(g){var d=ae(g,s),y=h.getText(d);u.indexOf(y)>=0?g.hide():g.show()})}}else if(Xf(t)){var c=o.getValue(),f=Y(c,2),v=f[0],p=f[1];M(n,function(g){var d=ae(g,s);d>=v&&d<=p?g.show():g.hide()})}}},r.prototype.clear=function(){var t=Mt(this.context.view);M(t,function(e){e.show()})},r.prototype.reset=function(){this.clear()},r}(yt),Qv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.byRecord=!1,t}return r.prototype.filter=function(){Yi(this.context)&&(this.byRecord?this.filterByRecord():this.filterByBBox())},r.prototype.filterByRecord=function(){var t=this.context.view,e=Es(this.context,10);if(!!e){var n=t.getXScale().field,a=t.getYScales()[0].field,o=e.map(function(l){return l.getModel().data}),s=ve(t);M(s,function(l){var h=Mt(l);M(h,function(u){var c=u.getModel().data;_f(o,c,n,a)?u.show():u.hide()})})}},r.prototype.filterByBBox=function(){var t=this,e=this.context.view,n=ve(e);M(n,function(a){var o=zf(t.context,a,10),s=Mt(a);o&&M(s,function(l){o.includes(l)?l.show():l.hide()})})},r.prototype.reset=function(){var t=ve(this.context.view);M(t,function(e){var n=Mt(e);M(n,function(a){a.show()})})},r}(yt),tb=10,eb=5,rb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.buttonGroup=null,t.buttonCfg={name:"button",text:"button",textStyle:{x:0,y:0,fontSize:12,fill:"#333333",cursor:"pointer"},padding:[8,10],style:{fill:"#f7f7f7",stroke:"#cccccc",cursor:"pointer"},activeStyle:{fill:"#e6e6e6"}},t}return r.prototype.getButtonCfg=function(){return D(this.buttonCfg,this.cfg)},r.prototype.drawButton=function(){var t=this.getButtonCfg(),e=this.context.view.foregroundGroup.addGroup({name:t.name}),n=e.addShape({type:"text",name:"button-text",attrs:w({text:t.text},t.textStyle)}),a=n.getBBox(),o=Is(t.padding),s=e.addShape({type:"rect",name:"button-rect",attrs:w({x:a.x-o[3],y:a.y-o[0],width:a.width+o[1]+o[3],height:a.height+o[0]+o[2]},t.style)});s.toBack(),e.on("mouseenter",function(){s.attr(t.activeStyle)}),e.on("mouseleave",function(){s.attr(t.style)}),this.buttonGroup=e},r.prototype.resetPosition=function(){var t=this.context.view,e=t.getCoordinate(),n=e.convert({x:1,y:1}),a=this.buttonGroup,o=a.getBBox(),s=ct(null,[["t",n.x-o.width-tb,n.y+o.height+eb]]);a.setMatrix(s)},r.prototype.show=function(){this.buttonGroup||this.drawButton(),this.resetPosition(),this.buttonGroup.show()},r.prototype.hide=function(){this.buttonGroup&&this.buttonGroup.hide()},r.prototype.destroy=function(){var t=this.buttonGroup;t&&t.remove(),i.prototype.destroy.call(this)},r}(yt),ib=4,nb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.starting=!1,t.dragStart=!1,t}return r.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint()},r.prototype.drag=function(){if(!!this.startPoint){var t=this.context.getCurrentPoint(),e=this.context.view,n=this.context.event;this.dragStart?e.emit("drag",{target:n.target,x:n.x,y:n.y}):ks(t,this.startPoint)>ib&&(e.emit("dragstart",{target:n.target,x:n.x,y:n.y}),this.dragStart=!0)}},r.prototype.end=function(){if(this.dragStart){var t=this.context.view,e=this.context.event;t.emit("dragend",{target:e.target,x:e.x,y:e.y})}this.starting=!1,this.dragStart=!1},r}(yt),ab=5,ob=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.starting=!1,t.isMoving=!1,t.startPoint=null,t.startMatrix=null,t}return r.prototype.start=function(){this.starting=!0,this.startPoint=this.context.getCurrentPoint(),this.startMatrix=this.context.view.middleGroup.getMatrix()},r.prototype.move=function(){if(!!this.starting){var t=this.startPoint,e=this.context.getCurrentPoint(),n=ks(t,e);if(n>ab&&!this.isMoving&&(this.isMoving=!0),this.isMoving){var a=this.context.view,o=ct(this.startMatrix,[["t",e.x-t.x,e.y-t.y]]);a.backgroundGroup.setMatrix(o),a.foregroundGroup.setMatrix(o),a.middleGroup.setMatrix(o)}}},r.prototype.end=function(){this.isMoving&&(this.isMoving=!1),this.startMatrix=null,this.starting=!1,this.startPoint=null},r.prototype.reset=function(){this.starting=!1,this.startPoint=null,this.isMoving=!1;var t=this.context.view;t.backgroundGroup.resetMatrix(),t.foregroundGroup.resetMatrix(),t.middleGroup.resetMatrix(),this.isMoving=!1},r}(yt),Du="x",Ru="y",Kv=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.dims=[Du,Ru],t.cfgFields=["dims"],t.cacheScaleDefs={},t}return r.prototype.hasDim=function(t){return this.dims.includes(t)},r.prototype.getScale=function(t){var e=this.context.view;return t==="x"?e.getXScale():e.getYScales()[0]},r.prototype.resetDim=function(t){var e=this.context.view;if(this.hasDim(t)&&this.cacheScaleDefs[t]){var n=this.getScale(t);e.scale(n.field,this.cacheScaleDefs[t]),this.cacheScaleDefs[t]=null}},r.prototype.reset=function(){this.resetDim(Du),this.resetDim(Ru);var t=this.context.view;t.render(!0)},r}(yt),sb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.startPoint=null,t.starting=!1,t.startCache={},t}return r.prototype.start=function(){var t=this;this.startPoint=this.context.getCurrentPoint(),this.starting=!0;var e=this.dims;M(e,function(n){var a=t.getScale(n),o=a.min,s=a.max,l=a.values;t.startCache[n]={min:o,max:s,values:l}})},r.prototype.end=function(){this.startPoint=null,this.starting=!1,this.startCache={}},r.prototype.translate=function(){var t=this;if(!!this.starting){var e=this.startPoint,n=this.context.view.getCoordinate(),a=this.context.getCurrentPoint(),o=n.invert(e),s=n.invert(a),l=s.x-o.x,h=s.y-o.y,u=this.context.view,c=this.dims;M(c,function(f){t.translateDim(f,{x:l*-1,y:h*-1})}),u.render(!0)}},r.prototype.translateDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.translateLinear(t,n,e)}},r.prototype.translateLinear=function(t,e,n){var a=this.context.view,o=this.startCache[t],s=o.min,l=o.max,h=l-s,u=n[t]*h;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:s,max:l}),a.scale(e.field,{nice:!1,min:s+u,max:l+u})},r.prototype.reset=function(){i.prototype.reset.call(this),this.startPoint=null,this.starting=!1},r}(Kv),lb=function(i){E(r,i);function r(){var t=i!==null&&i.apply(this,arguments)||this;return t.zoomRatio=.05,t}return r.prototype.zoomIn=function(){this.zoom(this.zoomRatio)},r.prototype.zoom=function(t){var e=this,n=this.dims;M(n,function(a){e.zoomDim(a,t)}),this.context.view.render(!0)},r.prototype.zoomOut=function(){this.zoom(-1*this.zoomRatio)},r.prototype.zoomDim=function(t,e){if(this.hasDim(t)){var n=this.getScale(t);n.isLinear&&this.zoomLinear(t,n,e)}},r.prototype.zoomLinear=function(t,e,n){var a=this.context.view;this.cacheScaleDefs[t]||(this.cacheScaleDefs[t]={nice:e.nice,min:e.min,max:e.max});var o=this.cacheScaleDefs[t],s=o.max-o.min,l=e.min,h=e.max,u=n*s,c=l-u,f=h+u,v=f-c,p=v/s;f>c&&p<100&&p>.01&&a.scale(e.field,{nice:!1,min:l-u,max:h+u})},r}(Kv);function hb(i){var r=i.gEvent.originalEvent;return r.deltaY>0}var ub=1,cb=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.scroll=function(t){var e=this.context,n=e.view,a=e.event;if(!!n.getOptions().scrollbar){var o=(t==null?void 0:t.wheelDelta)||ub,s=n.getController("scrollbar"),l=n.getXScale(),h=n.getOptions().data,u=Gt(Me(h,l.field)),c=Gt(l.values),f=s.getValue(),v=Math.floor((u-c)*f),p=v+(hb(a)?o:-o),g=o/(u-c)/1e4,d=at(p/(u-c)+g,0,1);s.setValue(d)}},r}(yt),fb="aixs-description-tooltip",vb=function(i){E(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.show=function(){var t=this.context,e=Gr(t).axis,n=e.cfg.title,a=n.description,o=n.text,s=n.descriptionTooltipStyle,l=t.event,h=l.x,u=l.y;this.tooltip||this.renderTooltip(),this.tooltip.update({title:o||"",customContent:function(){return`
<div class="`.concat(Se,'" style={').concat(s,`}>
<div class="`).concat(be,`">
\u5B57\u6BB5\u8BF4\u660E\uFF1A`).concat(a,`
</div>
</div>
`)},x:h,y:u}),this.tooltip.show()},r.prototype.destroy=function(){i.prototype.destroy.call(this),this.tooltip&&this.tooltip.destroy()},r.prototype.hide=function(){this.tooltip&&this.tooltip.hide()},r.prototype.renderTooltip=function(){var t,e=this.context.view,n=e.canvas,a={start:{x:0,y:0},end:{x:n.get("width"),y:n.get("height")}},o=new Ea({parent:n.get("el").parentNode,region:a,visible:!1,containerId:fb,domStyles:w({},D({},(t={},t[Se]={"max-width":"50%",padding:"10px","line-height":"15px","font-size":"12px",color:"rgba(0, 0, 0, .65)"},t[be]={"word-break":"break-all","margin-bottom":"3px"},t)))});o.init(),o.setCapture(!1),this.tooltip=o},r}(yt);nw("dark",Uf(_w));Uu("canvas",VC);Uu("svg",I1);ye("Polygon",$1);ye("Interval",V1);ye("Schema",_1);ye("Path",$s);ye("Point",z1);ye("Line",N1);ye("Area",F1);ye("Edge",O1);ye("Heatmap",D1);ye("Violin",U1);ka("base",Ds);ka("interval",uM);ka("pie",cM);ka("polar",Vv);Vt("overlap",AM);Vt("distribute",vM);Vt("fixed-overlap",bM);Vt("hide-overlap",DM);Vt("limit-in-shape",wM);Vt("limit-in-canvas",xM);Vt("limit-in-plot",KM);Vt("pie-outer",gM);Vt("adjust-color",YM);Vt("interval-adjust-position",NM);Vt("interval-hide-overlap",zM);Vt("point-adjust-position",_M);Vt("pie-spider",mM);Vt("path-adjust-position",qM);_t("fade-in",JM);_t("fade-out",tS);_t("grow-in-x",rS);_t("grow-in-xy",nS);_t("grow-in-y",iS);_t("scale-in-x",sS);_t("scale-in-y",lS);_t("wave-in",uS);_t("zoom-in",cS);_t("zoom-out",fS);_t("position-update",oS);_t("sector-path-update",hS);_t("path-in",aS);$r("rect",yS);$r("mirror",dS);$r("list",pS);$r("matrix",gS);$r("circle",vS);$r("tree",mS);_r("axis",CS);_r("legend",MS);_r("tooltip",Cw);_r("annotation",wS);_r("slider",SS);_r("scrollbar",TS);V("tooltip",$v);V("sibling-tooltip",kS);V("ellipsis-text",IS);V("element-active",PS);V("element-single-active",DS);V("element-range-active",OS);V("element-highlight",il);V("element-highlight-by-x",YS);V("element-highlight-by-color",RS);V("element-single-highlight",GS);V("element-range-highlight",jv);V("element-sibling-highlight",jv,{effectSiblings:!0,effectByRecord:!0});V("element-selected",VS);V("element-single-selected",NS);V("element-range-selected",HS);V("element-link-by-color",FS);V("active-region",BS);V("list-active",XS);V("list-selected",WS);V("list-highlight",nl);V("list-unchecked",$S);V("list-checked",_S);V("list-focus",jS);V("list-radio",US);V("legend-item-highlight",nl,{componentNames:["legend"]});V("axis-label-highlight",nl,{componentNames:["axis"]});V("axis-description",vb);V("rect-mask",Uv);V("x-rect-mask",qv,{dim:"x"});V("y-rect-mask",qv,{dim:"y"});V("circle-mask",qS);V("path-mask",Zv);V("smooth-path-mask",ZS);V("cursor",QS);V("data-filter",KS);V("brush",Fa);V("brush-x",Fa,{dims:["x"]});V("brush-y",Fa,{dims:["y"]});V("sibling-filter",ol);V("sibling-x-filter",ol);V("sibling-y-filter",ol);V("element-filter",JS);V("element-sibling-filter",Qv);V("element-sibling-filter-record",Qv,{byRecord:!0});V("view-drag",nb);V("view-move",ob);V("scale-translate",sb);V("scale-zoom",lb);V("reset-button",rb,{name:"reset-button",text:"reset"});V("mousewheel-scroll",cb);function ze(i){return i.isInPlot()}it("tooltip",{start:[{trigger:"plot:mousemove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"plot:touchmove",action:"tooltip:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"plot:mouseleave",action:"tooltip:hide"},{trigger:"plot:leave",action:"tooltip:hide"},{trigger:"plot:touchend",action:"tooltip:hide"}]});it("ellipsis-text",{start:[{trigger:"legend-item-name:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"legend-item-name:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:mousemove",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}},{trigger:"axis-label:touchstart",action:"ellipsis-text:show",throttle:{wait:50,leading:!0,trailing:!1}}],end:[{trigger:"legend-item-name:mouseleave",action:"ellipsis-text:hide"},{trigger:"legend-item-name:touchend",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseleave",action:"ellipsis-text:hide"},{trigger:"axis-label:mouseout",action:"ellipsis-text:hide"},{trigger:"axis-label:touchend",action:"ellipsis-text:hide"}]});it("element-active",{start:[{trigger:"element:mouseenter",action:"element-active:active"}],end:[{trigger:"element:mouseleave",action:"element-active:reset"}]});it("element-selected",{start:[{trigger:"element:click",action:"element-selected:toggle"}]});it("element-highlight",{start:[{trigger:"element:mouseenter",action:"element-highlight:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight:reset"}]});it("element-highlight-by-x",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-x:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-x:reset"}]});it("element-highlight-by-color",{start:[{trigger:"element:mouseenter",action:"element-highlight-by-color:highlight"}],end:[{trigger:"element:mouseleave",action:"element-highlight-by-color:reset"}]});it("legend-active",{start:[{trigger:"legend-item:mouseenter",action:["list-active:active","element-active:active"]}],end:[{trigger:"legend-item:mouseleave",action:["list-active:reset","element-active:reset"]}]});it("legend-highlight",{start:[{trigger:"legend-item:mouseenter",action:["legend-item-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"legend-item:mouseleave",action:["legend-item-highlight:reset","element-highlight:reset"]}]});it("axis-label-highlight",{start:[{trigger:"axis-label:mouseenter",action:["axis-label-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"axis-label:mouseleave",action:["axis-label-highlight:reset","element-highlight:reset"]}]});it("element-list-highlight",{start:[{trigger:"element:mouseenter",action:["list-highlight:highlight","element-highlight:highlight"]}],end:[{trigger:"element:mouseleave",action:["list-highlight:reset","element-highlight:reset"]}]});it("element-range-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"mask:mouseenter",action:"cursor:move"},{trigger:"plot:mouseleave",action:"cursor:default"},{trigger:"mask:mouseleave",action:"cursor:crosshair"}],start:[{trigger:"plot:mousedown",isEnable:function(i){return!i.isInShape("mask")},action:["rect-mask:start","rect-mask:show"]},{trigger:"mask:dragstart",action:["rect-mask:moveStart"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:drag",action:["rect-mask:move"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end"]},{trigger:"mask:dragend",action:["rect-mask:moveEnd"]},{trigger:"document:mouseup",isEnable:function(i){return!i.isInPlot()},action:["element-range-highlight:clear","rect-mask:end","rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["element-range-highlight:clear","rect-mask:hide"]}]});it("brush",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:["brush:start","rect-mask:start","rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:ze,action:["rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:ze,action:["brush:filter","brush:end","rect-mask:end","rect-mask:hide","reset-button:show"]}],rollback:[{trigger:"reset-button:click",action:["brush:reset","reset-button:hide","cursor:crosshair"]}]});it("brush-visible",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"plot:mousedown",action:["rect-mask:start","rect-mask:show"]}],processing:[{trigger:"plot:mousemove",action:["rect-mask:resize"]},{trigger:"mask:change",action:["element-range-highlight:highlight"]}],end:[{trigger:"plot:mouseup",action:["rect-mask:end","rect-mask:hide","element-filter:filter","element-range-highlight:clear"]}],rollback:[{trigger:"dblclick",action:["element-filter:clear"]}]});it("brush-x",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:["brush-x:start","x-rect-mask:start","x-rect-mask:show"]}],processing:[{trigger:"mousemove",isEnable:ze,action:["x-rect-mask:resize"]}],end:[{trigger:"mouseup",isEnable:ze,action:["brush-x:filter","brush-x:end","x-rect-mask:end","x-rect-mask:hide"]}],rollback:[{trigger:"dblclick",action:["brush-x:reset"]}]});it("element-path-highlight",{showEnable:[{trigger:"plot:mouseenter",action:"cursor:crosshair"},{trigger:"plot:mouseleave",action:"cursor:default"}],start:[{trigger:"mousedown",isEnable:ze,action:"path-mask:start"},{trigger:"mousedown",isEnable:ze,action:"path-mask:show"}],processing:[{trigger:"mousemove",action:"path-mask:addPoint"}],end:[{trigger:"mouseup",action:"path-mask:end"}],rollback:[{trigger:"dblclick",action:"path-mask:hide"}]});it("element-single-selected",{start:[{trigger:"element:click",action:"element-single-selected:toggle"}]});it("legend-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:["cursor:pointer","list-radio:show"]},{trigger:"legend-item:mouseleave",action:["cursor:default","list-radio:hide"]}],start:[{trigger:"legend-item:click",isEnable:function(i){return!i.isInShape("legend-item-radio")},action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","data-filter:filter","list-radio:show"]},{trigger:"legend-item-radio:mouseenter",action:["list-radio:showTip"]},{trigger:"legend-item-radio:mouseleave",action:["list-radio:hideTip"]},{trigger:"legend-item-radio:click",action:["list-focus:toggle","data-filter:filter","list-radio:show"]}]});it("continuous-filter",{start:[{trigger:"legend:valuechanged",action:"data-filter:filter"}]});it("continuous-visible-filter",{start:[{trigger:"legend:valuechanged",action:"element-filter:filter"}]});it("legend-visible-filter",{showEnable:[{trigger:"legend-item:mouseenter",action:"cursor:pointer"},{trigger:"legend-item:mouseleave",action:"cursor:default"}],start:[{trigger:"legend-item:click",action:["legend-item-highlight:reset","element-highlight:reset","list-unchecked:toggle","element-filter:filter"]}]});it("active-region",{start:[{trigger:"plot:mousemove",action:"active-region:show"}],end:[{trigger:"plot:mouseleave",action:"active-region:hide"}]});it("axis-description",{start:[{trigger:"axis-description:mousemove",action:"axis-description:show"}],end:[{trigger:"axis-description:mouseleave",action:"axis-description:hide"}]});function Yu(i){return i.gEvent.preventDefault(),i.gEvent.originalEvent.deltaY>0}it("view-zoom",{start:[{trigger:"plot:mousewheel",isEnable:function(i){return Yu(i.event)},action:"scale-zoom:zoomOut",throttle:{wait:100,leading:!0,trailing:!1}},{trigger:"plot:mousewheel",isEnable:function(i){return!Yu(i.event)},action:"scale-zoom:zoomIn",throttle:{wait:100,leading:!0,trailing:!1}}]});it("sibling-tooltip",{start:[{trigger:"plot:mousemove",action:"sibling-tooltip:show"}],end:[{trigger:"plot:mouseleave",action:"sibling-tooltip:hide"}]});it("plot-mousewheel-scroll",{start:[{trigger:"plot:mousewheel",action:"mousewheel-scroll:scroll"}]});export{pb as C};