@boldreports/javascript-reporting-controls
Version:
The Bold Reports by Syncfusion controls for JavaScript contains ReportViewer and ReportDesigner HTML5 and JavaScript reporting controls for enterprise web development
1 lines • 68.2 kB
JavaScript
this.ej=this.ej||{},this.ej.lineargauge=function(e,t,i,o){"use strict";function n(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function r(e,i){var o=document.getElementById("gauge-measuretext");return null===o&&(o=t.createElement("text",{id:"gauge-measuretext"}),document.body.appendChild(o)),o.innerHTML=e,o.style.position="absolute",o.style.fontSize=i.size,o.style.fontWeight=i.fontWeight,o.style.fontStyle=i.fontStyle,o.style.fontFamily=i.fontFamily,o.style.visibility="hidden",o.style.top="-100",o.style.left="0",o.style.whiteSpace="nowrap",new Y(o.clientWidth,o.clientHeight)}function a(e,t,i,o,n,r){return"pointer"===r?e<=o&&e>=n:null!=t&&t<=o&&t>=n&&null!=i&&i<=o&&i>=n}function s(e,t,i,o,n,r){var a=e.getBoundingClientRect(),s=t.getBoundingClientRect(),l=t.id.indexOf("MarkerPointer")>-1?s.height/2:o.isInversed?s.height:0,h=t.id.indexOf("MarkerPointer")>-1?s.width/2:o.isInversed?0:s.width,u=new Y(o.lineBounds.width,o.lineBounds.height),p="drag"===n?r.y-o.lineBounds.y:s.top+l-a.top-o.lineBounds.y,d="drag"===n?r.x-o.lineBounds.x:s.left+h-a.left-o.lineBounds.x,g="Vertical"===i?u.height:u.width,c="Vertical"===i?p:d,m="Vertical"===i?o.isInversed?c/g:1-c/g:o.isInversed?1-c/g:c/g;return m=m*o.visibleRange.delta+o.visibleRange.min}function l(e,o,n){var r=document.getElementById("gauge_path");null===r&&((r=t.createElement("text",{id:"gauge_path"})).style.position="absolute",r.style.top="0px",r.style.left="0px",n.appendChild(r));var a=new i.SvgRenderer("id").createSvg({id:"box_path",width:o.width,height:o.height});a.appendChild(e),r.appendChild(a);var s=e.getBBox();return t.remove(r),s}function h(e){return document.getElementById(e)}function u(e){var i=h(e);i&&t.remove(i)}function p(e){var t=!1;return e.map(function(e,i){e.pointers.map(function(e,i){e.enableDrag&&(t=!0)})}),t}function d(e,t,i,o){var n=(e-o.min)/o.delta;return n="Vertical"===i?t.isInversed?n:1-n:t.isInversed?1-n:n}function g(e){return"font-size:"+e.size+"; font-style:"+e.fontStyle+"; font-weight:"+e.fontWeight+"; font-family:"+e.fontFamily+";opacity:"+e.opacity+"; color:"+e.color+";"}function c(e,i,o){if(t.isNullOrUndefined(e))return null;for(var n=0,r=Object.keys(i);n<r.length;n++){var a=r[n];e=e.split("{"+a+"}").join(m(i[a],o).toString())}return e}function m(e,t){var i;return i=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e,null!==i?i:""}function y(e){return e&&null!==e.match("{value}")?"":e}function f(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(o){i=t.compile(e)}return i}function v(e,t){var i,o;return t.appendChild(e),i=e.offsetWidth,o=e.offsetHeight,t.removeChild(e),new Y(i,o)}function b(e,t,o,n){var r,a={},s=new i.SvgRenderer(""),l="fill:"+o+"; font-size:"+t.size+"; font-style:"+t.fontStyle+" ; font-weight:"+t.fontWeight+"; font-family:"+t.fontFamily+"; text-anchor:"+e.anchor+"; transform:"+e.transform+"; opacity:"+t.opacity+"; dominant-baseline:"+e.baseLine+";";return a={id:e.id,x:e.x,y:e.y,style:l},r=s.createText(a,e.text),n.appendChild(r),r}function x(e,t,i,o){for(var n,r=t-e,a=[10,5,2,1],s=w(i,o),l=r/s,h=Math.pow(10,Math.floor(Math.log(l)/Math.log(10))),u=0,p=a;u<p.length&&(n=h*p[u],!(s<r/n));u++)l=n;return l}function w(e,t){var i=5*("Horizontal"===t?.533:1);return i=Math.max(e*(i/100),1)}function P(e,t){var i,o,n,r,a=[];return a=e.id.replace(t.element.id,"").split("_"),i=parseInt(a[2],10),o=parseInt(a[4],10),n=t.axes[i],r=t.axes[i].pointers[o],{axis:n,axisIndex:i,pointer:r,pointerIndex:o}}function C(e,t){var i=null;return t.forEach(function(t,o){e>=t.start&&t.end>=e&&(i=t.interior)}),i}function S(){return["#ff5985","#ffb133","#fcde0b","#27d5ff","#50c917"]}function T(e,i,o,n,r,a,s,l){var h,u,p=o.width,d=o.height,g=e.x,c=e.y;switch(i){case"Circle":u=(p+d)/4,g="Vertical"===a?s.opposedPosition?"Near"===l.placement?g-u:g+u:"Far"!==l.placement?g-u:g+u:g,c="Vertical"===a?c:s.opposedPosition?"Near"===l.placement?c-u:c+u:"Far"===l.placement?c+u:c-u,t.merge(r,{r:u,cx:g,cy:c});break;case"Diamond":case"Rectangle":g="Horizontal"===a?g-p/2:!s.opposedPosition&&"Far"!==l.placement||s.opposedPosition&&"Near"===l.placement?g-p:g,c="Vertical"===a?c:s.opposedPosition?"Near"===l.placement?c-d/2:c+d/2:"Far"===l.placement?c+d/2:c-d/2,h="Diamond"===i?"M "+g+" "+c+" L "+(g+p/2)+" "+(c-d/2)+" L "+(g+p)+" "+c+" L "+(g+p/2)+" "+(c+d/2)+" L "+g+" "+c+" z":"M "+g+" "+(c-d/2)+" L "+(g+p)+" "+(c-d/2)+" L "+(g+p)+" "+(c+d/2)+" L "+g+" "+(c+d/2)+" L "+g+" "+(c-d/2)+" z",t.merge(r,{d:h});break;case"Triangle":h="Vertical"===a?"M "+g+" "+c+" L"+(g-p)+" "+(c-d/2)+"L"+(g-p)+" "+(c+d/2)+" Z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c-d)+"L"+(g-p/2)+" "+(c-d)+" Z",t.merge(r,{d:h});break;case"InvertedTriangle":h="Vertical"===a?"M "+g+" "+c+" L"+(g+p)+" "+(c-d/2)+"L"+(g+p)+" "+(c+d/2)+" Z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c+d)+"L"+(g-p/2)+" "+(c+d)+" Z",t.merge(r,{d:h});break;case"Arrow":h="Vertical"===a?"M "+g+" "+c+" L"+(g-p/2)+" "+(c-d/2)+" L"+(g-p/2)+" "+(c-d/2+d/4)+" L"+(g-p)+" "+(c-d/2+d/4)+" L"+(g-p)+" "+(c+d/2-d/4)+" L"+(g-p/2)+" "+(c+d/2-d/4)+" L"+(g-p/2)+" "+(c+d/2)+"z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c-d/2)+" L"+(g+p/2-p/4)+" "+(c-d/2)+" L"+(g+p/2-p/4)+" "+(c-d)+" L"+(g-p/2+p/4)+" "+(c-d)+" L"+(g-p/2+p/4)+" "+(c-d/2)+" L"+(g-p/2)+" "+(c-d/2)+"z",t.merge(r,{d:h});break;case"InvertedArrow":h="Vertical"===a?"M "+g+" "+c+"L"+(g+p/2)+" "+(c-d/2)+" L"+(g+p/2)+" "+(c-d/2+d/4)+" L"+(g+p)+" "+(c-d/2+d/4)+" L"+(g+p)+" "+(c+d/2-d/4)+" L"+(g+p/2)+" "+(c+d/2-d/4)+" L"+(g+p/2)+" "+(c+d/2)+"z":"M "+g+" "+c+" L"+(g+p/2)+" "+(c+d/2)+" L"+(g+p/2-p/4)+" "+(c+d/2)+" L"+(g+p/2-p/4)+" "+(c+d)+" L"+(g-p/2+p/4)+" "+(c+d)+" L"+(g-p/2+p/4)+" "+(c+d/2)+" L"+(g-p/2)+" "+(c+d/2)+"z",t.merge(r,{d:h});break;case"Image":t.merge(r,{href:n,height:d,width:p,x:g-p/2,y:c-d/2})}return r}function A(e,t,i,o,n,r,a,s){var l,h,u,p,d,g,c=" ",m=s;switch(t){case"RoundedRectangle":c="M "+(l=e.x)+" "+(m+(h=e.y))+" Q "+l+" "+h+" "+(l+m)+" "+h+" ",c+="L "+(l+(u=e.width)-m)+" "+h+" Q "+(l+u)+" "+h+" "+(l+u)+" "+(h+m)+" ",c+="L "+(l+u)+" "+(h+(p=e.height)-m)+" Q "+(l+u)+" "+(h+p)+" "+(l+u-m)+" "+(h+p)+" ",c+=" L "+(l+m)+" "+(h+p)+" Q "+l+" "+(h+p)+" "+l+" "+(h+p-m)+" ",c+="L "+l+" "+(m+h)+" z";break;case"Thermometer":var y="Vertical"===i?e.width:e.height;if(d=y+y/2/Math.PI,g=y/2,"Vertical"===i){var f=r+r/2/Math.PI-d,v="bar"===n?e.y+f:e.y,b="bar"===n?e.y+(g-g/Math.PI):e.y,x=e.height;c="M"+e.x+" "+(v+x)+" A "+d+" "+d+", 0, 1, 0, "+(e.x+e.width)+" "+(v+x)+" L "+(e.x+e.width)+" "+b+" A "+g+" "+g+", 0, 1, 0, "+e.x+" "+b+" z "}else{var w="bar"!==n||a.isInversed?e.x:e.x-(r+r/2/Math.PI-d),P="bar"===n?e.width-(g-g/Math.PI):e.width;c="M"+w+" "+e.y+" A "+d+" "+d+", 0, 1, 0, "+w+" "+(e.y+e.height)+" L "+(("bar"===n?e.x:w)+P)+" "+(e.y+e.height)+" A "+g+" "+g+", 0, 1, 0, "+(("bar"===n?e.x:w)+P)+" "+e.y+" z "}}return c}function B(e){var t;switch(e.toLowerCase()){case"materialdark":case"fabricdark":case"bootstrapdark":t={backgroundColor:"#333232",titleFontColor:"#ffffff",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#000000",labelColor:"#DADADA",lineColor:"#C8C8C8",majorTickColor:"#C8C8C8",minorTickColor:"#9A9A9A",pointerColor:"#9A9A9A"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",tooltipFillColor:"#ffffff",tooltipFontColor:"#000000",labelColor:"#FFFFFF",lineColor:"#FFFFFF",majorTickColor:"#FFFFFF",minorTickColor:"#FFFFFF",pointerColor:"#FFFFFF"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",labelColor:"#212529",lineColor:"#ADB5BD",majorTickColor:"#ADB5BD",minorTickColor:"#CED4DA",pointerColor:"#6C757D",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",labelFontFamily:"HelveticaNeue",tooltipFillOpacity:1,tooltipTextOpacity:.9,containerBackground:"#F8F9FA"};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",tooltipFillColor:"#FFFFF",tooltipFontColor:"#FFFFFF",labelColor:"#686868",lineColor:"#a6a6a6",majorTickColor:"#a6a6a6",minorTickColor:"#a6a6a6",pointerColor:"#a6a6a6",containerBackground:"#e0e0e0"}}return t}var k=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),L=function(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("16px")],i.prototype,"size",void 0),L([t.Property("")],i.prototype,"color",void 0),L([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),L([t.Property("Regular")],i.prototype,"fontWeight",void 0),L([t.Property("Normal")],i.prototype,"fontStyle",void 0),L([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property(10)],i.prototype,"left",void 0),L([t.Property(10)],i.prototype,"right",void 0),L([t.Property(10)],i.prototype,"top",void 0),L([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),I=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property(null)],i.prototype,"color",void 0),L([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("")],i.prototype,"content",void 0),L([t.Property(0)],i.prototype,"x",void 0),L([t.Property(0)],i.prototype,"y",void 0),L([t.Property("None")],i.prototype,"verticalAlignment",void 0),L([t.Property("None")],i.prototype,"horizontalAlignment",void 0),L([t.Property("-1")],i.prototype,"zIndex",void 0),L([t.Complex({size:"12px",color:null},O)],i.prototype,"font",void 0),L([t.Property(null)],i.prototype,"axisIndex",void 0),L([t.Property(null)],i.prototype,"axisValue",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("Normal")],i.prototype,"type",void 0),L([t.Property(0)],i.prototype,"height",void 0),L([t.Property(0)],i.prototype,"width",void 0),L([t.Property(10)],i.prototype,"roundedCornerRadius",void 0),L([t.Property("transparent")],i.prototype,"backgroundColor",void 0),L([t.Complex({width:1,color:"#bfbfbf"},I)],i.prototype,"border",void 0),L([t.Property(0)],i.prototype,"offset",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property(!1)],i.prototype,"enable",void 0),L([t.Property("")],i.prototype,"fill",void 0),L([t.Complex({color:"",size:"13px"},O)],i.prototype,"textStyle",void 0),L([t.Property(null)],i.prototype,"format",void 0),L([t.Property(null)],i.prototype,"template",void 0),L([t.Property(!0)],i.prototype,"enableAnimation",void 0),L([t.Complex({},I)],i.prototype,"border",void 0),i}(t.ChildProperty),F=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),M=function(e,t,i,o){var n,r=arguments.length,a=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(r<3?n(a):r>3?n(t,i,a):n(t,i))||a);return r>3&&a&&Object.defineProperty(t,i,a),a},j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),M([t.Property("")],i.prototype,"dashArray",void 0),M([t.Property(null)],i.prototype,"height",void 0),M([t.Property(2)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(0)],i.prototype,"offset",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),M([t.Complex({size:"12px",color:null},O)],i.prototype,"font",void 0),M([t.Property(!1)],i.prototype,"useRangeColor",void 0),M([t.Property("")],i.prototype,"format",void 0),M([t.Property(0)],i.prototype,"offset",void 0),M([t.Property("Auto")],i.prototype,"position",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),M([t.Property(0)],i.prototype,"start",void 0),M([t.Property(0)],i.prototype,"end",void 0),M([t.Property("Outside")],i.prototype,"position",void 0),M([t.Property("")],i.prototype,"color",void 0),M([t.Property(10)],i.prototype,"startWidth",void 0),M([t.Property(10)],i.prototype,"endWidth",void 0),M([t.Property(0)],i.prototype,"offset",void 0),M([t.Complex({color:"#000000",width:0},I)],i.prototype,"border",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),M([t.Property(20)],i.prototype,"height",void 0),M([t.Property(2)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"interval",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(null)],i.prototype,"offset",void 0),M([t.Property("Auto")],i.prototype,"position",void 0),i}(t.ChildProperty),U=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.animationComplete=!0,t.currentValue=null,t}return F(i,e),M([t.Property("Marker")],i.prototype,"type",void 0),M([t.Property(null)],i.prototype,"value",void 0),M([t.Property("InvertedTriangle")],i.prototype,"markerType",void 0),M([t.Property(null)],i.prototype,"imageUrl",void 0),M([t.Complex({color:"#808080"},I)],i.prototype,"border",void 0),M([t.Property(10)],i.prototype,"roundedCornerRadius",void 0),M([t.Property("Far")],i.prototype,"placement",void 0),M([t.Property(20)],i.prototype,"height",void 0),M([t.Property(20)],i.prototype,"width",void 0),M([t.Property(null)],i.prototype,"color",void 0),M([t.Property(1)],i.prototype,"opacity",void 0),M([t.Property(0)],i.prototype,"animationDuration",void 0),M([t.Property(!1)],i.prototype,"enableDrag",void 0),M([t.Property(0)],i.prototype,"offset",void 0),M([t.Property("Auto")],i.prototype,"position",void 0),M([t.Property(null)],i.prototype,"description",void 0),i}(t.ChildProperty),G=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.visibleLabels=[],t}return F(i,e),M([t.Property(0)],i.prototype,"minimum",void 0),M([t.Property(100)],i.prototype,"maximum",void 0),M([t.Property(!1)],i.prototype,"isInversed",void 0),M([t.Property(!1)],i.prototype,"showLastLabel",void 0),M([t.Property(!1)],i.prototype,"opposedPosition",void 0),M([t.Complex({},j)],i.prototype,"line",void 0),M([t.Collection([{}],N)],i.prototype,"ranges",void 0),M([t.Collection([{}],U)],i.prototype,"pointers",void 0),M([t.Complex({width:2,height:20},D)],i.prototype,"majorTicks",void 0),M([t.Complex({width:1,height:10},D)],i.prototype,"minorTicks",void 0),M([t.Complex({},V)],i.prototype,"labelStyle",void 0),i}(t.ChildProperty),H=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),W=function(){function e(e,t,i,o){this.min=e,this.max=t,this.interval=i,this.delta=o}return e}(),X=function(){function e(e,t){this.x=e,this.y=t}return e}(),Y=function(){function e(e,t){this.width=e,this.height=t}return e}(),Z=function(){function e(e,t,i,o){this.x=e,this.y=t,this.width=i,this.height=o}return e}(),q=function(){function e(e){this.id=e}return e}(),Q=function(e){function t(t,i,o,n,r,a,s,l){void 0===l&&(l="");var h=e.call(this,t)||this;return h.opacity=r,h.fill=i,h.stroke=n,h["stroke-width"]=o,h["stroke-dasharray"]=a,h.d=s,h.transform=l,h}return H(t,e),t}(q),J=function(){function e(e,t,i,o,n,r,a){this.opacity=o,this.id=e,this.y=n.y,this.x=n.x,this.fill=t,this.stroke=i.color,this["stroke-width"]=i.width,this.height=n.height,this.width=n.width}return e}(),K=function(e){function t(t,i,o,n,r,a,s){void 0===a&&(a="");var l=e.call(this,t)||this;return l.transform="",l.baseLine="auto",l.x=i,l.y=o,l.anchor=n,l.text=r,l.transform=a,l.baseLine=s,l}return H(t,e),t}(q),$=function(){function e(e,t,i){this.text=e,this.value=t,this.size=i}return e}(),ee=function(){function e(e,t){this.align=t,this.axisIndex=e}return e}(),te=function(){function e(e){this.gauge=e}return e.prototype.calculateAxesBounds=function(){var e,t;this.gauge.nearSizes=[],this.gauge.farSizes=[];var i,o,n,r;this.gauge.containerBounds;this.checkThermometer();for(var a=0;a<this.gauge.axes.length;a++)(e=this.gauge.axes[a]).checkAlign=new ee(a,e.opposedPosition?"Far":"Near"),e.opposedPosition?this.gauge.farSizes.push(1):this.gauge.nearSizes.push(1),this.calculateLineBounds(e,a),this.calculateTickBounds(e,a),this.calculateLabelBounds(e,a),e.pointers.length>0&&this.calculatePointerBounds(e,a),e.ranges.length>0&&this.calculateRangesBounds(e,a),t=e.labelBounds,"Vertical"===this.gauge.orientation?(i=e.opposedPosition?e.lineBounds.x:t.x-8,o=e.lineBounds.y,r=e.lineBounds.height,n=Math.abs(e.opposedPosition?t.x+t.width+8-i:e.lineBounds.x-i)):(o=e.opposedPosition?e.lineBounds.y:t.y-t.height-8,i=e.lineBounds.x,n=e.lineBounds.width,r=Math.abs(e.opposedPosition?t.y+8-o:Math.abs(e.lineBounds.y-o))),e.bounds=new Z(i,o,n,r)},e.prototype.calculateLineBounds=function(e,i){var o,n,r,a,s,l,h=e.line.height,u=this.gauge.orientation,p=this.gauge.containerBounds;h=e.line.width>0?h:null,"Vertical"===u?(n=t.isNullOrUndefined(h)?p.y:p.y+(p.height/2-h/2),r=e.line.width,a=t.isNullOrUndefined(h)?p.height:h):(o=t.isNullOrUndefined(h)?p.x:p.x+(p.width/2-h/2),a=e.line.width,r=t.isNullOrUndefined(h)?p.width:h),s=this.checkPreviousAxes(e,i),t.isNullOrUndefined(s)?"Vertical"===u?o=(e.opposedPosition?p.x+p.width:p.x)+e.line.offset:n=(e.opposedPosition?p.y+p.height:p.y)+e.line.offset:(l=this.gauge.axes[s],"Vertical"===u?o=(e.opposedPosition?l.bounds.x+l.bounds.width:l.bounds.x)+e.line.offset:n=(e.opposedPosition?l.bounds.y+l.bounds.height:l.bounds.y)+e.line.offset),e.lineBounds=new Z(o,n,r,a)},e.prototype.calculateTickBounds=function(e,i){var o,n,r,a,s=Math.min(e.minimum,e.maximum),l=Math.max(e.minimum,e.maximum);s=s===l?l-1:s;e.majorTicks.interval;var h=e.lineBounds;r=e.majorTicks,a=e.minorTicks,e.majorInterval=r.interval,e.minorInterval=a.interval;var u="Vertical"===this.gauge.orientation?h.height:h.width,p=("Vertical"===this.gauge.orientation?h.width:h.height)/2;e.majorInterval=t.isNullOrUndefined(e.majorInterval)?x(s,l,u,this.gauge.orientation):r.interval,e.visibleRange=new W(s,l,e.majorInterval,l-s),e.minorInterval=t.isNullOrUndefined(e.minorInterval)?e.majorInterval/2:e.minorInterval,"Vertical"===this.gauge.orientation?(o="Auto"===e.majorTicks.position?(e.opposedPosition?h.x+p:h.x-p-r.height)+r.offset:o,o="Auto"!==e.majorTicks.position?"Cross"===e.majorTicks.position?h.x-r.height/2-r.offset:"Inside"===e.majorTicks.position&&!e.opposedPosition||"Outside"===e.majorTicks.position&&e.opposedPosition?h.x-p-r.height-r.offset:h.x+p+r.offset:o,e.majorTickBounds=new Z(o,h.y,r.height,h.height),o="Auto"===e.minorTicks.position?(e.opposedPosition?h.x+p:h.x-p-a.height)+a.offset:o,o="Auto"!==e.minorTicks.position?"Cross"===e.minorTicks.position?h.x-a.height/2-a.offset:"Inside"===e.minorTicks.position&&!e.opposedPosition||"Outside"===e.minorTicks.position&&e.opposedPosition?h.x-p-a.height-a.offset:h.x+p+a.offset:o,e.minorTickBounds=new Z(o,h.y,a.height,h.height)):(n="Auto"===e.majorTicks.position?(e.opposedPosition?h.y+p:h.y-p-r.height)+r.offset:n,n="Auto"!==e.majorTicks.position?"Cross"===e.majorTicks.position?h.y-r.height/2-r.offset:"Inside"===e.majorTicks.position&&!e.opposedPosition||"Outside"===e.majorTicks.position&&e.opposedPosition?h.y-p-r.height-r.offset:h.y+p+r.offset:n,e.majorTickBounds=new Z(h.x,n,h.width,r.height),n="Auto"===e.minorTicks.position?(e.opposedPosition?h.y+p:h.y-p-a.height)+a.offset:n,n="Auto"!==e.minorTicks.position?"Cross"===e.minorTicks.position?h.y-a.height/2-r.offset:"Inside"===e.minorTicks.position&&!e.opposedPosition||"Outside"===e.minorTicks.position&&e.opposedPosition?h.y-p-a.height-a.offset:h.y+p+a.offset:n,e.minorTickBounds=new Z(h.x,n,h.width,a.height))},e.prototype.calculateLabelBounds=function(e,t){var i,o,n,r,a="Auto"!==e.labelStyle.position&&"Auto"!==e.majorTicks.position&&"Auto"!==e.minorTicks.position,s=a&&e.labelStyle.position===e.minorTicks.position&&e.minorTicks.position!==e.majorTicks.position?e.minorTickBounds:e.majorTickBounds,l=e.labelStyle.offset;if(this.calculateVisibleLabels(e),n=e.maxLabelSize.width,r=e.maxLabelSize.height/2,"Vertical"===this.gauge.orientation){i="Auto"===e.labelStyle.position?(e.opposedPosition?s.x+s.width+5:s.x-n-5)+l:i;var h=s.x,u=("Cross"===e.majorTicks.position||"Cross"===e.minorTicks.position)&&s.width>e.lineBounds.width?s.width/2:e.lineBounds.width/2;h=a&&e.labelStyle.position!==e.minorTicks.position&&e.labelStyle.position!==e.majorTicks.position?"Cross"!==e.minorTicks.position&&"Cross"!==e.majorTicks.position?"Inside"===e.labelStyle.position?s.x-e.lineBounds.width:"Outside"===e.labelStyle.position?s.x+e.lineBounds.width:s.x:"Inside"===e.labelStyle.position?e.lineBounds.x-u:"Outside"===e.labelStyle.position?e.lineBounds.x-s.width+u:s.x:s.x,i="Auto"!==e.labelStyle.position?"Cross"===e.labelStyle.position?e.lineBounds.x-e.maxLabelSize.width/4-l:"Inside"===e.labelStyle.position&&!e.opposedPosition||"Outside"===e.labelStyle.position&&e.opposedPosition?h-n-5-l:h+s.width+5+l:i,o=e.lineBounds.y}else{o="Auto"===e.labelStyle.position?(e.opposedPosition?s.y+s.height+5+r:s.y-5)+l:o;var p=s.y,u=("Cross"===e.majorTicks.position||"Cross"===e.minorTicks.position)&&s.height>e.lineBounds.height?s.height/2:e.lineBounds.height/2;p=a&&e.labelStyle.position!==e.minorTicks.position&&e.labelStyle.position!==e.majorTicks.position?"Cross"!==e.minorTicks.position&&"Cross"!==e.majorTicks.position?"Inside"===e.labelStyle.position?s.y-e.lineBounds.height:"Outside"===e.labelStyle.position?s.y+e.lineBounds.height:s.y:"Inside"===e.labelStyle.position?e.lineBounds.y-u:"Outside"===e.labelStyle.position?e.lineBounds.y-s.height+u:s.y:s.y,o="Auto"!==e.labelStyle.position?"Cross"===e.labelStyle.position?e.lineBounds.y+e.maxLabelSize.height/4-l:"Inside"===e.labelStyle.position&&!e.opposedPosition||"Outside"===e.labelStyle.position&&e.opposedPosition?p-5-l:p+s.height+5+r+l:o,i=e.lineBounds.x}e.labelBounds=new Z(i,o,n,r)},e.prototype.calculatePointerBounds=function(e,t){for(var i,o=e.visibleRange,r=(this.gauge.orientation,e.lineBounds,e.labelBounds,Math.min(o.min,o.max)),s=Math.max(o.min,o.max),l=0;l<e.pointers.length;l++)(i=e.pointers[l]).offset.length>0?i.currentOffset=n(i.offset,"Horizontal"===this.gauge.orientation?this.gauge.availableSize.height/2:this.gauge.availableSize.width/2):i.currentOffset=i.offset,i.currentValue=null!==i.value?i.value<r?r:i.value>s?s:i.value:r,i.width>0&&a(i.currentValue,null,null,o.max,o.min,"pointer")&&this["calculate"+i.type+"Bounds"](t,e,l,i)},e.prototype.calculateMarkerBounds=function(e,t,i,o){var n,r,a=t.lineBounds,s=o.currentOffset,l=t.visibleRange,h=o.placement,u=t.majorTickBounds,p=t.labelBounds,g=o.border.width;"Vertical"===this.gauge.orientation?("Auto"===o.position?(n=t.opposedPosition?"Far"===h?p.x+p.width:"Center"===h?u.x+u.width:a.x:"Near"===h?p.x:"Center"===h?u.x:a.x,n=t.opposedPosition?("Near"===o.placement?n-g:n+g)+s:("Far"===o.placement?n+g:n-g)+s):n="Cross"===o.position?a.x-o.width/2-s:"Inside"===o.position&&!t.opposedPosition||"Outside"===o.position&&t.opposedPosition?a.x-a.width/2-("InvertedTriangle"!==o.markerType&&"Triangle"!==o.markerType?o.width:0)-s:a.x+a.width/2+s,r=d(o.currentValue,t,this.gauge.orientation,l)*a.height+a.y):("Auto"===o.position?(r=t.opposedPosition?"Far"===h?p.y:"Center"===h?u.y+u.height:a.y:"Near"===h?p.y-p.height:"Center"===h?u.y:a.y,r=t.opposedPosition?("Near"===o.placement?r-g:r+g)+s:("Far"===o.placement?r+g:r-g)+s):r="Cross"===o.position?a.y-o.height/2-s:"Inside"===o.position&&!t.opposedPosition||"Outside"===o.position&&t.opposedPosition?a.y-a.height/2-("InvertedTriangle"!==o.markerType&&"Triangle"!==o.markerType?o.height:0)-s:a.y+a.height/2+s,n=d(o.currentValue,t,this.gauge.orientation,l)*a.width+a.x),o.bounds=new Z(n,r,o.width,o.height)},e.prototype.calculateBarBounds=function(e,t,i,o){var n,r,a,s,l,h,u=t.lineBounds,p=t.visibleRange,g=this.gauge.orientation,c=o.currentOffset,m=this.gauge.containerBounds;"Vertical"===g?("Auto"===o.position?(n=m.width>0?m.x+(m.width/2-o.width/2):t.opposedPosition?u.x-o.width-10:u.x+10,n+=c):n="Cross"===o.position?u.x-o.width/2-c:"Inside"===o.position&&!t.opposedPosition||"Outside"===o.position&&t.opposedPosition?u.x-u.width/2-o.width-c:u.x+u.width/2+c,a=d(o.currentValue,t,g,p)*u.height+u.y,s=d(p.min,t,g,p)*u.height+u.y,l=Math.abs(s-a),a=t.isInversed?s:a,h=o.width):("Auto"===o.position?(a=m.height>0?m.y+m.height/2-o.height/2:t.opposedPosition?u.y-o.height-10:u.y+10,a+=c):a="Cross"===o.position?u.y-o.height/2-c:"Inside"===o.position&&!t.opposedPosition||"Outside"===o.position&&t.opposedPosition?u.y-u.height/2-o.height-c:u.y+u.height/2+c,l=o.height,n=d(p.min,t,g,p)*u.width+u.x,r=d(o.currentValue,t,g,p)*u.width+u.x,h=Math.abs(r-n),n=t.isInversed?r:n),o.bounds=new Z(n,a,h,l)},e.prototype.calculateRangesBounds=function(e,t){for(var i,o,r,s,l,h,u,p,g,c,m,y,f,v=e.lineBounds,b=e.visibleRange,x=this.gauge.orientation,w=0;w<e.ranges.length;w++)(i=e.ranges[w]).offset.length>0?i.currentOffset=n(i.offset,"Horizontal"===this.gauge.orientation?this.gauge.availableSize.height/2:this.gauge.availableSize.width/2):i.currentOffset=i.offset,a(null,o=Math.max(i.start,b.min),r=Math.min(i.end,b.max),b.max,b.min,"range")&&(o=Math.min(o,i.end),r=Math.max(o,r),c=i.position,m=i.startWidth,y=i.endWidth,f=this.gauge.rangePalettes.length?this.gauge.rangePalettes:["#ff5985","#ffb133","#fcde0b","#27d5ff","#50c917"],i.interior=i.color?i.color:f[w%f.length],"Vertical"===this.gauge.orientation?(h=v.x+i.currentOffset+("Cross"===c?m/2:"Outside"===c?-v.width/2:"Inside"===c?v.width/2:0),u=d(r,e,x,b)*v.height+v.y,g=d(o,e,x,b)*v.height+v.y,g-=u,s=e.opposedPosition?"Inside"===c?h-m:"Cross"===c?h-m:h+m:"Inside"===c?h+m:h-m,l=e.opposedPosition?"Inside"===c?h-y:"Cross"===c?h-y:h+y:"Inside"===c?h+y:h-y,i.path="M"+h+" "+u+" L "+h+" "+(u+g)+" L "+s+" "+(u+g)+" L "+l+" "+u+" L "+h+" "+u+" z "):(h=d(r,e,x,b)*v.width+v.x,u=e.lineBounds.y+i.currentOffset+("Cross"===c?m/2:"Outside"===c?-v.height/2:"Inside"===c?v.height/2:0),p=h-(p=d(o,e,x,b)*v.width+v.x),s=e.opposedPosition?"Inside"===c?u-m:"Cross"===c?u-m:u+m:"Inside"===c?u+m:u-m,l=e.opposedPosition?"Inside"===c?u-y:"Cross"===c?u-y:u+y:"Inside"===c?u+y:u-y,i.path="M"+h+" "+u+" L "+(h-p)+" "+u+" L "+(h-p)+" "+s+" L "+h+" "+l+" L "+h+" "+u+" z "))},e.prototype.checkPreviousAxes=function(e,t){var i=t-1;return i=i>=0?this.gauge.axes[i].checkAlign.align===e.checkAlign.align?i:this.checkPreviousAxes(e,i):null},e.prototype.calculateVisibleLabels=function(e){e.visibleLabels=[];var t,i,o,n=e.visibleRange.min,a=e.visibleRange.max,s=e.visibleRange.interval,l=e.labelStyle,h=l.format&&null!==l.format.match("{value}");t=this.gauge.intl.getNumberFormat({format:y(l.format),useGrouping:this.gauge.useGroupingSeparator});for(var u=this,p=n;p<=a&&s>0;p+=s)!function(t){i={cancel:!1,name:"axisLabelRender",axis:e,text:h?c(l.format,{value:t},u.gauge):m(t,u.gauge).toString(),value:t};var n=function(i){i.cancel||e.visibleLabels.push(new $(i.text,t,o))};n.bind(u),u.gauge.trigger("axisLabelRender",i,n)}(p);var d=e.visibleLabels.length?e.visibleLabels[e.visibleLabels.length-1].value:null,g=e.visibleRange.max;if(d!==g&&!0===e.showLastLabel){i={cancel:!1,name:"axisLabelRender",axis:e,text:h?l.format.replace(new RegExp("{value}","g"),t(g)):t(g),value:g};var f=function(t){o=r(t.text,e.labelStyle.font),t.cancel||e.visibleLabels.push(new $(t.text,g,o))};f.bind(this),this.gauge.trigger("axisLabelRender",i,f)}this.getMaxLabelWidth(this.gauge,e)},e.prototype.getMaxLabelWidth=function(e,t){t.maxLabelSize=new Y(0,0);for(var i,o=0;o<t.visibleLabels.length;o++)(i=t.visibleLabels[o]).size=r(i.text,t.labelStyle.font),i.size.width>t.maxLabelSize.width&&(t.maxLabelSize.width=i.size.width),i.size.height>t.maxLabelSize.height&&(t.maxLabelSize.height=i.size.height)},e.prototype.checkThermometer=function(){"Thermometer"===this.gauge.container.type&&this.gauge.axes.map(function(e,t){e.isInversed&&e.pointers.map(function(t,i){"Bar"===t.type&&(e.isInversed=!1)})})},e}(),ie=function(){function e(e){this.gauge=e}return e.prototype.performMarkerAnimation=function(e,i,o){var n,r,a=this,s=e,l=i.visibleRange,h="Vertical"===this.gauge.orientation?i.lineBounds.height:i.lineBounds.width,u="Vertical"===this.gauge.orientation?i.lineBounds.y:i.lineBounds.x;"Vertical"===this.gauge.orientation?o.bounds.y=d(o.currentValue,i,this.gauge.orientation,l)*h+u:o.bounds.x=d(o.currentValue,i,this.gauge.orientation,l)*h+u,n=new Q(s.id,null,null,null),n=T(o.bounds,o.markerType,new Y(o.width,o.height),o.imageUrl,n,this.gauge.orientation,i,o);var p,g=o.startValue,c=o.currentValue;g=g===c?l.min:g;var m=Math.abs(g-c),y=n.d;new t.Animation({}).animate(s,{duration:o.animationDuration,progress:function(e){e.timeStamp>=e.delay&&(r=(e.timeStamp-e.delay)/e.duration,p=g<c?g+r*m:g-r*m,"Vertical"===a.gauge.orientation?o.bounds.y=d(p,i,a.gauge.orientation,l)*h+u:o.bounds.x=d(p,i,a.gauge.orientation,l)*h+u,n=T(o.bounds,o.markerType,new Y(o.width,o.height),o.imageUrl,n,a.gauge.orientation,i,o),s.setAttribute("d",n.d))},end:function(e){s.setAttribute("d",y),o.startValue=o.currentValue,o.animationComplete=!0,a.gauge.trigger("animationComplete",{axis:a.gauge.isBlazor?null:i,pointer:o})}})},e.prototype.performBarAnimation=function(e,i,o){var n,r,a,s,l,h,u,p,g,c,m,y,f,v,b=this,x=i.visibleRange,w=e,P="Vertical"===this.gauge.orientation?i.lineBounds.height:i.lineBounds.width,C="Vertical"===this.gauge.orientation?i.lineBounds.y:i.lineBounds.x,S=(new Y(this.gauge.availableSize.width,this.gauge.availableSize.height),o.startValue),T=o.currentValue;S=S===T?x.min:S;var B="",k="",L=w.tagName;n=Math.abs(S-T);var O=d(T,i,this.gauge.orientation,x)*P+C,E=d(x.min,i,this.gauge.orientation,x)*P+C;m="Vertical"===this.gauge.orientation?i.isInversed?E:O:i.isInversed?O:E,c=Math.abs(E-O),"Thermometer"===this.gauge.container.type&&0===S&&(v=w.parentElement.childNodes[1].childNodes[0].childNodes[0],"Vertical"===this.gauge.orientation?(u=v.getAttribute("y"),h=v.getAttribute("height"),g=parseInt(u,10)+parseInt(h,10),v.setAttribute("y",g.toString())):(p=v.getAttribute("x"),y=v.getAttribute("width"),g=parseInt(p,10)+parseInt(y,10),v.setAttribute("width","0"))),B=A(o.bounds,this.gauge.container.type,this.gauge.orientation,new Y(o.bounds.width,o.bounds.height),"bar",this.gauge.container.width,i,o.roundedCornerRadius),new t.Animation({}).animate(w,{duration:o.animationDuration,progress:function(e){e.timeStamp>=e.delay&&(r=(e.timeStamp-e.delay)/e.duration,a=d(l=S<T?S+r*n:S-r*n,i,b.gauge.orientation,x)*P+C,s=d(x.min,i,b.gauge.orientation,x)*P+C,f=Math.abs(a-s),"Vertical"===b.gauge.orientation?(o.bounds.y=i.isInversed?s:a,o.bounds.height=f):(o.bounds.x=i.isInversed?a:s,o.bounds.width=f),"path"===L?(0===S&&"Thermometer"===b.gauge.container.type&&("Vertical"===b.gauge.orientation?v.setAttribute("y",(g-r*parseInt(h,10)).toString()):v.setAttribute("width",(r*parseInt(y,10)).toString())),k=A(o.bounds,b.gauge.container.type,b.gauge.orientation,new Y(o.bounds.width,o.bounds.height),"bar",b.gauge.container.width,i,o.roundedCornerRadius),w.setAttribute("d",k)):"Vertical"===b.gauge.orientation?(w.setAttribute("y",o.bounds.y.toString()),w.setAttribute("height",o.bounds.height.toString())):(w.setAttribute("x",o.bounds.x.toString()),w.setAttribute("width",o.bounds.width.toString())))},end:function(e){"path"===L?0===S&&"Thermometer"===b.gauge.container.type?w.parentElement.children[1].remove():w.setAttribute("d",B):"Vertical"===b.gauge.orientation?(w.setAttribute("y",m.toString()),w.setAttribute("height",c.toString())):(w.setAttribute("x",m.toString()),w.setAttribute("width",c.toString())),o.startValue=o.currentValue,b.gauge.trigger("animationComplete",{axis:b.gauge.isBlazor?null:i,pointer:o})}})},e}(),oe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function o(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(o.prototype=i.prototype,new o)}}(),ne=function(e){function i(t){return e.call(this,t)||this}return oe(i,e),i.prototype.renderAxes=function(){var e,i,o,n=this;this.axisElements=[];var r=this.gauge.svgObject.querySelector("#"+this.gauge.element.id+"_Axis_Collections");r&&t.remove(r),this.axisObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Collections",transform:"translate( 0, 0 )"});for(var a=0;a<this.gauge.axes.length;a++)i=(e=this.gauge.axes[a]).majorTicks,o=e.minorTicks,this.htmlObject=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_Axis_Group_"+a}),this.drawAxisLine(e,this.htmlObject,a),this.drawRanges(e,this.htmlObject,a),this.drawTicks(e,i,this.htmlObject,"MajorTicks",e.majorTickBounds),this.drawTicks(e,o,this.htmlObject,"MinorTicks",e.minorTickBounds),this.drawAxisLabels(e,this.htmlObject),this.drawPointers(e,this.htmlObject,a),this.axisElements.push(this.htmlObject);this.axisElements.forEach(function(e){n.axisObject.appendChild(e)}),this.gauge.svgObject.appendChild(this.axisObject),this.gauge.nearSizes.length!==this.gauge.farSizes.length&&this.gauge.axes.length>1&&this.axisAlign(this.gauge.axes)},i.prototype.axisAlign=function(e){var i,o,n=0,r=0;"Vertical"===this.gauge.orientation?(e.forEach(function(e,t){e.opposedPosition?r+=e.bounds.width:n+=e.bounds.width}),n+=this.gauge.containerBounds.width/2,r+=this.gauge.containerBounds.width/2,i=n/2-r/2,this.axisObject.setAttribute("transform","translate("+i+",0)"),t.isNullOrUndefined(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate("+i+",0)")):(e.forEach(function(e,t){e.opposedPosition?r+=e.bounds.height:n+=e.bounds.height}),n+=this.gauge.containerBounds.height/2,r+=this.gauge.containerBounds.height/2,o=n/2-r/2,this.axisObject.setAttribute("transform","translate(0,"+o+")"),t.isNullOrUndefined(this.gauge.containerObject)||this.gauge.containerObject.setAttribute("transform","translate(0,"+o+")"))},i.prototype.drawAxisLine=function(e,t,i){var o,n=e.lineBounds,r="",a=e.line.color||this.gauge.themeStyle.lineColor;e.line.width>0&&(r="M"+n.x+" "+n.y+" L "+("Vertical"===this.gauge.orientation?n.x:n.x+n.width)+" "+("Vertical"===this.gauge.orientation?n.y+n.height:n.y)+"z",o=new Q(this.gauge.element.id+"_AxisLine_"+i,a,e.line.width,a,1,e.line.dashArray,r),t.appendChild(this.gauge.renderer.drawPath(o)))},i.prototype.drawTicks=function(e,t,i,o,n){for(var r,a,s,l="",h=e.visibleRange,u=e.lineBounds,p=e.majorTicks.color||this.gauge.themeStyle.majorTickColor,g=e.minorTicks.color||this.gauge.themeStyle.minorTickColor,c="MajorTicks"===o?p:g,m="MajorTicks"===o?e.majorInterval:e.minorInterval,y=h.min;y<=h.max&&m>0;y+=m)"MajorTicks"!==o&&"MinorTicks"!==o||("Vertical"===this.gauge.orientation?(a=n.x,r=d(y,e,this.gauge.orientation,h)*u.height+u.y,l=l.concat("M"+a+" "+r+" L"+(a+t.height)+" "+r+" ")):(a=d(y,e,this.gauge.orientation,h)*u.width+u.x,r=n.y,l=l.concat("M"+a+" "+r+" L"+a+" "+(r+t.height)+" ")));s=new Q(this.gauge.element.id+"_"+o+"Line_0",c,t.width,c,1,null,l),i.appendChild(this.gauge.renderer.drawPath(s))},i.prototype.drawAxisLabels=function(e,i){for(var o,n,r,a,s,l,h=e.lineBounds,u=e.labelBounds,p=e.majorTickBounds,g=e.visibleRange,c=this.gauge.themeStyle.labelColor,m=e.labelStyle.offset,y=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisLabelsGroup"}),f=0;f<e.visibleLabels.length;f++)r=e.visibleLabels[f].size,l=e.labelStyle.useRangeColor?C(e.visibleLabels[f].value,e.ranges):null,l=t.isNullOrUndefined(l)?e.labelStyle.font.color||c:l,"Vertical"===this.gauge.orientation?(n=d(e.visibleLabels[f].value,e,this.gauge.orientation,g)*h.height+h.y,o="Auto"===e.labelStyle.position?e.opposedPosition?u.x:p.x-r.width-5+m:u.x,n+=r.height/4):(o=d(e.visibleLabels[f].value,e,this.gauge.orientation,g)*h.width+h.x,n=u.y,a="middle",s=""),e.labelStyle.font.fontFamily=this.gauge.themeStyle.labelFontFamily||e.labelStyle.font.fontFamily,b(new K(this.gauge.element.id+"_AxisLabel_"+f,o,n,a,e.visibleLabels[f].text,null,s),e.labelStyle.font,l,y);i.appendChild(y)},i.prototype.drawPointers=function(e,i,o){var n,r,a,s;a=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_PointersGroup"});for(var l=0;l<e.pointers.length;l++)n=e.pointers[l],r="url(#"+this.gauge.element.id+"_AxisIndex_"+o+"__"+n.type+"ClipRect_"+l+")",t.isNullOrUndefined(n.bounds)||(s=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_AxisIndex_"+o+"_"+n.type+"Pointer_"+l,"clip-path":r}),t.isNullOrUndefined(n.startValue)&&(n.startValue=e.visibleRange.min),this["draw"+n.type+"Pointer"](e,o,n,l,s),a.appendChild(s));i.appendChild(a)},i.prototype.drawMarkerPointer=function(e,i,o,n,r){var a,s,l=this.gauge.element.id+"_AxisIndex_"+i+"_"+o.type+"Pointer_"+n;h(l)&&h(l).childElementCount>0&&t.remove(h(l));var u=o.color||this.gauge.themeStyle.pointerColor,p=o.markerType;t.isNullOrUndefined(o.position)||"InvertedTriangle"!==o.markerType&&"Triangle"!==o.markerType||(p=("Outside"===o.position&&!e.opposedPosition||"Inside"===o.position&&e.opposedPosition||"Cross"===o.position)&&"Triangle"===o.markerType?"InvertedTriangle":("Inside"===o.position&&!e.opposedPosition||"Outside"===o.position&&e.opposedPosition)&&"InvertedTriangle"===o.markerType?"Triangle":o.markerType),a=new Q(l,u,o.border.width,o.border.color,o.opacity,null,null,"translate( 0, 0 )"),a=T(o.bounds,p,new Y(o.width,o.height),o.imageUrl,a,this.gauge.orientation,e,o),s="Circle"===o.markerType?this.gauge.renderer.drawCircle(a):"Image"===o.markerType?this.gauge.renderer.drawImage(a):this.gauge.renderer.drawPath(a),r.appendChild(s),o.animationDuration>0&&!this.gauge.gaugeResized&&(o.animationComplete=!1,this.performMarkerAnimation(s,e,o)),s.setAttribute("aria-label",o.description||"Pointer:"+Number(o.currentValue).toString())},i.prototype.drawBarPointer=function(e,i,o,n,r){var a,s,u,p,d,g="",c=new Y(this.gauge.availableSize.width,this.gauge.availableSize.height),m=this.gauge.element.id+"_AxisIndex_"+i+"_"+o.type+"Pointer_"+n;if(h(m)&&h(m).childElementCount>0&&t.remove(h(m)),"Normal"===this.gauge.container.type?(a=new J(m,o.color||this.gauge.themeStyle.pointerColor,o.border,o.opacity,o.bounds,null,null),d=o.bounds,u=this.gauge.renderer.drawRectangle(a)):(g=A(o.bounds,this.gauge.container.type,this.gauge.orientation,new Y(o.bounds.width,o.bounds.height),"bar",this.gauge.container.width,e,o.roundedCornerRadius),p=new Q(m,o.color||this.gauge.themeStyle.pointerColor,o.border.width,o.border.color,o.opacity,null,g),d=l((u=this.gauge.renderer.drawPath(p)).cloneNode(!0),c,this.gauge.element)),h(m)&&h(m).childElementCount>0){var y=h(m).firstElementChild;"Normal"===this.gauge.container.type?(y.setAttribute("x",a.x+""),y.setAttribute("y",a.y+""),y.setAttribute("width",a.width+""),y.setAttribute("height",a.height+"")):y.setAttribute("d",p.d)}else r.appendChild(u);u.setAttribute("aria-label",o.description||"Pointer:"+Number(o.currentValue).toString()),o.animationDuration>0&&!this.gauge.gaugeResized&&("Thermometer"===this.gauge.container.type&&0===o.startValue&&(s=this.gauge.renderer.drawClipPath(new J(this.gauge.element.id+"_AxisIndex_"+i+"__"+o.type+"ClipRect_"+n,"transparent",{width:1,color:"Gray"},1,d)),r.appendChild(s)),this.performBarAnimation(u,e,o))},i.prototype.drawRanges=function(e,i,o){for(var n,r,a=this.gauge.renderer.createGroup({id:this.gauge.element.id+"_RangesGroup"}),s=0;s<e.ranges.length;s++)n=e.ranges[s],t.isNullOrUndefined(n.path)||(r=new Q(this.gauge.element.id+"_AxisIndex_"+o+"_Range_"+s,n.interior,n.border.width,n.border.color,1,null,n.path),a.appendChild(this.gauge.renderer.drawPath(r)));i.appendChild(a)},i}(ie),re=function(){function e(e){this.gauge=e}return e.prototype.renderAnnotationElements=function(){var e=this,i=this.gauge.element.id+"_Secondary_Element",o=t.createElement("div",{id:this.gauge.element.id+"_AnnotationsGroup"});if(o.style.position="absolute",o.style.top="0px",o.style.left="0px",this.gauge.annotations.map(function(t,i){null!==t.content&&e.createAnnotationTemplate(o,i)}),o.childElementCount>0&&!t.isNullOrUndefined(h(i))){h(i).appendChild(o);for(var n=0;n<this.gauge.annotations.length;n++)t.updateBlazorTemplate(this.gauge.element.id+"_ContentTemplate"+n,"ContentTemplate",this.gauge.annotations[n])}},e.prototype.createAnnotationTemplate=function(e,i){var o,n,r,a,s,l,h,u=this,p=!1,c=(this.gauge.element.id,this.gauge.annotations[i]);h=t.createElement("div",{id:this.gauge.element.id+"_Annotation_"+i,styles:"position: absolute; z-index:"+c.zIndex+";"});var m={cancel:!1,name:"annotationRender",content:c.content,annotation:c,textStyle:c.font};if(m.textStyle.color=c.font.color||this.gauge.themeStyle.labelColor,this.gauge.isBlazor){var y=m.cancel,b=m.name,x=m.content,w=m.annotation,P=m.textStyle;m={cancel:y,name:b,content:x,annotation:w,textStyle:P}}this.gauge.trigger("annotationRender",m,function(y){if(!m.cancel){if((r=f(m.content))&&(u.gauge.isBlazor?{}:r(u.gauge,null,null,u.gauge.element.id+"_ContentTemplate"+i).length))for(var b=(a=Array.prototype.slice.call(r(u.gauge.isBlazor?{}:u.gauge,null,null,u.gauge.element.id+"_ContentTemplate"+i))).length,x=0;x<b;x++)h.appendChild(a[x]);else h.appendChild(t.createElement("div",{innerHTML:m.content,styles:g(m.textStyle)}));var w=v(h.cloneNode(!0),u.gauge.element);if(t.isNullOrUndefined(c.axisValue)){var P=u.gauge.element.getBoundingClientRect(),C=u.gauge.svgObject.getBoundingClientRect();switch(p=!0,o=Math.abs(C.left-P.left),n=Math.abs(C.top-P.top),o="None"===c.horizontalAlignment?o+c.x:o,n="None"===c.verticalAlignment?n+c.y:n,c.verticalAlignment){case"Near":n+=c.y;break;case"Center":n=n+c.y+(C.height/2-w.height/2);break;case"Far":n=n+C.height+c.y-w.height}switch(c.horizontalAlignment){case"Near":o+=c.x;break;case"Center":o=o+c.x+(C.width/2-w.width/2);break;case"Far":o=o+C.width+c.x-w.width}}else{l=t.isNullOrUndefined(c.axisIndex)?0:c.axisIndex;var S=(s=u.gauge.axes[l]).visibleRange;p=c.axisValue>=S.min&&c.axisValue<=S.max;var T=s.lineBounds;"Vertical"===u.gauge.orientation?(o=T.x+c.x,n=d(c.axisValue,s,u.gauge.orientation,S)*T.height+T.y,n+=c.y):(o=d(c.axisValue,s,u.gauge.orientation,S)*T.width+T.x,o+=c.x,n=T.y+c.y),o-=w.width/2,n-=w.height/2}h.style.left=o+"px",h.style.top=n+"px",p&&e.appendChild(h)}})},e.prototype.getModuleName=function(){return"Annotations"},e.prototype.destroy=function(e){},e}(),ae=function(){function e(e){this.gauge=e,this.element=e.element,this.tooltip=e.tooltip,this.textStyle=this.tooltip.textStyle,this.borderStyle=this.tooltip.border,this.tooltipId=this.gauge.element.id+"_LinearGauge_Tooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var o,n,r=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,(n=e).changedTouches[0].pageX,n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,e.pageX,e.pageY,o=e.target);var a,s;if(o.id.indexOf("Pointer")>-1){this.pointerElement=o;var l=this.gauge.element.getBoundingClientRect(),h=P(this.pointerElement,this.gauge);this.currentAxis=h.axis,this.axisIndex=h.axisIndex,this.currentPointer=h.pointer;var u=this.tooltip.format&&null!==this.tooltip.format.match("{value}");if(this.tooltip.textStyle.fontFamily=this.gauge.themeStyle.fontFamily||this.tooltip.textStyle.fontFamily,this.tooltip.textStyle.opacity=this.gauge.themeStyle.tooltipTextOpacity||this.tooltip.textStyle.opacity,s=u?c(this.tooltip.format,{value:this.currentPointer.currentValue},this.gauge):m(this.currentPointer.currentValue,this.gauge).toString(),document.getElementById(this.tooltipId)?a=document.getElementById(this.tooltipId):(a=t.createElement("div",{id:this.tooltipId,className:"EJ2-LinearGauge-Tooltip",styles:"position: absolute;pointer-events:none;"}),document.getElementById(this.gauge.element.id+"_Secondary_Element").appendChild(a)),0!==a.childElementCount&&!this.gauge.pointerDrag)return null;var p=this.getTooltipLocation(),d={name:"tooltipRender",cancel:!1,gauge:this.gauge,event:e,location:p,content:s,tooltip:this.tooltip,axis:this.currentAxis,pointer:this.currentPointer},g=this.getTooltipPosition();p.y+=this.tooltip.template&&"Top"===g?20:0,p.x+=this.tooltip.template&&"Right"===g?20:0,this.gauge.trigger("tooltipRender",d,function(e){var t=d.tooltip.template;null!==t&&1===Object.keys(t).length&&(t=t[Object.keys(t)[0]]);r.gauge.theme.toLowerCase();d.cancel||(d.tooltip.properties.textStyle.color=r.tooltip.textStyle.color||r.gauge.themeStyle.tooltipFontColor,r.svgTooltip=new i.Tooltip({enable:!0,header:"",data:{value:d.pointer.currentValue},template:t,content:[d.content],shapes:[],location:d.location,palette:[],inverted:!("Horizontal"===d.gauge.orientation),enableAnimation:d.tooltip.enableAnimation,fill:r.tooltip.fill||r.gauge.themeStyle.tooltipFillColor,availableSize:r.gauge.availableSize,areaBounds:new Z(l.left,"Bottom"===g?p.y:l.top,"Right"===g?Math.abs(l.left-p.x):l.width,l.height),textStyle:d.tooltip.textStyle,border:d.tooltip.border,theme:d.gauge.theme,blazorTemplate:{name:"TooltipTemplate",parent:r.gauge.tooltip}}),r.svgTooltip.opacity=r.gauge.themeStyle.tooltipFillOpacity||r.svgTooltip.opacity,r.svgTooltip.appendTo(a))})}else this.removeTooltip()},e.prototype.getTooltipPosition=function(){return"Vertical"===this.gauge.orientation?this.currentAxis.opposedPosition?"Right":"Left":this.currentAxis.opposedPosition?"Top":"Bottom"},e.prototype.getTooltipLocation=function(){new Y(this.gauge.availableSize.width,this.gauge.availableSize.height);var e,t,i,o,n,r,a,s,l=this.gauge.element.id+"_AxisLine_"+this.axisIndex,u=this.gauge.element.id+"_MajorTicksLine_"+this.axisIndex;h(l)?(t=(s=h(l).getBoundingClientRect()).left,i=s.top):(s=h(u).getBoundingClientRect(),t=this.currentAxis.opposedPosition?s.left:s.left+s.width,i=this.currentAxis.opposedPosition?s.top:s.top+s.height),e=this.pointerElement.getBoundingClientRect();var p=this.gauge.element.getBoundingClientRect();return o=e.left-p.left,n=e.top-p.top,r=e.height,a=e.width,"Vertical"===this.gauge.orientation?(o=t-p.left,n="Marker"===this.currentPointer.type?n+r/2:this.currentAxis.isInversed?n+r:n):(n=i-p.top,o="Marker"===this.currentPointer.type?o+a/2:this.currentAxis.isInversed?o:o+a),new X(o,n)},e.prototype.removeTooltip=function(){document.getElementsByClassName("EJ2-LinearGauge-Tooltip").length>0&&document.getElementsByClassName("EJ2-LinearGauge-Tooltip")[0].remove()},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.addEventListener=function(){this.gauge.isDestroyed||(this.gauge.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.gauge.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.gauge.isDestroyed||(this.gauge.off(t.Browser.touchMoveEvent,this.renderTooltip),this.gauge.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"Tooltip"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),se=function(){function e(e){this.control=e}return e.prototype.print=function(e){var i=this;this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight);var o={cancel:!1,htmlContent:this.getHTMLContent(e),name:"beforePrint"};this.control.trigger("beforePrint",o,function(e){o.cancel||t.print(o.htmlContent,i.printWindow)})},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");return e?e instanceof Array?e.forEach(function(e){i.appendChild(h(e).cloneNode(!0))}):e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(h(e).cloneNode(!0)):i.appendChild(this.control.element.cloneNode(!0)),i},e.prototype.export=function(e,i,n){var r=this,a=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:this.control.availableSize.width.toString(),height:this.control.availableSize.height.toString()}}),s=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);n=t.isNullOrUndefined(n)?o.PdfPageOrientation.Landscape:n;var l='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+this.control.svgObject.outerHTML+"</svg>",h=window.URL.createObjectURL(new Blob("SVG"===e?[l]:[(new XMLSerializer).serializeToString(this.control.svgObject)],{type:"image/svg+xml"}));if("SVG"===e)this.triggerDownload(i,e,h,s);else{var u=new Image,p=a.getContext("2d");u.onload=function(){if(p.drawImage(u,0,0),window.URL.revokeObjectURL(h),"PDF"===e){var t=new o.PdfDocument,l=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=n,l=l.slice(l.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(l),0,0,r.control.availableSize.width-60,r.control.availableSize.height),s&&(t.save(i+".pdf"),t.destroy())}else r.triggerDownload(i,e,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s)},u.src=h}},e.prototype.triggerDownload=function(e,i,o,n){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:o}}).dispatchEvent(new MouseEvent(n?"click":"move",{view:window,bubbles:!1,cancela