@syncfusion/ej2-treemap 27.1.53 → 27.1.55
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/dist/ej2-treemap.min.js +2 -2
- package/dist/ej2-treemap.umd.min.js +2 -2
- package/dist/ej2-treemap.umd.min.js.map +1 -1
- package/dist/es6/ej2-treemap.es2015.js +19 -7
- package/dist/es6/ej2-treemap.es2015.js.map +1 -1
- package/dist/es6/ej2-treemap.es5.js +19 -7
- package/dist/es6/ej2-treemap.es5.js.map +1 -1
- package/dist/global/ej2-treemap.min.js +2 -2
- package/dist/global/ej2-treemap.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/treemap/layout/render-panel.js +14 -5
- package/src/treemap/model/base.js +2 -2
- package/src/treemap/model/interface.d.ts +4 -0
- package/src/treemap/model/theme.js +4 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-treemap.umd.min.js
|
|
3
|
-
* version : 27.1.
|
|
3
|
+
* version : 27.1.55
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2023. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,H,F,C,I){"use strict";var O,B,R="load",z="loaded",U="beforePrint",k="itemRendering",A="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",re="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,r=arguments.length,n=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(r<3?o(n):3<r?o(t,i,n):o(t,i))||n);return 3<r&&n&&Object.defineProperty(t,i,n),n},l=(B=H.ChildProperty,t(ne,B),i([H.Property("#808080")],ne.prototype,"color",void 0),i([H.Property(0)],ne.prototype,"width",void 0),ne);function ne(){return null!==B&&B.apply(this,arguments)||this}ae=H.ChildProperty,t(o,ae),i([H.Property(10)],o.prototype,"left",void 0),i([H.Property(10)],o.prototype,"right",void 0),i([H.Property(10)],o.prototype,"top",void 0),i([H.Property(10)],o.prototype,"bottom",void 0);var ae,se=o;function o(){return null!==ae&&ae.apply(this,arguments)||this}he=H.ChildProperty,t(n,he),i([H.Property(null)],n.prototype,"size",void 0),i([H.Property(null)],n.prototype,"color",void 0),i([H.Property(re)],n.prototype,"fontFamily",void 0),i([H.Property("")],n.prototype,"fontWeight",void 0),i([H.Property("Normal")],n.prototype,"fontStyle",void 0),i([H.Property(1)],n.prototype,"opacity",void 0);var he,r=n;function n(){return null!==he&&he.apply(this,arguments)||this}de=H.ChildProperty,t(ge,de),i([H.Property("")],ge.prototype,"text",void 0),i([H.Property("")],ge.prototype,"description",void 0);var de,pe=ge;function ge(){return null!==de&&de.apply(this,arguments)||this}t(ue,ce=pe),i([H.Complex({fontFamily:null,fontWeight:null},r)],ue.prototype,"textStyle",void 0),i([H.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([H.Complex({fontFamily:null,fontWeight:null},r)],ve.prototype,"textStyle",void 0),i([H.Property("Center")],ve.prototype,"alignment",void 0),i([H.Complex({},me)],ve.prototype,"subtitleSettings",void 0);var ye,fe=ve;function ve(){return null!==ye&&ye.apply(this,arguments)||this}be=H.ChildProperty,t(a,be),i([H.Property(null)],a.prototype,"from",void 0),i([H.Property(null)],a.prototype,"to",void 0),i([H.Property(null)],a.prototype,"color",void 0),i([H.Property(null)],a.prototype,"label",void 0),i([H.Property(null)],a.prototype,"value",void 0),i([H.Property(null)],a.prototype,"minOpacity",void 0),i([H.Property(null)],a.prototype,"maxOpacity",void 0),i([H.Property(!0)],a.prototype,"showLegend",void 0);var be,xe=a;function a(){return null!==be&&be.apply(this,arguments)||this}Se=H.ChildProperty,t(s,Se),i([H.Property(!1)],s.prototype,"visible",void 0),i([H.Property("Default")],s.prototype,"mode",void 0),i([H.Property("transparent")],s.prototype,"background",void 0),i([H.Property("Circle")],s.prototype,"shape",void 0),i([H.Property("")],s.prototype,"width",void 0),i([H.Property("")],s.prototype,"height",void 0),i([H.Complex({size:null,fontFamily:null,fontWeight:null},r)],s.prototype,"textStyle",void 0),i([H.Property(null)],s.prototype,"fill",void 0),i([H.Property(1)],s.prototype,"opacity",void 0),i([H.Property(15)],s.prototype,"shapeWidth",void 0),i([H.Property(15)],s.prototype,"shapeHeight",void 0),i([H.Property(10)],s.prototype,"shapePadding",void 0),i([H.Property(null)],s.prototype,"imageUrl",void 0),i([H.Complex({color:null,width:null},l)],s.prototype,"border",void 0),i([H.Complex({color:"#000000",width:0},l)],s.prototype,"shapeBorder",void 0),i([H.Complex({},pe)],s.prototype,"title",void 0),i([H.Complex({size:null,fontFamily:null,fontWeight:null},r)],s.prototype,"titleStyle",void 0),i([H.Property("Bottom")],s.prototype,"position",void 0),i([H.Property("None")],s.prototype,"orientation",void 0),i([H.Property(!1)],s.prototype,"invertedPointer",void 0),i([H.Property("After")],s.prototype,"labelPosition",void 0),i([H.Property("None")],s.prototype,"labelDisplayMode",void 0),i([H.Property("Center")],s.prototype,"alignment",void 0),i([H.Property({x:0,y:0})],s.prototype,"location",void 0),i([H.Property(null)],s.prototype,"showLegendPath",void 0),i([H.Property(null)],s.prototype,"valuePath",void 0),i([H.Property(!1)],s.prototype,"removeDuplicateLegend",void 0);var Se,we=s;function s(){return null!==Se&&Se.apply(this,arguments)||this}Fe=H.ChildProperty,t(Ie,Fe),i([H.Property(null)],Ie.prototype,"groupIndex",void 0),i([H.Property(null)],Ie.prototype,"groupName",void 0);var Fe,Ce=Ie;function Ie(){return null!==Fe&&Fe.apply(this,arguments)||this}Oe=H.ChildProperty,t(h,Oe),i([H.Property(null)],h.prototype,"fill",void 0),i([H.Property(!1)],h.prototype,"autoFill",void 0),i([H.Complex({},l)],h.prototype,"border",void 0),i([H.Property(0)],h.prototype,"gap",void 0),i([H.Property(10)],h.prototype,"padding",void 0),i([H.Property(1)],h.prototype,"opacity",void 0),i([H.Property(!0)],h.prototype,"showLabels",void 0),i([H.Property(null)],h.prototype,"labelPath",void 0),i([H.Property(null)],h.prototype,"labelFormat",void 0),i([H.Property("TopLeft")],h.prototype,"labelPosition",void 0),i([H.Complex({color:null,size:null},r)],h.prototype,"labelStyle",void 0),i([H.Property(null)],h.prototype,"labelTemplate",void 0),i([H.Property("Center")],h.prototype,"templatePosition",void 0),i([H.Property("Trim")],h.prototype,"interSectAction",void 0),i([H.Collection([],xe)],h.prototype,"colorMapping",void 0);var Oe,Le=h;function h(){return null!==Oe&&Oe.apply(this,arguments)||this}Te=H.ChildProperty,t(d,Te),i([H.Property(!1)],d.prototype,"visible",void 0),i([H.Property("")],d.prototype,"template",void 0),i([H.Property(null)],d.prototype,"format",void 0),i([H.Property(null)],d.prototype,"fill",void 0),i([H.Property(.75)],d.prototype,"opacity",void 0),i([H.Property(["Circle"])],d.prototype,"markerShapes",void 0),i([H.Complex({width:null,color:null},l)],d.prototype,"border",void 0),i([H.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},r)],d.prototype,"textStyle",void 0);var Te,Ne=d;function d(){return null!==Te&&Te.apply(this,arguments)||this}De=H.ChildProperty,t(p,De),i([H.Property(!1)],p.prototype,"enable",void 0),i([H.Property(null)],p.prototype,"fill",void 0),i([H.Property("0.5")],p.prototype,"opacity",void 0),i([H.Complex({},l)],p.prototype,"border",void 0),i([H.Property("Item")],p.prototype,"mode",void 0);var De,Ee=p;function p(){return null!==De&&De.apply(this,arguments)||this}Me=H.ChildProperty,t(g,Me),i([H.Property(!1)],g.prototype,"enable",void 0),i([H.Property("#808080")],g.prototype,"fill",void 0),i([H.Property("0.5")],g.prototype,"opacity",void 0),i([H.Complex({},l)],g.prototype,"border",void 0),i([H.Property("Item")],g.prototype,"mode",void 0);var Me,Pe=g;function g(){return null!==Me&&Me.apply(this,arguments)||this}_e=H.ChildProperty,t(c,_e),i([H.Property(null)],c.prototype,"groupPath",void 0),i([H.Property(0)],c.prototype,"groupGap",void 0),i([H.Property(10)],c.prototype,"groupPadding",void 0),i([H.Complex({},l)],c.prototype,"border",void 0),i([H.Property(null)],c.prototype,"fill",void 0),i([H.Property(!1)],c.prototype,"autoFill",void 0),i([H.Property(1)],c.prototype,"opacity",void 0),i([H.Property(!0)],c.prototype,"showHeader",void 0),i([H.Property(20)],c.prototype,"headerHeight",void 0),i([H.Property(null)],c.prototype,"headerTemplate",void 0),i([H.Property(null)],c.prototype,"headerFormat",void 0),i([H.Property("Near")],c.prototype,"headerAlignment",void 0),i([H.Complex({color:null,size:"13px"},r)],c.prototype,"headerStyle",void 0),i([H.Property("TopLeft")],c.prototype,"templatePosition",void 0),i([H.Collection([],xe)],c.prototype,"colorMapping",void 0);var _e,t=c;function c(){return null!==_e&&_e.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,r){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"]=r},E=function(e,t,i,l,o,r,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=r,this.d=n};function G(e,t){var i=document.getElementById("treeMapMeasureText");return null===i&&(i=H.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(i)),i.innerHTML=H.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,r,n,a){void 0===r&&(r=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=r,this.anchor=l,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a};function V(e,t,i){var l=t;if(e<G(t,i).width)for(var o=t.length-1;0<=o;--o)if(G(l=t.substring(0,o)+"...",i).width<=e||l.length<4)return l=l.length<4?" ":l;return l}var m=function(e,t){this.x=e,this.y=t};function Re(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 m(o,t)}function ze(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 r,n,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 F.SvgRenderer("");if(!H.isNullOrUndefined(i)&&!H.isNullOrUndefined(e.connectorText)&&0<=i.search(e.connectorText[1]))for(var h=i.split("#"),d=0;d<h.length;d++){var p=-1===h[d].search(e.connectorText)||H.isNullOrUndefined(e.connectorText)?h[d]:e.connectorText,p=(a.id=e.id+"_"+d,n=ze(s,a,p),d%2==0&&0!==d&&(p=p.replace(/\s+/g," ")),G(p,t));a.x=0!==d?a.x+p.width:a.x+p.width+5,l.appendChild(n)}else n=ze(s,a,i),l.appendChild(n);if("string"!=typeof e.text&&1<e.text.length){for(var g=1,c=e.text.length;g<c;g++)r=G(e.text[g],t).height,r=s.createTSpan({x:e.x,id:e.id,y:e.y+g*r},e.text[g]),n.appendChild(r);l.appendChild(n)}return n}function ke(e,t,i){var l=e.split("_RectPath")[0],e=-1<e.indexOf("_LabelTemplate")?t:document.querySelector("#"+l+"_LabelTemplate");H.isNullOrUndefined(e)||(e.innerHTML=i)}function Ae(e){return document.getElementById(e)}function He(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function We(e,t,i,l){for(var o=!1,r="",n=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:n.labelPath||l.weightValuePath]||"undefined";if(e[a]===s&&(r+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function M(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 je(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=M(e).values;if(o&&0<o.length){for(var r=0;r<o.length;r++)-1===t.indexOf(o[r].levelOrderName)&&t.push(o[r].levelOrderName);for(var n=0;n<o.length;n++)je(o[n],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),je(e.parent,t,i,l));else if("All"===i)for(var a=e.levelOrderName.split("#")[0],s=void 0,r=0;r<l.layout.renderItems.length;r++)-1<(s=l.layout.renderItems[r]).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?H.compile(document.querySelector(t).innerHTML.trim()):H.compile(t)}catch(e){i=H.compile(t)}return i}function Ve(e,t,i){for(var l=H.createElement("div",{id:t}),o=(l.style.cssText="position: absolute;pointer-events: auto;",e.length);0<o;)l.appendChild(e[0]),o--;for(var r=l.innerHTML,n=Object.keys(i),a=0;a<n.length;a++)var s=RegExp,r=r.replace(new s("{{:"+n[a]+"}}","g"),i[n[a].toString()]);return l.innerHTML=r,l}function qe(e,t,i,l,o){var r=new m(0,0),n="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return r.x=Math.abs(n-(-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?r.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)):r.y=Math.abs(e.y+e.height-i.height+5),r}function Xe(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 Je(e){return(e.width-e.x)*(e.height-e.y)}function Ye(e){var e=Ze(e),t=e.width,e=e.height;return Math.min(t,e)}function Ze(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function Qe(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function $e(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=l.left+o-i,i=l.top+r-n;return new m(e-o,t-i)}function Ke(e,t,i){var l,o,r=[];if(H.isNullOrUndefined(t)&&H.isNullOrUndefined(i)&&isNaN(i))return null;for(var n=0;n<e.length;n++){var a=!1,s=i;H.isNullOrUndefined(e[n].from)||H.isNullOrUndefined(e[n].to)||H.isNullOrUndefined(e[n].value)?(H.isNullOrUndefined(e[n].from)||H.isNullOrUndefined(e[n].to))&&H.isNullOrUndefined(e[n].value)||(i>=e[n].from&&e[n].to>=i||e[n].value===t)&&(e[n].value===t&&(a=!0),l="[object Array]"===Object.prototype.toString.call(e[n].color)?a?e[n].color[0]:tt(e[n],s):e[n].color):i>=e[n].from&&e[n].to>=i&&e[n].value===t&&(a=!0,l="[object Array]"===Object.prototype.toString.call(e[n].color)?a?e[n].color[0]:tt(e[n],s):e[n].color),(i>=e[n].from&&i<=e[n].to||e[n].value===t)&&!H.isNullOrUndefined(e[n].minOpacity)&&!H.isNullOrUndefined(e[n].maxOpacity)&&l&&(o=et(e[n],i)),(""===l||H.isNullOrUndefined(l))&&H.isNullOrUndefined(e[n].from)&&H.isNullOrUndefined(e[n].to)&&H.isNullOrUndefined(e[n].minOpacity)&&H.isNullOrUndefined(e[n].maxOpacity)&&H.isNullOrUndefined(e[n].value)&&(l="[object Array]"===Object.prototype.toString.call(e[n].color)?e[n].color[0]:e[n].color),o=H.isNullOrUndefined(o)?"1":o,r.push(l)}for(var h=r.length-1;0<=h;h--)h=(l=r[h])?-1:h;return{fill:l,opacity:o}}function et(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 tt(e,t){return lt(e,t)}function it(e,t,i){return"#"+u(e)+u(t)+u(i)}function lt(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:it((t=ot(Number(t),e)).r,t.g,t.b)}function ot(e,t){var i=t.from,l=t.to,o=0,r=l-i,o=(e-i)/r;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:y(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:y(t.color[t.color.length-1]);else{for(var n,a="#"===t.color[0].charAt(0)?t.color[0]:y(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:y(t.color[t.color.length-1]),h=r/(t.color.length-1),d=t.color.length-1,p=[],g=1;g<d;g++)n={b:i+g*h,color:t.color[g]},p.push(n);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:y(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/h):(e-p[c].b)/h):p[c].b<=e&&e<=l&&c===p.length-1&&(a="#"===p[c].color.charAt(0)?p[c].color:y(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/h):(e-p[c].b)/h),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:y(p[c].color),s="#"===p[c+1].color.charAt(0)?p[c+1].color:y(p[c+1].color),o=Math.abs(e-p[c+1].b)/h)}return rt(o,a,s)}function rt(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],l=nt(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=nt(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=nt(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new ut(l,o,e)}function nt(e,t,i){return Math.round(t+(i-t)*e)}function at(e,t,i){for(var l,o=t.split(" "),r="",n=[],a=0,s=o.length;a<s;a++)l=o[a],G(r.concat(l),i).width<e?r=r.concat((""===r?"":" ")+l):""!==r?(n.push(V(e,r,i)),r=l):n.push(V(e,l,i)),r&&a===s-1&&n.push(V(e,r,i));return n}function st(e,t,i){var l=[],o=0,r=G(t,i).width,n=t.length;if(r<=e)l.push(t);else for(var a=t.length;o<a;a--){var s=t.slice(o,a);if(G(s,i).width<=e){if(l.push(s),n===(o+=s.length))return l;a=n+1}}return l}function ht(e,t,i,l){l=G(i,l);return l.width>e||l.height>t?" ":i}function dt(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function pt(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]?0<t.childElementCount&&(t.children[0].setAttribute("class",i),D(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function gt(e,t){var i=e.legendId;if(i)for(var l=0;l<i.length;l++)for(var o,r=0;r<t.childElementCount;r++)t.childNodes[r].id===i[l]&&((o=t.childNodes[r]).setAttribute("fill",e.selectionSettings.fill),o.setAttribute("stroke",e.selectionSettings.border.color),o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("opacity",e.selectionSettings.opacity))}function N(e,t,i){for(var l,o,r=0;r<e.length;r++)l=H.isNullOrUndefined(e[r].childNodes[0])?e[r]:e[r].childNodes[0],o=i.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options,D(l,o),e[r].classList.remove(t),--r}function D(e,t){e.setAttribute("opacity",t.opacity),H.isNullOrUndefined(t.fill)||e.setAttribute("fill",t.fill),e.setAttribute("stroke",t.border.color),e.setAttribute("stroke-width",t.border.width)}function ct(e,t,i){if(H.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(t);l<o.length;l++){var r=o[l];e=e.split("${"+r+"}").join(mt(t[r],i).toString())}return e}function mt(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t||""}var ut=function(e,t,i){this.r=e,this.g=t,this.b=i};function yt(e){return"#"+u(e.r)+u(e.g)+u(e.b)}function u(e){e=e.toString(16);return 1===e.length?"0"+e:e}function ft(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new ut(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new ut(255,255,255)}function y(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 yt(new ut(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function vt(e,t,i,l,o){var r=new F.SvgRenderer(""),e=bt(e,i,t,o,l);return r["draw"+e.functionName](e.renderOption)}function bt(e,t,i,l,o){var r,n="Path",a=t.width,s=t.height,h=e.x,d=e.y,p=e.x+-a/2,g=e.y+-s/2;switch(i){case"Circle":case"Bubble":n="Ellipse",H.merge(l,{rx:a/2,ry:s/2,cx:h,cy:d});break;case"VerticalLine":H.merge(l,{d:r="M "+h+" "+(d+s/2)+" L "+h+" "+(d+-s/2)});break;case"Diamond":H.merge(l,{d:r="M "+p+" "+d+" L "+h+" "+(d+-s/2)+" L "+(h+a/2)+" "+d+" L "+h+" "+(d+s/2)+" L "+p+" "+d+" z"});break;case"Rectangle":H.merge(l,{d:r="M "+p+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+s/2)+" L "+p+" "+(d+s/2)+" L "+p+" "+(d+-s/2)+" z"});break;case"Triangle":H.merge(l,{d:r="M "+p+" "+(d+s/2)+" L "+h+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+s/2)+" L "+p+" "+(d+s/2)+" z"});break;case"InvertedTriangle":H.merge(l,{d:r="M "+(h+a/2)+" "+(d-s/2)+" L "+h+" "+(d+s/2)+" L "+(h-a/2)+" "+(d-s/2)+" L "+(h+a/2)+" "+(d-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)),r=0===u?"M "+(h+c)+" "+(d+m)+" ":r.concat("L "+(h+c)+" "+(d+m)+" ");r=r.concat("Z"),H.merge(l,{d:r});break;case"Star":r="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",H.merge(l,{d:r});break;case"Cross":H.merge(l,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d+" M "+h+" "+(d+s/2)+" L "+h+" "+(d+-s/2)});break;case"Image":n="Image",H.merge(l,{href:o,height:s,width:a,x:p,y:g})}return{renderOption:l,functionName:n}}function xt(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function St(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o}function P(e){if(0<e.length)for(var t=0;t<e.length;t++){var i=e[t];_(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function wt(e){if(0<e.length)for(var t=0;t<e.length;t++)for(var i=e[t],l=(_(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth),i.ShapeCollection.Elements.length),o=0;o<l;o++)_(i.ShapeCollection.Elements[o],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}function _(e,t,i,l,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",l),e.setAttribute("stroke-width",o)}function Ft(e,t,i){P(e),N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ct(e,t,i){for(var l,o=0;o<e;o++)for(var r=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<r;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){l=o;break}return l}function It(e,t,i,l,o,r,n){e.push({legendEle:l,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:r[i].options.fill,shapeOldOpacity:r[i].options.opacity,shapeOldBorderColor:r[i].options.border.color,shapeOldBorderWidth:r[i].options.border.width})}function Ot(e,t,i,l){H.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Lt(e){e=document.getElementById(e);return e?H.remove(e):null}f.prototype.processLayoutPanel=function(){var e,t,i,l;this.treemap.treemapLevelData.levelsData&&0<this.treemap.treemapLevelData.levelsData.length&&(i=(H.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||H.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(H.isNullOrUndefined(this.treemap.drilledItems)?!H.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[]))[0],l=H.extend({},this.treemap.areaRect,l,!1),H.isNullOrUndefined(this.treemap.treeMapLegendModule)||H.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(l=this.treemap.totalRect),H.isNullOrUndefined(this.treemap.currentLevel)||(H.isNullOrUndefined(this.treemap.drilledItems)?H.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?(!H.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(H.isNullOrUndefined(this.treemap.drilledItems)?H.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],H.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())},f.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=M(e).values;if(o&&0<o.length&&0===t.length){for(var r=0;r<o.length;r++)o[r].groupIndex===i.initialDrillDown.groupIndex&&o[r].name===i.initialDrillDown.groupName&&(o[r].isDrilled=!0,l[o[r].groupName]=[o[r]],t.push(l));for(var n=0;n<o.length;n++)this.getDrilldownData(o[n],t)}return t},f.prototype.calculateLayoutItems=function(e,t){this.renderItems=[],this.parentData=[],H.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)))},f.prototype.computeSliceAndDiceDimensional=function(e,t){var i,l,o,r=this.treemap.leafItemSettings,n=this.treemap.levels,a=M(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===n.length||o===n.length?r.gap:n[o].groupGap,o=0===n.length?0:n[o]?n[o].showHeader?n[o].headerHeight:0:n[o-1].showHeader?n[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},f.prototype.sliceAndDiceProcess=function(e,t){var i,l=t.height*t.width,o=this.treemap.levels,r=0,n=0,a=(e.forEach(function(e){n+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/n}),"SliceAndDiceAuto"===this.treemap.layoutType?t.width>t.height:"SliceAndDiceHorizontal"===this.treemap.layoutType);e.sort(He);for(var s=0;s<e.length;s++){var h=e[s];h.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||H.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?h.groupIndex===o.length-1:h.groupIndex===this.treemap.levels.length),a?(i=l/n*e[s].weight/t.height,r<=t.width&&(e[s].rect=new j(r+t.x,t.y,i,t.height))):(i=l/n*e[s].weight/t.width,r<=t.height&&(e[s].rect=new j(t.x,r+t.y,t.width,i))),r+=i,this.renderItems.push(e[s])}},f.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,r,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=M(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 h=0;h<s.length;h++)r=(l=s[h]).groupIndex,i=l.rect,o=(l.isLeafItem?n.padding:a[r].groupPadding)/2,r=this.treemap.isHierarchicalData?(0!==r||!l.isLeafItem)&&a[r]&&a[r].showHeader?a[r].headerHeight:0:0!==a.length&&a[r]&&a[r].showHeader?a[r].headerHeight:0,i=new j(i.x+o,i.y+(r+o),i.width-o,i.height-o),!l.isLeafItem&&0<l.weight&&this.computeSquarifyDimensional(s[h],i)},f.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,Je(i)),t.sort(dt),this.performRowsLayout(t,[],i,[])},f.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o)return d=this.getCoordinates(t,i),l.concat(d);var r=Ye(i),n=e[0],o=e.slice(1,o);if(this.aspectRatio(t,n,r))return r=t.concat(n),this.performRowsLayout(o,r,i,l);for(var a=t.length,s=0,h=0;h<a;h+=1)s+=t[h].itemArea;var n=this.cutArea(i,s),d=this.getCoordinates(t,i),o=l.concat(d);return this.performRowsLayout(e,[],n,o)},f.prototype.aspectRatio=function(e,t,i){return 0===e.length||(t=e.concat(t),e=this.findMaxAspectRatio(e,i),this.findMaxAspectRatio(t,i)<=e)},f.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,r=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<l&&(l=a),o<a&&(o=a),r+=a}return Math.max(Math.pow(t,2)*o/Math.pow(r,2),Math.pow(r,2)/(Math.pow(t,2)*l))},f.prototype.cutArea=function(e,t){var i,e=Ze(e),l=e.width,o=e.height,r=e.x,e=e.y;return Qe(o<=l?{x:r+(i=t/o),y:e,width:l-i,height:o}:{x:r,y:e+(i=t/l),width:l,height:o-i})},f.prototype.getCoordinates=function(e,t){for(var i=Ze(t),l=i.width,o=i.height,r=i.x,i=i.y,n=e.length,a=this.treemap.levels,s=this.treemap.leafItemSettings,h=0,d=0;d<n;d+=1)h+=e[d].itemArea;for(var p,g,c=h/o,m=h/l,u=r,y=i,f=[],d=0;d<n;d+=1){var v,b=e[d],x=b.groupIndex;b.isLeafItem=0===a.length||(this.treemap.isHierarchicalData||!H.isNullOrUndefined(s.labelPath))&&x===a.length,g=(p=xt(this.parentData[0],b))?this.treemap.areaRect:b.parent.rect,x=b.isLeafItem?s.padding:a[x].groupPadding,o<=l?(v=y+b.itemArea/c,b.rect={x:u,y:y,width:u+c,height:v},y=v):(v=u+b.itemArea/m,b.rect={x:u,y:y,width:v,height:y+m},u=v),0<b.weight&&(p||Math.round(t.y+x/2)<=Math.round(g.y+(g.height-g.y))&&Math.round(t.x+x/2)<=Math.round(g.x+(g.width-g.x)))&&(this.renderItems.push(b),f.push(b))}return f},f.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var r=e.length,n=0,a=0;a<r;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<r;d++)(h=e[d]).itemArea=h.weight*s,l.push(h)}return l},f.prototype.onDemandProcess=function(e){var t,i=e[0].parent;this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;for(var l={},o=(H.isNullOrUndefined(i.groupName)?l=i:l[i.groupName]=[i],t=H.extend({},this.treemap.areaRect,t,!1),H.isNullOrUndefined(this.treemap.treeMapLegendModule)||H.isNullOrUndefined(this.treemap.totalRect)||(t=this.treemap.totalRect),this.treemap.levels.length),r=0;r<o;r++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[r]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,t),this.renderLayoutItems()},f.prototype.renderLayoutItems=function(){for(var i,l,o,r,n,a,s,h,d,p,g,c,m,u,y,f,v,b,x=this,S=this.treemap,w=(this.renderer=S.renderer,S.element.id),e=S.layoutType,F=this.treemap.leafItemSettings.interSectAction,C="",I=document.getElementById(S.element.id+"_Secondary_Element"),O=S.levels,L=(this.layoutGroup=this.renderer.createGroup({id:w+"_TreeMap_"+e+"_Layout"}),H.createElement("div",{id:S.element.id+"_Label_Template_Group",className:"template"})),T=(L.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+S.areaRect.y+"px;left:"+S.areaRect.x+"px;height:"+S.areaRect.height+"px;width:"+S.areaRect.width+"px;",!1),N=S.leafItemSettings,D=this,t=0;t<this.renderItems.length;t++)!function(e){if(h=D.renderItems[e],r=h.groupIndex,D.treemap.drillDownView&&H.isNullOrUndefined(D.treemap.currentLevel)&&0<r||D.treemap.drillDownView&&r>D.treemap.currentLevel+1)return;a=h.rect,T=h.isLeafItem,g=w+"_Level_Index_"+r+"_Item_Index_"+e,u=D.renderer.createGroup({id:g+"_Group"}),v=(T?N.gap:O[r].groupGap)/2;var t,e=D.treemap.totalRect?Ze(D.treemap.totalRect):D.treemap.areaRect;"Squarified"===S.layoutType&&(a.width=Math.abs(a.x-a.width)-v,a.height=Math.abs(a.y-a.height)-v),"TopRightBottomLeft"===S.renderDirection?a.x=e.x+e.width-a.width-Math.abs(e.x-a.x):"BottomLeftTopRight"===S.renderDirection?a.y=e.y+e.height-a.height-Math.abs(e.y-a.y):"BottomRightTopLeft"===S.renderDirection&&(a.x=e.x+e.width-a.width-Math.abs(e.x-a.x),a.y=e.y+e.height-a.height-Math.abs(e.y-a.y)),v=D.getItemColor(T,h),s=v.fill,p=v.opacity,v=T?N.labelFormat:O[r].headerFormat,l=T?N.showLabels:O[r].showHeader,t=r===D.treemap.currentLevel?D.treemap.enableBreadcrumb?(b="#"+D.treemap.breadcrumbConnector+"#",t=h.levelOrderName.replace(/#/gi,b),0!==r?"#"+t:t):h.name:(D.treemap.enableBreadcrumb&&(h.isDrilled=!1),h.name),d=ct(v,h.data,D.treemap)||t||"undefined",v=M(h).values,d=!T&&v&&0<v.length&&D.treemap.enableDrillDown?h.isDrilled?S.enableRtl?d+" [-]":"[-] "+d:S.enableRtl?d+" [+]":"[+] "+d:d,(m=T?N.labelStyle:O[r].headerStyle).fontFamily=D.treemap.themeStyle.labelFontFamily||m.fontFamily,m.fontWeight=m.fontWeight||D.treemap.themeStyle.fontWeight,m.size=m.size||D.treemap.themeStyle.labelFontSize,f=(T?N:O[r]).border,i=T?N.labelPosition:"Near"===O[r].headerAlignment?"TopLeft":"Center"===O[r].headerAlignment?"TopCenter":"TopRight",n=(T?N:O[r]).templatePosition,y=T?N.labelTemplate:O[r].headerTemplate,h.options={border:f,opacity:p,fill:s},o={cancel:!1,name:k,treemap:D.treemap,text:d,currentItem:h,RenderItems:D.renderItems,options:h.options},D.treemap.trigger(k,o,function(e){e.cancel||(C=" M "+a.x+" "+a.y+" L "+(a.x+a.width)+" "+a.y+" L "+(a.x+a.width)+" "+(a.y+a.height)+" L "+a.x+" "+(a.y+a.height)+"z",c=new E(g+"_RectPath",s,f.width,f.color,p,null,C),e=x.renderer.drawPath(c),u.appendChild(e),l&&(o.text!==d&&(o.text=ct(o.text,h.data,x.treemap)||t),x.renderItemText(o.text.toString(),u,m,a,F,g,s,i,b)),y&&(c=x.renderTemplate(I,g,a,n,y,h,T),H.isNullOrUndefined(c)||(L.appendChild(c),x.treemap.renderReactTemplates())),u.setAttribute("aria-label",h.name),x.treemap.enableDrillDown&&T||x.treemap.selectionSettings.enable||x.treemap.highlightSettings.enable?(u.setAttribute("role","button"),u.setAttribute("tabindex",x.treemap.tabIndex.toString()),u.style.cursor=(!x.treemap.highlightSettings.enable||x.treemap.selectionSettings.enable||!x.treemap.enableDrillDown||h.groupIndex!==x.treemap.levels.length-1)&&(!x.treemap.highlightSettings.enable||x.treemap.selectionSettings.enable||x.treemap.enableDrillDown)?"pointer":"default"):u.setAttribute("role","region"),pt(x.treemap,u,"treeMapSelection"),x.layoutGroup.appendChild(u))})}(t);0<L.childNodes.length&&I.appendChild(L),this.treemap.svgObject.appendChild(this.layoutGroup)},f.prototype.renderItemText=function(e,t,i,l,o,r,n,a,s){var h=[],d=0,p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(l,e,i,o),c=G(p&&p[0]||g[0],i),e=(this.treemap.enableRtl&&(b=G(e,i),v=e.search("[+]")||e.search("[-]"),l.width<b.width)&&0<v&&(b=e.substring(v-1,e.length),v=G("[+]",i),g[0]=V(l.width-v.width-5,g[0],i)+b),qe(l,a,c,"Text",this.treemap));if(!H.isNullOrUndefined(p)){for(var m,u=[],y=[],f=0;f<p.length;f++)d+=(c=G(m=V(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=d}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var v,b,x=0;x<g.length;x++)d+=(c=G(g[x],i)).height,l.height-5>d&&h.push(g[x]);"Wrap"===o&&g.length!==h.length&&h.length&&(b=(b=h[v=h.length-1]).substring(0,b.length-1)+"...",h.splice(v),"..."!==b)&&h.push(b)}else a=g,h.push(a);Ue(new T(r+"_Text",e.x,e.y,"start",h,"","",s),i,i.color||this.getSaturatedColor(n),t)},f.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,r=(H.isNullOrUndefined(i.treemapLevelData.defaultLevelsData)||0<i.treemapLevelData.defaultLevelsData.length&&(i.treemapLevelData.levelsData=i.treemapLevelData.defaultLevelsData),M(i.treemapLevelData.levelsData[0]).values),e=(e?i.leafItemSettings:i.levels[t.groupIndex]).colorMapping;if(0<e.length){e=Ke(e,t.data[i.equalColorValuePath],t.data[i.rangeColorValuePath]);H.isNullOrUndefined(e)||(l=(H.isNullOrUndefined(e.fill)?i.leafItemSettings:e).fill,o=e.opacity)}else for(var n=0;n<r.length;n++)r[n].levelOrderName===t.levelOrderName.split("#")[0]&&(l=H.isNullOrUndefined(l)?H.isNullOrUndefined(i.colorValuePath)?!H.isNullOrUndefined(i.palette)&&0<i.palette.length?i.palette[n%i.palette.length]:"#808080":r[n].data[i.colorValuePath]:l);return{fill:l,opacity:o}},f.prototype.getSaturatedColor=function(e){var t=e,e=ft(y("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"},f.prototype.renderTemplate=function(e,t,i,l,o,r,n){var a,t=n?t+"_LabelTemplate":t+"_HeaderTemplate",n=n?"_LabelTemplate":"_HeaderTemplate";if(H.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var s=Object.keys(r.data),h=0;h<s.length;h++){var d=RegExp;o=o.replace(new d("{{:"+s[h]+"}}","g"),r.data[s[h].toString()])}return H.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))||(i=qe(i,l,Xe(a=Ve(Ge(o)(r.data,this.treemap,o,this.treemap.element.id+n,!1),t,r.data),e),"Template",this.treemap),a.style.left=i.x+"px",a.style.top=i.y+"px"),a},f.prototype.labelInterSectAction=function(e,t,i,l){var o,r=e.width-10;switch(l){case"Hide":o=[ht(r,e.height,t,i)];break;case"Trim":o=[V(3+r,t,i)];break;case"WrapByWord":o=at(r,t,i);break;case"Wrap":o=st(r,t,i)}return o},f.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]};var Tt=f;function f(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",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",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"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",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:U});e.trigger(U,l,function(){l.cancel||H.print(l.htmlContent,i)})},Et.prototype.getHTMLContent=function(e,t){var i,l,o=H.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],H.isNullOrUndefined(l)||(l=l.childNodes[0],H.isNullOrUndefined(l))||(i=l.getAttribute("fill"),"Tailwind"!==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&&"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 Dt=Et;function Et(e){}Pt.prototype.export=function(h,d,p,g){return new Promise(function(e,t){var i,l,o=H.createElement("canvas",{id:"ej2-canvas",attrs:{height:h.availableSize.height.toString(),width:h.availableSize.width.toString()}}),r=h.svgObject.cloneNode(!0),n=r.childNodes[0],a=(H.isNullOrUndefined(n)||(n=n.getAttribute("fill"),"Tailwind"!==h.theme&&"Bootstrap5"!==h.theme&&"Fluent"!==h.theme&&"Material3"!==h.theme&&"Fluent2"!==h.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==h.theme&&"Bootstrap5Dark"!==h.theme&&"FluentDark"!==h.theme&&"Material3Dark"!==h.theme&&"Fluent2Dark"!==h.theme&&"Fluent2HighContrast"!==h.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||r.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):r.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),!(-1<H.Browser.userAgent.toString().indexOf("HeadlessChrome"))),n='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+r.outerHTML+"</svg>",s=window.URL.createObjectURL(new Blob("SVG"===d?[n]:[(new XMLSerializer).serializeToString(r)],{type:"image/svg+xml"}));"SVG"===d?g?Ot(p,d,s,a):e(null):(i=new Image,l=o.getContext("2d"),i.onload=function(){l.drawImage(i,0,0),window.URL.revokeObjectURL(s),g?Ot(p,d,o.toDataURL("image/png").replace("image/png","image/octet-stream"),a):"JPEG"===d?e(o.toDataURL("image/jpeg")):"PNG"===d&&e(o.toDataURL("image/png"))},i.src=s)})},Pt.prototype.getModuleName=function(){return"ImageExport"},Pt.prototype.destroy=function(){};var Mt=Pt;function Pt(e){}Bt.prototype.export=function(s,e,h,d,p){return new Promise(function(i,e){var l=H.createElement("canvas",{id:"ej2-canvas",attrs:{width:s.availableSize.width.toString(),height:s.availableSize.height.toString()}}),t=(d=H.isNullOrUndefined(d)?I.PdfPageOrientation.Landscape:d,s.svgObject.cloneNode(!0)),o=t.childNodes[0],r=(H.isNullOrUndefined(o)||(o=o.getAttribute("fill"),"Tailwind"!==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&&"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"}))),n=new Image,a=l.getContext("2d");n.onload=function(){a.drawImage(n,0,0),window.URL.revokeObjectURL(r);var e=new I.PdfDocument,t=l.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=d,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new I.PdfBitmap(t),0,0,s.availableSize.width-60,s.availableSize.height),p?(e.save(h+".pdf"),e.destroy()):i(null)},n.src=r})},Bt.prototype.getModuleName=function(){return"PdfExport"},Bt.prototype.destroy=function(){};var _t=Bt;function Bt(e){}Rt=function(e,t){return(Rt=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 Rt,zt,i=function(e,t){function i(){this.constructor=e}Rt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},v=function(e,t,i,l){var o,r=arguments.length,n=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(r<3?o(n):3<r?o(t,i,n):o(t,i))||n);return 3<r&&n&&Object.defineProperty(t,i,n),n},i=(zt=H.Component,i(b,zt),b.prototype.preRender=function(){var e=this;this.trigger(R,{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},b.prototype.render=function(){this.renderElements()},b.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),H.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},b.prototype.processDataManager=function(){var e,t,l=this;this.dataSource instanceof C.DataManager?(e=this.dataSource,t=this.query instanceof C.Query?this.query:new C.Query,e.executeQuery(t).then(function(e){l.dataSource=e.result,l.renderTreeMapElements()})):this.dataSource instanceof St?(e=this.dataSource,(t=new H.Fetch(e.dataOptions,e.type,e.contentType)).onSuccess=function(e){var t,i;H.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()},b.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger(z,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},b.prototype.createSvg=function(){if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&H.remove(this.svgObject)}H.isNullOrUndefined(this.renderer)&&(this.renderer=new F.SvgRenderer(this.element.id)),H.isNullOrUndefined(this.layout)&&(this.layout=new Tt(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})},b.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-treemap").length,this.element.id="treemap_control_"+e),this.renderer=new F.SvgRenderer(this.element.id),this.layout=new Tt(this)},b.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");e&&0<e.childElementCount&&e.parentNode.removeChild(e),H.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))&&((e=H.createElement("div",{id:this.element.id+"_Secondary_Element"})).style.cssText="position: absolute;z-index:1;",this.element.appendChild(e))},b.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!H.isNullOrUndefined(this.svgObject)&&!H.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!H.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},b.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)&&H.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)},b.prototype.renderTitle=function(e,t,i,l){var o,r,n,a={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},s=this.availableSize.width-this.margin.right-this.margin.left;a.fontFamily=a.fontFamily||this.themeStyle.fontFamily,a.fontWeight=a.fontWeight||this.themeStyle.titleFontWeight,a.size=a.size||("title"===t?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text?(H.isNullOrUndefined(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"})),n=G(r=V(s,e.text,a),a),i=Re(H.isNullOrUndefined(i)?new j(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):i,e.alignment,n,t),r=new T(this.element.id+"_TreeMap_"+t,i.x,i.y,"start",r),i=new j(i.x,i.y,n.width,n.height),(n=Ue(r,a,a.color||("title"===t?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l)).setAttribute("aria-label",e.description||e.text),n.setAttribute("role","region"),n.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,s,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,s,o))},b.prototype.processingData=function(){var t=this;if(this.dataSource=this.dataSource,!H.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=M(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=H.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")}},b.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=M(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},b.prototype.processHierarchicalData=function(e,t){var i,l=this,o={},r=this.leafItemSettings.labelPath||this.weightValuePath,n=(o=M(e))?o.values:null;if(n&&0<n.length){for(var a=o.key,s=0;s<this.levels.length;s++)a===this.levels[s].groupPath&&(i=s);for(var h=0;h<n.length;h++){n[h].name=n[h][r],n[h].levelOrderName=(0===i?n[h].name:e.levelOrderName+"#"+n[h].name)+"";var d=n[h].levelOrderName,p=void 0;0<d.search("#")&&(p=d.split("#").length-1),n[h].groupIndex=H.isNullOrUndefined(i)?p===this.levels.length?this.levels.length:p:i,0!==i&&(n[h].parent=e),n[h].groupName=a,n[h].data=n[h],n[h].isDrilled=!1,n[h].weight=n[h][this.weightValuePath]}n.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(!H.isNullOrUndefined(g)){for(var c=0;c<this.treemapLevelData.hierarchyData.length;c++)n=M(this.treemapLevelData.hierarchyData[c]).values,0!==c&&n&&(n.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}}},b.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},b.prototype.export=function(i,l,o,r){var n=this;return H.isNullOrUndefined(r)&&(r=!0),"PDF"===i&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(n.pdfExportModule.export(n,i,l,o,r))}):this.allowImageExport&&"PDF"!==i&&this.imageExportModule?new Promise(function(e,t){e(n.imageExportModule.export(n,i,l,r))}):null},b.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 r={},n="";if(!H.isNullOrUndefined(i)){var a=this.dataSource[o][i];if(0!==t)for(var s=0;s<=t;s++){var h=this.levels[s]?this.levels[s].groupPath:i;n+=this.dataSource[o][h]+(s===t?"":"#")}0<e.length&&-1!==e.indexOf(n||a)||(r.name=a,r.levelOrderName=(n||a)+"",r.groupIndex=t,r.isDrilled=!1,r.groupName=i,r.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][i].push(r),e.push(n||a))}}}},b.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],r=0;r<l.length;r++)for(var n=l[r].levelOrderName,a=0;a<o.length;a++)if(o[a][t]=H.isNullOrUndefined(o[a][t])?[]:o[a][t],this.IsChildHierarchy(n.split("#"),o[a].levelOrderName.split("#"))){H.isNullOrUndefined(l[r].parent)&&(l[r].parent=o[a]),o[a][t].push(l[r]);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)},b.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},b.prototype.findTotalWeight=function(i,e){for(var l,o,r,n=this,a={},s=this,t=0;t<i.length;t++)!function(t){l=0,r=i[t].groupName,o=i[t].levelOrderName.split("#"),s.dataSource.forEach(function(e){We(o,i[t].levelOrderName,e,n)&&(l+=parseFloat(e[n.weightValuePath]))}),"Parent"===e&&((a[r]=i)[t].parent=a),i[t].weight=l}(t)},b.prototype.unWireEVents=function(){H.EventHandler.remove(this.element,"click",this.clickOnTreeMap),H.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),H.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchStartEvent,this.mouseDownOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchEndEvent,this.mouseEndOnTreeMap),H.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},b.prototype.wireEVents=function(){H.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),H.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),H.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),H.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},b.prototype.setCulture=function(){this.intl=new H.Internationalization},b.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},b.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),!H.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)))},b.prototype.clickOnTreeMap=function(e){var t,i=this,l=e.target,o=l.id,r=l.innerHTML,n=(this.trigger($,{cancel:!1,name:$,treemap:this,mouseEvent:e}),-1<o.indexOf("_Item_Index")&&(e.preventDefault(),n=parseFloat(o.split("_Item_Index_")[1]),n={cancel:!1,name:Z,treemap:this,item:this.layout.renderItems[n],mouseEvent:e,groupIndex:this.layout.renderItems[n].groupIndex,groupName:this.layout.renderItems[n].name,text:r,contentItemTemplate:r},this.trigger(Z,n,function(e){e.text===r&&e.contentItemTemplate===r||(H.isNullOrUndefined(i.leafItemSettings.labelTemplate)?(e.text=ct(e.text,e.item.data,e.treemap),l.textContent=e.text):ke(o,l,e.contentItemTemplate))})),(new Date).getMilliseconds());H.isNullOrUndefined(this.doubleClick)||!H.isNullOrUndefined(t)&&n-t<500&&this.doubleClickOnTreeMap(e)},b.prototype.doubleClickOnTreeMap=function(e){this.trigger(K,{cancel:!1,name:K,treemap:this,mouseEvent:e})},b.prototype.rightClickOnTreeMap=function(e){this.trigger(ee,{cancel:!1,name:ee,treemap:this,mouseEvent:e})},b.prototype.mouseDownOnTreeMap=function(e){-1<e.target.id.indexOf("_Item_Index")&&(this.mouseDown=!0),this.notify(H.Browser.touchStartEvent,e)},b.prototype.mouseMoveOnTreeMap=function(e){var t,i=e.target.id;this.trigger(te,{cancel:!1,name:te,treemap:this,mouseEvent:e}),-1<i.indexOf("_Item_Index")?(t=M(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(H.Browser.touchMoveEvent,e)},b.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,r=t.levelOrderName.split("#"),n=0,a=Object.keys(r);n<a.length;n++)r[l=a[n]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:r}},b.prototype.calculatePreviousLevelChildItems=function(e,t,i){for(var l,o,r=0,n=this.layout.renderItems[0].levelOrderName.split("#").length,a=0;a<n;a++)o=0===a?e.levelText[a]:o+"#"+e.levelText[a];for(var s,r=1<n?n:r,h=0,d=Object.values(this.layout.renderItems);h<d.length;h++)(s=d[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===r?H.isNullOrUndefined(o)?o:e.levelText[r]:i?o:o+"#"+e.levelText[r])===s.levelOrderName&&(this.drilledItems.push({name:s.levelOrderName,data:s}),i=!0,++r<=t.groupIndex)&&(o=l+"#"+e.levelText[r]);return i},b.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},b.prototype.mouseEndOnTreeMap=function(e){var i,l,t,o=this,r=e.target,n=r.id,a=!1,s={},h=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",d=this.element.id+"_Label_Template_Group";if(-1<n.indexOf("_Item_Index")&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),n=parseFloat(n.split("_Item_Index_")[1]),p=this.layout.renderItems[n];var n=r.textContent;if(this.enableBreadcrumb&&(t=this.calculateSelectedTextLevels(n,p),l=t.drillLevel,this.drillDownView||-1===n.search("[+]")||(a=this.calculatePreviousLevelChildItems(t,p,a))),0!==this.levels.length&&!p.isLeafItem&&M(p).values&&0<M(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(!H.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&&H.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&&H.isNullOrUndefined(l)&&(p.isDrilled=!0,s[p.groupName]=[p])}else p.isDrilled=!0,s[p.groupName]=[p];n={cancel:!1,name:A,treemap:this,element:r,groupIndex:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!H.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).groupIndex,groupName:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!H.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).name,rightClick:3===e.which,childItems:null,item:s},this.trigger(A,n,function(e){var t;o.currentLevel=p.isDrilled&&H.isNullOrUndefined(l)?p.groupIndex:!H.isNullOrUndefined(l)&&o.enableBreadcrumb&&p.isDrilled?l:null,e.cancel||(document.getElementById(h)&&(t=document.getElementById(h)).parentNode.removeChild(t),i=H.extend({},o.areaRect,i,!0),o.legendSettings.visible&&!H.isNullOrUndefined(o.treeMapLegendModule)&&(H.isNullOrUndefined(s)||(o.treeMapLegendModule.legendGroup.textContent="",o.treeMapLegendModule.legendGroup=null,o.treeMapLegendModule.widthIncrement=0,o.treeMapLegendModule.heightIncrement=0,o.enableBreadcrumb&&!H.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=H.isNullOrUndefined(o.totalRect)?i:o.totalRect),document.getElementById(d)&&(t=document.getElementById(d)).parentNode.removeChild(t),H.isNullOrUndefined(e.childItems)||e.cancel?(o.layout.calculateLayoutItems(s,i),o.layout.renderLayoutItems()):o.layout.onDemandProcess(e.childItems))}),r={cancel:!1,name:q,treemap:this,renderItems:this.layout.renderItems},this.trigger(q,r),!a&&H.isNullOrUndefined(l)&&this.drilledItems.push({name:p.levelOrderName,data:p})}}this.mouseDown=!1,this.notify(H.Browser.touchEndEvent,e)},b.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(P(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},b.prototype.selectItem=function(e,t){H.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)},b.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,Dt],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Mt],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,_t],name:"PdfExport"}),e},b.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())}},b.prototype.getModuleName=function(){return"treemap"},b.prototype.destroy=function(){this.unWireEVents(),Lt("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),zt.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,H.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},b.prototype.removeSvg=function(){if(Lt(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&&H.remove(this.svgObject)}},v([H.Property(!(b.prototype.getPersistData=function(){return""}))],b.prototype,"allowPrint",void 0),v([H.Property(!1)],b.prototype,"allowImageExport",void 0),v([H.Property(!1)],b.prototype,"allowPdfExport",void 0),v([H.Property(null)],b.prototype,"width",void 0),v([H.Property(null)],b.prototype,"height",void 0),v([H.Complex({},l)],b.prototype,"border",void 0),v([H.Complex({},se)],b.prototype,"margin",void 0),v([H.Property(null)],b.prototype,"background",void 0),v([H.Property("Material")],b.prototype,"theme",void 0),v([H.Complex({},fe)],b.prototype,"titleSettings",void 0),v([H.Property("Squarified")],b.prototype,"layoutType",void 0),v([H.Property(null)],b.prototype,"dataSource",void 0),v([H.Property(null)],b.prototype,"query",void 0),v([H.Property(null)],b.prototype,"weightValuePath",void 0),v([H.Property("")],b.prototype,"rangeColorValuePath",void 0),v([H.Property("")],b.prototype,"equalColorValuePath",void 0),v([H.Property(null)],b.prototype,"colorValuePath",void 0),v([H.Property([])],b.prototype,"palette",void 0),v([H.Property("TopLeftBottomRight")],b.prototype,"renderDirection",void 0),v([H.Property(!1)],b.prototype,"enableDrillDown",void 0),v([H.Property(!1)],b.prototype,"enableBreadcrumb",void 0),v([H.Property(" - ")],b.prototype,"breadcrumbConnector",void 0),v([H.Property(!1)],b.prototype,"drillDownView",void 0),v([H.Complex({},Ce)],b.prototype,"initialDrillDown",void 0),v([H.Complex({},Le)],b.prototype,"leafItemSettings",void 0),v([H.Collection([],t)],b.prototype,"levels",void 0),v([H.Complex({},Pe)],b.prototype,"highlightSettings",void 0),v([H.Complex({},Ee)],b.prototype,"selectionSettings",void 0),v([H.Complex({},Ne)],b.prototype,"tooltipSettings",void 0),v([H.Complex({},we)],b.prototype,"legendSettings",void 0),v([H.Property(!1)],b.prototype,"useGroupingSeparator",void 0),v([H.Property(null)],b.prototype,"description",void 0),v([H.Property(0)],b.prototype,"tabIndex",void 0),v([H.Property(null)],b.prototype,"format",void 0),v([H.Event()],b.prototype,"load",void 0),v([H.Event()],b.prototype,"beforePrint",void 0),v([H.Event()],b.prototype,"loaded",void 0),v([H.Event()],b.prototype,"itemRendering",void 0),v([H.Event()],b.prototype,"drillStart",void 0),v([H.Event()],b.prototype,"drillEnd",void 0),v([H.Event()],b.prototype,"itemSelected",void 0),v([H.Event()],b.prototype,"itemHighlight",void 0),v([H.Event()],b.prototype,"tooltipRendering",void 0),v([H.Event()],b.prototype,"itemClick",void 0),v([H.Event()],b.prototype,"itemMove",void 0),v([H.Event()],b.prototype,"click",void 0),v([H.Event()],b.prototype,"doubleClick",void 0),v([H.Event()],b.prototype,"rightClick",void 0),v([H.Event()],b.prototype,"mouseMove",void 0),v([H.Event()],b.prototype,"resize",void 0),v([H.Event()],b.prototype,"legendItemRendering",void 0),v([H.Event()],b.prototype,"legendRendering",void 0),v([H.NotifyPropertyChanges],b));function b(e,t){e=zt.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(){},v=(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]),(!H.isNullOrUndefined(this.treemap.palette)&&0<this.treemap.palette.length||!H.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,R=t.title.text,o=t.titleStyle,z=t.mode,r=0,n=0,a=0,s=0,h=t.shapeHeight,d=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,U=(o.fontFamily=o.fontFamily||e.themeStyle.fontFamily,o.fontWeight=o.fontWeight||e.themeStyle.titleFontWeight,o.size=o.size||e.themeStyle.subtitleFontSize,G(R,o)),y=0,f=0,v=t.shapePadding,b=t.textStyle;if(b.size=b.size||e.themeStyle.legendFontSize,b.fontFamily=b.fontFamily||e.themeStyle.fontFamily,b.fontWeight=b.fontWeight||e.themeStyle.fontWeight,"Default"===z){for(var m=H.isNullOrUndefined(m)?e.areaRect.width:m,u=H.isNullOrUndefined(u)?e.areaRect.height:u,x=0,S=0;S<this.legendCollections.length;S++){var w,F,C,I=this.legendCollections[S],O=(H.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]}),G(I.legendName,b));this.textMaxWidth=Math.max(this.textMaxWidth,O.width),0===S?(y=r=10+d/2,f=n=10+U.height+(h>O.height?h/2:O.height/4)):(w=O.height>h?O.height:h,"Horizontal"===c?n=(C=g[x-1].x+g[x-1].width+10+d)+v+O.width>m?u<(F=(g[x-1].y>p[x-1].y+h/2?g[x-1].y:p[x-1].y+h/2)+10)+w?(this.getPageChanged(),x=0,p=[],g=[],r=y,f):(r=p[0].x,F+w/2):(r=C-d/2,p[x-1].y):u<(F=g[x-1].y>p[x-1].y+h/2?g[x-1].y:p[x-1].y+h/2)+10+w?(C=g[x-1].x+this.textMaxWidth+10)+v+O.width>m?(r=y,n=f,g=[],p=[],this.getPageChanged(),x=0):(r=C+d/2,n=p[0].y):(r=p[x-1].x,n=F+10+h/2)),a=r+d/2+v,s=n+O.height/4,p.push({x:r,y:n}),g.push({x:a,y:s,width:O.width,height:O.height/2}),this.totalPages[this.page].Collection.push({DisplayText:I.legendName,element:I.gradientElement,Shape:{x:r,y:n},Text:{x:a,y:s},Fill:I.legendFill,Data:I.legendData,Rect:{x:p[x].x-d/2,y:p[x].y-h/2<s-O.height?p[x].y-h/2:s-O.height,width:Math.abs(p[x].x-d/2-(a+O.width)),height:h>O.height?h:O.height}}),x++}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?H.isNullOrUndefined(m)?e.areaRect.width/L:m/L:H.isNullOrUndefined(m)?25:m,N="Horizontal"===c?H.isNullOrUndefined(u)?25:u:H.isNullOrUndefined(u)?e.areaRect.height/L:u/L,D=(y=0,f=U.height+10,t.labelPosition),E=0,M=0,k=t.labelDisplayMode,P=0,A=0,S=0;S<this.legendCollections.length;S++){var y="Horizontal"===c?y+T:y,f="Horizontal"===c?f:f+N,_=this.legendCollections[S].legendName,B=new W(0,0);"None"===k?B=G(_,b):"Trim"===k?B=G(_=V("Horizontal"===c?T:N,_,b),b):_="",P=Math.max(P,B.height),A=Math.max(A,B.width),0<B.width&&0<B.height&&(s="Horizontal"===c?(a=y+T/2,"After"===D?f+N+B.height/2+10:f-10):(a="After"===D?y-B.width/2-10:y+T+B.width/2+10,f+N/2+B.height/4)),0===S&&(E="Horizontal"!==c&&"After"===D?a-B.width/2:y,M="Horizontal"!==c||"After"===D?f:s-B.height/2),S===L-1&&(m="Horizontal"===c?Math.abs(y+T-E):T+A+10,u="Horizontal"===c?N+P/2+10:Math.abs(f+N-M)),this.legendRenderingCollections.push({fill:this.legendCollections[S].legendFill,x:y,y:f,width:T,height:N,element:this.legendCollections[S].gradientElement,text:_,textX:a,textY:s,textWidth:B.width,textHeight:B.height,data:this.legendCollections[S].legendData})}this.legendItemRect={x:E,y:M,width:m,height:u}}}},x.prototype.getPageChanged=function(){this.page++,H.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},x.prototype.findColorMappingLegendItems=function(e){var t=M(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,l,o;if(!H.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!H.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&H.isNullOrUndefined(this.treemap.drilledLegendItems))for(var r=M(e).values,n=0;n<r.length;n++)if(r[n].Name===this.treemap.initialDrillDown.groupName){r[n].isDrilled=!r[n].isDrilled,e=r[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=0<this.treemap.palette.length?this.treemap.palette[n%this.treemap.palette.length]:r[n].data[this.treemap.colorValuePath];break}if((i=(this.treemap.enableDrillDown&&!H.isNullOrUndefined(this.treemap.drilledLegendItems)?(l=(t=this.treemap.drilledLegendItems).data.options.fill,t.data.isDrilled?M(t.data):M(t.data.parent)):M(e)).values)&&0<i.length){for(var a=0;a<i.length;a++)!H.isNullOrUndefined(i[a].data[this.treemap.legendSettings.showLegendPath])&&!i[a].data[this.treemap.legendSettings.showLegendPath]||(o=i[a].data[this.treemap.legendSettings.valuePath]||i[a].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,o))||this.legendCollections.push({legendName:o,legendFill:0<this.treemap.palette.length?H.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[a%this.treemap.palette.length]:l:i[a].data[this.treemap.colorValuePath],legendData:[],itemArea:i[a].weight});if(this.legendCollections.sort(dt),0<this.treemap.palette.length)for(var s=0;s<this.legendCollections.length;s++)this.legendCollections[s].legendFill=H.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:l}},x.prototype.calculateLegendItems=function(e){var t,i,l,o,r,n,a=!1,s=this.treemap.leafItemSettings,h=this.treemap.levels,d=this.treemap.legendSettings.position,p=!1,g=0;this.outOfRangeLegend=null;for(var c=0;c<e.length;c++){i="",p=n=r=!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:h[y]).colorMapping,v=0;v<f.length;v++){var b=f[v];if(I=null,F=Number(u[this.treemap.rangeColorValuePath]),C=u[this.treemap.equalColorValuePath],b.value=H.isNullOrUndefined(b.value)?b.value:b.value.toString(),!H.isNullOrUndefined(b.from)&&!H.isNullOrUndefined(b.to)&&F>=b.from&&F<=b.to&&b.showLegend?(n=a=!0,o=b.from+" - "+b.to,l=H.isNullOrUndefined(b.label)?b.from+" - "+b.to:b.label,i=H.isNullOrUndefined(b.color)?i:b.color,t=this.isAddNewLegendData(o)):!H.isNullOrUndefined(b.value)&&C===b.value&&b.showLegend&&(r=a=!0,o=b.value.toString(),l=H.isNullOrUndefined(b.label)?b.value.toString():b.label,i=H.isNullOrUndefined(b.color)?i:"[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,t=this.isAddNewLegendData(o)),a&&H.isNullOrUndefined(b.value)&&b.maxOpacity&&b.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var x=[],p=!0;if("[object Array]"===Object.prototype.toString.call(b.color))for(var S=0;S<b.color.length;S++){var w={colorStop:(S*(100/(b.color.length-1))+"%").toString(),color:b.color[S]};x.push(w)}else{var w={colorStop:"0%",color:i},F={colorStop:"100%",color:i};x.push(w),x.push(F)}var C={id:"groupIndex_"+y+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:"Top"===d||"Bottom"===d?"100%":"0%",y2:"Top"===d||"Bottom"===d?"0%":"100%"},I=this.treemap.renderer.drawGradient("linearGradient",C,x).childNodes[0];"[object Array]"!==Object.prototype.toString.call(b.color)&&(I.childNodes[0].setAttribute("stop-opacity",b.minOpacity.toString()),I.childNodes[1].setAttribute("stop-opacity",b.maxOpacity.toString())),this.defsElement.appendChild(I),this.gradientCount++}F=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,l),t&&t.process&&a&&!F?(a=!1,i="[object Array]"===Object.prototype.toString.call(b.color)&&H.isNullOrUndefined(I)&&H.isNullOrUndefined(b.value)?this.legendGradientColor(b,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:H.isNullOrUndefined(I)?H.isNullOrUndefined(b.value)?this.legendLinearGradient:null:I,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&&!F&&(a=!1,this.legendCollections[t.value].legendData.push(e[c])),n||p||r||H.isNullOrUndefined(b.from)&&H.isNullOrUndefined(b.to)&&H.isNullOrUndefined(b.minOpacity)&&H.isNullOrUndefined(b.maxOpacity)&&H.isNullOrUndefined(b.value)&&!H.isNullOrUndefined(b.color)&&(C="[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,I=H.isNullOrUndefined(b.label)?"Others":b.label,F=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,I),H.isNullOrUndefined(this.outOfRangeLegend)&&!F&&(this.legendCollections.push({actualValue:I,legendData:[],legendName:I,legendFill:C}),F=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[F-1],g++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[c]))}}},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,r=this.treemap.element.id+"_Legend_Index_"+l+"_Text",n=this.legendRenderingCollections[l],a=(a=n.element)?"url(#"+a.id+")":n.fill,s=new j(n.x,n.y,n.width,n.height),h=new m(n.textX,n.textY),o=new L(o,a,e.shapeBorder,e.opacity,s);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),h.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+n.textHeight/2-Math.abs(this.legendBorderRect.y-h.y)):(o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+o.width)-Math.abs(this.legendBorderRect.x-o.x),h.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-h.x))),Ue(new T(r,h.x,h.y,"middle",n.text,"",""),i,i.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(t.drawRectangle(o))}gt(this.treemap,this.legendGroup)},x.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,r=e.Text,e=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),r.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+e.width+t)-Math.abs(this.legendBorderRect.x-r.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,r.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-r.y)),{shapeLocation:o,textLocation:r}},x.prototype.drawLegendItem=function(t){var h,d=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?H.isNullOrUndefined(c.fill)?"#000000":c.fill:e.color,v=y&&0===e.width?1:e.width,b=this,i=0;i<this.totalPages[t].Collection.length;i++)!function(e){var i=b.totalPages[t].Collection[e],l=i.DisplayText,o=u.createGroup({id:p.element.id+"_Legend_Index_"+e}),r=(o.setAttribute("aria-label",l+" Legend"),o.setAttribute("role","region"),p.element.id+"_Legend_Shape_Index_"+e),n=p.element.id+"_Legend_Text_Index_"+e,a=i.Shape,s=i.Text;p.enableRtl&&(h=b.defaultLegendRtlLocation(i,g,p,c),a=h.shapeLocation,s=h.textLocation),h={cancel:!1,name:ie,treemap:p,fill:i.Fill,shape:c.shape,imageUrl:c.imageUrl},p.trigger(ie,h,function(e){var t=new E(r,e.fill,v,y?i.Fill:f,c.opacity,"");o.appendChild(vt(a,e.shape,m,e.imageUrl,t)),Ue(new T(n,s.x,s.y,"start",l,"",""),c.textStyle,c.textStyle.color||p.themeStyle.legendTextColor,o),d.legendGroup.appendChild(o)})}(i);var l,o,r,n,a,s,x,S,w,F,C,e=void 0,I=g,O=g/2;0!==this.page&&(r=G(l=t+1+"/"+this.totalPages.length,o=c.textStyle),w=this.legendItemRect.x+this.legendItemRect.width-r.width-2*I-g,n=this.legendItemRect.x+this.legendItemRect.width,a=this.legendItemRect.y+this.legendItemRect.height+O/2+g,s=n-I-r.width/2-g/2,e=u.createGroup({id:p.element.id+"_Legend_Paging_Group"}),x=u.createGroup({id:p.element.id+"_Legend_Left_Paging_Group"}),S=u.createGroup({id:p.element.id+"_Legend_Right_Paging_Group"}),C=" M "+n+" "+a+" L "+(n-I)+" "+(a-O)+" L "+(n-I)+" "+(a+O)+" z ",F=new E(p.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,""," M "+w+" "+a+" L "+(w+I)+" "+(a-O)+" L "+(w+I)+" "+(a+O)+" z "),x.appendChild(u.drawPath(F)),F=new L(p.element.id+"_Left_Page_Rect","transparent",{},1,new j(w-I/2,a-2*O,2*I,2*g),""),x.appendChild(u.drawRectangle(F)),this.wireEvents(x),w=new E(p.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",C),S.appendChild(u.drawPath(w)),F=new L(p.element.id+"_Right_Page_Rect","transparent",{},1,new j(n-I,a-O,I,g),""),S.appendChild(u.drawRectangle(F)),this.wireEvents(S),e.appendChild(x),e.appendChild(S),C={id:p.element.id+"_Paging_Text",x:s,y:a+r.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(C,l)),this.legendGroup.appendChild(e))}},x.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,l=t.titleStyle,i=G(V(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=e.title.text,i=V(this.legendItemRect.width+20,e,t),l=G(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",i=-1<e.type.indexOf("touch")?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):i,o=t.legendSettings;if(-1<i.id.indexOf("_Item_Index")&&o.visible&&0<this.legendRenderingCollections.length)for(var r=void 0,n=t.layout.renderItems[parseFloat(i.id.split("_Item_Index_")[1])],a=t.svgObject.getBoundingClientRect(),s=0;s<this.legendCollections.length;s++){var h=this.legendCollections[s],d=(r=document.getElementById(t.element.id+"_Legend_Index_"+s)).getBoundingClientRect(),p=new j(Math.abs(d.left-a.left),Math.abs(d.top-a.top),d.width,d.height),g=r.getAttribute("fill"),c=o.shapeBorder.color,m=o.shapeBorder.width;if(!H.isNullOrUndefined(h.legendData))for(var u=h.legendData,y=0;y<u.length;y++)if(u[y].levelOrderName===n.levelOrderName){this.drawInteractivePointer(o,g,c,l,m,p);break}}else this.removeInteractivePointer()},x.prototype.drawInteractivePointer=function(e,t,i,l,o,r){var n,a,e="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(n=r.x+r.width/2)+" "+(a=r.y+r.height)+" L "+(n-10)+" "+(a+10)+" L "+(n+10)+" "+(a+10)+" Z ":" M "+(n=r.x+r.width/2)+" "+(a=r.y)+" L "+(n-10)+" "+(a-10)+" L "+(n+10)+" "+(a-10)+" Z ":e.invertedPointer?" M "+(n=r.x)+" "+(a=r.y+r.height/2)+" L "+(n-10)+" "+(a-10)+" L "+(n-10)+" "+(a+10)+" z ":" M "+(n=r.x+r.width)+" "+(a=r.y+r.height/2)+" L "+(n+10)+" "+(a-10)+" L "+(n+10)+" "+(a+10)+" z ",r=new E(l,t,o,i,1,"",e);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(r))},x.prototype.getLegendAlignment=function(e,t,i,l){var o,r,n=H.extend({},e.areaRect,void 0,!0),a=n.x,s=n.y,h=n.height,d=n.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":n.height=h-i,o=p/2-t/2,r="Top"===c?s:s+n.height+10,n.y="Top"===c?s+i+10:s;break;case"Left":case"Right":n.width=d-t,o="Left"===c?a:a+n.width,r=g/2-i/2,n.x="Left"===c?a+t:a}switch(l.alignment){case"Near":"Top"===c||"Bottom"===c?o=n.x:r=n.y;break;case"Far":"Top"===c||"Bottom"===c?o=p-t:r=g-i}this.treemap.totalRect=n,this.translate=new m(o,r)}},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){H.EventHandler.add(e,H.Browser.touchStartEvent,this.changeNextPage,this)},x.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(H.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(H.Browser.touchEndEvent,this.mouseUpHandler,this))},x.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(H.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(H.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(!H.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),o=document.createElementNS(i,"linearGradient"),r=this.treemap.legendSettings.position,n="Top"===r||"Bottom"===r?"100":"0",r="Top"===r||"Bottom"===r?"0":"100";o.setAttribute("id","linear_"+t),o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2",n+"%"),o.setAttribute("y2",r+"%");for(var a=0;a<e.color.length;a++){var s=100/(e.color.length-1),h=document.createElementNS(i,"stop");h.setAttribute("offset",a*s+"%"),h.setAttribute("stop-color",e.color[a]),h.setAttribute("stop-opacity",1..toString()),o.appendChild(h)}l.appendChild(o),this.legendLinearGradient=o;n="url(#linear_"+t+")";this.defsElement.appendChild(o),r=n}return r},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()}At.prototype.mouseMove=function(e){var t,i,l=this.treemap,o=e.target.id,r=[],n=this.treemap.highlightSettings,a=[],e=this.treemap.treeMapSelectionModule;if(-1<o.indexOf("_Item_Index")&&(!e||this.treemap.selectionId!==o)){if(this.highLightId!==o){var s=document.getElementById(l.element.id+"_TreeMap_"+l.layoutType+"_Layout"),h=document.getElementsByClassName("treeMapSelection"),d=(m=this.treemap.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])],void 0);if(this.treemap.legendSettings.visible&&(w=this.treemap.treeMapLegendModule.legendCollections,d=Ct(this.treemap.treeMapLegendModule.legendCollections.length,m,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+d):document.getElementById(this.treemap.element.id+"_Legend_Index_"+d),null===this.shapeElement||e&&this.shapeElement.getAttribute("id")===e.legendSelectId||e&&this.shapeElement===e.shapeElement?0<this.currentElement.length&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(Ft(this.shapeHighlightCollection,this.currentElement,l),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),P(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:w[d].legendFill,oldOpacity:w[d].opacity,oldBorderColor:w[d].borderColor,oldBorderWidth:w[d].borderWidth}),_(this.shapeElement,n.fill,n.opacity,n.border.color,n.border.width.toString()),this.target="highlight")),i=je(m,[],n.mode,l),!this.treemap.legendSettings.visible||!e||!this.shapeElement||this.shapeElement.getAttribute("id")!==e.legendSelectId)if(this.treemap.legendSettings.visible&&e&&this.shapeElement===e.shapeElement)t=!1;else{for(var p=0;p<s.childElementCount;p++){for(var g=s.childNodes[p],c=!0,m=l.layout.renderItems[parseFloat(g.id.split("_Item_Index_")[1])],u=0;u<h.length;u++)if(g.id===h[u].id){c=!1;break}-1<i.indexOf(m.levelOrderName)&&c&&(a.push(g),r.push(m))}N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",l);for(var y=0;y<a.length;y++)D((g=a[y]).childNodes[0],{border:n.border,fill:n.fill,opacity:n.opacity}),g.classList.add("treeMapHighLight"),this.highLightId=o;l.trigger(J,{cancel:!1,name:J,treemap:l,items:r,elements:a})}}}else if(-1<o.indexOf("_Legend_Shape")||-1<o.indexOf("_Legend_Index")){if(this.treemap.legendSettings.visible&&(!e||e.legendSelectId!==o)&&(!e||e.shapeSelectId!==o))for(var f,v=void 0,b=void 0,x=document.getElementById(o),d=("highlight"===this.shapeTarget&&wt(this.legendHighlightCollection),this.shapeTarget="highlight","Default"===this.treemap.legendSettings.mode?parseFloat(o.split("_Legend_Shape_Index_")[1]):parseFloat(o.split("_Legend_Index_")[1])),S=this.treemap.treeMapLegendModule.legendCollections[d].legendData.length,w=this.treemap.treeMapLegendModule.legendCollections,F=parseInt(o[o.length-1],10),p=0;p<S;p++)for(var C,u=0;u<this.treemap.layout.renderItems.length;u++)this.treemap.treeMapLegendModule.legendCollections[d].legendData[p].levelOrderName===this.treemap.layout.renderItems[u].levelOrderName&&(v=u,b=this.treemap.layout.renderItems[u].groupIndex,C=document.getElementById(this.treemap.element.id+"_Level_Index_"+b+"_Item_Index_"+v+"_RectPath"),0===p&&(this.legendHighlightCollection=[],It(this.legendHighlightCollection,F,u,x,C,this.treemap.layout.renderItems,w),f=this.legendHighlightCollection.length,this.legendHighlightCollection[f-1].ShapeCollection={Elements:[]}),_(x,n.fill,n.opacity,n.border.color,n.border.width.toString()),_(C,n.fill,n.opacity,n.border.color,n.border.width.toString()),f=this.legendHighlightCollection.length,this.legendHighlightCollection[f-1].ShapeCollection.Elements.push(C))}else e&&this.shapeElement&&this.shapeElement.getAttribute("id")===e.legendSelectId||(e?this.shapeElement!==e.shapeElement:this.treemap.legendSettings.visible)&&N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",l),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||e&&this.shapeElement&&this.shapeElement.getAttribute("id")===e.legendSelectId||e&&this.shapeElement===e.shapeElement||(P(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&wt(this.legendHighlightCollection),this.highLightId="",t=!1;return t},At.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(H.Browser.touchMoveEvent,this.mouseMove,this)},At.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(H.Browser.touchMoveEvent,this.mouseMove)},At.prototype.getModuleName=function(){return"treeMapHighlight"},At.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null};var kt=At;function At(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}S.prototype.mouseDown=function(e){var t,i=e.target,l=this.treemap,o=(l.levelSelection=[],[]),r=i.id,n=i.innerHTML,a=[],s=l.selectionSettings,h=this.treemap.treeMapHighlightModule,d=l.element.id+"_TreeMap_"+l.layoutType+"_Layout";if(-1<r.indexOf("_Item_Index"))if(e.preventDefault(),this.treemap.selectionId!==r&&this.legendSelect){var p=document.getElementById(d),g=l.layout.renderItems[parseFloat(r.split("_Item_Index_")[1])],c=void 0;this.treemap.legendSettings.visible&&(this.shapeSelect=!1,e=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections,this.shapeElement=void 0,P(this.shapeSelectionCollection),h&&(h.shapeTarget="selection",h.shapeHighlightCollection=[]),c=Ct(e,g,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+c):document.getElementById(this.treemap.element.id+"_Legend_Index_"+c),null!==this.shapeElement)&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[c].legendFill,oldOpacity:b[c].opacity,oldBorderColor:b[c].borderColor,oldBorderWidth:b[c].borderWidth}),_(this.shapeElement,s.fill,s.opacity,s.border.color,s.border.width.toString()));for(var m=je(g,[],s.mode,l),u=0;u<p.childElementCount;u++)t=p.childNodes[u],g=l.layout.renderItems[parseFloat(t.id.split("_Item_Index_")[1])],-1<m.indexOf(g.levelOrderName)&&(a.push(t),l.levelSelection.push(t.id),o.push(g));N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=r;for(var y=document.getElementsByClassName("treeMapHighLight"),f=0;f<a.length;f++){if(t=a[f],0<y.length)for(var v=0;v<y.length;v++)y[v].id===t.id&&y[v].classList.remove("treeMapHighLight"),D(t.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),t.classList.add("treeMapSelection");else D(t.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),t.classList.add("treeMapSelection");l.trigger(X,{cancel:!1,name:X,treemap:l,items:o,elements:a,text:n,contentItemTemplate:n},function(e){e.contentItemTemplate!==n&&ke(r,i,e.contentItemTemplate)})}}else P(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="";else if(-1<r.indexOf("_Legend_Shape")||-1<r.indexOf("_Legend_Index")){var b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==r&&this.shapeSelect)for(var x,S=void 0,w=void 0,F=(this.legendSelectId=r,this.legendSelect=!1,parseInt(r[r.length-1],10)),C=document.getElementById(r),c=(wt(this.legendSelectionCollection),h&&(h.shapeTarget="selection"),"Default"===this.treemap.legendSettings.mode?parseFloat(r.split("_Legend_Shape_Index_")[1]):parseFloat(r.split("_Legend_Index_")[1])),I=this.treemap.treeMapLegendModule.legendCollections[c].legendData.length,f=0;f<I;f++)for(var O,L=0;L<this.treemap.layout.renderItems.length;L++)this.treemap.treeMapLegendModule.legendCollections[c].legendData[f].levelOrderName===this.treemap.layout.renderItems[L].levelOrderName&&(S=L,w=this.treemap.layout.renderItems[L].groupIndex,O=document.getElementById(this.treemap.element.id+"_Level_Index_"+w+"_Item_Index_"+S+"_RectPath"),0===f&&(It(this.legendSelectionCollection,F,L,C,O,this.treemap.layout.renderItems,b),x=this.legendSelectionCollection.length,this.legendSelectionCollection[x-1].ShapeCollection={Elements:[]}),_(C,s.fill,s.opacity,s.border.color,s.border.width.toString()),_(O,s.fill,s.opacity,s.border.color,s.border.width.toString()),x=this.legendSelectionCollection.length,this.legendSelectionCollection[x-1].ShapeCollection.Elements.push(O));else wt(this.legendSelectionCollection),h&&(h.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},S.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,r=[],n=void 0,a=[],t=(this.treemap.levelSelection=[],this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout"),s=document.getElementById(t),h=je(i,[],o.mode,this.treemap),d=0;d<s.childElementCount;d++)n=s.childNodes[d],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],-1<h.indexOf(i.levelOrderName)&&(r.push(n),this.treemap.levelSelection.push(n.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,P(this.shapeSelectionCollection),g=Ct(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}),_(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}N(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<r.length;u++)if(n=r[u],0<m.length)for(var y=0;y<m.length;y++)m[y].id===n.id&&m[y].classList.remove("treeMapHighLight"),D(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill=("null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options:o).fill,D(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else P(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},S.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(H.Browser.touchStartEvent,this.mouseDown,this)},S.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(H.Browser.touchStartEvent,this.mouseDown)},S.prototype.getModuleName=function(){return"treeMapSelection"},S.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null};var Ht=S;function S(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=(w.prototype.renderTooltip=function(e){var t,i,l,o,r,n,a=this,s=(t=(-1!==e.type.indexOf("touch")?(this.isTouch=!0,r=e.changedTouches[0].pageX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,r=e.pageX,e)).pageY,e.target),h=s.id,d={},p=[];-1<h.indexOf("_Item_Index")?(d=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])],H.isNullOrUndefined(d)||(h=d.weight,l=d.data,H.isNullOrUndefined(d.options)||(o=d.options.fill),p=this.treemap.enableRtl?[(H.isNullOrUndefined(this.tooltipSettings.format)?null:ct(this.tooltipSettings.format,l,this.treemap))||mt(h,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(H.isNullOrUndefined(this.tooltipSettings.format)?null:ct(this.tooltipSettings.format,l,this.treemap))||this.treemap.weightValuePath.toString()+" : "+mt(h,this.treemap)],document.getElementById(this.tooltipId)?i=document.getElementById(this.tooltipId):((i=H.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(i)),(h=$e(r,t,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=H.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,r={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"},n={cancel:!1,name:Y,item:d,options:{location:h,text:p,data:l,border:r,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:s,eventArgs:e},this.treemap.trigger(Y,n,function(e){a.addTooltip(n,o,i)}))):(this.removeTooltip(),this.treemap.clearTemplate())},w.prototype.addTooltip=function(e,t,i,l){var o;l=H.isNullOrUndefined(e)?(o=l.cancel,l):(o=e.cancel,Wt(e,["cancel"]).options),o?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new F.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())},w.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},w.prototype.removeTooltip=function(){var e;0<document.getElementsByClassName("EJ2-TreeMap-Tooltip").length&&(e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0]).parentNode.removeChild(e)},w.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(H.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(H.Browser.touchEndEvent,this.mouseUpHandler,this))},w.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(H.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(H.Browser.touchEndEvent,this.mouseUpHandler))},w.prototype.getModuleName=function(){return"treeMapTooltip"},w.prototype.destroy=function(){H.isNullOrUndefined(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},w);function w(e){this.treemap=e,this.tooltipSettings=this.treemap.tooltipSettings,this.tooltipId=this.treemap.element.id+"_TreeMapTooltip",this.addEventListener()}e.Border=l,e.ColorMapping=xe,e.ColorValue=ut,e.CommonTitleSettings=pe,e.Font=r,e.HighlightSettings=Pe,e.ImageExport=Mt,e.InitialDrillSettings=Ce,e.LayoutPanel=Tt,e.LeafItemSettings=Le,e.LegendSettings=we,e.LevelSettings=t,e.LevelsData=Ut,e.Location=m,e.Margin=se,e.PathOption=E,e.PdfExport=_t,e.Print=Dt,e.Rect=j,e.RectOption=L,e.SelectionSettings=Ee,e.Size=W,e.SubTitleSettings=me,e.TextOption=T,e.TitleSettings=fe,e.TooltipSettings=Ne,e.TreeMap=i,e.TreeMapAjax=St,e.TreeMapHighlight=kt,e.TreeMapLegend=v,e.TreeMapSelection=Ht,e.TreeMapTooltip=jt,e.applyOptions=D,e.beforePrint=U,e.click=$,e.colorCollections=tt,e.colorMap=Ke,e.colorNameToHex=y,e.componentToHex=u,e.convertElement=Ve,e.convertHexToColor=ft,e.convertToContainer=Ze,e.convertToHexCode=yt,e.convertToRect=Qe,e.createTextStyle=ze,e.deSaturationColor=et,e.defaultFont=re,e.doubleClick=K,e.drawSymbol=vt,e.drillEnd=q,e.drillStart=A,e.findChildren=M,e.findHightLightItems=je,e.findLabelLocation=qe,e.findPosition=Re,e.formatValue=mt,e.getArea=Je,e.getColorByValue=lt,e.getElement=Ae,e.getGradientColor=ot,e.getLegendIndex=Ct,e.getMousePosition=$e,e.getPercentage=nt,e.getPercentageColor=rt,e.getShortestEdge=Ye,e.getTemplateFunction=Ge,e.getThemeStyle=Nt,e.hide=ht,e.isContainsData=We,e.isParentItem=xt,e.itemClick=Z,e.itemHighlight=J,e.itemMove=Q,e.itemRendering=k,e.itemSelected=X,e.itemsToOrder=He,e.legendItemRendering=ie,e.legendMaintain=gt,e.legendRendering=le,e.load=R,e.loaded=z,e.maintainSelection=pt,e.measureElement=Xe,e.measureText=G,e.mouseMove=te,e.orderByArea=dt,e.pushCollection=It,e.removeClassNames=N,e.removeElement=Lt,e.removeLegend=wt,e.removeSelectionWithHighlight=Ft,e.removeShape=P,e.renderLegendShape=bt,e.renderTextElement=Ue,e.resize=oe,e.rgbToHex=it,e.rightClick=ee,e.setColor=_,e.setItemTemplateContent=ke,e.stringToNumber=Be,e.textFormatter=ct,e.textTrim=V,e.textWrap=st,e.tooltipRendering=Y,e.triggerDownload=Ot,e.wordWrap=at,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,H,F,C,I){"use strict";var O,P,_="load",B="loaded",U="beforePrint",k="itemRendering",A="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",re="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,r=arguments.length,n=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(r<3?o(n):3<r?o(t,i,n):o(t,i))||n);return 3<r&&n&&Object.defineProperty(t,i,n),n},l=(P=H.ChildProperty,t(ne,P),i([H.Property("#808080")],ne.prototype,"color",void 0),i([H.Property(0)],ne.prototype,"width",void 0),ne);function ne(){return null!==P&&P.apply(this,arguments)||this}ae=H.ChildProperty,t(o,ae),i([H.Property(10)],o.prototype,"left",void 0),i([H.Property(10)],o.prototype,"right",void 0),i([H.Property(10)],o.prototype,"top",void 0),i([H.Property(10)],o.prototype,"bottom",void 0);var ae,se=o;function o(){return null!==ae&&ae.apply(this,arguments)||this}he=H.ChildProperty,t(n,he),i([H.Property(null)],n.prototype,"size",void 0),i([H.Property(null)],n.prototype,"color",void 0),i([H.Property(re)],n.prototype,"fontFamily",void 0),i([H.Property("")],n.prototype,"fontWeight",void 0),i([H.Property("Normal")],n.prototype,"fontStyle",void 0),i([H.Property(1)],n.prototype,"opacity",void 0);var he,r=n;function n(){return null!==he&&he.apply(this,arguments)||this}de=H.ChildProperty,t(ge,de),i([H.Property("")],ge.prototype,"text",void 0),i([H.Property("")],ge.prototype,"description",void 0);var de,pe=ge;function ge(){return null!==de&&de.apply(this,arguments)||this}t(ue,ce=pe),i([H.Complex({fontFamily:null,fontWeight:null},r)],ue.prototype,"textStyle",void 0),i([H.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([H.Complex({fontFamily:null,fontWeight:null},r)],ve.prototype,"textStyle",void 0),i([H.Property("Center")],ve.prototype,"alignment",void 0),i([H.Complex({},me)],ve.prototype,"subtitleSettings",void 0);var ye,fe=ve;function ve(){return null!==ye&&ye.apply(this,arguments)||this}be=H.ChildProperty,t(a,be),i([H.Property(null)],a.prototype,"from",void 0),i([H.Property(null)],a.prototype,"to",void 0),i([H.Property(null)],a.prototype,"color",void 0),i([H.Property(null)],a.prototype,"label",void 0),i([H.Property(null)],a.prototype,"value",void 0),i([H.Property(null)],a.prototype,"minOpacity",void 0),i([H.Property(null)],a.prototype,"maxOpacity",void 0),i([H.Property(!0)],a.prototype,"showLegend",void 0);var be,Se=a;function a(){return null!==be&&be.apply(this,arguments)||this}xe=H.ChildProperty,t(s,xe),i([H.Property(!1)],s.prototype,"visible",void 0),i([H.Property("Default")],s.prototype,"mode",void 0),i([H.Property("transparent")],s.prototype,"background",void 0),i([H.Property("Circle")],s.prototype,"shape",void 0),i([H.Property("")],s.prototype,"width",void 0),i([H.Property("")],s.prototype,"height",void 0),i([H.Complex({size:null,fontFamily:null,fontWeight:null},r)],s.prototype,"textStyle",void 0),i([H.Property(null)],s.prototype,"fill",void 0),i([H.Property(1)],s.prototype,"opacity",void 0),i([H.Property(15)],s.prototype,"shapeWidth",void 0),i([H.Property(15)],s.prototype,"shapeHeight",void 0),i([H.Property(10)],s.prototype,"shapePadding",void 0),i([H.Property(null)],s.prototype,"imageUrl",void 0),i([H.Complex({color:null,width:null},l)],s.prototype,"border",void 0),i([H.Complex({color:"#000000",width:0},l)],s.prototype,"shapeBorder",void 0),i([H.Complex({},pe)],s.prototype,"title",void 0),i([H.Complex({size:null,fontFamily:null,fontWeight:null},r)],s.prototype,"titleStyle",void 0),i([H.Property("Bottom")],s.prototype,"position",void 0),i([H.Property("None")],s.prototype,"orientation",void 0),i([H.Property(!1)],s.prototype,"invertedPointer",void 0),i([H.Property("After")],s.prototype,"labelPosition",void 0),i([H.Property("None")],s.prototype,"labelDisplayMode",void 0),i([H.Property("Center")],s.prototype,"alignment",void 0),i([H.Property({x:0,y:0})],s.prototype,"location",void 0),i([H.Property(null)],s.prototype,"showLegendPath",void 0),i([H.Property(null)],s.prototype,"valuePath",void 0),i([H.Property(!1)],s.prototype,"removeDuplicateLegend",void 0);var xe,we=s;function s(){return null!==xe&&xe.apply(this,arguments)||this}Fe=H.ChildProperty,t(Ie,Fe),i([H.Property(null)],Ie.prototype,"groupIndex",void 0),i([H.Property(null)],Ie.prototype,"groupName",void 0);var Fe,Ce=Ie;function Ie(){return null!==Fe&&Fe.apply(this,arguments)||this}Oe=H.ChildProperty,t(h,Oe),i([H.Property(null)],h.prototype,"fill",void 0),i([H.Property(!1)],h.prototype,"autoFill",void 0),i([H.Complex({},l)],h.prototype,"border",void 0),i([H.Property(0)],h.prototype,"gap",void 0),i([H.Property(10)],h.prototype,"padding",void 0),i([H.Property(1)],h.prototype,"opacity",void 0),i([H.Property(!0)],h.prototype,"showLabels",void 0),i([H.Property(null)],h.prototype,"labelPath",void 0),i([H.Property(null)],h.prototype,"labelFormat",void 0),i([H.Property("TopLeft")],h.prototype,"labelPosition",void 0),i([H.Complex({color:null,size:null,fontFamily:null},r)],h.prototype,"labelStyle",void 0),i([H.Property(null)],h.prototype,"labelTemplate",void 0),i([H.Property("Center")],h.prototype,"templatePosition",void 0),i([H.Property("Trim")],h.prototype,"interSectAction",void 0),i([H.Collection([],Se)],h.prototype,"colorMapping",void 0);var Oe,Le=h;function h(){return null!==Oe&&Oe.apply(this,arguments)||this}Te=H.ChildProperty,t(d,Te),i([H.Property(!1)],d.prototype,"visible",void 0),i([H.Property("")],d.prototype,"template",void 0),i([H.Property(null)],d.prototype,"format",void 0),i([H.Property(null)],d.prototype,"fill",void 0),i([H.Property(.75)],d.prototype,"opacity",void 0),i([H.Property(["Circle"])],d.prototype,"markerShapes",void 0),i([H.Complex({width:null,color:null},l)],d.prototype,"border",void 0),i([H.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},r)],d.prototype,"textStyle",void 0);var Te,Ne=d;function d(){return null!==Te&&Te.apply(this,arguments)||this}De=H.ChildProperty,t(p,De),i([H.Property(!1)],p.prototype,"enable",void 0),i([H.Property(null)],p.prototype,"fill",void 0),i([H.Property("0.5")],p.prototype,"opacity",void 0),i([H.Complex({},l)],p.prototype,"border",void 0),i([H.Property("Item")],p.prototype,"mode",void 0);var De,Ee=p;function p(){return null!==De&&De.apply(this,arguments)||this}Me=H.ChildProperty,t(g,Me),i([H.Property(!1)],g.prototype,"enable",void 0),i([H.Property("#808080")],g.prototype,"fill",void 0),i([H.Property("0.5")],g.prototype,"opacity",void 0),i([H.Complex({},l)],g.prototype,"border",void 0),i([H.Property("Item")],g.prototype,"mode",void 0);var Me,Pe=g;function g(){return null!==Me&&Me.apply(this,arguments)||this}_e=H.ChildProperty,t(c,_e),i([H.Property(null)],c.prototype,"groupPath",void 0),i([H.Property(0)],c.prototype,"groupGap",void 0),i([H.Property(10)],c.prototype,"groupPadding",void 0),i([H.Complex({},l)],c.prototype,"border",void 0),i([H.Property(null)],c.prototype,"fill",void 0),i([H.Property(!1)],c.prototype,"autoFill",void 0),i([H.Property(1)],c.prototype,"opacity",void 0),i([H.Property(!0)],c.prototype,"showHeader",void 0),i([H.Property(20)],c.prototype,"headerHeight",void 0),i([H.Property(null)],c.prototype,"headerTemplate",void 0),i([H.Property(null)],c.prototype,"headerFormat",void 0),i([H.Property("Near")],c.prototype,"headerAlignment",void 0),i([H.Complex({color:null,size:"13px",fontFamily:null},r)],c.prototype,"headerStyle",void 0),i([H.Property("TopLeft")],c.prototype,"templatePosition",void 0),i([H.Collection([],Se)],c.prototype,"colorMapping",void 0);var _e,t=c;function c(){return null!==_e&&_e.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,r){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"]=r},R=function(e,t,i,l,o,r,n){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=r,this.d=n};function G(e,t){var i=document.getElementById("treeMapMeasureText");return null===i&&(i=H.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(i)),i.innerHTML=H.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,r,n,a){void 0===r&&(r=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=r,this.anchor=l,this.x=t,this.y=i,this.baseLine=n,this.connectorText=a};function V(e,t,i){var l=t;if(e<G(t,i).width)for(var o=t.length-1;0<=o;--o)if(G(l=t.substring(0,o)+"...",i).width<=e||l.length<4)return l=l.length<4?" ":l;return l}var m=function(e,t){this.x=e,this.y=t};function Re(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 m(o,t)}function ze(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 r,n,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 F.SvgRenderer("");if(!H.isNullOrUndefined(i)&&!H.isNullOrUndefined(e.connectorText)&&0<=i.search(e.connectorText[1]))for(var h=i.split("#"),d=0;d<h.length;d++){var p=-1===h[d].search(e.connectorText)||H.isNullOrUndefined(e.connectorText)?h[d]:e.connectorText,p=(a.id=e.id+"_"+d,n=ze(s,a,p),d%2==0&&0!==d&&(p=p.replace(/\s+/g," ")),G(p,t));a.x=0!==d?a.x+p.width:a.x+p.width+5,l.appendChild(n)}else n=ze(s,a,i),l.appendChild(n);if("string"!=typeof e.text&&1<e.text.length){for(var g=1,c=e.text.length;g<c;g++)r=G(e.text[g],t).height,r=s.createTSpan({x:e.x,id:e.id,y:e.y+g*r},e.text[g]),n.appendChild(r);l.appendChild(n)}return n}function ke(e,t,i){var l=e.split("_RectPath")[0],e=-1<e.indexOf("_LabelTemplate")?t:document.querySelector("#"+l+"_LabelTemplate");H.isNullOrUndefined(e)||(e.innerHTML=i)}function Ae(e){return document.getElementById(e)}function He(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function We(e,t,i,l){for(var o=!1,r="",n=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:n.labelPath||l.weightValuePath]||"undefined";if(e[a]===s&&(r+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function z(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 je(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=z(e).values;if(o&&0<o.length){for(var r=0;r<o.length;r++)-1===t.indexOf(o[r].levelOrderName)&&t.push(o[r].levelOrderName);for(var n=0;n<o.length;n++)je(o[n],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),je(e.parent,t,i,l));else if("All"===i)for(var a=e.levelOrderName.split("#")[0],s=void 0,r=0;r<l.layout.renderItems.length;r++)-1<(s=l.layout.renderItems[r]).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?H.compile(document.querySelector(t).innerHTML.trim()):H.compile(t)}catch(e){i=H.compile(t)}return i}function Ve(e,t,i){for(var l=H.createElement("div",{id:t}),o=(l.style.cssText="position: absolute;pointer-events: auto;",e.length);0<o;)l.appendChild(e[0]),o--;for(var r=l.innerHTML,n=Object.keys(i),a=0;a<n.length;a++)var s=RegExp,r=r.replace(new s("{{:"+n[a]+"}}","g"),i[n[a].toString()]);return l.innerHTML=r,l}function qe(e,t,i,l,o){var r=new m(0,0),n="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return r.x=Math.abs(n-(-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?r.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)):r.y=Math.abs(e.y+e.height-i.height+5),r}function Xe(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 Je(e){return(e.width-e.x)*(e.height-e.y)}function Ye(e){var e=Ze(e),t=e.width,e=e.height;return Math.min(t,e)}function Ze(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function Qe(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function $e(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,r=i.ownerDocument.defaultView.pageYOffset,n=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=l.left+o-i,i=l.top+r-n;return new m(e-o,t-i)}function Ke(e,t,i){var l,o,r=[];if(H.isNullOrUndefined(t)&&H.isNullOrUndefined(i)&&isNaN(i))return null;for(var n=0;n<e.length;n++){var a=!1,s=i;H.isNullOrUndefined(e[n].from)||H.isNullOrUndefined(e[n].to)||H.isNullOrUndefined(e[n].value)?(H.isNullOrUndefined(e[n].from)||H.isNullOrUndefined(e[n].to))&&H.isNullOrUndefined(e[n].value)||(i>=e[n].from&&e[n].to>=i||e[n].value===t)&&(e[n].value===t&&(a=!0),l="[object Array]"===Object.prototype.toString.call(e[n].color)?a?e[n].color[0]:tt(e[n],s):e[n].color):i>=e[n].from&&e[n].to>=i&&e[n].value===t&&(a=!0,l="[object Array]"===Object.prototype.toString.call(e[n].color)?a?e[n].color[0]:tt(e[n],s):e[n].color),(i>=e[n].from&&i<=e[n].to||e[n].value===t)&&!H.isNullOrUndefined(e[n].minOpacity)&&!H.isNullOrUndefined(e[n].maxOpacity)&&l&&(o=et(e[n],i)),(""===l||H.isNullOrUndefined(l))&&H.isNullOrUndefined(e[n].from)&&H.isNullOrUndefined(e[n].to)&&H.isNullOrUndefined(e[n].minOpacity)&&H.isNullOrUndefined(e[n].maxOpacity)&&H.isNullOrUndefined(e[n].value)&&(l="[object Array]"===Object.prototype.toString.call(e[n].color)?e[n].color[0]:e[n].color),o=H.isNullOrUndefined(o)?"1":o,r.push(l)}for(var h=r.length-1;0<=h;h--)h=(l=r[h])?-1:h;return{fill:l,opacity:o}}function et(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 tt(e,t){return lt(e,t)}function it(e,t,i){return"#"+u(e)+u(t)+u(i)}function lt(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:it((t=ot(Number(t),e)).r,t.g,t.b)}function ot(e,t){var i=t.from,l=t.to,o=0,r=l-i,o=(e-i)/r;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:y(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:y(t.color[t.color.length-1]);else{for(var n,a="#"===t.color[0].charAt(0)?t.color[0]:y(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:y(t.color[t.color.length-1]),h=r/(t.color.length-1),d=t.color.length-1,p=[],g=1;g<d;g++)n={b:i+g*h,color:t.color[g]},p.push(n);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:y(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/h):(e-p[c].b)/h):p[c].b<=e&&e<=l&&c===p.length-1&&(a="#"===p[c].color.charAt(0)?p[c].color:y(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/h):(e-p[c].b)/h),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:y(p[c].color),s="#"===p[c+1].color.charAt(0)?p[c+1].color:y(p[c+1].color),o=Math.abs(e-p[c+1].b)/h)}return rt(o,a,s)}function rt(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],l=nt(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=nt(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=nt(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new ut(l,o,e)}function nt(e,t,i){return Math.round(t+(i-t)*e)}function at(e,t,i){for(var l,o=t.split(" "),r="",n=[],a=0,s=o.length;a<s;a++)l=o[a],G(r.concat(l),i).width<e?r=r.concat((""===r?"":" ")+l):""!==r?(n.push(V(e,r,i)),r=l):n.push(V(e,l,i)),r&&a===s-1&&n.push(V(e,r,i));return n}function st(e,t,i){var l=[],o=0,r=G(t,i).width,n=t.length;if(r<=e)l.push(t);else for(var a=t.length;o<a;a--){var s=t.slice(o,a);if(G(s,i).width<=e){if(l.push(s),n===(o+=s.length))return l;a=n+1}}return l}function ht(e,t,i,l){l=G(i,l);return l.width>e||l.height>t?" ":i}function dt(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function pt(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]?0<t.childElementCount&&(t.children[0].setAttribute("class",i),D(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function gt(e,t){var i=e.legendId;if(i)for(var l=0;l<i.length;l++)for(var o,r=0;r<t.childElementCount;r++)t.childNodes[r].id===i[l]&&((o=t.childNodes[r]).setAttribute("fill",e.selectionSettings.fill),o.setAttribute("stroke",e.selectionSettings.border.color),o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("opacity",e.selectionSettings.opacity))}function N(e,t,i){for(var l,o,r=0;r<e.length;r++)l=H.isNullOrUndefined(e[r].childNodes[0])?e[r]:e[r].childNodes[0],o=i.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options,D(l,o),e[r].classList.remove(t),--r}function D(e,t){e.setAttribute("opacity",t.opacity),H.isNullOrUndefined(t.fill)||e.setAttribute("fill",t.fill),e.setAttribute("stroke",t.border.color),e.setAttribute("stroke-width",t.border.width)}function ct(e,t,i){if(H.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(t);l<o.length;l++){var r=o[l];e=e.split("${"+r+"}").join(mt(t[r],i).toString())}return e}function mt(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t||""}var ut=function(e,t,i){this.r=e,this.g=t,this.b=i};function yt(e){return"#"+u(e.r)+u(e.g)+u(e.b)}function u(e){e=e.toString(16);return 1===e.length?"0"+e:e}function ft(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new ut(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new ut(255,255,255)}function y(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 yt(new ut(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function vt(e,t,i,l,o){var r=new F.SvgRenderer(""),e=bt(e,i,t,o,l);return r["draw"+e.functionName](e.renderOption)}function bt(e,t,i,l,o){var r,n="Path",a=t.width,s=t.height,h=e.x,d=e.y,p=e.x+-a/2,g=e.y+-s/2;switch(i){case"Circle":case"Bubble":n="Ellipse",H.merge(l,{rx:a/2,ry:s/2,cx:h,cy:d});break;case"VerticalLine":H.merge(l,{d:r="M "+h+" "+(d+s/2)+" L "+h+" "+(d+-s/2)});break;case"Diamond":H.merge(l,{d:r="M "+p+" "+d+" L "+h+" "+(d+-s/2)+" L "+(h+a/2)+" "+d+" L "+h+" "+(d+s/2)+" L "+p+" "+d+" z"});break;case"Rectangle":H.merge(l,{d:r="M "+p+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+s/2)+" L "+p+" "+(d+s/2)+" L "+p+" "+(d+-s/2)+" z"});break;case"Triangle":H.merge(l,{d:r="M "+p+" "+(d+s/2)+" L "+h+" "+(d+-s/2)+" L "+(h+a/2)+" "+(d+s/2)+" L "+p+" "+(d+s/2)+" z"});break;case"InvertedTriangle":H.merge(l,{d:r="M "+(h+a/2)+" "+(d-s/2)+" L "+h+" "+(d+s/2)+" L "+(h-a/2)+" "+(d-s/2)+" L "+(h+a/2)+" "+(d-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)),r=0===u?"M "+(h+c)+" "+(d+m)+" ":r.concat("L "+(h+c)+" "+(d+m)+" ");r=r.concat("Z"),H.merge(l,{d:r});break;case"Star":r="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",H.merge(l,{d:r});break;case"Cross":H.merge(l,{d:r="M "+p+" "+d+" L "+(h+a/2)+" "+d+" M "+h+" "+(d+s/2)+" L "+h+" "+(d+-s/2)});break;case"Image":n="Image",H.merge(l,{href:o,height:s,width:a,x:p,y:g})}return{renderOption:l,functionName:n}}function St(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function xt(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o}function E(e){if(0<e.length)for(var t=0;t<e.length;t++){var i=e[t];M(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function wt(e){if(0<e.length)for(var t=0;t<e.length;t++)for(var i=e[t],l=(M(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth),i.ShapeCollection.Elements.length),o=0;o<l;o++)M(i.ShapeCollection.Elements[o],i.shapeOldFill,i.shapeOldOpacity,i.shapeOldBorderColor,i.shapeOldBorderWidth)}function M(e,t,i,l,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),e.setAttribute("stroke",l),e.setAttribute("stroke-width",o)}function Ft(e,t,i){E(e),N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function Ct(e,t,i){for(var l,o=0;o<e;o++)for(var r=i.treeMapLegendModule.legendCollections[o].legendData.length,n=0;n<r;n++)if(i.treeMapLegendModule.legendCollections[o].legendData[n].levelOrderName===t.levelOrderName){l=o;break}return l}function It(e,t,i,l,o,r,n){e.push({legendEle:l,oldFill:n[t].legendFill,oldOpacity:n[t].opacity,oldBorderColor:n[t].borderColor,oldBorderWidth:n[t].borderWidth,shapeElement:o,shapeOldFill:r[i].options.fill,shapeOldOpacity:r[i].options.opacity,shapeOldBorderColor:r[i].options.border.color,shapeOldBorderWidth:r[i].options.border.width})}function Ot(e,t,i,l){H.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Lt(e){e=document.getElementById(e);return e?H.remove(e):null}f.prototype.processLayoutPanel=function(){var e,t,i,l;this.treemap.treemapLevelData.levelsData&&0<this.treemap.treemapLevelData.levelsData.length&&(i=(H.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||H.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(H.isNullOrUndefined(this.treemap.drilledItems)?!H.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[]))[0],l=H.extend({},this.treemap.areaRect,l,!1),H.isNullOrUndefined(this.treemap.treeMapLegendModule)||H.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(l=this.treemap.totalRect),H.isNullOrUndefined(this.treemap.currentLevel)||(H.isNullOrUndefined(this.treemap.drilledItems)?H.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?(!H.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(H.isNullOrUndefined(this.treemap.drilledItems)?H.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],H.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())},f.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=z(e).values;if(o&&0<o.length&&0===t.length){for(var r=0;r<o.length;r++)o[r].groupIndex===i.initialDrillDown.groupIndex&&o[r].name===i.initialDrillDown.groupName&&(o[r].isDrilled=!0,l[o[r].groupName]=[o[r]],t.push(l));for(var n=0;n<o.length;n++)this.getDrilldownData(o[n],t)}return t},f.prototype.calculateLayoutItems=function(e,t){this.renderItems=[],this.parentData=[],H.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)))},f.prototype.computeSliceAndDiceDimensional=function(e,t){var i,l,o,r=this.treemap.leafItemSettings,n=this.treemap.levels,a=z(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===n.length||o===n.length?r.gap:n[o].groupGap,o=0===n.length?0:n[o]?n[o].showHeader?n[o].headerHeight:0:n[o-1].showHeader?n[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},f.prototype.sliceAndDiceProcess=function(e,t){var i,l=t.height*t.width,o=this.treemap.levels,r=0,n=0,a=(e.forEach(function(e){n+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/n}),"SliceAndDiceAuto"===this.treemap.layoutType?t.width>t.height:"SliceAndDiceHorizontal"===this.treemap.layoutType);e.sort(He);for(var s=0;s<e.length;s++){var h=e[s];h.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||H.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?h.groupIndex===o.length-1:h.groupIndex===this.treemap.levels.length),a?(i=l/n*e[s].weight/t.height,r<=t.width&&(e[s].rect=new j(r+t.x,t.y,i,t.height))):(i=l/n*e[s].weight/t.width,r<=t.height&&(e[s].rect=new j(t.x,r+t.y,t.width,i))),r+=i,this.renderItems.push(e[s])}},f.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,r,n=this.treemap.leafItemSettings,a=this.treemap.levels,s=z(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 h=0;h<s.length;h++)r=(l=s[h]).groupIndex,i=l.rect,o=(l.isLeafItem?n.padding:a[r].groupPadding)/2,r=this.treemap.isHierarchicalData?(0!==r||!l.isLeafItem)&&a[r]&&a[r].showHeader?a[r].headerHeight:0:0!==a.length&&a[r]&&a[r].showHeader?a[r].headerHeight:0,i=new j(i.x+o,i.y+(r+o),i.width-o,i.height-o),!l.isLeafItem&&0<l.weight&&this.computeSquarifyDimensional(s[h],i)},f.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,Je(i)),t.sort(dt),this.performRowsLayout(t,[],i,[])},f.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o)return d=this.getCoordinates(t,i),l.concat(d);var r=Ye(i),n=e[0],o=e.slice(1,o);if(this.aspectRatio(t,n,r))return r=t.concat(n),this.performRowsLayout(o,r,i,l);for(var a=t.length,s=0,h=0;h<a;h+=1)s+=t[h].itemArea;var n=this.cutArea(i,s),d=this.getCoordinates(t,i),o=l.concat(d);return this.performRowsLayout(e,[],n,o)},f.prototype.aspectRatio=function(e,t,i){return 0===e.length||(t=e.concat(t),e=this.findMaxAspectRatio(e,i),this.findMaxAspectRatio(t,i)<=e)},f.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,r=0,n=0;n<i;n+=1){var a=e[n].itemArea;a<l&&(l=a),o<a&&(o=a),r+=a}return Math.max(Math.pow(t,2)*o/Math.pow(r,2),Math.pow(r,2)/(Math.pow(t,2)*l))},f.prototype.cutArea=function(e,t){var i,e=Ze(e),l=e.width,o=e.height,r=e.x,e=e.y;return Qe(o<=l?{x:r+(i=t/o),y:e,width:l-i,height:o}:{x:r,y:e+(i=t/l),width:l,height:o-i})},f.prototype.getCoordinates=function(e,t){for(var i=Ze(t),l=i.width,o=i.height,r=i.x,i=i.y,n=e.length,a=this.treemap.levels,s=this.treemap.leafItemSettings,h=0,d=0;d<n;d+=1)h+=e[d].itemArea;for(var p,g,c=h/o,m=h/l,u=r,y=i,f=[],d=0;d<n;d+=1){var v,b=e[d],S=b.groupIndex;b.isLeafItem=0===a.length||(this.treemap.isHierarchicalData||!H.isNullOrUndefined(s.labelPath))&&S===a.length,g=(p=St(this.parentData[0],b))?this.treemap.areaRect:b.parent.rect,S=b.isLeafItem?s.padding:a[S].groupPadding,o<=l?(v=y+b.itemArea/c,b.rect={x:u,y:y,width:u+c,height:v},y=v):(v=u+b.itemArea/m,b.rect={x:u,y:y,width:v,height:y+m},u=v),0<b.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(b),f.push(b))}return f},f.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var r=e.length,n=0,a=0;a<r;a+=1)n+=e[a].weight;for(var s=t/n,h=void 0,d=0;d<r;d++)(h=e[d]).itemArea=h.weight*s,l.push(h)}return l},f.prototype.onDemandProcess=function(e){var t,i=e[0].parent;this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;for(var l={},o=(H.isNullOrUndefined(i.groupName)?l=i:l[i.groupName]=[i],t=H.extend({},this.treemap.areaRect,t,!1),H.isNullOrUndefined(this.treemap.treeMapLegendModule)||H.isNullOrUndefined(this.treemap.totalRect)||(t=this.treemap.totalRect),this.treemap.levels.length),r=0;r<o;r++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[r]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,t),this.renderLayoutItems()},f.prototype.renderLayoutItems=function(){for(var a,s,h,d,p,g,c,m,u,y,f,v,b,S,x,w,F,C,I=this,O=this.treemap,L=(this.renderer=O.renderer,O.element.id),e=O.layoutType,T=this.treemap.leafItemSettings.interSectAction,N="",D=document.getElementById(O.element.id+"_Secondary_Element"),E=O.levels,M=(this.layoutGroup=this.renderer.createGroup({id:L+"_TreeMap_"+e+"_Layout"}),H.createElement("div",{id:O.element.id+"_Label_Template_Group",className:"template"})),P=(M.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),_=O.leafItemSettings,B=this,t=0;t<this.renderItems.length;t++)!function(e){if(m=B.renderItems[e],d=m.groupIndex,B.treemap.drillDownView&&H.isNullOrUndefined(B.treemap.currentLevel)&&0<d||B.treemap.drillDownView&&d>B.treemap.currentLevel+1)return;g=m.rect,P=m.isLeafItem,f=L+"_Level_Index_"+d+"_Item_Index_"+e,S=B.renderer.createGroup({id:f+"_Group"}),F=(P?_.gap:E[d].groupGap)/2;var t,e=B.treemap.totalRect?Ze(B.treemap.totalRect):B.treemap.areaRect;"Squarified"===O.layoutType&&(g.width=Math.abs(g.x-g.width)-F,g.height=Math.abs(g.y-g.height)-F),"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)),F=B.getItemColor(P,m),c=F.fill,y=F.opacity,F=P?_.labelFormat:E[d].headerFormat,s=P?_.showLabels:E[d].showHeader,t=d===B.treemap.currentLevel?B.treemap.enableBreadcrumb?(C="#"+B.treemap.breadcrumbConnector+"#",t=m.levelOrderName.replace(/#/gi,C),0!==d?"#"+t:t):m.name:(B.treemap.enableBreadcrumb&&(m.isDrilled=!1),m.name),u=ct(F,m.data,B.treemap)||t||"undefined",F=z(m).values,u=!P&&F&&0<F.length&&B.treemap.enableDrillDown?m.isDrilled?O.enableRtl?u+" [-]":"[-] "+u:O.enableRtl?u+" [+]":"[+] "+u:u;var e=(P?_.labelStyle:E[d].headerStyle).fontFamily||B.treemap.themeStyle.labelFontFamily,i=(P?_.labelStyle:E[d].headerStyle).size||B.treemap.themeStyle.labelFontSize,l=(P?_.labelStyle:E[d].headerStyle).fontWeight||B.treemap.themeStyle.fontWeight,o=(P?_.labelStyle:E[d].headerStyle).color,r=(P?_.labelStyle:E[d].headerStyle).fontStyle,n=(P?_.labelStyle:E[d].headerStyle).opacity;b={fontFamily:e,size:i,fontWeight:l,color:o,fontStyle:r,opacity:n},w=(P?_:E[d]).border,a=P?_.labelPosition:"Near"===E[d].headerAlignment?"TopLeft":"Center"===E[d].headerAlignment?"TopCenter":"TopRight",p=(P?_:E[d]).templatePosition,x=P?_.labelTemplate:E[d].headerTemplate,m.options={border:w,opacity:y,fill:c},h={cancel:!1,name:k,treemap:B.treemap,text:u,currentItem:m,RenderItems:B.renderItems,options:m.options,textColor:b.color},B.treemap.trigger(k,h,function(e){e.cancel||(N=" 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 R(f+"_RectPath",c,w.width,w.color,y,null,N),e=I.renderer.drawPath(v),S.appendChild(e),s&&(h.text!==u&&(h.text=ct(h.text,m.data,I.treemap)||t),b.color=h.textColor||b.color,I.renderItemText(h.text.toString(),S,b,g,T,f,c,a,C)),x&&(v=I.renderTemplate(D,f,g,p,x,m,P),H.isNullOrUndefined(v)||(M.appendChild(v),I.treemap.renderReactTemplates())),S.setAttribute("aria-label",m.name),I.treemap.enableDrillDown&&P||I.treemap.selectionSettings.enable||I.treemap.highlightSettings.enable?(S.setAttribute("role","button"),S.setAttribute("tabindex",I.treemap.tabIndex.toString()),S.style.cursor=(!I.treemap.highlightSettings.enable||I.treemap.selectionSettings.enable||!I.treemap.enableDrillDown||m.groupIndex!==I.treemap.levels.length-1)&&(!I.treemap.highlightSettings.enable||I.treemap.selectionSettings.enable||I.treemap.enableDrillDown)?"pointer":"default"):S.setAttribute("role","region"),pt(I.treemap,S,"treeMapSelection"),I.layoutGroup.appendChild(S))})}(t);0<M.childNodes.length&&D.appendChild(M),this.treemap.svgObject.appendChild(this.layoutGroup)},f.prototype.renderItemText=function(e,t,i,l,o,r,n,a,s){var h=[],d=0,p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(l,e,i,o),c=G(p&&p[0]||g[0],i),e=(this.treemap.enableRtl&&(b=G(e,i),v=e.search("[+]")||e.search("[-]"),l.width<b.width)&&0<v&&(b=e.substring(v-1,e.length),v=G("[+]",i),g[0]=V(l.width-v.width-5,g[0],i)+b),qe(l,a,c,"Text",this.treemap));if(!H.isNullOrUndefined(p)){for(var m,u=[],y=[],f=0;f<p.length;f++)d+=(c=G(m=V(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=d}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var v,b,S=0;S<g.length;S++)d+=(c=G(g[S],i)).height,l.height-5>d&&h.push(g[S]);"Wrap"===o&&g.length!==h.length&&h.length&&(b=(b=h[v=h.length-1]).substring(0,b.length-1)+"...",h.splice(v),"..."!==b)&&h.push(b)}else a=g,h.push(a);Ue(new T(r+"_Text",e.x,e.y,"start",h,"","",s),i,i.color||this.getSaturatedColor(n),t)},f.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,r=(H.isNullOrUndefined(i.treemapLevelData.defaultLevelsData)||0<i.treemapLevelData.defaultLevelsData.length&&(i.treemapLevelData.levelsData=i.treemapLevelData.defaultLevelsData),z(i.treemapLevelData.levelsData[0]).values),e=(e?i.leafItemSettings:i.levels[t.groupIndex]).colorMapping;if(0<e.length){e=Ke(e,t.data[i.equalColorValuePath],t.data[i.rangeColorValuePath]);H.isNullOrUndefined(e)||(l=(H.isNullOrUndefined(e.fill)?i.leafItemSettings:e).fill,o=e.opacity)}else for(var n=0;n<r.length;n++)r[n].levelOrderName===t.levelOrderName.split("#")[0]&&(l=H.isNullOrUndefined(l)?H.isNullOrUndefined(i.colorValuePath)?!H.isNullOrUndefined(i.palette)&&0<i.palette.length?i.palette[n%i.palette.length]:"#808080":r[n].data[i.colorValuePath]:l);return{fill:l,opacity:o}},f.prototype.getSaturatedColor=function(e){var t=e,e=ft(y("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"},f.prototype.renderTemplate=function(e,t,i,l,o,r,n){var a,t=n?t+"_LabelTemplate":t+"_HeaderTemplate",n=n?"_LabelTemplate":"_HeaderTemplate";if(H.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var s=Object.keys(r.data),h=0;h<s.length;h++){var d=RegExp;o=o.replace(new d("{{:"+s[h]+"}}","g"),r.data[s[h].toString()])}return H.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))||(i=qe(i,l,Xe(a=Ve(Ge(o)(r.data,this.treemap,o,this.treemap.element.id+n,!1),t,r.data),e),"Template",this.treemap),a.style.left=i.x+"px",a.style.top=i.y+"px"),a},f.prototype.labelInterSectAction=function(e,t,i,l){var o,r=e.width-10;switch(l){case"Hide":o=[ht(r,e.height,t,i)];break;case"Trim":o=[V(3+r,t,i)];break;case"WrapByWord":o=at(r,t,i);break;case"Wrap":o=st(r,t,i)}return o},f.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]};var Tt=f;function f(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: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",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:re,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"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",labelFontFamily:re,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",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:U});e.trigger(U,l,function(){l.cancel||H.print(l.htmlContent,i)})},Et.prototype.getHTMLContent=function(e,t){var i,l,o=H.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],H.isNullOrUndefined(l)||(l=l.childNodes[0],H.isNullOrUndefined(l))||(i=l.getAttribute("fill"),"Tailwind"!==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&&"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 Dt=Et;function Et(e){}Pt.prototype.export=function(h,d,p,g){return new Promise(function(e,t){var i,l,o=H.createElement("canvas",{id:"ej2-canvas",attrs:{height:h.availableSize.height.toString(),width:h.availableSize.width.toString()}}),r=h.svgObject.cloneNode(!0),n=r.childNodes[0],a=(H.isNullOrUndefined(n)||(n=n.getAttribute("fill"),"Tailwind"!==h.theme&&"Bootstrap5"!==h.theme&&"Fluent"!==h.theme&&"Material3"!==h.theme&&"Fluent2"!==h.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n?"TailwindDark"!==h.theme&&"Bootstrap5Dark"!==h.theme&&"FluentDark"!==h.theme&&"Material3Dark"!==h.theme&&"Fluent2Dark"!==h.theme&&"Fluent2HighContrast"!==h.theme||"rgba(255,255,255, 0.0)"!==n&&"transparent"!==n||r.childNodes[0].setAttribute("fill","rgba(0, 0, 0, 1)"):r.childNodes[0].setAttribute("fill","rgba(255,255,255, 1)")),!(-1<H.Browser.userAgent.toString().indexOf("HeadlessChrome"))),n='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">'+r.outerHTML+"</svg>",s=window.URL.createObjectURL(new Blob("SVG"===d?[n]:[(new XMLSerializer).serializeToString(r)],{type:"image/svg+xml"}));"SVG"===d?g?Ot(p,d,s,a):e(null):(i=new Image,l=o.getContext("2d"),i.onload=function(){l.drawImage(i,0,0),window.URL.revokeObjectURL(s),g?Ot(p,d,o.toDataURL("image/png").replace("image/png","image/octet-stream"),a):"JPEG"===d?e(o.toDataURL("image/jpeg")):"PNG"===d&&e(o.toDataURL("image/png"))},i.src=s)})},Pt.prototype.getModuleName=function(){return"ImageExport"},Pt.prototype.destroy=function(){};var Mt=Pt;function Pt(e){}Bt.prototype.export=function(s,e,h,d,p){return new Promise(function(i,e){var l=H.createElement("canvas",{id:"ej2-canvas",attrs:{width:s.availableSize.width.toString(),height:s.availableSize.height.toString()}}),t=(d=H.isNullOrUndefined(d)?I.PdfPageOrientation.Landscape:d,s.svgObject.cloneNode(!0)),o=t.childNodes[0],r=(H.isNullOrUndefined(o)||(o=o.getAttribute("fill"),"Tailwind"!==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&&"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"}))),n=new Image,a=l.getContext("2d");n.onload=function(){a.drawImage(n,0,0),window.URL.revokeObjectURL(r);var e=new I.PdfDocument,t=l.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");e.pageSettings.orientation=d,t=t.slice(t.indexOf(",")+1),e.pages.add().graphics.drawImage(new I.PdfBitmap(t),0,0,s.availableSize.width-60,s.availableSize.height),p?(e.save(h+".pdf"),e.destroy()):i(null)},n.src=r})},Bt.prototype.getModuleName=function(){return"PdfExport"},Bt.prototype.destroy=function(){};var _t=Bt;function Bt(e){}Rt=function(e,t){return(Rt=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 Rt,zt,i=function(e,t){function i(){this.constructor=e}Rt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},v=function(e,t,i,l){var o,r=arguments.length,n=r<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(n=(r<3?o(n):3<r?o(t,i,n):o(t,i))||n);return 3<r&&n&&Object.defineProperty(t,i,n),n},i=(zt=H.Component,i(b,zt),b.prototype.preRender=function(){var e=this;this.trigger(_,{treemap:this},function(){e.initPrivateVariable(),e.unWireEVents(),e.createSvg(),e.wireEVents(),e.setCulture()})},b.prototype.render=function(){this.renderElements()},b.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),H.isNullOrUndefined(this.treemapLevelData.levelsData)||(this.treemapLevelData.defaultLevelsData=this.treemapLevelData.levelsData),this.processDataManager()},b.prototype.processDataManager=function(){var e,t,l=this;this.dataSource instanceof C.DataManager?(e=this.dataSource,t=this.query instanceof C.Query?this.query:new C.Query,e.executeQuery(t).then(function(e){l.dataSource=e.result,l.renderTreeMapElements()})):this.dataSource instanceof xt?(e=this.dataSource,(t=new H.Fetch(e.dataOptions,e.type,e.contentType)).onSuccess=function(e){var t,i;H.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()},b.prototype.renderTreeMapElements=function(){this.processingData(),this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.renderLegend(),this.layout.processLayoutPanel(),this.element.appendChild(this.svgObject),this.elementChange(),this.trigger(B,{treemap:this,isResized:this.isResize}),this.isResize=!1,this.renderComplete()},b.prototype.createSvg=function(){if(this.svgObject){for(;0<this.svgObject.childNodes.length;)this.svgObject.removeChild(this.svgObject.firstChild);!this.svgObject.hasChildNodes()&&this.svgObject.parentNode&&H.remove(this.svgObject)}H.isNullOrUndefined(this.renderer)&&(this.renderer=new F.SvgRenderer(this.element.id)),H.isNullOrUndefined(this.layout)&&(this.layout=new Tt(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})},b.prototype.initPrivateVariable=function(){var e;""===this.element.id&&(e=document.getElementsByClassName("e-treemap").length,this.element.id="treemap_control_"+e),this.renderer=new F.SvgRenderer(this.element.id),this.layout=new Tt(this)},b.prototype.createSecondaryElement=function(){var e=document.getElementById(this.element.id+"_Secondary_Element");e&&0<e.childElementCount&&e.parentNode.removeChild(e),H.isNullOrUndefined(document.getElementById(this.element.id+"_Secondary_Element"))&&((e=H.createElement("div",{id:this.element.id+"_Secondary_Element"})).style.cssText="position: absolute;z-index:1;",this.element.appendChild(e))},b.prototype.elementChange=function(){this.treeMapLegendModule&&this.legendSettings.visible&&this.treeMapLegendModule.legendGroup&&this.layout.layoutGroup&&!H.isNullOrUndefined(this.svgObject)&&!H.isNullOrUndefined(document.getElementById(this.layout.layoutGroup.id))&&!H.isNullOrUndefined(document.getElementById(this.treeMapLegendModule.legendGroup.id))&&this.svgObject.insertBefore(this.layout.layoutGroup,this.treeMapLegendModule.legendGroup)},b.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)&&H.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)},b.prototype.renderTitle=function(e,t,i,l){var o,r,n,a={color:e.textStyle.color,size:e.textStyle.size,fontFamily:e.textStyle.fontFamily,fontStyle:e.textStyle.fontStyle,fontWeight:e.textStyle.fontWeight,opacity:e.textStyle.opacity},s=this.availableSize.width-this.margin.right-this.margin.left;a.fontFamily=a.fontFamily||this.themeStyle.fontFamily,a.fontWeight=a.fontWeight||this.themeStyle.titleFontWeight,a.size=a.size||("title"===t?this.themeStyle.fontSize:this.themeStyle.subtitleFontSize),e.text?(H.isNullOrUndefined(l)&&(l=this.renderer.createGroup({id:this.element.id+"_Title_Group"})),n=G(r=V(s,e.text,a),a),i=Re(H.isNullOrUndefined(i)?new j(this.margin.left,this.margin.top,this.availableSize.width,this.availableSize.height):i,e.alignment,n,t),r=new T(this.element.id+"_TreeMap_"+t,i.x,i.y,"start",r),i=new j(i.x,i.y,n.width,n.height),(n=Ue(r,a,a.color||("title"===t?this.themeStyle.titleFontColor:this.themeStyle.subTitleFontColor),l)).setAttribute("aria-label",e.description||e.text),n.setAttribute("role","region"),n.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,s,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,s,o))},b.prototype.processingData=function(){var t=this;if(this.dataSource=this.dataSource,!H.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=z(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=H.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")}},b.prototype.checkIsHierarchicalData=function(){var e;this.dataSource=this.dataSource;for(var t=0;t<this.dataSource.length;t++){if((e=z(this.dataSource[t]).values)&&e.length){this.isHierarchicalData=!0;break}t===this.dataSource.length-1&&(this.isHierarchicalData=!1)}},b.prototype.processHierarchicalData=function(e,t){var i,l=this,o={},r=this.leafItemSettings.labelPath||this.weightValuePath,n=(o=z(e))?o.values:null;if(n&&0<n.length){for(var a=o.key,s=0;s<this.levels.length;s++)a===this.levels[s].groupPath&&(i=s);for(var h=0;h<n.length;h++){n[h].name=n[h][r],n[h].levelOrderName=(0===i?n[h].name:e.levelOrderName+"#"+n[h].name)+"";var d=n[h].levelOrderName,p=void 0;0<d.search("#")&&(p=d.split("#").length-1),n[h].groupIndex=H.isNullOrUndefined(i)?p===this.levels.length?this.levels.length:p:i,0!==i&&(n[h].parent=e),n[h].groupName=a,n[h].data=n[h],n[h].isDrilled=!1,n[h].weight=n[h][this.weightValuePath]}n.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(!H.isNullOrUndefined(g)){for(var c=0;c<this.treemapLevelData.hierarchyData.length;c++)n=z(this.treemapLevelData.hierarchyData[c]).values,0!==c&&n&&(n.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}}},b.prototype.print=function(e){this.allowPrint&&this.printModule&&this.printModule.print(this,e)},b.prototype.export=function(i,l,o,r){var n=this;return H.isNullOrUndefined(r)&&(r=!0),"PDF"===i&&this.allowPdfExport&&this.pdfExportModule?new Promise(function(e,t){e(n.pdfExportModule.export(n,i,l,o,r))}):this.allowImageExport&&"PDF"!==i&&this.imageExportModule?new Promise(function(e,t){e(n.imageExportModule.export(n,i,l,r))}):null},b.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 r={},n="";if(!H.isNullOrUndefined(i)){var a=this.dataSource[o][i];if(0!==t)for(var s=0;s<=t;s++){var h=this.levels[s]?this.levels[s].groupPath:i;n+=this.dataSource[o][h]+(s===t?"":"#")}0<e.length&&-1!==e.indexOf(n||a)||(r.name=a,r.levelOrderName=(n||a)+"",r.groupIndex=t,r.isDrilled=!1,r.groupName=i,r.data=this.dataSource[o],this.treemapLevelData.levelsData[this.treemapLevelData.levelsData.length-1][i].push(r),e.push(n||a))}}}},b.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],r=0;r<l.length;r++)for(var n=l[r].levelOrderName,a=0;a<o.length;a++)if(o[a][t]=H.isNullOrUndefined(o[a][t])?[]:o[a][t],this.IsChildHierarchy(n.split("#"),o[a].levelOrderName.split("#"))){H.isNullOrUndefined(l[r].parent)&&(l[r].parent=o[a]),o[a][t].push(l[r]);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)},b.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},b.prototype.findTotalWeight=function(i,e){for(var l,o,r,n=this,a={},s=this,t=0;t<i.length;t++)!function(t){l=0,r=i[t].groupName,o=i[t].levelOrderName.split("#"),s.dataSource.forEach(function(e){We(o,i[t].levelOrderName,e,n)&&(l+=parseFloat(e[n.weightValuePath]))}),"Parent"===e&&((a[r]=i)[t].parent=a),i[t].weight=l}(t)},b.prototype.unWireEVents=function(){H.EventHandler.remove(this.element,"click",this.clickOnTreeMap),H.EventHandler.remove(this.element,"dblclick",this.doubleClickOnTreeMap),H.EventHandler.remove(this.element,"contextmenu",this.rightClickOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchStartEvent,this.mouseDownOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchMoveEvent,this.mouseMoveOnTreeMap),H.EventHandler.remove(this.element,H.Browser.touchEndEvent,this.mouseEndOnTreeMap),H.EventHandler.remove(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap),window.removeEventListener("resize",this.resizeEvent)},b.prototype.wireEVents=function(){H.EventHandler.add(this.element,"click",this.clickOnTreeMap,this),H.EventHandler.add(this.element,"dblclick",this.doubleClickOnTreeMap,this),H.EventHandler.add(this.element,"contextmenu",this.rightClickOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchStartEvent,this.mouseDownOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchMoveEvent,this.mouseMoveOnTreeMap,this),H.EventHandler.add(this.element,H.Browser.touchEndEvent,this.mouseEndOnTreeMap,this),H.EventHandler.add(this.element,"pointerleave mouseleave",this.mouseLeaveOnTreeMap,this),this.resizeEvent=this.resizeOnTreeMap.bind(this),window.addEventListener("resize",this.resizeEvent)},b.prototype.setCulture=function(){this.intl=new H.Internationalization},b.prototype.addTabIndex=function(){this.element.setAttribute("aria-label",this.description||"TreeMap Element"),this.element.setAttribute("role","region"),this.element.setAttribute("tabindex",this.tabIndex.toString())},b.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),!H.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)))},b.prototype.clickOnTreeMap=function(e){var t,i=this,l=e.target,o=l.id,r=l.innerHTML,n=(this.trigger($,{cancel:!1,name:$,treemap:this,mouseEvent:e}),-1<o.indexOf("_Item_Index")&&(e.preventDefault(),n=parseFloat(o.split("_Item_Index_")[1]),n={cancel:!1,name:Z,treemap:this,item:this.layout.renderItems[n],mouseEvent:e,groupIndex:this.layout.renderItems[n].groupIndex,groupName:this.layout.renderItems[n].name,text:r,contentItemTemplate:r},this.trigger(Z,n,function(e){e.text===r&&e.contentItemTemplate===r||(H.isNullOrUndefined(i.leafItemSettings.labelTemplate)?(e.text=ct(e.text,e.item.data,e.treemap),l.textContent=e.text):ke(o,l,e.contentItemTemplate))})),(new Date).getMilliseconds());H.isNullOrUndefined(this.doubleClick)||!H.isNullOrUndefined(t)&&n-t<500&&this.doubleClickOnTreeMap(e)},b.prototype.doubleClickOnTreeMap=function(e){this.trigger(K,{cancel:!1,name:K,treemap:this,mouseEvent:e})},b.prototype.rightClickOnTreeMap=function(e){this.trigger(ee,{cancel:!1,name:ee,treemap:this,mouseEvent:e})},b.prototype.mouseDownOnTreeMap=function(e){-1<e.target.id.indexOf("_Item_Index")&&(this.mouseDown=!0),this.notify(H.Browser.touchStartEvent,e)},b.prototype.mouseMoveOnTreeMap=function(e){var t,i=e.target.id;this.trigger(te,{cancel:!1,name:te,treemap:this,mouseEvent:e}),-1<i.indexOf("_Item_Index")?(t=z(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(H.Browser.touchMoveEvent,e)},b.prototype.calculateSelectedTextLevels=function(e,t){for(var i,l,o,r=t.levelOrderName.split("#"),n=0,a=Object.keys(r);n<a.length;n++)r[l=a[n]]===e&&(i=parseInt(l,10),o=e);return{drillLevel:i,currentLevelLabel:o,levelText:r}},b.prototype.calculatePreviousLevelChildItems=function(e,t,i){for(var l,o,r=0,n=this.layout.renderItems[0].levelOrderName.split("#").length,a=0;a<n;a++)o=0===a?e.levelText[a]:o+"#"+e.levelText[a];for(var s,r=1<n?n:r,h=0,d=Object.values(this.layout.renderItems);h<d.length;h++)(s=d[h]).levelOrderName.split("#")[0]===e.levelText[0]&&(l=0===r?H.isNullOrUndefined(o)?o:e.levelText[r]:i?o:o+"#"+e.levelText[r])===s.levelOrderName&&(this.drilledItems.push({name:s.levelOrderName,data:s}),i=!0,++r<=t.groupIndex)&&(o=l+"#"+e.levelText[r]);return i},b.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},b.prototype.mouseEndOnTreeMap=function(e){var i,l,t,o=this,r=e.target,n=r.id,a=!1,s={},h=this.element.id+"_TreeMap_"+this.layoutType+"_Layout",d=this.element.id+"_Label_Template_Group";if(-1<n.indexOf("_Item_Index")&&this.enableDrillDown&&!this.drillMouseMove){e.cancelable&&e.preventDefault(),n=parseFloat(n.split("_Item_Index_")[1]),p=this.layout.renderItems[n];var n=r.textContent;if(this.enableBreadcrumb&&(t=this.calculateSelectedTextLevels(n,p),l=t.drillLevel,this.drillDownView||-1===n.search("[+]")||(a=this.calculatePreviousLevelChildItems(t,p,a))),0!==this.levels.length&&!p.isLeafItem&&z(p).values&&0<z(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(!H.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&&H.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&&H.isNullOrUndefined(l)&&(p.isDrilled=!0,s[p.groupName]=[p])}else p.isDrilled=!0,s[p.groupName]=[p];n={cancel:!1,name:A,treemap:this,element:r,groupIndex:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!H.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).groupIndex,groupName:(this.enableBreadcrumb&&0!==this.drilledItems.length&&!H.isNullOrUndefined(l)?this.drilledItems[this.drilledItems.length-1].data:p).name,rightClick:3===e.which,childItems:null,item:s},this.trigger(A,n,function(e){var t;o.currentLevel=p.isDrilled&&H.isNullOrUndefined(l)?p.groupIndex:!H.isNullOrUndefined(l)&&o.enableBreadcrumb&&p.isDrilled?l:null,e.cancel||(document.getElementById(h)&&(t=document.getElementById(h)).parentNode.removeChild(t),i=H.extend({},o.areaRect,i,!0),o.legendSettings.visible&&!H.isNullOrUndefined(o.treeMapLegendModule)&&(H.isNullOrUndefined(s)||(o.treeMapLegendModule.legendGroup.textContent="",o.treeMapLegendModule.legendGroup=null,o.treeMapLegendModule.widthIncrement=0,o.treeMapLegendModule.heightIncrement=0,o.enableBreadcrumb&&!H.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=H.isNullOrUndefined(o.totalRect)?i:o.totalRect),document.getElementById(d)&&(t=document.getElementById(d)).parentNode.removeChild(t),H.isNullOrUndefined(e.childItems)||e.cancel?(o.layout.calculateLayoutItems(s,i),o.layout.renderLayoutItems()):o.layout.onDemandProcess(e.childItems))}),r={cancel:!1,name:q,treemap:this,renderItems:this.layout.renderItems},this.trigger(q,r),!a&&H.isNullOrUndefined(l)&&this.drilledItems.push({name:p.levelOrderName,data:p})}}this.mouseDown=!1,this.notify(H.Browser.touchEndEvent,e)},b.prototype.mouseLeaveOnTreeMap=function(e){this.treeMapTooltipModule&&this.treeMapTooltipModule.removeTooltip(),this.treeMapLegendModule&&this.treeMapLegendModule.removeInteractivePointer(),N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",this),this.treeMapHighlightModule&&(E(this.treeMapHighlightModule.shapeHighlightCollection),this.treeMapHighlightModule.highLightId="")},b.prototype.selectItem=function(e,t){H.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)},b.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,Dt],name:"Print"}),this.allowImageExport&&e.push({member:"ImageExport",args:[this,Mt],name:"ImageExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this,_t],name:"PdfExport"}),e},b.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())}},b.prototype.getModuleName=function(){return"treemap"},b.prototype.destroy=function(){this.unWireEVents(),Lt("treeMapMeasureText"),this.drilledItems=[],this.levelSelection=[],this.legendId=[],this.removeSvg(),zt.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,H.isNullOrUndefined(this.layout)||this.layout.destroy(),this.layout=null,this.renderer=null},b.prototype.removeSvg=function(){if(Lt(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&&H.remove(this.svgObject)}},v([H.Property(!(b.prototype.getPersistData=function(){return""}))],b.prototype,"allowPrint",void 0),v([H.Property(!1)],b.prototype,"allowImageExport",void 0),v([H.Property(!1)],b.prototype,"allowPdfExport",void 0),v([H.Property(null)],b.prototype,"width",void 0),v([H.Property(null)],b.prototype,"height",void 0),v([H.Complex({},l)],b.prototype,"border",void 0),v([H.Complex({},se)],b.prototype,"margin",void 0),v([H.Property(null)],b.prototype,"background",void 0),v([H.Property("Material")],b.prototype,"theme",void 0),v([H.Complex({},fe)],b.prototype,"titleSettings",void 0),v([H.Property("Squarified")],b.prototype,"layoutType",void 0),v([H.Property(null)],b.prototype,"dataSource",void 0),v([H.Property(null)],b.prototype,"query",void 0),v([H.Property(null)],b.prototype,"weightValuePath",void 0),v([H.Property("")],b.prototype,"rangeColorValuePath",void 0),v([H.Property("")],b.prototype,"equalColorValuePath",void 0),v([H.Property(null)],b.prototype,"colorValuePath",void 0),v([H.Property([])],b.prototype,"palette",void 0),v([H.Property("TopLeftBottomRight")],b.prototype,"renderDirection",void 0),v([H.Property(!1)],b.prototype,"enableDrillDown",void 0),v([H.Property(!1)],b.prototype,"enableBreadcrumb",void 0),v([H.Property(" - ")],b.prototype,"breadcrumbConnector",void 0),v([H.Property(!1)],b.prototype,"drillDownView",void 0),v([H.Complex({},Ce)],b.prototype,"initialDrillDown",void 0),v([H.Complex({},Le)],b.prototype,"leafItemSettings",void 0),v([H.Collection([],t)],b.prototype,"levels",void 0),v([H.Complex({},Pe)],b.prototype,"highlightSettings",void 0),v([H.Complex({},Ee)],b.prototype,"selectionSettings",void 0),v([H.Complex({},Ne)],b.prototype,"tooltipSettings",void 0),v([H.Complex({},we)],b.prototype,"legendSettings",void 0),v([H.Property(!1)],b.prototype,"useGroupingSeparator",void 0),v([H.Property(null)],b.prototype,"description",void 0),v([H.Property(0)],b.prototype,"tabIndex",void 0),v([H.Property(null)],b.prototype,"format",void 0),v([H.Event()],b.prototype,"load",void 0),v([H.Event()],b.prototype,"beforePrint",void 0),v([H.Event()],b.prototype,"loaded",void 0),v([H.Event()],b.prototype,"itemRendering",void 0),v([H.Event()],b.prototype,"drillStart",void 0),v([H.Event()],b.prototype,"drillEnd",void 0),v([H.Event()],b.prototype,"itemSelected",void 0),v([H.Event()],b.prototype,"itemHighlight",void 0),v([H.Event()],b.prototype,"tooltipRendering",void 0),v([H.Event()],b.prototype,"itemClick",void 0),v([H.Event()],b.prototype,"itemMove",void 0),v([H.Event()],b.prototype,"click",void 0),v([H.Event()],b.prototype,"doubleClick",void 0),v([H.Event()],b.prototype,"rightClick",void 0),v([H.Event()],b.prototype,"mouseMove",void 0),v([H.Event()],b.prototype,"resize",void 0),v([H.Event()],b.prototype,"legendItemRendering",void 0),v([H.Event()],b.prototype,"legendRendering",void 0),v([H.NotifyPropertyChanges],b));function b(e,t){e=zt.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(){},v=(S.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()})},S.prototype.calculateLegendBounds=function(){var i=this,e=this.treemap,t=e.legendSettings;if(this.findColorMappingLegendItems(e.treemapLevelData.levelsData[0]),(!H.isNullOrUndefined(this.treemap.palette)&&0<this.treemap.palette.length||!H.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,R=t.title.text,o=t.titleStyle,z=t.mode,r=0,n=0,a=0,s=0,h=t.shapeHeight,d=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,U=(o.fontFamily=o.fontFamily||e.themeStyle.fontFamily,o.fontWeight=o.fontWeight||e.themeStyle.titleFontWeight,o.size=o.size||e.themeStyle.subtitleFontSize,G(R,o)),y=0,f=0,v=t.shapePadding,b=t.textStyle;if(b.size=b.size||e.themeStyle.legendFontSize,b.fontFamily=b.fontFamily||e.themeStyle.fontFamily,b.fontWeight=b.fontWeight||e.themeStyle.fontWeight,"Default"===z){for(var m=H.isNullOrUndefined(m)?e.areaRect.width:m,u=H.isNullOrUndefined(u)?e.areaRect.height:u,S=0,x=0;x<this.legendCollections.length;x++){var w,F,C,I=this.legendCollections[x],O=(H.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]}),G(I.legendName,b));this.textMaxWidth=Math.max(this.textMaxWidth,O.width),0===x?(y=r=10+d/2,f=n=10+U.height+(h>O.height?h/2:O.height/4)):(w=O.height>h?O.height:h,"Horizontal"===c?n=(C=g[S-1].x+g[S-1].width+10+d)+v+O.width>m?u<(F=(g[S-1].y>p[S-1].y+h/2?g[S-1].y:p[S-1].y+h/2)+10)+w?(this.getPageChanged(),S=0,p=[],g=[],r=y,f):(r=p[0].x,F+w/2):(r=C-d/2,p[S-1].y):u<(F=g[S-1].y>p[S-1].y+h/2?g[S-1].y:p[S-1].y+h/2)+10+w?(C=g[S-1].x+this.textMaxWidth+10)+v+O.width>m?(r=y,n=f,g=[],p=[],this.getPageChanged(),S=0):(r=C+d/2,n=p[0].y):(r=p[S-1].x,n=F+10+h/2)),a=r+d/2+v,s=n+O.height/4,p.push({x:r,y:n}),g.push({x:a,y:s,width:O.width,height:O.height/2}),this.totalPages[this.page].Collection.push({DisplayText:I.legendName,element:I.gradientElement,Shape:{x:r,y:n},Text:{x:a,y:s},Fill:I.legendFill,Data:I.legendData,Rect:{x:p[S].x-d/2,y:p[S].y-h/2<s-O.height?p[S].y-h/2:s-O.height,width:Math.abs(p[S].x-d/2-(a+O.width)),height:h>O.height?h: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?H.isNullOrUndefined(m)?e.areaRect.width/L:m/L:H.isNullOrUndefined(m)?25:m,N="Horizontal"===c?H.isNullOrUndefined(u)?25:u:H.isNullOrUndefined(u)?e.areaRect.height/L:u/L,D=(y=0,f=U.height+10,t.labelPosition),E=0,M=0,k=t.labelDisplayMode,P=0,A=0,x=0;x<this.legendCollections.length;x++){var y="Horizontal"===c?y+T:y,f="Horizontal"===c?f:f+N,_=this.legendCollections[x].legendName,B=new W(0,0);"None"===k?B=G(_,b):"Trim"===k?B=G(_=V("Horizontal"===c?T:N,_,b),b):_="",P=Math.max(P,B.height),A=Math.max(A,B.width),0<B.width&&0<B.height&&(s="Horizontal"===c?(a=y+T/2,"After"===D?f+N+B.height/2+10:f-10):(a="After"===D?y-B.width/2-10:y+T+B.width/2+10,f+N/2+B.height/4)),0===x&&(E="Horizontal"!==c&&"After"===D?a-B.width/2:y,M="Horizontal"!==c||"After"===D?f:s-B.height/2),x===L-1&&(m="Horizontal"===c?Math.abs(y+T-E):T+A+10,u="Horizontal"===c?N+P/2+10:Math.abs(f+N-M)),this.legendRenderingCollections.push({fill:this.legendCollections[x].legendFill,x:y,y:f,width:T,height:N,element:this.legendCollections[x].gradientElement,text:_,textX:a,textY:s,textWidth:B.width,textHeight:B.height,data:this.legendCollections[x].legendData})}this.legendItemRect={x:E,y:M,width:m,height:u}}}},S.prototype.getPageChanged=function(){this.page++,H.isNullOrUndefined(this.totalPages[this.page])&&(this.totalPages[this.page]={Page:this.page+1,Collection:[]})},S.prototype.findColorMappingLegendItems=function(e){var t=z(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])},S.prototype.findPaletteLegendItems=function(e){var t,i,l,o;if(!H.isNullOrUndefined(this.treemap.drilledItems)&&0===this.treemap.drilledItems.length&&!H.isNullOrUndefined(this.treemap.initialDrillDown.groupName)&&H.isNullOrUndefined(this.treemap.drilledLegendItems))for(var r=z(e).values,n=0;n<r.length;n++)if(r[n].Name===this.treemap.initialDrillDown.groupName){r[n].isDrilled=!r[n].isDrilled,e=r[n],this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex,l=0<this.treemap.palette.length?this.treemap.palette[n%this.treemap.palette.length]:r[n].data[this.treemap.colorValuePath];break}if((i=(this.treemap.enableDrillDown&&!H.isNullOrUndefined(this.treemap.drilledLegendItems)?(l=(t=this.treemap.drilledLegendItems).data.options.fill,t.data.isDrilled?z(t.data):z(t.data.parent)):z(e)).values)&&0<i.length){for(var a=0;a<i.length;a++)!H.isNullOrUndefined(i[a].data[this.treemap.legendSettings.showLegendPath])&&!i[a].data[this.treemap.legendSettings.showLegendPath]||(o=i[a].data[this.treemap.legendSettings.valuePath]||i[a].name,!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,o))||this.legendCollections.push({legendName:o,legendFill:0<this.treemap.palette.length?H.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[a%this.treemap.palette.length]:l:i[a].data[this.treemap.colorValuePath],legendData:[],itemArea:i[a].weight});if(this.legendCollections.sort(dt),0<this.treemap.palette.length)for(var s=0;s<this.legendCollections.length;s++)this.legendCollections[s].legendFill=H.isNullOrUndefined(this.treemap.currentLevel)?this.treemap.palette[s%this.treemap.palette.length]:l}},S.prototype.calculateLegendItems=function(e){var t,i,l,o,r,n,a=!1,s=this.treemap.leafItemSettings,h=this.treemap.levels,d=this.treemap.legendSettings.position,p=!1,g=0;this.outOfRangeLegend=null;for(var c=0;c<e.length;c++){i="",p=n=r=!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:h[y]).colorMapping,v=0;v<f.length;v++){var b=f[v];if(I=null,F=Number(u[this.treemap.rangeColorValuePath]),C=u[this.treemap.equalColorValuePath],b.value=H.isNullOrUndefined(b.value)?b.value:b.value.toString(),!H.isNullOrUndefined(b.from)&&!H.isNullOrUndefined(b.to)&&F>=b.from&&F<=b.to&&b.showLegend?(n=a=!0,o=b.from+" - "+b.to,l=H.isNullOrUndefined(b.label)?b.from+" - "+b.to:b.label,i=H.isNullOrUndefined(b.color)?i:b.color,t=this.isAddNewLegendData(o)):!H.isNullOrUndefined(b.value)&&C===b.value&&b.showLegend&&(r=a=!0,o=b.value.toString(),l=H.isNullOrUndefined(b.label)?b.value.toString():b.label,i=H.isNullOrUndefined(b.color)?i:"[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,t=this.isAddNewLegendData(o)),a&&H.isNullOrUndefined(b.value)&&b.maxOpacity&&b.minOpacity&&"Interactive"===this.treemap.legendSettings.mode){var S=[],p=!0;if("[object Array]"===Object.prototype.toString.call(b.color))for(var x=0;x<b.color.length;x++){var w={colorStop:(x*(100/(b.color.length-1))+"%").toString(),color:b.color[x]};S.push(w)}else{var w={colorStop:"0%",color:i},F={colorStop:"100%",color:i};S.push(w),S.push(F)}var C={id:"groupIndex_"+y+"_colorIndex_"+this.gradientCount,x1:"0%",y1:"0%",x2:"Top"===d||"Bottom"===d?"100%":"0%",y2:"Top"===d||"Bottom"===d?"0%":"100%"},I=this.treemap.renderer.drawGradient("linearGradient",C,S).childNodes[0];"[object Array]"!==Object.prototype.toString.call(b.color)&&(I.childNodes[0].setAttribute("stop-opacity",b.minOpacity.toString()),I.childNodes[1].setAttribute("stop-opacity",b.maxOpacity.toString())),this.defsElement.appendChild(I),this.gradientCount++}F=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,l),t&&t.process&&a&&!F?(a=!1,i="[object Array]"===Object.prototype.toString.call(b.color)&&H.isNullOrUndefined(I)&&H.isNullOrUndefined(b.value)?this.legendGradientColor(b,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:H.isNullOrUndefined(I)?H.isNullOrUndefined(b.value)?this.legendLinearGradient:null:I,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&&!F&&(a=!1,this.legendCollections[t.value].legendData.push(e[c])),n||p||r||H.isNullOrUndefined(b.from)&&H.isNullOrUndefined(b.to)&&H.isNullOrUndefined(b.minOpacity)&&H.isNullOrUndefined(b.maxOpacity)&&H.isNullOrUndefined(b.value)&&!H.isNullOrUndefined(b.color)&&(C="[object Array]"===Object.prototype.toString.call(b.color)?b.color[0]:b.color,I=H.isNullOrUndefined(b.label)?"Others":b.label,F=!!this.treemap.legendSettings.removeDuplicateLegend&&this.removeDuplicates(this.legendCollections,I),H.isNullOrUndefined(this.outOfRangeLegend)&&!F&&(this.legendCollections.push({actualValue:I,legendData:[],legendName:I,legendFill:C}),F=this.legendCollections.length,this.outOfRangeLegend=this.legendCollections[F-1],g++),this.legendCollections[this.legendCollections.length-1].legendData.push(e[c]))}}},S.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},S.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}},S.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,r=this.treemap.element.id+"_Legend_Index_"+l+"_Text",n=this.legendRenderingCollections[l],a=(a=n.element)?"url(#"+a.id+")":n.fill,s=new j(n.x,n.y,n.width,n.height),h=new m(n.textX,n.textY),o=new L(o,a,e.shapeBorder,e.opacity,s);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),h.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y+n.textHeight/2-Math.abs(this.legendBorderRect.y-h.y)):(o.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+o.width)-Math.abs(this.legendBorderRect.x-o.x),h.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-this.translate.x-Math.abs(this.legendBorderRect.x-h.x))),Ue(new T(r,h.x,h.y,"middle",n.text,"",""),i,i.color||this.treemap.themeStyle.legendTextColor,this.legendGroup),this.legendGroup.appendChild(t.drawRectangle(o))}gt(this.treemap,this.legendGroup)},S.prototype.defaultLegendRtlLocation=function(e,t,i,l){var o=e.Shape,r=e.Text,e=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),r.x=this.translate.x+this.legendBorderRect.x+this.legendBorderRect.width-(this.translate.x+e.width+t)-Math.abs(this.legendBorderRect.x-r.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,r.y=this.translate.y+this.legendBorderRect.y+this.legendBorderRect.height-this.translate.y-Math.abs(Math.abs(this.legendBorderRect.y)-r.y)),{shapeLocation:o,textLocation:r}},S.prototype.drawLegendItem=function(t){var h,d=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?H.isNullOrUndefined(c.fill)?"#000000":c.fill:e.color,v=y&&0===e.width?1:e.width,b=this,i=0;i<this.totalPages[t].Collection.length;i++)!function(e){var i=b.totalPages[t].Collection[e],l=i.DisplayText,o=u.createGroup({id:p.element.id+"_Legend_Index_"+e}),r=(o.setAttribute("aria-label",l+" Legend"),o.setAttribute("role","region"),p.element.id+"_Legend_Shape_Index_"+e),n=p.element.id+"_Legend_Text_Index_"+e,a=i.Shape,s=i.Text;p.enableRtl&&(h=b.defaultLegendRtlLocation(i,g,p,c),a=h.shapeLocation,s=h.textLocation),h={cancel:!1,name:ie,treemap:p,fill:i.Fill,shape:c.shape,imageUrl:c.imageUrl},p.trigger(ie,h,function(e){var t=new R(r,e.fill,v,y?i.Fill:f,c.opacity,"");o.appendChild(vt(a,e.shape,m,e.imageUrl,t)),Ue(new T(n,s.x,s.y,"start",l,"",""),c.textStyle,c.textStyle.color||p.themeStyle.legendTextColor,o),d.legendGroup.appendChild(o)})}(i);var l,o,r,n,a,s,S,x,w,F,C,e=void 0,I=g,O=g/2;0!==this.page&&(r=G(l=t+1+"/"+this.totalPages.length,o=c.textStyle),w=this.legendItemRect.x+this.legendItemRect.width-r.width-2*I-g,n=this.legendItemRect.x+this.legendItemRect.width,a=this.legendItemRect.y+this.legendItemRect.height+O/2+g,s=n-I-r.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"}),x=u.createGroup({id:p.element.id+"_Legend_Right_Paging_Group"}),C=" M "+n+" "+a+" L "+(n-I)+" "+(a-O)+" L "+(n-I)+" "+(a+O)+" z ",F=new R(p.element.id+"_Left_Page","#a6a6a6",0,"#a6a6a6",1,""," M "+w+" "+a+" L "+(w+I)+" "+(a-O)+" L "+(w+I)+" "+(a+O)+" z "),S.appendChild(u.drawPath(F)),F=new L(p.element.id+"_Left_Page_Rect","transparent",{},1,new j(w-I/2,a-2*O,2*I,2*g),""),S.appendChild(u.drawRectangle(F)),this.wireEvents(S),w=new R(p.element.id+"_Right_Page","#a6a6a6",0,"#a6a6a6",1,"",C),x.appendChild(u.drawPath(w)),F=new L(p.element.id+"_Right_Page_Rect","transparent",{},1,new j(n-I,a-O,I,g),""),x.appendChild(u.drawRectangle(F)),this.wireEvents(x),e.appendChild(S),e.appendChild(x),C={id:p.element.id+"_Paging_Text",x:s,y:a+r.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(C,l)),this.legendGroup.appendChild(e))}},S.prototype.renderLegendBorder=function(){var e=this.treemap,t=e.legendSettings,i=t.title.text,l=t.titleStyle,i=G(V(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)},S.prototype.renderLegendTitle=function(){var e=this.treemap.legendSettings,t=e.titleStyle,e=e.title.text,i=V(this.legendItemRect.width+20,e,t),l=G(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))},S.prototype.renderInteractivePointer=function(e){var t=this.treemap,i=e.target,l=t.element.id+"_Interactive_Legend",i=-1<e.type.indexOf("touch")?document.elementFromPoint(e.changedTouches[0].clientX,e.changedTouches[0].clientY):i,o=t.legendSettings;if(-1<i.id.indexOf("_Item_Index")&&o.visible&&0<this.legendRenderingCollections.length)for(var r=void 0,n=t.layout.renderItems[parseFloat(i.id.split("_Item_Index_")[1])],a=t.svgObject.getBoundingClientRect(),s=0;s<this.legendCollections.length;s++){var h=this.legendCollections[s],d=(r=document.getElementById(t.element.id+"_Legend_Index_"+s)).getBoundingClientRect(),p=new j(Math.abs(d.left-a.left),Math.abs(d.top-a.top),d.width,d.height),g=r.getAttribute("fill"),c=o.shapeBorder.color,m=o.shapeBorder.width;if(!H.isNullOrUndefined(h.legendData))for(var u=h.legendData,y=0;y<u.length;y++)if(u[y].levelOrderName===n.levelOrderName){this.drawInteractivePointer(o,g,c,l,m,p);break}}else this.removeInteractivePointer()},S.prototype.drawInteractivePointer=function(e,t,i,l,o,r){var n,a,e="Horizontal"===("None"===e.orientation?"Top"===e.position||"Bottom"===e.position?"Horizontal":"Vertical":e.orientation)?e.invertedPointer?" M "+(n=r.x+r.width/2)+" "+(a=r.y+r.height)+" L "+(n-10)+" "+(a+10)+" L "+(n+10)+" "+(a+10)+" Z ":" M "+(n=r.x+r.width/2)+" "+(a=r.y)+" L "+(n-10)+" "+(a-10)+" L "+(n+10)+" "+(a-10)+" Z ":e.invertedPointer?" M "+(n=r.x)+" "+(a=r.y+r.height/2)+" L "+(n-10)+" "+(a-10)+" L "+(n-10)+" "+(a+10)+" z ":" M "+(n=r.x+r.width)+" "+(a=r.y+r.height/2)+" L "+(n+10)+" "+(a-10)+" L "+(n+10)+" "+(a+10)+" z ",r=new R(l,t,o,i,1,"",e);this.treemap.svgObject.appendChild(this.treemap.renderer.drawPath(r))},S.prototype.getLegendAlignment=function(e,t,i,l){var o,r,n=H.extend({},e.areaRect,void 0,!0),a=n.x,s=n.y,h=n.height,d=n.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":n.height=h-i,o=p/2-t/2,r="Top"===c?s:s+n.height+10,n.y="Top"===c?s+i+10:s;break;case"Left":case"Right":n.width=d-t,o="Left"===c?a:a+n.width,r=g/2-i/2,n.x="Left"===c?a+t:a}switch(l.alignment){case"Near":"Top"===c||"Bottom"===c?o=n.x:r=n.y;break;case"Far":"Top"===c||"Bottom"===c?o=p-t:r=g-i}this.treemap.totalRect=n,this.translate=new m(o,r)}},S.prototype.mouseUpHandler=function(e){this.renderInteractivePointer(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeInteractivePointer.bind(this),3e3)},S.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)},S.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},S.prototype.wireEvents=function(e){H.EventHandler.add(e,H.Browser.touchStartEvent,this.changeNextPage,this)},S.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(H.Browser.touchMoveEvent,this.renderInteractivePointer,this),this.treemap.on(H.Browser.touchEndEvent,this.mouseUpHandler,this))},S.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(H.Browser.touchMoveEvent,this.renderInteractivePointer),this.treemap.off(H.Browser.touchEndEvent,this.mouseUpHandler))},S.prototype.getModuleName=function(){return"treeMapLegend"},S.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},S.prototype.legendGradientColor=function(e,t){var i="http://www.w3.org/2000/svg";if(!H.isNullOrUndefined(e.color)&&"[object Array]"===Object.prototype.toString.call(e.color)){var l=this.treemap.renderer.createDefs(),o=document.createElementNS(i,"linearGradient"),r=this.treemap.legendSettings.position,n="Top"===r||"Bottom"===r?"100":"0",r="Top"===r||"Bottom"===r?"0":"100";o.setAttribute("id","linear_"+t),o.setAttribute("x1","0%"),o.setAttribute("y1","0%"),o.setAttribute("x2",n+"%"),o.setAttribute("y2",r+"%");for(var a=0;a<e.color.length;a++){var s=100/(e.color.length-1),h=document.createElementNS(i,"stop");h.setAttribute("offset",a*s+"%"),h.setAttribute("stop-color",e.color[a]),h.setAttribute("stop-opacity",1..toString()),o.appendChild(h)}l.appendChild(o),this.legendLinearGradient=o;n="url(#linear_"+t+")";this.defsElement.appendChild(o),r=n}return r},S);function S(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()}At.prototype.mouseMove=function(e){var t,i,l=this.treemap,o=e.target.id,r=[],n=this.treemap.highlightSettings,a=[],e=this.treemap.treeMapSelectionModule;if(-1<o.indexOf("_Item_Index")&&(!e||this.treemap.selectionId!==o)){if(this.highLightId!==o){var s=document.getElementById(l.element.id+"_TreeMap_"+l.layoutType+"_Layout"),h=document.getElementsByClassName("treeMapSelection"),d=(m=this.treemap.layout.renderItems[parseFloat(o.split("_Item_Index_")[1])],void 0);if(this.treemap.legendSettings.visible&&(w=this.treemap.treeMapLegendModule.legendCollections,d=Ct(this.treemap.treeMapLegendModule.legendCollections.length,m,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+d):document.getElementById(this.treemap.element.id+"_Legend_Index_"+d),null===this.shapeElement||e&&this.shapeElement.getAttribute("id")===e.legendSelectId||e&&this.shapeElement===e.shapeElement?0<this.currentElement.length&&this.currentElement[this.currentElement.length-1].currentElement!==this.shapeElement&&(Ft(this.shapeHighlightCollection,this.currentElement,l),this.highLightId=""):(this.currentElement.push({currentElement:this.shapeElement}),E(this.shapeHighlightCollection),this.shapeHighlightCollection.push({legendEle:this.shapeElement,oldFill:w[d].legendFill,oldOpacity:w[d].opacity,oldBorderColor:w[d].borderColor,oldBorderWidth:w[d].borderWidth}),M(this.shapeElement,n.fill,n.opacity,n.border.color,n.border.width.toString()),this.target="highlight")),i=je(m,[],n.mode,l),!this.treemap.legendSettings.visible||!e||!this.shapeElement||this.shapeElement.getAttribute("id")!==e.legendSelectId)if(this.treemap.legendSettings.visible&&e&&this.shapeElement===e.shapeElement)t=!1;else{for(var p=0;p<s.childElementCount;p++){for(var g=s.childNodes[p],c=!0,m=l.layout.renderItems[parseFloat(g.id.split("_Item_Index_")[1])],u=0;u<h.length;u++)if(g.id===h[u].id){c=!1;break}-1<i.indexOf(m.levelOrderName)&&c&&(a.push(g),r.push(m))}N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",l);for(var y=0;y<a.length;y++)D((g=a[y]).childNodes[0],{border:n.border,fill:n.fill,opacity:n.opacity}),g.classList.add("treeMapHighLight"),this.highLightId=o;l.trigger(J,{cancel:!1,name:J,treemap:l,items:r,elements:a})}}}else if(-1<o.indexOf("_Legend_Shape")||-1<o.indexOf("_Legend_Index")){if(this.treemap.legendSettings.visible&&(!e||e.legendSelectId!==o)&&(!e||e.shapeSelectId!==o))for(var f,v=void 0,b=void 0,S=document.getElementById(o),d=("highlight"===this.shapeTarget&&wt(this.legendHighlightCollection),this.shapeTarget="highlight","Default"===this.treemap.legendSettings.mode?parseFloat(o.split("_Legend_Shape_Index_")[1]):parseFloat(o.split("_Legend_Index_")[1])),x=this.treemap.treeMapLegendModule.legendCollections[d].legendData.length,w=this.treemap.treeMapLegendModule.legendCollections,F=parseInt(o[o.length-1],10),p=0;p<x;p++)for(var C,u=0;u<this.treemap.layout.renderItems.length;u++)this.treemap.treeMapLegendModule.legendCollections[d].legendData[p].levelOrderName===this.treemap.layout.renderItems[u].levelOrderName&&(v=u,b=this.treemap.layout.renderItems[u].groupIndex,C=document.getElementById(this.treemap.element.id+"_Level_Index_"+b+"_Item_Index_"+v+"_RectPath"),0===p&&(this.legendHighlightCollection=[],It(this.legendHighlightCollection,F,u,S,C,this.treemap.layout.renderItems,w),f=this.legendHighlightCollection.length,this.legendHighlightCollection[f-1].ShapeCollection={Elements:[]}),M(S,n.fill,n.opacity,n.border.color,n.border.width.toString()),M(C,n.fill,n.opacity,n.border.color,n.border.width.toString()),f=this.legendHighlightCollection.length,this.legendHighlightCollection[f-1].ShapeCollection.Elements.push(C))}else e&&this.shapeElement&&this.shapeElement.getAttribute("id")===e.legendSelectId||(e?this.shapeElement!==e.shapeElement:this.treemap.legendSettings.visible)&&N(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",l),"highlight"!==this.shapeTarget&&"highlight"!==this.target||!this.treemap.legendSettings.visible||e&&this.shapeElement&&this.shapeElement.getAttribute("id")===e.legendSelectId||e&&this.shapeElement===e.shapeElement||(E(this.shapeHighlightCollection),this.shapeHighlightCollection=[]),"highlight"===this.shapeTarget&&this.treemap.legendSettings.visible&&wt(this.legendHighlightCollection),this.highLightId="",t=!1;return t},At.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(H.Browser.touchMoveEvent,this.mouseMove,this)},At.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(H.Browser.touchMoveEvent,this.mouseMove)},At.prototype.getModuleName=function(){return"treeMapHighlight"},At.prototype.destroy=function(){this.shapeElement=null,this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.removeEventListener(),this.treemap=null};var kt=At;function At(e){this.target="highlight",this.shapeTarget="highlight",this.shapeHighlightCollection=[],this.legendHighlightCollection=[],this.currentElement=[],this.treemap=e,this.addEventListener()}x.prototype.mouseDown=function(e){var t,i=e.target,l=this.treemap,o=(l.levelSelection=[],[]),r=i.id,n=i.innerHTML,a=[],s=l.selectionSettings,h=this.treemap.treeMapHighlightModule,d=l.element.id+"_TreeMap_"+l.layoutType+"_Layout";if(-1<r.indexOf("_Item_Index"))if(e.preventDefault(),this.treemap.selectionId!==r&&this.legendSelect){var p=document.getElementById(d),g=l.layout.renderItems[parseFloat(r.split("_Item_Index_")[1])],c=void 0;this.treemap.legendSettings.visible&&(this.shapeSelect=!1,e=this.treemap.treeMapLegendModule.legendCollections.length,b=this.treemap.treeMapLegendModule.legendCollections,this.shapeElement=void 0,E(this.shapeSelectionCollection),h&&(h.shapeTarget="selection",h.shapeHighlightCollection=[]),c=Ct(e,g,l),this.shapeElement="Default"===this.treemap.legendSettings.mode?document.getElementById(this.treemap.element.id+"_Legend_Shape_Index_"+c):document.getElementById(this.treemap.element.id+"_Legend_Index_"+c),null!==this.shapeElement)&&(this.shapeSelectId=this.shapeElement.getAttribute("id"),this.shapeSelectionCollection.push({legendEle:this.shapeElement,oldFill:b[c].legendFill,oldOpacity:b[c].opacity,oldBorderColor:b[c].borderColor,oldBorderWidth:b[c].borderWidth}),M(this.shapeElement,s.fill,s.opacity,s.border.color,s.border.width.toString()));for(var m=je(g,[],s.mode,l),u=0;u<p.childElementCount;u++)t=p.childNodes[u],g=l.layout.renderItems[parseFloat(t.id.split("_Item_Index_")[1])],-1<m.indexOf(g.levelOrderName)&&(a.push(t),l.levelSelection.push(t.id),o.push(g));N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId=r;for(var y=document.getElementsByClassName("treeMapHighLight"),f=0;f<a.length;f++){if(t=a[f],0<y.length)for(var v=0;v<y.length;v++)y[v].id===t.id&&y[v].classList.remove("treeMapHighLight"),D(t.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),t.classList.add("treeMapSelection");else D(t.childNodes[0],{border:s.border,fill:s.fill,opacity:s.opacity}),t.classList.add("treeMapSelection");l.trigger(X,{cancel:!1,name:X,treemap:l,items:o,elements:a,text:n,contentItemTemplate:n},function(e){e.contentItemTemplate!==n&&ke(r,i,e.contentItemTemplate)})}}else E(this.shapeSelectionCollection),this.shapeSelectionCollection=[],this.shapeElement=void 0,this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",l),this.treemap.selectionId="";else if(-1<r.indexOf("_Legend_Shape")||-1<r.indexOf("_Legend_Index")){var b=this.treemap.treeMapLegendModule.legendCollections;if(this.treemap.legendSettings.visible&&this.legendSelectId!==r&&this.shapeSelect)for(var S,x=void 0,w=void 0,F=(this.legendSelectId=r,this.legendSelect=!1,parseInt(r[r.length-1],10)),C=document.getElementById(r),c=(wt(this.legendSelectionCollection),h&&(h.shapeTarget="selection"),"Default"===this.treemap.legendSettings.mode?parseFloat(r.split("_Legend_Shape_Index_")[1]):parseFloat(r.split("_Legend_Index_")[1])),I=this.treemap.treeMapLegendModule.legendCollections[c].legendData.length,f=0;f<I;f++)for(var O,L=0;L<this.treemap.layout.renderItems.length;L++)this.treemap.treeMapLegendModule.legendCollections[c].legendData[f].levelOrderName===this.treemap.layout.renderItems[L].levelOrderName&&(x=L,w=this.treemap.layout.renderItems[L].groupIndex,O=document.getElementById(this.treemap.element.id+"_Level_Index_"+w+"_Item_Index_"+x+"_RectPath"),0===f&&(It(this.legendSelectionCollection,F,L,C,O,this.treemap.layout.renderItems,b),S=this.legendSelectionCollection.length,this.legendSelectionCollection[S-1].ShapeCollection={Elements:[]}),M(C,s.fill,s.opacity,s.border.color,s.border.width.toString()),M(O,s.fill,s.opacity,s.border.color,s.border.width.toString()),S=this.legendSelectionCollection.length,this.legendSelectionCollection[S-1].ShapeCollection.Elements.push(O));else wt(this.legendSelectionCollection),h&&(h.shapeTarget="highlight"),this.legendSelect=!0,this.legendSelectId=""}},x.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,r=[],n=void 0,a=[],t=(this.treemap.levelSelection=[],this.treemap.element.id+"_TreeMap_"+this.treemap.layoutType+"_Layout"),s=document.getElementById(t),h=je(i,[],o.mode,this.treemap),d=0;d<s.childElementCount;d++)n=s.childNodes[d],i=this.treemap.layout.renderItems[parseFloat(n.id.split("_Item_Index_")[1])],-1<h.indexOf(i.levelOrderName)&&(r.push(n),this.treemap.levelSelection.push(n.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,E(this.shapeSelectionCollection),g=Ct(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}),M(this.shapeElement,o.fill,o.opacity,o.border.color,o.border.width.toString()))}N(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<r.length;u++)if(n=r[u],0<m.length)for(var y=0;y<m.length;y++)m[y].id===n.id&&m[y].classList.remove("treeMapHighLight"),D(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection");else o.fill=("null"===o.fill?this.treemap.layout.renderItems[parseInt(n.id.split("Item_Index_")[1],10)].options:o).fill,D(n.childNodes[0],{border:o.border,fill:o.fill,opacity:o.opacity}),n.classList.add("treeMapSelection")}else E(this.shapeSelectionCollection),this.shapeElement=void 0,this.treemap.levelSelection=[],this.shapeSelect=!0,this.shapeSelectId="",this.treemap.legendId=[],N(document.getElementsByClassName("treeMapSelection"),"treeMapSelection",this.treemap),this.treemap.selectionId=""},x.prototype.addEventListener=function(){this.treemap.isDestroyed||this.treemap.on(H.Browser.touchStartEvent,this.mouseDown,this)},x.prototype.removeEventListener=function(){this.treemap.isDestroyed||this.treemap.off(H.Browser.touchStartEvent,this.mouseDown)},x.prototype.getModuleName=function(){return"treeMapSelection"},x.prototype.destroy=function(){this.shapeElement=null,this.shapeSelectionCollection=[],this.legendSelectionCollection=[],this.removeEventListener(),this.treemap=null};var Ht=x;function x(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=(w.prototype.renderTooltip=function(e){var t,i,l,o,r,n,a=this,s=(t=(-1!==e.type.indexOf("touch")?(this.isTouch=!0,r=e.changedTouches[0].pageX,e.changedTouches[0]):(this.isTouch="touch"===e.pointerType,r=e.pageX,e)).pageY,e.target),h=s.id,d={},p=[];-1<h.indexOf("_Item_Index")?(d=this.treemap.layout.renderItems[parseFloat(h.split("_Item_Index_")[1])],H.isNullOrUndefined(d)||(h=d.weight,l=d.data,H.isNullOrUndefined(d.options)||(o=d.options.fill),p=this.treemap.enableRtl?[(H.isNullOrUndefined(this.tooltipSettings.format)?null:ct(this.tooltipSettings.format,l,this.treemap))||mt(h,this.treemap)+" : "+this.treemap.weightValuePath.toString()]:[(H.isNullOrUndefined(this.tooltipSettings.format)?null:ct(this.tooltipSettings.format,l,this.treemap))||this.treemap.weightValuePath.toString()+" : "+mt(h,this.treemap)],document.getElementById(this.tooltipId)?i=document.getElementById(this.tooltipId):((i=H.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(i)),(h=$e(r,t,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=H.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,r={width:this.tooltipSettings.border.width||this.treemap.themeStyle.tooltipBorderWidth||0,color:this.tooltipSettings.border.color||this.treemap.themeStyle.tooltipBorderColor||"transparent"},n={cancel:!1,name:Y,item:d,options:{location:h,text:p,data:l,border:r,textStyle:this.tooltipSettings.textStyle,template:this.tooltipSettings.template},treemap:this.treemap,element:s,eventArgs:e},this.treemap.trigger(Y,n,function(e){a.addTooltip(n,o,i)}))):(this.removeTooltip(),this.treemap.clearTemplate())},w.prototype.addTooltip=function(e,t,i,l){var o;l=H.isNullOrUndefined(e)?(o=l.cancel,l):(o=e.cancel,Wt(e,["cancel"]).options),o?(this.removeTooltip(),this.treemap.clearTemplate()):(this.svgTooltip=new F.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())},w.prototype.mouseUpHandler=function(e){this.renderTooltip(e),clearTimeout(this.clearTimeout),this.clearTimeout=setTimeout(this.removeTooltip.bind(this),2e3)},w.prototype.removeTooltip=function(){var e;0<document.getElementsByClassName("EJ2-TreeMap-Tooltip").length&&(e=document.getElementsByClassName("EJ2-TreeMap-Tooltip")[0]).parentNode.removeChild(e)},w.prototype.addEventListener=function(){this.treemap.isDestroyed||(this.treemap.on(H.Browser.touchMoveEvent,this.renderTooltip,this),this.treemap.on(H.Browser.touchEndEvent,this.mouseUpHandler,this))},w.prototype.removeEventListener=function(){this.treemap.isDestroyed||(this.treemap.off(H.Browser.touchMoveEvent,this.renderTooltip),this.treemap.off(H.Browser.touchEndEvent,this.mouseUpHandler))},w.prototype.getModuleName=function(){return"treeMapTooltip"},w.prototype.destroy=function(){H.isNullOrUndefined(this.svgTooltip)||this.svgTooltip.destroy(),this.svgTooltip=null,this.tooltipSettings=null,this.removeEventListener(),this.treemap=null},w);function w(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=ut,e.CommonTitleSettings=pe,e.Font=r,e.HighlightSettings=Pe,e.ImageExport=Mt,e.InitialDrillSettings=Ce,e.LayoutPanel=Tt,e.LeafItemSettings=Le,e.LegendSettings=we,e.LevelSettings=t,e.LevelsData=Ut,e.Location=m,e.Margin=se,e.PathOption=R,e.PdfExport=_t,e.Print=Dt,e.Rect=j,e.RectOption=L,e.SelectionSettings=Ee,e.Size=W,e.SubTitleSettings=me,e.TextOption=T,e.TitleSettings=fe,e.TooltipSettings=Ne,e.TreeMap=i,e.TreeMapAjax=xt,e.TreeMapHighlight=kt,e.TreeMapLegend=v,e.TreeMapSelection=Ht,e.TreeMapTooltip=jt,e.applyOptions=D,e.beforePrint=U,e.click=$,e.colorCollections=tt,e.colorMap=Ke,e.colorNameToHex=y,e.componentToHex=u,e.convertElement=Ve,e.convertHexToColor=ft,e.convertToContainer=Ze,e.convertToHexCode=yt,e.convertToRect=Qe,e.createTextStyle=ze,e.deSaturationColor=et,e.defaultFont=re,e.doubleClick=K,e.drawSymbol=vt,e.drillEnd=q,e.drillStart=A,e.findChildren=z,e.findHightLightItems=je,e.findLabelLocation=qe,e.findPosition=Re,e.formatValue=mt,e.getArea=Je,e.getColorByValue=lt,e.getElement=Ae,e.getGradientColor=ot,e.getLegendIndex=Ct,e.getMousePosition=$e,e.getPercentage=nt,e.getPercentageColor=rt,e.getShortestEdge=Ye,e.getTemplateFunction=Ge,e.getThemeStyle=Nt,e.hide=ht,e.isContainsData=We,e.isParentItem=St,e.itemClick=Z,e.itemHighlight=J,e.itemMove=Q,e.itemRendering=k,e.itemSelected=X,e.itemsToOrder=He,e.legendItemRendering=ie,e.legendMaintain=gt,e.legendRendering=le,e.load=_,e.loaded=B,e.maintainSelection=pt,e.measureElement=Xe,e.measureText=G,e.mouseMove=te,e.orderByArea=dt,e.pushCollection=It,e.removeClassNames=N,e.removeElement=Lt,e.removeLegend=wt,e.removeSelectionWithHighlight=Ft,e.removeShape=E,e.renderLegendShape=bt,e.renderTextElement=Ue,e.resize=oe,e.rgbToHex=it,e.rightClick=ee,e.setColor=M,e.setItemTemplateContent=ke,e.stringToNumber=Be,e.textFormatter=ct,e.textTrim=V,e.textWrap=st,e.tooltipRendering=Y,e.triggerDownload=Ot,e.wordWrap=at,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
11
11
|
//# sourceMappingURL=ej2-treemap.umd.min.js.map
|