UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

53 lines 737 kB
/* @license */
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("kendo.core.min.js"),require("kendo.icons.min.js"),require("kendo.grid.min.js"),require("kendo.expansionpanel.min.js"),require("kendo.window.min.js"),require("kendo.splitter.min.js"),require("kendo.form.min.js"),require("kendo.tabstrip.min.js"),require("kendo.dataviz.chart.min.js"),require("kendo.html.icon.min.js"),require("kendo.dropdownbutton.min.js"),require("kendo.colorpicker.min.js")):typeof define==`function`&&define.amd?define([`exports`,`kendo.core.min`,`kendo.icons.min`,`kendo.grid.min`,`kendo.expansionpanel.min`,`kendo.window.min`,`kendo.splitter.min`,`kendo.form.min`,`kendo.tabstrip.min`,`kendo.dataviz.chart.min`,`kendo.html.icon.min`,`kendo.dropdownbutton.min`,`kendo.colorpicker.min`],t):(e=typeof globalThis<`u`?globalThis:e||self,t((e.kendo=e.kendo||{},e.kendo._globals=e.kendo._globals||{},e.kendo._globals.Chartwizard={}),e.kendo._globals.Core,e.kendo._globals.Icons,e.kendo._globals.Grid,e.kendo._globals.Expansionpanel,e.kendo._globals.Window,e.kendo._globals.Splitter,e.kendo._globals.Form,e.kendo._globals.Tabstrip,e.kendo._globals.DatavizChart,e.kendo._globals.HtmlIcon,e.kendo._globals.Dropdownbutton,e.kendo._globals.Colorpicker))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var p=Object.defineProperty,m=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t||p(n,Symbol.toStringTag,{value:`Module`}),n};let h=`ArrowUp`,g=`ArrowDown`,_=`ArrowLeft`,v=`ArrowRight`,y=`aria-activedescendant`,b=`#000`,x=`bottom`,S=`center`,C=`circle`,w=`date`,ee=`12px sans-serif`,T=/\{\d+:?/,te=`height`,E=`left`,D=Number.MAX_VALUE,ne=-Number.MAX_VALUE,re=`none`,ie=`outside`,O=`right`,ae=`value`,k=`#fff`,oe=`width`,se=`pointer`;function ce(e,t=10){return!Number.isFinite(e)||e===0?e:parseFloat(e.toPrecision(t))}function A(e,t){let n=ce(t-e,9);if(n===0){if(t===0)return .1;n=Math.abs(t)}let r=10**Math.floor(Math.log(n)/Math.log(10)),i=ce(n/r,10),a=1;return a=i<1.904762?.2:i<4.761904?.5:i<9.523809?1:2,ce(r*a,10)}function j(e){return Array.isArray(e)}function le(e,t){let n=j(t)?t:[t];for(let t=0;t<n.length;t++){let r=n[t];e.className.indexOf(r)===-1&&(e.className+=` `+r)}}let ue=/\s+/g;function de(e,t){e&&e.className&&(e.className=e.className.replace(t,``).replace(ue,` `))}var fe=class{},pe=class extends fe{constructor(){super(),this._events={}}bind(e,t,n){let r=he(e),i=me(t),a=r.length;if(t===void 0){for(let t in e)this.bind(t,e[t]);return this}for(let e=0;e<a;e++){let a=r[e],o=i?t:t[a];if(o){if(n){let e=o;o=()=>{this.unbind(a,o),e.apply(this,arguments)},o.original=e}(this._events[a]=this._events[a]||[]).push(o)}}return this}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=he(e),r=me(t);for(let e=0,i=n.length;e<i;e++){let i=n[e],a=r?t:t[i];a&&(this._events[i]=this._events[i]||[]).unshift(a)}return this}trigger(e,t={}){let n=this._events[e];if(n){let e=n.length;t.sender=this,t._defaultPrevented=!1,t.preventDefault=ge,t.isDefaultPrevented=_e,n=n.slice();for(let r=0;r<e;r++)n[r].call(this,t);return t._defaultPrevented===!0}return!1}unbind(e,t){let n=this._events[e];if(e===void 0)this._events={};else if(n)if(t)for(let e=n.length-1;e>=0;e--)(n[e]===t||n[e].original===t)&&n.splice(e,1);else this._events[e]=[];return this}};function me(e){return typeof e==`function`}function he(e){return typeof e==`string`?[e]:e}function ge(){this._defaultPrevented=!0}function _e(){return this._defaultPrevented===!0}let ve=e=>{let t=typeof window<`u`?window:{},n=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)};ve=e=>n.call(t,e),ve(e)};var ye=ve;let be=/&/g,xe=/</g,Se=/"/g,Ce=/'/g,we=/>/g;function Te(e){return String(e).replace(be,`&amp;`).replace(xe,`&lt;`).replace(we,`&gt;`).replace(Se,`&quot;`).replace(Ce,`&#39;`)}function Ee(e){let t=window.console;t!==void 0&&t.log&&t.log(e)}function De(e){let t={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+))/i},n={};for(let r in t)if(t.hasOwnProperty(r)){let i=e.match(t[r]);if(i){n[r]=!0,n[i[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,n.version=parseInt(document.documentMode||i[2],10);break}}return n}let Oe=null,ke={get browser(){return typeof window>`u`||Oe||(Oe=De(window.navigator.userAgent)),Oe}},Ae=Date.now||function(){return new Date().getTime()};function je(e,t){let n=0,r;if(!t||t<=0)return e;let i=function(){let i=Ae()-n,a=arguments,o=function(){e.apply(null,a),n=Ae()};if(!n)return o();r&&clearTimeout(r),i>t?o():r=setTimeout(o,t-i)};return i.cancel=function(){clearTimeout(r)},i}let Me={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`00ffff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000000`,blanchedalmond:`ffebcd`,blue:`0000ff`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`00ffff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgrey:`a9a9a9`,darkgreen:`006400`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`ff00ff`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,grey:`808080`,green:`008000`,greenyellow:`adff2f`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgrey:`d3d3d3`,lightgreen:`90ee90`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`778899`,lightslategrey:`778899`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`00ff00`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`ff00ff`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370d8`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`d87093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,red:`ff0000`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`ffffff`,whitesmoke:`f5f5f5`,yellow:`ffff00`,yellowgreen:`9acd32`},Ne=ke.browser,Pe=e=>{let t=Object.keys(Me);t.push(`transparent`);let n=RegExp(`^(`+t.join(`|`)+`)(\\W|$)`,`i`);return Pe=e=>n.exec(e),n.exec(e)};var Fe=class extends fe{constructor(){super()}toHSV(){return this}toRGB(){return this}toHex(e){return this.toBytes().toHex(e)}toBytes(){return this}toCss(e){return`#`+this.toHex(e)}toCssRgba(){let e=this.toBytes();return`rgba(${e.r}, ${e.g}, ${e.b}, ${parseFloat(Number(this.a).toFixed(3))})`}toCssHex(){return this.a===1?`#`+this.toHex():`#`+this.toHex({alpha:!0})}toDisplay(){return Ne.msie&&Ne.version<9?this.toCss():this.toCssRgba()}equals(e){return e===this||e!=null&&this.toCssRgba()===Ue(e).toCssRgba()}diff(e){if(e===null)return NaN;let t=this.toBytes(),n=e.toBytes();return Math.sqrt(((t.r-n.r)*.3)**2+((t.g-n.g)*.59)**2+((t.b-n.b)*.11)**2)}clone(){let e=this.toBytes();return e===this&&(e=new Le(e.r,e.g,e.b,e.a)),e}},Ie=class extends Fe{constructor(e,t,n,r){super(),this.r=e,this.g=t,this.b=n,this.a=r}toHSV(){let{r:e,g:t,b:n}=this,r=Math.min(e,t,n),i=Math.max(e,t,n),a=i-r,o=i,s,c;return a===0?new ze(0,0,o,this.a):(i===0?(c=0,s=-1):(c=a/i,s=e===i?(t-n)/a:t===i?2+(n-e)/a:4+(e-t)/a,s*=60,s<0&&(s+=360)),new ze(s,c,o,this.a))}toHSL(){let{r:e,g:t,b:n}=this,r=Math.max(e,t,n),i=Math.min(e,t,n),a,o,s=(r+i)/2;if(r===i)a=o=0;else{let c=r-i;switch(o=s>.5?c/(2-r-i):c/(r+i),r){case e:a=(t-n)/c+(t<n?6:0);break;case t:a=(n-e)/c+2;break;case n:a=(e-t)/c+4;break;default:break}}return new Be(a*60,o*100,s*100,this.a)}toBytes(){return new Le(this.r*255,this.g*255,this.b*255,this.a)}},Le=class extends Ie{constructor(e,t,n,r){super(Math.round(e),Math.round(t),Math.round(n),r)}toRGB(){return new Ie(this.r/255,this.g/255,this.b/255,this.a)}toHSV(){return this.toRGB().toHSV()}toHSL(){return this.toRGB().toHSL()}toHex(e){let t=Re(this.r,2)+Re(this.g,2)+Re(this.b,2);return e&&e.alpha&&(t+=Re(Math.round(this.a*255),2)),t}toBytes(){return this}};function Re(e,t,n=`0`){let r=e.toString(16);for(;t>r.length;)r=n+r;return r}var ze=class extends Fe{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.v=n,this.a=r}toRGB(){let{h:e,s:t,v:n}=this,r,i,a;if(t===0)r=i=a=n;else{e/=60;let o=Math.floor(e),s=e-o,c=n*(1-t),l=n*(1-t*s),u=n*(1-t*(1-s));switch(o){case 0:r=n,i=u,a=c;break;case 1:r=l,i=n,a=c;break;case 2:r=c,i=n,a=u;break;case 3:r=c,i=l,a=n;break;case 4:r=u,i=c,a=n;break;default:r=n,i=c,a=l;break}}return new Ie(r,i,a,this.a)}toHSL(){return this.toRGB().toHSL()}toBytes(){return this.toRGB().toBytes()}},Be=class extends Fe{constructor(e,t,n,r){super(),this.h=e,this.s=t,this.l=n,this.a=r}toRGB(){let e=this.h/360,t=this.s/100,n=this.l/100,r,i,a;if(t===0)r=i=a=n;else{let o=n<.5?n*(1+t):n+t-n*t,s=2*n-o;r=Ve(s,o,e+1/3),i=Ve(s,o,e),a=Ve(s,o,e-1/3)}return new Ie(r,i,a,this.a)}toHSV(){return this.toRGB().toHSV()}toBytes(){return this.toRGB().toBytes()}};function Ve(e,t,n){let r=n;return r<0&&(r+=1),r>1&&--r,r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function He(e){return parseFloat(parseFloat(parseInt(e,16)/255).toFixed(3))}function Ue(e,t){let n,r;if(!e||e===`none`)return null;if(e instanceof Fe)return e;let i=e.toLowerCase();if(n=Pe(i))return i=n[1]===`transparent`?new Ie(1,1,1,0):Ue(Me[n[1]],t),i.match=[n[1]],i;if((n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new Le(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new Le(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),1):(n=/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])\b/i.exec(i))?r=new Le(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16),He(n[4]+n[4])):(n=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})\b/i.exec(i))?r=new Le(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16),He(n[4])):(n=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(i))?r=new Le(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),1):(n=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new Le(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4])):(n=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(i))?r=new Ie(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,1):(n=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(i))?r=new Ie(parseFloat(n[1])/100,parseFloat(n[2])/100,parseFloat(n[3])/100,parseFloat(n[4])):(n=/^color\(\s*srgb\s*([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s+([0-9]*\.?[0-9]+)\s*(\/\s+([0-9]*\.?[0-9]+))?\)/.exec(i))&&(r=new Ie(parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),parseFloat(n[5]||`1`))),r)r.match=n;else if(!t)throw Error(`Cannot parse color: `+i);return r}var We=class e extends fe{constructor(t){if(super(),arguments.length===1){let n=e.formats,r=this.resolveColor(t);for(let e=0;e<n.length;e++){let t=n[e].re,i=n[e].process,a=t.exec(r);if(a){let e=i(a);this.r=e[0],this.g=e[1],this.b=e[2]}}}else this.r=arguments[0],this.g=arguments[1],this.b=arguments[2];this.r=this.normalizeByte(this.r),this.g=this.normalizeByte(this.g),this.b=this.normalizeByte(this.b)}toHex(){let e=this.padDigit,t=this.r.toString(16),n=this.g.toString(16),r=this.b.toString(16);return`#`+e(t)+e(n)+e(r)}resolveColor(t){let n=t||`black`;return n.charAt(0)===`#`&&(n=n.substr(1,6)),n=n.replace(/ /g,``),n=n.toLowerCase(),n=e.namedColors[n]||n,n}normalizeByte(e){return e<0||isNaN(e)?0:e>255?255:e}padDigit(e){return e.length===1?`0`+e:e}brightness(e){let t=Math.round;return this.r=t(this.normalizeByte(this.r*e)),this.g=t(this.normalizeByte(this.g*e)),this.b=t(this.normalizeByte(this.b*e)),this}percBrightness(){return Math.sqrt(.241*this.r*this.r+.691*this.g*this.g+.068*this.b*this.b)}isDark(){return this.percBrightness()<180}static fromBytes(e,t,n,r){return new Le(e,t,n,r??1)}static fromRGB(e,t,n,r){return new Ie(e,t,n,r??1)}static fromHSV(e,t,n,r){return new ze(e,t,n,r??1)}static fromHSL(e,t,n,r){return new Be(e,t,n,r??1)}};We.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],We.namedColors=Me;let Ge=e=>e.ownerDocument.defaultView.getComputedStyle(e),Ke=(e,t)=>{let n=document.createElement(`div`);e.parentElement?e.parentElement.appendChild(n):e.appendChild(n),n.style.color=`rgb(from ${t} clamp(0, r, 255) clamp(0, g, 255) clamp(0, b, 255))`;let r=Ue(Ge(n).color,!0);return n.remove(),r?r.toCssHex():`#000000`};function qe(e,t){let n=Ge(e).getPropertyValue(t),r=Ue(n,!0);return r?r.toCssHex():Ke(e,n)}var Je=class extends fe{observers(){return this._observers=this._observers||[],this._observers}addObserver(e){return this._observers?this._observers.push(e):this._observers=[e],this}removeObserver(e){let t=this.observers(),n=t.indexOf(e);return n!==-1&&t.splice(n,1),this}trigger(e,t){let n=this._observers;if(n&&!this._suspended)for(let r=0;r<n.length;r++){let i=n[r];i[e]&&i[e](t)}return this}optionsChange(e={}){e.element=this,this.trigger(`optionsChange`,e)}geometryChange(){this.trigger(`geometryChange`,{element:this})}suspend(){return this._suspended=(this._suspended||0)+1,this}resume(){return this._suspended=Math.max((this._suspended||0)-1,0),this}_observerField(e,t){this[e]&&this[e].removeObserver(this),this[e]=t,t.addObserver(this)}};let Ye={}.toString;var Xe=class e extends Je{constructor(e,t=``){super(),this.prefix=t;for(let t in e){let n=e[t];n=this._wrap(n,t),this[t]=n}}get(e){let t=e.split(`.`),n=this;for(;t.length&&n;){let e=t.shift();n=n[e]}return n}set(e,t){this.get(e)!==t&&(this._set(e,this._wrap(t,e)),this.optionsChange({field:this.prefix+e,value:t}))}_set(t,n){let r=t.indexOf(`.`)>=0,i=this,a=t;if(r){let t=a.split(`.`),n=this.prefix;for(;t.length>1;){a=t.shift(),n+=a+`.`;let r=i[a];r||(r=new e({},n),r.addObserver(this),i[a]=r),i=r}a=t[0]}i._clear(a),i[a]=n}_clear(e){let t=this[e];t&&t.removeObserver&&t.removeObserver(this)}_wrap(t,n){let r=Ye.call(t),i=t;return i!=null&&r===`[object Object]`&&(!(t instanceof e)&&!(t instanceof fe)&&(i=new e(i,this.prefix+n+`.`)),i.addObserver(this)),i}};function Ze(e){return function(t){return this[e]!==t&&(this[e]=t,this.geometryChange()),this}}function Qe(e){return function(){return this[e]}}function $e(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=r.charAt(0).toUpperCase()+r.substring(1,r.length);e[`set`+i]=Ze(r),e[`get`+i]=Qe(r)}}let et=(e,t)=>{let n=class extends e{};return $e(n.prototype,t),n};function tt(e,t){return e.push.apply(e,t),e}let nt={1:`i`,10:`x`,100:`c`,2:`ii`,20:`xx`,200:`cc`,3:`iii`,30:`xxx`,300:`ccc`,4:`iv`,40:`xl`,400:`cd`,5:`v`,50:`l`,500:`d`,6:`vi`,60:`lx`,600:`dc`,7:`vii`,70:`lxx`,700:`dcc`,8:`viii`,80:`lxxx`,800:`dccc`,9:`ix`,90:`xc`,900:`cm`,1e3:`m`};function rt(e){let t=[1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],n=``;for(;e>0;)e<t[0]?t.shift():(n+=nt[t[0]],e-=t[0]);return n}function it(){let e,t,n=new Promise((r,i)=>{e=e=>(n._state=`resolved`,r(e),n),t=e=>(n._state=`rejected`,i(e),n)});return n._state=`pending`,n.resolve=e,n.reject=t,n.state=()=>n._state,n}function at(e){return e!==void 0}let ot=1;function st(){return`kdef`+ot++}let ct=Math.PI/180,lt=Number.MAX_VALUE,ut=-Number.MAX_VALUE;function dt(e){return e/ct}let ft=String.fromCharCode;function pt(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(55296<=r&&r<=56319){let t=r,i=e.charCodeAt(++n);isNaN(i)||(r=(t-55296)*1024+(i-56320)+65536)}r<128?t+=ft(r):r<2048?(t+=ft(192|r>>>6),t+=ft(128|r&63)):r<65536?(t+=ft(224|r>>>12),t+=ft(128|r>>>6&63),t+=ft(128|r&63)):r<1114111&&(t+=ft(240|r>>>18),t+=ft(128|r>>>12&63),t+=ft(128|r>>>6&63),t+=ft(128|r&63))}return t}function mt(e){return ft(e>>8)+ft(e&255)}function ht(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<65535)t+=mt(r);else{let e=(r-65536>>10)+55296,n=(r-65536&1023)+56320;t+=mt(e),t+=mt(n)}}return t}let gt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;function _t(e){let t=``,n=0,r=pt(e);for(;n<r.length;){let e=r.charCodeAt(n++),i=r.charCodeAt(n++),a=r.charCodeAt(n++),o=e>>2,s=(e&3)<<4|i>>4,c=(i&15)<<2|a>>6,l=a&63;isNaN(i)?c=l=64:isNaN(a)&&(l=64),t=t+gt.charAt(o)+gt.charAt(s)+gt.charAt(c)+gt.charAt(l)}return t}function vt(e){return(e.x||{}).location===void 0?{x:e.pageX||e.clientX||0,y:e.pageY||e.clientY||0}:{x:e.x.location,y:e.y.location}}function yt(e={}){return e.touch?e.touch.initialTouch:e.target}function bt(e){return e===``||e===null||e===`none`||e===`transparent`||e===void 0}function xt(e){if(e)return e[e.length-1]}function St(e,t,n){return Math.max(Math.min(e,n),t)}function Ct(e,t){if(e.length<2)return e.slice();function n(e,n){for(var r=[],i=0,a=0,o=0;i<e.length&&a<n.length;)t(e[i],n[a])<=0?r[o++]=e[i++]:r[o++]=n[a++];return i<e.length&&r.push.apply(r,e.slice(i)),a<n.length&&r.push.apply(r,n.slice(a)),r}return(function e(t){if(t.length<=1)return t;var r=Math.floor(t.length/2),i=t.slice(0,r),a=t.slice(r);return i=e(i),a=e(a),n(i,a)})(e)}function wt(e){return Promise.all(e)}function Tt(e){return e*ct}function Et(e){return e?10**e:1}function Dt(e,t){let n=Et(t);return Math.round(e*n)/n}function Ot(e,t){return e===void 0?t:e}function kt(e,t){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.addEventListener(r[i],t[n],!1)}}function At(e){let t=e.getBoundingClientRect(),n=document.documentElement;return{top:t.top+(window.pageYOffset||n.scrollTop)-(n.clientTop||0),left:t.left+(window.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}}function jt(e,t){let n={},r=window.getComputedStyle(e)||{},i=Array.isArray(t)?t:[t];for(let e=0;e<i.length;e++){let t=i[e];n[t]=r[t]}return n}function Mt(e){return isNaN(e)?e:e+`px`}function Nt(e,t){if(t){let{width:n,height:r}=t;n!==void 0&&(e.style.width=Mt(n)),r!==void 0&&(e.style.height=Mt(r))}else{let t=jt(e,[`width`,`height`]);return{width:parseInt(t.width,10),height:parseInt(t.height,10)}}}function Pt(e,t={}){for(let n in t){let r=n.trim().split(` `);for(let i=0;i<r.length;i++)e.removeEventListener(r[i],t[n],!1)}}function Ft(e){let{paddingLeft:t,paddingTop:n}=jt(e,[`paddingLeft`,`paddingTop`]);return{top:parseFloat(n),left:parseFloat(t)}}var It=class e extends fe{constructor(e=0,t=0,n=0,r=0,i=0,a=0){super(),this.a=e,this.b=t,this.c=n,this.d=r,this.e=i,this.f=a}multiplyCopy(t){return new e(this.a*t.a+this.c*t.b,this.b*t.a+this.d*t.b,this.a*t.c+this.c*t.d,this.b*t.c+this.d*t.d,this.a*t.e+this.c*t.f+this.e,this.b*t.e+this.d*t.f+this.f)}invert(){let{a:t,b:n,c:r,d:i,e:a,f:o}=this,s=t*i-n*r;return s===0?null:new e(i/s,-n/s,-r/s,t/s,(r*o-i*a)/s,(n*a-t*o)/s)}clone(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)}equals(e){return e?this.a===e.a&&this.b===e.b&&this.c===e.c&&this.d===e.d&&this.e===e.e&&this.f===e.f:!1}round(e){return this.a=Dt(this.a,e),this.b=Dt(this.b,e),this.c=Dt(this.c,e),this.d=Dt(this.d,e),this.e=Dt(this.e,e),this.f=Dt(this.f,e),this}toArray(e){let t=[this.a,this.b,this.c,this.d,this.e,this.f];if(e!==void 0)for(let n=0;n<t.length;n++)t[n]=Dt(t[n],e);return t}toString(e,t=`,`){return this.toArray(e).join(t)}static translate(t,n){return new e(1,0,0,1,t,n)}static unit(){return new e(1,0,0,1,0,0)}static rotate(t,n,r){let i=new e;return i.a=Math.cos(Tt(t)),i.b=Math.sin(Tt(t)),i.c=-i.b,i.d=i.a,i.e=n-n*i.a+r*i.b||0,i.f=r-r*i.a-n*i.b||0,i}static scale(t,n){return new e(t,0,0,n,0,0)}};It.IDENTITY=It.unit();let Lt=/matrix\((.*)\)/;function Rt(e){let t=e.match(Lt);return t===null||t.length!==2?It.unit():new It(...t[1].split(`,`).map(e=>parseFloat(e)))}function zt(e){let t=getComputedStyle(e).transform;return t===`none`?It.unit():Rt(t)}function Bt(e){if(!e)return It.unit();let t=zt(e),n=e.parentElement;for(;n;){let e=zt(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}var Vt=class extends fe{constructor(e){super(),this._size=e,this._length=0,this._map={}}put(e,t){let n=this._map,r={key:e,value:t};n[e]=r,this._head?(this._tail.newer=r,r.older=this._tail,this._tail=r):this._head=this._tail=r,this._length>=this._size?(n[this._head.key]=null,this._head=this._head.newer,this._head.older=null):this._length++}get(e){let t=this._map[e];if(t)return t===this._head&&t!==this._tail&&(this._head=t.newer,this._head.older=null),t!==this._tail&&(t.older&&(t.older.newer=t.newer,t.newer.older=t.older),t.older=this._tail,t.newer=null,this._tail.newer=t,this._tail=t),t.value}};let Ht=/\r?\n|\r|\t/g;function Ut(e){return String(e).replace(Ht,` `)}function Wt(e){let t=[];for(let n in e)t.push(n+e[n]);return t.sort().join(``)}function Gt(e){let t=2166136261;for(let n=0;n<e.length;++n)t+=(t<<1)+(t<<4)+(t<<7)+(t<<8)+(t<<24),t^=e.charCodeAt(n);return t>>>0}function Kt(){return{width:0,height:0,baseline:0}}let qt={baselineMarkerSize:1},Jt;typeof document<`u`&&(Jt=document.createElement(`div`),Jt.style.setProperty(`position`,`absolute`,`important`),Jt.style.setProperty(`top`,`-4000px`,`important`),Jt.style.setProperty(`width`,`auto`,`important`),Jt.style.setProperty(`height`,`auto`,`important`),Jt.style.setProperty(`padding`,`0`,`important`),Jt.style.setProperty(`margin`,`0`,`important`),Jt.style.setProperty(`border`,`0`,`important`),Jt.style.setProperty(`line-height`,`normal`,`important`),Jt.style.setProperty(`visibility`,`hidden`,`important`),Jt.style.setProperty(`white-space`,`pre`,`important`));var Yt=class extends fe{constructor(e){super(),this._cache=new Vt(1e3),this.options=Object.assign({},qt,e)}measure(e,t,n={}){if(e==null)return Kt();let r=Gt(e+Wt(t)),i=this._cache.get(r);if(i)return i;let a=Kt(),o=n.box||Jt,s=this._baselineMarker().cloneNode(!1);for(let e in t){let n=t[e];n!==void 0&&(o.style[e]=n)}let c=n.normalizeText===!1?String(e):Ut(e);return o.textContent=c,o.appendChild(s),document.body.appendChild(o),c.length&&(a.width=o.offsetWidth-this.options.baselineMarkerSize,a.height=o.offsetHeight,a.baseline=s.offsetTop+this.options.baselineMarkerSize),a.width>0&&a.height>0&&this._cache.put(r,a),o.parentNode.removeChild(o),a}_baselineMarker(){let e=document.createElement(`div`);return e.style.display=`inline-block`,e.style.verticalAlign=`baseline`,e.style.width=this.options.baselineMarkerSize+`px`,e.style.height=this.options.baselineMarkerSize+`px`,e.style.overflow=`hidden`,e}};Yt.current=new Yt;function Xt(e,t,n){return Yt.current.measure(e,t,n)}let Zt=()=>typeof window<`u`,Qt={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)(\.(\d+(\.\d+)?))?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},$t={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},en={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i},tn={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i},nn=(e,t,n)=>{for(let n in t)if(t.hasOwnProperty(n)&&t[n].test(e))return n;return n===void 0?e:n},rn=e=>{let t,n=[];for(let r in Qt)if(Qt.hasOwnProperty(r)){if(n=e.match(Qt[r]),!n)continue;if(r===`windows`&&`plugins`in window.navigator)return null;let i={};return i.device=r,i.browser=nn(e,tn,`default`),i.name=nn(r,$t),i[i.name]=!0,i.majorVersion=n[2],i.minorVersion=n[3]?n[3].replace(`_`,`.`):`.0`,t=i.minorVersion.replace(`.`,``).substr(0,2),i.flatVersion=i.majorVersion+t+Array(3-(t.length<3?t.length:2)).join(`0`),i.cordova=!0,i.appMode=window.navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||i.cordova,i}return null},an=e=>{let t=null,n=[];for(let r in en)if(en.hasOwnProperty(r)&&(n=e.match(en[r]),n)){t={},t[r]=!0,t[n[1].toLowerCase().split(` `)[0].split(`/`)[0]]=!0,t.version=parseInt(document.documentMode||n[2],10);break}return t},on=Zt()&&window.navigator?window.navigator.userAgent:null,sn=on?an(on):null;on&&rn(on),Zt()&&`ontouchstart`in window,sn&&!sn.chrome&&window.MSPointerEvent,sn&&!sn.chrome&&window.PointerEvent;let cn={};cn.undefined=e=>e;let ln={};ln.undefined=e=>e;let un=/\/\*[\s\S]*?\*\//g,dn=/([^\s:;]+?)\s*:\s*((?:(?:url\(\s*(?:(?:[^"')\\]|\\.)*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')\s*\)|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^;"'])*?)\s*)(?=;|$)/gi,fn=/&quot;|&#34;|&#x22;/gi,pn=/&apos;|&#39;|&#x27;/gi;function mn(e){return e.replace(fn,`"`).replace(pn,`'`)}function hn(e){let t={},n=mn((e||``).replace(un,``)),r=dn.exec(n),i,a;for(;r!==null;)i=r[1].trim(),a=r[2].trim(),t[i]=a,r=dn.exec(n);return t}let gn=(e,t)=>{let n=hn(t);Object.keys(n).forEach(t=>{e.style[t]=n[t]})},_n=`data-style`,vn=e=>(e||``).replace(/\sstyle=/g,` data-style=`),yn=e=>{Array.from(e.querySelectorAll(`[data-style]`)).forEach(e=>{let t=e.getAttribute(_n);e.removeAttribute(_n),gn(e,t)})},bn=(e,t)=>{e.innerHTML=vn(t),yn(e)},xn=(e,t)=>{let n=document.createElement(`div`);bn(n,t),n.firstElementChild&&e.insertBefore(n.firstElementChild,e.firstChild)};var Sn=m({DEG_TO_RAD:()=>ct,LRUCache:()=>Vt,MAX_NUM:()=>lt,MIN_NUM:()=>ut,TextMetrics:()=>Yt,append:()=>tt,arabicToRoman:()=>rt,bindEvents:()=>kt,createPromise:()=>it,defined:()=>at,definitionId:()=>st,deg:()=>dt,elementOffset:()=>At,elementPadding:()=>Ft,elementScale:()=>Bt,elementSize:()=>Nt,elementStyles:()=>jt,encodeBase64:()=>_t,eventCoordinates:()=>vt,eventElement:()=>yt,hashKey:()=>Gt,isTransparent:()=>bt,last:()=>xt,limitValue:()=>St,measureText:()=>Xt,mergeSort:()=>Ct,normalizeText:()=>Ut,now:()=>Ae,objectKey:()=>Wt,promiseAll:()=>wt,rad:()=>Tt,round:()=>Dt,setInnerHTML:()=>bn,unbindEvents:()=>Pt,valueOrDefault:()=>Ot});function Cn(e){return e&&typeof e.matrix==`function`?e.matrix():e}var M=class e extends et(Je,[`x`,`y`]){constructor(e,t){super(),this.x=e||0,this.y=t||0}equals(e){return e&&e.x===this.x&&e.y===this.y}clone(){return new e(this.x,this.y)}rotate(t,n){let r=e.create(n)||e.ZERO;return this.transform(It.rotate(t,r.x,r.y))}translate(e,t){return this.x+=e,this.y+=t,this.geometryChange(),this}translateWith(e){return this.translate(e.x,e.y)}move(e,t){return this.x=this.y=0,this.translate(e,t)}scale(e,t=e){return this.x*=e,this.y*=t,this.geometryChange(),this}scaleCopy(e,t){return this.clone().scale(e,t)}transform(e){let t=Cn(e),{x:n,y:r}=this;return this.x=t.a*n+t.c*r+t.e,this.y=t.b*n+t.d*r+t.f,this.geometryChange(),this}transformCopy(e){let t=this.clone();return e&&t.transform(e),t}distanceTo(e){let t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}round(e){return this.x=Dt(this.x,e),this.y=Dt(this.y,e),this.geometryChange(),this}toArray(e){let t=e!==void 0;return[t?Dt(this.x,e):this.x,t?Dt(this.y,e):this.y]}toString(e,t=` `){let{x:n,y:r}=this;return e!==void 0&&(n=Dt(n,e),r=Dt(r,e)),n+t+r}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static min(){let t=lt,n=lt;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.min(r.x,t),n=Math.min(r.y,n)}return new e(t,n)}static max(){let t=ut,n=ut;for(let e=0;e<arguments.length;e++){let r=arguments[e];t=Math.max(r.x,t),n=Math.max(r.y,n)}return new e(t,n)}static minPoint(){return new e(ut,ut)}static maxPoint(){return new e(lt,lt)}static get ZERO(){return new e(0,0)}},wn=class e extends et(Je,[`width`,`height`]){constructor(e,t){super(),this.width=e||0,this.height=t||0}equals(e){return e&&e.width===this.width&&e.height===this.height}clone(){return new e(this.width,this.height)}toArray(e){let t=e!==void 0;return[t?Dt(this.width,e):this.width,t?Dt(this.height,e):this.height]}static create(t,n){if(t!==void 0)return t instanceof e?t:arguments.length===1&&t.length===2?new e(t[0],t[1]):new e(t,n)}static get ZERO(){return new e(0,0)}},N=class e extends Je{constructor(e=new M,t=new wn,n=0){super(),this.setOrigin(e),this.setSize(t),this.setCornerRadius(n)}clone(){return new e(this.origin.clone(),this.size.clone())}equals(e){return e&&e.origin.equals(this.origin)&&e.size.equals(this.size)}setOrigin(e){return this._observerField(`origin`,M.create(e)),this.geometryChange(),this}getOrigin(){return this.origin}setCornerRadius(e){return this.cornerRadius=Array.isArray(e)?e:[e,e],this.geometryChange(),this}getCornerRadius(){return this.cornerRadius}setSize(e){return this._observerField(`size`,wn.create(e)),this.geometryChange(),this}getSize(){return this.size}width(){return this.size.width}height(){return this.size.height}topLeft(){return this.origin.clone()}bottomRight(){return this.origin.clone().translate(this.width(),this.height())}topRight(){return this.origin.clone().translate(this.width(),0)}bottomLeft(){return this.origin.clone().translate(0,this.height())}center(){return this.origin.clone().translate(this.width()/2,this.height()/2)}bbox(t){let n=this.topLeft().transformCopy(t),r=this.topRight().transformCopy(t),i=this.bottomRight().transformCopy(t),a=this.bottomLeft().transformCopy(t);return e.fromPoints(n,r,i,a)}transformCopy(t){return e.fromPoints(this.topLeft().transform(t),this.bottomRight().transform(t))}expand(e,t=e){return this.size.width+=2*e,this.size.height+=2*t,this.origin.translate(-e,-t),this}expandCopy(e,t){return this.clone().expand(e,t)}containsPoint(e){let t=this.origin,n=this.bottomRight();return!(e.x<t.x||e.y<t.y||n.x<e.x||n.y<e.y)}_isOnPath(e,t){let n=this.expandCopy(t,t),r=this.expandCopy(-t,-t);return n.containsPoint(e)&&!r.containsPoint(e)}static fromPoints(){let t=M.min.apply(null,arguments),n=M.max.apply(null,arguments),r=new wn(n.x-t.x,n.y-t.y);return new e(t,r)}static union(t,n){return e.fromPoints(M.min(t.topLeft(),n.topLeft()),M.max(t.bottomRight(),n.bottomRight()))}static intersect(t,n){let r={left:t.topLeft().x,top:t.topLeft().y,right:t.bottomRight().x,bottom:t.bottomRight().y},i={left:n.topLeft().x,top:n.topLeft().y,right:n.bottomRight().x,bottom:n.bottomRight().y};if(r.left<=i.right&&i.left<=r.right&&r.top<=i.bottom&&i.top<=r.bottom)return e.fromPoints(new M(Math.max(r.left,i.left),Math.max(r.top,i.top)),new M(Math.min(r.right,i.right),Math.min(r.bottom,i.bottom)))}},Tn=class e extends Je{constructor(e=It.unit()){super(),this._matrix=e}clone(){return new e(this._matrix.clone())}equals(e){return e&&e._matrix.equals(this._matrix)}translate(e,t){return this._matrix=this._matrix.multiplyCopy(It.translate(e,t)),this._optionsChange(),this}scale(e,t=e,n=null){let r=n;return r&&(r=M.create(r),this._matrix=this._matrix.multiplyCopy(It.translate(r.x,r.y))),this._matrix=this._matrix.multiplyCopy(It.scale(e,t)),r&&(this._matrix=this._matrix.multiplyCopy(It.translate(-r.x,-r.y))),this._optionsChange(),this}rotate(e,t){let n=M.create(t)||M.ZERO;return this._matrix=this._matrix.multiplyCopy(It.rotate(e,n.x,n.y)),this._optionsChange(),this}multiply(e){let t=Cn(e);return this._matrix=this._matrix.multiplyCopy(t),this._optionsChange(),this}matrix(e){return e?(this._matrix=e,this._optionsChange(),this):this._matrix}_optionsChange(){this.optionsChange({field:`transform`,value:this})}};function P(e){return e===null?null:e instanceof Tn?e:new Tn(e)}let En={dot:[1.5,3.5],dash:[4,3.5],longdash:[8,3.5],dashdot:[3.5,3.5,1.5,3.5],longdashdot:[8,3.5,1.5,3.5],longdashdotdot:[8,3.5,1.5,3.5,1.5,3.5]},Dn=`butt`;var On=class extends Je{get nodeType(){return`Rect`}constructor(e){super(),this._initOptions(e)}_initOptions(e={}){let{clip:t,transform:n}=e;n&&(e.transform=P(n)),t&&!t.id&&(t.id=st()),this.options=new Xe(e),this.options.addObserver(this)}transform(e){if(e!==void 0)this.options.set(`transform`,P(e));else return this.options.get(`transform`)}parentTransform(){let e=this,t;for(;e.parent;){e=e.parent;let n=e.transform();n&&(t=n.matrix().multiplyCopy(t||It.unit()))}if(t)return P(t)}currentTransform(e=this.parentTransform()){let t=Cn(this.transform()),n=Cn(e),r;if(r=t&&n?n.multiplyCopy(t):t||n,r)return P(r)}visible(e){return e===void 0?this.options.get(`visible`)!==!1:(this.options.set(`visible`,e),this)}clip(e){let t=this.options;return e===void 0?t.get(`clip`):(e&&!e.id&&(e.id=st()),t.set(`clip`,e),this)}opacity(e){return e===void 0?Ot(this.options.get(`opacity`),1):(this.options.set(`opacity`,e),this)}className(e){return e===void 0?this.options.get(`className`):(this.options.set(`className`,e),this)}clippedBBox(e){let t=this._clippedBBox(e);if(t){let n=this.clip();return n?N.intersect(t,n.bbox(e)):t}}containsPoint(e,t){if(this.visible()){let n=this.currentTransform(t),r=e;return n&&(r=e.transformCopy(n.matrix().invert())),this._hasFill()&&this._containsPoint(r)||this._isOnPath&&this._hasStroke()&&this._isOnPath(r)}return!1}_hasFill(){let e=this.options.fill;return e&&(e.nodeType===`Pattern`||!bt(e.color))}_hasStroke(){let e=this.options.stroke;return e&&e.width>0&&!bt(e.color)}_clippedBBox(e){return this.bbox(e)}};function kn(e,t,n,r){let i=0,a=0;return r&&(i=Math.atan2(r.c*n,r.a*t),r.b!==0&&(a=Math.atan2(r.d*n,r.b*t))),{x:i,y:a}}let An=Math.PI/2;var jn=class e extends et(Je,[`radius`]){constructor(e=new M,t=0){super(),this.setCenter(e),this.setRadius(t)}setCenter(e){return this._observerField(`center`,M.create(e)),this.geometryChange(),this}getCenter(){return this.center}equals(e){return e&&e.center.equals(this.center)&&e.radius===this.radius}clone(){return new e(this.center.clone(),this.radius)}pointAt(e){return this._pointAt(Tt(e))}bbox(e){let t=kn(this.center,this.radius,this.radius,e),n=M.maxPoint(),r=M.minPoint();for(let i=0;i<4;i++){let a=this._pointAt(t.x+i*An).transformCopy(e),o=this._pointAt(t.y+i*An).transformCopy(e),s=new M(a.x,o.y);n=M.min(n,s),r=M.max(r,s)}return N.fromPoints(n,r)}_pointAt(e){let{center:t,radius:n}=this;return new M(t.x+n*Math.cos(e),t.y+n*Math.sin(e))}containsPoint(e){let{center:t,radius:n}=this;return(e.x-t.x)**2+(e.y-t.y)**2<=n**2}_isOnPath(e,t){let{center:n,radius:r}=this,i=n.distanceTo(e);return r-t<=i&&i<=r+t}};let Mn=e=>class extends e{fill(e,t){let n=this.options;if(e!==void 0){if(e&&e.nodeType!==`Gradient`){let r={color:e};t!==void 0&&(r.opacity=t),n.set(`fill`,r)}else n.set(`fill`,e);return this}return n.get(`fill`)}stroke(e,t,n){return e===void 0?this.options.get(`stroke`):(this.options.set(`stroke.color`,e),t!==void 0&&this.options.set(`stroke.width`,t),n!==void 0&&this.options.set(`stroke.opacity`,n),this)}},Nn=It.IDENTITY.toString(),Pn=e=>class extends e{bbox(e){let t=Cn(this.currentTransform(e)),n=t?t.toString():Nn,r;this._bboxCache&&this._matrixHash===n?r=this._bboxCache.clone():(r=this._bbox(t),this._bboxCache=r?r.clone():null,this._matrixHash=n);let i=this.options.get(`stroke.width`);return i&&r&&r.expand(i/2),r}geometryChange(){delete this._bboxCache,this.trigger(`geometryChange`,{element:this})}};function Fn(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,e),this.geometryChange(),this)}}function In(e,t){for(let n=0;n<t.length;n++)e[t[n]]=Fn(t[n])}let Ln=(e,t=[`geometry`])=>{let n=class extends e{};return In(n.prototype,t),n};var Rn=class extends Mn(Pn(Ln(On))){get nodeType(){return`Circle`}constructor(e=new jn,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}rawBBox(){return this._geometry.bbox()}_bbox(e){return this._geometry.bbox(e)}_containsPoint(e){return this.geometry().containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}};function zn(e,t,n=10){return Dt(Math.abs(e-t),n)===0}function Bn(e,t,n){return e<t||zn(e,t,n)}function Vn(e,t,n,r){let i=t.x-e.x,a=r.x-n.x,o=t.y-e.y,s=r.y-n.y,c=e.x-n.x,l=e.y-n.y,u=i*s-a*o,d=(i*l-o*c)/u,f=(a*l-s*c)/u;if(d>=0&&d<=1&&f>=0&&f<=1)return new M(e.x+f*i,e.y+f*o)}let Hn=Math.pow,Un=[`radiusX`,`radiusY`,`startAngle`,`endAngle`,`anticlockwise`];var Wn=class e extends et(Je,Un){constructor(e=new M,t={}){super(),this.setCenter(e),this.radiusX=t.radiusX,this.radiusY=t.radiusY||t.radiusX,this.startAngle=t.startAngle,this.endAngle=t.endAngle,this.anticlockwise=t.anticlockwise||!1,this.xRotation=t.xRotation}clone(){return new e(this.center,{radiusX:this.radiusX,radiusY:this.radiusY,startAngle:this.startAngle,endAngle:this.endAngle,anticlockwise:this.anticlockwise})}setCenter(e){return this._observerField(`center`,M.create(e)),this.geometryChange(),this}getCenter(){return this.center}pointAt(e){let t=this.center,n=Tt(e);return new M(t.x+this.radiusX*Math.cos(n),t.y+this.radiusY*Math.sin(n))}curvePoints(){let e=this.startAngle,t=this.anticlockwise?-1:1,n=[this.pointAt(e)],r=this._arcInterval(),i=r.endAngle-r.startAngle,a=Math.ceil(i/45),o=i/a,s=e,c;this.xRotation&&(c=P().rotate(this.xRotation,this.center));for(let e=1;e<=a;e++){let e=s+t*o,r=this._intervalCurvePoints(s,e,c);n.push(r.cp1,r.cp2,r.p2),s=e}return n}bbox(e){let t=this._arcInterval(),n=t.startAngle,r=t.endAngle,i=kn(this.center,this.radiusX,this.radiusY,e),a=dt(i.x),o=dt(i.y),s=this.pointAt(r).transformCopy(e),c=qn(a,n),l=qn(o,n),u=this.pointAt(n).transformCopy(e),d=M.min(u,s),f=M.max(u,s);for(;c<r||l<r;){let t;c<r&&(t=this.pointAt(c).transformCopy(e),c+=90);let n;l<r&&(n=this.pointAt(l).transformCopy(e),l+=90),u=new M(t.x,n.y),d=M.min(d,u),f=M.max(f,u)}return N.fromPoints(d,f)}_arcInterval(){let{startAngle:e,endAngle:t,anticlockwise:n}=this;if(n){let n=e;e=t,t=n}return(e>t||n&&e===t)&&(t+=360),{startAngle:e,endAngle:t}}_intervalCurvePoints(e,t,n){let r=this.pointAt(e),i=this.pointAt(t),a=this._derivativeAt(e),o=this._derivativeAt(t),s=(Tt(t)-Tt(e))/3,c=new M(r.x+s*a.x,r.y+s*a.y),l=new M(i.x-s*o.x,i.y-s*o.y);return n&&(r.transform(n),i.transform(n),c.transform(n),l.transform(n)),{p1:r,cp1:c,cp2:l,p2:i}}_derivativeAt(e){let t=Tt(e);return new M(-this.radiusX*Math.sin(t),this.radiusY*Math.cos(t))}containsPoint(e){let t=this._arcInterval(),n=t.endAngle-t.startAngle,{center:r,radiusX:i,radiusY:a}=this,o=r.distanceTo(e),s=Math.atan2(e.y-r.y,e.x-r.x),c=i*a/Math.sqrt(Hn(i,2)*Hn(Math.sin(s),2)+Hn(a,2)*Hn(Math.cos(s),2)),l=this.pointAt(this.startAngle).round(10),u=this.pointAt(this.endAngle).round(10),d=Vn(r,e.round(10),l,u),f;if(n<180)f=d&&Bn(r.distanceTo(d),o)&&Bn(o,c);else{let n=Gn(r.x,r.y,i,a,e.x,e.y);n!==360&&(n=(360+n)%360);let s=t.startAngle<=n&&n<=t.endAngle;f=s&&Bn(o,c)||!s&&(!d||d.equals(e))}return f}_isOnPath(e,t){let n=this._arcInterval(),r=this.center,i=Gn(r.x,r.y,this.radiusX,this.radiusY,e.x,e.y);return i!==360&&(i=(360+i)%360),n.startAngle<=i&&i<=n.endAngle&&this.pointAt(i).distanceTo(e)<=t}static fromPoints(t,n,r,i,a,o,s){let c=Kn({x1:t.x,y1:t.y,x2:n.x,y2:n.y,rx:r,ry:i,largeArc:a,swipe:o,rotation:s});return new e(c.center,{startAngle:c.startAngle,endAngle:c.endAngle,radiusX:c.radiusX,radiusY:c.radiusY,xRotation:c.xRotation,anticlockwise:o===0})}};function Gn(e,t,n,r,i,a){let o=Dt((i-e)/n,3),s=Dt((a-t)/r,3);return Dt(dt(Math.atan2(s,o)))}function Kn(e){let{x1:t,y1:n,x2:r,y2:i,rx:a,ry:o,largeArc:s,swipe:c,rotation:l=0}=e,u=Tt(l),d=Math.cos(u),f=Math.sin(u),p=d*(t-r)/2+f*(n-i)/2,m=-f*(t-r)/2+d*(n-i)/2,h=s===c?-1:1,g=p**2,_=m**2,v=a**2,y=o**2,b=g/v+_/y;b>1&&(b=Math.sqrt(g/v+_/y),a=b*a,v=a**2,o=b*o,y=o**2);let x=h*Math.sqrt((v*y-v*_-y*g)/(v*_+y*g));isNaN(x)&&(x=0);let S=a*m*x/o,C=-x*(o*p)/a,w=d*S-f*C+(t+r)/2,ee=f*S+d*C+(n+i)/2,T=(p-S)/a,te=(m-C)/o,E=-(p+S)/a,D=-(m+C)/o,ne=(te>=0?1:-1)*dt(Math.acos(T/Math.sqrt(T*T+te*te))),re=Dt((T*E+te*D)/(Math.sqrt(T*T+te*te)*Math.sqrt(E*E+D*D)),10),ie=(T*D-te*E>=0?1:-1)*dt(Math.acos(re));!c&&ie>0&&(ie-=360),c&&ie<0&&(ie+=360);let O=ne+ie,ae=O>=0?1:-1;return O=Math.abs(O)%360*ae,{center:new M(w,ee),startAngle:ne,endAngle:O,radiusX:a,radiusY:o,xRotation:l}}function qn(e,t){let n=e;for(;n<t;)n+=90;return n}let Jn=[].splice,Yn=[].slice;var Xn=class extends Je{constructor(e=[]){super(),this.length=0,this._splice(0,e.length,e)}elements(e){return e?(this._splice(0,this.length,e),this._change(),this):this.slice(0)}push(...e){let t=this.length,n=e.length;for(let r=0;r<n;r++)this[t+r]=e[r],e[r].addObserver(this);return this.length=t+n,this._change(),this.length}slice(){return Yn.call(this)}pop(){if(this.length>0){let e=this[this.length-1];return this.length--,e.removeObserver(this),this._change(),e}}splice(e,t,...n){let r=this._splice(e,t,n);return this._change(),r}shift(){if(this.length>0){let e=this[0];for(let e=1;e<this.length;e++)this[e-1]=this[e];return this.length--,e.removeObserver(this),this._change(),e}}unshift(...e){let t=e.length;for(let e=this.length-1;e>=0;e--)this[e+t]=this[e];for(let n=0;n<t;n++)this[n]=e[n],e[n].addObserver(this);return this.length+=t,this._change(),this.length}indexOf(e){let t=this.length;for(let n=0;n<t;n++)if(this[n]===e)return n;return-1}_splice(e,t,n){let r=Jn.apply(this,[e,t].concat(n));return this._clearObserver(r),this._setObserver(n),r}_add(e){this._setObserver(e),this._change()}_remove(e){this._clearObserver(e),this._change()}_setObserver(e){for(let t=0;t<e.length;t++)e[t].addObserver(this)}_clearObserver(e){for(let t=0;t<e.length;t++)e[t].removeObserver(this)}_change(){}},Zn=class extends Xn{_change(){this.geometryChange()}};function Qn(e,t,n){let r=dt(Math.atan2(t.y-e.y,t.x-e.x));return n.transformCopy(P().rotate(-r,e)).x<e.x}function $n(e,t,n){let r=1-e;return r**3*n[0][t]+3*r**2*e*n[1][t]+3*e**2*r*n[2][t]+e**3*n[3][t]}function er(e,t){return[-e[0][t]+3*e[1][t]-3*e[2][t]+e[3][t],3*(e[0][t]-2*e[1][t]+e[2][t]),3*(-e[0][t]+e[1][t]),e[0][t]]}var tr=class e extends fe{constructor(e=0,t=0){super(),this.real=e,this.img=t}add(t){return new e(Dt(this.real+t.real,10),Dt(this.img+t.img,10))}addConstant(t){return new e(this.real+t,this.img)}negate(){return new e(-this.real,-this.img)}multiply(t){return new e(this.real*t.real-this.img*t.img,this.real*t.img+this.img*t.real)}multiplyConstant(t){return new e(this.real*t,this.img*t)}nthRoot(t){let n=Math.atan2(this.img,this.real),r=Math.sqrt(this.img**2+this.real**2)**(1/t);return new e(r*Math.cos(n/t),r*Math.sin(n/t))}equals(e){return this.real===e.real&&this.img===e.img}isReal(){return this.img===0}};function nr(e){return e<0?-1:1}function rr(e,t,n){let r=Math.sqrt(t**2-4*e*n);return[(-t+r)/(2*e),(-t-r)/(2*e)]}function ir(e,t,n,r){if(e===0)return rr(t,n,r);let i=(3*e*n-t**2)/(3*e**2),a=(2*t**3-9*e*t*n+27*e**2*r)/(27*e**3),o=(i/3)**3+(a/2)**2,s=new tr(0,1),c=-t/(3*e),l,u,d,f,p,m,h;o<0?(l=new tr(-a/2,Math.sqrt(-o)).nthRoot(3),u=new tr(-a/2,-Math.sqrt(-o)).nthRoot(3)):(l=-a/2+Math.sqrt(o),l=new tr(nr(l)*Math.abs(l)**(1/3)),u=-a/2-Math.sqrt(o),u=new tr(nr(u)*Math.abs(u)**(1/3))),d=l.add(u),m=l.add(u).multiplyConstant(-1/2),h=l.add(u.negate()).multiplyConstant(Math.sqrt(3)/2),f=m.add(s.multiply(h)),p=m.add(s.negate().multiply(h));let g=[];return d.isReal()&&g.push(Dt(d.real+c,10)),f.isReal()&&g.push(Dt(f.real+c,10)),p.isReal()&&g.push(Dt(p.real+c,10)),g}function ar(e,t,n,r,i){let a=er(e,r),o=ir(a[0],a[1],a[2],a[3]-t[r]),s;for(let r=0;r<o.length;r++)if(0<=o[r]&&o[r]<=1&&(s=$n(o[r],n,e),Math.abs(s-t[n])<=i))return!0}function or(e,t,n){let r=er(e,`x`),i=ir(r[0],r[1],r[2],r[3]-t.x),a,o,s=0;for(let r=0;r<i.length;r++)a=$n(i[r],`y`,e),o=zn(a,t.y)||a>t.y,o&&((i[r]===0||i[r]===1)&&n.bottomRight().x>t.x||0<i[r]&&i[r]<1)&&s++;return s}function sr(e,t,n){let r;if(e.x!==t.x){let i=Math.min(e.x,t.x),a=Math.max(e.x,t.x),o=Math.min(e.y,t.y),s=Math.max(e.y,t.y),c=i<=n.x&&n.x<a;r=o===s?n.y<=o&&c:c&&(s-o)*((e.x-t.x)*(e.y-t.y)>0?n.x-i:a-n.x)/(a-i)+o-n.y>=0}return+!!r}function cr(e){let t=`_`+e;return function(e){return e===void 0?this[t]:(this._observerField(t,M.create(e)),this.geometryChange(),this)}}function lr(e,t){for(let n=0;n<t.length;n++)e[t[n]]=cr(t[n])}let ur=(e,t)=>{let n=class extends e{};return lr(n.prototype,t),n},dr=[`anchor`,`controlIn`,`controlOut`];var fr=class extends ur(Je,dr){constructor(e,t,n){super(),this.anchor(e||new M),this.controlIn(t),this.controlOut(n)}bboxTo(e,t){let n=this.anchor().transformCopy(t),r=e.anchor().transformCopy(t),i;return i=this.controlOut()&&e.controlIn()?this._curveBoundingBox(n,this.controlOut().transformCopy(t),e.controlIn().transformCopy(t),r):this._lineBoundingBox(n,r),i}_lineBoundingBox(e,t){return N.fromPoints(e,t)}_curveBoundingBox(e,t,n,r){let i=[e,t,n,r],a=this._curveExtremesFor(i,`x`),o=this._curveExtremesFor(i,`y`),s=pr([a.min,a.max,e.x,r.x]),c=pr([o.min,o.max,e.y,r.y]);return N.fromPoints(new M(s.min,c.min),new M(s.max,c.max))}_curveExtremesFor(e,t){let n=this._curveExtremes(e[0][t],e[1][t],e[2][t],e[3][t]);return{min:$n(n.min,t,e),max:$n(n.max,t,e)}}_curveExtremes(e,t,n,r){let i=e-3*t+3*n-r,a=-2*(e-2*t+n),o=e-t,s=Math.sqrt(a*a-4*i*o),c=0,l=1;i===0?a!==0&&(c=l=-o/a):isNaN(s)||(c=(-a+s)/(2*i),l=(-a-s)/(2*i));let u=Math.max(Math.min(c,l),0);(u<0||u>1)&&(u=0);let d=Math.min(Math.max(c,l),1);return(d>1||d<0)&&(d=1),{min:u,max:d}}_intersectionsTo(e,t){let n;return n=this.controlOut()&&e.controlIn()?or([this.anchor(),this.controlOut(),e.controlIn(),e.anchor()],t,this.bboxTo(e)):sr(this.anchor(),e.anchor(),t),n}_isOnCurveTo(e,t,n,r){if(this.bboxTo(e).expand(n,n).containsPoint(t)){let i=this.anchor(),a=this.controlOut(),o=e.controlIn(),s=e.anchor();if(r===`start`&&i.distanceTo(t)<=n)return!Qn(i,a,t);if(r===`end`&&s.distanceTo(t)<=n)return!Qn(s,o,t);let c=[i,a,o,s];if(ar(c,t,`x`,`y`,n)||ar(c,t,`y`,`x`,n))return!0;let l=P().rotate(45,t),u=[i.transformCopy(l),a.transformCopy(l),o.transformCopy(l),s.transformCopy(l)];return ar(u,t,`x`,`y`,n)||ar(u,t,`y`,`x`,n)}}_isOnLineTo(e,t,n){let r=this.anchor(),i=e.anchor(),a=dt(Math.atan2(i.y-r.y,i.x-r.x));return new N([r.x,r.y-n/2],[r.distanceTo(i),n]).containsPoint(t.transformCopy(P().rotate(-a,r)))}_isOnPathTo(e,t,n,r){let i;return i=this.controlOut()&&e.controlIn()?this._isOnCurveTo(e,t,n/2,r):this._isOnLineTo(e,t,n),i}};function pr(e){let t=e.length,n=lt,r=ut;for(let i=0;i<t;i++)r=Math.max(r,e[i]),n=Math.min(n,e[i]);return{min:n,max:r}}let mr=.333;function hr(e,t){let n=e.slice(0),r=[],i=n.length;if(i>2&&(gr(0,n),i=n.length),i<2||i===2&&n[0].equals(n[1]))return r;let a=n[0],o=n[1],s=n[2];for(r.push(new fr(a));a.equals(n[i-1]);)t=!0,n.pop(),i--;if(i===2){let e=Sr(a,o,`x`,`y`);return xt(r).controlOut(wr(e,a,o,`x`,`y`)),r.push(new fr(o,Tr(e,a,o,`x`,`y`))),r}let c,l;if(t){a=n[i-1],o=n[0],s=n[1];let e=br(a,o,s);c=e[1],l=e[0]}else c=wr(Sr(a,o,`x`,`y`),a,o,`x`,`y`);let u=c;for(let e=0;e<=i-3;e++)if(gr(e,n),i=n.length,e+3<=i){a=n[e],o=n[e+1],s=n[e+2];let t=br(a,o,s);xt(r).controlOut(u),u=t[1];let i=t[0];r.push(new fr(o,i))}if(t){a=n[i-2],o=n[i-1],s=n[0];let e=br(a,o,s);xt(r).controlOut(u),r.push(new fr(o,e[0])),xt(r).controlOut(e[1]),r.push(new fr(s,l))}else{let e=Sr(o,s,`x`,`y`);xt(r).controlOut(u),r.push(new fr(s,Tr(e,o,s,`x`,`y`)))}return r}function gr(e,t){for(;t[e+1]&&(t[e].equals(t[e+1])||t[e+1].equals(t[e+2]));)t.splice(e+1,1)}function _r(e,t,n){let r=!1;if(e.x===t.x)r=!0;else if(t.x===n.x)(t.y<n.y&&e.y<=t.y||n.y<t.y&&t.y<=e.y)&&(r=!0);else{let i=Dr(yr(e,t),n.x);!(e.y<=t.y&&n.y<=i)&&!(t.y<=e.y&&n.y>=i)&&(r=!0)}return r}function vr(e,t,n){let r=Dr(yr(e,t),n.x);return e.x===t.x&&t.x===n.x||Dt(r,1)===Dt(n.y,1)}function yr(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}function br(e,t,n){let r=`x`,i=`y`,a=!1,o=!1,s;if(vr(e,t,n))s=Sr(e,t,`x`,`y`);else{let c={x:Cr(e,t,n,`x`),y:Cr(e,t,n,`y`)};if(c.x&&c.y)s=Sr(e,n,`x`,`y`),a=!0;else if(_r(e,t,n)&&(r=`y`,i=`x`),c[r])s=0;else{let a;a=n[i]<e[i]&&e[i]<=t[i]||e[i]<n[i]&&t[i]<=e[i]?Or((n[i]-e[i])*(t[r]-e[r])):-Or((n[r]-e[r])*(t[i]-e[i])),s=.01*a,o=!0}}let c=Tr(s,e,t,r,i);if(o){let e=r;r=i,i=e}let l=wr(s,t,n,r,i);return a&&(xr(e,t,c,s),xr(t,n,l,s)),[c,l]}function xr(e,t,n,r){e.y<t.y?t.y<n.y?(n.x=e.x+(t.y-e.y)/r,n.y=t.y):n.y<e.y&&(n.x=t.x-(t.y-e.y)/r,n.y=e.y):n.y<t.y?(n.x=e.x-(e.y-t.y)/r,n.y=t.y):e.y<n.y&&(n.x=t.x+(e.y-t.y)/r,n.y=e.y)}function Sr(e,t,n,r){let i=t[n]-e[n],a=t[r]-e[r],o;return o=i===0?0:a/i,o}function Cr(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}function wr(e,t,n,r,i){let a=t[r],o=(n[r]-a)*mr;return Er(a+o,t[i]+o*e,r,i)}function Tr(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*mr;return Er(o-s,n[i]-s*e,r,i)}function Er(e,t,n,r){let i=new M;return i[n]=e,i[r]=t,i}function Dr(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}function Or(e){return e<=0?-1:1}let kr={l:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=2){let a=new M(n[i],n[i+1]);t.isRelative&&a.translateWith(r),e.lineTo(a.x,a.y),r.x=a.x,r.y=a.y}},c:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=6){let a=new M(n[i],n[i+1]),o=new M(n[i+2],n[i+3]),s=new M(n[i+4],n[i+5]);t.isRelative&&(o.translateWith(r),a.translateWith(r),s.translateWith(r)),e.curveTo(a,o,s),r.x=s.x,r.y=s.y}},v:function(e,t){let n=t.isRelative?0:t.position.x;Ar(t.parameters,!0,n),this.l(e,t)},h:function(e,t){let n=t.isRelative?0:t.position.y;Ar(t.parameters,!1,n),this.l(e,t)},a:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=7){let a=n[i],o=n[i+1],s=n[i+2],c=n[i+3],l=n[i+4],u=new M(n[i+5],n[i+6]);t.isRelative&&u.translateWith(r),(r.x!==u.x||r.y!==u.y)&&(e.arcTo(u,a,o,c,l,s),r.x=u.x,r.y=u.y)}},s:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`s`||i===`c`)&&(a=xt(xt(e.paths).segments).controlIn());for(let i=0;i<n.length;i+=4){let o=new M(n[i],n[i+1]),s=new M(n[i+2],n[i+3]),c;t.isRelative&&(o.translateWith(r),s.translateWith(r)),c=a?jr(a,r):r.clone(),a=o,e.curveTo(c,o,s),r.x=s.x,r.y=s.y}},q:function(e,t){let{parameters:n,position:r}=t;for(let i=0;i<n.length;i+=4){let a=new M(n[i],n[i+1]),o=new M(n[i+2],n[i+3]);t.isRelative&&(a.translateWith(r),o.translateWith(r));let s=Nr(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}},t:function(e,t){let{parameters:n,position:r,previousCommand:i}=t,a;(i===`q`||i===`t`)&&(a=xt(xt(e.paths).segments).controlIn().clone().translateWith(r.scaleCopy(-1/3)).scale(3/2));for(let i=0;i<n.length;i+=2){let o=new M(n[i],n[i+1]);t.isRelative&&o.translateWith(r),a=a?jr(a,r):r.clone();let s=Nr(r,a,o);e.curveTo(s.controlOut,s.controlIn,o),r.x=o.x,r.y=o.y}}};function Ar(e,t,n){let r=+!t;for(let t=0;t<e.length;t+=2)e.splice(t+r,0,n)}function jr(e,t){if(e&&t)return t.scaleCopy(2).translate(-e.x,-e.y)}let Mr=1/3;function Nr(e,t,n){let r=t.clone().scale(2/3);return{controlOut:r.clone().translateWith(e.scaleCopy(Mr)),controlIn:r.translateWith(n.scaleCopy(Mr))}}let Pr=/([a-df-z]{1})([^a-df-z]*)(z)?/gi,Fr=/[,\s]?([+\-]?(?:\d*\.\d+|\d+)(?:[eE][+\-]?\d+)?)/g;function Ir(e){let t=[];return e.replace(Fr,function(e,n){t.push(parseFloat(n))}),t}function Lr(e,t){let n=new M,r;return t.replace(Pr,(t,i,a,o)=>{let s=i.toLowerCase(),c=s===i,l=Ir(a.trim());if(s===`m`&&(c?(n.x+=l[0],n.y+=l[1]):(n.x=l[0],n.y=l[1]),e.moveTo(n.x,n.y),l.length>2&&(s=`l`,l.splice(0,2))),kr[s])kr[s](e,{parameters:l,position:n,isRelative:c,previousCommand:r}),o&&o.toLowerCase()===`z`&&e.close();else if(s!==`m`)throw Error(`Error while parsing SVG path. Unsupported command: `+s);r=s}),e}function Rr(e,t,n){let r;for(let i=0;i<e.length;i++){let a=e[i];if(a.visible()){let e=t?a.bbox(n):a.rawBBox();e&&(r=r?N.union(r,e):e)}}return r}function zr(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r];if(i.visible()){let e=i.clippedBBox(t);e&&(n=n?N.union(n,e):e)}}return n}let Br=e=>(...t)=>t.map(t=>t.toString(e)).join(` `),Vr=(e,t)=>e.controlOut()&&t.controlIn()?`C`:`L`;var F=class e extends Mn(Pn(On)){get nodeType(){return`Path`}constructor(e){super(e),this.segments=new Zn,this.segments.addObserver(this),this.options.stroke===void 0&&(this.stroke(`#000`),this.options.stroke.lineJoin===void 0&&this.options.set(`stroke.lineJoin`,`miter`))}moveTo(e,t){return this.suspend(),this.segments.elements([]),this.resume(),this.lineTo(e,t),this}lineTo(e,t){let n=new fr(t===void 0?e:new M(e,t));return this.segments.push(n),this}curveTo(e,t,n){if(this.segments.length>0){let r=xt(this.segments),i=new fr(n,t);this.suspend(),r.controlOut(e),this.resume(),this.segments.push(i)}return this}arc(e,t,n,r,i){if(this.segments.length>0){let a=xt(this.segments).anchor(),o=Tt(e),s=new Wn(new M(a.x-n*Math.cos(o),a.y-r*Math.sin(o)),{startAngle:e,endAngle:t,radiusX:n,radiusY:r,anticlockwise:i});this._addArcSegments(s)}return this}arcTo(e,t,n,r,i,a){if(this.segments.length>0){let o=xt(this.segments).anchor(),s=Wn.fromPoints(o,M.create(e),t,n,r,i,a);this._addArcSegments(s)}return this}_addArcSegments(e){this.suspend();let t=e.curvePoints();for(let e=1;e<t.length;e+=3)this.curveTo(t[e],t[e+1],t[e+2]);this.resume(),this.geometryChange()}close(){return this.options.closed=!0,this.geometryChange(),this}rawBBox(){return this._bbox()}toString(e){let t=``,n=this.segments,r=n.length;if(r>0){let i=[],a=Br(e),o;for(let e=1;e<r;e++){let t=Vr(n[e-1],n[e]);t!==o&&(o=t,i.push(t)),t===`L`?i.push(a(n[e].anchor())):i.push(a(n[e-1].controlOut(),n[e].controlIn(),n[e].anchor()))}t=`M`+a(n[0].anchor())+` `+i.join(` `),this.options.closed&&(t+=`Z`)}return t}_containsPoint(e){let t=this.segments,n=t.length,r=0,i,a;for(let o=1;o<n;o++)i=t[o-1],a=t[o],r+=i._intersectionsTo(a,e);return(this.options.closed||!t[0].anchor().equals(t[n-1].anchor()))&&(r+=sr(t[0].anchor(),t[n-1].anchor(),e)),r%2!=0}_isOnPath(e,t){let n=this.segments,r=n.length,i=t||this.options.stroke.width;if(r>1){if(n[0]._isOnPathTo(n[1],e,i,`start`))return!0;for(let t=2;t<=r-2;t++)if(n[t-1]._isOnPathTo(n[t],e,i))return!0;if(n[r-2]._isOnPathTo(n[r-1],e,i,`end`))return!0}return!1}_bbox(e){let t=this.segments,n=t.length,r;if(n===1)r=new N(t[0].anchor().transformCopy(e),wn.ZERO);else if(n>0)for(let i=1;i<n;i++){let n=t[i-1].bboxTo(t[i],e);r=r?N.union(r,n):n}return r}static parse(e,t){return Hr.parse(e,t)}static fromRect(t,n){let r=new e(n),[i,a]=t.cornerRadius;if(i===0&&a===0)r.moveTo(t.topLeft()).lineTo(t.topRight()).lineTo(t.bottomRight()).lineTo(t.bottomLeft()).close();else{let{x:e,y:n}=t.origin,o=t.width(),s=t.height();i=St(i,0,o/2),a=St(a,0,s/2),r.moveTo(e+i,n).lineTo(e+o-i,n).arcTo([e+o,n+a],i,a,!1).lineTo(e+o,n+s-a).arcTo([e+o-i,n+s],i,a,!1).lineTo(e+i,n+s).arcTo([e,n+s-a],i,a,!1).lineTo(e,n+a).arcTo([e+i,n],i,a,!1)}return r}static fromPoints(t,n){if(t){let r=new e(n);for(let e=0;e<t.length;e++){let n=M.create(t[e]);n&&(e===0?r.moveTo(n):r.lineTo(n))}return r}}static curveFromPoints(t,n){if(t){let r=hr(t),i=new e(n);return i.segments.push.apply(i.segments,r),i}}static fromArc(t,n){let r=new e(n),i=t.startAngle,a=t.pointAt(i);return r.moveTo(a.x,a.y),r.arc(i,t.endAngle,t.radiusX,t.radiusY,t.anticlockwise),r}},Hr=class e extends Mn(Pn(On)){static parse(t,n){return Lr(new e(n),t)}toString(e){let t=this.paths,n=``;if(t.length>0){let r=[];for(let n=0;n<t.length;n++)r.push(t[n].toString(e));n=r.join(` `)}return n}get nodeType(){return`MultiPath`}constructor(e){super(e),this.paths=new Zn,this.paths.addObserver(this),this.options.stroke===void 0&&this.stroke(`#000`)}moveTo(e,t){let n=new F;return n.moveTo(e,t),this.paths.push(n),this}lineTo(e,t){return this.paths.length>0&&xt(this.paths).lineTo(e,t),this}curveTo(e,t,n){return this.paths.length>0&&xt(this.paths).curveTo(e,t,n),this}arc(e,t,n,r,i){return this.paths.length>0&&xt(this.paths).arc(e,t,n,r,i),this}arcTo(e,t,n,r,i,a){return this.paths.length>0&&xt(this.paths).arcTo(e,t,n,r,i,a),this}close(){return this.paths.length>0&&xt(this.paths).close(),this}_bbox(e){return Rr(this.paths,!0,e)}rawBBox(){return Rr(this.paths,!1)}_containsPoint(e){let t=this.paths;for(let n=0;n<t.length;n++)if(t[n]._containsPoint(e))return!0;return!1}_isOnPath(e){let t=this.paths,n=this.options.stroke.width;for(let r=0;r<t.length;r++)if(t[r]._isOnPath(e,n))return!0;return!1}_clippedBBox(e){return zr(this.paths,this.currentTransform(e))}},Ur=class extends Mn(Pn(Ln(On))){get nodeType(){return`Arc`}constructor(e=new Wn,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}_bbox(e){return this._geometry.bbox(e)}rawBBox(){return this.geometry().bbox()}toPath(){let e=new F,t=this.geometry().curvePoints();if(t.length>0){e.moveTo(t[0].x,t[0].y);for(let n=1;n<t.length;n+=3)e.curveTo(t[n],t[n+1],t[n+2])}return e}_containsPoint(e){return this.geometry().containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}},Wr=class extends Mn(ur(On,[`position`])){get nodeType(){return`Text`}constructor(e,t=new M,n={}){super(n),this.content(e),this.position(t),this.options.font||(this.options.font=`12px sans-serif`),this.options.fill===void 0&&this.fill(`#000`)}content(e){return e===void 0?this.options.get(`content`):(this.options.set(`content`,e),this)}measure(){return Xt(this.content(),{font:this.options.get(`font`)})}rect(){let e=this.measure();return new N(this.position().clone(),[e.width,e.height])}bbox(e){let t=Cn(this.currentTransform(e));return this.rect().bbox(t)}rawBBox(){return this.rect().bbox()}_containsPoint(e){return this.rect().containsPoint(e)}},Gr=class extends Ln(On,[`rect`]){get nodeType(){return`Image`}constructor(e,t=new N,n={}){super(n),this.src(e),this.rect(t)}src(e){return e===void 0?this.options.get(`src`):(this.options.set(`src`,e),this)}bbox(e){let t=Cn(this.currentTransform(e));return this._rect.bbox(t)}rawBBox(){return this._rect.bbox()}_containsPoint(e){return this._rect.containsPoint(e)}_hasFill(){return this.src()}};let Kr=(e,t)=>class extends e{traverse(e){let n=this[t];for(let t=0;t<n.length;t++){let r=n[t];r.traverse?r.traverse(e):e(r)}return this}};var I=class extends Kr(On,`children`){get nodeType(){return`Group`}constructor(e){super(e),this.children=[]}childrenChange(e,t,n){this.trigger(`childrenChange`,{action:e,items:t,index:n})}append(){return tt(this.children,arguments),this._reparent(arguments,this),this.childrenChange(`add`,arguments),this}insert(e,t){return this.children.splice(e,0,t),t.parent=this,this.childrenChange(`add`,[t],e),this}insertAt(e,t){return this.insert(t,e)}remove(e){let t=this.children.indexOf(e);return t>=0&&(this.children.splice(t,1),e.parent=null,this.childrenChange(`remove`,[e],t)),this}removeAt(e){if(0<=e&&e<this.children.length){let t=this.children[e];this.children.splice(e,1),t.parent=null,this.childrenChange(`remove`,[t],e)}return this}clear(){let e=this.children;return this.children=[],this._reparent(e,null),this.childrenChange(`remove`,e,0),this}bbox(e){return Rr(this.children,!0,this.currentTransform(e))}rawBBox(){return Rr(this.children,!1)}_clippedBBox(e){return zr(this.children,this.currentTransform(e))}currentTransform(e){return On.prototype.currentTransform.call(this,e)||null}containsPoint(e,t){if(this.visible()){let n=this.children,r=this.currentTransform(t);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e,r))return!0}return!1}_reparent(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.parent;i&&i!==this&&i.remove&&i.remove(r),r.parent=t}}};function qr(e,t,n){let r=n.transform()||P(),i=r.matrix();i.e+=e.x-t.origin.x,i.f+=e.y-t.origin.y,r.matrix(i),n.transform(r)}function Jr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]:n===`end`?t.origin[r]+t.size[i]-e:t.origin[r]+(t.size[i]-e)/2,a}function Yr(e,t,n,r,i){let a;return a=n===`start`?t.origin[r]+t.size[i]-e:n===`end`?t.origin[r]:t.origin[r]+(t.size[i]-e)/2,a}let Xr={alignContent:`start`,justifyContent:`start`,alignItems:`start`,spacing:0,orientation:`horizontal`,lineSpacing:0,wrap:!0,revers:!1},Zr=(e,t)=>{e.forEach(t)},Qr=(e,t)=>{let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r)};var $r=class extends I{constructor(e,t){super(Object.assign({},Xr,t)),this._rect=e,this._fieldMap={}}rect(e){return e?(this._rect=e,this):this._rect}appendBreak(){let e=new I;return e._isBreakMarker=!0,this.append(e),this}_initMap(){let e=this.options,t=this._fieldMap;e.orientation===`horizontal`?(t.sizeField=`width`,t.groupsSizeField=`height`,t.groupAxis=`x`,t.groupsAxis=`y`):(t.sizeField=`height`,t.groupsSizeField=`width`,t.groupAxis=`y`,t.groupsAxis=`x`),e.reverse?(this.forEach=Qr,this.justifyAlign=Yr):(this.forEach=Zr,this.justifyAlign=Jr)}reflow(){if(!this._rect||this.children.length===0)return;this._initMap(),this.options.transform&&this.transform(null);let e=this.options,t=this._rect,{groups:n,groupsSize:r}=this._initGroups(),{sizeField:i,groupsSizeField:a,groupAxis:o,groupsAxis:s}=this._fieldMap,c=new M,l=new M,u=new wn,d=Jr(r,t,e.alignContent,s,a),f,p,m,h=(t,n)=>{let r=p.elements[n];l[o]=f,l[s]=Jr(t.size[a],m,e.alignItems,s,a),qr(l,t,r),f+=t.size[i]+e.spacing};for(let r=0;r<n.length;r++)p=n[r],c[o]=f=this.justifyAlign(p.size,t,e.justifyContent,o,i),c[s]=d,u[i]=p.size,u[a]=p.lineSize,m=new N(c,u),this.forEach(p.bboxes,h),d+=p.lineSize+e.lineSpacing;if(!e.wrap&&p.size>t.size[i]){let n=t.size[i]/m.size[i],r=m.topLeft().scale(n,n),c=Jr(m.size[a]*n,t,e.alignContent,s,a),l=P();o===`x`?l.translate(t.origin.x-r.x,c-r.y):l.translate(c-r.x,t.origin.y-r.y),l.scale(n,n),this.transform(l)}}_initGroups(){let{options:e,children:t}=this,{lineSpacing:n,wrap:r,spacing:i}=e,a=this._fieldMap.sizeField,o=this._newGroup(),s=[],c=function(){s.push(o),l+=o.lineSize+n},l=-n;for(let e=0;e<t.length;e++){let n=t[e],s=t[e].clippedBBox();if(n._isBreakMarker){o.bboxes.length>0&&(c(),o=this._newGroup());continue}n.visible()&&s&&(r&&o.size+s.size[a]+i>this._rect.size[a]?o.bboxes.length===0?(this._addToGroup(o,s,n),c(),o=this._newGroup()):(c(),o=this._newGroup(),this._addToGroup(o,s,n)):this._addToGroup(o,s,n))}return o.bboxes.length&&c(),{groups:s,groupsSize:l}}_addToGroup(e,t,n){e.size+=t.size[this._fieldMap.sizeField]+this.options.spacing,e.lineSize=Math.max(t.size[this._fieldMap.groupsSizeField],e.lineSize),e.bboxes.push(t),e.elements.push(n)}_newGroup(){return{lineSize:0,size:-this.options.spacing,bboxes:[],elements:[]}}},ei=class extends Mn(Pn(Ln(On))){get nodeType(){return`Rect`}constructor(e=new N,t={}){super(t),this.geometry(e),this.options.stroke===void 0&&this.stroke(`#000`)}_bbox(e){return this._geometry.bbox(e)}rawBBox(){return this._geometry.bbox()}_containsPoint(e){return this._geometry.containsPoint(e)}_isOnPath(e){return this.geometry()._isOnPath(e,this.options.stroke.width/2)}};function ti(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a].clippedBBox();if(o){let s=o.origin.clone();s[r]=Jr(o.size[i],t,n||`start`,r,i),qr(s,o,e[a])}}}function ni(e,t,n){ti(e,t,n,`x`,`width`)}function ri(e,t,n){ti(e,t,n,`y`,`height`)}function ii(e,t,n,r){if(e.length>1){let i=new M,a=e[0].bbox;for(let o=1;o<e.length;o++){let s=e[o].element,c=e[o].bbox;i[t]=a.origin[t]+a.size[r],i[n]=c.origin[n],qr(i,c,s),c.origin[t]=i[t],a=c}}}function ai(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=r.clippedBBox();i&&t.push({element:r,bbox:i})}return t}function oi(e){ii(ai(e),`x`,`y`,`width`)}function si(e){ii(ai(e),`y`,`x`,`height`)}function ci(e,t,n){let r=t.size[n],i=[],a=[],o=0,s,c,l=function(){a.push({element:s,bbox:c})};for(let t=0;t<e.length;t++)if(s=e[t],c=s.clippedBBox(),c){let e=c.size[n];o+e>r?a.length?(i.push(a),a=[],l(),o=e):(l(),i.push(a),a=[],o=0):(l(),o+=e)}return a.length&&i.push(a),i}function li(e,t,n,r,i){let a=ci(e,t,i),o=t.origin.clone(),s=[];for(let e=0;e<a.length;e++){let t=a[e],c=t[0];o[r]=c.bbox.origin[r],qr(o,c.bbox,c.element),c.bbox.origin[n]=o[n],ii(t,n,r,i),s.push([]);for(let n=0;n<t.length;n++)s[e].push(t[n].element)}return s}function ui(e,t){return li(e,t,`x`,`y`,`width`)}function di(e,t){return li(e,t,`y`,`x`,`height`)}function fi(e,t){let n=e.clippedBBox();if(n){let r=n.size,i=t.size;if(i.width<r.width||i.height<r.height){let t=Math.min(i.width/r.width,i.height/r.height),n=e.transform()||P();n.scale(t,t),e.transform(n)}}}var pi=class extends Xn{_change(){this.optionsChange({field:`stops`})}};function mi(e){return function(t){return t===void 0?this.options.get(e):(this.options.set(e,t),this)}}function hi(e,t){for(let n=0;n<t.length;n++)e[t[n]]=mi(t[n])}let gi=(e,t)=>{let n=class extends e{};return hi(n.prototype,t),n},_i=[`offset`,`color`,`opacity`];var vi=class e extends gi(Je,_i){constructor(e,t,n){super(),this.options=new Xe({offset:e,color:t,opacity:n===void 0?1:n}),this.options.addObserver(this)}static create(t){if(t!==void 0){let n;return n=t instanceof e?t:t.length>1?new e(t[0],t[1],t[2]):new e(t.offset,t.color,t.opacity),n}}},yi=class extends Je{get nodeType(){return`Gradient`}constructor(e={}){super(),this.stops=new pi(this._createStops(e.stops)),this.stops.addObserver(this),this._userSpace=e.userSpace,this.id=st()}userSpace(e){return e===void 0?this._userSpace:(this._userSpace=e,this.optionsChange(),this)}_createStops(e=[]){let t=[];for(let n=0;n<e.length;n++)t.push(vi.create(e[n]));return t}addStop(e,t,n){this.stops.push(new vi(e,t,n))}removeStop(e){let t=this.stops.indexOf(e);t>=0&&this.stops.splice(t,1)}optionsChange(e){this.trigger(`optionsChange`,{field:`gradient`+(e?`.`+e.field:``),value:this})}geometryChange(){this.optionsChange()}};let bi=[`start`,`end`];var xi=class extends ur(yi,bi){constructor(e={}){super(e),this.start(e.start||new M),this.end(e.end||new M(1,0))}},Si=class extends ur(yi,[`center`]){constructor(e={}){super(e),this.center(e.center||new M),this._radius=e.radius===void 0?1:e.radius,this._fallbackFill=e.fallbackFill}radius(e){return e===void 0?this._radius:(this._radius=e,this.geometryChange(),this)}fallbackFill(e){return e===void 0?this._fallbackFill:(this._fallbackFill=e,this.optionsChange(),this)}};let Ci=`#aba4a6`,wi={width:2,gap:18},Ti={radius:10,gap:10},Ei={size:18,gap:2};var Di=class extends I{get nodeType(){return`Pattern`}constructor(e){super();let{width:t,height:n}=e;this._size=wn.create([t,n]),this.id=st()}size(e){return e?(this._size=wn.create(e),this):this._size}};let Oi=(e,t,n)=>{t&&e.append(new ei(new N([0,0],n),{fill:{color:t},stroke:null}))};function ki(e={}){let{gap:t=Ti.gap,radius:n=Ti.radius,color:r=Ci,background:i}=e,a={fill:{color:r},stroke:null},o=4*n+2*t,s=3*n+1.5*t,c=[o/2,n+1/2*t],l=[0,s],u=[o,s],d=new Di({width:o,height:o});return Oi(d,i,[o,o]),d.append(new Rn(new jn(c,n),a),new Rn(new jn(l,n),a),new Rn(new jn(u,n),a)),d}function Ai(e={}){let{gap:t=wi.gap,width:n=wi.width,color:r=Ci,background:i}=e,a=n+t,o={fill:null,stroke:{color:r,width:n/2}},s=new Di({width:a,height:a});Oi(s,i,[a,a]);let c=n/4,l=a-n/4,u=new F(o);u.moveTo(c,0).lineTo(c,a);let d=new F(o);return d.moveTo(l,0).lineTo(l,a),s.append(u,d),s}function ji(e={}){let{gap:t=wi.gap,width:n=wi.width,color:r=Ci,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n}},s=new Di({width:a,height:a});Oi(s,i,[a,a]);let c=new F(o);c.moveTo(0,0).lineTo(a,a);let l=new F(o);return l.moveTo(a,0).lineTo(0,a),s.append(c,l),s}function Mi(e={}){let{gap:t=wi.gap,width:n=wi.width,color:r=Ci,background:i}=e,a=Math.sqrt(2)*(n+t),o={fill:null,stroke:{color:r,width:n,lineCap:`square`}},s=new Di({width:a,height:a});Oi(s,i,[a,a]);let c=new F(o);c.moveTo(0,a/2).lineTo(a/2,0);let l=new F(o);return l.moveTo(a/2,a).lineTo(a,a/2),s.append(c,l),s}function Ni(e={}){let{gap:t=Ei.gap,size:n=Ei.size,color:r=Ci,background:i}=e,a=n+t,o=t/2,s={fill:{color:r},stroke:null},c=new Di({width:a,height:a});Oi(c,i,[a,a]);let l=new ei(new N([o,o],[n,n]),s);return c.append(l),c}var Pi=m({easeInOutBack:()=>qi,easeInOutCubic:()=>zi,easeInOutExpo:()=>Gi,easeInOutQuad:()=>Vi,easeInOutQuint:()=>Yi,easeInOutSine:()=>Ui,easeOutBack:()=>Ki,easeOutCirc:()=>Hi,easeOutCubic:()=>Ri,easeOutElastic:()=>Li,easeOutExpo:()=>Wi,easeOutQuad:()=>Bi,easeOutQuint:()=>Ji,linear:()=>Ii,swing:()=>Fi});function Fi(e){return .5-Math.cos(e*Math.PI)/2}function Ii(e){return e}function Li(e){return e===0||e===1?e:2**(-10*e)*Math.sin((e-.125)*(1.1*Math.PI)/.5)+1}function Ri(e){return 1-(1-e)**3}function zi(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function Bi(e){return 1-(1-e)**2}function Vi(e){return e<.5?2*e*e:1-(-2*e+2)**2/2}function Hi(e){return Math.sqrt(1-(e-1)**2)}function Ui(e){return-(Math.cos(Math.PI*e)-1)/2}function Wi(e){return e===1?1:1-2**(-10*e)}function Gi(e){return e===0||e===1?e:e<.5?2**(20*e-10)/2:(2-2**(-20*e+10))/2}function Ki(e){return 1+2.70158*(e-1)**3+1.70158*(e-1)**2}function qi(e){let t=1.70158*1.525;return e<.5?(2*e)**2*(3.5949095*2*e-t)/2:((2*e-2)**2*(3.5949095*(e*2-2)+t)+2)/2}function Ji(e){return 1-(1-e)**5}function Yi(e){return e<.5?16*e**5:1-(-2*e+2)**5/2}let Xi;var Zi=class e extends fe{static get current(){return Xi||=new e,Xi}constructor(){super(),this._items=[]}register(e,t){this._items.push({name:e,type:t})}create(e,t){let n=this._items,r;if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name.toLowerCase()===e){r=n[t];break}}if(r)return new r.type(e,t)}};function Qi(e){return Math.min(1,Math.max(0,e))}function $i(e,t,n,r){let i=3*e,a=3*(n-e)-i,o=1-i-a,s=3*t,c=3*(r-t)-s,l=1-s-c;function u(e){return((o*e+a)*e+i)*e}function d(e){return((l*e+c)*e+s)*e}function f(e){return(3*o*e+2*a)*e+i}function p(e){let t=e;for(let n=0;n<8;n++){let n=u(t)-e,r=f(t);if(Math.abs(n)<1e-7)return t;if(Math.abs(r)<1e-7)break;t-=n/r}let n=0,r=1;t=e;for(let t=0;t<24;t++){let t=(n+r)/2,i=u(t);if(Math.abs(i-e)<1e-7)return t;i<e?n=t:r=t}return(n+r)/2}return e=>{let t=Qi(e);return t===0||t===1?t:d(p(t))}}let ea={duration:500,easing:`swing`};var ta=class extends fe{static create(e,t,n){return Zi.current.create(e,t,n)}get options(){return this._options||ea}set options(e){this._options=e}constructor(e,t){super(),this.options=Object.assign({},this.options,t),this.element=e}setup(){}step(){}play(){let e=this.options;typeof e.easing==`string`&&Pi[e.easing]?e.easing=Pi[e.easing]:Array.isArray(e.easing)&&e.easing.length===4?e.easing=$i(...e.easing):e.easing=Pi[ea.easing];let{duration:t,delay:n=0,easing:r}=e,i=Ae()+n,a=i+t;t===0?(this.step(1),this.abort()):setTimeout(()=>{let e=()=>{if(this._stopped)return;let n=Ae(),o=St(n-i,0,t),s=r(o/t);this.step(s),n<a?ye(e):this.abort()};e()},n)}abort(){this._stopped=!0}destroy(){this.abort()}};let na;var ra=class e extends fe{static get current(){return na||=new e,na}parse(e,t){return Lr(new Hr(t),e)}},ia=class extends fe{constructor(e){super(),this.childNodes=[],this.parent=null,e&&(this.srcElement=e,this.observe())}destroy(){this.srcElement&&this.srcElement.removeObserver(this);let e=this.childNodes;for(let t=0;t<e.length;t++)this.childNodes[t].destroy();this.parent=null}load(){}observe(){this.srcElement&&this.srcElement.addObserver(this)}append(e){this.childNodes.push(e),e.parent=this}insertAt(e,t){this.childNodes.splice(t,0,e),e.parent=this}remove(e,t){let n=e+t;for(let t=e;t<n;t++)this.childNodes[t].removeSelf();this.childNodes.splice(e,t)}removeSelf(){this.clear(),this.destroy()}clear(){this.remove(0,this.childNodes.length)}invalidate(){this.parent&&this.parent.invalidate()}geometryChange(){this.invalidate()}optionsChange(){this.invalidate()}childrenChange(e){e.action===`add`?this.load(e.items,e.index):e.action===`remove`&&this.remove(e.index,e.items.length),this.invalidate()}};let aa=[`click`,`mouseenter`,`mouseleave`,`mousemove`,`resize`];var oa=class extends pe{constructor(e,t){super(),this.options=Object.assign({},t),this.element=e,this.element._kendoExportVisual=this.exportVisual.bind(this),this._click=this._handler(`click`),this._mouseenter=this._handler(`mouseenter`),this._mouseleave=this._handler(`mouseleave`),this._mousemove=this._handler(`mousemove`),this._visual=new I,Nt(e,this.options),this.bind(aa,this.options),this._enableTracking()}draw(e){this._visual.children.push(e)}clear(){this._visual.children=[]}destroy(){this._visual=null,this.element._kendoExportVisual=null,this.unbind()}eventTarget(e){let t=yt(e),n;for(;!n&&t&&(n=t._kendoNode,t!==this.element);)t=t.parentElement;if(n)return n.srcElement}exportVisual(){return this._visual}getSize(){return Nt(this.element)}currentSize(e){if(e)this._size=e;else return this._size}setSize(e){Nt(this.element,e),this.currentSize(e),this._resize()}resize(e){let t=this.getSize(),n=this.currentSize();(e||(t.width>0||t.height>0)&&(!n||t.width!==n.width||t.height!==n.height))&&(this.currentSize(t),this._resize(t,e),this.trigger(`resize`,t))}size(e){if(!e)return this.getSize();this.setSize(e)}suspendTracking(){this._suspendedTracking=!0}resumeTracking(){this._suspendedTracking=!1}_enableTracking(){}_resize(){}_handler(e){return t=>{let n=this.eventTarget(t);n&&!this._suspendedTracking&&this.trigger(e,{element:n,originalEvent:t,type:e})}}_elementOffset(){let e=this.element,t=Ft(e),{left:n,top:r}=At(e);return{left:n+t.left,top:r+t.top}}_surfacePoint(e){let t=this._elementOffset(),n=vt(e),r=n.x-t.left,i=n.y-t.top,a=Bt(this.element).invert();return new M(r,i).transform(a)}};function sa(e,t){return t==null?``:` ${e}="${t}" `}function ca(e){let t=``;for(let n=0;n<e.length;n++)t+=sa(e[n][0],e[n][1]);return t}function la(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n][1];r!==void 0&&(t+=e[n][0]+`:`+r+`;`)}if(t!==``)return t}let ua={},da=`http://www.w3.org/2000/svg`,fa=`none`,pa=(e,t)=>{xn(e,t)},ma=(e,t)=>{let n=new DOMParser().parseFromString(vn(t),`text/xml`);yn(n);let r=document.adoptNode(n.documentElement);e.insertBefore(r,e.firstChild)},ha,ga=(e,t)=>{if(ha)return ha(e,t);if(ha=pa,typeof document<`u`){let e=document.createElement(`div`),t=typeof DOMParser<`u`;e.innerHTML=`<svg xmlns='http://www.w3.org/2000/svg'></svg>`,t&&e.firstChild.namespaceURI!==`http://www.w3.org/2000/svg`&&(ha=ma)}return ha(e,t)},_a=`transform`,va={clip:`clip-path`,fill:`fill`};function ya(e,t){return e===`clip`||e===`fill`&&(!t||t.nodeType===`Gradient`||t.nodeType===`Pattern`)}var ba=class extends ia{constructor(e,t){super(e),this.definitions={},this.options=t}destroy(){this.element&&=(this.element._kendoNode=null,null),this.clearDefinitions(),super.destroy()}load(e,t){for(let n=0;n<e.length;n++){let r=e[n],i=r.children,a=new ua[r.nodeType](r,this.options);t===void 0?this.append(a):this.insertAt(a,t),a.createDefinitions(),i&&i.length>0&&a.load(i);let o=this.element;o&&a.attachTo(o,t)}}root(){let e=this;for(;e.parent;)e=e.parent;return e}attachTo(e,t){let n=document.createElement(`div`);ga(n,`<svg xmlns='http://www.w3.org/2000/svg' version='1.1'>`+this.render()+`</svg>`);let r=n.firstChild.firstChild;r&&(t===void 0?e.appendChild(r):e.insertBefore(r,e.childNodes[t]||null),this.setElement(r))}setElement(e){this.element&&(this.element._kendoNode=null),this.element=e,this.element._kendoNode=this;let t=this.childNodes;for(let n=0;n<t.length;n++){let r=e.childNodes[n];t[n].setElement(r)}}clear(){this.clearDefinitions(),this.element&&(this.element.innerHTML=``);let e=this.childNodes;for(let t=0;t<e.length;t++)e[t].destroy();this.childNodes=[]}removeSelf(){if(this.element){let e=this.element.parentNode;e&&e.removeChild(this.element),this.element=null}super.removeSelf()}template(){return this.renderChildren()}render(){return this.template()}renderChildren(){let e=this.childNodes,t=``;for(let n=0;n<e.length;n++)t+=e[n].render();return t}optionsChange(e){let{field:t,value:n}=e;t===`visible`?this.css(`display`,n?``:fa):va[t]&&ya(t,n)?this.updateDefinition(t,n):t===`opacity`?this.attr(`opacity`,n):t===`cursor`?this.css(`cursor`,n):t===`id`&&(n?this.attr(`id`,n):this.removeAttr(`id`)),super.optionsChange(e)}accessibilityOptionsChange(e){let{field:t,value:n}=e;t===`role`?n?this.attr(`role`,n):this.removeAttr(`role`):t===`ariaLabel`?n?this.attr(`aria-label`,Te(n)):this.removeAttr(`aria-label`):t===`ariaRoleDescription`?n?this.attr(`aria-roledescription`,Te(n)):this.removeAttr(`aria-roledescription`):t===`ariaChecked`?n===void 0?this.removeAttr(`aria-checked`):this.attr(`aria-checked`,n):t===`className`&&this.className(n)}attr(e,t){this.element&&this.element.setAttribute(e,t)}allAttr(e){for(let t=0;t<e.length;t++)this.attr(e[t][0],e[t][1])}toggleAttr(e,t){t?this.attr(e,t):this.removeAttr(e)}css(e,t){this.element&&(this.element.style[e]=t)}allCss(e){for(let t=0;t<e.length;t++)this.css(e[t][0],e[t][1])}className(e){this.element&&(this.element.classList.remove(...this.element.classList),e&&e.split(` `).forEach(e=>{e&&this.element.classList.add(e)}))}removeAttr(e){this.element&&this.element.removeAttribute(e)}mapTransform(e){let t=[];return e&&t.push([_a,`matrix(`+e.matrix().toString(6)+`)`]),t}renderTransform(){return ca(this.mapTransform(this.srcElement.transform()))}transformChange(e){e?this.allAttr(this.mapTransform(e)):this.removeAttr(_a)}mapStyle(){let e=this.srcElement.options,t=[[`cursor`,e.cursor]];return e.visible===!1&&t.push([`display`,fa]),t}renderStyle(){return sa(`style`,la(this.mapStyle(!0)))}renderOpacity(){return sa(`opacity`,this.srcElement.options.opacity)}renderId(){return sa(`id`,this.srcElement.options.id)}renderClassName(){return sa(`class`,this.srcElement.options.className)}renderRole(){return sa(`role`,this.srcElement.options.role)}renderAriaLabel(){let e=this.srcElement.options.ariaLabel;return e&&=Te(e),sa(`aria-label`,e)}renderAriaRoleDescription(){let e=this.srcElement.options.ariaRoleDescription;return e&&=Te(e),sa(`aria-roledescription`,e)}renderAriaChecked(){return sa(`aria-checked`,this.srcElement.options.ariaChecked)}createDefinitions(){let e=this.srcElement,t=this.definitions;if(e){let n=e.options,r;for(let e in va){let i=n.get(e);i&&ya(e,i)&&(t[e]=i,r=!0)}r&&this.definitionChange({action:`add`,definitions:t})}}definitionChange(e){this.parent&&this.parent.definitionChange(e)}updateDefinition(e,t){let n=this.definitions,r=n[e],i=va[e],a={};r&&(a[e]=r,this.definitionChange({action:`remove`,definitions:a}),delete n[e]),t?(a[e]=t,this.definitionChange({action:`add`,definitions:a}),n[e]=t,this.attr(i,this.refUrl(t.id))):r&&this.removeAttr(i)}clearDefinitions(){let e=this.definitions;this.definitionChange({action:`remove`,definitions:e}),this.definitions={}}renderDefinitions(){return ca(this.mapDefinitions())}mapDefinitions(){let e=this.definitions,t=[];for(let n in e){let r=e[n];t.push([va[n],this.refUrl(r.id)])}return t}refUrl(e){return`url(#${e})`}},xa=class extends ba{template(){return`<stop ${this.renderOffset()} ${this.renderStyle()} />`}renderOffset(){return sa(`offset`,this.srcElement.offset())}mapStyle(){let e=this.srcElement;return[[`stop-color`,e.color()],[`stop-opacity`,e.opacity()]]}optionsChange(e){e.field===`offset`?this.attr(e.field,e.value):(e.field===`color`||e.field===`opacity`)&&this.css(`stop-`+e.field,e.value)}},Sa=class extends ba{constructor(e){super(e),this.id=e.id,this.loadStops()}loadStops(){let e=this.srcElement.stops,t=this.element;for(let n=0;n<e.length;n++){let r=new xa(e[n]);this.append(r),t&&r.attachTo(t)}}optionsChange(e){e.field===`gradient.stops`?(ia.prototype.clear.call(this),this.loadStops()):e.field===`gradient`&&this.allAttr(this.mapCoordinates())}renderCoordinates(){return ca(this.mapCoordinates())}mapSpace(){return[`gradientUnits`,this.srcElement.userSpace()?`userSpaceOnUse`:`objectBoundingBox`]}},Ca=class extends Sa{template(){return`<linearGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</linearGradient>`}mapCoordinates(){let e=this.srcElement,t=e.start(),n=e.end();return[[`x1`,t.x],[`y1`,t.y],[`x2`,n.x],[`y2`,n.y],this.mapSpace()]}},wa=class extends Sa{template(){return`<radialGradient id='${this.id}' ${this.renderCoordinates()}>${this.renderChildren()}</radialGradient>`}mapCoordinates(){let e=this.srcElement,t=e.center(),n=e.radius();return[[`cx`,t.x],[`cy`,t.y],[`r`,n],this.mapSpace()]}},Ta=class extends ba{constructor(e){super(e),this.id=e.id,this.load(e.children)}template(){let e=this.srcElement.size().getWidth(),t=this.srcElement.size().getHeight();return`<pattern id='${this.srcElement.id}' width='${e}' height='${t}' patternUnits='userSpaceOnUse'>${this.renderChildren()}</pattern>`}},Ea=class extends ba{constructor(e){super(),this.srcElement=e,this.id=e.id,this.load([e])}renderClipRule(){return sa(`clip-rule`,`evenodd`)}template(){return`<clipPath ${this.renderClipRule()} id='${this.id}'>${this.renderChildren()}</clipPath>`}},Da=class extends ba{constructor(){super(),this.definitionMap={}}attachTo(e){this.element=e}template(){return`<defs>${this.renderChildren()}</defs>`}definitionChange(e){let{definitions:t,action:n}=e;n===`add`?this.addDefinitions(t):n===`remove`&&this.removeDefinitions(t)}createDefinition(e,t){let n;return e===`clip`?n=Ea:e===`fill`&&(t instanceof xi?n=Ca:t instanceof Si?n=wa:t.nodeType===`Pattern`&&(n=Ta)),new n(t)}addDefinitions(e){for(let t in e)this.addDefinition(t,e[t])}addDefinition(e,t){let{element:n,definitionMap:r}=this,i=t.id,a=r[i];if(a)a.count++;else{let a=this.createDefinition(e,t);r[i]={element:a,count:1},this.append(a),n&&a.attachTo(this.element)}}removeDefinitions(e){for(let t in e)this.removeDefinition(e[t])}removeDefinition(e){let t=this.definitionMap,n=e.id,r=t[n];r&&(r.count--,r.count===0&&(this.remove(this.childNodes.indexOf(r.element),1),delete t[n]))}},Oa=class extends ba{constructor(e){super(),this.options=e,this.defs=new Da}attachTo(e){this.element=e,this.defs.attachTo(e.firstElementChild)}clear(){ia.prototype.clear.call(this)}template(){return this.defs.render()+this.renderChildren()}definitionChange(e){this.defs.definitionChange(e)}};let ka={"fill.opacity":`fill-opacity`,"stroke.color":`stroke`,"stroke.width":`stroke-width`,"stroke.opacity":`stroke-opacity`};var Aa=class extends ba{geometryChange(){this.attr(`d`,this.renderData()),this.invalidate()}optionsChange(e){switch(e.field){case`fill`:e.value?this.allAttr(this.mapFill(e.value)):this.removeAttr(`fill`);break;case`fill.color`:this.allAttr(this.mapFill({color:e.value}));break;case`stroke`:e.value?this.allAttr(this.mapStroke(e.value)):this.removeAttr(`stroke`);break;case`transform`:this.transformChange(e.value);break;default:{let t=ka[e.field];t&&this.attr(t,e.value);break}}this.accessibilityOptionsChange(e),super.optionsChange(e)}content(){this.element&&(this.element.textContent=this.srcElement.content())}renderData(){return this.srcElement.toString(3)||void 0}mapStroke(e){let t=[];return e&&!bt(e.color)?(t.push([`stroke`,e.color]),t.push([`stroke-width`,e.width]),t.push([`stroke-linecap`,this.renderLinecap(e)]),t.push([`stroke-linejoin`,e.lineJoin]),e.opacity!==void 0&&t.push([`stroke-opacity`,e.opacity]),e.dashType!==void 0&&t.push([`stroke-dasharray`,this.renderDashType(e)])):t.push([`stroke`,fa]),t}renderStroke(){return ca(this.mapStroke(this.srcElement.options.stroke))}renderDashType(e){let{dashType:t,width:n=1}=e;if(t&&t!==`solid`){let e=En[t.toLowerCase()],r=[];for(let t=0;t<e.length;t++)r.push(e[t]*n);return r.join(` `)}}renderLinecap(e){let{dashType:t,lineCap:n}=e;return t&&t!==`solid`?Dn:n}mapFill(e){let t=[];return e&&(e.nodeType===`Gradient`||e.nodeType===`Pattern`)||(e&&!bt(e.color)?(t.push([`fill`,e.color]),e.opacity!==void 0&&t.push([`fill-opacity`,e.opacity])):t.push([`fill`,fa])),t}renderFill(){return ca(this.mapFill(this.srcElement.options.fill))}template(){return`<path ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} ${sa(`d`,this.renderData())}${this.renderStroke()}${this.renderFill()}${this.renderDefinitions()}${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></path>`}},ja=class extends Aa{renderData(){return this.srcElement.toPath().toString(3)}},Ma=class extends Aa{geometryChange(){let e=this.center();this.attr(`cx`,e.x),this.attr(`cy`,e.y),this.attr(`r`,this.radius()),this.invalidate()}center(){return this.srcElement.geometry().center}radius(){return this.srcElement.geometry().radius}template(){return`<circle ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()}cx='${this.center().x}' cy='${this.center().y}' r='${this.radius()}'${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ${this.renderTransform()} ></circle>`}},Na=class extends ba{template(){return`<g${this.renderId()+this.renderTransform()+this.renderClassName()+this.renderStyle()+this.renderOpacity()+this.renderRole()+this.renderAriaLabel()+this.renderAriaRoleDescription()+this.renderAriaChecked()+this.renderDefinitions()}>${this.renderChildren()}</g>`}optionsChange(e){let{field:t,value:n}=e;t===`transform`&&this.transformChange(n),this.accessibilityOptionsChange(e),super.optionsChange(e)}},Pa=class extends Aa{geometryChange(){this.allAttr(this.mapPosition()),this.invalidate()}optionsChange(e){e.field===`src`&&this.allAttr(this.mapSource()),super.optionsChange(e)}mapPosition(){let e=this.srcElement.rect(),t=e.topLeft();return[[`x`,t.x],[`y`,t.y],[`width`,e.width()+`px`],[`height`,e.height()+`px`]]}renderPosition(){return ca(this.mapPosition())}mapSource(e){let t=this.srcElement.src();return e&&(t=Te(t)),[[`xlink:href`,t]]}renderSource(){return ca(this.mapSource(!0))}template(){return`<image preserveAspectRatio='none' ${this.renderId()} ${this.renderStyle()} ${this.renderTransform()} ${this.renderOpacity()}${this.renderPosition()} ${this.renderSource()} ${this.renderDefinitions()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} ></image>`}},Fa=class extends Aa{renderData(){return this.srcElement.toString(3)||`undefined`}},Ia=class extends Aa{geometryChange(){let e=this.srcElement.geometry();this.attr(`x`,e.origin.x),this.attr(`y`,e.origin.y),this.attr(`width`,e.size.width),this.attr(`height`,e.size.height),this.attr(`rx`,e.cornerRadius[0]),this.attr(`ry`,e.cornerRadius[1]),this.invalidate()}size(){return this.srcElement.geometry().size}origin(){return this.srcElement.geometry().origin}rx(){return this.srcElement.geometry().cornerRadius[0]}ry(){return this.srcElement.geometry().cornerRadius[1]}template(){return`<rect ${this.renderId()} ${this.renderStyle()} ${this.renderOpacity()} x='${this.origin().x}' y='${this.origin().y}' rx='${this.rx()}' ry='${this.ry()}' width='${this.size().width}' height='${this.size().height}' ${this.renderStroke()} ${this.renderFill()} ${this.renderDefinitions()} ${this.renderTransform()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()} />`}};let La=/&(?:[a-zA-Z]+|#\d+);/g;function Ra(e){if(!e||typeof e!=`string`||!La.test(e))return e;let t=Ra._element;return La.lastIndex=0,e.replace(La,e=>(t.innerHTML=e,t.textContent||t.innerText))}typeof document<`u`&&(Ra._element=document.createElement(`span`));var za=class extends Aa{geometryChange(){let e=this.pos();this.attr(`x`,e.x),this.attr(`y`,e.y),this.invalidate()}optionsChange(e){e.field===`font`?(this.attr(`style`,la(this.mapStyle())),this.geometryChange()):e.field===`content`&&super.content(this.srcElement.content()),super.optionsChange(e)}mapStyle(e){let t=super.mapStyle(e),n=this.srcElement.options.font;return e&&(n=Te(n)),t.push([`font`,n],[`white-space`,`pre`]),t}pos(){let e=this.srcElement.position(),t=this.srcElement.measure();return e.clone().setY(e.y+t.baseline)}renderContent(){let e=this.srcElement.content();return e=Ra(e),e=Te(e),Ut(e)}renderTextAnchor(){let e;return(this.options||{}).rtl&&!(ke.browser.msie||ke.browser.edge)&&(e=`end`),sa(`text-anchor`,e)}renderPaintOrder(){let e=this.srcElement.options.paintOrder;return e?sa(`paint-order`,e):``}template(){return`<text ${this.renderId()} ${this.renderTextAnchor()} ${this.renderStyle()} ${this.renderOpacity()}x='${this.pos().x}' y='${this.pos().y}' ${this.renderStroke()} ${this.renderTransform()} ${this.renderDefinitions()}${this.renderPaintOrder()}${this.renderFill()}${this.renderClassName()} ${this.renderRole()}${this.renderAriaLabel()} ${this.renderAriaRoleDescription()}${this.renderAriaChecked()}>${this.renderContent()}</text>`}};ua.Arc=ja,ua.Circle=Ma,ua.Group=Na,ua.Image=Pa,ua.MultiPath=Fa,ua.Path=Aa,ua.Rect=Ia,ua.Text=za;function Ba(e){let t;try{t=e.getScreenCTM?e.getScreenCTM():null}catch{}if(t){let n=-t.e%1,r=-t.f%1,i=e.style;(n!==0||r!==0)&&(i.left=n+`px`,i.top=r+`px`)}}var Va=class extends oa{get type(){return`svg`}constructor(e,t){super(e,t),this._root=new Oa(Object.assign({rtl:jt(e,`direction`).direction===`rtl`},this.options)),ga(this.element,this._template(``)),this._rootElement=this.element.firstElementChild,this._rootElement.style.width=`100%`,this._rootElement.style.height=`100%`,this._rootElement.style.overflow=`hidden`,Ba(this._rootElement),this._root.attachTo(this._rootElement),kt(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove}),this.resize()}destroy(){this._root&&(this._root.destroy(),this._root=null,this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null,Pt(this.element,{click:this._click,mouseover:this._mouseenter,mouseout:this._mouseleave,mousemove:this._mousemove})),super.destroy()}translate(e){let t=`${Math.round(e.x)} ${Math.round(e.y)} ${this._size.width} ${this._size.height}`;this._offset=e,this._rootElement.setAttribute(`viewBox`,t)}draw(e){super.draw(e),this._root.load([e])}clear(){super.clear(),this._root.clear()}svg(){return`<?xml version='1.0' ?>`+this._template()}exportVisual(){let{_visual:e,_offset:t}=this;if(t){let n=new I;n.children.push(e),n.transform(P().translate(-t.x,-t.y)),e=n}return e}_resize(){this._offset&&this.translate(this._offset)}_template(e){return`<svg ${typeof e==`string`?e:`style='width: 100%; height: 100%; overflow: hidden;' `}xmlns='${da}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${this._root.render()}</svg>`}};let Ha={};var Ua=class extends ia{constructor(e){super(e),e&&this.initClip()}initClip(){let e=this.srcElement.clip();e&&(this.clip=e,e.addObserver(this))}clear(){this.srcElement&&this.srcElement.removeObserver(this),this.clearClip(),super.clear()}clearClip(){this.clip&&(this.clip.removeObserver(this),delete this.clip)}setClip(e){this.clip&&(e.beginPath(),new Ha[this.clip.nodeType](this.clip).renderPoints(e,this.clip),e.clip(`evenodd`))}optionsChange(e){e.field===`clip`&&(this.clearClip(),this.initClip()),super.optionsChange(e)}setTransform(e){if(this.srcElement){let t=this.srcElement.transform();t&&e.transform.apply(e,t.matrix().toArray(6))}}loadElements(e,t,n){for(let r=0;r<e.length;r++){let i=e[r],a=i.children,o=new Ha[i.nodeType](i,n);a&&a.length>0&&o.load(a,t,n),t===void 0?this.append(o):this.insertAt(o,t)}}load(e,t,n){this.loadElements(e,t,n),this.invalidate()}setOpacity(e){if(this.srcElement){let t=this.srcElement.opacity();t!==void 0&&this.globalAlpha(e,t)}}globalAlpha(e,t){let n=t;n&&e.globalAlpha&&(n*=e.globalAlpha),e.globalAlpha=n}visible(){let e=this.srcElement;return!e||e&&e.options.visible!==!1}},Wa=class extends Kr(Ua,`childNodes`){renderTo(e){if(!this.visible())return;e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e);let t=this.childNodes;for(let n=0;n<t.length;n++){let r=t[n];r.visible()&&r.renderTo(e)}e.restore()}},Ga=class extends Kr(Wa,`childNodes`){constructor(e,t){super(),this.canvas=e,this.size=t,this.ctx=e.getContext(`2d`);let n=this._invalidate.bind(this);this.invalidate=je(()=>{ye(n)},16.666666666666668)}destroy(){super.destroy(),this.canvas=null,this.ctx=null}load(e,t,n){this.loadElements(e,t,n),this._invalidate()}_rescale(e){let{canvas:t,size:n}=this;t.width=n.width*e,t.height=n.height*e,this.ctx.scale(e,e)}_devicePixelRatio(){return typeof window.devicePixelRatio==`number`?window.devicePixelRatio:1}_invalidate(e){if(!this.ctx)return;let t=e&&e.fixedScale?1:this._devicePixelRatio();this._rescale(t),this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderTo(this.ctx)}},Ka=class extends fe{constructor(){super(),this.shapes=[]}_add(e,t){this.shapes.push({bbox:t,shape:e}),e._quadNode=this}pointShapes(e){let t=this.shapes,n=t.length,r=[];for(let i=0;i<n;i++)t[i].bbox.containsPoint(e)&&r.push(t[i].shape);return r}insert(e,t){this._add(e,t)}remove(e){let t=this.shapes,n=t.length;for(let r=0;r<n;r++)if(t[r].shape===e){t.splice(r,1);break}}},qa=class e extends Ka{constructor(e){super(),this.children=[],this.rect=e}inBounds(e){let t=this.rect,n=t.bottomRight(),r=e.bottomRight();return t.origin.x<=e.origin.x&&t.origin.y<=e.origin.y&&r.x<=n.x&&r.y<=n.y}pointShapes(e){let t=this.children,n=t.length,r=super.pointShapes(e);for(let i=0;i<n;i++)tt(r,t[i].pointShapes(e));return r}insert(e,t){let n=this.children,r=!1;if(this.inBounds(t)){if(this.shapes.length<4)this._add(e,t);else{n.length||this._initChildren();for(let i=0;i<n.length;i++)if(n[i].insert(e,t)){r=!0;break}r||this._add(e,t)}r=!0}return r}_initChildren(){let{rect:t,children:n}=this,r=t.center(),i=t.width()/2,a=t.height()/2;n.push(new e(new N([t.origin.x,t.origin.y],[i,a])),new e(new N([r.x,t.origin.y],[i,a])),new e(new N([t.origin.x,r.y],[i,a])),new e(new N([r.x,r.y],[i,a])))}};let Ja=3e3,Ya=BigInt(1e4);var Xa=class extends fe{constructor(){super(),this.initRoots()}initRoots(){this.rootMap={},this.root=new Ka,this.rootElements=[]}clear(){let e=this.rootElements;for(let t=0;t<e.length;t++)this.remove(e[t]);this.initRoots()}pointShape(e){let t=(this.rootMap[Math.floor(e.x/Ja)]||{})[Math.floor(e.y/Ja)],n=this.root.pointShapes(e);t&&(n=n.concat(t.pointShapes(e)));let r=eo(n);this.assignZindex(n,r),n.sort(Za);for(let t=0;t<n.length;t++)if(n[t].containsPoint(e))return n[t]}assignZindex(e,t){let n=$a(Ya,BigInt(t)),r=[],i=BigInt(0);for(let t=0;t<e.length;t++){let a=e[t],o=i,s=n,c=[];for(;a;)c.push(a),a=a.parent;for(;c.length;)a=c.pop(),o+=BigInt((a.parent?a.parent.children:this.rootElements).indexOf(a)+1)*s,s/=Ya;e[t]._zIndex=o,r.push(o)}r.sort(Qa);for(let t=0;t<e.length;t++)e[t]._zIndex=r.indexOf(e[t]._zIndex)}optionsChange(e){(e.field===`transform`||e.field===`stroke.width`)&&this.bboxChange(e.element)}geometryChange(e){this.bboxChange(e.element)}bboxChange(e){if(e.nodeType===`Group`)for(let t=0;t<e.children.length;t++)this.bboxChange(e.children[t]);else e._quadNode&&e._quadNode.remove(e),this._insertShape(e)}add(e){let t=Array.isArray(e)?e.slice(0):[e];tt(this.rootElements,t),this._insert(t)}childrenChange(e){if(e.action===`remove`)for(let t=0;t<e.items.length;t++)this.remove(e.items[t]);else this._insert(Array.prototype.slice.call(e.items,0))}_insert(e){let t;for(;e.length>0;)t=e.pop(),t.addObserver(this),t.nodeType===`Group`?tt(e,t.children):this._insertShape(t)}_insertShape(e){let t=e.bbox();if(t){let n=this.getSectors(t),r=n[0][0],i=n[1][0];if(this.inRoot(n))this.root.insert(e,t);else{let n=this.rootMap;n[r]||(n[r]={}),n[r][i]||(n[r][i]=new qa(new N([r*Ja,i*Ja],[Ja,Ja]))),n[r][i].insert(e,t)}}}remove(e){if(e.removeObserver(this),e.nodeType===`Group`){let t=e.children;for(let e=0;e<t.length;e++)this.remove(t[e])}else e._quadNode&&(e._quadNode.remove(e),delete e._quadNode)}inRoot(e){return e[0].length>1||e[1].length>1}getSectors(e){let t=e.bottomRight(),n=Math.floor(t.x/Ja),r=Math.floor(t.y/Ja),i=[[],[]];for(let t=Math.floor(e.origin.x/Ja);t<=n;t++)i[0].push(t);for(let t=Math.floor(e.origin.y/Ja);t<=r;t++)i[1].push(t);return i}};function Za(e,t){return e._zIndex<t._zIndex?1:e._zIndex>t._zIndex?-1:0}function Qa(e,t){return e<t?-1:+(e>t)}function $a(e,t){let n=e,r=t,i=BigInt(1),a=i;for(;r;)r&i&&(a*=n),r>>=i,r&&(n*=n);return a}function eo(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n],i=[];for(;r;)i.push(r),r=r.parent;t=Math.max(t,i.length)}return t+1}var to=class{constructor(e){e.bind(`mouseenter`,this._mouseenter.bind(this)),e.bind(`mouseleave`,this._mouseleave.bind(this)),this.element=e.element}clear(){this._resetCursor()}destroy(){this._resetCursor(),delete this.element}_mouseenter(e){let t=this._shapeCursor(e);t?(this._current||(this._defaultCursor=this._getCursor()),this._setCursor(t)):this._resetCursor()}_mouseleave(){this._resetCursor()}_shapeCursor(e){let t=e.element;for(;t&&t.options.cursor===void 0;)t=t.parent;if(t)return t.options.cursor}_getCursor(){if(this.element)return this.element.style.cursor}_setCursor(e){this.element&&(this.element.style.cursor=e,this._current=e)}_resetCursor(){this._current&&(this._setCursor(this._defaultCursor||``),delete this._current)}};function no(e,t){let n=t.segments;if(n.length===0)return;let r=n[0],i=r.anchor();e.moveTo(i.x,i.y);for(let t=1;t<n.length;t++){r=n[t],i=r.anchor();let a=n[t-1].controlOut(),o=r.controlIn();a&&o?e.bezierCurveTo(a.x,a.y,o.x,o.y,i.x,i.y):e.lineTo(i.x,i.y)}t.options.closed&&e.closePath()}function ro(e,t){for(let n=0;n<t.length;n++){let r=t[n],i=Ue(r.color());i.a*=r.opacity(),e.addColorStop(r.offset(),i.toCssRgba())}}var io=class extends Ua{renderTo(e){e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),this.renderPoints(e,this.srcElement),this.setLineDash(e),this.setLineCap(e),this.setLineJoin(e),this.setFill(e),this.setStroke(e),e.restore()}setFill(e){let t=this.srcElement.options.fill,n=!1;return t&&(t.nodeType===`Gradient`?(this.setGradientFill(e,t),n=!0):t.nodeType===`Pattern`?(this.setPatternFill(e,t),n=!0):bt(t.color)||(e.fillStyle=t.color,e.save(),this.globalAlpha(e,t.opacity),e.fill(),e.restore(),n=!0)),n}setGradientFill(e,t){let n=this.srcElement.rawBBox(),r;if(t instanceof xi){let n=t.start(),i=t.end();r=e.createLinearGradient(n.x,n.y,i.x,i.y)}else if(t instanceof Si){let n=t.center();r=e.createRadialGradient(n.x,n.y,0,n.x,n.y,t.radius())}ro(r,t.stops),e.save(),t.userSpace()||e.transform(n.width(),0,0,n.height(),n.origin.x,n.origin.y),e.fillStyle=r,e.fill(),e.restore()}setPatternFill(e,t){let n=t.size(),r=document.createElement(`canvas`),i=r.getContext(`2d`);r.width=n.getWidth(),r.height=n.getHeight(),this.childNodes.length=0,this.loadElements(t.children);let a=this.childNodes;for(let e=0;e<a.length;e++)a[e].renderTo(i);e.save(),e.fillStyle=e.createPattern(r,`repeat`),e.fill(),e.restore()}setStroke(e){let t=this.srcElement.options.stroke;if(t&&!bt(t.color)&&t.width>0)return e.strokeStyle=t.color,e.lineWidth=Ot(t.width,1),e.lineJoin=Ot(t.lineJoin,e.lineJoin),e.save(),this.globalAlpha(e,t.opacity),e.stroke(),e.restore(),!0}dashType(){let e=this.srcElement.options.stroke;if(e&&e.dashType)return e.dashType.toLowerCase()}setLineDash(e){let t=this.dashType();if(t&&t!==`solid`){let n=En[t];e.setLineDash?e.setLineDash(n):(e.mozDash=n,e.webkitLineDash=n)}}setLineCap(e){let t=this.dashType(),n=this.srcElement.options.stroke;t&&t!==`solid`?e.lineCap=Dn:n&&n.lineCap&&(e.lineCap=n.lineCap)}setLineJoin(e){let t=this.srcElement.options.stroke;t&&t.lineJoin&&(e.lineJoin=t.lineJoin)}renderPoints(e,t){no(e,t)}},ao=class extends io{renderPoints(e){no(e,this.srcElement.toPath())}},oo=class extends io{renderPoints(e){let{center:t,radius:n}=this.srcElement.geometry();e.arc(t.x,t.y,n,0,Math.PI*2)}},so=class extends io{constructor(e,t){super(e),this.onLoad=this.onLoad.bind(this),this.onError=this.onError.bind(this),this.loading=it();let n=this.img=new Image,r=e.src();t&&!/^data:/i.test(r)&&(n.crossOrigin=t),r&&(n.src=r),n.complete?this.onLoad():(n.onload=this.onLoad,n.onerror=this.onError)}renderTo(e){this.loading.state()===`resolved`&&(e.save(),this.setTransform(e),this.setClip(e),this.drawImage(e),e.restore())}optionsChange(e){e.field===`src`?(this.loading=it(),this.img.src=this.srcElement.src()):super.optionsChange(e)}onLoad(){this.loading.resolve(),this.invalidate()}onError(){this.loading.reject(Error(`Unable to load image '`+this.img.src+`'. Check for connectivity and verify CORS headers.`))}drawImage(e){let t=this.srcElement.rect(),n=t.topLeft();e.drawImage(this.img,n.x,n.y,t.width(),t.height())}},co=class extends io{renderPoints(e){let t=this.srcElement.paths;for(let n=0;n<t.length;n++)no(e,t[n])}},lo=class extends io{renderPoints(e){let t=this.srcElement.geometry(),[n,r]=t.cornerRadius;if(n===0&&r===0){let{origin:n,size:r}=t;e.rect(n.x,n.y,r.width,r.height)}else super.renderPoints(e,F.fromRect(t))}},uo=class extends io{renderTo(e){let t=this.srcElement,n=t.position(),r=t.measure();e.save(),this.setTransform(e),this.setClip(e),this.setOpacity(e),e.beginPath(),e.font=t.options.font,e.textAlign=`left`,t.options.paintOrder===`stroke`?(this.stroke(e,t,n,r),this.fill(e,t,n,r)):(this.fill(e,t,n,r),this.stroke(e,t,n,r)),e.restore()}stroke(e,t,n,r){this.setStroke(e)&&(this.setLineDash(e),e.strokeText(t.content(),n.x,n.y+r.baseline))}fill(e,t,n,r){this.setFill(e)&&e.fillText(t.content(),n.x,n.y+r.baseline)}};Ha.Arc=ao,Ha.Circle=oo,Ha.Group=Wa,Ha.Image=so,Ha.MultiPath=co,Ha.Path=io,Ha.Rect=lo,Ha.Text=uo;var fo=class extends oa{get type(){return`canvas`}constructor(e,t){super(e,t),xn(this.element,this._template(this));let n=this.element.firstElementChild;n.style.width=`100%`,n.style.height=`100%`;let r=Nt(e);n.width=r.width,n.height=r.height,this._rootElement=n,this._root=new Ga(n,r),this._mouseTrackHandler=this._trackMouse.bind(this),kt(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler})}destroy(){super.destroy(),this._root&&=(this._root.destroy(),null),this._searchTree&&(this._searchTree.clear(),delete this._searchTree),this._cursor&&(this._cursor.destroy(),delete this._cursor),Pt(this.element,{click:this._mouseTrackHandler,mousemove:this._mouseTrackHandler}),this._rootElement&&this._rootElement.parentNode&&this._rootElement.parentNode.removeChild(this._rootElement),this._rootElement=null}draw(e){super.draw(e),this._root.load([e],void 0,this.options.cors),this._searchTree&&this._searchTree.add([e])}clear(){super.clear(),this._root.clear(),this._searchTree&&this._searchTree.clear(),this._cursor&&this._cursor.clear()}eventTarget(e){if(this._searchTree){let t=this._surfacePoint(e);return this._searchTree.pointShape(t)}}image(){let{_root:e,_rootElement:t}=this,n=[];e.traverse(e=>{e.loading&&n.push(e.loading)});let r=it(),i=()=>{e._invalidate({fixedScale:!0});try{let e=t.toDataURL();r.resolve(e)}catch(e){r.reject(e)}};return wt(n).then(i,i),r}suspendTracking(){super.suspendTracking(),this._searchTree&&(this._searchTree.clear(),delete this._searchTree)}resumeTracking(){if(super.resumeTracking(),!this._searchTree){this._searchTree=new Xa;let e=this._root.childNodes,t=[];for(let n=0;n<e.length;n++)t.push(e[n].srcElement);this._searchTree.add(t)}}_resize(){this._rootElement.width=this._size.width,this._rootElement.height=this._size.height,this._root.size=this._size,this._root.invalidate()}_template(){return`<canvas></canvas>`}_enableTracking(){this._searchTree=new Xa,this._cursor=new to(this),super._enableTracking()}_trackMouse(e){if(this._suspendedTracking)return;let t=this.eventTarget(e);if(e.type!==`click`){let n=this._currentShape;n&&n!==t&&this.trigger(`mouseleave`,{element:n,originalEvent:e,type:`mouseleave`}),t&&n!==t&&this.trigger(`mouseenter`,{element:t,originalEvent:e,type:`mouseenter`}),this.trigger(`mousemove`,{element:t,originalEvent:e,type:`mousemove`}),this._currentShape=t}else t&&this.trigger(`click`,{element:t,originalEvent:e,type:`click`})}};let po,mo,ho=()=>typeof document<`u`,go=()=>ho()&&document.createElement(`canvas`).getContext,_o=()=>ho()&&document.implementation.hasFeature(`http://www.w3.org/TR/SVG11/feature#BasicStructure`,`1.1`);var vo=class e extends fe{static get support(){return mo||={canvas:go(),svg:_o()},mo}static get current(){return po||=new e,po}constructor(){super(),this._items=[{name:`svg`,type:Va},{name:`canvas`,type:fo}]}create(e,t){let n=this._items,r=n[0];if(t&&t.type){let e=t.type.toLowerCase();for(let t=0;t<n.length;t++)if(n[t].name===e){r=n[t];break}}if(r)return new r.type(e,t);Ee(`Warning: Unable to create Kendo UI Drawing Surface. Possible causes:
- The browser does not support SVG and Canvas. User agent: ${navigator.userAgent}`)}},yo=class extends oa{static get support(){return vo.support}static create(e,t){return vo.current.create(e,t)}};function bo(e){let t=new Oa({skipBaseHref:!0}),n=e.clippedBBox(),r=e;if(n){let t=n.getOrigin(),i=new I;i.transform(P().translate(-t.x,-t.y)),i.children.push(e),r=i}t.load([r]);let i=`<?xml version='1.0' ?><svg xmlns='${da}' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1'>${t.render()}</svg>`;return t.destroy(),i}var xo=m({ArcNode:()=>ja,CircleNode:()=>Ma,ClipNode:()=>Ea,DefinitionNode:()=>Da,GradientStopNode:()=>xa,GroupNode:()=>Na,ImageNode:()=>Pa,LinearGradientNode:()=>Ca,MultiPathNode:()=>Fa,Node:()=>ba,PathNode:()=>Aa,RadialGradientNode:()=>wa,RectNode:()=>Ia,RootNode:()=>Oa,Surface:()=>Va,TextNode:()=>za,exportGroup:()=>bo}),So=m({ArcNode:()=>ao,CircleNode:()=>oo,GroupNode:()=>Wa,ImageNode:()=>so,MultiPathNode:()=>co,Node:()=>Ua,PathNode:()=>io,RectNode:()=>lo,RootNode:()=>Ga,Surface:()=>fo,TextNode:()=>uo});function Co(e,t){let n={width:`800px`,height:`600px`,cors:`Anonymous`},r=e,i=e.clippedBBox();if(i){let t=i.getOrigin();r=new I,r.transform(P().translate(-t.x,-t.y)),r.children.push(e);let a=i.getSize();n.width=a.width+`px`,n.height=a.height+`px`}let a=Object.assign(n,t),o=document.createElement(`div`),s=o.style;s.display=`none`,s.width=a.width,s.height=a.height,document.body.appendChild(o);let c=new fo(o,a);c.suspendTracking(),c.draw(r);let l=c.image(),u=()=>{c.destroy(),document.body.removeChild(o)};return l.then(u,u),l}function wo(e,t){let n=bo(e);return(!t||!t.raw)&&(n=`data:image/svg+xml;base64,`+_t(n)),it().resolve(n)}var To=m({Animation:()=>ta,AnimationFactory:()=>Zi,Arc:()=>Ur,BaseNode:()=>ia,Circle:()=>Rn,Element:()=>On,Gradient:()=>yi,GradientStop:()=>vi,Group:()=>I,HasObservers:()=>Je,Image:()=>Gr,Layout:()=>$r,LinearGradient:()=>xi,MultiPath:()=>Hr,OptionsStore:()=>Xe,Path:()=>F,PathParser:()=>ra,Pattern:()=>Di,QuadNode:()=>qa,RadialGradient:()=>Si,Rect:()=>ei,ShapesQuadTree:()=>Xa,Surface:()=>yo,SurfaceFactory:()=>vo,Text:()=>Wr,align:()=>ni,canvas:()=>So,crosshatchPattern:()=>ji,diagonalStripesPattern:()=>Mi,dotsPattern:()=>ki,exportImage:()=>Co,exportSVG:()=>wo,fit:()=>fi,gridPattern:()=>Ni,parsePath:()=>Lr,stack:()=>oi,svg:()=>xo,util:()=>Sn,vAlign:()=>ri,vStack:()=>si,vWrap:()=>di,verticalStripesPattern:()=>Ai,wrap:()=>ui});let Eo=typeof Uint8Array<`u`&&ke.browser&&(!ke.browser.msie||ke.browser.version>9),Do=function(){var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;return{decode:function(t){for(var n=t.replace(/[^A-Za-z0-9\+\/\=]/g,``),r=0,i=n.length,a=[];r<i;){var o=e.indexOf(n.charAt(r++)),s=e.indexOf(n.charAt(r++)),c=e.indexOf(n.charAt(r++)),l=e.indexOf(n.charAt(r++)),u=o<<2|s>>>4,d=(s&15)<<4|c>>>2,f=(c&3)<<6|l;a.push(u),c!=64&&a.push(d),l!=64&&a.push(f)}return a},encode:function(t){for(var n=0,r=t.length,i=``;n<r;){var a=t[n++],o=t[n++],s=t[n++],c=a>>>2,l=(a&3)<<4|o>>>4,u=(o&15)<<2|s>>>6,d=s&63;n-r==2?u=d=64:n-r==1&&(d=64),i+=e.charAt(c)+e.charAt(l)+e.charAt(u)+e.charAt(d)}return i}}}();function Oo(e){var t=0,n=0;e==null?e=Eo?new Uint8Array(256):[]:n=e.length;var r=Eo?function(t){if(t>=e.length){var n=new Uint8Array(Math.max(t+256,e.length*2));n.set(e,0),e=n}}:function(){},i=Eo?function(){return new Uint8Array(e.buffer,0,n)}:function(){return e},a=Eo?function(i){if(typeof i==`string`)return w(i);var a=i.length;r(t+a),e.set(i,t),t+=a,t>n&&(n=t)}:function(e){if(typeof e==`string`)return w(e);for(var t=0;t<e.length;++t)l(e[t])},o=Eo?function(t,n){if(e.buffer.slice)return new Uint8Array(e.buffer.slice(t,t+n));var r=new Uint8Array(n);return r.set(new Uint8Array(e.buffer,t,n)),r}:function(t,n){return e.slice(t,t+n)};function s(){return t>=n}function c(){return t<n?e[t++]:0}function l(i){r(t),e[t++]=i&255,t>n&&(n=t)}function u(){return c()<<8|c()}function d(e){l(e>>8),l(e)}function f(){var e=u();return e>=32768?e-65536:e}function p(e){d(e<0?e+65536:e)}function m(){return u()*65536+u()}function h(e){d(e>>>16&65535),d(e&65535)}function g(){var e=m();return e>=2147483648?e-4294967296:e}function _(e){h(e<0?e+4294967296:e)}function v(){return m()/65536}function y(e){h(Math.round(e*65536))}function b(){return g()/65536}function x(e){_(Math.round(e*65536))}function S(e){return ee(e,c)}function C(e){return String.fromCharCode.apply(String,S(e))}function w(e){for(var t=0;t<e.length;++t)l(e.charCodeAt(t))}function ee(e,t){for(var n=Array(e),r=0;r<e;++r)n[r]=t();return n}var T={eof:s,readByte:c,writeByte:l,readShort:u,writeShort:d,readLong:m,writeLong:h,readFixed:v,writeFixed:y,readShort_:f,writeShort_:p,readLong_:g,writeLong_:_,readFixed_:b,writeFixed_:x,read:S,write:a,readString:C,writeString:w,times:ee,get:i,slice:o,offset:function(e){return e==null?t:(t=e,T)},skip:function(e){t+=e},toString:function(){throw Error(`FIX CALLER.  BinaryStream is no longer convertible to string!`)},length:function(){return n},saveExcursion:function(e){var n=t;try{return e()}finally{t=n}},writeBase64:function(e){window.atob?w(window.atob(e)):a(Do.decode(e))},base64:function(){return Do.encode(i())}};return T}function ko(e){return e.map(function(e){var t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t}).join(``)}var Ao=class{constructor(e,t){this.definition=t,this.length=t.length,this.offset=t.offset,this.file=e,this.rawData=e.raw,this.parse(e.raw)}raw(){return this.rawData.slice(this.offset,this.length)}parse(){}};(class extends Ao{parse(e){e.offset(this.offset),this.version=e.readLong(),this.revision=e.readLong(),this.checkSumAdjustment=e.readLong(),this.magicNumber=e.readLong(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.read(8),this.modified=e.read(8),this.xMin=e.readShort_(),this.yMin=e.readShort_(),this.xMax=e.readShort_(),this.yMax=e.readShort_(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort_(),this.indexToLocFormat=e.readShort_(),this.glyphDataFormat=e.readShort_()}render(e){var t=Oo();return t.writeLong(this.version),t.writeLong(this.revision),t.writeLong(0),t.writeLong(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.write(this.created),t.write(this.modified),t.writeShort_(this.xMin),t.writeShort_(this.yMin),t.writeShort_(this.xMax),t.writeShort_(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort_(this.fontDirectionHint),t.writeShort_(e),t.writeShort_(this.glyphDataFormat),t.get()}}),class extends Ao{parse(e){e.offset(this.offset),this.file.head.indexToLocFormat===0?this.offsets=e.times(this.length/2,function(){return 2*e.readShort()}):this.offsets=e.times(this.length/4,e.readLong)}offsetOf(e){return this.offsets[e]}lengthOf(e){return this.offsets[e+1]-this.offsets[e]}render(e){for(var t=Oo(),n=e[e.length-1]>65535,r=0;r<e.length;++r)n?t.writeLong(e[r]):t.writeShort(e[r]/2);return{format:+!!n,table:t.get()}}},class extends Ao{parse(e){e.offset(this.offset),this.version=e.readLong(),this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort_(),this.minRightSideBearing=e.readShort_(),this.xMaxExtent=e.readShort_(),this.caretSlopeRise=e.readShort_(),this.caretSlopeRun=e.readShort_(),this.caretOffset=e.readShort_(),e.skip(8),this.metricDataFormat=e.readShort_(),this.numOfLongHorMetrics=e.readShort()}render(e){var t=Oo();return t.writeLong(this.version),t.writeShort_(this.ascent),t.writeShort_(this.descent),t.writeShort_(this.lineGap),t.writeShort(this.advanceWidthMax),t.writeShort_(this.minLeftSideBearing),t.writeShort_(this.minRightSideBearing),t.writeShort_(this.xMaxExtent),t.writeShort_(this.caretSlopeRise),t.writeShort_(this.caretSlopeRun),t.writeShort_(this.caretOffset),t.write([0,0,0,0,0,0,0,0]),t.writeShort_(this.metricDataFormat),t.writeShort(e.length),t.get()}},class extends Ao{parse(e){e.offset(this.offset),this.version=e.readLong(),this.numGlyphs=e.readShort(),this.maxPoints=e.readShort(),this.maxContours=e.readShort(),this.maxComponentPoints=e.readShort(),this.maxComponentContours=e.readShort(),this.maxZones=e.readShort(),this.maxTwilightPoints=e.readShort(),this.maxStorage=e.readShort(),this.maxFunctionDefs=e.readShort(),this.maxInstructionDefs=e.readShort(),this.maxStackElements=e.readShort(),this.maxSizeOfInstructions=e.readShort(),this.maxComponentElements=e.readShort(),this.maxComponentDepth=e.readShort()}render(e){var t=Oo();return t.writeLong(this.version),t.writeShort(e.length),t.writeShort(this.maxPoints),t.writeShort(this.maxContours),t.writeShort(this.maxComponentPoints),t.writeShort(this.maxComponentContours),t.writeShort(this.maxZones),t.writeShort(this.maxTwilightPoints),t.writeShort(this.maxStorage),t.writeShort(this.maxFunctionDefs),t.writeShort(this.maxInstructionDefs),t.writeShort(this.maxStackElements),t.writeShort(this.maxSizeOfInstructions),t.writeShort(this.maxComponentElements),t.writeShort(this.maxComponentDepth),t.get()}},class extends Ao{parse(e){e.offset(this.offset);var t=this.file,n=t.hhea;this.metrics=e.times(n.numOfLongHorMetrics,function(){return{advance:e.readShort(),lsb:e.readShort_()}});var r=t.maxp.numGlyphs-t.hhea.numOfLongHorMetrics;this.leftSideBearings=e.times(r,e.readShort_)}forGlyph(e){var t=this.metrics,n=t.length;return e<n?t[e]:{advance:t[n-1].advance,lsb:this.leftSideBearings[e-n]}}render(e){for(var t=Oo(),n=0;n<e.length;++n){var r=this.forGlyph(e[n]);t.writeShort(r.advance),t.writeShort_(r.lsb)}return t.get()}},(function(){var e=`.notdef .null nonmarkingreturn space exclam quotedbl numbersign dollar percent ampersand quotesingle parenleft parenright asterisk plus comma hyphen period slash zero one two three four five six seven eight nine colon semicolon less equal greater question at A B C D E F G H I J K L M N O P Q R S T U V W X Y Z bracketleft backslash bracketright asciicircum underscore grave a b c d e f g h i j k l m n o p q r s t u v w x y z braceleft bar braceright asciitilde Adieresis Aring Ccedilla Eacute Ntilde Odieresis Udieresis aacute agrave acircumflex adieresis atilde aring ccedilla eacute egrave ecircumflex edieresis iacute igrave icircumflex idieresis ntilde oacute ograve ocircumflex odieresis otilde uacute ugrave ucircumflex udieresis dagger degree cent sterling section bullet paragraph germandbls registered copyright trademark acute dieresis notequal AE Oslash infinity plusminus lessequal greaterequal yen mu partialdiff summation product pi integral ordfeminine ordmasculine Omega ae oslash questiondown exclamdown logicalnot radical florin approxequal Delta guillemotleft guillemotright ellipsis nonbreakingspace Agrave Atilde Otilde OE oe endash emdash quotedblleft quotedblright quoteleft quoteright divide lozenge ydieresis Ydieresis fraction currency guilsinglleft guilsinglright fi fl daggerdbl periodcentered quotesinglbase quotedblbase perthousand Acircumflex Ecircumflex Aacute Edieresis Egrave Iacute Icircumflex Idieresis Igrave Oacute Ocircumflex apple Ograve Uacute Ucircumflex Ugrave dotlessi circumflex tilde macron breve dotaccent ring cedilla hungarumlaut ogonek caron Lslash lslash Scaron scaron Zcaron zcaron brokenbar Eth eth Yacute yacute Thorn thorn minus multiply onesuperior twosuperior threesuperior onehalf onequarter threequarters franc Gbreve gbreve Idotaccent Scedilla scedilla Cacute cacute Ccaron ccaron dcroat`.split(/\s+/g);return class extends Ao{parse(e){e.offset(this.offset),this.format=e.readLong(),this.italicAngle=e.readFixed_(),this.underlinePosition=e.readShort_(),this.underlineThickness=e.readShort_(),this.isFixedPitch=e.readLong(),this.minMemType42=e.readLong(),this.maxMemType42=e.readLong(),this.minMemType1=e.readLong(),this.maxMemType1=e.readLong();var t;switch(this.format){case 65536:case 196608:break;case 131072:t=e.readShort(),this.glyphNameIndex=e.times(t,e.readShort),this.names=[];for(var n=this.offset+this.length;e.offset()<n;)this.names.push(e.readString(e.readByte()));break;case 151552:t=e.readShort(),this.offsets=e.read(t);break;case 262144:this.map=e.times(this.file.maxp.numGlyphs,e.readShort);break}}glyphFor(t){switch(this.format){case 65536:return e[t]||`.notdef`;case 131072:var n=this.glyphNameIndex[t];return n<e.length?e[n]:this.names[n-e.length]||`.notdef`;case 151552:case 196608:return`.notdef`;case 262144:return this.map[t]||65535}}render(t){if(this.format==196608)return this.raw();var n=Oo(this.rawData.slice(this.offset,32));n.writeLong(131072),n.offset(32);for(var r=[],i=[],a=0;a<t.length;++a){var o=t[a],s=this.glyphFor(o),c=e.indexOf(s);c>=0?r.push(c):(r.push(e.length+i.length),i.push(s))}for(n.writeShort(t.length),a=0;a<r.length;++a)n.writeShort(r[a]);for(a=0;a<i.length;++a)n.writeByte(i[a].length),n.writeString(i[a]);return n.get()}}})(),class extends Ao{parse(e){e.offset(this.offset),this.version=e.readShort(),this.averageCharWidth=e.readShort_(),this.weightClass=e.readShort(),this.widthClass=e.readShort(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort_(),this.ySubscriptYSize=e.readShort_(),this.ySubscriptXOffset=e.readShort_(),this.ySubscriptYOffset=e.readShort_(),this.ySuperscriptXSize=e.readShort_(),this.ySuperscriptYSize=e.readShort_(),this.ySuperscriptXOffset=e.readShort_(),this.ySuperscriptYOffset=e.readShort_(),this.yStrikeoutSize=e.readShort_(),this.yStrikeoutPosition=e.readShort_(),this.familyClass=e.readShort_(),this.panose=e.times(10,e.readByte),this.charRange=e.times(4,e.readLong),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort_(),this.descent=e.readShort_(),this.lineGap=e.readShort_(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=e.times(2,e.readLong),this.version>1&&(this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()))}render(){return this.raw()}};function jo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Mo(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)jo(n,r)&&(e[r]=n[r])}}return e}function No(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)}var Po={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o},Buf8:function(e){return new Uint8Array(e)},Buf16:function(e){return new Uint16Array(e)},Buf32:function(e){return new Int32Array(e)}},Fo={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)},Buf8:function(e){return Array(e)},Buf16:function(e){return Array(e)},Buf32:function(e){return Array(e)}};let Io=()=>{let e=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;return Io=()=>e,e},Lo=(e,t,n,r,i)=>(Lo=Io()?Po.arraySet:Fo.arraySet,Lo(e,t,n,r,i)),Ro=e=>(Ro=Io()?Po.flattenChunks:Fo.flattenChunks,Ro(e)),zo=e=>(zo=Io()?Po.Buf8:Fo.Buf8,zo(e)),Bo=e=>(Bo=Io()?Po.Buf16:Fo.Buf16,Bo(e)),Vo=e=>(Vo=Io()?Po.Buf32:Fo.Buf32,Vo(e)),Ho=function(){let e=!0;try{String.fromCharCode.apply(null,[0])}catch{e=!1}return Ho=()=>e,e},Uo=function(){let e=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{e=!1}return Uo=()=>e,e},Wo=function(e){for(var t=zo(256),n=0;n<256;n++)t[n]=n>=252?6:n>=248?5:n>=240?4:n>=224?3:n>=192?2:1;return t[254]=t[254]=1,Wo=e=>t[e],t[e]};function Go(e){var t,n,r,i,a,o=e.length,s=0;for(i=0;i<o;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=0,i=0;a<s;i++)n=e.charCodeAt(i),(n&64512)==55296&&i+1<o&&(r=e.charCodeAt(i+1),(r&64512)==56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[a++]=n:n<2048?(t[a++]=192|n>>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t}function Ko(e,t){if(t<65534&&(e.subarray&&Uo()||!e.subarray&&Ho()))return String.fromCharCode.apply(null,No(e,t));for(var n=``,r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}function qo(e){return Ko(e,e.length)}function Jo(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}function Yo(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}let Xo=function(){let e=Yo();return Xo=()=>e,e};function Zo(e,t,n,r){var i=Xo(),a=r+n;e^=-1;for(var o=r;o<a;o++)e=e>>>8^i[(e^t[o])&255];return e^-1}var Qo={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`};function $o(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}function es(e){for(var t=e.length;--t>=0;)e[t]=0}var ts=0,ns=1,rs=2,is=3,as=258,os=29,ss=256,cs=ss+1+os,ls=30,us=19,ds=2*cs+1,fs=15,ps=16,ms=7,hs=256,gs=16,_s=17,vs=18,ys=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],xs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ss=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Cs=512,ws,Ts,Es,Ds,Os,ks;function As(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var js,Ms,Ns;function Ps(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function Fs(e){return e<256?Es[e]:Es[256+(e>>>7)]}function Is(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Ls(e,t,n){e.bi_valid>ps-n?(e.bi_buf|=t<<e.bi_valid&65535,Is(e,e.bi_buf),e.bi_buf=t>>ps-e.bi_valid,e.bi_valid+=n-ps):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function Rs(e,t,n){Ls(e,n[t*2],n[t*2+1])}function zs(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function Bs(e){e.bi_valid===16?(Is(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function Vs(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=fs;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<ds;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function Hs(e,t,n){var r=Array(fs+1),i=0,a,o;for(a=1;a<=fs;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=zs(r[s]++,s))}}function Us(){var e,t,n,r,i,a=Array(fs+1);for(ws=Array((cs+2)*2),es(ws),Ts=Array(ls*2),es(Ts),Es=Array(Cs),es(Es),Ds=Array(as-is+1),es(Ds),Os=Array(os),es(Os),ks=Array(ls),es(ks),n=0,r=0;r<os-1;r++)for(Os[r]=n,e=0;e<1<<ys[r];e++)Ds[n++]=r;for(Ds[n-1]=r,i=0,r=0;r<16;r++)for(ks[r]=i,e=0;e<1<<bs[r];e++)Es[i++]=r;for(i>>=7;r<ls;r++)for(ks[r]=i<<7,e=0;e<1<<bs[r]-7;e++)Es[256+i++]=r;for(t=0;t<=fs;t++)a[t]=0;for(e=0;e<=143;)ws[e*2+1]=8,e++,a[8]++;for(;e<=255;)ws[e*2+1]=9,e++,a[9]++;for(;e<=279;)ws[e*2+1]=7,e++,a[7]++;for(;e<=287;)ws[e*2+1]=8,e++,a[8]++;for(Hs(ws,cs+1,a),e=0;e<ls;e++)Ts[e*2+1]=5,Ts[e*2]=zs(e,5);js=new As(ws,ys,ss+1,cs,fs),Ms=new As(Ts,bs,0,ls,fs),Ns=new As([],xs,0,us,ms)}function Ws(e){var t;for(t=0;t<cs;t++)e.dyn_ltree[t*2]=0;for(t=0;t<ls;t++)e.dyn_dtree[t*2]=0;for(t=0;t<us;t++)e.bl_tree[t*2]=0;e.dyn_ltree[hs*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function Gs(e){e.bi_valid>8?Is(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Ks(e,t,n,r){Gs(e),r&&(Is(e,n),Is(e,~n)),Lo(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function qs(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function Js(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&qs(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!qs(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function Ys(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?Rs(e,i,t):(o=Ds[i],Rs(e,o+ss+1,t),s=ys[o],s!==0&&(i-=Os[o],Ls(e,i,s)),r--,o=Fs(r),Rs(e,o,n),s=bs[o],s!==0&&(r-=ks[o],Ls(e,r,s)));while(a<e.last_lit);Rs(e,hs,t)}function Xs(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=ds,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)Js(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Js(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,Js(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Vs(e,t),Hs(n,c,e.bl_count)}function Zs(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[_s*2]++:e.bl_tree[vs*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[gs*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function Qs(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do Rs(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(Rs(e,_s,e.bl_tree),Ls(e,s-3,3)):(Rs(e,vs,e.bl_tree),Ls(e,s-11,7)):(a!==i&&(Rs(e,a,e.bl_tree),s--),Rs(e,gs,e.bl_tree),Ls(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function $s(e){var t;for(Zs(e,e.dyn_ltree,e.l_desc.max_code),Zs(e,e.dyn_dtree,e.d_desc.max_code),Xs(e,e.bl_desc),t=us-1;t>=3&&e.bl_tree[Ss[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function ec(e,t,n,r){var i;for(Ls(e,t-257,5),Ls(e,n-1,5),Ls(e,r-4,4),i=0;i<r;i++)Ls(e,e.bl_tree[Ss[i]*2+1],3);Qs(e,e.dyn_ltree,t-1),Qs(e,e.dyn_dtree,n-1)}function tc(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(n=32;n<ss;n++)if(e.dyn_ltree[n*2]!==0)return 1;return 0}var nc=!1;function rc(e){nc||=(Us(),!0),e.l_desc=new Ps(e.dyn_ltree,js),e.d_desc=new Ps(e.dyn_dtree,Ms),e.bl_desc=new Ps(e.bl_tree,Ns),e.bi_buf=0,e.bi_valid=0,Ws(e)}function ic(e,t,n,r){Ls(e,(ts<<1)+ +!!r,3),Ks(e,t,n,!0)}function ac(e){Ls(e,ns<<1,3),Rs(e,hs,ws),Bs(e)}function oc(e,t,n,r){var i,a,o=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=tc(e)),Xs(e,e.l_desc),Xs(e,e.d_desc),o=$s(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?ic(e,t,n,r):e.strategy===4||a===i?(Ls(e,(ns<<1)+ +!!r,3),Ys(e,ws,Ts)):(Ls(e,(rs<<1)+ +!!r,3),ec(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),Ys(e,e.dyn_ltree,e.dyn_dtree)),Ws(e),r&&Gs(e)}function sc(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Ds[n]+ss+1)*2]++,e.dyn_dtree[Fs(t)*2]++),e.last_lit===e.lit_bufsize-1}var cc=9,lc=286,uc=30,dc=19,fc=2*lc+1,pc=15,L=3,mc=258,hc=mc+L+1,gc=32,_c=42,vc=69,yc=73,bc=91,xc=103,Sc=113,Cc=666,wc=1,Tc=2,Ec=3,Dc=4,Oc=3;function kc(e,t){return e.msg=Qo[t],t}function Ac(e){return(e<<1)-(e>4?9:0)}function jc(e){for(var t=e.length;--t>=0;)e[t]=0}function Mc(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Lo(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function Nc(e,t){oc(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Mc(e.strm)}function Pc(e,t){e.pending_buf[e.pending++]=t}function Fc(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function Ic(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,Lo(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=Jo(e.adler,t,i,n):e.state.wrap===2&&(e.adler=Zo(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function Lc(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-hc?e.strstart-(e.w_size-hc):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+mc,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=mc-(f-r),r=f-mc,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function Rc(e){var t=e.w_size,n,r,i,a,o;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-hc)){Lo(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=Ic(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=L)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+L-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<L)););}while(e.lookahead<hc&&e.strm.avail_in!==0)}function zc(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Rc(e),e.lookahead===0&&t===0)return wc;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,Nc(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-hc&&(Nc(e,!1),e.strm.avail_out===0))return wc}return e.insert=0,t===4?(Nc(e,!0),e.strm.avail_out===0?Ec:Dc):(e.strstart>e.block_start&&(Nc(e,!1),e.strm.avail_out),wc)}function Bc(e,t){for(var n,r;;){if(e.lookahead<hc){if(Rc(e),e.lookahead<hc&&t===0)return wc;if(e.lookahead===0)break}if(n=0,e.lookahead>=L&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+L-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-hc&&(e.match_length=Lc(e,n)),e.match_length>=L)if(r=sc(e,e.strstart-e.match_start,e.match_length-L),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=L){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+L-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=sc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Nc(e,!1),e.strm.avail_out===0))return wc}return e.insert=e.strstart<L-1?e.strstart:L-1,t===4?(Nc(e,!0),e.strm.avail_out===0?Ec:Dc):e.last_lit&&(Nc(e,!1),e.strm.avail_out===0)?wc:Tc}function Vc(e,t){for(var n,r,i;;){if(e.lookahead<hc){if(Rc(e),e.lookahead<hc&&t===0)return wc;if(e.lookahead===0)break}if(n=0,e.lookahead>=L&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+L-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=L-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-hc&&(e.match_length=Lc(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===L&&e.strstart-e.match_start>4096)&&(e.match_length=L-1)),e.prev_length>=L&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-L,r=sc(e,e.strstart-1-e.prev_match,e.prev_length-L),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+L-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=L-1,e.strstart++,r&&(Nc(e,!1),e.strm.avail_out===0))return wc}else if(e.match_available){if(r=sc(e,0,e.window[e.strstart-1]),r&&Nc(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return wc}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=sc(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<L-1?e.strstart:L-1,t===4?(Nc(e,!0),e.strm.avail_out===0?Ec:Dc):e.last_lit&&(Nc(e,!1),e.strm.avail_out===0)?wc:Tc}function Hc(e,t){for(var n,r,i,a,o=e.window;;){if(e.lookahead<=mc){if(Rc(e),e.lookahead<=mc&&t===0)return wc;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=L&&e.strstart>0&&(i=e.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){a=e.strstart+mc;do;while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<a);e.match_length=mc-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=L?(n=sc(e,1,e.match_length-L),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=sc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Nc(e,!1),e.strm.avail_out===0))return wc}return e.insert=0,t===4?(Nc(e,!0),e.strm.avail_out===0?Ec:Dc):e.last_lit&&(Nc(e,!1),e.strm.avail_out===0)?wc:Tc}function Uc(e,t){for(var n;;){if(e.lookahead===0&&(Rc(e),e.lookahead===0)){if(t===0)return wc;break}if(e.match_length=0,n=sc(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Nc(e,!1),e.strm.avail_out===0))return wc}return e.insert=0,t===4?(Nc(e,!0),e.strm.avail_out===0?Ec:Dc):e.last_lit&&(Nc(e,!1),e.strm.avail_out===0)?wc:Tc}function Wc(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}let Gc=function(){let e=[new Wc(0,0,0,0,zc),new Wc(4,4,8,4,Bc),new Wc(4,5,16,8,Bc),new Wc(4,6,32,32,Bc),new Wc(4,4,16,16,Vc),new Wc(8,16,32,32,Vc),new Wc(8,16,128,128,Vc),new Wc(8,32,128,256,Vc),new Wc(32,128,258,1024,Vc),new Wc(32,258,258,4096,Vc)];return Gc=()=>e,e};function Kc(e){e.window_size=2*e.w_size,jc(e.head);let t=Gc();e.max_lazy_match=t[e.level].max_lazy,e.good_match=t[e.level].good_length,e.nice_match=t[e.level].nice_length,e.max_chain_length=t[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=L-1,e.match_available=0,e.ins_h=0}function qc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=Bo(fc*2),this.dyn_dtree=Bo((2*uc+1)*2),this.bl_tree=Bo((2*dc+1)*2),jc(this.dyn_ltree),jc(this.dyn_dtree),jc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=Bo(pc+1),this.heap=Bo(2*lc+1),jc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=Bo(2*lc+1),jc(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Jc(e){var t;return!e||!e.state?kc(e,-2):(e.total_in=e.total_out=0,e.data_type=2,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?_c:Sc,e.adler=t.wrap===2?0:1,t.last_flush=0,rc(t),0)}function Yc(e){var t=Jc(e);return t===0&&Kc(e.state),t}function Xc(e,t){return!e||!e.state||e.state.wrap!==2?-2:(e.state.gzhead=t,0)}function Zc(e,t,n,r,i,a){if(!e)return-2;var o=1;if(t===-1&&(t=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>cc||n!==8||r<8||r>15||t<0||t>9||a<0||a>4)return kc(e,-2);r===8&&(r=9);var s=new qc;return e.state=s,s.strm=e,s.wrap=o,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+L-1)/L),s.window=zo(s.w_size*2),s.head=Bo(s.hash_size),s.prev=Bo(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=zo(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=a,s.method=n,Yc(e)}function Qc(e,t){var n,r,i,a;if(!e||!e.state||t>5||t<0)return e?kc(e,-2):-2;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===Cc&&t!==4)return kc(e,e.avail_out===0?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===_c)if(r.wrap===2)e.adler=0,Pc(r,31),Pc(r,139),Pc(r,8),r.gzhead?(Pc(r,+!!r.gzhead.text+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Pc(r,r.gzhead.time&255),Pc(r,r.gzhead.time>>8&255),Pc(r,r.gzhead.time>>16&255),Pc(r,r.gzhead.time>>24&255),Pc(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),Pc(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(Pc(r,r.gzhead.extra.length&255),Pc(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Zo(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=vc):(Pc(r,0),Pc(r,0),Pc(r,0),Pc(r,0),Pc(r,0),Pc(r,r.level===9?2:r.strategy>=2||r.level<2?4:0),Pc(r,Oc),r.status=Sc);else{var o=8+(r.w_bits-8<<4)<<8,s=-1;s=r.strategy>=2||r.level<2?0:r.level<6?1:r.level===6?2:3,o|=s<<6,r.strstart!==0&&(o|=gc),o+=31-o%31,r.status=Sc,Fc(r,o),r.strstart!==0&&(Fc(r,e.adler>>>16),Fc(r,e.adler&65535)),e.adler=1}if(r.status===vc)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),Mc(e),i=r.pending,r.pending===r.pending_buf_size));)Pc(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=yc)}else r.status=yc;if(r.status===yc)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),Mc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.name.length?r.gzhead.name.charCodeAt(r.gzindex++)&255:0,Pc(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=bc)}else r.status=bc;if(r.status===bc)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),Mc(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}a=r.gzindex<r.gzhead.comment.length?r.gzhead.comment.charCodeAt(r.gzindex++)&255:0,Pc(r,a)}while(a!==0);r.gzhead.hcrc&&r.pending>i&&(e.adler=Zo(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=xc)}else r.status=xc;if(r.status===xc&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Mc(e),r.pending+2<=r.pending_buf_size&&(Pc(r,e.adler&255),Pc(r,e.adler>>8&255),e.adler=0,r.status=Sc)):r.status=Sc),r.pending!==0){if(Mc(e),e.avail_out===0)return r.last_flush=-1,0}else if(e.avail_in===0&&Ac(t)<=Ac(n)&&t!==4)return kc(e,-5);if(r.status===Cc&&e.avail_in!==0)return kc(e,-5);if(e.avail_in!==0||r.lookahead!==0||t!==0&&r.status!==Cc){var c=r.strategy===2?Uc(r,t):r.strategy===3?Hc(r,t):Gc()[r.level].func(r,t);if((c===Ec||c===Dc)&&(r.status=Cc),c===wc||c===Ec)return e.avail_out===0&&(r.last_flush=-1),0;if(c===Tc&&(t===1?ac(r):t!==5&&(ic(r,0,0,!1),t===3&&(jc(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),Mc(e),e.avail_out===0))return r.last_flush=-1,0}return t===4?r.wrap<=0?1:(r.wrap===2?(Pc(r,e.adler&255),Pc(r,e.adler>>8&255),Pc(r,e.adler>>16&255),Pc(r,e.adler>>24&255),Pc(r,e.total_in&255),Pc(r,e.total_in>>8&255),Pc(r,e.total_in>>16&255),Pc(r,e.total_in>>24&255)):(Fc(r,e.adler>>>16),Fc(r,e.adler&65535)),Mc(e),r.wrap>0&&(r.wrap=-r.wrap),+(r.pending===0)):0}function $c(e){var t;return!e||!e.state?-2:(t=e.state.status,t!==_c&&t!==vc&&t!==yc&&t!==bc&&t!==xc&&t!==Sc&&t!==Cc?kc(e,-2):(e.state=null,t===Sc?kc(e,-3):0))}function el(e,t){var n=t.length,r,i,a,o,s,c,l,u;if(!e||!e.state||(r=e.state,o=r.wrap,o===2||o===1&&r.status!==_c||r.lookahead))return-2;for(o===1&&(e.adler=Jo(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(o===0&&(jc(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=zo(r.w_size),Lo(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),s=e.avail_in,c=e.next_in,l=e.input,e.avail_in=n,e.next_in=0,e.input=t,Rc(r);r.lookahead>=L;){i=r.strstart,a=r.lookahead-(L-1);do r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+L-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++;while(--a);r.strstart=i,r.lookahead=L-1,Rc(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=L-1,r.match_available=0,e.next_in=c,e.input=l,e.avail_in=s,r.wrap=o,0}var tl=Object.prototype.toString,nl=class{constructor(e){this.options=Mo({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:``},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new $o,this.strm.avail_out=0;var n=Zc(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==0)throw Error(Qo[n]);if(t.header&&Xc(this.strm,t.header),t.dictionary){var r=typeof t.dictionary==`string`?Go(t.dictionary):tl.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary;if(n=el(this.strm,r),n!==0)throw Error(Qo[n]);this._dict_set=!0}}push(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?4:0,typeof e==`string`?n.input=Go(e):tl.call(e)===`[object ArrayBuffer]`?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=zo(r),n.next_out=0,n.avail_out=r),i=Qc(n,a),i!==1&&i!==0)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===4||a===2))&&(this.options.to===`string`?this.onData(qo(No(n.output,n.next_out))):this.onData(No(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==1);return a===4?(i=$c(this.strm),this.onEnd(i),this.ended=!0,i===0):a===2?(this.onEnd(0),n.avail_out=0,!0):!0}onData(e){this.chunks.push(e)}onEnd(e){e===0&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=Ro(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg}};function rl(e,t){var n=new nl(t);if(n.push(e,!0),n.err)throw n.msg||Qo[n.err];return n.result}let il=rl;function al(){return!0}ke.browser;var ol=0;let sl=0;function cl(){var e=0,t=Oo();function n(){for(var e=0;e<arguments.length;++e){var r=arguments[e];if(r===void 0)throw Error(`Cannot output undefined to PDF`);if(r instanceof gl)r.beforeRender(n),r.render(n);else if(fl(r))ml(r,n);else if(pl(r))hl(r,n);else if(typeof r==`number`){if(isNaN(r))throw Error(`Cannot output NaN to PDF`);var i=r.toFixed(7);i.indexOf(`.`)>=0&&(i=i.replace(/\.?0+$/,``)),i==`-0`&&(i=`0`),t.writeString(i)}else/string|boolean/.test(typeof r)?t.writeString(String(r)):typeof r.get==`function`?t.write(r.get()):typeof r==`object`&&(r?n(new bl(r)):t.writeString(`null`))}}return n.writeData=function(e){t.write(e)},n.withIndent=function(t){++e,t(n),--e},n.indent=function(){n(`
`,ll(``,e*2,`  `)),n.apply(null,arguments)},n.offset=function(){return t.offset()},n.toString=function(){throw Error(`FIX CALLER`)},n.get=function(){return t.get()},n.stream=function(){return t},n}function ll(e,t,n){for(;e.length<t;)e=n+e;return e}function ul(e,t){return ll(String(e),t,`0`)}function dl(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var fl=Array.isArray||function(e){return e instanceof Array};function pl(e){return e instanceof Date}function ml(e,t){t(`[`),e.length>0&&t.withIndent(function(){for(var n=0;n<e.length;++n)n>0&&n%8==0?t.indent(e[n]):t(` `,e[n])}),t(` ]`)}function hl(e,t){t(`(D:`,ul(e.getUTCFullYear(),4),ul(e.getUTCMonth()+1,2),ul(e.getUTCDate(),2),ul(e.getUTCHours(),2),ul(e.getUTCMinutes(),2),ul(e.getUTCSeconds(),2),`Z)`)}var gl=class{beforeRender(){}},_l=class extends gl{constructor(e,t){super(),this.value=e,this.utf16be=!!t}render(e){let t=this.value;if(this.utf16be)t=`þÿ`+ht(t),t=t.replace(/([\(\)\\])/g,`\\$1`),e(`(`,t,`)`);else{let r=[40];for(var n=0;n<t.length;++n){let e=t.charCodeAt(n)&255;(e==40||e==41||e==92)&&r.push(92),r.push(e)}r.push(41),e.writeData(r)}}toString(){return this.value}},vl=class extends _l{constructor(e){super(e),this.value=e}render(e){e(`<`);for(var t=0;t<this.value.length;++t)e(ul(this.value.charCodeAt(t).toString(16),4));e(`>`)}},yl=class extends gl{static get(e){return R(e)}constructor(e){super(),this.name=e}render(e){e(`/`+this.escape())}escape(){return this.name.replace(/[^\x21-\x7E]/g,function(e){return`#`+ul(e.charCodeAt(0).toString(16),2)})}toString(){return this.name}};function R(e){return new yl(e)}var bl=class extends gl{constructor(e){super(),this.props=e}render(e){var t=this.props,n=!0;e(`<<`),e.withIndent(function(){for(var r in t)dl(t,r)&&!/^_/.test(r)&&(n=!1,e.indent(R(r),` `,t[r]))}),n||e.indent(),e(`>>`)}},xl=class extends gl{constructor(e,t,n){if(super(),typeof e==`string`){var r=Oo();r.write(e),e=r}this.data=e,this.props=t||{},this.compress=n}render(e){var t=this.data.get(),n=this.props;this.compress&&al()&&(n.Filter?n.Filter instanceof Array||(n.Filter=[n.Filter]):n.Filter=[],n.Filter.unshift(R(`FlateDecode`)),t=il(t)),n.Length=t.length,e(new bl(n),` stream`,`
`),e.writeData(t),e(`
`,`endstream`)}};(class extends bl{constructor(){super({Type:R(`Catalog`)})}setPages(e){this.props.Pages=e}}),class extends bl{constructor(){super({Type:R(`Pages`),Kids:[],Count:0})}addPage(e){this.props.Kids.push(e),this.props.Count++}},class extends bl{constructor(e,t,n){let{width:r,height:i}=e.size(),a=new jl(t._pdf,{});a._content=new xl(cl(),null,!0),n(e,a,{}),t._xResources=Object.assign(t._xResources,a._xResources),t._fontResources=Object.assign(t._fontResources,a._fontResources),t._gsResources=Object.assign(t._gsResources,a._gsResources),super({Type:R(`Pattern`),PatternType:1,PaintType:1,TilingType:1,BBox:[0,0,r,i],XStep:r,YStep:i,Matrix:[1,0,0,-1,0,i],Resources:{ExtGState:new bl(a._gsResources),XObject:new bl(a._xResources),Font:new bl(a._fontResources)}}),this._resourceName=R(`P`+ ++sl),this.data=a._content.data,this.compress=!0}render(e){xl.prototype.render.call(this,e)}},class extends bl{constructor(e){super({Type:R(`Font`),Subtype:R(`Type1`),BaseFont:R(e)}),this._resourceName=R(`F`+ ++ol)}encodeText(e){return new _l(String(e))}};var Sl=class extends bl{constructor(e,t,n){super({}),n=this.props,n.Type=R(`Font`),n.Subtype=R(`Type0`),n.Encoding=R(`Identity-H`),this._pdf=e,this._font=t,this._sub=t.makeSubset(),this._resourceName=R(`F`+ ++ol);var r=t.head;this.name=t.psName;var i=this.scale=t.scale;this.bbox=[r.xMin*i,r.yMin*i,r.xMax*i,r.yMax*i],this.italicAngle=t.post.italicAngle,this.ascent=t.ascent*i,this.descent=t.descent*i,this.lineGap=t.lineGap*i,this.capHeight=t.os2.capHeight||this.ascent,this.xHeight=t.os2.xHeight||0,this.stemV=0,this.familyClass=(t.os2.familyClass||0)>>8,this.isSerif=this.familyClass>=1&&this.familyClass<=7,this.isScript=this.familyClass==10,this.flags=!!t.post.isFixedPitch|(this.isSerif?2:0)|(this.isScript?8:0)|(this.italicAngle===0?0:64)|32}encodeText(e){return new vl(this._sub.encodeText(String(e)))}getTextWidth(e,t){for(var n=0,r=this._font.cmap.codeMap,i=0;i<t.length;++i){var a=r[t.charCodeAt(i)];n+=this._font.widthOfGlyph(a||0)}return n*e/1e3}beforeRender(){var e=this,t=e._sub,n=t.render(),r=new xl(Oo(n),{Length1:n.length},!0),i=e._pdf.attach(new bl({Type:R(`FontDescriptor`),FontName:R(e._sub.psName),FontBBox:e.bbox,Flags:e.flags,StemV:e.stemV,ItalicAngle:e.italicAngle,Ascent:e.ascent,Descent:e.descent,CapHeight:e.capHeight,XHeight:e.xHeight,FontFile2:e._pdf.attach(r)})),a=t.ncid2ogid,o=t.firstChar,s=t.lastChar,c=[];(function t(n,r){if(n<=s){var i=a[n];i==null?t(n+1):(r||c.push(n,r=[]),r.push(e._font.widthOfGlyph(i)),t(n+1,r))}})(o);var l=new bl({Type:R(`Font`),Subtype:R(`CIDFontType2`),BaseFont:R(e._sub.psName),CIDSystemInfo:new bl({Registry:new _l(`Adobe`),Ordering:new _l(`Identity`),Supplement:0}),FontDescriptor:i,FirstChar:o,LastChar:s,DW:Math.round(e._font.widthOfGlyph(0)),W:c,CIDToGIDMap:e._pdf.attach(e._makeCidToGidMap())}),u=e.props;u.BaseFont=R(e._sub.psName),u.DescendantFonts=[e._pdf.attach(l)];var d=new Cl(o,s,t.subset),f=new xl(cl(),null,!0);f.data(d),u.ToUnicode=e._pdf.attach(f)}_makeCidToGidMap(){return new xl(Oo(this._sub.cidToGidMap()),null,!0)}},Cl=class extends gl{constructor(e,t,n){super(),this.firstChar=e,this.lastChar=t,this.map=n}render(e){e.indent(`/CIDInit /ProcSet findresource begin`),e.indent(`12 dict begin`),e.indent(`begincmap`),e.indent(`/CIDSystemInfo <<`),e.indent(`  /Registry (Adobe)`),e.indent(`  /Ordering (UCS)`),e.indent(`  /Supplement 0`),e.indent(`>> def`),e.indent(`/CMapName /Adobe-Identity-UCS def`),e.indent(`/CMapType 2 def`),e.indent(`1 begincodespacerange`),e.indent(`  <0000><ffff>`),e.indent(`endcodespacerange`);var t=this;e.indent(t.lastChar-t.firstChar+1,` beginbfchar`),e.withIndent(function(){for(var n=t.firstChar;n<=t.lastChar;++n){var r=t.map[n],i=ko([r]);e.indent(`<`,ul(n.toString(16),4),`>`,`<`);for(var a=0;a<i.length;++a)e(ul(i.charCodeAt(a).toString(16),4));e(`>`)}}),e.indent(`endbfchar`),e.indent(`endcmap`),e.indent(`CMapName currentdict /CMap defineresource pop`),e.indent(`end`),e.indent(`end`)}};function wl(e){return e.map(function(e){return fl(e)?wl(e):typeof e==`number`?(Math.round(e*1e3)/1e3).toFixed(3):e}).join(` `)}function Tl(e,t,n,r,i,a,o){var s=wl([t,n,r,i,a,o]),c=e.GRAD_COL_FUNCTIONS[s];return c||=e.GRAD_COL_FUNCTIONS[s]=e.attach(new bl({FunctionType:2,Domain:[0,1],Range:[0,1,0,1,0,1],N:1,C0:[t,n,r],C1:[i,a,o]})),c}function El(e,t,n){var r=wl([t,n]),i=e.GRAD_OPC_FUNCTIONS[r];return i||=e.GRAD_OPC_FUNCTIONS[r]=e.attach(new bl({FunctionType:2,Domain:[0,1],Range:[0,1],N:1,C0:[t],C1:[n]})),i}function Dl(e,t){var n=!1,r=[],i=[],a=[],o=[],s,c,l,u,d;for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,i.push(Tl(e,u.r,u.g,u.b,d.r,d.g,d.b)),(u.a<1||d.a<1)&&(n=!0),a.push(l.offset),o.push(0,1);if(n)for(s=1;s<t.length;++s)c=t[s-1],l=t[s],u=c.color,d=l.color,r.push(El(e,u.a,d.a));return a.pop(),{hasAlpha:n,colors:f(i),opacities:n?f(r):null};function f(e){return e.length==1?e[0]:{FunctionType:3,Functions:e,Domain:[0,1],Bounds:a,Encode:o}}}function Ol(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.r,e.color.g,e.color.b)}),s=wl(c),o=e.GRAD_COL[s]}return o||(o=new bl({Type:R(`Shading`),ShadingType:t?3:2,ColorSpace:R(`DeviceRGB`),Coords:r,Domain:[0,1],Function:i,Extend:[!0,!0]}),e.attach(o),o._resourceName=`S`+ ++ol,s&&(e.GRAD_COL[s]=o)),o}function kl(e,t,n,r,i,a){var o,s;if(!a){var c=[t].concat(r);n.forEach(function(e){c.push(e.offset,e.color.a)}),s=wl(c),o=e.GRAD_OPC[s]}return o||(o=new bl({Type:R(`ExtGState`),AIS:!1,CA:1,ca:1,SMask:{Type:R(`Mask`),S:R(`Luminosity`),G:e.attach(new xl(`/a0 gs /s0 sh`,{Type:R(`XObject`),Subtype:R(`Form`),FormType:1,BBox:a?[a.left,a.top+a.height,a.left+a.width,a.top]:[0,1,1,0],Group:{Type:R(`Group`),S:R(`Transparency`),CS:R(`DeviceGray`),I:!0},Resources:{ExtGState:{a0:{CA:1,ca:1}},Shading:{s0:{ColorSpace:R(`DeviceGray`),Coords:r,Domain:[0,1],ShadingType:t?3:2,Function:i,Extend:[!0,!0]}}}}))}}),e.attach(o),o._resourceName=`O`+ ++ol,s&&(e.GRAD_OPC[s]=o)),o}function Al(e,t,n){var r=t.type==`radial`,i=Dl(e,t.stops),a=r?[t.start.x,t.start.y,t.start.r,t.end.x,t.end.y,t.end.r]:[t.start.x,t.start.y,t.end.x,t.end.y],o=Ol(e,r,t.stops,a,i.colors,t.userSpace&&n),s=i.hasAlpha?kl(e,r,t.stops,a,i.opacities,t.userSpace&&n):null;return{hasAlpha:i.hasAlpha,shading:o,opacity:s}}var jl=class extends bl{constructor(e,t){super(t),this._pdf=e,this._rcount=0,this._textMode=!1,this._fontResources={},this._gsResources={},this._xResources={},this._patResources={},this._shResources={},this._opacity=1,this._matrix=[1,0,0,1,0,0],this._annotations=[],this._font=null,this._fontSize=null,this._contextStack=[],t=this.props,t.Type=R(`Page`),t.ProcSet=[R(`PDF`),R(`Text`),R(`ImageB`),R(`ImageC`),R(`ImageI`)],t.Resources=new bl({Font:new bl(this._fontResources),ExtGState:new bl(this._gsResources),XObject:new bl(this._xResources),Pattern:new bl(this._patResources),Shading:new bl(this._shResources)}),t.Annots=this._annotations}_out(){this._content.data.apply(null,arguments)}transform(e,t,n,r,i,a){zl(arguments)||(this._matrix=Rl(arguments,this._matrix),this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` cm`),this._out(`
`))}translate(e,t){this.transform(1,0,0,1,e,t)}scale(e,t){this.transform(e,0,0,t,0,0)}rotate(e){var t=Math.cos(e),n=Math.sin(e);this.transform(t,n,-n,t,0,0)}beginText(){this._textMode=!0,this._out(`BT`,`
`)}endText(){this._textMode=!1,this._out(`ET`,`
`)}_requireTextMode(){if(!this._textMode)throw Error(`Text mode required; call page.beginText() first`)}_requireFont(){if(!this._font)throw Error(`No font selected; call page.setFont() first`)}setFont(e,t){this._requireTextMode(),e==null?e=this._font:e instanceof Sl||(e=this._pdf.getFont(e)),t??=this._fontSize,this._fontResources[e._resourceName]=e,this._font=e,this._fontSize=t,this._out(e._resourceName,` `,t,` Tf`,`
`)}setTextLeading(e){this._requireTextMode(),this._out(e,` TL`,`
`)}setTextRenderingMode(e){this._requireTextMode(),this._out(e,` Tr`,`
`)}showText(e,t){if(this._requireFont(),e.length>1&&t&&this._font instanceof Sl){var n=t/this._font.getTextWidth(this._fontSize,e)*100;this._out(n,` Tz `)}this._out(this._font.encodeText(e),` Tj`,`
`)}showTextNL(e){this._requireFont(),this._out(this._font.encodeText(e),` '`,`
`)}addLink(e,t){var n=this._toPage({x:t.left,y:t.bottom}),r=this._toPage({x:t.right,y:t.top});this._annotations.push(new bl({Type:R(`Annot`),Subtype:R(`Link`),Rect:[n.x,n.y,r.x,r.y],Border:[0,0,0],A:new bl({Type:R(`Action`),S:R(`URI`),URI:new _l(e)})}))}setStrokeColor(e,t,n){this._out(e,` `,t,` `,n,` RG`,`
`)}setOpacity(e){this.setFillOpacity(e),this.setStrokeOpacity(e),this._opacity*=e}setStrokeOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!0);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}setFillColor(e,t,n){this._out(e,` `,t,` `,n,` rg`,`
`)}pattern(e,t,n){let r=this._pdf.getPattern(e,this,n);this._patResources[r._resourceName]=r,this._out(`/Pattern cs`,`
`),this._out(r._resourceName,` scn`,`
`),this.rect(t.left,t.top,t.width,t.height),this.fill()}setFillOpacity(e){if(e<1){var t=this._pdf.getOpacityGS(this._opacity*e,!1);this._gsResources[t._resourceName]=t,this._out(t._resourceName,` gs`,`
`)}}gradient(e,t){this.save(),this.rect(t.left,t.top,t.width,t.height),this.clip(),e.userSpace||this.transform(t.width,0,0,t.height,t.left,t.top);var n=Al(this._pdf,e,t),r=n.shading._resourceName,i;this._shResources[r]=n.shading,n.hasAlpha&&(i=n.opacity._resourceName,this._gsResources[i]=n.opacity,this._out(`/`+i+` gs `)),this._out(`/`+r+` sh`,`
`),this.restore()}setDashPattern(e,t){this._out(e,` `,t,` d`,`
`)}setLineWidth(e){this._out(e,` w`,`
`)}setLineCap(e){this._out(e,` J`,`
`)}setLineJoin(e){this._out(e,` j`,`
`)}setMitterLimit(e){this._out(e,` M`,`
`)}save(){this._contextStack.push(this._context()),this._out(`q`,`
`)}restore(){this._out(`Q`,`
`),this._context(this._contextStack.pop())}moveTo(e,t){this._out(e,` `,t,` m`,`
`)}lineTo(e,t){this._out(e,` `,t,` l`,`
`)}bezier(e,t,n,r,i,a){this._out(e,` `,t,` `,n,` `,r,` `,i,` `,a,` c`,`
`)}bezier1(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` y`,`
`)}bezier2(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` v`,`
`)}close(){this._out(`h`,`
`)}rect(e,t,n,r){this._out(e,` `,t,` `,n,` `,r,` re`,`
`)}ellipse(e,t,n,r){function i(t){return e+t}function a(e){return t+e}var o=.5522847498307936;this.moveTo(i(0),a(r)),this.bezier(i(n*o),a(r),i(n),a(r*o),i(n),a(0)),this.bezier(i(n),a(-r*o),i(n*o),a(-r),i(0),a(-r)),this.bezier(i(-n*o),a(-r),i(-n),a(-r*o),i(-n),a(0)),this.bezier(i(-n),a(r*o),i(-n*o),a(r),i(0),a(r))}circle(e,t,n){this.ellipse(e,t,n,n)}stroke(){this._out(`S`,`
`)}nop(){this._out(`n`,`
`)}clip(){this._out(`W n`,`
`)}clipStroke(){this._out(`W S`,`
`)}closeStroke(){this._out(`s`,`
`)}fill(){this._out(`f`,`
`)}fillStroke(){this._out(`B`,`
`)}drawImage(e){var t=this._pdf.getImage(e);t&&(this._xResources[t._resourceName]=t,this._out(t._resourceName,` Do`,`
`))}comment(e){var t=this;e.split(/\r?\n/g).forEach(function(e){t._out(`% `,e,`
`)})}_context(e){if(e!=null)this._opacity=e.opacity,this._matrix=e.matrix;else return{opacity:this._opacity,matrix:this._matrix}}_toPage(e){var t=this._matrix,n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5];return{x:n*e.x+i*e.y+o,y:r*e.x+a*e.y+s}}};function Ml(e){return e.replace(/^\s*(['"])(.*)\1\s*$/,`$2`)}function Nl(e){var t=/^\s*((normal|italic)\s+)?(([a-z0-9-]+)\s+)?((normal|bold|\d+)\s+)?(([0-9.]+)(px|pt))(\/(([0-9.]+)(px|pt)|normal))?\s+(.*?)\s*$/i.exec(e);if(!t)return{fontSize:12,fontFamily:`sans-serif`};var n=t[8]?parseInt(t[8],10):12;return{italic:t[2]&&t[2].toLowerCase()==`italic`,variant:t[4],bold:t[6]&&/bold|[6789]00/i.test(t[6]),fontSize:n,lineHeight:t[12]?t[12]==`normal`?n:parseInt(t[12],10):null,fontFamily:t[14].split(/\s*,\s*/g).map(Ml)}}function Pl(e){function t(t){return e.bold&&(t+=`|bold`),e.italic&&(t+=`|italic`),t.toLowerCase()}var n=e.fontFamily,r,i;if(n instanceof Array)for(var a=0;a<n.length&&(r=t(n[a]),i=Fl[r],!i);++a);else i=Fl[n.toLowerCase()];for(;typeof i==`function`;)i=i();return i||=`Times-Roman`,i}var Fl={serif:`Times-Roman`,"serif|bold":`Times-Bold`,"serif|italic":`Times-Italic`,"serif|bold|italic":`Times-BoldItalic`,"sans-serif":`Helvetica`,"sans-serif|bold":`Helvetica-Bold`,"sans-serif|italic":`Helvetica-Oblique`,"sans-serif|bold|italic":`Helvetica-BoldOblique`,monospace:`Courier`,"monospace|bold":`Courier-Bold`,"monospace|italic":`Courier-Oblique`,"monospace|bold|italic":`Courier-BoldOblique`,zapfdingbats:`ZapfDingbats`,"zapfdingbats|bold":`ZapfDingbats`,"zapfdingbats|italic":`ZapfDingbats`,"zapfdingbats|bold|italic":`ZapfDingbats`};function Il(e,t){e=e.toLowerCase(),Fl[e]=function(){return Fl[t]},Fl[e+`|bold`]=function(){return Fl[t+`|bold`]},Fl[e+`|italic`]=function(){return Fl[t+`|italic`]},Fl[e+`|bold|italic`]=function(){return Fl[t+`|bold|italic`]}}Il(`Times New Roman`,`serif`),Il(`Courier New`,`monospace`),Il(`Arial`,`sans-serif`),Il(`Helvetica`,`sans-serif`),Il(`Verdana`,`sans-serif`),Il(`Tahoma`,`sans-serif`),Il(`Georgia`,`sans-serif`),Il(`Monaco`,`monospace`),Il(`Andale Mono`,`monospace`);function Ll(e,t){if(arguments.length==1)for(var n in e)dl(e,n)&&Ll(n,e[n]);else switch(e=e.toLowerCase(),Fl[e]=t,e){case`dejavu sans`:Fl[`sans-serif`]=t;break;case`dejavu sans|bold`:Fl[`sans-serif|bold`]=t;break;case`dejavu sans|italic`:Fl[`sans-serif|italic`]=t;break;case`dejavu sans|bold|italic`:Fl[`sans-serif|bold|italic`]=t;break;case`dejavu serif`:Fl.serif=t;break;case`dejavu serif|bold`:Fl[`serif|bold`]=t;break;case`dejavu serif|italic`:Fl[`serif|italic`]=t;break;case`dejavu serif|bold|italic`:Fl[`serif|bold|italic`]=t;break;case`dejavu mono`:Fl.monospace=t;break;case`dejavu mono|bold`:Fl[`monospace|bold`]=t;break;case`dejavu mono|italic`:Fl[`monospace|italic`]=t;break;case`dejavu mono|bold|italic`:Fl[`monospace|bold|italic`]=t;break}}function Rl(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}function zl(e){return e[0]===1&&e[1]===0&&e[2]===0&&e[3]===1&&e[4]===0&&e[5]===0}let Bl={fill:0,stroke:1,fillAndStroke:2,invisible:3,fillAndClip:4,strokeAndClip:5,fillStrokeClip:6,clip:7},Vl={dash:[4],dashDot:[4,2,1,2],dot:[1,2],longDash:[8,2],longDashDot:[8,2,1,2],longDashDotDot:[8,2,1,2,1,2],solid:[]},Hl={butt:0,round:1,square:2},Ul={miter:0,round:1,bevel:2};function Wl(e,t){var n=e[t.nodeType];return n?n.call.apply(n,arguments):t}function Gl(e,t,n){e.options._pdfDebug&&t.comment(`BEGIN: `+e.options._pdfDebug);var r=e.transform(),i=e.opacity();if(t.save(),i!=null&&i<1&&t.setOpacity(i),Kl(e,t,n),ql(e,t,n),r){var a=r.matrix();t.transform(a.a,a.b,a.c,a.d,a.e,a.f)}Jl(e,t,n),Wl({Path:tu,MultiPath:nu,Circle:ru,Arc:iu,Text:au,Image:cu,Group:su,Rect:lu},e,t,n),t.restore(),e.options._pdfDebug&&t.comment(`END: `+e.options._pdfDebug)}function Kl(e,t){var n=e.stroke&&e.stroke();if(n){var r=n.color;if(r){if(r=uu(r),r==null)return;t.setStrokeColor(r.r,r.g,r.b),r.a!=1&&t.setStrokeOpacity(r.a)}var i=n.width;if(i!=null){if(i===0)return;t.setLineWidth(i)}var a=n.dashType;a&&t.setDashPattern(Vl[a],0);var o=n.lineCap;o&&t.setLineCap(Hl[o]);var s=n.lineJoin;s&&t.setLineJoin(Ul[s]);var c=n.opacity;c!=null&&t.setStrokeOpacity(c)}}function ql(e,t){var n=e.fill&&e.fill();if(n&&!(n instanceof yi||n instanceof Di)){var r=n.color;if(r){if(r=uu(r),r==null)return;t.setFillColor(r.r,r.g,r.b),r.a!=1&&t.setFillOpacity(r.a)}var i=n.opacity;i!=null&&t.setFillOpacity(i)}}function Jl(e,t,n){var r=e.clip();r&&(eu(r,t,n),t.clip())}function Yl(e){return e&&(e instanceof yi||e instanceof Di||e.color&&!/^(none|transparent)$/i.test(e.color)&&(e.width==null||e.width>0)&&(e.opacity==null||e.opacity>0))}function Xl(e,t,n,r){var i=e.fill();if(i instanceof yi){r?t.clipStroke():t.clip();var a=i instanceof Si,o,s;a?(o={x:i.center().x,y:i.center().y,r:0},s={x:i.center().x,y:i.center().y,r:i.radius()}):(o={x:i.start().x,y:i.start().y},s={x:i.end().x,y:i.end().y});var c=i.stops.elements().map(function(e){var t=e.offset();t=/%$/.test(t)?parseFloat(t)/100:parseFloat(t);var n=uu(e.color());return n.a*=e.opacity(),{offset:t,color:n}});c.unshift(c[0]),c.push(c[c.length-1]);var l={userSpace:i.userSpace(),type:a?`radial`:`linear`,start:o,end:s,stops:c},u=e.rawBBox(),d=u.topLeft(),f=u.getSize();return u={left:d.x,top:d.y,width:f.width,height:f.height},t.gradient(l,u),!0}}function Zl(e,t,n,r){let i=e.fill();if(i instanceof Di){r?t.clipStroke():t.clip();let n=e.rawBBox(),a=n.topLeft(),o=n.getSize(),s=e.stroke()?e.stroke().width:0;return t.pattern(i,{left:a.x+s/2,top:a.y+s/2,width:o.width-s,height:o.height-s},ou),!0}}function Ql(e,t,n){Yl(e.fill())&&Yl(e.stroke())?!Xl(e,t,n,!0)&&!Zl(e,t,n,!0)&&t.fillStroke():Yl(e.fill())?!Xl(e,t,n,!1)&&!Zl(e,t,n,!1)&&t.fill():Yl(e.stroke())?t.stroke():t.nop()}function $l(e,t){var n=e.segments;if(n.length==4&&e.options.closed){for(var r=[],i=0;i<n.length;++i){if(n[i].controlIn())return!1;r[i]=n[i].anchor()}if(r[0].y==r[1].y&&r[1].x==r[2].x&&r[2].y==r[3].y&&r[3].x==r[0].x||r[0].x==r[1].x&&r[1].y==r[2].y&&r[2].x==r[3].x&&r[3].y==r[0].y)return t.rect(r[0].x,r[0].y,r[2].x-r[0].x,r[2].y-r[0].y),!0}}function eu(e,t,n){var r=e.segments;if(r.length!==0&&!$l(e,t,n)){for(var i,a=0;a<r.length;++a){var o=r[a],s=o.anchor();if(!i)t.moveTo(s.x,s.y);else{var c=i.controlOut(),l=o.controlIn();c&&l?t.bezier(c.x,c.y,l.x,l.y,s.x,s.y):t.lineTo(s.x,s.y)}i=o}e.options.closed&&t.close()}}function tu(e,t,n){eu(e,t,n),Ql(e,t,n)}function nu(e,t,n){for(var r=e.paths,i=0;i<r.length;++i)eu(r[i],t,n);Ql(e,t,n)}function ru(e,t,n){var r=e.geometry();t.circle(r.center.x,r.center.y,r.radius),Ql(e,t,n)}function iu(e,t,n){var r=e.geometry().curvePoints();t.moveTo(r[0].x,r[0].y);for(var i=1;i<r.length;)t.bezier(r[i].x,r[i++].y,r[i].x,r[i++].y,r[i].x,r[i++].y);Ql(e,t,n)}function au(e,t){var n=Nl(e.options.font),r=e._position,i;t.transform(1,0,0,-1,r.x,r.y+n.fontSize);let a=r=>{t.beginText(),t.setFont(Pl(n),n.fontSize),t.setTextRenderingMode(r),t.showText(e.content(),e._pdfRect?e._pdfRect.width():null)};e.fill()&&e.stroke()?(i=Bl.fillAndStroke,e.options.paintOrder===`stroke`&&(a(Bl.stroke),i=Bl.fill)):e.fill()?i=Bl.fill:e.stroke()&&(i=Bl.stroke),a(i),t.endText()}function ou(e,t,n){for(var r=e.children,i=0;i<r.length;++i)Gl(r[i],t,n)}function su(e,t,n){e._pdfLink&&t.addLink(e._pdfLink.url,e._pdfLink);for(var r=e.children,i=0;i<r.length;++i)Gl(r[i],t,n)}function cu(e,t){var n=e.src();if(n){var r=e.rect(),i=r.getOrigin(),a=r.getSize();t.transform(a.width,0,0,-a.height,i.x,i.y+a.height),t.drawImage(n)}}function lu(e,t,n){var r=e.geometry();let[i,a]=r.cornerRadius;i===0&&a===0?(t.rect(r.origin.x,r.origin.y,r.size.width,r.size.height),Ql(e,t,n)):tu(F.fromRect(r,e.options),t,n)}function uu(e){var t=Ue(e,!0);return t?t.toRGB():null}let du=ke.browser||{};function fu(e){return Array.prototype.slice.call(e)}var pu=`KENDO-PSEUDO-ELEMENT`;let mu=`data-kendo-bullet-type`;var hu={},z={};z._root=z;let gu=typeof window<`u`?du.msie||du.edge:!1;var _u=class extends Wr{constructor(e,t,n){super(e,t.getOrigin(),n),this._pdfRect=t}rect(){return this._pdfRect}rawBBox(){return this._pdfRect}},vu=typeof Element<`u`&&Element.prototype&&(function(e){return e.matches?function(e,t){return e.matches(t)}:e.webkitMatchesSelector?function(e,t){return e.webkitMatchesSelector(t)}:e.mozMatchesSelector?function(e,t){return e.mozMatchesSelector(t)}:e.msMatchesSelector?function(e,t){return e.msMatchesSelector(t)}:function(e){return[].indexOf.call(document.querySelectorAll(e),this)!==-1}})(Element.prototype);(function(e){return e?function t(n){var r=n.cloneNode(!1);if(n.nodeType==1){var i=e(n),a=e(r),o,s=i.data();for(o in s)a.data(o,s[o]);for(/^canvas$/i.test(n.tagName)?r.getContext(`2d`).drawImage(n,0,0):/^(?:input|select|textarea|option)$/i.test(n.tagName)?(r.removeAttribute(`id`),r.removeAttribute(`name`),/^textarea$/i.test(n.tagName)||(r.value=n.value),r.checked=n.checked,r.selected=n.selected):/^img$/i.test(n.tagName)&&r.removeAttribute(`loading`),n._kendoExportVisual&&(r._kendoExportVisual=n._kendoExportVisual),o=n.firstChild;o;o=o.nextSibling)r.appendChild(t(o))}return r}:function(e){let t=(function e(t){let n=t.cloneNode(!1);t._kendoExportVisual&&(n._kendoExportVisual=t._kendoExportVisual);for(let r=t.firstChild;r;r=r.nextSibling)n.appendChild(e(r));return n})(e),n=e.querySelectorAll(`canvas`);n.length&&fu(t.querySelectorAll(`canvas`)).forEach((e,t)=>{e.getContext(`2d`).drawImage(n[t],0,0)});let r=e.querySelectorAll(`input, select, textarea, option`);return fu(t.querySelectorAll(`input, select, textarea, option`)).forEach((e,t)=>{e.removeAttribute(`id`),e.removeAttribute(`name`),/^textarea$/i.test(e.tagName)||(e.value=r[t].value),e.checked=r[t].checked,e.selected=r[t].selected}),fu(t.querySelectorAll(`img`)).forEach(e=>{e.removeAttribute(`loading`)}),t}})(typeof window<`u`&&window.kendo&&window.kendo.jQuery);var yu=(function(){var e=/^((-webkit-|-moz-|-o-|-ms-)?linear-gradient\s*)\(/,t=/^([-0-9.]+%)/,n=/^([-0-9.]+px)/,r=/^(left|right|top|bottom|to|center)\W/,i=/^([-0-9.]+(deg|grad|rad|turn)|0)/,a=/^(\s+)/,o=/^(\()/,s=/^(\))/,c=/^(,)/,l=/^(url)\(/,u=/^(.*?)\)/,d={},f={};function p(f){var p=f;if(Su(d,p))return d[p];function m(){var e=a.exec(f);e&&(f=f.substr(e[1].length))}function h(e){m();var t=e.exec(f);if(t)return f=f.substr(t[1].length),t[1]}function g(){var e=Ue(f,!0),r,i;if(e){let a=/^#[0-9a-f]+/i.exec(f)||/^rgba?\(.*?\)/i.exec(f)||/^..*?\b/.exec(f);return f=f.substr(a[0].length),e=e.toRGB(),(r=h(n))||(i=h(t)),{color:e,length:r,percent:i}}}function _(e){var n,a,l,u=[],d=!1;if(h(o)){if(n=h(i),n==`0`&&(n=`0deg`),n?(n=Gu(n),h(c)):(a=h(r),a==`to`?a=h(r):a&&/^-/.test(e)&&(d=!0),l=h(r),h(c)),/-moz-/.test(e)&&n==null&&a==null){var p=h(t),m=h(t);d=!0,p==`0%`?a=`left`:p==`100%`&&(a=`right`),m==`0%`?l=`top`:m==`100%`&&(l=`bottom`),h(c)}for(;f&&!h(s);){var _=g();if(!_)break;u.push(_),h(c)}return{type:`linear`,angle:n,to:a&&l?a+` `+l:a||l||null,stops:u,reverse:d}}}function v(){if(h(o)){var e=h(u);return e=e.replace(/^['"]+|["']+$/g,``),h(s),{type:`url`,url:e}}}var y;return(y=h(e))?y=_(y):(y=h(l))&&(y=v()),d[p]=y||{type:`none`}}return function(e){return Su(f,e)?f[e]:f[e]=bu(e).map(p)}})(),bu=(function(){var e={};return function(t,n){n||=/^\s*,\s*/;var r=t+n;if(Su(e,r))return e[r];var i=[],a=0,o=0,s=0,c=!1,l;function u(e){return l=e.exec(t.substr(o))}function d(e){return e.replace(/^\s+|\s+$/g,``)}for(;o<t.length;)!c&&u(/^[\(\[\{]/)?(s++,o++):!c&&u(/^[\)\]\}]/)?(s--,o++):!c&&u(/^[\"\']/)?(c=l[0],o++):c==`'`&&u(/^\\\'/)||c==`"`&&u(/^\\\"/)?o+=2:c==`'`&&u(/^\'/)||c==`"`&&u(/^\"/)?(c=!1,o++):u(n)?(!c&&!s&&o>a&&(i.push(d(t.substring(a,o))),a=o+l[0].length),o+=l[0].length):o++;return a<o&&i.push(d(t.substring(a,o))),e[r]=i}})(),xu=(function(e){return function(t){var n=e[t];return n??=e[t]=Xt(`Mapq`,{font:t}).height,n}})(Object.create(null));function Su(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Cu(e){return e=`_counter_`+e,z[e]}function wu(e){var t=[],n=z;for(e=`_counter_`+e;n;)Su(n,e)&&t.push(n[e]),n=Object.getPrototypeOf(n);return t.reverse()}function Tu(e,t){var n=z;for(e=`_counter_`+e;n&&!Su(n,e);)n=Object.getPrototypeOf(n);n||=z._root,n[e]=(n[e]||0)+(t??1)}function Eu(e,t){e=`_counter_`+e,z[e]=t??0}function Du(e,t,n){for(var r=0;r<e.length;){var i=e[r++],a=parseFloat(e[r]);isNaN(a)?t(i,n):(t(i,a),++r)}}function Ou(e){var t=B(e,`counter-reset`);t&&Du(bu(t,/^\s+/),Eu,0);var n=B(e,`counter-increment`);n&&Du(bu(n,/^\s+/),Tu,1)}function ku(e,t){var n=Ue(e,!0);return n&&(n=n.toRGB(),t?n=n.toCssRgba():n.a===0&&(n=null)),n}function Au(e){var t=``;do{var n=e%26;t=String.fromCharCode(97+n)+t,e=Math.floor(e/26)}while(e>0);return t}function ju(e,t,n){z=Object.create(z),z[e.tagName.toLowerCase()]={element:e,style:t};let r=B(t,`text-decoration`);if(r&&r!=`none`){let n=qe(e,`text-decoration-color`);r.split(/\s+/g).forEach(function(e){if(!z[e]&&(z[e]=n,e==`underline`)){let e=B(t,`text-underline-offset`);e!=`auto`&&(z[`underline-offset`]=parseFloat(e))}})}Fu(t)&&(z._stackingContext={element:e,group:n})}function Mu(){z=Object.getPrototypeOf(z)}function Nu(e){if(z._clipbox!=null){var t=e.bbox(z._matrix);z._clipbox?z._clipbox=N.intersect(z._clipbox,t):z._clipbox=t}}function Pu(){var e=z._clipbox;if(e==null)return!0;if(e)return e.width()===0||e.height()===0}function Fu(e){function t(t){return B(e,t)}if(t(`transform`)!=`none`||t(`position`)!=`static`||t(`z-index`)!=`auto`||t(`opacity`)<1)return!0}function Iu(e,t){return window.getComputedStyle(e,t||null)}function B(e,t,n){var r=e.getPropertyValue(t);return(r==null||r===``)&&(du.webkit?r=e.getPropertyValue(`-webkit-`+t):du.mozilla?r=e.getPropertyValue(`-moz-`+t):du.opera?r=e.getPropertyValue(`-o-`+t):gu&&(r=e.getPropertyValue(`-ms-`+t))),arguments.length>2&&(r==null||r===``)?n:r}function Lu(e,t,n,r){e.setProperty(t,n,r),du.webkit?e.setProperty(`-webkit-`+t,n,r):du.mozilla?e.setProperty(`-moz-`+t,n,r):du.opera?e.setProperty(`-o-`+t,n,r):gu&&(e.setProperty(`-ms-`+t,n,r),t=`ms`+t.replace(/(^|-)([a-z])/g,function(e,t,n){return t+n.toUpperCase()}),e[t]=n)}function Ru(e,t,n){return n=`border-`+n,{width:parseFloat(B(t,n+`-width`)),style:B(t,n+`-style`),color:qe(e,n+`-color`)}}function zu(e,t){var n=e.style.cssText,r=t();return gn(e,n),r}function Bu(e,t){var n=B(e,`border-`+t+`-radius`).split(/\s+/g).map(parseFloat);return n.length==1&&n.push(n[0]),Yu({x:n[0],y:n[1]})}function Vu(e){var t=e.getBoundingClientRect();return t=Hu(t,`border-*-width`,e),t=Hu(t,`padding-*`,e),t}function Hu(e,t,n){var r,i,a,o,s;return typeof t==`string`?(r=Iu(n),i=parseFloat(B(r,t.replace(`*`,`top`))),a=parseFloat(B(r,t.replace(`*`,`right`))),o=parseFloat(B(r,t.replace(`*`,`bottom`))),s=parseFloat(B(r,t.replace(`*`,`left`)))):typeof t==`number`&&(i=a=o=s=t),{top:e.top+i,right:e.right-a,bottom:e.bottom-o,left:e.left+s,width:e.right-e.left-a-s,height:e.bottom-e.top-o-i}}function Uu(e){var t=B(e,`transform`);if(t==`none`)return null;var n=/^\s*matrix\(\s*(.*?)\s*\)\s*$/.exec(t);if(n){var r=B(e,`transform-origin`);return n=n[1].split(/\s*,\s*/g).map(parseFloat),r=r.split(/\s+/g).map(parseFloat),{matrix:n,origin:r}}}function Wu(e){return 180*e/Math.PI%360}function Gu(e){var t=parseFloat(e);if(/grad$/.test(e))return Math.PI*t/200;if(/rad$/.test(e))return t;if(/turn$/.test(e))return Math.PI*t*2;if(/deg$/.test(e))return Math.PI*t/180}function Ku(e,t){return t=new It(t[0],t[1],t[2],t[3],t[4],t[5]),e.transform(t),t}function qu(e,t){e.clip(t)}function Ju(e,t,n,r){for(var i=new Wn([t,n],r).curvePoints(),a=1;a<i.length;)e.curveTo(i[a++],i[a++],i[a++])}function Yu(e){return(e.x<=0||e.y<=0)&&(e.x=e.y=0),e}function Xu(e,t,n,r,i){var a=Math.max(0,t.x),o=Math.max(0,t.y),s=Math.max(0,n.x),c=Math.max(0,n.y),l=Math.max(0,r.x),u=Math.max(0,r.y),d=Math.max(0,i.x),f=Math.max(0,i.y),p=Math.min(e.width/(a+s),e.height/(c+u),e.width/(l+d),e.height/(f+o));return p<1&&(a*=p,o*=p,s*=p,c*=p,l*=p,u*=p,d*=p,f*=p),{tl:{x:a,y:o},tr:{x:s,y:c},br:{x:l,y:u},bl:{x:d,y:f}}}function Zu(e,t,n){var r=Iu(e),i=Bu(r,`top-left`),a=Bu(r,`top-right`),o=Bu(r,`bottom-left`),s=Bu(r,`bottom-right`);if(n==`padding`||n==`content`){var c=Ru(e,r,`top`),l=Ru(e,r,`right`),u=Ru(e,r,`bottom`),d=Ru(e,r,`left`);if(i.x-=d.width,i.y-=c.width,a.x-=l.width,a.y-=c.width,s.x-=l.width,s.y-=u.width,o.x-=d.width,o.y-=u.width,n==`content`){var f=parseFloat(B(r,`padding-top`)),p=parseFloat(B(r,`padding-right`)),m=parseFloat(B(r,`padding-bottom`)),h=parseFloat(B(r,`padding-left`));i.x-=h,i.y-=f,a.x-=p,a.y-=f,s.x-=p,s.y-=m,o.x-=h,o.y-=m}}return typeof n==`number`&&(i.x-=n,i.y-=n,a.x-=n,a.y-=n,s.x-=n,s.y-=n,o.x-=n,o.y-=n),Qu(t,i,a,s,o)}function Qu(e,t,n,r,i){var a=Xu(e,t,n,r,i),o=a.tl,s=a.tr,c=a.br,l=a.bl,u=new F({fill:null,stroke:null});return u.moveTo(e.left,e.top+o.y),o.x&&Ju(u,e.left+o.x,e.top+o.y,{startAngle:-180,endAngle:-90,radiusX:o.x,radiusY:o.y}),u.lineTo(e.right-s.x,e.top),s.x&&Ju(u,e.right-s.x,e.top+s.y,{startAngle:-90,endAngle:0,radiusX:s.x,radiusY:s.y}),u.lineTo(e.right,e.bottom-c.y),c.x&&Ju(u,e.right-c.x,e.bottom-c.y,{startAngle:0,endAngle:90,radiusX:c.x,radiusY:c.y}),u.lineTo(e.left+l.x,e.bottom),l.x&&Ju(u,e.left+l.x,e.bottom-l.y,{startAngle:90,endAngle:180,radiusX:l.x,radiusY:l.y}),u.close()}function $u(e,t){var n=String(parseFloat(e));switch(t){case`decimal-leading-zero`:return n.length<2&&(n=`0`+n),n;case`lower-roman`:return rt(e).toLowerCase();case`upper-roman`:return rt(e).toUpperCase();case`lower-latin`:case`lower-alpha`:return Au(e-1);case`upper-latin`:case`upper-alpha`:return Au(e-1).toUpperCase();default:return n}}function ed(e,t){function n(e,t,n){return n?(n=n.replace(/^\s*(["'])(.*)\1\s*$/,`$2`),wu(e).map(function(e){return $u(e,t)}).join(n)):$u(Cu(e)||0,t)}var r=bu(t,/^\s+/),i=[],a;return r.forEach(function(t){var r;(a=/^\s*(["'])(.*)\1\s*$/.exec(t))?i.push(a[2].replace(/\\([0-9a-f]{4})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))})):(a=/^\s*counter\((.*?)\)\s*$/.exec(t))?(r=bu(a[1]),i.push(n(r[0],r[1]))):(a=/^\s*counters\((.*?)\)\s*$/.exec(t))?(r=bu(a[1]),i.push(n(r[0],r[2],r[1]))):(a=/^\s*attr\((.*?)\)\s*$/.exec(t))?i.push(e.getAttribute(a[1])||``):i.push(t)}),i.join(``)}function td(e){if(e.cssText)return e.cssText;for(var t=[],n=0;n<e.length;++n)t.push(e[n]+`: `+B(e,e[n]));return t.join(`;
`)}function nd(e,t){if(e.tagName==pu){rd(e,t);return}let n=[];function r(t,r){let i=Iu(e,t),a=i.content;if(Ou(i),a&&a!=`normal`&&a!=`none`&&i.width!=`0px`){let t=e.ownerDocument.createElement(pu);gn(t,td(i)),t.textContent=ed(e,a),e.insertBefore(t,r),n.push(t)}}if(r(`:before`,e.firstChild),r(`:after`,null),n.length>0){let r=e.className;e.className+=` kendo-pdf-hide-pseudo-elements`,rd(e,t),e.className=r,n.forEach(function(t){e.removeChild(t)})}else rd(e,t)}function rd(e,t){var n=Iu(e),r=Ru(e,n,`top`),i=Ru(e,n,`right`),a=Ru(e,n,`bottom`),o=Ru(e,n,`left`),s=Bu(n,`top-left`),c=Bu(n,`top-right`),l=Bu(n,`bottom-left`),u=Bu(n,`bottom-right`),d=B(n,`direction`),f=ku(qe(e,`background-color`)),p=yu(B(n,`background-image`)),m=bu(B(n,`background-repeat`)),h=bu(B(n,`background-position`)),g=bu(B(n,`background-origin`)),_=bu(B(n,`background-size`)),v,y;gu&&(v=n.textOverflow,v==`ellipsis`&&(y=e.style.textOverflow,e.style.textOverflow=`clip`)),du.msie&&du.version<10&&(h=bu(e.currentStyle.backgroundPosition));var b=Hu(e.getBoundingClientRect(),`border-*-width`,e);(function(){var e=B(n,`clip`),r=/^\s*rect\((.*)\)\s*$/.exec(e);if(r){var i=r[1].split(/[ ,]+/g),a=i[0]==`auto`?b.top:parseFloat(i[0])+b.top,o=i[1]==`auto`?b.right:parseFloat(i[1])+b.left,s=i[2]==`auto`?b.bottom:parseFloat(i[2])+b.top,c=i[3]==`auto`?b.left:parseFloat(i[3])+b.left,l=new I,u=new F().moveTo(c,a).lineTo(o,a).lineTo(o,s).lineTo(c,s).close();qu(l,u),t.append(l),t=l,Nu(u)}})();var x,S,C,w=B(n,`display`);if(w==`table-row`)for(x=[],S=0,C=e.children;S<C.length;++S)x.push(C[S].getBoundingClientRect());else x=e.getClientRects(),x.length==1&&(x=[e.getBoundingClientRect()]);for(x=ee(x),S=0;S<x.length;++S)ne(x[S],S===0,S==x.length-1);if(e.tagName==`A`&&e.href&&!/^#?$/.test(e.getAttribute(`href`))&&(!z._avoidLinks||!vu(e,z._avoidLinks))){let n=document.createRange();n.selectNodeContents(e),fu(n.getClientRects()).forEach(function(n){let r=new I;r._pdfLink={url:e.href,top:n.top,right:n.right,bottom:n.bottom,left:n.left},t.append(r)})}return x.length>0&&w==`list-item`&&!e.getAttribute(`kendo-no-bullet`)&&D(x[0]),(function(){function r(){var n=Zu(e,b,`padding`),r=new I;qu(r,n),t.append(r),t=r,Nu(n)}(ld(e)||/^(hidden|auto|scroll)/.test(B(n,`overflow`))||/^(hidden|auto|scroll)/.test(B(n,`overflow-x`))||/^(hidden|auto|scroll)/.test(B(n,`overflow-y`)))&&r()})(),!ad(e,t)&&!od(e,t)&&md(e,t),gu&&v==`ellipsis`&&(e.style.textOverflow=y),t;function ee(t){if(/^td$/i.test(e.tagName)){var n=z.table;if(n&&B(n.style,`border-collapse`)==`collapse`){var r=Ru(n.element,n.style,`left`).width,i=Ru(n.element,n.style,`top`).width;if(r===0&&i===0)return t;var a=n.element.getBoundingClientRect(),o=n.element.rows[0].cells[0].getBoundingClientRect();if(o.top==a.top||o.left==a.left)return fu(t).map(function(e){return{left:e.left+r,top:e.top+i,right:e.right+r,bottom:e.bottom+i,height:e.height,width:e.width}})}}return t}function T(e,n,r,i,a,o,s,c){if(r<=0)return;var l,u=new I;Ku(u,c),t.append(u),Yu(o),Yu(s),l=new F({fill:{color:e},stroke:null}),u.append(l),l.moveTo(o.x?Math.max(o.x,i):0,0).lineTo(n-(s.x?Math.max(s.x,a):0),0).lineTo(n-Math.max(s.x,a),r).lineTo(Math.max(o.x,i),r).close(),o.x&&d(i,o,[-1,0,0,1,o.x,0]),s.x&&d(a,s,[1,0,0,1,n-s.x,0]);function d(t,n,i){var a=Math.PI/2*t/(t+r),o={x:n.x-t,y:n.y-r},s=new F({fill:{color:e},stroke:null}).moveTo(0,0);Ku(s,i),Ju(s,0,n.y,{startAngle:-90,endAngle:-Wu(a),radiusX:n.x,radiusY:n.y}),o.x>0&&o.y>0?(s.lineTo(o.x*Math.cos(a),n.y-o.y*Math.sin(a)),Ju(s,0,n.y,{startAngle:-Wu(a),endAngle:-90,radiusX:o.x,radiusY:o.y,anticlockwise:!0})):o.x>0?s.lineTo(o.x,r).lineTo(0,r):s.lineTo(o.x,r).lineTo(o.x,0),u.append(s.close())}}function te(e){var n=new I;if(qu(n,Qu(e,s,c,u,l)),t.append(n),f){var r=new F({fill:{color:f.toCssRgba()},stroke:null});r.moveTo(e.left,e.top).lineTo(e.right,e.top).lineTo(e.right,e.bottom).lineTo(e.left,e.bottom).close(),n.append(r)}for(var i=p.length;--i>=0;)E(n,e,p[i],m[i%m.length],h[i%h.length],g[i%g.length],_[i%_.length])}function E(t,n,r,i,a,o,s){if(!r||r==`none`)return;if(r.type==`url`){var c=hu[r.url];c&&c.width>0&&c.height>0&&l(t,n,c.width,c.height,function(e,t){e.append(new Gr(r.url,t))})}else if(r.type==`linear`)l(t,n,n.width,n.height,id(r));else return;function l(t,n,r,c,l){var u=r/c,d,f=n;if(o==`content-box`?(f=Hu(f,`border-*-width`,e),f=Hu(f,`padding-*`,e)):o==`padding-box`&&(f=Hu(f,`border-*-width`,e)),!/^\s*auto(\s+auto)?\s*$/.test(s))if(s==`contain`)d=Math.min(f.width/r,f.height/c),r*=d,c*=d;else if(s==`cover`)d=Math.max(f.width/r,f.height/c),r*=d,c*=d;else{var p=s.split(/\s+/g);r=/%$/.test(p[0])?f.width*parseFloat(p[0])/100:parseFloat(p[0]),c=p.length==1||p[1]==`auto`?r/u:/%$/.test(p[1])?f.height*parseFloat(p[1])/100:parseFloat(p[1])}var m=String(a);switch(m){case`bottom`:m=`50% 100%`;break;case`top`:m=`50% 0`;break;case`left`:m=`0 50%`;break;case`right`:m=`100% 50%`;break;case`center`:m=`50% 50%`;break}m=m.split(/\s+/),m.length==1&&(m[1]=`50%`),/%$/.test(m[0])?m[0]=parseFloat(m[0])/100*(f.width-r):m[0]=parseFloat(m[0]),/%$/.test(m[1])?m[1]=parseFloat(m[1])/100*(f.height-c):m[1]=parseFloat(m[1]);var h=new N([f.left+m[0],f.top+m[1]],[r,c]);function g(){for(;h.origin.x>n.left;)h.origin.x-=r}function _(){for(;h.origin.y>n.top;)h.origin.y-=c}function v(){for(;h.origin.x<n.right;)l(t,h.clone()),h.origin.x+=r}if(i==`no-repeat`)l(t,h);else if(i==`repeat-x`)g(),v();else if(i==`repeat-y`)for(_();h.origin.y<n.bottom;)l(t,h.clone()),h.origin.y+=c;else if(i==`repeat`){g(),_();for(var y=h.origin.clone();h.origin.y<n.bottom;)h.origin.x=y.x,v(),h.origin.y+=c}}}function D(){var r=B(n,`list-style-type`);if(r==`none`)return;var i=B(n,`list-style-position`);function a(n){zu(e,function(){e.style.position=`relative`;var r=e.ownerDocument.createElement(pu);r.style.position=`absolute`,r.style.boxSizing=`border-box`,i==`outside`?(r.style.width=`6em`,r.style.left=`-6.8em`,r.style.textAlign=`right`):r.style.left=`0px`,n(r),e.insertBefore(r,e.firstChild),_d(r,t),e.removeChild(r)})}function o(t){var n=e.parentNode.children,r=e.getAttribute(`kendo-split-index`);if(r!=null)return t(r|0,n.length);for(var i=0;i<n.length;++i)if(n[i]===e)return t(i,n.length)}switch(r){case`circle`:case`disc`:case`square`:a(function(e){e.innerHTML=`&nbsp;`,e.setAttribute(mu,r)});break;case`decimal`:case`decimal-leading-zero`:a(function(e){o(function(t){++t,r==`decimal-leading-zero`&&t<10&&(t=`0`+t),e.innerHTML=t+`.`})});break;case`lower-roman`:case`upper-roman`:a(function(e){o(function(t){t=rt(t+1),r==`upper-roman`&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break;case`lower-latin`:case`lower-alpha`:case`upper-latin`:case`upper-alpha`:a(function(e){o(function(t){t=Au(t),/^upper/i.test(r)&&(t=t.toUpperCase()),e.innerHTML=t+`.`})});break}}function ne(n,f,p){if(n.width===0||n.height===0)return;te(n);var m=o.width>0&&(f&&d==`ltr`||p&&d==`rtl`),h=i.width>0&&(p&&d==`ltr`||f&&d==`rtl`);if(r.width===0&&o.width===0&&i.width===0&&a.width===0)return;if(r.color==i.color&&r.color==a.color&&r.color==o.color&&r.width==i.width&&r.width==a.width&&r.width==o.width&&m&&h){n=Hu(n,r.width/2);var g=Zu(e,n,r.width/2);g.options.stroke={color:r.color,width:r.width},t.append(g);return}if(s.x===0&&c.x===0&&u.x===0&&l.x===0&&r.width<2&&o.width<2&&i.width<2&&a.width<2){r.width>0&&t.append(new F({stroke:{width:r.width,color:r.color}}).moveTo(n.left,n.top+r.width/2).lineTo(n.right,n.top+r.width/2)),a.width>0&&t.append(new F({stroke:{width:a.width,color:a.color}}).moveTo(n.left,n.bottom-a.width/2).lineTo(n.right,n.bottom-a.width/2)),m&&t.append(new F({stroke:{width:o.width,color:o.color}}).moveTo(n.left+o.width/2,n.top).lineTo(n.left+o.width/2,n.bottom)),h&&t.append(new F({stroke:{width:i.width,color:i.color}}).moveTo(n.right-i.width/2,n.top).lineTo(n.right-i.width/2,n.bottom));return}var _=Xu(n,s,c,u,l),v=_.tl,y=_.tr,b=_.br,x=_.bl;T(r.color,n.width,r.width,o.width,i.width,v,y,[1,0,0,1,n.left,n.top]),T(a.color,n.width,a.width,i.width,o.width,b,x,[-1,0,0,-1,n.right,n.bottom]);function S(e){return{x:e.y,y:e.x}}T(o.color,n.height,o.width,a.width,r.width,S(x),S(v),[0,-1,1,0,n.left,n.bottom]),T(i.color,n.height,i.width,r.width,a.width,S(y),S(b),[0,1,-1,0,n.right,n.top])}}function id(e){return function(t,n){var r=n.width(),i=n.height();switch(e.type){case`linear`:var a=e.angle==null?Math.PI:e.angle;switch(e.to){case`top`:a=0;break;case`left`:a=-Math.PI/2;break;case`bottom`:a=Math.PI;break;case`right`:a=Math.PI/2;break;case`top left`:case`left top`:a=-Math.atan2(i,r);break;case`top right`:case`right top`:a=Math.atan2(i,r);break;case`bottom left`:case`left bottom`:a=Math.PI+Math.atan2(i,r);break;case`bottom right`:case`right bottom`:a=Math.PI-Math.atan2(i,r);break}e.reverse&&(a-=Math.PI),a%=2*Math.PI,a<0&&(a+=2*Math.PI);var o=Math.abs(r*Math.sin(a))+Math.abs(i*Math.cos(a)),s=Math.atan(r*Math.tan(a)/i),c=Math.sin(s),l=Math.cos(s),u=Math.abs(c)+Math.abs(l),d=u/2*c,f=u/2*l;a>Math.PI/2&&a<=3*Math.PI/2&&(d=-d,f=-f);var p=[],m=0,h=e.stops.map(function(t,n){var r=t.percent;r?r=parseFloat(r)/100:t.length?r=parseFloat(t.length)/o:n===0?r=0:n==e.stops.length-1&&(r=1);var i={color:t.color.toCssRgba(),offset:r};return r==null?p.push({left:m,stop:i}):(m=r,p.forEach(function(e,t){var n=e.stop;n.offset=e.left+(m-e.left)*(t+1)/(p.length+1)}),p=[]),i}),g=[.5-d,.5+f],_=[.5+d,.5-f];t.append(F.fromRect(n).stroke(null).fill(new xi({start:g,end:_,stops:h,userSpace:!1})));break;case`radial`:window.console&&window.console.log&&window.console.log(`Radial gradients are not yet supported in HTML renderer`);break}}}function ad(e,t){let n=null;if(window.kendo&&window.kendo.jQuery&&e.getAttribute(window.kendo.attr(`role`))){let t=window.kendo.widgetInstance(window.kendo.jQuery(e));t&&(t.exportDOMVisual||t.exportVisual)&&(n=t.exportDOMVisual?t.exportDOMVisual():t.exportVisual())}if(n===null&&e._kendoExportVisual){let t=e.getBoundingClientRect(),r={width:t.width,height:t.height};n=e._kendoExportVisual(r)}if(!n)return!1;let r=new I;r.children.push(n);let i=e.getBoundingClientRect();return r.transform(P().translate(i.left,i.top)),t.append(r),!0}function od(e,t){let n=e.getAttribute(mu);if(!n)return!1;var r=e.getBoundingClientRect();let i=qe(e,`color`);if(n===`square`){let e=r.height/5;t.append(new ei(new N([r.right-e,r.top+r.height/2.1],[e,e])).fill(i).stroke(i))}else{let e=r.height/7,a=new Rn(new jn([r.right-e,r.top+(r.height+e)/2],e));n===`circle`?a.stroke(i,.5):a.fill(i).stroke(null),t.append(a)}return!0}function sd(e,t,n){var r=Vu(e),i=new Gr(t,new N([r.left,r.top],[r.width,r.height]));qu(i,Zu(e,r,`content`)),n.append(i)}function cd(e,t){var n=Iu(e),r=Iu(t),i=parseFloat(B(n,`z-index`)),a=parseFloat(B(r,`z-index`)),o=B(n,`position`),s=B(r,`position`);return isNaN(i)&&isNaN(a)?/static|absolute/.test(o)&&/static|absolute/.test(s)?0:o==`static`?-1:+(s==`static`):isNaN(i)?a===0?0:a>0?-1:1:isNaN(a)?i===0?0:i>0?1:-1:parseFloat(i)-parseFloat(a)}function ld(e){return/^(?:textarea|select|input)$/i.test(e.tagName)}function ud(e){return e.selectedOptions&&e.selectedOptions.length>0?e.selectedOptions[0]:e.options[e.selectedIndex]}function dd(e,t){Iu(e);var n=qe(e,`color`),r=e.getBoundingClientRect();e.type==`checkbox`?(t.append(F.fromRect(new N([r.left+1,r.top+1],[r.width-2,r.height-2])).stroke(n,1)),e.checked&&t.append(new F().stroke(n,1.2).moveTo(r.left+.22*r.width,r.top+.55*r.height).lineTo(r.left+.45*r.width,r.top+.75*r.height).lineTo(r.left+.78*r.width,r.top+.22*r.width))):(t.append(new Rn(new jn([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-2,r.height-2)/2)).stroke(n,1)),e.checked&&t.append(new Rn(new jn([(r.left+r.right)/2,(r.top+r.bottom)/2],Math.min(r.width-8,r.height-8)/2)).fill(n).stroke(null)))}function fd(e,t){var n=e.tagName.toLowerCase();if(n==`input`&&(e.type==`checkbox`||e.type==`radio`))return dd(e,t);var r=e.parentNode,i=e.ownerDocument,a=i.createElement(pu),o;if(gn(a,td(Iu(e))),n==`input`&&(a.style.whiteSpace=`pre`),(n==`select`||n==`textarea`)&&(a.style.overflow=`auto`),n==`select`)if(e.multiple)for(var s=0;s<e.options.length;++s)o=i.createElement(pu),gn(o,td(Iu(e.options[s]))),o.style.display=`block`,o.textContent=e.options[s].textContent,a.appendChild(o);else o=ud(e),o&&(a.textContent=o.textContent);else a.textContent=e.value;r.insertBefore(a,e),a.scrollLeft=e.scrollLeft,a.scrollTop=e.scrollTop,e.style.display=`none`,md(a,t),e.style.display=``,r.removeChild(a)}function pd(e){let t=new window.XMLSerializer,n=t.serializeToString(e);if(du.mozilla&&!(e.getAttribute(`width`)&&e.getAttribute(`height`))){let r=new window.DOMParser().parseFromString(n,`image/svg+xml`).documentElement,i=Vu(e);r.setAttribute(`width`,i.width),r.setAttribute(`height`,i.height),n=t.serializeToString(r)}return n}function md(e,t){switch(z._stackingContext.element===e&&(z._stackingContext.group=t),e.tagName.toLowerCase()){case`img`:sd(e,e.src,t);break;case`svg`:sd(e,`data:image/svg+xml;base64,${_t(pd(e))}`,t);break;case`canvas`:try{sd(e,e.toDataURL(`image/png`),t)}catch{}break;case`textarea`:case`input`:case`select`:fd(e,t);break;default:for(var n=[],r=[],i=[],a=e.firstChild;a;a=a.nextSibling)switch(a.nodeType){case 3:/\S/.test(a.data)&&hd(e,a,t);break;case 1:var o=Iu(a),s=B(o,`float`);B(o,`position`)==`static`?s==`none`?n.push(a):r.push(a):i.push(a);break}Ct(n,cd).forEach(function(e){_d(e,t)}),Ct(r,cd).forEach(function(e){_d(e,t)}),Ct(i,cd).forEach(function(e){_d(e,t)})}}function hd(e,t,n){if(Pu())return;var r=Iu(e);if(parseFloat(B(r,`text-indent`))<-500)return;var i=t.data,a=0,o=i.search(/\S\s*$/)+1;if(!o)return;var s=B(r,`font-size`),c=B(r,`line-height`),l=[B(r,`font-style`),B(r,`font-variant`),B(r,`font-weight`),s,B(r,`font-family`)].join(` `);if(s=parseFloat(s),c=parseFloat(c),s===0||isNaN(s))return;var u=qe(e,`color`),d=e.ownerDocument.createRange(),f=B(r,`text-align`)==`justify`,p=B(r,`column-count`,1),m=B(r,`white-space`),h=B(r,`text-transform`),g=e.getBoundingClientRect().width/s*5;g===0&&(g=500);var _=null,v=z.underline,y=z[`line-through`],b=z.overline,x=z[`underline-offset`];for(v&&S(E);!w(););(y||b)&&S(te);return;function S(e){d.selectNode(t);let n=fu(d.getClientRects());S=e=>n.forEach(e),S(e)}function C(e){if(gu||du.chrome||du.safari){for(var t=e.getClientRects(),n={top:1/0,right:-1/0,bottom:-1/0,left:1/0},r=!1,i=0;i<t.length;++i){var a=t[i];a.width<=1||a.bottom===_||(n.left=Math.min(a.left,n.left),n.top=Math.min(a.top,n.top),n.right=Math.max(a.right,n.right),n.bottom=Math.max(a.bottom,n.bottom),r=!0)}return r?(n.width=n.right-n.left,n.height=n.bottom-n.top,n):e.getBoundingClientRect()}return e.getBoundingClientRect()}function w(){var e=a,n,r=i.substr(a).search(/\S/);if(a+=r,r<0||a>=o)return!0;d.setStart(t,a),d.setEnd(t,a+1),n=C(d);var s=!1;if((f||p>1)&&(r=i.substr(a).search(/\s/),r>=0)){d.setEnd(t,a+r);var c=C(d);c.bottom==n.bottom&&(n=c,s=!0,a+=r)}if(!s){if(r=(function e(r,i,a){d.setEnd(t,i);var o=C(d);return o.bottom!=n.bottom&&r<i?e(r,r+i>>1,i):o.right==n.right?i:(n=o,i<a?e(i,i+a>>1,a):i)})(a,Math.min(o,a+g),o),r==a)return!0;if(a=r,r=d.toString().search(/\s+$/),r===0)return!1;r>0&&(d.setEnd(t,d.startOffset+r),n=C(d))}gu&&(n=d.getClientRects()[0]);var l=d.toString();if(!/^(?:pre|pre-wrap)$/i.test(m))l=l.replace(/\s+/g,` `);else if(/\t/.test(l)){var u=0;for(r=e;r<d.startOffset;++r){var h=i.charCodeAt(r);h==9?u+=8-u%8:h==10||h==13?u=0:u++}for(;(r=l.search(`	`))>=0;){var v=`        `.substr(0,8-(u+r)%8);l=l.substr(0,r)+v+l.substr(r+1)}}s||(_=n.bottom),ee(l,n)}function ee(e,t){if(gu&&!isNaN(c)){var r=xu(l),i=(t.top+t.bottom-r)/2;t={top:i,right:t.right,bottom:i+r,left:t.left,height:r,width:t.right-t.left}}switch(h){case`uppercase`:e=e.toUpperCase();break;case`lowercase`:e=e.toLowerCase();break;case`capitalize`:e=e.replace(/(?:^|\s)\S/g,e=>e.toUpperCase());break}var a=new _u(e,new N([t.left,t.top],[t.width,t.height]),{font:l,fill:{color:u}});n.append(a)}function T(e,t,r,i){if(r){var a=new F({stroke:{width:e,color:r}});i-=e,a.moveTo(t.left,i).lineTo(t.right,i),n.append(a)}}function te(e){let t=s/12;T(t,e,y,e.bottom-e.height/2.7),T(t,e,b,e.top)}function E(e){let t=s/12,n=e.bottom;x==null?n+=t:n+=x,T(t,e,v,n)}}function gd(e,t,n){var r;n==`auto`?(r=t,n=0):(r=z._stackingContext.group,n=parseFloat(n));for(var i=r.children,a=0;a<i.length&&!(i[a]._dom_zIndex!=null&&i[a]._dom_zIndex>n);++a);var o=new I;if(r.insert(a,o),o._dom_zIndex=n,r!==t&&z._clipbox){var s=z._matrix.invert(),c=z._clipbox.transformCopy(s);qu(o,F.fromRect(c))}return o}function _d(e,t){var n=Iu(e);if(Ou(n),!/^(style|script|link|meta|iframe|col|colgroup)$/i.test(e.tagName)&&z._clipbox!=null){var r=parseFloat(B(n,`opacity`)),i=B(n,`visibility`),a=B(n,`display`);if(r!==0&&i!=`hidden`&&a!=`none`){var o=Uu(n),s,c=B(n,`z-index`);(o||r<1)&&c==`auto`&&(c=0),s=gd(e,t,c),r<1&&s.opacity(r*s.opacity()),ju(e,n,s),o?zu(e,function(){Lu(e.style,`transform`,`none`,`important`),Lu(e.style,`transition`,`none`,`important`),B(n,`position`)==`static`&&Lu(e.style,`position`,`relative`,`important`);var t=e.getBoundingClientRect(),r=t.left+o.origin[0],i=t.top+o.origin[1],a=[1,0,0,1,-r,-i];a=vd(a,o.matrix),a=vd(a,[1,0,0,1,r,i]),a=Ku(s,a),z._matrix=z._matrix.multiplyCopy(a),nd(e,s)}):nd(e,s),Mu()}}}function vd(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=t[0],l=t[1],u=t[2],d=t[3],f=t[4],p=t[5];return[n*c+r*u,n*l+r*d,i*c+a*u,i*l+a*d,o*c+s*u+f,o*l+s*d+p]}function yd(e){let t=.5;e.options.stroke&&at(e.options.stroke.width)&&e.options.stroke.width%2==0&&(t=0);for(let n=0;n<e.segments.length;n++)e.segments[n].anchor().round(0).translate(t,t);return e}function bd(e,t){return-e.x*t.y+e.y*t.x<0}function V(e){return typeof e==`number`&&!isNaN(e)}function xd(e){return typeof e==`string`}function Sd(e){return V(e)||xd(e)&&isFinite(e)}function Cd(e,t){return(e+1)%t}function wd(e,t){let n=e-1;return n<0?t-1:n}function Td(e,t){return t===1||e%t===0?0:e<0?t+e%t:e>=t?e%t:e}function Ed(e){return typeof e==`function`}let Dd=`object`;function Od(e,t){for(let n in t){if(n===`__proto__`||n===`constructor`)continue;let r=t[n],i=typeof r,a;if(a=i===Dd&&r!==null?r.constructor:null,a&&a!==Array)if(r instanceof Date)e[n]=new Date(r.getTime());else if(Ed(r.clone))e[n]=r.clone();else{let t=e[n];typeof t==Dd?e[n]=t||{}:e[n]={},Od(e[n],r)}else i!==`undefined`&&(e[n]=r)}return e}function H(e){let t=arguments.length;for(let n=1;n<t;n++)Od(e,arguments[n]);return e}function kd(e){return typeof e==`object`}function Ad(e){return V(e)?e+`px`:e}let jd=/width|height|top|left|bottom|right/i;function Md(e){return jd.test(e)}function Nd(e,t){let n=xd(t)?[t]:t;if(j(n)){let t={},r=window.getComputedStyle(e);for(let e=0;e<n.length;e++){let i=n[e];t[i]=Md(i)?parseFloat(r[i]):r[i]}return t}else if(kd(t))for(let n in t)e.style[n]=Ad(t[n])}function U(e,t=0){let n={top:0,right:0,bottom:0,left:0};return typeof e==`number`?n.top=n[O]=n[x]=n[E]=e:(n.top=e.top||t,n[O]=e.right||t,n[x]=e.bottom||t,n[E]=e.left||t),n}let Pd={compile:function(e){return e}};var Fd=class{static register(e){Pd=e}static compile(e,t){return Pd.compile(e,t)}};function Id(e={}){let t;return e.template?e.template=t=Fd.compile(e.template):Ed(e.content)&&(t=e.content),t}function Ld(e={}){let t;return e.ariaTemplate?e.ariaTemplate=t=Fd.compile(e.ariaTemplate):Ed(e.ariaContent)&&(t=e.ariaContent),t}let Rd=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,zd={};zd.undefined=function(e){return e};function Bd(e){if(zd[e])return zd[e];let t=[];return e.replace(Rd,function(e,n,r,i){t.push(n===void 0?r||i:n)}),zd[e]=function(e){let n=e;for(let e=0;e<t.length&&n;e++)n=n[t[e]];return n},zd[e]}let Vd=(e,t)=>e.filter(t);function Hd(e,t){if(e.className){let n=t.split(` `);for(let t=0;t<n.length;t++)if(e.className.indexOf&&e.className.indexOf(n[t])!==-1)return!0}}var Ud=class{constructor(){this._map=new Map}get(e){return this._map.get(e)}set(e,t){this._map.set(e,t)}};function W(e,t){if(t)return t.includes(e)}function Wd(e,t,n){return Dt(e+(t-e)*n,3)}let Gd=`trigger`;var Kd=class{constructor(e,t){this.observer=e,this.handlerMap=H({},this.handlerMap,t)}trigger(e,t){let{observer:n,handlerMap:r}=this,i;return r[e]?i=this.callObserver(r[e],t):n[Gd]&&(i=this.callObserver(Gd,e,t)),i}callObserver(e,...t){return this.observer[e].apply(this.observer,t)}requiresHandlers(e){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(e);for(let t=0;t<e.length;t++)if(this.handlerMap[e[t]])return!0}};function qd(e){return Object.prototype.toString.call(e)===`[object Object]`}function Jd(e,t){let n=e.length,r=[];for(let i=0;i<n;i++){let n=t(e[i]);at(n)&&r.push(n)}return r}let Yd=ke.browser||{};function Xd(e){let t=0;return e.wheelDelta?(t=-e.wheelDelta/120,Yd.webkit&&(t/=2*Math.max(window.devicePixelRatio,.625))):e.detail&&(t=e.detail/3),t=t>0?Math.ceil(t):Math.floor(t),t}let{append:Zd,bindEvents:Qd,defined:G,deg:$d,elementOffset:ef,elementSize:tf,eventCoordinates:nf,eventElement:rf,hashKey:af,last:of,limitValue:K,objectKey:sf,rad:cf,round:q,unbindEvents:lf,valueOrDefault:J}=Sn;var uf=class e{static fetchFonts(t,n,r={depth:0}){!t||r.depth>5||!document.fonts||Object.keys(t).forEach(function(i){let a=t[i];i===`dataSource`||i[0]===`$`||!a||(i===`font`?n.push(a):typeof a==`object`&&(r.depth++,e.fetchFonts(a,n,r),r.depth--))})}static loadFonts(e,t){let n=[];if(e.length>0&&document.fonts){try{n=e.map(function(e){return document.fonts.load(e)})}catch(e){Ee(e)}Promise.all(n).then(t,t)}else t()}static preloadFonts(t,n){let r=[];e.fetchFonts(t,r),e.loadFonts(r,n)}};function Y(e,t){let n=e.prototype;n.options?n.options=H({},n.options,t):n.options=t}let df=`k-i-`,ff=`k-svg-i-`;var pf=class{constructor(e,t){this.element=e,this.options=H({},this.options,t),this.wrapper()}wrapper(){this.addClasses()}addClasses(){}html(){return this.element.outerHTML}};Y(pf,{name:``,size:`none`,themeColor:`none`,flip:`default`,iconClass:``,stylingOptions:[`size`,`themeColor`,`fill`]});var mf=class extends pf{constructor(e,t){super(e,t)}wrapper(){let e=this.element.className.split(` `).find(e=>e.startsWith(df)),t=this.options.icon?`${this.options.icon.startsWith(df)?``:df}${this.options.icon}`:``;this._className=t,le(this.element,`k-icon`),le(this.element,`k-font-icon`),de(this.element,e),le(this.element,t),le(this.element,this.options.iconClass||``),super.wrapper()}};Y(mf,{name:`HTMLFontIcon`,icon:null});var hf=class extends pf{constructor(e,t){e.innerHTML=``,super(e,t)}wrapper(){let e=this.options.icon,t=this.options.iconClass,n=this.element.className.split(` `).find(e=>e.startsWith(ff));if(!e&&t){let n=t.match(/k-i-(\w+(?:-\w+)*)/);n&&(e=n[1],t=t.replace(n[0],``))}xd(e)&&(e=e.replace(`k-i-`,``).replace(/-./g,e=>e[1].toUpperCase()),e=this.options.svgIcons[e]||this.options.svgIcons[`${e}Icon`]);let r=e&&e.name?`${ff}${e.name}`:``;if(this._className=r,le(this.element,`k-svg-icon`),de(this.element,n),le(this.element,r),le(this.element,t||``),this.element.setAttribute(`aria-hidden`,`true`),e&&qd(e)){let t=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);t.setAttribute(`viewBox`,e.viewBox||``),t.setAttribute(`focusable`,`false`),t.innerHTML=e.content||``,this.element.appendChild(t)}super.wrapper()}};Y(hf,{name:`HTMLSvgIcon`,icon:null,svgIcons:{}});let gf={svg:hf,font:mf};function _f(e,t){let n=e,r=t;return(!n||kd(n)&&!(n instanceof HTMLElement)||xd(n))&&(r=n,n=document.createElement(`span`)),xd(r)&&(r={icon:r}),r.type||=`svg`,gf[r.type]?new gf[r.type](n,r).html():null}function vf(e){let t=D,n=ne;for(let r=0,i=e.length;r<i;r++){let i=e[r];i!==null&&isFinite(i)&&(t=Math.min(t,i),n=Math.max(n,i))}return{min:t===D?void 0:t,max:n===ne?void 0:n}}function yf(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r,n,e))return r}}let bf=It,xf=/matrix\((.*)\)/;function Sf(e){let t=e.match(xf);if(t===null||t.length!==2)return bf.unit();let n=t[1].split(`,`).map(e=>parseFloat(e));return new bf(...n)}function Cf(e){let t=getComputedStyle(e).transform;return t===`none`?bf.unit():Sf(t)}function wf(e){if(!e)return bf.unit();let t=Cf(e),n=e.parentElement;for(;n;){let e=Cf(n);t=t.multiplyCopy(e),n=n.parentElement}return t.b=t.c=t.e=t.f=0,t}function Tf(e){return new We(e).isDark()?k:b}let Ef={};var Df=class{constructor(e){this._index={},this._values=e?e.slice(0):[];for(let e=0;e<this._values.length;e++)this._index[this._values[e]]=e}values(){return this._values.filter(e=>e!==Ef)}has(e){return this._index[e]!==void 0}add(e){this.has(e)||(this._index[e]=this._values.length,this._values.push(e))}delete(e){let t=this._index[e];t!==void 0&&(this._values[t]=Ef,delete this._index[e])}clear(){this._index={},this._values=[]}get size(){return this._values.length}},Of=class{constructor(e){this._set=new Set(e)}values(){return Array.from(this._set)}has(e){return this._set.has(e)}add(e){this._set.add(e)}delete(e){this._set.delete(e)}clear(){this._set.clear()}get size(){return this._set.size}};let kf=()=>{let e=!1;return typeof Set==`function`&&(e=new Set([1]).has(1)),e};function Af(e){return kf()?new Of(e):new Df(e)}function jf(e){throw e}let Mf={INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110};function Nf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Pf=class e{constructor(){this.height=0,this.width=0,this.data=[]}clone(){let t=new e;return t.height=this.height,t.width=this.width,t.data=this.data.map(e=>e.slice()),t}get(e,t){let n=this.data[e];return n?n[t]:null}set(e,t,n){let r=this.data[e];r??=this.data[e]=[],r[t]=n,e>=this.height&&(this.height=e+1),t>=this.width&&(this.width=t+1)}each(e,t){for(let n=0;n<this.height;++n)for(let r=0;r<this.width;++r){let i=this.get(n,r);if((t||i!=null)&&(i=e(i,n,r),i!==void 0))return i}}map(t,n){let r=new e;return this.each(function(e,n,i){r.set(n,i,t(e,n,i))},n),r}transpose(){let t=new e;return this.each(function(e,n,r){t.set(r,n,e)}),t}unit(e){this.width=this.height=e;let t=this.data=Array(e);for(let n=e;--n>=0;){let r=t[n]=Array(e);for(let t=e;--t>=0;)r[t]=+(n===t)}return this}multiply(t){let n=this,r=new e;for(let e=0;e<n.height;++e)for(let i=0;i<t.width;++i){let a=0;for(let r=0;r<n.width;++r){let o=n.get(e,r),s=t.get(r,i);typeof o==`number`&&typeof s==`number`&&(a+=o*s)}r.set(e,i,a)}return r}inverse(){let t=this.width,n=this.augment(new e().unit(t)),r=n.data;for(let e=0;e<t;++e){let n=Ff(e,t,function(t){return r[t][e]});if(!r[n][e])return null;if(e!==n){let t=r[e];r[e]=r[n],r[n]=t}for(let n=e+1;n<t;++n){for(let i=e+1;i<2*t;++i)r[n][i]-=r[e][i]*r[n][e]/r[e][e];r[n][e]=0}}for(let e=0;e<t;++e)for(let n=r[e][e],i=0;i<2*t;++i)r[e][i]/=n;for(let e=t;--e>=0;)for(let n=e;--n>=0;)if(r[n][e])for(let i=2*t;--i>=t;)r[n][i]-=r[e][i]*r[n][e];return n.slice(0,t,t,t)}augment(e){let t=this.clone(),n=t.width;return e.each(function(e,r,i){t.set(r,i+n,e)}),t}slice(t,n,r,i){let a=new e;for(let e=0;e<r;++e)for(let r=0;r<i;++r)a.set(e,r,this.get(t+e,n+r));return a}};function Ff(e,t,n){let r=n(e),i=e;for(let a=e+1;a<t;a++){let t=n(e);t>r&&(r=t,i=e)}return i}let If={down:`pointerdown`,move:`pointermove`,up:`pointerup`,cancel:`pointercancel pointerleave`};function Lf(e){return If[e]||e}let Rf=e=>e.replace(/([^ ]+)/g,Lf),zf=1;function Bf(){return`kchart`+zf++}function Vf(){return Bf()}let Hf=new WeakMap,Uf=Symbol(`id`);function Wf(e,t,n,r,i){qf(e,t,n,r,i)}function Gf(e,t,n,r,i){Yf(e,t,n,r,i)}function Kf(e){return typeof e==`string`}function qf(e,t,n,r,i){(j(t)?t:(t||``).split(` `)).forEach(function(t){Jf(e,t,n,r,i)})}function Jf(e,t,n,r,i){let a=r,o;n&&Ed(n)&&!r?a=n:n&&Kf(n)&&Ed(a)&&(o=n);let s=function(t){let n=t.target?t.target.closest(o):null;if(!o||o&&t.target&&n){let r=o?n:t.currentTarget;Object.defineProperty(t,"currentTarget",{value:r}),Object.defineProperty(t,"delegateTarget",{value:e}),a(t)}};a[Uf]||(a[Uf]=Vf());let c=Hf.get(e);c||(c=new Map,Hf.set(e,c)),c.set(t+a[Uf],s),e.addEventListener(t,s,!!i)}function Yf(e,t,n,r){(j(t)?t:(t||``).split(` `)).forEach(function(t){Xf(e,t,n,r)})}function Xf(e,t,n,r){let i=Hf.get(e);if(i&&n&&n[Uf]){let a=t+n[Uf],o=i.get(a);i.delete(a),o&&e.removeEventListener(t,o,!!r)}}function Zf(){let e=Qf(navigator.userAgent),t={};return t.mobileOS=e,t}function Qf(e){let t=!1,n={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.?(\d+(\.\d+)?)?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[._]([\d._]+)/,ipad:/(iPad).*OS\s+(\d+)[._]([\d_]+)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i},r={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i};for(let i in n)if(e.match(n[i])){if(i===`windows`&&`plugins`in navigator)return!1;t={},t.device=i,t.name=$f(i,r),t[t.name]=!0;break}return t}function $f(e,t,n){for(let n in t)if(t[n].test(e))return n;return n===void 0?e:n}function ep(){}function tp(){return new Date().getTime()}let np=`string`,rp=`function`,ip=function(){this._defaultPrevented=!0},ap=function(){return this._defaultPrevented===!0};var op=class{constructor(){this._events={}}destroy(){this.unbind()}bind(e,t,n){let r=this,i,a=typeof e==np?[e]:e||[],o,s,c,l=typeof t==rp,u;if(t===void 0){for(i in e)r.bind(i,e[i]);return r}for(i=0,o=a.length;i<o;i++){let e=a[i];c=l?t:t[e],c&&(n&&(s=c,c=function(){r.unbind(e,c),s.apply(r,arguments)},c.original=s),u=r._events[e]=r._events[e]||[],u.push(c))}return r}one(e,t){return this.bind(e,t,!0)}first(e,t){let n=this,r,i=typeof e==np?[e]:e,a,o,s=typeof t==rp,c;for(r=0,a=i.length;r<a;r++){let e=i[r];o=s?t:t[e],o&&(c=n._events[e]=n._events[e]||[],c.unshift(o))}return n}trigger(e,t){let n=this,r=n._events[e],i,a;if(r){let e=t||{};for(e.sender=n,e._defaultPrevented=!1,e.preventDefault=ip,e.isDefaultPrevented=ap,r=r.slice(),i=0,a=r.length;i<a;i++)r[i].call(n,e);return e._defaultPrevented===!0}return!1}unbind(e,t){let n=this,r=n._events[e],i;if(e===void 0)n._events={};else if(r)if(t)for(i=r.length-1;i>=0;i--)(r[i]===t||r[i].original===t)&&r.splice(i,1);else n._events[e]=[];return n}_setEvents(e){let t=(this.events||[]).length;for(let n=0;n<t;n++){let t=this.events[n];this.options[t]&&e[t]&&(this.unbind(t,this.options[t]),this._events&&this._events[t]&&delete this._events[t])}this.bind(this.events,e)}};let sp=Object.assign,cp=e=>{e.preventDefault()},lp=800,up=0,dp=`press`,fp=`hold`,pp=`select`,mp=`start`,hp=`move`,gp=`cancel`,_p=`doubleTap`,vp=`release`,yp=`gesturechange`,bp=`gestureend`,xp=`gesturetap`,Sp={api:0,touch:0,mouse:9,pointer:9};function Cp(e,t){let n=e.x.location,r=e.y.location,i=t.x.location,a=t.y.location,o=n-i,s=r-a;return{center:{x:(n+i)/2,y:(r+a)/2},distance:Math.sqrt(o*o+s*s)}}function wp(e){let t=[],n=e.originalEvent||e,r=e.currentTarget;return e.api?t.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e,type:`api`}):t.push({location:n,event:e,target:e.target,currentTarget:r,id:n.pointerId,type:`pointer`}),t}var Tp=class{constructor(e,t){let n=this;n.support=Zf(),n.invalidZeroEvents=this.support.mobileOS&&this.support.mobileOS.android,n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=tp()}move(e){let t=this,n=e[`page`+t.axis],r=tp(),i=r-t.timeStamp||1;!n&&this.invalidZeroEvents||(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/i,t.timeStamp=r)}_updateLocationData(e){let t=this,n=t.axis;t.location=e[`page`+n],t.client=e[`client`+n],t.screen=e[`screen`+n]}},Ep=class{constructor(e,t,n){sp(this,{x:new Tp(`X`,n.location),y:new Tp(`Y`,n.location),type:n.type,threshold:e.threshold||Sp[n.type],userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_clicks:e._clicks,supportDoubleTap:e.supportDoubleTap,_moved:!1,_finished:!1})}press(){this._holdTimeout=setTimeout(()=>this._hold(),this.userEvents.minHold),this._trigger(dp,this.pressEvent)}_tap(e){let t=this;t.userEvents._clicks++,t.userEvents._clicks===1&&(t._clickTimeout=setTimeout(function(){t.userEvents._clicks===1?t._trigger(`tap`,e):t._trigger(_p,e),t.userEvents._clicks=0},300))}_hold(){this._trigger(fp,this.pressEvent)}move(e){let t=this,n=e.type!==`api`&&t.userEvents._shouldNotMove;if(!(t._finished||n)){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(!Op.current||Op.current===t.userEvents)t._start(e);else return t.dispose()}t._finished||t._trigger(hp,e)}}end(e){this.endTime=tp(),!this._finished&&(this._finished=!0,this._trigger(vp,e),this._moved?this._trigger(`end`,e):this.supportDoubleTap?this._tap(e):this._trigger(`tap`,e),clearTimeout(this._holdTimeout),this.dispose())}dispose(){let e=this.userEvents.touches||[];this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout);let t=e.indexOf(this);e.splice(t,1)}skip(){this.dispose()}cancel(){this.dispose()}isMoved(){return this._moved}_start(e){clearTimeout(this._holdTimeout),this.startTime=tp(),this._moved=!0,this._trigger(mp,e)}_trigger(e,t){let n=t.event,r={touch:this,x:this.x,y:this.y,target:this.target,event:n};this.userEvents.notify(e,r)&&n.preventDefault()}_withinIgnoreThreshold(){let e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.threshold}};function Dp(e){let t=If.up.split(` `),n=0,r=t.length;for(;n<r;n++)e(t[n])}var Op=class e extends op{constructor(e,t){super();let n=this,r,i=Zf();if(this.support=i,t||={},this.options=t,r=n.filter=t.filter,n.threshold=t.threshold||up,n.minHold=t.minHold||lp,n.touches=[],n._maxTouches=t.multiTouch?2:1,n.allowSelection=t.allowSelection,n.captureUpIfMoved=t.captureUpIfMoved,n._clicks=0,n.supportDoubleTap=t.supportDoubleTap,sp(n,{element:e,surface:t.surface||e,stopPropagation:t.stopPropagation,pressed:!1}),this._surfaceMoveHandler=this._move.bind(this),Wf(n.surface,Rf(`move`),this._surfaceMoveHandler),this._surfaceEndHandler=this._end.bind(this),Wf(n.surface,Rf(`up cancel`),this._surfaceEndHandler),this._elementStartHandler=this._start.bind(this),Wf(e,Rf(`down`),r,this._elementStartHandler),e.style[`touch-action`]=t.touchAction||`none`,t.preventDragEvent&&(this._elementDragStartHandler=cp,Wf(e,Rf(`dragstart`),this._elementDragStartHandler)),this._elementSelectHandler=this._select.bind(this),Wf(e,Rf(`mousedown`),r,this._elementSelectHandler),n.captureUpIfMoved){let e=n.surface;n._preventIfMovingProxy=n.preventIfMoving.bind(n),Dp(function(t){e.addEventListener(t,n._preventIfMovingProxy,!0)})}n.bind([dp,fp,`tap`,_p,mp,hp,`end`,vp,gp,`gesturestart`,yp,bp,xp,pp],t)}preventIfMoving(e){this._isMoved()&&e.preventDefault()}destroy(){let e=this,t=this.options,n=this.element;if(!e._destroyed){if(e._destroyed=!0,e.captureUpIfMoved){let t=e.surface;Dp(function(n){t.removeEventListener(n,e._preventIfMovingProxy,!0)})}Gf(e.surface,Rf(`move`),this._surfaceMoveHandler),Gf(e.surface,Rf(`up cancel`),this._surfaceEndHandler),Gf(n,Rf(`down`),this._elementStartHandler),t.preventDragEvent&&Gf(n,Rf(`dragstart`),this._elementDragStartHandler),Gf(n,Rf(`mousedown`),this._elementSelectHandler),e._disposeAll(),e.unbind(),delete e.surface,delete e.element,delete e.currentTarget}}capture(){e.current=this}cancel(){this._disposeAll(),this.trigger(gp)}notify(e,t){let n=this.touches,r=e;if(this._isMultiTouch()){switch(r){case hp:r=yp;break;case`end`:r=bp;break;case`tap`:r=xp;break;default:break}sp(t,{touches:n},Cp(n[0],n[1]))}return this.trigger(r,sp(t,{type:r}))}press(e,t,n){this._apiCall(`_start`,e,t,n)}move(e,t){this._apiCall(`_move`,e,t)}end(e,t){this._apiCall(`_end`,e,t)}_isMultiTouch(){return this.touches.length>1}_maxTouchesReached(){return this.touches.length>=this._maxTouches}_disposeAll(){let e=this.touches;for(;e.length>0;)e.pop().dispose()}_isMoved(){return Vd(this.touches,function(e){return e.isMoved()}).length}_select(e){(!this.allowSelection||this.trigger(pp,{event:e}))&&e.preventDefault()}_start(t){if(t.which&&t.which>1||this._maxTouchesReached())return;e.current=null,this.currentTarget=t.currentTarget,this.stopPropagation&&t.stopPropagation();let n,r=wp(t);for(let e=0;e<r.length&&!this._maxTouchesReached();e++){let t=r[e];if(n=this.filter?t.currentTarget:this.element,n&&n.length===0)continue;let i=new Ep(this,n,t);this.touches.push(i),i.press(),this._isMultiTouch()&&this.notify(`gesturestart`,{})}}_move(e){this._eachTouch(`move`,e)}_end(e){this._eachTouch(`end`,e)}_eachTouch(e,t){let n=this,r={},i=wp(t),a=n.touches,o,s,c,l;for(o=0;o<a.length;o++)s=a[o],r[s.id]=s;for(o=0;o<i.length;o++)c=i[o],l=r[c.id],l&&(e===`move`&&c.type===`pointer`&&!this.surface.hasPointerCapture(c.id)&&this.surface.setPointerCapture(c.id),l[e](c))}_apiCall(e,t,n,r){this[e]({api:!0,pageX:t,pageY:n,clientX:t,clientY:n,target:r||this.element,stopPropagation:ep,preventDefault:ep})}static defaultThreshold(e){up=e}static minHold(e){lp=e}},X=class e{constructor(e,t){this.x=e||0,this.y=t||0}clone(){return new e(this.x,this.y)}equals(e){return e&&this.x===e.x&&this.y===e.y}rotate(e,t){let n=cf(t),r=Math.cos(n),i=Math.sin(n),{x:a,y:o}=e,{x:s,y:c}=this;return this.x=q(a+(s-a)*r+(c-o)*i,3),this.y=q(o+(c-o)*r-(s-a)*i,3),this}multiply(e){return this.x*=e,this.y*=e,this}distanceTo(e){let t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)}static onCircle(t,n,r){let i=cf(n);return new e(t.x-r*Math.cos(i),t.y-r*Math.sin(i))}},Z=class e{constructor(e,t,n,r){this.x1=e||0,this.y1=t||0,this.x2=n||0,this.y2=r||0}equals(e){return this.x1===e.x1&&this.x2===e.x2&&this.y1===e.y1&&this.y2===e.y2}width(){return this.x2-this.x1}height(){return this.y2-this.y1}translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this}move(e,t){let n=this.height(),r=this.width();return e!==void 0&&(this.x1=e,this.x2=this.x1+r),t!==void 0&&(this.y1=t,this.y2=this.y1+n),this}wrap(e){return this.x1=Math.min(this.x1,e.x1),this.y1=Math.min(this.y1,e.y1),this.x2=Math.max(this.x2,e.x2),this.y2=Math.max(this.y2,e.y2),this}wrapLimit(e,t,n){return this.x1=Math.min(this.x1,Math.max(this.x1-t,e.x1)),this.y1=Math.min(this.y1,Math.max(this.y1-n,e.y1)),this.x2=Math.max(this.x2,Math.min(this.x2+t,e.x2)),this.y2=Math.max(this.y2,Math.min(this.y2+n,e.y2)),this}wrapPoint(t){let n=j(t),r=n?t[0]:t.x,i=n?t[1]:t.y;return this.wrap(new e(r,i,r,i)),this}snapTo(e,t){return(t===`x`||!t)&&(this.x1=e.x1,this.x2=e.x2),(t===`y`||!t)&&(this.y1=e.y1,this.y2=e.y2),this}alignTo(e,t){let n=this.height(),r=this.width(),i=t===`top`||t===`bottom`?`y`:`x`,a=i===`y`?n:r;if(t===`center`){let t=e.center(),n=this.center();this.x1+=t.x-n.x,this.y1+=t.y-n.y}else t===`top`||t===`left`?this[i+1]=e[i+1]-a:this[i+1]=e[i+2];return this.x2=this.x1+r,this.y2=this.y1+n,this}shrink(e,t){return this.x2-=e,this.y2-=t,this}expand(e,t){return this.shrink(-e,-t),this}pad(e){let t=U(e);return this.x1-=t.left,this.x2+=t.right,this.y1-=t.top,this.y2+=t.bottom,this}unpad(e){let t=U(e);return t.left=-t.left,t.top=-t.top,t.right=-t.right,t.bottom=-t.bottom,this.pad(t)}clone(){return new e(this.x1,this.y1,this.x2,this.y2)}center(){return new X(this.x1+this.width()/2,this.y1+this.height()/2)}containsPoint(e){return e.x>=this.x1&&e.x<=this.x2&&e.y>=this.y1&&e.y<=this.y2}points(){return[new X(this.x1,this.y1),new X(this.x2,this.y1),new X(this.x2,this.y2),new X(this.x1,this.y2)]}getHash(){return[this.x1,this.y1,this.x2,this.y2].join(`,`)}overlaps(e){return!(e.y2<this.y1||this.y2<e.y1||e.x2<this.x1||this.x2<e.x1)}rotate(e){let t=this.width(),n=this.height(),{x:r,y:i}=this.center(),a=kp(0,0,r,i,e),o=kp(t,0,r,i,e),s=kp(t,n,r,i,e),c=kp(0,n,r,i,e);return t=Math.max(a.x,o.x,s.x,c.x)-Math.min(a.x,o.x,s.x,c.x),n=Math.max(a.y,o.y,s.y,c.y)-Math.min(a.y,o.y,s.y,c.y),this.x2=this.x1+t,this.y2=this.y1+n,this}toRect(){return new N([this.x1,this.y1],[this.width(),this.height()])}hasSize(){return this.width()!==0&&this.height()!==0}align(e,t,n){return t===`x`?this.alignX(e,n):this.alignY(e,n),this}alignX(e,t){let n=this.width();t===`left`?(this.x1=e.x1,this.x2=this.x1+n):t===`right`?(this.x2=e.x2,this.x1=this.x2-n):t===`center`&&(this.x1=e.x1+(e.width()-n)/2,this.x2=this.x1+n)}alignY(e,t){let n=this.height();t===`top`?(this.y1=e.y1,this.y2=this.y1+n):t===`bottom`?(this.y2=e.y2,this.y1=this.y2-n):t===`center`&&(this.y1=e.y1+(e.height()-n)/2,this.y2=this.y1+n)}};function kp(e,t,n,r,i){let a=cf(i);return new X(n+(e-n)*Math.cos(a)+(t-r)*Math.sin(a),r-(e-n)*Math.sin(a)+(t-r)*Math.cos(a))}var Ap=class e{constructor(e,t,n,r,i){this.center=e,this.innerRadius=t,this.radius=n,this.startAngle=r,this.angle=i}clone(){return new e(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)}middle(){return this.startAngle+this.angle/2}setRadius(e,t){return t?this.innerRadius=e:this.radius=e,this}point(e,t){let n=cf(e),r=Math.cos(n),i=Math.sin(n),a=t?this.innerRadius:this.radius;return new X(q(this.center.x-r*a,3),q(this.center.y-i*a,3))}adjacentBox(e,t,n){let r=this.clone().expand(e),i=r.middle(),a=r.point(i),o=t/2,s=n/2,c=Math.sin(cf(i)),l=Math.cos(cf(i)),u=a.x-o,d=a.y-s;return Math.abs(c)<.9&&(u+=o*-l/Math.abs(l)),Math.abs(l)<.9&&(d+=s*-c/Math.abs(c)),new Z(u,d,u+t,d+n)}containsPoint(e){let t=this.center,n=this.innerRadius,r=this.radius,i=this.startAngle,a=this.startAngle+this.angle,o=e.x-t.x,s=e.y-t.y,c=new X(o,s),l=this.point(i),u=new X(l.x-t.x,l.y-t.y),d=this.point(a),f=new X(d.x-t.x,d.y-t.y),p=q(o*o+s*s,3);return(u.equals(c)||bd(u,c))&&!bd(f,c)&&p>=n*n&&p<=r*r}getBBox(){let e=new Z(D,D,ne,ne),t=q(this.startAngle%360),n=q((t+this.angle)%360),r=this.innerRadius,i=[0,90,180,270,t,n].sort(jp),a=i.indexOf(t),o=i.indexOf(n),s;s=t===n?i:a<o?i.slice(a,o+1):[].concat(i.slice(0,o+1),i.slice(a,i.length));for(let t=0;t<s.length;t++){let n=this.point(s[t]);e.wrapPoint(n),e.wrapPoint(n,r)}return r||e.wrapPoint(this.center),e}expand(e){return this.radius+=e,this}};function jp(e,t){return e-t}(class e extends Ap{constructor(e,t,n,r){super(e,0,t,n,r)}expand(e){return super.expand(e)}clone(){return new e(this.center,this.radius,this.startAngle,this.angle)}setRadius(e){return this.radius=e,this}});var Mp=class{createRing(e,t){let n=e.startAngle+180,r=e.angle+n;(e.angle===0||e.angle>0&&n===r)&&(r+=.001);let i=new M(e.center.x,e.center.y),a=Math.max(e.radius,0),o=Math.max(e.innerRadius,0),s=new Wn(i,{startAngle:n,endAngle:r,radiusX:a,radiusY:a}),c=F.fromArc(s,t).close();if(o){s.radiusX=s.radiusY=o;let e=s.pointAt(r);c.lineTo(e.x,e.y),c.arc(r,n,o,o,!0)}else c.lineTo(i.x,i.y);return c}};Mp.current=new Mp;var Q=class{constructor(e){this.children=[],this.initOptions(e)}initOptions(e){this.options=H({},this.options,this.initUserOptions(e))}initUserOptions(e){return e}reflow(e){let t=this.children,n;for(let r=0;r<t.length;r++){let i=t[r];i.reflow(e),n=n?n.wrap(i.box):i.box.clone()}this.box=n||e}destroy(){let e=this.children;this.animation&&this.animation.destroy();for(let t=0;t<e.length;t++)e[t].destroy()}getRoot(){let e=this.parent;return e?e.getRoot():null}getSender(){let e=this.getService();if(e)return e.sender}getService(){let e=this;for(;e;){if(e.chartService)return e.chartService;e=e.parent}}translateChildren(e,t){let n=this.children,r=n.length;for(let i=0;i<r;i++)n[i].box.translate(e,t)}append(){for(let e=0;e<arguments.length;e++){let t=arguments[e];this.children.push(t),t.parent=this}}renderVisual(){this.options.visible!==!1&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())}addVisual(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))}renderChildren(){let e=this.children,t=e.length;for(let n=0;n<t;n++)e[n].renderVisual()}createVisual(){this.visual=new I({zIndex:this.options.zIndex,visible:J(this.options.visible,!0)})}createAnimation(){this.visual&&this.options.animation&&(this.animation=ta.create(this.visual,this.options.animation))}appendVisual(e){e.chartElement||=this,e.options.noclip?this.clipRoot().visual.append(e):e.options.zIndex===void 0?this.isStackRoot?this.stackVisual(e):this.visual?this.visual.append(e):this.parent.appendVisual(e):this.stackRoot().stackVisual(e)}clipRoot(){return this.parent?this.parent.clipRoot():this}stackRoot(){return this.parent?this.parent.stackRoot():this}stackVisual(e){let t=e.options.zIndex||0,n=this.visual.children,r=n.length,i;for(i=0;i<r;i++){let e=n[i];if(J(e.options.zIndex,0)>t)break}this.visual.insert(i,e)}traverse(e){let t=this.children,n=t.length;for(let r=0;r<n;r++){let n=t[r];e(n),n.traverse&&n.traverse(e)}}closest(e){let t=this,n=!1;for(;t&&!n;)n=e(t),n||(t=t.parent);if(n)return t}renderComplete(){}hasHighlight(){let e=(this.options||{}).highlight;return!(!this.createHighlight||e&&e.visible===!1||this.visible===!1)}toggleHighlight(e,t){let n=(this.options||{}).highlight||{},r=n.visual,i=this._highlight;if(!i){let e={fill:{color:k,opacity:t||.2},stroke:{color:k,width:1,opacity:t||.2}};if(r){if(i=this._highlight=r(Object.assign(this.highlightVisualArgs(),{createVisual:()=>this.createHighlight(e),sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total})),!i)return}else i=this._highlight=this.createHighlight(e);i.options.zIndex===void 0&&(i.options.zIndex=J(n.zIndex,this.options.zIndex)),this.appendVisual(i)}i.visible(e)}toggleFocusHighlight(e){let t=(this.options||{}).focusHighlight||{},n=this._focusHighlight;if(!(!e&&!n)){if(!n){let e=this.getRoot().options.background,r=Tf(e),i={fill:{opacity:t.opacity,color:t.color},stroke:Object.assign({},{color:r},t.border),zIndex:t.zIndex};n=this._focusHighlight=this.createFocusHighlight(i),this.appendVisual(n)}n.visible(e)}}createGradientOverlay(e,t,n){let r=new F(Object.assign({stroke:{color:`none`},fill:this.createGradient(n),closed:e.options.closed},t));return r.segments.elements(e.segments.elements()),r}createGradient(e){if(this.parent)return this.parent.createGradient(e)}supportsPointInactiveOpacity(){return!0}};Q.prototype.options={};let{dotsPattern:Np,verticalStripesPattern:Pp,crosshatchPattern:Fp,diagonalStripesPattern:Ip,gridPattern:Lp}=To,Rp={dots:Np,verticalStripes:Pp,crosshatch:Fp,diagonalStripes:Ip,grid:Lp};function zp(e,t){return Ed(e)?e(t):e}function Bp(e,t,n){let r=zp(e,n),i=r&&Rp[r.type];return i?i(Object.assign({},t,r)):t}var Vp=class extends Q{constructor(e){super(e),this.options.margin=U(this.options.margin),this.options.padding=U(this.options.padding)}reflow(e){let t=this.options,{width:n,height:r,shrinkToFit:i}=t,a=n&&r,o=t.margin,s=t.padding,c=t.border.width,l,u=()=>{this.align(e,`x`,t.align),this.align(e,`y`,t.vAlign),this.paddingBox=l.clone().unpad(o).unpad(c)},d=e.clone();a&&(d.x2=d.x1+n,d.y2=d.y1+r),i&&d.unpad(o).unpad(c).unpad(s),super.reflow(d),l=a?this.box=new Z(0,0,n,r):this.box,i&&a?(u(),d=this.contentBox=this.paddingBox.clone().unpad(s)):(d=this.contentBox=l.clone(),l.pad(s).pad(c).pad(o),u()),this.translateChildren(l.x1-d.x1+o.left+c+s.left,l.y1-d.y1+o.top+c+s.top);let f=this.children;for(let e=0;e<f.length;e++){let t=f[e];t.reflow(t.box)}}align(e,t,n){this.box.align(e,t,n)}hasBox(){let e=this.options;return e.border.width||e.background}createVisual(){super.createVisual(),this.options.visible&&this.hasBox()&&this.visual.append(F.fromRect(this.paddingBox.toRect(),this.visualStyle()))}visualStyle(){let e=this.options,t=e.border||{};return{stroke:{width:t.width,color:t.color,opacity:J(t.opacity,e.opacity),dashType:t.dashType},fill:Bp(e.pattern,{color:e.background,opacity:e.opacity},void 0),cursor:e.cursor}}};Y(Vp,{align:E,vAlign:`top`,margin:{},padding:{},border:{color:b,width:0},background:``,shrinkToFit:!1,width:0,height:0,visible:!0});function Hp(e,t){e&&t&&(e.options.className=t.className,e.options.role=t.role,e.options.ariaLabel=t.ariaLabel,e.options.ariaRoleDescription=t.ariaRoleDescription,e.options.ariaChecked=t.ariaChecked)}var Up=class extends Vp{constructor(e,t){super(e),this.pointData=t}getElement(){let{options:e,paddingBox:t}=this,{type:n,rotation:r}=e,i=t.center(),a=t.width()/2,o=t.height()/2;if(!e.visible||!this.hasBox())return null;let s=this.visualStyle(),c;if(n===`circle`)c=new Rn(new jn([q(t.x1+a,3),q(t.y1+o,3)],Math.min(a,o)),s);else if(n===`triangle`)c=F.fromPoints([[t.x1+a,t.y1],[t.x1,t.y2],[t.x2,t.y2]],s).close();else if(n===`cross`)c=new Hr(s),c.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),c.moveTo(t.x1,t.y2).lineTo(t.x2,t.y1);else{let r=t.toRect();if(n===`roundedRect`){let t=J(e.borderRadius,r.width()/5);r.setCornerRadius(t)}c=F.fromRect(r,s)}return r&&c.transform(P().rotate(-r,[i.x,i.y])),c.options.zIndex=e.zIndex,c}createElement(){let e=this.options.visual,t=this.pointData||{},n;return n=e?e({value:t.value,dataItem:t.dataItem,sender:this.getSender(),series:t.series,category:t.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),n}visualOptions(){let e=this.options;return{background:e.background,border:e.border,margin:e.margin,padding:e.padding,type:e.type,size:e.width,visible:e.visible}}createVisual(){this.visual=this.createElement(),Hp(this.visual,this.options.accessibilityOptions)}};Y(Up,{type:C,align:S,vAlign:S});let Wp=`radial`,Gp={glass:{type:`linear`,rotation:0,stops:[{offset:0,color:k,opacity:0},{offset:.25,color:k,opacity:.3},{offset:1,color:k,opacity:0}]},sharpBevel:{type:Wp,stops:[{offset:0,color:k,opacity:.55},{offset:.65,color:k,opacity:0},{offset:.95,color:k,opacity:.25}]},roundedBevel:{type:Wp,stops:[{offset:.33,color:k,opacity:.06},{offset:.83,color:k,opacity:.2},{offset:.95,color:k,opacity:0}]},roundedGlass:{type:Wp,supportVML:!1,stops:[{offset:0,color:k,opacity:0},{offset:.5,color:k,opacity:.3},{offset:.99,color:k,opacity:0}]},sharpGlass:{type:Wp,supportVML:!1,stops:[{offset:0,color:k,opacity:.2},{offset:.15,color:k,opacity:.15},{offset:.17,color:k,opacity:.35},{offset:.85,color:k,opacity:.05},{offset:.87,color:k,opacity:.15},{offset:.99,color:k,opacity:0}]},bubbleShadow:{type:Wp,center:[.5,.5],radius:.5}};function Kp(e,t){if(e.x1===t.x1&&e.y1===t.y1&&e.x2===t.x2&&e.y2===t.y2)return t;let n=Math.min(e.x1,t.x1),r=Math.max(e.x1,t.x1),i=Math.min(e.x2,t.x2),a=Math.max(e.x2,t.x2),o=Math.min(e.y1,t.y1),s=Math.max(e.y1,t.y1),c=Math.min(e.y2,t.y2),l=Math.max(e.y2,t.y2),u=[];return u[0]=new Z(r,o,i,s),u[1]=new Z(n,s,r,c),u[2]=new Z(i,s,a,c),u[3]=new Z(r,c,i,l),e.x1===n&&e.y1===o||t.x1===n&&t.y1===o?(u[4]=new Z(n,o,r,s),u[5]=new Z(i,c,a,l)):(u[4]=new Z(i,o,a,s),u[5]=new Z(n,c,r,l)),Vd(u,function(e){return e.height()>0&&e.width()>0})[0]}var qp=class extends Q{constructor(e){super(e);let t=this.options;t.width=parseInt(t.width,10),t.height=parseInt(t.height,10),this.gradients={}}reflow(){let{options:e,children:t}=this,n=new Z(0,0,e.width,e.height);this.box=n.unpad(e.margin);for(let e=0;e<t.length;e++)t[e].reflow(n),n=Kp(n,t[e].box)||new Z}createVisual(){this.visual=new I,this.createBackground()}createBackground(){let e=this.options,t=e.border||{},n=this.box.clone().pad(e.margin).unpad(t.width),r=F.fromRect(n.toRect(),{stroke:{color:t.width?t.color:``,width:t.width,dashType:t.dashType},fill:{color:e.background,opacity:e.opacity},zIndex:-10});this.visual.append(r)}getRoot(){return this}createGradient(e){let t=this.gradients,n=sf(e),r=Gp[e.gradient],i;if(t[n])i=t[n];else{let a=Object.assign({},r,e);r.type===`linear`?i=new xi(a):(e.innerRadius&&(a.stops=Jp(a)),i=new Si(a),i.supportVML=r.supportVML!==!1),t[n]=i}return i}cleanGradients(){let e=this.gradients;for(let t in e)e[t]._observers=[]}size(){let e=this.options;return new Z(0,0,e.width,e.height)}};Y(qp,{width:600,height:400,background:k,border:{color:b,width:0},margin:U(5),zIndex:-2});function Jp(e){let t=e.stops,n=e.innerRadius/e.radius*100,r=t.length,i=[];for(let e=0;e<r;e++){let r=Object.assign({},t[e]);r.offset=(r.offset*(100-n)+n)/100,i.push(r)}return i}var Yp=class extends Q{constructor(e){super(e),this._initDirection()}_initDirection(){let e=this.options;e.vertical?(this.groupAxis=`x`,this.elementAxis=`y`,this.groupSizeField=oe,this.elementSizeField=te,this.groupSpacing=e.spacing,this.elementSpacing=e.vSpacing):(this.groupAxis=`y`,this.elementAxis=`x`,this.groupSizeField=te,this.elementSizeField=oe,this.groupSpacing=e.vSpacing,this.elementSpacing=e.spacing)}reflow(e){this.box=e.clone(),this.reflowChildren()}reflowChildren(){let{box:e,elementAxis:t,groupAxis:n,elementSizeField:r,groupSizeField:i}=this,{groups:a,groupsSize:o,maxGroupElementsSize:s}=this.groupOptions(),c=a.length,l=e[n+1]+this.alignStart(o,e[i]());if(c){let u=l;for(let o=0;o<c;o++){let s=a[o],c=s.groupElements,l=e[t+1],d=c.length;for(let e=0;e<d;e++){let a=c[e],o=this.elementSize(a),d=u+this.alignStart(o[i],s.groupSize),f=new Z;f[n+1]=d,f[n+2]=d+o[i],f[t+1]=l,f[t+2]=l+o[r],a.reflow(f),l+=o[r]+this.elementSpacing}u+=s.groupSize+this.groupSpacing}e[n+1]=l,e[n+2]=l+o,e[t+2]=e[t+1]+s}}alignStart(e,t){let n=0,r=this.options.align;return r===`right`||r===`bottom`?n=t-e:r===`center`&&(n=(t-e)/2),n}groupOptions(){let{box:e,children:t,elementSizeField:n,groupSizeField:r,elementSpacing:i,groupSpacing:a}=this,o=q(e[n]()),s=t.length,c=[],l=0,u=0,d=0,f=0,p=[];for(let m=0;m<s;m++){let s=t[m];s.box||s.reflow(e);let h=this.elementSize(s);this.options.wrap&&q(u+i+h[n])>o&&(c.push({groupElements:p,groupSize:l,groupElementsSize:u}),f=Math.max(f,u),d+=a+l,l=0,u=0,p=[]),l=Math.max(l,h[r]),u>0&&(u+=i),u+=h[n],p.push(s)}return c.push({groupElements:p,groupSize:l,groupElementsSize:u}),f=Math.max(f,u),d+=l,{groups:c,groupsSize:d,maxGroupElementsSize:f}}elementSize(e){return{width:e.box.width(),height:e.box.height()}}createVisual(){}};Y(Yp,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});let Xp=Wr;var Zp=class extends Q{constructor(e,t){super(t),this.content=e,this.reflow(new Z)}reflow(e){let t=this.options,n=t.size=Xt(this.content,{font:t.font});this.baseline=n.baseline,this.box=new Z(e.x1,e.y1,e.x1+n.width,e.y1+n.height)}createVisual(){let{font:e,color:t,opacity:n,cursor:r,stroke:i,paintOrder:a}=this.options;this.visual=new Xp(this.content,this.box.toRect().topLeft(),{font:e,fill:{color:t,opacity:n},cursor:r,stroke:i,paintOrder:a})}};Y(Zp,{font:ee,color:b});function Qp(e){let t=e.origin,n=e.bottomRight();return new Z(t.x,t.y,n.x,n.y)}let $p=/\n/m;var em=class extends Vp{constructor(e,t,n){super(t),this.content=e,this.data=n,this._initContainer(),this.options._autoReflow!==!1&&this.reflow(new Z)}_initContainer(){let e=this.options,t=String(this.content).split($p),n=new Yp({vertical:!0,align:e.align,wrap:!1}),r=H({},e,{opacity:1,animation:null});this.container=n,this.append(n);for(let e=0;e<t.length;e++){let i=new Zp(t[e].trim(),r);n.append(i)}}reflow(e){let t=this.options,n=t.visual;if(this.container.options.align=t.align,n&&!this._boxReflow){let r=e;r.hasSize()||(this._boxReflow=!0,this.reflow(r),this._boxReflow=!1,r=this.box);let i=this.visual=n(this.visualContext(r));i&&(r=Qp(i.clippedBBox()||new N),i.options.zIndex=t.zIndex),this.box=this.contentBox=this.paddingBox=r}else if(super.reflow(e),t.rotation){let n=U(t.margin),r=this.box.unpad(n);this.targetBox=e,this.normalBox=r.clone(),r=this.rotate(),r.translate(n.left-n.right,n.top-n.bottom),this.rotatedBox=r.clone(),r.pad(n)}}createVisual(){let e=this.options;if(this.visual=new I({transform:this.rotationTransform(),zIndex:e.zIndex,noclip:e.noclip}),this.hasBox()){let e=F.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(e)}}renderVisual(){if(this.options.visible)if(this.options.visual){let e=this.visual;e&&!G(e.options.noclip)&&(e.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else super.renderVisual()}visualContext(e){let t={text:this.content,rect:e.toRect(),sender:this.getSender(),options:this.options,createVisual:()=>(this._boxReflow=!0,this.reflow(e),this._boxReflow=!1,this.getDefaultVisual())};return this.data&&Object.assign(t,this.data),t}getDefaultVisual(){this.createVisual(),this.renderChildren();let e=this.visual;return delete this.visual,e}rotate(){let e=this.options;return this.box.rotate(e.rotation),this.align(this.targetBox,`x`,e.align),this.align(this.targetBox,`y`,e.vAlign),this.box}rotationTransform(){let e=this.options.rotation;if(!e)return null;let{x:t,y:n}=this.normalBox.center(),r=this.rotatedBox.center();return P().translate(r.x-t,r.y-n).rotate(e,[t,n])}},tm=class e extends Q{constructor(e){super(e),this._textBox=new em(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})),this.append(this._textBox)}reflow(e){super.reflow(e),this.box.snapTo(e,`x`)}static buildTitle(t,n){let r=t;typeof t==`string`&&(r={text:t}),r=Object.assign({visible:!0},n,r);let i;return r&&r.visible&&r.text&&(i=new e(r)),i}static orderTitles(e){let t=[].concat(e),n=t.filter(e=>e&&e.options.position!==`bottom`),r=t.filter(e=>e&&e.options.position===`bottom`);return nm(n),nm(r),r.reverse(),n.concat(r)}};function nm(e){for(let t=1;t<e.length;t++){let n=e[t]._textBox,r=e[t-1]._textBox;r.options.margin=Object.assign(U(r.options.margin),{bottom:0}),n.options.margin=Object.assign(U(n.options.margin),{top:0})}}Y(tm,{color:b,position:`top`,align:S,margin:U(5),padding:U(5)});var rm=class extends em{constructor(e,t,n,r,i){super(t,i),this.text=t,this.value=e,this.index=n,this.dataItem=r,this.reflow(new Z)}visualContext(e){let t=super.visualContext(e);return t.value=this.value,t.dataItem=this.dataItem,t.format=this.options.format,t.culture=this.options.culture,t}click(e,t){e.trigger(`axisLabelClick`,{element:rf(t),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})}rotate(){if(this.options.alignRotation!==`center`){let e=this.normalBox.toRect(),t=this.rotationTransform();this.box=Qp(e.bbox(t.matrix()))}else super.rotate();return this.box}rotationTransform(){let e=this.options,t=e.rotation;if(!t)return null;if(e.alignRotation===`center`)return super.rotationTransform();let n=P().rotate(t).matrix(),r=this.normalBox.toRect(),i=this.targetBox.toRect(),a=e.rotationOrigin||`top`,o=a===`top`||a===`bottom`?`x`:`y`,s=a===`top`||a===`bottom`?`y`:`x`,c=a===`top`||a===`left`?i.origin:i.bottomRight(),l=r.topLeft().transformCopy(n),u=r.topRight().transformCopy(n),d=r.bottomRight().transformCopy(n),f=r.bottomLeft().transformCopy(n),p=N.fromPoints(l,u,d,f),m={[s]:i.origin[s]-p.origin[s]},h=Math.abs(l[s]+m[s]-c[s]),g=Math.abs(u[s]+m[s]-c[s]),_,v;q(h,10)===q(g,10)?(_=l,v=u):g<h?(_=u,v=d):(_=l,v=f);let y=_[o]+(v[o]-_[o])/2;return m[o]=i.center()[o]-y,P().translate(m.x,m.y).rotate(t)}};Y(rm,{_autoReflow:!1});var im=class extends Vp{constructor(e,t,n){super(t),this.fields=e,this.chartService=n,this.render()}hide(){this.options.visible=!1}show(){this.options.visible=!0}render(){let e=this.options;if(e.visible){let{label:t,icon:n}=e,r=new Z,i=()=>this,a=n.size,o=this.fields.text,s,c;if(G(t)&&t.visible){let e=Id(t);e?o=e(this.fields):t.format&&(o=this.chartService.format.auto(t.format,o)),t.color||=t.position===`inside`?`#fff`:n.background,this.label=new em(o,H({},t)),this.label.aliasFor=i,t.position===`inside`&&!G(a)&&(n.type===`circle`?a=Math.max(this.label.box.width(),this.label.box.height()):(s=this.label.box.width(),c=this.label.box.height()),r.wrap(this.label.box))}n.width=s||a||7,n.height=c||a||7;let l=new Up(H({},n));l.aliasFor=i,this.marker=l,this.append(l),this.label&&this.append(this.label),l.reflow(new Z),this.wrapperBox=r.wrap(l.box)}}reflow(e){let{options:t,label:n,marker:r,wrapperBox:i}=this,a=e.center(),o=t.line.length,s=t.position;if(t.visible){let c,l,u;W(s,[`left`,`right`])?s===`left`?(u=i.alignTo(e,s).translate(-o,e.center().y-i.center().y),t.line.visible&&(c=[e.x1,a.y],this.linePoints=[c,[u.x2,a.y]],l=u.clone().wrapPoint(c))):(u=i.alignTo(e,s).translate(o,e.center().y-i.center().y),t.line.visible&&(c=[e.x2,a.y],this.linePoints=[c,[u.x1,a.y]],l=u.clone().wrapPoint(c))):s===`bottom`?(u=i.alignTo(e,s).translate(e.center().x-i.center().x,o),t.line.visible&&(c=[a.x,e.y2],this.linePoints=[c,[a.x,u.y1]],l=u.clone().wrapPoint(c))):(u=i.alignTo(e,s).translate(e.center().x-i.center().x,-o),t.line.visible&&(c=[a.x,e.y1],this.linePoints=[c,[a.x,u.y2]],l=u.clone().wrapPoint(c))),r&&r.reflow(u),n&&(n.reflow(u),r&&(t.label.position===`outside`&&n.box.alignTo(r.box,s),n.reflow(n.box))),this.contentBox=u,this.targetBox=e,this.box=l||u}}createVisual(){super.createVisual(),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()}renderVisual(){let e=this.options,t=e.visual;e.visible&&t?(this.visual=t(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:e.background,border:e.background,icon:e.icon,label:e.label,line:e.line,position:e.position,visible:e.visible},createVisual:()=>{this.createVisual(),this.renderChildren();let e=this.visual;return delete this.visual,e}})),this.addVisual()):super.renderVisual()}createLine(){let e=this.options.line;if(this.linePoints){let t=F.fromPoints(this.linePoints,{stroke:{color:e.color,width:e.width,dashType:e.dashType}});yd(t),this.visual.append(t)}}click(e,t){let n=this.eventArgs(t);e.trigger(`noteClick`,n)||t.preventDefault()}over(e,t){let n=this.eventArgs(t);e.trigger(`noteHover`,n)||t.preventDefault()}out(e,t){let n=this.eventArgs(t);e.trigger(`noteLeave`,n)}eventArgs(e){let t=this.options;return Object.assign(this.fields,{element:rf(e),text:G(t.label)?t.label.text:``,visual:this.visual})}};Y(im,{icon:{visible:!0,type:C},label:{position:`inside`,visible:!0,align:S,vAlign:S},line:{visible:!0},visible:!0,position:`top`,zIndex:2});let am={format:(e,t)=>t,toString:e=>e,parseDate:e=>new Date(e),firstDay:()=>0};var om=class{static register(e){am=e}static get implementation(){return am}};let sm=/\{(\d+)(:[^\}]+)?\}/g;var cm=class{constructor(e){this._intlService=e}get intl(){return this._intlService||om.implementation}set intl(e){this._intlService=e}auto(e,...t){let n=this.intl;return xd(e)&&e.match(T)?n.format(e,...t):n.toString(t[0],e)}localeAuto(e,t,n){let r=this.intl,i;return i=xd(e)&&e.match(T)?e.replace(sm,function(e,i,a){let o=t[parseInt(i,10)];return r.toString(o,a?a.substring(1):``,n)}):r.toString(t[0],e,n),i}},lm=class{constructor(e,t={}){this._intlService=t.intlService,this.sender=t.sender||e,this.format=new cm(t.intlService),this.chart=e,this.rtl=!!t.rtl}get intl(){return this._intlService||om.implementation}set intl(e){this._intlService=e,this.format.intl=e}notify(e,t){this.chart&&this.chart.trigger(e,t)}isPannable(e){let t=((this.chart||{}).options||{}).pannable;return t&&t.lock!==e}};let um;var dm=class{static register(e){um=e}static create(e,t){let n;return n=um?um.create(e,t):new Op(e,Object.assign({},{multiTouch:!0,touchAction:`manipulation`},t)),n}};function fm(e,t){let{tickX:n,tickY:r,position:i}=e,a=new F({stroke:{width:t.width,color:t.color}});return e.vertical?a.moveTo(n,i).lineTo(n+t.size,i):a.moveTo(i,r).lineTo(i,r+t.size),yd(a),a}function pm(e,t){let{lineStart:n,lineEnd:r,position:i}=e,a=new F({stroke:{width:t.width,color:t.color,dashType:t.dashType}});return e.vertical?a.moveTo(n,i).lineTo(r,i):a.moveTo(i,n).lineTo(i,r),yd(a),a}var mm=class extends Q{constructor(e,t=new lm){super(e),this.chartService=t,this.options.visible||(this.options=H({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=H({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.minorTickType!==re},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=H({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.majorTickType!==re},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType}),this.initFields(),this.options._deferLabels||this.createLabels(),this.createTitle(),this.createNotes()}initFields(){}labelsRange(){return{min:this.options.labels.skip,max:this.labelsCount()}}normalizeLabelRotation(e){let t=e.rotation;kd(t)&&(e.alignRotation=t.align,e.rotation=t.angle)}createLabels(){let e=this.options,t=e.vertical?O:S,n=H({},e.labels,{align:t,zIndex:e.zIndex}),r=Math.max(1,n.step);if(this.clearLabels(),n.visible){this.normalizeLabelRotation(n),n.rotation===`auto`&&(n.rotation=0,e.autoRotateLabels=!0);let t=this.labelsRange();for(let e=t.min;e<t.max;e+=r){let r={index:e,count:t.max},i=this.createAxisLabel(e,n,r);i&&(this.append(i),this.labels.push(i))}}}clearLabels(){this.children=Vd(this.children,e=>!(e instanceof rm)),this.labels=[]}clearTitle(){this.title&&=(this.children=Vd(this.children,e=>e!==this.title),void 0)}clear(){this.clearLabels(),this.clearTitle()}lineBox(){let{options:e,box:t}=this,n=e.vertical,r=e.labels.mirror,i=r?t.x1:t.x2,a=r?t.y2:t.y1,o=e.line.width||0;return n?new Z(i,t.y1,i,t.y2-o):new Z(t.x1,a,t.x2-o,a)}createTitle(){let e=this.options,t=H({rotation:e.vertical?-90:0,text:``,zIndex:1,visualSize:!0},e.title);if(t.visible&&t.text){let e=new em(t.text,t);this.append(e),this.title=e}}createNotes(){let e=this.options,t=e.notes,n=t.data||[];this.notes=[];for(let r=0;r<n.length;r++){let i=H({},t,n[r]);i.value=this.parseNoteValue(i.value);let a=new im({value:i.value,text:i.label.text,dataItem:i},i,this.chartService);a.options.visible&&(G(a.options.position)?e.vertical&&!W(a.options.position,[`left`,`right`])?a.options.position=e.reverse?E:O:!e.vertical&&!W(a.options.position,[`top`,`bottom`])&&(a.options.position=e.reverse?x:`top`):e.vertical?a.options.position=e.reverse?E:O:a.options.position=e.reverse?x:`top`,this.append(a),this.notes.push(a))}}parseNoteValue(e){return e}renderVisual(){super.renderVisual(),this.createPlotBands()}createVisual(){super.createVisual(),this.createBackground(),this.createLine()}gridLinesVisual(){let e=this._gridLines;return e||(e=this._gridLines=new I({zIndex:-2}),this.appendVisual(this._gridLines)),e}createTicks(e){let t=this.options,n=this.lineBox(),r=t.labels.mirror,i=t.majorTicks.visible?t.majorUnit:0,a={vertical:t.vertical};function o(t,i,o){let s=t.length,c=Math.max(1,i.step);if(i.visible)for(let l=i.skip;l<s;l+=c)G(o)&&l%o===0||(a.tickX=r?n.x2:n.x2-i.size,a.tickY=r?n.y1-i.size:n.y1,a.position=t[l],e.append(fm(a,i)))}o(this.getMajorTickPositions(),t.majorTicks),o(this.getMinorTickPositions(),t.minorTicks,i/t.minorUnit)}createLine(){let e=this.options,t=e.line,n=this.lineBox();if(t.width>0&&t.visible){let r=new F({stroke:{width:t.width,color:t.color,dashType:t.dashType}});r.moveTo(n.x1,n.y1).lineTo(n.x2,n.y2),e._alignLines&&yd(r);let i=this._lineGroup=new I;i.append(r),this.visual.append(i),this.createTicks(i)}}getActualTickSize(){let e=this.options,t=0;return e.majorTicks.visible&&e.minorTicks.visible?t=Math.max(e.majorTicks.size,e.minorTicks.size):e.majorTicks.visible?t=e.majorTicks.size:e.minorTicks.visible&&(t=e.minorTicks.size),t}createBackground(){let{options:e,box:t}=this,n=e.background;n&&(this._backgroundPath=F.fromRect(t.toRect(),{fill:{color:n},stroke:null}),this.visual.append(this._backgroundPath))}createPlotBands(){let e=this.options,t=e.plotBands||[],n=e.vertical,r=this.plotArea;if(t.length===0)return;let i=this._plotbandGroup=new I({zIndex:-1}),a=Vd(this.pane.axes,e=>e.options.vertical!==this.options.vertical)[0];for(let e=0;e<t.length;e++){let o=t[e],s,c,l=o.label,u;if(n?(s=(a||r.axisX).lineBox(),c=this.getSlot(o.from,o.to,!0)):(s=this.getSlot(o.from,o.to,!0),c=(a||r.axisY).lineBox()),l&&(l.vAlign=l.position||`left`,u=this.createPlotBandLabel(l,o,new Z(s.x1,c.y1,s.x2,c.y2))),s.width()!==0&&c.height()!==0){let e=new N([s.x1,c.y1],[s.width(),c.height()]),t=F.fromRect(e,{fill:{color:o.color,opacity:o.opacity},stroke:null});i.append(t),u&&i.append(u)}}this.appendVisual(i)}createPlotBandLabel(e,t,n){if(e.visible===!1)return null;let r=e.text,i;if(G(e)&&e.visible){let n=Id(e);n?r=n({text:r,item:t}):e.format&&(r=this.chartService.format.auto(e.format,r)),e.color||=this.options.labels.color}return i=new em(r,e),i.reflow(n),i.renderVisual(),i.visual}createGridLines(e){let t=this.options,{minorGridLines:n,majorGridLines:r,minorUnit:i,vertical:a}=t,o=e.options.line.visible,s=r.visible?t.majorUnit:0,c=e.lineBox(),l=c[a?`y1`:`x1`],u={lineStart:c[a?`x1`:`y1`],lineEnd:c[a?`x2`:`y2`],vertical:a},d=[],f=this.gridLinesVisual();function p(e,t,n){let r=e.length,i=Math.max(1,t.step);if(t.visible)for(let a=t.skip;a<r;a+=i){let r=q(e[a]);W(r,d)||a%n!==0&&(!o||l!==r)&&(u.position=r,f.append(pm(u,t)),d.push(r))}}return p(this.getMajorTickPositions(),r),p(this.getMinorTickPositions(),n,s/i),f.children}reflow(e){let{options:t,labels:n,title:r}=this,i=t.vertical,a=n.length,o=i?oe:te,s=r?r.box[o]():0,c=this.getActualTickSize()+t.margin+s,l=((this.getRoot()||{}).box||e)[o](),u=0;for(let e=0;e<a;e++){let t=n[e].box[o]();t+c<=l&&(u=Math.max(u,t))}i?this.box=new Z(e.x1,e.y1,e.x1+u+c,e.y2):this.box=new Z(e.x1,e.y1,e.x2,e.y1+u+c),this.arrangeTitle(),this.arrangeLabels(),this.arrangeNotes()}getLabelsTickPositions(){return this.getMajorTickPositions()}labelTickIndex(e){return e.index}arrangeLabels(){let{options:e,labels:t}=this,n=this.labelsBetweenTicks(),r=e.vertical,i=e.labels.mirror,a=this.getLabelsTickPositions();for(let e=0;e<t.length;e++){let o=t[e],s=this.labelTickIndex(o),c=r?o.box.height():o.box.width(),l=a[s],u=a[s+1],d,f;r?(d=n?l+(u-l)/2-c/2:l-c/2,f=d):n?(d=l,f=u):(d=l-c/2,f=d+c),this.positionLabel(o,i,d,f)}}positionLabel(e,t,n,r=n){let i=this.options,a=i.vertical,o=this.lineBox(),s=this.getActualTickSize()+i.margin,c;if(a){let r=o.x2;t?(r+=s,e.options.rotationOrigin=E):(r-=s+e.box.width(),e.options.rotationOrigin=O),c=e.box.move(r,n)}else{let i=o.y1;t?(i-=s+e.box.height(),e.options.rotationOrigin=x):(i+=s,e.options.rotationOrigin=`top`),c=new Z(n,i,r,i+e.box.height())}e.reflow(c)}autoRotateLabelAngle(e,t){return e.width()<t?0:e.height()>t?-90:-45}autoRotateLabels(){if(!this.options.autoRotateLabels||this.options.vertical)return!1;let e=this.getMajorTickPositions(),t=this.labels,n=Math.min(t.length,e.length-1),r=0;for(let i=0;i<n;i++){let n=Math.abs(e[i+1]-e[i]),a=t[i].box,o=this.autoRotateLabelAngle(a,n);if(o!==0&&(r=o),r===-90)break}if(r!==0){for(let e=0;e<t.length;e++)t[e].options.rotation=r,t[e].reflow(new Z);return!0}}arrangeTitle(){let{options:e,title:t}=this,n=e.labels.mirror,r=e.vertical;t&&(r?(t.options.align=n?O:E,t.options.vAlign=t.options.position):(t.options.align=t.options.position,t.options.vAlign=n?`top`:x),t.reflow(this.box))}arrangeNotes(){for(let e=0;e<this.notes.length;e++){let t=this.notes[e],n=t.options.value,r;G(n)?(this.shouldRenderNote(n)?t.show():t.hide(),r=this.noteSlot(n)):t.hide(),t.reflow(r||this.lineBox())}}noteSlot(e){return this.getSlot(e)}alignTo(e){let t=e.lineBox(),n=this.options.vertical,r=n?`y`:`x`;this.box.snapTo(t,r),n?this.box.shrink(0,this.lineBox().height()-t.height()):this.box.shrink(this.lineBox().width()-t.width(),0),this.box[r+1]-=this.lineBox()[r+1]-t[r+1],this.box[r+2]-=this.lineBox()[r+2]-t[r+2]}axisLabelText(e,t,n){let r,i=Id(t),a=()=>t.format?this.chartService.format.localeAuto(t.format,[e],t.culture):e;return r=i?i(Object.assign({},n,{get text(){return a()},value:e,format:t.format,culture:t.culture})):a(),r}slot(e,t,n){let r=this.getSlot(e,t,n);if(r)return r.toRect()}contentBox(){let e=this.box.clone(),t=this.labels;if(t.length){let n=this.options.vertical?`y`:`x`;if(this.chartService.isPannable(n)){let t=this.maxLabelOffset();e[n+1]-=t.start,e[n+2]+=t.end}else{t[0].options.visible&&e.wrap(t[0].box);let n=t[t.length-1];n.options.visible&&e.wrap(n.box)}}return e}maxLabelOffset(){let{vertical:e,reverse:t}=this.options,n=this.labelsBetweenTicks(),r=this.getLabelsTickPositions(),i=e?`y`:`x`,a=this.labels,o=+!!t,s=+!t,c=0,l=0;for(let e=0;e<a.length;e++){let t=a[e],u=this.labelTickIndex(t),d,f;n?(d=r[u+o],f=r[u+s]):d=f=r[u],c=Math.max(c,d-t.box[i+1]),l=Math.max(l,t.box[i+2]-f)}return{start:c,end:l}}limitRange(e,t,n,r,i){let a=this.options;if(e<n&&i<0&&(!G(a.min)||a.min<=n)||r<t&&i>0&&(!G(a.max)||r<=a.max))return null;if(t<n&&i>0||r<e&&i<0)return{min:e,max:t};let o=t-e,s=e,c=t;return e<n&&i<0?(s=K(e,n,r),c=K(e+o,n+o,r)):t>r&&i>0&&(c=K(t,n,r),s=K(t-o,n,r-o)),{min:s,max:c}}valueRange(){return{min:this.seriesMin,max:this.seriesMax}}lineDir(){let{vertical:e,reverse:t}=this.options;return(e?-1:1)*(t?-1:1)}lineInfo(){let{vertical:e}=this.options,t=this.lineBox(),n=e?t.height():t.width(),r=e?`y`:`x`,i=this.lineDir(),a=r+(i===1?1:2).toString();return{axis:r,axisOrigin:a,axisDir:i,lineBox:t,lineSize:n,lineStart:t[a]}}pointOffset(e){let{axis:t,axisDir:n,axisOrigin:r,lineBox:i,lineSize:a}=this.lineInfo();return(n>0?e[t]-i[r]:i[r]-e[t])/a}scaleToDelta(e,t){let n=K(e,-.999,.999),r;return r=n>0?t*Math.min(1,n):t-t/(1+n),r}labelsBetweenTicks(){return!this.options.justified}prepareUserOptions(){}};Y(mm,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:b,visible:!0},title:{visible:!0,position:S},majorTicks:{align:ie,size:4,skip:0,step:1},minorTicks:{align:ie,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:ie,minorTickType:re,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:b,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:``}},_alignLines:!0,_deferLabels:!1});let hm=`seconds`,gm=`minutes`,_m=`hours`,vm=`days`,ym=`weeks`,bm=`months`,xm=`years`,Sm=1e3,Cm=60*Sm,wm=60*Cm,Tm=24*wm,Em={years:31536e6,months:26784e5,weeks:6048e5,days:Tm,hours:wm,minutes:Cm,seconds:Sm,milliseconds:1};function Dm(e,t){return e.getTime()-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Cm}function Om(e,t){return new Date(e.getTime()+t)}function km(e){let t;return e instanceof Date?t=e:e&&(t=new Date(e)),t}function Am(e,t=0){let n=0,r=e.getDay();if(!isNaN(r))for(;r!==t;)r===0?r=6:r--,n++;return Om(e,-n*Tm)}function jm(e,t){return t===0&&e.getHours()===23?(e.setHours(e.getHours()+2),!0):!1}function Mm(e,t){let n=new Date(e);return n.setMinutes(0,0,0),Om(n,(e.getTimezoneOffset()-n.getTimezoneOffset())*Cm+t*wm)}function Nm(e,t,n,r){let i=e;if(e){let a=km(e),o=a.getHours();n===`years`?(i=new Date(a.getFullYear()+t,0,1),jm(i,0)):n===`months`?(i=new Date(a.getFullYear(),a.getMonth()+t,1),jm(i,o)):n===`weeks`?(i=Nm(Am(a,r),t*7,vm),jm(i,o)):n===`days`?(i=new Date(a.getFullYear(),a.getMonth(),a.getDate()+t),jm(i,o)):n===`hours`?i=Mm(a,t):n===`minutes`?(i=Om(a,t*Cm),i.getSeconds()>0&&i.setSeconds(0)):n===`seconds`?i=Om(a,t*Sm):n===`milliseconds`&&(i=Om(a,t)),n!==`milliseconds`&&i.getMilliseconds()>0&&i.setMilliseconds(0)}return i}function Pm(e,t,n){return Nm(km(e),0,t,n)}function Fm(e,t,n){let r=km(e);return r&&Pm(r,t,n).getTime()===r.getTime()?r:Nm(r,1,t,n)}function Im(e,t){return e&&t?e.getTime()-t.getTime():-1}function Lm(e,t){return e.getTime()-t}function Rm(e){if(j(e)){let t=[];for(let n=0;n<e.length;n++)t.push(Rm(e[n]));return t}else if(e)return km(e).getTime()}function zm(e,t){return e&&t?Rm(e)===Rm(t):e===t}function Bm(e,t,n){return Dm(e,t)/Em[n]}function Vm(e,t,n,r){let i=km(e),a=km(t),o;return o=n===`months`?i.getMonth()-a.getMonth()+(i.getFullYear()-a.getFullYear())*12+Bm(i,new Date(i.getFullYear(),i.getMonth()),vm)/new Date(i.getFullYear(),i.getMonth()+1,0).getDate():n===`years`?i.getFullYear()-a.getFullYear()+Vm(i,new Date(i.getFullYear(),0),bm,1)/12:n===`days`||n===`weeks`?Bm(i,a,n):Lm(i,t)/Em[n],o/r}function Hm(e,t,n){let r;return r=n===`years`?t.getFullYear()-e.getFullYear():n===`months`?Hm(e,t,xm)*12+t.getMonth()-e.getMonth():Math.floor(n===`days`?Lm(t,e)/Tm:Lm(t,e)/Em[n]),r}function Um(e,t){let n;return n=xd(t)&&e.parseDate(t)||km(t),n}function Wm(e,t){if(j(t)){let n=[];for(let r=0;r<t.length;r++)n.push(Um(e,t[r]));return n}return Um(e,t)}function Gm(e,t){return V(e.weekStartDay)?e.weekStartDay:t&&t.firstDay?t.firstDay():0}let Km=.1;function qm(e,t){return e instanceof Date?t.findIndex(t=>zm(t,e)):t.indexOf(e)}var Jm=class e extends mm{initFields(){this._ticks={}}categoriesHash(){return``}clone(){let t=new e(Object.assign({},this.options,{categories:this.options.srcCategories}),this.chartService);return t.createLabels(),t}initUserOptions(e){let t=e.categories||[],n=e.min!==void 0,r=e.max!==void 0;if(e.srcCategories=e.categories=t,(n||r)&&t.length){let i=n?Math.floor(e.min):0,a;a=r?e.justified?Math.floor(e.max)+1:Math.ceil(e.max):t.length,e.categories=e.categories.slice(i,a)}return e}rangeIndices(){let e=this.options,t=e.categories.length||1,n=V(e.min)?e.min%1:0,r;return r=V(e.max)&&e.max%1!=0&&e.max<this.totalRange().max?t-(1-e.max%1):t-+!!e.justified,{min:n,max:r}}range(){let e=this.options;return{min:V(e.min)?e.min:0,max:V(e.max)?e.max:this.totalRange().max}}roundedRange(){return this.range()}totalRange(){let e=this.options;return{min:0,max:Math.max(this._seriesMax||0,e.srcCategories.length)-+!!e.justified}}scaleOptions(){let{min:e,max:t}=this.rangeIndices(),n=this.lineBox();return{scale:(this.options.vertical?n.height():n.width())/(t-e||1)*(this.options.reverse?-1:1),box:n,min:e,max:t}}arrangeLabels(){super.arrangeLabels(),this.hideOutOfRangeLabels()}hideOutOfRangeLabels(){let{box:e,labels:t}=this;if(t.length>0){let n=this.options.vertical?`y`:`x`,r=e[n+1],i=e[n+2],a=t[0],o=of(t);(a.box[n+1]>i||a.box[n+2]<r)&&(a.options.visible=!1),(o.box[n+1]>i||o.box[n+2]<r)&&(o.options.visible=!1)}}getMajorTickPositions(){return this.getTicks().majorTicks}getMinorTickPositions(){return this.getTicks().minorTicks}getLabelsTickPositions(){return this.getTicks().labelTicks}tickIndices(e){let{min:t,max:n}=this.rangeIndices(),r=Math.ceil(n),i=Math.floor(t),a=[];for(;i<=r;)a.push(i),i+=e;return a}getTickPositions(e){let{vertical:t,reverse:n}=this.options,{scale:r,box:i,min:a}=this.scaleOptions(),o=i[(t?`y`:`x`)+(n?2:1)],s=this.tickIndices(e),c=[];for(let e=0;e<s.length;e++)c.push(o+q(r*(s[e]-a),3));return c}getTicks(){let e=this.options,t=this._ticks,n=this.rangeIndices(),r=this.lineBox(),i=r.getHash()+n.min+`,`+n.max+e.reverse+e.justified;if(t._hash!==i){let n=e.minorTicks.visible||e.minorGridLines.visible;t._hash=i,t.labelTicks=this.getTickPositions(1),t.majorTicks=this.filterOutOfRangePositions(t.labelTicks,r),t.minorTicks=n?this.filterOutOfRangePositions(this.getTickPositions(.5),r):[]}return t}filterOutOfRangePositions(e,t){if(!e.length)return e;let n=this.options.vertical?`y`:`x`,r=e=>t[n+1]<=e&&e<=t[n+2],i=e.length-1,a=0;for(;!r(e[a])&&a<=i;)a++;let o=i;for(;!r(e[o])&&o>=0;)o--;return e.slice(a,o+1)}lineInfo(){let{vertical:e,reverse:t}=this.options,n=this.lineBox(),r=e?n.height():n.width(),i=e?`y`:`x`,a=t?-1:1,o=i+(a===1?1:2).toString();return{axis:i,axisOrigin:o,axisDir:a,lineBox:n,lineSize:r,lineStart:n[o]}}lineDir(){let{reverse:e}=this.options;return e?-1:1}getSlot(e,t,n){let{reverse:r,justified:i}=this.options,{scale:a,box:o,min:s}=this.scaleOptions(),{axis:c,lineStart:l}=this.lineInfo(),u=o.clone(),d=t===void 0,f=J(e,0),p=J(t,f);p=Math.max(p-1,f),p=Math.max(f,p);let m=l+(f-s)*a,h=l+(p+1-s)*a;return d&&i&&(h=m),n&&(m=K(m,o[c+1],o[c+2]),h=K(h,o[c+1],o[c+2])),u[c+1]=r?h:m,u[c+2]=r?m:h,u}limitSlot(e){let t=this.options.vertical?`y`:`x`,n=this.lineBox(),r=e.clone();return r[t+1]=K(e[t+1],n[t+1],n[t+2]),r[t+2]=K(e[t+2],n[t+1],n[t+2]),r}slot(e,t,n){let r=Math.floor(this.options.min||0),i=e,a=t;return typeof i==`string`?i=this.categoryIndex(i):V(i)&&(i-=r),typeof a==`string`?a=this.categoryIndex(a):V(a)&&(a-=r),super.slot(i,a,n)}pointCategoryIndex(e){let{reverse:t,justified:n,vertical:r}=this.options,i=r?`y`:`x`,{scale:a,box:o,min:s,max:c}=this.scaleOptions(),l=t?c:s,u=o[i+1],d=o[i+2],f=e[i];if(f<u||f>d)return null;let p=l+(f-u)/a,m=p%1;return n?p=Math.round(p):m===0&&p>0&&p--,Math.floor(p)}getCategory(e){let t=this.pointCategoryIndex(e);return t===null?null:this.options.categories[t]}categoryIndex(e){return this.totalIndex(e)-Math.floor(this.options.min||0)}categoryAt(e,t){let n=this.options;return(t?n.srcCategories:n.categories)[e]}categoriesCount(){return(this.options.categories||[]).length}translateRange(e){let t=this.options,n=this.lineBox(),r=t.vertical?n.height():n.width(),i=t.categories.length,a=r/i,o=q(e/a,10);return{min:o,max:i+o}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.limitedRangeIndices(),i=r.max-r.min,a=this.scaleToDelta(e,i),o=n*a,s=(1-n)*a,c=r.min+o,l=r.max-s;return l-c<Km&&(l=c+Km),{min:c,max:l}}zoomRange(e,t){let{min:n,max:r}=this.totalRange(),i=this.scaleRange(e,t);return{min:K(i.min,n,r),max:K(i.max,n,r)}}labelsCount(){let e=this.labelsRange();return e.max-e.min}labelsRange(){let e=this.options,{justified:t,labels:n}=e,{min:r,max:i}=this.limitedRangeIndices(!0),a=Math.floor(r);t?(r=Math.ceil(r),i=Math.floor(i)):(r=Math.floor(r),i=Math.ceil(i));let o;return o=r>n.skip?n.skip+n.step*Math.ceil((r-n.skip)/n.step):n.skip,{min:o-a,max:(e.categories.length?i+ +!!t:0)-a}}createAxisLabel(e,t,n){let r=this.options,i=r.dataItems?r.dataItems[e]:null,a=J(r.categories[e],``);return n.dataItem=i,new rm(a,this.axisLabelText(a,t,n),e,i,t)}shouldRenderNote(e){let t=this.limitedRangeIndices();return Math.floor(t.min)<=e&&e<=Math.ceil(t.max)}noteSlot(e){let t=this.options,n=e-Math.floor(t.min||0);return this.getSlot(n)}arrangeNotes(){super.arrangeNotes(),this.hideOutOfRangeNotes()}hideOutOfRangeNotes(){let{notes:e,box:t}=this;if(e&&e.length){let n=this.options.vertical?`y`:`x`,r=t[n+1],i=t[n+2];for(let t=0;t<e.length;t++){let a=e[t];a.box&&(i<a.box[n+1]||a.box[n+2]<r)&&a.hide()}}}pan(e){let t=this.limitedRangeIndices(!0),{scale:n}=this.scaleOptions(),r=q(e/n,10),i=this.totalRange(),a=t.min+r,o=t.max+r;return this.limitRange(a,o,0,i.max,r)}pointsRange(e,t){let{reverse:n,vertical:r}=this.options,i=r?`y`:`x`,a=this.limitedRangeIndices(!0),{scale:o,box:s}=this.scaleOptions(),c=s[i+(n?2:1)],l=e[i]-c,u=t[i]-c,d=a.min+l/o,f=a.min+u/o,p=Math.min(d,f),m=Math.max(d,f);if(m-p>=.01)return{min:p,max:m}}valueRange(){return this.range()}totalIndex(e){let t=this.options;return this._categoriesMap?this._categoriesMap.get(e):qm(e,t.srcCategories)}currentRangeIndices(){let e=this.options,t=0;V(e.min)&&(t=Math.floor(e.min));let n;return n=V(e.max)?e.justified?Math.floor(e.max):Math.ceil(e.max)-1:this.totalCount()-1,{min:t,max:n}}limitedRangeIndices(e){let t=this.options,n=V(t.min)?t.min:0,r;if(r=V(t.max)?t.max:V(t.min)?n+t.categories.length:this.totalRange().max||1,e){let e=this.totalRange();n=K(n,0,e.max),r=K(r,0,e.max)}return{min:n,max:r}}totalRangeIndices(){return{min:0,max:this.totalRange().max||1}}indexCategories(){if(!this._categoriesMap){let e=this._categoriesMap=new Ud,t=this.options.srcCategories;for(let n=0;n<t.length;n++)e.set(t[n],n)}}totalCount(){return Math.max(this.options.srcCategories.length,this._seriesMax||0)}};Y(Jm,{type:`category`,vertical:!1,majorGridLines:{visible:!1,width:1,color:b},labels:{zIndex:1},justified:!1,_deferLabels:!0});let Ym={milliseconds:`HH:mm:ss.fff`,seconds:`HH:mm:ss`,minutes:`HH:mm`,hours:`HH:mm`,days:`M/d`,weeks:`M/d`,months:`MMM 'yy`,years:`yyyy`},Xm=[`milliseconds`,hm,gm,_m,vm,ym,bm,xm];function Zm(e,t){t&&(e._range=void 0);let n=e._range;return n||(n=e._range=vf(e),n.min=km(n.min),n.max=km(n.max)),n}var Qm=class{constructor(e){this.options=e}displayIndices(){return{min:0,max:1}}displayRange(){return{}}total(){return{}}valueRange(){return{}}valueIndex(){return-1}values(){return[]}totalIndex(){return-1}valuesCount(){return 0}totalCount(){return 0}dateAt(){return null}},$m=class{constructor(e,t,n){this.options=n,n.baseUnitStep=n.baseUnitStep||1;let{roundToBaseUnit:r,justified:i}=n;this.start=Nm(e,0,n.baseUnit,n.weekStartDay);let a=this.roundToTotalStep(t),o=!i&&zm(t,a)&&!n.justifyEnd;this.end=this.roundToTotalStep(t,!i,+!!o);let s=n.min||e;this.valueStart=this.roundToTotalStep(s),this.displayStart=r?this.valueStart:s;let c=n.max;if(!c)this.valueEnd=a,this.displayEnd=r||o?this.end:t;else{let e=!i&&zm(c,this.roundToTotalStep(c))?-1:0;this.valueEnd=this.roundToTotalStep(c,!1,e),this.displayEnd=r?this.roundToTotalStep(c,!i):n.max}this.valueEnd<this.valueStart&&(this.valueEnd=this.valueStart),this.displayEnd<=this.displayStart&&(this.displayEnd=this.roundToTotalStep(this.displayStart,!1,1))}displayRange(){return{min:this.displayStart,max:this.displayEnd}}displayIndices(){if(!this._indices){let{baseUnit:e,baseUnitStep:t}=this.options,n=Vm(this.displayStart,this.valueStart,e,t),r=Vm(this.displayEnd,this.valueStart,e,t);this._indices={min:n,max:r}}return this._indices}total(){return{min:this.start,max:this.end}}totalCount(){return this.totalIndex(this.end)+ +!!this.options.justified}valueRange(){return{min:this.valueStart,max:this.valueEnd}}valueIndex(e){let t=this.options;return Math.floor(Vm(e,this.valueStart,t.baseUnit,t.baseUnitStep))}totalIndex(e){let t=this.options;return Math.floor(Vm(e,this.start,t.baseUnit,t.baseUnitStep))}dateIndex(e){let t=this.options;return Vm(e,this.valueStart,t.baseUnit,t.baseUnitStep)}valuesCount(){return this.valueIndex(this.valueEnd)+1}values(){let e=this._values;if(!e){let t=this.options,n=this.valueRange();this._values=e=[];for(let r=n.min;r<=n.max;)e.push(r),r=Nm(r,t.baseUnitStep,t.baseUnit,t.weekStartDay)}return e}dateAt(e,t){let n=this.options;return Nm(t?this.start:this.valueStart,n.baseUnitStep*e,n.baseUnit,n.weekStartDay)}roundToTotalStep(e,t,n){let{baseUnit:r,baseUnitStep:i,weekStartDay:a}=this.options,o=this.start,s=Vm(e,o,r,i),c=t?Math.ceil(s):Math.floor(s);return n&&(c+=n),Nm(o,c*i,r,a)}};function eh(e,t,n){let r=Zm(e.categories),i=(e.max||r.max)-(e.min||r.min),{autoBaseUnitSteps:a,maxDateGroups:o}=e,s=e.baseUnit===`fit`,c=t?Xm.indexOf(t):0,l=s?Xm[c++]:e.baseUnit,u=i/Em[l],d=u,f,p,m;for(;!p||u>=o;){f||=a[l].slice(0);do m=f.shift();while(m&&t===l&&m<n);if(m)p=m,u=d/p;else if(l===of(Xm)){p=Math.ceil(d/o);break}else if(s)l=Xm[c++]||of(Xm),d=i/Em[l],f=null;else{u>o&&(p=Math.ceil(d/o));break}}e.baseUnitStep=p,e.baseUnit=l}function th(e){let t=e.categories,n=G(t)?t.length:0,r=D,i,a;for(let e=0;e<n;e++){let n=t[e];if(n&&i){let e=Math.abs(Dm(n,i));e!==0&&(r=Math.min(r,e),a=r>=31536e6?xm:r>=26784e5-864e5*3?bm:r>=6048e5?ym:r>=864e5?vm:r>=36e5?_m:r>=6e4?gm:hm)}i=n}e.baseUnit=a||`days`}function nh(e){let t=(e.baseUnit||``).toLowerCase();return t!==`fit`&&!W(t,Xm)&&th(e),(t===`fit`||e.baseUnitStep===`auto`)&&eh(e),e}var rh=class e extends Jm{clone(){let t=new e(Object.assign({},this.options),this.chartService);return t.createLabels(),t}categoriesHash(){let e=this.dataRange.total().min;return this.options.baseUnit+this.options.baseUnitStep+e}initUserOptions(e){return e}initFields(){super.initFields();let e=this.chartService,t=e.intl,n=this.options,r=n.categories||[];if(r._parsed||(r=Wm(t,r),r._parsed=!0),n=H({roundToBaseUnit:!0},n,{categories:r,min:Um(t,n.min),max:Um(t,n.max),weekStartDay:Gm(n,t)}),e.panning&&e.isPannable(n.vertical?`y`:`x`)&&(n.roundToBaseUnit=!1),n.userSetBaseUnit=n.userSetBaseUnit||n.baseUnit,n.userSetBaseUnitStep=n.userSetBaseUnitStep||n.baseUnitStep,this.options=n,n.srcCategories=r,r.length>0){let e=Zm(r,!0),t=n.maxDivisions,i=nh(n),a=n._forecast;if(a&&(a.before>0&&(e.min=Nm(e.min,-a.before,i.baseUnit,i.weekStartDay)),a.after>0&&(e.max=Nm(e.max,a.after,i.baseUnit,i.weekStartDay))),this.dataRange=new $m(e.min,e.max,i),t){let r=this.dataRange.displayRange(),i=Object.assign({},n,{justified:!0,roundToBaseUnit:!1,baseUnit:`fit`,min:r.min,max:r.max,maxDateGroups:t}),a=this.dataRange.options;eh(i,a.baseUnit,a.baseUnitStep),this.divisionRange=new $m(e.min,e.max,i)}else this.divisionRange=this.dataRange}else n.baseUnit=n.baseUnit||`days`,this.dataRange=this.divisionRange=new Qm(n);this.rangeLabels=[]}tickIndices(e){let{dataRange:t,divisionRange:n}=this,r=n.valuesCount();if(!this.options.maxDivisions||!r)return super.tickIndices(e);let i=[],a=n.values(),o=0;this.options.justified||(a=a.concat(n.dateAt(r)),o=.5);for(let n=0;n<a.length;n++)if(i.push(t.dateIndex(a[n])+o),e!==1&&n>=1){let t=i.length-1;i.splice(n,0,i[t-1]+(i[t]-i[t-1])*e)}return i}shouldRenderNote(e){let t=this.range(),n=this.options.categories||[];return Im(e,t.min)>=0&&Im(e,t.max)<=0&&n.length}parseNoteValue(e){return Um(this.chartService.intl,e)}noteSlot(e){return this.getSlot(e)}translateRange(e){let t=this.options,{baseUnit:n,weekStartDay:r,vertical:i}=t,a=this.lineBox(),o=i?a.height():a.width(),s=this.range(),c=o/(s.max-s.min),l=q(e/c,10);if(s.min&&s.max){let e=Om(t.min||s.min,l),i=Om(t.max||s.max,l);s={min:Nm(e,0,n,r),max:Nm(i,0,n,r)}}return s}labelsRange(){return{min:this.options.labels.skip,max:this.divisionRange.valuesCount()}}pan(e){if(this.isEmpty())return null;let t=this.options,n=this.lineBox(),r=t.vertical?n.height():n.width(),{min:i,max:a}=this.dataRange.displayRange(),o=this.dataRange.total(),s=r/(a-i),c=q(e/s,10)*(t.reverse?-1:1),l=Om(i,c),u=Om(a,c),d=this.limitRange(Rm(l),Rm(u),Rm(o.min),Rm(o.max),c);if(d)return d.min=km(d.min),d.max=km(d.max),d.baseUnit=t.baseUnit,d.baseUnitStep=t.baseUnitStep||1,d.userSetBaseUnit=t.userSetBaseUnit,d.userSetBaseUnitStep=t.userSetBaseUnitStep,d}pointsRange(e,t){if(this.isEmpty())return null;let n=super.pointsRange(e,t),r=this.dataRange.displayRange(),i=this.dataRange.displayIndices(),a=Lm(r.max,r.min)/(i.max-i.min),o=this.options;return{min:Om(r.min,n.min*a),max:Om(r.min,n.max*a),baseUnit:o.userSetBaseUnit||o.baseUnit,baseUnitStep:o.userSetBaseUnitStep||o.baseUnitStep}}scaleRange(e,t){if(this.isEmpty())return{};let n=this.options,r=n.userSetBaseUnit===`fit`,i=this.dataRange.total(),{min:a,max:o}=this.dataRange.displayRange(),s=Math.abs(this.pointOffset(t)),c=o-a,l=this.scaleToDelta(e,c),u=Math.round(s*l),d=Math.round((1-s)*l),{baseUnit:f}=this.dataRange.options,p=new Date(a.getTime()+u),m=new Date(o.getTime()-d);if(r){let{autoBaseUnitSteps:e,maxDateGroups:t}=n,r=of(e[f])*t*Em[f],s=Lm(o,a),c=Lm(m,p),l=Xm.indexOf(f),u,d;if(c<Em[f]&&f!==`milliseconds`)f=Xm[l-1],u=of(e[f]),d=(s-(t-1)*u*Em[f])/2,p=Om(a,d),m=Om(o,-d);else if(c>r&&f!==`years`){let t=0;do{l++,f=Xm[l],t=0,d=2*Em[f];do u=e[f][t],t++;while(t<e[f].length&&d*u<s)}while(f!==`years`&&d*u<s);d=(d*u-s)/2,d>0&&(p=Om(a,-d),m=Om(o,d),p=Om(p,K(m,i.min,i.max)-m),m=Om(m,K(p,i.min,i.max)-p))}}if(p&&m&&Lm(m,p)>0)return{min:p,max:m,baseUnit:n.userSetBaseUnit||n.baseUnit,baseUnitStep:n.userSetBaseUnitStep||n.baseUnitStep}}zoomRange(e,t){let n=this.dataRange.total(),r=this.scaleRange(e,t);if(r){if(r.min<n.min){if(e<0&&this.options.justified){let e=Lm(n.min,r.min);r.max=Om(r.max,e)}r.min=n.min}r.max>n.max&&(r.max=n.max)}return r}range(){return this.dataRange.displayRange()}createLabels(){super.createLabels(),this.createRangeLabels()}clearLabels(){super.clearLabels(),this.rangeLabels=[]}arrangeLabels(){this.arrangeRangeLabels(),super.arrangeLabels()}arrangeRangeLabels(){let{options:e,rangeLabels:t}=this;if(t.length===0)return;let n=this.lineBox(),r=e.vertical,i=e.rangeLabels.mirror||e.labels.mirror,a=t[0];if(a){let e=r?n.y1-a.box.height()/2:n.x1;this.positionLabel(a,i,e)}let o=t[1];if(o){let e=r?n.y2-o.box.height()/2:n.x2;this.positionLabel(o,i,e)}}autoRotateLabels(){super.autoRotateLabels(),this.autoRotateRangeLabels()}hideOutOfRangeLabels(){super.hideOutOfRangeLabels(),this.hideOverlappingLabels()}hideOverlappingLabels(){let{rangeLabels:e,labels:t}=this;if(e.length===0)return;function n(e,t){return!t.options.visible||t.box.overlaps(e.box)?(t.options.visible=!1,!0):!1}let r=e[0];if(r&&r.options.visible)for(let e=0;e<t.length&&n(r,t[e]);e++);let i=e[1];if(i&&i.options.visible)for(let e=t.length-1;e>0&&n(i,t[e]);--e);}contentBox(){let e=super.contentBox(),t=this.rangeLabels;for(let n=0;n<t.length;n++){let r=t[n];r.options.visible&&e.wrap(r.box)}return e}createAxisLabel(e,t,n={}){let r=this.options,i=r.dataItems&&!r.maxDivisions?r.dataItems[e]:null,a=this.divisionRange.dateAt(e),o=t.dateFormats[this.divisionRange.options.baseUnit];t.format=t.format||o,n.dataItem=i;let s=this.axisLabelText(a,t,n);if(s)return new rm(a,s,e,i,t)}createRangeLabels(){let{displayStart:e,displayEnd:t}=this.divisionRange,n=this.options,r=Object.assign({},n.labels,n.rangeLabels,{align:S,zIndex:n.zIndex});if(r.visible!==!0)return;this.normalizeLabelRotation(r),r.alignRotation=S,r.rotation===`auto`&&(r.rotation=0,n.autoRotateRangeLabels=!0);let i=r.dateFormats[this.divisionRange.options.baseUnit];r.format=r.format||i;let a=(e,t,n)=>{if(n){let i=new rm(t,n,e,null,r);this.append(i),this.rangeLabels.push(i)}};a(0,e,this.axisLabelText(e,r,{index:0,count:2})),a(1,t,this.axisLabelText(t,r,{index:1,count:2}))}autoRotateRangeLabels(){let e=this.rangeLabels;if(!this.options.autoRotateRangeLabels||this.options.vertical||e.length!==2)return;let t=(e,t,n)=>{let r=Math.abs(t[n+1]-t[n])*2,i=this.autoRotateLabelAngle(e.box,r);i!==0&&(e.options.rotation=i,e.reflow(new Z))},n=this.getMajorTickPositions();t(e[0],n,0),t(e[1],n,n.length-2)}categoryIndex(e){return this.dataRange.valueIndex(e)}slot(e,t,n){let r=this.dataRange,i=e,a=t;i instanceof Date&&(i=r.dateIndex(i)),a instanceof Date&&(a=r.dateIndex(a));let o=this.getSlot(i,a,n);if(o)return o.toRect()}getSlot(e,t,n){let r=e,i=t;return typeof r==`object`&&(r=this.categoryIndex(r)),typeof i==`object`&&(i=this.categoryIndex(i)),super.getSlot(r,i,n)}valueRange(){let e=this.options,t=Zm(e.srcCategories);return{min:km(t.min),max:km(t.max)}}categoryAt(e,t){return this.dataRange.dateAt(e,t)}categoriesCount(){return this.dataRange.valuesCount()}rangeIndices(){return this.dataRange.displayIndices()}labelsBetweenTicks(){return!this.divisionRange.options.justified}prepareUserOptions(){this.isEmpty()||(this.options.categories=this.dataRange.values())}getCategory(e){let t=this.pointCategoryIndex(e);return t===null?null:this.dataRange.dateAt(t)}totalIndex(e){return this.dataRange.totalIndex(e)}currentRangeIndices(){let e=this.dataRange.valueRange();return{min:this.dataRange.totalIndex(e.min),max:this.dataRange.totalIndex(e.max)}}totalRange(){return this.dataRange.total()}totalRangeIndices(){let e=this.dataRange.total();return{min:this.dataRange.totalIndex(e.min),max:this.dataRange.totalIndex(e.max)}}totalCount(){return this.dataRange.totalCount()}isEmpty(){return!this.options.srcCategories.length}roundedRange(){if(this.options.roundToBaseUnit!==!1||this.isEmpty())return this.range();let e=this.options,t=Zm(e.srcCategories);return new $m(t.min,t.max,Object.assign({},e,{justified:!1,roundToBaseUnit:!0,justifyEnd:!1})).displayRange()}};Y(rh,{type:w,labels:{dateFormats:Ym},rangeLabels:{visible:!1},autoBaseUnitSteps:{milliseconds:[1,10,100],seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10});function ih(e,t,n){if(!e&&!t)return 0;let r;if(e>=0&&t>=0){let i=e===t?0:e,a=(t-i)/t;if(n===!1||!n&&a>.2)return 0;r=Math.max(0,i-(t-i)/2)}else r=e;return r}function ah(e,t,n){if(!e&&!t)return 1;let r;if(e<=0&&t<=0){let i=e===t?0:t,a=Math.abs((i-e)/i);if(n===!1||!n&&a>.2)return 0;r=Math.min(0,i-(e-i)/2)}else r=t;return r}function oh(e,t){return ce(Math.floor(e/t)*t)}function sh(e,t){return ce(Math.ceil(e/t)*t)}function ch(e){return Math.max(Math.min(e,3e5),-3e5)}let lh=10**-9;var uh=class e extends mm{constructor(e,t,n,r){super(Object.assign({},n,{seriesMin:e,seriesMax:t}),r)}initUserOptions(e){let t=dh(e.seriesMin,e.seriesMax,e);return this.totalOptions=fh(t,e),mh(t,e)}initFields(){this.totalMin=this.totalOptions.min,this.totalMax=this.totalOptions.max,this.totalMajorUnit=this.totalOptions.majorUnit,this.seriesMin=this.options.seriesMin,this.seriesMax=this.options.seriesMax}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return 0}range(){let e=this.options;return{min:e.min,max:e.max}}getDivisions(e){if(e===0)return 1;let t=this.options,n=t.max-t.min;return Math.floor(q(n/e,3))+1}getTickPositions(e,t){let n=this.options,{axisDir:r,axisOrigin:i,lineBox:a,lineSize:o}=this.lineInfo(),s=e*(o/(n.max-n.min)),c=this.getDivisions(e),l=[],u=a[i],d=0;t&&(d=t/e);for(let e=0;e<c;e++)e%d!==0&&l.push(q(u,3)),u+=s*r;return l}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(e,t,n=!1){let r=this.options,{axis:i,axisDir:a,lineBox:o,lineSize:s,lineStart:c}=this.lineInfo(),l=a*(s/(r.max-r.min)),u=J(e,t||0),d=J(t,e||0);n&&(u=K(u,r.min,r.max),d=K(d,r.min,r.max));let f=Math.min(u,d)-r.min,p=Math.max(u,d)-r.min,m=new Z(o.x1,o.y1,o.x1,o.y1);return m[i+1]=ch(c+l*(a>0?f:p)),m[i+2]=ch(c+l*(a>0?p:f)),m}getValue(e){let t=this.options,n=Number(t.max),r=Number(t.min),i=this.pointOffset(e),a=i*(n-r);return i<0||i>1?null:ce(r+a)}translateRange(e){let{vertical:t,reverse:n,max:r,min:i}=this.options,{lineSize:a}=this.lineInfo(),o=e/(a/(r-i));return(t||n)&&!(t&&n)&&(o=-o),{min:ce(i+o),max:ce(r+o),offset:o}}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(e,t,n){let r=this.options,i=ce(r.min+e*r.majorUnit);return new rm(i,this.axisLabelText(i,t,n),e,null,t)}shouldRenderNote(e){let t=this.range();return t.min<=e&&e<=t.max}pan(e){let t=this.translateRange(e);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax,t.offset)}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t),i=Math.min(n,r),a=Math.max(n,r);if(a-i>lh)return{min:i,max:a}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.options.max-this.options.min,i=this.scaleToDelta(e,r),a=n*i,o=(1-n)*i;return{min:ce(this.options.min+a),max:ce(this.options.max-o)}}zoomRange(e,t){let{totalMin:n,totalMax:r}=this,i=this.scaleRange(e,t);return{min:K(i.min,n,r),max:K(i.max,n,r),narrowRange:!1}}};function dh(e,t,n){let r=n.narrowRange,i=ih(e,t,r),a=ah(e,t,r),o=A(i,a),s={majorUnit:o};return n.roundToMajorUnit!==!1&&(i<0&&hh(i,o,1/3)&&(i-=o),a>0&&hh(a,o,1/3)&&(a+=o)),s.min=oh(i,o),s.max=sh(a,o),s}function fh(e,t){return{min:G(t.min)?Math.min(e.min,t.min):e.min,max:G(t.max)?Math.max(e.max,t.max):e.max,majorUnit:e.majorUnit}}function ph(e,t){for(let n=0;n<t.length;n++){let r=t[n];e[r]===null&&(e[r]=void 0)}}function mh(e,t){let n=t,r,i;if(t){ph(t,[`min`,`max`]),r=G(t.min),i=G(t.max);let a=r||i;a&&t.min===t.max&&(t.min>0?t.min=0:t.max=1),t.majorUnit?(e.min=oh(e.min,t.majorUnit),e.max=sh(e.max,t.majorUnit)):a&&(n=H(e,t),e.majorUnit=A(n.min,n.max))}e.minorUnit=(n.majorUnit||e.majorUnit)/5;let a=H(e,n);return a.min>=a.max&&(r&&!i?a.max=a.min+a.majorUnit:!r&&i&&(a.min=a.max-a.majorUnit)),a}function hh(e,t,n){let r=q(Math.abs(e%t),10),i=t*(1-n);return r===0||r>i}Y(uh,{type:`numeric`,min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:b},labels:{format:`#.####################`},zIndex:1});let gh=1e3;var _h=class e extends mm{constructor(e,t,n,r){let i=km(e),a=km(t),o=r.intl,s=n||{};s=H(s||{},{min:Um(o,s.min),max:Um(o,s.max),axisCrossingValue:Wm(o,s.axisCrossingValues||s.axisCrossingValue),weekStartDay:Gm(s,o)}),s=yh(i,a,s),super(s,r),this.intlService=o,this.seriesMin=i,this.seriesMax=a;let c=s.weekStartDay||0;this.totalMin=Rm(Pm(Rm(i)-1,s.baseUnit,c)),this.totalMax=Rm(Fm(Rm(a)+1,s.baseUnit,c))}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}range(){let e=this.options;return{min:e.min,max:e.max}}getDivisions(e){let t=this.options;return Math.floor(Hm(t.min,t.max,t.baseUnit)/e+1)}getTickPositions(e){let t=this.options,{axisDir:n,lineSize:r,lineStart:i}=this.lineInfo(),a=this.getDivisions(e),o=r/Lm(t.max,t.min),s=t.weekStartDay||0,c=[i];for(let r=1;r<a;r++){let a=i+Lm(Nm(t.min,r*e,t.baseUnit,s),t.min)*o*n;c.push(q(a,3))}return c}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(e,t,n){return uh.prototype.getSlot.call(this,Um(this.intlService,e),Um(this.intlService,t),n)}getValue(e){let t=uh.prototype.getValue.call(this,e);return t===null?null:km(t)}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(e,t,n){let r=this.options,i=e*r.majorUnit,a=r.weekStartDay||0,o=r.min;i>0&&(o=Nm(o,i,r.baseUnit,a));let s=t.dateFormats[r.baseUnit];t.format=t.format||s;let c=this.axisLabelText(o,t,n);return new rm(o,c,e,null,t)}translateRange(e){let t=this.options,n=this.lineBox(),{vertical:r,reverse:i}=t,a=r?n.height():n.width(),o=this.range(),s=a/Lm(o.max,o.min),c=q(e/s,10);return(r||i)&&!(r&&i)&&(c=-c),{min:Om(t.min,c),max:Om(t.max,c),offset:c}}shouldRenderNote(e){let t=this.range();return Im(e,t.min)>=0&&Im(e,t.max)<=0}pan(e){let t=this.translateRange(e,!0),n=this.limitRange(Rm(t.min),Rm(t.max),this.totalMin,this.totalMax,t.offset);if(n)return{min:km(n.min),max:km(n.max)}}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t),i=Math.min(n,r),a=Math.max(n,r);return{min:km(i),max:km(a)}}scaleRange(e,t){let n=Math.abs(this.pointOffset(t)),r=this.options.max-this.options.min,i=this.scaleToDelta(e,r),a=n*i,o=(1-n)*i,s=km(Rm(this.options.min)+a),c=km(Rm(this.options.max)-o);return c-s<gh&&(c=km(Rm(s)+gh)),{min:s,max:c}}zoomRange(e,t){let n=this.scaleRange(e,t);return{min:km(K(Rm(n.min),this.totalMin,this.totalMax)),max:km(K(Rm(n.max),this.totalMin,this.totalMax))}}};function vh(e){let t=_m;return e>=31536e6?t=xm:e>=26784e5?t=bm:e>=6048e5?t=ym:e>=864e5&&(t=vm),t}function yh(e,t,n){let r=n.min||e,i=n.max||t,a=n.baseUnit||(i&&r?vh(Dm(i,r)):`hours`),o=Em[a],s=n.weekStartDay||0,c=Pm(Rm(r)-1,a,s)||km(i),l=Fm(Rm(i)+1,a,s),u=(n.majorUnit?n.majorUnit:void 0)||sh(A(c.getTime(),l.getTime()),o)/o,d=Hm(c,l,a),f=sh(d,u)-d,p=Math.floor(f/2),m=f-p;return n.baseUnit||delete n.baseUnit,n.baseUnit=n.baseUnit||a,n.min=n.min||Nm(c,-p,a,s),n.max=n.max||Nm(l,m,a,s),n.minorUnit=n.minorUnit||u/5,n.majorUnit=u,n}Y(_h,{type:w,majorGridLines:{visible:!0,width:1,color:b},labels:{dateFormats:Ym}});let bh=1e-6;var xh=class e extends mm{constructor(e,t,n,r){let i=H({majorUnit:10,min:e,max:t},n),a=i.majorUnit,o=wh(t,a),s=Ch(e,t,i),c=Sh(s,o,i,n);i.max=c.max,i.min=c.min,i.minorUnit=n.minorUnit||q(a-1,10),super(i,r),this.totalMin=G(n.min)?Math.min(s,n.min):s,this.totalMax=G(n.max)?Math.max(o,n.max):o,this.logMin=q(Eh(c.min,a),10),this.logMax=q(Eh(c.max,a),10),this.seriesMin=e,this.seriesMax=t,this.createLabels()}clone(){return new e(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return this.options.min}getSlot(e,t,n){let{options:r,logMin:i,logMax:a}=this,{majorUnit:o,min:s,max:c}=r,{axis:l,axisDir:u,lineBox:d,lineSize:f,lineStart:p}=this.lineInfo(),m=u*(f/(a-i)),h=J(e,t||1),g=J(t,e||1);if(h<=0||g<=0)return null;n&&(h=K(h,s,c),g=K(g,s,c)),h=Eh(h,o),g=Eh(g,o);let _=Math.min(h,g)-i,v=Math.max(h,g)-i,y=new Z(d.x1,d.y1,d.x1,d.y1);return y[l+1]=ch(p+m*(u>0?_:v)),y[l+2]=ch(p+m*(u>0?v:_)),y}getValue(e){let{options:t,logMin:n,logMax:r}=this,{majorUnit:i}=t,{axis:a,axisDir:o,lineStart:s,lineSize:c}=this.lineInfo(),l=(r-n)/c,u=o*(e[a]-s),d=u*l;if(u<0||u>c)return null;let f=n+d;return q(i**+f,10)}range(){let e=this.options;return{min:e.min,max:e.max}}translateRange(e){let{options:t,logMin:n,logMax:r}=this,{reverse:i,vertical:a,majorUnit:o}=t,s=this.lineBox(),c=(a?s.height():s.width())/(r-n),l=q(e/c,10);return(a||i)&&!(a&&i)&&(l=-l),{min:o**+(n+l),max:o**+(r+l),offset:l}}labelsCount(){let e=Math.floor(this.logMax);return Math.floor(e-this.logMin)+1}getMajorTickPositions(){let e=[];return this.traverseMajorTicksPositions(t=>{e.push(t)},{step:1,skip:0}),e}createTicks(e){let t=this.options,{majorTicks:n,minorTicks:r,vertical:i}=t,a=t.labels.mirror,o=this.lineBox(),s=[],c={vertical:i};function l(t,n){c.tickX=a?o.x2:o.x2-n.size,c.tickY=a?o.y1-n.size:o.y1,c.position=t,e.append(fm(c,n))}return n.visible&&this.traverseMajorTicksPositions(l,n),r.visible&&this.traverseMinorTicksPositions(l,r),s}createGridLines(e){let{minorGridLines:t,majorGridLines:n,vertical:r}=this.options,i=e.lineBox(),a={lineStart:i[r?`x1`:`y1`],lineEnd:i[r?`x2`:`y2`],vertical:r},o=[],s=this.gridLinesVisual();function c(e,t){W(e,o)||(a.position=e,s.append(pm(a,t)),o.push(e))}return n.visible&&this.traverseMajorTicksPositions(c,n),t.visible&&this.traverseMinorTicksPositions(c,t),s.children}traverseMajorTicksPositions(e,t){let{lineStart:n,step:r}=this.lineInfo(),{logMin:i,logMax:a}=this;for(let o=Math.ceil(i)+t.skip;o<=a;o+=t.step)e(q(n+r*(o-i),10),t)}traverseMinorTicksPositions(e,t){let{min:n,max:r,minorUnit:i,majorUnit:a}=this.options,{lineStart:o,step:s}=this.lineInfo(),{logMin:c,logMax:l}=this,u=Math.floor(c);for(let d=u;d<l;d++){let l=this._minorIntervalOptions(d);for(let u=t.skip;u<i;u+=t.step){let i=l.value+u*l.minorStep;if(i>r)break;i>=n&&e(q(o+s*(Eh(i,a)-c),10),t)}}}createAxisLabel(e,t,n){let r=Math.ceil(this.logMin+e),i=this.options.majorUnit**+r;return new rm(i,this.axisLabelText(i,t,n),e,null,t)}shouldRenderNote(e){let t=this.range();return t.min<=e&&e<=t.max}pan(e){let t=this.translateRange(e);return this.limitRange(t.min,t.max,this.totalMin,this.totalMax,t.offset)}pointsRange(e,t){let n=this.getValue(e),r=this.getValue(t);return{min:Math.min(n,r),max:Math.max(n,r)}}scaleRange(e,t){let{majorUnit:n}=this.options,r=Eh(this.options.min,n),i=Eh(this.options.max,n),a=Math.abs(this.pointOffset(t)),o=i-r,s=this.scaleToDelta(e,o),c=n**+(r+a*s),l=n**(i-(1-a)*s);return l-c<bh&&(l=c+bh),{min:c,max:l}}zoomRange(e,t){let n=this.scaleRange(e,t),{totalMin:r,totalMax:i}=this;return{min:K(n.min,r,i),max:K(n.max,r,i)}}_minorIntervalOptions(e){let{minorUnit:t,majorUnit:n}=this.options,r=n**+e;return{value:r,minorStep:(n**+(e+1)-r)/t}}lineInfo(){let e=super.lineInfo();return e.step=e.axisDir*(e.lineSize/(this.logMax-this.logMin)),e}};function Sh(e,t,n,r){let{min:i,max:a}=n;return G(n.axisCrossingValue)&&n.axisCrossingValue<=0&&Th(),G(r.max)?r.max<=0&&Th():a=t,G(r.min)?r.min<=0&&Th():i=e,{min:i,max:a}}function Ch(e,t,n){let r=n.majorUnit,i=e;return e<=0?i=t<=1?r**-2:1:n.narrowRange||(i=r**+Math.floor(Eh(e,r))),i}function wh(e,t){let n=q(Eh(e,t),10)%1,r;return r=e<=0?t:n!==0&&(n<.3||n>.9)?t**+(Eh(e,t)+.2):t**+Math.ceil(Eh(e,t)),r}function Th(){throw Error(`Non positive values cannot be used for a logarithmic axis`)}function Eh(e,t){return Math.log(e)/Math.log(t)}Y(xh,{type:`log`,majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:b},zIndex:1,_deferLabels:!0});let Dh={createGridLines:function(e){let t=this.options,n=Math.abs(this.box.center().y-e.lineBox().y1),r=[],i=!1,a,o;return t.majorGridLines.visible&&(a=this.majorGridLineAngles(e),i=!0,r=this.renderMajorGridLines(a,n,t.majorGridLines)),t.minorGridLines.visible&&(o=this.minorGridLineAngles(e,i),Zd(r,this.renderMinorGridLines(o,n,t.minorGridLines,e,i))),r},renderMajorGridLines:function(e,t,n){return this.renderGridLines(e,t,n)},renderMinorGridLines:function(e,t,n,r,i){let a=this.radiusCallback&&this.radiusCallback(t,r,i);return this.renderGridLines(e,t,n,a)},renderGridLines:function(e,t,n,r){let i={stroke:{width:n.width,color:n.color,dashType:n.dashType}},a=this.box.center(),o=new jn([a.x,a.y],t),s=this.gridLinesVisual();for(let t=0;t<e.length;t++){let n=new F(i);r&&(o.radius=r(e[t])),n.moveTo(o.center).lineTo(o.pointAt(e[t]+180)),s.append(n)}return s.children},gridLineAngles:function(e,t,n,r,i){let a=this.intervals(t,n,r,i),o=e.options,s=o.visible&&(o.line||{}).visible!==!1;return Jd(a,e=>{let t=this.intervalAngle(e);if(!s||t!==90)return t})}};var Oh=class extends Jm{range(){return{min:0,max:this.options.categories.length}}reflow(e){this.box=e,this.reflowLabels()}lineBox(){return this.box}reflowLabels(){let{labels:e,options:{labels:t}}=this,n=t.skip||0,r=t.step||1,i=new Z;for(let t=0;t<e.length;t++){e[t].reflow(i);let a=e[t].box;e[t].reflow(this.getSlot(n+t*r).adjacentBox(0,a.width(),a.height()))}}intervals(e,t,n,r=!1){let i=this.options,a=i.categories.length/e||1,o=360/a,s=t||0,c=n||1,l=[],u=0;for(let e=s;e<a;e+=c)u=i.reverse?360-e*o:e*o,u=q(u,3)%360,r&&W(u,r)||l.push(u);return l}majorIntervals(){return this.intervals(1)}minorIntervals(){return this.intervals(.5)}intervalAngle(e){return(360+e+this.options.startAngle)%360}majorAngles(){return Jd(this.majorIntervals(),e=>this.intervalAngle(e))}createLine(){return[]}majorGridLineAngles(e){let t=this.options.majorGridLines;return this.gridLineAngles(e,1,t.skip,t.step)}minorGridLineAngles(e,t){let{minorGridLines:n,majorGridLines:r}=this.options,i=t?this.intervals(1,r.skip,r.step):null;return this.gridLineAngles(e,.5,n.skip,n.step,i)}radiusCallback(e,t,n){if(t.options.type!==`arc`){let t=cf(360/(this.options.categories.length*2)),r=Math.cos(t)*e,i=this.majorAngles();return function(t){return!n&&W(t,i)?e:r}}}createPlotBands(){let e=this.options.plotBands||[],t=this._plotbandGroup=new I({zIndex:-1});for(let n=0;n<e.length;n++){let r=e[n],i=this.plotBandSlot(r),a=this.getSlot(r.from),o=r.from-Math.floor(r.from);i.startAngle+=o*a.angle;let s=Math.ceil(r.to)-r.to;i.angle-=(s+o)*a.angle;let c=Mp.current.createRing(i,{fill:{color:r.color,opacity:r.opacity},stroke:{opacity:r.opacity}});t.append(c)}this.appendVisual(t)}plotBandSlot(e){return this.getSlot(e.from,e.to-1)}getSlot(e,t){let n=this.options,r=n.justified,i=this.box,a=this.majorAngles(),o=a.length,s=360/o,c=e;n.reverse&&!r&&(c=(c+1)%o),c=K(Math.floor(c),0,o-1);let l=a[c];r&&(l-=s/2,l<0&&(l+=360));let u=s*(K(Math.ceil(t||c),c,o-1)-c+1);return new Ap(i.center(),0,i.height()/2,l,u)}slot(e,t){let n=this.getSlot(e,t),r=n.startAngle+180,i=r+n.angle;return new Wn([n.center.x,n.center.y],{startAngle:r,endAngle:i,radiusX:n.radius,radiusY:n.radius})}pointCategoryIndex(e){let t=this.options.categories.length,n=null;for(let r=0;r<t;r++)if(this.getSlot(r).containsPoint(e)){n=r;break}return n}};Y(Oh,{startAngle:90,labels:{margin:U(10)},majorGridLines:{visible:!0},justified:!0}),H(Oh.prototype,Dh);var kh=class extends mm{constructor(e,t){super(e,t);let n=this.options;n.minorUnit=n.minorUnit||n.majorUnit/2}getDivisions(e){return uh.prototype.getDivisions.call(this,e)-1}reflow(e){this.box=e,this.reflowLabels()}reflowLabels(){let{options:e,labels:t,options:{labels:n}}=this,r=n.skip||0,i=n.step||1,a=new Z,o=this.intervals(e.majorUnit,r,i);for(let e=0;e<t.length;e++){t[e].reflow(a);let n=t[e].box;t[e].reflow(this.getSlot(o[e]).adjacentBox(0,n.width(),n.height()))}}lineBox(){return this.box}intervals(e,t,n,r=!1){let i=this.options.min,a=this.getDivisions(e),o=[],s=t||0,c=n||1;for(let t=s;t<a;t+=c){let n=(360+i+t*e)%360;r&&W(n,r)||o.push(n)}return o}majorIntervals(){return this.intervals(this.options.majorUnit)}minorIntervals(){return this.intervals(this.options.minorUnit)}intervalAngle(e){return(540-e-this.options.startAngle)%360}createLine(){return[]}majorGridLineAngles(e){let t=this.options.majorGridLines;return this.gridLineAngles(e,this.options.majorUnit,t.skip,t.step)}minorGridLineAngles(e,t){let n=this.options,{minorGridLines:r,majorGridLines:i}=n,a=t?this.intervals(n.majorUnit,i.skip,i.step):null;return this.gridLineAngles(e,n.minorUnit,r.skip,r.step,a)}plotBandSlot(e){return this.getSlot(e.from,e.to)}getSlot(e,t){let{options:n,box:r}=this,i=n.startAngle,a=K(e,n.min,n.max),o=K(t||a,a,n.max);if(n.reverse&&(a*=-1,o*=-1),a=(540-a-i)%360,o=(540-o-i)%360,o<a){let e=a;a=o,o=e}return new Ap(r.center(),0,r.height()/2,a,o-a)}slot(e,t=e){let n=this.options,r=360-n.startAngle,i=this.getSlot(e,t),a=Math.min(e,t),o=Math.max(e,t),s,c;return n.reverse?(s=a,c=o):(s=360-o,c=360-a),s=(s+r)%360,c=(c+r)%360,new Wn([i.center.x,i.center.y],{startAngle:s,endAngle:c,radiusX:i.radius,radiusY:i.radius})}getValue(e){let t=this.options,n=this.box.center(),r=e.x-n.x,i=e.y-n.y,a=Math.round($d(Math.atan2(i,r))),o=t.startAngle;return t.reverse||(a*=-1,o*=-1),(a+o+360)%360}valueRange(){return{min:0,max:Math.PI*2}}};Y(kh,{type:`polar`,startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:U(10)},majorGridLines:{color:b,visible:!0,width:1},minorGridLines:{color:`#aaa`}}),H(kh.prototype,Dh,{createPlotBands:Oh.prototype.createPlotBands,majorAngles:Oh.prototype.majorAngles,range:uh.prototype.range,labelsCount:uh.prototype.labelsCount,createAxisLabel:uh.prototype.createAxisLabel});let Ah={options:{majorGridLines:{visible:!0}},createPlotBands:function(){let{majorGridLines:{type:e},plotBands:t=[]}=this.options,n=this.plotArea.polarAxis,r=n.majorAngles(),i=n.box.center(),a=this._plotbandGroup=new I({zIndex:-1});for(let n=0;n<t.length;n++){let o=t[n],s={fill:{color:o.color,opacity:o.opacity},stroke:{opacity:o.opacity}},c=this.getSlot(o.from,o.to,!0),l=new Ap(i,i.y-c.y2,i.y-c.y1,0,360),u;u=e===`arc`?Mp.current.createRing(l,s):F.fromPoints(this.plotBandPoints(l,r),s).close(),a.append(u)}this.appendVisual(a)},plotBandPoints:function(e,t){let n=[],r=[],i=[e.center.x,e.center.y],a=new jn(i,e.innerRadius),o=new jn(i,e.radius);for(let e=0;e<t.length;e++)n.push(a.pointAt(t[e]+180)),r.push(o.pointAt(t[e]+180));return n.reverse(),n.push(n[0]),r.push(r[0]),r.concat(n)},createGridLines:function(e){let t=this.options,n=this.radarMajorGridLinePositions(),r=e.majorAngles(),i=e.box.center(),a=[];if(t.majorGridLines.visible&&(a=this.renderGridLines(i,n,r,t.majorGridLines)),t.minorGridLines.visible){let e=this.radarMinorGridLinePositions();Zd(a,this.renderGridLines(i,e,r,t.minorGridLines))}return a},renderGridLines:function(e,t,n,r){let i={stroke:{width:r.width,color:r.color,dashType:r.dashType}},{skip:a=0,step:o=0}=r,s=this.gridLinesVisual();for(let c=a;c<t.length;c+=o){let a=e.y-t[c];if(a>0){let t=new jn([e.x,e.y],a);if(r.type===`arc`)s.append(new Rn(t,i));else{let e=new F(i);for(let r=0;r<n.length;r++)e.lineTo(t.pointAt(n[r]+180));e.close(),s.append(e)}}}return s.children},getValue:function(e){let t=this.lineBox(),n=this.plotArea.polarAxis,r=n.majorAngles(),i=n.box.center(),a=e.distanceTo(i),o=a;if(this.options.majorGridLines.type!==`arc`&&r.length>1){let t=e.x-i.x,n=e.y-i.y,s=($d(Math.atan2(n,t))+540)%360;r.sort(function(e,t){return jh(e,s)-jh(t,s)});let c=jh(r[0],r[1])/2,l=jh(s,r[0]),u=90-c,d=180-l-u;o=a*(Math.sin(cf(d))/Math.sin(cf(u)))}return this.axisType().prototype.getValue.call(this,new X(t.x1,t.y2-o))}};function jh(e,t){return 180-Math.abs(Math.abs(e-t)-180)}var Mh=class extends uh{radarMajorGridLinePositions(){return this.getTickPositions(this.options.majorUnit)}radarMinorGridLinePositions(){let e=this.options,t=0;return e.majorGridLines.visible&&(t=e.majorUnit),this.getTickPositions(e.minorUnit,t)}axisType(){return uh}};H(Mh.prototype,Ah);var Nh=class extends xh{radarMajorGridLinePositions(){let e=[];return this.traverseMajorTicksPositions(function(t){e.push(t)},this.options.majorGridLines),e}radarMinorGridLinePositions(){let e=[];return this.traverseMinorTicksPositions(function(t){e.push(t)},this.options.minorGridLines),e}axisType(){return xh}};H(Nh.prototype,Ah);let Ph=.333;var Fh=class{constructor(e){this.closed=e}process(e){let t=e.slice(0),n=[],r=this.closed,i=t.length;if(i>2&&(this.removeDuplicates(0,t),i=t.length),i<2||i===2&&t[0].equals(t[1]))return n;let a=t[0],o=t[1],s=t[2];for(n.push(new fr(a));a.equals(t[i-1]);)r=!0,t.pop(),i--;if(i===2){let e=this.tangent(a,o,`x`,`y`);return of(n).controlOut(this.firstControlPoint(e,a,o,`x`,`y`)),n.push(new fr(o,this.secondControlPoint(e,a,o,`x`,`y`))),n}let c,l;if(r){a=t[i-1],o=t[0],s=t[1];let e=this.controlPoints(a,o,s);c=e[1],l=e[0]}else{let e=this.tangent(a,o,`x`,`y`);c=this.firstControlPoint(e,a,o,`x`,`y`)}let u=c;for(let e=0;e<=i-3;e++)if(this.removeDuplicates(e,t),i=t.length,e+3<=i){a=t[e],o=t[e+1],s=t[e+2];let r=this.controlPoints(a,o,s);of(n).controlOut(u),u=r[1];let i=r[0];n.push(new fr(o,i))}if(r){a=t[i-2],o=t[i-1],s=t[0];let e=this.controlPoints(a,o,s);of(n).controlOut(u),n.push(new fr(o,e[0])),of(n).controlOut(e[1]),n.push(new fr(s,l))}else{let e=this.tangent(o,s,`x`,`y`);of(n).controlOut(u),n.push(new fr(s,this.secondControlPoint(e,o,s,`x`,`y`)))}return n}removeDuplicates(e,t){for(;t[e+1]&&(t[e].equals(t[e+1])||t[e+1].equals(t[e+2]));)t.splice(e+1,1)}invertAxis(e,t,n){let r=!1;if(e.x===t.x)r=!0;else if(t.x===n.x)(t.y<n.y&&e.y<=t.y||n.y<t.y&&t.y<=e.y)&&(r=!0);else{let i=this.lineFunction(e,t),a=this.calculateFunction(i,n.x);!(e.y<=t.y&&n.y<=a)&&!(t.y<=e.y&&n.y>=a)&&(r=!0)}return r}isLine(e,t,n){let r=this.lineFunction(e,t),i=this.calculateFunction(r,n.x);return e.x===t.x&&t.x===n.x||q(i,1)===q(n.y,1)}lineFunction(e,t){let n=(t.y-e.y)/(t.x-e.x);return[e.y-n*e.x,n]}controlPoints(e,t,n){let r=`x`,i=`y`,a=!1,o;if(this.isLine(e,t,n))o=this.tangent(e,t,`x`,`y`);else{let s={x:this.isMonotonicByField(e,t,n,`x`),y:this.isMonotonicByField(e,t,n,`y`)};if(s.x&&s.y){let a=t[r]-e[r],s=n[r]-t[r],c=(t[i]-e[i])/a,l=(n[i]-t[i])/s;o=3*(a+s)/((2*s+a)/c+(s+2*a)/l)}else if(this.invertAxis(e,t,n)&&(r=`y`,i=`x`),s[r])o=0;else{let s;s=n[i]<e[i]&&e[i]<=t[i]||e[i]<n[i]&&t[i]<=e[i]?Ih((n[i]-e[i])*(t[r]-e[r])):-Ih((n[r]-e[r])*(t[i]-e[i])),o=.01*s,a=!0}}let s=this.secondControlPoint(o,e,t,r,i);if(a){let e=r;r=i,i=e}return[s,this.firstControlPoint(o,t,n,r,i)]}tangent(e,t,n,r){let i=t[n]-e[n],a=t[r]-e[r],o;return o=i===0?0:a/i,o}isMonotonicByField(e,t,n,r){return n[r]>t[r]&&t[r]>e[r]||n[r]<t[r]&&t[r]<e[r]}firstControlPoint(e,t,n,r,i){let a=t[r],o=(n[r]-a)*Ph;return this.point(a+o,t[i]+o*e,r,i)}secondControlPoint(e,t,n,r,i){let a=t[r],o=n[r],s=(o-a)*Ph;return this.point(o-s,n[i]-s*e,r,i)}point(e,t,n,r){let i=new M;return i[n]=e,i[r]=t,i}calculateFunction(e,t){let n=e.length,r=0;for(let i=0;i<n;i++)r+=t**+i*e[i];return r}};function Ih(e){return e<=0?-1:1}var Lh=class{constructor(e){this._axis=e,this.options=e.options}value(e){let t=this._axis;return t.getCategory?t.getCategory(e):t.getValue(e)}slot(e,t,n=!0){return this._axis.slot(e,t,n)}range(){return this._axis.range()}valueRange(){return this._axis.valueRange()}};function Rh(e,t){for(let n=0;n<t.length;n++)if(t[n].options.name===e)return t[n].prepareUserOptions(),new Lh(t[n])}var zh=class{constructor(e){this.visual=e.visual,this.chartsVisual=e.chartContainer.visual,this._pane=e}findAxisByName(e){return Rh(e,this._pane.axes)}},Bh=class{constructor(e){this._plotArea=e,this.visual=e.visual,this.backgroundVisual=e._bgVisual}};function Vh(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e[r];V(t)&&n++}return n}let Hh={min:function(e){let t=e.length,n=D;for(let r=0;r<t;r++){let t=e[r];V(t)&&(n=Math.min(n,t))}return n===D?e[0]:n},max:function(e){let t=e.length,n=ne;for(let r=0;r<t;r++){let t=e[r];V(t)&&(n=Math.max(n,t))}return n===ne?e[0]:n},sum:function(e){let t=e.length,n=0;for(let r=0;r<t;r++){let t=e[r];V(t)&&(n+=t)}return n},sumOrNull:function(e){let t=null;return Vh(e)&&(t=Hh.sum(e)),t},count:function(e){let t=e.length,n=0;for(let r=0;r<t;r++)e[r]!=null&&n++;return n},avg:function(e){let t=Vh(e),n=e[0];return t>0&&(n=Hh.sum(e)/t),n},first:function(e){let t=e.length;for(let n=0;n<t;n++){let t=e[n];if(t!=null)return t}return e[0]}};function Uh(e,t){return t===null?t:Bd(e,!0)(t)}var Wh=class{constructor(){this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}}register(e,t=[ae],n={}){for(let r=0;r<e.length;r++){let i=e[r];this._valueFields[i]=t,this._otherFields[i]=n,this._nullValue[i]=this._makeValue(t,null),this._undefinedValue[i]=this._makeValue(t,void 0)}}canonicalFields(e){return this.valueFields(e).concat(this.otherFields(e))}valueFields(e){return this._valueFields[e.type]||[`value`]}otherFields(e){return this._otherFields[e.type]||[`value`]}bindPoint(e,t,n){let r=e.data,i=n===void 0?r[t]:n,a={valueFields:{value:i}},o=this.valueFields(e),s=this._otherFields[e.type],c,l;if(i===null)l=this._nullValue[e.type];else if(i===void 0)l=this._undefinedValue[e.type];else if(Array.isArray(i)){let e=i.slice(o.length);l=this._bindFromArray(i,o),c=this._bindFromArray(e,s)}else if(typeof i==`object`){let t=this.sourceFields(e,o),n=this.sourceFields(e,s);l=this._bindFromObject(i,o,t),c=this._bindFromObject(i,s,n)}return l!==void 0&&(o.length===1?a.valueFields.value=l[o[0]]:a.valueFields=l),a.fields=c||{},a}_makeValue(e,t){let n={},r=e.length;for(let i=0;i<r;i++){let r=e[i];n[r]=t}return n}_bindFromArray(e,t){let n={};if(t){let r=Math.min(t.length,e.length);for(let i=0;i<r;i++)n[t[i]]=e[i]}return n}_bindFromObject(e,t,n=t){let r={};if(t){let i=t.length;for(let a=0;a<i;a++){let i=t[a],o=n[a];o!==null&&(r[i]=Uh(o,e))}}return r}sourceFields(e,t){let n=[];if(t){let r=t.length;for(let i=0;i<r;i++){let r=t[i],a=r===`value`?`field`:r+`Field`;n.push(e[a]===null?null:e[a]||r)}}return n}};Wh.current=new Wh;let Gh=/percent(?:\w*)\((\d+)\)/,Kh=RegExp(`^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$`);var qh=class{constructor(e,t,n){this.initGlobalRanges(e,t,n)}initGlobalRanges(e,t,n){let r=t.data,i=Kh.exec(e);if(i){this.valueGetter=this.createValueGetter(t,n);let e=this.getAverage(r),a=this.getStandardDeviation(r,e,!1),o=i[1]?parseFloat(i[1]):1,s={low:e.value-a*o,high:e.value+a*o};this.globalRange=function(){return s}}else if(e.indexOf&&e.indexOf(`stderr`)>=0){this.valueGetter=this.createValueGetter(t,n);let e=this.getStandardError(r,this.getAverage(r));this.globalRange=function(t){return{low:t-e,high:t+e}}}}createValueGetter(e,t){let n=e.data,r=Wh.current,i=r.valueFields(e),a=G(n[0])?n[0]:{},o;return j(a)?o=Bd(`[`+(t?i.indexOf(t):0)+`]`):V(a)?o=Bd():typeof a==`object`&&(o=Bd(r.sourceFields(e,i)[i.indexOf(t)])),o}getErrorRange(e,t){let n,r,i;if(!G(t))return null;if(this.globalRange)return this.globalRange(e);if(j(t))n=e-t[0],r=e+t[1];else if(V(i=parseFloat(t)))n=e-i,r=e+i;else if(i=Gh.exec(t)){let t=e*(parseFloat(i[1])/100);n=e-Math.abs(t),r=e+Math.abs(t)}else throw Error(`Invalid ErrorBar value: `+t);return{low:n,high:r}}getStandardError(e,t){return this.getStandardDeviation(e,t,!0)/Math.sqrt(t.count)}getStandardDeviation(e,t,n){let r=e.length,i=n?t.count-1:t.count,a=0;for(let n=0;n<r;n++){let r=this.valueGetter(e[n]);V(r)&&(a+=(r-t.value)**2)}return Math.sqrt(a/i)}getAverage(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++){let t=this.valueGetter(e[i]);V(t)&&(n+=t,r++)}return{value:n/r,count:r}}};let Jh=ke.browser||{},Yh=`fadeIn`,Xh=.8,Zh=Jh.msie?.001:0,Qh=`errorLow`,$h=`errorHigh`,eg=`zero`,tg=`above`,ng=`below`,rg=`area`,ig=`boxPlot`,ag=`bubble`,og=`bullet`,sg=`candlestick`,cg=`column`,lg=`donut`,ug=`funnel`,dg=`pyramid`,fg=`heatmap`,pg=`horizontalWaterfall`,mg=`line`,hg=`ohlc`,gg=`polarArea`,_g=`polarLine`,vg=`polarScatter`,yg=`radarArea`,bg=`radarColumn`,xg=`radarLine`,Sg=`rangeArea`,Cg=`rangeBar`,wg=`rangeColumn`,Tg=`scatter`,Eg=`scatterLine`,Dg=`verticalArea`,Og=`verticalBoxPlot`,kg=`verticalBullet`,Ag=`verticalLine`,jg=`verticalRangeArea`,Mg=`waterfall`,Ng=[`bar`,cg,hg,sg,ig,Og,og,wg,Cg,Mg,pg],Pg=`exponentialTrendline`,Fg=`linearTrendline`,Ig=`logarithmicTrendline`,Lg=`movingAverageTrendline`,Rg=`polynomialTrendline`,zg=`powerTrendline`,Bg=[Pg,Fg,Ig,Lg,Rg,zg],Vg=`plotAreaLeave`,Hg=`drag`,Ug=`dragEnd`,Wg=`zoomStart`,Gg=`zoom`,Kg=`zoomEnd`,qg=`select`,Jg=`selectEnd`,Yg=`hideTooltip`,Xg=`graphics-symbol`,Zg=`k-chart-point`,Qg=`Point`,$g=`category`,e_=`outsideEnd`,t_=`wheel`,n_=`drilldown`,r_=`pattern`;var i_=class extends Q{constructor(e,t,n,r,i,a){super(a),this.low=e,this.high=t,this.isVertical=n,this.chart=r,this.series=i}reflow(e){let t=this.options.endCaps,n=this.isVertical,r=this.getAxis().getSlot(this.low,this.high),i=e.center(),a=this.getCapsWidth(e,n),o=n?i.x:i.y,s=o-a,c=o+a,l;n?(l=[new X(i.x,r.y1),new X(i.x,r.y2)],t&&l.push(new X(s,r.y1),new X(c,r.y1),new X(s,r.y2),new X(c,r.y2)),this.box=new Z(s,r.y1,c,r.y2)):(l=[new X(r.x1,i.y),new X(r.x2,i.y)],t&&l.push(new X(r.x1,s),new X(r.x1,c),new X(r.x2,s),new X(r.x2,c)),this.box=new Z(r.x1,s,r.x2,c)),this.linePoints=l}getCapsWidth(e,t){let n=t?e.width():e.height();return Math.min(Math.floor(n/2),4)||4}createVisual(){let e=this.options,t=e.visual;t?this.visual=t({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:e.endCaps,color:e.color,line:e.line},createVisual:()=>{this.createDefaultVisual();let e=this.visual;return delete this.visual,e}}):this.createDefaultVisual()}createDefaultVisual(){let{options:e,linePoints:t}=this,n={stroke:{color:e.color,width:e.line.width,dashType:e.line.dashType}};super.createVisual();for(let e=0;e<t.length;e+=2){let r=new F(n).moveTo(t[e].x,t[e].y).lineTo(t[e+1].x,t[e+1].y);yd(r),this.visual.append(r)}}};Y(i_,{animation:{type:Yh,delay:600},endCaps:!0,line:{width:2},zIndex:1});var a_=class extends i_{getAxis(){return this.chart.seriesValueAxis(this.series)}};function o_(e){for(let t=0;t<e.length;t++)if(G(e[t].zIndex))return!0}function s_(e,t){t!==null&&e.push(t)}function c_(e){return Vh(e)===e.length}function l_(e,t,n){let r=t.visible;if(G(r))return r;let i=e.pointVisibility;if(i)return i[n]}function u_(e){let t=e.data,n=[],r=0,i=0;for(let a=0;a<t.length;a++){let t=Wh.current.bindPoint(e,a),o=t.valueFields.value;xd(o)&&(o=parseFloat(o)),V(o)?(t.visible=l_(e,t.fields,a)!==!1,t.value=Math.abs(o),n.push(t),t.visible&&(r+=t.value),o!==0&&i++):n.push(null)}return{total:r,points:n,count:i}}function d_(e){let t=e.length,n=0;for(let r=0;r<t;r++)n=Math.max(n,e[r].data.length);return n}function f_(e,t){return e&&t?e.toLowerCase()===t.toLowerCase():e===t}function p_(e,t,n={},r=!1){let i=n.defaults=n.defaults||{},a=n.depth=n.depth||0,o=!1;if(n.excluded=n.excluded||[],a>5)return null;for(let a in e)if(!W(a,n.excluded)&&Nf(e,a)){let s=e[a];Ed(s)?(o=!0,r||(e[a]=J(s(t),i[a]))):kd(s)&&(r||(n.defaults=i[a]),n.depth++,o=p_(s,t,n,r)||o,n.depth--)}return o}function m_(e,t){let n=[],r=[].concat(t);for(let t=0;t<e.length;t++){let i=e[t];W(i.type,r)&&n.push(i)}return n}let h_=new WeakMap;function g_(e,t,n){if(typeof t!=`object`||!t)return Um(n,e);let r=h_.get(t);return r||(r=Um(n,e),h_.set(t,r)),r}function __(e){let t=e.overlay;return t&&t.gradient&&t.gradient!==`none`}function v_(e){return G(e)&&e!==null}function y_(e,t){let n=e.type,r=t instanceof Date;return!n&&r||f_(n,`date`)}function b_(e){return e.length===1?e[0]:e}let x_=/area/i;function S_(e){return e.missingValues?e.missingValues:x_.test(e.type)||e.stack?eg:`interpolate`}function C_(e,t){let n=Wh.current.bindPoint(e,null,t).valueFields;for(let e in n)if(Sd(n[e]))return!0}function w_({start:e,dir:t,min:n,max:r,getter:i,hasItem:a,series:o}){let s,c,l=e;do l+=t,a(l)&&(c=i(l),s=C_(o,c.item));while(n<=l&&l<=r&&!s);if(s)return c}function T_(e,t,n,r,i){let{min:a,max:o}=t,s=a>0&&a<n,c=o+1<n;if(s||c){let t=S_(e),l,u;if(t!==`interpolate`)s&&(l=r(a-1)),c&&(u=r(o+1));else{let t,d;s&&(t=r(a-1),d=C_(e,t.item),l=d?t:w_({start:a,dir:-1,min:0,max:n-1,getter:r,hasItem:i,series:e})),c&&(t=r(o+1),d=C_(e,t.item),u=d?t:w_({start:o,dir:1,min:0,max:n-1,getter:r,hasItem:i,series:e}))}l&&(e._outOfRangeMinPoint=l),u&&(e._outOfRangeMaxPoint=u)}}function E_(e,t){return t.forEach(t=>{let n=t&&t.options,r=t&&(t.box||t.wrapperBox);n&&r&&n.noclip!==!1&&n.visible!==!1&&!n.visual&&e.wrap(r)}),e}var D_=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.categoryAxis=e.seriesCategoryAxis(t.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=H({},r,{vertical:!this.options.invertAxes},e)}return n}plotValue(e){if(!e)return 0;if(this.options.isStacked100&&V(e.value)){let t=e.categoryIx,n=this.categoryPoints[t],r=[],i=0;for(let t=0;t<n.length;t++){let a=n[t];if(a){let t=e.series.stack,n=a.series.stack;if(t&&n&&t.group!==n.group)continue;V(a.value)&&(i+=Math.abs(a.value),r.push(Math.abs(a.value)))}}if(i>0)return e.value/i}return e.value}plotRange(e,t=0){let n=this.categoryPoints[e.categoryIx];if(this.options.isStacked){let r=this.plotValue(e),i=r>=0,a=t,o=!1,s=e.series.stack===void 0?this.options.defaultStack:e.series.stack,c=e=>e===!0||typeof e==`object`&&!e.group;if(s)for(let l=0;l<n.length;l++){let u=n[l];if(e===u)break;let d=u.series.stack===void 0?this.options.defaultStack:u.series.stack;if(!d||typeof s==`string`&&s!==d||c(s)&&!c(d)||s.group&&s.group!==d.group)continue;let f=this.plotValue(u);(f>=0&&i||f<0&&!i)&&(t===0||f!==0)&&(a+=f,r+=f,o=!0,this.options.isStacked100&&(r=Math.min(r,1)))}return o&&(a-=t),[a,r]}let r=e.series,i=this.seriesValueAxis(r),a=this.categoryAxisCrossingValue(i);return[a,Sd(e.value)?e.value:a]}stackLimits(e,t){let n=D,r=ne;for(let i=0;i<this.categoryPoints.length;i++){let a=this.categoryPoints[i];if(a)for(let i=0;i<a.length;i++){let o=a[i];if(o&&(o.series.stack===t||o.series.axis===e)){let e=this.plotRange(o,0)[1];e!==void 0&&isFinite(e)&&(r=Math.max(r,e),n=Math.min(n,e))}}}return{min:n,max:r}}updateStackRange(){let{isStacked:e,series:t}=this.options,n={};if(e)for(let e=0;e<t.length;e++){let r=t[e],i=r.axis,a=i+r.stack,o=n[a];if(!o){o=this.stackLimits(i,r.stack);let e=this.errorTotals;e&&(e.negative.length&&(o.min=Math.min(o.min,vf(e.negative).min)),e.positive.length&&(o.max=Math.max(o.max,vf(e.positive).max))),o.min!==D||o.max!==ne?n[a]=o:o=null}o&&(this.valueAxisRanges[i]=o)}}addErrorBar(e,t,n){let{value:r,series:i,seriesIx:a}=e,o=e.options.errorBars,s=t.fields[Qh],c=t.fields[$h],l;V(s)&&V(c)?l={low:s,high:c}:o&&o.value!==void 0&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[a]=this.seriesErrorRanges[a]||new qh(o.value,i,`value`),l=this.seriesErrorRanges[a].getErrorRange(r,o.value)),l&&(e.low=l.low,e.high=l.high,this.addPointErrorBar(e,n))}addPointErrorBar(e,t){let n=!this.options.invertAxes,r=e.options.errorBars,{series:i,low:a,high:o}=e;if(this.options.isStacked){let n=this.stackedErrorRange(e,t);a=n.low,o=n.high}else{let e={categoryIx:t,series:i};this.updateRange({value:a},e),this.updateRange({value:o},e)}let s=new a_(a,o,n,this,i,r);e.errorBars=[s],e.append(s)}stackedErrorRange(e,t){let n=this.plotRange(e,0)[1]-e.value,r=e.low+n,i=e.high+n;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},r<0&&(this.errorTotals.negative[t]=Math.min(this.errorTotals.negative[t]||0,r)),i>0&&(this.errorTotals.positive[t]=Math.max(this.errorTotals.positive[t]||0,i)),{low:r,high:i}}addValue(e,t){let{categoryIx:n,series:r,seriesIx:i}=t,a=this.categoryPoints[n];a||(this.categoryPoints[n]=a=[]);let o=this.seriesPoints[i];o||(this.seriesPoints[i]=o=[]);let s=this.createPoint(e,t);s&&(Object.assign(s,t),s.owner=this,s.noteText=e.fields.noteText,s.dataItem===void 0&&(s.dataItem=r.data[n]),this.addErrorBar(s,e,n)),this.points.push(s),o.push(s),a.push(s),this.updateRange(e.valueFields,t)}evalPointOptions(e,t,n){let r=n.categoryIx,i=n.category,a=n.series,o=n.seriesIx,s={defaults:a._defaults,excluded:[`data`,`aggregate`,`_events`,`tooltip`,`content`,`template`,`visual`,`toggle`,`_outOfRangeMinPoint`,`_outOfRangeMaxPoint`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},c=this._evalSeries[o];c===void 0&&(this._evalSeries[o]=c=p_(e,{},s,!0));let l=e;return c&&(l=H({},l),p_(l,{value:t,category:i,index:r,series:a,dataItem:a.data[r]},s)),l}updateRange(e,t){let n=t.series.axis,r=e.value,i=this.valueAxisRanges[n];isFinite(r)&&r!==null&&(i=this.valueAxisRanges[n]=i||{min:D,max:ne},i.min=Math.min(i.min,r),i.max=Math.max(i.max,r))}seriesValueAxis(e){let t=this.plotArea,n=e.axis,r=n?t.namedValueAxes[n]:t.valueAxis;if(!r)throw Error(`Unable to locate value axis with name `+n);return r}reflow(e){let t=this.categorySlots=[],n=this.points,r=this.categoryAxis,i=0;this.traverseDataPoints((e,a)=>{let{categoryIx:o,series:s}=a,c=this.seriesValueAxis(s),l=n[i++],u=t[o];if(u||(t[o]=u=this.categorySlot(r,o,c)),l){let e=this.plotRange(l,c.startValue()),t=this.valueSlot(c,e);if(t){let n=this.pointSlot(u,t);l.aboveAxis=this.aboveAxis(l,c),l.stackValue=e[1],this.options.isStacked100&&(l.percentage=this.plotValue(l)),this.reflowPoint(l,n)}else l.visible=!1}}),this.reflowCategories(t),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=e}valueSlot(e,t){return e.getSlot(t[0],t[1],!this.options.clip)}limitPoints(){let e=this.categoryPoints,t=e[0].concat(of(e));for(let e=0;e<t.length;e++)t[e]&&this.limitPoint(t[e])}limitPoint(e){let t=this.categoryAxis.limitSlot(e.box);t.equals(e.box)||e.reflow(t)}aboveAxis(e,t){let n=this.categoryAxisCrossingValue(t),r=e.value;return t.options.reverse?r<n:r>=n}categoryAxisCrossingValue(e){let t=this.categoryAxis,n=e.options;return[].concat(n.axisCrossingValues||n.axisCrossingValue)[t.axisIndex||0]||0}reflowPoint(e,t){e.reflow(t)}reflowCategories(){}pointSlot(e,t){let n=this.options.invertAxes,r=n?t:e,i=n?e:t;return new Z(r.x1,i.y1,r.x2,i.y2)}categorySlot(e,t){return e.getSlot(t)}traverseDataPoints(e){let t=this.options.series,n=d_(t),r=t.length;for(let n=0;n<r;n++)this._outOfRangeCallback(t[n],`_outOfRangeMinPoint`,n,e);for(let i=0;i<n;i++){let a=this.categoryAxis.categoryAt(i);for(let o=0;o<r;o++){let r=t[o];e(this.plotArea.bindPoint(r,i),{category:a,categoryIx:i,categoriesCount:n,series:r,seriesIx:o})}}for(let n=0;n<r;n++)this._outOfRangeCallback(t[n],`_outOfRangeMaxPoint`,n,e)}_outOfRangeCallback(e,t,n,r){let i=e[t];if(i){let t=i.categoryIx;r(this.plotArea.bindPoint(e,t,i.item),{category:i.category,categoryIx:t,series:e,seriesIx:n,dataItem:i.item})}}formatPointValue(e,t){return e.value===null?``:this.chartService.format.auto(t,e.value)}pointValue(e){return e.valueFields.value}};Y(D_,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});let O_={click:function(e,t){return e.trigger(`seriesClick`,this.eventArgs(t))},hover:function(e,t){return e.trigger(`seriesHover`,this.eventArgs(t))},over:function(e,t){return e.trigger(`seriesOver`,this.eventArgs(t))},out:function(e,t){return e.trigger(`seriesLeave`,this.eventArgs(t))},eventArgs:function(e){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:rf(e),originalEvent:e,point:this}}},k_={createNote:function(){let e=this.options.notes,t=this.noteText||e.label.text;e.visible!==!1&&t!=null&&(this.note=new im({value:this.value,text:t,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}};var A_=class extends Q{constructor(e,t){super(t),this.value=e,this.aboveAxis=J(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=Bf()}initOptions(e){this.options=Object.assign({},e)}render(){let{markers:e}=this.options;this._rendered||(this._rendered=!0,e.visible&&e.size&&(this.marker=this.createMarker(),this.append(this.marker)),this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new em(this.getLabelText(e),Object.assign({},{align:S,vAlign:S,zIndex:J(e.zIndex,this.series.zIndex)},e,{margin:Object.assign({},{left:5,right:5},e.margin)}),this.pointData())}getLabelText(e){let t=Id(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}getAriaLabelText(){let e=this.options.labels,t=Ld(e);return t?t(this.pointData()):this.getLabelText(e)}markerBorder(){let e=this.options.markers,t=e.background,n=Object.assign({},{color:this.color},e.border);return n.color===void 0&&(n.color=new We(t).brightness(Xh).toHex()),n}createVisual(){}createMarker(){let e=this.options.markers;return new Up({type:e.type,width:e.size,height:e.size,rotation:e.rotation,background:e.background,border:this.markerBorder(),opacity:e.opacity,pattern:this.options.pattern,zIndex:J(e.zIndex,this.series.zIndex),animation:e.animation,visual:e.visual,accessibilityOptions:Object.assign({},{ariaLabel:this.getAriaLabelText(this.options.labels)},this.options.accessibility)},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})}markerBox(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box}reflow(e){let{options:t,aboveAxis:n}=this,r=t.vertical;this.render(),this.box=e;let i=e.clone();if(r?n?i.y1-=i.height():i.y2+=i.height():n?i.x1+=i.width():i.x2-=i.width(),this._childBox=i,this.marker&&this.marker.reflow(i),this.reflowLabel(i),this.errorBars)for(let e=0;e<this.errorBars.length;e++)this.errorBars[e].reflow(i);if(this.note){let e=this.markerBox();if(!(t.markers.visible&&t.markers.size)){let t=e.center();e=new Z(t.x,t.y,t.x,t.y)}this.note.reflow(e)}}reflowLabel(e){let{options:t,label:n}=this,r=t.labels.position;n&&(r=r===`above`?`top`:r,r=r===`below`?x:r,n.reflow(e),n.box.alignTo(this.markerBox(),r),n.reflow(n.box))}createHighlight(){let e=this.options.highlight.markers,t=this.markerBorder().color,n=this.options.markers,r=n.size+(n.border.width||0)+(e.border.width||0),i=new Up({type:n.type,width:r,height:r,rotation:n.rotation,background:e.color||t,border:{color:e.border.color,width:e.border.width,opacity:J(e.border.opacity,1)},opacity:J(e.opacity,1)});return i.reflow(this._childBox),i.getElement()}highlightVisual(){return(this.marker||{}).visual}highlightVisualArgs(){let e=this.marker,t,n;if(e)n=e.paddingBox.toRect(),t=e.visual;else{let e=this.options.markers.size,t=e/2,r=this.box.center();n=new N([r.x-t,r.y-t],[e,e])}return{options:this.options,rect:n,visual:t}}createFocusHighlight(){let e=this.options.markers,t=this.options.focusHighlight,n=e.size+(e.border.width||0),r=new Up({type:e.type,width:n,height:n,rotation:e.rotation,background:t.color,border:t.border,opacity:t.opacity,padding:t.border.width/2,zIndex:t.zIndex});return r.reflow(this._childBox),r.getElement()}tooltipAnchor(){let e=this.markerBox(),t=this.owner.pane.clipBox();if(!t||t.overlaps(e)){let t=e.x2+5,n,r;return this.aboveAxis?(n=e.y1,r=x):(n=e.y2,r=`top`),{point:new X(t,n),align:{horizontal:`left`,vertical:r}}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.markerBox().overlaps(e)}clipElements(){this.options.visible=!1}unclipElements(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)}unclipBox(){return E_(this.markerBox().clone(),[this.label,this.note])}labelBox(){return this.label?this.label.box:new Z}noteBox(){return this.note?this.note.box:new Z}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}focusVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0))}clearFocusFromVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set(`id`,``),this.toggleFocusHighlight(!1))}getIndex(){return this.categoryIx===void 0?this.pointIx:this.categoryIx}};A_.prototype.defaults={vertical:!0,markers:{visible:!0,background:k,size:8,type:C,border:{width:2},opacity:1},labels:{visible:!1,position:tg,margin:U(3),padding:U(4),animation:{type:Yh,delay:600}},notes:{label:{}},highlight:{markers:{border:{color:`#fff`,width:2}},zIndex:100},errorBars:{line:{width:1}},accessibility:{tabIndex:0,role:Xg,className:Zg,ariaRoleDescription:Qg}},H(A_.prototype,O_),H(A_.prototype,k_);var j_=class extends Q{constructor(e,t,n){super(),this.linePoints=e,this.series=t,this.seriesIx=n}points(){return this.toGeometryPoints(this.linePoints)}toGeometryPoints(e){let t=[];for(let n=0,r=e.length;n<r;n++)e[n]&&e[n].visible!==!1&&t.push(e[n]._childBox.toRect().center());return t}createVisual(){let e=this.series.visual;e?(this.visual=e({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:()=>(this.segmentVisual(),this.visual)}),this.visual&&!G(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()}segmentVisual(){let{options:e,series:t}=this,{color:n,_defaults:r}=t;Ed(n)&&r&&(n=r.color);let i=F.fromPoints(this.points(),{stroke:{color:n,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});e.closed&&i.close(),this.visual=i}aliasFor(e,t){return this.parent.getNearestPoint(t.x,t.y,this.seriesIx)}};Y(j_,{closed:!1});let M_={calculateStepPoints:function(e){let{justified:t,vertical:n,reverse:r}=this.parent.plotArea.seriesCategoryAxis(this.series).options,i=n?`x`:`y`,a=n?`y`:`x`,o=r?2:1,s=o,c=N_(e[0],i,o,a,s),l=[c];for(let t=1;t<e.length;t++){let n=N_(e[t],i,o,a,s);if(c[i]!==n[i]){let e=new M;e[i]=c[i],e[a]=n[a],l.push(e,n)}c=n}return t?c!==of(l)&&l.push(c):l.push(N_(of(e),i,o,a,r?1:2)),l}};function N_(e,t,n,r,i){let a=e.box,o=new M;return o[t]=a[t+n],o[r]=a[r+i],o}var P_=class extends j_{points(){return this.calculateStepPoints(this.linePoints)}};H(P_.prototype,M_);var F_=class extends j_{segmentVisual(){let e=this.series,t=e._defaults,n=e.color;Ed(n)&&t&&(n=t.color);let r=new Fh(this.options.closed).process(this.points()),i=new F({stroke:{color:n,width:e.width,opacity:e.opacity,dashType:e.dashType},zIndex:e.zIndex});i.segments.push.apply(i.segments,r),this.visual=i}};let I_={renderSegments:function(){let{options:e,seriesPoints:t}=this,n=e.series,r=t.length,i;this._segments=[];for(let e=0;e<r;e++){let r=n[e],a=this.sortPoints(t[e]),o=a.length,s=[];for(let t=0;t<o;t++){let n=a[t];n?s.push(n):this.seriesMissingValues(r)!==`interpolate`&&(s.length>1&&(i=this.createSegment(s,r,e,i),this._addSegment(i)),s=[])}s.length>1&&(i=this.createSegment(s,r,e,i),this._addSegment(i))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(e){this._segments.push(e),e.parent=this},hasSegmentForPoint(e,t){return this._segments.some(n=>{if(n.seriesIx!==e)return!1;let r=n.linePoints,i=r[0].categoryIx,a=r[r.length-1].categoryIx;return t>=i&&t<=a})},sortPoints:function(e){return e},seriesMissingValues:function(e){let t=e.missingValues;return!t&&this.options.isStacked?eg:t||`interpolate`},getNearestPoint:function(e,t,n){let r=new X(e,t),i=this.seriesPoints[n],a=D,o;for(let e=0;e<i.length;e++){let t=i[e];if(t&&t.value!==void 0&&t.value!==null&&t.visible!==!1){let e=t.box.center().distanceTo(r);e<a&&(o=t,a=e)}}return o}};var L_=class extends ta{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig[e.easing]||[],this._setEnd(e.box.x1)}step(e){let t=this.options.box;this._setEnd(Wd(t.x1,t.x2,e))}_setEnd(e){let t=this.element,n=t.segments,r=n[1].anchor(),i=n[2].anchor();t.suspend(),r.setX(e),t.resume(),i.setX(e)}};Y(L_,{motionConfig:{}}),Zi.current.register(`clip`,L_);let R_={createAnimation:function(){let e=this.getRoot(),t=(e&&e.options||{}).transitions;if(e&&t!==!1){let t=this.parent&&this.parent.clipBox||e.size(),n=F.fromRect(t.toRect());this.visual.clip(n),this.animation=new L_(n,{box:t}),o_(this.options.series)&&this._setChildrenAnimation(n)}},_setChildrenAnimation:function(e){let t=this.animationPoints();for(let n=0;n<t.length;n++){let r=t[n];r&&r.visual&&G(r.visual.options.zIndex)&&r.visual.clip(e)}}};var z_=class extends D_{render(){super.render(),this.updateStackRange(),this.renderSegments()}pointType(){return A_}createPoint(e,t){let{series:n,seriesIx:r}=t,i=this.seriesMissingValues(n),a=e.valueFields.value;if(a==null)if(i===`zero`)a=0;else return null;let o=this.pointOptions(n,r);o=this.evalPointOptions(o,a,t);let s=e.fields.color||n.color;Ed(n.color)&&(s=o.color);let c=new A_(a,o);return c.color=s,this.append(c),c}plotRange(e){let t=this.plotValue(e);if(this.options.isStacked){let n=e.categoryIx,r=this.categoryPoints[n];for(let n=0;n<r.length;n++){let i=r[n];if(e===i)break;t+=this.plotValue(i),this.options.isStacked100&&(t=Math.min(t,1))}}return[t,t]}createSegment(e,t,n){let r=t.style,i;return i=r===`step`?P_:r===`smooth`?F_:j_,new i(e,t,n)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t.concat(this._segments)}supportsPointInactiveOpacity(){return!1}};H(z_.prototype,I_,R_);var B_=class extends j_{constructor(e,t,n,r,i){super(e,t,n),this.prevSegment=r,this.stackPoints=i}createVisual(){let e=this.series,t=e._defaults,n=e.line||{},r=e.color;Ed(r)&&t&&(r=t.color),this.visual=new I({zIndex:e.zIndex}),this.createFill({fill:Bp(e.pattern,{color:r,opacity:e.opacity}),stroke:null}),n.width>0&&n.visible!==!1&&this.createStroke({stroke:H({color:r,opacity:e.opacity,lineCap:`butt`},n)})}strokeSegments(){let e=this._strokeSegments;return e||=this._strokeSegments=this.createStrokeSegments(),e}createStrokeSegments(){return this.segmentsFromPoints(this.points())}stackSegments(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)}createStackSegments(e){return this.segmentsFromPoints(this.toGeometryPoints(e)).reverse()}segmentsFromPoints(e){return e.map(e=>new fr(e))}createStroke(e){let t=new F(e);t.segments.push.apply(t.segments,this.strokeSegments()),this.visual.append(t)}hasStackSegment(){return this.prevSegment||this.stackPoints&&this.stackPoints.length}createFill(e){let t=this.strokeSegments(),n=t.slice(0),r=this.hasStackSegment();if(r){let e=this.stackSegments();Zd(n,e)}let i=new F(e);i.segments.push.apply(i.segments,n),!r&&t.length>1&&this.fillToAxes(i),this.visual.append(i)}fillToAxes(e){let t=this.parent,n=t.options.invertAxes,r=t.seriesValueAxis(this.series),i=t.categoryAxisCrossingValue(r),a=r.getSlot(i,i,!0),o=this.strokeSegments(),s=o[0].anchor(),c=of(o).anchor(),l=n?a.x1:a.y1;n?e.lineTo(l,c.y).lineTo(l,s.y):e.lineTo(c.x,l).lineTo(s.x,l)}},V_=class extends B_{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))}createStackSegments(e){return this.segmentsFromPoints(this.calculateStepPoints(e)).reverse()}};H(V_.prototype,M_);var H_=class extends B_{createStrokeSegments(){let e=new Fh(this.options.closed),t=this.points();return e.process(t)}},U_=class extends z_{createSegment(e,t,n,r){let i=this.options.isStacked,a=(t.line||{}).style,o,s;i&&n>0&&r&&(s=this._getStackPoints(e,n,a),o=r);let c;return c=a===`step`?V_:a===`smooth`?H_:B_,new c(e,t,n,o,s)}reflow(e){super.reflow(e);let t=this._stackPoints;if(t)for(let e=0;e<t.length;e++){let n=t[e],r=this.categoryAxis.getSlot(n.categoryIx);n.reflow(r)}}_getStackPoints(e,t,n){let r=this.seriesPoints,i=Math.max(-1,e[0].categoryIx),a=of(e).categoryIx+1,o=+!!this.seriesOptions[0]._outOfRangeMinPoint,s=[];this._stackPoints=this._stackPoints||[];for(let e=i;e<a;e++){let c=e,l=t,u,d=!1;do if(l--,u=r[l][c+o],!u&&this.hasSegmentForPoint(l,e)){d=!0;break}while(l>0&&!u);if(u)n!==`step`&&e>i&&(this.hasSegmentForPoint(l,c-1)||s.push(this._previousSegmentPoint(e,c,c-1,l))),s.push(u),n!==`step`&&e+1<a&&(this.hasSegmentForPoint(l,c+1)||s.push(this._previousSegmentPoint(e,c,c+1,l)));else if(!d){let t=this._createGapStackPoint(e);this._stackPoints.push(t),s.push(t)}}return s}_previousSegmentPoint(e,t,n,r){let i=this.seriesPoints,a=r,o;for(;a>0&&!o;)a--,o=i[a][n];return o?o=i[a][t]:(o=this._createGapStackPoint(e),this._stackPoints.push(o)),o}_createGapStackPoint(e){let t=new A_(0,this.pointOptions({},0));return t.categoryIx=e,t.series={},t}seriesMissingValues(e){return e.missingValues||`zero`}supportsPointInactiveOpacity(){return!1}},W_=class{constructor(){this.axisRanges={}}update(e){let t=this.axisRanges;for(let n in e){let r=e[n],i=t[n];t[n]=i||={min:D,max:ne},i.min=Math.min(i.min,r.min),i.max=Math.max(i.max,r.max)}}reset(e){this.axisRanges[e]=void 0}query(e){return this.axisRanges[e]}},G_=class extends Q{constructor(e,t,n){super(t),this.textBox=new em(e,this.options,n),this.append(this.textBox)}createVisual(){this.textBox.options.noclip=this.options.noclip}reflow(e){let t=this.options,{vertical:n,aboveAxis:r}=t,i=this.children[0],a=i.options,o=i.box,s=i.options.padding,c=e;if(a.align=n?S:E,a.vAlign=n?`top`:S,t.position===`insideEnd`)n?(a.vAlign=`top`,!r&&o.height()<e.height()&&(a.vAlign=x)):a.align=r?O:E;else if(t.position===`center`)a.vAlign=S,a.align=S;else if(t.position===`insideBase`)n?a.vAlign=r?x:`top`:a.align=r?E:O;else if(t.position===`outsideEnd`)if(n)if(r){let t=(o.width()-e.width()-s.left-s.right)/2;c=new Z(e.x1-t,e.y1-o.height(),e.x2+t,e.y1)}else c=new Z(e.x1,e.y2,e.x2,e.y2+o.height());else a.align=S,c=r?new Z(e.x2,e.y1,e.x2+o.width(),e.y2):new Z(e.x1-o.width(),e.y1,e.x1,e.y2);t.rotation||(n?s.left=s.right=(c.width()-i.contentBox.width())/2:s.top=s.bottom=(c.height()-i.contentBox.height())/2),i.reflow(c)}alignToClipBox(e){let t=this.options.vertical?`y`:`x`,n=t+`1`,r=t+`2`,i=this.children[0],a=this.parent.box;if(a[n]<e[n]||e[r]<a[r]){let t=i.paddingBox.clone();t[n]=Math.max(a[n],e[n]),t[r]=Math.min(a[r],e[r]),this.reflow(t)}}};Y(G_,{position:e_,margin:U(3),padding:U(4),color:b,background:``,border:{width:1,color:``},aboveAxis:!0,vertical:!1,animation:{type:Yh,delay:600},zIndex:2});let K_={addAccessibilityAttributesToVisual:function(){this._id=this._id||Vf();let e=Object.assign({},{ariaLabel:this.getAriaLabelText()},this.options.accessibility);Hp(this.visual,e)},getAriaLabelText(){let e=this.options.labels,t=Ld(e);return t?t(this.pointData()):this.getLabelText(e)},focusVisual(){this.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0)},clearFocusFromVisual(){this.visual.options.set(`id`,``),this.toggleFocusHighlight(!1)}};var q_=class extends Q{constructor(e,t){super(),this.options=t,this.color=t.color||`#fff`,this.aboveAxis=J(this.options.aboveAxis,!0),this.value=e}render(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new G_(this.getLabelText(e),H({vertical:this.options.vertical},e),this.pointData())}getLabelText(e){let t=Id(e);return t?t(this.pointData()):this.formatValue(e.format)}formatValue(e){return this.owner.formatPointValue(this,e)}reflow(e){this.render();let t=this.label;if(this.box=e,t&&(t.options.aboveAxis=this.aboveAxis,t.reflow(e)),this.note&&this.note.reflow(e),this.errorBars)for(let t=0;t<this.errorBars.length;t++)this.errorBars[t].reflow(e)}createVisual(){let{box:e,options:t}=this,n=t.visual;if(this.visible!==!1)if(super.createVisual(),this.addAccessibilityAttributesToVisual(),n){let r=this.rectVisual=n({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:e.toRect(),createVisual:()=>{let e=new I;return this.createRect(e),e},options:t});r&&this.visual.append(r)}else e.width()>0&&e.height()>0&&this.createRect(this.visual)}createRect(e){let t=this.options,n=t.border,r=G(n.opacity)?n.opacity:t.opacity,i=this.box.toRect();i.size.width=Math.round(i.size.width);let a=this.rectVisual=F.fromRect(i,{fill:Bp(t.pattern,{color:this.color,opacity:t.opacity}),stroke:{color:this.getBorderColor(),width:n.width,opacity:r,dashType:n.dashType}}),o=this.box.width(),s=this.box.height();if((t.vertical?o:s)>6&&(yd(a),(o<1||s<1)&&(a.options.stroke.lineJoin=`round`)),e.append(a),__(t)){let n=this.createGradientOverlay(a,{baseColor:this.color},H({end:t.vertical?void 0:[0,1]},t.overlay));e.append(n)}}createHighlight(e){return yd(F.fromRect(this.box.toRect(),e))}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width;return yd(F.fromRect(this.box.pad(t/2).toRect(),e))}getBorderColor(){let e=this.color,t=this.options.border,n=t._brightness||.8,r=t.color;return G(r)||(r=new We(e).brightness(n).toHex()),r}tooltipAnchor(){let{options:e,box:t,aboveAxis:n}=this,r=this.owner.pane.clipBox()||t,i=E,a=`top`,o,s;if(e.vertical)o=Math.min(t.x2,r.x2)+5,n?s=Math.max(t.y1,r.y1):(s=Math.min(t.y2,r.y2),a=x);else{let c=Math.max(t.x1,r.x1),l=Math.min(t.x2,r.x2);e.isStacked?(a=x,n?(i=O,o=l):o=c,s=Math.max(t.y1,r.y1)-5):(n?o=l+5:(o=c-5,i=O),s=Math.max(t.y1,r.y1))}return{point:new X(o,s),align:{horizontal:i,vertical:a}}}overlapsBox(e){return this.box.overlaps(e)}unclipBox(){let e=this.label&&this.label.textBox;return E_(this.box.clone(),[e,this.note])}labelBox(){let e=this.label&&this.label.textBox;return e?e.box:new Z}noteBox(){return this.note?this.note.box:new Z}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}}getIndex(){return this.categoryIx}};H(q_.prototype,O_),H(q_.prototype,k_),H(q_.prototype,K_),q_.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:`glass`},labels:{visible:!1,format:`{0}`},opacity:1,notes:{label:{}},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}};function J_(e,t){e.forEach(t)}function Y_(e,t){let n=e.length;for(let r=n-1;r>=0;r--)t(e[r],r-n-1)}var X_=class extends Q{constructor(e){super(e),this.forEach=e.rtl?Y_:J_}reflow(e){let{vertical:t,gap:n,spacing:r}=this.options,i=this.children,a=i.length,o=t?`y`:`x`,s=a+n+r*(a-1),c=(t?e.height():e.width())/s,l=e[o+1]+n/2*c;this.forEach(i,(t,n)=>{let i=(t.box||e).clone();i[o+1]=l,i[o+2]=l+c,t.reflow(i),n<a-1&&(l+=c*r),l+=c})}};Y(X_,{vertical:!1,gap:0,spacing:0});var Z_=class extends Q{reflow(e){let t=this.options.vertical?`x`:`y`,n=this.children,r=n.length,i=this.box=new Z;for(let a=0;a<r;a++){let r=n[a];if(r.visible!==!1){let n=r.box.clone();n.snapTo(e,t),a===0&&(i=this.box=n.clone()),r.reflow(n),i.wrap(n)}}}};Y(Z_,{vertical:!0});var Q_=class extends D_{render(){super.render(),this.updateStackRange()}pointType(){return q_}clusterType(){return X_}stackType(){return Z_}stackLimits(e,t){return super.stackLimits(e,t)}createPoint(e,t){let{categoryIx:n,series:r,seriesIx:i}=t,{options:a,children:o}=this,s=G(r.stack)?r.stack:a.defaultStack,c=this.pointValue(e),l=this.pointOptions(r,i),u=l.labels;s&&u.position===`outsideEnd`&&(u.position=`insideEnd`),l.isStacked=s;let d=e.fields.color||r.color;c<0&&l.negativeColor&&(d=l.negativeColor),l=this.evalPointOptions(l,c,t),Ed(r.color)&&(d=l.color);let f=new(this.pointType())(c,l);f.color=d;let p=o[n];return p||(p=new(this.clusterType())({vertical:a.invertAxes,gap:a.gap,spacing:a.spacing,rtl:!a.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),a.isStacked?this.getStackWrap(s,p).append(f):p.append(f),f}getStackWrap(e,t){let n=typeof e==`object`?e.group||!0:e,r=t.children,i;if(typeof n==`string`||n===!0){for(let e=0;e<r.length;e++)if(r[e]._stackGroup===n){i=r[e];break}}return i||(i=new(this.stackType())({vertical:!this.options.invertAxes}),i._stackGroup=n,t.append(i)),i}categorySlot(e,t,n){let r=this.options,i=e.getSlot(t),a=n.startValue();if(r.isStacked){let e=n.getSlot(a,a,!0),t=r.invertAxes?`x`:`y`;i[t+1]=i[t+2]=e[t+1]}return i}reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}createAnimation(){this._setAnimationOptions(),super.createAnimation(),o_(this.options.series)&&this._setChildrenAnimation()}_setChildrenAnimation(){let e=this.points;for(let t=0;t<e.length;t++){let n=e[t],r=n.visual;r&&G(r.options.zIndex)&&(n.options.animation=this.options.animation,n.createAnimation())}}_setAnimationOptions(){let e=this.options,t=e.animation||{},n;if(e.isStacked){let t=this.seriesValueAxis(e.series[0]);n=t.getSlot(t.startValue())}else n=this.categoryAxis.getSlot(0);t.origin=new M(n.x1,n.y1),t.vertical=!e.invertAxes}};Y(Q_,{animation:{type:`bar`}});var $_=class extends Q{constructor(e,t){super(t),this.value=e}getLabelText(e){return this.formatValue(e.format)}reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a=i.getSlot(n.open,n.close),o=i.getSlot(n.low,n.high);a.x1=o.x1=e.x1,a.x2=o.x2=e.x2,this.realBody=a;let s=o.center().x,c=[];c.push([[s,o.y1],[s,a.y1]]),c.push([[s,a.y2],[s,o.y2]]),this.lines=c,this.box=o.clone().wrap(a),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()}reflowNote(){this.note&&this.note.reflow(this.box)}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual(),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()}mainVisual(e){let t=new I;return this.createBody(t,e),this.createLines(t,e),t}createBody(e,t){let n=F.fromRect(this.realBody.toRect(),{fill:Bp(t.pattern,{color:this.color,opacity:t.opacity}),stroke:null});t.border.width>0&&n.options.set(`stroke`,{color:this.getBorderColor(t),width:t.border.width,dashType:t.border.dashType,opacity:J(t.border.opacity,t.opacity)}),yd(n),e.append(n),__(t)&&e.append(this.createGradientOverlay(n,{baseColor:this.color},H({end:t.vertical?void 0:[0,1]},t.overlay)))}createLines(e,t){this.drawLines(e,t,this.lines,t.line)}drawLines(e,t,n,r){if(!n)return;let i={stroke:{color:r.color||this.color,opacity:J(r.opacity,t.opacity),width:r.width,dashType:r.dashType,lineCap:`butt`}};for(let t=0;t<n.length;t++){let r=F.fromPoints(n[t],i);yd(r),e.append(r)}}getBorderColor(e){let t=e.border.color;return G(t)||(t=new We(this.color).brightness(this.options.border._brightness).toHex()),t}createOverlay(){let e=F.fromRect(this.box.toRect(),{fill:{color:k,opacity:0},stroke:null});this.visual.append(e)}createHighlight(){let e=this.options.highlight,t=this.color;this.color=e.color||this.color;let n=this.mainVisual(H({},this.options,{line:{color:this.getBorderColor(e)}},e));return this.color=t,n}highlightVisual(){return this._mainVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}}tooltipAnchor(){let e=this.box,t=this.owner.pane.clipBox()||e;return{point:new X(e.x2+5,Math.max(e.y1,t.y1)+5),align:{horizontal:E,vertical:`top`}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.box.overlaps(e)}pointData(){return{dataItem:this.dataItem,value:this.value,meanPoints:this.meanPoints,medianPoints:this.medianPoints,whiskerPoints:this.whiskerPoints,stackValue:this.stackValue,series:this.series}}getIndex(){return this.categoryIx}};$_.prototype.createFocusHighlight=q_.prototype.createFocusHighlight,Y($_,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:`glass`},tooltip:{format:`<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>`},labels:{format:``},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}}),H($_.prototype,O_),H($_.prototype,k_),H($_.prototype,K_);var ev=class extends D_{reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}addValue(e,t){let{categoryIx:n,category:r,series:i,seriesIx:a}=t,{children:o,options:s}=this,c=e.valueFields,l=c_(this.splitValue(c)),u=i.data[n],d=this.categoryPoints[n],f;d||(this.categoryPoints[n]=d=[]),l&&(f=this.createPoint(e,t));let p=o[n];p||(p=new X_({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),f&&(this.updateRange(c,t),p.append(f),f.categoryIx=n,f.category=r,f.series=i,f.seriesIx=a,f.owner=this,f.dataItem=u,f.noteText=e.fields.noteText),this.points.push(f),d.push(f)}pointType(){return $_}createPoint(e,t){let{series:n}=t,r=this.pointType(),i=e.valueFields,a=H({},n),o=e.fields.color||n.color;a=this.evalPointOptions(a,i,t),(n.type===`candlestick`||n.type===`ohlc`)&&i.open>i.close&&(o=e.fields.downColor||n.downColor||n.color),Ed(n.color)&&(o=a.color),a.vertical=!this.options.invertAxes;let s=new r(i,a);return s.color=o,s}splitValue(e){return[e.low,e.open,e.close,e.high]}updateRange(e,t){let n=t.series.axis,r=this.splitValue(e),i=this.valueAxisRanges[n]||{min:D,max:ne};this.valueAxisRanges[n]={min:Math.min.apply(Math,r.concat([i.min])),max:Math.max.apply(Math,r.concat([i.max]))}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.open,n.high,n.low,n.close,e.category)}animationPoints(){return this.points}};H(ev.prototype,R_);var tv=class extends $_{constructor(e,t){super(e,t),this.createNote()}reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a,o;this.boxSlot=o=i.getSlot(n.q1,n.q3),this.realBody=o,this.reflowBoxSlot(e),this.whiskerSlot=a=i.getSlot(n.lower,n.upper),this.reflowWhiskerSlot(e);let s=i.getSlot(n.median);if(n.mean){let t=i.getSlot(n.mean);this.meanPoints=this.calcMeanPoints(e,t)}this.whiskerPoints=this.calcWhiskerPoints(o,a),this.medianPoints=this.calcMedianPoints(e,s),this.box=a.clone().wrap(o),this.reflowNote()}reflowBoxSlot(e){this.boxSlot.x1=e.x1,this.boxSlot.x2=e.x2}reflowWhiskerSlot(e){this.whiskerSlot.x1=e.x1,this.whiskerSlot.x2=e.x2}calcMeanPoints(e,t){return[[[e.x1,t.y1],[e.x2,t.y1]]]}calcWhiskerPoints(e,t){let n=t.center().x;return[[[n-5,t.y1],[n+5,t.y1],[n,t.y1],[n,e.y1]],[[n-5,t.y2],[n+5,t.y2],[n,t.y2],[n,e.y2]]]}calcMedianPoints(e,t){return[[[e.x1,t.y1],[e.x2,t.y1]]]}renderOutliers(e){let t=this.value,n=t.outliers||[],r=Math.abs(t.q3-t.q1)*3,i=[],a=e.markers||{};for(let o=0;o<n.length;o++){let s=n[o];a=s<t.q3+r&&s>t.q1-r?e.outliers:e.extremes;let c=H({},a.border);G(c.color)||(G(this.color)?c.color=this.color:c.color=new We(a.background).brightness(Xh).toHex());let l=new Up({type:a.type,width:a.size,height:a.size,rotation:a.rotation,background:a.background,border:c,opacity:a.opacity});l.value=s,i.push(l)}return this.reflowOutliers(i),i}reflowOutliers(e){let t=this.owner.seriesValueAxis(this.options),n=this.box.center();for(let r=0;r<e.length;r++){let i=e[r].value,a=t.getSlot(i);this.options.vertical?a.move(n.x):a.move(void 0,n.y),this.box=this.box.wrap(a),e[r].reflow(a)}}mainVisual(e){let t=super.mainVisual(e),n=this.renderOutliers(e);for(let e=0;e<n.length;e++){let r=n[e].getElement();r&&t.append(r)}return t}createLines(e,t){this.drawLines(e,t,this.whiskerPoints,t.whiskers),this.drawLines(e,t,this.medianPoints,t.median),this.drawLines(e,t,this.meanPoints,t.mean)}getBorderColor(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:super.getBorderColor()}};Y(tv,{border:{_brightness:.8},line:{width:2},median:{color:`#f6f6f6`},mean:{width:2,dashType:`dash`,color:`#f6f6f6`},overlay:{gradient:`glass`},tooltip:{format:`<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>`},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:`cross`,background:k,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:C,background:k,border:{width:2,opacity:1},opacity:0}}),H(tv.prototype,O_);var nv=class extends tv{reflowBoxSlot(e){this.boxSlot.y1=e.y1,this.boxSlot.y2=e.y2}reflowWhiskerSlot(e){this.whiskerSlot.y1=e.y1,this.whiskerSlot.y2=e.y2}calcMeanPoints(e,t){return[[[t.x1,e.y1],[t.x1,e.y2]]]}calcWhiskerPoints(e,t){let n=t.center().y;return[[[t.x1,n-5],[t.x1,n+5],[t.x1,n],[e.x1,n]],[[t.x2,n-5],[t.x2,n+5],[t.x2,n],[e.x2,n]]]}calcMedianPoints(e,t){return[[[t.x1,e.y1],[t.x1,e.y2]]]}},rv=class extends ev{addValue(e,t){let{categoryIx:n,category:r,series:i,seriesIx:a}=t,{children:o,options:s}=this,c=e.valueFields,l=c_(this.splitValue(c)),u=i.data[n],d=this.categoryPoints[n],f;d||(this.categoryPoints[n]=d=[]),l&&(f=this.createPoint(e,t));let p=o[n];p||(p=new X_({vertical:s.invertAxes,gap:s.gap,spacing:s.spacing,rtl:!s.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),f&&(this.updateRange(c,t),p.append(f),f.categoryIx=n,f.category=r,f.series=i,f.seriesIx=a,f.owner=this,f.dataItem=u),this.points.push(f),d.push(f)}pointType(){return this.options.invertAxes?nv:tv}splitValue(e){return[e.lower,e.q1,e.median,e.q3,e.upper]}updateRange(e,t){let n=t.series.axis,r=this.splitValue(e).concat(this.filterOutliers(e.outliers));G(e.mean)&&(r=r.concat(e.mean));let i=this.valueAxisRanges[n]||{min:D,max:ne};this.valueAxisRanges[n]={min:Math.min.apply(Math,r.concat([i.min])),max:Math.max.apply(Math,r.concat([i.max]))}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.lower,n.q1,n.median,n.q3,n.upper,n.mean,e.category)}filterOutliers(e){let t=(e||[]).length,n=[];for(let r=0;r<t;r++){let t=e[r];G(t)&&t!==null&&n.push(t)}return n}supportsPointInactiveOpacity(){return!1}},iv=class extends i_{getAxis(){let e=this.chart.seriesAxes(this.series);return this.isVertical?e.y:e.x}},av=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}_initFields(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]}render(){this.traverseDataPoints(this.addValue.bind(this))}addErrorBar(e,t,n){let r=e.value[t],i=t+`Value`,a=t+`ErrorLow`,o=t+`ErrorHigh`,{seriesIx:s,series:c}=n,l=e.options.errorBars,u=n[a],d=n[o];if(V(r)){let n;V(u)&&V(d)&&(n={low:u,high:d}),l&&G(l[i])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[t][s]=this.seriesErrorRanges[t][s]||new qh(l[i],c,t),n=this.seriesErrorRanges[t][s].getErrorRange(r,l[i])),n&&this.addPointErrorBar(n,e,t)}}addPointErrorBar(e,t,n){let{low:r,high:i}=e,{series:a,options:{errorBars:o}}=t,s=n===`y`,c={};t[n+`Low`]=r,t[n+`High`]=i,t.errorBars=t.errorBars||[];let l=new iv(r,i,s,this,a,o);t.errorBars.push(l),t.append(l),c[n]=r,this.updateRange(c,a),c[n]=i,this.updateRange(c,a)}addValue(e,t){let{x:n,y:r}=e,i=t.seriesIx,a=this.options.series[i],o=this.seriesMissingValues(a),s=this.seriesPoints[i],c=e;v_(n)&&v_(r)||(c=this.createMissingValue(c,o));let l;c&&(l=this.createPoint(c,t),l&&(Object.assign(l,t),this.addErrorBar(l,`x`,t),this.addErrorBar(l,`y`,t)),this.updateRange(c,t.series)),this.points.push(l),s.push(l)}seriesMissingValues(e){return e.missingValues}createMissingValue(){}updateRange(e,t){let n=this.chartService.intl,{xAxis:r,yAxis:i}=t,{x:a,y:o}=e,s=this.xAxisRanges[r],c=this.yAxisRanges[i];v_(a)&&(s=this.xAxisRanges[r]=s||{min:D,max:ne},xd(a)&&(a=Um(n,a)),s.min=Math.min(s.min,a),s.max=Math.max(s.max,a)),v_(o)&&(c=this.yAxisRanges[i]=c||{min:D,max:ne},xd(o)&&(o=Um(n,o)),c.min=Math.min(c.min,o),c.max=Math.max(c.max,o))}evalPointOptions(e,t,n){let{series:r,seriesIx:i}=n,a={defaults:r._defaults,excluded:[`data`,`tooltip`,`content`,`template`,`visual`,`toggle`,`_outOfRangeMinPoint`,`_outOfRangeMaxPoint`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},o=this._evalSeries[i];G(o)||(this._evalSeries[i]=o=p_(e,{},a,!0));let s=e;return o&&(s=H({},e),p_(s,{value:t,series:r,dataItem:n.dataItem},a)),s}pointType(){return A_}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=H({},r,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)}return n}createPoint(e,t){let n=t.series,r=this.pointOptions(n,t.seriesIx),i=t.color||n.color;r=this.evalPointOptions(r,e,t),Ed(n.color)&&(i=r.color);let a=new A_(e,r);return a.color=i,this.append(a),a}seriesAxes(e){let{xAxis:t,yAxis:n}=e,r=this.plotArea,i=t?r.namedXAxes[t]:r.axisX,a=n?r.namedYAxes[n]:r.axisY;if(!i)throw Error(`Unable to locate X axis with name `+t);if(!a)throw Error(`Unable to locate Y axis with name `+n);return{x:i,y:a}}reflow(e){let t=this.points,n=!this.options.clip,r=0;this.traverseDataPoints((e,i)=>{let a=t[r++],o=this.seriesAxes(i.series),s=o.x.getSlot(e.x,e.x,n),c=o.y.getSlot(e.y,e.y,n);if(a)if(s&&c){let e=this.pointSlot(s,c);a.reflow(e)}else a.visible=!1}),this.box=e}pointSlot(e,t){return new Z(e.x1,t.y1,e.x2,t.y2)}traverseDataPoints(e){let{options:{series:t},seriesPoints:n}=this;for(let r=0;r<t.length;r++){let i=t[r];n[r]||(n[r]=[]);for(let t=0;t<i.data.length;t++){let{valueFields:n,fields:a}=this.plotArea.bindPoint(i,t);e(n,H({pointIx:t,series:i,seriesIx:r,dataItem:i.data[t],owner:this},a))}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t}};Y(av,{series:[],tooltip:{format:`{0}, {1}`},labels:{format:`{0}, {1}`},clip:!0}),H(av.prototype,R_);var ov=class extends A_{constructor(e,t){super(e,t),this.category=e.category}createHighlight(){let e=this.options.highlight,t=e.border,n=this.options.markers,r=this.box.center(),i=(n.size+n.border.width+t.width)/2,a=new I,o=new Rn(new jn([r.x,r.y+i/5+t.width/2],i+t.width/2),{stroke:{color:`none`},fill:this.createGradient({gradient:`bubbleShadow`,color:n.background,stops:[{offset:0,color:n.background,opacity:.3},{offset:1,color:n.background,opacity:0}]})}),s=new Rn(new jn([r.x,r.y],i),{stroke:{color:t.color||new We(n.background).brightness(.8).toHex(),width:t.width,opacity:t.opacity,dashType:t.dashType},fill:Bp(this.options.pattern,{color:n.background,opacity:e.opacity})});return a.append(o,s),a}createFocusHighlight(e){let t=this.options.focusHighlight,n=this.options.markers,r=this.box.center(),i=(n.size+n.border.width)/2+t.border.width/2;return new Rn(new jn([r.x,r.y],i),e)}};ov.prototype.defaults=H({},ov.prototype.defaults,{labels:{position:S},highlight:{opacity:1,border:{color:`#fff`,width:2,opacity:1}}}),ov.prototype.defaults.highlight.zIndex=void 0;var sv=class extends av{_initFields(){this._maxSize=ne,super._initFields()}addValue(e,t){e.size!==null&&(e.size>0||e.size<0&&t.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(e.size)),super.addValue(e,t)):(this.points.push(null),this.seriesPoints[t.seriesIx].push(null))}reflow(e){this.updateBubblesSize(e),super.reflow(e)}pointType(){return ov}createPoint(e,t){let n=t.series,r=n.data.length,i=(this.chartService.chart?this.chartService.chart.options.motion:{steady:600}).steady,a=t.pointIx*(i/r),o={delay:a,duration:i-a,type:ag},s=t.color||n.color;e.size<0&&n.negativeValues.visible&&(s=J(n.negativeValues.color,s));let c=H({labels:{animation:{delay:a,duration:i-a}}},this.pointOptions(n,t.seriesIx),{markers:{type:C,border:n.border,opacity:n.opacity,animation:o}});c=this.evalPointOptions(c,e,t),Ed(n.color)&&(s=c.color),c.markers.background=s;let l=new ov(e,c);return l.color=s,this.append(l),l}updateBubblesSize(e){let{options:{series:t}}=this,n=Math.min(e.width(),e.height());for(let e=0;e<t.length;e++){let r=t[e],i=this.seriesPoints[e],a=r.minSize||Math.max(n*.02,10),o=r.maxSize||n*.2,s=a/2,c=o/2,l=Math.PI*s*s,u=(Math.PI*c*c-l)/this._maxSize;for(let e=0;e<i.length;e++){let t=i[e];if(t){let e=Math.abs(t.value.size)*u,n=Math.sqrt((l+e)/Math.PI),r=J(t.options.zIndex,0)+(1-n/c);H(t.options,{zIndex:r,markers:{size:n*2,zIndex:r},labels:{zIndex:r+1}})}}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y,n.size,e.category)}createAnimation(){}createVisual(){}};Y(sv,{tooltip:{format:`{3}`},labels:{format:`{3}`}});var cv=class extends Up{};H(cv.prototype,O_);var lv=class extends Q{constructor(e,t){super(t),this.aboveAxis=this.options.aboveAxis,this.color=t.color||`#fff`,this.value=e}render(){let e=this.options;this._rendered||(this._rendered=!0,G(this.value.target)&&(this.target=new cv({type:e.target.shape,background:e.target.color||this.color,opacity:e.opacity,zIndex:e.zIndex,border:e.target.border,vAlign:`top`,align:O}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createLabel(),this.createNote())}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){return new G_(this.getLabelText(e),e,this.pointData())}getLabelText(e){let t=Id(e);return t?t(this.pointData()):this.formatValue(e.format)}reflow(e){this.render();let{options:t,target:n,owner:r}=this,i=t.invertAxes,a=r.seriesValueAxis(this.options),o=r.categorySlot(r.categoryAxis,t.categoryIx,a),s=a.getSlot(this.value.target),c=i?s:o,l=i?o:s;if(n){let e=new Z(c.x1,l.y1,c.x2,l.y2);n.options.height=i?e.height():t.target.line.width,n.options.width=i?t.target.line.width:e.width(),n.reflow(e)}let u=this.label;u&&(u.options.aboveAxis=this.aboveAxis,u.reflow(e)),this.note&&this.note.reflow(e),this.box=e}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual();let e=this.options,t=F.fromRect(this.box.toRect(),{fill:Bp(e.pattern,{color:this.color,opacity:e.opacity}),stroke:null});e.border.width>0&&t.options.set(`stroke`,{color:e.border.color||this.color,width:e.border.width,dashType:e.border.dashType,opacity:J(e.border.opacity,e.opacity)}),this.bodyVisual=t,yd(t),this.visual.append(t)}createAnimation(){this.bodyVisual&&(this.animation=ta.create(this.bodyVisual,this.options.animation))}createHighlight(e){return F.fromRect(this.box.toRect(),e)}highlightVisual(){return this.bodyVisual}highlightVisualArgs(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}}formatValue(e){return this.owner.formatPointValue(this,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series}}overlapsBox(e){return this.box.overlaps(e)}getIndex(){return this.categoryIx}};lv.prototype.tooltipAnchor=q_.prototype.tooltipAnchor,lv.prototype.createFocusHighlight=q_.prototype.createFocusHighlight,Y(lv,{border:{width:1},vertical:!1,opacity:1,target:{shape:``,border:{width:0,color:`green`},line:{width:2}},labels:{visible:!1},tooltip:{format:`Current: {0}<br />Target: {1}`},notes:{label:{}},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}}),H(lv.prototype,O_),H(lv.prototype,k_),H(lv.prototype,K_);var uv=class extends D_{constructor(e,t){dv(t),super(e,t)}reflowCategories(e){let t=this.children,n=t.length;for(let r=0;r<n;r++)t[r].reflow(e[r])}plotRange(e){let t=e.series,n=this.seriesValueAxis(t),r=this.categoryAxisCrossingValue(n);return[r,e.value.current||r]}createPoint(e,t){let{categoryIx:n,series:r}=t,{options:i,children:a}=this,o=e.valueFields,s=H({vertical:!i.invertAxes,overlay:r.overlay,categoryIx:n,invertAxes:i.invertAxes},r),c=e.fields.color||r.color;s=this.evalPointOptions(s,o,t),Ed(r.color)&&(c=s.color);let l=new lv(o,s);l.color=c;let u=a[n];return u||(u=new X_({vertical:i.invertAxes,gap:i.gap,spacing:i.spacing,rtl:!i.invertAxes&&(this.chartService||{}).rtl}),this.append(u)),u.append(l),l}updateRange(e,t){let{current:n,target:r}=e,i=t.series.axis,a=this.valueAxisRanges[i];G(n)&&!isNaN(n)&&G(r&&!isNaN(r))&&(a=this.valueAxisRanges[i]=a||{min:D,max:ne},a.min=Math.min(a.min,n,r),a.max=Math.max(a.max,n,r))}formatPointValue(e,t){return this.chartService.format.auto(t,e.value.current,e.value.target)}pointValue(e){return e.valueFields.current}aboveAxis(e){return e.value.current>0}createAnimation(){let e=this.points;this._setAnimationOptions();for(let t=0;t<e.length;t++){let n=e[t];n.options.animation=this.options.animation,n.createAnimation()}}};uv.prototype._setAnimationOptions=Q_.prototype._setAnimationOptions,Y(uv,{animation:{type:`bar`}});function dv(e){let t=e.series;for(let e=0;e<t.length;e++){let n=t[e],r=n.data;r&&!j(r[0])&&!kd(r[0])&&(n.data=[r])}}var fv=class{constructor(e,t){this.chartService=e,this.options=H({},this.options,t)}getStyle(e,t){let{background:n,border:{color:r}}=e;if(t){let e=t.color||t.options.color;n=J(n,e),r=J(r,e)}let i=e.padding===void 0?{}:U(e.padding);return typeof e.padding==`object`&&(i.top=e.padding.top===void 0?void 0:i.top,i.right=e.padding.right===void 0?void 0:i.right,i.bottom=e.padding.bottom===void 0?void 0:i.bottom,i.left=e.padding.left===void 0?void 0:i.left),{backgroundColor:n,borderColor:r,font:e.font,color:e.color,opacity:e.opacity,borderWidth:Ad(e.border.width),paddingTop:Ad(i.top),paddingBottom:Ad(i.bottom),paddingLeft:Ad(i.left),paddingRight:Ad(i.right)}}show(e,t,n){if(!this.chartService)return;e.format=t.format;let r=this.getStyle(t,n);e.style=r;let i=new We(r.backgroundColor);!G(t.color)&&!i.isDark()&&(e.className=`k-chart-tooltip-inverse`),this.chartService.notify(`showTooltip`,e),this.visible=!0}hide(){this.chartService&&this.chartService.notify(Yg),this.visible=!1}destroy(){delete this.chartService}};Y(fv,{border:{width:1},opacity:1});var pv=class extends fv{constructor(e,t,n){super(e,n),this.crosshair=t,this.formatService=e.format,this.initAxisName()}initAxisName(){let e=this.crosshair.axis,t=e.plotArea,n;n=t.categoryAxis?e.getCategory?`categoryAxis`:`valueAxis`:e.options.vertical?`yAxis`:`xAxis`,this.axisName=n}showAt(e){let{crosshair:{axis:t},options:n}=this,r=t[n.stickyMode?`getCategory`:`getValue`](e),i=r;n.format?i=this.formatService.auto(n.format,r):t.options.type===`date`&&(i=this.formatService.auto(t.options.labels.dateFormats[t.options.baseUnit],r)),this.show({point:e,anchor:this.getAnchor(),crosshair:this.crosshair,value:i,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)}hide(){this.chartService.notify(Yg,{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})}getAnchor(){let{crosshair:e,options:{position:t,padding:n}}=this,r=!e.axis.options.vertical,i=e.line.bbox(),a,o,s;return r?(a=S,t===`bottom`?(o=`top`,s=i.bottomLeft().translate(0,n)):(o=x,s=i.topLeft().translate(0,-n))):(o=S,t===`left`?(a=O,s=i.topLeft().translate(-n,0)):(a=E,s=i.topRight().translate(n,0))),{point:s,align:{horizontal:a,vertical:o}}}};Y(pv,{padding:10});var mv=class extends Q{constructor(e,t,n){super(n),this.axis=t,this.stickyMode=t instanceof Jm;let r=this.options.tooltip;r.visible&&(this.tooltip=new pv(e,this,H({},r,{stickyMode:this.stickyMode})))}showAt(e){this.point=e,this.moveLine(),this.line.visible(!0),this.tooltip&&this.tooltip.showAt(e)}hide(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()}moveLine(){let{axis:e,point:t}=this,n=e.options.vertical,r=this.getBox(),i=n?`y`:`x`,a=new M(r.x1,r.y1),o;if(o=n?new M(r.x2,r.y1):new M(r.x1,r.y2),t)if(this.stickyMode){let n=e.getSlot(e.pointCategoryIndex(t));a[i]=o[i]=n.center()[i]}else a[i]=o[i]=t[i];this.box=r,this.line.moveTo(a).lineTo(o)}getBox(){let e=this.axis,t=e.pane.axes,n=t.length,r=e.options.vertical,i=e.lineBox().clone(),a=r?`x`:`y`,o;for(let e=0;e<n;e++){let n=t[e];n.options.vertical!==r&&(o?o.wrap(n.lineBox()):o=n.lineBox().clone())}return i[a+1]=o[a+1],i[a+2]=o[a+2],i}createVisual(){super.createVisual();let e=this.options;this.line=new F({stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)}destroy(){this.tooltip&&this.tooltip.destroy(),super.destroy()}};Y(mv,{color:b,width:2,zIndex:-1,tooltip:{visible:!1}});var hv=class extends Q{constructor(e,t){super(e),this.pane=t}shouldClip(){let e=this.children,t=e.length;for(let n=0;n<t;n++)if(e[n].options.clip===!0)return!0;return!1}_clipBox(){return this.pane.chartsBox()}createVisual(){if(this.visual=new I({zIndex:0}),this.shouldClip()){let e=(this.clipBox=this._clipBox()).toRect(),t=F.fromRect(e);yd(t),this.visual.clip(t),this.unclipLabels()}}stackRoot(){return this}unclipLabels(){let{children:e,clipBox:t}=this;for(let n=0;n<e.length;n++){let r=e[n].points||[],i=r.length;for(let e=0;e<i;e++){let n=r[e];if(n&&n.visible!==!1&&n.overlapsBox&&n.overlapsBox(t))if(n.unclipElements)n.unclipElements();else{let{label:e,note:r}=n;e&&e.options.visible&&(e.alignToClipBox&&e.alignToClipBox(t),e.options.noclip=!0),r&&r.options.visible&&(r.options.noclip=!0)}}}}unclipBox(){let{children:e}=this,t=this._clipBox(),n=t.clone();for(let r=0;r<e.length;r++){if(e[r].options.clip===!1)continue;let i=e[r].points||[],a=i.length;for(let e=0;e<a;e++){let r=i[e];if(r&&r.unclipBox&&r.overlapsBox&&r.visible!==!1){if(!r.overlapsBox(t)){r.clipElements&&r.clipElements();continue}let e=r.unclipBox();if(n.overlaps(e)){let t=r.labelBox?r.labelBox():new Z,i=r.noteBox?r.noteBox():new Z,a=Math.max(t.height(),i.height()),o=Math.max(t.width(),i.width());n.wrapLimit(e,o,a)}}}}return n}destroy(){super.destroy(),delete this.parent}};hv.prototype.isStackRoot=!0;var gv=class e extends Vp{constructor(e){super(e),this.id=vv(),this.createTitle(),this.content=new Q,this.chartContainer=new hv({},this),this.append(this.content),this.axes=[],this.charts=[]}createTitle(){let t=this.options.title;kd(t)&&(t=H({},t,{align:t.position,position:`top`})),this.title=tm.buildTitle(t,e.prototype.options.title),this.title&&this.append(this.title)}appendAxis(e){this.content.append(e),this.axes.push(e),e.pane=this}appendAxisAt(e,t){this.content.append(e),this.axes.splice(t,0,e),e.pane=this}appendChart(e){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer),this.charts.push(e),this.chartContainer.append(e),e.pane=this}empty(){let e=this.parent;if(e){for(let t=0;t<this.axes.length;t++)e.removeAxis(this.axes[t]);for(let t=0;t<this.charts.length;t++)e.removeChart(this.charts[t])}this.axes=[],this.charts=[],this.content.destroy(),this.content.children=[],this.chartContainer.children=[]}reflow(e){let t;of(this.children)===this.content&&(t=this.children.pop()),super.reflow(e),t&&this.children.push(t),this.title&&(this.contentBox.y1+=this.title.box.height())}unclipBox(){return this.chartContainer.unclipBox()}visualStyle(){let e=super.visualStyle();return e.zIndex=-10,e}renderComplete(){this.options.visible&&this.createGridLines()}stackRoot(){return this}clipRoot(){return this}createGridLines(){let e=this.axes,t=e.concat(this.parent.axes),n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a.options.vertical,s=o?n:r;for(let e=0;e<t.length;e++)if(s.length===0){let n=t[e];o!==n.options.vertical&&Zd(s,a.createGridLines(n))}}}refresh(){this.visual.clear(),this.content.parent=null,this.content.createGradient=this.createGradient.bind(this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete(),this.notifyRender()}chartsBox(){let e=this.axes,t=e.length,n=new Z;for(let r=0;r<t;r++){let t=e[r],i=t.options.vertical?`y`:`x`,a=t.lineBox();n[i+1]=a[i+1],n[i+2]=a[i+2]}if(n.x2===0){let e=this.parent.axes,t=e.length;for(let r=0;r<t;r++){let t=e[r];if(!t.options.vertical){let e=t.lineBox();n.x1=e.x1,n.x2=e.x2}}}return n}clipBox(){return this.chartContainer.clipBox}notifyRender(){let e=this.getService();e&&e.notify(`paneRender`,{pane:new zh(this),index:this.paneIndex,name:this.options.name})}};let _v=1;function vv(){return`pane`+_v++}gv.prototype.isStackRoot=!0,Y(gv,{zIndex:-1,shrinkToFit:!0,title:{align:E},visible:!0});let yv=e=>e.options.visible!==!1;var bv=class extends Q{constructor(e,t,n){super(t),this.initFields(e,t),this.series=e,this.initSeries(),this.charts=[],this.options.legend=this.options.legend||{},this.options.legend.data=[],this.axes=[],this.crosshairs=[],this.chartService=n,this.originalOptions=t,this.originalSeries=e,this._bindCache=new WeakMap,this.createPanes(),this.render(),this.createCrosshairs()}initFields(){}initSeries(){let e=this.series;for(let t=0;t<e.length;t++)e[t].index=t}bindPoint(e,t,n){let r=this._bindCache.get(e);r||(r=[],this._bindCache.set(e,r));let i=r[t];return i||=r[t]=Wh.current.bindPoint(e,t,n),i}createPanes(){let e=this.options.title||{},t=this.options.paneDefaults,n=this.options.panes||[],r=Math.max(n.length,1),i=[],a=H({title:{color:e.color}},t);for(let e=0;e<r;e++){let t=H({},a,n[e]);xd(t.title)&&(t.title=H({text:t.title},a.title));let r=new gv(t);r.paneIndex=e,i.push(r),this.append(r)}this.panes=i}crosshairOptions(e){return e.options.crosshair}createCrosshairs(e=this.panes){for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.axes.length;e++){let t=n.axes[e],r=this.crosshairOptions(t);if(r&&r.visible){let e=new mv(this.chartService,t,r);this.crosshairs.push(e),n.content.append(e)}}}}removeCrosshairs(e){let t=this.crosshairs,n=e.axes;for(let e=t.length-1;e>=0;e--)for(let r=0;r<n.length;r++)if(t[e].axis===n[r]){t.splice(e,1);break}}hideCrosshairs(){let e=this.crosshairs;for(let t=0;t<e.length;t++)e[t].hide()}findPane(e){let t=this.panes,n;for(let r=0;r<t.length;r++)if(t[r].options.name===e){n=t[r];break}return n||t[0]}findPointPane(e){let t=this.panes,n;for(let r=0;r<t.length;r++)if(t[r].box.containsPoint(e)){n=t[r];break}return n}appendAxis(e){this.findPane(e.options.pane).appendAxis(e),this.axes.push(e),e.plotArea=this}removeAxis(e){let t=[];for(let n=0;n<this.axes.length;n++){let r=this.axes[n];e===r?r.destroy():t.push(r)}this.axes=t}appendChart(e,t){this.charts.push(e),t?t.appendChart(e):this.append(e)}removeChart(e){let t=[];for(let n=0;n<this.charts.length;n++){let r=this.charts[n];r===e?r.destroy():t.push(r)}this.charts=t}addToLegend(e){let t=e.length,n=this.options.legend,r=n.labels||{},i=n.inactiveItems||{},a=i.labels||{},o=[];for(let n=0;n<t;n++){let t=e[n],s=t.visible!==!1;if(t.visibleInLegend===!1)continue;let c=t.name,l=s?Id(r):Id(a)||Id(r);l&&(c=l({text:v_(c)?c:``,series:t}));let u=t._defaults,d=t.color;Ed(d)&&u&&(d=u.color);let f,p;s?(f={},p=d):(f={color:a.color,font:a.font},p=i.markers.color),v_(c)&&c!==``&&o.push({text:c,labels:f,markerColor:p,series:t,active:s})}Zd(n.data,o)}groupAxes(e){let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r].axes;for(let e=0;e<i.length;e++){let r=i[e];r.options.vertical?n.push(r):t.push(r)}}return{x:t,y:n,any:t.concat(n)}}groupSeriesByPane(){let e=this.series,t={};for(let n=0;n<e.length;n++){let r=e[n],i=this.seriesPaneName(r);t[i]?t[i].push(r):t[i]=[r]}return t}filterVisibleSeries(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r.visible!==!1&&t.push(r)}return t}reflow(e){let t=this.options.plotArea,n=this.panes,r=U(t.margin);this.box=e.clone().unpad(r),this.reflowArea(n),this.ensureLabelsFit(n)&&(this.reflowPanes(),this.reflowAxes(n),this.reflowCharts(n))}reflowArea(e){this.reflowPanes(),this.detachLabels(),this.reflowAxes(e),this.reflowCharts(e)}ensureLabelsFit(e){let t=!1;return e.forEach(e=>{let n=e.unclipBox(),r=e.chartContainer._clipBox(),i=U(e.options.padding||{}),a=r.width()+i.left+i.right,o=r.height()+i.top+i.bottom,s=.2,c=!1;if(n.y1<r.y1-i.top){let e=r.y1-n.y1;e<=o*s&&e>i.top&&(c=!0,i.top=e)}if(n.y2>r.y2+i.bottom){let e=n.y2-r.y2;e<=o*s&&e>i.bottom&&(c=!0,i.bottom=e)}if(n.x1<r.x1-i.left){let e=r.x1-n.x1;e<=a*s&&e>i.left&&(c=!0,i.left=e)}if(n.x2>r.x2+i.right){let e=n.x2-r.x2;e<=a*s&&e>i.right&&(c=!0,i.right=e)}c&&(t=!0,e.options.padding=i)}),t}redraw(e){let t=[].concat(e);this.initSeries();let n=this.getRoot();n&&n.cleanGradients();for(let e=0;e<t.length;e++)this.removeCrosshairs(t[e]),t[e].empty();this._bindCache=new WeakMap,this.render(t),this.detachLabels(),this.reflowAxes(this.panes),this.reflowCharts(t),this.createCrosshairs(t);for(let e=0;e<t.length;e++)t[e].refresh()}axisCrossingValues(e,t){let n=e.options,r=[].concat(n.axisCrossingValues||n.axisCrossingValue),i=t.length-r.length,a=r[0]||0;for(let e=0;e<i;e++)r.push(a);return r}alignAxisTo(e,t,n,r){let i=e.getSlot(n,n,!0),a=e.options.reverse?2:1,o=t.getSlot(r,r,!0),s=t.options.reverse?2:1,c=e.box.translate(o[`x`+s]-i[`x`+a],o[`y`+s]-i[`y`+a]);e.pane!==t.pane&&c.translate(0,e.pane.box.y1-t.pane.box.y1),e.reflow(c)}alignAxes(e,t){let n=e[0],r=t[0],i=this.axisCrossingValues(n,t),a=this.axisCrossingValues(r,e),o={},s={},c={},l={};for(let c=0;c<t.length;c++){let l=t[c],u=l.pane,d=u.id,f=l.options.visible!==!1,p=Cv(e,u)||n,m=i;if(p!==n&&(m=this.axisCrossingValues(p,t)),this.alignAxisTo(l,p,a[c],m[c]),l.options._overlap)continue;q(l.lineBox().x1)===q(p.lineBox().x1)&&(o[d]&&l.reflow(l.box.alignTo(o[d].box,E).translate(-l.options.margin,0)),f&&(o[d]=l)),q(l.lineBox().x2)===q(p.lineBox().x2)&&(l._mirrored||=(l.options.labels.mirror=!l.options.labels.mirror,!0),this.alignAxisTo(l,p,a[c],m[c]),s[d]&&l.reflow(l.box.alignTo(s[d].box,O).translate(l.options.margin,0)),f&&(s[d]=l));let h=Cv(t,u)||r;h!==l&&(l.alignTo(h),l.reflow(l.box))}for(let o=0;o<e.length;o++){let s=e[o],u=s.pane,d=u.id,f=s.options.visible!==!1,p=Cv(t,u)||r,m=a;p!==r&&(m=this.axisCrossingValues(p,e)),this.alignAxisTo(s,p,i[o],m[o]),!s.options._overlap&&(q(s.lineBox().y1)===q(p.lineBox().y1)&&(s._mirrored||=(s.options.labels.mirror=!s.options.labels.mirror,!0),this.alignAxisTo(s,p,i[o],m[o]),c[d]&&s.reflow(s.box.alignTo(c[d].box,`top`).translate(0,-s.options.margin)),f&&(c[d]=s)),q(s.lineBox().y2,3)===q(p.lineBox().y2,3)&&(l[d]&&s.reflow(s.box.alignTo(l[d].box,x).translate(0,s.options.margin)),f&&(l[d]=s)),o!==0&&(s.alignTo(n),s.reflow(s.box)))}}shrinkAxisWidth(e){let t=this.groupAxes(e).any,n=Sv(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];i.axes.length>0&&(r=Math.max(r,n.width()-i.contentBox.width()))}if(r!==0)for(let e=0;e<t.length;e++){let n=t[e];n.options.vertical||n.reflow(n.box.shrink(r,0))}}shrinkAxisHeight(e){let t;for(let n=0;n<e.length;n++){let r=e[n],i=r.axes,a=Math.max(0,Sv(i).height()-r.contentBox.height());if(a!==0){for(let e=0;e<i.length;e++){let t=i[e];t.options.vertical&&t.reflow(t.box.shrink(0,a))}t=!0}}return t}fitAxes(e){let t=this.groupAxes(e).any,n=0;for(let t=0;t<e.length;t++){let r=e[t],i=r.axes,a=r.contentBox;if(i.length>0){let e=Sv(i),t=Math.max(a.y1-e.y1,a.y2-e.y2);n=Math.max(n,a.x1-e.x1);for(let e=0;e<i.length;e++){let n=i[e];n.reflow(n.box.translate(0,t))}}}for(let e=0;e<t.length;e++){let r=t[e];r.reflow(r.box.translate(n,0))}}reflowAxes(e){let t=this.groupAxes(e);for(let t=0;t<e.length;t++)this.reflowPaneAxes(e[t]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(e),this.autoRotateAxisLabels(t),this.alignAxes(t.x,t.y),this.shrinkAxisWidth(e)&&this.alignAxes(t.x,t.y),this.shrinkAxisHeight(e),this.alignAxes(t.x,t.y),this.shrinkAxisHeight(e)&&this.alignAxes(t.x,t.y),this.fitAxes(e))}autoRotateAxisLabels(e){let{panes:t}=this,n=Tv(t),r;for(let e=0;e<n.length;e++)n[e].autoRotateLabels()&&(r=!0);if(r){for(let e=0;e<t.length;e++)this.reflowPaneAxes(t[e]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t))}}reflowPaneAxes(e){let t=e.axes,n=t.length;if(n>0)for(let r=0;r<n;r++)t[r].reflow(e.contentBox)}reflowCharts(e){let t=this.charts,n=t.length,r=this.box;for(let i=0;i<n;i++){let n=t[i].pane;(!n||W(n,e))&&t[i].reflow(r)}}reflowPanes(){let{box:e,panes:t}=this,n=t.length,r=e.height(),i=0,a=e.y1;for(let a=0;a<n;a++){let n=t[a],o=n.options.height;if(n.options.width=e.width(),!n.options.height)i++;else{if(o.indexOf&&o.indexOf(`%`)){let t=parseInt(o,10)/100;n.options.height=t*e.height()}n.reflow(e.clone()),r-=n.options.height}}for(let e=0;e<n;e++){let n=t[e];n.options.height||(n.options.height=r/i)}for(let r=0;r<n;r++){let n=t[r],i=e.clone().move(e.x1,a);n.reflow(i),a+=n.options.height}}backgroundBox(){let e=this.axes,t=e.length,n;for(let r=0;r<t;r++){let i=e[r];for(let r=0;r<t;r++){let t=e[r];if(i.options.vertical!==t.options.vertical){let e=i.lineBox().clone().wrap(t.lineBox());n=n?n.wrap(e):e}}}return n||this.box}chartsBoxes(){let e=this.panes,t=[];for(let n=0;n<e.length;n++)t.push(e[n].chartsBox());return t}addBackgroundPaths(e){let t=this.chartsBoxes();for(let n=0;n<t.length;n++)e.paths.push(F.fromRect(t[n].toRect()))}backgroundContainsPoint(e){let t=this.chartsBoxes();for(let n=0;n<t.length;n++)if(t[n].containsPoint(e))return!0}createVisual(){super.createVisual();let{opacity:e,background:t,border:n={}}=this.options.plotArea;wv(t)&&(t=k,e=0);let r=this._bgVisual=new Hr({fill:{color:t,opacity:e},stroke:{color:n.width?n.color:``,width:n.width,dashType:n.dashType},zIndex:-1});this.addBackgroundPaths(r),this.appendVisual(r)}pointsByCategoryIndex(e){let t=this.charts,n=[];if(e!==null)for(let r=0;r<t.length;r++){if(t[r].pane.options.name===`_navigator`)continue;let i=t[r].categoryPoints[e];if(i&&i.length)for(let e=0;e<i.length;e++){let t=i[e];t&&G(t.value)&&t.value!==null&&n.push(t)}}return n}pointsBySeriesIndex(e){return this.filterPoints(function(t){return t.series.index===e})}pointsByPointIndex(e){return this.filterPoints(function(t){return t.getIndex()===e})}pointsBySeriesName(e){return this.filterPoints(function(t){return t.series.name===e})}filterPoints(e){let t=this.charts,n=[];for(let r=0;r<t.length;r++){let i=t[r].points;for(let t=0;t<i.length;t++){let r=i[t];r&&r.visible!==!1&&e(r)&&n.push(r)}}return n}findPoint(e){let t=this.charts;for(let n=0;n<t.length;n++){let r=t[n].points;for(let t=0;t<r.length;t++){let n=r[t];if(n&&n.visible!==!1&&e(n))return n}}}paneByPoint(e){let t=this.panes;for(let n=0;n<t.length;n++){let r=t[n];if(r.box.containsPoint(e))return r}}detachLabels(){let e=this.groupAxes(this.panes),t=e.x,n=e.y;this.detachAxisGroupLabels(n,t),this.detachAxisGroupLabels(t,n)}detachAxisGroupLabels(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=i.pane,o=Cv(t,a)||t[0],s=r+n,c=this.createLabelAxis(i,s,o);if(c){n++;let e=a.axes.indexOf(i)+n;a.appendAxisAt(c,e)}}}createLabelAxis(e,t,n){let r=e.options.labels,i=r.position,a=i!==`end`&&i!==`start`,o=r.visible;if(a||o===!1)return null;let s=this.groupAxes(this.panes),c=n.options.vertical?s.x:s.y,l=this.axisCrossingValues(n,c),u=i===`end`,d=n.range(),f=u?d.max:d.min;if(K(l[t],d.min,d.max)-f===0)return null;l.splice(t+1,0,f),n.options.axisCrossingValues=l;let p=e.clone();return e.clear(),p.options.name=void 0,p.options.line.visible=!1,p.options.crosshair=void 0,p.options.notes=void 0,p.options.plotBands=void 0,p}isTrendline(e){return e&&W(e.type,Bg)}trendlineFactory(){}createTrendlineSeries(){let e=[];return this.series=this.series.map(t=>{if(!this.isTrendline(t))return t;let n=this.seriesByName(t.for);if(!n)throw Error(`Invalid Configuration: Unable to locate linked series "${t.for}" for trendline "${t.name}".`);let r=Wh.current.valueFields(n),i=of(r),a=this.trendlineFactory(Object.assign({},{field:i},t),n);return a&&(n.visible===!1&&(a.visible=!1),a.color===`inherit`&&(a.color=n.color),e.push(a)),a}).filter(e=>e!==null),e}seriesByName(e){return this.series.find(t=>t.name===e)}getFirstPoint(){for(let e=0;e<this.series.length;e++){let t=this.pointsBySeriesIndex(e).find(yv);if(t)return t}}getPointBelow(e){return this._getNextPoint(e,this._pointsByVertical,1)}getPointAbove(e){return this._getNextPoint(e,this._pointsByVertical,-1)}getPointToTheRight(e){return this._getNextPoint(e,this._pointsByHorizontal,1)}getPointToTheLeft(e){return this._getNextPoint(e,this._pointsByHorizontal,-1)}_getNextPoint(e,t,n){let r=t.call(this,e).filter(yv),i=r.indexOf(e)+n,a=n=>{let r,i=0;do i+=n,r=t.call(this,e,i).filter(yv);while(r.length===0);return r};return i<0?(r=a(-1),r.at(-1)):i>=r.length?(r=a(1),r.at(0)):r[i]}_pointsByVertical(e){return this.pointsByPointIndex(e.getIndex())}_pointsByHorizontal(e,t=0){let n=Td(e.series.index+t,this.series.length);return this.pointsBySeriesIndex(n)}};function xv(e){return!e.pane.axes.some(t=>t.options.vertical===e.options.vertical&&t!==e&&t.options.visible!==!1)}function Sv(e){let t=e.length,n;for(let r=0;r<t;r++){let t=e[r],i=t.options.visible!==!1;if(i||xv(t)){let e=i?t.contentBox():t.lineBox();n?n.wrap(e):n=e.clone()}}return n||new Z}function Cv(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r&&r.pane===t)return r}}function wv(e){return e===``||e===null||e===`none`||e===`transparent`||!G(e)}let Tv=e=>e.reduce((e,t)=>e.concat(t.axes),[]);Y(bv,{series:[],plotArea:{margin:{}},background:``,border:{color:b,width:0},paneDefaults:{title:{}},legend:{inactiveItems:{labels:{color:`#919191`},markers:{color:`#919191`}}}});let Ev={hover:function(e,t){this._dispatchEvent(e,t,`plotAreaHover`)},click:function(e,t){this._dispatchEvent(e,t,`plotAreaClick`)}};var Dv=class{constructor(e,t,n){let r=t.canonicalFields(e),i=t.valueFields(e),a=t.sourceFields(e,r),o=this._seriesFields=[],s=n.query(e.type),c=e.aggregate||s;this._series=e,this._binder=t;for(let e=0;e<r.length;e++){let t=r[e],n;if(kd(c))n=c[t];else if(e===0||W(t,i))n=c;else break;n&&o.push({canonicalName:t,name:a[e],transform:Ed(n)?n:Hh[n]})}}aggregatePoints(e,t){let{_series:n,_seriesFields:r}=this,i=this._bindPoints(e||[]),a=i.dataItems[0],o=null;if(a&&!V(a)&&!j(a)){let e=function(){};e.prototype=a,o=new e}for(let e=0;e<r.length;e++){let a=r[e],s=this._bindField(i.values,a.canonicalName),c=a.transform(s,n,i.dataItems,t);if(c!==null&&kd(c)&&c.length===void 0&&!(c instanceof Date)){o=c;break}else c!==void 0&&(o===null&&(o={}),Ov(a.name,o,c))}return o}_bindPoints(e){let{_binder:t,_series:n}=this,r=[],i=[];for(let a=0;a<e.length;a++){let o=e[a];r.push(t.bindPoint(n,o)),i.push(n.data[o])}return{values:r,dataItems:i}}_bindField(e,t){let n=[],r=e.length;for(let i=0;i<r;i++){let r=e[i],a=r.valueFields,o;o=a[t]===void 0?r.fields[t]:a[t],n.push(o)}return n}};function Ov(e,t,n){let r=t,i=e;if(e.indexOf(`.`)>-1){let t=e.split(`.`);for(;t.length>1;)i=t.shift(),r[i]===void 0&&(r[i]={}),r=r[i];i=t.shift()}r[i]=n}var kv=class{constructor(){this._defaults={}}register(e,t){for(let n=0;n<e.length;n++)this._defaults[e[n]]=t}query(e){return this._defaults[e]}};kv.current=new kv;var Av=class extends q_{createLabel(){let e=this.options.labels,t=H({},e,e.from),n=H({},e,e.to);t.visible&&(this.labelFrom=this.createLabelElement(t),this.append(this.labelFrom)),n.visible&&(this.labelTo=this.createLabelElement(n),this.append(this.labelTo))}reflow(e){this.render();let{labelFrom:t,labelTo:n,value:r}=this;this.box=e,t&&(t.options.aboveAxis=r.from>r.to,t.reflow(e)),n&&(n.options.aboveAxis=r.to>r.from,n.reflow(e)),this.note&&this.note.reflow(e)}};Av.prototype.defaults=H({},Av.prototype.defaults,{labels:{format:`{0} - {1}`},tooltip:{format:`{1}`}});var jv=class extends Q_{pointType(){return Av}pointValue(e){return e.valueFields}formatPointValue(e,t){return e.value.from===null&&e.value.to===null?``:this.chartService.format.auto(t,e.value.from,e.value.to)}plotRange(e){return e?[e.value.from,e.value.to]:0}updateRange(e,t){let n=t.series.axis,{from:r,to:i}=e,a=this.valueAxisRanges[n];e!==null&&V(r)&&V(i)&&(a=this.valueAxisRanges[n]=a||{min:D,max:ne},a.min=Math.min(a.min,r),a.max=Math.max(a.max,r),a.min=Math.min(a.min,i),a.max=Math.max(a.max,i))}aboveAxis(e){let t=e.value;return t.from<t.to}};jv.prototype.plotLimits=D_.prototype.plotLimits;var Mv=class extends A_{aliasFor(){return this.parent}};let Nv=`auto`;var Pv=class extends Q{constructor(e,t){super(),this.value=e,this.options=t,this.aboveAxis=J(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=Vf(),this.initLabelsFormat()}render(){if(this._rendered)return;this._rendered=!0;let{markers:e,labels:t}=this.options,n=this.value,r=this.fromPoint=new Mv(n,H({},this.options,{labels:t.from,markers:e.from})),i=this.toPoint=new Mv(n,H({},this.options,{labels:t.to,markers:e.to}));this.copyFields(r),this.copyFields(i),this.append(r),this.append(i)}reflow(e){this.render();let{from:t,to:n}=e;this.positionLabels(t,n),this.fromPoint.reflow(t),this.toPoint.reflow(n),this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())}createHighlight(){let e=new I;return e.append(this.fromPoint.createHighlight()),e.append(this.toPoint.createHighlight()),e}highlightVisual(){return this.visual}highlightVisualArgs(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}}createFocusHighlight(){let e=new I;return e.append(this.fromPoint.createFocusHighlight()),e.append(this.toPoint.createFocusHighlight()),e}tooltipAnchor(){let e=this.owner.pane.clipBox();if(!e||e.overlaps(this.box)){let e=this.box,t=e.center(),n,r,i;return this.options.vertical?(n=t.x,r=e.y1-5,i=x):(n=e.x2+5,r=t.y,i=S),{point:new X(n,r),align:{horizontal:`left`,vertical:i}}}}formatValue(e){return this.owner.formatPointValue(this,e)}overlapsBox(e){return this.box.overlaps(e)}unclipElements(){this.fromPoint.unclipElements(),this.toPoint.unclipElements()}initLabelsFormat(){let e=this.options.labels;e.format||((!e.from||!e.from.format)&&(e.from=Object.assign({},e.from,{format:`{0}`})),(!e.to||!e.to.format)&&(e.to=Object.assign({},e.to,{format:`{1}`})))}positionLabels(e,t){let{labels:n,vertical:r}=this.options;if(n.position===Nv){let i,a;r?t.y1<=e.y1?(a=tg,i=ng):(a=ng,i=tg):t.x1<=e.x1?(a=E,i=O):(a=O,i=E),(!n.from||!n.from.position)&&(this.fromPoint.options.labels.position=i),(!n.to||!n.to.position)&&(this.toPoint.options.labels.position=a)}}copyFields(e){e.dataItem=this.dataItem,e.category=this.category,e.series=this.series,e.color=this.color,e.owner=this.owner}focusVisual(){this.fromPoint.focusVisual()}clearFocusFromVisual(){this.toPoint.clearFocusFromVisual()}getIndex(){return this.categoryIx}getLabelText(e){let t=Id(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}getAriaLabelText(){let e=this.options.labels,t=Ld(e);return t?t(this.pointData()):this.getLabelText(e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}};H(Pv.prototype,O_),H(Pv.prototype,k_),Pv.prototype.defaults={markers:{visible:!1,background:k,size:8,type:C,border:{width:2},opacity:1},labels:{visible:!1,margin:U(3),padding:U(4),animation:{type:Yh,delay:600},position:Nv},notes:{label:{}},highlight:{markers:{border:{color:k,width:2}},zIndex:100},tooltip:{format:`{0} - {1}`},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}};var Fv=class extends B_{createStrokeSegments(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),e}createStroke(e){let t=new F(e),n=new F(e);t.segments.push.apply(t.segments,this.strokeSegments()),n.segments.push.apply(n.segments,this.stackSegments()),this.visual.append(t),this.visual.append(n)}hasStackSegment(){return!0}fromPoints(){return this.linePoints.map(e=>e.fromPoint)}toPoints(){return this.linePoints.map(e=>e.toPoint)}},Iv=class extends Fv{createStrokeSegments(){return this.createCurveSegments(this.toPoints())}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),e}createCurveSegments(e){return new Fh().process(this.toGeometryPoints(e))}},Lv=class extends Fv{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))}stackSegments(){let e=this.fromSegments;return this.fromSegments||(e=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints())),e.reverse()),e}};H(Lv.prototype,M_);var Rv=class extends D_{render(){super.render(),this.renderSegments()}pointType(){return Pv}createPoint(e,t){let{series:n,seriesIx:r}=t,i=e.valueFields;if(!v_(i.from)&&!v_(i.to))if(this.seriesMissingValues(n)===`zero`)i={from:0,to:0};else return null;let a=this.pointOptions(n,r);a=this.evalPointOptions(a,i,t);let o=e.fields.color||n.color;Ed(n.color)&&(o=a.color);let s=new Pv(i,a);return s.color=o,this.append(s),s}createSegment(e,t,n){let r=(t.line||{}).style,i;return i=r===`smooth`?Iv:r===`step`?Lv:Fv,new i(e,t,n)}plotRange(e,t){return e?[e.value.from,e.value.to]:[t,t]}valueSlot(e,t){let n=e.getSlot(t[0],t[0],!this.options.clip),r=e.getSlot(t[1],t[1],!this.options.clip);if(n&&r)return{from:n,to:r}}pointSlot(e,t){let{from:n,to:r}=t,i,a;return this.options.invertAxes?(i=new Z(n.x1,e.y1,n.x2,e.y2),a=new Z(r.x1,e.y1,r.x2,e.y2)):(i=new Z(e.x1,n.y1,e.x2,n.y2),a=new Z(e.x1,r.y1,e.x2,r.y2)),{from:i,to:a}}addValue(e,t){let n=e.valueFields;V(n.from)||(n.from=n.to),V(n.to)||(n.to=n.from),super.addValue(e,t)}updateRange(e,t){if(e!==null&&V(e.from)&&V(e.to)){let n=t.series.axis,r=this.valueAxisRanges[n]=this.valueAxisRanges[n]||{min:D,max:ne},{from:i,to:a}=e;r.min=Math.min(r.min,i,a),r.max=Math.max(r.max,i,a)}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.from,n.to)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++){let r=e[n];r&&(t.push((r.fromPoint||{}).marker),t.push((r.toPoint||{}).marker))}return t.concat(this._segments)}};H(Rv.prototype,I_,R_);var zv=class extends $_{reflow(e){let{options:t,value:n,owner:r}=this,i=r.seriesValueAxis(t),a=[],o=[],s=[],c=i.getSlot(n.low,n.high),l=i.getSlot(n.open,n.open),u=i.getSlot(n.close,n.close);l.x1=u.x1=c.x1=e.x1,l.x2=u.x2=c.x2=e.x2;let d=c.center().x;a.push([l.x1,l.y1]),a.push([d,l.y1]),o.push([d,u.y1]),o.push([u.x2,u.y1]),s.push([d,c.y1]),s.push([d,c.y2]),this.lines=[a,o,s],this.box=c.clone().wrap(l.clone().wrap(u)),this.reflowNote()}createBody(){}},Bv=class extends ev{pointType(){return zv}},Vv=class extends Q{constructor(e,t,n){super(),this.from=e,this.to=t,this.series=n}linePoints(){let e=this.from,{from:{box:t},to:{box:n}}=this,r=[];if(e.isVertical){let i=e.aboveAxis?t.y1:t.y2;r.push([t.x1,i],[n.x2,i])}else{let i=e.aboveAxis?t.x2:t.x1;r.push([i,t.y1],[i,n.y2])}return r}createVisual(){super.createVisual();let e=this.series.line||{},t=F.fromPoints(this.linePoints(),{stroke:{color:e.color,width:e.width,opacity:e.opacity,dashType:e.dashType}});yd(t),this.visual.append(t)}};Y(Vv,{animation:{type:Yh,delay:600}});var Hv=class extends Q_{render(){super.render(),this.createSegments()}traverseDataPoints(e){let t=this.options.series,n=d_(t),r=!this.options.invertAxes;for(let i=0;i<t.length;i++){let a=t[i],o=0,s=0;for(let t=0;t<n;t++){let n=Wh.current.bindPoint(a,t),c=n.valueFields.value,l=n.fields.summary,u=o,d;l?l.toLowerCase()===`total`?(n.valueFields.value=o,u=0,d=o):(n.valueFields.value=s,d=u-s,s=0):V(c)&&(s+=c,o+=c,d=o),e(n,{category:this.categoryAxis.categoryAt(t),categoryIx:t,series:a,seriesIx:i,total:o,runningTotal:s,from:u,to:d,isVertical:r})}}}updateRange(e,t){super.updateRange({value:t.to},t)}aboveAxis(e){return e.value>=0}plotRange(e){return[e.from,e.to]}createSegments(){let e=this.options.series,t=this.seriesPoints,n=this.segments=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(a){let e;for(let t=0;t<a.length;t++){let r=a[t];if(r&&e){let t=new Vv(e,r,i);n.push(t),this.append(t)}e=r}}}}};function Uv(e,t,n){let r=e[String(t)];return r?r(n):null}function Wv(e,t){let n=0,r=0,i=0,a=0,o=0,s,c,l=Number.MAX_VALUE,u=Number.MIN_VALUE;for(let s=0;s<e.length;s++){let c=e[s],{xValue:d,yValue:f}=t(c);isFinite(d)&&d!==null&&isFinite(f)&&f!==null&&(l=Math.min(d,l),u=Math.max(d,u),o++,n+=d,r+=f,i+=d**2,a+=d*f)}return o>0&&(s=(o*a-n*r)/(o*i-n**2),c=(r-s*n)/o),{slope:s,intercept:c,count:o,xMin:l,xMax:u}}let Gv=(e,t)=>e.every(({valueFields:e})=>!v_(e[t])||e[t]>0);function Kv(e,t){let n=[],r=t.totalRangeIndices(),i=t.currentRangeIndices(),a={min:Math.floor(Math.max(i.min-1,r.min)),max:Math.ceil(Math.min(i.max+2,r.max))};for(let r=a.min;r<a.max;r++){let i=r+1;n[r]={category:t.categoryAt(r,!0),value:e(i)}}return n}function qv(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=Yv({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let Jv=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:Math.log(n[e])});function Yv({seriesValues:e,categoryAxis:t,options:n}){let r=e();if(!Gv(r,n.field))return null;let{slope:i,intercept:a,count:o}=Wv(r,Jv(n.field));if(o>0){let e=Math.exp(a),n=i;return Kv(t=>e*Math.exp(n*t),t)}return null}function Xv(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=Qv({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let Zv=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:n[e]});function Qv({seriesValues:e,categoryAxis:t,options:n}){let{slope:r,intercept:i,count:a}=Wv(e(),Zv(n.field));return a>0?Kv(e=>r*e+i,t):null}function $v(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=ty({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let ey=e=>({categoryIx:t,valueFields:n})=>({xValue:Math.log(t+1),yValue:n[e]});function ty({seriesValues:e,categoryAxis:t,options:n}){let{slope:r,intercept:i,count:a}=Wv(e(),ey(n.field));if(a>0){let e=r,n=i;return Kv(t=>e*Math.log(t)+n,t)}return null}function ny(e,t,n){let r=[],i=[],a=Math.max(2,n)-1,o=0,s=0;for(let n=0;n<e.length;n++){let c=e[n],{xValue:l,yValue:u}=t(c);if(isFinite(u)&&u!==null?(i.push(u),s+=u,o=Math.max(n,o)):i.push(null),n>=a){let e=i.filter(e=>e!==null).length,t=i.shift()||0;if(e>0){let n=s/e;r.push([l,n]),s-=t;continue}}r.push([l,null])}return r.slice(0,o+1)}function ry(e){let{options:t}=e,n=oy(e);return n?Object.assign({},t,{type:`line`,data:n,categoryField:`category`,field:`value`}):null}let iy=e=>({categoryIx:t,valueFields:n})=>({xValue:t,yValue:n[e]});function ay({options:e,categoryAxis:t,seriesValues:n}){let r=(e.trendline||{}).period||2,i=t.totalRangeIndices(),a=t.currentRangeIndices();return ny(n({min:Math.floor(Math.max(a.min-r,i.min)),max:Math.ceil(Math.min(a.max+r+2,i.max))}),iy(e.field),r)}function oy(e){let{categoryAxis:t}=e,n=ay(e),r=[];return n.forEach(([e,n])=>{r[e]={category:t.categoryAt(e,!0),value:n}}),r.length>0?r:null}function sy(e,t,n){let r=Math.min(Math.max(n||1,1),6)+1,i=new Pf,a=new Pf,o=0,s=Number.MAX_VALUE,c=Number.MIN_VALUE,l=e=>e,u=[];for(let n=0;n<e.length;n++){let l=e[n],{xValue:u,yValue:d}=t(l);if(isFinite(u)&&u!==null&&isFinite(d)&&d!==null){s=Math.min(u,s),c=Math.max(u,c),o++,a.set(n,0,d),i.set(n,0,1),i.set(n,1,u);for(let e=2;e<=r;e++)i.set(n,e,i.get(n,1)**+e)}else i.set(n,0,0)}return i.width=Math.min(r,o),o>0&&(u=cy(i,a),l=e=>u.reduce((t,n,r)=>t+n*e**+r,0)),{coefficients:u,count:o,valueMapper:l,xMin:s,xMax:c}}function cy(e,t){let n=e.transpose(),r=n.multiply(e).inverse().multiply(n).multiply(t),i=[];for(let e=0;e<r.height;e++)i.push(r.get(e,0));return i}function ly(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=dy({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let uy=e=>({categoryIx:t,valueFields:n})=>({xValue:t+1,yValue:n[e]});function dy({seriesValues:e,categoryAxis:t,options:n}){let r=(n.trendline||{}).order,{count:i,valueMapper:a}=sy(e(),uy(n.field),r);return i>0?Kv(e=>a(e),t):null}function fy(e){let{options:t,categoryAxis:n,seriesValues:r}=e,i=my({seriesValues:r,categoryAxis:n,options:t});return i?Object.assign({},t,{type:`line`,data:i,categoryField:`category`,field:`value`}):null}let py=e=>({categoryIx:t,valueFields:n})=>({xValue:Math.log(t+1),yValue:Math.log(n[e])});function my({seriesValues:e,categoryAxis:t,options:n}){let r=e();if(!Gv(r,n.field))return null;let{slope:i,intercept:a,count:o}=Wv(r,py(n.field));if(o>0){let e=Math.exp(a),n=i;return Kv(t=>e*t**+n,t)}return null}let hy={};hy[Pg]=qv,hy[Fg]=Xv,hy[Ig]=$v,hy[Lg]=ry,hy[Rg]=ly,hy[zg]=fy;let gy=[rg,Dg,Sg,jg],_y=[mg,Ag].concat(gy);var vy=class extends bv{initFields(e){if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new W_,this._seriesPointsCache={},this._currentPointsCache={},e.length>0){this.invertAxes=W(e[0].type,[`bar`,og,Ag,Dg,jg,Cg,pg,Og]);for(let t=0;t<e.length;t++){let n=e[t].stack;if(n&&n.type===`100%`){this.stack100=!0;break}}}}render(e=this.panes){this.series=[...this.originalSeries],this.createCategoryAxes(e),this.aggregateCategories(e),this.createTrendlineSeries(e),this.createCategoryAxesLabels(e),this.createCharts(e),this.createValueAxes(e)}removeAxis(e){let t=e.options.name;super.removeAxis(e),e instanceof Jm?delete this.namedCategoryAxes[t]:(this.valueAxisRangeTracker.reset(t),delete this.namedValueAxes[t]),e===this.categoryAxis&&delete this.categoryAxis,e===this.valueAxis&&delete this.valueAxis}trendlineFactory(e,t){let n=this.seriesCategoryAxis(e),r=this.seriesValues.bind(this,t.index),i=Uv(hy,e.type,{options:e,categoryAxis:n,seriesValues:r});return i&&(i.categoryAxis=t.categoryAxis,i.valueAxis=t.valueAxis,this.filterSeries(i,n))}trendlineAggregateForecast(){return this.series.map(e=>(e.trendline||{}).forecast).filter(e=>e!==void 0).reduce((e,t)=>({before:Math.max(e.before,t.before||0),after:Math.max(e.after,t.after||0)}),{before:0,after:0})}seriesValues(e,t){let n=[],r=this.srcSeries[e],i=this.seriesCategoryAxis(r);f_(i.options.type,w)&&(this._seriesPointsCache={},this._currentPointsCache={},i.options.dataItems=[],r=this.aggregateSeries(r,i));let a=t?t.min:0,o=t?t.max:r.data.length;for(let e=a;e<o;e++){let t=this.bindPoint(r,e);n.push({categoryIx:e,category:t.fields.category,valueFields:t.valueFields})}return n}createCharts(e){let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);if(!a)continue;let o=this.groupSeriesByCategoryAxis(a);for(let e=0;e<o.length;e++)this.createChartGroup(o[e],r)}}createChartGroup(e,t){this.createAreaChart(m_(e,[rg,Dg]),t),this.createRangeAreaChart(m_(e,[Sg,jg]),t),this.createBarChart(m_(e,[cg,`bar`]),t),this.createRangeBarChart(m_(e,[wg,Cg]),t),this.createBulletChart(m_(e,[og,kg]),t),this.createCandlestickChart(m_(e,sg),t),this.createBoxPlotChart(m_(e,[ig,Og]),t),this.createOHLCChart(m_(e,hg),t),this.createWaterfallChart(m_(e,[Mg,pg]),t),this.createLineChart(m_(e,[mg,Ag]),t)}aggregateCategories(e){let t=[...this.series],n=[];this._currentPointsCache={},this._seriesPointsCache=this._seriesPointsCache||{};for(let r=0;r<t.length;r++){let i=t[r];if(!this.isTrendline(i)){let t=this.seriesCategoryAxis(i),n=this.findPane(t.options.pane);i=(f_(t.options.type,w)||i.categoryField)&&W(n,e)?this.aggregateSeries(i,t,t.currentRangeIndices()):this.filterSeries(i,t)}n.push(i)}this._seriesPointsCache=this._currentPointsCache,this._currentPointsCache=null,this.srcSeries=t,this.series=n}filterSeries(e,t){let n=(e.data||{}).length;if(t._seriesMax=Math.max(t._seriesMax||0,n),!(G(t.options.min)||G(t.options.max)))return e;let r=t.currentRangeIndices(),i=W(e.type,_y),a=H({},e);return a.data=(a.data||[]).slice(r.min,r.max+1),i&&T_(a,r,n,n=>({item:e.data[n],category:t.categoryAt(n,!0),categoryIx:n-r.min}),t=>G(e.data[t])),a}clearSeriesPointsCache(){this._seriesPointsCache={}}seriesSourcePoints(e,t){let n=`${e.index};${t.categoriesHash()}`;if(this._seriesPointsCache&&this._seriesPointsCache[n])return this._currentPointsCache[n]=this._seriesPointsCache[n],this._seriesPointsCache[n];let r=t.options,i=r.srcCategories,a=f_(r.type,w),o=e.data,s=[];a||t.indexCategories();for(let n=0;n<o.length;n++){let r=Wh.current.bindPoint(e,n).fields.category;if(a&&(r=g_(r,o[n],this.chartService.intl)),r===void 0&&(r=i[n]),r!=null){let e=t.totalIndex(r);s[e]=s[e]||{items:[],category:r},s[e].items.push(n)}}return this._currentPointsCache[n]=s,s}aggregateSeries(e,t,n=null){if(!e.data.length)return e;let r=this.seriesSourcePoints(e,t),i=H({},e),a=new Dv(H({},e),Wh.current,kv.current),o=i.data=[],s=t.options.dataItems||[],c=n||{min:0,max:r.length-1},l=e=>{let n=e-c.min,i=r[e];if(i||=r[e]={},i.categoryIx=n,!i.item){let n=t.categoryAt(e,!0);i.category=n,i.item=a.aggregatePoints(i.items,n)}return i};for(let e=c.min;e<=c.max;e++){let t=l(e);o[t.categoryIx]=t.item,t.items&&t.items.length&&(s[t.categoryIx]=t.item)}return W(i.type,_y)&&T_(i,c,t.totalCount(),l,e=>r[e]),t.options.dataItems=s,i}appendChart(e,t){let n=e.options.series,r=this.seriesCategoryAxis(n[0]),i=r.options.categories,a=Math.max(0,d_(n)-i.length);if(a>0)for(i=r.options.categories=r.options.categories.slice(0);a--;)i.push(``);this.valueAxisRangeTracker.update(e.valueAxisRanges),super.appendChart(e,t)}seriesPaneName(e){let t=this.options,n=e.axis,r=[].concat(t.valueAxis),i=Vd(r,function(e){return e.name===n})[0],a=((t.panes||[{}])[0]||{}).name||`default`;return(i||{}).pane||a}seriesCategoryAxis(e){let t=e.categoryAxis,n=t?this.namedCategoryAxes[t]:this.categoryAxis;if(!n)throw Error(`Unable to locate category axis with name `+t);return n}stackableChartOptions(e,t){let n=e.some(e=>e.stack),r=e.some(e=>e.stack&&e.stack.type===`100%`),i=t.options.clip;return{defaultStack:e[0].stack,isStacked:n,isStacked100:r,clip:i}}groupSeriesByCategoryAxis(e){let t=[],n={};for(let r=0;r<e.length;r++){let i=e[r].categoryAxis||`$$default$$`;Nf(n,i)||(n[i]=!0,t.push(i))}let r=[];for(let n=0;n<t.length;n++){let i=t[n],a=by(e,i,n);a.length!==0&&r.push(a)}return r}createBarChart(e,t){if(e.length===0)return;let n=e[0],r=new Q_(this,Object.assign({series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing},this.stackableChartOptions(e,t)));this.appendChart(r,t)}createRangeBarChart(e,t){if(e.length===0)return;let n=e[0],r=new jv(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing});this.appendChart(r,t)}createBulletChart(e,t){if(e.length===0)return;let n=e[0],r=new uv(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createLineChart(e,t){if(e.length===0)return;let n=new z_(this,Object.assign({invertAxes:this.invertAxes,series:e},this.stackableChartOptions(e,t)));this.appendChart(n,t)}createAreaChart(e,t){if(e.length===0)return;let n=new U_(this,Object.assign({invertAxes:this.invertAxes,series:e},this.stackableChartOptions(e,t)));this.appendChart(n,t)}createRangeAreaChart(e,t){if(e.length===0)return;let n=new Rv(this,{invertAxes:this.invertAxes,series:e,clip:t.options.clip});this.appendChart(n,t)}createOHLCChart(e,t){if(e.length===0)return;let n=e[0],r=new Bv(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createCandlestickChart(e,t){if(e.length===0)return;let n=e[0],r=new ev(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createBoxPlotChart(e,t){if(e.length===0)return;let n=e[0],r=new rv(this,{invertAxes:this.invertAxes,gap:n.gap,series:e,spacing:n.spacing,clip:t.options.clip});this.appendChart(r,t)}createWaterfallChart(e,t){if(e.length===0)return;let n=e[0],r=new Hv(this,{series:e,invertAxes:this.invertAxes,gap:n.gap,spacing:n.spacing});this.appendChart(r,t)}axisRequiresRounding(e,t){let n=m_(this.series,Ng);for(let e=0;e<this.series.length;e++){let t=this.series[e];if(W(t.type,gy)){let e=t.line;e&&e.style===`step`&&n.push(t)}}for(let r=0;r<n.length;r++){let i=n[r].categoryAxis||``;if(i===e||!i&&t===0)return!0}}aggregatedAxis(e,t){let n=this.series;for(let r=0;r<n.length;r++){let i=n[r].categoryAxis||``;if((i===e||!i&&t===0)&&n[r].categoryField)return!0}}createCategoryAxesLabels(){let e=this.axes;for(let t=0;t<e.length;t++)e[t]instanceof Jm&&e[t].createLabels()}createCategoryAxes(e){let t=this.invertAxes,n=[].concat(this.options.categoryAxis),r=[];for(let i=0;i<n.length;i++){let a=n[i];if(W(this.findPane(a.pane),e)){let{name:e,categories:o=[]}=a;a=H({vertical:t,reverse:!t&&this.chartService.rtl,axisCrossingValue:t?D:0},a),G(a.justified)||(a.justified=this.isJustified()),this.axisRequiresRounding(e,i)&&(a.justified=!1);let s;if(y_(a,o[0])?(a._forecast=this.trendlineAggregateForecast(),s=new rh(a,this.chartService)):s=new Jm(a,this.chartService),n[i].categories=s.options.srcCategories,e){if(this.namedCategoryAxes[e])throw Error(`Category axis with name ${e} is already defined`);this.namedCategoryAxes[e]=s}s.axisIndex=i,r.push(s),this.appendAxis(s)}}let i=this.categoryAxis||r[0];this.categoryAxis=i,t?this.axisY=i:this.axisX=i}isJustified(){let e=this.series;for(let t=0;t<e.length;t++){let n=e[t];if(!W(n.type,gy))return!1}return!0}createValueAxes(e){let t=this.valueAxisRangeTracker,n=t.query(),r=[].concat(this.options.valueAxis),i=this.invertAxes,a={vertical:!i,reverse:i&&this.chartService.rtl},o=[];this.stack100&&(a.roundToMajorUnit=!1,a.labels={format:`P0`});for(let i=0;i<r.length;i++){let s=r[i];if(W(this.findPane(s.pane),e)){let e=s.name,r=f_(s.type,`log`)?{min:.1,max:1}:{min:0,max:1},c=t.query(e)||n||r;i===0&&c&&n&&(c.min=Math.min(c.min,n.min),c.max=Math.max(c.max,n.max));let l;l=f_(s.type,`log`)?xh:uh;let u=new l(c.min,c.max,H({},a,s),this.chartService);if(e){if(this.namedValueAxes[e])throw Error(`Value axis with name ${e} is already defined`);this.namedValueAxes[e]=u}u.axisIndex=i,o.push(u),this.appendAxis(u)}}let s=this.valueAxis||o[0];this.valueAxis=s,i?this.axisX=s:this.axisY=s}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.pointPane(i),o=[],s=[];if(!a)return;let c=a.axes;for(let e=0;e<c.length;e++){let t=c[e];t.getValue?s_(s,t.getValue(i)):s_(o,t.getCategory(i))}o.length===0&&s_(o,this.categoryAxis.getCategory(i)),o.length>0&&s.length>0&&e.trigger(n,{element:rf(t),originalEvent:t,category:b_(o),value:b_(s)})}pointPane(e){let t=this.panes;for(let n=0;n<t.length;n++){let r=t[n];if(r.contentBox.containsPoint(e))return r}}updateAxisOptions(e,t){yy(this.options,e,t),yy(this.originalOptions,e,t)}_pointsByVertical(e,t=0){return this.invertAxes?this._siblingsBySeriesIndex(e.series.index,t):this._siblingsByPointIndex(e.getIndex())}_pointsByHorizontal(e,t=0){if(this.invertAxes)return this._siblingsByPointIndex(e.getIndex());let n=this._siblingsBySeriesIndex(e.series.index,t);return this.chartService.rtl?n.reverse():n}_siblingsByPointIndex(e){let t=this.charts,n=[];for(let r=0;r<t.length;r++){let i=t[r];if(i.pane&&i.pane.options.name===`_navigator`)continue;let a=i.points.filter(t=>t&&t.visible!==!1&&t.getIndex()===e);n.push(...a.sort(this._getSeriesCompareFn(a[0])))}return n}_siblingsBySeriesIndex(e,t){let n=Td(e+t,this.series.length);return this.pointsBySeriesIndex(n)}_getSeriesCompareFn(e){let t=this._isInStackedSeries(e);return t&&this.invertAxes||!t&&!this.invertAxes?(e,t)=>e.box.center().x-t.box.center().x:(e,t)=>e.box.center().y-t.box.center().y}_isInStackedSeries(e){let t=W(e.series.type,[rg,Dg,Sg,jg,mg,Ag,xg,yg]),n=W(e.series.type,[cg,`bar`]);return t||n&&e.options.isStacked}categoryAxisByPoint(e){let t=this.axes,n;for(let r=0;r<t.length;r++){let i=t[r];if(i instanceof Jm&&i.pane.chartsBox().containsPoint(e)){n=i;break}}return n}};function yy(e,t,n){H((t instanceof Jm?[].concat(e.categoryAxis):[].concat(e.valueAxis))[t.axisIndex],n)}function by(e,t,n){return Vd(e,function(e){return n===0&&!e.categoryAxis||e.categoryAxis===t})}Y(vy,{categoryAxis:{},valueAxis:{}}),H(vy.prototype,Ev);var xy=class{constructor(){this._points=[]}destroy(){this._points=[]}show(e,t){let n=[].concat(e);this.hide();for(let e=0;e<n.length;e++){let r=n[e];r&&r.toggleHighlight&&r.hasHighlight()&&(this.togglePointHighlight(r,!0,t),this._points.push(r))}}togglePointHighlight(e,t,n){let r=(e.options.highlight||{}).toggle,i=e.options.highlight||{},a=n===void 0?i.inactiveOpacity:n;if(r){let n={category:e.category,series:e.series,dataItem:e.dataItem,value:e.value,stackValue:e.stackValue,preventDefault:Sy,visual:e.highlightVisual(),show:t};r(n),n._defaultPrevented||e.toggleHighlight(t,a)}else e.toggleHighlight(t,a)}hide(){let e=this._points;for(;e.length;){let t=e.pop(),n=t.options.highlight||{};this.togglePointHighlight(t,!1,n.inactiveOpacity)}}isHighlighted(e){let t=this._points;for(let n=0;n<t.length;n++)if(e===t[n])return!0;return!1}};function Sy(){this._defaultPrevented=!0}function Cy(e,t){let n=(t||``).toLowerCase(),r=e.event;return n===`none`&&!(r.ctrlKey||r.shiftKey||r.altKey)||r[n+`Key`]}function wy(e){let t={};for(let n=0;n<e.length;n++){let r=e[n];r.axis.options.name&&(t[r.axis.options.name]={min:r.range.min,max:r.range.max})}return t}var Ty=class{constructor(e,t){this.plotArea=e,this.options=H({},this.options,t)}start(e){return this._active=Cy(e,this.options.key),this._active}move(e){if(this._active){let t=this.axisRanges=this._panAxes(e,`x`).concat(this._panAxes(e,`y`));if(t.length)return this.axisRanges=t,wy(t)}}end(){let e=this._active;return this._active=!1,e}pan(){let{plotArea:e,axisRanges:t}=this;if(t.length){for(let n=0;n<t.length;n++){let r=t[n];e.updateAxisOptions(r.axis,r.range)}e.redraw(e.panes)}}destroy(){delete this.plotArea}_panAxes(e,t){let n=this.plotArea,r=-e[t].delta,i=(this.options.lock||``).toLowerCase(),a=[];if(r!==0&&(i||``).toLowerCase()!==t){let e=n.axes;for(let n=0;n<e.length;n++){let i=e[n];if(t===`x`&&!i.options.vertical||t===`y`&&i.options.vertical){let e=i.pan(r);e&&(e.limitRange=!0,a.push({axis:i,range:e}))}}}return a}};Ty.prototype.options={key:`none`,lock:`none`};var Ey=class{constructor(e,t){this.chart=e,this.options=H({},this.options,t),this.createElement()}createElement(){let e=this._marquee=document.createElement(`div`);e.className=`k-marquee`;let t=document.createElement(`div`);t.className=`k-marquee-color`,e.appendChild(t)}removeElement(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)}setStyles(e){Nd(this._marquee,e)}start(e){if(Cy(e,this.options.key)){let t=this.chart,n=t._eventCoordinates(e),r=this._zoomPane=t._plotArea.paneByPoint(n),i=r?r.chartsBox().clone():null;if(r&&i){let t=this._elementOffset();return i.translate(t.left,t.top),this._zoomPaneClipBox=i,document.body.appendChild(this._marquee),this.setStyles({left:e.pageX+1,top:e.pageY+1,width:0,height:0}),!0}}return!1}_elementOffset(){let e=this.chart.element,{paddingLeft:t,paddingTop:n}=Nd(e,[`paddingLeft`,`paddingTop`]),r=ef(e);return{left:t+r.left,top:n+r.top}}move(e){this._zoomPane&&this.setStyles(this._selectionPosition(e))}end(e){if(this._zoomPane){let t=this._elementOffset(),n=this._selectionPosition(e);n.left-=t.left,n.top-=t.top;let r={x:n.left,y:n.top},i={x:n.left+n.width,y:n.top+n.height};return this._updateAxisRanges(r,i),this.removeElement(),delete this._zoomPane,wy(this.axisRanges)}}zoom(){let e=this.axisRanges;if(e&&e.length){let t=this.chart._plotArea;for(let n=0;n<e.length;n++){let r=e[n];t.updateAxisOptions(r.axis,r.range)}t.redraw(t.panes)}}destroy(){this.removeElement(),delete this._marquee,delete this.chart}_updateAxisRanges(e,t){let n=(this.options.lock||``).toLowerCase(),r=[],i=this._zoomPane.axes;for(let a=0;a<i.length;a++){let o=i[a],s=o.options.vertical;if(!(n===`x`&&!s)&&!(n===`y`&&s)&&G(o.axisIndex)){let n=o.pointsRange(e,t);n&&r.push({axis:o,range:n})}}this.axisRanges=r}_selectionPosition(e){let t=this._zoomPaneClipBox,n={x:e.x.startLocation,y:e.y.startLocation},{x:{location:r},y:{location:i}}=e,a=(this.options.lock||``).toLowerCase(),o=Math.min(n.x,r),s=Math.min(n.y,i),c=Math.abs(n.x-r),l=Math.abs(n.y-i);return a===`x`&&(o=t.x1,c=t.width()),a===`y`&&(s=t.y1,l=t.height()),r>t.x2&&(c=t.x2-n.x),r<t.x1&&(c=n.x-t.x1),i>t.y2&&(l=t.y2-n.y),i<t.y1&&(l=n.y-t.y1),{left:Math.max(o,t.x1),top:Math.max(s,t.y1),width:c,height:l}}};Ey.prototype.options={key:`shift`,lock:`none`};var Dy=class{constructor(e,t){this.chart=e,this.options=H({rate:.3},this.options,t)}updateRanges(e,t){let n=(this.options.lock||``).toLowerCase(),r=[],i=this.chart._plotArea.axes;for(let a=0;a<i.length;a++){let o=i[a],s=o.options.vertical;if(!(n===`x`&&!s)&&!(n===`y`&&s)&&o.zoomRange){let n=K(this.options.rate,.01,.9),i=o.zoomRange(-e*n,t);i&&r.push({axis:o,range:i})}}return this.axisRanges=r,wy(r)}zoom(){let e=this.axisRanges,t=this.chart._plotArea;if(e&&e.length&&t.updateAxisOptions){for(let n=0;n<e.length;n++){let r=e[n];t.updateAxisOptions(r.axis,r.range)}t.redraw(t.panes)}}destroy(){delete this.chart}};let Oy=e=>e?`end`:`start`;var ky=class extends Q{constructor(e,t){super(e),this.chartService=t}render(){let{children:e,options:t}=this,n=t.vertical;this.visual=new $r(null,{spacing:n?0:t.spacing,lineSpacing:n?t.spacing:0,orientation:n?`vertical`:`horizontal`,reverse:t.rtl,alignItems:n?Oy(t.rtl):S});for(let t=0;t<e.length;t++){let n=e[t];n.reflow(new Z),n.renderVisual()}}reflow(e){this.visual.rect(e.toRect()),this.visual.reflow();let t=this.visual.clippedBBox();t?this.box=Qp(t):this.box=new Z}renderVisual(){this.addVisual()}createVisual(){}},Ay=class extends Up{visualStyle(){let e=this.markerOptions(),t=e.border;return{stroke:{width:t.width,color:t.color,opacity:J(t.opacity,e.opacity),dashType:t.dashType},fill:{color:e.background,opacity:e.opacity},cursor:e.cursor}}markerOptions(){return this.options}markerHighlightOptions(){let e=this.markerOptions(),t=e.highlight.border.width;return H({},e,{background:e.border.color},e.highlight,e.type===`cross`?{background:e.highlight.border.color,border:{color:e.highlight.background,width:t/2},width:e.width,height:e.height,margin:{top:0,left:0}}:{})}createHighlight(){let e=new Up(this.markerHighlightOptions()),t=this.paddingBox.clone();return e.reflow(t.pad(e.options.border.width)),this.highlight=[e.getElement()],this.highlight}};Y(Ay,{border:{width:2},width:8,height:8,background:k,margin:{top:-1,left:-1},vAlign:`top`,align:E,highlight:{width:10,height:10,border:{color:k,width:2}}});var jy=class extends Up{getElement(){let e=new I,t=new Hr(this.visualStyle()),{paddingBox:n}=this,r=n.height()/2;return t.moveTo(n.x1,n.y1+r).lineTo(n.x1,n.y2).lineTo(n.x2,n.y2),e.append(t),e}};Y(jy,{width:15,height:15,align:O,vAlign:x,margin:{right:-2,bottom:2}});var My=class extends Up{getElement(){let e=new I,t=new Hr({stroke:{color:this.options.border.color,opacity:this.options.opacity,width:this.options.height,dashType:this.options.dashType}}),n=this.paddingBox,r=n.center().y;return t.moveTo(n.x1,r).lineTo(n.x2,r),e.append(t),e}createHighlight(){return this.highlight=[this.createHighlightLine(),this.createHighlightMarker()],this.highlight}createHighlightLine(){let e=new jy(H({},{border:{color:this.options.border.color,opacity:this.options.border.opacity,dashType:this.options.border.dashType}},this.options.highlight));return e.reflow(this.parent.paddingBox.clone()),this.highlightLine=e.getElement(),this.highlightLine}createHighlightMarker(){let e=H({},{background:this.options.background},this.options.highlight.markers),t=new Up(e),n=this.parent.paddingBox,r=e.border.width,i=this.parent.box.clone();return i.pad({left:r-n.x1,top:r-n.y1}),t.reflow(i),this.highlightMarker=t.getElement(),this.highlightMarker}};Y(My,{border:{width:0},type:`rect`,align:E,vAlign:S,highlight:{border:{width:2},markers:{type:C,width:10,height:10,border:{width:2,color:k},align:E,vAlign:`top`}}});var Ny=class extends Up{createHighlight(){let e=new Up(H({},{background:this.options.background},this.options.highlight.markers)),t=this.paddingBox.clone(),n=this.parent.box.clone();return t.align(n,`x`,E),t.align(n,`y`,`top`),e.reflow(t),this.highlight=[e.getElement()],this.highlight}};Y(Ny,{highlight:{markers:{type:C,width:10,height:10,border:{width:2,color:k},margin:{top:-3,left:-3}}}});var Py=class extends Vp{constructor(e){super(e),this.createContainer(),e.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel()),this._id=Vf(),this.options.accessibility.ariaChecked=e.active}createContainer(){this.container=new Yp({vertical:!1,wrap:!1,align:S,spacing:this.options.spacing}),this.append(this.container)}createMarker(){this.markerWrap=new Vp({vertical:!1,shrinkToFit:!0,wrap:!1,margin:1,width:22,height:22}),this.container.append(this.markerWrap),this.createMarkerArea(),this.options.markers.visible&&(this._marker=this._createMarker(),this.markerWrap.append(this._marker))}createMarkerArea(){let{markerColor:e,line:t={}}=this.options,n={border:{color:t.color||e,opacity:t.opacity,dashType:t.dashType}};return this._createLine(n)||this._createMarkerLine(n,t)||this._createSquare()}markerOptions(){let e=this.options,{markers:t={},markerColor:n}=e,{border:r={}}=t;return t.zIndex=void 0,H({},t,{border:{color:r.color||n},highlight:e.highlight.markers})}_highlightOptions(){let e=this.options;return H({markers:{type:e.markers.type}},e.highlight)}_createLine(e){let t=this.options;return t.type===`line`&&!t.markers.visible&&(this._line=new My(H({},{background:t.markerColor,highlight:this._highlightOptions()},e,t.line)),this.markerWrap.append(this._line)),this._line}_createMarkerLine(e,t){return this.options.type===`line`&&(this._markerLineArea=new jy(H({},{border:{width:t.height}},e)),this.markerWrap.append(this._markerLineArea)),this._markerLineArea}_reduceSize(e,t,n=.6){typeof e[t]==`number`&&(e[t]=e[t]*n)}_createSquare(){let e=this.options;if(e.type===`area`){let t=e.pattern||(e.series||{}).pattern;t&&(typeof t==`function`&&(t=t(e.series)),t=Object.assign({},t),this._reduceSize(t,`gap`),this._reduceSize(t,`width`),this._reduceSize(t,`radius`)),this._square=new Ny(Object.assign({},{border:e.border,vAlign:e.markers.visible?x:S,highlight:this._highlightOptions()},e.area,{pattern:t,background:e.area.background||e.markerColor})),this.markerWrap.append(this._square)}return this._square}_createMarker(){return new Ay(this.markerOptions())}_highlightMarkers(){this.options.active&&this._toggleHighlight(!0)}_restoreMarkers(){this._toggleHighlight(!1)}_toggleHighlight(e){if(!this.options.highlight.visible)return;let t=this._marker||this._square||this._line;if(t&&t===this._line&&this._line.visual.visible(!e),t){let n=t.highlight;n||(n=t.createHighlight(),n.forEach(e=>e&&this.markerWrap.appendVisual(e))),n.forEach(t=>t&&t.visible(e))}}createLabel(){let e=this.options,t=H({},e.labels);this.container.append(new em(e.text,t))}getAriaLabelText(){return this.options.text}focusVisual(){this.visual.options.set(`id`,this._id),this.toggleFocusHighlight(!0),this._highlightMarkers()}clearFocusFromVisual(){this.visual.options.set(`id`,``),this.toggleFocusHighlight(!1),this._restoreMarkers()}renderComplete(){super.renderComplete();let e=this.options.cursor||{},t=this._itemOverlay=F.fromRect(this.container.box.toRect(),{fill:{color:k,opacity:0},stroke:null,cursor:e.style||e});this.appendVisual(t)}click(e,t){let n=this.eventArgs(t);!e.trigger(`legendItemClick`,n)&&t&&t.type===`contextmenu`&&t.preventDefault()}over(e,t){let n=this.eventArgs(t);return e.trigger(`legendItemHover`,n)||(e._legendItemHover(n.seriesIndex,n.pointIndex),this._highlightMarkers()),!0}out(e,t){e._unsetActivePoint(),this._restoreMarkers(),e.trigger(`legendItemLeave`,this.eventArgs(t))}eventArgs(e){let t=this.options;return{element:rf(e),text:t.text,series:t.series,seriesIndex:t.series.index,pointIndex:t.pointIndex}}createVisual(){super.createVisual();let e=this.options;if(this.options.visible){let t=H({ariaLabel:e.accessibility.ariaLabel===void 0?e.text:e.accessibility.ariaLabel},e.accessibility);Hp(this.visual,t)}}renderVisual(){let e=this.options,t=e.visual;t?(this.visual=t({active:e.active,series:e.series,sender:this.getSender(),pointIndex:e.pointIndex,options:{type:e.type,markers:H({background:this.options.markerColor},this.markerOptions()),labels:e.labels},createVisual:()=>{this.createVisual(),this.renderChildren(),this.renderComplete();let e=this.visual;return delete this.visual,e}}),this._marker=this._markerLineArea=this._square=this._line=null,this.addVisual()):super.renderVisual()}createFocusHighlight(e){let t=e.stroke.width;return F.fromRect(this.container.box.pad(t/2).toRect(),e)}};Y(Py,{accessibility:{role:`checkbox`,className:`k-chart-legend-item`,ariaRoleDescription:`Legend item`},markers:{},highlight:{visible:!0,markers:{}}});let Fy=`custom`;var Iy=class extends Q{constructor(e,t={}){super(e),this.chartService=t,W(this.options.position,[`top`,`right`,`bottom`,`left`,Fy])||(this.options.position=O),this.createContainers(),this.createLegendTitle(e.title),this.createItems()}createContainers(){let e=this.options,{position:t,align:n}=e,r=t,i=S;t===Fy?r=E:W(t,[`top`,`bottom`])?(r=n===`start`?E:n===`end`?O:S,i=t):n&&(n===`start`?i=`top`:n===`end`&&(i=x)),this.container=new Vp({margin:e.margin,padding:e.padding,background:e.background,border:e.border,vAlign:i,align:r,zIndex:e.zIndex,shrinkToFit:!0}),this.hasTitle()?this.itemsContainer=new Vp({vAlign:i,align:r,zIndex:e.zIndex,shrinkToFit:!0}):this.itemsContainer=this.container,this.append(this.container)}createItems(){let e=this.getService(),t=this.options,n=new ky({vertical:this.isVertical(),spacing:t.spacing,rtl:e.rtl},e),r=t.data;t.reverse&&(r=r.slice(0).reverse());let i=r.length;for(let a=0;a<i;a++){let i=r[a],{markers:o={},dashType:s,legendItem:c,opacity:l}=i.series||{},u=H({visible:o.visible!==!1,type:C},o);delete u.size;let d=H({},{markers:u,labels:t.labels,rtl:e.rtl,line:Object.assign({},{dashType:s},t.line),area:Object.assign({},{opacity:l},t.area),opacity:l,accessibility:t.accessibility,focusHighlight:t.focusHighlight},t.item,c,i,{markers:t.markers});n.append(new Py(d))}n.render(),this.itemsContainer.append(n)}isVertical(){let{orientation:e,position:t}=this.options;return t===Fy&&e!==`horizontal`||(G(e)?e!==`horizontal`:W(t,[`left`,`right`]))}hasItems(){return this.container.children[0].children.length>0}getItems(){return this.itemsContainer.children[0].children}reflow(e){let t=this.options,n=e.clone();if(!this.hasItems()){this.box=n;return}t.position===Fy?(this.containerCustomReflow(n),this.box=n):this.containerReflow(n),this.hasTitle()&&(this.title.reflow(new Z(this.container.box.x1,this.title.box.y1,this.container.box.x2,this.title.box.y2)),this.title.box.width()>this.itemsContainer.box.width()&&this.itemsContainer.reflow(new Z(this.container.box.x1,this.itemsContainer.box.y1,this.container.box.x2,this.itemsContainer.box.y2)))}containerReflow(e){let{options:t,container:n}=this,{position:r,width:i,height:a}=t,o=r===`top`||r===`bottom`?`x`:`y`,s=this.isVertical(),c=e.clone(),l=e.clone();(r===`left`||r===`right`)&&(l.y1=c.y1=0),s&&a?(l.y2=l.y1+a,l.align(c,`y`,n.options.vAlign)):!s&&i&&(l.x2=l.x1+i,l.align(c,`x`,n.options.align)),n.reflow(l),l=n.box;let u=l.clone();(t.offsetX||t.offsetY)&&(l.translate(t.offsetX,t.offsetY),n.reflow(l)),u[o+1]=e[o+1],u[o+2]=e[o+2],this.box=u}containerCustomReflow(e){let{options:t,container:n}=this,{offsetX:r,offsetY:i,width:a,height:o}=t,s=this.isVertical(),c=e.clone();s&&o?c.y2=c.y1+o:!s&&a&&(c.x2=c.x1+a),n.reflow(c),c=n.box,n.reflow(new Z(r,i,r+c.width(),i+c.height()))}renderVisual(){this.hasItems()&&super.renderVisual()}createLegendTitle(e){let t=H({},{color:b,position:`top`,align:S},e),n=t.text;if(!(!e||e.visible===!1||!e.text)){if(G(t)&&t.visible){let e=Id(t);e?n=e({text:n}):t.format&&(n=this.chartService.format.auto(t.format,n))}this.title=new em(n,t),this.createTitleLayout(),this.appendTitleLayoutContent()}}createTitleLayout(){this.layout=new Yp({vertical:!0,wrap:!1}),this.container.append(this.layout)}hasTitle(){return!!(this.options.title&&this.options.title.visible!==!1&&this.options.title.text)}appendTitleLayoutContent(){this.options.title.position===`bottom`?(this.layout.append(this.itemsContainer),this.layout.append(this.title)):(this.layout.append(this.title),this.layout.append(this.itemsContainer))}};Y(Iy,{position:O,data:[],offsetX:0,offsetY:0,margin:U(2),padding:U(5),border:{color:b,width:0},item:{cursor:se,spacing:6},spacing:6,background:``,zIndex:1,markers:{},line:{width:20,height:2,cursor:se,opacity:1},area:{type:`square`,align:O,width:15,height:15}});var Ly=class{constructor(){this._registry=[]}register(e,t){this._registry.push({type:e,seriesTypes:t})}create(e,t,n){let r=this._registry,i=r[0],a;for(let t=0;t<r.length;t++){let n=r[t];a=m_(e,n.seriesTypes);let o=m_(e,Bg);if(a.length-o.length>0){i=n;break}}return new i.type(a,t,n)}};Ly.current=new Ly;function Ry(e){let t=document.createElement(`div`);return e&&(t.className=e),t}function zy(e){let t=e;for(;t&&!Hd(t,`k-handle`);)t=t.parentNode;return t}var By=class{constructor(e,t,n,r){let i=e.element;this.options=H({},this.options,n),this.chart=e,this.observer=r,this.chartElement=i,this.categoryAxis=t,this._dateAxis=this.categoryAxis instanceof rh,this.initOptions(),this.visible=this.options.visible&&i.offsetHeight,this.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())}onPane(e){return this.categoryAxis.pane===e}createElements(){let e=this.options,t=this.wrapper=Ry(`k-selector k-pointer-events-none`);Nd(t,{top:e.offset.top,left:e.offset.left,width:e.width,height:e.height,direction:`ltr`});let n=this.selection=Ry(`k-selection k-pointer-events-none`);this.leftMask=Ry(`k-mask k-pointer-events-none`),this.rightMask=Ry(`k-mask k-pointer-events-none`),t.appendChild(this.leftMask),t.appendChild(this.rightMask),t.appendChild(n);let r=this.body=Ry(`k-selection-bg k-pointer-events-none`);n.appendChild(r);let i=this.leftHandle=Ry(`k-handle k-left-handle k-pointer-events-auto`),a=this.rightHandle=Ry(`k-handle k-right-handle k-pointer-events-auto`);i.appendChild(Ry()),a.appendChild(Ry()),n.appendChild(i),n.appendChild(a),this.chartElement.appendChild(t);let o=Nd(n,[`borderLeftWidth`,`borderRightWidth`,`height`]),s=Nd(i,`height`).height,c=Nd(a,`height`).height;e.selection={border:{left:o.borderLeftWidth,right:o.borderRightWidth}},Nd(i,{top:(o.height-s)/2}),Nd(a,{top:(o.height-c)/2}),t.style.cssText=t.style.cssText}bindEvents(){this.options.mousewheel!==!1&&(this._mousewheelHandler=this._mousewheel.bind(this),Qd(this.chartElement,{[t_]:this._mousewheelHandler})),this._domEvents=dm.create(this.chartElement,{stopPropagation:!0,start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})}initOptions(){let{options:e,categoryAxis:t}=this,n=t.pane.chartsBox(),r=this.chart.chartService.intl;this._dateAxis&&H(e,{min:Um(r,e.min),max:Um(r,e.max),from:Um(r,e.from),to:Um(r,e.to)});let{paddingLeft:i,paddingTop:a}=Nd(this.chartElement,[`paddingLeft`,`paddingTop`]);this.options=H({},{width:n.width(),height:n.height()+.1,padding:{left:i,top:a},offset:{left:n.x1+i,top:n.y1+a},from:e.min,to:e.max},e)}destroy(){this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper&&=(this._mousewheelHandler&&=(lf(this.chartElement,{[t_]:this._mousewheelHandler}),null),this.chartElement.removeChild(this.wrapper),null)}_rangeEventArgs(e){return{axis:this.categoryAxis.options,from:this._value(e.from),to:this._value(e.to)}}_pointInPane(e,t){let n=this.categoryAxis.pane.box,r=this.chart._toModelCoordinates(e,t);return n.containsPoint(r)}_start(e){let t=this.options,n=rf(e);if(this._state||!n)return;let r=nf(e);if(!this._pointInPane(r.x,r.y))return;let i=zy(n),a=this.body.getBoundingClientRect(),o=!i&&r.x>=a.x&&r.x<=a.x+a.width&&r.y>=a.y&&r.y<=a.y+a.height;this.chart._unsetActivePoint(),this._state={moveTarget:i,startLocation:e.x?e.x.location:0,inBody:o,range:{from:this._index(t.from),to:this._index(t.to)}};let s=this._rangeEventArgs({from:this._index(t.from),to:this._index(t.to)});this.trigger(`selectStart`,s)&&(this._state=null)}_press(e){let t;t=this._state?this._state.moveTarget:zy(rf(e)),t&&le(t,`k-handle-active`)}_move(e){if(!this._state)return;let{_state:t,options:n,categoryAxis:r}=this,{range:i,moveTarget:a}=t,o=r.options.reverse,s=this._index(n.from),c=this._index(n.to),l=this._index(n.min),u=this._index(n.max),d=t.startLocation-e.x.location,f={from:i.from,to:i.to},p=i.to-i.from,m=Nd(this.wrapper,`width`).width/(r.categoriesCount()-1),h=Math.round(d/m)*(o?-1:1);if(!a&&!t.inBody)return;let g=a&&Hd(a,`k-left-handle`),_=a&&Hd(a,`k-right-handle`);t.inBody?(i.from=Math.min(Math.max(l,s-h),u-p),i.to=Math.min(i.from+p,u)):g&&!o||_&&o?(i.from=Math.min(Math.max(l,s-h),u-1),i.to=Math.max(i.from+1,i.to)):(g&&o||_&&!o)&&(i.to=Math.min(Math.max(l+1,c-h),u),i.from=Math.min(i.to-1,i.from)),(i.from!==f.from||i.to!==f.to)&&(this.move(i.from,i.to),this.trigger(qg,this._rangeEventArgs(i)))}_end(){if(this._state){let e=this._state.moveTarget;e&&de(e,`k-handle-active`);let t=this._state.range;this.set(t.from,t.to),this.trigger(Jg,this._rangeEventArgs(t)),delete this._state}}_tap(e){let{options:t,categoryAxis:n}=this,r=this.chart._eventCoordinates(e),i=n.pointCategoryIndex(new X(r.x,n.box.y1)),a=this._index(t.from),o=this._index(t.to),s=this._index(t.min),c=this._index(t.max),l=o-a,u=a+l/2,d={},f=e.event.which===3,p=Math.round(u-i);this._state||f||(this.chart._unsetActivePoint(),n.options.justified||p--,d.from=Math.min(Math.max(s,a-p),c-l),d.to=Math.min(d.from+l,c),this._start(e),this._state&&(this._state.range=d,this.trigger(qg,this._rangeEventArgs(d)),this._end()))}_mousewheel(e){let t=Xd(e);if(this._start(e),this._state){let n=this._state.range;e.preventDefault(),e.stopPropagation(),Math.abs(t)>1&&(t*=3),this.options.mousewheel.reverse&&(t*=-1),this.expand(t)&&this.trigger(qg,{axis:this.categoryAxis.options,delta:t,originalEvent:e,from:this._value(n.from),to:this._value(n.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout(()=>{this._end()},150)}}_gesturestart(e){let t=this.options,n=e.touches[0];if(!this._pointInPane(n.pageX,n.pageY))return;this._state={range:{from:this._index(t.from),to:this._index(t.to)}};let r=this._rangeEventArgs(this._state.range);this.trigger(`selectStart`,r)?this._state=null:e.preventDefault()}_gestureend(){this._state&&(this.trigger(Jg,this._rangeEventArgs(this._state.range)),delete this._state)}_gesturechange(e){if(!this._state)return;let{chart:t,_state:n,options:r,categoryAxis:i}=this,a=n.range,o=t._toModelCoordinates(e.touches[0].x.location).x,s=t._toModelCoordinates(e.touches[1].x.location).x,c=Math.min(o,s),l=Math.max(o,s);e.preventDefault(),a.from=i.pointCategoryIndex(new X(c))||r.min,a.to=i.pointCategoryIndex(new X(l))||r.max,this.move(a.from,a.to),this.trigger(qg,this._rangeEventArgs(a))}_index(e){let t=e;return e instanceof Date&&(t=this.categoryAxis.categoryIndex(e)),t}_value(e){let t=e;return this._dateAxis&&(t=this.categoryAxis.categoryAt(e),t>this.options.max&&(t=this.options.max)),t}_slot(e){let t=this.categoryAxis,n=this._index(e);return t.getSlot(n,n,!0)}move(e,t){let n=this.options,r=this.categoryAxis.options.reverse,{offset:i,padding:a,selection:{border:o}}=n,s=r?t:e,c=r?e:t,l=`x`+(r?2:1),u=this._slot(s),d=q(u[l]-i.left+a.left);Nd(this.leftMask,{width:d}),Nd(this.selection,{left:d}),u=this._slot(c);let f=q(n.width-(u[l]-i.left+a.left));Nd(this.rightMask,{width:f});let p=n.width-f;p!==n.width&&(p+=o.right),Nd(this.rightMask,{left:p}),Nd(this.selection,{width:Math.max(n.width-(d+f)-o.right,0)})}set(e,t){let n=this.options,r=this._index(n.min),i=this._index(n.max),a=K(this._index(e),r,i),o=K(this._index(t),a+1,i);n.visible&&this.move(a,o),n.from=this._value(a),n.to=this._value(o)}expand(e){let t=this.options,n=this._index(t.min),r=this._index(t.max),i=t.mousewheel.zoom,a=this._index(t.from),o=this._index(t.to),s={from:a,to:o},c=H({},s);if(this._state&&(s=this._state.range),i!==`right`&&(s.from=K(K(a-e,0,o-1),n,r)),i!==`left`&&(s.to=K(K(o+e,s.from+1,r),n,r)),s.from!==c.from||s.to!==c.to)return this.set(s.from,s.to),!0}zoom(e,t){let n=this.options,r=this._index(n.min),i=this._index(n.max),a=this._index(n.from),o=this._index(n.to),s={from:a,to:o},c=H({},s),{reverse:l}=this.categoryAxis.options,u=`x`+(l?`2`:`1`),d=this.categoryAxis.lineBox(),f=Math.abs(d[u]-t.x),p=d.width(),m=q(f/p,2),h=q(m*e),g=q((1-m)*e);if(this._state&&(s=this._state.range),s.from=K(K(a-h,0,o-1),r,i),s.to=K(K(o+g,s.from+1,i),r,i),s.from!==c.from||s.to!==c.to)return this.set(s.from,s.to),!0}trigger(e,t){return(this.observer||this.chart).trigger(e,t)}};Y(By,{visible:!0,mousewheel:{zoom:`both`},min:ne,max:D});var Vy=class extends fv{show(e){if(!e||!e.tooltipAnchor||this._current&&this._current===e)return;let t=H({},this.options,e.options.tooltip),n=e.tooltipAnchor();n?(this._current=e,super.show({point:e,anchor:n},t,e)):this.hide()}hide(){delete this._current,super.hide()}},Hy=class extends fv{constructor(e,t){super(e.chartService,t),this.plotArea=e,this.formatService=e.chartService.format}showAt(e,t){let n=Vd(e,function(e){let t=e.series.tooltip;return!(t&&t.visible===!1)});if(n.length>0){let r=n[0],i=this.plotArea.categoryAxis.getSlot(r.categoryIx),a=t?this._slotAnchor(t,i):this._defaultAnchor(r,i);this.show({anchor:a,shared:!0,points:e,category:r.category,categoryText:this.formatService.auto(this.options.categoryFormat,r.category),series:this.plotArea.series},this.options)}}_slotAnchor(e,t){return this.plotArea.categoryAxis.options.vertical||(e.x=t.center().x),{point:e,align:{horizontal:`left`,vertical:`center`}}}_defaultAnchor(e,t){let n=e.owner.pane.chartsBox(),r=this.plotArea.categoryAxis.options.vertical,i=n.center(),a=t.center(),o={horizontal:`center`,vertical:`center`},s;return s=r?new X(i.x,a.y):new X(a.x,i.y),{point:s,align:o}}};Y(Hy,{categoryFormat:`{0:d}`});var Uy=class extends ta{setup(){let{element:e,options:t}=this;if(t.duration=t.duration===void 0?t.motionConfig.steady:t.duration,t.easing=t.motionConfig[t.easing]||[],e.bbox()){this.origin=t.origin;let n=t.vertical?`y`:`x`,r=this.fromScale=new M(1,1);r[n]=Zh,e.transform(P().scale(r.x,r.y))}else this.abort()}step(e){let t=Wd(this.fromScale.x,1,e),n=Wd(this.fromScale.y,1,e);this.element.transform(P().scale(t,n,this.origin))}abort(){super.abort(),this.element.transform(null)}};Y(Uy,{motionConfig:{}}),Zi.current.register(`bar`,Uy);var Wy=class extends ta{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig.easeOutElastic||[];let t=this.center=this.element.bbox().center();this.element.transform(P().scale(Zh,Zh,t))}step(e){this.element.transform(P().scale(e,e,this.center))}};Y(Wy,{motionConfig:{}}),Zi.current.register(ag,Wy);var Gy=class extends ta{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.rapid:e.duration,e.easing=e.motionConfig.linear||[],this.fadeTo=this.element.opacity(),this.element.opacity(0)}step(e){this.element.opacity(e*this.fadeTo)}};Y(Gy,{motionConfig:{}}),Zi.current.register(Yh,Gy);var Ky=class extends ta{setup(){let e=this.options;e.duration=e.duration===void 0?e.motionConfig.steady:e.duration,e.easing=e.motionConfig.easeOutElastic||[],this.element.transform(P().scale(Zh,Zh,this.options.center))}step(e){this.element.transform(P().scale(e,e,this.options.center))}};Y(Ky,{motionConfig:{}}),Zi.current.register(`pie`,Ky);var qy=class extends av{render(){super.render(),this.renderSegments()}createSegment(e,t,n){let r=t.style,i;return i=r===`smooth`?F_:j_,new i(e,t,n)}animationPoints(){return super.animationPoints().concat(this._segments)}createMissingValue(e,t){if(t===`zero`){let t={x:e.x,y:e.y};return v_(t.x)||(t.x=0),v_(t.y)||(t.y=0),t}}};H(qy.prototype,I_);function Jy(e,t,n){let r=[],{xMin:i,xMax:a}=t,o=(n||{}).forecast;o&&(o.before>0&&(i-=o.before),o.after>0&&(a+=o.after));let s=(n||{}).samplingInterval,c=J(s,A(i,a)/10);s<=0&&(c=a-i);for(let t=i;t<=a;t+=c)r.push([t,e(t)]);return r}function Yy(e){let{options:t,seriesValues:n}=e,r=Zy({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let Xy=e=>({valueFields:t})=>({xValue:t.x,yValue:Math.log(t[e])});function Zy({seriesValues:e,options:t}){let n=e();if(!Gv(n,t.field))return null;let{slope:r,intercept:i,count:a,xMin:o,xMax:s}=Wv(n,Xy(t.field)),c={xMin:o,xMax:s};if(a>0){let e=Math.exp(i),n=r;return Jy(t=>e*Math.exp(n*t),c,t.trendline)}return null}let Qy=e=>({valueFields:t})=>({xValue:t.x,yValue:t[e]});function $y(e){let{options:t,seriesValues:n}=e,r=eb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}function eb({seriesValues:e,options:t}){let{slope:n,intercept:r,count:i,xMin:a,xMax:o}=Wv(e(),Qy(t.field));return i>0?Jy(e=>n*e+r,{xMin:a,xMax:o},t.trendline):null}function tb(e,t){let n=Number.MAX_VALUE,r=Number.MIN_VALUE;for(let i=0;i<e.length;i++){let a=e[i],{xValue:o,yValue:s}=t(a);isFinite(o)&&o!==null&&isFinite(s)&&s!==null&&(n=Math.min(o,n),r=Math.max(o,r))}return{xMin:n,xMax:r}}function nb(e){let{options:t,seriesValues:n}=e,r=ab({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let rb=e=>({valueFields:t})=>({xValue:t.x,yValue:t[e]}),ib=e=>({valueFields:t})=>({xValue:Math.log(t.x),yValue:t[e]});function ab({seriesValues:e,options:t}){let n=e();if(!Gv(n,`x`))return null;let{slope:r,intercept:i,count:a}=Wv(n,ib(t.field)),o=tb(n,rb(t.field));if(a>0){let e=r,n=i;return Jy(t=>e*Math.log(t)+n,o,t.trendline)}return null}function ob(e){let{options:t}=e,n=sb(e);return n?Object.assign({},t,{type:`scatterLine`,data:n}):null}function sb({options:e,seriesValues:t}){let n=(e.trendline||{}).period||2,r=ny(t({before:n,after:n}),Qy(e.field),n);return r.length>0?r:null}function cb(e){let{options:t,seriesValues:n}=e,r=lb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}function lb({seriesValues:e,options:t}){let n=(t.trendline||{}).order,r=Qy(t.field),{count:i,valueMapper:a,xMin:o,xMax:s}=sy(e(),r,n);return i>0?Jy(a,{xMin:o,xMax:s},t.trendline):null}function ub(e){let{options:t,seriesValues:n}=e,r=fb({seriesValues:n,options:t});return r?Object.assign({},t,{type:`scatterLine`,data:r}):null}let db=e=>({valueFields:t})=>({xValue:Math.log(t.x),yValue:Math.log(t[e])});function fb({seriesValues:e,options:t}){let n=e();if(!Gv(n,`x`))return null;let{slope:r,intercept:i,count:a}=Wv(n,db(t.field)),o=tb(n,Qy(t.field));if(a>0){let e=Math.exp(i),n=r;return Jy(t=>e*t**+n,o,t.trendline)}return null}let pb={};pb[Pg]=Yy,pb[Fg]=$y,pb[Ig]=nb,pb[Lg]=ob,pb[Rg]=cb,pb[zg]=ub;var mb=class extends bv{initFields(){this.namedXAxes={},this.namedYAxes={},this.xAxisRangeTracker=new W_,this.yAxisRangeTracker=new W_}render(e=this.panes){this.series=[...this.originalSeries],this.createTrendlineSeries();let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);a&&(this.createScatterChart(m_(a,Tg),r),this.createScatterLineChart(m_(a,Eg),r),this.createBubbleChart(m_(a,ag),r))}this.createAxes(e)}appendChart(e,t){this.xAxisRangeTracker.update(e.xAxisRanges),this.yAxisRangeTracker.update(e.yAxisRanges),super.appendChart(e,t)}removeAxis(e){let t=e.options.name;super.removeAxis(e),e.options.vertical?(this.yAxisRangeTracker.reset(t),delete this.namedYAxes[t]):(this.xAxisRangeTracker.reset(t),delete this.namedXAxes[t]),e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY}seriesPaneName(e){let t=this.options,n=e.xAxis,r=[].concat(t.xAxis),i=Vd(r,function(e){return e.name===n})[0],a=e.yAxis,o=[].concat(t.yAxis),s=Vd(o,function(e){return e.name===a})[0],c=(t.panes||[{}])[0].name||`default`;return(i||{}).pane||(s||{}).pane||c}createScatterChart(e,t){e.length>0&&this.appendChart(new av(this,{series:e,clip:t.options.clip}),t)}createScatterLineChart(e,t){e.length>0&&this.appendChart(new qy(this,{series:e,clip:t.options.clip}),t)}createBubbleChart(e,t){e.length>0&&this.appendChart(new sv(this,{series:e,clip:t.options.clip}),t)}createXYAxis(e,t,n){let r=e.name,i=t?this.namedYAxes:this.namedXAxes,a=t?this.yAxisRangeTracker:this.xAxisRangeTracker,o=H({reverse:!t&&this.chartService.rtl},e,{vertical:t}),s=f_(o.type,`log`),c=a.query(),l=s?{min:.1,max:1}:{min:0,max:1},u=a.query(r)||c||l,d=[o.min,o.max],f=this.series;for(let e=0;e<f.length;e++){let r=f[e],i=r[t?`yAxis`:`xAxis`];if(i===o.name||n===0&&!i){let e=Wh.current.bindPoint(r,0).valueFields;d.push(e[t?`y`:`x`]);break}}n===0&&c&&(u.min=Math.min(u.min,c.min),u.max=Math.max(u.max,c.max));let p;for(let e=0;e<d.length;e++)if(d[e]instanceof Date){p=!0;break}let m;m=f_(o.type,`date`)||!o.type&&p?_h:s?xh:uh;let h=new m(u.min,u.max,o,this.chartService);if(h.axisIndex=n,r){if(i[r])throw Error(`${t?`Y`:`X`} axis with name ${r} is already defined`);i[r]=h}return this.appendAxis(h),h}createAxes(e){let t=this.options,n=[].concat(t.xAxis),r=[],i=[].concat(t.yAxis),a=[];for(let t=0;t<n.length;t++)W(this.findPane(n[t].pane),e)&&r.push(this.createXYAxis(n[t],!1,t));for(let t=0;t<i.length;t++)W(this.findPane(i[t].pane),e)&&a.push(this.createXYAxis(i[t],!0,t));this.axisX=this.axisX||r[0],this.axisY=this.axisY||a[0]}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axes,o=a.length,s=[],c=[];for(let e=0;e<o;e++){let t=a[e],n=t.options.vertical?c:s,r=t.getValue(i);r!==null&&n.push(r)}s.length>0&&c.length>0&&e.trigger(n,{element:rf(t),originalEvent:t,x:b_(s),y:b_(c)})}updateAxisOptions(e,t){let n=e.options.vertical,r=this.groupAxes(this.panes),i=(n?r.y:r.x).indexOf(e);hb(this.options,i,n,t),hb(this.originalOptions,i,n,t)}trendlineFactory(e,t){let n=this.seriesValues.bind(this,t.index),r=Uv(pb,e.type,{options:e,seriesValues:n});return r&&(r.xAxis=t.xAxis,r.yAxis=t.yAxis),r}seriesValues(e){let t=[],n=this.series[e];for(let e=0;e<n.data.length;e++){let r=this.bindPoint(n,e);t.push({pointIx:e,valueFields:r.valueFields})}return t}};function hb(e,t,n,r){let i=[].concat(n?e.yAxis:e.xAxis)[t];H(i,r)}Y(mb,{xAxis:{},yAxis:{}}),H(mb.prototype,Ev);var gb=class extends Q{constructor(e,t,n){super(n),this.value=e,this.sector=t}render(){this._rendered||this.visible===!1||(this._rendered=!0,this.createLabel())}createLabel(){let e=this.options.labels,t=this.owner.chartService,n=this.getLabelText(e);if(e.visible&&(n||n===0)){if(e.position===`center`||e.position===`insideEnd`)e.color||=Tf(this.options.color),e.background||=this.options.color;else{let n=t.theme.seriesDefaults.labels;e.color=e.color||n.color,e.background=e.background||n.background}this.label=new em(n,H({},e,{align:S,vAlign:``,animation:{type:Yh,delay:this.animationDelay}}),this.pointData()),this.append(this.label)}}getLabelText(e){let t=Id(e);return t?t(this.pointData()):this.owner.chartService.format.auto(e.format,this.value)}reflow(e){this.render(),this.box=e,this.reflowLabel()}reflowLabel(){let{options:{labels:e},label:t}=this,n=this.sector.clone(),r=e.distance,i=n.middle();if(t){let a=t.box.height(),o=t.box.width(),s;if(e.position===`center`)n.radius=Math.abs((n.radius-a)/2)+a,s=n.point(i),t.reflow(new Z(s.x,s.y-a/2,s.x,s.y));else if(e.position===`insideEnd`)n.radius-=a/2,s=n.point(i),t.reflow(new Z(s.x,s.y-a/2,s.x,s.y));else{let e;s=n.clone().expand(r).point(i),s.x>=n.center.x?(e=s.x+o,t.orientation=O):(e=s.x-o,t.orientation=E),t.reflow(new Z(e,s.y-a,s.x,s.y))}}}createVisual(){let{sector:e,options:t}=this;if(super.createVisual(),this.addAccessibilityAttributesToVisual(),this.value)if(t.visual){let n=(e.startAngle+180)%360,r=t.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new M(e.center.x,e.center.y),radius:e.radius,innerRadius:e.innerRadius,startAngle:n,endAngle:n+e.angle,options:t,sender:this.getSender(),createVisual:()=>{let e=new I;return this.createSegmentVisual(e),e}});r&&this.visual.append(r)}else this.createSegmentVisual(this.visual)}createSegmentVisual(e){let{sector:t,options:n}=this,r=n.border||{},i=r.width>0?{stroke:{color:r.color,width:r.width,opacity:r.opacity,dashType:r.dashType}}:{},a=n.color,o=Bp(n.pattern,{color:a,opacity:n.opacity}),s=this.createSegment(t,H({fill:o,stroke:{opacity:n.opacity},zIndex:n.zIndex},i));e.append(s),__(n)&&e.append(this.createGradientOverlay(s,{baseColor:a,fallbackFill:o},H({center:[t.center.x,t.center.y],innerRadius:t.innerRadius,radius:t.radius,userSpace:!0},n.overlay)))}createSegment(e,t){return t.singleSegment?new Rn(new jn(new M(e.center.x,e.center.y),e.radius),t):Mp.current.createRing(e,t)}createAnimation(){let{options:e,sector:{center:t}}=this;H(e,{animation:{center:[t.x,t.y],delay:this.animationDelay}}),super.createAnimation()}createHighlight(e){let t=this.options.highlight||{},n=t.border||{};return this.createSegment(this.sector,H({},e,{fill:{color:t.color,opacity:t.opacity},stroke:{opacity:n.opacity,width:n.width,color:n.color,dashType:n.dashType}}))}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){let e=this.sector;return{options:this.options,radius:e.radius,innerRadius:e.innerRadius,center:new M(e.center.x,e.center.y),startAngle:e.startAngle,endAngle:e.angle+e.startAngle,visual:this.visual}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width,n=this.createSegment(this.sector,H({},e,{stroke:{width:t*2}})),r=new Hr;return r.paths.push(F.fromRect(n.bbox())),r.paths.push(this.createSegment(this.sector,{})),n.clip(r),n}tooltipAnchor(){let e=this.sector.clone().expand(5),t=e.middle();return{point:e.point(t),align:yb(t+180)}}formatValue(e){return this.owner.formatPointValue(this,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}};let _b=q(cf(30),10),vb=q(cf(60),10);function yb(e){let t=cf(e),n=q(Math.sin(t),10),r=q(Math.cos(t),10),i;i=Math.abs(n)>vb?S:r<0?O:E;let a;return a=Math.abs(n)<_b?S:n<0?x:`top`,{horizontal:i,vertical:a}}Y(gb,{color:k,overlay:{gradient:`roundedBevel`},border:{width:.5},labels:{visible:!1,distance:35,font:ee,margin:U(.5),align:C,zIndex:1,position:e_},animation:{type:`pie`},highlight:{visible:!0,border:{width:1}},visible:!0,accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}}),H(gb.prototype,O_),H(gb.prototype,K_);let bb={createLegendItem:function(e,t,n){let r=this.options.legend||{},i=r.labels||{},a=r.inactiveItems||{},o=a.labels||{};if(n&&n.visibleInLegend!==!1){let r=n.visible!==!1,s=r?Id(i):Id(o)||Id(i),c=n.category;s&&(c=s({text:c,series:n.series,dataItem:n.dataItem,percentage:n.percentage,value:e}));let l,u;r?(l={},u=t.color):(l={color:o.color,font:o.font},u=(a.markers||{}).color),v_(c)&&c!==``&&this.legendItems.push({active:r,pointIndex:n.index,text:c,series:n.series,markerColor:u,pattern:t.pattern,labels:l})}}};var xb=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.legendItems=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}traverseDataPoints(e){let{options:t,plotArea:{options:{seriesColors:n=[]}}}=this,r=n.length,i=t.series,a=i.length;for(let o=0;o<a;o++){let s=i[o],c=s.data,{total:l,points:u,count:d}=u_(s),f=360/l,p;isFinite(f)||(p=360/d);let m;m=G(s.startAngle)?s.startAngle:t.startAngle,o!==a-1&&s.labels.position===`outsideEnd`&&(s.labels.position=S);for(let t=0;t<u.length;t++){let i=u[t];if(!i)continue;let{fields:d,value:h,visible:g}=i,_=h===0?0:p||h*f,v=c.length!==1&&!!d.explode;Ed(s.color)||(s.color=d.color||n[t%r]),e(h,new Ap(null,0,0,m,_),{owner:this,category:G(d.category)?d.category:``,pattern:G(d.pattern)?d.pattern:s.pattern,index:t,series:s,seriesIx:o,dataItem:c[t],percentage:l===0?0:h/l,explode:v,visibleInLegend:d.visibleInLegend,visible:g,zIndex:a-o,animationDelay:this.animationDelay(t,o,a)}),g!==!1&&(m+=_)}}}evalSegmentOptions(e,t,n){let r=n.series;p_(e,{value:t,series:r,dataItem:n.dataItem,category:n.category,percentage:n.percentage},{defaults:r._defaults,excluded:[`data`,`content`,`template`,`visual`,`toggle`,`ariaTemplate`,`ariaContent`]})}addValue(e,t,n){let r=H({},n.series,{index:n.index});if(r.pattern=n.pattern||r.pattern,this.evalSegmentOptions(r,e,n),this.createLegendItem(e,r,n),n.visible===!1)return;let i=new gb(e,t,r);Object.assign(i,n),this.append(i),this.points.push(i)}reflow(e){let{options:t,points:n,seriesConfigs:r=[]}=this,i=n.length,a=e.clone(),o=Math.min(a.width(),a.height()),s=o/2,c=o-o*.85,l=new Z(a.x1,a.y1,a.x1+o,a.y1+o),u=l.center(),d=a.center(),f=t.series.length,p=[],m=[],h=J(t.padding,c);this.targetBox=e,h=h>s-5?s-5:h,l.translate(d.x-u.x,d.y-u.y);let g=s-h,_=new X(g+l.x1+h,g+l.y1+h);for(let e=0;e<i;e++){let t=n[e],i=t.sector,a=t.seriesIx;if(i.radius=g,i.center=_,r.length){let e=r[a];i.innerRadius=e.innerRadius,i.radius=e.radius}a===f-1&&t.explode&&(i.center=i.clone().setRadius(i.radius*.15).point(i.middle())),t.reflow(l);let o=t.label;o&&o.options.position===`outsideEnd`&&a===f-1&&(o.orientation===`right`?m.push(o):p.push(o))}p.length>0&&(p.sort(this.labelComparator(!0)),this.leftLabelsReflow(p)),m.length>0&&(m.sort(this.labelComparator(!1)),this.rightLabelsReflow(m)),this.box=l}leftLabelsReflow(e){let t=this.distanceBetweenLabels(e);this.distributeLabels(t,e)}rightLabelsReflow(e){let t=this.distanceBetweenLabels(e);this.distributeLabels(t,e)}distanceBetweenLabels(e){let t=of(this.points),n=t.sector,r=e.length-1,i=n.radius+t.options.labels.distance,a=[],o=e[0].box,s=q(o.y1-(n.center.y-i-o.height()-o.height()/2));a.push(s);for(let t=0;t<r;t++){let n=e[t+1].box;o=e[t].box,s=q(n.y1-o.y2),a.push(s)}return s=q(n.center.y+i-e[r].box.y2-e[r].box.height()/2),a.push(s),a}distributeLabels(e,t){let n=e.length,r,i,a;for(let t=0;t<n;t++)for(a=-e[t],r=i=t;a>0&&(r>=0||i<n);)a=this._takeDistance(e,t,--r,a),a=this._takeDistance(e,t,++i,a);this.reflowLabels(e,t)}_takeDistance(e,t,n,r){let i=r;if(e[n]>0){let r=Math.min(e[n],i);i-=r,e[n]-=r,e[t]+=r}return i}reflowLabels(e,t){let n=of(this.points),r=n.sector,i=n.options.labels,a=t.length,o=i.distance,s=r.center.y-(r.radius+o)-t[0].box.height(),c;e[0]+=2;for(let n=0;n<a;n++){let a=t[n],l=a.box;s+=e[n],c=this.hAlignLabel(l.x2,r.clone().expand(o),s,s+l.height(),a.orientation===O),a.orientation===`right`?(i.align!==`circle`&&(c=r.radius+r.center.x+o),a.reflow(new Z(c+l.width(),s,c,s))):(i.align!==`circle`&&(c=r.center.x-r.radius-o),a.reflow(new Z(c-l.width(),s,c,s))),s+=l.height()}}createVisual(){let{options:{connectors:e},points:t}=this,n=t.length;super.createVisual(),this._connectorLines=[];for(let r=0;r<n;r++){let n=t[r],{sector:i,label:a}=n,o=i.middle(),s=(n.options.connectors||{}).color||e.color;if(a){let t=new F({stroke:{color:s,width:e.width},animation:{type:Yh,delay:n.animationDelay}});if(a.options.position===`outsideEnd`){let r=a.box,s=i.center,c=i.point(o),l=new X(r.x1,r.center().y),u,d,f;c=i.clone().expand(e.padding).point(o),t.moveTo(c.x,c.y),a.orientation===`right`?(d=new X(r.x1-e.padding,r.center().y),f=Sb(s,c,l,d),l=new X(d.x-4,d.y),f||=l,f.x=Math.min(f.x,l.x),this.pointInCircle(f,i.center,i.radius+4)||f.x<i.center.x?(u=i.center.x+i.radius+4,n.options.labels.align===`column`||u<l.x?t.lineTo(u,c.y):t.lineTo(c.x+8,c.y),t.lineTo(l.x,d.y)):(f.y=d.y,t.lineTo(f.x,f.y))):(d=new X(r.x2+e.padding,r.center().y),f=Sb(s,c,l,d),l=new X(d.x+4,d.y),f||=l,f.x=Math.max(f.x,l.x),this.pointInCircle(f,i.center,i.radius+4)||f.x>i.center.x?(u=i.center.x-i.radius-4,n.options.labels.align===`column`||u>l.x?t.lineTo(u,c.y):t.lineTo(c.x-8,c.y),t.lineTo(l.x,d.y)):(f.y=d.y,t.lineTo(f.x,f.y))),t.lineTo(d.x,d.y),this._connectorLines.push(t),this.visual.append(t)}}}}renderVisual(){if(super.renderVisual(),yf(this.options.series,e=>e.autoFit)){let e=this.targetBox,t=this.box.center(),n=this.visual.bbox();if(!n)return;let r=n.bottomRight(),i=Math.min((t.y-e.y1)/(t.y-n.origin.y),(e.y2-t.y)/(r.y-t.y),(t.x-e.x1)/(t.x-n.origin.x),(e.x2-t.x)/(r.x-t.x));i<1&&this.visual.transform(P().scale(i,i,[t.x,t.y]))}}labelComparator(e){let t=e?-1:1;return function(e,n){return((e.parent.sector.middle()+270)%360-(n.parent.sector.middle()+270)%360)*t}}hAlignLabel(e,t,n,r,i){let{radius:a,center:{x:o,y:s}}=t,c=Math.min(Math.abs(s-n),Math.abs(s-r));return c>a?e:o+Math.sqrt(a*a-c*c)*(i?1:-1)}pointInCircle(e,t,n){return(t.x-e.x)**2+(t.y-e.y)**2<n**2}formatPointValue(e,t){return this.chartService.format.auto(t,e.value)}animationDelay(e){return e*70}stackRoot(){return this}};function Sb(e,t,n,r){let i=(r.x-n.x)*(e.y-n.y)-(r.y-n.y)*(e.x-n.x),a=(r.y-n.y)*(t.x-e.x)-(r.x-n.x)*(t.y-e.y),o;if(a!==0){let n=i/a;o=new X(e.x+n*(t.x-e.x),e.y+n*(t.y-e.y))}return o}Y(xb,{startAngle:90,connectors:{width:2,color:`#939393`,padding:8},inactiveItems:{markers:{},labels:{}}}),H(xb.prototype,bb),xb.prototype.isStackRoot=!0;var Cb=class extends bv{render(){this.createPieChart(this.series)}createPieChart(e){let t=e[0],n=new xb(this,{series:e,padding:t.padding,startAngle:t.startAngle,connectors:t.connectors,legend:this.options.legend});this.appendChart(n)}appendChart(e,t){super.appendChart(e,t),Zd(this.options.legend.data,e.legendItems)}getPointBelow(e){return this.getPointToTheRight(e)}getPointAbove(e){return this.getPointToTheLeft(e)}},wb=class extends gb{reflowLabel(){let{options:{labels:e},label:t}=this,n=this.sector.clone(),r=n.middle();if(t){let i=t.box.height();if(e.position===`center`){n.radius-=(n.radius-n.innerRadius)/2;let e=n.point(r);t.reflow(new Z(e.x,e.y-i/2,e.x,e.y))}else super.reflowLabel()}}createSegment(e,t){return Mp.current.createRing(e,t)}};Y(wb,{overlay:{gradient:`roundedGlass`},labels:{position:S},animation:{type:`pie`}}),H(wb.prototype,O_);var Tb=class extends xb{addValue(e,t,n){let r=H({},n.series,{index:n.index});if(r.pattern=n.pattern||r.pattern,this.evalSegmentOptions(r,e,n),this.createLegendItem(e,r,n),n.visible===!1)return;let i=new wb(e,t,r);Object.assign(i,n),this.append(i),this.points.push(i)}reflow(e){let t=this.options,n=e.clone(),r=Math.min(n.width(),n.height()),i=r/2,a=r-r*.85,o=t.series,s=o.length,c=J(t.padding,a);c=c>i-5?i-5:c;let l=i-c,u=0,d;for(let e=0;e<s;e++){let t=o[e];e===0&&G(t.holeSize)&&(d=t.holeSize,l-=t.holeSize),G(t.size)?l-=t.size:u++,G(t.margin)&&e!==s-1&&(l-=t.margin)}G(d)||(d=(i-c)/(s+.75)*.75,l-=d);let f=d,p=0,m,h;this.seriesConfigs=[];for(let e=0;e<s;e++){let t=o[e];m=J(t.size,l/u),f+=p,h=f+m,this.seriesConfigs.push({innerRadius:f,radius:h}),p=t.margin||0,f=h}super.reflow(e)}animationDelay(e,t,n){return e*50+600*(t+1)/(n+1)}};Y(Tb,{startAngle:90,connectors:{width:2,color:`#939393`,padding:8}});var Eb=class extends Cb{render(){this.createDonutChart(this.series)}createDonutChart(e){let t=e[0],n=new Tb(this,{series:e,padding:t.padding,connectors:t.connectors,legend:this.options.legend});this.appendChart(n)}getPointBelow(e){return this._getNextPoint(e,this._pointsByVertical,-1)}getPointAbove(e){return this._getNextPoint(e,this._pointsByVertical,1)}},Db=class extends bv{initFields(){this.valueAxisRangeTracker=new W_}render(){this.addToLegend(this.series),this.createPolarAxis(),this.createCharts(),this.createValueAxis()}alignAxes(){let e=this.valueAxis,t=e.range(),n=e.options.reverse?t.max:t.min,r=e.getSlot(n),i=this.polarAxis.getSlot(0).center,a=e.box.translate(i.x-r.x1,i.y-r.y1);e.reflow(a)}createValueAxis(){let e=this.valueAxisRangeTracker.query(),t=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1}),n,r;t.type===`log`?(n=Nh,r={min:.1,max:1}):(n=Mh,r={min:0,max:1});let i=e||r,a=new n(i.min,i.max,t,this.chartService);this.valueAxis=a,this.appendAxis(a)}reflowAxes(){let{options:{plotArea:e},valueAxis:t,polarAxis:n,box:r}=this,i=Math.min(r.width(),r.height())*.15,a=U(e.padding||{},i),o=r.clone().unpad(a),s=o.clone();s.y2=s.y1+Math.min(s.width(),s.height()),s.align(o,`y`,S);let c=s.clone().shrink(0,s.height()/2);n.reflow(s),t.reflow(c);let l=t.lineBox().height()-t.box.height();t.reflow(t.box.unpad({top:l})),this.axisBox=s,this.alignAxes(s)}backgroundBox(){return this.box}detachLabels(){}},Ob=class extends av{pointSlot(e,t){let n=e.center.y-t.y1,r=X.onCircle(e.center,e.startAngle,n);return new Z(r.x,r.y,r.x,r.y)}};Y(Ob,{clip:!1});var kb=class extends qy{};kb.prototype.pointSlot=Ob.prototype.pointSlot,Y(kb,{clip:!1});var Ab=class extends H_{fillToAxes(e){let t=this._polarAxisCenter();e.lineTo(t.x,t.y)}_polarAxisCenter(){return this.parent.plotArea.polarAxis.box.center()}strokeSegments(){let e=this._strokeSegments;if(!e){let t=this._polarAxisCenter(),n=new Fh(!1),r=this.points();r.push(t),e=this._strokeSegments=n.process(r),e.pop()}return e}},jb=class extends B_{fillToAxes(e){let t=this.parent.plotArea.polarAxis.box.center(),n=new fr([t.x,t.y]);e.segments.unshift(n),e.segments.push(n)}},Mb=class extends kb{createSegment(e,t,n){let r=(t.line||{}).style,i;return i=r===`smooth`?new Ab(e,t,n):new jb(e,t,n),i}createMissingValue(e,t){let n;return v_(e.x)&&t!==`interpolate`&&(n={x:e.x,y:e.y},t===`zero`&&(n.y=0)),n}seriesMissingValues(e){return e.missingValues||`zero`}_hasMissingValuesGap(){let e=this.options.series;for(let t=0;t<e.length;t++)if(this.seriesMissingValues(e[t])===`gap`)return!0}sortPoints(e){if(e.sort(Nb),this._hasMissingValuesGap())for(let t=0;t<e.length;t++){let n=e[t];if(n){let r=n.value;!v_(r.y)&&this.seriesMissingValues(n.series)===`gap`&&delete e[t]}}return e}};function Nb(e,t){return e.value.x-t.value.x}var Pb=class extends Db{createPolarAxis(){let e=new kh(this.options.xAxis,this.chartService);this.polarAxis=e,this.axisX=e,this.appendAxis(e)}render(){this.series=[...this.originalSeries],this.createTrendlineSeries(),super.render()}valueAxisOptions(e){return H(e,{majorGridLines:{type:`arc`},minorGridLines:{type:`arc`}},this.options.yAxis)}createValueAxis(){super.createValueAxis(),this.axisY=this.valueAxis}trendlineFactory(e,t){let n=mb.prototype.trendlineFactory.call(this,e,t);return n&&(n.type=_g),n}appendChart(e,t){this.valueAxisRangeTracker.update(e.yAxisRanges),bv.prototype.appendChart.call(this,e,t)}createCharts(){let e=this.filterVisibleSeries(this.series),t=this.panes[0];this.createLineChart(m_(e,[_g]),t),this.createScatterChart(m_(e,[vg]),t),this.createAreaChart(m_(e,[gg]),t)}createLineChart(e,t){if(e.length===0)return;let n=new kb(this,{series:e});this.appendChart(n,t)}createScatterChart(e,t){if(e.length===0)return;let n=new Ob(this,{series:e});this.appendChart(n,t)}createAreaChart(e,t){if(e.length===0)return;let n=new Mb(this,{series:e});this.appendChart(n,t)}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axisX.getValue(i),o=this.axisY.getValue(i);a!==null&&o!==null&&e.trigger(n,{element:rf(t),x:a,y:o})}createCrosshairs(){}};Y(Pb,{xAxis:{},yAxis:{}}),H(Pb.prototype,Ev,{seriesValues:mb.prototype.seriesValues});function Fb(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[r.seriesIx]=t[r.seriesIx]||[],t[r.seriesIx].push(r)}return t}var Ib=class extends z_{pointSlot(e,t){let n=e.center.y-t.y1,r=X.onCircle(e.center,e.middle(),n);return new Z(r.x,r.y,r.x,r.y)}renderSegments(){if(super.renderSegments(),this._segments&&this._segments.length>1){let e=Fb(this._segments);for(let t=0;t<e.length;t++){let n=e[t];if(n&&n.length>1){let e=n[0].linePoints[0],t=of(n),r=of(t.linePoints),i=e.categoryIx===0,a=r.categoryIx===r.categoriesCount-1;i&&a&&of(n).linePoints.push(e)}}}}createSegment(e,t,n){let r=t.style,i;i=r===`smooth`?F_:j_;let a=new i(e,t,n),o=this.seriesMissingValues(t);return(e.length===t.data.length||o===`interpolate`)&&(a.options.closed=!0),a}};Y(Ib,{clip:!1,limitPoints:!1});var Lb=class extends H_{fillToAxes(){}},Rb=class extends B_{fillToAxes(){}},zb=class extends Ib{createSegment(e,t,n,r){let i=this.options.isStacked,a=(t.line||{}).style,o,s,c;return i&&n>0&&r&&(s=r.linePoints.slice(0),o=r),a===`smooth`?(c=new Lb(e,t,n,o,s),c.options.closed=!0):(e.push(e[0]),c=new Rb(e,t,n,o,s)),c}seriesMissingValues(e){return e.missingValues||`zero`}},Bb=class extends wb{constructor(e,t){super(e,null,t)}getIndex(){return this.categoryIx}};Y(Bb,{overlay:{gradient:`none`},labels:{distance:10}});var Vb=class extends Q{constructor(e){super(e),this.forEach=e.rtl?Y_:J_}reflow(e){let{options:t,children:n}=this,{gap:r,spacing:i}=t,a=n.length,o=a+r+i*(a-1),s=e.angle/o,c=e.startAngle+r/2*s;this.forEach(n,t=>{let n=e.clone();n.startAngle=c,n.angle=s,t.sector&&(n.radius=t.sector.radius),t.reflow(n),t.sector=n,c+=s+s*i})}};Y(Vb,{gap:1,spacing:0});var Hb=class extends Q{reflow(e){let{options:{reverse:t},children:n}=this,r=n.length,i=t?r-1:0,a=t?-1:1;this.box=new Z;for(let t=i;t>=0&&t<r;t+=a){let r=n[t].sector;r.startAngle=e.startAngle,r.angle=e.angle}}},Ub=class extends Q_{pointType(){return Bb}clusterType(){return Vb}stackType(){return Hb}categorySlot(e,t){return e.getSlot(t)}pointSlot(e,t){let n=e.clone(),r=e.center.y;return n.radius=r-t.y1,n.innerRadius=r-t.y2,n}reflowPoint(e,t){e.sector=t,e.reflow()}createAnimation(){this.options.animation.center=this.box.toRect().center(),super.createAnimation()}};Ub.prototype.reflow=D_.prototype.reflow,Y(Ub,{clip:!1,limitPoints:!1,animation:{type:`pie`}});var Wb=class extends Db{createPolarAxis(){let e=new Oh(this.options.categoryAxis,this.chartService);this.polarAxis=e,this.categoryAxis=e,this.appendAxis(e),this.aggregateCategories(),this.createTrendlineSeries(),this.createCategoryAxesLabels()}valueAxisOptions(e){return this._hasBarCharts&&H(e,{majorGridLines:{type:`arc`},minorGridLines:{type:`arc`}}),this._isStacked100&&H(e,{roundToMajorUnit:!1,labels:{format:`P0`}}),H(e,this.options.valueAxis)}aggregateCategories(){vy.prototype.aggregateCategories.call(this,this.panes)}createCategoryAxesLabels(){vy.prototype.createCategoryAxesLabels.call(this,this.panes)}filterSeries(e){return e}trendlineFactory(e,t){let n=vy.prototype.trendlineFactory.call(this,e,t);return n&&(n.type=xg),n}createCharts(){let e=this.filterVisibleSeries(this.series),t=this.panes[0];this.createAreaChart(m_(e,[yg]),t),this.createLineChart(m_(e,[xg]),t),this.createBarChart(m_(e,[bg]),t)}chartOptions(e){let t={series:e},n=e[0];if(n){let r=this.filterVisibleSeries(e),i=n.stack;t.isStacked=i&&r.length>1,t.isStacked100=i&&i.type===`100%`&&r.length>1,t.isStacked100&&(this._isStacked100=!0)}return t}createAreaChart(e,t){if(e.length===0)return;let n=new zb(this,this.chartOptions(e));this.appendChart(n,t)}createLineChart(e,t){if(e.length===0)return;let n=new Ib(this,this.chartOptions(e));this.appendChart(n,t)}createBarChart(e,t){if(e.length===0)return;let n=e[0],r=this.chartOptions(e),i=this.filterVisibleSeries(e),a=i.some(e=>e.stack),o=i.some(e=>e.stack&&e.stack.type===`100%`);r.gap=n.gap,r.spacing=n.spacing,r.defaultStack=n.stack&&i.length>1,r.isStacked=a&&i.length>1,r.isStacked100=o&&i.length>1;let s=new Ub(this,r);this.appendChart(s,t),this._hasBarCharts=!0}seriesCategoryAxis(){return this.categoryAxis}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.categoryAxis.getCategory(i),o=this.valueAxis.getValue(i);a!==null&&o!==null&&e.trigger(n,{element:rf(t),category:a,value:o})}createCrosshairs(){}_pointsByVertical(e){return super._pointsByVertical(e).sort(this._getSeriesCompareFn())}_getSeriesCompareFn(){return(e,t)=>t.value-e.value}};H(Wb.prototype,Ev,{appendChart:vy.prototype.appendChart,aggregateSeries:vy.prototype.aggregateSeries,seriesSourcePoints:vy.prototype.seriesSourcePoints,seriesValues:vy.prototype.seriesValues}),Y(Wb,{categoryAxis:{categories:[]},valueAxis:{}});var Gb=class extends Q{constructor(e,t,n){super(t),this.value=e,this.options.index=n.index}getLabelText(e){let t=Id(e);return t?t(this.pointData()):e.format?this.formatValue(e.format):this.value}reflow(e){let t=this.points,n=this.children[0],r=Math.min(t[0].x,t[3].x),i=Math.max(t[1].x,t[2].x);this.box=new Z(r,t[0].y,i,t[2].y),n&&n.reflow(new Z(e.x1,t[0].y,e.x2,t[2].y))}createVisual(){let e=this.options,t;super.createVisual(),this.addAccessibilityAttributesToVisual(),t=e.visual?e.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:e,sender:this.getSender(),createVisual:()=>this.createPath()}):this.createPath(),t&&this.visual.append(t)}createPath(){let e=this.options,t=e.border;return F.fromPoints(this.points,{fill:Bp(e.pattern,{color:e.color,opacity:e.opacity}),stroke:{color:t.color,opacity:t.opacity,width:t.width}}).close()}createHighlight(e){return F.fromPoints(this.points,e)}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){let e=F.fromPoints(this.points).close();return{options:this.options,path:e}}createFocusHighlight(e){let t=this.options.focusHighlight.border.width,n=F.fromPoints(this.points,H({},e,{stroke:{width:t*2}})).close(),r=new Hr;return r.paths.push(F.fromRect(this.box.clone().pad(t).toRect())),r.paths.push(F.fromPoints(this.points)),n.clip(r),n}tooltipAnchor(){let e=this.box;return{point:new X(e.center().x,e.y1),align:{horizontal:`center`,vertical:`top`}}}formatValue(e){let t=this;return t.owner.formatPointValue(t,e)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}};Y(Gb,{color:k,border:{width:1},labels:{format:``},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}}),H(Gb.prototype,O_),H(Gb.prototype,K_);var Kb=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this.points=[],this.labels=[],this.legendItems=[],this.render()}formatPointValue(e,t){return this.plotArea.chartService.format.auto(t,e.value)}render(){let{options:e,plotArea:{options:{seriesColors:t=[]}}}=this,n=e.series[0],r=n.data;if(!r)return;let{total:i,points:a}=u_(n);for(let e=0;e<a.length;e++){let o=a[e];if(!o)continue;let s=o.fields;Ed(n.color)||(n.color=s.color||t[e%t.length]),s=H({index:e,owner:this,series:n,seriesIx:0,dataItem:r[e],percentage:o.value/i},s,{visible:o.visible});let c=o.valueFields.value,l=this.createSegment(c,s),u=this.createLabel(c,s);l&&u&&l.append(u)}}evalSegmentOptions(e,t,n){let r=n.series;p_(e,{value:t,series:r,dataItem:n.dataItem,index:n.index},{defaults:r._defaults,excluded:[`data`,`content`,`template`,`toggle`,`visual`,`ariaTemplate`,`ariaContent`]})}createSegment(e,t){let n=H({},t.series);if(n.pattern=t.pattern||n.pattern,this.evalSegmentOptions(n,e,t),this.createLegendItem(e,n,t),t.visible!==!1){let r=new Gb(e,n,t);return Object.assign(r,t),this.append(r),this.points.push(r),r}}createLabel(e,t){let{series:n,dataItem:r}=t,i=H({},this.options.labels,n.labels),a=e;if(i.visible){let o=Id(i),s={dataItem:r,value:e,percentage:t.percentage,category:t.category,series:n};o?a=o(s):i.format&&(a=this.chartService.format.auto(i.format,a)),i.color||(i.color=Tf(n.color),i.background||=n.color),this.evalSegmentOptions(i,e,t);let c=new em(a,H({vAlign:i.position},i),s);return this.labels.push(c),c}}labelPadding(){let e=this.labels,t={left:0,right:0};for(let n=0;n<e.length;n++){let r=e[n].options.align;if(r!==`center`){let i=e[n].box.width();r===`left`?t.left=Math.max(t.left,i):t.right=Math.max(t.right,i)}}return t}dynamicSlopeReflow(e,t,n){let{options:r,points:i}=this,a=i.length,o=i[0],s=o;for(let e=0;e<i.length;e++)i[e].percentage>s.percentage&&(s=i[e]);let c=o.percentage/s.percentage*t,l=(t-c)/2,u=0;for(let o=0;o<a;o++){let s=i[o].percentage,d=i[o+1],f=d?d.percentage:s,p=i[o].points=[],m=r.dynamicHeight?n*s:n/a,h;h=s?(t-f/s*c)/2:f?0:t/2,h=K(h,0,t),p.push(new M(e.x1+l,e.y1+u)),p.push(new M(e.x1+t-l,e.y1+u)),p.push(new M(e.x1+t-h,e.y1+m+u)),p.push(new M(e.x1+h,e.y1+m+u)),l=h,u+=m+r.segmentSpacing,c=K(t-2*h,0,t)}}constantSlopeReflow(e,t,n){let{options:r,points:i}=this,a=i.length,o=r.neckRatio<=1,s=o?r.neckRatio*t:t,c=o?0:(t-t/r.neckRatio)/2,l=((o?t:t-c*2)-s)/2,u=0;for(let o=0;o<a;o++){let s=i[o].points=[],d=i[o].percentage,f=r.dynamicHeight?l*d:l/a,p=r.dynamicHeight?n*d:n/a;s.push(new M(e.x1+c,e.y1+u)),s.push(new M(e.x1+t-c,e.y1+u)),s.push(new M(e.x1+t-c-f,e.y1+p+u)),s.push(new M(e.x1+c+f,e.y1+p+u)),c+=f,u+=p+r.segmentSpacing}}reflow(e){let t=this.points,n=t.length;if(!n)return;let r=this.options,i=e.clone().unpad(this.labelPadding()),a=i.height()-r.segmentSpacing*(n-1),o=i.width();r.dynamicSlope?this.dynamicSlopeReflow(i,o,a):this.constantSlopeReflow(i,o,a);for(let r=0;r<n;r++)t[r].reflow(e)}};Y(Kb,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:S,position:S,zIndex:1}}),H(Kb.prototype,bb);var qb=class extends Kb{constructor(e,t){t.dynamicSlope=!1,t.neckRatio=1e6,super(e,t)}},Jb=class extends bv{render(){this.createChart(Kb,m_(this.series,[ug])),this.createChart(qb,m_(this.series,[dg]))}createChart(e,t){let n=t[0];if(!n)return;let r=new e(this,{series:t,legend:this.options.legend,neckRatio:n.neckRatio,dynamicHeight:n.dynamicHeight,dynamicSlope:n.dynamicSlope,segmentSpacing:n.segmentSpacing,highlight:n.highlight});this.appendChart(r)}appendChart(e,t){super.appendChart(e,t),Zd(this.options.legend.data,e.legendItems)}_pointsByVertical(e){return this.pointsBySeriesIndex(e.series.index)}getPointToTheRight(e){return this.getPointBelow(e)}getPointToTheLeft(e){return this.getPointAbove(e)}};let Yb=(e,t=.05)=>{let n=Ue(e),r=1-t;return e=>{let t=n.toHSL(),i=100-t.l,a=r-e;return t.l+=Math.min(a*i,i),t.toCss()}};var Xb=class extends Q{constructor(e,t){super(),this.options=t,this.color=t.color||`#fff`,this.value=e}render(){this._rendered||(this._rendered=!0,this.createMarker(),this.createLabel(),this.createNote())}createLabel(){let e=this.options.labels;e.visible&&(this.label=this.createLabelElement(e),this.append(this.label))}createLabelElement(e){let t=e.color;return t||=Tf(this.color),new em(this.getLabelText(e),H({align:S,vAlign:S,margin:{left:5,right:5},zIndex:J(e.zIndex,this.series.zIndex)},e,{color:t}),this.pointData())}getLabelText(e){let t=Id(e);return t?t(this.pointData()):this.formatValue(e.format)}formatValue(e){return this.owner.formatPointValue(this,e)}reflow(e){this.render();let t=this.label;this.box=e,t&&t.reflow(this.markerBox()),this.note&&this.note.reflow(e),this.marker.reflow(this.markerBox())}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual()}markerBox(){let e=this.options.markers,t=e.border,n=this.box.toRect(),r=J(e.type,`rect`)===`roundedRect`,i=J(t.width,+!!r),a=Math.round(i/2);if(e.size){let t=n.center();n.size.width=n.size.height=e.size,n.origin.x=Math.round(t.x-n.size.width/2),n.origin.y=Math.round(t.y-n.size.height/2)}return n.size.width-=i,n.size.height-=i,n.origin.y+=a+.5,n.origin.x+=a+.5,Qp(n)}markerBorder(){let e=this.options,t=e.markers.border,n=J(t.opacity,e.opacity);return{color:t.color||this.color,width:t.width,opacity:n,dashType:t.dashType}}createMarker(){let e=this.options,t=e.markers,n=new Up({type:J(t.type,`rect`),width:t.size,height:t.size,rotation:t.rotation,background:this.color,border:this.markerBorder(),pattern:e.pattern,borderRadius:t.borderRadius,opacity:this.series.opacity||e.opacity,zIndex:J(e.zIndex,this.series.zIndex),animation:e.animation,visual:e.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});this.marker=n,this.append(n)}createHighlight(e){let t=this.options,n=this.options.highlight.markers||this.options.markers,r=new Up({type:J(n.type,`rect`),width:n.size,height:n.size,rotation:n.rotation,background:n.color||this.color,border:this.markerBorder(),borderRadius:n.borderRadius,opacity:this.series.opacity||t.opacity,zIndex:J(t.zIndex,this.series.zIndex)});r.reflow(this.markerBox());let i=r.getElement();return i.options.fill=e.fill,i.options.stroke=e.stroke,i}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(){let e=this.options.markers,t=this.options.focusHighlight,n=new Up({type:J(e.type,`rect`),width:e.size,height:e.size,rotation:e.rotation,background:t.color,border:t.border,borderRadius:e.borderRadius,padding:t.border.width/2,zIndex:t.zIndex});return n.reflow(this.markerBox()),n.getElement()}tooltipAnchor(){let e=this.box.center().x;return{point:new X(e,this.box.y1-5),align:{horizontal:S,vertical:x}}}overlapsBox(e){return this.box.overlaps(e)}unclipElements(){}pointData(){return{x:this.value.x,y:this.value.y,value:this.value.value,dataItem:this.dataItem,series:this.series}}};H(Xb.prototype,O_),H(Xb.prototype,k_),H(Xb.prototype,K_),Xb.prototype.defaults={markers:{type:`rect`,borderRadius:4,border:{color:`transparent`}},padding:{top:1},labels:{visible:!1,padding:3},opacity:1,notes:{label:{}},accessibility:{role:Xg,className:Zg,ariaRoleDescription:Qg}};var Zb=class extends Q{constructor(e,t){super(t),this.plotArea=e,this.chartService=e.chartService,this._initFields(),this.render()}_initFields(){this.points=[],this.seriesOptions=[],this.valueRange={min:D,max:ne},this._evalSeries=[]}render(){this.setRange(),this.traverseDataPoints(this.addValue.bind(this))}setRange(){let{options:{series:e}}=this;for(let t=0;t<e.length;t++){let n=e[t];for(let e=0;e<n.data.length;e++){let{valueFields:t}=this.plotArea.bindPoint(n,e);G(t.value)&&t.value!==null&&(this.valueRange.min=Math.min(this.valueRange.min,t.value),this.valueRange.max=Math.max(this.valueRange.max,t.value))}}}addValue(e,t){let n;e&&G(e.value)&&e.value!==null&&(n=this.createPoint(e,t),n&&Object.assign(n,t)),this.points.push(n)}evalPointOptions(e,t,n){let{series:r,seriesIx:i}=n,a={defaults:r._defaults,excluded:[`data`,`tooltip`,`content`,`template`,`visual`,`toggle`,`drilldownSeriesFactory`,`ariaTemplate`,`ariaContent`]},o=this._evalSeries[i];G(o)||(this._evalSeries[i]=o=p_(e,{},a,!0));let s=e;return o&&(s=H({},e),p_(s,{value:t,series:r,dataItem:n.dataItem,min:this.valueRange.min,max:this.valueRange.max},a)),s}pointType(){return Xb}pointOptions(e,t){let n=this.seriesOptions[t];if(!n){let r=this.pointType().prototype.defaults;this.seriesOptions[t]=n=H({},r,{markers:{opacity:e.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},e)}return Object.assign({},n)}createPoint(e,t){let n=t.series,r=this.pointOptions(n,t.seriesIx),i=t.color||n.color;r.pattern=t.pattern||r.pattern,r=this.evalPointOptions(r,e,t),Ed(n.color)?i=r.color:this.valueRange.max!==0&&(i=Yb(i)(e.value/this.valueRange.max));let a=new Xb(e,r);return a.color=i,this.append(a),a}seriesAxes(e){let{xAxis:t,yAxis:n}=e,r=this.plotArea,i=t?r.namedXAxes[t]:r.axisX,a=n?r.namedYAxes[n]:r.axisY;if(!i)throw Error(`Unable to locate X axis with name `+t);if(!a)throw Error(`Unable to locate Y axis with name `+n);return{xAxis:i,yAxis:a}}reflow(e){let t=this.points,n=!this.options.clip,r=0;this.traverseDataPoints((e,i)=>{let a=t[r++],{xAxis:o,yAxis:s}=this.seriesAxes(i.series),c=o.categoryIndex(e.x),l=s.categoryIndex(e.y),u=o.getSlot(c,c,n),d=s.getSlot(l,l,n);if(a)if(u&&d){let e=this.pointSlot(u,d);a.reflow(e)}else a.visible=!1}),this.box=e}pointSlot(e,t){return new Z(e.x1,t.y1,e.x2,t.y2)}traverseDataPoints(e){let{options:{series:t}}=this;for(let n=0;n<t.length;n++){let r=t[n],{xAxis:i,yAxis:a}=this.seriesAxes(r),o=i.currentRangeIndices(),s=a.currentRangeIndices();for(let t=0;t<r.data.length;t++){let{valueFields:c,fields:l}=this.plotArea.bindPoint(r,t),u=i.totalIndex(c.x),d=a.totalIndex(c.y),f=o.min<=u&&u<=o.max,p=s.min<=d&&d<=s.max;f&&p&&e(c,H({pointIx:t,series:r,seriesIx:n,dataItem:r.data[t],owner:this},l))}}}formatPointValue(e,t){let n=e.value;return this.chartService.format.auto(t,n.x,n.y,n.value)}animationPoints(){let e=this.points,t=[];for(let n=0;n<e.length;n++)t.push((e[n]||{}).marker);return t}};Y(Zb,{series:[],tooltip:{format:`{0}, {1}: {2}`},labels:{format:`{2}`},clip:!0});var Qb=class extends bv{initFields(){this.namedXAxes={},this.namedYAxes={}}render(e=this.panes){this.bindCategories(),this.createAxes(e),this.createCharts(e),this.createAxisLabels()}bindCategories(){let e=this.srcSeries||this.series;for(let t=0;t<e.length;t++){let n=e[t],r=n.data||[],{xAxis:i,yAxis:a}=this.seriesAxes(n),o=Af(i.categories||[]),s=Af(a.categories||[]);for(let e=0;e<r.length;e++){let{x:t,y:r}=Wh.current.bindPoint(n,e).valueFields;o.has(t)||o.add(t),s.has(r)||s.add(r)}i.categories=o.values(),a.categories=s.values()}}createCharts(e){let t=this.groupSeriesByPane();for(let n=0;n<e.length;n++){let r=e[n],i=t[r.options.name||`default`]||[];this.addToLegend(i);let a=this.filterVisibleSeries(i);a&&this.createHeatmapChart(m_(a,[fg]),r)}}createHeatmapChart(e,t){let n=new Zb(this,{series:e});this.appendChart(n,t)}seriesPaneName(e){let t=this.options,n=e.xAxis,r=[].concat(t.xAxis),i=Vd(r,function(e){return e.name===n})[0],a=e.yAxis,o=[].concat(t.yAxis),s=Vd(o,function(e){return e.name===a})[0],c=(t.panes||[{}])[0].name||`default`;return(i||{}).pane||(s||{}).pane||c}seriesAxes(e){let t,n,r=this.options,i=[].concat(r.xAxis),a=e.xAxis;t=a?i.find(e=>e.name===a):i[0];let o=[].concat(r.yAxis),s=e.yAxis;if(n=s?o.find(e=>e.name===s):o[0],!t)throw Error(`Unable to locate X axis with name `+a);if(!n)throw Error(`Unable to locate Y axis with name `+s);return{xAxis:t,yAxis:n}}createAxisLabels(){let e=this.axes;for(let t=0;t<e.length;t++)e[t].createLabels()}createXYAxis(e,t,n){let r=e.name,i=t?this.namedYAxes:this.namedXAxes,a=Object.assign({axisCrossingValue:0},e,{vertical:t,reverse:t||this.chartService.rtl?!e.reverse:e.reverse,justified:!1}),o=a.categories?a.categories[0]:null,s=[a.min,a.max,o],c=this.series;for(let e=0;e<c.length;e++){let r=c[e],i=r[t?`yAxis`:`xAxis`];if(i===a.name||n===0&&!i){let e=Wh.current.bindPoint(r,0).valueFields;s.push(e[t?`y`:`x`]);break}}let l;for(let e=0;e<s.length;e++)if(s[e]instanceof Date){l=!0;break}let u;u=f_(a.type,`date`)||!a.type&&l?rh:Jm;let d=new u(a,this.chartService);if(d.axisIndex=n,r){if(i[r])throw Error(`${t?`Y`:`X`} axis with name ${r} is already defined`);i[r]=d}return this.appendAxis(d),d.indexCategories(),d}createAxes(e){let t=this.options,n=[].concat(t.xAxis),r=[],i=[].concat(t.yAxis),a=[];for(let t=0;t<n.length;t++)W(this.findPane(n[t].pane),e)&&r.push(this.createXYAxis(n[t],!1,t));for(let t=0;t<i.length;t++)W(this.findPane(i[t].pane),e)&&a.push(this.createXYAxis(i[t],!0,t));this.axisX=this.axisX||r[0],this.axisY=this.axisY||a[0]}removeAxis(e){let t=e.options.name;super.removeAxis(e),e.options.vertical?delete this.namedYAxes[t]:delete this.namedXAxes[t],e===this.axisX&&delete this.axisX,e===this.axisY&&delete this.axisY}_dispatchEvent(e,t,n){let r=e._eventCoordinates(t),i=new X(r.x,r.y),a=this.axes,o=a.length,s=[],c=[];for(let e=0;e<o;e++){let t=a[e];s_(t.options.vertical?c:s,t.getCategory(i))}s.length>0&&c.length>0&&e.trigger(n,{element:rf(t),originalEvent:t,x:b_(s),y:b_(c)})}updateAxisOptions(e,t){let n=e.options.vertical,r=this.groupAxes(this.panes),i=(n?r.y:r.x).indexOf(e);ex(this.options,i,n,t),ex(this.originalOptions,i,n,t)}crosshairOptions(e){return Object.assign({},e.options.crosshair,{zIndex:0})}_pointsByVertical(e,t=0){let n=this.axisX.options.reverse?t*-1:t,r=this.axisX.children,i=this._getPointAxisXIndex(e)+n;i=Td(i,r.length);let a=r[i].value,o=this.filterPoints(e=>$b(e.pointData().x,a)).sort((e,t)=>this._getPointAxisYIndex(e)-this._getPointAxisYIndex(t));return this.axisY.options.reverse?o.reverse():o}_pointsByHorizontal(e,t=0){let n=this.axisY.options.reverse?t*-1:t,r=this.axisY.children,i=this._getPointAxisYIndex(e)+n;i=Td(i,r.length);let a=r[i].value,o=this.filterPoints(e=>$b(e.pointData().y,a)).sort((e,t)=>this._getPointAxisXIndex(e)-this._getPointAxisXIndex(t));return this.axisX.options.reverse?o.reverse():o}_getPointAxisXIndex(e){return this._getPointAxisIndex(this.axisX,e.pointData().x)}_getPointAxisYIndex(e){return this._getPointAxisIndex(this.axisY,e.pointData().y)}_getPointAxisIndex(e,t){return e.children.findIndex(e=>$b(t,e.value))}};function $b(e,t){return e instanceof Date&&t instanceof Date?zm(e,t):e===t}function ex(e,t,n,r){let i=[].concat(n?e.yAxis:e.xAxis)[t];H(i,r)}Y(Qb,{xAxis:{},yAxis:{}}),H(Qb.prototype,Ev);let tx=`color`,nx=`first`,rx=`noteText`;Ly.current.register(vy,[`bar`,cg,mg,Ag,rg,Dg,sg,hg,og,kg,ig,Og,wg,Cg,Mg,pg,Sg,jg,...Bg]),Ly.current.register(mb,[Tg,Eg,ag,...Bg]),Ly.current.register(Cb,[`pie`]),Ly.current.register(Eb,[lg]),Ly.current.register(Jb,[ug,dg]),Ly.current.register(Pb,[gg,_g,vg,...Bg]),Ly.current.register(Wb,[yg,bg,xg,...Bg]),Ly.current.register(Qb,[fg]),Wh.current.register([`bar`,cg,mg,Ag,rg,Dg],[ae],[$g,tx,rx,Qh,$h,n_,r_]),Wh.current.register([wg,Cg,Sg,jg],[`from`,`to`],[$g,tx,rx,n_,r_]),Wh.current.register([Mg,pg],[ae],[$g,tx,rx,`summary`,n_,r_]),Wh.current.register([gg,_g,vg],[`x`,`y`],[tx,n_,r_]),Wh.current.register([yg,bg,xg],[ae],[$g,tx,n_,r_]),Wh.current.register([ug,dg],[ae],[$g,tx,`visibleInLegend`,`visible`,n_,r_]),kv.current.register([`bar`,cg,mg,Ag,rg,Dg,Mg,pg],{value:`max`,color:nx,noteText:nx,errorLow:`min`,errorHigh:`max`}),kv.current.register([wg,Cg,Sg,jg],{from:`min`,to:`max`,color:nx,noteText:nx}),kv.current.register([yg,bg,xg],{value:`max`,color:nx}),Wh.current.register([Tg,Eg,ag],[`x`,`y`],[tx,rx,`xErrorLow`,`xErrorHigh`,`yErrorLow`,`yErrorHigh`]),Wh.current.register([ag],[`x`,`y`,`size`],[tx,$g,rx,r_]),Wh.current.register([fg],[`x`,`y`,ae],[tx,rx,r_]),Wh.current.register([sg,hg],[`open`,`high`,`low`,`close`],[$g,tx,`downColor`,rx,r_]),kv.current.register([sg,hg],{open:`max`,high:`max`,low:`min`,close:`max`,color:nx,downColor:nx,noteText:nx}),Wh.current.register([ig,Og],[`lower`,`q1`,`median`,`q3`,`upper`,`mean`,`outliers`],[$g,tx,rx,n_,r_]),kv.current.register([ig,Og],{lower:`max`,q1:`max`,median:`max`,q3:`max`,upper:`max`,mean:`max`,outliers:nx,color:nx,noteText:nx}),Wh.current.register([og,kg],[`current`,`target`],[$g,tx,`visibleInLegend`,rx,n_,r_]),kv.current.register([og,kg],{current:`max`,target:`max`,color:nx,noteText:nx}),Wh.current.register([`pie`,lg],[ae],[$g,tx,`explode`,`visibleInLegend`,`visible`,n_,r_]);function ix(e,t,n){let r=getComputedStyle(e),i=new Map;n.forEach(e=>{i.set(e,r.getPropertyValue(e))});let a=!1,o=()=>{if(!e.isConnected)return;let a=!1;n.forEach(e=>{let t=r.getPropertyValue(e);i.get(e)!==t&&(i.set(e,t),a=!0)}),a&&t()},s=setInterval(()=>{a||(a=!0,requestAnimationFrame(()=>{a=!1,o()}))},500);return{disconnect:()=>{clearInterval(s),i.clear()}}}let ax={};for(let e=1;e<=30;e++)ax[`series-color-${e}`]=`--kendo-chart-series-${e}`;let ox={text:`--kendo-chart-text`,chartBg:`--kendo-chart-bg`,fontWeight:`--kendo-font-weight`,fontFamily:`--kendo-font-family`},sx={majorLines:`--kendo-chart-major-lines`,minorLines:`--kendo-chart-minor-lines`,areaOpacity:`--kendo-chart-area-opacity`,surface:`--kendo-color-surface`,primaryBg:`--kendo-chart-primary-bg`,crosshairBg:`--kendo-chart-crosshair-bg`,axisLabelFontSize:`--kendo-chart-label-font-size`,axisLabelFontWeight:`--kendo-font-weight`,axisLabelFontFamily:`--kendo-font-family`,chartFontSize:`--kendo-chart-font-size`,paneTitleFontSize:`--kendo-chart-pane-title-font-size`,paneTitleFontWeight:`--kendo-chart-pane-title-font-weight`,titleFontSize:`--kendo-chart-title-font-size`,titleFontWeight:`--kendo-font-weight`,errorBarsBg:`--kendo-chart-error-bars-bg`,areaInactiveOpacity:`--kendo-chart-area-inactive-opacity`,lineInactiveOpacity:`--kendo-chart-line-inactive-opacity`,bulletTarget:`--kendo-chart-bullet-target`,notesBg:`--kendo-chart-notes-bg`,notesBorder:`--kendo-chart-notes-border`,notesLines:`--kendo-chart-notes-lines`,inactive:`--kendo-chart-inactive`,initialAnimationDuration:`--kendo-duration-steady`,fadeInAnimationDuration:`--kendo-duration-rapid`,elasticEasing:`--kendo-easing-stretchy`,linearEasing:`--kendo-easing-linear`,swingEasing:`--kendo-easing-standard`},cx={linksColor:`--kendo-color-subtle`},lx={gaugePointer:`--kendo-chart-gauge-pointer`,gaugeTrack:`--kendo-chart-gauge-track`},ux=Object.assign({},ox,sx,ax);Object.assign({},ox,cx,ax),Object.assign({},ox,lx);let dx=[$g,ae,`x`,`y`],fx=`mousedown`,px=`mousemove`,mx=`contextmenu`,hx=`mouseleave`,gx=`keydown`,_x=`focus`,vx=`blur`,yx=`k-chart-overlay-top`,bx=e=>/^kendo-/i.test(e.nodeName)||e.nodeType===8;var xx=class{constructor(e,t,n,r={}){this.observers=[],this.addObserver(r.observer),this.chartService=new lm(this,r),this.chartService.theme=n,this._initElement(e);let i=H({},this.options,t);this._originalOptions=H({},i),this._theme=n,this._initTheme(i,n),this._focusState={},this._initHandlers(),this._createSurface=r.createSurface||yo.create.bind(yo),this._initSurface(),this.bindCategories(),uf.preloadFonts(t,()=>{this.fontLoaded=!0,this._destroyed||(this.trigger(`init`),this._redraw(),this._attachEvents(),this._restoreOverlayElement(),this._initStyleObserver())})}_initStyleObserver(){this._destroyStyleObserver(),this.options.observeStyles&&(this._stylesObserver=ix(this.element,()=>{this.trigger(`styleChanged`)},Object.values(ux)))}_destroyStyleObserver(){this._stylesObserver&&=(this._stylesObserver.disconnect(),null)}_initElement(e){this._setElementClass(e),e.style.position=`relative`,e.tabIndex=e.getAttribute(`tabindex`)?e.getAttribute(`tabindex`):0,e.setAttribute(`role`,`graphics-document document`);for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];Hd(n,`k-chart-overlay`)?this.overlayElement=n:bx(n)||e.removeChild(n)}this.element=e}_setElementClass(e){le(e,`k-chart`)}_restoreOverlayElement(){this.overlayElement&&(this._hasSeriesData()?this.overlayElement.style.display=`none`:(!this.options.title||this.options.title&&this.options.title.position!==`bottom`?le(this.overlayElement,yx):de(this.overlayElement,yx),this.overlayElement.style.display=``),this.overlayElement.parentElement!==this.element&&this.element.appendChild(this.overlayElement))}_hasSeriesData(){let e=this.options.series||[];return e.length>0&&e.some(e=>e.data&&e.data.length>0)}_initTheme(e,t){let n=[],r=e.series||[];for(let e=0;e<r.length;e++)n.push(Object.assign({},r[e]));e.series=n,Sx(e),this.applyDefaults(e,t),e.seriesColors===null&&delete e.seriesColors,xd(e.title)&&(e.title={text:e.title}),this.options=H({},t,e),this.applySeriesColors()}getSize(){let e=this.options.chartArea||{};return{width:e.width?parseInt(e.width,10):Math.floor(this.element.offsetWidth),height:e.height?parseInt(e.height,10):Math.floor(this.element.offsetHeight)}}resize(e){let t=this.getSize(),n=this._size,r=t.width>0||t.height>0;e||r&&(!n||t.width!==n.width||t.height!==n.height)?(this._size=t,this._resize(t,e),this.trigger(`resize`,t)):r&&this._selections&&yf(this._selections,e=>!e.visible)&&(this._destroySelections(),this._setupSelection())}_resize(){this._noTransitionsRedraw()}redraw(e){if(this.applyDefaults(this.options),this.applySeriesColors(),e){let t=this._model._plotArea,n=t.findPane(e);t.redraw(n)}else this._redraw()}getAxis(e){return Rh(e,this._plotArea.axes)}findAxisByName(e){return this.getAxis(e)}findPaneByName(e){let t=this._plotArea.panes;for(let n=0;n<t.length;n++)if(t[n].options.name===e)return new zh(t[n])}findPaneByIndex(e){let t=this._plotArea.panes;if(t[e])return new zh(t[e])}plotArea(){return new Bh(this._plotArea)}toggleHighlight(e,t){let n=this._plotArea,r=(n.srcSeries||n.series||[])[0],i;if(Ed(t))i=n.filterPoints(t);else{let e,a;kd(t)?(e=t.series,a=t.category):e=a=t,i=r.type===`donut`?Cx(n.pointsBySeriesName(e),a):W(r.type,[`pie`,`funnel`,`pyramid`])?Cx((n.charts[0]||{}).points,a):n.pointsBySeriesName(e)}i&&this.togglePointsHighlight(e,i)}togglePointsHighlight(e,t){let n=this._highlight;for(let r=0;r<t.length;r++)n.togglePointHighlight(t[r],e)}showTooltip(e){let t=this._sharedTooltip(),{_tooltip:n,_plotArea:r}=this,i,a;if(Ed(e)?(i=r.findPoint(e),i&&t&&(a=i.categoryIx)):t&&G(e)&&(a=r.categoryAxis.categoryIndex(e)),t){if(a>=0){let e=this._plotArea.pointsByCategoryIndex(a);n.showAt(e)}}else i&&n.show(i)}hideTooltip(){this._tooltip.hide()}_initSurface(){let e=this.surface,t=this._surfaceWrap(),n=this.options.chartArea||{};n.width&&tf(t,{width:n.width}),n.height&&tf(t,{height:n.height}),!e||e.options.type!==this.options.renderAs?(this._destroySurface(),this.surface=this._createSurface(t,{type:this.options.renderAs}),this.surface.bind(`mouseenter`,this._surfaceMouseenterHandler),this.surface.bind(`mouseleave`,this._surfaceMouseleaveHandler)):(this.surface.clear(),this.surface.resize()),this.element._kendoExportVisual=this._kendoExportVisual.bind(this)}_surfaceWrap(){return this.element}_redraw(){let e=this._getModel();this._size={width:e.options.width,height:e.options.height},this._destroyView(),this._setElementAccessibilityAttributes(),this._model=e,this._plotArea=e._plotArea,this._legend=e._legend,e.renderVisual();let t=this.options.transitions,n=this.options.motion||{};t!==!1&&e.traverse(function(e){e.animation&&(e.animation.options=Object.assign({},e.animation.options,{duration:void 0,motionConfig:Object.assign({},n)}),e.animation.setup())}),this._initSurface(),this.surface.draw(e.visual),t!==!1&&e.traverse(function(e){e.animation&&e.animation.play()}),this._tooltip=this._createTooltip(),this._highlight=new xy,this._setupSelection(),this._createPannable(),this._createZoomSelection(),this._createMousewheelZoom(),this._setComputedStyles(),this.trigger(`render`),Ax(this._plotArea.panes),this._navState||this._cancelDomEvents(),this._redrawFocusHighlight()}_setComputedStyles(){let e=this.titleHeight();this.element.style.setProperty(`--kendo-chart-computed-title-height`,`${e}px`)}_redrawFocusHighlight(){if(this._destroyed)return;let{_focusState:{legendInFocus:e,preserveHighlight:t}}=this;e&&t&&(this._focusElement(this._getFocusedLegendItem(),!1),this._focusState.preserveHighlight=!1)}_setElementAccessibilityAttributes(){let e=this.options.title,t=xd(e)?e:e.description||e.text;t&&this.element.setAttribute(`aria-roledescription`,t)}_kendoExportVisual(e){if(e&&e.width&&e.height){let t=this._originalOptions.chartArea||{},n={width:t.width||e.width,height:t.height||e.height};return this.exportVisual(n)}return this.exportVisual()}exportVisual(e){let t;if(e&&(e.width||e.height||e.options)){let n=this.options,r=H({},e.options,{chartArea:{width:e.width,height:e.height}});kx(this._originalOptions,r),this.options=H({},this._originalOptions,r),this._initTheme(this.options,this._theme),this.bindCategories();let i=this._getModel();i.renderVisual(),Ax(i._plotArea.panes),t=i.visual,this.options=n}else t=this.surface.exportVisual();return t}_toggleCategoryHighlight(e,t){let n=this._plotArea,r=t||n.categoryAxis;if(this._categoryHighlightIndex===e&&this._categoryHighlightAxis===r)return;this._categoryHighlightIndex=e,this._categoryHighlightAxis=r;let i=r?(r.options||{}).highlight:null;if(!i||!i.visible||e===null){this._categoryHighlight&&this._categoryHighlight.visible(!1);return}this._categoryHighlight?(this._categoryHighlight.fill(i.color,i.opacity),this._categoryHighlight.options.set(`stroke`,i.border||null)):this._categoryHighlight=new F({fill:{color:i.color,opacity:i.opacity},stroke:i.border||null,closed:!0,zIndex:-1});let a=r.getSlot(e).toRect(),o=n.box;r.pane&&(o=r.pane.chartsBox()),r.options.vertical?(a.origin.x=o.x1,a.size.width=o.width()):(a.origin.y=o.y1,a.size.height=o.height());let s=F.fromRect(a);this._categoryHighlight.segments.elements(s.segments.elements()),this._categoryHighlight.visible(!0);let c=(r.pane||this._plotArea).visual;c&&this._categoryHighlight.parent!==c&&(this._categoryHighlight.parent&&this._categoryHighlight.parent.remove(this._categoryHighlight),c.insert(0,this._categoryHighlight))}_categoryHighlightEnabled(){return this._plotArea instanceof vy&&[].concat(this.options.categoryAxis||{}).some(e=>e.highlight&&e.highlight.visible)}_sharedTooltip(){return this._plotArea instanceof vy&&this.options.tooltip&&this.options.tooltip.shared}_createPannable(){let e=this.options;e.pannable!==!1&&(this._pannable=new Ty(this._plotArea,e.pannable))}_createZoomSelection(){let e=this.options.zoomable,t=(e||{}).selection;e!==!1&&t!==!1&&(this._zoomSelection=new Ey(this,t))}_createMousewheelZoom(){let e=this.options.zoomable,t=(e||{}).mousewheel;e!==!1&&t!==!1&&(this._mousewheelZoom=new Dy(this,t))}_toggleDragZoomEvents(){let e=this.options.pannable,t=this.options.zoomable,n=(t||{}).selection,r=(t||{}).mousewheel,i=!e&&(t===!1||n===!1)&&!this.requiresHandlers([`dragStart`,`drag`,`dragEnd`]),a=(t===!1||r===!1)&&!this.requiresHandlers([`zoomStart`,`zoom`,`zoomEnd`]),o=this.element;this._dragZoomEnabled&&i&&a?(o.style.touchAction=this._touchAction||``,this._dragZoomEnabled=!1):!this._dragZoomEnabled&&!(i&&a)&&(o.style.touchAction=`none`,this._dragZoomEnabled=!0),this._toggleDomEvents(!i,!a)}_toggleDomEvents(e,t){let n=this.domEvents;n&&(n.toggleDrag&&n.toggleDrag(e),n.toggleZoom&&n.toggleZoom(t))}_createTooltip(){let{options:{tooltip:e}}=this,t;return t=this._sharedTooltip()?this._createSharedTooltip(e):new Vy(this.chartService,e),t}_createSharedTooltip(e){return new Hy(this._plotArea,e)}applyDefaults(e,t){wx(e,t),Tx(e,t)}applySeriesColors(){let e=this.options,t=e.series,n=e.seriesColors||[];for(let e=0;e<t.length;e++){let r=t[e],i=n[e%n.length],a=r._defaults;r.color=r.color||i,a&&(a.color=a.color||i)}}_getModel(){let e=this.options,t=this._createPlotArea(),n=new qp(this._modelOptions());n.chart=this,n._plotArea=t;let r=tm.buildTitle(e.title),i=tm.buildTitle(e.subtitle,{align:e.title.align,position:e.title.position});if(n.append.apply(n,tm.orderTitles([r,i])),e.legend&&e.legend.visible){let e=new Iy(t.options.legend,this.chartService);n.append(e),n._legend=e}return n.append(t),n.reflow(),this._setTitleBox(r,i),n}_setTitleBox(e,t){if(!e&&!t)return;this._titleBox=(e||t).box.clone();let n=e?e.options.position:``,r=t?t.options.position:``;n===r&&t?this._titleBox.wrap(t.box):e&&t&&r!==x&&(this._titleBox=t.box.clone())}_modelOptions(){let e=this.options,t=this.getSize();return H({transitions:e.transitions,width:t.width||600,height:t.height||400},e.chartArea)}_createPlotArea(e){let t=this.options;return Ly.current.create(e?[]:t.series,t,this.chartService)}_setupSelection(){let{_plotArea:{axes:e}}=this,t=this._selections=[];for(let n=0;n<e.length;n++){let r=e[n],i=r.options;if(r instanceof Jm&&i.select&&!i.vertical){let e=r.range(),n=new By(this,r,H({min:e.min,max:e.max},i.select));t.push(n)}}}_selectStart(e){return this.trigger(`selectStart`,e)}_select(e){return this.trigger(qg,e)}_selectEnd(e){return this.trigger(Jg,e)}_initHandlers(){this._clickHandler=this._click.bind(this),this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._mousedownHandler=this._mousedown.bind(this),this._mousewheelHandler=this._mousewheel.bind(this),this._mouseleaveHandler=this._mouseleave.bind(this),this._surfaceMouseenterHandler=this._mouseover.bind(this),this._surfaceMouseleaveHandler=this._mouseout.bind(this),this._mousemoveThrottled=je(this._mousemove.bind(this),20)}addObserver(e){e&&this.observers.push(e)}removeObserver(e){let t=this.observers.indexOf(e);t>=0&&this.observers.splice(t,1)}requiresHandlers(e){let t=this.observers;for(let n=0;n<t.length;n++)if(t[n].requiresHandlers(e))return!0}trigger(e,t={}){t.sender=this,e===`showTooltip`?t.anchor.point=this._toDocumentCoordinates(t.anchor.point):e===`seriesOver`?this._updateDrilldownPoint(t.point):e===`seriesLeave`?this._resetDrilldownPoint():e===`seriesClick`?(this._focusPoint(t.point),this._startDrilldown(t.point)):e===`legendItemClick`&&this._focusLegendItem(t);let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r}titleHeight(){return this._titleBox?this._titleBox.height():0}_attachEvents(){let e=this.element;this._touchAction=e.style.touchAction,Qd(e,{[mx]:this._clickHandler,[t_]:this._mousewheelHandler,[hx]:this._mouseleaveHandler,[gx]:this._keydownHandler,[fx]:this._mousedownHandler,[_x]:this._focusHandler,[vx]:this._blurHandler}),this._shouldAttachMouseMove()&&Qd(e,{[px]:this._mousemoveThrottled}),this.domEvents=dm.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)}),this._toggleDragZoomEvents()}_mouseleave(e){this._hoveredPoint&&=(this._hoveredPoint.out(this,e),null),this._plotAreaHovered&&(this._plotAreaHovered=!1,this.trigger(Vg)),this._hasInactiveOpacity()&&this._activeChartInstance&&(this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._updateSeriesOpacity(null,!0))}_cancelDomEvents(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()}_gesturestart(e){this._mousewheelZoom&&!this._stopChartHandlers(e)&&(this._gestureDistance=e.distance,this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking())}_gestureend(e){this._zooming&&!this._stopChartHandlers(e)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger(Kg,{axisRanges:Dx(this._plotArea.axes),originalEvent:e}))}_gesturechange(e){let t=this._mousewheelZoom;if(t&&!this._stopChartHandlers(e)){e.preventDefault();let n=this._gestureDistance,r=-e.distance/n+1;if(Math.abs(r)>=.1){r=Math.round(r*10),this._gestureDistance=e.distance;let n={delta:r,axisRanges:Dx(this._plotArea.axes),originalEvent:e};if(this._zooming||!this.trigger(`zoomStart`,n)){let i=this._eventCoordinates(e);this._zooming||=!0,(n.axisRanges=t.updateRanges(r,i))&&!this.trigger(`zoom`,n)&&t.zoom()}}}}_mouseout(e){if(e.element){let t=this._drawingChartElement(e.element,e);t&&t.leave&&t.leave(this,e.originalEvent)}}_start(e){let t=this._eventCoordinates(e);this._stopChartHandlers(e)||!this._plotArea.backgroundContainsPoint(t)||(this.requiresHandlers([`dragStart`,`drag`,`dragEnd`])&&this._startNavigation(e,t,`dragStart`),this._pannable&&this._pannable.start(e)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._clearFocusedElement(),this._suppressHover=!0,this.chartService.panning=!0),this._zoomSelection&&this._zoomSelection.start(e)&&this.trigger(Wg,{axisRanges:Dx(this._plotArea.axes),originalEvent:e}))}_move(e){let{_navState:t,_pannable:n}=this;if(!this._stopChartHandlers(e)){if(n){let t=n.move(e);t&&!this.trigger(`drag`,{axisRanges:t,originalEvent:e})&&n.pan()}else if(t){let n={},r=t.axes;for(let t=0;t<r.length;t++){let i=r[t];if(i.options.name){let t=i.options.vertical?e.y:e.x,r=t.startLocation-t.location;r!==0&&(n[i.options.name]=i.translateRange(r))}}t.axisRanges=n,this.trigger(Hg,{axisRanges:n,originalEvent:e})}this._zoomSelection&&this._zoomSelection.move(e)}}_end(e){if(this._stopChartHandlers(e))return;let t=this._pannable;if(t&&t.end(e)?(this.surface.resumeTracking(),this.trigger(Ug,{axisRanges:Dx(this._plotArea.axes),originalEvent:e}),this._suppressHover=!1,this.chartService.panning=!1):this._endNavigation(e,Ug),this._zoomSelection){let t=this._zoomSelection.end(e);t&&!this.trigger(`zoom`,{axisRanges:t,originalEvent:e})&&(this._zoomSelection.zoom(),this.trigger(Kg,{axisRanges:t,originalEvent:e}))}}_stopChartHandlers(e){let t=this._selections||[];if(!t.length)return!1;let n=this._eventCoordinates(e),r=this._plotArea.paneByPoint(n);if(r){for(let e=0;e<t.length;e++)if(t[e].onPane(r))return!0}}_mousewheelZoomRate(){let e=(this.options.zoomable||{}).mousewheel||{};return J(e.rate,.3)}_mousewheel(e){let t=Xd(e),n=this._mousewheelZoom,r=this._eventCoordinates(e);if(!(this._stopChartHandlers(e)||!this._plotArea.backgroundContainsPoint(r)))if(n){let i={delta:t,axisRanges:Dx(this._plotArea.axes),originalEvent:e};(this._zooming||!this.trigger(`zoomStart`,i))&&(e.preventDefault(),this._zooming||=(this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking(),!0),this._mwTimeout&&clearTimeout(this._mwTimeout),i.axisRanges=n.updateRanges(t,r),i.axisRanges&&!this.trigger(`zoom`,i)&&n.zoom(),this._mwTimeout=setTimeout(()=>{this.trigger(Kg,i),this._zooming=!1,this.surface&&this.surface.resumeTracking()},150))}else{let n=this._navState;if(n||this._startNavigation(e,r,Wg)||(n=this._navState),n){let i=n.totalDelta||t;n.totalDelta=i+t;let a=this._navState.axes,o={};for(let e=0;e<a.length;e++){let t=a[e],n=t.options.name;n&&(o[n]=t.scaleRange(-i*this._mousewheelZoomRate(),r))}this.trigger(Gg,{delta:t,axisRanges:o,originalEvent:e}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout(()=>{this._endNavigation(e,Kg)},150)}}}_startNavigation(e,t,n){let r=this._model._plotArea,i=r.findPointPane(t),a=r.axes.slice(0);if(!i)return;let o=Dx(a);this.trigger(n,{axisRanges:o,originalEvent:e})?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._clearFocusedElement(),this._navState={axisRanges:o,pane:i,axes:a})}_endNavigation(e,t){this._navState&&=(this.trigger(t,{axisRanges:this._navState.axisRanges,originalEvent:e}),this._suppressHover=!1,null)}_getChartElement(e,t){let n=this.surface.eventTarget(e);if(n)return this._drawingChartElement(n,e,t)}_drawingChartElement(e,t,n){let r=e,i;for(;r&&!i;)i=r.chartElement,r=r.parent;if(i)return i.aliasFor&&(i=i.aliasFor(t,this._eventCoordinates(t))),n&&(i=i.closest(n),i&&i.aliasFor&&(i=i.aliasFor())),i}_eventCoordinates(e){let t=nf(e);return this._toModelCoordinates(t.x,t.y)}_elementPadding(){if(!this._padding){let{paddingLeft:e,paddingTop:t}=Nd(this.element,[`paddingLeft`,`paddingTop`]);this._padding={top:t,left:e}}return this._padding}_toDocumentCoordinates(e){let t=this._elementPadding(),n=ef(this.element);return{left:q(e.x+t.left+n.left),top:q(e.y+t.top+n.top)}}_toModelCoordinates(e,t){let n=this.element,r=ef(n),i=this._elementPadding(),a=wf(n).invert(),o=new M(e-r.left-i.left,t-r.top-i.top).transform(a);return new X(o.x,o.y)}_tap(e){let t=this.surface.eventTarget(e),n=this._drawingChartElement(t,e),r=this._sharedTooltip();!this._startHover(t,e)&&!r&&this._unsetActivePoint(),r&&this._trackSharedTooltip(this._eventCoordinates(e),e,!0),this._propagateClick(n,e),this.handlingTap=!0,setTimeout(()=>{this.handlingTap=!1},0)}_click(e){let t=this._getChartElement(e);this._propagateClick(t,e)}_propagateClick(e,t){let n=e;for(;n;)n.click&&n.click(this,t),n=n.parent}_isLegendBeforeChart(){let{options:{legend:{position:e}},_legend:t}=this;return t&&t.hasItems()&&(e===`top`||e===`left`)}_focus(){this._preventInitialPointFocus||(this._isLegendBeforeChart()?this._focusFirstLegendItem():this._focusFirstPoint()),this._preventInitialPointFocus=!1}_keydown(e){let{_focusState:{legendInFocus:t,focusedElement:n},_legend:r}=this;if(e.key===`Tab`){this._clearFocusedElement();let n=this._isLegendBeforeChart();t&&n!==e.shiftKey?this._navigatePoints(e):!t&&n===e.shiftKey&&r.hasItems()&&this._navigateLegend(e)}else e.key===`Escape`?(n&&e.stopPropagation(),this._tooltip&&this._tooltip.visible?this._hideTooltip():this._blur()):e.key===`Enter`?n&&(this._focusState.preserveHighlight=!0,this._propagateClick(n,e),this._focusElement(n)):t?this._navigateLegend(e):this._navigatePoints(e)}_navigatePoints(e){let{_focusState:t,_plotArea:n}=this;if(t.legendInFocus=!1,!t.focusedElement){this._focusFirstPoint(),e.preventDefault();return}let r=n=>{t.focusedPoint=n,this._focusElement(t.focusedPoint),this._displayTooltip(n),e.preventDefault()};switch(e.key){case v:r(n.getPointToTheRight(t.focusedPoint));break;case _:r(n.getPointToTheLeft(t.focusedPoint));break;case g:r(n.getPointBelow(t.focusedPoint));break;case h:r(n.getPointAbove(t.focusedPoint));break;default:break}}_navigateLegend(e){let{_focusState:t,_legend:n,chartService:{rtl:r}}=this;if(t.legendInFocus=!0,!t.focusedElement){this._focusFirstLegendItem(),e.preventDefault();return}let i=n.getItems().length,a=n=>{t.focusedLegendItemIndex=n(t.focusedLegendItemIndex,i),this._focusElement(this._getFocusedLegendItem()),e.preventDefault()};switch(e.key){case h:case _:a(r?Cd:wd);break;case g:case v:a(r?wd:Cd);break;default:break}}_focusFirstPoint(){let e=this._focusState.focusedPoint=this._plotArea.getFirstPoint();e&&(this._focusElement(e),this._displayTooltip(e))}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_mousedown(){this._hasFocus()||(this._preventInitialPointFocus=!0)}_focusChart(){this._hasFocus()||(this._preventInitialPointFocus=!0,this.element.focus())}_focusPoint(e){this._focusState.focusedPoint=e,this._focusChart(),this._focusElement(e,!0)}_focusFirstLegendItem(){let{_focusState:e}=this;e.focusedLegendItemIndex=0,this._focusElement(this._getFocusedLegendItem()),e.legendInFocus=!0,this._hideTooltip()}_focusLegendItem(e){let{_focusState:t}=this;t.focusedLegendItemIndex=this._legend.getItems().findIndex(t=>t.options.series.index===e.seriesIndex&&t.options.pointIndex===e.pointIndex),t.legendInFocus=!0,this._focusChart(),this._focusElement(this._getFocusedLegendItem(),!0)}_getFocusedLegendItem(){let{_focusState:e,_legend:t}=this;return t.getItems()[e.focusedLegendItemIndex]}_focusElement(e,t){let{_focusState:n}=this;if(this._clearFocusedElement(),e&&(n.focusedElement=e,this._setElementActiveDescendant(e),!t))if(e.focusVisual(),n.legendInFocus){let t=e.options;this._showSeriesInactiveOpacity(t.series.index,t.pointIndex)}else this._showInactiveOpacity(e)}_clearFocusedElement(){let{_focusState:e}=this;e&&(e.focusedElement&&e.focusedElement.clearFocusFromVisual&&(e.focusedElement.clearFocusFromVisual(),this._clearElementActiveDescendant()),e.focusedElement=null)}_setElementActiveDescendant(e){this.options.renderAs===`canvas`&&(this._pseudoFocusedElement=this._createPseudoFocusedElement(e),this.element.append(this._pseudoFocusedElement)),this.element.setAttribute(y,e._id)}_clearElementActiveDescendant(){this._pseudoFocusedElement&&=(this._pseudoFocusedElement.remove(),null),this.element.removeAttribute(y)}_createPseudoFocusedElement(e){let t=document.createElement(`div`),n=e.options.accessibility;t.id=e._id,t.setAttribute(`aria-label`,e.getAriaLabelText()),t.setAttribute(`role`,n.role),t.setAttribute(`aria-roledescription`,n.ariaRoleDescription);let r=n.ariaChecked;return G(r)&&t.setAttribute(`aria-checked`,r),t}_blur(){this._focusState.legendInFocus=!1,this._clearFocusedElement(),this._hideInactiveOpacity()}_startHover(e,t){if(this._suppressHover)return!1;let n=this._drawingChartElement(e,t,function(e){return(e.hover||e.over)&&!(e instanceof bv)}),r=this._activePoint;return this._updateHoveredPoint(n,t),n&&r!==n&&n.hover&&(this._activePoint=n,!this._sharedTooltip()&&!n.hover(this,t)&&(this._displayTooltip(n),this._showInactiveOpacity(n))),n}_displayTooltip(e){H({},this.options.tooltip,e.options.tooltip).visible&&(this._sharedTooltip()&&e.box?this._trackSharedTooltip(e.box.center(),{}):this._tooltip.show(e))}_hideTooltip(){this._tooltip&&this._tooltip.hide()}_displayInactiveOpacity(e,t,n){let r=this._activeChartInstance=this._chartInstanceFromPoint(e);if(r)if(t)this._updateSeriesOpacity(e),this._applySeriesOpacity(r.children,null,!0),this._applySeriesOpacity(r.children,e.series),this._highlight.show(n||e);else{let t;if(!r.supportsPointInactiveOpacity()){this._highlight.show(e);return}t=this._getInactivePoints(e,r),t&&t.length&&this._highlight.show(t,this._getInactiveOpacityForSeries(e.series))}}_getInactivePoints(e,t){return this._getAllPointsOfType(t,e.constructor).filter(t=>t!==e)}_getAllPointsOfType(e,t){let n=[];for(let r=0;r<e.children.length;r++){let i=e.children[r];i.constructor===t?n.push(i):i.children&&i.children.length&&(n=n.concat(this._getAllPointsOfType(i,t)))}return n}_updateHoveredPoint(e,t){let n=this._hoveredPoint;n&&n!==e&&(n.out(this,t),this._hoveredPoint=null),e&&n!==e&&e.over&&(this._hoveredPoint=e,e.over(this,t))}_updateDrilldownPoint(e){if(!e||!e.series)return;let{fields:t}=Wh.current.bindPoint(e.series,null,e.dataItem);t.drilldown&&(this._drilldownState={cursor:this.element.style.cursor},this.element.style.cursor=`pointer`)}_resetDrilldownPoint(){this._drilldownState&&=(this.element.style.cursor=this._drilldownState.cursor,null)}_startDrilldown(e){if(!e||!e.series)return;let t=e.series,{fields:n}=Wh.current.bindPoint(t,null,e.dataItem),r=n.drilldown;if(r){let n={series:t,point:e,value:r,sender:this};this.trigger(`drilldown`,n)}}_updateSeriesOpacity(e,t){let n=this._plotArea,r=n.series.length;for(let i=0;i<r;i++){let r=n.series[i],a=this._getDefaultOpacityForSeries(r),o=this._getInactiveOpacityForSeries(r);!t&&r!==e.series?(r.defaultOpacity=a,r.opacity=o,r.line&&(r.line.opacity=o)):(r.opacity=a,r.line&&(r.line.opacity=a))}}_applySeriesOpacity(e,t,n,r){for(let i=0;i<e.length;i++){let a=e[i],o=a.series||r;if(o&&(o.highlight||{}).visible&&a.visual){let e=r?r.opacity:a.series.opacity;(o!==t||n)&&a.visual.opacity(n?1:e)}a.children&&a.children.length&&this._applySeriesOpacity(a.children,t,n,a.series)}}_chartInstanceFromPoint(e){let t=e.parent;for(;t&&!t.plotArea;)t=t.parent;return t}_showInactiveOpacity(e){let t=this._plotArea.series.length>1;this._hasInactiveOpacity()?this._displayInactiveOpacity(e,t):this._highlight.show(e)}_hideInactiveOpacity(e){let t=this._plotArea.series.length>1;this._hasInactiveOpacity()&&(t&&this._activeChartInstance&&(this._updateSeriesOpacity(e,!0),this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._activeChartInstance=null),this._highlight&&this._highlight.hide(),this._activePoint=null)}_hasInactiveOpacity(){let e=this.options.seriesDefaults.highlight.inactiveOpacity!==void 0,t=this.options.series.filter(e=>e.highlight.inactiveOpacity!==void 0).length>0;return e||t}_getInactiveOpacityForSeries(e){let t=this.options.seriesDefaults.highlight.inactiveOpacity,n=e.highlight.inactiveOpacity;return n===void 0?t===void 0?e.opacity===void 0?1:e.opacity:t:n}_getDefaultOpacityForSeries(e){return e.defaultOpacity||e.opacity||1}_mouseover(e){let t=this._startHover(e.element,e.originalEvent);t&&t.tooltipTracking&&!this._mouseMoveTrackHandler&&!this._sharedTooltip()&&(this._mouseMoveTrackHandler=this._mouseMoveTracking.bind(this),Qd(document,{[px]:this._mouseMoveTrackHandler}))}_mouseMoveTracking(e){let{options:t,_tooltip:n,_highlight:r,_activePoint:i}=this,a=this._eventCoordinates(e);if(this._plotArea.box.containsPoint(a)){if(i&&i.tooltipTracking&&i.series&&i.parent.getNearestPoint){let o=i.parent.getNearestPoint(a.x,a.y,i.seriesIx);o&&o!==i&&(this._activePoint=o,o.hover(this,e)||(H({},t.tooltip,o.options.tooltip).visible&&n.show(o),r.show(o)))}}else lf(document,{[px]:this._mouseMoveTrackHandler}),this._unsetActivePoint(),this._clearFocusedElement(),this._mouseMoveTrackHandler=null,this._hideInactiveOpacity(i)}_mousemove(e){let t=this._eventCoordinates(e),n=this._plotArea;if(this._trackCrosshairs(t),n.hover){let r=n.backgroundContainsPoint(t);r?(this._plotAreaHovered=!0,this._plotArea.hover(this,e)):this._plotAreaHovered&&!r&&(this._plotAreaHovered=!1,this.trigger(Vg))}this._sharedTooltip()&&this._trackSharedTooltip(t,e),this._categoryHighlightEnabled()&&this._trackCategoryHighlight(t)}_trackCategoryHighlight(e){let{_plotArea:t}=this,n=t.categoryAxisByPoint(e)||t.categoryAxis;if(t.backgroundContainsPoint(e)){let t=n.pointCategoryIndex(e);this._toggleCategoryHighlight(t,n)}else this._toggleCategoryHighlight(null)}_trackCrosshairs(e){let t=this._plotArea.crosshairs;for(let n=0;n<t.length;n++){let r=t[n];r.box.containsPoint(e)?r.showAt(e):r.hide()}}_trackSharedTooltip(e,t,n){if(this._suppressHover)return;let{options:{tooltip:r},_plotArea:i,_plotArea:{categoryAxis:a},_tooltip:o,_highlight:s}=this;if(i.backgroundContainsPoint(e)){let c=a.pointCategoryIndex(e);if(c!==this._tooltipCategoryIx||!this._sharedHighlight&&n){let n=i.pointsByCategoryIndex(c),a=n.map(function(e){return e.eventArgs(t)}),l=a[0]||{};l.categoryPoints=a,n.length>0&&!this.trigger(`seriesHover`,l)?(r.visible&&o.showAt(n,e),s.show(n),this._sharedHighlight=!0):o.hide(),this._tooltipCategoryIx=c}else n&&this._sharedHighlight&&(s.hide(),o.hide(),this._sharedHighlight=!1)}else this._sharedHighlight&&=(s.hide(),o.hide(),this._tooltipCategoryIx=null,!1)}hideElements(e){let t=this._plotArea;this._mousemoveThrottled.cancel(),t.hideCrosshairs(),this._unsetActivePoint(e),this._toggleCategoryHighlight(null)}_unsetActivePoint(e){let{_highlight:t}=this;this._activePoint=null,this._hoveredPoint=null,(!e||!e.keepTooltipOpen)&&this._hideTooltip(),this._tooltipCategoryIx=null,this._sharedHighlight=!1,t&&t.hide()}_deferRedraw(){this._redraw()}_clearRedrawTimeout(){this._redrawTimeout&&=(clearInterval(this._redrawTimeout),null)}bindCategories(){let e=this.options,t=[].concat(e.categoryAxis);for(let e=0;e<t.length;e++){let n=t[e];n.autoBind!==!1&&this.bindCategoryAxisFromSeries(n,e)}}bindCategoryAxisFromSeries(e,t){let n=new Set,r=this.options.series.filter(n=>n.categoryAxis===e.name||!n.categoryAxis&&t===0),i=r.some(e=>!!e.categoryField),a=r.filter(e=>e.data&&e.data.length>0),o=a.map(e=>Wh.current.bindPoint(e,0).fields.category),s=o.reduce((t,n)=>t||y_(e,n),!1);if(a.filter((e,t)=>e.categoryField||G(o[t])).forEach(e=>e.data.forEach((t,r)=>{let i=Wh.current.bindPoint(e,r).fields.category;if(s){let e=g_(i,t,this.chartService.intl);i=e?e.getTime():void 0}n.add(i)})),n.size>0){let t=Array.from(n.values());s&&(t=t.sort().map(e=>e&&new Date(e))),e.categories=t}else i&&(e.categories=[])}_isBindable(e){let t=Wh.current.valueFields(e),n=!0;for(let r=0;r<t.length;r++){let i=t[r];if(i===`value`?i=`field`:i+=`Field`,!G(e[i])){n=!1;break}}return n}_noTransitionsRedraw(){let e=this.options,t;e.transitions!==!1&&(t=e.transitions,e.transitions=!1),this._redraw(),t&&(e.transitions=t)}_legendItemHover(e,t){this._showSeriesInactiveOpacity(e,t)}_showSeriesInactiveOpacity(e,t){let{_plotArea:n,_highlight:r}=this,i=(n.srcSeries||n.series)[e],a;if(a=W(i.type,[`pie`,`donut`,`funnel`,`pyramid`])?n.findPoint(function(n){return n.series.index===e&&n.index===t}):n.pointsBySeriesIndex(e),this._hasInactiveOpacity()&&i.visible&&a){let e=n.series.length>1,t=a.length?a[0]:a;this._displayInactiveOpacity(t,e,a)}else r.show(a)}_shouldAttachMouseMove(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this._categoryHighlightEnabled()||this.requiresHandlers([`plotAreaHover`,`plotAreaLeave`])}updateMouseMoveHandler(){lf(this.element,{[px]:this._mousemoveThrottled}),this._shouldAttachMouseMove()&&Qd(this.element,{[px]:this._mousemoveThrottled})}applyTheme(e){let t=Object.assign({},this._originalOptions);requestAnimationFrame(()=>{this.applyOptions(t,e),this.noTransitionsRedraw()})}applyOptions(e,t){kx(this._originalOptions,e),this._originalOptions=H(this._originalOptions,e),this.options=H({},this._originalOptions),t&&(this._theme=t,this.chartService.theme=t),this._initTheme(this.options,this._theme),this._toggleDragZoomEvents()}setOptions(e,t){this.applyOptions(e,t),this.bindCategories(),this.redraw(),this.updateMouseMoveHandler(),this._restoreOverlayElement(),this._initStyleObserver()}setDirection(e){this.chartService.rtl=!!e,this.surface&&this.surface.type===`svg`&&this._destroySurface()}setIntlService(e){this.chartService.intl=e}noTransitionsRedraw(){this._noTransitionsRedraw()}destroy(){this._destroyed=!0,lf(this.element,{[mx]:this._clickHandler,[t_]:this._mousewheelHandler,[px]:this._mousemoveThrottled,[hx]:this._mouseleaveHandler,[fx]:this._mousedownHandler,[gx]:this._keydownHandler,[_x]:this._focusHandler,[vx]:this._blurHandler}),this.domEvents&&(this.domEvents.destroy(),delete this.domEvents),this._mouseMoveTrackHandler&&lf(document,{[px]:this._mouseMoveTrackHandler}),this._focusState=null,this.element._kendoExportVisual=null,this._destroyView(),this._destroySurface(),this._clearRedrawTimeout(),this._destroyStyleObserver()}_destroySurface(){let e=this.surface;e&&(e.unbind(`mouseenter`,this._surfaceMouseenterHandler),e.unbind(`mouseleave`,this._surfaceMouseleaveHandler),e.destroy(),this.surface=null)}_destroySelections(){let e=this._selections;if(e)for(;e.length>0;)e.shift().destroy()}_destroyView(){let e=this._model;e&&(e.destroy(),this._model=null),this._unsetActivePoint(),this._clearFocusedElement(),this._resetDrilldownPoint(),this._destroySelections(),this._tooltip&&this._tooltip.destroy(),this._highlight&&this._highlight.destroy(),this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection),this._pannable&&(this._pannable.destroy(),delete this._pannable),this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)}};function Sx(e){let t=dx;for(let n=0;n<t.length;n++){let r=t[n]+`Axes`;e[r]&&(e[t[n]+`Axis`]=e[r],delete e[r])}}function Cx(e,t){if(e){for(let n=0;n<e.length;n++)if(e[n].category===t)return[e[n]]}}function wx(e,t){let n=(t||{}).axisDefaults||{},r,i,a;function o(e){let t=(e||{}).color||i.color,a=H({},n,n[r],i,i[r],{line:{color:t},labels:{color:t},title:{color:t}},e);return delete a[r],a}for(let t=0;t<dx.length;t++)r=dx[t]+`Axis`,i=e.axisDefaults||{},a=[].concat(e[r]),a=a.map(o),e[r]=a.length>1?a:a[0]}function Tx(e,t){let n=e.series,r=n.length,i=e.seriesDefaults,a=H({},e.seriesDefaults),o=t?H({},t.seriesDefaults):{},s=H({},o);Ex(a),Ex(s);for(let t=0;t<r;t++){let r=n[t].type||e.seriesDefaults.type,c=H({data:[]},s,o[r],{tooltip:e.tooltip},a,i[r]);n[t]._defaults=c,n[t]=H({},c,n[t]),n[t].data=n[t].data||[]}}function Ex(e){delete e.bar,delete e.column,delete e.rangeColumn,delete e.line,delete e.verticalLine,delete e.pie,delete e.donut,delete e.area,delete e.verticalArea,delete e.scatter,delete e.scatterLine,delete e.bubble,delete e.candlestick,delete e.ohlc,delete e.boxPlot,delete e.bullet,delete e.verticalBullet,delete e.polarArea,delete e.polarLine,delete e.radarArea,delete e.radarLine,delete e.waterfall}function Dx(e){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=r.options.name;i&&(t[i]=r.range())}return t}let Ox=[`data`,`categories`];function kx(e,t){for(let n in t)if(!W(n,Ox)&&Nf(t,n)){let r=t[n],i=e[n];if(G(i)){let a=r===null;a||!G(r)?(delete e[n],a&&delete t[n]):i&&kd(r)&&kd(i)&&kx(i,r)}}}function Ax(e){for(let t=0;t<e.length;t++)e[t].notifyRender()}Y(xx,{renderAs:``,motion:{},chartArea:{},axisDefaults:{categoryAxis:{highlight:{visible:!1,border:null}},valueAxis:{narrowRange:!1}},legend:{visible:!0,labels:{},accessibility:{},focusHighlight:{border:{opacity:1,color:b,width:2}}},categoryAxis:{},seriesDefaults:{type:cg,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1},accessibility:{},focusHighlight:{border:{opacity:1,width:2},zIndex:200}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,observeStyles:!1,valueAxis:{},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1});var jx=class extends Hy{_slotAnchor(e,t){let n=this.plotArea.categoryAxis.options.vertical,r=n?{horizontal:`left`,vertical:`center`}:{horizontal:`center`,vertical:`bottom`},i;return i=n?new X(this.plotArea.box.x2,t.center().y):new X(t.center().x,-2),{point:i,align:r}}_defaultAnchor(e,t){return this._slotAnchor({},t)}};let Mx=[`bar`,og];function Nx(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];t[n]=r.style.display,r.style.display=`none`}return t}function Px(e,t){for(let n=0;n<e.length;n++)e[n].style.display=t[n]}function Fx(e){return V(e)?[e]:e}Y(class extends xx{_setElementClass(e){le(e,`k-sparkline`)}_initElement(e){super._initElement(e),this._initialWidth=Math.floor(tf(e).width)}_resize(){let e=this.element,t=Nx(e.children);this._initialWidth=Math.floor(tf(e).width),Px(e.children,t),super._resize()}_modelOptions(){let e=this.options,t=this._surfaceWrap(),n=Nx(t.children),r=document.createElement(`span`);r.innerHTML=`&nbsp;`,t.appendChild(r);let i=H({width:this._autoWidth,height:tf(t).height,transitions:e.transitions},e.chartArea,{inline:!0,align:!1});return tf(t,{width:i.width,height:i.height}),t.removeChild(r),Px(t.children,n),this.surface&&this.surface.resize(),i}_surfaceWrap(){if(!this.stage){let e=this.stage=document.createElement(`span`);this.element.appendChild(e)}return this.stage}_createPlotArea(e){let t=super._createPlotArea(e);return this._autoWidth=this._initialWidth||this._calculateWidth(t),t}_calculateWidth(e){let t=this.options,n=U(t.chartArea.margin),r=e.charts,i=this._surfaceWrap(),a=0;for(let e=0;e<r.length;e++){let t=r[e],n=(t.options.series||[])[0];if(!n)continue;if(n.type===`bar`||n.type===`bullet`)return 150;if(n.type===`pie`)return tf(i).height;let o=t.categoryAxis;if(o){let e=o.categoriesCount()*(!t.options.isStacked&&W(n.type,[`column`,`verticalBullet`])?t.seriesOptions.length:1);a=Math.max(a,e)}}let o=a*t.pointWidth;return o>0&&(o+=n.left+n.right),o}_createSharedTooltip(e){return new jx(this._plotArea,e)}static normalizeOptions(e){let t=Fx(e);return t=j(t)?{seriesDefaults:{data:t}}:H({},t),t.series||=[{data:Fx(t.data)}],H(t,{seriesDefaults:{type:t.type}}),(W(t.series[0].type,Mx)||W(t.seriesDefaults.type,Mx))&&(t=H({},{categoryAxis:{crosshair:{visible:!1}}},t)),t}},{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:`line`,area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]});var Ix=class extends ta{setup(){this._initialOpacity=parseFloat(Nd(this.element,`opacity`).opacity)}step(e){Nd(this.element,{opacity:String(Wd(this._initialOpacity,0,e))})}abort(){super.abort(),Nd(this.element,{display:`none`,opacity:String(this._initialOpacity)})}cancel(){super.abort(),Nd(this.element,{opacity:String(this._initialOpacity)})}};function Lx(e,t){let n=document.createElement(`div`);return n.className=e,t&&(n.style.cssText=t),n}var Rx=class{constructor(e,t,n){this.options=H({},this.options,n),this.container=e,this.chartService=t;let r=Nd(e,[`paddingLeft`,`paddingTop`]);this.chartPadding={top:r.paddingTop,left:r.paddingLeft},this.createElements(),e.appendChild(this.element)}createElements(){let e=this.element=Lx(`k-navigator-hint`,`display: none; position: absolute; top: 1px; left: 1px;`),t=this.tooltip=Lx(`k-tooltip k-chart-tooltip`),n=this.scroll=Lx(`k-scroll`);t.innerHTML=`&nbsp;`,e.appendChild(t),e.appendChild(n)}show(e,t,n){let{element:r,options:i,scroll:a,tooltip:o}=this,s=km(Rm(e)+Rm(t-e)/2),c=n.width()*.4,l=n.center().x-c,u=(n.center().x-l)/(i.max-i.min),d=s-i.min,f=this.chartService.intl.format(i.format,e,t),p=Id(i);this.clearHideTimeout(),this._visible||=(Nd(r,{visibility:`hidden`,display:`block`}),!0),p&&(f=p({from:e,to:t})),o.innerHTML=f,Nd(o,{left:n.center().x-o.offsetWidth/2,top:n.y1});let m=Nd(o,[`marginTop`,`borderTopWidth`,`height`]);Nd(a,{width:c,left:l+d*u,top:n.y1+m.marginTop+m.borderTopWidth+m.height/2}),Nd(r,{visibility:`visible`})}clearHideTimeout(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideAnimation&&this._hideAnimation.cancel()}hide(){this.clearHideTimeout(),this._hideTimeout=setTimeout(()=>{this._visible=!1,this._hideAnimation=new Ix(this.element),this._hideAnimation.setup(),this._hideAnimation.play()},this.options.hideDelay)}destroy(){this.clearHideTimeout(),this.container&&this.container.removeChild(this.element),delete this.container,delete this.chartService,delete this.element,delete this.tooltip,delete this.scroll}};Y(Rx,{format:`{0:d} - {1:d}`,hideDelay:500});let zx=`_navigator`,Bx=zx;var Vx=class e{constructor(e){this.chart=e;let t=this.options=H({},this.options,e.options.navigator),n=t.select;n&&(n.from=this.parseDate(n.from),n.to=this.parseDate(n.to)),G(t.hint.visible)||(t.hint.visible=t.visible),this.chartObserver=new Kd(this,{[Hg]:`_drag`,[Ug]:`_dragEnd`,[Gg]:`_zoom`,[Kg]:`_zoomEnd`}),e.addObserver(this.chartObserver)}parseDate(e){return Um(this.chart.chartService.intl,e)}clean(){this.selection&&=(this.selection.destroy(),null),this.hint&&=(this.hint.destroy(),null)}destroy(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart),this.clean()}redraw(){this._redrawSelf(),this.initSelection()}initSelection(){let{chart:e,options:t}=this,n=this.mainAxis(),{min:r,max:i}=n.roundedRange(),{from:a,to:o,mousewheel:s}=t.select,c=Ux(n);n.categoriesCount()!==0&&(this.clean(),c.box=n.box,this.selection=new By(e,c,{min:r,max:i,from:a||r,to:o||i,mousewheel:J(s,{zoom:`left`}),visible:t.visible},new Kd(this,{selectStart:`_selectStart`,select:`_select`,selectEnd:`_selectEnd`})),t.hint.visible&&(this.hint=new Rx(e.element,e.chartService,{min:r,max:i,template:Id(t.hint),format:t.hint.format})))}setRange(){let{min:e,max:t}=this.chart._createPlotArea(!0).namedCategoryAxes[Bx].roundedRange(),n=this.options.select||{},r=n.from||e;r<e&&(r=e);let i=n.to||t;i>t&&(i=t),this.options.select=H({},n,{from:r,to:i}),this.filterAxes()}_redrawSelf(e){let t=this.chart._plotArea;t&&t.redraw(of(t.panes),e)}redrawSlaves(){let e=this.chart,t=e._plotArea,n=t.panes.filter(e=>e.options.name!==zx);t.srcSeries=e.options.series,t.options.categoryAxis=e.options.categoryAxis,t.clearSeriesPointsCache(),t.redraw(n)}_drag(e){let{chart:t,selection:n}=this,r=t._eventCoordinates(e.originalEvent),i=this.mainAxis(),a=i.roundedRange(),o=i.pane.box.containsPoint(r),s=t._plotArea.categoryAxis,c=e.axisRanges[s.options.name],l=this.options.select,u;if(!c||o||!n)return;u=l.from&&l.to?Rm(l.to)-Rm(l.from):Rm(n.options.to)-Rm(n.options.from);let d=km(K(Rm(c.min),a.min,Rm(a.max)-u)),f=km(K(Rm(d)+u,Rm(a.min)+u,a.max));this.options.select={from:d,to:f},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),n.set(d,f),this.showHint(d,f)}_dragEnd(){this.filterAxes(),this.filter(),this.redrawSlaves(),this.hint&&this.hint.hide()}readSelection(){let{selection:{options:{from:e,to:t}},options:{select:n}}=this;n.from=e,n.to=t}filterAxes(){let{options:{select:e={}},chart:t}=this,n=t.options.categoryAxis,{from:r,to:i}=e;for(let e=0;e<n.length;e++){let t=n[e];t.pane!==`_navigator`&&(t.min=r,t.max=i)}}filter(){let{chart:e,options:{select:t}}=this;if(!e.requiresHandlers([`navigatorFilter`]))return;let n=this.mainAxis(),r={from:t.from,to:t.to};if(n.options.type!==`category`){let n=new rh(H({baseUnit:`fit`},e.options.categoryAxis[0],{categories:[t.from,t.to]}),e.chartService).options;r.from=Nm(n.min,-n.baseUnitStep,n.baseUnit),r.to=Nm(n.max,n.baseUnitStep,n.baseUnit)}this.chart.trigger(`navigatorFilter`,r)}_zoom(e){let{chart:{_plotArea:{categoryAxis:t}},selection:n,options:{select:r,liveDrag:i}}=this,a=this.mainAxis(),o=e.delta;if(!n)return;let s=a.categoryIndex(n.options.from),c=a.categoryIndex(n.options.to),l=this.chart._eventCoordinates(e.originalEvent);e.originalEvent.preventDefault(),Math.abs(o)>1&&(o*=3),c-s>1?(n.zoom(o,l),this.readSelection()):(t.options.min=r.from,r.from=t.scaleRange(-e.delta*this.chart._mousewheelZoomRate(),l).min),i&&(this.filterAxes(),this.redrawSlaves()),n.set(r.from,r.to),this.showHint(this.options.select.from,this.options.select.to)}_zoomEnd(e){this._dragEnd(e)}showHint(e,t){let n=this.chart._plotArea;this.hint&&this.hint.show(e,t,n.backgroundBox())}_selectStart(e){return this.chart._selectStart(e)}_select(e){return this.showHint(e.from,e.to),this.chart._select(e)}_selectEnd(e){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(e)}mainAxis(){let e=this.chart._plotArea;if(e)return e.namedCategoryAxes[Bx]}select(e,t){let n=this.options.select;return e&&t&&(n.from=this.parseDate(e),n.to=this.parseDate(t),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(e,t)),{from:n.from,to:n.to}}static setup(t={},n={}){if(t.__navi)return;t.__navi=!0;let r=H({},n.navigator,t.navigator),i=t.panes=[].concat(t.panes),a=H({},r.pane,{name:zx});r.visible||(a.visible=!1,a.height=.1),t.navigator.position===`top`?i.unshift(a):i.push(a),i.forEach(e=>{e.name=e.name||`_default`}),e.attachAxes(t,r),e.attachSeries(t,r,n)}static attachAxes(e,t){let n=t.series||[],r=e.categoryAxis=[].concat(e.categoryAxis),i=e.valueAxis=[].concat(e.valueAxis);r.concat(i).forEach(e=>{e.pane=e.pane||`_default`});let a=m_(n,Ng).length===0,o=H({type:`date`,pane:zx,roundToBaseUnit:!a,justified:a,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:t.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),s=t.categoryAxis;r.push(H({},o,{maxDateGroups:200},s,{name:Bx,title:null,baseUnit:`fit`,baseUnitStep:`auto`,labels:{visible:!1},majorTicks:{visible:!1}}),H({},o,s,{name:`_navigator_labels`,maxDateGroups:20,baseUnitStep:`auto`,labels:{position:``},plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),H({},o,s,{name:`_navigator_ticks`,maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0})),i.push(H({name:Bx,pane:zx,majorGridLines:{visible:!1},visible:!1},t.valueAxis))}static attachSeries(e,t,n){let r=e.series=e.series||[],i=[].concat(t.series||[]),a=n.seriesColors,o=t.seriesDefaults;for(let e=0;e<i.length;e++)r.push(H({color:a[e%a.length],categoryField:t.dateField,visibleInLegend:!1,tooltip:{visible:!1}},o,i[e],{axis:Bx,categoryAxis:Bx,autoBind:t.autoBindElements}))}};function Hx(){}function Ux(e){return Hx.prototype=e,new Hx}Y(class extends xx{applyDefaults(e,t){let n=tf(this.element).width||600,r=t,i={seriesDefaults:{categoryField:e.dateField},axisDefaults:{categoryAxis:{name:`default`,majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(n/28)}}};r&&=H({},r,i),Vx.setup(e,r),super.applyDefaults(e,r)}_setElementClass(e){le(e,`k-chart k-stockchart`)}setOptions(e){this.destroyNavigator(),super.setOptions(e)}noTransitionsRedraw(){let e=this.options.transitions;this.options.transitions=!1,this._fullRedraw(),this.options.transitions=e}_resize(){this.noTransitionsRedraw()}_redraw(){let e=this.navigator;!this._dirty()&&e&&e.options.partialRedraw?e.redrawSlaves():this._fullRedraw()}_dirty(){let e=this.options,t=[].concat(e.series,e.navigator.series),n=Vd(t,function(e){return e&&e.visible}).length,r=this._seriesCount!==n;return this._seriesCount=n,r}_fullRedraw(){let e=this.navigator;e||(e=this.navigator=new Vx(this),this.trigger(`navigatorCreated`,{navigator:e})),e.clean(),e.setRange(),super._redraw(),e.initSelection()}_trackSharedTooltip(e){let t=this._plotArea.paneByPoint(e);t&&t.options.name===`_navigator`?this._unsetActivePoint():super._trackSharedTooltip(e)}bindCategories(){super.bindCategories(),this.copyNavigatorCategories()}copyNavigatorCategories(){let e=[].concat(this.options.categoryAxis),t;for(let n=0;n<e.length;n++){let r=e[n];r.name===`_navigator`?t=r.categories:t&&r.pane===`_navigator`&&(r.categories=t)}}destroyNavigator(){this.navigator&&=(this.navigator.destroy(),null)}destroy(){this.destroyNavigator(),super.destroy()}_stopChartHandlers(e){let t=this._eventCoordinates(e),n=this._plotArea.paneByPoint(t);return super._stopChartHandlers(e)||n&&n.options.name===`_navigator`}_toggleDragZoomEvents(){this._dragZoomEnabled||=(this.element.style.touchAction=`none`,!0)}},{dateField:`date`,axisDefaults:{categoryAxis:{type:`date`,baseUnit:`fit`,justified:!0},valueAxis:{narrowRange:!0,labels:{format:`C`}}},valueAxis:{narrowRange:!1},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!1},highlight:{visible:!1},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});let Wx=`arrowPointer`,Gx=`barPointer`,Kx=.5,qx=Math.PI/180,Jx=`inside`,Yx=`linear`,Xx=`radialPointer`,Zx=`radialRangePointer`;function Qx(e,t){let n=e.getOrigin(),r=e.getSize(),i=U(t);return e.setOrigin([n.x-i.left,n.y-i.top]),e.setSize([r.width+(i.left+i.right),r.height+(i.top+i.bottom)]),e}let{Group:$x,Path:eS,Text:tS}=To;function nS(e,t){let n=e.box,r=e.children[0].box,i=t.border||{},a=t.background||``,o=eS.fromRect(new N([n.x1,n.y1],[n.width(),n.height()]),{stroke:{}}),s=new tS(e.text,new M(r.x1,r.y1),{font:t.font,fill:{color:t.color}}),c=Qx(s.bbox().clone(),t.padding),l=eS.fromRect(c,{stroke:{color:i.width?i.color:``,width:i.width,opacity:i.opacity,dashType:i.dashType,lineJoin:`round`,lineCap:`round`},fill:{color:a}}),u=new $x;return u.append(o),u.append(l),u.append(s),u}function rS(e,t,n){let r=G(e.from)?e.from:ne,i=G(e.to)?e.to:D;return e.from=Math.max(Math.min(i,r),t),e.to=Math.min(Math.max(i,r),n),e}function iS(e,t){let n=U(t);return n.left=-n.left,n.top=-n.top,n.right=-n.right,n.bottom=-n.bottom,Qx(e,n)}let{Path:aS,Surface:oS}=To;var sS=class{constructor(e,t,n,r={}){this.element=e,this.theme=n,this.contextService=new lm(this,r),this._originalOptions=H({},this.options,t),this.options=H({},this._originalOptions),this._initTheme(n),this.redraw()}destroy(){this.surface&&=(this.surface.destroy(),null),delete this.element,delete this.surfaceElement}value(e){let t=this.pointers[0];if(arguments.length===0)return t.value();t.value(e),this._setValueOptions(e)}_draw(){let e=this.surface;e.clear(),e.draw(this._visuals)}exportVisual(){return this._visuals}allValues(e){let t=this.pointers,n=[];if(arguments.length===0){for(let e=0;e<t.length;e++)n.push(t[e].value());return n}if(j(e))for(let n=0;n<e.length;n++)V(e[n])&&t[n].value(e[n]);this._setValueOptions(e)}_setValueOptions(e){let t=[].concat(this.options.pointer),n=[].concat(e);for(let e=0;e<n.length;e++)t[e].value=n[e]}resize(){this.noTransitionsRedraw()}noTransitionsRedraw(){let e=this.options.transitions;this._toggleTransitions(!1),this.redraw(),this._toggleTransitions(e)}redraw(){let e=this._surfaceSize(),t=new N([0,0],[e.width,e.height]);this._initSurface(),this.gaugeArea=this._createGaugeArea(),this._createModel();let n=iS(t.bbox(),this._gaugeAreaMargin);this.reflow(n)}setOptions(e,t){this._originalOptions=H(this._originalOptions,e),this.options=H({},this._originalOptions),this._initTheme(t),this.redraw()}setDirection(e){this.contextService.rtl=!!e,this.surface&&this.surface.type===`svg`&&(this.surface.destroy(),this.surface=null)}setIntlService(e){this.contextService.intl=e}_initTheme(e){let t=e||this.theme||{};this.theme=t,this.options=H({},t,this.options);let n=this.options,r=n.pointer;if(j(r)){let e=[];for(let n=0;n<r.length;n++)e.push(H({},t.pointer,r[n]));n.pointer=e}}_createGaugeArea(){let e=this.options.gaugeArea,t=this.surface.size(),n=e.border||{},r=new N([0,0],[t.width,t.height]);return this._gaugeAreaMargin=e.margin||5,n.width>0&&(r=iS(r,n.width)),aS.fromRect(r,{stroke:{color:n.width?n.color:``,width:n.width,opacity:n.opacity,dashType:n.dashType,lineJoin:`round`,lineCap:`round`},fill:{color:e.background}})}_initSurface(){let{options:e,surface:t}=this,n=this._surfaceElement(),r=this._surfaceSize();tf(n,r),!t||t.options.type!==e.renderAs?(t&&t.destroy(),this.surface=oS.create(n,{type:e.renderAs})):(this.surface.clear(),this.surface.resize())}_surfaceSize(){let e=this.options,t=this._getSize();return e.gaugeArea&&H(t,e.gaugeArea),t}_surfaceElement(){return this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.element.appendChild(this.surfaceElement)),this.surfaceElement}getSize(){return this._getSize()}_getSize(){let e=this.element,t=this._defaultSize(),n=e.offsetWidth,r=e.offsetHeight;return n||=t.width,r||=t.height,{width:n,height:r}}_defaultSize(){return{width:200,height:200}}_toggleTransitions(e){this.options.transitions=e;for(let t=0;t<this.pointers.length;t++)this.pointers[t].options.animation.transitions=e}};Y(sS,{plotArea:{},theme:`default`,renderAs:``,pointer:{},scale:{},gaugeArea:{}});let{Path:cS,Group:lS}=To,uS=M;function dS(e,t){let{position:n,tickX:r,tickY:i}=e,a,o;return e.vertical?(a=new uS(r,n),o=new uS(r+t.size,n)):(a=new uS(n,i),o=new uS(n,i+t.size)),new cS({stroke:{color:t.color,width:t.width}}).moveTo(a).lineTo(o)}function fS(e,t,n,r){let i=t.length;if(r.visible){let{mirror:a,lineBox:o}=n;for(let s=r.skip;s<i;s+=r.step)s%r.skipUnit!==0&&(n.tickX=a?o.x2:o.x2-r.size,n.tickY=a?o.y1-r.size:o.y1,n.position=t[s],e.append(dS(n,r)))}}var pS=class extends uh{constructor(e,t){let n=e||{};!G(n.reverse)&&n.vertical===!1&&(t||{}).rtl&&(n=Object.assign({},n,{reverse:!0})),super(0,1,n,t),this.options.minorUnit=this.options.minorUnit||this.options.majorUnit/10}initUserOptions(e){let t=H({},this.options,e);return t=H({},t,{labels:{mirror:t.mirror}}),t.majorUnit=t.majorUnit||A(t.min,t.max),t}initFields(){}render(){let e=this.elements=new lS,t=this.renderLabels(),n=this.renderLine(),r=this.renderTicks(),i=this.renderRanges();return e.append(n,t,r,i),e}renderRanges(){let e=this.options,{min:t,max:n,vertical:r,labels:{mirror:i}}=e,a=e.ranges||[],o=new lS,s=a.length,c=e.rangeSize||e.minorTicks.size/2;for(let e=0;e<s;e++){let s=rS(a[e],t,n),l=this.getSlot(s.from,s.to),u=r?this.lineBox():l,d=r?l:this.lineBox();r?u.x1-=c*(i?-1:1):d.y2+=c*(i?-1:1),o.append(cS.fromRect(new N([u.x1,d.y1],[u.x2-u.x1,d.y2-d.y1]),{fill:{color:s.color,opacity:s.opacity},stroke:{}}))}return o}renderLabels(){let{labels:e,options:t}=this,n=new lS;for(let r=0;r<e.length;r++)n.append(nS(e[r],t.labels));return n}renderLine(){let e=this.options.line,t=this.lineBox(),n=new lS;if(e.width>0&&e.visible){let r=new cS({stroke:{color:e.color,dashType:e.dashType,width:e.width}});r.moveTo(t.x1,t.y1).lineTo(t.x2,t.y2),n.append(r)}return n}renderTicks(){let e=new lS,t=this.options,n=t.majorTicks.visible?t.majorUnit:0,r={vertical:t.vertical,mirror:t.labels.mirror,lineBox:this.lineBox()};return fS(e,this.getMajorTickPositions(),r,t.majorTicks),fS(e,this.getMinorTickPositions(),r,H({},{skipUnit:n/t.minorUnit},t.minorTicks)),e}};Y(pS,{min:0,max:50,majorTicks:{size:15,align:Jx,color:b,width:Kx,visible:!0},minorTicks:{size:10,align:Jx,color:b,width:Kx,visible:!0},line:{width:Kx},labels:{position:Jx,padding:2},mirror:!1,_alignLines:!1});var mS=class{constructor(e,t){let{min:n,max:r}=e.options,i=this.options=H({},this.options,t);i.fill=i.color,this.scale=e,G(i.value)?i.value=K(i.value,n,r):i.value=n}value(e){let t=this.options,n=t.value;if(arguments.length===0)return n;let{min:r,max:i}=this.scale.options;t._oldValue=G(t._oldValue)?t.value:r,t.value=K(e,r,i),this.elements&&this.repaint()}};Y(mS,{color:b});var hS=class extends mS{constructor(e,t){super(e,t),this.options=H({track:{visible:G(t.track)}},this.options)}reflow(){let{options:e,scale:t}=this,{mirror:n,vertical:r}=t.options,i=t.lineBox(),a=e.track.size||e.size,o=e.size/2,s=U(e.margin),c=r?s[n?`left`:`right`]:s[n?`bottom`:`top`],l,u,d;c=n?-c:c,r?(d=new Z(i.x1+c,i.y1,i.x1+c,i.y2),n?d.x1-=a:d.x2+=a,e.shape!==`barPointer`&&(u=new Z(i.x2+c,i.y1-o,i.x2+c,i.y2+o),l=u)):(d=new Z(i.x1,i.y1-c,i.x2,i.y1-c),n?d.y2+=a:d.y1-=a,e.shape!==`barPointer`&&(u=new Z(i.x1-o,i.y1-c,i.x2+o,i.y1-c),l=u)),this.trackBox=d,this.pointerRangeBox=u,this.box=l||d.clone().pad(e.border.width)}getElementOptions(){let e=this.options;return{fill:{color:e.color,opacity:e.opacity},stroke:G(e.border)?{color:e.border.width?e.border.color||e.color:``,width:e.border.width,dashType:e.border.dashType,opacity:e.opacity}:null}}_margin(){let{scale:e,options:t}=this,{mirror:n,vertical:r}=e.options,i=U(t.margin);return r?i[n?`left`:`right`]:i[n?`bottom`:`top`]}};Y(hS,{shape:Gx,track:{border:{width:1}},color:b,border:{width:1},opacity:1,margin:U(3),animation:{type:Gx},visible:!0});var gS=class extends ta{setup(){let e=this.options,{margin:t,from:n,to:r,vertical:i}=e,a=i?`x1`:`y1`;e.mirror===i?(n[a]-=t,r[a]-=t):(n[a]+=t,r[a]+=t);let o=this.fromScale=new M(n.x1,n.y1),s=this.toScale=new M(r.x1,r.y1);e.duration!==0&&(e.duration=Math.max(o.distanceTo(s)/e.duration*1e3,1))}step(e){let t=Wd(this.fromScale.x,this.toScale.x,e),n=Wd(this.fromScale.y,this.toScale.y,e);this.element.transform(P().translate(t,n))}};Y(gS,{easing:Yx,duration:250}),Zi.current.register(Wx,gS);let _S=M,vS=F;var yS=class extends hS{constructor(e,t){super(e,t),G(this.options.size)||(this.options.size=this.scale.options.majorTicks.size*.6)}pointerShape(){let{scale:e,options:{size:t}}=this,n=t/2,r=e.options.mirror?-1:1,i;return i=e.options.vertical?[new _S(0,0-n),new _S(0-r*t,0),new _S(0,0+n)]:[new _S(0-n,0),new _S(0,0+r*t),new _S(0+n,0)],i}repaint(){let{scale:e,options:t}=this,n=new gS(this.elements,H(t.animation,{vertical:e.options.vertical,mirror:e.options.mirror,margin:this._margin(t.margin),from:e.getSlot(t._oldValue),to:e.getSlot(t.value)}));t.animation.transitions===!1&&(n.options.duration=0),n.setup(),n.play()}render(){let{scale:e,options:t}=this,n=this.getElementOptions(),r=this.pointerShape(t.value);t.animation.type=Wx;let i=new vS({stroke:n.stroke,fill:n.fill}).moveTo(r[0]).lineTo(r[1]).lineTo(r[2]).close(),a=e.getSlot(t.value);return i.transform(P().translate(a.x1,a.y1)),this.elements=i,i}},bS=class extends ta{setup(){let e=this.options,t=this.axis=e.vertical?`y`:`x`,n=this.to=e.newPoints[0][t],r=this.from=e.oldPoints[0][t];e.duration!==0&&(e.duration=Math.max(Math.abs(n-r)/e.speed*1e3,1)),this._set(r)}step(e){let t=Wd(this.from,this.to,e);this._set(t)}_set(e){let t=`set`+this.axis.toUpperCase(),n=this.options.newPoints;n[0][t](e),n[1][t](e)}};Y(bS,{easing:Yx,speed:250}),Zi.current.register(Gx,bS);let{Group:xS,Path:SS}=To;var CS=class extends hS{constructor(e,t){super(e,t),G(this.options.size)||(this.options.size=this.scale.options.majorTicks.size*.3)}pointerShape(e){let{scale:t,options:n}=this,{mirror:r,vertical:i}=t.options,a=r===i?-1:1,o=n.size*a,s=t.getSlot(t.options.min),c=t.getSlot(e),l=i?`y`:`x`,u=i?`x`:`y`,d=this._margin()*a,f=new M;f[l]=s[l+`1`],f[u]=s[u+`1`];let p=new M;p[l]=c[l+`1`],p[u]=c[u+`1`],i?(f.translate(d,0),p.translate(d,0)):(f.translate(0,d),p.translate(0,d));let m=p.clone(),h=f.clone();return i?(m.translate(o,0),h.translate(o,0)):(m.translate(0,o),h.translate(0,o)),[f,p,m,h]}repaint(){let{scale:e,options:t}=this,n=this.pointerShape(t.value),r=this.pointerPath,i=this.pointerShape(t._oldValue);r.moveTo(n[0]).lineTo(n[1]).lineTo(n[2]).lineTo(n[3]).close();let a=new bS(r,H(t.animation,{reverse:e.options.reverse,vertical:e.options.vertical,oldPoints:[i[1],i[2]],newPoints:[n[1],n[2]]}));t.animation.transitions===!1&&(a.options.duration=0),a.setup(),a.play()}render(){let e=new xS,t=this.getElementOptions();this.options.track.visible&&e.append(this.renderTrack());let n=this.pointerPath=new SS({stroke:t.stroke,fill:t.fill});return e.append(n),this.elements=e,e}renderTrack(){let e=this.options.track,t=e.border||{},n=this.trackBox.clone().pad(t.width||0);return SS.fromRect(n.toRect(),{fill:{color:e.color,opacity:e.opacity},stroke:{color:t.width?t.color||e.color:``,width:t.width,dashType:t.dashType}})}};let wS=I;Y(class extends sS{reflow(e){let t=this.pointers,n=e.origin.x,r=e.origin.y,i=new Z(n,r,n+e.width(),r+e.height());this.scale.reflow(i),this._shrinkScaleWidth(i);for(let e=0;e<t.length;e++)t[e].reflow();this.bbox=this._getBox(i),this._alignElements(),this._shrinkElements(),this._buildVisual(),this._draw()}_buildVisual(){let e=new wS,t=this.scale.render(),n=this.pointers;e.append(this.gaugeArea),e.append(t);for(let t=0;t<n.length;t++){let r=n[t];e.append(r.render()),r.value(r.options.value)}this._visuals=e}_createModel(){let e=this.options,t=this.scale=new pS(e.scale,this.contextService);this.pointers=[];let n=e.pointer;n=j(n)?n:[n];for(let r=0;r<n.length;r++){let i=H({},n[r],{animation:{transitions:e.transitions}}),a=i.shape===`arrow`?yS:CS;this.pointers.push(new a(t,i))}}_defaultSize(){let e=this.options.scale.vertical;return{width:e?60:200,height:e?200:60}}_getBox(e){let{scale:t,pointers:n}=this,r=e.center(),i=n[0].box.clone().wrap(t.box);for(let e=0;e<n.length;e++)i.wrap(n[e].box.clone());let a;return t.options.vertical?(a=i.width()/2,i=new Z(r.x-a,e.y1,r.x+a,e.y2)):(a=i.height()/2,i=new Z(e.x1,r.y-a,e.x2,r.y+a)),i}_alignElements(){let{scale:e,pointers:t}=this,n=e.box,r=t[0].box.clone().wrap(e.box),i=this.bbox;for(let e=0;e<t.length;e++)r.wrap(t[e].box.clone());let a;e.options.vertical?(a=i.center().x-r.center().x,e.reflow(new Z(n.x1+a,i.y1,n.x2+a,i.y2))):(a=i.center().y-r.center().y,e.reflow(new Z(n.x1,n.y1+a,n.x2,n.y2+a)));for(let e=0;e<t.length;e++)t[e].reflow(this.bbox)}_shrinkScaleWidth(e){let{scale:t}=this;if(!t.options.vertical){let n=t.contentBox().width()-e.width();n>0&&(t.box.shrink(n,0),t.box.alignTo(e,`center`),t.reflow(t.box))}}_shrinkElements(){let{scale:e,pointers:t}=this,n=e.box.clone(),r=e.options.vertical?`y`:`x`,i=t[0].box;for(let e=0;e<t.length;e++)i.wrap(t[e].box.clone());n[r+1]+=Math.max(n[r+1]-i[r+1],0),n[r+2]-=Math.max(i[r+2]-n[r+2],0),e.reflow(n);for(let e=0;e<t.length;e++)t[e].reflow(this.bbox)}},{transitions:!0,gaugeArea:{background:``},scale:{vertical:!0}});let{Arc:TS,Path:ES,Group:DS}=To;function OS(e,t,n,r){let i=new DS,a=e.center,o=e.getRadiusX();if(r.visible)for(let n=0;n<t.length;n++){let s=e.pointAt(t[n]),c=new M(a.x+o-r.size,a.y).rotate(t[n],a);i.append(new ES({stroke:{color:r.color,width:r.width}}).moveTo(s).lineTo(c))}return i}function kS(e,t,n,r){return{from:e,to:t,color:n,opacity:r}}var AS=class extends uh{constructor(e,t){super(0,1,e,t)}initUserOptions(e){let t=H({},this.options,e);return t.majorUnit=t.majorUnit||A(t.min,t.max),t.minorUnit=t.minorUnit||t.majorUnit/10,t}initFields(){}render(e,t){let n=this.renderArc(e,t);this.bbox=n.bbox(),this.labelElements=this.renderLabels(),this.ticks=this.renderTicks(),this.ranges=this.renderRanges()}reflow(e){let t=e.center(),n=Math.min(e.height(),e.width())/2;if(G(this.bbox))this.bbox=this.arc.bbox(),this.radius(this.arc.getRadiusX()),this.repositionRanges(),this.renderLabels();else return this.render(t,n)}slotAngle(e){let{min:t,max:n,reverse:r,startAngle:i,endAngle:a}=this.options,o=a-i,s;return s=r?a-(e-t)/(n-t)*o:(e-t)/(n-t)*o+i,s+180}hasRanges(){let e=this.options.ranges;return e&&e.length}ticksSize(){let{majorTicks:e,minorTicks:t}=this.options,n=0;return e.visible&&(n=e.size),t.visible&&(n=Math.max(t.size,n)),n}labelsCount(){let e=super.labelsCount(),t=this.options;return t.endAngle-t.startAngle>=360&&t.max%t.majorUnit===0&&--e,e}renderLabels(){let e=this.options,t=this.arc.clone(),n=t.getRadiusX(),r=this.tickAngles(t,e.majorUnit),i=e.rangeSize=e.rangeSize||n*.1,a=new DS,o=n*.05;G(e.rangeDistance)?o=e.rangeDistance:e.rangeDistance=o;let s=e.labels,c=s.position===Jx,l=G(this.labelElements);c&&(n-=this.ticksSize(),this.hasRanges()&&!l&&(n-=i+o),t.setRadiusX(n).setRadiusY(n));let u=this.labels,d=u.length,f=U(s.padding),p=(f.left+f.right)/2,m=(f.top+f.bottom)/2;for(let n=0;n<d;n++){let i=u[n],o=i.box.width()/2,s=i.box.height()/2,d=r[n],f=(d-180)*qx,h=t.pointAt(d),g=h.x+Math.cos(f)*(o+p)*(c?1:-1),_=h.y+Math.sin(f)*(s+m)*(c?1:-1);i.reflow(new Z(g-o,_-s,g+o,_+s));let v=new M(i.box.x1,i.box.y1),y;if(!l)y=nS(i,e.labels),a.append(y);else{y=this.labelElements.children[n];let e=y.bbox().origin,t=y.transform()||P();t.translate(v.x-e.x,v.y-e.y),y.transform(t)}this.bbox=N.union(this.bbox,y.bbox())}return a}repositionRanges(){let e=this.ranges.children;if(e.length>0){let{rangeDistance:t,rangeSize:n}=this.options,r=this.getRangeRadius();this.options.labels.position===`inside`&&(r+=n+t);let i=r+n/2;for(let t=0;t<e.length;t++)e[t]._geometry.setRadiusX(i).setRadiusY(i);this.bbox=N.union(this.bbox,this.ranges.bbox())}}renderRanges(){let e=this.rangeSegments(),t=e.length,n=new DS;if(t){let{rangeSize:r,reverse:i,rangeDistance:a}=this.options,o=this.getRangeRadius();this.radius(this.radius()-r-a);for(let r=0;r<t;r++){let t=e[r],a=this.slotAngle(t[i?`to`:`from`]),s=this.slotAngle(t[i?`from`:`to`]);s-a!==0&&n.append(this.createRange(a,s,o,t))}}return n}createRange(e,t,n,r){let i=this.options.rangeSize,a=new Wn(this.arc.center,{radiusX:n+i/2,radiusY:n+i/2,startAngle:e,endAngle:t});return new TS(a,{stroke:{width:i,color:r.color,opacity:r.opacity,lineCap:r.lineCap}})}rangeSegments(){let e=this.options,t=e.ranges||[],n=t.length,r=[];if(n){let{min:i,max:a,rangePlaceholderColor:o}=e;r.push(kS(i,a,o));for(let e=0;e<n;e++){let n=rS(t[e],i,a),s=r.length;for(let e=0;e<s;e++){let t=r[e];if(t.from<=n.from&&n.from<=t.to){r.push(kS(n.from,n.to,n.color,n.opacity)),t.from<=n.to&&n.to<=t.to&&r.push(kS(n.to,t.to,o,n.opacity)),t.to=n.from;break}}}}return r}getRangeRadius(){let{arc:e,options:t}=this,{rangeSize:n,rangeDistance:r,majorTicks:{size:i}}=t,a;return a=t.labels.position===`outside`?e.getRadiusX()-i-r-n:e.getRadiusX()-n,a}renderArc(e,t){let n=this.options;return this.arc=new Wn(e,{radiusX:t,radiusY:t,startAngle:n.startAngle+180,endAngle:n.endAngle+180})}renderTicks(){let{arc:e,options:t}=this,n=e.clone();this.majorTickAngles=this.tickAngles(e,t.majorUnit),this.majorTicks=OS(n,this.majorTickAngles,t.majorUnit,t.majorTicks);let r=new DS;r.append(this.majorTicks);let i=t.majorTicks.size,a=t.minorTicks.size;if(this._tickDifference=i-a,t.labels.position===`outside`){let e=n.getRadiusX();n.setRadiusX(e-i+a).setRadiusY(e-i+a)}return this.minorTickAngles=this.normalizeTickAngles(this.tickAngles(e,t.minorUnit)),this.minorTicks=OS(n,this.minorTickAngles,t.minorUnit,t.minorTicks),r.append(this.minorTicks),r}normalizeTickAngles(e){let t=this.options,n=t.majorUnit/t.minorUnit;for(let t=e.length-1;t>=0;t--)t%n===0&&e.splice(t,1);return e}tickAngles(e,t){let n=this.options,r=n.reverse,i=n.max-n.min,a=e.endAngle-e.startAngle,o=i/t,s=e.startAngle,c=a/o;r&&(s+=a,c=-c),a>=360&&n.max%t===0&&--o;let l=[];for(let e=0;e<o;e++)l.push(q(s,3)),s+=c;return q(s)<=e.endAngle&&l.push(s),l}radius(e){if(e)this.arc.setRadiusX(e).setRadiusY(e),this.repositionTicks(this.majorTicks.children,this.majorTickAngles),this.repositionTicks(this.minorTicks.children,this.minorTickAngles,!0);else return this.arc.getRadiusX()}repositionTicks(e,t,n){let r=n&&this._tickDifference||0,i=this.arc,a=i.getRadiusX();n&&this.options.labels.position===`outside`&&r!==0&&(i=this.arc.clone(),i.setRadiusX(a-r).setRadiusY(a-r));for(let n=0;n<e.length;n++){let r=i.pointAt(t[n]),a=e[n].segments,o=r.x-a[0].anchor().x,s=r.y-a[0].anchor().y;e[n].transform(new P().translate(o,s))}}};Y(AS,{min:0,max:100,majorTicks:{size:15,align:Jx,color:b,width:Kx,visible:!0},minorTicks:{size:10,align:Jx,color:b,width:Kx,visible:!0},startAngle:-30,endAngle:210,labels:{position:Jx,padding:2}});var jS=class extends ta{constructor(e,t){super(e,t);let n=this.options;n.duration=Math.max(Math.abs(n.newAngle-n.oldAngle)/n.duration*1e3,1)}step(e){let t=this.options,n=Wd(t.oldAngle,t.newAngle,e);this.element.transform(P().rotate(n,t.center))}};Y(jS,{easing:Yx,duration:150}),Zi.current.register(Xx,jS);let{Circle:MS,Group:NS,Path:PS}=To;var FS=class extends mS{setAngle(e){this.elements.transform(P().rotate(e,this.center))}repaint(){let{scale:e,options:t}=this,n=e.slotAngle(t._oldValue),r=e.slotAngle(t.value);t.animation.transitions===!1?this.setAngle(r):new jS(this.elements,H(t.animation,{oldAngle:n,newAngle:r})).play()}render(){let{scale:e,options:t}=this,n=new NS;return t.animation!==!1&&H(t.animation,{startAngle:0,center:e.arc.center,reverse:e.options.reverse}),n.append(this._renderNeedle(),this._renderCap()),this.elements=n,this.setAngle(qx),n}reflow(e){let t=this.center=e.center,n=K(this.options.length||1,.1,1.5),r=this.radius=e.getRadiusX()*n,i=this.capSize=Math.round(r*this.options.cap.size);this.bbox=N.fromPoints(new M(t.x-i,t.y-i),new M(t.x+i,t.y+i))}_renderNeedle(){let e=this.scale.options.minorTicks.size,t=this.center,n=this.options.color,r=new PS({fill:{color:n},stroke:{color:n,width:Kx}});return r.moveTo(t.x+this.radius-e,t.y).lineTo(t.x,t.y-this.capSize/2).lineTo(t.x,t.y+this.capSize/2).close(),r}_renderCap(){let e=this.options,t=e.cap.color||e.color,n=new jn(this.center,this.capSize);return new MS(n,{fill:{color:t},stroke:{color:t}})}};Y(FS,{cap:{size:.05},arrow:{width:16,height:14},animation:{type:Xx,duration:150}});let IS=I;var LS=class extends sS{reflow(e){let t=this.pointers;this.scale.reflow(e),this._initialPlotArea=this.scale.bbox;for(let e=0;e<t.length;e++)t[e].reflow(this.scale.arc),this._initialPlotArea=N.union(this._initialPlotArea,t[e].bbox);this.fitScale(e),this.alignScale(e),this._buildVisual(this.gaugeArea,t,this.scale),this._draw()}_buildVisual(e,t,n){let r=this._visuals=new IS;r.append(e),r.append(n.ticks),r.append(n.ranges),this._buildPointers(t),r.append(n.labelElements)}_buildPointers(e){for(let t=0;t<e.length;t++){let n=e[t];n.render(),this._visuals.append(n.elements),n.value(n.options.value)}}fitScale(e){let t=this.scale.arc,n=this._initialPlotArea,r=Math.abs(this.getDiff(n,e)),i=q(r,3),a=q(-r,3),o,s,c,l,u,d=0,f=0;for(;f++<100&&(d=u===c?d+1:0,!(d>5||i!==l&&(o=this.getPlotBox(i,e,t),0<=o&&o<=2)||a!==l&&(c=this.getPlotBox(a,e,t),0<=c&&c<=2)||(l=o>0&&c>0?i*2:o<0&&c<0?a*2:q((i+a)/2||1,3),s=this.getPlotBox(l,e,t),0<=s&&s<=2)));)u=c,s>0?(a=l,c=s):(i=l,o=s)}getPlotBox(e,t,n){let r=this.scale,i=this.pointers,a=n.getRadiusX(),o=n.clone();o.setRadiusX(a+e).setRadiusY(a+e),r.arc=o,r.reflow(t),this.plotBbox=r.bbox;for(let e=0;e<i.length;e++)i[e].reflow(o),this.plotBbox=N.union(this.plotBbox,i[e].bbox);return this.getDiff(this.plotBbox,t)}getDiff(e,t){return Math.min(t.width()-e.width(),t.height()-e.height())}alignScale(e){let t=this.plotBbox.center(),n=e.center(),r=t.x-n.x,i=t.y-n.y,{scale:a,pointers:o}=this;a.arc.center.x-=r,a.arc.center.y-=i,a.reflow(e);for(let e=0;e<o.length;e++)o[e].reflow(a.arc),this.plotBbox=N.union(a.bbox,o[e].bbox)}_createModel(){let e=this.options,t=e.pointer,n=this.scale=new AS(e.scale,this.contextService);this.pointers=[];let r=j(t)?t:[t];for(let t=0;t<r.length;t++){let i=new FS(n,H({},r[t],{animation:{transitions:e.transitions}}));this.pointers.push(i)}}};Y(LS,{transitions:!0,gaugeArea:{background:``}});var RS=class extends AS{rangeSegments(){let{min:e,max:t,rangePlaceholderColor:n,rangeLineCap:r}=this.options;return[{from:e,to:t,color:n,lineCap:r}]}hasRanges(){return!0}placeholderRangeAngle(e){let t=this.ranges.children[0].geometry();this.options.reverse?t.setEndAngle(e):t.setStartAngle(e)}addRange(e,t,n){let r=this.options.reverse,i=this.slotAngle(r?t:e),a=this.slotAngle(r?e:t),o=this.createRange(i,a,this.getRangeRadius(),n);return this.ranges.append(o),o}};Y(RS,{min:0,max:100,majorTicks:{visible:!1},minorTicks:{visible:!1},labels:{visible:!1},startAngle:0,endAngle:180,rangeLineCap:`round`});var zS=class extends ta{constructor(e,t){super(e,t);let n=this.options,r=Math.abs(n.newAngle-n.oldAngle)/n.duration*1e3;n.duration=K(r,150,800);let i=e.elements.options.get(`stroke.color`),a=e.currentColor();i!==a&&(this.startColor=new We(i),this.color=new We(a))}step(e){let{options:t,startColor:n,color:r}=this,i=Wd(t.oldAngle,t.newAngle,e);if(this.element.angle(i),r){let t=q(Wd(n.r,r.r,e)),i=q(Wd(n.g,r.g,e)),a=q(Wd(n.b,r.b,e));this.element.stroke(new We(t,i,a).toHex())}}};Y(zS,{easing:Yx,duration:150}),Zi.current.register(Zx,zS);var BS=class extends mS{repaint(){let{scale:e,options:t}=this,n=e.slotAngle(t._oldValue),r=e.slotAngle(t.value);this.animation&&this.animation.abort(),t.animation.transitions===!1?(this.angle(r),this.stroke(this.currentColor())):(this.animation=new zS(this,H(t.animation,{oldAngle:n,newAngle:r})),this.animation.play())}angle(e){let t=this.elements.geometry();this.scale.options.reverse?t.setStartAngle(e):t.setEndAngle(e),this.scale.placeholderRangeAngle(e)}stroke(e){this.elements.stroke(e)}render(){if(this.elements)return;let{scale:e,options:t}=this;t.animation!==!1&&H(t.animation,{startAngle:0,center:e.arc.center,reverse:e.options.reverse}),this.elements=e.addRange(e.options.min,this.options.value,{color:this.currentColor(),opacity:t.opacity,lineCap:e.options.rangeLineCap})}currentColor(){let{min:e,max:t}=this.scale.options,{colors:n,color:r,value:i}=this.options,a=V(i)?i:e;if(n)for(let r=0;r<n.length;r++){let{color:i,from:o=e,to:s=t}=n[r];if(o<=a&&a<=s)return i}return r}reflow(){this.render(),this.bbox=this.elements.bbox()}};Y(BS,{animation:{type:Zx,duration:150}});var VS=class extends LS{_initTheme(e){super._initTheme(e),this.options.color=this.options.color||(this.theme.pointer||{}).color}_createModel(){let e=this.options,t=new BS(this.scale=new RS(e.scale,this.contextService),H({},{colors:e.colors,color:e.color,value:e.value,opacity:e.opacity,animation:{transitions:e.transitions}}));this.pointers=[t]}_buildPointers(e){for(let t=0;t<e.length;t++){let n=e[t];n.render(),n.value(n.options.value)}}_setValueOptions(e){this.options.value=e}currentColor(){let e=this.pointers[0];if(e)return e.currentColor()}centerLabelPosition(e,t){let n=this.getSize(),r=this.scale.arc.center,i=r.x-e/2,a=r.y-t/2;if(e<n.width){let t=i+e;i=Math.max(i,0),t>n.width&&(i-=t-n.width)}if(t<n.height){let e=this.scale.bbox,n=e.bottomRight().y,r=a+t;a=Math.max(a,e.origin.y),r>n&&(a-=r-n)}return{left:i,top:a}}};(class extends VS{_createModel(){let e=this.options.scale;typeof e.startAngle!=`number`&&(e.startAngle=90),e.endAngle=e.startAngle+360,super._createModel()}});var HS=class{constructor(e){this.setOptions(e),this.initProperties()}initProperties(){}setOptions(e){this.options=Object.assign({},this.options,e),this.quietZoneLength=this.options.addQuietZone?2*this.options.quietZoneLength:0}encode(e,t,n){let r=G(e)?String(e):e;return this.initValue(r,t,n),this.options.addQuietZone&&this.addQuietZone(),this.addData(),this.options.addQuietZone&&this.addQuietZone(),{baseUnit:this.baseUnit,pattern:this.pattern}}initValue(){}addQuietZone(){this.pattern.push(this.options.quietZoneLength||10)}addData(){}invalidCharacterError(e){throw Error(`Character "${e}" is not valid for symbology ${this.name}.`)}};Y(HS,{quietZoneLength:10,addQuietZone:!0,addCheckSum:!0});let US=Object.assign;var WS=class extends HS{initProperties(){super.initProperties(),US(this,{name:`Code 11`,characterMap:[`111121`,`211121`,`121121`,`221111`,`112121`,`212111`,`122111`,`111221`,`211211`,`211111`,`112111`],cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:`-`,START:`112211`,STOP:`11221`})}initValue(e,t){this.pattern=[],this.value=e,this.width=t,this.totalUnits=0}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addCheckSum(){let e=this.value,t=e.length,n=this.getWeightedSum(e,t,this.cCheckSumTotal)%this.checkSumMod;if(this.checksum=String(n),this.addPattern(this.characterMap[n]),t++,t>=this.kCheckSumMinLength){let r=(n+this.getWeightedSum(e,t,this.kCheckSumTotal))%this.checkSumMod;this.checksum+=r,this.addPattern(this.characterMap[r])}}getWeightedSum(e,t,n){let r=0;for(let i=0;i<e.length;i++)r+=this.weightedValue(this.getValue(e.charAt(i)),t,i,n);return r}weightedValue(e,t,n,r){return((t-n)%r||r)*e}getValue(e){if(isNaN(e))e!==this.DASH&&this.invalidCharacterError(e);else return parseInt(e,10);return this.DASH_VALUE}addCharacter(e){let t=this.getValue(e),n=this.characterMap[t];this.addPattern(n)}addPattern(e){let t;for(let n=0;n<e.length;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t),this.totalUnits+=t}};Y(WS,{addCheckSum:!0});let GS=Object.assign;var KS=class extends HS{initProperties(){super.initProperties(),GS(this,{minBaseUnitLength:.7})}addData(){let e=this.value;this.addStart();for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.pushCheckSum(),this.addStop(),this.prepareValues()}addCharacter(e){let t=this.characterMap[e];t||this.invalidCharacterError(e),this.addBase(t)}addBase(){}},qS=class extends KS{initProperties(){super.initProperties(),GS(this,{name:`Code 39`,checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:`|`,patternMappings:{b:`1|`,w:`1|`,B:`ratio|`,W:`ratio|`},characterMap:{0:{pattern:`bwbWBwBwb`,value:0},1:{pattern:`BwbWbwbwB`,value:1},2:{pattern:`bwBWbwbwB`,value:2},3:{pattern:`BwBWbwbwb`,value:3},4:{pattern:`bwbWBwbwB`,value:4},5:{pattern:`BwbWBwbwb`,value:5},6:{pattern:`bwBWBwbwb`,value:6},7:{pattern:`bwbWbwBwB`,value:7},8:{pattern:`BwbWbwBwb`,value:8},9:{pattern:`bwBWbwBwb`,value:9},A:{pattern:`BwbwbWbwB`,value:10},B:{pattern:`bwBwbWbwB`,value:11},C:{pattern:`BwBwbWbwb`,value:12},D:{pattern:`bwbwBWbwB`,value:13},E:{pattern:`BwbwBWbwb`,value:14},F:{pattern:`bwBwBWbwb`,value:15},G:{pattern:`bwbwbWBwB`,value:16},H:{pattern:`BwbwbWBwb`,value:17},I:{pattern:`bwBwbWBwb`,value:18},J:{pattern:`bwbwBWBwb`,value:19},K:{pattern:`BwbwbwbWB`,value:20},L:{pattern:`bwBwbwbWB`,value:21},M:{pattern:`BwBwbwbWb`,value:22},N:{pattern:`bwbwBwbWB`,value:23},O:{pattern:`BwbwBwbWb`,value:24},P:{pattern:`bwBwBwbWb`,value:25},Q:{pattern:`bwbwbwBWB`,value:26},R:{pattern:`BwbwbwBWb`,value:27},S:{pattern:`bwBwbwBWb`,value:28},T:{pattern:`bwbwBwBWb`,value:29},U:{pattern:`BWbwbwbwB`,value:30},V:{pattern:`bWBwbwbwB`,value:31},W:{pattern:`BWBwbwbwb`,value:32},X:{pattern:`bWbwBwbwB`,value:33},Y:{pattern:`BWbwBwbwb`,value:34},Z:{pattern:`bWBwBwbwb`,value:35},"-":{pattern:`bWbwbwBwB`,value:36},".":{pattern:`BWbwbwBwb`,value:37}," ":{pattern:`bWBwbwBwb`,value:38},$:{pattern:`bWbWbWbwb`,value:39},"/":{pattern:`bWbWbwbWb`,value:40},"+":{pattern:`bWbwbWbWb`,value:41},"%":{pattern:`bwbWbWbWb`,value:42},START:{pattern:`bWbwBwBwb`}}})}initValue(e,t,n){this.width=t,this.height=n,this.value=e,this.dataLength=e.length,this.pattern=[],this.patternString=``}prepareValues(){let e=this.minBaseUnitLength,t=this.minRatio,n=Math.ceil(Math.max(.15*this.width,24)),r,i=this.maxRatio;if(this.height<n)throw Error(`Insufficient height for Code39 encoding: the current height is ${this.height}px and the minimum height is ${n}px.`);for(r=this.getBaseUnit(i);r<e&&i>t;)i=parseFloat((i-.1).toFixed(1)),r=this.getBaseUnit(i);if(r<e){let n=Math.ceil(this.getBaseWidth(t)*e);throw Error(`Insufficient width for Code39 encoding: the current width is ${this.width}px and the minimum width for value "${this.value}" is ${n}px.`)}this.ratio=i,this.baseUnit=r,this.patternString=this.patternString.substring(0,this.patternString.length-1),this.pattern=this.pattern.concat(this.patternString.replace(/ratio/g,i).split(this.splitCharacter))}getBaseUnit(e){return this.width/this.getBaseWidth(e)}getBaseWidth(e){let t=3*(e+2);return this.quietZoneLength+t*(this.dataLength+2)+this.gapWidth*(this.dataLength+1)}addStart(){this.addPattern(this.characterMap.START.pattern),this.addCharacterGap()}addBase(e){this.addPattern(e.pattern),this.addCharacterGap()}addStop(){this.addPattern(this.characterMap.START.pattern)}addPattern(e){for(let t=0;t<e.length;t++)this.patternString+=this.patternMappings[e.charAt(t)]}addCharacterGap(){this.patternString+=this.gapWidth+this.splitCharacter}};Y(qS,{addCheckSum:!1});let JS={addCharacter(e){this.characterMap[e]?this.addBase(this.characterMap[e]):e.charCodeAt(0)>127?this.invalidCharacterError(e):this.addExtended(e.charCodeAt(0))},addExtended(e){let t;for(let n=0;n<this.extendedMappings.length;n++)if(t=this.extendedMappings[n].call(this,e),t){for(let e=0;e<t.length;e++){let n=t[e];this.addBase(n)}this.dataLength+=t.length-1;return}},extendedMappings:[function(e){if(97<=e&&e<=122)return[this.characterMap[this.shiftCharacters[0]],this.characterMap[String.fromCharCode(e-32)]]},function(e){if(33<=e&&e<=58)return[this.characterMap[this.shiftCharacters[1]],this.characterMap[String.fromCharCode(e+32)]]},function(e){if(1<=e&&e<=26)return[this.characterMap[this.shiftCharacters[2]],this.characterMap[String.fromCharCode(e+64)]]},function(e){let t,n;if(!this.specialAsciiCodes[e])n=Math.floor(e/32)*6+(e-27)%32+64,t=[this.characterMap[this.shiftCharacters[3]],this.characterMap[String.fromCharCode(n)]];else{t=[];for(let n=0;n<this.specialAsciiCodes[e].length;n++)t.push(this.characterMap[this.shiftCharacters[3]]),t.push(this.characterMap[this.specialAsciiCodes[e][n]])}return t}],specialAsciiCodes:{0:[`U`],64:[`V`],96:[`W`],127:[`T`,`X`,`Y`,`Z`]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:[`SHIFT0`,`SHIFT1`,`SHIFT2`,`SHIFT3`]};var YS=class extends qS{initProperties(){super.initProperties(),H(this,JS,{name:`Code 39 extended`,characterMap:{SHIFT0:{pattern:`bWbwbWbWb`,value:41},SHIFT1:{pattern:`bWbWbwbWb`,value:40},SHIFT2:{pattern:`bWbWbWbwb`,value:39},SHIFT3:{pattern:`bwbWbWbWb`,value:42}}})}};let XS=Object.assign;var ZS=class extends KS{initProperties(){super.initProperties(),XS(this,{name:`Code 93`,cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,characterMap:{0:{pattern:`131112`,value:0},1:{pattern:`111213`,value:1},2:{pattern:`111312`,value:2},3:{pattern:`111411`,value:3},4:{pattern:`121113`,value:4},5:{pattern:`121212`,value:5},6:{pattern:`121311`,value:6},7:{pattern:`111114`,value:7},8:{pattern:`131211`,value:8},9:{pattern:`141111`,value:9},A:{pattern:`211113`,value:10},B:{pattern:`211212`,value:11},C:{pattern:`211311`,value:12},D:{pattern:`221112`,value:13},E:{pattern:`221211`,value:14},F:{pattern:`231111`,value:15},G:{pattern:`112113`,value:16},H:{pattern:`112212`,value:17},I:{pattern:`112311`,value:18},J:{pattern:`122112`,value:19},K:{pattern:`132111`,value:20},L:{pattern:`111123`,value:21},M:{pattern:`111222`,value:22},N:{pattern:`111321`,value:23},O:{pattern:`121122`,value:24},P:{pattern:`131121`,value:25},Q:{pattern:`212112`,value:26},R:{pattern:`212211`,value:27},S:{pattern:`211122`,value:28},T:{pattern:`211221`,value:29},U:{pattern:`221121`,value:30},V:{pattern:`222111`,value:31},W:{pattern:`112122`,value:32},X:{pattern:`112221`,value:33},Y:{pattern:`122121`,value:34},Z:{pattern:`123111`,value:35},"-":{pattern:`121131`,value:36},".":{pattern:`311112`,value:37}," ":{pattern:`311211`,value:38},$:{pattern:`321111`,value:39},"/":{pattern:`112131`,value:40},"+":{pattern:`113121`,value:41},"%":{pattern:`211131`,value:42},SHIFT0:{pattern:`122211`,value:46},SHIFT1:{pattern:`311121`,value:45},SHIFT2:{pattern:`121221`,value:43},SHIFT3:{pattern:`312111`,value:44},START:{pattern:`111141`},TERMINATION_BAR:`1`}})}initValue(e,t,n){this.value=e,this.width=t,this.height=n,this.pattern=[],this.values=[],this.dataLength=e.length}prepareValues(){let e=Math.ceil(Math.max(.15*this.width,24));if(this.height<e)throw Error(`Insufficient height for Code93 encoding: the current height is ${this.height}px, the minimum required height is ${e}px.`);if(this.setBaseUnit(),this.baseUnit<this.minBaseUnitLength){let e=Math.ceil(this.minBaseUnitLength*(this.width/this.baseUnit));throw Error(`Insufficient width for Code93 encoding: the current width is ${this.width}px and the minimum required width for value "${this.value}" is ${e}px.`)}}setBaseUnit(){this.baseUnit=this.width/(9*(this.dataLength+2+2)+this.quietZoneLength+1)}addStart(){let e=this.characterMap.START.pattern;this.addPattern(e)}addStop(){this.addStart(),this.pattern.push(this.characterMap.TERMINATION_BAR)}addBase(e){this.addPattern(e.pattern),this.values.push(e.value)}pushCheckSum(){let e=this._getCheckValues(),t;this.checksum=e.join(``);for(let n=0;n<e.length;n++)t=this.characterMap[this._findCharacterByValue(e[n])],this.addPattern(t.pattern)}_getCheckValues(){let e=this.values,t=e.length,n=0,r,i,a;for(a=t-1;a>=0;a--)n+=this.weightedValue(e[a],t-a,this.cCheckSumTotal);for(r=n%this.checkSumMod,n=this.weightedValue(r,1,this.kCheckSumTotal),a=t-1;a>=0;a--)n+=this.weightedValue(e[a],t-a+1,this.kCheckSumTotal);return i=n%this.checkSumMod,[r,i]}_findCharacterByValue(e){for(let t in this.characterMap)if(this.characterMap[t].value===e)return t}weightedValue(e,t,n){return(t%n||n)*e}addPattern(e){let t;for(let n=0;n<e.length;n++)t=parseInt(e.charAt(n),10),this.pattern.push(t)}},QS=class extends ZS{initProperties(){super.initProperties(),H(this,JS,{name:`Code 93 extended`,pushCheckSum:function(){let e=this._getCheckValues(),t;this.checksum=e.join(``);for(let n=0;n<e.length;n++)if(t=e[n],this.shiftValuesAsciiCodes[t])this.addExtended(this.shiftValuesAsciiCodes[t]);else{let e=this._findCharacterByValue(t);this.addPattern(this.characterMap[e].pattern)}}})}};let $S=/^\d+$/,eC=Object.assign;var tC=class extends HS{initProperties(){super.initProperties(),eC(this,{name:`Postnet`,START:`2`,VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:`-`,characterMap:[`22111`,`11122`,`11212`,`11221`,`12112`,`12121`,`12211`,`21112`,`21121`,`21211`]})}initValue(e,t,n){this.height=n,this.width=t,this.baseHeight=n/2,this.value=e.replace(new RegExp(this.DIGIT_SEPARATOR,`g`),``),this.pattern=[],this.validate(this.value),this.checkSum=0,this.setBaseUnit()}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.START),this.pattern.pop()}addCharacter(e){let t=this.characterMap[e];this.checkSum+=parseInt(e,10),this.addPattern(t)}addCheckSum(){this.checksum=(10-this.checkSum%10)%10,this.addCharacter(this.checksum)}setBaseUnit(){this.baseUnit=this.width/((this.value.length+1)*10+3+this.quietZoneLength)}validate(e){if($S.test(e)||this.invalidCharacterError(e.match(/[^0-9]/)[0]),!W(e.length,this.VALID_CODE_LENGTHS))throw Error(`Invalid value length. Valid lengths for the Postnet symbology are `+this.VALID_CODE_LENGTHS.join(`,`)+`.`)}addPattern(e){let t;for(let n=0;n<e.length;n++)t=this.height-this.baseHeight*e.charAt(n),this.pattern.push({width:1,y1:t,y2:this.height}),this.pattern.push(1)}};let nC=/^\d+$/,rC=/^[a-z0-9]+$/i,iC=Object.assign;var aC=class{constructor(e){this.encoding=e,this.initProperties()}initProperties(){}addStart(){}is(){}isCode(){return!1}move(){}pushState(){}},oC=class extends aC{constructor(e,t){super(e),this.states=t,this._initMoves(t)}initProperties(){super.initProperties(),H(this,{FNC4:`FNC4`,SHIFT:98})}addStart(){this.encoding.addPattern(this.START)}is(e,t){let n=e.charCodeAt(t);return this.isCode(n)}move(e){let t=0;for(;!this._moves[t].call(this,e)&&t<this._moves.length;)t++}pushState(e){let t=this.states,n=e.value,r=n.length,i;if(W(`C`,t)){let t=n.substr(e.index).match(/\d{4,}/g);t&&(r=n.indexOf(t[0],e.index))}for(;(i=e.value.charCodeAt(e.index))>=0&&this.isCode(i)&&e.index<r;)this.encoding.addPattern(this.getValue(i)),e.index++}_initMoves(e){this._moves=[],W(this.FNC4,e)&&this._moves.push(this._moveFNC),W(this.shiftKey,e)&&this._moves.push(this._shiftState),this._moves.push(this._moveState)}_moveFNC(e){if(e.fnc)return e.fnc=!1,e.previousState===this.key}_shiftState(e){if(e.previousState===this.shiftKey&&(e.index+1>=e.value.length||this.encoding[this.shiftKey].is(e.value,e.index+1)))return this.encoding.addPattern(this.SHIFT),e.shifted=!0,!0}_moveState(){return this.encoding.addPattern(this.MOVE),!0}};let sC={};sC.A=class extends oC{initProperties(){super.initProperties(),iC(this,{key:`A`,shiftKey:`B`,MOVE:101,START:103})}isCode(e){return 0<=e&&e<96}getValue(e){return e<32?e+64:e-32}},sC.B=class extends oC{initProperties(){super.initProperties(),iC(this,{key:`B`,shiftKey:`A`,MOVE:100,START:104})}isCode(e){return 32<=e&&e<128}getValue(e){return e-32}},sC.C=class extends aC{initProperties(){super.initProperties(),iC(this,{key:`C`,MOVE:99,START:105})}addStart(){this.encoding.addPattern(this.START)}is(e,t){let n=mC(e,t,4);return(t+4<=e.length||e.length===2)&&nC.test(n)}move(){this.encoding.addPattern(this.MOVE)}pushState(e){let t;for(;(t=mC(e.value,e.index,2))&&nC.test(t)&&t.length===2;)this.encoding.addPattern(parseInt(t,10)),e.index+=2}getValue(e){return e}},sC.FNC4=class extends aC{constructor(e,t){super(e),this._initSubStates(t)}initProperties(){super.initProperties(),iC(this,{key:`FNC4`,dependentStates:[`A`,`B`]})}addStart(e){let t=e.value.charCodeAt(0)-128,n=this._getSubState(t);this.encoding[n].addStart()}is(e,t){let n=e.charCodeAt(t);return this.isCode(n)}isCode(e){return 128<=e&&e<256}pushState(e){let t=this._initSubState(e),n=this.encoding,r=t.value.length,i;if(e.index+=r,r<3)for(;t.index<r;t.index++)i=t.value.charCodeAt(t.index),t.state=this._getSubState(i),t.previousState!==t.state&&(t.previousState=t.state,n[t.state].move(t)),n.addPattern(n[t.state].MOVE),n.addPattern(n[t.state].getValue(i));else t.state!==t.previousState&&n[t.state].move(t),this._pushStart(t),n.pushData(t,this.subStates),e.index<e.value.length&&this._pushStart(t);e.fnc=!0,e.state=t.state}_pushStart(e){this.encoding.addPattern(this.encoding[e.state].MOVE),this.encoding.addPattern(this.encoding[e.state].MOVE)}_initSubState(e){let t={value:this._getAll(e.value,e.index),index:0};return t.state=this._getSubState(t.value.charCodeAt(0)),t.previousState=e.previousState===this.key?t.state:e.previousState,t}_initSubStates(e){this.subStates=[];for(let t=0;t<e.length;t++)W(e[t],this.dependentStates)&&this.subStates.push(e[t])}_getSubState(e){for(let t=0;t<this.subStates.length;t++)if(this.encoding[this.subStates[t]].isCode(e))return this.subStates[t]}_getAll(e,t){let n,r=``,i=t;for(;(n=e.charCodeAt(i++))&&this.isCode(n);)r+=String.fromCharCode(n-128);return r}},sC.FNC1=class extends aC{constructor(e,t){super(e),this.states=t}initProperties(){super.initProperties(),iC(this,{key:`FNC1`,startState:`C`,startAI:`(`,endAI:`)`,dependentStates:[`C`,`B`],applicationIdentifiers:{22:{max:29,type:`alphanumeric`},402:{length:17},7004:{max:4,type:`alphanumeric`},242:{max:6,type:`alphanumeric`},8020:{max:25,type:`alphanumeric`},703:{min:3,max:30,type:`alphanumeric`},8008:{min:8,max:12,type:`alphanumeric`},253:{min:13,max:17,type:`alphanumeric`},8003:{min:14,max:30,type:`alphanumeric`},multiKey:[{ids:[`15`,`17`,`8005`,`8100`],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:[`240`,`241`,`250`,`251`,`400`,`401`,`403`,`7002`,`8004`,`8007`,`8110`],ranges:[[-9]],type:{max:30,type:`alphanumeric`}},{ids:[`7001`],ranges:[[410,414]],type:{length:13}},{ids:[`10`,`21`,`254`,`420`,`8002`],type:{max:20,type:`alphanumeric`}},{ids:[`00`,`8006`,`8017`,`8018`],type:{length:18}},{ids:[`01`,`02`,`8001`],type:{length:14}},{ids:[`422`],ranges:[[424,426]],type:{length:3}},{ids:[`20`,`8102`],type:{length:2}},{ids:[`30`,`37`],type:{max:8,type:`alphanumeric`}},{ids:[`390`,`392`],type:{max:15,type:`alphanumeric`}},{ids:[`421`,`423`],type:{min:3,max:15,type:`alphanumeric`}},{ids:[`391`,`393`],type:{min:3,max:18,type:`alphanumeric`}},{ids:[`7003`,`8101`],type:{length:10}}]},START:102})}addStart(){this.encoding[this.startState].addStart()}is(){return W(this.key,this.states)}pushState(e){let t=this.encoding,n=e.value.replace(/\s/g,``),r=RegExp(`[`+this.startAI+this.endAI+`]`,`g`),i=e.index,a={state:this.startState},o,s,c;for(t.addPattern(this.START);;){if(a.index=0,c=n.charAt(i)===this.startAI?2:0,o=c>0?this.getBySeparator(n,i):this.getByLength(n,i),o.ai.length)s=i+c+o.id.length+o.ai.length;else if(s=n.indexOf(this.startAI,i+1),s<0){if(i+o.ai.max+o.id.length+c<n.length)throw Error(`Separators are required after variable length identifiers`);s=n.length}if(a.value=n.substring(i,s).replace(r,``),this.validate(o,a.value),t.pushData(a,this.dependentStates),s>=n.length)break;i=s,a.state!==this.startState&&(t[this.startState].move(a),a.state=this.startState),o.ai.length||t.addPattern(this.START)}e.index=e.value.length}validate(e,t){let n=t.substr(e.id.length),r=e.ai;if(!r.type&&!nC.test(n))throw Error(`Application identifier `+e.id+` is numeric only but contains non numeric character(s).`);if(r.type===`alphanumeric`&&!rC.test(n))throw Error(`Application identifier `+e.id+` is alphanumeric only but contains non alphanumeric character(s).`);if(r.length&&r.length!==n.length)throw Error(`Application identifier `+e.id+` must be `+r.length+` characters long.`);if(r.min&&r.min>n.length)throw Error(`Application identifier `+e.id+` must be at least `+r.min+` characters long.`);if(r.max&&r.max<n.length)throw Error(`Application identifier `+e.id+` must be at most `+r.max+` characters long.`)}getByLength(e,t){let n,r;for(let i=2;i<=4;i++)if(n=mC(e,t,i),r=this.getApplicationIdentifier(n)||this.getApplicationIdentifier(n.substring(0,n.length-1)),r)return{id:n,ai:r};this.unsupportedAIError(n)}unsupportedAIError(e){throw Error(`'`+e+`' is not a supported Application Identifier`)}getBySeparator(e,t){let n=e.indexOf(this.startAI,t),r=e.indexOf(this.endAI,n),i=e.substring(n+1,r),a=this.getApplicationIdentifier(i)||this.getApplicationIdentifier(i.substr(i.length-1));return a||this.unsupportedAIError(i),{ai:a,id:i}}getApplicationIdentifier(e){let t=this.applicationIdentifiers,n=t.multiKey;if(t[e])return t[e];for(let t=0;t<n.length;t++){if(n[t].ids&&W(e,n[t].ids))return n[t].type;if(n[t].ranges){let r=n[t].ranges;for(let i=0;i<r.length;i++)if(r[i][0]<=e&&e<=r[i][1])return n[t].type}}}};var cC=class extends HS{constructor(e){super(e),this._initStates()}initProperties(){super.initProperties(),iC(this,{characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106})}_initStates(){for(let e=0;e<this.states.length;e++)this[this.states[e]]=new sC[this.states[e]](this,this.states)}initValue(e,t,n){this.pattern=[],this.value=e,this.width=t,this.height=n,this.checkSum=0,this.totalUnits=0,this.index=0,this.position=1}addData(){let e={value:this.value,index:0,state:``};this.value.length!==0&&(e.state=e.previousState=this.getNextState(e,this.states),this.addStart(e),this.pushData(e,this.states),this.addCheckSum(),this.addStop(),this.setBaseUnit())}pushData(e,t){for(;this[e.state].pushState(e),!(e.index>=e.value.length);)if(!e.shifted)e.previousState=e.state,e.state=this.getNextState(e,t),this[e.state].move(e);else{let t=e.state;e.state=e.previousState,e.previousState=t,e.shifted=!1}}addStart(e){this[e.state].addStart(e),this.position=1}addCheckSum(){this.checksum=this.checkSum%103,this.addPattern(this.checksum)}addStop(){this.addPattern(this.STOP)}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addPattern(e){let t=this.characterMap[e].toString(),n;for(let e=0;e<t.length;e++)n=parseInt(t.charAt(e),10),this.pattern.push(n),this.totalUnits+=n;this.checkSum+=e*this.position++}getNextState(e,t){for(let n=0;n<t.length;n++)if(this[t[n]].is(e.value,e.index))return t[n];this.invalidCharacterError(e.value.charAt(e.index))}},lC=class extends cC{initProperties(){super.initProperties(),iC(this,{name:`Code 128 A`,states:[`A`]})}},uC=class extends cC{initProperties(){super.initProperties(),iC(this,{name:`Code 128 B`,states:[`B`]})}},dC=class extends cC{initProperties(){super.initProperties(),iC(this,{name:`Code 128 C`,states:[`C`]})}},fC=class extends cC{initProperties(){super.initProperties(),iC(this,{name:`Code 128`,states:[`C`,`B`,`A`,`FNC4`]})}},pC=class extends cC{initProperties(){super.initProperties(),iC(this,{name:`Code GS1-128`,states:[`FNC1`,`C`,`B`]})}};function mC(e,t,n){return e.substring(t,t+n)}let hC=Object.assign;var gC=class extends HS{initProperties(){super.initProperties(),hC(this,{characterMap:[`12121212`,`12121221`,`12122112`,`12122121`,`12211212`,`12211221`,`12212112`,`12212121`,`21121212`,`21121221`],START:`21`,STOP:`121`,checkSumType:``,checkSums:xC})}initValue(e,t){this.pattern=[],this.value=e,this.checkSumLength=0,this.width=t}setBaseUnit(){this.baseUnit=this.width/(12*(this.value.length+this.checkSumLength)+this.quietZoneLength+7)}addData(){let e=this.value;this.addPattern(this.START);for(let t=0;t<e.length;t++)this.addCharacter(e.charAt(t));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}addCharacter(e){let t=this.characterMap[e];t||this.invalidCharacterError(e),this.addPattern(t)}addPattern(e){for(let t=0;t<e.length;t++)this.pattern.push(parseInt(e.charAt(t),10))}addCheckSum(){let e=this.checkSums[this.checkSumType].call(this.checkSums,this.value);this.checksum=e.join(``);for(let t=0;t<e.length;t++)this.checkSumLength++,this.addPattern(this.characterMap[e[t]])}},_C=class extends gC{initProperties(){super.initProperties(),hC(this,{name:`MSI Modulo10`,checkSumType:`Modulo10`})}},vC=class extends gC{initProperties(){super.initProperties(),hC(this,{name:`MSI Modulo11`,checkSumType:`Modulo11`})}},yC=class extends gC{initProperties(){super.initProperties(),hC(this,{name:`MSI Modulo10 Modulo10`,checkSumType:`Modulo10Modulo10`})}},bC=class extends gC{initProperties(){super.initProperties(),hC(this,{name:`MSI Modulo11 Modulo10`,checkSumType:`Modulo11Modulo10`})}};let xC={Modulo10(e){let t=[0,``],n=e.length%2,r,i,a;for(r=0;r<e.length;r++)t[(r+n)%2]+=parseInt(e.charAt(r),10);for(a=t[0],i=(t[1]*2).toString(),r=0;r<i.length;r++)a+=parseInt(i.charAt(r),10);return[(10-a%10)%10]},Modulo11(e){let t=0,n=e.length,r,i;for(let i=0;i<n;i++)r=((n-i)%6||6)+1,t+=r*e.charAt(i);return i=(11-t%11)%11,i===10?[1,0]:[i]},Modulo11Modulo10(e){let t=this.Modulo11(e),n;return n=e+t[0],t.concat(this.Modulo10(n))},Modulo10Modulo10(e){let t=this.Modulo10(e),n;return n=e+t[0],t.concat(this.Modulo10(n))}},SC=Object.assign;var CC=class extends HS{initProperties(){super.initProperties(),SC(this,{name:`EAN 13`,keyTable:[`000000`,`001011`,`001101`,`001110`,`010011`,`011001`,`011100`,`010101`,`010110`,`011010`],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}})}initValue(e,t,n){let r=String(e);if(r.length!==12||/\D/.test(r))throw Error(`The value of the "EAN13" encoding should be 12 symbols`);this.pattern=[],this.options.height=n,this.baseUnit=t/(95+this.quietZoneLength),this.value=r,this.checksum=this.calculateChecksum(),this.leftKey=r[0],this.leftPart=r.substr(1,6),this.rightPart=r.substr(7)+this.checksum}addData(){this.addPieces(this.characterMap.start),this.addSide(this.leftPart,this.leftKey),this.addPieces(this.characterMap.middle),this.addSide(this.rightPart),this.addPieces(this.characterMap.start)}addSide(e,t){for(let n=0;n<e.length;n++)t&&parseInt(this.keyTable[t].charAt(n),10)?this.addPieces(Array.prototype.slice.call(this.characterMap.digits[e.charAt(n)]).reverse(),!0):this.addPieces(this.characterMap.digits[e.charAt(n)],!0)}addPieces(e,t){for(let n=0;n<e.length;n++)t?this.pattern.push({y1:0,y2:this.options.height*.95,width:e[n]}):this.pattern.push(e[n])}calculateChecksum(){let e=0,t=0,n=this.value.split(``).reverse().join(``);for(let r=0;r<n.length;r++)r%2?t+=parseInt(n.charAt(r),10):e+=parseInt(n.charAt(r),10);return(10-(3*e+t)%10)%10}};let wC=Object.assign,TC={code11:WS,code39:qS,code39extended:YS,code93:ZS,code93extended:QS,code128:fC,code128a:lC,code128b:uC,code128c:dC,"gs1-128":pC,msimod10:_C,msimod11:vC,msimod1010:yC,msimod1110:bC,postnet:tC,ean8:class extends CC{initProperties(){super.initProperties(),wC(this,{name:`EAN 8`})}initValue(e,t,n){if(e.length!==7||/\D/.test(e))throw Error(`Invalid value provided`);this.value=e,this.options.height=n,this.checksum=this.calculateChecksum(this.value),this.leftPart=this.value.substr(0,4),this.rightPart=this.value.substr(4)+this.checksum,this.pattern=[],this.baseUnit=t/(67+this.quietZoneLength)}},ean13:CC};function EC(e,t){let n=e.style.display;t===`canvas`&&(e.style.display=`block`);let r={width:e.clientWidth,height:e.clientHeight};return e.style.display=n,r}Y(class{constructor(e,t,n=jf){this.options=H({},this.options,t),this.element=e,this.onError=n,this._initElement(),this._initSurface(),this._setOptions(t),t&&G(t.value)&&this.redraw()}destroy(){this._destroySurface()}_initElement(){le(this.element,`k-barcode`)}_initSurface(){let{options:e,surface:t}=this;(!t||t.options.type!==e.renderAs)&&(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return yo.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.surfaceElement.style.position=`relative`,this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(e){this._setOptions(e),this._initSurface(),this.redraw()}redraw(){let e=this._getSize();this.surface.clear(),this.surface.setSize({width:e.width,height:e.height}),this.createVisual(),this.surface.draw(this.visual)}getSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}_resize(){this.redraw()}createVisual(){this.visual=this._render()}_render(){let e=this.options,t=e.value,n=e.text,r=U(n.margin),i=this._getSize(),a=e.border||{},o=this.encoding,s=new Z(0,0,i.width,i.height).unpad(a.width).unpad(e.padding),c=s.height(),l,u,d,f=new I;this.contentBox=s,f.append(this._getBackground(i)),n.visible&&(d=Xt(t,{font:n.font}).height,c-=d+r.top+r.bottom);try{l=o.encode(t,s.width(),c)}catch(e){return this.onError(e),f}return n.visible&&(u=this._displayValue==null?t:this._displayValue,e.checksum&&G(o.checksum)&&(u+=` `+o.checksum),f.append(this._getText(u))),this.barHeight=c,this._bandsGroup=this._getBands(l.pattern,l.baseUnit),f.append(this._bandsGroup),f}exportVisual(){return this._render()}_getSize(){let e=this.element,t=EC(e,this.options.renderAs),n=new wn(300,100);return t.width>0&&(n.width=t.width),t.height>0&&(n.height=t.height),this.options.width&&(n.width=this.options.width),this.options.height&&(n.height=this.options.height),n}value(e){if(!G(e))return this.options.value;this.options.value=String(e),this.redraw()}_getBands(e,t){let n=this.contentBox,r=n.x1,i,a,o=new I;for(let s=0;s<e.length;s++){if(a=kd(e[s])?e[s]:{width:e[s],y1:0,y2:this.barHeight},i=a.width*t,s%2){let e=N.fromPoints(new M(r,a.y1+n.y1),new M(r+i,a.y2+n.y1)),t=F.fromRect(e,{fill:{color:this.options.color},stroke:null});o.append(t)}r+=i}return o}_getBackground(e){let t=this.options,n=t.border||{},r=new Z(0,0,e.width,e.height).unpad(n.width/2);return F.fromRect(r.toRect(),{fill:{color:t.background},stroke:{color:n.width?n.color:``,width:n.width,dashType:n.dashType}})}_getText(e){let t=this.options.text,n=this._textbox=new em(e,{font:t.font,color:t.color,align:`center`,vAlign:`bottom`,margin:t.margin});return n.reflow(this.contentBox),n.renderVisual(),n.visual}_setOptions(e){if(this.type=(e.type||this.options.type).toLowerCase(),this._displayValue=null,this.type===`upca`&&(this.type=`ean13`,this._displayValue=e.value,e.value=`0`+e.value),this.type===`upce`&&(this.type=`ean8`,this._displayValue=e.value,e.value=`0`+e.value),!TC[this.type])throw Error(`Encoding '${this.type}' is not supported.`);this.encoding=new TC[this.type],this.options=H({},this.options,e)}},{name:`Barcode`,renderAs:`svg`,value:``,type:`code39`,checksum:!1,width:0,height:0,color:`black`,background:`white`,text:{visible:!0,font:`16px Consolas, Monaco, Sans Mono, monospace, sans-serif`,color:`black`,margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:`solid`,color:`black`},padding:{top:0,bottom:0,left:0,right:0}});let DC=Object.assign;function OC(e,t){let n=[],r=0;for(;r<e.length;)n.push(e.substring(r,r+t)),r+=t;return n}function kC(e,t){let n=Number(e).toString(2);return n.length<t&&(n=Array(t-n.length+1).join(0)+n),n}function AC(e){return parseInt(e,2)}var jC=class{constructor(e){this.matrix=e,this.row=e.length-1,this.column=e.length-1,this.startColumn=this.column,this.dir=-1,this.c=0}move(){this.row+=this.dir*this.c,this.c^=1,this.column=this.startColumn-this.c}getNextCell(){for(;this.matrix[this.row][this.column]!==void 0;)this.move(),(this.row<0||this.row>=this.matrix.length)&&(this.dir=-this.dir,this.startColumn-=this.startColumn===8?3:2,this.column=this.startColumn,this.row=this.dir<0?this.matrix.length-1:0);return{row:this.row,column:this.column}}getNextRemainderCell(){if(this.move(),this.matrix[this.row][this.column]===void 0)return{row:this.row,column:this.column}}},MC=class{constructor(e,t){this.dataString=e,this.version=t}};let NC=`alphanumeric`,PC=/^\d+/,FC=RegExp(`^[A-Z $%*+./:-]+`),IC=RegExp(`^[A-Z0-9 $%*+./:-]+`),LC=RegExp(`^[^A-Z0-9 $%*+./:-]+`);function RC(e,t,n,r,i){let a=PC.exec(e),o=a?a[0]:``,s=FC.exec(e),c=s?s[0]:``,l=IC.exec(e),u=l?l[0]:``,d,f;return o&&(o.length>=t||e.length===o.length||o.length>=n&&!IC.test(e.charAt(o.length)))?(d=`numeric`,f=o):u&&(e.length===u.length||u.length>=r||i===NC)?(d=NC,f=o||c):(d=`byte`,f=u?u+LC.exec(e.substring(u.length))[0]:LC.exec(e)[0]),{mode:d,modeString:f}}var zC=class{constructor(){this.initProperties()}initProperties(){DC(this,{modeIndicator:``,bitsInCharacterCount:[]})}getVersionIndex(e){return e<10?0:e>26?2:1}getBitsCharacterCount(e){return this.bitsInCharacterCount[this.getVersionIndex(e||40)]}getModeCountString(e,t){return this.modeIndicator+kC(e,this.getBitsCharacterCount(t))}encode(){}getStringBitsLength(){}getValue(){}},BC=class extends zC{initProperties(){super.initProperties(),DC(this,{bitsInCharacterCount:[10,12,14],modeIndicator:`0001`})}getValue(e){return parseInt(e,10)}encode(e,t){let n=this,r=OC(e,3),i=n.getModeCountString(e.length,t),a;for(a=0;a<r.length-1;a++)i+=kC(r[a],10);return i+kC(r[a],1+3*r[a].length)}getStringBitsLength(e,t){let n=e%3;return 4+this.getBitsCharacterCount(t)+10*Math.floor(e/3)+3*n+(n===0?0:1)}},VC=class extends zC{initProperties(){super.initProperties(),DC(this,{characters:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:18,J:19,K:20,L:21,M:22,N:23,O:24,P:25,Q:26,R:27,S:28,T:29,U:30,V:31,W:32,X:33,Y:34,Z:35," ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44},bitsInCharacterCount:[9,11,13],modeIndicator:`0010`})}getValue(e){return this.characters[e]}encode(e,t){let n=OC(e,2),r=this.getModeCountString(e.length,t),i,a;for(a=0;a<n.length-1;a++)i=45*this.getValue(n[a].charAt(0))+this.getValue(n[a].charAt(1)),r+=kC(i,11);return i=n[a].length===2?45*this.getValue(n[a].charAt(0))+this.getValue(n[a].charAt(1)):this.getValue(n[a].charAt(0)),r+kC(i,1+5*n[a].length)}getStringBitsLength(e,t){return 4+this.getBitsCharacterCount(t)+11*Math.floor(e/2)+e%2*6}},HC=class extends zC{initProperties(){super.initProperties(),DC(this,{bitsInCharacterCount:[8,16,16],modeIndicator:`0100`})}getValue(e){let t=e.charCodeAt(0);if(t<=127||160<=t&&t<=255)return t;throw Error(`Unsupported character in QR Code: "${e}".`)}encode(e,t){let n=this,r=n.getModeCountString(e.length,t);for(let t=0;t<e.length;t++)r+=kC(n.getValue(e.charAt(t)),8);return r}getStringBitsLength(e,t){return 4+this.getBitsCharacterCount(t)+8*e}};let UC={numeric:new BC,alphanumeric:new VC,byte:new HC};function WC(e){let t=0,n;for(let r=0;r<e.length;r++)n=UC[e[r].mode],t+=n.getStringBitsLength(e[r].modeString.length);return Math.ceil(t/8)}function GC(e,t){let n=``,r;for(let i=0;i<e.length;i++)r=UC[e[i].mode],n+=r.encode(e[i].modeString,t);return n}function KC(e){let t=[],n,r=0,i=e;for(t.push(RC(i,8,5,8,n)),n=t[0].mode,i=i.substr(t[0].modeString.length);i.length>0;){let e=RC(i,17,9,16,n);e.mode===n?t[r].modeString+=e.modeString:(n=e.mode,t.push(e),r++),i=i.substr(e.modeString.length)}return t}let qC=[{L:{groups:[[1,19]],totalDataCodewords:19,errorCodewordsPerBlock:7},M:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:10},Q:{groups:[[1,13]],totalDataCodewords:13,errorCodewordsPerBlock:13},H:{groups:[[1,9]],totalDataCodewords:9,errorCodewordsPerBlock:17}},{L:{groups:[[1,34]],totalDataCodewords:34,errorCodewordsPerBlock:10},M:{groups:[[1,28]],totalDataCodewords:28,errorCodewordsPerBlock:16},Q:{groups:[[1,22]],totalDataCodewords:22,errorCodewordsPerBlock:22},H:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:28}},{L:{groups:[[1,55]],totalDataCodewords:55,errorCodewordsPerBlock:15},M:{groups:[[1,44]],totalDataCodewords:44,errorCodewordsPerBlock:26},Q:{groups:[[2,17]],totalDataCodewords:34,errorCodewordsPerBlock:18},H:{groups:[[2,13]],totalDataCodewords:26,errorCodewordsPerBlock:22}},{L:{groups:[[1,80]],totalDataCodewords:80,errorCodewordsPerBlock:20},M:{groups:[[2,32]],totalDataCodewords:64,errorCodewordsPerBlock:18},Q:{groups:[[2,24]],totalDataCodewords:48,errorCodewordsPerBlock:26},H:{groups:[[4,9]],totalDataCodewords:36,errorCodewordsPerBlock:16}},{L:{groups:[[1,108]],totalDataCodewords:108,errorCodewordsPerBlock:26},M:{groups:[[2,43]],totalDataCodewords:86,errorCodewordsPerBlock:24},Q:{groups:[[2,15],[2,16]],totalDataCodewords:62,errorCodewordsPerBlock:18},H:{groups:[[2,11],[2,12]],totalDataCodewords:46,errorCodewordsPerBlock:22}},{L:{groups:[[2,68]],totalDataCodewords:136,errorCodewordsPerBlock:18},M:{groups:[[4,27]],totalDataCodewords:108,errorCodewordsPerBlock:16},Q:{groups:[[4,19]],totalDataCodewords:76,errorCodewordsPerBlock:24},H:{groups:[[4,15]],totalDataCodewords:60,errorCodewordsPerBlock:28}},{L:{groups:[[2,78]],totalDataCodewords:156,errorCodewordsPerBlock:20},M:{groups:[[4,31]],totalDataCodewords:124,errorCodewordsPerBlock:18},Q:{groups:[[2,14],[4,15]],totalDataCodewords:88,errorCodewordsPerBlock:18},H:{groups:[[4,13],[1,14]],totalDataCodewords:66,errorCodewordsPerBlock:26}},{L:{groups:[[2,97]],totalDataCodewords:194,errorCodewordsPerBlock:24},M:{groups:[[2,38],[2,39]],totalDataCodewords:154,errorCodewordsPerBlock:22},Q:{groups:[[4,18],[2,19]],totalDataCodewords:110,errorCodewordsPerBlock:22},H:{groups:[[4,14],[2,15]],totalDataCodewords:86,errorCodewordsPerBlock:26}},{L:{groups:[[2,116]],totalDataCodewords:232,errorCodewordsPerBlock:30},M:{groups:[[3,36],[2,37]],totalDataCodewords:182,errorCodewordsPerBlock:22},Q:{groups:[[4,16],[4,17]],totalDataCodewords:132,errorCodewordsPerBlock:20},H:{groups:[[4,12],[4,13]],totalDataCodewords:100,errorCodewordsPerBlock:24}},{L:{groups:[[2,68],[2,69]],totalDataCodewords:274,errorCodewordsPerBlock:18},M:{groups:[[4,43],[1,44]],totalDataCodewords:216,errorCodewordsPerBlock:26},Q:{groups:[[6,19],[2,20]],totalDataCodewords:154,errorCodewordsPerBlock:24},H:{groups:[[6,15],[2,16]],totalDataCodewords:122,errorCodewordsPerBlock:28}},{L:{groups:[[4,81]],totalDataCodewords:324,errorCodewordsPerBlock:20},M:{groups:[[1,50],[4,51]],totalDataCodewords:254,errorCodewordsPerBlock:30},Q:{groups:[[4,22],[4,23]],totalDataCodewords:180,errorCodewordsPerBlock:28},H:{groups:[[3,12],[8,13]],totalDataCodewords:140,errorCodewordsPerBlock:24}},{L:{groups:[[2,92],[2,93]],totalDataCodewords:370,errorCodewordsPerBlock:24},M:{groups:[[6,36],[2,37]],totalDataCodewords:290,errorCodewordsPerBlock:22},Q:{groups:[[4,20],[6,21]],totalDataCodewords:206,errorCodewordsPerBlock:26},H:{groups:[[7,14],[4,15]],totalDataCodewords:158,errorCodewordsPerBlock:28}},{L:{groups:[[4,107]],totalDataCodewords:428,errorCodewordsPerBlock:26},M:{groups:[[8,37],[1,38]],totalDataCodewords:334,errorCodewordsPerBlock:22},Q:{groups:[[8,20],[4,21]],totalDataCodewords:244,errorCodewordsPerBlock:24},H:{groups:[[12,11],[4,12]],totalDataCodewords:180,errorCodewordsPerBlock:22}},{L:{groups:[[3,115],[1,116]],totalDataCodewords:461,errorCodewordsPerBlock:30},M:{groups:[[4,40],[5,41]],totalDataCodewords:365,errorCodewordsPerBlock:24},Q:{groups:[[11,16],[5,17]],totalDataCodewords:261,errorCodewordsPerBlock:20},H:{groups:[[11,12],[5,13]],totalDataCodewords:197,errorCodewordsPerBlock:24}},{L:{groups:[[5,87],[1,88]],totalDataCodewords:523,errorCodewordsPerBlock:22},M:{groups:[[5,41],[5,42]],totalDataCodewords:415,errorCodewordsPerBlock:24},Q:{groups:[[5,24],[7,25]],totalDataCodewords:295,errorCodewordsPerBlock:30},H:{groups:[[11,12],[7,13]],totalDataCodewords:223,errorCodewordsPerBlock:24}},{L:{groups:[[5,98],[1,99]],totalDataCodewords:589,errorCodewordsPerBlock:24},M:{groups:[[7,45],[3,46]],totalDataCodewords:453,errorCodewordsPerBlock:28},Q:{groups:[[15,19],[2,20]],totalDataCodewords:325,errorCodewordsPerBlock:24},H:{groups:[[3,15],[13,16]],totalDataCodewords:253,errorCodewordsPerBlock:30}},{L:{groups:[[1,107],[5,108]],totalDataCodewords:647,errorCodewordsPerBlock:28},M:{groups:[[10,46],[1,47]],totalDataCodewords:507,errorCodewordsPerBlock:28},Q:{groups:[[1,22],[15,23]],totalDataCodewords:367,errorCodewordsPerBlock:28},H:{groups:[[2,14],[17,15]],totalDataCodewords:283,errorCodewordsPerBlock:28}},{L:{groups:[[5,120],[1,121]],totalDataCodewords:721,errorCodewordsPerBlock:30},M:{groups:[[9,43],[4,44]],totalDataCodewords:563,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[1,23]],totalDataCodewords:397,errorCodewordsPerBlock:28},H:{groups:[[2,14],[19,15]],totalDataCodewords:313,errorCodewordsPerBlock:28}},{L:{groups:[[3,113],[4,114]],totalDataCodewords:795,errorCodewordsPerBlock:28},M:{groups:[[3,44],[11,45]],totalDataCodewords:627,errorCodewordsPerBlock:26},Q:{groups:[[17,21],[4,22]],totalDataCodewords:445,errorCodewordsPerBlock:26},H:{groups:[[9,13],[16,14]],totalDataCodewords:341,errorCodewordsPerBlock:26}},{L:{groups:[[3,107],[5,108]],totalDataCodewords:861,errorCodewordsPerBlock:28},M:{groups:[[3,41],[13,42]],totalDataCodewords:669,errorCodewordsPerBlock:26},Q:{groups:[[15,24],[5,25]],totalDataCodewords:485,errorCodewordsPerBlock:30},H:{groups:[[15,15],[10,16]],totalDataCodewords:385,errorCodewordsPerBlock:28}},{L:{groups:[[4,116],[4,117]],totalDataCodewords:932,errorCodewordsPerBlock:28},M:{groups:[[17,42]],totalDataCodewords:714,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[6,23]],totalDataCodewords:512,errorCodewordsPerBlock:28},H:{groups:[[19,16],[6,17]],totalDataCodewords:406,errorCodewordsPerBlock:30}},{L:{groups:[[2,111],[7,112]],totalDataCodewords:1006,errorCodewordsPerBlock:28},M:{groups:[[17,46]],totalDataCodewords:782,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[16,25]],totalDataCodewords:568,errorCodewordsPerBlock:30},H:{groups:[[34,13]],totalDataCodewords:442,errorCodewordsPerBlock:24}},{L:{groups:[[4,121],[5,122]],totalDataCodewords:1094,errorCodewordsPerBlock:30},M:{groups:[[4,47],[14,48]],totalDataCodewords:860,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[14,25]],totalDataCodewords:614,errorCodewordsPerBlock:30},H:{groups:[[16,15],[14,16]],totalDataCodewords:464,errorCodewordsPerBlock:30}},{L:{groups:[[6,117],[4,118]],totalDataCodewords:1174,errorCodewordsPerBlock:30},M:{groups:[[6,45],[14,46]],totalDataCodewords:914,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[16,25]],totalDataCodewords:664,errorCodewordsPerBlock:30},H:{groups:[[30,16],[2,17]],totalDataCodewords:514,errorCodewordsPerBlock:30}},{L:{groups:[[8,106],[4,107]],totalDataCodewords:1276,errorCodewordsPerBlock:26},M:{groups:[[8,47],[13,48]],totalDataCodewords:1e3,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[22,25]],totalDataCodewords:718,errorCodewordsPerBlock:30},H:{groups:[[22,15],[13,16]],totalDataCodewords:538,errorCodewordsPerBlock:30}},{L:{groups:[[10,114],[2,115]],totalDataCodewords:1370,errorCodewordsPerBlock:28},M:{groups:[[19,46],[4,47]],totalDataCodewords:1062,errorCodewordsPerBlock:28},Q:{groups:[[28,22],[6,23]],totalDataCodewords:754,errorCodewordsPerBlock:28},H:{groups:[[33,16],[4,17]],totalDataCodewords:596,errorCodewordsPerBlock:30}},{L:{groups:[[8,122],[4,123]],totalDataCodewords:1468,errorCodewordsPerBlock:30},M:{groups:[[22,45],[3,46]],totalDataCodewords:1128,errorCodewordsPerBlock:28},Q:{groups:[[8,23],[26,24]],totalDataCodewords:808,errorCodewordsPerBlock:30},H:{groups:[[12,15],[28,16]],totalDataCodewords:628,errorCodewordsPerBlock:30}},{L:{groups:[[3,117],[10,118]],totalDataCodewords:1531,errorCodewordsPerBlock:30},M:{groups:[[3,45],[23,46]],totalDataCodewords:1193,errorCodewordsPerBlock:28},Q:{groups:[[4,24],[31,25]],totalDataCodewords:871,errorCodewordsPerBlock:30},H:{groups:[[11,15],[31,16]],totalDataCodewords:661,errorCodewordsPerBlock:30}},{L:{groups:[[7,116],[7,117]],totalDataCodewords:1631,errorCodewordsPerBlock:30},M:{groups:[[21,45],[7,46]],totalDataCodewords:1267,errorCodewordsPerBlock:28},Q:{groups:[[1,23],[37,24]],totalDataCodewords:911,errorCodewordsPerBlock:30},H:{groups:[[19,15],[26,16]],totalDataCodewords:701,errorCodewordsPerBlock:30}},{L:{groups:[[5,115],[10,116]],totalDataCodewords:1735,errorCodewordsPerBlock:30},M:{groups:[[19,47],[10,48]],totalDataCodewords:1373,errorCodewordsPerBlock:28},Q:{groups:[[15,24],[25,25]],totalDataCodewords:985,errorCodewordsPerBlock:30},H:{groups:[[23,15],[25,16]],totalDataCodewords:745,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[3,116]],totalDataCodewords:1843,errorCodewordsPerBlock:30},M:{groups:[[2,46],[29,47]],totalDataCodewords:1455,errorCodewordsPerBlock:28},Q:{groups:[[42,24],[1,25]],totalDataCodewords:1033,errorCodewordsPerBlock:30},H:{groups:[[23,15],[28,16]],totalDataCodewords:793,errorCodewordsPerBlock:30}},{L:{groups:[[17,115]],totalDataCodewords:1955,errorCodewordsPerBlock:30},M:{groups:[[10,46],[23,47]],totalDataCodewords:1541,errorCodewordsPerBlock:28},Q:{groups:[[10,24],[35,25]],totalDataCodewords:1115,errorCodewordsPerBlock:30},H:{groups:[[19,15],[35,16]],totalDataCodewords:845,errorCodewordsPerBlock:30}},{L:{groups:[[17,115],[1,116]],totalDataCodewords:2071,errorCodewordsPerBlock:30},M:{groups:[[14,46],[21,47]],totalDataCodewords:1631,errorCodewordsPerBlock:28},Q:{groups:[[29,24],[19,25]],totalDataCodewords:1171,errorCodewordsPerBlock:30},H:{groups:[[11,15],[46,16]],totalDataCodewords:901,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[6,116]],totalDataCodewords:2191,errorCodewordsPerBlock:30},M:{groups:[[14,46],[23,47]],totalDataCodewords:1725,errorCodewordsPerBlock:28},Q:{groups:[[44,24],[7,25]],totalDataCodewords:1231,errorCodewordsPerBlock:30},H:{groups:[[59,16],[1,17]],totalDataCodewords:961,errorCodewordsPerBlock:30}},{L:{groups:[[12,121],[7,122]],totalDataCodewords:2306,errorCodewordsPerBlock:30},M:{groups:[[12,47],[26,48]],totalDataCodewords:1812,errorCodewordsPerBlock:28},Q:{groups:[[39,24],[14,25]],totalDataCodewords:1286,errorCodewordsPerBlock:30},H:{groups:[[22,15],[41,16]],totalDataCodewords:986,errorCodewordsPerBlock:30}},{L:{groups:[[6,121],[14,122]],totalDataCodewords:2434,errorCodewordsPerBlock:30},M:{groups:[[6,47],[34,48]],totalDataCodewords:1914,errorCodewordsPerBlock:28},Q:{groups:[[46,24],[10,25]],totalDataCodewords:1354,errorCodewordsPerBlock:30},H:{groups:[[2,15],[64,16]],totalDataCodewords:1054,errorCodewordsPerBlock:30}},{L:{groups:[[17,122],[4,123]],totalDataCodewords:2566,errorCodewordsPerBlock:30},M:{groups:[[29,46],[14,47]],totalDataCodewords:1992,errorCodewordsPerBlock:28},Q:{groups:[[49,24],[10,25]],totalDataCodewords:1426,errorCodewordsPerBlock:30},H:{groups:[[24,15],[46,16]],totalDataCodewords:1096,errorCodewordsPerBlock:30}},{L:{groups:[[4,122],[18,123]],totalDataCodewords:2702,errorCodewordsPerBlock:30},M:{groups:[[13,46],[32,47]],totalDataCodewords:2102,errorCodewordsPerBlock:28},Q:{groups:[[48,24],[14,25]],totalDataCodewords:1502,errorCodewordsPerBlock:30},H:{groups:[[42,15],[32,16]],totalDataCodewords:1142,errorCodewordsPerBlock:30}},{L:{groups:[[20,117],[4,118]],totalDataCodewords:2812,errorCodewordsPerBlock:30},M:{groups:[[40,47],[7,48]],totalDataCodewords:2216,errorCodewordsPerBlock:28},Q:{groups:[[43,24],[22,25]],totalDataCodewords:1582,errorCodewordsPerBlock:30},H:{groups:[[10,15],[67,16]],totalDataCodewords:1222,errorCodewordsPerBlock:30}},{L:{groups:[[19,118],[6,119]],totalDataCodewords:2956,errorCodewordsPerBlock:30},M:{groups:[[18,47],[31,48]],totalDataCodewords:2334,errorCodewordsPerBlock:28},Q:{groups:[[34,24],[34,25]],totalDataCodewords:1666,errorCodewordsPerBlock:30},H:{groups:[[20,15],[61,16]],totalDataCodewords:1276,errorCodewordsPerBlock:30}}];function JC(e,t){let n=0,r=qC.length-1,i=Math.floor(qC.length/2);do e<qC[i][t].totalDataCodewords?r=i:n=i,i=n+Math.floor((r-n)/2);while(r-n>1);return e<=qC[n][t].totalDataCodewords?i+1:r+1}var YC=class{getEncodingResult(e,t){let n=KC(e),r=JC(WC(n),t);return new MC(GC(n,r),r)}},XC=class{constructor(e={}){this.includeBOM=e.includeBOM===void 0||e.includeBOM,this.initProperties(),this.mode=UC[this.encodingMode]}initProperties(){DC(this,{encodingMode:`byte`,utfBOM:`111011111011101110111111`,initialModeCountStringLength:20,ranges:[128,2048,65536,2097152,67108864]})}getEncodingResult(e,t){let n=this.encode(e),r=JC(this.getDataCodewordsCount(n),t);return new MC(this.mode.getModeCountString(n.length/8,r)+n,r)}getDataCodewordsCount(e){let t=e.length;return Math.ceil((this.initialModeCountStringLength+t)/8)}encode(e){let t=this.includeBOM?this.utfBOM:``;for(let n=0;n<e.length;n++)t+=this.encodeCharacter(e.charCodeAt(n));return t}encodeCharacter(e){let t=this.getBytesCount(e),n=t-1,r=``;if(t===1)r=kC(e,8);else{let i=8-t;for(let t=0;t<n;t++)r=kC(e>>t*6&63|128,8)+r;r=(e>>n*6|255>>i<<i).toString(2)+r}return r}getBytesCount(e){let t=this.ranges;for(let n=0;n<t.length;n++)if(e<t[n])return n+1}};let ZC={1:0},QC={0:1},$C={15:20,16:20,18:24,19:24,22:20,24:22,26:24,28:20,30:20,31:24,32:28,33:24,36:18,37:22,39:20,40:24},ew=[1,0,1,1,1],tw=[1,0,1],nw={L:`01`,M:`00`,Q:`11`,H:`10`},rw=[`11101100`,`00010001`],iw=[(e,t)=>(e+t)%2==0,(e,t)=>e%2==0,(e,t)=>t%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0],aw=[[1,0],[1,25,0]];function ow(e,t,n,r){for(let i=0;i<e.length;i++)e[i][n][r]=t}function sw(e,t,n,r){for(let i=0;i<iw.length;i++)e[i][n][r]=iw[i](n,r)?t^1:parseInt(t,10)}function cw(e,t){let n=new jC(e[0]),r,i,a;for(let o=0;o<t.length;o++)for(r=t[o],i=0;r.length>0;){for(let t=0;t<r.length;t++)for(let o=0;o<8;o++)a=n.getNextCell(),sw(e,r[t][i].charAt(o),a.row,a.column);for(i++;r[0]&&i===r[0].length;)r.splice(0,1)}for(;a=n.getNextRemainderCell();)sw(e,0,a.row,a.column)}function lw(e,t){let n=t*8,r=0,i=0,a=e;for(;a.length<n&&r<4;)a+=`0000`.charAt(r++);for(a.length%8!=0&&(a+=Array(9-a.length%8).join(`0`));a.length<n;)a+=rw[i],i^=1;return a}function uw(){let e,t;for(t=1;t<255;t++)e=QC[t-1]*2,e>255&&(e^=285),QC[t]=e,ZC[e]=t;e=QC[t-1]*2^285,QC[t]=e,QC[-1]=0}function dw(e,t){let n=[],r=e.length-2;for(let i=r;i>=0;i--)n[i]=e[i]^t[i];return n}function fw(e,t){let n=[];for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]===void 0?n[r+i]=(e[r]+(t[i]>=0?t[i]:0))%255:n[r+i]=ZC[QC[n[r+i]]^QC[(e[r]+t[i])%255]];return n}function pw(){for(let e=2;e<=68;e++){let t=aw[e-1];aw[e]=fw(t,[e,0])}}uw(),pw();function mw(e,t){let n=[],r=e.length-1;do n[r]=QC[(e[r]+t)%255],r--;while(e[r]!==void 0);return n}function hw(e,t){let n=aw[t-1],r=Array(t).concat(e),i=Array(r.length-n.length).concat(n),a=e.length,o=[],s,c;for(c=0;c<a;c++)s=mw(i,ZC[r[r.length-1]]),i.splice(0,1),r=dw(s,r);for(c=r.length-1;c>=0;c--)o[t-1-c]=kC(r[c],8);return o}function gw(e,t){let n=0,r=[],i=[],a,o=t.groups,s,c,l,u;for(let d=0;d<o.length;d++){c=o[d][0];for(let f=0;f<c;f++){s=o[d][1],a=[],l=[];for(let t=1;t<=s;t++)u=e.substring(n,n+8),a.push(u),l[s-t]=AC(u),n+=8;r.push(a),i.push(hw(l,t.errorCodewordsPerBlock))}}return[r,i]}function _w(e){let t=AC(e),n,r=``;if(t===0)return`101010000010010`;n=vw(AC(e),`10100110111`,15);for(let e=0;e<n.length;e++)r+=n.charAt(e)^`101010000010010`.charAt(e);return r}function vw(e,t,n){let r=AC(t),i=t.length-1,a=e<<i,o=kC(e,n-i),s=yw(a,r);return s=o+kC(s,i),s}function yw(e,t){let n=t.toString(2).length,r=e.toString(2).length,i=e;do i^=t<<r-n,r=i.toString(2).length;while(r>=n);return i}function bw(e,t){return parseInt(e.charAt(t),10)}function xw(e){let t=[],n=17+4*e;for(let e=0;e<iw.length;e++){t[e]=Array(n);for(let r=0;r<n;r++)t[e][r]=Array(n)}return t}function Sw(e,t){let n=e[0],r,i,a=0,o=t.length;for(r=0,i=8;r<=8;r++)r!==6&&ow(e,bw(t,o-1-a++),r,i);for(r=8,i=7;i>=0;i--)i!==6&&ow(e,bw(t,o-1-a++),r,i);for(a=0,i=n.length-1,r=8;i>=n.length-8;i--)ow(e,bw(t,o-1-a++),r,i);for(ow(e,1,n.length-8,8),r=n.length-7,i=8;r<n.length;r++)ow(e,bw(t,o-1-a++),r,i)}function Cw(e){return vw(e,`1111100100101`,18)}function ww(e,t){let n=e[0].length,r=n-11,i=n-11,a,o,s;for(let n=0;n<t.length;n++)a=Math.floor(n/3),o=n%3,s=bw(t,t.length-n-1),ow(e,s,0+a,r+o),ow(e,s,i+o,0+a)}function Tw(e,t,n,r){let i=t.length+2,a=t.length+1,o;for(let s=0;s<t.length;s++)for(let c=s;c<i-s;c++)o=t[s],ow(e,o,n+c,r+s),ow(e,o,n+s,r+c),ow(e,o,n+a-c,r+a-s),ow(e,o,n+a-s,r+a-c)}function Ew(e,t,n,r){let i=n,a=r,o=e[0];do ow(e,0,i,r),ow(e,0,n,a),i+=t[0],a+=t[1];while(i>=0&&i<o.length)}function Dw(e){let t=e[0].length;Tw(e,ew,0,0),Ew(e,[-1,-1],7,7),Tw(e,ew,t-7,0),Ew(e,[1,-1],t-8,7),Tw(e,ew,0,t-7),Ew(e,[-1,1],7,t-8)}function Ow(e,t){if(t<2)return;let n=e[0],r=n.length,i=Math.floor(t/7),a=[6],o,s,c=0;for((o=$C[t])?s=(r-13-o)/i:o=s=(r-13)/(i+1),a.push(a[c++]+o);a[c]+s<r;)a.push(a[c++]+s);for(let t=0;t<a.length;t++)for(let r=0;r<a.length;r++)n[a[t]][a[r]]===void 0&&Tw(e,tw,a[t]-2,a[r]-2)}function kw(e){let t=1,n=e[0].length;for(let r=8;r<n-8;r++)ow(e,t,6,r),ow(e,t,r,6),t^=1}function Aw(e){let t=[],n=[],r=[],i=[],a=[],o,s,c=e[0].length;for(s=0;s<e.length;s++)t[s]=0,r[s]=0,a[s]=[0,0],i[s]=[0,0],n[s]=[];for(let s=0;s<c;s++)for(let l=0;l<c;l++)for(let u=0;u<e.length;u++)o=e[u],r[u]+=parseInt(o[s][l],10),n[u][0]===o[s][l]&&s+1<c&&l-1>=0&&o[s+1][l]===n[u][0]&&o[s+1][l-1]===n[u][0]&&(t[u]+=3),jw(u,i,t,0,o[s][l]),jw(u,i,t,1,o[l][s]),Mw(u,t,n,o[s][l],a,0),Mw(u,t,n,o[l][s],a,1);let l=c*c,u,d=Number.MAX_VALUE;for(s=0;s<t.length;s++)t[s]+=Nw(r[s],l),t[s]<d&&(d=t[s],u=s);return u}function jw(e,t,n,r,i){t[e][r]=(t[e][r]<<1^i)%128,t[e][r]===93&&(n[e]+=40)}function Mw(e,t,n,r,i,a){n[e][a]===r?i[e][a]++:(n[e][a]=r,i[e][a]>=5&&(t[e]+=3+i[e][a]-5),i[e][a]=1)}function Nw(e,t){let n=Math.floor(e/t*100),r=n%5,i=Math.abs(n-r-50),a=Math.abs(n+5-r-50);return 10*Math.min(i/5,a/5)}function Pw(e){return e&&e.toLowerCase().indexOf(`utf_8`)>=0?new XC({includeBOM:e.toLowerCase().indexOf(`no_bom`)<0}):new YC}function Fw(e,t,n){let r=Pw(n).getEncodingResult(e,t),i=r.version,a=qC[i-1][t],o=gw(lw(r.dataString,a.totalDataCodewords),a),s=xw(i);Dw(s),Ow(s,i),kw(s),i>=7&&ww(s,kC(0,18)),Sw(s,kC(0,15)),cw(s,o);let c=Aw(s),l=s[c];i>=7&&ww([l],Cw(i));let u=nw[t]+kC(c,3);return Sw([l],_w(u)),l}let Iw=Math.round,Lw=[[0,1],[1,1],[1,2],[2,2],[2,1],[3,1],[3,0],[2,0],[2,-1],[1,-1],[1,0]],Rw=[[0,1],[1,1],[1,0]],zw={DEFAULT_SIZE:200,QUIET_ZONE_LENGTH:4,DEFAULT_ERROR_CORRECTION_LEVEL:`L`,DEFAULT_BACKGROUND:`#fff`,DEFAULT_DARK_MODULE_COLOR:`#000`,MIN_BASE_UNIT_SIZE:1,DEFAULT_LOGO_SIZE:7};Y(class{constructor(e,t,n=jf){this.options=H({},this.options,t),this.element=e,this.wrapper=this.element,this.onError=n,this._initElement(),this._initSurface(),this.setOptions(t)}destroy(){this._destroySurface()}_initElement(){le(this.element,`k-qrcode`)}_initSurface(){let{options:e,surface:t}=this;(!t||t.options.type!==e.renderAs)&&(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return yo.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.surfaceElement.style.position=`relative`,this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}redraw(){let e=this._getSize();this.surface.clear(),this.surface.setSize({width:e,height:e}),this.createVisual(),this.surface.draw(this.visual)}getSize(){let e=this.element,t=e.clientWidth,n=e.clientHeight,r={width:0,height:0};return t>0&&(r.width=t),n&&(r.height=n),r}_resize(){this.redraw()}createVisual(){this.visual=this._render()}exportVisual(){return this._render()}_render(){let e=this._value,t,n=this.options.border||{},r=this.options.padding||0,i=n.width||0,a,o,s,c,l;n.width=i;let u=new I;try{e&&(o=Fw(e,this.options.errorCorrection,this.options.encoding),s=this._getSize(),l=s-2*(i+r),t=this._calculateBaseUnit(l,o.length),c=o.length*t,a=i+r+(l-c)/2,u.append(this._renderBackground(s,n)),u.append(this._renderMatrix(o,t,a)),this._hasCustomLogo()?u.append(this._renderLogo(s,t)):this._isSwiss()&&u.append(this._renderSwissCode(s,t)))}catch(e){this.onError(e)}return u}_renderLogo(e,t){let n,r,i=Iw(e/2),a=this._getLogoSize(t*zw.DEFAULT_LOGO_SIZE),o=this.options.overlay.imageUrl,s={x:i-a.width/2,y:i-a.height/2};return r=new N(new M(s.x,s.y),new wn(a.width,a.height)),n=new Gr(o,r),n}_renderSwissCode(e,t){let n=this._getLogoSize(t*zw.DEFAULT_LOGO_SIZE);n=Math.max(n.width,n.height);let r=n/4,i=r/2,a=e/2,o={},s=new I;return o.x=o.y=Math.ceil(a-t-n/2),s.append(this._renderShape(o,Math.ceil(n+t*2),Rw,`#fff`)),o.x=o.y=a-n/2,s.append(this._renderShape(o,n,Rw,this.options.color)),o.x=a+i-n/2,o.y=a+i+r-n/2,s.append(this._renderShape(o,r,Lw,`#fff`)),s}_renderShape(e,t,n,r){let i=new Hr({fill:{color:r},stroke:null});i.moveTo(e.x,e.y);for(let r=0;r<n.length;r++)i.lineTo(e.x+t*n[r][0],e.y+t*n[r][1]);return i.close(),i}_getSize(){let e;if(this.options.size)e=parseInt(this.options.size,10);else{let t=this.element,n=EC(t,this.options.renderAs),r=Math.min(n.width,n.height);e=r>0?r:zw.DEFAULT_SIZE}return e}_calculateBaseUnit(e,t){let n=Math.floor(e/t);if(n<zw.MIN_BASE_UNIT_SIZE){let n=Math.ceil(t*zw.MIN_BASE_UNIT_SIZE);this.onError(Error(`Insufficient size for QR Code: the current size is ${e}px and the minimum size is ${n}px.`))}else n*t>=e&&n-1>=zw.MIN_BASE_UNIT_SIZE&&n--;return n}_renderMatrix(e,t,n){let r=new Hr({fill:{color:this.options.color},stroke:null});for(let i=0;i<e.length;i++){let a=n+i*t,o=0;for(;o<e.length;){for(;e[i][o]===0&&o<e.length;)o++;if(o<e.length){let s=o;for(;e[i][o]===1;)o++;let c=Iw(n+s*t),l=Iw(a),u=Iw(n+o*t),d=Iw(a+t);r.moveTo(c,l).lineTo(c,d).lineTo(u,d).lineTo(u,l).close()}}}return r}_renderBackground(e,t){let n=new Z(0,0,e,e).unpad(t.width/2);return F.fromRect(n.toRect(),{fill:{color:this.options.background},stroke:{color:t.color,width:t.width}})}setOptions(e){let t=e||{};this.options=DC(this.options,t),e.value!==void 0&&(this._value=String(this.options.value)),this._initSurface(),this.redraw()}value(e){if(e===void 0)return this._value;this._value=String(e),this.redraw()}_hasCustomLogo(){return!!this.options.overlay.imageUrl}_isSwiss(){return this.options.overlay.type===`swiss`}_getLogoSize(e){let t=this.options.overlay.width,n=this.options.overlay.height;return!t&&!n?t=n=e:t&&!n?n=t:!t&&n&&(t=n),{width:t,height:n}}},{name:`QRCode`,renderAs:`svg`,encoding:`ISO_8859_1`,value:``,errorCorrection:zw.DEFAULT_ERROR_CORRECTION_LEVEL,background:zw.DEFAULT_BACKGROUND,color:zw.DEFAULT_DARK_MODULE_COLOR,size:``,padding:0,border:{color:``,width:0},overlay:{type:`image`,imageUrl:``,width:0,height:0}});let Bw={WGS84:{a:6378137,b:6356752.314245179,f:.0033528106647474805,e:.08181919084262149}};function Vw(e){return e*e}let Hw=Math,Uw=Hw.abs,Ww=Hw.atan,Gw=Hw.atan2,Kw=Hw.cos,qw=Hw.sin,Jw=Hw.tan;var Yw=class e{constructor(e,t){this.initProperties(),arguments.length===1?(this.lat=e[0],this.lng=e[1]):(this.lat=e,this.lng=t)}initProperties(){H(this,{DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:`{0:N6}{1:N6}`})}toArray(){return[this.lat,this.lng]}equals(e){return e&&e.lat===this.lat&&e.lng===this.lng}clone(){return new e(this.lat,this.lng)}round(e){return this.lng=q(this.lng,e),this.lat=q(this.lat,e),this}wrap(){return this.lng%=180,this.lat%=90,this}distanceTo(e,t){return this.greatCircleTo(e,t).distance}destination(t,n,r){let i=cf(n),a=r||Bw.WGS84,o=cf(this.lat),s=cf(this.lng),c=t/a.a,l=Hw.asin(qw(o)*Kw(c)+Kw(o)*qw(c)*Kw(i)),u=s+Gw(qw(i)*qw(c)*Kw(o),Kw(c)-qw(o)*qw(l));return new e($d(l),$d(u))}greatCircleTo(t,n){let r=e.create(r),i=n||Bw.WGS84;if(!r||this.clone().round(8).equals(r.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};let a=i.a,o=i.b,s=i.f,c=cf(r.lng-this.lng),l=Ww((1-s)*Jw(cf(this.lat))),u=qw(l),d=Kw(l),f=Ww((1-s)*Jw(cf(r.lat))),p=qw(f),m=Kw(f),h=c,g,_=this.DISTANCE_ITERATIONS,v=!1,y,b,x,S,C,w,ee;for(;!v&&_-->0;){y=qw(h),b=Kw(h),x=Hw.sqrt(Vw(m*y)+Vw(d*p-u*m*b)),C=u*p+d*m*b,ee=Gw(x,C);let e=d*m*y/x;S=1-Vw(e),w=0,S!==0&&(w=C-2*u*p/S),g=h;let t=s/16*S*(4+s*(4-3*S));h=c+(1-t)*s*e*(ee+t*x*(w+t*C*(-1+2*Vw(w)))),v=Uw(h-g)<=this.DISTANCE_CONVERGENCE}let T=S*(Vw(a)-Vw(o))/Vw(o),te=1+T/16384*(4096+T*(-768+T*(320-175*T))),E=T/1024*(256+T*(-128+T*(74-47*T))),D=E*x*(w+E/4*(C*(-1+2*Vw(w))-E/6*w*(-3+4*Vw(x))*(-3+4*Vw(w)))),ne=Gw(m*y,d*p-u*m*b),re=Gw(d*y,-u*m+d*p*b);return{distance:q(o*te*(ee-D),this.DISTANCE_PRECISION),azimuthFrom:$d(ne),azimuthTo:$d(re)}}toString(){return String(this.lat)+`,`+String(this.lng)}static fromLngLat(t){return new e(t[1],t[0])}static fromLatLng(t){return new e(t[0],t[1])}static create(t,n){if(G(t))return t instanceof e?t.clone():arguments.length===1&&t.length===2?e.fromLatLng(t):new e(t,n)}};let Xw=Math,Zw=Xw.atan,Qw=Xw.exp,$w=Xw.pow,eT=Xw.sin,tT=Xw.log,nT=Xw.tan,rT=M,iT=Xw.PI,aT=iT/2,oT=iT/4,sT=iT/180,cT=Bw.WGS84;var lT=class{constructor(e){this.initProperties(),this._initOptions(e)}_initOptions(e){this.options=H({},this.options,e)}initProperties(){H(this,{MAX_LNG:180,MAX_LAT:85.0840590501,INVERSE_ITERATIONS:15,INVERSE_CONVERGENCE:1e-12})}forward(e,t){let n=this,r=n.options,i=r.datum.a,a=r.centralMeridian,o=K(e.lat,-n.MAX_LAT,n.MAX_LAT),s=t?K(e.lng,-n.MAX_LNG,n.MAX_LNG):e.lng,c=cf(s-a)*i,l=n._projectLat(o);return new rT(c,l)}_projectLat(e){let t=this.options.datum,n=t.e,r=t.a,i=cf(e),a=nT(oT+i/2),o=n*eT(i),s=$w((1-o)/(1+o),n/2);return r*tT(a*s)}inverse(e,t){let n=this,r=n.options,i=r.datum.a,a=r.centralMeridian,o=e.x/(sT*i)+a,s=K(n._inverseY(e.y),-n.MAX_LAT,n.MAX_LAT);return t&&(o=K(o,-n.MAX_LNG,n.MAX_LNG)),new Yw(s,o)}_inverseY(e){let t=this,n=t.options.datum,r=n.a,i=n.e,a=i/2,o=Qw(-e/r),s=aT-2*Zw(o),c;for(c=0;c<=t.INVERSE_ITERATIONS;c++){let e=i*eT(s),n=$w((1-e)/(1+e),a),r=aT-2*Zw(o*n)-s;if(s+=r,Xw.abs(r)<=t.INVERSE_CONVERGENCE)break}return $d(s)}};Y(lT,{centralMeridian:0,datum:cT});var uT=class extends lT{initProperties(){super.initProperties(),H(this,{MAX_LAT:85.0511287798})}_projectLat(e){let t=this.options.datum.a,n=cf(e),r=nT(oT+n/2);return t*tT(r)}_inverseY(e){let t=this.options.datum.a,n=Qw(-e/t);return $d(aT-2*Zw(n))}},dT=class{constructor(){let e=this,t=e._proj=new uT,n=this.c=2*iT*t.options.datum.a;this._tm=P().translate(.5,.5).scale(1/n,-1/n),this._itm=P().scale(n,-n).translate(-.5,-.5)}toPoint(e,t,n){return this._proj.forward(e,n).transform(this._tm).scale(t||1)}toLocation(e,t,n){let r=e.clone().scale(1/(t||1)).transform(this._itm);return this._proj.inverse(r,n)}};let fT=(e,t)=>e.bind(t),pT=e=>{let t=document.createElement(`div`);return t.innerHTML=e,t.firstChild},mT=(e,t)=>{let n=document.createElement(`div`);for(n.innerHTML=e;n.childNodes.length>0;)t.appendChild(n.childNodes[0])},hT=e=>{for(;e.firstChild;)e.removeChild(e.firstChild)},gT=(e,t)=>{t.insertBefore(e,t.firstChild)},_T=(e,t)=>{for(e.appendChild(t);e.firstChild!==t;)t.appendChild(e.firstChild)},vT=e=>e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+`-`+e.charAt(1).toLowerCase()}),yT=e=>{let t;return t=e&&String(e).endsWith(`px`)?e:String(e)+`px`,t},bT=e=>{let{mobileOS:t}=Zf(e);return t.ios||t.android},xT=(e,t)=>{let n=e.prototype;n.events?t.forEach(e=>{n.events.indexOf(e)<0&&n.events.push(e)}):n.events=t},ST=e=>{let t=e.wheelDeltaY,n;return e.wheelDelta?(t===void 0||t)&&(n=e.wheelDelta):e.detail&&e.axis===e.VERTICAL_AXIS&&(n=-e.detail*10),n},CT=e=>{let t=[];switch(e){case`topLeft`:return`k-top-start`;case`topRight`:return`k-top-end`;case`bottomLeft`:return`k-bottom-start`;case`bottomRight`:return`k-bottom-end`;default:break}return t.join(` `)};var wT=class extends op{constructor(e,t){super(),this.element=e,this._initOptions(t),this.items=[],le(this.element,`k-widget k-attribution`)}_initOptions(e){this.options=H({},this.options,e)}filter(e,t){this._extent=e,this._zoom=t,this._render()}add(e){let t=e;G(e)&&(typeof e==`string`&&(t={text:e}),this.items.push(t),this._render())}remove(e){let t=[];for(let n=0;n<this.items.length;n++){let r=this.items[n];r.text!==e&&t.push(r)}this.items=t,this._render()}clear(){this.items=[],hT(this.element)}_render(){let e=[];for(let t=0;t<this.items.length;t++){let n=this.items[t],r=this._itemText(n);r!==``&&e.push(r)}if(e.length>0){hT(this.element);let t=e.join(this.options.separator);mT(t,this.element),this.showElement()}else this.hideElement()}hideElement(){this.element.style.display=`none`}showElement(){this.element.style.display=``}_itemText(e){let t=``,n=this._inZoomLevel(e.minZoom,e.maxZoom),r=this._inArea(e.extent);return n&&r&&(t+=e.text),t}_inZoomLevel(e,t){let n=!0,r=J(e,-Number.MAX_VALUE),i=J(t,Number.MAX_VALUE);return n=this._zoom>r&&this._zoom<i,n}_inArea(e){let t=!0;return e&&(t=e.contains(this._extent)),t}};Y(wT,{name:`Attribution`,separator:`&nbsp;|&nbsp;`});let TT={up:{className:`k-navigator-n`,iconClass:`k-i-chevron-up`},down:{className:`k-navigator-s`,iconClass:`k-i-chevron-down`},right:{className:`k-navigator-e`,iconClass:`k-i-chevron-right`},left:{className:`k-navigator-w`,iconClass:`k-i-chevron-left`}};function ET(e,t){let n=`<button type="button" class="k-button k-button-square k-rounded-full k-button-flat k-icon-button `+TT[e].className+`" aria-label="move `+e+`">`+_f({icon:`chevron-${e}`,iconClass:`k-button-icon`,svgIcons:t.svgIcons,type:t.type})+`</button>`;return pT(n)}var DT=class extends op{constructor(e,t){super(),this.element=e,this._initOptions(t);let n=ET(`up`,t.icons),r=ET(`right`,t.icons),i=ET(`down`,t.icons),a=ET(`left`,t.icons);this.element.appendChild(n),this.element.appendChild(r),this.element.appendChild(i),this.element.appendChild(a),le(this.element,`k-widget k-navigator`),Wf(this.element,`click`,`.k-button`,fT(this._click,this));let o=this.element.parentNode.closest(`[data-role]`);this._keyroot=o||this.element,this._tabindex(this._keyroot),this._keydownHandler=fT(this._keydown,this),Wf(this._keyroot,`keydown`,this._keydownHandler)}destroy(){this.dispose()}dispose(){Gf(this._keyroot,`keydown`,this._keydownHandler)}_tabindex(e){let t=e||this.wrapper||this.element,n=this.element,r=`tabindex`,i=t.getAttribute(r)||n.getAttribute(r);n.removeAttribute(r),t.setAttribute(r,isNaN(i)?0:i)}_initOptions(e){this.options=H({},this.options,e)}_pan(e,t){let n=this.options.panStep;this.trigger(`pan`,{x:e*n,y:t*n})}_click(e){let t=0,n=0,r=e.currentTarget;r.matches(`.k-navigator-n`)?n=1:r.matches(`.k-navigator-s`)?n=-1:r.matches(`.k-navigator-e`)?t=1:r.matches(`.k-navigator-w`)&&(t=-1),this._pan(t,n),e.preventDefault()}_keydown(e){switch(e.which){case Mf.UP:this._pan(0,1),e.preventDefault();break;case Mf.DOWN:this._pan(0,-1),e.preventDefault();break;case Mf.RIGHT:this._pan(1,0),e.preventDefault();break;case Mf.LEFT:this._pan(-1,0),e.preventDefault();break;default:break}}};Y(DT,{name:`Navigator`,panStep:1}),xT(DT,[`pan`]);function OT(e,t,n){let r=`<button type="button" class="k-button k-icon-button k-zoom-`+e+`" title="zoom-`+e+`" aria-label="zoom-`+e+`">`+_f({icon:t,iconClass:`k-button-icon`,svgIcons:n.svgIcons,type:n.type})+`</button>`;return pT(r)}let kT=`change`;var AT=class extends op{constructor(e,t,n){super(),this.element=e,this._initOptions(t);let r=OT(`in`,`plus`,n),i=OT(`out`,`minus`,n);this.element.appendChild(r),this.element.appendChild(i),this.element.setAttribute(`role`,`group`),le(this.element,`k-widget k-zoom-control k-button-group k-group-horizontal`),this._clickHandler=this._click.bind(this),Wf(this.element,`click`,`.k-button`,this._clickHandler);let a=this.element.parentNode.closest(`[data-role]`);this._keyroot=a||this.element,this._tabindex(this._keyroot),this._keydownHandler=this._keydown.bind(this),Wf(this._keyroot,`keydown`,this._keydownHandler)}destroy(){this.element&&Gf(this.element,`click`,this._clickHandler),this._keyroot&&Gf(this._keyroot,`keydown`,this._keydownHandler)}_tabindex(e){let t=e||this.wrapper||this.element,n=this.element,r=`tabindex`,i=t.getAttribute(r)||n.getAttribute(r);n.removeAttribute(r),t.setAttribute(r,isNaN(i)?0:i)}_initOptions(e){this.options=H({},this.options,e)}_change(e){let t=this.options.zoomStep;this.trigger(kT,{delta:e*t})}_click(e){let t=e.currentTarget,n=1;Hd(t,`k-zoom-out`)&&(n=-1),this._change(n),e.preventDefault()}_keydown(e){switch(e.which){case Mf.NUMPAD_PLUS:case 187:case 61:this._change(1);break;case Mf.NUMPAD_MINUS:case 189:case 173:this._change(-1);break;default:break}}};Y(AT,{name:`ZoomControl`,zoomStep:1}),xT(AT,[kT]);let jT=Math,MT=jT.max,NT=jT.min;var PT=class e{constructor(e,t){let n=Yw.create(e),r=Yw.create(t);n.lng+180>r.lng+180&&n.lat+90<r.lat+90?(this.se=n,this.nw=r):(this.se=r,this.nw=n)}contains(e){let t=this.nw,n=this.se,r=J(e.lng,e[1]),i=J(e.lat,e[0]);return e&&r+180>=t.lng+180&&r+180<=n.lng+180&&i+90>=n.lat+90&&i+90<=t.lat+90}center(){let e=this.nw,t=this.se,n=e.lng+(t.lng-e.lng)/2;return new Yw(e.lat+(t.lat-e.lat)/2,n)}containsAny(e){let t=!1;for(let n=0;n<e.length;n++)t||=this.contains(e[n]);return t}include(e){let t=this.nw,n=this.se,r=J(e.lng,e[1]),i=J(e.lat,e[0]);t.lng=NT(t.lng,r),t.lat=MT(t.lat,i),n.lng=MT(n.lng,r),n.lat=NT(n.lat,i)}includeAll(e){for(let t=0;t<e.length;t++)this.include(e[t])}edges(){let e=this.nw,t=this.se;return{nw:this.nw,ne:new Yw(e.lat,t.lng),se:this.se,sw:new Yw(t.lat,e.lng)}}toArray(){let e=this.nw,t=this.se;return[e,new Yw(e.lat,t.lng),t,new Yw(t.lat,e.lng)]}overlaps(e){return this.containsAny(e.toArray())||e.containsAny(this.toArray())}static create(t,n){if(t instanceof e)return t;if(t&&n)return new e(t,n);if(t&&t.length===4&&!n)return new e([t[0],t[1]],[t[2],t[3]])}static get World(){return new e([90,-180],[-90,180])}};let FT=`centerChange`;var IT=class{constructor(e,t){this.widgetService=e,this.options=H({},this.options,t),this.offset={x:0,y:0}}show(e,t){this.location!==t.location&&(this.anchor=e,this.location=t.location,this.widgetService.notify(`showTooltip`,Object.assign({anchor:this.anchor},t)),this.visible=!0)}hide(){this.widgetService&&this.widgetService.notify(`hideTooltip`),this.visible=!1,this.location=null}get anchor(){return this._anchor}set anchor(e){let t=this.widgetService.widget._toDocumentCoordinates({x:e.left-this.offset.x,y:e.top-this.offset.y});this._anchor={left:t.left,top:t.top}}destroy(){this.widgetService=null}};Y(IT,{border:{width:1},opacity:1});var LT=class{constructor(e,t){this.support=Zf(),this._initOptions(t),this.map=e;let n=document.createElement(`div`);le(n,`k-layer`),n.style.zIndex=this.options.zIndex,n.style.opacity=this.options.opacity,this.element=n,e.scrollElement.appendChild(this.element),this._beforeReset=this._beforeReset.bind(this),this._reset=this._reset.bind(this),this._resize=this._resize.bind(this),this._panEnd=this._panEnd.bind(this),this._activate(),this._updateAttribution()}destroy(){this._deactivate()}_initOptions(e){this.options=H({},this.options,e)}show(){this.reset(),this._activate(),this._applyExtent(!0)}hide(){this._deactivate(),this._setVisibility(!1)}reset(){this._beforeReset(),this._reset()}_reset(){this._applyExtent()}_beforeReset(){}_resize(){}_panEnd(){this._applyExtent()}_applyExtent(){let e=this.options,t=this.map.zoom(),n=!G(e.minZoom)||t>=e.minZoom,r=!G(e.maxZoom)||t<=e.maxZoom,i=PT.create(e.extent),a=!i||i.overlaps(this.map.extent());this._setVisibility(n&&r&&a)}_setVisibility(e){this.element.style.display=e?``:`none`}_activate(){let e=this.map;this._deactivate(),e.bind(`beforeReset`,this._beforeReset),e.bind(`reset`,this._reset),e.bind(`resize`,this._resize),e.bind(`panEnd`,this._panEnd)}_deactivate(){let e=this.map;e.unbind(`beforeReset`,this._beforeReset),e.unbind(`reset`,this._reset),e.unbind(`resize`,this._resize),e.unbind(`panEnd`,this._panEnd)}_updateAttribution(){let e=this.map.attribution;e&&e.add(this.options.attribution)}_readData(){return this.options.data||[]}_hasData(){return this._data&&this._data.length>0}_layerIndex(){return(this.map.layers||[]).indexOf(this)}};let RT=Math,zT=M;function BT(e){return Ed(e)?e:Fd.compile(e)}function VT(e){return new zT(q(e.x),q(e.y))}function HT(e){let t=e;return typeof e!=`string`&&(t+=`px`),t}var UT=class extends LT{constructor(e,t){super(e,t),typeof this.options.subdomains==`string`&&(this.options.subdomains=this.options.subdomains.split(``));let n=this._viewType();this._view=new n(this.element,this.options)}destroy(){super.destroy(),this._view.destroy(),this._view=null}_beforeReset(){let e=this.map,t=e.locationToLayer(e.extent().nw).round();this._view.viewOrigin(t)}_reset(){super._reset(),this._updateView(),this._view.reset()}_viewType(){return WT}_activate(){super._activate(),this.support.mobileOS||(this._pan||=je(this._render.bind(this),100),this.map.bind(`pan`,this._pan))}_deactivate(){super._deactivate(),this._pan&&this.map.unbind(`pan`,this._pan)}_updateView(){let e=this._view,t=this.map,n=t.extent(),r={nw:t.locationToLayer(n.nw).round(),se:t.locationToLayer(n.se).round()};e.center(t.locationToLayer(t.center())),e.extent(r),e.zoom(t.zoom())}_resize(){this._render()}_panEnd(e){super._panEnd(e),this._render()}_render(){this._updateView(),this._view.render()}};Y(UT,{tileSize:256,subdomains:[`a`,`b`,`c`],urlTemplate:``,zIndex:1});var WT=class{constructor(e,t){this.element=e,this._initOptions(t),this.pool=new KT}_initOptions(e){this.options=H({},this.options,e)}center(e){this._center=e}extent(e){this._extent=e}viewOrigin(e){this._viewOrigin=e}zoom(e){this._zoom=e}pointToTileIndex(e){return new zT(RT.floor(e.x/this.options.tileSize),RT.floor(e.y/this.options.tileSize))}tileCount(){let e=this.size(),t=this.pointToTileIndex(this._extent.nw),n=this._extent.nw,r=this.indexToPoint(t).translate(-n.x,-n.y);return{x:RT.ceil((RT.abs(r.x)+e.width)/this.options.tileSize),y:RT.ceil((RT.abs(r.y)+e.height)/this.options.tileSize)}}size(){let e=this._extent.nw,t=this._extent.se.clone().translate(-e.x,-e.y);return{width:t.x,height:t.y}}indexToPoint(e){let t=e.x,n=e.y;return new zT(t*this.options.tileSize,n*this.options.tileSize)}subdomainText(){let e=this.options.subdomains;return e[this.subdomainIndex++%e.length]}destroy(){hT(this.element),this.pool.empty()}reset(){this.pool.reset(),this.subdomainIndex=0,this.render()}render(){let e=this.tileCount(),t=this.pointToTileIndex(this._extent.nw),n,r,i;for(r=0;r<e.x;r++)for(i=0;i<e.y;i++)n=this.createTile({x:t.x+r,y:t.y+i}),n.visible||n.show()}createTile(e){let t=this.tileOptions(e),n=this.pool.get(this._center,t);return n.element.parentNode||this.element.append(n.element),n}tileOptions(e){let t=this.wrapIndex(e),n=this.indexToPoint(e),r=this._viewOrigin;return{index:t,currentIndex:e,point:n,offset:VT(n.clone().translate(-r.x,-r.y)),zoom:this._zoom,size:this.options.tileSize,subdomain:this.subdomainText(),urlTemplate:this.options.urlTemplate,errorUrlTemplate:this.options.errorUrlTemplate}}wrapIndex(e){let t=RT.pow(2,this._zoom);return{x:this.wrapValue(e.x,t),y:K(e.y,0,t-1)}}wrapValue(e,t){let n=RT.abs(e)%t,r=e;return r=e>=0?n:t-(n===0?t:n),r}},GT=class{constructor(e,t){this.id=e,this.visible=!0,this._initOptions(t),this.createElement(),this.show()}destroy(){let e=this.element,t=e?e.parentNode:null;e&&(t&&t.removeChild(e),this.element=null)}_initOptions(e){this.options=H({},this.options,e)}createElement(){let e=document.createElement(`img`),t=this.options.size+`px`;e.setAttribute(`alt`,``),e.style.position=`absolute`,e.style.display=`block`,e.style.width=e.style.maxWidth=t,e.style.height=e.style.maxHeight=t,this.element=e}show(){let e=this.element;e.style.top=HT(this.options.offset.y),e.style.left=HT(this.options.offset.x);let t=this.url();t&&e.setAttribute(`src`,t),e.style.visibility=`visible`,this.visible=!0}hide(){this.element.style.visibility=`hidden`,this.visible=!1}url(){return BT(this.options.urlTemplate)(this.urlOptions())}errorUrl(){return BT(this.options.errorUrlTemplate)(this.urlOptions())}urlOptions(){let e=this.options;return{zoom:e.zoom,subdomain:e.subdomain,z:e.zoom,x:e.index.x,y:e.index.y,s:e.subdomain,quadkey:e.quadkey,q:e.quadkey,culture:e.culture,c:e.culture}}};Y(GT,{urlTemplate:``,errorUrlTemplate:``});var KT=class{constructor(){this._items=[]}get(e,t){return this._items.length>=this.options.maxSize&&this._remove(e),this._create(t)}empty(){let e=this._items;for(let t=0;t<e.length;t++)e[t].destroy();this._items=[]}reset(){let e=this._items;for(let t=0;t<e.length;t++)e[t].hide()}_create(e){let t=this._items,n,r=af(e.point.toString()+e.offset.toString()+e.zoom+e.urlTemplate);for(let e=0;e<t.length;e++)if(t[e].id===r){n=t[e];break}return n?n.show():(n=new GT(r,e),this._items.push(n)),n}_remove(e){let t=this._items,n=-1,r=-1;for(let i=0;i<t.length;i++){let a=t[i].options.point.distanceTo(e);a>n&&!t[i].visible&&(r=i,n=a)}r!==-1&&(t[r].destroy(),t.splice(r,1))}};Y(KT,{maxSize:100});let qT=Object.assign,JT=`change`;var YT=class extends op{constructor(e,t){super();let n=this,r=e[0]||e;n.capture=!1,r.addEventListener?(If.down.split(` `).forEach(function(e){r.addEventListener(e,fT(n._press,n),!0)}),If.up.split(` `).forEach(function(e){r.addEventListener(e,fT(n._release,n),!0)})):(If.down.split(` `).forEach(function(e){r.attachEvent(e,fT(n._press,n))}),If.up.split(` `).forEach(function(e){r.attachEvent(e,fT(n._release,n))})),n.bind([`press`,`release`],t||{})}captureNext(){this.capture=!0}cancelCapture(){this.capture=!1}_press(e){let t=this;t.trigger(`press`),t.capture&&e.preventDefault()}_release(e){let t=this;t.trigger(`release`),t.capture&&(e.preventDefault(),t.cancelCapture())}},XT=class extends op{constructor(e){super();let t=this;t.forcedEnabled=!1,qT(t,e),t.scale=1,t.horizontal?(t.measure=`offsetWidth`,t.scrollSize=`scrollWidth`,t.axis=`x`):(t.measure=`offsetHeight`,t.scrollSize=`scrollHeight`,t.axis=`y`)}makeVirtual(){qT(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})}virtualSize(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())}outOfBounds(e){return e>this.max||e<this.min}forceEnabled(){this.forcedEnabled=!0}getSize(){return this.container[this.measure]}getTotal(){return this.element[this.scrollSize]}rescale(e){this.scale=e}update(e){let t=this,n=t.virtual?t._virtualMax:t.getTotal(),r=n*t.scale,i=t.getSize();n===0&&!t.forcedEnabled||(t.max=t.virtual?-t._virtualMin:0,t.size=i,t.total=r,t.min=Math.min(t.max,i-r),t.minScale=i/n,t.centerOffset=(r-i)/2,t.enabled=t.forcedEnabled||r>i,e||t.trigger(JT,t))}},ZT=class extends op{constructor(e){super();let t=this;t.x=new XT(qT({horizontal:!0},e)),t.y=new XT(qT({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(JT,e)}rescale(e){this.x.rescale(e),this.y.rescale(e),this.refresh()}centerCoordinates(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}}refresh(){let e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(JT)}},QT=class extends op{constructor(e){super(),qT(this,e)}outOfBounds(){return this.dimension.outOfBounds(this.movable[this.axis])}dragMove(e){let t=this,n=t.dimension,r=t.axis,i=t.movable,a=i[r]+e;if(!n.enabled)return;let o=e;(a<n.min&&e<0||a>n.max&&e>0)&&(o*=t.resistance),i.translateAxis(r,o),t.trigger(JT,t)}},$T=class{constructor(e){let t=this,n,r,i,a;qT(t,{elastic:!0},e),i=t.elastic?.5:0,a=t.movable,t.x=n=new QT({axis:`x`,dimension:t.dimensions.x,resistance:i,movable:a}),t.y=r=new QT({axis:`y`,dimension:t.dimensions.y,resistance:i,movable:a}),t.userEvents.bind([`press`,`move`,`end`,`gesturestart`,`gesturechange`],{gesturestart(e){t.gesture=e,t.offset=ef(t.dimensions.container)},press(e){let t=e.event.target.closest(`a`);t&&t.matches(`[data-navigate-on-press=true]`)&&e.sender.cancel()},gesturechange(e){let i=t.gesture,o=i.center,s=e.center,c=e.distance/i.distance,l=t.dimensions.minScale,u=t.dimensions.maxScale,d;a.scale<=l&&c<1&&(c+=(1-c)*.8),a.scale*c>=u&&(c=u/a.scale);let f=a.x+t.offset.left,p=a.y+t.offset.top;d={x:(f-o.x)*c+s.x-f,y:(p-o.y)*c+s.y-p},a.scaleWith(c),n.dragMove(d.x),r.dragMove(d.y),t.dimensions.rescale(a.scale),t.gesture=e,e.preventDefault()},move(e){e.event.target.tagName.match(/textarea|input/i)||(n.dimension.enabled||r.dimension.enabled?(n.dragMove(e.x.delta),r.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end(e){e.preventDefault()}})}};let eE=function(e,t,n){return`translate3d(`+e+`px,`+t+`px,0) scale(`+n+`)`};var tE=class extends op{constructor(e){super();let t=this;t.element=e,t.element.style.transformOrigin=`left top`,t.x=0,t.y=0,t.scale=1;let n=eE(t.x,t.y,t.scale);t.element.style.transform=n,t._saveCoordinates(n)}translateAxis(e,t){this[e]+=t,this.refresh()}scaleTo(e){this.scale=e,this.refresh()}scaleWith(e){this.scale*=e,this.refresh()}translate(e){this.x+=e.x,this.y+=e.y,this.refresh()}moveAxis(e,t){this[e]=t,this.refresh()}moveTo(e){qT(this,e),this.refresh()}refresh(){let e=this,t=e.x,n=e.y,r;e.round&&(t=Math.round(t),n=Math.round(n)),r=eE(t,n,e.scale),r!==e.coordinates&&(e.element.style.transform=r,e._saveCoordinates(r),e.trigger(JT))}_saveCoordinates(e){this.coordinates=e}};let nE=I;var rE=class extends LT{constructor(e,t){super(e,t),this._pan=fT(this._pan,this),this.surface=yo.create(this.element,{width:e.scrollElement.clientWidth,height:e.scrollElement.clientHeight}),this._initRoot(),this.movable=new tE(this.surface.element),this._markers=[],this._click=this._handler(`shapeClick`),this.surface.bind(`click`,this._click),this._mouseleave=this._handler(`shapeMouseLeave`),this.surface.bind(`mouseleave`,this._mouseleave),this.surface.bind(`mouseenter`,this._mouseenter.bind(this))}destroy(){super.destroy(),this.surface.destroy()}_reset(){super._reset(),this._translateSurface(),this._data=this._readData(),this._hasData()&&this._load(this._data)}_initRoot(){this._root=new nE,this.surface.draw(this._root)}_beforeReset(){this.surface.clear(),this._initRoot()}_resize(){this.surface.size(this.map.size())}_readData(){let e=super._readData();return e.type===`FeatureCollection`?e.features:e.type===`GeometryCollection`?e.geometries:e}_load(e){this._data=e,this._clearMarkers(),this._loader||=new iE(this.map,this.options.style,this);let t=new nE;for(let n=0;n<e.length;n++){let r=this._loader.parse(e[n]);r&&t.append(r)}this._root.clear(),this._root.append(t)}shapeCreated(e){let t=!1;if(e instanceof Rn&&this.map.options.renderPointsAsMarkers&&(t=G(this._createMarker(e))),!t){let n={layer:this,shape:e};t=this.map.trigger(`shapeCreated`,n)}return t}featureCreated(e){e.layer=this,this.map.trigger(`shapeFeatureCreated`,e)}_createMarker(e){let t=this.map.markers.bind({location:e.location},e.dataItem);return t&&this._markers.push(t),t}_clearMarkers(){for(let e=0;e<this._markers.length;e++)this.map.markers.remove(this._markers[e]);this._markers=[]}_pan(){this._panning||(this._panning=!0,this.surface.suspendTracking())}_panEnd(e){super._panEnd(e),this._translateSurface(),this.surface.resumeTracking(),this._panning=!1}_translateSurface(){let e=this.map,t=e.locationToView(e.extent().nw);this.surface.translate&&(this.surface.translate(t),this.movable.moveTo({x:t.x,y:t.y}))}_eventArgs(e){return{layer:this,layerIndex:this._layerIndex(),shape:e.element,shapeIndex:(this._data||[]).indexOf(e.element.dataItem),originalEvent:e.originalEvent}}_handler(e){return t=>{t.element&&this.map.trigger(e,this._eventArgs(t))}}_mouseenter(e){if(!e.element)return;this.map.trigger(`shapeMouseEnter`,this._eventArgs(e));let t=e.element,n=this._tooltipAnchor(e);this.map._tooltip.show(n,this._tooltipContext(t))}_tooltipContext(e){return{type:`shape`,layerIndex:this._layerIndex(),className:`k-map-shape-tooltip`,dataItem:e.dataItem,location:e.location}}_tooltipAnchor(e){let t=this.map.eventOffset(e.originalEvent);return{top:t.y,left:t.x}}_activate(){super._activate(),this._panHandler=fT(this._pan,this),this.map.bind(`pan`,this.panHandler)}_deactivate(){super._deactivate(),this.map.unbind(`pan`,this._panHandler)}};Y(rE,{autoBind:!0,zIndex:100});var iE=class{constructor(e,t,n){this.observer=n,this.locator=e,this.style=t}parse(e){let t=new nE,n=!0;return e.type===`Feature`?(n=!1,this._loadGeometryTo(t,e.geometry,e),this._featureCreated(t,e)):this._loadGeometryTo(t,e,e),n&&t.children.length<2&&(t=t.children[0]),t}_shapeCreated(e){let t=!1;return this.observer&&this.observer.shapeCreated&&(t=this.observer.shapeCreated(e)),t}_featureCreated(e,t){this.observer&&this.observer.featureCreated&&this.observer.featureCreated({group:e,dataItem:t,properties:t.properties})}_loadGeometryTo(e,t,n){let r=t.coordinates,i,a;switch(t.type){case`LineString`:a=this._loadPolygon(e,[r],n),this._setLineFill(a);break;case`MultiLineString`:for(i=0;i<r.length;i++)a=this._loadPolygon(e,[r[i]],n),this._setLineFill(a);break;case`Polygon`:this._loadPolygon(e,r,n);break;case`MultiPolygon`:for(i=0;i<r.length;i++)this._loadPolygon(e,r[i],n);break;case`Point`:this._loadPoint(e,r,n);break;case`MultiPoint`:for(i=0;i<r.length;i++)this._loadPoint(e,r[i],n);break;default:break}}_setLineFill(e){let t=e.segments;(t.length<4||!t[0].anchor().equals(of(t).anchor()))&&(e.options.fill=null)}_loadShape(e,t){return this._shapeCreated(t)||e.append(t),t}_loadPolygon(e,t,n){let r=this._buildPolygon(t);return r.dataItem=n,r.location=this.locator.viewToLocation(r.bbox().center()),this._loadShape(e,r)}_buildPolygon(e){let t=new(e.length>1?Hr:F)(this.style);for(let n=0;n<e.length;n++)for(let r=0;r<e[n].length;r++){let i=this.locator.locationToView(Yw.fromLngLat(e[n][r]));r===0?t.moveTo(i.x,i.y):t.lineTo(i.x,i.y)}return t}_loadPoint(e,t,n){let r=Yw.fromLngLat(t),i=new Rn(new jn(this.locator.locationToView(r),10),this.style);return i.dataItem=n,i.location=r,this._loadShape(e,i)}},aE=class extends rE{_readData(){return this.options.data||[]}_load(e){if(this._data=e,this.surface.clear(),e.length===0)return;let t=this.options,n=Bd(t.valueField),r=e.slice(0);r.sort(function(e,t){return n(t)-n(e)});let i=this._scaleType(),a,o=Bd(this.options.locationField);for(let e=0;e<r.length;e++){let s=r[e],c=o(s),l=n(s);if(G(c)&&G(l)){a||=new i([0,l],[t.minSize,t.maxSize]),c=Yw.create(c);let e=this.map.locationToView(c),n=a.map(l),r=this._createSymbol({center:e,size:n,style:t.style,dataItem:s,location:c});r.dataItem=s,r.location=c,r.value=l,this._drawSymbol(r)}}}_scaleType(){let e=this.options.scale;return Ed(e)?e:oE[e]}_createSymbol(e){let t=this.options.symbol;return Ed(t)||(t=sE[t]),t(e)}_drawSymbol(e){let t={layer:this,shape:e};this.map.trigger(`shapeCreated`,t)||this.surface.draw(e)}_tooltipContext(e){return{type:`bubble`,layerIndex:this._layerIndex(),className:`k-map-bubble-tooltip`,dataItem:e.dataItem,location:e.location,value:e.value}}_tooltipAnchor(e){let t=e.element.bbox().center();return{top:t.y,left:t.x}}};Y(aE,{locationField:`location`,valueField:`value`,minSize:0,maxSize:100,scale:`sqrt`,symbol:`circle`,zIndex:200});let oE={sqrt:class{constructor(e,t){this._domain=e,this._range=t;let n=Math.sqrt(e[1])-Math.sqrt(e[0]),r=t[1]-t[0];this._ratio=r/n}map(e){let t=(Math.sqrt(e)-Math.sqrt(this._domain[0]))*this._ratio;return this._range[0]+t}}},sE={circle:function(e){return new Rn(new jn(e.center,e.size/2),e.style)},square:function(e){let t=new F(e.style),n=e.size/2,r=e.center;return t.moveTo(r.x-n,r.y-n).lineTo(r.x+n,r.y-n).lineTo(r.x+n,r.y+n).lineTo(r.x-n,r.y+n).close(),t}},cE=`click`,lE=`mouseenter`,uE=`mouseleave`,dE=Object.assign,fE=`.k-marker`;var pE=class extends LT{constructor(e,t){super(e,t),this._markerClickHandler=fT(this._markerClick,this),Wf(this.element,cE,fE,this._markerClickHandler),this.items=[],this._load(this._readData())}destroy(){super.destroy(),Gf(this.element,cE,this._markerClickHandler),this.clear()}add(e){if(j(e))for(let t=0;t<e.length;t++)this._addOne(e[t]);else return this._addOne(e)}remove(e){e.destroy();let t=(this.items||[]).indexOf(e);t>-1&&this.items.splice(t,1)}clear(){for(let e=0;e<this.items.length;e++)this.items[e].destroy();this.items=[]}update(e){let t=e.location();if(t){e.showAt(this.map.locationToView(t));let n={marker:e,layer:this};this.map.trigger(`markerActivate`,n)}}_reset(){super._reset();let e=this.items;for(let t=0;t<e.length;t++)this.update(e[t])}bind(e,t){let n=mE.create(e,this.options);n.dataItem=t;let r={marker:n,layer:this};if(!this.map.trigger(`markerCreated`,r))return this.add(n),n}_addOne(e){let t=mE.create(e,this.options);return t.addTo(this),t}_readData(){return this.options.data||[]}_load(e){this._data=e,this.clear();let t=Bd(this.options.locationField),n=Bd(this.options.titleField);for(let r=0;r<e.length;r++){let i=e[r];this.bind({location:t(i),title:n(i)},i)}}_markerClick(e){let t=e.currentTarget._kendoNode,n={layer:this,layerIndex:this._layerIndex(),marker:t,markerIndex:(this.items||[]).indexOf(t),originalEvent:e};this.map.trigger(`markerClick`,n)}_markerMouseEnter(e){let t=this._createMarkerEventArgs(e);this.map.trigger(`markerMouseEnter`,t)}_markerMouseLeave(e){let t=this._createMarkerEventArgs(e);this.map.trigger(`markerMouseLeave`,t)}_createMarkerEventArgs(e){let t=e.marker;return dE({},{layer:this,layerIndex:this._layerIndex(),marker:t,markerIndex:(this.items||[]).indexOf(t)},e)}};Y(pE,{zIndex:1e3,autoBind:!0,locationField:`location`,titleField:`title`,template:``});var mE=class e{constructor(e){this.options=e||{}}destroy(){this.layer=null,this.unbindEvents(),this.hide()}addTo(e){this.layer=e.markers||e,this.layer.items.push(this),this.layer.update(this)}location(e){return e?(this.options.location=Yw.create(e).toArray(),this.layer&&this.layer.update(this),this):Yw.create(this.options.location)}showAt(e){this.render(),this._anchor={left:Math.round(e.x),top:Math.round(e.y)},this.element.style.left=yT(this._anchor.left),this.element.style.top=yT(this._anchor.top)}hide(){this.element&&=(this.element.remove(),null)}bindEvents(){this.element&&(this._mouseEnterHandler=fT(this._mouseEnter,this),Wf(this.element,lE,fE,this._mouseEnterHandler),this._mouseLeaveHandler=fT(this._mouseLeave,this),Wf(this.element,uE,fE,this._mouseLeaveHandler))}unbindEvents(){this.element&&(Gf(this.element,lE,this._mouseEnterHandler),Gf(this.element,uE,this._mouseLeaveHandler))}render(){if(!this.element){let e=this.options,t=this.layer,n=document.createElement(`span`);if(le(n,`k-marker`),this.options.template){let e=this._compileTemplate(this.options.template)(this.dataItem),t=pT(e);n.appendChild(t)}else if(e.svgIcon)_f(n,{icon:e.svgIcon,iconClass:`k-icon-xxl`,svgIcons:this.options.icons.svgIcons,type:`svg`});else{let t={icon:`map-marker`,iconClass:`k-icon-xxl`,svgIcons:this.options.icons.svgIcons,type:this.options.icons.type};e.shape?e.shape===`pinTarget`?(t.icon=`map-marker-target`,_f(n,t)):e.shape===`pin`?_f(n,t):le(n,`k-icon k-icon-xxl k-i-marker-`+vT(e.shape||`pin`)):_f(n,t)}e.title&&n.setAttribute(`title`,e.title);let r=e.attributes||{};Object.keys(r).forEach(function(e){n.setAttribute(e,r[e])}),n._kendoNode=this,n.style.zIndex=e.zIndex,this.element=n,t&&t.element.appendChild(this.element),this.bindEvents()}}_mouseEnter(e){let t=this._createEventArgs(e);this.layer._markerMouseEnter(t),this.layer.map._tooltip.show({top:this._anchor.top-this.element.offsetHeight,left:this._anchor.left},this._tooltipContext())}_tooltipContext(){return{type:`marker`,layerIndex:this.layer._layerIndex(),className:`k-map-marker-tooltip`,dataItem:this.dataItem,title:this.options.title,location:this.location()}}_mouseLeave(e){let t=this._createEventArgs(e);this.layer._markerMouseLeave(t)}_createEventArgs(e){return{marker:this,originalEvent:e}}_compileTemplate(e){return Fd.compile(e,{paramName:`dataItem`,useWithBlock:!1})}static create(t,n){return t instanceof e?t:new e(H({},n,t))}};let hE=Object.assign;function gE(e){window.requestAnimationFrame(e)}var _E=class{constructor(){let e=this;e._tickProxy=fT(e._tick,e),e._started=!1}tick(){}done(){}onEnd(){}onCancel(){}start(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,gE(this._tickProxy)))}enabled(){return!0}cancel(){this._started=!1,this.onCancel()}_tick(){let e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):gE(e._tickProxy))}},vE=class extends _E{constructor(e){super(),hE(this,e)}done(){return this.timePassed()>=this.duration}timePassed(){return Math.min(this.duration,tp()-this.startDate)}moveTo(e){let t=this;t.initial=t.movable[t.axis],t.delta=e.location-t.initial,t.duration=typeof e.duration==`number`?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=tp(),t.start()}_easeProxy(e){let t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}static easeOutExpo(e,t,n,r){return e===r?t+n:n*(-(2**(-10*e/r))+1)+t}};let yE=Object.assign,bE=Math.abs,xE=`change`,SE=`scroll`;var CE=class extends _E{constructor(e){super(e);let t=this;yE(t,e),t.userEvents.bind(`gestureend`,t.start.bind(this)),t.tapCapture.bind(`press`,t.cancel.bind(this))}enabled(){return this.movable.scale<this.dimensions.minScale}done(){return this.dimensions.minScale-this.movable.scale<.01}tick(){let e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)}onEnd(){let e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}},wE=class extends _E{constructor(e){super();let t=this;yE(t,e,{transition:new vE({axis:e.axis,movable:e.movable,onEnd(){t._end()}})}),t.tapCapture.bind(`press`,function(){t.cancel()}),t.userEvents.bind(`end`,fT(t.start,t)),t.userEvents.bind(`gestureend`,fT(t.start,t)),t.userEvents.bind(`tap`,fT(t.onEnd,t))}onCancel(){this.transition.cancel()}freeze(e){let t=this;t.cancel(),t._moveTo(e)}onEnd(){let e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()}done(){return bE(this.velocity)<1}start(e){let t=this,n;t.dimension.enabled&&(t.paneAxis.outOfBounds()?t.transition._started?(t.transition.cancel(),t.velocity=Math.min(e.touch[t.axis].velocity*t.velocityMultiplier,55),super.start()):t._snapBack():(n=e.touch.id===2?0:e.touch[t.axis].velocity,t.velocity=Math.max(Math.min(n*t.velocityMultiplier,55),-55),t.tapCapture.captureNext(),super.start()))}tick(){let e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?.5:e.friction,r=e.velocity*=n,i=e.movable[e.axis]+r;!e.elastic&&t.outOfBounds(i)&&(i=Math.max(Math.min(i,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,i)}_end(){this.tapCapture.cancelCapture(),this.end()}_snapBack(){let e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)}_moveTo(e){this.transition.moveTo({location:e,duration:500,ease:vE.easeOutExpo})}},TE=class extends _E{constructor(e){super(e);let t=this;yE(t,e,{origin:{},destination:{},offset:{}})}tick(){this._updateCoordinates(),this.moveTo(this.origin)}done(){return bE(this.offset.y)<5&&bE(this.offset.x)<5}onEnd(){this.moveTo(this.destination),this.callback&&this.callback.call()}setCoordinates(e,t){this.offset={},this.origin=e,this.destination=t}setCallback(e){e&&Ed(e)?this.callback=e:e=void 0}_updateCoordinates(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}},EE=class{constructor(e){let t=this,n=e.axis===`x`,r=pT(`<div class="km-touch-scrollbar km-`+(n?`horizontal`:`vertical`)+`-scrollbar" />`);yE(t,e,{element:r,elementSize:0,movable:new tE(r),scrollMovable:e.movable,alwaysVisible:e.alwaysVisible,size:n?`width`:`height`}),t.scrollMovable.bind(xE,t.refresh.bind(t)),t.container.appendChild(r),e.alwaysVisible&&t.show()}refresh(){let e=this,t=e.axis,n=e.dimension,r=n.size,i=e.scrollMovable,a=r/n.total,o=Math.round(-i[t]*a),s=Math.round(r*a);a>=1?this.element.style.display=`none`:this.element.style.display=``,o+s>r?s=r-o:o<0&&(s+=o,o=0),e.elementSize!==s&&(e.element.style[e.size]=s+`px`,e.elementSize=s),e.movable.moveAxis(t,o)}show(){this.element.style.opacity=.7,this.element.style.visibility=`visible`}hide(){this.alwaysVisible||(this.element.style.opacity=0)}},DE=class extends op{constructor(e,t){super();let n=this;this.element=e,this._initOptions(t);let r=bT(navigator.userAgent);n._native=n.options.useNative&&r;let i=pT(`<div class="km-scroll-header"/>`);if(n._native){le(e,`km-native-scroller`),gT(i,e),yE(n,{scrollElement:e,fixedContainer:e.children[0]});return}e.style.overflow=`hidden`,le(e,`km-scroll-wrapper`);let a=pT(`<div class="km-scroll-container"/>`);_T(e,a),gT(i,e);let o=e.children[1],s=new YT(e),c=new tE(o),l=new ZT({element:o,container:e,forcedEnabled:n.options.zoom}),u=this.options.avoidScrolling,d=new Op(e,{touchAction:`none`,allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:n.options.zoom,supportDoubleTap:n.options.supportDoubleTap,start(e){l.refresh();let t=bE(e.x.velocity),r=bE(e.y.velocity),i=t*2>=r,a=n.fixedContainer.contains(e.event.target),o=r*2>=t;!a&&!u(e)&&n.enabled&&(l.x.enabled&&i||l.y.enabled&&o)?d.capture():d.cancel()}}),f=new $T({movable:c,dimensions:l,userEvents:d,elastic:n.options.elastic}),p=new CE({movable:c,dimensions:l,userEvents:d,tapCapture:s}),m=new TE({moveTo(e){n.scrollTo(e.x,e.y)}});c.bind(xE,function(){n.scrollTop=-c.y,n.scrollLeft=-c.x,n.trigger(SE,{scrollTop:n.scrollTop,scrollLeft:n.scrollLeft})}),n.options.mousewheelScrolling&&(this._wheelScrollHandler=this._wheelScroll.bind(this),Wf(e,`wheel`,this._wheelScrollHandler)),yE(n,{movable:c,dimensions:l,zoomSnapBack:p,animatedScroller:m,userEvents:d,pane:f,tapCapture:s,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:e.children[0]}),n._initAxis(`x`),n._initAxis(`y`),n._wheelEnd=function(){n._wheel=!1,n.userEvents.end(0,n._wheelY)},l.refresh(),n.options.pullToRefresh&&n._initPullToRefresh()}_initOptions(e){this.options=H({},this.options,e)}_wheelScroll(e){if(e.ctrlKey)return;this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);let t=ST(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()}makeVirtual(){this.dimensions.y.makeVirtual()}virtualSize(e,t){this.dimensions.y.virtualSize(e,t)}height(){return this.dimensions.y.size}scrollHeight(){return this.scrollElement.scrollHeight}scrollWidth(){return this.scrollElement.scrollWidth}_resize(){this._native||this.contentResized()}setOptions(e){let t=this;this._initOptions(e),e.pullToRefresh&&t._initPullToRefresh()}reset(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))}contentResized(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis(`x`,this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis(`y`,this.dimensions.y.min)}zoomOut(){let e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())}enable(){this.enabled=!0}disable(){this.enabled=!1}scrollTo(e,t){this._native?(this.scrollElement.scrollLeft(bE(e)),this.scrollElement.scrollTop(bE(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))}animatedScrollTo(e,t,n){let r,i;this._native?this.scrollTo(e,t):(r={x:this.movable.x,y:this.movable.y},i={x:e,y:t},this.animatedScroller.setCoordinates(r,i),this.animatedScroller.setCallback(n),this.animatedScroller.start())}pullHandled(){}destroy(){let e=this.element;Gf(e,`wheel`,this._wheelScrollHandler),this.userEvents&&this.userEvents.destroy()}_scale(e){this.dimensions.rescale(e),this.movable.scaleTo(e)}_initPullToRefresh(){}_dragEnd(){}_paneChange(){}_initAxis(e){let t=this,n=t.movable,r=t.dimensions[e],i=t.tapCapture,a=t.pane[e],o=new EE({axis:e,movable:n,dimension:r,container:t.element,alwaysVisible:t.options.visibleScrollHints});r.bind(xE,function(){o.refresh()}),a.bind(xE,function(){o.show()}),t[e+`inertia`]=new wE({axis:e,paneAxis:a,movable:n,tapCapture:i,userEvents:t.userEvents,dimension:r,elastic:t.options.elastic,friction:t.options.friction||.96,velocityMultiplier:t.options.velocityMultiplier||10,end(){o.hide(),t.trigger(`scrollEnd`,{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}};Y(DE,{name:`Scroller`,zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling(){return!1},pullToRefresh:!1,messages:{pullTemplate:`Pull to refresh`,releaseTemplate:`Release to refresh`,refreshTemplate:`Refreshing`}}),xT(DE,[`pull`,SE,`resize`]);var OE=class{constructor(e,t={}){this.sender=t.sender||e,this.widget=e,this.rtl=!!t.rtl}notify(e,t){this.widget&&this.widget.trigger(e,t)}};let kE=Math,AE=kE.min,jE=kE.pow,ME=M,NE=`marker`,PE=`location`,FE=`wheel`,IE={bubble:aE,shape:rE,tile:UT,[NE]:pE};var LE=class extends op{constructor(e,t={},n={},r={}){super(),this._init(e,t,n,r)}destroy(){this.scroller.destroy(),this._tooltip&&this._tooltip.destroy(),this.navigator&&this.navigator.destroy(),this.attribution&&this.attribution.destroy(),this.zoomControl&&this.zoomControl.destroy(),j(this.markers)?this.markers.forEach(e=>{e.destroy()}):this.markers.destroy();for(let e=0;e<this.layers.length;e++)this.layers[e].destroy();Gf(this.element,FE,this._mousewheelHandler),super.destroy()}_init(e,t={},n={},r={}){this.support=Zf(),this.context=r,this.initObserver(r),this.initServices(r),this._notifyObserver(`init`),this._initOptions(t),this._setEvents(t),this.crs=new dT,this._initElement(e),this._viewOrigin=this._getOrigin(),this._tooltip=this._createTooltip(),this._initScroller(),this._initMarkers(),this._initControls(),this._initLayers(),this._reset();let i=je(this._mousewheel.bind(this),50);this._mousewheelHandler=e=>{e.preventDefault(),i(e)},Wf(this.element,FE,this._mousewheelHandler)}_initOptions(e){this.options=H({},this.options,e)}_initElement(e){this.element=e,le(e,`k-map`),e.style.position=`relative`,e.setAttribute(`data-role`,`map`),hT(e);let t=pT(`<div />`);this.element.appendChild(t)}initServices(e={}){this.widgetService=new OE(this,e)}initObserver(e={}){this.observers=[],this.addObserver(e.observer)}addObserver(e){e&&this.observers.push(e)}removeObserver(e){let t=this.observers.indexOf(e);t>=0&&this.observers.splice(t,1)}requiresHandlers(e){let t=this.observers;for(let n=0;n<t.length;n++)if(t[n].requiresHandlers(e))return!0}trigger(e,t={}){t.sender=this;let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r||super.trigger(e,t),r}_notifyObserver(e,t={}){t.sender=this;let n=this.observers,r=!1;for(let i=0;i<n.length;i++)n[i].trigger(e,t)&&(r=!0);return r}zoom(e){let t=this.options,n;if(G(e)){let r=kE.round(K(e,t.minZoom,t.maxZoom));t.zoom!==r&&(t.zoom=r,this.widgetService.notify(`zoomChange`,{zoom:t.zoom}),this._reset()),n=this}else n=t.zoom;return n}center(e){let t;if(e){let n=Yw.create(e),r=Yw.create(this.options.center);n.equals(r)||(this.options.center=n.toArray(),this.widgetService.notify(FT,{center:this.options.center}),this._reset()),t=this}else t=Yw.create(this.options.center);return t}extent(e){let t;return e?(this._setExtent(e),t=this):t=this._getExtent(),t}setOptions(e={}){let t=this.element;this.destroy(),hT(t),this._init(t,e,{},this.context),this._reset()}locationToLayer(e,t){let n=!this.options.wraparound,r=Yw.create(e);return this.crs.toPoint(r,this._layerSize(t),n)}layerToLocation(e,t){let n=!this.options.wraparound,r=ME.create(e);return this.crs.toLocation(r,this._layerSize(t),n)}locationToView(e){let t=Yw.create(e),n=this.locationToLayer(this._viewOrigin);return this.locationToLayer(t).translateWith(n.scale(-1))}viewToLocation(e,t){let n=this.locationToLayer(this._getOrigin(),t),r=ME.create(e).clone().translateWith(n);return this.layerToLocation(r,t)}eventOffset(e){let t,n,r=ef(this.element);if(e.x&&e.x[PE]||e.y&&e.y[PE])t=e.x[PE]-r.left,n=e.y[PE]-r.top;else{let i=e.originalEvent||e;t=J(i.pageX,i.clientX)-r.left,n=J(i.pageY,i.clientY)-r.top}return new M(t,n)}eventToView(e){let t=this.eventOffset(e);return this.locationToView(this.viewToLocation(t))}eventToLayer(e){return this.locationToLayer(this.eventToLocation(e))}eventToLocation(e){let t=this.eventOffset(e);return this.viewToLocation(t)}viewSize(){let e=this.element,t=this._layerSize(),n=e.clientWidth;return this.options.wraparound||(n=AE(t,n)),{width:n,height:AE(t,e.clientHeight)}}exportVisual(){return this._reset(),!1}hideTooltip(){this._tooltip&&this._tooltip.hide()}_setOrigin(e,t){let n=this.viewSize(),r,i=this._origin=Yw.create(e);return r=this.locationToLayer(i,t),r.x+=n.width/2,r.y+=n.height/2,this.options.center=this.layerToLocation(r,t).toArray(),this.widgetService.notify(FT,{center:this.options.center}),this}_getOrigin(e){let t=this.viewSize(),n;return(e||!this._origin)&&(n=this.locationToLayer(this.center()),n.x-=t.width/2,n.y-=t.height/2,this._origin=this.layerToLocation(n)),this._origin}_setExtent(e){let t=PT.create(e),n=t.se.clone();this.options.wraparound&&n.lng<0&&e.nw.lng>0&&(n.lng=180+(180+n.lng));let r=new PT(t.nw,n);this.center(r.center());let i=this.element.clientWidth,a=this.element.clientHeight,o;for(o=this.options.maxZoom;o>=this.options.minZoom;o--){let e=this.locationToLayer(r.nw,o),t=this.locationToLayer(r.se,o),n=kE.abs(t.x-e.x),s=kE.abs(t.y-e.y);if(n<=i&&s<=a)break}this.zoom(o)}_getExtent(){let e=this._getOrigin(),t=this.locationToLayer(e),n=this.viewSize();return t.x+=n.width,t.y+=n.height,new PT(e,this.layerToLocation(t))}_zoomAround(e,t){this._setOrigin(this.layerToLocation(e,t),t),this.zoom(t)}_initControls(){let e=this.options.controls;e.attribution&&this._createAttribution(e.attribution),this.support.mobileOS||(e.navigator&&this._createNavigator(e.navigator),e.zoom&&this._createZoomControl(e.zoom))}_createControlElement(e,t){let n=e.position||t,r=`.`+CT(n).replace(` `,`.`),i=this.element.querySelector(`.k-map-controls`+r)||[];if(i.length===0){let e=document.createElement(`div`);le(e,`k-map-controls `+CT(n)),i=e,this.element.appendChild(i)}let a=document.createElement(`div`);return i.appendChild(a),a}_createAttribution(e){let t=this._createControlElement(e,`bottomRight`);this.attribution=new wT(t,e)}_createNavigator(e){let t=this._createControlElement(e,`topLeft`),n=this.navigator=new DT(t,H({},e,{icons:this.options.icons}));this._navigatorPan=this._navigatorPan.bind(this),n.bind(`pan`,this._navigatorPan),this._navigatorCenter=this._navigatorCenter.bind(this),n.bind(`center`,this._navigatorCenter)}_navigatorPan(e){let t=this.scroller,n=t.scrollLeft+e.x,r=t.scrollTop-e.y,i=this._virtualSize,a=this.element.clientWidth,o=this.element.clientHeight;n=K(n,i.x.min,i.x.max-a),r=K(r,i.y.min,i.y.max-o),this.scroller.one(`scroll`,fT(this._scrollEnd,this)),this.scroller.scrollTo(-n,-r)}_navigatorCenter(){this.center(this.options.center)}_createZoomControl(e){let t=this._createControlElement(e,`topLeft`),n=this.zoomControl=new AT(t,e,this.options.icons);this._zoomControlChange=this._zoomControlChange.bind(this),n.bind(`change`,this._zoomControlChange)}_zoomControlChange(e){this.trigger(`zoomStart`,{originalEvent:e})||(this.zoom(this.zoom()+e.delta),this.trigger(`zoomEnd`,{originalEvent:e}))}_initScroller(){let e=this.support.mobileOS?.93:.9,t=this.options.zoomable!==!1,n=this.scroller=new DE(this.element.children[0],{friction:e,velocityMultiplier:5,zoom:t,mousewheelScrolling:!1,supportDoubleTap:!0});n.bind(`scroll`,fT(this._scroll,this)),n.bind(`scrollEnd`,fT(this._scrollEnd,this)),n.userEvents.bind(`gesturestart`,fT(this._scaleStart,this)),n.userEvents.bind(`gestureend`,fT(this._scale,this)),n.userEvents.bind(`doubleTap`,fT(this._doubleTap,this)),n.userEvents.bind(`tap`,fT(this._tap,this)),this.scrollElement=n.scrollElement}_initLayers(){let e=this.options.layers,t=this.layers=[];for(let n=0;n<e.length;n++){let r=e[n],i=this._createLayer(r);t.push(i)}}_createLayer(e){let t=e.type||`shape`,n=this.options.layerDefaults[t],r=t===NE?H({},this.options.markerDefaults,e,{icons:this.options.icons}):H({},n,e),i=IE[t],a=new i(this,r);return t===NE&&(this.markers=a),a}_createTooltip(){return new IT(this.widgetService,this.options.tooltip)}_initMarkers(){(this.options.layers||[]).filter(e=>e&&e.type===NE).length>0||(this.markers=new pE(this,H({},this.options.markerDefaults,{icons:this.options.icons})),this.markers.add(this.options.markers))}_scroll(e){let t=this.locationToLayer(this._viewOrigin).round(),n=e.sender.movable,r=new M(n.x,n.y).scale(-1).scale(1/n.scale);t.x+=r.x,t.y+=r.y,this._scrollOffset=r,this._tooltip.offset=r,this.hideTooltip(),this._setOrigin(this.layerToLocation(t)),this.trigger(`pan`,{originalEvent:e,origin:this._getOrigin(),center:this.center()})}_scrollEnd(e){!this._scrollOffset||!this._panComplete()||(this._scrollOffset=null,this._panEndTimestamp=tp(),this.trigger(`panEnd`,{originalEvent:e,origin:this._getOrigin(),center:this.center()}))}_panComplete(){return tp()-(this._panEndTimestamp||0)>50}_scaleStart(e){if(this.trigger(`zoomStart`,{originalEvent:e})){let t=e.touches[1];t&&t.cancel()}}_scale(e){let t=this.scroller.movable.scale,n=this._scaleToZoom(t),r=new M(e.center.x,e.center.y),i=this.viewToLocation(r,n),a=this.locationToLayer(i,n).translate(-r.x,-r.y);this._zoomAround(a,n),this.trigger(`zoomEnd`,{originalEvent:e})}_scaleToZoom(e){let t=this._layerSize()*e/this.options.minSize,n=kE.log(t)/kE.log(2);return kE.round(n)}_reset(){this.attribution&&this.attribution.filter(this.center(),this.zoom()),this._viewOrigin=this._getOrigin(!0),this._resetScroller(),this.hideTooltip(),this.trigger(`beforeReset`),this.trigger(`reset`)}_resetScroller(){let e=this.scroller,t=e.dimensions.x,n=e.dimensions.y,r=this._layerSize(),i=this.extent().nw,a=this.locationToLayer(i).round();e.movable.round=!0,e.reset(),e.userEvents.cancel();let o=this.zoom();e.dimensions.forcedMinScale=jE(2,this.options.minZoom-o),e.dimensions.maxScale=jE(2,this.options.maxZoom-o);let s={min:-a.x,max:r-a.x},c={min:-a.y,max:r-a.y};if(this.options.wraparound&&(s.max=20*r,s.min=-s.max),this.options.pannable===!1){let e=this.viewSize();s.min=c.min=0,s.max=e.width,c.max=e.height}t.makeVirtual(),n.makeVirtual(),t.virtualSize(s.min,s.max),n.virtualSize(c.min,c.max),this._virtualSize={x:s,y:c}}_renderLayers(){}_layerSize(e){let t=J(e,this.options.zoom);return this.options.minSize*jE(2,t)}_tap(e){if(!this._panComplete())return;let t=this.eventOffset(e);this.hideTooltip(),this.trigger(`click`,{originalEvent:e,location:this.viewToLocation(t)})}_doubleTap(e){if(this.options.zoomable!==!1&&!this.trigger(`zoomStart`,{originalEvent:e})){let t=this.zoom()+1,n=this.eventOffset(e),r=this.viewToLocation(n),i=this.locationToLayer(r,t).translate(-n.x,-n.y);this._zoomAround(i,t),this.trigger(`zoomEnd`,{originalEvent:e})}}_mousewheel(e){let t=Xd(e)>0?-1:1,n=this.options,r=this.zoom(),i=K(r+t,n.minZoom,n.maxZoom);if(n.zoomable!==!1&&i!==r&&!this.trigger(`zoomStart`,{originalEvent:e})){let t=this.eventOffset(e),n=this.viewToLocation(t),r=this.locationToLayer(n,i).translate(-t.x,-t.y);this._zoomAround(r,i),this.trigger(`zoomEnd`,{originalEvent:e})}}_toDocumentCoordinates(e){let t=ef(this.element);return{left:q(e.x+t.left),top:q(e.y+t.top)}}};Y(LE,{name:`Map`,controls:{attribution:!0,navigator:{panStep:100},zoom:!0},layers:[],layerDefaults:{shape:{style:{fill:{color:`#fff`},stroke:{color:`#aaa`,width:.5}}},bubble:{style:{fill:{color:`#fff`,opacity:.5},stroke:{color:`#aaa`,width:.5}}},marker:{shape:`pinTarget`,tooltip:{position:`top`}}},center:[0,0],icons:{type:`font`,svgIcons:{}},zoom:3,minSize:256,minZoom:1,maxZoom:19,markers:[],markerDefaults:{shape:`pinTarget`,tooltip:{position:`top`}},wraparound:!0,renderPointsAsMarkers:!1}),xT(LE,[`beforeReset`,`click`,`markerActivate`,`markerClick`,`markerCreated`,`markerMouseEnter`,`markerMouseLeave`,`pan`,`panEnd`,`reset`,`shapeClick`,`shapeCreated`,`shapeFeatureCreated`,`shapeMouseEnter`,`shapeMouseLeave`,`zoomEnd`,`zoomStart`]);let RE=(e,t)=>Math.max.apply(null,e.map(t)),zE=(e,t)=>Math.min.apply(null,e.map(t)),BE=(e,t)=>e.map(t).reduce((e,t)=>e+t,0),VE=(e,t)=>e.y0===t.y0?e.index-t.index:e.y0+e.y1-t.y0-t.y1,HE=(e,t)=>VE(e.source,t.source),UE=(e,t)=>VE(e.target,t.target),WE=e=>e.value;function GE(e){e.forEach(e=>{e.targetLinks.forEach(e=>{e.source.sourceLinks.sort(UE)}),e.sourceLinks.forEach(e=>{e.target.targetLinks.sort(HE)})})}let KE=(e,t)=>e.align===`left`?e.depth:e.align===`right`?t-e.height:e.sourceLinks.length?e.depth:t;var qE=class{constructor(e){let{offset:t={},align:n}=e.nodesOptions;this.data={nodes:e.nodes.map(e=>H({},{offset:t,align:n},e)),links:e.links.map(e=>H({},e))},this.width=e.width,this.height=e.height,this.offsetX=e.offsetX||0,this.offsetY=e.offsetY||0,this.nodeWidth=e.nodesOptions.width,this.nodePadding=e.nodesOptions.padding,this.reverse=e.reverse,this.targetColumnIndex=e.targetColumnIndex,this.loops=e.loops,this.autoLayout=e.autoLayout}calculate(){let{nodes:e,links:t}=this.data;this.connectLinksToNodes(e,t),this.calculateNodeValues(e);let n=this.calculateNodeHeights(e);if(n)return{nodes:[],links:[],columns:[],circularLinks:n};this.calculateNodeDepths(e);let r=this.calculateNodeColumns(e);return this.calculateNodeBreadths(r),this.applyNodesOffset(e),this.calculateLinkBreadths(e),Object.assign({},this.data,{columns:r})}connectLinksToNodes(e,t){let n=new Map;e.forEach((e,t)=>{e.index=t,e.sourceLinks=[],e.targetLinks=[],e.id=e.id===void 0?e.label.text:e.id,n.set(e.id,e)}),t.forEach(e=>{e.source=n.get(e.sourceId),e.target=n.get(e.targetId),e.source.sourceLinks.push(e),e.target.targetLinks.push(e)})}calculateNodeValues(e){e.forEach(e=>{e.value=Math.max(BE(e.sourceLinks,WE),BE(e.targetLinks,WE))})}calculateNodeDepths(e){let t=new Set(e),n=new Set,r=0;for(;t.size;){let e=Array.from(t);for(let t=0;t<e.length;t++){let i=e[t];i.depth=r;for(let e=0;e<i.sourceLinks.length;e++){let t=i.sourceLinks[e];n.add(t.target)}}r++,t=n,n=new Set}}calculateNodeHeights(e){let t=e.length,n=new Set(e),r=new Set,i=0,a=e=>{e.height=i,e.targetLinks.forEach(e=>{r.add(e.source)})};for(;n.size;){if(n.forEach(a),i++,i>t)return!0;n=r,r=new Set}return!1}calculateNodeColumns(e){let t=RE(e,e=>e.depth),n=(this.width-this.offsetX-this.nodeWidth)/t,r=Array(t+1);for(let i=0;i<e.length;i++){let a=e[i],o=Math.max(0,Math.min(t,KE(a,t)));a.x0=this.offsetX+o*n,a.x1=a.x0+this.nodeWidth,a.layer=o,r[o]=r[o]||[],r[o].push(a)}return r}calculateNodeBreadths(e){let t=zE(e,e=>(this.height-this.offsetY-(e.length-1)*this.nodePadding)/BE(e,WE));if(e.forEach(e=>{let n=this.offsetY;e.forEach(e=>{e.y0=n,e.y1=n+e.value*t,n=e.y1+this.nodePadding,e.sourceLinks.forEach(e=>{e.width=e.value*t})}),n=(this.height-n+this.nodePadding)/(e.length+1),e.forEach((e,t)=>{e.y0+=n*(t+1),e.y1+=n*(t+1)})}),this.autoLayout!==!1){let t=this.loops===void 0?e.length-1:this.loops,n=this.targetColumnIndex||1;for(let r=0;r<t;r++)this.reverse?(this.uncurlLinksToRight(e,n),this.uncurlLinksToLeft(e,n)):(this.uncurlLinksToLeft(e,n),this.uncurlLinksToRight(e,n))}e.forEach(GE)}applyNodesOffset(e){e.forEach(e=>{let t=(e.offset?e.offset.left:0)||0,n=(e.offset?e.offset.top:0)||0;e.x0+=t,e.x1+=t,e.y0+=n,e.y1+=n})}calculateLinkBreadths(e){e.forEach(e=>{let{sourceLinks:t,targetLinks:n}=e,r=e.y0,i=r;t.forEach(e=>{e.x0=e.source.x1,e.y0=r+e.width/2,r+=e.width}),n.forEach(e=>{e.x1=e.target.x0,e.y1=i+e.width/2,i+=e.width})})}uncurlLinksToRight(e,t){let n=e.length;for(let r=t;r<n;r++){let t=e[r];t.forEach(e=>{let t=0,n=0;e.targetLinks.forEach(r=>{let i=r.value*(e.layer-r.source.layer);t+=this.targetTopPos(r.source,e)*i,n+=i});let r=t===0?0:t/n-e.y0;e.y0+=r,e.y1+=r,GE([e])}),t.sort(VE),this.arrangeNodesVertically(t)}}uncurlLinksToLeft(e,t){let n=e.length-1-t;for(let t=n;t>=0;t--){let n=e[t];for(let e=0;e<n.length;e++){let t=n[e],r=0,i=0;t.sourceLinks.forEach(e=>{let n=e.value*(e.target.layer-t.layer);r+=this.sourceTopPos(t,e.target)*n,i+=n});let a=r===0?0:r/i-t.y0;t.y0+=a,t.y1+=a,GE([t])}n.sort(VE),this.arrangeNodesVertically(n)}}arrangeNodesVertically(e){let t=e.length-1;this.arrangeUp(e,this.height,t),this.arrangeDown(e,this.offsetY,0)}arrangeDown(e,t,n){let r=t;for(let t=n;t<e.length;t++){let n=e[t],i=Math.max(0,r-n.y0);n.y0+=i,n.y1+=i,r=n.y1+this.nodePadding}}arrangeUp(e,t,n){let r=t;for(let t=n;t>=0;--t){let n=e[t],i=Math.max(0,n.y1-r);n.y0-=i,n.y1-=i,r=n.y0-this.nodePadding}}sourceTopPos(e,t){let n=t.y0-(t.targetLinks.length-1)*this.nodePadding/2;for(let r=0;r<t.targetLinks.length;r++){let i=t.targetLinks[r];if(i.source===e)break;n+=i.width+this.nodePadding}for(let r=0;r<e.sourceLinks.length;r++){let i=e.sourceLinks[r];if(i.target===t)break;n-=i.width}return n}targetTopPos(e,t){let n=e.y0-(e.sourceLinks.length-1)*this.nodePadding/2;for(let r=0;r<e.sourceLinks.length;r++){let i=e.sourceLinks[r];if(i.target===t)break;n+=i.width+this.nodePadding}for(let r=0;r<t.targetLinks.length;r++){let i=t.targetLinks[r];if(i.source===e)break;n-=i.width}return n}};let JE=e=>new qE(e).calculate(),YE=e=>{let t=0,n=e.length;for(let r=0;r<n;r++){let i=e[r];for(let a=r+1;a<n;a++){let n=e[a];ZE(i,n)&&(t+=Math.min(i.value,n.value))}}return t};function XE(e,t,n,r,i,a){let o=(a-t)*(n-e),s=(r-t)*(i-e);return o>s?1:o===s?0:-1}function ZE(e,t){let n=XE(e.x0,e.y0,e.x1,e.y1,t.x1,t.y1),r=XE(e.x0,e.y0,e.x1,e.y1,t.x0,t.y0),i=XE(e.x0,e.y0,t.x0,t.y0,t.x1,t.y1),a=XE(e.x1,e.y1,t.x0,t.y0,t.x1,t.y1);return n!==r&&i!==a}var QE=class{constructor(e){this.options=H({},this.options,e),this.createVisual()}createVisual(){this.visual=this.createElement()}exportVisual(){return this.visual}createElement(){let e=this.options.visual,t;return t=e?e({sender:this.getSender(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),t}getSender(){return this}},$E=class extends QE{getElement(){return F.fromRect(this.getRect(),this.visualOptions())}getRect(){let e=this.options.node;return new N([e.x0,e.y0],[e.x1-e.x0,e.y1-e.y0])}getLabelText(e){let t=e.labels.ariaTemplate;if(t)return t({node:e.node})}visualOptions(){let e=H({},this.options,this.options.node),t=this.getLabelText(e);return{fill:{color:e.color,opacity:e.opacity},stroke:{width:0},className:`k-sankey-node`,role:`graphics-symbol`,ariaRoleDescription:`Node`,ariaLabel:t}}createFocusHighlight(){if(this.options.navigatable)return this._highlight=F.fromRect(this.getRect(),{stroke:this.options.focusHighlight.border,visible:!1}),this._highlight}focus(e){if(this._highlight){let{highlight:t=!0}=e||{};t&&this._highlight.options.set(`visible`,!0);let n=this.options.node.id;this.visual.options.set(`id`,n),this.options.root()&&this.options.root().setAttribute(y,n)}}blur(){this._highlight&&(this._highlight.options.set(`visible`,!1),this.visual.options.set(`id`,``),this.options.root()&&this.options.root().removeAttribute(y))}};let eD=(e,t,n)=>e.color||t[n%t.length],tD=(e,t,n,r)=>{let i=H({},t,t.node);return H({},{color:eD(e,n,r)},i,{node:e},{visual:e.visual,opacity:e.opacity,offset:e.offset,color:e.color})},nD=(e,t,n,r,i)=>{let a=1-i,o=a*a,s=i*i;return e*o*a+3*t*i*o+3*n*s*a+r*s*i};function rD(e,t,n,r,i){let a=(e+n)/2,o=(t+r)/2,s,c;if(t===r)s=0,c=i/2;else if(e===n)s=i/2,c=0;else{let a=-1/((r-t)/(n-e));s=i/2/Math.sqrt(1+a*a),c=a*s}return{P1:{x:a-s,y:o-c},P2:{x:a+s,y:o+c}}}function iD(e,t,n,r,i){let a={x:(e.x+t.x)/2,y:(e.y+t.y)/2},o=t.x-e.x,s=-(t.y-e.y),c=o,l=Math.sqrt(s*s+c*c);s=s/l*n,c=c/l*n;let u={x:a.x+s,y:a.y+c},d={x:a.x-s,y:a.y-c},f=i.x-r.x,p=i.y-r.y,m=p*(u.x-d.x)-f*(u.y-d.y);if(Math.abs(m)<1e-10)return null;let h=(f*(d.y-r.y)-p*(d.x-r.x))/m,g=((u.x-d.x)*(d.y-r.y)-(u.y-d.y)*(d.x-r.x))/m;return h>=0&&h<=1&&g>=0&&g<=1?{x:d.x+h*(u.x-d.x)}:null}let aD=(e,t)=>{let n=e.width/2,r=t?e.x1:e.x0,i=t?e.x0:e.x1,a=t?e.y1:e.y0,o=t?e.y0:e.y1,s=(r+i)/2,c=[s,nD(a,a,o,o,.5)],l=.4999,u=[nD(r,s,s,i,l),nD(a,a,o,o,l)],d=rD(c[0],c[1],u[0],u[1],e.width),f=[s,nD(a+n,a+n,o+n,o+n,.5)],p=d.P1.y>d.P2.y?d.P1:d.P2,m=n,h=(a>o?1:-1)*m,g=iD(p,{x:f[0],y:f[1]},m,{x:f[0],y:f[1]},{x:Math.max(1,f[0]+h),y:f[1]})||{x:(f[0]+p.x)/2},_=r,v=i;return s-(g.x-.125*_-.125*v)/.75};var oD=class extends QE{getElement(){let{x0:e,x1:t,y0:n,y1:r}=this.options.link,i=(e+t)/2;return new F(this.visualOptions()).moveTo(e,n).curveTo([i,n],[i,r],[t,r])}getLabelText(e){let t=e.labels.ariaTemplate;if(t)return t({link:e.link})}visualOptions(){let e=this.options,t=this.options.link,n=this.getLabelText(e);return{stroke:{width:e.link.width,color:t.color||e.color,opacity:G(t.opacity)?t.opacity:e.opacity},role:`graphics-symbol`,ariaRoleDescription:`Link`,ariaLabel:n}}createFocusHighlight(){if(!this.options.navigatable)return;let{link:e}=this.options,{x0:t,x1:n,y0:r,y1:i}=e,a=(t+n)/2,o=e.width/2,s=aD(e,this.options.rtl);this._highlight=new F({stroke:this.options.focusHighlight.border,visible:!1}).moveTo(t,r+o).lineTo(t,r-o).curveTo([a+s,r-o],[a+s,i-o],[n,i-o]).lineTo(n,i+o).curveTo([a-s,i+o],[a-s,r+o],[t,r+o])}focus(e){if(this._highlight){let{highlight:t=!0}=e||{};t&&this._highlight.options.set(`visible`,!0);let n=`${this.options.link.sourceId}->${this.options.link.targetId}`;this.visual.options.set(`id`,n),this.options.root()&&this.options.root().setAttribute(y,n)}}blur(){this._highlight&&(this._highlight.options.set(`visible`,!1),this.visual.options.set(`id`,``),this.options.root()&&this.options.root().removeAttribute(y))}};let sD=(e,t,n,r)=>{let i=H({},t,{link:e,opacity:e.opacity,color:e.color,colorType:e.colorType,visual:e.visual,highlight:e.highlight});return i.colorType===`source`?i.color=n.options.fill.color:i.colorType===`target`&&(i.color=r.options.fill.color),i},cD=`inside`,lD=`before`,uD=`after`;var dD=class extends QE{getElement(){let e=H({},this.options,this.options.node.label),{node:t,diagramMinX:n,diagramMaxX:r,text:i,offset:a,rtl:o}=e,s=e.position;if(o&&s!==cD&&(s=s===lD?uD:lD),!e.visible||!i)return null;let c=new Z(t.x0,t.y0,t.x1,t.y1),l=this.visualOptions();o&&!l.align&&(l.align=`right`);let u=new em(i,l);u.reflow(new Z);let d=u.box,f=c.center().y-d.height()/2,p=t.x1+d.width()>r,m=t.x0-d.width()<n,h=s===lD||s===cD&&p?lD:uD;o&&(h=s===uD||s===cD&&m?uD:lD);let g=[h===lD?t.x0-d.width():t.x1,f],_=new Z(g[0],g[1],g[0]+d.width(),g[1]+d.height());return _.translate(a.left||0,a.top||0),u.reflow(_),u.renderVisual(),u.visual}visualOptions(){let e=H({},this.options,this.options.node.label);return{color:e.color,font:e.font,border:e.border,margin:e.margin,padding:e.padding,align:e.align,paintOrder:e.paintOrder,stroke:e.stroke}}};Y(dD,{position:cD});let fD=(e,t,n,r,i)=>H({},t,{node:e,diagramMinX:r,diagramMaxX:i,rtl:n,visual:e.label.visual,visible:e.label.visible,margin:e.label.margin,padding:e.label.padding,border:e.label.border,align:e.label.align,offset:e.label.offset});var pD=class extends QE{getElement(){let e=this.options,{drawingRect:t,text:n}=e;if(e.visible===!1||!n)return null;let r=tm.buildTitle(n,e);return r.reflow(t),r.renderVisual(),r.visual}createElement(){return this.getElement()}};Y(pD,{align:S,border:{width:0},margin:U(5),padding:U(5)});let mD=(e,t)=>e.node.x0-t.node.x0===0?e.node.y0-t.node.y0:e.node.x0-t.node.x0,hD=(e,t)=>e.node.x1-t.node.x1===0?t.node.y0-e.node.y0:e.node.x1-t.node.x1,gD=e=>e?hD:mD;var _D=class extends QE{getElement(){let e=this.options,{drawingRect:t,rtl:n,nodes:r=[],item:i,position:a}=e;if(e.visible===!1||!r.length)return null;let o=e.labels||{},s;o.content&&(s=Id(o));let c=r.map(e=>{let t=e.label&&e.label.text||``;return{text:s?s({text:t,node:e}):t,area:{background:i.areaBackground===void 0?e.color:i.areaBackground,opacity:i.areaOpacity===void 0?e.opacity:i.areaOpacity},node:e}});c.sort(gD(n));let l=new Iy(Object.assign({},e,{data:c,reverse:n&&a!==`left`&&a!==`right`}),{rtl:n});return l.reflow(t),l.renderVisual(),l.visual}createElement(){return this.getElement()}};Y(_D,{markers:{visible:!1},item:{type:rg,cursor:se,opacity:1},position:x,align:S,accessibility:{role:`presentation`,ariaLabel:null,ariaRoleDescription:null},border:{width:0}});let vD=`link`,yD=`node`,bD=e=>{let{nodes:t,links:n}=e,r=Math.min(...t.map(e=>e.x0)),i=Math.max(...t.map(e=>e.x1))-r;t.forEach(e=>{let t=i-(e.x1-2*r),n=i-(e.x0-2*r);e.x0=t,e.x1=n}),n.forEach(e=>{let t=i-(e.x1-2*r),n=i-(e.x0-2*r);e.x1=t,e.x0=n})};var xD=class extends op{constructor(e,t,n){super(),this._initTheme(n),this._setOptions(t),this._initElement(e),this._initSurface(),t&&t.data&&(this._redraw(),this._initResizeObserver(),this._initNavigation(e))}destroy(){this.unbind(),this._destroySurface(),this._destroyResizeObserver(),this.element&&(this.element.removeEventListener(`keydown`,this._keydownHandler),this.element.removeEventListener(`focus`,this._focusHandler),this.element.removeEventListener(`mousedown`,this._onDownHandler),this.element.removeEventListener(`touchstart`,this._onDownHandler),this.element.removeEventListener(`pointerdown`,this._onDownHandler)),this._focusState=null,this.element=null}_initElement(e){this.element=e,le(e,[`k-chart`,`k-sankey`]),e.setAttribute(`role`,`graphics-document`);let{title:t}=this.options;t.text&&e.setAttribute(`aria-label`,t.text),t.description&&e.setAttribute(`aria-roledescription`,t.description)}_initSurface(){this.surface||=(this._destroySurface(),this._initSurfaceElement(),this._createSurface())}_initNavigation(e){e.tabIndex=e.getAttribute(`tabindex`)||0,!this.options.disableKeyboardNavigation&&(this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._onDownHandler=this._onDown.bind(this),e.addEventListener(`keydown`,this._keydownHandler),e.addEventListener(`focus`,this._focusHandler),e.addEventListener(`blur`,this._blurHandler),e.addEventListener(`mousedown`,this._onDownHandler),e.addEventListener(`touchstart`,this._onDownHandler),e.addEventListener(`pointerdown`,this._onDownHandler),this._focusState={node:this.firstFocusableNode(),link:null})}firstFocusableNode(){return this.columns[0][0]}_initResizeObserver(){let e=new ResizeObserver(e=>{e.forEach(e=>{let{width:t,height:n}=e.contentRect;e.target!==this.element||this.size&&this.size.width===t&&this.size.height===n||(this.size={width:t,height:n},this.surface.setSize(this.size),this.resize=!0,this._redraw())})});this._resizeObserver=e,e.observe(this.element)}_createSurface(){return yo.create(this.surfaceElement,{mouseenter:this._mouseenter.bind(this),mouseleave:this._mouseleave.bind(this),mousemove:this._mousemove.bind(this),click:this._click.bind(this)})}_initTheme(e){let t=e||this.theme||{};this.theme=t,this.options=H({},t,this.options)}setLinksOpacity(e){this.linksVisuals.forEach(t=>{this.setOpacity(t,e,t.linkOptions.opacity)})}setLinksInactivityOpacity(e){this.linksVisuals.forEach(t=>{this.setOpacity(t,e,t.linkOptions.highlight.inactiveOpacity)})}setOpacity(e,t,n){e.options.set(`stroke`,Object.assign({},e.options.stroke,{opacity:G(n)?n:t}))}trigger(e,t){let n=t.element.dataItem,r=t.element.type,i=Object.assign({},t,{type:e,targetType:r,dataItem:n});return super.trigger(e,i)}_mouseenter(e){let t=e.element,n=t.type===vD,r=t.type===yD,i=!!(t.chartElement&&t.chartElement.options.node);if(n&&this.trigger(`linkEnter`,e)||r&&this.trigger(`nodeEnter`,e))return;let{highlight:a}=this.options.links;if(n)this.setLinksInactivityOpacity(a.inactiveOpacity),this.setOpacity(t,a.opacity,t.linkOptions.highlight.opacity);else if(r)this.highlightLinks(t,a);else if(i){let e=this.nodesVisuals.get(t.chartElement.options.node.id);this.highlightLinks(e,a)}}_mouseleave(e){let t=e.element,n=t.type===vD,r=t.type===yD,i=!!(t.chartElement&&t.chartElement.options.node),a=e.originalEvent.relatedTarget;n&&a&&a.nodeName===`text`||((n||r)&&(this.tooltipTimeOut&&=(clearTimeout(this.tooltipTimeOut),null),this.tooltipShown=!1,this.trigger(`tooltipHide`,e)),!(n&&this.trigger(`linkLeave`,e)||r&&this.trigger(`nodeLeave`,e))&&(n||r||i)&&this.linksVisuals.forEach(e=>{this.setOpacity(e,this.options.links.opacity,e.linkOptions.opacity)}))}_mousemove(e){let{followPointer:t,delay:n}=this.options.tooltip,r=e.element,i=r.type;if(i!==vD&&i!==yD||this.tooltipShown&&!t)return;let a=e.originalEvent,o=this.element.getBoundingClientRect(),s=a.clientX-o.left<o.width/2,c=a.clientY-o.top<o.height/2;if(e.tooltipData={popupOffset:{left:a.pageX,top:a.pageY},popupAlign:{horizontal:s?`left`:`right`,vertical:c?`top`:`bottom`}},i===yD){let{sourceLinks:t,targetLinks:n}=r.dataItem;e.nodeValue=(n.length?n:t).reduce((e,t)=>e+t.value,0)}this.tooltipTimeOut&&=(clearTimeout(this.tooltipTimeOut),null);let l=t&&this.tooltipShown?0:n;this.tooltipTimeOut=setTimeout(()=>{this.trigger(`tooltipShow`,e),this.tooltipShown=!0,this.tooltipTimeOut=null},l)}_click(e){let t=e.element,n=t.dataItem,r=t.type===vD,i=t.type===yD,a=this._focusState||{};if(i)!a.link&&this.sameNode(a.node,n)||(this._focusState={node:n,link:null},this._focusNode({highlight:!1})),this.trigger(`nodeClick`,e);else if(r){let t={sourceId:n.source.id,targetId:n.target.id,value:n.value};this.sameLink(a.link,t)||(this._focusState={node:n.source,link:t},this._focusLink({highlight:!1})),this.trigger(`linkClick`,e)}}sameNode(e,t){return e&&t&&e.id===t.id}sameLink(e,t){return e&&t&&e.sourceId===t.sourceId&&e.targetId===t.targetId}_focusNode(e){this._cleanFocusHighlight();let t=this._focusState.node;this.models.map.get(t.id).focus(e)}_focusLink(e){this._cleanFocusHighlight();let t=this._focusState.link;this.models.map.get(`${t.sourceId}-${t.targetId}`).focus(e)}_focusNextNode(e=1){let t=this._focusState.node,n=this.columns.findIndex(e=>e.find(e=>e.id===t.id)),r=this.columns[n],i=r[r.findIndex(e=>e.id===t.id)+e];i&&(this._focusState.node=i,this._focusNode())}_focusNextLink(e=1){let t=this._focusState.node,n=this._focusState.link,r=t.sourceLinks.findIndex(e=>e.sourceId===n.sourceId&&e.targetId===n.targetId),i=t.targetLinks.findIndex(e=>e.sourceId===n.sourceId&&e.targetId===n.targetId);if(r!==-1){let n=t.sourceLinks[r+e];n&&(this._focusState.link=n,this._focusLink())}else if(i!==-1){let n=t.targetLinks[i+e];n&&(this._focusState.link=n,this._focusLink())}}_focusSourceNode(){let e=this._focusState.link,t=this.models.map.get(e.sourceId);this._focusState={node:t.options.node,link:null},this._focusNode()}_focusTargetNode(){let e=this._focusState.link,t=this.models.map.get(e.targetId);this._focusState={node:t.options.node,link:null},this._focusNode()}_focusSourceLink(){let e=this._focusState.node.sourceLinks[0];e&&(this._focusState.link=e,this._focusLink())}_focusTargetLink(){let e=this._focusState.node.targetLinks[0];e&&(this._focusState.link=e,this._focusLink())}_focus(){this._skipFocusHighlight||(this._focusState.link?this._focusLink():this._focusNode()),this._skipFocusHighlight=!1}_blur(){this._cleanFocusHighlight()}_onDown(){this._hasFocus()||(this._skipFocusHighlight=!0)}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_cleanFocusHighlight(){this.models.nodes.forEach(e=>e.blur()),this.models.links.forEach(e=>e.blur())}_keydown(e){let t=this[`on`+e.key],n=this.options.rtl;n&&e.key===`ArrowLeft`?t=this.onArrowRight:n&&e.key===`ArrowRight`&&(t=this.onArrowLeft),t&&t.call(this,e)}onEscape(e){e.preventDefault(),this._focusState={node:this.firstFocusableNode(),link:null},this._focusNode()}onArrowDown(e){e.preventDefault(),this._focusState.link?this._focusNextLink(1):this._focusNextNode(1)}onArrowUp(e){e.preventDefault(),this._focusState.link?this._focusNextLink(-1):this._focusNextNode(-1)}onArrowLeft(e){e.preventDefault(),this._focusState.link?this._focusSourceNode():this._focusTargetLink()}onArrowRight(e){e.preventDefault(),this._focusState.link?this._focusTargetNode():this._focusSourceLink()}highlightLinks(e,t){e&&(this.setLinksInactivityOpacity(t.inactiveOpacity),e.links.forEach(e=>{this.setOpacity(e,t.opacity,e.linkOptions.highlight.opacity)}))}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_destroyResizeObserver(){this._resizeObserver&&=(this._resizeObserver.disconnect(),null)}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement(`div`),this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(e,t){this._setOptions(e),this._initTheme(t),this._initSurface(),this._redraw()}_redraw(){this.surface.clear();let{width:e,height:t}=this._getSize();this.size={width:e,height:t},this.surface.setSize(this.size),this.createVisual(),this.surface.draw(this.visual)}_getSize(){return this.element.getBoundingClientRect()}createVisual(){this.visual=this._render()}titleBox(e,t){return!e||e.visible===!1||!e.text?null:new pD(Object.assign({},{drawingRect:t},e)).exportVisual().chartElement.box}legendBox(e,t,n){return!e||e.visible===!1?null:new _D(Object.assign({},{nodes:t},e,{drawingRect:n})).exportVisual().chartElement.box}calculateSankey(e,t){let{title:n,legend:r,data:i,nodes:a,labels:o,nodeColors:s,disableAutoLayout:c,disableKeyboardNavigation:l,rtl:u}=t,d=!c,f=((a.focusHighlight||{}).border||{}).width||0,p=l?0:f/2,m=new Z(0,0,e.width,e.height);m.unpad(p);let h=this.titleBox(n,m),g=m.clone();if(h){let t=h.height();n.position===`top`?(m.unpad({top:t}),g=new Z(0,t,e.width,e.height)):(m.shrink(0,t),g=new Z(0,0,e.width,e.height-t))}let _=this.legendBox(r,i.nodes,g),v=r&&r.position||_D.prototype.options.position;_&&(v===`left`&&m.unpad({left:_.width()}),v===`right`&&m.shrink(_.width(),0),v===`top`&&m.unpad({top:_.height()}),v===`bottom`&&m.shrink(0,_.height()));let{nodes:y,circularLinks:b}=JE(Object.assign({},e,{offsetX:0,offsetY:0,width:m.width(),height:m.height()}));if(b)return console.warn(`Circular links detected. Kendo Sankey diagram does not support circular links.`),{sankey:{nodes:[],links:[],columns:[[]],circularLinks:b},legendBox:_,titleBox:h};let x=new Z,S=y.reduce((e,t)=>Math.min(e,t.x0),1/0),C=y.reduce((e,t)=>Math.max(e,t.x1),0);y.forEach((e,t)=>{if(u){let{x0:t,x1:n}=e;e.x0=C-n,e.x1=C-t}let n=new $E(tD(e,a,s,t));x.wrap(Qp(n.exportVisual().rawBBox()));let r=new dD(fD(e,o,u,S,C)).exportVisual();r&&x.wrap(Qp(r.rawBBox()))});let w=m.x1,ee=m.y1,T=m.width()+w,te=m.height()+ee;if(T-=x.x2>m.width()?x.x2-m.width():0,te-=x.y2>m.height()?x.y2-m.height():0,w+=x.x1<0?-x.x1:0,ee+=x.y1<0?-x.y1:0,d===!1)return{sankey:JE(Object.assign({},e,{offsetX:w,offsetY:ee,width:T,height:te,autoLayout:!1})),legendBox:_,titleBox:h};if(this.resize&&d&&this.permutation)return this.resize=!1,{sankey:JE(Object.assign({},e,{offsetX:w,offsetY:ee,width:T,height:te},this.permutation)),legendBox:_,titleBox:h};let E=JE(Object.assign({},e,{offsetX:w,offsetY:ee,width:T,height:te,autoLayout:!1})).columns.length,D=[],ne=(t,n)=>{let r=JE(Object.assign({},e,{offsetX:w,offsetY:ee,width:T,height:te,loops:2,targetColumnIndex:t,reverse:n})),i=YE(r.links);return D.push({crosses:i,reverse:n,targetColumnIndex:t}),i===0};for(let e=1;e<=E-1&&!(ne(e,!1)||ne(e,!0));e++);let re=Math.min.apply(null,D.map(e=>e.crosses)),ie=D.find(e=>e.crosses===re);return this.permutation={targetColumnIndex:ie.targetColumnIndex,reverse:ie.reverse},{sankey:JE(Object.assign({},e,{offsetX:w,offsetY:ee,width:T,height:te},this.permutation)),legendBox:_,titleBox:h}}_render(e,t){let n=e||this.options,r=t||this,{labels:i,nodes:a,links:o,nodeColors:s,title:c,legend:l,rtl:u,disableKeyboardNavigation:d}=n,f=n.data,{width:p,height:m}=r.size,h=Object.assign({},f,{width:p,height:m,nodesOptions:a,title:c,legend:l}),{sankey:g,titleBox:_,legendBox:v}=this.calculateSankey(h,n);u&&bD(g);let{nodes:y,links:b,columns:x}=g;r.columns=x.map(e=>{let t=e.slice();return t.sort((e,t)=>e.y0-t.y0),t});let S=new I({clip:F.fromRect(new N([0,0],[p,m]))});if(_){let e=new pD(Object.assign({},c,{drawingRect:_})).exportVisual();S.append(e)}if(g.circularLinks)return S;let C=new Map;r.nodesVisuals=C;let w={nodes:[],links:[],map:new Map};r.models=w;let ee=[];y.forEach((e,t)=>{let n=tD(e,a,s,t);n.root=()=>r.element,n.navigatable=d!==!0;let i=new $E(n),o=i.exportVisual();o.links=[],o.type=yD,e.color=n.color,e.opacity=n.opacity,o.dataItem=Object.assign({},f.nodes[t],{color:n.color,opacity:n.opacity,sourceLinks:e.sourceLinks.map(e=>({sourceId:e.sourceId,targetId:e.targetId,value:e.value})),targetLinks:e.targetLinks.map(e=>({sourceId:e.sourceId,targetId:e.targetId,value:e.value}))}),C.set(e.id,o),w.nodes.push(i),w.map.set(e.id,i),S.append(o),i.createFocusHighlight(),i._highlight&&ee.push(i._highlight)});let T=b.slice().sort((e,t)=>t.value-e.value),te=[];r.linksVisuals=te,T.forEach(e=>{let{source:t,target:n}=e,i=C.get(t.id),a=C.get(n.id),s=sD(e,o,i,a);s.root=()=>r.element,s.navigatable=d!==!0,s.rtl=u;let c=new oD(s),l=c.exportVisual();l.type=vD,l.dataItem={source:Object.assign({},i.dataItem),target:Object.assign({},a.dataItem),value:e.value},l.linkOptions=s,te.push(l),i.links.push(l),a.links.push(l),w.links.push(c),w.map.set(`${t.id}-${n.id}`,c),c.createFocusHighlight(),c._highlight&&ee.push(c._highlight),S.append(l)});let E=y.reduce((e,t)=>Math.min(e,t.x0),1/0),D=y.reduce((e,t)=>Math.max(e,t.x1),0);if(y.forEach(e=>{let t=new dD(fD(e,i,u,E,D)).exportVisual();t&&S.append(t)}),v){let e=new _D(Object.assign({},l,{rtl:u,drawingRect:v,nodes:y})).exportVisual();S.append(e)}if(ee.length!==0){let e=new I;e.append(...ee),S.append(e)}return S}exportVisual(e){let t=e&&e.options?H({},this.options,e.options):this.options,n={size:{width:G(e&&e.width)?e.width:this.size.width,height:G(e&&e.height)?e.height:this.size.height}};return this._render(t,n)}_setOptions(e){this.options=H({},this.options,e)}};let SD={opacity:1,width:2,color:b};Y(xD,{title:{position:`top`},labels:{visible:!0,margin:{left:8,right:8},padding:0,border:{width:0},paintOrder:`stroke`,stroke:{lineJoin:`round`,width:1},offset:{left:0,top:0}},nodes:{width:24,padding:16,opacity:1,align:`stretch`,offset:{left:0,top:0},focusHighlight:{border:Object.assign({},SD)},labels:{ariaTemplate:({node:e})=>e.label.text}},links:{colorType:`static`,opacity:.4,highlight:{opacity:.8,inactiveOpacity:.2},focusHighlight:{border:Object.assign({},SD)},labels:{ariaTemplate:({link:e})=>`${e.source.label.text} to ${e.target.label.text}`}},tooltip:{followPointer:!1,delay:200}});function CD(e){let t=[];return e.forEach(e=>{let{dataItem:n,dataColumns:r}=e,i=[];r.forEach(e=>{i.push({field:e.title||e.field,value:Bd(e.field)(n)})}),t.push(i)}),t}let $=Object.freeze({seriesType:0,stacked:1,categoryAxisX:2,valueAxisY:3,seriesChange:4,areaMarginLeft:5,areaMarginRight:6,areaMarginTop:7,areaMarginBottom:8,areaBackground:9,titleText:10,titleFontName:11,titleFontSize:12,titleColor:13,subtitleText:14,subtitleFontName:15,subtitleFontSize:16,subtitleColor:17,seriesColor:18,seriesLabel:19,legendVisible:20,legendFontName:21,legendFontSize:22,legendColor:23,legendPosition:24,categoryAxisTitleText:25,categoryAxisTitleFontName:26,categoryAxisTitleFontSize:27,categoryAxisTitleColor:28,categoryAxisLabelsFontName:29,categoryAxisLabelsFontSize:30,categoryAxisLabelsColor:31,categoryAxisLabelsRotation:32,categoryAxisReverseOrder:33,valueAxisTitleText:34,valueAxisTitleFontName:35,valueAxisTitleFontSize:36,valueAxisTitleColor:37,valueAxisLabelsFormat:38,valueAxisLabelsFontName:39,valueAxisLabelsFontSize:40,valueAxisLabelsColor:41,valueAxisLabelsRotation:42}),wD=[{text:`10`,value:`10px`},{text:`12`,value:`12px`},{text:`14`,value:`14px`},{text:`16`,value:`16px`},{text:`20`,value:`20px`},{text:`28`,value:`28px`},{text:`42`,value:`42px`},{text:`56`,value:`56px`}],TD=`12px`,ED=`16px`,DD=[{text:`Arial`,value:`Arial, Helvetica, sans-serif`,style:{fontFamily:`Arial, Helvetica, sans-serif`}},{text:`Courier New`,value:`'Courier New', Courier, monospace`,style:{fontFamily:`'Courier New', Courier, monospace`}},{text:`Georgia`,value:`Georgia, serif`,style:{fontFamily:`Georgia, serif`}},{text:`Impact`,value:`Impact, Charcoal, sans-serif`,style:{fontFamily:`Impact, Charcoal, sans-serif`}},{text:`Lucida Console`,value:`'Lucida Console', Monaco, monospace`,style:{fontFamily:`'Lucida Console', Monaco, monospace`}},{text:`Tahoma`,value:`Tahoma, Geneva, sans-serif`,style:{fontFamily:`Tahoma, Geneva, sans-serif`}},{text:`Times New Roman`,value:`'Times New Roman', Times,serif`,style:{fontFamily:`'Times New Roman', Times,serif`}},{text:`Trebuchet MS`,value:`'Trebuchet MS', Helvetica, sans-serif`,style:{fontFamily:`'Trebuchet MS', Helvetica, sans-serif`}},{text:`Verdana`,value:`Verdana, Geneva, sans-serif`,style:{fontFamily:`Verdana, Geneva, sans-serif`}}],OD=DD[0].value,kD=`line`,AD=`scatter`,jD=[`column`,`bar`,kD,AD],MD={type:kD,width:0};function ND(e){return e&&jD.includes(e)}let PD=[`string`,`date`,`number`],FD=[`number`],ID={bar:[{axisType:`category`,types:PD},{axisType:`value`,types:FD}],column:[{axisType:`category`,types:PD},{axisType:`value`,types:FD}],line:[{axisType:`category`,types:PD},{axisType:`value`,types:FD}],pie:[{axisType:`category`,types:PD},{axisType:`value`,types:FD,count:1}],scatter:[{axisType:`category`,types:PD},{axisType:`value`,types:FD}]};function LD(e,t){return`${t||``} ${e||``}`.trim()}function RD(e){let t=(e||``).indexOf(` `);return{size:e&&e.substring(0,t),name:e&&e.substring(t+1)}}let zD=(e,t,n)=>{let{size:r}=RD(n);return e?LD(e,r||t):``},BD=(e,t,n)=>{let{name:r}=RD(n);return e?LD(r||t,e):``},VD=e=>e!=null,HD=e=>{let t=structuredClone(e[0]);return t.forEach((t,n)=>{if(!VD(t.value))for(let r=0;r<e.length;r++){let i=e[r][n].value;if(VD(i)){t.value=i;break}}}),t},UD=(e,t)=>{let n=[],r=HD(e);t.types.forEach(e=>{r.forEach((t,r)=>{typeof t.value===e&&n.push(r)})});let i=n.findIndex(t=>{let n=e.map(e=>e[t].value);return new Set(n).size===n.length});return Math.max(i,0)},WD=(e,t)=>{let n=[],r=HD(e);return t.forEach(e=>{e.types.forEach(e=>{r.forEach((t,r)=>{typeof t.value===e&&n.push(r)})})}),n},GD=()=>structuredClone({columns:[],data:[],series:[],initialSeries:[],categoryAxis:[{categories:[],labels:{visible:!0,rotation:`auto`},title:{text:``}}],valueAxis:[{labels:{visible:!0,rotation:`auto`}}],area:{margin:{left:void 0,right:void 0,top:void 0,bottom:void 0}},title:{text:``},subtitle:{text:``},stack:!1}),KD=(e,t,n)=>{let r=GD();r.seriesType=t,r.data=e||[],r.legend={visible:!0,position:`bottom`};let i=ID[t];if(!i||!e.length)return r;let a=e[0].slice();r.columns=e[0].map(e=>String(e.field));let o=i.find(e=>e.axisType===`category`),s=-1;o&&(s=n&&n.categoryAxis?r.columns.indexOf(n.categoryAxis):UD(e,o));let c=i.filter(e=>e.axisType===`value`),l=WD(e,c);l.includes(s)&&(l.length>1?l=l.filter(e=>e!==s):s=-1);let u=[];l.forEach(n=>{let r=a[n],i=[];e.forEach(e=>{i.push(e[n].value)}),u.push(Object.assign({},{name:r.field,type:t,data:i,stack:!1,labels:{visible:!1}},t===AD?MD:{}))});let d=s>-1?e.map(e=>String(VD(e[s].value)?e[s].value:` `)):[];return u.length&&(r.series=u.map((e,t)=>Object.assign({},e,{id:t})),r.initialSeries=structuredClone(r.series)),r.categoryAxis=[{categories:d,labels:{visible:!0,rotation:`auto`}}],r.categoryField=r.columns[s],r},qD=(e,t,n)=>{let r=GD();r.seriesType=t,r.data=e||[];let i=ID[t];if(!i||!e.length)return r;let a=e[0].map(e=>e.field),o=i.find(e=>e.axisType===`category`),s=-1;o&&(s=n&&n.categoryAxis?a.indexOf(n.categoryAxis):UD(e,o));let c=i.filter(e=>e.axisType===`value`),l=[];l=n&&n.valueAxis?[a.indexOf(n.valueAxis)]:WD(e,c),l.includes(s)&&l.length>1&&(l=l.filter(e=>e!==s)),typeof c[0].count==`number`&&(l=l.slice(0,c[0].count));let u=s>-1?e.map(e=>String(e[s].value)):[],d=[];return e.forEach(e=>{let t={};l.forEach(n=>{let r=e[n];t[r.field]=r.value||0,t[e[s].field]=e[s].value||` `}),d.push(t)}),r.columns=a,r.categoryAxis=[{categories:u,title:{text:``}}],r.series=[{id:0,data:d,type:t,name:a[s],labels:{visible:!0},categoryField:a[s],field:a[l[0]]}],r.categoryField=a[s],r.valueField=a[l[0]],r.initialSeries=structuredClone(r.series),r};function JD(e,t,n){let r=YD(e,n&&n.seriesType||t);return(n&&n.stack)===void 0?r:QD(r,$.stacked,n.stack)}function YD(e,t){return(ND(t)?KD:qD)(e,t)}function XD(e,t){if(e.stack!==void 0){t.stack=e.stack;for(let n=0;n<t.series.length;n++)t.series[n].stack=e.stack}}function ZD(e,t){let n=structuredClone(t);if(n.legend=e.legend,n.area=e.area,n.title=e.title,n.subtitle=e.subtitle,n.series.length===e.series.length)for(let t=0;t<n.series.length;t++)n.series[t].color=e.series[t].color,n.series[t].labels=e.series[t].labels;return e.series.every(e=>e.labels&&e.labels.visible)&&ND(n.seriesType)&&ND(e.seriesType)&&n.series.forEach(e=>{e.labels=e.labels||{},e.labels.visible=!0}),n}function QD(e,t,n){let r=Object.assign({},e);switch(t){case $.seriesType:return YD(r.data,n);case $.stacked:return r.series=r.series.map(e=>Object.assign({},e,{stack:n})),r.stack=n,r;case $.categoryAxisX:if(r.seriesType&&ND(r.seriesType)){let e=KD(r.data,r.seriesType,{categoryAxis:n});return XD(r,e),ZD(r,e)}else if(r.seriesType===`pie`)return ZD(r,qD(r.data,r.seriesType,{categoryAxis:n}));return r;case $.valueAxisY:return r.seriesType===`pie`?ZD(r,qD(r.data,r.seriesType,{categoryAxis:r.categoryField,valueAxis:n})):r;case $.seriesChange:return r.series=n,r;case $.areaMarginLeft:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{left:n})}),r;case $.areaMarginRight:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{right:n})}),r;case $.areaMarginTop:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{top:n})}),r;case $.areaMarginBottom:return r.area=Object.assign({},r.area,{margin:Object.assign({},r.area&&r.area.margin||{},{bottom:n})}),r;case $.areaBackground:return r.area=Object.assign({},r.area,{background:n}),r;case $.titleText:return r.title=Object.assign({},r.title,{text:n}),r;case $.titleFontName:return r.title=Object.assign({},r.title,{font:zD(n,`20px`,r.title&&r.title.font)}),r;case $.titleFontSize:return r.title=Object.assign({},r.title,{font:BD(n,OD,r.title&&r.title.font)}),r;case $.titleColor:return r.title=Object.assign({},r.title,{color:n}),r;case $.subtitleText:return r.subtitle=Object.assign({},r.subtitle,{text:n}),r;case $.subtitleFontName:return r.subtitle=Object.assign({},r.subtitle,{font:zD(n,`16px`,r.subtitle&&r.subtitle.font)}),r;case $.subtitleFontSize:return r.subtitle=Object.assign({},r.subtitle,{font:BD(n,OD,r.subtitle&&r.subtitle.font)}),r;case $.subtitleColor:return r.subtitle=Object.assign({},r.subtitle,{color:n}),r;case $.seriesColor:return r.series=r.series.map(e=>Object.assign({},e,{color:n.seriesName===e.name?n.color:e.color})),r;case $.seriesLabel:return r.series=r.series.map(e=>n.all||n.seriesName===e.name?Object.assign({},e,{labels:{visible:n.visible}}):e),r;case $.legendVisible:return r.legend=Object.assign({},r.legend,{visible:n}),r;case $.legendFontName:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{font:zD(n,TD,e.labels&&e.labels.font)})}),r}case $.legendFontSize:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{font:BD(n,OD,e.labels&&e.labels.font)})}),r}case $.legendColor:{let e=r.legend||{};return r.legend=Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})}),r}case $.legendPosition:return r.legend=Object.assign({},r.legend,{position:n}),r;case $.categoryAxisTitleText:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{text:n})})),r;case $.categoryAxisTitleFontName:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:zD(n,ED,e.title&&e.title.font)})})),r;case $.categoryAxisTitleFontSize:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:BD(n,OD,e.title&&e.title.font)})})),r;case $.categoryAxisTitleColor:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{color:n})})),r;case $.categoryAxisLabelsFontName:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:zD(n,TD,e.labels&&e.labels.font)})})),r;case $.categoryAxisLabelsFontSize:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:BD(n,OD,e.labels&&e.labels.font)})})),r;case $.categoryAxisLabelsColor:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})})),r;case $.categoryAxisLabelsRotation:{let e=VD(n)?n:`auto`;return r.categoryAxis=(r.categoryAxis||[]).map(t=>Object.assign({},t,{labels:Object.assign({},t.labels,{rotation:e})})),r}case $.categoryAxisReverseOrder:return r.categoryAxis=(r.categoryAxis||[]).map(e=>Object.assign({},e,{reverse:n})),r;case $.valueAxisTitleText:return!r.valueAxis||r.valueAxis.length===0?r.valueAxis=[{title:{text:n}}]:r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{text:n})})),r;case $.valueAxisTitleFontName:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:zD(n,ED,e.title&&e.title.font)})})),r;case $.valueAxisTitleFontSize:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{font:BD(n,OD,e.title&&e.title.font)})})),r;case $.valueAxisTitleColor:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{title:Object.assign({},e.title,{color:n})})),r;case $.valueAxisLabelsFormat:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{format:n})})),r;case $.valueAxisLabelsFontName:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:zD(n,TD,e.labels&&e.labels.font)})})),r;case $.valueAxisLabelsFontSize:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{font:BD(n,OD,e.labels&&e.labels.font)})})),r;case $.valueAxisLabelsColor:return r.valueAxis=(r.valueAxis||[]).map(e=>Object.assign({},e,{labels:Object.assign({},e.labels,{color:n})})),r;case $.valueAxisLabelsRotation:{let e=VD(n)?n:`auto`;return r.valueAxis=(r.valueAxis||[]).map(t=>Object.assign({},t,{labels:Object.assign({},t.labels,{rotation:e})})),r}default:return r}}let $D=Object.freeze({windowTitle:`Chart Preview`,exportButton:`Export`,exportPDFButton:`PDF File`,exportSVGButton:`SVG File`,exportPNGButton:`PNG File`,tabChart:`Chart`,tabData:`Data`,tabFormat:`Format`,barChart:`Bar Chart`,barChartBar:`Bar`,barChartStackedBar:`Stacked Bar`,barChart100StackedBar:`100% Stacked Bar`,pieChart:`Pie Chart`,pieChartPie:`Pie`,columnChart:`Column Chart`,columnChartColumn:`Column`,columnChartStackedColumn:`Stacked Column`,columnChart100StackedColumn:`100% Stacked Column`,lineChart:`Line Chart`,lineChartLine:`Line`,lineChartStackedLine:`Stacked Line`,lineChart100StackedLine:`100% Stacked Line`,scatterChart:`Scatter Chart`,scatterChartScatter:`Scatter`,configuration:`Configuration`,configurationCategoryAxis:`Category Axis`,configurationXAxis:`X Axis`,configurationValueAxis:`Value Axis`,configurationSeries:`Series`,configurationSeriesAdd:`Add`,formatChartArea:`Chart Area`,formatChartAreaMargins:`Margins`,formatChartAreaMarginsAuto:`Auto`,formatChartAreaMarginsLeft:`Left`,formatChartAreaMarginsRight:`Right`,formatChartAreaMarginsTop:`Top`,formatChartAreaMarginsBottom:`Bottom`,formatChartAreaBackground:`Background`,formatChartAreaBackgroundColor:`Color`,formatTitle:`Title`,formatTitleApplyTo:`Apply to`,formatTitleChartTitle:`Chart Title`,formatTitleChartSubtitle:`Chart Subtitle`,formatTitleLabel:`Title`,formatTitleFont:`Font`,formatTitleFontPlaceholder:`(inherited font)`,formatTitleSize:`Size`,formatTitleSizePlaceholder:`px`,formatTitleColor:`Color`,formatSeries:`Series`,formatSeriesApplyTo:`Apply to`,formatSeriesAllSeries:`All Series`,formatSeriesColor:`Color`,formatSeriesShowLabels:`Show Labels`,formatLegend:`Legend`,formatLegendShowLegend:`Show Legend`,formatLegendFont:`Font`,formatLegendFontPlaceholder:`(inherited font)`,formatLegendSize:`Size`,formatLegendSizePlaceholder:`px`,formatLegendColor:`Color`,formatLegendPosition:`Position`,formatLegendPositionTop:`Top`,formatLegendPositionBottom:`Bottom`,formatLegendPositionLeft:`Left`,formatLegendPositionRight:`Right`,formatCategoryAxis:`Category Axis`,formatXAxis:`X Axis`,formatCategoryAxisTitle:`Title`,formatCategoryAxisTitlePlaceholder:`Axis Title`,formatCategoryAxisTitleFont:`Font`,formatCategoryAxisTitleFontPlaceholder:`(inherited font)`,formatCategoryAxisTitleSize:`Size`,formatCategoryAxisTitleSizePlaceholder:`px`,formatCategoryAxisTitleColor:`Color`,formatCategoryAxisLabels:`Labels`,formatCategoryAxisLabelsFont:`Font`,formatCategoryAxisLabelsFontPlaceholder:`(inherited font)`,formatCategoryAxisLabelsSize:`Size`,formatCategoryAxisLabelsSizePlaceholder:`px`,formatCategoryAxisLabelsColor:`Color`,formatCategoryAxisLabelsRotation:`Rotation`,formatCategoryAxisLabelsRotationAuto:`Auto`,formatCategoryAxisLabelsReverseOrder:`Reverse Order`,formatValueAxis:`Value Axis`,formatYAxis:`Y Axis`,formatValueAxisTitle:`Title`,formatValueAxisTitlePlaceholder:`Axis Title`,formatValueAxisTitleFont:`Font`,formatValueAxisTitleFontPlaceholder:`(inherited font)`,formatValueAxisTitleSize:`Size`,formatValueAxisTitleSizePlaceholder:`px`,formatValueAxisTitleColor:`Color`,formatValueAxisLabels:`Labels`,formatValueAxisLabelsFormat:`Label Format`,formatValueAxisLabelsFormatText:`Text`,formatValueAxisLabelsFormatNumber:`Number`,formatValueAxisLabelsFormatCurrency:`Currency`,formatValueAxisLabelsFormatPercent:`Percent`,formatValueAxisLabelsFont:`Font`,formatValueAxisLabelsFontPlaceholder:`(inherited font)`,formatValueAxisLabelsSize:`Size`,formatValueAxisLabelsSizePlaceholder:`px`,formatValueAxisLabelsColor:`Color`,formatValueAxisLabelsRotation:`Rotation`,formatValueAxisLabelsRotationAuto:`Auto`}),eO=Object.freeze({getWizardDataFromDataRows:CD,ActionTypes:$,createInitialState:JD,createState:YD,fontNames:DD,fontSizes:wD,isCategorical:ND,mergeStates:ZD,parseFont:RD,updateState:QD,messages:$D});Object.assign({},{type:rg},{markers:{visible:!1},highlight:{visible:!1}});let tO={id:`chartwizard`,name:`ChartWizard`,category:`web`,description:`The ChartWizard allows configuration and visual representation of various charts`,depends:[`core`,`icons`,`html.icon`,`grid`,`expansionpanel`,`window`,`form`,`tabstrip`,`dataviz.chart`,`splitter`,`dropdownbutton`,`colorpicker`]};(function(e){let t=window.kendo,n=t.ui.Widget,r=t.data.DataSource,i=t.keys,a=eO.fontSizes,o=eO.fontNames,s=eO.isCategorical,c=eO.updateState,l=eO.mergeStates,u=eO.ActionTypes,d=eO.getWizardDataFromDataRows,f=`.kendoChartWizard`,p=t.ui,m=e.extend,h=t.deepExtend,g=`resizing`,_=`resize`,v=`maximize`,y=`restore`,b=`open`,x=`close`,S=`activate`,C=`change`,w=`dataBinding`,ee=`dataBound`,T=`exportPDF`,te=`exportSVG`,E=`exportImage`,D=`ref*=`,ne=`data-action`,re=`[data-action]`,ie=`data-role`,O=`data-role=`,ae=`data-chart-type`,k=`k-selected`,oe=`outline`,se=`flat`,ce=/(?=[A-Z])/,A={chartWizard:`k-chart-wizard`,previewPane:`k-chart-wizard-preview-pane`,previewPaneHeader:`k-preview-pane-header`,previewPaneContent:`k-preview-pane-content`,propertyPane:`k-chart-wizard-property-pane`,splitter:`k-chart-wizard-splitter`,expansionPanelWrapper:`k-expander`,cols2gap4:`k-grid-cols-2 k-gap-x-4`,colSpan2:`k-col-span-2`},j={numericTextBox:`numerictextbox`,colorPicker:`colorpicker`,textBox:`textbox`,comboBox:`combobox`,checkBox:`checkbox`,dropDownList:`dropdownlist`,switch:`switch`},le={icon:`export`,fillMode:se,items:[{id:`export-pdf`,icon:`file-pdf`},{id:`export-svg`,icon:`file`},{id:`export-png`,icon:`file-image`}]},ue={bar:{content:{bar:`chart-bar-clustered`,stackedBar:`chart-bar-stacked`,hundredStackedBar:`chart-bar-stacked100`}},pie:{content:{pie:`chart-pie`}},column:{content:{column:`chart-column-clustered`,stackedColumn:`chart-column-stacked`,hundredStackedColumn:`chart-column-stacked100`}},line:{content:{line:`chart-line`,stackedLine:`chart-line-stacked`,hundredStackedLine:`chart-line-stacked100`}},scatter:{content:{scatter:`chart-scatter`}}},de=e=>[{legend:e.configuration.categoryAxis,editors:{id:`category-axis`,role:j.dropDownList,action:`categoryAxisX`}},{legend:e.configuration.valueAxis,editors:{id:`value-axis`,role:j.dropDownList,action:`valueAxisY`}},{legend:e.configuration.series.title,editors:{custom:`<div class="k-grid" ${ne}="seriesChange"></div>`}}],fe=e=>[{legend:e.chartArea.margins.default,layoutClass:A.cols2gap4,editors:[{label:{text:e.chartArea.margins.left,for:`left`},field:{id:`left`,role:j.numericTextBox,placeholder:e.chartArea.margins.auto,action:`areaMarginLeft`}},{label:{text:e.chartArea.margins.right,for:`right`},field:{id:`right`,role:j.numericTextBox,placeholder:e.chartArea.margins.auto,action:`areaMarginRight`}},{label:{text:e.chartArea.margins.top,for:`top`},field:{id:`top`,role:j.numericTextBox,placeholder:e.chartArea.margins.auto,action:`areaMarginTop`}},{label:{text:e.chartArea.margins.bottom,for:`bottom`},field:{id:`bottom`,role:j.numericTextBox,placeholder:e.chartArea.margins.auto,action:`areaMarginBottom`}}]},{legend:e.chartArea.background.default,editors:[{label:{text:e.chartArea.background.color,for:`background`},field:{id:`background`,role:j.colorPicker,action:`areaBackground`}}]}],pe=e=>[{layoutClass:A.cols2gap4,editors:[{label:{text:e.title.applyTo,for:`apply-to-title`},field:{id:`apply-to-title`,role:j.dropDownList,action:`activateTitle`},className:A.colSpan2},{label:{text:e.title.label,for:`title-text`},field:{id:`title-text`,role:j.textBox,action:`titleText`},className:A.colSpan2},{label:{text:e.title.font,for:`title-font`},field:{id:`title-font`,role:j.comboBox,placeholder:e.title.fontPlaceholder,action:`titleFontName`},className:A.colSpan2},{label:{text:e.title.size,for:`title-size`},field:{id:`title-size`,role:j.comboBox,placeholder:e.title.sizePlaceholder,action:`titleFontSize`}},{label:{text:e.title.color,for:`title-color`},field:{id:`title-color`,role:j.colorPicker,action:`titleColor`}}]}],me=e=>[{editors:[{label:{text:e.series.applyTo,for:`apply-to-series`},field:{id:`apply-to-series`,role:j.dropDownList,action:`activateSeries`}},{label:{text:e.series.color,for:`series-color`},field:{id:`series-color`,role:j.colorPicker,action:`seriesColor`}},{field:{id:`show-labels`,type:`checkbox`,role:j.checkBox,action:`seriesLabel`}}]}],he=e=>[{layoutClass:A.cols2gap4,editors:[{nowrap:!0,label:{text:e.legend.showLegend,for:`show-legend`}},{nowrap:!0,field:{id:`show-legend`,role:j.switch,action:`legendVisible`}},{label:{text:e.legend.font,for:`legend-font`},field:{id:`legend-font`,placeholder:e.legend.fontPlaceholder,role:j.comboBox,action:`legendFontName`},className:A.colSpan2},{label:{text:e.legend.size,for:`legend-size`},field:{id:`legend-size`,role:j.comboBox,placeholder:e.legend.sizePlaceholder,action:`legendFontSize`}},{label:{text:e.title.color,for:`legend-color`},field:{id:`legend-color`,role:j.colorPicker,action:`legendColor`}},{label:{text:e.legend.position.default,for:`legend-position`},field:{id:`legend-position`,role:j.dropDownList,action:`legendPosition`},className:A.colSpan2}]}],ge=e=>[{legend:e.categoryAxis.title.text,layoutClass:A.cols2gap4,editors:[{field:{id:`category-axis-title`,role:j.textBox,placeholder:e.categoryAxis.title.placeholder,action:`categoryAxisTitleText`},className:A.colSpan2},{label:{text:e.categoryAxis.title.font,for:`category-axis-title-font`},field:{id:`category-axis-title-font`,role:j.comboBox,placeholder:e.categoryAxis.title.fontPlaceholder,action:`categoryAxisTitleFontName`},className:A.colSpan2},{label:{text:e.categoryAxis.title.size,for:`category-axis-title-size`},field:{id:`category-axis-title-size`,role:j.comboBox,placeholder:e.categoryAxis.title.sizePlaceholder,action:`categoryAxisTitleFontSize`}},{label:{text:e.categoryAxis.title.color,for:`category-axis-title-color`},field:{id:`category-axis-title-color`,role:j.colorPicker,action:`categoryAxisTitleColor`}}]},{layoutClass:A.cols2gap4,legend:e.categoryAxis.labels.text,editors:[{label:{text:e.categoryAxis.labels.font,for:`category-axis-labels-font`},field:{id:`category-axis-labels-font`,role:j.comboBox,placeholder:e.categoryAxis.labels.fontPlaceholder,action:`categoryAxisLabelsFontName`},className:A.colSpan2},{label:{text:e.categoryAxis.labels.size,for:`category-axis-labels-size`},field:{id:`category-axis-labels-size`,role:j.comboBox,placeholder:e.categoryAxis.labels.sizePlaceholder,action:`categoryAxisLabelsFontSize`}},{label:{text:e.categoryAxis.labels.color,for:`category-axis-labels-color`},field:{id:`category-axis-labels-color`,role:j.colorPicker,action:`categoryAxisLabelsColor`}},{label:{text:e.categoryAxis.labels.rotation.text,for:`category-axis-labels-rotation`},field:{id:`category-axis-labels-rotation`,role:j.numericTextBox,placeholder:e.categoryAxis.labels.rotation.auto,action:`categoryAxisLabelsRotation`}},{field:{id:`category-axis-labels-reverse-order`,role:j.checkBox,action:`categoryAxisReverseOrder`},className:A.colSpan2}]}],_e=e=>[{legend:e.valueAxis.title.text,layoutClass:A.cols2gap4,editors:[{field:{id:`value-axis-title`,role:j.textBox,placeholder:e.valueAxis.title.placeholder,action:`valueAxisTitleText`},className:A.colSpan2},{label:{text:e.categoryAxis.title.font,for:`value-axis-title-font`},field:{id:`value-axis-title-font`,role:j.comboBox,placeholder:e.valueAxis.title.fontPlaceholder,action:`valueAxisTitleFontName`},className:A.colSpan2},{label:{text:e.valueAxis.title.size,for:`value-axis-title-size`},field:{id:`value-axis-title-size`,role:j.comboBox,placeholder:e.valueAxis.title.sizePlaceholder,action:`valueAxisTitleFontSize`}},{label:{text:e.valueAxis.title.color,for:`value-axis-title-color`},field:{id:`value-axis-title-color`,role:j.colorPicker,action:`valueAxisTitleColor`}}]},{layoutClass:A.cols2gap4,legend:e.valueAxis.labels.text,editors:[{label:{text:e.valueAxis.labels.labelFormat.default,for:`value-axis-label-format`},field:{id:`value-axis-label-format`,role:j.dropDownList,action:`valueAxisLabelsFormat`},className:A.colSpan2},{label:{text:e.valueAxis.labels.font,for:`value-axis-label-font`},field:{id:`value-axis-label-font`,role:j.comboBox,placeholder:e.valueAxis.labels.fontPlaceholder,action:`valueAxisLabelsFontName`},className:A.colSpan2},{label:{text:e.valueAxis.labels.size,for:`value-axis-label-size`},field:{id:`value-axis-label-size`,role:j.comboBox,placeholder:e.valueAxis.labels.sizePlaceholder,action:`valueAxisLabelsFontSize`}},{label:{text:e.valueAxis.labels.color,for:`value-axis-labels-color`},field:{id:`value-axis-labels-color`,role:j.colorPicker,action:`valueAxisLabelsColor`}},{label:{text:e.valueAxis.labels.rotation.text,for:`value-axis-labels-rotation`},field:{id:`value-axis-labels-rotation`,role:j.numericTextBox,placeholder:e.valueAxis.labels.rotation.auto,action:`valueAxisLabelsRotation`}}]}];function ve(e,t){return eO.createState(e,t)}function ye(e,t,n,r){var i=ve(e,n&&n.seriesType||t);return r&&(i=h({},i,r)),(n&&n.stack)===void 0?i:c(i,u.stacked,n.stack)}function be(){return[{ref:`chartarea`,getData:fe},{ref:`title`,getData:pe},{ref:`series`,getData:me},{ref:`legend`,getData:he},{ref:`categoryaxis`,getData:ge},{ref:`valueaxis`,getData:_e}]}function xe({state:e,data:t,type:n,action:r,change:i}){let a=e;return t&&n&&(a=l(e,ve(t,n))),r&&i!=null&&(a=c(a,r,i)),a.transitions=!1,a}function Se(e,t,n){let r=e.options.dataSource,i=r.splice(t,1);return r.splice(n,0,i[0]),r}let Ce={chartTypesWrapper:()=>`<div class="k-chart-types-wrapper"></div>`,iconTextItem:(e,n,r)=>`<div class="k-icon-text-wrapper" ${r??``}>${e}${t.htmlEncode(n)}</div>`,iconWrapper:(e,n)=>`<div class="k-icon-background-area" tabindex="0">${t.ui.icon({icon:e,size:n})}</div>`,formElement:()=>`<form class="k-form"></form>`,formFieldSet:(e,t)=>`<fieldset class="k-form-fieldset">
            ${e?`<legend class="k-form-legend">${e}</legend>`:``}
            ${t}
        </fieldset>`,divContentWrapper:e=>`<div ref=${e}></div>`,formFieldWrap:e=>`<div class="k-form-field-wrap">${e}</div>`,formField:(e,t)=>`<div class="k-form-field${t?` `+t:``}">
            ${e}
        </div>`,fieldContent:(e,t)=>`
            ${e}
            ${t}`,label:(e,t,n)=>`<label for="${t}" class="k-label${n?` `+n:``}">${e}</label>`,formGridLayout:e=>`<div class="k-form-layout k-d-grid${` `+e}"></div>`,inputBaseElement:e=>`<input ${e.id?`id="${e.id}"`:``} ${ie}=${e.role} ${ne}=${e.action} ${e.type?`type="${e.type}"`:``} ${e.placeholder?`placeholder="${t.htmlEncode(e.placeholder)}"`:``}/>`},we=e=>[{value:`bottom`,text:e.position.bottom},{value:`top`,text:e.position.top},{value:`left`,text:e.position.left},{value:`right`,text:e.position.right}],Te=e=>[{value:``,text:e.labels.labelFormat.text},{value:`n0`,text:e.labels.labelFormat.number},{value:`c0`,text:e.labels.labelFormat.currency},{value:`p0`,text:e.labels.labelFormat.percent}],Ee=e=>[{value:`title`,text:e.format.title.chartTitle},{value:`subtitle`,text:e.format.title.chartSubtitle}],De={colorPicker:{fillMode:oe,view:`gradient`,buttons:!1,format:`rgb`,opacity:!0},comboBox:{filter:`contains`,suggest:!0,dataTextField:`text`,dataValueField:`value`},numericTextBox:{step:1,fillMode:oe},dropDownList:{fillMode:oe,animation:!1,dataTextField:`text`,dataValueField:`value`,index:0},tabStrip:{dataTextField:`name`,dataContentField:`content`},grid:{columns:[{id:1,field:`reoreder`,draggable:!0,editable:()=>!1,width:`40px`},{id:2,field:`name`},{id:3,field:`remove`,editable:()=>!1,width:`40px`,template:()=>`<button ${ne}="remove" tabindex="0"></button>`}],pageable:!1,scrollable:!1,navigatable:!1,editable:{confirmation:!1,mode:`incell`},reorderable:{rows:!0}}},Oe=(e,t)=>{let n=[];e.forEach(e=>{let t=n.find(t=>t.uid===e.uid);t?m(t,e):n.push(e)});let r=n.map(e=>({dataItem:e,dataColumns:t}));return d(r)},ke=n.extend({init:function(e,r){let i=this;r||={},i.options=h({},i.options,r),n.fn.init.call(i,e,r),i._initial=!0,i._dataSource(),t.notify(i),n.fn.endInit.call(i)},options:{name:`ChartWizard`,dataSource:[],dataColumns:[],defaultState:{},state:{},window:{actions:[`Maximize`,`Close`],resizable:!0,visible:!0,modal:!0,scrollable:!1,animation:!1,width:700,height:550},exportOptions:{fileName:`chart`,pdf:{margin:`1cm`},image:{width:800,height:600}},messages:{window:{title:`Chart Preview`},export:`Export`,exportPDF:`PDF File`,exportSVG:`SVG File`,exportPNG:`PNG File`,tab:{chart:`Chart`,data:`Data`,format:`Format`},chart:{bar:{expandText:`Bar Chart`,bar:`Bar`,stackedBar:`Stacked Bar`,hundredStackedBar:`100% Stacked Bar`},pie:{expandText:`Pie Chart`,pie:`Pie`},column:{expandText:`Column Chart`,column:`Column`,stackedColumn:`Stacked Column`,hundredStackedColumn:`100% Stacked Column`},line:{expandText:`Line Chart`,line:`Line`,stackedLine:`Stacked Line`,hundredStackedLine:`100% Stacked Line`},scatter:{expandText:`Scatter Chart`,scatter:`Scatter`}},data:{configuration:{expandText:`Configuration`,series:{title:`Series`,add:`Add`},valueAxis:`Value Axis`,categoryAxis:`Category Axis`,xAxis:`X Axis`}},format:{chartArea:{expandText:`Chart Area`,margins:{default:`Margins`,auto:`Auto`,left:`Left`,right:`Right`,top:`Top`,bottom:`Bottom`},background:{default:`Background`,color:`Color`}},title:{expandText:`Title`,applyTo:`Apply to`,chartTitle:`Chart Title`,chartSubtitle:`Chart Subtitle`,label:`Title`,font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`},series:{expandText:`Series`,applyTo:`Apply to`,allSeries:`All Series`,color:`Color`,showLabels:`Show Labels`},legend:{expandText:`Legend`,showLegend:`Show Legend`,font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`,position:{default:`Position`,top:`Top`,bottom:`Bottom`,left:`Left`,right:`Right`}},categoryAxis:{expandText:`Category Axis`,title:{text:`Title`,placeholder:`Axis Title`,font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`},labels:{text:`Labels`,font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`,rotation:{text:`Rotation`,auto:`Auto`},reverseOrder:`Reverse Order`}},valueAxis:{expandText:`Value Axis`,title:{text:`Title`,placeholder:`Axis Title`,font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`},labels:{text:`Labels`,labelFormat:{default:`Label Format`,text:`Text`,number:`Number`,currency:`Currency`,percent:`Percent`},font:`Font`,fontPlaceholder:`(inherited font)`,size:`Size`,sizePlaceholder:`px`,color:`Color`,rotation:{text:`Rotation`,auto:`Auto`}}},xAxis:{expandText:`X Axis`},yAxis:{expandText:`Y Axis`}}}},events:[g,w,ee,_,`click`,`keydown`,b,x,C,T,te,E,`kendoKeydown`],open:function(){this.window.open()},close:function(){this.window.close()},_attachEvents:function(){let e=this;e.splitter.bind(g,({pane:e})=>{t.resize(e)}),e.splitter.bind(_,e=>{e.sender.element.find(`.k-pane`).each((e,n)=>{t.resize(n)})}),e.window.bind(S,e._windowActivateHandler.bind(e)),e.window.bind(_,e._windowResizeHandler.bind(e)),e.window.bind(v,e._windowActivateHandler.bind(e)),e.window.bind(y,e._windowActivateHandler.bind(e)),e.window.bind(x,function(){e.trigger(x)}),e.window.bind(b,function(){e.trigger(b)}),e.tabStrip.contentElements.on(`click.kendoChartWizard`,`.k-icon-text-wrapper`,e._handleChartTypeClick.bind(e)),e.tabStrip.contentElements.on(`keydown.kendoChartWizard`,`.k-icon-text-wrapper`,e,e._handleChartTypeKeydown.bind(e))},_dataSource:function(){let e=this,t=e.options.dataSource;e.dataSource&&e._refreshHandler?e.dataSource.unbind(C,e._refreshHandler):e._refreshHandler=e._refresh.bind(e),t&&t instanceof r?e.dataSource=t.bind(C,e._refreshHandler):(t=Array.isArray(t)?{data:t}:t,e.dataSource=r.create(t).bind(C,e._refreshHandler)),e.dataSource.data().length?e._refresh():e.dataSource._requestInProgress||e.dataSource.fetch()},_refreshContent:function(){let e=this,n=e.options,r=e._getChartStateInstance(n),i=e.previewPane.find(`.`+A.previewPaneHeader);e.window.setOptions({title:t.htmlEncode(n.messages.window.title),...n.window}),e._oldType=null,e._setChartContainerHeight(),e.chartState=m(e.chartState,r),e.chart.setOptions(e.chartState),e._detachEvents(),t.destroy(i),i.empty(),e._createExportButton(i),t.destroy(e.propertyPane),e.propertyPane.empty(),e._seriesGrid=null,e._seriesValueAxisDDL=null,e._initPropertyPane(),e._attachEvents(),!e.window.wrapper.is(`:visible`)&&n.window.visible&&e.window.open(),n.position||e.window.center()},_refresh:function(e){let t=this,n=Array.from(t.dataSource.data());t.trigger(w,{data:n}),n=t._data=t._getWizardData(n),t._initial?(t._initWindow(),t._initSplitter(),t._initPreviewPane(),t._initPropertyPane(),t._attachEvents(),t._initial=!1):t._refreshContent(),t.trigger(ee,{data:n})},_getWizardData:function(e){let t=this,n=e,r=t.options.dataColumns?t.options.dataColumns.map(e=>typeof e==`string`?{field:e}:e):[];return e.length&&e[0].dataItem&&e[0].dataColumns?n=d(e):e.length&&!Array.isArray(e[0])&&r.length&&(n=Oe(e,r)),n},setDataSource:function(e){let t=this,n=t.options;e&&(n.dataSource=e,t._dataSource())},setDataColumns:function(e){let t=this.options;e.length&&(t.dataColumns=e)},_detachEvents:function(){let e=this;e.splitter.unbind(g),e.splitter.unbind(_),e.window.unbind(S),e.window.unbind(_),e.window.unbind(x),e.window.unbind(b),e.window.unbind(v),e.window.unbind(y),e.tabStrip.contentElements.off(`click.kendoChartWizard`),e.tabStrip.contentElements.off(`keydown.kendoChartWizard`)},_setChartContainerHeight:function(){let e=this;e.previewPane.find(`.`+A.previewPaneContent).css({height:e.previewPane.height()-50})},_windowActivateHandler:function(){let e=this;e._setChartContainerHeight(),e.chart.resize()},_windowResizeHandler:function(){this._setChartContainerHeight()},_handleChartTypeKeydown:function(e){t.keyDownHandler(e,this)&&e.keyCode===i.ENTER&&this._handleChartTypeClick(e)},_handleChartTypeClick:function(t){let n=this,r=e(t.currentTarget),i=n._getRefAttributeValue(r.closest(`.k-expander-content`)[0])[0],a=r.attr(ae),o=n.chartState,s=null,c=null;a.includes(`hundredstacked`)?(c=u.stacked,s={type:`100%`}):a.includes(`stacked`)&&(c=u.stacked,s={type:`normal`}),n._executeAction(s,{element:r},o.data,i,c),r.closest(`.k-tabstrip-content`).find(`.k-selected`).removeClass(k),r.addClass(k),n._toggleFieldsForSeriesPanel(i),n._toggleFormatPanels(),n._refreshEditors()},_refreshEditors:function(){let t=this;t.propertyPane.find(`[data-action]:not('.k-button')`).each((n,r)=>{let i=e(r),a=i.data(`handler`),o=i.attr(`id`),s=e(r).closest(`[ref]`),c=i.attr(ie),l=t._getRefAttributeValue(s[0])[0];if(a&&a.setOptions){let e=t._getOptionsForPanel(o)[l][c];if(e&&e.options)if(c===j.checkBox)a.check(e.options.checked);else if(l===`series`)a.setOptions(e.options),e.options&&e.options.enable&&a.enable(e.options.enable);else{let t=e.options.value;t&&typeof t!=`string`&&t.value&&(t=t.value),a.value(t)}if(c===j.comboBox){let e=t._getFontState(i);e&&e.value&&a.value(e.value)}}}),t._seriesGrid&&t._seriesGrid.setDataSource(t.chartState.series)},_initWindow:function(){let e=this,n=e.options.messages,r=e.options.window,i=!r.position;e.window=e.element.kendoWindow({title:t.htmlEncode(n.window.title),...r}).data(`kendoWindow`),i&&e.window.center(),e.window.element.attr(`tabindex`,`-1`),e.wrapper=e.window.wrapper.addClass(A.chartWizard)},_initSplitter:function(){let t=this;t.splitter=e(`<div>`).kendoSplitter({orientation:`horizontal`}).data(`kendoSplitter`),t.previewPane=t.splitter.append({scrollable:!1}),t.propertyPane=t.splitter.append({size:`300px`,collapsible:!0}),t.splitter.wrapper.addClass(A.splitter),t.window.content(t.splitter.wrapper)},_initPreviewPane:function(){let t=this,n=t.options;t.previewPane.addClass(A.previewPane);let r=e(`<div></div>`).addClass(A.previewPaneHeader),i=e(`<div></div>`).addClass(A.previewPaneContent);t.options.window.visible&&i.css({height:t.previewPane.height()-50});let a=e(`<div id='chart'>`);t._createExportButton(r),i.append(a),t.previewPane.append(r.add(i)),t._initChart(a,n)},_getChartStateInstance:function(e,t){let n=this,r=t?{}:e.defaultState,i=Object.keys(e.state).length,a=i?e.state.data:n._data,o=i&&!t&&e.state.seriesType||`bar`;return ye(a||[],o,r,e.state)},_initChart:function(e,t){let n=this,r=t.defaultState&&t.defaultState.seriesType===`pie`||t.state&&t.state.seriesType===`pie`,i=n._getChartStateInstance(t,r);if(i.chartArea=i.area,i.transitions=!1,n.chartState=i,n.chart=e.kendoChart(i).data(`kendoChart`),n.chart.wrapper.css({width:`100%`,height:`100%`}),r){let e=n._getChartStateInstance(t);n.chartState=m(n.chartState,e),n.chart.setOptions(n.chartState)}n._initialState||=n.chart.options},_createExportButton:function(n){let r=this;r._configureExportButton(le);let i=e(`<button>${t.htmlEncode(r.options.messages.export)}</button>`).kendoDropDownButton(le);n.append(i)},_configureExportButton:function(e){let n=this,r=n.options.messages,i={"export-pdf":function(){n.trigger(T,{chart:n.chart,exportOptions:n.options.exportOptions})||n.chart.exportPDF(n.options.exportOptions.pdf).done(function(e){t.saveAs({dataURI:e,fileName:n.options.exportOptions.fileName})})},"export-svg":function(){n.trigger(te,{chart:n.chart,exportOptions:n.options.exportOptions})||n.chart.exportSVG(n.options.exportOptions.fileName).done(function(e){t.saveAs({dataURI:e,fileName:n.options.exportOptions.fileName})})},"export-png":function(){n.trigger(E,{chart:n.chart,exportOptions:n.options.exportOptions})||n.chart.exportImage(n.options.exportOptions.image).done(function(e){t.saveAs({dataURI:e,fileName:n.options.exportOptions.fileName})})}};e.items.forEach(e=>{let n=e.id.split(`-`),a=n[0]+n[1].toUpperCase();e.text=t.htmlEncode(r[a]),e.click=i[e.id]})},_preventLabelPointerEvents:function(){this.propertyPane.find(`.k-label`).addClass(`k-pointer-events-none`)},_initPropertyPane:function(){let n=this,r=De.tabStrip;r.dataSource=Object.values(n.options.messages.tab).map(e=>({name:t.htmlEncode(e)})),n._createTabsContent(r.dataSource),n.tabStrip=e(`<div>`).kendoTabStrip({...r,activate:function(r){if(e(r.contentElement).find(`[${D}'data']`).length){let i=e(r.contentElement).find(`#category-axis`).parent().siblings(`.k-form-legend`);i.length&&n.chart.options.seriesType===`scatter`?i.text(t.htmlEncode(n.options.messages.data.configuration.xAxis)):i.length&&i.text(t.htmlEncode(n.options.messages.data.configuration.categoryAxis))}n._seriesGrid&&n._seriesGrid.wrapper.is(`:visible`)&&(n._seriesGrid._draggableRows(),n._seriesGrid._reorderableRows())}}).data(`kendoTabStrip`),n.propertyPane.addClass(A.propertyPane),n.propertyPane.append(n.tabStrip.wrapper),n._expansionPanels(),n._prepareDataTab(),n._prepareFormatTab(),n._initStaticEditors(),n.tabStrip.activateTab(n.tabStrip.tabGroup.children().first()),n.options.window.visible&&n.chart.resize()},_createTabsContent:function(e){let t=this;e.forEach(e=>{e.content=t._createExpansionPanelContent(e.name)??``})},_createExpansionPanelContent:function(e){let t=this,n=``,r=t.options.messages.tab;if(e===r.chart)Object.keys(ue).forEach(e=>{n+=t._createChartTypesPanel(ue[e].content,`${e}-chart-panel`,e)});else if(e===r.data){let e=de(t.options.messages.data);n+=t._createFormPanel(e,`configuration-data-panel`)}else e===r.format&&be().forEach(e=>{let r=e.getData(t.options.messages.format);n+=t._createFormPanel(r,`${e.ref}-format-panel`)});return n},_createChartTypesPanel:function(n,r,i){let a=this.options.messages.chart,o=e(Ce.divContentWrapper(r)),s=e(Ce.chartTypesWrapper());return Object.keys(n).forEach(e=>{let r=t.htmlEncode(a[i][e]),o=`${ae}=${e.toLowerCase()}`;s.append(Ce.iconTextItem(Ce.iconWrapper(n[e],`xlarge`),r,o))}),o.append(s),o[0].outerHTML},_createFormPanel:function(n,r){let i=e(Ce.divContentWrapper(r)),a=e(Ce.formElement());return n.forEach(n=>{let r=n.legend,i=n.layoutClass,o=n.editors,s=``;if(o instanceof Array){let n=``;if(o.forEach(e=>{let r=e.nowrap,i=e.label?Ce.label(t.htmlEncode(e.label.text),e.label.for,!r&&`k-form-label`):``,a=e.className,o;o=e.field&&e.field.custom?e.field.custom:e.field?Ce.inputBaseElement(e.field):``,r?n+=Ce.fieldContent(i,o):n+=Ce.formField(Ce.fieldContent(i,Ce.formFieldWrap(o)),a)}),i){let t=e(Ce.formGridLayout(i));t.append(n),s=t[0].outerHTML}else s=n}else s=o&&o.custom?o.custom:Ce.inputBaseElement(o);r?a.append(Ce.formFieldSet(t.htmlEncode(r),s)):a.append(s)}),i.append(a),i[0].outerHTML},_ensureSizeValue:function(e,t){let n=/^\d+$/,r=e.toString(),i=a.find(e=>e.text===r);if(!i){if(!n.test(r)||isNaN(parseInt(r,10)))return!1;i={text:r,value:r+`px`},a.push(i),a.sort((e,t)=>parseInt(e.text,10)-parseInt(t.text,10)),t(a)}return!0},_executeAction:function(e,t,n,r,i){let a=this,o=t.element.data(`action`),s={state:a.chartState,action:i??u[o],change:e};n&&(s.data=n,s.type=r??a.chartState.seriesType);let c=xe(s);return c.chartArea=c.area,a.chart.setOptions(c),a.chartState=c,c},_seriesDropDownChange:function(e){let t=this;t._seriesChange=!0,e.preventChange=!0;let n=t._handlePropertyChange(e);delete t._seriesChange,t._seriesGrid&&t._seriesGrid.setDataSource(n.series)},_prepareDataTab:function(){let e=this,t=e.element.find(`[${D}'data'] > form`),n=t.find(`.k-grid`).closest(`.k-form-fieldset`),r=t.find(`#value-axis`).closest(`.k-form-fieldset`);e._dynamicConfigurationFields={grid:n.clone(),valueAxis:r.clone(),container:t},n.remove(),r.remove()},_resetFontValue:function(e,t){return e&&t?(t.font=``,!0):!1},_getFontField:function(e,t,n){let r=this,i;return i=n?t&&t.font:e&&e.font,r._valueReset=r._resetFontValue(n,e),i},_getFontValue:function(e,t,n,r){let i=this,a,o=n===`initial`,s=i._initialState[e.active],c=i.chartState[e.active];if(a=Array.isArray(c)?i._getFontField(c[0],s,o,r):i._getFontField(c,s,o,r),!a&&e.subfield){let t=e.subfield.toLowerCase();a=Array.isArray(c)?i._getFontField(c[0][t],s[t],o,r):i._getFontField(c[t],s[t],o,r)}return a&&=i._parseFont(a)[t],a},_createFontCombobox:function(e){let t=this,n=t._getFontState(e),r=e.kendoComboBox({dataSource:n.dataSource,value:n.value,change:function(e){let r=e.sender._fontState,i=r.type===`name`,s=r.subfield&&n.active!==`legend`,c=`${r.active}${r.subfield&&s?`${r.subfield}`:``}Font`,l=i?`Size`:`Name`,u=e.sender.value(),d=e.sender.wrapper.closest(`.k-form`).find(`[${ne}*=${c+l}]`).data(`kendoComboBox`);l=l.toLowerCase();let f=!u;if(f){if(t._getFontValue(r,r.type,`initial`),t._valueReset)return e.sender.value(``),d.value(``),t.chart.setOptions(t.chartState)}else{if(i||(u=u.replace(`px`,``)),u!==``&&!i&&!t._ensureSizeValue(u,e.sender.setDataSource.bind(e.sender)))return;t._handlePropertyChange(e)}if(!f&&!d.value()){let e=t._getFontValue(r,l),n;i?t._ensureSizeValue(e,d.setDataSource.bind(d))&&(n=a.find(t=>t.text===e.toString())):(e=e.replace(/^['"]*([a-zA-Z0-9\s]+)['"]*$/g,`$1`),n=o.find(t=>t.value.includes(e))),n&&n.value&&(d.value(n.text),t._handlePropertyChange({sender:d,preventChange:!0},n.value))}},...De.comboBox}).data(`kendoComboBox`);return r._fontState=n,r},_createDropDownList:function(t,n,r){let i=this;return e(t).kendoDropDownList({...De.dropDownList,...n,change:r||function(e){i._handlePropertyChange(e)}}).data(`kendoDropDownList`)},_createSwitch:function(e,t,n){let r=this;return e.kendoSwitch({...t,change:n||function(e){r._handlePropertyChange(e)}}).data(`kendoSwitch`)},_createCheckBox:function(e,t,n){let r=this;return e.kendoCheckBox({...t,change:n||function(e){r._handlePropertyChange(e)}}).data(`kendoCheckBox`)},_createColorPicker:function(e,t,n){let r=this,i=t??{},a=i.enable===void 0||i.enable;delete i.enabled;let o=e.kendoColorPicker({...De.colorPicker,...i,change:n||function(e){r._handlePropertyChange(e)},select:n||function(e){r._handlePropertyChange(e,e.value)}}).data(`kendoColorPicker`);return o.enable(a),o},_createNumericTextBox:function(e,t,n){let r=this;return e.kendoNumericTextBox({...De.numericTextBox,...t,change:n||function(e){r._handlePropertyChange(e)},spin:n||function(e){r._handlePropertyChange(e)}}).data(`kendoNumericTextBox`)},_createTextBox:function(t,n){let r=this,i=t.kendoTextBox({...n});return i.on(`input.kendoChartWizard`,function(t){let n={element:e(t.target)};r._handlePropertyChange({sender:n},e(t.target).val())}),i.data(`kendoTextBox`)},_getFieldValue:function(e){let t=e.split(ce),n=t.indexOf(`Font`),r=t.slice(0,n),i=t[n+1].toLowerCase(),a,o;return r.length===1?a=r[0]:r.length>1&&(o=r.pop(),a=r.join(``)),{type:i,field:a,subfield:a===`legend`?`Labels`:o}},_getFontState:function(e){let t=this,n=t.chartState,r=e.data(`action`),i=t._getFieldValue(r),s=i.field,c=i.subfield&&i.subfield.toLowerCase(),l=n[s]&&n[s].font;!l&&c&&(l=n[s]&&n[s][c]&&n[s][c].font);let u=null,d=[];return i.type===`name`?(d=o,u=l&&d.find(e=>e.value===t._parseFont(l).name)||null):(d=a,u=l&&d.find(e=>e.value===t._parseFont(l).size)||null),{dataSource:d,value:u,type:i.type,active:s,subfield:i.subfield}},_parseFont:function(t){let n=e(`<span></span>`);return n.css(`font`,t),{fontWeight:n.css(`fontWeight`),size:parseInt(parseFloat(n.css(`fontSize`))),name:n.css(`fontFamily`)}},_addSeries:function(e){let t=this,n=t._seriesGrid,r=t._removedSeries.pop(),i=n.options.dataSource;i.push(r),n.setDataSource(i)},_removeSeries:function(e){let t=this,n=e.target.closest(`tr`);t._seriesGrid.removeRow(n)},_gridDataBoundHandler:function(t){let n=this,r={add:this._addSeries.bind(n),remove:this._removeSeries.bind(n)};t.wrapper.find(`.k-grid-header`).remove(),t.wrapper.find(re).each((i,a)=>{let o=e(a);o.data(`kendoButton`)&&(o.data(`kendoButton`).destroy(),o.removeAttr(`disabled`));let s=o.data(`action`),c=s===`remove`&&t._data.length>1,l=!!(s===`add`&&n._removedSeries&&n._removedSeries.length>0),u=c||l;o.kendoButton({icon:s===`add`?`plus`:`trash`,enabled:u,fillMode:se,click:r[s]})})},_initGrid:function(e){let n=this,r=n.options.messages.data.configuration.series;n._seriesGrid=e.kendoGrid({...De.grid,toolbar:[{template:()=>`<button ${ne}='add' tabindex="0">${t.htmlEncode(r.add)}</button>`}],dataBound:function(e){let t=e.sender;n._preventChange=!0,n._seriesReordering?t._data.length===n._reorderedData.length&&(n._seriesReordering=!1,n._executeAction(n._reorderedData,t),delete n._reorderedData,n.trigger(C,{state:n.chartState})):(n._executeAction(t.options.dataSource,t),n.trigger(C,{state:n.chartState})),n._preventChange=!1,n._gridDataBoundHandler(t)},cellClose:function(e){e.type===`save`&&n._handleSeriesEdit(e)},remove:function(e){n._handleSeriesRemove(e)},rowReorder:function(e){n._seriesReordering=!0,n._reorderedData=Se(e.sender,e.oldIndex,e.newIndex-1)},dataSource:n.chartState.series}).data(`kendoGrid`)},_handleSeriesEdit:function(e){let t=this,n=e.sender,r=n.options.dataSource,i=n.dataSource.indexOf(e.model),a={...r[i],name:e.model.name};r.splice(i,1,a),t._executeAction(r,n),t.trigger(C,{state:t.chartState})},_handleSeriesRemove:function(e){let t=this,n=e.sender.options.dataSource,r,i=n.find((t,n)=>(r=n,t.name===e.model.name));n.splice(r,1),t._removedSeries?t._removedSeries.unshift(i):t._removedSeries=[i]},_toggleFieldsForSeriesPanel:function(t){let n=this,r=e(n._dynamicConfigurationFields.grid[0].outerHTML),i=e(n._dynamicConfigurationFields.valueAxis[0].outerHTML),a=n._dynamicConfigurationFields.container,o=s(t);if(!(!r||!i)&&!(n._oldType===t||s(n._oldType)&&o)){if(o)n._seriesValueAxisDDL&&n._seriesValueAxisDDL.wrapper&&n._seriesValueAxisDDL.wrapper.data&&n._seriesValueAxisDDL.destroy(),delete n._seriesValueAxisDDL,a.find(`[data-action=valueAxisY]`).closest(`.k-form-fieldset`).remove(),a.append(r),n._initGrid(r.find(`.k-grid`));else{n._seriesGrid&&n._seriesGrid.wrapper&&n._seriesGrid.wrapper.data&&n._seriesGrid.destroy(),delete n._seriesGrid,a.find(`.k-grid`).closest(`.k-form-fieldset`).remove(),a.append(i);let e=i.find(`[${O}${j.dropDownList}]`);n._seriesValueAxisDDL=n._createDropDownList(e,{value:n.chartState.valueField||``,dataSource:n.chartState.columns.map(e=>({text:e,value:e}))},n._seriesDropDownChange.bind(n))}n._oldType=t,n._preventLabelPointerEvents()}},_initStaticEditors:function(){let t=this;t.element.find(`.k-form`).each((n,r)=>{let i=e(r).closest(`[ref]`),a=e(i).find(`[${ie}]`),o=t._getRefAttributeValue(i[0])[0];t._initEditors(a,o)}),t._toggleFieldsForSeriesPanel(t.chartState.seriesType),t._toggleFormatPanels()},_initEditors:function(t,n){let r=this;t.each((t,i)=>{let a=e(i),o=a.attr(`id`),s=a.data(`role`),c=r._getOptionsForPanel(o)[n][s],l=c&&c.options,u=c&&c.handler;s===`combobox`?r._createFontCombobox(a,l,u):s===`dropdownlist`?r._createDropDownList(a,l,u):s===`colorpicker`?r._createColorPicker(a,l,u):s===`numerictextbox`?r._createNumericTextBox(a,l,u):s===`switch`?r._createSwitch(a,l,u):s===`checkbox`?r._createCheckBox(a,l,u):s===`textbox`&&r._createTextBox(a,l,u)})},_prepareFormatTab:function(){let e=this,t=e.element.find(`[${D}'categoryaxis'] > form`),n=e.element.find(`[${D}'valueaxis'] > form`);e._dynamicFormatPanels={categoryAxis:t,valueAxis:n,container:t.closest(`.`+A.expansionPanelWrapper).parent()},e._initialAxesPanelsContent={categoryAxis:t.clone(),valueAxis:n.clone()},t.closest(`.`+A.expansionPanelWrapper).remove(),n.closest(`.`+A.expansionPanelWrapper).remove()},_toggleFormatPanels:function(){let n=this,r=n.options.messages.format,i=n.chartState.seriesType,a=n._dynamicFormatPanels.categoryAxis,o=n._dynamicFormatPanels.valueAxis,s=n._dynamicFormatPanels.container,c=n._initialAxesPanelsContent.categoryAxis.html(),l=n._initialAxesPanelsContent.valueAxis.html();if(a.empty().append(c),o.empty().append(l),i!==`pie`){let c=t.htmlEncode(r.categoryAxis.expandText),l=t.htmlEncode(r.valueAxis.expandText);if(i===`scatter`&&(c=t.htmlEncode(r.xAxis.expandText),l=t.htmlEncode(r.yAxis.expandText)),s.find(e(o)).length===0){let t=e(Ce.divContentWrapper(`categoryaxis-format-panel`)).append(a),n=e(Ce.divContentWrapper(`valueaxis-format-panel`)).append(o);s.append(t),s.append(n),e(t).kendoExpansionPanel({title:c}),e(n).kendoExpansionPanel({title:l})}else a.closest(`.`+A.expansionPanelWrapper).find(`.k-expander-title`).text(c),o.closest(`.`+A.expansionPanelWrapper).find(`.k-expander-title`).text(l);a.closest(`.`+A.expansionPanelWrapper).length&&a.closest(`[ref]`).add(o.closest(`[ref]`)).each((t,r)=>{let i=e(r).find(`[${ie}]`),a=n._getRefAttributeValue(r)[0];n._initEditors(i,a)})}else if(s.find(o).length){let e=a.closest(`.`+A.expansionPanelWrapper),n=o.closest(`.`+A.expansionPanelWrapper);t.destroy(e),t.destroy(n),e.remove(),n.remove()}n._preventLabelPointerEvents()},_handlePropertyChange:function(e,t){let n=this,r=t||t===``?t:e.sender.value(),i=n._executeAction(r,e.sender);return!e.preventChange&&n.trigger(C,{state:n.chartState}),i},_getOptionsForPanel:function(e){let n=this,r=n.chartState,i=n.options.messages,a=we(i.format.legend).map(e=>({...e,text:t.htmlEncode(e.text)})),o=Te(i.format.valueAxis).map(e=>({...e,text:t.htmlEncode(e.text)})),c=Ee(i).map(e=>({...e,text:t.htmlEncode(e.text)})),l=e.includes(`title`)?`title`:`labels`;return{configuration:{dropdownlist:{options:{value:r[e.includes(`category`)?`categoryField`:`valueField`],dataSource:r.columns.map(e=>({text:e,value:e}))},handler:n._seriesDropDownChange.bind(n)}},chartarea:{numerictextbox:{options:{value:r.chartArea&&r.chartArea.margin[e]?r.chartArea.margin[e]:null,min:0,max:1e3}},colorpicker:{options:{value:r.chartArea.background&&r.chartArea.background.color||``}}},title:{dropdownlist:{options:{dataSource:c,value:n._activeTitle&&c.find(e=>e.value===n._activeTitle.value)},handler:n._titleFieldChange.bind(n)},textbox:{options:{value:n._activeTitle&&r[n._activeTitle].text}},colorpicker:{options:{value:n._activeTitle&&r[n._activeTitle].color}}},series:{dropdownlist:{options:{dataSource:[{name:t.htmlEncode(i.format.series.allSeries)},...r.series],dataTextField:`name`,dataValueField:`name`,enable:s(r.seriesType),value:n._activeSeries&&r.series.find(e=>e.name===n._activeSeries)},handler:n._activeSeriesChange.bind(n)},colorpicker:{options:{value:n._activeSeries?r.series.find(e=>e.name===n._activeSeries).color:``,enable:!1},handler:n._changeSeriesColor.bind(n)},checkbox:{options:{label:i.format.series.showLabels,checked:n._activeSeries?r.series.find(e=>e.name===n._activeSeries).labels.visible:r.series.every(e=>e.labels?.visible)},handler:n._showLabels.bind(n)}},legend:{dropdownlist:{options:{dataSource:a,value:r.legend&&r.legend.position&&a.find(e=>e.value===r.legend.position)}},colorPicker:{options:{value:r.legend&&r.legend.labels&&r.legend.labels.color||``}},switch:{options:{checked:r.legend&&r.legend.visible}}},categoryaxis:{textbox:{options:{value:r.categoryAxis[0][l]&&r.categoryAxis[0][l].text||``}},numerictextbox:{options:{value:r.categoryAxis[l]&&r.categoryAxis[l].rotation,min:-360,max:360}},checkbox:{options:{label:i.format.categoryAxis[l].reverseOrder,checked:r.categoryAxis[0].reverse||!1}},colorpicker:{options:{value:r.categoryAxis[0][l]&&r.categoryAxis[0][l].color||``}}},valueaxis:{dropdownlist:{options:{dataSource:o,value:r.valueAxis[l]&&r.valueAxis[l].labelFormat&&o.find(e=>e.value===r.valueAxis[l].labelFormat)}},textbox:{options:{value:r.valueAxis[l]&&r.valueAxis[l].text||``}},numerictextbox:{options:{value:r.valueAxis[0][l]&&typeof r.valueAxis[0][l].rotation==`number`?r.valueAxis[0][l].rotation:null,min:-360,max:360}},colorpicker:{options:{value:r.valueAxis[0][l]&&r.valueAxis[0][l].color||``}}}}},_titleFieldChange:function(t){let n=this,r=n._applyTo(t),i=t.sender.wrapper.closest(`.k-form`);i.find(`[${O}${j.textBox}]`).data(`kendoTextBox`).value(n.chartState[r].text),i.find(`[${O}${j.colorPicker}]`).data(`kendoColorPicker`).value(n.chartState[r].color??``),i.find(`[${O}${j.comboBox}]`).each((t,i)=>{let s=e(i).data(`action`).includes(`FontName`)?`name`:`size`,c=n._parseFont(n.chartState[r].font)[s].toString(),l=e(i).data(`kendoComboBox`),u;if(c){let e=RegExp(`${c.replaceAll(`"`,``).split(`,`)[0]}`,`g`);u=s===`name`?o.find(t=>e.test(t.text)):a.find(e=>e.text===c.toString()),u&&n._handlePropertyChange&&n._handlePropertyChange({sender:l},u.value)}n._activeTitle=r,l._fontState.active=r,l.value(u?u.text:null)})},_activeSeriesChange:function(e){let t=this,n=e.sender.value(),r=e.sender.wrapper.closest(`.k-form`).find(`[${O}${j.colorPicker}]`).data(`kendoColorPicker`);if(n!==t.options.messages.format.series.allSeries){let e=t.chart.options.series.find(e=>e.name===n);r.enable(!0),e&&r.value(e.color),r._currentActiveSeries=n,t._activeSeries=n}else r.value(``),r.enable(!1),r._currentActiveSeries=null,t._activeSeries=null},_applyTo:function(t){let n=t.sender.value();return t.sender.wrapper.closest(`.k-form`).find(re).each((r,i)=>{let a=e(i);if(!a.is(t.sender.element)){let e=a.data(`action`).split(ce);e.shift();let t=n+e.join(``);a.attr(ne,t).data(`action`,t)}}),n},_showLabels:function(e){let t=this,n=e.sender.check(),r=e.sender.wrapper.closest(`.k-form`).find(`[${O}${j.colorPicker}]`).data(`kendoColorPicker`);t._handlePropertyChange(e,{seriesName:r._currentActiveSeries,all:!r._currentActiveSeries,visible:n})},_changeSeriesColor:function(e){let t=this,n=e.value;t._handlePropertyChange(e,{seriesName:e.sender._currentActiveSeries,color:n})},_getRefAttributeValue:function(e){return e.getAttribute(`ref`).split(`-`)},_expansionPanels:function(){let n=this,r=``,i=0;n.tabStrip.contentElements.children().each((a,o)=>{let s=n._getRefAttributeValue(o)[1];r===s?i++:i=0;let c=Object.keys(n.options.messages[s]),l=e(o).kendoExpansionPanel({title:t.htmlEncode(n.options.messages[s][c[i]].expandText),complete:()=>{n._seriesGrid&&n._seriesGrid.wrapper.is(`:visible`)&&(n._seriesGrid._draggableRows(),n._seriesGrid._reorderableRows())}}).data(`kendoExpansionPanel`);l.wrapper.removeClass(),l.wrapper.addClass(A.expansionPanelWrapper),r=s})},setOptions:function(e){if(!e)return;let t=this,n=e.dataSource!==null&&e.dataSource!==void 0,r=e.dataColumns!==null&&e.dataColumns!==void 0;e.state!==null&&e.state!==void 0&&delete t.options.state,n&&delete t.options.dataSource,r&&delete t.options.dataColumns,h(t.options,e),r&&t.setDataColumns(e.dataColumns),n?t.setDataSource(t.options.dataSource):t._refreshContent()},destroy:function(){let e=this;t.destroy(e.previewPane),t.destroy(e.propertyPane),e.element.empty(),n.fn.destroy.call(e),e.element.off(f),e.wrapper.off(f),e._detachEvents(),e.splitter&&e.splitter.destroy(),e.chart&&e.chart.destroy(),e.tabStrip&&e.tabStrip.destroy(),e.window&&e.window.destroy(),e.chart=e.tabStrip=e.window=e.splitter=e.propertyPane=e.chartState=e.previewPane=null,e._dynamicConfigurationFields=e._dynamicFormatPanels=e._initialAxesPanelsContent=e._initialState=e._oldType=e._seriesGrid=null}});p.plugin(ke),m(t.ui.ChartWizard,{generateDataRows:Oe,getWizardDataFromDataRows:d})})(window.kendo.jQuery);var nO=kendo;e.__meta__=tO,e.default=nO});
//# sourceMappingURL=kendo.chartwizard.min.js.map