@syncfusion/ej2-navigations 20.2.49 → 20.2.50

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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-navigations.umd.min.js
3
- * version : 20.2.49
3
+ * version : 20.2.50
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs"],t):t(e.ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs)}(this,function(e,t,i,s,n,l,r){"use strict";function o(e,t,i,s,n,l){var r,o,d=t.parentElement;if("vscroll"===s?(r=l||t.getBoundingClientRect().height,o=i.getBoundingClientRect().height):(r=t.getBoundingClientRect().width,o=i.getBoundingClientRect().width),r<o)return a(e,t,i,s,n,l);if(d){var h=d.getBoundingClientRect().width;return h<r&&"hscroll"===s?(o=h,t.style.maxWidth=h+"px",a(e,t,i,s,n,l)):i}return i}function a(e,i,s,n,l,r){var o=e("div",{className:"e-menu-"+n});i.appendChild(o),o.appendChild(s),r?(o.style.overflow="hidden",o.style.height=r+"px"):(o.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new B({enableRtl:l},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new I({enableRtl:l},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,o}function d(e,i,s){if(e){var n=t.select(".e-menu-parent",i);n?s&&s!==n||(e.destroy(),i.parentElement.appendChild(n),t.detach(i)):(e.destroy(),t.detach(i))}}var h=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),c=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},p="e-rtl",u="e-overlay",f="e-nav-arrow",m="e-nav-right-arrow",v="e-nav-left-arrow",g="e-scroll-nav",y="e-scroll-right-nav",b="e-scroll-left-nav",C="e-scroll-device",x="e-scroll-overlay",E="e-scroll-right-overlay",N="e-scroll-left-overlay",I=function(e){function i(t,i){return e.call(this,t,i)||this}return h(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(p)},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(C),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var i=this.element,s=0,n=[].slice.call(i.children);s<n.length;s++){var l=n[s];e.appendChild(l)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"hScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",i.classList.remove("e-hscroll"),i.classList.remove(C);var s=t.selectAll(".e-"+i.id+"_nav."+g,i),n=t.selectAll("."+x,i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var l=0,r=[].slice.call(this.scrollItems.children);l<r.length;l++){var o=r[l];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(."+u+")",this.element);e?this.element.classList.add(u):this.element.classList.remove(u),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:x+" "+E}),s="e-"+e.id.concat("_nav "+g+" "+y),n=this.createElement("div",{id:t.concat("_right"),className:s}),l=this.createElement("div",{className:m+" "+f+" e-icons"});n.appendChild(l);var r=this.createElement("div",{className:x+" "+N});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(r,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+g+" "+y),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},n=this.createElement("div",{className:i,attrs:s});n.setAttribute("aria-disabled","false");var l=this.createElement("div",{className:m+" "+f+" e-icons"}),r="e-"+e.id.concat("_nav "+g+" "+b),o={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},a=this.createElement("div",{className:r+" "+u,attrs:o});a.setAttribute("aria-disabled","true");var d=this.createElement("div",{className:v+" "+f+" e-icons"});a.appendChild(d),n.appendChild(l),e.appendChild(n),e.insertBefore(a,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),a.classList.add("e-ie-align")),this.eventBinding([n,a])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,g)?i.firstElementChild:i;this.timeout=window.setInterval(function(){t.eleScrolling(10,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(g)&&(n=t.querySelector("."+f).classList),this.contains(s,p)&&this.browserCheck&&(e=-e),!this.contains(s,p)||this.browserCheck||this.ieCheck?n.contains(m)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(v)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var s=.5,n=function(){var l=Math.sin(s);l<=0?window.cancelAnimationFrame(l):("Left"===e.swipeDirection?i.scrollLeft+=t*l:"Right"===e.swipeDirection&&(i.scrollLeft-=t*l),s-=.5,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)this.scrollUpdating(e,i);else{this.customStep||[].slice.call(t.selectAll("."+x,this.element)).forEach(function(t){e-=t.offsetWidth});var l=function(){var t,s;n.contains(n.element,p)&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(l))};l()}},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,p)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector("."+f);t.isNullOrUndefined(e)?t.classList(s,[m],[v]):t.classList(s,[v],[m])}else e&&i&&(e.classList.add(u),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove(u),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0"));this.repeatScroll()},i.prototype.scrollHandler=function(e){var t=e.target,i=t.offsetWidth,s=(this.element,this.element.querySelector("."+b)),n=this.element.querySelector("."+y),l=this.element.querySelector("."+N),r=this.element.querySelector("."+E),o=t.scrollLeft;if(o<=0&&(o=-o),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(l=this.element.querySelector("."+E),r=this.element.querySelector("."+N)),l.style.width=o<40?o+"px":"40px",t.scrollWidth-Math.ceil(i+o)<40?r.style.width=t.scrollWidth-Math.ceil(i+o)+"px":r.style.width="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollWidth)this.arrowDisabling(n,s);else{var a=this.element.querySelector("."+g+"."+u);a&&(a.classList.remove(u),a.setAttribute("aria-disabled","false"),a.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(p):this.element.classList.remove(p)}}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),S=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),O=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},w="e-overlay",k="e-nav-arrow",L="e-nav-up-arrow",A="e-nav-down-arrow",P="e-scroll-nav",D="e-scroll-up-nav",T="e-scroll-down-nav",M="e-scroll-device",H="e-scroll-overlay",U="e-scroll-up-overlay",R="e-scroll-down-overlay",B=function(e){function i(t,i){return e.call(this,t,i)||this}return S(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(M),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),t.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=t.createElement("div",{className:"e-vscroll-content"}),i=t.createElement("div",{className:"e-vscroll-bar"});i.setAttribute("tabindex","-1");for(var s=this.element,n=0,l=[].slice.call(s.children);n<l.length;n++){var r=l[n];e.appendChild(r)}i.appendChild(e),s.appendChild(i),i.style.overflow="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll",M]);var s=t.selectAll(".e-"+i.id+"_nav."+P,i),n=t.selectAll("."+H,i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var l=0,r=[].slice.call(this.scrollItems.children);l<r.length;l++){var o=r[l];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(."+w+")",this.element);e?this.element.classList.add(w):this.element.classList.remove(w),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlayElement=function(e){var i=e.id.concat("_nav"),s=t.createElement("div",{className:H+" "+R}),n="e-"+e.id.concat("_nav "+P+" "+T),l=t.createElement("div",{id:i.concat("down"),className:n}),r=t.createElement("div",{className:A+" "+k+" e-icons"});l.appendChild(r);var o=t.createElement("div",{className:H+" "+U});this.ieCheck&&l.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(l),e.insertBefore(o,e.firstChild),this.eventBinding([l])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav "+P+" "+T),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var l=t.createElement("div",{className:A+" "+k+" e-icons"}),r="e-"+e.id.concat("_nav "+P+" "+D),o=t.createElement("div",{id:i.concat("_up"),className:r+" "+w});o.setAttribute("aria-disabled","true");var a=t.createElement("div",{className:L+" "+k+" e-icons"});o.appendChild(a),n.appendChild(l),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(o,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),o.classList.add("e-ie-align")),this.eventBinding([n,o])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,P)?i.firstElementChild:i;this.timeout=window.setInterval(function(){t.eleScrolling(10,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;s.contains(P)&&(s=t.querySelector("."+k).classList),s.contains(A)?this.frameScrollRequest(e,"add",i):s.contains(L)&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var s=.5,n=function(){var l=Math.sin(s);l<=0?window.cancelAnimationFrame(l):("Up"===e.swipeDirection?i.scrollTop+=t*l:"Down"===e.swipeDirection&&(i.scrollTop-=t*l),s-=.02,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)this.scrollUpdating(e,i);else{this.customStep||[].slice.call(t.selectAll("."+H,this.element)).forEach(function(t){e-=t.offsetHeight});var l=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(l))};l()}},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector("."+k);t.isNullOrUndefined(e)?t.classList(s,[A],[L]):t.classList(s,[L],[A])}else e.classList.add(w),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove(w),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var t=e.target,i=t.offsetHeight,s=this.element.querySelector("."+D),n=this.element.querySelector("."+T),l=this.element.querySelector("."+U),r=this.element.querySelector("."+R),o=t.scrollTop;if(o<=0&&(o=-o),this.isDevice&&(l.style.height=o<40?o+"px":"40px",t.scrollHeight-Math.ceil(i+o)<40?r.style.height=t.scrollHeight-Math.ceil(i+o)+"px":r.style.height="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var a=this.element.querySelector("."+P+"."+w);a&&(a.classList.remove(w),a.setAttribute("aria-disabled","false"),a.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}}},O([t.Property(null)],i.prototype,"scrollStep",void 0),i=O([t.NotifyPropertyChanges],i)}(t.Component),j=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),q=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},F="e-focused",W="e-menu-header",V="e-selected",_="e-separator",z="uparrow",K="downarrow",Y="leftarrow",X="rightarrow",G="e-menu-item",Q="e-disabled",J="e-menu-hide",Z="e-menu-popup",$=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property("id")],i.prototype,"itemId",void 0),q([t.Property("parentId")],i.prototype,"parentId",void 0),q([t.Property("text")],i.prototype,"text",void 0),q([t.Property("iconCss")],i.prototype,"iconCss",void 0),q([t.Property("url")],i.prototype,"url",void 0),q([t.Property("separator")],i.prototype,"separator",void 0),q([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property(null)],i.prototype,"iconCss",void 0),q([t.Property("")],i.prototype,"id",void 0),q([t.Property(!1)],i.prototype,"separator",void 0),q([t.Collection([],i)],i.prototype,"items",void 0),q([t.Property("")],i.prototype,"text",void 0),q([t.Property("")],i.prototype,"url",void 0),i}(t.ChildProperty),te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property("SlideDown")],i.prototype,"effect",void 0),q([t.Property(400)],i.prototype,"duration",void 0),q([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),ie=function(e){function n(i,s){var n=e.call(this,i,s)||this;return n.navIdx=[],n.animation=new t.Animation({}),n.isTapHold=!1,n.tempItem=[],n.showSubMenuOn="Auto",n}return j(n,e),n.prototype.preRender=function(){if(!this.isMenu){var e=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){e=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var i=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=e,t.setValue("ej2_instances",i,this.element)}else{e=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),e);var s=this.element.nextElementSibling;s?this.element.parentElement.insertBefore(e,s):this.element.parentElement.appendChild(e),this.clonedElement=e}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var n=this.element,l=t.getValue("ej2_instances",n),r=(e=this.createElement("ul"),this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"})),o=0,a=n.attributes.length;o<a;o++)e.setAttribute(n.attributes[o].nodeName,n.attributes[o].nodeValue);n.parentNode.insertBefore(r,n),t.detach(n),n=e,r.appendChild(n),t.setValue("ej2_instances",l,n),this.clonedElement=r,this.element=n,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete();var t=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){o(e.createElement,t,e.element,"hscroll",e.enableRtl)})},n.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):document.body.appendChild(e)),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&e.classList.add("e-rtl"),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},n.prototype.renderItems=function(){if(!this.items.length){var e=i.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}});this.setProperties({items:e},!0),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML=""}var s=this.createItems(this.items);if(t.append(Array.prototype.slice.call(s.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu&&(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling)){var n=this.getWrapper();this.element.classList.contains("e-vertical")?o(this.createElement,n,this.element,"vscroll",this.enableRtl):o(this.createElement,n,this.element,"hscroll",this.enableRtl)}},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),l=0,r=n.length;l<r;l++)i=n[l],this.isMenu?t.EventHandler.add(i,"click",this.menuHeaderClickHandler,this):t.Browser.isIos?new t.Touch(i,{tapHold:this.touchHandler.bind(this)}):t.EventHandler.add(i,"contextmenu",this.cmenuHandler,this);if(this.targetElement=i,!this.isMenu){t.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var o=0,a=s.getScrollableParent(this.targetElement);o<a.length;o++){var d=a[o];t.EventHandler.add(d,"scroll",this.scrollHandler,this)}}}t.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),t.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),t.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+G})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:K,uparrow:z,enter:"enter",leftarrow:Y,rightarrow:X,escape:"escape"};this.isMenu&&(i.home="home",i.end="end",i.tab="tab"),new t.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:i})},n.prototype.mouseDownHandler=function(e){t.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||t.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},n.prototype.keyBoardHandler=function(e){var i="",s=e.target,n=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&s.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([F,V],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case X:i=X,e.action=K;break;case Y:i=Y,e.action=z;break;case K:i=K,e.action=X;break;case z:i=z,e.action=""}else if(this.enableRtl)switch(e.action){case Y:n=!0,i=Y,e.action=X;break;case X:n=!0,i=X,e.action=Y}switch(e.action){case K:case z:case"end":case"home":case"tab":this.upDownKeyHandler(e);break;case X:this.rightEnterKeyHandler(e);break;case Y:this.leftEscKeyHandler(e);break;case"enter":this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e);break;case"escape":this.leftEscKeyHandler(e)}n&&(e.action=i)},n.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===K||"home"===e.action||"tab"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,F);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(F),"end"!==e.action&&"home"!==e.action&&(e.action===K?s++:s--,s===(e.action===K?t.childElementCount:-1)&&(s=i)));var l=t.children[s];s=this.isValidLI(l,s,e.action),t.children[s].classList.add(F),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx();return(e.classList.contains(_)||e.classList.contains(Q)||e.classList.contains(J))&&(i===K||i===X?t++:t--),((e=s.children[t]).classList.contains(_)||e.classList.contains(Q)||e.classList.contains(J))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){if(void 0===e&&(e=this.navIdx.length),this.isMenu){var i=[this.getWrapper()].concat([].slice.call(t.selectAll("."+Z)))[e];return t.isNullOrUndefined(i)?null:t.select(".e-menu-parent",i)}return this.getWrapper().children[e]},n.prototype.rightEnterKeyHandler=function(e){var t,i=this.getUlByNavIdx(),s=this.getLIByClass(i,F);if(s){var n=this.getIdx(i,s),l=this.navIdx.concat(n),r=this.getItem(l);r.items.length?(this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,r,-1,-1,e)):"enter"===e.action&&(this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([V],[this.getWrapper()]):s.classList.remove(F),s.classList.add(V),t={element:s,item:r,event:e},this.trigger("select",t),this.closeMenu(null,e))}},n.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):"escape"===e.action&&this.closeMenu(null,e)},n.prototype.scrollHandler=function(e){this.closeMenu(null,e)},n.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},n.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},n.prototype.closeMenu=function(e,i,n){var l=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var r,o,a=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,m=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&m.classList.contains("e-menu")&&((a=this.getLIByClass(m,V))&&a.classList.remove(V),u=!0),!u){var v=i&&i.target&&this.getLI(i.target);this.cli=v||m.children[0],r=this.navIdx.length?this.getItem(this.navIdx):null,o=r?r.items:this.items,c={element:m,parentItem:r,items:o,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(a){var c,p,u,f="",g=!a.cancel;(g||l.isCMenu)&&(l.isMenu?(c=t.closest(m,"."+Z),l.hamburgerMode&&(c.parentElement.style.minHeight="",t.closest(m,".e-menu-item").setAttribute("aria-expanded","false")),l.unWireKeyboardEvent(c),d(t.getInstance(c.children[0],B),c.children[0]),(u=t.getInstance(c,s.Popup)).hide(),f=c.id,u.destroy(),t.detach(c)):l.toggleAnimation(m,!1),p={element:m,parentItem:r,items:o},l.trigger("onClose",p),l.navIdx.pop()),l.updateReactTemplate();var y,b,C,x=l.getWrapper()&&l.getUlByNavIdx();l.isCMenu&&(l.canOpen(i.target)&&l.openMenu(null,null,l.pageY,l.pageX,i),l.isCMenu=!1),l.isMenu&&x&&f.length&&(y=new RegExp("(.*)-ej2menu-"+l.element.id+"-popup").exec(f)[1],b=x.querySelector('[id="'+y+'"]'),C=v&&x.querySelector('[id="'+v.id+'"]'));var E=v&&v.querySelectorAll(".e-menu-item");if(g&&l.hamburgerMode&&e&&!E.length)l.afterCloseMenu(i);else if(g&&!l.hamburgerMode&&l.navIdx.length&&b&&!C&&"left"!==l.keyType){var N=i&&i.target.classList.contains("e-vscroll")?t.closest(i.target,".e-menu-wrapper"):null;N?(N=N.querySelector(".e-menu-item"),(l.showItemOnClick||N&&l.getIndex(N.id,!0).length<=l.navIdx.length)&&l.closeMenu(l.navIdx[l.navIdx.length-1],i,!0)):l.closeMenu(l.navIdx[l.navIdx.length-1],i)}else if(g&&!n&&!e&&(l.hamburgerMode&&l.navIdx.length||1===l.navIdx.length))l.closeMenu(null,i);else if(g&&t.isNullOrUndefined(e)&&l.navIdx.length)l.closeMenu(null,i);else if(!g||l.isMenu||e||0!==l.navIdx.length||l.isMenusClosed)if(g&&l.isMenu&&i&&i.target&&0!==l.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))l.closeMenu(0,i);else if(g&&!l.isMenu&&t.selectAll(".e-menu-parent",h)[e-1]&&3===i.which)l.closeMenu(null,i);else{if(!g||"right"!==l.keyType&&"click"!==l.keyType){var I=l.getUlByNavIdx(),S=l.getLIByClass(I,V);if(S&&(S.setAttribute("aria-expanded","false"),S.classList.remove(V),(a.isFocused&&v||"left"===l.keyType)&&(S.classList.add(F),S.focus())),!g&&l.hamburgerMode&&v&&"false"===v.getAttribute("aria-expanded")&&"true"===v.getAttribute("aria-haspopup")){t.closest(v,".e-menu-parent.e-control")?l.navIdx=[]:l.navIdx.pop(),l.navIdx.push(l.cliIdx);var O=l.getItem(l.navIdx);v.setAttribute("aria-expanded","true"),l.openMenu(v,O,-1,-1,i)}}else l.afterCloseMenu(i);l.navIdx.length<1&&("Hover"!==l.showSubMenuOn&&"Click"!==l.showSubMenuOn||(l.showItemOnClick=l.defaultOption,l.showSubMenuOn="Auto"))}else l.isMenusClosed=!0,l.closeMenu(0,i);l.removeStateWrapper()})}}},n.prototype.updateReactTemplate=function(){if(this.isReact&&this.template&&0===this.navIdx.length){var e=this.portals.splice(0,this.items.length);this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates()}},n.prototype.getMenuItemModel=function(e,i){if(t.isNullOrUndefined(e))return null;t.isNullOrUndefined(i)&&(i=0);var s=this.getFields(i);return{text:e[s.text],id:e[s.id],items:e[s.child],separator:e[s.separator],iconCss:e[s.iconCss],url:e[s.url]}},n.prototype.getPopups=function(){var e=this,i=[];return[].slice.call(document.querySelectorAll("."+Z)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+G))&&e.getIndex(s.querySelector("."+G).id,!0).length&&i.push(s)}),i},n.prototype.isMenuVisible=function(){return this.navIdx.length>0||this.element.classList.contains("e-contextmenu")&&t.isVisible(this.element).valueOf()},n.prototype.canOpen=function(e){var i=!0;if(this.filter){i=!1;for(var s=this.filter.split(" "),n=0,l=s.length;n<l;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,l,r,o){var a=this;void 0===n&&(n=0),void 0===l&&(l=0),void 0===r&&(r=null),void 0===o&&(o=this.targetElement);var d=this.getWrapper();this.lItem=e;var h=""!==this.element.id?this.element.id:"menu";if(this.isMenusClosed=!1,t.isNullOrUndefined(n)&&(n=-1),t.isNullOrUndefined(l)&&(l=-1),e){if(this.uList=this.createItems(i[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&t.Browser.isDevice){d.lastChild.style.display="none";var c={text:i[this.getField("text")].toString(),iconCss:"e-icons e-previous"},p=new ee(this.items[0],"items",c,!0),u=this.createItems([p]).children[0];u.classList.add(W),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Z,id:e.id+"-ej2menu-"+h+"-popup"}),this.hamburgerMode?(n=e.offsetHeight,e.appendChild(this.popupWrapper)):document.body.appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&t.addClass([this.popupWrapper],this.cssClass.split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,r,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,r,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,d.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,r,n,l,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,r,n,l,"none"))}else this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(o||this.element).toString(),this.triggerBeforeOpen(e,this.uList,i,r,n,l,"none")},n.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),s=parseInt(i.textIndent,10);this.navIdx.length<2&&!t.classList.contains("e-blankicon")?s*=2:s+=s/4,e.style.textIndent=s+"px";var n=e.querySelectorAll(".e-blankicon");if(n&&n.length)for(var l=e.querySelector(".e-menu-icon"),r=getComputedStyle(l),o=parseInt(r.marginRight,10)+l.offsetWidth+s,a=0;a<n.length;a++)n[a].style.textIndent=o+"px"},n.prototype.generatePopup=function(e,i,n,l){var r=this,o=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:l||this.enableRtl?"none":"flip",Y:"fit"},position:l&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:i,open:function(){var e=t.select(".e-menu-vscroll",o.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",o.element);o.element.style.maxHeight="",i.focus(),r.triggerOpen(i)}});return o},n.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var i=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.title):this.title,n=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:s}),l=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(l),e.insertBefore(i,this.element)},n.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},n.prototype.closeHamburgerMenu=function(e){var t=this,i={element:this.element,parentItem:null,event:e,items:this.items,cancel:!1};this.trigger("beforeClose",i,function(i){i.cancel||(t.closeMenu(null,e),t.element.classList.add("e-hide-menu"),t.trigger("onClose",{element:t.element,parentItem:null,items:t.items}))})},n.prototype.callFit=function(e,t,i,n,l){return s.fit(e,null,{X:t,Y:i},{top:n,left:l})},n.prototype.triggerBeforeOpen=function(e,i,s,n,l,r,a){var d=this,h=e?s[this.getField("children",this.navIdx.length-1)]:this.items,c={element:i,items:h,parentItem:s,event:n,cancel:!1,top:l,left:r,showSubMenuOn:"Auto"},p=a;this.trigger("beforeOpen",c,function(l){switch(p){case"menu":d.hamburgerMode||("Auto"!==l.showSubMenuOn&&(d.showItemOnClick=!d.defaultOption,d.showSubMenuOn=l.showSubMenuOn),d.top=l.top,d.left=l.left),d.popupWrapper.style.display="block",d.hamburgerMode||(d.popupWrapper.style.maxHeight=d.popupWrapper.getBoundingClientRect().height+"px",d.enableScrolling&&o(d.createElement,d.popupWrapper,d.uList,"vscroll",d.enableRtl),d.checkScrollOffset(n)),d.hamburgerMode||d.left||d.top?(d.popupObj.collision={X:"none",Y:"none"},d.popupWrapper.style.display=""):(d.popupObj.refreshPosition(d.lItem,!0),d.left=parseInt(d.popupWrapper.style.left,10),d.top=parseInt(d.popupWrapper.style.top,10),d.enableRtl&&(d.left=d.isNestedOrVertical?d.left-d.popupWrapper.offsetWidth-d.lItem.parentElement.offsetWidth+2:d.left-d.popupWrapper.offsetWidth+d.lItem.offsetWidth),d.template&&(d.isReact||d.isAngular)?requestAnimationFrame(function(){d.collision(),d.popupWrapper.style.display=""}):(d.collision(),d.popupWrapper.style.display=""));break;case"none":d.top=l.top,d.left=l.left;break;case"hamburger":l.cancel||(d.element.classList.remove("e-hide-menu"),d.triggerOpen(d.element))}if("hamburger"!==p)if(l.cancel)d.isMenu?(d.popupObj.destroy(),t.detach(d.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),d.navIdx.pop();else if(d.isMenu)if(d.hamburgerMode)d.popupWrapper.style.top=d.top+"px",d.popupWrapper.style.left="0px",d.toggleAnimation(d.popupWrapper);else{d.setBlankIconStyle(d.popupWrapper),d.wireKeyboardEvent(d.popupWrapper),t.rippleEffect(d.popupWrapper,{selector:"."+G}),d.popupWrapper.style.left=d.left+"px",d.popupWrapper.style.top=d.top+"px";var r="None"!==d.animationSettings.effect?{name:d.animationSettings.effect,duration:d.animationSettings.duration,timingFunction:d.animationSettings.easing}:null;d.popupObj.show(r,d.lItem)}else d.setBlankIconStyle(d.uList),d.setPosition(d.lItem,d.uList,d.top,d.left),d.toggleAnimation(d.uList);if("right"===d.keyType){var a=d.getUlByNavIdx();if(e.classList.remove(F),d.isMenu&&1===d.navIdx.length&&d.removeLIStateByClass([V],[d.getWrapper()]),e.classList.add(V),"enter"===d.action){var h={element:e,item:s,event:n};d.trigger("select",h)}e.focus(),a=d.getUlByNavIdx();var c=d.isValidLI(a.children[0],0,d.action);a.children[c].classList.add(F),a.children[c].focus()}})},n.prototype.collision=function(){var e;if(e=s.isCollide(this.popupWrapper,null,this.left,this.top),(this.isNestedOrVertical||this.enableRtl)&&(e.indexOf("right")>-1||e.indexOf("left")>-1)){this.popupObj.collision.X="none";var i=t.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth;this.left=this.enableRtl?s.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-i+2}((e=s.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")>-1||e.indexOf("right")>-1)&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},n.prototype.setBlankIconStyle=function(e){var t=[].slice.call(e.getElementsByClassName("e-blankicon"));if(t.length){var i=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"),s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},l=getComputedStyle(s),r=parseInt(l.fontSize,10);parseInt(l.width,10)&&parseInt(l.width,10)>r&&(r=parseInt(l.width,10));var o=r+parseInt(l[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=o})}}},n.prototype.checkScrollOffset=function(e){var i=this.getWrapper();if(i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length){var s=t.isNullOrUndefined(e)?this.element:t.closest(e.target,"."+G),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var l=n.scrollLeft+n.offsetWidth,r=s.offsetLeft+s.offsetWidth;l<r&&(n.scrollLeft+=r-l)}},n.prototype.setPosition=function(e,i,n,l){if(this.toggleVisiblity(i),i===this.element||l>-1&&n>-1){if((d=s.isCollide(i,null,l,n)).indexOf("right")>-1&&(l-=i.offsetWidth),d.indexOf("bottom")>-1){if((n=(o=this.callFit(i,!1,!0,n,l)).top-20)<0){var r=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;r>-1&&(n=r)}}if((d=s.isCollide(i,null,l,n)).indexOf("left")>-1){l=(o=this.callFit(i,!0,!1,n,l)).left}}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),l=Number(this.element.style.left.replace("px",""));else{var o,a=this.enableRtl?"left":"right";n=(o=s.calculatePosition(e,a,"top")).top,l=o.left;var d,h=(d=s.isCollide(i,null,this.enableRtl?l-i.offsetWidth:l,n)).indexOf("left")>-1||d.indexOf("right")>-1;h&&(l=(o=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||h)&&(l=this.enableRtl&&h?l:l-i.offsetWidth),d.indexOf("bottom")>-1&&(n=(o=this.callFit(i,!1,!0,n,l)).top)}this.toggleVisiblity(i,!1),i.style.top=n+"px",i.style.left=l+"px"},n.prototype.toggleVisiblity=function(e,t){void 0===t&&(t=!0),e.style.visibility=t?"hidden":"",e.style.display=t?"block":"none"},n.prototype.createItems=function(e){var s=this,n=this.navIdx?this.navIdx.length:0,l=this.getFields(n),r=this.hasField(e,this.getField("iconCss",n)),o={showIcon:r,moduleName:"menu",fields:l,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[l.id]]||(e.curData[e.fields[l.id]]=t.getUniqueID("menuitem")),e.curData.htmlAttributes={role:"menuitem",tabindex:"-1"},s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]),""===e.curData[e.fields[l.iconCss]]&&(e.curData[e.fields[l.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add(_),e.item.removeAttribute("role")),!r||e.curData[e.fields.iconCss]||e.curData[s.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length){var t=s.createElement("span",{className:"e-icons e-caret"});e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),s.isMenu||e.item.removeAttribute("role"),e.item.classList.add("e-menu-caret-icon")}s.isMenu&&s.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"));var i={item:e.curData,element:e.item};s.trigger("beforeItemRender",i)}};this.setProperties({items:this.items},!0),this.isMenu&&(o.templateID=this.element.id+"Template");var a=i.ListBase.createList(this.createElement,e,o,!this.template,this);return a.setAttribute("tabindex","0"),this.isMenu&&a.setAttribute("role","menu"),a},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i;var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),l=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(n){if((""!==n.id?r.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([F,V],[this.getWrapper()]),!this.navIdx.length)return;o=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([F],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([F],this.isMenu?[l].concat(this.getPopups()):[l]),s.classList.add(F),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([F],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||i.parentElement===n||t.closest(i,".e-"+this.getModuleName()+"-popup")||s&&(!s||this.getIndex(s.id,!0).length)||"Hover"===this.showSubMenuOn?o&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([F],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1)}},n.prototype.removeStateWrapper=function(){if(this.liTrgt){var e=t.closest(this.liTrgt,".e-menu-vscroll");"DIV"===this.liTrgt.tagName&&e&&this.removeLIStateByClass([F,V],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})},l=0;l<i.length;l++)n(l)},n.prototype.getField=function(e,t){void 0===t&&(t=0);var i=this.fields[e];return"string"==typeof i?i:i[t]?i[t].toString():i[i.length-1].toString()},n.prototype.getFields=function(e){return void 0===e&&(e=0),{id:this.getField("itemId",e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},n.prototype.menuHeaderClickHandler=function(e){t.closest(e.target,".e-menu-wrapper").querySelector("ul.e-menu-parent").id===this.element.id&&(this.element.className.indexOf("e-hide-menu")>-1?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){if(this.isTapHold)this.isTapHold=!1;else{var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),l=new RegExp("-ej2menu-(.*)-popup"),r=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&r&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===r.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([F],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&r&&this.isMenu){var a=r.id?l.exec(r.id)[1]:r.querySelector(".e-menu-parent").id;if(this.element.id!==a)return}if(o&&"click"===e.type&&!n.classList.contains(W)){this.setLISelected(n);var d=this.getIndex(n.id,!0),h={element:n,item:this.getItem(d),event:e};this.trigger("select",h)}if(o&&("mouseover"===e.type||t.Browser.isDevice||this.showItemOnClick)){var c=void 0;if(n.classList.contains(W)){c=i.children[this.navIdx.length-1],this.toggleAnimation(c);(f=this.getLIByClass(c,V))&&f.classList.remove(V),t.detach(n.parentNode),this.navIdx.pop()}else if(!n.classList.contains(_)){this.showSubMenu=!0;var p=n.parentNode;if(this.cliIdx=this.getIdx(p,n),this.isMenu||!t.Browser.isDevice){var u=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),t.closest(p,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,p);if(this.navIdx[u]===this.cliIdx&&(this.showSubMenu=!1),u!==this.navIdx.length&&("mouseover"!==e.type||this.showSubMenu)){var f;(f=this.getLIByClass(p,V))&&f.classList.remove(V),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&this.setLISelected(n),this.closeMenu(u+1,e),this.showItemOnClick&&this.setLISelected(n)}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if(this.isMenu&&"DIV"===s.tagName&&this.navIdx.length&&t.closest(s,".e-menu-vscroll")){var m=t.closest(s,"."+Z),v=Array.prototype.indexOf.call(this.getPopups(),m)+1;v<this.navIdx.length&&(this.closeMenu(v+1,e),m&&this.removeLIStateByClass([F,V],[m]))}else this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+G).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([V],[i]),n&&n.querySelector(".e-caret")||this.closeMenu(null,e))}},n.prototype.afterCloseMenu=function(e){var i;if(this.showSubMenu){i=this.showItemOnClick&&0===this.navIdx.length?t.closest(e.target,".e-menu-parent.e-control"):t.closest(this.element,".e-menu-parent.e-control");var s=this.navIdx.concat(this.cliIdx),n=this.getItem(s);if(n&&n[this.getField("children",s.length-1)]&&n[this.getField("children",s.length-1)].length?(("mouseover"===e.type||t.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&i||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,n,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!i){var l=this.getUlByNavIdx(),r=this.getLIByClass(l,V);r&&(r.setAttribute("aria-expanded","false"),r.classList.remove(V))}}this.keyType=""},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,V);t&&t.classList.remove(V),this.isMenu||e.classList.remove(F),e.classList.add(V)},n.prototype.getLIByClass=function(e,t){for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},n.prototype.getItemIndex=function(e,t){var i;i="string"==typeof e?e:e.id;var s=!1!==t;return this.getIndex(i,s)},n.prototype.setItem=function(e,t,i){var s;s=i?t||e.id:t||e.text;var n=this.getIndex(s,i),l=this.getItem(n);Object.assign(l,e)},n.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},n.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},n.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},n.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=Array.prototype.indexOf.call(e.children,t);return i&&e.children[0].classList.contains(W)&&s--,s},n.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:t.closest(e,"li.e-menu-item")},n.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},n.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},n.prototype.onPropertyChanged=function(e,i){for(var s=this,n=this.getWrapper(),l=function(l){switch(l){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.split(" "));break;case"enableRtl":n.classList.toggle("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var a;r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){a=t.select(".e-ul",e),o(s.createElement,e,a,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")?d(t.getInstance(h,B),h):d(t.getInstance(h,I),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,B),h),e.style.overflow=""})}break;case"items":var c=void 0,p=void 0,u=void 0;if(Object.keys(i.items).length){var f=Object.keys(e.items);for(m=0;m<f.length;m++)(p=r.getChangedItemIndex(e,[],Number(f[m]))).length<=r.getWrapper().children.length&&(c=p.pop(),u=r.getItems(p),r.insertAfter([u[c]],u[c].text),r.removeItem(u,p,c),r.setItems(u,p)),p.length=0}else{if(r.updateItem(r.element,r.items),r.enableScrolling&&r.element.parentElement.classList.contains("e-custom-scroll")&&(r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl)),!r.hamburgerMode)for(var m=1,v=n.childElementCount;m<v;m++)t.detach(n.lastElementChild);r.navIdx=[]}}},r=this,a=0,h=Object.keys(e);a<h.length;a++){l(h[a])}},n.prototype.updateItem=function(e,i){if(t.isBlazor()&&!this.isMenu)e=this.removeChildElement(e);else{if(this.enableScrolling){var s=this.getWrapper().children[0];this.element.classList.contains("e-vertical")?d(t.getInstance(s,B),s):d(t.getInstance(s,I),s)}e.innerHTML=""}[].slice.call(this.createItems(i).children).forEach(function(t){e.appendChild(t)})},n.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();if("items"===s){var n=e.items[i],l=Object.keys(n.items).pop();l&&this.getChangedItemIndex(n,t,Number(l))}else"isParentArray"===s&&t.length>1&&t.pop();return t},n.prototype.removeItem=function(e,i,s){e.splice(s,1);var n=this.getWrapper().children;i.length<n.length&&t.detach(n[i.length].children[s])},n.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var i=this.getWrapper();if(e){for(var n=void 0,l=void 0,r=t.selectAll(e),o=0,a=r.length;o<a;o++)n=r[o],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(l=t.getInstance(n,t.Touch))&&l.destroy():t.EventHandler.remove(n,"contextmenu",this.cmenuHandler);if(!this.isMenu){t.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var d=0,h=s.getScrollableParent(this.targetElement);d<h.length;d++){var c=h[d];t.EventHandler.remove(c,"scroll",this.scrollHandler)}}}t.Browser.isDevice||(t.EventHandler.remove(this.isMenu?document:i,"mouseover",this.delegateMoverHandler),t.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler)),t.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(i),this.rippleFn()},n.prototype.unWireKeyboardEvent=function(e){var i=t.getInstance(e,t.KeyboardEvents);i&&i.destroy()},n.prototype.toggleAnimation=function(e,t){var i=this;void 0===t&&(t=!0);var s,n;"None"!==this.animationSettings.effect&&t?this.animation.animate(e,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){i.hamburgerMode?(n=e.element.parentElement,e.element.style.position="absolute",s=n.offsetHeight,e.element.style.maxHeight=e.element.offsetHeight+"px",n.style.maxHeight=""):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){i.hamburgerMode&&(n.style.minHeight=s+e.element.offsetHeight+"px")},end:function(e){i.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",n.style.minHeight="",e.element.style.top="0px",e.element.children[0].focus(),i.triggerOpen(e.element.children[0])):i.end(e.element,t)}}):this.end(e,t)},n.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,i={element:e,parentItem:t,items:t?t.items:this.items};this.trigger("onOpen",i)},n.prototype.end=function(e,i){if(i){if(e.style.display="block",e.style.maxHeight="",this.triggerOpen(e),e.querySelector("."+F))e.querySelector("."+F).focus();else if(this.currentTarget&&!this.currentTarget.classList.contains("e-numerictextbox")&&!this.currentTarget.classList.contains("e-textbox")){var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];s?s.querySelector("."+V).focus():this.element.focus()}}else if(e===this.element){var n=this.getLIByClass(this.element,F);n&&n.classList.remove(F);var l=this.getLIByClass(this.element,V);l&&l.classList.remove(V),e.style.display="none"}else t.detach(e)},n.prototype.getPersistData=function(){return""},n.prototype.getWrapper=function(){return t.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},n.prototype.getIndex=function(e,t,i,s,n,l){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===l&&(l=0);var r;l=n?l+1:0;for(var o=0,a=i.length;o<a;o++){if(r=i[o],(t?r[this.getField("itemId",l)]:r[this.getField("text",l)])===e){s.push(o);break}if(r[this.getField("children",l)]&&r[this.getField("children",l)].length){if(-1!==(s=this.getIndex(e,t,r[this.getField("children",l)],s,!0,l))[s.length-1]){s.unshift(o);break}o!==a-1&&s.pop()}else o===a-1&&s.push(-1)}return n||-1!==s[0]?s:[]},n.prototype.enableItems=function(e,i,s){void 0===i&&(i=!0);for(var n,l,r,o,a=Q,d=0;d<e.length;d++){if(r=this.getIndex(e[d],s),this.navIdx.length){if(1!==r.length){o=!1;for(var h=0,c=r.length-1;h<c;h++)if(r[h]!==this.navIdx[h]){o=!0;break}if(o)continue}}else if(1!==r.length)continue;l=r.pop(),(n=this.getUlByNavIdx(r.length))&&(i?this.isMenu?(n.children[l].classList.remove(a),n.children[l].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.remove(a):n.children[l].classList.remove(a):this.isMenu?(n.children[l].classList.add(a),n.children[l].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.add(a):n.children[l].classList.add(a))}},n.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},n.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},n.prototype.showHideItems=function(e,i,s){for(var n,l,r,o=0;o<e.length;o++)l=(r=this.getIndex(e[o],s)).pop(),(n=this.getUlByNavIdx(r.length))&&(i?t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.add(J):n.children[l].classList.add(J):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.remove(J):n.children[l].classList.remove(J))},n.prototype.removeItems=function(e,i){for(var s,n,l,r=0;r<e.length;r++)s=(n=this.getIndex(e[r],i)).pop(),l=this.getItems(n),t.isNullOrUndefined(s)||this.removeItem(l,n,s)},n.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},n.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},n.prototype.insertItems=function(e,i,s,n){void 0===n&&(n=!0);for(var l,r,o,a,d,h=0;h<e.length;h++){r=(o=this.getIndex(i,s)).pop(),a=this.getItems(o),d=new ee(a[0],"items",e[h],!0),a.splice(n?r+1:r,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(o.length<c.length){r=n?r+1:r,l=this.createItems(a).children[r];var p=this.isMenu?t.select(".e-menu-parent",c[o.length]):c[o.length];p.insertBefore(l,p.children[r])}}},n.prototype.removeAttributes=function(){var e=this;["top","left","display","z-index"].forEach(function(t){e.element.style.removeProperty(t)}),["role","tabindex","class","style"].forEach(function(t){"class"===t&&e.element.classList.contains("e-menu-parent")&&e.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(t)&&e.element.getAttribute(t)||e.element.removeAttribute(t),e.isMenu&&"class"===t&&e.element.classList.contains("e-vertical")&&e.element.classList.remove("e-vertical")})},n.prototype.destroy=function(){var i=this.getWrapper();if(i){if(this.unWireEvents(),this.isMenu)this.closeMenu(),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),i.parentNode.insertBefore(this.element,i),this.clonedElement=null;else{if(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName)t.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement;else if(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)){var s=this.clonedElement.nextElementSibling;s&&s!==i?this.clonedElement.parentElement.insertBefore(this.element,s):this.clonedElement.parentElement.appendChild(this.element),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",t.append([].slice.call(this.clonedElement.children),this.element),t.detach(this.clonedElement),this.removeAttributes()}this.clonedElement=null}this.isMenu&&this.clonedElement?(t.detach(this.element),i.style.display="",i.classList.remove("e-"+this.getModuleName()+"-wrapper"),i.removeAttribute("data-ripple")):t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}this.rippleFn=null},q([t.Event()],n.prototype,"beforeItemRender",void 0),q([t.Event()],n.prototype,"beforeOpen",void 0),q([t.Event()],n.prototype,"onOpen",void 0),q([t.Event()],n.prototype,"beforeClose",void 0),q([t.Event()],n.prototype,"onClose",void 0),q([t.Event()],n.prototype,"select",void 0),q([t.Event()],n.prototype,"created",void 0),q([t.Property("")],n.prototype,"cssClass",void 0),q([t.Property(0)],n.prototype,"hoverDelay",void 0),q([t.Property(!1)],n.prototype,"showItemOnClick",void 0),q([t.Property("")],n.prototype,"target",void 0),q([t.Property("")],n.prototype,"filter",void 0),q([t.Property(null)],n.prototype,"template",void 0),q([t.Property(!1)],n.prototype,"enableScrolling",void 0),q([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),q([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},$)],n.prototype,"fields",void 0),q([t.Collection([],ee)],n.prototype,"items",void 0),q([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},te)],n.prototype,"animationSettings",void 0),n=q([t.NotifyPropertyChanges],n)}(t.Component),se=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ne=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},le="e-vertical",re="e-toolbar-items",oe="e-toolbar-item",ae="e-rtl",de="e-separator",he="e-popup-up-icon",ce="e-popup-down-icon",pe="e-overlay",ue="e-popup-text",fe="e-overflow-show",me="e-overflow-hide",ve="e-hor-nav",ge="e-toolbar-center",ye="e-tbar-pos",be="e-toolbar-pop",Ce="e-toolbar-popup",xe="e-nav-active",Ee="e-ignore",Ne="e-popup-alone",Ie="e-hidden",Se="e-toolbar-multirow",Oe="e-multirow-separator",we="e-extended-separator",ke="e-extended-toolbar",Le="e-toolbar-extended",Ae="e-tbar-extended",Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),ne([t.Property("")],i.prototype,"id",void 0),ne([t.Property("")],i.prototype,"text",void 0),ne([t.Property("auto")],i.prototype,"width",void 0),ne([t.Property("")],i.prototype,"cssClass",void 0),ne([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),ne([t.Property(!1)],i.prototype,"disabled",void 0),ne([t.Property("")],i.prototype,"prefixIcon",void 0),ne([t.Property("")],i.prototype,"suffixIcon",void 0),ne([t.Property(!0)],i.prototype,"visible",void 0),ne([t.Property("None")],i.prototype,"overflow",void 0),ne([t.Property("")],i.prototype,"template",void 0),ne([t.Property("Button")],i.prototype,"type",void 0),ne([t.Property("Both")],i.prototype,"showTextOn",void 0),ne([t.Property(null)],i.prototype,"htmlAttributes",void 0),ne([t.Property("")],i.prototype,"tooltipText",void 0),ne([t.Property("Left")],i.prototype,"align",void 0),ne([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),De=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.resizeContext=s.resize.bind(s),s.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return se(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular)&&this.clearTemplate();var s=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(s).forEach(function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.ej2_instances)||t.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),t.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach(function(e){return i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},i.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(le),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,ae)},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),this.allowKeyboard&&this.wireKeyboardEvent()},i.prototype.wireKeyboardEvent=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),t.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.element.setAttribute("tabIndex","0")},i.prototype.unwireKeyboardEvent=function(){this.keyModule&&(t.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},i.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var i=!t.isNullOrUndefined(this.popObj)&&t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&i&&this.popObj.hide({name:"FadeOut",duration:100});(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(document,"scroll",this.docEvent),t.EventHandler.remove(document,"click",this.docEvent)},i.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},i.prototype.docEvent=function(e){var i=t.closest(e.target,".e-popup");this.popObj&&t.isVisible(this.popObj.element)&&!i&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},i.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ye),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+oe)).forEach(function(e){t.detach(e)}),this.tbarAlign){var e=this.element.querySelector("."+re);[].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,ye)}this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,ae),this.destroyScroll()),this.remove(this.element,Ae),this.remove(this.element,ke);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,Se),this.popObj&&this.popupRefresh(this.popObj.element,!0)},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},i.prototype.clstElement=function(e,i){return e&&this.popObj&&t.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+oe):this.element===i||e?this.element.querySelector("."+oe+":not(."+pe+" ):not(."+de+" ):not(."+Ie+" )"):t.closest(i,"."+oe)},i.prototype.keyHandling=function(e,i,s,n,l){var r,o,a=this.popObj,d=this.element,h={name:"FadeOut",duration:100},c="moveUp"===i.action?"previous":"next";switch(i.action){case"moveRight":if(this.isVertical)return;d===s?this.elementFocus(e):n||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;n||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var p=t.closest(e,".e-popup"),u=this.element.querySelector("."+Le);"Extended"===this.overflowMode&&u&&u.classList.contains("e-popup-open")&&(p="end"===i.action?u:null),p?t.isVisible(this.popObj.element)&&(o=[].slice.call(p.children),r="home"===i.action?o[0]:o[o.length-1]):(o=this.element.querySelectorAll("."+re+" ."+oe+":not(."+de+")"),r="home"===i.action?o[0]:o[o.length-1]),r&&this.elementFocus(r)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(a&&t.closest(s,".e-popup")){var f=a.element,m=f.firstElementChild;if("previous"===c&&m===e||"next"===c&&f.lastElementChild===e)return;this.eleFocus(e,c)}else"moveDown"===i.action&&a&&t.isVisible(a.element)&&this.elementFocus(e);break;case"tab":if(!l&&!n){var v=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(v),v.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":a&&"Extended"!==this.overflowMode&&a.hide(h);break;case"popupOpen":if(!n)return;a&&!t.isVisible(a.element)?(a.element.style.top=d.offsetHeight+"px",a.show({name:"FadeIn",duration:100})):a.hide(h)}},i.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains(pe)){e.preventDefault();var i=t.classList.contains(ve),s=t.classList.contains("e-scroll-nav"),n=this.clstElement(i,t);(n||s)&&this.keyHandling(n,e,t,i,s)}},i.prototype.disable=function(e){var i=this.element;e?i.classList.add(pe):i.classList.remove(pe),i.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),i.querySelector("#"+i.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},i.prototype.eleContains=function(e){return e.classList.contains(de)||e.classList.contains(pe)||e.getAttribute("disabled")||e.classList.contains(Ie)||!t.isVisible(e)},i.prototype.eleFocus=function(e,i){var s=Object(e)[i+"ElementSibling"];if(s){if(this.eleContains(s))return void this.eleFocus(s,i);this.elementFocus(s)}else if(this.tbarAlign){var n=Object(e.parentElement)[i+"ElementSibling"];if(t.isNullOrUndefined(n)||0!==n.children.length||(n=Object(n)[i+"ElementSibling"]),!t.isNullOrUndefined(n)&&n.children.length>0)if("next"===i){var l=n.querySelector("."+oe);this.eleContains(l)?this.eleFocus(l,i):(l.firstElementChild.focus(),this.activeEleSwitch(l))}else{l=n.lastElementChild;this.eleContains(l)?this.eleFocus(l,i):this.elementFocus(l)}}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,l=!t.isNullOrUndefined(t.closest(s,"."+be)),r=s.classList,o=t.closest(s,"."+ve);o||(o=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!r.contains(ve)||(r=s.querySelector(".e-icons").classList),(r.contains(he)||r.contains(ce))&&this.popupClickHandler(n,o,ae);var a,d=t.closest(e.target,"."+oe);if(!t.isNullOrUndefined(d)&&!d.classList.contains(pe)||o.classList.contains(ve)){if(d){a=this.items[this.tbarEle.indexOf(d)]}var h={originalEvent:e,item:a};a&&!t.isNullOrUndefined(a.click)&&this.trigger("items["+this.tbarEle.indexOf(d)+"].click",h),h.cancel||this.trigger("clicked",h,function(e){!t.isNullOrUndefined(i.popObj)&&l&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})}},i.prototype.popupClickHandler=function(e,i,s){var n=this.popObj;t.isVisible(n.element)?(i.classList.remove(xe),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(s)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(s)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(n.element.style.minHeight="0px"),i.classList.add(xe),n.show({name:"FadeIn",duration:100}))},i.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);"msie"===t.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||t.setStyleAttribute(this.element,{height:i}),t.setStyleAttribute(this.element,{width:e});var s={role:"toolbar","aria-disabled":"false","aria-haspopup":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};t.attributes(this.element,s),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},i.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},i.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},i.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[n],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[n],t,n),(s=t.querySelector(".e-toolbar-"+e[n].align.toLowerCase()))?(e[n].showAlwaysInPopup&&"Show"!==e[n].overflow||this.tbarAlgEle[(e[n].align+"s").toLowerCase()].push(i),s.appendChild(i)):t.appendChild(i);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},i.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(le),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(le),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),t.setStyleAttribute(this.element,{height:t.formatUnit(this.height),width:t.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},i.prototype.initScroll=function(e,i){!this.scrollModule&&this.checkOverflow(e,i[0])&&(this.tbarAlign&&this.element.querySelector("."+re+" ."+ge).removeAttribute("style"),this.isVertical?this.scrollModule=new B({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new I({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.cssClass&&t.addClass([i[0]],this.cssClass.split(" ")),this.remove(this.scrollModule.element,ye),t.setStyleAttribute(this.element,{overflow:"hidden"}))},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+oe,e)).forEach(function(e){t.isVisible(e)&&(i=window.getComputedStyle(e),n+=s.isVertical?e.offsetHeight:e.offsetWidth,n+=parseFloat(s.isVertical?i.marginTop:i.marginRight),n+=parseFloat(s.isVertical?i.marginBottom:i.marginLeft))}),n},i.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},i.prototype.checkOverflow=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||!t.isVisible(e))return!1;var s=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?i.offsetHeight:i.offsetWidth;(this.tbarAlign||this.scrollModule||s===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(i):i));var l=e.querySelector("."+ve),r=e.querySelector(".e-scroll-nav"),o=0;return l?o=this.isVertical?l.offsetHeight:l.offsetWidth:r&&(o=this.isVertical?2*r.offsetHeight:2*r.offsetWidth),n>s-o},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ye),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+re),s=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===t.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":t.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(re)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,i)||s)&&this.setOverflowAttributes(e),this.toolbarAlign(i);break;case"MultiRow":this.add(i,Se),this.checkOverflow(e,i)&&this.tbarAlign&&(this.removePositioning(),this.add(i,"e-multirow-pos")),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==t.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,ke),(this.checkOverflow(e,i)||s)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(i)}},i.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(t.selectAll("."+re+" ."+oe,e))),this.element.querySelector("."+ve).setAttribute("tabIndex","0"),this.element.querySelector("."+ve).setAttribute("role","list")},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+de)),i=e.querySelector("."+Oe),s=e.querySelector("."+we),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove(Oe):"Extended"===this.overflowMode&&n.classList.remove(we));for(var l=0;l<=t.length-1;l++)t[l].offsetLeft<30&&0!==t[l].offsetLeft&&("MultiRow"===this.overflowMode?t[l].classList.add(Oe):"Extended"===this.overflowMode&&t[l].classList.add(we))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector("."+ve),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector("."+ve);var l=n?s.offsetHeight:s.offsetWidth,r=(n?e.offsetHeight:e.offsetWidth)-l;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,r,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,l){var r=e.element,o=[].slice.call(t.selectAll("."+Ce,r.querySelector("."+re))),a=t.selectAll("."+fe,s),d=0,h=0;o.forEach(function(r,o){a=t.selectAll("."+fe,s),r.classList.contains(fe)&&a.length>0?e.tbResize&&a.length>o?(s.insertBefore(r,a[o]),++h):(s.insertBefore(r,s.children[a.length]),++h):r.classList.contains(fe)?(s.insertBefore(r,s.firstChild),++h):e.tbResize&&r.classList.contains(me)&&s.children.length>0&&0===a.length?(s.insertBefore(r,s.firstChild),++h):r.classList.contains(me)?i.push(r):e.tbResize?(s.insertBefore(r,s.childNodes[d+h]),++d):s.appendChild(r),r.classList.contains(de)?t.setStyleAttribute(r,{display:"",height:l+"px"}):t.setStyleAttribute(r,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+oe,r.querySelector("."+re)),p=c.length-1;p>=0;p--){var u=c[p];if(!u.classList.contains(de)||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,i,s=this.element;"Extended"===this.overflowMode&&(i=s.querySelector("."+de+":not(."+Ce+")"),e="auto"===s.style.height||""===s.style.height?null:i.offsetHeight);var n,l=s.querySelector("."+oe+":not(."+de+"):not(."+Ce+")"),r="auto"===s.style.height||""===s.style.height?null:l&&l.offsetHeight;if(t.select("#"+s.id+"_popup."+be,s))n=t.select("#"+s.id+"_popup."+be,s);else{var o=this.createElement("div",{id:s.id+"_popup",className:be+" "+Le}),a=this.createElement("div",{id:s.id+"_popup",className:be});n="Extended"===this.overflowMode?o:a}this.pushingPoppedEle(this,[],n,r,e),this.popupInit(s,n)},i.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},i.prototype.popupInit=function(e,i){if(this.popObj){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(i),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),t.setStyleAttribute(this.element,{overflow:""});var l=window.getComputedStyle(this.element),r=new s.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if(r.appendTo(i),"Extended"===this.overflowMode&&(r.width=parseFloat(l.width)+2*parseFloat(l.borderRightWidth),r.offsetX=0),t.EventHandler.add(document,"scroll",this.docEvent.bind(this)),t.EventHandler.add(document,"click ",this.docEvent.bind(this)),r.element.style.maxHeight=r.element.offsetHeight+"px",this.isVertical&&(r.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector("."+ve);o.classList.add(xe),t.classList(o.firstElementChild,[he],[ce]),this.element.querySelector("."+Le).classList.add("e-popup-open")}else r.hide();this.popObj=r,this.element.setAttribute("aria-haspopup","true")}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,Ae):this.remove(this.element,Ae))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,l=this.popObj.element.parentElement,r=l.querySelector("."+ve);t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px","Extended"===this.overflowMode&&(i.element.style.minHeight="");var o=n.offsetTop+n.offsetHeight+s.calculatePosition(l).top,a=r.firstElementChild;r.classList.add(xe),t.classList(a,[he],[ce]),this.tbarPopupHandler(!0);var d=t.isNullOrUndefined(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+d<o&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(o-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[c];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical){var u=this.element.getBoundingClientRect();t.setStyleAttribute(i.element,{maxHeight:u.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(i){var f=n.getBoundingClientRect();f.right>document.documentElement.clientWidth&&f.width>l.getBoundingClientRect().width&&(i.collision={Y:"none"},i.dataBind()),i.refreshPosition()}},i.prototype.popupClose=function(e){var i=this.element.querySelector("."+ve),s=i.firstElementChild;i.classList.remove(xe),t.classList(s,[ce],[he]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var l,r=this.popupPriCount>0,o=s,a=0,d=0,h=0,c=function(e,t){var i=!1;return t.forEach(function(t){e.classList.contains(t)&&(i=!0)}),i},p=i.length-1;p>=0;p--){var u=void 0,f=window.getComputedStyle(i[p]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[p]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),l=this.isVertical?i[p].offsetHeight:i[p].offsetWidth;var v=m?l+u:l;if(c(i[p],[Ne])&&r&&(i[p].classList.add(Ce),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++),this.isVertical?i[p].offsetTop+i[p].offsetHeight+u>s:i[p].offsetLeft+i[p].offsetWidth+u>s){if(i[p].classList.contains(de)){if("Extended"===this.overflowMode){if(d===h){c(g=i[p],[de,Ee])&&(i[p].classList.add(Ce),h++)}d++}else if("Popup"===this.overflowMode){if(a>0&&d===h){var g;c(g=i[p+d+(a-1)],[de,Ee])&&t.setStyleAttribute(g,{display:"none"})}a++,d=0,h=0}}else d++;i[p].classList.contains(fe)&&n?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:c(i[p],[de,Ee])?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:(i[p].classList.add(Ce),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++)}}if(n){var y=t.selectAll("."+oe+":not(."+Ce+")",this.element);this.checkPriority(e,y,o,!1)}},i.prototype.createPopupIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-hor-nav");s="Extended"===this.overflowMode?s+" e-expended-nav":s;var n=this.createElement("div",{id:i,className:s});"msie"!==t.Browser.info.name&&"edge"!==t.Browser.info.name||n.classList.add("e-ie-align");var l=this.createElement("div",{className:ce+" e-icons"});n.appendChild(l),n.setAttribute("tabindex","0"),n.setAttribute("role","list"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,l,r,o,a){var d=a,h=this.popObj.element,c=t.selectAll("."+Ce+":not(."+fe+")",h).length,p=function(e,t){return e.classList.contains(t)};if(0===t.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length){var u=e.children[i-(i-s)-1],f=!t.isNullOrUndefined(u)&&p(u,Ee);if(!t.isNullOrUndefined(u)&&p(u,de)&&!t.isVisible(u)||f){u.style.display="inherit";var m=u.offsetWidth+2*parseFloat(window.getComputedStyle(u).marginRight),v=u.previousElementSibling;r+m<o||l?(e.insertBefore(n,e.children[i+d-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):v.classList.contains(de)&&(v.style.display="none"),u.style.display=""}else e.insertBefore(n,e.children[i+d-(i-s)])}else e.insertBefore(n,e.children[i+d-c])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,l=this.isVertical,r=n.querySelector("."+re),o=n.querySelector("."+ve);if(!t.isNullOrUndefined(o)){r.removeAttribute("style"),e.style.display="block";var a;a=l?n.offsetHeight-(o.offsetHeight+r.offsetHeight):n.offsetWidth-(o.offsetWidth+r.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),a+(l?o.offsetHeight:o.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(a,e,i),e.style.display="",0===e.children.length&&o&&this.popObj&&(t.detach(o),o=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null,n.setAttribute("aria-haspopup","false"))}},i.prototype.ignoreEleFetch=function(e,t){var i=[].slice.call(t.querySelectorAll("."+Ee)),s=[],n=0;return i.length>0?(i.forEach(function(e){s.push([].slice.call(t.children).indexOf(e))}),s.forEach(function(t){t<=e&&n++}),n):0},i.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var s=e.offsetWidth-e.querySelector("."+ve).offsetWidth,n=e.querySelector("."+re).offsetWidth;return t.style.removeProperty("display"),s>i+n},i.prototype.popupEleWidth=function(e){e.style.position="absolute";var i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains(ue)){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains(ue)?s.style.display="none":!t.isNullOrUndefined(s)&&e.classList.contains("e-toolbar-text")&&(s.style.display="block"),n.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),n.style.minWidth="",n.style.minHeight="",t.isNullOrUndefined(s)||(s.style.display="")}return i},i.prototype.popupEleRefresh=function(e,i,s){for(var n,l,r=this.popupPriCount>0,o=this.tbarEle,a=this.element.querySelector("."+re),d=0,h=function(i){if(i.classList.contains(Ne)&&r&&!s)return"continue";var h=c.popupEleWidth(i);if(i===c.tbarEle[0]&&(h+=c.tbarEleMrgn),i.style.position="",!(h<e||s))return"break";if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains(me)||i.classList.remove(Ce),l=c.tbarEle.indexOf(i),c.tbarAlign){var p=c.items[l].align;l=c.tbarAlgEle[(p+"s").toLowerCase()].indexOf(i),o=c.tbarAlgEle[(p+"s").toLowerCase()],a=c.element.querySelector("."+re+" .e-toolbar-"+p.toLowerCase())}var u=0;"Extended"!==c.overflowMode&&o.slice(0,l).forEach(function(t){(t.classList.contains(fe)||t.classList.contains(de))&&(t.classList.contains(de)&&(t.style.display="",e-=t.offsetWidth),u++)}),d=c.ignoreEleFetch(l,a),i.classList.contains(fe)?(c.tbarPriRef(a,l,u,i,s,h,e,d),e-=i.offsetWidth):0===l?(a.insertBefore(i,a.firstChild),e-=i.offsetWidth):(n=t.selectAll("."+fe,c.popObj.element).length,a.insertBefore(i,a.children[l+d-n]),e-=i.offsetWidth),i.style.height=""},c=this,p=0,u=[].slice.call(i.children);p<u.length;p++){if("break"===h(u[p]))break}this.checkOverflow(this.element,this.element.getElementsByClassName(re)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+re);if(!t.isNullOrUndefined(e)&&e.classList.contains(ye)){this.remove(e,ye);var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+re);this.add(e,ye),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+re);if(!t.isNullOrUndefined(i)&&i.classList.contains(ye)){var s,n=this.element.querySelector("."+ve);if(this.scrollModule){var l=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+l).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var r=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){r-=this.isVertical?n.offsetHeight:n.offsetWidth;var o=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=o:s[2].style.bottom=o:this.enableRtl?s[2].style.left=o:s[2].style.right=o}if(!(r<=e)){var a=(r-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+a+"px";this.isVertical?this.enableRtl?s[1].style.marginBottom=d:s[1].style.marginTop=d:this.enableRtl?s[1].style.marginRight=d:s[1].style.marginLeft=d}}},i.prototype.tbarItemAlign=function(e,t,i){var s=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var n=[];if(n.push(this.createElement("div",{className:"e-toolbar-left"})),n.push(this.createElement("div",{className:ge})),n.push(this.createElement("div",{className:"e-toolbar-right"})),0===i&&"Left"!==e.align)n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ye);else if("Left"!==e.align){var l=t.childNodes,r=n[0];[].slice.call(l).forEach(function(e){s.tbarAlgEle.lefts.push(e),r.appendChild(e)}),t.appendChild(r),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,ye)}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,re),this.tbarEle=[];[].slice.call(this.trgtEle.children).forEach(function(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,oe))})},i.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var i=void 0;e&&e.children.length>0&&(i=e.querySelector("."+re)),i||(i=this.createElement("div",{className:re})),this.itemsAlign(t,i),e.appendChild(i)}},i.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[n])?this.add(t,e[i]):t.setAttribute(i,e[i])},i.prototype.enableItems=function(e,i){var s,n=e,l=n.length;t.isNullOrUndefined(i)&&(i=!0);var r=function(e,t){e?(t.classList.remove(pe),t.setAttribute("aria-disabled","false")):(t.classList.add(pe),t.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(l)&&l>=1){for(var o=0,a=[].slice.call(n);o<l;o++){var d=a[o];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[o]=s}else s=d;r(i,s)}i?t.removeClass(n,pe):t.addClass(n,pe)}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;r(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]:null},i.prototype.addItems=function(e,i){var s;this.extendedOpen();var n=this.element.querySelector("."+re);if(t.isNullOrUndefined(n))this.itemsRerender(e);else{var l,r="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var o=0,a=e;o<a.length;o++){var d=a[o];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+oe,this.element),d.align=r,l=this.renderSubComponent(d,i),this.tbarEle.length>=i&&s.length>=0){t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var h="L"===d.align[0]?0:"C"===d.align[0]?1:2,c=void 0;this.tbarAlign||"Left"===r?this.tbarAlign?((c=t.closest(s[0],"."+re).children[h]).insertBefore(l,c.children[i]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,l),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+re,this.element))[0].appendChild(l):s[0].parentNode.insertBefore(l,s[i]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+re).children[h]).appendChild(l),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(l),this.refreshPositioning()),this.items.splice(i,0,d),d.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(i,0,l),i++,this.offsetWid=n.offsetWidth}}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},i.prototype.removeItems=function(e){var i,s=e,n=[].slice.call(t.selectAll("."+oe,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var l=0,r=[].slice.call(s);l<r.length;l++){var o=r[l];i=this.tbarEle.indexOf(o),this.removeItemByIndex(i,n),n=t.selectAll("."+oe,this.element)}else{o=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(o),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[e]&&i[e]){var s=this.tbarEle.indexOf(i[e]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].indexOf(this.tbarEle[s]);this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].splice(n,1)}this.isReact&&this.clearTemplate();var l=i[e].querySelector(".e-control.e-btn");t.isNullOrUndefined(l)||t.isNullOrUndefined(l.ej2_instances[0])||l.ej2_instances[0].isDestroyed||l.ej2_instances[0].destroy(),t.detach(i[e]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var l,r=s.type,o=e;if("object"==typeof e&&(l="function"==typeof o.appendTo),"string"!=typeof e&&l){if("Input"===r){c=this.createElement("input");s.id?c.id=s.id:c.id=t.getUniqueID("tbr-ipt"),i.appendChild(c),o.appendTo(c)}}else{var a=void 0,d=e,h=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);d="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName))if("string"==typeof e&&h.test(d))i.innerHTML=d;else if(document.querySelectorAll(d).length){var c,p=(c=document.querySelector(d)).outerHTML.trim();i.appendChild(c),c.style.display="",t.isNullOrUndefined(p)||this.tempId.push(d)}else a=t.compile(d);else i.appendChild(e)}catch(e){a=t.compile(d)}var u=void 0;if(!t.isNullOrUndefined(a)){var f=this.element.id+n+"_template";u=a({},this,"template",f,this.isStringTemplate)}!t.isNullOrUndefined(u)&&u.length>0&&[].slice.call(u).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template"),this.tbarEle.push(i)},i.prototype.buttonRendering=function(e,i){var s=this.createElement("button",{className:"e-tbar-btn"});s.setAttribute("type","button");var l,r,o=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var a=this.createElement("span",{className:"e-tbar-btn-text"});o?(a.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o,s.appendChild(a),s.classList.add("e-tbtn-txt")):this.add(i,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(l=e.prefixIcon+" e-icons",r="Left"):(l=e.suffixIcon+" e-icons",r="Right"));var d=new n.Button({iconCss:l,iconPosition:r});return d.createElement=this.createElement,d.appendTo(s),e.width&&t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),s},i.prototype.renderSubComponent=function(e,i){var s,n=this.createElement("div",{className:oe});n.setAttribute("aria-disabled","false");var l=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",l.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,i);else switch(e.type){case"Button":(s=this.buttonRendering(e,n)).setAttribute("tabindex","-1"),s.setAttribute("aria-label",e.text||e.tooltipText),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,de)}if(e.showTextOn){var r=e.showTextOn;"Toolbar"===r?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===r&&this.add(n,ue)}if(e.overflow){var o=e.overflow;"Show"===o?this.add(n,fe):"Hide"===o&&(n.classList.contains(de)||this.add(n,me))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains(de)&&(this.add(n,Ne),this.popupPriCount++),e.disabled&&this.add(n,pe),!1===e.visible&&this.add(n,Ie),n},i.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){t.isNullOrUndefined(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"toolbar"},i.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var i=this.checkOverflow(e,e.getElementsByClassName(re)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+re);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,ye))}if(!i||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var n=window.getComputedStyle(this.element);this.popObj.width=parseFloat(n.width)+2*parseFloat(n.borderRightWidth)}this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()}this.element.querySelector(".e-hscroll-bar")&&(this.scrollStep=this.element.querySelector(".e-hscroll-bar").offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator()}},i.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Le);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.onPropertyChanged=function(e,i){var s=this.element,n=s.offsetWidth;this.extendedOpen();for(var l=0,r=Object.keys(e);l<r.length;l++){switch(r[l]){case"items":if(e.items instanceof Array&&i.items instanceof Array)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=Object(e.items[d])[h];if("function"!=typeof c){if(this.tbarAlign||"align"===h){this.refresh(),this.trigger("created");break}var p="showAlwaysInPopup"===h&&!c,u="overflow"===h&&0!==this.popupPriCount;(p||this.items[d].showAlwaysInPopup&&u)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var f=[].slice.call(t.selectAll("."+re+" ."+oe,s));this.isReact&&this.clearTemplate(),t.detach(f[d]),this.tbarEle.splice(d,1),this.addItems([this.items[d]],d),this.items.splice(d,1),this.items[d].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.renderOverflowMode(),this.popObj&&n<s.offsetWidth&&this.popupRefresh(this.popObj.element,!1);break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(s,ae),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,ae):this.remove(s,ae),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,ae):this.remove(this.scrollModule.element,ae)),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,ae):this.remove(this.popObj.element,ae)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}}},i.prototype.hideItem=function(e,i){var s,n,l="object"==typeof e,r=e,o=[].slice.call(t.selectAll("."+oe,this.element));if(l)n=e;else if(this.tbarEle[r]){n=[].slice.call(t.selectAll("."+oe,this.element))[r]}if(n){if(i?n.classList.add(Ie):n.classList.remove(Ie),i&&t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains(de)){if(t.isNullOrUndefined(n.firstElementChild.getAttribute("tabindex"))){n.firstElementChild.setAttribute("tabindex","-1");var a=[].slice.call(t.selectAll("."+oe,this.element));l&&(r=a.indexOf(n));for(var d=a[++r];d;){if(!this.eleContains(d)){d.firstElementChild.removeAttribute("tabindex");break}d=a[++r]}}}else if(t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains(de))for(var h=!1,c=!1,p=o[s=0];p;)if(p.classList.contains(de))p=o[++s];else if(t.isNullOrUndefined(p.firstElementChild.getAttribute("tabindex")))p.firstElementChild.setAttribute("tabindex","-1"),h=!0;else{if(h&&c)break;this.eleContains(p)||(p.firstElementChild.removeAttribute("tabindex"),c=!0),p=o[++s]}this.refreshOverflow()}},ne([t.Collection([],Pe)],i.prototype,"items",void 0),ne([t.Property("auto")],i.prototype,"width",void 0),ne([t.Property("auto")],i.prototype,"height",void 0),ne([t.Property("")],i.prototype,"cssClass",void 0),ne([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),ne([t.Property()],i.prototype,"scrollStep",void 0),ne([t.Property(!0)],i.prototype,"enableCollision",void 0),ne([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),ne([t.Property(!0)],i.prototype,"allowKeyboard",void 0),ne([t.Event()],i.prototype,"clicked",void 0),ne([t.Event()],i.prototype,"created",void 0),ne([t.Event()],i.prototype,"destroyed",void 0),ne([t.Event()],i.prototype,"beforeCreate",void 0),i=ne([t.NotifyPropertyChanges],i)}(t.Component),Te=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Me=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},He="e-acrdn-root",Ue="e-accordion",Re="e-acrdn-item",Be="e-acrdn-header",je="e-acrdn-header-content",qe="e-acrdn-panel",Fe="e-acrdn-content",We="e-toggle-icon",Ve="e-content-hide",_e="e-selected",ze="e-active",Ke="e-overlay",Ye="e-toggle-animation",Xe="e-expand-state",Ge="e-accordion-container",Qe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Property("SlideDown")],i.prototype,"effect",void 0),Me([t.Property(400)],i.prototype,"duration",void 0),Me([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Je=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},Qe)],i.prototype,"collapse",void 0),Me([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},Qe)],i.prototype,"expand",void 0),i}(t.ChildProperty),Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Property(null)],i.prototype,"content",void 0),Me([t.Property(null)],i.prototype,"header",void 0),Me([t.Property(null)],i.prototype,"cssClass",void 0),Me([t.Property(null)],i.prototype,"iconCss",void 0),Me([t.Property(!1)],i.prototype,"expanded",void 0),Me([t.Property(!0)],i.prototype,"visible",void 0),Me([t.Property(!1)],i.prototype,"disabled",void 0),Me([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),$e=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},s}return Te(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var s=this.element;if(e.prototype.destroy.call(this),this.unwireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(s.children).forEach(function(e){s.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)s.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}s.classList.remove(He),s.removeAttribute("style"),["aria-disabled","aria-multiselectable","role","data-ripple"].forEach(function(e){i.element.removeAttribute(e)}),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+qe);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Ue)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(He),this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);t.setStyleAttribute(this.element,{width:e,height:i});t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),t.attributes(this.element,{"aria-disabled":"false",role:"presentation","aria-multiselectable":"true"}),"Single"===this.expandMode&&this.element.setAttribute("aria-multiselectable","false")},i.prototype.renderControl=function(){this.trgtEle=this.element.children.length>0?t.select("div",this.element):null,this.renderItems(),this.initItemExpand()},i.prototype.wireFocusEvents=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+Re));e<i.length;e++){var s=i[e],n=s.querySelector("."+Be);s.childElementCount>0&&n&&(t.EventHandler.clearEvents(n),t.EventHandler.add(n,"focus",this.focusIn,this),t.EventHandler.add(n,"blur",this.focusOut,this))}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+Be})),this.isNested||(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},i.prototype.templateParser=function(e){if(e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},i.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},i.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},i.prototype.getItemTemplate=function(){return this.itemTemplateFn},i.prototype.focusIn=function(e){e.target.parentElement.classList.add("e-item-focus")},i.prototype.focusOut=function(e){e.target.parentElement.classList.remove("e-item-focus")},i.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e,i=t.select("."+Ge,this.element);e=i?i.children:this.element.children;var s=[];[].slice.call(e).forEach(function(e){s.push({header:e.childElementCount>0&&e.children[0]?e.children[0]:"",content:e.childElementCount>1&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),i&&this.element.removeChild(i),this.setProperties({items:s},!0)},i.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:We}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},i.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[t]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),this.dataSource.length>0)this.dataSource.forEach(function(e,l){i=s.renderInnerItem(e,l),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+Be),"blur",s.focusOut,s))});else{var l=this.items;n&&l.length>0&&l.forEach(function(i,l){e=s.renderInnerItem(i,l),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+Be),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=e.target,n=this.getItems(),l={};if(t.closest(s,"."+Ue)===this.element){s.classList.add("e-target");var r=t.closest(s,"."+Re),o=t.closest(s,"."+Be),a=t.closest(s,"."+qe);r&&(t.isNullOrUndefined(o)||t.isNullOrUndefined(a))&&(o=r.children[0],a=r.children[1]),o&&(i=t.select("."+We,o));var d;o?d=t.closest(o,"."+Re):a&&(d=t.closest(a,"."+Re));var h=this.getIndexByItem(r);d&&(l.item=n[this.getIndexByItem(d)]),l.originalEvent=e;!(!t.isNullOrUndefined(i)&&r.childElementCount<=1)||!t.isNullOrUndefined(a)&&t.isNullOrUndefined(t.select("."+Be+" ."+We,d))?this.afterContentRender(s,l,r,o,a,d):(r.appendChild(this.contentRendering(h)),this.ariaAttrUpdate(r),this.afterContentRender(s,l,r,o,a,d)),this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,l,r){var o=this,a=[];this.trigger("clicked",i);var d=l&&!t.isNullOrUndefined(t.select(".e-target",l)),h=l&&!t.isNullOrUndefined(t.select("."+Ue,l))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=l&&t.isNullOrUndefined(t.select("."+Ue,l))||!(t.closest(e,"."+Ue)===this.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(qe)||e.classList.contains(Fe)||d)){var p=this.element.querySelector("."+Ge),u=p?p.children:this.element.children;[].slice.call(u).forEach(function(e){e.classList.contains(ze)&&a.push(e)});var f=[].slice.call(this.element.querySelectorAll("."+Re+" [e-animate]"));if(f.length>0)for(var m=0,v=f;m<v.length;m++){var g=v[m];a.push(g.parentElement)}var y=-1!==a.indexOf(r)&&"true"===l.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+qe,s),x=t.closest(s,"."+He).querySelector("."+Xe);if(t.isNullOrUndefined(C))return;b=x===s,!t.isVisible(C)||y&&!r.classList.contains(_e)?(a.length>0&&"Single"===this.expandMode&&!y&&a.forEach(function(e){o.collapse(t.select("."+qe,e)),e.classList.remove(Xe)}),this.expand(C)):this.collapse(C),t.isNullOrUndefined(x)||b||x.classList.remove(Xe)}}},i.prototype.eleMoveFocus=function(e,i,s){var n,l=t.closest(s,"."+Re);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+Be):s.classList.contains(Be)&&(l="moveUp"===e?l.previousElementSibling:l.nextElementSibling)&&(n=t.select("."+Be,l)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,Be);if(!t.isNullOrUndefined(s)||i.classList.contains(Ue)||i.classList.contains(Be)){var n,l=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,l,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(qe)?"true"!==n.getAttribute("e-animate")&&i.click():i.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?l.firstElementChild.children[0]:l.lastElementChild.children[0]).focus(),e.preventDefault()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Be,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"heading","aria-label":"collapsed","aria-disabled":"false","aria-level":this.getItems().length.toString()};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:Re,id:e.id||t.getUniqueID("acrdn_item"),attrs:{"aria-expanded":"false",role:"row"}});if(this.headerTemplate){var n=this.headerEleGenerate(),l=this.createElement("div",{className:je});return n.appendChild(l),t.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),l),s.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(s,"e-select"),s}if(e.header&&this.angularnativeCondiCheck(e,"header")){this.enableHtmlSanitizer&&"string"==typeof e.header&&(e.header=t.SanitizeHtmlHelper.sanitize(e.header));n=this.headerEleGenerate(),l=this.createElement("div",{className:je});n.appendChild(l),n.appendChild(this.fetchElement(l,e.header,i,!0)),s.appendChild(n)}var r=t.select("."+Be,s);if(!e.expanded||t.isNullOrUndefined(i)||this.enablePersistence||-1===this.initExpand.indexOf(i)&&this.initExpand.push(i),e.cssClass&&t.addClass([s],e.cssClass.split(" ")),e.disabled&&t.addClass([s],Ke),!1===e.visible&&t.addClass([s],"e-hide"),e.iconCss){var o=this.createElement("div",{className:"e-acrdn-header-icon"}),a=this.createElement("span",{className:e.iconCss+" e-icons"});o.appendChild(a),t.isNullOrUndefined(r)?((r=this.headerEleGenerate()).appendChild(o),s.appendChild(r)):r.insertBefore(o,r.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var d=this.toggleIconGenerate();t.isNullOrUndefined(r)&&(r=this.headerEleGenerate(),s.appendChild(r)),r.appendChild(d),this.add(s,"e-select")}return s},i.prototype.angularnativeCondiCheck=function(e,i){var s="content"===i?e.content:e.header;if(this.isAngular&&!t.isNullOrUndefined(s.elementRef)){var n=s.elementRef.nativeElement.data;if(t.isNullOrUndefined(n)||""===n||-1===n.indexOf("bindings="))return!0;var l=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(l)&&"false"===l["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s,n){var l,r;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);r=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}else l=t.compile(i)}catch(s){"string"==typeof i?e.innerHTML=t.SanitizeHtmlHelper.sanitize(i):!t.isNullOrUndefined(this.trgtEle)&&i instanceof HTMLElement?(e.appendChild(i),e.firstElementChild.style.display=""):l=t.compile(i)}var a;if(!t.isNullOrUndefined(l)){this.isReact&&this.renderReactTemplates();var d=void 0,h=void 0;e.classList.contains(je)?(d=this.element.id+s+"_header",h="header"):e.classList.contains(Fe)&&(d=this.element.id+s+"_content",h="content"),a=l({},this,h,d,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+Be,e),s=t.select("."+qe,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","definition")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:qe+" "+Ve,id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:Fe});return this.dataSource.length>0?(this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[e],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(this.enableHtmlSanitizer&&(this.items[e].content,1)&&(this.items[e].content=t.SanitizeHtmlHelper.sanitize(this.items[e].content)),i.appendChild(this.fetchElement(s,this.items[e].content,e,!1))),i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+Re);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains(Ke))){var l=t.closest(n,"."+He).querySelector("."+Xe),r={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=t.select("."+We,n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+qe),isExpanded:!0};this.trigger("expanding",a,function(s){s.cancel||(o.classList.add(Ye),i.expandedItemsPush(n),t.isNullOrUndefined(l)||l.classList.remove(Xe),n.classList.add(Xe),"None"===r.name?(i.expandProgress("begin",o,e,n,s),i.expandProgress("end",o,e,n,s)):i.expandAnimation(r.name,o,e,n,r,s))})}},i.prototype.expandAnimation=function(e,i,s,n,l,r){var o,a=this;this.lastActiveItemId=n.id,"SlideDown"===e?(l.begin=function(){a.expandProgress("begin",i,s,n,r),s.style.position="absolute",o=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},l.progress=function(){n.style.minHeight=o+s.offsetHeight+"px"},l.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,r)}):(l.begin=function(){a.expandProgress("begin",i,s,n,r)},l.end=function(){a.expandProgress("end",i,s,n,r)}),new t.Animation(l).animate(s)},i.prototype.expandProgress=function(e,i,s,n,l){this.remove(s,Ve),this.add(n,_e),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,ze),s.setAttribute("aria-hidden","false"),t.attributes(n,{"aria-expanded":"true"}),t.attributes(s.previousElementSibling,{"aria-label":"expanded"}),i.classList.remove(Ye),this.trigger("expanded",l))},i.prototype.expandedItemsPush=function(e){var t=this.getIndexByItem(e);if(-1===this.expandedIndices.indexOf(t)){var i=[].slice.call(this.expandedIndices);i.push(t),this.setProperties({expandedIndices:i},!0)}},i.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},i.prototype.getItemElements=function(){var e=[],t=this.element.children;return[].slice.call(t).forEach(function(t){t.classList.contains(Re)&&e.push(t)}),e},i.prototype.expandedItemsPop=function(e){var t=this.getIndexByItem(e),i=[].slice.call(this.expandedIndices);i.splice(i.indexOf(t),1),this.setProperties({expandedIndices:i},!0)},i.prototype.collapse=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+Re);if(!t.isNullOrUndefined(e)&&t.isVisible(e)&&!n.classList.contains(Ke)){var l={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},r=t.select("."+We,n).firstElementChild,o={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+qe),isExpanded:!1};this.trigger("expanding",o,function(t){t.cancel||(i.expandedItemsPop(n),n.classList.remove(Xe),r.classList.add(Ye),"None"===l.name?(i.collapseProgress("begin",r,e,n,t),i.collapseProgress("end",r,e,n,t)):i.collapseAnimation(l.name,e,n,r,l,t))})}},i.prototype.collapseAnimation=function(e,i,s,n,l,r){var o,a,d,h,c=this;this.lastActiveItemId=s.id,"SlideUp"===e?(l.begin=function(){d=s.offsetHeight,s.style.minHeight=d+"px",i.style.position="absolute",o=s.offsetHeight,a=i.offsetHeight,i.style.maxHeight=a+"px",c.collapseProgress("begin",n,i,s,r)},l.progress=function(){(h=o-(a-i.offsetHeight))<d&&(s.style.minHeight=h+"px")},l.end=function(){i.style.display="none",c.collapseProgress("end",n,i,s,r),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(l.begin=function(){c.collapseProgress("begin",n,i,s,r)},l.end=function(){c.collapseProgress("end",n,i,s,r)}),new t.Animation(l).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,l){this.remove(i,"e-expand-icon"),this.remove(n,_e),"end"===e&&(this.add(s,Ve),i.classList.remove(Ye),this.remove(n,ze),s.setAttribute("aria-hidden","true"),t.attributes(n,{"aria-expanded":"false"}),t.attributes(s.previousElementSibling,{"aria-label":"collapsed"}),this.trigger("expanded",l))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.itemAttribUpdate=function(){var e=this.getItems(),i=this.getItemElements(),s=e.length;i.forEach(function(e){t.select("."+Be,e).setAttribute("aria-level",""+s)})},i.prototype.getItems=function(){return this.itemTemplate&&this.headerTemplate?this.dataSource:this.items},i.prototype.addItem=function(e,i){var s=this,n=this.element,l=this.getItemElements(),r=this.getItems();if(t.isNullOrUndefined(i)&&(i=r.length),n.childElementCount>=i){(e instanceof Array?e:[e]).forEach(function(e,o){var a=i+o;r.splice(a,0,e);var d=s.renderInnerItem(e,a);n.childElementCount===a?n.appendChild(d):n.insertBefore(d,l[a]),t.EventHandler.add(d.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+Be),"blur",s.focusOut,s),s.itemAttribUpdate(),s.expandedIndices=[],s.expandedItemRefresh(n),e&&e.expanded&&s.expandItem(!0,a)})}this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(e){var t=this,i=this.getItemElements();[].slice.call(i).forEach(function(e){e.classList.contains(_e)&&t.expandedItemsPush(e)})},i.prototype.removeItem=function(e){this.isReact&&this.clearTemplate(["headerTemplate","itemTemplate"],e);var i=this.getItemElements()[e],s=this.getItems();t.isNullOrUndefined(i)||(this.restoreContent(e),t.detach(i),s.splice(e,1),this.itemAttribUpdate(),this.expandedIndices=[],this.expandedItemRefresh(this.element))},i.prototype.select=function(e){var i=this.getItemElements()[e];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+Be,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[e];t.isNullOrUndefined(s)||(t.isNullOrUndefined(i)&&(i=!0),i?this.add(s,"e-hide"):this.remove(s,"e-hide"))},i.prototype.enableItem=function(e,i){var s=this.getItemElements()[e];if(!t.isNullOrUndefined(s)){var n=s.firstElementChild;i?(this.remove(s,Ke),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains(ze)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,Ke),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){var l=n[n.length-1];this.itemExpand(e,l,this.getIndexByItem(l))}else{var r=t.select("#"+this.lastActiveItemId,this.element);[].slice.call(n).forEach(function(t){s.itemExpand(e,t,s.getIndexByItem(t)),t.classList.remove(Xe)});var o=t.select("."+Xe,this.element);o&&o.classList.remove(Xe),r&&r.classList.add(Xe)}else{l=n[i];if(t.isNullOrUndefined(l)||!l.classList.contains("e-select")||l.classList.contains(ze)&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,l,i)}},i.prototype.itemExpand=function(e,i,s){var n=i.children[1];i.classList.contains(Ke)||(t.isNullOrUndefined(n)&&e?(n=this.contentRendering(s),i.appendChild(n),this.ariaAttrUpdate(i),this.expand(n)):t.isNullOrUndefined(n)||(e?this.expand(n):this.collapse(n)),this.isReact&&this.renderReactTemplates())},i.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Re)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Re)[e],this.templateEle.forEach(function(e){t.isNullOrUndefined(i.querySelector(e))||(document.body.appendChild(i.querySelector(e)).style.display="none")})},i.prototype.updateItem=function(e,i){if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=s[i];s.splice(i,1),this.restoreContent(i),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){t.innerHTML="",this.templateCompile(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.fetchElement(s,t,i,!1),0!==s.childNodes.length&&[].slice.call(s.childNodes).forEach(function(t){e.appendChild(t)})},i.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,l=0,r=Object.keys(e);l<r.length;l++){switch(r[l]){case"items":if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=t.selectAll("."+Re,this.element)[d],p=Object(i.items[d])[h],u=Object(e.items[d])[h];if(("header"===h||"iconCss"===h||"expanded"===h||"content"===h&&""===p)&&this.updateItem(c,d),"cssClass"!==h||t.isNullOrUndefined(c)||(c.classList.remove(p),c.classList.add(u)),"visible"!==h||t.isNullOrUndefined(c)||(!1===Object(e.items[d])[h]?c.classList.add("e-hide"):c.classList.remove("e-hide")),"disabled"!==h||t.isNullOrUndefined(c)||this.enableItem(d,!u),"content"===h&&!t.isNullOrUndefined(c)&&2===c.children.length)if("function"==typeof u){var f=c.querySelector("."+Fe);f.innerHTML="",this.setTemplate(u,f,d)}else c.classList.contains(_e)&&this.expandItem(!1,d),t.detach(c.querySelector("."+qe))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),n=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),n=!0;break;case"itemTemplate":this.initializeItemTemplate(),n=!0;break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl");break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode?(this.element.setAttribute("aria-multiselectable","false"),this.expandedIndices.length>1&&this.expandItem(!1)):this.element.setAttribute("aria-multiselectable","true")}}n&&(this.initExpand=[],this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},Me([t.Collection([],Ze)],i.prototype,"items",void 0),Me([t.Property([])],i.prototype,"dataSource",void 0),Me([t.Property()],i.prototype,"itemTemplate",void 0),Me([t.Property()],i.prototype,"headerTemplate",void 0),Me([t.Property("100%")],i.prototype,"width",void 0),Me([t.Property("auto")],i.prototype,"height",void 0),Me([t.Property([])],i.prototype,"expandedIndices",void 0),Me([t.Property("Multiple")],i.prototype,"expandMode",void 0),Me([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),Me([t.Complex({},Je)],i.prototype,"animation",void 0),Me([t.Event()],i.prototype,"clicked",void 0),Me([t.Event()],i.prototype,"expanding",void 0),Me([t.Event()],i.prototype,"expanded",void 0),Me([t.Event()],i.prototype,"created",void 0),Me([t.Event()],i.prototype,"destroyed",void 0),i=Me([t.NotifyPropertyChanges],i)}(t.Component),et=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),tt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},it=function(e){function i(t,i){return e.call(this,t,i)||this}return et(i,e),i.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||t.getUniqueID("ej2-contextmenu"),e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=s.getZindexPartial(this.element).toString()},i.prototype.open=function(t,i,s){e.prototype.openMenu.call(this,null,null,t,i,null,s)},i.prototype.close=function(){e.prototype.closeMenu.call(this)},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++){switch(n[s]){case"filter":this.close(),this.filter=t.filter;break;case"target":this.unWireEvents(i.target),this.wireEvents()}}},i.prototype.getModuleName=function(){return"contextmenu"},tt([t.Property("")],i.prototype,"target",void 0),tt([t.Property("")],i.prototype,"filter",void 0),tt([t.Collection([],ee)],i.prototype,"items",void 0),i=tt([t.NotifyPropertyChanges],i)}(ie),st=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),nt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},lt="e-vertical",rt="e-hamburger",ot=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return st(i,e),i.prototype.getModuleName=function(){return"menu"},i.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||t.getUniqueID("ej2-menu"),this.template)try{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}else this.updateMenuItems(this.items);e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(lt),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(lt),this.element.setAttribute("aria-orientation","vertical")):t.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(rt),"Horizontal"===this.orientation&&this.element.classList.add("e-hide-menu"))},i.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},i.prototype.onPropertyChanged=function(i,s){for(var n=this,l=0,r=Object.keys(i);l<r.length;l++){switch(r[l]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(lt),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(lt),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(lt),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(lt),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(s.items).length||this.updateMenuItems(i.items);break;case"hamburgerMode":this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),i.hamburgerMode?(this.element.parentElement.classList.add(rt),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(rt),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(lt),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(lt):this.element.previousElementSibling.classList.remove(lt),this.element.classList[i.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(i.title=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title):i.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=i.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(s.target),this.wireEvents(),"Horizontal"===this.orientation&&(i.target?this.element.previousElementSibling.classList.add(lt):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(lt)),this.element.classList.add("e-hide-menu")))}}e.prototype.onPropertyChanged.call(this,i,s)},i.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[n]){for(t=this.getIndex(e[n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},i.prototype.open=function(){e.prototype.openHamburgerMenu.call(this)},i.prototype.close=function(){e.prototype.closeHamburgerMenu.call(this)},nt([t.Property("Horizontal")],i.prototype,"orientation",void 0),nt([t.Property("")],i.prototype,"target",void 0),nt([t.Property(null)],i.prototype,"template",void 0),nt([t.Property(!1)],i.prototype,"enableScrolling",void 0),nt([t.Property(!1)],i.prototype,"hamburgerMode",void 0),nt([t.Property("Menu")],i.prototype,"title",void 0),nt([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),nt([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},$)],i.prototype,"fields",void 0),i=nt([t.NotifyPropertyChanges],i)}(ie),at=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),dt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},ht="e-tab-header",ct="e-content",pt="e-nested",ut="e-item",ft="e-template",mt="e-active",vt="e-disable",gt="e-hidden",yt="e-close-icon",bt="e-close-show",Ct="e-tab-text",xt="e-indicator",Et="e-tab-wrap",Nt="e-text-wrap",It="e-toolbar-items",St="e-toolbar-item",Ot="e-toolbar-popup",wt="e-progress",kt="e-vertical-tab",Lt="e-vertical",At="e-vertical-right",Pt="e-horizontal-bottom",Dt="e-fill-mode",Tt="e-reorder-active-item",Mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),dt([t.Property(600)],i.prototype,"duration",void 0),dt([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},Mt)],i.prototype,"previous",void 0),dt([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},Mt)],i.prototype,"next",void 0),i}(t.ChildProperty),Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Property("")],i.prototype,"text",void 0),dt([t.Property("")],i.prototype,"iconCss",void 0),dt([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),Rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Complex({},Ut)],i.prototype,"header",void 0),dt([t.Property(null)],i.prototype,"headerTemplate",void 0),dt([t.Property("")],i.prototype,"content",void 0),dt([t.Property("")],i.prototype,"cssClass",void 0),dt([t.Property(!1)],i.prototype,"disabled",void 0),dt([t.Property(!0)],i.prototype,"visible",void 0),dt([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),Bt=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.show={},s.hide={},s.maxHeight=0,s.title="Close",s.isInteracted=!1,s.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActiveTabBorder.bind(s),s.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},s}return at(i,e),i.prototype.destroy=function(){var i=this;if((this.isReact||this.isAngular)&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation","aria-owns"].forEach(function(e){i.element.removeAttribute(e)}),this.expTemplateContent(),this.isTemplate){var s=t.select(".e-tab > ."+ct,this.element);this.element.classList.remove(ft),t.isNullOrUndefined(s)||(s.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var n=0;n<this.draggableItems.length;n++)this.draggableItems[n].destroy(),this.draggableItems[n]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+ct);this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+ht:this.dragArea),t.isNullOrUndefined(e)||(e.parentElement.classList.add(pt),this.isNested=!0);var i=t.Browser.info.name,s="msie"===i?"e-ie":"edge"===i?"e-edge":"safari"===i?"e-safari":"";t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),t.attributes(this.element,{role:"tablist","aria-disabled":"false","aria-activedescendant":"","aria-owns":this.element.id+"_tab_header_items"}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){this.btnCls=this.createElement("span",{className:"e-icons "+yt,attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:t.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1},i.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach(function(e,i){t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(e.setProperties)&&e.setProperties({id:"tabitem_"+i.toString()},!0)}),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:ct})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:ht})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add(ft);var i=e.querySelector("."+ht);i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select("."+ht,this.element))&&!t.isNullOrUndefined(t.select("."+ct,this.element))){if(this.renderHeader(),this.tbItems=t.select("."+ht+" ."+It,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+St,this.element).length>0){this.tbItems=t.select("."+ht+" ."+It,this.element),this.bdrLine=this.createElement("div",{className:xt+" "+gt+" e-ignore"});var s=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(s)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):s.insertBefore(this.bdrLine,s.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}if(!t.isNullOrUndefined(this.tbItem))for(var n=0;n<this.items.length;n++)if(this.items[n]){var l=this.items[n].id;this.tbItem[n].setAttribute("data-id",l)}this.setRTL(this.enableRtl)}},i.prototype.renderHeader=function(){var e=this,i=this.headerPlacement,s=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(ht)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,l=[],r=0;r<n;r++)l.push(this.hdrEle.children.item(r).innerHTML);if(n>0){for(;this.hdrEle.firstElementChild;)t.detach(this.hdrEle.firstElementChild);var o=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(o),l.forEach(function(i,s){e.lastIndex=s;var n={className:ut,id:ut+e.tabId+"_"+s,attrs:{role:"tab","aria-controls":ct+e.tabId+"_"+s,"aria-selected":"false"}},l=e.createElement("span",{className:Ct,innerHTML:i,attrs:{role:"presentation"}}).outerHTML,r=e.createElement("div",{className:Nt,innerHTML:l+e.btnCls.outerHTML}).outerHTML,a=e.createElement("div",{className:Et,innerHTML:r,attrs:{tabIndex:"-1"}});o.appendChild(e.createElement("div",n)),t.selectAll(".e-item",o)[s].appendChild(a)})}}else s=this.parseObject(this.items,0);this.tbObj=new De({width:"Left"===i||"Right"===i?"auto":"100%",height:"Left"===i||"Right"===i?"100%":"auto",overflowMode:this.overflowMode,items:0!==s.length?s:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton);var a=this.tbObj.element.querySelector("."+It);t.isNullOrUndefined(a)||((t.isNullOrUndefined(a.id)||""===a.id)&&(a.id=this.element.id+"_tab_header_items"),this.element.setAttribute("aria-owns",a.id))},i.prototype.renderContent=function(){this.cntEle=t.select("."+ct,this.element);var e=t.selectAll("."+St,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var i=this.cntEle.children,s=0;s<e.length;s++)i.length-1>=s&&(t.addClass([i.item(s)],ut),t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":ut+this.tabId+"_"+s}),i.item(s).id=ct+this.tabId+"_"+s)}},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.parseObject=function(e,i){var s=this,n=t.selectAll(".e-tab-header ."+St,this.element),l=this.lastIndex;if(!this.isReplace&&n.length>0){var r=[];n.forEach(function(e){r.push(parseInt(e.id.slice(e.id.indexOf("_")+1),10))}),l=Math.max.apply(Math,r)}var o,a=[],d=[];return e.forEach(function(e,r){var h=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,c=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;if(t.isNullOrUndefined(e.headerTemplate)&&(t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===c))d.push(r);else{var p=e.headerTemplate||e.header.text;"string"==typeof p&&s.enableHtmlSanitizer&&(p=t.SanitizeHtmlHelper.sanitize(p));var u;if(s.isReplace&&!t.isNullOrUndefined(s.tbId)&&""!==s.tbId){var f=s.tbId.indexOf("_");u=parseInt(s.tbId.substring(f+1),10),s.tbId=""}else u=i+r;s.lastIndex=0===n.length?r:s.isReplace?u:l+1+r;var m=e.disabled?" e-disable e-overlay":"",v=!1===e.visible?" "+gt:"";o=s.createElement("div",{className:Ct,attrs:{role:"presentation"}});var g=p instanceof Object?p.outerHTML:p,y=!t.isNullOrUndefined(g)&&""!==g;t.isNullOrUndefined(p.tagName)?s.headerTextCompile(o,p,r):o.appendChild(p);var b=s.createElement("span",{className:"e-icons e-tab-icon e-icon-"+h+" "+c}),C=s.createElement("div",{className:Nt});C.appendChild(o),""!==p&&void 0!==p&&""!==c?("left"===h||"top"===h?C.insertBefore(b,C.firstElementChild):C.appendChild(b),o,s.isIconAlone=!1):(""===c?o:b)===b&&(t.detach(o),C.appendChild(b),s.isIconAlone=!0);var x=e.disabled?{}:{tabIndex:"-1"};C.appendChild(s.btnCls.cloneNode(!0));var E=s.createElement("div",{className:Et,attrs:x});E.appendChild(C),s.itemIndexArray===[]?s.itemIndexArray.push(ut+s.tabId+"_"+s.lastIndex):s.itemIndexArray.splice(i+r,0,ut+s.tabId+"_"+s.lastIndex);var N={htmlAttributes:{id:ut+s.tabId+"_"+s.lastIndex,role:"tab","aria-selected":"false"},template:E};N.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+m+" "+v+" "+(""!==c?"e-i"+h:"")+" "+(y?"":"e-icon"),"top"!==h&&"bottom"!==h||s.element.classList.add("e-vertical-icon"),a.push(N),r++}}),this.isAdd||d.forEach(function(e){s.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),a},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll("."+St+"."+mt,e);[].slice.call(i).forEach(function(e){return e.classList.remove(mt)})}},i.prototype.checkPopupOverflow=function(e){this.tbPop=t.select(".e-toolbar-pop",this.element);var i=t.select(".e-hor-nav",this.element),s=t.select("."+It,this.element),n=s.lastChild,l=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?l=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(l=!0),l&&(e.classList.add(Ot),this.tbPop.insertBefore(e,t.selectAll("."+Ot,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+Et).classList.remove("e-ripple")),this.tbItem=t.selectAll("."+It+" ."+St,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(Ot),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(s)){var n=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(n)}this.isPopup=!0}return t.selectAll("."+St,this.tbItems).length-1},i.prototype.updateOrientationAttribute=function(){t.attributes(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},i.prototype.setCloseButton=function(e){var i=t.select("."+ht,this.element);!0===e?i.classList.add(bt):i.classList.remove(bt),this.tbObj.refreshOverflow(),this.refreshActiveTabBorder()},i.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains("e-rtl");return this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},i.prototype.triggerPrevAnimation=function(e,i){var s=this,n=this.prevCtnAnimation(i,this.selectedItem);t.isNullOrUndefined(n)?e.classList.remove(mt):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add(wt),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove(mt),e.classList.remove(wt),e.classList.remove("e-view"),t.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||s.isTemplate||t.detach(e)},new t.Animation(n).animate(e))},i.prototype.triggerAnimation=function(e,i){var s,n=this,l=this.prevIndex;[].slice.call(this.element.querySelector("."+ct).children).forEach(function(e){e.id===n.prevActiveEle&&(s=e)});var r=this.tbItem[l],o=this.getTrgContent(this.cntEle,this.extIndex(e));if(t.isNullOrUndefined(s)&&!t.isNullOrUndefined(r)){var a=this.extIndex(r.id);s=this.getTrgContent(this.cntEle,a)}if(t.isNullOrUndefined(o)||(this.prevActiveEle=o.id),this.initRender||!1===i||this.animation==={}||t.isNullOrUndefined(this.animation))s&&s!==o&&s.classList.remove(mt);else{var d,h=t.select("."+ct,this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var c=this.animation.previous.effect;d={name:"None"===c?"":"SlideLeftIn"!==c?c:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var p=this.animation.next.effect;d={name:"None"===p?"":"SlideRightIn"!==p?p:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}d.progress=function(){h.classList.add(wt),n.setActiveBorder()},d.end=function(){h.classList.remove(wt),o.classList.add(mt)},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,l),this.isPopup=!1,""===d.name?o.classList.add(mt):new t.Animation(d).animate(o)}},i.prototype.keyPressed=function(e){var i=t.closest(e,"."+ht+" ."+St),s=this.getEleIndex(i);!t.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():t.isNullOrUndefined(i)||!1!==i.classList.contains(mt)||(this.selectTab(s,null,!0),t.isNullOrUndefined(this.popEle)||this.popObj.hide(this.hide))},i.prototype.getTabHeader=function(){if(!t.isNullOrUndefined(this.element)){var e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(ht)});if(e.length>0)return e[0];var i=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0];if(i)return[].slice.call(i.children).filter(function(e){return e.classList.contains(ht)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+St,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace(ut+this.tabId+"_","")},i.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach(function(i){t.isNullOrUndefined(e.element.querySelector(i))||(document.body.appendChild(e.element.querySelector(i)).style.display="none")})},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},i.prototype.compileElement=function(e,i,s,n){var l;"string"==typeof i?(i=i.trim(),this.isVue?l=t.compile(t.SanitizeHtmlHelper.sanitize(i)):e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):l=t.compile(i);var r;t.isNullOrUndefined(l)||(r=l({},this,s)),!t.isNullOrUndefined(l)&&r.length>0&&[].slice.call(r).forEach(function(t){e.appendChild(t)})},i.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},i.prototype.getContent=function(e,i,s,n){var l;if("string"==typeof(i=t.isNullOrUndefined(i)?"":i)||t.isNullOrUndefined(i.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var r=document.querySelector(i);l=r.outerHTML.trim(),"clone"===s?e.appendChild(r.cloneNode(!0)):(e.appendChild(r),r.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(l)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains(pt)?t.select(".e-nested> .e-content > #"+ct+this.tabId+"_"+i,this.element):this.findEle(e.children,ct+this.tabId+"_"+i)},i.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},i.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},i.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?"e-vertical-left":At;t.addClass([this.hdrEle],[Lt,e]),this.element.classList.contains(pt)?t.addClass([this.hdrEle],[kt,e]):t.addClass([this.element],[kt,e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],[Pt])},i.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},i.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var i=this.hdrEle.querySelector("."+mt),s=!!this.hdrEle.classList.contains(Lt);t.removeClass([this.element],[kt]),t.removeClass([this.hdrEle],[Lt,"e-vertical-left",At]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(Ot)&&this.popupHandler(i)),this.addVerticalClass(),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},i.prototype.focusItem=function(){var e=t.select(" #e-item"+this.tabId+"_"+this.selectedItem,this.hdrEle);t.isNullOrUndefined(e)||e.firstElementChild.focus()},i.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},i.prototype.setOrientation=function(e,i){var s=Array.prototype.indexOf.call(this.element.children,i),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+ct));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],[Pt]),this.element.insertBefore(i,t.select("."+ct,this.element)))},i.prototype.setCssClass=function(e,t,i){if(""!==t)for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},i.prototype.setContentHeight=function(e){if(this.element.classList.contains(Dt)&&t.removeClass([this.element],[Dt]),!t.isNullOrUndefined(this.cntEle)){var i=this.getTabHeader();if("None"===this.heightAdjustMode){if("auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],[Dt]),t.setStyleAttribute(this.element,{height:"100%"}),t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"});else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var s=t.selectAll(".e-content > .e-item",this.element),n=0;n<s.length;n++)s[n].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(s[n])),s[n].style.removeProperty("display"),s[n].style.removeProperty("visibility");else{this.cntEle=t.select("."+ct,this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:ct+this.tabId+"_0",className:"e-item "+mt,attrs:{role:"tabpanel","aria-labelledby":ut+this.tabId+"_0"}}));var l=this.cntEle.children.item(0);for(n=0;n<this.items.length;n++)for(this.getContent(l,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(l));l.firstChild;)l.removeChild(l.firstChild);this.isReact&&this.clearTemplate(["content"]),this.templateEle=[],this.getContent(l,this.items[0].content,"render",0),this.prevIndex!==this.selectedItem&&l.classList.remove(mt)}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else t.setStyleAttribute(this.cntEle,{height:"auto"})}},i.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},i.prototype.setActiveBorder=function(){var e=this.getTabHeader(),i=t.select("."+St+"."+mt,e);if(!t.isNullOrUndefined(i)){this.reorderActiveTab?e&&e.classList.remove(Tt):(i.classList.contains(Ot)&&!this.bdrLine.classList.contains(gt)&&this.bdrLine.classList.add(gt),e&&!e.classList.contains(Tt)&&e.classList.add(Tt));var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+It,e);var n=t.select("."+xt,e),l=t.select("."+It+" ."+this.scrCntClass,e);if(this.isVertical()){t.setStyleAttribute(n,{left:"",right:""});0!==(t.isNullOrUndefined(l)?this.tbItems.offsetHeight:l.offsetHeight)?t.setStyleAttribute(n,{top:i.offsetTop+"px",height:i.offsetHeight+"px"}):t.setStyleAttribute(n,{top:0,height:0})}else{if("MultiRow"===this.overflowMode){var r=t.select("."+xt,this.element);t.setStyleAttribute(r,{top:i.offsetHeight+i.offsetTop+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var o=t.isNullOrUndefined(l)?this.tbItems.offsetWidth:l.offsetWidth;0!==o?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:o-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||i.classList.contains(Ot)||this.bdrLine.classList.remove(gt)}}},i.prototype.setActive=function(e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1),this.tbItem=t.selectAll("."+St,this.getTabHeader());var n=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length))if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),n.classList.contains(mt))this.setActiveBorder();else{if(!this.isTemplate){var l=this.tbItem[this.prevIndex];t.isNullOrUndefined(l)||l.removeAttribute("aria-controls"),t.attributes(n,{"aria-controls":ct+this.tabId+"_"+e})}var r=n.id;this.removeActiveClass(),n.classList.add(mt),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),n.setAttribute("aria-selected","true");var o=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=ct+this.tabId+"_"+o),t.attributes(this.element,{"aria-activedescendant":r}),this.isTemplate){if(t.select("."+ct,this.element).children.length>0){var a=this.findEle(t.select("."+ct,this.element).children,ct+this.tabId+"_"+o);t.isNullOrUndefined(a)||a.classList.add(mt),this.triggerAnimation(r,this.enableAnimation)}}else{this.cntEle=t.select(".e-tab > ."+ct,this.element);var d=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(d)){this.cntEle.appendChild(this.createElement("div",{id:ct+this.tabId+"_"+this.extIndex(r),className:"e-item "+mt,attrs:{role:"tabpanel","aria-labelledby":ut+this.tabId+"_"+this.extIndex(r)}}));var h=this.getTrgContent(this.cntEle,this.extIndex(r)),c=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(h,this.items[c].content,"render",c)}else d.classList.add(mt);this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(n),!this.initRender&&!i){n.firstElementChild.focus();var p={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:n,selectedIndex:e,selectedContent:t.select("#"+ct+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:s};this.trigger("selected",p)}}},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+It,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},i.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,"e-rtl",e),this.refreshActiveBorder()},i.prototype.refreshActiveBorder=function(){t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(gt),this.setActiveBorder()},i.prototype.showPopup=function(e){var i=t.select(".e-popup.e-toolbar-pop",this.hdrEle);if(i.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector("."+ht);if(t){t.querySelectorAll("."+St).forEach(function(t){e.initializeDrag(t)})}}},i.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},i.prototype.unWireEvents=function(){t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),t.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),t.isNullOrUndefined(this.cntEle)||t.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove("e-rtl"),this.element.classList.remove("e-focused")},i.prototype.clickHandler=function(e){this.element.classList.remove("e-focused");var i=e.originalEvent.target,s=t.closest(i,"."+St),n=this.getEleIndex(s);i.classList.contains(yt)?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,t.isNullOrUndefined(s)||n===this.selectedItem&&n===this.prevIndex||this.selectTab(n,e.originalEvent,!0))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches))){this.isNested&&this.element.setAttribute("data-swipe","true");var i=this.element.querySelector('[data-swipe="true"]');if(i)i.removeAttribute("data-swipe");else{if(this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var s=this.selectedItem-1;s>=0;s--)if(!this.tbItem[s].classList.contains(gt)){this.selectTab(s,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+St,this.element).length-1)for(var n=this.selectedItem+1;n<this.tbItem.length;n++)if(!this.tbItem[n].classList.contains(gt)){this.selectTab(n,null,!0);break}this.isSwipeed=!1}}},i.prototype.spaceKeyDown=function(e){if(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which){var i=t.closest(e.target,"."+ht);t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains(vt)){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select("."+mt,s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var l=t.closest(document.activeElement,"."+St),r=t.closest(i,"."+St);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains(vt))return;if("enter"===e.action&&i.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(i);break;case"tab":case"shiftTab":i.classList.contains(Et)&&!1===t.closest(i,"."+St).classList.contains(mt)&&i.setAttribute("tabindex","-1"),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":t.isNullOrUndefined(l)||this.refreshItemVisibility(l);break;case"openPopup":e.preventDefault(),!t.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!t.isNullOrUndefined(r)){var o=r.nextSibling;!t.isNullOrUndefined(o)&&o.classList.contains(St)&&o.firstElementChild.focus(),this.removeTab(this.getEleIndex(r))}this.setActiveBorder()}}},i.prototype.refreshActiveTabBorder=function(){var e=t.select("."+St+"."+Ot+"."+mt,this.element);!t.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},i.prototype.refreshItemVisibility=function(e){var i=t.select("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!t.isNullOrUndefined(i)){var s=t.select(".e-hscroll-bar",this.tbItems),n=s.scrollLeft,l=n+s.offsetWidth,r=e.offsetLeft,o=e.offsetWidth,a=e.offsetLeft+e.offsetWidth;if(n<r&&l<a){var d=l-r;s.scrollLeft=n+(o-d)}else if(n>r&&l>a){d=a-n;s.scrollLeft=n-(o-d)}}},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains(yt)&&i.setAttribute("title",new t.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},i.prototype.evalOnPropertyChangeItems=function(e,i){if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var s=t.select(".e-tab > ."+ct,this.element);s.firstElementChild;)t.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else for(var n=Object.keys(e.items),l=0;l<n.length;l++)for(var r=parseInt(Object.keys(e.items)[l],10),o=Object.keys(e.items[r]),a=0;a<o.length;a++){var d=Object(i.items[r])[o[a]],h=Object(e.items[r])[o[a]],c=this.element.querySelectorAll("."+St)[r],p=void 0;if(c&&!t.isNullOrUndefined(c.id)&&""!==c.id){var u=c.id.lastIndexOf("_");p=parseInt(c.id.substring(u+1),10)}else p=r;var f=t.select("."+It+" #"+ut+this.tabId+"_"+p,this.element),m=t.select(".e-content #"+ct+this.tabId+"_"+p,this.element);if("header"===o[a]||"headerTemplate"===o[a]){var v=t.isNullOrUndefined(this.items[r].header)||t.isNullOrUndefined(this.items[r].header.iconCss)?"":this.items[r].header.iconCss;if(""===(this.items[r].headerTemplate||this.items[r].header.text)&&""===v)this.removeTab(r);else{this.tbId=c.id;var g=[];g.push(this.items[r]),this.items.splice(r,1),this.itemIndexArray.splice(r,1),this.tbObj.items.splice(r,1);var y=f.classList.contains(gt);t.detach(f),this.isReplace=!0,this.addTab(g,r),y&&this.hideTab(r),this.isReplace=!1}}if("content"===o[a]&&!t.isNullOrUndefined(m)){if(("string"==typeof h||t.isNullOrUndefined(h.innerHTML))&&("."===h[0]||"#"===h[0])&&h.length){var b=document.querySelector(h);m.appendChild(b),b.style.display=""}else""===h&&"#"===d[0]?(document.body.appendChild(this.element.querySelector(d)).style.display="none",m.innerHTML=h):this.isReact?(m.innerHTML="",this.templateCompile(m,h,r)):"function"!=typeof h&&(m.innerHTML=h)}"cssClass"===o[a]&&(t.isNullOrUndefined(f)||(f.classList.remove(d),f.classList.add(h)),t.isNullOrUndefined(m)||(m.classList.remove(d),m.classList.add(h))),"disabled"===o[a]&&this.enableTab(r,!0!==h),"visible"===o[a]&&this.hideTab(r,!0!==h)}},i.prototype.initializeDrag=function(e){var i=this,s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+St,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,l=i.getEleIndex(i.dragItem),r={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+St),clonedElement:i.cloneElement,index:l};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||i.dragArea==="."+ht){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+Et).style.visibility="hidden",i.cloneElement.classList.contains(gt)&&t.removeClass([i.cloneElement],gt)):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],gt),i.dragItem.classList.contains(gt)&&t.removeClass([i.dragItem],gt),i.dragItem.querySelector("."+Et).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var o=i.element.querySelector(".e-scroll-right-nav"),a=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(o)&&Math.abs(o.offsetWidth/2+o.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(a)&&Math.abs(a.offsetLeft+a.offsetWidth-i.cloneElement.offsetLeft)>a.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none",n=t.closest(e.target,"."+St+".e-draggable");var h=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(h=i.element.querySelector(".e-hscroll-content").offsetWidth),null!=n&&!n.isSameNode(i.dragItem)&&n.closest(".e-tab").isSameNode(i.dragItem.closest(".e-tab"))&&((s=i.getEleIndex(n))<l&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,l,s),s>l&&Math.abs(n.offsetWidth/2)+n.offsetLeft-h<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,l,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",r)}else i.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(s)},i.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),t.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+ht).classList.contains(bt)&&t.addClass([this.cloneElement],bt),t.removeClass([this.cloneElement.querySelector("."+Et)],"e-ripple"),t.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||t.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},i.prototype.itemDragStart=function(e){var i=this;this.draggingItems=this.items.map(function(e){return e}),this.dragItem=e.element;var s={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",s,function(e){e.cancel?t.detach(i.cloneElement):(i.removeActiveClass(),t.addClass([i.tbItems.querySelector("."+xt)],gt),i.dragItem.querySelector("."+Et).style.visibility="hidden")})},i.prototype.dragAction=function(e,t,i){if(this.items.length>0){var s=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>i)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){var n=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var l=e.parentElement.lastChild;if(e.isSameNode(l)){n=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(l,n.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},i.prototype.itemDragStop=function(e){var i=this;t.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Et).style.visibility="visible",document.body.style.cursor="";var s={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",s,function(e){e.cancel?i.refresh():i.items.length>0&&i.draggingItems.length>0?(i.items=i.draggingItems,i.selectedItem=i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+Et).style.visibility="",t.removeClass([i.tbItems.querySelector("."+xt)],gt),i.selectTab(i.droppedIndex,null,!0))}),this.dragItem=null},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+St,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove(vt,"e-overlay"),s.firstElementChild.setAttribute("tabindex","-1")):(s.classList.add(vt,"e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains(mt)&&this.select(e+1)),t.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!i,this.dataBind()),s.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):this.trigger("adding",s,function(s){s.cancel||i.addingTabContent(e,t)}),this.isReact&&this.renderReactTemplates()},i.prototype.addingTabContent=function(e,i){var s=this,n=0;if(this.hdrEle=t.select("."+ht,this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var l=t.selectAll(".e-tab-header ."+St,this.element).length;if(0!==l&&(n=this.lastIndex+1),t.isNullOrUndefined(i)&&(i=l-1),l<i||i<0||isNaN(i))return;0!==l||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(gt),this.tbItems=t.select("."+It,this.getTabHeader()),this.isAdd=!0;var r=this.parseObject(e,i);this.isAdd=!1;var o,a=0;e.forEach(function(e,l){if(o=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(o)||0===o.length&&!t.isNullOrUndefined(e.header)&&t.isNullOrUndefined(e.header.iconCss)||(r[l]&&(t.isNullOrUndefined(e.id)&&(e.id="tabitem_"+(n+l).toString()),r[l].htmlAttributes["data-id"]=e.id),s.items.splice(i+a,0,e),a++),s.isTemplate&&!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)){var d=n+l,h=s.createElement("div",{id:ct+s.tabId+"_"+d,className:ut,attrs:{role:"tabpanel","aria-labelledby":"e-item_"+d}});s.cntEle.insertBefore(h,s.cntEle.children[i+l]);var c=s.getTrgContent(s.cntEle,d.toString());s.getContent(c,e.content,"render",i)}}),this.tbObj.addItems(r,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):(this.setActiveBorder(),this.tbItem=t.selectAll("."+St,this.getTabHeader())),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+St,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id));var l=i.itemIndexArray.indexOf(s.id);i.items.splice(l,1),i.itemIndexArray.splice(l,1),i.refreshActiveBorder();var r=t.select("#"+ct+i.tabId+"_"+i.extIndex(s.id),t.select("."+ct,i.element));t.isNullOrUndefined(r)||t.detach(r),i.trigger("removed",n),i.draggableItems&&i.draggableItems.length>0&&(i.draggableItems[e].destroy(),i.draggableItems[e]=null,i.draggableItems.splice(e,1)),s.classList.contains(mt)?(e=e>t.selectAll("."+St+":not(."+Ot+")",i.element).length-1?e-1:e,i.enableAnimation=!1,i.selectedItem=e,i.select(e)):e!==i.selectedItem&&(e<i.selectedItem&&(e=i.itemIndexArray.indexOf(i.tbItem[i.selectedItem].id),i.setProperties({selectedItem:e>-1?e:i.selectedItem},!0),i.prevIndex=i.selectedItem),i.tbItem=t.selectAll("."+St,i.getTabHeader())),0===t.selectAll("."+St,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+St,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add(gt),!0===i)if(n.classList.add(gt),0!==(s=t.selectAll("."+St+":not(."+gt+")",this.tbItems)).length&&n.classList.contains(mt)){if(0!==e)for(var l=e-1;l>=0;l--){if(!this.tbItem[l].classList.contains(gt)){this.select(l);break}if(0===l)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(gt)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(gt)){this.select(r);break}}else 0===s.length&&this.element.classList.add(gt);else this.element.classList.remove(gt),s=t.selectAll("."+St+":not(."+gt+")",this.tbItems),n.classList.remove(gt),0===s.length&&this.select(e);this.setActiveBorder(),n.setAttribute("aria-hidden",""+i),"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},i.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1),this.isInteracted=i,this.select(e,t)},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+It,n),this.tbItem=t.selectAll("."+St,n),this.content=t.select("."+ct,this.element),this.prevItem=this.tbItem[this.prevIndex],t.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var l=this.tbItem[e];t.isNullOrUndefined(l)?this.selectedID="0":this.selectingID=this.extIndex(l.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(vt)||this.prevItem.children.item(0).setAttribute("tabindex","-1");var r={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#"+ct+this.tabId+"_"+this.selectedID,this.content),selectingItem:l,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#"+ct+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",r,function(t){t.cancel||s.selectingContent(e,s.isInteracted)}),this.isInteracted=!1},i.prototype.selectingContent=function(e,i){if("number"==typeof e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(vt)||this.tbItem[e].classList.contains(gt)))for(var s=e+1;s<this.items.length;s++){if(!1===this.items[s].disabled&&!0===this.items[s].visible){e=s;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Ot)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,i),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll("."+It+" ."+St,this.hdrEle);var n=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,n);var l=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,l)}}else this.setActive(e,null,i);else this.setActive(0,null,i)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,i)},i.prototype.getItemIndex=function(e){for(var t,i=0;i<this.tbItem.length;i++){if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}}return t},i.prototype.disable=function(e){this.setCssClass(this.element,vt,e),this.element.setAttribute("aria-disabled",""+e)},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},i.prototype.getModuleName=function(){return"tab"},i.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,l=Object.keys(e);n<l.length;n++){switch(l[n]){case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+ht);""===i.cssClass||t.isNullOrUndefined(i.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(r)||(this.setCssClass(r,i.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=i.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+It),i=this.element.querySelector("."+St+"."+mt),s=i.id,n=s.indexOf("_"),l=parseInt(s.substring(n+1),10),r=i.innerText,o=this.element.querySelector("."+ct).querySelector("."+mt).children[0],a=o.innerHTML;t.detach(i),t.detach(o);var d={className:St+" "+ft+" "+mt,id:ut+this.tabId+"_"+l,attrs:{role:"tab","aria-controls":ct+this.tabId+"_"+l,"aria-disabled":"false","aria-selected":"true"}},h=this.createElement("span",{className:Ct,innerHTML:r,attrs:{role:"presentation"}}).outerHTML,c=this.createElement("div",{className:Nt,innerHTML:h+this.btnCls.outerHTML}).outerHTML,p=this.createElement("div",{className:Et,innerHTML:c,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",d),e.children[l+1]),this.element.querySelector("."+St+"."+mt).appendChild(p);E=this.createElement("div",{innerHTML:a});this.element.querySelector("."+ct).querySelector("."+mt).appendChild(E)}else if(this.element.querySelector("."+St+"."+mt)){t.detach(this.element.querySelector("."+St+"."+mt).children[0]),t.detach(this.element.querySelector("."+ct).querySelector("."+mt).children[0]);var u=this.items[this.selectedItem],f=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconPosition)?"":u.header.iconPosition,m=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconCss)?"":u.header.iconCss,v=u.headerTemplate||u.header.text,g=this.createElement("div",{className:Ct,attrs:{role:"presentation"}});t.isNullOrUndefined(v.tagName)?this.headerTextCompile(g,v,this.selectedItem):g.appendChild(v);var y=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+f+" "+m}),b=this.createElement("div",{className:Nt});b.appendChild(g),""!==v&&void 0!==v&&""!==m?("left"===f||"top"===f?b.insertBefore(y,b.firstElementChild):b.appendChild(y),g,this.isIconAlone=!1):(""===m?g:y)===y&&(t.detach(g),b.appendChild(y),this.isIconAlone=!0);var C=u.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var x=this.createElement("div",{className:Et,attrs:C});x.appendChild(b),"top"!==f&&"bottom"!==f||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+St+"."+mt).appendChild(x);var E=this.createElement("div"),N=u.content,I=void 0;if("string"==typeof N||t.isNullOrUndefined(N.innerHTML))if("string"==typeof N&&this.enableHtmlSanitizer&&(N=t.SanitizeHtmlHelper.sanitize(N)),"."===N[0]||"#"===N[0])if(document.querySelectorAll(N).length){var S=document.querySelector(N);I=S.outerHTML.trim(),E.appendChild(S),S.style.display=""}else this.compileElement(E,N,"content",this.selectedItem);else this.compileElement(E,N,"content",this.selectedItem);else E.appendChild(N);t.isNullOrUndefined(I)||-1===this.templateEle.indexOf(N.toString())&&this.templateEle.push(N.toString()),this.element.querySelector(".e-item."+mt).appendChild(E)}this.isReact&&this.renderReactTemplates()},dt([t.Collection([],Rt)],i.prototype,"items",void 0),dt([t.Property("100%")],i.prototype,"width",void 0),dt([t.Property("auto")],i.prototype,"height",void 0),dt([t.Property("")],i.prototype,"cssClass",void 0),dt([t.Property(0)],i.prototype,"selectedItem",void 0),dt([t.Property("Top")],i.prototype,"headerPlacement",void 0),dt([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),dt([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),dt([t.Property("Dynamic")],i.prototype,"loadOn",void 0),dt([t.Property(!1)],i.prototype,"enablePersistence",void 0),dt([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),dt([t.Property(!1)],i.prototype,"showCloseButton",void 0),dt([t.Property(!0)],i.prototype,"reorderActiveTab",void 0),dt([t.Property()],i.prototype,"scrollStep",void 0),dt([t.Property()],i.prototype,"dragArea",void 0),dt([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),dt([t.Complex({},Ht)],i.prototype,"animation",void 0),dt([t.Event()],i.prototype,"created",void 0),dt([t.Event()],i.prototype,"adding",void 0),dt([t.Event()],i.prototype,"added",void 0),dt([t.Event()],i.prototype,"selecting",void 0),dt([t.Event()],i.prototype,"selected",void 0),dt([t.Event()],i.prototype,"removing",void 0),dt([t.Event()],i.prototype,"removed",void 0),dt([t.Event()],i.prototype,"onDragStart",void 0),dt([t.Event()],i.prototype,"dragging",void 0),dt([t.Event()],i.prototype,"dragged",void 0),dt([t.Event()],i.prototype,"destroyed",void 0),i=dt([t.NotifyPropertyChanges],i)}(t.Component),jt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),qt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Ft="e-treeview",Wt="e-icon-collapsible",Vt="e-icon-expandable",_t="e-list-item",zt="e-list-text",Kt="e-list-parent",Yt="e-hover",Xt="e-active",Gt="e-icons-spinner",Qt="e-process",Jt="e-icons",Zt="e-text-content",$t="e-tree-input",ei="e-dragging",ti="e-sibling",ii="e-drop-in",si="e-drop-next",ni="e-drop-out",li="e-fullrow",ri="e-selected",oi="e-expanded",ai="e-node-collapsed",di="e-check",hi="e-stop",ci="e-checkbox-wrapper",pi="e-frame",ui="e-node-focus",fi="e-animation-active",mi={treeRole:"tree",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Property("child")],i.prototype,"child",void 0),qt([t.Property([])],i.prototype,"dataSource",void 0),qt([t.Property("expanded")],i.prototype,"expanded",void 0),qt([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),qt([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),qt([t.Property("iconCss")],i.prototype,"iconCss",void 0),qt([t.Property("id")],i.prototype,"id",void 0),qt([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),qt([t.Property("isChecked")],i.prototype,"isChecked",void 0),qt([t.Property("parentID")],i.prototype,"parentID",void 0),qt([t.Property(null)],i.prototype,"query",void 0),qt([t.Property("selected")],i.prototype,"selected",void 0),qt([t.Property(null)],i.prototype,"tableName",void 0),qt([t.Property("text")],i.prototype,"text",void 0),qt([t.Property("tooltip")],i.prototype,"tooltip",void 0),qt([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),gi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Property("SlideDown")],i.prototype,"effect",void 0),qt([t.Property(400)],i.prototype,"duration",void 0),qt([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),yi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},gi)],i.prototype,"collapse",void 0),qt([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},gi)],i.prototype,"expand",void 0),i}(t.ChildProperty),bi=function(e){function o(t,i){var s=e.call(this,t,i)||this;return s.isRefreshed=!1,s.preventExpand=!1,s.checkedElement=[],s.disableNode=[],s.validArr=[],s.validNodes=[],s.expandChildren=[],s.isFieldChange=!1,s.changeDataSource=!1,s.hasTemplate=!1,s.isFirstRender=!1,s.mouseDownStatus=!1,s}jt(o,e),a=o,o.prototype.getModuleName=function(){return"treeview"},o.prototype.preRender=function(){var e=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:Vt,ariaAttributes:mi,expandIconPosition:"Left",itemCreated:function(t){e.beforeNodeCreate(t)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new t.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),t.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),t.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),t.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},o.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},o.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},o.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},o.prototype.setDisabledMode=function(){this.disabled?this.element.classList.add("e-disabled"):this.element.classList.remove("e-disabled")},o.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},o.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+Zt+" > ."+Jt+",.e-input-group,.e-input, ."+ci};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+Zt+" > ."+Jt,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},o.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},o.prototype.setMultiSelect=function(e){var i=t.select("."+Kt,this.element);e?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable")},o.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},o.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof l.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof l.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(t){i.treeList.pop(),i.treeData=t.result,i.isNumberTypeId=i.getType(),i.setRootData(),e&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),t.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,r=[];if(e.query)n=e.query.clone();else{n=new l.Query;for(var o=this.getActualProperties(e),a=0,d=Object.keys(o);a<d.length;a++){var h=d[a];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[h]&&"url"!==h&&-1===r.indexOf(e[h])&&r.push(e[h])}n.select(r),o.hasOwnProperty("tableName")&&n.from(e.tableName)}return i.ListBase.addSorting(this.sortOrder,e.text,n),t.isNullOrUndefined(s)||t.isNullOrUndefined(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(s):s),n},o.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},o.prototype.setRootData=function(){if(this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType){this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID);var e=this.getChildNodes(this.treeData,void 0,!0);t.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e}else this.rootData=this.treeData},o.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var s=this.getSortedData(this.rootData);this.ulElement=i.ListBase.createList(this.createElement,e?this.rootData:s,this.listBaseOption),this.element.appendChild(this.ulElement);var n=this.ulElement.querySelectorAll(".e-list-item");if(!1===this.loadOnDemand)for(var l=0;l<n.length;)this.renderChildNodes(n[l],!0,null,!0),l++;(1===t.selectAll("."+Kt,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},o.prototype.updateCheckedStateFromDS=function(e){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var i=this.fields,s=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.isChecked,"equal",!0,!1)),n=0;n<s.length;n++){var r=s[n][this.fields.id]?s[n][this.fields.id].toString():null;s[n][this.fields.parentID]&&s[n][this.fields.parentID].toString();if(-1!==this.checkedNodes.indexOf(r)||this.isLoaded||this.checkedNodes.push(r),s[n][this.fields.hasChildren])for(var o=s[n][this.fields.id],a=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.parentID,"equal",o,!1)),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(h)&&this.autoCheck&&this.checkedNodes.push(h)}}for(n=0;n<this.checkedNodes.length;n++){var c=this.fields,p=new l.DataManager(this.treeData).executeLocal((new l.Query).where(c.id,"equal",this.checkedNodes[n],!0));if(p[0]&&this.autoCheck&&(this.getCheckedNodeDetails(c,p),this.checkIndeterminateState(p[0])),p.length>0){var u=p[0][this.fields.id]?p[0][this.fields.id].toString():null;this.checkedNodes.indexOf(u)>-1&&-1===this.validNodes.indexOf(u)&&this.validNodes.push(u)}for(var f=new l.DataManager(this.treeData).executeLocal((new l.Query).where(c.parentID,"equal",this.checkedNodes[n],!0)),m=0;m<f.length;m++){u=f[m][this.fields.id]?f[m][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.autoCheck&&this.checkedNodes.push(u),this.checkedNodes.indexOf(u)>-1&&-1===this.validNodes.indexOf(u)&&this.validNodes.push(u)}}}else if(2===this.dataType||this.fields.dataSource instanceof l.DataManager&&this.isOffline){for(m=0;m<this.treeData.length;m++){var v=this.treeData[m][this.fields.id]?this.treeData[m][this.fields.id].toString():"";this.treeData[m][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(v)&&this.checkedNodes.push(v),this.checkedNodes.indexOf(v)>-1&&-1===this.validNodes.indexOf(v)&&this.validNodes.push(v);var g=t.getValue(this.fields.child.toString(),this.treeData[m]);g&&this.updateChildCheckState(g,this.treeData[m])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},o.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,r=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),o=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(r||o){if(o){t.select("."+di,o)||this.changeState(o,"indeterminate",null,!0,!0)}}else{this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var a=this.getChildNodes(this.treeData,s),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===a.length&&-1===this.checkedNodes.indexOf(s)&&this.checkedNodes.push(s)}var c=new l.DataManager(this.treeData).executeLocal((new l.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},o.prototype.updateParentCheckState=function(){for(var e,i=t.selectAll(".e-stop",this.element),s=0;s<i.length;s++){var n=t.closest(i[s],"."+_t),r=n.getAttribute("data-uid").toString(),o=0;if(e=1===this.dataType?new l.DataManager(this.treeData).executeLocal((new l.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(this.treeData,r)){for(var a=0;a<e.length;a++){var d=e[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}if(o===e.length){var h=n.getAttribute("data-uid");-1===this.checkedNodes.indexOf(h)&&this.checkedNodes.push(h),this.changeState(n,"check",null,!0,!0)}else 0===o&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},o.prototype.checkIndeterminateState=function(e){var t;if(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]')){"true"!==t.querySelector("."+ci).getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0)}else if(2===this.dataType){this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())}},o.prototype.updateChildCheckState=function(e,i){for(var s=0,n=i[this.fields.id]?i[this.fields.id].toString():"",l=0;l<e.length;l++){var r=e[l][this.fields.id]?e[l][this.fields.id].toString():"";e[l][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkedNodes.push(r),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkedNodes.push(r),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&s++,this.checkedNodes.indexOf(r)>-1&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r);var o=t.getValue(this.fields.child.toString(),e[l]);o&&o.length&&(-1===this.parentCheckData.indexOf(i)&&this.parentCheckData.push(i),this.updateChildCheckState(o,e[l])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkedNodes.push(n)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var a=0;a<this.parentCheckData.length;a++)i!==this.parentCheckData[a]&&this.parentCheckData[a]&&this.checkIndeterminateState(this.parentCheckData[a])}this.parentCheckData=[]},o.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.setAttribute("role","checkbox");var s=t.select("div."+Jt,e.item),l=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var r=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(l)>-1?(t.select("."+pi,i).classList.add(di),i.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(r)||"true"!==r.toString()?i.setAttribute("aria-checked","false"):(t.select("."+pi,i).classList.add(di),i.setAttribute("aria-checked","true"),this.addCheck(e.item));var o=t.select("."+pi,i);t.EventHandler.add(o,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(o,"mouseup",this.frameMouseHandler,this)}this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(ri)&&e.item.setAttribute("aria-selected","false");var a=e.fields;if(this.addActionClass(e,a.selected,ri),this.addActionClass(e,a.expanded,oi),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+zt),h=e.item.getAttribute("data-uid");d.innerHTML="",this.renderNodeTemplate(e.curData,d,h)}var c={node:e.item,nodeData:e.curData,text:e.text};this.isRefreshed||this.trigger("drawNode",c)},o.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},o.prototype.addActionClass=function(e,i,s){var n=e.curData,l=t.getValue(i,n);t.isNullOrUndefined(l)||"false"===l.toString()||e.item.classList.add(s)},o.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof l.DataManager){for(var s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[s])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s])))return 1;return 2}s=0;for(var n=e.length;s<n;s++){if("string"==typeof i.child&&!t.isNullOrUndefined(t.getValue(i.child,e[s])))return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[s]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[s])))return 1}return 1},o.prototype.getGroupedData=function(e,t){for(var s=(new l.Query).group(t),n=i.ListBase.getDataSource(e,s),r=[],o=0;o<n.length;o++){var a=n[o].items;r.push(a)}return r},o.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},o.prototype.finalizeNode=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[s].setAttribute("alt","e-list-img");if(this.isLoaded){for(var n=t.selectAll("."+ri,e),l=0;l<n.length;l++){this.selectNode(n[l],null);break}t.removeClass(n,ri)}for(var r=t.selectAll("."+_t+":not(."+oi+")",e),o=0;o<r.length;o++){var a=t.select("div."+Jt,r[o]);a&&a.classList.contains(Vt)&&this.disableExpandAttr(r[o])}var d=t.selectAll("."+oi,e);if(!this.isInitalExpand)for(l=0;l<d.length;l++)this.renderChildNodes(d[l]);t.removeClass(d,oi),this.updateList(),this.isLoaded&&this.updateCheckedProp()},o.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},o.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[i].classList.contains(_t)&&(t.select("."+Kt,e[i])?this.ensureParentCheckState(e[i]):this.ensureChildCheckState(e[i]));else{var s=t.selectAll(".e-stop",this.element);for(i=0;i<s.length;i++)s[i].classList.remove(hi)}},o.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(Ft))return;var i=e;e.classList.contains(_t)&&(i=t.select("."+Kt,e));var s=t.selectAll("."+di,i),n=t.selectAll(".e-stop",i),l=t.selectAll("."+_t,i),r=e.getElementsByClassName(ci)[0];l.length===s.length?this.changeState(r,"check",null,!0,!0):s.length>0||n.length>0?this.changeState(r,"indeterminate",null,!0,!0):0===s.length&&this.changeState(r,"uncheck",null,!0,!0);var o=t.closest(e,"."+Kt);if(!t.isNullOrUndefined(o)){var a=t.closest(o,"."+_t);this.ensureParentCheckState(a)}}},o.prototype.ensureChildCheckState=function(e,i){if(!t.isNullOrUndefined(e)){var s=t.select("."+Kt,e),n=void 0;if(!t.isNullOrUndefined(s)){n=t.selectAll("."+ci,s);for(var l=e.getElementsByClassName(pi)[0].classList.contains(di),r=e.getElementsByClassName(pi)[0].classList.contains(hi),o=s.querySelectorAll("li"),a=(s.parentElement.getAttribute("aria-expanded"),void 0),d=0;d<n.length;d++){var h=o[d].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[d]))){var c=n[d].getElementsByClassName(pi)[0].classList.contains(di);l?a="check":c&&!this.isLoaded?a="check":-1!==this.checkedNodes.indexOf(h)&&this.isLoaded&&(r||l)?a="check":o[d].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||r)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||r)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):a="uncheck"}else a=t.getValue(this.fields.isChecked,this.currentLoadData[d])?"check":"uncheck",-1!==this.ele&&(a=l?"check":"uncheck"),"uncheck"===a&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(h)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1),a="indeterminate");this.changeState(n[d],a,i,!0,!0)}}this.autoCheck&&this.isLoaded&&this.updateParentCheckState()}},o.prototype.doCheckBoxAction=function(e,i){t.selectAll("."+_t,this.element);if(t.isNullOrUndefined(e)){var s=t.selectAll("."+ci,this.element);if(this.loadOnDemand)for(var n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck",null,null,null,i);else for(n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck")}else for(var l=e.length;l>=0;l--){var r=void 0;if(r=1===e.length?this.getElement(e[l-1]):this.getElement(e[l]),t.isNullOrUndefined(r)){var o=void 0;if(""!==(o=e[l-e.length]?e[l-e.length].toString():e[l]?e[l].toString():null)&&i&&o)this.setValidCheckedNode(o),this.dynamicCheckState(o,i);else if(-1!==this.checkedNodes.indexOf(o)&&""!==o&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(o),1);var a=this.getChildNodes(this.treeData,o);if(a){for(var d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(h)){this.checkedNodes.splice(this.checkedNodes.indexOf(h),1);var c=this.element.querySelector('[data-uid="'+h+'"]');c&&this.changeState(c,"uncheck",null)}}-1!==this.parentNodeCheck.indexOf(o)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(o),1)}o&&this.dynamicCheckState(o,i),this.updateField(this.treeData,this.fields,o,"isChecked",null)}}else{var p=t.select("."+Kt+" ."+ci,r);this.validateCheckNode(p,!i,r,null)}}if(e)for(var u=0;u<e.length;u++){o=e[u]?e[u].toString():"";i||this.updateField(this.treeData,this.fields,o,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},o.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+_t),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},o.prototype.dynamicCheckState=function(e,i){if(1===this.dataType){var s=0,n=new l.DataManager(this.treeData).executeLocal((new l.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var r=n[0][this.fields.id]?n[0][this.fields.id].toString():null,o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=((u=this.element.querySelector('[data-uid="'+o+'"]'))&&t.select(".e-stop",u),u?t.select("."+di,u):null),d=this.element.querySelector('[data-uid="'+r+'"]'),h=this.getChildNodes(this.treeData,o);if(h)for(var c=0;c<h.length;c++){var p=h[c][this.fields.id]?h[c][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(p)&&s++}-1!==this.checkedNodes.indexOf(e)&&u&&r===e&&this.autoCheck?this.changeState(u,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&r===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&r===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&u&&r===e&&this.autoCheck&&0!==s?this.changeState(u,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&u&&r===e&&this.autoCheck&&0===s?this.changeState(u,"uncheck",null):d||u||r!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof l.DataManager&&this.isOffline){r=void 0;var u=void 0;for(a=void 0,c=0;c<this.treeData.length;c++){r=this.treeData[c][this.fields.id]?this.treeData[c][this.fields.id].toString():"",a=(u=this.element.querySelector('[data-uid="'+r+'"]'))?t.select("."+di,u):null,-1===this.checkedNodes.indexOf(r)&&u&&a&&!i&&this.changeState(u,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[c]);f&&this.updateChildIndeterminate(f,r,e,i,r)}}},o.prototype.updateIndeterminate=function(e,t){var i,s=this.getTreeData(e),n=0;1===this.dataType&&(i=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null);var l=this.getChildNodes(this.treeData,i);if(l)for(var r=0;r<l.length;r++){var o=l[r][this.fields.id]?l[r][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&n++}var a=this.element.querySelector('[data-uid="'+i+'"]');a&&t?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(a,"uncheck",null):a||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)?this.parentNodeCheck.push(i):t||-1===this.checkedNodes.indexOf(i)||-1!==this.parentNodeCheck.indexOf(i)||0===n||this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1))},o.prototype.updateChildIndeterminate=function(e,i,s,n,l){for(var r=0,o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(a)&&r++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+di,d):null,p=this.element.querySelector('[data-uid="'+a+'"]'),u=p?t.select("."+di,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&a===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||a!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&a===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&a===s&&this.autoCheck&&0===r&&!n)h.classList.remove(hi);else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&a===s&&0===r)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(a)&&p&&u&&0===r)this.changeState(p,"uncheck",null);else if(!p&&!d&&a===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+l+'"]');n&&0!==r?this.changeState(f,"indeterminate",null):n&&r===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkedNodes.push(i):n||0!==r||-1===this.parentNodeCheck.indexOf(i)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i)),-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i)}}else this.autoCheck?this.changeState(d,"uncheck",null):0!==r?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[o]);m&&this.updateChildIndeterminate(m,a,s,n,l)}},o.prototype.changeState=function(e,i,s,n,l,r){var o,a=this,d=t.closest(e,"."+_t);e===d&&(e=t.select("."+ci,d)),n?this.nodeCheckAction(e,i,d,o,s,n,l,r):(this.checkActionNodes=[],o=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",o,function(t){t.cancel||a.nodeCheckAction(e,i,d,t,s,n,l,r)}))},o.prototype.nodeCheckAction=function(e,i,s,n,l,r,o,a){var d,h=e.getElementsByClassName(pi)[0];if("check"!==i||h.classList.contains(di)?"uncheck"===i&&(h.classList.contains(di)||h.classList.contains(hi))?(t.removeClass([h],[di,hi]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(di),h.classList.add(hi),this.removeCheck(s),d="mixed"):(h.classList.remove(hi),h.classList.add(di),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||e.setAttribute("aria-checked",d),o){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,l),t.isUndefined(r)&&(n.data=c)}void 0!==a&&this.ensureStateChange(s,a),r||t.isNullOrUndefined(d)||(e.setAttribute("aria-checked",d),n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},o.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkedNodes.push(i)},o.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},o.prototype.getCheckEvent=function(e,i,s){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,data:n}},o.prototype.finalize=function(){var e=t.select("."+Kt,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",mi.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+_t,this.element);i&&(t.addClass([i],ui),this.updateIdAttr(null,i)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&this.rootData[0].hasOwnProperty(this.fields.parentID),this.doExpandAction()}},o.prototype.setTextWrap=function(){(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-text-wrap"),t.Browser.isIE&&(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-ie-wrap")},o.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var i=e?t.selectAll("."+_t,e):this.liList,s=i.length,n=0;n<s;n++)this.calculateWrap(i[n])},o.prototype.calculateWrap=function(e){var i=t.select("."+li,e);i&&i.nextElementSibling&&(i.style.height=this.allowTextWrap?i.nextElementSibling.offsetHeight+"px":"")},o.prototype.doExpandAction=function(){var e=this.expandedNodes;if(this.isInitalExpand&&e.length>0)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof l.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s=t.select('[data-uid="'+e[i]+'"]',this.element);if(t.isNullOrUndefined(s))e[i]&&-1===this.expandChildren.indexOf(e[i])&&this.expandChildren.push(e[i].toString());else{var n=t.select("."+Vt,t.select("."+Zt,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null)}}this.afterFinalized()}else this.afterFinalized()},o.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()})},o.prototype.expandCallback=function(e,i){var s=t.select('[data-uid="'+e+'"]',this.element);if(t.isNullOrUndefined(s))i();else{var n=t.select("."+Vt,t.select("."+Zt,s));t.isNullOrUndefined(n)?i():this.expandAction(s,n,null,!1,i)}},o.prototype.afterFinalized=function(){if(this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,!this.isLoaded||this.isFieldChange){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0},o.prototype.doSelectionAction=function(){var e=t.selectAll("."+ri,this.element),i=this.selectedNodes;if(i.length>0){this.setProperties({selectedNodes:[]},!0);for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[s]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[s]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,ri)},o.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[t].classList.contains("e-disable")||this.selectNode(e[t],null,!0),this.allowMultiSelection);t++);},o.prototype.clickHandler=function(e){var i=e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+_t);if(n){if(3!==e.originalEvent.which){var l=t.select(".e-ripple-element",n),r=t.select("."+Jt,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var o=t.closest(i,"."+ci);if(!t.isNullOrUndefined(o)){var a=t.select("."+pi,o);return this.validateCheckNode(o,a.classList.contains(di),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(Vt)?this.expandAction(n,i,e):s.contains(Wt)?this.collapseNode(n,i,e):l&&r?r.classList.contains("e-ripple")&&r.classList.contains(Vt)?this.expandAction(n,r,e):r.classList.contains("e-ripple")&&r.classList.contains(Wt)?this.collapseNode(n,r,e):s.contains(Kt)||s.contains(_t)||this.toggleSelect(n,e.originalEvent,!1):s.contains(Kt)||s.contains(_t)||this.toggleSelect(n,e.originalEvent,!1)}this.triggerClickEvent(e.originalEvent,n)}}},o.prototype.nodeCheckedEvent=function(e,i,s){t.closest(e,"."+_t);var n=this.getCheckEvent(e,i?"uncheck":"check",s);n.data=n.data.splice(0,n.data.length-1),this.trigger("nodeChecked",n)},o.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},o.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Gt)&&this.hideSpinner(i),this.initialRender||i.classList.add("interaction"),!0!==s||!0===s&&e.classList.contains("e-expanded")){if(!0!==this.preventExpand){t.removeClass([i],Vt),t.addClass([i],Wt);var r=0,o=0,a=this,d=t.select("."+Kt,e),h=e;this.setHeight(h,d);var c=t.select("."+_t+"."+Xt,e);this.isAnimate&&!this.isRefreshed?this.aniObj.animate(d,{name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(i){h.style.overflow="hidden",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.add(fi),r=h.offsetHeight,o=t.select("."+Zt,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,r,o)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.remove(fi),n.expandedNode(h,d,i)}}):this.expandedNode(h,d,i)}}else{t.select("."+Kt,e).style.display="none",this.fields.dataSource instanceof l.DataManager==!0&&(this.preventExpand=!1)}this.initialRender&&i.classList.add("interaction")},o.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Qt),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.trigger("nodeExpanded",this.expandArgs))},o.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),t.removeClass([e],ai);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.expandedNodes.indexOf(i)||this.expandedNodes.push(i)},o.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Qt)){t.addClass([i],Qt);var l;this.isLoaded?(l=this.getExpandEvent(e,s),this.trigger("nodeCollapsing",l,function(s){s.cancel?t.removeClass([i],Qt):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,l)}},o.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],Wt),t.addClass([i],Vt);var l=0,r=0,o=this,a=t.select("."+Kt,e),d=e,h=t.select("."+_t+"."+Xt,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(i){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add(fi),l=t.select("."+Zt,e).offsetHeight,r=d.offsetHeight},progress:function(e){o.animateHeight(e,l,r)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove(fi),n.collapsedNode(d,a,i,s)}}):this.collapsedNode(d,a,i,s)},o.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Qt),this.removeExpand(e),this.isLoaded&&(n=this.getExpandEvent(e,null),this.trigger("nodeCollapsed",n))},o.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);var i=this.expandedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.expandedNodes.splice(i,1)},o.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],ai)},o.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},o.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},o.prototype.renderChildNodes=function(e,s,n,r){var o=this,a=t.select("div."+Jt,e);if(!t.isNullOrUndefined(a)){this.showSpinner(a);var d;if(this.fields.dataSource instanceof l.DataManager){var h=this.parents(e,"."+Kt).length,c=this.getChildFields(this.fields,h,1);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c.dataSource))return t.detach(a),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof l.DataManager&&this.isOffline?(this.treeList.pop(),d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(d,c,a,e,s,n,r)):c.dataSource.executeQuery(this.getQuery(c,e.getAttribute("data-uid"))).then(function(t){o.treeList.pop(),d=t.result,1===o.dataType&&(o.dataType=2),o.loadChild(d,c,a,e,s,n,r)}).catch(function(e){o.trigger("actionFailure",{error:e})})}else{if(d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.currentLoadData=this.getSortedData(d),t.isNullOrUndefined(d)||0===d.length)return t.detach(a),void this.removeExpand(e,!0);this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(e,a,r),this.setSelectionForChildNodes(d),this.ensureCheckNode(e),this.finalizeNode(e),this.disableTreeNodes(d),this.renderSubChild(e,s,r)}}},o.prototype.loadChild=function(e,s,n,r,o,a,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(r,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof l.DataManager&&!this.isOffline){var h=r.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(r.getAttribute("aria-level"))+1,r.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(r,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(r),this.finalizeNode(r),this.disableTreeNodes(e),this.renderSubChild(r,o,d)}a&&a(),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.disableTreeNodes=function(e){for(var t=0;t<e.length;){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},o.prototype.setSelectionForChildNodes=function(e){var t;for(t=0;t<e.length;t++){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},o.prototype.ensureCheckNode=function(e){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e),this.ensureParentCheckState(e))),this.currentLoadData=null},o.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},o.prototype.getChildNodes=function(e,i,s){void 0===s&&(s=!1);var n;if(t.isNullOrUndefined(e))return n;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)for(var l=0,r=e.length;l<r;l++){var o=t.getValue(this.fields.id,e[l]);if(o&&o.toString()===i)return t.getValue(this.fields.child,e[l]);if(!t.isNullOrUndefined(t.getValue(this.fields.child,e[l]))&&void 0!==(n=this.getChildNodes(t.getValue(this.fields.child,e[l]),i)))break}return n},o.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,l=e.length;n<l;n++){if(t.isNullOrUndefined(e[n][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[n][0])))return s?e[n]:[];if(t.getValue(this.fields.parentID,e[n][0]).toString()===i)return e[n]}},o.prototype.renderSubChild=function(e,i,s){if(i)for(var n=t.selectAll("."+Vt,e),l=0,r=n.length;l<r;l++){var o=n[l];if(e.querySelector(".e-icons")!==n[l]){var a=t.closest(o,"."+_t);this.expandArgs=this.getExpandEvent(a,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(a,i,null,s)}}},o.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},o.prototype.isActive=function(e){return!!e.classList.contains(Xt)},o.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))this.setFocusElement(e);else{var l;this.isLoaded?(l=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",l,function(t){t.cancel||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,l,s)}},o.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var l=this.liList.indexOf(this.startNode),r=this.liList.indexOf(e);if(l>r){var o=l;l=r,r=o}for(var a=l;a<=r;a++){var d=this.liList[a];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.setFocusElement(e),this.isLoaded&&(s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s))},o.prototype.unselectNode=function(e,t){var i,s=this;this.isLoaded?(i=this.getSelectEvent(e,"un-select",t),this.trigger("nodeSelecting",i,function(t){t.cancel||s.nodeUnselectAction(e,t)})):this.nodeUnselectAction(e,i)},o.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},o.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&t.removeClass([i],ui),t.addClass([e],ui),this.updateIdAttr(i,e)}},o.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],Xt);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},o.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],Xt);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},o.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+Xt),i=0,s=e;i<s.length;i++){var n=s[i];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}t.removeClass(e,Xt),this.setProperties({selectedNodes:[]},!0)},o.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},o.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},o.prototype.expandHandler=function(e){var i=e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(Ft)||i.classList.contains(Kt)||i.classList.contains(_t)||i.classList.contains(Jt)||this.showCheckBox&&t.closest(i,"."+ci)||this.expandCollapseAction(t.closest(i,"."+_t),e)},o.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+Jt,e);if(s&&!s.classList.contains(Qt)){var n=s.classList;n.contains(Vt)?this.expandAction(e,s,i):n.contains(Wt)&&this.collapseNode(e,s,i)}},o.prototype.expandAction=function(e,i,s,n,l){var r=this;i.classList.contains(Qt)||(t.addClass([i],Qt),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Qt):r.nodeExpandAction(e,i,n,l)})):this.nodeExpandAction(e,i,n,l))},o.prototype.nodeExpandAction=function(e,i,s,n){var l=t.select("."+Kt,e);if(l&&"UL"===l.nodeName)this.expandNode(e,i);else{this.isFirstRender=!0,this.renderChildNodes(e,s,n);for(var r=t.selectAll("."+_t,e),o=0;o<r.length;o++){var a=this.getId(r[o]);if(-1!==this.expandChildren.indexOf(a)&&void 0!==this.expandChildren){var d=t.select("."+Vt,t.select("."+Zt,r[o]));t.isNullOrUndefined(d)||this.expandAction(r[o],d,null),this.expandChildren.splice(this.expandChildren.indexOf(a),1)}}}},o.prototype.keyActionHandler=function(e){var i=this,s=e.target,n=this.getFocusedNode();if(s&&s.classList.contains("e-input")){var l=s;"enter"===e.action?(l.blur(),this.element.focus(),t.addClass([n],Yt)):"escape"===e.action&&(l.value=this.oldText,l.blur(),this.element.focus(),t.addClass([n],Yt))}else{e.preventDefault();var r={cancel:!1,event:e,node:n};this.trigger("keyPress",r,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox&&i.checkNode(e);break;case"moveRight":i.openNode(!i.enableRtl,e);break;case"moveLeft":i.openNode(!!i.enableRtl,e);break;case"shiftDown":i.shiftKeySelect(!0,e);break;case"moveDown":case"ctrlDown":case"csDown":i.navigateNode(!0);break;case"shiftUp":i.shiftKeySelect(!1,e);break;case"moveUp":case"ctrlUp":case"csUp":i.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":i.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":i.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n,e);break;case"ctrlA":if(i.allowMultiSelection){var l=t.selectAll("."+_t+":not(."+Xt+")",i.element);i.selectGivenNodes(l)}}})}},o.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+Zt),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var l=n.getBoundingClientRect();s.bottom>l.bottom?n.scrollTop+=s.bottom-l.bottom:s.top<l.top&&(n.scrollTop-=l.top-s.top)}this.isVisibleInViewport(i)||i.scrollIntoView(e)},o.prototype.isVisibleInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},o.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},o.prototype.shiftKeySelect=function(e,t){if(this.allowMultiSelection){var i=this.getFocusedNode(),s=e?this.getNextNode(i):this.getPrevNode(i);this.removeHover(),this.setFocusElement(s),this.toggleSelect(s,t,!1),this.navigateToFocus(!e)}else this.navigateNode(e)},o.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+ci,i),n=t.select(" ."+pi,s).classList.contains(di);i.classList.contains("e-disable")||0==i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},o.prototype.validateCheckNode=function(e,i,s,n){var l=this,r=t.closest(e,"."+_t);this.checkActionNodes=[];var o=i?"false":"true";t.isNullOrUndefined(o)||e.setAttribute("aria-checked",o);var a=this.getCheckEvent(r,i?"uncheck":"check",n);this.trigger("nodeChecking",a,function(t){t.cancel||l.nodeCheckingAction(e,i,s,t,n)})},o.prototype.nodeCheckingAction=function(e,i,s,n,l){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))&&(this.checkedElement.push(s.getAttribute("data-uid")),this.autoCheck)){var r=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==r?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null}if(this.changeState(e,i?"uncheck":"check",l,!0),this.autoCheck){this.ensureChildCheckState(s),this.ensureParentCheckState(t.closest(t.closest(s,"."+Kt),"."+_t));var o=void 0;"check"===n.action?o=!0:"uncheck"===n.action&&(o=!1),this.ensureStateChange(s,o)}this.nodeCheckedEvent(e,i,l)},o.prototype.ensureStateChange=function(e,i){var s=t.select("."+Kt,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck)for(var o=new l.DataManager(this.treeData).executeLocal((new l.Query).where(r.parentID,"equal",n,!0)),a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null,h=o[a][this.fields.isChecked]?o[a][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)){this.checkedNodes.push(d);var c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}else if(-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d)){var p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}}else{c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i)}}else if(1!==this.dataType||this.autoCheck){(c=this.getChildNodes(this.treeData,n))&&this.childStateChange(c,n,s,i)}else if(i)for(a=0;a<this.treeData.length;a++){var u=this.treeData[a][this.fields.id]?this.treeData[a][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.checkedNodes.push(u)}else{for(var f=new l.DataManager(this.treeData).executeLocal((new l.Query).where(r.isChecked,"equal",!0,!1)),a=0;a<f.length;a++){var m=f[a][this.fields.id]?f[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(m)&&this.checkedNodes.splice(this.checkedNodes.indexOf(m),1),this.updateField(this.treeData,this.fields,m,"isChecked",null)}this.checkedNodes=[]}},o.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[i][this.fields.id]?e[i][this.fields.id].toString():null,n=e[i][this.fields.isChecked]?e[i][this.fields.isChecked].toString():null;-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkedNodes.push(s),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null);var l=this.getChildNodes(this.treeData,s);l.length>0&&this.getChildItems(l,t)}},o.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var l=e[n][this.fields.id]?e[n][this.fields.id].toString():"",r=e[n][this.fields.isChecked]?e[n][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(l)?(this.checkedNodes.push(l),-1!==this.parentNodeCheck.indexOf(l)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(l),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(l)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(l),1),"true"===r&&this.updateField(this.treeData,this.fields,l,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l):(-1!==this.checkedNodes.indexOf(l)&&this.checkedNodes.splice(this.checkedNodes.indexOf(l),1),this.updateField(this.treeData,this.fields,l,"isChecked",null),this.checkedNodes=[]));var o=this.getChildNodes([e[n]],l);o&&this.childStateChange(o,t,i,s)}},o.prototype.allCheckNode=function(e,i,s,n,l){if(e)for(var r=0;r<e.length;r++){var o=t.getValue(this.fields.id,e[r]),a=this.element.querySelector('[data-uid="'+o+'"]');!1!==l&&-1===this.checkedElement.indexOf(o.toString())&&(null===a&&!t.isNullOrUndefined(e[r][this.fields.isChecked])&&-1===i.indexOf(o.toString())||0===n||2===s)&&(!1!==e[r][this.fields.isChecked]||2===s?i.push(o.toString()):n=null,n=!1!==e[r][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(o.toString())&&t.isNullOrUndefined(s)&&i.push(o.toString());var d=t.getValue(this.fields.child.toString(),e[r]);if(!0===t.getValue(this.fields.hasChildren,e[r])||d){var h=t.getValue(this.fields.id,e[r]),c=void 0;(c=1===this.dataType?this.getChildNodes(this.treeData,h.toString()):d)&&(t.isNullOrUndefined(l)?this.allCheckNode(c,i,s,n):this.allCheckNode(c,i,s,n,l),n=null)}n=null}},o.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+Jt,s);if(e){if(!n)return;n.classList.contains(Vt)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(Wt))this.collapseNode(s,n,i);else{var l=t.closest(t.closest(s,"."+Kt),"."+_t);if(!l)return;l.classList.contains("e-disable")||(this.setFocus(s,l),this.navigateToFocus(!0))}},o.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},o.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},o.prototype.getFocusedNode=function(){var e,i=t.select("."+_t+"."+ui,this.element);return t.isNullOrUndefined(i)&&(e=t.select("."+_t,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},o.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);if(this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")){var s=i.lastChild;null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")?this.focusNextNode(i,!1):null==i.nextSibling&&s.classList.contains(Zt)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},o.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[i],i++}while(!t.isVisible(e));return e},o.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[i],i--}while(!t.isVisible(e));return e},o.prototype.setFocus=function(e,i){t.removeClass([e],[Yt,ui]),i.classList.contains("e-disable")||(t.addClass([i],[Yt,ui]),this.updateIdAttr(e,i))},o.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},o.prototype.focusIn=function(){this.mouseDownStatus||t.addClass([this.getFocusedNode()],Yt),this.mouseDownStatus=!1},o.prototype.focusOut=function(){t.removeClass([this.getFocusedNode()],Yt)},o.prototype.onMouseOver=function(e){var i=e.target,s=i.classList,n=t.closest(i,"."+_t);!n||s.contains(Kt)||s.contains(_t)?this.removeHover():n&&!n.classList.contains("e-disable")&&this.setHover(n)},o.prototype.setHover=function(e){e.classList.contains(Yt)||(this.removeHover(),t.addClass([e],Yt))},o.prototype.onMouseLeave=function(e){this.removeHover()},o.prototype.removeHover=function(){var e=t.selectAll("."+Yt,this.element);e&&e.length&&t.removeClass(e,Yt)},o.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(_t)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(Ft)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),l=t.closest(e.parentNode,"."+_t),r=l?l.getAttribute("data-uid"):null,o=e.classList.contains(Xt),a="true"===e.getAttribute("aria-expanded"),d=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+Vt,e)||t.select("."+Wt,e)),h=null;return this.showCheckBox&&(h=t.select("."+ci,e).getAttribute("aria-checked")),{id:s,text:n,parentID:r,selected:o,expanded:a,isChecked:h,hasChildren:d}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},o.prototype.getText=function(e,i){if(i){var s=this.getNodeObject(e.getAttribute("data-uid")),n=parseFloat(e.getAttribute("aria-level")),l=this.getFields(this.fields,n,1);return t.getValue(l.text,s)}return t.select("."+zt,e).textContent},o.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},o.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i,this.root);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},o.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},o.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",t.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},o.prototype.setCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},o.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(Ft)||i.classList.contains(Kt)||i.classList.contains(_t)||i.classList.contains(Jt)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+_t);this.createTextbox(s,e)}},o.prototype.createTextbox=function(e,i){var s=this,n=t.select("."+$t,this.element);n&&n.blur();var l=t.select("."+zt,e);this.updateOldText(e);var o=this.createElement("input",{className:$t,attrs:{value:this.oldText}}),a=this.getEditEvent(e,null,o.outerHTML);this.trigger("nodeEditing",a,function(i){if(!i.cancel){var n="width:"+(l.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(e),l.innerHTML=a.innerHtml;var o=t.select("."+$t,l);s.inputObj=r.Input.createInput({element:o,properties:{enableRtl:s.enableRtl}},s.createElement),s.inputObj.container.setAttribute("style",n),o.focus();var d=o;d.setSelectionRange(0,d.value.length),s.wireInputEvents(o)}})},o.prototype.updateOldText=function(e){var i=e.getAttribute("data-uid");this.editData=this.getNodeObject(i);var s=parseFloat(e.getAttribute("aria-level"));this.editFields=this.getFields(this.fields,s,1),this.oldText=t.getValue(this.editFields.text,this.editData)},o.prototype.inputFocusOut=function(e){if(t.select("."+$t,this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+zt),r=t.closest(i,"."+_t);t.detach(this.inputObj.container),this.fields.dataSource instanceof l.DataManager&&!this.isOffline?this.crudOperation("update",null,r,s,null,null,!0):this.appendNewText(r,n,s,!0)}},o.prototype.appendNewText=function(e,t,i,s){var n=this,l=this.getEditEvent(e,i,null);this.trigger("nodeEdited",l,function(l){i=l.cancel?l.oldText:l.newText,n.updateText(e,t,i,s),l.oldText!==i&&n.triggerEvent()})},o.prototype.updateText=function(e,i,s,n){var l=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))i.innerText=s;else{i.innerText="";var r=e.getAttribute("data-uid");this.renderNodeTemplate(l,i,r),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),i.focus()),this.allowTextWrap&&this.calculateWrap(e)},o.prototype.getElement=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?t.getElement(e):null},o.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},o.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},o.prototype.getNodeObject=function(e){if(!t.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var i=0,s=this.treeData.length;i<s;i++){var n=t.getValue(this.fields.id,this.treeData[i]);if(!t.isNullOrUndefined(this.treeData[i])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[i]}}},o.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var r=0,o=e.length;r<o;r++){var a=t.getValue(i.id,e[r]);if(e[r]&&a&&a.toString()===s)return e[r];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[r]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[r]),this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[r]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},o.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},o.prototype.initializeDrag=function(){var e,i=this,s=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Zt,helper:function(n){i.dragTarget=n.sender.target;var l=t.closest(i.dragTarget,"."+Ft),r=t.closest(i.dragTarget,"."+Zt);if(i.dragLi=t.closest(i.dragTarget,"."+_t),i.fullRowSelect&&!r&&i.dragTarget.classList.contains(li)&&(r=i.dragTarget.nextElementSibling),!i.dragTarget||!n.element.isSameNode(l)||!r||i.dragTarget.classList.contains(Ft)||i.dragTarget.classList.contains(Kt)||i.dragTarget.classList.contains(_t)||i.dragLi.classList.contains("e-disable"))return!1;var o=r.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+Jt,o))){var a=s.createElement("div",{className:Jt+" "+Vt});o.insertBefore(a,o.children[0])}var d="e-drag-item "+Ft+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=s.createElement("div",{className:d})).appendChild(o);var h=i.selectedNodes.length;if(h>1&&i.allowMultiSelection&&i.dragLi.classList.contains(Xt)){var c=s.createElement("span",{className:"e-drop-count",innerHTML:""+h});e.appendChild(c)}return document.body.appendChild(e),document.body.style.cursor="",i.dragData=i.getNodeData(i.dragLi),e},dragStart:function(s){t.addClass([i.element],ei);var n,l=t.closest(s.target,".e-list-item");l&&(n=parseInt(l.getAttribute("aria-level"),10));var r=i.getDragEvent(s.event,i,null,s.target,null,e,n);r.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",r,function(t){t.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0})},drag:function(s){i.dragObj.setProperties({cursorAt:{top:!t.isNullOrUndefined(s.event.targetTouches)||t.Browser.isDevice?60:-20}}),i.dragAction(s,e)},dragStop:function(e){t.removeClass([i.element],ei),i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable");s&&n||(t.detach(e.helper),document.body.style.cursor="");var l,r=t.closest(s,".e-list-item");r&&(l=parseInt(r.getAttribute("aria-level"),10));var o=i.getDragEvent(e.event,i,s,s,null,e.helper,l);o.preventTargetExpand=!1,i.trigger("nodeDragStop",o,function(s){i.dragParent=s.draggedParentNode,i.preventExpand=s.preventTargetExpand,s.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor=""),i.dragStartAction=!1})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){t.isNullOrUndefined(e)||e.target.classList.contains(ti)||(document.body.style.cursor="not-allowed")},over:function(e){document.body.style.cursor=""},drop:function(e){i.dropAction(e)}})},o.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],ei),this.dragStartAction=!1},o.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+Zt),l=t.select("div."+Jt,i);t.removeClass([l],[ii,si,ni,"e-no-drop"]),this.removeVirtualEle(),document.body.style.cursor="";var r=e.target.classList;if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(r)&&r.contains(li)&&(n=e.target.nextElementSibling),s){var o=t.closest(e.target,"."+_t),a=t.closest(e.target,"."+ci),d=t.closest(e.target,"."+Wt),h=t.closest(e.target,"."+Vt);if(!s.classList.contains(Ft)||n&&!o.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,o))if(this.hasTemplate&&o){var c=t.select(this.fullRowSelect?"."+li:"."+Zt,o);if(e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){var p=this.fullRowSelect?1:0;this.appendIndicator(o,l,p)}else if(e&&!h&&!d&&!a&&c&&e.event.offsetY>c.offsetHeight-10||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,l,p)}else t.addClass([l],ii)}else if(o&&e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,l,p)}else if(o&&e&&!h&&!d&&e.target.offsetHeight>0&&e.event.offsetY>e.target.offsetHeight-10&&!a||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,l,p)}else t.addClass([l],ii);else"LI"!==e.target.nodeName||o.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,o)?e.target.classList.contains(ti)?t.addClass([l],si):t.addClass([l],ni):(t.addClass([l],si),this.renderVirtualEle(e))}else t.addClass([l],"e-no-drop"),document.body.style.cursor="not-allowed";var u,f=t.closest(e.target,".e-list-item");f&&(u=parseInt(f.getAttribute("aria-level"),10));var m=this.getDragEvent(e.event,this,e.target,e.target,null,i,u);m.dropIndicator&&t.removeClass([l],m.dropIndicator),this.trigger("nodeDragging",m),m.dropIndicator&&t.addClass([l],m.dropIndicator)},o.prototype.appendIndicator=function(e,i,s){t.addClass([i],si);var n=this.createElement("div",{className:ti});e.insertBefore(n,e.children[s])},o.prototype.dropAction=function(e){var i,s,n,r=e.event.offsetY,o=e.target,d=!1;n=e.dragData.draggable;for(var h=0;h<n.ej2_instances.length;h++)if(n.ej2_instances[h]instanceof a){i=n.ej2_instances[h];break}if(i&&i.dragTarget){var c=i.dragTarget,p=t.closest(c,"."+_t),u=t.closest(o,"."+_t);if(null==u&&o.classList.contains(Ft)&&(u=o.firstElementChild),t.detach(e.droppedElement),document.body.style.cursor="",!u||u.isSameNode(p)||this.isDescendant(p,u))return void(this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1));if(i.allowMultiSelection&&p.classList.contains(Xt)){var f=t.selectAll("."+Xt,i.element);if(e.target.offsetHeight<=33&&r>e.target.offsetHeight-10&&r>6)for(h=f.length-1;h>=0;h--)u.isSameNode(f[h])||this.isDescendant(f[h],u)||this.appendNode(o,f[h],u,e,i,r);else for(h=0;h<f.length;h++)u.isSameNode(f[h])||this.isDescendant(f[h],u)||this.appendNode(o,f[h],u,e,i,r)}else this.appendNode(o,p,u,e,i,r);s=parseInt(p.getAttribute("aria-level"),10),d=!0}this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1),this.trigger("nodeDropped",this.getDragEvent(e.event,i,o,e.target,e.dragData.draggedElement,null,s,d)),i.element.id!==this.element.id&&i.triggerEvent(),this.triggerEvent()},o.prototype.appendNode=function(e,i,s,n,l,r){var o=t.closest(e,"."+ci),a=t.closest(n.target,"."+Wt),d=t.closest(n.target,"."+Vt);i.classList.contains("e-disable")||o||!(d&&n.event.offsetY<5||a&&n.event.offsetX<3||d&&n.event.offsetY>19||a&&n.event.offsetX>19||!d&&!a)?this.dropAsChildNode(i,s,l,null,n,r,!0):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,l):e.firstElementChild&&e.classList.contains(Ft)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,l):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,l):this.dropAsChildNode(i,s,l,null,n,r)},o.prototype.dropAsSiblingNode=function(e,i,s,n){var l,r=t.closest(i,"."+Kt),o=t.closest(e,"."+Kt),a=t.closest(o,"."+_t);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?l=!1:s.event.offsetY<2?l=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?l=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(l=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");r.insertBefore(e,l?d:d.nextElementSibling)}else r.insertBefore(e,l?s.target:s.target.nextElementSibling);this.moveData(e,i,r,l,n),this.updateElement(o,a),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},o.prototype.dropAsChildNode=function(e,i,s,n,l,r,o){var a,d=t.closest(e,"."+Kt),h=t.closest(d,"."+_t),c=t.closest(i,"."+Kt);if(l&&l.target&&(a=t.select(this.fullRowSelect?"."+li:"."+Zt,i)),l&&r<7&&!o)c.insertBefore(e,i),this.moveData(e,i,c,!0,s);else if(l&&l.target.offsetHeight>0&&r>l.target.offsetHeight-10&&!o&&!this.hasTemplate)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else if(this.hasTemplate&&a&&r>a.offsetHeight-10&&!o)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else{var p=this.expandParent(i),u=p.childNodes[n];p.insertBefore(e,u),this.moveData(e,u,p,!0,s)}this.updateElement(d,h),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},o.prototype.moveData=function(e,i,s,n,l){var r=t.closest(s,"."+_t),o=this.getId(e),a=l.updateChildField(l.treeData,l.fields,o,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(r);if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);var p=t.isNullOrUndefined(h)?this.treeData.length:n?h:h+1;if(t.isNullOrUndefined(c)&&!this.hasPid)delete a[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,a[0])}if(this.treeData.splice(p,0,a[0]),l.element.id!==this.element.id){var f=l.removeChildNodes(o);p++;for(var m=0,v=f.length;m<v;m++)this.treeData.splice(p,0,f[m]),p++;l.groupedData=l.getGroupedData(l.treeData,l.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,c,a,n?h:h+1)},o.prototype.expandParent=function(e){var s=t.select("div."+Jt,e);s&&s.classList.contains(Vt)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+Kt,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+Kt,e),t.isNullOrUndefined(n)||!0!==this.preventExpand||(n.style.display="none"),t.isNullOrUndefined(n)||!1!==this.preventExpand||(n.style.display="block"),t.isNullOrUndefined(n)&&!0===this.preventExpand){t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,Vt,this.listBaseOption);(l=t.select("div."+Jt,e))&&l.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),l?t.removeClass([l],Wt):i.ListBase.generateIcon(this.createElement,e,Vt,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"}if(t.isNullOrUndefined(n)){this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,Wt,this.listBaseOption);var l;(l=t.select("div."+Jt,e))?t.removeClass([l],Vt):(i.ListBase.generateIcon(this.createElement,e,Wt,this.listBaseOption),l=t.select("div."+Jt,e),t.removeClass([l],Vt)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}return n},o.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+Jt,i);t.detach(e),t.detach(s);var n=this.getId(i);this.updateField(this.treeData,this.fields,n,"hasChildren",!1),this.removeExpand(i,!0)}},o.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+Kt).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+Kt,e),i+1)},o.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,l=s.length;n<l;n++){var r=s[n];r.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+Kt,r),i+1)}},o.prototype.renderVirtualEle=function(e){var t;e.event.offsetY>e.target.offsetHeight-2?t=!1:e.event.offsetY<2&&(t=!0);var i=this.createElement("div",{className:ti}),s=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(i,e.target.children[s])},o.prototype.removeVirtualEle=function(){var e=t.select("."+ti);e&&t.detach(e)},o.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},o.prototype.getDragEvent=function(e,i,s,n,r,o,a,d){var h=s?t.closest(s,"."+_t):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:r,u=i?i.dragData:null,f=s?this.parents(s,"."+_t):null,m=i.dragLi.parentElement,v=i.dragLi?t.closest(m,"."+_t):null,g=null,y=null,b=[si,ii,ni,"e-no-drop"],C=null,x=!0===d?p:h,E=x?t.closest(x,".e-list-parent"):null,N=0,I=null;if(v=i.dragLi&&null===v?t.closest(m,"."+Ft):v,v=!0===d?this.dragParent:v,o)for(;N<4;){if(t.select("."+Jt,o).classList.contains(b[N])){C=b[N];break}N++}if(E){var S=0;for(N=0;N<E.childElementCount;N++){if(S=!0!==d&&E.children[N]===p&&h!==p?++S:S,!0!==d&&E.children[N].classList.contains("e-hover")){y=e.offsetY>=23?N+1:N;break}if(E.children[N]===x){e.offsetY,y=N;break}}y=0!==S?--y:y,I="e-drop-in"==C?"Inside":e.offsetY<7?"Before":"After"}if(s&&(g=0===f.length?null:s.classList.contains(_t)?f[0]:f[1]),h===p&&(g=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(g=h,!0!==d)){a=++a;var O=g?t.select(".e-list-parent",g):null;if(y=O?O.children.length:0,!(this.fields.dataSource instanceof l.DataManager)&&null===O&&g){var w=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null;y=w?w.length:0}}return{cancel:!1,clonedNode:o,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:a,draggedParentNode:v,dropTarget:g,dropIndicator:C,target:n,position:I}},o.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(var s=0;s<i;s++)this.createFullRow(this.liList[s]);else for(s=0;s<i;s++){var n=t.select("."+li,this.liList[s]);t.detach(n)}},o.prototype.createFullRow=function(e){var t=this.createElement("div",{className:li});e.insertBefore(t,e.childNodes[0])},o.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=t.selectAll("."+_t+':not([aria-selected="true"])',this.element);i<s.length;i++){s[i].setAttribute("aria-selected","false")}else for(var n=0,l=t.selectAll("."+_t+'[aria-selected="false"]',this.element);n<l.length;n++){l[n].removeAttribute("aria-selected")}},o.prototype.collapseByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),l=0,r=n.length;l<r;l++){var o=n[l],a=t.select("."+Wt,t.select("."+Zt,o));t.isNullOrUndefined(a)||this.collapseNode(o,a,null),this.collapseByLevel(t.select("."+Kt,o),i-1,s)}},o.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+Wt,this.element)),s=0,n=i.length;s<n;s++){var l=i[s],r=t.closest(l,"."+_t);this.collapseNode(r,l,null)}},o.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),l=0,r=n.length;l<r;l++){var o=n[l],a=t.select("."+Vt,t.select("."+Zt,o));t.isNullOrUndefined(a)||this.expandAction(o,a,null),this.expandByLevel(t.select("."+Kt,o),i-1,s)}},o.prototype.expandAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+Vt,this.element)),s=0,n=i.length;s<n;s++){var l=i[s],r=t.closest(l,"."+_t);this.expandAction(r,l,null,!0)}},o.prototype.getVisibleNodes=function(e,i){var s=Array.prototype.slice.call(i);if(e)for(var n=0;n<s.length;n++)t.isVisible(s[n])||(s.splice(n,1),n--);return s},o.prototype.removeNode=function(e){var i=t.closest(e,"."+Kt),s=t.closest(i,"."+_t);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.removeData(e)},o.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},o.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+_t,this.element))},o.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=t.selectAll("."+Xt,this.element);this.selectGivenNodes(e)},o.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=t.selectAll('[aria-expanded="true"]',this.element),i=0,s=e.length;i<s;i++)this.addExpand(e[i])},o.prototype.removeData=function(e){if(1===this.dataType){var t=new l.DataManager(this.treeData),i=this.getId(e),s={},n=this.isNumberTypeId?parseFloat(i):i;s[this.fields.id]=n,t.remove(this.fields.id,s),this.removeChildNodes(i)}else{i=this.getId(e);this.updateChildField(this.treeData,this.fields,i,null,null,!0)}},o.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,r=i.length;n<r;n++){var o=new l.DataManager(this.treeData),a=t.getValue(this.fields.id,i[n]).toString(),d={},h=this.isNumberTypeId?parseFloat(a):a;d[this.fields.id]=h;var c=o.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(a)}return s},o.prototype.doGivenAction=function(e,i,s){for(var n=0,l=e.length;n<l;n++){var r=this.getElement(e[n]);if(!t.isNullOrUndefined(r)){var o=t.select("."+i,t.select("."+Zt,r));t.isNullOrUndefined(o)||(s?this.expandAction(r,o,null):this.collapseNode(r,o,null))}}},o.prototype.addGivenNodes=function(e,s,n,l,r){if(0!==e.length){var o=this.getSortedData(e),a=s?parseFloat(s.getAttribute("aria-level"))+1:1;l&&this.updateMapper(a);var d,h=i.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a),c=(d=r||(s?this.expandParent(s):t.select("."+Kt,this.element))).childNodes[n];if(c||"None"===this.sortOrder)for(var p=0;p<h.length;p++)d.insertBefore(h[p],c);if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder)){var u=d.childNodes;for(p=0;p<h.length;p++)for(var f=0;f<u.length;f++){if("Ascending"===this.sortOrder?u[f].textContent.toUpperCase()>h[p].innerText.toUpperCase():u[f].textContent.toUpperCase()<h[p].innerText.toUpperCase()){d.insertBefore(h[p],u[f]);break}d.insertBefore(h[p],u[u.length])}}var m=this.getId(s);if(1===this.dataType){this.updateField(this.treeData,this.fields,m,"hasChildren",!0);var v=this.getId(c),g=t.isNullOrUndefined(v)?this.treeData.length:this.getDataPos(this.treeData,this.fields,v);for(f=0;f<e.length;f++){if(!t.isNullOrUndefined(m)){var y=this.isNumberTypeId?parseFloat(m):m;t.setValue(this.fields.parentID,y,e[f])}this.treeData.splice(g,0,e[f]),g++}}else this.addChildData(this.treeData,this.fields,m,e,n);this.finalizeNode(d)}},o.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},o.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=t.hasOwnProperty("navigateUrl")?t.navigateUrl:"navigateUrl"},o.prototype.getDataPos=function(e,i,s){for(var n=null,r=0,o=e.length;r<o;r++){var a=t.getValue(i.id,e[r]);if(e[r]&&a&&a.toString()===s)return r;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[r]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){var d=t.getValue("child",e[r]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[r]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},o.prototype.addChildData=function(e,i,s,n,r){var o;if(t.isNullOrUndefined(s)){r=t.isNullOrUndefined(r)?e.length:r;for(var a=0,d=n.length;a<d;a++)e.splice(r,0,n[a]),r++;return o}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[h]);if(e[h]&&p&&p.toString()===s){if("string"==typeof i.child&&e[h].hasOwnProperty(i.child)&&null!==e[h][i.child]||this.fields.dataSource instanceof l.DataManager&&e[h].hasOwnProperty("child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[h]);t.isNullOrUndefined(f)&&(f=[]),r=t.isNullOrUndefined(r)?f.length:r;for(a=0,d=n.length;a<d;a++)f.splice(r,0,n[a]),r++}else{u="string"==typeof i.child?i.child:"child";e[h][u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[h]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[h]))){f=t.getValue("child",e[h]);if(void 0!==(o=this.addChildData(f,this.getChildMapper(i),s,n,r)))break}}else{var m=t.getValue(i.child,e[h]);if(void 0!==(o=this.addChildData(m,this.getChildMapper(i),s,n,r)))break}}return o},o.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,l=s.length;n<l;n++){var r=s[n][this.fields.id].toString();r&&-1===this.disableNode.indexOf(r)&&this.disableNode.push(r);var o=this.getElement(r);o&&(o.setAttribute("aria-disabled","true"),t.addClass([o],"e-disable"))}},o.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var l=this.getElement(i[s]),r=i[s];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),l&&(l.removeAttribute("aria-disabled"),t.removeClass([l],"e-disable"))}},o.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[i]?n=e[i]?e[i].toString():null:"object"==typeof e[i]&&(n=e[i]?e[i].getAttribute("data-uid").toString():null),-1==t.indexOf(n)&&t.push(n)}return t},o.prototype.checkValidId=function(e){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(t){return-1!==e.indexOf(t[i.fields.id]?t[i.fields.id].toString():null)});else if(2===this.dataType)for(var s=0;s<this.treeData.length;s++){var n=this.treeData[s][this.fields.id]?this.treeData[s][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[s]);var l=t.getValue(this.fields.child.toString(),this.treeData[s]);l&&this.filterNestedChild(l,e)}return this.validArr},o.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[s][this.fields.id]?e[s][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[s]);var l=t.getValue(this.fields.child.toString(),e[s]);l&&this.filterNestedChild(l,i)}},o.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},o.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[t],"selected",!0);for(var s=this.expandedNodes,n=0,l=s.length;n<l;n++)this.updateField(this.treeData,this.fields,s[n],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);var r=this.checkedNodes,o=0;for(l=r.length;o<l;o++)this.updateField(this.treeData,this.fields,r[o],"isChecked",!0)}},o.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,r=e.length;n<r;n++){for(var o=0;o<s.length;o++){var a=this.getMapperProp(i,s[o]);t.isNullOrUndefined(e[n][a])||delete e[n][a]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[n]))?this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[n]))&&this.removeField(t.getValue("child",e[n]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[n]),this.getChildMapper(i),s)}},o.prototype.getMapperProp=function(e,i){switch(i){case"selected":return t.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return t.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return t.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return t.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return i}},o.prototype.updateField=function(e,i,s,n,r){if(!t.isNullOrUndefined(s))if(1===this.dataType){var o=this.isNumberTypeId?parseFloat(s):s,a=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.id,"equal",o,!1));t.setValue(this.getMapperProp(i,n),r,a[0])}else this.updateChildField(e,i,s,n,r)},o.prototype.updateChildField=function(e,i,s,n,r,o){var a;if(t.isNullOrUndefined(e))return a;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[d]);if(e[d]&&c&&c.toString()===s)return o?a=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),r,e[d]),a=[]),a;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[d]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[d]))){var p=t.getValue("child",e[d]);if(void 0!==(a=this.updateChildField(p,this.getChildMapper(i),s,n,r,o)))break}}else{var u=t.getValue(i.child,e[d]);if(void 0!==(a=this.updateChildField(u,this.getChildMapper(i),s,n,r,o)))break}}return a},o.prototype.triggerEvent=function(){this.renderReactTemplates();var e={data:this.treeData};this.trigger("dataSourceChanged",e)},o.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},o.prototype.wireEditingEvents=function(e){var i=this;if(e&&!this.disabled){var s=this;this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),s.editingHandler(e.originalEvent))}})}else this.touchEditObj&&this.touchEditObj.destroy()},o.prototype.wireClickEvent=function(e){if(e){var i=this;this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}})}else this.touchClickObj&&this.touchClickObj.destroy()},o.prototype.wireExpandOnEvent=function(e){var i=this;if(e){var s=this;this.touchExpandObj=new t.Touch(this.element,{tap:function(e){("Click"===i.expandOnType||"DblClick"===i.expandOnType&&i.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&s.expandHandler(e)}})}else this.touchExpandObj&&this.touchExpandObj.destroy()},o.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&t.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},o.prototype.preventContextMenu=function(e){e.preventDefault()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),t.EventHandler.add(this.element,"focus",this.focusIn,this),t.EventHandler.add(this.element,"blur",this.focusOut,this),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},o.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"focus",this.focusIn),t.EventHandler.remove(this.element,"blur",this.focusOut),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},o.prototype.parents=function(e,i){for(var s=[],n=e.parentNode;!t.isNullOrUndefined(n);)t.matches(n,i)&&s.push(n),n=n.parentNode;return s},o.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+_t):2===e.tapCount&&(i=t.closest(s,"."+_t))),this.firstTap===i},o.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},o.prototype.showSpinner=function(e){t.addClass([e],Gt),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},o.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Gt)},o.prototype.setCheckedNodes=function(e){e=JSON.parse(JSON.stringify(e)),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},o.prototype.setValidCheckedNode=function(e){if(1===this.dataType){var i=this.fields,s=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.id,"equal",e,!0));if(s[0]&&(this.setChildCheckState(s,e,s[0]),this.autoCheck)){for(var n=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.getChildNodes(this.treeData,n),o=0,a=0;a<r.length;a++){var d=r[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}o===r.length&&-1===this.checkedNodes.indexOf(n)&&n&&this.checkedNodes.push(n)}}else if(2===this.dataType)for(var h=0;h<this.treeData.length;h++){if((this.treeData[h][this.fields.id]?this.treeData[h][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkedNodes.push(e);break}var c=t.getValue(this.fields.child.toString(),this.treeData[h]);c&&this.setChildCheckState(c,e,this.treeData[h])}},o.prototype.setChildCheckState=function(e,i,s){var n,l=0;if(1===this.dataType){s&&(n=s[this.fields.id]?s[this.fields.id].toString():null);for(var r=0;r<e.length;r++){var o=e[r][this.fields.id]?e[r][this.fields.id].toString():null;s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.checkedNodes.push(o),o===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);(d=this.getChildNodes(this.treeData,o))&&this.setChildCheckState(d,i,s)}}else{s&&(n=s[this.fields.id]?s[this.fields.id].toString():"");for(r=0;r<e.length;r++){var a=e[r][this.fields.id]?e[r][this.fields.id].toString():"";s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(a)&&this.checkedNodes.push(a),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);var d;(d=t.getValue(this.fields.child.toString(),e[r]))&&this.setChildCheckState(d,i,e[r]),-1!==this.checkedNodes.indexOf(a)&&this.autoCheck&&l++,l===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkedNodes.push(n)}}},o.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[t])},o.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var l=0;l<s.length;l++)this.treeData.splice(n,0,s[l]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},o.prototype.updateChildPosition=function(e,i,s,n,r){for(var o,a=0,d=e.length;a<d;a++){var h=t.getValue(i.id,e[a]);if(e[a]&&h&&h.toString()===s)return e[a]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[a]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){var c=t.getValue("child",e[a]);if(void 0!==(o=this.updateChildPosition(c,this.getChildMapper(i),s,n,r)))break}}else{var p=t.getValue(i.child,e[a]);if(void 0!==(o=this.updateChildPosition(p,this.getChildMapper(i),s,n,r)))break}}return o},o.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},o.prototype.crudOperation=function(e,i,s,n,l,r,o){var a,d=this,h=this.fields.dataSource,c=[],p=this.getQuery(this.fields),u=this.fields.id,f={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];i?m=this.nodeType(i):s&&("string"==typeof s?m[0]=s.toString():"object"==typeof s&&(m[0]=s.getAttribute("data-uid").toString()));for(var v=0,g=m.length;v<g;v++){var y=this.getElement(m[v]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[v]);c.push(b)}}switch(e){case"delete":1==i.length?a=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,a=h.saveChanges(f,u,p.fromTable,p)),a.then(function(e){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(a=h.update(u,c[0],p.fromTable,p)).then(function(e){return d.editSucess(s,n,o)}).catch(function(e){return d.dmFailure(e,s,o)});break;case"insert":if(1==l.length)a=h.insert(l[0],p.fromTable,p);else{var C=[];for(v=0,g=l.length;v<g;v++)C.push(l[v]);f.addedRecords=C,a=h.saveChanges(f,u,p.fromTable,p)}a.then(function(e){var t=d.getElement(s);d.addSuccess(l,t,r),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},o.prototype.deleteSuccess=function(e){for(var i=0,s=e.length;i<s;i++){var n=this.getElement(e[i]);t.isNullOrUndefined(n)||this.removeNode(n)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent()},o.prototype.editSucess=function(e,i,s){var n=this.getElement(e),l=t.select("."+zt,n);this.appendNewText(n,l,i,s)},o.prototype.addSuccess=function(e,t,i){var s,n=t?t.querySelector("."+Jt):null,l=this;t&&n&&n.classList.contains(Vt)&&null===t.querySelector("."+Kt)?l.renderChildNodes(t,null,function(){s=t.querySelector("."+Kt),l.addGivenNodes(e,t,i,!0,s),l.triggerEvent()}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent())},o.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},o.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+zt,s);this.updateText(s,n,this.oldText,i)},o.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":if(this.selectedNodes.length>1){var l=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(l,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=i.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(i.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:t.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.reRenderNodes(),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),o=0;o<r.length;)"true"!==r[o].getAttribute("aria-expanded")&&this.renderChildNodes(r[o],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}}},o.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.element.removeAttribute("tabindex"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),e.prototype.destroy.call(this)},o.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var r=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof l.DataManager)this.isOffline?this.addSuccess(e,r,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,r,s);else{if(r)this.addGivenNodes(e,r,s);else{e=this.getSortedData(e);for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.parentID,e[o]);r=a?this.getElement(a.toString()):a,this.addGivenNodes([e[o]],r,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&r&&this.ensureParentCheckState(r),this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent())}},o.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i,null)},o.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},o.prototype.collapseAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.collapseByLevel(t.select("."+Kt,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,Wt,!1)},o.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},o.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},o.prototype.ensureVisible=function(e){var i=this.getElement(e);if(!t.isNullOrUndefined(i)){var s=this.parents(i,"."+_t);this.expandAll(s),setTimeout(function(){i.scrollIntoView(!0)},450)}},o.prototype.expandAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+Kt,this.element),i,s):this.expandAllNodes(s):this.doGivenAction(e,Vt,!0)},o.prototype.getAllCheckedNodes=function(){return this.checkedNodes},o.prototype.getDisabledNodes=function(){return this.disableNode},o.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},o.prototype.getTreeData=function(e){var i=this.getId(e);if(this.updatePersistProp(),t.isNullOrUndefined(i))return this.treeData;var s=this.getNodeObject(i);return t.isNullOrUndefined(s)?[]:[s]},o.prototype.moveNodes=function(e,i,s,n){var r=this.getElement(i);if(!t.isNullOrUndefined(r)){for(var o=0;o<e.length;o++){var a=this.getElement(e[o]);t.isNullOrUndefined(a)||r.isSameNode(a)||this.isDescendant(a,r)||(this.preventExpand=n,this.dropAsChildNode(a,r,this,s))}this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent()}},o.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n,l=!1;if(1==this.dataType&&s.length>1)l=!0;else if(2==this.dataType&&1===s.length){var r=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(r)||(l=!0)}var o=this.getElement(e);n=o?o.getAttribute("data-uid"):e?e.toString():null,this.refreshData=this.getNodeObject(n),s=JSON.parse(JSON.stringify(s));var a,d;if(1==this.dataType&&l){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[h][this.fields.parentID])){d=s[h],s.splice(h,1);break}a=t.extend({},this.refreshData,d)}else a=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))this.updatePosition(n,a,l,s);else{this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[a],this.listBaseOption,c),u=t.select("."+Kt,o),f=t.getValue(this.fields.child.toString(),a);if(l&&u||l&&!t.isNullOrUndefined(f)){var m=o.parentElement,v=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[v]),this.updatePosition(n,a,l,s),l&&u&&this.expandAll([n])}else{var g=t.select("."+Zt,o),y=t.select("."+Zt,p[0]),b=t.select("div."+Jt,g),C=t.select("div."+Jt,y);b&&C&&(C.classList.contains(Vt)&&b.classList.contains(Wt)?(t.removeClass([C],Vt),t.addClass([C],Wt)):C.classList.contains(Wt)&&b.classList.contains(Vt)?(t.removeClass([C],Wt),t.addClass([C],Vt)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(g);var x=t.select("."+li,o);x.parentNode.insertBefore(y,x.nextSibling),this.updatePosition(n,a,l,s)}if(o=this.getElement(e),a[this.fields.tooltip]&&o.setAttribute("title",a[this.fields.tooltip]),a.hasOwnProperty(this.fields.htmlAttributes)&&a[this.fields.htmlAttributes]){var E={};t.merge(E,a[this.fields.htmlAttributes]),E.class?(t.addClass([o],E.class.split(" ")),delete E.class):t.attributes(o,E)}-1!==this.selectedNodes.indexOf(n)&&(o.setAttribute("aria-selected","true"),t.addClass([o],Xt)),this.isRefreshed=!1,this.triggerEvent()}}},o.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof l.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},o.prototype.updateNode=function(e,i){var s=this;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&this.allowEditing){var n=this.getElement(e);if(!t.isNullOrUndefined(n)){var r=t.select("."+zt,n);this.updateOldText(n);var o=this.getEditEvent(n,null,null);this.trigger("nodeEditing",o,function(t){t.cancel||(s.fields.dataSource instanceof l.DataManager&&!s.isOffline?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,r,i,!1))})}}},o.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var a;return qt([t.Property(!1)],o.prototype,"allowDragAndDrop",void 0),qt([t.Property(!1)],o.prototype,"allowEditing",void 0),qt([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),qt([t.Property(!1)],o.prototype,"allowTextWrap",void 0),qt([t.Complex({},yi)],o.prototype,"animation",void 0),qt([t.Property()],o.prototype,"checkedNodes",void 0),qt([t.Property("")],o.prototype,"cssClass",void 0),qt([t.Property(!1)],o.prototype,"disabled",void 0),qt([t.Property(null)],o.prototype,"dragArea",void 0),qt([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),qt([t.Property(!1)],o.prototype,"enablePersistence",void 0),qt([t.Property()],o.prototype,"expandedNodes",void 0),qt([t.Property("Auto")],o.prototype,"expandOn",void 0),qt([t.Complex({},vi)],o.prototype,"fields",void 0),qt([t.Property(!0)],o.prototype,"fullRowSelect",void 0),qt([t.Property(!0)],o.prototype,"loadOnDemand",void 0),qt([t.Property()],o.prototype,"locale",void 0),qt([t.Property()],o.prototype,"nodeTemplate",void 0),qt([t.Property()],o.prototype,"selectedNodes",void 0),qt([t.Property("None")],o.prototype,"sortOrder",void 0),qt([t.Property(!1)],o.prototype,"showCheckBox",void 0),qt([t.Property(!0)],o.prototype,"autoCheck",void 0),qt([t.Property(!1)],o.prototype,"fullRowNavigable",void 0),qt([t.Event()],o.prototype,"actionFailure",void 0),qt([t.Event()],o.prototype,"created",void 0),qt([t.Event()],o.prototype,"dataBound",void 0),qt([t.Event()],o.prototype,"dataSourceChanged",void 0),qt([t.Event()],o.prototype,"drawNode",void 0),qt([t.Event()],o.prototype,"destroyed",void 0),qt([t.Event()],o.prototype,"keyPress",void 0),qt([t.Event()],o.prototype,"nodeChecked",void 0),qt([t.Event()],o.prototype,"nodeChecking",void 0),qt([t.Event()],o.prototype,"nodeClicked",void 0),qt([t.Event()],o.prototype,"nodeCollapsed",void 0),qt([t.Event()],o.prototype,"nodeCollapsing",void 0),qt([t.Event()],o.prototype,"nodeDragging",void 0),qt([t.Event()],o.prototype,"nodeDragStart",void 0),qt([t.Event()],o.prototype,"nodeDragStop",void 0),qt([t.Event()],o.prototype,"nodeDropped",void 0),qt([t.Event()],o.prototype,"nodeEdited",void 0),qt([t.Event()],o.prototype,"nodeEditing",void 0),qt([t.Event()],o.prototype,"nodeExpanded",void 0),qt([t.Event()],o.prototype,"nodeExpanding",void 0),qt([t.Event()],o.prototype,"nodeSelected",void 0),qt([t.Event()],o.prototype,"nodeSelecting",void 0),o=a=qt([t.NotifyPropertyChanges],o)}(t.Component),Ci=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),xi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Ei="e-close",Ni="e-open",Ii="e-transition",Si="e-right",Oi="e-over",wi="e-push",ki="e-visibility",Li="e-disable-animation",Ai="e-sidebar-context",Pi="e-sidebar-absolute",Di=function(e){function i(t,i){return e.call(this,t,i)||this}return Ci(i,e),i.prototype.preRender=function(){this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.setEnableRTL=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},i.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),t.addClass([this.element],Pi),t.addClass([this.target],Ai),this.targetEle=this.getTargetElement())},i.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!t.isNullOrUndefined(e)&&e.classList.contains("e-sidebar");)e=e.nextElementSibling;return e},i.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?t.EventHandler.add(document,"mousedown touchstart",this.documentclickHandler,this):t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler)},i.prototype.setWidth=function(){this.enableDock&&"Left"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock&&"Right"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||t.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},i.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},i.prototype.setZindex=function(){t.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},i.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&t.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");t.isNullOrUndefined(e||this.targetEle)||t.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.enableDock||"Auto"===this.type||t.addClass([this.element],[ki]),t.removeClass([this.element],[Ni,Ei,Si,"e-left","e-slide",wi,Oi]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?Si:"e-left"),this.enableDock&&t.addClass([this.element],"e-dock"),this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],Ei):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Ei)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,t.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},i.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e?t.removeClass([e],"e-backdrop"):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},i.prototype.hide=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Ei))return;i.element.classList.contains(Ni)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Ei),t.removeClass([i.element],Ni),t.setStyleAttribute(i.element,{width:t.formatUnit(i.enableDock?i.dockSize:i.width)}),i.setType(i.type);var s=document.querySelector(".e-main-content")||i.targetEle;!i.enableDock&&s&&(s.style.transform="translateX(0px)",s.style["Left"===i.position?"marginLeft":"marginRight"]="0px"),i.destroyBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.remove("e-sidebar-overflow"),i.setProperties({isOpen:!1},!0),i.enableDock&&setTimeout(function(){return i.setTimeOut()},50),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(Ni)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(Ei)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],ki),i.element.classList.contains(Ni))return;i.element.classList.contains(Ei)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[Ni,Ii]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Ei),t.setStyleAttribute(i.element,{width:t.formatUnit(i.width)}),i.setType(i.type),i.createBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.add("e-sidebar-overflow"),i.setProperties({isOpen:!0},!0),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setAnimation=function(){this.animate?t.removeClass([this.element],Li):t.addClass([this.element],Li)},i.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},i.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?t.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&t.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(Ei)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=document.querySelector(".e-main-content")||this.targetEle;t.addClass([e],"e-backdrop")}else this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className="e-sidebar-overlay",this.modal.style.display="block",document.body.appendChild(this.modal))},i.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},i.prototype.getModuleName=function(){return"sidebar"},i.prototype.toggle=function(){this.element.classList.contains(Ni)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(Ni)},i.prototype.setMediaQuery=function(){if(this.mediaQuery){("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery).matches:this.mediaQuery.matches)&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide()}},i.prototype.resize=function(){"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],Oi):t.addClass([this.element],wi)),this.setMediaQuery(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.documentclickHandler=function(e){t.closest(e.target,".e-control.e-sidebar")||this.hide(e)},i.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&e.distanceX>=50&&e.velocity>=.5?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection?this.hide():this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide():!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&e.distanceX>=50&&e.velocity>=.5&&this.show()},i.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new t.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new t.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},i.prototype.wireEvents=function(){this.setEnableGestures(),t.EventHandler.add(window,"resize",this.resize,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.resize),t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},i.prototype.onPropertyChanged=function(i,s){for(var n=document.querySelector(".e-main-content")||this.targetEle,l=this.isServerRendered,r=0,o=Object.keys(i);r<o.length;r++){switch(o[r]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),t.removeClass([this.element],[ki]),this.addClass(),t.addClass([this.element],"Auto"===this.type?t.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),n&&(n.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(t.removeClass([this.element],"e-left"),t.addClass([this.element],Si)):(t.removeClass([this.element],Si),t.addClass([this.element],"e-left")),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),t.isNullOrUndefined(this.target)&&(t.removeClass([this.element],Pi),t.removeClass([s.target],Ai),t.setStyleAttribute(n,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,e.prototype.refresh.call(this),this.isServerRendered=l;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock();break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}}},i.prototype.setType=function(e){var i=this.element.getBoundingClientRect().width;this.setZindex();var s=document.querySelector(".e-main-content")||this.targetEle;s&&(s.style.transform="translateX(0px)",t.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),l="Left"===this.position?i:-i;switch(t.removeClass([this.element],[wi,Oi,"e-slide"]),e){case"Push":t.addClass([this.element],[wi]),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style.transform="translateX("+l+"px)");break;case"Over":t.addClass([this.element],[Oi]),this.enableDock&&(this.element.classList.contains(Ei)||this.isOpen)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":t.addClass([this.element],[Ii]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],wi)):t.addClass([this.element],Oi):(t.addClass([this.element],wi),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.target&&t.removeClass([this.target],Ai),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[Ni,Ei,wi,"e-slide",Oi,"e-left",Si,Ii]),t.removeClass([this.element],Pi),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",t.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var i=document.querySelector(".e-main-content")||this.targetEle;t.isNullOrUndefined(i)||(i.style.margin="",i.style.transform=""),this.unWireEvents()},xi([t.Property("auto")],i.prototype,"dockSize",void 0),xi([t.Property(null)],i.prototype,"mediaQuery",void 0),xi([t.Property(!1)],i.prototype,"enableDock",void 0),xi([t.Property("en-US")],i.prototype,"locale",void 0),xi([t.Property(!1)],i.prototype,"enablePersistence",void 0),xi([t.Property(!0)],i.prototype,"enableGestures",void 0),xi([t.Property(!1)],i.prototype,"isOpen",void 0),xi([t.Property(!1)],i.prototype,"enableRtl",void 0),xi([t.Property(!0)],i.prototype,"animate",void 0),xi([t.Property("auto")],i.prototype,"height",void 0),xi([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),xi([t.Property("Left")],i.prototype,"position",void 0),xi([t.Property(null)],i.prototype,"target",void 0),xi([t.Property(!1)],i.prototype,"showBackdrop",void 0),xi([t.Property("Auto")],i.prototype,"type",void 0),xi([t.Property("auto")],i.prototype,"width",void 0),xi([t.Property(1e3)],i.prototype,"zIndex",void 0),xi([t.Event()],i.prototype,"created",void 0),xi([t.Event()],i.prototype,"close",void 0),xi([t.Event()],i.prototype,"open",void 0),xi([t.Event()],i.prototype,"change",void 0),xi([t.Event()],i.prototype,"destroyed",void 0),i=xi([t.NotifyPropertyChanges],i)}(t.Component),Ti=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Mi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Hi="e-icon-right",Ui="e-breadcrumb-text",Ri="e-breadcrumb-icon",Bi="e-breadcrumb-menu",ji="e-breadcrumb-item",qi="e-breadcrumb-popup",Fi="e-breadcrumb-wrap-mode",Wi="e-breadcrumb-scroll-mode",Vi="e-disabled",_i="aria-disabled",zi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ti(i,e),Mi([t.Property("")],i.prototype,"text",void 0),Mi([t.Property("")],i.prototype,"url",void 0),Mi([t.Property(null)],i.prototype,"iconCss",void 0),Mi([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),Ki=function(e){function n(t,i){return e.call(this,t,i)||this}return Ti(n,e),n.prototype.preRender=function(){},n.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},n.prototype.initialize=function(){this._maxItems=this.maxItems,this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(Vi),this.element.setAttribute(_i,"true")),"Wrap"===this.overflowMode?this.element.classList.add(Fi):"Scroll"===this.overflowMode&&this.element.classList.add(Wi),this.initItems(),this.initPvtProps()},n.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&this._maxItems>0&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(this._maxItems>=0?(this.startIndex=this._maxItems>1?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},n.prototype.getEndIndex=function(){var e,t=this;return this.activeItem?this.items.forEach(function(i,s){i.url!==t.activeItem&&i.text!==t.activeItem||(e=s)}):e=this.items.length-1,e},n.prototype.initItems=function(){if(!this.items.length){var e=void 0,t=void 0,i=[];if(this.url){var s=new URL(this.url,window.location.origin);e=s.origin+"/",t=s.href.split(e)[1].split("/")}else e=window.location.origin+"/",t=window.location.href.split(e)[1].split("/");i.push({iconCss:"e-icons e-home",url:e});for(var n=0;n<t.length;n++)t[n]&&(i.push({text:t[n],url:e+t[n]}),e+=t[n]+"/");this.setProperties({items:i},!0)}},n.prototype.renderItems=function(e){var s,n,l=this,r=this.element.classList.contains(Hi),o=e.length;if(o){var a,d=void 0,h=void 0,c=0,p=void 0,u=2*o-1,f=!1,m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),v=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),g=this.hasField(e,"iconCss"),y="Collapsed"===this.overflowMode&&this._maxItems>0&&o>this._maxItems&&!this.isExpanded,b="Hidden"===this.overflowMode&&this._maxItems>0;"Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML="");for(var C={moduleName:this.getModuleName(),showIcon:g,itemNavigable:!0,itemCreated:function(e){var i=e.curData.isLastItem;i&&e.item.children.length&&!l.itemTemplate&&(delete e.curData.isLastItem,a||l.enableActiveItemNavigation||(e.item.innerHTML=l.createElement("span",{className:Ui,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||l.itemTemplate||e.item.classList.add("e-icon-item"),b&&e.item.setAttribute("item-index",c.toString());var s={item:t.extend({},e.curData.properties?e.curData.properties:e.curData),element:e.item,cancel:!1};l.trigger("beforeItemRender",s),f=s.cancel;var n=r||s.element.classList.contains(Hi);n&&e.curData.iconCss&&!l.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector("."+Ri)),s.item.disabled&&(e.item.setAttribute(_i,"true"),e.item.classList.add(Vi)),(s.item.disabled||l.disabled)&&e.item.children.length&&!l.itemTemplate&&e.item.children[0].setAttribute("tabindex","-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),!(!i||i&&l.enableActiveItemNavigation)||s.item.disabled||l.disabled||(e.item.children[0].setAttribute("tabindex","0"),t.EventHandler.add(e.item.children[0],"keydown",l.keyDownHandler,l))),i&&e.item.setAttribute("data-active-item",""),l.itemTemplate||l.beforeItemRenderChanges(e.curData,s.item,e.item,n)}},x=0;x<u;x%2&&c++,x++)if(d=this.activeItem&&(this.activeItem===e[c].url||this.activeItem===e[c].text),!(y&&x>1&&x<u-2)&&(!b||!(c<this.startIndex||c>this.endIndex)||x%2&&c===this.startIndex-1||0===c)){x%2?(p=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),C.template=this.separatorTemplate?this.separatorTemplate:"/",C.itemClass="e-breadcrumb-separator",n=!1,s=[{previousItem:e[c],nextItem:e[c+1]}]):(C.itemClass="",this.itemTemplate?(C.template=this.itemTemplate,n=!1):n=!0,(s=[t.extend({},e[c].properties?e[c].properties:e[c])])[0].url||this.itemTemplate||(s=[t.extend({},s[0],{isEmptyUrl:!0,url:"#"})]),h=(b||"Menu"===this.overflowMode)&&c===this.endIndex,((x===u-1||h)&&!this.itemTemplate||d)&&(s[0].isLastItem=!0));var E=m,N=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(c>=this.startIndex&&c<=N&&(!(x%2)||c!==N)&&this.endIndex>=this._maxItems&&this._maxItems>0||0===this._maxItems)){if(x%2)continue;E=this.popupUl,h&&(a=!0)}else"Wrap"===this.overflowMode&&(E=0===x?v:p);var I=i.ListBase.createList(this.createElement,s,C,n,this).childNodes;if(f){if(b||y||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(c,1),this.initPvtProps(),this.reRenderItems();(x===u-1||h)&&t.remove(E.lastElementChild)}else t.append(I,E);if("Wrap"===this.overflowMode&&0!==x&&x%2==0&&m.appendChild(p),y&&1===x){var S=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}});t.EventHandler.add(S,"keyup",this.expandHandler,this),m.appendChild(S)}if("Menu"===this.overflowMode&&this.startIndex===x&&this.endIndex>=this._maxItems&&this._maxItems>=0){var O=this.getMenuElement();t.EventHandler.add(O,"keyup",this.keyDownHandler,this),m.appendChild(O)}if(d||h)break;f&&x++}this.isReact&&this.renderReactTemplates(),"Wrap"===this.overflowMode&&this.element.appendChild(v),this.element.appendChild(m),this.calculateMaxItems()}},n.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e=void 0,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);if("Menu"===this.overflowMode){var l=this.getMenuElement();this.element.appendChild(l),n+=l.offsetWidth,t.remove(l)}for(var r=0;r<s.length-2;r++){if(n>i){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(this.maxItems>-1&&-1==e)||-1==this.maxItems)&&this._maxItems!=e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth)>i)return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(Bi)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&this._maxItems>0){i=0;if((s=this.element.querySelectorAll("."+ji)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},n.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},n.prototype.beforeItemRenderChanges=function(e,i,s,n){var l=s.querySelector(".e-anchor-wrap");if(i.text!==e.text&&l.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=i.text)}),i.iconCss!==e.iconCss&&l){var r=s.querySelector("."+Ri);if(r)i.iconCss?(t.removeClass([r],e.iconCss.split(" ")),t.addClass([r],i.iconCss.split(" "))):t.remove(r);else if(i.iconCss){var o=this.createElement("span",{className:Ri+" "+i.iconCss});n?t.append([o],l):l.insertBefore(o,l.childNodes[0])}}if(i.url!==e.url&&this.enableNavigation){var a=s.querySelector("a."+Ui);a&&(i.url?a.setAttribute("href",i.url):a.removeAttribute("href"))}},n.prototype.reRenderItems=function(){this.element.innerHTML="",this.renderItems(this.items)},n.prototype.clickHandler=function(e){var i=t.closest(e.target,"."+ji+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),i&&(t.closest(e.target,"."+Ui)||this.itemTemplate)){var s=void 0;s="Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll("."+ji)).indexOf(i):[].slice.call(i.parentElement.children).indexOf(i),"Menu"===this.overflowMode?t.closest(e.target,"."+qi)?(s+=this.startIndex,this.endIndex=s,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector("."+Bi)?s>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector("."+Bi))?(s+=2*this.popupUl.childElementCount-2,s=Math.floor(s/2),this.endIndex=s):this.startIndex=this.endIndex=s:(s=Math.floor(s/2),this.startIndex=this.endIndex=s):s=Math.floor(s/2),"Hidden"===this.overflowMode&&this._maxItems>0&&0!==this.endIndex&&(s=parseInt(i.getAttribute("item-index"),10),this.startIndex>1&&(this.startIndex-=this.endIndex-s),this.endIndex=s),this.trigger("itemClick",{element:i,item:this.items[s],event:e}),this.activeItem=this.items[s].url||this.items[s].text,this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Bi)&&this.renderPopup()},n.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:qi+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.popupObj=new s.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector("."+Bi),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},n.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!t.closest(e.target,"."+Bi)&&(this.popupObj.hide(),this.popupObj.destroy(),t.detach(this.popupObj.element))},n.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},n.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},n.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},n.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},n.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===i.overflowMode?this.element.classList.remove(Fi):"Wrap"===e.overflowMode&&this.element.classList.add(Fi),"Scroll"===i.overflowMode?this.element.classList.remove(Wi):"Scroll"===e.overflowMode&&this.element.classList.add(Wi);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" ")),(i.cssClass&&i.cssClass.indexOf(Hi)>-1&&!(e.cssClass&&e.cssClass.indexOf(Hi)>-1)||!(i.cssClass&&i.cssClass.indexOf(Hi)>-1)&&e.cssClass&&e.cssClass.indexOf(Hi)>-1)&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(Vi),this.element.setAttribute(_i,e.disabled+"")}}},n.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHanlder,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},n.prototype.popupWireEvents=function(){t.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),t.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(document,"click",this.delegateClickHanlder),t.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(t.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),t.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},n.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},n.prototype.getModuleName=function(){return"breadcrumb"},n.prototype.destroy=function(){var i=this,s=[],n=["aria-label"];this.cssClass&&s.concat(this.cssClass.split(" ")),this.enableRtl&&s.push("e-rtl"),this.disabled&&(s.push(Vi),n.push(_i)),"Wrap"===this.overflowMode?s.push(Fi):"Scroll"===this.overflowMode&&s.push(Wi),this.unWireEvents(),this.element.innerHTML="",t.removeClass([this.element],s),n.forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Mi([t.Property("")],n.prototype,"url",void 0),Mi([t.Collection([],zi)],n.prototype,"items",void 0),Mi([t.Property("")],n.prototype,"activeItem",void 0),Mi([t.Property(-1)],n.prototype,"maxItems",void 0),Mi([t.Property("Menu")],n.prototype,"overflowMode",void 0),Mi([t.Property("")],n.prototype,"cssClass",void 0),Mi([t.Property(null)],n.prototype,"itemTemplate",void 0),Mi([t.Property("/")],n.prototype,"separatorTemplate",void 0),Mi([t.Property(!0)],n.prototype,"enableNavigation",void 0),Mi([t.Property(!1)],n.prototype,"enableActiveItemNavigation",void 0),Mi([t.Property(!1)],n.prototype,"disabled",void 0),Mi([t.Property("")],n.prototype,"locale",void 0),Mi([t.Event()],n.prototype,"beforeItemRender",void 0),Mi([t.Event()],n.prototype,"itemClick",void 0),Mi([t.Event()],n.prototype,"created",void 0),n=Mi([t.NotifyPropertyChanges],n)}(t.Component),Yi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Xi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Gi="e-carousel",Qi="e-active",Ji="e-carousel-items",Zi="e-carousel-item",$i="e-previous",es="e-carousel-navigators",ts="e-carousel-indicators",is="e-indicator-bar",ss="e-play-pause",ns="e-play-icon",ls="e-pause-icon",rs="e-previous-button",os="e-next-button",as="e-play-button",ds="e-hover-arrows",hs="e-carousel-hover",cs="e-template",ps="e-carousel-slide-animation",us="e-carousel-fade-animation",fs="e-carousel-custom-animation",ms="e-carousel-animation-none",vs="e-transition-start",gs="e-transition-end",ys=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Yi(i,e),Xi([t.Property()],i.prototype,"cssClass",void 0),Xi([t.Property()],i.prototype,"interval",void 0),Xi([t.Property()],i.prototype,"template",void 0),Xi([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),bs=function(e){function i(t,i){return e.call(this,t,i)||this}return Yi(i,e),i.prototype.getModuleName=function(){return Gi.replace("e-","")},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},i.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new t.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},i.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},i.prototype.onPropertyChanged=function(e,i){for(var s,n=0,l=Object.keys(e);n<l.length;n++){switch(l[n]){case"animationEffect":this.applyAnimation();break;case"cssClass":t.classList(this.element,[e.cssClass],[i.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,i.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector("."+Ji)&&this.renderTouchActions();break;case"loop":this.loop&&t.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex);break;case"enableRtl":this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl");break;case"buttonsVisibility":if(s=this.element.querySelector("."+es))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),t.remove(s);break;case"VisibleOnHover":t.addClass([].slice.call(s.childNodes),ds);break;case"Visible":t.removeClass([].slice.call(s.childNodes),ds)}else this.renderNavigators(),this.renderPlayButton();break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(this.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&t.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":s=this.element.querySelector("."+ts),!this.showIndicators&&s&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(s)),this.renderIndicators();break;case"showPlayButton":s=this.element.querySelector("."+ss),!this.showPlayButton&&s&&(t.remove(s),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":(s=this.element.querySelector("."+Ji))&&(this.resetTemplates(["itemTemplate"]),t.remove(s)),this.renderSlides()}}},i.prototype.initialize=function(){var e=[];this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push("e-rtl"),t.addClass([this.element],e),t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),t.attributes(this.element,{tabindex:"0","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},i.prototype.renderSlides=function(){var e=this,t=this.createElement("div",{className:Ji,attrs:{"aria-live":this.autoPlay?"off":"polite"}});this.element.appendChild(t),this.items.length>0?(this.slideItems=this.items,this.items.forEach(function(i,s){e.renderSlide(i,i.template,s,t)})):this.dataSource.length>0&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(i,s){e.renderSlide(i,e.itemTemplate,s,t)})),this.renderTemplates(),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},i.prototype.renderSlide=function(e,i,s,n){var l=this.createElement("div",{id:t.getUniqueID("carousel_item"),className:Zi+" "+(e.cssClass?e.cssClass:"")+" "+(this.selectedIndex===s?Qi:""),attrs:{"aria-hidden":this.selectedIndex===s?"false":"true","data-index":s.toString(),"aria-role":"group","aria-roledescription":"slide"}});t.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,l);var r=this.element.id+"_template",o=this.templateParser(i)(e,this,"itemTemplate",r,!1);t.append(o,l),n.appendChild(l)},i.prototype.renderNavigators=function(){if("Hidden"!==this.buttonsVisibility){var e=this.createElement("div",{className:es});this.element.querySelector("."+Ji).insertAdjacentElement("afterend",e),this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next"),this.renderTemplates()}},i.prototype.renderNavigatorButton=function(e){var i=this.createElement("div",{className:("Previous"===e?$i:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?ds:""),attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide")}});if("Previous"===e&&this.previousButtonTemplate){t.addClass([i],cs);var s=this.element.id+"_previousButtonTemplate",l=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",s,!1);t.append(l,i)}else if("Next"===e&&this.nextButtonTemplate){t.addClass([i],cs);s=this.element.id+"_nextButtonTemplate",l=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",s,!1);t.append(l,i)}else{var r=this.createElement("button");new n.Button({cssClass:"e-flat e-round "+("Previous"===e?rs:os),iconCss:"e-icons "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(r),i.appendChild(r)}this.element.querySelector("."+es).appendChild(i),t.EventHandler.add(i,"click",this.navigatorClickHandler,this)},i.prototype.renderPlayButton=function(){if("Hidden"!==this.buttonsVisibility&&this.showPlayButton){var e=this.createElement("div",{className:ss+" "+("VisibleOnHover"===this.buttonsVisibility?ds:"")});if(this.playButtonTemplate){t.addClass([e],cs);var i=this.element.id+"_playButtonTemplate",s=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",i,!1);t.append(s,e)}else{var l=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")}}),r=this.selectedIndex===this.slideItems.length-1&&!this.loop,o=new n.Button({cssClass:"e-flat e-round "+as,iconCss:"e-icons "+(this.autoPlay&&!r?ls:ns),isToggle:!0,enableRtl:this.enableRtl});if(r){this.setProperties({autoPlay:!1},!0),l.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition"));this.element.querySelector("."+Ji).setAttribute("aria-live","polite")}o.appendTo(l),e.appendChild(l)}var a=this.element.querySelector("."+es);a.insertBefore(e,a.lastElementChild),this.renderTemplates(),t.EventHandler.add(e,"click",this.playButtonClickHandler,this)}},i.prototype.renderIndicators=function(){var e=this;if(this.showIndicators){var i=this.createElement("div",{className:ts}),s=this.createElement("div",{className:"e-indicator-bars"});i.appendChild(s),this.slideItems&&this.slideItems.forEach(function(i,l){var r=e.createElement("div",{className:is+" "+(e.selectedIndex===l?Qi:""),attrs:{"data-index":l.toString(),"aria-current":e.selectedIndex===l?"true":"false"}});if(e.indicatorsTemplate){t.addClass([r],cs);var o=e.element.id+"_indicatorsTemplate",a=e.templateParser(e.indicatorsTemplate)({index:l,selectedIndex:e.selectedIndex},e,"indicatorsTemplate",o,!1);t.append(a,r)}else{var d=e.createElement("button",{className:"e-indicator"});r.appendChild(d),d.appendChild(e.createElement("div",{attrs:{"aria-label":e.localeObj.getConstant("slide")+" "+(l+1)+" "+e.localeObj.getConstant("of")+" "+e.slideItems.length}}));new n.Button({cssClass:"e-flat e-small"}).appendTo(d)}s.appendChild(r),t.EventHandler.add(r,"click",e.indicatorClickHandler,e)}),this.element.appendChild(i)}},i.prototype.renderKeyboardActions=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs})},i.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new t.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},i.prototype.applyAnimation=function(){switch(t.removeClass([this.element],[fs,us,ps,ms]),this.animationEffect){case"Slide":t.addClass([this.element],ps);break;case"Fade":t.addClass([this.element],us);break;case"None":t.addClass([this.element],ms);break;case"Custom":t.addClass([this.element],fs)}},i.prototype.autoSlide=function(){this.resetSlideInterval(),this.applySlideInterval()},i.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+Qi);if(!t.isNullOrUndefined(e)){var i=parseInt(e.dataset.index,10);if(this.loop||i!==this.slideItems.length-1){var s=(i+1)%this.slideItems.length;this.element.classList.contains(hs)||this.setActiveSlide(s,"Next"),this.autoSlide()}else this.resetSlideInterval()}},i.prototype.applySlideInterval=function(){var e=this;if(this.autoPlay&&!this.element.classList.contains(hs)){var i=this.interval;this.items.length>0&&!t.isNullOrUndefined(this.items[this.selectedIndex].interval)&&(i=this.items[this.selectedIndex].interval),this.autoSlideInterval=setInterval(function(){return e.autoSlideChange()},i)}},i.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},i.prototype.getSlideIndex=function(e){var t=this.selectedIndex;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},i.prototype.setActiveSlide=function(e,i,s){var n=this;if(void 0===s&&(s=!1),!(this.element.querySelectorAll("."+Zi+".e-prev,."+Zi+".e-next").length>0)){var l=[].slice.call(this.element.querySelectorAll("."+Zi)),r=this.element.querySelector("."+Zi+"."+Qi);if(t.isNullOrUndefined(r)&&this.showIndicators){var o=this.element.querySelector("."+is+"."+Qi),a=parseInt(o.dataset.index,10);t.addClass([l[a]],Qi)}else if(t.isNullOrUndefined(r))t.addClass([l[e]],Qi);else{var d=parseInt(r.dataset.index,10),h=l[e],c={currentIndex:d,nextIndex:e,currentSlide:r,nextSlide:h,slideDirection:i,isSwiped:s,cancel:!1};this.trigger("slideChanging",c,function(l){if(!l.cancel){n.setProperties({selectedIndex:e},!0),t.attributes(l.currentSlide,{"aria-hidden":"true"}),t.attributes(l.nextSlide,{"aria-hidden":"false"});var r=[].slice.call(n.element.querySelectorAll("."+is));r.length>0&&(t.attributes(r[d],{"aria-current":"false"}),t.attributes(r[e],{"aria-current":"true"}),t.removeClass(r,Qi),t.addClass([r[e]],Qi)),n.slideChangedEventArgs={currentIndex:l.nextIndex,previousIndex:l.currentIndex,currentSlide:l.nextSlide,previousSlide:l.currentSlide,slideDirection:i,isSwiped:s};"Slide"===n.animationEffect?"Previous"===i?(t.addClass([l.nextSlide],"e-prev"),l.nextSlide.offsetHeight,t.addClass([l.currentSlide,l.nextSlide],gs)):(t.addClass([l.nextSlide],"e-next"),l.nextSlide.offsetHeight,t.addClass([l.currentSlide,l.nextSlide],vs)):"Fade"===n.animationEffect?(t.removeClass([l.currentSlide],Qi),t.addClass([l.nextSlide],Qi)):"Custom"===n.animationEffect?"Previous"===i?(t.addClass([l.nextSlide],"e-next"),t.addClass([l.currentSlide],"e-prev")):(t.addClass([l.currentSlide],"e-prev"),t.addClass([l.nextSlide],"e-next")):n.onTransitionEnd(),n.handleNavigatorsActions(e)}})}}},i.prototype.onTransitionEnd=function(){var e=this;this.slideChangedEventArgs&&(t.addClass([this.slideChangedEventArgs.currentSlide],Qi),t.removeClass([this.slideChangedEventArgs.previousSlide],Qi),this.trigger("slideChanged",this.slideChangedEventArgs,function(){t.removeClass(e.element.querySelectorAll("."+Zi),["e-prev","e-next",vs,gs]),e.slideChangedEventArgs=null}))},i.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var l=n[s];"class"===l?t.addClass([i],e[l]):i.setAttribute(l,e[l])}},i.prototype.templateParser=function(e){if(e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.getNavigatorState=function(e,i){var s=e.querySelector("."+(i?rs:os));if(s){return t.getInstance(s,n.Button).disabled}return!1},i.prototype.navigatorClickHandler=function(e){var t=e.currentTarget;if(!this.getNavigatorState(t,t.classList.contains($i))){var i=t.classList.contains($i)?"Previous":"Next";this.setActiveSlide(this.getSlideIndex(i),i),this.autoSlide()}},i.prototype.indicatorClickHandler=function(e){var i=t.closest(e.target,"."+is),s=parseInt(i.dataset.index,10);this.selectedIndex!==s&&(this.setActiveSlide(s,this.selectedIndex>s?"Previous":"Next"),this.autoSlide())},i.prototype.playButtonClickHandler=function(e,i){void 0===i&&(i=!1);var s=this.element.querySelector("."+as);if(s){var l=t.getInstance(s,n.Button);i||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),l.iconCss="e-icons "+(this.autoPlay?ls:ns),l.dataBind();this.element.querySelector("."+Ji).setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide()}},i.prototype.keyHandler=function(e){var i,s,n=!1,l=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&l.classList.contains("e-indicator")?l.click():l.classList.contains(Gi)||l.classList.contains(as)?this.playButtonClickHandler(e):l.classList.contains(os)?this.next():l.classList.contains(rs)&&this.prev();break;case"end":s=this.slideItems.length-1,i="Next",n=!0;break;case"home":s=0,i="Previous",n=!0;break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&t.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),i="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",s=this.getSlideIndex(i),n=!this.isSuspendSlideTransition(s,i)}n&&(this.setActiveSlide(s,i),this.autoSlide(),n=!1)},i.prototype.swipeHandler=function(e){if(!this.element.classList.contains(hs)){var t="Right"===e.swipeDirection?"Previous":"Next",i=this.getSlideIndex(t);this.isSuspendSlideTransition(i,t)||(this.setActiveSlide(i,t,!0),this.autoSlide())}},i.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},i.prototype.handleNavigatorsActions=function(e){if("Hidden"!==this.buttonsVisibility){if(this.showPlayButton){var i=this.element.querySelector("."+as),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,l=t.isNullOrUndefined(this.playButtonTemplate)&&i&&s;if(t.isNullOrUndefined(this.playButtonTemplate)&&i&&!s&&(l=!i.classList.contains(Qi)),l){this.setProperties({autoPlay:!s},!0),i.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"));this.element.querySelector("."+Ji).setAttribute("aria-live",this.autoPlay?"off":"polite");(a=t.getInstance(i,n.Button)).iconCss="e-icons "+(this.autoPlay?ls:ns),a.dataBind()}}var r=this.element.querySelector("."+rs);if(r&&t.isNullOrUndefined(this.previousButtonTemplate)){(a=t.getInstance(r,n.Button)).disabled=!this.loop&&0===e,a.dataBind()}var o=this.element.querySelector("."+os);if(o&&t.isNullOrUndefined(this.nextButtonTemplate)){var a;(a=t.getInstance(o,n.Button)).disabled=!this.loop&&e===this.slideItems.length-1,a.dataBind()}}},i.prototype.onHoverActions=function(e){var i=this.element.querySelector("."+es);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&i&&t.removeClass([].slice.call(i.childNodes),ds),this.pauseOnHover&&t.addClass([this.element],hs);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&i&&t.addClass([].slice.call(i.childNodes),ds),t.removeClass([this.element],hs)}this.autoSlide()},i.prototype.onFocusActions=function(e){switch(e.type){case"focusin":t.addClass([this.element],hs);break;case"focusout":t.removeClass([this.element],hs)}this.autoSlide()},i.prototype.destroyButtons=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<i.length;e++){var s=i[e],l=t.getInstance(s,n.Button);l&&l.destroy()}},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),t.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),t.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),t.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this)},i.prototype.unWireEvents=function(){var e=this;[].slice.call(this.element.querySelectorAll("."+is)).forEach(function(i){t.EventHandler.remove(i,"click",e.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+$i+",.e-next")).forEach(function(i){t.EventHandler.remove(i,"click",e.navigatorClickHandler)});var i=this.element.querySelector("."+ss);i&&t.EventHandler.remove(i,"click",this.playButtonClickHandler),t.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),t.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),t.EventHandler.clearEvents(this.element)},i.prototype.prev=function(){if(this.loop||0!==this.selectedIndex){var e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1;this.setActiveSlide(e,"Previous"),this.autoSlide()}},i.prototype.next=function(){if(this.loop||this.selectedIndex!==this.slideItems.length-1){var e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1;this.setActiveSlide(e,"Next"),this.autoSlide()}},i.prototype.play=function(){var e=this.element.querySelector("."+ns);if(this.showPlayButton&&e){t.classList(e,[ls],[ns]);this.element.querySelector("."+as).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))}this.setProperties({autoPlay:!0},!0);this.element.querySelector("."+Ji).setAttribute("aria-live","off"),this.applySlideInterval()},i.prototype.pause=function(){var e=this.element.querySelector("."+ls);if(this.showPlayButton&&e){this.element.querySelector("."+as).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),t.classList(e,[ns],[ls])}this.setProperties({autoPlay:!1},!0);this.element.querySelector("."+Ji).setAttribute("aria-live","off"),this.resetSlideInterval()},i.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},i.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},i.prototype.destroy=function(){var i=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule.destroy(),this.keyModule=null,this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){i.element.removeChild(e)}),t.removeClass([this.element],[Gi,this.cssClass,"e-rtl"]),["tabindex","role","style"].forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Xi([t.Collection([],ys)],i.prototype,"items",void 0),Xi([t.Property("Slide")],i.prototype,"animationEffect",void 0),Xi([t.Property()],i.prototype,"previousButtonTemplate",void 0),Xi([t.Property()],i.prototype,"nextButtonTemplate",void 0),Xi([t.Property()],i.prototype,"indicatorsTemplate",void 0),Xi([t.Property()],i.prototype,"playButtonTemplate",void 0),Xi([t.Property()],i.prototype,"cssClass",void 0),Xi([t.Property([])],i.prototype,"dataSource",void 0),Xi([t.Property()],i.prototype,"itemTemplate",void 0),Xi([t.Property(0)],i.prototype,"selectedIndex",void 0),Xi([t.Property("100%")],i.prototype,"width",void 0),Xi([t.Property("100%")],i.prototype,"height",void 0),Xi([t.Property(5e3)],i.prototype,"interval",void 0),Xi([t.Property(!0)],i.prototype,"autoPlay",void 0),Xi([t.Property(!0)],i.prototype,"pauseOnHover",void 0),Xi([t.Property(!0)],i.prototype,"loop",void 0),Xi([t.Property(!1)],i.prototype,"showPlayButton",void 0),Xi([t.Property(!0)],i.prototype,"enableTouchSwipe",void 0),Xi([t.Property(!0)],i.prototype,"showIndicators",void 0),Xi([t.Property("Visible")],i.prototype,"buttonsVisibility",void 0),Xi([t.Property()],i.prototype,"htmlAttributes",void 0),Xi([t.Event()],i.prototype,"slideChanging",void 0),Xi([t.Event()],i.prototype,"slideChanged",void 0),i=Xi([t.NotifyPropertyChanges],i)}(t.Component);e.MenuAnimationSettings=te,e.MenuItem=ee,e.HScroll=I,e.VScroll=B,e.addScrolling=o,e.destroyScroll=d,e.Item=Pe,e.Toolbar=De,e.AccordionActionSettings=Qe,e.AccordionAnimationSettings=Je,e.AccordionItem=Ze,e.Accordion=$e,e.ContextMenu=it,e.Menu=ot,e.TabActionSettings=Mt,e.TabAnimationSettings=Ht,e.Header=Ut,e.TabItem=Rt,e.Tab=Bt,e.FieldsSettings=vi,e.ActionSettings=gi,e.NodeAnimationSettings=yi,e.TreeView=bi,e.Sidebar=Di,e.BreadcrumbItem=zi,e.Breadcrumb=Ki,e.CarouselItem=ys,e.Carousel=bs,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-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs"],t):t(e.ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs)}(this,function(e,t,i,s,n,l,r){"use strict";function o(e,t,i,s,n,l){var r,o,d=t.parentElement;if("vscroll"===s?(r=l||t.getBoundingClientRect().height,o=i.getBoundingClientRect().height):(r=t.getBoundingClientRect().width,o=i.getBoundingClientRect().width),r<o)return a(e,t,i,s,n,l);if(d){var h=d.getBoundingClientRect().width;return h<r&&"hscroll"===s?(o=h,t.style.maxWidth=h+"px",a(e,t,i,s,n,l)):i}return i}function a(e,i,s,n,l,r){var o=e("div",{className:"e-menu-"+n});i.appendChild(o),o.appendChild(s),r?(o.style.overflow="hidden",o.style.height=r+"px"):(o.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new B({enableRtl:l},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new I({enableRtl:l},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetWidth,o}function d(e,i,s){if(e){var n=t.select(".e-menu-parent",i);n?s&&s!==n||(e.destroy(),i.parentElement.appendChild(n),t.detach(i)):(e.destroy(),t.detach(i))}}var h=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),c=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},p="e-rtl",u="e-overlay",f="e-nav-arrow",m="e-nav-right-arrow",v="e-nav-left-arrow",g="e-scroll-nav",y="e-scroll-right-nav",b="e-scroll-left-nav",C="e-scroll-device",x="e-scroll-overlay",E="e-scroll-right-overlay",N="e-scroll-left-overlay",I=function(e){function i(t,i){return e.call(this,t,i)||this}return h(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(p)},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(C),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"});t.setAttribute("tabindex","-1");for(var i=this.element,s=0,n=[].slice.call(i.children);s<n.length;s++){var l=n[s];e.appendChild(l)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"hScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",i.classList.remove("e-hscroll"),i.classList.remove(C);var s=t.selectAll(".e-"+i.id+"_nav."+g,i),n=t.selectAll("."+x,i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var l=0,r=[].slice.call(this.scrollItems.children);l<r.length;l++){var o=r[l];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(."+u+")",this.element);e?this.element.classList.add(u):this.element.classList.remove(u),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:x+" "+E}),s="e-"+e.id.concat("_nav "+g+" "+y),n=this.createElement("div",{id:t.concat("_right"),className:s}),l=this.createElement("div",{className:m+" "+f+" e-icons"});n.appendChild(l);var r=this.createElement("div",{className:x+" "+N});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(r,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+g+" "+y),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},n=this.createElement("div",{className:i,attrs:s});n.setAttribute("aria-disabled","false");var l=this.createElement("div",{className:m+" "+f+" e-icons"}),r="e-"+e.id.concat("_nav "+g+" "+b),o={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},a=this.createElement("div",{className:r+" "+u,attrs:o});a.setAttribute("aria-disabled","true");var d=this.createElement("div",{className:v+" "+f+" e-icons"});a.appendChild(d),n.appendChild(l),e.appendChild(n),e.insertBefore(a,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),a.classList.add("e-ie-align")),this.eventBinding([n,a])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,g)?i.firstElementChild:i;this.timeout=window.setInterval(function(){t.eleScrolling(10,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(g)&&(n=t.querySelector("."+f).classList),this.contains(s,p)&&this.browserCheck&&(e=-e),!this.contains(s,p)||this.browserCheck||this.ieCheck?n.contains(m)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(v)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceX/(10*e.velocity):e.distanceX/e.velocity;var s=.5,n=function(){var l=Math.sin(s);l<=0?window.cancelAnimationFrame(l):("Left"===e.swipeDirection?i.scrollLeft+=t*l:"Right"===e.swipeDirection&&(i.scrollLeft-=t*l),s-=.5,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)this.scrollUpdating(e,i);else{this.customStep||[].slice.call(t.selectAll("."+x,this.element)).forEach(function(t){e-=t.offsetWidth});var l=function(){var t,s;n.contains(n.element,p)&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(l))};l()}},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,p)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector("."+f);t.isNullOrUndefined(e)?t.classList(s,[m],[v]):t.classList(s,[v],[m])}else e&&i&&(e.classList.add(u),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove(u),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0"));this.repeatScroll()},i.prototype.scrollHandler=function(e){var t=e.target,i=t.offsetWidth,s=(this.element,this.element.querySelector("."+b)),n=this.element.querySelector("."+y),l=this.element.querySelector("."+N),r=this.element.querySelector("."+E),o=t.scrollLeft;if(o<=0&&(o=-o),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(l=this.element.querySelector("."+E),r=this.element.querySelector("."+N)),l.style.width=o<40?o+"px":"40px",t.scrollWidth-Math.ceil(i+o)<40?r.style.width=t.scrollWidth-Math.ceil(i+o)+"px":r.style.width="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollWidth)this.arrowDisabling(n,s);else{var a=this.element.querySelector("."+g+"."+u);a&&(a.classList.remove(u),a.setAttribute("aria-disabled","false"),a.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add(p):this.element.classList.remove(p)}}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),S=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),O=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},w="e-overlay",k="e-nav-arrow",L="e-nav-up-arrow",A="e-nav-down-arrow",P="e-scroll-nav",D="e-scroll-up-nav",T="e-scroll-down-nav",M="e-scroll-device",H="e-scroll-overlay",U="e-scroll-up-overlay",R="e-scroll-down-overlay",B=function(e){function i(t,i){return e.call(this,t,i)||this}return S(i,e),i.prototype.preRender=function(){this.browser=t.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=t.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=t.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add("e-rtl")},i.prototype.render=function(){this.touchModule=new t.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),t.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(M),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),t.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){t.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){var e=t.createElement("div",{className:"e-vscroll-content"}),i=t.createElement("div",{className:"e-vscroll-bar"});i.setAttribute("tabindex","-1");for(var s=this.element,n=0,l=[].slice.call(s.children);n<l.length;n++){var r=l[n];e.appendChild(r)}i.appendChild(e),s.appendChild(i),i.style.overflow="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll",M]);var s=t.selectAll(".e-"+i.id+"_nav."+P,i),n=t.selectAll("."+H,i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var l=0,r=[].slice.call(this.scrollItems.children);l<r.length;l++){var o=r[l];i.appendChild(o)}this.uniqueId&&this.element.removeAttribute("id"),t.detach(this.scrollEle),s.length>0&&(t.detach(s[0]),t.isNullOrUndefined(s[1])||t.detach(s[1])),t.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,e.prototype.destroy.call(this)},i.prototype.disable=function(e){var i=t.selectAll(".e-scroll-nav:not(."+w+")",this.element);e?this.element.classList.add(w):this.element.classList.remove(w),[].slice.call(i).forEach(function(t){t.setAttribute("tabindex",e?"-1":"0")})},i.prototype.createOverlayElement=function(e){var i=e.id.concat("_nav"),s=t.createElement("div",{className:H+" "+R}),n="e-"+e.id.concat("_nav "+P+" "+T),l=t.createElement("div",{id:i.concat("down"),className:n}),r=t.createElement("div",{className:A+" "+k+" e-icons"});l.appendChild(r);var o=t.createElement("div",{className:H+" "+U});this.ieCheck&&l.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(l),e.insertBefore(o,e.firstChild),this.eventBinding([l])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav "+P+" "+T),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var l=t.createElement("div",{className:A+" "+k+" e-icons"}),r="e-"+e.id.concat("_nav "+P+" "+D),o=t.createElement("div",{id:i.concat("_up"),className:r+" "+w});o.setAttribute("aria-disabled","true");var a=t.createElement("div",{className:L+" "+k+" e-icons"});o.appendChild(a),n.appendChild(l),n.setAttribute("tabindex","0"),e.appendChild(n),e.insertBefore(o,e.firstChild),this.ieCheck&&(n.classList.add("e-ie-align"),o.classList.add("e-ie-align")),this.eventBinding([n,o])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100)}},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var i=this;[].slice.call(e).forEach(function(e){new t.Touch(e,{tapHold:i.tabHoldHandler.bind(i),tapHoldThreshold:500}),e.addEventListener("keydown",i.onKeyPress.bind(i)),e.addEventListener("keyup",i.onKeyUp.bind(i)),e.addEventListener("mouseup",i.repeatScroll.bind(i)),e.addEventListener("touchend",i.repeatScroll.bind(i)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),t.EventHandler.add(e,"click",i.clickEventHandler,i)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target;i=this.contains(i,P)?i.firstElementChild:i;this.timeout=window.setInterval(function(){t.eleScrolling(10,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;s.contains(P)&&(s=t.querySelector("."+k).classList),s.contains(A)?this.frameScrollRequest(e,"add",i):s.contains(L)&&this.frameScrollRequest(e,"",i)},i.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},i.prototype.wheelEventHandler=function(e){e.preventDefault(),this.frameScrollRequest(this.scrollStep,e.deltaY>0?"add":"",!1)},i.prototype.swipeHandler=function(e){var t,i=this.scrollEle;t=e.velocity<=1?e.distanceY/(10*e.velocity):e.distanceY/e.velocity;var s=.5,n=function(){var l=Math.sin(s);l<=0?window.cancelAnimationFrame(l):("Up"===e.swipeDirection?i.scrollTop+=t*l:"Down"===e.swipeDirection&&(i.scrollTop-=t*l),s-=.02,window.requestAnimationFrame(n))};n()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(e,i,s){var n=this;if(s)this.scrollUpdating(e,i);else{this.customStep||[].slice.call(t.selectAll("."+H,this.element)).forEach(function(t){e-=t.offsetHeight});var l=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(l))};l()}},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceY;"Up"===e.scrollDirection?t.scrollTop=t.scrollTop+i:"Down"===e.scrollDirection&&(t.scrollTop=t.scrollTop-i)},i.prototype.arrowDisabling=function(e,i){if(this.isDevice){var s=(t.isNullOrUndefined(e)?i:e).querySelector("."+k);t.isNullOrUndefined(e)?t.classList(s,[A],[L]):t.classList(s,[L],[A])}else e.classList.add(w),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove(w),i.setAttribute("aria-disabled","false"),i.setAttribute("tabindex","0");this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var t=e.target,i=t.offsetHeight,s=this.element.querySelector("."+D),n=this.element.querySelector("."+T),l=this.element.querySelector("."+U),r=this.element.querySelector("."+R),o=t.scrollTop;if(o<=0&&(o=-o),this.isDevice&&(l.style.height=o<40?o+"px":"40px",t.scrollHeight-Math.ceil(i+o)<40?r.style.height=t.scrollHeight-Math.ceil(i+o)+"px":r.style.height="40px"),0===o)this.arrowDisabling(s,n);else if(Math.ceil(i+o+.1)>=t.scrollHeight)this.arrowDisabling(n,s);else{var a=this.element.querySelector("."+P+"."+w);a&&(a.classList.remove(w),a.setAttribute("aria-disabled","false"),a.setAttribute("tabindex","0"))}},i.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){switch(s[i]){case"scrollStep":this.setScrollState();break;case"enableRtl":e.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")}}},O([t.Property(null)],i.prototype,"scrollStep",void 0),i=O([t.NotifyPropertyChanges],i)}(t.Component),j=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),q=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},F="e-focused",W="e-menu-header",V="e-selected",_="e-separator",z="uparrow",K="downarrow",Y="leftarrow",X="rightarrow",G="e-menu-item",Q="e-disabled",J="e-menu-hide",Z="e-menu-popup",$=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property("id")],i.prototype,"itemId",void 0),q([t.Property("parentId")],i.prototype,"parentId",void 0),q([t.Property("text")],i.prototype,"text",void 0),q([t.Property("iconCss")],i.prototype,"iconCss",void 0),q([t.Property("url")],i.prototype,"url",void 0),q([t.Property("separator")],i.prototype,"separator",void 0),q([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),ee=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property(null)],i.prototype,"iconCss",void 0),q([t.Property("")],i.prototype,"id",void 0),q([t.Property(!1)],i.prototype,"separator",void 0),q([t.Collection([],i)],i.prototype,"items",void 0),q([t.Property("")],i.prototype,"text",void 0),q([t.Property("")],i.prototype,"url",void 0),i}(t.ChildProperty),te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return j(i,e),q([t.Property("SlideDown")],i.prototype,"effect",void 0),q([t.Property(400)],i.prototype,"duration",void 0),q([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),ie=function(e){function n(i,s){var n=e.call(this,i,s)||this;return n.navIdx=[],n.animation=new t.Animation({}),n.isTapHold=!1,n.tempItem=[],n.showSubMenuOn="Auto",n}return j(n,e),n.prototype.preRender=function(){if(!this.isMenu){var e=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){e=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var i=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=e,t.setValue("ej2_instances",i,this.element)}else{e=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),e);var s=this.element.nextElementSibling;s?this.element.parentElement.insertBefore(e,s):this.element.parentElement.appendChild(e),this.clonedElement=e}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var n=this.element,l=t.getValue("ej2_instances",n),r=(e=this.createElement("ul"),this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"})),o=0,a=n.attributes.length;o<a;o++)e.setAttribute(n.attributes[o].nodeName,n.attributes[o].nodeValue);n.parentNode.insertBefore(r,n),t.detach(n),n=e,r.appendChild(n),t.setValue("ej2_instances",l,n),this.clonedElement=r,this.element=n,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){var e=this;this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete();var t=this.getWrapper();this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){o(e.createElement,t,e.element,"hscroll",e.enableRtl)})},n.prototype.initialize=function(){var e=this.getWrapper();e||(e=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper"}),this.isMenu?this.element.parentElement.insertBefore(e,this.element):document.body.appendChild(e)),this.cssClass&&t.addClass([e],this.cssClass.split(" ")),this.enableRtl&&e.classList.add("e-rtl"),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},n.prototype.renderItems=function(){if(!this.items.length){var e=i.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}});this.setProperties({items:e},!0),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML=""}var s=this.createItems(this.items);if(t.append(Array.prototype.slice.call(s.children),this.element),this.element.classList.add("e-menu-parent"),this.isMenu&&(!this.hamburgerMode&&this.element.classList.contains("e-vertical")&&this.setBlankIconStyle(this.element),this.enableScrolling)){var n=this.getWrapper();this.element.classList.contains("e-vertical")?o(this.createElement,n,this.element,"vscroll",this.enableRtl):o(this.createElement,n,this.element,"hscroll",this.enableRtl)}},n.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var i=void 0,n=t.selectAll(this.target),l=0,r=n.length;l<r;l++)i=n[l],this.isMenu?t.EventHandler.add(i,"click",this.menuHeaderClickHandler,this):t.Browser.isIos?new t.Touch(i,{tapHold:this.touchHandler.bind(this)}):t.EventHandler.add(i,"contextmenu",this.cmenuHandler,this);if(this.targetElement=i,!this.isMenu){t.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var o=0,a=s.getScrollableParent(this.targetElement);o<a.length;o++){var d=a[o];t.EventHandler.add(d,"scroll",this.scrollHandler,this)}}}t.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),t.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),t.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this)),this.delegateClickHandler=this.clickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=t.rippleEffect(e,{selector:"."+G})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:K,uparrow:z,enter:"enter",leftarrow:Y,rightarrow:X,escape:"escape"};this.isMenu&&(i.home="home",i.end="end",i.tab="tab"),new t.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:i})},n.prototype.mouseDownHandler=function(e){t.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||t.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},n.prototype.keyBoardHandler=function(e){var i="",s=e.target,n=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&s.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([F,V],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case X:i=X,e.action=K;break;case Y:i=Y,e.action=z;break;case K:i=K,e.action=X;break;case z:i=z,e.action=""}else if(this.enableRtl)switch(e.action){case Y:n=!0,i=Y,e.action=X;break;case X:n=!0,i=X,e.action=Y}switch(e.action){case K:case z:case"end":case"home":case"tab":this.upDownKeyHandler(e);break;case X:this.rightEnterKeyHandler(e);break;case Y:this.leftEscKeyHandler(e);break;case"enter":this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e);break;case"escape":this.leftEscKeyHandler(e)}n&&(e.action=i)},n.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===K||"home"===e.action||"tab"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,F);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(F),"end"!==e.action&&"home"!==e.action&&(e.action===K?s++:s--,s===(e.action===K?t.childElementCount:-1)&&(s=i)));var l=t.children[s];s=this.isValidLI(l,s,e.action),t.children[s].classList.add(F),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx();return(e.classList.contains(_)||e.classList.contains(Q)||e.classList.contains(J))&&(i===K||i===X?t++:t--),((e=s.children[t]).classList.contains(_)||e.classList.contains(Q)||e.classList.contains(J))&&(t=this.isValidLI(e,t,i)),t},n.prototype.getUlByNavIdx=function(e){if(void 0===e&&(e=this.navIdx.length),this.isMenu){var i=[this.getWrapper()].concat([].slice.call(t.selectAll("."+Z)))[e];return t.isNullOrUndefined(i)?null:t.select(".e-menu-parent",i)}return this.getWrapper().children[e]},n.prototype.rightEnterKeyHandler=function(e){var t,i=this.getUlByNavIdx(),s=this.getLIByClass(i,F);if(s){var n=this.getIdx(i,s),l=this.navIdx.concat(n),r=this.getItem(l);r.items.length?(this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,r,-1,-1,e)):"enter"===e.action&&(this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([V],[this.getWrapper()]):s.classList.remove(F),s.classList.add(V),t={element:s,item:r,event:e},this.trigger("select",t),this.closeMenu(null,e))}},n.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):"escape"===e.action&&this.closeMenu(null,e)},n.prototype.scrollHandler=function(e){this.closeMenu(null,e)},n.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},n.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},n.prototype.closeMenu=function(e,i,n){var l=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var r,o,a=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,m=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&m.classList.contains("e-menu")&&((a=this.getLIByClass(m,V))&&a.classList.remove(V),u=!0),!u){var v=i&&i.target&&this.getLI(i.target);this.cli=v||m.children[0],r=this.navIdx.length?this.getItem(this.navIdx):null,o=r?r.items:this.items,c={element:m,parentItem:r,items:o,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(a){var c,p,u,f="",g=!a.cancel;(g||l.isCMenu)&&(l.isMenu?(c=t.closest(m,"."+Z),l.hamburgerMode&&(c.parentElement.style.minHeight="",t.closest(m,".e-menu-item").setAttribute("aria-expanded","false")),l.unWireKeyboardEvent(c),d(t.getInstance(c.children[0],B),c.children[0]),(u=t.getInstance(c,s.Popup)).hide(),f=c.id,u.destroy(),t.detach(c)):l.toggleAnimation(m,!1),p={element:m,parentItem:r,items:o},l.trigger("onClose",p),l.navIdx.pop()),l.updateReactTemplate();var y,b,C,x=l.getWrapper()&&l.getUlByNavIdx();l.isCMenu&&(l.canOpen(i.target)&&l.openMenu(null,null,l.pageY,l.pageX,i),l.isCMenu=!1),l.isMenu&&x&&f.length&&(y=new RegExp("(.*)-ej2menu-"+l.element.id+"-popup").exec(f)[1],b=x.querySelector('[id="'+y+'"]'),C=v&&x.querySelector('[id="'+v.id+'"]'));var E=v&&v.querySelectorAll(".e-menu-item");if(g&&l.hamburgerMode&&e&&!E.length)l.afterCloseMenu(i);else if(g&&!l.hamburgerMode&&l.navIdx.length&&b&&!C&&"left"!==l.keyType){var N=i&&i.target.classList.contains("e-vscroll")?t.closest(i.target,".e-menu-wrapper"):null;N?(N=N.querySelector(".e-menu-item"),(l.showItemOnClick||N&&l.getIndex(N.id,!0).length<=l.navIdx.length)&&l.closeMenu(l.navIdx[l.navIdx.length-1],i,!0)):l.closeMenu(l.navIdx[l.navIdx.length-1],i)}else if(g&&!n&&!e&&(l.hamburgerMode&&l.navIdx.length||1===l.navIdx.length))l.closeMenu(null,i);else if(g&&t.isNullOrUndefined(e)&&l.navIdx.length)l.closeMenu(null,i);else if(!g||l.isMenu||e||0!==l.navIdx.length||l.isMenusClosed)if(g&&l.isMenu&&i&&i.target&&0!==l.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))l.closeMenu(0,i);else if(g&&!l.isMenu&&t.selectAll(".e-menu-parent",h)[e-1]&&3===i.which)l.closeMenu(null,i);else{if(!g||"right"!==l.keyType&&"click"!==l.keyType){var I=l.getUlByNavIdx(),S=l.getLIByClass(I,V);if(S&&(S.setAttribute("aria-expanded","false"),S.classList.remove(V),(a.isFocused&&v||"left"===l.keyType)&&(S.classList.add(F),S.focus())),!g&&l.hamburgerMode&&v&&"false"===v.getAttribute("aria-expanded")&&"true"===v.getAttribute("aria-haspopup")){t.closest(v,".e-menu-parent.e-control")?l.navIdx=[]:l.navIdx.pop(),l.navIdx.push(l.cliIdx);var O=l.getItem(l.navIdx);v.setAttribute("aria-expanded","true"),l.openMenu(v,O,-1,-1,i)}}else l.afterCloseMenu(i);l.navIdx.length<1&&("Hover"!==l.showSubMenuOn&&"Click"!==l.showSubMenuOn||(l.showItemOnClick=l.defaultOption,l.showSubMenuOn="Auto"))}else l.isMenusClosed=!0,l.closeMenu(0,i);l.removeStateWrapper()})}}},n.prototype.updateReactTemplate=function(){if(this.isReact&&this.template&&0===this.navIdx.length){var e=this.portals.splice(0,this.items.length);this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates()}},n.prototype.getMenuItemModel=function(e,i){if(t.isNullOrUndefined(e))return null;t.isNullOrUndefined(i)&&(i=0);var s=this.getFields(i);return{text:e[s.text],id:e[s.id],items:e[s.child],separator:e[s.separator],iconCss:e[s.iconCss],url:e[s.url]}},n.prototype.getPopups=function(){var e=this,i=[];return[].slice.call(document.querySelectorAll("."+Z)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+G))&&e.getIndex(s.querySelector("."+G).id,!0).length&&i.push(s)}),i},n.prototype.isMenuVisible=function(){return this.navIdx.length>0||this.element.classList.contains("e-contextmenu")&&t.isVisible(this.element).valueOf()},n.prototype.canOpen=function(e){var i=!0;if(this.filter){i=!1;for(var s=this.filter.split(" "),n=0,l=s.length;n<l;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,l,r,o){var a=this;void 0===n&&(n=0),void 0===l&&(l=0),void 0===r&&(r=null),void 0===o&&(o=this.targetElement);var d=this.getWrapper();this.lItem=e;var h=""!==this.element.id?this.element.id:"menu";if(this.isMenusClosed=!1,t.isNullOrUndefined(n)&&(n=-1),t.isNullOrUndefined(l)&&(l=-1),e){if(this.uList=this.createItems(i[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&t.Browser.isDevice){d.lastChild.style.display="none";var c={text:i[this.getField("text")].toString(),iconCss:"e-icons e-previous"},p=new ee(this.items[0],"items",c,!0),u=this.createItems([p]).children[0];u.classList.add(W),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Z,id:e.id+"-ej2menu-"+h+"-popup"}),this.hamburgerMode?(n=e.offsetHeight,e.appendChild(this.popupWrapper)):document.body.appendChild(this.popupWrapper),this.isNestedOrVertical=this.element.classList.contains("e-vertical")||1!==this.navIdx.length,this.popupObj=this.generatePopup(this.popupWrapper,this.uList,e,this.isNestedOrVertical),this.template&&this.renderReactTemplates(),this.hamburgerMode?this.calculateIndentSize(this.uList,e):(this.cssClass&&t.addClass([this.popupWrapper],this.cssClass.split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,i,r,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,r,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,d.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,r,n,l,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,r,n,l,"none"))}else this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(o||this.element).toString(),this.triggerBeforeOpen(e,this.uList,i,r,n,l,"none")},n.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),s=parseInt(i.textIndent,10);this.navIdx.length<2&&!t.classList.contains("e-blankicon")?s*=2:s+=s/4,e.style.textIndent=s+"px";var n=e.querySelectorAll(".e-blankicon");if(n&&n.length)for(var l=e.querySelector(".e-menu-icon"),r=getComputedStyle(l),o=parseInt(r.marginRight,10)+l.offsetWidth+s,a=0;a<n.length;a++)n[a].style.textIndent=o+"px"},n.prototype.generatePopup=function(e,i,n,l){var r=this,o=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:l||this.enableRtl?"none":"flip",Y:"fit"},position:l&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:i,open:function(){var e=t.select(".e-menu-vscroll",o.element);e&&(e.style.height="inherit",e.style.maxHeight="");var i=t.select(".e-ul",o.element);o.element.style.maxHeight="",i.focus(),r.triggerOpen(i)}});return o},n.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var i=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),s=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.title):this.title,n=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:s}),l=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(l),e.insertBefore(i,this.element)},n.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},n.prototype.closeHamburgerMenu=function(e){var t=this,i={element:this.element,parentItem:null,event:e,items:this.items,cancel:!1};this.trigger("beforeClose",i,function(i){i.cancel||(t.closeMenu(null,e),t.element.classList.add("e-hide-menu"),t.trigger("onClose",{element:t.element,parentItem:null,items:t.items}))})},n.prototype.callFit=function(e,t,i,n,l){return s.fit(e,null,{X:t,Y:i},{top:n,left:l})},n.prototype.triggerBeforeOpen=function(e,i,s,n,l,r,a){var d=this,h=e?s[this.getField("children",this.navIdx.length-1)]:this.items,c={element:i,items:h,parentItem:s,event:n,cancel:!1,top:l,left:r,showSubMenuOn:"Auto"},p=a;this.trigger("beforeOpen",c,function(l){switch(p){case"menu":d.hamburgerMode||("Auto"!==l.showSubMenuOn&&(d.showItemOnClick=!d.defaultOption,d.showSubMenuOn=l.showSubMenuOn),d.top=l.top,d.left=l.left),d.popupWrapper.style.display="block",d.hamburgerMode||(d.popupWrapper.style.maxHeight=d.popupWrapper.getBoundingClientRect().height+"px",d.enableScrolling&&o(d.createElement,d.popupWrapper,d.uList,"vscroll",d.enableRtl),d.checkScrollOffset(n)),d.hamburgerMode||d.left||d.top?(d.popupObj.collision={X:"none",Y:"none"},d.popupWrapper.style.display=""):(d.popupObj.refreshPosition(d.lItem,!0),d.left=parseInt(d.popupWrapper.style.left,10),d.top=parseInt(d.popupWrapper.style.top,10),d.enableRtl&&(d.left=d.isNestedOrVertical?d.left-d.popupWrapper.offsetWidth-d.lItem.parentElement.offsetWidth+2:d.left-d.popupWrapper.offsetWidth+d.lItem.offsetWidth),d.template&&(d.isReact||d.isAngular)?requestAnimationFrame(function(){d.collision(),d.popupWrapper.style.display=""}):(d.collision(),d.popupWrapper.style.display=""));break;case"none":d.top=l.top,d.left=l.left;break;case"hamburger":l.cancel||(d.element.classList.remove("e-hide-menu"),d.triggerOpen(d.element))}if("hamburger"!==p)if(l.cancel)d.isMenu?(d.popupObj.destroy(),t.detach(d.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),d.navIdx.pop();else if(d.isMenu)if(d.hamburgerMode)d.popupWrapper.style.top=d.top+"px",d.popupWrapper.style.left="0px",d.toggleAnimation(d.popupWrapper);else{d.setBlankIconStyle(d.popupWrapper),d.wireKeyboardEvent(d.popupWrapper),t.rippleEffect(d.popupWrapper,{selector:"."+G}),d.popupWrapper.style.left=d.left+"px",d.popupWrapper.style.top=d.top+"px";var r="None"!==d.animationSettings.effect?{name:d.animationSettings.effect,duration:d.animationSettings.duration,timingFunction:d.animationSettings.easing}:null;d.popupObj.show(r,d.lItem)}else d.setBlankIconStyle(d.uList),d.setPosition(d.lItem,d.uList,d.top,d.left),d.toggleAnimation(d.uList);if("right"===d.keyType){var a=d.getUlByNavIdx();if(e.classList.remove(F),d.isMenu&&1===d.navIdx.length&&d.removeLIStateByClass([V],[d.getWrapper()]),e.classList.add(V),"enter"===d.action){var h={element:e,item:s,event:n};d.trigger("select",h)}e.focus(),a=d.getUlByNavIdx();var c=d.isValidLI(a.children[0],0,d.action);a.children[c].classList.add(F),a.children[c].focus()}})},n.prototype.collision=function(){var e;if(e=s.isCollide(this.popupWrapper,null,this.left,this.top),(this.isNestedOrVertical||this.enableRtl)&&(e.indexOf("right")>-1||e.indexOf("left")>-1)){this.popupObj.collision.X="none";var i=t.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth;this.left=this.enableRtl?s.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-i+2}((e=s.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")>-1||e.indexOf("right")>-1)&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},n.prototype.setBlankIconStyle=function(e){var t=[].slice.call(e.getElementsByClassName("e-blankicon"));if(t.length){var i=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"),s=i.querySelector(".e-menu-icon");if(s){var n=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},l=getComputedStyle(s),r=parseInt(l.fontSize,10);parseInt(l.width,10)&&parseInt(l.width,10)>r&&(r=parseInt(l.width,10));var o=r+parseInt(l[n.margin],10)+parseInt(getComputedStyle(i)[n.padding],10)+"px";t.forEach(function(e){e.style[n.padding]=o})}}},n.prototype.checkScrollOffset=function(e){var i=this.getWrapper();if(i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length){var s=t.isNullOrUndefined(e)?this.element:t.closest(e.target,"."+G),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var l=n.scrollLeft+n.offsetWidth,r=s.offsetLeft+s.offsetWidth;l<r&&(n.scrollLeft+=r-l)}},n.prototype.setPosition=function(e,i,n,l){if(this.toggleVisiblity(i),i===this.element||l>-1&&n>-1){if((d=s.isCollide(i,null,l,n)).indexOf("right")>-1&&(l-=i.offsetWidth),d.indexOf("bottom")>-1){if((n=(o=this.callFit(i,!1,!0,n,l)).top-20)<0){var r=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;r>-1&&(n=r)}}if((d=s.isCollide(i,null,l,n)).indexOf("left")>-1){l=(o=this.callFit(i,!0,!1,n,l)).left}}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),l=Number(this.element.style.left.replace("px",""));else{var o,a=this.enableRtl?"left":"right";n=(o=s.calculatePosition(e,a,"top")).top,l=o.left;var d,h=(d=s.isCollide(i,null,this.enableRtl?l-i.offsetWidth:l,n)).indexOf("left")>-1||d.indexOf("right")>-1;h&&(l=(o=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||h)&&(l=this.enableRtl&&h?l:l-i.offsetWidth),d.indexOf("bottom")>-1&&(n=(o=this.callFit(i,!1,!0,n,l)).top)}this.toggleVisiblity(i,!1),i.style.top=n+"px",i.style.left=l+"px"},n.prototype.toggleVisiblity=function(e,t){void 0===t&&(t=!0),e.style.visibility=t?"hidden":"",e.style.display=t?"block":"none"},n.prototype.createItems=function(e){var s=this,n=this.navIdx?this.navIdx.length:0,l=this.getFields(n),r=this.hasField(e,this.getField("iconCss",n)),o={showIcon:r,moduleName:"menu",fields:l,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[l.id]]||(e.curData[e.fields[l.id]]=t.getUniqueID("menuitem")),e.curData.htmlAttributes={role:"menuitem",tabindex:"-1"},s.isMenu&&!e.curData[s.getField("separator",n)]&&(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]),""===e.curData[e.fields[l.iconCss]]&&(e.curData[e.fields[l.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add(_),e.item.removeAttribute("role")),!r||e.curData[e.fields.iconCss]||e.curData[s.getField("separator",n)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length){var t=s.createElement("span",{className:"e-icons e-caret"});e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),s.isMenu||e.item.removeAttribute("role"),e.item.classList.add("e-menu-caret-icon")}s.isMenu&&s.template&&(e.item.setAttribute("id",e.curData[e.fields.id].toString()),e.item.removeAttribute("data-uid"),e.item.classList.contains("e-level-1")&&e.item.classList.remove("e-level-1"),e.item.classList.contains("e-has-child")&&e.item.classList.remove("e-has-child"));var i={item:e.curData,element:e.item};s.trigger("beforeItemRender",i)}};this.setProperties({items:this.items},!0),this.isMenu&&(o.templateID=this.element.id+"Template");var a=i.ListBase.createList(this.createElement,e,o,!this.template,this);return a.setAttribute("tabindex","0"),this.isMenu&&a.setAttribute("role","menu"),a},n.prototype.moverHandler=function(e){var i=e.target;this.liTrgt=i;var s=this.getLI(i),n=s?t.closest(s,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),l=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(n){if((""!==n.id?r.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([F,V],[this.getWrapper()]),!this.navIdx.length)return;o=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([F],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([F],this.isMenu?[l].concat(this.getPopups()):[l]),s.classList.add(F),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([F],[n].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||i.parentElement===n||t.closest(i,".e-"+this.getModuleName()+"-popup")||s&&(!s||this.getIndex(s.id,!0).length)||"Hover"===this.showSubMenuOn?o&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([F],[n]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1)}},n.prototype.removeStateWrapper=function(){if(this.liTrgt){var e=t.closest(this.liTrgt,".e-menu-vscroll");"DIV"===this.liTrgt.tagName&&e&&this.removeLIStateByClass([F,V],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})},l=0;l<i.length;l++)n(l)},n.prototype.getField=function(e,t){void 0===t&&(t=0);var i=this.fields[e];return"string"==typeof i?i:i[t]?i[t].toString():i[i.length-1].toString()},n.prototype.getFields=function(e){return void 0===e&&(e=0),{id:this.getField("itemId",e),iconCss:this.getField("iconCss",e),text:this.getField("text",e),url:this.getField("url",e),child:this.getField("children",e),separator:this.getField("separator",e)}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},n.prototype.menuHeaderClickHandler=function(e){t.closest(e.target,".e-menu-wrapper").querySelector("ul.e-menu-parent").id===this.element.id&&(this.element.className.indexOf("e-hide-menu")>-1?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},n.prototype.clickHandler=function(e){if(this.isTapHold)this.isTapHold=!1;else{var i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),l=new RegExp("-ej2menu-(.*)-popup"),r=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&r&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===r.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([F],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&r&&this.isMenu){var a=r.id?l.exec(r.id)[1]:r.querySelector(".e-menu-parent").id;if(this.element.id!==a)return}if(o&&"click"===e.type&&!n.classList.contains(W)){this.setLISelected(n);var d=this.getIndex(n.id,!0),h={element:n,item:this.getItem(d),event:e};this.trigger("select",h)}if(o&&("mouseover"===e.type||t.Browser.isDevice||this.showItemOnClick)){var c=void 0;if(n.classList.contains(W)){c=i.children[this.navIdx.length-1],this.toggleAnimation(c);(f=this.getLIByClass(c,V))&&f.classList.remove(V),t.detach(n.parentNode),this.navIdx.pop()}else if(!n.classList.contains(_)){this.showSubMenu=!0;var p=n.parentNode;if(this.cliIdx=this.getIdx(p,n),this.isMenu||!t.Browser.isDevice){var u=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),t.closest(p,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,p);if(this.navIdx[u]===this.cliIdx&&(this.showSubMenu=!1),u!==this.navIdx.length&&("mouseover"!==e.type||this.showSubMenu)){var f;(f=this.getLIByClass(p,V))&&f.classList.remove(V),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&this.setLISelected(n),this.closeMenu(u+1,e),this.showItemOnClick&&this.setLISelected(n)}}this.isClosed||this.afterCloseMenu(e),this.isClosed=!1}}else if(this.isMenu&&"DIV"===s.tagName&&this.navIdx.length&&t.closest(s,".e-menu-vscroll")){var m=t.closest(s,"."+Z),v=Array.prototype.indexOf.call(this.getPopups(),m)+1;v<this.navIdx.length&&(this.closeMenu(v+1,e),m&&this.removeLIStateByClass([F,V],[m]))}else this.isMenu&&this.hamburgerMode&&"SPAN"===s.tagName&&s.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):"UL"===s.tagName&&(this.isMenu?!s.parentElement.classList.contains("e-menu-wrapper")||this.getIndex(s.querySelector("."+G).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([V],[i]),n&&n.querySelector(".e-caret")||this.closeMenu(null,e))}},n.prototype.afterCloseMenu=function(e){var i;if(this.showSubMenu){i=this.showItemOnClick&&0===this.navIdx.length?t.closest(e.target,".e-menu-parent.e-control"):t.closest(this.element,".e-menu-parent.e-control");var s=this.navIdx.concat(this.cliIdx),n=this.getItem(s);if(n&&n[this.getField("children",s.length-1)]&&n[this.getField("children",s.length-1)].length?(("mouseover"===e.type||t.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&i||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,n,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!i){var l=this.getUlByNavIdx(),r=this.getLIByClass(l,V);r&&(r.setAttribute("aria-expanded","false"),r.classList.remove(V))}}this.keyType=""},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,V);t&&t.classList.remove(V),this.isMenu||e.classList.remove(F),e.classList.add(V)},n.prototype.getLIByClass=function(e,t){for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},n.prototype.getItemIndex=function(e,t){var i;i="string"==typeof e?e:e.id;var s=!1!==t;return this.getIndex(i,s)},n.prototype.setItem=function(e,t,i){var s;s=i?t||e.id:t||e.text;var n=this.getIndex(s,i),l=this.getItem(n);Object.assign(l,e)},n.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},n.prototype.getItems=function(e){for(var t=this.items,i=0;i<e.length;i++)t=t[e[i]][this.getField("children",i)];return t},n.prototype.setItems=function(e,t){var i=this.getItems(t);i.splice(0,i.length);for(var s=0;s<e.length;s++)i.splice(s,0,e[s])},n.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=Array.prototype.indexOf.call(e.children,t);return i&&e.children[0].classList.contains(W)&&s--,s},n.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:t.closest(e,"li.e-menu-item")},n.prototype.updateItemsByNavIdx=function(){for(var e=this.items,t=0,i=0;i<this.navIdx.length&&(e=e[i].items);i++){t++;var s=this.getUlByNavIdx(t);if(!s)break;this.updateItem(s,e)}},n.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},n.prototype.onPropertyChanged=function(e,i){for(var s=this,n=this.getWrapper(),l=function(l){switch(l){case"cssClass":i.cssClass&&t.removeClass([n],i.cssClass.split(" ")),e.cssClass&&t.addClass([n],e.cssClass.split(" "));break;case"enableRtl":n.classList.toggle("e-rtl");break;case"showItemOnClick":r.unWireEvents(),r.showItemOnClick=e.showItemOnClick,r.wireEvents();break;case"enableScrolling":if(e.enableScrolling){var a;r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl),r.getPopups().forEach(function(e){a=t.select(".e-ul",e),o(s.createElement,e,a,"vscroll",s.enableRtl)})}else{var h=n.children[0];r.element.classList.contains("e-vertical")?d(t.getInstance(h,B),h):d(t.getInstance(h,I),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,B),h),e.style.overflow=""})}break;case"items":var c=void 0,p=void 0,u=void 0;if(Object.keys(i.items).length){var f=Object.keys(e.items);for(m=0;m<f.length;m++)(p=r.getChangedItemIndex(e,[],Number(f[m]))).length<=r.getWrapper().children.length&&(c=p.pop(),u=r.getItems(p),r.insertAfter([u[c]],u[c].text),r.removeItem(u,p,c),r.setItems(u,p)),p.length=0}else{if(r.updateItem(r.element,r.items),r.enableScrolling&&r.element.parentElement.classList.contains("e-custom-scroll")&&(r.element.classList.contains("e-vertical")?o(r.createElement,n,r.element,"vscroll",r.enableRtl):o(r.createElement,n,r.element,"hscroll",r.enableRtl)),!r.hamburgerMode)for(var m=1,v=n.childElementCount;m<v;m++)t.detach(n.lastElementChild);r.navIdx=[]}}},r=this,a=0,h=Object.keys(e);a<h.length;a++){l(h[a])}},n.prototype.updateItem=function(e,i){if(t.isBlazor()&&!this.isMenu)e=this.removeChildElement(e);else{if(this.enableScrolling){var s=this.getWrapper().children[0];this.element.classList.contains("e-vertical")?d(t.getInstance(s,B),s):d(t.getInstance(s,I),s)}e.innerHTML=""}[].slice.call(this.createItems(i).children).forEach(function(t){e.appendChild(t)})},n.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();if("items"===s){var n=e.items[i],l=Object.keys(n.items).pop();l&&this.getChangedItemIndex(n,t,Number(l))}else"isParentArray"===s&&t.length>1&&t.pop();return t},n.prototype.removeItem=function(e,i,s){e.splice(s,1);var n=this.getWrapper().children;i.length<n.length&&t.detach(n[i.length].children[s])},n.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var i=this.getWrapper();if(e){for(var n=void 0,l=void 0,r=t.selectAll(e),o=0,a=r.length;o<a;o++)n=r[o],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(l=t.getInstance(n,t.Touch))&&l.destroy():t.EventHandler.remove(n,"contextmenu",this.cmenuHandler);if(!this.isMenu){t.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var d=0,h=s.getScrollableParent(this.targetElement);d<h.length;d++){var c=h[d];t.EventHandler.remove(c,"scroll",this.scrollHandler)}}}t.Browser.isDevice||(t.EventHandler.remove(this.isMenu?document:i,"mouseover",this.delegateMoverHandler),t.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler)),t.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(i),this.rippleFn()},n.prototype.unWireKeyboardEvent=function(e){var i=t.getInstance(e,t.KeyboardEvents);i&&i.destroy()},n.prototype.toggleAnimation=function(e,t){var i=this;void 0===t&&(t=!0);var s,n;"None"!==this.animationSettings.effect&&t?this.animation.animate(e,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){i.hamburgerMode?(n=e.element.parentElement,e.element.style.position="absolute",s=n.offsetHeight,e.element.style.maxHeight=e.element.offsetHeight+"px",n.style.maxHeight=""):(e.element.style.display="block",e.element.style.maxHeight=e.element.getBoundingClientRect().height+"px")},progress:function(e){i.hamburgerMode&&(n.style.minHeight=s+e.element.offsetHeight+"px")},end:function(e){i.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",n.style.minHeight="",e.element.style.top="0px",e.element.children[0].focus(),i.triggerOpen(e.element.children[0])):i.end(e.element,t)}}):this.end(e,t)},n.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,i={element:e,parentItem:t,items:t?t.items:this.items};this.trigger("onOpen",i)},n.prototype.end=function(e,i){if(i){if(e.style.display="block",e.style.maxHeight="",this.triggerOpen(e),e.querySelector("."+F))e.querySelector("."+F).focus();else if(this.currentTarget&&!this.currentTarget.classList.contains("e-numerictextbox")&&!this.currentTarget.classList.contains("e-textbox")){var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];s?s.querySelector("."+V).focus():this.element.focus()}}else if(e===this.element){var n=this.getLIByClass(this.element,F);n&&n.classList.remove(F);var l=this.getLIByClass(this.element,V);l&&l.classList.remove(V),e.style.display="none"}else t.detach(e)},n.prototype.getPersistData=function(){return""},n.prototype.getWrapper=function(){return t.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},n.prototype.getIndex=function(e,t,i,s,n,l){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===l&&(l=0);var r;l=n?l+1:0;for(var o=0,a=i.length;o<a;o++){if(r=i[o],(t?r[this.getField("itemId",l)]:r[this.getField("text",l)])===e){s.push(o);break}if(r[this.getField("children",l)]&&r[this.getField("children",l)].length){if(-1!==(s=this.getIndex(e,t,r[this.getField("children",l)],s,!0,l))[s.length-1]){s.unshift(o);break}o!==a-1&&s.pop()}else o===a-1&&s.push(-1)}return n||-1!==s[0]?s:[]},n.prototype.enableItems=function(e,i,s){void 0===i&&(i=!0);for(var n,l,r,o,a=Q,d=0;d<e.length;d++){if(r=this.getIndex(e[d],s),this.navIdx.length){if(1!==r.length){o=!1;for(var h=0,c=r.length-1;h<c;h++)if(r[h]!==this.navIdx[h]){o=!0;break}if(o)continue}}else if(1!==r.length)continue;l=r.pop(),(n=this.getUlByNavIdx(r.length))&&(i?this.isMenu?(n.children[l].classList.remove(a),n.children[l].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.remove(a):n.children[l].classList.remove(a):this.isMenu?(n.children[l].classList.add(a),n.children[l].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.add(a):n.children[l].classList.add(a))}},n.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},n.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},n.prototype.showHideItems=function(e,i,s){for(var n,l,r,o=0;o<e.length;o++)l=(r=this.getIndex(e[o],s)).pop(),(n=this.getUlByNavIdx(r.length))&&(i?t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.add(J):n.children[l].classList.add(J):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[l+1].classList.remove(J):n.children[l].classList.remove(J))},n.prototype.removeItems=function(e,i){for(var s,n,l,r=0;r<e.length;r++)s=(n=this.getIndex(e[r],i)).pop(),l=this.getItems(n),t.isNullOrUndefined(s)||this.removeItem(l,n,s)},n.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},n.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},n.prototype.insertItems=function(e,i,s,n){void 0===n&&(n=!0);for(var l,r,o,a,d,h=0;h<e.length;h++){r=(o=this.getIndex(i,s)).pop(),a=this.getItems(o),d=new ee(a[0],"items",e[h],!0),a.splice(n?r+1:r,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(o.length<c.length){r=n?r+1:r,l=this.createItems(a).children[r];var p=this.isMenu?t.select(".e-menu-parent",c[o.length]):c[o.length];p.insertBefore(l,p.children[r])}}},n.prototype.removeAttributes=function(){var e=this;["top","left","display","z-index"].forEach(function(t){e.element.style.removeProperty(t)}),["role","tabindex","class","style"].forEach(function(t){"class"===t&&e.element.classList.contains("e-menu-parent")&&e.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(t)&&e.element.getAttribute(t)||e.element.removeAttribute(t),e.isMenu&&"class"===t&&e.element.classList.contains("e-vertical")&&e.element.classList.remove("e-vertical")})},n.prototype.destroy=function(){var i=this.getWrapper();if(i){if(this.unWireEvents(),this.isMenu)this.closeMenu(),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),i.parentNode.insertBefore(this.element,i),this.clonedElement=null;else{if(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName)t.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement;else if(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)){var s=this.clonedElement.nextElementSibling;s&&s!==i?this.clonedElement.parentElement.insertBefore(this.element,s):this.clonedElement.parentElement.appendChild(this.element),t.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",t.append([].slice.call(this.clonedElement.children),this.element),t.detach(this.clonedElement),this.removeAttributes()}this.clonedElement=null}this.isMenu&&this.clonedElement?(t.detach(this.element),i.style.display="",i.classList.remove("e-"+this.getModuleName()+"-wrapper"),i.removeAttribute("data-ripple")):t.detach(i),e.prototype.destroy.call(this),this.template&&this.clearTemplate(["template"])}this.rippleFn=null},q([t.Event()],n.prototype,"beforeItemRender",void 0),q([t.Event()],n.prototype,"beforeOpen",void 0),q([t.Event()],n.prototype,"onOpen",void 0),q([t.Event()],n.prototype,"beforeClose",void 0),q([t.Event()],n.prototype,"onClose",void 0),q([t.Event()],n.prototype,"select",void 0),q([t.Event()],n.prototype,"created",void 0),q([t.Property("")],n.prototype,"cssClass",void 0),q([t.Property(0)],n.prototype,"hoverDelay",void 0),q([t.Property(!1)],n.prototype,"showItemOnClick",void 0),q([t.Property("")],n.prototype,"target",void 0),q([t.Property("")],n.prototype,"filter",void 0),q([t.Property(null)],n.prototype,"template",void 0),q([t.Property(!1)],n.prototype,"enableScrolling",void 0),q([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),q([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},$)],n.prototype,"fields",void 0),q([t.Collection([],ee)],n.prototype,"items",void 0),q([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},te)],n.prototype,"animationSettings",void 0),n=q([t.NotifyPropertyChanges],n)}(t.Component),se=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),ne=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},le="e-vertical",re="e-toolbar-items",oe="e-toolbar-item",ae="e-rtl",de="e-separator",he="e-popup-up-icon",ce="e-popup-down-icon",pe="e-overlay",ue="e-popup-text",fe="e-overflow-show",me="e-overflow-hide",ve="e-hor-nav",ge="e-toolbar-center",ye="e-tbar-pos",be="e-toolbar-pop",Ce="e-toolbar-popup",xe="e-nav-active",Ee="e-ignore",Ne="e-popup-alone",Ie="e-hidden",Se="e-toolbar-multirow",Oe="e-multirow-separator",we="e-extended-separator",ke="e-extended-toolbar",Le="e-toolbar-extended",Ae="e-tbar-extended",Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return se(i,e),ne([t.Property("")],i.prototype,"id",void 0),ne([t.Property("")],i.prototype,"text",void 0),ne([t.Property("auto")],i.prototype,"width",void 0),ne([t.Property("")],i.prototype,"cssClass",void 0),ne([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),ne([t.Property(!1)],i.prototype,"disabled",void 0),ne([t.Property("")],i.prototype,"prefixIcon",void 0),ne([t.Property("")],i.prototype,"suffixIcon",void 0),ne([t.Property(!0)],i.prototype,"visible",void 0),ne([t.Property("None")],i.prototype,"overflow",void 0),ne([t.Property("")],i.prototype,"template",void 0),ne([t.Property("Button")],i.prototype,"type",void 0),ne([t.Property("Both")],i.prototype,"showTextOn",void 0),ne([t.Property(null)],i.prototype,"htmlAttributes",void 0),ne([t.Property("")],i.prototype,"tooltipText",void 0),ne([t.Property("Left")],i.prototype,"align",void 0),ne([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),De=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.resizeContext=s.resize.bind(s),s.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},s}return se(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular)&&this.clearTemplate();var s=this.element.querySelectorAll(".e-control.e-btn");for([].slice.call(s).forEach(function(e){t.isNullOrUndefined(e)||t.isNullOrUndefined(e.ej2_instances)||t.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),t.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&t.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","aria-haspopup","role"].forEach(function(e){return i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},i.prototype.preRender=function(){var e={enableCollision:this.enableCollision,scrollStep:this.scrollStep};this.trigger("beforeCreate",e),this.enableCollision=e.enableCollision,this.scrollStep=e.scrollStep,this.scrollModule=null,this.popObj=null,this.tempId=[],this.tbarItemsCol=this.items,this.isVertical=!!this.element.classList.contains(le),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,ae)},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),this.allowKeyboard&&this.wireKeyboardEvent()},i.prototype.wireKeyboardEvent=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),t.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.element.setAttribute("tabIndex","0")},i.prototype.unwireKeyboardEvent=function(){this.keyModule&&(t.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},i.prototype.docKeyDown=function(e){if("INPUT"!==e.target.tagName){var i=!t.isNullOrUndefined(this.popObj)&&t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode;9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&i&&this.popObj.hide({name:"FadeOut",duration:100});(40===e.keyCode||38===e.keyCode||35===e.keyCode||36===e.keyCode)&&e.preventDefault()}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(document,"scroll",this.docEvent),t.EventHandler.remove(document,"click",this.docEvent)},i.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},i.prototype.docEvent=function(e){var i=t.closest(e.target,".e-popup");this.popObj&&t.isVisible(this.popObj.element)&&!i&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},i.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ye),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){if(this.element&&[].slice.call(this.element.querySelectorAll("."+oe)).forEach(function(e){t.detach(e)}),this.tbarAlign){var e=this.element.querySelector("."+re);[].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,ye)}this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,ae),this.destroyScroll()),this.remove(this.element,Ae),this.remove(this.element,ke);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,Se),this.popObj&&this.popupRefresh(this.popObj.element,!0)},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},i.prototype.clstElement=function(e,i){return e&&this.popObj&&t.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+oe):this.element===i||e?this.element.querySelector("."+oe+":not(."+pe+" ):not(."+de+" ):not(."+Ie+" )"):t.closest(i,"."+oe)},i.prototype.keyHandling=function(e,i,s,n,l){var r,o,a=this.popObj,d=this.element,h={name:"FadeOut",duration:100},c="moveUp"===i.action?"previous":"next";switch(i.action){case"moveRight":if(this.isVertical)return;d===s?this.elementFocus(e):n||this.eleFocus(e,"next");break;case"moveLeft":if(this.isVertical)return;n||this.eleFocus(e,"previous");break;case"home":case"end":if(e){var p=t.closest(e,".e-popup"),u=this.element.querySelector("."+Le);"Extended"===this.overflowMode&&u&&u.classList.contains("e-popup-open")&&(p="end"===i.action?u:null),p?t.isVisible(this.popObj.element)&&(o=[].slice.call(p.children),r="home"===i.action?o[0]:o[o.length-1]):(o=this.element.querySelectorAll("."+re+" ."+oe+":not(."+de+")"),r="home"===i.action?o[0]:o[o.length-1]),r&&this.elementFocus(r)}break;case"moveUp":case"moveDown":if(this.isVertical)"moveUp"===i.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next");else if(a&&t.closest(s,".e-popup")){var f=a.element,m=f.firstElementChild;if("previous"===c&&m===e||"next"===c&&f.lastElementChild===e)return;this.eleFocus(e,c)}else"moveDown"===i.action&&a&&t.isVisible(a.element)&&this.elementFocus(e);break;case"tab":if(!l&&!n){var v=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(v),v.focus()),this.element.removeAttribute("tabindex"))}break;case"popupClose":a&&"Extended"!==this.overflowMode&&a.hide(h);break;case"popupOpen":if(!n)return;a&&!t.isVisible(a.element)?(a.element.style.top=d.offsetHeight+"px",a.show({name:"FadeIn",duration:100})):a.hide(h)}},i.prototype.keyActionHandler=function(e){var t=e.target;if("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!this.element.classList.contains(pe)){e.preventDefault();var i=t.classList.contains(ve),s=t.classList.contains("e-scroll-nav"),n=this.clstElement(i,t);(n||s)&&this.keyHandling(n,e,t,i,s)}},i.prototype.disable=function(e){var i=this.element;e?i.classList.add(pe):i.classList.remove(pe),i.setAttribute("tabindex",e?"-1":"0"),this.activeEle&&this.activeEle.setAttribute("tabindex",e?"-1":"0"),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(t.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),i.querySelector("#"+i.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},i.prototype.eleContains=function(e){return e.classList.contains(de)||e.classList.contains(pe)||e.getAttribute("disabled")||e.classList.contains(Ie)||!t.isVisible(e)},i.prototype.eleFocus=function(e,i){var s=Object(e)[i+"ElementSibling"];if(s){if(this.eleContains(s))return void this.eleFocus(s,i);this.elementFocus(s)}else if(this.tbarAlign){var n=Object(e.parentElement)[i+"ElementSibling"];if(t.isNullOrUndefined(n)||0!==n.children.length||(n=Object(n)[i+"ElementSibling"]),!t.isNullOrUndefined(n)&&n.children.length>0)if("next"===i){var l=n.querySelector("."+oe);this.eleContains(l)?this.eleFocus(l,i):(l.firstElementChild.focus(),this.activeEleSwitch(l))}else{l=n.lastElementChild;this.eleContains(l)?this.eleFocus(l,i):this.elementFocus(l)}}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,l=!t.isNullOrUndefined(t.closest(s,"."+be)),r=s.classList,o=t.closest(s,"."+ve);o||(o=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!r.contains(ve)||(r=s.querySelector(".e-icons").classList),(r.contains(he)||r.contains(ce))&&this.popupClickHandler(n,o,ae);var a,d=t.closest(e.target,"."+oe);if(!t.isNullOrUndefined(d)&&!d.classList.contains(pe)||o.classList.contains(ve)){if(d){a=this.items[this.tbarEle.indexOf(d)]}var h={originalEvent:e,item:a};a&&!t.isNullOrUndefined(a.click)&&this.trigger("items["+this.tbarEle.indexOf(d)+"].click",h),h.cancel||this.trigger("clicked",h,function(e){!t.isNullOrUndefined(i.popObj)&&l&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})}},i.prototype.popupClickHandler=function(e,i,s){var n=this.popObj;t.isVisible(n.element)?(i.classList.remove(xe),n.hide({name:"FadeOut",duration:100})):(e.classList.contains(s)&&(n.enableRtl=!0,n.position={X:"left",Y:"top"}),0!==n.offsetX||e.classList.contains(s)||(n.enableRtl=!1,n.position={X:"right",Y:"top"}),n.dataBind(),n.refreshPosition(),n.element.style.top=this.getElementOffsetY()+"px","Extended"===this.overflowMode&&(n.element.style.minHeight="0px"),i.classList.add(xe),n.show({name:"FadeIn",duration:100}))},i.prototype.render=function(){this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);"msie"===t.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||t.setStyleAttribute(this.element,{height:i}),t.setStyleAttribute(this.element,{width:e});var s={role:"toolbar","aria-disabled":"false","aria-haspopup":"false","aria-orientation":this.isVertical?"vertical":"horizontal"};t.attributes(this.element,s),this.cssClass&&t.addClass([this.element],this.cssClass.split(" "))},i.prototype.renderControl=function(){var e=this.element;this.trgtEle=e.children.length>0?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},i.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&this.popObj.element.childElementCount>1&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},i.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[n],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[n],t,n),(s=t.querySelector(".e-toolbar-"+e[n].align.toLowerCase()))?(e[n].showAlwaysInPopup&&"Show"!==e[n].overflow||this.tbarAlgEle[(e[n].align+"s").toLowerCase()].push(i),s.appendChild(i)):t.appendChild(i);if(this.isReact){this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates()}},i.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(le),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(le),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),t.setStyleAttribute(this.element,{height:t.formatUnit(this.height),width:t.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},i.prototype.initScroll=function(e,i){!this.scrollModule&&this.checkOverflow(e,i[0])&&(this.tbarAlign&&this.element.querySelector("."+re+" ."+ge).removeAttribute("style"),this.isVertical?this.scrollModule=new B({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new I({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.cssClass&&t.addClass([i[0]],this.cssClass.split(" ")),this.remove(this.scrollModule.element,ye),t.setStyleAttribute(this.element,{overflow:"hidden"}))},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+oe,e)).forEach(function(e){t.isVisible(e)&&(i=window.getComputedStyle(e),n+=s.isVertical?e.offsetHeight:e.offsetWidth,n+=parseFloat(s.isVertical?i.marginTop:i.marginRight),n+=parseFloat(s.isVertical?i.marginBottom:i.marginLeft))}),n},i.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},i.prototype.checkOverflow=function(e,i){if(t.isNullOrUndefined(e)||t.isNullOrUndefined(i)||!t.isVisible(e))return!1;var s=this.isVertical?e.offsetHeight:e.offsetWidth,n=this.isVertical?i.offsetHeight:i.offsetWidth;(this.tbarAlign||this.scrollModule||s===n)&&(n=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(i):i));var l=e.querySelector("."+ve),r=e.querySelector(".e-scroll-nav"),o=0;return l?o=this.isVertical?l.offsetHeight:l.offsetWidth:r&&(o=this.isVertical?2*r.offsetHeight:2*r.offsetWidth),n>s-o},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ye),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+re),s=this.popupPriCount>0;if(e&&e.children.length>0)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===t.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":t.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(re)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,i)||s)&&this.setOverflowAttributes(e),this.toolbarAlign(i);break;case"MultiRow":this.add(i,Se),this.checkOverflow(e,i)&&this.tbarAlign&&(this.removePositioning(),this.add(i,"e-multirow-pos")),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==t.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,ke),(this.checkOverflow(e,i)||s)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(i)}},i.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(t.selectAll("."+re+" ."+oe,e))),this.element.querySelector("."+ve).setAttribute("tabIndex","0"),this.element.querySelector("."+ve).setAttribute("role","list")},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+de)),i=e.querySelector("."+Oe),s=e.querySelector("."+we),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove(Oe):"Extended"===this.overflowMode&&n.classList.remove(we));for(var l=0;l<=t.length-1;l++)t[l].offsetLeft<30&&0!==t[l].offsetLeft&&("MultiRow"===this.overflowMode?t[l].classList.add(Oe):"Extended"===this.overflowMode&&t[l].classList.add(we))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector("."+ve),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector("."+ve);var l=n?s.offsetHeight:s.offsetWidth,r=(n?e.offsetHeight:e.offsetWidth)-l;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,r,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,l){var r=e.element,o=[].slice.call(t.selectAll("."+Ce,r.querySelector("."+re))),a=t.selectAll("."+fe,s),d=0,h=0;o.forEach(function(r,o){a=t.selectAll("."+fe,s),r.classList.contains(fe)&&a.length>0?e.tbResize&&a.length>o?(s.insertBefore(r,a[o]),++h):(s.insertBefore(r,s.children[a.length]),++h):r.classList.contains(fe)?(s.insertBefore(r,s.firstChild),++h):e.tbResize&&r.classList.contains(me)&&s.children.length>0&&0===a.length?(s.insertBefore(r,s.firstChild),++h):r.classList.contains(me)?i.push(r):e.tbResize?(s.insertBefore(r,s.childNodes[d+h]),++d):s.appendChild(r),r.classList.contains(de)?t.setStyleAttribute(r,{display:"",height:l+"px"}):t.setStyleAttribute(r,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+oe,r.querySelector("."+re)),p=c.length-1;p>=0;p--){var u=c[p];if(!u.classList.contains(de)||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,i,s=this.element;"Extended"===this.overflowMode&&(i=s.querySelector("."+de+":not(."+Ce+")"),e="auto"===s.style.height||""===s.style.height?null:i.offsetHeight);var n,l=s.querySelector("."+oe+":not(."+de+"):not(."+Ce+")"),r="auto"===s.style.height||""===s.style.height?null:l&&l.offsetHeight;if(t.select("#"+s.id+"_popup."+be,s))n=t.select("#"+s.id+"_popup."+be,s);else{var o=this.createElement("div",{id:s.id+"_popup",className:be+" "+Le}),a=this.createElement("div",{id:s.id+"_popup",className:be});n="Extended"===this.overflowMode?o:a}this.pushingPoppedEle(this,[],n,r,e),this.popupInit(s,n)},i.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},i.prototype.popupInit=function(e,i){if(this.popObj){var n=this.popObj.element;t.setStyleAttribute(n,{maxHeight:"",display:"block"}),t.setStyleAttribute(n,{maxHeight:n.offsetHeight+"px",display:""})}else{e.appendChild(i),this.cssClass&&t.addClass([i],this.cssClass.split(" ")),t.setStyleAttribute(this.element,{overflow:""});var l=window.getComputedStyle(this.element),r=new s.Popup(null,{relateTo:this.element,offsetY:this.isVertical?0:this.getElementOffsetY(),enableRtl:this.enableRtl,open:this.popupOpen.bind(this),close:this.popupClose.bind(this),collision:{Y:this.enableCollision?"flip":"none"},position:this.enableRtl?{X:"left",Y:"top"}:{X:"right",Y:"top"}});if(r.appendTo(i),"Extended"===this.overflowMode&&(r.width=parseFloat(l.width)+2*parseFloat(l.borderRightWidth),r.offsetX=0),t.EventHandler.add(document,"scroll",this.docEvent.bind(this)),t.EventHandler.add(document,"click ",this.docEvent.bind(this)),r.element.style.maxHeight=r.element.offsetHeight+"px",this.isVertical&&(r.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector("."+ve);o.classList.add(xe),t.classList(o.firstElementChild,[he],[ce]),this.element.querySelector("."+Le).classList.add("e-popup-open")}else r.hide();this.popObj=r,this.element.setAttribute("aria-haspopup","true")}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,Ae):this.remove(this.element,Ae))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,l=this.popObj.element.parentElement,r=l.querySelector("."+ve);t.setStyleAttribute(i.element,{height:"auto",maxHeight:""}),i.element.style.maxHeight=i.element.offsetHeight+"px","Extended"===this.overflowMode&&(i.element.style.minHeight="");var o=n.offsetTop+n.offsetHeight+s.calculatePosition(l).top,a=r.firstElementChild;r.classList.add(xe),t.classList(a,[he],[ce]),this.tbarPopupHandler(!0);var d=t.isNullOrUndefined(window.scrollY)?0:window.scrollY;if(!this.isVertical&&window.innerHeight+d<o&&this.element.offsetTop<n.offsetHeight){var h=n.offsetHeight-(o-window.innerHeight-d+5);i.height=h+"px";for(var c=0;c<=n.childElementCount;c++){var p=n.children[c];if(p.offsetTop+p.offsetHeight>h){h=p.offsetTop;break}}t.setStyleAttribute(i.element,{maxHeight:h+"px"})}else if(this.isVertical){var u=this.element.getBoundingClientRect();t.setStyleAttribute(i.element,{maxHeight:u.top+this.element.offsetHeight+"px",bottom:0,visibility:""})}if(i){var f=n.getBoundingClientRect();f.right>document.documentElement.clientWidth&&f.width>l.getBoundingClientRect().width&&(i.collision={Y:"none"},i.dataBind()),i.refreshPosition()}},i.prototype.popupClose=function(e){var i=this.element.querySelector("."+ve),s=i.firstElementChild;i.classList.remove(xe),t.classList(s,[ce],[he]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var l,r=this.popupPriCount>0,o=s,a=0,d=0,h=0,c=function(e,t){var i=!1;return t.forEach(function(t){e.classList.contains(t)&&(i=!0)}),i},p=i.length-1;p>=0;p--){var u=void 0,f=window.getComputedStyle(i[p]);this.isVertical?(u=parseFloat(f.marginTop),u+=parseFloat(f.marginBottom)):(u=parseFloat(f.marginRight),u+=parseFloat(f.marginLeft));var m=i[p]===this.tbarEle[0];m&&(this.tbarEleMrgn=u),l=this.isVertical?i[p].offsetHeight:i[p].offsetWidth;var v=m?l+u:l;if(c(i[p],[Ne])&&r&&(i[p].classList.add(Ce),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++),this.isVertical?i[p].offsetTop+i[p].offsetHeight+u>s:i[p].offsetLeft+i[p].offsetWidth+u>s){if(i[p].classList.contains(de)){if("Extended"===this.overflowMode){if(d===h){c(g=i[p],[de,Ee])&&(i[p].classList.add(Ce),h++)}d++}else if("Popup"===this.overflowMode){if(a>0&&d===h){var g;c(g=i[p+d+(a-1)],[de,Ee])&&t.setStyleAttribute(g,{display:"none"})}a++,d=0,h=0}}else d++;i[p].classList.contains(fe)&&n?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:c(i[p],[de,Ee])?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:(i[p].classList.add(Ce),this.isVertical?t.setStyleAttribute(i[p],{display:"none",minHeight:v+"px"}):t.setStyleAttribute(i[p],{display:"none",minWidth:v+"px"}),h++)}}if(n){var y=t.selectAll("."+oe+":not(."+Ce+")",this.element);this.checkPriority(e,y,o,!1)}},i.prototype.createPopupIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-hor-nav");s="Extended"===this.overflowMode?s+" e-expended-nav":s;var n=this.createElement("div",{id:i,className:s});"msie"!==t.Browser.info.name&&"edge"!==t.Browser.info.name||n.classList.add("e-ie-align");var l=this.createElement("div",{className:ce+" e-icons"});n.appendChild(l),n.setAttribute("tabindex","0"),n.setAttribute("role","list"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,l,r,o,a){var d=a,h=this.popObj.element,c=t.selectAll("."+Ce+":not(."+fe+")",h).length,p=function(e,t){return e.classList.contains(t)};if(0===t.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length){var u=e.children[i-(i-s)-1],f=!t.isNullOrUndefined(u)&&p(u,Ee);if(!t.isNullOrUndefined(u)&&p(u,de)&&!t.isVisible(u)||f){u.style.display="inherit";var m=u.offsetWidth+2*parseFloat(window.getComputedStyle(u).marginRight),v=u.previousElementSibling;r+m<o||l?(e.insertBefore(n,e.children[i+d-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):v.classList.contains(de)&&(v.style.display="none"),u.style.display=""}else e.insertBefore(n,e.children[i+d-(i-s)])}else e.insertBefore(n,e.children[i+d-c])},i.prototype.popupRefresh=function(e,i){var s=this,n=this.element,l=this.isVertical,r=n.querySelector("."+re),o=n.querySelector("."+ve);if(!t.isNullOrUndefined(o)){r.removeAttribute("style"),e.style.display="block";var a;a=l?n.offsetHeight-(o.offsetHeight+r.offsetHeight):n.offsetWidth-(o.offsetWidth+r.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),a+(l?o.offsetHeight:o.offsetWidth)>d&&0===this.popupPriCount&&(i=!0),this.popupEleRefresh(a,e,i),e.style.display="",0===e.children.length&&o&&this.popObj&&(t.detach(o),o=null,this.popObj.destroy(),t.detach(this.popObj.element),this.popObj=null,n.setAttribute("aria-haspopup","false"))}},i.prototype.ignoreEleFetch=function(e,t){var i=[].slice.call(t.querySelectorAll("."+Ee)),s=[],n=0;return i.length>0?(i.forEach(function(e){s.push([].slice.call(t.children).indexOf(e))}),s.forEach(function(t){t<=e&&n++}),n):0},i.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild);t.firstElementChild.style.removeProperty("Position");var s=e.offsetWidth-e.querySelector("."+ve).offsetWidth,n=e.querySelector("."+re).offsetWidth;return t.style.removeProperty("display"),s>i+n},i.prototype.popupEleWidth=function(e){e.style.position="absolute";var i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");if(e.classList.contains("e-tbtn-align")||e.classList.contains(ue)){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains(ue)?s.style.display="none":!t.isNullOrUndefined(s)&&e.classList.contains("e-toolbar-text")&&(s.style.display="block"),n.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),n.style.minWidth="",n.style.minHeight="",t.isNullOrUndefined(s)||(s.style.display="")}return i},i.prototype.popupEleRefresh=function(e,i,s){for(var n,l,r=this.popupPriCount>0,o=this.tbarEle,a=this.element.querySelector("."+re),d=0,h=function(i){if(i.classList.contains(Ne)&&r&&!s)return"continue";var h=c.popupEleWidth(i);if(i===c.tbarEle[0]&&(h+=c.tbarEleMrgn),i.style.position="",!(h<e||s))return"break";if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains(me)||i.classList.remove(Ce),l=c.tbarEle.indexOf(i),c.tbarAlign){var p=c.items[l].align;l=c.tbarAlgEle[(p+"s").toLowerCase()].indexOf(i),o=c.tbarAlgEle[(p+"s").toLowerCase()],a=c.element.querySelector("."+re+" .e-toolbar-"+p.toLowerCase())}var u=0;"Extended"!==c.overflowMode&&o.slice(0,l).forEach(function(t){(t.classList.contains(fe)||t.classList.contains(de))&&(t.classList.contains(de)&&(t.style.display="",e-=t.offsetWidth),u++)}),d=c.ignoreEleFetch(l,a),i.classList.contains(fe)?(c.tbarPriRef(a,l,u,i,s,h,e,d),e-=i.offsetWidth):0===l?(a.insertBefore(i,a.firstChild),e-=i.offsetWidth):(n=t.selectAll("."+fe,c.popObj.element).length,a.insertBefore(i,a.children[l+d-n]),e-=i.offsetWidth),i.style.height=""},c=this,p=0,u=[].slice.call(i.children);p<u.length;p++){if("break"===h(u[p]))break}this.checkOverflow(this.element,this.element.getElementsByClassName(re)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+re);if(!t.isNullOrUndefined(e)&&e.classList.contains(ye)){this.remove(e,ye);var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+re);this.add(e,ye),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+re);if(!t.isNullOrUndefined(i)&&i.classList.contains(ye)){var s,n=this.element.querySelector("."+ve);if(this.scrollModule){var l=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+l).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var r=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){r-=this.isVertical?n.offsetHeight:n.offsetWidth;var o=(this.isVertical?n.offsetHeight:n.offsetWidth)+"px";s[2].removeAttribute("style"),this.isVertical?this.enableRtl?s[2].style.top=o:s[2].style.bottom=o:this.enableRtl?s[2].style.left=o:s[2].style.right=o}if(!(r<=e)){var a=(r-e-(this.isVertical?s[1].offsetHeight:s[1].offsetWidth))/2;s[1].removeAttribute("style");var d=(this.isVertical?s[0].offsetHeight:s[0].offsetWidth)+a+"px";this.isVertical?this.enableRtl?s[1].style.marginBottom=d:s[1].style.marginTop=d:this.enableRtl?s[1].style.marginRight=d:s[1].style.marginLeft=d}}},i.prototype.tbarItemAlign=function(e,t,i){var s=this;if(!e.showAlwaysInPopup||"Show"===e.overflow){var n=[];if(n.push(this.createElement("div",{className:"e-toolbar-left"})),n.push(this.createElement("div",{className:ge})),n.push(this.createElement("div",{className:"e-toolbar-right"})),0===i&&"Left"!==e.align)n.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ye);else if("Left"!==e.align){var l=t.childNodes,r=n[0];[].slice.call(l).forEach(function(e){s.tbarAlgEle.lefts.push(e),r.appendChild(e)}),t.appendChild(r),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,ye)}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,re),this.tbarEle=[];[].slice.call(this.trgtEle.children).forEach(function(t){"DIV"===t.tagName&&(e.tbarEle.push(t),t.setAttribute("aria-disabled","false"),e.add(t,oe))})},i.prototype.renderItems=function(){var e=this.element,t=this.items;if(null!=this.trgtEle)this.ctrlTemplate();else if(e&&t.length>0){var i=void 0;e&&e.children.length>0&&(i=e.querySelector("."+re)),i||(i=this.createElement("div",{className:re})),this.itemsAlign(t,i),e.appendChild(i)}},i.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[n])?this.add(t,e[i]):t.setAttribute(i,e[i])},i.prototype.enableItems=function(e,i){var s,n=e,l=n.length;t.isNullOrUndefined(i)&&(i=!0);var r=function(e,t){e?(t.classList.remove(pe),t.setAttribute("aria-disabled","false")):(t.classList.add(pe),t.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(l)&&l>=1){for(var o=0,a=[].slice.call(n);o<l;o++){var d=a[o];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[o]=s}else s=d;r(i,s)}i?t.removeClass(n,pe):t.addClass(n,pe)}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;r(i,s)}},i.prototype.getElementByIndex=function(e){return this.tbarEle[e]?this.tbarEle[e]:null},i.prototype.addItems=function(e,i){var s;this.extendedOpen();var n=this.element.querySelector("."+re);if(t.isNullOrUndefined(n))this.itemsRerender(e);else{var l,r="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var o=0,a=e;o<a.length;o++){var d=a[o];if(t.isNullOrUndefined(d.type)&&(d.type="Button"),s=t.selectAll("."+oe,this.element),d.align=r,l=this.renderSubComponent(d,i),this.tbarEle.length>=i&&s.length>=0){t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var h="L"===d.align[0]?0:"C"===d.align[0]?1:2,c=void 0;this.tbarAlign||"Left"===r?this.tbarAlign?((c=t.closest(s[0],"."+re).children[h]).insertBefore(l,c.children[i]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,l),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+re,this.element))[0].appendChild(l):s[0].parentNode.insertBefore(l,s[i]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+re).children[h]).appendChild(l),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(l),this.refreshPositioning()),this.items.splice(i,0,d),d.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(i,0,l),i++,this.offsetWid=n.offsetWidth}}n.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},i.prototype.removeItems=function(e){var i,s=e,n=[].slice.call(t.selectAll("."+oe,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var l=0,r=[].slice.call(s);l<r.length;l++){var o=r[l];i=this.tbarEle.indexOf(o),this.removeItemByIndex(i,n),n=t.selectAll("."+oe,this.element)}else{o=s&&s.length&&1===s.length?s[0]:e;i=n.indexOf(o),this.removeItemByIndex(i,n)}this.resize()},i.prototype.removeItemByIndex=function(e,i){if(this.tbarEle[e]&&i[e]){var s=this.tbarEle.indexOf(i[e]);if(this.tbarAlign){var n=this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].indexOf(this.tbarEle[s]);this.tbarAlgEle[(this.items[s].align+"s").toLowerCase()].splice(n,1)}this.isReact&&this.clearTemplate();var l=i[e].querySelector(".e-control.e-btn");t.isNullOrUndefined(l)||t.isNullOrUndefined(l.ej2_instances[0])||l.ej2_instances[0].isDestroyed||l.ej2_instances[0].destroy(),t.detach(i[e]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var l,r=s.type,o=e;if("object"==typeof e&&(l="function"==typeof o.appendTo),"string"!=typeof e&&l){if("Input"===r){c=this.createElement("input");s.id?c.id=s.id:c.id=t.getUniqueID("tbr-ipt"),i.appendChild(c),o.appendTo(c)}}else{var a=void 0,d=e,h=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i);d="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName))if("string"==typeof e&&h.test(d))i.innerHTML=d;else if(document.querySelectorAll(d).length){var c,p=(c=document.querySelector(d)).outerHTML.trim();i.appendChild(c),c.style.display="",t.isNullOrUndefined(p)||this.tempId.push(d)}else a=t.compile(d);else i.appendChild(e)}catch(e){a=t.compile(d)}var u=void 0;if(!t.isNullOrUndefined(a)){var f=this.element.id+n+"_template";u=a({},this,"template",f,this.isStringTemplate)}!t.isNullOrUndefined(u)&&u.length>0&&[].slice.call(u).forEach(function(e){t.isNullOrUndefined(e.tagName)||(e.style.display=""),i.appendChild(e)})}this.add(i,"e-template"),this.tbarEle.push(i)},i.prototype.buttonRendering=function(e,i){var s=this.createElement("button",{className:"e-tbar-btn"});s.setAttribute("type","button");var l,r,o=e.text;e.id?s.id=e.id:s.id=t.getUniqueID("e-tbr-btn");var a=this.createElement("span",{className:"e-tbar-btn-text"});o?(a.innerHTML=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(o):o,s.appendChild(a),s.classList.add("e-tbtn-txt")):this.add(i,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(e.prefixIcon&&e.suffixIcon||e.prefixIcon?(l=e.prefixIcon+" e-icons",r="Left"):(l=e.suffixIcon+" e-icons",r="Right"));var d=new n.Button({iconCss:l,iconPosition:r});return d.createElement=this.createElement,d.appendTo(s),e.width&&t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),s},i.prototype.renderSubComponent=function(e,i){var s,n=this.createElement("div",{className:oe});n.setAttribute("aria-disabled","false");var l=this.createElement("div",{innerHTML:this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,n),e.tooltipText&&n.setAttribute("title",l.textContent),e.cssClass&&(n.className=n.className+" "+e.cssClass),e.template)this.templateRender(e.template,n,e,i);else switch(e.type){case"Button":(s=this.buttonRendering(e,n)).setAttribute("tabindex","-1"),s.setAttribute("aria-label",e.text||e.tooltipText),n.appendChild(s),n.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(n,de)}if(e.showTextOn){var r=e.showTextOn;"Toolbar"===r?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===r&&this.add(n,ue)}if(e.overflow){var o=e.overflow;"Show"===o?this.add(n,fe):"Hide"===o&&(n.classList.contains(de)||this.add(n,me))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains(de)&&(this.add(n,Ne),this.popupPriCount++),e.disabled&&this.add(n,pe),!1===e.visible&&this.add(n,Ie),n},i.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},i.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},i.prototype.activeEleRemove=function(e){t.isNullOrUndefined(this.activeEle)||this.activeEle.setAttribute("tabindex","-1"),this.activeEle=e,t.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains("e-template")?e.removeAttribute("tabindex"):this.activeEle.setAttribute("tabindex","0")},i.prototype.getPersistData=function(){return this.addOnPersist([])},i.prototype.getModuleName=function(){return"toolbar"},i.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},i.prototype.resize=function(){var e=this.element;this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide();var i=this.checkOverflow(e,e.getElementsByClassName(re)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+re);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,ye))}if(!i||!this.scrollModule||this.offsetWid!==e.offsetWidth){if((this.offsetWid>e.offsetWidth||i)&&this.renderOverflowMode(),this.popObj){if("Extended"===this.overflowMode){var n=window.getComputedStyle(this.element);this.popObj.width=parseFloat(n.width)+2*parseFloat(n.borderRightWidth)}this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign&&this.refreshPositioning()}this.element.querySelector(".e-hscroll-bar")&&(this.scrollStep=this.element.querySelector(".e-hscroll-bar").offsetWidth),this.offsetWid=e.offsetWidth,this.tbResize=!1,this.separator()}},i.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Le);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains("e-popup-open"))},i.prototype.onPropertyChanged=function(e,i){var s=this.element,n=s.offsetWidth;this.extendedOpen();for(var l=0,r=Object.keys(e);l<r.length;l++){switch(r[l]){case"items":if(e.items instanceof Array&&i.items instanceof Array)this.itemsRerender(e.items);else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=Object(e.items[d])[h];if("function"!=typeof c){if(this.tbarAlign||"align"===h){this.refresh(),this.trigger("created");break}var p="showAlwaysInPopup"===h&&!c,u="overflow"===h&&0!==this.popupPriCount;(p||this.items[d].showAlwaysInPopup&&u)&&--this.popupPriCount,t.isNullOrUndefined(this.scrollModule)&&this.destroyMode();var f=[].slice.call(t.selectAll("."+re+" ."+oe,s));this.isReact&&this.clearTemplate(),t.detach(f[d]),this.tbarEle.splice(d,1),this.addItems([this.items[d]],d),this.items.splice(d,1),this.items[d].template&&this.tbarEle.splice(this.items.length,1)}}break;case"width":t.setStyleAttribute(s,{width:t.formatUnit(e.width)}),this.renderOverflowMode(),this.popObj&&n<s.offsetWidth&&this.popupRefresh(this.popObj.element,!1);break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(s,ae),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,ae):this.remove(s,ae),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,ae):this.remove(this.scrollModule.element,ae)),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,ae):this.remove(this.popObj.element,ae)),this.tbarAlign&&this.itemPositioning();break;case"scrollStep":this.scrollModule&&(this.scrollModule.scrollStep=this.scrollStep);break;case"enableCollision":this.popObj&&(this.popObj.collision={Y:this.enableCollision?"flip":"none"});break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}}},i.prototype.hideItem=function(e,i){var s,n,l="object"==typeof e,r=e,o=[].slice.call(t.selectAll("."+oe,this.element));if(l)n=e;else if(this.tbarEle[r]){n=[].slice.call(t.selectAll("."+oe,this.element))[r]}if(n){if(i?n.classList.add(Ie):n.classList.remove(Ie),i&&t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains(de)){if(t.isNullOrUndefined(n.firstElementChild.getAttribute("tabindex"))){n.firstElementChild.setAttribute("tabindex","-1");var a=[].slice.call(t.selectAll("."+oe,this.element));l&&(r=a.indexOf(n));for(var d=a[++r];d;){if(!this.eleContains(d)){d.firstElementChild.removeAttribute("tabindex");break}d=a[++r]}}}else if(t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains(de))for(var h=!1,c=!1,p=o[s=0];p;)if(p.classList.contains(de))p=o[++s];else if(t.isNullOrUndefined(p.firstElementChild.getAttribute("tabindex")))p.firstElementChild.setAttribute("tabindex","-1"),h=!0;else{if(h&&c)break;this.eleContains(p)||(p.firstElementChild.removeAttribute("tabindex"),c=!0),p=o[++s]}this.refreshOverflow()}},ne([t.Collection([],Pe)],i.prototype,"items",void 0),ne([t.Property("auto")],i.prototype,"width",void 0),ne([t.Property("auto")],i.prototype,"height",void 0),ne([t.Property("")],i.prototype,"cssClass",void 0),ne([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),ne([t.Property()],i.prototype,"scrollStep",void 0),ne([t.Property(!0)],i.prototype,"enableCollision",void 0),ne([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),ne([t.Property(!0)],i.prototype,"allowKeyboard",void 0),ne([t.Event()],i.prototype,"clicked",void 0),ne([t.Event()],i.prototype,"created",void 0),ne([t.Event()],i.prototype,"destroyed",void 0),ne([t.Event()],i.prototype,"beforeCreate",void 0),i=ne([t.NotifyPropertyChanges],i)}(t.Component),Te=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Me=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},He="e-acrdn-root",Ue="e-accordion",Re="e-acrdn-item",Be="e-acrdn-header",je="e-acrdn-header-content",qe="e-acrdn-panel",Fe="e-acrdn-content",We="e-toggle-icon",Ve="e-content-hide",_e="e-selected",ze="e-active",Ke="e-overlay",Ye="e-toggle-animation",Xe="e-expand-state",Ge="e-accordion-container",Qe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Property("SlideDown")],i.prototype,"effect",void 0),Me([t.Property(400)],i.prototype,"duration",void 0),Me([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Je=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},Qe)],i.prototype,"collapse",void 0),Me([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},Qe)],i.prototype,"expand",void 0),i}(t.ChildProperty),Ze=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Te(i,e),Me([t.Property(null)],i.prototype,"content",void 0),Me([t.Property(null)],i.prototype,"header",void 0),Me([t.Property(null)],i.prototype,"cssClass",void 0),Me([t.Property(null)],i.prototype,"iconCss",void 0),Me([t.Property(!1)],i.prototype,"expanded",void 0),Me([t.Property(!0)],i.prototype,"visible",void 0),Me([t.Property(!1)],i.prototype,"disabled",void 0),Me([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),$e=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},s}return Te(i,e),i.prototype.destroy=function(){var i=this;(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var s=this.element;if(e.prototype.destroy.call(this),this.unwireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(s.children).forEach(function(e){s.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)s.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}s.classList.remove(He),s.removeAttribute("style"),["aria-disabled","aria-multiselectable","role","data-ripple"].forEach(function(e){i.element.removeAttribute(e)}),!this.isNested&&t.isRippleEnabled&&this.removeRippleEffect()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+qe);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Ue)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(He),this.enableRtl&&this.add(this.element,"e-rtl")},i.prototype.add=function(e,t){e.classList.add(t)},i.prototype.remove=function(e,t){e.classList.remove(t)},i.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){var e=t.formatUnit(this.width),i=t.formatUnit(this.height);t.setStyleAttribute(this.element,{width:e,height:i});t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),t.attributes(this.element,{"aria-disabled":"false",role:"presentation","aria-multiselectable":"true"}),"Single"===this.expandMode&&this.element.setAttribute("aria-multiselectable","false")},i.prototype.renderControl=function(){this.trgtEle=this.element.children.length>0?t.select("div",this.element):null,this.renderItems(),this.initItemExpand()},i.prototype.wireFocusEvents=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll("."+Re));e<i.length;e++){var s=i[e],n=s.querySelector("."+Be);s.childElementCount>0&&n&&(t.EventHandler.clearEvents(n),t.EventHandler.add(n,"focus",this.focusIn,this),t.EventHandler.add(n,"blur",this.focusOut,this))}},i.prototype.unwireEvents=function(){t.EventHandler.remove(this.element,"click",this.clickHandler),t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=t.rippleEffect(this.element,{selector:"."+Be})),this.isNested||(this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},i.prototype.templateParser=function(e){if(e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},i.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},i.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},i.prototype.getItemTemplate=function(){return this.itemTemplateFn},i.prototype.focusIn=function(e){e.target.parentElement.classList.add("e-item-focus")},i.prototype.focusOut=function(e){e.target.parentElement.classList.remove("e-item-focus")},i.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e,i=t.select("."+Ge,this.element);e=i?i.children:this.element.children;var s=[];[].slice.call(e).forEach(function(e){s.push({header:e.childElementCount>0&&e.children[0]?e.children[0]:"",content:e.childElementCount>1&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),i&&this.element.removeChild(i),this.setProperties({items:s},!0)},i.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:We}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},i.prototype.initItemExpand=function(){var e=this.initExpand.length;if(0!==e){if("Single"===this.expandMode)this.expandItem(!0,this.initExpand[e-1]);else for(var t=0;t<e;t++)this.expandItem(!0,this.initExpand[t]);this.isReact&&this.renderReactTemplates()}},i.prototype.renderItems=function(){var e,i,s=this,n=this.element;if(t.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),this.dataSource.length>0)this.dataSource.forEach(function(e,l){i=s.renderInnerItem(e,l),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+Be),"blur",s.focusOut,s))});else{var l=this.items;n&&l.length>0&&l.forEach(function(i,l){e=s.renderInnerItem(i,l),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+Be),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=e.target,n=this.getItems(),l={};if(t.closest(s,"."+Ue)===this.element){s.classList.add("e-target");var r=t.closest(s,"."+Re),o=t.closest(s,"."+Be),a=t.closest(s,"."+qe);r&&(t.isNullOrUndefined(o)||t.isNullOrUndefined(a))&&(o=r.children[0],a=r.children[1]),o&&(i=t.select("."+We,o));var d;o?d=t.closest(o,"."+Re):a&&(d=t.closest(a,"."+Re));var h=this.getIndexByItem(r);d&&(l.item=n[this.getIndexByItem(d)]),l.originalEvent=e;!(!t.isNullOrUndefined(i)&&r.childElementCount<=1)||!t.isNullOrUndefined(a)&&t.isNullOrUndefined(t.select("."+Be+" ."+We,d))?this.afterContentRender(s,l,r,o,a,d):(r.appendChild(this.contentRendering(h)),this.ariaAttrUpdate(r),this.afterContentRender(s,l,r,o,a,d)),this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,l,r){var o=this,a=[];this.trigger("clicked",i);var d=l&&!t.isNullOrUndefined(t.select(".e-target",l)),h=l&&!t.isNullOrUndefined(t.select("."+Ue,l))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=l&&t.isNullOrUndefined(t.select("."+Ue,l))||!(t.closest(e,"."+Ue)===this.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(qe)||e.classList.contains(Fe)||d)){var p=this.element.querySelector("."+Ge),u=p?p.children:this.element.children;[].slice.call(u).forEach(function(e){e.classList.contains(ze)&&a.push(e)});var f=[].slice.call(this.element.querySelectorAll("."+Re+" [e-animate]"));if(f.length>0)for(var m=0,v=f;m<v.length;m++){var g=v[m];a.push(g.parentElement)}var y=-1!==a.indexOf(r)&&"true"===l.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+qe,s),x=t.closest(s,"."+He).querySelector("."+Xe);if(t.isNullOrUndefined(C))return;b=x===s,!t.isVisible(C)||y&&!r.classList.contains(_e)?(a.length>0&&"Single"===this.expandMode&&!y&&a.forEach(function(e){o.collapse(t.select("."+qe,e)),e.classList.remove(Xe)}),this.expand(C)):this.collapse(C),t.isNullOrUndefined(x)||b||x.classList.remove(Xe)}}},i.prototype.eleMoveFocus=function(e,i,s){var n,l=t.closest(s,"."+Re);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+Be):s.classList.contains(Be)&&(l="moveUp"===e?l.previousElementSibling:l.nextElementSibling)&&(n=t.select("."+Be,l)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,Be);if(!t.isNullOrUndefined(s)||i.classList.contains(Ue)||i.classList.contains(Be)){var n,l=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,l,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(qe)?"true"!==n.getAttribute("e-animate")&&i.click():i.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?l.firstElementChild.children[0]:l.lastElementChild.children[0]).focus(),e.preventDefault()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Be,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"heading","aria-label":"collapsed","aria-disabled":"false","aria-level":this.getItems().length.toString()};return t.attributes(e,i),e},i.prototype.renderInnerItem=function(e,i){var s=this.createElement("div",{className:Re,id:e.id||t.getUniqueID("acrdn_item"),attrs:{"aria-expanded":"false",role:"row"}});if(this.headerTemplate){var n=this.headerEleGenerate(),l=this.createElement("div",{className:je});return n.appendChild(l),t.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),l),s.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(s,"e-select"),s}if(e.header&&this.angularnativeCondiCheck(e,"header")){this.enableHtmlSanitizer&&"string"==typeof e.header&&(e.header=t.SanitizeHtmlHelper.sanitize(e.header));n=this.headerEleGenerate(),l=this.createElement("div",{className:je});n.appendChild(l),n.appendChild(this.fetchElement(l,e.header,i,!0)),s.appendChild(n)}var r=t.select("."+Be,s);if(!e.expanded||t.isNullOrUndefined(i)||this.enablePersistence||-1===this.initExpand.indexOf(i)&&this.initExpand.push(i),e.cssClass&&t.addClass([s],e.cssClass.split(" ")),e.disabled&&t.addClass([s],Ke),!1===e.visible&&t.addClass([s],"e-hide"),e.iconCss){var o=this.createElement("div",{className:"e-acrdn-header-icon"}),a=this.createElement("span",{className:e.iconCss+" e-icons"});o.appendChild(a),t.isNullOrUndefined(r)?((r=this.headerEleGenerate()).appendChild(o),s.appendChild(r)):r.insertBefore(o,r.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var d=this.toggleIconGenerate();t.isNullOrUndefined(r)&&(r=this.headerEleGenerate(),s.appendChild(r)),r.appendChild(d),this.add(s,"e-select")}return s},i.prototype.angularnativeCondiCheck=function(e,i){var s="content"===i?e.content:e.header;if(this.isAngular&&!t.isNullOrUndefined(s.elementRef)){var n=s.elementRef.nativeElement.data;if(t.isNullOrUndefined(n)||""===n||-1===n.indexOf("bindings="))return!0;var l=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(l)&&"false"===l["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s,n){var l,r;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);r=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}else l=t.compile(i)}catch(s){"string"==typeof i?e.innerHTML=t.SanitizeHtmlHelper.sanitize(i):!t.isNullOrUndefined(this.trgtEle)&&i instanceof HTMLElement?(e.appendChild(i),e.firstElementChild.style.display=""):l=t.compile(i)}var a;if(!t.isNullOrUndefined(l)){this.isReact&&this.renderReactTemplates();var d=void 0,h=void 0;e.classList.contains(je)?(d=this.element.id+s+"_header",h="header"):e.classList.contains(Fe)&&(d=this.element.id+s+"_content",h="content"),a=l({},this,h,d,this.isStringTemplate)}return t.isNullOrUndefined(a)||!(a.length>0)||t.isNullOrUndefined(a[0].tagName)&&1===a.length?0===e.childElementCount&&(e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):[].slice.call(a).forEach(function(i){t.isNullOrUndefined(i.tagName)||(i.style.display=""),e.appendChild(i)}),t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+Be,e),s=t.select("."+qe,e);i.setAttribute("aria-controls",s.id),s.setAttribute("aria-labelledby",i.id),s.setAttribute("role","definition")},i.prototype.contentRendering=function(e){var i=this.createElement("div",{className:qe+" "+Ve,id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:Fe});return this.dataSource.length>0?(this.isReact&&this.renderReactTemplates(),t.append(this.getItemTemplate()(this.dataSource[e],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(this.enableHtmlSanitizer&&(this.items[e].content,1)&&(this.items[e].content=t.SanitizeHtmlHelper.sanitize(this.items[e].content)),i.appendChild(this.fetchElement(s,this.items[e].content,e,!1))),i},i.prototype.expand=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+Re);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains(Ke))){var l=t.closest(n,"."+He).querySelector("."+Xe),r={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=t.select("."+We,n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+qe),isExpanded:!0};this.trigger("expanding",a,function(s){s.cancel||(o.classList.add(Ye),i.expandedItemsPush(n),t.isNullOrUndefined(l)||l.classList.remove(Xe),n.classList.add(Xe),"None"===r.name?(i.expandProgress("begin",o,e,n,s),i.expandProgress("end",o,e,n,s)):i.expandAnimation(r.name,o,e,n,r,s))})}},i.prototype.expandAnimation=function(e,i,s,n,l,r){var o,a=this;this.lastActiveItemId=n.id,"SlideDown"===e?(l.begin=function(){a.expandProgress("begin",i,s,n,r),s.style.position="absolute",o=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},l.progress=function(){n.style.minHeight=o+s.offsetHeight+"px"},l.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,r)}):(l.begin=function(){a.expandProgress("begin",i,s,n,r)},l.end=function(){a.expandProgress("end",i,s,n,r)}),new t.Animation(l).animate(s)},i.prototype.expandProgress=function(e,i,s,n,l){this.remove(s,Ve),this.add(n,_e),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,ze),s.setAttribute("aria-hidden","false"),t.attributes(n,{"aria-expanded":"true"}),t.attributes(s.previousElementSibling,{"aria-label":"expanded"}),i.classList.remove(Ye),this.trigger("expanded",l))},i.prototype.expandedItemsPush=function(e){var t=this.getIndexByItem(e);if(-1===this.expandedIndices.indexOf(t)){var i=[].slice.call(this.expandedIndices);i.push(t),this.setProperties({expandedIndices:i},!0)}},i.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},i.prototype.getItemElements=function(){var e=[],t=this.element.children;return[].slice.call(t).forEach(function(t){t.classList.contains(Re)&&e.push(t)}),e},i.prototype.expandedItemsPop=function(e){var t=this.getIndexByItem(e),i=[].slice.call(this.expandedIndices);i.splice(i.indexOf(t),1),this.setProperties({expandedIndices:i},!0)},i.prototype.collapse=function(e){var i=this,s=this.getItems(),n=t.closest(e,"."+Re);if(!t.isNullOrUndefined(e)&&t.isVisible(e)&&!n.classList.contains(Ke)){var l={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},r=t.select("."+We,n).firstElementChild,o={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+qe),isExpanded:!1};this.trigger("expanding",o,function(t){t.cancel||(i.expandedItemsPop(n),n.classList.remove(Xe),r.classList.add(Ye),"None"===l.name?(i.collapseProgress("begin",r,e,n,t),i.collapseProgress("end",r,e,n,t)):i.collapseAnimation(l.name,e,n,r,l,t))})}},i.prototype.collapseAnimation=function(e,i,s,n,l,r){var o,a,d,h,c=this;this.lastActiveItemId=s.id,"SlideUp"===e?(l.begin=function(){d=s.offsetHeight,s.style.minHeight=d+"px",i.style.position="absolute",o=s.offsetHeight,a=i.offsetHeight,i.style.maxHeight=a+"px",c.collapseProgress("begin",n,i,s,r)},l.progress=function(){(h=o-(a-i.offsetHeight))<d&&(s.style.minHeight=h+"px")},l.end=function(){i.style.display="none",c.collapseProgress("end",n,i,s,r),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(l.begin=function(){c.collapseProgress("begin",n,i,s,r)},l.end=function(){c.collapseProgress("end",n,i,s,r)}),new t.Animation(l).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,l){this.remove(i,"e-expand-icon"),this.remove(n,_e),"end"===e&&(this.add(s,Ve),i.classList.remove(Ye),this.remove(n,ze),s.setAttribute("aria-hidden","true"),t.attributes(n,{"aria-expanded":"false"}),t.attributes(s.previousElementSibling,{"aria-label":"collapsed"}),this.trigger("expanded",l))},i.prototype.getModuleName=function(){return"accordion"},i.prototype.itemAttribUpdate=function(){var e=this.getItems(),i=this.getItemElements(),s=e.length;i.forEach(function(e){t.select("."+Be,e).setAttribute("aria-level",""+s)})},i.prototype.getItems=function(){return this.itemTemplate&&this.headerTemplate?this.dataSource:this.items},i.prototype.addItem=function(e,i){var s=this,n=this.element,l=this.getItemElements(),r=this.getItems();if(t.isNullOrUndefined(i)&&(i=r.length),n.childElementCount>=i){(e instanceof Array?e:[e]).forEach(function(e,o){var a=i+o;r.splice(a,0,e);var d=s.renderInnerItem(e,a);n.childElementCount===a?n.appendChild(d):n.insertBefore(d,l[a]),t.EventHandler.add(d.querySelector("."+Be),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+Be),"blur",s.focusOut,s),s.itemAttribUpdate(),s.expandedIndices=[],s.expandedItemRefresh(n),e&&e.expanded&&s.expandItem(!0,a)})}this.isReact&&this.renderReactTemplates()},i.prototype.expandedItemRefresh=function(e){var t=this,i=this.getItemElements();[].slice.call(i).forEach(function(e){e.classList.contains(_e)&&t.expandedItemsPush(e)})},i.prototype.removeItem=function(e){this.isReact&&this.clearTemplate(["headerTemplate","itemTemplate"],e);var i=this.getItemElements()[e],s=this.getItems();t.isNullOrUndefined(i)||(this.restoreContent(e),t.detach(i),s.splice(e,1),this.itemAttribUpdate(),this.expandedIndices=[],this.expandedItemRefresh(this.element))},i.prototype.select=function(e){var i=this.getItemElements()[e];t.isNullOrUndefined(i)||t.isNullOrUndefined(t.select("."+Be,i))||i.children[0].focus()},i.prototype.hideItem=function(e,i){var s=this.getItemElements()[e];t.isNullOrUndefined(s)||(t.isNullOrUndefined(i)&&(i=!0),i?this.add(s,"e-hide"):this.remove(s,"e-hide"))},i.prototype.enableItem=function(e,i){var s=this.getItemElements()[e];if(!t.isNullOrUndefined(s)){var n=s.firstElementChild;i?(this.remove(s,Ke),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains(ze)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,Ke),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){var l=n[n.length-1];this.itemExpand(e,l,this.getIndexByItem(l))}else{var r=t.select("#"+this.lastActiveItemId,this.element);[].slice.call(n).forEach(function(t){s.itemExpand(e,t,s.getIndexByItem(t)),t.classList.remove(Xe)});var o=t.select("."+Xe,this.element);o&&o.classList.remove(Xe),r&&r.classList.add(Xe)}else{l=n[i];if(t.isNullOrUndefined(l)||!l.classList.contains("e-select")||l.classList.contains(ze)&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,l,i)}},i.prototype.itemExpand=function(e,i,s){var n=i.children[1];i.classList.contains(Ke)||(t.isNullOrUndefined(n)&&e?(n=this.contentRendering(s),i.appendChild(n),this.ariaAttrUpdate(i),this.expand(n)):t.isNullOrUndefined(n)||(e?this.expand(n):this.collapse(n)),this.isReact&&this.renderReactTemplates())},i.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Re)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Re)[e],this.templateEle.forEach(function(e){t.isNullOrUndefined(i.querySelector(e))||(document.body.appendChild(i.querySelector(e)).style.display="none")})},i.prototype.updateItem=function(e,i){if(!t.isNullOrUndefined(e)){var s=this.getItems(),n=s[i];s.splice(i,1),this.restoreContent(i),t.detach(e),this.addItem(n,i)}},i.prototype.setTemplate=function(e,t,i){t.innerHTML="",this.templateCompile(t,e,i),this.isReact&&this.renderReactTemplates()},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.fetchElement(s,t,i,!1),0!==s.childNodes.length&&[].slice.call(s.childNodes).forEach(function(t){e.appendChild(t)})},i.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,l=0,r=Object.keys(e);l<r.length;l++){switch(r[l]){case"items":if(e.items instanceof Array&&i.items instanceof Array)n=!0;else for(var o=Object.keys(e.items),a=0;a<o.length;a++){var d=parseInt(Object.keys(e.items)[a],10),h=Object.keys(e.items[d])[0],c=t.selectAll("."+Re,this.element)[d],p=Object(i.items[d])[h],u=Object(e.items[d])[h];if(("header"===h||"iconCss"===h||"expanded"===h||"content"===h&&""===p)&&this.updateItem(c,d),"cssClass"!==h||t.isNullOrUndefined(c)||(c.classList.remove(p),c.classList.add(u)),"visible"!==h||t.isNullOrUndefined(c)||(!1===Object(e.items[d])[h]?c.classList.add("e-hide"):c.classList.remove("e-hide")),"disabled"!==h||t.isNullOrUndefined(c)||this.enableItem(d,!u),"content"===h&&!t.isNullOrUndefined(c)&&2===c.children.length)if("function"==typeof u){var f=c.querySelector("."+Fe);f.innerHTML="",this.setTemplate(u,f,d)}else c.classList.contains(_e)&&this.expandItem(!1,d),t.detach(c.querySelector("."+qe))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),n=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),n=!0;break;case"itemTemplate":this.initializeItemTemplate(),n=!0;break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl");break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)});break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode?(this.element.setAttribute("aria-multiselectable","false"),this.expandedIndices.length>1&&this.expandItem(!1)):this.element.setAttribute("aria-multiselectable","true")}}n&&(this.initExpand=[],this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},Me([t.Collection([],Ze)],i.prototype,"items",void 0),Me([t.Property([])],i.prototype,"dataSource",void 0),Me([t.Property()],i.prototype,"itemTemplate",void 0),Me([t.Property()],i.prototype,"headerTemplate",void 0),Me([t.Property("100%")],i.prototype,"width",void 0),Me([t.Property("auto")],i.prototype,"height",void 0),Me([t.Property([])],i.prototype,"expandedIndices",void 0),Me([t.Property("Multiple")],i.prototype,"expandMode",void 0),Me([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),Me([t.Complex({},Je)],i.prototype,"animation",void 0),Me([t.Event()],i.prototype,"clicked",void 0),Me([t.Event()],i.prototype,"expanding",void 0),Me([t.Event()],i.prototype,"expanded",void 0),Me([t.Event()],i.prototype,"created",void 0),Me([t.Event()],i.prototype,"destroyed",void 0),i=Me([t.NotifyPropertyChanges],i)}(t.Component),et=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),tt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},it=function(e){function i(t,i){return e.call(this,t,i)||this}return et(i,e),i.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||t.getUniqueID("ej2-contextmenu"),e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=s.getZindexPartial(this.element).toString()},i.prototype.open=function(t,i,s){e.prototype.openMenu.call(this,null,null,t,i,null,s)},i.prototype.close=function(){e.prototype.closeMenu.call(this)},i.prototype.onPropertyChanged=function(t,i){e.prototype.onPropertyChanged.call(this,t,i);for(var s=0,n=Object.keys(t);s<n.length;s++){switch(n[s]){case"filter":this.close(),this.filter=t.filter;break;case"target":this.unWireEvents(i.target),this.wireEvents()}}},i.prototype.getModuleName=function(){return"contextmenu"},tt([t.Property("")],i.prototype,"target",void 0),tt([t.Property("")],i.prototype,"filter",void 0),tt([t.Collection([],ee)],i.prototype,"items",void 0),i=tt([t.NotifyPropertyChanges],i)}(ie),st=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),nt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},lt="e-vertical",rt="e-hamburger",ot=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return st(i,e),i.prototype.getModuleName=function(){return"menu"},i.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||t.getUniqueID("ej2-menu"),this.template)try{document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}else this.updateMenuItems(this.items);e.prototype.preRender.call(this)},i.prototype.initialize=function(){e.prototype.initialize.call(this),t.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(lt),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(lt),this.element.setAttribute("aria-orientation","vertical")):t.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(rt),"Horizontal"===this.orientation&&this.element.classList.add("e-hide-menu"))},i.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},i.prototype.onPropertyChanged=function(i,s){for(var n=this,l=0,r=Object.keys(i);l<r.length;l++){switch(r[l]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(lt),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(lt),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(lt),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(lt),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(s.items).length||this.updateMenuItems(i.items);break;case"hamburgerMode":this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),i.hamburgerMode?(this.element.parentElement.classList.add(rt),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(rt),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(lt),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(lt):this.element.previousElementSibling.classList.remove(lt),this.element.classList[i.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(i.title=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.title):i.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=i.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(s.target),this.wireEvents(),"Horizontal"===this.orientation&&(i.target?this.element.previousElementSibling.classList.add(lt):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(lt)),this.element.classList.add("e-hide-menu")))}}e.prototype.onPropertyChanged.call(this,i,s)},i.prototype.createMenuItems=function(e){var t,i,s=this.items,n=this.getField("parentId");if(e[n]){for(t=this.getIndex(e[n].toString(),!0),i=0;i<t.length;i++)s[t[i]].items||(s[t[i]].items=[]),s=s[t[i]].items;s.push(e)}else this.items.push(e)},i.prototype.open=function(){e.prototype.openHamburgerMenu.call(this)},i.prototype.close=function(){e.prototype.closeHamburgerMenu.call(this)},nt([t.Property("Horizontal")],i.prototype,"orientation",void 0),nt([t.Property("")],i.prototype,"target",void 0),nt([t.Property(null)],i.prototype,"template",void 0),nt([t.Property(!1)],i.prototype,"enableScrolling",void 0),nt([t.Property(!1)],i.prototype,"hamburgerMode",void 0),nt([t.Property("Menu")],i.prototype,"title",void 0),nt([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),nt([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},$)],i.prototype,"fields",void 0),i=nt([t.NotifyPropertyChanges],i)}(ie),at=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),dt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},ht="e-tab-header",ct="e-content",pt="e-nested",ut="e-item",ft="e-template",mt="e-active",vt="e-disable",gt="e-hidden",yt="e-close-icon",bt="e-close-show",Ct="e-tab-text",xt="e-indicator",Et="e-tab-wrap",Nt="e-text-wrap",It="e-toolbar-items",St="e-toolbar-item",Ot="e-toolbar-popup",wt="e-progress",kt="e-vertical-tab",Lt="e-vertical",At="e-vertical-right",Pt="e-horizontal-bottom",Dt="e-fill-mode",Tt="e-reorder-active-item",Mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),dt([t.Property(600)],i.prototype,"duration",void 0),dt([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},Mt)],i.prototype,"previous",void 0),dt([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},Mt)],i.prototype,"next",void 0),i}(t.ChildProperty),Ut=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Property("")],i.prototype,"text",void 0),dt([t.Property("")],i.prototype,"iconCss",void 0),dt([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),Rt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return at(i,e),dt([t.Complex({},Ut)],i.prototype,"header",void 0),dt([t.Property(null)],i.prototype,"headerTemplate",void 0),dt([t.Property("")],i.prototype,"content",void 0),dt([t.Property("")],i.prototype,"cssClass",void 0),dt([t.Property(!1)],i.prototype,"disabled",void 0),dt([t.Property(!0)],i.prototype,"visible",void 0),dt([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),Bt=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.show={},s.hide={},s.maxHeight=0,s.title="Close",s.isInteracted=!1,s.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActiveTabBorder.bind(s),s.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},s}return at(i,e),i.prototype.destroy=function(){var i=this;if((this.isReact||this.isAngular)&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation","aria-owns"].forEach(function(e){i.element.removeAttribute(e)}),this.expTemplateContent(),this.isTemplate){var s=t.select(".e-tab > ."+ct,this.element);this.element.classList.remove(ft),t.isNullOrUndefined(s)||(s.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&this.draggableItems.length>0){for(var n=0;n<this.draggableItems.length;n++)this.draggableItems[n].destroy(),this.draggableItems[n]=null;this.draggableItems=[]}e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.preRender=function(){var e=t.closest(this.element,"."+ct);this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+ht:this.dragArea),t.isNullOrUndefined(e)||(e.parentElement.classList.add(pt),this.isNested=!0);var i=t.Browser.info.name,s="msie"===i?"e-ie":"edge"===i?"e-edge":"safari"===i?"e-safari":"";t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),t.attributes(this.element,{role:"tablist","aria-disabled":"false","aria-activedescendant":"","aria-owns":this.element.id+"_tab_header_items"}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){this.btnCls=this.createElement("span",{className:"e-icons "+yt,attrs:{title:this.title}}),this.tabId=this.element.id.length>0?"-"+this.element.id:t.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1},i.prototype.renderContainer=function(){var e=this.element;if(this.items.forEach(function(e,i){t.isNullOrUndefined(e.id)&&!t.isNullOrUndefined(e.setProperties)&&e.setProperties({id:"tabitem_"+i.toString()},!0)}),this.items.length>0&&0===e.children.length)e.appendChild(this.createElement("div",{className:ct})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:ht})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add(ft);var i=e.querySelector("."+ht);i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select("."+ht,this.element))&&!t.isNullOrUndefined(t.select("."+ct,this.element))){if(this.renderHeader(),this.tbItems=t.select("."+ht+" ."+It,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+St,this.element).length>0){this.tbItems=t.select("."+ht+" ."+It,this.element),this.bdrLine=this.createElement("div",{className:xt+" "+gt+" e-ignore"});var s=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(s)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):s.insertBefore(this.bdrLine,s.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)}if(!t.isNullOrUndefined(this.tbItem))for(var n=0;n<this.items.length;n++)if(this.items[n]){var l=this.items[n].id;this.tbItem[n].setAttribute("data-id",l)}this.setRTL(this.enableRtl)}},i.prototype.renderHeader=function(){var e=this,i=this.headerPlacement,s=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){this.element.children.length>1&&this.element.children[1].classList.contains(ht)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,l=[],r=0;r<n;r++)l.push(this.hdrEle.children.item(r).innerHTML);if(n>0){for(;this.hdrEle.firstElementChild;)t.detach(this.hdrEle.firstElementChild);var o=this.createElement("div",{className:"e-items"});this.hdrEle.appendChild(o),l.forEach(function(i,s){e.lastIndex=s;var n={className:ut,id:ut+e.tabId+"_"+s,attrs:{role:"tab","aria-controls":ct+e.tabId+"_"+s,"aria-selected":"false"}},l=e.createElement("span",{className:Ct,innerHTML:i,attrs:{role:"presentation"}}).outerHTML,r=e.createElement("div",{className:Nt,innerHTML:l+e.btnCls.outerHTML}).outerHTML,a=e.createElement("div",{className:Et,innerHTML:r,attrs:{tabIndex:"-1"}});o.appendChild(e.createElement("div",n)),t.selectAll(".e-item",o)[s].appendChild(a)})}}else s=this.parseObject(this.items,0);this.tbObj=new De({width:"Left"===i||"Right"===i?"auto":"100%",height:"Left"===i||"Right"===i?"100%":"auto",overflowMode:this.overflowMode,items:0!==s.length?s:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),t.attributes(this.hdrEle,{"aria-label":"tab-header"}),this.updateOrientationAttribute(),this.setCloseButton(this.showCloseButton);var a=this.tbObj.element.querySelector("."+It);t.isNullOrUndefined(a)||((t.isNullOrUndefined(a.id)||""===a.id)&&(a.id=this.element.id+"_tab_header_items"),this.element.setAttribute("aria-owns",a.id))},i.prototype.renderContent=function(){this.cntEle=t.select("."+ct,this.element);var e=t.selectAll("."+St,this.element);if(this.isTemplate){this.cnt=this.cntEle.children.length>0?this.cntEle.innerHTML:"";for(var i=this.cntEle.children,s=0;s<e.length;s++)i.length-1>=s&&(t.addClass([i.item(s)],ut),t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":ut+this.tabId+"_"+s}),i.item(s).id=ct+this.tabId+"_"+s)}},i.prototype.reRenderItems=function(){this.renderContainer(),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},i.prototype.parseObject=function(e,i){var s=this,n=t.selectAll(".e-tab-header ."+St,this.element),l=this.lastIndex;if(!this.isReplace&&n.length>0){var r=[];n.forEach(function(e){r.push(parseInt(e.id.slice(e.id.indexOf("_")+1),10))}),l=Math.max.apply(Math,r)}var o,a=[],d=[];return e.forEach(function(e,r){var h=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,c=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;if(t.isNullOrUndefined(e.headerTemplate)&&(t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===c))d.push(r);else{var p=e.headerTemplate||e.header.text;"string"==typeof p&&s.enableHtmlSanitizer&&(p=t.SanitizeHtmlHelper.sanitize(p));var u;if(s.isReplace&&!t.isNullOrUndefined(s.tbId)&&""!==s.tbId){var f=s.tbId.indexOf("_");u=parseInt(s.tbId.substring(f+1),10),s.tbId=""}else u=i+r;s.lastIndex=0===n.length?r:s.isReplace?u:l+1+r;var m=e.disabled?" e-disable e-overlay":"",v=!1===e.visible?" "+gt:"";o=s.createElement("div",{className:Ct,attrs:{role:"presentation"}});var g=p instanceof Object?p.outerHTML:p,y=!t.isNullOrUndefined(g)&&""!==g;t.isNullOrUndefined(p.tagName)?s.headerTextCompile(o,p,r):o.appendChild(p);var b=s.createElement("span",{className:"e-icons e-tab-icon e-icon-"+h+" "+c}),C=s.createElement("div",{className:Nt});C.appendChild(o),""!==p&&void 0!==p&&""!==c?("left"===h||"top"===h?C.insertBefore(b,C.firstElementChild):C.appendChild(b),o,s.isIconAlone=!1):(""===c?o:b)===b&&(t.detach(o),C.appendChild(b),s.isIconAlone=!0);var x=e.disabled?{}:{tabIndex:"-1"};C.appendChild(s.btnCls.cloneNode(!0));var E=s.createElement("div",{className:Et,attrs:x});E.appendChild(C),s.itemIndexArray===[]?s.itemIndexArray.push(ut+s.tabId+"_"+s.lastIndex):s.itemIndexArray.splice(i+r,0,ut+s.tabId+"_"+s.lastIndex);var N={htmlAttributes:{id:ut+s.tabId+"_"+s.lastIndex,role:"tab","aria-selected":"false"},template:E};N.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+m+" "+v+" "+(""!==c?"e-i"+h:"")+" "+(y?"":"e-icon"),"top"!==h&&"bottom"!==h||s.element.classList.add("e-vertical-icon"),a.push(N),r++}}),this.isAdd||d.forEach(function(e){s.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),a},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll("."+St+"."+mt,e);[].slice.call(i).forEach(function(e){return e.classList.remove(mt)})}},i.prototype.checkPopupOverflow=function(e){this.tbPop=t.select(".e-toolbar-pop",this.element);var i=t.select(".e-hor-nav",this.element),s=t.select("."+It,this.element),n=s.lastChild,l=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?l=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(l=!0),l&&(e.classList.add(Ot),this.tbPop.insertBefore(e,t.selectAll("."+Ot,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+Et).classList.remove("e-ripple")),this.tbItem=t.selectAll("."+It+" ."+St,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(Ot),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(s)){var n=this.tbItems.lastChild.previousElementSibling;this.checkPopupOverflow(n)}this.isPopup=!0}return t.selectAll("."+St,this.tbItems).length-1},i.prototype.updateOrientationAttribute=function(){t.attributes(this.element,{"aria-orientation":this.isVertical()?"vertical":"horizontal"})},i.prototype.setCloseButton=function(e){var i=t.select("."+ht,this.element);!0===e?i.classList.add(bt):i.classList.remove(bt),this.tbObj.refreshOverflow(),this.refreshActiveTabBorder()},i.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains("e-rtl");return this.isPopup||e<=t?"SlideLeftIn"===this.animation.previous.effect?{name:"SlideLeftOut",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:null:"SlideRightIn"===this.animation.next.effect?{name:"SlideRightOut",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}:null},i.prototype.triggerPrevAnimation=function(e,i){var s=this,n=this.prevCtnAnimation(i,this.selectedItem);t.isNullOrUndefined(n)?e.classList.remove(mt):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add(wt),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove(mt),e.classList.remove(wt),e.classList.remove("e-view"),t.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||s.isTemplate||t.detach(e)},new t.Animation(n).animate(e))},i.prototype.triggerAnimation=function(e,i){var s,n=this,l=this.prevIndex;[].slice.call(this.element.querySelector("."+ct).children).forEach(function(e){e.id===n.prevActiveEle&&(s=e)});var r=this.tbItem[l],o=this.getTrgContent(this.cntEle,this.extIndex(e));if(t.isNullOrUndefined(s)&&!t.isNullOrUndefined(r)){var a=this.extIndex(r.id);s=this.getTrgContent(this.cntEle,a)}if(t.isNullOrUndefined(o)||(this.prevActiveEle=o.id),this.initRender||!1===i||this.animation==={}||t.isNullOrUndefined(this.animation))s&&s!==o&&s.classList.remove(mt);else{var d,h=t.select("."+ct,this.element);if(this.prevIndex>this.selectedItem&&!this.isPopup){var c=this.animation.previous.effect;d={name:"None"===c?"":"SlideLeftIn"!==c?c:"SlideLeftIn",duration:this.animation.previous.duration,timingFunction:this.animation.previous.easing}}else if(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem){var p=this.animation.next.effect;d={name:"None"===p?"":"SlideRightIn"!==p?p:"SlideRightIn",duration:this.animation.next.duration,timingFunction:this.animation.next.easing}}d.progress=function(){h.classList.add(wt),n.setActiveBorder()},d.end=function(){h.classList.remove(wt),o.classList.add(mt)},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,l),this.isPopup=!1,""===d.name?o.classList.add(mt):new t.Animation(d).animate(o)}},i.prototype.keyPressed=function(e){var i=t.closest(e,"."+ht+" ."+St),s=this.getEleIndex(i);!t.isNullOrUndefined(this.popEle)&&e.classList.contains("e-hor-nav")?this.popEle.classList.contains("e-popup-open")?this.popObj.hide(this.hide):this.popObj.show(this.show):e.classList.contains("e-scroll-nav")?e.click():t.isNullOrUndefined(i)||!1!==i.classList.contains(mt)||(this.selectTab(s,null,!0),t.isNullOrUndefined(this.popEle)||this.popObj.hide(this.hide))},i.prototype.getTabHeader=function(){if(!t.isNullOrUndefined(this.element)){var e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(ht)});if(e.length>0)return e[0];var i=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0];if(i)return[].slice.call(i.children).filter(function(e){return e.classList.contains(ht)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+St,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace(ut+this.tabId+"_","")},i.prototype.expTemplateContent=function(){var e=this;this.templateEle.forEach(function(i){t.isNullOrUndefined(e.element.querySelector(i))||(document.body.appendChild(e.element.querySelector(i)).style.display="none")})},i.prototype.templateCompile=function(e,t,i){var s=this.createElement("div");this.compileElement(s,t,"content",i),0!==s.childNodes.length&&e.appendChild(s),this.isReact&&this.renderReactTemplates()},i.prototype.compileElement=function(e,i,s,n){var l;"string"==typeof i?(i=i.trim(),this.isVue?l=t.compile(t.SanitizeHtmlHelper.sanitize(i)):e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):l=t.compile(i);var r;t.isNullOrUndefined(l)||(r=l({},this,s)),!t.isNullOrUndefined(l)&&r.length>0&&[].slice.call(r).forEach(function(t){e.appendChild(t)})},i.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},i.prototype.getContent=function(e,i,s,n){var l;if("string"==typeof(i=t.isNullOrUndefined(i)?"":i)||t.isNullOrUndefined(i.innerHTML))if("string"==typeof i&&this.enableHtmlSanitizer&&(i=t.SanitizeHtmlHelper.sanitize(i)),"."===i[0]||"#"===i[0])if(document.querySelectorAll(i).length){var r=document.querySelector(i);l=r.outerHTML.trim(),"clone"===s?e.appendChild(r.cloneNode(!0)):(e.appendChild(r),r.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(l)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains(pt)?t.select(".e-nested> .e-content > #"+ct+this.tabId+"_"+i,this.element):this.findEle(e.children,ct+this.tabId+"_"+i)},i.prototype.findEle=function(e,t){for(var i,s=0;s<e.length;s++)if(e[s].id===t){i=e[s];break}return i},i.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},i.prototype.addVerticalClass=function(){if(this.isVertical()){var e="Left"===this.headerPlacement?"e-vertical-left":At;t.addClass([this.hdrEle],[Lt,e]),this.element.classList.contains(pt)?t.addClass([this.hdrEle],[kt,e]):t.addClass([this.element],[kt,e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],[Pt])},i.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},i.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var i=this.hdrEle.querySelector("."+mt),s=!!this.hdrEle.classList.contains(Lt);t.removeClass([this.element],[kt]),t.removeClass([this.hdrEle],[Lt,"e-vertical-left",At]),s!==this.isVertical()&&(this.changeToolbarOrientation(),!t.isNullOrUndefined(i)&&i.classList.contains(Ot)&&this.popupHandler(i)),this.addVerticalClass(),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},i.prototype.focusItem=function(){var e=t.select(" #e-item"+this.tabId+"_"+this.selectedItem,this.hdrEle);t.isNullOrUndefined(e)||e.firstElementChild.focus()},i.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},i.prototype.setOrientation=function(e,i){var s=Array.prototype.indexOf.call(this.element.children,i),n=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+ct));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],[Pt]),this.element.insertBefore(i,t.select("."+ct,this.element)))},i.prototype.setCssClass=function(e,t,i){if(""!==t)for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},i.prototype.setContentHeight=function(e){if(this.element.classList.contains(Dt)&&t.removeClass([this.element],[Dt]),!t.isNullOrUndefined(this.cntEle)){var i=this.getTabHeader();if("None"===this.heightAdjustMode){if("auto"===this.height)return;this.isVertical()||t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"})}else if("Fill"===this.heightAdjustMode)t.addClass([this.element],[Dt]),t.setStyleAttribute(this.element,{height:"100%"}),t.setStyleAttribute(this.cntEle,{height:this.element.offsetHeight-i.offsetHeight+"px"});else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var s=t.selectAll(".e-content > .e-item",this.element),n=0;n<s.length;n++)s[n].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(s[n])),s[n].style.removeProperty("display"),s[n].style.removeProperty("visibility");else{this.cntEle=t.select("."+ct,this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:ct+this.tabId+"_0",className:"e-item "+mt,attrs:{role:"tabpanel","aria-labelledby":ut+this.tabId+"_0"}}));var l=this.cntEle.children.item(0);for(n=0;n<this.items.length;n++)for(this.getContent(l,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(l));l.firstChild;)l.removeChild(l.firstChild);this.isReact&&this.clearTemplate(["content"]),this.templateEle=[],this.getContent(l,this.items[0].content,"render",0),this.prevIndex!==this.selectedItem&&l.classList.remove(mt)}t.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else t.setStyleAttribute(this.cntEle,{height:"auto"})}},i.prototype.getHeight=function(e){var t=window.getComputedStyle(e);return e.offsetHeight+parseFloat(t.getPropertyValue("padding-top"))+parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("margin-top"))+parseFloat(t.getPropertyValue("margin-bottom"))},i.prototype.setActiveBorder=function(){var e=this.getTabHeader(),i=t.select("."+St+"."+mt,e);if(!t.isNullOrUndefined(i)){this.reorderActiveTab?e&&e.classList.remove(Tt):(i.classList.contains(Ot)&&!this.bdrLine.classList.contains(gt)&&this.bdrLine.classList.add(gt),e&&!e.classList.contains(Tt)&&e.classList.add(Tt));var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+It,e);var n=t.select("."+xt,e),l=t.select("."+It+" ."+this.scrCntClass,e);if(this.isVertical()){t.setStyleAttribute(n,{left:"",right:""});0!==(t.isNullOrUndefined(l)?this.tbItems.offsetHeight:l.offsetHeight)?t.setStyleAttribute(n,{top:i.offsetTop+"px",height:i.offsetHeight+"px"}):t.setStyleAttribute(n,{top:0,height:0})}else{if("MultiRow"===this.overflowMode){var r="Bottom"===this.headerPlacement?i.offsetTop:i.offsetHeight+i.offsetTop;t.setStyleAttribute(n,{top:r+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var o=t.isNullOrUndefined(l)?this.tbItems.offsetWidth:l.offsetWidth;0!==o?t.setStyleAttribute(n,{left:i.offsetLeft+"px",right:o-(i.offsetLeft+i.offsetWidth)+"px"}):t.setStyleAttribute(n,{left:"auto",right:"auto"})}t.isNullOrUndefined(this.bdrLine)||i.classList.contains(Ot)||this.bdrLine.classList.remove(gt)}}},i.prototype.setActive=function(e,i,s){void 0===i&&(i=!1),void 0===s&&(s=!1),this.tbItem=t.selectAll("."+St,this.getTabHeader());var n=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length))if(e>=0&&!i&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),n.classList.contains(mt))this.setActiveBorder();else{if(!this.isTemplate){var l=this.tbItem[this.prevIndex];t.isNullOrUndefined(l)||l.removeAttribute("aria-controls"),t.attributes(n,{"aria-controls":ct+this.tabId+"_"+e})}var r=n.id;this.removeActiveClass(),n.classList.add(mt),this.tbItem[this.prevIndex].setAttribute("aria-selected","false"),n.setAttribute("aria-selected","true");var o=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=ct+this.tabId+"_"+o),t.attributes(this.element,{"aria-activedescendant":r}),this.isTemplate){if(t.select("."+ct,this.element).children.length>0){var a=this.findEle(t.select("."+ct,this.element).children,ct+this.tabId+"_"+o);t.isNullOrUndefined(a)||a.classList.add(mt),this.triggerAnimation(r,this.enableAnimation)}}else{this.cntEle=t.select(".e-tab > ."+ct,this.element);var d=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(d)){this.cntEle.appendChild(this.createElement("div",{id:ct+this.tabId+"_"+this.extIndex(r),className:"e-item "+mt,attrs:{role:"tabpanel","aria-labelledby":ut+this.tabId+"_"+this.extIndex(r)}}));var h=this.getTrgContent(this.cntEle,this.extIndex(r)),c=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(h,this.items[c].content,"render",c)}else d.classList.add(mt);this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(n),!this.initRender&&!i){n.firstElementChild.focus();var p={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:n,selectedIndex:e,selectedContent:t.select("#"+ct+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:s};this.trigger("selected",p)}}},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+It,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},i.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,"e-rtl",e),this.refreshActiveBorder()},i.prototype.refreshActiveBorder=function(){t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(gt),this.setActiveBorder()},i.prototype.showPopup=function(e){var i=t.select(".e-popup.e-toolbar-pop",this.hdrEle);if(i.classList.contains("e-popup-close")){var s=i&&i.ej2_instances[0];s.position.X="Left"===this.headerPlacement?"left":"right",s.dataBind(),s.show(e)}},i.prototype.bindDraggable=function(){var e=this;if(this.allowDragAndDrop){var t=this.element.querySelector("."+ht);if(t){t.querySelectorAll("."+St).forEach(function(t){e.initializeDrag(t)})}}},i.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),t.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),t.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},i.prototype.unWireEvents=function(){t.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),t.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),t.isNullOrUndefined(this.cntEle)||t.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),t.EventHandler.remove(this.element,"mouseover",this.hoverHandler),t.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove("e-rtl"),this.element.classList.remove("e-focused")},i.prototype.clickHandler=function(e){this.element.classList.remove("e-focused");var i=e.originalEvent.target,s=t.closest(i,"."+St),n=this.getEleIndex(s);i.classList.contains(yt)?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,t.isNullOrUndefined(s)||n===this.selectedItem&&n===this.prevIndex||this.selectTab(n,e.originalEvent,!0))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches))){this.isNested&&this.element.setAttribute("data-swipe","true");var i=this.element.querySelector('[data-swipe="true"]');if(i)i.removeAttribute("data-swipe");else{if(this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var s=this.selectedItem-1;s>=0;s--)if(!this.tbItem[s].classList.contains(gt)){this.selectTab(s,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+St,this.element).length-1)for(var n=this.selectedItem+1;n<this.tbItem.length;n++)if(!this.tbItem[n].classList.contains(gt)){this.selectTab(n,null,!0);break}this.isSwipeed=!1}}},i.prototype.spaceKeyDown=function(e){if(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which){var i=t.closest(e.target,"."+ht);t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains(vt)){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select("."+mt,s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var l=t.closest(document.activeElement,"."+St),r=t.closest(i,"."+St);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains(vt))return;if("enter"===e.action&&i.classList.contains("e-hor-nav")){this.showPopup(this.show);break}this.keyPressed(i);break;case"tab":case"shiftTab":i.classList.contains(Et)&&!1===t.closest(i,"."+St).classList.contains(mt)&&i.setAttribute("tabindex","-1"),this.popObj&&t.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":t.isNullOrUndefined(l)||this.refreshItemVisibility(l);break;case"openPopup":e.preventDefault(),!t.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":if(!0===this.showCloseButton&&!t.isNullOrUndefined(r)){var o=r.nextSibling;!t.isNullOrUndefined(o)&&o.classList.contains(St)&&o.firstElementChild.focus(),this.removeTab(this.getEleIndex(r))}this.setActiveBorder()}}},i.prototype.refreshActiveTabBorder=function(){var e=t.select("."+St+"."+Ot+"."+mt,this.element);!t.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},i.prototype.refreshItemVisibility=function(e){var i=t.select("."+this.scrCntClass,this.tbItems);if(!this.isVertical()&&!t.isNullOrUndefined(i)){var s=t.select(".e-hscroll-bar",this.tbItems),n=s.scrollLeft,l=n+s.offsetWidth,r=e.offsetLeft,o=e.offsetWidth,a=e.offsetLeft+e.offsetWidth;if(n<r&&l<a){var d=l-r;s.scrollLeft=n+(o-d)}else if(n>r&&l>a){d=a-n;s.scrollLeft=n-(o-d)}}},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains(yt)&&i.setAttribute("title",new t.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},i.prototype.evalOnPropertyChangeItems=function(e,i){if(e.items instanceof Array&&i.items instanceof Array)if(this.lastIndex=0,t.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var s=t.select(".e-tab > ."+ct,this.element);s.firstElementChild;)t.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else for(var n=Object.keys(e.items),l=0;l<n.length;l++)for(var r=parseInt(Object.keys(e.items)[l],10),o=Object.keys(e.items[r]),a=0;a<o.length;a++){var d=Object(i.items[r])[o[a]],h=Object(e.items[r])[o[a]],c=this.element.querySelectorAll("."+St)[r],p=void 0;if(c&&!t.isNullOrUndefined(c.id)&&""!==c.id){var u=c.id.lastIndexOf("_");p=parseInt(c.id.substring(u+1),10)}else p=r;var f=t.select("."+It+" #"+ut+this.tabId+"_"+p,this.element),m=t.select(".e-content #"+ct+this.tabId+"_"+p,this.element);if("header"===o[a]||"headerTemplate"===o[a]){var v=t.isNullOrUndefined(this.items[r].header)||t.isNullOrUndefined(this.items[r].header.iconCss)?"":this.items[r].header.iconCss;if(""===(this.items[r].headerTemplate||this.items[r].header.text)&&""===v)this.removeTab(r);else{this.tbId=c.id;var g=[];g.push(this.items[r]),this.items.splice(r,1),this.itemIndexArray.splice(r,1),this.tbObj.items.splice(r,1);var y=f.classList.contains(gt);t.detach(f),this.isReplace=!0,this.addTab(g,r),y&&this.hideTab(r),this.isReplace=!1}}if("content"===o[a]&&!t.isNullOrUndefined(m)){if(("string"==typeof h||t.isNullOrUndefined(h.innerHTML))&&("."===h[0]||"#"===h[0])&&h.length){var b=document.querySelector(h);m.appendChild(b),b.style.display=""}else""===h&&"#"===d[0]?(document.body.appendChild(this.element.querySelector(d)).style.display="none",m.innerHTML=h):this.isReact?(m.innerHTML="",this.templateCompile(m,h,r)):"function"!=typeof h&&(m.innerHTML=h)}"cssClass"===o[a]&&(t.isNullOrUndefined(f)||(f.classList.remove(d),f.classList.add(h)),t.isNullOrUndefined(m)||(m.classList.remove(d),m.classList.add(h))),"disabled"===o[a]&&this.enableTab(r,!0!==h),"visible"===o[a]&&this.hideTab(r,!0!==h)}},i.prototype.initializeDrag=function(e){var i=this,s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+St,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,l=i.getEleIndex(i.dragItem),r={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+St),clonedElement:i.cloneElement,index:l};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||i.dragArea==="."+ht){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+Et).style.visibility="hidden",i.cloneElement.classList.contains(gt)&&t.removeClass([i.cloneElement],gt)):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],gt),i.dragItem.classList.contains(gt)&&t.removeClass([i.dragItem],gt),i.dragItem.querySelector("."+Et).style.visibility="visible"),"Scrollable"===i.overflowMode&&!t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))){var o=i.element.querySelector(".e-scroll-right-nav"),a=i.element.querySelector(".e-scroll-left-nav"),d=i.element.querySelector(".e-hscroll-bar");!t.isNullOrUndefined(o)&&Math.abs(o.offsetWidth/2+o.offsetLeft)>i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&(d.scrollLeft-=10),!t.isNullOrUndefined(a)&&Math.abs(a.offsetLeft+a.offsetWidth-i.cloneElement.offsetLeft)>a.offsetWidth/2&&(d.scrollLeft+=10)}i.cloneElement.style.pointerEvents="none",n=t.closest(e.target,"."+St+".e-draggable");var h=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(h=i.element.querySelector(".e-hscroll-content").offsetWidth),null!=n&&!n.isSameNode(i.dragItem)&&n.closest(".e-tab").isSameNode(i.dragItem.closest(".e-tab"))&&((s=i.getEleIndex(n))<l&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,l,s),s>l&&Math.abs(n.offsetWidth/2)+n.offsetLeft-h<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,l,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",r)}else i.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(s)},i.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),t.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+ht).classList.contains(bt)&&t.addClass([this.cloneElement],bt),t.removeClass([this.cloneElement.querySelector("."+Et)],"e-ripple"),t.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||t.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},i.prototype.itemDragStart=function(e){var i=this;this.draggingItems=this.items.map(function(e){return e}),this.dragItem=e.element;var s={draggedItem:e.element,event:e.event,target:e.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1};this.trigger("onDragStart",s,function(e){e.cancel?t.detach(i.cloneElement):(i.removeActiveClass(),t.addClass([i.tbItems.querySelector("."+xt)],gt),i.dragItem.querySelector("."+Et).style.visibility="hidden")})},i.prototype.dragAction=function(e,t,i){if(this.items.length>0){var s=this.draggingItems[t];this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)}if("MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),t>i)if(this.dragItem.parentElement.isSameNode(e.parentElement))this.dragItem.parentNode.insertBefore(this.dragItem,e);else if("Extended"===this.overflowMode)if(e.isSameNode(e.parentElement.lastChild)){var n=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var l=e.parentElement.lastChild;if(e.isSameNode(l)){n=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(l,n.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)}t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},i.prototype.itemDragStop=function(e){var i=this;t.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Et).style.visibility="visible",document.body.style.cursor="";var s={draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1};this.trigger("dragged",s,function(e){e.cancel?i.refresh():i.items.length>0&&i.draggingItems.length>0?(i.items=i.draggingItems,i.selectedItem=i.droppedIndex,i.refresh()):(i.dragItem.querySelector("."+Et).style.visibility="",t.removeClass([i.tbItems.querySelector("."+xt)],gt),i.selectTab(i.droppedIndex,null,!0))}),this.dragItem=null},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+St,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove(vt,"e-overlay"),s.firstElementChild.setAttribute("tabindex","-1")):(s.classList.add(vt,"e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains(mt)&&this.select(e+1)),t.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!i,this.dataBind()),s.setAttribute("aria-disabled",!0===i?"false":"true"))},i.prototype.addTab=function(e,t){var i=this,s={addedItems:e,cancel:!1};this.isReplace?this.addingTabContent(e,t):this.trigger("adding",s,function(s){s.cancel||i.addingTabContent(e,t)}),this.isReact&&this.renderReactTemplates()},i.prototype.addingTabContent=function(e,i){var s=this,n=0;if(this.hdrEle=t.select("."+ht,this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems(),this.bindDraggable();else{var l=t.selectAll(".e-tab-header ."+St,this.element).length;if(0!==l&&(n=this.lastIndex+1),t.isNullOrUndefined(i)&&(i=l-1),l<i||i<0||isNaN(i))return;0!==l||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(gt),this.tbItems=t.select("."+It,this.getTabHeader()),this.isAdd=!0;var r=this.parseObject(e,i);this.isAdd=!1;var o,a=0;e.forEach(function(e,l){if(o=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(o)||0===o.length&&!t.isNullOrUndefined(e.header)&&t.isNullOrUndefined(e.header.iconCss)||(r[l]&&(t.isNullOrUndefined(e.id)&&(e.id="tabitem_"+(n+l).toString()),r[l].htmlAttributes["data-id"]=e.id),s.items.splice(i+a,0,e),a++),s.isTemplate&&!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)){var d=n+l,h=s.createElement("div",{id:ct+s.tabId+"_"+d,className:ut,attrs:{role:"tabpanel","aria-labelledby":"e-item_"+d}});s.cntEle.insertBefore(h,s.cntEle.children[i+l]);var c=s.getTrgContent(s.cntEle,d.toString());s.getContent(c,e.content,"render",i)}}),this.tbObj.addItems(r,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):(this.setActiveBorder(),this.tbItem=t.selectAll("."+St,this.getTabHeader())),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+St,this.element)[e];if(!t.isNullOrUndefined(s)){var n={removedItem:s,removedIndex:e,cancel:!1};this.trigger("removing",n,function(n){if(!n.cancel){i.tbObj.removeItems(e),i.allowDragAndDrop&&e!==Array.prototype.indexOf.call(i.itemIndexArray,s.id)&&(e=Array.prototype.indexOf.call(i.itemIndexArray,s.id));var l=i.itemIndexArray.indexOf(s.id);i.items.splice(l,1),i.itemIndexArray.splice(l,1),i.refreshActiveBorder();var r=t.select("#"+ct+i.tabId+"_"+i.extIndex(s.id),t.select("."+ct,i.element));t.isNullOrUndefined(r)||t.detach(r),i.trigger("removed",n),i.draggableItems&&i.draggableItems.length>0&&(i.draggableItems[e].destroy(),i.draggableItems[e]=null,i.draggableItems.splice(e,1)),s.classList.contains(mt)?(e=e>t.selectAll("."+St+":not(."+Ot+")",i.element).length-1?e-1:e,i.enableAnimation=!1,i.selectedItem=e,i.select(e)):e!==i.selectedItem&&(e<i.selectedItem&&(e=i.itemIndexArray.indexOf(i.tbItem[i.selectedItem].id),i.setProperties({selectedItem:e>-1?e:i.selectedItem},!0),i.prevIndex=i.selectedItem),i.tbItem=t.selectAll("."+St,i.getTabHeader())),0===t.selectAll("."+St,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+St,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add(gt),!0===i)if(n.classList.add(gt),0!==(s=t.selectAll("."+St+":not(."+gt+")",this.tbItems)).length&&n.classList.contains(mt)){if(0!==e)for(var l=e-1;l>=0;l--){if(!this.tbItem[l].classList.contains(gt)){this.select(l);break}if(0===l)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(gt)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(gt)){this.select(r);break}}else 0===s.length&&this.element.classList.add(gt);else this.element.classList.remove(gt),s=t.selectAll("."+St+":not(."+gt+")",this.tbItems),n.classList.remove(gt),0===s.length&&this.select(e);this.setActiveBorder(),n.setAttribute("aria-hidden",""+i),"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},i.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),void 0===i&&(i=!1),this.isInteracted=i,this.select(e,t)},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+It,n),this.tbItem=t.selectAll("."+St,n),this.content=t.select("."+ct,this.element),this.prevItem=this.tbItem[this.prevIndex],t.isNullOrUndefined(this.selectedItem)||this.selectedItem<0||this.tbItem.length<=this.selectedItem||isNaN(this.selectedItem)?this.selectedItem=0:this.selectedID=this.extIndex(this.tbItem[this.selectedItem].id);var l=this.tbItem[e];t.isNullOrUndefined(l)?this.selectedID="0":this.selectingID=this.extIndex(l.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(vt)||this.prevItem.children.item(0).setAttribute("tabindex","-1");var r={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#"+ct+this.tabId+"_"+this.selectedID,this.content),selectingItem:l,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#"+ct+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,isInteracted:this.isInteracted,cancel:!1};this.initRender?this.selectingContent(e,this.isInteracted):this.trigger("selecting",r,function(t){t.cancel||s.selectingContent(e,s.isInteracted)}),this.isInteracted=!1},i.prototype.selectingContent=function(e,i){if("number"==typeof e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(vt)||this.tbItem[e].classList.contains(gt)))for(var s=e+1;s<this.items.length;s++){if(!1===this.items[s].disabled&&!0===this.items[s].visible){e=s;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Ot)&&this.reorderActiveTab){if(this.setActive(this.popupHandler(this.tbItem[e]),null,i),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll("."+It+" ."+St,this.hdrEle);var n=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,n);var l=this.itemIndexArray[e];this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,l)}}else this.setActive(e,null,i);else this.setActive(0,null,i)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,i)},i.prototype.getItemIndex=function(e){for(var t,i=0;i<this.tbItem.length;i++){if(e===this.tbItem[i].getAttribute("data-id")){t=i;break}}return t},i.prototype.disable=function(e){this.setCssClass(this.element,vt,e),this.element.setAttribute("aria-disabled",""+e)},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},i.prototype.getModuleName=function(){return"tab"},i.prototype.onPropertyChanged=function(e,i){for(var s=this,n=0,l=Object.keys(e);n<l.length;n++){switch(l[n]){case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(e.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+ht);""===i.cssClass||t.isNullOrUndefined(i.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),t.isNullOrUndefined(r)||(this.setCssClass(r,i.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=i.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=s.dragArea}),this.refresh())}}},i.prototype.refreshActiveTab=function(){if(this.isReact&&this.clearTemplate(),this.isTemplate){var e=this.element.querySelector("."+It),i=this.element.querySelector("."+St+"."+mt),s=i.id,n=s.indexOf("_"),l=parseInt(s.substring(n+1),10),r=i.innerText,o=this.element.querySelector("."+ct).querySelector("."+mt).children[0],a=o.innerHTML;t.detach(i),t.detach(o);var d={className:St+" "+ft+" "+mt,id:ut+this.tabId+"_"+l,attrs:{role:"tab","aria-controls":ct+this.tabId+"_"+l,"aria-disabled":"false","aria-selected":"true"}},h=this.createElement("span",{className:Ct,innerHTML:r,attrs:{role:"presentation"}}).outerHTML,c=this.createElement("div",{className:Nt,innerHTML:h+this.btnCls.outerHTML}).outerHTML,p=this.createElement("div",{className:Et,innerHTML:c,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",d),e.children[l+1]),this.element.querySelector("."+St+"."+mt).appendChild(p);E=this.createElement("div",{innerHTML:a});this.element.querySelector("."+ct).querySelector("."+mt).appendChild(E)}else if(this.element.querySelector("."+St+"."+mt)){t.detach(this.element.querySelector("."+St+"."+mt).children[0]),t.detach(this.element.querySelector("."+ct).querySelector("."+mt).children[0]);var u=this.items[this.selectedItem],f=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconPosition)?"":u.header.iconPosition,m=t.isNullOrUndefined(u.header)||t.isNullOrUndefined(u.header.iconCss)?"":u.header.iconCss,v=u.headerTemplate||u.header.text,g=this.createElement("div",{className:Ct,attrs:{role:"presentation"}});t.isNullOrUndefined(v.tagName)?this.headerTextCompile(g,v,this.selectedItem):g.appendChild(v);var y=this.createElement("span",{className:"e-icons e-tab-icon e-icon-"+f+" "+m}),b=this.createElement("div",{className:Nt});b.appendChild(g),""!==v&&void 0!==v&&""!==m?("left"===f||"top"===f?b.insertBefore(y,b.firstElementChild):b.appendChild(y),g,this.isIconAlone=!1):(""===m?g:y)===y&&(t.detach(g),b.appendChild(y),this.isIconAlone=!0);var C=u.disabled?{}:{tabIndex:"-1"};b.appendChild(this.btnCls.cloneNode(!0));var x=this.createElement("div",{className:Et,attrs:C});x.appendChild(b),"top"!==f&&"bottom"!==f||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+St+"."+mt).appendChild(x);var E=this.createElement("div"),N=u.content,I=void 0;if("string"==typeof N||t.isNullOrUndefined(N.innerHTML))if("string"==typeof N&&this.enableHtmlSanitizer&&(N=t.SanitizeHtmlHelper.sanitize(N)),"."===N[0]||"#"===N[0])if(document.querySelectorAll(N).length){var S=document.querySelector(N);I=S.outerHTML.trim(),E.appendChild(S),S.style.display=""}else this.compileElement(E,N,"content",this.selectedItem);else this.compileElement(E,N,"content",this.selectedItem);else E.appendChild(N);t.isNullOrUndefined(I)||-1===this.templateEle.indexOf(N.toString())&&this.templateEle.push(N.toString()),this.element.querySelector(".e-item."+mt).appendChild(E)}this.isReact&&this.renderReactTemplates()},dt([t.Collection([],Rt)],i.prototype,"items",void 0),dt([t.Property("100%")],i.prototype,"width",void 0),dt([t.Property("auto")],i.prototype,"height",void 0),dt([t.Property("")],i.prototype,"cssClass",void 0),dt([t.Property(0)],i.prototype,"selectedItem",void 0),dt([t.Property("Top")],i.prototype,"headerPlacement",void 0),dt([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),dt([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),dt([t.Property("Dynamic")],i.prototype,"loadOn",void 0),dt([t.Property(!1)],i.prototype,"enablePersistence",void 0),dt([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),dt([t.Property(!1)],i.prototype,"showCloseButton",void 0),dt([t.Property(!0)],i.prototype,"reorderActiveTab",void 0),dt([t.Property()],i.prototype,"scrollStep",void 0),dt([t.Property()],i.prototype,"dragArea",void 0),dt([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),dt([t.Complex({},Ht)],i.prototype,"animation",void 0),dt([t.Event()],i.prototype,"created",void 0),dt([t.Event()],i.prototype,"adding",void 0),dt([t.Event()],i.prototype,"added",void 0),dt([t.Event()],i.prototype,"selecting",void 0),dt([t.Event()],i.prototype,"selected",void 0),dt([t.Event()],i.prototype,"removing",void 0),dt([t.Event()],i.prototype,"removed",void 0),dt([t.Event()],i.prototype,"onDragStart",void 0),dt([t.Event()],i.prototype,"dragging",void 0),dt([t.Event()],i.prototype,"dragged",void 0),dt([t.Event()],i.prototype,"destroyed",void 0),i=dt([t.NotifyPropertyChanges],i)}(t.Component),jt=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),qt=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Ft="e-treeview",Wt="e-icon-collapsible",Vt="e-icon-expandable",_t="e-list-item",zt="e-list-text",Kt="e-list-parent",Yt="e-hover",Xt="e-active",Gt="e-icons-spinner",Qt="e-process",Jt="e-icons",Zt="e-text-content",$t="e-tree-input",ei="e-dragging",ti="e-sibling",ii="e-drop-in",si="e-drop-next",ni="e-drop-out",li="e-fullrow",ri="e-selected",oi="e-expanded",ai="e-node-collapsed",di="e-check",hi="e-stop",ci="e-checkbox-wrapper",pi="e-frame",ui="e-node-focus",fi="e-animation-active",mi={treeRole:"tree",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},vi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Property("child")],i.prototype,"child",void 0),qt([t.Property([])],i.prototype,"dataSource",void 0),qt([t.Property("expanded")],i.prototype,"expanded",void 0),qt([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),qt([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),qt([t.Property("iconCss")],i.prototype,"iconCss",void 0),qt([t.Property("id")],i.prototype,"id",void 0),qt([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),qt([t.Property("isChecked")],i.prototype,"isChecked",void 0),qt([t.Property("parentID")],i.prototype,"parentID",void 0),qt([t.Property(null)],i.prototype,"query",void 0),qt([t.Property("selected")],i.prototype,"selected",void 0),qt([t.Property(null)],i.prototype,"tableName",void 0),qt([t.Property("text")],i.prototype,"text",void 0),qt([t.Property("tooltip")],i.prototype,"tooltip",void 0),qt([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),gi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Property("SlideDown")],i.prototype,"effect",void 0),qt([t.Property(400)],i.prototype,"duration",void 0),qt([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),yi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),qt([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},gi)],i.prototype,"collapse",void 0),qt([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},gi)],i.prototype,"expand",void 0),i}(t.ChildProperty),bi=function(e){function o(t,i){var s=e.call(this,t,i)||this;return s.isRefreshed=!1,s.preventExpand=!1,s.checkedElement=[],s.disableNode=[],s.validArr=[],s.validNodes=[],s.expandChildren=[],s.isFieldChange=!1,s.changeDataSource=!1,s.hasTemplate=!1,s.isFirstRender=!1,s.mouseDownStatus=!1,s}jt(o,e),a=o,o.prototype.getModuleName=function(){return"treeview"},o.prototype.preRender=function(){var e=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:Vt,ariaAttributes:mi,expandIconPosition:"Left",itemCreated:function(t){e.beforeNodeCreate(t)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new t.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),t.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),t.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),t.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},o.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},o.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},o.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("tabindex","0"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},o.prototype.setDisabledMode=function(){this.disabled?this.element.classList.add("e-disabled"):this.element.classList.remove("e-disabled")},o.prototype.setEnableRtl=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},o.prototype.setRipple=function(){var e={selector:".e-fullrow,.e-text-content",ignore:"."+Zt+" > ."+Jt+",.e-input-group,.e-input, ."+ci};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+Zt+" > ."+Jt,isCenterRipple:!0};this.rippleIconFn=t.rippleEffect(this.element,i)},o.prototype.setFullRow=function(e){(e?t.addClass:t.removeClass)([this.element],"e-fullrow-wrap")},o.prototype.setMultiSelect=function(e){var i=t.select("."+Kt,this.element);e?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable")},o.prototype.templateComplier=function(e){if(e){this.hasTemplate=!0,this.element.classList.add("e-interaction");try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}}this.element.classList.remove("e-interaction")},o.prototype.setDataBinding=function(e){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof l.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof l.DataManager&&i.isOffline&&(i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),i.renderItems(!0),0!==i.treeList.length||i.isLoaded||i.finalize())}).catch(function(e){i.trigger("actionFailure",{error:e})}):this.fields.dataSource.executeQuery(this.getQuery(this.fields)).then(function(t){i.treeList.pop(),i.treeData=t.result,i.isNumberTypeId=i.getType(),i.setRootData(),e&&(i.changeDataSource=!0),i.renderItems(!0),i.changeDataSource=!1,0!==i.treeList.length||i.isLoaded||i.finalize()}).catch(function(e){i.trigger("actionFailure",{error:e})})):(this.treeList.pop(),t.isNullOrUndefined(this.fields.dataSource)?this.rootData=this.treeData=[]:(this.treeData=JSON.parse(JSON.stringify(this.fields.dataSource)),this.setRootData()),this.isNumberTypeId=this.getType(),this.renderItems(!1)),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.getQuery=function(e,s){void 0===s&&(s=null);var n,r=[];if(e.query)n=e.query.clone();else{n=new l.Query;for(var o=this.getActualProperties(e),a=0,d=Object.keys(o);a<d.length;a++){var h=d[a];"dataSource"!==h&&"tableName"!==h&&"child"!==h&&e[h]&&"url"!==h&&-1===r.indexOf(e[h])&&r.push(e[h])}n.select(r),o.hasOwnProperty("tableName")&&n.from(e.tableName)}return i.ListBase.addSorting(this.sortOrder,e.text,n),t.isNullOrUndefined(s)||t.isNullOrUndefined(e.parentID)||n.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(s):s),n},o.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof t.getValue(this.fields.id,this.treeData[0])},o.prototype.setRootData=function(){if(this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType){this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID);var e=this.getChildNodes(this.treeData,void 0,!0);t.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e}else this.rootData=this.treeData},o.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var s=this.getSortedData(this.rootData);this.ulElement=i.ListBase.createList(this.createElement,e?this.rootData:s,this.listBaseOption),this.element.appendChild(this.ulElement);var n=this.ulElement.querySelectorAll(".e-list-item");if(!1===this.loadOnDemand)for(var l=0;l<n.length;)this.renderChildNodes(n[l],!0,null,!0),l++;(1===t.selectAll("."+Kt,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},o.prototype.updateCheckedStateFromDS=function(e){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var i=this.fields,s=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.isChecked,"equal",!0,!1)),n=0;n<s.length;n++){var r=s[n][this.fields.id]?s[n][this.fields.id].toString():null;s[n][this.fields.parentID]&&s[n][this.fields.parentID].toString();if(-1!==this.checkedNodes.indexOf(r)||this.isLoaded||this.checkedNodes.push(r),s[n][this.fields.hasChildren])for(var o=s[n][this.fields.id],a=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.parentID,"equal",o,!1)),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(h)&&this.autoCheck&&this.checkedNodes.push(h)}}for(n=0;n<this.checkedNodes.length;n++){var c=this.fields,p=new l.DataManager(this.treeData).executeLocal((new l.Query).where(c.id,"equal",this.checkedNodes[n],!0));if(p[0]&&this.autoCheck&&(this.getCheckedNodeDetails(c,p),this.checkIndeterminateState(p[0])),p.length>0){var u=p[0][this.fields.id]?p[0][this.fields.id].toString():null;this.checkedNodes.indexOf(u)>-1&&-1===this.validNodes.indexOf(u)&&this.validNodes.push(u)}for(var f=new l.DataManager(this.treeData).executeLocal((new l.Query).where(c.parentID,"equal",this.checkedNodes[n],!0)),m=0;m<f.length;m++){u=f[m][this.fields.id]?f[m][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.autoCheck&&this.checkedNodes.push(u),this.checkedNodes.indexOf(u)>-1&&-1===this.validNodes.indexOf(u)&&this.validNodes.push(u)}}}else if(2===this.dataType||this.fields.dataSource instanceof l.DataManager&&this.isOffline){for(m=0;m<this.treeData.length;m++){var v=this.treeData[m][this.fields.id]?this.treeData[m][this.fields.id].toString():"";this.treeData[m][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(v)&&this.checkedNodes.push(v),this.checkedNodes.indexOf(v)>-1&&-1===this.validNodes.indexOf(v)&&this.validNodes.push(v);var g=t.getValue(this.fields.child.toString(),this.treeData[m]);g&&this.updateChildCheckState(g,this.treeData[m])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},o.prototype.getCheckedNodeDetails=function(e,i){var s=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,n=0,r=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),o=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(r||o){if(o){t.select("."+di,o)||this.changeState(o,"indeterminate",null,!0,!0)}}else{this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(s)&&this.parentNodeCheck.push(s);for(var a=this.getChildNodes(this.treeData,s),d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(h)&&n++,n===a.length&&-1===this.checkedNodes.indexOf(s)&&this.checkedNodes.push(s)}var c=new l.DataManager(this.treeData).executeLocal((new l.Query).where(e.id,"equal",s,!0));this.getCheckedNodeDetails(e,c)}},o.prototype.updateParentCheckState=function(){for(var e,i=t.selectAll(".e-stop",this.element),s=0;s<i.length;s++){var n=t.closest(i[s],"."+_t),r=n.getAttribute("data-uid").toString(),o=0;if(e=1===this.dataType?new l.DataManager(this.treeData).executeLocal((new l.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(this.treeData,r)){for(var a=0;a<e.length;a++){var d=e[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}if(o===e.length){var h=n.getAttribute("data-uid");-1===this.checkedNodes.indexOf(h)&&this.checkedNodes.push(h),this.changeState(n,"check",null,!0,!0)}else 0===o&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},o.prototype.checkIndeterminateState=function(e){var t;if(t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]')){"true"!==t.querySelector("."+ci).getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0)}else if(2===this.dataType){this.parentNodeCheck.length;-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())}},o.prototype.updateChildCheckState=function(e,i){for(var s=0,n=i[this.fields.id]?i[this.fields.id].toString():"",l=0;l<e.length;l++){var r=e[l][this.fields.id]?e[l][this.fields.id].toString():"";e[l][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkedNodes.push(r),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkedNodes.push(r),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&s++,this.checkedNodes.indexOf(r)>-1&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r);var o=t.getValue(this.fields.child.toString(),e[l]);o&&o.length&&(-1===this.parentCheckData.indexOf(i)&&this.parentCheckData.push(i),this.updateChildCheckState(o,e[l])),s===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(n)&&this.checkedNodes.push(n)}if(0!==s&&this.autoCheck){this.checkIndeterminateState(i);for(var a=0;a<this.parentCheckData.length;a++)i!==this.parentCheckData[a]&&this.parentCheckData[a]&&this.checkIndeterminateState(this.parentCheckData[a])}this.parentCheckData=[]},o.prototype.beforeNodeCreate=function(e){if(this.showCheckBox){var i=n.createCheckBox(this.createElement,!0,{cssClass:this.touchClass});i.setAttribute("role","checkbox");var s=t.select("div."+Jt,e.item),l=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var r=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(l)>-1?(t.select("."+pi,i).classList.add(di),i.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(r)||"true"!==r.toString()?i.setAttribute("aria-checked","false"):(t.select("."+pi,i).classList.add(di),i.setAttribute("aria-checked","true"),this.addCheck(e.item));var o=t.select("."+pi,i);t.EventHandler.add(o,"mousedown",this.frameMouseHandler,this),t.EventHandler.add(o,"mouseup",this.frameMouseHandler,this)}this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(ri)&&e.item.setAttribute("aria-selected","false");var a=e.fields;if(this.addActionClass(e,a.selected,ri),this.addActionClass(e,a.expanded,oi),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+zt),h=e.item.getAttribute("data-uid");d.innerHTML="",this.renderNodeTemplate(e.curData,d,h)}var c={node:e.item,nodeData:e.curData,text:e.text};this.isRefreshed||this.trigger("drawNode",c)},o.prototype.frameMouseHandler=function(e){var i=t.select(".e-ripple-container",e.target.parentElement);n.rippleMouseHandler(e,i)},o.prototype.addActionClass=function(e,i,s){var n=e.curData,l=t.getValue(i,n);t.isNullOrUndefined(l)||"false"===l.toString()||e.item.classList.add(s)},o.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof l.DataManager){for(var s=0;s<e.length;s++)if(this.isOffline){if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s]))&&!t.isNullOrUndefined(t.getValue(i.parentID,e[s])))return 1}else if("string"==typeof i.child&&t.isNullOrUndefined(t.getValue(i.child,e[s])))return 1;return 2}s=0;for(var n=e.length;s<n;s++){if("string"==typeof i.child&&!t.isNullOrUndefined(t.getValue(i.child,e[s])))return 2;if(!t.isNullOrUndefined(t.getValue(i.parentID,e[s]))||!t.isNullOrUndefined(t.getValue(i.hasChildren,e[s])))return 1}return 1},o.prototype.getGroupedData=function(e,t){for(var s=(new l.Query).group(t),n=i.ListBase.getDataSource(e,s),r=[],o=0;o<n.length;o++){var a=n[o].items;r.push(a)}return r},o.prototype.getSortedData=function(e){return e&&"None"!==this.sortOrder&&(e=i.ListBase.getDataSource(e,i.ListBase.addSorting(this.sortOrder,this.fields.text))),e},o.prototype.finalizeNode=function(e){for(var i=t.selectAll(".e-list-img",e),s=0;s<i.length;s++)i[s].setAttribute("alt","e-list-img");if(this.isLoaded){for(var n=t.selectAll("."+ri,e),l=0;l<n.length;l++){this.selectNode(n[l],null);break}t.removeClass(n,ri)}for(var r=t.selectAll("."+_t+":not(."+oi+")",e),o=0;o<r.length;o++){var a=t.select("div."+Jt,r[o]);a&&a.classList.contains(Vt)&&this.disableExpandAttr(r[o])}var d=t.selectAll("."+oi,e);if(!this.isInitalExpand)for(l=0;l<d.length;l++)this.renderChildNodes(d[l]);t.removeClass(d,oi),this.updateList(),this.isLoaded&&this.updateCheckedProp()},o.prototype.updateCheckedProp=function(){if(this.showCheckBox){var e=[].concat([],this.checkedNodes);this.setProperties({checkedNodes:e},!0)}},o.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=t.selectAll("li",this.element),i=0;i<e.length;i++)e[i].classList.contains(_t)&&(t.select("."+Kt,e[i])?this.ensureParentCheckState(e[i]):this.ensureChildCheckState(e[i]));else{var s=t.selectAll(".e-stop",this.element);for(i=0;i<s.length;i++)s[i].classList.remove(hi)}},o.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(Ft))return;var i=e;e.classList.contains(_t)&&(i=t.select("."+Kt,e));var s=t.selectAll("."+di,i),n=t.selectAll(".e-stop",i),l=t.selectAll("."+_t,i),r=e.getElementsByClassName(ci)[0];l.length===s.length?this.changeState(r,"check",null,!0,!0):s.length>0||n.length>0?this.changeState(r,"indeterminate",null,!0,!0):0===s.length&&this.changeState(r,"uncheck",null,!0,!0);var o=t.closest(e,"."+Kt);if(!t.isNullOrUndefined(o)){var a=t.closest(o,"."+_t);this.ensureParentCheckState(a)}}},o.prototype.ensureChildCheckState=function(e,i){if(!t.isNullOrUndefined(e)){var s=t.select("."+Kt,e),n=void 0;if(!t.isNullOrUndefined(s)){n=t.selectAll("."+ci,s);for(var l=e.getElementsByClassName(pi)[0].classList.contains(di),r=e.getElementsByClassName(pi)[0].classList.contains(hi),o=s.querySelectorAll("li"),a=(s.parentElement.getAttribute("aria-expanded"),void 0),d=0;d<n.length;d++){var h=o[d].getAttribute("data-uid");if(t.isNullOrUndefined(this.currentLoadData)||t.isNullOrUndefined(t.getValue(this.fields.isChecked,this.currentLoadData[d]))){var c=n[d].getElementsByClassName(pi)[0].classList.contains(di);l?a="check":c&&!this.isLoaded?a="check":-1!==this.checkedNodes.indexOf(h)&&this.isLoaded&&(r||l)?a="check":o[d].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||r)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||r)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):a="uncheck"}else a=t.getValue(this.fields.isChecked,this.currentLoadData[d])?"check":"uncheck",-1!==this.ele&&(a=l?"check":"uncheck"),"uncheck"===a&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(h)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1),a="indeterminate");this.changeState(n[d],a,i,!0,!0)}}this.autoCheck&&this.isLoaded&&this.updateParentCheckState()}},o.prototype.doCheckBoxAction=function(e,i){t.selectAll("."+_t,this.element);if(t.isNullOrUndefined(e)){var s=t.selectAll("."+ci,this.element);if(this.loadOnDemand)for(var n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck",null,null,null,i);else for(n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck")}else for(var l=e.length;l>=0;l--){var r=void 0;if(r=1===e.length?this.getElement(e[l-1]):this.getElement(e[l]),t.isNullOrUndefined(r)){var o=void 0;if(""!==(o=e[l-e.length]?e[l-e.length].toString():e[l]?e[l].toString():null)&&i&&o)this.setValidCheckedNode(o),this.dynamicCheckState(o,i);else if(-1!==this.checkedNodes.indexOf(o)&&""!==o&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(o),1);var a=this.getChildNodes(this.treeData,o);if(a){for(var d=0;d<a.length;d++){var h=a[d][this.fields.id]?a[d][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(h)){this.checkedNodes.splice(this.checkedNodes.indexOf(h),1);var c=this.element.querySelector('[data-uid="'+h+'"]');c&&this.changeState(c,"uncheck",null)}}-1!==this.parentNodeCheck.indexOf(o)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(o),1)}o&&this.dynamicCheckState(o,i),this.updateField(this.treeData,this.fields,o,"isChecked",null)}}else{var p=t.select("."+Kt+" ."+ci,r);this.validateCheckNode(p,!i,r,null)}}if(e)for(var u=0;u<e.length;u++){o=e[u]?e[u].toString():"";i||this.updateField(this.treeData,this.fields,o,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},o.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+_t),n=s.getAttribute("data-uid");"true"!==this.getNodeData(s).isChecked||i||this.updateField(this.treeData,this.fields,n,"isChecked",null)},o.prototype.dynamicCheckState=function(e,i){if(1===this.dataType){var s=0,n=new l.DataManager(this.treeData).executeLocal((new l.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var r=n[0][this.fields.id]?n[0][this.fields.id].toString():null,o=n[0][this.fields.parentID]?n[0][this.fields.parentID].toString():null,a=((u=this.element.querySelector('[data-uid="'+o+'"]'))&&t.select(".e-stop",u),u?t.select("."+di,u):null),d=this.element.querySelector('[data-uid="'+r+'"]'),h=this.getChildNodes(this.treeData,o);if(h)for(var c=0;c<h.length;c++){var p=h[c][this.fields.id]?h[c][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(p)&&s++}-1!==this.checkedNodes.indexOf(e)&&u&&r===e&&this.autoCheck?this.changeState(u,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&r===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&r===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&u&&r===e&&this.autoCheck&&0!==s?this.changeState(u,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&u&&r===e&&this.autoCheck&&0===s?this.changeState(u,"uncheck",null):d||u||r!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof l.DataManager&&this.isOffline){r=void 0;var u=void 0;for(a=void 0,c=0;c<this.treeData.length;c++){r=this.treeData[c][this.fields.id]?this.treeData[c][this.fields.id].toString():"",a=(u=this.element.querySelector('[data-uid="'+r+'"]'))?t.select("."+di,u):null,-1===this.checkedNodes.indexOf(r)&&u&&a&&!i&&this.changeState(u,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[c]);f&&this.updateChildIndeterminate(f,r,e,i,r)}}},o.prototype.updateIndeterminate=function(e,t){var i,s=this.getTreeData(e),n=0;1===this.dataType&&(i=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null);var l=this.getChildNodes(this.treeData,i);if(l)for(var r=0;r<l.length;r++){var o=l[r][this.fields.id]?l[r][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&n++}var a=this.element.querySelector('[data-uid="'+i+'"]');a&&t?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0!==n?this.changeState(a,"indeterminate",null):!t&&a&&-1===this.parentNodeCheck.indexOf(i)&&0===n?this.changeState(a,"uncheck",null):a||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)?this.parentNodeCheck.push(i):t||-1===this.checkedNodes.indexOf(i)||-1!==this.parentNodeCheck.indexOf(i)||0===n||this.parentNodeCheck.push(i):this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i),1),this.updateIndeterminate(i,t),-1===this.checkedNodes.indexOf(i)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(i),1))},o.prototype.updateChildIndeterminate=function(e,i,s,n,l){for(var r=0,o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][this.fields.id].toString():"";-1!==this.checkedNodes.indexOf(a)&&r++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+di,d):null,p=this.element.querySelector('[data-uid="'+a+'"]'),u=p?t.select("."+di,p):null;if(-1!==this.checkedNodes.indexOf(s)&&d&&a===s&&this.autoCheck)this.changeState(d,"indeterminate",null);else if(-1!==this.checkedNodes.indexOf(s)||!d||p||a!==s||n){if(-1===this.checkedNodes.indexOf(s)&&p&&a===s&&!n)this.changeState(p,"uncheck",null);else if(-1===this.checkedNodes.indexOf(s)&&h&&a===s&&this.autoCheck&&0===r&&!n)h.classList.remove(hi);else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&a===s&&0===r)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(a)&&p&&u&&0===r)this.changeState(p,"uncheck",null);else if(!p&&!d&&a===s||-1!==this.parentNodeCheck.indexOf(i)&&this.autoCheck){var f=this.element.querySelector('[data-uid="'+l+'"]');n&&0!==r?this.changeState(f,"indeterminate",null):n&&r===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkedNodes.push(i):n||0!==r||-1===this.parentNodeCheck.indexOf(i)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(i)),-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i)}}else this.autoCheck?this.changeState(d,"uncheck",null):0!==r?this.changeState(d,"indeterminate",null):this.changeState(d,"uncheck",null);var m=t.getValue(this.fields.child.toString(),e[o]);m&&this.updateChildIndeterminate(m,a,s,n,l)}},o.prototype.changeState=function(e,i,s,n,l,r){var o,a=this,d=t.closest(e,"."+_t);e===d&&(e=t.select("."+ci,d)),n?this.nodeCheckAction(e,i,d,o,s,n,l,r):(this.checkActionNodes=[],o=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",o,function(t){t.cancel||a.nodeCheckAction(e,i,d,t,s,n,l,r)}))},o.prototype.nodeCheckAction=function(e,i,s,n,l,r,o,a){var d,h=e.getElementsByClassName(pi)[0];if("check"!==i||h.classList.contains(di)?"uncheck"===i&&(h.classList.contains(di)||h.classList.contains(hi))?(t.removeClass([h],[di,hi]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(di),h.classList.add(hi),this.removeCheck(s),d="mixed"):(h.classList.remove(hi),h.classList.add(di),this.addCheck(s),d="true"),d="check"===i?"true":"uncheck"===i?"false":d,t.isNullOrUndefined(d)||e.setAttribute("aria-checked",d),o){var c=[].concat([],this.checkActionNodes);n=this.getCheckEvent(s,i,l),t.isUndefined(r)&&(n.data=c)}void 0!==a&&this.ensureStateChange(s,a),r||t.isNullOrUndefined(d)||(e.setAttribute("aria-checked",d),n.data[0].checked=d,this.trigger("nodeChecked",n),this.checkActionNodes=[])},o.prototype.addCheck=function(e){var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.checkedNodes.indexOf(i)||this.checkedNodes.push(i)},o.prototype.removeCheck=function(e){var t=this.checkedNodes.indexOf(e.getAttribute("data-uid"));t>-1&&this.checkedNodes.splice(t,1)},o.prototype.getCheckEvent=function(e,i,s){this.checkActionNodes.push(this.getNodeData(e));var n=this.checkActionNodes;return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,data:n}},o.prototype.finalize=function(){var e=t.select("."+Kt,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",mi.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+_t,this.element);i&&(t.addClass([i],ui),this.updateIdAttr(null,i)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&this.rootData[0].hasOwnProperty(this.fields.parentID),this.doExpandAction()}},o.prototype.setTextWrap=function(){(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-text-wrap"),t.Browser.isIE&&(this.allowTextWrap?t.addClass:t.removeClass)([this.element],"e-ie-wrap")},o.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var i=e?t.selectAll("."+_t,e):this.liList,s=i.length,n=0;n<s;n++)this.calculateWrap(i[n])},o.prototype.calculateWrap=function(e){var i=t.select("."+li,e);i&&i.nextElementSibling&&(i.style.height=this.allowTextWrap?i.nextElementSibling.offsetHeight+"px":"")},o.prototype.doExpandAction=function(){var e=this.expandedNodes;if(this.isInitalExpand&&e.length>0)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof l.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s=t.select('[data-uid="'+e[i]+'"]',this.element);if(t.isNullOrUndefined(s))e[i]&&-1===this.expandChildren.indexOf(e[i])&&this.expandChildren.push(e[i].toString());else{var n=t.select("."+Vt,t.select("."+Zt,s));t.isNullOrUndefined(n)||this.expandAction(s,n,null)}}this.afterFinalized()}else this.afterFinalized()},o.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()})},o.prototype.expandCallback=function(e,i){var s=t.select('[data-uid="'+e+'"]',this.element);if(t.isNullOrUndefined(s))i();else{var n=t.select("."+Vt,t.select("."+Zt,s));t.isNullOrUndefined(n)?i():this.expandAction(s,n,null,!1,i)}},o.prototype.afterFinalized=function(){if(this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,!this.isLoaded||this.isFieldChange){var e={data:this.treeData};this.trigger("dataBound",e)}this.isLoaded=!0},o.prototype.doSelectionAction=function(){var e=t.selectAll("."+ri,this.element),i=this.selectedNodes;if(i.length>0){this.setProperties({selectedNodes:[]},!0);for(var s=0;s<i.length;s++){var n=t.select('[data-uid="'+i[s]+'"]',this.element);if(n&&!n.classList.contains("e-active")?this.selectNode(n,null,!0):this.selectedNodes.push(i[s]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);t.removeClass(e,ri)},o.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[t].classList.contains("e-disable")||this.selectNode(e[t],null,!0),this.allowMultiSelection);t++);},o.prototype.clickHandler=function(e){var i=e.originalEvent.target;if(t.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),i&&!this.dragStartAction){var s=i.classList,n=t.closest(i,"."+_t);if(n){if(3!==e.originalEvent.which){var l=t.select(".e-ripple-element",n),r=t.select("."+Jt,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var o=t.closest(i,"."+ci);if(!t.isNullOrUndefined(o)){var a=t.select("."+pi,o);return this.validateCheckNode(o,a.classList.contains(di),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(Vt)?this.expandAction(n,i,e):s.contains(Wt)?this.collapseNode(n,i,e):l&&r?r.classList.contains("e-ripple")&&r.classList.contains(Vt)?this.expandAction(n,r,e):r.classList.contains("e-ripple")&&r.classList.contains(Wt)?this.collapseNode(n,r,e):s.contains(Kt)||s.contains(_t)||this.toggleSelect(n,e.originalEvent,!1):s.contains(Kt)||s.contains(_t)||this.toggleSelect(n,e.originalEvent,!1)}this.triggerClickEvent(e.originalEvent,n)}}},o.prototype.nodeCheckedEvent=function(e,i,s){t.closest(e,"."+_t);var n=this.getCheckEvent(e,i?"uncheck":"check",s);n.data=n.data.splice(0,n.data.length-1),this.trigger("nodeChecked",n)},o.prototype.triggerClickEvent=function(e,t){var i={event:e,node:t};this.trigger("nodeClicked",i)},o.prototype.expandNode=function(e,i,s){var n=this;if(this.renderReactTemplates(),i.classList.contains(Gt)&&this.hideSpinner(i),this.initialRender||i.classList.add("interaction"),!0!==s||!0===s&&e.classList.contains("e-expanded")){if(!0!==this.preventExpand){t.removeClass([i],Vt),t.addClass([i],Wt);var r=0,o=0,a=this,d=t.select("."+Kt,e),h=e;this.setHeight(h,d);var c=t.select("."+_t+"."+Xt,e);this.isAnimate&&!this.isRefreshed?this.aniObj.animate(d,{name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(i){h.style.overflow="hidden",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.add(fi),r=h.offsetHeight,o=t.select("."+Zt,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,r,o)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.remove(fi),n.expandedNode(h,d,i)}}):this.expandedNode(h,d,i)}}else{t.select("."+Kt,e).style.display="none",this.fields.dataSource instanceof l.DataManager==!0&&(this.preventExpand=!1)}this.initialRender&&i.classList.add("interaction")},o.prototype.expandedNode=function(e,i,s){i.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",t.removeClass([s],Qt),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.trigger("nodeExpanded",this.expandArgs))},o.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),t.removeClass([e],ai);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.expandedNodes.indexOf(i)||this.expandedNodes.push(i)},o.prototype.collapseNode=function(e,i,s){var n=this;if(!i.classList.contains(Qt)){t.addClass([i],Qt);var l;this.isLoaded?(l=this.getExpandEvent(e,s),this.trigger("nodeCollapsing",l,function(s){s.cancel?t.removeClass([i],Qt):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,l)}},o.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],Wt),t.addClass([i],Vt);var l=0,r=0,o=this,a=t.select("."+Kt,e),d=e,h=t.select("."+_t+"."+Xt,e);this.isAnimate?this.aniObj.animate(a,{name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(i){d.style.overflow="hidden",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.add(fi),l=t.select("."+Zt,e).offsetHeight,r=d.offsetHeight},progress:function(e){o.animateHeight(e,l,r)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove(fi),n.collapsedNode(d,a,i,s)}}):this.collapsedNode(d,a,i,s)},o.prototype.collapsedNode=function(e,i,s,n){i.style.display="none",e.style.overflow="",e.style.height="",t.removeClass([s],Qt),this.removeExpand(e),this.isLoaded&&(n=this.getExpandEvent(e,null),this.trigger("nodeCollapsed",n))},o.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);var i=this.expandedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.expandedNodes.splice(i,1)},o.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),t.addClass([e],ai)},o.prototype.setHeight=function(e,t){t.style.display="block",t.style.visibility="hidden",e.style.height=e.offsetHeight+"px",t.style.display="none",t.style.visibility=""},o.prototype.animateHeight=function(e,t,i){var s=(i-t)*((e.duration-e.timeStamp)/e.duration)+t;e.element.parentElement.style.height=s+"px"},o.prototype.renderChildNodes=function(e,s,n,r){var o=this,a=t.select("div."+Jt,e);if(!t.isNullOrUndefined(a)){this.showSpinner(a);var d;if(this.fields.dataSource instanceof l.DataManager){var h=this.parents(e,"."+Kt).length,c=this.getChildFields(this.fields,h,1);if(t.isNullOrUndefined(c)||t.isNullOrUndefined(c.dataSource))return t.detach(a),void this.removeExpand(e,!0);this.treeList.push("false"),this.fields.dataSource instanceof l.DataManager&&this.isOffline?(this.treeList.pop(),d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(d,c,a,e,s,n,r)):c.dataSource.executeQuery(this.getQuery(c,e.getAttribute("data-uid"))).then(function(t){o.treeList.pop(),d=t.result,1===o.dataType&&(o.dataType=2),o.loadChild(d,c,a,e,s,n,r)}).catch(function(e){o.trigger("actionFailure",{error:e})})}else{if(d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.currentLoadData=this.getSortedData(d),t.isNullOrUndefined(d)||0===d.length)return t.detach(a),void this.removeExpand(e,!0);this.listBaseOption.ariaAttributes.level=parseFloat(e.getAttribute("aria-level"))+1,e.appendChild(i.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(e,a,r),this.setSelectionForChildNodes(d),this.ensureCheckNode(e),this.finalizeNode(e),this.disableTreeNodes(d),this.renderSubChild(e,s,r)}}},o.prototype.loadChild=function(e,s,n,r,o,a,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(r,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof l.DataManager&&!this.isOffline){var h=r.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(r.getAttribute("aria-level"))+1,r.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(r,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(r),this.finalizeNode(r),this.disableTreeNodes(e),this.renderSubChild(r,o,d)}a&&a(),0!==this.treeList.length||this.isLoaded||this.finalize()},o.prototype.disableTreeNodes=function(e){for(var t=0;t<e.length;){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},o.prototype.setSelectionForChildNodes=function(e){var t;for(t=0;t<e.length;t++){var i=e[t][this.fields.id]?e[t][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},o.prototype.ensureCheckNode=function(e){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck&&(this.ensureChildCheckState(e),this.ensureParentCheckState(e))),this.currentLoadData=null},o.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},o.prototype.getChildMapper=function(e){return"string"==typeof e.child||t.isNullOrUndefined(e.child)?e:e.child},o.prototype.getChildNodes=function(e,i,s){void 0===s&&(s=!1);var n;if(t.isNullOrUndefined(e))return n;if(1===this.dataType)return this.getChildGroup(this.groupedData,i,s);if("string"==typeof this.fields.child)for(var l=0,r=e.length;l<r;l++){var o=t.getValue(this.fields.id,e[l]);if(o&&o.toString()===i)return t.getValue(this.fields.child,e[l]);if(!t.isNullOrUndefined(t.getValue(this.fields.child,e[l]))&&void 0!==(n=this.getChildNodes(t.getValue(this.fields.child,e[l]),i)))break}return n},o.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,l=e.length;n<l;n++){if(t.isNullOrUndefined(e[n][0])||t.isNullOrUndefined(t.getValue(this.fields.parentID,e[n][0])))return s?e[n]:[];if(t.getValue(this.fields.parentID,e[n][0]).toString()===i)return e[n]}},o.prototype.renderSubChild=function(e,i,s){if(i)for(var n=t.selectAll("."+Vt,e),l=0,r=n.length;l<r;l++){var o=n[l];if(e.querySelector(".e-icons")!==n[l]){var a=t.closest(o,"."+_t);this.expandArgs=this.getExpandEvent(a,null),!0!==s&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(a,i,null,s)}}},o.prototype.toggleSelect=function(e,t,i){e.classList.contains("e-disable")||(this.allowMultiSelection&&(t&&t.ctrlKey||i)&&this.isActive(e)?this.unselectNode(e,t):this.selectNode(e,t,i))},o.prototype.isActive=function(e){return!!e.classList.contains(Xt)},o.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))this.setFocusElement(e);else{var l;this.isLoaded?(l=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",l,function(t){t.cancel||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,l,s)}},o.prototype.nodeSelectAction=function(e,i,s,n){if(this.allowMultiSelection&&(n||i&&(!i||i.ctrlKey))||this.removeSelectAll(),this.allowMultiSelection&&i&&i.shiftKey){this.startNode||(this.startNode=e);var l=this.liList.indexOf(this.startNode),r=this.liList.indexOf(e);if(l>r){var o=l;l=r,r=o}for(var a=l;a<=r;a++){var d=this.liList[a];t.isVisible(d)&&!d.classList.contains("e-disable")&&this.addSelect(d)}}else this.startNode=e,this.addSelect(e);this.setFocusElement(e),this.isLoaded&&(s.nodeData=this.getNodeData(e),this.trigger("nodeSelected",s))},o.prototype.unselectNode=function(e,t){var i,s=this;this.isLoaded?(i=this.getSelectEvent(e,"un-select",t),this.trigger("nodeSelecting",i,function(t){t.cancel||s.nodeUnselectAction(e,t)})):this.nodeUnselectAction(e,i)},o.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},o.prototype.setFocusElement=function(e){if(!t.isNullOrUndefined(e)){var i=this.getFocusedNode();i&&t.removeClass([i],ui),t.addClass([e],ui),this.updateIdAttr(i,e)}},o.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],Xt);var i=e.getAttribute("data-uid");t.isNullOrUndefined(i)||-1!==this.selectedNodes.indexOf(i)||this.selectedNodes.push(i)},o.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),t.removeClass([e],Xt);var i=this.selectedNodes.indexOf(e.getAttribute("data-uid"));i>-1&&this.selectedNodes.splice(i,1)},o.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+Xt),i=0,s=e;i<s.length;i++){var n=s[i];this.allowMultiSelection?n.setAttribute("aria-selected","false"):n.removeAttribute("aria-selected")}t.removeClass(e,Xt),this.setProperties({selectedNodes:[]},!0)},o.prototype.getSelectEvent=function(e,i,s){var n=this.getNodeData(e);return{action:i,cancel:!1,isInteracted:!t.isNullOrUndefined(s),node:e,nodeData:n}},o.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?t.Browser.isDevice?"Click":"DblClick":this.expandOn},o.prototype.expandHandler=function(e){var i=e.originalEvent.target;!i||i.classList.contains("e-input")||i.classList.contains(Ft)||i.classList.contains(Kt)||i.classList.contains(_t)||i.classList.contains(Jt)||this.showCheckBox&&t.closest(i,"."+ci)||this.expandCollapseAction(t.closest(i,"."+_t),e)},o.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+Jt,e);if(s&&!s.classList.contains(Qt)){var n=s.classList;n.contains(Vt)?this.expandAction(e,s,i):n.contains(Wt)&&this.collapseNode(e,s,i)}},o.prototype.expandAction=function(e,i,s,n,l){var r=this;i.classList.contains(Qt)||(t.addClass([i],Qt),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Qt):r.nodeExpandAction(e,i,n,l)})):this.nodeExpandAction(e,i,n,l))},o.prototype.nodeExpandAction=function(e,i,s,n){var l=t.select("."+Kt,e);if(l&&"UL"===l.nodeName)this.expandNode(e,i);else{this.isFirstRender=!0,this.renderChildNodes(e,s,n);for(var r=t.selectAll("."+_t,e),o=0;o<r.length;o++){var a=this.getId(r[o]);if(-1!==this.expandChildren.indexOf(a)&&void 0!==this.expandChildren){var d=t.select("."+Vt,t.select("."+Zt,r[o]));t.isNullOrUndefined(d)||this.expandAction(r[o],d,null),this.expandChildren.splice(this.expandChildren.indexOf(a),1)}}}},o.prototype.keyActionHandler=function(e){var i=this,s=e.target,n=this.getFocusedNode();if(s&&s.classList.contains("e-input")){var l=s;"enter"===e.action?(l.blur(),this.element.focus(),t.addClass([n],Yt)):"escape"===e.action&&(l.value=this.oldText,l.blur(),this.element.focus(),t.addClass([n],Yt))}else{e.preventDefault();var r={cancel:!1,event:e,node:n};this.trigger("keyPress",r,function(s){if(!s.cancel)switch(e.action){case"space":i.showCheckBox&&i.checkNode(e);break;case"moveRight":i.openNode(!i.enableRtl,e);break;case"moveLeft":i.openNode(!!i.enableRtl,e);break;case"shiftDown":i.shiftKeySelect(!0,e);break;case"moveDown":case"ctrlDown":case"csDown":i.navigateNode(!0);break;case"shiftUp":i.shiftKeySelect(!1,e);break;case"moveUp":case"ctrlUp":case"csUp":i.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":i.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":i.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.toggleSelect(n,e);break;case"f2":i.allowEditing&&!n.classList.contains("e-disable")&&i.createTextbox(n,e);break;case"ctrlA":if(i.allowMultiSelection){var l=t.selectAll("."+_t+":not(."+Xt+")",i.element);i.selectGivenNodes(l)}}})}},o.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+Zt),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var l=n.getBoundingClientRect();s.bottom>l.bottom?n.scrollTop+=s.bottom-l.bottom:s.top<l.top&&(n.scrollTop-=l.top-s.top)}this.isVisibleInViewport(i)||i.scrollIntoView(e)},o.prototype.isVisibleInViewport=function(e){var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},o.prototype.getScrollParent=function(e){return t.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},o.prototype.shiftKeySelect=function(e,t){if(this.allowMultiSelection){var i=this.getFocusedNode(),s=e?this.getNextNode(i):this.getPrevNode(i);this.removeHover(),this.setFocusElement(s),this.toggleSelect(s,t,!1),this.navigateToFocus(!e)}else this.navigateNode(e)},o.prototype.checkNode=function(e){var i=this.getFocusedNode(),s=t.select("."+ci,i),n=t.select(" ."+pi,s).classList.contains(di);i.classList.contains("e-disable")||0==i.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(s,n,i,e)},o.prototype.validateCheckNode=function(e,i,s,n){var l=this,r=t.closest(e,"."+_t);this.checkActionNodes=[];var o=i?"false":"true";t.isNullOrUndefined(o)||e.setAttribute("aria-checked",o);var a=this.getCheckEvent(r,i?"uncheck":"check",n);this.trigger("nodeChecking",a,function(t){t.cancel||l.nodeCheckingAction(e,i,s,t,n)})},o.prototype.nodeCheckingAction=function(e,i,s,n,l){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))&&(this.checkedElement.push(s.getAttribute("data-uid")),this.autoCheck)){var r=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==r?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null}if(this.changeState(e,i?"uncheck":"check",l,!0),this.autoCheck){this.ensureChildCheckState(s),this.ensureParentCheckState(t.closest(t.closest(s,"."+Kt),"."+_t));var o=void 0;"check"===n.action?o=!0:"uncheck"===n.action&&(o=!1),this.ensureStateChange(s,o)}this.nodeCheckedEvent(e,i,l)},o.prototype.ensureStateChange=function(e,i){var s=t.select("."+Kt,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck)for(var o=new l.DataManager(this.treeData).executeLocal((new l.Query).where(r.parentID,"equal",n,!0)),a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null,h=o[a][this.fields.isChecked]?o[a][this.fields.isChecked].toString():null;if(-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)){this.checkedNodes.push(d);var c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}else if(-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)){if(this.checkedNodes.splice(this.checkedNodes.indexOf(d),1),"true"===h&&this.updateField(this.treeData,this.fields,d,"isChecked",null),-1===this.checkedNodes.indexOf(n)&&null===s||-1!==this.parentNodeCheck.indexOf(d)){var p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}}else{c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i)}}else if(1!==this.dataType||this.autoCheck){(c=this.getChildNodes(this.treeData,n))&&this.childStateChange(c,n,s,i)}else if(i)for(a=0;a<this.treeData.length;a++){var u=this.treeData[a][this.fields.id]?this.treeData[a][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(u)&&this.checkedNodes.push(u)}else{for(var f=new l.DataManager(this.treeData).executeLocal((new l.Query).where(r.isChecked,"equal",!0,!1)),a=0;a<f.length;a++){var m=f[a][this.fields.id]?f[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(m)&&this.checkedNodes.splice(this.checkedNodes.indexOf(m),1),this.updateField(this.treeData,this.fields,m,"isChecked",null)}this.checkedNodes=[]}},o.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[i][this.fields.id]?e[i][this.fields.id].toString():null,n=e[i][this.fields.isChecked]?e[i][this.fields.isChecked].toString():null;-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkedNodes.push(s),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null);var l=this.getChildNodes(this.treeData,s);l.length>0&&this.getChildItems(l,t)}},o.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var l=e[n][this.fields.id]?e[n][this.fields.id].toString():"",r=e[n][this.fields.isChecked]?e[n][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(l)?(this.checkedNodes.push(l),-1!==this.parentNodeCheck.indexOf(l)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(l),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(l)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(l),1),"true"===r&&this.updateField(this.treeData,this.fields,l,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l):(-1!==this.checkedNodes.indexOf(l)&&this.checkedNodes.splice(this.checkedNodes.indexOf(l),1),this.updateField(this.treeData,this.fields,l,"isChecked",null),this.checkedNodes=[]));var o=this.getChildNodes([e[n]],l);o&&this.childStateChange(o,t,i,s)}},o.prototype.allCheckNode=function(e,i,s,n,l){if(e)for(var r=0;r<e.length;r++){var o=t.getValue(this.fields.id,e[r]),a=this.element.querySelector('[data-uid="'+o+'"]');!1!==l&&-1===this.checkedElement.indexOf(o.toString())&&(null===a&&!t.isNullOrUndefined(e[r][this.fields.isChecked])&&-1===i.indexOf(o.toString())||0===n||2===s)&&(!1!==e[r][this.fields.isChecked]||2===s?i.push(o.toString()):n=null,n=!1!==e[r][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(o.toString())&&t.isNullOrUndefined(s)&&i.push(o.toString());var d=t.getValue(this.fields.child.toString(),e[r]);if(!0===t.getValue(this.fields.hasChildren,e[r])||d){var h=t.getValue(this.fields.id,e[r]),c=void 0;(c=1===this.dataType?this.getChildNodes(this.treeData,h.toString()):d)&&(t.isNullOrUndefined(l)?this.allCheckNode(c,i,s,n):this.allCheckNode(c,i,s,n,l),n=null)}n=null}},o.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+Jt,s);if(e){if(!n)return;n.classList.contains(Vt)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(Wt))this.collapseNode(s,n,i);else{var l=t.closest(t.closest(s,"."+Kt),"."+_t);if(!l)return;l.classList.contains("e-disable")||(this.setFocus(s,l),this.navigateToFocus(!0))}},o.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},o.prototype.navigateRootNode=function(e){var t=this.getFocusedNode(),i=e?this.getRootNode():this.getEndNode();i.classList.contains("e-disable")||(this.setFocus(t,i),this.navigateToFocus(e))},o.prototype.getFocusedNode=function(){var e,i=t.select("."+_t+"."+ui,this.element);return t.isNullOrUndefined(i)&&(e=t.select("."+_t,this.element)),t.isNullOrUndefined(i)?t.isNullOrUndefined(e)?this.element.firstElementChild:e:i},o.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);if(this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")){var s=i.lastChild;null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")?this.focusNextNode(i,!1):null==i.nextSibling&&s.classList.contains(Zt)?this.focusNextNode(i,!1):this.focusNextNode(i,t)}},o.prototype.getNextNode=function(e){var i,s=this.liList.indexOf(e);do{if(s++,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getPrevNode=function(e){var i,s=this.liList.indexOf(e);do{if(s--,i=this.liList[s],t.isNullOrUndefined(i))return e}while(!t.isVisible(i));return i},o.prototype.getRootNode=function(){var e,i=0;do{e=this.liList[i],i++}while(!t.isVisible(e));return e},o.prototype.getEndNode=function(){var e,i=this.liList.length-1;do{e=this.liList[i],i--}while(!t.isVisible(e));return e},o.prototype.setFocus=function(e,i){t.removeClass([e],[Yt,ui]),i.classList.contains("e-disable")||(t.addClass([i],[Yt,ui]),this.updateIdAttr(e,i))},o.prototype.updateIdAttr=function(e,t){this.element.removeAttribute("aria-activedescendant"),e&&e.removeAttribute("id"),t.setAttribute("id",this.element.id+"_active"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active")},o.prototype.focusIn=function(){this.mouseDownStatus||t.addClass([this.getFocusedNode()],Yt),this.mouseDownStatus=!1},o.prototype.focusOut=function(){t.removeClass([this.getFocusedNode()],Yt)},o.prototype.onMouseOver=function(e){var i=e.target,s=i.classList,n=t.closest(i,"."+_t);!n||s.contains(Kt)||s.contains(_t)?this.removeHover():n&&!n.classList.contains("e-disable")&&this.setHover(n)},o.prototype.setHover=function(e){e.classList.contains(Yt)||(this.removeHover(),t.addClass([e],Yt))},o.prototype.onMouseLeave=function(e){this.removeHover()},o.prototype.removeHover=function(){var e=t.selectAll("."+Yt,this.element);e&&e.length&&t.removeClass(e,Yt)},o.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(_t)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(Ft)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),l=t.closest(e.parentNode,"."+_t),r=l?l.getAttribute("data-uid"):null,o=e.classList.contains(Xt),a="true"===e.getAttribute("aria-expanded"),d=null!==e.getAttribute("aria-expanded")||null!=(t.select("."+Vt,e)||t.select("."+Wt,e)),h=null;return this.showCheckBox&&(h=t.select("."+ci,e).getAttribute("aria-checked")),{id:s,text:n,parentID:r,selected:o,expanded:a,isChecked:h,hasChildren:d}}return{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},o.prototype.getText=function(e,i){if(i){var s=this.getNodeObject(e.getAttribute("data-uid")),n=parseFloat(e.getAttribute("aria-level")),l=this.getFields(this.fields,n,1);return t.getValue(l.text,s)}return t.select("."+zt,e).textContent},o.prototype.getExpandEvent=function(e,i){var s=this.getNodeData(e);return{cancel:!1,isInteracted:!t.isNullOrUndefined(i),node:e,nodeData:s,event:i}},o.prototype.renderNodeTemplate=function(e,i,s){var n=this.nodeTemplateFn(e,this,"nodeTemplate"+s,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,i,this.root);n&&(n=Array.prototype.slice.call(n),t.append(n,i))},o.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},o.prototype.reRenderNodes=function(){this.updateListProp(this.fields),t.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",t.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},o.prototype.setCssClass=function(e,i){t.isNullOrUndefined(e)||""===e||t.removeClass([this.element],e.split(" ")),t.isNullOrUndefined(i)||""===i||t.addClass([this.element],i.split(" "))},o.prototype.editingHandler=function(e){var i=e.target;if(!(!i||i.classList.contains(Ft)||i.classList.contains(Kt)||i.classList.contains(_t)||i.classList.contains(Jt)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+_t);this.createTextbox(s,e)}},o.prototype.createTextbox=function(e,i){var s=this,n=t.select("."+$t,this.element);n&&n.blur();var l=t.select("."+zt,e);this.updateOldText(e);var r=this.createElement("input",{className:$t,attrs:{value:this.oldText}}),o=this.getEditEvent(e,null,r.outerHTML);this.trigger("nodeEditing",o,function(i){if(!i.cancel){var n="width:"+(l.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(e),s.isReact?setTimeout(function(){s.renderTextBox(o,l,n)},5):s.renderTextBox(o,l,n)}})},o.prototype.renderTextBox=function(e,i,s){i.innerHTML=e.innerHtml;var n=t.select("."+$t,i);this.inputObj=r.Input.createInput({element:n,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.setAttribute("style",s),n.focus();var l=n;l.setSelectionRange(0,l.value.length),this.wireInputEvents(n)},o.prototype.updateOldText=function(e){var i=e.getAttribute("data-uid");this.editData=this.getNodeObject(i);var s=parseFloat(e.getAttribute("aria-level"));this.editFields=this.getFields(this.fields,s,1),this.oldText=t.getValue(this.editFields.text,this.editData)},o.prototype.inputFocusOut=function(e){if(t.select("."+$t,this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+zt),r=t.closest(i,"."+_t);t.detach(this.inputObj.container),this.fields.dataSource instanceof l.DataManager&&!this.isOffline?this.crudOperation("update",null,r,s,null,null,!0):this.appendNewText(r,n,s,!0)}},o.prototype.appendNewText=function(e,t,i,s){var n=this,l=this.getEditEvent(e,i,null);this.trigger("nodeEdited",l,function(l){i=l.cancel?l.oldText:l.newText,n.updateText(e,t,i,s),l.oldText!==i&&n.triggerEvent()})},o.prototype.updateText=function(e,i,s,n){var l=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))i.innerText=s;else{i.innerText="";var r=e.getAttribute("data-uid");this.renderNodeTemplate(l,i,r),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),i.focus()),this.allowTextWrap&&this.calculateWrap(e)},o.prototype.getElement=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?t.getElement(e):null},o.prototype.getId=function(e){return t.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?t.getElement(e).getAttribute("data-uid"):null},o.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},o.prototype.getNodeObject=function(e){if(!t.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var i=0,s=this.treeData.length;i<s;i++){var n=t.getValue(this.fields.id,this.treeData[i]);if(!t.isNullOrUndefined(this.treeData[i])&&!t.isNullOrUndefined(n)&&n.toString()===e)return this.treeData[i]}}},o.prototype.getChildNodeObject=function(e,i,s){var n;if(t.isNullOrUndefined(e))return n;for(var r=0,o=e.length;r<o;r++){var a=t.getValue(i.id,e[r]);if(e[r]&&a&&a.toString()===s)return e[r];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[r]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[r]),this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[r]);if(void 0!==(n=this.getChildNodeObject(d,this.getChildMapper(i),s)))break}}return n},o.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},o.prototype.initializeDrag=function(){var e,i=this,s=this;this.dragObj=new t.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+Zt,helper:function(n){i.dragTarget=n.sender.target;var l=t.closest(i.dragTarget,"."+Ft),r=t.closest(i.dragTarget,"."+Zt);if(i.dragLi=t.closest(i.dragTarget,"."+_t),i.fullRowSelect&&!r&&i.dragTarget.classList.contains(li)&&(r=i.dragTarget.nextElementSibling),!i.dragTarget||!n.element.isSameNode(l)||!r||i.dragTarget.classList.contains(Ft)||i.dragTarget.classList.contains(Kt)||i.dragTarget.classList.contains(_t)||i.dragLi.classList.contains("e-disable"))return!1;var o=r.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+Jt,o))){var a=s.createElement("div",{className:Jt+" "+Vt});o.insertBefore(a,o.children[0])}var d="e-drag-item "+Ft+" "+i.cssClass+" "+(i.enableRtl?"e-rtl":"");(e=s.createElement("div",{className:d})).appendChild(o);var h=i.selectedNodes.length;if(h>1&&i.allowMultiSelection&&i.dragLi.classList.contains(Xt)){var c=s.createElement("span",{className:"e-drop-count",innerHTML:""+h});e.appendChild(c)}return document.body.appendChild(e),document.body.style.cursor="",i.dragData=i.getNodeData(i.dragLi),e},dragStart:function(s){t.addClass([i.element],ei);var n,l=t.closest(s.target,".e-list-item");l&&(n=parseInt(l.getAttribute("aria-level"),10));var r=i.getDragEvent(s.event,i,null,s.target,null,e,n);r.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",r,function(t){t.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0})},drag:function(s){i.dragObj.setProperties({cursorAt:{top:!t.isNullOrUndefined(s.event.targetTouches)||t.Browser.isDevice?60:-20}}),i.dragAction(s,e)},dragStop:function(e){t.removeClass([i.element],ei),i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable");s&&n||(t.detach(e.helper),document.body.style.cursor="");var l,r=t.closest(s,".e-list-item");r&&(l=parseInt(r.getAttribute("aria-level"),10));var o=i.getDragEvent(e.event,i,s,s,null,e.helper,l);o.preventTargetExpand=!1,i.trigger("nodeDragStop",o,function(s){i.dragParent=s.draggedParentNode,i.preventExpand=s.preventTargetExpand,s.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor=""),i.dragStartAction=!1})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){t.isNullOrUndefined(e)||e.target.classList.contains(ti)||(document.body.style.cursor="not-allowed")},over:function(e){document.body.style.cursor=""},drop:function(e){i.dropAction(e)}})},o.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],ei),this.dragStartAction=!1},o.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+Zt),l=t.select("div."+Jt,i);t.removeClass([l],[ii,si,ni,"e-no-drop"]),this.removeVirtualEle(),document.body.style.cursor="";var r=e.target.classList;if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(r)&&r.contains(li)&&(n=e.target.nextElementSibling),s){var o=t.closest(e.target,"."+_t),a=t.closest(e.target,"."+ci),d=t.closest(e.target,"."+Wt),h=t.closest(e.target,"."+Vt);if(!s.classList.contains(Ft)||n&&!o.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,o))if(this.hasTemplate&&o){var c=t.select(this.fullRowSelect?"."+li:"."+Zt,o);if(e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){var p=this.fullRowSelect?1:0;this.appendIndicator(o,l,p)}else if(e&&!h&&!d&&!a&&c&&e.event.offsetY>c.offsetHeight-10||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,l,p)}else t.addClass([l],ii)}else if(o&&e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){p=this.fullRowSelect?1:0;this.appendIndicator(o,l,p)}else if(o&&e&&!h&&!d&&e.target.offsetHeight>0&&e.event.offsetY>e.target.offsetHeight-10&&!a||h&&e.event.offsetY>19||d&&e.event.offsetX>19){p=this.fullRowSelect?2:1;this.appendIndicator(o,l,p)}else t.addClass([l],ii);else"LI"!==e.target.nodeName||o.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,o)?e.target.classList.contains(ti)?t.addClass([l],si):t.addClass([l],ni):(t.addClass([l],si),this.renderVirtualEle(e))}else t.addClass([l],"e-no-drop"),document.body.style.cursor="not-allowed";var u,f=t.closest(e.target,".e-list-item");f&&(u=parseInt(f.getAttribute("aria-level"),10));var m=this.getDragEvent(e.event,this,e.target,e.target,null,i,u);m.dropIndicator&&t.removeClass([l],m.dropIndicator),this.trigger("nodeDragging",m),m.dropIndicator&&t.addClass([l],m.dropIndicator)},o.prototype.appendIndicator=function(e,i,s){t.addClass([i],si);var n=this.createElement("div",{className:ti});e.insertBefore(n,e.children[s])},o.prototype.dropAction=function(e){var i,s,n,r=e.event.offsetY,o=e.target,d=!1;n=e.dragData.draggable;for(var h=0;h<n.ej2_instances.length;h++)if(n.ej2_instances[h]instanceof a){i=n.ej2_instances[h];break}if(i&&i.dragTarget){var c=i.dragTarget,p=t.closest(c,"."+_t),u=t.closest(o,"."+_t);if(null==u&&o.classList.contains(Ft)&&(u=o.firstElementChild),t.detach(e.droppedElement),document.body.style.cursor="",!u||u.isSameNode(p)||this.isDescendant(p,u))return void(this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1));if(i.allowMultiSelection&&p.classList.contains(Xt)){var f=t.selectAll("."+Xt,i.element);if(e.target.offsetHeight<=33&&r>e.target.offsetHeight-10&&r>6)for(h=f.length-1;h>=0;h--)u.isSameNode(f[h])||this.isDescendant(f[h],u)||this.appendNode(o,f[h],u,e,i,r);else for(h=0;h<f.length;h++)u.isSameNode(f[h])||this.isDescendant(f[h],u)||this.appendNode(o,f[h],u,e,i,r)}else this.appendNode(o,p,u,e,i,r);s=parseInt(p.getAttribute("aria-level"),10),d=!0}this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1),this.trigger("nodeDropped",this.getDragEvent(e.event,i,o,e.target,e.dragData.draggedElement,null,s,d)),i.element.id!==this.element.id&&i.triggerEvent(),this.triggerEvent()},o.prototype.appendNode=function(e,i,s,n,l,r){var o=t.closest(e,"."+ci),a=t.closest(n.target,"."+Wt),d=t.closest(n.target,"."+Vt);i.classList.contains("e-disable")||o||!(d&&n.event.offsetY<5||a&&n.event.offsetX<3||d&&n.event.offsetY>19||a&&n.event.offsetX>19||!d&&!a)?this.dropAsChildNode(i,s,l,null,n,r,!0):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,l):e.firstElementChild&&e.classList.contains(Ft)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,l):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,l):this.dropAsChildNode(i,s,l,null,n,r)},o.prototype.dropAsSiblingNode=function(e,i,s,n){var l,r=t.closest(i,"."+Kt),o=t.closest(e,"."+Kt),a=t.closest(o,"."+_t);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?l=!1:s.event.offsetY<2?l=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?l=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(l=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");r.insertBefore(e,l?d:d.nextElementSibling)}else r.insertBefore(e,l?s.target:s.target.nextElementSibling);this.moveData(e,i,r,l,n),this.updateElement(o,a),this.updateAriaLevel(e),n.element.id===this.element.id?this.updateList():(n.updateInstance(),this.updateInstance())},o.prototype.dropAsChildNode=function(e,i,s,n,l,r,o){var a,d=t.closest(e,"."+Kt),h=t.closest(d,"."+_t),c=t.closest(i,"."+Kt);if(l&&l.target&&(a=t.select(this.fullRowSelect?"."+li:"."+Zt,i)),l&&r<7&&!o)c.insertBefore(e,i),this.moveData(e,i,c,!0,s);else if(l&&l.target.offsetHeight>0&&r>l.target.offsetHeight-10&&!o&&!this.hasTemplate)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else if(this.hasTemplate&&a&&r>a.offsetHeight-10&&!o)c.insertBefore(e,i.nextElementSibling),this.moveData(e,i,c,!1,s);else{var p=this.expandParent(i),u=p.childNodes[n];p.insertBefore(e,u),this.moveData(e,u,p,!0,s)}this.updateElement(d,h),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},o.prototype.moveData=function(e,i,s,n,l){var r=t.closest(s,"."+_t),o=this.getId(e),a=l.updateChildField(l.treeData,l.fields,o,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(r);if(1===this.dataType){this.updateField(this.treeData,this.fields,c,"hasChildren",!0);var p=t.isNullOrUndefined(h)?this.treeData.length:n?h:h+1;if(t.isNullOrUndefined(c)&&!this.hasPid)delete a[0][this.fields.parentID];else{var u=this.isNumberTypeId?parseFloat(c):c;t.setValue(this.fields.parentID,u,a[0])}if(this.treeData.splice(p,0,a[0]),l.element.id!==this.element.id){var f=l.removeChildNodes(o);p++;for(var m=0,v=f.length;m<v;m++)this.treeData.splice(p,0,f[m]),p++;l.groupedData=l.getGroupedData(l.treeData,l.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,c,a,n?h:h+1)},o.prototype.expandParent=function(e){var s=t.select("div."+Jt,e);s&&s.classList.contains(Vt)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+Kt,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+Kt,e),t.isNullOrUndefined(n)||!0!==this.preventExpand||(n.style.display="none"),t.isNullOrUndefined(n)||!1!==this.preventExpand||(n.style.display="block"),t.isNullOrUndefined(n)&&!0===this.preventExpand){t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,Vt,this.listBaseOption);(l=t.select("div."+Jt,e))&&l.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),l?t.removeClass([l],Wt):i.ListBase.generateIcon(this.createElement,e,Vt,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"}if(t.isNullOrUndefined(n)){this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,Wt,this.listBaseOption);var l;(l=t.select("div."+Jt,e))?t.removeClass([l],Vt):(i.ListBase.generateIcon(this.createElement,e,Wt,this.listBaseOption),l=t.select("div."+Jt,e),t.removeClass([l],Vt)),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))}return n},o.prototype.updateElement=function(e,i){if(i&&0===e.childElementCount){var s=t.select("div."+Jt,i);t.detach(e),t.detach(s);var n=this.getId(i);this.updateField(this.treeData,this.fields,n,"hasChildren",!1),this.removeExpand(i,!0)}},o.prototype.updateAriaLevel=function(e){var i=this.parents(e,"."+Kt).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+Kt,e),i+1)},o.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,l=s.length;n<l;n++){var r=s[n];r.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+Kt,r),i+1)}},o.prototype.renderVirtualEle=function(e){var t;e.event.offsetY>e.target.offsetHeight-2?t=!1:e.event.offsetY<2&&(t=!0);var i=this.createElement("div",{className:ti}),s=this.fullRowSelect?t?1:2:t?0:1;e.target.insertBefore(i,e.target.children[s])},o.prototype.removeVirtualEle=function(){var e=t.select("."+ti);e&&t.detach(e)},o.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},o.prototype.getDragEvent=function(e,i,s,n,r,o,a,d){var h=s?t.closest(s,"."+_t):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:r,u=i?i.dragData:null,f=s?this.parents(s,"."+_t):null,m=i.dragLi.parentElement,v=i.dragLi?t.closest(m,"."+_t):null,g=null,y=null,b=[si,ii,ni,"e-no-drop"],C=null,x=!0===d?p:h,E=x?t.closest(x,".e-list-parent"):null,N=0,I=null;if(v=i.dragLi&&null===v?t.closest(m,"."+Ft):v,v=!0===d?this.dragParent:v,o)for(;N<4;){if(t.select("."+Jt,o).classList.contains(b[N])){C=b[N];break}N++}if(E){var S=0;for(N=0;N<E.childElementCount;N++){if(S=!0!==d&&E.children[N]===p&&h!==p?++S:S,!0!==d&&E.children[N].classList.contains("e-hover")){y=e.offsetY>=23?N+1:N;break}if(E.children[N]===x){e.offsetY,y=N;break}}y=0!==S?--y:y,I="e-drop-in"==C?"Inside":e.offsetY<7?"Before":"After"}if(s&&(g=0===f.length?null:s.classList.contains(_t)?f[0]:f[1]),h===p&&(g=h),s&&n.offsetHeight<=33&&e.offsetY<n.offsetHeight-10&&e.offsetY>6&&(g=h,!0!==d)){a=++a;var O=g?t.select(".e-list-parent",g):null;if(y=O?O.children.length:0,!(this.fields.dataSource instanceof l.DataManager)&&null===O&&g){var w=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null;y=w?w.length:0}}return{cancel:!1,clonedNode:o,event:e,draggedNode:p,draggedNodeData:u,droppedNode:h,droppedNodeData:c,dropIndex:y,dropLevel:a,draggedParentNode:v,dropTarget:g,dropIndicator:C,target:n,position:I}},o.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(var s=0;s<i;s++)this.createFullRow(this.liList[s]);else for(s=0;s<i;s++){var n=t.select("."+li,this.liList[s]);t.detach(n)}},o.prototype.createFullRow=function(e){var t=this.createElement("div",{className:li});e.insertBefore(t,e.childNodes[0])},o.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=t.selectAll("."+_t+':not([aria-selected="true"])',this.element);i<s.length;i++){s[i].setAttribute("aria-selected","false")}else for(var n=0,l=t.selectAll("."+_t+'[aria-selected="false"]',this.element);n<l.length;n++){l[n].removeAttribute("aria-selected")}},o.prototype.collapseByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),l=0,r=n.length;l<r;l++){var o=n[l],a=t.select("."+Wt,t.select("."+Zt,o));t.isNullOrUndefined(a)||this.collapseNode(o,a,null),this.collapseByLevel(t.select("."+Kt,o),i-1,s)}},o.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+Wt,this.element)),s=0,n=i.length;s<n;s++){var l=i[s],r=t.closest(l,"."+_t);this.collapseNode(r,l,null)}},o.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),l=0,r=n.length;l<r;l++){var o=n[l],a=t.select("."+Vt,t.select("."+Zt,o));t.isNullOrUndefined(a)||this.expandAction(o,a,null),this.expandByLevel(t.select("."+Kt,o),i-1,s)}},o.prototype.expandAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+Vt,this.element)),s=0,n=i.length;s<n;s++){var l=i[s],r=t.closest(l,"."+_t);this.expandAction(r,l,null,!0)}},o.prototype.getVisibleNodes=function(e,i){var s=Array.prototype.slice.call(i);if(e)for(var n=0;n<s.length;n++)t.isVisible(s[n])||(s.splice(n,1),n--);return s},o.prototype.removeNode=function(e){var i=t.closest(e,"."+Kt),s=t.closest(i,"."+_t);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.removeData(e)},o.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},o.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+_t,this.element))},o.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=t.selectAll("."+Xt,this.element);this.selectGivenNodes(e)},o.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=t.selectAll('[aria-expanded="true"]',this.element),i=0,s=e.length;i<s;i++)this.addExpand(e[i])},o.prototype.removeData=function(e){if(1===this.dataType){var t=new l.DataManager(this.treeData),i=this.getId(e),s={},n=this.isNumberTypeId?parseFloat(i):i;s[this.fields.id]=n,t.remove(this.fields.id,s),this.removeChildNodes(i)}else{i=this.getId(e);this.updateChildField(this.treeData,this.fields,i,null,null,!0)}},o.prototype.removeChildNodes=function(e){var i=this.getChildGroup(this.groupedData,e,!1),s=[];if(i)for(var n=0,r=i.length;n<r;n++){var o=new l.DataManager(this.treeData),a=t.getValue(this.fields.id,i[n]).toString(),d={},h=this.isNumberTypeId?parseFloat(a):a;d[this.fields.id]=h;var c=o.remove(this.fields.id,d);s.push(c[0]),this.removeChildNodes(a)}return s},o.prototype.doGivenAction=function(e,i,s){for(var n=0,l=e.length;n<l;n++){var r=this.getElement(e[n]);if(!t.isNullOrUndefined(r)){var o=t.select("."+i,t.select("."+Zt,r));t.isNullOrUndefined(o)||(s?this.expandAction(r,o,null):this.collapseNode(r,o,null))}}},o.prototype.addGivenNodes=function(e,s,n,l,r){if(0!==e.length){var o=this.getSortedData(e),a=s?parseFloat(s.getAttribute("aria-level"))+1:1;l&&this.updateMapper(a);var d,h=i.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a),c=(d=r||(s?this.expandParent(s):t.select("."+Kt,this.element))).childNodes[n];if(c||"None"===this.sortOrder)for(var p=0;p<h.length;p++)d.insertBefore(h[p],c);if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder)){var u=d.childNodes;for(p=0;p<h.length;p++)for(var f=0;f<u.length;f++){if("Ascending"===this.sortOrder?u[f].textContent.toUpperCase()>h[p].innerText.toUpperCase():u[f].textContent.toUpperCase()<h[p].innerText.toUpperCase()){d.insertBefore(h[p],u[f]);break}d.insertBefore(h[p],u[u.length])}}var m=this.getId(s);if(1===this.dataType){this.updateField(this.treeData,this.fields,m,"hasChildren",!0);var v=this.getId(c),g=t.isNullOrUndefined(v)?this.treeData.length:this.getDataPos(this.treeData,this.fields,v);for(f=0;f<e.length;f++){if(!t.isNullOrUndefined(m)){var y=this.isNumberTypeId?parseFloat(m):m;t.setValue(this.fields.parentID,y,e[f])}this.treeData.splice(g,0,e[f]),g++}}else this.addChildData(this.treeData,this.fields,m,e,n);this.finalizeNode(d)}},o.prototype.updateMapper=function(e){var t=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(t)},o.prototype.updateListProp=function(e){var t=this.getActualProperties(e);this.listBaseOption.fields=t,this.listBaseOption.fields.url=t.hasOwnProperty("navigateUrl")?t.navigateUrl:"navigateUrl"},o.prototype.getDataPos=function(e,i,s){for(var n=null,r=0,o=e.length;r<o;r++){var a=t.getValue(i.id,e[r]);if(e[r]&&a&&a.toString()===s)return r;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[r]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[r]))){var d=t.getValue("child",e[r]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[r]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},o.prototype.addChildData=function(e,i,s,n,r){var o;if(t.isNullOrUndefined(s)){r=t.isNullOrUndefined(r)?e.length:r;for(var a=0,d=n.length;a<d;a++)e.splice(r,0,n[a]),r++;return o}for(var h=0,c=e.length;h<c;h++){var p=t.getValue(i.id,e[h]);if(e[h]&&p&&p.toString()===s){if("string"==typeof i.child&&e[h].hasOwnProperty(i.child)&&null!==e[h][i.child]||this.fields.dataSource instanceof l.DataManager&&e[h].hasOwnProperty("child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[h]);t.isNullOrUndefined(f)&&(f=[]),r=t.isNullOrUndefined(r)?f.length:r;for(a=0,d=n.length;a<d;a++)f.splice(r,0,n[a]),r++}else{u="string"==typeof i.child?i.child:"child";e[h][u]=n}return!0}if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[h]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[h]))){f=t.getValue("child",e[h]);if(void 0!==(o=this.addChildData(f,this.getChildMapper(i),s,n,r)))break}}else{var m=t.getValue(i.child,e[h]);if(void 0!==(o=this.addChildData(m,this.getChildMapper(i),s,n,r)))break}}return o},o.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,l=s.length;n<l;n++){var r=s[n][this.fields.id].toString();r&&-1===this.disableNode.indexOf(r)&&this.disableNode.push(r);var o=this.getElement(r);o&&(o.setAttribute("aria-disabled","true"),t.addClass([o],"e-disable"))}},o.prototype.doEnableAction=function(e){for(var i=this.nodeType(e),s=0,n=i.length;s<n;s++){var l=this.getElement(i[s]),r=i[s];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),l&&(l.removeAttribute("aria-disabled"),t.removeClass([l],"e-disable"))}},o.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[i]?n=e[i]?e[i].toString():null:"object"==typeof e[i]&&(n=e[i]?e[i].getAttribute("data-uid").toString():null),-1==t.indexOf(n)&&t.push(n)}return t},o.prototype.checkValidId=function(e){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(t){return-1!==e.indexOf(t[i.fields.id]?t[i.fields.id].toString():null)});else if(2===this.dataType)for(var s=0;s<this.treeData.length;s++){var n=this.treeData[s][this.fields.id]?this.treeData[s][this.fields.id].toString():null;-1!==e.indexOf(n)&&this.validArr.push(this.treeData[s]);var l=t.getValue(this.fields.child.toString(),this.treeData[s]);l&&this.filterNestedChild(l,e)}return this.validArr},o.prototype.filterNestedChild=function(e,i){for(var s=0;s<e.length;s++){var n=e[s][this.fields.id]?e[s][this.fields.id].toString():null;-1!==i.indexOf(n)&&this.validArr.push(e[s]);var l=t.getValue(this.fields.child.toString(),e[s]);l&&this.filterNestedChild(l,i)}},o.prototype.setTouchClass=function(){var e=t.closest(this.element,".e-bigger");this.touchClass=t.isNullOrUndefined(e)?"":"e-small"},o.prototype.updatePersistProp=function(){this.removeField(this.treeData,this.fields,["selected","expanded"]);for(var e=this.selectedNodes,t=0,i=e.length;t<i;t++)this.updateField(this.treeData,this.fields,e[t],"selected",!0);for(var s=this.expandedNodes,n=0,l=s.length;n<l;n++)this.updateField(this.treeData,this.fields,s[n],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);var r=this.checkedNodes,o=0;for(l=r.length;o<l;o++)this.updateField(this.treeData,this.fields,r[o],"isChecked",!0)}},o.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,r=e.length;n<r;n++){for(var o=0;o<s.length;o++){var a=this.getMapperProp(i,s[o]);t.isNullOrUndefined(e[n][a])||delete e[n][a]}"string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[n]))?this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[n]))&&this.removeField(t.getValue("child",e[n]),this.getChildMapper(i),s):this.removeField(t.getValue(i.child,e[n]),this.getChildMapper(i),s)}},o.prototype.getMapperProp=function(e,i){switch(i){case"selected":return t.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return t.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return t.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return t.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return i}},o.prototype.updateField=function(e,i,s,n,r){if(!t.isNullOrUndefined(s))if(1===this.dataType){var o=this.isNumberTypeId?parseFloat(s):s,a=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.id,"equal",o,!1));t.setValue(this.getMapperProp(i,n),r,a[0])}else this.updateChildField(e,i,s,n,r)},o.prototype.updateChildField=function(e,i,s,n,r,o){var a;if(t.isNullOrUndefined(e))return a;for(var d=0,h=e.length;d<h;d++){var c=t.getValue(i.id,e[d]);if(e[d]&&c&&c.toString()===s)return o?a=e.splice(d,1):(t.setValue(this.getMapperProp(i,n),r,e[d]),a=[]),a;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[d]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[d]))){var p=t.getValue("child",e[d]);if(void 0!==(a=this.updateChildField(p,this.getChildMapper(i),s,n,r,o)))break}}else{var u=t.getValue(i.child,e[d]);if(void 0!==(a=this.updateChildField(u,this.getChildMapper(i),s,n,r,o)))break}}return a},o.prototype.triggerEvent=function(){this.renderReactTemplates();var e={data:this.treeData};this.trigger("dataSourceChanged",e)},o.prototype.wireInputEvents=function(e){t.EventHandler.add(e,"blur",this.inputFocusOut,this)},o.prototype.wireEditingEvents=function(e){var i=this;if(e&&!this.disabled){var s=this;this.touchEditObj=new t.Touch(this.element,{tap:function(e){i.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),s.editingHandler(e.originalEvent))}})}else this.touchEditObj&&this.touchEditObj.destroy()},o.prototype.wireClickEvent=function(e){if(e){var i=this;this.touchClickObj=new t.Touch(this.element,{tap:function(e){i.clickHandler(e)}})}else this.touchClickObj&&this.touchClickObj.destroy()},o.prototype.wireExpandOnEvent=function(e){var i=this;if(e){var s=this;this.touchExpandObj=new t.Touch(this.element,{tap:function(e){("Click"===i.expandOnType||"DblClick"===i.expandOnType&&i.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&s.expandHandler(e)}})}else this.touchExpandObj&&this.touchExpandObj.destroy()},o.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&t.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},o.prototype.preventContextMenu=function(e){e.preventDefault()},o.prototype.wireEvents=function(){t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),t.EventHandler.add(this.element,"focus",this.focusIn,this),t.EventHandler.add(this.element,"blur",this.focusOut,this),t.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),t.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},o.prototype.unWireEvents=function(){t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),t.EventHandler.remove(this.element,"focus",this.focusIn),t.EventHandler.remove(this.element,"blur",this.focusOut),t.EventHandler.remove(this.element,"mouseover",this.onMouseOver),t.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},o.prototype.parents=function(e,i){for(var s=[],n=e.parentNode;!t.isNullOrUndefined(n);)t.matches(n,i)&&s.push(n),n=n.parentNode;return s},o.prototype.isDoubleTapped=function(e){var i,s=e.originalEvent.target;return s&&e.tapCount&&(1===e.tapCount?this.firstTap=t.closest(s,"."+_t):2===e.tapCount&&(i=t.closest(s,"."+_t))),this.firstTap===i},o.prototype.isDescendant=function(e,i){for(var s=i.parentNode;!t.isNullOrUndefined(s);){if(s===e)return!0;s=s.parentNode}return!1},o.prototype.showSpinner=function(e){t.addClass([e],Gt),s.createSpinner({target:e,width:t.Browser.isDevice?16:14},this.createElement),s.showSpinner(e)},o.prototype.hideSpinner=function(e){s.hideSpinner(e),e.innerHTML="",t.removeClass([e],Gt)},o.prototype.setCheckedNodes=function(e){e=JSON.parse(JSON.stringify(e)),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),e.length>0&&this.checkAll(e)},o.prototype.setValidCheckedNode=function(e){if(1===this.dataType){var i=this.fields,s=new l.DataManager(this.treeData).executeLocal((new l.Query).where(i.id,"equal",e,!0));if(s[0]&&(this.setChildCheckState(s,e,s[0]),this.autoCheck)){for(var n=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.getChildNodes(this.treeData,n),o=0,a=0;a<r.length;a++){var d=r[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}o===r.length&&-1===this.checkedNodes.indexOf(n)&&n&&this.checkedNodes.push(n)}}else if(2===this.dataType)for(var h=0;h<this.treeData.length;h++){if((this.treeData[h][this.fields.id]?this.treeData[h][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkedNodes.push(e);break}var c=t.getValue(this.fields.child.toString(),this.treeData[h]);c&&this.setChildCheckState(c,e,this.treeData[h])}},o.prototype.setChildCheckState=function(e,i,s){var n,l=0;if(1===this.dataType){s&&(n=s[this.fields.id]?s[this.fields.id].toString():null);for(var r=0;r<e.length;r++){var o=e[r][this.fields.id]?e[r][this.fields.id].toString():null;s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(o)&&this.checkedNodes.push(o),o===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);(d=this.getChildNodes(this.treeData,o))&&this.setChildCheckState(d,i,s)}}else{s&&(n=s[this.fields.id]?s[this.fields.id].toString():"");for(r=0;r<e.length;r++){var a=e[r][this.fields.id]?e[r][this.fields.id].toString():"";s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(a)&&this.checkedNodes.push(a),a===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i);var d;(d=t.getValue(this.fields.child.toString(),e[r]))&&this.setChildCheckState(d,i,e[r]),-1!==this.checkedNodes.indexOf(a)&&this.autoCheck&&l++,l===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkedNodes.push(n)}}},o.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[t])},o.prototype.updatePosition=function(e,t,i,s){if(1===this.dataType){var n=this.getDataPos(this.treeData,this.fields,e);if(this.treeData.splice(n,1,t),i){this.removeChildNodes(e);for(var l=0;l<s.length;l++)this.treeData.splice(n,0,s[l]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},o.prototype.updateChildPosition=function(e,i,s,n,r){for(var o,a=0,d=e.length;a<d;a++){var h=t.getValue(i.id,e[a]);if(e[a]&&h&&h.toString()===s)return e[a]=n[0],!0;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[a]))){if(this.fields.dataSource instanceof l.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[a]))){var c=t.getValue("child",e[a]);if(void 0!==(o=this.updateChildPosition(c,this.getChildMapper(i),s,n,r)))break}}else{var p=t.getValue(i.child,e[a]);if(void 0!==(o=this.updateChildPosition(p,this.getChildMapper(i),s,n,r)))break}}return o},o.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},o.prototype.crudOperation=function(e,i,s,n,l,r,o){var a,d=this,h=this.fields.dataSource,c=[],p=this.getQuery(this.fields),u=this.fields.id,f={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];i?m=this.nodeType(i):s&&("string"==typeof s?m[0]=s.toString():"object"==typeof s&&(m[0]=s.getAttribute("data-uid").toString()));for(var v=0,g=m.length;v<g;v++){var y=this.getElement(m[v]);if(!t.isNullOrUndefined(y)){var b=this.getNodeObject(m[v]);c.push(b)}}switch(e){case"delete":1==i.length?a=h.remove(u,c[0],p.fromTable,p):(f.deletedRecords=c,a=h.saveChanges(f,u,p.fromTable,p)),a.then(function(e){return d.deleteSuccess(m)}).catch(function(e){return d.dmFailure(e)});break;case"update":c[0][this.fields.text]=n,(a=h.update(u,c[0],p.fromTable,p)).then(function(e){return d.editSucess(s,n,o)}).catch(function(e){return d.dmFailure(e,s,o)});break;case"insert":if(1==l.length)a=h.insert(l[0],p.fromTable,p);else{var C=[];for(v=0,g=l.length;v<g;v++)C.push(l[v]);f.addedRecords=C,a=h.saveChanges(f,u,p.fromTable,p)}a.then(function(e){var t=d.getElement(s);d.addSuccess(l,t,r),d.preventExpand=!1}).catch(function(e){return d.dmFailure(e)})}},o.prototype.deleteSuccess=function(e){for(var i=0,s=e.length;i<s;i++){var n=this.getElement(e[i]);t.isNullOrUndefined(n)||this.removeNode(n)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent()},o.prototype.editSucess=function(e,i,s){var n=this.getElement(e),l=t.select("."+zt,n);this.appendNewText(n,l,i,s)},o.prototype.addSuccess=function(e,t,i){var s,n=t?t.querySelector("."+Jt):null,l=this;t&&n&&n.classList.contains(Vt)&&null===t.querySelector("."+Kt)?l.renderChildNodes(t,null,function(){s=t.querySelector("."+Kt),l.addGivenNodes(e,t,i,!0,s),l.triggerEvent()}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent())},o.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},o.prototype.updatePreviousText=function(e,i){var s=this.getElement(e),n=t.select("."+zt,s);this.updateText(s,n,this.oldText,i)},o.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"allowDragAndDrop":this.setDragAndDrop(this.allowDragAndDrop);break;case"dragArea":this.allowDragAndDrop&&(this.dragObj.dragArea=this.dragArea);break;case"allowEditing":this.wireEditingEvents(this.allowEditing);break;case"allowMultiSelection":if(this.selectedNodes.length>1){var l=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(l,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=i.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(i.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:t.isNullOrUndefined(e.expandedNodes)?[]:e.expandedNodes},!0),this.doExpandAction(),this.isInitalExpand=!1,this.isAnimate=!0;break;case"expandOn":this.wireExpandOnEvent(!1),this.setExpandOnType(),"None"===this.expandOnType||this.disabled||this.wireExpandOnEvent(!0);break;case"disabled":this.setDisabledMode(),this.dynamicState();break;case"fields":this.isAnimate=!1,this.isFieldChange=!0,this.initialRender=!0,this.reRenderNodes(),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),o=0;o<r.length;)"true"!==r[o].getAttribute("aria-expanded")&&this.renderChildNodes(r[o],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}}},o.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.element.removeAttribute("tabindex"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),e.prototype.destroy.call(this)},o.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var r=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof l.DataManager)this.isOffline?this.addSuccess(e,r,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,r,s);else{if(r)this.addGivenNodes(e,r,s);else{e=this.getSortedData(e);for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.parentID,e[o]);r=a?this.getElement(a.toString()):a,this.addGivenNodes([e[o]],r,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&r&&this.ensureParentCheckState(r),this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent())}},o.prototype.beginEdit=function(e){var i=this.getElement(e);t.isNullOrUndefined(i)||this.disabled||this.createTextbox(i,null)},o.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},o.prototype.collapseAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.collapseByLevel(t.select("."+Kt,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,Wt,!1)},o.prototype.disableNodes=function(e){t.isNullOrUndefined(e)||this.doDisableAction(e)},o.prototype.enableNodes=function(e){t.isNullOrUndefined(e)||this.doEnableAction(e)},o.prototype.ensureVisible=function(e){var i=this.getElement(e);if(!t.isNullOrUndefined(i)){var s=this.parents(i,"."+_t);this.expandAll(s),setTimeout(function(){i.scrollIntoView(!0)},450)}},o.prototype.expandAll=function(e,i,s){t.isNullOrUndefined(e)?i>0?this.expandByLevel(t.select("."+Kt,this.element),i,s):this.expandAllNodes(s):this.doGivenAction(e,Vt,!0)},o.prototype.getAllCheckedNodes=function(){return this.checkedNodes},o.prototype.getDisabledNodes=function(){return this.disableNode},o.prototype.getNode=function(e){var t=this.getElement(e);return this.getNodeData(t,!0)},o.prototype.getTreeData=function(e){var i=this.getId(e);if(this.updatePersistProp(),t.isNullOrUndefined(i))return this.treeData;var s=this.getNodeObject(i);return t.isNullOrUndefined(s)?[]:[s]},o.prototype.moveNodes=function(e,i,s,n){var r=this.getElement(i);if(!t.isNullOrUndefined(r)){for(var o=0;o<e.length;o++){var a=this.getElement(e[o]);t.isNullOrUndefined(a)||r.isSameNode(a)||this.isDescendant(a,r)||(this.preventExpand=n,this.dropAsChildNode(a,r,this,s))}this.fields.dataSource instanceof l.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent()}},o.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n,l=!1;if(1==this.dataType&&s.length>1)l=!0;else if(2==this.dataType&&1===s.length){var r=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(r)||(l=!0)}var o=this.getElement(e);n=o?o.getAttribute("data-uid"):e?e.toString():null,this.refreshData=this.getNodeObject(n),s=JSON.parse(JSON.stringify(s));var a,d;if(1==this.dataType&&l){for(var h=0;h<s.length;h++)if(t.isNullOrUndefined(s[h][this.fields.parentID])){d=s[h],s.splice(h,1);break}a=t.extend({},this.refreshData,d)}else a=t.extend({},this.refreshData,s[0]);if(t.isNullOrUndefined(o))this.updatePosition(n,a,l,s);else{this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[a],this.listBaseOption,c),u=t.select("."+Kt,o),f=t.getValue(this.fields.child.toString(),a);if(l&&u||l&&!t.isNullOrUndefined(f)){var m=o.parentElement,v=Array.prototype.indexOf.call(m.childNodes,o);t.remove(o),m.insertBefore(p[0],m.childNodes[v]),this.updatePosition(n,a,l,s),l&&u&&this.expandAll([n])}else{var g=t.select("."+Zt,o),y=t.select("."+Zt,p[0]),b=t.select("div."+Jt,g),C=t.select("div."+Jt,y);b&&C&&(C.classList.contains(Vt)&&b.classList.contains(Wt)?(t.removeClass([C],Vt),t.addClass([C],Wt)):C.classList.contains(Wt)&&b.classList.contains(Vt)?(t.removeClass([C],Wt),t.addClass([C],Vt)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(g);var x=t.select("."+li,o);x.parentNode.insertBefore(y,x.nextSibling),this.updatePosition(n,a,l,s)}if(o=this.getElement(e),a[this.fields.tooltip]&&o.setAttribute("title",a[this.fields.tooltip]),a.hasOwnProperty(this.fields.htmlAttributes)&&a[this.fields.htmlAttributes]){var E={};t.merge(E,a[this.fields.htmlAttributes]),E.class?(t.addClass([o],E.class.split(" ")),delete E.class):t.attributes(o,E)}-1!==this.selectedNodes.indexOf(n)&&(o.setAttribute("aria-selected","true"),t.addClass([o],Xt)),this.isRefreshed=!1,this.triggerEvent()}}},o.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof l.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},o.prototype.updateNode=function(e,i){var s=this;if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i)&&this.allowEditing){var n=this.getElement(e);if(!t.isNullOrUndefined(n)){var r=t.select("."+zt,n);this.updateOldText(n);var o=this.getEditEvent(n,null,null);this.trigger("nodeEditing",o,function(t){t.cancel||(s.fields.dataSource instanceof l.DataManager&&!s.isOffline?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,r,i,!1))})}}},o.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var a;return qt([t.Property(!1)],o.prototype,"allowDragAndDrop",void 0),qt([t.Property(!1)],o.prototype,"allowEditing",void 0),qt([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),qt([t.Property(!1)],o.prototype,"allowTextWrap",void 0),qt([t.Complex({},yi)],o.prototype,"animation",void 0),qt([t.Property()],o.prototype,"checkedNodes",void 0),qt([t.Property("")],o.prototype,"cssClass",void 0),qt([t.Property(!1)],o.prototype,"disabled",void 0),qt([t.Property(null)],o.prototype,"dragArea",void 0),qt([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),qt([t.Property(!1)],o.prototype,"enablePersistence",void 0),qt([t.Property()],o.prototype,"expandedNodes",void 0),qt([t.Property("Auto")],o.prototype,"expandOn",void 0),qt([t.Complex({},vi)],o.prototype,"fields",void 0),qt([t.Property(!0)],o.prototype,"fullRowSelect",void 0),qt([t.Property(!0)],o.prototype,"loadOnDemand",void 0),qt([t.Property()],o.prototype,"locale",void 0),qt([t.Property()],o.prototype,"nodeTemplate",void 0),qt([t.Property()],o.prototype,"selectedNodes",void 0),qt([t.Property("None")],o.prototype,"sortOrder",void 0),qt([t.Property(!1)],o.prototype,"showCheckBox",void 0),qt([t.Property(!0)],o.prototype,"autoCheck",void 0),qt([t.Property(!1)],o.prototype,"fullRowNavigable",void 0),qt([t.Event()],o.prototype,"actionFailure",void 0),qt([t.Event()],o.prototype,"created",void 0),qt([t.Event()],o.prototype,"dataBound",void 0),qt([t.Event()],o.prototype,"dataSourceChanged",void 0),qt([t.Event()],o.prototype,"drawNode",void 0),qt([t.Event()],o.prototype,"destroyed",void 0),qt([t.Event()],o.prototype,"keyPress",void 0),qt([t.Event()],o.prototype,"nodeChecked",void 0),qt([t.Event()],o.prototype,"nodeChecking",void 0),qt([t.Event()],o.prototype,"nodeClicked",void 0),qt([t.Event()],o.prototype,"nodeCollapsed",void 0),qt([t.Event()],o.prototype,"nodeCollapsing",void 0),qt([t.Event()],o.prototype,"nodeDragging",void 0),qt([t.Event()],o.prototype,"nodeDragStart",void 0),qt([t.Event()],o.prototype,"nodeDragStop",void 0),qt([t.Event()],o.prototype,"nodeDropped",void 0),qt([t.Event()],o.prototype,"nodeEdited",void 0),qt([t.Event()],o.prototype,"nodeEditing",void 0),qt([t.Event()],o.prototype,"nodeExpanded",void 0),qt([t.Event()],o.prototype,"nodeExpanding",void 0),qt([t.Event()],o.prototype,"nodeSelected",void 0),qt([t.Event()],o.prototype,"nodeSelecting",void 0),o=a=qt([t.NotifyPropertyChanges],o)}(t.Component),Ci=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),xi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Ei="e-close",Ni="e-open",Ii="e-transition",Si="e-right",Oi="e-over",wi="e-push",ki="e-visibility",Li="e-disable-animation",Ai="e-sidebar-context",Pi="e-sidebar-absolute",Di=function(e){function i(t,i){return e.call(this,t,i)||this}return Ci(i,e),i.prototype.preRender=function(){this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.setEnableRTL=function(){(this.enableRtl?t.addClass:t.removeClass)([this.element],"e-rtl")},i.prototype.setTarget=function(){this.targetEle=this.element.nextElementSibling,this.sidebarEleCopy=this.element.cloneNode(!0),"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),this.target&&(this.target.insertBefore(this.element,this.target.children[0]),t.addClass([this.element],Pi),t.addClass([this.target],Ai),this.targetEle=this.getTargetElement())},i.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!t.isNullOrUndefined(e)&&e.classList.contains("e-sidebar");)e=e.nextElementSibling;return e},i.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?t.EventHandler.add(document,"mousedown touchstart",this.documentclickHandler,this):t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler)},i.prototype.setWidth=function(){this.enableDock&&"Left"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock&&"Right"===this.position?t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||t.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},i.prototype.setDimension=function(e){return e="number"==typeof e?t.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:t.formatUnit(e):"100%"},i.prototype.setZindex=function(){t.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},i.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&t.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");t.isNullOrUndefined(e||this.targetEle)||t.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.enableDock||"Auto"===this.type||t.addClass([this.element],[ki]),t.removeClass([this.element],[Ni,Ei,Si,"e-left","e-slide",wi,Oi]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?Si:"e-left"),this.enableDock&&t.addClass([this.element],"e-dock"),this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||t.Browser.isDevice?this.isOpen||t.addClass([this.element],Ei):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Ei)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,t.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},i.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e?t.removeClass([e],"e-backdrop"):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},i.prototype.hide=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Ei))return;i.element.classList.contains(Ni)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Ei),t.removeClass([i.element],Ni),t.setStyleAttribute(i.element,{width:t.formatUnit(i.enableDock?i.dockSize:i.width)}),i.setType(i.type);var s=document.querySelector(".e-main-content")||i.targetEle;!i.enableDock&&s&&(s.style.transform="translateX(0px)",s.style["Left"===i.position?"marginLeft":"marginRight"]="0px"),i.destroyBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.remove("e-sidebar-overflow"),i.setProperties({isOpen:!1},!0),i.enableDock&&setTimeout(function(){return i.setTimeOut()},50),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(Ni)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(Ei)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],ki),i.element.classList.contains(Ni))return;i.element.classList.contains(Ei)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[Ni,Ii]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Ei),t.setStyleAttribute(i.element,{width:t.formatUnit(i.width)}),i.setType(i.type),i.createBackDrop(),i.setAnimation(),"Slide"===i.type&&document.body.classList.add("e-sidebar-overflow"),i.setProperties({isOpen:!0},!0),t.EventHandler.add(i.element,"transitionend",i.transitionEnd,i)}})},i.prototype.setAnimation=function(){this.animate?t.removeClass([this.element],Li):t.addClass([this.element],Li)},i.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},i.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?t.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&t.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(Ei)&&this.enableDock&&t.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},i.prototype.createBackDrop=function(){if(this.target&&this.showBackdrop&&this.getState()){var e=document.querySelector(".e-main-content")||this.targetEle;t.addClass([e],"e-backdrop")}else this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className="e-sidebar-overlay",this.modal.style.display="block",document.body.appendChild(this.modal))},i.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},i.prototype.getModuleName=function(){return"sidebar"},i.prototype.toggle=function(){this.element.classList.contains(Ni)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(Ni)},i.prototype.setMediaQuery=function(){if(this.mediaQuery){("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery).matches:this.mediaQuery.matches)&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide()}},i.prototype.resize=function(){"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],Oi):t.addClass([this.element],wi)),this.setMediaQuery(),t.Browser.isDevice&&(this.windowWidth=window.innerWidth)},i.prototype.documentclickHandler=function(e){t.closest(e.target,".e-control.e-sidebar")||this.hide(e)},i.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&e.distanceX>=50&&e.velocity>=.5?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection?this.hide():this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide():!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&e.distanceX>=50&&e.velocity>=.5&&this.show()},i.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new t.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new t.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},i.prototype.wireEvents=function(){this.setEnableGestures(),t.EventHandler.add(window,"resize",this.resize,this)},i.prototype.unWireEvents=function(){t.EventHandler.remove(window,"resize",this.resize),t.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},i.prototype.onPropertyChanged=function(i,s){for(var n=document.querySelector(".e-main-content")||this.targetEle,l=this.isServerRendered,r=0,o=Object.keys(i);r<o.length;r++){switch(o[r]){case"isOpen":this.isOpen?this.show():this.hide();break;case"width":this.setWidth(),this.getState()||this.setDock();break;case"animate":this.setAnimation();break;case"type":this.checkType(!1),t.removeClass([this.element],[ki]),this.addClass(),t.addClass([this.element],"Auto"===this.type?t.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),n&&(n.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(t.removeClass([this.element],"e-left"),t.addClass([this.element],Si)):(t.removeClass([this.element],Si),t.addClass([this.element],"e-left")),this.setType(this.type);break;case"showBackdrop":this.showBackdrop?this.createBackDrop():this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null);break;case"target":"string"==typeof this.target&&this.setProperties({target:document.querySelector(this.target)},!0),t.isNullOrUndefined(this.target)&&(t.removeClass([this.element],Pi),t.removeClass([s.target],Ai),t.setStyleAttribute(n,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,e.prototype.refresh.call(this),this.isServerRendered=l;break;case"closeOnDocumentClick":this.setCloseOnDocumentClick();break;case"enableDock":this.getState()||this.setDock();break;case"zIndex":this.setZindex();break;case"mediaQuery":this.setMediaQuery();break;case"enableGestures":this.setEnableGestures();break;case"enableRtl":this.setEnableRTL()}}},i.prototype.setType=function(e){var i=this.element.getBoundingClientRect().width;this.setZindex();var s=document.querySelector(".e-main-content")||this.targetEle;s&&(s.style.transform="translateX(0px)",t.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),l="Left"===this.position?i:-i;switch(t.removeClass([this.element],[wi,Oi,"e-slide"]),e){case"Push":t.addClass([this.element],[wi]),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style.transform="translateX("+l+"px)");break;case"Over":t.addClass([this.element],[Oi]),this.enableDock&&(this.element.classList.contains(Ei)||this.isOpen)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":t.addClass([this.element],[Ii]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],wi)):t.addClass([this.element],Oi):(t.addClass([this.element],wi),s&&(this.enableDock||this.element.classList.contains(Ni))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n)),this.createBackDrop()}},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.target&&t.removeClass([this.target],Ai),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[Ni,Ei,wi,"e-slide",Oi,"e-left",Si,Ii]),t.removeClass([this.element],Pi),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",t.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var i=document.querySelector(".e-main-content")||this.targetEle;t.isNullOrUndefined(i)||(i.style.margin="",i.style.transform=""),this.unWireEvents()},xi([t.Property("auto")],i.prototype,"dockSize",void 0),xi([t.Property(null)],i.prototype,"mediaQuery",void 0),xi([t.Property(!1)],i.prototype,"enableDock",void 0),xi([t.Property("en-US")],i.prototype,"locale",void 0),xi([t.Property(!1)],i.prototype,"enablePersistence",void 0),xi([t.Property(!0)],i.prototype,"enableGestures",void 0),xi([t.Property(!1)],i.prototype,"isOpen",void 0),xi([t.Property(!1)],i.prototype,"enableRtl",void 0),xi([t.Property(!0)],i.prototype,"animate",void 0),xi([t.Property("auto")],i.prototype,"height",void 0),xi([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),xi([t.Property("Left")],i.prototype,"position",void 0),xi([t.Property(null)],i.prototype,"target",void 0),xi([t.Property(!1)],i.prototype,"showBackdrop",void 0),xi([t.Property("Auto")],i.prototype,"type",void 0),xi([t.Property("auto")],i.prototype,"width",void 0),xi([t.Property(1e3)],i.prototype,"zIndex",void 0),xi([t.Event()],i.prototype,"created",void 0),xi([t.Event()],i.prototype,"close",void 0),xi([t.Event()],i.prototype,"open",void 0),xi([t.Event()],i.prototype,"change",void 0),xi([t.Event()],i.prototype,"destroyed",void 0),i=xi([t.NotifyPropertyChanges],i)}(t.Component),Ti=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Mi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Hi="e-icon-right",Ui="e-breadcrumb-text",Ri="e-breadcrumb-icon",Bi="e-breadcrumb-menu",ji="e-breadcrumb-item",qi="e-breadcrumb-popup",Fi="e-breadcrumb-wrap-mode",Wi="e-breadcrumb-scroll-mode",Vi="e-disabled",_i="aria-disabled",zi=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ti(i,e),Mi([t.Property("")],i.prototype,"text",void 0),Mi([t.Property("")],i.prototype,"url",void 0),Mi([t.Property(null)],i.prototype,"iconCss",void 0),Mi([t.Property(!1)],i.prototype,"disabled",void 0),i}(t.ChildProperty),Ki=function(e){function n(t,i){return e.call(this,t,i)||this}return Ti(n,e),n.prototype.preRender=function(){},n.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},n.prototype.initialize=function(){this._maxItems=this.maxItems,this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&t.addClass([this.element],this.cssClass.split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(Vi),this.element.setAttribute(_i,"true")),"Wrap"===this.overflowMode?this.element.classList.add(Fi):"Scroll"===this.overflowMode&&this.element.classList.add(Wi),this.initItems(),this.initPvtProps()},n.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&this._maxItems>0&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(this._maxItems>=0?(this.startIndex=this._maxItems>1?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},n.prototype.getEndIndex=function(){var e,t=this;return this.activeItem?this.items.forEach(function(i,s){i.url!==t.activeItem&&i.text!==t.activeItem||(e=s)}):e=this.items.length-1,e},n.prototype.initItems=function(){if(!this.items.length){var e=void 0,t=void 0,i=[];if(this.url){var s=new URL(this.url,window.location.origin);e=s.origin+"/",t=s.href.split(e)[1].split("/")}else e=window.location.origin+"/",t=window.location.href.split(e)[1].split("/");i.push({iconCss:"e-icons e-home",url:e});for(var n=0;n<t.length;n++)t[n]&&(i.push({text:t[n],url:e+t[n]}),e+=t[n]+"/");this.setProperties({items:i},!0)}},n.prototype.renderItems=function(e){var s,n,l=this,r=this.element.classList.contains(Hi),o=e.length;if(o){var a,d=void 0,h=void 0,c=0,p=void 0,u=2*o-1,f=!1,m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),v=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),g=this.hasField(e,"iconCss"),y="Collapsed"===this.overflowMode&&this._maxItems>0&&o>this._maxItems&&!this.isExpanded,b="Hidden"===this.overflowMode&&this._maxItems>0;"Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML="");for(var C={moduleName:this.getModuleName(),showIcon:g,itemNavigable:!0,itemCreated:function(e){var i=e.curData.isLastItem;i&&e.item.children.length&&!l.itemTemplate&&(delete e.curData.isLastItem,a||l.enableActiveItemNavigation||(e.item.innerHTML=l.createElement("span",{className:Ui,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||l.itemTemplate||e.item.classList.add("e-icon-item"),b&&e.item.setAttribute("item-index",c.toString());var s={item:t.extend({},e.curData.properties?e.curData.properties:e.curData),element:e.item,cancel:!1};l.trigger("beforeItemRender",s),f=s.cancel;var n=r||s.element.classList.contains(Hi);n&&e.curData.iconCss&&!l.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector("."+Ri)),s.item.disabled&&(e.item.setAttribute(_i,"true"),e.item.classList.add(Vi)),(s.item.disabled||l.disabled)&&e.item.children.length&&!l.itemTemplate&&e.item.children[0].setAttribute("tabindex","-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),!(!i||i&&l.enableActiveItemNavigation)||s.item.disabled||l.disabled||(e.item.children[0].setAttribute("tabindex","0"),t.EventHandler.add(e.item.children[0],"keydown",l.keyDownHandler,l))),i&&e.item.setAttribute("data-active-item",""),l.itemTemplate||l.beforeItemRenderChanges(e.curData,s.item,e.item,n)}},x=0;x<u;x%2&&c++,x++)if(d=this.activeItem&&(this.activeItem===e[c].url||this.activeItem===e[c].text),!(y&&x>1&&x<u-2)&&(!b||!(c<this.startIndex||c>this.endIndex)||x%2&&c===this.startIndex-1||0===c)){x%2?(p=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),C.template=this.separatorTemplate?this.separatorTemplate:"/",C.itemClass="e-breadcrumb-separator",n=!1,s=[{previousItem:e[c],nextItem:e[c+1]}]):(C.itemClass="",this.itemTemplate?(C.template=this.itemTemplate,n=!1):n=!0,(s=[t.extend({},e[c].properties?e[c].properties:e[c])])[0].url||this.itemTemplate||(s=[t.extend({},s[0],{isEmptyUrl:!0,url:"#"})]),h=(b||"Menu"===this.overflowMode)&&c===this.endIndex,((x===u-1||h)&&!this.itemTemplate||d)&&(s[0].isLastItem=!0));var E=m,N=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(c>=this.startIndex&&c<=N&&(!(x%2)||c!==N)&&this.endIndex>=this._maxItems&&this._maxItems>0||0===this._maxItems)){if(x%2)continue;E=this.popupUl,h&&(a=!0)}else"Wrap"===this.overflowMode&&(E=0===x?v:p);var I=i.ListBase.createList(this.createElement,s,C,n,this).childNodes;if(f){if(b||y||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(c,1),this.initPvtProps(),this.reRenderItems();(x===u-1||h)&&t.remove(E.lastElementChild)}else t.append(I,E);if("Wrap"===this.overflowMode&&0!==x&&x%2==0&&m.appendChild(p),y&&1===x){var S=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}});t.EventHandler.add(S,"keyup",this.expandHandler,this),m.appendChild(S)}if("Menu"===this.overflowMode&&this.startIndex===x&&this.endIndex>=this._maxItems&&this._maxItems>=0){var O=this.getMenuElement();t.EventHandler.add(O,"keyup",this.keyDownHandler,this),m.appendChild(O)}if(d||h)break;f&&x++}this.isReact&&this.renderReactTemplates(),"Wrap"===this.overflowMode&&this.element.appendChild(v),this.element.appendChild(m),this.calculateMaxItems()}},n.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e=void 0,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);if("Menu"===this.overflowMode){var l=this.getMenuElement();this.element.appendChild(l),n+=l.offsetWidth,t.remove(l)}for(var r=0;r<s.length-2;r++){if(n>i){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(this.maxItems>-1&&-1==e)||-1==this.maxItems)&&this._maxItems!=e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth)>i)return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(Bi)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&this._maxItems>0){i=0;if((s=this.element.querySelectorAll("."+ji)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},n.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][t])return!0;return!1},n.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},n.prototype.beforeItemRenderChanges=function(e,i,s,n){var l=s.querySelector(".e-anchor-wrap");if(i.text!==e.text&&l.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=i.text)}),i.iconCss!==e.iconCss&&l){var r=s.querySelector("."+Ri);if(r)i.iconCss?(t.removeClass([r],e.iconCss.split(" ")),t.addClass([r],i.iconCss.split(" "))):t.remove(r);else if(i.iconCss){var o=this.createElement("span",{className:Ri+" "+i.iconCss});n?t.append([o],l):l.insertBefore(o,l.childNodes[0])}}if(i.url!==e.url&&this.enableNavigation){var a=s.querySelector("a."+Ui);a&&(i.url?a.setAttribute("href",i.url):a.removeAttribute("href"))}},n.prototype.reRenderItems=function(){this.element.innerHTML="",this.renderItems(this.items)},n.prototype.clickHandler=function(e){var i=t.closest(e.target,"."+ji+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),i&&(t.closest(e.target,"."+Ui)||this.itemTemplate)){var s=void 0;s="Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll("."+ji)).indexOf(i):[].slice.call(i.parentElement.children).indexOf(i),"Menu"===this.overflowMode?t.closest(e.target,"."+qi)?(s+=this.startIndex,this.endIndex=s,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector("."+Bi)?s>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector("."+Bi))?(s+=2*this.popupUl.childElementCount-2,s=Math.floor(s/2),this.endIndex=s):this.startIndex=this.endIndex=s:(s=Math.floor(s/2),this.startIndex=this.endIndex=s):s=Math.floor(s/2),"Hidden"===this.overflowMode&&this._maxItems>0&&0!==this.endIndex&&(s=parseInt(i.getAttribute("item-index"),10),this.startIndex>1&&(this.startIndex-=this.endIndex-s),this.endIndex=s),this.trigger("itemClick",{element:i,item:this.items[s],event:e}),this.activeItem=this.items[s].url||this.items[s].text,this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(Bi)&&this.renderPopup()},n.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:qi+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.popupObj=new s.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector("."+Bi),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},n.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!t.closest(e.target,"."+Bi)&&(this.popupObj.hide(),this.popupObj.destroy(),t.detach(this.popupObj.element))},n.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},n.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},n.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},n.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},n.prototype.onPropertyChanged=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){switch(n[s]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===i.overflowMode?this.element.classList.remove(Fi):"Wrap"===e.overflowMode&&this.element.classList.add(Fi),"Scroll"===i.overflowMode?this.element.classList.remove(Wi):"Scroll"===e.overflowMode&&this.element.classList.add(Wi);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":i.cssClass&&t.removeClass([this.element],i.cssClass.split(" ")),e.cssClass&&t.addClass([this.element],e.cssClass.split(" ")),(i.cssClass&&i.cssClass.indexOf(Hi)>-1&&!(e.cssClass&&e.cssClass.indexOf(Hi)>-1)||!(i.cssClass&&i.cssClass.indexOf(Hi)>-1)&&e.cssClass&&e.cssClass.indexOf(Hi)>-1)&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(Vi),this.element.setAttribute(_i,e.disabled+"")}}},n.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),t.EventHandler.add(document,"click",this.delegateClickHanlder,this),t.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},n.prototype.popupWireEvents=function(){t.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),t.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},n.prototype.unWireEvents=function(){t.EventHandler.remove(document,"click",this.delegateClickHanlder),t.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(t.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),t.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},n.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},n.prototype.getModuleName=function(){return"breadcrumb"},n.prototype.destroy=function(){var i=this,s=[],n=["aria-label"];this.cssClass&&s.concat(this.cssClass.split(" ")),this.enableRtl&&s.push("e-rtl"),this.disabled&&(s.push(Vi),n.push(_i)),"Wrap"===this.overflowMode?s.push(Fi):"Scroll"===this.overflowMode&&s.push(Wi),this.unWireEvents(),this.element.innerHTML="",t.removeClass([this.element],s),n.forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Mi([t.Property("")],n.prototype,"url",void 0),Mi([t.Collection([],zi)],n.prototype,"items",void 0),Mi([t.Property("")],n.prototype,"activeItem",void 0),Mi([t.Property(-1)],n.prototype,"maxItems",void 0),Mi([t.Property("Menu")],n.prototype,"overflowMode",void 0),Mi([t.Property("")],n.prototype,"cssClass",void 0),Mi([t.Property(null)],n.prototype,"itemTemplate",void 0),Mi([t.Property("/")],n.prototype,"separatorTemplate",void 0),Mi([t.Property(!0)],n.prototype,"enableNavigation",void 0),Mi([t.Property(!1)],n.prototype,"enableActiveItemNavigation",void 0),Mi([t.Property(!1)],n.prototype,"disabled",void 0),Mi([t.Property("")],n.prototype,"locale",void 0),Mi([t.Event()],n.prototype,"beforeItemRender",void 0),Mi([t.Event()],n.prototype,"itemClick",void 0),Mi([t.Event()],n.prototype,"created",void 0),n=Mi([t.NotifyPropertyChanges],n)}(t.Component),Yi=function(){var e=function(t,i){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(t,i)};return function(t,i){function s(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(s.prototype=i.prototype,new s)}}(),Xi=function(e,t,i,s){var n,l=arguments.length,r=l<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(r=(l<3?n(r):l>3?n(t,i,r):n(t,i))||r);return l>3&&r&&Object.defineProperty(t,i,r),r},Gi="e-carousel",Qi="e-active",Ji="e-carousel-items",Zi="e-carousel-item",$i="e-previous",es="e-carousel-navigators",ts="e-carousel-indicators",is="e-indicator-bar",ss="e-play-pause",ns="e-play-icon",ls="e-pause-icon",rs="e-previous-button",os="e-next-button",as="e-play-button",ds="e-hover-arrows",hs="e-carousel-hover",cs="e-template",ps="e-carousel-slide-animation",us="e-carousel-fade-animation",fs="e-carousel-custom-animation",ms="e-carousel-animation-none",vs="e-transition-start",gs="e-transition-end",ys=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Yi(i,e),Xi([t.Property()],i.prototype,"cssClass",void 0),Xi([t.Property()],i.prototype,"interval",void 0),Xi([t.Property()],i.prototype,"template",void 0),Xi([t.Property()],i.prototype,"htmlAttributes",void 0),i}(t.ChildProperty),bs=function(e){function i(t,i){return e.call(this,t,i)||this}return Yi(i,e),i.prototype.getModuleName=function(){return Gi.replace("e-","")},i.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},i.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new t.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},i.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},i.prototype.onPropertyChanged=function(e,i){for(var s,n=0,l=Object.keys(e);n<l.length;n++){switch(l[n]){case"animationEffect":this.applyAnimation();break;case"cssClass":t.classList(this.element,[e.cssClass],[i.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,i.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector("."+Ji)&&this.renderTouchActions();break;case"loop":this.loop&&t.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex);break;case"enableRtl":this.enableRtl?t.addClass([this.element],"e-rtl"):t.removeClass([this.element],"e-rtl");break;case"buttonsVisibility":if(s=this.element.querySelector("."+es))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),t.remove(s);break;case"VisibleOnHover":t.addClass([].slice.call(s.childNodes),ds);break;case"Visible":t.removeClass([].slice.call(s.childNodes),ds)}else this.renderNavigators(),this.renderPlayButton();break;case"width":t.setStyleAttribute(this.element,{width:t.formatUnit(this.width)});break;case"height":t.setStyleAttribute(this.element,{height:t.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&t.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":s=this.element.querySelector("."+ts),!this.showIndicators&&s&&(this.resetTemplates(["indicatorsTemplate"]),t.remove(s)),this.renderIndicators();break;case"showPlayButton":s=this.element.querySelector("."+ss),!this.showPlayButton&&s&&(t.remove(s),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":(s=this.element.querySelector("."+Ji))&&(this.resetTemplates(["itemTemplate"]),t.remove(s)),this.renderSlides()}}},i.prototype.initialize=function(){var e=[];this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push("e-rtl"),t.addClass([this.element],e),t.setStyleAttribute(this.element,{width:t.formatUnit(this.width),height:t.formatUnit(this.height)}),t.attributes(this.element,{tabindex:"0","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),t.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},i.prototype.renderSlides=function(){var e=this,t=this.createElement("div",{className:Ji,attrs:{"aria-live":this.autoPlay?"off":"polite"}});this.element.appendChild(t),this.items.length>0?(this.slideItems=this.items,this.items.forEach(function(i,s){e.renderSlide(i,i.template,s,t)})):this.dataSource.length>0&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(i,s){e.renderSlide(i,e.itemTemplate,s,t)})),this.renderTemplates(),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},i.prototype.renderSlide=function(e,i,s,n){var l=this.createElement("div",{id:t.getUniqueID("carousel_item"),className:Zi+" "+(e.cssClass?e.cssClass:"")+" "+(this.selectedIndex===s?Qi:""),attrs:{"aria-hidden":this.selectedIndex===s?"false":"true","data-index":s.toString(),"aria-role":"group","aria-roledescription":"slide"}});t.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,l);var r=this.element.id+"_template",o=this.templateParser(i)(e,this,"itemTemplate",r,!1);t.append(o,l),n.appendChild(l)},i.prototype.renderNavigators=function(){if("Hidden"!==this.buttonsVisibility){var e=this.createElement("div",{className:es});this.element.querySelector("."+Ji).insertAdjacentElement("afterend",e),this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next"),this.renderTemplates()}},i.prototype.renderNavigatorButton=function(e){var i=this.createElement("div",{className:("Previous"===e?$i:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?ds:""),attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide")}});if("Previous"===e&&this.previousButtonTemplate){t.addClass([i],cs);var s=this.element.id+"_previousButtonTemplate",l=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",s,!1);t.append(l,i)}else if("Next"===e&&this.nextButtonTemplate){t.addClass([i],cs);s=this.element.id+"_nextButtonTemplate",l=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",s,!1);t.append(l,i)}else{var r=this.createElement("button");new n.Button({cssClass:"e-flat e-round "+("Previous"===e?rs:os),iconCss:"e-icons "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(r),i.appendChild(r)}this.element.querySelector("."+es).appendChild(i),t.EventHandler.add(i,"click",this.navigatorClickHandler,this)},i.prototype.renderPlayButton=function(){if("Hidden"!==this.buttonsVisibility&&this.showPlayButton){var e=this.createElement("div",{className:ss+" "+("VisibleOnHover"===this.buttonsVisibility?ds:"")});if(this.playButtonTemplate){t.addClass([e],cs);var i=this.element.id+"_playButtonTemplate",s=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",i,!1);t.append(s,e)}else{var l=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")}}),r=this.selectedIndex===this.slideItems.length-1&&!this.loop,o=new n.Button({cssClass:"e-flat e-round "+as,iconCss:"e-icons "+(this.autoPlay&&!r?ls:ns),isToggle:!0,enableRtl:this.enableRtl});if(r){this.setProperties({autoPlay:!1},!0),l.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition"));this.element.querySelector("."+Ji).setAttribute("aria-live","polite")}o.appendTo(l),e.appendChild(l)}var a=this.element.querySelector("."+es);a.insertBefore(e,a.lastElementChild),this.renderTemplates(),t.EventHandler.add(e,"click",this.playButtonClickHandler,this)}},i.prototype.renderIndicators=function(){var e=this;if(this.showIndicators){var i=this.createElement("div",{className:ts}),s=this.createElement("div",{className:"e-indicator-bars"});i.appendChild(s),this.slideItems&&this.slideItems.forEach(function(i,l){var r=e.createElement("div",{className:is+" "+(e.selectedIndex===l?Qi:""),attrs:{"data-index":l.toString(),"aria-current":e.selectedIndex===l?"true":"false"}});if(e.indicatorsTemplate){t.addClass([r],cs);var o=e.element.id+"_indicatorsTemplate",a=e.templateParser(e.indicatorsTemplate)({index:l,selectedIndex:e.selectedIndex},e,"indicatorsTemplate",o,!1);t.append(a,r)}else{var d=e.createElement("button",{className:"e-indicator"});r.appendChild(d),d.appendChild(e.createElement("div",{attrs:{"aria-label":e.localeObj.getConstant("slide")+" "+(l+1)+" "+e.localeObj.getConstant("of")+" "+e.slideItems.length}}));new n.Button({cssClass:"e-flat e-small"}).appendTo(d)}s.appendChild(r),t.EventHandler.add(r,"click",e.indicatorClickHandler,e)}),this.element.appendChild(i)}},i.prototype.renderKeyboardActions=function(){this.keyModule=new t.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs})},i.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new t.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},i.prototype.applyAnimation=function(){switch(t.removeClass([this.element],[fs,us,ps,ms]),this.animationEffect){case"Slide":t.addClass([this.element],ps);break;case"Fade":t.addClass([this.element],us);break;case"None":t.addClass([this.element],ms);break;case"Custom":t.addClass([this.element],fs)}},i.prototype.autoSlide=function(){this.resetSlideInterval(),this.applySlideInterval()},i.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+Qi);if(!t.isNullOrUndefined(e)){var i=parseInt(e.dataset.index,10);if(this.loop||i!==this.slideItems.length-1){var s=(i+1)%this.slideItems.length;this.element.classList.contains(hs)||this.setActiveSlide(s,"Next"),this.autoSlide()}else this.resetSlideInterval()}},i.prototype.applySlideInterval=function(){var e=this;if(this.autoPlay&&!this.element.classList.contains(hs)){var i=this.interval;this.items.length>0&&!t.isNullOrUndefined(this.items[this.selectedIndex].interval)&&(i=this.items[this.selectedIndex].interval),this.autoSlideInterval=setInterval(function(){return e.autoSlideChange()},i)}},i.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},i.prototype.getSlideIndex=function(e){var t=this.selectedIndex;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},i.prototype.setActiveSlide=function(e,i,s){var n=this;if(void 0===s&&(s=!1),!(this.element.querySelectorAll("."+Zi+".e-prev,."+Zi+".e-next").length>0)){var l=[].slice.call(this.element.querySelectorAll("."+Zi)),r=this.element.querySelector("."+Zi+"."+Qi);if(t.isNullOrUndefined(r)&&this.showIndicators){var o=this.element.querySelector("."+is+"."+Qi),a=parseInt(o.dataset.index,10);t.addClass([l[a]],Qi)}else if(t.isNullOrUndefined(r))t.addClass([l[e]],Qi);else{var d=parseInt(r.dataset.index,10),h=l[e],c={currentIndex:d,nextIndex:e,currentSlide:r,nextSlide:h,slideDirection:i,isSwiped:s,cancel:!1};this.trigger("slideChanging",c,function(l){if(!l.cancel){n.setProperties({selectedIndex:e},!0),t.attributes(l.currentSlide,{"aria-hidden":"true"}),t.attributes(l.nextSlide,{"aria-hidden":"false"});var r=[].slice.call(n.element.querySelectorAll("."+is));r.length>0&&(t.attributes(r[d],{"aria-current":"false"}),t.attributes(r[e],{"aria-current":"true"}),t.removeClass(r,Qi),t.addClass([r[e]],Qi)),n.slideChangedEventArgs={currentIndex:l.nextIndex,previousIndex:l.currentIndex,currentSlide:l.nextSlide,previousSlide:l.currentSlide,slideDirection:i,isSwiped:s};"Slide"===n.animationEffect?"Previous"===i?(t.addClass([l.nextSlide],"e-prev"),l.nextSlide.offsetHeight,t.addClass([l.currentSlide,l.nextSlide],gs)):(t.addClass([l.nextSlide],"e-next"),l.nextSlide.offsetHeight,t.addClass([l.currentSlide,l.nextSlide],vs)):"Fade"===n.animationEffect?(t.removeClass([l.currentSlide],Qi),t.addClass([l.nextSlide],Qi)):"Custom"===n.animationEffect?"Previous"===i?(t.addClass([l.nextSlide],"e-next"),t.addClass([l.currentSlide],"e-prev")):(t.addClass([l.currentSlide],"e-prev"),t.addClass([l.nextSlide],"e-next")):n.onTransitionEnd(),n.handleNavigatorsActions(e)}})}}},i.prototype.onTransitionEnd=function(){var e=this;this.slideChangedEventArgs&&(t.addClass([this.slideChangedEventArgs.currentSlide],Qi),t.removeClass([this.slideChangedEventArgs.previousSlide],Qi),this.trigger("slideChanged",this.slideChangedEventArgs,function(){t.removeClass(e.element.querySelectorAll("."+Zi),["e-prev","e-next",vs,gs]),e.slideChangedEventArgs=null}))},i.prototype.setHtmlAttributes=function(e,i){for(var s=0,n=Object.keys(e);s<n.length;s++){var l=n[s];"class"===l?t.addClass([i],e[l]):i.setAttribute(l,e[l])}},i.prototype.templateParser=function(e){if(e)try{return document.querySelectorAll(e).length?t.compile(document.querySelector(e).innerHTML.trim()):t.compile(e)}catch(i){return t.compile(e)}},i.prototype.getNavigatorState=function(e,i){var s=e.querySelector("."+(i?rs:os));if(s){return t.getInstance(s,n.Button).disabled}return!1},i.prototype.navigatorClickHandler=function(e){var t=e.currentTarget;if(!this.getNavigatorState(t,t.classList.contains($i))){var i=t.classList.contains($i)?"Previous":"Next";this.setActiveSlide(this.getSlideIndex(i),i),this.autoSlide()}},i.prototype.indicatorClickHandler=function(e){var i=t.closest(e.target,"."+is),s=parseInt(i.dataset.index,10);this.selectedIndex!==s&&(this.setActiveSlide(s,this.selectedIndex>s?"Previous":"Next"),this.autoSlide())},i.prototype.playButtonClickHandler=function(e,i){void 0===i&&(i=!1);var s=this.element.querySelector("."+as);if(s){var l=t.getInstance(s,n.Button);i||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),l.iconCss="e-icons "+(this.autoPlay?ls:ns),l.dataBind();this.element.querySelector("."+Ji).setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide()}},i.prototype.keyHandler=function(e){var i,s,n=!1,l=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&l.classList.contains("e-indicator")?l.click():l.classList.contains(Gi)||l.classList.contains(as)?this.playButtonClickHandler(e):l.classList.contains(os)?this.next():l.classList.contains(rs)&&this.prev();break;case"end":s=this.slideItems.length-1,i="Next",n=!0;break;case"home":s=0,i="Previous",n=!0;break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&t.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),i="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",s=this.getSlideIndex(i),n=!this.isSuspendSlideTransition(s,i)}n&&(this.setActiveSlide(s,i),this.autoSlide(),n=!1)},i.prototype.swipeHandler=function(e){if(!this.element.classList.contains(hs)){var t="Right"===e.swipeDirection?"Previous":"Next",i=this.getSlideIndex(t);this.isSuspendSlideTransition(i,t)||(this.setActiveSlide(i,t,!0),this.autoSlide())}},i.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},i.prototype.handleNavigatorsActions=function(e){if("Hidden"!==this.buttonsVisibility){if(this.showPlayButton){var i=this.element.querySelector("."+as),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,l=t.isNullOrUndefined(this.playButtonTemplate)&&i&&s;if(t.isNullOrUndefined(this.playButtonTemplate)&&i&&!s&&(l=!i.classList.contains(Qi)),l){this.setProperties({autoPlay:!s},!0),i.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"));this.element.querySelector("."+Ji).setAttribute("aria-live",this.autoPlay?"off":"polite");(a=t.getInstance(i,n.Button)).iconCss="e-icons "+(this.autoPlay?ls:ns),a.dataBind()}}var r=this.element.querySelector("."+rs);if(r&&t.isNullOrUndefined(this.previousButtonTemplate)){(a=t.getInstance(r,n.Button)).disabled=!this.loop&&0===e,a.dataBind()}var o=this.element.querySelector("."+os);if(o&&t.isNullOrUndefined(this.nextButtonTemplate)){var a;(a=t.getInstance(o,n.Button)).disabled=!this.loop&&e===this.slideItems.length-1,a.dataBind()}}},i.prototype.onHoverActions=function(e){var i=this.element.querySelector("."+es);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&i&&t.removeClass([].slice.call(i.childNodes),ds),this.pauseOnHover&&t.addClass([this.element],hs);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&i&&t.addClass([].slice.call(i.childNodes),ds),t.removeClass([this.element],hs)}this.autoSlide()},i.prototype.onFocusActions=function(e){switch(e.type){case"focusin":t.addClass([this.element],hs);break;case"focusout":t.removeClass([this.element],hs)}this.autoSlide()},i.prototype.destroyButtons=function(){for(var e=0,i=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<i.length;e++){var s=i[e],l=t.getInstance(s,n.Button);l&&l.destroy()}},i.prototype.wireEvents=function(){t.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),t.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),t.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),t.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this)},i.prototype.unWireEvents=function(){var e=this;[].slice.call(this.element.querySelectorAll("."+is)).forEach(function(i){t.EventHandler.remove(i,"click",e.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+$i+",.e-next")).forEach(function(i){t.EventHandler.remove(i,"click",e.navigatorClickHandler)});var i=this.element.querySelector("."+ss);i&&t.EventHandler.remove(i,"click",this.playButtonClickHandler),t.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),t.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),t.EventHandler.clearEvents(this.element)},i.prototype.prev=function(){if(this.loop||0!==this.selectedIndex){var e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1;this.setActiveSlide(e,"Previous"),this.autoSlide()}},i.prototype.next=function(){if(this.loop||this.selectedIndex!==this.slideItems.length-1){var e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1;this.setActiveSlide(e,"Next"),this.autoSlide()}},i.prototype.play=function(){var e=this.element.querySelector("."+ns);if(this.showPlayButton&&e){t.classList(e,[ls],[ns]);this.element.querySelector("."+as).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))}this.setProperties({autoPlay:!0},!0);this.element.querySelector("."+Ji).setAttribute("aria-live","off"),this.applySlideInterval()},i.prototype.pause=function(){var e=this.element.querySelector("."+ls);if(this.showPlayButton&&e){this.element.querySelector("."+as).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),t.classList(e,[ns],[ls])}this.setProperties({autoPlay:!1},!0);this.element.querySelector("."+Ji).setAttribute("aria-live","off"),this.resetSlideInterval()},i.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},i.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},i.prototype.destroy=function(){var i=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule.destroy(),this.keyModule=null,this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){i.element.removeChild(e)}),t.removeClass([this.element],[Gi,this.cssClass,"e-rtl"]),["tabindex","role","style"].forEach(function(e){i.element.removeAttribute(e)}),e.prototype.destroy.call(this)},Xi([t.Collection([],ys)],i.prototype,"items",void 0),Xi([t.Property("Slide")],i.prototype,"animationEffect",void 0),Xi([t.Property()],i.prototype,"previousButtonTemplate",void 0),Xi([t.Property()],i.prototype,"nextButtonTemplate",void 0),Xi([t.Property()],i.prototype,"indicatorsTemplate",void 0),Xi([t.Property()],i.prototype,"playButtonTemplate",void 0),Xi([t.Property()],i.prototype,"cssClass",void 0),Xi([t.Property([])],i.prototype,"dataSource",void 0),Xi([t.Property()],i.prototype,"itemTemplate",void 0),Xi([t.Property(0)],i.prototype,"selectedIndex",void 0),Xi([t.Property("100%")],i.prototype,"width",void 0),Xi([t.Property("100%")],i.prototype,"height",void 0),Xi([t.Property(5e3)],i.prototype,"interval",void 0),Xi([t.Property(!0)],i.prototype,"autoPlay",void 0),Xi([t.Property(!0)],i.prototype,"pauseOnHover",void 0),Xi([t.Property(!0)],i.prototype,"loop",void 0),Xi([t.Property(!1)],i.prototype,"showPlayButton",void 0),Xi([t.Property(!0)],i.prototype,"enableTouchSwipe",void 0),Xi([t.Property(!0)],i.prototype,"showIndicators",void 0),Xi([t.Property("Visible")],i.prototype,"buttonsVisibility",void 0),Xi([t.Property()],i.prototype,"htmlAttributes",void 0),Xi([t.Event()],i.prototype,"slideChanging",void 0),Xi([t.Event()],i.prototype,"slideChanged",void 0),i=Xi([t.NotifyPropertyChanges],i)}(t.Component);e.MenuAnimationSettings=te,e.MenuItem=ee,e.HScroll=I,e.VScroll=B,e.addScrolling=o,e.destroyScroll=d,e.Item=Pe,e.Toolbar=De,e.AccordionActionSettings=Qe,e.AccordionAnimationSettings=Je,e.AccordionItem=Ze,e.Accordion=$e,e.ContextMenu=it,e.Menu=ot,e.TabActionSettings=Mt,e.TabAnimationSettings=Ht,e.Header=Ut,e.TabItem=Rt,e.Tab=Bt,e.FieldsSettings=vi,e.ActionSettings=gi,e.NodeAnimationSettings=yi,e.TreeView=bi,e.Sidebar=Di,e.BreadcrumbItem=zi,e.Breadcrumb=Ki,e.CarouselItem=ys,e.Carousel=bs,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-navigations.umd.min.js.map