UNPKG

@progress/kendo-ui

Version:

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

1 lines 516 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("kendo.drawing.cmn.chunk.js")):"function"==typeof define&&define.amd?define(["exports","kendo.drawing.cmn.chunk.min"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).kendo=t.kendo||{},t.kendo._globals=t.kendo._globals||{},t.kendo._globals.ChartsCmnChunk={}),t.kendo._globals.DrawingCmnChunk)}(this,(function(t,e){const i="arc",s="ArrowUp",o="ArrowDown",n="ArrowLeft",r="ArrowRight",a="aria-activedescendant",l="axisLabelClick",h="#000",c="bottom",d="center",u="circle",p="cross",g="date",m="12px sans-serif",f=10,x=600,y="end",v="Enter",b="Escape",w=/\{\d+:?/,_="height",k="inside",A="inherit",S="left",C=Number.MAX_VALUE,T=-Number.MAX_VALUE,P="none",M="noteClick",E="noteHover",L="noteLeave",I="object",R="outside",B="right",O="roundedRect",V="start",D="string",z="top",F="triangle",H="square",N="rect",j="value",U="#fff",G="width",W="x",X="y",Y="pointer",q="horizontal",Z="vertical";var $=Object.freeze({__proto__:null,ARC:i,ARIA_ACTIVE_DESCENDANT:a,ARROW_DOWN:o,ARROW_LEFT:n,ARROW_RIGHT:r,ARROW_UP:s,AXIS_LABEL_CLICK:l,BLACK:h,BOTTOM:c,CENTER:d,CIRCLE:u,COORD_PRECISION:3,CROSS:p,DATE:g,DEFAULT_FONT:m,DEFAULT_HEIGHT:400,DEFAULT_PRECISION:f,DEFAULT_SERIES_OPACITY:1,DEFAULT_WIDTH:x,END:y,ENTER:v,ESCAPE:b,FORMAT_REGEX:w,HEIGHT:_,HIGHLIGHT_ZINDEX:100,HORIZONTAL:q,INHERIT:A,INSIDE:k,LEFT:S,MAX_VALUE:C,MIN_VALUE:T,NONE:P,NOTE_CLICK:M,NOTE_HOVER:E,NOTE_LEAVE:L,OBJECT:I,OUTSIDE:R,POINTER:Y,RECT:N,RIGHT:B,ROUNDED_RECT:O,SQUARE:H,START:V,STRING:D,TAB:"Tab",TOP:z,TRIANGLE:F,VALUE:j,VERTICAL:Z,WHITE:U,WIDTH:G,X:W,Y:X});function Q(t){return Array.isArray(t)}function K(t,e){const i=Q(e)?e:[e];for(let e=0;e<i.length;e++){const s=i[e];-1===t.className.indexOf(s)&&(t.className+=" "+s)}}const J=/\s+/g;function tt(t,e){t&&t.className&&(t.className=t.className.replace(e,"").replace(J," "))}function et(t){let i=.5;t.options.stroke&&e.d(t.options.stroke.width)&&t.options.stroke.width%2==0&&(i=0);for(let e=0;e<t.segments.length;e++)t.segments[e].anchor().round(0).translate(i,i);return t}function it(t,e){return-t.x*e.y+t.y*e.x<0}function st(t){return"number"==typeof t&&!isNaN(t)}function ot(t){return typeof t===D}function nt(t){return st(t)||ot(t)&&isFinite(t)}function rt(t,e){return(t+1)%e}function at(t,e){let i=t-1;return i<0?e-1:i}function lt(t,e){return 1===e||t%e==0?0:t<0?e+t%e:t>=e?t%e:t}function ht(t){return"function"==typeof t}const ct="object";function dt(t,e){for(let i in e){if("__proto__"===i||"constructor"===i)continue;let s,o=e[i],n=typeof o;if(s=n===ct&&null!==o?o.constructor:null,s&&s!==Array)if(o instanceof Date)t[i]=new Date(o.getTime());else if(ht(o.clone))t[i]=o.clone();else{let e=t[i];t[i]=typeof e===ct&&e||{},dt(t[i],o)}else"undefined"!==n&&(t[i]=o)}return t}function ut(t){const e=arguments.length;for(let i=1;i<e;i++)dt(t,arguments[i]);return t}function pt(t){return"object"==typeof t}function gt(t){return st(t)?t+"px":t}const mt=/width|height|top|left|bottom|right/i;function ft(t){return mt.test(t)}function xt(t,e){const i=ot(e)?[e]:e;if(Q(i)){const e={},s=window.getComputedStyle(t);for(let t=0;t<i.length;t++){let o=i[t];e[o]=ft(o)?parseFloat(s[o]):s[o]}return e}if(pt(e))for(let i in e)t.style[i]=gt(e[i])}function yt(t,e=0){const i={top:0,right:0,bottom:0,left:0};return"number"==typeof t?i[z]=i[B]=i[c]=i[S]=t:(i[z]=t[z]||e,i[B]=t[B]||e,i[c]=t[c]||e,i[S]=t[S]||e),i}let vt={compile:function(t){return t}};class bt{static register(t){vt=t}static compile(t,e){return vt.compile(t,e)}}function wt(t={}){let e;return t.template?t.template=e=bt.compile(t.template):ht(t.content)&&(e=t.content),e}function _t(t={}){let e;return t.ariaTemplate?t.ariaTemplate=e=bt.compile(t.ariaTemplate):ht(t.ariaContent)&&(e=t.ariaContent),e}const kt=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,At={};function St(t){if(At[t])return At[t];const e=[];return t.replace(kt,(function(t,i,s,o){e.push(void 0!==i?i:s||o)})),At[t]=function(t){let i=t;for(let t=0;t<e.length&&i;t++)i=i[e[t]];return i},At[t]}At[void 0]=function(t){return t};const Ct=(t,e)=>t.filter(e);function Tt(t,e){if(t.className){const i=e.split(" ");for(let e=0;e<i.length;e++)if(t.className.indexOf&&-1!==t.className.indexOf(i[e]))return!0}}class Pt{constructor(){this._map=new Map}get(t){return this._map.get(t)}set(t,e){this._map.set(t,e)}}function Mt(t,e){if(e)return e.includes(t)}function Et(t,i,s){return e.r(t+(i-t)*s,3)}const Lt="trigger";class It{constructor(t,e){this.observer=t,this.handlerMap=ut({},this.handlerMap,e)}trigger(t,e){const{observer:i,handlerMap:s}=this;let o;return s[t]?o=this.callObserver(s[t],e):i[Lt]&&(o=this.callObserver(Lt,t,e)),o}callObserver(t,...e){return this.observer[t].apply(this.observer,e)}requiresHandlers(t){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(t);for(let e=0;e<t.length;e++)if(this.handlerMap[t[e]])return!0}}function Rt(t){return"[object Object]"===Object.prototype.toString.call(t)}function Bt(t,i){const s=t.length,o=[];for(let n=0;n<s;n++){let s=i(t[n]);e.d(s)&&o.push(s)}return o}const Ot=e.s.browser||{};function Vt(t){let e=0;return t.wheelDelta?(e=-t.wheelDelta/120,Ot.webkit&&(e/=2*Math.max(window.devicePixelRatio,.625))):t.detail&&(e=t.detail/3),e=e>0?Math.ceil(e):Math.floor(e),e}const{append:Dt,bindEvents:zt,defined:Ft,deg:Ht,elementOffset:Nt,elementSize:jt,eventCoordinates:Ut,eventElement:Gt,hashKey:Wt,last:Xt,limitValue:Yt,objectKey:qt,rad:Zt,round:$t,unbindEvents:Qt,valueOrDefault:Kt}=e.u;class Jt{static fetchFonts(t,e,i={depth:0}){!t||i.depth>5||!document.fonts||Object.keys(t).forEach((function(s){const o=t[s];"dataSource"!==s&&"$"!==s[0]&&o&&("font"===s?e.push(o):"object"==typeof o&&(i.depth++,Jt.fetchFonts(o,e,i),i.depth--))}))}static loadFonts(t,i){let s=[];if(t.length>0&&document.fonts){try{s=t.map((function(t){return document.fonts.load(t)}))}catch(t){e.l(t)}Promise.all(s).then(i,i)}else i()}static preloadFonts(t,e){const i=[];Jt.fetchFonts(t,i),Jt.loadFonts(i,e)}}function te(t,e){const i=t.prototype;i.options?i.options=ut({},i.options,e):i.options=e}const ee="k-i-",ie="k-svg-i-";class se{constructor(t,e){this.element=t,this.options=ut({},this.options,e),this.wrapper()}wrapper(){this.addClasses()}addClasses(){}html(){return this.element.outerHTML}}te(se,{name:"",size:"none",themeColor:"none",flip:"default",iconClass:"",stylingOptions:["size","themeColor","fill"]});class oe extends se{constructor(t,e){super(t,e)}wrapper(){let t=this.element.className.split(" ").find((t=>t.startsWith(ee))),e=this.options.icon?`${this.options.icon.startsWith(ee)?"":ee}${this.options.icon}`:"";this._className=e,K(this.element,"k-icon"),K(this.element,"k-font-icon"),tt(this.element,t),K(this.element,e),K(this.element,this.options.iconClass||""),super.wrapper()}}te(oe,{name:"HTMLFontIcon",icon:null});class ne extends se{constructor(t,e){t.innerHTML="",super(t,e)}wrapper(){let t=this.options.icon,e=this.options.iconClass,i=this.element.className.split(" ").find((t=>t.startsWith(ie)));if(!t&&e){const i=/k-i-(\w+(?:-\w+)*)/;let s=e.match(i);s&&(t=s[1],e=e.replace(s[0],""))}ot(t)&&(t=t.replace("k-i-","").replace(/-./g,(t=>t[1].toUpperCase())),t=this.options.svgIcons[t]||this.options.svgIcons[`${t}Icon`]);let s=t&&t.name?`${ie}${t.name}`:"";if(this._className=s,K(this.element,"k-svg-icon"),tt(this.element,i),K(this.element,s),K(this.element,e||""),this.element.setAttribute("aria-hidden","true"),t&&Rt(t)){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox",t.viewBox||""),e.setAttribute("focusable","false"),e.innerHTML=t.content||"",this.element.appendChild(e)}super.wrapper()}}te(ne,{name:"HTMLSvgIcon",icon:null,svgIcons:{}});const re={svg:ne,font:oe};function ae(t,e){let i=t,s=e;return i&&(!pt(i)||i instanceof HTMLElement)&&!ot(i)||(s=i,i=document.createElement("span")),ot(s)&&(s={icon:s}),s.type||(s.type="svg"),re[s.type]?new re[s.type](i,s).html():null}function le(t){let e=C,i=T;for(let s=0,o=t.length;s<o;s++){const o=t[s];null!==o&&isFinite(o)&&(e=Math.min(e,o),i=Math.max(i,o))}return{min:e===C?void 0:e,max:i===T?void 0:i}}function he(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(e(s,i,t))return s}}const ce=e.M,de=/matrix\((.*)\)/;function ue(t){const e=getComputedStyle(t).transform;return"none"===e?ce.unit():function(t){const e=t.match(de);if(null===e||2!==e.length)return ce.unit();const i=e[1].split(",").map((t=>parseFloat(t)));return new ce(...i)}(e)}function pe(t){if(!t)return ce.unit();let e=ue(t),i=t.parentElement;for(;i;){const t=ue(i);e=e.multiplyCopy(t),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}function ge(t){return new e.C(t).isDark()?U:h}const me={};class fe{constructor(t){this._index={},this._values=t?t.slice(0):[];for(let t=0;t<this._values.length;t++)this._index[this._values[t]]=t}values(){return this._values.filter((t=>t!==me))}has(t){return void 0!==this._index[t]}add(t){this.has(t)||(this._index[t]=this._values.length,this._values.push(t))}delete(t){const e=this._index[t];void 0!==e&&(this._values[e]=me,delete this._index[t])}clear(){this._index={},this._values=[]}get size(){return this._values.length}}class xe{constructor(t){this._set=new Set(t)}values(){return Array.from(this._set)}has(t){return this._set.has(t)}add(t){this._set.add(t)}delete(t){this._set.delete(t)}clear(){this._set.clear()}get size(){return this._set.size}}function ye(t){return(()=>{let t=!1;"function"==typeof Set&&(t=new Set([1]).has(1));return t})()?new xe(t):new fe(t)}function ve(t){throw t}let be={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 we(t,e){return Object.prototype.hasOwnProperty.call(t,e)}class _e{constructor(){this.height=0,this.width=0,this.data=[]}clone(){const t=new _e;return t.height=this.height,t.width=this.width,t.data=this.data.map((t=>t.slice())),t}get(t,e){const i=this.data[t];return i?i[e]:null}set(t,e,i){let s=this.data[t];null==s&&(s=this.data[t]=[]),s[e]=i,t>=this.height&&(this.height=t+1),e>=this.width&&(this.width=e+1)}each(t,e){for(let i=0;i<this.height;++i)for(let s=0;s<this.width;++s){let o=this.get(i,s);if((e||null!=o)&&(o=t(o,i,s),void 0!==o))return o}}map(t,e){const i=new _e;return this.each((function(e,s,o){i.set(s,o,t(e,s,o))}),e),i}transpose(){const t=new _e;return this.each((function(e,i,s){t.set(s,i,e)})),t}unit(t){this.width=this.height=t;const e=this.data=new Array(t);for(let i=t;--i>=0;){const s=e[i]=new Array(t);for(let e=t;--e>=0;)s[e]=i===e?1:0}return this}multiply(t){const e=this,i=new _e;for(let s=0;s<e.height;++s)for(let o=0;o<t.width;++o){let n=0;for(let i=0;i<e.width;++i){const r=e.get(s,i),a=t.get(i,o);"number"==typeof r&&"number"==typeof a&&(n+=r*a)}i.set(s,o,n)}return i}inverse(){const t=this.width,e=this.augment((new _e).unit(t)),i=e.data;for(let e=0;e<t;++e){const s=ke(e,t,(function(t){return i[t][e]}));if(!i[s][e])return null;if(e!==s){let t=i[e];i[e]=i[s],i[s]=t}for(let s=e+1;s<t;++s){for(let o=e+1;o<2*t;++o)i[s][o]-=i[e][o]*i[s][e]/i[e][e];i[s][e]=0}}for(let e=0;e<t;++e)for(let s=i[e][e],o=0;o<2*t;++o)i[e][o]/=s;for(let e=t;--e>=0;)for(let s=e;--s>=0;)if(i[s][e])for(let o=2*t;--o>=t;)i[s][o]-=i[e][o]*i[s][e];return e.slice(0,t,t,t)}augment(t){const e=this.clone(),i=e.width;return t.each((function(t,s,o){e.set(s,o+i,t)})),e}slice(t,e,i,s){const o=new _e;for(let n=0;n<i;++n)for(let i=0;i<s;++i)o.set(n,i,this.get(t+n,e+i));return o}}function ke(t,e,i){let s=i(t),o=t;for(let n=t+1;n<e;n++){const e=i(t);e>s&&(s=e,o=t)}return o}const Ae={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"};function Se(t){return Ae[t]||t}const Ce=t=>t.replace(/([^ ]+)/g,Se);let Te=1;function Pe(){return"kchart"+Te++}function Me(){return Pe()}const Ee=new WeakMap,Le=Symbol("id");function Ie(t,e,i,s,o){!function(t,e,i,s,o){const n=Q(e)?e:(e||"").split(" ");n.forEach((function(e){!function(t,e,i,s,o){let n,r=s;i&&ht(i)&&!s?r=i:i&&function(t){return"string"==typeof t}(i)&&ht(r)&&(n=i);const a=function(e){const i=e.target?e.target.closest(n):null;if(!n||n&&e.target&&i){const s=n?i:e.currentTarget;Object.defineProperty(e,"currentTarget",{value:s}),Object.defineProperty(e,"delegateTarget",{value:t}),r(e)}};r[Le]||(r[Le]=Me());let l=Ee.get(t);l||(l=new Map,Ee.set(t,l));l.set(e+r[Le],a),t.addEventListener(e,a,Boolean(o))}(t,e,i,s,o)}))}(t,e,i,s,o)}function Re(t,e,i,s,o){!function(t,e,i,s){const o=Q(e)?e:(e||"").split(" ");o.forEach((function(e){!function(t,e,i,s){const o=Ee.get(t);if(o&&i&&i[Le]){const n=e+i[Le],r=o.get(n);o.delete(n),r&&t.removeEventListener(e,r,Boolean(s))}}(t,e,i,s)}))}(t,e,i,s)}function Be(){const t=function(t){let e=!1;const i={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},s={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i};for(let o in i){if(t.match(i[o])){if("windows"===o&&"plugins"in navigator)return!1;e={},e.device=o,e.name=Oe(o,s),e[e.name]=!0;break}}return e}(navigator.userAgent),e={};return e.mobileOS=t,e}function Oe(t,e,i){for(let i in e)if(e[i].test(t))return i;return void 0!==i?i:t}function Ve(){}function De(){return(new Date).getTime()}const ze="string",Fe="function";let He=function(){this._defaultPrevented=!0},Ne=function(){return!0===this._defaultPrevented};class je{constructor(){this._events={}}destroy(){this.unbind()}bind(t,e,i){let s,o,n,r,a,l=this,h=typeof t===ze?[t]:t||[],c=typeof e===Fe;if(void 0===e){for(s in t)l.bind(s,t[s]);return l}for(s=0,o=h.length;s<o;s++){let t=h[s];r=c?e:e[t],r&&(i&&(n=r,r=function(){l.unbind(t,r),n.apply(l,arguments)},r.original=n),a=l._events[t]=l._events[t]||[],a.push(r))}return l}one(t,e){return this.bind(t,e,!0)}first(t,e){let i,s,o,n,r=this,a=typeof t===ze?[t]:t,l=typeof e===Fe;for(i=0,s=a.length;i<s;i++){let t=a[i];o=l?e:e[t],o&&(n=r._events[t]=r._events[t]||[],n.unshift(o))}return r}trigger(t,e){let i,s,o=this,n=o._events[t];if(n){let t=e||{};for(t.sender=o,t._defaultPrevented=!1,t.preventDefault=He,t.isDefaultPrevented=Ne,n=n.slice(),i=0,s=n.length;i<s;i++)n[i].call(o,t);return!0===t._defaultPrevented}return!1}unbind(t,e){let i,s=this,o=s._events[t];if(void 0===t)s._events={};else if(o)if(e)for(i=o.length-1;i>=0;i--)o[i]!==e&&o[i].original!==e||o.splice(i,1);else s._events[t]=[];return s}_setEvents(t){const e=(this.events||[]).length;for(let i=0;i<e;i++){let e=this.events[i];this.options[e]&&t[e]&&(this.unbind(e,this.options[e]),this._events&&this._events[e]&&delete this._events[e])}this.bind(this.events,t)}}const Ue=Object.assign,Ge=t=>{t.preventDefault()};let We=800,Xe=0,Ye="press",qe="hold",Ze="select",$e="start",Qe="move",Ke="end",Je="cancel",ti="tap",ei="doubleTap",ii="release",si="gesturechange",oi="gestureend",ni="gesturetap",ri={api:0,touch:0,mouse:9,pointer:9};function ai(t){let e=[],i=t.originalEvent||t,s=t.currentTarget;return t.api?e.push({id:2,event:t,target:t.target,currentTarget:t.target,location:t,type:"api"}):e.push({location:i,event:t,target:t.target,currentTarget:s,id:i.pointerId,type:"pointer"}),e}class li{constructor(t,e){let i=this;i.support=Be(),i.invalidZeroEvents=this.support.mobileOS&&this.support.mobileOS.android,i.axis=t,i._updateLocationData(e),i.startLocation=i.location,i.velocity=i.delta=0,i.timeStamp=De()}move(t){let e=this,i=t["page"+e.axis],s=De(),o=s-e.timeStamp||1;!i&&this.invalidZeroEvents||(e.delta=i-e.location,e._updateLocationData(t),e.initialDelta=i-e.startLocation,e.velocity=e.delta/o,e.timeStamp=s)}_updateLocationData(t){let e=this,i=e.axis;e.location=t["page"+i],e.client=t["client"+i],e.screen=t["screen"+i]}}class hi{constructor(t,e,i){Ue(this,{x:new li("X",i.location),y:new li("Y",i.location),type:i.type,threshold:t.threshold||ri[i.type],userEvents:t,target:e,currentTarget:i.currentTarget,initialTouch:i.target,id:i.id,pressEvent:i,_clicks:t._clicks,supportDoubleTap:t.supportDoubleTap,_moved:!1,_finished:!1})}press(){this._holdTimeout=setTimeout((()=>this._hold()),this.userEvents.minHold),this._trigger(Ye,this.pressEvent)}_tap(t){let e=this;e.userEvents._clicks++,1===e.userEvents._clicks&&(e._clickTimeout=setTimeout((function(){1===e.userEvents._clicks?e._trigger(ti,t):e._trigger(ei,t),e.userEvents._clicks=0}),300))}_hold(){this._trigger(qe,this.pressEvent)}move(t){let e=this,i="api"!==t.type&&e.userEvents._shouldNotMove;if(!e._finished&&!i){if(e.x.move(t.location),e.y.move(t.location),!e._moved){if(e._withinIgnoreThreshold())return;if(di.current&&di.current!==e.userEvents)return e.dispose();e._start(t)}e._finished||e._trigger(Qe,t)}}end(t){this.endTime=De(),this._finished||(this._finished=!0,this._trigger(ii,t),this._moved?this._trigger(Ke,t):this.supportDoubleTap?this._tap(t):this._trigger(ti,t),clearTimeout(this._holdTimeout),this.dispose())}dispose(){let t=this.userEvents.touches||[];this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout);const e=t.indexOf(this);t.splice(e,1)}skip(){this.dispose()}cancel(){this.dispose()}isMoved(){return this._moved}_start(t){clearTimeout(this._holdTimeout),this.startTime=De(),this._moved=!0,this._trigger($e,t)}_trigger(t,e){const i=e.event,s={touch:this,x:this.x,y:this.y,target:this.target,event:i};this.userEvents.notify(t,s)&&i.preventDefault()}_withinIgnoreThreshold(){let t=this.x.initialDelta,e=this.y.initialDelta;return Math.sqrt(t*t+e*e)<=this.threshold}}function ci(t){let e=Ae.up.split(" "),i=0,s=e.length;for(;i<s;i++)t(e[i])}class di extends je{constructor(t,e){super();let i,s=this;const o=Be();if(this.support=o,e=e||{},this.options=e,i=s.filter=e.filter,s.threshold=e.threshold||Xe,s.minHold=e.minHold||We,s.touches=[],s._maxTouches=e.multiTouch?2:1,s.allowSelection=e.allowSelection,s.captureUpIfMoved=e.captureUpIfMoved,s._clicks=0,s.supportDoubleTap=e.supportDoubleTap,Ue(s,{element:t,surface:e.surface||t,stopPropagation:e.stopPropagation,pressed:!1}),this._surfaceMoveHandler=this._move.bind(this),Ie(s.surface,Ce("move"),this._surfaceMoveHandler),this._surfaceEndHandler=this._end.bind(this),Ie(s.surface,Ce("up cancel"),this._surfaceEndHandler),this._elementStartHandler=this._start.bind(this),Ie(t,Ce("down"),i,this._elementStartHandler),t.style["touch-action"]=e.touchAction||"none",e.preventDragEvent&&(this._elementDragStartHandler=Ge,Ie(t,Ce("dragstart"),this._elementDragStartHandler)),this._elementSelectHandler=this._select.bind(this),Ie(t,Ce("mousedown"),i,this._elementSelectHandler),s.captureUpIfMoved){let t=s.surface;s._preventIfMovingProxy=s.preventIfMoving.bind(s),ci((function(e){t.addEventListener(e,s._preventIfMovingProxy,!0)}))}s.bind([Ye,qe,ti,ei,$e,Qe,Ke,ii,Je,"gesturestart",si,oi,ni,Ze],e)}preventIfMoving(t){this._isMoved()&&t.preventDefault()}destroy(){let t=this;const e=this.options,i=this.element;if(!t._destroyed){if(t._destroyed=!0,t.captureUpIfMoved){let e=t.surface;ci((function(i){e.removeEventListener(i,t._preventIfMovingProxy,!0)}))}Re(t.surface,Ce("move"),this._surfaceMoveHandler),Re(t.surface,Ce("up cancel"),this._surfaceEndHandler),Re(i,Ce("down"),this._elementStartHandler),e.preventDragEvent&&Re(i,Ce("dragstart"),this._elementDragStartHandler),Re(i,Ce("mousedown"),this._elementSelectHandler),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget}}capture(){di.current=this}cancel(){this._disposeAll(),this.trigger(Je)}notify(t,e){let i=this.touches,s=t;if(this._isMultiTouch()){switch(s){case Qe:s=si;break;case Ke:s=oi;break;case ti:s=ni}Ue(e,{touches:i},function(t,e){let i=t.x.location,s=t.y.location,o=e.x.location,n=e.y.location,r=i-o,a=s-n;return{center:{x:(i+o)/2,y:(s+n)/2},distance:Math.sqrt(r*r+a*a)}}(i[0],i[1]))}return this.trigger(s,Ue(e,{type:s}))}press(t,e,i){this._apiCall("_start",t,e,i)}move(t,e){this._apiCall("_move",t,e)}end(t,e){this._apiCall("_end",t,e)}_isMultiTouch(){return this.touches.length>1}_maxTouchesReached(){return this.touches.length>=this._maxTouches}_disposeAll(){let t=this.touches;for(;t.length>0;)t.pop().dispose()}_isMoved(){return Ct(this.touches,(function(t){return t.isMoved()})).length}_select(t){this.allowSelection&&!this.trigger(Ze,{event:t})||t.preventDefault()}_start(t){if(t.which&&t.which>1||this._maxTouchesReached())return;let e;di.current=null,this.currentTarget=t.currentTarget,this.stopPropagation&&t.stopPropagation();const i=ai(t);for(let t=0;t<i.length&&!this._maxTouchesReached();t++){const s=i[t];if(e=this.filter?s.currentTarget:this.element,e&&0===e.length)continue;const o=new hi(this,e,s);this.touches.push(o),o.press(),this._isMultiTouch()&&this.notify("gesturestart",{})}}_move(t){this._eachTouch("move",t)}_end(t){this._eachTouch("end",t)}_eachTouch(t,e){let i,s,o,n,r={},a=ai(e),l=this.touches;for(i=0;i<l.length;i++)s=l[i],r[s.id]=s;for(i=0;i<a.length;i++)if(o=a[i],n=r[o.id],n){"move"===t&&"pointer"===o.type&&!this.surface.hasPointerCapture(o.id)&&this.surface.setPointerCapture(o.id),n[t](o)}}_apiCall(t,e,i,s){this[t]({api:!0,pageX:e,pageY:i,clientX:e,clientY:i,target:s||this.element,stopPropagation:Ve,preventDefault:Ve})}static defaultThreshold(t){Xe=t}static minHold(t){We=t}}function ui(t,e){let i=$t(e-t,9);if(0===i){if(0===e)return.1;i=Math.abs(e)}const s=Math.pow(10,Math.floor(Math.log(i)/Math.log(10))),o=$t(i/s,f);let n=1;return n=o<1.904762?.2:o<4.761904?.5:o<9.523809?1:2,$t(s*n,f)}let pi=class t{constructor(t,e){this.x=t||0,this.y=e||0}clone(){return new t(this.x,this.y)}equals(t){return t&&this.x===t.x&&this.y===t.y}rotate(t,e){const i=Zt(e),s=Math.cos(i),o=Math.sin(i),{x:n,y:r}=t,{x:a,y:l}=this;return this.x=$t(n+(a-n)*s+(l-r)*o,3),this.y=$t(r+(l-r)*s-(a-n)*o,3),this}multiply(t){return this.x*=t,this.y*=t,this}distanceTo(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}static onCircle(e,i,s){const o=Zt(i);return new t(e.x-s*Math.cos(o),e.y-s*Math.sin(o))}};class gi{constructor(t,e,i,s){this.x1=t||0,this.y1=e||0,this.x2=i||0,this.y2=s||0}equals(t){return this.x1===t.x1&&this.x2===t.x2&&this.y1===t.y1&&this.y2===t.y2}width(){return this.x2-this.x1}height(){return this.y2-this.y1}translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}move(t,e){const i=this.height(),s=this.width();return void 0!==t&&(this.x1=t,this.x2=this.x1+s),void 0!==e&&(this.y1=e,this.y2=this.y1+i),this}wrap(t){return this.x1=Math.min(this.x1,t.x1),this.y1=Math.min(this.y1,t.y1),this.x2=Math.max(this.x2,t.x2),this.y2=Math.max(this.y2,t.y2),this}wrapLimit(t,e,i){return this.x1=Math.min(this.x1,Math.max(this.x1-e,t.x1)),this.y1=Math.min(this.y1,Math.max(this.y1-i,t.y1)),this.x2=Math.max(this.x2,Math.min(this.x2+e,t.x2)),this.y2=Math.max(this.y2,Math.min(this.y2+i,t.y2)),this}wrapPoint(t){const e=Q(t),i=e?t[0]:t.x,s=e?t[1]:t.y;return this.wrap(new gi(i,s,i,s)),this}snapTo(t,e){return e!==W&&e||(this.x1=t.x1,this.x2=t.x2),e!==X&&e||(this.y1=t.y1,this.y2=t.y2),this}alignTo(t,e){const i=this.height(),s=this.width(),o=e===z||e===c?X:W,n=o===X?i:s;if(e===d){const e=t.center(),i=this.center();this.x1+=e.x-i.x,this.y1+=e.y-i.y}else this[o+1]=e===z||e===S?t[o+1]-n:t[o+2];return this.x2=this.x1+s,this.y2=this.y1+i,this}shrink(t,e){return this.x2-=t,this.y2-=e,this}expand(t,e){return this.shrink(-t,-e),this}pad(t){const e=yt(t);return this.x1-=e.left,this.x2+=e.right,this.y1-=e.top,this.y2+=e.bottom,this}unpad(t){const e=yt(t);return e.left=-e.left,e.top=-e.top,e.right=-e.right,e.bottom=-e.bottom,this.pad(e)}clone(){return new gi(this.x1,this.y1,this.x2,this.y2)}center(){return new pi(this.x1+this.width()/2,this.y1+this.height()/2)}containsPoint(t){return t.x>=this.x1&&t.x<=this.x2&&t.y>=this.y1&&t.y<=this.y2}points(){return[new pi(this.x1,this.y1),new pi(this.x2,this.y1),new pi(this.x2,this.y2),new pi(this.x1,this.y2)]}getHash(){return[this.x1,this.y1,this.x2,this.y2].join(",")}overlaps(t){return!(t.y2<this.y1||this.y2<t.y1||t.x2<this.x1||this.x2<t.x1)}rotate(t){let e=this.width(),i=this.height();const{x:s,y:o}=this.center(),n=mi(0,0,s,o,t),r=mi(e,0,s,o,t),a=mi(e,i,s,o,t),l=mi(0,i,s,o,t);return e=Math.max(n.x,r.x,a.x,l.x)-Math.min(n.x,r.x,a.x,l.x),i=Math.max(n.y,r.y,a.y,l.y)-Math.min(n.y,r.y,a.y,l.y),this.x2=this.x1+e,this.y2=this.y1+i,this}toRect(){return new e.R([this.x1,this.y1],[this.width(),this.height()])}hasSize(){return 0!==this.width()&&0!==this.height()}align(t,e,i){return e===W?this.alignX(t,i):this.alignY(t,i),this}alignX(t,e){const i=this.width();e===S?(this.x1=t.x1,this.x2=this.x1+i):e===B?(this.x2=t.x2,this.x1=this.x2-i):e===d&&(this.x1=t.x1+(t.width()-i)/2,this.x2=this.x1+i)}alignY(t,e){const i=this.height();e===z?(this.y1=t.y1,this.y2=this.y1+i):e===c?(this.y2=t.y2,this.y1=this.y2-i):e===d&&(this.y1=t.y1+(t.height()-i)/2,this.y2=this.y1+i)}}function mi(t,e,i,s,o){const n=Zt(o);return new pi(i+(t-i)*Math.cos(n)+(e-s)*Math.sin(n),s-(t-i)*Math.sin(n)+(e-s)*Math.cos(n))}class fi{constructor(t,e,i,s,o){this.center=t,this.innerRadius=e,this.radius=i,this.startAngle=s,this.angle=o}clone(){return new fi(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)}middle(){return this.startAngle+this.angle/2}setRadius(t,e){return e?this.innerRadius=t:this.radius=t,this}point(t,e){const i=Zt(t),s=Math.cos(i),o=Math.sin(i),n=e?this.innerRadius:this.radius,r=$t(this.center.x-s*n,3),a=$t(this.center.y-o*n,3);return new pi(r,a)}adjacentBox(t,e,i){const s=this.clone().expand(t),o=s.middle(),n=s.point(o),r=e/2,a=i/2,l=Math.sin(Zt(o)),h=Math.cos(Zt(o));let c=n.x-r,d=n.y-a;return Math.abs(l)<.9&&(c+=r*-h/Math.abs(h)),Math.abs(h)<.9&&(d+=a*-l/Math.abs(l)),new gi(c,d,c+e,d+i)}containsPoint(t){const e=this.center,i=this.innerRadius,s=this.radius,o=this.startAngle,n=this.startAngle+this.angle,r=t.x-e.x,a=t.y-e.y,l=new pi(r,a),h=this.point(o),c=new pi(h.x-e.x,h.y-e.y),d=this.point(n),u=new pi(d.x-e.x,d.y-e.y),p=$t(r*r+a*a,3);return(c.equals(l)||it(c,l))&&!it(u,l)&&p>=i*i&&p<=s*s}getBBox(){const t=new gi(C,C,T,T),e=$t(this.startAngle%360),i=$t((e+this.angle)%360),s=this.innerRadius,o=[0,90,180,270,e,i].sort(xi),n=o.indexOf(e),r=o.indexOf(i);let a;a=e===i?o:n<r?o.slice(n,r+1):[].concat(o.slice(0,r+1),o.slice(n,o.length));for(let e=0;e<a.length;e++){let i=this.point(a[e]);t.wrapPoint(i),t.wrapPoint(i,s)}return s||t.wrapPoint(this.center),t}expand(t){return this.radius+=t,this}}function xi(t,e){return t-e}class yi extends fi{constructor(t,e,i,s){super(t,0,e,i,s)}expand(t){return super.expand(t)}clone(){return new yi(this.center,this.radius,this.startAngle,this.angle)}setRadius(t){return this.radius=t,this}}class vi{createRing(t,i){const s=t.startAngle+180;let o=t.angle+s;(0===t.angle||t.angle>0&&s===o)&&(o+=.001);const n=new e.P(t.center.x,t.center.y),r=Math.max(t.radius,0),a=Math.max(t.innerRadius,0),l=new e.A(n,{startAngle:s,endAngle:o,radiusX:r,radiusY:r}),h=e.a.fromArc(l,i).close();if(a){l.radiusX=l.radiusY=a;const t=l.pointAt(o);h.lineTo(t.x,t.y),h.arc(o,s,a,a,!0)}else h.lineTo(n.x,n.y);return h}}vi.current=new vi;class bi{constructor(t){this.children=[],this.initOptions(t)}initOptions(t){this.options=ut({},this.options,this.initUserOptions(t))}initUserOptions(t){return t}reflow(t){const e=this.children;let i;for(let s=0;s<e.length;s++){let o=e[s];o.reflow(t),i=i?i.wrap(o.box):o.box.clone()}this.box=i||t}destroy(){const t=this.children;this.animation&&this.animation.destroy();for(let e=0;e<t.length;e++)t[e].destroy()}getRoot(){const t=this.parent;return t?t.getRoot():null}getSender(){const t=this.getService();if(t)return t.sender}getService(){let t=this;for(;t;){if(t.chartService)return t.chartService;t=t.parent}}translateChildren(t,e){const i=this.children,s=i.length;for(let o=0;o<s;o++)i[o].box.translate(t,e)}append(){for(let t=0;t<arguments.length;t++){let e=arguments[t];this.children.push(e),e.parent=this}}renderVisual(){!1!==this.options.visible&&(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(){const t=this.children,e=t.length;for(let i=0;i<e;i++)t[i].renderVisual()}createVisual(){this.visual=new e.G({zIndex:this.options.zIndex,visible:Kt(this.options.visible,!0)})}createAnimation(){this.visual&&this.options.animation&&(this.animation=e.b.create(this.visual,this.options.animation))}appendVisual(t){t.chartElement||(t.chartElement=this),t.options.noclip?this.clipRoot().visual.append(t):void 0!==t.options.zIndex?this.stackRoot().stackVisual(t):this.isStackRoot?this.stackVisual(t):this.visual?this.visual.append(t):this.parent.appendVisual(t)}clipRoot(){return this.parent?this.parent.clipRoot():this}stackRoot(){return this.parent?this.parent.stackRoot():this}stackVisual(t){const e=t.options.zIndex||0,i=this.visual.children,s=i.length;let o;for(o=0;o<s;o++){let t=i[o];if(Kt(t.options.zIndex,0)>e)break}this.visual.insert(o,t)}traverse(t){const e=this.children,i=e.length;for(let s=0;s<i;s++){let i=e[s];t(i),i.traverse&&i.traverse(t)}}closest(t){let e=this,i=!1;for(;e&&!i;)i=t(e),i||(e=e.parent);if(i)return e}renderComplete(){}hasHighlight(){const t=(this.options||{}).highlight;return!(!this.createHighlight||t&&!1===t.visible||!1===this.visible)}toggleHighlight(t,e){const i=(this.options||{}).highlight||{},s=i.visual;let o=this._highlight;if(!o){const t={fill:{color:U,opacity:e||.2},stroke:{color:U,width:1,opacity:e||.2}};if(s){if(o=this._highlight=s(Object.assign(this.highlightVisualArgs(),{createVisual:()=>this.createHighlight(t),sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total})),!o)return}else o=this._highlight=this.createHighlight(t);void 0===o.options.zIndex&&(o.options.zIndex=Kt(i.zIndex,this.options.zIndex)),this.appendVisual(o)}o.visible(t)}toggleFocusHighlight(t){const e=(this.options||{}).focusHighlight||{};let i=this._focusHighlight;if(t||i){if(!i){const t=ge(this.getRoot().options.background),s={fill:{opacity:e.opacity,color:e.color},stroke:Object.assign({},{color:t},e.border),zIndex:e.zIndex};i=this._focusHighlight=this.createFocusHighlight(s),this.appendVisual(i)}i.visible(t)}}createGradientOverlay(t,i,s){const o=new e.a(Object.assign({stroke:{color:"none"},fill:this.createGradient(s),closed:t.options.closed},i));return o.segments.elements(t.segments.elements()),o}createGradient(t){if(this.parent)return this.parent.createGradient(t)}supportsPointInactiveOpacity(){return!0}}bi.prototype.options={};const{dotsPattern:wi,verticalStripesPattern:_i,crosshatchPattern:ki,diagonalStripesPattern:Ai,gridPattern:Si}=e.c,Ci={dots:wi,verticalStripes:_i,crosshatch:ki,diagonalStripes:Ai,grid:Si};function Ti(t,e,i){const s=function(t,e){return ht(t)?t(e):t}(t,i),o=s&&Ci[s.type];return o?o(Object.assign({},e,s)):e}class Pi extends bi{constructor(t){super(t),this.options.margin=yt(this.options.margin),this.options.padding=yt(this.options.padding)}reflow(t){const e=this.options,{width:i,height:s,shrinkToFit:o}=e,n=i&&s,r=e.margin,a=e.padding,l=e.border.width;let h;const c=()=>{this.align(t,W,e.align),this.align(t,X,e.vAlign),this.paddingBox=h.clone().unpad(r).unpad(l)};let d=t.clone();n&&(d.x2=d.x1+i,d.y2=d.y1+s),o&&d.unpad(r).unpad(l).unpad(a),super.reflow(d),h=n?this.box=new gi(0,0,i,s):this.box,o&&n?(c(),d=this.contentBox=this.paddingBox.clone().unpad(a)):(d=this.contentBox=h.clone(),h.pad(a).pad(l).pad(r),c()),this.translateChildren(h.x1-d.x1+r.left+l+a.left,h.y1-d.y1+r.top+l+a.top);const u=this.children;for(let t=0;t<u.length;t++){let e=u[t];e.reflow(e.box)}}align(t,e,i){this.box.align(t,e,i)}hasBox(){const t=this.options;return t.border.width||t.background}createVisual(){super.createVisual();this.options.visible&&this.hasBox()&&this.visual.append(e.a.fromRect(this.paddingBox.toRect(),this.visualStyle()))}visualStyle(){const t=this.options,e=t.border||{};return{stroke:{width:e.width,color:e.color,opacity:Kt(e.opacity,t.opacity),dashType:e.dashType},fill:Ti(t.pattern,{color:t.background,opacity:t.opacity},void 0),cursor:t.cursor}}}function Mi(t,e){e&&(t.options.className=e.className,t.options.role=e.role,t.options.ariaLabel=e.ariaLabel,t.options.ariaRoleDescription=e.ariaRoleDescription,t.options.ariaChecked=e.ariaChecked)}te(Pi,{align:S,vAlign:z,margin:{},padding:{},border:{color:h,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0});class Ei extends Pi{constructor(t,e){super(t),this.pointData=e}getElement(){const{options:t,paddingBox:i}=this,{type:s,rotation:o}=t,n=i.center(),r=i.width()/2,a=i.height()/2;if(!t.visible||!this.hasBox())return null;const l=this.visualStyle();let h;if(s===u)h=new e.e(new e.f([$t(i.x1+r,3),$t(i.y1+a,3)],Math.min(r,a)),l);else if(s===F)h=e.a.fromPoints([[i.x1+r,i.y1],[i.x1,i.y2],[i.x2,i.y2]],l).close();else if(s===p)h=new e.g(l),h.moveTo(i.x1,i.y1).lineTo(i.x2,i.y2),h.moveTo(i.x1,i.y2).lineTo(i.x2,i.y1);else{const o=i.toRect();if(s===O){const e=Kt(t.borderRadius,o.width()/5);o.setCornerRadius(e)}h=e.a.fromRect(o,l)}return o&&h.transform(e.t().rotate(-o,[n.x,n.y])),h.options.zIndex=t.zIndex,h}createElement(){const t=this.options.visual,e=this.pointData||{};let i;return i=t?t({value:e.value,dataItem:e.dataItem,sender:this.getSender(),series:e.series,category:e.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),i}visualOptions(){const t=this.options;return{background:t.background,border:t.border,margin:t.margin,padding:t.padding,type:t.type,size:t.width,visible:t.visible}}createVisual(){this.visual=this.createElement(),Mi(this.visual,this.options.accessibilityOptions)}}te(Ei,{type:u,align:d,vAlign:d});const Li="radial",Ii={glass:{type:"linear",rotation:0,stops:[{offset:0,color:U,opacity:0},{offset:.25,color:U,opacity:.3},{offset:1,color:U,opacity:0}]},sharpBevel:{type:Li,stops:[{offset:0,color:U,opacity:.55},{offset:.65,color:U,opacity:0},{offset:.95,color:U,opacity:.25}]},roundedBevel:{type:Li,stops:[{offset:.33,color:U,opacity:.06},{offset:.83,color:U,opacity:.2},{offset:.95,color:U,opacity:0}]},roundedGlass:{type:Li,supportVML:!1,stops:[{offset:0,color:U,opacity:0},{offset:.5,color:U,opacity:.3},{offset:.99,color:U,opacity:0}]},sharpGlass:{type:Li,supportVML:!1,stops:[{offset:0,color:U,opacity:.2},{offset:.15,color:U,opacity:.15},{offset:.17,color:U,opacity:.35},{offset:.85,color:U,opacity:.05},{offset:.87,color:U,opacity:.15},{offset:.99,color:U,opacity:0}]},bubbleShadow:{type:Li,center:[.5,.5],radius:.5}};function Ri(t,e){if(t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2)return e;const i=Math.min(t.x1,e.x1),s=Math.max(t.x1,e.x1),o=Math.min(t.x2,e.x2),n=Math.max(t.x2,e.x2),r=Math.min(t.y1,e.y1),a=Math.max(t.y1,e.y1),l=Math.min(t.y2,e.y2),h=Math.max(t.y2,e.y2),c=[];return c[0]=new gi(s,r,o,a),c[1]=new gi(i,a,s,l),c[2]=new gi(o,a,n,l),c[3]=new gi(s,l,o,h),t.x1===i&&t.y1===r||e.x1===i&&e.y1===r?(c[4]=new gi(i,r,s,a),c[5]=new gi(o,l,n,h)):(c[4]=new gi(o,r,n,a),c[5]=new gi(i,l,s,h)),Ct(c,(function(t){return t.height()>0&&t.width()>0}))[0]}class Bi extends bi{constructor(t){super(t);const e=this.options;e.width=parseInt(e.width,10),e.height=parseInt(e.height,10),this.gradients={}}reflow(){const{options:t,children:e}=this;let i=new gi(0,0,t.width,t.height);this.box=i.unpad(t.margin);for(let t=0;t<e.length;t++)e[t].reflow(i),i=Ri(i,e[t].box)||new gi}createVisual(){this.visual=new e.G,this.createBackground()}createBackground(){const t=this.options,i=t.border||{},s=this.box.clone().pad(t.margin).unpad(i.width),o=e.a.fromRect(s.toRect(),{stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(o)}getRoot(){return this}createGradient(t){const i=this.gradients,s=qt(t),o=Ii[t.gradient];let n;if(i[s])n=i[s];else{const r=Object.assign({},o,t);"linear"===o.type?n=new e.L(r):(t.innerRadius&&(r.stops=function(t){const e=t.stops,i=t.innerRadius/t.radius*100,s=e.length,o=[];for(let t=0;t<s;t++){let s=Object.assign({},e[t]);s.offset=(s.offset*(100-i)+i)/100,o.push(s)}return o}(r)),n=new e.h(r),n.supportVML=!1!==o.supportVML),i[s]=n}return n}cleanGradients(){const t=this.gradients;for(let e in t)t[e]._observers=[]}size(){const t=this.options;return new gi(0,0,t.width,t.height)}}te(Bi,{width:x,height:400,background:U,border:{color:h,width:0},margin:yt(5),zIndex:-2});class Oi extends bi{constructor(t){super(t),this._initDirection()}_initDirection(){const t=this.options;t.vertical?(this.groupAxis=W,this.elementAxis=X,this.groupSizeField=G,this.elementSizeField=_,this.groupSpacing=t.spacing,this.elementSpacing=t.vSpacing):(this.groupAxis=X,this.elementAxis=W,this.groupSizeField=_,this.elementSizeField=G,this.groupSpacing=t.vSpacing,this.elementSpacing=t.spacing)}reflow(t){this.box=t.clone(),this.reflowChildren()}reflowChildren(){const{box:t,elementAxis:e,groupAxis:i,elementSizeField:s,groupSizeField:o}=this,{groups:n,groupsSize:r,maxGroupElementsSize:a}=this.groupOptions(),l=n.length,h=t[i+1]+this.alignStart(r,t[o]());if(l){let c=h;for(let r=0;r<l;r++){let a=n[r],l=a.groupElements,h=t[e+1],d=l.length;for(let t=0;t<d;t++){let n=l[t],r=this.elementSize(n),d=c+this.alignStart(r[o],a.groupSize),u=new gi;u[i+1]=d,u[i+2]=d+r[o],u[e+1]=h,u[e+2]=h+r[s],n.reflow(u),h+=r[s]+this.elementSpacing}c+=a.groupSize+this.groupSpacing}t[i+1]=h,t[i+2]=h+r,t[e+2]=t[e+1]+a}}alignStart(t,e){let i=0;const s=this.options.align;return s===B||s===c?i=e-t:s===d&&(i=(e-t)/2),i}groupOptions(){const{box:t,children:e,elementSizeField:i,groupSizeField:s,elementSpacing:o,groupSpacing:n}=this,r=$t(t[i]()),a=e.length,l=[];let h=0,c=0,d=0,u=0,p=[];for(let g=0;g<a;g++){let a=e[g];a.box||a.reflow(t);let m=this.elementSize(a);this.options.wrap&&$t(c+o+m[i])>r&&(l.push({groupElements:p,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),d+=n+h,h=0,c=0,p=[]),h=Math.max(h,m[s]),c>0&&(c+=o),c+=m[i],p.push(a)}return l.push({groupElements:p,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),d+=h,{groups:l,groupsSize:d,maxGroupElementsSize:u}}elementSize(t){return{width:t.box.width(),height:t.box.height()}}createVisual(){}}te(Oi,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});const Vi=e.T;let Di=class extends bi{constructor(t,e){super(e),this.content=t,this.reflow(new gi)}reflow(t){const i=this.options,s=i.size=e.m(this.content,{font:i.font});this.baseline=s.baseline,this.box=new gi(t.x1,t.y1,t.x1+s.width,t.y1+s.height)}createVisual(){const{font:t,color:e,opacity:i,cursor:s,stroke:o,paintOrder:n}=this.options;this.visual=new Vi(this.content,this.box.toRect().topLeft(),{font:t,fill:{color:e,opacity:i},cursor:s,stroke:o,paintOrder:n})}};function zi(t){const e=t.origin,i=t.bottomRight();return new gi(e.x,e.y,i.x,i.y)}te(Di,{font:m,color:h});const Fi=/\n/m;class Hi extends Pi{constructor(t,e,i){super(e),this.content=t,this.data=i,this._initContainer(),!1!==this.options._autoReflow&&this.reflow(new gi)}_initContainer(){const t=this.options,e=String(this.content).split(Fi),i=new Oi({vertical:!0,align:t.align,wrap:!1}),s=ut({},t,{opacity:1,animation:null});this.container=i,this.append(i);for(let t=0;t<e.length;t++){let o=new Di(e[t].trim(),s);i.append(o)}}reflow(t){const i=this.options,s=i.visual;if(this.container.options.align=i.align,s&&!this._boxReflow){let o=t;o.hasSize()||(this._boxReflow=!0,this.reflow(o),this._boxReflow=!1,o=this.box);const n=this.visual=s(this.visualContext(o));n&&(o=zi(n.clippedBBox()||new e.R),n.options.zIndex=i.zIndex),this.box=this.contentBox=this.paddingBox=o}else if(super.reflow(t),i.rotation){const e=yt(i.margin);let s=this.box.unpad(e);this.targetBox=t,this.normalBox=s.clone(),s=this.rotate(),s.translate(e.left-e.right,e.top-e.bottom),this.rotatedBox=s.clone(),s.pad(e)}}createVisual(){const t=this.options;if(this.visual=new e.G({transform:this.rotationTransform(),zIndex:t.zIndex,noclip:t.noclip}),this.hasBox()){const t=e.a.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(t)}}renderVisual(){if(this.options.visible)if(this.options.visual){const t=this.visual;t&&!Ft(t.options.noclip)&&(t.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else super.renderVisual()}visualContext(t){const e={text:this.content,rect:t.toRect(),sender:this.getSender(),options:this.options,createVisual:()=>(this._boxReflow=!0,this.reflow(t),this._boxReflow=!1,this.getDefaultVisual())};return this.data&&Object.assign(e,this.data),e}getDefaultVisual(){this.createVisual(),this.renderChildren();const t=this.visual;return delete this.visual,t}rotate(){const t=this.options;return this.box.rotate(t.rotation),this.align(this.targetBox,W,t.align),this.align(this.targetBox,X,t.vAlign),this.box}rotationTransform(){const t=this.options.rotation;if(!t)return null;const{x:i,y:s}=this.normalBox.center(),o=this.rotatedBox.center();return e.t().translate(o.x-i,o.y-s).rotate(t,[i,s])}}let Ni=class t extends bi{constructor(t){super(t),this._textBox=new Hi(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})),this.append(this._textBox)}reflow(t){super.reflow(t),this.box.snapTo(t,W)}static buildTitle(e,i){let s,o=e;return"string"==typeof e&&(o={text:e}),o=Object.assign({visible:!0},i,o),o&&o.visible&&o.text&&(s=new t(o)),s}static orderTitles(t){const e=[].concat(t),i=e.filter((t=>t&&t.options.position!==c)),s=e.filter((t=>t&&t.options.position===c));return ji(i),ji(s),s.reverse(),i.concat(s)}};function ji(t){for(let e=1;e<t.length;e++){const i=t[e]._textBox,s=t[e-1]._textBox;s.options.margin=Object.assign(yt(s.options.margin),{bottom:0}),i.options.margin=Object.assign(yt(i.options.margin),{top:0})}}te(Ni,{color:h,position:z,align:d,margin:yt(5),padding:yt(5)});class Ui extends Hi{constructor(t,e,i,s,o){super(e,o),this.text=e,this.value=t,this.index=i,this.dataItem=s,this.reflow(new gi)}visualContext(t){const e=super.visualContext(t);return e.value=this.value,e.dataItem=this.dataItem,e.format=this.options.format,e.culture=this.options.culture,e}click(t,e){t.trigger(l,{element:Gt(e),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})}rotate(){if(this.options.alignRotation!==d){const t=this.normalBox.toRect(),e=this.rotationTransform();this.box=zi(t.bbox(e.matrix()))}else super.rotate();return this.box}rotationTransform(){const t=this.options,i=t.rotation;if(!i)return null;if(t.alignRotation===d)return super.rotationTransform();const s=e.t().rotate(i).matrix(),o=this.normalBox.toRect(),n=this.targetBox.toRect(),r=t.rotationOrigin||z,a=r===z||r===c?W:X,l=r===z||r===c?X:W,h=r===z||r===S?n.origin:n.bottomRight(),u=o.topLeft().transformCopy(s),p=o.topRight().transformCopy(s),g=o.bottomRight().transformCopy(s),m=o.bottomLeft().transformCopy(s),x=e.R.fromPoints(u,p,g,m),y={[l]:n.origin[l]-x.origin[l]},v=Math.abs(u[l]+y[l]-h[l]),b=Math.abs(p[l]+y[l]-h[l]);let w,_;$t(v,f)===$t(b,f)?(w=u,_=p):b<v?(w=p,_=g):(w=u,_=m);const k=w[a]+(_[a]-w[a])/2;return y[a]=n.center()[a]-k,e.t().translate(y.x,y.y).rotate(i)}}te(Ui,{_autoReflow:!1});class Gi extends Pi{constructor(t,e,i){super(e),this.fields=t,this.chartService=i,this.render()}hide(){this.options.visible=!1}show(){this.options.visible=!0}render(){const t=this.options;if(t.visible){const{label:e,icon:i}=t,s=new gi,o=()=>this;let n,r,a=i.size,l=this.fields.text;if(Ft(e)&&e.visible){const t=wt(e);t?l=t(this.fields):e.format&&(l=this.chartService.format.auto(e.format,l)),e.color||(e.color=e.position===k?"#fff":i.background),this.label=new Hi(l,ut({},e)),this.label.aliasFor=o,e.position!==k||Ft(a)||(i.type===u?a=Math.max(this.label.box.width(),this.label.box.height()):(n=this.label.box.width(),r=this.label.box.height()),s.wrap(this.label.box))}i.width=n||a||7,i.height=r||a||7;const h=new Ei(ut({},i));h.aliasFor=o,this.marker=h,this.append(h),this.label&&this.append(this.label),h.reflow(new gi),this.wrapperBox=s.wrap(h.box)}}reflow(t){const{options:e,label:i,marker:s,wrapperBox:o}=this,n=t.center(),r=e.line.length,a=e.position;if(e.visible){let l,h,d;Mt(a,[S,B])?a===S?(d=o.alignTo(t,a).translate(-r,t.center().y-o.center().y),e.line.visible&&(l=[t.x1,n.y],this.linePoints=[l,[d.x2,n.y]],h=d.clone().wrapPoint(l))):(d=o.alignTo(t,a).translate(r,t.center().y-o.center().y),e.line.visible&&(l=[t.x2,n.y],this.linePoints=[l,[d.x1,n.y]],h=d.clone().wrapPoint(l))):a===c?(d=o.alignTo(t,a).translate(t.center().x-o.center().x,r),e.line.visible&&(l=[n.x,t.y2],this.linePoints=[l,[n.x,d.y1]],h=d.clone().wrapPoint(l))):(d=o.alignTo(t,a).translate(t.center().x-o.center().x,-r),e.line.visible&&(l=[n.x,t.y1],this.linePoints=[l,[n.x,d.y2]],h=d.clone().wrapPoint(l))),s&&s.reflow(d),i&&(i.reflow(d),s&&(e.label.position===R&&i.box.alignTo(s.box,a),i.reflow(i.box))),this.contentBox=d,this.targetBox=t,this.box=h||d}}createVisual(){super.createVisual(),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()}renderVisual(){const t=this.options,e=t.visual;t.visible&&e?(this.visual=e(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:t.background,border:t.background,icon:t.icon,label:t.label,line:t.line,position:t.position,visible:t.visible},createVisual:()=>{this.createVisual(),this.renderChildren();const t=this.visual;return delete this.visual,t}})),this.addVisual()):super.renderVisual()}createLine(){const t=this.options.line;if(this.linePoints){const i=e.a.fromPoints(this.linePoints,{stroke:{color:t.color,width:t.width,dashType:t.dashType}});et(i),this.visual.append(i)}}click(t,e){const i=this.eventArgs(e);t.trigger(M,i)||e.preventDefault()}over(t,e){const i=this.eventArgs(e);t.trigger(E,i)||e.preventDefault()}out(t,e){const i=this.eventArgs(e);t.trigger(L,i)}eventArgs(t){const e=this.options;return Object.assign(this.fields,{element:Gt(t),text:Ft(e.label)?e.label.text:"",visual:this.visual})}}te(Gi,{icon:{visible:!0,type:u},label:{position:k,visible:!0,align:d,vAlign:d},line:{visible:!0},visible:!0,position:z,zIndex:2});const Wi={format:(t,e)=>e,toString:t=>t,parseDate:t=>new Date(t),firstDay:()=>0};let Xi=Wi;class Yi{static register(t){Xi=t}static get implementation(){return Xi}}const qi=/\{(\d+)(:[^\}]+)?\}/g;class Zi{constructor(t){this._intlService=t}get intl(){return this._intlService||Yi.implementation}set intl(t){this._intlService=t}auto(t,...e){const i=this.intl;return ot(t)&&t.match(w)?i.format(t,...e):i.toString(e[0],t)}localeAuto(t,e,i){const s=this.intl;let o;return o=ot(t)&&t.match(w)?t.replace(qi,(function(t,o,n){let r=e[parseInt(o,10)];return s.toString(r,n?n.substring(1):"",i)})):s.toString(e[0],t,i),o}}class $i{constructor(t,e={}){this._intlService=e.intlService,this.sender=e.sender||t,this.format=new Zi(e.intlService),this.chart=t,this.rtl=Boolean(e.rtl)}get intl(){return this._intlService||Yi.implementation}set intl(t){this._intlService=t,this.format.intl=t}notify(t,e){this.chart&&this.chart.trigger(t,e)}isPannable(t){const e=((this.chart||{}).options||{}).pannable;return e&&e.lock!==t}}let Qi;class Ki{static register(t){Qi=t}static create(t,e){let i;return i=Qi?Qi.create(t,e):new di(t,Object.assign({},{multiTouch:!0,touchAction:"manipulation"},e)),i}}var Ji=Object.freeze({__proto__:null,ChartService:$i,DomEventsBuilder:Ki,FormatService:Zi,IntlService:Yi,TemplateService:bt});function ts(t,i){const{tickX:s,tickY:o,position:n}=t,r=new e.a({stroke:{width:i.width,color:i.color}});return t.vertical?r.moveTo(s,n).lineTo(s+i.size,n):r.moveTo(n,o).lineTo(n,o+i.size),et(r),r}function es(t,i){const{lineStart:s,lineEnd:o,position:n}=t,r=new e.a({stroke:{width:i.width,color:i.color,dashType:i.dashType}});return t.vertical?r.moveTo(s,n).lineTo(o,n):r.moveTo(n,s).lineTo(n,o),et(r),r}class is extends bi{constructor(t,e=new $i){super(t),this.chartService=e,this.options.visible||(this.options=ut({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=ut({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.minorTickType!==P},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=ut({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.majorTickType!==P},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(t){const e=t.rotation;pt(e)&&(t.alignRotation=e.align,t.rotation=e.angle)}createLabels(){const t=this.options,e=t.vertical?B:d,i=ut({},t.labels,{align:e,zIndex:t.zIndex}),s=Math.max(1,i.step);if(this.clearLabels(),i.visible){this.normalizeLabelRotation(i),"auto"===i.rotation&&(i.rotation=0,t.autoRotateLabels=!0);const e=this.labelsRange();for(let t=e.min;t<e.max;t+=s){const s={index:t,count:e.max};let o=this.createAxisLabel(t,i,s);o&&(this.append(o),this.labels.push(o))}}}clearLabels(){this.children=Ct(this.children,(t=>!(t instanceof Ui))),this.labels=[]}clearTitle(){this.title&&(this.children=Ct(this.children,(t=>t!==this.title)),this.title=void 0)}clear(){this.clearLabels(),this.clearTitle()}lineBox(){const{options:t,box:e}=this,i=t.vertical,s=t.labels.mirror,o=s?e.x1:e.x2,n=s?e.y2:e.y1,r=t.line.width||0;return i?new gi(o,e.y1,o,e.y2-r):new gi(e.x1,n,e.x2-r,n)}createTitle(){const t=this.options,e=ut({rotation:t.vertical?-90:0,text:"",zIndex:1,visualSize:!0},t.title);if(e.visible&&e.text){const t=new Hi(e.text,e);this.append(t),this.title=t}}createNotes(){const t=this.options,e=t.notes,i=e.data||[];this.notes=[];for(let s=0;s<i.length;s++){const o=ut({},e,i[s]);o.value=this.parseNoteValue(o.value);const n=new Gi({value:o.