@syncfusion/ej2-treemap 20.1.55 → 20.2.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,13 +8,13 @@
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## 18.2.44 (2020-07-07)
12
+
11
13
  ### TreeMap
12
14
 
13
15
  #### Bug Fixes
14
16
 
15
- - `#I377352` - The samples in the TreeMap sample browser can now be edited in the StackBlitz.
16
-
17
- ## 18.2.44 (2020-07-07)
17
+ - `#F175858` - The TreeMap's title will now accept the provided font family.
18
18
 
19
19
  ### TreeMap
20
20
 
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-treemap.umd.min.js
3
- * version : 20.1.55
3
+ * version : 20.2.38
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,t,i,r,o){"use strict";function l(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function n(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=e,r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new He(r.clientWidth,r.clientHeight)}function a(e,t,i){var r=t,o=n(t,i).width;if(o>e)for(var l=t.length-1;l>=0;--l)if(r=t.substring(0,l)+"...",(o=n(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function s(e,t,i,r){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var l="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Ve(o,l)}function h(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function d(e,r,o,l,a){void 0===a&&(a=!1);var s,d,p,c={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},g="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],u=new i.SvgRenderer("");if(!t.isNullOrUndefined(g)&&!t.isNullOrUndefined(e.connectorText)&&g.search(e.connectorText[1])>=0)for(var m=g.split("#"),f=0;f<m.length;f++){var y=-1===m[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?m[f]:e.connectorText;if(c.id=e.id+"_"+f,p=h(u,c,y),f%2==0&&0!==f){y=y.replace(/\s+/g,"&nbsp")}var v=n(y,r);c.x=0!==f?c.x+v.width:c.x+v.width+5,l.appendChild(p)}else p=h(u,c,g),l.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,x=e.text.length;b<x;b++)d=n(e.text[b],r).height,s=u.createTSpan({x:e.x,id:e.id,y:e.y+b*d},e.text[b]),p.appendChild(s);l.appendChild(p)}return p}function p(e,i,r){var o,l=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+l+"_LabelTemplate"),t.isNullOrUndefined(o)||(o.innerHTML=r)}function c(e){return document.getElementById(e)}function g(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function u(e,t,i,r){for(var o=!1,l="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(l+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function m(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function f(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var o=m(e).values;if(o&&o.length>0){for(var l=0;l<o.length;l++)-1===t.indexOf(o[l].levelOrderName)&&t.push(o[l].levelOrderName);for(var n=0;n<o.length;n++)f(o[n],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,r));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(l=0;l<r.layout.renderItems.length;l++)(s=r.layout.renderItems[l]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function y(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function v(e,i,r){for(var o=t.createElement("div",{id:i,styles:"position: absolute;pointer-events: auto;"}),l=e.length;l>0;)o.appendChild(e[0]),l--;for(var n=o.innerHTML,a=Object.keys(r),s=0;s<a.length;s++)n=n.replace(new RegExp("{{:"+a[s]+"}}","g"),r[a[s].toString()]);return o.innerHTML=n,o}function b(e,t,i,r,o){var l=new Ve(0,0),n=(o.element.getBoundingClientRect(),"Template"===r?o.areaRect.x:0),a="Template"===r?o.areaRect.y:0;return l.x=Math.abs(n-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?l.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):l.y=Math.abs(e.y+e.height-i.height+5),l}function x(e,t){var i=new He(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function S(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=I(e),i=t.width,r=t.height;return Math.min(i,r)}function I(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function O(e,t,i){var r=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,l=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+o-a,h=r.top+l-n;return new Ve(e-s,t-h)}function L(e,i,r,o){var l,n,a=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&isNaN(r))return null;for(var s=0;s<e.length;s++){var h=!1,d=r;t.isNullOrUndefined(e[s].from)||t.isNullOrUndefined(e[s].to)||t.isNullOrUndefined(e[s].value)?(t.isNullOrUndefined(e[s].from)||t.isNullOrUndefined(e[s].to))&&t.isNullOrUndefined(e[s].value)||(r>=e[s].from&&e[s].to>=r||e[s].value===i)&&(e[s].value===i&&(h=!0),l="[object Array]"===Object.prototype.toString.call(e[s].color)?h?e[s].color[0]:P(e[s],d):e[s].color):r>=e[s].from&&e[s].to>=r&&e[s].value===i&&(h=!0,l="[object Array]"===Object.prototype.toString.call(e[s].color)?h?e[s].color[0]:P(e[s],d):e[s].color),(r>=e[s].from&&r<=e[s].to||e[s].value===i)&&!t.isNullOrUndefined(e[s].minOpacity)&&!t.isNullOrUndefined(e[s].maxOpacity)&&l&&(n=M(o,e[s],l,r)),(""===l||t.isNullOrUndefined(l))&&t.isNullOrUndefined(e[s].from)&&t.isNullOrUndefined(e[s].to)&&t.isNullOrUndefined(e[s].minOpacity)&&t.isNullOrUndefined(e[s].maxOpacity)&&t.isNullOrUndefined(e[s].value)&&(l="[object Array]"===Object.prototype.toString.call(e[s].color)?e[s].color[0]:e[s].color),n=t.isNullOrUndefined(n)?"1":n,a.push(l)}for(var p=a.length-1;p>=0;p--)p=(l=a[p])?-1:p;return{fill:l,opacity:n}}function M(e,t,i,r){var o=1;if(r>=t.from&&r<=t.to){o=(r-t.from)/(t.to-t.from)*(t.maxOpacity-t.minOpacity)+t.minOpacity}return o.toString()}function P(e,t){return T(e,t)}function N(e,t,i){return"#"+W(e)+W(t)+W(i)}function T(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:N((i=E(Number(t),e)).r,i.g,i.b)}function E(e,t){var i=t.from,r=t.to,o=0,l=r-i;o=(e-i)/l;var n,a;if(t.color.length<=2)n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);else{n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);for(var s=l/(t.color.length-1),h=t.color.length-1,d=[],p={},c=1;c<h;c++)p={b:i+c*s,color:t.color[c]},d.push(p);for(var g=0;g<d.length;g++)i<=e&&e<=d[g].b&&0===g?(a="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),o=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s):d[g].b<=e&&e<=r&&g===d.length-1&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),o=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s),g!==d.length-1&&g<d.length&&d[g].b<=e&&e<=d[g+1].b&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),a="#"===d[g+1].color.charAt(0)?d[g+1].color:X(d[g+1].color),o=Math.abs(e-d[g+1].b)/s)}return F(o,n,a)}function F(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],l=D(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),n=D(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),a=D(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ge(l,n,a)}function D(e,t,i){var r=i-t;return Math.round(t+r*e)}function _(e,t,i){for(var r,o=t.split(" "),l="",s=[],h=0,d=o.length;h<d;h++)r=o[h],n(l.concat(r),i).width<e?l=l.concat((""===l?"":" ")+r):""!==l?(s.push(a(e,l,i)),l=r):(s.push(a(e,r,i)),r=""),l&&h===d-1&&s.push(a(e,l,i));return s}function R(e,t,i){var r=[],o=0,l=n(t,i).width,a=t.length;if(e>=l)return r.push(t),r;for(var s=t.length;s>o;s--){var h=t.slice(o,s);if((l=n(h,i).width)<=e){if(r.push(h),o+=h.length,a===o)return r;s=a+1}}return r}function B(e,t,i,r){var o=n(i,r);return o.width>e||o.height>t?" ":i}function U(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function H(e,t,i){var r=e.levelSelection;if(r)for(var o=0;o<r.length;o++)t.getAttribute("id")===r[o]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),z(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function k(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var o=0;o<t.childElementCount;o++)t.childNodes[o].id===i[r]&&(t.childNodes[o].setAttribute("fill",e.selectionSettings.fill),t.childNodes[o].setAttribute("stroke",e.selectionSettings.border.color),t.childNodes[o].setAttribute("stroke-width",e.selectionSettings.border.width.toString()),t.childNodes[o].setAttribute("opacity",e.selectionSettings.opacity))}function A(e,i,r){for(var o,l=0;l<e.length;l++)z(o=t.isNullOrUndefined(e[l].childNodes[0])?e[l]:e[l].childNodes[0],r.layout.renderItems[o.id.split("_")[6]].options),e[l].classList.remove(i),l-=1}function z(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function j(e,i,r){if(t.isNullOrUndefined(e))return null;for(var o=0,l=Object.keys(i);o<l.length;o++){var n=l[o];e=e.split("${"+n+"}").join(V(i[n],r).toString())}return e}function V(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function G(e){return"#"+W(e.r)+W(e.g)+W(e.b)}function W(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ge(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ge(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e,e=window.getComputedStyle(t).color;var i=/^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.exec(e);return G(new Ge(parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)))}function J(e,t,r,o,l,n){var a=new i.SvgRenderer(""),s=Y(e,r,t,l,o),h=a["draw"+s.functionName](s.renderOption);return h.setAttribute("aria-label",n),h}function Y(e,i,r,o,l){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,c=e.x+-s/2,g=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",t.merge(o,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(o,{d:n});break;case"Diamond":n="M "+c+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+c+" "+p+" z",t.merge(o,{d:n});break;case"Rectangle":n="M "+c+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(p+h/2)+" L "+c+" "+(p+-h/2)+" z",t.merge(o,{d:n});break;case"Triangle":n="M "+c+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(p+h/2)+" z",t.merge(o,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",t.merge(o,{d:n});break;case"Pentagon":for(var u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");n=n.concat("Z"),t.merge(o,{d:n});break;case"Star":n="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",t.merge(o,{d:n});break;case"Cross":n="M "+c+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(o,{d:n});break;case"Image":a="Image",t.merge(o,{href:l,height:h,width:s,x:c,y:g})}return{renderOption:o,functionName:a}}function Z(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}function Q(e,t){if(e.length>0)for(var i=0;i<e.length;i++){var r=e[i];K(r.legendEle,r.oldFill,r.oldOpacity,r.oldBorderColor,r.oldBorderWidth)}}function $(e,t){if(e.length>0)for(var i=0;i<e.length;i++){var r=e[i];K(r.legendEle,r.oldFill,r.oldOpacity,r.oldBorderColor,r.oldBorderWidth);for(var o=r.ShapeCollection.Elements.length,l=0;l<o;l++)K(r.ShapeCollection.Elements[l],r.shapeOldFill,r.shapeOldOpacity,r.shapeOldBorderColor,r.shapeOldBorderWidth)}}function K(e,t,i,r,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",o)}function ee(e,t,i){Q(e),A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,t,i){for(var r,o=0;o<e;o++)for(var l=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<l;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){r=o;break}return r}function ie(e,t,i,r,o,l,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:l[i].options.fill,shapeOldOpacity:l[i].options.opacity,shapeOldBorderColor:l[i].options.border.color,shapeOldBorderWidth:l[i].options.border.width})}function re(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function oe(e){var i=document.getElementById(e);return i?t.remove(i):null}function le(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontFamily:"Roboto, Noto, Sans-serif"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Roboto, Noto, Sans-serif"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue"};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"bootstrap5":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#212529",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Helvetica Neue",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"bootstrap5dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#E9ECEF",tooltipFontColor:"#212529",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Helvetica Neue",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#353535",legendTextColor:"#353535",fontFamily:"Roboto, Noto, Sans-serif"}}return t}var ne="beforePrint",ae="itemRendering",se="drillStart",he="drillEnd",de="itemSelected",pe="itemHighlight",ce="tooltipRendering",ge="itemClick",ue="itemMove",me="doubleClick",fe="rightClick",ye="mouseMove",ve="legendItemRendering",be="legendRendering",xe="resize",Se="Roboto, Segoe UI, Noto, Sans-serif",we=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ie=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("#808080")],i.prototype,"color",void 0),Ie([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(10)],i.prototype,"left",void 0),Ie([t.Property(10)],i.prototype,"right",void 0),Ie([t.Property(10)],i.prototype,"top",void 0),Ie([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"size",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(Se)],i.prototype,"fontFamily",void 0),Ie([t.Property("Normal")],i.prototype,"fontWeight",void 0),Ie([t.Property("Normal")],i.prototype,"fontStyle",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("")],i.prototype,"text",void 0),Ie([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({size:"14px"},Le)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),i}(Me),Ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({size:"15px"},Le)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Complex({},Pe)],i.prototype,"subtitleSettings",void 0),i}(Me),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"from",void 0),Ie([t.Property(null)],i.prototype,"to",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(null)],i.prototype,"label",void 0),Ie([t.Property(null)],i.prototype,"value",void 0),Ie([t.Property(null)],i.prototype,"minOpacity",void 0),Ie([t.Property(null)],i.prototype,"maxOpacity",void 0),Ie([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),Ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("Default")],i.prototype,"mode",void 0),Ie([t.Property("transparent")],i.prototype,"background",void 0),Ie([t.Property("Circle")],i.prototype,"shape",void 0),Ie([t.Property("")],i.prototype,"width",void 0),Ie([t.Property("")],i.prototype,"height",void 0),Ie([t.Complex({size:"13px"},Le)],i.prototype,"textStyle",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(15)],i.prototype,"shapeWidth",void 0),Ie([t.Property(15)],i.prototype,"shapeHeight",void 0),Ie([t.Property(10)],i.prototype,"shapePadding",void 0),Ie([t.Property(null)],i.prototype,"imageUrl",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"border",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"shapeBorder",void 0),Ie([t.Complex({},Me)],i.prototype,"title",void 0),Ie([t.Complex({size:"14px"},Le)],i.prototype,"titleStyle",void 0),Ie([t.Property("Bottom")],i.prototype,"position",void 0),Ie([t.Property("None")],i.prototype,"orientation",void 0),Ie([t.Property(!1)],i.prototype,"invertedPointer",void 0),Ie([t.Property("After")],i.prototype,"labelPosition",void 0),Ie([t.Property("None")],i.prototype,"labelDisplayMode",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Property({x:0,y:0})],i.prototype,"location",void 0),Ie([t.Property(null)],i.prototype,"showLegendPath",void 0),Ie([t.Property(null)],i.prototype,"valuePath",void 0),Ie([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupIndex",void 0),Ie([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(0)],i.prototype,"gap",void 0),Ie([t.Property(10)],i.prototype,"padding",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showLabels",void 0),Ie([t.Property(null)],i.prototype,"labelPath",void 0),Ie([t.Property(null)],i.prototype,"labelFormat",void 0),Ie([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),Ie([t.Complex({color:null,size:"12px"},Le)],i.prototype,"labelStyle",void 0),Ie([t.Property(null)],i.prototype,"labelTemplate",void 0),Ie([t.Property("Center")],i.prototype,"templatePosition",void 0),Ie([t.Property("Trim")],i.prototype,"interSectAction",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("")],i.prototype,"template",void 0),Ie([t.Property(null)],i.prototype,"format",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(.75)],i.prototype,"opacity",void 0),Ie([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Complex({fontFamily:Se,size:"13px"},Le)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property("#808080")],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupPath",void 0),Ie([t.Property(0)],i.prototype,"groupGap",void 0),Ie([t.Property(10)],i.prototype,"groupPadding",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showHeader",void 0),Ie([t.Property(20)],i.prototype,"headerHeight",void 0),Ie([t.Property(null)],i.prototype,"headerTemplate",void 0),Ie([t.Property(null)],i.prototype,"headerFormat",void 0),Ie([t.Property("Near")],i.prototype,"headerAlignment",void 0),Ie([t.Complex({color:null,size:"13px"},Le)],i.prototype,"headerStyle",void 0),Ie([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),He=function(){return function(e,t){this.width=e,this.height=t}}(),ke=function(){return function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}}(),Ae=function(){return function(e,t,i,r,o,l){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=l}}(),ze=function(){return function(e,t,i,r,o,l,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=l,this.d=n}}(),je=function(){return function(e,t,i,r,o,l,n,a){void 0===l&&(l=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=l,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a}}(),Ve=function(){return function(e,t){this.x=e,this.y=t}}(),Ge=function(){return function(e,t,i){this.r=e,this.g=t,this.b=i}}(),We=function(){return function(e,t,i,r,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=o}}(),qe=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(Ke.levelsData&&Ke.levelsData.length>0)if(e=t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(t.isNullOrUndefined(this.treemap.drilledItems)?!t.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?Ke.levelsData[0]:this.getDrilldownData(Ke.levelsData[0],[])[0],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),t.isNullOrUndefined(this.treemap.currentLevel)||(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||Ke.levelsData[0],i),this.renderLayoutItems(e||Ke.levelsData[0]);else{var r=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[r].data,l={};l[this.treemap.drilledItems[r].data.groupName]=[o],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(l||Ke.levelsData[0],i),this.renderLayoutItems(l||Ke.levelsData[0])}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},o=m(e).values;if(o&&o.length>0&&0===t.length){for(var l=0;l<o.length;l++)o[l].groupIndex===i.initialDrillDown.groupIndex&&o[l].name===i.initialDrillDown.groupName&&(o[l].isDrilled=!0,r[o[l].groupName]=[o[l]],t.push(r));for(var n=0;n<o.length;n++)this.getDrilldownData(o[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],t.isNullOrUndefined(this.treemap.weightValuePath)||(this.treemap.layoutType.indexOf("SliceAndDice")>-1?this.computeSliceAndDiceDimensional(e,i):(i.height=i.height+i.y,i.width=i.width+i.x,this.computeSquarifyDimensional(e,i)))},e.prototype.computeSliceAndDiceDimensional=function(e,t){var i,r,o,l,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=m(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,o=0===a.length||r===a.length?n.gap:a[r].groupGap,l=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new ke(i.x+o/2,i.y+(l+o/2),i.width-o,Math.abs(i.height-(o+l))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,o=i.height*i.width,l=this.treemap.levels,n=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=o*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(g);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===l.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===l.length-1:d.groupIndex===this.treemap.levels.length),s?(r=o/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new ke(n+i.x,i.y,r,i.height))):(r=o/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new ke(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,o,l,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=m(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)o=(r=h[d]).groupIndex,i=r.rect,l=(r.isLeafItem?a.padding:s[o].groupPadding)/2,n=this.treemap.isHierarchicalData?0===o&&r.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new ke(i.x+l,i.y+(n+l),i.width-l,i.height-l),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,S(i)),t.sort(U),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var o=e.length;if(0===o){var l=this.getCoordinates(t,i);return u=r.concat(l)}var n=w(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,c=0;c<d;c+=1)p+=t[c].itemArea;var g=this.cutArea(i,p),u=(l=this.getCoordinates(t,i),r.concat(l));return this.performRowsLayout(e,[],g,u)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,o=-1/0,l=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>o&&(o=a),l+=a}return Math.max(Math.pow(t,2)*o/Math.pow(l,2),Math.pow(l,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=I(e),r=i.width,o=i.height,l=i.x,n=i.y;if(r>=o){var a=t/o;return C({x:l+a,y:n,width:r-a,height:o})}var s=t/r;return C({x:l,y:n+s,width:r,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var r,o=I(i),l=o.width,n=o.height,a=o.x,s=o.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,c=0,g=0;g<h;g+=1)c+=e[g].itemArea;var u,m,f,y=c/n,v=c/l,b=a,x=s,S=[];for(g=0;g<h;g+=1){var w=e[g];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData?r===d.length:!t.isNullOrUndefined(p.labelPath)&&r===d.length),m=Z(this.parentData[0],w),f=m?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,l>=n){var C=x+w.itemArea/y;w.rect={x:b,y:x,width:b+y,height:C},x=C}else{var O=b+w.itemArea/v;w.rect={x:b,y:x,width:O,height:x+v},b=O}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),S.push(w))}return S},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],o=0;o<i;o+=1){for(var l=e.length,n=0,a=0;a<l;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<l;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r={};r=e[0].parent,this.treemap.currentLevel=r.isDrilled?r.groupIndex:null;var o={};t.isNullOrUndefined(r.groupName)?o=r:o[r.groupName]=[r],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var l=this.treemap.levels.length,n=0;n<l;n++){l===e[0].groupIndex?this.treemap.levels[l]=this.treemap.levels[n]:this.treemap.levels.splice(l-1,1)}this.calculateLayoutItems(o,i),this.renderLayoutItems(o)},e.prototype.renderLayoutItems=function(e){var i,r,o,l,n=this,a=this.treemap;this.renderer=a.renderer;var s,h,d,p,c,g,u,f,y,v,b,x,S,w=a.element.id,C=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",M=document.getElementById(a.element.id+"_Secondary_Element"),P=a.levels;this.layoutGroup=this.renderer.createGroup({id:w+"_TreeMap_"+C+"_Layout"});for(var N,T,E,F,D,_=t.createElement("div",{id:a.element.id+"_Label_Template_Group",className:"template",styles:"overflow: hidden; position: absolute;pointer-events: none;top:"+a.areaRect.y+"px;left:"+a.areaRect.x+"px;height:"+a.areaRect.height+"px;width:"+a.areaRect.width+"px;"}),R=!1,B=a.leafItemSettings,U=function(e){if(u=k.renderItems[e],h=u.groupIndex,k.treemap.drillDownView&&t.isNullOrUndefined(k.treemap.currentLevel)&&h>0||k.treemap.drillDownView&&h>k.treemap.currentLevel+1)return"continue";p=u.rect,R=u.isLeafItem,v=w+"_Level_Index_"+h+"_Item_Index_"+e,N=k.renderer.createGroup({id:v+"_Group"}),x=(R?B.gap:P[h].groupGap)/2;var C=k.treemap.totalRect?I(k.treemap.totalRect):k.treemap.areaRect;"Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-x,p.height=Math.abs(p.y-p.height)-x),"TopRightBottomLeft"===a.renderDirection?p.x=C.x+C.width-p.width-Math.abs(C.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=C.y+C.height-p.height-Math.abs(C.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=C.x+C.width-p.width-Math.abs(C.x-p.x),p.y=C.y+C.height-p.height-Math.abs(C.y-p.y)),R?B.colorMapping:P[h].colorMapping,o=k.getItemColor(R,u),g=o.fill,y=o.opacity,c=R?B.labelFormat:P[h].headerFormat;var U;if(r=R?B.showLabels:P[h].showHeader,h===k.treemap.currentLevel)if(k.treemap.enableBreadcrumb){D="#"+k.treemap.breadcrumbConnector+"#",U=u.levelOrderName.replace(/#/gi,D),U=0!==h?"#"+U:U}else U=u.name;else k.treemap.enableBreadcrumb&&(u.isDrilled=!1),U=u.name;f=j(c,u.data,k.treemap)||U||"undefined",F=m(u).values,f=!R&&F&&F.length>0&&k.treemap.enableDrillDown?u.isDrilled?a.enableRtl?f+" [-]":"[-] "+f:a.enableRtl?f+" [+]":"[+] "+f:f,(S=R?B.labelStyle:P[h].headerStyle).fontFamily=k.treemap.themeStyle.labelFontFamily||S.fontFamily,E=R?B.border:P[h].border,i=R?B.labelPosition:"Near"===P[h].headerAlignment?"TopLeft":"Center"===P[h].headerAlignment?"TopCenter":"TopRight",d=R?B.templatePosition:P[h].templatePosition,T=R?B.labelTemplate:P[h].headerTemplate,u.options={border:E,opacity:y,fill:g},l={cancel:!1,name:ae,treemap:k.treemap,text:f,currentItem:u,RenderItems:k.renderItems,options:u.options},k.treemap.trigger(ae,l,function(t){if(!t.cancel){L=" M "+p.x+" "+p.y+" L "+(p.x+p.width)+" "+p.y+" L "+(p.x+p.width)+" "+(p.y+p.height)+" L "+p.x+" "+(p.y+p.height)+"z",s=new ze(v+"_RectPath",g,E.width,E.color,y,null,L);var o=n.renderer.drawPath(s);N.appendChild(o),r&&(l.text!==f&&(l.text=j(l.text,u.data,n.treemap)||U),n.renderItemText(l.text.toString(),N,S,p,O,v,g,i,D)),T&&(b=n.renderTemplate(M,v,p,d,T,u,R),_.appendChild(b),n.treemap.renderReactTemplates()),N.setAttribute("aria-label",u.name),N.setAttribute("tabindex",(n.treemap.tabIndex+e+2).toString()),H(n.treemap,N,"treeMapSelection"),n.layoutGroup.appendChild(N)}})},k=this,A=0;A<this.renderItems.length;A++)U(A);_.childNodes.length>0&&M.appendChild(_),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,o,l,s,h,p,c){document.getElementById(this.treemap.element.id+"_Secondary_Element"),this.treemap.leafItemSettings;var g,u,m,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,u=this.labelInterSectAction(o,e,r,l),g=n(f&&f[0]||u[0],r),this.treemap.enableRtl){var x=n(e,r),S=e.search("[+]")||e.search("[-]");if(o.width<x.width&&S>0){var w=e.substring(S-1,e.length),I=n("[+]",r);u[0]=a(o.width-I.width-5,u[0],r)+w}}var C=b(o,p,g,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var O=[],L=null,M=[],P=0;P<f.length;P++)v+=(g=n(L=a(o.width-5,f[P],r),r)).height,M.push(g.width),O.push(L);u=O,g.width=Math.max.apply(null,M),g.height=v}if("WrapByWord"===l||"Wrap"===l||"Trim"===l){for(var N=0;N<u.length;N++)v+=(g=n(u[N],r)).height,o.height-5>v&&y.push(u[N]);if("Wrap"===l&&u.length!==y.length&&y.length){var T=y.length-1,E=y[T];E=E.substring(0,E.length-1)+"...",y.splice(T),"..."!==E&&y.push(E)}}else m=u,y.push(m);d(new je(s+"_Text",C.x,C.y,"start",y,"","",c),r,r.color||this.getSaturatedColor(h),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,o=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,l=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;t.isNullOrUndefined(Ke.defaultLevelsData)||Ke.defaultLevelsData.length>0&&(Ke.levelsData=Ke.defaultLevelsData);var n=m(Ke.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=L(a,i.data[this.treemap.equalColorValuePath],i.data[this.treemap.rangeColorValuePath],i.data[this.treemap.weightValuePath]);o=t.isNullOrUndefined(s.fill)?r.leafItemSettings.fill:s.fill,l=s.opacity}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(o=t.isNullOrUndefined(o)?t.isNullOrUndefined(r.colorValuePath)?r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:o);return{fill:o,opacity:l}},e.prototype.getSaturatedColor=function(e){var t=e,i=q(X(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.r+587*i.g+114*i.b)/1e3)>=128?"black":"white"},e.prototype.renderTemplate=function(e,i,r,o,l,n,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(l.prototype))for(var d=Object.keys(n.data),p=0;p<d.length;p++)l=l.replace(new RegExp("{{:"+d[p]+"}}","g"),n.data[d[p].toString()]);var c=v(y(l)(n.data,this.treemap,l,this.treemap.element.id+h,!1),s,n.data),g=b(r,o,x(c,e),"Template",this.treemap);return c.style.left=g.x+"px",c.style.top=g.y+"px",c},e.prototype.labelInterSectAction=function(e,t,i,r){var o,l=e.width-10;switch(r){case"Hide":o=[B(l,e.height,t,i)];break;case"Trim":o=[a(l+3,t,i)];break;case"WrapByWord":o=_(l,t,i);break;case"Wrap":o=R(l,t,i)}return o},e}();(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};var Xe=function(){function e(e){this.control=e}return e.prototype.print=function(e){var i=this;this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight);var r={cancel:!1,htmlContent:this.getHTMLContent(e),name:ne};this.control.trigger(ne,r,function(){r.cancel||t.print(r.htmlContent,i.printWindow)})},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");return e?e instanceof Array?e.forEach(function(e){i.appendChild(c(e).cloneNode(!0))}):e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(c(e).cloneNode(!0)):i.appendChild(this.control.element.cloneNode(!0)),i},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(e){},e}(),Je=function(){function e(e){this.control=e}return e.prototype.export=function(e,i,r){var o=this;return new Promise(function(l,n){var a=t.createElement("canvas",{id:"ej2-canvas",attrs:{height:o.control.availableSize.height.toString(),width:o.control.availableSize.width.toString()}}),s=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),h='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+o.control.svgObject.outerHTML+"</svg>",d=window.URL.createObjectURL(new Blob("SVG"===e?[h]:[(new XMLSerializer).serializeToString(o.control.svgObject)],{type:"image/svg+xml"}));if("SVG"===e)r?re(i,e,d,s):l(null);else{var p=new Image,c=a.getContext("2d");p.onload=function(){c.drawImage(p,0,0),window.URL.revokeObjectURL(d),r?re(i,e,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s):"JPEG"===e?l(a.toDataURL("image/jpeg")):"PNG"===e&&l(a.toDataURL("image/png"))},p.src=d}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(e){},e}(),Ye=function(){function e(e){this.control=e}return e.prototype.export=function(e,i,r,l){var n=this;return new Promise(function(e,a){var s=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:n.control.availableSize.width.toString(),height:n.control.availableSize.height.toString()}});t.Browser.userAgent.toString().indexOf("HeadlessChrome");r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var h=n.control.svgObject.cloneNode(!0),d=h.childNodes[0];if(!t.isNullOrUndefined(d)){var p=d.getAttribute("fill");"Tailwind"!==n.control.theme&&"TailwindDark"!==n.control.theme&&"Bootstrap5"!==n.control.theme&&"Bootstrap5Dark"!==n.control.theme&&"Fluent"!==n.control.theme&&"FluentDark"!==n.control.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||h.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var c=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h)],{type:"image/svg+xml"})),g=new Image,u=s.getContext("2d");g.onload=function(){u.drawImage(g,0,0),window.URL.revokeObjectURL(c);var t=new o.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=r,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(a),0,0,n.control.availableSize.width-60,n.control.availableSize.height),l?(t.save(i+".pdf"),t.destroy()):e(null)},g.src=c})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qe=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},$e=function(e){function o(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return Ze(o,e),o.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},o.prototype.render=function(){this.renderElements()},o.prototype.renderElements=function(){Ke.levelsData=null,Ke.defaultLevelsData=null,Ke.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=le(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(Ke.levelsData)||(Ke.defaultLevelsData=Ke.levelsData),this.processDataManager()},o.prototype.processDataManager=function(){var e,i,o,l,n=this;if(this.dataSource instanceof r.DataManager){e=this.dataSource,i=this.query instanceof r.Query?this.query:new r.Query;e.executeQuery(i).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})}else this.dataSource instanceof We?(l=this.dataSource,(o=new t.Ajax(l.dataOptions,l.type,l.async,l.contentType)).onSuccess=function(e){n.dataSource=JSON.parse("["+e+"]")[0],n.renderTreeMapElements()},o.send(l.sendData)):this.renderTreeMapElements()},o.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger("loaded",{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},o.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}this.clearTemplate();var e=this.element.clientWidth,i=this.element.clientHeight;this.availableSize=new He(l(this.width,e)||e||600,l(this.height,i)||i||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},o.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new qe(this)},o.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var i=t.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: absolute;z-index:1;"});this.element.appendChild(i)}},o.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!t.isNullOrUndefined(this.svgObject)&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},o.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&t.isNullOrUndefined(i)){var r=new Ae(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new ke(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},o.prototype.renderTitle=function(e,i,r,o){var l,h=e.textStyle,p=this.availableSize.width-this.margin.right-this.margin.left;if(e.textStyle.fontFamily=this.themeStyle.fontFamily||e.textStyle.fontFamily,e.textStyle.size=this.themeStyle.fontSize||e.textStyle.size,e.text){t.isNullOrUndefined(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var c=a(p,e.text,h),g=n(c,h),u=s(t.isNullOrUndefined(r)?new ke(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,g,i),m=new je(this.element.id+"_TreeMap_"+i,u.x,u.y,"start",c),f=new ke(u.x,u.y,g.width,g.height),y=d(m,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);y.setAttribute("aria-label",e.description||e.text),y.setAttribute("tabindex",(this.tabIndex+("title"===i?1:2)).toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(l=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new ke(this.margin.left,f.y+10,p,l)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",f,o):this.svgObject.appendChild(o)}else l=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new ke(this.margin.left,this.margin.top,p,l)},o.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(Ke.levelsData=[],this.dataSource.map(function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={};r.level=0,e=this.leafItemSettings.labelPath,r[e]=[];for(var o=0;o<this.dataSource.length;o++){var l=m(this.dataSource[o]).values;this.isHierarchicalData&&l&&l.length>0?l.forEach(function(t,o){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[o][e]&&r[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}Ke.levelsData.push(r)}else{if(this.isHierarchicalData){Ke.hierarchyData=[],Ke.hierarchyData=t.extend([],this.dataSource,Ke.hierarchyData,!0);for(o=0;o<Ke.hierarchyData.length;o++)this.processHierarchicalData(Ke.hierarchyData[o],o);Ke.levelsData=Ke.hierarchyData}else this.processFlatJsonData(),Ke.levelsData.length>1&&this.reOrderLevelData(Ke.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(Ke.levelsData[0][e],"Parent")}},o.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=m(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},o.prototype.processHierarchicalData=function(e,i){var r,o,l,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=m(e),(r=a?a.values:null)&&r.length>0){l=a.key;for(var h=0;h<this.levels.length;h++)l===this.levels[h].groupPath&&(this.levels[h],o=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===o?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,c=void 0;p.search("#")>0&&(c=p.split("#").length-1),r[d].groupIndex=t.isNullOrUndefined(o)?c===this.levels.length?this.levels.length:c:o,0!==o&&(r[d].parent=e),r[d].groupName=l,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach(function(e){n.processHierarchicalData(e,i)})}if(i===Ke.hierarchyData.length-1){for(var g=Ke.hierarchyData[0][this.levels[0].groupPath],u=0;u<Ke.hierarchyData.length;u++)r=m(Ke.hierarchyData[u]).values,0!==u&&r&&(r.forEach(function(e){g.push(e)}),Ke.hierarchyData.splice(u,1),u-=1);g=Ke.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<g.length;f++)a[this.levels[0].groupPath]=g,g[f].parent=a}},o.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(e)},o.prototype.export=function(e,i,r,o){var l=this;return t.isNullOrUndefined(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,n){t(l.pdfExportModule.export(e,i,r,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,r){t(l.imageExportModule.export(e,i,o))}):null},o.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e,i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var o={};o.level=r,o[e]=[],Ke.levelsData.push(o);for(var l=0;l<this.dataSource.length;l++){var n={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[l][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[l][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[l],Ke.levelsData[Ke.levelsData.length-1][e].push(n),i.push(a||s))}}}},o.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,l=Ke.levelsData[e][r],n=Ke.levelsData[e-1][o],a=0;a<l.length;a++){i=l[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=t.isNullOrUndefined(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){t.isNullOrUndefined(l[a].parent)&&(l[a].parent=n[s]),n[s][r].push(l[a]);break}}this.findTotalWeight(Ke.levelsData[Ke.levelsData.length-1][r],"Child"),Ke.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},o.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},o.prototype.findTotalWeight=function(e,t){for(var i,r,o,l=this,n={},a=function(a){i=0,o=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){u(r,e[a].levelOrderName,t,l)&&(i+=parseFloat(t[l.weightValuePath]))}),"Parent"===t&&(n[o]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},o.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeOnTreeMap)},o.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),window.addEventListener("resize",this.resizeOnTreeMap.bind(this))},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("tabindex",this.tabIndex.toString())},o.prototype.resizeOnTreeMap=function(e){var i=this;this.isResize=!0;var r={name:xe,cancel:!1,previousSize:this.availableSize,currentSize:new He(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!t.isNullOrUndefined(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger(xe,r,function(e){i.render()})},500))},o.prototype.clickOnTreeMap=function(e){var i,r,o=this,l=e.target,n=l.id,a=l.innerHTML,s={cancel:!1,name:"click",treemap:this,mouseEvent:e};this.trigger("click",s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_")[6]),i={cancel:!1,name:ge,treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger(ge,i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(o.leafItemSettings.labelTemplate)?(e.text=j(e.text,e.item.data,e.treemap),l.innerHTML=e.text):p(n,l,e.contentItemTemplate))}));var h,d=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},o.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:me,treemap:this,mouseEvent:e};this.trigger(me,t)},o.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:fe,treemap:this,mouseEvent:e};this.trigger(fe,t)},o.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},o.prototype.mouseMoveOnTreeMap=function(e){var i,r,o=e.target.id,l={cancel:!1,name:ye,treemap:this,mouseEvent:e};this.trigger(ye,l);var n;o.indexOf("_Item_Index")>-1&&(n=m(r=this.layout.renderItems[parseFloat(o.split("_")[6])]).values,this.element.style.cursor=!r.isLeafItem&&n&&n.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:ue,treemap:this,item:r,mouseEvent:e},this.trigger(ue,i)),this.notify(t.Browser.touchMoveEvent,e)},o.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,o,l=t.levelOrderName.split("#"),n=0,a=Object.keys(l);n<a.length;n++)l[r=a[n]]===e&&(i=parseInt(r,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:l}},o.prototype.calculatePreviousLevelChildItems=function(e,i,r,o){for(var l,n,a,s=0,h=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<h;d++)a=0===d?i.levelText[d]:a+"#"+i.levelText[d];s=h>1?h:s;for(var p=0,c=Object.values(this.layout.renderItems);p<c.length;p++){(n=c[p]).levelOrderName.split("#")[0]===i.levelText[0]&&(l=0===s?t.isNullOrUndefined(a)?a:i.levelText[s]:o?a:a+"#"+i.levelText[s])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),o=!0,++s<=r.groupIndex&&(a=l=l+"#"+i.levelText[s]))}return o},o.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,o[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},o.prototype.mouseEndOnTreeMap=function(e){var i,r,o,l,n,a,s,h=this,d=e.target,p=d.id,c=!1,g={},u=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",f=this.element.id+"_Label_Template_Group";if(p.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),l=parseFloat(p.split("_")[6]),n=this.layout.renderItems[l];var y=d.innerHTML;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(y,n),a=s.drillLevel,this.drillDownView||-1===y.search("[+]")||(c=this.calculatePreviousLevelChildItems(y,s,n,c))),0!==this.levels.length&&!n.isLeafItem&&m(n).values&&m(n).values.length>0){if(this.drilledItems.length>0){n=c?this.drilledItems[this.drilledItems.length-1].data:n;for(var v=0;v<this.drilledItems.length;v++){if(!t.isNullOrUndefined(a)){var b=this.drilledItems.length;if(g=this.compareSelectedLabelWithDrillDownItems(s,n,v),b!==this.drilledItems.length){v-=1;break}}if(n.levelOrderName===this.drilledItems[v].name&&!c&&t.isNullOrUndefined(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?g[n.groupName]=[n]:g=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,g[n.groupName]=[n]),this.drilledItems.splice(v,1),v-=1;break}v===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(n.isDrilled=!0,g[n.groupName]=[n])}}else n.isDrilled=!0,g[n.groupName]=[n];r={cancel:!1,name:se,treemap:this,element:d,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:g},this.trigger(se,r,function(e){if(h.currentLevel=n.isDrilled&&t.isNullOrUndefined(a)?n.groupIndex:!t.isNullOrUndefined(a)&&h.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(u)){var r=document.getElementById(u);r.parentNode.removeChild(r)}if(i=t.extend({},h.areaRect,i,!0),h.legendSettings.visible&&!t.isNullOrUndefined(h.treeMapLegendModule)&&(t.isNullOrUndefined(g)||(h.treeMapLegendModule.legendGroup.textContent="",h.treeMapLegendModule.legendGroup=null,h.treeMapLegendModule.widthIncrement=0,h.treeMapLegendModule.heightIncrement=0,h.enableBreadcrumb&&!t.isNullOrUndefined(a)?h.drilledLegendItems={name:h.drilledItems[h.drilledItems.length-1].data.levelOrderName,data:h.drilledItems[h.drilledItems.length-1].data}:h.drilledLegendItems={name:n.levelOrderName,data:n},h.treeMapLegendModule.renderLegend()),i=t.isNullOrUndefined(h.totalRect)?i:h.totalRect),document.getElementById(f)){var o=document.getElementById(f);o.parentNode.removeChild(o)}t.isNullOrUndefined(e.childItems)||e.cancel?(h.layout.calculateLayoutItems(g,i),h.layout.renderLayoutItems(g)):h.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:he,treemap:this,renderItems:this.layout.renderItems},this.trigger(he,o),!c&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},o.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Q(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},o.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var r="",o=0;o<e.length;o++)o!==e.length-1?r+=e[o]+"#":r+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},o.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this]}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this]}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this]}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this]}),this.allowPrint&&e.push({member:"Print",args:[this,Xe]}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Je]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Ye]}),e},o.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++){switch(o[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}}i&&(this.createSvg(),this.renderElements())},o.prototype.getModuleName=function(){return"treemap"},o.prototype.destroy=function(){this.unWireEVents(),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this)},o.prototype.removeSvg=function(){if(oe(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},o.prototype.getPersistData=function(){return""},Qe([t.Property(!1)],o.prototype,"allowPrint",void 0),Qe([t.Property(!1)],o.prototype,"allowImageExport",void 0),Qe([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Qe([t.Property(null)],o.prototype,"width",void 0),Qe([t.Property(null)],o.prototype,"height",void 0),Qe([t.Complex({},Ce)],o.prototype,"border",void 0),Qe([t.Complex({},Oe)],o.prototype,"margin",void 0),Qe([t.Property(null)],o.prototype,"background",void 0),Qe([t.Property("Material")],o.prototype,"theme",void 0),Qe([t.Complex({},Ne)],o.prototype,"titleSettings",void 0),Qe([t.Property("Squarified")],o.prototype,"layoutType",void 0),Qe([t.Property(null)],o.prototype,"dataSource",void 0),Qe([t.Property(null)],o.prototype,"query",void 0),Qe([t.Property(null)],o.prototype,"weightValuePath",void 0),Qe([t.Property("")],o.prototype,"rangeColorValuePath",void 0),Qe([t.Property("")],o.prototype,"equalColorValuePath",void 0),Qe([t.Property(null)],o.prototype,"colorValuePath",void 0),Qe([t.Property([])],o.prototype,"palette",void 0),Qe([t.Property("TopLeftBottomRight")],o.prototype,"renderDirection",void 0),Qe([t.Property(!1)],o.prototype,"enableDrillDown",void 0),Qe([t.Property(!1)],o.prototype,"enableBreadcrumb",void 0),Qe([t.Property(" - ")],o.prototype,"breadcrumbConnector",void 0),Qe([t.Property(!1)],o.prototype,"drillDownView",void 0),Qe([t.Complex({},Fe)],o.prototype,"initialDrillDown",void 0),Qe([t.Complex({},De)],o.prototype,"leafItemSettings",void 0),Qe([t.Collection([],Ue)],o.prototype,"levels",void 0),Qe([t.Complex({},Be)],o.prototype,"highlightSettings",void 0),Qe([t.Complex({},Re)],o.prototype,"selectionSettings",void 0),Qe([t.Complex({},_e)],o.prototype,"tooltipSettings",void 0),Qe([t.Complex({},Ee)],o.prototype,"legendSettings",void 0),Qe([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Qe([t.Property(null)],o.prototype,"description",void 0),Qe([t.Property(1)],o.prototype,"tabIndex",void 0),Qe([t.Property(null)],o.prototype,"format",void 0),Qe([t.Event()],o.prototype,"load",void 0),Qe([t.Event()],o.prototype,"beforePrint",void 0),Qe([t.Event()],o.prototype,"loaded",void 0),Qe([t.Event()],o.prototype,"itemRendering",void 0),Qe([t.Event()],o.prototype,"drillStart",void 0),Qe([t.Event()],o.prototype,"drillEnd",void 0),Qe([t.Event()],o.prototype,"itemSelected",void 0),Qe([t.Event()],o.prototype,"itemHighlight",void 0),Qe([t.Event()],o.prototype,"tooltipRendering",void 0),Qe([t.Event()],o.prototype,"itemClick",void 0),Qe([t.Event()],o.prototype,"itemMove",void 0),Qe([t.Event()],o.prototype,"click",void 0),Qe([t.Event()],o.prototype,"doubleClick",void 0),Qe([t.Event()],o.prototype,"rightClick",void 0),Qe([t.Event()],o.prototype,"mouseMove",void 0),Qe([t.Event()],o.prototype,"resize",void 0),Qe([t.Event()],o.prototype,"legendItemRendering",void 0),Qe([t.Event()],o.prototype,"legendRendering",void 0),o=Qe([t.NotifyPropertyChanges],o)}(t.Component),Ke=function(){return function(){}}(),et=function(){function e(e){this.page=0,this.legendBorderRect=new ke(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new ke(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t;t={cancel:!1,name:be,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position},this.treemap.trigger(be,t,function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()})},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(Ke.levelsData[0]),(this.treemap.palette.length>0||!t.isNullOrUndefined(this.treemap.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(Ke.levelsData[0],"Parent"),this.legendCollections.length>0){var o=r.position,l=r.title.text,s=r.titleStyle,h=r.mode,d=0,p=0,c=0,g=0,u=r.shapeHeight,m=r.shapeWidth,f=[],y=[],v="None"===r.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,b=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,x=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=i.themeStyle.fontFamily||s.fontFamily,s.size=i.themeStyle.legendFontSize||s.size;var S=n(l,s),w=0,I=0,C=r.shapePadding;r.textStyle,this.legendCollections.length;if(r.textStyle.size=i.themeStyle.legendFontSize||r.textStyle.size,r.textStyle.fontFamily=i.themeStyle.fontFamily||r.textStyle.fontFamily,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,x=t.isNullOrUndefined(x)?i.areaRect.height:x;for(var O=0,L=0;L<this.legendCollections.length;L++){var M=this.legendCollections[L];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var P=n(M.legendName,r.textStyle);if(this.textMaxWidth=Math.max(this.textMaxWidth,P.width),0===L)w=d=10+m/2,I=p=10+S.height+(u>P.height?u/2:P.height/4);else{var N=P.height>u?P.height:u;if("Horizontal"===v){var T=y[O-1].x+y[O-1].width+10+m;if(T+C+P.width>b){var E=(y[O-1].y>f[O-1].y+u/2?y[O-1].y:f[O-1].y+u/2)+10;E+N>x?(this.getPageChanged(),O=0,f=[],y=[],d=w,p=I):(d=f[0].x,p=E+N/2)}else d=T-m/2,p=f[O-1].y}else{var F=y[O-1].y>f[O-1].y+u/2?y[O-1].y:f[O-1].y+u/2;if(F+10+N>x){var D=y[O-1].x+this.textMaxWidth+10;D+C+P.width>b?(d=w,p=I,y=[],f=[],this.getPageChanged(),O=0):(d=D+m/2,p=f[0].y)}else d=f[O-1].x,p=F+10+u/2}}c=d+m/2+C,g=p+P.height/4,f.push({x:d,y:p}),y.push({x:c,y:g,width:P.width,height:P.height/2}),this.totalPages[this.page].Collection.push({DisplayText:M.legendName,element:M.gradientElement,Shape:{x:d,y:p},Text:{x:c,y:g},Fill:M.legendFill,Data:M.legendData,Rect:{x:f[O].x-m/2,y:f[O].y-u/2<g-P.height?f[O].y-u/2:g-P.height,width:Math.abs(f[O].x-m/2-(c+P.width)),height:u>P.height?u:P.height}}),O++}var _=this.totalPages[0].Collection;_.forEach(function(t,i){var r=new ke(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,I=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(I-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,x=this.heightIncrement<x?this.heightIncrement:x,this.legendItemRect={x:_[0].Rect.x,y:_[0].Rect.y,width:b,height:x}}else{var R=r.textStyle,B=this.legendCollections.length,U="Horizontal"===v?t.isNullOrUndefined(b)?i.areaRect.width/B:b/B:t.isNullOrUndefined(b)?25:b,H="Horizontal"===v?t.isNullOrUndefined(x)?25:x:t.isNullOrUndefined(x)?i.areaRect.height/B:x/B;w=0,I=S.height+10;var k=r.labelPosition,A=0,z=0,j=r.labelDisplayMode,V=0,G=0;for(L=0;L<this.legendCollections.length;L++){w="Horizontal"===v?w+U:w,I="Horizontal"===v?I:I+H;var W=this.legendCollections[L].legendName,q=new He(0,0);"None"===j?q=n(W,R):"Trim"===j?q=n(W=a("Horizontal"===v?U:H,W,R),R):W="",V=Math.max(V,q.height),G=Math.max(G,q.width),q.width>0&&q.height>0&&("Horizontal"===v?(c=w+U/2,g="After"===k?I+H+q.height/2+10:I-10):(c="After"===k?w-q.width/2-10:w+U+q.width/2+10,g=I+H/2+q.height/4)),0===L&&(A="Horizontal"===v?w:"After"===k?c-q.width/2:w,z="Horizontal"===v?"After"===k?I:g-q.height/2:I),L===B-1&&(b="Horizontal"===v?Math.abs(w+U-A):U+G+10,x="Horizontal"===v?H+V/2+10:Math.abs(I+H-z)),this.legendRenderingCollections.push({fill:this.legendCollections[L].legendFill,x:w,y:I,width:U,height:H,element:this.legendCollections[L].gradientElement,text:W,textX:c,textY:g,textWidth:q.width,textHeight:q.height,data:this.legendCollections[L].legendData})}this.legendItemRect={x:A,y:z,width:b,height:x}}}},e.prototype.getPageChanged=function(){this.page++,t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=m(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e,i){var r,o;if(!t.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&t.isNullOrUndefined(this.treemap.drilledLegendItems))for(var l=m(e).values,n=0;n<l.length;n++)if(l[n].Name===this.treemap.initialDrillDown.groupName){l[n].isDrilled=!l[n].isDrilled,e=l[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,o=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:l[n].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var a=this.treemap.drilledLegendItems;if(o=a.data.options.fill,a.data.isDrilled)r=m(a.data).values;else{r=m(a.data.parent).values}}else r=m(e).values;var s;if(r&&r.length>0){for(var h=0;h<r.length;h++)(t.isNullOrUndefined(r[h].data[this.treemap.legendSettings.showLegendPath])||r[h].data[this.treemap.legendSettings.showLegendPath])&&(s=r[h].data[this.treemap.legendSettings.valuePath]?r[h].data[this.treemap.legendSettings.valuePath]:r[h].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,s)||this.legendCollections.push({legendName:s,legendFill:this.treemap.palette.length>0?t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:o:r[h].data[this.treemap.colorValuePath],legendData:[],itemArea:r[h].weight}));if(this.legendCollections.sort(U),this.treemap.palette.length>0)for(var d=0;d<this.legendCollections.length;d++)this.legendCollections[d].legendFill=t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[d%this.treemap.palette.length]:o}},e.prototype.calculateLegendItems=function(e){var i,r,o,l,n,a,s,h,d,p,c,g,u,m,f,y,v,b=!1,x=this.treemap.leafItemSettings,S=this.treemap.levels,w=this.treemap.legendSettings.position,I=!1,C=0;this.outOfRangeLegend=null;for(var O=0;O<e.length;O++){r="",u=!1,m=!1,I=!1,l=e[O].data,a=e[O].groupIndex;for(var L=0,M=0===this.treemap.levels.length||a===this.treemap.levels.length?x.colorMapping:S[a].colorMapping;L<M.length;L++){var P=M[L];if(h=null,o=Number(l[this.treemap.rangeColorValuePath]),s=l[this.treemap.equalColorValuePath],P.value=t.isNullOrUndefined(P.value)?P.value:P.value.toString(),!t.isNullOrUndefined(P.from)&&!t.isNullOrUndefined(P.to)&&o>=P.from&&o<=P.to&&P.showLegend?(b=!0,m=!0,c=P.from+" - "+P.to,n=t.isNullOrUndefined(P.label)?P.from+" - "+P.to:P.label,r=t.isNullOrUndefined(P.color)?r:P.color,i=this.isAddNewLegendData(c)):!t.isNullOrUndefined(P.value)&&s===P.value&&P.showLegend&&(b=!0,u=!0,c=P.value.toString(),n=t.isNullOrUndefined(P.label)?P.value.toString():P.label,r=t.isNullOrUndefined(P.color)?r:"[object Array]"===Object.prototype.toString.call(P.color)?P.color[0]:P.color,i=this.isAddNewLegendData(c)),b&&t.isNullOrUndefined(P.value)&&P.maxOpacity&&P.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(P.color))for(var T=0;T<P.color.length;T++){var E={colorStop:(T*(100/(P.color.length-1))+"%").toString(),color:P.color[T]};N.push(E)}else{E={colorStop:"0%",color:r};var F={colorStop:"100%",color:r};N.push(E),N.push(F)}d="Top"===w||"Bottom"===w?"100%":"0%",p="Top"===w||"Bottom"===w?"0%":"100%";var D={id:"groupIndex_"+a+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:d,y2:p};h=this.treemap.renderer.drawGradient("linearGradient",D,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(P.color)&&(h.childNodes[0].setAttribute("stop-opacity",P.minOpacity.toString()),h.childNodes[1].setAttribute("stop-opacity",P.maxOpacity.toString())),this.defsElement.appendChild(h),this.gradientCount++}g=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&b&&!g?(b=!1,r="[object Array]"===Object.prototype.toString.call(P.color)&&t.isNullOrUndefined(h)&&t.isNullOrUndefined(P.value)?this.legendGradientColor(P,C):r,this.legendCollections.push({actualValue:c,legendName:n,legendFill:r,legendData:[],gradientElement:t.isNullOrUndefined(h)?t.isNullOrUndefined(P.value)?this.legendLinearGradient:null:h,name:e[O].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]),C++):b&&!g&&(b=!1,this.legendCollections[i.value].legendData.push(e[O])),m||I||u||t.isNullOrUndefined(P.from)&&t.isNullOrUndefined(P.to)&&t.isNullOrUndefined(P.minOpacity)&&t.isNullOrUndefined(P.maxOpacity)&&t.isNullOrUndefined(P.value)&&!t.isNullOrUndefined(P.color)&&(f="[object Array]"===Object.prototype.toString.call(P.color)?P.color[0]:P.color,y=t.isNullOrUndefined(P.label)?"Others":P.label,t.isNullOrUndefined(this.outOfRangeLegend)&&(this.legendCollections.push({actualValue:y,legendData:[],legendName:y,legendFill:f}),v=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[v-1],C++),this.legendCollections[v-1].legendData.push(e[O]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap,r=i.legendSettings,o=i.renderer,l=r.textStyle;if(this.legendGroup=o.createGroup({id:i.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===r.mode)this.drawLegendItem(this.currentPage);else for(var n=0;n<this.legendRenderingCollections.length;n++){var a=i.element.id+"_Legend_Index_"+n,s=i.element.id+"_Legend_Index_"+n+"_Text",h=this.legendRenderingCollections[n];e=(t=h.element)?"url(#"+t.id+")":h.fill;var p=new ke(h.x,h.y,h.width,h.height),c=new Ve(h.textX,h.textY),g=new Ae(a,e,r.shapeBorder,r.opacity,p);this.treemap.enableRtl&&("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(g.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+g.height)-Math.abs(this.legendBorderRect.y-g.y),c.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+h.textHeight/2-Math.abs(this.legendBorderRect.y-c.y)):(g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+g.width)-Math.abs(this.legendBorderRect.x-g.x),c.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-c.x))),d(new je(s,c.x,c.y,"middle",h.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(o.drawRectangle(g))}k(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var o=e.Shape,l=e.Text,a=n(e.DisplayText,r.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-l.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-r.shapeHeight/2,l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)),{shapeLocation:o,textLocation:l}},e.prototype.drawLegendItem=function(e){var i,r,o=this,l=this.treemap,a=l.legendSettings,s=new He(a.shapeWidth,a.shapeHeight),h=l.renderer,p=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=c?t.isNullOrUndefined(a.fill)?"#000000":a.fill:p.color,u=c&&0===p.width?1:p.width,m=function(t){var n=f.totalPages[e].Collection[t],p=h.createGroup({id:l.element.id+"_Legend_Index_"+t}),m=n.DisplayText,y=l.element.id+"_Legend_Shape_Index_"+t,v=l.element.id+"_Legend_Text_Index_"+t,b=n.Shape,x=n.Text;l.enableRtl&&(i=f.defaultLegendRtlLocation(n,10,l,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:ve,treemap:l,fill:n.Fill,shape:a.shape,imageUrl:a.imageUrl},f.treemap.trigger(ve,r,function(e){var t=new ze(y,e.fill,u,c?n.Fill:g,a.opacity,"");p.appendChild(J(b,e.shape,s,e.imageUrl,t,m)),d(new je(v,x.x,x.y,"start",m,"",""),a.textStyle,a.textStyle.color||o.treemap.themeStyle.legendTextColor,p),o.legendGroup.appendChild(p)})},f=this,y=0;y<this.totalPages[e].Collection.length;y++)m(y);var v=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,S=n(b,x),w=this.legendItemRect.x+this.legendItemRect.width-S.width-20-10,I=this.legendItemRect.x+this.legendItemRect.width,C=this.legendItemRect.y+this.legendItemRect.height+2.5+10,O=I-10-S.width/2-5;v=h.createGroup({id:l.element.id+"_Legend_Paging_Group"});var L=h.createGroup({id:l.element.id+"_Legend_Left_Paging_Group"}),M=h.createGroup({id:l.element.id+"_Legend_Right_Paging_Group"}),P=" M "+I+" "+C+" L "+(I-10)+" "+(C-5)+" L "+(I-10)+" "+(C+5)+" z ",N=" M "+w+" "+C+" L "+(w+10)+" "+(C-5)+" L "+(w+10)+" "+(C+5)+" z ",T=new ze(l.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(h.drawPath(T));var E=new Ae(l.element.id+"_Left_Page_Rect","transparent",{},1,new ke(w-5,C-10,20,20),"");L.appendChild(h.drawRectangle(E)),this.wireEvents(L);var F=new ze(l.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",P);M.appendChild(h.drawPath(F));var D=new Ae(l.element.id+"_Right_Page_Rect","transparent",{},1,new ke(I-10,C-5,10,10),"");M.appendChild(h.drawRectangle(D)),this.wireEvents(M),v.appendChild(L),v.appendChild(M);var _={id:l.element.id+"_Paging_Text",x:O,y:C+S.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":""};v.appendChild(h.createText(_,b)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=t.titleStyle,o=n(a(this.legendItemRect.width+20,i,r),r);this.legendBorderRect=new ke(this.legendItemRect.x-10,this.legendItemRect.y-10-o.height,this.legendItemRect.width+20,this.legendItemRect.height+20+o.height+("Interactive"===t.mode?0:0!==this.page?10:0));var l=new Ae(e.element.id+"_Legend_Border",t.background,t.border,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(l);s.style.pointerEvents="none",this.legendGroup.appendChild(s),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e=this.treemap,t=e.legendSettings,i=t.titleStyle,r=t.title.text,o=a(this.legendItemRect.width+20,r,i),l=n(o,i);r&&d(new je(e.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-l.height/2-5,"middle",o,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,r=e.target,o=i.element.id+"_Interactive_Legend";r=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):r;var l,n=i.legendSettings;if(r.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,c=void 0,g=void 0;l=i.layout.renderItems[parseFloat(r.id.split("_")[6])];for(var u=i.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(g=document.getElementById(i.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new ke(Math.abs(s.left-u.left),Math.abs(s.top-u.top),s.width,s.height);if(d=g.getAttribute("fill"),p=n.shapeBorder.color,c=n.shapeBorder.width,!t.isNullOrUndefined(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===l.levelOrderName){this.drawInteractivePointer(n,d,p,o,c,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,o,l){var n,a,s;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=l.x+l.width/2)+" "+(s=l.y+l.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=l.x+l.width/2)+" "+(s=l.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=l.x)+" "+(s=l.y+l.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=l.x+l.width)+" "+(s=l.y+l.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var h=new ze(r,t,o,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(h))},e.prototype.getLegendAlignment=function(e,i,r,o){var l,n,a,s=(a=t.extend({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,c=e.availableSize.width,g=e.availableSize.height,u="Auto"===o.position?c>g?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,l=c/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,l="Left"===u?s:s+a.width,n=g/2-r/2,a.x="Left"===u?s+i:s}switch(o.alignment){case"Near":"Top"===u||"Bottom"===u?l=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?l=c-i:n=g-r}this.treemap.totalRect=a,this.translate=new Ve(l,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.drawLegend()},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(e){this.removeEventListener()},e.prototype.legendGradientColor=function(e,i){var r,o="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),n=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),c=document.createElementNS(o,"stop");c.setAttribute("offset",d*p+"%"),c.setAttribute("stop-color",e.color[d]),c.setAttribute("stop-opacity",1..toString()),n.appendChild(c)}l.appendChild(n),this.legendLinearGradient=n;var g="url(#linear_"+i+")";this.defsElement.appendChild(n),r=g}return r},e}(),tt=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,o,l,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,c=[],g=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!g||this.treemap.selectionId!==h)){if(this.highLightId!==h){l=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var u=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_")[6])];var m=void 0;if(this.treemap.legendSettings.visible){var y=this.treemap.treeMapLegendModule.legendCollections;m=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById("container_Legend_Shape_Index_"+m):document.getElementById("container_Legend_Index_"+m),null===this.shapeElement||g&&this.shapeElement.getAttribute("id")===g.legendSelectId?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):g&&this.shapeElement===g.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Q(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:y[m].legendFill,oldOpacity:y[m].opacity,oldBorderColor:y[m].borderColor,oldBorderWidth:y[m].borderWidth}),K(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=f(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!g||(!this.shapeElement||this.shapeElement.getAttribute("id")!==g.legendSelectId)))if(this.treemap.legendSettings.visible&&(g&&this.shapeElement===g.shapeElement))t=!1;else{for(var v=0;v<l.childElementCount;v++){n=l.childNodes[v],o=!0,r=s.layout.renderItems[n.id.split("_")[6]];for(var b=0;b<u.length;b++)if(n.id===u[b].id){o=!1;break}a.indexOf(r.levelOrderName)>-1&&o&&(c.push(n),d.push(r))}A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var x=0;x<c.length;x++)z((n=c[x]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:pe,treemap:s,items:d,elements:c},s.trigger(pe,i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!g||g.legendSelectId!==h)&&(!g||g.shapeSelectId!==h)){var S,w=void 0,I=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";m="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_")[4]):parseFloat(h.split("_")[3]);var O=this.treemap.treeMapLegendModule.legendCollections[m].legendData.length,L=(y=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(v=0;v<O;v++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[m].legendData[v].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,I=this.treemap.layout.renderItems[b].groupIndex;var M=document.getElementById("container_Level_Index_"+I+"_Item_Index_"+w+"_RectPath");0===v&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,L,b,C,M,this.treemap.layout.renderItems,y),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection={Elements:[]}),K(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(M,p.fill,p.opacity,p.border.color,p.border.width.toString()),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection.Elements.push(M)}}}else g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:this.treemap.legendSettings.visible)&&A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:!g||g.legendSelect)&&(Q(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&$(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),it=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var o,l,n,a,s=[],h=i.id,d=i.innerHTML,c=[],g=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){l=document.getElementById(m),o=r.layout.renderItems[parseFloat(h.split("_")[6])];var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),y=te(v,o,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById("container_Legend_Shape_Index_"+y):document.getElementById("container_Legend_Index_"+y),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[y].legendFill,oldOpacity:b[y].opacity,oldBorderColor:b[y].borderColor,oldBorderWidth:b[y].borderWidth}),K(this.shapeElement,g.fill,g.opacity,g.border.color,g.border.width.toString()))}a=f(o,[],g.mode,r);for(var x=0;x<l.childElementCount;x++)n=l.childNodes[x],o=r.layout.renderItems[n.id.split("_")[6]],a.indexOf(o.levelOrderName)>-1&&(c.push(n),r.levelSelection.push(n.id),s.push(o));A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),w=0;w<c.length;w++){if(n=c[w],S.length>0)for(var I=0;I<S.length;I++)S[I].id===n.id&&S[I].classList.remove("treeMapHighLight"),z(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");else z(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:de,treemap:r,items:s,elements:c,text:d,contentItemTemplate:d},r.trigger(de,t,function(e){e.contentItemTemplate!==d&&p(h,i,e.contentItemTemplate)})}}else Q(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var C,O=void 0,L=void 0;this.legendSelectId=h,this.legendSelect=!1;var M=parseInt(h[h.length-1],10),P=document.getElementById(h);$(this.legendSelectionCollection),u&&(u.shapeTarget="selection");y="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_")[4]):parseFloat(h.split("_")[3]);var N=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(w=0;w<N;w++)for(var T=0;T<this.treemap.layout.renderItems.length;T++)if(this.treemap.treeMapLegendModule.legendCollections[y].legendData[w].levelOrderName===this.treemap.layout.renderItems[T].levelOrderName){O=T,L=this.treemap.layout.renderItems[T].groupIndex;var E=document.getElementById("container_Level_Index_"+L+"_Item_Index_"+O+"_RectPath");0===w&&(ie(this.legendSelectionCollection,M,T,P,E,this.treemap.layout.renderItems,b),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection={Elements:[]}),K(P,g.fill,g.opacity,g.border.color,g.border.width.toString()),K(E,g.fill,g.opacity,g.border.color,g.border.width.toString()),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection.Elements.push(E)}}else $(this.legendSelectionCollection),u&&(u.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var o=this.treemap.selectionSettings,l=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=f(i,[],o.mode,this.treemap),c=0;c<d.childElementCount;c++)n=d.childNodes[c],i=this.treemap.layout.renderItems[n.id.split("_")[6]],p.indexOf(i.levelOrderName)>-1&&(l.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var g=0;g<s.length;g++){this.shapeSelect=!1;var u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(u,s[g],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById("container_Legend_Shape_Index_"+a):document.getElementById("container_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),K(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var y=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=y.childNodes[0].id;for(var v=document.getElementsByClassName("treeMapHighLight"),b=0;b<l.length;b++)if(n=l[b],v.length>0)for(var x=0;x<v.length;x++)v[x].id===n.id&&v[x].classList.remove("treeMapHighLight"),z(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:o.fill,z(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),rt=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]])}return i},ot=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,o,l,n,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(l=e).changedTouches[0].pageX,r=l.changedTouches[0].pageY,o=l.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,o=e.target);var s,h,d,p,c=o.id,g={},u={},m=[];c.indexOf("_Item_Index")>-1?(g=this.treemap.layout.renderItems[parseFloat(c.split("_")[6])],t.isNullOrUndefined(g)||(g.name,s=g.weight,u=g.data,p=g.options.fill,m=this.treemap.enableRtl?[j(this.tooltipSettings.format,u,this.treemap)||V(s,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[j(this.tooltipSettings.format,u,this.treemap)||this.treemap.weightValuePath.toString()+" : "+V(s,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):(h=t.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip",styles:"position: absolute;pointer-events:none;"}),document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=O(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.fontFamily=this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.color=this.treemap.themeStyle.tooltipFontColor||this.tooltipSettings.textStyle.color,this.tooltipSettings.textStyle.opacity=this.treemap.themeStyle.tooltipTextOpacity||this.tooltipSettings.textStyle.opacity,n={cancel:!1,name:ce,item:g,options:{location:d,text:m,data:u,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger(ce,n,function(e){a.addTooltip(n,p,h)}))):(this.removeTooltip(),this.treemap.clearTemplate())},e.prototype.addTooltip=function(e,r,o,l){var n,a;if(t.isNullOrUndefined(e))n=l.cancel,a=l;else{n=e.cancel,a=rt(e,["cancel"]).options}n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(o),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(e){this.removeEventListener()},e}();e.TreeMap=$e,e.LevelsData=Ke,e.Border=Ce,e.Margin=Oe,e.Font=Le,e.CommonTitleSettings=Me,e.SubTitleSettings=Pe,e.TitleSettings=Ne,e.ColorMapping=Te,e.LegendSettings=Ee,e.InitialDrillSettings=Fe,e.LeafItemSettings=De,e.TooltipSettings=_e,e.SelectionSettings=Re,e.HighlightSettings=Be,e.LevelSettings=Ue,e.load="load",e.loaded="loaded",e.beforePrint=ne,e.itemRendering=ae,e.drillStart=se,e.drillEnd=he,e.itemSelected=de,e.itemHighlight=pe,e.tooltipRendering=ce,e.itemClick=ge,e.itemMove=ue,e.click="click",e.doubleClick=me,e.rightClick=fe,e.mouseMove=ye,e.legendItemRendering=ve,e.legendRendering=be,e.resize=xe,e.defaultFont=Se,e.getThemeStyle=le,e.Size=He,e.stringToNumber=l,e.Rect=ke,e.RectOption=Ae,e.PathOption=ze,e.measureText=n,e.TextOption=je,e.textTrim=a,e.Location=Ve,e.findPosition=s,e.createTextStyle=h,e.renderTextElement=d,e.setItemTemplateContent=p,e.getElement=c,e.itemsToOrder=g,e.isContainsData=u,e.findChildren=m,e.findHightLightItems=f,e.getTemplateFunction=y,e.convertElement=v,e.findLabelLocation=b,e.measureElement=x,e.getArea=S,e.getShortestEdge=w,e.convertToContainer=I,e.convertToRect=C,e.getMousePosition=O,e.colorMap=L,e.deSaturationColor=M,e.colorCollections=P,e.rgbToHex=N,e.getColorByValue=T,e.getGradientColor=E,e.getPercentageColor=F,e.getPercentage=D,e.wordWrap=_,e.textWrap=R,e.hide=B,e.orderByArea=U,e.maintainSelection=H,e.legendMaintain=k,e.removeClassNames=A,e.applyOptions=z,e.textFormatter=j,e.formatValue=V,e.ColorValue=Ge,e.convertToHexCode=G,e.componentToHex=W,e.convertHexToColor=q,e.colorNameToHex=X,e.drawSymbol=J,e.renderLegendShape=Y,e.isParentItem=Z,e.TreeMapAjax=We,e.removeShape=Q,e.removeLegend=$,e.setColor=K,e.removeSelectionWithHighlight=ee,e.getLegendIndex=te,e.pushCollection=ie,e.triggerDownload=re,e.removeElement=oe,e.TreeMapLegend=et,e.LayoutPanel=qe,e.TreeMapHighlight=tt,e.TreeMapSelection=it,e.TreeMapTooltip=ot,e.ImageExport=Je,e.PdfExport=Ye,e.Print=Xe,Object.defineProperty(e,"__esModule",{value:!0})});
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t(e.ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,t,i,r,o){"use strict";function l(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function n(e,i){var r=document.getElementById("treeMapMeasureText");return null===r&&(r=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(r)),r.innerHTML=e,r.style.position="absolute",r.style.fontSize=i.size,r.style.fontWeight=i.fontWeight,r.style.fontStyle=i.fontStyle,r.style.fontFamily=i.fontFamily,r.style.visibility="hidden",r.style.top="-100",r.style.left="0",r.style.whiteSpace="nowrap",r.style.lineHeight="normal",new He(r.clientWidth,r.clientHeight)}function a(e,t,i){var r=t,o=n(t,i).width;if(o>e)for(var l=t.length-1;l>=0;--l)if(r=t.substring(0,l)+"...",(o=n(r,i).width)<=e||r.length<4)return r.length<4&&(r=" "),r;return r}function s(e,t,i,r){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===r?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===r?e.width-e.y-i.width:e.x+e.width-i.width}var l="title"===r?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Ge(o,l)}function h(e,t,i){var r=e.createText(t,i);return r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),r.style["user-select"]="none",r.style["-moz-user-select"]="none",r.style["-webkit-touch-callout"]="none",r.style["-webkit-user-select"]="none",r.style["-khtml-user-select"]="none",r.style["-ms-user-select"]="none",r.style["-o-user-select"]="none",r}function d(e,r,o,l,a){void 0===a&&(a=!1);var s,d,p,c={"font-size":r.size,"font-style":r.fontStyle,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:r.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},g="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],u=new i.SvgRenderer("");if(!t.isNullOrUndefined(g)&&!t.isNullOrUndefined(e.connectorText)&&g.search(e.connectorText[1])>=0)for(var m=g.split("#"),f=0;f<m.length;f++){var y=-1===m[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?m[f]:e.connectorText;if(c.id=e.id+"_"+f,p=h(u,c,y),f%2==0&&0!==f){y=y.replace(/\s+/g,"&nbsp")}var v=n(y,r);c.x=0!==f?c.x+v.width:c.x+v.width+5,l.appendChild(p)}else p=h(u,c,g),l.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var b=1,x=e.text.length;b<x;b++)d=n(e.text[b],r).height,s=u.createTSpan({x:e.x,id:e.id,y:e.y+b*d},e.text[b]),p.appendChild(s);l.appendChild(p)}return p}function p(e,i,r){var o,l=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+l+"_LabelTemplate"),t.isNullOrUndefined(o)||(o.innerHTML=r)}function c(e){return document.getElementById(e)}function g(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function u(e,t,i,r){for(var o=!1,l="",n=r.leafItemSettings,a=0;a<e.length;a++){var s=i[r.levels[a]?r.levels[a].groupPath:n.labelPath?n.labelPath:r.weightValuePath]||"undefined";if(e[a]===s&&(l+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function m(e){var t;if(e){var i=Object.keys(e);t={};for(var r=0;r<i.length;r++)if(e[i[r]]instanceof Array){t.values=e[i[r]],t.key=i[r];break}}return t}function f(e,t,i,r){if("Child"===i){t.push(e.levelOrderName);var o=m(e).values;if(o&&o.length>0){for(var l=0;l<o.length;l++)-1===t.indexOf(o[l].levelOrderName)&&t.push(o[l].levelOrderName);for(var n=0;n<o.length;n++)f(o[n],t,i,r)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,r));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(l=0;l<r.layout.renderItems.length;l++)(s=r.layout.renderItems[l]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function y(e){var i=null;try{document.querySelectorAll(e).length&&(i=t.compile(document.querySelector(e).innerHTML.trim()))}catch(r){i=t.compile(e)}return i}function v(e,i,r){for(var o=t.createElement("div",{id:i,styles:"position: absolute;pointer-events: auto;"}),l=e.length;l>0;)o.appendChild(e[0]),l--;for(var n=o.innerHTML,a=Object.keys(r),s=0;s<a.length;s++)n=n.replace(new RegExp("{{:"+a[s]+"}}","g"),r[a[s].toString()]);return o.innerHTML=n,o}function b(e,t,i,r,o){var l=new Ge(0,0),n=(o.element.getBoundingClientRect(),"Template"===r?o.areaRect.x:0),a="Template"===r?o.areaRect.y:0;return l.x=Math.abs(n-(t.indexOf("Left")>-1?e.x+5:t.indexOf("Right")>-1?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?l.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===r?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===r?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):l.y=Math.abs(e.y+e.height-i.height+5),l}function x(e,t){var i=new He(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var r=document.getElementById(e.id);return r.parentNode.removeChild(r),i}function S(e){return(e.width-e.x)*(e.height-e.y)}function w(e){var t=I(e),i=t.width,r=t.height;return Math.min(i,r)}function I(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function O(e,t,i){var r=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,l=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=r.left+o-a,h=r.top+l-n;return new Ge(e-s,t-h)}function L(e,i,r,o){var l,n,a=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(r)&&isNaN(r))return null;for(var s=0;s<e.length;s++){var h=!1,d=r;t.isNullOrUndefined(e[s].from)||t.isNullOrUndefined(e[s].to)||t.isNullOrUndefined(e[s].value)?(t.isNullOrUndefined(e[s].from)||t.isNullOrUndefined(e[s].to))&&t.isNullOrUndefined(e[s].value)||(r>=e[s].from&&e[s].to>=r||e[s].value===i)&&(e[s].value===i&&(h=!0),l="[object Array]"===Object.prototype.toString.call(e[s].color)?h?e[s].color[0]:P(e[s],d):e[s].color):r>=e[s].from&&e[s].to>=r&&e[s].value===i&&(h=!0,l="[object Array]"===Object.prototype.toString.call(e[s].color)?h?e[s].color[0]:P(e[s],d):e[s].color),(r>=e[s].from&&r<=e[s].to||e[s].value===i)&&!t.isNullOrUndefined(e[s].minOpacity)&&!t.isNullOrUndefined(e[s].maxOpacity)&&l&&(n=M(o,e[s],l,r)),(""===l||t.isNullOrUndefined(l))&&t.isNullOrUndefined(e[s].from)&&t.isNullOrUndefined(e[s].to)&&t.isNullOrUndefined(e[s].minOpacity)&&t.isNullOrUndefined(e[s].maxOpacity)&&t.isNullOrUndefined(e[s].value)&&(l="[object Array]"===Object.prototype.toString.call(e[s].color)?e[s].color[0]:e[s].color),n=t.isNullOrUndefined(n)?"1":n,a.push(l)}for(var p=a.length-1;p>=0;p--)p=(l=a[p])?-1:p;return{fill:l,opacity:n}}function M(e,t,i,r){var o=1;if(r>=t.from&&r<=t.to){o=(r-t.from)/(t.to-t.from)*(t.maxOpacity-t.minOpacity)+t.minOpacity}return o.toString()}function P(e,t){return T(e,t)}function N(e,t,i){return"#"+W(e)+W(t)+W(i)}function T(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:N((i=E(Number(t),e)).r,i.g,i.b)}function E(e,t){var i=t.from,r=t.to,o=0,l=r-i;o=(e-i)/l;var n,a;if(t.color.length<=2)n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);else{n="#"===t.color[0].charAt(0)?t.color[0]:X(t.color[0]),a="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:X(t.color[t.color.length-1]);for(var s=l/(t.color.length-1),h=t.color.length-1,d=[],p={},c=1;c<h;c++)p={b:i+c*s,color:t.color[c]},d.push(p);for(var g=0;g<d.length;g++)i<=e&&e<=d[g].b&&0===g?(a="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),o=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s):d[g].b<=e&&e<=r&&g===d.length-1&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),o=e<d[g].b?1-Math.abs((e-d[g].b)/s):(e-d[g].b)/s),g!==d.length-1&&g<d.length&&d[g].b<=e&&e<=d[g+1].b&&(n="#"===d[g].color.charAt(0)?d[g].color:X(d[g].color),a="#"===d[g+1].color.charAt(0)?d[g+1].color:X(d[g+1].color),o=Math.abs(e-d[g+1].b)/s)}return F(o,n,a)}function F(e,t,i){var r=i.split("#")[1],o=t.split("#")[1],l=D(e,parseInt(o.substr(0,2),16),parseInt(r.substr(0,2),16)),n=D(e,parseInt(o.substr(2,2),16),parseInt(r.substr(2,2),16)),a=D(e,parseInt(o.substr(4,2),16),parseInt(r.substr(4,2),16));return new Ve(l,n,a)}function D(e,t,i){var r=i-t;return Math.round(t+r*e)}function _(e,t,i){for(var r,o=t.split(" "),l="",s=[],h=0,d=o.length;h<d;h++)r=o[h],n(l.concat(r),i).width<e?l=l.concat((""===l?"":" ")+r):""!==l?(s.push(a(e,l,i)),l=r):(s.push(a(e,r,i)),r=""),l&&h===d-1&&s.push(a(e,l,i));return s}function R(e,t,i){var r=[],o=0,l=n(t,i).width,a=t.length;if(e>=l)return r.push(t),r;for(var s=t.length;s>o;s--){var h=t.slice(o,s);if((l=n(h,i).width)<=e){if(r.push(h),o+=h.length,a===o)return r;s=a+1}}return r}function B(e,t,i,r){var o=n(i,r);return o.width>e||o.height>t?" ":i}function U(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function H(e,t,i){var r=e.levelSelection;if(r)for(var o=0;o<r.length;o++)t.getAttribute("id")===r[o]?t.childElementCount>0&&(t.children[0].setAttribute("class",i),z(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function k(e,t){var i=e.legendId;if(i)for(var r=0;r<i.length;r++)for(var o=0;o<t.childElementCount;o++)t.childNodes[o].id===i[r]&&(t.childNodes[o].setAttribute("fill",e.selectionSettings.fill),t.childNodes[o].setAttribute("stroke",e.selectionSettings.border.color),t.childNodes[o].setAttribute("stroke-width",e.selectionSettings.border.width.toString()),t.childNodes[o].setAttribute("opacity",e.selectionSettings.opacity))}function A(e,i,r){for(var o,l=0;l<e.length;l++)z(o=t.isNullOrUndefined(e[l].childNodes[0])?e[l]:e[l].childNodes[0],r.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options),e[l].classList.remove(i),l-=1}function z(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)||e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function j(e,i,r){if(t.isNullOrUndefined(e))return null;for(var o=0,l=Object.keys(i);o<l.length;o++){var n=l[o];e=e.split("${"+n+"}").join(G(i[n],r).toString())}return e}function G(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function V(e){return"#"+W(e.r)+W(e.g)+W(e.b)}function W(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new Ve(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Ve(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e,e=window.getComputedStyle(t).color;var i=/^(rgb|hsl)(a?)[(]\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*,\s*([\d.]+\s*%?)\s*(?:,\s*([\d.]+)\s*)?[)]$/.exec(e);return V(new Ve(parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10)))}function J(e,t,r,o,l,n){var a=new i.SvgRenderer(""),s=Y(e,r,t,l,o),h=a["draw"+s.functionName](s.renderOption);return h.setAttribute("aria-label",n),h}function Y(e,i,r,o,l){var n,a="Path",s=i.width,h=i.height,d=e.x,p=e.y,c=e.x+-s/2,g=e.y+-h/2;switch(r){case"Circle":case"Bubble":a="Ellipse",t.merge(o,{rx:s/2,ry:h/2,cx:d,cy:p});break;case"VerticalLine":n="M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(o,{d:n});break;case"Diamond":n="M "+c+" "+p+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+p+" L "+d+" "+(p+h/2)+" L "+c+" "+p+" z",t.merge(o,{d:n});break;case"Rectangle":n="M "+c+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(p+h/2)+" L "+c+" "+(p+-h/2)+" z",t.merge(o,{d:n});break;case"Triangle":n="M "+c+" "+(p+h/2)+" L "+d+" "+(p+-h/2)+" L "+(d+s/2)+" "+(p+h/2)+" L "+c+" "+(p+h/2)+" z",t.merge(o,{d:n});break;case"InvertedTriangle":n="M "+(d+s/2)+" "+(p-h/2)+" L "+d+" "+(p+h/2)+" L "+(d-s/2)+" "+(p-h/2)+" L "+(d+s/2)+" "+(p-h/2)+" z",t.merge(o,{d:n});break;case"Pentagon":for(var u=void 0,m=void 0,f=0;f<=5;f++)u=s/2*Math.cos(Math.PI/180*(72*f)),m=s/2*Math.sin(Math.PI/180*(72*f)),n=0===f?"M "+(d+u)+" "+(p+m)+" ":n.concat("L "+(d+u)+" "+(p+m)+" ");n=n.concat("Z"),t.merge(o,{d:n});break;case"Star":n="M "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" L "+(e.x-i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x+i.width/2)+" "+(e.y+i.height/6)+" L "+(e.x-i.width/3)+" "+(e.y-i.height/2)+" L "+e.x+" "+(e.y+i.height/2)+" L "+(e.x+i.width/3)+" "+(e.y-i.height/2)+" Z",t.merge(o,{d:n});break;case"Cross":n="M "+c+" "+p+" L "+(d+s/2)+" "+p+" M "+d+" "+(p+h/2)+" L "+d+" "+(p+-h/2),t.merge(o,{d:n});break;case"Image":a="Image",t.merge(o,{href:l,height:h,width:s,x:c,y:g})}return{renderOption:o,functionName:a}}function Z(e,t){for(var i=!1,r=0;r<e.length;r++)if(t.levelOrderName===e[r].levelOrderName){i=!0;break}return i}function Q(e,t){if(e.length>0)for(var i=0;i<e.length;i++){var r=e[i];K(r.legendEle,r.oldFill,r.oldOpacity,r.oldBorderColor,r.oldBorderWidth)}}function $(e,t){if(e.length>0)for(var i=0;i<e.length;i++){var r=e[i];K(r.legendEle,r.oldFill,r.oldOpacity,r.oldBorderColor,r.oldBorderWidth);for(var o=r.ShapeCollection.Elements.length,l=0;l<o;l++)K(r.ShapeCollection.Elements[l],r.shapeOldFill,r.shapeOldOpacity,r.shapeOldBorderColor,r.shapeOldBorderWidth)}}function K(e,t,i,r,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",r),e.setAttribute("stroke-width",o)}function ee(e,t,i){Q(e),A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,t,i){for(var r,o=0;o<e;o++)for(var l=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<l;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){r=o;break}return r}function ie(e,t,i,r,o,l,n){e.push({legendEle:r,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:l[i].options.fill,shapeOldOpacity:l[i].options.opacity,shapeOldBorderColor:l[i].options.border.color,shapeOldBorderWidth:l[i].options.border.width})}function re(e,i,r,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:r}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function oe(e){var i=document.getElementById(e);return i?t.remove(i):null}function le(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue"};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter"};break;case"bootstrap5":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#212529",subTitleFontColor:"#212529",tooltipFillColor:"#212529",tooltipFontColor:"#F9FAFB",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Helvetica Neue",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"bootstrap5dark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#FFFFFF",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#E9ECEF",tooltipFontColor:"#212529",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Helvetica Neue",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Helvetica Neue"};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI"};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif"}}return t}var ne="beforePrint",ae="itemRendering",se="drillStart",he="drillEnd",de="itemSelected",pe="itemHighlight",ce="tooltipRendering",ge="itemClick",ue="itemMove",me="doubleClick",fe="rightClick",ye="mouseMove",ve="legendItemRendering",be="legendRendering",xe="resize",Se="Roboto, Segoe UI, Noto, Sans-serif",we=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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ie=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},Ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("#808080")],i.prototype,"color",void 0),Ie([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),Oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(10)],i.prototype,"left",void 0),Ie([t.Property(10)],i.prototype,"right",void 0),Ie([t.Property(10)],i.prototype,"top",void 0),Ie([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"size",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(Se)],i.prototype,"fontFamily",void 0),Ie([t.Property("Normal")],i.prototype,"fontWeight",void 0),Ie([t.Property("Normal")],i.prototype,"fontStyle",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property("")],i.prototype,"text",void 0),Ie([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null},Le)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),i}(Me),Ne=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Complex({fontFamily:null},Le)],i.prototype,"textStyle",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Complex({},Pe)],i.prototype,"subtitleSettings",void 0),i}(Me),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"from",void 0),Ie([t.Property(null)],i.prototype,"to",void 0),Ie([t.Property(null)],i.prototype,"color",void 0),Ie([t.Property(null)],i.prototype,"label",void 0),Ie([t.Property(null)],i.prototype,"value",void 0),Ie([t.Property(null)],i.prototype,"minOpacity",void 0),Ie([t.Property(null)],i.prototype,"maxOpacity",void 0),Ie([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),Ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("Default")],i.prototype,"mode",void 0),Ie([t.Property("transparent")],i.prototype,"background",void 0),Ie([t.Property("Circle")],i.prototype,"shape",void 0),Ie([t.Property("")],i.prototype,"width",void 0),Ie([t.Property("")],i.prototype,"height",void 0),Ie([t.Complex({fontFamily:null},Le)],i.prototype,"textStyle",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(15)],i.prototype,"shapeWidth",void 0),Ie([t.Property(15)],i.prototype,"shapeHeight",void 0),Ie([t.Property(10)],i.prototype,"shapePadding",void 0),Ie([t.Property(null)],i.prototype,"imageUrl",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"border",void 0),Ie([t.Complex({color:"#000000",width:0},Ce)],i.prototype,"shapeBorder",void 0),Ie([t.Complex({},Me)],i.prototype,"title",void 0),Ie([t.Complex({size:"14px"},Le)],i.prototype,"titleStyle",void 0),Ie([t.Property("Bottom")],i.prototype,"position",void 0),Ie([t.Property("None")],i.prototype,"orientation",void 0),Ie([t.Property(!1)],i.prototype,"invertedPointer",void 0),Ie([t.Property("After")],i.prototype,"labelPosition",void 0),Ie([t.Property("None")],i.prototype,"labelDisplayMode",void 0),Ie([t.Property("Center")],i.prototype,"alignment",void 0),Ie([t.Property({x:0,y:0})],i.prototype,"location",void 0),Ie([t.Property(null)],i.prototype,"showLegendPath",void 0),Ie([t.Property(null)],i.prototype,"valuePath",void 0),Ie([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),Fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupIndex",void 0),Ie([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),De=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(0)],i.prototype,"gap",void 0),Ie([t.Property(10)],i.prototype,"padding",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showLabels",void 0),Ie([t.Property(null)],i.prototype,"labelPath",void 0),Ie([t.Property(null)],i.prototype,"labelFormat",void 0),Ie([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),Ie([t.Complex({color:null,size:"12px"},Le)],i.prototype,"labelStyle",void 0),Ie([t.Property(null)],i.prototype,"labelTemplate",void 0),Ie([t.Property("Center")],i.prototype,"templatePosition",void 0),Ie([t.Property("Trim")],i.prototype,"interSectAction",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),_e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"visible",void 0),Ie([t.Property("")],i.prototype,"template",void 0),Ie([t.Property(null)],i.prototype,"format",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(.75)],i.prototype,"opacity",void 0),Ie([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Complex({fontFamily:Se,size:"13px"},Le)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),Re=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Be=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(!1)],i.prototype,"enable",void 0),Ie([t.Property("#808080")],i.prototype,"fill",void 0),Ie([t.Property("0.5")],i.prototype,"opacity",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return we(i,e),Ie([t.Property(null)],i.prototype,"groupPath",void 0),Ie([t.Property(0)],i.prototype,"groupGap",void 0),Ie([t.Property(10)],i.prototype,"groupPadding",void 0),Ie([t.Complex({},Ce)],i.prototype,"border",void 0),Ie([t.Property(null)],i.prototype,"fill",void 0),Ie([t.Property(!1)],i.prototype,"autoFill",void 0),Ie([t.Property(1)],i.prototype,"opacity",void 0),Ie([t.Property(!0)],i.prototype,"showHeader",void 0),Ie([t.Property(20)],i.prototype,"headerHeight",void 0),Ie([t.Property(null)],i.prototype,"headerTemplate",void 0),Ie([t.Property(null)],i.prototype,"headerFormat",void 0),Ie([t.Property("Near")],i.prototype,"headerAlignment",void 0),Ie([t.Complex({color:null,size:"13px"},Le)],i.prototype,"headerStyle",void 0),Ie([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),Ie([t.Collection([],Te)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),He=function(){return function(e,t){this.width=e,this.height=t}}(),ke=function(){return function(e,t,i,r){this.x=e,this.y=t,this.width=i,this.height=r}}(),Ae=function(){return function(e,t,i,r,o,l){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=r,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=l}}(),ze=function(){return function(e,t,i,r,o,l,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=r,this["stroke-width"]=i,this["stroke-dasharray"]=l,this.d=n}}(),je=function(){return function(e,t,i,r,o,l,n,a){void 0===l&&(l=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=l,this.anchor=r,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a}}(),Ge=function(){return function(e,t){this.x=e,this.y=t}}(),Ve=function(){return function(e,t,i){this.r=e,this.g=t,this.b=i}}(),We=function(){return function(e,t,i,r,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=r,this.sendData=o}}(),qe=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(Ke.levelsData&&Ke.levelsData.length>0)if(e=t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(t.isNullOrUndefined(this.treemap.drilledItems)?!t.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?Ke.levelsData[0]:this.getDrilldownData(Ke.levelsData[0],[])[0],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),t.isNullOrUndefined(this.treemap.currentLevel)||(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(t.isNullOrUndefined(this.treemap.drilledItems)?t.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||Ke.levelsData[0],i),this.renderLayoutItems(e||Ke.levelsData[0]);else{var r=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[r].data,l={};l[this.treemap.drilledItems[r].data.groupName]=[o],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[r].data.groupIndex),this.calculateLayoutItems(l||Ke.levelsData[0],i),this.renderLayoutItems(l||Ke.levelsData[0])}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,r={},o=m(e).values;if(o&&o.length>0&&0===t.length){for(var l=0;l<o.length;l++)o[l].groupIndex===i.initialDrillDown.groupIndex&&o[l].name===i.initialDrillDown.groupName&&(o[l].isDrilled=!0,r[o[l].groupName]=[o[l]],t.push(r));for(var n=0;n<o.length;n++)this.getDrilldownData(o[n],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],t.isNullOrUndefined(this.treemap.weightValuePath)||(this.treemap.layoutType.indexOf("SliceAndDice")>-1?this.computeSliceAndDiceDimensional(e,i):(i.height=i.height+i.y,i.width=i.width+i.x,this.computeSquarifyDimensional(e,i)))},e.prototype.computeSliceAndDiceDimensional=function(e,t){var i,r,o,l,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=m(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var h=0;h<s.length;h++)r=s[h].groupIndex,o=0===a.length||r===a.length?n.gap:a[r].groupGap,l=0===a.length?0:a[r]?a[r].showHeader?a[r].headerHeight:0:a[r-1].showHeader?a[r-1].headerHeight:0,i=s[h].rect,i=new ke(i.x+o/2,i.y+(l+o/2),i.width-o,Math.abs(i.height-(o+l))),this.computeSliceAndDiceDimensional(s[h],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var r,o=i.height*i.width,l=this.treemap.levels,n=0,a=0;e.forEach(function(e){a+=e.weight}),e.forEach(function(e){e.weightArea=o*e.weight/a});var s="SliceAndDiceAuto"===this.treemap.layoutType?i.width>i.height:"SliceAndDiceHorizontal"===this.treemap.layoutType;e.sort(g);for(var h=0;h<e.length;h++){var d=e[h];d.isLeafItem=0===l.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===l.length-1:d.groupIndex===this.treemap.levels.length),s?(r=o/a*e[h].weight/i.height,n<=i.width&&(e[h].rect=new ke(n+i.x,i.y,r,i.height))):(r=o/a*e[h].weight/i.width,n<=i.height&&(e[h].rect=new ke(i.x,n+i.y,i.width,r))),n+=r,this.renderItems.push(e[h])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,r,o,l,n,a=this.treemap.leafItemSettings,s=this.treemap.levels,h=m(e).values;if(h&&h.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(h)),this.calculateChildrenLayout(e,h,t),this.treemap.levels.length>0))for(var d=0;d<h.length;d++)o=(r=h[d]).groupIndex,i=r.rect,l=(r.isLeafItem?a.padding:s[o].groupPadding)/2,n=this.treemap.isHierarchicalData?0===o&&r.isLeafItem?0:s[o]&&s[o].showHeader?s[o].headerHeight:0:0===s.length?0:s[o]&&s[o].showHeader?s[o].headerHeight:0,i=new ke(i.x+l,i.y+(n+l),i.width-l,i.height-l),!r.isLeafItem&&r.weight>0&&this.computeSquarifyDimensional(h[d],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,S(i)),t.sort(U),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,r){var o=e.length;if(0===o){var l=this.getCoordinates(t,i);return u=r.concat(l)}var n=w(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,n)){var h=t.concat(a);return this.performRowsLayout(s,h,i,r)}for(var d=t.length,p=0,c=0;c<d;c+=1)p+=t[c].itemArea;var g=this.cutArea(i,p),u=(l=this.getCoordinates(t,i),r.concat(l));return this.performRowsLayout(e,[],g,u)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var r=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(r,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,r=1/0,o=-1/0,l=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<r&&(r=a),a>o&&(o=a),l+=a}return Math.max(Math.pow(t,2)*o/Math.pow(l,2),Math.pow(l,2)/(Math.pow(t,2)*r))},e.prototype.cutArea=function(e,t){var i=I(e),r=i.width,o=i.height,l=i.x,n=i.y;if(r>=o){var a=t/o;return C({x:l+a,y:n,width:r-a,height:o})}var s=t/r;return C({x:l,y:n+s,width:r,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var r,o=I(i),l=o.width,n=o.height,a=o.x,s=o.y,h=e.length,d=this.treemap.levels,p=this.treemap.leafItemSettings,c=0,g=0;g<h;g+=1)c+=e[g].itemArea;var u,m,f,y=c/n,v=c/l,b=a,x=s,S=[];for(g=0;g<h;g+=1){var w=e[g];if(r=w.groupIndex,w.isLeafItem=0===d.length||(this.treemap.isHierarchicalData?r===d.length:!t.isNullOrUndefined(p.labelPath)&&r===d.length),m=Z(this.parentData[0],w),f=m?this.treemap.areaRect:w.parent.rect,u=w.isLeafItem?p.padding:d[r].groupPadding,l>=n){var C=x+w.itemArea/y;w.rect={x:b,y:x,width:b+y,height:C},x=C}else{var O=b+w.itemArea/v;w.rect={x:b,y:x,width:O,height:x+v},b=O}w.weight>0&&(m||Math.round(i.y+u/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+u/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(w),S.push(w))}return S},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,r=[],o=0;o<i;o+=1){for(var l=e.length,n=0,a=0;a<l;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<l;d++)(h=e[d]).itemArea=h.weight*s,r.push(h)}return r},e.prototype.onDemandProcess=function(e){var i,r={};r=e[0].parent,this.treemap.currentLevel=r.isDrilled?r.groupIndex:null;var o={};t.isNullOrUndefined(r.groupName)?o=r:o[r.groupName]=[r],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var l=this.treemap.levels.length,n=0;n<l;n++){l===e[0].groupIndex?this.treemap.levels[l]=this.treemap.levels[n]:this.treemap.levels.splice(l-1,1)}this.calculateLayoutItems(o,i),this.renderLayoutItems(o)},e.prototype.renderLayoutItems=function(e){var i,r,o,l,n=this,a=this.treemap;this.renderer=a.renderer;var s,h,d,p,c,g,u,f,y,v,b,x,S,w=a.element.id,C=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",M=document.getElementById(a.element.id+"_Secondary_Element"),P=a.levels;this.layoutGroup=this.renderer.createGroup({id:w+"_TreeMap_"+C+"_Layout"});for(var N,T,E,F,D,_=t.createElement("div",{id:a.element.id+"_Label_Template_Group",className:"template",styles:"overflow: hidden; position: absolute;pointer-events: none;top:"+a.areaRect.y+"px;left:"+a.areaRect.x+"px;height:"+a.areaRect.height+"px;width:"+a.areaRect.width+"px;"}),R=!1,B=a.leafItemSettings,U=function(e){if(u=k.renderItems[e],h=u.groupIndex,k.treemap.drillDownView&&t.isNullOrUndefined(k.treemap.currentLevel)&&h>0||k.treemap.drillDownView&&h>k.treemap.currentLevel+1)return"continue";p=u.rect,R=u.isLeafItem,v=w+"_Level_Index_"+h+"_Item_Index_"+e,N=k.renderer.createGroup({id:v+"_Group"}),x=(R?B.gap:P[h].groupGap)/2;var C=k.treemap.totalRect?I(k.treemap.totalRect):k.treemap.areaRect;"Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-x,p.height=Math.abs(p.y-p.height)-x),"TopRightBottomLeft"===a.renderDirection?p.x=C.x+C.width-p.width-Math.abs(C.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=C.y+C.height-p.height-Math.abs(C.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=C.x+C.width-p.width-Math.abs(C.x-p.x),p.y=C.y+C.height-p.height-Math.abs(C.y-p.y)),R?B.colorMapping:P[h].colorMapping,o=k.getItemColor(R,u),g=o.fill,y=o.opacity,c=R?B.labelFormat:P[h].headerFormat;var U;if(r=R?B.showLabels:P[h].showHeader,h===k.treemap.currentLevel)if(k.treemap.enableBreadcrumb){D="#"+k.treemap.breadcrumbConnector+"#",U=u.levelOrderName.replace(/#/gi,D),U=0!==h?"#"+U:U}else U=u.name;else k.treemap.enableBreadcrumb&&(u.isDrilled=!1),U=u.name;f=j(c,u.data,k.treemap)||U||"undefined",F=m(u).values,f=!R&&F&&F.length>0&&k.treemap.enableDrillDown?u.isDrilled?a.enableRtl?f+" [-]":"[-] "+f:a.enableRtl?f+" [+]":"[+] "+f:f,(S=R?B.labelStyle:P[h].headerStyle).fontFamily=k.treemap.themeStyle.labelFontFamily||S.fontFamily,E=R?B.border:P[h].border,i=R?B.labelPosition:"Near"===P[h].headerAlignment?"TopLeft":"Center"===P[h].headerAlignment?"TopCenter":"TopRight",d=R?B.templatePosition:P[h].templatePosition,T=R?B.labelTemplate:P[h].headerTemplate,u.options={border:E,opacity:y,fill:g},l={cancel:!1,name:ae,treemap:k.treemap,text:f,currentItem:u,RenderItems:k.renderItems,options:u.options},k.treemap.trigger(ae,l,function(o){if(!o.cancel){L=" M "+p.x+" "+p.y+" L "+(p.x+p.width)+" "+p.y+" L "+(p.x+p.width)+" "+(p.y+p.height)+" L "+p.x+" "+(p.y+p.height)+"z",s=new ze(v+"_RectPath",g,E.width,E.color,y,null,L);var a=n.renderer.drawPath(s);N.appendChild(a),r&&(l.text!==f&&(l.text=j(l.text,u.data,n.treemap)||U),n.renderItemText(l.text.toString(),N,S,p,O,v,g,i,D)),T&&(b=n.renderTemplate(M,v,p,d,T,u,R),t.isNullOrUndefined(b)||(_.appendChild(b),n.treemap.renderReactTemplates())),N.setAttribute("aria-label",u.name),N.setAttribute("tabindex",(n.treemap.tabIndex+e+2).toString()),H(n.treemap,N,"treeMapSelection"),n.layoutGroup.appendChild(N)}})},k=this,A=0;A<this.renderItems.length;A++)U(A);_.childNodes.length>0&&M.appendChild(_),this.treemap.svgObject.appendChild(this.layoutGroup)},e.prototype.renderItemText=function(e,i,r,o,l,s,h,p,c){document.getElementById(this.treemap.element.id+"_Secondary_Element"),this.treemap.leafItemSettings;var g,u,m,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,u=this.labelInterSectAction(o,e,r,l),g=n(f&&f[0]||u[0],r),this.treemap.enableRtl){var x=n(e,r),S=e.search("[+]")||e.search("[-]");if(o.width<x.width&&S>0){var w=e.substring(S-1,e.length),I=n("[+]",r);u[0]=a(o.width-I.width-5,u[0],r)+w}}var C=b(o,p,g,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var O=[],L=null,M=[],P=0;P<f.length;P++)v+=(g=n(L=a(o.width-5,f[P],r),r)).height,M.push(g.width),O.push(L);u=O,g.width=Math.max.apply(null,M),g.height=v}if("WrapByWord"===l||"Wrap"===l||"Trim"===l){for(var N=0;N<u.length;N++)v+=(g=n(u[N],r)).height,o.height-5>v&&y.push(u[N]);if("Wrap"===l&&u.length!==y.length&&y.length){var T=y.length-1,E=y[T];E=E.substring(0,E.length-1)+"...",y.splice(T),"..."!==E&&y.push(E)}}else m=u,y.push(m);d(new je(s+"_Text",C.x,C.y,"start",y,"","",c),r,r.color||this.getSaturatedColor(h),i)},e.prototype.getItemColor=function(e,i){var r=this.treemap,o=e?r.leafItemSettings.fill:r.levels[i.groupIndex].fill,l=e?r.leafItemSettings.opacity:r.levels[i.groupIndex].opacity;t.isNullOrUndefined(Ke.defaultLevelsData)||Ke.defaultLevelsData.length>0&&(Ke.levelsData=Ke.defaultLevelsData);var n=m(Ke.levelsData[0]).values,a=e?r.leafItemSettings.colorMapping:r.levels[i.groupIndex].colorMapping;if(a.length>0){var s=L(a,i.data[this.treemap.equalColorValuePath],i.data[this.treemap.rangeColorValuePath],i.data[this.treemap.weightValuePath]);o=t.isNullOrUndefined(s.fill)?r.leafItemSettings.fill:s.fill,l=s.opacity}else for(var h=0;h<n.length;h++)n[h].levelOrderName===i.levelOrderName.split("#")[0]&&(o=t.isNullOrUndefined(o)?t.isNullOrUndefined(r.colorValuePath)?r.palette.length>0?r.palette[h%r.palette.length]:"#808080":n[h].data[r.colorValuePath]:o);return{fill:o,opacity:l}},e.prototype.getSaturatedColor=function(e){var t=e,i=q(X(t="transparent"===t?window.getComputedStyle(document.body,null).backgroundColor:t));return Math.round((299*i.r+587*i.g+114*i.b)/1e3)>=128?"black":"white"},e.prototype.renderTemplate=function(e,i,r,o,l,n,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(l.prototype))for(var d=Object.keys(n.data),p=0;p<d.length;p++)l=l.replace(new RegExp("{{:"+d[p]+"}}","g"),n.data[d[p].toString()]);var c;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var g=b(r,o,x(c=v(y(l)(n.data,this.treemap,l,this.treemap.element.id+h,!1),s,n.data),e),"Template",this.treemap);c.style.left=g.x+"px",c.style.top=g.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,r){var o,l=e.width-10;switch(r){case"Hide":o=[B(l,e.height,t,i)];break;case"Trim":o=[a(l+3,t,i)];break;case"WrapByWord":o=_(l,t,i);break;case"Wrap":o=R(l,t,i)}return o},e}();(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};var Xe=function(){function e(e){this.control=e}return e.prototype.print=function(e){var i=this;this.printWindow=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),this.printWindow.moveTo(0,0),this.printWindow.resizeTo(screen.availWidth,screen.availHeight);var r={cancel:!1,htmlContent:this.getHTMLContent(e),name:ne};this.control.trigger(ne,r,function(){r.cancel||t.print(r.htmlContent,i.printWindow)})},e.prototype.getHTMLContent=function(e){var i=t.createElement("div");return e?e instanceof Array?e.forEach(function(e){i.appendChild(c(e).cloneNode(!0))}):e instanceof Element?i.appendChild(e.cloneNode(!0)):i.appendChild(c(e).cloneNode(!0)):i.appendChild(this.control.element.cloneNode(!0)),i},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(e){},e}(),Je=function(){function e(e){this.control=e}return e.prototype.export=function(e,i,r){var o=this;return new Promise(function(l,n){var a=t.createElement("canvas",{id:"ej2-canvas",attrs:{height:o.control.availableSize.height.toString(),width:o.control.availableSize.width.toString()}}),s=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),h='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+o.control.svgObject.outerHTML+"</svg>",d=window.URL.createObjectURL(new Blob("SVG"===e?[h]:[(new XMLSerializer).serializeToString(o.control.svgObject)],{type:"image/svg+xml"}));if("SVG"===e)r?re(i,e,d,s):l(null);else{var p=new Image,c=a.getContext("2d");p.onload=function(){c.drawImage(p,0,0),window.URL.revokeObjectURL(d),r?re(i,e,a.toDataURL("image/png").replace("image/png","image/octet-stream"),s):"JPEG"===e?l(a.toDataURL("image/jpeg")):"PNG"===e&&l(a.toDataURL("image/png"))},p.src=d}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(e){},e}(),Ye=function(){function e(e){this.control=e}return e.prototype.export=function(e,i,r,l){var n=this;return new Promise(function(e,a){var s=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:n.control.availableSize.width.toString(),height:n.control.availableSize.height.toString()}});t.Browser.userAgent.toString().indexOf("HeadlessChrome");r=t.isNullOrUndefined(r)?o.PdfPageOrientation.Landscape:r;var h=n.control.svgObject.cloneNode(!0),d=h.childNodes[0];if(!t.isNullOrUndefined(d)){var p=d.getAttribute("fill");"Tailwind"!==n.control.theme&&"TailwindDark"!==n.control.theme&&"Bootstrap5"!==n.control.theme&&"Bootstrap5Dark"!==n.control.theme&&"Fluent"!==n.control.theme&&"FluentDark"!==n.control.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||h.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var c=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(h)],{type:"image/svg+xml"})),g=new Image,u=s.getContext("2d");g.onload=function(){u.drawImage(g,0,0),window.URL.revokeObjectURL(c);var t=new o.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=r,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(a),0,0,n.control.availableSize.width-60,n.control.availableSize.height),l?(t.save(i+".pdf"),t.destroy()):e(null)},g.src=c})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(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 r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qe=function(e,t,i,r){var o,l=arguments.length,n=l<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(l<3?o(n):l>3?o(t,i,n):o(t,i))||n);return l>3&&n&&Object.defineProperty(t,i,n),n},$e=function(e){function o(t,i){var r=e.call(this,t,i)||this;return r.isResize=!1,r.orientation="Horizontal",r.drilledItems=[],r.isHierarchicalData=!1,r.levelSelection=[],r.legendId=[],r}return Ze(o,e),o.prototype.preRender=function(){var e=this;this.trigger("load",{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},o.prototype.render=function(){this.renderElements()},o.prototype.renderElements=function(){Ke.levelsData=null,Ke.defaultLevelsData=null,Ke.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=le(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(Ke.levelsData)||(Ke.defaultLevelsData=Ke.levelsData),this.processDataManager()},o.prototype.processDataManager=function(){var e,i,o,l,n=this;if(this.dataSource instanceof r.DataManager){e=this.dataSource,i=this.query instanceof r.Query?this.query:new r.Query;e.executeQuery(i).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})}else this.dataSource instanceof We?(l=this.dataSource,(o=new t.Ajax(l.dataOptions,l.type,l.async,l.contentType)).onSuccess=function(e){n.dataSource=JSON.parse("["+e+"]")[0],n.renderTreeMapElements()},o.send(l.sendData)):this.renderTreeMapElements()},o.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger("loaded",{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},o.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}this.clearTemplate();var e=this.element.clientWidth,i=this.element.clientHeight;this.availableSize=new He(l(this.width,e)||e||600,l(this.height,i)||i||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},o.prototype.initPrivateVariable=function(){if(""===this.element.id){var e=document.getElementsByClassName("e-treemap").length;this.element.id="treemap_control_"+e}this.renderer=new i.SvgRenderer(this.element.id),this.layout=new qe(this)},o.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),t.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))){var i=t.createElement("div",{id:this.element.id+"_Secondary_Element",styles:"position: absolute;z-index:1;"});this.element.appendChild(i)}},o.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!t.isNullOrUndefined(this.svgObject)&&!t.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!t.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},o.prototype.renderBorder=function(){var e=this.border.width,i=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");if((this.border.width>0||this.background||this.themeStyle.backgroundColor)&&t.isNullOrUndefined(i)){var r=new Ae(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new ke(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(r))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},o.prototype.renderTitle=function(e,i,r,o){var l,h={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},p=this.availableSize.width-this.margin.right-this.margin.left;if(h.fontFamily=h.fontFamily||this.themeStyle.fontFamily,h.size=h.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){t.isNullOrUndefined(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var c=a(p,e.text,h),g=n(c,h),u=s(t.isNullOrUndefined(r)?new ke(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):r,e.alignment,g,i),m=new je(this.element.id+"_TreeMap_"+i,u.x,u.y,"start",c),f=new ke(u.x,u.y,g.width,g.height),y=d(m,h,h.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);y.setAttribute("aria-label",e.description||e.text),y.setAttribute("tabindex",(this.tabIndex+("title"===i?1:2)).toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(l=this.availableSize.height-f.y-10-this.margin.bottom,this.areaRect=new ke(this.margin.left,f.y+10,p,l)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",f,o):this.svgObject.appendChild(o)}else l=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new ke(this.margin.left,this.margin.top,p,l)},o.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(Ke.levelsData=[],this.dataSource.map(function(e){e[i.weightValuePath]=e[i.weightValuePath]?e[i.weightValuePath].toString():e[i.weightValuePath]}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var r={};r.level=0,e=this.leafItemSettings.labelPath,r[e]=[];for(var o=0;o<this.dataSource.length;o++){var l=m(this.dataSource[o]).values;this.isHierarchicalData&&l&&l.length>0?l.forEach(function(t,o){t[e]&&r[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[o][e]&&r[e].push({groupIndex:0,name:this.dataSource[o][e],levelOrderName:this.dataSource[o][e].toString(),data:this.dataSource[o],weight:this.dataSource[o][this.weightValuePath]})}Ke.levelsData.push(r)}else{if(this.isHierarchicalData){Ke.hierarchyData=[],Ke.hierarchyData=t.extend([],this.dataSource,Ke.hierarchyData,!0);for(o=0;o<Ke.hierarchyData.length;o++)this.processHierarchicalData(Ke.hierarchyData[o],o);Ke.levelsData=Ke.hierarchyData}else this.processFlatJsonData(),Ke.levelsData.length>1&&this.reOrderLevelData(Ke.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(Ke.levelsData[0][e],"Parent")}},o.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=m(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},o.prototype.processHierarchicalData=function(e,i){var r,o,l,n=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=m(e),(r=a?a.values:null)&&r.length>0){l=a.key;for(var h=0;h<this.levels.length;h++)l===this.levels[h].groupPath&&(this.levels[h],o=h);for(var d=0;d<r.length;d++){r[d].name=r[d][s],r[d].levelOrderName=(0===o?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var p=r[d].levelOrderName,c=void 0;p.search("#")>0&&(c=p.split("#").length-1),r[d].groupIndex=t.isNullOrUndefined(o)?c===this.levels.length?this.levels.length:c:o,0!==o&&(r[d].parent=e),r[d].groupName=l,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach(function(e){n.processHierarchicalData(e,i)})}if(i===Ke.hierarchyData.length-1){for(var g=Ke.hierarchyData[0][this.levels[0].groupPath],u=0;u<Ke.hierarchyData.length;u++)r=m(Ke.hierarchyData[u]).values,0!==u&&r&&(r.forEach(function(e){g.push(e)}),Ke.hierarchyData.splice(u,1),u-=1);g=Ke.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<g.length;f++)a[this.levels[0].groupPath]=g,g[f].parent=a}},o.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(e)},o.prototype.export=function(e,i,r,o){var l=this;return t.isNullOrUndefined(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,n){t(l.pdfExportModule.export(e,i,r,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,r){t(l.imageExportModule.export(e,i,o))}):null},o.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e,i=[],r=0;r<this.levels.length+1;r++){e=this.levels[r]?this.levels[r].groupPath:this.leafItemSettings.labelPath;var o={};o.level=r,o[e]=[],Ke.levelsData.push(o);for(var l=0;l<this.dataSource.length;l++){var n={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[l][e];if(0!==r)for(var h=0;h<=r;h++){var d=this.levels[h]?this.levels[h].groupPath:e;a+=this.dataSource[l][d]+(h===r?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(n.name=s,n.levelOrderName=(a||s)+"",n.groupIndex=r,n.isDrilled=!1,n.groupName=e,n.data=this.dataSource[l],Ke.levelsData[Ke.levelsData.length-1][e].push(n),i.push(a||s))}}}},o.prototype.reOrderLevelData=function(e){for(var i,r=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,l=Ke.levelsData[e][r],n=Ke.levelsData[e-1][o],a=0;a<l.length;a++){i=l[a].levelOrderName;for(var s=0;s<n.length;s++)if(n[s][r]=t.isNullOrUndefined(n[s][r])?[]:n[s][r],this.IsChildHierarchy(i.split("#"),n[s].levelOrderName.split("#"))){t.isNullOrUndefined(l[a].parent)&&(l[a].parent=n[s]),n[s][r].push(l[a]);break}}this.findTotalWeight(Ke.levelsData[Ke.levelsData.length-1][r],"Child"),Ke.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},o.prototype.IsChildHierarchy=function(e,t){for(var i=!1,r=0;r<t.length;r++){if(e.length<r||t[r]!==e[r])return!1;i=!0}return i},o.prototype.findTotalWeight=function(e,t){for(var i,r,o,l=this,n={},a=function(a){i=0,o=e[a].groupName,r=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){u(r,e[a].levelOrderName,t,l)&&(i+=parseFloat(t[l.weightValuePath]))}),"Parent"===t&&(n[o]=e,e[a].parent=n),e[a].weight=i},s=this,h=0;h<e.length;h++)a(h)},o.prototype.unWireEVents=function(){t.EventHandler.remove(this.element,"click",this.clickOnTreeMap),t.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),t.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),t.EventHandler.remove(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap),t.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeOnTreeMap)},o.prototype.wireEVents=function(){t.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),t.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),t.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),t.EventHandler.add(this.element,t.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),t.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),window.addEventListener("resize",this.resizeOnTreeMap.bind(this))},o.prototype.setCulture=function(){this.intl=new t.Internationalization},o.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("tabindex",this.tabIndex.toString())},o.prototype.resizeOnTreeMap=function(e){var i=this;this.isResize=!0;var r={name:xe,cancel:!1,previousSize:this.availableSize,currentSize:new He(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!t.isNullOrUndefined(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),r.currentSize=i.availableSize,i.trigger(xe,r,function(e){i.render()})},500))},o.prototype.clickOnTreeMap=function(e){var i,r,o=this,l=e.target,n=l.id,a=l.innerHTML,s={cancel:!1,name:"click",treemap:this,mouseEvent:e};this.trigger("click",s),n.indexOf("_Item_Index")>-1&&(e.preventDefault(),r=parseFloat(n.split("_Item_Index_")[1]),i={cancel:!1,name:ge,treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:a,contentItemTemplate:a},this.trigger(ge,i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(o.leafItemSettings.labelTemplate)?(e.text=j(e.text,e.item.data,e.treemap),l.innerHTML=e.text):p(n,l,e.contentItemTemplate))}));var h,d=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(h)&&d-h<500&&this.doubleClickOnTreeMap(e),h=d)},o.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:me,treemap:this,mouseEvent:e};this.trigger(me,t)},o.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:fe,treemap:this,mouseEvent:e};this.trigger(fe,t)},o.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),this.notify(t.Browser.touchStartEvent,e)},o.prototype.mouseMoveOnTreeMap=function(e){var i,r,o=e.target.id,l={cancel:!1,name:ye,treemap:this,mouseEvent:e};this.trigger(ye,l);var n;o.indexOf("_Item_Index")>-1&&(n=m(r=this.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])]).values,this.element.style.cursor=!r.isLeafItem&&n&&n.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:ue,treemap:this,item:r,mouseEvent:e},this.trigger(ue,i)),this.notify(t.Browser.touchMoveEvent,e)},o.prototype.calculateSelectedTextLevels=function(e,t){for(var i,r,o,l=t.levelOrderName.split("#"),n=0,a=Object.keys(l);n<a.length;n++)l[r=a[n]]===e&&(i=parseInt(r,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:l}},o.prototype.calculatePreviousLevelChildItems=function(e,i,r,o){for(var l,n,a,s=0,h=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<h;d++)a=0===d?i.levelText[d]:a+"#"+i.levelText[d];s=h>1?h:s;for(var p=0,c=Object.values(this.layout.renderItems);p<c.length;p++){(n=c[p]).levelOrderName.split("#")[0]===i.levelText[0]&&(l=0===s?t.isNullOrUndefined(a)?a:i.levelText[s]:o?a:a+"#"+i.levelText[s])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),o=!0,++s<=r.groupIndex&&(a=l=l+"#"+i.levelText[s]))}return o},o.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var r,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((r=this.drilledItems[i].data.parent).isDrilled=!0,o[r[this.drilledItems[i].data.groupName]]=[r],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},o.prototype.mouseEndOnTreeMap=function(e){var i,r,o,l,n,a,s,h=this,d=e.target,p=d.id,c=!1,g={},u=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",f=this.element.id+"_Label_Template_Group";if(p.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),l=parseFloat(p.split("_Item_Index_")[1]),n=this.layout.renderItems[l];var y=d.innerHTML;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(y,n),a=s.drillLevel,this.drillDownView||-1===y.search("[+]")||(c=this.calculatePreviousLevelChildItems(y,s,n,c))),0!==this.levels.length&&!n.isLeafItem&&m(n).values&&m(n).values.length>0){if(this.drilledItems.length>0){n=c?this.drilledItems[this.drilledItems.length-1].data:n;for(var v=0;v<this.drilledItems.length;v++){if(!t.isNullOrUndefined(a)){var b=this.drilledItems.length;if(g=this.compareSelectedLabelWithDrillDownItems(s,n,v),b!==this.drilledItems.length){v-=1;break}}if(n.levelOrderName===this.drilledItems[v].name&&!c&&t.isNullOrUndefined(a)){0===n.groupIndex&&n.parent[n.groupName]instanceof Array?(n.isDrilled=!n.isDrilled,n.isDrilled?g[n.groupName]=[n]:g=n.parent):(n.isDrilled=!1,n.parent.isDrilled=!0,n=n.parent,g[n.groupName]=[n]),this.drilledItems.splice(v,1),v-=1;break}v===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(n.isDrilled=!0,g[n.groupName]=[n])}}else n.isDrilled=!0,g[n.groupName]=[n];r={cancel:!1,name:se,treemap:this,element:d,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:n.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.name:n.name,rightClick:3===e.which,childItems:null,item:g},this.trigger(se,r,function(e){if(h.currentLevel=n.isDrilled&&t.isNullOrUndefined(a)?n.groupIndex:!t.isNullOrUndefined(a)&&h.enableBreadcrumb&&n.isDrilled?a:null,!e.cancel){if(document.getElementById(u)){var r=document.getElementById(u);r.parentNode.removeChild(r)}if(i=t.extend({},h.areaRect,i,!0),h.legendSettings.visible&&!t.isNullOrUndefined(h.treeMapLegendModule)&&(t.isNullOrUndefined(g)||(h.treeMapLegendModule.legendGroup.textContent="",h.treeMapLegendModule.legendGroup=null,h.treeMapLegendModule.widthIncrement=0,h.treeMapLegendModule.heightIncrement=0,h.enableBreadcrumb&&!t.isNullOrUndefined(a)?h.drilledLegendItems={name:h.drilledItems[h.drilledItems.length-1].data.levelOrderName,data:h.drilledItems[h.drilledItems.length-1].data}:h.drilledLegendItems={name:n.levelOrderName,data:n},h.treeMapLegendModule.renderLegend()),i=t.isNullOrUndefined(h.totalRect)?i:h.totalRect),document.getElementById(f)){var o=document.getElementById(f);o.parentNode.removeChild(o)}t.isNullOrUndefined(e.childItems)||e.cancel?(h.layout.calculateLayoutItems(g,i),h.layout.renderLayoutItems(g)):h.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:he,treemap:this,renderItems:this.layout.renderItems},this.trigger(he,o),!c&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:n.levelOrderName,data:n})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},o.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Q(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},o.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var r="",o=0;o<e.length;o++)o!==e.length-1?r+=e[o]+"#":r+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(r,i)},o.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this]}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this]}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this]}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this]}),this.allowPrint&&e.push({member:"Print",args:[this,Xe]}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Je]}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Ye]}),e},o.prototype.onPropertyChanged=function(e,t){for(var i=!1,r=0,o=Object.keys(e);r<o.length;r++){switch(o[r]){case"background":this.renderBorder();break;case"height":case"width":case"layoutType":case"levels":case"drillDownView":case"renderDirection":case"leafItemSettings":case"legendSettings":case"dataSource":i=!0}}i&&(this.createSvg(),this.renderElements())},o.prototype.getModuleName=function(){return"treemap"},o.prototype.destroy=function(){this.unWireEVents(),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this)},o.prototype.removeSvg=function(){if(oe(this.element.id+"_Secondary_Element"),this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&t.remove(this.svgObject)}},o.prototype.getPersistData=function(){return""},Qe([t.Property(!1)],o.prototype,"allowPrint",void 0),Qe([t.Property(!1)],o.prototype,"allowImageExport",void 0),Qe([t.Property(!1)],o.prototype,"allowPdfExport",void 0),Qe([t.Property(null)],o.prototype,"width",void 0),Qe([t.Property(null)],o.prototype,"height",void 0),Qe([t.Complex({},Ce)],o.prototype,"border",void 0),Qe([t.Complex({},Oe)],o.prototype,"margin",void 0),Qe([t.Property(null)],o.prototype,"background",void 0),Qe([t.Property("Material")],o.prototype,"theme",void 0),Qe([t.Complex({},Ne)],o.prototype,"titleSettings",void 0),Qe([t.Property("Squarified")],o.prototype,"layoutType",void 0),Qe([t.Property(null)],o.prototype,"dataSource",void 0),Qe([t.Property(null)],o.prototype,"query",void 0),Qe([t.Property(null)],o.prototype,"weightValuePath",void 0),Qe([t.Property("")],o.prototype,"rangeColorValuePath",void 0),Qe([t.Property("")],o.prototype,"equalColorValuePath",void 0),Qe([t.Property(null)],o.prototype,"colorValuePath",void 0),Qe([t.Property([])],o.prototype,"palette",void 0),Qe([t.Property("TopLeftBottomRight")],o.prototype,"renderDirection",void 0),Qe([t.Property(!1)],o.prototype,"enableDrillDown",void 0),Qe([t.Property(!1)],o.prototype,"enableBreadcrumb",void 0),Qe([t.Property(" - ")],o.prototype,"breadcrumbConnector",void 0),Qe([t.Property(!1)],o.prototype,"drillDownView",void 0),Qe([t.Complex({},Fe)],o.prototype,"initialDrillDown",void 0),Qe([t.Complex({},De)],o.prototype,"leafItemSettings",void 0),Qe([t.Collection([],Ue)],o.prototype,"levels",void 0),Qe([t.Complex({},Be)],o.prototype,"highlightSettings",void 0),Qe([t.Complex({},Re)],o.prototype,"selectionSettings",void 0),Qe([t.Complex({},_e)],o.prototype,"tooltipSettings",void 0),Qe([t.Complex({},Ee)],o.prototype,"legendSettings",void 0),Qe([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),Qe([t.Property(null)],o.prototype,"description",void 0),Qe([t.Property(1)],o.prototype,"tabIndex",void 0),Qe([t.Property(null)],o.prototype,"format",void 0),Qe([t.Event()],o.prototype,"load",void 0),Qe([t.Event()],o.prototype,"beforePrint",void 0),Qe([t.Event()],o.prototype,"loaded",void 0),Qe([t.Event()],o.prototype,"itemRendering",void 0),Qe([t.Event()],o.prototype,"drillStart",void 0),Qe([t.Event()],o.prototype,"drillEnd",void 0),Qe([t.Event()],o.prototype,"itemSelected",void 0),Qe([t.Event()],o.prototype,"itemHighlight",void 0),Qe([t.Event()],o.prototype,"tooltipRendering",void 0),Qe([t.Event()],o.prototype,"itemClick",void 0),Qe([t.Event()],o.prototype,"itemMove",void 0),Qe([t.Event()],o.prototype,"click",void 0),Qe([t.Event()],o.prototype,"doubleClick",void 0),Qe([t.Event()],o.prototype,"rightClick",void 0),Qe([t.Event()],o.prototype,"mouseMove",void 0),Qe([t.Event()],o.prototype,"resize",void 0),Qe([t.Event()],o.prototype,"legendItemRendering",void 0),Qe([t.Event()],o.prototype,"legendRendering",void 0),o=Qe([t.NotifyPropertyChanges],o)}(t.Component),Ke=function(){return function(){}}(),et=function(){function e(e){this.page=0,this.legendBorderRect=new ke(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new ke(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.legendRenderingCollections=[],this.legendCollections=[],this.legendNames=[],this.totalPages=[],this.gradientCount=1,this.widthIncrement=0,this.heightIncrement=0,this.defsElement=this.treemap.renderer.createDefs(),this.treemap.svgObject.appendChild(this.defsElement);var t;t={cancel:!1,name:be,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position},this.treemap.trigger(be,t,function(t){t.cancel||t._changePosition===e.treemap.legendSettings.position||(e.treemap.legendSettings.position=t._changePosition),e.calculateLegendBounds(),e.legendCollections.length>0&&e.drawLegend()})},e.prototype.calculateLegendBounds=function(){var e=this,i=this.treemap,r=i.legendSettings;if(this.findColorMappingLegendItems(Ke.levelsData[0]),(this.treemap.palette.length>0||!t.isNullOrUndefined(this.treemap.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(Ke.levelsData[0],"Parent"),this.legendCollections.length>0){var o=r.position,l=r.title.text,s=r.titleStyle,h=r.mode,d=0,p=0,c=0,g=0,u=r.shapeHeight,m=r.shapeWidth,f=[],y=[],v="None"===r.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":r.orientation,b=r.width.length>1?r.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(r.width):parseFloat(r.width):null,x=r.height.length>1?r.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(r.height):parseFloat(r.height):null;s.fontFamily=i.themeStyle.fontFamily||s.fontFamily,s.size=i.themeStyle.legendFontSize||s.size;var S=n(l,s),w=0,I=0,C=r.shapePadding,O=r.textStyle;this.legendCollections.length;if(O.size=O.size||i.themeStyle.legendFontSize,O.fontFamily=O.fontFamily||i.themeStyle.fontFamily,"Default"===h){b=t.isNullOrUndefined(b)?i.areaRect.width:b,x=t.isNullOrUndefined(x)?i.areaRect.height:x;for(var L=0,M=0;M<this.legendCollections.length;M++){var P=this.legendCollections[M];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var N=n(P.legendName,O);if(this.textMaxWidth=Math.max(this.textMaxWidth,N.width),0===M)w=d=10+m/2,I=p=10+S.height+(u>N.height?u/2:N.height/4);else{var T=N.height>u?N.height:u;if("Horizontal"===v){var E=y[L-1].x+y[L-1].width+10+m;if(E+C+N.width>b){var F=(y[L-1].y>f[L-1].y+u/2?y[L-1].y:f[L-1].y+u/2)+10;F+T>x?(this.getPageChanged(),L=0,f=[],y=[],d=w,p=I):(d=f[0].x,p=F+T/2)}else d=E-m/2,p=f[L-1].y}else{var D=y[L-1].y>f[L-1].y+u/2?y[L-1].y:f[L-1].y+u/2;if(D+10+T>x){var _=y[L-1].x+this.textMaxWidth+10;_+C+N.width>b?(d=w,p=I,y=[],f=[],this.getPageChanged(),L=0):(d=_+m/2,p=f[0].y)}else d=f[L-1].x,p=D+10+u/2}}c=d+m/2+C,g=p+N.height/4,f.push({x:d,y:p}),y.push({x:c,y:g,width:N.width,height:N.height/2}),this.totalPages[this.page].Collection.push({DisplayText:P.legendName,element:P.gradientElement,Shape:{x:d,y:p},Text:{x:c,y:g},Fill:P.legendFill,Data:P.legendData,Rect:{x:f[L].x-m/2,y:f[L].y-u/2<g-N.height?f[L].y-u/2:g-N.height,width:Math.abs(f[L].x-m/2-(c+N.width)),height:u>N.height?u:N.height}}),L++}var R=this.totalPages[0].Collection;R.forEach(function(t,i){var r=new ke(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(w=r.x,I=r.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(w-(r.x+r.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(I-(r.y+r.height)))}),b=this.widthIncrement<b?this.widthIncrement:b,x=this.heightIncrement<x?this.heightIncrement:x,this.legendItemRect={x:R[0].Rect.x,y:R[0].Rect.y,width:b,height:x}}else{var B=this.legendCollections.length,U="Horizontal"===v?t.isNullOrUndefined(b)?i.areaRect.width/B:b/B:t.isNullOrUndefined(b)?25:b,H="Horizontal"===v?t.isNullOrUndefined(x)?25:x:t.isNullOrUndefined(x)?i.areaRect.height/B:x/B;w=0,I=S.height+10;var k=r.labelPosition,A=0,z=0,j=r.labelDisplayMode,G=0,V=0;for(M=0;M<this.legendCollections.length;M++){w="Horizontal"===v?w+U:w,I="Horizontal"===v?I:I+H;var W=this.legendCollections[M].legendName,q=new He(0,0);"None"===j?q=n(W,O):"Trim"===j?q=n(W=a("Horizontal"===v?U:H,W,O),O):W="",G=Math.max(G,q.height),V=Math.max(V,q.width),q.width>0&&q.height>0&&("Horizontal"===v?(c=w+U/2,g="After"===k?I+H+q.height/2+10:I-10):(c="After"===k?w-q.width/2-10:w+U+q.width/2+10,g=I+H/2+q.height/4)),0===M&&(A="Horizontal"===v?w:"After"===k?c-q.width/2:w,z="Horizontal"===v?"After"===k?I:g-q.height/2:I),M===B-1&&(b="Horizontal"===v?Math.abs(w+U-A):U+V+10,x="Horizontal"===v?H+G/2+10:Math.abs(I+H-z)),this.legendRenderingCollections.push({fill:this.legendCollections[M].legendFill,x:w,y:I,width:U,height:H,element:this.legendCollections[M].gradientElement,text:W,textX:c,textY:g,textWidth:q.width,textHeight:q.height,data:this.legendCollections[M].legendData})}this.legendItemRect={x:A,y:z,width:b,height:x}}}},e.prototype.getPageChanged=function(){this.page++,t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=m(e).values;if(t&&t.length>0&&(this.calculateLegendItems(t),this.treemap.levels.length>0))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},e.prototype.findPaletteLegendItems=function(e,i){var r,o;if(!t.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&t.isNullOrUndefined(this.treemap.drilledLegendItems))for(var l=m(e).values,n=0;n<l.length;n++)if(l[n].Name===this.treemap.initialDrillDown.groupName){l[n].isDrilled=!l[n].isDrilled,e=l[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,o=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:l[n].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var a=this.treemap.drilledLegendItems;if(o=a.data.options.fill,a.data.isDrilled)r=m(a.data).values;else{r=m(a.data.parent).values}}else r=m(e).values;var s;if(r&&r.length>0){for(var h=0;h<r.length;h++)(t.isNullOrUndefined(r[h].data[this.treemap.legendSettings.showLegendPath])||r[h].data[this.treemap.legendSettings.showLegendPath])&&(s=r[h].data[this.treemap.legendSettings.valuePath]?r[h].data[this.treemap.legendSettings.valuePath]:r[h].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,s)||this.legendCollections.push({legendName:s,legendFill:this.treemap.palette.length>0?t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[h%this.treemap.palette.length]:o:r[h].data[this.treemap.colorValuePath],legendData:[],itemArea:r[h].weight}));if(this.legendCollections.sort(U),this.treemap.palette.length>0)for(var d=0;d<this.legendCollections.length;d++)this.legendCollections[d].legendFill=t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[d%this.treemap.palette.length]:o}},e.prototype.calculateLegendItems=function(e){var i,r,o,l,n,a,s,h,d,p,c,g,u,m,f,y,v,b=!1,x=this.treemap.leafItemSettings,S=this.treemap.levels,w=this.treemap.legendSettings.position,I=!1,C=0;this.outOfRangeLegend=null;for(var O=0;O<e.length;O++){r="",u=!1,m=!1,I=!1,l=e[O].data,a=e[O].groupIndex;for(var L=0,M=0===this.treemap.levels.length||a===this.treemap.levels.length?x.colorMapping:S[a].colorMapping;L<M.length;L++){var P=M[L];if(h=null,o=Number(l[this.treemap.rangeColorValuePath]),s=l[this.treemap.equalColorValuePath],P.value=t.isNullOrUndefined(P.value)?P.value:P.value.toString(),!t.isNullOrUndefined(P.from)&&!t.isNullOrUndefined(P.to)&&o>=P.from&&o<=P.to&&P.showLegend?(b=!0,m=!0,c=P.from+" - "+P.to,n=t.isNullOrUndefined(P.label)?P.from+" - "+P.to:P.label,r=t.isNullOrUndefined(P.color)?r:P.color,i=this.isAddNewLegendData(c)):!t.isNullOrUndefined(P.value)&&s===P.value&&P.showLegend&&(b=!0,u=!0,c=P.value.toString(),n=t.isNullOrUndefined(P.label)?P.value.toString():P.label,r=t.isNullOrUndefined(P.color)?r:"[object Array]"===Object.prototype.toString.call(P.color)?P.color[0]:P.color,i=this.isAddNewLegendData(c)),b&&t.isNullOrUndefined(P.value)&&P.maxOpacity&&P.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(I=!0,"[object Array]"===Object.prototype.toString.call(P.color))for(var T=0;T<P.color.length;T++){var E={colorStop:(T*(100/(P.color.length-1))+"%").toString(),color:P.color[T]};N.push(E)}else{E={colorStop:"0%",color:r};var F={colorStop:"100%",color:r};N.push(E),N.push(F)}d="Top"===w||"Bottom"===w?"100%":"0%",p="Top"===w||"Bottom"===w?"0%":"100%";var D={id:"groupIndex_"+a+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:d,y2:p};h=this.treemap.renderer.drawGradient("linearGradient",D,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(P.color)&&(h.childNodes[0].setAttribute("stop-opacity",P.minOpacity.toString()),h.childNodes[1].setAttribute("stop-opacity",P.maxOpacity.toString())),this.defsElement.appendChild(h),this.gradientCount++}g=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,n),i&&i.process&&b&&!g?(b=!1,r="[object Array]"===Object.prototype.toString.call(P.color)&&t.isNullOrUndefined(h)&&t.isNullOrUndefined(P.value)?this.legendGradientColor(P,C):r,this.legendCollections.push({actualValue:c,legendName:n,legendFill:r,legendData:[],gradientElement:t.isNullOrUndefined(h)?t.isNullOrUndefined(P.value)?this.legendLinearGradient:null:h,name:e[O].name,opacity:this.treemap.legendSettings.opacity,borderColor:this.treemap.legendSettings.border.color,borderWidth:this.treemap.legendSettings.border.width}),this.legendCollections[this.legendCollections.length-1].legendData.push(e[O]),C++):b&&!g&&(b=!1,this.legendCollections[i.value].legendData.push(e[O])),m||I||u||t.isNullOrUndefined(P.from)&&t.isNullOrUndefined(P.to)&&t.isNullOrUndefined(P.minOpacity)&&t.isNullOrUndefined(P.maxOpacity)&&t.isNullOrUndefined(P.value)&&!t.isNullOrUndefined(P.color)&&(f="[object Array]"===Object.prototype.toString.call(P.color)?P.color[0]:P.color,y=t.isNullOrUndefined(P.label)?"Others":P.label,t.isNullOrUndefined(this.outOfRangeLegend)&&(this.legendCollections.push({actualValue:y,legendData:[],legendName:y,legendFill:f}),v=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[v-1],C++),this.legendCollections[v-1].legendData.push(e[O]))}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,r=0;r<e.length;r++)if(e[r].legendName===t){i=!0;break}return i},e.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var r=0;r<this.legendCollections.length;r++){if(e===this.legendCollections[r].actualValue){t=!1,i=r;break}r===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,t,i=this.treemap,r=i.legendSettings,o=i.renderer,l=r.textStyle;if(this.legendGroup=o.createGroup({id:i.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===r.mode)this.drawLegendItem(this.currentPage);else for(var n=0;n<this.legendRenderingCollections.length;n++){var a=i.element.id+"_Legend_Index_"+n,s=i.element.id+"_Legend_Index_"+n+"_Text",h=this.legendRenderingCollections[n];e=(t=h.element)?"url(#"+t.id+")":h.fill;var p=new ke(h.x,h.y,h.width,h.height),c=new Ge(h.textX,h.textY),g=new Ae(a,e,r.shapeBorder,r.opacity,p);this.treemap.enableRtl&&("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(g.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+g.height)-Math.abs(this.legendBorderRect.y-g.y),c.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+h.textHeight/2-Math.abs(this.legendBorderRect.y-c.y)):(g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+g.width)-Math.abs(this.legendBorderRect.x-g.x),c.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-c.x))),d(new je(s,c.x,c.y,"middle",h.text,"",""),l,l.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(o.drawRectangle(g))}k(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,r){var o=e.Shape,l=e.Text,a=n(e.DisplayText,r.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),l.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-l.x),("Left"===i.legendSettings.position||"Right"===i.legendSettings.position||"Auto"===i.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height)&&(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-o.y)-r.shapeHeight/2,l.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-l.y)),{shapeLocation:o,textLocation:l}},e.prototype.drawLegendItem=function(e){var i,r,o=this,l=this.treemap,a=l.legendSettings,s=new He(a.shapeWidth,a.shapeHeight),h=l.renderer,p=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=c?t.isNullOrUndefined(a.fill)?"#000000":a.fill:p.color,u=c&&0===p.width?1:p.width,m=function(t){var n=f.totalPages[e].Collection[t],p=h.createGroup({id:l.element.id+"_Legend_Index_"+t}),m=n.DisplayText,y=l.element.id+"_Legend_Shape_Index_"+t,v=l.element.id+"_Legend_Text_Index_"+t,b=n.Shape,x=n.Text;l.enableRtl&&(i=f.defaultLegendRtlLocation(n,10,l,a),b=i.shapeLocation,x=i.textLocation),r={cancel:!1,name:ve,treemap:l,fill:n.Fill,shape:a.shape,imageUrl:a.imageUrl},f.treemap.trigger(ve,r,function(e){var t=new ze(y,e.fill,u,c?n.Fill:g,a.opacity,"");p.appendChild(J(b,e.shape,s,e.imageUrl,t,m)),d(new je(v,x.x,x.y,"start",m,"",""),a.textStyle,a.textStyle.color||o.treemap.themeStyle.legendTextColor,p),o.legendGroup.appendChild(p)})},f=this,y=0;y<this.totalPages[e].Collection.length;y++)m(y);var v=void 0;if(0!==this.page){var b=e+1+"/"+this.totalPages.length,x=a.textStyle,S=n(b,x),w=this.legendItemRect.x+this.legendItemRect.width-S.width-20-10,I=this.legendItemRect.x+this.legendItemRect.width,C=this.legendItemRect.y+this.legendItemRect.height+2.5+10,O=I-10-S.width/2-5;v=h.createGroup({id:l.element.id+"_Legend_Paging_Group"});var L=h.createGroup({id:l.element.id+"_Legend_Left_Paging_Group"}),M=h.createGroup({id:l.element.id+"_Legend_Right_Paging_Group"}),P=" M "+I+" "+C+" L "+(I-10)+" "+(C-5)+" L "+(I-10)+" "+(C+5)+" z ",N=" M "+w+" "+C+" L "+(w+10)+" "+(C-5)+" L "+(w+10)+" "+(C+5)+" z ",T=new ze(l.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(h.drawPath(T));var E=new Ae(l.element.id+"_Left_Page_Rect","transparent",{},1,new ke(w-5,C-10,20,20),"");L.appendChild(h.drawRectangle(E)),this.wireEvents(L);var F=new ze(l.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",P);M.appendChild(h.drawPath(F));var D=new Ae(l.element.id+"_Right_Page_Rect","transparent",{},1,new ke(I-10,C-5,10,10),"");M.appendChild(h.drawRectangle(D)),this.wireEvents(M),v.appendChild(L),v.appendChild(M);var _={id:l.element.id+"_Paging_Text",x:O,y:C+S.height/4,fill:"#a6a6a6","font-size":"14px","font-style":x.fontStyle,"font-family":x.fontFamily,"font-weight":x.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":""};v.appendChild(h.createText(_,b)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,r=t.titleStyle,o=n(a(this.legendItemRect.width+20,i,r),r);this.legendBorderRect=new ke(this.legendItemRect.x-10,this.legendItemRect.y-10-o.height,this.legendItemRect.width+20,this.legendItemRect.height+20+o.height+("Interactive"===t.mode?0:0!==this.page?10:0));var l=new Ae(e.element.id+"_Legend_Border",t.background,t.border,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(l);s.style.pointerEvents="none",this.legendGroup.appendChild(s),this.getLegendAlignment(e,this.legendBorderRect.width,this.legendBorderRect.height,t),this.legendGroup.setAttribute("transform","translate( "+(this.translate.x+-this.legendBorderRect.x)+" "+(this.translate.y+-this.legendBorderRect.y)+" )"),e.svgObject.appendChild(this.legendGroup)},e.prototype.renderLegendTitle=function(){var e=this.treemap,t=e.legendSettings,i=t.titleStyle,r=t.title.text,o=a(this.legendItemRect.width+20,r,i),l=n(o,i);r&&d(new je(e.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-l.height/2-5,"middle",o,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,r=e.target,o=i.element.id+"_Interactive_Legend";r=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):r;var l,n=i.legendSettings;if(r.id.indexOf("_Item_Index")>-1&&n.visible&&this.legendRenderingCollections.length>0){var a=void 0,s=void 0,h=void 0,d=void 0,p=void 0,c=void 0,g=void 0;l=i.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];for(var u=i.svgObject.getBoundingClientRect(),m=0;m<this.legendCollections.length;m++){a=this.legendCollections[m],s=(g=document.getElementById(i.element.id+"_Legend_Index_"+m)).getBoundingClientRect();var f=new ke(Math.abs(s.left-u.left),Math.abs(s.top-u.top),s.width,s.height);if(d=g.getAttribute("fill"),p=n.shapeBorder.color,c=n.shapeBorder.width,!t.isNullOrUndefined(a.legendData)){h=a.legendData;for(var y=0;y<h.length;y++)if(h[y].levelOrderName===l.levelOrderName){this.drawInteractivePointer(n,d,p,o,c,f);break}}}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,r,o,l){var n,a,s;n="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=l.x+l.width/2)+" "+(s=l.y+l.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=l.x+l.width/2)+" "+(s=l.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=l.x)+" "+(s=l.y+l.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=l.x+l.width)+" "+(s=l.y+l.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var h=new ze(r,t,o,i,1,"",n);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(h))},e.prototype.getLegendAlignment=function(e,i,r,o){var l,n,a,s=(a=t.extend({},e.areaRect,a,!0)).x,h=a.y,d=a.height,p=a.width,c=e.availableSize.width,g=e.availableSize.height,u="Auto"===o.position?c>g?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(u){case"Top":case"Bottom":a.height=d-r,l=c/2-i/2,n="Top"===u?h:h+a.height+10,a.y="Top"===u?h+r+10:h;break;case"Left":case"Right":a.width=p-i,l="Left"===u?s:s+a.width,n=g/2-r/2,a.x="Left"===u?s+i:s}switch(o.alignment){case"Near":"Top"===u||"Bottom"===u?l=a.x:n=a.y;break;case"Far":"Top"===u||"Bottom"===u?l=c-i:n=g-r}this.treemap.totalRect=a,this.translate=new Ge(l,n)}},e.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},e.prototype.removeInteractivePointer=function(){if(document.getElementById(this.treemap.element.id+"_Interactive_Legend")){var e=document.getElementById(this.treemap.element.id+"_Interactive_Legend");e.parentNode.removeChild(e)}},e.prototype.changeNextPage=function(e){this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?this.currentPage-1:this.currentPage+1,this.drawLegend()},e.prototype.wireEvents=function(e){t.EventHandler.add(e,t.Browser.touchStartEvent,this.changeNextPage,this)},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapLegend"},e.prototype.destroy=function(e){this.removeEventListener()},e.prototype.legendGradientColor=function(e,i){var r,o="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),n=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",h="Top"===a||"Bottom"===a?"0":"100";n.setAttribute("id","linear_"+i),n.setAttribute("x1","0%"),n.setAttribute("y1","0%"),n.setAttribute("x2",s+"%"),n.setAttribute("y2",h+"%");for(var d=0;d<e.color.length;d++){var p=100/(e.color.length-1),c=document.createElementNS(o,"stop");c.setAttribute("offset",d*p+"%"),c.setAttribute("stop-color",e.color[d]),c.setAttribute("stop-opacity",1..toString()),n.appendChild(c)}l.appendChild(n),this.legendLinearGradient=n;var g="url(#linear_"+i+")";this.defsElement.appendChild(n),r=g}return r},e}(),tt=function(){function e(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}return e.prototype.mouseMove=function(e){var t,i,r,o,l,n,a,s=this.treemap,h=e.target.id,d=[],p=this.treemap.highlightSettings,c=[],g=this.treemap.treeMapSelectionModule;if(h.indexOf("_Item_Index")>-1&&(!g||this.treemap.selectionId!==h)){if(this.highLightId!==h){l=document.getElementById(s.element.id+"_TreeMap_"+s.layoutType+"_Layout");var u=document.getElementsByClassName("treeMapSelection");r=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var m=void 0;if(this.treemap.legendSettings.visible){var y=this.treemap.treeMapLegendModule.legendCollections;m=te(this.treemap.treeMapLegendModule.legendCollections.length,r,s),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+m):document.getElementById(this.treemap.element.id+"_Legend_Index_"+m),null===this.shapeElement||g&&this.shapeElement.getAttribute("id")===g.legendSelectId?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):g&&this.shapeElement===g.shapeElement?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,s),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),Q(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:y[m].legendFill,oldOpacity:y[m].opacity,oldBorderColor:y[m].borderColor,oldBorderWidth:y[m].borderWidth}),K(this.shapeElement,p.fill,p.opacity,p.border.color,p.border.width.toString()),this.target="highlight")}if(a=f(r,[],p.mode,s),!this.treemap.legendSettings.visible||(!g||(!this.shapeElement||this.shapeElement.getAttribute("id")!==g.legendSelectId)))if(this.treemap.legendSettings.visible&&(g&&this.shapeElement===g.shapeElement))t=!1;else{for(var v=0;v<l.childElementCount;v++){n=l.childNodes[v],o=!0,r=s.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])];for(var b=0;b<u.length;b++)if(n.id===u[b].id){o=!1;break}a.indexOf(r.levelOrderName)>-1&&o&&(c.push(n),d.push(r))}A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s);for(var x=0;x<c.length;x++)z((n=c[x]).childNodes[0],{border:p.border,fill:p.fill,opacity:p.opacity}),n.classList.add("treeMapHighLight"),this.highLightId=h;i={cancel:!1,name:pe,treemap:s,items:d,elements:c},s.trigger(pe,i)}}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){if(this.treemap.legendSettings.visible&&(!g||g.legendSelectId!==h)&&(!g||g.shapeSelectId!==h)){var S,w=void 0,I=void 0,C=document.getElementById(h);"highlight"===this.shapeTarget&&$(this.legendHighlightCollection),this.shapeTarget="highlight";m="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var O=this.treemap.treeMapLegendModule.legendCollections[m].legendData.length,L=(y=this.treemap.treeMapLegendModule.legendCollections,parseInt(h[h.length-1],10));for(v=0;v<O;v++)for(b=0;b<this.treemap.layout.renderItems.length;b++)if(this.treemap.treeMapLegendModule.legendCollections[m].legendData[v].levelOrderName===this.treemap.layout.renderItems[b].levelOrderName){w=b,I=this.treemap.layout.renderItems[b].groupIndex;var M=document.getElementById(this.treemap.element.id+"_Level_Index_"+I+"_Item_Index_"+w+"_RectPath");0===v&&(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,L,b,C,M,this.treemap.layout.renderItems,y),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection={Elements:[]}),K(C,p.fill,p.opacity,p.border.color,p.border.width.toString()),K(M,p.fill,p.opacity,p.border.color,p.border.width.toString()),S=this.legendHighlightCollection.length,this.legendHighlightCollection[S-1].ShapeCollection.Elements.push(M)}}}else g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:this.treemap.legendSettings.visible)&&A(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",s),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||g&&this.shapeElement&&this.shapeElement.getAttribute("id")===g.legendSelectId||(g?this.shapeElement!==g.shapeElement:!g||g.legendSelect)&&(Q(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&$(this.legendHighlightCollection),this.highLightId="",t=!1;return t},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchMoveEvent,this.mouseMove,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchMoveEvent,this.mouseMove)},e.prototype.getModuleName=function(){return"treeMapHighlight"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),it=function(){function e(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}return e.prototype.mouseDown=function(e){var t,i=e.target,r=this.treemap;r.levelSelection=[];var o,l,n,a,s=[],h=i.id,d=i.innerHTML,c=[],g=r.selectionSettings,u=this.treemap.treeMapHighlightModule,m=r.element.id+"_TreeMap_"+r.layoutType+"_Layout";if(h.indexOf("_Item_Index")>-1)if(e.preventDefault(),this.treemap.selectionId!==h&&this.legendSelect){l=document.getElementById(m),o=r.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),u&&(u.shapeTarget="selection",u.shapeHighlightCollection=[]),y=te(v,o,r),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[y].legendFill,oldOpacity:b[y].opacity,oldBorderColor:b[y].borderColor,oldBorderWidth:b[y].borderWidth}),K(this.shapeElement,g.fill,g.opacity,g.border.color,g.border.width.toString()))}a=f(o,[],g.mode,r);for(var x=0;x<l.childElementCount;x++)n=l.childNodes[x],o=r.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],a.indexOf(o.levelOrderName)>-1&&(c.push(n),r.levelSelection.push(n.id),s.push(o));A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId=h;for(var S=document.getElementsByClassName("treeMapHighLight"),w=0;w<c.length;w++){if(n=c[w],S.length>0)for(var I=0;I<S.length;I++)S[I].id===n.id&&S[I].classList.remove("treeMapHighLight"),z(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");else z(n.childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),n.classList.add("treeMapSelection");t={cancel:!1,name:de,treemap:r,items:s,elements:c,text:d,contentItemTemplate:d},r.trigger(de,t,function(e){e.contentItemTemplate!==d&&p(h,i,e.contentItemTemplate)})}}else Q(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",r),this.treemap.selectionId="";else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1){b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==h&&this.shapeSelect){var C,O=void 0,L=void 0;this.legendSelectId=h,this.legendSelect=!1;var M=parseInt(h[h.length-1],10),P=document.getElementById(h);$(this.legendSelectionCollection),u&&(u.shapeTarget="selection");y="Default"===this.treemap.legendSettings.mode?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);var N=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(w=0;w<N;w++)for(var T=0;T<this.treemap.layout.renderItems.length;T++)if(this.treemap.treeMapLegendModule.legendCollections[y].legendData[w].levelOrderName===this.treemap.layout.renderItems[T].levelOrderName){O=T,L=this.treemap.layout.renderItems[T].groupIndex;var E=document.getElementById(this.treemap.element.id+"_Level_Index_"+L+"_Item_Index_"+O+"_RectPath");0===w&&(ie(this.legendSelectionCollection,M,T,P,E,this.treemap.layout.renderItems,b),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection={Elements:[]}),K(P,g.fill,g.opacity,g.border.color,g.border.width.toString()),K(E,g.fill,g.opacity,g.border.color,g.border.width.toString()),C=this.legendSelectionCollection.length,this.legendSelectionCollection[C-1].ShapeCollection.Elements.push(E)}}else $(this.legendSelectionCollection),u&&(u.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,r=0;r<this.treemap.layout.renderItems.length;r++)if(e===this.treemap.layout.renderItems[r].levelOrderName){i=this.treemap.layout.renderItems[r];break}var o=this.treemap.selectionSettings,l=[],n=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var h=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",d=document.getElementById(h),p=f(i,[],o.mode,this.treemap),c=0;c<d.childElementCount;c++)n=d.childNodes[c],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(l.push(n),this.treemap.levelSelection.push(n.id),s.push(i));if(this.treemap.legendSettings.visible)for(var g=0;g<s.length;g++){this.shapeSelect=!1;var u=this.treemap.treeMapLegendModule.legendCollections.length,m=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(u,s[g],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+a):document.getElementById(this.treemap.element.id+"_Legend_Index_"+a),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:m[a].legendFill,oldOpacity:m[a].opacity,oldBorderColor:m[a].borderColor,oldBorderWidth:m[a].borderWidth}),K(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var y=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=y.childNodes[0].id;for(var v=document.getElementsByClassName("treeMapHighLight"),b=0;b<l.length;b++)if(n=l[b],v.length>0)for(var x=0;x<v.length;x++)v[x].id===n.id&&v[x].classList.remove("treeMapHighLight"),z(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options.fill:o.fill,z(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],A(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},e.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(t.Browser.touchStartEvent,this.mouseDown,this)},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(t.Browser.touchStartEvent,this.mouseDown)},e.prototype.getModuleName=function(){return"treeMapSelection"},e.prototype.destroy=function(e){this.removeEventListener()},e}(),rt=function(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(i[r[o]]=e[r[o]])}return i},ot=function(){function e(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}return e.prototype.renderTooltip=function(e){var i,r,o,l,n,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(l=e).changedTouches[0].pageX,r=l.changedTouches[0].pageY,o=l.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,r=e.pageY,o=e.target);var s,h,d,p,c=o.id,g={},u={},m=[];c.indexOf("_Item_Index")>-1?(g=this.treemap.layout.renderItems[parseFloat(c.split("_Item_Index_")[1])],t.isNullOrUndefined(g)||(g.name,s=g.weight,u=g.data,p=g.options.fill,m=this.treemap.enableRtl?[j(this.tooltipSettings.format,u,this.treemap)||G(s,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[j(this.tooltipSettings.format,u,this.treemap)||this.treemap.weightValuePath.toString()+" : "+G(s,this.treemap)],document.getElementById(this.tooltipId)?h=document.getElementById(this.tooltipId):(h=t.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip",styles:"position: absolute;pointer-events:none;"}),document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(h)),(d=O(i,r,this.treemap.svgObject)).y=this.tooltipSettings.template?d.y+10:d.y,this.tooltipSettings.textStyle.fontFamily=this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.color=this.treemap.themeStyle.tooltipFontColor||this.tooltipSettings.textStyle.color,this.tooltipSettings.textStyle.opacity=this.treemap.themeStyle.tooltipTextOpacity||this.tooltipSettings.textStyle.opacity,n={cancel:!1,name:ce,item:g,options:{location:d,text:m,data:u,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger(ce,n,function(e){a.addTooltip(n,p,h)}))):(this.removeTooltip(),this.treemap.clearTemplate())},e.prototype.addTooltip=function(e,r,o,l){var n,a;if(t.isNullOrUndefined(e))n=l.cancel,a=l;else{n=e.cancel,a=rt(e,["cancel"]).options}n?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[r],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(o),this.treemap.renderReactTemplates())},e.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},e.prototype.removeTooltip=function(){if(document.getElementsByClassName("EJ2-TreeMap-Tooltip").length>0){var e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0];e.parentNode.removeChild(e)}},e.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(t.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(t.Browser.touchEndEvent,this.mouseUpHandler,this))},e.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(t.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(t.Browser.touchEndEvent,this.mouseUpHandler))},e.prototype.getModuleName=function(){return"treeMapTooltip"},e.prototype.destroy=function(e){this.removeEventListener()},e}();e.TreeMap=$e,e.LevelsData=Ke,e.Border=Ce,e.Margin=Oe,e.Font=Le,e.CommonTitleSettings=Me,e.SubTitleSettings=Pe,e.TitleSettings=Ne,e.ColorMapping=Te,e.LegendSettings=Ee,e.InitialDrillSettings=Fe,e.LeafItemSettings=De,e.TooltipSettings=_e,e.SelectionSettings=Re,e.HighlightSettings=Be,e.LevelSettings=Ue,e.load="load",e.loaded="loaded",e.beforePrint=ne,e.itemRendering=ae,e.drillStart=se,e.drillEnd=he,e.itemSelected=de,e.itemHighlight=pe,e.tooltipRendering=ce,e.itemClick=ge,e.itemMove=ue,e.click="click",e.doubleClick=me,e.rightClick=fe,e.mouseMove=ye,e.legendItemRendering=ve,e.legendRendering=be,e.resize=xe,e.defaultFont=Se,e.getThemeStyle=le,e.Size=He,e.stringToNumber=l,e.Rect=ke,e.RectOption=Ae,e.PathOption=ze,e.measureText=n,e.TextOption=je,e.textTrim=a,e.Location=Ge,e.findPosition=s,e.createTextStyle=h,e.renderTextElement=d,e.setItemTemplateContent=p,e.getElement=c,e.itemsToOrder=g,e.isContainsData=u,e.findChildren=m,e.findHightLightItems=f,e.getTemplateFunction=y,e.convertElement=v,e.findLabelLocation=b,e.measureElement=x,e.getArea=S,e.getShortestEdge=w,e.convertToContainer=I,e.convertToRect=C,e.getMousePosition=O,e.colorMap=L,e.deSaturationColor=M,e.colorCollections=P,e.rgbToHex=N,e.getColorByValue=T,e.getGradientColor=E,e.getPercentageColor=F,e.getPercentage=D,e.wordWrap=_,e.textWrap=R,e.hide=B,e.orderByArea=U,e.maintainSelection=H,e.legendMaintain=k,e.removeClassNames=A,e.applyOptions=z,e.textFormatter=j,e.formatValue=G,e.ColorValue=Ve,e.convertToHexCode=V,e.componentToHex=W,e.convertHexToColor=q,e.colorNameToHex=X,e.drawSymbol=J,e.renderLegendShape=Y,e.isParentItem=Z,e.TreeMapAjax=We,e.removeShape=Q,e.removeLegend=$,e.setColor=K,e.removeSelectionWithHighlight=ee,e.getLegendIndex=te,e.pushCollection=ie,e.triggerDownload=re,e.removeElement=oe,e.TreeMapLegend=et,e.LayoutPanel=qe,e.TreeMapHighlight=tt,e.TreeMapSelection=it,e.TreeMapTooltip=ot,e.ImageExport=Je,e.PdfExport=Ye,e.Print=Xe,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-treemap.umd.min.js.map