@syncfusion/ej2-treemap
Version:
Essential JS 2 TreeMap Components
10 lines • 134 kB
JavaScript
/*!
* filename: ej2-treemap.umd.min.js
* version : 31.1.17
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-svg-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2SvgBase,e.ej2Data,e.ej2PdfExport)}(this,function(e,A,C,F,w){"use strict";var O,M,N="load",_="loaded",E="beforePrint",U="itemRendering",k="drillStart",q="drillEnd",X="itemSelected",J="itemHighlight",Y="tooltipRendering",Z="itemClick",Q="itemMove",$="click",K="doubleClick",ee="rightClick",te="mouseMove",ie="legendItemRendering",le="legendRendering",oe="resize",ne="Roboto, Segoe UI, Noto, Sans-serif",t=(O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),i=function(e,t,i,l){var o,n=arguments.length,r=n<3?t:null===l?l=Object.getOwnPropertyDescriptor(t,i):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,l);else for(var a=e.length-1;0<=a;a--)(o=e[a])&&(r=(n<3?o(r):3<n?o(t,i,r):o(t,i))||r);return 3<n&&r&&Object.defineProperty(t,i,r),r},l=(M=A.ChildProperty,t(re,M),i([A.Property("#808080")],re.prototype,"color",void 0),i([A.Property(0)],re.prototype,"width",void 0),re);function re(){return null!==M&&M.apply(this,arguments)||this}ae=A.ChildProperty,t(o,ae),i([A.Property(10)],o.prototype,"left",void 0),i([A.Property(10)],o.prototype,"right",void 0),i([A.Property(10)],o.prototype,"top",void 0),i([A.Property(10)],o.prototype,"bottom",void 0);var ae,se=o;function o(){return null!==ae&&ae.apply(this,arguments)||this}de=A.ChildProperty,t(r,de),i([A.Property(null)],r.prototype,"size",void 0),i([A.Property(null)],r.prototype,"color",void 0),i([A.Property(ne)],r.prototype,"fontFamily",void 0),i([A.Property("")],r.prototype,"fontWeight",void 0),i([A.Property("Normal")],r.prototype,"fontStyle",void 0),i([A.Property(1)],r.prototype,"opacity",void 0);var de,n=r;function r(){return null!==de&&de.apply(this,arguments)||this}he=A.ChildProperty,t(ge,he),i([A.Property("")],ge.prototype,"text",void 0),i([A.Property("")],ge.prototype,"description",void 0);var he,pe=ge;function ge(){return null!==he&&he.apply(this,arguments)||this}t(ue,ce=pe),i([A.Complex({fontFamily:null,fontWeight:null},n)],ue.prototype,"textStyle",void 0),i([A.Property("Center")],ue.prototype,"alignment",void 0);var ce,me=ue;function ue(){return null!==ce&&ce.apply(this,arguments)||this}t(ve,ye=pe),i([A.Complex({fontFamily:null,fontWeight:null},n)],ve.prototype,"textStyle",void 0),i([A.Property("Center")],ve.prototype,"alignment",void 0),i([A.Complex({},me)],ve.prototype,"subtitleSettings",void 0);var ye,fe=ve;function ve(){return null!==ye&&ye.apply(this,arguments)||this}xe=A.ChildProperty,t(a,xe),i([A.Property(null)],a.prototype,"from",void 0),i([A.Property(null)],a.prototype,"to",void 0),i([A.Property(null)],a.prototype,"color",void 0),i([A.Property(null)],a.prototype,"label",void 0),i([A.Property(null)],a.prototype,"value",void 0),i([A.Property(null)],a.prototype,"minOpacity",void 0),i([A.Property(null)],a.prototype,"maxOpacity",void 0),i([A.Property(!0)],a.prototype,"showLegend",void 0);var xe,Se=a;function a(){return null!==xe&&xe.apply(this,arguments)||this}be=A.ChildProperty,t(s,be),i([A.Property(!1)],s.prototype,"visible",void 0),i([A.Property("Default")],s.prototype,"mode",void 0),i([A.Property("transparent")],s.prototype,"background",void 0),i([A.Property("Circle")],s.prototype,"shape",void 0),i([A.Property("")],s.prototype,"width",void 0),i([A.Property("")],s.prototype,"height",void 0),i([A.Complex({size:null,fontFamily:null,fontWeight:null},n)],s.prototype,"textStyle",void 0),i([A.Property(null)],s.prototype,"fill",void 0),i([A.Property(1)],s.prototype,"opacity",void 0),i([A.Property(15)],s.prototype,"shapeWidth",void 0),i([A.Property(15)],s.prototype,"shapeHeight",void 0),i([A.Property(10)],s.prototype,"shapePadding",void 0),i([A.Property(null)],s.prototype,"imageUrl",void 0),i([A.Complex({color:null,width:null},l)],s.prototype,"border",void 0),i([A.Complex({color:"#000000",width:0},l)],s.prototype,"shapeBorder",void 0),i([A.Complex({},pe)],s.prototype,"title",void 0),i([A.Complex({size:null,fontFamily:null,fontWeight:null},n)],s.prototype,"titleStyle",void 0),i([A.Property("Bottom")],s.prototype,"position",void 0),i([A.Property("None")],s.prototype,"orientation",void 0),i([A.Property(!1)],s.prototype,"invertedPointer",void 0),i([A.Property("After")],s.prototype,"labelPosition",void 0),i([A.Property("None")],s.prototype,"labelDisplayMode",void 0),i([A.Property("Center")],s.prototype,"alignment",void 0),i([A.Property({x:0,y:0})],s.prototype,"location",void 0),i([A.Property(null)],s.prototype,"showLegendPath",void 0),i([A.Property(null)],s.prototype,"valuePath",void 0),i([A.Property(!1)],s.prototype,"removeDuplicateLegend",void 0);var be,Ie=s;function s(){return null!==be&&be.apply(this,arguments)||this}Ce=A.ChildProperty,t(we,Ce),i([A.Property(null)],we.prototype,"groupIndex",void 0),i([A.Property(null)],we.prototype,"groupName",void 0);var Ce,Fe=we;function we(){return null!==Ce&&Ce.apply(this,arguments)||this}Oe=A.ChildProperty,t(d,Oe),i([A.Property(null)],d.prototype,"fill",void 0),i([A.Property(!1)],d.prototype,"autoFill",void 0),i([A.Complex({},l)],d.prototype,"border",void 0),i([A.Property(0)],d.prototype,"gap",void 0),i([A.Property(10)],d.prototype,"padding",void 0),i([A.Property(1)],d.prototype,"opacity",void 0),i([A.Property(!0)],d.prototype,"showLabels",void 0),i([A.Property(null)],d.prototype,"labelPath",void 0),i([A.Property(null)],d.prototype,"labelFormat",void 0),i([A.Property("TopLeft")],d.prototype,"labelPosition",void 0),i([A.Complex({color:null,size:null,fontFamily:null},n)],d.prototype,"labelStyle",void 0),i([A.Property(null)],d.prototype,"labelTemplate",void 0),i([A.Property("Center")],d.prototype,"templatePosition",void 0),i([A.Property("Trim")],d.prototype,"interSectAction",void 0),i([A.Collection([],Se)],d.prototype,"colorMapping",void 0);var Oe,Le=d;function d(){return null!==Oe&&Oe.apply(this,arguments)||this}Te=A.ChildProperty,t(h,Te),i([A.Property(!1)],h.prototype,"visible",void 0),i([A.Property("")],h.prototype,"template",void 0),i([A.Property(null)],h.prototype,"format",void 0),i([A.Property(null)],h.prototype,"fill",void 0),i([A.Property(.75)],h.prototype,"opacity",void 0),i([A.Property(["Circle"])],h.prototype,"markerShapes",void 0),i([A.Complex({width:null,color:null},l)],h.prototype,"border",void 0),i([A.Complex({fontFamily:null,size:null,fontWeight:null,opacity:null},n)],h.prototype,"textStyle",void 0);var Te,Me=h;function h(){return null!==Te&&Te.apply(this,arguments)||this}Ne=A.ChildProperty,t(p,Ne),i([A.Property(!1)],p.prototype,"enable",void 0),i([A.Property(null)],p.prototype,"fill",void 0),i([A.Property("0.5")],p.prototype,"opacity",void 0),i([A.Complex({},l)],p.prototype,"border",void 0),i([A.Property("Item")],p.prototype,"mode",void 0);var Ne,_e=p;function p(){return null!==Ne&&Ne.apply(this,arguments)||this}Ee=A.ChildProperty,t(g,Ee),i([A.Property(!1)],g.prototype,"enable",void 0),i([A.Property("#808080")],g.prototype,"fill",void 0),i([A.Property("0.5")],g.prototype,"opacity",void 0),i([A.Complex({},l)],g.prototype,"border",void 0),i([A.Property("Item")],g.prototype,"mode",void 0);var Ee,De=g;function g(){return null!==Ee&&Ee.apply(this,arguments)||this}Pe=A.ChildProperty,t(c,Pe),i([A.Property(null)],c.prototype,"groupPath",void 0),i([A.Property(0)],c.prototype,"groupGap",void 0),i([A.Property(10)],c.prototype,"groupPadding",void 0),i([A.Complex({},l)],c.prototype,"border",void 0),i([A.Property(null)],c.prototype,"fill",void 0),i([A.Property(!1)],c.prototype,"autoFill",void 0),i([A.Property(1)],c.prototype,"opacity",void 0),i([A.Property(!0)],c.prototype,"showHeader",void 0),i([A.Property(20)],c.prototype,"headerHeight",void 0),i([A.Property(null)],c.prototype,"headerTemplate",void 0),i([A.Property(null)],c.prototype,"headerFormat",void 0),i([A.Property("Near")],c.prototype,"headerAlignment",void 0),i([A.Complex({color:null,size:"13px",fontFamily:null},n)],c.prototype,"headerStyle",void 0),i([A.Property("TopLeft")],c.prototype,"templatePosition",void 0),i([A.Collection([],Se)],c.prototype,"colorMapping",void 0);var Pe,t=c;function c(){return null!==Pe&&Pe.apply(this,arguments)||this}var W=function(e,t){this.width=e,this.height=t};function Be(e,t){return null!=e?-1!==e.indexOf("%")?t/100*parseInt(e,10):parseInt(e,10):null}var j=function(e,t,i,l){this.x=e,this.y=t,this.width=i,this.height=l},L=function(e,t,i,l,o,n){this.y=o.y,this.x=o.x,this.height=o.height,this.width=o.width,this.id=e,this.fill=t,this.opacity=l,this.stroke=i.color,this["stroke-width"]=i.width,this["stroke-dasharray"]=n},z=function(e,t,i,l,o,n,r){this.id=e,this.opacity=o,this.fill=t,this.stroke=l,this["stroke-width"]=i,this["stroke-dasharray"]=n,this.d=r};function V(e,t){var i=document.getElementById("treeMapMeasureText");return null===i&&(i=A.createElement("text",{id:"treeMapMeasureText"}),document.body.appendChild(i)),i.innerHTML=A.SanitizeHtmlHelper.sanitize(e),i.style.position="absolute",i.style.fontSize=t.size,i.style.fontWeight=t.fontWeight,i.style.fontStyle=t.fontStyle,i.style.fontFamily=t.fontFamily,i.style.visibility="hidden",i.style.top="-100",i.style.left="0",i.style.whiteSpace="nowrap",i.style.lineHeight="normal",new W(i.clientWidth,i.clientHeight)}var T=function(e,t,i,l,o,n,r,a){void 0===n&&(n=""),this.transform="",this.baseLine="auto",this.id=e,this.text=o,this.transform=n,this.anchor=l,this.x=t,this.y=i,this.baseLine=r,this.connectorText=a};function G(e,t,i){var l=t;if(e<V(t,i).width)for(var o=t.length-1;0<=o;--o)if(V(l=t.substring(0,o)+"...",i).width<=e||l.length<4)return l=l.length<4?" ":l;return l}var ze=function(e,t){this.x=e,this.y=t};function He(e,t,i,l){var o;switch(t){case"Near":o=e.x;break;case"Center":o="title"===l?e.width/2-i.width/2:e.x+e.width/2-i.width/2;break;case"Far":o="title"===l?e.width-e.y-i.width:e.x+e.width-i.width}t="title"===l?e.y+i.height/2:e.y+e.height/2+i.height/2;return new ze(o,t)}function Re(e,t,i){e=e.createText(t,i);return e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.style["user-select"]="none",e.style["-moz-user-select"]="none",e.style["-webkit-touch-callout"]="none",e.style["-webkit-user-select"]="none",e.style["-khtml-user-select"]="none",e.style["-ms-user-select"]="none",e.style["-o-user-select"]="none",e}function Ue(e,t,i,l,o){void 0===o&&(o=!1);var n,r,a={"font-size":t.size,"font-style":t.fontStyle,"font-family":t.fontFamily,"font-weight":t.fontWeight,"text-anchor":e.anchor,transform:e.transform,opacity:t.opacity,"dominant-baseline":e.baseLine,id:e.id,x:e.x,y:e.y,fill:i},i="string"==typeof e.text?e.text:o?e.text[e.text.length-1]:e.text[0],s=new C.SvgRenderer("");if(!A.isNullOrUndefined(i)&&!A.isNullOrUndefined(e.connectorText)&&i.includes(e.connectorText[1]))for(var d=i.split("#"),h=0;h<d.length;h++){var p=-1===d[h].search(e.connectorText)||A.isNullOrUndefined(e.connectorText)?d[h]:e.connectorText,p=(a.id=e.id+"_"+h,r=Re(s,a,p),h%2==0&&0!==h&&(p=p.replace(/\s+/g," ")),V(p,t));a.x=0!==h?a.x+p.width:a.x+p.width+5,l.appendChild(r)}else r=Re(s,a,i),l.appendChild(r);if("string"!=typeof e.text&&1<e.text.length){for(var g=1,c=e.text.length;g<c;g++)n=V(e.text[g],t).height,n=s.createTSpan({x:e.x,id:e.id,y:e.y+g*n},e.text[g]),r.appendChild(n);l.appendChild(r)}return r}function ke(e,t,i){var l=e.split("_RectPath")[0],e=-1<e.indexOf("_LabelTemplate")?t:document.querySelector("#"+l+"_LabelTemplate");A.isNullOrUndefined(e)||(e.innerHTML=i)}function Ae(e){return document.getElementById(e)}function We(e,t){return e.weight===t.weight?0:e.weight<t.weight?1:-1}function je(e,t,i,l){for(var o=!1,n="",r=l.leafItemSettings,a=0;a<e.length;a++){var s=i[l.levels[a]?l.levels[a].groupPath:r.labelPath||l.weightValuePath]||"undefined";if(e[a]===s&&(n+=s+(a===e.length-1?"":"#"))===t){o=!0;break}}return o}function H(e){if(e)for(var t=Object.keys(e),i={},l=0;l<t.length;l++)if(e[t[l]]instanceof Array){i.values=e[t[l]],i.key=t[l];break}return i}function Ve(e,t,i,l){if("Child"===i){t.push(e.levelOrderName);var o=H(e).values;if(o&&0<o.length){for(var n=0;n<o.length;n++)-1===t.indexOf(o[n].levelOrderName)&&t.push(o[n].levelOrderName);for(var r=0;r<o.length;r++)Ve(o[r],t,i,l)}}else if("Parent"===i)"string"==typeof e.levelOrderName&&-1===t.indexOf(e.levelOrderName)&&(t.push(e.levelOrderName),Ve(e.parent,t,i,l));else if("All"===i)for(var a=e.levelOrderName.split("#")[0],s=void 0,n=0;n<l.layout.renderItems.length;n++)-1<(s=l.layout.renderItems[n]).levelOrderName.indexOf(a)&&-1===t.indexOf(s.levelOrderName)&&t.push(s.levelOrderName);else t.push(e.levelOrderName);return t}function Ge(t){var i=null;try{i="function"!=typeof t&&document.querySelectorAll(t).length?A.compile(document.querySelector(t).innerHTML.trim()):A.compile(t)}catch(e){i=A.compile(t)}return i}function qe(e,t,i){for(var l=A.createElement("div",{id:t}),o=(l.style.cssText="position: absolute;pointer-events: auto;",e.length);0<o;)l.appendChild(e[0]),o--;for(var n=l.innerHTML,r=Object.keys(i),a=0;a<r.length;a++)var s=RegExp,n=n.replace(new s("{{:"+r[a]+"}}","g"),i[r[a].toString()]);return l.innerHTML=n,l}function Xe(e,t,i,l,o){var n=new ze(0,0),r="Template"===l?o.areaRect.x:0,a="Template"===l?o.areaRect.y:0;return n.x=Math.abs(r-(-1<t.indexOf("Left")?e.x+5:-1<t.indexOf("Right")?e.x+e.width-i.width:e.x+(e.width/2-i.width/2)))-2,!o.enableDrillDown||"BottomLeftTopRight"!==o.renderDirection&&"BottomRightTopLeft"!==o.renderDirection?n.y=Math.abs(a-(-1<t.indexOf("Top")?"Template"===l?e.y:e.y+i.height:-1<t.indexOf("Bottom")?e.y+e.height-i.height:"Template"===l?e.y+(e.height/2-i.height/2):e.y+e.height/2+i.height/4)):n.y=Math.abs(e.y+e.height-i.height+5),n}function Je(e,t){var i=new W(0,0),t=(t.appendChild(e),i.height=e.offsetHeight,i.width=e.offsetWidth,document.getElementById(e.id));return t.parentNode.removeChild(t),i}function Ye(e){return(e.width-e.x)*(e.height-e.y)}function Ze(e){var e=Qe(e),t=e.width,e=e.height;return Math.min(t,e)}function Qe(e){var t=e.x,i=e.y;return{x:t,y:i,width:e.width-t,height:e.height-i}}function $e(e){var t=e.x,i=e.y;return{x:t,y:i,width:t+e.width,height:i+e.height}}function Ke(e,t,i){var l=i.getBoundingClientRect(),o=i.ownerDocument.defaultView.pageXOffset,n=i.ownerDocument.defaultView.pageYOffset,r=i.ownerDocument.documentElement.clientTop,i=i.ownerDocument.documentElement.clientLeft,o=l.left+o-i,i=l.top+n-r;return new ze(e-o,t-i)}function et(e,t,i){var l,o,n=[];if(A.isNullOrUndefined(t)&&A.isNullOrUndefined(i)&&isNaN(i))return null;for(var r=0;r<e.length;r++){var a=!1,s=i;A.isNullOrUndefined(e[r].from)||A.isNullOrUndefined(e[r].to)||A.isNullOrUndefined(e[r].value)?(A.isNullOrUndefined(e[r].from)||A.isNullOrUndefined(e[r].to))&&A.isNullOrUndefined(e[r].value)||(i>=e[r].from&&e[r].to>=i||e[r].value===t)&&(e[r].value===t&&(a=!0),l="[object Array]"===Object.prototype.toString.call(e[r].color)?a?e[r].color[0]:it(e[r],s):e[r].color):i>=e[r].from&&e[r].to>=i&&e[r].value===t&&(a=!0,l="[object Array]"===Object.prototype.toString.call(e[r].color)?a?e[r].color[0]:it(e[r],s):e[r].color),(i>=e[r].from&&i<=e[r].to||e[r].value===t)&&!A.isNullOrUndefined(e[r].minOpacity)&&!A.isNullOrUndefined(e[r].maxOpacity)&&l&&(o=tt(e[r],i)),(""===l||A.isNullOrUndefined(l))&&A.isNullOrUndefined(e[r].from)&&A.isNullOrUndefined(e[r].to)&&A.isNullOrUndefined(e[r].minOpacity)&&A.isNullOrUndefined(e[r].maxOpacity)&&A.isNullOrUndefined(e[r].value)&&(l="[object Array]"===Object.prototype.toString.call(e[r].color)?e[r].color[0]:e[r].color),o=A.isNullOrUndefined(o)?"1":o,n.push(l)}for(var d=n.length-1;0<=d;d--)d=(l=n[d])?-1:d;return{fill:l,opacity:o}}function tt(e,t){var i=1;return(i=t>=e.from&&t<=e.to?(t-e.from)/(e.to-e.from)*(e.maxOpacity-e.minOpacity)+e.minOpacity:i).toString()}function it(e,t){return ot(e,t)}function lt(e,t,i){return"#"+m(e)+m(t)+m(i)}function ot(e,t){return Number(t)===e.from?e.color[0]:Number(t)===e.to?e.color[e.color.length-1]:lt((t=nt(Number(t),e)).r,t.g,t.b)}function nt(e,t){var i=t.from,l=t.to,o=0,n=l-i,o=(e-i)/n;if(t.color.length<=2)a="#"===t.color[0].charAt(0)?t.color[0]:u(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:u(t.color[t.color.length-1]);else{for(var r,a="#"===t.color[0].charAt(0)?t.color[0]:u(t.color[0]),s="#"===t.color[t.color.length-1].charAt(0)?t.color[t.color.length-1]:u(t.color[t.color.length-1]),d=n/(t.color.length-1),h=t.color.length-1,p=[],g=1;g<h;g++)r={b:i+g*d,color:t.color[g]},p.push(r);for(var c=0;c<p.length;c++)i<=e&&e<=p[c].b&&0===c?(s="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/d):(e-p[c].b)/d):p[c].b<=e&&e<=l&&c===p.length-1&&(a="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),o=e<p[c].b?1-Math.abs((e-p[c].b)/d):(e-p[c].b)/d),c!==p.length-1&&c<p.length&&p[c].b<=e&&e<=p[c+1].b&&(a="#"===p[c].color.charAt(0)?p[c].color:u(p[c].color),s="#"===p[c+1].color.charAt(0)?p[c+1].color:u(p[c+1].color),o=Math.abs(e-p[c+1].b)/d)}return rt(o,a,s)}function rt(e,t,i){var i=i.split("#")[1],t=t.split("#")[1],l=at(e,parseInt(t.substr(0,2),16),parseInt(i.substr(0,2),16)),o=at(e,parseInt(t.substr(2,2),16),parseInt(i.substr(2,2),16)),e=at(e,parseInt(t.substr(4,2),16),parseInt(i.substr(4,2),16));return new yt(l,o,e)}function at(e,t,i){return Math.round(t+(i-t)*e)}function st(e,t,i){for(var l,o=t.split(" "),n="",r=[],a=0,s=o.length;a<s;a++)l=o[a],V(n.concat(l),i).width<e?n=n.concat((""===n?"":" ")+l):""!==n?(r.push(G(e,n,i)),n=l):r.push(G(e,l,i)),n&&a===s-1&&r.push(G(e,n,i));return r}function dt(e,t,i){var l=[],o=0,n=V(t,i).width,r=t.length;if(n<=e)l.push(t);else for(var a=t.length;o<a;a--){var s=t.slice(o,a);if(V(s,i).width<=e){if(l.push(s),r===(o+=s.length))return l;a=r+1}}return l}function ht(e,t,i,l){l=V(i,l);return l.width>e||l.height>t?" ":i}function pt(e,t){return e.itemArea===t.itemArea?0:e.itemArea<t.itemArea?1:-1}function gt(e,t,i){var l=e.levelSelection;if(l)for(var o=0;o<l.length;o++)t.getAttribute("id")===l[o]||t.children[0].id===l[o]?0<t.childElementCount&&-1===t.children[0].id.indexOf("_Group")&&(t.children[0].setAttribute("class",i),P(t.childNodes[0],{border:e.selectionSettings.border,fill:e.selectionSettings.fill,opacity:e.selectionSettings.opacity})):t.setAttribute("class","")}function ct(e,t){var i=e.legendId;if(i)for(var l=0;l<i.length;l++)if("Interactive"===e.legendSettings.mode)for(var o,n=0;n<t.childElementCount;n++)t.childNodes[n].id!==i[l]&&parseFloat(t.childNodes[n].id.split("Index_")[1])!==parseFloat(i[l].split("Index_")[1])||((o=t.childNodes[n]).setAttribute("fill",e.selectionSettings.fill),o.setAttribute("opacity",e.selectionSettings.opacity),-1===o.id.indexOf("Text")?(o.setAttribute("stroke-width",e.selectionSettings.border.width.toString()),o.setAttribute("stroke",e.selectionSettings.border.color)):(o.setAttribute("stroke",null),o.setAttribute("stroke-width",null)));else{var r=document.getElementById(i[l]);A.isNullOrUndefined(r)||(r.setAttribute("fill",e.selectionSettings.fill),r.setAttribute("opacity",e.selectionSettings.opacity),-1===r.id.indexOf("Text")?(r.setAttribute("stroke",e.selectionSettings.border.color),r.setAttribute("stroke-width",e.selectionSettings.border.width.toString())):(r.setAttribute("stroke",null),r.setAttribute("stroke-width",null)))}}function D(e,t,i){for(var l,o,n=0;n<e.length;n++)l=A.isNullOrUndefined(e[n].childNodes[0])?e[n]:e[n].childNodes[0],o=i.layout.renderItems[parseFloat(l.id.split("_Item_Index_")[1])].options,P(l,o),e[n].classList.remove(t),--n}function P(e,t){e.setAttribute("opacity",t.opacity),A.isNullOrUndefined(t.fill)?e.setAttribute("fill","black"):e.setAttribute("fill",t.fill),e.setAttribute("stroke",t.border.color),e.setAttribute("stroke-width",t.border.width)}function mt(e,t,i){if(A.isNullOrUndefined(e))return null;for(var l=0,o=Object.keys(t);l<o.length;l++){var n=o[l];e=e.split("${"+n+"}").join(ut(t[n],i).toString())}return e}function ut(e,t){t=t.format&&!isNaN(Number(e))?t.intl.getNumberFormat({format:t.format,useGrouping:t.useGroupingSeparator})(Number(e)):e;return t||""}var yt=function(e,t,i){this.r=e,this.g=t,this.b=i};function ft(e){return"#"+m(e.r)+m(e.g)+m(e.b)}function m(e){e=e.toString(16);return 1===e.length?"0"+e:e}function vt(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?new yt(parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)):new yt(255,255,255)}function u(e){e="transparent"===e?"white":e;var t=document.getElementById("treeMapMeasureText"),t=(t.style.color=e,(e=window.getComputedStyle(t).color).replace(/[()RGBrgba ]/g,"").split(","));return ft(new yt(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)))}function xt(e,t,i,l,o){var n=new C.SvgRenderer(""),e=St(e,i,t,o,l);return n["draw"+e.functionName](e.renderOption)}function St(e,t,i,l,o){var n,r="Path",a=t.width,s=t.height,d=e.x,h=e.y,p=e.x+-a/2,g=e.y+-s/2;switch(i){case"Circle":case"Bubble":r="Ellipse",A.merge(l,{rx:a/2,ry:s/2,cx:d,cy:h});break;case"VerticalLine":A.merge(l,{d:n="M "+d+" "+(h+s/2)+" L "+d+" "+(h+-s/2)});break;case"Diamond":A.merge(l,{d:n="M "+p+" "+h+" L "+d+" "+(h+-s/2)+" L "+(d+a/2)+" "+h+" L "+d+" "+(h+s/2)+" L "+p+" "+h+" z"});break;case"Rectangle":A.merge(l,{d:n="M "+p+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+s/2)+" L "+p+" "+(h+s/2)+" L "+p+" "+(h+-s/2)+" z"});break;case"Triangle":A.merge(l,{d:n="M "+p+" "+(h+s/2)+" L "+d+" "+(h+-s/2)+" L "+(d+a/2)+" "+(h+s/2)+" L "+p+" "+(h+s/2)+" z"});break;case"InvertedTriangle":A.merge(l,{d:n="M "+(d+a/2)+" "+(h-s/2)+" L "+d+" "+(h+s/2)+" L "+(d-a/2)+" "+(h-s/2)+" L "+(d+a/2)+" "+(h-s/2)+" z"});break;case"Pentagon":for(var c,m,u=0;u<=5;u++)c=a/2*Math.cos(Math.PI/180*(72*u)),m=a/2*Math.sin(Math.PI/180*(72*u)),n=0===u?"M "+(d+c)+" "+(h+m)+" ":n.concat("L "+(d+c)+" "+(h+m)+" ");n=n.concat("Z"),A.merge(l,{d:n});break;case"Star":n="M "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" L "+(e.x-t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x+t.width/2)+" "+(e.y+t.height/6)+" L "+(e.x-t.width/3)+" "+(e.y-t.height/2)+" L "+e.x+" "+(e.y+t.height/2)+" L "+(e.x+t.width/3)+" "+(e.y-t.height/2)+" Z",A.merge(l,{d:n});break;case"Cross":A.merge(l,{d:n="M "+p+" "+h+" L "+(d+a/2)+" "+h+" M "+d+" "+(h+s/2)+" L "+d+" "+(h+-s/2)});break;case"Image":r="Image",A.merge(l,{href:o,height:s,width:a,x:p,y:g})}return{renderOption:l,functionName:r}}function bt(e,t){for(var i=!1,l=0;l<e.length;l++)if(t.levelOrderName===e[l].levelOrderName){i=!0;break}return i}function It(e,t,i,l,o){this.dataOptions=e,this.type=t||"GET",this.async=i||!0,this.contentType=l,this.sendData=o}function Ct(e){if(0<e.length)for(var t=0;t<e.length;t++){var i=e[t];R(i.legendEle,i.oldFill,i.oldOpacity,i.oldBorderColor,i.oldBorderWidth)}}function B(e,t){if(0<e.length)for(var i=0;i<e.length;i++)for(var l=e[i],o=parseFloat(l.legendEle.id.split("_Index_")[1]),n=-1<l.legendEle.id.indexOf("Text")?l.legendEle.id.replace("_Text",""):l.legendEle.id,r="Interactive"===t.legendSettings.mode?document.getElementById(n):document.getElementById(t.element.id+"_Legend_Shape_Index_"+o),n="Interactive"===t.legendSettings.mode?document.getElementById(n+"_Text"):document.getElementById(t.element.id+"_Legend_Text_Index_"+o),a=(A.isNullOrUndefined(r)||R(r,l.oldFill,l.oldOpacity,"none","0px"),A.isNullOrUndefined(n)||R(n,t.legendSettings.textStyle.color||t.themeStyle.legendTextColor,l.oldOpacity,null,null),A.isNullOrUndefined(l.ShapeCollection)?0:l.ShapeCollection.Elements.length),s=0;s<a;s++){var d=document.getElementById(l.ShapeCollection.Elements[s].id);A.isNullOrUndefined(d)||R(d,l.shapeOldFill,l.shapeOldOpacity,l.shapeOldBorderColor,l.shapeOldBorderWidth)}}function R(e,t,i,l,o){e.setAttribute("fill",t),e.setAttribute("opacity",i),A.isNullOrUndefined(l)||e.setAttribute("stroke",l),A.isNullOrUndefined(o)||e.setAttribute("stroke-width",o)}function Ft(e,t,i){B(e,i),D(document.getElementsByClassName("treeMapHighLight"),"treeMapHighLight",i)}function wt(e,t,i){for(var l,o=""!==i.rangeColorValuePath?i.rangeColorValuePath:null,n=!1,r=0;r<e&&!n;r++){var a=i.treeMapLegendModule.legendCollections[r].legendData.length;if(0<a){for(var s=0;s<a;s++)if(!A.isNullOrUndefined(o)&&0<i.leafItemSettings.colorMapping.length?i.treeMapLegendModule.legendCollections[r].legendData[s].data[o]===t.data[o]:i.treeMapLegendModule.legendCollections[r].legendData[s].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[r].legendName)){l=r,n=!0;break}}else if(i.palette&&0<i.palette.length&&(i.treeMapLegendModule.legendCollections[r].levelOrderName===t.levelOrderName||-1<t.levelOrderName.indexOf(i.treeMapLegendModule.legendCollections[r].levelOrderName))&&i.treeMapLegendModule.legendCollections[r].legendName===t.name){l=r;break}}return l}function Ot(e,t,i,l,o,n,r){e.push({legendEle:l,oldFill:r[t].legendFill,oldOpacity:r[t].opacity,oldBorderColor:r[t].borderColor,oldBorderWidth:r[t].borderWidth,shapeElement:o,shapeOldFill:n[i].options.fill,shapeOldOpacity:n[i].options.opacity,shapeOldBorderColor:n[i].options.border.color,shapeOldBorderWidth:n[i].options.border.width})}function Lt(e,t,i,l){A.createElement("a",{attrs:{download:e+"."+t.toLocaleLowerCase(),href:i}}).dispatchEvent(new MouseEvent(l?"click":"move",{view:window,bubbles:!1,cancelable:!0}))}function Tt(e){e=document.getElementById(e);return e?A.remove(e):null}y.prototype.processLayoutPanel=function(){var e,t,i,l;this.treemap.treemapLevelData.levelsData&&0<this.treemap.treemapLevelData.levelsData.length&&(i=(A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||A.isNullOrUndefined(this.treemap.initialDrillDown.groupName)||(A.isNullOrUndefined(this.treemap.drilledItems)?!A.isNullOrUndefined(this.treemap.drilledItems):0!==this.treemap.drilledItems.length)?this.treemap.treemapLevelData.levelsData:this.getDrilldownData(this.treemap.treemapLevelData.levelsData[0],[]))[0],l=A.extend({},this.treemap.areaRect,l,!1),A.isNullOrUndefined(this.treemap.treeMapLegendModule)||A.isNullOrUndefined(this.treemap.totalRect)||"Float"!==this.treemap.legendSettings.position&&(l=this.treemap.totalRect),A.isNullOrUndefined(this.treemap.currentLevel)||(A.isNullOrUndefined(this.treemap.drilledItems)?A.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)?(!A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)&&(A.isNullOrUndefined(this.treemap.drilledItems)?A.isNullOrUndefined(this.treemap.drilledItems):0===this.treemap.drilledItems.length)&&(this.treemap.currentLevel=this.treemap.initialDrillDown.groupIndex),this.calculateLayoutItems(i||this.treemap.treemapLevelData.levelsData[0],l)):(i=this.treemap.drilledItems.length-1,e=this.treemap.drilledItems[i].data,(t={})[this.treemap.drilledItems[i].data.groupName]=[e],A.isNullOrUndefined(this.treemap.initialDrillDown.groupIndex)||this.treemap.enableBreadcrumb||(this.treemap.currentLevel=this.treemap.drilledItems[i].data.groupIndex),this.calculateLayoutItems(t||this.treemap.treemapLevelData.levelsData[0],l)),this.renderLayoutItems())},y.prototype.getDrilldownData=function(e,t){var i=this.treemap,l={},o=H(e).values;if(o&&0<o.length&&0===t.length){for(var n=0;n<o.length;n++)o[n].groupIndex===i.initialDrillDown.groupIndex&&o[n].name===i.initialDrillDown.groupName&&(o[n].isDrilled=!0,l[o[n].groupName]=[o[n]],t.push(l));for(var r=0;r<o.length;r++)this.getDrilldownData(o[r],t)}return t},y.prototype.calculateLayoutItems=function(e,t){this.renderItems=[],this.parentData=[],A.isNullOrUndefined(this.treemap.weightValuePath)||(-1<this.treemap.layoutType.indexOf("SliceAndDice")?this.computeSliceAndDiceDimensional(e,t):(t.height=t.height+t.y,t.width=t.width+t.x,this.computeSquarifyDimensional(e,t)))},y.prototype.computeSliceAndDiceDimensional=function(e,t){var i,l,o,n=this.treemap.leafItemSettings,r=this.treemap.levels,a=H(e).values;if(a&&0<a.length&&(this.sliceAndDiceProcess(a,t),0<this.treemap.levels.length))for(var s=0;s<a.length;s++)o=a[s].groupIndex,l=0===r.length||o===r.length?n.gap:r[o].groupGap,o=0===r.length?0:r[o]?r[o].showHeader?r[o].headerHeight:0:r[o-1].showHeader?r[o-1].headerHeight:0,i=a[s].rect,i=new j(i.x+l/2,i.y+(o+l/2),i.width-l,Math.abs(i.height-(l+o))),this.computeSliceAndDiceDimensional(a[s],i);return e},y.prototype.sliceAndDiceProcess=function(e,t){var i,l=t.height*t.width,o=this.treemap.levels,n=0,r=0,a=(e.forEach(function(e){r+=e.weight}),e.forEach(function(e){e.weightArea=l*e.weight/r}),"SliceAndDiceAuto"===this.treemap.layoutType?t.width>t.height:"SliceAndDiceHorizontal"===this.treemap.layoutType);e.sort(We);for(var s=0;s<e.length;s++){var d=e[s];d.isLeafItem=0===o.length||(this.treemap.isHierarchicalData||A.isNullOrUndefined(this.treemap.leafItemSettings.labelPath)?d.groupIndex===o.length-1:d.groupIndex===this.treemap.levels.length),a?(i=l/r*e[s].weight/t.height,n<=t.width&&(e[s].rect=new j(n+t.x,t.y,i,t.height))):(i=l/r*e[s].weight/t.width,n<=t.height&&(e[s].rect=new j(t.x,n+t.y,t.width,i))),n+=i,this.renderItems.push(e[s])}},y.prototype.computeSquarifyDimensional=function(e,t){var i,l,o,n,r=this.treemap.leafItemSettings,a=this.treemap.levels,s=H(e).values;if(s&&0<s.length&&(0===this.parentData.length&&(this.parentData=[],this.parentData.push(s)),this.calculateChildrenLayout(e,s,t),0<this.treemap.levels.length))for(var d=0;d<s.length;d++)n=(l=s[d]).groupIndex,i=l.rect,o=(l.isLeafItem?r.padding:a[n].groupPadding)/2,n=this.treemap.isHierarchicalData?(0!==n||!l.isLeafItem)&&a[n]&&a[n].showHeader?a[n].headerHeight:0:0!==a.length&&a[n]&&a[n].showHeader?a[n].headerHeight:0,i=new j(i.x+o,i.y+(n+o),i.width-o,i.height-o),!l.isLeafItem&&0<l.weight&&this.computeSquarifyDimensional(s[d],i)},y.prototype.calculateChildrenLayout=function(e,t,i){this.computeTotalArea(t,Ye(i)),t.sort(pt),this.performRowsLayout(t,[],i,[])},y.prototype.performRowsLayout=function(e,t,i,l){var o=e.length;if(0===o)return h=this.getCoordinates(t,i),l.concat(h);var n=Ze(i),r=e[0],o=e.slice(1,o);if(this.aspectRatio(t,r,n))return n=t.concat(r),this.performRowsLayout(o,n,i,l);for(var a=t.length,s=0,d=0;d<a;d+=1)s+=t[d].itemArea;var r=this.cutArea(i,s),h=this.getCoordinates(t,i),o=l.concat(h);return this.performRowsLayout(e,[],r,o)},y.prototype.aspectRatio=function(e,t,i){return 0===e.length||(t=e.concat(t),e=this.findMaxAspectRatio(e,i),this.findMaxAspectRatio(t,i)<=e)},y.prototype.findMaxAspectRatio=function(e,t){for(var i=e.length,l=1/0,o=-1/0,n=0,r=0;r<i;r+=1){var a=e[r].itemArea;a<l&&(l=a),o<a&&(o=a),n+=a}return Math.max(Math.pow(t,2)*o/Math.pow(n,2),Math.pow(n,2)/(Math.pow(t,2)*l))},y.prototype.cutArea=function(e,t){var i,e=Qe(e),l=e.width,o=e.height,n=e.x,e=e.y;return $e(o<=l?{x:n+(i=t/o),y:e,width:l-i,height:o}:{x:n,y:e+(i=t/l),width:l,height:o-i})},y.prototype.getCoordinates=function(e,t){for(var i=Qe(t),l=i.width,o=i.height,n=i.x,i=i.y,r=e.length,a=this.treemap.levels,s=this.treemap.leafItemSettings,d=0,h=0;h<r;h+=1)d+=e[h].itemArea;for(var p,g,c=d/o,m=d/l,u=n,y=i,f=[],h=0;h<r;h+=1){var v,x=e[h],S=x.groupIndex;x.isLeafItem=0===a.length||(this.treemap.isHierarchicalData||!A.isNullOrUndefined(s.labelPath))&&S===a.length,g=(p=bt(this.parentData[0],x))?this.treemap.areaRect:x.parent.rect,S=x.isLeafItem?s.padding:a[S].groupPadding,o<=l?(v=y+x.itemArea/c,x.rect={x:u,y:y,width:u+c,height:v},y=v):(v=u+x.itemArea/m,x.rect={x:u,y:y,width:v,height:y+m},u=v),0<x.weight&&(p||Math.round(t.y+S/2)<=Math.round(g.y+(g.height-g.y))&&Math.round(t.x+S/2)<=Math.round(g.x+(g.width-g.x)))&&(this.renderItems.push(x),f.push(x))}return f},y.prototype.computeTotalArea=function(e,t){for(var i=e.length,l=[],o=0;o<i;o+=1){for(var n=e.length,r=0,a=0;a<n;a+=1)r+=e[a].weight;for(var s=t/r,d=void 0,h=0;h<n;h++)(d=e[h]).itemArea=d.weight*s,l.push(d)}return l},y.prototype.onDemandProcess=function(e){var t,i=e[0].parent;this.treemap.currentLevel=i.isDrilled?i.groupIndex:null;for(var l={},o=(A.isNullOrUndefined(i.groupName)?l=i:l[i.groupName]=[i],t=A.extend({},this.treemap.areaRect,t,!1),A.isNullOrUndefined(this.treemap.treeMapLegendModule)||A.isNullOrUndefined(this.treemap.totalRect)||(t=this.treemap.totalRect),this.treemap.levels.length),n=0;n<o;n++)o===e[0].groupIndex?this.treemap.levels[o]=this.treemap.levels[n]:this.treemap.levels.splice(o-1,1);this.calculateLayoutItems(l,t),this.renderLayoutItems()},y.prototype.renderLayoutItems=function(){for(var a,s,d,h,p,g,c,m,u,y,f,v,x,S,b,I,C,F,w=this,O=this.treemap,L=(this.renderer=O.renderer,O.element.id),e=O.layoutType,T=this.treemap.leafItemSettings.interSectAction,M="",N=document.getElementById(O.element.id+"_Secondary_Element"),_=O.levels,E=(this.layoutGroup=this.renderer.createGroup({id:L+"_TreeMap_"+e+"_Layout"}),A.createElement("div",{id:O.element.id+"_Label_Template_Group",className:"template"})),D=(E.style.cssText="overflow: hidden; position: absolute;pointer-events: none;top:"+O.areaRect.y+"px;left:"+O.areaRect.x+"px;height:"+O.areaRect.height+"px;width:"+O.areaRect.width+"px;",!1),P=O.leafItemSettings,B=this,t=0;t<this.renderItems.length;t++)!function(e){if(m=B.renderItems[e],h=m.groupIndex,B.treemap.drillDownView&&A.isNullOrUndefined(B.treemap.currentLevel)&&0<h||B.treemap.drillDownView&&h>B.treemap.currentLevel+1)return;g=m.rect,D=m.isLeafItem,f=L+"_Level_Index_"+h+"_Item_Index_"+e,S=B.renderer.createGroup({id:f+"_Group"}),C=(D?P.gap:_[h].groupGap)/2;var t,e=B.treemap.totalRect?O.legendSettings.visible?B.treemap.totalRect:Qe(B.treemap.totalRect):B.treemap.areaRect;"Squarified"===O.layoutType&&(g.width=Math.abs(g.x-g.width)-C,g.height=Math.abs(g.y-g.height)-C),"TopRightBottomLeft"===O.renderDirection?g.x=e.x+e.width-g.width-Math.abs(e.x-g.x):"BottomLeftTopRight"===O.renderDirection?g.y=e.y+e.height-g.height-Math.abs(e.y-g.y):"BottomRightTopLeft"===O.renderDirection&&(g.x=e.x+e.width-g.width-Math.abs(e.x-g.x),g.y=e.y+e.height-g.height-Math.abs(e.y-g.y)),C=B.getItemColor(D,m),c=C.fill,y=C.opacity,C=D?P.labelFormat:_[h].headerFormat,s=D?P.showLabels:_[h].showHeader,t=h===B.treemap.currentLevel?B.treemap.enableBreadcrumb?(F="#"+B.treemap.breadcrumbConnector+"#",t=m.levelOrderName.replace(/#/gi,F),0!==h?"#"+t:t):m.name:(B.treemap.enableBreadcrumb&&(m.isDrilled=!1),m.name),u=mt(C,m.data,B.treemap)||t||"undefined",C=H(m).values,u=!D&&C&&0<C.length&&B.treemap.enableDrillDown?m.isDrilled?O.enableRtl?u+" [-]":"[-] "+u:O.enableRtl?u+" [+]":"[+] "+u:u,O.enableHtmlSanitizer&&(u=A.SanitizeHtmlHelper.sanitize(u));var e=(D?P.labelStyle:_[h].headerStyle).fontFamily||B.treemap.themeStyle.labelFontFamily,i=(D?P.labelStyle:_[h].headerStyle).size||B.treemap.themeStyle.labelFontSize,l=(D?P.labelStyle:_[h].headerStyle).fontWeight||B.treemap.themeStyle.fontWeight,o=(D?P.labelStyle:_[h].headerStyle).color,n=(D?P.labelStyle:_[h].headerStyle).fontStyle,r=(D?P.labelStyle:_[h].headerStyle).opacity;x={fontFamily:e,size:i,fontWeight:l,color:o,fontStyle:n,opacity:r},I=(D?P:_[h]).border,a=D?P.labelPosition:"Near"===_[h].headerAlignment?"TopLeft":"Center"===_[h].headerAlignment?"TopCenter":"TopRight",p=(D?P:_[h]).templatePosition,b=D?P.labelTemplate:_[h].headerTemplate,m.options={border:I,opacity:y,fill:c},d={cancel:!1,name:U,treemap:B.treemap,text:u,currentItem:m,RenderItems:B.renderItems,options:m.options,textColor:x.color},B.treemap.trigger(U,d,function(e){e.cancel||(M=" M "+g.x+" "+g.y+" L "+(g.x+g.width)+" "+g.y+" L "+(g.x+g.width)+" "+(g.y+g.height)+" L "+g.x+" "+(g.y+g.height)+"z",v=new z(f+"_RectPath",c,I.width,I.color,y,null,M),e=w.renderer.drawPath(v),S.appendChild(e),s&&(d.text!==u&&(d.text=mt(d.text,m.data,w.treemap)||t),x.color=d.textColor||x.color,w.renderItemText(d.text.toString(),S,x,g,T,f,c,a,F)),b&&(v=w.renderTemplate(N,f,g,p,b,m,D),A.isNullOrUndefined(v)||(E.appendChild(v),w.treemap.renderReactTemplates())),S.setAttribute("aria-label",m.name),w.treemap.enableDrillDown&&!D||w.treemap.selectionSettings.enable||w.treemap.highlightSettings.enable?(S.setAttribute("role","button"),S.setAttribute("tabindex",w.treemap.tabIndex.toString()),S.style.outline="none",S.style.cursor=(!w.treemap.highlightSettings.enable||w.treemap.selectionSettings.enable||!w.treemap.enableDrillDown||m.groupIndex!==w.treemap.levels.length-1)&&(!w.treemap.highlightSettings.enable||w.treemap.selectionSettings.enable||w.treemap.enableDrillDown)?"pointer":"default"):S.setAttribute("role","region"),gt(w.treemap,S,"treeMapSelection"),w.layoutGroup.appendChild(S))})}(t);0<E.childNodes.length&&N.appendChild(E),this.treemap.svgObject.appendChild(this.layoutGroup),gt(this.treemap,this.layoutGroup,"treeMapSelection")},y.prototype.renderItemText=function(e,t,i,l,o,n,r,a,s){var d=[],h=0,p=-1!==e.indexOf("<br>")?e.split("<br>"):null,g=this.labelInterSectAction(l,e,i,o),c=V(p&&p[0]||g[0],i),e=(this.treemap.enableRtl&&(x=V(e,i),v=e.search("[+]")||e.search("[-]"),l.width<x.width)&&0<v&&(x=e.substring(v-1,e.length),v=V("[+]",i),g[0]=G(l.width-v.width-5,g[0],i)+x),Xe(l,a,c,"Text",this.treemap));if(!A.isNullOrUndefined(p)){for(var m,u=[],y=[],f=0;f<p.length;f++)h+=(c=V(m=G(l.width-5,p[f],i),i)).height,y.push(c.width),u.push(m);g=u,c.width=Math.max.apply(null,y),c.height=h}if("WrapByWord"===o||"Wrap"===o||"Trim"===o){for(var v,x,S=0;S<g.length;S++)h+=(c=V(g[S],i)).height,l.height-5>h&&d.push(g[S]);"Wrap"===o&&g.length!==d.length&&d.length&&(x=(x=d[v=d.length-1]).substring(0,x.length-1)+"...",d.splice(v),"..."!==x)&&d.push(x)}else a=g,d.push(a);Ue(new T(n+"_Text",e.x,e.y,"start",d,"","",s),i,i.color||this.getSaturatedColor(r),t)},y.prototype.getItemColor=function(e,t){var i=this.treemap,l=(e?i.leafItemSettings:i.levels[t.groupIndex]).fill,o=(e?i.leafItemSettings:i.levels[t.groupIndex]).opacity,n=(A.isNullOrUndefined(i.treemapLevelData.defaultLevelsData)||0<i.treemapLevelData.defaultLevelsData.length&&(i.treemapLevelData.levelsData=i.treemapLevelData.defaultLevelsData),H(i.treemapLevelData.levelsData[0]).values),e=(e?i.leafItemSettings:i.levels[t.groupIndex]).colorMapping;if(0<e.length){e=et(e,t.data[i.equalColorValuePath],t.data[i.rangeColorValuePath]);A.isNullOrUndefined(e)||(l=(A.isNullOrUndefined(e.fill)?i.leafItemSettings:e).fill,o=e.opacity)}else for(var r=0;r<n.length;r++)n[r].levelOrderName===t.levelOrderName.split("#")[0]&&(l=A.isNullOrUndefined(l)?A.isNullOrUndefined(i.colorValuePath)?A.isNullOrUndefined(t.options)?!A.isNullOrUndefined(i.palette)&&0<i.palette.length?i.palette[r%i.palette.length]:"#808080":t.options.fill:n[r].data[i.colorValuePath]:l);return{fill:l,opacity:o}},y.prototype.getSaturatedColor=function(e){var t=e,e=vt(u("transparent"===e?window.getComputedStyle(document.body,null).backgroundColor:t));return 128<=Math.round((299*e.r+587*e.g+114*e.b)/1e3)?"black":"white"},y.prototype.renderTemplate=function(e,t,i,l,o,n,r){var a,t=r?t+"_LabelTemplate":t+"_HeaderTemplate",r=r?"_LabelTemplate":"_HeaderTemplate";if(A.isNullOrUndefined(o.prototype)&&"string"==typeof o)for(var s=Object.keys(n.data),d=0;d<s.length;d++){var h=RegExp;o=o.replace(new h("{{:"+s[d]+"}}","g"),n.data[s[d].toString()])}return this.treemap.enableHtmlSanitizer&&"string"==typeof o&&(o=A.SanitizeHtmlHelper.sanitize(o)),A.isNullOrUndefined(document.getElementById(this.treemap.element.id+"_Secondary_Element"))||(i=Xe(i,l,Je(a=qe(Ge(o)(n.data,this.treemap,o,this.treemap.element.id+r,!1),t,n.data),e),"Template",this.treemap),a.style.left=i.x+"px",a.style.top=i.y+"px"),a},y.prototype.labelInterSectAction=function(e,t,i,l){var o,n=e.width-10;switch(l){case"Hide":o=[ht(n,e.height,t,i)];break;case"Trim":o=[G(3+n,t,i)];break;case"WrapByWord":o=st(n,t,i);break;case"Wrap":o=dt(n,t,i)}return o},y.prototype.destroy=function(){this.treemap=null,this.currentRect=null,this.layoutGroup=null,this.renderer=null,this.renderItems=[],this.parentData=[]};var Mt=y;function y(e){this.treemap=e}function Nt(e){var t,i;switch(e.toLowerCase()){case"materialdark":i="#303030";break;case"fabricdark":i="#201F1F";break;case"bootstrapdark":i="#1A1A1A"}switch(e.toLowerCase()){case"bootstrapdark":case"fabricdark":case"materialdark":t={backgroundColor:i,titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#DADADA",legendTextColor:"#DADADA",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0};break;case"highcontrast":t={backgroundColor:"#000000",titleFontColor:"#FFFFFF",titleFontWeight:"Normal",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",labelFontFamily:ne,fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap4":t={backgroundColor:"#FFFFFF",titleFontColor:"#212529",titleFontWeight:"Normal",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"HelveticaNeue-Medium",fontSize:"16px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"HelveticaNeue",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind":t={backgroundColor:"transparent",titleFontColor:"#374151",titleFontWeight:"Normal",subTitleFontColor:"#374151",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#374151",legendTextColor:"#374151",fontFamily:"Inter",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwinddark":t={backgroundColor:"transparent",titleFontColor:"#D1D5DB",titleFontWeight:"Normal",subTitleFontColor:"#D1D5DB",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#D1D5DB",legendTextColor:"#D1D5DB",fontFamily:"Inter",fontWeight:"Normal",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3":t={backgroundColor:"transparent",titleFontColor:"#111827",titleFontWeight:"600",subTitleFontColor:"#111827",tooltipFillColor:"#111827",tooltipFontColor:"#F9FAFB",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#111827",legendTextColor:"#111827",fontFamily:"Inter",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"tailwind3dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#F9FAFB",tooltipFontColor:"#1F2937",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Inter",fontWeight:"400",fontSize:"14px",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Inter",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5":t={backgroundColor:"transparent",titleFontColor:"#212529",titleFontWeight:"400",subTitleFontColor:"#212529",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#212529",legendTextColor:"#212529",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"bootstrap5dark":t={backgroundColor:"transparent",titleFontColor:"#DEE2E6",titleFontWeight:"400",subTitleFontColor:"#DEE2E6",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#212529",tooltipFontSize:"12px",tooltipFillOpacity:.9,legendTitleColor:"#DEE2E6",legendTextColor:"#DEE2E6",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"10px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#201F1E",titleFontWeight:"Normal",subTitleFontColor:"#201F1E",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#323130",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#201F1E",legendTextColor:"#201F1E",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluentdark":t={backgroundColor:"rgba(255,255,255, 0.0)",titleFontColor:"#F3F2F1",titleFontWeight:"Normal",subTitleFontColor:"#F3F2F1",tooltipFillColor:"#252423",tooltipFontColor:"#F3F2F1",tooltipFontSize:"13px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#F3F2F1",legendTextColor:"#F3F2F1",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"Normal",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3":t={backgroundColor:"transparent",titleFontColor:"#1C1B1F",titleFontWeight:"500",subTitleFontColor:"#1C1B1F",tooltipFillColor:"#313033",tooltipFontColor:"#F4EFF4",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#1C1B1F",legendTextColor:"#49454E",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"material3dark":t={backgroundColor:"transparent",titleFontColor:"#E6E1E5",titleFontWeight:"500",subTitleFontColor:"#E6E1E5",tooltipFillColor:"#E6E1E5",tooltipFontColor:"#313033",tooltipFontSize:"14px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#E6E1E5",legendTextColor:"#CAC4D0",fontFamily:"Roboto",fontSize:"16px",fontWeight:"400",subtitleFontSize:"14px",legendFontSize:"14px",labelFontFamily:"Roboto",labelFontSize:"12px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2":t={backgroundColor:"transparent",titleFontColor:"#242424",titleFontWeight:"600",subTitleFontColor:"#242424",tooltipFillColor:"#FFFFFF",tooltipFontColor:"#242424",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#242424",legendTextColor:"#242424",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2dark":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#292929",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#000000",legendBorderWidth:0};break;case"fluent2highcontrast":t={backgroundColor:"transparent",titleFontColor:"#FFFFFF",titleFontWeight:"600",subTitleFontColor:"#FFFFFF",tooltipFillColor:"#000000",tooltipFontColor:"#FFFFFF",tooltipFontSize:"12px",tooltipFillOpacity:1,tooltipTextOpacity:1,legendTitleColor:"#FFFFFF",legendTextColor:"#FFFFFF",fontFamily:"Segoe UI",fontSize:"14px",fontWeight:"400",subtitleFontSize:"12px",legendFontSize:"12px",labelFontFamily:"Segoe UI",labelFontSize:"10px",legendBorderColor:"#FFF",legendBorderWidth:1,tooltipBorderColor:"#FFF",tooltipBorderWidth:1};break;default:t={backgroundColor:"#FFFFFF",titleFontColor:"#424242",titleFontWeight:"Normal",subTitleFontColor:"#424242",tooltipFillColor:"#363F4C",tooltipFontColor:"#ffffff",tooltipFontSize:"13px",legendTitleColor:"#353535",legendTextColor:"#353535",fontSize:"15px",fontWeight:"Normal",subtitleFontSize:"14px",legendFontSize:"13px",fontFamily:"Roboto, Noto, Sans-serif",labelFontSize:"12px",labelFontFamily:ne,legendBorderColor:"#000000",legendBorderWidth:0}}return t}(e.Theme||(e.Theme={})).mapsTitleFont={size:"14px",fontWeight:"Medium",color:"#424242",fontStyle:"Medium",fontFamily:"Roboto, Noto, Sans-serif"};Et.prototype.print=function(e,t){var i=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),l=(i.moveTo(0,0),i.resizeTo(screen.availWidth,screen.availHeight),{cancel:!1,htmlContent:this.getHTMLContent(e,t),name:E});e.trigger(E,l,function(){l.cancel||A.print(l.htmlContent,i)})},Et.prototype.getHTMLContent=function(e,t){var i,l,o=A.createElement("div");return t?t instanceof Array?t.forEach(function(e){o.appendChild(Ae(e).cloneNode(!0))}):t instanceof Element?o.appendChild(t.cloneNode(!0)):o.appendChild(Ae(t).cloneNode(!0)):(l=(t=e.element.cloneNode(!0)).getElementsByTagName("svg")[0],A.isNullOrUndefined(l)||(l=l.childNodes[0],A.isNullOrUndefined(l))||(i=l.getAttribute("fill"),"Tailwind"!==e.theme&&"Tailwind3"!==e.theme&&"Bootstrap5"!==e.theme&&"Fluent"!==e.theme&&"Material3"!==e.theme&&"Fluent2"!==e.theme||"rgba(255,255,255, 0.0)"!==i&&"transparent"!==i?"TailwindDark"!==e.theme&