text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-svg-base")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-svg-base"],t):t(e.ej={},e.ej2Base,e.ej2Data,e.ej2SvgBase)}(this,function(e,t,i,l){"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 a(e,i){var l=document.getElementById("heatmapmeasuretext");return null===l&&(l=t.createElement("text",{id:"heatmapmeasuretext"}),document.body.appendChild(l)),l.innerHTML=e,l.style.position="absolute",l.style.visibility="hidden",l.style.fontSize=-1!==i.size.indexOf("px")?i.size:i.size+"px",l.style.fontWeight=i.fontWeight,l.style.fontStyle=i.fontStyle,l.style.fontFamily=i.fontFamily,l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new U(l.clientWidth,l.clientHeight)}function o(e,t,i,l){return"Near"===l.textAlignment?t:"Center"===l.textAlignment?t+e/2:e+t}function s(e){for(var t=0,i=0,l=e;i<l.length;i++){t+=l[i]}return t}function r(e,t,i,l){return"Near"===l.textAlignment?e.height-i:"Center"===l.textAlignment?e.height/2:t}function h(e,i,l){var n,a,o,s=new t.SvgRenderer("heatmapMeasureRotateText"),r=s.createSvg({id:"heatmapMeasureRotateText_svg",width:100,height:100});return a={"font-size":e.size,"font-style":e.fontStyle,"font-family":e.fontFamily,"font-weight":e.fontWeight,transform:"rotate("+l+", 0, 0)","text-anchor":"middle"},o=s.createText(a,i),r.appendChild(o),document.body.appendChild(r),n=o.getBoundingClientRect(),t.remove(r),new U(n.right-n.left,n.bottom-n.top)}function d(e,t,i){var l=[];switch(t.textOverflow){case"Wrap":l=p(e,i,t);break;case"Trim":l.push(c(i,e,t));break;default:l.push(g(i,e,t))}return l}function p(e,t,i){for(var l,n=e.split(" "),o="",s=[],r=0,h=n.length;r<h;r++)l=n[r],a(o.concat(l),i).width<t?o=o.concat((""===o?"":" ")+l):""!==o?(s.push(c(t,o,i)),o=l):(s.push(c(t,l,i)),l=""),o&&r===h-1&&s.push(c(t,o,i));return s}function c(e,t,i){var l=t,n=a(t,i).width;if(n>e)for(var o=t.length-1;o>=0;--o)if(l=t.substring(0,o)+"...",(n=a(l,i).width)<=e)return l;return l}function g(e,t,i){var l=t,n=a(t,i).width;if(n>e)for(var o=t.length-1;o>=0;--o)if(l=t.substring(0,o),(n=a(l,i).width)<=e)return l;return l}function u(e,i,l,n,o,s,r,h){var d=document.getElementById(o),p=(h.initialClipRect,a(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"})),c=p.width+5;i=(i=i+c>n?i-c:i)<0?5:i,d?(d.innerHTML=e,d.style.top=(l+15).toString()+"px",d.style.left=(i+15).toString()+"px"):(d=t.createElement("div",{innerHTML:e,id:o,styles:"top:"+(l+15).toString()+"px;left:"+(i+15).toString()+"px;background-color: rgb(255, 255, 255) !important; color:black !important; position:absolute;border:1px solid rgb(112, 112, 112); padding-left : 3px; padding-right : 2px;padding-bottom : 2px; padding-top : 2px; font-size:12px; font-family: Segoe UI"}),s.appendChild(d)),e===h.titleSettings.text?d.style.width=i+15+p.width+7>h.availableSize.width?(h.availableSize.width-(i+15)).toString()+"px":"":(d.style.left=i+15+p.width+7>h.availableSize.width?(h.availableSize.width-(p.width+7)).toString()+"px":i.toString()+"px",d.style.top=l+15+p.height+6>h.availableSize.height?(l-(p.height+6)-10).toString()+"px":d.style.top),r&&setTimeout(function(){v(o)},1500)}function v(e){var i=y(e);i&&t.remove(i)}function y(e){return document.getElementById(e)}function b(e,t,i,l){var n=new Date(e);switch(t=Math.ceil(t*l),i){case"Years":n.setFullYear(n.getFullYear()+t);break;case"Months":n.setMonth(n.getMonth()+t);break;case"Days":n.setDate(n.getDate()+t);break;case"Hours":n.setHours(n.getHours()+t);break;case"Minutes":n.setMinutes(n.getMinutes()+t)}return n}function m(e,t,i){for(var l,n,a,o=e.length,s=0;s<o;s++)if(l=e[s],n=l.region,t>=n.x&&t<=n.x+n.width&&i>=n.y&&i<=n.y+n.height){a=l.text;break}return a}function x(e){var t;e="transparent"===e?"white":e,(t=document.getElementById("heatmapmeasuretext")).style.color=e,e=window.getComputedStyle(t).color;var i=/^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.exec(e);return f(new k(parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)))}function f(e){return"#"+S(e.R)+S(e.G)+S(e.B)}function S(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function C(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new k(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new k(255,255,255)}function M(e,t,i,l){return e?t.replace("{value}",l(i)):l(i)}var w;!function(e){e.heatMapTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisTitleFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.axisLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.legendLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.rectLabelFont={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},e.tooltipFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"}}(w||(w={}));var L=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),T=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("16px")],i.prototype,"size",void 0),T([t.Property("")],i.prototype,"color",void 0),T([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),T([t.Property("Normal")],i.prototype,"fontWeight",void 0),T([t.Property("Normal")],i.prototype,"fontStyle",void 0),T([t.Property("Center")],i.prototype,"textAlignment",void 0),T([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property(10)],i.prototype,"left",void 0),T([t.Property(10)],i.prototype,"right",void 0),T([t.Property(10)],i.prototype,"top",void 0),T([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("")],i.prototype,"color",void 0),T([t.Property(1)],i.prototype,"width",void 0),T([t.Property("")],i.prototype,"radius",void 0),i}(t.ChildProperty),A=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("")],i.prototype,"color",void 0),T([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property(null)],i.prototype,"size",void 0),T([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("")],i.prototype,"text",void 0),T([t.Complex({},R)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property(null)],i.prototype,"value",void 0),T([t.Property(null)],i.prototype,"color",void 0),T([t.Property(null)],i.prototype,"label",void 0),i}(t.ChildProperty),I=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("#b5b5b5")],i.prototype,"color",void 0),T([t.Property(1)],i.prototype,"width",void 0),T([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property(null)],i.prototype,"start",void 0),T([t.Property(null)],i.prototype,"end",void 0),T([t.Property("")],i.prototype,"text",void 0),T([t.Property(null)],i.prototype,"maximumTextWidth",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return L(i,e),T([t.Property("Center")],i.prototype,"alignment",void 0),T([t.Property("Wrap")],i.prototype,"overflow",void 0),T([t.Complex(w.axisLabelFont,R)],i.prototype,"textStyle",void 0),T([t.Complex({color:"#b5b5b5",width:1,type:"Rectangle"},I)],i.prototype,"border",void 0),T([t.Collection([],B)],i.prototype,"categories",void 0),i}(t.ChildProperty),E=function(){return function(e,t,i){this.value=e,this.color=t,this.label=i}}(),N=function(){return function(e,t,i){this.mappingName=e,this.bubbleData=t,this.valueType=i}}(),H=function(){return function(e,t,i,l){this.value=e,this.color=t,this.label=i,this.isHidden=l}}(),G=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),j=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},F=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return G(i,e),j([t.Collection([{}],_)],i.prototype,"palette",void 0),j([t.Property("Gradient")],i.prototype,"type",void 0),j([t.Property("")],i.prototype,"emptyPointColor",void 0),i}(t.ChildProperty),k=function(){return function(e,t,i){this.R=e,this.G=t,this.B=i}}(),W=function(){function e(e){this.heatMap=e}return e.prototype.convertToRGB=function(e,t){for(var i=t[0].value,l=0,n=1;n<t.length;n++){var a=Number(t[n].value);if(e<=a){l=a;break}l=a,i=a}var o=0;o=(e-i)/(l-i),o=isNaN(o)?0:o;var s=this.getEqualColor(t,i),r=this.getEqualColor(t,l);return this.getPercentageColor(o,s,r)},e.prototype.rgbToHex=function(e,t,i){return"#"+this.componentToHex(e)+this.componentToHex(t)+this.componentToHex(i)},e.prototype.componentToHex=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.prototype.getEqualColor=function(e,t){for(var i=0;i<e.length;i++)if(Number(e[i].value)===t){var l=e[i].color;return-1!==l.indexOf("rgb")?l=this.convertToHex(l):-1===l.indexOf("#")&&(l="#FFFFFF"),l}return"#00000"},e.prototype.convertToHex=function(e){var t=e.substr(3),i=(t=t.split("(")[1].split(")")[0]).split(",");return t=this.rgbToHex(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10))},e.prototype.getPercentageColor=function(e,t,i){var l=i.split("#")[1],n=t.split("#")[1],a=this.getPercentage(e,parseInt(n.substr(0,2),16),parseInt(l.substr(0,2),16)),o=this.getPercentage(e,parseInt(n.substr(2,2),16),parseInt(l.substr(2,2),16)),s=this.getPercentage(e,parseInt(n.substr(4,2),16),parseInt(l.substr(4,2),16));return new k(a,o,s)},e.prototype.getPercentage=function(e,t,i){var l=i-t;return Math.round(t+l*e)},e.prototype.getColorCollection=function(){var e=this.heatMap;e.colorCollection=[],e.legendColorCollection=[];var i,l=e.bubbleSizeWithColor?e.minColorValue:e.dataSourceMinValue,n=e.bubbleSizeWithColor?e.maxColorValue:e.dataSourceMaxValue;e.emptyPointColor=e.paletteSettings.emptyPointColor?e.paletteSettings.emptyPointColor:e.themeStyle.emptyCellColor;var a=this.orderbyOffset(e.paletteSettings.palette&&e.paletteSettings.palette.length>1?e.paletteSettings.palette:e.themeStyle.palette);if(a.isCompact)e.colorCollection=a.offsets,e.legendColorCollection=t.extend([],a.offsets,null,!0);else if(i="Gradient"===e.paletteSettings.type?(n-l)/(a.offsets.length-1):(n-l)/a.offsets.length,a.offsets.length>=2)for(var o=0;o<a.offsets.length;o++)e.colorCollection.push(new E(Math.round(100*(l+o*i))/100,a.offsets[o].color,a.offsets[o].label)),e.legendColorCollection.push(new H(Math.round(100*(l+o*i))/100,a.offsets[o].color,a.offsets[o].label,!1));this.updateLegendColorCollection(l,n,a)},e.prototype.updateLegendColorCollection=function(e,t,i){"Fixed"===this.heatMap.paletteSettings.type&&(i.isCompact||i.isLabel)||(e<this.heatMap.legendColorCollection[0].value&&this.heatMap.legendColorCollection.unshift(new H(e,this.heatMap.legendColorCollection[0].color,this.heatMap.legendColorCollection[0].label,!0)),t>this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].value&&this.heatMap.legendColorCollection.push(new H(t,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].color,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].label,!0)))},e.prototype.orderbyOffset=function(e){var i=new pe;return i.isCompact=!0,i.isLabel=!0,i.offsets=e.sort(function(e,l){return t.isNullOrUndefined(e.label)&&t.isNullOrUndefined(l.label)&&(i.isLabel=!1),t.isNullOrUndefined(e.value)||t.isNullOrUndefined(l.value)?(i.isCompact=!1,e):e.value-l.value}),i.isCompact||(i.offsets=this.heatMap.paletteSettings.palette&&this.heatMap.paletteSettings.palette.length>1?this.heatMap.paletteSettings.palette:this.heatMap.themeStyle.palette),i},e.prototype.getColorByValue=function(e){var t,i="",l=0;if(""!==e.toString())if("Bubble"!==this.heatMap.cellSettings.tileType||"Size"!==this.heatMap.cellSettings.bubbleType&&"Sector"!==this.heatMap.cellSettings.bubbleType)if("Fixed"===this.heatMap.paletteSettings.type)for(var n=0;n<this.heatMap.colorCollection.length;n++){l=this.heatMap.colorCollection[n+1]?this.heatMap.colorCollection[n+1].value:this.heatMap.colorCollection[n].value;var a=this.heatMap.dataSourceMinValue===this.heatMap.dataSourceMaxValue;if(e<=l&&0===n&&a||e<l||e>=l&&n===this.heatMap.colorCollection.length-1){var o=void 0;this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[n]&&!o[n].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[n].color;break}}else e<this.heatMap.colorCollection[0].value?i=this.heatMap.colorCollection[0].color:e>this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].value?i=this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].color:(t=this.convertToRGB(e,this.heatMap.colorCollection),i=this.rgbToHex(t.R,t.G,t.B));else i=this.heatMap.colorCollection[0].color;else i=this.heatMap.emptyPointColor;return i},e}(),Y=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),X=function(){return function(e,t){this["font-size"]=e.size,this["font-style"]=e.fontStyle,this["font-family"]=e.fontFamily,this["font-weight"]=e.fontWeight,this.fill=t||""}}(),U=function(){return function(e,t){this.width=e,this.height=t}}(),J=function(){return function(e){this.id=e}}(),q=function(e){function t(t,i,l,n,a,o,s){var r=e.call(this,t)||this;return r.opacity=a,r.fill=i,r.stroke=n||"",r["stroke-width"]=parseFloat(l.toString()),r["stroke-dasharray"]=o,r.d=s,r}return Y(t,e),t}(J),Z=function(){return function(e,t,i,l,n,a,o,s,r,h,d,p,c){this.x=e,this.y=t,this.width=i,this.height=l,this.value=n,this.id=a,this.xIndex=o,this.yIndex=s,this.xValue=r,this.yValue=h,this.visible=d,this.displayText=p,this.textId=c}}(),$=function(){return function(e,t,i,l,n,a){this.value=e,this.xLabel=t,this.yLabel=i,this.xValue=l,this.yValue=n,this.cellElement=a}}(),K=function(e){function t(t,i,l,n,a,o,s,r,h,d){var p=e.call(this,t,i,l.width,o,n,d)||this;return p.y=a.y,p.x=a.x,p.height=a.height>0?a.height:0,p.width=a.width>0?a.width:0,p.rx=s||0,p.ry=r||0,p.transform=h||"",p}return Y(t,e),t}(q),Q=function(e){function t(t,i,l,n,a,o,s,r){var h=e.call(this,t,i,l.width,a,n)||this;return h.cx=o||0,h.cy=s||0,h.r=r||0,h}return Y(t,e),t}(q),ee=function(){return function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l}}(),te=function(e){function t(t,i,l,n){var a=e.call(this,l,n)||this;return a.transform="",a["dominant-baseline"]="auto",a.labelRotation=0,a.baseline="auto",a.id=t,a.x=i.x,a.y=i.y,a["text-anchor"]=i["text-anchor"],a.text=i.text,a.transform=i.transform,a.labelRotation=i.labelRotation,a["dominant-baseline"]=i["dominant-baseline"],a.baseline=i.baseline,a.dy=i.dy,a}return Y(t,e),t}(X),ie=function(){return function(e,t,i,l,n,a,o,s){this.transform="",this["dominant-baseline"]="auto",this.labelRotation=0,this.baseline="auto",this.x=e||0,this.y=t||0,this["text-anchor"]=i||"",this.text=l||"",this.transform=a||"",this.labelRotation=n,this["dominant-baseline"]=o||"",this.baseline=o||"",this.dy=s||""}}(),le=function(){return function(e,t,i,l){this.x1=e,this.y1=t,this.x2=i,this.y2=l}}(),ne=function(e){function t(t,i,l,n,a,o){var s=e.call(this,t,null,n,l,a,o,null)||this;return s.x1=i.x1,s.y1=i.y1,s.x2=i.x2,s.y2=i.y2,s}return Y(t,e),t}(q),ae=function(e){function t(t,i,l,n,a,o,s){var r=e.call(this,t,l,a,s,o,null)||this;return r.d=i.d,r.x=i.x,r.y=i.y,r}return Y(t,e),t}(q),oe=function(){return function(e,t,i,l,n,a,o,s,r,h,d,p){this.d=e,this.innerR=t,this.cx=o,this.cy=s,this.x=i,this.y=l,this.x1=n,this.y1=a,this.start=r,this.end=h,this.radius=d,this.counterClockWise=p}}(),se=function(){function e(e){this.heatMap=e}return e.prototype.drawRectangle=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasRectangle(this.heatMap.canvasRenderer,e,i):t.appendChild(this.heatMap.renderer.drawRectangle(e))},e.prototype.drawCircle=function(e,t){this.heatMap.enableCanvasRendering?this.drawCanvasCircle(this.heatMap.canvasRenderer,e):t.appendChild(this.heatMap.renderer.drawCircle(e))},e.prototype.drawPath=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasPath(this.heatMap.canvasRenderer,e,t):i.appendChild(this.heatMap.renderer.drawPath(e))},e.prototype.createText=function(e,t,i){this.heatMap.enableCanvasRendering?this.canvasDrawText(e,i):t.appendChild(this.heatMap.renderer.createText(e,i))},e.prototype.createWrapText=function(e,t,i){var l,n,o,s,r={};if(r={id:e.id,x:e.x,y:e.y,fill:e.fill,"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e["text-anchor"],transform:e.transform,"dominant-baseline":e["dominant-baseline"]},o=e.text[0],this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawText(e,o):l=this.heatMap.renderer.createText(r,o),"string"!=typeof e.text&&e.text.length>1)for(var h=1,d=e.text.length;h<d;h++)s=a(e.text[h],t).height,this.heatMap.enableCanvasRendering?(e.id=e.id+h,e.y+=s,this.heatMap.canvasRenderer.drawText(e,e.text[h])):(n=this.heatMap.renderer.createTSpan({x:e.x,id:e.id+h,y:e.y+h*s},e.text[h]),l.appendChild(n));this.heatMap.enableCanvasRendering||i.appendChild(l)},e.prototype.drawLine=function(e,t){this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawLine(e):t.appendChild(this.heatMap.renderer.drawLine(e))},e.prototype.canvasDrawText=function(e,i,l,n){var a=this.heatMap.canvasRenderer.ctx;l||(l=e.x),n||(n=e.y);var o=this.getOptionValue(e,"font-weight");t.isNullOrUndefined(o)||"regular"!==o.toLowerCase()||(o="normal");var s=this.getOptionValue(e,"font-family"),r=-1===e["font-size"].toString().indexOf("px")?e["font-size"]+"px":e["font-size"],h=this.getOptionValue(e,"text-anchor"),d=this.getOptionValue(e,"font-style").toLowerCase()+" "+o+" "+r+" "+s;"middle"===h&&(h="center"),a.save(),a.fillStyle=e.fill,a.font=d,a.textAlign=h,e.baseline&&(a.textBaseline=e.baseline),a.translate(l,n),a.rotate(e.labelRotation*Math.PI/180),a.fillText(i,e.x-l,e.y-n),a.restore()},e.prototype.getOptionValue=function(e,t){return e[t]},e.prototype.setAttributes=function(e,i){e.ctx.lineWidth=i["stroke-width"];var l=i["stroke-dasharray"];if(!t.isNullOrUndefined(l)){var n=l.split(",");e.ctx.setLineDash([parseInt(n[0],10),parseInt(n[1],10)])}e.ctx.strokeStyle=i.stroke},e.prototype.drawCanvasRectangle=function(e,t,i){var l=e.ctx;t.rx;e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,this.setAttributes(e,t),this.drawCornerRadius(e,t),(t["stroke-width"]&&0!=t["stroke-width"]||i)&&e.ctx.stroke(),e.ctx.restore(),e.ctx=l},e.prototype.drawCornerRadius=function(e,t){var i=t.rx,l=t.x,n=t.y,a=t.width,o=t.height;"none"===t.fill&&(t.fill="transparent"),e.ctx.fillStyle=t.fill,a<2*i&&(i=a/2),o<2*i&&(i=o/2),e.ctx.beginPath(),e.ctx.moveTo(l+a-i,n),e.ctx.arcTo(l+a,n,l+a,n+o,i),e.ctx.arcTo(l+a,n+o,l,n+o,i),e.ctx.arcTo(l,n+o,l,n,i),e.ctx.arcTo(l,n,l+a,n,i),e.ctx.closePath(),e.ctx.fill()},e.prototype.drawCanvasCircle=function(e,t){e.ctx.save(),e.ctx.beginPath(),e.ctx.arc(t.cx,t.cy,t.r,0,2*Math.PI),e.ctx.fillStyle=t.fill,e.ctx.globalAlpha=t.opacity,e.ctx.fill(),this.setAttributes(e,t),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},e.prototype.drawCanvasPath=function(e,t,i){var l=t.d.split(" ");this.getOptionValue(i,"stroke-width");e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,e.ctx.fillStyle=t.fill,this.setAttributes(e,t);for(var n=0;n<l.length;n+=3){var a=parseFloat(l[n+1]),o=parseFloat(l[n+2]);switch(l[n]){case"M":e.ctx.moveTo(a,o);break;case"L":e.ctx.lineTo(a,o);break;case"A":case"a":e.ctx.arc(i.x,i.y,i.radius,.0174533*i.start,.0174533*i.end,!1),n="a"===l[n]?n+13:n+5;break;case"Z":e.ctx.closePath()}}e.ctx.fill(),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},e}(),re=function(){return function(e,t,i,l,n){this.id=e,this.x1=t,this.x2=i,this.y1=l,this.y2=n}}(),he=function(){return function(e,t){this.color=e,this.colorStop=t}}(),de=function(){return function(e,t){this.region=new ee(0,0,0,0),this.text=e,this.region=t}}(),pe=function(){return function(){}}(),ce=function(){return function(e,t,i,l,n,a){this.pathX1=e,this.pathY1=t,this.pathX2=i,this.pathY2=l,this.pathX3=n,this.pathY3=a}}(),ge=function(){return function(e,t,i,l,n,a){this.x=e,this.y=t,this.width=i,this.height=l,this.label=n,this.id=a}}(),ue=function(){return function(e,t,i,l,n,a,o){this.x=e,this.y=t,this.width=i,this.height=l,this.value=n,this.visible=a,this.currentPage=o}}(),ve=function(){return function(e,t){this.visible=e,this.value=t}}(),ye=function(){return function(e,t){this.x=e,this.y=t}}(),be=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),me=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},xe=function(e){function l(){var t=null!==e&&e.apply(this,arguments)||this;return t.rect=new ee(void 0,void 0,0,0),t.nearSizes=[],t.farSizes=[],t.maxLabelSize=new U(0,0),t.titleSize=new U(0,0),t.axisLabels=[],t.tooltipLabels=[],t.labelValue=[],t.axisLabelSize=0,t.axisLabelInterval=0,t.dateTimeAxisLabelInterval=[],t.maxLength=0,t.min=0,t.max=0,t.isIntersect=!1,t.jsonCellLabel=[],t.multiLevelSize=[],t.xAxisMultiLabelHeight=[],t.yAxisMultiLabelHeight=[],t.multiLevelPosition=[],t}return be(l,e),l.prototype.computeSize=function(e,t,i){var l=new U(0,0);this.titleSize=e.getTitleSize(e,10),this.maxLabelSize=e.getMaxLabelSize(e,t),this.getMultilevelLabelsHeight(e,i,t);for(var n=0;n<this.multiLevelLabels.length;n++)l=e.multiLevelLabelSize(10,n),this.multiLevelSize.push(l)},l.prototype.multiPosition=function(e,t){var i="Horizontal"===e.orientation?10:20,l=new ye(0,0);if("Horizontal"===e.orientation){var n=e.maxLabelSize.height+i,a=this.xAxisMultiLabelHeight[t-1];l.x=e.isInversed?e.rect.x+e.rect.width:e.rect.x,l.y=0===t?e.rect.y+(e.opposedPosition?-n:n):e.multiLevelPosition[t-1].y+(e.opposedPosition?-a:a)}else{n=e.maxLabelSize.width+i,a=0!==t&&this.multiLevelSize[t-1].width;l.x=0===t?e.rect.x-(e.opposedPosition?-n:n):e.multiLevelPosition[t-1].x-(e.opposedPosition?-(a+i):a+i),l.y=e.isInversed?e.rect.y:e.rect.y+e.rect.height}return l},l.prototype.multiLevelLabelSize=function(e,t){for(var i=new U(0,0),l=this.multiLevelLabels,n=l[t].categories,o=0;o<n.length;o++){var s=a(n[o].text,l[t].textStyle);i.width=i.width>s.width?i.width:s.width,i.height=i.height>s.height?i.height:s.height}var r="Horizontal"===this.orientation?this.xAxisMultiLabelHeight[t]:this.yAxisMultiLabelHeight[t];return this.opposedPosition?this.farSizes.push(r):this.nearSizes.push(r),i},l.prototype.getMultilevelLabelsHeight=function(e,t,i){var l,n,o,s,r,h,d,c=[],g="Vertical"===e.orientation,u=(g?t.height:t.width,e.axisLabelSize,"Vertical"===e.orientation?20:10);this.multiLevelLabels.map(function(v,y){v.categories.map(function(b){s="number"==typeof b.start?b.start:Number(new Date(b.start)),r="number"==typeof b.end?b.end:Number(new Date(b.end)),""!==b.text&&null!==b.start&&null!==b.end&&(l=a(b.text,v.textStyle),o=g?l.width:l.height,h=i.heatMapAxis.calculateLeftPosition(e,s,b.start,t),d=i.heatMapAxis.calculateWidth(e,b.end,r,t),l=a(b.text,v.textStyle),n=null===b.maximumTextWidth?Math.abs(d-h):b.maximumTextWidth,l.width>n-u&&"Wrap"===v.overflow&&!g&&(o*=p(b.text,n-u,v.textStyle).length),c[y]=c[y]?c[y]<o?o+u:c[y]:o+u)})}),g?this.yAxisMultiLabelHeight=c:this.xAxisMultiLabelHeight=c},l.prototype.getTitleSize=function(e,t){var i=new U(0,0);return this.title.text&&((i=a(this.title.text,this.title.textStyle)).height+=t),e.opposedPosition?this.farSizes.push(i.height):this.nearSizes.push(i.height),i},l.prototype.getMaxLabelSize=function(e,i){var l=new U(0,0),n=this.axisLabels,o=e.border.width>0||e.multiLevelLabels.length>0?10:0;if(e.angle=e.labelRotation,e.isIntersect=!1,"Horizontal"===e.orientation&&("Rotate45"===e.labelIntersectAction||e.labelRotation%180==0&&"Trim"===e.labelIntersectAction))for(var s="DateTime"===e.valueType&&"None"!==e.showLabelOn?i.initialClipRect.width/e.axisLabelSize:i.initialClipRect.width/e.axisLabels.length,r=i.initialClipRect.x+(e.isInversed?i.initialClipRect.width:0),d=void 0,p=void 0,c=0,g=n.length;c<g;c++){var u=a(n[c],e.textStyle),v="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[c]*s:s,y=r+(e.isInversed?-(s+u.width)/2:(s-u.width)/2),b=(y=y<i.initialClipRect.x?i.initialClipRect.x:y)+u.width;if(e.isInversed){if(t.isNullOrUndefined(p))p=y;else if(p<b){"Rotate45"===e.labelIntersectAction?e.angle=45:e.isIntersect=!0;break}p=y}else{if(t.isNullOrUndefined(d))d=b;else if(y<d){"Rotate45"===e.labelIntersectAction?e.angle=45:e.isIntersect=!0;break}d=b}r+=e.isInversed?-v:v}for(c=0;c<n.length;c++){var m=e.angle%180==0?a(n[c],e.textStyle):h(e.textStyle,n[c],e.angle);l.width=l.width>m.width?l.width:m.width,l.height=l.height>m.height?l.height:m.height}return e.opposedPosition?this.farSizes.push("Horizontal"===e.orientation?l.height:l.width+o):this.nearSizes.push("Horizontal"===e.orientation?l.height:l.width+o),l},l.prototype.calculateNumericAxisLabels=function(e){var i,l,n=0,a=0,o=this.interval?this.interval:1;e.adaptorModule&&e.isCellData&&(i="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.min:e.adaptorModule.adaptiveYMinMax.min,l="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.max:e.adaptorModule.adaptiveYMinMax.max),n=t.isNullOrUndefined(this.minimum)?i||0:this.minimum,a=t.isNullOrUndefined(this.maximum)?l||this.maxLength*this.increment:this.maximum;var s;this.minimum&&this.maximum&&n>a&&(s=n,n=a,a=s),a=t.isNullOrUndefined(this.maximum)?l||a+n:a;var r=this.labelFormat,h=null!==r.match("{value}");this.format=e.intl.getNumberFormat({format:h?"":r});for(var d=n;d<=a;d+=o*this.increment){var p=M(h,r,d,this.format);this.axisLabels.push(p)}this.min=0,this.axisLabelSize=Math.floor((a-n)/this.increment+1),this.max=this.axisLabelSize-1,this.axisLabelInterval=o;for(d=n;d<=a;d+=this.increment){p=M(h,r,d,this.format);this.tooltipLabels.push(p),this.labelValue.push(d)}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},l.prototype.calculateCategoryAxisLabels=function(){var e=this.labels?this.labels:[];e=e.length>0?e:this.jsonCellLabel;var i,l=t.isNullOrUndefined(this.minimum)?0:this.minimum,n=t.isNullOrUndefined(this.maximum)?this.maxLength:this.maximum,a=this.interval?this.interval:1;if(!t.isNullOrUndefined(this.minimum)&&!t.isNullOrUndefined(this.maximum)&&l>n&&(i=l,l=n,n=i),e&&e.length>0)for(var o=l;o<=n;o+=a){var s=e[o]?e[o].toString():o.toString();this.axisLabels.push(s)}else for(o=l;o<=n;o+=a)this.axisLabels.push(o.toString());for(o=l;o<=n;o++)this.tooltipLabels.push(e[o]?e[o].toString():o.toString()),this.labelValue.push(e[o]?e[o].toString():o.toString());this.min=l,this.max=n,this.axisLabelSize=n-l+1,this.axisLabelInterval=a,this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},l.prototype.calculateDateTimeAxisLabel=function(e){var t,l,n=this.interval?this.interval:1,a={skeleton:"full",type:"dateTime"},o=e.intl.getDateParser(a),s=e.intl.getDateFormat(a),r=null,h=null;e.adaptorModule&&e.isCellData&&(r="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.min:e.adaptorModule.adaptiveYMinMax.min,h="Horizontal"===this.orientation?e.adaptorModule.adaptiveXMinMax.max:e.adaptorModule.adaptiveYMinMax.max);var d=this.minimum?this.minimum:r||null,p=this.maximum?this.maximum:h||null;if(null===d&&null===p){t=0,l=this.maxLength*this.increment;for(var c=t;c<=l;c+=n*this.increment)this.axisLabels.push(c.toString()),this.tooltipLabels.push(c.toString()),this.labelValue.push(c.toString());this.min=0,this.max=this.maxLength,this.axisLabelSize=(l-t)/this.increment+1,this.axisLabelInterval=n}else{null!==d&&null===p?l=b(t=Date.parse(o(s(new Date(i.DataUtil.parse.parseJson({val:d}).val)))),this.maxLength,this.intervalType,this.increment).getTime():null===d&&null!==p?t=b(l=Date.parse(o(s(new Date(i.DataUtil.parse.parseJson({val:p}).val)))),-this.maxLength,this.intervalType,this.increment).getTime():(t=Date.parse(o(s(new Date(i.DataUtil.parse.parseJson({val:d}).val)))),l=Date.parse(o(s(new Date(i.DataUtil.parse.parseJson({val:p}).val))))),this.format=e.intl.getDateFormat({format:this.labelFormat,skeleton:this.getSkeleton()});for(var g=t;g<=l;){var u=this.format(new Date(g));this.axisLabels.push(u),"None"!==this.showLabelOn&&(n=this.calculateLabelInterval(g),this.dateTimeAxisLabelInterval.push(n)),g=b(g,n,this.intervalType,this.increment).getTime()}for(this.min=0,this.axisLabelInterval=n,this.axisLabelSize=this.getTotalLabelLength(t,l),this.max=this.axisLabelSize-1,g=t;g<=l;){u=this.format(new Date(g));this.tooltipLabels.push(u),this.labelValue.push(new Date(g)),g=b(g,1,this.intervalType,this.increment).getTime()}}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},l.prototype.calculateLabelInterval=function(e){var t,i,l=new Date(e).getFullYear(),n=new Date(e).getMonth()+1,a=new Date(e).getDate();if("Years"===this.showLabelOn||"Months"===this.showLabelOn)"Years"===this.showLabelOn&&"Months"===this.intervalType?i=Math.ceil(12/this.increment):(t="Years"===this.showLabelOn?l%4==0?366:365:new Date(l,n,0).getDate(),t+=1-a,i="Days"===this.intervalType?Math.ceil(t/this.increment):"Hours"===this.intervalType?Math.ceil(24*t/this.increment):"Minutes"===this.intervalType?Math.ceil(24*t*60/this.increment):1);else if("Days"===this.showLabelOn)i="Hours"===this.intervalType?Math.ceil(24/this.increment):"Minutes"===this.intervalType?Math.ceil(1440/this.increment):1;else if("Hours"===this.showLabelOn){var o=new Date(e).getMinutes();i="Minutes"===this.intervalType?Math.ceil((60-o)/this.increment):1}else i=1;return i},l.prototype.getSkeleton=function(){return"Years"===this.intervalType?"yMMM":"Months"===this.intervalType?"MMMd":"Days"===this.intervalType?"yMd":"Hours"===this.intervalType?"EHm":(this.intervalType,"Hms")},l.prototype.getTotalLabelLength=function(e,t){var i,l,n=0,a=new Date(e),o=new Date(t);switch(this.intervalType){case"Years":var s=(o.getFullYear()-a.getFullYear())/this.increment+1;n=Math.floor(s);break;case"Months":var r=12*(o.getFullYear()-a.getFullYear());r-=a.getMonth(),n=(r+=o.getMonth())<=0?1:Math.floor(r/this.increment+1);break;case"Days":i=Math.abs(a.getTime()-o.getTime()),l=Math.floor(i/864e5),n=Math.floor(l/this.increment+1);break;case"Hours":i=Math.abs(a.getTime()-o.getTime());var h=Math.floor(i/36e5);n=Math.floor(h/this.increment)+1;break;case"Minutes":i=Math.abs(a.getTime()-o.getTime());var d=Math.floor(i/6e4);n=Math.floor(d/this.increment)+1}return n},l.prototype.clearAxisLabel=function(){this.axisLabels=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.labelValue=[]},me([t.Complex({text:"",textStyle:w.axisTitleFont},z)],l.prototype,"title",void 0),me([t.Property(!1)],l.prototype,"opposedPosition",void 0),me([t.Property(null)],l.prototype,"labels",void 0),me([t.Complex(w.axisLabelFont,R)],l.prototype,"textStyle",void 0),me([t.Property(0)],l.prototype,"labelRotation",void 0),me([t.Property(!1)],l.prototype,"isInversed",void 0),me([t.Property("Category")],l.prototype,"valueType",void 0),me([t.Property(1)],l.prototype,"increment",void 0),me([t.Property("None")],l.prototype,"showLabelOn",void 0),me([t.Property(null)],l.prototype,"minimum",void 0),me([t.Property(null)],l.prototype,"maximum",void 0),me([t.Property(null)],l.prototype,"interval",void 0),me([t.Property("")],l.prototype,"labelFormat",void 0),me([t.Property("Days")],l.prototype,"intervalType",void 0),me([t.Property("Trim")],l.prototype,"labelIntersectAction",void 0),me([t.Complex({color:"#b5b5b5",width:0,type:"Rectangle"},I)],l.prototype,"border",void 0),me([t.Collection([],V)],l.prototype,"multiLevelLabels",void 0),l}(t.ChildProperty),fe=function(){function e(e){this.heatMap=e,this.padding=10,this.drawSvgCanvas=new se(e)}return e.prototype.renderAxes=function(){this.initialClipRect=this.heatMap.initialClipRect;var e,t,i=this.heatMap;i.enableCanvasRendering||(e=this.heatMap.renderer.createGroup({id:i.element.id+"AxisCollection"}));for(var l=this.heatMap.axisCollections,n=0,a=l.length;n<a;n++){var o=l[n];"Horizontal"===o.orientation?(i.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:i.element.id+"XAxisGroup"})),this.drawXAxisLine(t,o),this.drawXAxisTitle(o,t,o.rect),this.drawXAxisLabels(o,t,o.rect)):(t=i.renderer.createGroup({id:i.element.id+"YAxisGroup"}),this.drawYAxisLine(t,o),this.drawYAxisTitle(o,t,o.rect),this.drawYAxisLabels(o,t,o.rect)),o.multiLevelLabels.length>0&&this.drawMultiLevels(t,o),i.enableCanvasRendering||e.appendChild(t)}i.enableCanvasRendering||this.heatMap.svgObject.appendChild(e)},e.prototype.drawXAxisLine=function(e,t){var i=this.initialClipRect.y+(t.opposedPosition?0:this.initialClipRect.height),l=new ne(this.heatMap.element.id+"_XAxisLine",new le(this.initialClipRect.x,i,this.initialClipRect.x+this.initialClipRect.width,i),"transparent",0);this.drawSvgCanvas.drawLine(l,e)},e.prototype.drawYAxisLine=function(e,t){var i=this.initialClipRect.x+(t.opposedPosition?this.initialClipRect.width:0),l=new ne(this.heatMap.element.id+"_YAxisLine",new le(i,this.initialClipRect.y,i,this.initialClipRect.height+this.initialClipRect.y),"transparent",0);this.drawSvgCanvas.drawLine(l,e)},e.prototype.drawXAxisTitle=function(e,t,i){var l=i.y+(e.opposedPosition?-(e.maxLabelSize.height+this.padding+s(e.xAxisMultiLabelHeight)):e.maxLabelSize.height+this.padding+s(e.xAxisMultiLabelHeight));if(e.title.text){var n=this.heatMap,r=e.title,h=a(r.text,r.textStyle),d=this.padding,p="Near"===r.textStyle.textAlignment?"start":"Far"===r.textStyle.textAlignment?"end":"middle";d=e.opposedPosition?-(d+h.height/4):d+3*h.height/4;var c=new te(n.element.id+"_XAxisTitle",new ie(i.x+o(i.width,0,0,r.textStyle),l+d,p,r.text),r.textStyle,r.textStyle.color||n.themeStyle.axisTitle);this.drawSvgCanvas.createText(c,t,r.text)}},e.prototype.drawYAxisTitle=function(e,t,i){if(e.title.text){var l=e.title,n=this.heatMap,o=e.opposedPosition?90:-90,h=(a(l.text,l.textStyle),"Near"===l.textStyle.textAlignment?"start":"Far"===l.textStyle.textAlignment?"end":"middle"),d=10;d=e.opposedPosition?d:-d;var p=i.x+d+(e.opposedPosition?e.maxLabelSize.width+s(e.yAxisMultiLabelHeight):-(e.maxLabelSize.width+s(e.yAxisMultiLabelHeight))),c=i.y+r(i,0,0,l.textStyle)+(e.opposedPosition?this.padding:-this.padding),g=new te(n.element.id+"_YAxisTitle",new ie(p,c-this.padding,h,l.text,o,"rotate("+o+","+p+","+c+")","auto"),l.textStyle,l.textStyle.color||n.themeStyle.axisTitle);this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(g,l.text,p,c):this.drawSvgCanvas.createText(g,t,l.text)}},e.prototype.calculateVisibleLabels=function(){for(var e,t=this.heatMap.axisCollections,i=this.heatMap.dataSource,l=!(i&&i.isJsonData&&"Cell"===i.adaptorType),n=0,a=t.length;n<a;n++)"Numeric"===(e=t[n]).valueType&&l?(e.clearAxisLabel(),e.calculateNumericAxisLabels(this.heatMap)):"DateTime"===e.valueType&&l?(e.clearAxisLabel(),e.calculateDateTimeAxisLabel(this.heatMap)):"Category"===e.valueType&&(e.clearAxisLabel(),e.calculateCategoryAxisLabels()),e.tooltipLabels=e.isInversed?e.tooltipLabels.reverse():e.tooltipLabels},e.prototype.measureAxis=function(e){for(var t,i=this.heatMap,l=i.axisCollections,n=l.length-1;n>=0;n--){var a="0px"===(t=l[n]).textStyle.size?0:this.padding;t.nearSizes=[],t.farSizes=[],t.computeSize(t,i,e),t.opposedPosition?"Horizontal"===t.orientation?(e.y+=s(t.farSizes)+a,e.height-=s(t.farSizes)+a):e.width-=s(t.farSizes)+a:"Horizontal"===t.orientation?e.height-=s(t.nearSizes)+a:(e.x+=s(t.nearSizes)+a,e.width-=s(t.nearSizes)+a)}},e.prototype.calculateAxisSize=function(e){for(var i=this.heatMap.axisCollections,l=0,n=i.length;l<n;l++){var a=i[l];a.rect=t.extend({},e,null,!0),"Horizontal"!==a.orientation||a.opposedPosition||(a.rect.y=e.y+e.height,a.rect.height=0),"Vertical"===a.orientation&&a.opposedPosition&&(a.rect.x=e.x+e.width,a.rect.width=0),a.multiLevelPosition=[];for(var o=0;o<a.multiLevelLabels.length;o++){var s=a.multiPosition(a,o);a.multiLevelPosition.push(s)}}},e.prototype.drawXAxisLabels=function(e,t,i){var l=this.heatMap,n=e.axisLabels,o=i.width/e.axisLabelSize,s=0,r=e.interval?e.interval:1,d=i.width/(e.axisLabelSize/e.axisLabelInterval),p=e.axisLabelInterval;if(d>0)for(;d<parseInt(e.textStyle.size,10);)p+=1,d=i.width/(e.axisLabelSize/p);else p=e.tooltipLabels.length;e.axisLabelInterval<p&&(s=p,n=e.tooltipLabels,r=p);var g,u=10,v=i.x+(e.isInversed?i.width:0),y=e.angle;u=this.padding;var b,m;l.enableCanvasRendering||(b=this.heatMap.renderer.createGroup({id:l.element.id+"XAxisLabels"}),m=this.heatMap.renderer.createGroup({id:l.element.id+"XAxisLabelBorder"}));for(var x=0,f=n.length;x<f;x++){var S=new ee(v,i.y,o,i.height),C="Trim"===e.labelIntersectAction&&e.isIntersect?"DateTime"!==e.valueType||"None"===e.showLabelOn?c(o*r,n[x],e.textStyle):c(e.dateTimeAxisLabelInterval[x]*o,n[x],e.textStyle):n[x],M=a(C,e.textStyle),w=void 0;g=e.opposedPosition?-u:u+(y%360==0?M.height/2:0);var L=S.x+(e.isInversed?-(S.width/2+M.width/2):S.width/2-M.width/2);"Trim"===e.labelIntersectAction?L=e.isInversed?L>v-o?L:v-o:L>=S.x?L:S.x:y%180==0&&(L=(L=L<i.x?i.x:L)+M.width>i.x+i.width?i.x+i.width-M.width:L);var T=i.y+g;if(this.drawXAxisBorder(e,m,e.rect,L,M.width,x),y%360!=0){y=y>360?y%360:y;var R=h(e.textStyle,C,y),P=e.maxLabelSize.height-Math.ceil(R.height-M.height);e.opposedPosition;w="rotate("+y+","+(L=S.x+(e.isInversed?-S.width/2:S.width/2))+","+(T+=e.opposedPosition?-R.height/2:y%360==180||y%360==-180?0:R.height/2)+")"}var O=new te(l.element.id+"_XAxis_Label"+x,new ie(L,T,y%360==0?"start":"middle",C,y,w),e.textStyle,e.textStyle.color||l.themeStyle.axisLabel);if(0!==y&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(O,C):this.drawSvgCanvas.createText(O,b,C),0===s){var A="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[x]:e.axisLabelInterval;v+=e.isInversed?-A*o:A*o}else v+=e.isInversed?-s*o:s*o;-1!==C.indexOf("...")&&this.heatMap.tooltipCollection.push(new de(n[x],new ee(L,T-M.height,M.width,M.height))),0!==s&&(x+=s-1)}l.enableCanvasRendering||(t.appendChild(b),t.appendChild(m))},e.prototype.drawYAxisLabels=function(e,i,l){var n=this.heatMap,o=e.axisLabels,s=l.height/e.axisLabelSize,r=0,h=l.height/(e.axisLabelSize/e.axisLabelInterval),d=e.axisLabelInterval;if(h>0)for(;h<parseInt(e.textStyle.size,10);)d+=1,h=l.height/(e.axisLabelSize/d);else d=e.tooltipLabels.length;e.axisLabelInterval<d&&(r=d,o=e.tooltipLabels);var p=10,c=l.y+(e.isInversed?0:l.height),g=e.opposedPosition?"start":"end";p=e.opposedPosition?p:-p;var u,v;n.enableCanvasRendering||(u=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabels"}),v=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabelBorder"}));for(var y=0,b=o.length;y<b;y++){var m=new ee(l.x,c,l.width,s),x=m.height/2,f=m.x+p,S=m.y+(e.isInversed?x:-x),C=new te(n.element.id+"_YAxis_Label"+y,new ie(f,S,g,o[y],0,"rotate(0,"+f+","+S+")","middle"),e.textStyle,e.textStyle.color||n.themeStyle.axisLabel);if(t.Browser.isIE&&!n.enableCanvasRendering&&(C.dy="1ex"),this.drawSvgCanvas.createText(C,u,o[y]),0===r){var M="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[y]:e.axisLabelInterval;c+=e.isInversed?M*s:-M*s}else c+=e.isInversed?r*s:-r*s,y+=r-1;var w=a(o[y],e.textStyle);this.drawYAxisBorder(e,v,e.rect,S,w.height,y)}n.enableCanvasRendering||(i.appendChild(u),i.appendChild(v))},e.prototype.drawXAxisBorder=function(e,t,i,l,n,a){var o,s,r=i.width/e.axisLabelSize,h="",d=e.interval?e.interval:1,p=e.isInversed?i.x+i.width-r*a*d:i.x+r*a*d,c=i.y;switch(s=c+(e.opposedPosition?-(e.maxLabelSize.height+10):e.maxLabelSize.height+10),o=e.isInversed?p-r:p+r,e.border.type){case"Rectangle":h="M "+p+" "+c+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+c+" L "+p+" "+c;break;case"WithoutTopBorder":h="M "+p+" "+c+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+c+" ";break;case"WithoutBottomBorder":h="M "+p+" "+s+" L "+p+" "+c+" L "+o+" "+c+" L "+o+" "+s+" ";break;case"WithoutTopandBottomBorder":h="M "+p+" "+c+" L "+p+" "+s+" M "+o+" "+c+" L "+o+" "+s+" ";break;case"Brace":h="M "+p+" "+c+" L "+p+" "+(s=c+(s-c)/2+(e.opposedPosition?0:5))+" L "+(e.isInversed?l+n+3:l-3)+" "+s+" M "+(e.isInversed?l-3:l+n+3)+" "+s+" L "+o+" "+s+" L "+o+" "+c+" "}e.border.width>0&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,h,t,a)},e.prototype.drawYAxisBorder=function(e,t,i,l,n,a){var o,s,r=i.height/e.axisLabelSize,h="",d=e.interval?e.interval:1,p=i.x,c=e.isInversed?i.y+r*a*d:i.y+i.height-r*a*d;switch(o=p+(e.opposedPosition?e.maxLabelSize.width+20:-(e.maxLabelSize.width+20)),s=e.isInversed?c+r:c-r,e.border.type){case"Rectangle":h="M "+p+" "+c+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+c+" L "+p+" "+c;break;case"WithoutTopBorder":h="M "+p+" "+c+" L "+o+" "+c+" L "+o+" "+s+" L "+p+" "+s+" ";break;case"WithoutBottomBorder":h="M "+o+" "+c+" L "+p+" "+c+" L "+p+" "+s+" L "+o+" "+s+" ";break;case"WithoutTopandBottomBorder":h="M "+p+" "+c+" L "+o+" "+c+" M "+o+" "+s+" L "+p+" "+s+" ";break;case"Brace":h="M "+p+" "+c+" L "+(o=p-(p-o)/2)+" "+c+" L "+o+" "+(e.isInversed?l-n/2:l+n/2)+" M "+o+" "+(e.isInversed?l+n/2:l-n/2)+" L "+o+" "+s+" L "+p+" "+s}e.border.width>0&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,h,t,a)},e.prototype.createAxisBorderElement=function(e,t,i,l){var n="Horizontal"===e.orientation?"_XAxis_Label_Border":"_YAxis_Label_Border",a=new q(this.heatMap.element.id+n+l,"transparent",e.border.width,e.border.color,1,"none",t);if(this.heatMap.enableCanvasRendering)this.heatMap.canvasRenderer.drawPath(a,void 0);else{var o=this.heatMap.renderer.drawPath(a);i.appendChild(o)}},e.prototype.drawMultiLevels=function(e,t){var i;this.heatMap.enableCanvasRendering||(i=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_"+t.orientation+"_MultiLevelLabel"})),"Horizontal"===t.orientation?this.renderXAxisMultiLevelLabels(t,i,t.rect):this.renderYAxisMultiLevelLabels(t,i,t.rect),this.heatMap.enableCanvasRendering||e.appendChild(i)},e.prototype.renderXAxisMultiLevelLabels=function(e,t,i){var l,n,o,s,r,h,d,g,u,v,y,b=this,m=0,x=0,f=e.isInversed,S=e.opposedPosition,C="",M=(f?e.rect.width:0)+e.rect.x;e.multiLevelLabels.map(function(i,w){u=b.heatMap.renderer.createGroup({id:b.heatMap.element.id+"_XAxisMultiLevelLabel"+w}),i.categories.map(function(L,T){s=!1,r="number"==typeof L.start?L.start:Number(new Date(L.start)),h="number"==typeof L.end?L.end:Number(new Date(L.end)),n=M+b.calculateLeftPosition(e,r,L.start,e.rect),o=e.multiLevelPosition[w].y,x=M+b.calculateWidth(e,L.end,h,e.rect),d=a(L.text,i.textStyle),v=(null===L.maximumTextWidth?Math.abs(x-n):L.maximumTextWidth)-10,l=o+(S?-(e.xAxisMultiLabelHeight[w]-d.height):d.height),L.maximumTextWidth?L.maximumTextWidth:d.width,m=f?n-v:n+10,"Center"===i.alignment?(m=(x-n)/2+n,m-=(d.width>v?v:d.width)/2):"Far"===i.alignment?(m=f?n-10:x-10,m-=d.width>v?v:d.width):m=f?x+10:n+10,"None"===i.overflow&&d.width>Math.abs(x-n)&&(m=f?n-d.width-10:n+10,g="start");var R=new ie(m,l,g,L.text,0,"translate(0,0)"),P=new te(b.heatMap.element.id+"_XAxis_MultiLevel"+w+"_Text"+T,R,i.textStyle,i.textStyle.color||b.heatMap.themeStyle.axisLabel);if("Wrap"===i.overflow?(P.text=p(L.text,v,i.textStyle),y=P.text.length):"Trim"===i.overflow&&(P.text=c(v,L.text,i.textStyle),y=1),"Wrap"===i.overflow&&P.text.length>1){b.drawSvgCanvas.createWrapText(P,i.textStyle,u);for(var O=0;O<P.text.length;O++)if(-1!==P.text[O].indexOf("...")){s=!0;break}}else b.drawSvgCanvas.createText(P,u,P.text);b.heatMap.enableCanvasRendering||t.appendChild(u),(-1!==P.text.indexOf("...")||-1!==P.text[0].indexOf("...")||s)&&b.heatMap.tooltipCollection.push(new de(L.text,new ee(m,l-d.height,v,d.height*y))),i.border.width>0&&"WithoutBorder"!==i.border.type&&(C=b.renderXAxisLabelBorder(w,e,n,o,x,C,w,d,v,m))}),""!==C&&(b.createBorderElement(w,e,C,t),C="")}),this.heatMap.enableCanvasRendering||t.appendChild(u)},e.prototype.renderXAxisLabelBorder=function(e,t,i,l,n,a,o,s,r,h){var d=l+(t.opposedPosition?-t.xAxisMultiLabelHeight[e]:t.xAxisMultiLabelHeight[e]);switch(t.multiLevelLabels[o].border.type){case"Rectangle":a+="M "+i+" "+l+" L "+i+" "+d+" L "+n+" "+d+" L "+n+" "+l+" L "+i+" "+l+" ";break;case"WithoutTopBorder":a+="M "+i+" "+l+" L "+i+" "+d+" L "+n+" "+d+" L "+n+" "+l+" ";break;case"WithoutBottomBorder":a+="M "+i+" "+d+" L "+i+" "+l+" L "+n+" "+l+" L "+n+" "+d+" ";break;case"WithoutTopandBottomBorder":a+="M "+i+" "+l+" L "+i+" "+d+" M "+n+" "+l+" L "+n+" "+d+" ";break;case"Brace":a+="M "+i+" "+l+" L "+i+" "+(l+(d-l)/2)+" L "+(t.isInversed?(s.width>r?r:s.width)+h+3:h-3)+" "+(l+(d-l)/2)+" M "+(t.isInversed?h-3:(s.width>r?r:s.width)+h+3)+" "+(l+(d-l)/2)+" L "+n+" "+(l+(d-l)/2)+" L "+n+" "+l+" "}return a},e.prototype.renderYAxisMultiLevelLabels=function(e,t,i){var l,n,o,s,r,h,d,g,u,v,y=this,b=0,m=e.isInversed,x=(e.opposedPosition,""),f=(e.rect.height,e.axisLabelSize,e.increment,(m?0:e.rect.height)+e.rect.y);e.multiLevelLabels.map(function(i,S){e.multiLevelPosition[S].y,g=y.heatMap.renderer.createGroup({id:y.heatMap.element.id+"_YAxisMultiLevelLabel"+S}),i.categories.map(function(C,M){r="number"==typeof C.start?C.start:Number(new Date(C.start)),h="number"==typeof C.end?C.end:Number(new Date(C.end)),o=f+y.calculateLeftPosition(e,r,C.start,e.rect),n=e.multiLevelPosition[S].x,s=f+y.calculateWidth(e,C.start,h,e.rect),d=a(C.text,i.textStyle),u=(null===C.maximumTextWidth?Math.abs(n):C.maximumTextWidth)-10;var w=Math.abs(n-(n-e.multiLevelSize[S].width-20))/2-d.width/2;b=(e.opposedPosition?n:n-e.multiLevelSize[S].width-20)+w,l=o+10,"None"!==i.overflow&&(v="Wrap"===i.overflow?p(C.text,u,i.textStyle):c(u,C.text,i.textStyle)),"Center"===i.alignment?l+=(s-o)/2-v.length*d.height/2:l="Far"===i.alignment?m?s-d.height/2:l-d.height:m?l+d.height/2:s+d.height,i.border.width>0&&"WithoutBorder"!==i.border.type&&(x=y.renderYAxisLabelBorder(S,e,n,o,s,x,S,d,u,l));var L=new ie(b,l,"start",C.text,0,"translate(0,0)"),T=new te(y.heatMap.element.id+"_YAxis_MultiLevel"+S+"_Text"+M,L,i.textStyle,i.textStyle.color||y.heatMap.themeStyle.axisLabel);T.text=v,y.drawSvgCanvas.createText(T,g,T.text),-1!==T.text.indexOf("...")&&y.heatMap.tooltipCollection.push(new de(C.text,new ee(b,l-d.height,u,d.height))),y.heatMap.enableCanvasRendering||t.appendChild(g)}),""!==x&&(y.createBorderElement(S,e,x,t),x="")}),this.heatMap.enableCanvasRendering||t.appendChild(g)},e.prototype.renderYAxisLabelBorder=function(e,t,i,l,n,a,o,s,r,h){var d=i-(t.opposedPosition?-(t.multiLevelSize[e].width+20):t.multiLevelSize[e].width+20);switch(t.multiLevelLabels[o].border.type){case"Rectangle":a+="M "+i+" "+l+" L "+d+" "+l+" L "+d+" "+n+" L "+i+" "+n+" L "+i+" "+l+" ";break;case"WithoutTopBorder":a+="M "+i+" "+l+" L "+d+" "+l+" L "+d+" "+n+" L "+i+" "+n+" ";break;case"WithoutBottomBorder":a+="M "+d+" "+l+" L "+i+" "+l+" L "+i+" "+n+" L "+d+" "+n+" ";break;case"WithoutTopandBottomBorder":a+="M "+i+" "+l+" L "+d+" "+l+" M "+i+" "+n+" L "+d+" "+n+" ";break;case"Brace":a+="M "+i+" "+l+" L "+(i+(d-i)/2)+" "+l+" L "+(i+(d-i)/2)+" "+(t.isInversed?h-10-5:h+s.height-10)+" M "+(i+(d-i)/2)+" "+(t.isInversed?h+s.height-10:h-10-5)+" L "+(i+(d-i)/2)+" "+n+" L "+i+" "+n+" "}return a},e.prototype.createBorderElement=function(e,t,i,l){var n="Horizontal"===t.orientation?"XAxis":"YAxis",a=new q(this.heatMap.element.id+"_"+n+"_MultiLevel_Rect_"+e,"Transparent",t.multiLevelLabels[e].border.width,t.multiLevelLabels[e].border.color,1,"",i),o=this.heatMap.renderer.drawPath(a);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(a,void 0):l.appendChild(o)},e.prototype.calculateLeftPosition=function(e,t,i,l){var n,a;if("number"==typeof i){if("Numeric"===e.valueType&&(e.minimum||e.maximum)){t-=e.minimum?e.minimum:0}a=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),n=(e.isInversed?-1:1)*t*a,n="Horizontal"===e.orientation?n:-n}else a=this.calculateNumberOfDays(t,e,!0,l),n=e.isInversed?-a:a,n="Horizontal"===e.orientation?n:-n;return n},e.prototype.calculateWidth=function(e,t,i,l){var n,a;if("number"==typeof t){if("Numeric"===e.valueType&&(e.minimum||e.maximum)){i-=e.minimum?e.minimum:0}n=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),a=(e.isInversed?-1:1)*(i+1)*n,a="Horizontal"===e.orientation?a:-a}else a=n=this.calculateNumberOfDays(i,e,!1,l),a=e.isInversed?-a:a,a="Horizontal"===e.orientation?a:-a;return a},e.prototype.calculateNumberOfDays=function(e,t,i,l){for(var n,a,o,s=t.labelValue,r=("Horizontal"===t.orientation?l.width:l.height)/t.axisLabelSize,h=new Date(Number(e)),d=0,p=0;p<t.axisLabelSize;p++){if(n=new Date(Number(s[p])),a=t.isInversed?new Date(Number(s[p-1])):new Date(Number(s[p+1])),p===(t.isInversed?0:t.axisLabelSize-1))if(a=new Date(Number(s[p])),"Hours"===t.intervalType)a=new Date(Number(a.setHours(a.getHours()+1)));else if("Minutes"===t.intervalType)a=new Date(Number(a.setMinutes(a.getMinutes()+1)));else if("Days"===t.intervalType)a=new Date(Number(a.setDate(a.getDate()+1)));else{var c="Months"===t.intervalType?new Date(a.getFullYear(),a.getMonth()+1,0).getDate():a.getFullYear()%4==0?366:365;a=new Date(Number(a.setDate(a.getDate()+c)))}if(Number(n)<=e&&Number(a)>=e){if("Minutes"===t.intervalType||"Hours"===t.intervalType){d=r/Math.round(Math.abs((n.getTime()-a.getTime())/6e4))*Math.abs((n.getTime()-h.getTime())/6e4),o=(p=t.isInversed?t.axisLabelSize-1-p:p)*r+d;break}c=Math.round(Math.abs((n.getTime()-a.getTime())/864e5));i?h.getDate():h.setDate(h.getDate()+1),0!==c&&(d=r/c*Math.abs((n.getTime()-h.getTime())/864e5)),o=(p=t.isInversed?t.axisLabelSize-1-p:p)*r+d;break}}return o},e}(),Se=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),Ce=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Se(i,e),Ce([t.Property(!0)],i.prototype,"showLabel",void 0),Ce([t.Property("")],i.prototype,"format",void 0),Ce([t.Property(!0)],i.prototype,"enableCellHighlighting",void 0),Ce([t.Complex({},O)],i.prototype,"border",void 0),Ce([t.Complex(w.rectLabelFont,R)],i.prototype,"textStyle",void 0),Ce([t.Property("Rect")],i.prototype,"tileType",void 0),Ce([t.Property("Color")],i.prototype,"bubbleType",void 0),Ce([t.Property(!1)],i.prototype,"isInversedBubbleSize",void 0),i}(t.ChildProperty),we=function(){function e(e){this.heatMap=e,this.drawSvgCanvas=new se(this.heatMap),this.cellColor=new W(this.heatMap)}return e.prototype.renderRectSeries=function(){this.createSeriesGroup();var e=this.heatMap;e.xLength=e.axisCollections[0].axisLabelSize,e.yLength=e.axisCollections[1].axisLabelSize;var i,l,n=Math.round(100*e.initialClipRect.x)/100,a=Math.round(100*e.initialClipRect.y)/100,o=0,s=0,r=e.cellSettings,h=Math.round((e.initialClipRect.width-r.border.width/2)/e.xLength*100)/100,d=Math.round((e.initialClipRect.height-r.border.width/2)/e.yLength*100)/100,p=0,c=(e.themeStyle,[]);i=r.border;var g,u;this.rectPositionCollection=[],this.color="",this.bubbleColorValue=[],e.yAxis.opposedPosition&&(n=Math.round(100*(e.initialClipRect.x+parseFloat(i.width.toString())/2))/100),l=this.getBubbleRadius(h,d);for(var v=0;v<e.xLength*e.yLength;v++){this.setTextAndColor(o,s);var y=new Z(0,0,0,0,0,"",0,0,0,0,!0,"","");if(g=i.color,("Canvas"===e.renderingMode&&0===parseFloat(i.width.toString())||!g&&"Bubble"===r.tileType&&"Sector"===r.bubbleType)&&(g=this.color),this.heatMap.bubbleSizeWithColor?this.updateRectDetails(y,n,a,h,d,t.extend("",this.bubbleColorValue,null,!0),v,s,o):this.updateRectDetails(y,n,a,h,d,this.text,v,s,o),r.showLabel&&(u=this.getFormatedText(this.text,r.format),y.displayText=u,t.isNullOrUndefined(this.heatMap.cellRender)||(u=this.cellRendering(y,u))),"Rect"===r.tileType)this.renderTileCell(y,i,v,this.color,g),this.updateLabelVisibleStatus(h,d,u);else if("Color"===r.bubbleType)this.renderBubbleCell(y,i,v,this.color,g,l),this.updateLabelVisibleStatus(2*l-12,2*l-6,u);else if(t.isNullOrUndefined(this.text)||"Size"!==r.bubbleType&&"SizeAndColor"!==r.bubbleType||""===this.text.toString())"Sector"!==r.bubbleType||t.isNullOrUndefined(this.text)||""===this.text.toString()||(this.renderSectorCell(y,i,v.toString(),this.color,g,l,this.text),this.checkLabelXDisplay=!1,this.checkLabelYDisplay=!1);else{var b=this.getRadiusBypercentage(parseFloat(this.text.toString()),e.dataSourceMinValue,e.dataSourceMaxValue,l);this.renderBubbleCell(y,i,v,this.color,g,b),this.updateLabelVisibleStatus(2*b-12,2*b-6,u)}if(c.push(y),r.showLabel&&this.checkLabelYDisplay&&this.checkLabelXDisplay){var m=r.textStyle,x=new te(e.element.id+"_HeatMapRectLabels_"+v,new ie(Math.round(100*(n+h/2))/100,Math.round(100*(a+d/2))/100,"middle",u,null,null,"middle"),m,m.color||this.getSaturatedColor(this.color));y.textId=x.id,e.rangeSelection&&"Fixed"===e.paletteSettings.type&&this.toggleCellTextColor(y,x,o,s),t.Browser.isIE&&!e.enableCanvasRendering&&(x.dy="Bubble"===this.heatMap.cellSettings.tileType?"0.5ex":"1ex"),this.drawSvgCanvas.createText(x,this.containerTextObject,u)}p===e.xLength-1?(a=Math.round(100*(a+d))/100,p=0,s=0,n=e.yAxis.opposedPosition?Math.round(100*(e.initialClipRect.x+parseFloat(i.width.toString())/2))/100:Math.round(100*e.initialClipRect.x)/100,this.rectPositionCollection.push(c),c=[],o++):(n=Math.round(100*(n+h))/100,p++,s++)}e.enableCanvasRendering||(e.svgObject.appendChild(this.containerRectObject),!r.showLabel||"Bubble"===r.tileType&&"Sector"===r.bubbleType||e.svgObject.appendChild(this.containerTextObject))},e.prototype.toggleCellTextColor=function(e,i,l,n){for(var a=0;a<this.heatMap.toggleValue.length;a++){var o=0===a?this.heatMap.dataSourceMinValue:this.heatMap.toggleValue[a].value,s=a===this.heatMap.toggleValue.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.toggleValue[a+1].value-.01,r=this.heatMap.clonedDataSource,h=t.isNullOrUndefined(r[l][n][1])||""===r[l][n][1].toString()?"":r[l][n][1],d="Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?h:this.text;if(d&&d>=o&&d<=s){if(this.heatMap.toggleValue[a].visible){i.fill=i.fill;break}i.fill=this.heatMap.themeStyle.toggledColor,e.visible=!1;break}}},e.prototype.cellRendering=function(e,t){var i=this.heatMap.axisCollections[0],l=this.heatMap.axisCollections[1],n=i.tooltipLabels,a=l.tooltipLabels.slice().reverse(),o=l.labelValue.slice().reverse(),s={heatmap:this.heatMap,cancel:!1,name:"cellRender",value:e.value,xLabel:n[e.xIndex].toString(),yLabel:a[e.yIndex].toString(),displayText:t,xValue:i.labelValue[e.xIndex],yValue:o[e.yIndex]};return this.heatMap.trigger("cellRender",s),s.displayText},e.prototype.setTextAndColor=function(e,i){this.heatMap.cellSettings;this.bubbleColorValue=[];var l=this.heatMap.dataSource,n=this.heatMap.clonedDataSource;if(this.heatMap.bubbleSizeWithColor){this.text=t.isNullOrUndefined(n[e][i][0])||""===n[e][i][0].toString()?"":n[e][i][0],this.color=t.isNullOrUndefined(n[e][i][1])||""===n[e][i][1].toString()?this.heatMap.isColorValueExist?this.heatMap.emptyPointColor:this.cellColor.getColorByValue(this.text):this.cellColor.getColorByValue(n[e][i][1]);var a=new N(l.isJsonData&&"Cell"===l.adaptorType?this.heatMap.dataSource.bubbleDataMapping.size:null,this.text,"Size");this.bubbleColorValue.push(a),this.bubbleColorValue.push({mappingName:l.isJsonData&&"Cell"===l.adaptorType?this.heatMap.dataSource.bubbleDataMapping.color:null,bubbleData:t.isNullOrUndefined(n[e][i][1])||""===n[e][i][1].toString()?"":n[e][i][1],valueType:"Color"})}else this.text=n[e][i],this.color=this.cellColor.getColorByValue(this.text)},e.prototype.createSeriesGroup=function(){this.heatMap.enableCanvasRendering||(this.containerRectObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_RectGroup",x:this.heatMap.initialClipRect.x,y:this.heatMap.initialClipRect.y,transform:"translate( 0, 0)"}),!this.heatMap.cellSettings.showLabel||"Bubble"===this.heatMap.cellSettings.tileType&&"Sector"===this.heatMap.cellSettings.bubbleType||(this.containerTextObject=this.heatMap.renderer.createGroup({id:this.heatMap.element.id+"_Container_TextGroup",transform:"translate( 0, 0)"})))},e.prototype.updateRectDetails=function(e,t,i,l,n,a,o,s,r){e.x=t,e.y=i,e.width=l,e.height=n,e.value=a,e.id=this.heatMap.element.id+"_HeatMapRect_"+o,e.xIndex=s,e.yIndex=r},e.prototype.renderTileCell=function(e,t,i,l,n){var a=new K(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,new ee(e.x,e.y,e.width,e.height),n||this.heatMap.themeStyle.cellBorder,t.radius,t.radius);this.drawSvgCanvas.drawRectangle(a,this.containerRectObject,!0)},e.prototype.getBubbleRadius=function(e,t){var i=e/2-2;return t/2<e/2&&(i=t/2-2),i<0?0:i},e.prototype.renderSectorCell=function(e,t,i,l,n,a,o){for(var s,r,h,d,p,c,g,u,v,y,b=Math.round(100*(e.x+e.width/2))/100,m=Math.round(100*(e.y+e.height/2))/100,x=l,f=this.getRadiusBypercentage(o,this.heatMap.dataSourceMinValue,this.heatMap.dataSourceMaxValue,360),S=0;S<2;S++){y=parseFloat(t.width.toString()),0===S?(s=f>=180?1:0,r=-90,h=0===f?270:f-90,d=Math.round(100*(b+a*Math.cos((f-90)*(Math.PI/180))))/100,p=Math.round(100*(m+a*Math.sin((f-90)*(Math.PI/180))))/100,c=Math.round(100*b)/100,g=Math.round(100*(m-a))/100,0===f&&(x=this.heatMap.emptyPointColor)):(s=f>=180?0:1,r=h,h=270,x=this.heatMap.emptyPointColor,i+="_Unfilled",u=d,v=p,d=c,p=g,c=u,g=v,0===f&&(y=1,n=l));var C=new oe("",!1,b,m,c,g,d,p,r,h,a,!0),M=new ae(this.heatMap.element.id+"_HeatMapRect_"+i,C,x,t,y,1,n);if(this.calculateShapes(M,C,f,s),this.drawSvgCanvas.drawPath(M,C,this.containerRectObject),360===f)break}},e.prototype.calculateShapes=function(e,i,l,n){var a;switch(l){case 360:case 0:a=0===l&&i.start===i.end?"M "+e.x+" "+e.y+" L "+i.x+" "+(i.y-i.radius):(a=this.heatMap.enableCanvasRendering?"":"M "+e.x+" "+e.y+" ")+"m "+-i.radius+" 0 a "+i.radius+" "+i.radius+" 0 1 0 "+2*i.radius+" 0 a "+i.radius+" "+i.radius+" 0 1 0 "+-2*i.radius+" 0 ",t.merge(e,{d:a});break;default:a="M "+e.x+" "+e.y+" L "+i.x1+" "+i.y1+" A "+i.radius+" "+i.radius+" 0 "+n+" 1 "+i.cx+" "+i.cy+" Z",t.merge(e,{d:a})}},e.prototype.renderBubbleCell=function(e,t,i,l,n,a){var o=new Q(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,n||this.heatMap.themeStyle.cellBorder,Math.round(100*(e.x+e.width/2))/100,Math.round(100*(e.y+e.height/2))/100,a);this.drawSvgCanvas.drawCircle(o,this.containerRectObject)},e.prototype.updateLabelVisibleStatus=function(e,t,i){this.heatMap.cellSettings.showLabel&&(this.checkLabelYDisplay=t>parseInt(this.heatMap.cellSettings.textStyle.size,10),this.checkLabelXDisplay=e>i.length*(parseInt(this.heatMap.cellSettings.textStyle.size,10)/2))},e.prototype.getRadiusBypercentage=function(e,t,i,l){var n=(e-t)/(i-t)*100;return n=isNaN(n)?100:n,l=(this.heatMap.bubbleSizeWithColor||"Bubble"===this.heatMap.cellSettings.tileType&&"Size"===this.heatMap.cellSettings.bubbleType)&&this.heatMap.cellSettings.isInversedBubbleSize?l-l*(n/100):l*(n/100),Math.round(100*l)/100<0?0:Math.round(100*l)/100},e.prototype.getSaturatedColor=function(e){var t=e,i=C(x(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.R+587*i.G+114*i.B)/1e3)>=128?"black":"white"},e.prototype.highlightSvgRect=function(e){if(-1===e.indexOf("Celltooltip"))if(-1!==e.indexOf("_HeatMapRect")){if(-1!==e.indexOf("_HeatMapRectLabels_")){var t=e.indexOf("_HeatMapRectLabels_")+19;e=this.heatMap.element.id+"_HeatMapRect_"+e.slice(t)}var i=document.getElementById(e);if(this.heatMap.tempRectHoverClass!==e){if(this.heatMap.cellSettings.enableCellHighlighting){(l=document.getElementById(this.heatMap.tempRectHoverClass))&&!this.heatMap.rectSelected&&l.setAttribute("opacity","1"),i&&!this.heatMap.rectSelected&&i.setAttribute("opacity","0.65")}this.heatMap.tempRectHoverClass=e}}else if(this.heatMap.cellSettings.enableCellHighlighting){var l;(l=document.getElementById(this.heatMap.tempRectHoverClass))&&!this.heatMap.rectSelected&&(l.setAttribute("opacity","1"),this.heatMap.tempRectHoverClass="")}},e.prototype.getFormatedText=function(e,t){var i=t,l=null!==i.match("{value}");this.format=this.heatMap.intl.getNumberFormat({format:l?"":i});var n="";return""!==e.toString()&&(n=M(l,i,e,this.format)),n},e.prototype.getCurrentRect=function(e,t){var i,l=[];l.push(this.heatMap.heatMapSeries.rectPositionCollection[0][0]);var n=Math.ceil((e-l[0].x)/l[0].width)<this.heatMap.axisCollections[0].axisLabelSize?Math.ceil((e-l[0].x)/l[0].width):this.heatMap.axisCollections[0].axisLabelSize,a=Math.floor((t-l[0].y)/l[0].height)<this.heatMap.axisCollections[1].axisLabelSize?Math.floor((t-l[0].y)/l[0].height):this.heatMap.axisCollections[1].axisLabelSize-1;return n=0===n?1:n,i=this.heatMap.heatMapSeries.rectPositionCollection[a][n-1],this.hoverXAxisLabel=this.heatMap.axisCollections[0].tooltipLabels[n-1],this.hoverXAxisValue=this.heatMap.axisCollections[0].labelValue[n-1],this.hoverYAxisLabel=this.heatMap.axisCollections[1].tooltipLabels[this.heatMap.axisCollections[1].tooltipLabels.length-1-a],this.hoverYAxisValue=this.heatMap.axisCollections[1].labelValue[this.heatMap.axisCollections[1].labelValue.length-1-a],i},e}(),Le=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),Te=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Le(i,e),Te([t.Property("")],i.prototype,"fill",void 0),Te([t.Complex({},A)],i.prototype,"border",void 0),Te([t.Complex(w.tooltipFont,R)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Pe=function(){function e(e){this.isFirst=!0,this.isFadeout=!1,this.heatMap=e}return e.prototype.getModuleName=function(){return"Tooltip"},e.prototype.showHideTooltip=function(e,t){var i=document.getElementById(this.heatMap.element.id+"Celltooltipcontainer");if(e)i.style.visibility="visible";else{if(i&&"hidden"!==i.style.visibility){if(this.tooltipObject&&t)this.tooltipObject.fadeOut();else if(this.tooltipObject&&this.tooltipObject.element){this.tooltipObject.element.firstChild.setAttribute("opacity","0")}i.style.visibility="hidden"}this.isFadeout=!0}},e.prototype.destroy=function(e){},e.prototype.createTooltip=function(e,t,i){var n=null;this.heatMap.cellSettings.showLabel&&this.heatMap.heatMapSeries.checkLabelXDisplay&&this.heatMap.heatMapSeries.checkLabelYDisplay&&(n=parseInt(this.heatMap.cellSettings.textStyle.size,10)/2),this.tooltipObject=new l.Tooltip({enableAnimation:!1,offset:n,location:{x:e,y:t},theme:this.heatMap.theme,content:i,fill:this.heatMap.tooltipSettings.fill,border:{width:this.heatMap.tooltipSettings.border.width,color:this.heatMap.tooltipSettings.border.color},textStyle:{size:this.heatMap.tooltipSettings.textStyle.size,fontWeight:this.heatMap.tooltipSettings.textStyle.fontWeight,color:this.heatMap.tooltipSettings.textStyle.color,fontStyle:this.heatMap.tooltipSettings.textStyle.fontStyle,fontFamily:this.heatMap.tooltipSettings.textStyle.fontFamily},areaBounds:{height:this.heatMap.initialClipRect.height+this.heatMap.initialClipRect.y,width:this.heatMap.initialClipRect.width,x:this.heatMap.initialClipRect.x}},"#"+this.heatMap.element.id+"Celltooltipcontainer")},e.prototype.createTooltipDiv=function(e){var i=t.createElement("div",{id:this.heatMap.element.id+"Celltooltipcontainer",styles:"position:absolute; z-index: 3"});this.heatMap.element.appendChild(t.createElement("div",{id:this.heatMap.element.id+"Celltooltipparent",styles:"position:relative"}).appendChild(i))},e.prototype.getTooltipContent=function(e,t){var i,l,n=this.heatMap,a=this.heatMap.dataSource;if(n.bubbleSizeWithColor){var o=n.xAxis.title&&""!==n.xAxis.title.text?n.xAxis.title.text:"X-Axis",s=n.yAxis.title&&""!==n.yAxis.title.text?n.yAxis.title.text:"Y-Axis",r=a.isJsonData&&"Cell"===a.adaptorType?n.dataSource.bubbleDataMapping.size:"Value 1",h=a.isJsonData&&"Cell"===a.adaptorType?n.dataSource.bubbleDataMapping.color:"Value 2";i=t.getFormatedText(e.value[0].bubbleData,this.heatMap.cellSettings.format),l=[o+" : "+t.hoverXAxisLabel+"<br/>"+s+" : "+t.hoverYAxisLabel+"<br/>"+r+" : "+i+"<br/>"+h+" : "+t.getFormatedText(e.value[1].bubbleData,this.heatMap.cellSettings.format)]}else i=e.value,l=[t.hoverXAxisLabel+" | "+t.hoverYAxisLabel+" : "+t.getFormatedText(i,this.heatMap.cellSettings.format)];return l},e.prototype.renderTooltip=function(e){var i=this.heatMap.heatMapSeries,l=[""];if(this.heatMap.bubbleSizeWithColor?!t.isNullOrUndefined(e.value)&&!t.isNullOrUndefined(e.value[0].bubbleData)&&""!==e.value[0].bubbleData.toString():!(t.isNullOrUndefined(e.value)||!t.isNullOrUndefined(e.value)&&""===e.value.toString())){if(t.isNullOrUndefined(this.heatMap.tooltipRender))l=this.getTooltipContent(e,i);else{var n=this.getTooltipContent(e,i),a={heatmap:this.heatMap,cancel:!1,name:"tooltipRender",value:e.value,xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null,content:n};if(this.heatMap.trigger("tooltipRender",a),a.cancel)return void(this.tooltipObject&&this.showHideTooltip(!1));l=a.content}this.tooltipObject?this.tooltipObject.content=l:this.createTooltip(e.x+e.width/2,e.y+e.height/2,l),this.showHideTooltip(!0),this.tooltipObject.enableAnimation=!this.isFirst&&!this.isFadeout,this.isFirst=!this.isFirst&&this.isFirst,this.isFadeout=!this.isFadeout&&this.isFadeout,this.tooltipObject.location.x=e.x+e.width/2,this.tooltipObject.location.y=e.y+e.height/2}else this.showHideTooltip(!1,!1);e.visible||this.showHideTooltip(!1,!1)},e}(),Oe=function(){function e(e){this.heatMap=e}return e.prototype.processDataSource=function(e){var i=t.extend([],e,null,!0);this.heatMap.clonedDataSource=[],this.completeDataSource=[];var l,n,a,o=this.heatMap.axisCollections,s=o[0].maxLength+1,r=o[0].axisLabelSize+(o[0].min>0?o[0].min:0),h=s>r?s:r,d=(s=o[1].maxLength+1)>(r=o[1].axisLabelSize+(o[1].min>0?o[1].min:0))?s:r,p=0,c=[];this.tempSizeArray=[],this.tempColorArray=[],this.heatMap.minColorValue=null,this.heatMap.maxColorValue=null;for(var g="Category"===o[1].valueType?o[1].min:0;g<d;g++){var u="Category"===o[0].valueType?o[0].min:0;for(this.completeDataSource.push([]);u<h;)u>=o[0].min&&u<=o[0].max&&this.processDataArray(i,u,g,p),u++;a=t.extend([],this.completeDataSource[p],null,!0);var v=this.getMinMaxValue(l,n,a);l=v[0],n=v[1],this.heatMap.xAxis.isInversed&&(this.completeDataSource[p]=this.completeDataSource[p].reverse()),g>=this.heatMap.axisCollections[1].min&&g<=this.heatMap.axisCollections[1].max&&c.push(this.completeDataSource[p]),p++}this.heatMap.yAxis.isInversed||(this.completeDataSource.reverse(),c.reverse()),this.heatMap.clonedDataSource=c,this.heatMap.dataSourceMinValue=t.isNullOrUndefined(l)?0:parseFloat(l.toString()),this.heatMap.dataSourceMaxValue=t.isNullOrUndefined(n)?0:parseFloat(n.toString()),this.heatMap.isColorValueExist=!t.isNullOrUndefined(this.heatMap.minColorValue),this.heatMap.minColorValue=t.isNullOrUndefined(this.heatMap.minColorValue)?this.heatMap.dataSourceMinValue:parseFloat(this.heatMap.minColorValue.toString()),this.heatMap.maxColorValue=t.isNullOrUndefined(this.heatMap.maxColorValue)?this.heatMap.dataSourceMaxValue:parseFloat(this.heatMap.maxColorValue.toString())},e.prototype.processDataArray=function(e,i,l,n){if(this.heatMap.bubbleSizeWithColor)if(e[i]&&!t.isNullOrUndefined(e[i][l])&&"object"==typeof e[i][l]){for(var a=e[i][l],o=0;o<a.length;o++)if(t.isNullOrUndefined(a[o])&&(a[o]=""),0===o)this.tempSizeArray.push(a[o]);else if(1===o){this.tempColorArray.push(a[o]);break}this.completeDataSource[n].push(a)}else!t.isNullOrUndefined(e[i])&&(e[i][l]||0===e[i][l]&&""!==e[i][l].toString())?(this.completeDataSource[n].push([e[i][l]]),this.tempSizeArray.push(e[i][l])):this.completeDataSource[n].push("");else e[i]&&(e[i][l]||0===e[i][l]&&""!==e[i][l].toString())?"object"==typeof e[i][l]?e[i][l].length>0&&!t.isNullOrUndefined(e[i][l][0])?this.completeDataSource[n].push(e[i][l][0]):this.completeDataSource[n].push(""):this.completeDataSource[n].push(e[i][l]):this.completeDataSource[n].push("")},e.prototype.getMinMaxValue=function(e,t,i){var l=[];return this.heatMap.bubbleSizeWithColor?(l.push(this.getMinValue(e,this.tempSizeArray)),l.push(this.getMaxValue(t,this.tempSizeArray)),this.heatMap.minColorValue=this.getMinValue(this.heatMap.minColorValue,this.tempColorArray),this.heatMap.maxColorValue=this.getMaxValue(this.heatMap.maxColorValue,this.tempColorArray)):(l.push(this.getMinValue(e,i)),l.push(this.getMaxValue(t,i))),l},e.prototype.getMinValue=function(e,i){return t.isNullOrUndefined(e)?e=this.performSort(i):this.performSort(i)<e&&(e=this.performSort(i)),t.isNullOrUndefined(e)?e:parseFloat(e.toString())},e.prototype.getMaxValue=function(e,i){return t.isNullOrUndefined(e)&&i.length>0?e=Math.max.apply(Math,i):Math.max.apply(Math,i)>e&&(e=Math.max.apply(Math,i)),t.isNullOrUndefined(e)?e:parseFloat(e.toString())},e.prototype.performSort=function(e){return e.sort(function(e,t){return e-t}).filter(this.checkmin)[0]},e.prototype.checkmin=function(e){return!t.isNullOrUndefined(e)&&""!==e.toString()},e}(),Ae=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),De=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ae(i,e),De([t.Property("")],i.prototype,"height",void 0),De([t.Property("")],i.prototype,"width",void 0),De([t.Property("Right")],i.prototype,"position",void 0),De([t.Property(!0)],i.prototype,"visible",void 0),De([t.Property("Center")],i.prototype,"alignment",void 0),De([t.Property(!0)],i.prototype,"showLabel",void 0),De([t.Property(!0)],i.prototype,"showGradientPointer",void 0),De([t.Property(!1)],i.prototype,"enableSmartLegend",void 0),De([t.Property("All")],i.prototype,"labelDisplayType",void 0),De([t.Complex(w.legendLabelFont,R)],i.prototype,"textStyle",void 0),De([t.Property("")],i.prototype,"labelFormat",void 0),De([t.Property(!0)],i.prototype,"toggleVisibility",void 0),i}(t.ChildProperty),_e=function(){function e(e){this.maxLegendLabelSize=new U(0,0),this.gradientScaleSize=10,this.segmentCollections=[],this.textWrapCollections=[],this.labelCollections=[],this.legendSize=10,this.previousOptions=new ce(0,0,0,0,0,0),this.listPerPage=0,this.numberOfPages=1,this.listWidth=0,this.fillRect=new ee(0,0,0,0),this.legendRect=new ee(0,0,0,0),this.currentPage=1,this.lastList=[],this.navigationCollections=[],this.pagingRect=new ee(0,0,0,0),this.listInterval=10,this.legendLabelTooltip=[],this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],this.legendRectPositionCollection=[],this.legendRange=[],this.legendTextRange=[],this.visibilityCollections=[],this.heatMap=e,this.drawSvgCanvas=new se(e)}return e.prototype.getModuleName=function(){return"Legend"},e.prototype.destroy=function(e){},e.prototype.renderLegendItems=function(){var e=this.heatMap,i={color:"transparent",width:0};this.legend=e.renderer.createGroup({id:e.element.id+"_Heatmap_Legend"});var l=new K(e.element.id+"_LegendBound","none",i,1,this.legendGroup);this.drawSvgCanvas.drawRectangle(l,this.legend);var n=this.legendRectScale,a=new ee(n.x,n.y,n.width,n.height);if("Fixed"===e.paletteSettings.type){var o=e.legendSettings.enableSmartLegend?e.legendColorCollection:e.colorCollection;this.legendRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendRange,this.legendTextRange=e.resizing||!e.legendOnLoad&&e.rendering?[]:this.legendTextRange,e.toggleValue=[];for(var s=0;s<o.length;s++){var r=!!t.isNullOrUndefined(this.visibilityCollections[s])||this.visibilityCollections[s];e.toggleValue.push(new ve(r,o[s].value))}}if("Gradient"===e.paletteSettings.type||"Fixed"===e.paletteSettings.type&&!0===e.legendSettings.enableSmartLegend){if("Gradient"===e.paletteSettings.type){var h=void 0;if(e.enableCanvasRendering){var d=void 0,p=e.canvasRenderer.ctx;d=e.horizontalGradient?p.createLinearGradient(n.x,0,n.x+n.width,0):p.createLinearGradient(0,n.y,0,n.y+n.height);for(s=0;s<e.legendColorCollection.length;s++){var c=(e.legendColorCollection[s].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);c=isNaN(c)?0:c,d.addColorStop(c,e.legendColorCollection[s].color)}p.fillStyle=d,h=d.toString()}else{var g=void 0,u=void 0,v=[];for(s=0;s<e.legendColorCollection.length;s++){var y=(e.legendColorCollection[s].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100;if(y=isNaN(y)?0:y,u=new he(e.legendColorCollection[s].color,y+"%"),v.push(u),this.legendMaxValue===this.legendMinValue)break}g=e.horizontalGradient?new re(e.element.id+"_lineargradient","0%","100%","0%","0%"):new re(e.element.id+"_lineargradient","0%","0%","0%","100%");var b=e.renderer.drawGradient("linearGradient",g,v);this.legend.appendChild(b),h="url(#"+e.element.id+"_lineargradient)"}var m=new K(e.element.id+"_Gradient_Legend",h,i,1,a);this.drawSvgCanvas.drawRectangle(m,this.legend),this.renderColorAxisGrid(a)}else this.renderSmartLegend();e.enableCanvasRendering||e.svgObject.appendChild(this.legend),this.renderLegendLabel(a)}else{this.legendScale=e.renderer.createGroup({id:e.element.id+"Heatmap_GradientScale"});var x=new K(e.element.id+"_Gradient_Scale","none",i,1,this.legendRectScale);this.drawSvgCanvas.drawRectangle(x,this.legendScale),e.enableCanvasRendering||this.legend.appendChild(this.legendScale),this.translategroup=e.renderer.createGroup({id:e.element.id+"_translate"}),this.calculateListPerPage(a),this.numberOfPages>1&&(this.paginggroup=e.renderer.createGroup({id:e.element.id+"_navigation"})),this.renderListLegendMode(a,!0)}},e.prototype.renderSmartLegend=function(){var e,i,l,n,o,s=this.heatMap,r=s.colorCollection,h={color:"transparent",width:0},p=this.legendRectScale,c=p.width/r.length,g=p.height/r.length;this.legendRectPositionCollection=[],this.legendRange=[];for(var u=0;u<s.legendColorCollection.length;u++){var v=new ge(0,0,0,0,"","");s.horizontalGradient?(i=p.x+u*c,l=p.y,n=c,o=p.height,this.segmentCollections.push("Edge"!==s.legendSettings.labelDisplayType||u!==s.legendColorCollection.length-1||s.legendColorCollection[u].isHidden?i:i+c)):(i=p.x,l=p.y+u*g,n=p.width,o=g,this.segmentCollections.push("Edge"!==s.legendSettings.labelDisplayType||u!==s.legendColorCollection.length-1||s.legendColorCollection[u].isHidden?l:l+g)),e=new ee(i,l,n,o);var y=new ue(0,0,0,0,0,!0,0);if(y.x=i,y.y=l,y.width=n,y.height=o,y.value=s.legendColorCollection[u].value,y.currentPage=this.currentPage,r.length!==s.legendColorCollection.length&&u===s.legendColorCollection.length-1&&(s.horizontalGradient?y.width=0:y.height=0,this.visibilityCollections[u]=this.visibilityCollections[u-1]),y.visible=!!t.isNullOrUndefined(this.visibilityCollections[u])||this.visibilityCollections[u],this.legendRange.push(y),!s.legendColorCollection[u].isHidden){var b=s.legendOnLoad?r[u].color:this.legendRange[u].visible?r[u].color:"#D3D3D3",m=new K(s.element.id+"_Smart_Legend"+u,b,h,1,e);this.drawSvgCanvas.drawRectangle(m,this.legend),v.x=i,v.y=l,v.width=n,v.height=o,v.label=this.labelCollections[u],v.id=s.element.id+"_Smart_Legend"+u,this.legendRectPositionCollection.push(v);if(0!==d(this.labelCollections[u],s.legendSettings.textStyle,this.textWrapCollections[u]).length&&s.enableCanvasRendering){var x=a(this.labelCollections[u],s.legendSettings.textStyle);this.legendLabelTooltip.push(new de(this.labelCollections[u],new ee(v.x,v.y,x.width,x.height)))}}}},e.prototype.renderLegendLabel=function(e){var i=this.heatMap;if(this.legendTextRange=[],i.legendSettings.showLabel&&("Gradient"===i.paletteSettings.type||"Fixed"===i.paletteSettings.type&&"None"!==i.legendSettings.labelDisplayType)){var l=void 0,n=void 0,o=void 0,s=0,r=void 0;this.legendLabelTooltip=[];var h=void 0,p=i.legendColorCollection;if(i.enableCanvasRendering){var c=i.canvasRenderer.ctx;c.rect(this.legendGroup.x,this.legendGroup.y,this.legendGroup.width,this.legendGroup.height),c.save(),c.clip(),c.restore()}else o=i.renderer.createGroup({id:i.element.id+"_Heatmap_LegendLabel"});for(var g=void 0,u=void 0,v=0;v<p.length;v++){var y=(p[v].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100;if(i.horizontalGradient?(g=this.segmentCollections[v],u=e.y+e.height+this.labelPadding,l=0===y||0===v&&"Fixed"===i.paletteSettings.type?"start":i.dataSourceMaxValue===p[v].value||i.legendSettings.enableSmartLegend&&"Edge"===i.legendSettings.labelDisplayType?"end":"middle",n="hanging"):(g=e.x+e.width+this.labelPadding,u=this.segmentCollections[v],n=0===y||0===v&&"Fixed"===i.paletteSettings.type?"hanging":i.dataSourceMaxValue===p[v].value||i.legendSettings.enableSmartLegend&&"Edge"===i.legendSettings.labelDisplayType?"baseline":"middle"),s=i.horizontalGradient?this.textWrapCollections[v]:this.width-(this.legendRectScale.width+this.labelPadding+this.legendRectPadding),r=d(this.labelCollections[v],i.legendSettings.textStyle,s),h=a(r[0],i.legendSettings.textStyle),"Fixed"===i.paletteSettings.type){var b="hanging"===n?u:"middle"===n?u-h.height/2:u-h.height,m="end"===l?g-h.width:"middle"===l?g-h.width/2:g,x=new ue(m,b,h.width,h.height,p[v].value,!0,this.currentPage);x.visible=!!t.isNullOrUndefined(this.visibilityCollections[v])||this.visibilityCollections[v],this.legendTextRange.push(x)}if(""!==this.labelCollections[v]){0!==r.length&&-1!==r[0].indexOf("...")&&i.enableCanvasRendering&&this.legendLabelTooltip.push(new de(this.labelCollections[v],new ee(g,u,h.width,h.height)));var f=new ie(g,u,l,r,0,"translate(0,0)",n),S=new te(i.element.id+"_Legend_Label"+v,f,i.legendSettings.textStyle,i.legendSettings.textStyle.color||i.themeStyle.legendLabel);S.fill=i.legendOnLoad?S.fill:"Fixed"!==i.paletteSettings.type||this.legendRange[v].visible?S.fill:"#D3D3D3",r.length>1?this.drawSvgCanvas.createWrapText(S,i.legendSettings.textStyle,o):this.drawSvgCanvas.createText(S,o,r[0]),t.Browser.isIE&&!i.enableCanvasRendering&&("middle"===n?o.lastChild.setAttribute("dy","0.6ex"):"hanging"===n&&o.lastChild.setAttribute("dy","1.5ex"))}if(this.legendMaxValue===this.legendMinValue&&"Gradient"===i.paletteSettings.type)break}if(!i.enableCanvasRendering){this.legendGroup.height=this.legendGroup.height>0?this.legendGroup.height:0,this.legendGroup.width=this.legendGroup.width>0?this.legendGroup.width:0,this.legend.appendChild(o);var C=i.renderer.createClipPath({id:i.element.id+"_clipPath"}),M=i.renderer.drawRectangle(this.legendGroup);C.appendChild(M),i.svgObject.appendChild(C),this.legend.setAttribute("style","clip-path:url(#"+C.id+")")}}},e.prototype.renderGradientPointer=function(e,t,i){var l,n,a,o,s,r,h,d,p,c=this.heatMap,g=c.heatMapSeries.getCurrentRect(t,i),u=c.bubbleSizeWithColor?""!==g.value[0].bubbleData.toString()?this.heatMap.isColorValueExist?g.value[1].bubbleData.toString():g.value[0].bubbleData.toString():"":g.value.toString(),v=this.legendRectScale;if(""!==u.toString())if(c.horizontalGradient?(a=v.width/100*((Number(u)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,a=isNaN(a)?0:a,o=v.x+a,s=v.y+v.height,r=v.x-5+a,h=p=v.y+v.height+8,d=v.x+5+a):(a=v.height/100*((Number(u)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,a=isNaN(a)?0:a,o=v.x-1,s=v.y+a,r=d=v.x-8,h=v.y-5+a,p=v.y+5+a),l="M "+o+" "+s+" L "+r+" "+h+" L "+d+" "+p+" Z",n=new q(c.element.id+"_Gradient_Pointer","gray",.01,"#A0A0A0",1,"0,0",l),c.enableCanvasRendering){this.removeGradientPointer();c.canvasRenderer.drawPath(n,void 0),this.previousOptions.pathX1=o,this.previousOptions.pathY1=s,this.previousOptions.pathX2=r,this.previousOptions.pathY2=h,this.previousOptions.pathX3=d,this.previousOptions.pathY3=p}else this.gradientPointer=c.renderer.drawPath(n),this.gradientPointer.style.visibility="visible",this.legend.appendChild(this.gradientPointer);else this.removeGradientPointer()},e.prototype.removeGradientPointer=function(){var e=this.heatMap;this.gradientPointer&&!e.enableCanvasRendering?this.gradientPointer.style.visibility="hidden":e.enableCanvasRendering&&(0!==Object.keys(this.previousOptions).length&&(e.horizontalGradient?(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY1,this.fillRect.width=this.previousOptions.pathX3-this.previousOptions.pathX2+2,this.fillRect.height=this.previousOptions.pathY2+1-this.previousOptions.pathY1):(this.fillRect.x=this.previousOptions.pathX2-1,this.fillRect.y=this.previousOptions.pathY2-1,this.fillRect.width=this.previousOptions.pathX1-this.previousOptions.pathX2+1,this.fillRect.height=this.previousOptions.pathY3-this.previousOptions.pathY2+2)),e.canvasRenderer.ctx.fillStyle=e.themeStyle.background,e.canvasRenderer.ctx.fillRect(this.fillRect.x,this.fillRect.y,this.fillRect.width,this.fillRect.height))},e.prototype.calculateLegendBounds=function(e){var t=this.heatMap,i=t.legendSettings,l=t.legendColorCollection;this.labelCollections=[],"Bottom"!==i.position&&"Top"!==i.position&&"Right"!==i.position&&"Left"!==i.position&&(i.position="Right"),t.horizontalGradient="Bottom"===i.position||"Top"===i.position,this.legendRectPadding=t.horizontalGradient?16:10,this.labelPadding=i.showLabel?this.heatMap.horizontalGradient?10:6:0,this.legendHeight=i.height,this.legendWidth=i.width;var a=t.legendSettings.labelFormat,o=null!==a.match("{value}");if(this.format=t.intl.getNumberFormat({format:o?"":a}),"Fixed"===t.paletteSettings.type)for(var s=0;s<l.length;s++){var r=l[s].label?l[s].label:M(o,a,l[s].value,this.format).toString();t.legendSettings.enableSmartLegend&&"Edge"===t.legendSettings.labelDisplayType&&s>0&&s<l.length-1?this.labelCollections.push(""):this.labelCollections.push(r)}else for(s=0;s<l.length;s++){r=l[s].isHidden?"":l[s].label?l[s].label:M(o,a,l[s].value,this.format).toString();this.labelCollections.push(r)}"Gradient"===t.paletteSettings.type||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend?(this.maxLegendLabelSize=this.getMaxLabelSize(),t.horizontalGradient&&""===i.height?this.legendHeight=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.height).toString():!t.horizontalGradient&&""===i.width&&("None"===i.textStyle.textOverflow||"Fixed"===t.paletteSettings.type&&t.legendSettings.enableSmartLegend&&"None"===t.legendSettings.labelDisplayType)&&(this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.width).toString())):this.calculateListLegendBounds(e),this.legendHeight=this.legendHeight?this.legendHeight:t.horizontalGradient?"50":"100%",this.legendWidth=this.legendWidth?this.legendWidth:t.horizontalGradient?"100%":"Fixed"!==t.paletteSettings.type||t.legendSettings.enableSmartLegend?"50":"70",this.height=n(this.legendHeight,e.height),this.width=n(this.legendWidth,e.width),t.horizontalGradient?(this.height=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.height<50?50:this.height,"Top"===i.position&&(e.y+=this.height),e.height-=this.height):(this.width=("Gradient"===t.paletteSettings.type||t.legendSettings.enableSmartLegend)&&this.width<50?50:this.width,"Left"===i.position&&(e.x+=this.width),e.width-=this.width)},e.prototype.calculateListLegendBounds=function(e){var t=this.heatMap;this.listWidth=0,this.listHeight=0,this.currentPage=1;if(t.horizontalGradient){for(var i=0;i<t.colorCollection.length;i++){var l=0;if(t.legendSettings.showLabel){l=a(this.labelCollections[i],t.legendSettings.textStyle).width}var o=this.legendSize+this.labelPadding+l+this.listInterval;this.listWidth+=o}this.listWidth+=this.listInterval+10,""===this.legendWidth&&(this.legendWidth=this.listWidth>e.width?e.width.toString():this.listWidth.toString()),""===this.legendHeight&&(this.numberOfRows=Math.ceil(this.listWidth/n(this.legendWidth,e.width)),this.numberOfRows=this.numberOfRows>3?3:this.numberOfRows,this.legendHeight=(this.listWidth>e.width||this.listWidth>n(this.legendWidth,e.width))&&this.numberOfRows>3?((this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding+parseInt(t.legendSettings.textStyle.size,10)+10).toString():((this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding).toString())}else this.listHeight=(this.legendSize+this.listInterval)*t.colorCollection.length+this.listInterval,""===this.legendHeight&&(this.legendHeight=this.listHeight>e.height?e.height.toString():this.listHeight.toString()),""===this.legendWidth&&"Trim"!==t.legendSettings.textStyle.textOverflow&&(this.maxLegendLabelSize=this.getMaxLabelSize(),this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.labelPadding+this.maxLegendLabelSize.width).toString());n(this.legendHeight,e.height)<50&&(this.legendHeight="50"),n(this.legendWidth,e.width)<70&&(this.legendWidth="70")},e.prototype.getMaxLabelSize=function(){var e=this.heatMap;if(this.maxLegendLabelSize=new U(0,0),!e.legendSettings.showLabel||e.horizontalGradient&&"Fixed"===e.paletteSettings.type&&!e.legendSettings.enableSmartLegend||"Fixed"===e.paletteSettings.type&&"None"===e.legendSettings.labelDisplayType)return this.maxLegendLabelSize;for(var t=this.maxLegendLabelSize,i=0;i<e.legendColorCollection.length;i++){var l=a(this.labelCollections[i],e.legendSettings.textStyle);t.width=t.width>l.width?t.width:l.width,t.height=t.height>l.height?t.height:l.height}return t},e.prototype.calculateLegendSize=function(e,t){var i,l,o=this.heatMap,r=o.legendSettings,h=r.alignment,d=n(this.legendHeight,e.height),p=n(this.legendWidth,e.width),c=o.axisCollections,g=0;if(o.horizontalGradient){p=p>e.width?e.width:p,d="Gradient"===o.paletteSettings.type||o.legendSettings.enableSmartLegend?d>50?d:50:this.height,i="Near"===h?e.x:"Far"===h?e.x+e.width-p:e.x+e.width/2-p/2,""!==o.xAxis.title.text&&(g=a(o.xAxis.title.text,o.xAxis.textStyle).height+10);var u=c[0].opposedPosition?0:s(c[0].xAxisMultiLabelHeight)+c[0].maxLabelSize.height+g+10;l="Top"===r.position?o.titleSettings.text?t:o.margin.top:e.y+e.height+u}else{d=d>e.height?e.height:d,p="Gradient"===o.paletteSettings.type||o.legendSettings.enableSmartLegend?p>50?p:50:p,l="Near"===h?e.y:"Far"===h?e.y+e.height-d:e.y+e.height/2-d/2,""!==o.yAxis.title.text&&(g=a(o.yAxis.title.text,o.yAxis.textStyle).height+10);var v=c[1].opposedPosition?s(c[1].yAxisMultiLabelHeight)+c[1].maxLabelSize.width+g+20:0;i="Right"===r.position?e.x+e.width+v:o.margin.left}this.legendGroup=new ee(i,l,p,d),this.calculateGradientScale(this.legendGroup)},e.prototype.measureListLegendBound=function(e){var t=this.heatMap;if(this.numberOfPages=1,t.horizontalGradient)this.listWidth>this.width?(this.numberOfRows=Math.ceil(this.listWidth/this.width),this.listHeight=(this.legendSize+this.listInterval)*this.numberOfRows,this.listPerPage=this.numberOfRows<=3?this.numberOfRows:Math.ceil((this.height-15-parseInt(t.legendSettings.textStyle.size,10)-this.legendRectPadding)/(this.legendSize+this.listInterval)),this.numberOfPages=Math.ceil(this.numberOfRows/this.listPerPage)):this.listPerPage=1;else if(this.listHeight>e.height||this.listHeight>this.height){var i=n(this.legendHeight,e.height);i=i>e.height?e.height:i,this.listPerPage=Math.floor(i/(this.legendSize+this.listInterval)-1),this.numberOfPages=Math.max(1,Math.ceil(t.colorCollection.length/this.listPerPage))}else this.listPerPage=t.colorCollection.length,this.legendHeight=this.listHeight.toString()},e.prototype.renderPagingElements=function(){var e=this.heatMap;if(this.numberOfPages>1){this.navigationCollections=[],this.legend.appendChild(this.paginggroup);var i=this.legendGroup.x+this.legendGroup.width-10,l=this.legendGroup.y+this.legendGroup.height-10,n=this.currentPage+"/"+this.numberOfPages,o=a(n,e.legendSettings.textStyle),s=i-o.width-15,r=new ie(s,l,"start",n,0,"translate(0,0)","middle"),h=new te(e.element.id+"_paging",r,e.legendSettings.textStyle,e.legendSettings.textStyle.color||e.themeStyle.legendLabel);this.drawSvgCanvas.createText(h,this.paginggroup,n),t.Browser.isIE&&!e.enableCanvasRendering&&this.paginggroup.lastChild.setAttribute("dy","0.6ex"),this.pagingRect=new ee(s,l-o.height/2,o.width,o.height);var d=new K(e.element.id+"_pagingText","none",{color:"transparent",width:0},1,this.pagingRect);this.drawSvgCanvas.drawRectangle(d,this.paginggroup);var p=new K(e.element.id+"_rightArrow","none",{color:"transparent",width:0},1,new ee(i-10,l-5,10,10));this.drawSvgCanvas.drawRectangle(p,this.paginggroup);var c="M "+i+" "+l+" L "+(i-10)+" "+(l-5)+" L "+(i-10)+" "+(l+5)+"Z",g=s-15,u="M "+g+" "+l+" L "+(g+10)+" "+(l-5)+" L "+(g+10)+" "+(l+5)+"Z",v=new K(e.element.id+"_leftArrow","none",{color:"transparent",width:0},1,new ee(g,l-5,10,10));this.drawSvgCanvas.drawRectangle(v,this.paginggroup);var y=new q(e.element.id+"_Legend_leftarrow","gray",.01,"#A0A0A0",1,"0,0",u),b=new q(e.element.id+"_Legend_rightarrow","gray",.01,"#A0A0A0",1,"0,0",c);if(this.navigationCollections.push(p),this.navigationCollections.push(v),e.enableCanvasRendering){e.canvasRenderer.drawPath(y,void 0),e.canvasRenderer.drawPath(b,void 0)}else{var m=e.renderer.drawPath(y),x=e.renderer.drawPath(b);this.paginggroup.appendChild(m),this.paginggroup.appendChild(x)}}},e.prototype.calculateGradientScale=function(e){var t,i,l,n,a=this.heatMap;"Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend||this.measureListLegendBound(a.initialClipRect),a.horizontalGradient?(t=e.x+10,i=e.y+this.legendRectPadding,n="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?e.width-20:e.width-2*this.listInterval,l="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?this.gradientScaleSize:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval):(t=e.x+this.legendRectPadding,i=e.y+10,n="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?this.gradientScaleSize:e.width-10,l="Fixed"!==a.paletteSettings.type||a.legendSettings.enableSmartLegend?e.height-20:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval),this.legendRectScale=new ee(t,i,n,l),("Gradient"===a.paletteSettings.type||"Fixed"===a.paletteSettings.type&&a.legendSettings.enableSmartLegend)&&this.calculateColorAxisGrid(this.legendRectScale)},e.prototype.calculateColorAxisGrid=function(e){var t,i,l=this.heatMap,n=this.legendRectScale,a=0;this.segmentCollections=[],this.textWrapCollections=[];var o,s,r="Gradient"===l.paletteSettings.type?l.legendColorCollection:l.colorCollection,h=l.bubbleSizeWithColor?l.minColorValue:l.dataSourceMinValue,p=l.bubbleSizeWithColor?l.maxColorValue:l.dataSourceMaxValue;if(this.legendMinValue=r[0].value>h?h:r[0].value,this.legendMaxValue=r[r.length-1].value<p?p:r[r.length-1].value,"Gradient"===l.paletteSettings.type)for(var c=0;c<r.length;c++){var g=(r[c].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100;g=isNaN(g)?0:g,l.horizontalGradient?(t=n.width/100,o=e.x+t*g,this.segmentCollections.push(o)):(t=n.height/100,s=e.y+t*g,this.segmentCollections.push(s))}var u;if(l.horizontalGradient){for(var v=0;v<r.length;v++){if("Gradient"===l.paletteSettings.type){var y=(this.segmentCollections[v]-this.segmentCollections[v-1])/2,b=(this.segmentCollections[v+1]-this.segmentCollections[v])/2;u=v===r.length-1?y:0===v?b:y<b?y:b}else{var m=this.legendRectScale.width/l.colorCollection.length;u="Edge"===l.legendSettings.labelDisplayType?m:m/2}this.textWrapCollections.push(u),a=(i=d(this.labelCollections[v],l.legendSettings.textStyle,u)).length>a?i.length:a}"Bottom"===l.legendSettings.position?(l.initialClipRect.height-=this.maxLegendLabelSize.height*(a-1),this.legendGroup.y-=this.maxLegendLabelSize.height*(a-1),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(a-1)):(l.initialClipRect.y+=this.maxLegendLabelSize.height*(a-1),l.initialClipRect.height-=this.maxLegendLabelSize.height*(a-1),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(a-1))}},e.prototype.renderColorAxisGrid=function(e){var t,i,l,n,a,o=this.heatMap;o.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:o.element.id+"_ColorAxis_Grid"}));for(var s=0;s<o.legendColorCollection.length;s++){o.horizontalGradient?(i=n=this.segmentCollections[s],l=e.y,a=e.y+e.height):(i=e.x,l=a=this.segmentCollections[s],n=e.x+e.width);var r=new le(i,l,n,a),h=new ne(this.heatMap.element.id+"_ColorAxis_Grid"+s,r,"#EEEEEE",1);this.drawSvgCanvas.drawLine(h,t),o.enableCanvasRendering||this.legend.appendChild(t)}},e.prototype.renderLegendLabelTooltip=function(e){var t=this.heatMap.mouseX,i=this.heatMap.mouseY;if(-1!==e.target.id.indexOf("_Legend_Label")&&e.target.textContent.indexOf("...")>-1){var l=e.target.id.split(this.heatMap.element.id+"_Legend_Label");if(2===l.length){var n=void 0;n=1===l[1].length||"Trim"===this.heatMap.legendSettings.textStyle.textOverflow?parseInt(l[1],10):parseInt(l[1].substring(0,l[1].length-1),10),u(this.labelCollections[n],t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_LegendLabel_Tooltip",y(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_LegendLabel_Tooltip").style.visibility="visible"}}else{var a=document.getElementById(this.heatMap.element.id+"_LegendLabel_Tooltip");a&&(a.style.visibility="hidden")}},e.prototype.calculateListPerPage=function(e){var t=this.heatMap;if(t.horizontalGradient){this.lastList=[];var i=e.x,l=e.y,n=0,o=0,s=0,r=0,h=void 0;for(this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],h=0;h<t.colorCollection.length;h++){if(t.legendSettings.showLabel){n=a(this.labelCollections[h],t.legendSettings.textStyle).width}s=i+10+5,r=l+5;var d=t.legendSettings.showLabel?s+n:i+this.legendSize+this.listInterval;0!==h&&d>this.legendGroup.width+this.legendGroup.x-this.listInterval&&(o+=1,s=(i=e.x)+10+5,r=(l=e.y+20*o)+5,o%this.listPerPage==0&&(this.lastList.push(h),r=(l=e.y)+5,o=0)),this.labelXCollections.push(s),this.labelYCollections.push(r),this.legendXCollections.push(i),this.legendYCollections.push(l),i=i+this.legendSize+this.labelPadding+n+this.listInterval}this.lastList.push(h),this.numberOfPages=this.lastList.length}},e.prototype.renderListLegendMode=function(e,i){var l=this.heatMap,n={color:"transparent",width:0};this.legendLabelTooltip=[];var o,s=new U(0,0),r=0,h=0,p=e.x,c=e.y;i&&this.renderPagingElements();var g,u,v=this.legendGroup.width-(this.legendSize+this.legendRectPadding+this.labelPadding);l.horizontalGradient?(g=1===this.currentPage?0:this.lastList[this.currentPage-2],u=this.lastList[this.currentPage-1]):u=(u=(g=this.currentPage*this.listPerPage-this.listPerPage)+this.listPerPage)<l.colorCollection.length?u:l.colorCollection.length;for(var y=g;y<u;y++){if(l.legendSettings.showLabel){s=a(x=this.labelCollections[y],l.legendSettings.textStyle)}if(l.horizontalGradient&&(p=this.legendXCollections[y],c=this.legendYCollections[y],r=this.labelXCollections[y],h=this.labelYCollections[y]),r=p+this.legendSize+this.labelPadding,h=c+5,i&&l.rendering&&this.legendRange.length<=l.colorCollection.length){var b=new ue(p,c,10,10,l.colorCollection[y].value,!0,this.currentPage);if(b.visible=!!t.isNullOrUndefined(this.visibilityCollections[y])||this.visibilityCollections[y],this.legendRange.push(b),l.legendSettings.showLabel){var m=new ue(r,h-s.height/2,s.width,s.height,l.colorCollection[y].value,!0,this.currentPage);m.visible=!!t.isNullOrUndefined(this.visibilityCollections[y])||this.visibilityCollections[y],this.legendTextRange.push(m)}}if(l.legendSettings.showLabel){var x;-1!==(x=d(this.labelCollections[y],l.legendSettings.textStyle,v))[0].indexOf("...")&&l.enableCanvasRendering&&this.legendLabelTooltip.push(new de(this.labelCollections[y],new ee(r,h,s.width,s.height)));var f=new ie(r,h,"start",x,0,"translate(0,0)","middle"),S=new te(l.element.id+"_Legend_Label"+y,f,l.legendSettings.textStyle,l.legendSettings.textStyle.color||l.themeStyle.legendLabel);S.fill=l.legendOnLoad?S.fill:this.legendRange[y].visible?S.fill:"#D3D3D3",this.drawSvgCanvas.createText(S,this.translategroup,x[0]),t.Browser.isIE&&!l.enableCanvasRendering&&this.translategroup.lastChild.setAttribute("dy","0.6ex")}o=new ee(p,c,10,10);var C=l.legendOnLoad?l.colorCollection[y].color:this.legendRange[y].visible?l.colorCollection[y].color:"#D3D3D3",M=new K(l.element.id+"_legend_list"+y,C,n,1,o);this.drawSvgCanvas.drawRectangle(M,this.translategroup),l.horizontalGradient?p=p+this.legendSize+this.labelPadding+s.width+this.listInterval:c+=this.legendSize+this.listInterval}if(!l.enableCanvasRendering){this.legendGroup.height=this.legendGroup.height>0?this.legendGroup.height:0,this.legendGroup.width=this.legendGroup.width>0?this.legendGroup.width:0;var w=l.renderer.createClipPath({id:l.element.id+"_LegendScale_ClipPath"}),L=l.renderer.drawRectangle(this.legendGroup);w.appendChild(L),this.translategroup.appendChild(w),this.translategroup.setAttribute("style","clip-path:url(#"+w.id+")"),this.legendScale.appendChild(this.translategroup),l.svgObject.appendChild(this.legend)}},e.prototype.translatePage=function(e,t,i){if(i&&t>=1&&t<this.numberOfPages||!i&&t>1&&t<=this.numberOfPages){if(i?(this.currentPage+=1,this.legendRect.y+=this.legendRect.height):(this.currentPage-=1,this.legendRect.y-=this.legendRect.height),e.enableCanvasRendering){(l=e.canvasRenderer.ctx).fillRect(this.legendRectScale.x-5,this.legendRectScale.y-5,this.legendRectScale.width+5,this.legendRectScale.height+10),l.fillRect(this.pagingRect.x,this.pagingRect.y,this.pagingRect.width,this.pagingRect.height)}else for(this.paginggroup.removeChild(this.paginggroup.firstChild);this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);this.renderListLegendMode(this.legendRectScale,!0)}if(e.enableCanvasRendering&&e.allowSelection&&e.rectSelected){var l=e.secondaryCanvasRenderer.ctx,n=e.legendSettings.position,a=e.initialClipRect,o="Right"===n?a.x+a.width:0,s="Bottom"===n?a.y+a.height:0,r="Right"===n?e.availableSize.width-(a.x+a.width):"Left"===n?a.x:e.availableSize.width,h="Top"===n?a.y:"Bottom"===n?e.availableSize.height-(a.y+a.height):e.availableSize.height;l.save(),l.clearRect(o,s,r,h),l.restore();var d=document.getElementById(e.element.id+"_canvas"),p=document.getElementById(e.element.id+"_secondary_canvas"),c=d.getContext("2d").getImageData(o,s,r,h);p.getContext("2d").putImageData(c,o,s),d.style.opacity="0.3"}},e.prototype.createTooltipDiv=function(e){var i=t.createElement("div",{id:this.heatMap.element.id+"legendLabelTooltipContainer",styles:"position:absolute"});this.heatMap.element.appendChild(i)},e.prototype.renderTooltip=function(e){var t=this.heatMap,i=[e.label],n=null;n=parseInt(t.legendSettings.textStyle.size,10)/2,this.tooltipObject=new l.Tooltip({offset:n,theme:t.theme,content:i,location:{x:e.x+e.width/2,y:e.y+e.height/2},inverted:!t.horizontalGradient,areaBounds:{height:this.legendGroup.height+this.legendGroup.y,width:this.legendGroup.width+this.legendGroup.x,x:"Right"===t.legendSettings.position?0:this.legendGroup.x,y:"Top"===t.legendSettings.position?""===t.titleSettings.text?this.legendGroup.height-this.legendGroup.y:this.legendGroup.y:0}},"#"+this.heatMap.element.id+"legendLabelTooltipContainer"),this.tooltipObject.element.style.visibility="visible"},e.prototype.createTooltip=function(e,t){for(var i,l=0;l<this.heatMap.colorCollection.length;l++){var n=this.legendRectPositionCollection[l];if(e>n.x&&e<n.width+n.x&&t>n.y&&t<n.height+n.y){i=this.legendRectPositionCollection[l];break}}var a=document.getElementById(this.heatMap.element.id+"legendLabelTooltipContainer");a&&"visible"===a.style.visibility&&this.tooltipObject&&!this.heatMap.isTouch&&(this.tooltipObject.fadeOut(),a.style.visibility="hidden"),i&&this.renderTooltip(i)},e.prototype.legendRangeSelection=function(e){var t=this.heatMap,i=this.legendRange,l=this.legendRectScale;if(t.rangeSelection=!0,t.enableCanvasRendering){var n=t.canvasRenderer.ctx;t.legendSettings.enableSmartLegend?n.fillRect(l.x-5,l.y-5,l.width+this.labelPadding+this.maxLegendLabelSize.width+5,l.height+10):n.fillRect(l.x-5,l.y-5,l.width+5,l.height+10)}else{if(t.legendSettings.enableSmartLegend)for(;this.legend&&this.legend.childNodes.length;)this.legend.removeChild(this.legend.firstChild);else for(;this.translategroup&&this.translategroup.childNodes.length;)this.translategroup.removeChild(this.translategroup.firstChild);v(t.heatMapSeries.containerRectObject.id),t.cellSettings.showLabel&&v(t.heatMapSeries.containerTextObject.id)}if(t.legendSettings.enableSmartLegend&&t.colorCollection.length!==t.legendColorCollection.length&&(e===t.legendColorCollection.length-1?t.toggleValue[e-1].visible=this.visibilityCollections[e-1]=i[e-1].visible=!i[e].visible:e===t.colorCollection.length-1&&(t.toggleValue[e+1].visible=this.visibilityCollections[e+1]=i[e+1].visible=!i[e].visible)),t.toggleValue[e].visible=this.visibilityCollections[e]=i[e].visible=!i[e].visible,t.legendOnLoad=!1,t.legendSettings.enableSmartLegend){this.renderSmartLegend();var a=new ee(l.x,l.y,l.width,l.height);this.renderLegendLabel(a)}else this.renderListLegendMode(this.legendRectScale,!1);t.heatMapSeries.renderRectSeries(),t.clearSelection(),t.enableCanvasRendering&&t.allowSelection},e.prototype.updateLegendRangeCollections=function(e){if(e){var t=this.heatMap;t.rangeSelection=!t.legendOnLoad,this.visibilityCollections=t.legendOnLoad?[]:this.visibilityCollections,t.toggleValue=t.legendOnLoad?[]:t.toggleValue,this.legendRange=t.legendOnLoad?[]:this.legendRange,this.legendTextRange=t.legendOnLoad?[]:this.legendTextRange}else this.legendRange=[],this.legendTextRange=[]},e}(),Ie=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),Be=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},Ve=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.enableCanvasRendering=!1,t.toggleValue=[],t.legendOnLoad=!0,t.resizing=!1,t.rendering=!0,t.horizontalGradient="Bottom"===t.legendSettings.position||"Top"===t.legendSettings.position,t.multiSelection=!1,t.rectSelected=!1,t.previousSelectedCellsRect=[],t.multiCellCollection=[],t.tempMultiCellCollection=[],t.tooltipCollection=[],t.isCellData=!1,t}return Ie(i,e),i.prototype.preRender=function(){this.initPrivateVariable(),this.unWireEvents(),this.wireEvents()},i.prototype.initPrivateVariable=function(){this.renderer=new t.SvgRenderer(this.element.id),this.canvasRenderer=new t.CanvasRenderer(this.element.id),this.secondaryCanvasRenderer=new t.CanvasRenderer(this.element.id+"_secondary"),this.heatMapAxis=new fe(this),this.heatMapSeries=new we(this),this.drawSvgCanvas=new se(this),this.twoDimensional=new Oe(this),this.cellColor=new W(this),this.tempRectHoverClass="",this.tempTooltipRectId="",this.setCulture()},i.prototype.setCulture=function(){this.intl=new t.Internationalization},i.prototype.render=function(){this.updateBubbleHelperProperty(),this.trigger("load",{heatmap:this}),this.initAxis(),this.processInitData(),this.setTheme(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.createSvg(),this.cellColor.getColorCollection(),this.calculateBounds(),this.renderElements(),this.appendSvgObject(),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1)},i.prototype.reRenderDatasource=function(){this.dataSourceMinValue=null,this.dataSourceMaxValue=null,this.processInitData(),this.calculateMaxLength(),this.heatMapAxis.calculateVisibleLabels(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),this.cellColor.getColorCollection(),this.calculateBounds()},i.prototype.processInitData=function(){this.adaptorModule?this.adaptorModule.constructDatasource(this.dataSource):this.completeAdaptDataSource=this.dataSource},i.prototype.setRenderMode=function(){"Canvas"===this.renderingMode?this.enableCanvasRendering=!0:"Auto"===this.renderingMode&&this.axisCollections[0].axisLabelSize*this.axisCollections[1].axisLabelSize>=1e4?this.enableCanvasRendering=!0:this.enableCanvasRendering=!1},i.prototype.updateBubbleHelperProperty=function(){"Bubble"!==this.cellSettings.tileType||"Size"!==this.cellSettings.bubbleType&&"Sector"!==this.cellSettings.bubbleType?this.legendModule&&this.legendSettings.visible&&(this.legendVisibilityByCellType=!0):this.legendVisibilityByCellType=!1,"Bubble"===this.cellSettings.tileType&&"SizeAndColor"===this.cellSettings.bubbleType?this.bubbleSizeWithColor=!0:this.bubbleSizeWithColor=!1},i.prototype.renderElements=function(){this.renderSecondaryElement(),this.renderBorder(),this.renderTitle(),this.heatMapAxis.renderAxes(),this.tooltipModule&&this.showTooltip&&(this.tooltipModule.tooltipObject=null,this.tooltipModule.createTooltipDiv(this)),this.heatMapSeries.renderRectSeries(),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&(this.legendModule.renderLegendItems(),"Fixed"===this.paletteSettings.type&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltipDiv(this))},i.prototype.getModuleName=function(){return"heatmap"},i.prototype.getPersistData=function(){return""},i.prototype.onPropertyChanged=function(e,t){for(var i=!1,l=!1,n=0,a=Object.keys(e);n<a.length;n++){switch(a[n]){case"renderingMode":this.rendering=!1,i=!0;break;case"cellSettings":this.updateBubbleHelperProperty(),!this.legendModule||e.cellSettings.tileType===t.cellSettings.tileType&&e.cellSettings.bubbleType===t.cellSettings.bubbleType||(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections(!0)),this.reRenderDatasource(),l=!0;break;case"showTooltip":l=!0;break;case"dataSource":this.isCellData=!1,this.updateBubbleHelperProperty(),this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections(!0)),this.reRenderDatasource(),i=!0;break;case"titleSettings":case"width":case"height":case"margin":l=!0;break;case"legendSettings":this.updateBubbleHelperProperty(),!this.legendVisibilityByCellType||e.legendSettings.visible===t.legendSettings.visible&&e.legendSettings.enableSmartLegend===t.legendSettings.enableSmartLegend?this.legendOnLoad=!1:(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections(!1)),l=!0;break;case"yAxis":case"xAxis":this.updateBubbleHelperProperty(),this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections(!0)),this.reRenderDatasource(),l=!0;break;case"paletteSettings":this.updateBubbleHelperProperty(),this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections(!0)),this.cellColor.getColorCollection(),this.calculateBounds(),i=!0;break;case"theme":this.setTheme(),i=!0;break;case"tooltipSettings":this.tooltipModule&&(this.tooltipModule.tooltipObject.fill=this.tooltipSettings.fill,this.tooltipModule.tooltipObject.border=this.tooltipSettings.border,this.tooltipModule.tooltipObject.textStyle=this.tooltipSettings.textStyle,this.tooltipModule.tooltipObject.refresh())}}!l&&i?(this.createSvg(),this.renderElements(),this.appendSvgObject(),this.trigger("created"),this.clearSelection()):l&&(this.createSvg(),this.refreshBound(),this.appendSvgObject(),this.trigger("created")),this.allowSelection&&this.rectSelected&&this.clearSelection(),this.rendering=!0},i.prototype.createSvg=function(){this.removeSvg(),this.setRenderMode(),this.calculateSize(),this.enableCanvasRendering?(this.svgObject=this.canvasRenderer.createCanvas({id:this.element.id+"_canvas",width:this.availableSize.width,height:this.availableSize.height}),this.allowSelection&&this.createMultiCellDiv(!0)):(this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height}),"0"===this.cellSettings.border.width.toString()&&"Rect"===this.cellSettings.tileType&&this.svgObject.setAttribute("shape-rendering","crispEdges"))},i.prototype.removeSvg=function(){if(document.getElementById(this.element.id+"_Secondary_Element")&&t.remove(document.getElementById(this.element.id+"_Secondary_Element")),document.getElementById(this.element.id+"Celltooltipcontainer")&&t.remove(document.getElementById(this.element.id+"Celltooltipcontainer")),document.getElementById(this.element.id+"legendLabelTooltipContainer")&&t.remove(document.getElementById(this.element.id+"legendLabelTooltipContainer")),document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")&&t.remove(document.getElementById(this.element.id+"_Multi_CellSelection_Canvas")),document.getElementById(this.element.id+"_CellSelection_Container")&&t.remove(document.getElementById(this.element.id+"_CellSelection_Container")),this.svgObject){if(document.getElementById(this.svgObject.id)){for(;this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);t.remove(this.svgObject)}}},i.prototype.renderSecondaryElement=function(){var e=this.createElement("div");e.id=this.element.id+"_Secondary_Element",this.element.appendChild(e);var t=this.createElement("div",{id:this.element.id+"_CellSelection_Container",styles:"position:absolute; z-index: 2"});this.element.appendChild(t)},i.prototype.requiredModules=function(){var e=[];return this.showTooltip&&e.push({member:"Tooltip",args:[this]}),this.legendSettings&&e.push({member:"Legend",args:[this]}),this.dataSource&&e.push({member:"Adaptor",args:[this]}),e},i.prototype.destroy=function(){this.unWireEvents(),e.prototype.destroy.call(this),this.element.innerHTML="",this.element.classList.remove("e-heatmap")},i.prototype.refresh=function(){e.prototype.refresh.call(this),this.element.classList.add("e-heatmap")},i.prototype.appendSvgObject=function(){this.enableCanvasRendering&&this.allowSelection?this.createMultiCellDiv(!1):this.element.appendChild(this.svgObject)},i.prototype.renderBorder=function(){this.border={width:0};var e=new K(this.element.id+"_HeatmapBorder",this.themeStyle.background,this.border,1,new ee(0,0,this.availableSize.width-0,this.availableSize.height-0));this.drawSvgCanvas.drawRectangle(e,this.svgObject)},i.prototype.calculateSize=function(){var e=n(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=n(this.height,this.element.offsetHeight)||this.element.offsetHeight||450;this.availableSize=new U(e,t)},i.prototype.renderTitle=function(){if(this.titleSettings.text){var e=this.titleSettings.textStyle,t="Near"===e.textAlignment?"start":"Far"===e.textAlignment?"end":"middle";this.elementSize=a(this.titleCollection[0],e);var i=new te(this.element.id+"_HeatmapTitle",new ie(o(this.availableSize.width-this.margin.left-this.margin.right,this.margin.left,this.margin.right,e),this.margin.top+3*this.elementSize.height/4,t,this.titleCollection),e,e.color||this.themeStyle.heatMapTitle);this.titleCollection.length>1?this.drawSvgCanvas.createWrapText(i,e,this.svgObject):(this.drawSvgCanvas.createText(i,this.svgObject,this.titleCollection[0]),-1!==this.titleCollection[0].indexOf("...")&&this.enableCanvasRendering&&this.tooltipCollection.push(new de(this.titleSettings.text,new ee(this.margin.left,this.margin.top,this.elementSize.width,this.elementSize.height))))}},i.prototype.titleTooltip=function(e,t,i,l){e.target.id===this.element.id+"_HeatmapTitle"&&e.target.textContent.indexOf("...")>-1?u(this.titleSettings.text,t,i,this.element.offsetWidth,this.element.id+"_Title_Tooltip",y(this.element.id+"_Secondary_Element"),l,this):v(this.element.id+"_Title_Tooltip")},i.prototype.axisTooltip=function(e,t,i,l){var n=e.target.id;if(-1!==n.indexOf(this.element.id+"_XAxis_Label")||-1!==n.indexOf(this.element.id+"_XAxis_MultiLevel")||-1!==n.indexOf(this.element.id+"_YAxis_MultiLevel")){var a=m(this.tooltipCollection,t,i);a?u(a,this.mouseX,this.mouseY,this.element.offsetWidth,this.element.id+"_axis_Tooltip",y(this.element.id+"_Secondary_Element"),this.isTouch,this):v(this.element.id+"_axis_Tooltip")}else v(this.element.id+"_axis_Tooltip")},i.prototype.isHeatmapRect=function(e,t){var i=[],l=[];return i.push(this.heatMapSeries.rectPositionCollection[0][0]),l.push(this.heatMapSeries.rectPositionCollection[this.yLength-1][this.xLength-1]),e>=i[0].x&&t>=i[0].y&&e<=l[0].x+l[0].width&&t<=l[0].y+l[0].height},i.prototype.setTheme=function(){this.themeStyle=function(e){var t;switch(e.toLowerCase()){case"highcontrastlight":case"highcontrast":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#ffffff",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"materialdark":case"fabricdark":case"bootstrapdark":t={heatMapTitle:"#ffffff",axisTitle:"#ffffff",axisLabel:"#DADADA",cellBorder:"#EEEEEE",background:"#000000",cellTextColor:"#000000",toggledColor:"#000000",emptyCellColor:"#EEEEEE",legendLabel:"#ffffff",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;default:t={heatMapTitle:"#424242",axisTitle:"#424242",axisLabel:"#686868",cellBorder:"#EEEEEE",cellTextColor:"#000000",toggledColor:"#ffffff",background:"#FFFFFF",emptyCellColor:"#EEEEEE",legendLabel:"#353535",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]}}return t}(this.theme)},i.prototype.calculateBounds=function(){var e=this.margin,t=0,i=this.legendModule&&"Top"===this.legendSettings.position&&this.legendVisibilityByCellType||"0px"===this.titleSettings.textStyle.size?0:16,l=e.left,n=this.availableSize.width-l-e.right;this.titleSettings.text&&(this.titleCollection=d(this.titleSettings.text,this.titleSettings.textStyle,n),t=a(this.titleSettings.text,this.titleSettings.textStyle).height*this.titleCollection.length+i);var o=e.top+t;this.titleRect=new ee(e.left,e.top,this.availableSize.width-e.left-e.right,t);var s=this.availableSize.height-o-e.bottom;this.initialClipRect=new ee(l,o,n,s);var r=this.initialClipRect.y;this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendBounds(this.initialClipRect),this.heatMapAxis.measureAxis(this.initialClipRect),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.calculateLegendSize(this.initialClipRect,r),this.heatMapAxis.calculateAxisSize(this.initialClipRect)},i.prototype.refreshBound=function(){this.updateBubbleHelperProperty(),this.calculateBounds(),this.renderElements()},i.prototype.initAxis=function(){var e,t=[this.xAxis,this.yAxis];this.axisCollections=[];for(var i=0,l=t.length;i<l;i++)(e=t[i]).orientation=0===i?"Horizontal":"Vertical",e.jsonCellLabel=[],this.axisCollections.push(e)},i.prototype.wireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,l=t.Browser.touchEndEvent,n=t.Browser.touchMoveEvent,a=e?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.isDevice?i:"click",this.heatMapMouseClick,this),t.EventHandler.add(this.element,i,this.heatMapMouseMove,this),t.EventHandler.add(this.element,l,this.heatMapMouseLeave,this),t.EventHandler.add(this.element,n,this.heatMapMouseMove,this),t.EventHandler.add(this.element,a,this.heatMapMouseLeave,this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.heatMapResize.bind(this)),this.setStyle(this.element)},i.prototype.setStyle=function(e){e.style.touchAction="element",e.style.msTouchAction="element",e.style.msContentZooming="none",e.style.msUserSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},i.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,l=(t.Browser.touchEndEvent,t.Browser.touchMoveEvent),n=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,t.Browser.isDevice?i:"click",this.heatMapMouseClick),t.EventHandler.remove(this.element,i,this.heatMapMouseMove),t.EventHandler.remove(this.element,l,this.heatMapMouseLeave),t.EventHandler.remove(this.element,l,this.heatMapMouseMove),t.EventHandler.remove(this.element,n,this.heatMapMouseLeave),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.heatMapResize)},i.prototype.heatMapResize=function(e){var t=this;return this.resizing=!0,this.clearSelection(),this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){t.isDestroyed?clearTimeout(t.resizeTimer):(t.createSvg(),t.refreshBound(),t.appendSvgObject(),t.resizing=!1)},500),!1},i.prototype.calculateMaxLength=function(){var e=this.completeAdaptDataSource;if(e&&e.length>0){for(var t=e.length-1,i=0,l=0;l<=t;l++){var n=e[l].length;i=i>n?i:n}this.axisCollections[0].maxLength=t,this.axisCollections[1].maxLength=i-1}else this.axisCollections[0].maxLength=0,this.axisCollections[1].maxLength=0},i.prototype.setMouseXY=function(e,t){var i,l=this.element.getBoundingClientRect();i=this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").getBoundingClientRect():document.getElementById(this.element.id+"_svg").getBoundingClientRect(),this.mouseX=e-l.left-Math.max(i.left-l.left,0),this.mouseY=t-l.top-Math.max(i.top-l.top,0)},i.prototype.heatMapMouseClick=function(e){var t,i,l,n=this.element.getBoundingClientRect();"touchstart"===e.type?(this.isTouch=!0,i=(l=e).changedTouches[0].clientY,t=l.changedTouches[0].clientX):(this.isTouch=!1,i=e.clientY,t=e.clientX),t-=n.left,i-=n.top;if(this.isHeatmapRect(t,i)){var a=this.heatMapSeries.getCurrentRect(t,i);this.trigger("cellClick",{heatmap:this,value:a.value,x:a.x,y:a.y,xLabel:this.heatMapSeries.hoverXAxisLabel,yLabel:this.heatMapSeries.hoverYAxisLabel,xValue:this.heatMapSeries.hoverXAxisValue,yValue:this.heatMapSeries.hoverYAxisValue,cellElement:this.enableCanvasRendering?null:document.getElementById(a.id)})}if(this.notify("click",e),"Gradient"!==this.paletteSettings.type&&this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType){var o=this.legendModule.navigationCollections;o.length&&t>o[0].x&&t<o[0].x+o[0].width&&i>o[0].y&&i<o[0].y+o[0].height?this.legendModule.translatePage(this,this.legendModule.currentPage,!0):o.length&&t>o[1].x&&t<o[1].x+o[1].width&&i>o[1].y&&i<o[1].y+o[1].height&&this.legendModule.translatePage(this,this.legendModule.currentPage,!1);for(var s=this.legendModule.legendRange,r=this.legendModule.legendTextRange,h=!0,d=0;d<s.length;d++)this.legendModule&&this.legendSettings.toggleVisibility&&this.legendModule.currentPage===s[d].currentPage&&(h&&t>=s[d].x&&t<=s[d].width+s[d].x&&i>=s[d].y&&i<=s[d].y+s[d].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&t>=r[d].x&&t<=r[d].width+r[d].x&&i>=r[d].y&&i<=r[d].y+r[d].height)&&(this.legendModule.legendRangeSelection(d),h=!1)}return!1},i.prototype.heatMapMouseMove=function(e){var t,i,l,n,a=this.element.getBoundingClientRect();if("touchmove"===e.type||"touchstart"===e.type?(this.isTouch=!0,t=(n=e).changedTouches[0].clientX,i=n.changedTouches[0].clientY):(this.isTouch=!1,t=e.clientX,i=e.clientY),t-=a.left,i-=a.top,this.setMouseXY(t,i),e.target&&e.target.id){var o=this.isHeatmapRect(t,i);this.legendModule&&(o?"Gradient"===this.paletteSettings.type&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderGradientPointer(e,t,i):this.legendModule.removeGradientPointer(),this.renderMousePointer(t,i));var s=void 0,r=void 0;if(s=!(!this.showTooltip||!this.tooltipModule)&&o,o&&(r=this.heatMapSeries.getCurrentRect(t,i),s=this.cellSelectionOnMouseMove(e,r,t,i,s)),this.tooltipOnMouseMove(e,r,s),this.legendModule&&this.legendSettings.visible&&"Fixed"===this.paletteSettings.type&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltip(t,i),this.enableCanvasRendering){a=this.element.getBoundingClientRect();var h="Fixed"!==this.paletteSettings.type||!this.legendSettings.enableSmartLegend||"None"!==this.legendSettings.labelDisplayType;(l=m(this.tooltipCollection,t,i)||this.legendModule&&h&&m(this.legendModule.legendLabelTooltip,t,i))?u(l,this.mouseX,this.mouseY,this.element.offsetWidth,this.element.id+"_canvas_Tooltip",y(this.element.id+"_Secondary_Element"),this.isTouch,this):v(this.element.id+"_canvas_Tooltip")}else this.titleSettings.text&&"Trim"===this.titleSettings.textStyle.textOverflow&&this.titleTooltip(e,t,i,this.isTouch),this.axisTooltip(e,t,i,this.isTouch),this.legendModule&&this.legendSettings.visible&&this.legendSettings.showLabel&&this.legendVisibilityByCellType&&this.legendModule.renderLegendLabelTooltip(e)}return!0},i.prototype.cellSelectionOnMouseMove=function(e,t,i,l,n){return("Rect"===this.cellSettings.tileType&&"mousedown"===e.type||"touchstart"===e.type)&&this.allowSelection&&(this.previousRect=t,this.multiSelection=!0,this.rectSelected=!0,this.initialCellX=i,this.initialCellY=l),"Rect"===this.cellSettings.tileType&&this.multiSelection&&t&&(this.highlightSelectedCells(this.previousRect,t,i,l),n=!1),n},i.prototype.tooltipOnMouseMove=function(e,t,i){var l=this;i?this.tempTooltipRectId!==t.id&&(this.showTooltip&&((this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(t.id),this.tooltipModule.renderTooltip(t),this.isTouch&&(this.tooltipTimer&&window.clearTimeout(this.tooltipTimer),this.tooltipTimer=setTimeout(function(){l.tooltipModule.tooltipObject.fadeOut(),l.tooltipModule.isFadeout=!0},1500),"touchmove"===e.type&&e.preventDefault())),this.tempTooltipRectId=t.id):(-1===e.target.id.indexOf("Celltooltip")&&(!this.cellSettings.enableCellHighlighting&&!this.showTooltip||this.enableCanvasRendering||this.heatMapSeries.highlightSvgRect(e.target.id),this.tooltipModule&&this.showTooltip&&this.tooltipModule.showHideTooltip(!1,!0)),this.tempTooltipRectId="")},i.prototype.highlightSelectedCells=function(e,t,i,l){var n=e.xIndex,a=e.yIndex,o=t.xIndex,s=t.yIndex,r=Math.abs(t.xIndex===e.xIndex?0:t.xIndex-e.xIndex)+1,h=Math.abs(t.yIndex===e.yIndex?0:t.yIndex-e.yIndex)+1,d=o>n?n:o,p=o>n?o:n,c=s>a?s:a,g=d,u=s>a?a:s,v=e.x,y=e.y;this.selectedCellsRect=new ee(0,0,0,0),this.selectedCellsRect.x=e.x>t.x?t.x:e.x,this.selectedCellsRect.y=e.y>t.y?t.y:e.y,this.selectedCellsRect.width=(1+(e.x>t.x?n-o:o-n))*t.width,this.selectedCellsRect.height=(1+(e.y>t.y?a-s:s-a))*t.height,this.removeSelectedCellsBorder(),this.multiCellCollection=[];for(var b=0;b<r*h;b++)this.getSelectedCellDatas(v,y),g<p?(v+=o>n?t.width:-t.width,g++):u<c&&(y+=s>a?t.height:-t.height,v=e.x,g=d);var m=this.initialCellX>i?i:this.initialCellX,x=this.initialCellY>l?l:this.initialCellY,f=document.getElementById(this.element.id+"_CellSelection_Container");f.style.left=this.selectedCellsRect.x-1+"px",f.style.top=this.selectedCellsRect.y-1+"px";var S=this.renderer.createSvg({id:this.element.id+"_CellSelection_Container_svg",width:this.selectedCellsRect.width+2,height:this.selectedCellsRect.height+2});f.appendChild(S);var C=document.getElementById(this.element.id+"_CellSelection_Container_svg"),M=new ee(m-this.selectedCellsRect.x,x-this.selectedCellsRect.y,Math.abs(i-this.initialCellX),Math.abs(l-this.initialCellY)),w=new K(this.element.id+"_selectedCells","#87ceeb",{color:"transparent",width:1},1,M,"#0000ff");C.appendChild(this.renderer.drawRectangle(w)),document.getElementById(this.element.id+"_selectedCells").style.opacity="0.5"},i.prototype.removeSelectedCellsBorder=function(){if(this.enableCanvasRendering){var e=this.secondaryCanvasRenderer.ctx,t=this.previousSelectedCellsRect[0];this.previousSelectedCellsRect.length>0&&(e.save(),e.clearRect(t.x-1,t.y-1,t.width+2,t.height+2),e.restore(),this.previousSelectedCellsRect.shift())}else for(var i=0;i<this.multiCellCollection.length;i++){var l=this.multiCellCollection[i].cellElement;if(l){var n=l.id.slice((this.element.id+"_HeatMapRect_").length),a=document.getElementById(this.element.id+"_HeatMapRectLabels_"+n),o=l.getAttribute("class");this.tempMultiCellCollection.length>0&&(l.setAttribute("opacity","0.3"),this.cellSettings.showLabel&&a&&a.setAttribute("opacity","0.3")),this.removeSvgClass(l,a,o)}}this.element.id,v(this.element.id+"_selectedCellsBorder")},i.prototype.highlightSelectedAreaInCanvas=function(e){var t=document.getElementById(this.element.id+"_canvas"),i=document.getElementById(this.element.id+"_secondary_canvas"),l=this.initialClipRect,n=t.getContext("2d").getImageData(e.x,e.y,e.width,e.height);i.getContext("2d").putImageData(n,e.x,e.y),t.style.opacity="0.3";var a=t.getContext("2d").getImageData(0,0,this.availableSize.width,l.y);i.getContext("2d").putImageData(a,0,0);var o=t.getContext("2d").getImageData(0,l.y+l.height,this.availableSize.width,this.availableSize.height-(l.y+l.height));i.getContext("2d").putImageData(o,0,l.y+l.height);var s=t.getContext("2d").getImageData(l.x+l.width,0,this.availableSize.width-(l.x+l.width),this.availableSize.height);i.getContext("2d").putImageData(s,l.x+l.width,0);var r=t.getContext("2d").getImageData(0,0,l.x,this.availableSize.height);i.getContext("2d").putImageData(r,0,0)},i.prototype.getSelectedCellDatas=function(e,i){var l=this.axisCollections[0],n=this.axisCollections[1],a=l.tooltipLabels,o=n.tooltipLabels.slice().reverse(),s=this.heatMapSeries.getCurrentRect(e+1,i+1),r=document.getElementById(s.id),h=new $(null,"","",0,0,null);h.value=s.value,h.xLabel=a[s.xIndex].toString(),h.yLabel=o[s.yIndex].toString(),h.xValue=l.labelValue[s.xIndex],h.yValue=n.labelValue.slice().reverse()[s.yIndex],h.cellElement=this.enableCanvasRendering?null:r,this.addSvgClass(r),s.visible&&!t.isNullOrUndefined(s.value)&&this.multiCellCollection.push(h)},i.prototype.addSvgClass=function(e){if(!this.enableCanvasRendering){var t=this.element.id+"_selected";e.setAttribute("class",t)}},i.prototype.removeSvgClass=function(e,t,i){i&&e.setAttribute("class",i.replace(i,""))},i.prototype.clearSelection=function(){if(this.enableCanvasRendering){if(this.previousSelectedCellsRect.length>0){var e=this.secondaryCanvasRenderer.ctx;e.save(),e.clearRect(this.previousSelectedCellsRect[0].x-1,this.previousSelectedCellsRect[0].y-1,this.previousSelectedCellsRect[0].width+2,this.previousSelectedCellsRect[0].height+2),e.restore()}document.getElementById(this.element.id+"_canvas").style.opacity="1"}else for(var t=document.getElementById(this.element.id+"_Container_RectGroup"),i=document.getElementById(this.element.id+"_Container_TextGroup"),l=0;l<t.childNodes.length;l++){var n=t.children[l].getAttribute("class");n===this.element.id+"_selected"&&this.removeSvgClass(t.children[l],i.children[l],n),t.children[l].setAttribute("opacity","1"),this.cellSettings.showLabel&&i&&i.children[l]&&i.children[l].setAttribute("opacity","1")}this.tempMultiCellCollection=[],this.multiCellCollection=[],this.rectSelected=!1,this.element.id,v(this.element.id+"_selectedCellsBorder")},i.prototype.renderMousePointer=function(e,t){for(var i=this.legendModule.legendRange,l=this.legendModule.legendTextRange,n=!0,a=0;a<i.length;a++)this.legendSettings.toggleVisibility&&this.legendModule.currentPage===i[a].currentPage&&(n&&e>=i[a].x&&e<=i[a].width+i[a].x&&t>=i[a].y&&t<=i[a].y+i[a].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&e>=l[a].x&&e<=l[a].width+l[a].x&&t>=l[a].y&&t<=l[a].y+l[a].height?(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="Pointer":document.getElementById(this.element.id+"_svg").style.cursor="Pointer",n=!1):n&&(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="":document.getElementById(this.element.id+"_svg").style.cursor=""))},i.prototype.heatMapMouseLeave=function(e){var t=this;if(e.target&&e.target.id&&(this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(this.tempTooltipRectId),this.allowSelection&&this.multiSelection)if(this.multiSelection=!1,"mouseup"===e.type||"touchend"===e.type){if(this.enableCanvasRendering)this.previousSelectedCellsRect.push(this.selectedCellsRect),this.highlightSelectedAreaInCanvas(this.selectedCellsRect);else{this.tempMultiCellCollection.push(this.multiCellCollection);for(var i=document.getElementById(this.element.id+"_Container_RectGroup"),l=document.getElementById(this.element.id+"_Container_TextGroup"),n=0;n<i.childNodes.length;n++){i.children[n].getAttribute("class")!==this.element.id+"_selected"?(i.children[n].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&l.children[n]&&l.children[n].setAttribute("opacity","0.3")):(i.children[n].setAttribute("opacity","1"),this.cellSettings.showLabel&&l.children[n]&&l.children[n].setAttribute("opacity","1"))}}v(this.element.id+"_selectedCells");var a=new ee(1,1,this.selectedCellsRect.width,this.selectedCellsRect.height),o=new K(this.element.id+"_selectedCellsBorder","none",{color:"transparent",width:1},1,a,"Black");document.getElementById(this.element.id+"_CellSelection_Container_svg").appendChild(this.renderer.drawRectangle(o));var s={heatmap:this,cancel:!1,name:"cellSelected",data:this.multiCellCollection};this.trigger("cellSelected",s)}else"mouseleave"===e.type&&(this.element.id,1)&&v(this.element.id+"_selectedCells");if(this.tooltipModule&&this.showTooltip&&"mouseleave"===e.type&&this.tooltipModule.showHideTooltip(!1),this.tempTooltipRectId="",this.legendModule&&this.legendSettings.visible&&this.legendModule.tooltipObject&&this.legendModule.tooltipObject.element){var r=this.legendModule.tooltipObject.element.firstChild;"mouseleave"===e.type?r.setAttribute("opacity","0"):(this.legendTooltipTimer&&window.clearTimeout(this.legendTooltipTimer),this.legendTooltipTimer=setTimeout(function(){r.setAttribute("opacity","0")},1500))}if("Gradient"===this.paletteSettings.type&&this.legendModule&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&("mouseleave"===e.type?this.legendModule.removeGradientPointer():(this.gradientTimer&&window.clearTimeout(this.gradientTimer),this.gradientTimer=setTimeout(function(){t.legendModule.removeGradientPointer()},1500))),this.enableCanvasRendering){var h=document.getElementById(this.element.id+"_hoverRect_canvas");h&&(h.style.visibility="hidden",this.tempRectHoverClass="")}return this.titleSettings.text&&-1!==this.titleCollection[0].indexOf("...")&&(this.enableCanvasRendering?v(this.element.id+"_canvas_Tooltip"):v(this.element.id+"_Title_Tooltip")),!0},i.prototype.createMultiCellDiv=function(e){if(e){var t=this.createElement("div",{id:this.element.id+"_Multi_CellSelection_Canvas",styles:"position:relative"});this.element.appendChild(t),t.appendChild(this.svgObject),this.svgObject.style.position="absolute",this.svgObject.style.left="0px",this.svgObject.style.top="0px",this.svgObject.style.zIndex="0"}else{var i=document.getElementById(this.element.id+"_Multi_CellSelection_Canvas"),l=this.secondaryCanvasRenderer.createCanvas({width:this.availableSize.width,height:this.availableSize.height,x:0,y:0,style:"position: absolute; z-index: 1"});i.appendChild(l)}},Be([t.Property(null)],i.prototype,"width",void 0),Be([t.Property(null)],i.prototype,"height",void 0),Be([t.Property(!0)],i.prototype,"showTooltip",void 0),Be([t.Event()],i.prototype,"tooltipRender",void 0),Be([t.Event()],i.prototype,"cellRender",void 0),Be([t.Event()],i.prototype,"cellSelected",void 0),Be([t.Property("SVG")],i.prototype,"renderingMode",void 0),Be([t.Property(null)],i.prototype,"dataSource",void 0),Be([t.Property("Material")],i.prototype,"theme",void 0),Be([t.Property(!1)],i.prototype,"allowSelection",void 0),Be([t.Complex({},P)],i.prototype,"margin",void 0),Be([t.Complex({text:"",textStyle:w.heatMapTitleFont},z)],i.prototype,"titleSettings",void 0),Be([t.Complex({},xe)],i.prototype,"xAxis",void 0),Be([t.Complex({},ze)],i.prototype,"legendSettings",void 0),Be([t.Complex({},F)],i.prototype,"paletteSettings",void 0),Be([t.Complex({},Re)],i.prototype,"tooltipSettings",void 0),Be([t.Complex({},xe)],i.prototype,"yAxis",void 0),Be([t.Complex({},Me)],i.prototype,"cellSettings",void 0),Be([t.Event()],i.prototype,"created",void 0),Be([t.Event()],i.prototype,"load",void 0),Be([t.Event()],i.prototype,"cellClick",void 0),i=Be([t.NotifyPropertyChanges],i)}(t.Component),Ee=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 l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),Ne=function(e,t,i,l){var n,a=arguments.length,o=a<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,l);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,i,o):n(t,i))||o);return a>3&&o&&Object.defineProperty(t,i,o),o},He=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),Ne([t.Property(null)],i.prototype,"data",void 0),Ne([t.Property(!1)],i.prototype,"isJsonData",void 0),Ne([t.Property("cell")],i.prototype,"adaptorType",void 0),Ne([t.Property("")],i.prototype,"xDataMapping",void 0),Ne([t.Property("")],i.prototype,"yDataMapping",void 0),Ne([t.Property("")],i.prototype,"valueMapping",void 0),Ne([t.Complex({},D)],i.prototype,"bubbleDataMapping",void 0),i}(t.ChildProperty),Ge=function(){return function(){}}(),je=function(){function e(e){this.reconstructedXAxis=[],this.reconstructedYAxis=[],this.adaptiveXMinMax=new Ge,this.adaptiveYMinMax=new Ge,this.heatMap=e}return e.prototype.constructDatasource=function(e){if("Cell"===e.adaptorType){var i=this.heatMap.xAxis,l=this.heatMap.yAxis;this.adaptiveXMinMax.min=i.minimum,this.adaptiveXMinMax.max=i.maximum,this.adaptiveYMinMax.min=l.minimum,this.adaptiveYMinMax.max=l.maximum,("Numeric"!==i.valueType&&"DateTime"!==i.valueType||!t.isNullOrUndefined(i.minimum)&&!t.isNullOrUndefined(i.maximum))&&("Numeric"!==l.valueType&&"DateTime"!==l.valueType||!t.isNullOrUndefined(l.minimum)&&!t.isNullOrUndefined(l.maximum))||this.getMinMaxValue(e,i,l),this.heatMap.isCellData=!0}e&&void 0===e.data?this.heatMap.completeAdaptDataSource=e:!e.isJsonData&&"Table"===e.adaptorType||null===e.data?this.heatMap.completeAdaptDataSource=e.data:e.isJsonData&&"Table"===e.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonTableData(e):e.isJsonData&&"Cell"===e.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonCellData(e):e.isJsonData||"Cell"!==e.adaptorType||(this.constructAdaptiveAxis(),this.heatMap.completeAdaptDataSource=this.processCellData(e),this.heatMap.isCellData=!0)},e.prototype.constructAdaptiveAxis=function(){var e=this.heatMap.xAxis,t=this.heatMap.yAxis;"Numeric"===e.valueType&&(this.reconstructedXAxis=this.getNumericAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.increment)),"Numeric"===t.valueType&&(this.reconstructedYAxis=this.getNumericAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.increment)),"DateTime"===e.valueType&&(this.reconstructedXAxis=this.getDateAxisCollection(this.adaptiveXMinMax.min,this.adaptiveXMinMax.max,e.intervalType,e.increment)),"DateTime"===t.valueType&&(this.reconstructedYAxis=this.getDateAxisCollection(this.adaptiveYMinMax.min,this.adaptiveYMinMax.max,t.intervalType,t.increment))},e.prototype.getNumericAxisCollection=function(e,t,i){for(var l=e,n=[];l<=t;)n.push(l.toString()),l+=i;return n},e.prototype.getDateAxisCollection=function(e,t,l,n){for(var a={skeleton:"full",type:"dateTime"},o=this.heatMap.intl.getDateParser(a),s=this.heatMap.intl.getDateFormat(a),r=e=Date.parse(o(s(new Date(i.DataUtil.parse.parseJson({val:e}).val)))),h=[];r<=t;)h.push(new Date(r).toString()),r=b(r,1,l,n).getTime();return h},e.prototype.getMinMaxValue=function(e,i,l){var n=e.data,a=Object.keys(n[0]);n.length>0&&(this.adaptiveXMinMax.min=t.isNullOrUndefined(i.minimum)?e.isJsonData?n[0][a[0]]:n[0][0]:i.minimum,this.adaptiveYMinMax.min=t.isNullOrUndefined(l.minimum)?e.isJsonData?n[0][a[1]]:n[0][1]:l.minimum,this.adaptiveXMinMax.max=t.isNullOrUndefined(i.maximum)?e.isJsonData?n[0][a[0]]:n[0][0]:i.maximum,this.adaptiveYMinMax.max=t.isNullOrUndefined(l.maximum)?e.isJsonData?n[0][a[1]]:n[0][1]:l.maximum);for(var o=0;o<n.length;o++){var s=e.isJsonData?n[o][a[0]]:n[o][0],r=e.isJsonData?n[o][a[1]]:n[o][1];s<this.adaptiveXMinMax.min&&t.isNullOrUndefined(i.minimum)&&(this.adaptiveXMinMax.min=s),s>this.adaptiveXMinMax.max&&t.isNullOrUndefined(i.maximum)&&(this.adaptiveXMinMax.max=s),r<this.adaptiveYMinMax.min&&t.isNullOrUndefined(l.minimum)&&(this.adaptiveYMinMax.min=r),r>this.adaptiveYMinMax.max&&t.isNullOrUndefined(l.maximum)&&(this.adaptiveYMinMax.max=r)}},e.prototype.processCellData=function(e){var i=e.data,l=this.reconstructedXAxis,n=this.reconstructedYAxis,a=0,o=0;if(i.length){this.reconstructData=[];for(var s=0;s<i.length;s++)if((a="Category"===this.heatMap.xAxis.valueType?i[s][0]:l.indexOf(i[s][0].toString()))>-1){for(;!this.reconstructData[a];)this.reconstructData.push([]);if(-1!==(o="Category"===this.heatMap.yAxis.valueType?i[s][1]:n.indexOf(i[s][1].toString()))){for(;""!==this.reconstructData[a][o];)this.reconstructData[a].push("");this.reconstructData[a][o]=t.isNullOrUndefined(i[s][2])?"":i[s][2]}}}return this.reconstructData},e.prototype.processJsonCellData=function(e){var i=e.data,l=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],n=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[],a=this.heatMap.axisCollections;0!==l.length&&0!==n.length||this.generateAxisLabels(e);var o="Category"===this.heatMap.xAxis.valueType?l.length>0?this.heatMap.xAxis.labels:a[0].jsonCellLabel:a[0].labelValue,s="Category"===this.heatMap.yAxis.valueType?n.length>0?this.heatMap.yAxis.labels:a[1].jsonCellLabel:a[1].labelValue,r=0,h=0;if(i.length){this.reconstructData=[];for(var d=0;d<i.length;d++)if(-1!==(r=this.getSplitDataValue(i[d],e,o,e.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[r];)this.reconstructData.push([]);if(-1!==(h=this.getSplitDataValue(i[d],e,s,e.yDataMapping.split("."),this.heatMap.yAxis.valueType))){for(;t.isNullOrUndefined(this.reconstructData[r][h]);)this.reconstructData[r].push("");this.heatMap.bubbleSizeWithColor?this.reconstructData[r][h]=[this.getSplitDataValue(i[d],e,null,e.bubbleDataMapping.size.split("."),""),this.getSplitDataValue(i[d],e,null,e.bubbleDataMapping.color.split("."),"")]:this.reconstructData[r][h]=this.getSplitDataValue(i[d],e,null,e.valueMapping.split("."),"")}}}return this.reconstructData},e.prototype.generateAxisLabels=function(e){for(var t=e.data,i=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],l=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[],n=i.length>0,a=l.length>0,o=this.heatMap.axisCollections,s=0;s<o.length;s++){var r=o[s].valueType,h=o[s];if("Category"===r){var d=void 0,p=void 0,c=void 0;if("Horizontal"===h.orientation?(d=n,p=e.xDataMapping,h.jsonCellLabel=c=[]):(d=a,p=e.yDataMapping,h.jsonCellLabel=c=[]),!d)for(var g=0;g<t.length;g++)if(p in t[g]){var u=t[g][p].toString();-1===c.indexOf(u.toString())&&c.push(u)}}else"DateTime"===r?(h.clearAxisLabel(),h.calculateDateTimeAxisLabel(this.heatMap)):(h.clearAxisLabel(),h.calculateNumericAxisLabels(this.heatMap))}},e.prototype.getSplitDataValue=function(e,i,l,n,a){var o=-1;this.tempSplitDataCollection=e;for(var s=0;s<n.length&&(o=t.isNullOrUndefined(l)?null:"DateTime"!==a?l.indexOf(this.tempSplitDataCollection[n[s]]):l.map(Number).indexOf(+this.tempSplitDataCollection[n[s]]),t.isNullOrUndefined(this.tempSplitDataCollection)||(this.tempSplitDataCollection=-1===o||t.isNullOrUndefined(l)?this.tempSplitDataCollection[n[s]]:this.tempSplitDataCollection),!t.isNullOrUndefined(this.tempSplitDataCollection));s++);return o=t.isNullOrUndefined(l)?t.isNullOrUndefined(this.tempSplitDataCollection)||""===this.tempSplitDataCollection.toString()?"":parseFloat(this.tempSplitDataCollection.toString()):o},e.prototype.processJsonTableData=function(e){var i,l=e.data,n=0,a=0,o=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],s=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[];if(l.length){this.reconstructData=[];for(var r=0;r<l.length;r++)if(-1!==(n=this.getSplitDataValue(l[r],e,o,e.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[n];)this.reconstructData.push([]);for(var h=0;h<Object.keys(this.tempSplitDataCollection).length;h++)if(i=Object.keys(this.tempSplitDataCollection)[h],-1!==(a=i!==e.xDataMapping?s.indexOf(i):-1)){for(;t.isNullOrUndefined(this.reconstructData[n][a]);)this.reconstructData[n].push("");this.reconstructData[n][a]=t.isNullOrUndefined(this.tempSplitDataCollection[i])?"":this.tempSplitDataCollection[i]}}}return this.reconstructData},e.prototype.destroy=function(e){},e.prototype.getModuleName=function(){return"Adaptor"},e}();e.HeatMap=Ve,e.Axis=xe,e.AxisHelper=fe,e.Data=He,e.AdaptiveMinMax=Ge,e.Adaptor=je,e.TwoDimensional=Oe,e.LegendSettings=ze,e.Legend=_e,e.Font=R,e.Margin=P,e.Border=O,e.TooltipBorder=A,e.BubbleData=D,e.Title=z,e.PaletteCollection=_,e.AxisLabelBorder=I,e.MultiLevelCategories=B,e.MultiLevelLabels=V,e.ColorCollection=E,e.BubbleTooltipData=N,e.LegendColorCollection=H,e.CellSettings=Me,e.Series=we,e.PaletteSettings=F,e.RgbColor=k,e.CellColor=W,e.TooltipSettings=Re,e.Tooltip=Pe,e.stringToNumber=n,e.measureText=a,e.TextElement=X,e.titlePositionX=o,e.Size=U,e.CustomizeOption=J,e.PathOption=q,e.CurrentRect=Z,e.SelectedCellDetails=$,e.RectOption=K,e.CircleOption=Q,e.Rect=ee,e.TextOption=te,e.TextBasic=ie,e.Line=le,e.LineOption=ne,e.PathAttributes=ae,e.Path=oe,e.sum=s,e.titlePositionY=r,e.rotateTextSize=h,e.DrawSvgCanvas=se,e.getTitle=d,e.textWrap=p,e.textTrim=c,e.textNone=g,e.Gradient=re,e.GradientColor=he,e.showTooltip=u,e.removeElement=v,e.getElement=y,e.increaseDateTimeInterval=b,e.CanvasTooltip=de,e.getTooltipText=m,e.PaletterColor=pe,e.GradientPointer=ce,e.CurrentLegendRect=ge,e.LegendRange=ue,e.ToggleVisibility=ve,e.colorNameToHex=x,e.convertToHexCode=f,e.componentToHex=S,e.convertHexToColor=C,e.formatValue=M,e.MultiLevelPosition=ye,Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=ej2-heatmap.umd.min.js.map
  