12345678910 |
- /*!
- * filename: ej2-navigations.min.js
- * version : 19.1.63
- * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
- * Use of this code is subject to the terms of our license.
- * A copy of the current license can be obtained at any time by e-mailing
- * licensing@syncfusion.com. Any infringement will be prosecuted under
- * applicable laws.
- */
- this.ej=this.ej||{},this.ej.navigations=function(e,t,i,s,n,r,l){"use strict";function o(e,t,i,s,n,r){var l,o,d=t.parentElement;if("vscroll"===s?(l=r||t.getBoundingClientRect().height,o=i.getBoundingClientRect().height):(l=t.getBoundingClientRect().width,o=i.getBoundingClientRect().width),l<o)return a(e,t,i,s,n,r);if(d){var h=d.getBoundingClientRect().width;return h<l?(o=h,t.style.maxWidth=h+"px",a(e,t,i,s,n,r)):i}return i}function a(e,i,s,n,r,l){var o=e("div",{className:"e-menu-"+n});i.appendChild(o),o.appendChild(s),l?(o.style.overflow="hidden",o.style.height=l+"px"):(o.style.maxHeight=i.style.maxHeight,i.style.overflow="hidden");return"vscroll"===n?new m({enableRtl:r},o).scrollStep=t.select(".e-"+n+"-bar",i).offsetHeight/2:new p({enableRtl:r},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,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},p=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("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.scrollHandler,this),this.isDevice?(this.element.classList.add("e-scroll-device"),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 r=n[s];e.appendChild(r)}t.appendChild(e),i.appendChild(t),t.style.overflowX="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},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("e-scroll-device");var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];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(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].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:"e-scroll-overlay e-scroll-right-overlay"}),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),n=this.createElement("div",{id:t.concat("_right"),className:s}),r=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"});n.appendChild(r);var l=this.createElement("div",{className:"e-scroll-overlay e-scroll-left-overlay"});this.ieCheck&&n.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(n),e.insertBefore(l,e.firstChild),this.eventBinding([n])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-scroll-nav e-scroll-right-nav"),s=this.createElement("div",{id:t.concat("_right"),className:i});s.setAttribute("aria-disabled","false");var n=this.createElement("div",{className:"e-nav-right-arrow e-nav-arrow e-icons"}),r="e-"+e.id.concat("_nav e-scroll-nav e-scroll-left-nav"),l=this.createElement("div",{id:t.concat("_left"),className:r+" e-overlay"});l.setAttribute("aria-disabled","true");var o=this.createElement("div",{className:"e-nav-left-arrow e-nav-arrow e-icons"});l.appendChild(o),s.appendChild(n),e.appendChild(s),e.insertBefore(l,e.firstChild),this.ieCheck&&(s.classList.add("e-ie-align"),l.classList.add("e-ie-align")),this.eventBinding([s,l])},i.prototype.onKeyPress=function(e){var t=this;if("Enter"===e.key){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},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,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},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("e-scroll-nav")&&(n=t.querySelector(".e-nav-arrow").classList),this.contains(s,"e-rtl")&&this.browserCheck&&(e=-e),!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?n.contains("e-nav-right-arrow")?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains("e-nav-left-arrow")?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 r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Left"===e.swipeDirection?i.scrollLeft+=t*r:"Right"===e.swipeDirection&&(i.scrollLeft-=t*r),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)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetWidth});var r=function(){var t,s;n.contains(n.element,"e-rtl")&&n.browserCheck?(t=-e,s=-10):(t=e,s=10),t<10?window.cancelAnimationFrame(s):(n.scrollUpdating(s,i),e-=s,window.requestAnimationFrame(r))};r()},i.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,"e-rtl")&&(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(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-right-arrow"],["e-nav-left-arrow"]):t.classList(s,["e-nav-left-arrow"],["e-nav-right-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),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,n=this.element.querySelector(".e-scroll-left-nav"),r=this.element.querySelector(".e-scroll-right-nav"),l=this.element.querySelector(".e-scroll-left-overlay"),o=this.element.querySelector(".e-scroll-right-overlay"),a=t.scrollLeft;if(a<=0&&(a=-a),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(l=this.element.querySelector(".e-scroll-right-overlay"),o=this.element.querySelector(".e-scroll-left-overlay")),l.style.width=a<40?a+"px":"40px",t.scrollWidth-Math.ceil(i+a)<40?o.style.width=t.scrollWidth-Math.ceil(i+a)+"px":o.style.width="40px"),0===a)!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(n,r):this.arrowDisabling(r,n);else if(Math.ceil(i+a+.1)>=t.scrollWidth)!this.contains(s,"e-rtl")||this.browserCheck||this.ieCheck?this.arrowDisabling(r,n):this.arrowDisabling(n,r);else{var d=this.element.querySelector(".e-scroll-nav.e-overlay");d&&(d.classList.remove("e-overlay"),d.setAttribute("aria-disabled","false"),d.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")}},c([t.Property(null)],i.prototype,"scrollStep",void 0),i=c([t.NotifyPropertyChanges],i)}(t.Component),u=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)}}(),f=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},m=function(e){function i(t,i){return e.call(this,t,i)||this}return u(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("e-scroll-device"),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,r=[].slice.call(s.children);n<r.length;n++){var l=r[n];e.appendChild(l)}i.appendChild(e),s.appendChild(i),i.style.overflowY="hidden",this.scrollEle=i,this.scrollItems=e},i.prototype.getPersistData=function(){var e=["scrollStep"];return this.addOnPersist(e)},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var i=this.element;i.style.display="",t.removeClass([this.element],["e-vscroll","e-scroll-device"]);var s=t.selectAll(".e-"+i.id+"_nav.e-scroll-nav",i),n=t.selectAll(".e-scroll-overlay",i);[].slice.call(n).forEach(function(e){t.detach(e)});for(var r=0,l=[].slice.call(this.scrollItems.children);r<l.length;r++){var o=l[r];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(.e-overlay)",this.element);e?this.element.classList.add("e-overlay"):this.element.classList.remove("e-overlay"),[].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:"e-scroll-overlay e-scroll-down-overlay"}),n="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),r=t.createElement("div",{id:i.concat("down"),className:n}),l=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"});r.appendChild(l);var o=t.createElement("div",{className:"e-scroll-overlay e-scroll-up-overlay"});this.ieCheck&&r.classList.add("e-ie-align"),e.appendChild(s),e.appendChild(r),e.insertBefore(o,e.firstChild),this.eventBinding([r])},i.prototype.createNavIcon=function(e){var i=e.id.concat("_nav"),s="e-"+e.id.concat("_nav e-scroll-nav e-scroll-down-nav"),n=t.createElement("div",{id:i.concat("_down"),className:s});n.setAttribute("aria-disabled","false");var r=t.createElement("div",{className:"e-nav-down-arrow e-nav-arrow e-icons"}),l="e-"+e.id.concat("_nav e-scroll-nav e-scroll-up-nav"),o=t.createElement("div",{id:i.concat("_up"),className:l+" e-overlay"});o.setAttribute("aria-disabled","true");var a=t.createElement("div",{className:"e-nav-up-arrow e-nav-arrow e-icons"});o.appendChild(a),n.appendChild(r),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){var i=function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)};this.keyTimer=window.setTimeout(function(){i()},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,"e-scroll-nav")?i.firstElementChild:i;var s=function(){t.eleScrolling(10,i,!0)};this.timeout=window.setInterval(function(){s()},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("e-scroll-nav")&&(s=t.querySelector(".e-nav-arrow").classList),s.contains("e-nav-down-arrow")?this.frameScrollRequest(e,"add",i):s.contains("e-nav-up-arrow")&&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 r=Math.sin(s);r<=0?window.cancelAnimationFrame(r):("Up"===e.swipeDirection?i.scrollTop+=t*r:"Down"===e.swipeDirection&&(i.scrollTop-=t*r),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)return void this.scrollUpdating(e,i);this.customStep||[].slice.call(t.selectAll(".e-scroll-overlay",this.element)).forEach(function(t){e-=t.offsetHeight});var r=function(){e<10?window.cancelAnimationFrame(10):(n.scrollUpdating(10,i),e-=10,window.requestAnimationFrame(r))};r()},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(".e-nav-arrow");t.isNullOrUndefined(e)?t.classList(s,["e-nav-down-arrow"],["e-nav-up-arrow"]):t.classList(s,["e-nav-up-arrow"],["e-nav-down-arrow"])}else e.classList.add("e-overlay"),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),i.classList.remove("e-overlay"),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(".e-scroll-up-nav"),n=this.element.querySelector(".e-scroll-down-nav"),r=this.element.querySelector(".e-scroll-up-overlay"),l=this.element.querySelector(".e-scroll-down-overlay"),o=t.scrollTop;if(o<=0&&(o=-o),this.isDevice&&(r.style.height=o<40?o+"px":"40px",t.scrollHeight-Math.ceil(i+o)<40?l.style.height=t.scrollHeight-Math.ceil(i+o)+"px":l.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(".e-scroll-nav.e-overlay");a&&(a.classList.remove("e-overlay"),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")}},f([t.Property(null)],i.prototype,"scrollStep",void 0),i=f([t.NotifyPropertyChanges],i)}(t.Component),v=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)}}(),g=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},y="e-focused",b="e-menu-header",C="e-selected",N="e-menu-item",E="e-menu-hide",x="e-menu-popup",O=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("id")],i.prototype,"itemId",void 0),g([t.Property("parentId")],i.prototype,"parentId",void 0),g([t.Property("text")],i.prototype,"text",void 0),g([t.Property("iconCss")],i.prototype,"iconCss",void 0),g([t.Property("url")],i.prototype,"url",void 0),g([t.Property("separator")],i.prototype,"separator",void 0),g([t.Property("items")],i.prototype,"children",void 0),i}(t.ChildProperty),S=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property(null)],i.prototype,"iconCss",void 0),g([t.Property("")],i.prototype,"id",void 0),g([t.Property(!1)],i.prototype,"separator",void 0),g([t.Collection([],i)],i.prototype,"items",void 0),g([t.Property("")],i.prototype,"text",void 0),g([t.Property("")],i.prototype,"url",void 0),i}(t.ChildProperty),w=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return v(i,e),g([t.Property("SlideDown")],i.prototype,"effect",void 0),g([t.Property(400)],i.prototype,"duration",void 0),g([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),I=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 v(n,e),n.prototype.preRender=function(){if(!this.isMenu){r=void 0;if("EJS-CONTEXTMENU"===this.element.tagName){r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()});var e=t.getValue("ej2_instances",this.element);t.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=r,t.setValue("ej2_instances",e,this.element)}else{r=this.createElement("ul",{id:t.getUniqueID(this.getModuleName())}),t.append([].slice.call(this.element.cloneNode(!0).children),r);var i=this.element.nextElementSibling;i?this.element.parentElement.insertBefore(r,i):this.element.parentElement.appendChild(r),this.clonedElement=r}this.clonedElement.style.display="none"}if("EJS-MENU"===this.element.tagName){for(var s=this.element,n=t.getValue("ej2_instances",s),r=this.createElement("ul"),l=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),o=0,a=s.attributes.length;o<a;o++)r.setAttribute(s.attributes[o].nodeName,s.attributes[o].nodeValue);s.parentNode.insertBefore(l,s),t.detach(s),s=r,l.appendChild(s),t.setValue("ej2_instances",n,s),this.clonedElement=l,this.element=s,this.element.id||(this.element.id=t.getUniqueID(this.getModuleName()))}},n.prototype.render=function(){if(this.initialize(),this.renderItems(),this.isMenu&&this.template&&t.isBlazor()){var e=this.element.id+"Template";t.resetBlazorTemplate(e,"Template"),Object.keys(t.blazorTemplates).length&&t.extend(this.tempItem,t.blazorTemplates[e],[],!0),t.updateBlazorTemplate(e,"Template",this)}this.wireEvents(),this.renderComplete()},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.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),r=0,l=n.length;r<l;r++)i=n[r],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:"."+N})},n.prototype.wireKeyboardEvent=function(e){var i={downarrow:"downarrow",uparrow:"uparrow",enter:"enter",leftarrow:"leftarrow",rightarrow:"rightarrow",escape:"escape"};this.isMenu&&(i.home="home",i.end="end"),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([y,C],[t.closest(s,".e-"+this.getModuleName()+"-wrapper")]),n)switch(e.action){case"rightarrow":i="rightarrow",e.action="downarrow";break;case"leftarrow":i="leftarrow",e.action="uparrow";break;case"downarrow":i="downarrow",e.action="rightarrow";break;case"uparrow":i="uparrow",e.action=""}else if(this.enableRtl)switch(e.action){case"leftarrow":n=!0,i="leftarrow",e.action="rightarrow";break;case"rightarrow":n=!0,i="rightarrow",e.action="leftarrow"}switch(e.action){case"downarrow":case"uparrow":case"end":case"home":this.upDownKeyHandler(e);break;case"rightarrow":this.rightEnterKeyHandler(e);break;case"leftarrow":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="downarrow"===e.action||"home"===e.action?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,y);n&&("end"!==e.action&&"home"!==e.action&&(s=this.getIdx(t,n)),n.classList.remove(y),"end"!==e.action&&"home"!==e.action&&("downarrow"===e.action?s++:s--,s===("downarrow"===e.action?t.childElementCount:-1)&&(s=i)));var r=t.children[s];s=this.isValidLI(r,s,e.action),t.children[s].classList.add(y),t.children[s].focus()},n.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx();return(e.classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&("downarrow"===i||"rightarrow"===i?t++:t--),((e=s.children[t]).classList.contains("e-separator")||e.classList.contains("e-disabled")||e.classList.contains(E))&&(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("."+x)))[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,y);if(s){var n=this.getIdx(i,s),r=this.navIdx.concat(n),l=this.getItem(r);l.items.length?(this.navIdx.push(n),this.keyType="right",this.action=e.action,this.openMenu(s,l,-1,-1,e)):"enter"===e.action&&(this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([C],[this.getWrapper()]):s.classList.remove(y),s.classList.add(C),t={element:s,item:l,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.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 r=this;if(void 0===e&&(e=0),void 0===i&&(i=null),this.isMenuVisible()){var l,o,a=void 0,h=this.getWrapper(),c=void 0,p=this.getPopups(),u=!1,f=this.isMenu?p.length+1:h.childElementCount,v=this.isMenu&&1!==f?t.select(".e-ul",p[f-2]):t.selectAll(".e-menu-parent",h)[f-1];if(this.isMenu&&v.classList.contains("e-menu")&&((a=this.getLIByClass(v,C))&&a.classList.remove(C),u=!0),!u){var g=i&&i.target&&this.getLI(i.target);l=this.navIdx.length?this.getItem(this.navIdx):null,o=l?l.items:this.items,c={element:v,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(l,e):l,items:o,event:i,cancel:!1,isFocused:!0},this.trigger("beforeClose",c,function(a){var h,c,p,u="",f=!a.cancel;(f||r.isCMenu)&&(r.isMenu?(h=t.closest(v,"."+x),r.hamburgerMode&&(h.parentElement.style.minHeight="",t.closest(v,".e-menu-item").setAttribute("aria-expanded","false")),r.unWireKeyboardEvent(h),d(t.getInstance(h.children[0],m),h.children[0]),(p=t.getInstance(h,s.Popup)).hide(),u=h.id,p.destroy(),t.detach(h)):r.toggleAnimation(v,!1),c={element:v,parentItem:l,items:o},r.trigger("onClose",c),r.navIdx.pop()),r.updateReactTemplate();var b,N,E,O=r.getWrapper()&&r.getUlByNavIdx();r.isCMenu&&(r.canOpen(i.target)&&r.openMenu(null,null,r.pageY,r.pageX,i),r.isCMenu=!1),r.isMenu&&O&&u.length&&(b=new RegExp("(.*)-ej2menu-"+r.element.id+"-popup").exec(u)[1],N=O.querySelector('[id="'+b+'"]'),E=g&&O.querySelector('[id="'+g.id+'"]'));var S=g&&g.querySelectorAll(".e-menu-item");if(f&&r.hamburgerMode&&e&&!S.length)r.afterCloseMenu(i);else if(f&&!r.hamburgerMode&&r.navIdx.length&&N&&!E){var w=i&&i.target.classList.contains("e-vscroll")?t.closest(i.target,".e-menu-wrapper"):null;w?(w=w.querySelector(".e-menu-item"),(r.showItemOnClick||w&&r.getIndex(w.id,!0).length<=r.navIdx.length)&&r.closeMenu(r.navIdx[r.navIdx.length-1],i,!0)):r.closeMenu(r.navIdx[r.navIdx.length-1],i)}else if(f&&!n&&!e&&(r.hamburgerMode&&r.navIdx.length||1===r.navIdx.length))r.closeMenu(null,i);else if(f&&t.isNullOrUndefined(e)&&r.navIdx.length)r.closeMenu(null,i);else if(!f||r.isMenu||e||0!==r.navIdx.length||r.isMenusClosed)if(f&&r.isMenu&&i&&i.target&&0!==r.navIdx.length&&t.closest(i.target,".e-menu-parent.e-control"))r.closeMenu(0,i);else{if(!f||"right"!==r.keyType&&"click"!==r.keyType){var I=r.getUlByNavIdx(),k=r.getLIByClass(I,C);if(k&&(k.setAttribute("aria-expanded","false"),k.classList.remove(C),a.isFocused&&g&&(k.classList.add(y),k.focus())),!f&&r.hamburgerMode&&g&&"false"===g.getAttribute("aria-expanded")&&"true"===g.getAttribute("aria-haspopup")){t.closest(g,".e-menu-parent.e-control")?r.navIdx=[]:r.navIdx.pop(),r.navIdx.push(r.cliIdx);var L=r.getItem(r.navIdx);g.setAttribute("aria-expanded","true"),r.openMenu(g,L,-1,-1,i)}}else r.afterCloseMenu(i);r.navIdx.length<1&&("Hover"!==r.showSubMenuOn&&"Click"!==r.showSubMenuOn||(r.showItemOnClick=r.defaultOption,r.showSubMenuOn="Auto"))}else r.isMenusClosed=!0,r.closeMenu(0,i);r.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("."+x)).forEach(function(s){!t.isNullOrUndefined(s.querySelector("."+N))&&e.getIndex(s.querySelector("."+N).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,r=s.length;n<r;n++)if(t.closest(e,"."+s[n])){i=!0;break}}return i},n.prototype.openMenu=function(e,i,n,r,l,o){var a=this;void 0===n&&(n=0),void 0===r&&(r=0),void 0===l&&(l=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(r)&&(r=-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 S(this.items[0],"items",c,!0),u=this.createItems([p]).children[0];u.classList.add(b),this.uList.insertBefore(u,this.uList.children[0])}this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+x,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,l,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){a.triggerBeforeOpen(e,a.uList,i,l,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,l,n,r,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none"))}else this.uList=this.element,this.uList.style.zIndex=s.getZindexPartial(o||this.element).toString(),this.triggerBeforeOpen(e,this.uList,i,l,n,r,"none");if(this.isMenu&&this.template&&t.isBlazor()){var f=this.element.id+"Template";if(Object.keys(t.blazorTemplates).length){var m=t.blazorTemplates[f];this.tempItem=this.tempItem.concat(m),t.blazorTemplates[f]=this.tempItem}t.updateBlazorTemplate(f,"Template",this)}},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 r=e.querySelector(".e-menu-icon"),l=getComputedStyle(r),o=parseInt(l.marginRight,10)+r.offsetWidth+s,a=0;a<n.length;a++)n[a].style.textIndent=o+"px"},n.prototype.generatePopup=function(e,i,n,r){var l=this,o=new s.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:n,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:r||this.enableRtl?"none":"flip",Y:"fit"},position:r&&!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(),l.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}),r=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});i.appendChild(n),i.appendChild(r),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;if(this.hamburgerMode){var 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,r){return s.fit(e,null,{X:t,Y:i},{top:n,left:r})},n.prototype.triggerBeforeOpen=function(e,i,n,r,l,a,d){var h,c=this,p=e?n[this.getField("children",this.navIdx.length-1)]:this.items,u={element:i,items:p,parentItem:this.isMenu&&t.isBlazor()?this.getMenuItemModel(n,this.navIdx.length-1):n,event:r,cancel:!1,top:l,left:a,showSubMenuOn:"Auto"},f=d;this.trigger("beforeOpen",u,function(l){switch(f){case"menu":if(c.hamburgerMode||("Auto"!==l.showSubMenuOn&&(c.showItemOnClick=!c.defaultOption,c.showSubMenuOn=l.showSubMenuOn),c.top=l.top,c.left=l.left),c.popupWrapper.style.display="block",c.hamburgerMode||(c.popupWrapper.style.maxHeight=c.popupWrapper.getBoundingClientRect().height+"px",c.enableScrolling&&o(c.createElement,c.popupWrapper,c.uList,"vscroll",c.enableRtl),c.checkScrollOffset(r)),c.hamburgerMode||c.left||c.top)c.popupObj.collision={X:"none",Y:"none"};else{if(c.popupObj.refreshPosition(c.lItem,!0),c.left=parseInt(c.popupWrapper.style.left,10),c.top=parseInt(c.popupWrapper.style.top,10),c.enableRtl&&(c.left=c.isNestedOrVertical?c.left-c.popupWrapper.offsetWidth-c.lItem.parentElement.offsetWidth+2:c.left-c.popupWrapper.offsetWidth+c.lItem.offsetWidth),h=s.isCollide(c.popupWrapper,null,c.left,c.top),(c.isNestedOrVertical||c.enableRtl)&&(h.indexOf("right")>-1||h.indexOf("left")>-1)){c.popupObj.collision.X="none";var a=t.closest(c.lItem,".e-"+c.getModuleName()+"-wrapper").offsetWidth;c.left=c.enableRtl?s.calculatePosition(c.lItem,c.isNestedOrVertical?"right":"left","top").left:c.left-c.popupWrapper.offsetWidth-a+2}((h=s.isCollide(c.popupWrapper,null,c.left,c.top)).indexOf("left")>-1||h.indexOf("right")>-1)&&(c.left=c.callFit(c.popupWrapper,!0,!1,c.top,c.left).left),c.popupWrapper.style.left=c.left+"px"}c.popupWrapper.style.display="";break;case"none":c.top=l.top,c.left=l.left;break;case"hamburger":l.cancel||(c.element.classList.remove("e-hide-menu"),c.triggerOpen(c.element))}if("hamburger"!==f)if(l.cancel)c.isMenu?(c.popupObj.destroy(),t.detach(c.popupWrapper)):i.className.indexOf("e-ul")>-1&&t.detach(i),c.navIdx.pop();else if(c.isMenu)if(c.hamburgerMode)c.popupWrapper.style.top=c.top+"px",c.popupWrapper.style.left="0px",c.toggleAnimation(c.popupWrapper);else{c.setBlankIconStyle(c.popupWrapper),c.wireKeyboardEvent(c.popupWrapper),t.rippleEffect(c.popupWrapper,{selector:"."+N}),c.popupWrapper.style.left=c.left+"px",c.popupWrapper.style.top=c.top+"px";var d="None"!==c.animationSettings.effect?{name:c.animationSettings.effect,duration:c.animationSettings.duration,timingFunction:c.animationSettings.easing}:null;c.popupObj.show(d,c.lItem)}else c.setBlankIconStyle(c.uList),c.setPosition(c.lItem,c.uList,c.top,c.left),c.toggleAnimation(c.uList);if("right"===c.keyType){var p=c.getUlByNavIdx();if(e.classList.remove(y),c.isMenu&&1===c.navIdx.length&&c.removeLIStateByClass([C],[c.getWrapper()]),e.classList.add(C),"enter"===c.action){var u={element:e,item:n,event:r};c.trigger("select",u)}e.focus(),p=c.getUlByNavIdx();var m=c.isValidLI(p.children[0],0,c.action);p.children[m].classList.add(y),p.children[m].focus()}})},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"},r=getComputedStyle(s),l=parseInt(r.fontSize,10);parseInt(r.width,10)&&parseInt(r.width,10)>l&&(l=parseInt(r.width,10));var o=l+parseInt(r[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,"."+N),n=t.select(".e-hscroll-bar",i);n.scrollLeft>s.offsetLeft&&(n.scrollLeft-=n.scrollLeft-s.offsetLeft);var r=n.scrollLeft+n.offsetWidth,l=s.offsetLeft+s.offsetWidth;r<l&&(n.scrollLeft+=l-r)}},n.prototype.setPosition=function(e,i,n,r){if(this.toggleVisiblity(i),i===this.element||r>-1&&n>-1){if((d=s.isCollide(i,null,r,n)).indexOf("right")>-1&&(r-=i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top-20)<0){var l=pageYOffset+document.documentElement.clientHeight-i.getBoundingClientRect().height;l>-1&&(n=l)}(d=s.isCollide(i,null,r,n)).indexOf("left")>-1&&(r=(a=this.callFit(i,!0,!1,n,r)).left)}else if(t.Browser.isDevice)n=Number(this.element.style.top.replace("px","")),r=Number(this.element.style.left.replace("px",""));else{var o=this.enableRtl?"left":"right",a=s.calculatePosition(e,o,"top");n=a.top,r=a.left;var d=s.isCollide(i,null,this.enableRtl?r-i.offsetWidth:r,n),h=d.indexOf("left")>-1||d.indexOf("right")>-1;h&&(r=(a=s.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||h)&&(r=this.enableRtl&&h?r:r-i.offsetWidth),d.indexOf("bottom")>-1&&(n=(a=this.callFit(i,!1,!0,n,r)).top)}this.toggleVisiblity(i,!1),i.style.top=n+"px",i.style.left=r+"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,r=this.getFields(n);if(t.isBlazor()&&this.template&&e.length&&e[0].properties){var l=[];e.forEach(function(e,i){l.push({}),l[i][r.text]=e[r.text],e[r.id]||(e[r.id]=t.getUniqueID("menuitem")),l[i][r.id]=e[r.id],l[i][r.iconCss]=e[r.iconCss],l[i][r.url]=e[r.url],l[i][r.child]=e[r.child],l[i][r.separator]=e[r.separator]}),e=l}var o=this.hasField(e,this.getField("iconCss",n)),a={showIcon:o,moduleName:"menu",fields:r,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[r.id]]||(e.curData[e.fields[r.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[r.iconCss]]&&(e.curData[e.fields[r.iconCss]]=null)},itemCreated:function(e){if(e.curData[s.getField("separator",n)]&&(e.item.classList.add("e-separator"),e.item.removeAttribute("role")),!o||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&&(a.templateID=this.element.id+"Template");var d=i.ListBase.createList(this.createElement,e,a,!this.template,this);return d.setAttribute("tabindex","0"),this.isMenu&&d.setAttribute("role","menu"),d},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(),r=this.getWrapper(),l=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(n){if((""!==n.id?l.exec(n.id)[1]:n.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([y,C],[this.getWrapper()]),!this.navIdx.length)return;o=!0}s&&t.closest(s,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([y],this.isMenu?[n].concat(this.getPopups()):[n]),this.removeLIStateByClass([y],this.isMenu?[r].concat(this.getPopups()):[r]),s.classList.add(y),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([y],[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([y],[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([y,C],[e])}},n.prototype.removeLIStateByClass=function(e,i){for(var s,n=0;n<i.length;n++)!function(n){e.forEach(function(e){(s=t.select("."+e,i[n]))&&s.classList.remove(e)})}(n)},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.classList.contains("e-hide-menu")?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),r=new RegExp("-ej2menu-(.*)-popup"),l=n?t.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,o=n&&l&&(this.isMenu?this.getIndex(n.id,!0).length>0:i.firstElementChild.id===l.firstElementChild.id);if(t.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([y],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&l&&this.isMenu){var a=l.id?r.exec(l.id)[1]:l.querySelector(".e-menu-parent").id;if(this.element.id!==a)return}if(o&&"click"===e.type&&!n.classList.contains(b)){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(b))c=i.children[this.navIdx.length-1],this.toggleAnimation(c),(f=this.getLIByClass(c,C))&&f.classList.remove(C),t.detach(n.parentNode),this.navIdx.pop();else if(!n.classList.contains("e-separator")){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=this.getLIByClass(p,C);f&&f.classList.remove(C),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,"."+x),v=Array.prototype.indexOf.call(this.getPopups(),m)+1;v<this.navIdx.length&&(this.closeMenu(v+1,e),m&&this.removeLIStateByClass([y,C],[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("."+N).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([C],[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 r=this.getUlByNavIdx(),l=this.getLIByClass(r,C);l&&(l.setAttribute("aria-expanded","false"),l.classList.remove(C))}}this.keyType=""},n.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,C);t&&t.classList.remove(C),this.isMenu||e.classList.remove(y),e.classList.add(C)},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=t||e.id,n=!1!==i,r=this.getIndex(s,n),l=this.getItem(r);l.iconCss=e.iconCss,l.id=e.id,l.text=e.text,l.url=e.url,l.separator=e.separator,l.items=e.items},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,i,s){void 0===s&&(s=!0);var n=Array.prototype.indexOf.call(e.querySelectorAll("li"),i);return n=this.isMenu&&this.template&&t.isBlazor()?Array.prototype.indexOf.call(e.querySelectorAll(i.tagName),i):Array.prototype.indexOf.call(e.children,i),s&&e.children[0].classList.contains(b)&&n--,n},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(),r=this,l=0,a=Object.keys(e);l<a.length;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,m),h):d(t.getInstance(h,p),h),n.style.overflow="",n.appendChild(r.element),r.getPopups().forEach(function(e){h=e.children[0],d(t.getInstance(h,m),h),e.style.overflow=""})}break;case"items":var c=void 0,u=void 0,f=void 0;if(Object.keys(i.items).length)for(var v=Object.keys(e.items),g=0;g<v.length;g++)(u=r.getChangedItemIndex(e,[],Number(v[g]))).length<=r.getWrapper().children.length&&(c=u.pop(),f=r.getItems(u),r.insertAfter([f[c]],f[c].text),r.removeItem(f,u,c),r.setItems(f,u)),u.length=0;else{r.updateItem(r.element,r.items);for(var g=1,y=n.childElementCount;g<y;g++)t.detach(n.lastElementChild);r.isMenu&&t.isBlazor()?r.updateItemsByNavIdx():r.navIdx=[]}}}(a[l])},n.prototype.updateItem=function(e,i){t.isBlazor()?e=this.removeChildElement(e):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],r=Object.keys(n.items).pop();r&&this.getChangedItemIndex(n,t,Number(r))}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,r=void 0,l=t.selectAll(e),o=0,a=l.length;o<a;o++)n=l[o],this.isMenu?t.EventHandler.remove(n,"click",this.menuHeaderClickHandler):t.Browser.isIos?(r=t.getInstance(n,t.Touch))&&r.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("."+y))e.querySelector("."+y).focus();else{var s=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1];s?s.querySelector("."+C).focus():this.element.focus()}else if(e===this.element){var n=this.getLIByClass(this.element,y);n&&n.classList.remove(y);var r=this.getLIByClass(this.element,C);r&&r.classList.remove(C),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,r){void 0===i&&(i=this.items),void 0===s&&(s=[]),void 0===n&&(n=!1),void 0===r&&(r=0);var l;r=n?r+1:0;for(var o=0,a=i.length;o<a;o++){if(l=i[o],(t?l[this.getField("itemId",r)]:l[this.getField("text",r)])===e){s.push(o);break}if(l[this.getField("children",r)]&&l[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,l[this.getField("children",r)],s,!0,r))[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,r,l,o,a="e-disabled",d=0;d<e.length;d++){if(l=this.getIndex(e[d],s),this.navIdx.length){if(1!==l.length){o=!1;for(var h=0,c=l.length-1;h<c;h++)if(l[h]!==this.navIdx[h]){o=!0;break}if(o)continue}}else if(1!==l.length)continue;r=l.pop(),(n=this.getUlByNavIdx(l.length))&&(i?this.isMenu?(n.children[r].classList.remove(a),n.children[r].removeAttribute("aria-disabled")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(a):n.children[r].classList.remove(a):this.isMenu?(n.children[r].classList.add(a),n.children[r].setAttribute("aria-disabled","true")):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(a):n.children[r].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,r,l,o=0;o<e.length;o++)r=(l=this.getIndex(e[o],s)).pop(),(n=this.getUlByNavIdx(l.length))&&(i?t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.add(E):n.children[r].classList.add(E):t.Browser.isDevice&&!n.classList.contains("e-contextmenu")?n.children[r+1].classList.remove(E):n.children[r].classList.remove(E))},n.prototype.removeItems=function(e,t){for(var i,s,n,r=0;r<e.length;r++)i=(s=this.getIndex(e[r],t)).pop(),n=this.getItems(s),this.removeItem(n,s,i)},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 r,l,o,a,d,h=0;h<e.length;h++){l=(o=this.getIndex(i,s)).pop(),a=this.getItems(o),d=new S(a[0],"items",e[h],!0),a.splice(n?l+1:l,0,d);var c=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);if(o.length<c.length){l=n?l+1:l,r=this.createItems(a).children[l];var p=this.isMenu?t.select(".e-menu-parent",c[o.length]):c[o.length];p.insertBefore(r,p.children[l])}}},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.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.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"])}},g([t.Event()],n.prototype,"beforeItemRender",void 0),g([t.Event()],n.prototype,"beforeOpen",void 0),g([t.Event()],n.prototype,"onOpen",void 0),g([t.Event()],n.prototype,"beforeClose",void 0),g([t.Event()],n.prototype,"onClose",void 0),g([t.Event()],n.prototype,"select",void 0),g([t.Event()],n.prototype,"created",void 0),g([t.Property("")],n.prototype,"cssClass",void 0),g([t.Property(0)],n.prototype,"hoverDelay",void 0),g([t.Property(!1)],n.prototype,"showItemOnClick",void 0),g([t.Property("")],n.prototype,"target",void 0),g([t.Property("")],n.prototype,"filter",void 0),g([t.Property(null)],n.prototype,"template",void 0),g([t.Property(!1)],n.prototype,"enableScrolling",void 0),g([t.Property(!1)],n.prototype,"enableHtmlSanitizer",void 0),g([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],n.prototype,"fields",void 0),g([t.Collection([],S)],n.prototype,"items",void 0),g([t.Complex({duration:400,easing:"ease",effect:"SlideDown"},w)],n.prototype,"animationSettings",void 0),n=g([t.NotifyPropertyChanges],n)}(t.Component),k=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)}}(),L=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},A="e-toolbar-items",D="e-toolbar-item",P="e-toolbar-popup",M=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return k(i,e),L([t.Property("")],i.prototype,"id",void 0),L([t.Property("")],i.prototype,"text",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property(!1)],i.prototype,"showAlwaysInPopup",void 0),L([t.Property(!1)],i.prototype,"disabled",void 0),L([t.Property("")],i.prototype,"prefixIcon",void 0),L([t.Property("")],i.prototype,"suffixIcon",void 0),L([t.Property(!0)],i.prototype,"visible",void 0),L([t.Property("None")],i.prototype,"overflow",void 0),L([t.Property("")],i.prototype,"template",void 0),L([t.Property("Button")],i.prototype,"type",void 0),L([t.Property("Both")],i.prototype,"showTextOn",void 0),L([t.Property(null)],i.prototype,"htmlAttributes",void 0),L([t.Property("")],i.prototype,"tooltipText",void 0),L([t.Property("Left")],i.prototype,"align",void 0),L([t.Event()],i.prototype,"click",void 0),i}(t.ChildProperty),T=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 k(i,e),i.prototype.destroy=function(){var i=this;for(this.isReact&&this.clearTemplate(),e.prototype.destroy.call(this),this.unwireEvents(),this.tempId.forEach(function(e){t.isNullOrUndefined(i.element.querySelector(e))||(document.body.appendChild(i.element.querySelector(e)).style.display="none")});this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&this.element.appendChild(this.ctrlTem),this.clearProperty(),this.popObj=null,this.tbarAlign=null,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)})},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("e-vertical"),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,"e-rtl")},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,"e-tbar-pos"),this.scrollModule.destroy(),this.scrollModule=null)},i.prototype.destroyItems=function(){this.element&&[].slice.call(this.element.querySelectorAll("."+D)).forEach(function(e){t.detach(e)});var e=this.element.querySelector("."+A);this.tbarAlign&&([].slice.call(e.children).forEach(function(e){t.detach(e)}),this.tbarAlign=!1,this.remove(e,"e-tbar-pos")),this.clearProperty()},i.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,"e-rtl"),this.destroyScroll()),this.remove(this.element,"e-tbar-extended"),this.remove(this.element,"e-extended-toolbar");var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,"e-toolbar-multirow"),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("."+D):this.element===i||e?this.element.querySelector("."+D+":not(.e-overlay ):not(.e-separator ):not(.e-hidden )"):t.closest(i,"."+D)},i.prototype.keyHandling=function(e,i,s,n,r){var l,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");p?t.isVisible(this.popObj.element)&&(o=[].slice.call(p.children),l="home"===i.action?o[0]:o[o.length-1]):(o=this.element.querySelectorAll("."+A+" ."+D),l="home"===i.action?o[0]:o[o.length-1]),l&&this.elementFocus(l)}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 u=a.element,f=u.firstElementChild;if("previous"===c&&f===e||"next"===c&&u.lastElementChild===e)return;this.eleFocus(e,c)}else"moveDown"===i.action&&a&&t.isVisible(a.element)&&this.elementFocus(e);break;case"tab":if(!r&&!n){var m=e.firstElementChild;d===s&&(this.activeEle?this.activeEle.focus():(this.activeEleRemove(m),m.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("e-overlay")){e.preventDefault();var i=t.classList.contains("e-hor-nav"),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("e-overlay"):i.classList.remove("e-overlay"),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("e-separator")||e.classList.contains("e-overlay")||e.getAttribute("disabled")||e.classList.contains("e-hidden")||!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){r=n.querySelector("."+D);this.eleContains(r)?this.eleFocus(r,i):(r.firstElementChild.focus(),this.activeEleSwitch(r))}else{var r=n.lastElementChild;this.eleContains(r)?this.eleFocus(r,i):this.elementFocus(r)}}},i.prototype.clickHandler=function(e){var i=this,s=e.target,n=this.element,r=!t.isNullOrUndefined(t.closest(s,".e-toolbar-pop")),l=s.classList,o=t.closest(s,".e-hor-nav");o||(o=s),n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!l.contains("e-hor-nav")||(l=s.querySelector(".e-icons").classList),(l.contains("e-popup-up-icon")||l.contains("e-popup-down-icon"))&&this.popupClickHandler(n,o,"e-rtl");var a,d=t.closest(e.target,"."+D);if(!t.isNullOrUndefined(d)&&!d.classList.contains("e-overlay")||o.classList.contains("e-hor-nav")){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)&&r&&!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("e-nav-active"),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("e-nav-active"),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("e-vertical"),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add("e-vertical"),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("."+A+" .e-toolbar-center").removeAttribute("style"),this.isVertical?this.scrollModule=new m({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]):this.scrollModule=new p({scrollStep:this.scrollStep,enableRtl:this.enableRtl},i[0]),this.remove(this.scrollModule.element,"e-tbar-pos"),t.setStyleAttribute(this.element,{overflow:"hidden"}))},i.prototype.itemWidthCal=function(e){var i,s=this,n=0;return[].slice.call(t.selectAll("."+D,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 r=e.querySelector(".e-hor-nav"),l=e.querySelector(".e-scroll-nav"),o=0;return r?o=this.isVertical?r.offsetHeight:r.offsetWidth:l&&(o=this.isVertical?2*l.offsetHeight:2*l.offsetWidth),n>s-o},i.prototype.refreshOverflow=function(){this.resize()},i.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,"e-tbar-pos"),this.itemPositioning())},i.prototype.renderOverflowMode=function(){var e=this.element,i=e.querySelector("."+A),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(A)));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,"e-toolbar-multirow"),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,"e-extended-toolbar"),(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("."+A+" ."+D,e))),this.element.querySelector(".e-hor-nav").setAttribute("tabIndex","0"),this.element.querySelector(".e-hor-nav").setAttribute("role","list")},i.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll(".e-separator")),i=e.querySelector(".e-multirow-separator"),s=e.querySelector(".e-extended-separator"),n="MultiRow"===this.overflowMode?i:s;null!==n&&("MultiRow"===this.overflowMode?n.classList.remove("e-multirow-separator"):"Extended"===this.overflowMode&&n.classList.remove("e-extended-separator"));for(var r=0;r<=t.length-1;r++)t[r].offsetLeft<30&&0!==t[r].offsetLeft&&("MultiRow"===this.overflowMode?t[r].classList.add("e-multirow-separator"):"Extended"===this.overflowMode&&t[r].classList.add("e-extended-separator"))},i.prototype.createPopupEle=function(e,i){var s=e.querySelector(".e-hor-nav"),n=this.isVertical;s||this.createPopupIcon(e),s=e.querySelector(".e-hor-nav");var r=n?s.offsetHeight:s.offsetWidth,l=(n?e.offsetHeight:e.offsetWidth)-r;this.element.classList.remove("e-rtl"),t.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,i,l,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},i.prototype.pushingPoppedEle=function(e,i,s,n,r){var l=e.element,o=[].slice.call(t.selectAll("."+P,l.querySelector("."+A))),a=t.selectAll(".e-overflow-show",s),d=0,h=0;o.forEach(function(l,o){a=t.selectAll(".e-overflow-show",s),l.classList.contains("e-overflow-show")&&a.length>0?e.tbResize&&a.length>o?(s.insertBefore(l,a[o]),++h):(s.insertBefore(l,s.children[a.length]),++h):l.classList.contains("e-overflow-show")?(s.insertBefore(l,s.firstChild),++h):e.tbResize&&l.classList.contains("e-overflow-hide")&&s.children.length>0&&0===a.length?(s.insertBefore(l,s.firstChild),++h):l.classList.contains("e-overflow-hide")?i.push(l):e.tbResize?(s.insertBefore(l,s.childNodes[d+h]),++d):s.appendChild(l),l.classList.contains("e-separator")?t.setStyleAttribute(l,{display:"",height:r+"px"}):t.setStyleAttribute(l,{display:"",height:n+"px"})}),i.forEach(function(e){s.appendChild(e)});for(var c=t.selectAll("."+D,l.querySelector("."+A)),p=c.length-1;p>=0;p--){var u=c[p];if(!u.classList.contains("e-separator")||"Extended"===this.overflowMode)break;t.setStyleAttribute(u,{display:"none"})}},i.prototype.createPopup=function(){var e,t,i=this.element;"Extended"===this.overflowMode&&(t=i.querySelector(".e-separator:not(."+P+")"),e="auto"===i.style.height||""===i.style.height?null:t.offsetHeight);var s,n=i.querySelector("."+D+":not(.e-separator):not(."+P+")"),r="auto"===i.style.height||""===i.style.height?null:n&&n.offsetHeight,l=[],o=document.getElementById(i.id+"_popup");if(o&&o.classList.contains("e-toolbar-pop"))s=o;else{var a=this.createElement("div",{id:i.id+"_popup",className:"e-toolbar-pop e-toolbar-extended"}),d=this.createElement("div",{id:i.id+"_popup",className:"e-toolbar-pop"});s="Extended"===this.overflowMode?a:d}this.pushingPoppedEle(this,l,s,r,e),this.popupInit(i,s)},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),t.setStyleAttribute(this.element,{overflow:""});var r=window.getComputedStyle(this.element),l=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(l.appendTo(i),"Extended"===this.overflowMode&&(l.width=parseFloat(r.width)+2*parseFloat(r.borderRightWidth),l.offsetX=0),t.EventHandler.add(document,"scroll",this.docEvent.bind(this)),t.EventHandler.add(document,"click ",this.docEvent.bind(this)),l.element.style.maxHeight=l.element.offsetHeight+"px",this.isVertical&&(l.element.style.visibility="hidden"),this.isExtendedOpen){var o=this.element.querySelector(".e-hor-nav");o.classList.add("e-nav-active"),t.classList(o.firstElementChild,["e-popup-up-icon"],["e-popup-down-icon"]),this.element.querySelector(".e-toolbar-extended").classList.add("e-popup-open")}else l.hide();this.popObj=l,this.element.setAttribute("aria-haspopup","true")}},i.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,"e-tbar-extended"):this.remove(this.element,"e-tbar-extended"))},i.prototype.popupOpen=function(e){var i=this.popObj;this.isVertical||(i.offsetY=this.getElementOffsetY(),i.dataBind());var n=this.popObj.element,r=this.popObj.element.parentElement,l=r.querySelector(".e-hor-nav");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(r).top,a=l.firstElementChild;l.classList.add("e-nav-active"),t.classList(a,["e-popup-up-icon"],["e-popup-down-icon"]),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:""})}i&&i.refreshPosition()},i.prototype.popupClose=function(e){var i=this.element.querySelector(".e-hor-nav"),s=i.firstElementChild;i.classList.remove("e-nav-active"),t.classList(s,["e-popup-down-icon"],["e-popup-up-icon"]),this.tbarPopupHandler(!1)},i.prototype.checkPriority=function(e,i,s,n){for(var r,l=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),r=this.isVertical?i[p].offsetHeight:i[p].offsetWidth;var v=m?r+u:r;if(c(i[p],["e-popup-alone"])&&l&&(i[p].classList.add(P),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("e-separator")){if("Extended"===this.overflowMode)d===h&&c(g=i[p],["e-separator","e-ignore"])&&(i[p].classList.add(P),h++),d++;else if("Popup"===this.overflowMode){if(a>0&&d===h){var g=i[p+d+(a-1)];c(g,["e-separator","e-ignore"])&&t.setStyleAttribute(g,{display:"none"})}a++,d=0,h=0}}else d++;i[p].classList.contains("e-overflow-show")&&n?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:c(i[p],["e-separator","e-ignore"])?s-=(this.isVertical?i[p].offsetHeight:i[p].offsetWidth)+u:(i[p].classList.add(P),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("."+D+":not(."+P+")",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 r=this.createElement("div",{className:"e-popup-down-icon e-icons"});n.appendChild(r),n.setAttribute("tabindex","0"),n.setAttribute("role","list"),e.appendChild(n)},i.prototype.tbarPriRef=function(e,i,s,n,r,l,o,a){var d=a,h=this.popObj.element,c=t.selectAll("."+P+":not(.e-overflow-show)",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,"e-ignore");if(!t.isNullOrUndefined(u)&&p(u,"e-separator")&&!t.isVisible(u)||f){u.style.display="inherit";var m=u.offsetWidth+2*parseFloat(window.getComputedStyle(u).marginRight),v=u.previousElementSibling;l+m<o||r?(e.insertBefore(n,e.children[i+d-(i-s)]),t.isNullOrUndefined(v)||(v.style.display="")):v.classList.contains("e-separator")&&(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,r=this.isVertical,l=n.querySelector("."+A),o=n.querySelector(".e-hor-nav");if(!t.isNullOrUndefined(o)){l.removeAttribute("style"),e.style.display="block";var a;a=r?n.offsetHeight-(o.offsetHeight+l.offsetHeight):n.offsetWidth-(o.offsetWidth+l.offsetWidth);var d=0;[].slice.call(e.children).forEach(function(e){d+=s.popupEleWidth(e),t.setStyleAttribute(e,{position:""})}),a+(r?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(".e-ignore")),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(".e-hor-nav").offsetWidth,n=e.querySelector("."+A).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("e-popup-text")){var n=e.children[0];!t.isNullOrUndefined(s)&&e.classList.contains("e-popup-text")?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,r,l=this.popupPriCount>0,o=this.tbarEle,a=this.element.querySelector("."+A),d=0,h=this,c=0,p=[].slice.call(i.children);c<p.length&&"break"!==function(i){if(i.classList.contains("e-popup-alone")&&l&&!s)return"continue";var c=h.popupEleWidth(i);if(i===h.tbarEle[0]&&(c+=h.tbarEleMrgn),i.style.position="",!(c<e||s))return"break";if(t.setStyleAttribute(i,{minWidth:"",height:"",minHeight:""}),i.classList.contains("e-overflow-hide")||i.classList.remove(P),r=h.tbarEle.indexOf(i),h.tbarAlign){var p=h.items[r].align;r=h.tbarAlgEle[(p+"s").toLowerCase()].indexOf(i),o=h.tbarAlgEle[(p+"s").toLowerCase()],a=h.element.querySelector("."+A+" .e-toolbar-"+p.toLowerCase())}var u=0;"Extended"!==h.overflowMode&&o.slice(0,r).forEach(function(t){(t.classList.contains("e-overflow-show")||t.classList.contains("e-separator"))&&(t.classList.contains("e-separator")&&(t.style.display="",e-=t.offsetWidth),u++)}),d=h.ignoreEleFetch(r,a),i.classList.contains("e-overflow-show")?(h.tbarPriRef(a,r,u,i,s,c,e,d),e-=i.offsetWidth):0===r?(a.insertBefore(i,a.firstChild),e-=i.offsetWidth):(n=t.selectAll(".e-overflow-show",h.popObj.element).length,a.insertBefore(i,a.children[r+d-n]),e-=i.offsetWidth),i.style.height=""}(p[c]);c++);this.checkOverflow(this.element,this.element.getElementsByClassName(A)[0])&&!s&&this.renderOverflowMode()},i.prototype.removePositioning=function(){var e=this.element.querySelector("."+A);if(!t.isNullOrUndefined(e)&&e.classList.contains("e-tbar-pos")){this.remove(e,"e-tbar-pos");var i=[].slice.call(e.childNodes);i[1].removeAttribute("style"),i[2].removeAttribute("style")}},i.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+A);this.add(e,"e-tbar-pos"),this.itemPositioning()},i.prototype.itemPositioning=function(){var e,i=this.element.querySelector("."+A);if(!t.isNullOrUndefined(i)&&i.classList.contains("e-tbar-pos")){var s,n=this.element.querySelector(".e-hor-nav");if(this.scrollModule){var r=this.isVertical?"e-vscroll-content":"e-hscroll-content";s=[].slice.call(i.querySelector("."+r).children)}else s=[].slice.call(i.childNodes);e=this.isVertical?s[0].offsetHeight+s[2].offsetHeight:s[0].offsetWidth+s[2].offsetWidth;var l=this.isVertical?this.element.offsetHeight:this.element.offsetWidth;if(n){l-=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(!(l<=e)){var a=(l-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:"e-toolbar-center"})),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,"e-tbar-pos");else if("Left"!==e.align){var r=t.childNodes,l=n[0];[].slice.call(r).forEach(function(e){s.tbarAlgEle.lefts.push(e),l.appendChild(e)}),t.appendChild(l),t.appendChild(n[1]),t.appendChild(n[2]),this.tbarAlign=!0,this.add(t,"e-tbar-pos")}}},i.prototype.ctrlTemplate=function(){var e=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,A),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,D))})},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("."+A)),i||(i=this.createElement("div",{className:A})),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,r=n.length;t.isNullOrUndefined(i)&&(i=!0);var l=function(e,t){e?(t.classList.remove("e-overlay"),t.setAttribute("aria-disabled","false")):(t.classList.add("e-overlay"),t.setAttribute("aria-disabled","true"))};if(!t.isNullOrUndefined(r)&&r>=1){for(var o=0,a=[].slice.call(n);o<r;o++){var d=a[o];if("number"==typeof d){if(s=this.getElementByIndex(d),t.isNullOrUndefined(s))return;n[o]=s}else s=d;l(i,s)}i?t.removeClass(n,"e-overlay"):t.addClass(n,"e-overlay")}else{if("number"==typeof n){if(s=this.getElementByIndex(n),t.isNullOrUndefined(s))return}else s=e;l(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("."+A);if(t.isNullOrUndefined(n))return void this.itemsRerender(e);var r,l="Left";t.isNullOrUndefined(i)&&(i=0),e.forEach(function(e){t.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==l||(l=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("."+D,this.element),d.align=l,r=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"===l?this.tbarAlign?((c=t.closest(s[0],"."+A).children[h]).insertBefore(r,c.children[i]),this.tbarAlgEle[(d.align+"s").toLowerCase()].splice(i,0,r),this.refreshPositioning()):0===s.length?(s=t.selectAll("."+A,this.element))[0].appendChild(r):s[0].parentNode.insertBefore(r,s[i]):(this.tbarItemAlign(d,n,1),this.tbarAlign=!0,(c=t.closest(s[0],"."+A).children[h]).appendChild(r),this.tbarAlgEle[(d.align+"s").toLowerCase()].push(r),this.refreshPositioning()),this.items.splice(i,0,d),this.tbarEle.splice(i,0,r),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("."+D,this.element));if("number"==typeof s)i=parseInt(e.toString(),10),this.removeItemByIndex(i,n);else if(s&&s.length>1)for(var r=0,l=[].slice.call(s);r<l.length;r++){o=l[r];i=this.tbarEle.indexOf(o),this.removeItemByIndex(i,n),n=t.selectAll("."+D,this.element)}else{var 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(),t.detach(i[e]),this.items.splice(s,1),this.tbarEle.splice(s,1)}},i.prototype.templateRender=function(e,i,s,n){var r,l=s.type,o=e;if("object"==typeof e&&(r="function"==typeof o.appendTo),"string"!=typeof e&&r){if("Input"===l){var a=this.createElement("input");s.id?a.id=s.id:a.id=t.getUniqueID("tbr-ipt"),i.appendChild(a),o.appendTo(a)}}else{var d=void 0,h=e;h="string"==typeof e?e.trim():e;try{if("object"!=typeof e||t.isNullOrUndefined(e.tagName)){if(document.querySelectorAll(h).length){var c=(a=document.querySelector(h)).outerHTML.trim();i.appendChild(a),a.style.display="",t.isNullOrUndefined(c)||this.tempId.push(h)}}else i.appendChild(e)}catch(e){d=t.compile(h)}var p=void 0;t.isNullOrUndefined(d)||(p=d({},this,"template",this.element.id+n+"_template",this.isStringTemplate)),!t.isNullOrUndefined(p)&&p.length>0&&[].slice.call(p).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 r,l,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?(r=e.prefixIcon+" e-icons",l="Left"):(r=e.suffixIcon+" e-icons",l="Right"));var d=new n.Button({iconCss:r,iconPosition:l});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:D});n.setAttribute("aria-disabled","false");var r=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",r.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,"e-separator")}if(e.showTextOn){var l=e.showTextOn;"Toolbar"===l?(this.add(n,"e-toolbar-text"),this.add(n,"e-tbtn-align")):"Overflow"===l&&this.add(n,"e-popup-text")}if(e.overflow){var o=e.overflow;"Show"===o?this.add(n,"e-overflow-show"):"Hide"===o&&(n.classList.contains("e-separator")||this.add(n,"e-overflow-hide"))}return"Show"!==e.overflow&&e.showAlwaysInPopup&&!n.classList.contains("e-separator")&&(this.add(n,"e-popup-alone"),this.popupPriCount++),e.disabled&&this.add(n,"e-overlay"),!1===e.visible&&this.add(n,"e-hidden"),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.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(A)[0]);if(!i){this.destroyScroll();var s=e.querySelector("."+A);t.isNullOrUndefined(s)||(this.remove(s,"e-multirow-pos"),this.tbarAlign&&this.add(s,"e-tbar-pos"))}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(".e-toolbar-extended");"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 r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(e.items instanceof Array&&i.items instanceof Array||this.isServerRendered)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(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("."+A+" ."+D,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,"e-rtl"),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(s,"e-rtl"):this.remove(s,"e-rtl"),t.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,"e-rtl"):this.remove(this.scrollModule.element,"e-rtl")),t.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,"e-rtl"):this.remove(this.popObj.element,"e-rtl")),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,r="object"==typeof e,l=e,o=[].slice.call(t.selectAll("."+D,this.element));if(r?n=e:this.tbarEle[l]&&(n=[].slice.call(t.selectAll("."+D,this.element))[l]),n){if(i?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),i&&t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator")){if(t.isNullOrUndefined(n.firstElementChild.getAttribute("tabindex"))){n.firstElementChild.setAttribute("tabindex","-1");var a=[].slice.call(t.selectAll("."+D,this.element));r&&(l=a.indexOf(n));for(var d=a[++l];d;){if(!(u=this.eleContains(d))){d.firstElementChild.removeAttribute("tabindex");break}d=a[++l]}}}else if(t.isNullOrUndefined(this.element.getAttribute("tabindex"))&&!n.classList.contains("e-separator"))for(var h=!1,c=!1,p=o[s=0];p;)if(p.classList.contains("e-separator"))p=o[++s];else if(t.isNullOrUndefined(p.firstElementChild.getAttribute("tabindex")))p.firstElementChild.setAttribute("tabindex","-1"),h=!0;else{if(h&&c)break;var u=this.eleContains(p);u||(p.firstElementChild.removeAttribute("tabindex"),c=!0),p=o[++s]}this.refreshOverflow()}},L([t.Collection([],M)],i.prototype,"items",void 0),L([t.Property("auto")],i.prototype,"width",void 0),L([t.Property("auto")],i.prototype,"height",void 0),L([t.Property("")],i.prototype,"cssClass",void 0),L([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),L([t.Property()],i.prototype,"scrollStep",void 0),L([t.Property(!0)],i.prototype,"enableCollision",void 0),L([t.Property(!0)],i.prototype,"enableHtmlSanitizer",void 0),L([t.Property(!0)],i.prototype,"allowKeyboard",void 0),L([t.Event()],i.prototype,"clicked",void 0),L([t.Event()],i.prototype,"created",void 0),L([t.Event()],i.prototype,"destroyed",void 0),L([t.Event()],i.prototype,"beforeCreate",void 0),i=L([t.NotifyPropertyChanges],i)}(t.Component),U=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)}}(),H=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},B="e-acrdn-item",R="e-acrdn-header",j="e-acrdn-panel",q="e-acrdn-content",F=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property("SlideDown")],i.prototype,"effect",void 0),H([t.Property(400)],i.prototype,"duration",void 0),H([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),z=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},F)],i.prototype,"collapse",void 0),H([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},F)],i.prototype,"expand",void 0),i}(t.ChildProperty),V=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return U(i,e),H([t.Property(null)],i.prototype,"content",void 0),H([t.Property(null)],i.prototype,"header",void 0),H([t.Property(null)],i.prototype,"cssClass",void 0),H([t.Property(null)],i.prototype,"iconCss",void 0),H([t.Property(!1)],i.prototype,"expanded",void 0),H([t.Property(!0)],i.prototype,"visible",void 0),H([t.Property(!1)],i.prototype,"disabled",void 0),H([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),W=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 U(i,e),i.prototype.destroy=function(){var i=this;this.isReact&&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.ctrlTem.firstElementChild;)s.appendChild(this.ctrlTem.firstElementChild);s.classList.remove("e-acrdn-root"),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,"."+j);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),t.isNullOrUndefined(e)?this.element.classList.add("e-acrdn-root"):(e.classList.add("e-nested"),this.isNested=!0),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.isServerRendered?this.wireFocusEvents():(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});var s={"aria-disabled":"false",role:"presentation","aria-multiselectable":"true"};t.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),t.attributes(this.element,s),"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("."+B));e<i.length;e++){var s=i[e],n=s.querySelector("."+R);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:"."+R})),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{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}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(".e-accordion-container",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:"e-toggle-icon"}),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,r){i=s.renderInnerItem(e,r),n.appendChild(i),i.childElementCount>0&&(t.EventHandler.add(i.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(i.querySelector("."+R),"blur",s.focusOut,s))});else{var r=this.items;n&&r.length>0&&r.forEach(function(i,r){e=s.renderInnerItem(i,r),n.appendChild(e),e.childElementCount>0&&(t.EventHandler.add(e.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(e.querySelector("."+R),"blur",s.focusOut,s))})}this.isReact&&this.renderReactTemplates()},i.prototype.clickHandler=function(e){var i,s=this,n=e.target,r=this.getItems(),l={};if(t.closest(n,".e-accordion")===this.element){n.classList.add("e-target");var o=t.closest(n,"."+B),a=t.closest(n,"."+R),d=t.closest(n,"."+j);o&&(t.isNullOrUndefined(a)||t.isNullOrUndefined(d))&&(a=o.children[0],d=o.children[1]),a&&(i=t.select(".e-toggle-icon",a));var h;a?h=t.closest(a,"."+B):d&&(h=t.closest(d,"."+B));var c=this.getIndexByItem(o);if(h&&(l.item=r[this.getIndexByItem(h)]),l.originalEvent=e,!(!t.isNullOrUndefined(i)&&o.childElementCount<=1)||!t.isNullOrUndefined(d)&&t.isNullOrUndefined(t.select(".e-acrdn-header .e-toggle-icon",h)))this.afterContentRender(n,l,o,a,d,h);else if(this.isServerRendered){var p=o.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",c).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)}):this.interopAdaptor.invokeMethodAsync("OnDataClick",p).then(function(){s.isDestroyed||s.afterContentRender(n,l,o,a,d,h)})}else o.appendChild(this.contentRendering(c)),this.ariaAttrUpdate(o),this.afterContentRender(n,l,o,a,d,h);this.isReact&&this.renderReactTemplates()}},i.prototype.afterContentRender=function(e,i,s,n,r,l){var o=this,a=[];this.trigger("clicked",i);var d=r&&!t.isNullOrUndefined(t.select(".e-target",r)),h=r&&!t.isNullOrUndefined(t.select(".e-accordion",r))&&t.isNullOrUndefined(t.closest(e,".e-acrdn-panel .e-accordion")),c=r&&t.isNullOrUndefined(t.select(".e-accordion",r))||!(t.closest(e,".e-accordion")===this.element);if(d=d&&(h||c),e.classList.remove("e-target"),!(e.classList.contains(j)||e.classList.contains(q)||d)){var p=this.element.querySelector(".e-accordion-container"),u=p?p.children:this.element.children;[].slice.call(u).forEach(function(e){e.classList.contains("e-active")&&a.push(e)});var f=[].slice.call(this.element.querySelectorAll(".e-acrdn-item [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(l)&&"true"===r.getAttribute("e-animate"),b=!1;if(!t.isNullOrUndefined(s)&&!t.isNullOrUndefined(n)){var C=t.select("."+j,s),N=t.closest(s,".e-acrdn-root").querySelector(".e-expand-state");if(t.isNullOrUndefined(C))return;b=N===s,!t.isVisible(C)||y&&!l.classList.contains("e-selected")?(a.length>0&&"Single"===this.expandMode&&!y&&a.forEach(function(e){o.collapse(t.select("."+j,e)),e.classList.remove("e-expand-state")}),this.expand(C)):this.collapse(C),t.isNullOrUndefined(N)||b||N.classList.remove("e-expand-state")}}},i.prototype.eleMoveFocus=function(e,i,s){var n,r=t.closest(s,"."+B);s===i?n=("moveUp"===e?s.lastElementChild:s).querySelector("."+R):s.classList.contains(R)&&(r="moveUp"===e?r.previousElementSibling:r.nextElementSibling)&&(n=t.select("."+R,r)),n&&n.focus()},i.prototype.keyActionHandler=function(e){var i=e.target,s=t.closest(e.target,R);if(!t.isNullOrUndefined(s)||i.classList.contains("e-accordion")||i.classList.contains(R)){var n,r=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,r,i);break;case"space":case"enter":n=i.nextElementSibling,!t.isNullOrUndefined(n)&&n.classList.contains(j)?"true"!==n.getAttribute("e-animate")&&i.click():i.click();break;case"home":case"end":("home"===e.action?r.firstElementChild.children[0]:r.lastElementChild.children[0]).focus()}}},i.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:R,id:t.getUniqueID("acrdn_header")}),i={tabindex:"0",role:"heading","aria-selected":"false","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:B});if(s.id=t.getUniqueID("acrdn_item"),t.isNullOrUndefined(e.id)&&(e.id=s.id),t.attributes(s,{"aria-expanded":"false"}),this.headerTemplate){var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});return n.appendChild(r),t.append(this.getheaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),r),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));var n=this.headerEleGenerate(),r=this.createElement("div",{className:"e-acrdn-header-content"});n.appendChild(r),n.appendChild(this.fetchElement(r,e.header,i,!0)),s.appendChild(n)}var l=t.select("."+R,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],"e-overlay"),!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(l)?((l=this.headerEleGenerate()).appendChild(o),s.appendChild(l)):l.insertBefore(o,l.childNodes[0])}if(e.content&&this.angularnativeCondiCheck(e,"content")){var d=this.toggleIconGenerate();t.isNullOrUndefined(l)&&(l=this.headerEleGenerate(),s.appendChild(l)),l.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 r=JSON.parse(s.elementRef.nativeElement.data.replace("bindings=",""));return!(!t.isNullOrUndefined(r)&&"false"===r["ng-reflect-ng-if"])}return!0},i.prototype.fetchElement=function(e,i,s,n){var r,l;try{if(document.querySelectorAll(i).length&&"Button"!==i){var o=document.querySelector(i);l=o.outerHTML.trim(),e.appendChild(o),o.style.display=""}}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=""):r=t.compile(i)}var a;if(!t.isNullOrUndefined(r)){this.isReact&&this.renderReactTemplates();var d=void 0,h=void 0;e.classList.contains("e-acrdn-header-content")?(d=this.element.id+s+"_header",h="header"):e.classList.contains(q)&&(d=this.element.id+s+"_content",h="content"),a=r({},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(l)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),e},i.prototype.ariaAttrUpdate=function(e){var i=t.select("."+R,e),s=t.select("."+j,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:j+" e-content-hide",id:t.getUniqueID("acrdn_panel")});t.attributes(i,{"aria-hidden":"true"});var s=this.createElement("div",{className:q});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,!0)&&(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,"."+B);if(!(t.isNullOrUndefined(e)||t.isVisible(e)&&"true"!==e.getAttribute("e-animate")||n.classList.contains("e-overlay"))){var r=t.closest(n,".e-acrdn-root").querySelector(".e-expand-state"),l={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},o=t.select(".e-toggle-icon",n).firstElementChild,a={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!0};this.trigger("expanding",a,function(s){s.cancel||(o.classList.add("e-toggle-animation"),i.expandedItemsPush(n),t.isNullOrUndefined(r)||r.classList.remove("e-expand-state"),n.classList.add("e-expand-state"),"None"===l.name?(i.expandProgress("begin",o,e,n,s),i.expandProgress("end",o,e,n,s)):i.expandAnimation(l.name,o,e,n,l,s))})}},i.prototype.expandAnimation=function(e,i,s,n,r,l){var o,a=this;this.lastActiveItemId=n.id,"SlideDown"===e?(r.begin=function(){a.expandProgress("begin",i,s,n,l),s.style.position="absolute",o=n.offsetHeight,s.style.maxHeight=s.offsetHeight+"px",n.style.maxHeight=""},r.progress=function(){n.style.minHeight=o+s.offsetHeight+"px"},r.end=function(){t.setStyleAttribute(s,{position:"",maxHeight:""}),n.style.minHeight="",a.expandProgress("end",i,s,n,l)}):(r.begin=function(){a.expandProgress("begin",i,s,n,l)},r.end=function(){a.expandProgress("end",i,s,n,l)}),new t.Animation(r).animate(s)},i.prototype.expandProgress=function(e,i,s,n,r){this.remove(s,"e-content-hide"),this.add(n,"e-selected"),this.add(i,"e-expand-icon"),"end"===e&&(this.add(n,"e-active"),s.setAttribute("aria-hidden","false"),t.attributes(n,{"aria-expanded":"true"}),t.attributes(s.previousElementSibling,{"aria-selected":"true","aria-label":"expanded"}),i.classList.remove("e-toggle-animation"),this.trigger("expanded",r))},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(B)&&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,"."+B);if(!t.isNullOrUndefined(e)&&t.isVisible(e)&&!n.classList.contains("e-overlay")){var r={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},l=t.select(".e-toggle-icon",n).firstElementChild,o={element:n,item:s[this.getIndexByItem(n)],index:this.getIndexByItem(n),content:n.querySelector("."+j),isExpanded:!1};this.trigger("expanding",o,function(t){t.cancel||(i.expandedItemsPop(n),n.classList.add("e-expand-state"),l.classList.add("e-toggle-animation"),"None"===r.name?(i.collapseProgress("begin",l,e,n,t),i.collapseProgress("end",l,e,n,t)):i.collapseAnimation(r.name,e,n,l,r,t))})}},i.prototype.collapseAnimation=function(e,i,s,n,r,l){var o,a,d,h,c=this;this.lastActiveItemId=s.id,"SlideUp"===e?(r.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,l)},r.progress=function(){(h=o-(a-i.offsetHeight))<d&&(s.style.minHeight=h+"px")},r.end=function(){i.style.display="none",c.collapseProgress("end",n,i,s,l),s.style.minHeight="",t.setStyleAttribute(i,{position:"",maxHeight:"",display:""})}):(r.begin=function(){c.collapseProgress("begin",n,i,s,l)},r.end=function(){c.collapseProgress("end",n,i,s,l)}),new t.Animation(r).animate(i)},i.prototype.collapseProgress=function(e,i,s,n,r){this.remove(i,"e-expand-icon"),this.remove(n,"e-selected"),"end"===e&&(this.add(s,"e-content-hide"),i.classList.remove("e-toggle-animation"),this.remove(n,"e-active"),s.setAttribute("aria-hidden","true"),t.attributes(n,{"aria-expanded":"false"}),t.attributes(s.previousElementSibling,{"aria-selected":"false","aria-label":"collapsed"}),this.trigger("expanded",r))},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("."+R,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,r=this.getItemElements(),l=this.getItems();t.isNullOrUndefined(i)&&(i=l.length),n.childElementCount>=i&&(e instanceof Array?e:[e]).forEach(function(e,o){var a=i+o;l.splice(a,0,e);var d=s.renderInnerItem(e,a);n.childElementCount===a?n.appendChild(d):n.insertBefore(d,r[a]),t.EventHandler.add(d.querySelector("."+R),"focus",s.focusIn,s),t.EventHandler.add(d.querySelector("."+R),"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-selected")&&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("."+R,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,"e-overlay"),t.attributes(n,{tabindex:"0","aria-disabled":"false"}),n.focus()):(s.classList.contains("e-active")&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,n)),this.add(s,"e-overlay"),n.setAttribute("aria-disabled","true"),n.removeAttribute("tabindex"))}},i.prototype.refresh=function(){this.isServerRendered||e.prototype.refresh.call(this)},i.prototype.expandItem=function(e,i){var s=this,n=this.getItemElements();if(t.isNullOrUndefined(i))if("Single"===this.expandMode&&e){o=n[n.length-1];this.itemExpand(e,o,this.getIndexByItem(o))}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("e-expand-state")});var l=t.select(".e-expand-state",this.element);l&&l.classList.remove("e-expand-state"),r&&r.classList.add("e-expand-state")}else{var o=n[i];if(t.isNullOrUndefined(o)||!o.classList.contains("e-select")||o.classList.contains("e-active")&&e)return;"Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(e,o,i)}},i.prototype.itemExpand=function(e,i,s){var n=this,r=i.children[1];if(!i.classList.contains("e-overlay")){if(t.isNullOrUndefined(r)&&e)if(this.isServerRendered){var l=i.id;this.items.length>0?this.interopAdaptor.invokeMethodAsync("OnItemClick",s).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))}):this.interopAdaptor.invokeMethodAsync("OnDataClick",l).then(function(){n.isDestroyed||(r=i.children[1],n.expand(r))})}else r=this.contentRendering(s),i.appendChild(r),this.ariaAttrUpdate(i),this.expand(r);else t.isNullOrUndefined(r)||(e?this.expand(r):this.collapse(r));this.isReact&&this.renderReactTemplates()}},i.prototype.destroyItems=function(){this.restoreContent(null),this.isReact&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+B)).forEach(function(e){t.detach(e)})},i.prototype.restoreContent=function(e){var i;i=t.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+B)[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(){var e=["expandedIndices"];return this.addOnPersist(e)},i.prototype.onPropertyChanged=function(e,i){for(var s=this.element,n=!1,r=0,l=Object.keys(e);r<l.length;r++)switch(l[r]){case"items":if(this.isServerRendered){this.wireFocusEvents();break}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("."+B,this.element)[d],p=Object(i.items[d])[h],u=Object(e.items[d])[h],f=h;if(("header"===f||"iconCss"===f||"expanded"===f||"content"===f&&""===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 m=c.querySelector("."+q);m.innerHTML="",this.setTemplate(u,m,d)}else c.classList.contains("e-selected")&&this.expandItem(!1,d),t.detach(c.querySelector("."+j))}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.isServerRendered&&(this.initExpand=[],this.expandedIndices.length>0&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},H([t.Collection([],V)],i.prototype,"items",void 0),H([t.Property([])],i.prototype,"dataSource",void 0),H([t.Property()],i.prototype,"itemTemplate",void 0),H([t.Property()],i.prototype,"headerTemplate",void 0),H([t.Property("100%")],i.prototype,"width",void 0),H([t.Property("auto")],i.prototype,"height",void 0),H([t.Property([])],i.prototype,"expandedIndices",void 0),H([t.Property("Multiple")],i.prototype,"expandMode",void 0),H([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),H([t.Complex({},z)],i.prototype,"animation",void 0),H([t.Event()],i.prototype,"clicked",void 0),H([t.Event()],i.prototype,"expanding",void 0),H([t.Event()],i.prototype,"expanded",void 0),H([t.Event()],i.prototype,"created",void 0),H([t.Event()],i.prototype,"destroyed",void 0),i=H([t.NotifyPropertyChanges],i)}(t.Component),_=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)}}(),K=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Y=function(e){function i(t,i){return e.call(this,t,i)||this}return _(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:"context menu",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"},K([t.Property("")],i.prototype,"target",void 0),K([t.Property("")],i.prototype,"filter",void 0),K([t.Collection([],S)],i.prototype,"items",void 0),i=K([t.NotifyPropertyChanges],i)}(I),G=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)}}(),X=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Q="e-vertical",J=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.tempItems=[],s}return G(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(Q),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(Q),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("e-hamburger"),"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,r=0,l=Object.keys(i);r<l.length;r++)switch(l[r]){case"orientation":"Vertical"===i.orientation?(this.element.classList.add(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(Q),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(Q),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(Q),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("e-hamburger"),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[n.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove("e-hamburger"),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(Q),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(Q):this.element.previousElementSibling.classList.remove(Q),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(Q):(this.element.previousElementSibling||e.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(Q)),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)},X([t.Property("Horizontal")],i.prototype,"orientation",void 0),X([t.Property("")],i.prototype,"target",void 0),X([t.Property(null)],i.prototype,"template",void 0),X([t.Property(!1)],i.prototype,"enableScrolling",void 0),X([t.Property(!1)],i.prototype,"hamburgerMode",void 0),X([t.Property("Menu")],i.prototype,"title",void 0),X([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),X([t.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},O)],i.prototype,"fields",void 0),i=X([t.NotifyPropertyChanges],i)}(I),Z=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)}}(),$=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ee="e-tab-header",te="e-tab-wrap",ie="e-toolbar-items",se="e-toolbar-item",ne="e-toolbar-popup",re="e-vertical-tab",le=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("SlideLeftIn")],i.prototype,"effect",void 0),$([t.Property(600)],i.prototype,"duration",void 0),$([t.Property("ease")],i.prototype,"easing",void 0),i}(t.ChildProperty),oe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},le)],i.prototype,"previous",void 0),$([t.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},le)],i.prototype,"next",void 0),i}(t.ChildProperty),ae=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Property("")],i.prototype,"text",void 0),$([t.Property("")],i.prototype,"iconCss",void 0),$([t.Property("left")],i.prototype,"iconPosition",void 0),i}(t.ChildProperty),de=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Z(i,e),$([t.Complex({},ae)],i.prototype,"header",void 0),$([t.Property(null)],i.prototype,"headerTemplate",void 0),$([t.Property("")],i.prototype,"content",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(!1)],i.prototype,"disabled",void 0),$([t.Property(!0)],i.prototype,"visible",void 0),$([t.Property()],i.prototype,"id",void 0),i}(t.ChildProperty),he=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.lastIndex=0,s.isAdd=!1,s.isIconAlone=!1,s.draggableItems=[],s.resizeContext=s.refreshActElePosition.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 Z(i,e),i.prototype.destroy=function(){var i=this;if(this.isReact&&this.clearTemplate(),t.isNullOrUndefined(this.tbObj)||this.tbObj.destroy(),this.unWireEvents(),["role","aria-disabled","aria-activedescendant","tabindex","aria-orientation"].forEach(function(e){i.element.removeAttribute(e)}),this.expTemplateContent(),this.isTemplate){var s=t.select(".e-tab > .e-content",this.element);this.element.classList.remove("e-template"),t.isNullOrUndefined(s)||(s.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)t.remove(this.element.firstElementChild);e.prototype.destroy.call(this),this.trigger("destroyed")},i.prototype.refresh=function(){this.isReact&&this.clearTemplate(),this.isServerRendered?this.isServerRendered&&"Dynamic"!==this.loadOn&&this.setActiveBorder():e.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},i.prototype.preRender=function(){var e=t.closest(this.element,".e-content");this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwipeed=!1,this.itemIndexArray=[],this.templateEle=[],t.isNullOrUndefined(e)||(e.parentElement.classList.add("e-nested"),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":""}),this.setCssClass(this.element,s,!0),this.updatePopAnimationConfig()},i.prototype.render=function(){this.btnCls=this.createElement("span",{className:"e-icons e-close-icon",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(){if(this.isServerRendered)return void(this.isTemplate=!1);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:"e-content"})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:ee})),this.isTemplate=!1;else if(this.element.children.length>0){this.isTemplate=!0,e.classList.add("e-template");var i=e.querySelector(".e-tab-header");i&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,i)}if(!t.isNullOrUndefined(t.select(".e-tab-header",this.element))&&!t.isNullOrUndefined(t.select(".e-content",this.element))){if(this.renderHeader(),this.tbItems=t.select(".e-tab-header ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),t.selectAll("."+se,this.element).length>0){this.tbItems=t.select(".e-tab-header ."+ie,this.element),this.bdrLine=this.createElement("div",{className:"e-indicator e-hidden 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++){var r=this.items[n].id;this.tbItem[n].setAttribute("data-id",r)}this.setRTL(this.enableRtl)}},i.prototype.serverItemsChanged=function(){if(this.enableAnimation=!1,this.setActive(this.selectedItem,!0),"Dynamic"!==this.loadOn&&!t.isNullOrUndefined(this.cntEle)){var e=[].slice.call(this.cntEle.children),i="e-content"+this.tabId+"_"+this.selectedItem;e.forEach(function(e){e.classList.contains("e-active")&&e.id!==i&&e.classList.remove("e-active"),e.id===i&&e.classList.add("e-active")}),this.prevIndex=this.selectedItem,this.triggerAnimation("e-item"+this.tabId+"_"+this.selectedItem,!1)}this.enableAnimation=!0},i.prototype.headerReady=function(){if(this.initRender=!0,this.hdrEle=this.getTabHeader(),this.setOrientation(this.headerPlacement,this.hdrEle),t.isNullOrUndefined(this.hdrEle)||(this.tbObj=this.hdrEle&&this.hdrEle.ej2_instances[0]),this.tbObj.clicked=this.clickHandler.bind(this),this.tbObj.on("onItemsChanged",this.serverItemsChanged.bind(this)),this.tbItems=t.select(".e-tab-header ."+ie,this.element),t.isNullOrUndefined(this.tbItems)||t.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),t.selectAll("."+se,this.element).length>0){this.bdrLine=t.select(".e-indicator.e-ignore",this.element);var e=t.select("."+this.scrCntClass,this.tbItems);t.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstElementChild):e.insertBefore(this.bdrLine,e.firstElementChild),this.select(this.selectedItem)}if(this.cntEle=t.select(".e-tab > .e-content",this.element),t.isNullOrUndefined(this.cntEle)||(this.touchModule=new t.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)})),"Demand"===this.loadOn){var i=this.setActiveContent();this.triggerAnimation(i,!1)}this.initRender=!1,this.renderComplete()},i.prototype.setActiveContent=function(){var e="e-item"+this.tabId+"_"+this.selectedItem,i=this.getTrgContent(this.cntEle,this.extIndex(e));return t.isNullOrUndefined(i)||i.classList.add("e-active"),e},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(ee)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var n=this.hdrEle.children.length,r=[],l=0;l<n;l++)r.push(this.hdrEle.children.item(l).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),r.forEach(function(i,s){e.lastIndex=s;var n={className:"e-item",id:"e-item"+e.tabId+"_"+s,attrs:{role:"tab","aria-controls":"e-content"+e.tabId+"_"+s,"aria-selected":"false"}},r=e.createElement("span",{className:"e-tab-text",innerHTML:i,attrs:{role:"presentation"}}).outerHTML,l=e.createElement("div",{className:"e-text-wrap",innerHTML:r+e.btnCls.outerHTML}).outerHTML,a=e.createElement("div",{className:te,innerHTML:l,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 T({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}),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)},i.prototype.renderContent=function(){this.cntEle=t.select(".e-content",this.element);var e=t.selectAll("."+se,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&&(i.item(s).className+="e-item",t.attributes(i.item(s),{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+s}),i.item(s).id="e-content"+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,n=this,r=t.selectAll("."+se,this.element).length,l=[],o=[];return e.forEach(function(e,a){var d=t.isNullOrUndefined(e.header)||t.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,h=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&&""===h))return void o.push(a);var c=e.headerTemplate||e.header.text;"string"==typeof c&&n.enableHtmlSanitizer&&(c=t.SanitizeHtmlHelper.sanitize(c)),n.lastIndex=0===r?a:n.isReplace?i+a:n.lastIndex+1;var p=e.disabled?" e-disable e-overlay":"",u=!1===e.visible?" e-hidden":"";s=n.createElement("div",{className:"e-tab-text",attrs:{role:"presentation"}});var f=c instanceof Object?c.outerHTML:c,m=!t.isNullOrUndefined(f)&&""!==f;t.isNullOrUndefined(c.tagName)?n.headerTextCompile(s,c,a):s.appendChild(c);var v=n.createElement("span",{className:"e-icons e-tab-icon e-icon-"+d+" "+h}),g=n.createElement("div",{className:"e-text-wrap"});g.appendChild(s),""!==c&&void 0!==c&&""!==h?("left"===d||"top"===d?g.insertBefore(v,g.firstElementChild):g.appendChild(v),s,n.isIconAlone=!1):(""===h?s:v)===v&&(t.detach(s),g.appendChild(v),n.isIconAlone=!0);var y=e.disabled?{}:{tabIndex:"-1"};g.appendChild(n.btnCls.cloneNode(!0));var b=n.createElement("div",{className:te,attrs:y});b.appendChild(g),n.itemIndexArray===[]?n.itemIndexArray.push("e-item"+n.tabId+"_"+n.lastIndex):n.itemIndexArray.splice(i+a,0,"e-item"+n.tabId+"_"+n.lastIndex);var C={htmlAttributes:{id:"e-item"+n.tabId+"_"+n.lastIndex,role:"tab","aria-selected":"false"},template:b};C.cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+p+" "+u+(""!==h?"e-i"+d:"")+" "+(m?"":"e-icon"),"top"!==d&&"bottom"!==d||n.element.classList.add("e-vertical-icon"),l.push(C),a++}),this.isAdd||o.forEach(function(e){n.items.splice(e,1)}),this.isIconAlone?this.element.classList.add("e-icon-tab"):this.element.classList.remove("e-icon-tab"),l},i.prototype.removeActiveClass=function(){var e=this.getTabHeader();if(e){var i=t.selectAll(".e-toolbar-item.e-active",e);[].slice.call(i).forEach(function(e){return e.classList.remove("e-active")})}},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("."+ie,this.element),n=s.lastChild,r=!1;return!this.isVertical()&&(this.enableRtl&&i.offsetLeft+i.offsetWidth>s.offsetLeft||!this.enableRtl&&i.offsetLeft<s.offsetWidth)?r=!0:this.isVertical()&&i.offsetTop<n.offsetTop+n.offsetHeight&&(r=!0),r&&(e.classList.add(ne),this.tbPop.insertBefore(e,t.selectAll("."+ne,this.tbPop)[0])),!0},i.prototype.popupHandler=function(e){var i=e.querySelector(".e-ripple-element");t.isNullOrUndefined(i)||(i.outerHTML="",e.querySelector("."+te).classList.remove("e-ripple")),this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.tbItem[this.tbItem.length-1];if(0!==this.tbItem.length){if(e.classList.remove(ne),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("."+se,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(".e-tab-header",this.element);!0===e?i.classList.add("e-close-show"):i.classList.remove("e-close-show"),this.tbObj.refreshOverflow(),this.refreshActElePosition()},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("e-active"):(n.begin=function(){t.setStyleAttribute(e,{position:"absolute"}),e.classList.add("e-progress"),e.classList.add("e-view")},n.end=function(){e.style.display="none",e.classList.remove("e-active"),e.classList.remove("e-progress"),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,r=this,l=this.prevIndex;if(!this.isServerRendered||this.isServerRendered&&"Dynamic"!==this.loadOn){[].slice.call(this.element.querySelector(".e-content").children).forEach(function(e){e.id===r.prevActiveEle&&(s=e)});var o=this.tbItem[l];if(n=this.getTrgContent(this.cntEle,this.extIndex(e)),t.isNullOrUndefined(s)&&!t.isNullOrUndefined(o)){var a=this.extIndex(o.id);s=this.getTrgContent(this.cntEle,a)}}else n=this.cntEle.firstElementChild;if(t.isNullOrUndefined(n)||(this.prevActiveEle=n.id),this.initRender||!1===i||this.animation==={}||t.isNullOrUndefined(this.animation))return void(s&&s!==n&&s.classList.remove("e-active"));var d,h=t.select(".e-content",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("e-progress"),r.setActiveBorder()},d.end=function(){h.classList.remove("e-progress"),n.classList.add("e-active")},this.initRender||t.isNullOrUndefined(s)||this.triggerPrevAnimation(s,l),this.isPopup=!1,""===d.name?n.classList.add("e-active"):new t.Animation(d).animate(n)},i.prototype.keyPressed=function(e){var i=t.closest(e,".e-tab-header ."+se),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("e-active")||(this.select(s),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(ee)});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(ee)})[0]}},i.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(t.selectAll("."+se,this.getTabHeader()),e)},i.prototype.extIndex=function(e){return e.replace("e-item"+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 r;"string"==typeof i?(i=i.trim(),e.innerHTML=t.SanitizeHtmlHelper.sanitize(i)):r=t.compile(i);var l;t.isNullOrUndefined(r)||(l=r({},this,s)),!t.isNullOrUndefined(r)&&l.length>0&&[].slice.call(l).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 r;if("string"==typeof 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 l=document.querySelector(i);r=l.outerHTML.trim(),"clone"===s?e.appendChild(l.cloneNode(!0)):(e.appendChild(l),l.style.display="")}else this.templateCompile(e,i,n);else this.templateCompile(e,i,n);else e.appendChild(i);t.isNullOrUndefined(r)||-1===this.templateEle.indexOf(i.toString())&&this.templateEle.push(i.toString())},i.prototype.getTrgContent=function(e,i){return this.element.classList.contains("e-nested")?t.select(".e-nested> .e-content > #e-content"+this.tabId+"_"+i,this.element):this.findEle(e.children,"e-content"+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":"e-vertical-right";t.addClass([this.hdrEle],["e-vertical",e]),this.element.classList.contains("e-nested")?t.addClass([this.hdrEle],[re,e]):t.addClass([this.element],[re,e])}"Bottom"===this.headerPlacement&&t.addClass([this.hdrEle],["e-horizontal-bottom"])},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.classList.contains("e-vertical");t.removeClass([this.element],[re]),t.removeClass([this.hdrEle],["e-vertical","e-vertical-left","e-vertical-right"]),i!==this.isVertical()&&this.changeToolbarOrientation(),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.serverChangeOrientation=function(e,i){this.setOrientation(e,this.hdrEle),t.removeClass([this.element],[re]),("Left"===e||"Right"===e)!==("Left"===i||"Right"===i)&&this.changeToolbarOrientation(),this.isVertical()&&t.addClass([this.element],[re]),this.updateOrientationAttribute(),this.setActiveBorder(),this.focusItem()},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(".e-content"));"Bottom"===e&&n>s?this.element.appendChild(i):(t.removeClass([i],["e-horizontal-bottom"]),this.element.insertBefore(i,t.select(".e-content",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("e-fill-mode")&&t.removeClass([this.element],["e-fill-mode"]),!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],["e-fill-mode"]),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(".e-content",this.element),!0===e&&this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_0",className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_0"}}));for(var r=this.cntEle.children.item(0),n=0;n<this.items.length;n++)for(this.getContent(r,this.items[n].content,"clone",n),this.maxHeight=Math.max(this.maxHeight,this.getHeight(r));r.firstChild;)r.removeChild(r.firstChild);this.clearTemplate(["content"]),this.templateEle=[],this.getContent(r,this.items[0].content,"render",0),r.classList.remove("e-active")}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(".e-toolbar-item.e-active",e);if(null!==i){this.isServerRendered&&i.classList.contains(ne)&&this.popupHandler(i);var s=t.closest(i,".e-tab");if(this.element===s){this.tbItems=t.select("."+ie,e);var n=t.select(".e-indicator",e),r=t.select(".e-toolbar-items ."+this.scrCntClass,e);if(this.isVertical())t.setStyleAttribute(n,{left:"",right:""}),0!==(t.isNullOrUndefined(r)?this.tbItems.offsetHeight:r.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 l=t.select(".e-indicator",this.element);t.setStyleAttribute(l,{top:i.offsetHeight+i.offsetTop+"px",height:""})}else t.setStyleAttribute(n,{top:"",height:""});var o=t.isNullOrUndefined(r)?this.tbItems.offsetWidth:r.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)||this.bdrLine.classList.remove("e-hidden")}}},i.prototype.setActive=function(e,i){void 0===i&&(i=!1),this.tbItem=t.selectAll("."+se,this.getTabHeader());var s=this.tbItem[e];if(this.isServerRendered&&s&&(e=parseInt(s.getAttribute("data-index"),10)),!(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()),s.classList.contains("e-active"))return void this.setActiveBorder();if(!this.isTemplate){var n=this.tbItem[this.prevIndex];t.isNullOrUndefined(n)||n.removeAttribute("aria-controls"),t.attributes(s,{"aria-controls":"e-content"+this.tabId+"_"+e})}var r=s.id;this.removeActiveClass(),s.classList.add("e-active"),s.setAttribute("aria-selected","true");var l=Number(this.extIndex(r));if(t.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle="e-content"+this.tabId+"_"+l),t.attributes(this.element,{"aria-activedescendant":r}),this.isTemplate){if(t.select(".e-content",this.element).children.length>0){var o=this.findEle(t.select(".e-content",this.element).children,"e-content"+this.tabId+"_"+l);t.isNullOrUndefined(o)||o.classList.add("e-active"),this.triggerAnimation(r,this.enableAnimation)}}else if(!this.isServerRendered||this.isServerRendered&&"Init"===this.loadOn){this.cntEle=t.select(".e-tab > .e-content",this.element);var a=this.getTrgContent(this.cntEle,this.extIndex(r));if(t.isNullOrUndefined(a)){this.cntEle.appendChild(this.createElement("div",{id:"e-content"+this.tabId+"_"+this.extIndex(r),className:"e-item e-active",attrs:{role:"tabpanel","aria-labelledby":"e-item"+this.tabId+"_"+this.extIndex(r)}}));var d=this.getTrgContent(this.cntEle,this.extIndex(r)),h=Array.prototype.indexOf.call(this.itemIndexArray,r);this.getContent(d,this.items[h].content,"render",h)}else a.classList.add("e-active");this.triggerAnimation(r,this.enableAnimation)}if(this.setActiveBorder(),this.refreshItemVisibility(s),!this.initRender&&!i){s.firstElementChild.focus();var c={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed};this.trigger("selected",c)}}},i.prototype.contentReady=function(){var e=this.setActiveContent();this.triggerAnimation(e,this.enableAnimation)},i.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=t.select("."+ie,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("e-hidden"),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;this.allowDragAndDrop&&this.element.querySelectorAll("."+se).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(),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,"."+se),n=this.getEleIndex(s);i.classList.contains("e-close-icon")?this.removeTab(n):this.isVertical()&&t.closest(i,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,this.isServerRendered&&!t.isNullOrUndefined(s)?parseInt(s.getAttribute("data-index"),10)!==this.selectedItem&&this.select(n):t.isNullOrUndefined(s)||n===this.selectedItem&&n===this.prevIndex||this.select(n,e.originalEvent))},i.prototype.swipeHandler=function(e){if(!(e.velocity<3&&t.isNullOrUndefined(e.originalEvent.changedTouches))){if(e.originalEvent&&e.originalEvent.stopPropagation(),this.isSwipeed=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;i>=0;i--)if(!this.tbItem[i].classList.contains("e-hidden")){this.select(i);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==t.selectAll("."+se,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains("e-hidden")){this.select(s);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,".e-tab-header");t.isNullOrUndefined(i)||e.preventDefault()}},i.prototype.keyHandler=function(e){if(!this.element.classList.contains("e-disable")){this.element.classList.add("e-focused");var i=e.target,s=this.getTabHeader(),n=t.select(".e-active",s);this.popEle=t.select(".e-toolbar-pop",s),t.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]);var r=t.closest(document.activeElement,"."+se),l=t.closest(i,"."+se);switch(e.action){case"space":case"enter":if(i.parentElement.classList.contains("e-disable"))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(te)&&!1===t.closest(i,"."+se).classList.contains("e-active")&&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(r)||this.refreshItemVisibility(r);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(l)){var o=l.nextSibling;!t.isNullOrUndefined(o)&&o.classList.contains(se)&&o.firstElementChild.focus(),this.removeTab(this.getEleIndex(l))}this.setActiveBorder()}}},i.prototype.refreshActElePosition=function(){var e=t.select(".e-toolbar-item.e-toolbar-popup.e-active",this.element);t.isNullOrUndefined(e)||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,r=n+s.offsetWidth,l=e.offsetLeft,o=e.offsetWidth,a=e.offsetLeft+e.offsetWidth;if(n<l&&r<a){d=r-l;s.scrollLeft=n+(o-d)}else if(n>l&&r>a){var d=a-n;s.scrollLeft=n-(o-d)}}},i.prototype.hoverHandler=function(e){var i=e.target;!t.isNullOrUndefined(i.classList)&&i.classList.contains("e-close-icon")&&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.isRect&&this.clearTemplate(),this.setItems(e.items),this.templateEle.length>0&&this.expTemplateContent(),this.templateEle=[];for(var s=t.select(".e-tab > .e-content",this.element);s.firstElementChild&&!t.isBlazor();)t.detach(s.firstElementChild);this.select(this.selectedItem)}else for(var n=Object.keys(e.items),r=0;r<n.length;r++){var l=parseInt(Object.keys(e.items)[r],10),o=Object.keys(e.items[l])[0],a=Object(i.items[l])[o],d=Object(e.items[l])[o],h=t.select(".e-toolbar-items #e-item"+this.tabId+"_"+l,this.element),c=t.select(".e-content #e-content"+this.tabId+"_"+l,this.element);if("header"===o||"headerTemplate"===o){var p=t.isNullOrUndefined(this.items[l].header)||t.isNullOrUndefined(this.items[l].header.iconCss)?"":this.items[l].header.iconCss;if(""===(this.items[l].headerTemplate||this.items[l].header.text)&&""===p)this.removeTab(l);else{var u=[];u.push(this.items[l]),this.items.splice(l,1),this.itemIndexArray.splice(l,1),this.tbObj.items.splice(l,1);var f=h.classList.contains("e-hidden");t.detach(h),this.isReplace=!0,this.addTab(u,l),f&&this.hideTab(l),this.isReplace=!1}}if("content"===o&&!t.isNullOrUndefined(c))if(("string"==typeof d||t.isNullOrUndefined(d.innerHTML))&&("."===d[0]||"#"===d[0])&&d.length){var m=document.querySelector(d);c.appendChild(m),m.style.display=""}else""===d&&"#"===a[0]?(document.body.appendChild(this.element.querySelector(a)).style.display="none",c.innerHTML=d):"function"!=typeof d&&(c.innerHTML=d);"cssClass"===o&&(t.isNullOrUndefined(h)||(h.classList.remove(a),h.classList.add(d)),t.isNullOrUndefined(c)||(c.classList.remove(a),c.classList.add(d))),"disabled"===o&&this.enableTab(l,!0!==d),"visible"===o&&this.hideTab(l,!0!==d)}},i.prototype.initializeDrag=function(e){var i=this;this.dragArea=t.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" .e-tab-header":this.dragArea;var s=new t.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+se,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var s,n,r=i.getEleIndex(i.dragItem),l={draggedItem:i.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+se),clonedElement:i.cloneElement,index:r};if(t.isNullOrUndefined(e.target.closest(".e-tab"))||e.target.closest(".e-tab").isEqualNode(i.element)||".e-tab-header"===i.dragArea){if(e.target.closest(i.dragArea)||"Popup"===i.overflowMode?(document.body.style.cursor="",i.dragItem.querySelector("."+te).style.visibility="hidden",i.cloneElement.classList.contains("e-hidden")&&t.removeClass([i.cloneElement],"e-hidden")):(document.body.style.cursor="not-allowed",t.addClass([i.cloneElement],"e-hidden"),i.dragItem.classList.contains("e-hidden")&&t.removeClass([i.dragItem],"e-hidden"),i.dragItem.querySelector("."+te).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";var h=i.cloneElement.getBoundingClientRect().left,c=i.cloneElement.getBoundingClientRect().top,p=document.elementFromPoint(h,c);n=t.closest(p,"."+se);var u=0;"Scrollable"!==i.overflowMode||t.isNullOrUndefined(i.element.querySelector(".e-hscroll"))||(u=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))<r&&Math.abs(n.offsetLeft+n.offsetWidth-i.cloneElement.offsetLeft)>n.offsetWidth/2&&i.dragAction(n,r,s),s>r&&Math.abs(n.offsetWidth/2)+n.offsetLeft-u<i.cloneElement.offsetLeft+i.cloneElement.offsetWidth&&i.dragAction(n,r,s)),i.droppedIndex=i.getEleIndex(i.dragItem),i.trigger("dragging",l)}else i.trigger("dragging",l)},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(".e-tab-header").classList.contains("e-close-show")&&t.addClass([this.cloneElement],"e-close-show"),t.removeClass([this.cloneElement.querySelector("."+te)],"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(s){s.cancel?t.detach(i.cloneElement):(i.removeActiveClass(),t.addClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.dragItem.querySelector("."+te).style.visibility="hidden"),t.isBlazor()&&e.bindEvents(t.getElement(e.dragElement))})},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)){r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(e.parentElement.lastChild,r.childNodes[0])}else this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e);else{var n=e.parentElement.lastChild;if(e.isSameNode(n)){var r=this.dragItem.parentNode;e.parentNode.insertBefore(this.dragItem,e),r.insertBefore(n,r.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(e,this.dragItem):"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.dragItem.querySelector("."+te).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("."+te).style.visibility="",t.removeClass([i.tbItems.querySelector(".e-indicator")],"e-hidden"),i.select(i.droppedIndex))})},i.prototype.enableTab=function(e,i){var s=t.selectAll("."+se,this.element)[e];t.isNullOrUndefined(s)||(!0===i?(s.classList.remove("e-disable","e-overlay"),s.firstElementChild.setAttribute("tabindex","-1")):(s.classList.add("e-disable","e-overlay"),s.firstElementChild.removeAttribute("tabindex"),s.classList.contains("e-active")&&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(".e-tab-header",this.element),t.isNullOrUndefined(this.hdrEle))this.items=e,this.reRenderItems();else{var r=t.selectAll("."+se,this.element).length;if(0!==r&&(n=this.lastIndex+1),t.isNullOrUndefined(i)&&(i=r-1),r<i||i<0||isNaN(i))return;0!==r||t.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),t.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add("e-hidden"),this.tbItems=t.select("."+ie,this.getTabHeader()),this.isAdd=!0;var l=this.parseObject(e,i);this.isAdd=!1;var o,a=0;e.forEach(function(e,r){if(o=e.headerTemplate||e.header.text,t.isNullOrUndefined(e.headerTemplate||e.header)||t.isNullOrUndefined(o)||0===o.length&&t.isNullOrUndefined(e.header.iconCss)||(s.items.splice(i+a,0,e),a++),s.isTemplate&&!t.isNullOrUndefined(e.header)&&!t.isNullOrUndefined(e.header.text)){var l=n+r,d=s.createElement("div",{id:"e-content"+s.tabId+"_"+l,className:"e-item",attrs:{role:"tabpanel","aria-labelledby":"e-item_"+l}});s.cntEle.insertBefore(d,s.cntEle.children[i+r]);var h=s.getTrgContent(s.cntEle,l.toString());s.getContent(h,e.content,"render",i)}}),this.tbObj.addItems(l,i),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===i?this.select(i):this.setActiveBorder(),this.bindDraggable()}},i.prototype.removeTab=function(e){var i=this,s=t.selectAll("."+se,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)),i.items.splice(e,1),i.itemIndexArray.splice(e,1),i.refreshActiveBorder();var r=t.select("#e-content"+i.tabId+"_"+i.extIndex(s.id),t.select(".e-content",i.element));t.isNullOrUndefined(r)||t.detach(r),i.trigger("removed",n),s.classList.contains("e-active")&&(e=e>t.selectAll(".e-toolbar-item:not(.e-toolbar-popup)",i.element).length-1?e-1:e,i.enableAnimation=!1,i.selectedItem=e,i.select(e)),0===t.selectAll("."+se,i.element).length&&(i.hdrEle.style.display="none"),i.enableAnimation=!0}})}},i.prototype.hideTab=function(e,i){var s,n=t.selectAll("."+se,this.element)[e];if(!t.isNullOrUndefined(n)){if(t.isNullOrUndefined(i)&&(i=!0),this.bdrLine.classList.add("e-hidden"),!0===i)if(n.classList.add("e-hidden"),0!==(s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems)).length&&n.classList.contains("e-active")){if(0!==e)for(var r=e-1;r>=0;r--){if(!this.tbItem[r].classList.contains("e-hidden")){this.select(r);break}if(0===r)for(l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);break}}else for(var l=e+1;l<this.tbItem.length;l++)if(!this.tbItem[l].classList.contains("e-hidden")){this.select(l);break}}else 0===s.length&&this.element.classList.add("e-hidden");else this.element.classList.remove("e-hidden"),s=t.selectAll(".e-toolbar-item:not(.e-hidden)",this.tbItems),n.classList.remove("e-hidden"),0===s.length&&this.select(e);this.setActiveBorder(),n.setAttribute("aria-hidden",""+i),!this.isServerRendered&&"Popup"===this.overflowMode&&this.tbObj&&this.tbObj.refreshOverflow()}},i.prototype.select=function(e,i){var s=this,n=this.getTabHeader();this.tbItems=t.select("."+ie,n),this.tbItem=t.selectAll("."+se,n),this.content=t.select(".e-content",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 r=this.tbItem[e];t.isNullOrUndefined(r)?this.selectedID="0":this.selectingID=this.extIndex(r.id),t.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains("e-disable")||this.prevItem.children.item(0).setAttribute("tabindex","-1");var l={event:i,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectedID,this.content),selectingItem:r,selectingIndex:e,selectingContent:t.isNullOrUndefined(this.content)?null:t.select("#e-content"+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwipeed,cancel:!1};this.initRender?this.selectingContent(e):this.trigger("selecting",l,function(t){t.cancel||s.selectingContent(e)})},i.prototype.selectingContent=function(e){if("number"==typeof e){if(!t.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains("e-disable")||this.tbItem[e].classList.contains("e-hidden")))for(var i=e+1;i<this.items.length;i++){if(!1===this.items[i].disabled&&!0===this.items[i].visible){e=i;break}e=0}if(this.tbItem.length>e&&e>=0&&!isNaN(e))if(this.prevIndex=this.selectedItem,this.tbItem[e].classList.contains(ne)){if(this.setActive(this.popupHandler(this.tbItem[e])),!t.isNullOrUndefined(this.items)&&this.items.length>0&&this.allowDragAndDrop){this.tbItem=t.selectAll(".e-toolbar-items ."+se,this.hdrEle);var s=this.items[e];this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,s)}}else this.setActive(e);else this.setActive(0)}else e instanceof HTMLElement&&this.setActive(this.getEleIndex(e))},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,"e-disable",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,r=Object.keys(e);n<r.length;n++)switch(r[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.isServerRendered||this.setContentHeight(!1);break;case"cssClass":""!==i.cssClass?(this.setCssClass(this.element,i.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0)):this.setCssClass(this.element,e.cssClass,!0);break;case"items":this.isServerRendered||this.evalOnPropertyChangeItems(e,i);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"selectedItem":this.isServerRendered||(this.selectedItem=i.selectedItem,this.select(e.selectedItem));break;case"headerPlacement":this.isServerRendered?this.serverChangeOrientation(e.headerPlacement,i.headerPlacement):this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActElePosition();break;case"heightAdjustMode":this.isServerRendered||(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("."+ie),i=this.element.querySelector(".e-toolbar-item.e-active"),s=i.id,n=s.indexOf("_"),r=parseInt(s.substring(n+1),10),l=i.innerText,o=this.element.querySelector(".e-content").querySelector(".e-active").children[0],a=o.innerHTML;t.detach(i),t.detach(o);var d={className:se+" e-template e-active",id:"e-item"+this.tabId+"_"+r,attrs:{role:"tab","aria-controls":"e-content"+this.tabId+"_"+r,"aria-disabled":"false","aria-selected":"true"}},h=this.createElement("span",{className:"e-tab-text",innerHTML:l,attrs:{role:"presentation"}}).outerHTML,c=this.createElement("div",{className:"e-text-wrap",innerHTML:h+this.btnCls.outerHTML}).outerHTML,p=this.createElement("div",{className:te,innerHTML:c,attrs:{tabIndex:"-1"}});e.insertBefore(this.createElement("div",d),e.children[r+1]),this.element.querySelector(".e-toolbar-item.e-active").appendChild(p);E=this.createElement("div",{innerHTML:a});this.element.querySelector(".e-content").querySelector(".e-active").appendChild(E)}else if(this.element.querySelector(".e-toolbar-item.e-active")){t.detach(this.element.querySelector(".e-toolbar-item.e-active").children[0]),t.detach(this.element.querySelector(".e-content").querySelector(".e-active").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:"e-tab-text",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:"e-text-wrap"});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 N=this.createElement("div",{className:te,attrs:C});N.appendChild(b),"top"!==f&&"bottom"!==f||this.element.classList.add("e-vertical-icon"),this.element.querySelector(".e-toolbar-item.e-active").appendChild(N);var E=this.createElement("div"),x=u.content,O=void 0;if("string"==typeof x||t.isNullOrUndefined(x.innerHTML))if("string"==typeof x&&this.enableHtmlSanitizer&&(x=t.SanitizeHtmlHelper.sanitize(x)),"."===x[0]||"#"===x[0])if(document.querySelectorAll(x).length){var S=document.querySelector(x);O=S.outerHTML.trim(),E.appendChild(S),S.style.display=""}else this.compileElement(E,x,"content",this.selectedItem);else this.compileElement(E,x,"content",this.selectedItem);else E.appendChild(x);t.isNullOrUndefined(O)||-1===this.templateEle.indexOf(x.toString())&&this.templateEle.push(x.toString()),this.element.querySelector(".e-item.e-active").appendChild(E)}this.isReact&&this.renderReactTemplates()},$([t.Collection([],de)],i.prototype,"items",void 0),$([t.Property("100%")],i.prototype,"width",void 0),$([t.Property("auto")],i.prototype,"height",void 0),$([t.Property("")],i.prototype,"cssClass",void 0),$([t.Property(0)],i.prototype,"selectedItem",void 0),$([t.Property("Top")],i.prototype,"headerPlacement",void 0),$([t.Property("Content")],i.prototype,"heightAdjustMode",void 0),$([t.Property("Scrollable")],i.prototype,"overflowMode",void 0),$([t.Property("Dynamic")],i.prototype,"loadOn",void 0),$([t.Property(!1)],i.prototype,"enablePersistence",void 0),$([t.Property(!1)],i.prototype,"enableHtmlSanitizer",void 0),$([t.Property(!1)],i.prototype,"showCloseButton",void 0),$([t.Property()],i.prototype,"scrollStep",void 0),$([t.Property()],i.prototype,"dragArea",void 0),$([t.Property(!1)],i.prototype,"allowDragAndDrop",void 0),$([t.Complex({},oe)],i.prototype,"animation",void 0),$([t.Event()],i.prototype,"created",void 0),$([t.Event()],i.prototype,"adding",void 0),$([t.Event()],i.prototype,"added",void 0),$([t.Event()],i.prototype,"selecting",void 0),$([t.Event()],i.prototype,"selected",void 0),$([t.Event()],i.prototype,"removing",void 0),$([t.Event()],i.prototype,"removed",void 0),$([t.Event()],i.prototype,"onDragStart",void 0),$([t.Event()],i.prototype,"dragging",void 0),$([t.Event()],i.prototype,"dragged",void 0),$([t.Event()],i.prototype,"destroyed",void 0),i=$([t.NotifyPropertyChanges],i)}(t.Component),ce=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)}}(),pe=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},ue="e-treeview",fe="e-icon-collapsible",me="e-icon-expandable",ve="e-list-item",ge="e-list-text",ye="e-list-parent",be="e-hover",Ce="e-active",Ne="e-icons-spinner",Ee="e-process",xe="e-icons",Oe="e-text-content",Se="e-sibling",we="e-drop-next",Ie="e-fullrow",ke="e-check",Le="e-checkbox-wrapper",Ae="e-node-focus",De={treeRole:"tree",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},Pe=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("child")],i.prototype,"child",void 0),pe([t.Property([])],i.prototype,"dataSource",void 0),pe([t.Property("expanded")],i.prototype,"expanded",void 0),pe([t.Property("hasChildren")],i.prototype,"hasChildren",void 0),pe([t.Property("htmlAttributes")],i.prototype,"htmlAttributes",void 0),pe([t.Property("iconCss")],i.prototype,"iconCss",void 0),pe([t.Property("id")],i.prototype,"id",void 0),pe([t.Property("imageUrl")],i.prototype,"imageUrl",void 0),pe([t.Property("isChecked")],i.prototype,"isChecked",void 0),pe([t.Property("parentID")],i.prototype,"parentID",void 0),pe([t.Property(null)],i.prototype,"query",void 0),pe([t.Property("selected")],i.prototype,"selected",void 0),pe([t.Property(null)],i.prototype,"tableName",void 0),pe([t.Property("text")],i.prototype,"text",void 0),pe([t.Property("tooltip")],i.prototype,"tooltip",void 0),pe([t.Property("navigateUrl")],i.prototype,"navigateUrl",void 0),i}(t.ChildProperty),Me=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Property("SlideDown")],i.prototype,"effect",void 0),pe([t.Property(400)],i.prototype,"duration",void 0),pe([t.Property("linear")],i.prototype,"easing",void 0),i}(t.ChildProperty),Te=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ce(i,e),pe([t.Complex({effect:"SlideUp",duration:400,easing:"linear"},Me)],i.prototype,"collapse",void 0),pe([t.Complex({effect:"SlideDown",duration:400,easing:"linear"},Me)],i.prototype,"expand",void 0),i}(t.ChildProperty),Ue=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.isBlazorExpandedNodes=[],s.mouseDownStatus=!1,s}ce(o,e),a=o,o.prototype.getModuleName=function(){return"treeview"},o.prototype.preRender=function(){var e=this;this.isBlazorPlatform=t.isBlazor()&&this.isServerRendered,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:me,ariaAttributes:De,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(){var e=["selectedNodes","checkedNodes","expandedNodes"];return this.addOnPersist(e)},o.prototype.render=function(){this.initialRender=!0,this.blazorInitialRender=!1,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.isBlazorPlatform||(this.initialRender=!1),this.renderComplete()},o.prototype.initialize=function(){this.isBlazorPlatform||(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.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:"."+Oe+" > ."+xe+",.e-input-group,.e-input, ."+Le};this.rippleFn=t.rippleEffect(this.element,e);var i={selector:"."+Oe+" > ."+xe,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("."+ye,this.element);e?i.setAttribute("aria-multiselectable","true"):i.removeAttribute("aria-multiselectable")},o.prototype.templateComplier=function(e){if(e){this.element.classList.add("e-interaction");try{if(document.querySelectorAll(e).length)return t.compile(document.querySelector(e).innerHTML.trim())}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 r.DataManager?(this.isOffline=this.isBlazorPlatform?this.fields.dataSource.offline:this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.isBlazorPlatform?i.fields.dataSource.offline:i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof r.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,l=[];if(e.query)n=e.query.clone();else{n=new r.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===l.indexOf(e[h])&&l.push(e[h])}n.select(l),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){if(!this.isBlazorPlatform||this.isBlazorPlatform&&this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName||this.changeDataSource){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("."+ye,this.element).length&&n&&0!==n.length||this.loadOnDemand)&&this.finalizeNode(this.element)}this.updateTemplateForBlazor(),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},o.prototype.updateTemplateForBlazor=function(){this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate()},o.prototype.updateCheckedStateFromDS=function(e){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var i=this.fields,s=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.isChecked,"equal",!0,!1)),n=0;n<s.length;n++){var l=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(l)||this.isLoaded||this.checkedNodes.push(l),s[n][this.fields.hasChildren])for(var o=s[n][this.fields.id],a=new r.DataManager(this.treeData).executeLocal((new r.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 r.DataManager(this.treeData).executeLocal((new r.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){m=p[0][this.fields.id]?p[0][this.fields.id].toString():null;this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}for(var u=new r.DataManager(this.treeData).executeLocal((new r.Query).where(c.parentID,"equal",this.checkedNodes[n],!0)),f=0;f<u.length;f++){var m=u[f][this.fields.id]?u[f][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(m)&&this.autoCheck&&this.checkedNodes.push(m),this.checkedNodes.indexOf(m)>-1&&-1===this.validNodes.indexOf(m)&&this.validNodes.push(m)}}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(f=0;f<this.treeData.length;f++){var v=this.treeData[f][this.fields.id]?this.treeData[f][this.fields.id].toString():"";this.treeData[f][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[f]);g&&this.updateChildCheckState(g,this.treeData[f])}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,l=this.element.querySelector('[data-uid="'+i[0][this.fields.id]+'"]'),o=this.element.querySelector('[data-uid="'+i[0][this.fields.parentID]+'"]');if(l||o)o&&(t.select("."+ke,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 r.DataManager(this.treeData).executeLocal((new r.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],"."+ve),l=n.getAttribute("data-uid").toString(),o=0;if(e=1===this.dataType?new r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.parentID,"equal",l,!0)):this.getChildNodes(this.treeData,l)){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("."+Le).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():"",r=0;r<e.length;r++){var l=e[r][this.fields.id]?e[r][this.fields.id].toString():"";e[r][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.autoCheck&&this.checkedNodes.push(l),-1!==this.checkedNodes.indexOf(l)&&this.autoCheck&&s++,this.checkedNodes.indexOf(l)>-1&&-1===this.validNodes.indexOf(l)&&this.validNodes.push(l);var o=t.getValue(this.fields.child.toString(),e[r]);o&&(this.parentCheckData.push(i),this.updateChildCheckState(o,e[r])),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."+xe,e.item),r=e.item.getAttribute("data-uid");e.item.childNodes[0].insertBefore(i,e.item.childNodes[0].childNodes[t.isNullOrUndefined(s)?0:1]);var l=t.getValue(e.fields.isChecked,e.curData);this.checkedNodes.indexOf(r)>-1?(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item)):t.isNullOrUndefined(l)||"true"!==l.toString()?i.setAttribute("aria-checked","false"):(t.select(".e-frame",i).classList.add(ke),i.setAttribute("aria-checked","true"),this.addCheck(e.item));var o=t.select(".e-frame",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("e-selected")&&e.item.setAttribute("aria-selected","false");var a=e.fields;if(this.addActionClass(e,a.selected,"e-selected"),this.addActionClass(e,a.expanded,"e-expanded"),!t.isNullOrUndefined(this.nodeTemplateFn)){var d=e.item.querySelector("."+ge),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,r=t.getValue(i,n);t.isNullOrUndefined(r)||"false"===r.toString()||e.item.classList.add(s)},o.prototype.getDataType=function(e,i){if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){for(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}for(var s=0,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 r.Query).group(t),n=i.ListBase.getDataSource(e,s),l=[],o=0;o<n.length;o++){var a=n[o].items;l.push(a)}return l},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(".e-selected",e),r=0;r<n.length;r++){this.selectNode(n[r],null);break}t.removeClass(n,"e-selected")}for(var l=t.selectAll(".e-list-item:not(.e-expanded)",e),o=0;o<l.length;o++){var a=t.select("div."+xe,l[o]);a&&a.classList.contains(me)&&this.disableExpandAttr(l[o])}var d=t.selectAll(".e-expanded",e);if(!this.isInitalExpand)for(r=0;r<d.length;r++)this.renderChildNodes(d[r]);t.removeClass(d,"e-expanded"),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(ve)&&(t.select("."+ye,e[i])?this.ensureParentCheckState(e[i]):this.ensureChildCheckState(e[i]));else for(var s=t.selectAll(".e-stop",this.element),i=0;i<s.length;i++)s[i].classList.remove("e-stop")},o.prototype.ensureParentCheckState=function(e){if(!t.isNullOrUndefined(e)){if(e.classList.contains(ue))return;var i=e;e.classList.contains(ve)&&(i=t.select("."+ye,e));var s=t.selectAll("."+ke,i),n=t.selectAll(".e-stop",i),r=t.selectAll("."+ve,i),l=e.getElementsByClassName(Le)[0];r.length===s.length?this.changeState(l,"check",null,!0,!0):s.length>0||n.length>0?this.changeState(l,"indeterminate",null,!0,!0):0===s.length&&this.changeState(l,"uncheck",null,!0,!0);var o=t.closest(e,"."+ye);if(!t.isNullOrUndefined(o)){var a=t.closest(o,"."+ve);this.ensureParentCheckState(a)}}},o.prototype.ensureChildCheckState=function(e,i){if(!t.isNullOrUndefined(e)){var s=t.select("."+ye,e),n=void 0;if(!t.isNullOrUndefined(s)){n=t.selectAll("."+Le,s);for(var r=e.getElementsByClassName("e-frame")[0].classList.contains(ke),l=e.getElementsByClassName("e-frame")[0].classList.contains("e-stop"),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("e-frame")[0].classList.contains(ke);r?a="check":c&&!this.isLoaded?a="check":-1!==this.checkedNodes.indexOf(h)&&this.isLoaded&&(l||r)?a="check":o[d].classList.contains("e-has-child")&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-1!==this.parentNodeCheck.indexOf(h)?(a="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(h),1)):1===this.dataType&&!t.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(r||l)&&-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=r?"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("."+ve,this.element);if(t.isNullOrUndefined(e)){var s=t.selectAll("."+Le,this.element);if(this.loadOnDemand)for(n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck",null,null,null,i);else for(var n=0;n<s.length;n++)this.updateFieldChecked(s[n],i),this.changeState(s[n],i?"check":"uncheck")}else for(var r=e.length;r>=0;r--){var l=void 0;if(l=1===e.length?this.getElement(e[r-1]):this.getElement(e[r]),t.isNullOrUndefined(l)){p=void 0;if(""!==(p=e[r-e.length]?e[r-e.length].toString():e[r]?e[r].toString():null)&&i&&p)this.setValidCheckedNode(p),this.dynamicCheckState(p,i);else if(-1!==this.checkedNodes.indexOf(p)&&""!==p&&!i){this.checkedNodes.splice(this.checkedNodes.indexOf(p),1);var o=this.getChildNodes(this.treeData,p);if(o){for(var a=0;a<o.length;a++){var d=o[a][this.fields.id]?o[a][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&this.checkedNodes.splice(this.checkedNodes.indexOf(d),1)}-1!==this.parentNodeCheck.indexOf(p)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)}p&&this.dynamicCheckState(p,i),this.updateField(this.treeData,this.fields,p,"isChecked",null)}}else{var h=t.select(".e-list-parent ."+Le,l);this.validateCheckNode(h,!i,l,null)}}if(e)for(var c=0;c<e.length;c++){var p=e[c]?e[c].toString():"";i||this.updateField(this.treeData,this.fields,p,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},o.prototype.updateFieldChecked=function(e,i){var s=t.closest(e,"."+ve),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 r.DataManager(this.treeData).executeLocal((new r.Query).where(this.fields.id,"equal",e,!0));if(n[0]){var l=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=((p=this.element.querySelector('[data-uid="'+o+'"]'))&&t.select(".e-stop",p),p?t.select("."+ke,p):null),d=this.element.querySelector('[data-uid="'+l+'"]'),h=this.getChildNodes(this.treeData,o);if(h)for(u=0;u<h.length;u++){var c=h[u][this.fields.id]?h[u][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(c)&&s++}-1!==this.checkedNodes.indexOf(e)&&p&&l===e&&this.autoCheck?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&d&&l===e&&!i?this.changeState(d,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&d&&l===e&&i?this.changeState(d,"check",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0!==s?this.changeState(p,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!d&&p&&l===e&&this.autoCheck&&0===s?this.changeState(p,"uncheck",null):d||p||l!==e||!this.autoCheck||this.updateIndeterminate(e,i)}}else if(2===this.dataType||this.fields.dataSource instanceof r.DataManager&&this.isOffline)for(var l=void 0,p=void 0,a=void 0,u=0;u<this.treeData.length;u++){l=this.treeData[u][this.fields.id]?this.treeData[u][this.fields.id].toString():"",a=(p=this.element.querySelector('[data-uid="'+l+'"]'))?t.select("."+ke,p):null,-1===this.checkedNodes.indexOf(l)&&p&&a&&!i&&this.changeState(p,"uncheck",null);var f=t.getValue(this.fields.child.toString(),this.treeData[u]);f&&this.updateChildIndeterminate(f,l,e,i,l)}},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 r=this.getChildNodes(this.treeData,i);if(r)for(var l=0;l<r.length;l++){var o=r[l][this.fields.id]?r[l][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,r){for(var l=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)&&l++;var d=this.element.querySelector('[data-uid="'+i+'"]'),h=d?t.select(".e-stop",d):null,c=d?t.select("."+ke,d):null,p=this.element.querySelector('[data-uid="'+a+'"]'),u=p?t.select("."+ke,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===l&&!n)h.classList.remove("e-stop");else if(-1===this.checkedNodes.indexOf(s)&&!p&&c&&a===s&&0===l)this.changeState(d,"uncheck",null);else if(-1===this.checkedNodes.indexOf(a)&&p&&u&&0===l)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="'+r+'"]');n&&0!==l?this.changeState(f,"indeterminate",null):n&&l===e.length&&-1===this.checkedNodes.indexOf(i)?this.checkedNodes.push(i):n||0!==l||-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!==l?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,r)}},o.prototype.changeState=function(e,i,s,n,r,l){var o,a=this,d=t.closest(e,"."+ve);n?this.nodeCheckAction(e,i,d,o,s,n,r,l):(this.checkActionNodes=[],o=this.getCheckEvent(d,i,s),this.trigger("nodeChecking",o,function(t){t.cancel||a.nodeCheckAction(e,i,d,t,s,n,r,l)}))},o.prototype.nodeCheckAction=function(e,i,s,n,r,l,o,a){var d,h=e.getElementsByClassName("e-frame")[0];if("check"!==i||h.classList.contains(ke)?"uncheck"===i&&(h.classList.contains(ke)||h.classList.contains("e-stop"))?(t.removeClass([h],[ke,"e-stop"]),this.removeCheck(s),d="false"):"indeterminate"===i&&this.autoCheck&&(h.classList.remove(ke),h.classList.add("e-stop"),this.removeCheck(s),d="mixed"):(h.classList.remove("e-stop"),h.classList.add(ke),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,r),t.isUndefined(l)&&(n.data=c)}void 0!==a&&this.ensureStateChange(s,a),l||t.isNullOrUndefined(d)||(e.setAttribute("aria-checked",d),this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,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("."+ye,this.element);if(!t.isNullOrUndefined(e)){e.setAttribute("role",De.treeRole),this.setMultiSelect(this.allowMultiSelection);var i=t.select("."+ve,this.element);i&&(t.addClass([i],Ae),this.updateIdAttr(null,i)),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&this.rootData[0].hasOwnProperty(this.fields.parentID),this.doExpandAction()}},o.prototype.doExpandAction=function(){var e=this.expandedNodes;if(this.isInitalExpand&&e.length>0){if(this.setProperties({expandedNodes:[]},!0),this.isBlazorPlatform&&!this.initialRender)return;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)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("."+me,t.select("."+Oe,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<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("."+me,t.select("."+Oe,s));t.isNullOrUndefined(n)?i():this.expandAction(s,n,null,!1,i)}},o.prototype.afterFinalized=function(){if((!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender)&&this.doSelectionAction(),this.updateCheckedProp(),this.isBlazorPlatform&&(this.initialRender&&this.setCheckedNodes(this.checkedNodes),this.updateInstance(),this.initialRender=!1),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(".e-selected",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,"e-selected")},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,"."+ve);if(n){if(3!==e.originalEvent.which){var r=t.select(".e-ripple-element",n),l=t.select("."+xe,n);if(this.removeHover(),this.setFocusElement(n),this.showCheckBox&&!n.classList.contains("e-disable")){var o=t.closest(i,"."+Le);if(!t.isNullOrUndefined(o)){var a=t.select(".e-frame",o);return this.validateCheckNode(o,a.classList.contains(ke),n,e.originalEvent),void this.triggerClickEvent(e.originalEvent,n)}}s.contains(me)?this.expandAction(n,i,e):s.contains(fe)?this.collapseNode(n,i,e):r&&l?l.classList.contains("e-ripple")&&l.classList.contains(me)?this.expandAction(n,l,e):l.classList.contains("e-ripple")&&l.classList.contains(fe)?this.collapseNode(n,l,e):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1):s.contains(ye)||s.contains(ve)||this.toggleSelect(n,e.originalEvent,!1)}this.triggerClickEvent(e.originalEvent,n)}}},o.prototype.nodeCheckedEvent=function(e,i,s){t.closest(e,"."+ve);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(Ne)&&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],me),t.addClass([i],fe);var l=0,o=0,a=this,d=t.select("."+ye,e),h=e;this.setHeight(h,d);var c=t.select(".e-list-item."+Ce,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("e-animation-active"),l=h.offsetHeight,o=t.select("."+Oe,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,l,o)},end:function(e){e.element.style.display="block",!t.isNullOrUndefined(c)&&c instanceof HTMLElement&&c.classList.remove("e-animation-active"),n.expandedNode(h,d,i)}}):this.expandedNode(h,d,i)}}else t.select("."+ye,e).style.display="none",this.fields.dataSource instanceof r.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],Ee),this.addExpand(e),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!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],"e-node-collapsed");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(Ee)){t.addClass([i],Ee);var r;this.isLoaded?(r=this.getExpandEvent(e,s),this.trigger("nodeCollapsing",r,function(s){s.cancel?t.removeClass([i],Ee):n.nodeCollapseAction(e,i,s)})):this.nodeCollapseAction(e,i,r)}},o.prototype.nodeCollapseAction=function(e,i,s){var n=this;t.removeClass([i],fe),t.addClass([i],me);var r=0,l=0,o=this,a=t.select("."+ye,e),d=e,h=t.select(".e-list-item."+Ce,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("e-animation-active"),r=t.select("."+Oe,e).offsetHeight,l=d.offsetHeight},progress:function(e){o.animateHeight(e,r,l)},end:function(e){e.element.style.display="none",!t.isNullOrUndefined(h)&&h instanceof HTMLElement&&h.classList.remove("e-animation-active"),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],Ee),this.allowServerDataBinding=!0,this.updateServerProperties("expand"),this.allowServerDataBinding=!1,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],"e-node-collapsed")},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,l){var o=this,a=t.select("div."+xe,e);if(!t.isNullOrUndefined(a)){this.showSpinner(a);var d;if(this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName){var h=this.parents(e,"."+ye).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 r.DataManager&&this.isOffline?(this.treeList.pop(),d=this.getChildNodes(this.treeData,e.getAttribute("data-uid")),this.loadChild(d,c,a,e,s,n,l),this.updateTemplateForBlazor()):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,l),o.updateTemplateForBlazor()}).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.isBlazorPlatform&&this.initialRender||(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,l),this.setSelectionForChildNodes(d),this.ensureCheckNode(e),this.finalizeNode(e),this.loadOnDemand&&this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate(),this.disableTreeNodes(d),this.renderSubChild(e,s,l)}}},o.prototype.loadChild=function(e,s,n,l,o,a,d){if(this.currentLoadData=e,t.isNullOrUndefined(e)||0===e.length)t.detach(n),this.removeExpand(l,!0);else{if(this.updateListProp(s),this.fields.dataSource instanceof r.DataManager&&!this.isOffline){var h=l.getAttribute("data-uid"),c=this.getNodeObject(h);t.setValue("child",e,c)}this.listBaseOption.ariaAttributes.level=parseFloat(l.getAttribute("aria-level"))+1,l.appendChild(i.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(l,n,d),this.setSelectionForChildNodes(e),this.ensureCheckNode(l),this.finalizeNode(l),this.disableTreeNodes(e),this.renderSubChild(l,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 r=0,l=e.length;r<l;r++){var o=t.getValue(this.fields.id,e[r]);if(o&&o.toString()===i)return t.getValue(this.fields.child,e[r]);if(!t.isNullOrUndefined(t.getValue(this.fields.child,e[r]))&&void 0!==(n=this.getChildNodes(t.getValue(this.fields.child,e[r]),i)))break}return n},o.prototype.getChildGroup=function(e,i,s){if(!t.isNullOrUndefined(e))for(var n=0,r=e.length;n<r;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("."+me,e),r=0,l=n.length;r<l;r++){var o=n[r];if(e.querySelector(".e-icons")!==n[r]){var a=t.closest(o,"."+ve);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(Ce)},o.prototype.selectNode=function(e,i,s){var n=this;if(t.isNullOrUndefined(e)||!this.allowMultiSelection&&this.isActive(e)&&!t.isNullOrUndefined(i))return void this.setFocusElement(e);var r;this.isLoaded?(r=this.getSelectEvent(e,"select",i),this.trigger("nodeSelecting",r,function(t){t.cancel||n.nodeSelectAction(e,i,t,s)})):this.nodeSelectAction(e,i,r,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 r=this.liList.indexOf(this.startNode),l=this.liList.indexOf(e);if(r>l){var o=r;r=l,l=o}for(var a=r;a<=l;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&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,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.allowServerDataBinding=!0,s.updateServerProperties("select"),s.allowServerDataBinding=!1,s.nodeUnselectAction(e,t))})):this.nodeUnselectAction(e,i)},o.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(this.allowServerDataBinding=!0,this.updateServerProperties("select"),this.allowServerDataBinding=!1,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],Ae),t.addClass([e],Ae),this.updateIdAttr(i,e)}},o.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),t.addClass([e],Ce);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],Ce);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("."+Ce),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,Ce),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(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||this.showCheckBox&&t.closest(i,"."+Le)||this.expandCollapseAction(t.closest(i,"."+ve),e)},o.prototype.expandCollapseAction=function(e,i){var s=t.select("div."+xe,e);if(s&&!s.classList.contains(Ee)){var n=s.classList;n.contains(me)?this.expandAction(e,s,i):n.contains(fe)&&this.collapseNode(e,s,i)}},o.prototype.expandAction=function(e,i,s,n,r){var l=this;i.classList.contains(Ee)||(t.addClass([i],Ee),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(e,s),this.trigger("nodeExpanding",this.expandArgs,function(s){s.cancel?t.removeClass([i],Ee):l.nodeExpandAction(e,i,n,r)})):this.nodeExpandAction(e,i,n,r))},o.prototype.nodeExpandAction=function(e,i,s,n){var r=t.select("."+ye,e);if(r&&"UL"===r.nodeName)this.expandNode(e,i);else{this.renderChildNodes(e,s,n);for(var l=t.selectAll("."+ve,e),o=0;o<l.length;o++){var a=this.getId(l[o]);if(-1!==this.expandChildren.indexOf(a)&&void 0!==this.expandChildren){var d=t.select("."+me,t.select("."+Oe,l[o]));t.isNullOrUndefined(d)||this.expandAction(l[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 r=s;return void("enter"===e.action?(r.blur(),this.element.focus(),t.addClass([n],be)):"escape"===e.action&&(r.value=this.oldText,r.blur(),this.element.focus(),t.addClass([n],be)))}e.preventDefault();var l={cancel:!1,event:e,node:n};this.trigger("keyPress",l,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 r=t.selectAll(".e-list-item:not(.e-active)",i.element);i.selectGivenNodes(r)}}})},o.prototype.navigateToFocus=function(e){var i=this.getFocusedNode().querySelector("."+Oe),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);if(!t.isNullOrUndefined(n)){var r=n.getBoundingClientRect();s.bottom>r.bottom?n.scrollTop+=s.bottom-r.bottom:s.top<r.top&&(n.scrollTop-=r.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("."+Le,i),n=t.select(" .e-frame",s).classList.contains(ke);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 r=this,l=t.closest(e,"."+ve);this.checkActionNodes=[];var o=i?"false":"true";t.isNullOrUndefined(o)||e.setAttribute("aria-checked",o);var a=this.getCheckEvent(l,i?"uncheck":"check",n);this.trigger("nodeChecking",a,function(t){t.cancel||r.nodeCheckingAction(e,i,s,t,n)})},o.prototype.nodeCheckingAction=function(e,i,s,n,r){if(-1===this.checkedElement.indexOf(s.getAttribute("data-uid"))){this.checkedElement.push(s.getAttribute("data-uid"));var l=this.getChildNodes(this.treeData,s.getAttribute("data-uid"));null!==l?this.allCheckNode(l,this.checkedElement,null,null,!1):l=null}if(this.changeState(e,i?"uncheck":"check",r,!0),this.autoCheck){this.ensureChildCheckState(s),this.ensureParentCheckState(t.closest(t.closest(s,"."+ye),"."+ve));var o=void 0;"check"===n.action?o=!0:"uncheck"===n.action&&(o=!1),this.ensureStateChange(s,o)}this.allowServerDataBinding=!0,this.updateServerProperties("check"),this.allowServerDataBinding=!1,this.nodeCheckedEvent(e,i,r)},o.prototype.ensureStateChange=function(e,i){var s=t.select("."+ye,e),n=e.getAttribute("data-uid"),l=this.fields;if(1===this.dataType&&this.autoCheck)for(var o=new r.DataManager(this.treeData).executeLocal((new r.Query).where(l.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);p=this.getChildNodes(this.treeData,d);this.getChildItems(p,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 c=this.getChildNodes(this.treeData,d);this.getChildItems(c,i),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)}}else{var p=this.getChildNodes(this.treeData,d);this.getChildItems(p,i)}}else if(1!==this.dataType||this.autoCheck)(p=this.getChildNodes(this.treeData,n))&&this.childStateChange(p,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 r.DataManager(this.treeData).executeLocal((new r.Query).where(l.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 r=this.getChildNodes(this.treeData,s);r.length>0&&this.getChildItems(r,t)}},o.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[n][this.fields.id]?e[n][this.fields.id].toString():"",l=e[n][this.fields.isChecked]?e[n][this.fields.isChecked].toString():null;this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkedNodes.push(r),-1!==this.parentNodeCheck.indexOf(r)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(r),1)):-1!==this.checkedNodes.indexOf(t)||-1===this.checkedNodes.indexOf(r)||s||(this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),"true"===l&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkedNodes.push(r):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[]));var o=this.getChildNodes([e[n]],r);o&&this.childStateChange(o,t,i,s)}},o.prototype.allCheckNode=function(e,i,s,n,r){if(e)for(var l=0;l<e.length;l++){var o=t.getValue(this.fields.id,e[l]),a=this.element.querySelector('[data-uid="'+o+'"]');if(!1!==r&&-1===this.checkedElement.indexOf(o.toString())&&(null===a&&!t.isNullOrUndefined(e[l][this.fields.isChecked])&&-1===i.indexOf(o.toString())||0===n||2===s)&&(!1!==e[l][this.fields.isChecked]||2===s?i.push(o.toString()):n=null,n=!1!==e[l][this.fields.isChecked]||2===s?0:null),-1===i.indexOf(o.toString())&&t.isNullOrUndefined(s)&&i.push(o.toString()),!0===t.getValue(this.fields.hasChildren,e[l])||t.getValue(this.fields.child.toString(),e[l])){var d=t.getValue(this.fields.id,e[l]),h=this.getChildNodes(this.treeData,d.toString());h&&(t.isNullOrUndefined(r)?this.allCheckNode(h,i,s,n):this.allCheckNode(h,i,s,n,r),n=null)}n=null}},o.prototype.openNode=function(e,i){var s=this.getFocusedNode(),n=t.select("div."+xe,s);if(e){if(!n)return;n.classList.contains(me)?this.expandAction(s,n,i):this.focusNextNode(s,!0)}else if(n&&n.classList.contains(fe))this.collapseNode(s,n,i);else{var r=t.closest(t.closest(s,"."+ye),"."+ve);if(!r)return;r.classList.contains("e-disable")||(this.setFocus(s,r),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(".e-list-item."+Ae,this.element);return t.isNullOrUndefined(i)&&(e=t.select("."+ve,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(Oe)?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],[be,Ae]),i.classList.contains("e-disable")||(t.addClass([i],[be,Ae]),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()],be),this.mouseDownStatus=!1},o.prototype.focusOut=function(){t.removeClass([this.getFocusedNode()],be)},o.prototype.onMouseOver=function(e){var i=e.target,s=i.classList,n=t.closest(i,"."+ve);if(!n||s.contains(ye)||s.contains(ve))return void this.removeHover();n&&!n.classList.contains("e-disable")&&this.setHover(n)},o.prototype.setHover=function(e){e.classList.contains(be)||(this.removeHover(),t.addClass([e],be))},o.prototype.onMouseLeave=function(e){this.removeHover()},o.prototype.removeHover=function(){var e=t.selectAll("."+be,this.element);e&&e.length&&t.removeClass(e,be)},o.prototype.getNodeData=function(e,i){if(!t.isNullOrUndefined(e)&&e.classList.contains(ve)&&!t.isNullOrUndefined(t.closest(e,".e-control"))&&t.closest(e,".e-control").classList.contains(ue)){var s=e.getAttribute("data-uid"),n=this.getText(e,i),r=t.closest(e.parentNode,"."+ve),l=r?r.getAttribute("data-uid"):null,o=e.classList.contains(Ce),a="true"===e.getAttribute("aria-expanded"),d=null!==e.getAttribute("aria-expanded");this.isBlazorPlatform&&(d="true"===e.getAttribute("aria-expanded")||null!=(e.querySelector(".e-icon-expandable")||e.querySelector(".e-icon-collapsible")));var h=null;return this.showCheckBox&&(h=t.select("."+Le,e).getAttribute("aria-checked")),{id:s,text:n,parentID:l,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")),r=this.getFields(this.fields,n,1);return t.getValue(r.text,s)}return t.select("."+ge,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);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.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),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(ue)||i.classList.contains(ye)||i.classList.contains(ve)||i.classList.contains(xe)||i.classList.contains("e-input")||i.classList.contains("e-input-group"))){var s=t.closest(i,"."+ve);this.createTextbox(s,e)}},o.prototype.createTextbox=function(e,i){var s=this,n=t.select(".e-tree-input",this.element);n&&n.blur();var r=t.select("."+ge,e);this.updateOldText(e);var o=this.createElement("input",{className:"e-tree-input",attrs:{value:this.oldText}}),a=this.getEditEvent(e,null,o.outerHTML);this.trigger("nodeEditing",a,function(i){if(!i.cancel){var n="width:"+(r.offsetWidth+5)+"px";t.addClass([e],"e-editing"),t.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(e),r.innerHTML=a.innerHtml;var o=t.select(".e-tree-input",r);s.inputObj=l.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(".e-tree-input",this.element)){var i=e.target,s=i.value,n=t.closest(i,"."+ge),l=t.closest(i,"."+ve);t.detach(this.inputObj.container),this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?this.crudOperation("update",null,l,s,null,null,!0):this.appendNewText(l,n,s,!0)}},o.prototype.appendNewText=function(e,t,i,s){var n=this,r=this.getEditEvent(e,i,null);this.trigger("nodeEdited",r,function(r){i=r.cancel?r.oldText:r.newText,n.updateText(e,t,i,s),r.oldText!==i&&n.triggerEvent()})},o.prototype.updateText=function(e,i,s,n){var r=t.setValue(this.editFields.text,s,this.editData);if(t.isNullOrUndefined(this.nodeTemplateFn))i.innerText=s;else{i.innerText="";var l=e.getAttribute("data-uid");this.renderNodeTemplate(r,i,l),this.updateBlazorTemplate(),this.renderReactTemplates()}n&&(t.removeClass([e],"e-editing"),i.focus())},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 l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return e[l];if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){if(void 0!==(n=this.getChildNodeObject(t.getValue("child",e[l]),this.getChildMapper(i),s)))break}}else{var d=t.getValue(i.child,e[l]);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:"."+Oe,helper:function(n){i.dragTarget=n.sender.target;var r=t.closest(i.dragTarget,"."+ue),l=t.closest(i.dragTarget,"."+Oe);if(i.dragLi=t.closest(i.dragTarget,"."+ve),i.fullRowSelect&&!l&&i.dragTarget.classList.contains(Ie)&&(l=i.dragTarget.nextElementSibling),!i.dragTarget||!n.element.isSameNode(r)||!l||i.dragTarget.classList.contains(ue)||i.dragTarget.classList.contains(ye)||i.dragTarget.classList.contains(ve)||i.dragLi.classList.contains("e-disable"))return!1;var o=l.cloneNode(!0);if(t.isNullOrUndefined(t.select("div."+xe,o))){var a=s.createElement("div",{className:xe+" "+me});o.insertBefore(a,o.children[0])}var d="e-drag-item "+ue+" "+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(Ce)){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],"e-dragging");var n,r=t.closest(s.target,".e-list-item");r&&(n=parseInt(r.getAttribute("aria-level"),10));var l=i.getDragEvent(s.event,i,null,s.target,null,e,n);l.draggedNode.classList.contains("e-editing")?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.trigger("nodeDragStart",l,function(n){n.cancel?(i.dragObj.intDestroy(s.event),i.dragCancelAction(e)):i.dragStartAction=!0,t.isBlazor()&&s.bindEvents(t.getElement(s.dragElement))})},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],"e-dragging"),i.removeVirtualEle();var s=e.target,n=t.closest(s,".e-droppable"),r=!0;s&&n||(t.detach(e.helper),document.body.style.cursor="",r=!1);var l,o=t.closest(s,".e-list-item");o&&(l=parseInt(o.getAttribute("aria-level"),10));var a=i.getDragEvent(e.event,i,s,s,null,e.helper,l);a.preventTargetExpand=!1,(i.isBlazorPlatform&&i.dragStartAction||!i.isBlazorPlatform)&&i.trigger("nodeDragStop",a,function(s){i.dragParent=s.draggedParentNode,i.preventExpand=s.preventTargetExpand,s.cancel&&(e.helper.parentNode&&t.detach(e.helper),document.body.style.cursor="",r=!1),i.dragStartAction=!1,i.isBlazorPlatform&&r&&i.dropAction(e,!0)})}}),this.dropObj=new t.Droppable(this.element,{out:function(e){t.isNullOrUndefined(e)||e.target.classList.contains(Se)||(document.body.style.cursor="not-allowed")},over:function(e){document.body.style.cursor=""},drop:function(e){i.isBlazorPlatform||i.dropAction(e)}})},o.prototype.dragCancelAction=function(e){t.detach(e),t.removeClass([this.element],"e-dragging"),this.dragStartAction=!1},o.prototype.dragAction=function(e,i){var s=t.closest(e.target,".e-droppable"),n=t.closest(e.target,"."+Oe),r=t.select("div."+xe,i);t.removeClass([r],["e-drop-in",we,"e-drop-out","e-no-drop"]),this.removeVirtualEle(),document.body.style.cursor="";var l=e.target.classList;if(this.fullRowSelect&&!n&&!t.isNullOrUndefined(l)&&l.contains(Ie)&&(n=e.target.nextElementSibling),s){var o=t.closest(e.target,"."+ve),a=t.closest(e.target,"."+Le),d=t.closest(e.target,"."+fe),h=t.closest(e.target,"."+me);if(!s.classList.contains(ue)||n&&!o.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,o))if(o&&e&&!h&&!d&&e.event.offsetY<7&&!a||h&&e.event.offsetY<5||d&&e.event.offsetX<3){t.addClass([r],we);var c=this.createElement("div",{className:Se}),p=this.fullRowSelect?1:0;o.insertBefore(c,o.children[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){t.addClass([r],we);var c=this.createElement("div",{className:Se}),p=this.fullRowSelect?2:1;o.insertBefore(c,o.children[p])}else t.addClass([r],"e-drop-in");else"LI"!==e.target.nodeName||o.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,o)?e.target.classList.contains(Se)?t.addClass([r],we):t.addClass([r],"e-drop-out"):(t.addClass([r],we),this.renderVirtualEle(e))}else t.addClass([r],"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([r],m.dropIndicator),this.trigger("nodeDragging",m),m.dropIndicator&&t.addClass([r],m.dropIndicator)},o.prototype.dropAction=function(e,i){var s,n,l,o=e.event.offsetY,d=e.target,h=!1;l=i?e.element:e.dragData.draggable;for(m=0;m<l.ej2_instances.length;m++)if(l.ej2_instances[m]instanceof a){s=l.ej2_instances[m];break}if(s&&s.dragTarget){var c=s.dragTarget,p=t.closest(c,"."+ve),u=t.closest(d,"."+ve);if(null==u&&d.classList.contains(ue)&&(u=d.firstElementChild),i?t.detach(e.helper):t.detach(e.droppedElement),document.body.style.cursor="",!u||u.isSameNode(p)||this.isDescendant(p,u))return void(this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1));if(s.allowMultiSelection&&p.classList.contains(Ce)){var f=t.selectAll("."+Ce,s.element);if(e.target.offsetHeight<=33&&o>e.target.offsetHeight-10&&o>6)for(m=f.length-1;m>=0;m--)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o);else for(var m=0;m<f.length;m++)u.isSameNode(f[m])||this.isDescendant(f[m],u)||this.appendNode(d,f[m],u,e,s,o)}else this.appendNode(d,p,u,e,s,o);n=parseInt(p.getAttribute("aria-level"),10),h=!0}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),i?this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.element,null,n,h)):this.trigger("nodeDropped",this.getDragEvent(e.event,s,d,e.target,e.dragData.draggedElement,null,n,h)),s.element.id!==this.element.id&&s.triggerEvent(),this.triggerEvent()},o.prototype.appendNode=function(e,i,s,n,r,l){var o=t.closest(e,"."+Le),a=t.closest(n.target,"."+fe),d=t.closest(n.target,"."+me);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,r,null,n,l,!0):"LI"===e.nodeName?this.dropAsSiblingNode(i,s,n,r):e.firstElementChild&&e.classList.contains(ue)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(i,s,n,r):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(i,s,n,r):this.dropAsChildNode(i,s,r,null,n,l)},o.prototype.dropAsSiblingNode=function(e,i,s,n){var r,l=t.closest(i,"."+ye),o=t.closest(e,"."+ye),a=t.closest(o,"."+ve);if(s.target.offsetHeight>0&&s.event.offsetY>s.target.offsetHeight-2?r=!1:s.event.offsetY<2?r=!0:(s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible"))&&(s.event.offsetY<5||s.event.offsetX<3?r=!0:(s.event.offsetY>15||s.event.offsetX>17)&&(r=!1)),s.target.classList.contains("e-icon-expandable")||s.target.classList.contains("e-icon-collapsible")){var d=s.target.closest("li");l.insertBefore(e,r?d:d.nextElementSibling)}else l.insertBefore(e,r?s.target:s.target.nextElementSibling);this.moveData(e,i,l,r,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,r,l,o){var a=t.closest(e,"."+ye),d=t.closest(a,"."+ve),h=t.closest(i,"."+ye);if(r&&l<7&&!o)h.insertBefore(e,i),this.moveData(e,i,h,!0,s);else if(r&&r.target.offsetHeight>0&&l>r.target.offsetHeight-10&&!o)h.insertBefore(e,i.nextElementSibling),this.moveData(e,i,h,!1,s);else{var c=this.expandParent(i),p=c.childNodes[n];c.insertBefore(e,p),this.moveData(e,p,c,!0,s)}this.updateElement(a,d),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},o.prototype.moveData=function(e,i,s,n,r){var l=t.closest(s,"."+ve),o=this.getId(e),a=r.updateChildField(r.treeData,r.fields,o,null,null,!0),d=this.getId(i),h=this.getDataPos(this.treeData,this.fields,d),c=this.getId(l);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]),r.element.id!==this.element.id){var f=r.removeChildNodes(o);p++;for(var m=0,v=f.length;m<v;m++)this.treeData.splice(p,0,f[m]),p++;r.groupedData=r.getGroupedData(r.treeData,r.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."+xe,e);s&&s.classList.contains(me)&&!0!==this.preventExpand&&this.expandAction(e,s,null);var n=t.select("."+ye,e);if(!0===this.preventExpand&&!n&&s&&this.renderChildNodes(e),n=t.select("."+ye,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,me,this.listBaseOption),(r=t.select("div."+xe,e))&&r.classList.add("e-icon-expandable"),n=i.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(n),r?t.removeClass([r],fe):i.ListBase.generateIcon(this.createElement,e,me,this.listBaseOption),e.setAttribute("aria-expanded","false"),n.style.display="none"),t.isNullOrUndefined(n)){this.trigger("nodeExpanding",this.getExpandEvent(e,null)),t.isNullOrUndefined(s)&&i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption);var r=t.select("div."+xe,e);r?t.removeClass([r],me):(i.ListBase.generateIcon(this.createElement,e,fe,this.listBaseOption),r=t.select("div."+xe,e),t.removeClass([r],me)),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."+xe,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,"."+ye).length;e.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,e),i+1)},o.prototype.updateChildAriaLevel=function(e,i){if(!t.isNullOrUndefined(e))for(var s=e.childNodes,n=0,r=s.length;n<r;n++){var l=s[n];l.setAttribute("aria-level",""+i),this.updateChildAriaLevel(t.select("."+ye,l),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:Se}),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("."+Se);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,l,o,a,d){var h=s?t.closest(s,"."+ve):null,c=h?this.getNodeData(h):null,p=i?i.dragLi:l,u=i?i.dragData:null,f=s?this.parents(s,"."+ve):null,m=i.dragLi.parentElement,v=i.dragLi?t.closest(m,"."+ve):null,g=null,y=null,b=[we,"e-drop-in","e-drop-out","e-no-drop"],C=null,N=!0===d?p:h,E=N?t.closest(N,".e-list-parent"):null,x=0,O=null;if(v=i.dragLi&&null===v?t.closest(m,"."+ue):v,v=!0===d?this.dragParent:v,o)for(;x<4;){if(t.select("."+xe,o).classList.contains(b[x])){C=b[x];break}x++}if(E){var S=0;for(x=0;x<E.childElementCount;x++){if(S=!0!==d&&E.children[x]===p&&h!==p?++S:S,!0!==d&&E.children[x].classList.contains("e-hover")){y=e.offsetY>=23?x+1:x;break}if(E.children[x]===N){e.offsetY,y=x;break}}y=0!==S?--y:y,O="e-drop-in"==C?"Inside":e.offsetY<7?"Before":"After"}if(s&&(g=0===f.length?null:s.classList.contains(ve)?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 w=g?t.select(".e-list-parent",g):null;if(y=w?w.children.length:0,!(this.fields.dataSource instanceof r.DataManager)&&null===w&&g){var I=g.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,g.getAttribute("data-uid").toString()):null;y=I?I.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:O}},o.prototype.addFullRow=function(e){var i=this.liList.length;if(e)for(s=0;s<i;s++)this.createFullRow(this.liList[s]);else for(var s=0;s<i;s++){var n=t.select("."+Ie,this.liList[s]);t.detach(n)}},o.prototype.createFullRow=function(e){var t=this.createElement("div",{className:Ie});e.insertBefore(t,e.childNodes[0])},o.prototype.addMultiSelect=function(e){if(e)for(var i=0,s=n=t.selectAll('.e-list-item:not([aria-selected="true"])',this.element);i<s.length;i++)(o=s[i]).setAttribute("aria-selected","false");else for(var n=t.selectAll('.e-list-item[aria-selected="false"]',this.element),r=0,l=n;r<l.length;r++){var o=l[r];o.removeAttribute("aria-selected")}},o.prototype.collapseByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+fe,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.collapseNode(o,a,null),this.collapseByLevel(t.select("."+ye,o),i-1,s)}},o.prototype.collapseAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+fe,this.element)),s=0,n=i.length;s<n;s++){var r=i[s],l=t.closest(r,"."+ve);this.collapseNode(l,r,null)}},o.prototype.expandByLevel=function(e,i,s){if(i>0&&!t.isNullOrUndefined(e))for(var n=this.getVisibleNodes(s,e.childNodes),r=0,l=n.length;r<l;r++){var o=n[r],a=t.select("."+me,t.select("."+Oe,o));t.isNullOrUndefined(a)||this.expandAction(o,a,null),this.expandByLevel(t.select("."+ye,o),i-1,s)}},o.prototype.expandAllNodes=function(e){for(var i=this.getVisibleNodes(e,t.selectAll("."+me,this.element)),s=0,n=i.length;s<n;s++){var r=i[s],l=t.closest(r,"."+ve);this.expandAction(l,r,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,"."+ye),s=t.closest(i,"."+ve);t.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),t.detach(e),this.updateElement(i,s),this.updateInstance(),this.removeData(e)},o.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes(),this.allowServerDataBinding=!1,this.updateServerProperties("expand"),this.updateServerProperties("check"),this.updateServerProperties("select"),this.allowServerDataBinding=!0},o.prototype.updateServerProperties=function(e){this.isBlazorPlatform&&("expand"==e?(this.isBlazorExpandedNodes=this.expandedNodes,this.setProperties({expandedNodes:[]},!0)):"check"==e?this.setProperties({checkedNodes:this.checkedNodes},!0):this.setProperties({selectedNodes:this.selectedNodes},!0))},o.prototype.updateList=function(){this.liList=Array.prototype.slice.call(t.selectAll("."+ve,this.element))},o.prototype.updateSelectedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({selectedNodes:[]},!0);e=t.selectAll("."+Ce,this.element);this.selectGivenNodes(e)}else if(this.isBlazorPlatform&&this.initialRender)for(var e=t.selectAll("."+Ce,this.element),i=0;i<e.length;i++){var s=e[i].getAttribute("data-uid").toString();t.isNullOrUndefined(s)||-1!==this.selectedNodes.indexOf(s)||this.selectedNodes.push(s)}},o.prototype.updateExpandedNodes=function(){if(!this.isBlazorPlatform||this.isBlazorPlatform&&!this.initialRender){this.setProperties({expandedNodes:[]},!0);for(var e=0,i=(s=t.selectAll('[aria-expanded="true"]',this.element)).length;e<i;e++)this.addExpand(s[e])}else if(this.isBlazorPlatform&&this.initialRender)for(var s=t.selectAll('[aria-expanded="true"]',this.element),n=0;n<s.length;n++){var r=s[n].getAttribute("data-uid").toString();t.isNullOrUndefined(r)||-1!==this.expandedNodes.indexOf(r)||this.expandedNodes.push(r)}},o.prototype.removeData=function(e){if(1===this.dataType){var t=new r.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,l=i.length;n<l;n++){var o=new r.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,r=e.length;n<r;n++){var l=this.getElement(e[n]);if(!t.isNullOrUndefined(l)){var o=t.select("."+i,t.select("."+Oe,l));t.isNullOrUndefined(o)||(s?this.expandAction(l,o,null):this.collapseNode(l,o,null))}}},o.prototype.addGivenNodes=function(e,s,n,r,l){if(0!==e.length){var o=this.getSortedData(e),a=s?parseFloat(s.getAttribute("aria-level"))+1:1;r&&this.updateMapper(a);for(var d,h=i.ListBase.createListItemFromJson(this.createElement,o,this.listBaseOption,a),c=(d=l||(s?this.expandParent(s):t.select("."+ye,this.element))).childNodes[n],p=0;p<h.length;p++)d.insertBefore(h[p],c);this.nodeTemplate&&this.isBlazorPlatform&&!this.isStringTemplate&&this.updateBlazorTemplate();var u=this.getId(s);if(1===this.dataType){this.updateField(this.treeData,this.fields,u,"hasChildren",!0);for(var f=this.getId(c),m=t.isNullOrUndefined(f)?this.treeData.length:this.getDataPos(this.treeData,this.fields,f),v=0;v<e.length;v++){if(!t.isNullOrUndefined(u)){var g=this.isNumberTypeId?parseFloat(u):u;t.setValue(this.fields.parentID,g,e[v])}this.treeData.splice(m,0,e[v]),m++}}else this.addChildData(this.treeData,this.fields,u,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,l=0,o=e.length;l<o;l++){var a=t.getValue(i.id,e[l]);if(e[l]&&a&&a.toString()===s)return l;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[l]))){if(this.fields.dataSource instanceof r.DataManager&&!t.isNullOrUndefined(t.getValue("child",e[l]))){var d=t.getValue("child",e[l]);if(null!==(n=this.getDataPos(d,this.getChildMapper(i),s)))break}}else{var h=t.getValue(i.child,e[l]);if(null!==(n=this.getDataPos(h,this.getChildMapper(i),s)))break}}return n},o.prototype.addChildData=function(e,i,s,n,l){var o;if(t.isNullOrUndefined(s)){l=t.isNullOrUndefined(l)?e.length:l;for(var a=0,d=n.length;a<d;a++)e.splice(l,0,n[a]),l++;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 r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&e[h].hasOwnProperty("child")){var u="string"==typeof i.child?i.child:"child",f=t.getValue(u,e[h]);t.isNullOrUndefined(f)&&(f=[]),l=t.isNullOrUndefined(l)?f.length:l;for(var a=0,d=n.length;a<d;a++)f.splice(l,0,n[a]),l++}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 r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName&&!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,l)))break}}else{var m=t.getValue(i.child,e[h]);if(void 0!==(o=this.addChildData(m,this.getChildMapper(i),s,n,l)))break}}return o},o.prototype.doDisableAction=function(e){var i=this.nodeType(e),s=this.checkValidId(i);this.validArr=[];for(var n=0,r=s.length;n<r;n++){var l=s[n][this.fields.id].toString();l&&-1===this.disableNode.indexOf(l)&&this.disableNode.push(l);var o=this.getElement(l);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 r=this.getElement(i[s]),l=i[s];l&&-1!==this.disableNode.indexOf(l)&&this.disableNode.splice(this.disableNode.indexOf(l),1),r&&(r.removeAttribute("aria-disabled"),t.removeClass([r],"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 r=t.getValue(this.fields.child.toString(),this.treeData[s]);r&&this.filterNestedChild(r,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 r=t.getValue(this.fields.child.toString(),e[s]);r&&this.filterNestedChild(r,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);var s=this.expandedNodes;this.isBlazorPlatform&&(s=this.isBlazorExpandedNodes);for(var n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[n],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var l=this.checkedNodes,o=0,r=l.length;o<r;o++)this.updateField(this.treeData,this.fields,l[o],"isChecked",!0)}},o.prototype.removeField=function(e,i,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(i))for(var n=0,l=e.length;n<l;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 r.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,l){if(!t.isNullOrUndefined(s))if(1===this.dataType){var o=this.isNumberTypeId?parseFloat(s):s,a=new r.DataManager(this.treeData).executeLocal((new r.Query).where(i.id,"equal",o,!1));t.setValue(this.getMapperProp(i,n),l,a[0])}else this.updateChildField(e,i,s,n,l)},o.prototype.updateChildField=function(e,i,s,n,l,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),l,e[d]),a=[]),a;if("string"!=typeof i.child||t.isNullOrUndefined(t.getValue(i.child,e[d]))){if(this.fields.dataSource instanceof r.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,l,o)))break}}else{var u=t.getValue(i.child,e[d]);if(void 0!==(a=this.updateChildField(u,this.getChildMapper(i),s,n,l,o)))break}}return a},o.prototype.triggerEvent=function(){this.updateTemplateForBlazor(),this.renderReactTemplates();var e={data:this.treeData};this.trigger("dataSourceChanged",e)},o.prototype.updateBlazorTemplate=function(){t.updateBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate",this,!1)},o.prototype.clientUpdateInitial=function(){this.blazorInitialRender=!0},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,"."+ve):2===e.tapCount&&(i=t.closest(s,"."+ve))),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],Ne),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],Ne)},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 r.DataManager(this.treeData).executeLocal((new r.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,l=this.getChildNodes(this.treeData,n),o=0,a=0;a<l.length;a++){var d=l[a][this.fields.id].toString();-1!==this.checkedNodes.indexOf(d)&&o++}o===l.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,r=0;if(1===this.dataType){s&&(n=s[this.fields.id]?s[this.fields.id].toString():null);for(o=0;o<e.length;o++){var l=e[o][this.fields.id]?e[o][this.fields.id].toString():null;s&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.checkedNodes.push(l),l===i&&-1===this.checkedNodes.indexOf(i)&&this.checkedNodes.push(i),(d=this.getChildNodes(this.treeData,l))&&this.setChildCheckState(d,i,s)}}else{s&&(n=s[this.fields.id]?s[this.fields.id].toString():"");for(var o=0;o<e.length;o++){var a=e[o][this.fields.id]?e[o][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=t.getValue(this.fields.child.toString(),e[o]);d&&this.setChildCheckState(d,i,e[o]),-1!==this.checkedNodes.indexOf(a)&&this.autoCheck&&r++,r===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 r=0;r<s.length;r++)this.treeData.splice(n,0,s[r]),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,l){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 r.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,l)))break}}else{var p=t.getValue(i.child,e[a]);if(void 0!==(o=this.updateChildPosition(p,this.getChildMapper(i),s,n,l)))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,r,l,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==r.length)a=h.insert(r[0],p.fromTable,p);else{for(var C=[],v=0,g=r.length;v<g;v++)C.push(r[v]);f.addedRecords=C,a=h.saveChanges(f,u,p.fromTable,p)}a.then(function(e){var t=d.getElement(s);d.addSuccess(r,t,l),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)}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),r=t.select("."+ge,n);this.appendNewText(n,r,i,s)},o.prototype.addSuccess=function(e,t,i){var s,n=t?t.querySelector("."+xe):null,r=this;t&&n&&n.classList.contains(me)&&null===t.querySelector("."+ye)?r.renderChildNodes(t,null,function(){s=t.querySelector("."+ye),r.addGivenNodes(e,t,i,!0,s),r.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("."+ge,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 r=this.getElement(this.selectedNodes[0]);this.isLoaded=!1,this.removeSelectAll(),this.selectNode(r,null),this.isLoaded=!0}this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);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.isBlazorPlatform||this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.isBlazorPlatform||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.blazorInitialRender||this.reRenderNodes(),this.blazorInitialRender=!1,this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect);break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var l=this.element.querySelectorAll("li"),o=0;o<l.length;)"true"!==l[o].getAttribute("aria-expanded")&&this.renderChildNodes(l[o],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":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(){t.resetBlazorTemplate(this.element.id+"nodeTemplate","NodeTemplate"),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.isBlazorPlatform&&(this.ulElement=this.element.querySelector(".e-list-parent.e-ul")),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.isBlazorPlatform||e.prototype.destroy.call(this)},o.prototype.addNodes=function(e,i,s,n){if(!t.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var l=this.getElement(i);if(this.preventExpand=n,this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName)this.isOffline?this.addSuccess(e,l,s):this.crudOperation("insert",null,i,null,e,s,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,l,s);else{if(l)this.addGivenNodes(e,l,s);else{e=this.getSortedData(e);for(var o=0;o<e.length;o++){var a=t.getValue(this.fields.parentID,e[o]);l=a?this.getElement(a.toString()):a,this.addGivenNodes([e[o]],l,s)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&l&&this.ensureParentCheckState(l),(this.fields.dataSource instanceof r.DataManager==!1||this.fields.dataSource instanceof r.DataManager&&"BlazorAdaptor"===this.fields.dataSource.adaptorName)&&(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("."+ye,this.element),i,s):this.collapseAllNodes(s):this.doGivenAction(e,fe,!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,"."+ve);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("."+ye,this.element),i,s):this.expandAllNodes(s):this.doGivenAction(e,me,!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 l=this.getElement(i);if(!t.isNullOrUndefined(l)){for(var o=0;o<e.length;o++){var a=this.getElement(e[o]);t.isNullOrUndefined(a)||l.isSameNode(a)||this.isDescendant(a,l)||(this.preventExpand=n,this.dropAsChildNode(a,l,this,s))}this.fields.dataSource instanceof r.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent()}},o.prototype.refreshNode=function(e,s){if(!t.isNullOrUndefined(e)&&!t.isNullOrUndefined(s)){var n,r=!1;if(1==this.dataType&&s.length>1)r=!0;else if(2==this.dataType&&1===s.length){var l=t.getValue(this.fields.child.toString(),s[0]);t.isNullOrUndefined(l)||(r=!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&&r){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))return void this.updatePosition(n,a,r,s);this.isRefreshed=!0;var c=parseFloat(o.getAttribute("aria-level")),p=i.ListBase.createListItemFromJson(this.createElement,[a],this.listBaseOption,c),u=t.select("."+ye,o),f=t.getValue(this.fields.child.toString(),a);if(r&&u||r&&!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,r,s),r&&u&&this.expandAll([n])}else{var g=t.select("."+Oe,o),y=t.select("."+Oe,p[0]),b=t.select("div."+xe,g),C=t.select("div."+xe,y);b&&C&&(C.classList.contains(me)&&b.classList.contains(fe)?(t.removeClass([C],me),t.addClass([C],fe)):C.classList.contains(fe)&&b.classList.contains(me)?(t.removeClass([C],fe),t.addClass([C],me)):b.classList.contains("interaction")&&t.addClass([C],"interaction")),t.remove(g);var N=t.select("."+Ie,o);N.parentNode.insertBefore(y,N.nextSibling),this.updatePosition(n,a,r,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],Ce)),this.isRefreshed=!1,this.triggerEvent()}},o.prototype.removeNodes=function(e){t.isNullOrUndefined(e)||(this.fields.dataSource instanceof r.DataManager&&!this.isOffline&&"BlazorAdaptor"!==this.fields.dataSource.adaptorName?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 l=t.select("."+ge,n);this.updateOldText(n);var o=this.getEditEvent(n,null,null);this.trigger("nodeEditing",o,function(t){t.cancel||(s.fields.dataSource instanceof r.DataManager&&!s.isOffline&&"BlazorAdaptor"!==s.fields.dataSource.adaptorName?s.crudOperation("update",null,e,i,null,null,!1):s.appendNewText(n,l,i,!1))})}}},o.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)};var a;return pe([t.Property(!1)],o.prototype,"allowDragAndDrop",void 0),pe([t.Property(!1)],o.prototype,"allowEditing",void 0),pe([t.Property(!1)],o.prototype,"allowMultiSelection",void 0),pe([t.Complex({},Te)],o.prototype,"animation",void 0),pe([t.Property()],o.prototype,"checkedNodes",void 0),pe([t.Property("")],o.prototype,"cssClass",void 0),pe([t.Property(!1)],o.prototype,"disabled",void 0),pe([t.Property(null)],o.prototype,"dragArea",void 0),pe([t.Property(!1)],o.prototype,"enableHtmlSanitizer",void 0),pe([t.Property(!1)],o.prototype,"enablePersistence",void 0),pe([t.Property()],o.prototype,"expandedNodes",void 0),pe([t.Property("Auto")],o.prototype,"expandOn",void 0),pe([t.Complex({},Pe)],o.prototype,"fields",void 0),pe([t.Property(!0)],o.prototype,"fullRowSelect",void 0),pe([t.Property(!0)],o.prototype,"loadOnDemand",void 0),pe([t.Property()],o.prototype,"locale",void 0),pe([t.Property()],o.prototype,"nodeTemplate",void 0),pe([t.Property()],o.prototype,"selectedNodes",void 0),pe([t.Property("None")],o.prototype,"sortOrder",void 0),pe([t.Property(!1)],o.prototype,"showCheckBox",void 0),pe([t.Property(!0)],o.prototype,"autoCheck",void 0),pe([t.Property(!1)],o.prototype,"fullRowNavigable",void 0),pe([t.Event()],o.prototype,"actionFailure",void 0),pe([t.Event()],o.prototype,"created",void 0),pe([t.Event()],o.prototype,"dataBound",void 0),pe([t.Event()],o.prototype,"dataSourceChanged",void 0),pe([t.Event()],o.prototype,"drawNode",void 0),pe([t.Event()],o.prototype,"destroyed",void 0),pe([t.Event()],o.prototype,"keyPress",void 0),pe([t.Event()],o.prototype,"nodeChecked",void 0),pe([t.Event()],o.prototype,"nodeChecking",void 0),pe([t.Event()],o.prototype,"nodeClicked",void 0),pe([t.Event()],o.prototype,"nodeCollapsed",void 0),pe([t.Event()],o.prototype,"nodeCollapsing",void 0),pe([t.Event()],o.prototype,"nodeDragging",void 0),pe([t.Event()],o.prototype,"nodeDragStart",void 0),pe([t.Event()],o.prototype,"nodeDragStop",void 0),pe([t.Event()],o.prototype,"nodeDropped",void 0),pe([t.Event()],o.prototype,"nodeEdited",void 0),pe([t.Event()],o.prototype,"nodeEditing",void 0),pe([t.Event()],o.prototype,"nodeExpanded",void 0),pe([t.Event()],o.prototype,"nodeExpanding",void 0),pe([t.Event()],o.prototype,"nodeSelected",void 0),pe([t.Event()],o.prototype,"nodeSelecting",void 0),o=a=pe([t.NotifyPropertyChanges],o)}(t.Component),He=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)}}(),Be=function(e,t,i,s){var n,r=arguments.length,l=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(l=(r<3?n(l):r>3?n(t,i,l):n(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l},Re="e-close",je="e-open",qe="e-right",Fe="e-left",ze="e-over",Ve="e-push",We="e-sidebar-context",_e=function(e){function i(t,i){var s=e.call(this,t,i)||this;return s.isBlazor=!1,s}return He(i,e),i.prototype.preRender=function(){this.isBlazor=t.isBlazor()&&this.isServerRendered,this.isBlazor||this.setWidth()},i.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},i.prototype.initialize=function(){this.setTarget(),this.addClass(),this.isBlazor||this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?this.show():this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.isBlazor||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],"e-sidebar-absolute"),t.addClass([this.target],We),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(){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.isBlazor||(this.enableDock||"Auto"===this.type||t.addClass([this.element],["e-visibility"]),t.removeClass([this.element],[je,Re,qe,Fe,"e-slide",Ve,ze]),this.element.classList.add("e-sidebar"),t.addClass([this.element],"Right"===this.position?qe:Fe),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],Re):this.show()},i.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(Re)||e||this.hide()},i.prototype.transitionEnd=function(e){this.setDock(),t.isNullOrUndefined(e)||this.triggerChange(),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};t.isBlazor()&&delete s.model,this.trigger("close",s,function(e){if(!e.cancel){if(i.element.classList.contains(Re))return;i.element.classList.contains(je)&&!i.animate&&i.triggerChange(),t.addClass([i.element],Re),t.removeClass([i.element],je),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(je)&&e?"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):this.element.classList.contains(Re)&&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))},i.prototype.show=function(e){var i=this,s={model:this,element:this.element,cancel:!1,isInteracted:!t.isNullOrUndefined(e),event:e||null};t.isBlazor()&&delete s.model,this.trigger("open",s,function(e){if(!e.cancel){if(t.removeClass([i.element],"e-visibility"),i.element.classList.contains(je))return;i.element.classList.contains(Re)&&!i.animate&&i.triggerChange(),t.addClass([i.element],[je,"e-transition"]),t.setStyleAttribute(i.element,{transform:""}),t.removeClass([i.element],Re),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],"e-disable-animation"):t.addClass([this.element],"e-disable-animation")},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(Re)&&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(e){this.element.classList.contains(je)?this.hide():this.show()},i.prototype.getState=function(){return!!this.element.classList.contains(je)},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(e){"Auto"===this.type&&(t.Browser.isDevice?t.addClass([this.element],ze):t.addClass([this.element],Ve)),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(),window.addEventListener("resize",this.resize.bind(this))},i.prototype.unWireEvents=function(){window.removeEventListener("resize",this.resize.bind(this)),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,r=this.isServerRendered,l=0,o=Object.keys(i);l<o.length;l++)switch(o[l]){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],["e-visibility"]),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],Fe),t.addClass([this.element],qe)):(t.removeClass([this.element],qe),t.addClass([this.element],Fe)),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],"e-sidebar-absolute"),t.removeClass([s.target],We),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=r;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||(s.style["Left"===this.position?"marginLeft":"marginRight"]="0px"));var n=(this.position,i+"px"),r="Left"===this.position?i:-i;switch(t.removeClass([this.element],[Ve,ze,"e-slide"]),e){case"Push":t.addClass([this.element],[Ve]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Slide":t.addClass([this.element],["e-slide"]),s&&(this.enableDock||this.element.classList.contains(je))&&(s.style.transform="translateX("+r+"px)");break;case"Over":t.addClass([this.element],[ze]),this.enableDock&&this.element.classList.contains(Re)&&s&&(s.style["Left"===this.position?"marginLeft":"marginRight"]=n);break;case"Auto":t.addClass([this.element],["e-transition"]),t.Browser.isDevice?s&&this.enableDock&&!this.getState()?(s.style["Left"===this.position?"marginLeft":"marginRight"]=n,t.addClass([this.element],Ve)):t.addClass([this.element],ze):(t.addClass([this.element],Ve),s&&(this.enableDock||this.element.classList.contains(je))&&(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],We),this.destroyBackDrop(),this.element&&(t.removeClass([this.element],[je,Re,Ve,"e-slide",ze,Fe,qe,"e-transition"]),t.removeClass([this.element],"e-sidebar-absolute"),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()},Be([t.Property("auto")],i.prototype,"dockSize",void 0),Be([t.Property(null)],i.prototype,"mediaQuery",void 0),Be([t.Property(!1)],i.prototype,"enableDock",void 0),Be([t.Property("en-US")],i.prototype,"locale",void 0),Be([t.Property(!1)],i.prototype,"enablePersistence",void 0),Be([t.Property(!0)],i.prototype,"enableGestures",void 0),Be([t.Property(!1)],i.prototype,"isOpen",void 0),Be([t.Property(!1)],i.prototype,"enableRtl",void 0),Be([t.Property(!0)],i.prototype,"animate",void 0),Be([t.Property("auto")],i.prototype,"height",void 0),Be([t.Property(!1)],i.prototype,"closeOnDocumentClick",void 0),Be([t.Property("Left")],i.prototype,"position",void 0),Be([t.Property(null)],i.prototype,"target",void 0),Be([t.Property(!1)],i.prototype,"showBackdrop",void 0),Be([t.Property("Auto")],i.prototype,"type",void 0),Be([t.Property("auto")],i.prototype,"width",void 0),Be([t.Property(1e3)],i.prototype,"zIndex",void 0),Be([t.Event()],i.prototype,"created",void 0),Be([t.Event()],i.prototype,"close",void 0),Be([t.Event()],i.prototype,"open",void 0),Be([t.Event()],i.prototype,"change",void 0),Be([t.Event()],i.prototype,"destroyed",void 0),i=Be([t.NotifyPropertyChanges],i)}(t.Component);return e.MenuAnimationSettings=w,e.MenuItem=S,e.HScroll=p,e.VScroll=m,e.addScrolling=o,e.destroyScroll=d,e.Item=M,e.Toolbar=T,e.AccordionActionSettings=F,e.AccordionAnimationSettings=z,e.AccordionItem=V,e.Accordion=W,e.ContextMenu=Y,e.Menu=J,e.TabActionSettings=le,e.TabAnimationSettings=oe,e.Header=ae,e.TabItem=de,e.Tab=he,e.FieldsSettings=Pe,e.ActionSettings=Me,e.NodeAnimationSettings=Te,e.TreeView=Ue,e.Sidebar=_e,e}({},ej.base,ej.lists,ej.popups,ej.buttons,ej.data,ej.inputs),this.ejs=ej;
|