@syncfusion/ej2-treemap 31.2.12 → 32.1.19
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/aceconfig.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//Config file for Accessibility-Checker
|
|
2
|
+
module.exports = {
|
|
3
|
+
ruleArchive: "18March2024",
|
|
4
|
+
policies: ["WCAG_2_1","IBM_Accessibility"],
|
|
5
|
+
failLevels: ["violation", "potentialviolation"],
|
|
6
|
+
reportLevels: [
|
|
7
|
+
"violation",
|
|
8
|
+
"potentialviolation",
|
|
9
|
+
"recommendation",
|
|
10
|
+
"potentialrecommendation",
|
|
11
|
+
"manual",
|
|
12
|
+
"pass",
|
|
13
|
+
],
|
|
14
|
+
outputFormat: ["html","json"],
|
|
15
|
+
label: [process.env.TRAVIS_BRANCH],
|
|
16
|
+
outputFolder:"accessibility-reports",
|
|
17
|
+
};
|
package/dist/ej2-treemap.min.js
CHANGED
|
@@ -1,10 +1 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-treemap.min.js
|
|
3
|
-
* version : 31.2.12
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionSvgBase","SyncfusionData","SyncfusionPdfExport"],t):"object"==typeof exports?exports.SyncfusionTreemap=t(require("SyncfusionBase"),require("SyncfusionSvgBase"),require("SyncfusionData"),require("SyncfusionPdfExport")):e.SyncfusionTreemap=t(e.SyncfusionBase,e.SyncfusionSvgBase,e.SyncfusionData,e.SyncfusionPdfExport)}(self,(e,t,i,l)=>(()=>{"use strict";var o={766:t=>{t.exports=e},74:e=>{e.exports=i},461:e=>{e.exports=l},727:e=>{e.exports=t}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{r.r(a),r.d(a,{Border:()=>O,ColorMapping:()=>E,ColorValue:()=>_e,CommonTitleSettings:()=>M,Font:()=>T,HighlightSettings:()=>R,ImageExport:()=>Ke,InitialDrillSettings:()=>P,LayoutPanel:()=>Ye,LeafItemSettings:()=>B,LegendSettings:()=>D,LevelSettings:()=>U,LevelsData:()=>nt,Location:()=>J,Margin:()=>L,PathOption:()=>V,PdfExport:()=>tt,Print:()=>$e,Rect:()=>W,RectOption:()=>j,SelectionSettings:()=>H,Size:()=>k,SubTitleSettings:()=>N,TextOption:()=>q,Theme:()=>Je,TitleSettings:()=>_,TooltipSettings:()=>z,TreeMap:()=>ot,TreeMapAjax:()=>Ue,TreeMapHighlight:()=>at,TreeMapLegend:()=>rt,TreeMapSelection:()=>st,TreeMapTooltip:()=>ht,applyOptions:()=>Te,beforePrint:()=>n,click:()=>f,colorCollections:()=>ue,colorMap:()=>ce,colorNameToHex:()=>Be,componentToHex:()=>De,convertElement:()=>ne,convertHexToColor:()=>Pe,convertToContainer:()=>he,convertToHexCode:()=>Ee,convertToRect:()=>pe,createTextStyle:()=>Z,deSaturationColor:()=>me,defaultFont:()=>C,doubleClick:()=>y,drawSymbol:()=>ze,drillEnd:()=>h,drillStart:()=>d,findChildren:()=>ie,findHightLightItems:()=>le,findLabelLocation:()=>re,findPosition:()=>Y,formatValue:()=>Ne,getArea:()=>se,getColorByValue:()=>ye,getElement:()=>K,getGradientColor:()=>ve,getLegendIndex:()=>Ve,getMousePosition:()=>ge,getPercentage:()=>xe,getPercentageColor:()=>Se,getShortestEdge:()=>de,getTemplateFunction:()=>oe,getThemeStyle:()=>Qe,hide:()=>Ce,isContainsData:()=>te,isParentItem:()=>Re,itemClick:()=>m,itemHighlight:()=>g,itemMove:()=>u,itemRendering:()=>s,itemSelected:()=>p,itemsToOrder:()=>ee,legendItemRendering:()=>x,legendMaintain:()=>Oe,legendRendering:()=>b,load:()=>l,loaded:()=>o,maintainSelection:()=>we,measureElement:()=>ae,measureText:()=>G,mouseMove:()=>S,orderByArea:()=>Fe,pushCollection:()=>Ge,removeClassNames:()=>Le,removeElement:()=>Xe,removeLegend:()=>Ae,removeSelectionWithHighlight:()=>je,removeShape:()=>ke,renderLegendShape:()=>He,renderTextElement:()=>Q,resize:()=>I,rgbToHex:()=>fe,rightClick:()=>v,setColor:()=>We,setItemTemplateContent:()=>$,stringToNumber:()=>A,textFormatter:()=>Me,textTrim:()=>X,textWrap:()=>Ie,tooltipRendering:()=>c,triggerDownload:()=>qe,wordWrap:()=>be});var e,t=r(766),i=r(727),l="load",o="loaded",n="beforePrint",s="itemRendering",d="drillStart",h="drillEnd",p="itemSelected",g="itemHighlight",c="tooltipRendering",m="itemClick",u="itemMove",f="click",y="doubleClick",v="rightClick",S="mouseMove",x="legendItemRendering",b="legendRendering",I="resize",C="Roboto, Segoe UI, Noto, Sans-serif",F=(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])},e(t,i)},function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}),w=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("#808080")],i.prototype,"color",void 0),w([(0,t.Property)(0)],i.prototype,"width",void 0),i}(t.ChildProperty),L=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(10)],i.prototype,"left",void 0),w([(0,t.Property)(10)],i.prototype,"right",void 0),w([(0,t.Property)(10)],i.prototype,"top",void 0),w([(0,t.Property)(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),T=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"size",void 0),w([(0,t.Property)(null)],i.prototype,"color",void 0),w([(0,t.Property)(C)],i.prototype,"fontFamily",void 0),w([(0,t.Property)("")],i.prototype,"fontWeight",void 0),w([(0,t.Property)("Normal")],i.prototype,"fontStyle",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)("")],i.prototype,"text",void 0),w([(0,t.Property)("")],i.prototype,"description",void 0),i}(t.ChildProperty),N=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),i}(M),_=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Complex)({fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),w([(0,t.Complex)({},N)],i.prototype,"subtitleSettings",void 0),i}(M),E=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"from",void 0),w([(0,t.Property)(null)],i.prototype,"to",void 0),w([(0,t.Property)(null)],i.prototype,"color",void 0),w([(0,t.Property)(null)],i.prototype,"label",void 0),w([(0,t.Property)(null)],i.prototype,"value",void 0),w([(0,t.Property)(null)],i.prototype,"minOpacity",void 0),w([(0,t.Property)(null)],i.prototype,"maxOpacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),D=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"visible",void 0),w([(0,t.Property)("Default")],i.prototype,"mode",void 0),w([(0,t.Property)("transparent")],i.prototype,"background",void 0),w([(0,t.Property)("Circle")],i.prototype,"shape",void 0),w([(0,t.Property)("")],i.prototype,"width",void 0),w([(0,t.Property)("")],i.prototype,"height",void 0),w([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"textStyle",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(15)],i.prototype,"shapeWidth",void 0),w([(0,t.Property)(15)],i.prototype,"shapeHeight",void 0),w([(0,t.Property)(10)],i.prototype,"shapePadding",void 0),w([(0,t.Property)(null)],i.prototype,"imageUrl",void 0),w([(0,t.Complex)({color:null,width:null},O)],i.prototype,"border",void 0),w([(0,t.Complex)({color:"#000000",width:0},O)],i.prototype,"shapeBorder",void 0),w([(0,t.Complex)({},M)],i.prototype,"title",void 0),w([(0,t.Complex)({size:null,fontFamily:null,fontWeight:null},T)],i.prototype,"titleStyle",void 0),w([(0,t.Property)("Bottom")],i.prototype,"position",void 0),w([(0,t.Property)("None")],i.prototype,"orientation",void 0),w([(0,t.Property)(!1)],i.prototype,"invertedPointer",void 0),w([(0,t.Property)("After")],i.prototype,"labelPosition",void 0),w([(0,t.Property)("None")],i.prototype,"labelDisplayMode",void 0),w([(0,t.Property)("Center")],i.prototype,"alignment",void 0),w([(0,t.Property)({x:0,y:0})],i.prototype,"location",void 0),w([(0,t.Property)(null)],i.prototype,"showLegendPath",void 0),w([(0,t.Property)(null)],i.prototype,"valuePath",void 0),w([(0,t.Property)(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),P=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"groupIndex",void 0),w([(0,t.Property)(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),B=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)(0)],i.prototype,"gap",void 0),w([(0,t.Property)(10)],i.prototype,"padding",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showLabels",void 0),w([(0,t.Property)(null)],i.prototype,"labelPath",void 0),w([(0,t.Property)(null)],i.prototype,"labelFormat",void 0),w([(0,t.Property)("TopLeft")],i.prototype,"labelPosition",void 0),w([(0,t.Complex)({color:null,size:null,fontFamily:null},T)],i.prototype,"labelStyle",void 0),w([(0,t.Property)(null)],i.prototype,"labelTemplate",void 0),w([(0,t.Property)("Center")],i.prototype,"templatePosition",void 0),w([(0,t.Property)("Trim")],i.prototype,"interSectAction",void 0),w([(0,t.Collection)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"visible",void 0),w([(0,t.Property)("")],i.prototype,"template",void 0),w([(0,t.Property)(null)],i.prototype,"format",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(.75)],i.prototype,"opacity",void 0),w([(0,t.Property)(["Circle"])],i.prototype,"markerShapes",void 0),w([(0,t.Complex)({width:null,color:null},O)],i.prototype,"border",void 0),w([(0,t.Complex)({fontFamily:null,size:null,fontWeight:null,opacity:null},T)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),H=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"enable",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),R=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(!1)],i.prototype,"enable",void 0),w([(0,t.Property)("#808080")],i.prototype,"fill",void 0),w([(0,t.Property)("0.5")],i.prototype,"opacity",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),U=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return F(i,e),w([(0,t.Property)(null)],i.prototype,"groupPath",void 0),w([(0,t.Property)(0)],i.prototype,"groupGap",void 0),w([(0,t.Property)(10)],i.prototype,"groupPadding",void 0),w([(0,t.Complex)({},O)],i.prototype,"border",void 0),w([(0,t.Property)(null)],i.prototype,"fill",void 0),w([(0,t.Property)(!1)],i.prototype,"autoFill",void 0),w([(0,t.Property)(1)],i.prototype,"opacity",void 0),w([(0,t.Property)(!0)],i.prototype,"showHeader",void 0),w([(0,t.Property)(20)],i.prototype,"headerHeight",void 0),w([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),w([(0,t.Property)(null)],i.prototype,"headerFormat",void 0),w([(0,t.Property)("Near")],i.prototype,"headerAlignment",void 0),w([(0,t.Complex)({color:null,size:"13px",fontFamily:null},T)],i.prototype,"headerStyle",void 0),w([(0,t.Property)("TopLeft")],i.prototype,"templatePosition",void 0),w([(0,t.Collection)([],E)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),k=function(e,t){this.width=e,this.height=t};function A(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var W=function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l},j=function(e,t,i,l,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},V=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function G(e,i){var l=document.getElementById("treeMapMeasureText");return null===l&&(l=(0,t.createElement)("text",{id:"treeMapMeasureText"}),document.body.appendChild(l)),l.innerHTML=t.SanitizeHtmlHelper.sanitize(e),l.style.position="absolute",l.style.fontSize=i.size,l.style.fontWeight=i.fontWeight,l.style.fontStyle=i.fontStyle,l.style.fontFamily=i.fontFamily,l.style.visibility="hidden",l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new k(l.clientWidth,l.clientHeight)}var q=function(e,t,i,l,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function X(e,t,i){var l=t,o=G(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if((o=G(l=t.substring(0,n)+"...",i).width)<=e||l.length<4)return l.length<4&&(l=" "),l;return l}var J=function(e,t){this.x=e,this.y=t};function Y(e,t,i,l){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var n="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new J(o,n)}function Z(e,t,i){var l=e.createText(t,i);return l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.style["user-select"]="none",l.style["-moz-user-select"]="none",l.style["-webkit-touch-callout"]="none",l.style["-webkit-user-select"]="none",l.style["-khtml-user-select"]="none",l.style["-ms-user-select"]="none",l.style["-o-user-select"]="none",l}function Q(e,l,o,n,r){void 0===r&&(r=!1);var a,s,d,h={"font-size":l.size,"font-style":l.fontStyle,"font-family":l.fontFamily,"font-weight":l.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:l.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},p="string"==typeof e.text?e.text:r?e.text[e.text.length-1]:e.text[0],g=new i.SvgRenderer("");if(!(0,t.isNullOrUndefined)(p)&&!(0,t.isNullOrUndefined)(e.connectorText)&&p.includes(e.connectorText[1]))for(var c=p.split("#"),m=0;m<c.length;m++){var u=-1===c[m].search(e.connectorText)||(0,t.isNullOrUndefined)(e.connectorText)?c[m]:e.connectorText;if(h.id=e.id+"_"+m,d=Z(g,h,u),m%2==0&&0!==m){u=u.replace(/\s+/g," ")}var f=G(u,l);h.x=0!==m?h.x+f.width:h.x+f.width+5,n.appendChild(d)}else d=Z(g,h,p),n.appendChild(d);if("string"!=typeof e.text&&e.text.length>1){for(var y=1,v=e.text.length;y<v;y++)s=G(e.text[y],l).height,a=g.createTSpan({x:e.x,id:e.id,y:e.y+y*s},e.text[y]),d.appendChild(a);n.appendChild(d)}return d}function $(e,i,l){var o,n=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+n+"_LabelTemplate"),(0,t.isNullOrUndefined)(o)||(o.innerHTML=l)}function K(e){return document.getElementById(e)}function ee(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function te(e,t,i,l){for(var o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath?r.labelPath:l.weightValuePath]||"undefined";if(e[a]===s&&(n+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function ie(e){var t;if(e){var i=Object.keys(e);t={};for(var l=0;l<i.length;l++)if(e[i[l]]instanceof Array){t.values=e[i[l]],t.key=i[l];break}}return t}function le(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=ie(e).values;if(o&&o.length>0){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)le(o[r],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),le(e.parent,t,i,l));else if("All"===i){var a=e.levelOrderName.split("#")[0],s=void 0;for(n=0;n<l.layout.renderItems.length;n++)(s=l.layout.renderItems[n]).levelOrderName.indexOf(a)>-1&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName)}else t.push(e.levelOrderName);return t}function oe(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(l){i=(0,t.compile)(e)}return i}function ne(e,i,l){var o=(0,t.createElement)("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var n=e.length;n>0;)o.appendChild(e[0]),n--;for(var r=o.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return o.innerHTML=r,o}function re(e,t,i,l,o){var n=new J(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(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?n.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===l?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):n.y=Math.abs(e.y+e.height-i.height+5),n}function ae(e,t){var i=new k(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var l=document.getElementById(e.id);return l.parentNode.removeChild(l),i}function se(e){return(e.width-e.x)*(e.height-e.y)}function de(e){var t=he(e),i=t.width,l=t.height;return Math.min(i,l)}function he(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function pe(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function ge(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+o-a,d=l.top+n-r;return new J(e-s,t-d)}function ce(e,i,l){var o,n,r=[];if((0,t.isNullOrUndefined)(i)&&(0,t.isNullOrUndefined)(l)&&isNaN(l))return null;for(var a=0;a<e.length;a++){var s=!1,d=l;(0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to)||(0,t.isNullOrUndefined)(e[a].value)?((0,t.isNullOrUndefined)(e[a].from)||(0,t.isNullOrUndefined)(e[a].to))&&(0,t.isNullOrUndefined)(e[a].value)||(l>=e[a].from&&e[a].to>=l||e[a].value===i)&&(e[a].value===i&&(s=!0),o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:ue(e[a],d):e[a].color):l>=e[a].from&&e[a].to>=l&&e[a].value===i&&(s=!0,o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:ue(e[a],d):e[a].color),(l>=e[a].from&&l<=e[a].to||e[a].value===i)&&!(0,t.isNullOrUndefined)(e[a].minOpacity)&&!(0,t.isNullOrUndefined)(e[a].maxOpacity)&&o&&(n=me(e[a],l)),(""===o||(0,t.isNullOrUndefined)(o))&&(0,t.isNullOrUndefined)(e[a].from)&&(0,t.isNullOrUndefined)(e[a].to)&&(0,t.isNullOrUndefined)(e[a].minOpacity)&&(0,t.isNullOrUndefined)(e[a].maxOpacity)&&(0,t.isNullOrUndefined)(e[a].value)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),n=(0,t.isNullOrUndefined)(n)?"1":n,r.push(o)}for(var h=r.length-1;h>=0;h--)h=(o=r[h])?-1:h;return{fill:o,opacity:n}}function me(e,t){var i=1;t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity);return i.toString()}function ue(e,t){return ye(e,t)}function fe(e,t,i){return"#"+De(e)+De(t)+De(i)}function ye(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:fe((i=ve(Number(t),e)).r,i.g,i.b)}function ve(e,t){var i,l,o=t.from,n=t.to,r=0,a=n-o;if(r=(e-o)/a,t.color.length<=2)i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);else{i="#"===t.color[0].charAt(0)?t.color[0]:Be(t.color[0]),l="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:Be(t.color[t.color.length-1]);for(var s=a/(t.color.length-1),d=t.color.length-1,h=[],p={},g=1;g<d;g++)p={b:o+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)o<=e&&e<=h[c].b&&0===c?(l="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=n&&c===h.length-1&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),r=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s),c!==h.length-1&&c<h.length&&h[c].b<=e&&e<=h[c+1].b&&(i="#"===h[c].color.charAt(0)?h[c].color:Be(h[c].color),l="#"===h[c+1].color.charAt(0)?h[c+1].color:Be(h[c+1].color),r=Math.abs(e-h[c+1].b)/s)}return Se(r,i,l)}function Se(e,t,i){var l=i.split("#")[1],o=t.split("#")[1],n=xe(e,parseInt(o.substr(0,2),16),parseInt(l.substr(0,2),16)),r=xe(e,parseInt(o.substr(2,2),16),parseInt(l.substr(2,2),16)),a=xe(e,parseInt(o.substr(4,2),16),parseInt(l.substr(4,2),16));return new _e(n,r,a)}function xe(e,t,i){var l=i-t;return Math.round(t+l*e)}function be(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],G(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(X(e,n,i)),n=l):(r.push(X(e,l,i)),l=""),n&&a===s-1&&r.push(X(e,n,i));return r}function Ie(e,t,i){var l=[],o=0,n=G(t,i).width,r=t.length;if(e>=n)return l.push(t),l;for(var a=t.length;a>o;a--){var s=t.slice(o,a);if((n=G(s,i).width)<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function Ce(e,t,i,l){var o=G(i,l);return o.width>e||o.height>t?" ":i}function Fe(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function we(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),Te(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function Oe(e,i){var l=e.legendId;if(l)for(var o=0;o<l.length;o++)if("Interactive"===e.legendSettings.mode){for(var n=0;n<i.childElementCount;n++)if(i.childNodes[n].id===l[o]||parseFloat(i.childNodes[n].id.split("Index_")[1])===parseFloat(l[o].split("Index_")[1])){var r=i.childNodes[n];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[o]);(0,t.isNullOrUndefined)(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function Le(e,i,l){for(var o,n={},r=0;r<e.length;r++)o=(0,t.isNullOrUndefined)(e[r].childNodes[0])?e[r]:e[r].childNodes[0],n=l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options,Te(o,n),e[r].classList.remove(i),r-=1}function Te(e,i){e.setAttribute("opacity",i.opacity),(0,t.isNullOrUndefined)(i.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function Me(e,i,l){if((0,t.isNullOrUndefined)(e))return null;for(var o=0,n=Object.keys(i);o<n.length;o++){var r=n[o];e=e.split("${"+r+"}").join(Ne(i[r],l).toString())}return e}function Ne(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}var _e=function(e,t,i){this.r=e,this.g=t,this.b=i};function Ee(e){return"#"+De(e.r)+De(e.g)+De(e.b)}function De(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function Pe(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?new _e(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new _e(255,255,255)}function Be(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return Ee(new _e(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function ze(e,t,l,o,n){var r=new i.SvgRenderer(""),a=He(e,l,t,n,o);return r["draw"+a.functionName](a.renderOption)}function He(e,i,l,o,n){var r,a="Path",s=i.width,d=i.height,h=e.x,p=e.y,g=e.x+-s/2,c=e.y+-d/2;switch(l){case"Circle":case"Bubble":a="Ellipse",(0,t.merge)(o,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Diamond":r="M "+g+" "+p+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+p+" L "+h+" "+(p+d/2)+" L "+g+" "+p+" z",(0,t.merge)(o,{d:r});break;case"Rectangle":r="M "+g+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" L "+g+" "+(p+-d/2)+" z",(0,t.merge)(o,{d:r});break;case"Triangle":r="M "+g+" "+(p+d/2)+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" z",(0,t.merge)(o,{d:r});break;case"InvertedTriangle":r="M "+(h+s/2)+" "+(p-d/2)+" L "+h+" "+(p+d/2)+" L "+(h-s/2)+" "+(p-d/2)+" L "+(h+s/2)+" "+(p-d/2)+" z",(0,t.merge)(o,{d:r});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),(0,t.merge)(o,{d:r});break;case"Star":r="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",(0,t.merge)(o,{d:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),(0,t.merge)(o,{d:r});break;case"Image":a="Image",(0,t.merge)(o,{href:n,height:d,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Re(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}var Ue=function(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o};function ke(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];We(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function Ae(e,i){if(e.length>0)for(var l=0;l<e.length;l++){var o=e[l],n=parseFloat(o.legendEle.id.split("_Index_")[1]),r=o.legendEle.id.indexOf("Text")>-1?o.legendEle.id.replace("_Text",""):o.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+n),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+n);(0,t.isNullOrUndefined)(a)||We(a,o.oldFill,o.oldOpacity,"none","0px"),(0,t.isNullOrUndefined)(s)||We(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,o.oldOpacity,null,null);for(var d=(0,t.isNullOrUndefined)(o.ShapeCollection)?0:o.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(o.ShapeCollection.Elements[h].id);(0,t.isNullOrUndefined)(p)||We(p,o.shapeOldFill,o.shapeOldOpacity,o.shapeOldBorderColor,o.shapeOldBorderWidth)}}}function We(e,i,l,o,n){e.setAttribute("fill",i),e.setAttribute("opacity",l),(0,t.isNullOrUndefined)(o)||e.setAttribute("stroke",o),(0,t.isNullOrUndefined)(n)||e.setAttribute("stroke-width",n)}function je(e,t,i){Ae(e,i),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ve(e,i,l){for(var o,n=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!(0,t.isNullOrUndefined)(n)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[n]===i.data[n]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){o=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){o=a;break}}return o}function Ge(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function qe(e,i,l,o){(0,t.createElement)("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).dispatchEvent(new MouseEvent(o?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Xe(e){var i=document.getElementById(e);return i?(0,t.remove)(i):null}var Je,Ye=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(this.treemap.treemapLevelData.levelsData&&this.treemap.treemapLevelData.levelsData.length>0)if(e=(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)||!((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[])[0],i=(0,t.extend)({},this.treemap.areaRect,i,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(i=this.treemap.totalRect),(0,t.isNullOrUndefined)(this.treemap.currentLevel)||((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length))!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)&&((0,t.isNullOrUndefined)(this.treemap.drilledItems)?(0,t.isNullOrUndefined)(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(e||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems();else{var l=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[l].data,n={};n[this.treemap.drilledItems[l].data.groupName]=[o],(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(n||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=ie(e).values;if(o&&o.length>0&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],t)}return t},e.prototype.calculateLayoutItems=function(e,i){this.renderItems=[],this.parentData=[],(0,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,l,o,n,r=this.treemap.leafItemSettings,a=this.treemap.levels,s=ie(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var d=0;d<s.length;d++)l=s[d].groupIndex,o=0===a.length||l===a.length?r.gap:a[l].groupGap,n=0===a.length?0:a[l]?a[l].showHeader?a[l].headerHeight:0:a[l-1].showHeader?a[l-1].headerHeight:0,i=s[d].rect,i=new W(i.x+o/2,i.y+(n+o/2),i.width-o,Math.abs(i.height-(o+n))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,o=i.height*i.width,n=this.treemap.levels,r=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(ee);for(var d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===n.length||(this.treemap.isHierarchicalData||(0,t.isNullOrUndefined)(this.treemap.leafItemSettings.labelPath)?h.groupIndex===n.length-1:h.groupIndex===this.treemap.levels.length),s?(l=o/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new W(r+i.x,i.y,l,i.height))):(l=o/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new W(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r,a=this.treemap.leafItemSettings,s=this.treemap.levels,d=ie(e).values;if(d&&d.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(d)),this.calculateChildrenLayout(e,d,t),this.treemap.levels.length>0))for(var h=0;h<d.length;h++)o=(l=d[h]).groupIndex,i=l.rect,n=(l.isLeafItem?a.padding:s[o].groupPadding)/2,r=this.treemap.isHierarchicalData?0===o&&l.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 W(i.x+n,i.y+(r+n),i.width-n,i.height-n),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,se(i)),t.sort(Fe),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o){var n=this.getCoordinates(t,i);return m=l.concat(n)}var r=de(i),a=e[0],s=e.slice(1,o);if(this.aspectRatio(t,a,r)){var d=t.concat(a);return this.performRowsLayout(s,d,i,l)}for(var h=t.length,p=0,g=0;g<h;g+=1)p+=t[g].itemArea;var c=this.cutArea(i,p),m=(n=this.getCoordinates(t,i),l.concat(n));return this.performRowsLayout(e,[],c,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var l=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(l,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>o&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=he(e),l=i.width,o=i.height,n=i.x,r=i.y;if(l>=o){var a=t/o;return pe({x:n+a,y:r,width:l-a,height:o})}var s=t/l;return pe({x:n,y:r+s,width:l,height:o-s})},e.prototype.getCoordinates=function(e,i){for(var l,o=he(i),n=o.width,r=o.height,a=o.x,s=o.y,d=e.length,h=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<d;c+=1)g+=e[c].itemArea;var m,u,f,y=g/r,v=g/n,S=a,x=s,b=[];for(c=0;c<d;c+=1){var I=e[c];if(l=I.groupIndex,I.isLeafItem=0===h.length||(this.treemap.isHierarchicalData||!(0,t.isNullOrUndefined)(p.labelPath))&&l===h.length,f=(u=Re(this.parentData[0],I))?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,n>=r){var C=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:C},x=C}else{var F=S+I.itemArea/v;I.rect={x:S,y:x,width:F,height:x+v},S=F}I.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(I),b.push(I))}return b},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},e.prototype.onDemandProcess=function(e){var i,l;i=e[0].parent,this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;var o={};(0,t.isNullOrUndefined)(i.groupName)?o=i:o[i.groupName]=[i],l=(0,t.extend)({},this.treemap.areaRect,l,!1),(0,t.isNullOrUndefined)(this.treemap.treeMapLegendModule)||(0,t.isNullOrUndefined)(this.treemap.totalRect)||(l=this.treemap.totalRect);for(var n=this.treemap.levels.length,r=0;r<n;r++){n===e[0].groupIndex?this.treemap.levels[n]=this.treemap.levels[r]:this.treemap.levels.splice(n-1,1)}this.calculateLayoutItems(o,l),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,o,n,r=this,a=this.treemap;this.renderer=a.renderer;var d,h,p,g,c,m,u,f,y,v,S,x,b,I,C,F=a.element.id,w=a.layoutType,O=this.treemap.leafItemSettings.interSectAction,L="",T=document.getElementById(a.element.id+"_Secondary_Element"),M=a.levels;this.layoutGroup=this.renderer.createGroup({id:F+"_TreeMap_"+w+"_Layout"});var N=(0,t.createElement)("div",{id:a.element.id+"_Label_Template_Group",className:"template"});N.style.cssText="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;";for(var _,E,D=!1,P=a.leafItemSettings,B=function(w){if(m=z.renderItems[w],d=m.groupIndex,z.treemap.drillDownView&&(0,t.isNullOrUndefined)(z.treemap.currentLevel)&&d>0||z.treemap.drillDownView&&d>z.treemap.currentLevel+1)return"continue";p=m.rect,D=m.isLeafItem,y=F+"_Level_Index_"+d+"_Item_Index_"+w,b=z.renderer.createGroup({id:y+"_Group"}),S=(D?P.gap:M[d].groupGap)/2;var B,H=z.treemap.totalRect?a.legendSettings.visible?z.treemap.totalRect:he(z.treemap.totalRect):z.treemap.areaRect;if("Squarified"===a.layoutType&&(p.width=Math.abs(p.x-p.width)-S,p.height=Math.abs(p.y-p.height)-S),"TopRightBottomLeft"===a.renderDirection?p.x=H.x+H.width-p.width-Math.abs(H.x-p.x):"BottomLeftTopRight"===a.renderDirection?p.y=H.y+H.height-p.height-Math.abs(H.y-p.y):"BottomRightTopLeft"===a.renderDirection&&(p.x=H.x+H.width-p.width-Math.abs(H.x-p.x),p.y=H.y+H.height-p.height-Math.abs(H.y-p.y)),l=z.getItemColor(D,m),c=l.fill,f=l.opacity,g=D?P.labelFormat:M[d].headerFormat,i=D?P.showLabels:M[d].showHeader,d===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){E="#"+z.treemap.breadcrumbConnector+"#",B=m.levelOrderName.replace(/#/gi,E),B=0!==d?"#"+B:B}else B=m.name;else z.treemap.enableBreadcrumb&&(m.isDrilled=!1),B=m.name;u=Me(g,m.data,z.treemap)||B||"undefined",_=ie(m).values,u=!D&&_&&_.length>0&&z.treemap.enableDrillDown?m.isDrilled?a.enableRtl?u+" [-]":"[-] "+u:a.enableRtl?u+" [+]":"[+] "+u:u,a.enableHtmlSanitizer&&(u=t.SanitizeHtmlHelper.sanitize(u));var R=D?P.labelStyle.fontFamily:M[d].headerStyle.fontFamily;R=R||z.treemap.themeStyle.labelFontFamily;var U=D?P.labelStyle.size:M[d].headerStyle.size;U=U||z.treemap.themeStyle.labelFontSize;var k=D?P.labelStyle.fontWeight:M[d].headerStyle.fontWeight;k=k||z.treemap.themeStyle.fontWeight;var A=D?P.labelStyle.color:M[d].headerStyle.color,W=D?P.labelStyle.fontStyle:M[d].headerStyle.fontStyle,j=D?P.labelStyle.opacity:M[d].headerStyle.opacity;x={fontFamily:R,size:U,fontWeight:k,color:A,fontStyle:W,opacity:j},C=D?P.border:M[d].border,e=D?P.labelPosition:"Near"===M[d].headerAlignment?"TopLeft":"Center"===M[d].headerAlignment?"TopCenter":"TopRight",h=D?P.templatePosition:M[d].templatePosition,I=D?P.labelTemplate:M[d].headerTemplate,m.options={border:C,opacity:f,fill:c},o={cancel:!1,name:s,treemap:z.treemap,text:u,currentItem:m,RenderItems:z.renderItems,options:m.options,textColor:x.color},z.treemap.trigger(s,o,function(l){if(!l.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",n=new V(y+"_RectPath",c,C.width,C.color,f,null,L);var a=r.renderer.drawPath(n);b.appendChild(a),i&&(o.text!==u&&(o.text=Me(o.text,m.data,r.treemap)||B),x.color=o.textColor?o.textColor:x.color,r.renderItemText(o.text.toString(),b,x,p,O,y,c,e,E)),I&&(v=r.renderTemplate(T,y,p,h,I,m,D),(0,t.isNullOrUndefined)(v)||(N.appendChild(v),r.treemap.renderReactTemplates())),b.setAttribute("aria-label",m.name),r.treemap.enableDrillDown&&!D||r.treemap.selectionSettings.enable||r.treemap.highlightSettings.enable?(b.setAttribute("role","button"),b.setAttribute("tabindex",r.treemap.tabIndex.toString()),b.style.outline="none",b.style.cursor=r.treemap.highlightSettings.enable&&!r.treemap.selectionSettings.enable&&r.treemap.enableDrillDown&&m.groupIndex===r.treemap.levels.length-1?"default":!r.treemap.highlightSettings.enable||r.treemap.selectionSettings.enable||r.treemap.enableDrillDown?"pointer":"default"):b.setAttribute("role","region"),we(r.treemap,b,"treeMapSelection"),r.layoutGroup.appendChild(b)}})},z=this,H=0;H<this.renderItems.length;H++)B(H);N.childNodes.length>0&&T.appendChild(N),this.treemap.svgObject.appendChild(this.layoutGroup),we(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,o,n,r,a,s,d){var h,p,g,c,m=[],u=0;if(p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(o,e,l,n),h=G(p&&p[0]||g[0],l),this.treemap.enableRtl){var f=G(e,l),y=e.search("[+]")||e.search("[-]");if(o.width<f.width&&y>0){var v=e.substring(y-1,e.length),S=G("[+]",l);g[0]=X(o.width-S.width-5,g[0],l)+v}}var x=re(o,s,h,"Text",this.treemap);if(!(0,t.isNullOrUndefined)(p)){for(var b=[],I=null,C=[],F=0;F<p.length;F++)u+=(h=G(I=X(o.width-5,p[F],l),l)).height,C.push(h.width),b.push(I);g=b,h.width=Math.max.apply(null,C),h.height=u}if("WrapByWord"===n||"Wrap"===n||"Trim"===n){for(var w=0;w<g.length;w++)u+=(h=G(g[w],l)).height,o.height-5>u&&m.push(g[w]);if("Wrap"===n&&g.length!==m.length&&m.length){var O=m.length-1,L=m[O];L=L.substring(0,L.length-1)+"...",m.splice(O),"..."!==L&&m.push(L)}}else c=g,m.push(c);Q(new q(r+"_Text",x.x,x.y,"start",m,"","",d),l,l.color||this.getSaturatedColor(a),i)},e.prototype.getItemColor=function(e,i){var l=this.treemap,o=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,n=e?l.leafItemSettings.opacity:l.levels[i.groupIndex].opacity;(0,t.isNullOrUndefined)(l.treemapLevelData.defaultLevelsData)||l.treemapLevelData.defaultLevelsData.length>0&&(l.treemapLevelData.levelsData=l.treemapLevelData.defaultLevelsData);var r=ie(l.treemapLevelData.levelsData[0]).values,a=e?l.leafItemSettings.colorMapping:l.levels[i.groupIndex].colorMapping;if(a.length>0){var s=ce(a,i.data[l.equalColorValuePath],i.data[l.rangeColorValuePath]);(0,t.isNullOrUndefined)(s)||(o=(0,t.isNullOrUndefined)(s.fill)?l.leafItemSettings.fill:s.fill,n=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(o=(0,t.isNullOrUndefined)(o)?(0,t.isNullOrUndefined)(l.colorValuePath)?(0,t.isNullOrUndefined)(i.options)?!(0,t.isNullOrUndefined)(l.palette)&&l.palette.length>0?l.palette[d%l.palette.length]:"#808080":i.options.fill:r[d].data[l.colorValuePath]:o);return{fill:o,opacity:n}},e.prototype.getSaturatedColor=function(e){var t=e,i=Pe(Be(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,l,o,n,r,a){var s,d=a?i+"_LabelTemplate":i+"_HeaderTemplate",h=a?"_LabelTemplate":"_HeaderTemplate";if((0,t.isNullOrUndefined)(n.prototype)&&"string"==typeof n)for(var p=Object.keys(r.data),g=0;g<p.length;g++){var c=RegExp;n=n.replace(new c("{{:"+p[g]+"}}","g"),r.data[p[g].toString()])}if(this.treemap.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n)),!(0,t.isNullOrUndefined)(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=re(l,o,ae(s=ne(oe(n)(r.data,this.treemap,n,this.treemap.element.id+h,!1),d,r.data),e),"Template",this.treemap);s.style.left=m.x+"px",s.style.top=m.y+"px"}return s},e.prototype.labelInterSectAction=function(e,t,i,l){var o,n=e.width-10;switch(l){case"Hide":o=[Ce(n,e.height,t,i)];break;case"Trim":o=[X(n+3,t,i)];break;case"WrapByWord":o=be(n,t,i);break;case"Wrap":o=Ie(n,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}(),Ze=r(74);function Qe(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",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:C,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:C,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:C,legendBorderColor:"#000000",legendBorderWidth:0}}return t}!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(Je||(Je={}));var $e=function(){function e(e){}return e.prototype.print=function(e,i){var l=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");l.moveTo(0,0),l.resizeTo(screen.availWidth,screen.availHeight);var o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:n};e.trigger(n,o,function(){o.cancel||(0,t.print)(o.htmlContent,l)})},e.prototype.getHTMLContent=function(e,i){var l=(0,t.createElement)("div");if(i)i instanceof Array?i.forEach(function(e){l.appendChild(K(e).cloneNode(!0))}):i instanceof Element?l.appendChild(i.cloneNode(!0)):l.appendChild(K(i).cloneNode(!0));else{var o=e.element.cloneNode(!0),n=o.getElementsByTagName("svg")[0];if(!(0,t.isNullOrUndefined)(n)&&(n=n.childNodes[0],!(0,t.isNullOrUndefined)(n))){var r=n.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")}l.appendChild(o)}return l},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),Ke=function(){function e(e){}return e.prototype.export=function(e,i,l,o){return new Promise(function(n,r){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),d=s.childNodes[0];if(!(0,t.isNullOrUndefined)(d)){var h=d.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)o?qe(l,i,c,p):n(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),o?qe(l,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?n(a.toDataURL("image/jpeg")):"PNG"===i&&n(a.toDataURL("image/png"))},m.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),et=r(461),tt=function(){function e(e){}return e.prototype.export=function(e,i,l,o,n){return new Promise(function(i,r){var a=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});o=(0,t.isNullOrUndefined)(o)?et.PdfPageOrientation.Landscape:o;var s=e.svgObject.cloneNode(!0),d=s.childNodes[0];if(!(0,t.isNullOrUndefined)(d)){var h=d.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"})),g=new Image,c=a.getContext("2d");g.onload=function(){c.drawImage(g,0,0),window.URL.revokeObjectURL(p);var t=new et.PdfDocument,r=a.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=o,r=r.slice(r.indexOf(",")+1),t.pages.add().graphics.drawImage(new et.PdfBitmap(r),0,0,e.availableSize.width-60,e.availableSize.height),n?(t.save(l+".pdf"),t.destroy()):i(null)},g.src=p})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),it=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])},e(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),lt=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},ot=function(e){function n(t,i){var l=e.call(this,t,i)||this;return l.isResize=!1,l.orientation="Horizontal",l.drilledItems=[],l.isHierarchicalData=!1,l.levelSelection=[],l.legendId=[],l}return it(n,e),n.prototype.preRender=function(){var e=this;this.trigger(l,{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},n.prototype.render=function(){this.renderElements()},n.prototype.renderElements=function(){this.treemapLevelData=new nt,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=Qe(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),(0,t.isNullOrUndefined)(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},n.prototype.processDataManager=function(){var e,i,l,o,n=this;this.dataSource instanceof Ze.DataManager?(e=this.dataSource,i=this.query instanceof Ze.Query?this.query:new Ze.Query,e.executeQuery(i).then(function(e){n.dataSource=e.result,n.renderTreeMapElements()})):this.dataSource instanceof Ue?(o=this.dataSource,(l=new t.Fetch(o.dataOptions,o.type,o.contentType)).onSuccess=function(e){if((0,t.isNullOrUndefined)(e.type)||"application/octet-stream"!==e.type)n.dataSource=e,n.renderTreeMapElements();else{var i=new FileReader,l=n;i.onload=function(){e=JSON.parse(i.result.toString()),l.dataSource=e,l.renderTreeMapElements()},i.readAsText(e)}},l.send(o.sendData)):this.renderTreeMapElements()},n.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),!(0,t.isNullOrUndefined)(this.treeMapLegendModule)&&this.legendSettings.visible&&Oe(this,this.treeMapLegendModule.legendGroup),this.elementChange(),this.trigger(o,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},n.prototype.createSvg=function(){if(this.svgObject){for(;this.svgObject.childNodes.length>0;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&(0,t.remove)(this.svgObject)}(0,t.isNullOrUndefined)(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),(0,t.isNullOrUndefined)(this.layout)&&(this.layout=new Ye(this)),this.clearTemplate();var e=this.element.clientWidth,l=this.element.clientHeight;this.availableSize=new k(A(this.width,e)||e||600,A(this.height,l)||l||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},n.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 Ye(this)},n.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");if(e&&e.childElementCount>0&&e.parentNode.removeChild(e),(0,t.isNullOrUndefined)(document.getElementById(this.element.id+"_Secondary_Element"))){var i=(0,t.createElement)("div",{id:this.element.id+"_Secondary_Element"});i.style.cssText="position: absolute;z-index:1;",this.element.appendChild(i)}},n.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!(0,t.isNullOrUndefined)(this.svgObject)&&!(0,t.isNullOrUndefined)(document.getElementById(this.layout.layoutGroup.id))&&!(0,t.isNullOrUndefined)(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},n.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)&&(0,t.isNullOrUndefined)(i)){var l=new j(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new W(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(l))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},n.prototype.renderTitle=function(e,i,l,o){var n,r={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},a=this.availableSize.width-this.margin.right-this.margin.left;if(r.fontFamily=r.fontFamily||this.themeStyle.fontFamily,r.fontWeight=r.fontWeight||this.themeStyle.titleFontWeight,r.size=r.size||("title"===i?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text){(0,t.isNullOrUndefined)(o)&&(o=this.renderer.createGroup({id:this.element.id+"_Title_Group"}));var s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text,d=X(a,s,r),h=G(d,r),p=Y((0,t.isNullOrUndefined)(l)?new W(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):l,e.alignment,h,i),g=new q(this.element.id+"_TreeMap_"+i,p.x,p.y,"start",d),c=new W(p.x,p.y,h.width,h.height),m=Q(g,r,r.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);m.setAttribute("aria-label",e.description||s),m.setAttribute("role","region"),m.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(n=this.availableSize.height-c.y-10-this.margin.bottom,this.areaRect=new W(this.margin.left,c.y+10,a,n)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",c,o):this.svgObject.appendChild(o)}else n=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new W(this.margin.left,this.margin.top,a,n)},n.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!(0,t.isNullOrUndefined)(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.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 l={level:0};e=this.leafItemSettings.labelPath,l[e]=[];for(var o=0;o<this.dataSource.length;o++){var n=ie(this.dataSource[o]).values;this.isHierarchicalData&&n&&n.length>0?n.forEach(function(t){t[e]&&l[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[o][e]&&l[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]})}this.treemapLevelData.levelsData.push(l)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=(0,t.extend)([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(o=0;o<this.treemapLevelData.hierarchyData.length;o++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[o],o);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][e],"Parent")}},n.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=ie(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},n.prototype.processHierarchicalData=function(e,i){var l,o,n,r=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if((l=(a=ie(e))?a.values:null)&&l.length>0){n=a.key;for(var d=0;d<this.levels.length;d++)n===this.levels[d].groupPath&&(o=d);for(var h=0;h<l.length;h++){l[h].name=l[h][s],l[h].levelOrderName=(0===o?l[h].name:e.levelOrderName+"#"+l[h].name)+"";var p=l[h].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),l[h].groupIndex=(0,t.isNullOrUndefined)(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(l[h].parent=e),l[h].groupName=n,l[h].data=l[h],l[h].isDrilled=!1,l[h].weight=l[h][this.weightValuePath]}l.forEach(function(e){r.processHierarchicalData(e,i)})}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!(0,t.isNullOrUndefined)(c)){for(var m=0;m<this.treemapLevelData.hierarchyData.length;m++)l=ie(this.treemapLevelData.hierarchyData[m]).values,0!==m&&l&&(l.forEach(function(e){c.push(e)}),this.treemapLevelData.hierarchyData.splice(m,1),m-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var u=0;u<c.length;u++)a[this.levels[0].groupPath]=c,c[u].parent=a}}},n.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},n.prototype.export=function(e,i,l,o){var n=this;return(0,t.isNullOrUndefined)(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,r){t(n.pdfExportModule.export(n,e,i,l,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,l){t(n.imageExportModule.export(n,e,i,o))}):null},n.prototype.processFlatJsonData=function(){var e;this.dataSource=this.dataSource;for(var i=[],l=0;l<this.levels.length+1;l++){e=this.levels[l]?this.levels[l].groupPath:this.leafItemSettings.labelPath;var o={};o.level=l,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var n=0;n<this.dataSource.length;n++){var r={},a="";if(!(0,t.isNullOrUndefined)(e)){var s=this.dataSource[n][e];if(0!==l)for(var d=0;d<=l;d++){var h=this.levels[d]?this.levels[d].groupPath:e;a+=this.dataSource[n][h]+(d===l?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(r.name=s,r.levelOrderName=(a||s)+"",r.groupIndex=l,r.isDrilled=!1,r.groupName=e,r.data=this.dataSource[n],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(r),i.push(a||s))}}}},n.prototype.reOrderLevelData=function(e){for(var i,l=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,n=this.treemapLevelData.levelsData[e][l],r=this.treemapLevelData.levelsData[e-1][o],a=0;a<n.length;a++){i=n[a].levelOrderName;for(var s=0;s<r.length;s++)if(r[s][l]=(0,t.isNullOrUndefined)(r[s][l])?[]:r[s][l],this.IsChildHierarchy(i.split("#"),r[s].levelOrderName.split("#"))){(0,t.isNullOrUndefined)(n[a].parent)&&(n[a].parent=r[s]),r[s][l].push(n[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][l],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},n.prototype.IsChildHierarchy=function(e,t){for(var i=!1,l=0;l<t.length;l++){if(e.length<l||t[l]!==e[l])return!1;i=!0}return i},n.prototype.findTotalWeight=function(e,t){for(var i,l,o,n=this,r={},a=function(a){i=0,o=e[a].groupName,l=e[a].levelOrderName.split("#"),s.dataSource.forEach(function(t){te(l,e[a].levelOrderName,t,n)&&(i+=parseFloat(t[n.weightValuePath]))}),"Parent"===t&&(r[o]=e,e[a].parent=r),e[a].weight=i},s=this,d=0;d<e.length;d++)a(d)},n.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),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},n.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),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent),this.setStyle(this.element)},n.prototype.setStyle=function(e){e.style.overflow="hidden"},n.prototype.setCulture=function(){this.intl=new t.Internationalization},n.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},n.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var l={name:I,cancel:!1,previousSize:this.availableSize,currentSize:new k(0,0),treemap:this};this.resizeTo&&clearTimeout(this.resizeTo),!(0,t.isNullOrUndefined)(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),l.currentSize=i.availableSize,i.trigger(I,l,function(e){i.render(),i.refreshing=!1})},500))}},n.prototype.clickOnTreeMap=function(e){var i,l,o=this,n=e.target,r=n.id,a=n.innerHTML,s={cancel:!1,name:f,treemap:this,mouseEvent:e};this.trigger(f,s),r.indexOf("_Item_Index")>-1&&(e.preventDefault(),l=parseFloat(r.split("_Item_Index_")[1]),i={cancel:!1,name:m,treemap:this,item:this.layout.renderItems[l],mouseEvent:e,groupIndex:this.layout.renderItems[l].groupIndex,groupName:this.layout.renderItems[l].name,text:a,contentItemTemplate:a},this.trigger(m,i,function(e){e.text===a&&e.contentItemTemplate===a||((0,t.isNullOrUndefined)(o.leafItemSettings.labelTemplate)?(e.text=Me(e.text,e.item.data,e.treemap),n.textContent=e.text):$(r,n,e.contentItemTemplate))}));var d,h=(new Date).getMilliseconds();(0,t.isNullOrUndefined)(this.doubleClick)||(!(0,t.isNullOrUndefined)(d)&&h-d<500&&this.doubleClickOnTreeMap(e),d=h)},n.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:y,treemap:this,mouseEvent:e};this.trigger(y,t)},n.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:v,treemap:this,mouseEvent:e};this.trigger(v,t)},n.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(t.Browser.touchStartEvent,e)},n.prototype.mouseMoveOnTreeMap=function(e){var i,l,o,n=e.target.id,r={cancel:!1,name:S,treemap:this,mouseEvent:e};this.trigger(S,r),this.removeFocus("none"),n.indexOf("_Item_Index")>-1?(o=ie(l=this.layout.renderItems[parseFloat(n.split("_Item_Index_")[1])]).values,this.element.style.cursor=!l.isLeafItem&&o&&o.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:u,treemap:this,item:l,mouseEvent:e},this.trigger(u,i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},n.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,n=t.levelOrderName.split("#"),r=0,a=Object.keys(n);r<a.length;r++)n[l=a[r]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:n}},n.prototype.calculatePreviousLevelChildItems=function(e,i,l){for(var o,n,r,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<s;d++)r=0===d?e.levelText[d]:r+"#"+e.levelText[d];a=s>1?s:a;for(var h=0,p=Object.values(this.layout.renderItems);h<p.length;h++){(n=p[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?(0,t.isNullOrUndefined)(r)?r:e.levelText[a]:l?r:r+"#"+e.levelText[a])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),l=!0,++a<=i.groupIndex&&(r=o=o+"#"+e.levelText[a]))}return l},n.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var l,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((l=this.drilledItems[i].data.parent).isDrilled=!0,o[l[this.drilledItems[i].data.groupName]]=[l],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},n.prototype.mouseEndOnTreeMap=function(e){var i,l,o,n,r,a,s,p=this,g=e.target,c=g.id,m=!1,u={},f=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",y=this.element.id+"_Label_Template_Group";if(c.indexOf("_Item_Index")>-1&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),n=parseFloat(c.split("_Item_Index_")[1]),r=this.layout.renderItems[n];var v=g.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(v,r),a=s.drillLevel,this.drillDownView||-1===v.search("[+]")||(m=this.calculatePreviousLevelChildItems(s,r,m))),0!==this.levels.length&&!r.isLeafItem&&ie(r).values&&ie(r).values.length>0){if(this.drilledItems.length>0){r=m?this.drilledItems[this.drilledItems.length-1].data:r;for(var S=0;S<this.drilledItems.length;S++){if(!(0,t.isNullOrUndefined)(a)){var x=this.drilledItems.length;if(u=this.compareSelectedLabelWithDrillDownItems(s,r,S),x!==this.drilledItems.length){S-=1;break}}if(r.levelOrderName===this.drilledItems[S].name&&!m&&(0,t.isNullOrUndefined)(a)){0===r.groupIndex&&r.parent[r.groupName]instanceof Array?(r.isDrilled=!r.isDrilled,r.isDrilled?u[r.groupName]=[r]:u=r.parent):(r.isDrilled=!1,r.parent.isDrilled=!0,r=r.parent,u[r.groupName]=[r]),this.drilledItems.splice(S,1),S-=1;break}S===this.drilledItems.length-1&&(0,t.isNullOrUndefined)(a)&&(r.isDrilled=!0,u[r.groupName]=[r])}}else r.isDrilled=!0,u[r.groupName]=[r];l={cancel:!1,name:d,treemap:this,element:g,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:r.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!(0,t.isNullOrUndefined)(a)?this.drilledItems[this.drilledItems.length-1].data.name:r.name,rightClick:3===e.which,childItems:null,item:u},this.trigger(d,l,function(e){if(p.currentLevel=r.isDrilled&&(0,t.isNullOrUndefined)(a)?r.groupIndex:!(0,t.isNullOrUndefined)(a)&&p.enableBreadcrumb&&r.isDrilled?a:null,!e.cancel){if(document.getElementById(f)){var l=document.getElementById(f);l.parentNode.removeChild(l)}if(i=(0,t.extend)({},p.areaRect,i,!0),p.legendSettings.visible&&!(0,t.isNullOrUndefined)(p.treeMapLegendModule)&&((0,t.isNullOrUndefined)(u)||(p.treeMapLegendModule.legendGroup.textContent="",p.treeMapLegendModule.legendGroup=null,p.treeMapLegendModule.widthIncrement=0,p.treeMapLegendModule.heightIncrement=0,p.enableBreadcrumb&&!(0,t.isNullOrUndefined)(a)?p.drilledLegendItems={name:p.drilledItems[p.drilledItems.length-1].data.levelOrderName,data:p.drilledItems[p.drilledItems.length-1].data}:p.drilledLegendItems={name:r.levelOrderName,data:r},p.treeMapLegendModule.renderLegend()),i=(0,t.isNullOrUndefined)(p.totalRect)?i:p.totalRect),document.getElementById(y)){var o=document.getElementById(y);o.parentNode.removeChild(o)}(0,t.isNullOrUndefined)(e.childItems)||e.cancel?(p.layout.calculateLayoutItems(u,i),p.layout.renderLayoutItems()):p.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:h,treemap:this,renderItems:this.layout.renderItems},this.trigger(h,o),!m&&(0,t.isNullOrUndefined)(a)&&this.drilledItems.push({name:r.levelOrderName,data:r})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},n.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(Ae(this.treeMapHighlightModule.shapeHighlightCollection,this),this.treeMapHighlightModule.highLightId=""),this.removeFocus("")},n.prototype.keyUpHandler=function(e){if("Tab"===e.code){var t=e.target.id,i=document.getElementById(t);if(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)if(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable){i.style.setProperty("outline","none"),i.classList.add("keyboard-focused");var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapHighlightModule.highlightOnMouseMove(l)}else this.removeFocus(""),i.style.outline="2px solid black",i.classList.add("keyboard-focused");else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&Ae(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")}},n.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);if("Enter"===e.code){if(this.selectionSettings.enable&&(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)){var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapSelectionModule.selectionOnMouseDown(l)}this.enableDrillDown&&i.childElementCount>0&&this.mouseEndOnTreeMap(e)}},n.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||t.indexOf("Item_Index")>-1&&e.relatedTarget.id.indexOf("Legend")>-1||t.indexOf("Legend")>-1&&e.relatedTarget.id.indexOf("Item_Index")>-1)&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),Ae(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},n.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},n.prototype.selectItem=function(e,i){(0,t.isNullOrUndefined)(i)&&(i=!0);for(var l="",o=0;o<e.length;o++)o!==e.length-1?l+=e[o]+"#":l+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(l,i)},n.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,$e],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Ke],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,tt],name:"PdfExport"}),e},n.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,l=0,o=Object.keys(e);l<o.length;l++){switch(o[l]){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())}},n.prototype.getModuleName=function(){return"treemap"},n.prototype.destroy=function(){this.unWireEVents(),Xe("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,(0,t.isNullOrUndefined)(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},n.prototype.removeSvg=function(){if(Xe(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&&(0,t.remove)(this.svgObject)}},n.prototype.getPersistData=function(){return""},lt([(0,t.Property)(!1)],n.prototype,"allowPrint",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowImageExport",void 0),lt([(0,t.Property)(!1)],n.prototype,"allowPdfExport",void 0),lt([(0,t.Property)(null)],n.prototype,"width",void 0),lt([(0,t.Property)(null)],n.prototype,"height",void 0),lt([(0,t.Complex)({},O)],n.prototype,"border",void 0),lt([(0,t.Complex)({},L)],n.prototype,"margin",void 0),lt([(0,t.Property)(null)],n.prototype,"background",void 0),lt([(0,t.Property)("Material")],n.prototype,"theme",void 0),lt([(0,t.Complex)({},_)],n.prototype,"titleSettings",void 0),lt([(0,t.Property)("Squarified")],n.prototype,"layoutType",void 0),lt([(0,t.Property)(null)],n.prototype,"dataSource",void 0),lt([(0,t.Property)(null)],n.prototype,"query",void 0),lt([(0,t.Property)(null)],n.prototype,"weightValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"rangeColorValuePath",void 0),lt([(0,t.Property)("")],n.prototype,"equalColorValuePath",void 0),lt([(0,t.Property)(null)],n.prototype,"colorValuePath",void 0),lt([(0,t.Property)([])],n.prototype,"palette",void 0),lt([(0,t.Property)("TopLeftBottomRight")],n.prototype,"renderDirection",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableDrillDown",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableBreadcrumb",void 0),lt([(0,t.Property)(" - ")],n.prototype,"breadcrumbConnector",void 0),lt([(0,t.Property)(!1)],n.prototype,"drillDownView",void 0),lt([(0,t.Property)(!1)],n.prototype,"enableHtmlSanitizer",void 0),lt([(0,t.Complex)({},P)],n.prototype,"initialDrillDown",void 0),lt([(0,t.Complex)({},B)],n.prototype,"leafItemSettings",void 0),lt([(0,t.Collection)([],U)],n.prototype,"levels",void 0),lt([(0,t.Complex)({},R)],n.prototype,"highlightSettings",void 0),lt([(0,t.Complex)({},H)],n.prototype,"selectionSettings",void 0),lt([(0,t.Complex)({},z)],n.prototype,"tooltipSettings",void 0),lt([(0,t.Complex)({},D)],n.prototype,"legendSettings",void 0),lt([(0,t.Property)(!1)],n.prototype,"useGroupingSeparator",void 0),lt([(0,t.Property)(null)],n.prototype,"description",void 0),lt([(0,t.Property)(0)],n.prototype,"tabIndex",void 0),lt([(0,t.Property)(null)],n.prototype,"format",void 0),lt([(0,t.Event)()],n.prototype,"load",void 0),lt([(0,t.Event)()],n.prototype,"beforePrint",void 0),lt([(0,t.Event)()],n.prototype,"loaded",void 0),lt([(0,t.Event)()],n.prototype,"itemRendering",void 0),lt([(0,t.Event)()],n.prototype,"drillStart",void 0),lt([(0,t.Event)()],n.prototype,"drillEnd",void 0),lt([(0,t.Event)()],n.prototype,"itemSelected",void 0),lt([(0,t.Event)()],n.prototype,"itemHighlight",void 0),lt([(0,t.Event)()],n.prototype,"tooltipRendering",void 0),lt([(0,t.Event)()],n.prototype,"itemClick",void 0),lt([(0,t.Event)()],n.prototype,"itemMove",void 0),lt([(0,t.Event)()],n.prototype,"click",void 0),lt([(0,t.Event)()],n.prototype,"doubleClick",void 0),lt([(0,t.Event)()],n.prototype,"rightClick",void 0),lt([(0,t.Event)()],n.prototype,"mouseMove",void 0),lt([(0,t.Event)()],n.prototype,"resize",void 0),lt([(0,t.Event)()],n.prototype,"legendItemRendering",void 0),lt([(0,t.Event)()],n.prototype,"legendRendering",void 0),n=lt([t.NotifyPropertyChanges],n)}(t.Component),nt=function(){},rt=function(){function e(e){this.page=0,this.legendBorderRect=new W(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new W(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,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={cancel:!1,name:b,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger(b,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,l=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!(0,t.isNullOrUndefined)(this.treemap.palette)&&this.treemap.palette.length>0||!(0,t.isNullOrUndefined)(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var o=l.position,n=i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.title.text):l.title.text,r=l.titleStyle,a=l.mode,s=0,d=0,h=0,p=0,g=l.shapeHeight,c=l.shapeWidth,m=[],u=[],f="None"===l.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":l.orientation,y=l.width.length>1?l.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(l.width):parseFloat(l.width):null,v=l.height.length>1?l.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(l.height):parseFloat(l.height):null;r.fontFamily=r.fontFamily||i.themeStyle.fontFamily,r.fontWeight=r.fontWeight||i.themeStyle.titleFontWeight,r.size=r.size||i.themeStyle.subtitleFontSize;var S=G(n,r),x=0,b=0,I=l.shapePadding,C=l.textStyle;if(C.size=C.size||i.themeStyle.legendFontSize,C.fontFamily=C.fontFamily||i.themeStyle.fontFamily,C.fontWeight=C.fontWeight||i.themeStyle.fontWeight,"Default"===a){y=(0,t.isNullOrUndefined)(y)?i.areaRect.width:y,v=(0,t.isNullOrUndefined)(v)?i.areaRect.height:v;for(var F=0,w=0;w<this.legendCollections.length;w++){var O=this.legendCollections[w];(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var L=G(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(O.legendName):O.legendName,C);if(this.textMaxWidth=Math.max(this.textMaxWidth,L.width),0===w)x=s=10+c/2,b=d=10+S.height+(g>L.height?g/2:L.height/4);else{var T=L.height>g?L.height:g;if("Horizontal"===f){var M=u[F-1].x+u[F-1].width+10+c;if(M+I+L.width>y){var N=(u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2)+10;N+T>v?(this.getPageChanged(),F=0,m=[],u=[],s=x,d=b):(s=m[0].x,d=N+T/2)}else s=M-c/2,d=m[F-1].y}else{var _=u[F-1].y>m[F-1].y+g/2?u[F-1].y:m[F-1].y+g/2;if(_+10+T>v){var E=u[F-1].x+this.textMaxWidth+10;E+I+L.width>y?(s=x,d=b,u=[],m=[],this.getPageChanged(),F=0):(s=E+c/2,d=m[0].y)}else s=m[F-1].x,d=_+10+g/2}}h=s+c/2+I,p=d+L.height/4,m.push({x:s,y:d}),u.push({x:h,y:p,width:L.width,height:L.height/2}),this.totalPages[this.page].Collection.push({DisplayText:O.legendName,element:O.gradientElement,Shape:{x:s,y:d},Text:{x:h,y:p},Fill:O.legendFill,Data:O.legendData,Rect:{x:m[F].x-c/2,y:m[F].y-g/2<p-L.height?m[F].y-g/2:p-L.height,width:Math.abs(m[F].x-c/2-(h+L.width)),height:g>L.height?g:L.height}}),F++}var D=this.totalPages[0].Collection;D.forEach(function(t,i){var l=new W(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(x=l.x,b=l.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(x-(l.x+l.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(b-(l.y+l.height)))}),y=this.widthIncrement<y?this.widthIncrement:y,v=this.heightIncrement<v?this.heightIncrement:v,this.legendItemRect={x:D[0].Rect.x,y:D[0].Rect.y,width:y,height:v}}else{var P=this.legendCollections.length,B="Horizontal"===f?(0,t.isNullOrUndefined)(y)?i.areaRect.width/P:y/P:(0,t.isNullOrUndefined)(y)?25:y,z="Horizontal"===f?(0,t.isNullOrUndefined)(v)?25:v:(0,t.isNullOrUndefined)(v)?i.areaRect.height/P:v/P;x=0,b=S.height+10;var H=10,R=l.labelPosition,U=0,A=0,j=l.labelDisplayMode,V=0,q=0;for(w=0;w<this.legendCollections.length;w++){x="Horizontal"===f?x+B:x,b="Horizontal"===f?b:b+z;var J=this.legendCollections[w].legendName,Y=new k(0,0);"None"===j?Y=G(J,C):"Trim"===j?Y=G(J=X("Horizontal"===f?B:z,J,C),C):J="",V=Math.max(V,Y.height),q=Math.max(q,Y.width),Y.width>0&&Y.height>0&&("Horizontal"===f?(h=x+B/2,p="After"===R?b+z+Y.height/2+H:b-H):(h="After"===R?x-Y.width/2-H:x+B+Y.width/2+H,p=b+z/2+Y.height/4)),0===w&&(U="Horizontal"===f?x:"After"===R?h-Y.width/2:x,A="Horizontal"===f?"After"===R?b:p-Y.height/2:b),w===P-1&&(y="Horizontal"===f?Math.abs(x+B-U):B+q+H,v="Horizontal"===f?z+V/2+H:Math.abs(b+z-A)),this.legendRenderingCollections.push({fill:this.legendCollections[w].legendFill,x,y:b,width:B,height:z,element:this.legendCollections[w].gradientElement,text:J,textX:h,textY:p,textWidth:Y.width,textHeight:Y.height,data:this.legendCollections[w].legendData})}this.legendItemRect={x:U,y:A,width:y,height:v}}}},e.prototype.getPageChanged=function(){this.page++,(0,t.isNullOrUndefined)(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},e.prototype.findColorMappingLegendItems=function(e){var t=ie(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){var i,l,o;if(!(0,t.isNullOrUndefined)(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!(0,t.isNullOrUndefined)(this.treemap.initialDrillDown.groupName)&&(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems))for(var n=ie(e).values,r=0;r<n.length;r++)if(n[r].Name===this.treemap.initialDrillDown.groupName){n[r].isDrilled=!n[r].isDrilled,e=n[r],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:n[r].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!(0,t.isNullOrUndefined)(this.treemap.drilledLegendItems)){var a=this.treemap.drilledLegendItems;if((0,t.isNullOrUndefined)(a.data.options))for(r=0;r<a.length;r++){l=this.treemap.palette.length>0?this.treemap.palette[r%this.treemap.palette.length]:a[r].data[this.treemap.colorValuePath];break}else l=a.data.options.fill;if(a.data.isDrilled)i=ie(a.data).values;else i=ie(a.data.parent).values}else i=ie(e).values;if(i&&i.length>0){for(var s=0;s<i.length;s++)((0,t.isNullOrUndefined)(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(o=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,o)||this.legendCollections.push({legendName:o,legendFill:this.treemap.palette.length>0?(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:l:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight,levelOrderName:i[s].levelOrderName}));if(this.legendCollections.sort(Fe),this.treemap.palette.length>0)for(var d=0;d<this.legendCollections.length;d++)this.legendCollections[d].legendFill=(0,t.isNullOrUndefined)(this.treemap.currentLevel)?this.treemap.palette[d%this.treemap.palette.length]:l}},e.prototype.calculateLegendItems=function(e){var i,l,o,n,r,a,s,d,h,p,g,c,m,u,f,y,v,S,x,b=!1,I=this.treemap.leafItemSettings,C=this.treemap.levels,F=this.treemap.legendSettings.position,w=!1,O=0;this.outOfRangeLegend=null;for(var L=0;L<e.length;L++){l="",f=!1,y=!1,w=!1,n=e[L].data,d=e[L].groupIndex,s=(a=0===this.treemap.levels.length||d===this.treemap.levels.length)?I.colorMapping:C[d].colorMapping;for(var T=0;T<s.length;T++){var M=s[T];if(p=null,o=Number(n[this.treemap.rangeColorValuePath]),h=n[this.treemap.equalColorValuePath],M.value=(0,t.isNullOrUndefined)(M.value)?M.value:M.value.toString(),!(0,t.isNullOrUndefined)(M.from)&&!(0,t.isNullOrUndefined)(M.to)&&o>=M.from&&o<=M.to&&M.showLegend?(b=!0,y=!0,m=M.from+" - "+M.to,r=(0,t.isNullOrUndefined)(M.label)?M.from+" - "+M.to:M.label,l=(0,t.isNullOrUndefined)(M.color)?l:M.color,i=this.isAddNewLegendData(m)):!(0,t.isNullOrUndefined)(M.value)&&h===M.value&&M.showLegend&&(b=!0,f=!0,m=M.value.toString(),r=(0,t.isNullOrUndefined)(M.label)?M.value.toString():M.label,l=(0,t.isNullOrUndefined)(M.color)?l:"[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,i=this.isAddNewLegendData(m)),b&&(0,t.isNullOrUndefined)(M.value)&&M.maxOpacity&&M.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(w=!0,"[object Array]"===Object.prototype.toString.call(M.color))for(var _=0;_<M.color.length;_++){var E={colorStop:(_*(100/(M.color.length-1))+"%").toString(),color:M.color[_]};N.push(E)}else{E={colorStop:"0%",color:l};var D={colorStop:"100%",color:l};N.push(E),N.push(D)}g="Top"===F||"Bottom"===F?"100%":"0%",c="Top"===F||"Bottom"===F?"0%":"100%";var P={id:"groupIndex_"+d+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",P,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(M.color)&&(p.childNodes[0].setAttribute("stop-opacity",M.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",M.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}if(u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,r),i&&i.process&&b&&!u?(b=!1,l="[object Array]"===Object.prototype.toString.call(M.color)&&(0,t.isNullOrUndefined)(p)&&(0,t.isNullOrUndefined)(M.value)?this.legendGradientColor(M,O):l,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:r,legendFill:l,legendData:[],groupIndex:a?-1:d,gradientElement:(0,t.isNullOrUndefined)(p)?(0,t.isNullOrUndefined)(M.value)?this.legendLinearGradient:null:p,name:e[L].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[L]),O++):b&&(b=!1,this.legendCollections[i.value].legendData.push(e[L])),!y&&!w&&!f&&(0,t.isNullOrUndefined)(M.from)&&(0,t.isNullOrUndefined)(M.to)&&(0,t.isNullOrUndefined)(M.minOpacity)&&(0,t.isNullOrUndefined)(M.maxOpacity)&&(0,t.isNullOrUndefined)(M.value)&&!(0,t.isNullOrUndefined)(M.color)){v="[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,S=(0,t.isNullOrUndefined)(M.label)?"Others":M.label,u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,S),(0,t.isNullOrUndefined)(this.outOfRangeLegend)&&!u&&(this.legendCollections.push({actualValue:S,legendData:[],legendName:S,legendFill:v,groupIndex:!a||d>-1?d:-1}),x=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[x-1],O++);for(var B=this.legendCollections.length-1;B>=0;B--)if(this.legendCollections[B].actualValue===(M.label||"Others")){this.legendCollections[B].legendData.push(e[L]);break}}}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,l=0;l<e.length;l++)if(e[l].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 l=0;l<this.legendCollections.length;l++){if(e===this.legendCollections[l].actualValue){t=!1,i=l;break}l===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,i,l=this.treemap.legendSettings,o=this.treemap.renderer,n=l.textStyle;if(this.legendGroup=o.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===l.mode)this.drawLegendItem(this.currentPage);else for(var r=0;r<this.legendRenderingCollections.length;r++){var a=this.treemap.element.id+"_Legend_Index_"+r,s=this.treemap.element.id+"_Legend_Index_"+r+"_Text",d=this.legendRenderingCollections[r];e=(i=d.element)?"url(#"+i.id+")":d.fill;var h=new W(d.x,d.y,d.width,d.height),p=new J(d.textX,d.textY),g=new j(a,e,l.shapeBorder,l.opacity,h);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.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),p.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+d.textHeight/2-Math.abs(this.legendBorderRect.y-p.y)):(g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+g.width)-Math.abs(this.legendBorderRect.x-g.x),p.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-p.x)));var c=this.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d.text):d.text;Q(new q(s,p.x,p.y,"middle",c,"",""),n,n.color||this.treemap.themeStyle.legendTextColor,this.legendGroup);var m=o.drawRectangle(g);m.setAttribute("tabindex",this.treemap.tabIndex.toString()),m.style.outline="",this.legendGroup.appendChild(m)}Oe(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,n=e.Text,r=G(e.DisplayText,l.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),n.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+r.width+t)-Math.abs(this.legendBorderRect.x-n.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)-l.shapeHeight/2,n.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-n.y)),{shapeLocation:o,textLocation:n}},e.prototype.drawLegendItem=function(e){var i,l,o=this,n=this.treemap,r=10,a=n.legendSettings,s=new k(a.shapeWidth,a.shapeHeight),d=n.renderer,h=a.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var p="HorizontalLine"===a.shape||"VerticalLine"===a.shape||"Cross"===a.shape,g=p?(0,t.isNullOrUndefined)(a.fill)?"#000000":a.fill:h.color,c=p&&0===h.width?1:h.width,m=function(h){var m=u.totalPages[e].Collection[h],f=u.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(m.DisplayText):m.DisplayText,y=d.createGroup({id:n.element.id+"_Legend_Index_"+h});y.setAttribute("aria-label",f+" Legend"),y.setAttribute("role","region"),y.setAttribute("tabindex",u.treemap.tabIndex.toString()),y.style.outline="none";var v=n.element.id+"_Legend_Shape_Index_"+h,S=n.element.id+"_Legend_Text_Index_"+h,b=m.Shape,I=m.Text;n.enableRtl&&(i=u.defaultLegendRtlLocation(m,r,n,a),b=i.shapeLocation,I=i.textLocation),l={cancel:!1,name:x,treemap:n,fill:m.Fill,shape:a.shape,imageUrl:a.imageUrl},n.trigger(x,l,function(e){var t=new V(v,e.fill,c,p?m.Fill:g,a.opacity,"");y.appendChild(ze(b,e.shape,s,e.imageUrl,t)),Q(new q(S,I.x,I.y,"start",f,"",""),a.textStyle,a.textStyle.color||n.themeStyle.legendTextColor,y),o.legendGroup.appendChild(y)})},u=this,f=0;f<this.totalPages[e].Collection.length;f++)m(f);var y=void 0,v=r;if(0!==this.page){var S=e+1+"/"+this.totalPages.length,b=a.textStyle,I=G(S,b),C=this.legendItemRect.x+this.legendItemRect.width-I.width-20-r,F=this.legendItemRect.x+this.legendItemRect.width,w=this.legendItemRect.y+this.legendItemRect.height+2.5+r,O=F-v-I.width/2-5;y=d.createGroup({id:n.element.id+"_Legend_Paging_Group"});var L=d.createGroup({id:n.element.id+"_Legend_Left_Paging_Group"}),T=d.createGroup({id:n.element.id+"_Legend_Right_Paging_Group"}),M=" M "+F+" "+w+" L "+(F-v)+" "+(w-5)+" L "+(F-v)+" "+(w+5)+" z ",N=" M "+C+" "+w+" L "+(C+v)+" "+(w-5)+" L "+(C+v)+" "+(w+5)+" z ",_=new V(n.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",N);L.appendChild(d.drawPath(_));var E=new j(n.element.id+"_Left_Page_Rect","transparent",{},1,new W(C-5,w-10,20,20),"");L.appendChild(d.drawRectangle(E)),this.wireEvents(L);var D=new V(n.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",M);T.appendChild(d.drawPath(D));var P=new j(n.element.id+"_Right_Page_Rect","transparent",{},1,new W(F-v,w-5,v,r),"");T.appendChild(d.drawRectangle(P)),this.wireEvents(T),y.appendChild(L),y.appendChild(T);var B={id:n.element.id+"_Paging_Text",x:O,y:w+I.height/4,fill:"#a6a6a6","font-size":"14px","font-style":b.fontStyle,"font-family":b.fontFamily,"font-weight":b.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":S};y.appendChild(d.createText(B,S)),this.legendGroup.appendChild(y)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,l=10,o=t.titleStyle,n=G(X(this.legendItemRect.width+20,i,o),o);this.legendBorderRect=new W(this.legendItemRect.x-l,this.legendItemRect.y-l-n.height,this.legendItemRect.width+20,this.legendItemRect.height+20+n.height+("Interactive"===t.mode?0:0!==this.page?l:0));var r={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},a=new j(e.element.id+"_Legend_Border",t.background,r,1,this.legendBorderRect,""),s=e.renderer.drawRectangle(a);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.legendSettings,i=e.titleStyle,l=this.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.title.text):e.title.text,o=X(this.legendItemRect.width+20,l,i),n=G(o,i);if(l){var r=Q(new q(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-n.height/2-5,"middle",o,""),i,i.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);r.setAttribute("role","region"),r.setAttribute("aria-label",l)}},e.prototype.renderInteractivePointer=function(e){var i,l=this.treemap,o=e.target,n=l.element.id+"_Interactive_Legend",r=!1;o=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):o;var a=l.legendSettings;if(o.id.indexOf("_Item_Index")>-1&&a.visible&&this.legendRenderingCollections.length>0){var s=void 0,d=void 0,h=void 0,p=void 0,g=void 0,c=void 0,m=void 0;i=l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])];for(var u=l.svgObject.getBoundingClientRect(),f=0;f<this.legendCollections.length&&!r;f++){s=this.legendCollections[f],d=(m=document.getElementById(l.element.id+"_Legend_Index_"+f)).getBoundingClientRect();var y=new W(Math.abs(d.left-u.left),Math.abs(d.top-u.top),d.width,d.height);if(p=m.getAttribute("fill"),g=a.shapeBorder.color,c=a.shapeBorder.width,!(0,t.isNullOrUndefined)(s.legendData)&&s.legendData.length>0){h=s.legendData;var v=l.rangeColorValuePath;if(i.levelOrderName.indexOf(this.legendCollections[f].legendName)>-1)this.drawInteractivePointer(a,p,g,n,c,y),r=!0;else for(var S=0;S<h.length;S++)if(l.rangeColorValuePath&&l.leafItemSettings.colorMapping.length>0?h[S].data[v]===i.data[v]:h[S].levelOrderName===i.levelOrderName||h[S].levelOrderName.indexOf(i.levelOrderName)>-1){this.drawInteractivePointer(a,p,g,n,c,y),r=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&i.levelOrderName.indexOf(s.levelOrderName)>-1&&(this.drawInteractivePointer(a,p,g,n,c,y),r=!0)}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,l,o,n){var r,a,s,d=10,h=10;r="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=n.x+n.width/2)+" "+(s=n.y+n.height)+" L "+(a-h)+" "+(s+d)+" L "+(a+h)+" "+(s+d)+" Z ":" M "+(a=n.x+n.width/2)+" "+(s=n.y)+" L "+(a-h)+" "+(s-d)+" L "+(a+h)+" "+(s-d)+" Z ":e.invertedPointer?" M "+(a=n.x)+" "+(s=n.y+n.height/2)+" L "+(a-h)+" "+(s-d)+" L "+(a-h)+" "+(s+d)+" z ":" M "+(a=n.x+n.width)+" "+(s=n.y+n.height/2)+" L "+(a+h)+" "+(s-d)+" L "+(a+h)+" "+(s+d)+" z ";var p=new V(l,t,o,i,1,"",r);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(p))},e.prototype.getLegendAlignment=function(e,i,l,o){var n,r,a,s=(a=(0,t.extend)({},e.areaRect,a,!0)).x,d=a.y,h=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,m="Auto"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(m){case"Top":case"Bottom":a.height=h-l,n=g/2-i/2,r="Top"===m?d:d+a.height+10,a.y="Top"===m?d+l+10:d;break;case"Left":case"Right":a.width=p-i,n="Left"===m?s:s+a.width,r=c/2-l/2,a.x="Left"===m?s+i:s}switch(o.alignment){case"Near":"Top"===m||"Bottom"===m?n=a.x:r=a.y;break;case"Far":"Top"===m||"Bottom"===m?n=g-i:r=c-l}this.treemap.totalRect=a,this.translate=new J(n,r)}},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.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},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(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var l,o="http://www.w3.org/2000/svg";if(!(0,t.isNullOrUndefined)(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var n=this.treemap.renderer.createDefs(),r=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",d="Top"===a||"Bottom"===a?"0":"100";r.setAttribute("id","linear_"+i),r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2",s+"%"),r.setAttribute("y2",d+"%");for(var h=0;h<e.color.length;h++){var p=100/(e.color.length-1),g=document.createElementNS(o,"stop");g.setAttribute("offset",h*p+"%"),g.setAttribute("stop-color",e.color[h]),g.setAttribute("stop-opacity",1..toString()),r.appendChild(g)}n.appendChild(r),this.legendLinearGradient=r;var c="url(#linear_"+i+")";this.defsElement.appendChild(r),l=c}return l},e}(),at=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=e.target;return this.highlightOnMouseMove(t)},e.prototype.highlightOnMouseMove=function(e){var i,l,o,n,r,a,s,d=this.treemap,h=e.id,p=[],c=this.treemap.highlightSettings,m=[],u=this.treemap.treeMapSelectionModule,f=!1;if(u&&u.legendSelectionCollection.length>0)for(var y=0;y<u.legendSelectionCollection.length;y++)for(var v=0;v<u.legendSelectionCollection[y].ShapeCollection.Elements.length;v++){var S=parseFloat(u.legendSelectionCollection[y].ShapeCollection.Elements[v].id.split("Item_Index_")[1].split("_")[0]),x=h.indexOf("_Item_Index_")>-1?parseFloat(h.split("Item_Index_")[1].split("_")[0]):null;if(u.legendSelectionCollection[y].ShapeCollection.Elements[v].id===h||S===x){f=!0;break}}if(h.indexOf("_Item_Index")>-1&&!f){if(this.highLightId!==h||this.legendHighlightCollection[0]&&this.legendHighlightCollection[0].ShapeCollection.Elements.length>1){r=document.getElementById(d.element.id+"_TreeMap_"+d.layoutType+"_Layout");var b=document.getElementsByClassName("treeMapSelection");o=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var I=void 0;if(this.treemap.legendSettings.visible){var C=this.treemap.treeMapLegendModule.legendCollections,F=this.treemap.treeMapLegendModule.legendCollections.length;if(I=!d.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0&&0===d.leafItemSettings.colorMapping.length&&0===d.levels.length?parseFloat(h.split("_Item_Index_")[1]):Ve(F,o,d),(0,t.isNullOrUndefined)(I)&&(Ae(this.legendHighlightCollection,d),Ae(this.shapeHighlightCollection,d),this.legendHighlightCollection=[],d.treeMapLegendModule.removeInteractivePointer()),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+I):document.getElementById(this.treemap.element.id+"_Legend_Index_"+I),null!==this.shapeElement)if(u&&this.shapeElement.id===(u&&u.shapeElement?u.shapeElement.id:null))this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(je(this.shapeHighlightCollection,this.currentElement,d),this.highLightId="");else this.currentElement.push({currentElement:this.shapeElement}),Ae(this.shapeHighlightCollection,d),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:C[I].legendFill,oldOpacity:C[I].opacity,oldBorderColor:C[I].borderColor,oldBorderWidth:C[I].borderWidth}),We("Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+I):document.getElementById(this.treemap.element.id+"_Legend_Index_"+I+"_Text"),c.fill,c.opacity,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.target="highlight"}s=le(o,[],c.mode,d);for(y=0;y<r.childElementCount;y++){a=r.childNodes[y],n=!0;var w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,O=d.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];o=d.layout.renderItems[parseFloat(a.id.split("_Item_Index_")[1])];for(v=0;v<b.length;v++)if(a.id===b[v].id||a.id===b[v].parentElement.id){n=!1;break}s.indexOf(o.levelOrderName)>-1&&n&&((0,t.isNullOrUndefined)(w)||(o.data[w]===O.data[w]||"Item"!==c.mode&&d.levels.length>0))&&(m.push(a),p.push(o))}Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d);for(var L=0;L<m.length;L++)Te((a=m[L]).childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),a.classList.add("treeMapHighLight"),this.highLightId=h;l={cancel:!1,name:g,treemap:d,items:p,elements:m},d.trigger(g,l)}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1||h.indexOf("_Legend_Text_Index")>-1){(0,t.isNullOrUndefined)(u)||(u.legendSelectId=(0,t.isNullOrUndefined)(d.legendId[0])?null:d.legendId[0]);var T=u&&u.legendSelectId?parseFloat(u.legendSelectId.split("Index_")[1]):u&&u.shapeSelectId?parseFloat(u.shapeSelectId.split("Index_")[1]):null,M="Default"===this.treemap.legendSettings.mode?-1===h.indexOf("Text")?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Text_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);if(this.treemap.legendSettings.visible&&M!==T){var N,_=void 0,E=void 0,D=(w=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,document.getElementById(h));"highlight"===this.shapeTarget&&(Ae(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight";var P=this.treemap.treeMapLegendModule.legendCollections[M].legendData.length;for(C=this.treemap.treeMapLegendModule.legendCollections,y=0;y<P;y++)for(v=0;v<this.treemap.layout.renderItems.length;v++)if(!(0,t.isNullOrUndefined)(w)&&d.leafItemSettings.colorMapping.length>0&&0===d.levels.length?d.treeMapLegendModule.legendCollections[M].legendData[y].data[w]===d.layout.renderItems[v].data[w]:d.treeMapLegendModule.legendCollections[M].legendData[y].levelOrderName===d.layout.renderItems[v].levelOrderName){_=v,E=this.treemap.layout.renderItems[v].groupIndex;var B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");0!==y&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]});var z=void 0;D.id.indexOf("Text")>-1?(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(z,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We("Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}if(0===P&&this.treemap.palette&&this.treemap.palette.length>0)for(v=0;v<this.treemap.layout.renderItems.length;v++)if((this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName===this.treemap.layout.renderItems[v].levelOrderName||this.treemap.layout.renderItems[v].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[M].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0)||this.treemap.layout.renderItems[v].parent.isDrilled||M===v)){_=v,E=this.treemap.layout.renderItems[v].groupIndex;B=document.getElementById(this.treemap.element.id+"_Level_Index_"+E+"_Item_Index_"+_+"_RectPath");Ge(this.legendHighlightCollection,M,v,D,B,this.treemap.layout.renderItems,C),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection={Elements:[]};var H=void 0;D.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+M),We(D,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString())):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(D.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+M),c.fill,c.opacity,null,null),We(D,c.fill,c.opacity,c.border.color,c.border.width.toString())),We(B,c.fill,c.opacity,c.border.color,c.border.width.toString()),N=this.legendHighlightCollection.length,this.legendHighlightCollection[N-1].ShapeCollection.Elements.push(B)}}else Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),Ae(this.legendHighlightCollection,d),this.legendHighlightCollection=[]}else u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:this.treemap.legendSettings.visible)&&Le(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||u&&this.shapeElement&&this.shapeElement.getAttribute("id")===u.legendSelectId||(u?this.shapeElement!==u.shapeElement:!u||u.legendSelect)&&(Ae(this.shapeHighlightCollection,d),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&Ae(this.legendHighlightCollection,this.treemap),this.highLightId="",i=!1;return i},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(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),st=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=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},e.prototype.selectionOnMouseDown=function(e){var i,l=this.treemap;e.setAttribute("tabindex","-1"),e.style.outline="none",e.id.includes("Legend_Shape_Index")||e.focus();var o,n,r,a,s=[],d=e.id,h=e.innerHTML,g=[],c=l.selectionSettings,m=this.treemap.treeMapHighlightModule,u=l.element.id+"_TreeMap_"+l.layoutType+"_Layout",f=(o=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])])&&!o.isLeafItem&&l.enableDrillDown&&(e.textContent.indexOf("[+]")>-1||e.textContent.indexOf("[-]")>-1||!(0,t.isNullOrUndefined)(e.nextElementSibling)&&(e.nextSibling.textContent.indexOf("[+]")>-1||e.nextSibling.textContent.indexOf("[-]")>-1));if(d.indexOf("_Item_Index")>-1&&!f)if(this.treemap.selectionId!==d&&(!l.selectionId||parseFloat(l.selectionId.split("_Item_Index_")[1])!==parseFloat(d.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&this.legendSelectionCollection[0].ShapeCollection.Elements.length>1){l.levelSelection=[],l.legendId=[],this.shapeSelectId="",Ae(this.legendSelectionCollection,l),this.legendSelectionCollection=[],n=document.getElementById(u);var y=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,S=this.treemap.treeMapLegendModule.legendCollections;if(this.shapeElement=void 0,Ae(this.shapeSelectionCollection,l),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),y=!l.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0&&0===l.leafItemSettings.colorMapping.length&&0===l.levels.length?parseFloat(d.split("_Item_Index_")[1]):Ve(v,o,l),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:S[y].legendFill,oldOpacity:S[y].opacity,oldBorderColor:S[y].borderColor,oldBorderWidth:S[y].borderWidth}),We(z="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y):document.getElementById(this.treemap.element.id+"_Legend_Index_"+y+"_Text"),c.fill,c.opacity,null,null),We(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.legendId.push(this.shapeElement.id),l.legendId.push(z.id)}a=le(o,[],c.mode,l);for(var x=0;x<n.childElementCount;x++){r=n.childNodes[x];var b=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])];o=l.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];var I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null;a.indexOf(o.levelOrderName)>-1&&((0,t.isNullOrUndefined)(I)||(o.data[I]===b.data[I]||"Item"!==c.mode&&l.levels.length>0))&&(g.push(r),d.indexOf("_RectPath")>-1&&l.levelSelection.push(r.id),s.push(o))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=d;for(var C=document.getElementsByClassName("treeMapHighLight"),F=0;F<g.length;F++){if(r=g[F],C.length>0)for(var w=0;w<C.length;w++)C[w].id===r.id&&C[w].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");else Te(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");i={cancel:!1,name:p,treemap:l,items:s,elements:g,text:h,contentItemTemplate:h},l.trigger(p,i,function(t){t.contentItemTemplate!==h&&$(d,e,t.contentItemTemplate)})}}else Ae(this.legendSelectionCollection,l),Ae(this.shapeSelectionCollection,l),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="");else if(d.indexOf("_Legend_Shape")>-1||d.indexOf("_Legend_Index")>-1||d.indexOf("_Legend_Text_")>-1){S=this.treemap.treeMapLegendModule.legendCollections;var O=(0,t.isNullOrUndefined)(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&O!==parseFloat(d.split("_Index_")[1])){var L,T=void 0,M=void 0;l.legendId=[],l.levelSelection=[],this.legendSelectId=d,this.legendSelect=!1;var N=isNaN(parseInt(d[d.length-1],10))?parseInt(d[d.length-6],10):parseInt(d[d.length-1],10),_=document.getElementById(d);Ae(this.legendSelectionCollection,l),Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),Ae(this.shapeSelectionCollection,l),this.legendSelectionCollection=[],m&&(m.shapeTarget="selection",m.legendHighlightCollection=[]);I=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,y="Default"===this.treemap.legendSettings.mode?-1===d.indexOf("Text")?parseFloat(d.split("_Legend_Shape_Index_")[1]):parseFloat(d.split("_Legend_Text_Index_")[1]):parseFloat(d.split("_Legend_Index_")[1]);var E=this.treemap.treeMapLegendModule.legendCollections[y].legendData.length;for(F=0;F<E;F++)for(var D=0;D<this.treemap.layout.renderItems.length;D++)if(!(0,t.isNullOrUndefined)(I)&&l.leafItemSettings.colorMapping.length>0&&0===l.levels.length?l.treeMapLegendModule.legendCollections[y].legendData[F].data[I]===l.layout.renderItems[D].data[I]:this.treemap.treeMapLegendModule.legendCollections[y].legendData[F].levelOrderName===this.treemap.layout.renderItems[D].levelOrderName){T=D,M=this.treemap.layout.renderItems[D].groupIndex;var P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");this.treemap.selectionId=P.id,0!==F&&0!==this.legendSelectionCollection.length||(Ge(this.legendSelectionCollection,N,D,_,P,this.treemap.layout.renderItems,S),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]}),this.treemap.selectionId=P.id;var B=void 0,z=void 0;_.id.indexOf("Text")>-1?(We(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),c.fill,c.opacity,c.border.color,c.border.width.toString()),We(_,c.fill,c.opacity,null,null),this.legendSelectId=B.id,this.shapeElement=B,l.legendId.push(_.id),l.legendId.push(B.id)):(We(z="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.shapeElement=_,l.legendId.push(_.id),l.legendId.push(z.id)),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),L=this.legendSelectionCollection.length,l.levelSelection.push(P.id),this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}if(0===E&&this.treemap.palette&&this.treemap.palette.length>0)for(w=0;w<this.treemap.layout.renderItems.length;w++)if((this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName===this.treemap.layout.renderItems[w].levelOrderName||this.treemap.layout.renderItems[w].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[y].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0)||this.treemap.layout.renderItems[w].parent.isDrilled||y===w)){T=w,M=this.treemap.layout.renderItems[w].groupIndex;P=document.getElementById(this.treemap.element.id+"_Level_Index_"+M+"_Item_Index_"+T+"_RectPath");Ge(this.legendSelectionCollection,y,w,_,P,this.treemap.layout.renderItems,S),this.treemap.selectionId=P.id,L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection={Elements:[]};var H=void 0;_.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+y),We(_,c.fill,c.opacity,null,null),We(H,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=H.id,this.shapeElement=H):(We(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+y),c.fill,c.opacity,null,null),We(_,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=d,this.shapeElement=_),We(P,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.levelSelection.push(P.id),-1===l.legendId.indexOf(H.id)&&l.legendId.push(H.id),-1===l.legendId.indexOf(_.id)&&l.legendId.push(_.id),L=this.legendSelectionCollection.length,this.legendSelectionCollection[L-1].ShapeCollection.Elements.push(P)}}else Ae(this.legendSelectionCollection,this.treemap),Ae(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="")}else f&&(Ae(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,l=0;l<this.treemap.layout.renderItems.length;l++)if(e===this.treemap.layout.renderItems[l].levelOrderName){i=this.treemap.layout.renderItems[l];break}var o=this.treemap.selectionSettings,n=[],r=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var d=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",h=document.getElementById(d),p=le(i,[],o.mode,this.treemap),g=0;g<h.childElementCount;g++)r=h.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(n.push(r),this.treemap.levelSelection.push(r.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var m=this.treemap.treeMapLegendModule.legendCollections.length,u=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,ke(this.shapeSelectionCollection),a=Ve(m,s[c],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:u[a].legendFill,oldOpacity:u[a].opacity,oldBorderColor:u[a].borderColor,oldBorderWidth:u[a].borderWidth}),We(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}Le(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);var f=document.getElementById(this.treemap.levelSelection[0]);this.treemap.selectionId=f.childNodes[0].id;for(var y=document.getElementsByClassName("treeMapHighLight"),v=0;v<n.length;v++)if(r=n[v],y.length>0)for(var S=0;S<y.length;S++)y[S].id===r.id&&y[S].classList.remove("treeMapHighLight"),Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(r.id.split("Item_Index_")[1],10)].options.fill:o.fill,Te(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection")}else ke(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],Le(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(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),dt=function(e,t){var i={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(i[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&(i[l[o]]=e[l[o]])}return i},ht=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,l,o,n,r,a,s=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(n=e).changedTouches[0].pageX,l=n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,l=e.pageY,o=e.target);var d,h,p,g=o.id,m={},u={},f=[];if(g.indexOf("_Item_Index")>-1&&-1===e.type.indexOf("key")){if(m=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!(0,t.isNullOrUndefined)(m)){a=m.weight,u=m.data,(0,t.isNullOrUndefined)(m.options)||(p=m.options.fill),f=this.treemap.enableRtl?[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Me(this.tooltipSettings.format,u,this.treemap))||Ne(a,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[((0,t.isNullOrUndefined)(this.tooltipSettings.format)?null:Me(this.tooltipSettings.format,u,this.treemap))||this.treemap.weightValuePath.toString()+" : "+Ne(a,this.treemap)],document.getElementById(this.tooltipId)?d=document.getElementById(this.tooltipId):((d=(0,t.createElement)("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(d)),(h=ge(i,l,this.treemap.svgObject)).y=this.tooltipSettings.template?h.y+10:h.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=(0,t.isNullOrUndefined)(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var y={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};if(this.treemap.enableHtmlSanitizer)for(var v=0;v<f.length;v++)f[v]=t.SanitizeHtmlHelper.sanitize(f[v]);r={cancel:!1,name:c,item:m,options:{location:h,text:f,data:u,border:y,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger(c,r,function(e){s.addTooltip(r,p,d)})}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,l,o,n){var r,a;(0,t.isNullOrUndefined)(e)?(r=n.cancel,a=n):(r=e.cancel,a=dt(e,["cancel"]).options);r?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[l],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(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(){(0,t.isNullOrUndefined)(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,Xe(this.treemap.element.id+"_TreeMapTooltip")),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}()})(),a})());
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-treemap.umd.min.js
|
|
3
|
-
* version : 31.2.12
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
!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=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,A,C,F,w){"use strict";var O,M,N="load",_="loaded",E="beforePrint",U="itemRendering",k="drillStart",q="drillEnd",X="itemSelected",J="itemHighlight",Y="tooltipRendering",Z="itemClick",Q="itemMove",$="click",K="doubleClick",ee="rightClick",te="mouseMove",ie="legendItemRendering",le="legendRendering",oe="resize",ne="Roboto, Segoe UI, Noto, Sans-serif",t=(O=function(e,t){return(O=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])}))(e,t)},function(e,t){function i(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),i=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(r=(n<3?o(r):3<n?o(t,i,r):o(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},l=(M=A.ChildProperty,t(re,M),i([A.Property("#808080")],re.prototype,"color",void 0),i([A.Property(0)],re.prototype,"width",void 0),re);function re(){return null!==M&&M.apply(this,arguments)||this}ae=A.ChildProperty,t(o,ae),i([A.Property(10)],o.prototype,"left",void 0),i([A.Property(10)],o.prototype,"right",void 0),i([A.Property(10)],o.prototype,"top",void 0),i([A.Property(10)],o.prototype,"bottom",void 0);var ae,se=o;function o(){return null!==ae&&ae.apply(this,arguments)||this}de=A.ChildProperty,t(r,de),i([A.Property(null)],r.prototype,"size",void 0),i([A.Property(null)],r.prototype,"color",void 0),i([A.Property(ne)],r.prototype,"fontFamily",void 0),i([A.Property("")],r.prototype,"fontWeight",void 0),i([A.Property("Normal")],r.prototype,"fontStyle",void 0),i([A.Property(1)],r.prototype,"opacity",void 0);var de,n=r;function r(){return null!==de&&de.apply(this,arguments)||this}he=A.ChildProperty,t(ge,he),i([A.Property("")],ge.prototype,"text",void 0),i([A.Property("")],ge.prototype,"description",void 0);var he,pe=ge;function ge(){return null!==he&&he.apply(this,arguments)||this}t(ue,ce=pe),i([A.Complex({fontFamily:null,fontWeight:null},n)],ue.prototype,"textStyle",void 0),i([A.Property("Center")],ue.prototype,"alignment",void 0);var ce,me=ue;function ue(){return null!==ce&&ce.apply(this,arguments)||this}t(ve,ye=pe),i([A.Complex({fontFamily:null,fontWeight:null},n)],ve.prototype,"textStyle",void 0),i([A.Property("Center")],ve.prototype,"alignment",void 0),i([A.Complex({},me)],ve.prototype,"subtitleSettings",void 0);var ye,fe=ve;function ve(){return null!==ye&&ye.apply(this,arguments)||this}xe=A.ChildProperty,t(a,xe),i([A.Property(null)],a.prototype,"from",void 0),i([A.Property(null)],a.prototype,"to",void 0),i([A.Property(null)],a.prototype,"color",void 0),i([A.Property(null)],a.prototype,"label",void 0),i([A.Property(null)],a.prototype,"value",void 0),i([A.Property(null)],a.prototype,"minOpacity",void 0),i([A.Property(null)],a.prototype,"maxOpacity",void 0),i([A.Property(!0)],a.prototype,"showLegend",void 0);var xe,Se=a;function a(){return null!==xe&&xe.apply(this,arguments)||this}be=A.ChildProperty,t(s,be),i([A.Property(!1)],s.prototype,"visible",void 0),i([A.Property("Default")],s.prototype,"mode",void 0),i([A.Property("transparent")],s.prototype,"background",void 0),i([A.Property("Circle")],s.prototype,"shape",void 0),i([A.Property("")],s.prototype,"width",void 0),i([A.Property("")],s.prototype,"height",void 0),i([A.Complex({size:null,fontFamily:null,fontWeight:null},n)],s.prototype,"textStyle",void 0),i([A.Property(null)],s.prototype,"fill",void 0),i([A.Property(1)],s.prototype,"opacity",void 0),i([A.Property(15)],s.prototype,"shapeWidth",void 0),i([A.Property(15)],s.prototype,"shapeHeight",void 0),i([A.Property(10)],s.prototype,"shapePadding",void 0),i([A.Property(null)],s.prototype,"imageUrl",void 0),i([A.Complex({color:null,width:null},l)],s.prototype,"border",void 0),i([A.Complex({color:"#000000",width:0},l)],s.prototype,"shapeBorder",void 0),i([A.Complex({},pe)],s.prototype,"title",void 0),i([A.Complex({size:null,fontFamily:null,fontWeight:null},n)],s.prototype,"titleStyle",void 0),i([A.Property("Bottom")],s.prototype,"position",void 0),i([A.Property("None")],s.prototype,"orientation",void 0),i([A.Property(!1)],s.prototype,"invertedPointer",void 0),i([A.Property("After")],s.prototype,"labelPosition",void 0),i([A.Property("None")],s.prototype,"labelDisplayMode",void 0),i([A.Property("Center")],s.prototype,"alignment",void 0),i([A.Property({x:0,y:0})],s.prototype,"location",void 0),i([A.Property(null)],s.prototype,"showLegendPath",void 0),i([A.Property(null)],s.prototype,"valuePath",void 0),i([A.Property(!1)],s.prototype,"removeDuplicateLegend",void 0);var be,Ie=s;function s(){return null!==be&&be.apply(this,arguments)||this}Ce=A.ChildProperty,t(we,Ce),i([A.Property(null)],we.prototype,"groupIndex",void 0),i([A.Property(null)],we.prototype,"groupName",void 0);var Ce,Fe=we;function we(){return null!==Ce&&Ce.apply(this,arguments)||this}Oe=A.ChildProperty,t(d,Oe),i([A.Property(null)],d.prototype,"fill",void 0),i([A.Property(!1)],d.prototype,"autoFill",void 0),i([A.Complex({},l)],d.prototype,"border",void 0),i([A.Property(0)],d.prototype,"gap",void 0),i([A.Property(10)],d.prototype,"padding",void 0),i([A.Property(1)],d.prototype,"opacity",void 0),i([A.Property(!0)],d.prototype,"showLabels",void 0),i([A.Property(null)],d.prototype,"labelPath",void 0),i([A.Property(null)],d.prototype,"labelFormat",void 0),i([A.Property("TopLeft")],d.prototype,"labelPosition",void 0),i([A.Complex({color:null,size:null,fontFamily:null},n)],d.prototype,"labelStyle",void 0),i([A.Property(null)],d.prototype,"labelTemplate",void 0),i([A.Property("Center")],d.prototype,"templatePosition",void 0),i([A.Property("Trim")],d.prototype,"interSectAction",void 0),i([A.Collection([],Se)],d.prototype,"colorMapping",void 0);var Oe,Le=d;function d(){return null!==Oe&&Oe.apply(this,arguments)||this}Te=A.ChildProperty,t(h,Te),i([A.Property(!1)],h.prototype,"visible",void 0),i([A.Property("")],h.prototype,"template",void 0),i([A.Property(null)],h.prototype,"format",void 0),i([A.Property(null)],h.prototype,"fill",void 0),i([A.Property(.75)],h.prototype,"opacity",void 0),i([A.Property(["Circle"])],h.prototype,"markerShapes",void 0),i([A.Complex({width:null,color:null},l)],h.prototype,"border",void 0),i([A.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},n)],h.prototype,"textStyle",void 0);var Te,Me=h;function h(){return null!==Te&&Te.apply(this,arguments)||this}Ne=A.ChildProperty,t(p,Ne),i([A.Property(!1)],p.prototype,"enable",void 0),i([A.Property(null)],p.prototype,"fill",void 0),i([A.Property("0.5")],p.prototype,"opacity",void 0),i([A.Complex({},l)],p.prototype,"border",void 0),i([A.Property("Item")],p.prototype,"mode",void 0);var Ne,_e=p;function p(){return null!==Ne&&Ne.apply(this,arguments)||this}Ee=A.ChildProperty,t(g,Ee),i([A.Property(!1)],g.prototype,"enable",void 0),i([A.Property("#808080")],g.prototype,"fill",void 0),i([A.Property("0.5")],g.prototype,"opacity",void 0),i([A.Complex({},l)],g.prototype,"border",void 0),i([A.Property("Item")],g.prototype,"mode",void 0);var Ee,De=g;function g(){return null!==Ee&&Ee.apply(this,arguments)||this}Pe=A.ChildProperty,t(c,Pe),i([A.Property(null)],c.prototype,"groupPath",void 0),i([A.Property(0)],c.prototype,"groupGap",void 0),i([A.Property(10)],c.prototype,"groupPadding",void 0),i([A.Complex({},l)],c.prototype,"border",void 0),i([A.Property(null)],c.prototype,"fill",void 0),i([A.Property(!1)],c.prototype,"autoFill",void 0),i([A.Property(1)],c.prototype,"opacity",void 0),i([A.Property(!0)],c.prototype,"showHeader",void 0),i([A.Property(20)],c.prototype,"headerHeight",void 0),i([A.Property(null)],c.prototype,"headerTemplate",void 0),i([A.Property(null)],c.prototype,"headerFormat",void 0),i([A.Property("Near")],c.prototype,"headerAlignment",void 0),i([A.Complex({color:null,size:"13px",fontFamily:null},n)],c.prototype,"headerStyle",void 0),i([A.Property("TopLeft")],c.prototype,"templatePosition",void 0),i([A.Collection([],Se)],c.prototype,"colorMapping",void 0);var Pe,t=c;function c(){return null!==Pe&&Pe.apply(this,arguments)||this}var W=function(e,t){this.width=e,this.height=t};function Be(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var j=function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l},L=function(e,t,i,l,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},z=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function V(e,t){var i=document.getElementById("treeMapMeasureText");return null===i&&(i=A.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(i)),i.innerHTML=A.SanitizeHtmlHelper.sanitize(e),i.style.position="absolute",i.style.fontSize=t.size,i.style.fontWeight=t.fontWeight,i.style.fontStyle=t.fontStyle,i.style.fontFamily=t.fontFamily,i.style.visibility="hidden",i.style.top="-100",i.style.left="0",i.style.whiteSpace="nowrap",i.style.lineHeight="normal",new W(i.clientWidth,i.clientHeight)}var T=function(e,t,i,l,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function G(e,t,i){var l=t;if(e<V(t,i).width)for(var o=t.length-1;0<=o;--o)if(V(l=t.substring(0,o)+"...",i).width<=e||l.length<4)return l=l.length<4?" ":l;return l}var ze=function(e,t){this.x=e,this.y=t};function He(e,t,i,l){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}t="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new ze(o,t)}function Re(e,t,i){e=e.createText(t,i);return e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.style["user-select"]="none",e.style["-moz-user-select"]="none",e.style["-webkit-touch-callout"]="none",e.style["-webkit-user-select"]="none",e.style["-khtml-user-select"]="none",e.style["-ms-user-select"]="none",e.style["-o-user-select"]="none",e}function Ue(e,t,i,l,o){void 0===o&&(o=!1);var n,r,a={"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:i},i="string"==typeof e.text?e.text:o?e.text[e.text.length-1]:e.text[0],s=new C.SvgRenderer("");if(!A.isNullOrUndefined(i)&&!A.isNullOrUndefined(e.connectorText)&&i.includes(e.connectorText[1]))for(var d=i.split("#"),h=0;h<d.length;h++){var p=-1===d[h].search(e.connectorText)||A.isNullOrUndefined(e.connectorText)?d[h]:e.connectorText,p=(a.id=e.id+"_"+h,r=Re(s,a,p),h%2==0&&0!==h&&(p=p.replace(/\s+/g," ")),V(p,t));a.x=0!==h?a.x+p.width:a.x+p.width+5,l.appendChild(r)}else r=Re(s,a,i),l.appendChild(r);if("string"!=typeof e.text&&1<e.text.length){for(var g=1,c=e.text.length;g<c;g++)n=V(e.text[g],t).height,n=s.createTSpan({x:e.x,id:e.id,y:e.y+g*n},e.text[g]),r.appendChild(n);l.appendChild(r)}return r}function ke(e,t,i){var l=e.split("_RectPath")[0],e=-1<e.indexOf("_LabelTemplate")?t:document.querySelector("#"+l+"_LabelTemplate");A.isNullOrUndefined(e)||(e.innerHTML=i)}function Ae(e){return document.getElementById(e)}function We(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function je(e,t,i,l){for(var o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath||l.weightValuePath]||"undefined";if(e[a]===s&&(n+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function H(e){if(e)for(var t=Object.keys(e),i={},l=0;l<t.length;l++)if(e[t[l]]instanceof Array){i.values=e[t[l]],i.key=t[l];break}return i}function Ve(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=H(e).values;if(o&&0<o.length){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)Ve(o[r],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),Ve(e.parent,t,i,l));else if("All"===i)for(var a=e.levelOrderName.split("#")[0],s=void 0,n=0;n<l.layout.renderItems.length;n++)-1<(s=l.layout.renderItems[n]).levelOrderName.indexOf(a)&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName);else t.push(e.levelOrderName);return t}function Ge(t){var i=null;try{i="function"!=typeof t&&document.querySelectorAll(t).length?A.compile(document.querySelector(t).innerHTML.trim()):A.compile(t)}catch(e){i=A.compile(t)}return i}function qe(e,t,i){for(var l=A.createElement("div",{id:t}),o=(l.style.cssText="position: absolute;pointer-events: auto;",e.length);0<o;)l.appendChild(e[0]),o--;for(var n=l.innerHTML,r=Object.keys(i),a=0;a<r.length;a++)var s=RegExp,n=n.replace(new s("{{:"+r[a]+"}}","g"),i[r[a].toString()]);return l.innerHTML=n,l}function Xe(e,t,i,l,o){var n=new ze(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(-1<t.indexOf("Left")?e.x+5:-1<t.indexOf("Right")?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?n.y=Math.abs(a-(-1<t.indexOf("Top")?"Template"===l?e.y:e.y+i.height:-1<t.indexOf("Bottom")?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):n.y=Math.abs(e.y+e.height-i.height+5),n}function Je(e,t){var i=new W(0,0),t=(t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth,document.getElementById(e.id));return t.parentNode.removeChild(t),i}function Ye(e){return(e.width-e.x)*(e.height-e.y)}function Ze(e){var e=Qe(e),t=e.width,e=e.height;return Math.min(t,e)}function Qe(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function $e(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function Ke(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=l.left+o-i,i=l.top+n-r;return new ze(e-o,t-i)}function et(e,t,i){var l,o,n=[];if(A.isNullOrUndefined(t)&&A.isNullOrUndefined(i)&&isNaN(i))return null;for(var r=0;r<e.length;r++){var a=!1,s=i;A.isNullOrUndefined(e[r].from)||A.isNullOrUndefined(e[r].to)||A.isNullOrUndefined(e[r].value)?(A.isNullOrUndefined(e[r].from)||A.isNullOrUndefined(e[r].to))&&A.isNullOrUndefined(e[r].value)||(i>=e[r].from&&e[r].to>=i||e[r].value===t)&&(e[r].value===t&&(a=!0),l="[object Array]"===Object.prototype.toString.call(e[r].color)?a?e[r].color[0]:it(e[r],s):e[r].color):i>=e[r].from&&e[r].to>=i&&e[r].value===t&&(a=!0,l="[object Array]"===Object.prototype.toString.call(e[r].color)?a?e[r].color[0]:it(e[r],s):e[r].color),(i>=e[r].from&&i<=e[r].to||e[r].value===t)&&!A.isNullOrUndefined(e[r].minOpacity)&&!A.isNullOrUndefined(e[r].maxOpacity)&&l&&(o=tt(e[r],i)),(""===l||A.isNullOrUndefined(l))&&A.isNullOrUndefined(e[r].from)&&A.isNullOrUndefined(e[r].to)&&A.isNullOrUndefined(e[r].minOpacity)&&A.isNullOrUndefined(e[r].maxOpacity)&&A.isNullOrUndefined(e[r].value)&&(l="[object Array]"===Object.prototype.toString.call(e[r].color)?e[r].color[0]:e[r].color),o=A.isNullOrUndefined(o)?"1":o,n.push(l)}for(var d=n.length-1;0<=d;d--)d=(l=n[d])?-1:d;return{fill:l,opacity:o}}function tt(e,t){var i=1;return(i=t>=e.from&&t<=e.to?(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity:i).toString()}function it(e,t){return ot(e,t)}function lt(e,t,i){return"#"+m(e)+m(t)+m(i)}function ot(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:lt((t=nt(Number(t),e)).r,t.g,t.b)}function nt(e,t){var i=t.from,l=t.to,o=0,n=l-i,o=(e-i)/n;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:u(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:u(t.color[t.color.length-1]);else{for(var r,a="#"===t.color[0].charAt(0)?t.color[0]:u(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:u(t.color[t.color.length-1]),d=n/(t.color.length-1),h=t.color.length-1,p=[],g=1;g<h;g++)r={b:i+g*d,color:t.color[g]},p.push(r);for(var c=0;c<p.length;c++)i<=e&&e<=p[c].b&&0===c?(s="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/d):(e-p[c].b)/d):p[c].b<=e&&e<=l&&c===p.length-1&&(a="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/d):(e-p[c].b)/d),c!==p.length-1&&c<p.length&&p[c].b<=e&&e<=p[c+1].b&&(a="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),s="#"===p[c+1].color.charAt(0)?p[c+1].color:u(p[c+1].color),o=Math.abs(e-p[c+1].b)/d)}return rt(o,a,s)}function rt(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],l=at(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=at(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=at(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new yt(l,o,e)}function at(e,t,i){return Math.round(t+(i-t)*e)}function st(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],V(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(G(e,n,i)),n=l):r.push(G(e,l,i)),n&&a===s-1&&r.push(G(e,n,i));return r}function dt(e,t,i){var l=[],o=0,n=V(t,i).width,r=t.length;if(n<=e)l.push(t);else for(var a=t.length;o<a;a--){var s=t.slice(o,a);if(V(s,i).width<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function ht(e,t,i,l){l=V(i,l);return l.width>e||l.height>t?" ":i}function pt(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function gt(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?0<t.childElementCount&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),P(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function ct(e,t){var i=e.legendId;if(i)for(var l=0;l<i.length;l++)if("Interactive"===e.legendSettings.mode)for(var o,n=0;n<t.childElementCount;n++)t.childNodes[n].id!==i[l]&&parseFloat(t.childNodes[n].id.split("Index_")[1])!==parseFloat(i[l].split("Index_")[1])||((o=t.childNodes[n]).setAttribute("fill",e.selectionSettings.fill),o.setAttribute("opacity",e.selectionSettings.opacity),-1===o.id.indexOf("Text")?(o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("stroke",e.selectionSettings.border.color)):(o.setAttribute("stroke",null),o.setAttribute("stroke-width",null)));else{var r=document.getElementById(i[l]);A.isNullOrUndefined(r)||(r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke",e.selectionSettings.border.color),r.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null)))}}function D(e,t,i){for(var l,o,n=0;n<e.length;n++)l=A.isNullOrUndefined(e[n].childNodes[0])?e[n]:e[n].childNodes[0],o=i.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options,P(l,o),e[n].classList.remove(t),--n}function P(e,t){e.setAttribute("opacity",t.opacity),A.isNullOrUndefined(t.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",t.fill),e.setAttribute("stroke",t.border.color),e.setAttribute("stroke-width",t.border.width)}function mt(e,t,i){if(A.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(t);l<o.length;l++){var n=o[l];e=e.split("${"+n+"}").join(ut(t[n],i).toString())}return e}function ut(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t||""}var yt=function(e,t,i){this.r=e,this.g=t,this.b=i};function ft(e){return"#"+m(e.r)+m(e.g)+m(e.b)}function m(e){e=e.toString(16);return 1===e.length?"0"+e:e}function vt(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new yt(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new yt(255,255,255)}function u(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText"),t=(t.style.color=e,(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(","));return ft(new yt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function xt(e,t,i,l,o){var n=new C.SvgRenderer(""),e=St(e,i,t,o,l);return n["draw"+e.functionName](e.renderOption)}function St(e,t,i,l,o){var n,r="Path",a=t.width,s=t.height,d=e.x,h=e.y,p=e.x+-a/2,g=e.y+-s/2;switch(i){case"Circle":case"Bubble":r="Ellipse",A.merge(l,{rx:a/2,ry:s/2,cx:d,cy:h});break;case"VerticalLine":A.merge(l,{d:n="M "+d+" "+(h+s/2)+" L "+d+" "+(h+-s/2)});break;case"Diamond":A.merge(l,{d:n="M "+p+" "+h+" L "+d+" "+(h+-s/2)+" L "+(d+a/2)+" "+h+" L "+d+" "+(h+s/2)+" L "+p+" "+h+" z"});break;case"Rectangle":A.merge(l,{d:n="M "+p+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+s/2)+" L "+p+" "+(h+s/2)+" L "+p+" "+(h+-s/2)+" z"});break;case"Triangle":A.merge(l,{d:n="M "+p+" "+(h+s/2)+" L "+d+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+s/2)+" L "+p+" "+(h+s/2)+" z"});break;case"InvertedTriangle":A.merge(l,{d:n="M "+(d+a/2)+" "+(h-s/2)+" L "+d+" "+(h+s/2)+" L "+(d-a/2)+" "+(h-s/2)+" L "+(d+a/2)+" "+(h-s/2)+" z"});break;case"Pentagon":for(var c,m,u=0;u<=5;u++)c=a/2*Math.cos(Math.PI/180*(72*u)),m=a/2*Math.sin(Math.PI/180*(72*u)),n=0===u?"M "+(d+c)+" "+(h+m)+" ":n.concat("L "+(d+c)+" "+(h+m)+" ");n=n.concat("Z"),A.merge(l,{d:n});break;case"Star":n="M "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" L "+(e.x-t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x+t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x-t.width/3)+" "+(e.y-t.height/2)+" L "+e.x+" "+(e.y+t.height/2)+" L "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" Z",A.merge(l,{d:n});break;case"Cross":A.merge(l,{d:n="M "+p+" "+h+" L "+(d+a/2)+" "+h+" M "+d+" "+(h+s/2)+" L "+d+" "+(h+-s/2)});break;case"Image":r="Image",A.merge(l,{href:o,height:s,width:a,x:p,y:g})}return{renderOption:l,functionName:r}}function bt(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function It(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o}function Ct(e){if(0<e.length)for(var t=0;t<e.length;t++){var i=e[t];R(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function B(e,t){if(0<e.length)for(var i=0;i<e.length;i++)for(var l=e[i],o=parseFloat(l.legendEle.id.split("_Index_")[1]),n=-1<l.legendEle.id.indexOf("Text")?l.legendEle.id.replace("_Text",""):l.legendEle.id,r="Interactive"===t.legendSettings.mode?document.getElementById(n):document.getElementById(t.element.id+"_Legend_Shape_Index_"+o),n="Interactive"===t.legendSettings.mode?document.getElementById(n+"_Text"):document.getElementById(t.element.id+"_Legend_Text_Index_"+o),a=(A.isNullOrUndefined(r)||R(r,l.oldFill,l.oldOpacity,"none","0px"),A.isNullOrUndefined(n)||R(n,t.legendSettings.textStyle.color||t.themeStyle.legendTextColor,l.oldOpacity,null,null),A.isNullOrUndefined(l.ShapeCollection)?0:l.ShapeCollection.Elements.length),s=0;s<a;s++){var d=document.getElementById(l.ShapeCollection.Elements[s].id);A.isNullOrUndefined(d)||R(d,l.shapeOldFill,l.shapeOldOpacity,l.shapeOldBorderColor,l.shapeOldBorderWidth)}}function R(e,t,i,l,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),A.isNullOrUndefined(l)||e.setAttribute("stroke",l),A.isNullOrUndefined(o)||e.setAttribute("stroke-width",o)}function Ft(e,t,i){B(e,i),D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function wt(e,t,i){for(var l,o=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,n=!1,r=0;r<e&&!n;r++){var a=i.treeMapLegendModule.legendCollections[r].legendData.length;if(0<a){for(var s=0;s<a;s++)if(!A.isNullOrUndefined(o)&&0<i.leafItemSettings.colorMapping.length?i.treeMapLegendModule.legendCollections[r].legendData[s].data[o]===t.data[o]:i.treeMapLegendModule.legendCollections[r].legendData[s].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[r].legendName)){l=r,n=!0;break}}else if(i.palette&&0<i.palette.length&&(i.treeMapLegendModule.legendCollections[r].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[r].levelOrderName))&&i.treeMapLegendModule.legendCollections[r].legendName===t.name){l=r;break}}return l}function Ot(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function Lt(e,t,i,l){A.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Tt(e){e=document.getElementById(e);return e?A.remove(e):null}y.prototype.processLayoutPanel=function(){var e,t,i,l;this.treemap.treemapLevelData.levelsData&&0<this.treemap.treemapLevelData.levelsData.length&&(i=(A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||A.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(A.isNullOrUndefined(this.treemap.drilledItems)?!A.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[]))[0],l=A.extend({},this.treemap.areaRect,l,!1),A.isNullOrUndefined(this.treemap.treeMapLegendModule)||A.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(l=this.treemap.totalRect),A.isNullOrUndefined(this.treemap.currentLevel)||(A.isNullOrUndefined(this.treemap.drilledItems)?A.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?(!A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(A.isNullOrUndefined(this.treemap.drilledItems)?A.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(i||this.treemap.treemapLevelData.levelsData[0],l)):(i=this.treemap.drilledItems.length-1,e=this.treemap.drilledItems[i].data,(t={})[this.treemap.drilledItems[i].data.groupName]=[e],A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[i].data.groupIndex),this.calculateLayoutItems(t||this.treemap.treemapLevelData.levelsData[0],l)),this.renderLayoutItems())},y.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=H(e).values;if(o&&0<o.length&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],t)}return t},y.prototype.calculateLayoutItems=function(e,t){this.renderItems=[],this.parentData=[],A.isNullOrUndefined(this.treemap.weightValuePath)||(-1<this.treemap.layoutType.indexOf("SliceAndDice")?this.computeSliceAndDiceDimensional(e,t):(t.height=t.height+t.y,t.width=t.width+t.x,this.computeSquarifyDimensional(e,t)))},y.prototype.computeSliceAndDiceDimensional=function(e,t){var i,l,o,n=this.treemap.leafItemSettings,r=this.treemap.levels,a=H(e).values;if(a&&0<a.length&&(this.sliceAndDiceProcess(a,t),0<this.treemap.levels.length))for(var s=0;s<a.length;s++)o=a[s].groupIndex,l=0===r.length||o===r.length?n.gap:r[o].groupGap,o=0===r.length?0:r[o]?r[o].showHeader?r[o].headerHeight:0:r[o-1].showHeader?r[o-1].headerHeight:0,i=a[s].rect,i=new j(i.x+l/2,i.y+(o+l/2),i.width-l,Math.abs(i.height-(l+o))),this.computeSliceAndDiceDimensional(a[s],i);return e},y.prototype.sliceAndDiceProcess=function(e,t){var i,l=t.height*t.width,o=this.treemap.levels,n=0,r=0,a=(e.forEach(function(e){r+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/r}),"SliceAndDiceAuto"===this.treemap.layoutType?t.width>t.height:"SliceAndDiceHorizontal"===this.treemap.layoutType);e.sort(We);for(var s=0;s<e.length;s++){var d=e[s];d.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||A.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===o.length-1:d.groupIndex===this.treemap.levels.length),a?(i=l/r*e[s].weight/t.height,n<=t.width&&(e[s].rect=new j(n+t.x,t.y,i,t.height))):(i=l/r*e[s].weight/t.width,n<=t.height&&(e[s].rect=new j(t.x,n+t.y,t.width,i))),n+=i,this.renderItems.push(e[s])}},y.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r=this.treemap.leafItemSettings,a=this.treemap.levels,s=H(e).values;if(s&&0<s.length&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(s)),this.calculateChildrenLayout(e,s,t),0<this.treemap.levels.length))for(var d=0;d<s.length;d++)n=(l=s[d]).groupIndex,i=l.rect,o=(l.isLeafItem?r.padding:a[n].groupPadding)/2,n=this.treemap.isHierarchicalData?(0!==n||!l.isLeafItem)&&a[n]&&a[n].showHeader?a[n].headerHeight:0:0!==a.length&&a[n]&&a[n].showHeader?a[n].headerHeight:0,i=new j(i.x+o,i.y+(n+o),i.width-o,i.height-o),!l.isLeafItem&&0<l.weight&&this.computeSquarifyDimensional(s[d],i)},y.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,Ye(i)),t.sort(pt),this.performRowsLayout(t,[],i,[])},y.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o)return h=this.getCoordinates(t,i),l.concat(h);var n=Ze(i),r=e[0],o=e.slice(1,o);if(this.aspectRatio(t,r,n))return n=t.concat(r),this.performRowsLayout(o,n,i,l);for(var a=t.length,s=0,d=0;d<a;d+=1)s+=t[d].itemArea;var r=this.cutArea(i,s),h=this.getCoordinates(t,i),o=l.concat(h);return this.performRowsLayout(e,[],r,o)},y.prototype.aspectRatio=function(e,t,i){return 0===e.length||(t=e.concat(t),e=this.findMaxAspectRatio(e,i),this.findMaxAspectRatio(t,i)<=e)},y.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),o<a&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},y.prototype.cutArea=function(e,t){var i,e=Qe(e),l=e.width,o=e.height,n=e.x,e=e.y;return $e(o<=l?{x:n+(i=t/o),y:e,width:l-i,height:o}:{x:n,y:e+(i=t/l),width:l,height:o-i})},y.prototype.getCoordinates=function(e,t){for(var i=Qe(t),l=i.width,o=i.height,n=i.x,i=i.y,r=e.length,a=this.treemap.levels,s=this.treemap.leafItemSettings,d=0,h=0;h<r;h+=1)d+=e[h].itemArea;for(var p,g,c=d/o,m=d/l,u=n,y=i,f=[],h=0;h<r;h+=1){var v,x=e[h],S=x.groupIndex;x.isLeafItem=0===a.length||(this.treemap.isHierarchicalData||!A.isNullOrUndefined(s.labelPath))&&S===a.length,g=(p=bt(this.parentData[0],x))?this.treemap.areaRect:x.parent.rect,S=x.isLeafItem?s.padding:a[S].groupPadding,o<=l?(v=y+x.itemArea/c,x.rect={x:u,y:y,width:u+c,height:v},y=v):(v=u+x.itemArea/m,x.rect={x:u,y:y,width:v,height:y+m},u=v),0<x.weight&&(p||Math.round(t.y+S/2)<=Math.round(g.y+(g.height-g.y))&&Math.round(t.x+S/2)<=Math.round(g.x+(g.width-g.x)))&&(this.renderItems.push(x),f.push(x))}return f},y.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},y.prototype.onDemandProcess=function(e){var t,i=e[0].parent;this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;for(var l={},o=(A.isNullOrUndefined(i.groupName)?l=i:l[i.groupName]=[i],t=A.extend({},this.treemap.areaRect,t,!1),A.isNullOrUndefined(this.treemap.treeMapLegendModule)||A.isNullOrUndefined(this.treemap.totalRect)||(t=this.treemap.totalRect),this.treemap.levels.length),n=0;n<o;n++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[n]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,t),this.renderLayoutItems()},y.prototype.renderLayoutItems=function(){for(var a,s,d,h,p,g,c,m,u,y,f,v,x,S,b,I,C,F,w=this,O=this.treemap,L=(this.renderer=O.renderer,O.element.id),e=O.layoutType,T=this.treemap.leafItemSettings.interSectAction,M="",N=document.getElementById(O.element.id+"_Secondary_Element"),_=O.levels,E=(this.layoutGroup=this.renderer.createGroup({id:L+"_TreeMap_"+e+"_Layout"}),A.createElement("div",{id:O.element.id+"_Label_Template_Group",className:"template"})),D=(E.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+O.areaRect.y+"px;left:"+O.areaRect.x+"px;height:"+O.areaRect.height+"px;width:"+O.areaRect.width+"px;",!1),P=O.leafItemSettings,B=this,t=0;t<this.renderItems.length;t++)!function(e){if(m=B.renderItems[e],h=m.groupIndex,B.treemap.drillDownView&&A.isNullOrUndefined(B.treemap.currentLevel)&&0<h||B.treemap.drillDownView&&h>B.treemap.currentLevel+1)return;g=m.rect,D=m.isLeafItem,f=L+"_Level_Index_"+h+"_Item_Index_"+e,S=B.renderer.createGroup({id:f+"_Group"}),C=(D?P.gap:_[h].groupGap)/2;var t,e=B.treemap.totalRect?O.legendSettings.visible?B.treemap.totalRect:Qe(B.treemap.totalRect):B.treemap.areaRect;"Squarified"===O.layoutType&&(g.width=Math.abs(g.x-g.width)-C,g.height=Math.abs(g.y-g.height)-C),"TopRightBottomLeft"===O.renderDirection?g.x=e.x+e.width-g.width-Math.abs(e.x-g.x):"BottomLeftTopRight"===O.renderDirection?g.y=e.y+e.height-g.height-Math.abs(e.y-g.y):"BottomRightTopLeft"===O.renderDirection&&(g.x=e.x+e.width-g.width-Math.abs(e.x-g.x),g.y=e.y+e.height-g.height-Math.abs(e.y-g.y)),C=B.getItemColor(D,m),c=C.fill,y=C.opacity,C=D?P.labelFormat:_[h].headerFormat,s=D?P.showLabels:_[h].showHeader,t=h===B.treemap.currentLevel?B.treemap.enableBreadcrumb?(F="#"+B.treemap.breadcrumbConnector+"#",t=m.levelOrderName.replace(/#/gi,F),0!==h?"#"+t:t):m.name:(B.treemap.enableBreadcrumb&&(m.isDrilled=!1),m.name),u=mt(C,m.data,B.treemap)||t||"undefined",C=H(m).values,u=!D&&C&&0<C.length&&B.treemap.enableDrillDown?m.isDrilled?O.enableRtl?u+" [-]":"[-] "+u:O.enableRtl?u+" [+]":"[+] "+u:u,O.enableHtmlSanitizer&&(u=A.SanitizeHtmlHelper.sanitize(u));var e=(D?P.labelStyle:_[h].headerStyle).fontFamily||B.treemap.themeStyle.labelFontFamily,i=(D?P.labelStyle:_[h].headerStyle).size||B.treemap.themeStyle.labelFontSize,l=(D?P.labelStyle:_[h].headerStyle).fontWeight||B.treemap.themeStyle.fontWeight,o=(D?P.labelStyle:_[h].headerStyle).color,n=(D?P.labelStyle:_[h].headerStyle).fontStyle,r=(D?P.labelStyle:_[h].headerStyle).opacity;x={fontFamily:e,size:i,fontWeight:l,color:o,fontStyle:n,opacity:r},I=(D?P:_[h]).border,a=D?P.labelPosition:"Near"===_[h].headerAlignment?"TopLeft":"Center"===_[h].headerAlignment?"TopCenter":"TopRight",p=(D?P:_[h]).templatePosition,b=D?P.labelTemplate:_[h].headerTemplate,m.options={border:I,opacity:y,fill:c},d={cancel:!1,name:U,treemap:B.treemap,text:u,currentItem:m,RenderItems:B.renderItems,options:m.options,textColor:x.color},B.treemap.trigger(U,d,function(e){e.cancel||(M=" M "+g.x+" "+g.y+" L "+(g.x+g.width)+" "+g.y+" L "+(g.x+g.width)+" "+(g.y+g.height)+" L "+g.x+" "+(g.y+g.height)+"z",v=new z(f+"_RectPath",c,I.width,I.color,y,null,M),e=w.renderer.drawPath(v),S.appendChild(e),s&&(d.text!==u&&(d.text=mt(d.text,m.data,w.treemap)||t),x.color=d.textColor||x.color,w.renderItemText(d.text.toString(),S,x,g,T,f,c,a,F)),b&&(v=w.renderTemplate(N,f,g,p,b,m,D),A.isNullOrUndefined(v)||(E.appendChild(v),w.treemap.renderReactTemplates())),S.setAttribute("aria-label",m.name),w.treemap.enableDrillDown&&!D||w.treemap.selectionSettings.enable||w.treemap.highlightSettings.enable?(S.setAttribute("role","button"),S.setAttribute("tabindex",w.treemap.tabIndex.toString()),S.style.outline="none",S.style.cursor=(!w.treemap.highlightSettings.enable||w.treemap.selectionSettings.enable||!w.treemap.enableDrillDown||m.groupIndex!==w.treemap.levels.length-1)&&(!w.treemap.highlightSettings.enable||w.treemap.selectionSettings.enable||w.treemap.enableDrillDown)?"pointer":"default"):S.setAttribute("role","region"),gt(w.treemap,S,"treeMapSelection"),w.layoutGroup.appendChild(S))})}(t);0<E.childNodes.length&&N.appendChild(E),this.treemap.svgObject.appendChild(this.layoutGroup),gt(this.treemap,this.layoutGroup,"treeMapSelection")},y.prototype.renderItemText=function(e,t,i,l,o,n,r,a,s){var d=[],h=0,p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(l,e,i,o),c=V(p&&p[0]||g[0],i),e=(this.treemap.enableRtl&&(x=V(e,i),v=e.search("[+]")||e.search("[-]"),l.width<x.width)&&0<v&&(x=e.substring(v-1,e.length),v=V("[+]",i),g[0]=G(l.width-v.width-5,g[0],i)+x),Xe(l,a,c,"Text",this.treemap));if(!A.isNullOrUndefined(p)){for(var m,u=[],y=[],f=0;f<p.length;f++)h+=(c=V(m=G(l.width-5,p[f],i),i)).height,y.push(c.width),u.push(m);g=u,c.width=Math.max.apply(null,y),c.height=h}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var v,x,S=0;S<g.length;S++)h+=(c=V(g[S],i)).height,l.height-5>h&&d.push(g[S]);"Wrap"===o&&g.length!==d.length&&d.length&&(x=(x=d[v=d.length-1]).substring(0,x.length-1)+"...",d.splice(v),"..."!==x)&&d.push(x)}else a=g,d.push(a);Ue(new T(n+"_Text",e.x,e.y,"start",d,"","",s),i,i.color||this.getSaturatedColor(r),t)},y.prototype.getItemColor=function(e,t){var i=this.treemap,l=(e?i.leafItemSettings:i.levels[t.groupIndex]).fill,o=(e?i.leafItemSettings:i.levels[t.groupIndex]).opacity,n=(A.isNullOrUndefined(i.treemapLevelData.defaultLevelsData)||0<i.treemapLevelData.defaultLevelsData.length&&(i.treemapLevelData.levelsData=i.treemapLevelData.defaultLevelsData),H(i.treemapLevelData.levelsData[0]).values),e=(e?i.leafItemSettings:i.levels[t.groupIndex]).colorMapping;if(0<e.length){e=et(e,t.data[i.equalColorValuePath],t.data[i.rangeColorValuePath]);A.isNullOrUndefined(e)||(l=(A.isNullOrUndefined(e.fill)?i.leafItemSettings:e).fill,o=e.opacity)}else for(var r=0;r<n.length;r++)n[r].levelOrderName===t.levelOrderName.split("#")[0]&&(l=A.isNullOrUndefined(l)?A.isNullOrUndefined(i.colorValuePath)?A.isNullOrUndefined(t.options)?!A.isNullOrUndefined(i.palette)&&0<i.palette.length?i.palette[r%i.palette.length]:"#808080":t.options.fill:n[r].data[i.colorValuePath]:l);return{fill:l,opacity:o}},y.prototype.getSaturatedColor=function(e){var t=e,e=vt(u("transparent"===e?window.getComputedStyle(document.body,null).backgroundColor:t));return 128<=Math.round((299*e.r+587*e.g+114*e.b)/1e3)?"black":"white"},y.prototype.renderTemplate=function(e,t,i,l,o,n,r){var a,t=r?t+"_LabelTemplate":t+"_HeaderTemplate",r=r?"_LabelTemplate":"_HeaderTemplate";if(A.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var s=Object.keys(n.data),d=0;d<s.length;d++){var h=RegExp;o=o.replace(new h("{{:"+s[d]+"}}","g"),n.data[s[d].toString()])}return this.treemap.enableHtmlSanitizer&&"string"==typeof o&&(o=A.SanitizeHtmlHelper.sanitize(o)),A.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))||(i=Xe(i,l,Je(a=qe(Ge(o)(n.data,this.treemap,o,this.treemap.element.id+r,!1),t,n.data),e),"Template",this.treemap),a.style.left=i.x+"px",a.style.top=i.y+"px"),a},y.prototype.labelInterSectAction=function(e,t,i,l){var o,n=e.width-10;switch(l){case"Hide":o=[ht(n,e.height,t,i)];break;case"Trim":o=[G(3+n,t,i)];break;case"WrapByWord":o=st(n,t,i);break;case"Wrap":o=dt(n,t,i)}return o},y.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]};var Mt=y;function y(e){this.treemap=e}function Nt(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",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:ne,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0}}return t}(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};Et.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),l=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:E});e.trigger(E,l,function(){l.cancel||A.print(l.htmlContent,i)})},Et.prototype.getHTMLContent=function(e,t){var i,l,o=A.createElement("div");return t?t instanceof Array?t.forEach(function(e){o.appendChild(Ae(e).cloneNode(!0))}):t instanceof Element?o.appendChild(t.cloneNode(!0)):o.appendChild(Ae(t).cloneNode(!0)):(l=(t=e.element.cloneNode(!0)).getElementsByTagName("svg")[0],A.isNullOrUndefined(l)||(l=l.childNodes[0],A.isNullOrUndefined(l))||(i=l.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i||l.setAttribute("fill","rgba(0, 0, 0, 1)"):l.setAttribute("fill","rgba(255,255,255, 1)")),o.appendChild(t)),o},Et.prototype.getModuleName=function(){return"Print"},Et.prototype.destroy=function(){};var _t=Et;function Et(e){}Pt.prototype.export=function(d,h,p,g){return new Promise(function(e,t){var i,l,o=A.createElement("canvas",{id:"ej2-canvas",attrs:{height:d.availableSize.height.toString(),width:d.availableSize.width.toString()}}),n=d.svgObject.cloneNode(!0),r=n.childNodes[0],a=(A.isNullOrUndefined(r)||(r=r.getAttribute("fill"),"Tailwind"!==d.theme&&"Tailwind3"!==d.theme&&"Bootstrap5"!==d.theme&&"Fluent"!==d.theme&&"Material3"!==d.theme&&"Fluent2"!==d.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r?"TailwindDark"!==d.theme&&"Tailwind3Dark"!==d.theme&&"Bootstrap5Dark"!==d.theme&&"FluentDark"!==d.theme&&"Material3Dark"!==d.theme&&"Fluent2Dark"!==d.theme&&"Fluent2HighContrast"!==d.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r||n.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):n.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),!(-1<A.Browser.userAgent.toString().indexOf("HeadlessChrome"))),r='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+n.outerHTML+"</svg>",s=window.URL.createObjectURL(new Blob("SVG"===h?[r]:[(new XMLSerializer).serializeToString(n)],{type:"image/svg+xml"}));"SVG"===h?g?Lt(p,h,s,a):e(null):(i=new Image,l=o.getContext("2d"),i.onload=function(){l.drawImage(i,0,0),window.URL.revokeObjectURL(s),g?Lt(p,h,o.toDataURL("image/png").replace("image/png","image/octet-stream"),a):"JPEG"===h?e(o.toDataURL("image/jpeg")):"PNG"===h&&e(o.toDataURL("image/png"))},i.src=s)})},Pt.prototype.getModuleName=function(){return"ImageExport"},Pt.prototype.destroy=function(){};var Dt=Pt;function Pt(e){}zt.prototype.export=function(s,e,d,h,p){return new Promise(function(i,e){var l=A.createElement("canvas",{id:"ej2-canvas",attrs:{width:s.availableSize.width.toString(),height:s.availableSize.height.toString()}}),t=(h=A.isNullOrUndefined(h)?w.PdfPageOrientation.Landscape:h,s.svgObject.cloneNode(!0)),o=t.childNodes[0],n=(A.isNullOrUndefined(o)||(o=o.getAttribute("fill"),"Tailwind"!==s.theme&&"Tailwind3"!==s.theme&&"Bootstrap5"!==s.theme&&"Fluent"!==s.theme&&"Material3"!==s.theme&&"Fluent2"!==s.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o?"TailwindDark"!==s.theme&&"Tailwind3Dark"!==s.theme&&"Bootstrap5Dark"!==s.theme&&"FluentDark"!==s.theme&&"Material3Dark"!==s.theme&&"Fluent2Dark"!==s.theme&&"Fluent2HighContrast"!==s.theme||"rgba(255,255,255, 0.0)"!==o&&"transparent"!==o||t.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):t.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(t)],{type:"image/svg+xml"}))),r=new Image,a=l.getContext("2d");r.onload=function(){a.drawImage(r,0,0),window.URL.revokeObjectURL(n);var e=new w.PdfDocument,t=l.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=h,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new w.PdfBitmap(t),0,0,s.availableSize.width-60,s.availableSize.height),p?(e.save(d+".pdf"),e.destroy()):i(null)},r.src=n})},zt.prototype.getModuleName=function(){return"PdfExport"},zt.prototype.destroy=function(){};var Bt=zt;function zt(e){}Ht=function(e,t){return(Ht=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])}))(e,t)};var Ht,Rt,i=function(e,t){function i(){this.constructor=e}Ht(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(r=(n<3?o(r):3<n?o(t,i,r):o(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},i=(Rt=A.Component,i(v,Rt),v.prototype.preRender=function(){var e=this;this.trigger(N,{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},v.prototype.render=function(){this.renderElements()},v.prototype.renderElements=function(){this.treemapLevelData=new Ut,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=Nt(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),A.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},v.prototype.processDataManager=function(){var e,t,l=this;this.dataSource instanceof F.DataManager?(e=this.dataSource,t=this.query instanceof F.Query?this.query:new F.Query,e.executeQuery(t).then(function(e){l.dataSource=e.result,l.renderTreeMapElements()})):this.dataSource instanceof It?(e=this.dataSource,(t=new A.Fetch(e.dataOptions,e.type,e.contentType)).onSuccess=function(e){var t,i;A.isNullOrUndefined(e.type)||"application/octet-stream"!==e.type?(l.dataSource=e,l.renderTreeMapElements()):(t=new FileReader,i=l,t.onload=function(){e=JSON.parse(t.result.toString()),i.dataSource=e,i.renderTreeMapElements()},t.readAsText(e))},t.send(e.sendData)):this.renderTreeMapElements()},v.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),!A.isNullOrUndefined(this.treeMapLegendModule)&&this.legendSettings.visible&&ct(this,this.treeMapLegendModule.legendGroup),this.elementChange(),this.trigger(_,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},v.prototype.createSvg=function(){if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&A.remove(this.svgObject)}A.isNullOrUndefined(this.renderer)&&(this.renderer=new C.SvgRenderer(this.element.id)),A.isNullOrUndefined(this.layout)&&(this.layout=new Mt(this)),this.clearTemplate();var e=this.element.clientWidth,t=this.element.clientHeight;this.availableSize=new W(Be(this.width,e)||e||600,Be(this.height,t)||t||450),this.svgObject=this.renderer.createSvg({id:this.element.id+"_svg",width:this.availableSize.width,height:this.availableSize.height})},v.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-treemap").length,this.element.id="treemap_control_"+e),this.renderer=new C.SvgRenderer(this.element.id),this.layout=new Mt(this)},v.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");e&&0<e.childElementCount&&e.parentNode.removeChild(e),A.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))&&((e=A.createElement("div",{id:this.element.id+"_Secondary_Element"})).style.cssText="position: absolute;z-index:1;",this.element.appendChild(e))},v.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!A.isNullOrUndefined(this.svgObject)&&!A.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!A.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},v.prototype.renderBorder=function(){var e=this.border.width,t=this.svgObject.querySelector("#"+this.element.id+"_TreeMap_Border");(0<this.border.width||this.background||this.themeStyle.backgroundColor)&&A.isNullOrUndefined(t)?(e=new L(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new j(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e)),this.svgObject.appendChild(this.renderer.drawRectangle(e))):t&&t.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},v.prototype.renderTitle=function(e,t,i,l){var o,n,r,a,s={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},d=this.availableSize.width-this.margin.right-this.margin.left;s.fontFamily=s.fontFamily||this.themeStyle.fontFamily,s.fontWeight=s.fontWeight||this.themeStyle.titleFontWeight,s.size=s.size||("title"===t?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text?(A.isNullOrUndefined(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"})),a=V(r=G(d,n=this.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(e.text):e.text,s),s),i=He(A.isNullOrUndefined(i)?new j(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):i,e.alignment,a,t),r=new T(this.element.id+"_TreeMap_"+t,i.x,i.y,"start",r),i=new j(i.x,i.y,a.width,a.height),(a=Ue(r,s,s.color||("title"===t?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l)).setAttribute("aria-label",e.description||n),a.setAttribute("role","region"),a.setAttribute("tabindex",this.tabIndex.toString()),("title"!==t||e.subtitleSettings.text)&&"subtitle"!==t||(o=this.availableSize.height-i.y-10-this.margin.bottom,this.areaRect=new j(this.margin.left,i.y+10,d,o)),"subtitle"!==t&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",i,l):this.svgObject.appendChild(l)):(o=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new j(this.margin.left,this.margin.top,d,o))},v.prototype.processingData=function(){var t=this;if(this.dataSource=this.dataSource,!A.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.weightValuePath){if(this.treemapLevelData.levelsData=[],this.dataSource.map(function(e){e[t.weightValuePath]=e[t.weightValuePath]&&e[t.weightValuePath].toString()}),this.leafItemSettings.labelPath=this.leafItemSettings.labelPath||this.weightValuePath,this.checkIsHierarchicalData(),0===this.levels.length){var i={level:0},l=this.leafItemSettings.labelPath;i[l]=[];for(var e=0;e<this.dataSource.length;e++){var o=H(this.dataSource[e]).values;this.isHierarchicalData&&o&&0<o.length?o.forEach(function(e){e[l]&&i[l].push({groupIndex:0,name:e[l],levelOrderName:e[l].toString(),data:e,weight:e[t.weightValuePath]})}):this.dataSource[e][l]&&i[l].push({groupIndex:0,name:this.dataSource[e][l],levelOrderName:this.dataSource[e][l].toString(),data:this.dataSource[e],weight:this.dataSource[e][this.weightValuePath]})}this.treemapLevelData.levelsData.push(i)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=A.extend([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(e=0;e<this.treemapLevelData.hierarchyData.length;e++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[e],e);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),1<this.treemapLevelData.levelsData.length&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);l=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.levelsData[0][l],"Parent")}},v.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=H(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},v.prototype.processHierarchicalData=function(e,t){var i,l=this,o={},n=this.leafItemSettings.labelPath||this.weightValuePath,r=(o=H(e))?o.values:null;if(r&&0<r.length){for(var a=o.key,s=0;s<this.levels.length;s++)a===this.levels[s].groupPath&&(i=s);for(var d=0;d<r.length;d++){r[d].name=r[d][n],r[d].levelOrderName=(0===i?r[d].name:e.levelOrderName+"#"+r[d].name)+"";var h=r[d].levelOrderName,p=void 0;0<h.search("#")&&(p=h.split("#").length-1),r[d].groupIndex=A.isNullOrUndefined(i)?p===this.levels.length?this.levels.length:p:i,0!==i&&(r[d].parent=e),r[d].groupName=a,r[d].data=r[d],r[d].isDrilled=!1,r[d].weight=r[d][this.weightValuePath]}r.forEach(function(e){l.processHierarchicalData(e,t)})}if(t===this.treemapLevelData.hierarchyData.length-1){var g=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!A.isNullOrUndefined(g)){for(var c=0;c<this.treemapLevelData.hierarchyData.length;c++)r=H(this.treemapLevelData.hierarchyData[c]).values,0!==c&&r&&(r.forEach(function(e){g.push(e)}),this.treemapLevelData.hierarchyData.splice(c,1),--c);for(var g=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath],m=0;m<g.length;m++)(o[this.levels[0].groupPath]=g)[m].parent=o}}},v.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},v.prototype.export=function(i,l,o,n){var r=this;return A.isNullOrUndefined(n)&&(n=!0),"PDF"===i&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(r.pdfExportModule.export(r,i,l,o,n))}):this.allowImageExport&&"PDF"!==i&&this.imageExportModule?new Promise(function(e,t){e(r.imageExportModule.export(r,i,l,n))}):null},v.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e=[],t=0;t<this.levels.length+1;t++){var i=this.levels[t]?this.levels[t].groupPath:this.leafItemSettings.labelPath,l={};l.level=t,l[i]=[],this.treemapLevelData.levelsData.push(l);for(var o=0;o<this.dataSource.length;o++){var n={},r="";if(!A.isNullOrUndefined(i)){var a=this.dataSource[o][i];if(0!==t)for(var s=0;s<=t;s++){var d=this.levels[s]?this.levels[s].groupPath:i;r+=this.dataSource[o][d]+(s===t?"":"#")}0<e.length&&-1!==e.indexOf(r||a)||(n.name=a,n.levelOrderName=(r||a)+"",n.groupIndex=t,n.isDrilled=!1,n.groupName=i,n.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][i].push(n),e.push(r||a))}}}},v.prototype.reOrderLevelData=function(e){for(var t=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,i=this.levels[e-1].groupPath,l=this.treemapLevelData.levelsData[e][t],o=this.treemapLevelData.levelsData[e-1][i],n=0;n<l.length;n++)for(var r=l[n].levelOrderName,a=0;a<o.length;a++)if(o[a][t]=A.isNullOrUndefined(o[a][t])?[]:o[a][t],this.IsChildHierarchy(r.split("#"),o[a].levelOrderName.split("#"))){A.isNullOrUndefined(l[n].parent)&&(l[n].parent=o[a]),o[a][t].push(l[n]);break}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][t],"Child"),this.treemapLevelData.levelsData.splice(e,1),0<e-1&&this.reOrderLevelData(e-1)},v.prototype.IsChildHierarchy=function(e,t){for(var i=!1,l=0;l<t.length;l++){if(e.length<l||t[l]!==e[l])return!1;i=!0}return i},v.prototype.findTotalWeight=function(i,e){for(var l,o,n,r=this,a={},s=this,t=0;t<i.length;t++)!function(t){l=0,n=i[t].groupName,o=i[t].levelOrderName.split("#"),s.dataSource.forEach(function(e){je(o,i[t].levelOrderName,e,r)&&(l+=parseFloat(e[r.weightValuePath]))}),"Parent"===e&&((a[n]=i)[t].parent=a),i[t].weight=l}(t)},v.prototype.unWireEVents=function(){A.EventHandler.remove(this.element,"click",this.clickOnTreeMap),A.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),A.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),A.EventHandler.remove(this.element,A.Browser.touchStartEvent,this.mouseDownOnTreeMap),A.EventHandler.remove(this.element,A.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),A.EventHandler.remove(this.element,A.Browser.touchEndEvent,this.mouseEndOnTreeMap),A.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),A.EventHandler.remove(this.element,"keydown",this.keyDownHandler),A.EventHandler.remove(this.element,"keyup",this.keyUpHandler),A.EventHandler.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},v.prototype.wireEVents=function(){A.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),A.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),A.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),A.EventHandler.add(this.element,A.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),A.EventHandler.add(this.element,A.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),A.EventHandler.add(this.element,A.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),A.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),A.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),A.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),A.EventHandler.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent),this.setStyle(this.element)},v.prototype.setStyle=function(e){e.style.overflow="hidden"},v.prototype.setCulture=function(){this.intl=new A.Internationalization},v.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},v.prototype.resizeOnTreeMap=function(e){var t,i=this;this.isDestroyed||(this.isResize=!0,t={name:oe,cancel:!1,previousSize:this.availableSize,currentSize:new W(0,0),treemap:this},this.resizeTo&&clearTimeout(this.resizeTo),!A.isNullOrUndefined(this.element)&&this.element.classList.contains("e-treemap")&&(this.resizeTo=setTimeout(function(){i.unWireEVents(),i.createSvg(),i.refreshing=!0,i.wireEVents(),t.currentSize=i.availableSize,i.trigger(oe,t,function(e){i.render(),i.refreshing=!1})},500)))},v.prototype.clickOnTreeMap=function(e){var t,i=this,l=e.target,o=l.id,n=l.innerHTML,r=(this.trigger($,{cancel:!1,name:$,treemap:this,mouseEvent:e}),-1<o.indexOf("_Item_Index")&&(e.preventDefault(),r=parseFloat(o.split("_Item_Index_")[1]),r={cancel:!1,name:Z,treemap:this,item:this.layout.renderItems[r],mouseEvent:e,groupIndex:this.layout.renderItems[r].groupIndex,groupName:this.layout.renderItems[r].name,text:n,contentItemTemplate:n},this.trigger(Z,r,function(e){e.text===n&&e.contentItemTemplate===n||(A.isNullOrUndefined(i.leafItemSettings.labelTemplate)?(e.text=mt(e.text,e.item.data,e.treemap),l.textContent=e.text):ke(o,l,e.contentItemTemplate))})),(new Date).getMilliseconds());A.isNullOrUndefined(this.doubleClick)||!A.isNullOrUndefined(t)&&r-t<500&&this.doubleClickOnTreeMap(e)},v.prototype.doubleClickOnTreeMap=function(e){this.trigger(K,{cancel:!1,name:K,treemap:this,mouseEvent:e})},v.prototype.rightClickOnTreeMap=function(e){this.trigger(ee,{cancel:!1,name:ee,treemap:this,mouseEvent:e})},v.prototype.mouseDownOnTreeMap=function(e){-1<e.target.id.indexOf("_Item_Index")&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(A.Browser.touchStartEvent,e)},v.prototype.mouseMoveOnTreeMap=function(e){var t,i=e.target.id;this.trigger(te,{cancel:!1,name:te,treemap:this,mouseEvent:e}),this.removeFocus("none"),-1<i.indexOf("_Item_Index")?(t=H(i=this.layout.renderItems[parseFloat(i.split("_Item_Index_")[1])]).values,this.element.style.cursor=!i.isLeafItem&&t&&0<t.length&&this.enableDrillDown?"pointer":"auto",this.trigger(Q,{cancel:!1,name:Q,treemap:this,item:i,mouseEvent:e})):this.element.style.cursor="default",this.notify(A.Browser.touchMoveEvent,e)},v.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,n=t.levelOrderName.split("#"),r=0,a=Object.keys(n);r<a.length;r++)n[l=a[r]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:n}},v.prototype.calculatePreviousLevelChildItems=function(e,t,i){for(var l,o,n=0,r=this.layout.renderItems[0].levelOrderName.split("#").length,a=0;a<r;a++)o=0===a?e.levelText[a]:o+"#"+e.levelText[a];for(var s,n=1<r?r:n,d=0,h=Object.values(this.layout.renderItems);d<h.length;d++)(s=h[d]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===n?A.isNullOrUndefined(o)?o:e.levelText[n]:i?o:o+"#"+e.levelText[n])===s.levelOrderName&&(this.drilledItems.push({name:s.levelOrderName,data:s}),i=!0,++n<=t.groupIndex)&&(o=l+"#"+e.levelText[n]);return i},v.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var l,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((l=this.drilledItems[i].data.parent).isDrilled=!0,o[l[this.drilledItems[i].data.groupName]]=[l],this.drilledItems.splice(i,this.drilledItems.length)):e.drillLevel!==this.drilledItems.length-1&&e.drillLevel!==t.groupIndex||(o[t.groupName]=[t]),o},v.prototype.mouseEndOnTreeMap=function(e){var i,l,t,o=this,n=e.target,r=n.id,a=!1,s={},d=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",h=this.element.id+"_Label_Template_Group";if(-1<r.indexOf("_Item_Index")&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),r=parseFloat(r.split("_Item_Index_")[1]),p=this.layout.renderItems[r];var r=n.textContent;if(this.enableBreadcrumb&&(t=this.calculateSelectedTextLevels(r,p),l=t.drillLevel,this.drillDownView||-1===r.search("[+]")||(a=this.calculatePreviousLevelChildItems(t,p,a))),0!==this.levels.length&&!p.isLeafItem&&H(p).values&&0<H(p).values.length){if(0<this.drilledItems.length)for(var p=a?this.drilledItems[this.drilledItems.length-1].data:p,g=0;g<this.drilledItems.length;g++){if(!A.isNullOrUndefined(l)){var c=this.drilledItems.length,s=this.compareSelectedLabelWithDrillDownItems(t,p,g);if(c!==this.drilledItems.length){--g;break}}if(p.levelOrderName===this.drilledItems[g].name&&!a&&A.isNullOrUndefined(l)){0===p.groupIndex&&p.parent[p.groupName]instanceof Array?(p.isDrilled=!p.isDrilled,p.isDrilled?s[p.groupName]=[p]:s=p.parent):(p.isDrilled=!1,p.parent.isDrilled=!0,p=p.parent,s[p.groupName]=[p]),this.drilledItems.splice(g,1),--g;break}g===this.drilledItems.length-1&&A.isNullOrUndefined(l)&&(p.isDrilled=!0,s[p.groupName]=[p])}else p.isDrilled=!0,s[p.groupName]=[p];r={cancel:!1,name:k,treemap:this,element:n,groupIndex:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!A.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).groupIndex,groupName:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!A.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).name,rightClick:3===e.which,childItems:null,item:s},this.trigger(k,r,function(e){var t;o.currentLevel=p.isDrilled&&A.isNullOrUndefined(l)?p.groupIndex:!A.isNullOrUndefined(l)&&o.enableBreadcrumb&&p.isDrilled?l:null,e.cancel||(document.getElementById(d)&&(t=document.getElementById(d)).parentNode.removeChild(t),i=A.extend({},o.areaRect,i,!0),o.legendSettings.visible&&!A.isNullOrUndefined(o.treeMapLegendModule)&&(A.isNullOrUndefined(s)||(o.treeMapLegendModule.legendGroup.textContent="",o.treeMapLegendModule.legendGroup=null,o.treeMapLegendModule.widthIncrement=0,o.treeMapLegendModule.heightIncrement=0,o.enableBreadcrumb&&!A.isNullOrUndefined(l)?o.drilledLegendItems={name:o.drilledItems[o.drilledItems.length-1].data.levelOrderName,data:o.drilledItems[o.drilledItems.length-1].data}:o.drilledLegendItems={name:p.levelOrderName,data:p},o.treeMapLegendModule.renderLegend()),i=A.isNullOrUndefined(o.totalRect)?i:o.totalRect),document.getElementById(h)&&(t=document.getElementById(h)).parentNode.removeChild(t),A.isNullOrUndefined(e.childItems)||e.cancel?(o.layout.calculateLayoutItems(s,i),o.layout.renderLayoutItems()):o.layout.onDemandProcess(e.childItems))}),n={cancel:!1,name:q,treemap:this,renderItems:this.layout.renderItems},this.trigger(q,n),!a&&A.isNullOrUndefined(l)&&this.drilledItems.push({name:p.levelOrderName,data:p})}}this.mouseDown=!1,this.notify(A.Browser.touchEndEvent,e)},v.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(B(this.treeMapHighlightModule.shapeHighlightCollection,this),this.treeMapHighlightModule.highLightId=""),this.removeFocus("")},v.prototype.keyUpHandler=function(e){var t;"Tab"===e.code&&(e=e.target.id,t=document.getElementById(e),-1<e.indexOf("Item_Index")||-1<e.indexOf("Legend")?(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable?(t.style.setProperty("outline","none"),t.classList.add("keyboard-focused"),e=-1<e.indexOf("_Legend_")&&"Default"===this.legendSettings.mode?t.children[0]:t,this.treeMapHighlightModule.highlightOnMouseMove(e)):(this.removeFocus(""),t.style.outline="2px solid black",t.classList.add("keyboard-focused"))):(D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&B(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")))},v.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);"Enter"===e.code&&(this.selectionSettings.enable&&(-1<t.indexOf("Item_Index")||-1<t.indexOf("Legend"))&&(t=-1<t.indexOf("_Legend_")&&"Default"===this.legendSettings.mode?i.children[0]:i,this.treeMapSelectionModule.selectionOnMouseDown(t)),this.enableDrillDown)&&0<i.childElementCount&&this.mouseEndOnTreeMap(e)},v.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||-1<t.indexOf("Item_Index")&&-1<e.relatedTarget.id.indexOf("Legend")||-1<t.indexOf("Legend")&&-1<e.relatedTarget.id.indexOf("Item_Index"))&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),B(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},v.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},v.prototype.selectItem=function(e,t){A.isNullOrUndefined(t)&&(t=!0);for(var i="",l=0;l<e.length;l++)l!==e.length-1?i+=e[l]+"#":i+=e[l];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(i,t)},v.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,_t],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Dt],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Bt],name:"PdfExport"}),e},v.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,l=0,o=Object.keys(e);l<o.length;l++)switch(o[l]){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())}},v.prototype.getModuleName=function(){return"treemap"},v.prototype.destroy=function(){this.unWireEVents(),Tt("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),Rt.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,A.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},v.prototype.removeSvg=function(){if(Tt(this.element.id+"_Secondary_Element"),this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&A.remove(this.svgObject)}},f([A.Property(!(v.prototype.getPersistData=function(){return""}))],v.prototype,"allowPrint",void 0),f([A.Property(!1)],v.prototype,"allowImageExport",void 0),f([A.Property(!1)],v.prototype,"allowPdfExport",void 0),f([A.Property(null)],v.prototype,"width",void 0),f([A.Property(null)],v.prototype,"height",void 0),f([A.Complex({},l)],v.prototype,"border",void 0),f([A.Complex({},se)],v.prototype,"margin",void 0),f([A.Property(null)],v.prototype,"background",void 0),f([A.Property("Material")],v.prototype,"theme",void 0),f([A.Complex({},fe)],v.prototype,"titleSettings",void 0),f([A.Property("Squarified")],v.prototype,"layoutType",void 0),f([A.Property(null)],v.prototype,"dataSource",void 0),f([A.Property(null)],v.prototype,"query",void 0),f([A.Property(null)],v.prototype,"weightValuePath",void 0),f([A.Property("")],v.prototype,"rangeColorValuePath",void 0),f([A.Property("")],v.prototype,"equalColorValuePath",void 0),f([A.Property(null)],v.prototype,"colorValuePath",void 0),f([A.Property([])],v.prototype,"palette",void 0),f([A.Property("TopLeftBottomRight")],v.prototype,"renderDirection",void 0),f([A.Property(!1)],v.prototype,"enableDrillDown",void 0),f([A.Property(!1)],v.prototype,"enableBreadcrumb",void 0),f([A.Property(" - ")],v.prototype,"breadcrumbConnector",void 0),f([A.Property(!1)],v.prototype,"drillDownView",void 0),f([A.Property(!1)],v.prototype,"enableHtmlSanitizer",void 0),f([A.Complex({},Fe)],v.prototype,"initialDrillDown",void 0),f([A.Complex({},Le)],v.prototype,"leafItemSettings",void 0),f([A.Collection([],t)],v.prototype,"levels",void 0),f([A.Complex({},De)],v.prototype,"highlightSettings",void 0),f([A.Complex({},_e)],v.prototype,"selectionSettings",void 0),f([A.Complex({},Me)],v.prototype,"tooltipSettings",void 0),f([A.Complex({},Ie)],v.prototype,"legendSettings",void 0),f([A.Property(!1)],v.prototype,"useGroupingSeparator",void 0),f([A.Property(null)],v.prototype,"description",void 0),f([A.Property(0)],v.prototype,"tabIndex",void 0),f([A.Property(null)],v.prototype,"format",void 0),f([A.Event()],v.prototype,"load",void 0),f([A.Event()],v.prototype,"beforePrint",void 0),f([A.Event()],v.prototype,"loaded",void 0),f([A.Event()],v.prototype,"itemRendering",void 0),f([A.Event()],v.prototype,"drillStart",void 0),f([A.Event()],v.prototype,"drillEnd",void 0),f([A.Event()],v.prototype,"itemSelected",void 0),f([A.Event()],v.prototype,"itemHighlight",void 0),f([A.Event()],v.prototype,"tooltipRendering",void 0),f([A.Event()],v.prototype,"itemClick",void 0),f([A.Event()],v.prototype,"itemMove",void 0),f([A.Event()],v.prototype,"click",void 0),f([A.Event()],v.prototype,"doubleClick",void 0),f([A.Event()],v.prototype,"rightClick",void 0),f([A.Event()],v.prototype,"mouseMove",void 0),f([A.Event()],v.prototype,"resize",void 0),f([A.Event()],v.prototype,"legendItemRendering",void 0),f([A.Event()],v.prototype,"legendRendering",void 0),f([A.NotifyPropertyChanges],v));function v(e,t){e=Rt.call(this,e,t)||this;return e.isResize=!1,e.orientation="Horizontal",e.drilledItems=[],e.isHierarchicalData=!1,e.levelSelection=[],e.legendId=[],e}var Ut=function(){},f=(x.prototype.renderLegend=function(){var t=this,e=(this.page=0,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),{cancel:!1,name:le,treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position});this.treemap.trigger(le,e,function(e){e.cancel||e._changePosition===t.treemap.legendSettings.position||(t.treemap.legendSettings.position=e._changePosition),t.calculateLegendBounds(),0<t.legendCollections.length&&t.drawLegend()})},x.prototype.calculateLegendBounds=function(){var i=this,e=this.treemap,t=e.legendSettings;if(this.findColorMappingLegendItems(e.treemapLevelData.levelsData[0]),(!A.isNullOrUndefined(this.treemap.palette)&&0<this.treemap.palette.length||!A.isNullOrUndefined(e.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(e.treemapLevelData.levelsData[0]),0<this.legendCollections.length){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var l=t.position,z=e.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(t.title.text):t.title.text,o=t.titleStyle,H=t.mode,n=0,r=0,a=0,s=0,d=t.shapeHeight,h=t.shapeWidth,p=[],g=[],c="None"===t.orientation?"Top"===l||"Bottom"===l||"Auto"===l&&e.availableSize.width<=e.availableSize.height?"Horizontal":"Vertical":t.orientation,m=1<t.width.length?-1<t.width.indexOf("%")?e.availableSize.width/100*parseFloat(t.width):parseFloat(t.width):null,u=1<t.height.length?-1<t.height.indexOf("%")?e.availableSize.height/100*parseFloat(t.height):parseFloat(t.height):null,R=(o.fontFamily=o.fontFamily||e.themeStyle.fontFamily,o.fontWeight=o.fontWeight||e.themeStyle.titleFontWeight,o.size=o.size||e.themeStyle.subtitleFontSize,V(z,o)),y=0,f=0,v=t.shapePadding,x=t.textStyle;if(x.size=x.size||e.themeStyle.legendFontSize,x.fontFamily=x.fontFamily||e.themeStyle.fontFamily,x.fontWeight=x.fontWeight||e.themeStyle.fontWeight,"Default"===H){for(var m=A.isNullOrUndefined(m)?e.areaRect.width:m,u=A.isNullOrUndefined(u)?e.areaRect.height:u,S=0,b=0;b<this.legendCollections.length;b++){var I,C,F,w=this.legendCollections[b],O=(A.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]}),V(e.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(w.legendName):w.legendName,x));this.textMaxWidth=Math.max(this.textMaxWidth,O.width),0===b?(y=n=10+h/2,f=r=10+R.height+(d>O.height?d/2:O.height/4)):(I=O.height>d?O.height:d,"Horizontal"===c?r=(F=g[S-1].x+g[S-1].width+10+h)+v+O.width>m?u<(C=(g[S-1].y>p[S-1].y+d/2?g[S-1].y:p[S-1].y+d/2)+10)+I?(this.getPageChanged(),S=0,p=[],g=[],n=y,f):(n=p[0].x,C+I/2):(n=F-h/2,p[S-1].y):u<(C=g[S-1].y>p[S-1].y+d/2?g[S-1].y:p[S-1].y+d/2)+10+I?(F=g[S-1].x+this.textMaxWidth+10)+v+O.width>m?(n=y,r=f,g=[],p=[],this.getPageChanged(),S=0):(n=F+h/2,r=p[0].y):(n=p[S-1].x,r=C+10+d/2)),a=n+h/2+v,s=r+O.height/4,p.push({x:n,y:r}),g.push({x:a,y:s,width:O.width,height:O.height/2}),this.totalPages[this.page].Collection.push({DisplayText:w.legendName,element:w.gradientElement,Shape:{x:n,y:r},Text:{x:a,y:s},Fill:w.legendFill,Data:w.legendData,Rect:{x:p[S].x-h/2,y:p[S].y-d/2<s-O.height?p[S].y-d/2:s-O.height,width:Math.abs(p[S].x-h/2-(a+O.width)),height:d>O.height?d:O.height}}),S++}l=this.totalPages[0].Collection;l.forEach(function(e,t){e=new j(e.Rect.x,e.Rect.y,e.Rect.width,e.Rect.height);0===t&&(y=e.x,f=e.y),i.widthIncrement=Math.max(i.widthIncrement,Math.abs(y-(e.x+e.width))),i.heightIncrement=Math.max(i.heightIncrement,Math.abs(f-(e.y+e.height)))}),m=this.widthIncrement<m?this.widthIncrement:m,u=this.heightIncrement<u?this.heightIncrement:u,this.legendItemRect={x:l[0].Rect.x,y:l[0].Rect.y,width:m,height:u}}else{for(var L=this.legendCollections.length,T="Horizontal"===c?A.isNullOrUndefined(m)?e.areaRect.width/L:m/L:A.isNullOrUndefined(m)?25:m,M="Horizontal"===c?A.isNullOrUndefined(u)?25:u:A.isNullOrUndefined(u)?e.areaRect.height/L:u/L,N=(y=0,f=R.height+10,t.labelPosition),_=0,E=0,U=t.labelDisplayMode,D=0,k=0,b=0;b<this.legendCollections.length;b++){var y="Horizontal"===c?y+T:y,f="Horizontal"===c?f:f+M,P=this.legendCollections[b].legendName,B=new W(0,0);"None"===U?B=V(P,x):"Trim"===U?B=V(P=G("Horizontal"===c?T:M,P,x),x):P="",D=Math.max(D,B.height),k=Math.max(k,B.width),0<B.width&&0<B.height&&(s="Horizontal"===c?(a=y+T/2,"After"===N?f+M+B.height/2+10:f-10):(a="After"===N?y-B.width/2-10:y+T+B.width/2+10,f+M/2+B.height/4)),0===b&&(_="Horizontal"!==c&&"After"===N?a-B.width/2:y,E="Horizontal"!==c||"After"===N?f:s-B.height/2),b===L-1&&(m="Horizontal"===c?Math.abs(y+T-_):T+k+10,u="Horizontal"===c?M+D/2+10:Math.abs(f+M-E)),this.legendRenderingCollections.push({fill:this.legendCollections[b].legendFill,x:y,y:f,width:T,height:M,element:this.legendCollections[b].gradientElement,text:P,textX:a,textY:s,textWidth:B.width,textHeight:B.height,data:this.legendCollections[b].legendData})}this.legendItemRect={x:_,y:E,width:m,height:u}}}},x.prototype.getPageChanged=function(){this.page++,A.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},x.prototype.findColorMappingLegendItems=function(e){var t=H(e).values;if(t&&0<t.length&&(this.calculateLegendItems(t),0<this.treemap.levels.length))for(var i=0;i<t.length;i++)this.findColorMappingLegendItems(t[i])},x.prototype.findPaletteLegendItems=function(e){var t,i;if(!A.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!A.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&A.isNullOrUndefined(this.treemap.drilledLegendItems))for(var l=H(e).values,o=0;o<l.length;o++)if(l[o].Name===this.treemap.initialDrillDown.groupName){l[o].isDrilled=!l[o].isDrilled,e=l[o],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,t=0<this.treemap.palette.length?this.treemap.palette[o%this.treemap.palette.length]:l[o].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!A.isNullOrUndefined(this.treemap.drilledLegendItems)){var n,r=this.treemap.drilledLegendItems;if(A.isNullOrUndefined(r.data.options))for(o=0;o<r.length;o++){t=0<this.treemap.palette.length?this.treemap.palette[o%this.treemap.palette.length]:r[o].data[this.treemap.colorValuePath];break}else t=r.data.options.fill;n=(r.data.isDrilled?H(r.data):H(r.data.parent)).values}else n=H(e).values;if(n&&0<n.length){for(var a=0;a<n.length;a++)!A.isNullOrUndefined(n[a].data[this.treemap.legendSettings.showLegendPath])&&!n[a].data[this.treemap.legendSettings.showLegendPath]||(i=n[a].data[this.treemap.legendSettings.valuePath]||n[a].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,i))||this.legendCollections.push({legendName:i,legendFill:0<this.treemap.palette.length?A.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[a%this.treemap.palette.length]:t:n[a].data[this.treemap.colorValuePath],legendData:[],itemArea:n[a].weight,levelOrderName:n[a].levelOrderName});if(this.legendCollections.sort(pt),0<this.treemap.palette.length)for(var s=0;s<this.legendCollections.length;s++)this.legendCollections[s].legendFill=A.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:t}},x.prototype.calculateLegendItems=function(e){var t,i,l,o,n,r,a=!1,s=this.treemap.leafItemSettings,d=this.treemap.levels,h=this.treemap.legendSettings.position,p=!1,g=0;this.outOfRangeLegend=null;for(var c=0;c<e.length;c++){i="",p=r=n=!1;for(var m,u=e[c].data,y=e[c].groupIndex,f=((m=0===this.treemap.levels.length||y===this.treemap.levels.length)?s:d[y]).colorMapping,v=0;v<f.length;v++){var x=f[v];if(w=null,C=Number(u[this.treemap.rangeColorValuePath]),F=u[this.treemap.equalColorValuePath],x.value=A.isNullOrUndefined(x.value)?x.value:x.value.toString(),!A.isNullOrUndefined(x.from)&&!A.isNullOrUndefined(x.to)&&C>=x.from&&C<=x.to&&x.showLegend?(r=a=!0,o=x.from+" - "+x.to,l=A.isNullOrUndefined(x.label)?x.from+" - "+x.to:x.label,i=A.isNullOrUndefined(x.color)?i:x.color,t=this.isAddNewLegendData(o)):!A.isNullOrUndefined(x.value)&&F===x.value&&x.showLegend&&(n=a=!0,o=x.value.toString(),l=A.isNullOrUndefined(x.label)?x.value.toString():x.label,i=A.isNullOrUndefined(x.color)?i:"[object Array]"===Object.prototype.toString.call(x.color)?x.color[0]:x.color,t=this.isAddNewLegendData(o)),a&&A.isNullOrUndefined(x.value)&&x.maxOpacity&&x.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var S=[],p=!0;if("[object Array]"===Object.prototype.toString.call(x.color))for(var b=0;b<x.color.length;b++){var I={colorStop:(b*(100/(x.color.length-1))+"%").toString(),color:x.color[b]};S.push(I)}else{var I={colorStop:"0%",color:i},C={colorStop:"100%",color:i};S.push(I),S.push(C)}var F={id:"groupIndex_"+y+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:"Top"===h||"Bottom"===h?"100%":"0%",y2:"Top"===h||"Bottom"===h?"0%":"100%"},w=this.treemap.renderer.drawGradient("linearGradient",F,S).childNodes[0];"[object Array]"!==Object.prototype.toString.call(x.color)&&(w.childNodes[0].setAttribute("stop-opacity",x.minOpacity.toString()),w.childNodes[1].setAttribute("stop-opacity",x.maxOpacity.toString())),this.defsElement.appendChild(w),this.gradientCount++}if(C=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,l),t&&t.process&&a&&!C?(a=!1,i="[object Array]"===Object.prototype.toString.call(x.color)&&A.isNullOrUndefined(w)&&A.isNullOrUndefined(x.value)?this.legendGradientColor(x,g):i,this.legendCollections.push({actualValue:o,levelIndex:m?-1:v,leafIndex:m?v:-1,legendName:l,legendFill:i,legendData:[],groupIndex:m?-1:y,gradientElement:A.isNullOrUndefined(w)?A.isNullOrUndefined(x.value)?this.legendLinearGradient:null:w,name:e[c].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[c]),g++):a&&(a=!1,this.legendCollections[t.value].legendData.push(e[c])),!r&&!p&&!n&&A.isNullOrUndefined(x.from)&&A.isNullOrUndefined(x.to)&&A.isNullOrUndefined(x.minOpacity)&&A.isNullOrUndefined(x.maxOpacity)&&A.isNullOrUndefined(x.value)&&!A.isNullOrUndefined(x.color)){F="[object Array]"===Object.prototype.toString.call(x.color)?x.color[0]:x.color,w=A.isNullOrUndefined(x.label)?"Others":x.label,C=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,w),A.isNullOrUndefined(this.outOfRangeLegend)&&!C&&(this.legendCollections.push({actualValue:w,legendData:[],legendName:w,legendFill:F,groupIndex:!m||-1<y?y:-1}),C=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[C-1],g++);for(var O=this.legendCollections.length-1;0<=O;O--)if(this.legendCollections[O].actualValue===(x.label||"Others")){this.legendCollections[O].legendData.push(e[c]);break}}}}},x.prototype.removeDuplicates=function(e,t){for(var i=!1,l=0;l<e.length;l++)if(e[l].legendName===t){i=!0;break}return i},x.prototype.isAddNewLegendData=function(e){var t,i;if(0===this.legendCollections.length)t=!0;else for(var l=0;l<this.legendCollections.length;l++){if(e===this.legendCollections[l].actualValue){t=!1,i=l;break}l===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},x.prototype.drawLegend=function(){var e=this.treemap.legendSettings,t=this.treemap.renderer,i=e.textStyle;if(this.legendGroup=t.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===e.mode)this.drawLegendItem(this.currentPage);else for(var l=0;l<this.legendRenderingCollections.length;l++){var o=this.treemap.element.id+"_Legend_Index_"+l,n=this.treemap.element.id+"_Legend_Index_"+l+"_Text",r=this.legendRenderingCollections[l],a=(a=r.element)?"url(#"+a.id+")":r.fill,s=new j(r.x,r.y,r.width,r.height),d=new ze(r.textX,r.textY),o=new L(o,a,e.shapeBorder,e.opacity,s),a=(this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(o.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+o.height)-Math.abs(this.legendBorderRect.y-o.y),d.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+r.textHeight/2-Math.abs(this.legendBorderRect.y-d.y)):(o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+o.width)-Math.abs(this.legendBorderRect.x-o.x),d.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-d.x))),this.treemap.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(r.text):r.text),s=(Ue(new T(n,d.x,d.y,"middle",a,"",""),i,i.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),t.drawRectangle(o));s.setAttribute("tabindex",this.treemap.tabIndex.toString()),s.style.outline="",this.legendGroup.appendChild(s)}ct(this.treemap,this.legendGroup)},x.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,n=e.Text,e=V(e.DisplayText,l.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),n.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+e.width+t)-Math.abs(this.legendBorderRect.x-n.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)-l.shapeHeight/2,n.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-n.y)),{shapeLocation:o,textLocation:n}},x.prototype.drawLegendItem=function(t){var d,h=this,p=this.treemap,g=10,c=p.legendSettings,m=new W(c.shapeWidth,c.shapeHeight),u=p.renderer,e=c.shapeBorder;if(0<=t&&t<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var y="HorizontalLine"===c.shape||"VerticalLine"===c.shape||"Cross"===c.shape,f=y?A.isNullOrUndefined(c.fill)?"#000000":c.fill:e.color,v=y&&0===e.width?1:e.width,x=this,i=0;i<this.totalPages[t].Collection.length;i++)!function(e){var i=x.totalPages[t].Collection[e],l=x.treemap.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(i.DisplayText):i.DisplayText,o=u.createGroup({id:p.element.id+"_Legend_Index_"+e}),n=(o.setAttribute("aria-label",l+" Legend"),o.setAttribute("role","region"),o.setAttribute("tabindex",x.treemap.tabIndex.toString()),o.style.outline="none",p.element.id+"_Legend_Shape_Index_"+e),r=p.element.id+"_Legend_Text_Index_"+e,a=i.Shape,s=i.Text;p.enableRtl&&(d=x.defaultLegendRtlLocation(i,g,p,c),a=d.shapeLocation,s=d.textLocation),d={cancel:!1,name:ie,treemap:p,fill:i.Fill,shape:c.shape,imageUrl:c.imageUrl},p.trigger(ie,d,function(e){var t=new z(n,e.fill,v,y?i.Fill:f,c.opacity,"");o.appendChild(xt(a,e.shape,m,e.imageUrl,t)),Ue(new T(r,s.x,s.y,"start",l,"",""),c.textStyle,c.textStyle.color||p.themeStyle.legendTextColor,o),h.legendGroup.appendChild(o)})}(i);var l,o,n,r,a,s,S,b,I,C,F,e=void 0,w=g,O=g/2;0!==this.page&&(n=V(l=t+1+"/"+this.totalPages.length,o=c.textStyle),I=this.legendItemRect.x+this.legendItemRect.width-n.width-2*w-g,r=this.legendItemRect.x+this.legendItemRect.width,a=this.legendItemRect.y+this.legendItemRect.height+O/2+g,s=r-w-n.width/2-g/2,e=u.createGroup({id:p.element.id+"_Legend_Paging_Group"}),S=u.createGroup({id:p.element.id+"_Legend_Left_Paging_Group"}),b=u.createGroup({id:p.element.id+"_Legend_Right_Paging_Group"}),F=" M "+r+" "+a+" L "+(r-w)+" "+(a-O)+" L "+(r-w)+" "+(a+O)+" z ",C=new z(p.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,""," M "+I+" "+a+" L "+(I+w)+" "+(a-O)+" L "+(I+w)+" "+(a+O)+" z "),S.appendChild(u.drawPath(C)),C=new L(p.element.id+"_Left_Page_Rect","transparent",{},1,new j(I-w/2,a-2*O,2*w,2*g),""),S.appendChild(u.drawRectangle(C)),this.wireEvents(S),I=new z(p.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",F),b.appendChild(u.drawPath(I)),C=new L(p.element.id+"_Right_Page_Rect","transparent",{},1,new j(r-w,a-O,w,g),""),b.appendChild(u.drawRectangle(C)),this.wireEvents(b),e.appendChild(S),e.appendChild(b),F={id:p.element.id+"_Paging_Text",x:s,y:a+n.height/4,fill:"#a6a6a6","font-size":"14px","font-style":o.fontStyle,"font-family":o.fontFamily,"font-weight":o.fontWeight,"text-anchor":"middle",transform:"",opacity:1,"dominant-baseline":"",role:"region","aria-label":l},e.appendChild(u.createText(F,l)),this.legendGroup.appendChild(e))}},x.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,l=t.titleStyle,i=V(G(this.legendItemRect.width+20,i,l),l),l=(this.legendBorderRect=new j(this.legendItemRect.x-10,this.legendItemRect.y-10-i.height,this.legendItemRect.width+20,this.legendItemRect.height+20+i.height+("Interactive"!==t.mode&&0!==this.page?10:0)),{color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth}),i=new L(e.element.id+"_Legend_Border",t.background,l,1,this.legendBorderRect,""),l=e.renderer.drawRectangle(i);l.style.pointerEvents="none",this.legendGroup.appendChild(l),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)},x.prototype.renderLegendTitle=function(){var e=this.treemap.legendSettings,t=e.titleStyle,e=this.treemap.enableHtmlSanitizer?A.SanitizeHtmlHelper.sanitize(e.title.text):e.title.text,i=G(this.legendItemRect.width+20,e,t),l=V(i,t);e&&((l=Ue(new T(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-l.height/2-5,"middle",i,""),t,t.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup)).setAttribute("role","region"),l.setAttribute("aria-label",e))},x.prototype.renderInteractivePointer=function(e){var t=this.treemap,i=e.target,l=t.element.id+"_Interactive_Legend",o=!1,i=-1<e.type.indexOf("touch")?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):i,n=t.legendSettings;if(-1<i.id.indexOf("_Item_Index")&&n.visible&&0<this.legendRenderingCollections.length)for(var r=void 0,a=void 0,s=t.layout.renderItems[parseFloat(i.id.split("_Item_Index_")[1])],d=t.svgObject.getBoundingClientRect(),h=0;h<this.legendCollections.length&&!o;h++){var p=this.legendCollections[h],g=(a=document.getElementById(t.element.id+"_Legend_Index_"+h)).getBoundingClientRect(),c=new j(Math.abs(g.left-d.left),Math.abs(g.top-d.top),g.width,g.height),m=a.getAttribute("fill"),u=n.shapeBorder.color,y=n.shapeBorder.width;if(!A.isNullOrUndefined(p.legendData)&&0<p.legendData.length){var r=p.legendData,f=t.rangeColorValuePath;if(-1<s.levelOrderName.indexOf(this.legendCollections[h].legendName))this.drawInteractivePointer(n,m,u,l,y,c),o=!0;else for(var v=0;v<r.length;v++)if(t.rangeColorValuePath&&0<t.leafItemSettings.colorMapping.length?r[v].data[f]===s.data[f]:r[v].levelOrderName===s.levelOrderName||-1<r[v].levelOrderName.indexOf(s.levelOrderName)){this.drawInteractivePointer(n,m,u,l,y,c),o=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&-1<s.levelOrderName.indexOf(p.levelOrderName)&&(this.drawInteractivePointer(n,m,u,l,y,c),o=!0)}else this.removeInteractivePointer()},x.prototype.drawInteractivePointer=function(e,t,i,l,o,n){var r,a,e="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(r=n.x+n.width/2)+" "+(a=n.y+n.height)+" L "+(r-10)+" "+(a+10)+" L "+(r+10)+" "+(a+10)+" Z ":" M "+(r=n.x+n.width/2)+" "+(a=n.y)+" L "+(r-10)+" "+(a-10)+" L "+(r+10)+" "+(a-10)+" Z ":e.invertedPointer?" M "+(r=n.x)+" "+(a=n.y+n.height/2)+" L "+(r-10)+" "+(a-10)+" L "+(r-10)+" "+(a+10)+" z ":" M "+(r=n.x+n.width)+" "+(a=n.y+n.height/2)+" L "+(r+10)+" "+(a-10)+" L "+(r+10)+" "+(a+10)+" z ",n=new z(l,t,o,i,1,"",e);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(n))},x.prototype.getLegendAlignment=function(e,t,i,l){var o,n,r=A.extend({},e.areaRect,void 0,!0),a=r.x,s=r.y,d=r.height,h=r.width,p=e.availableSize.width,g=e.availableSize.height,c="Auto"===l.position?g<p?"Right":"Bottom":l.position;if("Float"===l.position)this.translate=l.location;else{switch(c){case"Top":case"Bottom":r.height=d-i,o=p/2-t/2,n="Top"===c?s:s+r.height+10,r.y="Top"===c?s+i+10:s;break;case"Left":case"Right":r.width=h-t,o="Left"===c?a:a+r.width,n=g/2-i/2,r.x="Left"===c?a+t:a}switch(l.alignment){case"Near":"Top"===c||"Bottom"===c?o=r.x:n=r.y;break;case"Far":"Top"===c||"Bottom"===c?o=p-t:n=g-i}this.treemap.totalRect=r,this.translate=new ze(o,n)}},x.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},x.prototype.removeInteractivePointer=function(){var e;document.getElementById(this.treemap.element.id+"_Interactive_Legend")&&(e=document.getElementById(this.treemap.element.id+"_Interactive_Legend")).parentNode.removeChild(e)},x.prototype.changeNextPage=function(e){this.currentPage=-1<e.target.id.indexOf("_Left_Page_")?this.currentPage-1:this.currentPage+1,0<=this.currentPage&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=-1<e.target.id.indexOf("_Left_Page_")?0:this.totalPages.length-1},x.prototype.wireEvents=function(e){A.EventHandler.add(e,A.Browser.touchStartEvent,this.changeNextPage,this)},x.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(A.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(A.Browser.touchEndEvent,this.mouseUpHandler,this))},x.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(A.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(A.Browser.touchEndEvent,this.mouseUpHandler))},x.prototype.getModuleName=function(){return"treeMapLegend"},x.prototype.destroy=function(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},x.prototype.legendGradientColor=function(e,t){var i="http://www.w3.org/2000/svg";if(!A.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),o=document.createElementNS(i,"linearGradient"),n=this.treemap.legendSettings.position,r="Top"===n||"Bottom"===n?"100":"0",n="Top"===n||"Bottom"===n?"0":"100";o.setAttribute("id","linear_"+t),o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2",r+"%"),o.setAttribute("y2",n+"%");for(var a=0;a<e.color.length;a++){var s=100/(e.color.length-1),d=document.createElementNS(i,"stop");d.setAttribute("offset",a*s+"%"),d.setAttribute("stop-color",e.color[a]),d.setAttribute("stop-opacity",1..toString()),o.appendChild(d)}l.appendChild(o),this.legendLinearGradient=o;r="url(#linear_"+t+")";this.defsElement.appendChild(o),n=r}return n},x);function x(e){this.page=0,this.legendBorderRect=new j(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new j(0,0,0,0),this.treemap=e,this.addEventListener()}S.prototype.mouseMove=function(e){e=e.target;return this.highlightOnMouseMove(e)},S.prototype.highlightOnMouseMove=function(e){var t,i=this.treemap,l=e.id,o=[],n=this.treemap.highlightSettings,r=[],a=this.treemap.treeMapSelectionModule,s=!1;if(a&&0<a.legendSelectionCollection.length)for(var d=0;d<a.legendSelectionCollection.length;d++)for(var h=0;h<a.legendSelectionCollection[d].ShapeCollection.Elements.length;h++){var p=parseFloat(a.legendSelectionCollection[d].ShapeCollection.Elements[h].id.split("Item_Index_")[1].split("_")[0]),g=-1<l.indexOf("_Item_Index_")?parseFloat(l.split("Item_Index_")[1].split("_")[0]):null;if(a.legendSelectionCollection[d].ShapeCollection.Elements[h].id===l||p===g){s=!0;break}}if(-1<l.indexOf("_Item_Index")&&!s){if(this.highLightId!==l||this.legendHighlightCollection[0]&&1<this.legendHighlightCollection[0].ShapeCollection.Elements.length){var c=document.getElementById(i.element.id+"_TreeMap_"+i.layoutType+"_Layout"),m=document.getElementsByClassName("treeMapSelection"),e=(S=this.treemap.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])],void 0);this.treemap.legendSettings.visible&&(M=this.treemap.treeMapLegendModule.legendCollections,I=this.treemap.treeMapLegendModule.legendCollections.length,e=!i.legendSettings.removeDuplicateLegend&&i.palette&&0<i.palette.length&&0===i.leafItemSettings.colorMapping.length&&0===i.levels.length?parseFloat(l.split("_Item_Index_")[1]):wt(I,S,i),A.isNullOrUndefined(e)&&(B(this.legendHighlightCollection,i),B(this.shapeHighlightCollection,i),this.legendHighlightCollection=[],i.treeMapLegendModule.removeInteractivePointer()),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+e):document.getElementById(this.treemap.element.id+"_Legend_Index_"+e),null!==this.shapeElement)&&(a&&this.shapeElement.id===(a&&a.shapeElement?a.shapeElement.id:null)?0<this.currentElement.length&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(Ft(this.shapeHighlightCollection,this.currentElement,i),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),B(this.shapeHighlightCollection,i),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:M[e].legendFill,oldOpacity:M[e].opacity,oldBorderColor:M[e].borderColor,oldBorderWidth:M[e].borderWidth}),R("Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+e):document.getElementById(this.treemap.element.id+"_Legend_Index_"+e+"_Text"),n.fill,n.opacity,null,null),R(this.shapeElement,n.fill,n.opacity,n.border.color,n.border.width.toString()),this.target="highlight"));for(var u=Ve(S,[],n.mode,i),d=0;d<c.childElementCount;d++){for(var y=c.childNodes[d],f=!0,v=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,x=i.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])],S=i.layout.renderItems[parseFloat(y.id.split("_Item_Index_")[1])],h=0;h<m.length;h++)if(y.id===m[h].id||y.id===m[h].parentElement.id){f=!1;break}-1<u.indexOf(S.levelOrderName)&&f&&(A.isNullOrUndefined(v)||S.data[v]===x.data[v]||"Item"!==n.mode&&0<i.levels.length)&&(r.push(y),o.push(S))}D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i);for(var b=0;b<r.length;b++)P((y=r[b]).childNodes[0],{border:n.border,fill:n.fill,opacity:n.opacity}),y.classList.add("treeMapHighLight"),this.highLightId=l;i.trigger(J,{cancel:!1,name:J,treemap:i,items:o,elements:r})}}else if(-1<l.indexOf("_Legend_Shape")||-1<l.indexOf("_Legend_Index")||-1<l.indexOf("_Legend_Text_Index")){A.isNullOrUndefined(a)||(a.legendSelectId=A.isNullOrUndefined(i.legendId[0])?null:i.legendId[0]);var I=a&&a.legendSelectId?parseFloat(a.legendSelectId.split("Index_")[1]):a&&a.shapeSelectId?parseFloat(a.shapeSelectId.split("Index_")[1]):null,C="Default"===this.treemap.legendSettings.mode?-1===l.indexOf("Text")?parseFloat(l.split("_Legend_Shape_Index_")[1]):parseFloat(l.split("_Legend_Text_Index_")[1]):parseFloat(l.split("_Legend_Index_")[1]);if(this.treemap.legendSettings.visible&&C!==I){for(var F,w=void 0,O=void 0,v=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,L=document.getElementById(l),T=("highlight"===this.shapeTarget&&(B(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight",this.treemap.treeMapLegendModule.legendCollections[C].legendData.length),M=this.treemap.treeMapLegendModule.legendCollections,d=0;d<T;d++)for(var N,h=0;h<this.treemap.layout.renderItems.length;h++)(!A.isNullOrUndefined(v)&&0<i.leafItemSettings.colorMapping.length&&0===i.levels.length?i.treeMapLegendModule.legendCollections[C].legendData[d].data[v]===i.layout.renderItems[h].data[v]:i.treeMapLegendModule.legendCollections[C].legendData[d].levelOrderName===i.layout.renderItems[h].levelOrderName)&&(w=h,O=this.treemap.layout.renderItems[h].groupIndex,_=document.getElementById(this.treemap.element.id+"_Level_Index_"+O+"_Item_Index_"+w+"_RectPath"),N=void(0!==d&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],Ot(this.legendHighlightCollection,C,h,L,_,this.treemap.layout.renderItems,M),F=this.legendHighlightCollection.length,this.legendHighlightCollection[F-1].ShapeCollection={Elements:[]})),-1<L.id.indexOf("Text")?(N="Interactive"===this.treemap.legendSettings.mode?document.getElementById(L.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+C),R(L,n.fill,n.opacity,null,null),R(N,n.fill,n.opacity,n.border.color,n.border.width.toString())):(R("Interactive"===this.treemap.legendSettings.mode?document.getElementById(L.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+C),n.fill,n.opacity,null,null),R(L,n.fill,n.opacity,n.border.color,n.border.width.toString())),R(_,n.fill,n.opacity,n.border.color,n.border.width.toString()),F=this.legendHighlightCollection.length,this.legendHighlightCollection[F-1].ShapeCollection.Elements.push(_));if(0===T&&this.treemap.palette&&0<this.treemap.palette.length)for(var _,E,h=0;h<this.treemap.layout.renderItems.length;h++)!(this.treemap.treeMapLegendModule.legendCollections[C].levelOrderName===this.treemap.layout.renderItems[h].levelOrderName||-1<this.treemap.layout.renderItems[h].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[C].levelOrderName))||!this.treemap.legendSettings.removeDuplicateLegend&&i.palette&&0<i.palette.length&&!this.treemap.layout.renderItems[h].parent.isDrilled&&C!==h||(w=h,O=this.treemap.layout.renderItems[h].groupIndex,_=document.getElementById(this.treemap.element.id+"_Level_Index_"+O+"_Item_Index_"+w+"_RectPath"),Ot(this.legendHighlightCollection,C,h,L,_,this.treemap.layout.renderItems,M),F=this.legendHighlightCollection.length,E=void(this.legendHighlightCollection[F-1].ShapeCollection={Elements:[]}),-1<L.id.indexOf("Text")?(E="Interactive"===this.treemap.legendSettings.mode?document.getElementById(L.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+C),R(L,n.fill,n.opacity,null,null),R(E,n.fill,n.opacity,n.border.color,n.border.width.toString())):(R(E="Interactive"===this.treemap.legendSettings.mode?document.getElementById(L.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+C),n.fill,n.opacity,null,null),R(L,n.fill,n.opacity,n.border.color,n.border.width.toString())),R(_,n.fill,n.opacity,n.border.color,n.border.width.toString()),F=this.legendHighlightCollection.length,this.legendHighlightCollection[F-1].ShapeCollection.Elements.push(_))}else D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i),B(this.legendHighlightCollection,i),this.legendHighlightCollection=[]}else a&&this.shapeElement&&this.shapeElement.getAttribute("id")===a.legendSelectId||(a?this.shapeElement!==a.shapeElement:this.treemap.legendSettings.visible)&&D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||a&&this.shapeElement&&this.shapeElement.getAttribute("id")===a.legendSelectId||a&&this.shapeElement===a.shapeElement||(B(this.shapeHighlightCollection,i),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&B(this.legendHighlightCollection,this.treemap),this.highLightId="",t=!1;return t},S.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(A.Browser.touchMoveEvent,this.mouseMove,this)},S.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(A.Browser.touchMoveEvent,this.mouseMove)},S.prototype.getModuleName=function(){return"treeMapHighlight"},S.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null};var kt=S;function S(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}b.prototype.mouseDown=function(e){var t=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},b.prototype.selectionOnMouseDown=function(t){var e=this.treemap,i=(t.setAttribute("tabindex","-1"),t.style.outline="none",t.id.includes("Legend_Shape_Index")||t.focus(),[]),l=t.id,o=t.innerHTML,n=[],r=e.selectionSettings,a=this.treemap.treeMapHighlightModule,s=e.element.id+"_TreeMap_"+e.layoutType+"_Layout",d=(y=e.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])])&&!y.isLeafItem&&e.enableDrillDown&&(-1<t.textContent.indexOf("[+]")||-1<t.textContent.indexOf("[-]")||!A.isNullOrUndefined(t.nextElementSibling)&&(-1<t.nextSibling.textContent.indexOf("[+]")||-1<t.nextSibling.textContent.indexOf("[-]")));if(-1<l.indexOf("_Item_Index")&&!d)if(this.treemap.selectionId!==l&&(!e.selectionId||parseFloat(e.selectionId.split("_Item_Index_")[1])!==parseFloat(l.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&1<this.legendSelectionCollection[0].ShapeCollection.Elements.length){e.levelSelection=[],e.legendId=[],this.shapeSelectId="",B(this.legendSelectionCollection,e),this.legendSelectionCollection=[];var h=document.getElementById(s),p=void 0;this.treemap.legendSettings.visible&&(this.shapeSelect=!1,s=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections,this.shapeElement=void 0,B(this.shapeSelectionCollection,e),a&&(a.shapeTarget="selection",a.shapeHighlightCollection=[]),p=!e.legendSettings.removeDuplicateLegend&&e.palette&&0<e.palette.length&&0===e.leafItemSettings.colorMapping.length&&0===e.levels.length?parseFloat(l.split("_Item_Index_")[1]):wt(s,y,e),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p):document.getElementById(this.treemap.element.id+"_Legend_Index_"+p),null!==this.shapeElement)&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[p].legendFill,oldOpacity:b[p].opacity,oldBorderColor:b[p].borderColor,oldBorderWidth:b[p].borderWidth}),R(M="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p):document.getElementById(this.treemap.element.id+"_Legend_Index_"+p+"_Text"),r.fill,r.opacity,null,null),R(this.shapeElement,r.fill,r.opacity,r.border.color,r.border.width.toString()),e.legendId.push(this.shapeElement.id),e.legendId.push(M.id));for(var g=Ve(y,[],r.mode,e),c=0;c<h.childElementCount;c++){var m=h.childNodes[c],u=e.layout.renderItems[parseFloat(l.split("_Item_Index_")[1])],y=e.layout.renderItems[parseFloat(m.id.split("_Item_Index_")[1])],f=""!==e.rangeColorValuePath?e.rangeColorValuePath:null;-1<g.indexOf(y.levelOrderName)&&(A.isNullOrUndefined(f)||y.data[f]===u.data[f]||"Item"!==r.mode&&0<e.levels.length)&&(n.push(m),-1<l.indexOf("_RectPath")&&e.levelSelection.push(m.id),i.push(y))}D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId=l;for(var v=document.getElementsByClassName("treeMapHighLight"),x=0;x<n.length;x++){if(m=n[x],0<v.length)for(var S=0;S<v.length;S++)v[S].id===m.id&&v[S].classList.remove("treeMapHighLight"),P(m.childNodes[0],{border:r.border,fill:r.fill,opacity:r.opacity}),m.classList.add("treeMapSelection");else P(m.childNodes[0],{border:r.border,fill:r.fill,opacity:r.opacity}),m.classList.add("treeMapSelection");e.trigger(X,{cancel:!1,name:X,treemap:e,items:i,elements:n,text:o,contentItemTemplate:o},function(e){e.contentItemTemplate!==o&&ke(l,t,e.contentItemTemplate)})}}else B(this.legendSelectionCollection,e),B(this.shapeSelectionCollection,e),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId="");else if(-1<l.indexOf("_Legend_Shape")||-1<l.indexOf("_Legend_Index")||-1<l.indexOf("_Legend_Text_")){var b=this.treemap.treeMapLegendModule.legendCollections,s=A.isNullOrUndefined(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&s!==parseFloat(l.split("_Index_")[1])){for(var I,C=void 0,F=void 0,w=(e.legendId=[],e.levelSelection=[],this.legendSelectId=l,this.legendSelect=!1,isNaN(parseInt(l[l.length-1],10))?parseInt(l[l.length-6],10):parseInt(l[l.length-1],10)),O=document.getElementById(l),f=(B(this.legendSelectionCollection,e),D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),B(this.shapeSelectionCollection,e),this.legendSelectionCollection=[],a&&(a.shapeTarget="selection",a.legendHighlightCollection=[]),""!==e.rangeColorValuePath?e.rangeColorValuePath:null),p="Default"===this.treemap.legendSettings.mode?-1===l.indexOf("Text")?parseFloat(l.split("_Legend_Shape_Index_")[1]):parseFloat(l.split("_Legend_Text_Index_")[1]):parseFloat(l.split("_Legend_Index_")[1]),L=this.treemap.treeMapLegendModule.legendCollections[p].legendData.length,x=0;x<L;x++)for(var T,M,N=0;N<this.treemap.layout.renderItems.length;N++)(!A.isNullOrUndefined(f)&&0<e.leafItemSettings.colorMapping.length&&0===e.levels.length?e.treeMapLegendModule.legendCollections[p].legendData[x].data[f]===e.layout.renderItems[N].data[f]:this.treemap.treeMapLegendModule.legendCollections[p].legendData[x].levelOrderName===this.treemap.layout.renderItems[N].levelOrderName)&&(C=N,F=this.treemap.layout.renderItems[N].groupIndex,_=document.getElementById(this.treemap.element.id+"_Level_Index_"+F+"_Item_Index_"+C+"_RectPath"),this.treemap.selectionId=_.id,0!==x&&0!==this.legendSelectionCollection.length||(Ot(this.legendSelectionCollection,w,N,O,_,this.treemap.layout.renderItems,b),I=this.legendSelectionCollection.length,this.legendSelectionCollection[I-1].ShapeCollection={Elements:[]}),T=void(this.treemap.selectionId=_.id),M=void 0,-1<O.id.indexOf("Text")?(R(T="Interactive"===this.treemap.legendSettings.mode?document.getElementById(O.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p),r.fill,r.opacity,r.border.color,r.border.width.toString()),R(O,r.fill,r.opacity,null,null),this.legendSelectId=T.id,this.shapeElement=T,e.legendId.push(O.id),e.legendId.push(T.id)):(R(M="Interactive"===this.treemap.legendSettings.mode?document.getElementById(O.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p),r.fill,r.opacity,null,null),R(O,r.fill,r.opacity,r.border.color,r.border.width.toString()),this.shapeElement=O,e.legendId.push(O.id),e.legendId.push(M.id)),R(_,r.fill,r.opacity,r.border.color,r.border.width.toString()),I=this.legendSelectionCollection.length,e.levelSelection.push(_.id),this.legendSelectionCollection[I-1].ShapeCollection.Elements.push(_));if(0===L&&this.treemap.palette&&0<this.treemap.palette.length)for(var _,E,S=0;S<this.treemap.layout.renderItems.length;S++)!(this.treemap.treeMapLegendModule.legendCollections[p].levelOrderName===this.treemap.layout.renderItems[S].levelOrderName||-1<this.treemap.layout.renderItems[S].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[p].levelOrderName))||!this.treemap.legendSettings.removeDuplicateLegend&&e.palette&&0<e.palette.length&&!this.treemap.layout.renderItems[S].parent.isDrilled&&p!==S||(C=S,F=this.treemap.layout.renderItems[S].groupIndex,_=document.getElementById(this.treemap.element.id+"_Level_Index_"+F+"_Item_Index_"+C+"_RectPath"),Ot(this.legendSelectionCollection,p,S,O,_,this.treemap.layout.renderItems,b),this.treemap.selectionId=_.id,I=this.legendSelectionCollection.length,E=void(this.legendSelectionCollection[I-1].ShapeCollection={Elements:[]}),-1<O.id.indexOf("Text")?(E="Interactive"===this.treemap.legendSettings.mode?document.getElementById(O.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+p),R(O,r.fill,r.opacity,null,null),R(E,r.fill,r.opacity,r.border.color,r.border.width.toString()),this.legendSelectId=E.id,this.shapeElement=E):(R(E="Interactive"===this.treemap.legendSettings.mode?document.getElementById(O.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+p),r.fill,r.opacity,null,null),R(O,r.fill,r.opacity,r.border.color,r.border.width.toString()),this.legendSelectId=l,this.shapeElement=O),R(_,r.fill,r.opacity,r.border.color,r.border.width.toString()),e.levelSelection.push(_.id),-1===e.legendId.indexOf(E.id)&&e.legendId.push(E.id),-1===e.legendId.indexOf(O.id)&&e.legendId.push(O.id),I=this.legendSelectionCollection.length,this.legendSelectionCollection[I-1].ShapeCollection.Elements.push(_))}else B(this.legendSelectionCollection,this.treemap),B(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],a&&(a.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",e),this.treemap.selectionId="")}else d&&(B(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},b.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,l=0;l<this.treemap.layout.renderItems.length;l++)if(e===this.treemap.layout.renderItems[l].levelOrderName){i=this.treemap.layout.renderItems[l];break}for(var o=this.treemap.selectionSettings,n=[],r=void 0,a=[],t=(this.treemap.levelSelection=[],this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout"),s=document.getElementById(t),d=Ve(i,[],o.mode,this.treemap),h=0;h<s.childElementCount;h++)r=s.childNodes[h],i=this.treemap.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])],-1<d.indexOf(i.levelOrderName)&&(n.push(r),this.treemap.levelSelection.push(r.id),a.push(i));if(this.treemap.legendSettings.visible)for(var p=0;p<a.length;p++){this.shapeSelect=!1;var g=this.treemap.treeMapLegendModule.legendCollections.length,c=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Ct(this.shapeSelectionCollection),g=wt(g,a[p],this.treemap),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+g):document.getElementById(this.treemap.element.id+"_Legend_Index_"+g),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.treemap.legendId.push(this.shapeSelectId),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:c[g].legendFill,oldOpacity:c[g].opacity,oldBorderColor:c[g].borderColor,oldBorderWidth:c[g].borderWidth}),R(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap);for(var t=document.getElementById(this.treemap.levelSelection[0]),m=(this.treemap.selectionId=t.childNodes[0].id,document.getElementsByClassName("treeMapHighLight")),u=0;u<n.length;u++)if(r=n[u],0<m.length)for(var y=0;y<m.length;y++)m[y].id===r.id&&m[y].classList.remove("treeMapHighLight"),P(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection");else o.fill=("null"===o.fill?this.treemap.layout.renderItems[parseInt(r.id.split("Item_Index_")[1],10)].options:o).fill,P(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection")}else Ct(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],D(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},b.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(A.Browser.touchStartEvent,this.mouseDown,this)},b.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(A.Browser.touchStartEvent,this.mouseDown)},b.prototype.getModuleName=function(){return"treeMapSelection"},b.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null};var At=b;function b(e){this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeSelect=!0,this.legendSelect=!0,this.treemap=e,this.addEventListener()}var Wt=function(e,t){var i={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(i[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&(i[o[l]]=e[o[l]]);return i},jt=(I.prototype.renderTooltip=function(e){var t,i,l,o,n,r,a=this,s=(t=(-1!==e.type.indexOf("touch")?(this.isTouch=!0,p=e.changedTouches[0].pageX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,p=e.pageX,e)).pageY,e.target),d=s.id,h=[];if(-1<d.indexOf("_Item_Index")&&-1===e.type.indexOf("key")){if(d=this.treemap.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])],!A.isNullOrUndefined(d)){o=d.weight,n=d.data,A.isNullOrUndefined(d.options)||(r=d.options.fill),h=this.treemap.enableRtl?[(A.isNullOrUndefined(this.tooltipSettings.format)?null:mt(this.tooltipSettings.format,n,this.treemap))||ut(o,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(A.isNullOrUndefined(this.tooltipSettings.format)?null:mt(this.tooltipSettings.format,n,this.treemap))||this.treemap.weightValuePath.toString()+" : "+ut(o,this.treemap)],document.getElementById(this.tooltipId)?l=document.getElementById(this.tooltipId):((l=A.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(l)),(o=Ke(p,t,this.treemap.svgObject)).y=this.tooltipSettings.template?o.y+10:o.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=A.isNullOrUndefined(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var p={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};if(this.treemap.enableHtmlSanitizer)for(var g=0;g<h.length;g++)h[g]=A.SanitizeHtmlHelper.sanitize(h[g]);i={cancel:!1,name:Y,item:d,options:{location:o,text:h,data:n,border:p,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:s,eventArgs:e},this.treemap.trigger(Y,i,function(e){a.addTooltip(i,r,l)})}}else this.removeTooltip(),this.treemap.clearTemplate()},I.prototype.addTooltip=function(e,t,i,l){var o;l=A.isNullOrUndefined(e)?(o=l.cancel,l):(o=e.cancel,Wt(e,["cancel"]).options),o?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new C.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:l.data,template:l.template,content:l.text,shapes:[],location:l.location,palette:[t],areaBounds:this.treemap.areaRect,textStyle:l.textStyle,fill:this.treemap.tooltipSettings.fill||this.treemap.themeStyle.tooltipFillColor,border:l.border,enableShadow:!0}),(this.treemap.isVue||this.treemap.isVue3)&&(this.svgTooltip.controlInstance=this.treemap),this.svgTooltip.opacity=this.treemap.themeStyle.tooltipFillOpacity||this.svgTooltip.opacity,this.svgTooltip.appendTo(i),this.treemap.renderReactTemplates())},I.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},I.prototype.removeTooltip=function(){var e;0<document.getElementsByClassName("EJ2-TreeMap-Tooltip").length&&(e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0]).parentNode.removeChild(e)},I.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(A.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(A.Browser.touchEndEvent,this.mouseUpHandler,this))},I.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(A.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(A.Browser.touchEndEvent,this.mouseUpHandler))},I.prototype.getModuleName=function(){return"treeMapTooltip"},I.prototype.destroy=function(){A.isNullOrUndefined(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,Tt(this.treemap.element.id+"_TreeMapTooltip")),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},I);function I(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}e.Border=l,e.ColorMapping=Se,e.ColorValue=yt,e.CommonTitleSettings=pe,e.Font=n,e.HighlightSettings=De,e.ImageExport=Dt,e.InitialDrillSettings=Fe,e.LayoutPanel=Mt,e.LeafItemSettings=Le,e.LegendSettings=Ie,e.LevelSettings=t,e.LevelsData=Ut,e.Location=ze,e.Margin=se,e.PathOption=z,e.PdfExport=Bt,e.Print=_t,e.Rect=j,e.RectOption=L,e.SelectionSettings=_e,e.Size=W,e.SubTitleSettings=me,e.TextOption=T,e.TitleSettings=fe,e.TooltipSettings=Me,e.TreeMap=i,e.TreeMapAjax=It,e.TreeMapHighlight=kt,e.TreeMapLegend=f,e.TreeMapSelection=At,e.TreeMapTooltip=jt,e.applyOptions=P,e.beforePrint=E,e.click=$,e.colorCollections=it,e.colorMap=et,e.colorNameToHex=u,e.componentToHex=m,e.convertElement=qe,e.convertHexToColor=vt,e.convertToContainer=Qe,e.convertToHexCode=ft,e.convertToRect=$e,e.createTextStyle=Re,e.deSaturationColor=tt,e.defaultFont=ne,e.doubleClick=K,e.drawSymbol=xt,e.drillEnd=q,e.drillStart=k,e.findChildren=H,e.findHightLightItems=Ve,e.findLabelLocation=Xe,e.findPosition=He,e.formatValue=ut,e.getArea=Ye,e.getColorByValue=ot,e.getElement=Ae,e.getGradientColor=nt,e.getLegendIndex=wt,e.getMousePosition=Ke,e.getPercentage=at,e.getPercentageColor=rt,e.getShortestEdge=Ze,e.getTemplateFunction=Ge,e.getThemeStyle=Nt,e.hide=ht,e.isContainsData=je,e.isParentItem=bt,e.itemClick=Z,e.itemHighlight=J,e.itemMove=Q,e.itemRendering=U,e.itemSelected=X,e.itemsToOrder=We,e.legendItemRendering=ie,e.legendMaintain=ct,e.legendRendering=le,e.load=N,e.loaded=_,e.maintainSelection=gt,e.measureElement=Je,e.measureText=V,e.mouseMove=te,e.orderByArea=pt,e.pushCollection=Ot,e.removeClassNames=D,e.removeElement=Tt,e.removeLegend=B,e.removeSelectionWithHighlight=Ft,e.removeShape=Ct,e.renderLegendShape=St,e.renderTextElement=Ue,e.resize=oe,e.rgbToHex=lt,e.rightClick=ee,e.setColor=R,e.setItemTemplateContent=ke,e.stringToNumber=Be,e.textFormatter=mt,e.textTrim=G,e.textWrap=dt,e.tooltipRendering=Y,e.triggerDownload=Lt,e.wordWrap=st,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
2
|
//# sourceMappingURL=ej2-treemap.umd.min.js.map
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: ej2-treemap.min.js
|
|
3
|
-
* version : 31.2.12
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
this.ej=this.ej||{},this.ej.treemap=function(e,t,i,l,o){"use strict";function n(e,t){return null!==e&&void 0!==e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}function r(e,i){var l=document.getElementById("treeMapMeasureText");return null===l&&(l=t.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(l)),l.innerHTML=t.SanitizeHtmlHelper.sanitize(e),l.style.position="absolute",l.style.fontSize=i.size,l.style.fontWeight=i.fontWeight,l.style.fontStyle=i.fontStyle,l.style.fontFamily=i.fontFamily,l.style.visibility="hidden",l.style.top="-100",l.style.left="0",l.style.whiteSpace="nowrap",l.style.lineHeight="normal",new Ce(l.clientWidth,l.clientHeight)}function a(e,t,i){var l=t,o=r(t,i).width;if(o>e)for(var n=t.length-1;n>=0;--n)if(l=t.substring(0,n)+"...",(o=r(l,i).width)<=e||l.length<4)return l.length<4&&(l=" "),l;return l}function s(e,t,i,l){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}var n="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new Te(o,n)}function d(e,t,i){var l=e.createText(t,i);return l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),l.style["user-select"]="none",l.style["-moz-user-select"]="none",l.style["-webkit-touch-callout"]="none",l.style["-webkit-user-select"]="none",l.style["-khtml-user-select"]="none",l.style["-ms-user-select"]="none",l.style["-o-user-select"]="none",l}function h(e,l,o,n,a){void 0===a&&(a=!1);var s,h,p,g={"font-size":l.size,"font-style":l.fontStyle,"font-family":l.fontFamily,"font-weight":l.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:l.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:o},c="string"==typeof e.text?e.text:a?e.text[e.text.length-1]:e.text[0],m=new i.SvgRenderer("");if(!t.isNullOrUndefined(c)&&!t.isNullOrUndefined(e.connectorText)&&c.includes(e.connectorText[1]))for(var u=c.split("#"),f=0;f<u.length;f++){var y=-1===u[f].search(e.connectorText)||t.isNullOrUndefined(e.connectorText)?u[f]:e.connectorText;if(g.id=e.id+"_"+f,p=d(m,g,y),f%2==0&&0!==f){y=y.replace(/\s+/g," ")}var v=r(y,l);g.x=0!==f?g.x+v.width:g.x+v.width+5,n.appendChild(p)}else p=d(m,g,c),n.appendChild(p);if("string"!=typeof e.text&&e.text.length>1){for(var S=1,x=e.text.length;S<x;S++)h=r(e.text[S],l).height,s=m.createTSpan({x:e.x,id:e.id,y:e.y+S*h},e.text[S]),p.appendChild(s);n.appendChild(p)}return p}function p(e,i,l){var o,n=e.split("_RectPath")[0];o=e.indexOf("_LabelTemplate")>-1?i:document.querySelector("#"+n+"_LabelTemplate"),t.isNullOrUndefined(o)||(o.innerHTML=l)}function g(e){return document.getElementById(e)}function c(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function m(e,t,i,l){for(var o,n=!1,r="",a=l.leafItemSettings,s=0;s<e.length;s++){var d=i[o=l.levels[s]?l.levels[s].groupPath:a.labelPath?a.labelPath:l.weightValuePath]||"undefined";if(e[s]===d&&(r+=d+(s===e.length-1?"":"#"))===t){n=!0;break}}return n}function u(e){var t;if(e){var i=Object.keys(e);t={};for(var l=0;l<i.length;l++)if(e[i[l]]instanceof Array){t.values=e[i[l]],t.key=i[l];break}}return t}function f(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=u(e).values;if(o&&o.length>0){for(s=0;s<o.length;s++)-1===t.indexOf(o[s].levelOrderName)&&t.push(o[s].levelOrderName);for(var n=0;n<o.length;n++)f(o[n],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),f(e.parent,t,i,l));else if("All"===i)for(var r=e.levelOrderName.split("#")[0],a=void 0,s=0;s<l.layout.renderItems.length;s++)(a=l.layout.renderItems[s]).levelOrderName.indexOf(r)>-1&&-1===t.indexOf(a.levelOrderName)&&t.push(a.levelOrderName);else t.push(e.levelOrderName);return t}function y(e){var i=null;try{i="function"!=typeof e&&document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(l){i=t.compile(e)}return i}function v(e,i,l){var o=t.createElement("div",{id:i});o.style.cssText="position: absolute;pointer-events: auto;";for(var n=e.length;n>0;)o.appendChild(e[0]),n--;for(var r=o.innerHTML,a=Object.keys(l),s=0;s<a.length;s++){var d=RegExp;r=r.replace(new d("{{:"+a[s]+"}}","g"),l[a[s].toString()])}return o.innerHTML=r,o}function S(e,t,i,l,o){var n=new Te(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(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?n.y=Math.abs(a-(t.indexOf("Top")>-1?"Template"===l?e.y:e.y+i.height:t.indexOf("Bottom")>-1?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):n.y=Math.abs(e.y+e.height-i.height+5),n}function x(e,t){var i=new Ce(0,0);t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth;var l=document.getElementById(e.id);return l.parentNode.removeChild(l),i}function b(e){return(e.width-e.x)*(e.height-e.y)}function I(e){var t=C(e),i=t.width,l=t.height;return Math.min(i,l)}function C(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function F(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function w(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,a=i.ownerDocument.documentElement.clientLeft,s=l.left+o-a,d=l.top+n-r;return new Te(e-s,t-d)}function O(e,i,l){var o,n,r=[];if(t.isNullOrUndefined(i)&&t.isNullOrUndefined(l)&&isNaN(l))return null;for(var a=0;a<e.length;a++){var s=!1,d=l;t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to)||t.isNullOrUndefined(e[a].value)?(t.isNullOrUndefined(e[a].from)||t.isNullOrUndefined(e[a].to))&&t.isNullOrUndefined(e[a].value)||(l>=e[a].from&&e[a].to>=l||e[a].value===i)&&(e[a].value===i&&(s=!0),o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],d):e[a].color):l>=e[a].from&&e[a].to>=l&&e[a].value===i&&(s=!0,o="[object Array]"===Object.prototype.toString.call(e[a].color)?s?e[a].color[0]:T(e[a],d):e[a].color),(l>=e[a].from&&l<=e[a].to||e[a].value===i)&&!t.isNullOrUndefined(e[a].minOpacity)&&!t.isNullOrUndefined(e[a].maxOpacity)&&o&&(n=L(e[a],l)),(""===o||t.isNullOrUndefined(o))&&t.isNullOrUndefined(e[a].from)&&t.isNullOrUndefined(e[a].to)&&t.isNullOrUndefined(e[a].minOpacity)&&t.isNullOrUndefined(e[a].maxOpacity)&&t.isNullOrUndefined(e[a].value)&&(o="[object Array]"===Object.prototype.toString.call(e[a].color)?e[a].color[0]:e[a].color),n=t.isNullOrUndefined(n)?"1":n,r.push(o)}for(var h=r.length-1;h>=0;h--)h=(o=r[h])?-1:h;return{fill:o,opacity:n}}function L(e,t){var i=1;return t>=e.from&&t<=e.to&&(i=(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity),i.toString()}function T(e,t){return N(e,t)}function M(e,t,i){return"#"+G(e)+G(t)+G(i)}function N(e,t){var i;return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:M((i=_(Number(t),e)).r,i.g,i.b)}function _(e,t){var i=t.from,l=t.to,o=0,n=l-i;o=(e-i)/n;var r,a;if(t.color.length<=2)r="#"===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{r="#"===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=n/(t.color.length-1),d=t.color.length-1,h=[],p={},g=1;g<d;g++)p={b:i+g*s,color:t.color[g]},h.push(p);for(var c=0;c<h.length;c++)i<=e&&e<=h[c].b&&0===c?(a="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),o=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s):h[c].b<=e&&e<=l&&c===h.length-1&&(r="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),o=e<h[c].b?1-Math.abs((e-h[c].b)/s):(e-h[c].b)/s),c!==h.length-1&&c<h.length&&h[c].b<=e&&e<=h[c+1].b&&(r="#"===h[c].color.charAt(0)?h[c].color:X(h[c].color),a="#"===h[c+1].color.charAt(0)?h[c+1].color:X(h[c+1].color),o=Math.abs(e-h[c+1].b)/s)}return E(o,r,a)}function E(e,t,i){var l=i.split("#")[1],o=t.split("#")[1],n=D(e,parseInt(o.substr(0,2),16),parseInt(l.substr(0,2),16)),r=D(e,parseInt(o.substr(2,2),16),parseInt(l.substr(2,2),16)),a=D(e,parseInt(o.substr(4,2),16),parseInt(l.substr(4,2),16));return new Me(n,r,a)}function D(e,t,i){var l=i-t;return Math.round(t+l*e)}function P(e,t,i){for(var l,o=t.split(" "),n="",s=[],d=0,h=o.length;d<h;d++)l=o[d],r(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(s.push(a(e,n,i)),n=l):(s.push(a(e,l,i)),l=""),n&&d===h-1&&s.push(a(e,n,i));return s}function B(e,t,i){var l=[],o=0,n=r(t,i).width,a=t.length;if(e>=n)return l.push(t),l;for(var s=t.length;s>o;s--){var d=t.slice(o,s);if((n=r(d,i).width)<=e){if(l.push(d),o+=d.length,a===o)return l;s=a+1}}return l}function z(e,t,i,l){var o=r(i,l);return o.width>e||o.height>t?" ":i}function H(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function R(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?t.childElementCount>0&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),A(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function U(e,i){var l=e.legendId;if(l)for(var o=0;o<l.length;o++)if("Interactive"===e.legendSettings.mode){for(var n=0;n<i.childElementCount;n++)if(i.childNodes[n].id===l[o]||parseFloat(i.childNodes[n].id.split("Index_")[1])===parseFloat(l[o].split("Index_")[1])){var r=i.childNodes[n];r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),r.setAttribute("stroke",e.selectionSettings.border.color)):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null))}}else{var a=document.getElementById(l[o]);t.isNullOrUndefined(a)||(a.setAttribute("fill",e.selectionSettings.fill),a.setAttribute("opacity",e.selectionSettings.opacity),-1===a.id.indexOf("Text")?(a.setAttribute("stroke",e.selectionSettings.border.color),a.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(a.setAttribute("stroke",null),a.setAttribute("stroke-width",null)))}}function k(e,i,l){for(var o,n=0;n<e.length;n++)A(o=t.isNullOrUndefined(e[n].childNodes[0])?e[n]:e[n].childNodes[0],l.layout.renderItems[parseFloat(o.id.split("_Item_Index_")[1])].options),e[n].classList.remove(i),n-=1}function A(e,i){e.setAttribute("opacity",i.opacity),t.isNullOrUndefined(i.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",i.fill),e.setAttribute("stroke",i.border.color),e.setAttribute("stroke-width",i.border.width)}function W(e,i,l){if(t.isNullOrUndefined(e))return null;for(var o=0,n=Object.keys(i);o<n.length;o++){var r=n[o];e=e.split("${"+r+"}").join(j(i[r],l).toString())}return e}function j(e,t){return(t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e)||""}function V(e){return"#"+G(e.r)+G(e.g)+G(e.b)}function G(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 Me(parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)):new Me(255,255,255)}function X(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText");t.style.color=e;var i=(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(",");return V(new Me(parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)))}function J(e,t,l,o,n){var r=new i.SvgRenderer(""),a=Y(e,l,t,n,o);return r["draw"+a.functionName](a.renderOption)}function Y(e,i,l,o,n){var r,a="Path",s=i.width,d=i.height,h=e.x,p=e.y,g=e.x+-s/2,c=e.y+-d/2;switch(l){case"Circle":case"Bubble":a="Ellipse",t.merge(o,{rx:s/2,ry:d/2,cx:h,cy:p});break;case"VerticalLine":r="M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),t.merge(o,{d:r});break;case"Diamond":r="M "+g+" "+p+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+p+" L "+h+" "+(p+d/2)+" L "+g+" "+p+" z",t.merge(o,{d:r});break;case"Rectangle":r="M "+g+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" L "+g+" "+(p+-d/2)+" z",t.merge(o,{d:r});break;case"Triangle":r="M "+g+" "+(p+d/2)+" L "+h+" "+(p+-d/2)+" L "+(h+s/2)+" "+(p+d/2)+" L "+g+" "+(p+d/2)+" z",t.merge(o,{d:r});break;case"InvertedTriangle":r="M "+(h+s/2)+" "+(p-d/2)+" L "+h+" "+(p+d/2)+" L "+(h-s/2)+" "+(p-d/2)+" L "+(h+s/2)+" "+(p-d/2)+" z",t.merge(o,{d:r});break;case"Pentagon":for(var m=void 0,u=void 0,f=0;f<=5;f++)m=s/2*Math.cos(Math.PI/180*(72*f)),u=s/2*Math.sin(Math.PI/180*(72*f)),r=0===f?"M "+(h+m)+" "+(p+u)+" ":r.concat("L "+(h+m)+" "+(p+u)+" ");r=r.concat("Z"),t.merge(o,{d:r});break;case"Star":r="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:r});break;case"Cross":r="M "+g+" "+p+" L "+(h+s/2)+" "+p+" M "+h+" "+(p+d/2)+" L "+h+" "+(p+-d/2),t.merge(o,{d:r});break;case"Image":a="Image",t.merge(o,{href:n,height:d,width:s,x:g,y:c})}return{renderOption:o,functionName:a}}function Z(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function Q(e){if(e.length>0)for(var t=0;t<e.length;t++){var i=e[t];K(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function $(e,i){if(e.length>0)for(var l=0;l<e.length;l++){var o=e[l],n=parseFloat(o.legendEle.id.split("_Index_")[1]),r=o.legendEle.id.indexOf("Text")>-1?o.legendEle.id.replace("_Text",""):o.legendEle.id,a="Interactive"===i.legendSettings.mode?document.getElementById(r):document.getElementById(i.element.id+"_Legend_Shape_Index_"+n),s="Interactive"===i.legendSettings.mode?document.getElementById(r+"_Text"):document.getElementById(i.element.id+"_Legend_Text_Index_"+n);t.isNullOrUndefined(a)||K(a,o.oldFill,o.oldOpacity,"none","0px"),t.isNullOrUndefined(s)||K(s,i.legendSettings.textStyle.color||i.themeStyle.legendTextColor,o.oldOpacity,null,null);for(var d=t.isNullOrUndefined(o.ShapeCollection)?0:o.ShapeCollection.Elements.length,h=0;h<d;h++){var p=document.getElementById(o.ShapeCollection.Elements[h].id);t.isNullOrUndefined(p)||K(p,o.shapeOldFill,o.shapeOldOpacity,o.shapeOldBorderColor,o.shapeOldBorderWidth)}}}function K(e,i,l,o,n){e.setAttribute("fill",i),e.setAttribute("opacity",l),t.isNullOrUndefined(o)||e.setAttribute("stroke",o),t.isNullOrUndefined(n)||e.setAttribute("stroke-width",n)}function ee(e,t,i){$(e,i),k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function te(e,i,l){for(var o,n=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,r=!1,a=0;a<e&&!r;a++){var s=l.treeMapLegendModule.legendCollections[a].legendData.length;if(s>0){for(var d=0;d<s;d++)if(!t.isNullOrUndefined(n)&&l.leafItemSettings.colorMapping.length>0?l.treeMapLegendModule.legendCollections[a].legendData[d].data[n]===i.data[n]:l.treeMapLegendModule.legendCollections[a].legendData[d].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].legendName)>-1){o=a,r=!0;break}}else if(l.palette&&l.palette.length>0&&(l.treeMapLegendModule.legendCollections[a].levelOrderName===i.levelOrderName||i.levelOrderName.indexOf(l.treeMapLegendModule.legendCollections[a].levelOrderName)>-1)&&l.treeMapLegendModule.legendCollections[a].legendName===i.name){o=a;break}}return o}function ie(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function le(e,i,l,o){t.createElement("a",{attrs:{download:e+"."+i.toLocaleLowerCase(),href:l}}).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 ne(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",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:re,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:re,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:re,legendBorderColor:"#000000",legendBorderWidth:0}}return t}var re="Roboto, Segoe UI, Noto, Sans-serif",ae=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),se=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("#808080")],i.prototype,"color",void 0),se([t.Property(0)],i.prototype,"width",void 0),i}(t.ChildProperty),he=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(10)],i.prototype,"left",void 0),se([t.Property(10)],i.prototype,"right",void 0),se([t.Property(10)],i.prototype,"top",void 0),se([t.Property(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"size",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(re)],i.prototype,"fontFamily",void 0),se([t.Property("")],i.prototype,"fontWeight",void 0),se([t.Property("Normal")],i.prototype,"fontStyle",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),ge=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property("")],i.prototype,"text",void 0),se([t.Property("")],i.prototype,"description",void 0),i}(t.ChildProperty),ce=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),i}(ge),me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Complex({fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Complex({},ce)],i.prototype,"subtitleSettings",void 0),i}(ge),ue=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"from",void 0),se([t.Property(null)],i.prototype,"to",void 0),se([t.Property(null)],i.prototype,"color",void 0),se([t.Property(null)],i.prototype,"label",void 0),se([t.Property(null)],i.prototype,"value",void 0),se([t.Property(null)],i.prototype,"minOpacity",void 0),se([t.Property(null)],i.prototype,"maxOpacity",void 0),se([t.Property(!0)],i.prototype,"showLegend",void 0),i}(t.ChildProperty),fe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("Default")],i.prototype,"mode",void 0),se([t.Property("transparent")],i.prototype,"background",void 0),se([t.Property("Circle")],i.prototype,"shape",void 0),se([t.Property("")],i.prototype,"width",void 0),se([t.Property("")],i.prototype,"height",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"textStyle",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(15)],i.prototype,"shapeWidth",void 0),se([t.Property(15)],i.prototype,"shapeHeight",void 0),se([t.Property(10)],i.prototype,"shapePadding",void 0),se([t.Property(null)],i.prototype,"imageUrl",void 0),se([t.Complex({color:null,width:null},de)],i.prototype,"border",void 0),se([t.Complex({color:"#000000",width:0},de)],i.prototype,"shapeBorder",void 0),se([t.Complex({},ge)],i.prototype,"title",void 0),se([t.Complex({size:null,fontFamily:null,fontWeight:null},pe)],i.prototype,"titleStyle",void 0),se([t.Property("Bottom")],i.prototype,"position",void 0),se([t.Property("None")],i.prototype,"orientation",void 0),se([t.Property(!1)],i.prototype,"invertedPointer",void 0),se([t.Property("After")],i.prototype,"labelPosition",void 0),se([t.Property("None")],i.prototype,"labelDisplayMode",void 0),se([t.Property("Center")],i.prototype,"alignment",void 0),se([t.Property({x:0,y:0})],i.prototype,"location",void 0),se([t.Property(null)],i.prototype,"showLegendPath",void 0),se([t.Property(null)],i.prototype,"valuePath",void 0),se([t.Property(!1)],i.prototype,"removeDuplicateLegend",void 0),i}(t.ChildProperty),ye=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupIndex",void 0),se([t.Property(null)],i.prototype,"groupName",void 0),i}(t.ChildProperty),ve=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property(0)],i.prototype,"gap",void 0),se([t.Property(10)],i.prototype,"padding",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showLabels",void 0),se([t.Property(null)],i.prototype,"labelPath",void 0),se([t.Property(null)],i.prototype,"labelFormat",void 0),se([t.Property("TopLeft")],i.prototype,"labelPosition",void 0),se([t.Complex({color:null,size:null,fontFamily:null},pe)],i.prototype,"labelStyle",void 0),se([t.Property(null)],i.prototype,"labelTemplate",void 0),se([t.Property("Center")],i.prototype,"templatePosition",void 0),se([t.Property("Trim")],i.prototype,"interSectAction",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Se=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"visible",void 0),se([t.Property("")],i.prototype,"template",void 0),se([t.Property(null)],i.prototype,"format",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(.75)],i.prototype,"opacity",void 0),se([t.Property(["Circle"])],i.prototype,"markerShapes",void 0),se([t.Complex({width:null,color:null},de)],i.prototype,"border",void 0),se([t.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},pe)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),xe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([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 ae(i,e),se([t.Property(!1)],i.prototype,"enable",void 0),se([t.Property("#808080")],i.prototype,"fill",void 0),se([t.Property("0.5")],i.prototype,"opacity",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property("Item")],i.prototype,"mode",void 0),i}(t.ChildProperty),Ie=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ae(i,e),se([t.Property(null)],i.prototype,"groupPath",void 0),se([t.Property(0)],i.prototype,"groupGap",void 0),se([t.Property(10)],i.prototype,"groupPadding",void 0),se([t.Complex({},de)],i.prototype,"border",void 0),se([t.Property(null)],i.prototype,"fill",void 0),se([t.Property(!1)],i.prototype,"autoFill",void 0),se([t.Property(1)],i.prototype,"opacity",void 0),se([t.Property(!0)],i.prototype,"showHeader",void 0),se([t.Property(20)],i.prototype,"headerHeight",void 0),se([t.Property(null)],i.prototype,"headerTemplate",void 0),se([t.Property(null)],i.prototype,"headerFormat",void 0),se([t.Property("Near")],i.prototype,"headerAlignment",void 0),se([t.Complex({color:null,size:"13px",fontFamily:null},pe)],i.prototype,"headerStyle",void 0),se([t.Property("TopLeft")],i.prototype,"templatePosition",void 0),se([t.Collection([],ue)],i.prototype,"colorMapping",void 0),i}(t.ChildProperty),Ce=function(){function e(e,t){this.width=e,this.height=t}return e}(),Fe=function(){function e(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l}return e}(),we=function(){function e(e,t,i,l,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n}return e}(),Oe=function(){function e(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r}return e}(),Le=function(){function e(e,t,i,l,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a}return e}(),Te=function(){function e(e,t){this.x=e,this.y=t}return e}(),Me=function(){function e(e,t,i){this.r=e,this.g=t,this.b=i}return e}(),Ne=function(){function e(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o}return e}(),_e=function(){function e(e){this.treemap=e}return e.prototype.processLayoutPanel=function(){var e,i;if(this.treemap.treemapLevelData.levelsData&&this.treemap.treemapLevelData.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)?this.treemap.treemapLevelData.levelsData[0]:this.getDrilldownData(this.treemap.treemapLevelData.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||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems();else{var l=this.treemap.drilledItems.length-1,o=this.treemap.drilledItems[l].data,n={};n[this.treemap.drilledItems[l].data.groupName]=[o],t.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[l].data.groupIndex),this.calculateLayoutItems(n||this.treemap.treemapLevelData.levelsData[0],i),this.renderLayoutItems()}},e.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=u(e).values;if(o&&o.length>0&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],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,l,o,n,r=this.treemap.leafItemSettings,a=this.treemap.levels,s=u(e).values;if(s&&s.length>0&&(this.sliceAndDiceProcess(s,t),this.treemap.levels.length>0))for(var d=0;d<s.length;d++)l=s[d].groupIndex,o=0===a.length||l===a.length?r.gap:a[l].groupGap,n=0===a.length?0:a[l]?a[l].showHeader?a[l].headerHeight:0:a[l-1].showHeader?a[l-1].headerHeight:0,i=s[d].rect,i=new Fe(i.x+o/2,i.y+(n+o/2),i.width-o,Math.abs(i.height-(o+n))),this.computeSliceAndDiceDimensional(s[d],i);return e},e.prototype.sliceAndDiceProcess=function(e,i){var l,o=i.height*i.width,n=this.treemap.levels,r=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(c);for(var d=0;d<e.length;d++){var h=e[d];h.isLeafItem=0===n.length||(this.treemap.isHierarchicalData||t.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?h.groupIndex===n.length-1:h.groupIndex===this.treemap.levels.length),s?(l=o/a*e[d].weight/i.height,r<=i.width&&(e[d].rect=new Fe(r+i.x,i.y,l,i.height))):(l=o/a*e[d].weight/i.width,r<=i.height&&(e[d].rect=new Fe(i.x,r+i.y,i.width,l))),r+=l,this.renderItems.push(e[d])}},e.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r,a=this.treemap.leafItemSettings,s=this.treemap.levels,d=u(e).values;if(d&&d.length>0&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(d)),this.calculateChildrenLayout(e,d,t),this.treemap.levels.length>0))for(var h=0;h<d.length;h++)o=(l=d[h]).groupIndex,i=l.rect,n=(l.isLeafItem?a.padding:s[o].groupPadding)/2,r=this.treemap.isHierarchicalData?0===o&&l.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 Fe(i.x+n,i.y+(r+n),i.width-n,i.height-n),!l.isLeafItem&&l.weight>0&&this.computeSquarifyDimensional(d[h],i)},e.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,b(i)),t.sort(H),this.performRowsLayout(t,[],i,[])},e.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o){c=this.getCoordinates(t,i);return m=l.concat(c)}var n=I(i),r=e[0],a=e.slice(1,o);if(this.aspectRatio(t,r,n)){var s=t.concat(r);return this.performRowsLayout(a,s,i,l)}for(var d=t.length,h=0,p=0;p<d;p+=1)h+=t[p].itemArea;var g=this.cutArea(i,h),c=this.getCoordinates(t,i),m=l.concat(c);return this.performRowsLayout(e,[],g,m)},e.prototype.aspectRatio=function(e,t,i){if(0===e.length)return!0;var l=e.concat(t);return this.findMaxAspectRatio(e,i)>=this.findMaxAspectRatio(l,i)},e.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),a>o&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},e.prototype.cutArea=function(e,t){var i=C(e),l=i.width,o=i.height,n=i.x,r=i.y;if(l>=o){var a=t/o;return F(d={x:n+a,y:r,width:l-a,height:o})}var s=t/l,d={x:n,y:r+s,width:l,height:o-s};return F(d)},e.prototype.getCoordinates=function(e,i){for(var l,o=C(i),n=o.width,r=o.height,a=o.x,s=o.y,d=e.length,h=this.treemap.levels,p=this.treemap.leafItemSettings,g=0,c=0;c<d;c+=1)g+=e[c].itemArea;for(var m,u,f,y=g/r,v=g/n,S=a,x=s,b=[],c=0;c<d;c+=1){var I=e[c];if(l=I.groupIndex,I.isLeafItem=0===h.length||(this.treemap.isHierarchicalData?l===h.length:!t.isNullOrUndefined(p.labelPath)&&l===h.length),u=Z(this.parentData[0],I),f=u?this.treemap.areaRect:I.parent.rect,m=I.isLeafItem?p.padding:h[l].groupPadding,n>=r){var F=x+I.itemArea/y;I.rect={x:S,y:x,width:S+y,height:F},x=F}else{var w=S+I.itemArea/v;I.rect={x:S,y:x,width:w,height:x+v},S=w}I.weight>0&&(u||Math.round(i.y+m/2)<=Math.round(f.y+(f.height-f.y))&&Math.round(i.x+m/2)<=Math.round(f.x+(f.width-f.x)))&&(this.renderItems.push(I),b.push(I))}return b},e.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},e.prototype.onDemandProcess=function(e){var i,l={};l=e[0].parent,this.treemap.currentLevel=l.isDrilled?l.groupIndex:null;var o={};t.isNullOrUndefined(l.groupName)?o=l:o[l.groupName]=[l],i=t.extend({},this.treemap.areaRect,i,!1),t.isNullOrUndefined(this.treemap.treeMapLegendModule)||t.isNullOrUndefined(this.treemap.totalRect)||(i=this.treemap.totalRect);for(var n=this.treemap.levels.length,r=0;r<n;r++)n===e[0].groupIndex?this.treemap.levels[n]=this.treemap.levels[r]:this.treemap.levels.splice(n-1,1);this.calculateLayoutItems(o,i),this.renderLayoutItems()},e.prototype.renderLayoutItems=function(){var e,i,l,o,n=this,r=this.treemap;this.renderer=r.renderer;var a,s,d,h,p,g,c,m,f,y,v,S,x,b=r.element.id,I=r.layoutType,F=this.treemap.leafItemSettings.interSectAction,w="",O=document.getElementById(r.element.id+"_Secondary_Element"),L=r.levels;this.layoutGroup=this.renderer.createGroup({id:b+"_TreeMap_"+I+"_Layout"});var T,M,N,_=t.createElement("div",{id:r.element.id+"_Label_Template_Group",className:"template"});_.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+r.areaRect.y+"px;left:"+r.areaRect.x+"px;height:"+r.areaRect.height+"px;width:"+r.areaRect.width+"px;";for(var E,D,P=!1,B=r.leafItemSettings,z=this,H=0;H<this.renderItems.length;H++)!function(I){if(c=z.renderItems[I],s=c.groupIndex,z.treemap.drillDownView&&t.isNullOrUndefined(z.treemap.currentLevel)&&s>0||z.treemap.drillDownView&&s>z.treemap.currentLevel+1)return"continue";h=c.rect,P=c.isLeafItem,y=b+"_Level_Index_"+s+"_Item_Index_"+I,T=z.renderer.createGroup({id:y+"_Group"}),S=(P?B.gap:L[s].groupGap)/2;var H=z.treemap.totalRect?r.legendSettings.visible?z.treemap.totalRect:C(z.treemap.totalRect):z.treemap.areaRect;"Squarified"===r.layoutType&&(h.width=Math.abs(h.x-h.width)-S,h.height=Math.abs(h.y-h.height)-S),"TopRightBottomLeft"===r.renderDirection?h.x=H.x+H.width-h.width-Math.abs(H.x-h.x):"BottomLeftTopRight"===r.renderDirection?h.y=H.y+H.height-h.height-Math.abs(H.y-h.y):"BottomRightTopLeft"===r.renderDirection&&(h.x=H.x+H.width-h.width-Math.abs(H.x-h.x),h.y=H.y+H.height-h.height-Math.abs(H.y-h.y)),l=z.getItemColor(P,c),g=l.fill,f=l.opacity,p=P?B.labelFormat:L[s].headerFormat;var U;if(i=P?B.showLabels:L[s].showHeader,s===z.treemap.currentLevel)if(z.treemap.enableBreadcrumb){D="#"+z.treemap.breadcrumbConnector+"#",U=c.levelOrderName.replace(/#/gi,D),U=0!==s?"#"+U:U}else U=c.name;else z.treemap.enableBreadcrumb&&(c.isDrilled=!1),U=c.name;m=W(p,c.data,z.treemap)||U||"undefined",E=u(c).values,m=!P&&E&&E.length>0&&z.treemap.enableDrillDown?c.isDrilled?r.enableRtl?m+" [-]":"[-] "+m:r.enableRtl?m+" [+]":"[+] "+m:m,r.enableHtmlSanitizer&&(m=t.SanitizeHtmlHelper.sanitize(m));var k=P?B.labelStyle.fontFamily:L[s].headerStyle.fontFamily;k=k||z.treemap.themeStyle.labelFontFamily;var A=P?B.labelStyle.size:L[s].headerStyle.size;A=A||z.treemap.themeStyle.labelFontSize;var j=P?B.labelStyle.fontWeight:L[s].headerStyle.fontWeight;j=j||z.treemap.themeStyle.fontWeight;var V=P?B.labelStyle.color:L[s].headerStyle.color,G=P?B.labelStyle.fontStyle:L[s].headerStyle.fontStyle,q=P?B.labelStyle.opacity:L[s].headerStyle.opacity;x={fontFamily:k,size:A,fontWeight:j,color:V,fontStyle:G,opacity:q},N=P?B.border:L[s].border,e=P?B.labelPosition:"Near"===L[s].headerAlignment?"TopLeft":"Center"===L[s].headerAlignment?"TopCenter":"TopRight",d=P?B.templatePosition:L[s].templatePosition,M=P?B.labelTemplate:L[s].headerTemplate,c.options={border:N,opacity:f,fill:g},o={cancel:!1,name:"itemRendering",treemap:z.treemap,text:m,currentItem:c,RenderItems:z.renderItems,options:c.options,textColor:x.color},z.treemap.trigger("itemRendering",o,function(l){if(!l.cancel){w=" M "+h.x+" "+h.y+" L "+(h.x+h.width)+" "+h.y+" L "+(h.x+h.width)+" "+(h.y+h.height)+" L "+h.x+" "+(h.y+h.height)+"z",a=new Oe(y+"_RectPath",g,N.width,N.color,f,null,w);var r=n.renderer.drawPath(a);T.appendChild(r),i&&(o.text!==m&&(o.text=W(o.text,c.data,n.treemap)||U),x.color=o.textColor?o.textColor:x.color,n.renderItemText(o.text.toString(),T,x,h,F,y,g,e,D)),M&&(v=n.renderTemplate(O,y,h,d,M,c,P),t.isNullOrUndefined(v)||(_.appendChild(v),n.treemap.renderReactTemplates())),T.setAttribute("aria-label",c.name),n.treemap.enableDrillDown&&!P||n.treemap.selectionSettings.enable||n.treemap.highlightSettings.enable?(T.setAttribute("role","button"),T.setAttribute("tabindex",n.treemap.tabIndex.toString()),T.style.outline="none",T.style.cursor=n.treemap.highlightSettings.enable&&!n.treemap.selectionSettings.enable&&n.treemap.enableDrillDown&&c.groupIndex===n.treemap.levels.length-1?"default":!n.treemap.highlightSettings.enable||n.treemap.selectionSettings.enable||n.treemap.enableDrillDown?"pointer":"default"):T.setAttribute("role","region"),R(n.treemap,T,"treeMapSelection"),n.layoutGroup.appendChild(T)}})}(H);_.childNodes.length>0&&O.appendChild(_),this.treemap.svgObject.appendChild(this.layoutGroup),R(this.treemap,this.layoutGroup,"treeMapSelection")},e.prototype.renderItemText=function(e,i,l,o,n,s,d,p,g){var c,m,u,f=[],y=[],v=0;if(f=-1!==e.indexOf("<br>")?e.split("<br>"):null,m=this.labelInterSectAction(o,e,l,n),c=r(f&&f[0]||m[0],l),this.treemap.enableRtl){var x=r(e,l),b=e.search("[+]")||e.search("[-]");if(o.width<x.width&&b>0){var I=e.substring(b-1,e.length),C=r("[+]",l);m[0]=a(o.width-C.width-5,m[0],l)+I}}var F=S(o,p,c,"Text",this.treemap);if(!t.isNullOrUndefined(f)){for(var w=[],O=null,L=[],T=0;T<f.length;T++)v+=(c=r(O=a(o.width-5,f[T],l),l)).height,L.push(c.width),w.push(O);m=w,c.width=Math.max.apply(null,L),c.height=v}if("WrapByWord"===n||"Wrap"===n||"Trim"===n){for(var M=0;M<m.length;M++)v+=(c=r(m[M],l)).height,o.height-5>v&&y.push(m[M]);if("Wrap"===n&&m.length!==y.length&&y.length){var N=y.length-1,_=y[N];_=_.substring(0,_.length-1)+"...",y.splice(N),"..."!==_&&y.push(_)}}else u=m,y.push(u);h(new Le(s+"_Text",F.x,F.y,"start",y,"","",g),l,l.color||this.getSaturatedColor(d),i)},e.prototype.getItemColor=function(e,i){var l=this.treemap,o=e?l.leafItemSettings.fill:l.levels[i.groupIndex].fill,n=e?l.leafItemSettings.opacity:l.levels[i.groupIndex].opacity;t.isNullOrUndefined(l.treemapLevelData.defaultLevelsData)||l.treemapLevelData.defaultLevelsData.length>0&&(l.treemapLevelData.levelsData=l.treemapLevelData.defaultLevelsData);var r=u(l.treemapLevelData.levelsData[0]).values,a=e?l.leafItemSettings.colorMapping:l.levels[i.groupIndex].colorMapping;if(a.length>0){var s=O(a,i.data[l.equalColorValuePath],i.data[l.rangeColorValuePath]);t.isNullOrUndefined(s)||(o=t.isNullOrUndefined(s.fill)?l.leafItemSettings.fill:s.fill,n=s.opacity)}else for(var d=0;d<r.length;d++)r[d].levelOrderName===i.levelOrderName.split("#")[0]&&(o=t.isNullOrUndefined(o)?t.isNullOrUndefined(l.colorValuePath)?t.isNullOrUndefined(i.options)?!t.isNullOrUndefined(l.palette)&&l.palette.length>0?l.palette[d%l.palette.length]:"#808080":i.options.fill:r[d].data[l.colorValuePath]:o);return{fill:o,opacity:n}},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,l,o,n,r,a){var s=a?i+"_LabelTemplate":i+"_HeaderTemplate",d=a?"_LabelTemplate":"_HeaderTemplate";if(t.isNullOrUndefined(n.prototype)&&"string"==typeof n)for(var h=Object.keys(r.data),p=0;p<h.length;p++){var g=RegExp;n=n.replace(new g("{{:"+h[p]+"}}","g"),r.data[h[p].toString()])}this.treemap.enableHtmlSanitizer&&"string"==typeof n&&(n=t.SanitizeHtmlHelper.sanitize(n));var c;if(!t.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))){var m=S(l,o,x(c=v(y(n)(r.data,this.treemap,n,this.treemap.element.id+d,!1),s,r.data),e),"Template",this.treemap);c.style.left=m.x+"px",c.style.top=m.y+"px"}return c},e.prototype.labelInterSectAction=function(e,t,i,l){var o,n=e.width-10;switch(l){case"Hide":o=[z(n,e.height,t,i)];break;case"Trim":o=[a(n+3,t,i)];break;case"WrapByWord":o=P(n,t,i);break;case"Wrap":o=B(n,t,i)}return o},e.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]},e}();!function(e){e.mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"}}(e.Theme||(e.Theme={}));var Ee=function(){function e(e){}return e.prototype.print=function(e,i){var l=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no");l.moveTo(0,0),l.resizeTo(screen.availWidth,screen.availHeight);var o={cancel:!1,htmlContent:this.getHTMLContent(e,i),name:"beforePrint"};e.trigger("beforePrint",o,function(){o.cancel||t.print(o.htmlContent,l)})},e.prototype.getHTMLContent=function(e,i){var l=t.createElement("div");if(i)i instanceof Array?i.forEach(function(e){l.appendChild(g(e).cloneNode(!0))}):i instanceof Element?l.appendChild(i.cloneNode(!0)):l.appendChild(g(i).cloneNode(!0));else{var o=e.element.cloneNode(!0),n=o.getElementsByTagName("svg")[0];if(!t.isNullOrUndefined(n)&&(n=n.childNodes[0],!t.isNullOrUndefined(n))){var r=n.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==r&&"transparent"!==r||n.setAttribute("fill","rgba(0, 0, 0, 1)"):n.setAttribute("fill","rgba(255,255,255, 1)")}l.appendChild(o)}return l},e.prototype.getModuleName=function(){return"Print"},e.prototype.destroy=function(){},e}(),De=function(){function e(e){}return e.prototype.export=function(e,i,l,o){return new Promise(function(n,r){var a=t.createElement("canvas",{id:"ej2-canvas",attrs:{height:e.availableSize.height.toString(),width:e.availableSize.width.toString()}}),s=e.svgObject.cloneNode(!0),d=s.childNodes[0];if(!t.isNullOrUndefined(d)){var h=d.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==h&&"transparent"!==h||s.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):s.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var p=!(t.Browser.userAgent.toString().indexOf("HeadlessChrome")>-1),g='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+s.outerHTML+"</svg>",c=window.URL.createObjectURL(new Blob("SVG"===i?[g]:[(new XMLSerializer).serializeToString(s)],{type:"image/svg+xml"}));if("SVG"===i)o?le(l,i,c,p):n(null);else{var m=new Image,u=a.getContext("2d");m.onload=function(){u.drawImage(m,0,0),window.URL.revokeObjectURL(c),o?le(l,i,a.toDataURL("image/png").replace("image/png","image/octet-stream"),p):"JPEG"===i?n(a.toDataURL("image/jpeg")):"PNG"===i&&n(a.toDataURL("image/png"))},m.src=c}})},e.prototype.getModuleName=function(){return"ImageExport"},e.prototype.destroy=function(){},e}(),Pe=function(){function e(e){}return e.prototype.export=function(e,i,l,n,r){return new Promise(function(i,a){var s=t.createElement("canvas",{id:"ej2-canvas",attrs:{width:e.availableSize.width.toString(),height:e.availableSize.height.toString()}});n=t.isNullOrUndefined(n)?o.PdfPageOrientation.Landscape:n;var d=e.svgObject.cloneNode(!0),h=d.childNodes[0];if(!t.isNullOrUndefined(h)){var p=h.getAttribute("fill");"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p?"TailwindDark"!==e.theme&&"Tailwind3Dark"!==e.theme&&"Bootstrap5Dark"!==e.theme&&"FluentDark"!==e.theme&&"Material3Dark"!==e.theme&&"Fluent2Dark"!==e.theme&&"Fluent2HighContrast"!==e.theme||"rgba(255,255,255, 0.0)"!==p&&"transparent"!==p||d.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):d.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")}var g=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(d)],{type:"image/svg+xml"})),c=new Image,m=s.getContext("2d");c.onload=function(){m.drawImage(c,0,0),window.URL.revokeObjectURL(g);var t=new o.PdfDocument,a=s.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");t.pageSettings.orientation=n,a=a.slice(a.indexOf(",")+1),t.pages.add().graphics.drawImage(new o.PdfBitmap(a),0,0,e.availableSize.width-60,e.availableSize.height),r?(t.save(l+".pdf"),t.destroy()):i(null)},c.src=g})},e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.destroy=function(){},e}(),Be=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function l(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(l.prototype=i.prototype,new l)}}(),ze=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(n<3?o(r):n>3?o(t,i,r):o(t,i))||r);return n>3&&r&&Object.defineProperty(t,i,r),r},He=function(e){function o(t,i){var l=e.call(this,t,i)||this;return l.isResize=!1,l.orientation="Horizontal",l.drilledItems=[],l.isHierarchicalData=!1,l.levelSelection=[],l.legendId=[],l}return Be(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(){this.treemapLevelData=new Re,this.treemapLevelData.levelsData=null,this.treemapLevelData.defaultLevelsData=null,this.treemapLevelData.hierarchyData=null,this.createSecondaryElement(),this.addTabIndex(),this.themeStyle=ne(this.theme),this.renderBorder(),this.renderTitle(this.titleSettings,"title",null,null),t.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},o.prototype.processDataManager=function(){var e,i,o,n,r=this;this.dataSource instanceof l.DataManager?(e=this.dataSource,i=this.query instanceof l.Query?this.query:new l.Query,e.executeQuery(i).then(function(e){r.dataSource=e.result,r.renderTreeMapElements()})):this.dataSource instanceof Ne?(n=this.dataSource,(o=new t.Fetch(n.dataOptions,n.type,n.contentType)).onSuccess=function(e){if(t.isNullOrUndefined(e.type)||"application/octet-stream"!==e.type)r.dataSource=e,r.renderTreeMapElements();else{var i=new FileReader,l=r;i.onload=function(){e=JSON.parse(i.result.toString()),l.dataSource=e,l.renderTreeMapElements()},i.readAsText(e)}},o.send(n.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),!t.isNullOrUndefined(this.treeMapLegendModule)&&this.legendSettings.visible&&U(this,this.treeMapLegendModule.legendGroup),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)}t.isNullOrUndefined(this.renderer)&&(this.renderer=new i.SvgRenderer(this.element.id)),t.isNullOrUndefined(this.layout)&&(this.layout=new _e(this)),this.clearTemplate();var e=this.element.clientWidth,l=this.element.clientHeight;this.availableSize=new Ce(n(this.width,e)||e||600,n(this.height,l)||l||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 _e(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"});i.style.cssText="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 l=new we(this.element.id+"_TreeMap_Border",this.background||this.themeStyle.backgroundColor,this.border,1,new Fe(e/2,e/2,this.availableSize.width-e,this.availableSize.height-e));this.svgObject.appendChild(this.renderer.drawRectangle(l))}else i&&i.setAttribute("fill",this.background||this.themeStyle.backgroundColor)},o.prototype.renderTitle=function(e,i,l,o){var n,d={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(d.fontFamily=d.fontFamily||this.themeStyle.fontFamily,d.fontWeight=d.fontWeight||this.themeStyle.titleFontWeight,d.size=d.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 g=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.text):e.text,c=a(p,g,d),m=r(c,d),u=s(t.isNullOrUndefined(l)?new Fe(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):l,e.alignment,m,i),f=new Le(this.element.id+"_TreeMap_"+i,u.x,u.y,"start",c),y=new Fe(u.x,u.y,m.width,m.height),v=h(f,d,d.color||("title"===i?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),o);v.setAttribute("aria-label",e.description||g),v.setAttribute("role","region"),v.setAttribute("tabindex",this.tabIndex.toString()),("title"===i&&!e.subtitleSettings.text||"subtitle"===i)&&(n=this.availableSize.height-y.y-10-this.margin.bottom,this.areaRect=new Fe(this.margin.left,y.y+10,p,n)),"subtitle"!==i&&e.subtitleSettings.text?this.renderTitle(e.subtitleSettings,"subtitle",y,o):this.svgObject.appendChild(o)}else n=this.availableSize.height-this.margin.top-this.margin.bottom,this.areaRect=new Fe(this.margin.left,this.margin.top,p,n)},o.prototype.processingData=function(){var e,i=this;if(this.dataSource=this.dataSource,!t.isNullOrUndefined(this.dataSource)&&this.dataSource.length>0&&this.weightValuePath){if(this.treemapLevelData.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 l={};l.level=0,e=this.leafItemSettings.labelPath,l[e]=[];for(n=0;n<this.dataSource.length;n++){var o=u(this.dataSource[n]).values;this.isHierarchicalData&&o&&o.length>0?o.forEach(function(t){t[e]&&l[e].push({groupIndex:0,name:t[e],levelOrderName:t[e].toString(),data:t,weight:t[i.weightValuePath]})}):this.dataSource[n][e]&&l[e].push({groupIndex:0,name:this.dataSource[n][e],levelOrderName:this.dataSource[n][e].toString(),data:this.dataSource[n],weight:this.dataSource[n][this.weightValuePath]})}this.treemapLevelData.levelsData.push(l)}else{if(this.isHierarchicalData){this.treemapLevelData.hierarchyData=[],this.treemapLevelData.hierarchyData=t.extend([],this.dataSource,this.treemapLevelData.hierarchyData,!0);for(var n=0;n<this.treemapLevelData.hierarchyData.length;n++)this.processHierarchicalData(this.treemapLevelData.hierarchyData[n],n);this.treemapLevelData.levelsData=this.treemapLevelData.hierarchyData}else this.processFlatJsonData(),this.treemapLevelData.levelsData.length>1&&this.reOrderLevelData(this.treemapLevelData.levelsData.length-1);e=this.levels[0].groupPath}this.isHierarchicalData||this.findTotalWeight(this.treemapLevelData.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=u(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 l,o,n,r=this,a={},s=this.leafItemSettings.labelPath?this.leafItemSettings.labelPath:this.weightValuePath;if(a=u(e),(l=a?a.values:null)&&l.length>0){n=a.key;for(var d=0;d<this.levels.length;d++)n===this.levels[d].groupPath&&(o=d);for(var h=0;h<l.length;h++){l[h].name=l[h][s],l[h].levelOrderName=(0===o?l[h].name:e.levelOrderName+"#"+l[h].name)+"";var p=l[h].levelOrderName,g=void 0;p.search("#")>0&&(g=p.split("#").length-1),l[h].groupIndex=t.isNullOrUndefined(o)?g===this.levels.length?this.levels.length:g:o,0!==o&&(l[h].parent=e),l[h].groupName=n,l[h].data=l[h],l[h].isDrilled=!1,l[h].weight=l[h][this.weightValuePath]}l.forEach(function(e){r.processHierarchicalData(e,i)})}if(i===this.treemapLevelData.hierarchyData.length-1){var c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];if(!t.isNullOrUndefined(c)){for(var m=0;m<this.treemapLevelData.hierarchyData.length;m++)l=u(this.treemapLevelData.hierarchyData[m]).values,0!==m&&l&&(l.forEach(function(e){c.push(e)}),this.treemapLevelData.hierarchyData.splice(m,1),m-=1);c=this.treemapLevelData.hierarchyData[0][this.levels[0].groupPath];for(var f=0;f<c.length;f++)a[this.levels[0].groupPath]=c,c[f].parent=a}}},o.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},o.prototype.export=function(e,i,l,o){var n=this;return t.isNullOrUndefined(o)&&(o=!0),"PDF"===e&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(t,r){t(n.pdfExportModule.export(n,e,i,l,o))}):this.allowImageExport&&"PDF"!==e&&this.imageExportModule?new Promise(function(t,l){t(n.imageExportModule.export(n,e,i,o))}):null},o.prototype.processFlatJsonData=function(){this.dataSource=this.dataSource;for(var e,i=[],l=0;l<this.levels.length+1;l++){e=this.levels[l]?this.levels[l].groupPath:this.leafItemSettings.labelPath;var o={};o.level=l,o[e]=[],this.treemapLevelData.levelsData.push(o);for(var n=0;n<this.dataSource.length;n++){var r={},a="";if(!t.isNullOrUndefined(e)){var s=this.dataSource[n][e];if(0!==l)for(var d=0;d<=l;d++){var h=this.levels[d]?this.levels[d].groupPath:e;a+=this.dataSource[n][h]+(d===l?"":"#")}i.length>0&&-1!==i.indexOf(a||s)||(r.name=s,r.levelOrderName=(a||s)+"",r.groupIndex=l,r.isDrilled=!1,r.groupName=e,r.data=this.dataSource[n],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][e].push(r),i.push(a||s))}}}},o.prototype.reOrderLevelData=function(e){for(var i,l=this.levels[e]?this.levels[e].groupPath:this.leafItemSettings.labelPath,o=this.levels[e-1].groupPath,n=this.treemapLevelData.levelsData[e][l],r=this.treemapLevelData.levelsData[e-1][o],a=0;a<n.length;a++){i=n[a].levelOrderName;for(var s=0;s<r.length;s++)if(r[s][l]=t.isNullOrUndefined(r[s][l])?[]:r[s][l],this.IsChildHierarchy(i.split("#"),r[s].levelOrderName.split("#"))){t.isNullOrUndefined(n[a].parent)&&(n[a].parent=r[s]),r[s][l].push(n[a]);break}}this.findTotalWeight(this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][l],"Child"),this.treemapLevelData.levelsData.splice(e,1),e-1>0&&this.reOrderLevelData(e-1)},o.prototype.IsChildHierarchy=function(e,t){for(var i=!1,l=0;l<t.length;l++){if(e.length<l||t[l]!==e[l])return!1;i=!0}return i},o.prototype.findTotalWeight=function(e,t){for(var i,l,o,n=this,r={},a=this,s=0;s<e.length;s++)!function(s){i=0,o=e[s].groupName,l=e[s].levelOrderName.split("#"),a.dataSource.forEach(function(t){m(l,e[s].levelOrderName,t,n)&&(i+=parseFloat(t[n.weightValuePath]))}),"Parent"===t&&(r[o]=e,e[s].parent=r),e[s].weight=i}(s)},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),t.EventHandler.remove(this.element,"keydown",this.keyDownHandler),t.EventHandler.remove(this.element,"keyup",this.keyUpHandler),t.EventHandler.remove(this.element,"focusout",this.focusHandler),window.removeEventListener("resize",this.resizeEvent)},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),t.EventHandler.add(this.element,"keydown",this.keyDownHandler,this),t.EventHandler.add(this.element,"keyup",this.keyUpHandler,this),t.EventHandler.add(this.element,"focusout",this.focusHandler,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent),this.setStyle(this.element)},o.prototype.setStyle=function(e){e.style.overflow="hidden"},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("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},o.prototype.resizeOnTreeMap=function(e){var i=this;if(!this.isDestroyed){this.isResize=!0;var l={name:"resize",cancel:!1,previousSize:this.availableSize,currentSize:new Ce(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(),l.currentSize=i.availableSize,i.trigger("resize",l,function(e){i.render(),i.refreshing=!1})},500))}},o.prototype.clickOnTreeMap=function(e){var i,l,o=this,n=e.target,r=n.id,a=n.innerHTML,s={cancel:!1,name:"click",treemap:this,mouseEvent:e};this.trigger("click",s),r.indexOf("_Item_Index")>-1&&(e.preventDefault(),l=parseFloat(r.split("_Item_Index_")[1]),i={cancel:!1,name:"itemClick",treemap:this,item:this.layout.renderItems[l],mouseEvent:e,groupIndex:this.layout.renderItems[l].groupIndex,groupName:this.layout.renderItems[l].name,text:a,contentItemTemplate:a},this.trigger("itemClick",i,function(e){e.text===a&&e.contentItemTemplate===a||(t.isNullOrUndefined(o.leafItemSettings.labelTemplate)?(e.text=W(e.text,e.item.data,e.treemap),n.textContent=e.text):p(r,n,e.contentItemTemplate))}));var d,h=(new Date).getMilliseconds();t.isNullOrUndefined(this.doubleClick)||(!t.isNullOrUndefined(d)&&h-d<500&&this.doubleClickOnTreeMap(e),d=h)},o.prototype.doubleClickOnTreeMap=function(e){var t={cancel:!1,name:"doubleClick",treemap:this,mouseEvent:e};this.trigger("doubleClick",t)},o.prototype.rightClickOnTreeMap=function(e){var t={cancel:!1,name:"rightClick",treemap:this,mouseEvent:e};this.trigger("rightClick",t)},o.prototype.mouseDownOnTreeMap=function(e){e.target.id.indexOf("_Item_Index")>-1&&(this.mouseDown=!0),"touchstart"!==e.type&&"mousedown"!==e.type||(this.removeFocus("none"),e.preventDefault()),this.notify(t.Browser.touchStartEvent,e)},o.prototype.mouseMoveOnTreeMap=function(e){var i,l,o=e.target.id,n={cancel:!1,name:"mouseMove",treemap:this,mouseEvent:e};this.trigger("mouseMove",n);var r;this.removeFocus("none"),o.indexOf("_Item_Index")>-1?(r=u(l=this.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])]).values,this.element.style.cursor=!l.isLeafItem&&r&&r.length>0&&this.enableDrillDown?"pointer":"auto",i={cancel:!1,name:"itemMove",treemap:this,item:l,mouseEvent:e},this.trigger("itemMove",i)):this.element.style.cursor="default",this.notify(t.Browser.touchMoveEvent,e)},o.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,n=t.levelOrderName.split("#"),r=0,a=Object.keys(n);r<a.length;r++)n[l=a[r]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:n}},o.prototype.calculatePreviousLevelChildItems=function(e,i,l){for(var o,n,r,a=0,s=this.layout.renderItems[0].levelOrderName.split("#").length,d=0;d<s;d++)r=0===d?e.levelText[d]:r+"#"+e.levelText[d];a=s>1?s:a;for(var h=0,p=Object.values(this.layout.renderItems);h<p.length;h++)(n=p[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(o=0===a?t.isNullOrUndefined(r)?r:e.levelText[a]:l?r:r+"#"+e.levelText[a])===n.levelOrderName&&(this.drilledItems.push({name:n.levelOrderName,data:n}),l=!0,++a<=i.groupIndex&&(r=o=o+"#"+e.levelText[a]));return l},o.prototype.compareSelectedLabelWithDrillDownItems=function(e,t,i){var l,o={};return e.drillLevel+1===this.drilledItems[i].data.groupIndex?((l=this.drilledItems[i].data.parent).isDrilled=!0,o[l[this.drilledItems[i].data.groupName]]=[l],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,l,o,n,r,a,s,d=this,h=e.target,p=h.id,g=!1,c={},m=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(),n=parseFloat(p.split("_Item_Index_")[1]),r=this.layout.renderItems[n];var y=h.textContent;if(this.enableBreadcrumb&&(s=this.calculateSelectedTextLevels(y,r),a=s.drillLevel,this.drillDownView||-1===y.search("[+]")||(g=this.calculatePreviousLevelChildItems(s,r,g))),0!==this.levels.length&&!r.isLeafItem&&u(r).values&&u(r).values.length>0){if(this.drilledItems.length>0){r=g?this.drilledItems[this.drilledItems.length-1].data:r;for(var v=0;v<this.drilledItems.length;v++){if(!t.isNullOrUndefined(a)){var S=this.drilledItems.length;if(c=this.compareSelectedLabelWithDrillDownItems(s,r,v),S!==this.drilledItems.length){v-=1;break}}if(r.levelOrderName===this.drilledItems[v].name&&!g&&t.isNullOrUndefined(a)){0===r.groupIndex&&r.parent[r.groupName]instanceof Array?(r.isDrilled=!r.isDrilled,r.isDrilled?c[r.groupName]=[r]:c=r.parent):(r.isDrilled=!1,r.parent.isDrilled=!0,r=r.parent,c[r.groupName]=[r]),this.drilledItems.splice(v,1),v-=1;break}v===this.drilledItems.length-1&&t.isNullOrUndefined(a)&&(r.isDrilled=!0,c[r.groupName]=[r])}}else r.isDrilled=!0,c[r.groupName]=[r];l={cancel:!1,name:"drillStart",treemap:this,element:h,groupIndex:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.groupIndex:r.groupIndex,groupName:this.enableBreadcrumb&&0!==this.drilledItems.length&&!t.isNullOrUndefined(a)?this.drilledItems[this.drilledItems.length-1].data.name:r.name,rightClick:3===e.which,childItems:null,item:c},this.trigger("drillStart",l,function(e){if(d.currentLevel=r.isDrilled&&t.isNullOrUndefined(a)?r.groupIndex:!t.isNullOrUndefined(a)&&d.enableBreadcrumb&&r.isDrilled?a:null,!e.cancel){if(document.getElementById(m)){var l=document.getElementById(m);l.parentNode.removeChild(l)}if(i=t.extend({},d.areaRect,i,!0),d.legendSettings.visible&&!t.isNullOrUndefined(d.treeMapLegendModule)&&(t.isNullOrUndefined(c)||(d.treeMapLegendModule.legendGroup.textContent="",d.treeMapLegendModule.legendGroup=null,d.treeMapLegendModule.widthIncrement=0,d.treeMapLegendModule.heightIncrement=0,d.enableBreadcrumb&&!t.isNullOrUndefined(a)?d.drilledLegendItems={name:d.drilledItems[d.drilledItems.length-1].data.levelOrderName,data:d.drilledItems[d.drilledItems.length-1].data}:d.drilledLegendItems={name:r.levelOrderName,data:r},d.treeMapLegendModule.renderLegend()),i=t.isNullOrUndefined(d.totalRect)?i:d.totalRect),document.getElementById(f)){var o=document.getElementById(f);o.parentNode.removeChild(o)}t.isNullOrUndefined(e.childItems)||e.cancel?(d.layout.calculateLayoutItems(c,i),d.layout.renderLayoutItems()):d.layout.onDemandProcess(e.childItems)}}),o={cancel:!1,name:"drillEnd",treemap:this,renderItems:this.layout.renderItems},this.trigger("drillEnd",o),!g&&t.isNullOrUndefined(a)&&this.drilledItems.push({name:r.levelOrderName,data:r})}}this.mouseDown=!1,this.notify(t.Browser.touchEndEvent,e)},o.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&($(this.treeMapHighlightModule.shapeHighlightCollection,this),this.treeMapHighlightModule.highLightId=""),this.removeFocus("")},o.prototype.keyUpHandler=function(e){if("Tab"===e.code){var t=e.target.id,i=document.getElementById(t);if(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)if(this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapHighlightModule&&this.highlightSettings.enable){i.style.setProperty("outline","none"),i.classList.add("keyboard-focused");var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapHighlightModule.highlightOnMouseMove(l)}else this.removeFocus(""),i.style.outline="2px solid black",i.classList.add("keyboard-focused");else k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&$(this.treeMapHighlightModule.shapeHighlightCollection,this),this.removeFocus("none")}},o.prototype.keyDownHandler=function(e){var t=e.target.id,i=document.getElementById(t);if("Enter"===e.code){if(this.selectionSettings.enable&&(t.indexOf("Item_Index")>-1||t.indexOf("Legend")>-1)){var l=t.indexOf("_Legend_")>-1&&"Default"===this.legendSettings.mode?i.children[0]:i;this.treeMapSelectionModule.selectionOnMouseDown(l)}this.enableDrillDown&&i.childElementCount>0&&this.mouseEndOnTreeMap(e)}},o.prototype.focusHandler=function(e){var t=e.target.id;(!this.element.contains(e.relatedTarget)||t.indexOf("Item_Index")>-1&&e.relatedTarget.id.indexOf("Legend")>-1||t.indexOf("Legend")>-1&&e.relatedTarget.id.indexOf("Item_Index")>-1)&&(this.treeMapHighlightModule&&this.highlightSettings.enable?(k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),$(this.treeMapHighlightModule.legendHighlightCollection,this),this.treeMapHighlightModule.highLightId=""):this.removeFocus("none"))},o.prototype.removeFocus=function(e){var t=document.querySelector(".keyboard-focused");t&&(t.style.outline=e,t.classList.remove("keyboard-focused"))},o.prototype.selectItem=function(e,i){t.isNullOrUndefined(i)&&(i=!0);for(var l="",o=0;o<e.length;o++)o!==e.length-1?l+=e[o]+"#":l+=e[o];this.treeMapSelectionModule&&this.selectionSettings.enable&&this.treeMapSelectionModule.selectTreemapItem(l,i)},o.prototype.requiredModules=function(){var e=[];return this.tooltipSettings.visible&&e.push({member:"treeMapTooltip",args:[this],name:"TreeMapTooltip"}),this.highlightSettings.enable&&e.push({member:"treeMapHighlight",args:[this],name:"TreeMapHighlight"}),this.selectionSettings.enable&&e.push({member:"treeMapSelection",args:[this],name:"TreeMapSelection"}),this.legendSettings.visible&&e.push({member:"treeMapLegend",args:[this],name:"TreeMapLegend"}),this.allowPrint&&e.push({member:"Print",args:[this,Ee],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,De],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,Pe],name:"PdfExport"}),e},o.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed){for(var i=!1,l=0,o=Object.keys(e);l<o.length;l++)switch(o[l]){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(),oe("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),e.prototype.destroy.call(this),this.areaRect=null,this.themeStyle=null,this.totalRect=null,this.drilledLegendItems=null,this.doubleTapTimer=null,this.treemapLevelData=null,this.resizeEvent=null,this.availableSize=null,this.intl=null,t.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},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""},ze([t.Property(!1)],o.prototype,"allowPrint",void 0),ze([t.Property(!1)],o.prototype,"allowImageExport",void 0),ze([t.Property(!1)],o.prototype,"allowPdfExport",void 0),ze([t.Property(null)],o.prototype,"width",void 0),ze([t.Property(null)],o.prototype,"height",void 0),ze([t.Complex({},de)],o.prototype,"border",void 0),ze([t.Complex({},he)],o.prototype,"margin",void 0),ze([t.Property(null)],o.prototype,"background",void 0),ze([t.Property("Material")],o.prototype,"theme",void 0),ze([t.Complex({},me)],o.prototype,"titleSettings",void 0),ze([t.Property("Squarified")],o.prototype,"layoutType",void 0),ze([t.Property(null)],o.prototype,"dataSource",void 0),ze([t.Property(null)],o.prototype,"query",void 0),ze([t.Property(null)],o.prototype,"weightValuePath",void 0),ze([t.Property("")],o.prototype,"rangeColorValuePath",void 0),ze([t.Property("")],o.prototype,"equalColorValuePath",void 0),ze([t.Property(null)],o.prototype,"colorValuePath",void 0),ze([t.Property([])],o.prototype,"palette",void 0),ze([t.Property("TopLeftBottomRight")],o.prototype,"renderDirection",void 0),ze([t.Property(!1)],o.prototype,"enableDrillDown",void 0),ze([t.Property(!1)],o.prototype,"enableBreadcrumb",void 0),ze([t.Property(" - ")],o.prototype,"breadcrumbConnector",void 0),ze([t.Property(!1)],o.prototype,"drillDownView",void 0),ze([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),ze([t.Complex({},ye)],o.prototype,"initialDrillDown",void 0),ze([t.Complex({},ve)],o.prototype,"leafItemSettings",void 0),ze([t.Collection([],Ie)],o.prototype,"levels",void 0),ze([t.Complex({},be)],o.prototype,"highlightSettings",void 0),ze([t.Complex({},xe)],o.prototype,"selectionSettings",void 0),ze([t.Complex({},Se)],o.prototype,"tooltipSettings",void 0),ze([t.Complex({},fe)],o.prototype,"legendSettings",void 0),ze([t.Property(!1)],o.prototype,"useGroupingSeparator",void 0),ze([t.Property(null)],o.prototype,"description",void 0),ze([t.Property(0)],o.prototype,"tabIndex",void 0),ze([t.Property(null)],o.prototype,"format",void 0),ze([t.Event()],o.prototype,"load",void 0),ze([t.Event()],o.prototype,"beforePrint",void 0),ze([t.Event()],o.prototype,"loaded",void 0),ze([t.Event()],o.prototype,"itemRendering",void 0),ze([t.Event()],o.prototype,"drillStart",void 0),ze([t.Event()],o.prototype,"drillEnd",void 0),ze([t.Event()],o.prototype,"itemSelected",void 0),ze([t.Event()],o.prototype,"itemHighlight",void 0),ze([t.Event()],o.prototype,"tooltipRendering",void 0),ze([t.Event()],o.prototype,"itemClick",void 0),ze([t.Event()],o.prototype,"itemMove",void 0),ze([t.Event()],o.prototype,"click",void 0),ze([t.Event()],o.prototype,"doubleClick",void 0),ze([t.Event()],o.prototype,"rightClick",void 0),ze([t.Event()],o.prototype,"mouseMove",void 0),ze([t.Event()],o.prototype,"resize",void 0),ze([t.Event()],o.prototype,"legendItemRendering",void 0),ze([t.Event()],o.prototype,"legendRendering",void 0),o=ze([t.NotifyPropertyChanges],o)}(t.Component),Re=function(){function e(){}return e}(),Ue=function(){function e(e){this.page=0,this.legendBorderRect=new Fe(0,0,0,0),this.currentPage=0,this.heightIncrement=0,this.widthIncrement=0,this.textMaxWidth=0,this.legendInteractiveGradient=[],this.legendItemRect=new Fe(0,0,0,0),this.treemap=e,this.addEventListener()}return e.prototype.renderLegend=function(){var e=this;this.page=0,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={cancel:!1,name:"legendRendering",treemap:this.treemap,_changePosition:this.treemap.legendSettings.position,position:this.treemap.legendSettings.position};this.treemap.trigger("legendRendering",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,l=i.legendSettings;if(this.findColorMappingLegendItems(i.treemapLevelData.levelsData[0]),(!t.isNullOrUndefined(this.treemap.palette)&&this.treemap.palette.length>0||!t.isNullOrUndefined(i.colorValuePath))&&0===this.legendCollections.length&&this.findPaletteLegendItems(i.treemapLevelData.levelsData[0]),this.legendCollections.length>0){this.legendCollections.sort(function(e,t){return e.levelIndex>t.levelIndex?1:e.levelIndex<t.levelIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.groupIndex>t.groupIndex?1:e.groupIndex<t.groupIndex?-1:0}),this.legendCollections.sort(function(e,t){return e.leafIndex>t.leafIndex?1:e.leafIndex<t.leafIndex?-1:0});var o=l.position,n=i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(l.title.text):l.title.text,s=l.titleStyle,d=l.mode,h=0,p=0,g=0,c=0,m=l.shapeHeight,u=l.shapeWidth,f=[],y=[],v="None"===l.orientation?"Top"===o||"Bottom"===o||"Auto"===o&&i.availableSize.width<=i.availableSize.height?"Horizontal":"Vertical":l.orientation,S=l.width.length>1?l.width.indexOf("%")>-1?i.availableSize.width/100*parseFloat(l.width):parseFloat(l.width):null,x=l.height.length>1?l.height.indexOf("%")>-1?i.availableSize.height/100*parseFloat(l.height):parseFloat(l.height):null;s.fontFamily=s.fontFamily||i.themeStyle.fontFamily,s.fontWeight=s.fontWeight||i.themeStyle.titleFontWeight,s.size=s.size||i.themeStyle.subtitleFontSize;var b=r(n,s),I=0,C=0,F=l.shapePadding,w=l.textStyle;if(w.size=w.size||i.themeStyle.legendFontSize,w.fontFamily=w.fontFamily||i.themeStyle.fontFamily,w.fontWeight=w.fontWeight||i.themeStyle.fontWeight,"Default"===d){S=t.isNullOrUndefined(S)?i.areaRect.width:S,x=t.isNullOrUndefined(x)?i.areaRect.height:x;for(var O=0,L=0;L<this.legendCollections.length;L++){var T=this.legendCollections[L];t.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]});var M=r(i.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(T.legendName):T.legendName,w);if(this.textMaxWidth=Math.max(this.textMaxWidth,M.width),0===L)I=h=10+u/2,C=p=10+b.height+(m>M.height?m/2:M.height/4);else{var N=M.height>m?M.height:m;if("Horizontal"===v){var _=y[O-1].x+y[O-1].width+10+u;if(_+F+M.width>S){var E=(y[O-1].y>f[O-1].y+m/2?y[O-1].y:f[O-1].y+m/2)+10;E+N>x?(this.getPageChanged(),O=0,f=[],y=[],h=I,p=C):(h=f[0].x,p=E+N/2)}else h=_-u/2,p=f[O-1].y}else{var D=y[O-1].y>f[O-1].y+m/2?y[O-1].y:f[O-1].y+m/2;if(D+10+N>x){var P=y[O-1].x+this.textMaxWidth+10;P+F+M.width>S?(h=I,p=C,y=[],f=[],this.getPageChanged(),O=0):(h=P+u/2,p=f[0].y)}else h=f[O-1].x,p=D+10+m/2}}g=h+u/2+F,c=p+M.height/4,f.push({x:h,y:p}),y.push({x:g,y:c,width:M.width,height:M.height/2}),this.totalPages[this.page].Collection.push({DisplayText:T.legendName,element:T.gradientElement,Shape:{x:h,y:p},Text:{x:g,y:c},Fill:T.legendFill,Data:T.legendData,Rect:{x:f[O].x-u/2,y:f[O].y-m/2<c-M.height?f[O].y-m/2:c-M.height,width:Math.abs(f[O].x-u/2-(g+M.width)),height:m>M.height?m:M.height}}),O++}var B=this.totalPages[0].Collection;B.forEach(function(t,i){var l=new Fe(t.Rect.x,t.Rect.y,t.Rect.width,t.Rect.height);0===i&&(I=l.x,C=l.y),e.widthIncrement=Math.max(e.widthIncrement,Math.abs(I-(l.x+l.width))),e.heightIncrement=Math.max(e.heightIncrement,Math.abs(C-(l.y+l.height)))}),S=this.widthIncrement<S?this.widthIncrement:S,x=this.heightIncrement<x?this.heightIncrement:x,this.legendItemRect={x:B[0].Rect.x,y:B[0].Rect.y,width:S,height:x}}else{var z=this.legendCollections.length,H="Horizontal"===v?t.isNullOrUndefined(S)?i.areaRect.width/z:S/z:t.isNullOrUndefined(S)?25:S,R="Horizontal"===v?t.isNullOrUndefined(x)?25:x:t.isNullOrUndefined(x)?i.areaRect.height/z:x/z;I=0,C=b.height+10;for(var U=l.labelPosition,k=0,A=0,W=l.labelDisplayMode,j=0,V=0,L=0;L<this.legendCollections.length;L++){I="Horizontal"===v?I+H:I,C="Horizontal"===v?C:C+R;var G=this.legendCollections[L].legendName,q=new Ce(0,0);"None"===W?q=r(G,w):"Trim"===W?q=r(G=a("Horizontal"===v?H:R,G,w),w):G="",j=Math.max(j,q.height),V=Math.max(V,q.width),q.width>0&&q.height>0&&("Horizontal"===v?(g=I+H/2,c="After"===U?C+R+q.height/2+10:C-10):(g="After"===U?I-q.width/2-10:I+H+q.width/2+10,c=C+R/2+q.height/4)),0===L&&(k="Horizontal"===v?I:"After"===U?g-q.width/2:I,A="Horizontal"===v?"After"===U?C:c-q.height/2:C),L===z-1&&(S="Horizontal"===v?Math.abs(I+H-k):H+V+10,x="Horizontal"===v?R+j/2+10:Math.abs(C+R-A)),this.legendRenderingCollections.push({fill:this.legendCollections[L].legendFill,x:I,y:C,width:H,height:R,element:this.legendCollections[L].gradientElement,text:G,textX:g,textY:c,textWidth:q.width,textHeight:q.height,data:this.legendCollections[L].legendData})}this.legendItemRect={x:k,y:A,width:S,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=u(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){var i,l;if(!t.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!t.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&t.isNullOrUndefined(this.treemap.drilledLegendItems))for(var o=u(e).values,n=0;n<o.length;n++)if(o[n].Name===this.treemap.initialDrillDown.groupName){o[n].isDrilled=!o[n].isDrilled,e=o[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:o[n].data[this.treemap.colorValuePath];break}if(this.treemap.enableDrillDown&&!t.isNullOrUndefined(this.treemap.drilledLegendItems)){var r=this.treemap.drilledLegendItems;if(t.isNullOrUndefined(r.data.options))for(n=0;n<r.length;n++){l=this.treemap.palette.length>0?this.treemap.palette[n%this.treemap.palette.length]:r[n].data[this.treemap.colorValuePath];break}else l=r.data.options.fill;i=r.data.isDrilled?u(r.data).values:u(r.data.parent).values}else i=u(e).values;var a;if(i&&i.length>0){for(var s=0;s<i.length;s++)(t.isNullOrUndefined(i[s].data[this.treemap.legendSettings.showLegendPath])||i[s].data[this.treemap.legendSettings.showLegendPath])&&(a=i[s].data[this.treemap.legendSettings.valuePath]?i[s].data[this.treemap.legendSettings.valuePath]:i[s].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,a)||this.legendCollections.push({legendName:a,legendFill:this.treemap.palette.length>0?t.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:l:i[s].data[this.treemap.colorValuePath],legendData:[],itemArea:i[s].weight,levelOrderName:i[s].levelOrderName}));if(this.legendCollections.sort(H),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]:l}},e.prototype.calculateLegendItems=function(e){var i,l,o,n,r,a,s,d,h,p,g,c,m,u,f,y,v,S,x,b=!1,I=this.treemap.leafItemSettings,C=this.treemap.levels,F=this.treemap.legendSettings.position,w=!1,O=0;this.outOfRangeLegend=null;for(var L=0;L<e.length;L++){l="",f=!1,y=!1,w=!1,n=e[L].data,d=e[L].groupIndex,s=(a=0===this.treemap.levels.length||d===this.treemap.levels.length)?I.colorMapping:C[d].colorMapping;for(var T=0;T<s.length;T++){var M=s[T];if(p=null,o=Number(n[this.treemap.rangeColorValuePath]),h=n[this.treemap.equalColorValuePath],M.value=t.isNullOrUndefined(M.value)?M.value:M.value.toString(),!t.isNullOrUndefined(M.from)&&!t.isNullOrUndefined(M.to)&&o>=M.from&&o<=M.to&&M.showLegend?(b=!0,y=!0,m=M.from+" - "+M.to,r=t.isNullOrUndefined(M.label)?M.from+" - "+M.to:M.label,l=t.isNullOrUndefined(M.color)?l:M.color,i=this.isAddNewLegendData(m)):!t.isNullOrUndefined(M.value)&&h===M.value&&M.showLegend&&(b=!0,f=!0,m=M.value.toString(),r=t.isNullOrUndefined(M.label)?M.value.toString():M.label,l=t.isNullOrUndefined(M.color)?l:"[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,i=this.isAddNewLegendData(m)),b&&t.isNullOrUndefined(M.value)&&M.maxOpacity&&M.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var N=[];if(w=!0,"[object Array]"===Object.prototype.toString.call(M.color))for(var _=0;_<M.color.length;_++){E={colorStop:(_*(100/(M.color.length-1))+"%").toString(),color:M.color[_]};N.push(E)}else{var E={colorStop:"0%",color:l},D={colorStop:"100%",color:l};N.push(E),N.push(D)}g="Top"===F||"Bottom"===F?"100%":"0%",c="Top"===F||"Bottom"===F?"0%":"100%";var P={id:"groupIndex_"+d+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:g,y2:c};p=this.treemap.renderer.drawGradient("linearGradient",P,N).childNodes[0],"[object Array]"!==Object.prototype.toString.call(M.color)&&(p.childNodes[0].setAttribute("stop-opacity",M.minOpacity.toString()),p.childNodes[1].setAttribute("stop-opacity",M.maxOpacity.toString())),this.defsElement.appendChild(p),this.gradientCount++}if(u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,r),i&&i.process&&b&&!u?(b=!1,l="[object Array]"===Object.prototype.toString.call(M.color)&&t.isNullOrUndefined(p)&&t.isNullOrUndefined(M.value)?this.legendGradientColor(M,O):l,this.legendCollections.push({actualValue:m,levelIndex:a?-1:T,leafIndex:a?T:-1,legendName:r,legendFill:l,legendData:[],groupIndex:a?-1:d,gradientElement:t.isNullOrUndefined(p)?t.isNullOrUndefined(M.value)?this.legendLinearGradient:null:p,name:e[L].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[L]),O++):b&&(b=!1,this.legendCollections[i.value].legendData.push(e[L])),!y&&!w&&!f&&t.isNullOrUndefined(M.from)&&t.isNullOrUndefined(M.to)&&t.isNullOrUndefined(M.minOpacity)&&t.isNullOrUndefined(M.maxOpacity)&&t.isNullOrUndefined(M.value)&&!t.isNullOrUndefined(M.color)){v="[object Array]"===Object.prototype.toString.call(M.color)?M.color[0]:M.color,S=t.isNullOrUndefined(M.label)?"Others":M.label,u=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,S),t.isNullOrUndefined(this.outOfRangeLegend)&&!u&&(this.legendCollections.push({actualValue:S,legendData:[],legendName:S,legendFill:v,groupIndex:!a||d>-1?d:-1}),x=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[x-1],O++);for(var B=this.legendCollections.length-1;B>=0;B--)if(this.legendCollections[B].actualValue===(M.label||"Others")){this.legendCollections[B].legendData.push(e[L]);break}}}}},e.prototype.removeDuplicates=function(e,t){for(var i=!1,l=0;l<e.length;l++)if(e[l].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 l=0;l<this.legendCollections.length;l++){if(e===this.legendCollections[l].actualValue){t=!1,i=l;break}l===this.legendCollections.length-1&&(t=!0)}return{process:t,value:i}},e.prototype.drawLegend=function(){var e,i,l=this.treemap.legendSettings,o=this.treemap.renderer,n=l.textStyle;if(this.legendGroup=o.createGroup({id:this.treemap.element.id+"_Legend_Group"}),this.renderLegendBorder(),this.renderLegendTitle(),"Default"===l.mode)this.drawLegendItem(this.currentPage);else for(var r=0;r<this.legendRenderingCollections.length;r++){var a=this.treemap.element.id+"_Legend_Index_"+r,s=this.treemap.element.id+"_Legend_Index_"+r+"_Text",d=this.legendRenderingCollections[r];e=(i=d.element)?"url(#"+i.id+")":d.fill;var p=new Fe(d.x,d.y,d.width,d.height),g=new Te(d.textX,d.textY),c=new we(a,e,l.shapeBorder,l.opacity,p);this.treemap.enableRtl&&("Left"===this.treemap.legendSettings.position||"Right"===this.treemap.legendSettings.position||"Auto"===this.treemap.legendSettings.position&&this.treemap.availableSize.width>=this.treemap.availableSize.height?(c.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-(this.translate.y+c.height)-Math.abs(this.legendBorderRect.y-c.y),g.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+d.textHeight/2-Math.abs(this.legendBorderRect.y-g.y)):(c.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+c.width)-Math.abs(this.legendBorderRect.x-c.x),g.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-g.x)));var m=this.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d.text):d.text;h(new Le(s,g.x,g.y,"middle",m,"",""),n,n.color||this.treemap.themeStyle.legendTextColor,this.legendGroup);var u=o.drawRectangle(c);u.setAttribute("tabindex",this.treemap.tabIndex.toString()),u.style.outline="",this.legendGroup.appendChild(u)}U(this.treemap,this.legendGroup)},e.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,n=e.Text,a=r(e.DisplayText,l.textStyle);return o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+t)-Math.abs(this.legendBorderRect.x-o.x),n.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+a.width+t)-Math.abs(this.legendBorderRect.x-n.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)-l.shapeHeight/2,n.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-n.y)),{shapeLocation:o,textLocation:n}},e.prototype.drawLegendItem=function(e){var i,l,o,n=this,a=this.treemap,s=a.legendSettings,d=new Ce(s.shapeWidth,s.shapeHeight),p=a.renderer,g=s.shapeBorder;if(e>=0&&e<this.totalPages.length){document.getElementById(this.legendGroup.id)&&document.getElementById(this.legendGroup.id).remove();for(var c="HorizontalLine"===s.shape||"VerticalLine"===s.shape||"Cross"===s.shape,m=c?t.isNullOrUndefined(s.fill)?"#000000":s.fill:g.color,u=c&&0===g.width?1:g.width,f=this,y=0;y<this.totalPages[e].Collection.length;y++)!function(r){var g=f.totalPages[e].Collection[r],y=f.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(g.DisplayText):g.DisplayText,v=p.createGroup({id:a.element.id+"_Legend_Index_"+r});v.setAttribute("aria-label",y+" Legend"),v.setAttribute("role","region"),v.setAttribute("tabindex",f.treemap.tabIndex.toString()),v.style.outline="none";var S=a.element.id+"_Legend_Shape_Index_"+r,x=a.element.id+"_Legend_Text_Index_"+r,b=g.Shape,I=g.Text;a.enableRtl&&(l=f.defaultLegendRtlLocation(g,10,a,s),b=l.shapeLocation,I=l.textLocation),o={cancel:!1,name:"legendItemRendering",treemap:a,fill:g.Fill,shape:s.shape,imageUrl:s.imageUrl},a.trigger("legendItemRendering",o,function(e){var t=new Oe(S,e.fill,u,c?g.Fill:m,s.opacity,"");v.appendChild(J(b,e.shape,d,e.imageUrl,t)),h(i=new Le(x,I.x,I.y,"start",y,"",""),s.textStyle,s.textStyle.color||a.themeStyle.legendTextColor,v),n.legendGroup.appendChild(v)})}(y);var v=void 0;if(0!==this.page){var S=e+1+"/"+this.totalPages.length,x=s.textStyle,b=r(S,x),I=this.legendItemRect.x+this.legendItemRect.width-b.width-20-10,C=this.legendItemRect.x+this.legendItemRect.width,F=this.legendItemRect.y+this.legendItemRect.height+2.5+10,w=C-10-b.width/2-5;v=p.createGroup({id:a.element.id+"_Legend_Paging_Group"});var O=p.createGroup({id:a.element.id+"_Legend_Left_Paging_Group"}),L=p.createGroup({id:a.element.id+"_Legend_Right_Paging_Group"}),T=" M "+C+" "+F+" L "+(C-10)+" "+(F-5)+" L "+(C-10)+" "+(F+5)+" z ",M=" M "+I+" "+F+" L "+(I+10)+" "+(F-5)+" L "+(I+10)+" "+(F+5)+" z ",N=new Oe(a.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,"",M);O.appendChild(p.drawPath(N));var _=new we(a.element.id+"_Left_Page_Rect","transparent",{},1,new Fe(I-5,F-10,20,20),"");O.appendChild(p.drawRectangle(_)),this.wireEvents(O);var E=new Oe(a.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",T);L.appendChild(p.drawPath(E));var D=new we(a.element.id+"_Right_Page_Rect","transparent",{},1,new Fe(C-10,F-5,10,10),"");L.appendChild(p.drawRectangle(D)),this.wireEvents(L),v.appendChild(O),v.appendChild(L);var P={id:a.element.id+"_Paging_Text",x:w,y:F+b.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":"",role:"region","aria-label":S};v.appendChild(p.createText(P,S)),this.legendGroup.appendChild(v)}}},e.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,l=t.titleStyle,o=r(a(this.legendItemRect.width+20,i,l),l);this.legendBorderRect=new Fe(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 n={color:t.border.color||this.treemap.themeStyle.legendBorderColor,width:t.border.width||this.treemap.themeStyle.legendBorderWidth},s=new we(e.element.id+"_Legend_Border",t.background,n,1,this.legendBorderRect,""),d=e.renderer.drawRectangle(s);d.style.pointerEvents="none",this.legendGroup.appendChild(d),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,i=this.treemap.legendSettings,l=i.titleStyle,o=this.treemap.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title.text):i.title.text,n=a(this.legendItemRect.width+20,o,l),s=r(n,l);if(o){var d=h(e=new Le(this.treemap.element.id+"_LegendTitle",this.legendItemRect.x+this.legendItemRect.width/2,this.legendItemRect.y-s.height/2-5,"middle",n,""),l,l.color||this.treemap.themeStyle.legendTitleColor,this.legendGroup);d.setAttribute("role","region"),d.setAttribute("aria-label",o)}},e.prototype.renderInteractivePointer=function(e){var i=this.treemap,l=e.target,o=i.element.id+"_Interactive_Legend",n=!1;l=e.type.indexOf("touch")>-1?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):l;var r,a=i.legendSettings;if(l.id.indexOf("_Item_Index")>-1&&a.visible&&this.legendRenderingCollections.length>0){var s=void 0,d=void 0,h=void 0,p=void 0,g=void 0,c=void 0,m=void 0;r=i.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])];for(var u=i.svgObject.getBoundingClientRect(),f=0;f<this.legendCollections.length&&!n;f++){s=this.legendCollections[f],d=(m=document.getElementById(i.element.id+"_Legend_Index_"+f)).getBoundingClientRect();var y=new Fe(Math.abs(d.left-u.left),Math.abs(d.top-u.top),d.width,d.height);if(p=m.getAttribute("fill"),g=a.shapeBorder.color,c=a.shapeBorder.width,!t.isNullOrUndefined(s.legendData)&&s.legendData.length>0){h=s.legendData;var v=i.rangeColorValuePath;if(r.levelOrderName.indexOf(this.legendCollections[f].legendName)>-1)this.drawInteractivePointer(a,p,g,o,c,y),n=!0;else for(var S=0;S<h.length;S++)if(i.rangeColorValuePath&&i.leafItemSettings.colorMapping.length>0?h[S].data[v]===r.data[v]:h[S].levelOrderName===r.levelOrderName||h[S].levelOrderName.indexOf(r.levelOrderName)>-1){this.drawInteractivePointer(a,p,g,o,c,y),n=!0;break}}else 0===this.treemap.leafItemSettings.colorMapping.length&&this.treemap.palette&&r.levelOrderName.indexOf(s.levelOrderName)>-1&&(this.drawInteractivePointer(a,p,g,o,c,y),n=!0)}}else this.removeInteractivePointer()},e.prototype.drawInteractivePointer=function(e,t,i,l,o,n){var r,a,s;r="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(a=n.x+n.width/2)+" "+(s=n.y+n.height)+" L "+(a-10)+" "+(s+10)+" L "+(a+10)+" "+(s+10)+" Z ":" M "+(a=n.x+n.width/2)+" "+(s=n.y)+" L "+(a-10)+" "+(s-10)+" L "+(a+10)+" "+(s-10)+" Z ":e.invertedPointer?" M "+(a=n.x)+" "+(s=n.y+n.height/2)+" L "+(a-10)+" "+(s-10)+" L "+(a-10)+" "+(s+10)+" z ":" M "+(a=n.x+n.width)+" "+(s=n.y+n.height/2)+" L "+(a+10)+" "+(s-10)+" L "+(a+10)+" "+(s+10)+" z ";var d=new Oe(l,t,o,i,1,"",r);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(d))},e.prototype.getLegendAlignment=function(e,i,l,o){var n,r,a,s=(a=t.extend({},e.areaRect,a,!0)).x,d=a.y,h=a.height,p=a.width,g=e.availableSize.width,c=e.availableSize.height,m="Auto"===o.position?g>c?"Right":"Bottom":o.position;if("Float"===o.position)this.translate=o.location;else{switch(m){case"Top":case"Bottom":a.height=h-l,n=g/2-i/2,r="Top"===m?d:d+a.height+10,a.y="Top"===m?d+l+10:d;break;case"Left":case"Right":a.width=p-i,n="Left"===m?s:s+a.width,r=c/2-l/2,a.x="Left"===m?s+i:s}switch(o.alignment){case"Near":"Top"===m||"Bottom"===m?n=a.x:r=a.y;break;case"Far":"Top"===m||"Bottom"===m?n=g-i:r=c-l}this.treemap.totalRect=a,this.translate=new Te(n,r)}},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.currentPage>=0&&this.currentPage<this.totalPages.length?this.drawLegend():this.currentPage=e.target.id.indexOf("_Left_Page_")>-1?0:this.totalPages.length-1},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(){clearTimeout(this.clearTimeout),this.clearTimeout=null,this.legendRenderingCollections=[],this.legendCollections=[],this.outOfRangeLegend=null,this.totalPages=[],this.translate=null,this.legendBorderRect=null,this.legendGroup=null,this.legendNames=[],this.defsElement=null,this.legendLinearGradient=null,this.legendInteractiveGradient=[],this.legendItemRect=null,this.removeEventListener(),this.treemap=null},e.prototype.legendGradientColor=function(e,i){var l,o="http://www.w3.org/2000/svg";if(!t.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var n=this.treemap.renderer.createDefs(),r=document.createElementNS(o,"linearGradient"),a=this.treemap.legendSettings.position,s="Top"===a||"Bottom"===a?"100":"0",d="Top"===a||"Bottom"===a?"0":"100";r.setAttribute("id","linear_"+i),r.setAttribute("x1","0%"),r.setAttribute("y1","0%"),r.setAttribute("x2",s+"%"),r.setAttribute("y2",d+"%");for(var h=0;h<e.color.length;h++){var p=100/(e.color.length-1),g=document.createElementNS(o,"stop");g.setAttribute("offset",h*p+"%"),g.setAttribute("stop-color",e.color[h]),g.setAttribute("stop-opacity",1..toString()),r.appendChild(g)}n.appendChild(r),this.legendLinearGradient=r;var c="url(#linear_"+i+")";this.defsElement.appendChild(r),l=c}return l},e}(),ke=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=e.target;return this.highlightOnMouseMove(t)},e.prototype.highlightOnMouseMove=function(e){var i,l,o,n,r,a,s,d=this.treemap,h=e.id,p=[],g=this.treemap.highlightSettings,c=[],m=this.treemap.treeMapSelectionModule,u=!1;if(m&&m.legendSelectionCollection.length>0)for(D=0;D<m.legendSelectionCollection.length;D++)for(B=0;B<m.legendSelectionCollection[D].ShapeCollection.Elements.length;B++){var y=parseFloat(m.legendSelectionCollection[D].ShapeCollection.Elements[B].id.split("Item_Index_")[1].split("_")[0]),v=h.indexOf("_Item_Index_")>-1?parseFloat(h.split("Item_Index_")[1].split("_")[0]):null;if(m.legendSelectionCollection[D].ShapeCollection.Elements[B].id===h||y===v){u=!0;break}}if(h.indexOf("_Item_Index")>-1&&!u){if(this.highLightId!==h||this.legendHighlightCollection[0]&&this.legendHighlightCollection[0].ShapeCollection.Elements.length>1){r=document.getElementById(d.element.id+"_TreeMap_"+d.layoutType+"_Layout");var S=document.getElementsByClassName("treeMapSelection");o=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];var x=void 0;if(this.treemap.legendSettings.visible){var b=this.treemap.treeMapLegendModule.legendCollections,I=this.treemap.treeMapLegendModule.legendCollections.length;x=!d.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0&&0===d.leafItemSettings.colorMapping.length&&0===d.levels.length?parseFloat(h.split("_Item_Index_")[1]):te(I,o,d),t.isNullOrUndefined(x)&&($(this.legendHighlightCollection,d),$(this.shapeHighlightCollection,d),this.legendHighlightCollection=[],d.treeMapLegendModule.removeInteractivePointer()),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+x):document.getElementById(this.treemap.element.id+"_Legend_Index_"+x),null!==this.shapeElement&&(m&&this.shapeElement.id===(m&&m.shapeElement?m.shapeElement.id:null)?this.currentElement.length>0&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(ee(this.shapeHighlightCollection,this.currentElement,d),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),$(this.shapeHighlightCollection,d),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:b[x].legendFill,oldOpacity:b[x].opacity,oldBorderColor:b[x].borderColor,oldBorderWidth:b[x].borderWidth}),K("Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+x):document.getElementById(this.treemap.element.id+"_Legend_Index_"+x+"_Text"),g.fill,g.opacity,null,null),K(this.shapeElement,g.fill,g.opacity,g.border.color,g.border.width.toString()),this.target="highlight"))}s=f(o,[],g.mode,d);for(D=0;D<r.childElementCount;D++){a=r.childNodes[D],n=!0;var C=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,F=d.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])];o=d.layout.renderItems[parseFloat(a.id.split("_Item_Index_")[1])];for(B=0;B<S.length;B++)if(a.id===S[B].id||a.id===S[B].parentElement.id){n=!1;break}s.indexOf(o.levelOrderName)>-1&&n&&(t.isNullOrUndefined(C)||(o.data[C]===F.data[C]||"Item"!==g.mode&&d.levels.length>0))&&(c.push(a),p.push(o))}k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d);for(var w=0;w<c.length;w++)A((a=c[w]).childNodes[0],{border:g.border,fill:g.fill,opacity:g.opacity}),a.classList.add("treeMapHighLight"),this.highLightId=h;l={cancel:!1,name:"itemHighlight",treemap:d,items:p,elements:c},d.trigger("itemHighlight",l)}}else if(h.indexOf("_Legend_Shape")>-1||h.indexOf("_Legend_Index")>-1||h.indexOf("_Legend_Text_Index")>-1){t.isNullOrUndefined(m)||(m.legendSelectId=t.isNullOrUndefined(d.legendId[0])?null:d.legendId[0]);var O=m&&m.legendSelectId?parseFloat(m.legendSelectId.split("Index_")[1]):m&&m.shapeSelectId?parseFloat(m.shapeSelectId.split("Index_")[1]):null,L="Default"===this.treemap.legendSettings.mode?-1===h.indexOf("Text")?parseFloat(h.split("_Legend_Shape_Index_")[1]):parseFloat(h.split("_Legend_Text_Index_")[1]):parseFloat(h.split("_Legend_Index_")[1]);if(this.treemap.legendSettings.visible&&L!==O){var T,M=void 0,N=void 0,C=""!==d.rangeColorValuePath?d.rangeColorValuePath:null,_=document.getElementById(h);"highlight"===this.shapeTarget&&($(this.legendHighlightCollection,this.treemap),this.legendHighlightCollection=[]),this.shapeTarget="highlight";for(var E=this.treemap.treeMapLegendModule.legendCollections[L].legendData.length,b=this.treemap.treeMapLegendModule.legendCollections,D=0;D<E;D++)for(B=0;B<this.treemap.layout.renderItems.length;B++)if(!t.isNullOrUndefined(C)&&d.leafItemSettings.colorMapping.length>0&&0===d.levels.length?d.treeMapLegendModule.legendCollections[L].legendData[D].data[C]===d.layout.renderItems[B].data[C]:d.treeMapLegendModule.legendCollections[L].legendData[D].levelOrderName===d.layout.renderItems[B].levelOrderName){M=B,N=this.treemap.layout.renderItems[B].groupIndex;z=document.getElementById(this.treemap.element.id+"_Level_Index_"+N+"_Item_Index_"+M+"_RectPath");0!==D&&0!==this.legendHighlightCollection.length||(this.legendHighlightCollection=[],ie(this.legendHighlightCollection,L,B,_,z,this.treemap.layout.renderItems,b),T=this.legendHighlightCollection.length,this.legendHighlightCollection[T-1].ShapeCollection={Elements:[]});var P=void 0;_.id.indexOf("Text")>-1?(P="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+L),K(_,g.fill,g.opacity,null,null),K(P,g.fill,g.opacity,g.border.color,g.border.width.toString())):(K("Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+L),g.fill,g.opacity,null,null),K(_,g.fill,g.opacity,g.border.color,g.border.width.toString())),K(z,g.fill,g.opacity,g.border.color,g.border.width.toString()),T=this.legendHighlightCollection.length,this.legendHighlightCollection[T-1].ShapeCollection.Elements.push(z)}if(0===E&&this.treemap.palette&&this.treemap.palette.length>0)for(var B=0;B<this.treemap.layout.renderItems.length;B++)if((this.treemap.treeMapLegendModule.legendCollections[L].levelOrderName===this.treemap.layout.renderItems[B].levelOrderName||this.treemap.layout.renderItems[B].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[L].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&d.palette&&d.palette.length>0)||this.treemap.layout.renderItems[B].parent.isDrilled||L===B)){M=B,N=this.treemap.layout.renderItems[B].groupIndex;var z=document.getElementById(this.treemap.element.id+"_Level_Index_"+N+"_Item_Index_"+M+"_RectPath");ie(this.legendHighlightCollection,L,B,_,z,this.treemap.layout.renderItems,b),T=this.legendHighlightCollection.length,this.legendHighlightCollection[T-1].ShapeCollection={Elements:[]};var H=void 0;_.id.indexOf("Text")>-1?(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+L),K(_,g.fill,g.opacity,null,null),K(H,g.fill,g.opacity,g.border.color,g.border.width.toString())):(K(H="Interactive"===this.treemap.legendSettings.mode?document.getElementById(_.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+L),g.fill,g.opacity,null,null),K(_,g.fill,g.opacity,g.border.color,g.border.width.toString())),K(z,g.fill,g.opacity,g.border.color,g.border.width.toString()),T=this.legendHighlightCollection.length,this.legendHighlightCollection[T-1].ShapeCollection.Elements.push(z)}}else k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),$(this.legendHighlightCollection,d),this.legendHighlightCollection=[]}else m&&this.shapeElement&&this.shapeElement.getAttribute("id")===m.legendSelectId||(m?this.shapeElement!==m.shapeElement:this.treemap.legendSettings.visible)&&k(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",d),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||m&&this.shapeElement&&this.shapeElement.getAttribute("id")===m.legendSelectId||(m?this.shapeElement!==m.shapeElement:!m||m.legendSelect)&&($(this.shapeHighlightCollection,d),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&$(this.legendHighlightCollection,this.treemap),this.highLightId="",i=!1;return i},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(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null},e}(),Ae=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=e.target;e.preventDefault(),this.selectionOnMouseDown(t)},e.prototype.selectionOnMouseDown=function(e){var i,l=this.treemap;e.setAttribute("tabindex","-1"),e.style.outline="none",e.id.includes("Legend_Shape_Index")||e.focus();var o,n,r,a,s=[],d=e.id,h=e.innerHTML,g=[],c=l.selectionSettings,m=this.treemap.treeMapHighlightModule,u=l.element.id+"_TreeMap_"+l.layoutType+"_Layout",y=(o=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])])&&!o.isLeafItem&&l.enableDrillDown&&(e.textContent.indexOf("[+]")>-1||e.textContent.indexOf("[-]")>-1||!t.isNullOrUndefined(e.nextElementSibling)&&(e.nextSibling.textContent.indexOf("[+]")>-1||e.nextSibling.textContent.indexOf("[-]")>-1));if(d.indexOf("_Item_Index")>-1&&!y)if(this.treemap.selectionId!==d&&(!l.selectionId||parseFloat(l.selectionId.split("_Item_Index_")[1])!==parseFloat(d.split("_Item_Index_")[1]))||this.legendSelectionCollection[0]&&this.legendSelectionCollection[0].ShapeCollection.Elements.length>1){l.levelSelection=[],l.legendId=[],this.shapeSelectId="",$(this.legendSelectionCollection,l),this.legendSelectionCollection=[],n=document.getElementById(u);_=void 0;if(this.treemap.legendSettings.visible){this.shapeSelect=!1;var v=this.treemap.treeMapLegendModule.legendCollections.length,S=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,$(this.shapeSelectionCollection,l),m&&(m.shapeTarget="selection",m.shapeHighlightCollection=[]),_=!l.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0&&0===l.leafItemSettings.colorMapping.length&&0===l.levels.length?parseFloat(d.split("_Item_Index_")[1]):te(v,o,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+_):document.getElementById(this.treemap.element.id+"_Legend_Index_"+_),null!==this.shapeElement&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:S[_].legendFill,oldOpacity:S[_].opacity,oldBorderColor:S[_].borderColor,oldBorderWidth:S[_].borderWidth}),K(B="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+_):document.getElementById(this.treemap.element.id+"_Legend_Index_"+_+"_Text"),c.fill,c.opacity,null,null),K(this.shapeElement,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.legendId.push(this.shapeElement.id),l.legendId.push(B.id))}a=f(o,[],c.mode,l);for(var x=0;x<n.childElementCount;x++){r=n.childNodes[x];var b=l.layout.renderItems[parseFloat(d.split("_Item_Index_")[1])];o=l.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])];N=""!==l.rangeColorValuePath?l.rangeColorValuePath:null;a.indexOf(o.levelOrderName)>-1&&(t.isNullOrUndefined(N)||(o.data[N]===b.data[N]||"Item"!==c.mode&&l.levels.length>0))&&(g.push(r),d.indexOf("_RectPath")>-1&&l.levelSelection.push(r.id),s.push(o))}k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=d;for(var I=document.getElementsByClassName("treeMapHighLight"),C=0;C<g.length;C++){if(r=g[C],I.length>0)for(z=0;z<I.length;z++)I[z].id===r.id&&I[z].classList.remove("treeMapHighLight"),A(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");else A(r.childNodes[0],{border:c.border,fill:c.fill,opacity:c.opacity}),r.classList.add("treeMapSelection");i={cancel:!1,name:"itemSelected",treemap:l,items:s,elements:g,text:h,contentItemTemplate:h},l.trigger("itemSelected",i,function(t){t.contentItemTemplate!==h&&p(d,e,t.contentItemTemplate)})}}else $(this.legendSelectionCollection,l),$(this.shapeSelectionCollection,l),this.treemap.legendId=[],this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.levelSelection=[],this.legendSelectId="",(this.legendSelect||this.shapeSelect)&&(k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="");else if(d.indexOf("_Legend_Shape")>-1||d.indexOf("_Legend_Index")>-1||d.indexOf("_Legend_Text_")>-1){var S=this.treemap.treeMapLegendModule.legendCollections,F=t.isNullOrUndefined(this.legendSelectId)?null:parseFloat(this.legendSelectId.split("_Index_")[1]);if(this.treemap.legendSettings.visible&&F!==parseFloat(d.split("_Index_")[1])){var w,O=void 0,L=void 0;l.legendId=[],l.levelSelection=[],this.legendSelectId=d,this.legendSelect=!1;var T=isNaN(parseInt(d[d.length-1],10))?parseInt(d[d.length-6],10):parseInt(d[d.length-1],10),M=document.getElementById(d);$(this.legendSelectionCollection,l),k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),$(this.shapeSelectionCollection,l),this.legendSelectionCollection=[],m&&(m.shapeTarget="selection",m.legendHighlightCollection=[]);for(var N=""!==l.rangeColorValuePath?l.rangeColorValuePath:null,_="Default"===this.treemap.legendSettings.mode?-1===d.indexOf("Text")?parseFloat(d.split("_Legend_Shape_Index_")[1]):parseFloat(d.split("_Legend_Text_Index_")[1]):parseFloat(d.split("_Legend_Index_")[1]),E=this.treemap.treeMapLegendModule.legendCollections[_].legendData.length,C=0;C<E;C++)for(var D=0;D<this.treemap.layout.renderItems.length;D++)if(!t.isNullOrUndefined(N)&&l.leafItemSettings.colorMapping.length>0&&0===l.levels.length?l.treeMapLegendModule.legendCollections[_].legendData[C].data[N]===l.layout.renderItems[D].data[N]:this.treemap.treeMapLegendModule.legendCollections[_].legendData[C].levelOrderName===this.treemap.layout.renderItems[D].levelOrderName){O=D,L=this.treemap.layout.renderItems[D].groupIndex;H=document.getElementById(this.treemap.element.id+"_Level_Index_"+L+"_Item_Index_"+O+"_RectPath");this.treemap.selectionId=H.id,0!==C&&0!==this.legendSelectionCollection.length||(ie(this.legendSelectionCollection,T,D,M,H,this.treemap.layout.renderItems,S),w=this.legendSelectionCollection.length,this.legendSelectionCollection[w-1].ShapeCollection={Elements:[]}),this.treemap.selectionId=H.id;var P=void 0,B=void 0;M.id.indexOf("Text")>-1?(K(P="Interactive"===this.treemap.legendSettings.mode?document.getElementById(M.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+_),c.fill,c.opacity,c.border.color,c.border.width.toString()),K(M,c.fill,c.opacity,null,null),this.legendSelectId=P.id,this.shapeElement=P,l.legendId.push(M.id),l.legendId.push(P.id)):(K(B="Interactive"===this.treemap.legendSettings.mode?document.getElementById(M.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+_),c.fill,c.opacity,null,null),K(M,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.shapeElement=M,l.legendId.push(M.id),l.legendId.push(B.id)),K(H,c.fill,c.opacity,c.border.color,c.border.width.toString()),w=this.legendSelectionCollection.length,l.levelSelection.push(H.id),this.legendSelectionCollection[w-1].ShapeCollection.Elements.push(H)}if(0===E&&this.treemap.palette&&this.treemap.palette.length>0)for(var z=0;z<this.treemap.layout.renderItems.length;z++)if((this.treemap.treeMapLegendModule.legendCollections[_].levelOrderName===this.treemap.layout.renderItems[z].levelOrderName||this.treemap.layout.renderItems[z].levelOrderName.indexOf(this.treemap.treeMapLegendModule.legendCollections[_].levelOrderName)>-1)&&(!(!this.treemap.legendSettings.removeDuplicateLegend&&l.palette&&l.palette.length>0)||this.treemap.layout.renderItems[z].parent.isDrilled||_===z)){O=z,L=this.treemap.layout.renderItems[z].groupIndex;var H=document.getElementById(this.treemap.element.id+"_Level_Index_"+L+"_Item_Index_"+O+"_RectPath");ie(this.legendSelectionCollection,_,z,M,H,this.treemap.layout.renderItems,S),this.treemap.selectionId=H.id,w=this.legendSelectionCollection.length,this.legendSelectionCollection[w-1].ShapeCollection={Elements:[]};var R=void 0;M.id.indexOf("Text")>-1?(R="Interactive"===this.treemap.legendSettings.mode?document.getElementById(M.id.replace("_Text","")):document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+_),K(M,c.fill,c.opacity,null,null),K(R,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=R.id,this.shapeElement=R):(K(R="Interactive"===this.treemap.legendSettings.mode?document.getElementById(M.id+"_Text"):document.getElementById(this.treemap.element.id+"_Legend_Text_Index_"+_),c.fill,c.opacity,null,null),K(M,c.fill,c.opacity,c.border.color,c.border.width.toString()),this.legendSelectId=d,this.shapeElement=M),K(H,c.fill,c.opacity,c.border.color,c.border.width.toString()),l.levelSelection.push(H.id),-1===l.legendId.indexOf(R.id)&&l.legendId.push(R.id),-1===l.legendId.indexOf(M.id)&&l.legendId.push(M.id),w=this.legendSelectionCollection.length,this.legendSelectionCollection[w-1].ShapeCollection.Elements.push(H)}}else $(this.legendSelectionCollection,this.treemap),$(this.shapeSelectionCollection,this.treemap),this.legendSelectionCollection=[],m&&(m.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.shapeElement=null,this.shapeSelectId="",(this.legendSelect||this.shapeSelect)&&(k(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="")}else y&&($(this.legendSelectionCollection,this.treemap),this.legendSelectionCollection=[],this.legendSelect=!0,this.legendSelectId="",this.treemap.legendId=[],this.treemap.levelSelection=[],this.treemap.selectionId="",this.shapeElement=null)},e.prototype.selectTreemapItem=function(e,t){if(t){for(var i=void 0,l=0;l<this.treemap.layout.renderItems.length;l++)if(e===this.treemap.layout.renderItems[l].levelOrderName){i=this.treemap.layout.renderItems[l];break}var o=this.treemap.selectionSettings,n=[],r=void 0,a=void 0,s=[];this.treemap.levelSelection=[];for(var d=this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout",h=document.getElementById(d),p=f(i,[],o.mode,this.treemap),g=0;g<h.childElementCount;g++)r=h.childNodes[g],i=this.treemap.layout.renderItems[parseFloat(r.id.split("_Item_Index_")[1])],p.indexOf(i.levelOrderName)>-1&&(n.push(r),this.treemap.levelSelection.push(r.id),s.push(i));if(this.treemap.legendSettings.visible)for(var c=0;c<s.length;c++){this.shapeSelect=!1;var m=this.treemap.treeMapLegendModule.legendCollections.length,u=this.treemap.treeMapLegendModule.legendCollections;this.shapeElement=void 0,Q(this.shapeSelectionCollection),a=te(m,s[c],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:u[a].legendFill,oldOpacity:u[a].opacity,oldBorderColor:u[a].borderColor,oldBorderWidth:u[a].borderWidth}),K(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}k(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"),S=0;S<n.length;S++)if(r=n[S],v.length>0)for(var x=0;x<v.length;x++)v[x].id===r.id&&v[x].classList.remove("treeMapHighLight"),A(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection");else o.fill="null"===o.fill?this.treemap.layout.renderItems[parseInt(r.id.split("Item_Index_")[1],10)].options.fill:o.fill,A(r.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),r.classList.add("treeMapSelection")}else Q(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],k(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(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null},e}(),We=function(e,t){var i={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&t.indexOf(l)<0&&(i[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,l=Object.getOwnPropertySymbols(e);o<l.length;o++)t.indexOf(l[o])<0&&(i[l[o]]=e[l[o]]);return i},je=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,l,o,n,r,a=this;-1!==e.type.indexOf("touch")?(this.isTouch=!0,i=(n=e).changedTouches[0].pageX,l=n.changedTouches[0].pageY,o=n.target):(this.isTouch="touch"===e.pointerType,i=e.pageX,l=e.pageY,o=e.target);var s,d,h,p,g=o.id,c={},m={},u=[];if(g.indexOf("_Item_Index")>-1&&-1===e.type.indexOf("key")){if(c=this.treemap.layout.renderItems[parseFloat(g.split("_Item_Index_")[1])],!t.isNullOrUndefined(c)){s=c.weight,m=c.data,t.isNullOrUndefined(c.options)||(p=c.options.fill),u=this.treemap.enableRtl?[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||j(s,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(t.isNullOrUndefined(this.tooltipSettings.format)?null:W(this.tooltipSettings.format,m,this.treemap))||this.treemap.weightValuePath.toString()+" : "+j(s,this.treemap)],document.getElementById(this.tooltipId)?d=document.getElementById(this.tooltipId):((d=t.createElement("div",{id:this.treemap.element.id+"_TreeMapTooltip",className:"EJ2-TreeMap-Tooltip"})).style.cssText="position: absolute;pointer-events:none;",document.getElementById(this.treemap.element.id+"_Secondary_Element").appendChild(d)),(h=w(i,l,this.treemap.svgObject)).y=this.tooltipSettings.template?h.y+10:h.y,this.tooltipSettings.textStyle.size=this.tooltipSettings.textStyle.size||this.treemap.themeStyle.tooltipFontSize,this.tooltipSettings.textStyle.fontFamily=this.tooltipSettings.textStyle.fontFamily||this.treemap.themeStyle.fontFamily,this.tooltipSettings.textStyle.fontStyle=t.isNullOrUndefined(this.tooltipSettings.textStyle.fontStyle)?"Normal":this.tooltipSettings.textStyle.fontStyle,this.tooltipSettings.textStyle.fontWeight=this.tooltipSettings.textStyle.fontWeight||this.treemap.themeStyle.fontWeight,this.tooltipSettings.textStyle.color=this.tooltipSettings.textStyle.color||this.treemap.themeStyle.tooltipFontColor,this.tooltipSettings.textStyle.opacity=this.tooltipSettings.textStyle.opacity||this.treemap.themeStyle.tooltipTextOpacity;var f={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"};if(this.treemap.enableHtmlSanitizer)for(var y=0;y<u.length;y++)u[y]=t.SanitizeHtmlHelper.sanitize(u[y]);r={cancel:!1,name:"tooltipRendering",item:c,options:{location:h,text:u,data:m,border:f,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:o,eventArgs:e},this.treemap.trigger("tooltipRendering",r,function(e){a.addTooltip(r,p,d)})}}else this.removeTooltip(),this.treemap.clearTemplate()},e.prototype.addTooltip=function(e,l,o,n){var r,a;t.isNullOrUndefined(e)?(r=n.cancel,a=n):(r=e.cancel,a=We(e,["cancel"]).options),r?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new i.Tooltip({theme:this.treemap.theme,enable:!0,header:"",data:a.data,template:a.template,content:a.text,shapes:[],location:a.location,palette:[l],areaBounds:this.treemap.areaRect,textStyle:a.textStyle,fill:this.treemap.tooltipSettings.fill?this.treemap.tooltipSettings.fill:this.treemap.themeStyle.tooltipFillColor,border:a.border,enableShadow:!0}),(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(){t.isNullOrUndefined(this.svgTooltip)||(this.svgTooltip.destroy(),this.svgTooltip.controlInstance=null,oe(this.treemap.element.id+"_TreeMapTooltip")),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},e}();return He.Inject(je,Ue,ke,Ae,Ee,Pe,De),e.Border=de,e.ColorMapping=ue,e.ColorValue=Me,e.CommonTitleSettings=ge,e.Font=pe,e.HighlightSettings=be,e.ImageExport=De,e.InitialDrillSettings=ye,e.LayoutPanel=_e,e.LeafItemSettings=ve,e.LegendSettings=fe,e.LevelSettings=Ie,e.LevelsData=Re,e.Location=Te,e.Margin=he,e.PathOption=Oe,e.PdfExport=Pe,e.Print=Ee,e.Rect=Fe,e.RectOption=we,e.SelectionSettings=xe,e.Size=Ce,e.SubTitleSettings=ce,e.TextOption=Le,e.TitleSettings=me,e.TooltipSettings=Se,e.TreeMap=He,e.TreeMapAjax=Ne,e.TreeMapHighlight=ke,e.TreeMapLegend=Ue,e.TreeMapSelection=Ae,e.TreeMapTooltip=je,e.applyOptions=A,e.beforePrint="beforePrint",e.click="click",e.colorCollections=T,e.colorMap=O,e.colorNameToHex=X,e.componentToHex=G,e.convertElement=v,e.convertHexToColor=q,e.convertToContainer=C,e.convertToHexCode=V,e.convertToRect=F,e.createTextStyle=d,e.deSaturationColor=L,e.defaultFont=re,e.doubleClick="doubleClick",e.drawSymbol=J,e.drillEnd="drillEnd",e.drillStart="drillStart",e.findChildren=u,e.findHightLightItems=f,e.findLabelLocation=S,e.findPosition=s,e.formatValue=j,e.getArea=b,e.getColorByValue=N,e.getElement=g,e.getGradientColor=_,e.getLegendIndex=te,e.getMousePosition=w,e.getPercentage=D,e.getPercentageColor=E,e.getShortestEdge=I,e.getTemplateFunction=y,e.getThemeStyle=ne,e.hide=z,e.isContainsData=m,e.isParentItem=Z,e.itemClick="itemClick",e.itemHighlight="itemHighlight",e.itemMove="itemMove",e.itemRendering="itemRendering",e.itemSelected="itemSelected",e.itemsToOrder=c,e.legendItemRendering="legendItemRendering",e.legendMaintain=U,e.legendRendering="legendRendering",e.load="load",e.loaded="loaded",e.maintainSelection=R,e.measureElement=x,e.measureText=r,e.mouseMove="mouseMove",e.orderByArea=H,e.pushCollection=ie,e.removeClassNames=k,e.removeElement=oe,e.removeLegend=$,e.removeSelectionWithHighlight=ee,e.removeShape=Q,e.renderLegendShape=Y,e.renderTextElement=h,e.resize="resize",e.rgbToHex=M,e.rightClick="rightClick",e.setColor=K,e.setItemTemplateContent=p,e.stringToNumber=n,e.textFormatter=W,e.textTrim=a,e.textWrap=B,e.tooltipRendering="tooltipRendering",e.triggerDownload=le,e.wordWrap=P,e}({},ej.base,ej.svgbase,ej.data,ej.pdfexport),this.ejs=ej;
|
|
11
2
|
//# sourceMappingURL=ej2-treemap.min.js.map
|
package/dist/global/index.d.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* filename: index.d.ts
|
|
3
|
-
* version : 31.2.12
|
|
4
|
-
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
|
-
* Use of this code is subject to the terms of our license.
|
|
6
|
-
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
-
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
-
* applicable laws.
|
|
9
|
-
*/
|
|
10
1
|
import * as _treemap from '@syncfusion/ej2-treemap';
|
|
11
2
|
|
|
12
3
|
export declare namespace ej {
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncfusion/ej2-treemap",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.1.19",
|
|
4
4
|
"description": "Essential JS 2 TreeMap Components",
|
|
5
5
|
"author": "Syncfusion Inc.",
|
|
6
6
|
"license": "SEE LICENSE IN license",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@syncfusion/ej2-base": "~
|
|
9
|
-
"@syncfusion/ej2-compression": "~
|
|
10
|
-
"@syncfusion/ej2-data": "~
|
|
11
|
-
"@syncfusion/ej2-file-utils": "~
|
|
12
|
-
"@syncfusion/ej2-pdf-export": "~
|
|
13
|
-
"@syncfusion/ej2-svg-base": "~
|
|
8
|
+
"@syncfusion/ej2-base": "~32.1.19",
|
|
9
|
+
"@syncfusion/ej2-compression": "~32.1.19",
|
|
10
|
+
"@syncfusion/ej2-data": "~32.1.19",
|
|
11
|
+
"@syncfusion/ej2-file-utils": "~32.1.19",
|
|
12
|
+
"@syncfusion/ej2-pdf-export": "~32.1.19",
|
|
13
|
+
"@syncfusion/ej2-svg-base": "~32.1.19"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {},
|
|
16
16
|
"keywords": [
|