UNPKG

@syncfusion/ej2-heatmap

Version:

Feature rich data visulization control used to visualize the matrix data where the individual values are represented as colors

12 lines 224 kB
/*!
*  filename: ej2-heatmap.min.js
*  version : 30.1.42
*  Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
*  Use of this code is subject to the terms of our license.
*  A copy of the current license can be obtained at any time by e-mailing
*  licensing@syncfusion.com. Any infringement will be prosecuted under
*  applicable laws. 
*/
this.ej=this.ej||{},this.ej.heatmap=function(e,t,i,l,a){"use strict";function n(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;case"bootstrap4":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"#E9ECEF",background:"#FFFFFF",cellTextColor:"#212529",toggledColor:"#ffffff",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#BEE7EE"},{color:"#85c4cf"},{color:"#4CA1AF"}]};break;case"tailwind":t={heatMapTitle:"#374151",axisTitle:"#374151",axisLabel:"#6B7280",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#374151",palette:[{color:"#5A61F6"},{color:"#65A30D"},{color:"#14B8A6"}]};break;case"tailwinddark":t={heatMapTitle:"#D1D5DB",axisTitle:"#D1D5DB",axisLabel:"#9CA3AF",cellBorder:"#4B5563",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#374151",legendLabel:"#D1D5DB",palette:[{color:"#8B5CF6"},{color:"#22D3EE"},{color:"#F87171"}]};break;case"tailwind3":t={heatMapTitle:"#111827",axisTitle:"#111827",axisLabel:"#4B5563",cellBorder:"#E5E7EB",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#E5E7EB",legendLabel:"#4B5563",palette:[{color:"#2F4074"},{color:"#03B4B4"},{color:"#0D72DE"}]};break;case"tailwind3dark":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#D1D5DB",cellBorder:"#282F3C",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#282F3C",legendLabel:"#D1D5DB",palette:[{color:"#8029F1"},{color:"#1ABC9C"},{color:"#0D72DE"}]};break;case"bootstrap5":t={heatMapTitle:"#212529",axisTitle:"#212529",axisLabel:"#212529",cellBorder:"transparent",background:"transparent",toggledColor:"#E9ECEF",emptyCellColor:"#E9ECEF",legendLabel:"#212529",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"bootstrap5dark":t={heatMapTitle:"#DEE2E6",axisTitle:"#DEE2E6",axisLabel:"#DEE2E6",cellBorder:"transparent",background:"transparent",toggledColor:"#343A40",emptyCellColor:"#343A40",legendLabel:"#DEE2E6",palette:[{color:"#DC3545"},{color:"#FFC107"},{color:"#D63384"}]};break;case"fluent":t={heatMapTitle:"#201F1E",axisTitle:"#201F1E",axisLabel:"#201F1E",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#111827",toggledColor:"transparent",emptyCellColor:"#EDEBE9",legendLabel:"#201F1E",palette:[{color:"#EDEBE9"},{color:"#614570"},{color:"#4C6FB1"}]};break;case"fluentdark":t={heatMapTitle:"#F3F2F1",axisTitle:"#F3F2F1",axisLabel:"#F3F2F1",cellBorder:"#EDEBE9",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"transparent",emptyCellColor:"#292827",legendLabel:"#F3F2F1",palette:[{color:"#292827"},{color:"#2A72D5"},{color:"#43B786"}]};break;case"material3":t={heatMapTitle:"#1C1B1F",axisTitle:"#1C1B1F",axisLabel:"#1C1B1F",cellBorder:"#C4C7C5",background:"transparent",cellTextColor:"#1C1B1F",toggledColor:"#F6F0FB",emptyCellColor:"#F6F0FB",legendLabel:"#49454E",palette:[{color:"#6200EE"},{color:"#E77A16"},{color:"#82C100"}]};break;case"material3dark":t={heatMapTitle:"#E6E1E5",axisTitle:"#E6E1E5",axisLabel:"#E6E1E5",cellBorder:"#444746",background:"transparent",cellTextColor:"#E6E1E5",toggledColor:"#49454F",emptyCellColor:"#49454E",legendLabel:"#CAC4D0",palette:[{color:"#4EAAFF"},{color:"#FA4EAB"},{color:"#FFF500"}]};break;case"fluent2":t={heatMapTitle:"#242424",axisTitle:"#242424",axisLabel:"#242424",cellBorder:"transparent",background:"transparent",cellTextColor:"#242424",toggledColor:"#EDEBE9",emptyCellColor:"#EDEBE9",legendLabel:"#242424",palette:[{color:"#6200EE"},{color:"#09AF74"},{color:"#0076E5"}]};break;case"fluent2dark":case"fluent2highcontrast":t={heatMapTitle:"#FFFFFF",axisTitle:"#FFFFFF",axisLabel:"#FFFFFF",cellBorder:"transparent",background:"transparent",cellTextColor:"#FFFFFF",toggledColor:"#292827",emptyCellColor:"#292827",legendLabel:"#FFFFFF",palette:[{color:"#9BB449"},{color:"#2A72D5"},{color:"#43B786"}]};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}function o(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function s(e,i){var l=e||"",a=document.getElementById("heatmapmeasuretext");if(null===a&&(a=t.createElement("text",{id:"heatmapmeasuretext"}),document.body.appendChild(a)),"string"==typeof e&&(e.indexOf("<")>-1||e.indexOf(">")>-1)){for(var n=e.split(" "),o=0;o<n.length;o++)-1===n[o].indexOf("<br/>")&&(n[o]=n[o].replace(/[<>]/g,"&"));e=n.join(" ")}return a.innerText=l.indexOf("<br>")>-1||l.indexOf("<br/>")>-1?l:e,a.style.position="absolute",a.style.visibility="hidden",a.style.fontSize=-1!==i.size.indexOf("px")?i.size:i.size+"px",a.style.fontWeight=i.fontWeight,a.style.fontStyle=i.fontStyle,a.style.fontFamily=i.fontFamily,a.style.top="-100",a.style.left="0",a.style.whiteSpace="nowrap",a.style.lineHeight="normal",new ae(a.clientWidth,a.clientHeight)}function r(e,t,i,l){return"Near"===l.textAlignment?t:"Center"===l.textAlignment?t+e/2:e+t}function h(e,i,l,a,n,o,s){i.enableHtmlSanitizer&&"string"==typeof e&&(e=t.SanitizeHtmlHelper.sanitize(e));var r=d(e,i),h=null,g=i.dataSource;if(!i.dataSourceSettings.isJsonData||"Cell"!==i.dataSourceSettings.adaptorType&&"Table"!==i.dataSourceSettings.adaptorType)h={value:a.value,xLabel:n[a.xIndex],yLabel:o[a.yIndex]};else{var c="Numeric"===i.yAxis.valueType?i.yAxis.labels:o,u="Numeric"===i.xAxis.valueType?i.xAxis.labels:n;g.forEach(function(e){var t="Cell"===i.dataSourceSettings.adaptorType?Object.keys(e).some(function(t){return e[t]===c[a.yIndex]}):Object.prototype.hasOwnProperty.call(e,c[a.yIndex]);Object.keys(e).some(function(t){return e[t]===u[a.xIndex]})&&t&&(h=e)})}if(!t.isNullOrUndefined(r)){var m=p(r(h,i,r,i.element.id+"_Template"+s,!1),i.element.id+"_LabelTemplate_"+s);m.style.cssText="opacity: 1; display: flex; align-items: center; justify-content: center; z-index: 2; position: absolute;top:"+a.y+"px;left:"+a.x+"px;height:"+a.height+"px;width:"+a.width+"px;";for(var y=0;y<m.children.length;y++)m.children[y].style.pointerEvents="none";l.appendChild(m)}return l}function d(e,i){var l=null;try{"function"!=typeof e&&document.querySelectorAll(e).length?l=t.compile(document.querySelector(e).innerHTML.trim()):i.isVue||i.isVue3?l=t.compile(e):"function"==typeof e&&(l=t.compile(e))}catch(i){l=t.compile(e)}return l}function p(e,i){var l=t.createElement("div",{id:i});l.style.cssText="position: absolute;pointer-events: auto;";for(var a=e.length;a>0;)l.appendChild(e[0]),a--;return l}function g(e){for(var t=0,i=0,l=e;i<l.length;i++)t+=l[i];return t}function c(e,t,i,l){return"Near"===l.textAlignment?e.height-i:"Center"===l.textAlignment?e.height/2:t}function u(e,l,a){var n,o,r,h=new i.SvgRenderer("heatmapMeasureRotateText"),d=h.createSvg({id:"heatmapMeasureRotateText_svg",width:100,height:100}),p={"font-size":e.size,"font-style":e.fontStyle.toLowerCase(),"font-family":e.fontFamily,"font-weight":e.fontWeight.toLowerCase(),transform:"rotate("+a+", 0, 0)","text-anchor":"middle"},g=h.createText(p,l[0]);if("string"!=typeof l&&l.length>1)for(var c=1,u=l.length;c<u;c++)n=0+c*s(l[c],e).height,o=l[c],r=h.createTSpan({x:0,id:"heatmapMeasureRotateText_"+c,y:n},o),g.appendChild(r);d.appendChild(g),document.body.appendChild(d);var m=g.getBoundingClientRect();return t.remove(d),new ae(m.right-m.left,m.bottom-m.top)}function m(e,t,i){var l=[];switch(t.textOverflow){case"Wrap":l=x(e,i,t);break;case"Trim":l.push(b(i,e,t));break;default:l.push(f(i,e,t))}return l}function y(e,i){if(i)for(var l=0;l<e.length;l++)e[l]=t.SanitizeHtmlHelper.sanitize(e[l]);return e}function v(e){for(var t=!1,i=0;i<e.length;i++)if(-1!==e[i].indexOf("<br>")||-1!==e[i].indexOf("<br/>")){t=!0;break}return t}function x(e,t,i,l){for(var a,n=e.split(" "),o="",r=[],h=0,d=n.length;h<d;h++)a=n[h],s(o.concat(a),i).width<t?o=o.concat((""===o?"":" ")+a):""!==o?(o=l?o.concat((""===o?"":" ")+a):o,r.push(b(t,o,i)),o=l?"":a):(r.push(b(t,a,i)),a=""),o&&h===d-1&&r.push(b(t,o,i));return r}function b(e,t,i){var l=t,a=s(t,i).width;if(a>e)for(var n=t.length-1;n>=0;--n)if(l=t.substring(0,n)+"...",(a=s(l,i).width)<=e)return l;return l}function f(e,t,i){var l=t,a=s(t,i).width;if(a>e)for(var n=t.length-1;n>=0;--n)if(l=t.substring(0,n),(a=s(l,i).width)<=e)return l;return l}function S(e,i,l,a,n,o,r,h){var d=document.getElementById(n),p=s(e,{fontFamily:"Segoe UI",size:"12px",fontStyle:"Normal",fontWeight:"Regular"}),g=p.width+5;i=(i=i+g>a?i-g:i)<0?5:i,d?(d.innerText=e,d.style.top=(l+15).toString()+"px",d.style.left=(i+15).toString()+"px"):((d=t.createElement("div",{id:n})).style.cssText="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",d.innerText=e,o.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&&(t.isNullOrUndefined(h.tooltipTimer)||window.clearTimeout(h.tooltipTimer),h.tooltipTimer=setTimeout(function(){C(n)},1500))}function C(e){var i=w(e);i&&(t.remove(i),M())}function M(){C("heatmapmeasuretext")}function w(e){return document.getElementById(e)}function L(e,t,i,l){var a=new Date(e);switch(t=Math.ceil(t*l),i){case"Years":a.setFullYear(a.getFullYear()+t);break;case"Months":a.setMonth(a.getMonth()+t);break;case"Days":a.setDate(a.getDate()+t);break;case"Hours":a.setHours(a.getHours()+t);break;case"Minutes":a.setMinutes(a.getMinutes()+t)}return a}function T(e,t,i){for(var l,a,n,o=e.length,s=0;s<o;s++)if(l=e[s],a=l.region,t>=a.x&&t<=a.x+a.width&&i>=a.y&&i<=a.y+a.height){n=l.text;break}return n}function R(e){e="transparent"===e?"white":e;var t=document.getElementById("heatmapmeasuretext");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return O(new ee(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function O(e){return"#"+z(e.R)+z(e.G)+z(e.B)}function z(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function P(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new ee(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new ee(255,255,255)}function D(e,t,i,l){return e?t.replace("{value}",l(i)):l(i)}var A;!function(e){e.heatMapTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.titleFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI",textOverflow:"None"},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",textOverflow:"None"},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"}}(A||(A={}));var F=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),I=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("16px")],i.prototype,"size",void 0),I([t.Property("")],i.prototype,"color",void 0),I([t.Property("Segoe UI")],i.prototype,"fontFamily",void 0),I([t.Property("Normal")],i.prototype,"fontWeight",void 0),I([t.Property("Normal")],i.prototype,"fontStyle",void 0),I([t.Property("Center")],i.prototype,"textAlignment",void 0),I([t.Property("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(10)],i.prototype,"left",void 0),I([t.Property(10)],i.prototype,"right",void 0),I([t.Property(10)],i.prototype,"top",void 0),I([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"color",void 0),I([t.Property(1)],i.prototype,"width",void 0),I([t.Property("")],i.prototype,"radius",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"color",void 0),I([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"size",void 0),I([t.Property(null)],i.prototype,"color",void 0),i}(t.ChildProperty),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("")],i.prototype,"text",void 0),I([t.Complex({},V)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),k=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("#eeeeee")],i.prototype,"minColor",void 0),I([t.Property("#eeeeee")],i.prototype,"maxColor",void 0),i}(t.ChildProperty),G=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"value",void 0),I([t.Property(null)],i.prototype,"color",void 0),I([t.Property(null)],i.prototype,"label",void 0),I([t.Property(null)],i.prototype,"startValue",void 0),I([t.Property(null)],i.prototype,"endValue",void 0),I([t.Property(null)],i.prototype,"minColor",void 0),I([t.Property(null)],i.prototype,"maxColor",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("#b5b5b5")],i.prototype,"color",void 0),I([t.Property(1)],i.prototype,"width",void 0),I([t.Property("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),W=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("0%")],i.prototype,"minimum",void 0),I([t.Property("100%")],i.prototype,"maximum",void 0),i}(t.ChildProperty),j=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property(null)],i.prototype,"start",void 0),I([t.Property(null)],i.prototype,"end",void 0),I([t.Property("")],i.prototype,"text",void 0),I([t.Property(null)],i.prototype,"maximumTextWidth",void 0),i}(t.ChildProperty),Y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),I([t.Property("Center")],i.prototype,"alignment",void 0),I([t.Property("Wrap")],i.prototype,"overflow",void 0),I([t.Complex(A.axisLabelFont,V)],i.prototype,"textStyle",void 0),I([t.Complex({color:"#b5b5b5",width:1,type:"Rectangle"},U)],i.prototype,"border",void 0),I([t.Collection([],j)],i.prototype,"categories",void 0),i}(t.ChildProperty),X=function(){function e(e,t,i,l,a,n,o){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o}return e}(),J=function(){function e(e,t,i){this.mappingName=e,this.bubbleData=t,this.valueType=i}return e}(),K=function(){function e(e,t,i,l,a,n,o,s){this.value=e,this.color=t,this.label=i,this.startValue=l,this.endValue=a,this.minColor=n,this.maxColor=o,this.isHidden=s}return e}(),q=function(){function e(e,t,i,l,a){this.index=1,this.row=1,this.start=e,this.end=t,this.index=i,this.label=l,this.row=a}return e}(),Z=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)}}(),$=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Q=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Collection([{}],G)],i.prototype,"palette",void 0),$([t.Property("Gradient")],i.prototype,"type",void 0),$([t.Property("")],i.prototype,"emptyPointColor",void 0),$([t.Property("Table")],i.prototype,"colorGradientMode",void 0),$([t.Complex({},k)],i.prototype,"fillColor",void 0),i}(t.ChildProperty),ee=function(){function e(e,t,i){this.R=e,this.G=t,this.B=i}return e}(),te=function(){function e(e){this.heatMap=e}return e.prototype.convertToRGB=function(e,t){var i,l,a=this.heatMap.isColorRange?t[0].startValue:t[0].value,n=0,o=0;if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type)for(o=0;o<t.length;o++)if(e<=(s=Number(t[o].endValue))&&e>=Number(t[o].startValue))n=s,i=this.heatMap.colorCollection[o].minColor,l=this.heatMap.colorCollection[o].maxColor;else{if(t[0].startValue!==this.heatMap.dataSourceMinValue&&e<t[0].startValue){n=t[0].startValue,a=this.heatMap.dataSourceMinValue,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}if(e>s&&e<=(o===t.length-1?this.heatMap.dataSourceMaxValue:t[o+1].startValue)){n=o===t.length-1?this.heatMap.dataSourceMaxValue:t[o+1].startValue,a=s,i=this.heatMap.paletteSettings.fillColor.minColor,l=this.heatMap.paletteSettings.fillColor.maxColor;break}n=s,a=s}else for(o=1;o<t.length;o++){var s=Number(t[o].value);if(e<=s){n=s,i=this.getEqualColor(t,a),l=this.getEqualColor(t,n);break}n=s,a=s}var r=0;return r=(e-a)/(n-a),r=isNaN(r)||!isFinite(r)?0:r,this.getPercentageColor(r,i,l)},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,i){for(var l=0;l<e.length;l++)if(Number(e[l].value)===i){var a=e[l].color;return t.isNullOrUndefined(a)?a="#FFFFFF":-1!==a.indexOf("rgb")?a=this.convertToHex(a):-1===a.indexOf("#")&&(a="#FFFFFF"),a}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],a=t.split("#")[1],n=this.getPercentage(e,parseInt(a.substr(0,2),16),parseInt(l.substr(0,2),16)),o=this.getPercentage(e,parseInt(a.substr(2,2),16),parseInt(l.substr(2,2),16)),s=this.getPercentage(e,parseInt(a.substr(4,2),16),parseInt(l.substr(4,2),16));return new ee(n,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=[];for(var i,l=0;l<this.heatMap.paletteSettings.palette.length;l++){if(null===this.heatMap.paletteSettings.palette[l].startValue||null===this.heatMap.paletteSettings.palette[l].endValue){this.heatMap.isColorRange=!1;break}this.heatMap.isColorRange=!0}var a=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 o=this.orderbyOffset(this.heatMap.isColorRange?e.paletteSettings.palette:e.paletteSettings.palette&&e.paletteSettings.palette.length>1?e.paletteSettings.palette:e.themeStyle.palette);if(o.isCompact)e.colorCollection=o.offsets,e.legendColorCollection=t.extend([],o.offsets,null,!0);else if(i="Gradient"===e.paletteSettings.type?(n-a)/(o.offsets.length-1):(n-a)/o.offsets.length,o.offsets.length>=2)for(var s=0;s<o.offsets.length;s++)e.colorCollection.push(new X(Math.round(100*(a+s*i))/100,o.offsets[s].color,o.offsets[s].label,o.offsets[s].startValue,o.offsets[s].endValue,o.offsets[s].minColor,o.offsets[s].maxColor)),e.legendColorCollection.push(new K(Math.round(100*(a+s*i))/100,o.offsets[s].color,o.offsets[s].label,o.offsets[s].startValue,o.offsets[s].endValue,o.offsets[s].minColor,o.offsets[s].maxColor,!1));this.heatMap.isColorRange||this.updateLegendColorCollection(a,n,o)},e.prototype.updateLegendColorCollection=function(e,t,i){"Fixed"===this.heatMap.paletteSettings.type&&(i.isCompact||i.isLabel)||(Math.round(100*e)/100<this.heatMap.legendColorCollection[0].value&&this.heatMap.legendColorCollection.unshift(new K(Math.round(100*e)/100,this.heatMap.legendColorCollection[0].color,this.heatMap.legendColorCollection[0].label,this.heatMap.legendColorCollection[0].startValue,this.heatMap.legendColorCollection[0].endValue,this.heatMap.legendColorCollection[0].minColor,this.heatMap.legendColorCollection[0].maxColor,!0)),Math.round(100*t)/100>this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].value&&this.heatMap.legendColorCollection.push(new K(Math.round(100*t)/100,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].color,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].label,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].startValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].endValue,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].minColor,this.heatMap.legendColorCollection[this.heatMap.legendColorCollection.length-1].maxColor,!0)))},e.prototype.orderbyOffset=function(e){var i=new Ce,l=this.heatMap.isColorRange?"to":"value";return i.isCompact=!0,i.isLabel=!0,i.offsets=e.sort(function(e,a){return t.isNullOrUndefined(e.label)&&t.isNullOrUndefined(a.label)&&(i.isLabel=!1),t.isNullOrUndefined(e[l])||t.isNullOrUndefined(a[l])?(i.isCompact=!1,e):e[l]-a[l]}),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 a=0;a<this.heatMap.colorCollection.length;a++){l=this.heatMap.isColorRange?this.heatMap.paletteSettings.palette[a].startValue:this.heatMap.colorCollection[a+1]?this.heatMap.colorCollection[a+1].value:this.heatMap.colorCollection[a].value;var n=this.heatMap.dataSourceMinValue===this.heatMap.dataSourceMaxValue;if(this.heatMap.isColorRange){o=void 0;e<=this.heatMap.colorCollection[a].endValue&&e>=this.heatMap.colorCollection[a].startValue?(this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[a]&&!o[a].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[a].minColor):""===i&&(i=this.heatMap.paletteSettings.fillColor.minColor)}else if(e<=l&&n&&0===a||e<l||e>=l&&a===this.heatMap.colorCollection.length-1){var o=void 0;this.heatMap.legendVisibilityByCellType&&(o=this.heatMap.legendModule.legendRange),i=this.heatMap.legendVisibilityByCellType&&o[a]&&!o[a].visible?this.heatMap.themeStyle.toggledColor:this.heatMap.colorCollection[a].color;break}}else"Table"!==this.heatMap.paletteSettings.colorGradientMode&&this.getColorCollection(),e<this.heatMap.colorCollection[0].value&&!this.heatMap.isColorRange?i=this.heatMap.colorCollection[0].color:e>this.heatMap.colorCollection[this.heatMap.colorCollection.length-1].value&&!this.heatMap.isColorRange?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.isColorRange?this.heatMap.colorCollection[0].minColor:this.heatMap.colorCollection[0].color;else i=this.heatMap.emptyPointColor;return i},e.prototype.destroy=function(){this.heatMap=null},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)}}(),le=function(){function e(e,t){this["font-size"]=e.size,this["font-style"]=e.fontStyle.toLowerCase(),this["font-family"]=e.fontFamily,this["font-weight"]=e.fontWeight.toLowerCase(),this.fill=t||""}return e}(),ae=function(){function e(e,t){this.width=e,this.height=t}return e}(),ne=function(){function e(e){this.id=e}return e}(),oe=function(e){function t(t,i,l,a,n,o,s){var r=e.call(this,t)||this;return r.opacity=n,r.fill=i,r.stroke=a||"",r["stroke-width"]=parseFloat(l.toString()),r["stroke-dasharray"]=o,r.d=s,r}return ie(t,e),t}(ne),se=function(){function e(e,t,i,l,a,n,o,s,r,h,d,p,g,c){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.id=n,this.xIndex=o,this.yIndex=s,this.xValue=r,this.yValue=h,this.visible=d,this.displayText=p,this.textId=g,this.allowCollection=c}return e}(),re=function(){function e(e,t,i,l,a,n,o,s,r,h,d,p){this.value=e,this.xLabel=t,this.yLabel=i,this.xValue=l,this.yValue=a,this.cellElement=n,this.xPosition=o,this.yPosition=s,this.width=r,this.height=h,this.x=d,this.y=p}return e}(),he=function(e){function t(t,i,l,a,n,o,s,r,h,d){var p=e.call(this,t,i,l.width,o,a,d)||this;return p.y=n.y,p.x=n.x,p.height=n.height>0?n.height:0,p.width=n.width>0?n.width:0,p.rx=s||0,p.ry=r||0,p.transform=h||"",p}return ie(t,e),t}(oe),de=function(e){function t(t,i,l,a,n,o,s,r){var h=e.call(this,t,i,l.width,n,a)||this;return h.cx=o||0,h.cy=s||0,h.r=r||0,h}return ie(t,e),t}(oe),pe=function(){function e(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l}return e}(),ge=function(e){function t(t,i,l,a){var n=e.call(this,l,a)||this;return n.transform="",n["dominant-baseline"]="auto",n.role="region",n.labelRotation=0,n.baseline="auto",n.id=t,n.x=i.x,n.y=i.y,n["text-anchor"]=i["text-anchor"],n.text=i.text,n["aria-label"]=i.text,n.transform=i.transform,n.labelRotation=i.labelRotation,n["dominant-baseline"]=i["dominant-baseline"],n.baseline=i.baseline,n.dy=i.dy,n}return ie(t,e),t}(le),ce=function(){function e(e,t,i,l,a,n,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||"start",this.text=l||"",this["aria-label"]=l,this.transform=n||"",this.labelRotation=a,this["dominant-baseline"]=o||"auto",this.baseline=o||"",this.dy=s||""}return e}(),ue=function(){function e(e,t,i,l){this.x1=e,this.y1=t,this.x2=i,this.y2=l}return e}(),me=function(e){function t(t,i,l,a,n,o){var s=e.call(this,t,null,a,l,n,o,null)||this;return s.x1=i.x1,s.y1=i.y1,s.x2=i.x2,s.y2=i.y2,s}return ie(t,e),t}(oe),ye=function(e){function t(t,i,l,a,n,o,s){var r=e.call(this,t,l,n,s,o,null)||this;return r.d=i.d,r.x=i.x,r.y=i.y,r}return ie(t,e),t}(oe),ve=function(){function e(e,t,i,l,a,n,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=a,this.y1=n,this.start=r,this.end=h,this.radius=d,this.counterClockWise=p}return e}(),xe=function(){function e(e){this.heatMap=e}return e.prototype.drawRectangle=function(e,t,i){if(this.heatMap.enableCanvasRendering)this.drawCanvasRectangle(this.heatMap.canvasRenderer,e,i);else{delete e.d;var l=t.appendChild(this.heatMap.renderer.drawRectangle(e));if(-1===l.id.indexOf("Rect"))l.setAttribute("title","Rect Element"),l.setAttribute("role","img"),l.setAttribute("aria-hidden","false");else{var a=this.heatMap.cellSettings.enableCellHighlighting||this.heatMap.allowSelection?0:-1;l.setAttribute("tabindex",a.toString()),l.style.outline="none"}}},e.prototype.drawCircle=function(e,t){if(this.heatMap.enableCanvasRendering)this.drawCanvasCircle(this.heatMap.canvasRenderer,e);else{delete e.d;var i=t.appendChild(this.heatMap.renderer.drawCircle(e)),l=this.heatMap.cellSettings.enableCellHighlighting?0:-1;i.setAttribute("tabindex",l.toString()),i.style.outline="none"}},e.prototype.drawPath=function(e,t,i){this.heatMap.enableCanvasRendering?this.drawCanvasPath(this.heatMap.canvasRenderer,e,t):(delete e.x,delete e.y,i.appendChild(this.heatMap.renderer.drawPath(e)))},e.prototype.createText=function(e,t,i){this.heatMap.enableCanvasRendering?this.canvasDrawText(e,i):(delete e.labelRotation,delete e.baseline,delete e.text,t.appendChild(this.heatMap.renderer.createText(e,i)),e.text=i)},e.prototype.createWrapText=function(e,t,i){var l,a,n,o={};o={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.toLowerCase(),"text-anchor":e["text-anchor"],transform:e.transform,"dominant-baseline":e["dominant-baseline"],"aria-label":e.text[0]};var r=e.text[0];if(this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.createText(e,r):l=this.heatMap.renderer.createText(o,r),"string"!=typeof e.text&&e.text.length>1)for(var h=1,d=e.text.length;h<d;h++)n=s(e.text[h],t).height,this.heatMap.enableCanvasRendering?(e.id=e.id+h,e.y+=n,this.heatMap.canvasRenderer.createText(e,e.text[h])):(a=this.heatMap.renderer.createTSpan({x:e.x,id:e.id+h,y:e.y+h*n},e.text[h]),l.appendChild(a));this.heatMap.enableCanvasRendering||i.appendChild(l)},e.prototype.drawLine=function(e,t){this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawLine(e):(delete e.d,t.appendChild(this.heatMap.renderer.drawLine(e)))},e.prototype.canvasDrawText=function(e,i,l,a,n,o,s){var r=this.heatMap.canvasRenderer.ctx;l||(l=e.x),a||(a=e.y);var h=this.getOptionValue(e,"font-weight");t.isNullOrUndefined(h)||"regular"!==h.toLowerCase()||(h="normal");var d=this.getOptionValue(e,"font-family"),p=-1===e["font-size"].toString().indexOf("px")?e["font-size"]+"px":e["font-size"],g=this.getOptionValue(e,"text-anchor"),c=this.getOptionValue(e,"font-style").toLowerCase()+" "+h+" "+p+" "+d;if("middle"===g&&(g="center"),r.save(),r.fillStyle=e.fill,r.font=c,r.textAlign=g,e.baseline&&(r.textBaseline=e.baseline),r.translate(l,a),r.rotate(e.labelRotation*Math.PI/180),s)for(var u=0;u<n.length;u++)e.y=0!==u?e.y+o:e.y,r.fillText(n[u],e.x-l,e.y-a);else r.fillText(i,e.x-l,e.y-a);r.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 a=l.split(",");e.ctx.setLineDash([parseInt(a[0],10),parseInt(a[1],10)])}e.ctx.strokeStyle=i.stroke},e.prototype.drawCanvasRectangle=function(e,t,i){var l=e.ctx;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,a=t.y,n=t.width,o=t.height;"none"===t.fill&&(t.fill="transparent"),e.ctx.fillStyle=t.fill,n<2*i&&(i=n/2),o<2*i&&(i=o/2),e.ctx.beginPath(),e.ctx.moveTo(l+n-i,a),e.ctx.arcTo(l+n,a,l+n,a+o,i),e.ctx.arcTo(l+n,a+o,l,a+o,i),e.ctx.arcTo(l,a+o,l,a,i),e.ctx.arcTo(l,a,l+n,a,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(" ");e.ctx.save(),e.ctx.beginPath(),e.ctx.globalAlpha=t.opacity,e.ctx.fillStyle=t.fill,this.setAttributes(e,t);for(var a=0;a<l.length;a+=3){var n=parseFloat(l[a+1]),o=parseFloat(l[a+2]);switch(l[a]){case"M":e.ctx.moveTo(n,o);break;case"L":e.ctx.lineTo(n,o);break;case"A":case"a":e.ctx.arc(i.x,i.y,i.radius,.0174533*i.start,.0174533*i.end,!1),a="a"===l[a]?a+13:a+5;break;case"Z":e.ctx.closePath()}}e.ctx.fill(),t["stroke-width"]&&0!==t["stroke-width"]&&e.ctx.stroke(),e.ctx.restore()},e}(),be=function(){function e(e,t,i,l,a){this.id=e,this.x1=t,this.x2=i,this.y1=l,this.y2=a}return e}(),fe=function(){function e(e,t){this.color=e,this.colorStop=t}return e}(),Se=function(){function e(e,t){this.region=new pe(0,0,0,0),this.text=e,this.region=t}return e}(),Ce=function(){function e(){}return e}(),Me=function(){function e(e,t,i,l,a,n){this.pathX1=e,this.pathY1=t,this.pathX2=i,this.pathY2=l,this.pathX3=a,this.pathY3=n}return e}(),we=function(){function e(e,t,i,l,a,n){this.x=e,this.y=t,this.width=i,this.height=l,this.label=a,this.id=n}return e}(),Le=function(){function e(e,t,i,l,a,n,o){this.x=e,this.y=t,this.width=i,this.height=l,this.value=a,this.visible=n,this.currentPage=o}return e}(),Te=function(){function e(e,t,i,l){this.visible=e,this.value=t,this.startValue=i,this.endValue=l}return e}(),Re=function(){function e(e,t){this.x=e,this.y=t}return e}(),Oe=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),ze=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Pe=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.multipleRow=[],t.rect=new pe(void 0,void 0,0,0),t.nearSizes=[],t.farSizes=[],t.maxLabelSize=new ae(0,0),t.titleSize=new ae(0,0),t.multilevel=[],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 Oe(i,e),i.prototype.computeSize=function(e,t,i){var l=new ae(0,0);this.titleSize=e.getTitleSize(e,10),this.maxLabelSize=e.getMaxLabelSize(e,t),this.getMultilevelLabelsHeight(e,i,t);for(var a=0;a<this.multiLevelLabels.length;a++)l=e.multiLevelLabelSize(10,a),this.multiLevelSize.push(l)},i.prototype.multiPosition=function(e,t){var i="Horizontal"===e.orientation?10:20,l=new Re(0,0);if("Horizontal"===e.orientation){var a=e.maxLabelSize.height+i+(0===e.angle||180===e.angle||360===e.angle?0:i),n=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?-a:a):e.multiLevelPosition[t-1].y+(e.opposedPosition?-n:n)}else{var a=e.maxLabelSize.width+i,n=0!==t&&this.multiLevelSize[t-1].width;l.x=0===t?e.rect.x-(e.opposedPosition?-a:a):e.multiLevelPosition[t-1].x-(e.opposedPosition?-(n+i):n+i),l.y=e.isInversed?e.rect.y:e.rect.y+e.rect.height}return l},i.prototype.multiLevelLabelSize=function(e,t){for(var i=new ae(0,0),l=this.multiLevelLabels,a=l[t].categories,n=0;n<a.length;n++){var o=s(a[n].text,l[t].textStyle);i.width=i.width>o.width?i.width:o.width,i.height=i.height>o.height?i.height:o.height}var r="Horizontal"===this.orientation?this.xAxisMultiLabelHeight[t]:this.yAxisMultiLabelHeight[t];return this.opposedPosition?this.farSizes.push(r):this.nearSizes.push(r),i},i.prototype.getMultilevelLabelsHeight=function(e,t,i){var l,a,n,o,r,h,d,p=[],g="Vertical"===e.orientation,c="Vertical"===e.orientation?20:10;this.multiLevelLabels.map(function(u,m){u.categories.map(function(y){o="number"==typeof y.start?y.start:Number(new Date(y.start)),r="number"==typeof y.end?y.end:Number(new Date(y.end)),""!==y.text&&null!==y.start&&null!==y.end&&(l=s(y.text,u.textStyle),n=g?l.width:l.height,h=i.heatMapAxis.calculateLeftPosition(e,o,y.start,t),d=i.heatMapAxis.calculateWidth(e,y.end,r,t),l=s(y.text,u.textStyle),a=null===y.maximumTextWidth?Math.abs(d-h):y.maximumTextWidth,l.width>a-c&&"Wrap"===u.overflow&&!g&&(n*=x(y.text,a-c,u.textStyle).length),p[m]=p[m]?p[m]<n?n+c:p[m]:n+c)})}),g?this.yAxisMultiLabelHeight=p:this.xAxisMultiLabelHeight=p},i.prototype.getTitleSize=function(e,t){var i=new ae(0,0);return this.title.text&&((i=s(this.title.text,this.title.textStyle)).height+=t),e.opposedPosition?this.farSizes.push(i.height):this.nearSizes.push(i.height),i},i.prototype.getMaxLabelSize=function(e,i){var l=new ae(0,0),a=this.axisLabels,n=e.border.width>0||e.multiLevelLabels.length>0?10:0,o=1,r="DateTime"===e.valueType&&"None"!==e.showLabelOn||"Wrap"===e.textStyle.textOverflow||"Trim"===e.textStyle.textOverflow?i.initialClipRect.width/e.axisLabelSize:i.initialClipRect.width/e.axisLabels.length;e.angle=e.labelRotation,e.isIntersect=!1;var h=v(a);if(("Horizontal"===e.orientation&&("Rotate45"===e.labelIntersectAction||e.labelRotation%180==0&&"Trim"===e.labelIntersectAction||e.enableTrim)||"MultipleRows"===e.labelIntersectAction)&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow){var d=i.initialClipRect.x+(e.isInversed?i.initialClipRect.width:0),p=void 0,g=void 0;this.clearMultipleRow();for(var c=0,m=a.length;c<m;c++){var y=s(L=a[c],e.textStyle),f="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[c]*r:r,S=d+(e.isInversed?-(r+y.width)/2:(r-y.width)/2),C=(S=S<i.initialClipRect.x?i.initialClipRect.x:S)+y.width;if(e.isInversed){if(t.isNullOrUndefined(g))g=S;else if(g<C&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||h||e.enableTrim?e.isIntersect=!0:e.angle=45;break}g=S}else{if(t.isNullOrUndefined(p))p=C;else if(S<p&&"MultipleRows"!==e.labelIntersectAction){"Rotate45"!==e.labelIntersectAction||h||e.enableTrim?e.isIntersect=!0:e.angle=45;break}p=C}d+=e.isInversed?-f:f,"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===e.labelRotation&&this.multipleRow.push(new q(S,C,o,L,1))}"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&e.isInversed&&(this.multipleRow=this.multipleRow.reverse())}for(var M=1,c=0;c<a.length;c++){var w=this.multipleRow,L=void 0;L=e.enableTrim||"Trim"===e.textStyle.textOverflow&&-1===a[c].indexOf("<br>")&&-1===a[c].indexOf("<br/>")?b("Trim"===e.textStyle.textOverflow&&"Horizontal"===e.orientation?r:e.maxLabelLength,a[c],e.textStyle):a[c];var T=[];if("Wrap"!==e.textStyle.textOverflow&&!h||e.enableTrim){if(h&&e.enableTrim){T=L.split(/<br\s*\/?>/,-1);var R=b(e.maxLabelLength,T[0],e.textStyle);L=-1===L.indexOf("<br>")&&-1===L.indexOf("<br/>")||-1!==R.indexOf("...")?R:R+"...",T=[]}T.push(L)}else{var O="Horizontal"===e.orientation?r:e.maxLabelLength;if(h){T=L.split(/<br\s*\/?>/,-1);for(var z=0;z<T.length;z++)T[z]=b(O,T[z],e.textStyle)}else T=x(L,O,e.textStyle);if(M=T.length>M&&!e.enableTrim?T.length:M,"Vertical"===e.orientation||"Horizontal"===e.orientation&&e.angle%180!=0)for(var P=0,D=0;D<T.length;D++){var A=s(T[D],e.textStyle);A.width>P&&(P=A.width,L=T[D])}if("Vertical"===e.orientation)for(var F=i.initialClipRect.height/(e.axisLabelSize/e.axisLabelInterval),D=0;D<T.length;D++)s(L,e.textStyle).height*T.length>F-10&&T.length>0&&90!==e.angle&&270!==e.angle&&(T.pop(),T.length>0&&(T[T.length-1]=T[T.length-1]+"...",T[T.length-1]=b(e.maxLabelLength,T[T.length-1],e.textStyle)))}var I=e.angle%180==0?s(L,e.textStyle):u(e.textStyle,T,e.angle);if(l.width=l.width>I.width?l.width:I.width,"MultipleRows"===e.labelIntersectAction&&"Horizontal"===e.orientation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&c>0&&0===e.labelRotation){w[c].end>=i.initialClipRect.width&&c<a.length-1&&(w[c].row=w[c].row+1);for(var V=1;V<=e.multilevel.length;V++)if(w[c].start<w[c-1].end){if(e.multilevel[V]<w[c].start){o=V;break}if(V===e.multilevel.length-1){o=e.multilevel.length;break}}else if(I.width<r)for(var E=1;E<=e.multilevel.length;E++)if(e.multilevel[E]<w[c].start){o=E,w[E].row=o;break}l.height=l.height>I.height*o+.5*I.height/2*(o-1)?l.height:I.height*o+.5*I.height/2*o,this.multipleRow[c].index=o,e.multilevel[o]=w[c].end}else"Horizontal"===e.orientation&&"MultipleRows"===e.labelIntersectAction&&0===c&&0===e.labelRotation&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&(e.multilevel[1]=w[c].end),l.height=l.height>I.height?l.height:I.height}return l.height=e.angle%180==0?l.height*M:l.height,i.cellSettings.border.width>=20&&"Horizontal"!==e.orientation&&(l.width=l.width+i.cellSettings.border.width/4),e.opposedPosition?this.farSizes.push("Horizontal"===e.orientation?l.height:l.width+n):this.nearSizes.push("Horizontal"===e.orientation?l.height:l.width+n),l},i.prototype.calculateNumericAxisLabels=function(e){var i,l,a=0,n=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),a=t.isNullOrUndefined(this.minimum)?i||0:this.minimum,n=t.isNullOrUndefined(this.maximum)?l||this.maxLength*this.increment:this.maximum;var s;this.minimum&&this.maximum&&a>n&&(s=a,a=n,n=s),n=t.isNullOrUndefined(this.maximum)?l||n+a:n;var r=t.isNullOrUndefined(this.labelFormat)?"":this.labelFormat,h=null!==r.match("{value}");this.format=e.intl.getNumberFormat({format:h?"":r});for(d=a;d<=n;d+=o*this.increment){p=D(h,r,d,this.format);this.axisLabels.push(p)}this.min=0,this.axisLabelSize=Math.floor((n-a)/this.increment+1),this.max=this.axisLabelSize-1,this.axisLabelInterval=o;for(var d=a;d<=n;d+=this.increment){var p=D(h,r,d,this.format);this.tooltipLabels.push(p),this.labelValue.push(d)}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateCategoryAxisLabels=function(){var e=this.labels?this.labels:[];e=e.length>0?e:this.jsonCellLabel;var i,l=t.isNullOrUndefined(this.minimum)||this.minimum instanceof Date?0:this.minimum,a=t.isNullOrUndefined(this.maximum)||this.maximum instanceof Date?this.maxLength:this.maximum,n=this.interval?this.interval:1,o=t.isNullOrUndefined(this.labelFormat)?"":this.labelFormat,s=null!==o.match("{value}");if(!t.isNullOrUndefined(this.minimum)&&!t.isNullOrUndefined(this.maximum)&&l>a&&(i=l,l=a,a=i),e&&e.length>0)for(h=l;h<=a;h+=n){r=t.isNullOrUndefined(e[h])?s?o.replace("{value}",h.toString()):h.toString():s?o.replace("{value}",e[h].toString()):e[h].toString();this.axisLabels.push(r)}else for(h=l;h<=a;h+=n){var r=s?o.replace("{value}",h.toString()):h.toString();this.axisLabels.push(r)}for(var h=l;h<=a;h++)this.tooltipLabels.push(t.isNullOrUndefined(e[h])?s?o.replace("{value}",h.toString()):h.toString():s?o.replace("{value}",e[h].toString()):e[h].toString()),this.labelValue.push(t.isNullOrUndefined(e[h])?h.toString():e[h].toString());this.min=l,this.max=a,this.axisLabelSize=a-l+1,this.axisLabelInterval=n,this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateDateTimeAxisLabel=function(e){var t,i,a=this.interval?this.interval:1,n={skeleton:"full",type:"dateTime"},o=e.intl.getDateParser(n),s=e.intl.getDateFormat(n),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,i=this.maxLength*this.increment;for(var g=t;g<=i;g+=a*this.increment)this.axisLabels.push(g.toString()),this.tooltipLabels.push(g.toString()),this.labelValue.push(g.toString());this.min=0,this.max=this.maxLength,this.axisLabelSize=(i-t)/this.increment+1,this.axisLabelInterval=a}else{null!==d&&null===p?i=L(t=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:d}).val)))),this.maxLength,this.intervalType,this.increment).getTime():null===d&&null!==p?t=L(i=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:p}).val)))),-this.maxLength,this.intervalType,this.increment).getTime():(t=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:d}).val)))),i=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:p}).val))))),this.format=e.intl.getDateFormat({format:this.labelFormat,skeleton:this.getSkeleton()});for(var c=t;c<=i;){u=this.format(new Date(c));this.axisLabels.push(u),"None"!==this.showLabelOn&&(a=this.calculateLabelInterval(c),this.dateTimeAxisLabelInterval.push(a)),c=L(c,a,this.intervalType,this.increment).getTime()}for(this.min=0,this.axisLabelInterval=a,this.axisLabelSize=this.getTotalLabelLength(t,i),this.max=this.axisLabelSize-1,c=t;c<=i;){var u=this.format(new Date(c));this.tooltipLabels.push(u),this.labelValue.push(new Date(c)),c=L(c,1,this.intervalType,this.increment).getTime()}}this.labelValue=this.isInversed?this.labelValue.reverse():this.labelValue},i.prototype.calculateLabelInterval=function(e){var t,i,l=new Date(e).getFullYear(),a=new Date(e).getMonth()+1,n=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,a,0).getDate(),t+=1-n,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},i.prototype.getSkeleton=function(){return"Years"===this.intervalType?"yMMM":"Months"===this.intervalType?"MMMd":"Days"===this.intervalType?"yMd":"Hours"===this.intervalType?"EHm":(this.intervalType,"Hms")},i.prototype.getTotalLabelLength=function(e,t){var i,l,a=0,n=new Date(e),o=new Date(t);switch(this.intervalType){case"Years":var s=(o.getFullYear()-n.getFullYear())/this.increment+1;a=Math.floor(s);break;case"Months":var r=12*(o.getFullYear()-n.getFullYear());r-=n.getMonth(),a=(r+=o.getMonth())<=0?1:Math.floor(r/this.increment+1);break;case"Days":i=Math.abs(n.getTime()-o.getTime()),l=Math.floor(i/864e5),a=Math.floor(l/this.increment+1);break;case"Hours":i=Math.abs(n.getTime()-o.getTime());var h=Math.floor(i/36e5);a=Math.floor(h/this.increment)+1;break;case"Minutes":i=Math.abs(n.getTime()-o.getTime());var d=Math.floor(i/6e4);a=Math.floor(d/this.increment)+1}return a},i.prototype.clearAxisLabel=function(){this.axisLabels=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.labelValue=[]},i.prototype.clearMultipleRow=function(){this.multipleRow=[],this.multilevel=[]},i.prototype.destroy=function(){this.axisLabels=null,this.multipleRow=null,this.rect=null,this.nearSizes=null,this.farSizes=null,this.maxLabelSize=null,this.titleSize=null,this.labelValue=null,this.format=null,this.multilevel=[],this.tooltipLabels=[],this.dateTimeAxisLabelInterval=[],this.jsonCellLabel=[],this.multiLevelSize=[],this.xAxisMultiLabelHeight=[],this.yAxisMultiLabelHeight=[],this.multiLevelPosition=[]},ze([t.Complex({text:"",textStyle:A.axisTitleFont},H)],i.prototype,"title",void 0),ze([t.Property(!1)],i.prototype,"opposedPosition",void 0),ze([t.Property(null)],i.prototype,"labels",void 0),ze([t.Complex(A.axisLabelFont,V)],i.prototype,"textStyle",void 0),ze([t.Property(0)],i.prototype,"labelRotation",void 0),ze([t.Property(!1)],i.prototype,"isInversed",void 0),ze([t.Property("Category")],i.prototype,"valueType",void 0),ze([t.Property(1)],i.prototype,"increment",void 0),ze([t.Property("None")],i.prototype,"showLabelOn",void 0),ze([t.Property(null)],i.prototype,"minimum",void 0),ze([t.Property(null)],i.prototype,"maximum",void 0),ze([t.Property(null)],i.prototype,"interval",void 0),ze([t.Property("")],i.prototype,"labelFormat",void 0),ze([t.Property("Days")],i.prototype,"intervalType",void 0),ze([t.Property("Trim")],i.prototype,"labelIntersectAction",void 0),ze([t.Property(!1)],i.prototype,"enableTrim",void 0),ze([t.Property(35)],i.prototype,"maxLabelLength",void 0),ze([t.Complex({color:"#b5b5b5",width:0,type:"Rectangle"},U)],i.prototype,"border",void 0),ze([t.Collection([],Y)],i.prototype,"multiLevelLabels",void 0),i}(t.ChildProperty),De=function(){function e(e){this.heatMap=e,this.padding=10,this.drawSvgCanvas=new xe(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,a=0,n=l.length;a<n;a++){var o=l[a];"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 me(this.heatMap.element.id+"_XAxisLine",new ue(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 me(this.heatMap.element.id+"_YAxisLine",new ue(i,this.initialClipRect.y,i,this.initialClipRect.height+this.initialClipRect.y),"transparent",0);this.drawSvgCanvas.drawLine(l,e)},e.prototype.drawXAxisTitle=function(e,i,l){var a="0px"===e.textStyle.size?0:10,n=l.y+(e.opposedPosition?-(e.maxLabelSize.height+a+g(e.xAxisMultiLabelHeight)):e.maxLabelSize.height+a+g(e.xAxisMultiLabelHeight));if(e.title.text){var o=this.heatMap,h=e.title,d=this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(h.text):h.text,p=s(d,h.textStyle),c=this.padding,u="Near"===h.textStyle.textAlignment?"start":"Far"===h.textStyle.textAlignment?"end":"middle";c=e.opposedPosition?-(c+p.height/4):c+3*p.height/4;var m=new ge(o.element.id+"_XAxisTitle",new ce(l.x+r(l.width,0,0,h.textStyle),n+c,u,d),h.textStyle,h.textStyle.color||o.themeStyle.axisTitle);this.drawSvgCanvas.createText(m,i,d)}},e.prototype.drawYAxisTitle=function(e,i,l){if(e.title.text){var a=e.title,n=this.heatMap,o=e.opposedPosition?90:-90,s="Near"===a.textStyle.textAlignment?"start":"Far"===a.textStyle.textAlignment?"end":"middle",r=10;r=e.opposedPosition?r:-r;var h="0px"===e.textStyle.size?0:r,d=l.x+h+(e.opposedPosition?e.maxLabelSize.width+g(e.yAxisMultiLabelHeight):-(e.maxLabelSize.width+g(e.yAxisMultiLabelHeight))),p=l.y+c(l,0,0,a.textStyle)+(e.opposedPosition?this.padding:-this.padding),u=this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(a.text):a.text,m=new ge(n.element.id+"_YAxisTitle",new ce(d,p-this.padding,s,u,o,"rotate("+o+","+d+","+p+")","auto"),a.textStyle,a.textStyle.color||n.themeStyle.axisTitle);this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(m,u,d,p):this.drawSvgCanvas.createText(m,i,u)}},e.prototype.calculateVisibleLabels=function(){for(var e,t=this.heatMap.axisCollections,i=this.heatMap.dataSourceSettings,l=!(i&&i.isJsonData&&"Cell"===i.adaptorType),a=0,n=t.length;a<n;a++)"Numeric"===(e=t[a]).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,a=l.length-1;a>=0;a--){var n="0px"===(t=l[a]).textStyle.size?0:this.padding;t.nearSizes=[],t.farSizes=[],t.computeSize(t,i,e),t.opposedPosition?"Horizontal"===t.orientation?(e.y+=g(t.farSizes)+n,e.height-=g(t.farSizes)+n):e.width-=g(t.farSizes)+n:"Horizontal"===t.orientation?e.height-=g(t.nearSizes)+n:(e.x+=g(t.nearSizes)+n,e.width-=g(t.nearSizes)+n)}},e.prototype.calculateAxisSize=function(e){for(var i=this.heatMap.axisCollections,l=0,a=i.length;l<a;l++){var n=i[l];n.rect=t.extend({},e,null,!0),"Horizontal"===n.orientation&&0!==n.multiLevelLabels.length&&(n.opposedPosition&&(n.rect.y+=0===n.angle||180===n.angle||360===n.angle?0:this.padding,this.heatMap.initialClipRect.y+=0===n.angle||180===n.angle||360===n.angle?0:this.padding),e.height-=0===n.angle||180===n.angle||360===n.angle?0:this.padding),"Horizontal"!==n.orientation||n.opposedPosition||(n.rect.y=e.y+e.height,n.rect.height=0),"Vertical"===n.orientation&&n.opposedPosition&&(n.rect.x=e.x+e.width,n.rect.width=0),n.multiLevelPosition=[];for(var o=0;o<n.multiLevelLabels.length;o++){var s=n.multiPosition(n,o);n.multiLevelPosition.push(s)}}},e.prototype.drawXAxisLabels=function(e,i,l){var a=this.heatMap,n=e.axisLabels,o=!1,r=this.heatMap.cellSettings.border.width>5?this.heatMap.cellSettings.border.width/2:0,h=(l.width-r)/e.axisLabelSize,d=0,p=e.interval?e.interval:1,g=l.width/(e.axisLabelSize/e.axisLabelInterval),c=e.axisLabelInterval;if(g>0)for(;g<parseInt(e.textStyle.size,10);)c+=1,g=l.width/(e.axisLabelSize/c);else c=e.tooltipLabels.length;e.axisLabelInterval<c&&(d=c,n=e.tooltipLabels,p=c);var y,x,f=10,S=l.x+(e.isInversed?l.width:0),C=e.angle;f=this.padding;var M,w;a.enableCanvasRendering||(M=this.heatMap.renderer.createGroup({id:a.element.id+"XAxisLabels"}),w=this.heatMap.renderer.createGroup({id:a.element.id+"XAxisLabelBorder"})),e.isInversed&&"MultipleRows"===e.labelIntersectAction&&e.multipleRow.reverse(),o=v(n);for(var L=0,T=n.length;L<T;L++){var R=new pe(S,l.y,h,l.height),O=s(n[L],e.textStyle),z="Wrap"!==e.textStyle.textOverflow&&!o&&"Trim"!==e.textStyle.textOverflow&&"Trim"===e.labelIntersectAction&&(e.isIntersect||O.width>h)?"DateTime"!==e.valueType||"None"===e.showLabelOn?b(h*p,n[L],e.textStyle):b(e.dateTimeAxisLabelInterval[L]*h,n[L],e.textStyle):n[L];z=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||o?z:b("Trim"===e.textStyle.textOverflow?h-e.border.width/2:e.maxLabelLength,n[L],e.textStyle),a.enableHtmlSanitizer&&(z=t.SanitizeHtmlHelper.sanitize(z));var P=z,D=[],A=new ae(0,0);"Wrap"!==e.textStyle.textOverflow&&!o||e.enableTrim?(o&&e.enableTrim&&(D=this.getLabels(P,h-e.border.width/2,e,o),P=b(e.maxLabelLength,D[0],e.textStyle),P=-1===z.indexOf("<br>")&&-1===z.indexOf("<br/>")||-1!==P.indexOf("...")?P:P+"...",D=[]),D.push(P)):(D=this.getLabels(P,h-e.border.width/2,e,o),P=this.getMaxLabel(D,e)),O=s(P,e.textStyle);var F=void 0;x=e.opposedPosition?-f:f+(C%360==0?O.height/2:0),O.width=e.isInversed&&O.width>h?h:O.width;var I=R.x+(e.isInversed?-(R.width/2+O.width/2):R.width/2-O.width/2);if("Near"===e.textStyle.textAlignment?I=R.x-(e.isInversed?R.width:0):"Far"===e.textStyle.textAlignment&&(I=R.x+(e.isInversed?-O.width:R.width-O.width)),"Trim"===e.labelIntersectAction?I=e.isInversed?I>S-h?I:S-h:I>=R.x?I:R.x:C%180==0&&(I=(I=I<l.x?l.x:I)+O.width>l.x+l.width?l.x+l.width-O.width:I),"Wrap"!==e.textStyle.textOverflow&&!o||e.isInversed||(I=I<R.x?R.x:I),"MultipleRows"===e.labelIntersectAction&&"Wrap"!==e.textStyle.textOverflow&&"Trim"!==e.textStyle.textOverflow&&0===e.labelRotation){var V=e.opposedPosition?-(e.multipleRow[L].index-1):e.multipleRow[L].index-1;y=e.multipleRow[L].index>1?l.y+x+O.height*V+(e.opposedPosition?-.5*O.height/2*e.multipleRow[L].index:.5*O.height/2*e.multipleRow[L].index):l.y+x+(e.opposedPosition?-.5*O.height/2:.5*O.height/2)}else y=l.y+(("Wrap"===e.textStyle.textOverflow||o)&&e.opposedPosition&&C%360==0?-(e.farSizes.length>=1?e.farSizes[1]:0)+f:x);this.drawXAxisBorder(e,w,e.rect,I,O.width,L),I="Center"===e.textStyle.textAlignment&&D.length>1?I+O.width/2:"Near"===e.textStyle.textAlignment?I+f/2:"Far"===e.textStyle.textAlignment?I-f/2:I,C%360!=0&&(C=C>360?C%360:C,A=u(e.textStyle,D,C),I=R.x+(e.isInversed?-R.width/2:R.width/2)+(90===C?O.height*((D.length-1)/2):270===C?-O.height*(D.length-1)/2:0),y+=e.opposedPosition?("Wrap"!==e.textStyle.textOverflow&&!o||e.enableTrim?-A.height/2:(C%360==180?f:0)+A.height/2-(e.farSizes.length>=1?e.farSizes[1]:0))+e.border.width/2:C%360==0?0:C%360==180?A.height/2-e.border.width+f:A.height/2-e.border.width,D.length>1&&(y-=C>0&&C<80||C>300&&C<360?O.height*((D.length-1)/2):C>120&&C<240&&180!==C&&D.length>2?-O.height*((D.length-2)/2):0,I+=C>0&&C<70?O.height*((D.length-1)/2):0),F="rotate("+C+","+I+","+y+")"),this.heatMap.cellSettings.border.width>5&&e.opposedPosition&&(y-=this.heatMap.cellSettings.border.width/2),this.heatMap.yAxis.opposedPosition&&this.heatMap.cellSettings.border.width>5&&(I+=this.heatMap.cellSettings.border.width/2),this.heatMap.xAxis.isInversed&&this.heatMap.cellSettings.border.width>5&&(I-=this.heatMap.cellSettings.border.width/2),O.width>=h&&(I=e.border.width?I+e.border.width/2:I),I="Near"===e.textStyle.textAlignment?I+e.border.width/2:"Far"===e.textStyle.textAlignment?I-e.border.width/2:I,I=C%360==0&&"Center"===e.textStyle.textAlignment&&O.width>h?R.x+(e.isInversed?-O.width/2:O.width/2):I;var E=new ge(a.element.id+"_XAxis_Label"+L,new ce(I,y,C%360==0?"Center"===e.textStyle.textAlignment&&D.length>1?"middle":"start":"middle",z,C,F),e.textStyle,e.textStyle.color||a.themeStyle.axisLabel);if(E.text=o?D:m(E.text,e.textStyle,R.width-e.border.width/2),0!==C&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(E,null,null,null,D,O.height,!0):"Wrap"===e.textStyle.textOverflow||o?this.drawSvgCanvas.createWrapText(E,e.textStyle,M):this.drawSvgCanvas.createText(E,M,z),0===d){var _="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[L]:e.axisLabelInterval;S+=e.isInversed?-_*h:_*h}else S+=e.isInversed?-d*h:d*h;if(-1!==P.indexOf("...")){var B=e.angle%360!=0?I-A.width/2:"Center"===e.textStyle.textAlignment?I-O.width/2:I,N=y-(e.angle%360!=0?A.height/2:O.height);z=-1!==n[L].indexOf("<br>")||-1!==n[L].indexOf("<br/>")?n[L].replace(/<br\s*\/?>/g," "):n[L],this.heatMap.tooltipCollection.push(new Se(z,new pe(B,N,e.angle%360!=0?A.width:O.width,e.angle%360!=0?A.height:O.height*D.length)))}0!==d&&(L+=d-1)}a.enableCanvasRendering||(i.appendChild(M),i.appendChild(w))},e.prototype.getWrappedLabels=function(e,t,i){for(var l=e.split(/<br\s*\/?>/,-1),a=0;a<l.length;a++){var n=l[a];l[a]=b(t,n,i.textStyle)}return l},e.prototype.getMaxLabel=function(e,t){for(var i="",l=0,a=new ae(0,0),n=0;n<e.length;n++)(a=s(e[n],t.textStyle)).width>l&&(l=a.width,i=e[n]);return i},e.prototype.getLabels=function(e,t,i,l){return l?this.getWrappedLabels(e,t,i):x(e,t,i.textStyle)},e.prototype.drawYAxisLabels=function(e,i,l){var a,n=this.heatMap,o=e.axisLabels,r=l.height/e.axisLabelSize,h=0,d=l.height/(e.axisLabelSize/e.axisLabelInterval),p=e.axisLabelInterval;if(d>0)for(;d<parseInt(e.textStyle.size,10);)p+=1,d=l.height/(e.axisLabelSize/p);else p=e.tooltipLabels.length;e.axisLabelInterval<p&&(h=p,o=e.tooltipLabels);var g=10,c=l.y+(e.isInversed?0:l.height),y=e.opposedPosition?"start":"end";g=e.opposedPosition?g:-g;var x,f;n.enableCanvasRendering||(x=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabels"}),f=this.heatMap.renderer.createGroup({id:n.element.id+"YAxisLabelBorder"}));for(var S=v(o),C=0,M=o.length;C<M;C++){var w=new pe(l.x,c,l.width,r),L=e.isInversed?w.height/2:-w.height/2,T=this.heatMap.cellSettings.border.width>=20?this.heatMap.cellSettings.border.width/2:0,R=this.heatMap.cellSettings.border.width>5?this.heatMap.cellSettings.border.width/2/M*(e.isInversed?C:M-C):0;a=!e.enableTrim&&"Trim"!==e.textStyle.textOverflow||S?o[C]:b(e.maxLabelLength,o[C],e.textStyle),n.enableHtmlSanitizer&&(a=t.SanitizeHtmlHelper.sanitize(a));var O=s(a,e.textStyle),z=1,P=[],D=new ae(0,0);if("Wrap"!==e.textStyle.textOverflow&&!S||e.enableTrim){if(S&&e.enableTrim){P=this.getLabels(a,e.maxLabelLength,e,S);var A=b(e.maxLabelLength,P[0],e.textStyle);a=-1===a.indexOf("<br>")&&-1===a.indexOf("<br/>")||-1!==A.indexOf("...")?A:A+"...",P=[]}P.push(a)}else{P=this.getLabels(a,e.maxLabelLength,e,S);for(var F=0;F<P.length;F++)O.height*P.length>d+5&&P.length>0&&90!==e.angle&&270!==e.angle&&(P.pop(),P.length>0&&(P[P.length-1]=P[P.length-1]+"...",P[P.length-1]=b(e.maxLabelLength,P[P.length-1],e.textStyle)));if(!S){a=0!==P.length?"":a;for(var I=0;I<P.length;I++)a=t.isNullOrUndefined(a)?P[I]:a+" "+P[I]}z=P.length}var V=w.x+g+(e.opposedPosition?("Wrap"===e.textStyle.textOverflow&&e.angle%360!=0?z*(O.height/2):0)+T:-T);"Far"===e.textStyle.textAlignment&&e.angle%360==0?L=e.isInversed?w.height-(z>1?O.height*z-O.height/2:O.height/2):-(z>1?O.height*z-O.height/2:O.height/2):"Near"===e.textStyle.textAlignment&&e.angle%360==0&&(L=(e.isInversed?O.height/2:O.height/2-w.height)+e.border.width/2);var E=w.y-R+L-(z>1&&"Center"===e.textStyle.textAlignment||e.angle%360!=0&&e.opposedPosition?O.height*z/2-O.height/2:0);if(e.angle%360!=0&&(y="middle",e.angle=e.angle>360?e.angle%360:e.angle,D=u(e.textStyle,P,e.angle),V=w.x+(e.opposedPosition?D.width/2+g:-(D.width/2-g))+(90===e.angle?O.height*((P.length-1)/2):270===e.angle?-O.height*(P.length-1)/2:0),E=w.y+(e.isInversed?w.height/2:-w.height/2)+(180===e.angle?O.height*((P.length-1)/2):0),P.length>1)){var _=O.height*((P.length-1)/2);E-=e.angle>0&&e.angle<60||e.angle>290&&e.angle<360?_:e.angle>115&&e.angle<240&&180!==e.angle?-_:0,V+=e.angle>20&&e.angle<160&&90!==e.angle?_:e.angle>200&&e.angle<330&&270!==e.angle?-_-(e.angle>200&&e.angle<240&&!e.opposedPosition&&P.length>2?-O.height*((P.length-2)/2):0):e.angle>=330&&e.angle<350?-_/2:0}var B=new ge(n.element.id+"_YAxis_Label"+C,new ce(V,E,y,a,e.angle,"rotate("+e.angle+","+V+","+E+")","middle"),e.textStyle,e.textStyle.color||n.themeStyle.axisLabel);if(t.Browser.isIE&&!n.enableCanvasRendering&&(B.dy="1ex"),B.text=S?P:m(B.text,e.textStyle,e.maxLabelLength),0!==e.angle&&this.heatMap.enableCanvasRendering?this.drawSvgCanvas.canvasDrawText(B,null,null,null,P,O.height,!0):"Wrap"===e.textStyle.textOverflow||S?this.drawSvgCanvas.createWrapText(B,e.textStyle,x):this.drawSvgCanvas.createText(B,x,a),-1!==(a=this.getMaxLabel(P,e)).indexOf("...")){var N=e.opposedPosition?V:V-(e.angle%360!=0?D.width/2:O.width),H=E-(e.angle%360!=0?D.height/2:O.height);a=-1!==o[C].indexOf("<br>")||-1!==o[C].indexOf("<br/>")?o[C].replace(/<br\s*\/?>/g," "):o[C],this.heatMap.tooltipCollection.push(new Se(a,new pe(N,H,e.angle%360!=0?D.width:O.width,e.angle%360!=0?D.height:O.height*P.length)))}if(0===h){var k="DateTime"===e.valueType&&"None"!==e.showLabelOn?e.dateTimeAxisLabelInterval[C]:e.axisLabelInterval;c+=e.isInversed?k*r:-k*r}else c+=e.isInversed?h*r:-h*r,C+=h-1;this.drawYAxisBorder(e,f,e.rect,E,O.height,C)}n.enableCanvasRendering||(i.appendChild(x),i.appendChild(f))},e.prototype.drawXAxisBorder=function(e,t,i,l,a,n){var o,s,r=i.width/e.axisLabelSize,h="",d=e.interval?e.interval:1,p=e.isInversed?i.x+i.width-r*n*d:i.x+r*n*d,g=i.y;s=g+(e.opposedPosition?-(e.maxLabelSize.height+10):e.maxLabelSize.height+10),o=e.isInversed?p-r:p+r;var c=e.isInversed?l+a+10:l-10,u=e.isInversed?l-10:l+a+10;switch(u="Near"===e.textStyle.textAlignment&&e.isInversed?u+10:"Far"!==e.textStyle.textAlignment||e.isInversed?u:u-10,c="Far"===e.textStyle.textAlignment&&e.isInversed?c-10:"Near"!==e.textStyle.textAlignment||e.isInversed?c:c+10,e.border.type){case"Rectangle":h="M "+p+" "+g+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+g+" L "+p+" "+g;break;case"WithoutTopBorder":h="M "+p+" "+g+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+g+" ";break;case"WithoutBottomBorder":h="M "+p+" "+s+" L "+p+" "+g+" L "+o+" "+g+" L "+o+" "+s+" ";break;case"WithoutTopandBottomBorder":h="M "+p+" "+g+" L "+p+" "+s+" M "+o+" "+g+" L "+o+" "+s+" ";break;case"Brace":h="M "+p+" "+g+" L "+p+" "+(s=g+(s-g)/2+(e.opposedPosition?0:5))+" L "+c+" "+s+" M "+u+" "+s+" L "+o+" "+s+" L "+o+" "+g+" "}e.border.width>0&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,h,t,n)},e.prototype.drawYAxisBorder=function(e,t,i,l,a,n){var o,s,r=i.height/e.axisLabelSize,h="",d=e.interval?e.interval:1,p=i.x,g=e.isInversed?i.y+r*n*d:i.y+i.height-r*n*d;o=p+(e.opposedPosition?e.maxLabelSize.width+20:-(e.maxLabelSize.width+20)),s=e.isInversed?g+r:g-r;var c=e.isInversed?l-a/2:l+a/2,u=e.isInversed?l+a/2:l-a/2;switch(e.border.type){case"Rectangle":h="M "+p+" "+g+" L "+p+" "+s+" L "+o+" "+s+" L "+o+" "+g+" L "+p+" "+g;break;case"WithoutTopBorder":h="M "+p+" "+g+" L "+o+" "+g+" L "+o+" "+s+" L "+p+" "+s+" ";break;case"WithoutBottomBorder":h="M "+o+" "+g+" L "+p+" "+g+" L "+p+" "+s+" L "+o+" "+s+" ";break;case"WithoutTopandBottomBorder":h="M "+p+" "+g+" L "+o+" "+g+" M "+o+" "+s+" L "+p+" "+s+" ";break;case"Brace":h="M "+p+" "+g+" L "+(o=p-(p-o)/2)+" "+g+" L "+o+" "+c+" M "+o+" "+u+" L "+o+" "+s+" L "+p+" "+s}e.border.width>0&&"WithoutBorder"!==e.border.type&&this.createAxisBorderElement(e,h,t,n)},e.prototype.createAxisBorderElement=function(e,t,i,l){var a="Horizontal"===e.orientation?"_XAxis_Label_Border":"_YAxis_Label_Border",n=new oe(this.heatMap.element.id+a+l,"transparent",e.border.width,e.border.color,1,"none",t);if(this.heatMap.enableCanvasRendering)this.heatMap.canvasRenderer.drawPath(n,void 0);else{var o=this.heatMap.renderer.drawPath(n);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):this.renderYAxisMultiLevelLabels(t,i),this.heatMap.enableCanvasRendering||e.appendChild(i)},e.prototype.renderXAxisMultiLevelLabels=function(e,i){var l,a,n,o,r,h,d,p,g,c,u,m=this,y=0,v=0,f=e.isInversed,S=e.opposedPosition,C="",M=(f?e.rect.width:0)+e.rect.x;e.multiLevelLabels.map(function(w,L){g=m.heatMap.renderer.createGroup({id:m.heatMap.element.id+"_XAxisMultiLevelLabel"+L}),w.categories.map(function(T,R){if(!t.isNullOrUndefined(T.start)&&!t.isNullOrUndefined(T.end)){"Tailwind"!==m.heatMap.theme&&"TailwindDark"!==m.heatMap.theme||w.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==m.heatMap.theme&&"Tailwind3Dark"!==m.heatMap.theme||w.setProperties({textStyle:{color:m.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==m.heatMap.theme&&"Material3Dark"!==m.heatMap.theme||w.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Fluent"!==m.heatMap.theme&&"FluentDark"!==m.heatMap.theme||w.setProperties({textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}},!0),"Fluent2"===m.heatMap.theme&&w.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==m.heatMap.theme&&"Fluent2HighContrast"!==m.heatMap.theme||w.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5"===m.heatMap.theme&&w.setProperties({textStyle:{color:"#212529",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Bootstrap5Dark"===m.heatMap.theme&&w.setProperties({textStyle:{color:"#DEE2E6",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),o=!1,r="number"==typeof T.start?T.start:Number(new Date(T.start)),h="number"==typeof T.end?T.end:Number(new Date(T.end)),a=M+m.calculateLeftPosition(e,r,T.start,e.rect),n=e.multiLevelPosition[L].y,v=M+m.calculateWidth(e,T.end,h,e.rect);var O=m.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(T.text):T.text;d=s(O,w.textStyle),c=(null===T.maximumTextWidth?Math.abs(v-a):T.maximumTextWidth)-10,l=n+(S?-(e.xAxisMultiLabelHeight[L]-d.height):d.height),y=f?a-c:a+10,"Center"===w.alignment?(y=(v-a)/2+a,y-=(d.width>c?c:d.width)/2):"Far"===w.alignment?(y=f?a-10:v-10,y-=d.width>c?c:d.width):y=f?v+10:a+10,"None"===w.overflow&&d.width>Math.abs(v-a)&&(y=f?a-d.width-10:a+10,p="start");var z=new ce(y,l,p,O,0,"translate(0,0)"),P=new ge(m.heatMap.element.id+"_XAxis_MultiLevel"+L+"_Text"+R,z,w.textStyle,w.textStyle.color||m.heatMap.themeStyle.axisLabel);if("Wrap"===w.overflow?(P.text=x(O,c,w.textStyle),u=P.text.length):"Trim"===w.overflow&&(P.text=b(c,O,w.textStyle),u=1),"Wrap"===w.overflow&&P.text.length>1){m.drawSvgCanvas.createWrapText(P,w.textStyle,g);for(var D=0;D<P.text.length;D++)if(-1!==P.text[D].indexOf("...")){o=!0;break}}else m.drawSvgCanvas.createText(P,g,P.text);m.heatMap.enableCanvasRendering||i.appendChild(g),(-1!==P.text.indexOf("...")||-1!==P.text[0].indexOf("...")||o)&&m.heatMap.tooltipCollection.push(new Se(T.text,new pe(y,l-d.height,c,d.height*u))),w.border.width>0&&"WithoutBorder"!==w.border.type&&(C=m.renderXAxisLabelBorder(L,e,a,n,v,C,L,d,c,y))}}),""!==C&&(m.createBorderElement(L,e,C,i),C="")}),this.heatMap.enableCanvasRendering||i.appendChild(g)},e.prototype.renderXAxisLabelBorder=function(e,t,i,l,a,n,o,s,r,h){var d=l+(t.opposedPosition?-t.xAxisMultiLabelHeight[e]:t.xAxisMultiLabelHeight[e]);switch(t.multiLevelLabels[o].border.type){case"Rectangle":n+="M "+i+" "+l+" L "+i+" "+d+" L "+a+" "+d+" L "+a+" "+l+" L "+i+" "+l+" ";break;case"WithoutTopBorder":n+="M "+i+" "+l+" L "+i+" "+d+" L "+a+" "+d+" L "+a+" "+l+" ";break;case"WithoutBottomBorder":n+="M "+i+" "+d+" L "+i+" "+l+" L "+a+" "+l+" L "+a+" "+d+" ";break;case"WithoutTopandBottomBorder":n+="M "+i+" "+l+" L "+i+" "+d+" M "+a+" "+l+" L "+a+" "+d+" ";break;case"Brace":n+="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 "+a+" "+(l+(d-l)/2)+" L "+a+" "+l+" "}return n},e.prototype.renderYAxisMultiLevelLabels=function(e,i){var l,a,n,o,r,h,d,p,g,c,u=this,m=0,y=e.isInversed,v="",f=(y?0:e.rect.height)+e.rect.y;e.multiLevelLabels.map(function(S,C){n=e.multiLevelPosition[C].y,p=u.heatMap.renderer.createGroup({id:u.heatMap.element.id+"_YAxisMultiLevelLabel"+C}),S.categories.map(function(M,w){"Tailwind"!==u.heatMap.theme&&"TailwindDark"!==u.heatMap.theme||S.setProperties({textStyle:{fontFamily:"Inter"}},!0),"Tailwind3"!==u.heatMap.theme&&"Tailwind3Dark"!==u.heatMap.theme||S.setProperties({textStyle:{color:u.heatMap.themeStyle.axisLabel,fontFamily:"Inter",fontWeight:"400"}},!0),"Material3"!==u.heatMap.theme&&"Material3Dark"!==u.heatMap.theme||S.setProperties({textStyle:{fontFamily:"Roboto"}},!0),"Bootstrap5"!==u.heatMap.theme&&"Bootstrap5Dark"!==u.heatMap.theme||S.setProperties({textStyle:{fontFamily:"Segoe UI"}},!0),"Fluent2"===u.heatMap.theme&&S.setProperties({textStyle:{color:"#242424",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),"Fluent2Dark"!==u.heatMap.theme&&"Fluent2HighContrast"!==u.heatMap.theme||S.setProperties({textStyle:{color:"#FFFFFF",size:"12px",fontWeight:"400",fontFamily:"Segoe UI"}},!0),r="number"==typeof M.start?M.start:Number(new Date(M.start)),h="number"==typeof M.end?M.end:Number(new Date(M.end)),n=f+u.calculateLeftPosition(e,r,M.start,e.rect),a=e.multiLevelPosition[C].x,o=f+u.calculateWidth(e,M.start,h,e.rect);var L=u.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(M.text):M.text;d=s(L,S.textStyle),g=(null===M.maximumTextWidth?Math.abs(a):M.maximumTextWidth)-10;var T=Math.abs(a-(a-e.multiLevelSize[C].width-20))/2-d.width/2;m=(e.opposedPosition?a:a-e.multiLevelSize[C].width-20)+T,l=n+10,"None"!==S.overflow&&(c="Wrap"===S.overflow?x(L,g,S.textStyle):b(g,L,S.textStyle)),"Center"===S.alignment?l+=(o-n)/2-c.length*d.height/2:l="Far"===S.alignment?y?o-d.height/2:l-d.height:y?l+d.height/2:o+d.height,S.border.width>0&&"WithoutBorder"!==S.border.type&&(v=u.renderYAxisLabelBorder(C,e,a,n,o,v,C,d,g,l));var R=new ce(m,l,"start",u.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(M.text):M.text,0,"translate(0,0)"),O=new ge(u.heatMap.element.id+"_YAxis_MultiLevel"+C+"_Text"+w,R,S.textStyle,S.textStyle.color||u.heatMap.themeStyle.axisLabel);O.text=c,u.drawSvgCanvas.createText(O,p,O.text),-1!==O.text.indexOf("...")&&u.heatMap.tooltipCollection.push(new Se(M.text,new pe(m,l-d.height,g,d.height))),u.heatMap.enableCanvasRendering||i.appendChild(p)}),""!==v&&(u.createBorderElement(C,e,v,i),v="")}),this.heatMap.enableCanvasRendering||i.appendChild(p)},e.prototype.renderYAxisLabelBorder=function(e,t,i,l,a,n,o,s,r,h){var d=20,p=i-(t.opposedPosition?-(t.multiLevelSize[e].width+d):t.multiLevelSize[e].width+d);switch(t.multiLevelLabels[o].border.type){case"Rectangle":n+="M "+i+" "+l+" L "+p+" "+l+" L "+p+" "+a+" L "+i+" "+a+" L "+i+" "+l+" ";break;case"WithoutTopBorder":n+="M "+i+" "+l+" L "+p+" "+l+" L "+p+" "+a+" L "+i+" "+a+" ";break;case"WithoutBottomBorder":n+="M "+p+" "+l+" L "+i+" "+l+" L "+i+" "+a+" L "+p+" "+a+" ";break;case"WithoutTopandBottomBorder":n+="M "+i+" "+l+" L "+p+" "+l+" M "+i+" "+a+" L "+p+" "+a+" ";break;case"Brace":d=10,n+="M "+i+" "+l+" L "+(i+(p-i)/2)+" "+l+" L "+(i+(p-i)/2)+" "+(t.isInversed?h-d-5:h+s.height-d)+" M "+(i+(p-i)/2)+" "+(t.isInversed?h+s.height-d:h-d-5)+" L "+(i+(p-i)/2)+" "+a+" L "+i+" "+a+" "}return n},e.prototype.createBorderElement=function(e,t,i,l){var a="Horizontal"===t.orientation?"XAxis":"YAxis",n=new oe(this.heatMap.element.id+"_"+a+"_MultiLevel_Rect_"+e,"Transparent",t.multiLevelLabels[e].border.width,t.multiLevelLabels[e].border.color,1,"",i),o=this.heatMap.renderer.drawPath(n);this.heatMap.enableCanvasRendering?this.heatMap.canvasRenderer.drawPath(n,void 0):l.appendChild(o)},e.prototype.calculateLeftPosition=function(e,t,i,l){var a,n;return"number"==typeof i?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(t-=e.minimum?e.minimum:0),n=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),a=(e.isInversed?-1:1)*t*n,a="Horizontal"===e.orientation?a:-a):(n=this.calculateNumberOfDays(t,e,!0,l),a=e.isInversed?-n:n,a="Horizontal"===e.orientation?a:-a),a},e.prototype.calculateWidth=function(e,t,i,l){var a,n;return"number"==typeof t?("Numeric"===e.valueType&&(e.minimum||e.maximum)&&(i-=e.minimum?e.minimum:0),a=("Horizontal"===e.orientation?l.width:l.height)/(e.axisLabelSize*e.increment),n=(e.isInversed?-1:1)*(i+1)*a,n="Horizontal"===e.orientation?n:-n):(n=a=this.calculateNumberOfDays(i,e,!1,l),n=e.isInversed?-n:n,n="Horizontal"===e.orientation?n:-n),n},e.prototype.calculateNumberOfDays=function(e,t,i,l){for(var a,n,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(a=new Date(Number(s[p])),n=t.isInversed?new Date(Number(s[p-1])):new Date(Number(s[p+1])),p===(t.isInversed?0:t.axisLabelSize-1))if(n=new Date(Number(s[p])),"Hours"===t.intervalType)n=new Date(Number(n.setHours(n.getHours()+1)));else if("Minutes"===t.intervalType)n=new Date(Number(n.setMinutes(n.getMinutes()+1)));else if("Days"===t.intervalType)n=new Date(Number(n.setDate(n.getDate()+1)));else{g="Months"===t.intervalType?new Date(n.getFullYear(),n.getMonth()+1,0).getDate():n.getFullYear()%4==0?366:365;n=new Date(Number(n.setDate(n.getDate()+g)))}if(Number(a)<=e&&Number(n)>=e){if("Minutes"===t.intervalType||"Hours"===t.intervalType){d=r/Math.round(Math.abs((a.getTime()-n.getTime())/6e4))*Math.abs((a.getTime()-h.getTime())/6e4),o=(p=t.isInversed?t.axisLabelSize-1-p:p)*r+d;break}var g=Math.round(Math.abs((a.getTime()-n.getTime())/864e5));i?h.getDate():h.setDate(h.getDate()+1),0!==g&&(d=r/g*Math.abs((a.getTime()-h.getTime())/864e5)),o=(p=t.isInversed?t.axisLabelSize-1-p:p)*r+d;break}}return o},e.prototype.destroy=function(){this.drawSvgCanvas=null,this.element=null,this.htmlObject=null,this.initialClipRect=null,this.heatMap=null},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)}}(),Fe=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ae(i,e),Fe([t.Property("")],i.prototype,"labelTemplate",void 0),Fe([t.Property(!0)],i.prototype,"showLabel",void 0),Fe([t.Property("")],i.prototype,"format",void 0),Fe([t.Property(!0)],i.prototype,"enableCellHighlighting",void 0),Fe([t.Complex({},W)],i.prototype,"bubbleSize",void 0),Fe([t.Complex({},_)],i.prototype,"border",void 0),Fe([t.Complex(A.rectLabelFont,V)],i.prototype,"textStyle",void 0),Fe([t.Property("Rect")],i.prototype,"tileType",void 0),Fe([t.Property("Color")],i.prototype,"bubbleType",void 0),Fe([t.Property(!1)],i.prototype,"isInversedBubbleSize",void 0),i}(t.ChildProperty),Ve=function(){function e(e){this.heatMap=e,this.drawSvgCanvas=new xe(this.heatMap),this.cellColor=new te(this.heatMap)}return e.prototype.renderRectSeries=function(){this.createSeriesGroup();var e=this.heatMap,i=!1;e.xLength=e.axisCollections[0].axisLabelSize,e.yLength=e.axisCollections[1].axisLabelSize;var l,a,n=Math.round(100*e.initialClipRect.x)/100,o=Math.round(100*e.initialClipRect.y)/100,s=0,r=0,d=e.cellSettings,p=Math.round((e.initialClipRect.width-d.border.width/2)/e.xLength*100)/100,g=Math.round((e.initialClipRect.height-d.border.width/2)/e.yLength*100)/100,c=0,u=[],m=d.border,y=null;this.rectPositionCollection=[],this.color="",this.bubbleColorValue=[],e.yAxis.opposedPosition&&(n=Math.round(100*(e.initialClipRect.x+parseFloat(m.width.toString())/2))/100),t.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate||(document.getElementById(this.heatMap.element.id+"_LabelTemplate_Group")&&C(this.heatMap.element.id+"_LabelTemplate_Group"),y=t.createElement("div",{id:e.element.id+"_LabelTemplate_Group"}));for(var v,b=this.getBubbleRadius(p,g),f=0;f<e.xLength*e.yLength;f++){"Column"===e.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type?(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[r],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[r]):"Row"===e.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataSourceMinValue=this.heatMap.dataMin[s],this.heatMap.dataSourceMaxValue=this.heatMap.dataMax[s]),this.setTextAndColor(s,r);var S=new se(0,0,0,0,0,"",0,0,0,0,!0,"","",!0);if(l=m.color,this.heatMap.bubbleSizeWithColor?this.updateRectDetails(S,n,o,p,g,t.extend("",this.bubbleColorValue,null,!0),f,r,s):this.updateRectDetails(S,n,o,p,g,this.text,f,r,s),d.showLabel)if(t.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate)a=this.getFormatedText(this.text,d.format);else{var M=e.dataSourceSettings.bubbleDataMapping&&e.dataSourceSettings.isJsonData&&"Cell"===e.dataSourceSettings.adaptorType&&!t.isNullOrUndefined(S.value[0])?S.value[0].bubbleData:S.value;"number"==typeof M&&"#ffffff"!==this.cellColor.getColorByValue(M)&&h(this.heatMap.cellSettings.labelTemplate,e,y,S,e.axisCollections[0].axisLabels,e.axisCollections[1].axisLabels.slice().reverse(),f)}else a="";if(S.displayText=a,e.enableHtmlSanitizer&&(a=t.SanitizeHtmlHelper.sanitize(a)),t.isNullOrUndefined(this.heatMap.cellRender)||(a=this.cellRendering(S,a)),("Canvas"===e.renderingMode&&0===parseFloat(m.width.toString())||!l&&"Bubble"===d.tileType&&"Sector"===d.bubbleType)&&(l=this.color),"Rect"===d.tileType?(this.renderTileCell(S,m,f,this.color,l),this.updateLabelVisibleStatus(p,g,a)):"Color"===d.bubbleType?(this.renderBubbleCell(S,m,f,this.color,l,b),this.updateLabelVisibleStatus(2*b-12,2*b-6,a)):t.isNullOrUndefined(this.text)||"Size"!==d.bubbleType&&"SizeAndColor"!==d.bubbleType||""===this.text.toString()?"Sector"!==d.bubbleType||t.isNullOrUndefined(this.text)||""===this.text.toString()||(this.renderSectorCell(S,m,f.toString(),this.color,l,b,this.text),this.checkLabelXDisplay=!1,this.checkLabelYDisplay=!1):("Table"!==this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.minColorValue=isFinite(this.heatMap.minColorValue)?this.heatMap.minColorValue:this.heatMap.dataSourceMinValue,this.heatMap.maxColorValue=isFinite(this.heatMap.maxColorValue)?this.heatMap.maxColorValue:this.heatMap.dataSourceMaxValue),v=this.getRadiusBypercentage(parseFloat(this.text.toString()),e.dataSourceMinValue,e.dataSourceMaxValue,b),this.renderBubbleCell(S,m,f,this.color,l,v),this.updateLabelVisibleStatus(2*v-12,2*v-6,a)),u.push(S),e.rangeSelection&&"Fixed"===e.paletteSettings.type&&(i=this.isCellValueInRange(s,r),S.visible=i),d.showLabel&&this.checkLabelYDisplay&&this.checkLabelXDisplay){var w=d.textStyle,L=new ge(e.element.id+"_HeatMapRectLabels_"+f,new ce(Math.round(100*(n+p/2))/100,Math.round(100*(o+g/2))/100,"middle",a,null,null,"middle"),w,w.color||this.getSaturatedColor(this.color));if(S.textId=L.id,e.rangeSelection&&"Fixed"===e.paletteSettings.type&&(L.fill=i?L.fill:this.heatMap.themeStyle.toggledColor),t.Browser.isIE&&!e.enableCanvasRendering&&(L.dy="Bubble"===this.heatMap.cellSettings.tileType?"0.5ex":"1ex"),"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow){var T="Bubble"===d.tileType?"Size"===d.bubbleType||"SizeAndColor"===d.bubbleType?2*v-12:"Color"===d.bubbleType?2*b-12:p:p,R="Bubble"===d.tileType?"Size"===d.bubbleType||"SizeAndColor"===d.bubbleType?2*v-6:"Color"===d.bubbleType?2*b-6:g:g;L.text=x(a,T,this.heatMap.cellSettings.textStyle,!0),this.updateLabelText(R,T,L);var O=parseInt(this.heatMap.cellSettings.textStyle.size,10)*(L.text.length-1);L.y=L.text.length>1?Math.round(o+(g-O)/2):L.y,this.drawSvgCanvas.createWrapText(L,d.textStyle,this.containerTextObject)}else this.drawSvgCanvas.createText(L,this.containerTextObject,a)}c===e.xLength-1?(o=Math.round(100*(o+g))/100,c=0,r=0,n=e.yAxis.opposedPosition?Math.round(100*(e.initialClipRect.x+parseFloat(m.width.toString())/2))/100:Math.round(100*e.initialClipRect.x)/100,this.rectPositionCollection.push(u),u=[],s++):(n=Math.round(100*(n+p))/100,c++,r++)}t.isNullOrUndefined(y)||document.getElementById(this.heatMap.element.id+"_Secondary_Element").appendChild(y),e.enableCanvasRendering||(e.svgObject.appendChild(this.containerRectObject),!d.showLabel||"Bubble"===d.tileType&&"Sector"===d.bubbleType||e.svgObject.appendChild(this.containerTextObject))},e.prototype.isCellValueInRange=function(e,i){for(var l=!1,a=0;a<this.heatMap.toggleValue.length;a++){var n=void 0,o=0!==a||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[a].startValue:this.heatMap.toggleValue[a].value:this.heatMap.dataSourceMinValue;n="Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?a===this.heatMap.toggleValue.length-1?this.heatMap.maxColorValue:this.heatMap.toggleValue[a+1].value-.01:a!==this.heatMap.toggleValue.length-1||this.heatMap.isColorRange?this.heatMap.isColorRange?this.heatMap.toggleValue[a].endValue:this.heatMap.toggleValue[a+1].value-.01:this.heatMap.dataSourceMaxValue;var s=this.heatMap.clonedDataSource,r=t.isNullOrUndefined(s[e][i][1])||""===s[e][i][1].toString()?"":s[e][i][1],h=parseFloat("Bubble"===this.heatMap.cellSettings.tileType&&"SizeAndColor"===this.heatMap.cellSettings.bubbleType?r.toString():this.text.toString());if(isNaN(h))l=!0;else{if(!isNaN(h)&&h>=o&&h<=n){if(this.heatMap.toggleValue[a].visible){l=!0;break}l=!1;break}if(this.heatMap.isColorRange&&n>=this.heatMap.toggleValue[a].endValue&&a===this.heatMap.toggleValue.length-1){l=!0;break}}}return l},e.prototype.cellRendering=function(e,t){var i=this.heatMap.axisCollections[0],l=this.heatMap.axisCollections[1],a=i.tooltipLabels,n=l.tooltipLabels.slice().reverse(),o=l.labelValue.slice().reverse(),s={heatmap:this.heatMap,cancel:!1,name:"cellRender",value:e.value,xLabel:a[e.xIndex].toString(),yLabel:n[e.yIndex].toString(),displayText:t,xValue:i.labelValue[e.xIndex],yValue:o[e.yIndex],cellColor:this.color};return this.heatMap.trigger("cellRender",s),this.color=s.cellColor,s.displayText},e.prototype.setTextAndColor=function(e,i){this.bubbleColorValue=[];var l=this.heatMap.dataSourceSettings,a=this.heatMap.clonedDataSource;if(this.heatMap.bubbleSizeWithColor){this.text=t.isNullOrUndefined(a[e][i][0])||""===a[e][i][0].toString()?"":a[e][i][0],this.color=t.isNullOrUndefined(a[e][i][1])||""===a[e][i][1].toString()?this.heatMap.isColorValueExist?this.heatMap.emptyPointColor:this.cellColor.getColorByValue(this.text):this.cellColor.getColorByValue(a[e][i][1]);var n=new J(l.isJsonData&&"Cell"===l.adaptorType?l.bubbleDataMapping.size:null,this.text,"Size");this.bubbleColorValue.push(n),this.bubbleColorValue.push({mappingName:l.isJsonData&&"Cell"===l.adaptorType?l.bubbleDataMapping.color:null,bubbleData:t.isNullOrUndefined(a[e][i][1])||""===a[e][i][1].toString()?"":a[e][i][1],valueType:"Color"})}else this.text=a[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"}),!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,a,n,o,s,r){e.x=t,e.y=i,e.width=l,e.height=a,e.value=n,e.id=this.heatMap.element.id+"_HeatMapRect_"+o,e.xIndex=s,e.yIndex=r},e.prototype.renderTileCell=function(e,t,i,l,a){var n=new he(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,new pe(e.x,e.y,e.width,e.height),a||this.heatMap.themeStyle.cellBorder,t.radius,t.radius);this.drawSvgCanvas.drawRectangle(n,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,a,n,o){for(var s,r,h,d,p,g,c,u,m,y,v=Math.round(100*(e.x+e.width/2))/100,x=Math.round(100*(e.y+e.height/2))/100,b=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*(v+n*Math.cos((f-90)*(Math.PI/180))))/100,p=Math.round(100*(x+n*Math.sin((f-90)*(Math.PI/180))))/100,g=Math.round(100*v)/100,c=Math.round(100*(x-n))/100,0===f&&(b=this.heatMap.emptyPointColor)):(s=f>=180?0:1,r=h,h=270,b=this.heatMap.emptyPointColor,i+="_Unfilled",u=d,m=p,d=g,p=c,g=u,c=m,0===f&&(y=1,a=l));var C=new ve("",!1,v,x,g,c,d,p,r,h,n,!0),M=new ye(this.heatMap.element.id+"_HeatMapRect_"+i,C,b,t,y,1,a);if(this.calculateShapes(M,C,f,s),this.drawSvgCanvas.drawPath(M,C,this.containerRectObject),360===f)break}},e.prototype.calculateShapes=function(e,i,l,a){var n;switch(l){case 360:case 0:n=0===l&&i.start===i.end?"M "+e.x+" "+e.y+" L "+i.x+" "+(i.y-i.radius):(n=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:n});break;default:n="M "+e.x+" "+e.y+" L "+i.x1+" "+i.y1+" A "+i.radius+" "+i.radius+" 0 "+a+" 1 "+i.cx+" "+i.cy+" Z",t.merge(e,{d:n})}},e.prototype.renderBubbleCell=function(e,t,i,l,a,n){var o=new de(this.heatMap.element.id+"_HeatMapRect_"+i,l,t,1,a||this.heatMap.themeStyle.cellBorder,Math.round(100*(e.x+e.width/2))/100,Math.round(100*(e.y+e.height/2))/100,n);this.drawSvgCanvas.drawCircle(o,this.containerRectObject)},e.prototype.updateLabelText=function(e,t,i){for(var l=0;l<i.text.length;l++)if(e<parseInt(this.heatMap.cellSettings.textStyle.size,10)*(l+1)+10){if(i.text=i.text.slice(0,l),l>0&&"..."!==i.text[l-1].slice(-3)){var a=i.text.slice(0,l-1),n=b(t,i.text[l-1]+"...",this.heatMap.cellSettings.textStyle);a.push(n),i.text=a;break}break}},e.prototype.updateLabelVisibleStatus=function(e,i,l){this.heatMap.cellSettings.showLabel&&(t.isNullOrUndefined(this.heatMap.cellSettings.labelTemplate)||""===this.heatMap.cellSettings.labelTemplate)&&(this.checkLabelYDisplay=i>parseInt(this.heatMap.cellSettings.textStyle.size,10),this.checkLabelXDisplay=e>l.length*(parseInt(this.heatMap.cellSettings.textStyle.size,10)/2)||"Wrap"===this.heatMap.cellSettings.textStyle.textOverflow)},e.prototype.getRadiusBypercentage=function(e,t,i,l){var a=parseInt(this.heatMap.cellSettings.bubbleSize.minimum,10),n=parseInt(this.heatMap.cellSettings.bubbleSize.maximum,10);(a<0||a>100||isNaN(a))&&(a=0),(n<0||n>100||isNaN(n))&&(n=100);var o=(e-t)/(i-t)*100;return o=isNaN(o)?100:o,(this.heatMap.bubbleSizeWithColor||"Bubble"===this.heatMap.cellSettings.tileType&&"Size"===this.heatMap.cellSettings.bubbleType)&&(this.heatMap.cellSettings.isInversedBubbleSize&&(o=100-o),o=o*(n-a)/100+a),l*=o/100,Math.round(100*l)/100<0?0:Math.round(100*l)/100},e.prototype.getSaturatedColor=function(e){var t=e,i=P(R(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=void 0;this.heatMap.tempRectHoverClass&&(l=document.getElementById(this.heatMap.tempRectHoverClass)),l&&!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=void 0;this.heatMap.tempRectHoverClass&&(l=document.getElementById(this.heatMap.tempRectHoverClass)),l&&!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 a="";return""!==e.toString()&&(a=D(l,i,e,this.format)),a},e.prototype.getCurrentRect=function(e,t){var i,l=[];l.push(this.heatMap.heatMapSeries.rectPositionCollection[0][0]);var a=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,n=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 a=0===a?1:a,i=this.heatMap.heatMapSeries.rectPositionCollection[n][a-1],this.hoverXAxisLabel=this.heatMap.axisCollections[0].tooltipLabels[a-1],this.hoverXAxisValue=this.heatMap.axisCollections[0].labelValue[a-1],this.hoverYAxisLabel=this.heatMap.axisCollections[1].tooltipLabels[this.heatMap.axisCollections[1].tooltipLabels.length-1-n],this.hoverYAxisValue=this.heatMap.axisCollections[1].labelValue[this.heatMap.axisCollections[1].labelValue.length-1-n],i},e.prototype.destroy=function(){t.isNullOrUndefined(this.cellColor)||this.cellColor.destroy(),this.cellColor=null,this.bubbleColorValue=null,this.containerRectObject=null,this.containerTextObject=null,this.drawSvgCanvas=null,this.format=null,this.hoverXAxisValue=null,this.hoverYAxisValue=null,this.rectPositionCollection=null,this.heatMap=null},e}(),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)}}(),_e=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ee(i,e),_e([t.Property("")],i.prototype,"template",void 0),_e([t.Property("")],i.prototype,"fill",void 0),_e([t.Complex({},B)],i.prototype,"border",void 0),_e([t.Complex(A.tooltipFont,V)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Ne=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,i){if(!t.isNullOrUndefined(this.heatMap)){var l=document.getElementById(this.heatMap.element.id+"Celltooltipcontainer");e?l.style.visibility="visible":(t.isNullOrUndefined(l)||"hidden"===l.style.visibility||(!t.isNullOrUndefined(this.tooltipObject)&&i&&this.heatMap.isRectBoundary?this.tooltipObject.fadeOut():t.isNullOrUndefined(this.tooltipObject)||t.isNullOrUndefined(this.tooltipObject.element)||this.tooltipObject.element.firstChild.setAttribute("opacity","0"),l.style.visibility="hidden"),this.isFadeout=!0)}},e.prototype.destroy=function(){t.isNullOrUndefined(this.tooltipObject)||(this.tooltipObject.destroy(),this.tooltipObject.controlInstance=null,C(this.heatMap.element.id+"Celltooltipcontainer")),this.tooltipObject=null,this.heatMap=null},e.prototype.createTooltip=function(e,l,a,n){var o=null,s=t.select("#"+this.heatMap.element.id+"Celltooltipcontainer");this.heatMap.cellSettings.showLabel&&this.heatMap.heatMapSeries.checkLabelXDisplay&&this.heatMap.heatMapSeries.checkLabelYDisplay&&(o=parseInt(this.heatMap.cellSettings.textStyle.size,10)/2),"Tailwind"!==this.heatMap.theme&&"Tailwind3"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}}},!0),"TailwindDark"!==this.heatMap.theme&&"Tailwind3Dark"!==this.heatMap.theme||this.heatMap.setProperties({tooltipSettings:{fill:"#F9FAFB",textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500",color:"#1F2937"}}},!0),"Bootstrap5"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Bootstrap5Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#212529"}}},!0),"Fluent"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}}},!0),"FluentDark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#252423",textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500",color:"#F3F2F1"}}},!0),"Material3"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#313033",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#F4EFF4"}}},!0),"Material3Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#E6E1E5",textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"400",color:"#313033"}}},!0),"Fluent2"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#FFFFFF",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#242424"}}},!0),"Fluent2Dark"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#292929",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"}}},!0),"Fluent2HighContrast"===this.heatMap.theme&&this.heatMap.setProperties({tooltipSettings:{fill:"#000000",textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400",color:"#FFFFFF"},border:{width:1,color:"#FFF"}}},!0),this.tooltipObject=new i.Tooltip({opacity:"Tailwind"===this.heatMap.theme||"Tailwind3"===this.heatMap.theme||"TailwindDark"===this.heatMap.theme||"Tailwind3Dark"===this.heatMap.theme||"Bootstrap5"===this.heatMap.theme||"Bootstrap5Dark"===this.heatMap.theme||"Fluent"===this.heatMap.theme||"FluentDark"===this.heatMap.theme||"Fluent2"===this.heatMap.theme||"Fluent2Dark"===this.heatMap.theme||"Fluent2HighContrast"===this.heatMap.theme?1:.75,enableAnimation:!1,offset:o,location:{x:l,y:a},availableSize:this.heatMap.availableSize,data:{xValue:this.heatMap.heatMapSeries.hoverXAxisValue,yValue:this.heatMap.heatMapSeries.hoverYAxisValue,value:e.value,xLabel:this.heatMap.heatMapSeries.hoverXAxisLabel?this.heatMap.heatMapSeries.hoverXAxisLabel.toString():null,yLabel:this.heatMap.heatMapSeries.hoverYAxisLabel?this.heatMap.heatMapSeries.hoverYAxisLabel.toString():null},theme:this.heatMap.theme,content:n,fill:this.heatMap.tooltipSettings.fill,enableShadow:!0,template:""===this.heatMap.tooltipSettings.template?null:this.heatMap.tooltipSettings.template,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.toLowerCase(),color:this.heatMap.tooltipSettings.textStyle.color,fontStyle:this.heatMap.tooltipSettings.textStyle.fontStyle.toLowerCase(),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}},s)},e.prototype.createTooltipDiv=function(e){var i=e.enableCanvasRendering&&e.allowSelection?e.availableSize.height:0,l=t.createElement("div",{id:this.heatMap.element.id+"Celltooltipcontainer"});l.style.cssText="position:absolute; z-index: 3;top:-"+i+"px";var a=t.createElement("div",{id:this.heatMap.element.id+"Celltooltipparent"});a.style.position="relative",a.appendChild(l),this.heatMap.element.appendChild(a)},e.prototype.getTooltipContent=function(e,t){var i,l,a=this.heatMap,n=this.heatMap.dataSourceSettings;if(a.bubbleSizeWithColor){var o=a.xAxis.title&&""!==a.xAxis.title.text?a.xAxis.title.text:"X-Axis",s=a.yAxis.title&&""!==a.yAxis.title.text?a.yAxis.title.text:"Y-Axis",r=n.isJsonData&&"Cell"===n.adaptorType?n.bubbleDataMapping.size:"Value 1",h=n.isJsonData&&"Cell"===n.adaptorType?n.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=y(l,this.heatMap.enableHtmlSanitizer)},e.prototype.renderTooltip=function(e){var i=this,l=this.heatMap.heatMapSeries,a=[""];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))a=this.getTooltipContent(e,l),this.tooltipCallback(e,a);else{var n=this.getTooltipContent(e,l),o={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};this.heatMap.trigger("tooltipRender",o,function(t){t.cancel?i.tooltipObject&&i.showHideTooltip(!1):(a=t.content,i.tooltipCallback(e,a))})}else this.showHideTooltip(!1,!1),e.visible||this.showHideTooltip(!1,!1)},e.prototype.tooltipCallback=function(e,t){this.tooltipObject?(this.tooltipObject.content=t,this.tooltipObject.data={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,value:e.value}):this.createTooltip(e,e.x+e.width/2,e.y+e.height/2,t),(this.heatMap.isVue||this.heatMap.isVue3)&&(this.tooltipObject.controlInstance=this.heatMap),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,e.visible||this.showHideTooltip(!1,!1)},e}(),He=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,a,n,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,g=[];this.tempSizeArray=[],this.tempColorArray=[],this.heatMap.minColorValue=null,this.heatMap.maxColorValue=null,this.heatMap.dataMax=[],this.heatMap.dataMin=[],"Column"===this.heatMap.paletteSettings.colorGradientMode&&h<d&&(h=d);for(var c="Category"===o[1].valueType?o[1].min:0;c<("Column"===this.heatMap.paletteSettings.colorGradientMode?h:d);c++){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,c,p),u++;if("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type){n=t.extend([],i[p],null,!0);for(var m=0;m<n.length;m++)"object"==typeof n[m]&&null!==n[m]&&(n[m]=n[m][0])}else n=t.extend([],this.completeDataSource[p],null,!0);var y=this.getMinMaxValue(l,a,n);"Column"!==this.heatMap.paletteSettings.colorGradientMode&&"Row"!==this.heatMap.paletteSettings.colorGradientMode||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax[c]=y[1],this.heatMap.dataMin[c]=y[0]),l=y[0],a=y[1],this.heatMap.xAxis.isInversed&&(this.completeDataSource[p]=this.completeDataSource[p].reverse()),c>=this.heatMap.axisCollections[1].min&&c<=this.heatMap.axisCollections[1].max&&g.push(this.completeDataSource[p]),p++}"Row"!==this.heatMap.paletteSettings.colorGradientMode||this.heatMap.yAxis.isInversed||"Gradient"!==this.heatMap.paletteSettings.type||(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),"Column"===this.heatMap.paletteSettings.colorGradientMode&&this.heatMap.xAxis.isInversed&&"Gradient"===this.heatMap.paletteSettings.type&&(this.heatMap.dataMax=this.heatMap.dataMax.reverse(),this.heatMap.dataMin=this.heatMap.dataMin.reverse()),this.heatMap.yAxis.isInversed||(this.completeDataSource.reverse(),g.reverse()),this.heatMap.clonedDataSource=g,this.heatMap.dataSourceMinValue=t.isNullOrUndefined(l)?0:parseFloat(l.toString()),this.heatMap.dataSourceMaxValue=t.isNullOrUndefined(a)?0:parseFloat(a.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,a){if(this.heatMap.bubbleSizeWithColor)if(e[i]&&!t.isNullOrUndefined(e[i][l])&&"object"==typeof e[i][l]){for(var n=e[i][l],o=0;o<n.length;o++)if((t.isNullOrUndefined(n[o])||isNaN(n[o]))&&(n[o]=""),0===o)this.tempSizeArray.push(n[o]);else if(1===o){this.tempColorArray.push(n[o]);break}this.completeDataSource[a].push(n)}else!t.isNullOrUndefined(e[i])&&(e[i][l]||0===e[i][l]&&""!==e[i][l].toString())?(this.completeDataSource[a].push([e[i][l]]),this.tempSizeArray.push(e[i][l])):this.completeDataSource[a].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[a].push(e[i][l][0]):this.completeDataSource[a].push(""):this.completeDataSource[a].push(e[i][l]):this.completeDataSource[a].push("")},e.prototype.getMinMaxValue=function(e,t,i){var l=[];return this.heatMap.bubbleSizeWithColor?("Column"===this.heatMap.paletteSettings.colorGradientMode&&"Gradient"===this.heatMap.paletteSettings.type&&(this.tempSizeArray=i),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):"Row"!==this.heatMap.paletteSettings.colorGradientMode&&"Column"!==this.heatMap.paletteSettings.colorGradientMode||"Gradient"!==this.heatMap.paletteSettings.type||(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):"Row"!==this.heatMap.paletteSettings.colorGradientMode&&"Column"!==this.heatMap.paletteSettings.colorGradientMode||"Gradient"!==this.heatMap.paletteSettings.type||(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.prototype.destroy=function(){this.completeDataSource=null,this.tempColorArray=null,this.tempSizeArray=null,this.heatMap=null},e}(),ke=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)}}(),Ge=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ke(i,e),Ge([t.Property("")],i.prototype,"height",void 0),Ge([t.Property("")],i.prototype,"width",void 0),Ge([t.Complex({text:"",textStyle:A.titleFont},H)],i.prototype,"title",void 0),Ge([t.Property("Right")],i.prototype,"position",void 0),Ge([t.Property(!0)],i.prototype,"visible",void 0),Ge([t.Property("Center")],i.prototype,"alignment",void 0),Ge([t.Property(!0)],i.prototype,"showLabel",void 0),Ge([t.Property(!0)],i.prototype,"showGradientPointer",void 0),Ge([t.Property(!1)],i.prototype,"enableSmartLegend",void 0),Ge([t.Property("All")],i.prototype,"labelDisplayType",void 0),Ge([t.Complex(A.legendLabelFont,V)],i.prototype,"textStyle",void 0),Ge([t.Property("")],i.prototype,"labelFormat",void 0),Ge([t.Property(!0)],i.prototype,"toggleVisibility",void 0),i}(t.ChildProperty),We=function(){function e(e){this.maxLegendLabelSize=new ae(0,0),this.gradientScaleSize=10,this.segmentCollections=[],this.segmentCollectionsLabels=[],this.textWrapCollections=[],this.labelCollections=[],this.labelCollection=[],this.legendSize=10,this.previousOptions=new Me(0,0,0,0,0,0),this.listPerPage=0,this.numberOfPages=1,this.listWidth=0,this.fillRect=new pe(0,0,0,0),this.legendRect=new pe(0,0,0,0),this.currentPage=1,this.lastList=[],this.navigationCollections=[],this.pagingRect=new pe(0,0,0,0),this.listInterval=10,this.legendLabelTooltip=[],this.legendTitleTooltip=[],this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],this.legendRectPositionCollection=[],this.legendRange=[],this.legendTextRange=[],this.visibilityCollections=[],this.heatMap=e,this.drawSvgCanvas=new xe(e)}return e.prototype.getModuleName=function(){return"Legend"},e.prototype.destroy=function(){t.isNullOrUndefined(this.tooltipObject)||this.tooltipObject.destroy(),this.tooltipObject=null,this.drawSvgCanvas=null,this.format=null,this.gradientPointer=null,this.labelCollection=null,this.labelCollections=null,this.lastList=null,this.legend=null,this.legendGroup=null,this.legendRect=null,this.legendRectPositionCollection=null,this.legendRectScale=null,this.legendScale=null,this.legendXCollections=null,this.legendYCollections=null,this.maxLegendLabelSize=null,this.navigationCollections=null,this.pagingRect=null,this.paginggroup=null,this.segmentCollections=null,this.segmentCollectionsLabels=null,this.textWrapCollections=null,this.translategroup=null,this.visibilityCollections=null,this.fillRect=null,this.legendLabelTooltip=null,this.legendRange=[],this.legendTextRange=[],this.legendTitleTooltip=null,this.previousOptions=null,this.heatMap=null},e.prototype.renderLegendItems=function(){var e=this.heatMap;e.toggleValue=[];var i={color:"transparent",width:0};this.legend=e.renderer.createGroup({id:e.element.id+"_Heatmap_Legend"});var l=new he(e.element.id+"_LegendBound","none",i,1,this.legendGroup);this.drawSvgCanvas.drawRectangle(l,this.legend);var a,n=this.legendRectScale,o=e.canvasRenderer.ctx,s=new pe(n.x,n.y,n.width,n.height);if("Fixed"===e.paletteSettings.type){var r=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.enableCanvasRendering&&(o.save(),o.clip());for(y=0;y<r.length;y++){var h=!!t.isNullOrUndefined(this.visibilityCollections[y])||this.visibilityCollections[y];e.toggleValue.push(new Te(h,r[y].value,r[y].startValue,r[y].endValue))}}if("Gradient"===e.paletteSettings.type||"Fixed"===e.paletteSettings.type&&!0===e.legendSettings.enableSmartLegend){if("Gradient"===e.paletteSettings.type){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),e.legendSettings.title.text&&p.clip();for(y=0;y<e.legendColorCollection.length;y++){var g=((this.heatMap.isColorRange?e.legendColorCollection[y].startValue:e.legendColorCollection[y].value)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);g=isNaN(g)?0:g,this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type?this.calculateCanvasColorRange(y,d):d.addColorStop(g,e.legendColorCollection[y].color)}p.fillStyle=d,a=d.toString()}else{for(var c=void 0,u=void 0,m=[],y=0;y<e.legendColorCollection.length;y++){if(this.heatMap.isColorRange&&"Gradient"===this.heatMap.paletteSettings.type)this.calculateColorRange(y,m);else{var v=(e.legendColorCollection[y].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100;v=isNaN(v)?0:v,u=new fe(e.legendColorCollection[y].color,v+"%"),m.push(u)}if(this.legendMaxValue===this.legendMinValue)break}c=e.horizontalGradient?new be(e.element.id+"_lineargradient","0%","100%","0%","0%"):new be(e.element.id+"_lineargradient","0%","0%","0%","100%");var x=e.renderer.drawGradient("linearGradient",c,m);this.legend.appendChild(x),a="url(#"+e.element.id+"_lineargradient)"}var b=new he(e.element.id+"_Gradient_Legend",a,i,1,s);this.drawSvgCanvas.drawRectangle(b,this.legend),this.renderElements(s)}else this.renderSmartLegend(),this.renderTitle(s);e.enableCanvasRendering||e.svgObject.appendChild(this.legend),e.enableCanvasRendering&&o.restore(),this.renderLegendLabel(s)}else{this.legendScale=e.renderer.createGroup({id:e.element.id+"Heatmap_GradientScale"});var f=new he(e.element.id+"_Gradient_Scale","none",i,1,this.legendRectScale);this.drawSvgCanvas.drawRectangle(f,this.legendScale),this.renderTitle(s),e.enableCanvasRendering||this.legend.appendChild(this.legendScale),this.translategroup=e.renderer.createGroup({id:e.element.id+"_translate"}),this.calculateListPerPage(s),this.numberOfPages>1&&(this.paginggroup=e.renderer.createGroup({id:e.element.id+"_navigation"})),this.renderListLegendMode(s,!0),e.enableCanvasRendering&&o.restore()}},e.prototype.renderElements=function(e){this.renderTitle(e),this.renderColorAxisGrid(e)},e.prototype.calculateCanvasColorRange=function(e,t){var i=this.heatMap,l=((i.legendColorCollection[e].startValue<i.dataSourceMinValue&&i.legendColorCollection[e].endValue>i.dataSourceMinValue?i.dataSourceMinValue:i.legendColorCollection[e].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);l=isNaN(l)?0:l;var a=((i.legendColorCollection[e].endValue>=this.heatMap.dataSourceMaxValue?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue);this.heatMap.legendColorCollection[0].startValue!==this.heatMap.dataSourceMinValue&&0===e&&this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&(l=(this.heatMap.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l/2,this.heatMap.paletteSettings.fillColor.minColor),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.maxColor)),t.addColorStop(l,i.legendColorCollection[e].minColor),t.addColorStop(a,i.legendColorCollection[e].maxColor),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&this.heatMap.legendColorCollection[e].endValue<this.heatMap.dataSourceMaxValue&&(l=(i.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.minColor),l=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue),t.addColorStop(l,this.heatMap.paletteSettings.fillColor.maxColor))},e.prototype.calculateColorRange=function(e,t){void 0===t&&(t=[]);var i=this.heatMap;i.toggleValue=[];var l,a,n,o;this.heatMap.legendColorCollection[0].startValue>this.heatMap.dataSourceMinValue&&0===e&&(l=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,l=isNaN(l)?0:l,a=new fe(i.paletteSettings.fillColor.minColor,l+"%"),t.push(a),l=(i.legendColorCollection[0].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,a=new fe(i.paletteSettings.fillColor.maxColor,l+"%"),t.push(a)),l=(i.legendColorCollection[e].startValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,l=isNaN(l)?0:l,a=new fe(i.legendColorCollection[e].minColor,l+"%"),t.push(a),l=(i.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100;var s=new fe(i.legendColorCollection[e].maxColor,l+"%");t.push(s),this.heatMap.legendColorCollection[e].endValue!==(e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:this.heatMap.legendColorCollection[e+1].startValue)&&(l=(i.legendColorCollection[e].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,n=new fe(this.heatMap.paletteSettings.fillColor.minColor,l+"%"),t.push(n),l=((e===this.heatMap.legendColorCollection.length-1?this.heatMap.dataSourceMaxValue:i.legendColorCollection[e+1].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,o=new fe(this.heatMap.paletteSettings.fillColor.maxColor,l+"%"),t.push(o))},e.prototype.renderTitle=function(e){var i=this.heatMap;if(i.legendSettings.title.text){var l=i.legendSettings.title,a=this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.text):l.text,n=s(a,l.textStyle),o=i.legendSettings.showLabel?this.labelPadding:i.horizontalGradient?10:6,r=void 0,h="start",d=void 0,p=l.textStyle.textAlignment,g=void 0,c=void 0;if("Trim"===i.legendSettings.title.textStyle.textOverflow&&(a=b(d=i.horizontalGradient?e.width-10:this.width-10,a,l.textStyle)),i.horizontalGradient){r=e.y+("Top"===i.legendSettings.position?0:-(10+n.height+o)),o="Top"===i.legendSettings.position?-(o+n.height/4):o+3*n.height/4,c="Bottom"===i.legendSettings.position?r:r-n.height,0!==a.length&&i.enableCanvasRendering&&this.legendTitleTooltip.push(new Se(l.text,new pe(e.x,c,d,n.height))),n.width=e.width<n.width?e.width:n.width;var u=e.x;u=-1!==a.indexOf("...")&&"Far"===p?u+e.width/2-n.width/2:"Near"===p?u:"Far"===p?e.width+u:u+e.width/2-n.width/2,h="Far"===p&&-1===a.indexOf("...")?"end":"start",g=new ge(i.element.id+"_legendTitle",new ce(u,r+o,h,a,0,"translate(0,0)",void 0),l.textStyle,l.textStyle.color||i.themeStyle.heatMapTitle)}else o=-(o+n.height/4),0!==a.length&&i.enableCanvasRendering&&this.legendTitleTooltip.push(new Se(l.text,new pe(e.x,e.y-n.height,d,n.height))),g=new ge(i.element.id+"_legendTitle",new ce(e.x,e.y+o,h,a,0,"translate(0,0)",void 0),l.textStyle,l.textStyle.color||i.themeStyle.heatMapTitle);this.drawSvgCanvas.createText(g,this.legend,a)}},e.prototype.renderSmartLegend=function(){var e,i,l,a,n,o=this.heatMap,r=o.colorCollection,h={color:"transparent",width:0},d=this.legendRectScale,p=d.width/r.length,g=d.height/r.length;this.legendRectPositionCollection=[],this.legendRange=[];for(var c=0;c<o.legendColorCollection.length;c++){var u=new we(0,0,0,0,"","");o.horizontalGradient?(i=d.x+c*p,l=d.y,a=p,n=d.height,this.segmentCollections.push("Edge"!==o.legendSettings.labelDisplayType||c!==o.legendColorCollection.length-1||o.legendColorCollection[c].isHidden?i:i+p)):(i=d.x,l=d.y+c*g,a=d.width,n=g,this.segmentCollections.push("Edge"!==o.legendSettings.labelDisplayType||c!==o.legendColorCollection.length-1||o.legendColorCollection[c].isHidden?l:l+g));var y=this.heatMap.renderer.createGroup({id:o.element.id+"_Smart_Legend_Group_"+c}),v=this.heatMap.legendSettings.toggleVisibility?0:-1;y.setAttribute("tabindex",v.toString()),y.style.outline="none",e=new pe(i,l,a,n);var x=new Le(0,0,0,0,0,!0,0);if(x.x=i,x.y=l,x.width=a,x.height=n,x.value=this.heatMap.isColorRange?o.legendColorCollection[c].endValue:o.legendColorCollection[c].value,x.currentPage=this.currentPage,r.length!==o.legendColorCollection.length&&c===o.legendColorCollection.length-1&&(o.horizontalGradient?x.width=0:x.height=0,this.visibilityCollections[c]=this.visibilityCollections[c-1]),x.visible=!!t.isNullOrUndefined(this.visibilityCollections[c])||this.visibilityCollections[c],this.legendRange.push(x),!o.legendColorCollection[c].isHidden){var b=o.legendOnLoad?this.heatMap.isColorRange?r[c].minColor:r[c].color:this.legendRange[c].visible?this.heatMap.isColorRange?r[c].minColor:r[c].color:this.heatMap.themeStyle.toggledColor||"#D3D3D3",f=new he(o.element.id+"_Smart_Legend"+c,b,h,1,e);if(this.drawSvgCanvas.drawRectangle(f,y),this.legend.appendChild(y),u.x=i,u.y=l,u.width=a,u.height=n,u.label=this.labelCollections[c],u.id=o.element.id+"_Smart_Legend"+c,this.legendRectPositionCollection.push(u),0!==m(this.labelCollections[c],o.legendSettings.textStyle,this.textWrapCollections[c]).length&&o.enableCanvasRendering){var S=s(this.labelCollections[c],o.legendSettings.textStyle);this.legendLabelTooltip.push(new Se(this.labelCollections[c],new pe(u.x,u.y,S.width,S.height)))}}}},e.prototype.colorRangeLegendPosition=function(e,t){if(this.segmentCollections.length!==this.segmentCollectionsLabels.length){for(var i=0;i<this.segmentCollections.length;i++)if(this.segmentCollectionsLabels[e]===this.segmentCollections[i]){t=this.segmentCollectionsLabels[e]+((i===this.segmentCollections.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollections[i+1])-this.segmentCollections[i])/2;break}}else t=this.segmentCollectionsLabels[e]+((e===this.segmentCollectionsLabels.length-1?this.heatMap.horizontalGradient?this.width:this.height:this.segmentCollectionsLabels[e+1])-this.segmentCollectionsLabels[e])/2;this.labelPosition=t},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="start",a=void 0,n=void 0,o=0,r=void 0;this.legendLabelTooltip=[];var h=void 0,d=i.isColorRange,p=i.legendColorCollection;if(i.enableCanvasRendering){var g=i.canvasRenderer.ctx;g.rect(this.legendGroup.x,this.legendGroup.y,this.legendGroup.width,this.legendGroup.height),g.save(),g.clip(),g.restore()}else n=i.renderer.createGroup({id:i.element.id+"_Heatmap_LegendLabel"});for(var c=void 0,u=void 0,v=0;v<p.length;v++){var x=(p[v].value-Math.round(100*this.legendMinValue)/100)/(Math.round(100*this.legendMaxValue)/100-Math.round(100*this.legendMinValue)/100)*100,b=p[v].isHidden?v-1:v,f=this.legend.querySelector("#"+i.element.id+"_Smart_Legend_Group_"+b);if(i.horizontalGradient?(this.heatMap.isColorRange&&"Gradient"===i.paletteSettings.type?(this.colorRangeLegendPosition(v,c),c=this.labelPosition):c=this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===i.paletteSettings.type?this.segmentCollections[v]+e.width/p.length/2:this.segmentCollections[v],u=e.y+e.height+this.labelPadding,l=Math.round(100*x)/100==0&&!d||"Fixed"===i.paletteSettings.type&&0===v?"start":Math.round(100*x)/100==100&&"Gradient"===i.paletteSettings.type&&!d||Math.round(100*i.dataSourceMaxValue)/100===p[v].value&&i.legendSettings.enableSmartLegend||i.legendSettings.enableSmartLegend&&"Fixed"===i.paletteSettings.type&&"Edge"===i.legendSettings.labelDisplayType?"end":"middle",a="hanging"):(c=e.x+e.width+this.labelPadding,this.heatMap.isColorRange&&"Gradient"===i.paletteSettings.type?(this.colorRangeLegendPosition(v,u),u=this.labelPosition):u=this.heatMap.legendSettings.enableSmartLegend&&this.heatMap.isColorRange&&"Fixed"===i.paletteSettings.type?this.segmentCollections[v]+e.height/p.length/2:this.segmentCollections[v],a=Math.round(100*x)/100==0&&!d||0===v&&"Fixed"===i.paletteSettings.type?"hanging":Math.round(100*x)/100==100&&!d&&"Gradient"===i.paletteSettings.type||Math.round(100*i.dataSourceMaxValue)/100===p[v].value&&i.legendSettings.enableSmartLegend||i.legendSettings.enableSmartLegend&&"Edge"===i.legendSettings.labelDisplayType&&"Fixed"===i.paletteSettings.type?"auto":"middle"),o=i.horizontalGradient?"None"===i.legendSettings.textStyle.textOverflow?this.segmentCollections[v]:this.textWrapCollections[v]:this.width-(this.legendRectScale.width+this.labelPadding+this.legendRectPadding),r=m(this.labelCollections[v],i.legendSettings.textStyle,o),h=s(r[0],i.legendSettings.textStyle),"Fixed"===i.paletteSettings.type){var S="hanging"===a?u:"middle"===a?u-h.height/2:u-h.height,C="end"===l?c-h.width:"middle"===l?c-h.width/2:c,M=new Le(C,S,h.width,h.height,p[v].value,!0,this.currentPage);M.visible=!!t.isNullOrUndefined(this.visibilityCollections[v])||this.visibilityCollections[v],this.legendTextRange.push(M)}if(""!==this.labelCollections[v]){0!==r.length&&-1!==r[0].indexOf("...")&&i.enableCanvasRendering&&this.legendLabelTooltip.push(new Se(this.labelCollections[v],new pe(c,u,h.width,h.height))),r=y(r,this.heatMap.enableHtmlSanitizer);var w=new ce(c,u,l,r,0,"translate(0,0)",a),L=new ge(i.element.id+"_Legend_Label"+v,w,i.legendSettings.textStyle,i.legendSettings.textStyle.color||i.themeStyle.legendLabel);L.fill=i.legendOnLoad?L.fill:"Fixed"!==i.paletteSettings.type||this.legendRange[v].visible?L.fill:"#D3D3D3";var T="Fixed"===i.paletteSettings.type?f:n;r.length>1?this.drawSvgCanvas.createWrapText(L,i.legendSettings.textStyle,n):this.drawSvgCanvas.createText(L,T,r[0]),t.Browser.isIE&&!i.enableCanvasRendering&&("middle"===a?T.lastChild.setAttribute("dy","0.6ex"):"hanging"===a&&T.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,"Gradient"===i.paletteSettings.type&&this.legend.appendChild(n);var R=i.renderer.createClipPath({id:i.element.id+"_clipPath"}),O=i.renderer.drawRectangle(this.legendGroup);R.appendChild(O),i.svgObject.appendChild(R),this.legend.style.cssText="clip-path:url(#"+R.id+")"}}},e.prototype.renderGradientPointer=function(e,i,l){var a,n,o,s,r,h,d,p,g,c=this.heatMap,u=c.heatMapSeries.getCurrentRect(i,l),m=c.bubbleSizeWithColor?""!==u.value[0].bubbleData.toString()?this.heatMap.isColorValueExist?u.value[1].bubbleData.toString():u.value[0].bubbleData.toString():"":u.value.toString(),y=this.legendRectScale;if(""!==m.toString())if(c.horizontalGradient?(o=y.width/100*((Number(m)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,o=isNaN(o)?0:o,s=y.x+o,r=y.y+y.height,h=y.x-5+o,d=g=y.y+y.height+8,p=y.x+5+o):(o=y.height/100*((Number(m)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue))*100,o=isNaN(o)?0:o,s=y.x-1,r=y.y+o,h=p=y.x-8,d=y.y-5+o,g=y.y+5+o),a="M "+s+" "+r+" L "+h+" "+d+" L "+p+" "+g+" Z",n=new oe(c.element.id+"_Gradient_Pointer","gray",.01,"#A0A0A0",1,"0,0",a),c.enableCanvasRendering){this.removeGradientPointer();c.canvasRenderer.drawPath(n,void 0),t.isNullOrUndefined(this.previousOptions)||(this.previousOptions.pathX1=s,this.previousOptions.pathY1=r,this.previousOptions.pathX2=h,this.previousOptions.pathY2=d,this.previousOptions.pathX3=p,this.previousOptions.pathY3=g)}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;t.isNullOrUndefined(e)||(this.gradientPointer&&!e.enableCanvasRendering?this.gradientPointer.style.visibility="hidden":e.enableCanvasRendering&&(t.isNullOrUndefined(this.fillRect)||t.isNullOrUndefined(this.previousOptions)||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,t.isNullOrUndefined(this.fillRect)||e.canvasRenderer.ctx.clearRect(this.fillRect.x,this.fillRect.y,this.fillRect.width,this.fillRect.height)))},e.prototype.calculateLegendBounds=function(e){var i=this.heatMap,l=i.legendSettings;this.labelCollection=[],this.labelCollections=[];var a=i.legendColorCollection;"Bottom"!==l.position&&"Top"!==l.position&&"Right"!==l.position&&"Left"!==l.position&&(l.position="Right");var n=i.legendSettings.title,r=s(this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(n.text):n.text,n.textStyle);i.horizontalGradient="Bottom"===l.position||"Top"===l.position,this.legendRectPadding=i.horizontalGradient?i.legendSettings.title.text?r.height+16:16:10,this.labelPadding=l.showLabel?this.heatMap.horizontalGradient?10:6:0,this.legendHeight=l.height,this.legendWidth=l.width;var h=i.legendSettings.labelFormat,d=null!==h.match("{value}");if(this.format=i.intl.getNumberFormat({format:d?"":h}),"Fixed"===i.paletteSettings.type)for(p=0;p<a.length;p++){c={cancel:!1,text:g=a[p].label?a[p].label:this.heatMap.isColorRange?a[p].startValue.toString()+"-"+a[p].endValue.toString():D(d,h,a[p].value,this.format).toString(),name:"legendRender"};this.labelCollection.push(g),this.heatMap.trigger("legendRender",c),i.legendRender?i.legendSettings.enableSmartLegend&&"Edge"===i.legendSettings.labelDisplayType&&p>0&&p<a.length-1?this.labelCollections.push(""):c.cancel?this.labelCollections.push(""):this.labelCollections.push(c.text):i.legendSettings.enableSmartLegend&&"Edge"===i.legendSettings.labelDisplayType&&p>0&&p<a.length-1?this.labelCollections.push(""):this.labelCollections.push(g)}else for(var p=0;p<a.length;p++){var g=a[p].isHidden?"":a[p].label?a[p].label:this.heatMap.isColorRange?a[p].startValue.toString()+"-"+a[p].endValue.toString():D(d,h,a[p].value,this.format).toString(),c={cancel:!1,text:g,name:"legendRender"};a[p].isHidden||this.heatMap.trigger("legendRender",c),i.legendRender?c.cancel?this.labelCollections.push(""):p>0&&p<a.length-1&&"Edge"===i.legendSettings.labelDisplayType?this.labelCollections.push(""):c.cancel?this.labelCollections.push(""):this.labelCollections.push(c.text):p>0&&p<a.length-1&&"Edge"===i.legendSettings.labelDisplayType?this.labelCollections.push(""):this.labelCollections.push(g)}"Gradient"===i.paletteSettings.type||"Fixed"===i.paletteSettings.type&&i.legendSettings.enableSmartLegend?(this.maxLegendLabelSize=this.getMaxLabelSize(),i.horizontalGradient&&""===l.height?this.legendHeight=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.height).toString():!i.horizontalGradient&&""===l.width&&("None"===l.textStyle.textOverflow||"Fixed"===i.paletteSettings.type&&i.legendSettings.enableSmartLegend&&"None"===i.legendSettings.labelDisplayType)&&(this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.maxLegendLabelSize.width).toString()),this.calculateTitleBounds()):this.calculateListLegendBounds(e),this.legendHeight=this.legendHeight?this.legendHeight:i.horizontalGradient?"50":"100%",this.legendWidth=this.legendWidth?this.legendWidth:i.horizontalGradient?"100%":"Fixed"!==i.paletteSettings.type||i.legendSettings.enableSmartLegend?"50":"70",this.height=o(this.legendHeight,e.height),this.width=o(this.legendWidth,e.width),i.horizontalGradient?(this.height=("Gradient"===i.paletteSettings.type||i.legendSettings.enableSmartLegend)&&this.height<50?50:this.height,"Top"===l.position&&(e.y+=this.height),e.height-=this.height):(this.width=("Gradient"===i.paletteSettings.type||i.legendSettings.enableSmartLegend)&&this.width<50?50:this.width,"Left"===l.position&&(e.x+=this.width),e.width-=this.width)},e.prototype.calculateTitleBounds=function(){var e=this.heatMap,i=e.legendSettings.title,l=s(this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.text):i.text,i.textStyle);e.legendSettings.title.text&&("Top"!==e.legendSettings.position&&"Bottom"!==e.legendSettings.position||""!==e.legendSettings.height||(this.legendHeight=(2*this.legendRectPadding-l.height+this.legendSize+this.maxLegendLabelSize.height).toString()),""===e.legendSettings.width&&("None"===e.legendSettings.textStyle.textOverflow||"Fixed"===e.paletteSettings.type&&e.legendSettings.enableSmartLegend&&"None"===e.legendSettings.labelDisplayType)&&("Right"===e.legendSettings.position?this.legendWidth=(2*this.legendRectPadding+l.width+this.legendSize+this.maxLegendLabelSize.width).toString():"Left"===e.legendSettings.position&&(l.width=l.width>this.maxLegendLabelSize.width?l.width:this.maxLegendLabelSize.width,this.legendWidth=(2*this.legendRectPadding+l.width+this.legendSize).toString())))},e.prototype.calculateListLegendBounds=function(e){var i=this.heatMap;this.listWidth=0,this.listHeight=0,this.currentPage=1;var l=i.legendSettings.title,a=s(this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.text):l.text,l.textStyle),n=(a.height+50).toString();if(i.horizontalGradient){for(var r=0;r<i.colorCollection.length;r++){var h=0;if(i.legendSettings.showLabel){var d=this.labelCollections[r];h=s(this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d):d,i.legendSettings.textStyle).width}var p=this.legendSize+this.labelPadding+h+this.listInterval;this.listWidth+=p}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/o(this.legendWidth,e.width)),this.numberOfRows=this.numberOfRows>3?3:this.numberOfRows,this.legendHeight=(this.listWidth>e.width||this.listWidth>o(this.legendWidth,e.width))&&this.numberOfRows>3?((this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding+parseInt(i.legendSettings.textStyle.size,10)+10).toString():((this.legendSize+this.listInterval)*this.numberOfRows+this.legendRectPadding).toString())}else this.listHeight=(this.legendSize+this.listInterval)*i.colorCollection.length+this.listInterval+(i.legendSettings.title.text?a.height:0),""===this.legendHeight&&(this.legendHeight=this.listHeight>e.height?e.height.toString():this.listHeight.toString()),""===this.legendWidth&&"Trim"!==i.legendSettings.textStyle.textOverflow&&(this.maxLegendLabelSize=this.getMaxLabelSize(),this.maxLegendLabelSize.width=a.width>this.maxLegendLabelSize.width?a.width:this.maxLegendLabelSize.width,this.legendWidth=(2*this.legendRectPadding+this.legendSize+this.labelPadding+this.maxLegendLabelSize.width).toString());o(this.legendHeight,e.height)<50&&(this.legendHeight=n),o(this.legendWidth,e.width)<70&&(this.legendWidth="70")},e.prototype.getMaxLabelSize=function(){var e=this.heatMap;if(this.maxLegendLabelSize=new ae(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 i=this.maxLegendLabelSize,l=0;l<e.legendColorCollection.length;l++){var a=s(e.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.labelCollections[l]):this.labelCollections[l],e.legendSettings.textStyle);i.width=i.width>a.width?i.width:a.width,i.height=i.height>a.height?i.height:a.height}return i},e.prototype.calculateLegendSize=function(e,t){var i,l,a,n=this.heatMap,r=n.legendSettings,h=r.alignment,d=o(this.legendHeight,e.height);a=n.legendSettings.title.text?this.width:o(this.legendWidth,e.width);var p=n.axisCollections,c=0;if(n.horizontalGradient){a=a>e.width?e.width:a,d="Gradient"===n.paletteSettings.type||n.legendSettings.enableSmartLegend?d>50?d:50:this.height,i="Near"===h?e.x:"Far"===h?e.x+e.width-a:e.x+e.width/2-a/2,""!==n.xAxis.title.text&&(c=s(n.xAxis.title.text,n.xAxis.textStyle).height+10);var u=p[0].opposedPosition?0:g(p[0].xAxisMultiLabelHeight)+p[0].maxLabelSize.height+c+10;l="Top"===r.position?n.titleSettings.text?t:n.margin.top:e.y+e.height+u}else{d=d>e.height?e.height:d,a="Gradient"===n.paletteSettings.type||n.legendSettings.enableSmartLegend?a>50?a:50:a,l="Near"===h?e.y:"Far"===h?e.y+e.height-d:e.y+e.height/2-d/2,""!==n.yAxis.title.text&&(c=s(n.yAxis.title.text,n.yAxis.textStyle).height+10);var m=p[1].opposedPosition?g(p[1].yAxisMultiLabelHeight)+p[1].maxLabelSize.width+c+20:0;i="Right"===r.position?e.x+e.width+m:n.margin.left}this.legendGroup=new pe(i,l,a,d),this.calculateGradientScale(this.legendGroup)},e.prototype.measureListLegendBound=function(e){var i=this.heatMap,l=i.legendSettings.title;this.numberOfPages=1;var a=s(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.text):l.text,l.textStyle);if(i.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(i.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 n=o(this.legendHeight,e.height);n=n>e.height?e.height:n,n=i.legendSettings.title.text?n-a.height:n,this.listPerPage=Math.floor(n/(this.legendSize+this.listInterval)-1),this.numberOfPages=Math.max(1,Math.ceil(i.colorCollection.length/this.listPerPage))}else this.listPerPage=i.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,a=this.currentPage+"/"+this.numberOfPages,n=s(a,e.legendSettings.textStyle),o=i-n.width-15,r=new ce(o,l,"start",a,0,"translate(0,0)","middle"),h=new ge(e.element.id+"_paging",r,e.legendSettings.textStyle,e.legendSettings.textStyle.color||e.themeStyle.legendLabel);this.drawSvgCanvas.createText(h,this.paginggroup,a),t.Browser.isIE&&!e.enableCanvasRendering&&this.paginggroup.lastChild.setAttribute("dy","0.6ex"),this.pagingRect=new pe(o,l-n.height/2,n.width,n.height);var d=new he(e.element.id+"_pagingText","none",{color:"transparent",width:0},1,this.pagingRect);this.drawSvgCanvas.drawRectangle(d,this.paginggroup);var p=new he(e.element.id+"_rightArrow","none",{color:"transparent",width:0},1,new pe(i-10,l-5,10,10));this.drawSvgCanvas.drawRectangle(p,this.paginggroup);var g="M "+i+" "+l+" L "+(i-10)+" "+(l-5)+" L "+(i-10)+" "+(l+5)+"Z",c=o-15,u="M "+c+" "+l+" L "+(c+10)+" "+(l-5)+" L "+(c+10)+" "+(l+5)+"Z",m=new he(e.element.id+"_leftArrow","none",{color:"transparent",width:0},1,new pe(c+5,l-5,10,10));this.drawSvgCanvas.drawRectangle(m,this.paginggroup);var y=new oe(e.element.id+"_Legend_leftarrow","gray",.01,"#A0A0A0",1,"0,0",u),v=new oe(e.element.id+"_Legend_rightarrow","gray",.01,"#A0A0A0",1,"0,0",g);if(this.navigationCollections.push(p),this.navigationCollections.push(m),e.enableCanvasRendering){e.canvasRenderer.clearRect(m),e.canvasRenderer.clearRect(p),e.canvasRenderer.drawPath(y,void 0),e.canvasRenderer.drawPath(v,void 0)}else{var x=e.renderer.drawPath(y);x.setAttribute("tabindex","0"),x.style.outline="none";var b=e.renderer.drawPath(v);b.setAttribute("tabindex","0"),b.style.outline="none",this.paginggroup.appendChild(x),this.paginggroup.appendChild(b)}}},e.prototype.calculateGradientScale=function(e){var i,l,a,n,o=this.heatMap,r=o.legendSettings.title,h=s(o.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(r.text):r.text,r.textStyle),d=o.legendSettings.title.text?h.height:0;"Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend||this.measureListLegendBound(o.initialClipRect),o.horizontalGradient?(i=e.x+10,l=e.y+this.legendRectPadding,n="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?e.width-20:e.width-2*this.listInterval,a="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?this.gradientScaleSize:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval):(i=e.x+this.legendRectPadding,l=e.y+10+d,n="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?this.gradientScaleSize:e.width-10,a="Fixed"!==o.paletteSettings.type||o.legendSettings.enableSmartLegend?e.height-20-d:(this.legendSize+this.listInterval)*this.listPerPage-this.listInterval),this.legendRectScale=new pe(i,l,n,a),("Gradient"===o.paletteSettings.type||"Fixed"===o.paletteSettings.type&&o.legendSettings.enableSmartLegend)&&this.calculateColorAxisGrid(this.legendRectScale)},e.prototype.calculateColorAxisGrid=function(e){var t,i,l=this.heatMap,a=this.legendRectScale,n=0;this.segmentCollectionsLabels=[],this.segmentCollections=[],this.textWrapCollections=[];var o,s,r="Gradient"===l.paletteSettings.type?l.legendColorCollection:l.colorCollection,h=l.bubbleSizeWithColor?l.minColorValue:l.dataSourceMinValue,d=l.bubbleSizeWithColor?l.maxColorValue:l.dataSourceMaxValue;if(this.legendMinValue=this.heatMap.isColorRange?r[0].startValue>l.dataSourceMinValue?l.dataSourceMinValue:r[0].startValue:r[0].value>h?h:r[0].value,this.legendMaxValue=this.heatMap.isColorRange?r[r.length-1].endValue<l.dataSourceMaxValue?l.dataSourceMaxValue:r[r.length-1].endValue:r[r.length-1].value<d?d:r[r.length-1].value,"Gradient"===l.paletteSettings.type)for(var p=0;p<r.length;p++){var g=void 0;t=(this.heatMap.isColorRange&&l.horizontalGradient?a.width:a.height)/100,this.heatMap.isColorRange?(r[0].startValue!==this.heatMap.dataSourceMinValue&&0===p&&r[0].startValue>this.heatMap.dataSourceMinValue&&(g=(this.heatMap.dataSourceMinValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,s=(l.horizontalGradient?e.x:e.y)+t*g,this.segmentCollections.push(s)),g=((r[p].startValue<l.dataSourceMinValue&&r[p].endValue>l.dataSourceMaxValue?l.dataSourceMinValue:r[p].startValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,g=isNaN(g)?0:g,s=(l.horizontalGradient?e.x:e.y)+t*g,this.segmentCollections.push(s),this.segmentCollectionsLabels.push(s),r[p].endValue!==(p===r.length-1?this.heatMap.dataSourceMaxValue:r[p+1].startValue)&&this.heatMap.legendColorCollection[p].endValue<this.heatMap.dataSourceMaxValue&&(p===r.length-1&&(g=(r[p].endValue-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,s=(l.horizontalGradient?e.x:e.y)+t*g,this.segmentCollections.push(s)),g=((p===r.length-1?this.heatMap.dataSourceMaxValue:r[p].endValue)-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,s=(l.horizontalGradient?e.x:e.y)+t*g,this.segmentCollections.push(s))):(g=(r[p].value-this.legendMinValue)/(this.legendMaxValue-this.legendMinValue)*100,g=isNaN(g)?0:g,l.horizontalGradient?(t=a.width/100,o=e.x+t*g,this.segmentCollections.push(o)):(t=a.height/100,s=e.y+t*g,this.segmentCollections.push(s)))}var c;if(l.horizontalGradient){for(var u=this.heatMap.isColorRange?this.segmentCollectionsLabels:this.segmentCollections,y=0;y<r.length;y++){if("Gradient"===l.paletteSettings.type){var v=(u[y]-u[y-1])/2,x=(u[y+1]-u[y])/2;c=y===r.length-1?this.heatMap.isColorRange?(e.width-u[y-1])/2:v:0===y?x:v<x&&!this.heatMap.isColorRange?v:x}else{var b=this.legendRectScale.width/l.colorCollection.length;c="Edge"===l.legendSettings.labelDisplayType?b:b/2}this.textWrapCollections.push(c),n=(i=m(this.labelCollections[y],l.legendSettings.textStyle,c)).length>n?i.length:n}"Bottom"===l.legendSettings.position?(l.initialClipRect.height-=this.maxLegendLabelSize.height*(n-1),this.legendGroup.y-=this.maxLegendLabelSize.height*(n-1),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(n-1)):(l.initialClipRect.y+=this.maxLegendLabelSize.height*(n-1),l.initialClipRect.height-=this.maxLegendLabelSize.height*(n-1),this.legendRectScale.y=this.legendGroup.y+this.legendRectPadding,this.legendGroup.height=parseInt(this.legendHeight,10)+this.maxLegendLabelSize.height*(n-1))}},e.prototype.renderColorAxisGrid=function(e){var t,i,l,a,n,o=this.heatMap;o.enableCanvasRendering||(t=this.heatMap.renderer.createGroup({id:o.element.id+"_ColorAxis_Grid"}));for(var s=0;s<(o.isColorRange?this.segmentCollections.length:o.legendColorCollection.length);s++){o.horizontalGradient?(i=a=this.segmentCollections[s],l=e.y,n=e.y+e.height):(i=e.x,l=n=this.segmentCollections[s],a=e.x+e.width);var r=new ue(i,l,a,n),h=new me(this.heatMap.element.id+"_ColorAxis_Grid"+s,r,"#EEEEEE",1);this.drawSvgCanvas.drawLine(h,t),o.enableCanvasRendering||this.legend.appendChild(t)}},e.prototype.renderLegendTitleTooltip=function(e,t,i){-1!==e.target.id.indexOf("_legendTitle")&&e.target.textContent.indexOf("...")>-1?(S(this.heatMap.legendSettings.title.text,t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_legendTitle_Tooltip",w(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_legendTitle_Tooltip").style.visibility="visible"):C(this.heatMap.element.id+"_legendTitle_Tooltip")},e.prototype.renderLegendLabelTooltip=function(e,t,i){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 a=void 0;a=1===l[1].length||"Trim"===this.heatMap.legendSettings.textStyle.textOverflow?parseInt(l[1],10):parseInt(l[1].substring(0,l[1].length-1),10),S(this.labelCollections[a],t,i,this.heatMap.element.offsetWidth,this.heatMap.element.id+"_LegendLabel_Tooltip",w(this.heatMap.element.id+"_Secondary_Element"),null,this.heatMap),document.getElementById(this.heatMap.element.id+"_LegendLabel_Tooltip").style.visibility="visible"}}else C(this.heatMap.element.id+"_LegendLabel_Tooltip")},e.prototype.calculateListPerPage=function(e){var i=this.heatMap;if(i.horizontalGradient){this.lastList=[];var l=e.x,a=e.y,n=0,o=0,r=0,h=0,d=void 0;for(this.labelXCollections=[],this.labelYCollections=[],this.legendXCollections=[],this.legendYCollections=[],d=0;d<i.colorCollection.length;d++){if(i.legendSettings.showLabel){var p=this.labelCollections[d];n=s(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(p):p,i.legendSettings.textStyle).width}r=l+10+5,h=a+5;var g=i.legendSettings.showLabel?r+n:l+this.legendSize+this.listInterval;0!==d&&g>this.legendGroup.width+this.legendGroup.x-this.listInterval&&(o+=1,r=(l=e.x)+10+5,h=(a=e.y+20*o)+5,o%this.listPerPage==0&&(this.lastList.push(d),h=(a=e.y)+5,o=0)),this.labelXCollections.push(r),this.labelYCollections.push(h),this.legendXCollections.push(l),this.legendYCollections.push(a),l=l+this.legendSize+this.labelPadding+n+this.listInterval}this.lastList.push(d),this.numberOfPages=this.lastList.length}},e.prototype.renderListLegendMode=function(e,i){var l=this.heatMap,a={color:"transparent",width:0};this.legendLabelTooltip=[];var n,o=new ae(0,0),r=0,h=0,d=e.x,p=e.y;i&&this.renderPagingElements();var g,c,u=l.legendSettings.title.text?this.width-2*(this.legendSize+this.labelPadding):this.legendGroup.width-(this.legendSize+this.legendRectPadding+this.labelPadding);l.horizontalGradient?(g=1===this.currentPage?0:this.lastList[this.currentPage-2],c=this.lastList[this.currentPage-1]):c=(c=(g=this.currentPage*this.listPerPage-this.listPerPage)+this.listPerPage)<l.colorCollection.length?c:l.colorCollection.length;for(var y=g;y<c;y++){if(l.legendSettings.showLabel){var v=this.labelCollections[y];o=s(this.heatMap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(v):v,l.legendSettings.textStyle)}var x=this.heatMap.renderer.createGroup({id:l.element.id+"_Legend_Index_"+y}),b={cancel:!1,text:this.labelCollection[y],name:"legendRender"};if(l.horizontalGradient&&(d=this.legendXCollections[y],p=this.legendYCollections[y],r=this.labelXCollections[y],h=this.labelYCollections[y]),r=d+this.legendSize+this.labelPadding,h=p+5,this.heatMap.trigger("legendRender",b),i&&l.rendering&&this.legendRange.length<l.colorCollection.length){var f=new Le(d,p,10,10,l.colorCollection[y].value,!0,this.currentPage);if(f.visible=!!t.isNullOrUndefined(this.visibilityCollections[y])||this.visibilityCollections[y],b.cancel){var S=new Le(d,p,0,0,l.colorCollection[y].value,!0,this.currentPage);this.legendRange.push(S)}else this.legendRange.push(f);if(l.legendSettings.showLabel){var C=new Le(r,h-o.height/2,o.width,o.height,l.colorCollection[y].value,!0,this.currentPage);C.visible=!!t.isNullOrUndefined(this.visibilityCollections[y])||this.visibilityCollections[y],this.legendTextRange.push(C)}}if(!b.cancel){n=new pe(d,p,10,10);var M=l.legendOnLoad?this.heatMap.isColorRange?l.colorCollection[y].minColor:l.colorCollection[y].color:this.legendRange[y].visible?this.heatMap.isColorRange?l.colorCollection[y].minColor:l.colorCollection[y].color:"#D3D3D3",w=new he(l.element.id+"_legend_list"+y,M,a,1,n);if(this.drawSvgCanvas.drawRectangle(w,x),l.legendSettings.showLabel){-1!==(v=m(this.labelCollections[y],l.legendSettings.textStyle,u))[0].indexOf("...")&&l.enableCanvasRendering&&this.legendLabelTooltip.push(new Se(this.labelCollections[y],new pe(r,h,o.width,o.height)));var L=new ce(r,h,"start",v,0,"translate(0,0)","middle"),T=new ge(l.element.id+"_Legend_Label"+y,L,l.legendSettings.textStyle,l.legendSettings.textStyle.color||l.themeStyle.legendLabel);T.fill=l.legendOnLoad?T.fill:this.legendRange[y].visible?T.fill:"#D3D3D3",this.drawSvgCanvas.createText(T,x,v[0]),t.Browser.isIE&&!l.enableCanvasRendering&&x.lastChild.setAttribute("dy","0.6ex")}l.horizontalGradient?d=d+this.legendSize+this.labelPadding+o.width+this.listInterval:p+=this.legendSize+this.listInterval}var R=this.heatMap.legendSettings.toggleVisibility?0:-1;x.setAttribute("tabindex",R.toString()),x.style.outline="none",this.translategroup.appendChild(x)}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 O=l.renderer.createClipPath({id:l.element.id+"_LegendScale_ClipPath"}),z=l.renderer.drawRectangle(this.legendGroup);O.appendChild(z),this.translategroup.appendChild(O),this.legend.style.cssText="clip-path:url(#"+O.id+")",this.legendScale.appendChild(this.translategroup),l.svgObject.appendChild(this.legend)}},e.prototype.translatePage=function(e,i,l){if(l&&i>=1&&i<this.numberOfPages||!l&&i>1&&i<=this.numberOfPages){if(l?(this.currentPage+=1,this.legendRect.y+=this.legendRect.height):(this.currentPage-=1,this.legendRect.y-=this.legendRect.height),e.enableCanvasRendering)for(var a=0,n=[e.canvasRenderer.ctx,e.secondaryCanvasRenderer.ctx];a<n.length;a++){var o=n[a];t.isNullOrUndefined(o)||(o.clearRect(this.legendRectScale.x-5,this.legendRectScale.y-5,this.legendRectScale.width+5,this.legendRectScale.height+10),o.clearRect(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 s=e.secondaryCanvasRenderer.ctx,r=e.legendSettings.position,h=e.initialClipRect,d="Right"===r?h.x+h.width:0,p="Bottom"===r?h.y+h.height:0,g="Right"===r?e.availableSize.width-(h.x+h.width):"Left"===r?h.x:e.availableSize.width,c="Top"===r?h.y:"Bottom"===r?e.availableSize.height-(h.y+h.height):e.availableSize.height;s.save(),s.clearRect(d,p,g,c),s.restore();var u=document.getElementById(e.element.id+"_canvas"),m=document.getElementById(e.element.id+"_secondary_canvas"),y=u.getContext("2d").getImageData(d,p,g,c);m.getContext("2d").putImageData(y,d,p),u.style.opacity="0.3"}},e.prototype.createTooltipDiv=function(){var e=t.createElement("div",{id:this.heatMap.element.id+"legendLabelTooltipContainer"});e.style.cssText="position: absolute; pointer-events: none;",this.heatMap.element.appendChild(e)},e.prototype.renderTooltip=function(e){var t=this.heatMap,l=[e.label],a=null;a=parseInt(t.legendSettings.textStyle.size,10)/2,this.tooltipObject=new i.Tooltip({offset:a,theme:t.theme,content:l,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 a=this.legendRectPositionCollection[l];if(a&&e>a.x&&e<a.width+a.x&&t>a.y&&t<a.height+a.y){i=this.legendRectPositionCollection[l];break}}var n=document.getElementById(this.heatMap.element.id+"legendLabelTooltipContainer");n&&"visible"===n.style.visibility&&this.tooltipObject&&!this.heatMap.isTouch&&(this.tooltipObject.fadeOut(),n.style.visibility="hidden"),i&&this.renderTooltip(i)},e.prototype.legendRangeSelection=function(e){var i=this.heatMap,l=this.legendRange,a=i.horizontalGradient?10:0,n=this.legendRectScale,o=i.canvasRenderer.ctx,s=i.secondaryCanvasRenderer.ctx;if(i.rangeSelection=!0,i.enableCanvasRendering)i.legendSettings.enableSmartLegend?(t.isNullOrUndefined(o)||o.clearRect(n.x-5,n.y-5,n.width+this.labelPadding+this.maxLegendLabelSize.width+5,n.height+2*(5+a)),t.isNullOrUndefined(s)||s.clearRect(n.x-5,n.y-5,n.width+this.labelPadding+this.maxLegendLabelSize.width+5,n.height+2*(5+a))):(t.isNullOrUndefined(o)||o.clearRect(n.x-5,n.y-5,n.width+5,n.height+10),t.isNullOrUndefined(s)||s.clearRect(n.x-5,n.y-5,n.width+5,n.height+10));else{if(i.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);C(i.heatMapSeries.containerRectObject.id),i.cellSettings.showLabel&&C(i.heatMapSeries.containerTextObject.id)}if(i.legendSettings.enableSmartLegend&&i.colorCollection.length!==i.legendColorCollection.length&&(e===i.legendColorCollection.length-1?i.toggleValue[e-1].visible=this.visibilityCollections[e-1]=l[e-1].visible=!l[e].visible:e===i.colorCollection.length-1&&(i.toggleValue[e+1].visible=this.visibilityCollections[e+1]=l[e+1].visible=!l[e].visible)),i.toggleValue[e].visible=this.visibilityCollections[e]=l[e].visible=!l[e].visible,i.legendOnLoad=!1,i.legendSettings.enableSmartLegend){this.renderSmartLegend();var r=new pe(n.x,n.y,n.width,n.height);this.renderLegendLabel(r),i.enableCanvasRendering&&(o.save(),o.clip()),"SVG"===i.renderingMode&&this.renderTitle(r)}else this.renderListLegendMode(this.legendRectScale,!1);i.enableCanvasRendering&&o.restore(),i.heatMapSeries.renderRectSeries(),i.clearSelection(),i.enableCanvasRendering&&i.allowSelection},e.prototype.updateLegendRangeCollections=function(){var e=this.heatMap;e.rangeSelection=!e.legendOnLoad,this.visibilityCollections=e.legendOnLoad?[]:this.visibilityCollections,e.toggleValue=e.legendOnLoad?[]:e.toggleValue,this.legendRange=e.legendOnLoad?[]:this.legendRange,this.legendTextRange=e.legendOnLoad?[]:this.legendTextRange},e}(),je=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)}}(),Ye=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return je(i,e),Ye([t.Property(!1)],i.prototype,"isJsonData",void 0),Ye([t.Property("None")],i.prototype,"adaptorType",void 0),Ye([t.Property("")],i.prototype,"xDataMapping",void 0),Ye([t.Property("")],i.prototype,"yDataMapping",void 0),Ye([t.Property("")],i.prototype,"valueMapping",void 0),Ye([t.Complex({},N)],i.prototype,"bubbleDataMapping",void 0),i}(t.ChildProperty),Je=function(){function e(){}return e}(),Ke=function(){function e(e){this.reconstructedXAxis=[],this.reconstructedYAxis=[],this.adaptiveXMinMax=new Je,this.adaptiveYMinMax=new Je,this.heatMap=e}return e.prototype.constructDatasource=function(e,i){if("Cell"===i.adaptorType){var l=this.heatMap.xAxis,a=this.heatMap.yAxis;this.adaptiveXMinMax.min=l.minimum,this.adaptiveXMinMax.max=l.maximum,this.adaptiveYMinMax.min=a.minimum,this.adaptiveYMinMax.max=a.maximum,("Numeric"!==l.valueType&&"DateTime"!==l.valueType||!t.isNullOrUndefined(l.minimum)&&!t.isNullOrUndefined(l.maximum))&&("Numeric"!==a.valueType&&"DateTime"!==a.valueType||!t.isNullOrUndefined(a.minimum)&&!t.isNullOrUndefined(a.maximum))||this.getMinMaxValue(e,i,l,a),this.heatMap.isCellData=!0}"None"===i.adaptorType?this.heatMap.completeAdaptDataSource=e:i.isJsonData||"Table"!==i.adaptorType?i.isJsonData&&"Table"===i.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonTableData(e,i):i.isJsonData&&"Cell"===i.adaptorType?this.heatMap.completeAdaptDataSource=this.processJsonCellData(e,i):i.isJsonData||"Cell"!==i.adaptorType||(this.constructAdaptiveAxis(),this.heatMap.completeAdaptDataSource=this.processCellData(e),this.heatMap.isCellData=!0):this.heatMap.completeAdaptDataSource=e},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,a=[];l<=t;)a.push(l.toString()),l+=i;return a},e.prototype.getDateAxisCollection=function(e,t,i,a){for(var n={skeleton:"full",type:"dateTime"},o=this.heatMap.intl.getDateParser(n),s=this.heatMap.intl.getDateFormat(n),r=e=Date.parse(o(s(new Date(l.DataUtil.parse.parseJson({val:e}).val)))),h=[];r<=t;)h.push(new Date(r).toString()),r=L(r,1,i,a).getTime();return h},e.prototype.getMinMaxValue=function(e,i,l,a){var n=e,o=Object.keys(n[0]);n.length>0&&(this.adaptiveXMinMax.min=t.isNullOrUndefined(l.minimum)?i.isJsonData?n[0][o[0]]:n[0][0]:l.minimum,this.adaptiveYMinMax.min=t.isNullOrUndefined(a.minimum)?i.isJsonData?n[0][o[1]]:n[0][1]:a.minimum,this.adaptiveXMinMax.max=t.isNullOrUndefined(l.maximum)?i.isJsonData?n[0][o[0]]:n[0][0]:l.maximum,this.adaptiveYMinMax.max=t.isNullOrUndefined(a.maximum)?i.isJsonData?n[0][o[1]]:n[0][1]:a.maximum);for(var s=0;s<n.length;s++){var r=i.isJsonData?n[s][o[0]]:n[s][0],h=i.isJsonData?n[s][o[1]]:n[s][1];r<this.adaptiveXMinMax.min&&t.isNullOrUndefined(l.minimum)&&(this.adaptiveXMinMax.min=r),r>this.adaptiveXMinMax.max&&t.isNullOrUndefined(l.maximum)&&(this.adaptiveXMinMax.max=r),h<this.adaptiveYMinMax.min&&t.isNullOrUndefined(a.minimum)&&(this.adaptiveYMinMax.min=h),h>this.adaptiveYMinMax.max&&t.isNullOrUndefined(a.maximum)&&(this.adaptiveYMinMax.max=h)}},e.prototype.processCellData=function(e){var i=e,l=this.reconstructedXAxis,a=this.reconstructedYAxis,n=0,o=0;if(this.reconstructData=[],i&&i.length)for(var s=0;s<i.length;s++)if((n="Category"===this.heatMap.xAxis.valueType?i[s][0]:l.indexOf(i[s][0].toString()))>-1){for(;!this.reconstructData[n];)this.reconstructData.push([]);if(-1!==(o="Category"===this.heatMap.yAxis.valueType?i[s][1]:a.indexOf(i[s][1].toString()))){for(;""!==this.reconstructData[n][o];)this.reconstructData[n].push("");this.reconstructData[n][o]=t.isNullOrUndefined(i[s][2])?"":i[s][2]}}return this.reconstructData},e.prototype.processJsonCellData=function(e,i){var l=e,a=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],n=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[],o=this.heatMap.axisCollections;0!==a.length&&0!==n.length||this.generateAxisLabels(e,i);var s="Category"===this.heatMap.xAxis.valueType?a.length>0?this.heatMap.xAxis.labels:o[0].jsonCellLabel:o[0].labelValue,r="Category"===this.heatMap.yAxis.valueType?n.length>0?this.heatMap.yAxis.labels:o[1].jsonCellLabel:o[1].labelValue,h=0,d=0;if(l.length){this.reconstructData=[];for(var p=0;p<l.length;p++)if(-1!==(h=this.getSplitDataValue(l[p],i,s,t.isNullOrUndefined(i.xDataMapping)?null:i.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[h];)this.reconstructData.push([]);if(-1!==(d=this.getSplitDataValue(l[p],i,r,t.isNullOrUndefined(i.yDataMapping)?null:i.yDataMapping.split("."),this.heatMap.yAxis.valueType))){for(;t.isNullOrUndefined(this.reconstructData[h][d]);)this.reconstructData[h].push("");this.heatMap.bubbleSizeWithColor?this.reconstructData[h][d]=[this.getSplitDataValue(l[p],i,null,i.bubbleDataMapping.size.split("."),""),this.getSplitDataValue(l[p],i,null,i.bubbleDataMapping.color.split("."),"")]:this.reconstructData[h][d]=this.getSplitDataValue(l[p],i,null,t.isNullOrUndefined(i.valueMapping)?null:i.valueMapping.split("."),"")}}}return this.reconstructData},e.prototype.generateAxisLabels=function(e,t){for(var i=e,l=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],a=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[],n=l.length>0,o=a.length>0,s=this.heatMap.axisCollections,r=0;r<s.length;r++){var h=s[r].valueType,d=s[r];if("Category"===h){var p=void 0,g=void 0,c=void 0;if("Horizontal"===d.orientation?(p=n,g=t.xDataMapping,d.jsonCellLabel=c=[]):(p=o,g=t.yDataMapping,d.jsonCellLabel=c=[]),!p)for(var u=0;u<i.length;u++)if(g in i[u]){var m=i[u][g].toString();-1===c.indexOf(m.toString())&&c.push(m)}}else"DateTime"===h?(d.clearAxisLabel(),d.calculateDateTimeAxisLabel(this.heatMap)):(d.clearAxisLabel(),d.calculateNumericAxisLabels(this.heatMap))}},e.prototype.getSplitDataValue=function(e,i,a,n,o){var s=-1,r={skeleton:"full",type:"dateTime"},h=this.heatMap.intl.getDateParser(r),d=this.heatMap.intl.getDateFormat(r);this.tempSplitDataCollection=e;for(var p=0;p<(t.isNullOrUndefined(n)?0:n.length)&&(s=t.isNullOrUndefined(a)?null:"DateTime"!==o?a.indexOf(this.tempSplitDataCollection[n[p]]):"string"==typeof this.tempSplitDataCollection[n[p]]||"object"==typeof this.tempSplitDataCollection[n[p]]?a.map(Number).indexOf(Date.parse(h(d(new Date(l.DataUtil.parse.parseJson({val:this.tempSplitDataCollection[n[p]]}).val))))):a.map(Number).indexOf(+new Date(this.tempSplitDataCollection[n[p]]).setHours(0,0,0,0)),t.isNullOrUndefined(this.tempSplitDataCollection)||(this.tempSplitDataCollection=-1===s||t.isNullOrUndefined(a)?this.tempSplitDataCollection[n[p]]:this.tempSplitDataCollection),!t.isNullOrUndefined(this.tempSplitDataCollection));p++);return s=t.isNullOrUndefined(a)?t.isNullOrUndefined(this.tempSplitDataCollection)||""===this.tempSplitDataCollection.toString()?"":parseFloat(this.tempSplitDataCollection.toString()):s},e.prototype.processJsonTableData=function(e,i){var l,a=e,n=0,o=0,s=this.heatMap.xAxis.labels?this.heatMap.xAxis.labels:[],r=this.heatMap.yAxis.labels?this.heatMap.yAxis.labels:[];if(a.length){this.reconstructData=[];for(var h=0;h<a.length;h++)if(-1!==(n=this.getSplitDataValue(a[h],i,s,t.isNullOrUndefined(i.xDataMapping)?null:i.xDataMapping.split("."),this.heatMap.xAxis.valueType))){for(;!this.reconstructData[n];)this.reconstructData.push([]);for(var d=0;d<Object.keys(this.tempSplitDataCollection).length;d++)if(l=Object.keys(this.tempSplitDataCollection)[d],-1!==(o=l!==i.xDataMapping?r.indexOf(l):-1)){for(;t.isNullOrUndefined(this.reconstructData[n][o]);)this.reconstructData[n].push("");this.reconstructData[n][o]=t.isNullOrUndefined(this.tempSplitDataCollection[l])?"":this.tempSplitDataCollection[l]}}}return this.reconstructData},e.prototype.destroy=function(){this.reconstructData=null,this.reconstructedXAxis=null,this.reconstructedYAxis=null,this.adaptiveXMinMax=null,this.adaptiveYMinMax=null,this.tempSplitDataCollection=null,this.heatMap=null},e.prototype.getModuleName=function(){return"Adaptor"},e}(),qe=function(){function e(e){this.control=e}return e.prototype.export=function(e,i,l){var n,o,s=this,r=this.getControlsValue(),h=r.width,d=r.height,p=this.control.svgObject,g=this.control.enableCanvasRendering;g||(p=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:h.toString(),height:d.toString()}}));var c=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1);l=t.isNullOrUndefined(l)?a.PdfPageOrientation.Landscape:l;var u='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+r.svg.outerHTML+"</svg>";if(g)n=p.toDataURL("image/png");else{var m=this.control.svgObject.cloneNode(!0),y=m.childNodes[0],v=y.getAttribute("fill");"Tailwind"!==this.control.theme&&"Tailwind3"!==this.control.theme&&"Bootstrap5"!==this.control.theme&&"Fluent"!==this.control.theme&&"Material3"!==this.control.theme&&"Fluent2"!==this.control.theme||"rgba(255,255,255, 0.0)"!==v&&"transparent"!==v?"TailwindDark"!==this.control.theme&&"Tailwind3Dark"!==this.control.theme&&"Bootstrap5Dark"!==this.control.theme&&"FluentDark"!==this.control.theme&&"Material3Dark"!==this.control.theme&&"Fluent2Dark"!==this.control.theme&&"Fluent2HighContrast"!==this.control.theme||"rgba(255,255,255, 0.0)"!==v&&"transparent"!==v||y.setAttribute("fill","rgba(0, 0, 0, 1)"):y.setAttribute("fill","rgba(255,255,255, 1)"),n=window.URL.createObjectURL(new Blob("SVG"===e?[u]:[(new XMLSerializer).serializeToString(m)],{type:"image/svg+xml"}))}if("SVG"===e)if("msie"===t.Browser.info.name){var x=new Blob([(new XMLSerializer).serializeToString(r.svg)],{type:"application/octet-stream"});t.isNullOrUndefined(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(x,i+"."+e.toLocaleLowerCase())}else this.triggerDownload(i,e,n,c);else if("msie"===t.Browser.info.name){var b=p;g||(b=this.createCanvas()),o=b.toDataURL(e),"PDF"===e?this.exportPdf(b,l,h,d,c,i):this.doExport(e,o,i)}else{var f=new Image,S=p.getContext("2d"),M=S.shadowColor;f.onload=function(){"Tailwind"!==s.control.theme&&"Tailwind3"!==s.control.theme&&"Bootstrap5"!==s.control.theme&&"Fluent"!==s.control.theme&&"Material3"!==s.control.theme&&"Fluent2"!==s.control.theme||"rgba(0, 0, 0, 0)"!==M&&"transparent"!==M?"TailwindDark"!==s.control.theme&&"Tailwind3Dark"!==s.control.theme&&"Bootstrap5Dark"!==s.control.theme&&"FluentDark"!==s.control.theme&&"Material3Dark"!==s.control.theme&&"Fluent2Dark"!==s.control.theme&&"Fluent2HighContrast"!==s.control.theme||"rgba(0, 0, 0, 0)"!==M&&"transparent"!==M||(S.fillStyle="rgba(0, 0, 0, 1)"):S.fillStyle="rgba(255,255,255, 1)",S.fillRect(0,0,p.width,p.height),S.drawImage(f,0,0),window.URL.revokeObjectURL(n),"PDF"===e?s.exportPdf(p,l,h,d,c,i):window.navigator.msSaveOrOpenBlob?window.navigator.msSaveOrOpenBlob(p.msToBlob(),i+"."+e.toLocaleLowerCase()):s.triggerDownload(i,e,p.toDataURL("image/png").replace("image/png","image/octet-stream"),c)},f.src=n}g||C(document.getElementById(this.control.element.id)+"_canvas")},e.prototype.triggerDownload=function(e,i,l,a){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).dispatchEvent(new MouseEvent(a?"click":"move",{view:window,bubbles:!1,cancelable:!0}))},e.prototype.getControlsValue=function(){var e=0,t=0,l=this.control.enableCanvasRendering,a=new i.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200}),n=this.control.svgObject.cloneNode(!0),o=this.control.renderer.createGroup({});return o.style.cssText="transform: translateY("+t+"px)",l||o.appendChild(n),e=Math.max(this.control.availableSize.width,e),t+=this.control.availableSize.height,l||a.appendChild(o),l||(a.setAttribute("width",e+""),a.setAttribute("height",t+"")),{width:e,height:t,svg:a}},e.prototype.createCanvas=function(){var e=this.control,t=e.renderingMode;e.renderingMode="Canvas",e.refresh();var i=e.svgObject;return e.renderingMode=t,e.refresh(),i},e.prototype.exportPdf=function(e,t,i,l,n,o){var s=new a.PdfDocument,r=s.pageSettings.margins,h=s.pageSettings.width,d=s.pageSettings.height,p=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");s.pageSettings.orientation=t;var g=h<i?i+r.left+r.right:h,c=d<l?l+r.top+r.bottom:d;s.pageSettings.size=new a.SizeF(g,c),p=p.slice(p.indexOf(",")+1),s.pages.add().graphics.drawImage(new a.PdfBitmap(p),0,0,i,l),n&&(s.save(o+".pdf"),s.destroy())},e.prototype.doExport=function(e,t,i){var l=[],a=e||"JPG";l=[t],this.exportImage(l,i,a,t)},e.prototype.exportImage=function(e,i,l,a){for(var n=[],o=e instanceof HTMLElement?0:e.length,s=0;s<o;s++){for(var r=(a=(a=e[s]).replace(/^data:[a-z]*;,/,"")).split(","),h=atob(r[1]),d=new ArrayBuffer(h.length),p=new Uint8Array(d),g=0;g<h.length;g++)p[g]=h.charCodeAt(g);n.push(d)}for(var c=0;c<n.length;c++){var u=new Blob([n[c]],{type:"application/octet-stream"});"msie"!==t.Browser.info.name||t.isNullOrUndefined(window.navigator.msSaveOrOpenBlob)||window.navigator.msSaveOrOpenBlob(u,i+"."+l.toLocaleLowerCase())}},e.prototype.print=function(){if(this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight),"SVG"===this.control.renderingMode)t.print(this.getHTMLContent(),this.printWindow);else{var e=this.control.svgObject,i=e.toDataURL(),l=new Image,a=e.getContext("2d");l.onload=function(){a.drawImage(l,0,0)},l.src=i,t.print(l,this.printWindow)}},e.prototype.getHTMLContent=function(){var e=t.createElement("div");return e.appendChild(this.control.element.cloneNode(!0)),e},e}(),Ze=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)}}(),$e=function(e,t,i,l){var a,n=arguments.length,o=n<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--)(a=e[s])&&(o=(n<3?a(o):n>3?a(t,i,o):a(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},Qe=function(e){function l(){var t=null!==e&&e.apply(this,arguments)||this;return t.enableCanvasRendering=!1,t.isColorRange=!1,t.isCellTapHold=!1,t.selectedCellCount=0,t.toggleValue=[],t.legendOnLoad=!0,t.resizing=!1,t.rendering=!0,t.multiSelection=!1,t.rectSelected=!1,t.previousSelectedCellsRect=[],t.multiCellCollection=[],t.selectedMultiCellCollection=[],t.tempMultiCellCollection=[],t.tooltipCollection=[],t.isCellData=!1,t}return Ze(l,e),l.prototype.preRender=function(){this.initPrivateVariable(),this.unWireEvents(),this.wireEvents()},l.prototype.export=function(e,t,i){new qe(this).export(e,t,i)},l.prototype.initPrivateVariable=function(){this.renderer=new i.SvgRenderer(this.element.id),this.canvasRenderer=new i.CanvasRenderer(this.element.id),this.secondaryCanvasRenderer=new i.CanvasRenderer(this.element.id+"_secondary"),this.heatMapAxis=new De(this),this.heatMapSeries=new Ve(this),this.drawSvgCanvas=new xe(this),this.twoDimensional=new He(this),this.cellColor=new te(this),this.tempRectHoverClass="",this.tempTooltipRectId="",this.setCulture()},l.prototype.setCulture=function(){this.intl=new t.Internationalization},l.prototype.render=function(){if(this.horizontalGradient="Bottom"===this.legendSettings.position||"Top"===this.legendSettings.position,this.updateBubbleHelperProperty(),this.trigger("load",{heatmap:this}),"TailwindDark"===this.theme||"Tailwind"===this.theme){e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter"}};this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter"}}},!0)}if("Tailwind3Dark"===this.theme||"Tailwind3"===this.theme){e={title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}};this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Inter",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({yAxis:{title:{textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Inter",fontWeight:"400"}}},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Inter",fontWeight:"400"}}},!0)}if("Material3"===this.theme||"Material3Dark"===this.theme){e={title:{textStyle:{size:"14px",fontFamily:"Roboto",fontWeight:"500"}},textStyle:{size:"12px",fontFamily:"Roboto",fontWeight:"400"}};this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:"Roboto"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:"Roboto",fontWeight:"400"}}},!0)}if("Bootstrap5"===this.theme||"Bootstrap5Dark"===this.theme){e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}};this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"400"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)}if("Fluent"===this.theme||"FluentDark"===this.theme){e={title:{textStyle:{size:"12px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif',fontWeight:"500"}},textStyle:{size:"12px",fontFamily:'system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"'}};this.setProperties({titleSettings:{textStyle:{size:"16px",fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{fontFamily:'"Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif'}}},!0)}if("Fluent2"===this.theme||"Fluent2Dark"===this.theme||"Fluent2HighContrast"===this.theme){var e={title:{textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}},textStyle:{size:"12px",fontFamily:"Segoe UI",fontWeight:"400"}};this.setProperties({titleSettings:{textStyle:{size:"14px",fontFamily:"Segoe UI",fontWeight:"600"}}},!0),this.setProperties({legendSettings:e},!0),this.setProperties({xAxis:e},!0),this.setProperties({yAxis:e},!0),this.setProperties({cellSettings:{textStyle:{size:"10px",fontWeight:"400",fontFamily:"Segoe UI"}}},!0)}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),this.renderComplete()},l.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()},l.prototype.processInitData=function(){this.adaptorModule?this.adaptorModule.constructDatasource(this.dataSource,this.dataSourceSettings):this.completeAdaptDataSource=this.dataSource},l.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},l.prototype.updateBubbleHelperProperty=function(){t.isNullOrUndefined(this.legendModule)||"Bubble"===this.cellSettings.tileType&&("Size"===this.cellSettings.bubbleType||"Sector"===this.cellSettings.bubbleType)?this.legendVisibilityByCellType=!1:this.legendModule&&this.legendSettings.visible&&(this.legendVisibilityByCellType=!0),"Bubble"===this.cellSettings.tileType&&"SizeAndColor"===this.cellSettings.bubbleType?this.bubbleSizeWithColor=!0:this.bubbleSizeWithColor=!1},l.prototype.renderElements=function(){this.tooltipCollection=[],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()),M()},l.prototype.getModuleName=function(){return"heatmap"},l.prototype.getPersistData=function(){return""},l.prototype.onPropertyChanged=function(e,t){for(var i=!1,l=!1,a=!0,n=0,o=Object.keys(e);n<o.length;n++)switch(o[n]){case"renderingMode":this.rendering=!1,a=!1,i=!0;break;case"cellSettings":this.updateBubbleHelperProperty(),!this.legendModule||e.cellSettings.tileType===(void 0!==t.cellSettings&&t.cellSettings.tileType)&&e.cellSettings.bubbleType===t.cellSettings.bubbleType||(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()),"Bubble"===this.cellSettings.tileType&&(a=!1),this.reRenderDatasource(),l=!0;break;case"showTooltip":l=!0;break;case"dataSource":case"dataSourceSettings":this.isCellData=!1,this.paletteCellSelectionUpdation(),this.reRenderDatasource(),a=!1,i=!0;break;case"titleSettings":case"width":case"height":case"margin":case"backgroundColor":l=!0;break;case"legendSettings":this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(e.legendSettings.visible!==(void 0!==t.legendSettings&&t.legendSettings.visible)||e.legendSettings.enableSmartLegend!==t.legendSettings.enableSmartLegend)?(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections()):this.legendOnLoad=!1,l=!0;break;case"yAxis":case"xAxis":this.paletteCellSelectionUpdation(),this.reRenderDatasource(),a=!1,l=!0;break;case"paletteSettings":this.paletteCellSelectionUpdation(),this.twoDimensional.processDataSource(this.completeAdaptDataSource),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.template=this.tooltipSettings.template,this.tooltipModule.tooltipObject.refresh())}!l&&i?(this.createSvg(),this.renderElements(),this.appendSvgObject(),this.trigger("created"),a||this.clearSelection()):l&&(this.createSvg(),this.refreshBound(),this.appendSvgObject(),this.trigger("created")),this.allowSelection&&this.rectSelected&&(a?this.updateCellSelection():this.clearSelection()),this.rendering=!0},l.prototype.paletteCellSelectionUpdation=function(){this.updateBubbleHelperProperty(),this.legendModule&&this.legendVisibilityByCellType&&(this.legendOnLoad=!0,this.legendModule.updateLegendRangeCollections())},l.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"))},l.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")),document.getElementById(this.element.id+"_secondary_canvas")&&t.remove(document.getElementById(this.element.id+"_secondary_canvas")),this.svgObject&&document.getElementById(this.svgObject.id)){for(;this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);t.remove(this.svgObject)}},l.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"});t.style.cssText="position:absolute; z-index: 2 ; top:"+this.initialClipRect.y+"px; left:"+this.initialClipRect.x+"px",this.element.appendChild(t)},l.prototype.requiredModules=function(){var e=[];return this.showTooltip&&e.push({member:"Tooltip",args:[this],name:"Tooltip"}),this.legendSettings.visible&&e.push({member:"Legend",args:[this],name:"Legend"}),!t.isNullOrUndefined(this.dataSourceSettings)&&("Table"===this.dataSourceSettings.adaptorType&&this.dataSourceSettings.isJsonData||"Cell"===this.dataSourceSettings.adaptorType)&&e.push({member:"Adaptor",args:[this],name:"Adaptor"}),e},l.prototype.destroy=function(){this.unWireEvents(),this.touchInstance.destroy(),this.touchInstance=null;for(var i=0;i<this.axisCollections.length;i++)this.axisCollections[i].destroy();this.axisCollections=null,t.isNullOrUndefined(this.heatMapSeries)||this.heatMapSeries.destroy(),this.heatMapSeries=null,t.isNullOrUndefined(this.heatMapAxis)||this.heatMapAxis.destroy(),this.heatMapAxis=null,e.prototype.destroy.call(this),M(),t.isNullOrUndefined(this.twoDimensional)||this.twoDimensional.destroy(),this.twoDimensional=null,this.element.innerHTML="",this.availableSize=null,this.elementSize=null,this.initialClipRect=null,this.element.classList.remove("e-heatmap"),this.drawSvgCanvas=null,this.cellColor=null,this.colorCollection=null,this.legendColorCollection=null,this.clonedDataSource=null,this.completeAdaptDataSource=null,this.currentRect=null,this.dataMax=null,this.dataMin=null,this.previousRect=null,this.selectedCellsRect=null,this.canvasSelectedCells=null,this.titleRect=null,this.tooltipCollection=null,this.border=null,this.intl=null,this.titleCollection=null,this.themeStyle=null,this.renderer=null,this.canvasRenderer=null,this.secondaryCanvasRenderer=null,this.svgObject=null,this.resizeEvent=null,this.toggleValue=[],this.previousSelectedCellsRect=[],this.selectedMultiCellCollection=[],this.tempMultiCellCollection=[]},l.prototype.refresh=function(){e.prototype.refresh.call(this),this.element.classList.add("e-heatmap")},l.prototype.appendSvgObject=function(){this.element.appendChild(this.svgObject),this.enableCanvasRendering&&this.allowSelection&&this.createMultiCellDiv(!1)},l.prototype.renderBorder=function(){this.border={width:0};var e=t.isNullOrUndefined(this.backgroundColor)?this.themeStyle.background:this.backgroundColor,i=new he(this.element.id+"_HeatmapBorder",e,this.border,1,new pe(0,0,this.availableSize.width-0,this.availableSize.height-0));this.drawSvgCanvas.drawRectangle(i,this.svgObject)},l.prototype.calculateSize=function(){var e=o(this.width,this.element.offsetWidth)||this.element.offsetWidth||600,t=o(this.height,this.element.offsetHeight)||this.element.offsetHeight||450;this.availableSize=new ae(e,t);for(var i=this.element;i.parentNode&&"BODY"!==i.tagName;){if("center"===i.align){var l=this.availableSize.width.toString();this.element.style.width=l+"px",this.element.style.margin="0 auto";break}i=i.parentElement}},l.prototype.renderTitle=function(){if(this.titleSettings.text){var e=this.titleSettings.textStyle,t="Near"===e.textAlignment?"start":"Far"===e.textAlignment?"end":"middle";this.elementSize=s(this.titleCollection[0],e);var i=new ge(this.element.id+"_HeatmapTitle",new ce(r(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 Se(this.titleSettings.text,new pe(this.margin.left,this.margin.top,this.elementSize.width,this.elementSize.height))))}},l.prototype.titleTooltip=function(e,t,i,l){e.target.id===this.element.id+"_HeatmapTitle"&&e.target.textContent.indexOf("...")>-1?S(this.titleSettings.text,t,i,this.element.offsetWidth,this.element.id+"_Title_Tooltip",w(this.element.id+"_Secondary_Element"),l,this):C(this.element.id+"_Title_Tooltip")},l.prototype.axisTooltip=function(e,t,i,l){var a=e.target.id;if(-1!==a.indexOf(this.element.id+"_XAxis_Label")||-1!==a.indexOf(this.element.id+"_YAxis_Label")||-1!==a.indexOf(this.element.id+"_XAxis_MultiLevel")||-1!==a.indexOf(this.element.id+"_YAxis_MultiLevel")){var n=T(this.tooltipCollection,t,i);n?S(n,t,i,this.element.offsetWidth,this.element.id+"_axis_Tooltip",w(this.element.id+"_Secondary_Element"),this.isTouch,this):C(this.element.id+"_axis_Tooltip")}else C(this.element.id+"_axis_Tooltip")},l.prototype.isHeatmapRect=function(e,t){var i,l=[],a=[];if(this.heatMapSeries.rectPositionCollection.length>0&&(l.push(this.heatMapSeries.rectPositionCollection[0][0]),a.push(this.heatMapSeries.rectPositionCollection[this.yLength-1][this.xLength-1])),l.length>0&&a.length>0)if(this.cellSettings.border.width>5&&e>=l[0].x&&t>=l[0].y&&e<=a[0].x+a[0].width&&t<=a[0].y+a[0].height&&"Rect"===this.cellSettings.tileType){var n=this.heatMapSeries.getCurrentRect(e,t),o=a[0].height,s=a[0].width,r=this.cellSettings.border.width/2;e>=n.x+r&&t>=n.y+r&&e<=n.x+(s-r)&&t<=n.y+(o-r)?(i=!0,this.isRectBoundary=!0):(i=!1,this.isRectBoundary=!1)}else i=e>=l[0].x&&t>=l[0].y&&e<=a[0].x+a[0].width&&t<=a[0].y+a[0].height,this.isRectBoundary=i;return i},l.prototype.setTheme=function(){this.themeStyle=n(this.theme)},l.prototype.calculateBounds=function(){var e=this.margin,i=0,l=this.legendModule&&"Top"===this.legendSettings.position&&this.legendVisibilityByCellType||"0px"===this.titleSettings.textStyle.size?0:16,a=e.left,n=this.availableSize.width-a-e.right;if(("Column"===this.paletteSettings.colorGradientMode||"Row"===this.paletteSettings.colorGradientMode)&&"Gradient"===this.paletteSettings.type)if(0===this.paletteSettings.palette.length)this.legendVisibilityByCellType=!1;else for(var o=0;o<this.paletteSettings.palette.length;o++)if(null!==this.paletteSettings.palette[o].value)this.legendVisibilityByCellType=!0;else if(null===this.paletteSettings.palette[o].value){this.legendVisibilityByCellType=!1;break}if(this.titleSettings.text){var r=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.titleSettings.text):this.titleSettings.text;this.titleCollection=m(r,this.titleSettings.textStyle,n),i=s(r,this.titleSettings.textStyle).height*this.titleCollection.length+l}var h=e.top+i;this.titleRect=new pe(e.left,e.top,this.availableSize.width-e.left-e.right,i);var d=this.availableSize.height-h-e.bottom;this.initialClipRect=new pe(a,h,n,d);var p=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,p),this.heatMapAxis.calculateAxisSize(this.initialClipRect)},l.prototype.refreshBound=function(){this.updateBubbleHelperProperty(),this.calculateBounds(),this.renderElements()},l.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)},l.prototype.wireEvents=function(){var e=this,i=t.Browser.isPointer,l=t.Browser.touchStartEvent,a=t.Browser.touchEndEvent,n=t.Browser.touchMoveEvent,o=i?"pointerleave":"mouseleave";t.EventHandler.add(this.element,t.Browser.isDevice?l:"click",this.heatMapMouseClick,this),t.EventHandler.add(this.element,"contextmenu",this.heatMapMouseRightClick,this),t.EventHandler.add(this.element,"dblclick",this.heatMapMouseDoubleClick,this),t.EventHandler.add(this.element,l,this.heatMapMouseMove,this),t.EventHandler.add(this.element,a,this.heatMapMouseLeave,this),t.EventHandler.add(this.element,n,this.heatMapMouseMove,this),t.EventHandler.add(this.element,o,this.heatMapMouseLeave,this),t.EventHandler.add(this.element,"keyup",this.heatMapKeyUp,this),t.EventHandler.add(this.element,"keydown",this.heatMapKeyDown,this),this.resizeEvent=this.heatMapResize.bind(this),window.addEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent);var s=this;this.touchInstance=new t.Touch(this.element,{tapHold:function(t){var i=t.originalEvent.target.id;if((-1!==i.indexOf(e.element.id+"_HeatMapRect_")||-1!==i.indexOf(e.element.id+"_HeatMapRectLabels_"))&&e.allowSelection){s.isCellTapHold=!0;for(var l=[],a=0;a<e.multiCellCollection.length;a++)l.push(e.multiCellCollection[a]);t.originalEvent.ctrlKey&&e.enableMultiSelect||(e.multiCellCollection=[]),s.getDataCollection();var n={heatmap:s,cancel:!1,name:"cellSelected",data:s.multiCellCollection};s.trigger("cellSelected",n),n.cancel?(e.multiCellCollection=l,(e.multiCellCollection.length>0||!1===t.ctrlKey||!e.enableMultiSelect)&&e.removeSelectedCellsBorder(!0)):(!1!==t.ctrlKey&&e.enableMultiSelect||e.removeSelectedCellsBorder(!1),s.currentRect.allowCollection=!1),s.setCellOpacity(),window.clearTimeout(e.tooltipTimer),s.tooltipOnMouseMove(null,s.currentRect,s.isCellTapHold)}},tap:function(t){var i=t.originalEvent.target.id;if(-1!==i.indexOf(e.element.id+"_HeatMapRect_")||-1!==i.indexOf(e.element.id+"_HeatMapRectLabels_")||-1!==i.indexOf(e.element.id+"_CellSelection_Container_")){var l=!1;s.isCellTapHold||(l=!0);var a=void 0,n=void 0,o=void 0,r=e.element.getBoundingClientRect();"touchend"===t.originalEvent.type||"touchstart"===t.originalEvent.type?(e.isTouch=!0,a=(o=t.originalEvent).changedTouches[0].clientX,n=o.changedTouches[0].clientY):(e.isTouch=!1,a=t.originalEvent.clientX,n=t.originalEvent.clientY),a-=r.left,n-=r.top;var h=e.heatMapSeries.getCurrentRect(a,n);window.clearTimeout(e.tooltipTimer),s.tooltipOnMouseMove(null,h,l)}}}),this.setStyle(this.element)},l.prototype.setStyle=function(e){e.style.touchAction="element",e.style.touchAction="element",e.style.zoom="none",e.style.userSelect="none",e.style.webkitUserSelect="none",e.style.position="relative",e.style.display="block"},l.prototype.print=function(){new qe(this).print()},l.prototype.unWireEvents=function(){var e=t.Browser.isPointer,i=t.Browser.touchStartEvent,l=t.Browser.touchEndEvent,a=t.Browser.touchMoveEvent,n=e?"pointerleave":"mouseleave";t.EventHandler.remove(this.element,t.Browser.isDevice?i:"click",this.heatMapMouseClick),t.EventHandler.remove(this.element,"contextmenu",this.heatMapMouseRightClick),t.EventHandler.remove(this.element,"dblclick",this.heatMapMouseDoubleClick),t.EventHandler.remove(this.element,i,this.heatMapMouseMove),t.EventHandler.remove(this.element,l,this.heatMapMouseLeave),t.EventHandler.remove(this.element,a,this.heatMapMouseMove),t.EventHandler.remove(this.element,n,this.heatMapMouseLeave),t.EventHandler.remove(this.element,"keyup",this.heatMapKeyUp),t.EventHandler.remove(this.element,"keydown",this.heatMapKeyDown),window.removeEventListener(t.Browser.isTouch&&"orientation"in window&&"onorientationchange"in window?"orientationchange":"resize",this.resizeEvent)},l.prototype.heatMapResize=function(e){var t=this;this.resizing=!0;var i={heatmap:this,cancel:!1,name:"resized",currentSize:new ae(0,0),previousSize:new ae(this.availableSize.width,this.availableSize.height)};return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(function(){if(t.isDestroyed)return void clearTimeout(t.resizeTimer);t.createSvg(),i.currentSize=t.availableSize,t.trigger("resized",i),t.refreshBound(),t.appendSvgObject(),t.allowSelection&&t.updateCellSelection(),t.trigger("loaded",{heatmap:t}),t.resizing=!1},500),!1},l.prototype.updateCellSelection=function(){var e=this.initialClipRect.width/this.axisCollections[0].axisLabelSize,t=this.initialClipRect.height/this.axisCollections[1].axisLabelSize,i=this.initialClipRect.x,l=this.initialClipRect.y;if(this.enableCanvasRendering){if(this.enableCanvasRendering){for(var a=this.multiCellCollection,n=document.getElementById(this.element.id+"_canvas"),o=document.getElementById(this.element.id+"_secondary_canvas"),s=this.initialClipRect,r=s.y+s.height,h=s.x+s.width,d=0;d<this.multiCellCollection.length;d++){this.multiCellCollection[d].width=a[d].width=e,this.multiCellCollection[d].height=a[d].height=t,this.multiCellCollection[d].x=a[d].x=i+e*this.multiCellCollection[d].xPosition,this.multiCellCollection[d].y=a[d].y=l+t*this.multiCellCollection[d].yPosition;var p=n.getContext("2d").getImageData(a[d].x,a[d].y,a[d].width,a[d].height);o.getContext("2d").putImageData(p,a[d].x,a[d].y),n.style.opacity="0.3"}var g=n.getContext("2d").getImageData(0,0,this.availableSize.width,s.y);o.getContext("2d").putImageData(g,0,0);var c=n.getContext("2d").getImageData(0,r,this.availableSize.width,this.availableSize.height-r);o.getContext("2d").putImageData(c,0,s.y+s.height);var u=n.getContext("2d").getImageData(h,0,this.availableSize.width-h,this.availableSize.height);o.getContext("2d").putImageData(u,h,0);var m=n.getContext("2d").getImageData(0,0,s.x,this.availableSize.height);o.getContext("2d").putImageData(m,0,0),C(this.element.id+"_selectedCells")}}else if(0!==this.multiCellCollection.length){for(var y=document.getElementById(this.element.id+"_Container_RectGroup"),v=document.getElementById(this.element.id+"_Container_TextGroup"),d=0;d<y.childNodes.length;d++)y.childNodes[d].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&v.childNodes[d]&&v.childNodes[d].setAttribute("opacity","0.3");for(d=0;d<this.multiCellCollection.length;d++){var x=this.multiCellCollection[d].cellElement.id.replace(this.element.id+"_HeatMapRect_",""),b=parseInt(x,10);if(y.childNodes[b].setAttribute("opacity","1"),this.cellSettings.showLabel&&v.childNodes[d]){var f=document.getElementById(this.element.id+"_HeatMapRectLabels_"+b);f&&f.setAttribute("opacity","1"),this.addSvgClass(y.childNodes[b])}}}},l.prototype.clearSVGSelection=function(){for(var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<e.childNodes.length;i++){var l=e.childNodes[i].getAttribute("class");l===this.element.id+"_selected"&&this.removeSvgClass(e.childNodes[i],l),e.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","1")}},l.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 a=e[l].length;i=i>a?i:a}this.axisCollections[0].maxLength=t,this.axisCollections[1].maxLength=i-1}else this.axisCollections[0].maxLength=0,this.axisCollections[1].maxLength=0},l.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)},l.prototype.triggerClickEvent=function(e,t,i){var l,a,n,o=this.element.getBoundingClientRect();if("touchstart"===e.type?(t||(this.isTouch=!0),a=(n=e).changedTouches[0].clientY,l=n.changedTouches[0].clientX):(t||(this.isTouch=!1),a=e.clientY,l=e.clientX),l-=o.left,a-=o.top,this.isHeatmapRect(l,a)){var s=this.heatMapSeries.getCurrentRect(l,a);this.trigger(t?"cellDoubleClick":"cellClick",{heatmap:this,value:s.value,x:s.x,y:s.y,xLabel:this.heatMapSeries.hoverXAxisLabel,yLabel:this.heatMapSeries.hoverYAxisLabel,xValue:this.heatMapSeries.hoverXAxisValue,yValue:this.heatMapSeries.hoverYAxisValue,cellElement:this.enableCanvasRendering?null:document.getElementById(s.id),hasRightClicked:i,event:e})}return{x:l,y:a}},l.prototype.heatMapMouseRightClick=function(e){this.triggerClickEvent(e,!1,!0)},l.prototype.heatMapMouseDoubleClick=function(e){this.triggerClickEvent(e,!0,!1)},l.prototype.heatMapMouseClick=function(e){var i=this.triggerClickEvent(e,!1,!1),l=i.x,a=i.y;if(this.notify("click",e),this.isHeatmapRect(l,a)&&this.currentRect){var n=document.getElementById(this.currentRect.id);t.isNullOrUndefined(n)||n.focus()}if("Gradient"!==this.paletteSettings.type&&this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType){var o=this.legendModule.navigationCollections;o.length&&l>o[0].x&&l<o[0].x+o[0].width&&a>o[0].y&&a<o[0].y+o[0].height?this.legendModule.translatePage(this,this.legendModule.currentPage,!0):o.length&&l>o[1].x&&l<o[1].x+o[1].width&&a>o[1].y&&a<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&&l>=s[d].x&&l<=s[d].width+s[d].x&&a>=s[d].y&&a<=s[d].y+s[d].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&l>=r[d].x&&l<=r[d].width+r[d].x&&a>=r[d].y&&a<=r[d].y+r[d].height)&&(this.legendModule.legendRangeSelection(d),h=!1)}return!1},l.prototype.heatMapMouseMove=function(e){var t,i,l,a=this.element.getBoundingClientRect();return"touchmove"===e.type||"touchstart"===e.type?(this.isTouch=!0,t=(l=e).changedTouches[0].clientX,i=l.changedTouches[0].clientY):(this.isTouch=!1,t=e.clientX,i=e.clientY),this.removeFocus("none"),t-=a.left,i-=a.top,this.setMouseXY(t,i),this.mouseAction(e,t,i,l,a),!0},l.prototype.mouseAction=function(e,i,l,a,n){var o;if(e.target&&e.target.id){var s=this.isHeatmapRect(i,l);this.legendModule&&(s?"Gradient"===this.paletteSettings.type&&this.legendSettings.showGradientPointer&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderGradientPointer(e,i,l):this.legendModule.removeGradientPointer(),this.renderMousePointer(i,l));var r=void 0,h=void 0;if(r=!(!this.showTooltip||!this.tooltipModule)&&s,s&&(h=this.heatMapSeries.getCurrentRect(i,l),2!==e.which&&3!==e.which&&(r=this.cellSelectionOnMouseMove(e,h,i,l,r))),this.tooltipOnMouseMove(e,h,r,s),this.legendModule&&this.legendSettings.visible&&"Fixed"===this.paletteSettings.type&&this.legendSettings.enableSmartLegend&&"None"===this.legendSettings.labelDisplayType&&this.legendModule.createTooltip(i,l),this.enableCanvasRendering){this.element.getBoundingClientRect();var d="Fixed"!==this.paletteSettings.type||!this.legendSettings.enableSmartLegend||"None"!==this.legendSettings.labelDisplayType;(o=T(this.tooltipCollection,i,l)||this.legendModule&&d&&(!t.isNullOrUndefined(this.legendModule.legendLabelTooltip)&&T(this.legendModule.legendLabelTooltip,i,l)||!t.isNullOrUndefined(this.legendModule.legendTitleTooltip)&&T(this.legendModule.legendTitleTooltip,i,l)))?S(o,i,l,this.element.offsetWidth,this.element.id+"_canvas_Tooltip",w(this.element.id+"_Secondary_Element"),this.isTouch,this):C(this.element.id+"_canvas_Tooltip")}else this.titleSettings.text&&"Trim"===this.titleSettings.textStyle.textOverflow&&this.titleTooltip(e,i,l,this.isTouch),this.axisTooltip(e,i,l,this.isTouch),this.legendModule&&this.legendSettings.visible&&this.legendSettings.showLabel&&this.legendVisibilityByCellType&&this.legendModule.renderLegendLabelTooltip(e,i,l),this.legendModule&&this.legendSettings.visible&&this.legendVisibilityByCellType&&this.legendModule.renderLegendTitleTooltip(e,i,l)}return!0},l.prototype.cellSelectionOnMouseMove=function(e,t,i,l,a){return("Rect"===this.cellSettings.tileType&&"mousedown"===e.type||"touchstart"===e.type||"pointerdown"===e.type)&&this.allowSelection&&(this.previousRect=t,this.multiSelection=!0,this.rectSelected=!0,this.initialCellX=i,this.initialCellY=l,e.preventDefault()),"Rect"===this.cellSettings.tileType&&this.multiSelection&&t&&(a=!1,this.highlightSelectedCells(this.previousRect,t,i,l,e)),a},l.prototype.tooltipOnMouseMove=function(e,i,l,a){var n=this;if(l&&i){if(this.tempTooltipRectId!==i.id){if(this.showTooltip){(this.cellSettings.enableCellHighlighting||this.tooltipModule&&this.showTooltip)&&!this.enableCanvasRendering&&this.heatMapSeries.highlightSvgRect(i.id),!this.tooltipTimer||t.isNullOrUndefined(e)||"touchstart"!==e.type&&"touchmove"!==e.type||(window.clearTimeout(this.tooltipTimer),this.tooltipTimer=null),this.tooltipModule.renderTooltip(i);var o=this.tooltipModule.tooltipObject;this.isTouch&&(this.tooltipTimer=setTimeout(function(){t.isNullOrUndefined(o)||t.isNullOrUndefined(document.getElementById(o.element.id))||t.isNullOrUndefined(document.getElementById(o.element.id).firstChild)||o.fadeOut(),n.tooltipModule.isFadeout=!0,window.clearTimeout(n.tooltipTimer),n.tooltipTimer=null},1500),e&&"touchmove"===e.type&&e.cancelable&&e.preventDefault())}this.tempTooltipRectId=i.id}}else{if(null!==e){a?!this.showTooltip&&this.cellSettings.border.width>5&&this.heatMapSeries.highlightSvgRect(e.target.id):((this.cellSettings.enableCellHighlighting||this.showTooltip)&&!this.enableCanvasRendering&&this.cellSettings.border.width<5&&this.heatMapSeries.highlightSvgRect(e.target.id),this.tooltipModule&&this.showTooltip&&this.tooltipModule.showHideTooltip(!1,!0))}this.tempTooltipRectId=""}},l.prototype.highlightSelectedCells=function(e,t,i,l,a){var n=e.xIndex,o=e.yIndex,s=t.xIndex,r=t.yIndex;this.currentRect=t,this.selectedCellsRect=new pe(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-s:s-n))*t.width,this.selectedCellsRect.height=(1+(e.y>t.y?o-r:r-o))*t.height,"touchstart"!==a.type||0!==this.multiCellCollection.length||this.isCellTapHold?this.isCellTapHold=!1:this.isCellTapHold=!0,a.preventDefault();var h=this.initialCellX>i?i:this.initialCellX,d=this.initialCellY>l?l:this.initialCellY,p=new pe(h-this.initialClipRect.x,d-this.initialClipRect.y,Math.abs(i-this.initialCellX),Math.abs(l-this.initialCellY));if(p.width>0&&this.enableMultiSelect&&!1===a.ctrlKey){this.removeSelectedCellsBorder(!1);var g=document.getElementById(this.element.id+"Celltooltipcontainer_svg");g&&(this.tooltipModule.tooltipObject=null,g.setAttribute("opacity","0"))}var c=document.getElementById(this.element.id+"_CellSelection_Container"),u=this.renderer.createSvg({id:this.element.id+"_CellSelection_Container_svg",width:this.initialClipRect.width,height:this.initialClipRect.height});c.appendChild(u);var m=document.getElementById(this.element.id+"_CellSelection_Container_svg");if(this.enableMultiSelect){var y=new he(this.element.id+"_selectedCells","#87ceeb",{color:"transparent",width:1},1,p,"#0000ff");m.appendChild(this.renderer.drawRectangle(y)),document.getElementById(this.element.id+"_selectedCells").style.opacity="0.5"}},l.prototype.getDataCollection=function(){if(!t.isNullOrUndefined(this.previousRect)&&!t.isNullOrUndefined(this.currentRect)){var e=this.previousRect.xIndex,i=this.previousRect.yIndex,l=this.currentRect.xIndex,a=this.currentRect.yIndex,n=l>e?e:l,o=l>e?l:e,s=a>i?i:a,r=a>i?a:i,h=n,d=s,p=this.previousRect.x,g=this.previousRect.y;this.getCellCollection(this.currentRect,this.previousRect,!0,h,d,o,r,n,p,g),h=n,d=s,p=this.previousRect.x,g=this.previousRect.y,this.checkSelectedCells(),this.getCellCollection(this.currentRect,this.previousRect,!1,h,d,o,r,n,p,g),this.selectedMultiCellCollection=[],this.canvasSelectedCells=new pe(0,0,0,0),this.selectedCellCount=0}},l.prototype.getCellCollection=function(e,t,i,l,a,n,o,s,r,h){for(var d=Math.abs(e.xIndex===t.xIndex?0:e.xIndex-t.xIndex)+1,p=Math.abs(e.yIndex===t.yIndex?0:e.yIndex-t.yIndex)+1,g=0;g<d*p;g++)i?this.getSelectedCellData(r,h,!0):this.getSelectedCellData(r,h,!1),l<n?(r+=e.xIndex>t.xIndex?e.width:-e.width,l++):a<o&&(h+=e.yIndex>t.yIndex?e.height:-e.height,r=t.x,l=s)},l.prototype.removeSelectedCellsBorder=function(e){if(this.enableCanvasRendering){for(var t=this.secondaryCanvasRenderer.ctx,i=0;i<this.previousSelectedCellsRect.length;i++){var l=this.previousSelectedCellsRect[i];t.save(),t.clearRect(l.x-1,l.y-1,l.width+2,l.height+2),t.restore()}for(i=0;i<this.multiCellCollection.length;i++){var a=this.multiCellCollection[i];this.multiCellCollection.length>0&&(t.save(),t.clearRect(a.x-1,a.y-1,a.width+2,a.height+2))}}else for(var n=document.getElementById(this.element.id+"_Container_RectGroup"),o=document.getElementById(this.element.id+"_Container_TextGroup"),i=0;i<n.childNodes.length;i++){var s=n.childNodes[i].getAttribute("class");e?(n.childNodes[i].setAttribute("opacity","1"),this.cellSettings.showLabel&&o.childNodes[i]&&(o.childNodes[i].setAttribute("opacity","1"),this.removeSvgClass(n.childNodes[i],s))):(n.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&o.childNodes[i]&&(o.childNodes[i].setAttribute("opacity","0.3"),this.removeSvgClass(n.childNodes[i],s)))}},l.prototype.highlightSelectedAreaInCanvas=function(e){if(e.x){var t=document.getElementById(this.element.id+"_canvas"),i=document.getElementById(this.element.id+"_secondary_canvas"),l=this.initialClipRect,a=t.getContext("2d").getImageData(e.x,e.y,e.width,e.height);i.getContext("2d").putImageData(a,e.x,e.y),t.style.opacity="0.3";var n=t.getContext("2d").getImageData(0,0,this.availableSize.width,l.y);i.getContext("2d").putImageData(n,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)}},l.prototype.getSelectedCellData=function(e,i,l){var a=this.axisCollections[0],n=this.axisCollections[1],o=a.tooltipLabels,s=n.tooltipLabels.slice().reverse(),r=this.heatMapSeries.getCurrentRect(e+1,i+1),h=document.getElementById(r.id),d=new re(null,"","",0,0,null,0,0,0,0,0,0);if(d.value=r.value,d.xLabel=o[r.xIndex].toString(),d.yLabel=s[r.yIndex].toString(),d.xValue=a.labelValue[r.xIndex],d.yValue=n.labelValue.slice().reverse()[r.yIndex],d.cellElement=this.enableCanvasRendering?null:h,d.xPosition=r.xIndex,d.yPosition=r.yIndex,d.width=this.currentRect.width,d.height=this.currentRect.height,d.x=this.currentRect.x,d.y=this.currentRect.y,this.currentRect.allowCollection=!0,this.addSvgClass(h),l)this.selectedMultiCellCollection.push(d),this.currentRect.allowCollection=!1;else for(var p=0;p<this.multiCellCollection.length;p++)if(this.multiCellCollection[p].xPosition===d.xPosition&&this.multiCellCollection[p].yPosition===d.yPosition&&(this.currentRect.allowCollection=!1,this.selectedCellCount===this.selectedMultiCellCollection.length)){if(this.currentRect.allowCollection=!1,this.enableCanvasRendering){var g=this.secondaryCanvasRenderer.ctx,c=this.canvasSelectedCells;g.save(),g.clearRect(c.x-1,c.y-1,c.width+2,c.height+2),g.restore(),this.selectedCellsRect=new pe(0,0,0,0)}else for(var u=0;u<this.selectedMultiCellCollection.length;u++){var m=this.selectedMultiCellCollection[u].cellElement;if(m){var y=m.id.replace(this.element.id+"_HeatMapRect_",""),v=(document.getElementById(this.element.id+"_Container_TextGroup"),m.getAttribute("class"));m.setAttribute("opacity","0.3");var x=document.getElementById(this.element.id+"_HeatMapRectLabels_"+y);x&&x.setAttribute("opacity","0.3"),this.removeSvgClass(m,v)}}this.multiCellCollection.splice(p,1)}r.visible&&!t.isNullOrUndefined(r.value)&&!0===this.currentRect.allowCollection&&this.multiCellCollection.push(d)},l.prototype.addSvgClass=function(e){if(!this.enableCanvasRendering){var t=this.element.id+"_selected";e.classList.add(t)}},l.prototype.removeSvgClass=function(e,t){t&&e.setAttribute("class",t.replace(t,""))},l.prototype.clearSelection=function(){if(!this.enableCanvasRendering&&this.allowSelection&&this.clearSVGSelection(),this.enableCanvasRendering){for(var e=this.secondaryCanvasRenderer.ctx,t=0;t<this.previousSelectedCellsRect.length;t++)e.save(),e.clearRect(this.previousSelectedCellsRect[t].x-1,this.previousSelectedCellsRect[t].y-1,this.previousSelectedCellsRect[t].width+2,this.previousSelectedCellsRect[t].height+2),e.restore();for(t=0;t<this.multiCellCollection.length;t++){var i=this.multiCellCollection[t];this.multiCellCollection.length>0&&(e.save(),e.clearRect(i.x-1,i.y-1,i.width+2,i.height+2))}document.getElementById(this.element.id+"_canvas").style.opacity="1"}this.tempMultiCellCollection=[],this.multiCellCollection=[],this.rectSelected=!1},l.prototype.renderMousePointer=function(e,i){for(var l=this.legendModule.legendRange,a=this.legendModule.legendTextRange,n=!0,o=0;o<l.length;o++)if(this.legendSettings.toggleVisibility&&this.legendModule.currentPage===l[o].currentPage)if(n&&e>=l[o].x&&e<=l[o].width+l[o].x&&i>=l[o].y&&i<=l[o].y+l[o].height||this.legendSettings.showLabel&&"None"!==this.legendSettings.labelDisplayType&&e>=a[o].x&&e<=a[o].width+a[o].x&&i>=a[o].y&&i<=a[o].y+a[o].height){if(this.enableCanvasRendering)document.getElementById(this.element.id+"_canvas").style.cursor="Pointer";else{document.getElementById(this.element.id+"_svg").style.cursor="Pointer";var s=document.getElementById(this.element.id+"legendLabelTooltipContainer");t.isNullOrUndefined(s)||(s.style.cursor="Pointer")}n=!1}else n&&(this.enableCanvasRendering?document.getElementById(this.element.id+"_canvas").style.cursor="":document.getElementById(this.element.id+"_svg").style.cursor="")},l.prototype.heatMapMouseLeave=function(e){var i=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&&(this.multiSelection=!1,("mouseup"===e.type||"mouseleave"===e.type||"touchend"===e.type||"pointerup"===e.type)&&2!==e.which&&3!==e.which))if(!1===this.isCellTapHold){var l=void 0,a=document.getElementById(this.element.id+"_selectedCells");if(t.isNullOrUndefined(a)){var n=void 0,o=void 0,s=void 0,r=this.element.getBoundingClientRect();"touchend"===e.type?(this.isTouch=!0,o=(s=e).changedTouches[0].clientY,n=s.changedTouches[0].clientX):(this.isTouch=!1,o=e.clientY,n=e.clientX),n-=r.left,o-=r.top;var h=this.initialCellX>n?n:this.initialCellX,d=this.initialCellY>o?o:this.initialCellY;l=new pe(h-this.initialClipRect.x,d-this.initialClipRect.y,0!==Math.abs(n-this.initialCellX)?Math.abs(n-this.initialCellX):Math.abs(o-this.initialCellY),Math.abs(o-this.initialCellY))}else{var p=a.getClientRects()[0];l=new pe(p.left,p.top,p.width,p.height)}if(!(l.width>0)||this.enableMultiSelect){for(var g=[],c=0;c<this.multiCellCollection.length;c++)g.push(this.multiCellCollection[c]);!1!==e.ctrlKey&&this.enableMultiSelect||(this.multiCellCollection=[]),this.getDataCollection();var u={heatmap:this,cancel:!1,name:"cellSelected",data:this.multiCellCollection};this.trigger("cellSelected",u),u.cancel?(this.multiCellCollection=g,(this.multiCellCollection.length>0||!1===e.ctrlKey||!this.enableMultiSelect)&&this.removeSelectedCellsBorder(!0)):(!1!==e.ctrlKey&&this.enableMultiSelect||this.removeSelectedCellsBorder(!1),this.currentRect.allowCollection=!1),this.setCellOpacity(),"touchend"===e.type&&(window.clearTimeout(this.tooltipTimer),this.tooltipOnMouseMove(null,this.currentRect,!0))}}else this.isCellTapHold=!1;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 m=this.legendModule.tooltipObject.element.firstChild;"mouseleave"===e.type?m.setAttribute("opacity","0"):(this.legendTooltipTimer&&window.clearTimeout(this.legendTooltipTimer),this.legendTooltipTimer=setTimeout(function(){m.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(){i.legendModule.removeGradientPointer()},1500))),this.enableCanvasRendering){var y=document.getElementById(this.element.id+"_hoverRect_canvas");y&&(y.style.visibility="hidden",this.tempRectHoverClass="")}return this.titleSettings.text&&-1!==this.titleCollection[0].indexOf("...")&&(e.cancelable&&e.preventDefault(),this.isTouch||C(this.enableCanvasRendering?this.element.id+"_canvas_Tooltip":this.element.id+"_Title_Tooltip")),!0},l.prototype.heatMapKeyUp=function(e){if("Tab"===e.code){this.removeFocus("none"),this.tooltipModule&&this.tooltipModule.showHideTooltip(!1);var t=e.target,i=t.id.indexOf("HeatMapRect")>-1,l=t.id.indexOf("Legend")>-1;!this.cellSettings.enableCellHighlighting||l||this.rectSelected?(i&&this.allowSelection||l&&this.legendSettings.toggleVisibility||t.id.indexOf("arrow")>-1)&&(t.style.outline="2px solid black",t.classList.add("keyboard-focused")):this.heatMapSeries.highlightSvgRect(t.id)}},l.prototype.heatMapKeyDown=function(e){if("Enter"===e.code){e.ctrlKey||(this.multiCellCollection=[]),this.removeFocus("none");var i=e.target;if(this.allowSelection&&i.id.indexOf("HeatMapRect")>-1&&"Rect"===this.cellSettings.tileType)this.previousRect=this.currentRect=this.getRectElement(i.id),this.removeSelectedCellsBorder(!1),this.getDataCollection(),this.setCellOpacity(),this.rectSelected=!0;else if(this.legendModule&&this.legendSettings.visible){var l=this.calculateLegendIndex(i);t.isNullOrUndefined(l)||this.legendModule.legendRangeSelection(l),i=document.getElementById(i.id),this.handleArrowNavigation(i),i.setAttribute("tabindex","0"),i.focus()}}},l.prototype.calculateLegendIndex=function(e){if(this.legendSettings.toggleVisibility){if(e.id.indexOf("Legend_Index")>-1)return parseFloat(e.id.split("Legend_Index_")[1]);if(e.id.indexOf("_Smart_Legend_Group_")>-1)return parseFloat(e.id.split("_Smart_Legend_Group_")[1])}return null},l.prototype.handleArrowNavigation=function(e){if(e.id.indexOf("arrow")>-1){var t=this.legendModule.currentPage,i=this.legendColorCollection.length/this.legendModule.listPerPage;t<i&&e.id.indexOf("rightarrow")>-1?this.legendModule.translatePage(this,t,!0):t<=i&&e.id.indexOf("leftarrow")>-1&&this.legendModule.translatePage(this,t,!1)}},l.prototype.getRectElement=function(e){for(var t=this.heatMapSeries.rectPositionCollection,i=0;i<t.length;i++)for(var l=0;l<t[i].length;l++)if(t[i][l].id===e)return t[i][l];return null},l.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},l.prototype.checkSelectedCells=function(){if(this.enableCanvasRendering){this.canvasSelectedCells=new pe(0,0,0,0),this.canvasSelectedCells.x=this.selectedCellsRect.x,this.canvasSelectedCells.y=this.selectedCellsRect.y,this.canvasSelectedCells.width=this.selectedCellsRect.width,this.canvasSelectedCells.height=this.selectedCellsRect.height;for(e=0;e<this.multiCellCollection.length;e++)for(t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].xPosition===this.multiCellCollection[e].xPosition&&this.selectedMultiCellCollection[t].yPosition===this.multiCellCollection[e].yPosition&&this.selectedCellCount++;this.legendModule&&this.rectSelected&&"Gradient"===this.paletteSettings.type&&this.legendModule.removeGradientPointer()}else for(var e=0;e<this.multiCellCollection.length;e++)for(var t=0;t<this.selectedMultiCellCollection.length;t++)this.selectedMultiCellCollection[t].cellElement.getAttribute("id")===this.multiCellCollection[e].cellElement.getAttribute("id")&&this.selectedCellCount++},l.prototype.removeOpacity=function(e,t){for(var i=0;i<e.childNodes.length;i++)e.childNodes[i].setAttribute("opacity","0.3"),this.cellSettings.showLabel&&t.childNodes[i]&&t.childNodes[i].setAttribute("opacity","0.3")},l.prototype.setCellOpacity=function(){if(this.enableCanvasRendering)this.previousSelectedCellsRect.push(this.selectedCellsRect),this.highlightSelectedAreaInCanvas(this.selectedCellsRect);else if(0!==this.multiCellCollection.length){this.tempMultiCellCollection.push(this.multiCellCollection);var e=document.getElementById(this.element.id+"_Container_RectGroup"),t=document.getElementById(this.element.id+"_Container_TextGroup");this.removeOpacity(e,t);for(var i=0;i<this.multiCellCollection.length;i++){var l=this.multiCellCollection[i].cellElement,a=parseInt(l.id.replace(this.element.id+"_HeatMapRect_",""),10);if(e.childNodes[a].setAttribute("opacity","1"),e.childNodes[a].setAttribute("tabindex","0"),this.cellSettings.showLabel){var n=document.getElementById(this.element.id+"_HeatMapRectLabels_"+a);n&&n.setAttribute("opacity","1")}}}C(this.element.id+"_selectedCells")},l.prototype.createMultiCellDiv=function(e){if(e){var i=this.createElement("div",{id:this.element.id+"_Multi_CellSelection_Canvas"});i.style.position="relative",this.element.appendChild(i),this.svgObject.style.position="absolute",this.svgObject.style.left="0px",this.svgObject.style.top="0px",this.svgObject.style.zIndex="0"}else{var l=void 0;l=document.getElementById(this.element.id+"_secondary_canvas"),t.isNullOrUndefined(l)&&(l=this.secondaryCanvasRenderer.createCanvas({width:this.availableSize.width,height:this.availableSize.height,x:0,y:0})),l.style.cssText="position: relative; z-index: 1",this.element.appendChild(l)}},$e([t.Property(null)],l.prototype,"width",void 0),$e([t.Property(null)],l.prototype,"height",void 0),$e([t.Property(!0)],l.prototype,"showTooltip",void 0),$e([t.Event()],l.prototype,"tooltipRender",void 0),$e([t.Event()],l.prototype,"resized",void 0),$e([t.Event()],l.prototype,"loaded",void 0),$e([t.Event()],l.prototype,"cellRender",void 0),$e([t.Event()],l.prototype,"cellSelected",void 0),$e([t.Property("SVG")],l.prototype,"renderingMode",void 0),$e([t.Property(null)],l.prototype,"dataSource",void 0),$e([t.Complex({},Xe)],l.prototype,"dataSourceSettings",void 0),$e([t.Property(null)],l.prototype,"backgroundColor",void 0),$e([t.Property("Material")],l.prototype,"theme",void 0),$e([t.Property(!1)],l.prototype,"allowSelection",void 0),$e([t.Property(!0)],l.prototype,"enableMultiSelect",void 0),$e([t.Property(!1)],l.prototype,"enableHtmlSanitizer",void 0),$e([t.Complex({},E)],l.prototype,"margin",void 0),$e([t.Complex({text:"",textStyle:A.heatMapTitleFont},H)],l.prototype,"titleSettings",void 0),$e([t.Complex({},Pe)],l.prototype,"xAxis",void 0),$e([t.Complex({position:"Right"},Ue)],l.prototype,"legendSettings",void 0),$e([t.Complex({},Q)],l.prototype,"paletteSettings",void 0),$e([t.Complex({},Be)],l.prototype,"tooltipSettings",void 0),$e([t.Complex({},Pe)],l.prototype,"yAxis",void 0),$e([t.Complex({},Ie)],l.prototype,"cellSettings",void 0),$e([t.Event()],l.prototype,"created",void 0),$e([t.Event()],l.prototype,"load",void 0),$e([t.Event()],l.prototype,"cellClick",void 0),$e([t.Event()],l.prototype,"cellDoubleClick",void 0),$e([t.Event()],l.prototype,"legendRender",void 0),l=$e([t.NotifyPropertyChanges],l)}(t.Component);return Qe.Inject(We,Ne,Ke),e.AdaptiveMinMax=Je,e.Adaptor=Ke,e.Axis=Pe,e.AxisHelper=De,e.AxisLabelBorder=U,e.Border=_,e.BubbleData=N,e.BubbleSize=W,e.BubbleTooltipData=J,e.CanvasTooltip=Se,e.CellColor=te,e.CellSettings=Ie,e.CircleOption=de,e.ColorCollection=X,e.CurrentLegendRect=we,e.CurrentRect=se,e.CustomizeOption=ne,e.Data=Xe,e.DrawSvgCanvas=xe,e.ExportUtils=qe,e.FillColor=k,e.Font=V,e.Gradient=be,e.GradientColor=fe,e.GradientPointer=Me,e.HeatMap=Qe,e.Legend=We,e.LegendColorCollection=K,e.LegendRange=Le,e.LegendSettings=Ue,e.Line=ue,e.LineOption=me,e.Margin=E,e.MultiLevelCategories=j,e.MultiLevelLabels=Y,e.MultiLevelPosition=Re,e.MultipleRow=q,e.PaletteCollection=G,e.PaletteSettings=Q,e.PaletterColor=Ce,e.Path=ve,e.PathAttributes=ye,e.PathOption=oe,e.Rect=pe,e.RectOption=he,e.RgbColor=ee,e.SelectedCellDetails=re,e.Series=Ve,e.Size=ae,e.TextBasic=ce,e.TextElement=le,e.TextOption=ge,e.Title=H,e.ToggleVisibility=Te,e.Tooltip=Ne,e.TooltipBorder=B,e.TooltipSettings=Be,e.TwoDimensional=He,e.colorNameToHex=R,e.componentToHex=z,e.convertElement=p,e.convertHexToColor=P,e.convertToHexCode=O,e.createLabelTemplate=h,e.formatValue=D,e.getElement=w,e.getIsLineBreakLabel=v,e.getSanitizedTexts=y,e.getTemplateFunction=d,e.getTitle=m,e.getTooltipText=T,e.increaseDateTimeInterval=L,e.measureText=s,e.removeElement=C,e.removeMeasureElement=M,e.rotateTextSize=u,e.showTooltip=S,e.stringToNumber=o,e.sum=g,e.textNone=f,e.textTrim=b,e.textWrap=x,e.titlePositionX=r,e.titlePositionY=c,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport),this.ejs=ej;
//# sourceMappingURL=ej2-heatmap.min.js.map