@syncfusion/ej2-navigations 28.1.36 → 28.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,11 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs)}(this,function(a,E,U,g,R,x,B){"use strict";j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var j,q,F=function(e,t){function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},W="e-rtl",V="e-overlay",_="e-nav-arrow",z="e-nav-right-arrow",K="e-nav-left-arrow",X="e-scroll-nav",Y="e-scroll-right-nav",G="e-scroll-left-nav",Q="e-scroll-device",J="e-scroll-overlay",Z="e-scroll-right-overlay",$="e-scroll-left-overlay",ee=(q=E.Component,F(t,q),t.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(W)},t.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(Q),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){E.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){for(var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"}),i=(t.setAttribute("tabindex","-1"),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},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var e=this.element,t=(e.style.display="",e.classList.remove("e-hscroll"),e.classList.remove(Q),e.classList.remove(W),E.selectAll(".e-"+e.id+"_nav."+X,e)),i=E.selectAll("."+J,e);[].slice.call(i).forEach(function(e){E.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,q.prototype.destroy.call(this)},t.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+V+")",this.element);t?this.element.classList.add(V):this.element.classList.remove(V),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:J+" "+Z}),s="e-"+e.id.concat("_nav "+X+" "+Y),t=this.createElement("div",{id:t.concat("_right"),className:s}),s=this.createElement("div",{className:z+" "+_+" e-icons"}),s=(t.appendChild(s),this.createElement("div",{className:J+" "+$}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+X+" "+Y),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},i=this.createElement("div",{className:i,attrs:s}),s=(i.setAttribute("aria-disabled","false"),this.createElement("div",{className:z+" "+_+" e-icons"})),n="e-"+e.id.concat("_nav "+X+" "+G),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},n=this.createElement("div",{className:n+" "+V,attrs:t}),t=(n.setAttribute("aria-disabled","true"),this.createElement("div",{className:K+" "+_+" e-icons"}));n.appendChild(t),i.appendChild(s),e.appendChild(i),e.insertBefore(n,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),n.classList.add("e-ie-align")),this.eventBinding([i,n])},t.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new E.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.EventHandler.add(e,"click",t.clickEventHandler,t)})},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,X)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(X)&&(n=t.querySelector("."+_).classList),this.contains(s,W)&&this.browserCheck&&(e=-e),!this.contains(s,W)||this.browserCheck||this.ieCheck?n.contains(z)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(K)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Left"===t.swipeDirection?s.scrollLeft+=n*e:"Right"===t.swipeDirection&&(s.scrollLeft-=n*e),r-=.5,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceX/(10*t.velocity):t.distanceX/t.velocity,r=.5;i()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&0<this.scrollEle.scrollLeft&&(this.scrollEle.scrollLeft=0)},t.prototype.frameScrollRequest=function(i,s,e){var n,r=this,o=10;e?this.scrollUpdating(i,s):(this.customStep||[].slice.call(E.selectAll("."+J,this.element)).forEach(function(e){i-=e.offsetWidth}),(n=function(){var e,t=r.contains(r.element,W)&&r.browserCheck?(e=-i,-o):(e=i,o);e<o?window.cancelAnimationFrame(t):(r.scrollUpdating(t,s),i-=t,window.requestAnimationFrame(n))})())},t.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,W)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},t.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(E.isNullOrUndefined(e)?t:e).querySelector("."+_),E.isNullOrUndefined(e)?E.classList(i,[z],[K]):E.classList(i,[K],[z])):e&&t&&(e.classList.add(V),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(V),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},t.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+G)),s=this.element.querySelector("."+Y),n=this.element.querySelector("."+$),r=this.element.querySelector("."+Z),o=e.scrollLeft;o<=0&&(o=-o),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(n=this.element.querySelector("."+Z),r=this.element.querySelector("."+$)),n.style.width=o<40?o+"px":"40px",e.scrollWidth-Math.ceil(t+o)<40?r.style.width=e.scrollWidth-Math.ceil(t+o)+"px":r.style.width="40px"),0===o?this.arrowDisabling(i,s):Math.ceil(t+o+.1)>=e.scrollWidth?this.arrowDisabling(s,i):(n=this.element.querySelector("."+X+"."+V))&&(n.classList.remove(V),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},t.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(W):this.element.classList.remove(W)}},e([E.Property(null)],t.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],t));function t(e,t){return q.call(this,e,t)||this}te=function(e,t){return(te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var te,ie,F=function(e,t){function i(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},se="e-rtl",ne="e-overlay",re="e-nav-arrow",oe="e-nav-up-arrow",le="e-nav-down-arrow",ae="e-scroll-nav",de="e-scroll-up-nav",he="e-scroll-down-nav",ce="e-scroll-device",pe="e-scroll-overlay",ue="e-scroll-up-overlay",me="e-scroll-down-overlay",fe=(ie=E.Component,F(i,ie),i.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(se)},i.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(ce),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),E.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){E.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){for(var e=E.createElement("div",{className:"e-vscroll-content"}),t=E.createElement("div",{className:"e-vscroll-bar"}),i=(t.setAttribute("tabindex","-1"),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.overflow="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var e=this.element,t=(e.style.display="",E.removeClass([this.element],["e-vscroll",ce,se]),E.selectAll(".e-"+e.id+"_nav."+ae,e)),i=E.selectAll("."+pe,e);[].slice.call(i).forEach(function(e){E.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,ie.prototype.destroy.call(this)},i.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+ne+")",this.element);t?this.element.classList.add(ne):this.element.classList.remove(ne),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},i.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=E.createElement("div",{className:pe+" "+me}),s="e-"+e.id.concat("_nav "+ae+" "+he),t=E.createElement("div",{id:t.concat("down"),className:s}),s=E.createElement("div",{className:le+" "+re+" e-icons"}),s=(t.appendChild(s),E.createElement("div",{className:pe+" "+ue}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+ae+" "+he),i=E.createElement("div",{id:t.concat("_down"),className:i}),s=(i.setAttribute("aria-disabled","false"),E.createElement("div",{className:le+" "+re+" e-icons"})),n="e-"+e.id.concat("_nav "+ae+" "+de),t=E.createElement("div",{id:t.concat("_up"),className:n+" "+ne}),n=(t.setAttribute("aria-disabled","true"),E.createElement("div",{className:oe+" "+re+" e-icons"}));t.appendChild(n),i.appendChild(s),i.setAttribute("tabindex","0"),e.appendChild(i),e.insertBefore(t,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),t.classList.add("e-ie-align")),this.eventBinding([i,t])},i.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new E.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.EventHandler.add(e,"click",t.clickEventHandler,t)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,ae)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;(s=s.contains(ae)?t.querySelector("."+re).classList:s).contains(le)?this.frameScrollRequest(e,"add",i):s.contains(oe)&&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,0<e.deltaY?"add":"",!1)},i.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Up"===t.swipeDirection?s.scrollTop+=n*e:"Down"===t.swipeDirection&&(s.scrollTop-=n*e),r-=.02,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceY/(10*t.velocity):t.distanceY/t.velocity,r=.5;i()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(t,e,i){var s,n=this,r=10;i?this.scrollUpdating(t,e):(this.customStep||[].slice.call(E.selectAll("."+pe,this.element)).forEach(function(e){t-=e.offsetHeight}),(s=function(){t<r?window.cancelAnimationFrame(r):(n.scrollUpdating(r,e),t-=r,window.requestAnimationFrame(s))})())},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,t){var i;this.isDevice?(i=(E.isNullOrUndefined(e)?t:e).querySelector("."+re),E.isNullOrUndefined(e)?E.classList(i,[le],[oe]):E.classList(i,[oe],[le])):(e.classList.add(ne),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(ne),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var e=e.target,t=e.offsetHeight,i=this.element.querySelector("."+de),s=this.element.querySelector("."+he),n=this.element.querySelector("."+ue),r=this.element.querySelector("."+me),o=e.scrollTop;o<=0&&(o=-o),this.isDevice&&(n.style.height=o<40?o+"px":"40px",e.scrollHeight-Math.ceil(t+o)<40?r.style.height=e.scrollHeight-Math.ceil(t+o)+"px":r.style.height="40px"),0===o?this.arrowDisabling(i,s):Math.ceil(t+o+.1)>=e.scrollHeight?this.arrowDisabling(s,i):(n=this.element.querySelector("."+ae+"."+ne))&&(n.classList.remove(ne),n.setAttribute("aria-disabled","false"),n.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(se):this.element.classList.remove(se)}},e([E.Property(null)],i.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],i));function i(e,t){return ie.call(this,e,t)||this}function ge(e,t,i,s,n,r){var o,l=t.parentElement,a="vscroll"===s?(o=r||t.getBoundingClientRect().height,i.getBoundingClientRect().height):(o=t.getBoundingClientRect().width,i.getBoundingClientRect().width);return o<a?ve(e,t,i,s,n,r):l&&(l=l.getBoundingClientRect().width)<o&&"hscroll"===s?(t.style.maxWidth=(a=l)+"px",ve(e,t,i,s,n,r)):i}function ve(e,t,i,s,n,r){e=e("div",{className:"e-menu-"+s});return t.appendChild(e),e.appendChild(i),r?(e.style.overflow="hidden",e.style.height=r+"px"):(e.style.maxHeight=t.style.maxHeight,t.style.overflow="hidden"),"vscroll"===s?new fe({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetHeight/2:new ee({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetWidth,e}function ye(e,t,i){var s;e&&((s=E.select(".e-menu-parent",t))?i&&i!==s||(e.destroy(),t.parentElement.appendChild(s),E.detach(t)):(e.destroy(),E.detach(t)))}be=function(e,t){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var be,Ce,F=function(e,t){function i(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Se="enter",Ie="escape",v="e-focused",Ee="e-menu-header",y="e-selected",xe="e-separator",Ne="uparrow",Oe="downarrow",we="leftarrow",Le="rightarrow",ke="home",Ae="end",Te="tab",Pe="e-caret",De="e-menu-item",Me="e-disabled",He="e-menu-hide",Ue="e-icons",Re="e-rtl",Be="e-menu-popup",je=(Ce=E.ChildProperty,F(qe,Ce),e([E.Property("id")],qe.prototype,"itemId",void 0),e([E.Property("parentId")],qe.prototype,"parentId",void 0),e([E.Property("text")],qe.prototype,"text",void 0),e([E.Property("iconCss")],qe.prototype,"iconCss",void 0),e([E.Property("url")],qe.prototype,"url",void 0),e([E.Property("separator")],qe.prototype,"separator",void 0),e([E.Property("items")],qe.prototype,"children",void 0),qe);function qe(){return null!==Ce&&Ce.apply(this,arguments)||this}Fe=E.ChildProperty,F(Ve,Fe),e([E.Property(null)],Ve.prototype,"iconCss",void 0),e([E.Property("")],Ve.prototype,"id",void 0),e([E.Property(!1)],Ve.prototype,"separator",void 0),e([E.Collection([],Ve)],Ve.prototype,"items",void 0),e([E.Property("")],Ve.prototype,"text",void 0),e([E.Property("")],Ve.prototype,"url",void 0),e([E.Property()],Ve.prototype,"htmlAttributes",void 0);var Fe,We=Ve;function Ve(){return null!==Fe&&Fe.apply(this,arguments)||this}_e=E.ChildProperty,F(Ke,_e),e([E.Property("SlideDown")],Ke.prototype,"effect",void 0),e([E.Property(400)],Ke.prototype,"duration",void 0),e([E.Property("ease")],Ke.prototype,"easing",void 0);var _e,ze=Ke;function Ke(){return null!==_e&&_e.apply(this,arguments)||this}Xe=E.Component,F(s,Xe),s.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=E.getValue("ej2_instances",this.element),E.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,E.setValue("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName())}),E.append([].slice.call(this.element.cloneNode(!0).children),i),(t=this.element.nextElementSibling)?this.element.parentElement.insertBefore(i,t):this.element.parentElement.appendChild(i),this.clonedElement=i),this.clonedElement.style.display="none"),"EJS-MENU"===this.element.tagName){for(var e=this.element,t=E.getValue("ej2_instances",e),i=this.createElement("ul"),s=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,r=e.attributes.length;n<r;n++)i.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(s,e),E.detach(e),e=i,s.appendChild(e),E.setValue("ej2_instances",t,e),this.clonedElement=s,this.element=e,this.element.id||(this.element.id=E.getUniqueID(this.getModuleName()))}},s.prototype.render=function(){var e=this,t=(this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete(),this.getWrapper());this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){ge(e.createElement,t,e.element,"hscroll",e.enableRtl)})},s.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&&E.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Re),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},s.prototype.renderItems=function(){this.items.length||(e=U.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);E.append(Array.prototype.slice.call(e.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&&(e=this.getWrapper(),this.element.classList.contains("e-vertical")?ge(this.createElement,e,this.element,"vscroll",this.enableRtl):ge(this.createElement,e,this.element,"hscroll",this.enableRtl))):(this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu"))},s.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var t=void 0,i=E.selectAll(this.target),s=0,n=i.length;s<n;s++)t=i[s],this.isMenu?E.EventHandler.add(t,"click",this.menuHeaderClickHandler,this):E.Browser.isIos?new E.Touch(t,{tapHold:this.touchHandler.bind(this)}):E.EventHandler.add(t,"contextmenu",this.cmenuHandler,this);if(this.targetElement=t,!this.isMenu){E.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var r=0,o=g.getScrollableParent(this.targetElement);r<o.length;r++){var l=o[r];E.EventHandler.add(l,"scroll",this.scrollHandler,this)}}}E.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),E.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),E.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),E.EventHandler.add(document,"keydown",this.domKeyHandler,this),this.isMenu)||this.target||E.EventHandler.add(document,"scroll",this.scrollHandler,this),this.delegateClickHandler=this.clickHandler.bind(this),E.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=E.rippleEffect(e,{selector:"."+De})},s.prototype.wireKeyboardEvent=function(e){var t={downarrow:Oe,uparrow:Ne,enter:Se,leftarrow:we,rightarrow:Le,escape:Ie};this.isMenu&&(t.home=ke,t.end=Ae,t.tab=Te),new E.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s.prototype.mouseDownHandler=function(e){E.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||E.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},s.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},s.prototype.domKeyHandler=function(e){27===e.keyCode&&(e.action=Ie,this.leftEscKeyHandler(e))},s.prototype.keyBoardHandler=function(e){var t="",i=e.target,s=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&i.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([v,y],[E.closest(i,".e-"+this.getModuleName()+"-wrapper")]),s)switch(e.action){case Le:t=Le,e.action=Oe;break;case we:t=we,e.action=Ne;break;case Oe:t=Oe,e.action=Le;break;case Ne:t=Ne,e.action=""}else if(this.enableRtl)switch(e.action){case we:s=!0,t=we,e.action=Le;break;case Le:s=!0,t=Le,e.action=we}switch(e.action){case Oe:case Ne:case Ae:case ke:case Te:this.upDownKeyHandler(e);break;case Le:this.rightEnterKeyHandler(e);break;case we:this.leftEscKeyHandler(e);break;case Se:this.hamburgerMode&&"SPAN"===i.tagName&&i.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}s&&(e.action=t)},s.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===Oe||e.action===ke||e.action===Te?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,v),n=(n&&(e.action!==Ae&&e.action!==ke&&(s=this.getIdx(t,n)),n.classList.remove(v),e.action!==Ae)&&e.action!==ke&&(e.action===Oe?s++:s--,s===(e.action===Oe?t.childElementCount:-1))&&(s=i),t.children[s]),s=this.isValidLI(n,s,e.action);t.children[s].classList.add(v),t.children[s].focus()},s.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n=i===Oe||i===ke||i===Te?0:s.childElementCount-1;return(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))&&(i===Oe&&t===s.childElementCount-1||i===Ne&&0===t?t=n:i===Oe||i===Le||"tab"===i&&e.classList.contains(xe)?t++:t--),t=(e=s.children[t])&&(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))?this.isValidLI(e,t,i):t},s.prototype.getUlByNavIdx=function(e){var t,i,s=this;return void 0===e&&(e=this.navIdx.length),this.isMenu?(t=[this.getWrapper()].concat([].slice.call(E.selectAll("."+Be)))[e],i=[],E.selectAll("."+Be).forEach(function(e){(s.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&i.push(e)}),t=[this.getWrapper()].concat([].slice.call(i))[e],E.isNullOrUndefined(t)?null:E.select(".e-menu-parent",t)):document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},s.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,v);if(i){var t=this.getIdx(t,i),s=this.navIdx.concat(t),n=this.getItem(s);if(n.items.length)this.navIdx.push(t),this.keyType="right",this.action=e.action,this.openMenu(i,n,-1,-1,e);else if(e.action===Se){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([y],[this.getWrapper()]):i.classList.remove(v),i.classList.add(y),this.trigger("select",{element:i,item:n,event:e});s=i.querySelector(".e-menu-url");if(n.url&&s)switch(s.getAttribute("target")){case"_blank":window.open(n.url,"_blank");break;case"_parent":window.parent.location.href=n.url;break;default:window.location.href=n.url}this.closeMenu(null,e);t=this.getLIByClass(this.getUlByNavIdx(),y);t&&(t.classList.add(v),t.focus())}}},s.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===Ie&&this.closeMenu(null,e)},s.prototype.scrollHandler=function(e){this.closeMenu(null,e)},s.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},s.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},s.prototype.closeMenu=function(l,a,d){var e,h,c,t,p,i,s,n,u,m,f=this;void 0===l&&(l=0),void 0===a&&(a=null),this.isMenuVisible()&&(e=void 0,c=this.getWrapper(),t=void 0,i=this.getPopups(),s=!1,n=this.isMenu?i.length+1:c.childElementCount,u=this.isMenu&&1!==n?E.select(".e-ul",i[n-2]):E.selectAll(".e-menu-parent",c)[n-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,y))&&e.classList.remove(y),s=!0),s||(m=a&&a.target&&this.getLI(a.target),this.cli=m||u.children[0],h=this.navIdx.length?this.getItem(this.navIdx):null,p=(h||this).items,t={element:u,parentItem:h,items:p,event:a,cancel:!1,isFocused:!0},this.trigger("beforeClose",t,function(e){var t,i,s,n="",r=!e.cancel,o=((r||f.isCMenu)&&(f.isMenu?(t=E.closest(u,"."+Be),f.hamburgerMode&&(t.parentElement.style.minHeight="",E.closest(u,".e-menu-item").setAttribute("aria-expanded","false")),f.unWireKeyboardEvent(t),ye(E.getInstance(t.children[0],fe),t.children[0]),(o=E.getInstance(t,g.Popup)).hide(),n=t.id,o.destroy(),E.detach(t)):(f.isContextMenuClosed=!1,f.toggleAnimation(u,!1)),f.trigger("onClose",{element:u,parentItem:h,items:p}),f.navIdx.pop(),0===f.navIdx.length&&a&&"keyup"===a.type&&(f.showSubMenu=!1),f.isMenu||(E.EventHandler.remove(u,"keydown",f.keyHandler),"right"===f.keyType&&(f.keyType=""))),f.updateReactTemplate(),f.getWrapper()&&f.getUlByNavIdx()),n=(f.isCMenu&&(f.canOpen(a.target)&&f.openMenu(null,null,f.pageY,f.pageX,a),f.isCMenu=!1),f.isMenu&&o&&n.length?(t=new RegExp("(.*)-ej2menu-"+f.element.id+"-popup").exec(n)[1],i=o.querySelector('[id="'+t+'"]'),s=m&&o.querySelector('[id="'+m.id+'"]')):o&&(i=o.querySelector(".e-menu-item.e-selected"),s=m&&o.querySelector('[id="'+m.id+'"]')),m&&m.querySelectorAll(".e-menu-item"));r&&f.hamburgerMode&&l&&!n.length?f.afterCloseMenu(a):r&&!f.hamburgerMode&&i&&!s&&"left"!==f.keyType&&(f.navIdx.length||!f.isMenu&&0===f.navIdx.length)?(t=a&&a.target.classList&&(a.target.classList.contains("e-vscroll")||a.target.classList.contains("e-scroll-nav"))?E.closest(a.target,".e-menu-wrapper"):null)?(t=t.querySelector(".e-menu-item"),(f.showItemOnClick||t&&f.getIndex(t.id,!0).length<=f.navIdx.length)&&f.closeMenu(f.navIdx[f.navIdx.length-1],a,!0)):a&&a.target.classList&&a.target.classList.contains("e-nav-arrow")||f.closeMenu(f.navIdx[f.navIdx.length-1],a):r&&!d&&!l&&(f.hamburgerMode&&f.navIdx.length||1===f.navIdx.length&&m&&o!==m.parentElement)||r&&E.isNullOrUndefined(l)&&f.navIdx.length?f.closeMenu(null,a):!r||f.isMenu||l||0!==f.navIdx.length||f.isMenusClosed||f.isCmenuHover?r&&f.isMenu&&a&&a.target&&0!==f.navIdx.length&&E.closest(a.target,".e-menu-parent.e-control")?f.closeMenu(0,a):r&&!f.isMenu&&E.selectAll(".e-menu-parent",c)[l-1]&&3===a.which?f.closeMenu(null,a):(!r||"right"!==f.keyType&&"click"!==f.keyType?(n=f.getUlByNavIdx(),(i=f.getLIByClass(n,y))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(y),e.isFocused&&m||"left"===f.keyType)&&(i.classList.add(v),a.target&&a.target.classList.contains("e-edit-template")||i.focus()),!r&&f.hamburgerMode&&m&&"false"===m.getAttribute("aria-expanded")&&"true"===m.getAttribute("aria-haspopup")&&(E.closest(m,".e-menu-parent.e-control")?f.navIdx=[]:f.navIdx.pop(),f.navIdx.push(f.cliIdx),s=f.getItem(f.navIdx),m.setAttribute("aria-expanded","true"),f.openMenu(m,s,-1,-1,a))):f.afterCloseMenu(a),f.navIdx.length<1&&("Hover"!==f.showSubMenuOn&&"Click"!==f.showSubMenuOn||(f.showItemOnClick=f.defaultOption,f.showSubMenuOn="Auto"))):(f.isMenusClosed=!0,f.closeMenu(0,a)),f.removeStateWrapper()})))},s.prototype.updateReactTemplate=function(){var e;this.isReact&&this.template&&0===this.navIdx.length&&(e=void 0,this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates())},s.prototype.getMenuItemModel=function(e,t){if(E.isNullOrUndefined(e))return null;E.isNullOrUndefined(t)&&(t=0);t=this.getFields(t);return{text:e[t.text],id:e[t.id],items:e[t.child],separator:e[t.separator],iconCss:e[t.iconCss],url:e[t.url]}},s.prototype.getPopups=function(){var t=this,i=[];return[].slice.call(document.querySelectorAll("."+Be)).forEach(function(e){!E.isNullOrUndefined(e.querySelector("."+De))&&t.getIndex(e.querySelector("."+De).id,!0).length&&i.push(e)}),i},s.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&E.isVisible(this.element).valueOf()},s.prototype.canOpen=function(e){var t=!0;if(this.filter)for(var t=!1,i=this.filter.split(" "),s=0,n=i.length;s<n;s++)if(E.closest(e,"."+i[s])){t=!0;break}return t},s.prototype.openMenu=function(e,t,i,s,n,r){var o,l=this,a=(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=null),void 0===r&&(r=this.targetElement),this.getWrapper()),d=(this.lItem=e,""!==this.element.id?this.element.id:"menu");this.isMenusClosed=!1,E.isNullOrUndefined(i)&&(i=-1),E.isNullOrUndefined(s)&&(s=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&E.Browser.isDevice&&(a.lastChild.style.display="none",o={text:t[this.getField("text")].toString(),iconCss:Ue+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Ue+" e-previous"),o=new We(this.items[0],"items",this.template?t:o,!0),(o=this.createItems([o]).children[0]).classList.add(Ee),this.uList.insertBefore(o,this.uList.children[0])),this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Be,id:e.id+"-ej2menu-"+d+"-popup"}),(this.hamburgerMode?(i=e.offsetHeight,e):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&&E.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,t,n,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,t,n,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,a.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,t,n,i,s,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))):(this.uList=this.element,this.uList.style.zIndex=g.getZindexPartial(r||this.element).toString(),E.isNullOrUndefined(n)?((o=document.createEvent("MouseEvents")).initEvent("click",!0,!1),(d=this.copyObject(o,{})).target=d.srcElement=r,d.currentTarget=r,this.triggerBeforeOpen(e,this.uList,t,d,i,s,"none")):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))},s.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},s.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),i=parseInt(i.textIndent,10),s=(this.navIdx.length<2&&!t.classList.contains("e-blankicon")?i*=2:i+=i/4,e.style.textIndent=i+"px",e.querySelectorAll(".e-blankicon"));if(s&&s.length)for(var t=e.querySelector(".e-menu-icon"),e=getComputedStyle(t),n=parseInt(e.marginRight,10)+t.offsetWidth+i,r=0;r<s.length;r++)s[r].style.textIndent=n+"px"},s.prototype.generatePopup=function(e,t,i,s){var n=this,r=new g.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:i,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:s||this.enableRtl?"none":"flip",Y:"fit"},position:s&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:t,open:function(){var e=E.select(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),E.select(".e-ul",r.element));r.element.style.maxHeight="",e.focus(),n.triggerOpen(e)}});return r},s.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var t=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),i=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(this.title):this.title,i=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:i}),s=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});t.appendChild(i),t.appendChild(s),e.insertBefore(t,this.element)},s.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},s.prototype.closeHamburgerMenu=function(t){var i=this,e={element:this.element,parentItem:null,event:t,items:this.items,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(i.closeMenu(null,t),i.element.classList.add("e-hide-menu"),i.trigger("onClose",{element:i.element,parentItem:null,items:i.items}))})},s.prototype.callFit=function(e,t,i,s,n){return g.fit(e,null,{X:t,Y:i},{top:s,left:n})},s.prototype.triggerBeforeOpen=function(s,n,r,o,e,t,i){var l,a=this,d=s?r[this.getField("children",this.navIdx.length-1)]:this.items,h=i;this.trigger("beforeOpen",{element:n,items:d,parentItem:r,event:o,cancel:!1,top:e,left:t,showSubMenuOn:"Auto"},function(e){switch(h){case"menu":a.hamburgerMode||("Auto"!==e.showSubMenuOn&&(a.showItemOnClick=!a.defaultOption,a.showSubMenuOn=e.showSubMenuOn),a.top=e.top,a.left=e.left),a.popupWrapper.style.display="block",a.hamburgerMode||(a.popupWrapper.style.maxHeight=a.popupWrapper.getBoundingClientRect().height+"px",a.enableScrolling&&ge(a.createElement,a.popupWrapper,a.uList,"vscroll",a.enableRtl),a.checkScrollOffset(o)),a.hamburgerMode||a.left||a.top?(a.popupObj.collision={X:"none",Y:"none"},a.popupWrapper.style.display=""):(a.popupObj.refreshPosition(a.lItem,!0),a.left=parseInt(a.popupWrapper.style.left,10),a.top=parseInt(a.popupWrapper.style.top,10),a.enableRtl&&(a.left=a.isNestedOrVertical?a.left-a.popupWrapper.offsetWidth-a.lItem.parentElement.offsetWidth+2:a.left-a.popupWrapper.offsetWidth+a.lItem.offsetWidth),a.template&&(a.isReact||a.isAngular)?requestAnimationFrame(function(){a.collision(),a.popupWrapper.style.display=""}):(a.collision(),a.popupWrapper.style.display=""));break;case"none":a.top=e.top,a.left=e.left,a.isContextMenuClosed=!0,l=e.element,a.enableScrolling&&a.isCMenu&&l&&l.parentElement&&(l.style.height=l.parentElement.style.height);break;case"hamburger":e.cancel||(a.element.classList.remove("e-hide-menu"),a.triggerOpen(a.element))}var t,i;"hamburger"!==h&&(e.cancel?(a.isMenu?(a.popupObj.destroy(),E.detach(a.popupWrapper)):-1<n.className.indexOf("e-ul")&&E.detach(n),a.navIdx.pop()):a.isMenu?a.hamburgerMode?(a.popupWrapper.style.top=a.top+"px",a.popupWrapper.style.left="0px",a.toggleAnimation(a.popupWrapper)):(a.setBlankIconStyle(a.popupWrapper),a.wireKeyboardEvent(a.popupWrapper),E.rippleEffect(a.popupWrapper,{selector:"."+De}),a.popupWrapper.style.left=a.left+"px",a.popupWrapper.style.top=a.top+"px",t="None"!==a.animationSettings.effect?{name:a.animationSettings.effect,duration:a.animationSettings.duration,timingFunction:a.animationSettings.easing}:null,a.popupObj.show(t,a.lItem),E.Browser.isDevice&&(a.popupWrapper.style.left=a.left+"px")):(a.setBlankIconStyle(a.uList),a.setPosition(a.lItem,a.uList,a.top,a.left),a.toggleAnimation(a.uList))),"right"===a.keyType&&(t=a.getUlByNavIdx(),s.classList.remove(v),a.isMenu&&1===a.navIdx.length&&a.removeLIStateByClass([y],[a.getWrapper()]),s.classList.add(y),a.action===Se&&a.trigger("select",{element:s,item:r,event:o}),s.focus(),t=a.getUlByNavIdx(),i=a.isValidLI(t.children[0],0,a.action),t.children[i].classList.add(v),t.children[i].focus())})},s.prototype.collision=function(){var e,t=g.isCollide(this.popupWrapper,null,this.left,this.top);(this.isNestedOrVertical||this.enableRtl)&&(-1<t.indexOf("right")||-1<t.indexOf("left"))&&(this.popupObj.collision.X="none",e=E.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?g.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=g.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")||-1<t.indexOf("right"))&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},s.prototype.setBlankIconStyle=function(e){var t,i,s,n,r=[].slice.call(e.getElementsByClassName("e-blankicon"));r.length&&(e=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"))&&(i=e.querySelector(".e-menu-icon"))&&(t=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},i=getComputedStyle(i),s=parseInt(i.fontSize,10),n=(s=parseInt(i.width,10)&&parseInt(i.width,10)>s?parseInt(i.width,10):s)+parseInt(i[t.margin],10)+parseInt(getComputedStyle(e)[t.padding],10)+"px",r.forEach(function(e){e.style[t.padding]=n}))},s.prototype.checkScrollOffset=function(e){var t,i=this.getWrapper();i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length&&(e=E.isNullOrUndefined(e)?this.element:E.closest(e.target,"."+De),(i=E.select(".e-hscroll-bar",i)).scrollLeft>e.offsetLeft&&(i.scrollLeft-=i.scrollLeft-e.offsetLeft),(t=i.scrollLeft+i.offsetWidth)<(e=e.offsetLeft+e.offsetWidth))&&(i.scrollLeft+=e-t)},s.prototype.setPosition=function(e,t,i,s){this.toggleVisiblity(t),t===this.element||-1<s&&-1<i?(-1<(r=g.isCollide(t,null,s,i)).indexOf("right")&&(s-=t.offsetWidth),-1<r.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top-20)<0&&-1<(n=pageYOffset+document.documentElement.clientHeight-t.getBoundingClientRect().height)&&(i=n),-1<(r=g.isCollide(t,null,s,i)).indexOf("left")&&(s=(o=this.callFit(t,!0,!1,i,s)).left)):E.Browser.isDevice?(i=Number(this.element.style.top.replace("px","")),s=Number(this.element.style.left.replace("px",""))):(n=this.enableRtl?"left":"right",i=(o=g.calculatePosition(e,n,"top")).top,s=o.left,(n=-1<(r=g.isCollide(t,null,this.enableRtl?s-t.offsetWidth:s,i)).indexOf("left")||-1<r.indexOf("right"))&&(s=(o=g.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||n)&&(s=this.enableRtl&&n?s:s-t.offsetWidth),-1<r.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top)),this.toggleVisiblity(t,!1),this.isCMenu&&this.enableScrolling&&t&&(t.style.height="");var n,r,o,e=E.closest(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(n=E.closest(t,".e-menu-vscroll"),t.style.display="block",n&&ye(E.getInstance(n,fe),n),r=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),o=ge(this.createElement,e,t,"vscroll",this.enableRtl,e.offsetHeight),Object.assign(o.style,{top:i+"px",left:s+"px",width:r+"px",position:"absolute",display:"none"})):(t.style.top=i+"px",t.style.left=s+"px")},s.prototype.getMenuWidth=function(e,t,i){e=e.getElementsByClassName(Pe)[0];return e&&(t+=parseInt(getComputedStyle(e)[i?"marginRight":"marginLeft"],10)),t<120?120:t},s.prototype.toggleVisiblity=function(e,t){e.style.visibility=(t=void 0===t?!0:t)?"hidden":"",e.style.display=t?"block":"none"},s.prototype.createItems=function(e){var i=this,s=this.navIdx?this.navIdx.length:0,t=this.getFields(s),n=this.hasField(e,this.getField("iconCss",s)),r={showIcon:n,moduleName:"menu",fields:t,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[t.id]]||(e.curData[e.fields[t.id]]=E.getUniqueID("menuitem")),E.isNullOrUndefined(e.curData.htmlAttributes)&&(e.curData.htmlAttributes={}),E.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),!i.isMenu||e.curData[i.getField("separator",s)]||e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]||e.curData[e.fields.id]),""===e.curData[e.fields[t.iconCss]]&&(e.curData[e.fields[t.iconCss]]=null)},itemCreated:function(e){e.curData[i.getField("separator",s)]&&(e.item.classList.add(xe),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator")),!n||e.curData[e.fields.iconCss]||e.curData[i.getField("separator",s)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length&&(t=i.createElement("span",{className:Ue+" "+Pe}),e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")),i.isMenu&&i.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"),e.item.removeAttribute("aria-level"));var t={item:e.curData,element:e.item};i.trigger("beforeItemRender",t)}},e=(this.setProperties({items:this.items},!0),this.isMenu&&(r.templateID=this.element.id+"Template"),U.ListBase.createList(this.createElement,e,r,!this.template,this));return e.setAttribute("tabindex","0"),this.isMenu?e.setAttribute("role","menu"):e.setAttribute("role","menubar"),e},s.prototype.moverHandler=function(e){var t=e.target,i=(this.liTrgt=t,this.isMenu||(this.isCmenuHover=!0),this.getLI(t)),s=i?E.closest(i,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),n=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(s){if((""!==s.id?r.exec(s.id)[1]:s.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([v,y],[this.getWrapper()]),!this.navIdx.length)return;o=!0}i&&E.closest(i,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([v],this.isMenu?[s].concat(this.getPopups()):[s]),this.removeLIStateByClass([v],this.isMenu?[n].concat(this.getPopups()):[n]),i.classList.add(v),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([v],[s].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===s||E.closest(t,".e-"+this.getModuleName()+"-popup")||i&&this.getIndex(i.id,!0).length||"Hover"===this.showSubMenuOn?o&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([v],[s]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},s.prototype.removeStateWrapper=function(){var e;this.liTrgt&&(e=E.closest(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([v,y],[e])},s.prototype.removeLIStateByClass=function(e,i){for(var s,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(s=E.select("."+e,i[t]))&&s.classList.remove(e)})}(t)},s.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];return"string"==typeof e?e:(e[t]||e[e.length-1]).toString()},s.prototype.getFields=function(e){return{id:this.getField("itemId",e=void 0===e?0: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)}},s.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},s.prototype.menuHeaderClickHandler=function(e){var t=E.closest(e.target,".e-menu-wrapper");t&&t.querySelector("ul.e-menu-parent").id!==this.element.id||(-1<this.element.className.indexOf("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},s.prototype.clickHandler=function(e){this.isTapHold=this.isTapHold&&!1;var t,i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),o=n?E.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,l=n&&o&&(this.isMenu?0<this.getIndex(n.id,!0).length:i.firstElementChild.id===o.firstElementChild.id);if(E.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([v],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&o&&this.isMenu){var r=o.id?r.exec(o.id)[1]:o.querySelector(".e-menu-parent").id;if(this.element.id!==r)return}l&&"click"===e.type&&!n.classList.contains(Ee)&&(this.setLISelected(n),o=this.getIndex(n.id,!0),r=this.getItem(o),this.trigger("select",{element:n,item:r,event:e})),l&&("mouseover"===e.type||E.Browser.isDevice||this.showItemOnClick)?(o=void 0,n.classList.contains(Ee)?(o=i.children[this.navIdx.length-1],this.toggleAnimation(o),(t=this.getLIByClass(o,y))&&t.classList.remove(y),E.detach(n.parentNode),this.navIdx.pop()):n.classList.contains(xe)||(this.showSubMenu=!0,r=n.parentNode,E.isNullOrUndefined(r))||(this.cliIdx=this.getIdx(r,n),!this.isMenu&&E.Browser.isDevice||(l=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),E.closest(r,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,r),this.navIdx[l]===this.cliIdx&&(this.showSubMenu=!1),l===this.navIdx.length)||"mouseover"===e.type&&!this.showSubMenu||((t=this.getLIByClass(r,y))&&t.classList.remove(y),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(l+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))),this.isClosed||this.afterCloseMenu(e),this.isClosed=!1)):"DIV"===s.tagName&&E.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)?(o=this.isMenu?E.closest(s,"."+Be):E.closest(s,".e-menu-vscroll"),(r=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),o)+1:this.getIdx(i,E.select("ul.e-menu-parent",o)))<this.navIdx.length&&(this.closeMenu(r+1,e),o)&&this.removeLIStateByClass([v,y],[o])):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("."+De).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([y],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector("."+Pe))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||0<=navigator.platform.toUpperCase().indexOf("MAC")&&!e.ctrlKey)&&this.closeMenu(null,e))},s.prototype.afterCloseMenu=function(e){var t,i,s;E.isNullOrUndefined(e)||(this.showSubMenu&&(t=this.showItemOnClick&&0===this.navIdx.length?E.closest(e.target,".e-menu-parent.e-control"):E.closest(this.element,".e-menu-parent.e-control"),i=this.navIdx.concat(this.cliIdx),(s=this.getItem(i))&&s[this.getField("children",i.length-1)]&&s[this.getField("children",i.length-1)].length?(("mouseover"===e.type||E.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&t||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,s,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!t)&&(i=this.getUlByNavIdx(),s=this.getLIByClass(i,y))&&(s.setAttribute("aria-expanded","false"),s.classList.remove(y)),this.keyType="")},s.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,y);t&&t.classList.remove(y),this.isMenu||e.classList.remove(v),e.classList.add(y)},s.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},s.prototype.getItemIndex=function(e,t){e="string"==typeof e?e:e.id;return this.getIndex(e,!1!==t)},s.prototype.setItem=function(e,t,i){t=i?t||e.id:t||e.text,t=this.getIndex(t,i),i=this.getItem(t);Object.assign(i,e)},s.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},s.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},s.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])},s.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=!this.isMenu&&this.enableScrolling&&E.select(".e-menu-vscroll",e)?E.selectAll(".e-menu-parent",e):Array.from(e.children),s=Array.prototype.indexOf.call(s,t);return i&&e.children[0].classList.contains(Ee)&&s--,s},s.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:E.closest(e,"li.e-menu-item")},s.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)}},s.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},s.prototype.onPropertyChanged=function(d,h){for(var c=this,p=this.getWrapper(),u=this,e=0,t=Object.keys(d);e<t.length;e++)!function(e){switch(e){case"cssClass":h.cssClass&&E.removeClass([p],h.cssClass.split(" ")),d.cssClass&&E.addClass([p],d.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":u.enableRtl?p.classList.add(Re):p.classList.remove(Re);break;case"showItemOnClick":u.unWireEvents(),u.showItemOnClick=d.showItemOnClick,u.wireEvents();break;case"enableScrolling":var t,i;d.enableScrolling?(u.element.classList.contains("e-vertical")?ge(u.createElement,p,u.element,"vscroll",u.enableRtl):ge(u.createElement,p,u.element,"hscroll",u.enableRtl),u.getPopups().forEach(function(e){t=E.select(".e-ul",e),ge(c.createElement,e,t,"vscroll",c.enableRtl)})):(i=p.children[0],u.element.classList.contains("e-vertical")||!u.isMenu?ye(E.getInstance(i,fe),i):ye(E.getInstance(i,ee),i),p.style.overflow="",p.appendChild(u.element),u.getPopups().forEach(function(e){i=e.children[0],ye(E.getInstance(i,fe),i),e.style.overflow=""}));break;case"items":var s,n,r=void 0;if(u.isReact&&u.template&&u.clearTemplate(["template"]),Object.keys(h.items).length)for(var o=Object.keys(d.items),l=0;l<o.length;l++)(r=u.getChangedItemIndex(d,[],Number(o[l]))).length<=u.getWrapper().children.length&&(s=r.pop(),n=u.getItems(r),u.insertAfter([n[s]],n[s].text),u.removeItem(n,r,s),u.setItems(n,r)),r.length=0;else{if(u.updateItem(u.element,u.items),u.enableScrolling&&u.element.parentElement.classList.contains("e-custom-scroll")&&(u.element.classList.contains("e-vertical")?ge(u.createElement,p,u.element,"vscroll",u.enableRtl):ge(u.createElement,p,u.element,"hscroll",u.enableRtl)),!u.hamburgerMode)for(var l=1,a=p.childElementCount;l<a;l++)E.detach(p.lastElementChild);u.navIdx=[]}}}(t[e])},s.prototype.updateItem=function(t,e){var i;E.isBlazor()&&!this.isMenu?t=this.removeChildElement(t):(this.enableScrolling&&(i=this.getWrapper().children[0],this.element.classList.contains("e-vertical")?ye(E.getInstance(i,fe),i):ye(E.getInstance(i,ee),i)),t.innerHTML=""),[].slice.call(this.createItems(e).children).forEach(function(e){t.appendChild(e)})},s.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();return"items"===s?(e=e.items[i],(i=Object.keys(e.items).pop())&&this.getChangedItemIndex(e,t,Number(i))):"isParentArray"===s&&1<t.length&&t.pop(),t},s.prototype.removeItem=function(e,t,i){e.splice(i,1);e=this.getWrapper().children;t.length<e.length&&E.detach(e[t.length].children[i])},s.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var t=this.getWrapper();if(e){for(var i,s=void 0,n=E.selectAll(e),r=0,o=n.length;r<o;r++)i=n[r],this.isMenu?E.EventHandler.remove(i,"click",this.menuHeaderClickHandler):E.Browser.isIos?(s=E.getInstance(i,E.Touch))&&s.destroy():E.EventHandler.remove(i,"contextmenu",this.cmenuHandler);if(!this.isMenu){E.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var l=0,a=g.getScrollableParent(this.targetElement);l<a.length;l++){var d=a[l];E.EventHandler.remove(d,"scroll",this.scrollHandler)}}}E.Browser.isDevice||(E.EventHandler.remove(this.isMenu?document:t,"mouseover",this.delegateMoverHandler),E.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),E.EventHandler.remove(document,"keydown",this.domKeyHandler),this.isMenu)||this.target||E.EventHandler.remove(document,"scroll",this.scrollHandler),E.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(t),this.rippleFn()},s.prototype.unWireKeyboardEvent=function(e){e=E.getInstance(e,E.KeyboardEvents);e&&e.destroy()},s.prototype.toggleAnimation=function(e,t){var i,s,n=this,r=(void 0===t&&(t=!0),this.enableScrolling&&!this.isMenu&&E.closest(e,".e-menu-vscroll")?E.closest(e,".e-menu-vscroll"):e);"None"!==this.animationSettings.effect&&t?this.animation.animate(r,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){n.hamburgerMode?(s=e.element.parentElement,e.element.style.position="absolute",s&&(i=s.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",s&&(s.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=n.isMenu?e.element.getBoundingClientRect().height+"px":e.element.scrollHeight+"px")},progress:function(e){n.hamburgerMode&&s&&(s.style.minHeight=i+e.element.offsetHeight+"px")},end:function(e){n.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",s&&(s.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),n.triggerOpen(e.element.children[0])):n.end(e.element,t)}}):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,t))},s.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,t={element:e,parentItem:t,items:(t||this).items};this.trigger("onOpen",t),this.isMenu||E.EventHandler.add(e,"keydown",this.keyHandler,this)},s.prototype.end=function(e,t){var i;t&&this.isContextMenuClosed?((this.isMenu||!E.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&E.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(i=this.enableScrolling&&!this.isMenu?E.closest(e,".e-menu-vscroll"):null)&&(i.style.display="block"),this.triggerOpen(e),e.querySelector("."+v)?e.querySelector("."+v).focus():(t=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1],this.currentTarget&&(this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName)||(t?t.querySelector("."+y):this.element).focus())):((i=this.enableScrolling&&!this.isMenu?E.closest(e,".e-menu-vscroll"):null)&&ye(E.getInstance(i,fe),i),e===this.element?((t=this.getLIByClass(this.element,v))&&t.classList.remove(v),(i=this.getLIByClass(this.element,y))&&i.classList.remove(y),e.style.display="none",this.isAnimationNone=!1):E.detach(e))},s.prototype.getPersistData=function(){return""},s.prototype.getWrapper=function(){return E.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},s.prototype.getIndex=function(e,t,i,s,n,r){void 0===s&&(s=[]),void 0===r&&(r=0),r=(n=void 0===n?!1:n)?r+1:0;for(var o=0,l=(i=void 0===i?this.items:i).length;o<l;o++){var a=i[o],d=t?a[this.getField("itemId",r)]:a[this.getField("text",r)];if((a.htmlAttributes&&"id"in a.htmlAttributes?a.htmlAttributes.id:d)===e){s.push(o);break}if(a[this.getField("children",r)]&&a[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,a[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(o);break}o!==l-1&&s.pop()}else o===l-1&&s.push(-1)}return n||-1!==s[0]?s:[]},s.prototype.enableItems=function(e,t,i){void 0===t&&(t=!0);for(var s,n,r,o=Me,l=0;l<e.length;l++){if(r=this.getIndex(e[l],i),this.navIdx.length){if(1!==r.length){for(var a=!1,d=0,h=r.length-1;d<h;d++)if(r[d]!==this.navIdx[d]){a=!0;break}if(a)continue}}else if(1!==r.length)continue;n=r.pop(),(s=this.getUlByNavIdx(r.length))&&!E.isNullOrUndefined(n)&&(t?this.isMenu?(s.children[n].classList.remove(o),s.children[n].removeAttribute("aria-disabled")):(E.Browser.isDevice&&!s.classList.contains("e-contextmenu")?s.children[n+1]:s.children[n]).classList.remove(o):this.isMenu?(s.children[n].classList.add(o),s.children[n].setAttribute("aria-disabled","true")):(E.Browser.isDevice&&!s.classList.contains("e-contextmenu")?s.children[n+1]:s.children[n]).classList.add(o))}},s.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},s.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},s.prototype.showHideItems=function(e,t,i){for(var s=0;s<e.length;s++){var n=(o=this.getIndex(e[s],i)).pop(),r=this.getUlByNavIdx(o.length),o=this.getItems(o);r&&(o=i?r.children[n].id:o[n].text.toString(),t&&o===e[s]?r.children[n].classList.add(He):t||o!==e[s]||r.children[n].classList.remove(He))}},s.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),E.isNullOrUndefined(i)||this.removeItem(n,s,i)},s.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},s.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},s.prototype.insertItems=function(e,t,i,s){var n;void 0===s&&(s=!0);for(var r=0;r<e.length;r++){o=(n=this.getIndex(t,i)).pop(),l=this.getItems(n),(a=new We(l[0],"items",e[r],!0)).parentObj=l[0].parentObj,l.splice(s?o+1:o,0,a);var o,l,a=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);!E.isNullOrUndefined(o)&&n.length<a.length&&(o=s?o+1:o,l=this.createItems(l).children[o],(a=this.isMenu?E.select(".e-menu-parent",a[n.length]):a[n.length]).insertBefore(l,a.children[o]),r!==e.length-1||this.isMenu||"block"!==a.style.display||(this.setPosition(null,a,parseFloat(a.style.top),parseFloat(a.style.left)),a.style.display="block"))}},s.prototype.removeAttributes=function(){var t=this;["top","left","display","z-index"].forEach(function(e){t.element.style.removeProperty(e)}),["role","tabindex","class","style"].forEach(function(e){"class"===e&&t.element.classList.contains("e-menu-parent")&&t.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(e)&&t.element.getAttribute(e)||t.element.removeAttribute(e),t.isMenu&&"class"===e&&t.element.classList.contains("e-vertical")&&t.element.classList.remove("e-vertical")})},s.prototype.destroy=function(){var e,t=this.getWrapper();t&&(this.unWireEvents(),this.isMenu?(this.closeMenu(),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),t.parentNode.insertBefore(this.element,t)):(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName?(E.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement):(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)&&((e=this.clonedElement.nextElementSibling)&&e!==t?this.clonedElement.parentElement.insertBefore(this.element,e):this.clonedElement.parentElement.appendChild(this.element),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",E.append([].slice.call(this.clonedElement.children),this.element),E.detach(this.clonedElement),this.removeAttributes()))),this.clonedElement=null,E.detach(t),Xe.prototype.destroy.call(this),this.template)&&this.clearTemplate(["template"]),this.rippleFn=null},e([E.Event()],s.prototype,"beforeItemRender",void 0),e([E.Event()],s.prototype,"beforeOpen",void 0),e([E.Event()],s.prototype,"onOpen",void 0),e([E.Event()],s.prototype,"beforeClose",void 0),e([E.Event()],s.prototype,"onClose",void 0),e([E.Event()],s.prototype,"select",void 0),e([E.Event()],s.prototype,"created",void 0),e([E.Property("")],s.prototype,"cssClass",void 0),e([E.Property(0)],s.prototype,"hoverDelay",void 0),e([E.Property(!1)],s.prototype,"showItemOnClick",void 0),e([E.Property("")],s.prototype,"target",void 0),e([E.Property("")],s.prototype,"filter",void 0),e([E.Property(null)],s.prototype,"template",void 0),e([E.Property(!1)],s.prototype,"enableScrolling",void 0),e([E.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),e([E.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],s.prototype,"fields",void 0),e([E.Collection([],We)],s.prototype,"items",void 0),e([E.Complex({duration:400,easing:"ease",effect:"SlideDown"},ze)],s.prototype,"animationSettings",void 0);var Xe,F=e([E.NotifyPropertyChanges],s);function s(e,t){e=Xe.call(this,e,t)||this;return e.navIdx=[],e.animation=new E.Animation({}),e.isTapHold=!1,e.tempItem=[],e.showSubMenuOn="Auto",e.isAnimationNone=!1,e}Ye=function(e,t){return(Ye=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ye,Ge,e=function(e,t){function i(){this.constructor=e}Ye(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Qe="e-vertical",m="e-toolbar-items",b="e-toolbar-item",Je="e-rtl",C="e-separator",Ze="e-popup-up-icon",$e="e-popup-down-icon",et="e-popup-open",tt="e-template",it="e-overlay",st="e-toolbar-text",nt="e-popup-text",rt="e-overflow-show",ot="e-overflow-hide",lt="e-hor-nav",at="e-scroll-nav",dt="e-toolbar-center",ht="e-tbar-pos",ct="e-hscroll-bar",pt="e-toolbar-pop",ut="e-toolbar-popup",mt="e-nav-active",ft="e-ignore",gt="e-popup-alone",vt="e-hidden",yt="e-toolbar-multirow",bt="e-multirow-pos",Ct="e-multirow-separator",St="e-extended-separator",It="e-extended-toolbar",Et="e-toolbar-extended",xt="e-tbar-extended",Nt=(Ge=E.ChildProperty,e(Ot,Ge),n([E.Property("")],Ot.prototype,"id",void 0),n([E.Property("")],Ot.prototype,"text",void 0),n([E.Property("auto")],Ot.prototype,"width",void 0),n([E.Property("")],Ot.prototype,"cssClass",void 0),n([E.Property(!1)],Ot.prototype,"showAlwaysInPopup",void 0),n([E.Property(!1)],Ot.prototype,"disabled",void 0),n([E.Property("")],Ot.prototype,"prefixIcon",void 0),n([E.Property("")],Ot.prototype,"suffixIcon",void 0),n([E.Property(!0)],Ot.prototype,"visible",void 0),n([E.Property("None")],Ot.prototype,"overflow",void 0),n([E.Property("")],Ot.prototype,"template",void 0),n([E.Property("Button")],Ot.prototype,"type",void 0),n([E.Property("Both")],Ot.prototype,"showTextOn",void 0),n([E.Property(null)],Ot.prototype,"htmlAttributes",void 0),n([E.Property("")],Ot.prototype,"tooltipText",void 0),n([E.Property("Left")],Ot.prototype,"align",void 0),n([E.Event()],Ot.prototype,"click",void 0),n([E.Property(-1)],Ot.prototype,"tabIndex",void 0),Ot);function Ot(){return null!==Ge&&Ge.apply(this,arguments)||this}wt=E.Component,e(r,wt),r.prototype.destroy=function(){var t=this,e=((this.isReact||this.isAngular)&&this.clearTemplate(),this.element.querySelectorAll(".e-control.e-btn"));for([].slice.call(e).forEach(function(e){E.isNullOrUndefined(e)||E.isNullOrUndefined(e.ej2_instances)||E.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){E.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),E.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&E.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return t.element.removeAttribute(e)}),wt.prototype.destroy.call(this)},r.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(Qe),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,Je)},r.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},r.prototype.wireKeyboardEvent=function(){this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),E.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},r.prototype.updateTabIndex=function(e){var t,i=this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )");E.isNullOrUndefined(i)||E.isNullOrUndefined(i.firstElementChild)||(t=i.firstElementChild.getAttribute("data-tabindex"))&&"-1"===t&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)},r.prototype.unwireKeyboardEvent=function(){this.keyModule&&(E.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},r.prototype.docKeyDown=function(e){var t;"INPUT"!==e.target.tagName&&(t=!E.isNullOrUndefined(this.popObj)&&E.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode,9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),40!==e.keyCode&&38!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||e.preventDefault())},r.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},r.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},r.prototype.docEvent=function(e){e=E.closest(e.target,".e-popup");this.popObj&&E.isVisible(this.popObj.element)&&!e&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},r.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ht),this.scrollModule.destroy(),this.scrollModule=null)},r.prototype.destroyItems=function(){var e;this.element&&[].slice.call(this.element.querySelectorAll("."+b)).forEach(function(e){E.detach(e)}),this.tbarAlign&&(e=this.element.querySelector("."+m),[].slice.call(e.children).forEach(function(e){E.detach(e)}),this.tbarAlign=!1,this.remove(e,ht)),this.clearProperty()},r.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,Je),this.destroyScroll()),this.remove(this.element,xt),this.remove(this.element,It);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,yt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},r.prototype.add=function(e,t){e.classList.add(t)},r.prototype.remove=function(e,t){e.classList.remove(t)},r.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},r.prototype.clstElement=function(e,t){e=e&&this.popObj&&E.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+b):this.element===t||e?this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )"):E.closest(t,"."+b);return e},r.prototype.keyHandling=function(e,t,i,s,n){var r,o,l,a,d=this.popObj,h=this.element,c={name:"FadeOut",duration:100},p="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":this.isVertical||(h===i?this.elementFocus(e):s||this.eleFocus(e,"next"));break;case"moveLeft":this.isVertical||s||this.eleFocus(e,"previous");break;case"home":case"end":e&&(l=E.closest(e,".e-popup"),o=this.element.querySelector("."+Et),(l="Extended"===this.overflowMode&&o&&o.classList.contains("e-popup-open")?"end"===t.action?o:null:l)?E.isVisible(this.popObj.element)&&(a=[].slice.call(l.children),r="home"===t.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)):(a=this.element.querySelectorAll("."+m+" ."+b+":not(."+C+")"),r="home"===t.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)),r)&&this.elementFocus(r);break;case"moveUp":case"moveDown":this.isVertical?"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next"):d&&E.closest(i,".e-popup")?(l=(o=d.element).firstElementChild,"previous"==p&&l===e?o.lastElementChild.firstChild.focus():"next"==p&&o.lastElementChild===e?l.firstChild.focus():this.eleFocus(e,p)):"moveDown"===t.action&&d&&E.isVisible(d.element)&&this.elementFocus(e);break;case"tab":n||s||(a=e.firstElementChild,h===i&&(this.activeEle||(this.activeEleRemove(a),a)).focus());break;case"popupClose":d&&"Extended"!==this.overflowMode&&d.hide(c);break;case"popupOpen":s&&(d&&!E.isVisible(d.element)?(d.element.style.top=h.offsetHeight+"px",d.show({name:"FadeIn",duration:100})):d.hide(c))}},r.prototype.keyActionHandler=function(e){var t,i,s,n=e.target;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!this.element.classList.contains(it)&&(e.preventDefault(),t=n.classList.contains(lt),i=n.classList.contains(at),(s=this.clstElement(t,n))||i)&&this.keyHandling(s,e,n,t,i)},r.prototype.disable=function(e){var t=this.element;e?t.classList.add(it):t.classList.remove(it),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(E.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},r.prototype.eleContains=function(e){return e.classList.contains(C)||e.classList.contains(it)||e.getAttribute("disabled")||e.classList.contains(vt)||!E.isVisible(e)||!e.classList.contains(b)},r.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(vt)&&!i.classList.contains(it))return i;t++}},r.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;0<=t;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(vt)&&!i.classList.contains(it))return i;t--}},r.prototype.eleFocus=function(e,t){var i,s=Object(e)[t+"ElementSibling"];s?this.eleContains(s)?this.eleFocus(s,t):this.elementFocus(s):this.tbarAlign?(s=Object(e.parentElement)[t+"ElementSibling"],E.isNullOrUndefined(s)||0!==s.children.length||(s=Object(s)[t+"ElementSibling"]),!E.isNullOrUndefined(s)&&0<s.children.length&&("next"===t?(i=s.querySelector("."+b),this.eleContains(i)?this.eleFocus(i,t):(i.firstElementChild.focus(),this.activeEleSwitch(i))):(i=s.lastElementChild,this.eleContains(i)?this.eleFocus(i,t):this.elementFocus(i)))):E.isNullOrUndefined(e)||(s=this.element.querySelectorAll("."+m+" ."+b+":not(."+C+"):not(."+it+"):not(."+vt+")"),"next"===t&&s?this.elementFocus(s[0]):"previous"===t&&s&&this.elementFocus(s[s.length-1]))},r.prototype.clickHandler=function(e){var t,i=this,s=e.target,n=this.element,r=!E.isNullOrUndefined(E.closest(s,"."+pt)),o=s.classList,l=(l=E.closest(s,"."+lt))||s,s=(((o=n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!o.contains(lt)?o:s.querySelector(".e-icons").classList).contains(Ze)||o.contains($e))&&this.popupClickHandler(n,l,Je),E.closest(e.target,"."+b));(E.isNullOrUndefined(s)||s.classList.contains(it))&&!l.classList.contains(lt)||(o={originalEvent:e,item:t=s?this.items[this.tbarEle.indexOf(s)]:t},(t&&!E.isNullOrUndefined(t.click)&&"object"==typeof t.click?!E.isNullOrUndefined(t.click.observers)&&0<t.click.observers.length:!E.isNullOrUndefined(t)&&!E.isNullOrUndefined(t.click))&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",o),o.cancel)||this.trigger("clicked",o,function(e){!E.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})},r.prototype.popupClickHandler=function(e,t,i){var s=this.popObj;E.isVisible(s.element)?(t.classList.remove(mt),s.hide({name:"FadeOut",duration:100})):(e.classList.contains(i)&&(s.enableRtl=!0,s.position={X:"left",Y:"top"}),0!==s.offsetX||e.classList.contains(i)||(s.enableRtl=!1,s.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(s.element.style.minHeight="0px",s.width=this.getToolbarPopupWidth(this.element)),s.dataBind(),s.refreshPosition(),s.element.style.top=this.getElementOffsetY()+"px",t.classList.add(mt),s.show({name:"FadeIn",duration:100}))},r.prototype.getToolbarPopupWidth=function(e){e=window.getComputedStyle(e);return parseFloat(e.width)+2*parseFloat(e.borderRightWidth)},r.prototype.render=function(){var e=this;this.initialize(),this.renderControl(),this.wireEvents(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderComplete(),this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow()})},r.prototype.initialize=function(){var e=E.formatUnit(this.width),t=E.formatUnit(this.height),t=("msie"===E.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||E.setStyleAttribute(this.element,{height:t}),E.setStyleAttribute(this.element,{width:e}),{role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"});E.attributes(this.element,t),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},r.prototype.renderControl=function(){var e=this.element;this.trgtEle=0<e.children.length?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},r.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&1<this.popObj.element.childElementCount&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},r.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),((s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s):t).appendChild(i);this.isReact&&(this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates())},r.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(Qe),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(Qe),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),E.setStyleAttribute(this.element,{height:E.formatUnit(this.height),width:E.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},r.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+m+" ."+dt).removeAttribute("style"),this.isVertical?this.scrollModule=new fe({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new ee({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&E.addClass([t[0]],this.cssClass.split(" ")),(e=this.scrollModule.element.querySelector("."+ct+", .e-vscroll-bar"))&&e.removeAttribute("tabindex"),this.remove(this.scrollModule.element,ht),E.setStyleAttribute(this.element,{overflow:"hidden"}))},r.prototype.itemWidthCal=function(e){var t,i=this,s=0;return[].slice.call(E.selectAll("."+b,e)).forEach(function(e){E.isVisible(e)&&(t=window.getComputedStyle(e),s=(s=(s+=i.isVertical?e.offsetHeight:e.offsetWidth)+parseFloat(i.isVertical?t.marginTop:t.marginRight))+parseFloat(i.isVertical?t.marginBottom:t.marginLeft))}),s},r.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},r.prototype.checkOverflow=function(e,t){var i,s,n;return!(E.isNullOrUndefined(e)||E.isNullOrUndefined(t)||!E.isVisible(e))&&(i=this.isVertical?e.offsetHeight:e.offsetWidth,s=this.isVertical?t.offsetHeight:t.offsetWidth,(this.tbarAlign||this.scrollModule||i===s)&&(s=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t)),t=e.querySelector("."+lt),e=e.querySelector("."+at),n=0,t?n=this.isVertical?t.offsetHeight:t.offsetWidth:e&&(n=this.isVertical?2*e.offsetHeight:2*e.offsetWidth),i-n<s)},r.prototype.refreshOverflow=function(){this.resize()},r.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ht),this.itemPositioning())},r.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+m),i=0<this.popupPriCount;if(e&&0<e.children.length)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===E.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":E.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(m)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||i)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,yt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,bt)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==E.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,It),(this.checkOverflow(e,t)||i)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},r.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(E.selectAll("."+m+" ."+b,e)));E.attributes(this.element.querySelector("."+lt),{tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"})},r.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+C)),i=e.querySelector("."+Ct),e=e.querySelector("."+St),i="MultiRow"===this.overflowMode?i:e;null!==i&&("MultiRow"===this.overflowMode?i.classList.remove(Ct):"Extended"===this.overflowMode&&i.classList.remove(St));for(var s=0;s<=t.length-1;s++)t[parseInt(s.toString(),10)].offsetLeft<30&&0!==t[parseInt(s.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(s.toString(),10)].classList.add(Ct):"Extended"===this.overflowMode&&t[parseInt(s.toString(),10)].classList.add(St))},r.prototype.createPopupEle=function(e,t){var i=e.querySelector("."+lt),s=this.isVertical,i=(i||this.createPopupIcon(e),i=e.querySelector("."+lt),s?i.offsetHeight:i.offsetWidth),s=(s?e.offsetHeight:e.offsetWidth)-i;this.element.classList.remove("e-rtl"),E.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,t,s,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},r.prototype.pushingPoppedEle=function(i,s,n,r,o){for(var l,e=i.element,t=[].slice.call(E.selectAll("."+ut,e.querySelector("."+m))),a=(E.selectAll("."+rt,n),0),d=0,h=(t.forEach(function(e,t){l=E.selectAll("."+rt,n),e.classList.contains(rt)&&0<l.length?(i.tbResize&&l.length>t?n.insertBefore(e,l[parseInt(t.toString(),10)]):n.insertBefore(e,n.children[l.length]),++d):e.classList.contains(rt)||i.tbResize&&e.classList.contains(ot)&&0<n.children.length&&0===l.length?(n.insertBefore(e,n.firstChild),++d):e.classList.contains(ot)?s.push(e):i.tbResize?(n.insertBefore(e,n.childNodes[a+d]),++a):n.appendChild(e),e.classList.contains(C)?E.setStyleAttribute(e,{display:"",height:o+"px"}):E.setStyleAttribute(e,{display:"",height:r+"px"})}),s.forEach(function(e){n.appendChild(e)}),E.selectAll("."+b,e.querySelector("."+m))),c=h.length-1;0<=c;c--){var p=h[parseInt(c.toString(),10)];if(!p.classList.contains(C)||"Extended"===this.overflowMode)break;E.setStyleAttribute(p,{display:"none"})}},r.prototype.createPopup=function(){var e,t,i,s=this.element,n=("Extended"===this.overflowMode&&(e=s.querySelector("."+C),e="auto"===s.style.height||""===s.style.height?null:e&&e.offsetHeight),s.querySelector("."+b+":not(."+C+"):not(."+ut+")")),n="auto"===s.style.height||""===s.style.height?null:n&&n.offsetHeight;i=E.select("#"+s.id+"_popup."+pt,s)?E.select("#"+s.id+"_popup."+pt,s):(i=this.createElement("div",{id:s.id+"_popup",className:pt+" "+Et}),t=this.createElement("div",{id:s.id+"_popup",className:pt}),"Extended"===this.overflowMode?i:t),this.pushingPoppedEle(this,[],i,n,e),this.popupInit(s,i)},r.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},r.prototype.popupInit=function(e,t){var i;this.popObj?"Extended"!==this.overflowMode&&(i=this.popObj.element,E.setStyleAttribute(i,{maxHeight:"",display:"block"}),E.setStyleAttribute(i,{maxHeight:i.offsetHeight+"px",display:""})):(e.appendChild(t),this.cssClass&&E.addClass([t],this.cssClass.split(" ")),E.setStyleAttribute(this.element,{overflow:""}),i=new g.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"}}),"Extended"===this.overflowMode&&(i.width=this.getToolbarPopupWidth(this.element),i.offsetX=0),i.appendTo(t),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(i.element.style.maxHeight=i.element.offsetHeight+"px"),this.isVertical&&(i.element.style.visibility="hidden"),this.isExtendedOpen?((e=this.element.querySelector("."+lt)).classList.add(mt),E.classList(e.firstElementChild,[Ze],[$e]),this.element.querySelector("."+Et).classList.add(et)):i.hide(),this.popObj=i)},r.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,xt):this.remove(this.element,xt))},r.prototype.popupOpen=function(e){var t=this.popObj,i=(this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind()),this.popObj.element),s=this.popObj.element.parentElement,n=s.querySelector("."+lt),r=(n.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?t.element.style.minHeight="":(E.setStyleAttribute(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px"),i.offsetTop+i.offsetHeight+g.calculatePosition(s).top),o=n.firstElementChild,n=(n.classList.add(mt),E.classList(o,[Ze],[$e]),this.tbarPopupHandler(!0),E.isNullOrUndefined(window.scrollY)?0:window.scrollY);if(!this.isVertical&&window.innerHeight+n<r&&this.element.offsetTop<i.offsetHeight){var l=i.offsetHeight-(r-window.innerHeight-n+5);t.height=l+"px";for(var a=0;a<=i.childElementCount;a++){var d=i.children[parseInt(a.toString(),10)];if(d.offsetTop+d.offsetHeight>l){l=d.offsetTop;break}}"Extended"!==this.overflowMode&&E.setStyleAttribute(t.element,{maxHeight:l+"px"})}else this.isVertical&&"Extended"!==this.overflowMode&&(o=this.element.getBoundingClientRect(),E.setStyleAttribute(t.element,{maxHeight:o.top+this.element.offsetHeight+"px",bottom:0,visibility:""}));t&&((r=i.getBoundingClientRect()).right>document.documentElement.clientWidth&&r.width>s.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition())},r.prototype.popupClose=function(e){var t=this.element.querySelector("."+lt),i=(t.setAttribute("aria-expanded","false"),t.firstElementChild);t.classList.remove(mt),E.classList(i,[$e],[Ze]),this.tbarPopupHandler(!1)},r.prototype.checkPriority=function(e,t,i,s){for(var n,r,o=0<this.popupPriCount,l=i,a=0,d=0,h=0,c=function(t,e){var i=!1;return e.forEach(function(e){t.classList.contains(e)&&(i=!0)}),i},p=t.length-1;0<=p;p--){var u,m=void 0,f=window.getComputedStyle(t[parseInt(p.toString(),10)]),f=(this.isVertical?(m=parseFloat(f.marginTop),m+=parseFloat(f.marginBottom)):(m=parseFloat(f.marginRight),m+=parseFloat(f.marginLeft)),t[parseInt(p.toString(),10)]===this.tbarEle[0]),f=(f&&(this.tbarEleMrgn=m),n=this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth,f?n+m:n);c(t[parseInt(p.toString(),10)],[gt])&&o&&(t[parseInt(p.toString(),10)].classList.add(ut),this.isVertical?E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++),(this.isVertical?t[parseInt(p.toString(),10)].offsetTop+t[parseInt(p.toString(),10)].offsetHeight+m>i:t[parseInt(p.toString(),10)].offsetLeft+t[parseInt(p.toString(),10)].offsetWidth+m>i)&&(t[parseInt(p.toString(),10)].classList.contains(C)?"Extended"===this.overflowMode?(c(u=t[parseInt(p.toString(),10)],[C,ft])&&(t[parseInt(p.toString(),10)].classList.add(ut),h++),d++):"Popup"===this.overflowMode&&(0<a&&d===h&&c(u=t[p+d+(a-1)],[C,ft])&&E.setStyleAttribute(u,{display:"none"}),a++,h=d=0):d++,t[parseInt(p.toString(),10)].classList.contains(rt)&&s||c(t[parseInt(p.toString(),10)],[C,ft])?i-=(this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth)+m:(t[parseInt(p.toString(),10)].classList.add(ut),this.isVertical?E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++))}s&&(r=E.selectAll("."+b+":not(."+ut+")",this.element),this.checkPriority(e,r,l,!1))},r.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-hor-nav"),i="Extended"===this.overflowMode?i+" e-expended-nav":i,t=this.createElement("div",{id:t,className:i}),i=("msie"!==E.Browser.info.name&&"edge"!==E.Browser.info.name||t.classList.add("e-ie-align"),this.createElement("div",{className:$e+" e-icons"}));t.appendChild(i),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.appendChild(t)},r.prototype.tbarPriRef=function(e,t,i,s,n,r,o,l,a){function d(e,t){return e.classList.contains(t)}var h,c,p,u=this.popObj.element,u=E.selectAll("."+ut+":not(."+rt+")",u).length;0===E.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length?(h=e.children[t-(t-i)-1],c=!E.isNullOrUndefined(h)&&d(h,ft),!E.isNullOrUndefined(h)&&d(h,C)&&!E.isVisible(h)||c?(h.style.display="unset",c=h.offsetWidth+2*parseFloat(window.getComputedStyle(h).marginRight),p=h.previousElementSibling,r+c<o||n?(e.insertBefore(s,e.children[t+l-(t-i)]),E.isNullOrUndefined(p)||(p.style.display="")):(E.setStyleAttribute(s,a),p.classList.contains(C)&&(p.style.display="none")),h.style.display=""):e.insertBefore(s,e.children[t+l-(t-i)])):e.insertBefore(s,e.children[t+l-u])},r.prototype.popupRefresh=function(e,t){var i,s=this,n=this.element,r=this.isVertical,o=n.querySelector("."+m),l=n.querySelector("."+lt);E.isNullOrUndefined(l)||(o.removeAttribute("style"),e.style.display="block",n=r?n.offsetHeight-(l.offsetHeight+o.offsetHeight):n.offsetWidth-(l.offsetWidth+o.offsetWidth),i=0,[].slice.call(e.children).forEach(function(e){i+=s.popupEleWidth(e),E.setStyleAttribute(e,{position:""})}),n+(r?l.offsetHeight:l.offsetWidth)>i&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(n,e,t),e.style.display="",0===e.children.length&&l&&this.popObj&&(E.detach(l),this.popObj.destroy(),E.detach(this.popObj.element),this.popObj=null))},r.prototype.ignoreEleFetch=function(t,i){var e=[].slice.call(i.querySelectorAll("."+ft)),s=[],n=0;return 0<e.length?(e.forEach(function(e){s.push([].slice.call(i.children).indexOf(e))}),s.forEach(function(e){e<=t&&n++}),n):0},r.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild),s=(t.firstElementChild.style.removeProperty("Position"),e.offsetWidth-e.querySelector("."+lt).offsetWidth),e=e.querySelector("."+m).offsetWidth;return t.style.removeProperty("display"),i+e<s},r.prototype.popupEleWidth=function(e){e.style.position="absolute";var t,i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");return(e.classList.contains("e-tbtn-align")||e.classList.contains(nt))&&(t=e.children[0],!E.isNullOrUndefined(s)&&e.classList.contains(nt)?s.style.display="none":!E.isNullOrUndefined(s)&&e.classList.contains(st)&&(s.style.display="block"),t.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),t.style.minWidth="",t.style.minHeight="",E.isNullOrUndefined(s)||(s.style.display="")),i},r.prototype.popupEleRefresh=function(r,e,o){for(var l,a,d=0<this.popupPriCount,h=this.tbarEle,c=this.element.querySelector("."+m),p=0,u=this,t=0,i=[].slice.call(e.children);t<i.length&&"break"!==function(e){var t,i,s,n;return e.classList.contains(gt)&&d&&!o?"continue":(t=u.popupEleWidth(e),e===u.tbarEle[0]&&(t+=u.tbarEleMrgn),e.style.position="",t<r||o?(i={minWidth:e.style.minWidth,height:e.style.height,minHeight:e.style.minHeight},E.setStyleAttribute(e,{minWidth:"",height:"",minHeight:""}),e.classList.contains(ot)||e.classList.remove(ut),a=u.tbarEle.indexOf(e),u.tbarAlign&&(s=u.items[parseInt(a.toString(),10)].align,a=u.tbarAlgEle[(s+"s").toLowerCase()].indexOf(e),h=u.tbarAlgEle[(s+"s").toLowerCase()],c=u.element.querySelector("."+m+" .e-toolbar-"+s.toLowerCase())),n=0,"Extended"!==u.overflowMode&&h.slice(0,a).forEach(function(e){(e.classList.contains(rt)||e.classList.contains(C))&&(e.classList.contains(C)&&(e.style.display="",r-=e.offsetWidth),n++)}),p=u.ignoreEleFetch(a,c),e.classList.contains(rt)?u.tbarPriRef(c,a,n,e,o,t,r,p,i):0===a?c.insertBefore(e,c.firstChild):(l=E.selectAll("."+rt,u.popObj.element).length,c.insertBefore(e,c.children[a+p-l])),r-=e.offsetWidth,void(e.style.height="")):"break")}(i[t]);t++);this.checkOverflow(this.element,this.element.getElementsByClassName(m)[0])&&!o&&this.renderOverflowMode()},r.prototype.removePositioning=function(){var e=this.element.querySelector("."+m);!E.isNullOrUndefined(e)&&e.classList.contains(ht)&&(this.remove(e,ht),(e=[].slice.call(e.childNodes))[1].removeAttribute("style"),e[2].removeAttribute("style"))},r.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+m);this.add(e,ht),this.itemPositioning()},r.prototype.itemPositioning=function(){var e,t,i,s=this.element.querySelector("."+m);E.isNullOrUndefined(s)||!s.classList.contains(ht)||(t=this.element.querySelector("."+lt),e=this.scrollModule?(e=this.isVertical?"e-vscroll-content":"e-hscroll-content",[].slice.call(s.querySelector("."+e).children)):[].slice.call(s.childNodes),s=this.isVertical?e[0].offsetHeight+e[2].offsetHeight:e[0].offsetWidth+e[2].offsetWidth,i=this.isVertical?this.element.offsetHeight:this.element.offsetWidth,t&&(i-=this.isVertical?t.offsetHeight:t.offsetWidth,t=(this.isVertical?t.offsetHeight:t.offsetWidth)+"px",e[2].removeAttribute("style"),this.isVertical?this.enableRtl?e[2].style.top=t:e[2].style.bottom=t:this.enableRtl?e[2].style.left=t:e[2].style.right=t),i<=s)||(t=(i-s-(this.isVertical?e[1].offsetHeight:e[1].offsetWidth))/2,e[1].removeAttribute("style"),i=(this.isVertical?e[0].offsetHeight:e[0].offsetWidth)+t+"px",this.isVertical?this.enableRtl?e[1].style.marginBottom=i:e[1].style.marginTop=i:this.enableRtl?e[1].style.marginRight=i:e[1].style.marginLeft=i)},r.prototype.tbarItemAlign=function(e,t,i){var s,n,r=this;e.showAlwaysInPopup&&"Show"!==e.overflow||((s=[]).push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),s.push(this.createElement("div",{className:dt,attrs:{role:"group"}})),s.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align?(s.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ht)):"Left"!==e.align&&(i=t.childNodes,n=s[0],[].slice.call(i).forEach(function(e){r.tbarAlgEle.lefts.push(e),n.appendChild(e)}),t.appendChild(n),t.appendChild(s[1]),t.appendChild(s[2]),this.tbarAlign=!0,this.add(t,ht)))},r.prototype.ctrlTemplate=function(){var t=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,m),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(e){"DIV"===e.tagName&&(t.tbarEle.push(e),E.isNullOrUndefined(e.firstElementChild)||e.firstElementChild.setAttribute("aria-disabled","false"),t.add(e,b))})},r.prototype.renderItems=function(){var e,t=this.element,i=this.items;null!=this.trgtEle?this.ctrlTemplate():t&&0<i.length&&(e=void 0,e=(e=t&&0<t.children.length?t.querySelector("."+m):e)||this.createElement("div",{className:m}),this.itemsAlign(i,e),t.appendChild(e))},r.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},r.prototype.enableItems=function(e,t){function i(e,t){e?(t.classList.remove(it),E.isNullOrUndefined(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","false")):(t.classList.add(it),E.isNullOrUndefined(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","true"))}var s,n=e,r=n.length;E.isNullOrUndefined(t)&&(t=!0);if(!E.isNullOrUndefined(r)&&1<=r){for(var o=0,l=[].slice.call(n);o<r;o++){var a=l[parseInt(o.toString(),10)];if("number"==typeof a){if(s=this.getElementByIndex(a),E.isNullOrUndefined(s))return;n[parseInt(o.toString(),10)]=s}else s=a;i(t,s)}t?E.removeClass(n,it):E.addClass(n,it)}else{if("number"==typeof n){if(s=this.getElementByIndex(n),E.isNullOrUndefined(s))return}else s=e;i(t,s)}},r.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},r.prototype.addItems=function(e,t){this.extendedOpen();var i,s=this.element.querySelector("."+m);if(E.isNullOrUndefined(s))this.itemsRerender(e);else{var n,r="Left";E.isNullOrUndefined(t)&&(t=0),e.forEach(function(e){E.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var o=0,l=e;o<l.length;o++){var a,d,h=l[o];E.isNullOrUndefined(h.type)&&(h.type="Button"),i=E.selectAll("."+b,this.element),h.align=r,n=this.renderSubComponent(h,t),this.tbarEle.length>=t&&0<=i.length&&(E.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),a="L"===h.align[0]?0:"C"===h.align[0]?1:2,d=void 0,this.tbarAlign||"Left"===r?this.tbarAlign?((d=E.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).insertBefore(n,d.children[parseInt(t.toString(),10)]),this.tbarAlgEle[(h.align+"s").toLowerCase()].splice(t,0,n),this.refreshPositioning()):0===i.length?(i=E.selectAll("."+m,this.element))[0].appendChild(n):i[0].parentNode.insertBefore(n,i[parseInt(t.toString(),10)]):(this.tbarItemAlign(h,s,1),this.tbarAlign=!0,(d=E.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).appendChild(n),this.tbarAlgEle[(h.align+"s").toLowerCase()].push(n),this.refreshPositioning()),this.items.splice(t,0,h),h.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,n),t++,this.offsetWid=s.offsetWidth)}s.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},r.prototype.removeItems=function(e){var t=e,i=[].slice.call(E.selectAll("."+b,this.element));if("number"==typeof t)o=parseInt(e.toString(),10),this.removeItemByIndex(o,i);else if(t&&1<t.length)for(var s=0,n=[].slice.call(t);s<n.length;s++){var r=n[s],o=this.tbarEle.indexOf(r);this.removeItemByIndex(o,i),i=E.selectAll("."+b,this.element)}else{r=t&&t.length&&1===t.length?t[0]:e;o=i.indexOf(r),this.removeItemByIndex(o,i)}this.resize()},r.prototype.removeItemByIndex=function(e,t){var i,s;this.tbarEle[parseInt(e.toString(),10)]&&t[parseInt(e.toString(),10)]&&(i=this.tbarEle.indexOf(t[parseInt(e.toString(),10)]),this.tbarAlign&&(s=this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(i.toString(),10)]),this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].splice(parseInt(s.toString(),10),1)),this.isReact&&this.clearToolbarTemplate(t[parseInt(e.toString(),10)]),s=t[parseInt(e.toString(),10)].querySelector(".e-control.e-btn"),E.isNullOrUndefined(s)||E.isNullOrUndefined(s.ej2_instances[0])||s.ej2_instances[0].isDestroyed||s.ej2_instances[0].destroy(),E.detach(t[parseInt(e.toString(),10)]),this.items.splice(i,1),this.tbarEle.splice(i,1))},r.prototype.templateRender=function(e,t,i,s){var n=i.type,r=e;if("object"==typeof e&&(a="function"==typeof r.appendTo),"string"!=typeof e&&a)"Input"===n&&(o=this.createElement("input"),i.id?o.id=i.id:o.id=E.getUniqueID("tbr-ipt"),t.appendChild(o),r.appendTo(o));else{var o,l,a=void 0,n=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i),i="string"==typeof e?e.trim():e;try{"object"!=typeof e||E.isNullOrUndefined(e.tagName)?"string"==typeof e&&n.test(i)?t.innerHTML=i:document.querySelectorAll(i).length?(l=(o=document.querySelector(i)).outerHTML.trim(),t.appendChild(o),o.style.display="",E.isNullOrUndefined(l)||this.tempId.push(i)):a=E.compile(i):t.appendChild(e)}catch(e){a=E.compile(i)}r=void 0;E.isNullOrUndefined(a)||(r=a({},this,"template",this.element.id+s+"_template",this.isStringTemplate,void 0,void 0,this.root)),!E.isNullOrUndefined(r)&&0<r.length&&[].slice.call(r).forEach(function(e){E.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)})}this.add(t,tt);n=t.firstElementChild;E.isNullOrUndefined(n)||(n.setAttribute("tabindex",E.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n)),n.setAttribute("data-tabindex",E.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n))),this.tbarEle.push(t)},r.prototype.buttonRendering=function(e,t){var i,s,n=this.createElement("button",{className:"e-tbar-btn"}),r=(n.setAttribute("type","button"),e.text),o=(e.id?n.id=e.id:n.id=E.getUniqueID("e-tbr-btn"),this.createElement("span",{className:"e-tbar-btn-text"})),r=(r?(o.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(r):r,n.appendChild(o),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(s=e.prefixIcon&&e.suffixIcon||e.prefixIcon?(i=e.prefixIcon+" e-icons","Left"):(i=e.suffixIcon+" e-icons","Right")),new R.Button({iconCss:i,iconPosition:s}));return r.createElement=this.createElement,r.appendTo(n),e.width&&E.setStyleAttribute(n,{width:E.formatUnit(e.width)}),n},r.prototype.renderSubComponent=function(e,t){var i,s=this.createElement("div",{className:b}),n=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!E.isNullOrUndefined(e.tooltipText)?E.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,s),e.tooltipText&&s.setAttribute("title",n.textContent),e.cssClass&&(s.className=s.className+" "+e.cssClass),e.template)this.templateRender(e.template,s,e,t);else switch(e.type){case"Button":(i=this.buttonRendering(e,s)).setAttribute("tabindex",E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("data-tabindex",E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("aria-label",e.text||e.tooltipText),i.setAttribute("aria-disabled","false"),s.appendChild(i),s.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(s,C)}return e.showTextOn&&("Toolbar"===(n=e.showTextOn)?(this.add(s,st),this.add(s,"e-tbtn-align")):"Overflow"===n&&this.add(s,nt)),e.overflow&&("Show"===(t=e.overflow)?this.add(s,rt):"Hide"!==t||s.classList.contains(C)||this.add(s,ot)),"Show"!==e.overflow&&e.showAlwaysInPopup&&!s.classList.contains(C)&&(this.add(s,gt),this.popupPriCount++),e.disabled&&this.add(s,it),!1===e.visible&&this.add(s,vt),s},r.prototype.getDataTabindex=function(e){return E.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},r.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},r.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},r.prototype.activeEleRemove=function(e){var t,i=this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )");E.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle)&&(E.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains(tt)?(!E.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")?(this.updateTabIndex("0"),t="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i),i.setAttribute("tabindex",t)):this.updateTabIndex("-1"),e.removeAttribute("tabindex")):(i=parseInt(this.getDataTabindex(this.activeEle),10)+1,this.activeEle.setAttribute("tabindex",i.toString())))},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.getModuleName=function(){return"toolbar"},r.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},r.prototype.resize=function(){var e,t=this.element,i=(this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide(),this.checkOverflow(t,t.getElementsByClassName(m)[0]));i||(this.destroyScroll(),e=t.querySelector("."+m),E.isNullOrUndefined(e))||(this.remove(e,bt),this.tbarAlign&&this.add(e,ht)),i&&this.scrollModule&&this.offsetWid===t.offsetWidth||((this.offsetWid>t.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign)&&this.refreshPositioning(),this.element.querySelector("."+ct)&&(this.scrollStep=this.element.querySelector("."+ct).offsetWidth),this.offsetWid=t.offsetWidth,this.tbResize=!1,this.separator())},r.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},r.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Et);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(et))},r.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var o=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===o?r.firstElementChild.setAttribute("tabindex","0"):o!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",o);break}r=n[++s]}},r.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var t=this.registeredTemplate,i=0;i<t.template.length;i++){var s=t.template[parseInt(i.toString(),10)].rootNodes[0],n=E.closest(s,"."+b);if(!E.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],[t.template[parseInt(i.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var r=this.portals,i=0;i<r.length;i++){var o=r[parseInt(i.toString(),10)],n=E.closest(o.containerInfo,"."+b);if(!E.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],i);break}}},r.prototype.onPropertyChanged=function(e,t){var i=this.element;this.extendedOpen();for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var r=Object.keys(e.items),o=0;o<r.length;o++){var l=parseInt(Object.keys(e.items)[parseInt(o.toString(),10)],10),a=Object.keys(e.items[parseInt(l.toString(),10)])[0],d=Object(e.items[parseInt(l.toString(),10)])[""+a];if(this.tbarAlign||"align"===a){this.refresh(),this.trigger("created");break}var h="overflow"===a&&0!==this.popupPriCount,a=(("showAlwaysInPopup"===a&&!d||this.items[parseInt(l.toString(),10)].showAlwaysInPopup&&h)&&--this.popupPriCount,E.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),[].slice.call(E.selectAll("."+m+" ."+b,i)));this.isReact&&this.items[parseInt(l.toString(),10)].template&&this.clearToolbarTemplate(a[parseInt(l.toString(),10)]),E.detach(a[parseInt(l.toString(),10)]),this.tbarEle.splice(l,1),this.addItems([this.items[parseInt(l.toString(),10)]],l),this.items.splice(l,1),this.items[parseInt(l.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":E.setStyleAttribute(i,{width:E.formatUnit(e.width)}),this.refreshOverflow();break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(i,Je),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(i,Je):this.remove(i,Je),E.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,Je):this.remove(this.scrollModule.element,Je)),E.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,Je):this.remove(this.popObj.element,Je)),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":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},r.prototype.hideItem=function(e,t){var i,s,n="object"==typeof e,r=e;!n&&E.isNullOrUndefined(r)||(i=[].slice.call(E.selectAll("."+b,this.element)),n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(E.selectAll("."+b,this.element))[parseInt(r.toString(),10)]),s&&(t?(s.classList.add(vt),s.classList.contains(C)||!E.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))&&"-1"===s.firstElementChild.getAttribute("tabindex")||this.updateHideEleTabIndex(s,t,n,r,i)):(s.classList.remove(vt),s.classList.contains(C)||this.updateHideEleTabIndex(s,t,n,r,i)),this.refreshOverflow()))},n([E.Collection([],Nt)],r.prototype,"items",void 0),n([E.Property("auto")],r.prototype,"width",void 0),n([E.Property("auto")],r.prototype,"height",void 0),n([E.Property("")],r.prototype,"cssClass",void 0),n([E.Property("Scrollable")],r.prototype,"overflowMode",void 0),n([E.Property()],r.prototype,"scrollStep",void 0),n([E.Property(!0)],r.prototype,"enableCollision",void 0),n([E.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),n([E.Property(!0)],r.prototype,"allowKeyboard",void 0),n([E.Event()],r.prototype,"clicked",void 0),n([E.Event()],r.prototype,"created",void 0),n([E.Event()],r.prototype,"destroyed",void 0),n([E.Event()],r.prototype,"beforeCreate",void 0);var wt,Lt=n([E.NotifyPropertyChanges],r);function r(e,t){e=wt.call(this,e,t)||this;return e.resizeContext=e.resize.bind(e),e.orientationChangeContext=e.orientationChange.bind(e),e.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},e}kt=function(e,t){return(kt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var kt,At,e=function(e,t){function i(){this.constructor=e}kt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Tt="e-acrdn-root",Pt="e-accordion",Dt="e-acrdn-item",Mt="e-item-focus",Ht="e-hide",Ut="e-acrdn-header",Rt="e-acrdn-header-content",Bt="e-acrdn-panel",jt="e-acrdn-content",qt="e-toggle-icon",Ft="e-expand-icon",Wt="e-rtl",Vt="e-content-hide",_t="e-select",zt="e-selected",Kt="e-active",Xt="e-overlay",Yt="e-toggle-animation",Gt="e-expand-state",Qt="e-accordion-container",Jt=(At=E.ChildProperty,e(Zt,At),n([E.Property("SlideDown")],Zt.prototype,"effect",void 0),n([E.Property(400)],Zt.prototype,"duration",void 0),n([E.Property("linear")],Zt.prototype,"easing",void 0),Zt);function Zt(){return null!==At&&At.apply(this,arguments)||this}$t=E.ChildProperty,e(ti,$t),n([E.Complex({effect:"SlideUp",duration:400,easing:"linear"},Jt)],ti.prototype,"collapse",void 0),n([E.Complex({effect:"SlideDown",duration:400,easing:"linear"},Jt)],ti.prototype,"expand",void 0);var $t,ei=ti;function ti(){return null!==$t&&$t.apply(this,arguments)||this}ii=E.ChildProperty,e(ni,ii),n([E.Property(null)],ni.prototype,"content",void 0),n([E.Property(null)],ni.prototype,"header",void 0),n([E.Property(null)],ni.prototype,"cssClass",void 0),n([E.Property(null)],ni.prototype,"iconCss",void 0),n([E.Property(!1)],ni.prototype,"expanded",void 0),n([E.Property(!0)],ni.prototype,"visible",void 0),n([E.Property(!1)],ni.prototype,"disabled",void 0),n([E.Property()],ni.prototype,"id",void 0);var ii,si=ni;function ni(){return null!==ii&&ii.apply(this,arguments)||this}ri=E.Component,e(o,ri),o.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var t=this.element;if(ri.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(t.children).forEach(function(e){t.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)t.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}t.classList.remove(Tt),t.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&E.isRippleEnabled&&this.removeRippleEffect()},o.prototype.preRender=function(){var e=E.closest(this.element,"."+Bt);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Pt)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(Tt),this.enableRtl&&this.add(this.element,Wt)},o.prototype.add=function(e,t){e.classList.add(t)},o.prototype.remove=function(e,t){e.classList.remove(t)},o.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},o.prototype.initialize=function(){var e=E.formatUnit(this.width),t=E.formatUnit(this.height);E.setStyleAttribute(this.element,{width:e,height:t}),E.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!E.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices)},o.prototype.renderControl=function(){this.trgtEle=0<this.element.children.length?E.select("div",this.element):null,this.renderItems(),this.initItemExpand()},o.prototype.wireFocusEvents=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Dt));e<t.length;e++){var i=t[e],s=i.querySelector("."+Ut);0<i.childElementCount&&s&&(E.EventHandler.clearEvents(s),E.EventHandler.add(s,"focus",this.focusIn,this),E.EventHandler.add(s,"blur",this.focusOut,this))}},o.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.clickHandler),E.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},o.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=E.rippleEffect(this.element,{selector:"."+Ut})),this.isNested||(this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},o.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}},o.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},o.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},o.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},o.prototype.getItemTemplate=function(){return this.itemTemplateFn},o.prototype.focusIn=function(e){e.target.parentElement.classList.add(Mt)},o.prototype.focusOut=function(e){e.target.parentElement.classList.remove(Mt)},o.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e=E.select("."+Qt,this.element),t=(e||this.element).children,i=[];[].slice.call(t).forEach(function(e){i.push({header:0<e.childElementCount&&e.children[0]?e.children[0]:"",content:1<e.childElementCount&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),e&&this.element.removeChild(e),this.setProperties({items:i},!0)},o.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:qt}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},o.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[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},o.prototype.renderItems=function(){var i,s,e,n=this,r=this.element;E.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?this.dataSource.forEach(function(e,t){s=n.renderInnerItem(e,t),r.appendChild(s),0<s.childElementCount&&(E.EventHandler.add(s.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(s.querySelector("."+Ut),"blur",n.focusOut,n))}):(e=this.items,r&&0<e.length&&e.forEach(function(e,t){i=n.renderInnerItem(e,t),r.appendChild(i),0<i.childElementCount&&(E.EventHandler.add(i.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(i.querySelector("."+Ut),"blur",n.focusOut,n))})),this.isReact&&this.renderReactTemplates()},o.prototype.clickHandler=function(e){var t,i,s,n,r,o,l=e.target,a=this.getItems(),d={};E.closest(l,"."+Pt)===this.element&&(l.classList.add("e-target"),i=E.closest(l,"."+Dt),s=E.closest(l,"."+Ut),n=E.closest(l,"."+Bt),i&&(E.isNullOrUndefined(s)||E.isNullOrUndefined(n))&&(s=i.children[0],n=i.children[1]),s&&(t=E.select("."+qt,s)),s?r=E.closest(s,"."+Dt):n&&(r=E.closest(n,"."+Dt)),o=this.getIndexByItem(i),r&&(d.item=a[this.getIndexByItem(r)]),d.originalEvent=e,!E.isNullOrUndefined(t)&&i.childElementCount<=1&&(E.isNullOrUndefined(n)||!E.isNullOrUndefined(E.select("."+Ut+" ."+qt,r)))&&(i.appendChild(this.contentRendering(o)),this.ariaAttrUpdate(i)),this.afterContentRender(l,d,i,s,n,r),this.isReact)&&this.renderReactTemplates()},o.prototype.afterContentRender=function(l,e,a,d,h,c){var p=this,u=[];this.trigger("clicked",e,function(e){if(!e.cancel){var e=h&&!E.isNullOrUndefined(E.select(".e-target",h)),t=h&&!E.isNullOrUndefined(E.select("."+Pt,h))&&E.isNullOrUndefined(E.closest(l,".e-acrdn-panel .e-accordion")),i=h&&E.isNullOrUndefined(E.select("."+Pt,h))||!(E.closest(l,"."+Pt)===p.element),e=e&&(t||i);if(l.classList.remove("e-target"),!(l.classList.contains(Bt)||l.classList.contains(jt)||e)){t=p.element.querySelector("."+Qt),i=(t||p.element).children,e=([].slice.call(i).forEach(function(e){e.classList.contains(Kt)&&u.push(e)}),[].slice.call(p.element.querySelectorAll("."+Dt+" [e-animate]")));if(0<e.length)for(var s=0,n=e;s<n.length;s++){var r=n[s];u.push(r.parentElement)}var o,t=-1!==u.indexOf(c)&&"true"===h.getAttribute("e-animate");E.isNullOrUndefined(a)||E.isNullOrUndefined(d)||(i=E.select("."+Bt,a),e=E.closest(a,"."+Tt).querySelector("."+Gt),E.isNullOrUndefined(i))||(o=e===a,!E.isVisible(i)||t&&!c.classList.contains(zt)?(0<u.length&&"Single"===p.expandMode&&!t&&u.forEach(function(e){p.collapse(E.select("."+Bt,e)),e.classList.remove(Gt)}),p.expand(i)):p.collapse(i),E.isNullOrUndefined(e))||o||e.classList.remove(Gt)}}})},o.prototype.eleMoveFocus=function(e,t,i){var s,n=E.closest(i,"."+Dt);i===t?s=("moveUp"===e?i.lastElementChild:i).querySelector("."+Ut):i.classList.contains(Ut)&&(n="moveUp"===e?n.previousElementSibling:n.nextElementSibling)&&(s=E.select("."+Ut,n)),s&&s.focus()},o.prototype.keyActionHandler=function(e){var t=e.target,i=E.closest(e.target,Ut);if(!E.isNullOrUndefined(i)||t.classList.contains(Pt)||t.classList.contains(Ut)){var s,n=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,n,t);break;case"space":case"enter":s=t.nextElementSibling,(E.isNullOrUndefined(s)||!s.classList.contains(Bt)||"true"!==s.getAttribute("e-animate"))&&t.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?n.firstElementChild:n.lastElementChild).children[0].focus(),e.preventDefault()}}},o.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Ut,id:E.getUniqueID("acrdn_header")});return E.attributes(e,{tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"}),e},o.prototype.renderInnerItem=function(e,t){var i,s,n,r=this.createElement("div",{className:Dt,id:e.id||E.getUniqueID("acrdn_item")});return this.headerTemplate?(n=this.headerEleGenerate(),i=this.createElement("div",{className:Rt}),n.appendChild(i),E.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),i),r.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(r,_t)):(i=(e.header&&this.angularnativeCondiCheck(e,"header")&&(s=e.header,this.enableHtmlSanitizer&&"string"==typeof e.header&&(s=E.SanitizeHtmlHelper.sanitize(e.header)),n=this.headerEleGenerate(),i=this.createElement("div",{className:Rt}),n.appendChild(i),n.appendChild(this.fetchElement(i,s,t)),r.appendChild(n)),E.select("."+Ut,r)),!e.expanded||E.isNullOrUndefined(t)||this.enablePersistence||-1===this.initExpand.indexOf(t)&&this.initExpand.push(t),e.cssClass&&E.addClass([r],e.cssClass.split(" ")),e.disabled&&E.addClass([r],Xt),!1===e.visible&&E.addClass([r],Ht),e.iconCss&&(s=this.createElement("div",{className:"e-acrdn-header-icon"}),n=this.createElement("span",{className:e.iconCss+" e-icons"}),s.appendChild(n),E.isNullOrUndefined(i)?((i=this.headerEleGenerate()).appendChild(s),r.appendChild(i)):i.insertBefore(s,i.childNodes[0])),e.content&&this.angularnativeCondiCheck(e,"content")&&(t=this.toggleIconGenerate(),E.isNullOrUndefined(i)&&(i=this.headerEleGenerate(),r.appendChild(i)),i.appendChild(t),this.add(r,_t))),r},o.prototype.angularnativeCondiCheck=function(e,t){t="content"===t?e.content:e.header;return!(this.isAngular&&!E.isNullOrUndefined(t.elementRef)&&(e=t.elementRef.nativeElement.data,!E.isNullOrUndefined(e))&&""!==e&&-1!==e.indexOf("bindings=")&&(e=JSON.parse(t.elementRef.nativeElement.data.replace("bindings=","")),!E.isNullOrUndefined(e))&&"false"===e["ng-reflect-ng-if"])},o.prototype.fetchElement=function(t,i,e){var s,n,r,o;try{document.querySelectorAll(i).length&&"Button"!==i?(n=(r=document.querySelector(i)).outerHTML.trim(),t.appendChild(r),r.style.display=""):s=E.compile(i)}catch(e){"string"==typeof i?t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(t.appendChild(i),this.trgtEle&&(t.firstElementChild.style.display="")):s=E.compile(i)}return E.isNullOrUndefined(s)||(this.isReact&&this.renderReactTemplates(),o=r=void 0,t.classList.contains(Rt)?(r=this.element.id+e+"_header",o="header"):t.classList.contains(jt)&&(r=this.element.id+e+"_content",o="content"),o=s({},this,o,r,this.isStringTemplate)),E.isNullOrUndefined(o)||!(0<o.length)||E.isNullOrUndefined(o[0].tagName)&&1===o.length?0===t.childElementCount&&(t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(o).forEach(function(e){E.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)}),E.isNullOrUndefined(n)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),t},o.prototype.ariaAttrUpdate=function(e){var t=E.select("."+Ut,e),e=E.select("."+Bt,e);t.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",t.id),e.setAttribute("role","region")},o.prototype.contentRendering=function(e){var t,i=this.createElement("div",{className:Bt+" "+Vt,id:E.getUniqueID("acrdn_panel")}),s=(E.attributes(i,{"aria-hidden":"true"}),this.createElement("div",{className:jt}));return!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?(this.isReact&&this.renderReactTemplates(),E.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(t=this.items[parseInt(e.toString(),10)].content,this.enableHtmlSanitizer&&"string"==typeof t&&(t=E.SanitizeHtmlHelper.sanitize(t)),i.appendChild(this.fetchElement(s,t,e))),i},o.prototype.expand=function(t){var i,s,n,r=this,e=this.getItems(),o=E.closest(t,"."+Dt);E.isNullOrUndefined(t)||E.isVisible(t)&&"true"!==t.getAttribute("e-animate")||o.classList.contains(Xt)||(i=E.closest(o,"."+Tt).querySelector("."+Gt),s={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},n=E.select("."+qt,o).firstElementChild,e={element:o,item:e[this.getIndexByItem(o)],index:this.getIndexByItem(o),content:o.querySelector("."+Bt),isExpanded:!0},this.trigger("expanding",e,function(e){e.cancel||(n.classList.add(Yt),r.expandedItemsPush(o),E.isNullOrUndefined(i)||i.classList.remove(Gt),o.classList.add(Gt),"None"===s.name&&"Enable"!==E.animationMode||"Disable"===E.animationMode?(r.expandProgress("begin",n,t,o,e),r.expandProgress("end",n,t,o,e)):r.expandAnimation(s.name,n,t,o,s,e))}))},o.prototype.expandAnimation=function(e,t,i,s,n,r){var o,l=this;"None"===e&&"Enable"===E.animationMode&&(n.name=e="SlideDown"),this.lastActiveItemId=s.id,"SlideDown"===e?(n.begin=function(){l.expandProgress("begin",t,i,s,r),i.style.position="absolute",o=s.offsetHeight,i.style.maxHeight=i.offsetHeight+"px",s.style.maxHeight=""},n.progress=function(){s.style.minHeight=o+i.offsetHeight+"px"},n.end=function(){E.setStyleAttribute(i,{position:"",maxHeight:""}),s.style.minHeight="",l.expandProgress("end",t,i,s,r)}):(n.begin=function(){l.expandProgress("begin",t,i,s,r)},n.end=function(){l.expandProgress("end",t,i,s,r)}),new E.Animation(n).animate(i)},o.prototype.expandProgress=function(e,t,i,s,n){this.remove(i,Vt),this.add(s,zt),this.add(t,Ft),"end"===e&&(this.add(s,Kt),i.setAttribute("aria-hidden","false"),E.attributes(i.previousElementSibling,{"aria-expanded":"true"}),t.classList.remove(Yt),this.trigger("expanded",n))},o.prototype.expandedItemsPush=function(e){var t,e=this.getIndexByItem(e);-1===this.expandedIndices.indexOf(e)&&((t=[].slice.call(this.expandedIndices)).push(e),this.setProperties({expandedIndices:t},!0))},o.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},o.prototype.getItemElements=function(){var t=[],e=this.element.children;return[].slice.call(e).forEach(function(e){e.classList.contains(Dt)&&t.push(e)}),t},o.prototype.expandedItemsPop=function(e){var e=this.getIndexByItem(e),t=[].slice.call(this.expandedIndices);t.splice(t.indexOf(e),1),this.setProperties({expandedIndices:t},!0)},o.prototype.collapse=function(t){var i,s,n,e,r=this;E.isNullOrUndefined(t)||(e=this.getItems(),i=E.closest(t,"."+Dt),E.isVisible(t)&&!i.classList.contains(Xt)&&(s={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},n=E.select("."+qt,i).firstElementChild,e={element:i,item:e[this.getIndexByItem(i)],index:this.getIndexByItem(i),content:i.querySelector("."+Bt),isExpanded:!1},this.trigger("expanding",e,function(e){e.cancel||(r.expandedItemsPop(i),i.classList.remove(Gt),n.classList.add(Yt),"None"===s.name&&"Enable"!==E.animationMode||"Disable"===E.animationMode?(r.collapseProgress("begin",n,t,i,e),r.collapseProgress("end",n,t,i,e)):r.collapseAnimation(s.name,t,i,n,s,e))})))},o.prototype.collapseAnimation=function(e,t,i,s,n,r){var o,l,a,d,h=this;"None"===e&&"Enable"===E.animationMode&&(n.name=e="SlideUp"),this.lastActiveItemId=i.id,"SlideUp"===e?(n.begin=function(){a=i.offsetHeight,i.style.minHeight=a+"px",t.style.position="absolute",o=i.offsetHeight,l=t.offsetHeight,t.style.maxHeight=l+"px",h.collapseProgress("begin",s,t,i,r)},n.progress=function(){(d=o-(l-t.offsetHeight))<a&&(i.style.minHeight=d+"px")},n.end=function(){t.style.display="none",h.collapseProgress("end",s,t,i,r),i.style.minHeight="",E.setStyleAttribute(t,{position:"",maxHeight:"",display:""})}):(n.begin=function(){h.collapseProgress("begin",s,t,i,r)},n.end=function(){h.collapseProgress("end",s,t,i,r)}),new E.Animation(n).animate(t)},o.prototype.collapseProgress=function(e,t,i,s,n){this.remove(t,Ft),this.remove(s,zt),"end"===e&&(this.add(i,Vt),t.classList.remove(Yt),this.remove(s,Kt),i.setAttribute("aria-hidden","true"),E.attributes(i.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",n))},o.prototype.getModuleName=function(){return"accordion"},o.prototype.getItems=function(){var e=this.itemTemplate&&this.headerTemplate?this.dataSource:this.items;return e},o.prototype.addItem=function(e,s){var n=this,r=this.element,o=this.getItemElements(),l=this.getItems();E.isNullOrUndefined(s)&&(s=l.length),r.childElementCount>=s&&(e instanceof Array?e:[e]).forEach(function(e,t){var t=s+t,i=(l.splice(t,0,e),n.renderInnerItem(e,t));r.childElementCount===t?r.appendChild(i):r.insertBefore(i,o[parseInt(t.toString(),10)]),E.EventHandler.add(i.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(i.querySelector("."+Ut),"blur",n.focusOut,n),n.expandedIndices=[],n.expandedItemRefresh(),e&&e.expanded&&n.expandItem(!0,t)}),this.isReact&&this.renderReactTemplates()},o.prototype.expandedItemRefresh=function(){var t=this,e=this.getItemElements();[].slice.call(e).forEach(function(e){e.classList.contains(zt)&&t.expandedItemsPush(e)})},o.prototype.removeItem=function(e){(this.isReact||this.isAngular)&&(i=E.selectAll("."+Dt,this.element)[parseInt(e.toString(),10)],t=E.select("."+Rt,i),i=E.select("."+jt,i),this.clearAccordionTemplate(t,0<this.dataSource.length?"headerTemplate":"header",Rt),this.clearAccordionTemplate(i,0<this.dataSource.length?"itemTemplate":"content",jt));var t=this.getItemElements()[parseInt(e.toString(),10)],i=this.getItems();E.isNullOrUndefined(t)||(this.restoreContent(e),E.detach(t),i.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},o.prototype.select=function(e){e=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(e)||E.isNullOrUndefined(E.select("."+Ut,e))||e.children[0].focus()},o.prototype.hideItem=function(e,t){e=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(e)||((t=E.isNullOrUndefined(t)?!0:t)?this.add(e,Ht):this.remove(e,Ht))},o.prototype.enableItem=function(e,t){var i,s=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(s)||(i=s.firstElementChild,t?(this.remove(s,Xt),E.attributes(i,{tabindex:"0","aria-disabled":"false"}),i.focus()):(s.classList.contains(Kt)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,i)),this.add(s,Xt),i.setAttribute("aria-disabled","true"),i.removeAttribute("tabindex")))},o.prototype.expandItem=function(t,e){var i,s,n,r=this,o=this.getItemElements();E.isNullOrUndefined(e)?"Single"===this.expandMode&&t?(n=o[o.length-1],this.itemExpand(t,n,this.getIndexByItem(n))):(i=E.select("#"+this.lastActiveItemId,this.element),[].slice.call(o).forEach(function(e){r.itemExpand(t,e,r.getIndexByItem(e)),e.classList.remove(Gt)}),(s=E.select("."+Gt,this.element))&&s.classList.remove(Gt),i&&i.classList.add(Gt)):(n=o[parseInt(e.toString(),10)],E.isNullOrUndefined(n)||!n.classList.contains(_t)||n.classList.contains(Kt)&&t||("Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(t,n,e)))},o.prototype.itemExpand=function(e,t,i){var s=t.children[1];t.classList.contains(Xt)||(E.isNullOrUndefined(s)&&e?(s=this.contentRendering(i),t.appendChild(s),this.ariaAttrUpdate(t),this.expand(s)):E.isNullOrUndefined(s)||(e?this.expand(s):this.collapse(s)),this.isReact&&this.renderReactTemplates())},o.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Dt)).forEach(function(e){E.detach(e)})},o.prototype.restoreContent=function(e){var t=E.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Dt)[parseInt(e.toString(),10)];this.templateEle.forEach(function(e){E.isNullOrUndefined(t.querySelector(e))||(document.body.appendChild(t.querySelector(e)).style.display="none")})},o.prototype.updateItem=function(e,t){var i,s,n;E.isNullOrUndefined(e)||(i=(s=this.getItems())[parseInt(t.toString(),10)],s.splice(t,1),this.restoreContent(t),s=E.select("."+Rt,e),n=E.select("."+jt,e),(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(s,"header",Rt),this.clearAccordionTemplate(n,"content",jt)),E.detach(e),this.addItem(i,t))},o.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},o.prototype.clearAccordionTemplate=function(e,t,i){if(this.registeredTemplate&&this.registeredTemplate[""+t])for(var s=this.registeredTemplate,n=0;n<s[""+t].length;n++){var r=s[""+t][parseInt(n.toString(),10)].rootNodes[0],o=E.closest(r,"."+i);if(!E.isNullOrUndefined(o)&&o===e||E.isNullOrUndefined(r.parentNode)){this.clearTemplate([t],[s[""+t][parseInt(n.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var l=this.portals,n=0;n<l.length;n++){var a=l[parseInt(n.toString(),10)],o=E.closest(a.containerInfo,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],n);break}}},o.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},o.prototype.onPropertyChanged=function(e,t){for(var i=this.element,s=!1,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&t.items instanceof Array)s=!0;else for(var o=Object.keys(e.items),l=0;l<o.length;l++)for(var a=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),d=Object.keys(e.items[parseInt(a.toString(),10)]),h=0;h<d.length;h++){var c=E.selectAll("."+Dt,this.element)[parseInt(a.toString(),10)],p=Object(t.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],u=Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],m=d[parseInt(h.toString(),10)],f=E.select("."+jt,c);("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===p)&&this.updateItem(c,a),"cssClass"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||(p&&E.removeClass([c],p.split(" ")),u&&E.addClass([c],u.split(" "))),"visible"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||(!1===Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]]?c.classList.add(Ht):c.classList.remove(Ht)),"disabled"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||this.enableItem(a,!u),d.indexOf("header")<0&&"content"===d[parseInt(h.toString(),10)]&&!E.isNullOrUndefined(c)&&2===c.children.length&&("function"==typeof u?((this.isAngular||this.isReact)&&this.clearAccordionTemplate(f,d[parseInt(h.toString(),10)],jt),(m=c.querySelector("."+jt)).innerHTML="",this.setTemplate(u,m,a)):(c.classList.contains(zt)&&this.expandItem(!1,a),E.detach(c.querySelector("."+Bt))))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),s=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),s=!0;break;case"itemTemplate":this.initializeItemTemplate(),s=!0;break;case"enableRtl":e.enableRtl?this.add(i,Wt):this.remove(i,Wt);break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)});break;case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!E.isNullOrUndefined(this.expandedIndices)&&1<this.expandedIndices.length&&this.expandItem(!1)}s&&(this.initExpand=[],!E.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},n([E.Collection([],si)],o.prototype,"items",void 0),n([E.Property([])],o.prototype,"dataSource",void 0),n([E.Property()],o.prototype,"itemTemplate",void 0),n([E.Property()],o.prototype,"headerTemplate",void 0),n([E.Property("100%")],o.prototype,"width",void 0),n([E.Property("auto")],o.prototype,"height",void 0),n([E.Property([])],o.prototype,"expandedIndices",void 0),n([E.Property("Multiple")],o.prototype,"expandMode",void 0),n([E.Property(!0)],o.prototype,"enableHtmlSanitizer",void 0),n([E.Complex({},ei)],o.prototype,"animation",void 0),n([E.Event()],o.prototype,"clicked",void 0),n([E.Event()],o.prototype,"expanding",void 0),n([E.Event()],o.prototype,"expanded",void 0),n([E.Event()],o.prototype,"created",void 0),n([E.Event()],o.prototype,"destroyed",void 0);var ri,e=n([E.NotifyPropertyChanges],o);function o(e,t){e=ri.call(this,e,t)||this;return e.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},e}oi=function(e,t){return(oi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var oi,li,n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},n=(function(e,t){function i(){this.constructor=e}oi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ai,li=F),ai.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||E.getUniqueID("ej2-contextmenu"),li.prototype.preRender.call(this)},ai.prototype.initialize=function(){this.template=this.itemTemplate||null,li.prototype.initialize.call(this),E.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=g.getZindexPartial(this.element).toString()},ai.prototype.open=function(e,t,i){li.prototype.openMenu.call(this,null,null,e,t,null,i)},ai.prototype.close=function(){li.prototype.closeMenu.call(this)},ai.prototype.onPropertyChanged=function(e,t){li.prototype.onPropertyChanged.call(this,e,t);for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"filter":this.close(),this.filter=e.filter;break;case"target":this.unWireEvents(t.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=e.itemTemplate,this.refresh()}},ai.prototype.getModuleName=function(){return"contextmenu"},n([E.Property("")],ai.prototype,"target",void 0),n([E.Property("")],ai.prototype,"filter",void 0),n([E.Collection([],We)],ai.prototype,"items",void 0),n([E.Property(null)],ai.prototype,"itemTemplate",void 0),n([E.Property(!1)],ai.prototype,"enableScrolling",void 0),n([E.NotifyPropertyChanges],ai));function ai(e,t){return li.call(this,e,t)||this}di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var di,hi,ci=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},pi="e-vertical",ui="e-hamburger",F=(function(e,t){function i(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(mi,hi=F),mi.prototype.getModuleName=function(){return"menu"},mi.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||E.getUniqueID("ej2-menu"),this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items),hi.prototype.preRender.call(this)},mi.prototype.initialize=function(){hi.prototype.initialize.call(this),E.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(pi),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(pi),this.element.setAttribute("aria-orientation","vertical")):E.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(ui),"Horizontal"===this.orientation)&&this.element.classList.add("e-hide-menu")},mi.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},mi.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"orientation":"Vertical"===e.orientation?(this.element.classList.add(pi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(pi),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(pi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(pi),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(t.items).length||this.updateMenuItems(e.items);break;case"hamburgerMode":this.element.previousElementSibling||hi.prototype.createHeaderContainer.call(this),e.hamburgerMode?(this.element.parentElement.classList.add(ui),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[i.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(ui),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(pi),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(pi):this.element.previousElementSibling.classList.remove(pi),this.element.classList[e.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(e.title=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e.title):e.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=e.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(t.target),this.wireEvents(),"Horizontal"===this.orientation)&&(e.target?this.element.previousElementSibling.classList.add(pi):(this.element.previousElementSibling||hi.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(pi)),this.element.classList.add("e-hide-menu"));break;case"template":this.template=e.template,this.refresh()}hi.prototype.onPropertyChanged.call(this,e,t)},mi.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)},mi.prototype.open=function(){hi.prototype.openHamburgerMenu.call(this)},mi.prototype.close=function(){hi.prototype.closeHamburgerMenu.call(this)},ci([E.Property("Horizontal")],mi.prototype,"orientation",void 0),ci([E.Property("")],mi.prototype,"target",void 0),ci([E.Property(null)],mi.prototype,"template",void 0),ci([E.Property(!1)],mi.prototype,"enableScrolling",void 0),ci([E.Property(!1)],mi.prototype,"hamburgerMode",void 0),ci([E.Property("Menu")],mi.prototype,"title",void 0),ci([E.Property(!0)],mi.prototype,"enableHtmlSanitizer",void 0),ci([E.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],mi.prototype,"fields",void 0),ci([E.NotifyPropertyChanges],mi));function mi(e,t){e=hi.call(this,e,t)||this;return e.tempItems=[],e}fi=function(e,t){return(fi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var fi,gi,ci=function(e,t){function i(){this.constructor=e}fi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},vi="e-tab",yi="e-tab-header",S="e-content",bi="e-nested",Ci="e-item",Si="e-template",Ii="e-rtl",d="e-active",Ei="e-disable",I="e-hidden",xi="e-focused",Ni="e-icons",Oi="e-icon",wi="e-icon-tab",Li="e-close-icon",ki="e-close-show",Ai="e-tab-text",Ti="e-indicator",Pi="e-tab-wrap",Di="e-text-wrap",Mi="e-tab-icon",Hi="e-toolbar-items",N="e-toolbar-item",Ui="e-toolbar-pop",Ri="e-toolbar-popup",Bi="e-progress",ji="e-overlay",qi="e-vertical-tab",Fi="e-vertical",Wi="e-vertical-left",Vi="e-vertical-right",_i="e-horizontal-bottom",zi="e-fill-mode",Ki="tabitem_",Xi="e-reorder-active-item",Yi=(gi=E.ChildProperty,ci(Gi,gi),l([E.Property("SlideLeftIn")],Gi.prototype,"effect",void 0),l([E.Property(600)],Gi.prototype,"duration",void 0),l([E.Property("ease")],Gi.prototype,"easing",void 0),Gi);function Gi(){return null!==gi&&gi.apply(this,arguments)||this}Qi=E.ChildProperty,ci(Zi,Qi),l([E.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},Yi)],Zi.prototype,"previous",void 0),l([E.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},Yi)],Zi.prototype,"next",void 0);var Qi,Ji=Zi;function Zi(){return null!==Qi&&Qi.apply(this,arguments)||this}$i=E.ChildProperty,ci(ts,$i),l([E.Property("")],ts.prototype,"text",void 0),l([E.Property("")],ts.prototype,"iconCss",void 0),l([E.Property("left")],ts.prototype,"iconPosition",void 0);var $i,es=ts;function ts(){return null!==$i&&$i.apply(this,arguments)||this}is=E.ChildProperty,ci(ns,is),l([E.Complex({},es)],ns.prototype,"header",void 0),l([E.Property(null)],ns.prototype,"headerTemplate",void 0),l([E.Property("")],ns.prototype,"content",void 0),l([E.Property("")],ns.prototype,"cssClass",void 0),l([E.Property(!1)],ns.prototype,"disabled",void 0),l([E.Property(!0)],ns.prototype,"visible",void 0),l([E.Property()],ns.prototype,"id",void 0),l([E.Property(-1)],ns.prototype,"tabIndex",void 0);var is,ss=ns;function ns(){return null!==is&&is.apply(this,arguments)||this}rs=E.Component,ci(h,rs),h.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),E.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var e=E.select(".e-tab > ."+S,this.element);this.element.classList.remove(Si),E.isNullOrUndefined(e)||(e.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)E.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&0<this.draggableItems.length){for(var t=0;t<this.draggableItems.length;t++)this.draggableItems[t].destroy(),this.draggableItems[t]=null;this.draggableItems=[]}rs.prototype.destroy.call(this),this.trigger("destroyed")},h.prototype.refresh=function(){this.isReact&&this.clearTemplate(),rs.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},h.prototype.refreshOverflow=function(){E.isNullOrUndefined(this.tbObj)||this.tbObj.refreshOverflow()},h.prototype.preRender=function(){var e=E.closest(this.element,"."+S),e=(this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=E.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+yi:this.dragArea),E.isNullOrUndefined(e)||(e.parentElement.classList.add(bi),this.isNested=!0),E.Browser.info.name),e="msie"===e?"e-ie":"edge"===e?"e-edge":"safari"===e?"e-safari":"";E.setStyleAttribute(this.element,{width:E.formatUnit(this.width),height:E.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),E.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,e,!0),this.updatePopAnimationConfig()},h.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:Ni+" "+Li,attrs:{title:this.title}}),this.tabId=0<this.element.id.length?"-"+this.element.id:E.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow(),e.refreshActiveBorder()})},h.prototype.renderContainer=function(){var e=this.element;this.items.forEach(function(e,t){E.isNullOrUndefined(e.id)&&!E.isNullOrUndefined(e.setProperties)&&e.setProperties({id:Ki+t.toString()},!0)}),0<this.items.length&&0===e.children.length?(e.appendChild(this.createElement("div",{className:S})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:yi})),this.isTemplate=!1):0<this.element.children.length&&(this.isTemplate=!0,e.classList.add(Si),e=e.querySelector("."+yi))&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,e),E.isNullOrUndefined(E.select("."+yi,this.element))||E.isNullOrUndefined(E.select("."+S,this.element))||(this.renderHeader(),this.tbItems=E.select("."+yi+" ."+Hi,this.element),E.isNullOrUndefined(this.tbItems)||E.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),0<E.selectAll("."+N,this.element).length&&(this.tbItems=E.select("."+yi+" ."+Hi,this.element),this.bdrLine=this.createElement("div",{className:Ti+" "+I+" e-ignore"}),e=E.select("."+this.scrCntClass,this.tbItems),E.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):e.insertBefore(this.bdrLine,e.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)),this.setRTL(this.enableRtl))},h.prototype.renderHeader=function(){var n=this,e=this.headerPlacement,t=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){1<this.element.children.length&&this.element.children[1].classList.contains(yi)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r,i=this.hdrEle.children.length,s=[],o=0;o<i;o++)s.push(this.hdrEle.children.item(o));0<i&&(r=this.createElement("div",{className:"e-items"}),this.hdrEle.appendChild(r),s.forEach(function(e,t){n.lastIndex=t;var i={className:Ci,id:Ci+n.tabId+"_"+t},s=n.createElement("span",{className:Ai,attrs:{role:"presentation"}}).outerHTML,s=n.createElement("div",{className:Di,innerHTML:s+n.btnCls.outerHTML}).outerHTML,s=n.createElement("div",{className:Pi,innerHTML:s,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":S+n.tabId+"_"+t,"aria-disabled":"false"}});s.querySelector("."+Ai).appendChild(e),r.appendChild(n.createElement("div",i)),E.selectAll("."+Ci,r)[t].appendChild(s)}))}else t=this.parseObject(this.items,0);this.tbObj=new Lt({width:"Left"===e||"Right"===e?"auto":"100%",height:"Left"===e||"Right"===e?"100%":"auto",overflowMode:this.overflowMode,items:0!==t.length?t:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),E.attributes(this.hdrEle,{role:"tablist"}),E.isNullOrUndefined(this.element.getAttribute("aria-label"))?E.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.setCloseButton(this.showCloseButton);e=this.tbObj.element.querySelector("."+Hi);E.isNullOrUndefined(e)||!E.isNullOrUndefined(e.id)&&""!==e.id||(e.id=this.element.id+"_tab_header_items")},h.prototype.createContentElement=function(e){var t=this.createElement("div",{id:S+this.tabId+"_"+e,className:Ci,attrs:{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===Number(this.extIndex(this.itemIndexArray[0])))&&E.addClass([t],d),t},h.prototype.renderContent=function(){this.cntEle=E.select("."+S,this.element);var e=E.selectAll("."+N,this.element);if(this.isTemplate){this.cnt=0<this.cntEle.children.length?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,i=0;i<e.length;i++)t.length-1>=i&&(E.addClass([t.item(i)],Ci),E.attributes(t.item(i),{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+i}),t.item(i).id=S+this.tabId+"_"+i)}else if(0<E.selectAll("."+N,this.element).length)if("Init"===this.loadOn)for(i=0;i<this.itemIndexArray.length;i++)this.itemIndexArray[i]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[i]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(0<this.selectedItem?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},h.prototype.reRenderItems=function(){this.renderContainer(),E.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},h.prototype.parseObject=function(e,h){var c,p=this,u=Array.prototype.slice.call(E.selectAll(".e-tab-header ."+N,this.element)),m=this.lastIndex,f=(!this.isReplace&&0<u.length&&(m=this.getMaxIndicesFromItems(u)),[]),g=[];return e.forEach(function(e,t){var i,s,n,r,o,l,a=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,d=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;E.isNullOrUndefined(e.headerTemplate)&&(E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===d)?g.push(t):("string"==typeof(o=e.headerTemplate||e.header.text)&&p.enableHtmlSanitizer&&(o=E.SanitizeHtmlHelper.sanitize(o)),p.isReplace&&!E.isNullOrUndefined(p.tbId)&&""!==p.tbId?(i=parseInt(p.tbId.substring(p.tbId.lastIndexOf("_")+1),10),p.tbId=""):i=h+t,p.lastIndex=0===u.length?t:p.isReplace?i:m+1+t,i=e.disabled?" "+Ei+" "+ji:"",s=!1===e.visible?" "+I:"",c=p.createElement("div",{className:Ai,attrs:{role:"presentation"}}),n=o instanceof Object?o.outerHTML:o,n=!E.isNullOrUndefined(n)&&""!==n,E.isNullOrUndefined(o.tagName)?p.headerTextCompile(c,o,t):c.appendChild(o),l=p.createElement("span",{className:Ni+" "+Mi+" "+Oi+"-"+a+" "+d}),(r=p.createElement("div",{className:Di})).appendChild(c),""!==o&&void 0!==o&&""!==d?("left"===a||"top"===a?r.insertBefore(l,r.firstElementChild):r.appendChild(l),p.isIconAlone=!1):(""===d?c:l)===l&&(E.detach(c),r.appendChild(l),p.isIconAlone=!0),o=E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),l=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:o,"data-tabindex":o,role:"tab","aria-selected":"false","aria-disabled":"false"},r.appendChild(p.btnCls.cloneNode(!0)),(o=p.createElement("div",{className:Pi,attrs:l})).appendChild(r),p.itemIndexArray instanceof Array&&p.itemIndexArray.splice(h+t,0,Ci+p.tabId+"_"+p.lastIndex),(l={htmlAttributes:{id:Ci+p.tabId+"_"+p.lastIndex,"data-id":e.id},template:o}).cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+i+" "+s+" "+(""!==d?"e-i"+a:"")+" "+(n?"":Oi),"top"!==a&&"bottom"!==a||p.element.classList.add("e-vertical-icon"),f.push(l),t++)}),this.isAdd||g.forEach(function(e){p.items.splice(e,1)}),this.isIconAlone?this.element.classList.add(wi):this.element.classList.remove(wi),f},h.prototype.removeActiveClass=function(){var e=this.getTabHeader();e&&(e=E.selectAll("."+N+"."+d,e),[].slice.call(e).forEach(function(e){return e.classList.remove(d)}),[].slice.call(e).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")}))},h.prototype.checkPopupOverflow=function(e){this.tbPop=E.select("."+Ui,this.element);var t=E.select(".e-hor-nav",this.element),i=E.select("."+Hi,this.element),s=i.lastChild,n=!1;return(n=!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>i.offsetLeft||!this.enableRtl&&t.offsetLeft<i.offsetWidth)||this.isVertical()&&t.offsetTop<s.offsetTop+s.offsetHeight?!0:n)&&(e.classList.add(Ri),this.tbPop.insertBefore(e,E.selectAll("."+Ri,this.tbPop)[0])),!0},h.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element"),t=(E.isNullOrUndefined(t)||(t.outerHTML="",e.querySelector("."+Pi).classList.remove("e-ripple")),this.tbItem=E.selectAll("."+Hi+" ."+N,this.hdrEle),this.tbItem[this.tbItem.length-1]);return 0!==this.tbItem.length&&(e.classList.remove(Ri),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(t)&&(e=this.tbItems.lastChild.previousElementSibling,this.checkPopupOverflow(e)),this.isPopup=!0),E.selectAll("."+N,this.tbItems).length-1},h.prototype.setCloseButton=function(e){var t=E.select("."+yi,this.element);!0===e?t.classList.add(ki):t.classList.remove(ki),this.refreshOverflow(),this.refreshActiveTabBorder()},h.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains(Ii);e=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;return e},h.prototype.triggerPrevAnimation=function(e,t){var i=this,t=this.prevCtnAnimation(t,this.selectedItem);E.isNullOrUndefined(t)?e.classList.remove(d):(t.begin=function(){E.setStyleAttribute(e,{position:"absolute"}),e.classList.add(Bi),e.classList.add("e-view")},t.end=function(){e.style.display="none",e.classList.remove(d),e.classList.remove(Bi),e.classList.remove("e-view"),E.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||i.isTemplate||E.detach(e)},new E.Animation(t).animate(e))},h.prototype.triggerAnimation=function(e,t){var i,s,n,r=this,o=this.prevIndex,l=([].slice.call(this.element.querySelector("."+S).children).forEach(function(e){e.id===r.prevActiveEle&&(i=e)}),this.tbItem[o]),a=this.getTrgContent(this.cntEle,this.extIndex(e)),l=(E.isNullOrUndefined(i)&&!E.isNullOrUndefined(l)&&(e=this.extIndex(l.id),i=this.getTrgContent(this.cntEle,e)),E.isNullOrUndefined(a)||(this.prevActiveEle=a.id),E.isNullOrUndefined(this.animation)||E.isNullOrUndefined(this.animation.next.effect)||E.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect);this.initRender||!1===t||l?i&&i!==a&&i.classList.remove(d):(s=E.select("."+S,this.element),this.prevIndex>this.selectedItem&&!this.isPopup?n={name:"None"===(e=this.animation.previous.effect)?"":"SlideLeftIn"!==e?e:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===E.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem)&&(n={name:"None"===(t=this.animation.next.effect)?"":"SlideRightIn"!==t?t:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===E.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}),n.progress=function(){s.classList.add(Bi),r.setActiveBorder()},n.end=function(){s.classList.remove(Bi),a.classList.add(d)},this.initRender||E.isNullOrUndefined(i)||this.triggerPrevAnimation(i,o),this.isPopup=!1,""===n.name?a.classList.add(d):new E.Animation(n).animate(a))},h.prototype.keyPressed=function(e){var t=E.closest(e,"."+yi+" ."+N),i=this.getEleIndex(t);!E.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():E.isNullOrUndefined(t)||!1!==t.classList.contains(d)||(this.selectTab(i,null,!0),E.isNullOrUndefined(this.popEle))||this.popObj.hide(this.hide)},h.prototype.getTabHeader=function(){var e;if(!E.isNullOrUndefined(this.element))return 0<(e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(yi)})).length?e[0]:(e=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0])?[].slice.call(e.children).filter(function(e){return e.classList.contains(yi)})[0]:void 0},h.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(E.selectAll("."+N,this.getTabHeader()),e)},h.prototype.extIndex=function(e){return e.replace(Ci+this.tabId+"_","")},h.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},h.prototype.expTemplateContent=function(){var t=this;this.templateEle.forEach(function(e){E.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})},h.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()},h.prototype.compileElement=function(t,e,i,s){var n,r;"string"==typeof e?(e=e.trim(),this.isVue?n=E.compile(this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e):e):t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e):e):n=E.compile(e),E.isNullOrUndefined(n)||(r=n({},this,i)),!E.isNullOrUndefined(n)&&0<r.length&&[].slice.call(r).forEach(function(e){t.appendChild(e)})},h.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},h.prototype.getContent=function(e,t,i,s){var n,r;"string"==typeof(t=E.isNullOrUndefined(t)?"":t)||E.isNullOrUndefined(t.innerHTML)?("."===(t="string"==typeof t&&this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(t):t)[0]||"#"===t[0])&&document.querySelectorAll(t).length?(r=(n=document.querySelector(t)).outerHTML.trim(),"clone"===i?e.appendChild(n.cloneNode(!0)):(e.appendChild(n),n.style.display="")):this.templateCompile(e,t,s):e.appendChild(t),E.isNullOrUndefined(r)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},h.prototype.getTrgContent=function(e,t){e=this.element.classList.contains(bi)?E.select("."+bi+"> ."+S+" > #"+S+this.tabId+"_"+t,this.element):this.findEle(e.children,S+this.tabId+"_"+t);return e},h.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},h.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},h.prototype.addVerticalClass=function(){var e;this.isVertical()&&(e="Left"===this.headerPlacement?Wi:Vi,E.addClass([this.hdrEle],[Fi,e]),this.element.classList.contains(bi)?E.addClass([this.hdrEle],[qi,e]):E.addClass([this.element],[qi,e])),"Bottom"===this.headerPlacement&&E.addClass([this.hdrEle],[_i])},h.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},h.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var e=this.hdrEle.querySelector("."+d),t=!!this.hdrEle.classList.contains(Fi);E.removeClass([this.element],[qi]),E.removeClass([this.hdrEle],[Fi,Wi,Vi]),t!==this.isVertical()&&(this.changeToolbarOrientation(),!E.isNullOrUndefined(e))&&e.classList.contains(Ri)&&this.popupHandler(e),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},h.prototype.focusItem=function(){var e=E.select(" #"+Ci+this.tabId+"_"+this.selectedItem,this.hdrEle);E.isNullOrUndefined(e)||e.firstElementChild.focus()},h.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},h.prototype.setOrientation=function(e,t){var i=Array.prototype.indexOf.call(this.element.children,t),s=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+S));"Bottom"===e&&i<s?this.element.appendChild(t):(E.removeClass([t],[_i]),this.element.insertBefore(t,E.select("."+S,this.element)))},h.prototype.setCssClass=function(e,t,i){if(""!==t&&!E.isNullOrUndefined(t))for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},h.prototype.loadContentInitMode=function(e){if(e){if("Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t);this.prevIndex!==this.selectedItem&&e.classList.remove(d)}},h.prototype.loadContentElement=function(){var e;this.isTemplate||(e=this.cntEle.children.item(0),this.loadContentInitMode(e))},h.prototype.setContentHeight=function(e){if(this.element.classList.contains(zi)&&E.removeClass([this.element],[zi]),!E.isNullOrUndefined(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode)this.loadContentElement(),"auto"===this.height||this.isVertical()||E.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-t.offsetHeight+"px"});else if("Fill"===this.heightAdjustMode)E.addClass([this.element],[zi]),E.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var i=E.selectAll("."+S+" > ."+Ci,this.element),s=0;s<i.length;s++)i[s].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(i[s])),i[s].style.removeProperty("display"),i[s].style.removeProperty("visibility");else{this.cntEle=E.select("."+S,this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var n=this.cntEle.children.item(0),s=0;s<this.items.length;s++)for(this.getContent(n,this.items[s].content,"clone",s),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n));n.firstChild;)n.removeChild(n.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(n,this.items[0].content,"render",0),this.loadContentInitMode(n)}E.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),E.setStyleAttribute(this.cntEle,{height:"auto"})}},h.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"))},h.prototype.setActiveBorder=function(){var e,t,i=this.getTabHeader(),s=E.select("."+N+"."+d,i);E.isNullOrUndefined(s)||(this.reorderActiveTab?i&&i.classList.remove(Xi):(s.classList.contains(Ri)&&!this.bdrLine.classList.contains(I)&&this.bdrLine.classList.add(I),i&&!i.classList.contains(Xi)&&i.classList.add(Xi)),e=E.closest(s,"."+vi),this.element!==e)||(this.tbItems=E.select("."+Hi,i),e=E.select("."+Ti,i),i=E.select("."+Hi+" ."+this.scrCntClass,i),this.isVertical()?(E.setStyleAttribute(e,{left:"",right:""}),0!==(E.isNullOrUndefined(i)?this.tbItems:i).offsetHeight?E.setStyleAttribute(e,{top:s.offsetTop+"px",height:s.offsetHeight+"px"}):E.setStyleAttribute(e,{top:0,height:0})):("MultiRow"===this.overflowMode?(t="Bottom"===this.headerPlacement?s.offsetTop:s.offsetHeight+s.offsetTop,E.setStyleAttribute(e,{top:t+"px",height:""})):E.setStyleAttribute(e,{top:"",height:""}),0!==(t=(E.isNullOrUndefined(i)?this.tbItems:i).offsetWidth)?E.setStyleAttribute(e,{left:s.offsetLeft+"px",right:t-(s.offsetLeft+s.offsetWidth)+"px"}):E.setStyleAttribute(e,{left:"auto",right:"auto"})),E.isNullOrUndefined(this.bdrLine))||s.classList.contains(Ri)||this.bdrLine.classList.remove(I)},h.prototype.setActive=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),this.tbItem=E.selectAll("."+N,this.getTabHeader());var s=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!E.isNullOrUndefined(s)&&s.classList.contains(Ei)))if(0<=e&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains(d))this.setActiveBorder();else{this.isTemplate||E.attributes(s.firstElementChild,{"aria-controls":S+this.tabId+"_"+this.extIndex(s.id)});var n=s.id,r=(this.removeActiveClass(),s.classList.add(d),s.firstElementChild.setAttribute("aria-selected","true"),Number(this.extIndex(n)));if(E.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=S+this.tabId+"_"+r),this.isTemplate)0<E.select("."+S,this.element).children.length&&(r=this.findEle(E.select("."+S,this.element).children,S+this.tabId+"_"+r),E.isNullOrUndefined(r)||r.classList.add(d),this.triggerAnimation(n,this.enableAnimation));else{for(this.cntEle=E.select(".e-tab > ."+S,this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var o,l,r=this.getTrgContent(this.cntEle,this.extIndex(n));E.isNullOrUndefined(r)?(this.cntEle.appendChild(this.createElement("div",{id:S+this.tabId+"_"+this.extIndex(n),className:Ci+" "+d,attrs:{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+this.extIndex(n)}})),o=this.getTrgContent(this.cntEle,this.extIndex(n)),l=Array.prototype.indexOf.call(this.itemIndexArray,n),this.getContent(o,this.items[l].content,"render",l)):r.classList.add(d),this.triggerAnimation(n,this.enableAnimation)}this.setActiveBorder(),this.refreshItemVisibility(s),this.initRender||t||(o={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:E.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:i,preventFocus:!1},this.trigger("selected",o,function(e){e.preventFocus||s.firstElementChild.focus()}))}},h.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=E.select("."+Hi,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},h.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,Ii,e),this.refreshActiveBorder()},h.prototype.refreshActiveBorder=function(){E.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(I),this.setActiveBorder()},h.prototype.showPopup=function(e){var t=E.select(".e-popup.e-toolbar-pop",this.hdrEle);t&&t.classList.contains("e-popup-close")&&((t=t&&t.ej2_instances[0]).position.X="Left"===this.headerPlacement||this.element.classList.contains(Ii)?"left":"right",t.dataBind(),t.show(e))},h.prototype.bindDraggable=function(){var e,t=this;this.allowDragAndDrop&&(e=this.element.querySelector("."+yi))&&Array.prototype.slice.call(e.querySelectorAll("."+N)).forEach(function(e){t.initializeDrag(e)})},h.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new E.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},h.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),E.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),E.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),E.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},h.prototype.unWireEvents=function(){E.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),E.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),E.isNullOrUndefined(this.cntEle)||E.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),E.EventHandler.remove(this.element,"mouseover",this.hoverHandler),E.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(Ii),this.element.classList.remove(xi)},h.prototype.clickHandler=function(e){this.element.classList.remove(xi);var t=e.originalEvent.target,i=E.closest(t,"."+N),s=this.getEleIndex(i);t.classList.contains(Li)?this.removeTab(s):this.isVertical()&&E.closest(t,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,E.isNullOrUndefined(i)||s===this.selectedItem||this.selectTab(s,e.originalEvent,!0))},h.prototype.swipeHandler=function(e){if(!(e.velocity<3&&E.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;0<=i;i--)if(!this.tbItem[i].classList.contains(I)){this.selectTab(i,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==E.selectAll("."+N,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains(I)){this.selectTab(s,null,!0);break}this.isSwiped=!1}}},h.prototype.spaceKeyDown=function(e){var t;(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(t=E.closest(e.target,"."+yi),E.isNullOrUndefined(t)||e.preventDefault())},h.prototype.keyHandler=function(e){if(!this.element.classList.contains(Ei)){this.element.classList.add(xi);var t,i=e.target,s=this.getTabHeader(),n=E.select("."+d,s),r=(this.popEle=E.select("."+Ui,s),E.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]),E.closest(document.activeElement,"."+N)),o=E.closest(i,"."+N);switch(e.action){case"space":case"enter":i.parentElement.classList.contains(Ei)||("enter"===e.action&&i.classList.contains("e-hor-nav")?this.showPopup(this.show):this.keyPressed(i));break;case"tab":case"shiftTab":i.classList.contains(Pi)&&!1===E.closest(i,"."+N).classList.contains(d)&&i.setAttribute("tabindex",i.getAttribute("data-tabindex")),this.popObj&&E.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),E.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":E.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!E.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":!0!==this.showCloseButton||E.isNullOrUndefined(o)||(t=o.nextSibling,!E.isNullOrUndefined(t)&&t.classList.contains(N)&&t.firstElementChild.focus(),this.removeTab(this.getEleIndex(o))),this.setActiveBorder()}}},h.prototype.refreshItemVisibility=function(e){var t,i,s,n,r=E.select("."+this.scrCntClass,this.tbItems);this.isVertical()||E.isNullOrUndefined(r)||(i=(t=(r=E.select(".e-hscroll-bar",this.tbItems)).scrollLeft)+r.offsetWidth,s=e.offsetLeft,n=e.offsetWidth,e=e.offsetLeft+e.offsetWidth,t<s&&i<e?r.scrollLeft=t+(n-(i-s)):s<t&&e<i&&(r.scrollLeft=t-(n-(e-t))))},h.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},h.prototype.hoverHandler=function(e){e=e.target;!E.isNullOrUndefined(e.classList)&&e.classList.contains(Li)&&e.setAttribute("title",new E.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},h.prototype.evalOnPropertyChangeItems=function(e,t){var i=this;if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,E.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),0<this.templateEle.length&&this.expTemplateContent(),this.templateEle=[];for(var s=E.select(".e-tab > ."+S,this.element);s.firstElementChild;)E.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var n=Object.keys(e.items),r=0;r<n.length;r++)for(var o=parseInt(Object.keys(e.items)[r],10),l=Object.keys(e.items[o]),a=0;a<l.length;a++){var d,h,c=Object(t.items[o])[l[a]],p=Object(e.items[o])[l[a]],u=this.element.querySelectorAll("."+N)[o],m=void 0,m=u&&!E.isNullOrUndefined(u.id)&&""!==u.id?this.getIndexFromEle(u.id):o,f=E.select("."+Hi+" #"+Ci+this.tabId+"_"+m,this.element),m=E.select("."+S+" #"+S+this.tabId+"_"+m,this.element);"header"!==l[a]&&"headerTemplate"!==l[a]||(h=E.isNullOrUndefined(this.items[o].header)||E.isNullOrUndefined(this.items[o].header.iconCss)?"":this.items[o].header.iconCss,d=this.items[o].headerTemplate||this.items[o].header.text,"headerTemplate"===l[a]&&this.clearTabTemplate(f,l[a],N),""===d&&""===h?this.removeTab(o):(this.tbId=u.id,(d=[]).push(this.items[o]),this.items.splice(o,1),this.itemIndexArray.splice(o,1),this.tbObj.items.splice(o,1),h=f.classList.contains(I),E.detach(f),this.isReplace=!0,this.addTab(d,o),h&&this.hideTab(o),this.isReplace=!1)),"content"!==l[a]||E.isNullOrUndefined(m)||(("string"==typeof p||E.isNullOrUndefined(p.innerHTML))&&("."===p[0]||"#"===p[0])&&p.length?(u=document.querySelector(p),m.appendChild(u),u.style.display=""):""===p&&"#"===c[0]?(document.body.appendChild(this.element.querySelector(c)).style.display="none",m.innerHTML=p):this.isAngular||this.isReact?(this.clearTabTemplate(m,l[a],Ci),m.innerHTML="",this.templateCompile(m,p,o)):"function"!=typeof p&&(m.innerHTML=p)),"cssClass"===l[a]&&(E.isNullOrUndefined(f)||(f.classList.remove(c),f.classList.add(p)),E.isNullOrUndefined(m)||(m.classList.remove(c),m.classList.add(p))),"disabled"===l[a]&&this.enableTab(o,!0!==p),"visible"===l[a]&&this.hideTab(o,!0!==p)}this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){i.refreshActiveTabBorder()})}},h.prototype.clearTabTemplate=function(e,t,i){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[t])for(var s=this.registeredTemplate,n=0;n<s[t].length;n++){var r=s[t][n].rootNodes[0],o=E.closest(r,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],[s[t][n]]);break}}else if(this.portals&&0<this.portals.length)for(var l=this.portals,n=0;n<l.length;n++){var a=l[n],o=E.closest(a.containerInfo,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],n);break}}},h.prototype.initializeDrag=function(e){var o=this,e=new E.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+N,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var t,i,s,n=o.getEleIndex(o.dragItem),r={draggedItem:o.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+N),clonedElement:o.cloneElement,index:n};(E.isNullOrUndefined(e.target.closest("."+vi))||e.target.closest("."+vi).isEqualNode(o.element)||o.dragArea==="."+yi)&&(e.target.closest(o.dragArea)||"Popup"===o.overflowMode?(document.body.style.cursor="",o.dragItem.querySelector("."+Pi).style.visibility="hidden",o.cloneElement.classList.contains(I)&&E.removeClass([o.cloneElement],I)):(document.body.style.cursor="not-allowed",E.addClass([o.cloneElement],I),o.dragItem.classList.contains(I)&&E.removeClass([o.dragItem],I),o.dragItem.querySelector("."+Pi).style.visibility="visible"),"Scrollable"!==o.overflowMode||E.isNullOrUndefined(o.element.querySelector(".e-hscroll"))||(t=o.element.querySelector(".e-scroll-right-nav"),s=o.element.querySelector(".e-scroll-left-nav"),i=o.element.querySelector(".e-hscroll-bar"),!E.isNullOrUndefined(t)&&Math.abs(t.offsetWidth/2+t.offsetLeft)>o.cloneElement.offsetLeft+o.cloneElement.offsetWidth&&(i.scrollLeft-=10),!E.isNullOrUndefined(s)&&Math.abs(s.offsetLeft+s.offsetWidth-o.cloneElement.offsetLeft)>s.offsetWidth/2&&(i.scrollLeft+=10)),o.cloneElement.style.pointerEvents="none",t=E.closest(e.target,"."+N+".e-draggable"),s=0,"Scrollable"!==o.overflowMode||E.isNullOrUndefined(o.element.querySelector(".e-hscroll"))||(s=o.element.querySelector(".e-hscroll-content").offsetWidth),null!=t&&!t.isSameNode(o.dragItem)&&t.closest("."+vi).isSameNode(o.dragItem.closest("."+vi))&&((i=o.getEleIndex(t))<n&&Math.abs(t.offsetLeft+t.offsetWidth-o.cloneElement.offsetLeft)>t.offsetWidth/2&&o.dragAction(t,n,i),n<i)&&Math.abs(t.offsetWidth/2)+t.offsetLeft-s<o.cloneElement.offsetLeft+o.cloneElement.offsetWidth&&o.dragAction(t,n,i),o.droppedIndex=o.getEleIndex(o.dragItem)),o.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(e)},h.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),E.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+yi).classList.contains(ki)&&E.addClass([this.cloneElement],ki),E.removeClass([this.cloneElement.querySelector("."+Pi)],"e-ripple"),E.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||E.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},h.prototype.itemDragStart=function(t){var i=this,e=(this.draggingItems=this.items.map(function(e){return e}),this.dragItem=t.element,{draggedItem:t.element,event:t.event,target:t.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1});this.trigger("onDragStart",e,function(e){e.cancel?(e=t.element.ej2_instances[0],E.isNullOrUndefined(e)||e.intDestroy(t.event),E.detach(i.cloneElement)):(i.removeActiveClass(),E.addClass([i.tbItems.querySelector("."+Ti)],I),i.dragItem.querySelector("."+Pi).style.visibility="hidden")})},h.prototype.dragAction=function(e,t,i){var s,n;0<this.items.length&&(s=this.draggingItems[t],this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)),"MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),i<t&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e):"Extended"===this.overflowMode?e.isSameNode(e.parentElement.lastChild)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)):(s=e.parentElement.lastChild,e.isSameNode(s)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(s,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))),t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},h.prototype.itemDragStop=function(e){var t=this,e=(E.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Pi).style.visibility="visible",document.body.style.cursor="",{draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1});this.trigger("dragged",e,function(e){e.cancel?t.refresh():0<t.items.length&&0<t.draggingItems.length?(t.items=t.draggingItems,t.selectedItem=E.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+Pi).style.visibility="",E.removeClass([t.tbItems.querySelector("."+Ti)],I),t.droppedIndex=E.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.selectTab(t.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},h.prototype.enableTab=function(e,t){var i=E.selectAll("."+N,this.element)[e];E.isNullOrUndefined(i)||(!0===t?(i.classList.remove(Ei,ji),i.firstElementChild.setAttribute("tabindex",i.firstElementChild.getAttribute("data-tabindex"))):(i.classList.add(Ei,ji),i.firstElementChild.removeAttribute("tabindex"),i.classList.contains(d)&&this.select(e+1)),E.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),i.firstElementChild.setAttribute("aria-disabled",!0===t?"false":"true"))},h.prototype.addTab=function(t,i){var s=this,e={addedItems:t,cancel:!1};if(this.isReplace)this.addingTabContent(t,i);else{for(var n=0,r=t;n<r.length;n++){var o=r[n];o.disabled=o.disabled||!1,o.visible=o.visible||!0}this.trigger("adding",e,function(e){e.cancel||s.addingTabContent(t,i)})}this.isReact&&this.renderReactTemplates()},h.prototype.addingTabContent=function(e,n){var t,i,r,o,l,a=this,d=0;this.hdrEle=E.select("."+yi,this.element),E.isNullOrUndefined(this.hdrEle)?(this.items=e,this.reRenderItems(),this.bindDraggable()):(0!==(i=(t=Array.from(E.selectAll(".e-tab-header ."+N,this.element))).length)&&(d=this.getMaxIndicesFromItems(t)+1),i<(n=E.isNullOrUndefined(n)?i-1:n)||n<0||isNaN(n)||(0!==i||E.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),E.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(I),this.tbItems=E.select("."+Hi,this.getTabHeader()),this.isAdd=!0,r=this.parseObject(e,n),this.isAdd=!1,o=0,e.forEach(function(e,t){var i,s;l=e.headerTemplate||e.header.text,E.isNullOrUndefined(e.headerTemplate||e.header)||E.isNullOrUndefined(l)||0===l.length&&!E.isNullOrUndefined(e.header)&&E.isNullOrUndefined(e.header.iconCss)||(r[t]&&(E.isNullOrUndefined(e.id)&&(e.id=Ci+a.tabId+"_"+Ki+(d+t).toString()),r[t].htmlAttributes["data-id"]=e.id),a.items.splice(n+o,0,e),o++),E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.text)||!a.isTemplate&&"Init"!==a.loadOn||(i=d+t,s=a.createElement("div",{id:S+a.tabId+"_"+i,className:Ci,attrs:{role:"tabpanel","aria-labelledby":Ci+"_"+i}}),a.cntEle.insertBefore(s,a.cntEle.children[n+t]),s=a.getTrgContent(a.cntEle,i.toString()),a.getContent(s,e.content,"render",n))}),this.tbObj.addItems(r,n),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===n?this.select(n):(this.setActiveBorder(),this.tbItem=E.selectAll("."+N,this.getTabHeader())),this.bindDraggable()))},h.prototype.removeTab=function(i){var e,s=this,n=E.selectAll("."+N,this.element)[i];E.isNullOrUndefined(n)||(e={removedItem:n,removedIndex:i,cancel:!1},this.trigger("removing",e,function(e){var t;e.cancel||(t=E.select("#"+Ci+s.tabId+"_"+s.extIndex(n.id),E.select("."+Hi,s.element)),E.isNullOrUndefined(t)||s.clearTabTemplate(t,"headerTemplate",N),s.tbObj.removeItems(i),s.allowDragAndDrop&&i!==Array.prototype.indexOf.call(s.itemIndexArray,n.id)&&(i=Array.prototype.indexOf.call(s.itemIndexArray,n.id)),t=s.itemIndexArray.indexOf(n.id),s.items.splice(t,1),s.itemIndexArray.splice(t,1),s.refreshActiveBorder(),t=E.select("#"+S+s.tabId+"_"+s.extIndex(n.id),E.select("."+S,s.element)),E.isNullOrUndefined(t)||(s.clearTabTemplate(t,"content",Ci),E.detach(t)),s.trigger("removed",e),s.draggableItems&&0<s.draggableItems.length&&(s.draggableItems[i].destroy(),s.draggableItems[i]=null,s.draggableItems.splice(i,1)),n.classList.contains(d)?(i=i>E.selectAll("."+N+":not(."+Ri+")",s.element).length-1?i-1:i,s.enableAnimation=!1,s.tbItem=E.selectAll("."+N,s.getTabHeader()),i=s.getSelectingTabIndex(i),i=!isNaN(i)&&0<=i&&s.tbItem.length>i?i:0,s.selectedItem=i,s.select(i)):i!==s.selectedItem&&(i<s.selectedItem&&(i=s.itemIndexArray.indexOf(s.tbItem[s.selectedItem].id),s.setProperties({selectedItem:-1<i?i:s.selectedItem},!0),s.prevIndex=s.selectedItem),s.tbItem=E.selectAll("."+N,s.getTabHeader())),0===E.selectAll("."+N,s.element).length&&(s.hdrEle.style.display="none"),s.enableAnimation=!0)}))},h.prototype.hideTab=function(e,t){var i,s=E.selectAll("."+N,this.element)[e];if(!E.isNullOrUndefined(s)){if(E.isNullOrUndefined(t)&&(t=!0),this.bdrLine.classList.add(I),!0===t)if(s.classList.add(I),0!==(i=E.selectAll("."+N+":not(."+I+")",this.tbItems)).length&&s.classList.contains(d)){if(0!==e)for(var n=e-1;0<=n;n--){if(!this.tbItem[n].classList.contains(I)){this.select(n);break}if(0===n)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(I)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(I)){this.select(r);break}}else 0===i.length&&this.element.classList.add(I);else this.element.classList.remove(I),i=E.selectAll("."+N+":not(."+I+")",this.tbItems),s.classList.remove(I),0===i.length&&this.select(e);this.setActiveBorder(),E.isNullOrUndefined(this.items[e])||(this.items[e].visible=!t,this.dataBind()),E.isNullOrUndefined(s.firstElementChild)||s.firstElementChild.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.refreshOverflow()}},h.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),this.isInteracted=i=void 0===i?!1:i,this.select(e,t)},h.prototype.select=function(t,e){var i=this,s=this.getTabHeader(),s=(this.tbItems=E.select("."+Hi,s),this.tbItem=E.selectAll("."+N,s),this.content=E.select("."+S,this.element),this.prevItem=this.tbItem[this.prevIndex],E.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),this.tbItem[t]),e=(E.isNullOrUndefined(s)?this.selectedID="0":this.selectingID=this.extIndex(s.id),E.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(Ei)||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex")),{event:e,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:E.isNullOrUndefined(this.content)?null:E.select("#"+S+this.tabId+"_"+this.selectedID,this.content),selectingItem:s,selectingIndex:t,selectingContent:E.isNullOrUndefined(this.content)?null:E.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1});this.initRender?this.selectingContent(t,this.isInteracted):this.trigger("selecting",e,function(e){e.cancel||i.selectingContent(t,i.isInteracted)}),this.isInteracted=!1},h.prototype.getSelectingTabIndex=function(e){if(!E.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(Ei)||this.tbItem[e].classList.contains(I)))for(var t=e+1;t<this.items.length;t++){if(!1===this.items[t].disabled&&!0===this.items[t].visible){e=t;break}e=0}return e},h.prototype.selectingContent=function(e,t){var i;"number"==typeof e?(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&0<=e&&!isNaN(e)?(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Ri)&&this.reorderActiveTab?(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!E.isNullOrUndefined(this.items)&&0<this.items.length&&this.allowDragAndDrop&&(this.tbItem=E.selectAll("."+Hi+" ."+N,this.hdrEle),i=this.items[e],this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,i),i=this.itemIndexArray[e],this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,i))):this.setActive(e,null,t)):this.setActive(0,null,t)):e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},h.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},h.prototype.disable=function(e){this.setCssClass(this.element,Ei,e),this.element.setAttribute("aria-disabled",""+e)},h.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},h.prototype.getModuleName=function(){return"tab"},h.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});s<n.length;s++)switch(n[s]){case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(e.width)});break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+yi);""===t.cssClass||E.isNullOrUndefined(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),E.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),E.isNullOrUndefined(r)||(this.setCssClass(r,t.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=i.dragArea}),this.refresh())}},h.prototype.refreshActiveTab=function(){var e,t,i,s,n,r,o,l,a;this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate?(e=this.element.querySelector("."+Hi),l=this.element.querySelector("."+N+"."+d),t=this.getIndexFromEle(l.id),n=l.innerText,s=(r=this.element.querySelector("."+S).querySelector("."+d).children[0]).innerHTML,E.detach(l),E.detach(r),r={className:N+" "+Si+" "+d,id:Ci+this.tabId+"_"+t},n=this.createElement("span",{className:Ai,innerHTML:n,attrs:{role:"presentation"}}).outerHTML,n=this.createElement("div",{className:Di,innerHTML:n+this.btnCls.outerHTML}).outerHTML,l=l.firstElementChild.getAttribute("data-tabindex"),n=this.createElement("div",{className:Pi,innerHTML:n,attrs:{tabIndex:l,"data-tabindex":l,role:"tab","aria-controls":S+this.tabId+"_"+t,"aria-selected":"true","aria-disabled":"false"}}),e.insertBefore(this.createElement("div",r),e.children[t+1]),this.element.querySelector("."+N+"."+d).appendChild(n),r=this.createElement("div",{innerHTML:s}),this.element.querySelector("."+S).querySelector("."+d).appendChild(r)):this.element.querySelector("."+N+"."+d)&&(E.detach(this.element.querySelector("."+N+"."+d).children[0]),E.detach(this.element.querySelector("."+S).querySelector("."+d).children[0]),e=this.items[this.selectedItem],t=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,n=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss,s=e.headerTemplate||e.header.text,a=this.createElement("div",{className:Ai,attrs:{role:"presentation"}}),E.isNullOrUndefined(s.tagName)?this.headerTextCompile(a,s,this.selectedItem):a.appendChild(s),o=this.createElement("span",{className:Ni+" "+Mi+" "+Oi+"-"+t+" "+n}),(i=this.createElement("div",{className:Di})).appendChild(a),""!==s&&void 0!==s&&""!==n?("left"===t||"top"===t?i.insertBefore(o,i.firstElementChild):i.appendChild(o),this.isIconAlone=!1):(""===n?a:o)===o&&(E.detach(a),i.appendChild(o),this.isIconAlone=!0),l=E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),s=e.disabled?{}:{tabIndex:l,"data-tabindex":l,role:"tab","aria-selected":"true","aria-disabled":"false"},i.appendChild(this.btnCls.cloneNode(!0)),(n=this.createElement("div",{className:Pi,attrs:s})).appendChild(i),"top"!==t&&"bottom"!==t||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+N+"."+d).appendChild(n),r=this.createElement("div"),a=void 0,"string"==typeof(o=e.content)||E.isNullOrUndefined(o.innerHTML)?("."===(o="string"==typeof o&&this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(o):o)[0]||"#"===o[0])&&document.querySelectorAll(o).length?(a=(l=document.querySelector(o)).outerHTML.trim(),r.appendChild(l),l.style.display=""):this.compileElement(r,o,"content",this.selectedItem):r.appendChild(o),E.isNullOrUndefined(a)||-1===this.templateEle.indexOf(o.toString())&&this.templateEle.push(o.toString()),this.element.querySelector(".e-item."+d).appendChild(r)),this.isReact&&this.renderReactTemplates()},h.prototype.refreshActiveTabBorder=function(){var e=E.select("."+N+"."+Ri+"."+d,this.element);!E.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},l([E.Collection([],ss)],h.prototype,"items",void 0),l([E.Property("100%")],h.prototype,"width",void 0),l([E.Property("Both")],h.prototype,"swipeMode",void 0),l([E.Property("auto")],h.prototype,"height",void 0),l([E.Property("")],h.prototype,"cssClass",void 0),l([E.Property(0)],h.prototype,"selectedItem",void 0),l([E.Property("Top")],h.prototype,"headerPlacement",void 0),l([E.Property("Content")],h.prototype,"heightAdjustMode",void 0),l([E.Property("Scrollable")],h.prototype,"overflowMode",void 0),l([E.Property("Demand")],h.prototype,"loadOn",void 0),l([E.Property(!1)],h.prototype,"enablePersistence",void 0),l([E.Property(!0)],h.prototype,"enableHtmlSanitizer",void 0),l([E.Property(!1)],h.prototype,"showCloseButton",void 0),l([E.Property(!0)],h.prototype,"reorderActiveTab",void 0),l([E.Property()],h.prototype,"scrollStep",void 0),l([E.Property()],h.prototype,"dragArea",void 0),l([E.Property(!1)],h.prototype,"allowDragAndDrop",void 0),l([E.Property(!0)],h.prototype,"clearTemplates",void 0),l([E.Complex({},Ji)],h.prototype,"animation",void 0),l([E.Event()],h.prototype,"created",void 0),l([E.Event()],h.prototype,"adding",void 0),l([E.Event()],h.prototype,"added",void 0),l([E.Event()],h.prototype,"selecting",void 0),l([E.Event()],h.prototype,"selected",void 0),l([E.Event()],h.prototype,"removing",void 0),l([E.Event()],h.prototype,"removed",void 0),l([E.Event()],h.prototype,"onDragStart",void 0),l([E.Event()],h.prototype,"dragging",void 0),l([E.Event()],h.prototype,"dragged",void 0),l([E.Event()],h.prototype,"destroyed",void 0);var rs,ci=l([E.NotifyPropertyChanges],h);function h(e,t){e=rs.call(this,e,t)||this;return e.show={},e.hide={},e.maxHeight=0,e.title="Close",e.isInteracted=!1,e.lastIndex=0,e.isAdd=!1,e.isIconAlone=!1,e.draggableItems=[],e.resizeContext=e.refreshActiveTabBorder.bind(e),e.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},e}os=function(e,t){return(os=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var os,ls,l=function(e,t){function i(){this.constructor=e}os(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},c=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},as="e-treeview",ds="e-control",u="e-icon-collapsible",O="e-icon-expandable",w="e-list-item",hs="e-list-text",L="e-list-parent",cs="e-hover",ps="e-active",us="e-icons-spinner",ms="e-process",fs="e-icons",gs="e-text-content",vs="e-input",ys="e-input-group",bs="e-tree-input",Cs="e-editing",Ss="e-interaction",Is="e-droppable",Es="e-dragging",xs="e-sibling",Ns="e-drop-in",Os="e-drop-next",ws="e-drop-out",Ls="e-no-drop",ks="e-fullrow",As="e-selected",Ts="e-expanded",Ps="e-node-collapsed",Ds="e-disable",Ms="e-check",Hs="e-stop",Us="e-treeview-checkbox",Rs="e-frame",Bs="e-ripple",js="e-node-focus",qs="e-list-img",Fs="e-animation-active",Ws="e-disabled",Vs="e-prevent",_s={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},zs=(ls=E.ChildProperty,l(Ks,ls),c([E.Property("child")],Ks.prototype,"child",void 0),c([E.Property([])],Ks.prototype,"dataSource",void 0),c([E.Property("expanded")],Ks.prototype,"expanded",void 0),c([E.Property("hasChildren")],Ks.prototype,"hasChildren",void 0),c([E.Property("htmlAttributes")],Ks.prototype,"htmlAttributes",void 0),c([E.Property("iconCss")],Ks.prototype,"iconCss",void 0),c([E.Property("id")],Ks.prototype,"id",void 0),c([E.Property("imageUrl")],Ks.prototype,"imageUrl",void 0),c([E.Property("isChecked")],Ks.prototype,"isChecked",void 0),c([E.Property("parentID")],Ks.prototype,"parentID",void 0),c([E.Property(null)],Ks.prototype,"query",void 0),c([E.Property("selectable")],Ks.prototype,"selectable",void 0),c([E.Property("selected")],Ks.prototype,"selected",void 0),c([E.Property(null)],Ks.prototype,"tableName",void 0),c([E.Property("text")],Ks.prototype,"text",void 0),c([E.Property("tooltip")],Ks.prototype,"tooltip",void 0),c([E.Property("navigateUrl")],Ks.prototype,"navigateUrl",void 0),Ks);function Ks(){return null!==ls&&ls.apply(this,arguments)||this}Xs=E.ChildProperty,l(Gs,Xs),c([E.Property("SlideDown")],Gs.prototype,"effect",void 0),c([E.Property(400)],Gs.prototype,"duration",void 0),c([E.Property("linear")],Gs.prototype,"easing",void 0);var Xs,Ys=Gs;function Gs(){return null!==Xs&&Xs.apply(this,arguments)||this}Qs=E.ChildProperty,l(Zs,Qs),c([E.Complex({effect:"SlideUp",duration:400,easing:"linear"},Ys)],Zs.prototype,"collapse",void 0),c([E.Complex({effect:"SlideDown",duration:400,easing:"linear"},Ys)],Zs.prototype,"expand",void 0);var Qs,Js=Zs;function Zs(){return null!==Qs&&Qs.apply(this,arguments)||this}$s=E.Component,l(p,$s),(en=p).prototype.getModuleName=function(){return"treeview"},p.prototype.preRender=function(){var t=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:O,ariaAttributes:_s,expandIconPosition:"Left",itemCreated:function(e){t.beforeNodeCreate(e)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new E.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),E.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),E.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),E.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},p.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},p.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},p.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},p.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add(Ws),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove(Ws),this.element.setAttribute("aria-disabled","false"))},p.prototype.setEnableRtl=function(){(this.enableRtl?E.addClass:E.removeClass)([this.element],"e-rtl")},p.prototype.setRipple=function(){this.rippleFn=E.rippleEffect(this.element,{selector:".e-fullrow,.e-text-content",ignore:"."+gs+" > ."+fs+",."+ys+",."+vs+", ."+Us});var e={selector:"."+gs+" > ."+fs,isCenterRipple:!0};this.rippleIconFn=E.rippleEffect(this.element,e)},p.prototype.setFullRow=function(e){(e?E.addClass:E.removeClass)([this.element],"e-fullrow-wrap")},p.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},p.prototype.templateComplier=function(t){if(t){this.hasTemplate=!0,this.element.classList.add(Ss);try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}}this.element.classList.remove(Ss)},p.prototype.setDataBinding=function(t){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof x.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(e){i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),t&&(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(),E.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()},p.prototype.getQuery=function(e,t){void 0===t&&(t=null);var i=[];if(e.query)s=e.query.clone();else{for(var s=new x.Query,n=this.getActualProperties(e),r=0,o=Object.keys(n);r<o.length;r++){var l=o[r];"dataSource"!==l&&"tableName"!==l&&"child"!==l&&e[""+l]&&"url"!==l&&-1===i.indexOf(e[""+l])&&i.push(e[""+l])}s.select(i),Object.prototype.hasOwnProperty.call(n,"tableName")&&s.from(e.tableName)}return U.ListBase.addSorting(this.sortOrder,e.text,s),E.isNullOrUndefined(t)||E.isNullOrUndefined(e.parentID)||s.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(t):t),s},p.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof E.getValue(this.fields.id,this.treeData[0])},p.prototype.setRootData=function(){var e;this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType?(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID),e=this.getChildNodes(this.treeData,void 0,!0),E.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e):this.rootData=this.treeData},p.prototype.isChildObject=function(){return"object"==typeof this.fields.child},p.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var t=this.getSortedData(this.rootData),i=(this.ulElement=U.ListBase.createList(this.createElement,e?this.rootData:t,this.listBaseOption),this.element.appendChild(this.ulElement),this.ulElement.querySelectorAll(".e-list-item"));if(!1===this.loadOnDemand)for(var s=0;s<i.length;)this.renderChildNodes(i[parseInt(s.toString(),10)],!0,null,!0),s++;(1===E.selectAll("."+L,this.element).length&&i&&0!==i.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},p.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,t=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.isChecked,"equal",!0,!1)),i=0;i<t.length;i++){var s=t[parseInt(i.toString(),10)][this.fields.id]?t[parseInt(i.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(s)||this.isLoaded||this.checkDisabledState(s,t[i]),t[parseInt(i.toString(),10)][this.fields.hasChildren])for(var s=t[parseInt(i.toString(),10)][this.fields.id],n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.parentID,"equal",s,!1)),r=0;r<n.length;r++){var o=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(o)&&this.autoCheck&&this.checkDisabledState(o,n[r])}}for(i=0;i<this.checkedNodes.length;i++)for(var l=this.fields,a=new x.DataManager(this.treeData).executeLocal((new x.Query).where(l.id,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0)),d=(a[0]&&this.autoCheck&&(this.getCheckedNodeDetails(l,a),this.checkIndeterminateState(a[0])),0<a.length&&(c=a[0][this.fields.id]?a[0][this.fields.id].toString():null,-1<this.checkedNodes.indexOf(c))&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c),new x.DataManager(this.treeData).executeLocal((new x.Query).where(l.parentID,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0))),h=0;h<d.length;h++){var c=d[parseInt(h.toString(),10)][this.fields.id]?d[parseInt(h.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.autoCheck&&this.checkDisabledState(c,d[h]),-1<this.checkedNodes.indexOf(c)&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline){for(h=0;h<this.treeData.length;h++){var p=this.treeData[parseInt(h.toString(),10)][this.fields.id]?this.treeData[parseInt(h.toString(),10)][this.fields.id].toString():"",p=(this.treeData[parseInt(h.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p,this.treeData[h]),-1<this.checkedNodes.indexOf(p)&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p),E.getValue(this.fields.child.toString(),this.treeData[parseInt(h.toString(),10)]));p&&this.updateChildCheckState(p,this.treeData[parseInt(h.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},p.prototype.getCheckedNodeDetails=function(e,t){var i=t[0][this.fields.parentID]?t[0][this.fields.parentID].toString():null,s=0,n=this.element.querySelector('[data-uid="'+t[0][this.fields.id]+'"]'),t=this.element.querySelector('[data-uid="'+t[0][this.fields.parentID]+'"]');if(n||t)t&&!E.select("."+Ms,t)&&this.changeState(t,"indeterminate",null,!0,!0);else{-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i);for(var r=this.getChildNodes(this.treeData,i),o=0;o<r.length;o++){var l=r[parseInt(o.toString(),10)][this.fields.id]?r[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(l)&&s++,s===r.length&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i)}n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.id,"equal",i,!0));this.getCheckedNodeDetails(e,n)}},p.prototype.updateParentCheckState=function(){var i,e=E.selectAll("."+Hs,this.element),t=this.treeData;this.element.classList.contains("e-filtering")&&(t=this.DDTTreeData);for(var s=0;s<e.length;s++){var n=E.closest(e[parseInt(s.toString(),10)],"."+w),r=n.getAttribute("data-uid").toString(),o=void 0,l=(this.element.classList.contains("e-filtering")&&(o=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",r,!0))),i=1===this.dataType?new x.DataManager(t).executeLocal((new x.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(t,r),0);if(i){for(var a=this,d=0;d<i.length;d++)!function(e){var t=i[parseInt(e.toString(),10)][a.fields.id].toString();(-1!==a.checkedNodes.indexOf(t)||a.element.classList.contains("e-filtering")&&-1!==o.findIndex(function(e){return e.id===t}))&&l++}(d);l===i.length?(r=n.getAttribute("data-uid"),-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r),this.changeState(n,"check",null,!0,!0)):0===l&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},p.prototype.checkIndeterminateState=function(e){var t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]');t?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},p.prototype.updateChildCheckState=function(e,t){for(var i=0,s=t[this.fields.id]?t[this.fields.id].toString():"",n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",r=(e[parseInt(n.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(s)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&i++,-1<this.checkedNodes.indexOf(r)&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r),E.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]));r&&r.length&&(-1===this.parentCheckData.indexOf(t)&&this.parentCheckData.push(t),this.updateChildCheckState(r,e[parseInt(n.toString(),10)])),i===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s,t)}if(0!==i&&this.autoCheck){this.checkIndeterminateState(t);for(var o=0;o<this.parentCheckData.length;o++)t!==this.parentCheckData[parseInt(o.toString(),10)]&&this.parentCheckData[parseInt(o.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(o.toString(),10)])}this.parentCheckData=[]},p.prototype.beforeNodeCreate=function(e){this.showCheckBox&&((t=R.createCheckBox(this.createElement,!0,{cssClass:this.touchClass})).classList.add(Us),s=E.select("div."+O+", div."+u,e.item),i=e.item.getAttribute("data-uid"),e.item.childNodes[0].insertBefore(t,e.item.childNodes[0].childNodes[E.isNullOrUndefined(s)?0:1]),s=E.getValue(e.fields.isChecked,e.curData),!(-1<this.checkedNodes.indexOf(i))&&(E.isNullOrUndefined(s)||"true"!==s.toString())?e.item.setAttribute("aria-checked","false"):(E.select("."+Rs,t).classList.add(Ms),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)),i=E.select("."+Rs,t),E.EventHandler.add(i,"mousedown",this.frameMouseHandler,this),E.EventHandler.add(i,"mouseup",this.frameMouseHandler,this)),this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(As)&&e.item.setAttribute("aria-selected","false");var t,i,s=e.fields,s=(this.addActionClass(e,s.selected,As),this.addActionClass(e,s.expanded,Ts),e.item.setAttribute("tabindex","-1"),E.EventHandler.add(e.item,"focus",this.focusIn,this),E.isNullOrUndefined(this.nodeTemplateFn)||(t=e.item.querySelector("."+hs),i=e.item.getAttribute("data-uid"),t.innerHTML="",this.renderNodeTemplate(e.curData,t,i)),{node:e.item,nodeData:e.curData,text:e.text});this.isRefreshed||(this.trigger("drawNode",s),!1!==e.curData[this.fields.selectable])||this.showCheckBox||(e.item.classList.add(Vs),e.item.firstElementChild.setAttribute("style","cursor: not-allowed"))},p.prototype.frameMouseHandler=function(e){var t=E.select(".e-ripple-container",e.target.parentElement);R.rippleMouseHandler(e,t)},p.prototype.addActionClass=function(e,t,i){var s=e.curData,t=E.getValue(t,s);E.isNullOrUndefined(t)||"false"===t.toString()||e.item.classList.add(i)},p.prototype.getDataType=function(e,t){if(this.fields.dataSource instanceof x.DataManager){for(var i=0;i<e.length;i++)if(this.isOffline){if("string"==typeof t.child&&E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)]))&&!E.isNullOrUndefined(E.getValue(t.parentID,e[parseInt(i.toString(),10)])))return 1}else if("string"==typeof t.child&&E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)])))return 1;return 2}for(var i=0,s=e.length;i<s;i++){if("string"==typeof t.child&&(!E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(i.toString(),10)],t.child)))return 2;if(this.isChildObject())return 2;if(!E.isNullOrUndefined(E.getValue(t.parentID,e[parseInt(i.toString(),10)]))||!E.isNullOrUndefined(E.getValue(t.hasChildren,e[parseInt(i.toString(),10)])))return 1}return 1},p.prototype.getGroupedData=function(e,t){for(var t=(new x.Query).group(t),i=U.ListBase.getDataSource(e,t),s=[],n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].items;s.push(r)}return s},p.prototype.getSortedData=function(e){return e=e&&"None"!==this.sortOrder?U.ListBase.getDataSource(e,U.ListBase.addSorting(this.sortOrder,this.fields.text)):e},p.prototype.finalizeNode=function(e,t,i){var s=this;if(t||this.updateAttributes(e),!i){var n=E.selectAll("."+Ts,e);if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[s.fields.expanded]}).length||this.isInitalExpand),!this.isInitalExpand)for(var r=0;r<n.length;r++)this.renderChildNodes(n[parseInt(r.toString(),10)]);E.removeClass(n,Ts)}t||this.updateList(),this.isLoaded&&this.updateCheckedProp()},p.prototype.updateAttributes=function(e){for(var t=E.selectAll("."+qs,e),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].setAttribute("alt",qs);if(this.isLoaded){for(var s=E.selectAll("."+As,e),n=0;n<s.length;n++){this.selectNode(s[parseInt(n.toString(),10)],null);break}E.removeClass(s,As)}for(var r=E.selectAll("."+w+":not(."+Ts+")",e),o=0;o<r.length;o++){var l=E.select("div."+fs,r[parseInt(o.toString(),10)]);l&&l.classList.contains(O)&&this.disableExpandAttr(r[parseInt(o.toString(),10)])}},p.prototype.updateCheckedProp=function(){var e;this.showCheckBox&&(e=[].concat([],this.checkedNodes),this.setProperties({checkedNodes:e},!0))},p.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=E.selectAll("li",this.element),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].classList.contains(w)&&(E.select("."+L,e[parseInt(t.toString(),10)])?this.ensureParentCheckState(e[parseInt(t.toString(),10)]):this.ensureChildCheckState(e[parseInt(t.toString(),10)]));else for(var i=E.selectAll("."+Hs,this.element),t=0;t<i.length;t++)i[parseInt(t.toString(),10)].classList.remove(Hs)},p.prototype.ensureParentCheckState=function(e){var t,i,s,n,r,o,l,a,d,h,c;E.isNullOrUndefined(e)||e.classList.contains(as)||((o=e).classList.contains(w)&&(o=E.select("."+L,e)),l=E.selectAll("."+Us+" ."+Ms,o),t=E.selectAll("."+Hs,o),o=E.selectAll(this.checkDisabledChildren?"."+w:"."+w+":not(."+Ds+")",o),i=e.getElementsByClassName(Us)[0],c=o.length,l=l.length,a=[],d=[],s=e.getAttribute("data-uid"),r=!(n=!0),o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?r=!0:n=!1)}),o=!1,this.element.classList.contains("e-filtering")&&(l=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",s,!0)).length,0<(h=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("hasChildren","equal",!0,!0))).length&&this.OldCheckedData.some(function(e){return e.id===s})&&r&&(l=h.length,o=!0),c=(1===this.dataType?new x.DataManager(this.DDTTreeData).executeLocal((new x.Query).where(this.fields.parentID,"equal",s,!0)):this.getChildNodes(this.DDTTreeData,s)).length),!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof x.DataManager||(a=this.getSelectedChildNodeDetails(s),d=new x.DataManager(this.checkActionNodes).executeLocal((new x.Query).where("parentID","equal",s,!0))),0===c&&0===l)||(c===l||o&&0<c&&d.length===a.length&&0!==d.length&&0!==a.length&&n&&this.autoCheck&&this.showCheckBox?this.changeState(i,"check",null,!0,!0):0<l&&!o&&this.autoCheck&&this.showCheckBox||0<l||0<t.length?this.changeState(i,"indeterminate",null,!0,!0):0===l&&this.changeState(i,"uncheck",null,!0,!0),h=E.closest(e,"."+L),E.isNullOrUndefined(h))||(c=E.closest(h,"."+w),this.ensureParentCheckState(c))},p.prototype.getSelectedChildNodeDetails=function(t){var i=this;return this.checkedNodes.map(function(e){return new x.DataManager(i.DDTTreeData).executeLocal((new x.Query).where("id","equal",e,!0))[0]}).filter(function(e){if(e&&"object"==typeof e&&"pid"in e){e=e.pid;if(!E.isNullOrUndefined(e))return e.toString()===t}return!1})},p.prototype.ensureChildCheckState=function(e,t,i){var s=this;if(!E.isNullOrUndefined(e)){var n=E.select("."+L,e),r=void 0;if(!E.isNullOrUndefined(n)){var o=Array.from(n.querySelectorAll("li")),r=E.selectAll("."+Us,n);this.isFilter&&(r=Array.from(r).filter(function(e){e=e.closest("li").getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),o=Array.from(o).filter(function(e){e=e.getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),0===r.length)&&(r=E.selectAll("."+Us,n),o=Array.from(n.querySelectorAll("li")));for(var l=e.getElementsByClassName(Rs)[0].classList.contains(Ms),a=e.getElementsByClassName(Rs)[0].classList.contains(Hs),d=void 0,h=0;h<r.length;h++){var c,p=o[parseInt(h.toString(),10)].getAttribute("data-uid");E.isNullOrUndefined(this.currentLoadData)||E.isNullOrUndefined(E.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)]))?(c=r[parseInt(h.toString(),10)].getElementsByClassName(Rs)[0].classList.contains(Ms),l||c&&!this.isLoaded||-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(a||l)?d="check":o[parseInt(h.toString(),10)].classList.contains("e-has-child")&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||a)&&-1!==this.parentNodeCheck.indexOf(p)||1===this.dataType&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||a)&&-1!==this.parentNodeCheck.indexOf(p)?(d="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):d="uncheck"):(d=E.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)])?"check":"uncheck","uncheck"===(d=-1!==this.ele?l?"check":"uncheck":d)&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),d="indeterminate")),this.changeState(r[parseInt(h.toString(),10)],d,t,!0,!0)}}this.autoCheck&&this.isLoaded&&!i&&this.updateParentCheckState()}},p.prototype.doCheckBoxAction=function(e,t){if(E.isNullOrUndefined(e)){var i=E.selectAll("."+Us,this.element);if(this.loadOnDemand)for(var s=0;s<i.length;s++)this.updateFieldChecked(i[parseInt(s.toString(),10)],t),this.changeState(i[parseInt(s.toString(),10)],t?"check":"uncheck",null,null,null,t);else for(s=0;s<i.length;s++)this.updateFieldChecked(i[parseInt(s.toString(),10)],t),this.changeState(i[parseInt(s.toString(),10)],t?"check":"uncheck")}else{e.reverse();for(var n=e.length-1;0<=n;n--){var r=this.getElement(e[parseInt(n.toString(),10)]);if(E.isNullOrUndefined(r)){if(""!==(c=e[n-e.length]?e[n-e.length].toString():e[parseInt(n.toString(),10)]?e[parseInt(n.toString(),10)].toString():null)&&t&&c)this.setValidCheckedNode(c,e),this.dynamicCheckState(c,t);else if(-1!==this.checkedNodes.indexOf(c)&&""!==c&&!t){this.checkedNodes.splice(this.checkedNodes.indexOf(c),1);var o=this.getChildNodes(this.treeData,c);if(o){for(var l=0;l<o.length;l++){var a=o[parseInt(l.toString(),10)][this.fields.id]?o[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(a)&&(this.checkedNodes.splice(this.checkedNodes.indexOf(a),1),a=this.element.querySelector('[data-uid="'+a+'"]'))&&this.changeState(a,"uncheck",null)}-1!==this.parentNodeCheck.indexOf(c)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(c),1)}c&&this.dynamicCheckState(c,t),this.updateField(this.treeData,this.fields,c,"isChecked",null)}}else{var d=E.select("."+L+" ."+Us,r);this.validateCheckNode(d,!t,r,null)}}}if(e)for(var h=0;h<e.length-1;h++){var c=e[parseInt(h.toString(),10)]?e[parseInt(h.toString(),10)].toString():"";t||this.updateField(this.treeData,this.fields,c,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},p.prototype.updateFieldChecked=function(e,t){var e=E.closest(e,"."+w),i=e.getAttribute("data-uid");"true"!==this.getNodeData(e).isChecked||t||this.updateField(this.treeData,this.fields,i,"isChecked",null)},p.prototype.dynamicCheckState=function(e,t){if(1===this.dataType){var i=0,s=new x.DataManager(this.treeData).executeLocal((new x.Query).where(this.fields.id,"equal",e,!0));if(s[0]){var n=s[0][this.fields.id]?s[0][this.fields.id].toString():null,s=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.element.querySelector('[data-uid="'+s+'"]'),o=this.element.querySelector('[data-uid="'+n+'"]'),l=this.getChildNodes(this.treeData,s);if(l)for(var a=0;a<l.length;a++){var d=l[parseInt(a.toString(),10)][this.fields.id]?l[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&i++}-1!==this.checkedNodes.indexOf(e)&&r&&n===e&&this.autoCheck?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&o&&n===e&&!t?this.changeState(o,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&o&&n===e&&t?this.changeState(o,"check",null):-1===this.checkedNodes.indexOf(e)&&!o&&r&&n===e&&this.autoCheck&&0!==i?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!o&&r&&n===e&&this.autoCheck&&0===i?this.changeState(r,"uncheck",null):o||r||n!==e||!this.autoCheck||this.updateIndeterminate(e,t)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline)for(n=void 0,r=void 0,a=0;a<this.treeData.length;a++){n=this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():"",h=(r=this.element.querySelector('[data-uid="'+n+'"]'))?E.select("."+Ms,r):null,-1===this.checkedNodes.indexOf(n)&&r&&h&&!t&&this.changeState(r,"uncheck",null);var h=E.getValue(this.fields.child.toString(),this.treeData[parseInt(a.toString(),10)]);h&&this.updateChildIndeterminate(h,n,e,t,n)}},p.prototype.updateIndeterminate=function(e,t){var i,e=this.getTreeData(e),s=0,n=(1===this.dataType&&(i=e[0][this.fields.parentID]?e[0][this.fields.parentID].toString():null),this.getChildNodes(this.treeData,i));if(n)for(var r=0;r<n.length;r++){var o=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&s++}e=this.element.querySelector('[data-uid="'+i+'"]');e&&t||!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0!==s?this.changeState(e,"indeterminate",null):!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0===s?this.changeState(e,"uncheck",null):e||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?(t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)||!t&&-1!==this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)&&0!==s)&&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)},p.prototype.updateChildIndeterminate=function(e,t,i,s,n){for(var r=0,o=0;o<e.length;o++){var l=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",a=(-1!==this.checkedNodes.indexOf(l)&&r++,this.element.querySelector('[data-uid="'+t+'"]')),d=a?E.select("."+Hs,a):null,h=a?E.select("."+Ms,a):null,c=this.element.querySelector('[data-uid="'+l+'"]'),p=c?E.select("."+Ms,c):null,h=(-1!==this.checkedNodes.indexOf(i)&&a&&l===i&&this.autoCheck?this.changeState(a,"indeterminate",null):-1!==this.checkedNodes.indexOf(i)||!a||c||l!==i||s?-1===this.checkedNodes.indexOf(i)&&c&&l===i&&!s?this.changeState(c,"uncheck",null):-1===this.checkedNodes.indexOf(i)&&d&&l===i&&this.autoCheck&&0===r&&!s?d.classList.remove(Hs):-1===this.checkedNodes.indexOf(i)&&!c&&h&&l===i&&0===r?this.changeState(a,"uncheck",null):-1===this.checkedNodes.indexOf(l)&&c&&p&&0===r?this.changeState(c,"uncheck",null):(!c&&!a&&l===i||-1!==this.parentNodeCheck.indexOf(t)&&this.autoCheck)&&(d=this.element.querySelector('[data-uid="'+n+'"]'),s&&0!==r?this.changeState(d,"indeterminate",null):s&&r===e.length&&-1===this.checkedNodes.indexOf(t)?this.checkDisabledState(t):s||0!==r||-1===this.parentNodeCheck.indexOf(t)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(t)),-1===this.parentNodeCheck.indexOf(t))&&this.parentNodeCheck.push(t):!this.autoCheck&&0!==r?this.changeState(a,"indeterminate",null):this.changeState(a,"uncheck",null),E.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]));h&&this.updateChildIndeterminate(h,l,i,s,n)}},p.prototype.changeState=function(t,i,s,n,r,o){var e,l=this,a=E.closest(t,"."+w);!this.checkDisabledChildren&&a&&(a.classList.contains(Ds)||this.disableNode&&-1!==this.disableNode.indexOf(a.getAttribute("data-uid")))||(t===a&&(t=E.select("."+Us,a)),n?this.nodeCheckAction(t,i,a,e,s,n,r,o):(this.checkActionNodes=[],e=this.getCheckEvent(a,i,s),this.trigger("nodeChecking",e,function(e){e.cancel||l.nodeCheckAction(t,i,a,e,s,n,r,o)})))},p.prototype.nodeCheckAction=function(e,t,i,s,n,r,o,l){var a,e=e.getElementsByClassName(Rs)[0];"check"!==t||e.classList.contains(Ms)?"uncheck"===t&&(e.classList.contains(Ms)||e.classList.contains(Hs))?(E.removeClass([e],[Ms,Hs]),this.removeCheck(i),a="false"):"indeterminate"===t&&this.autoCheck&&(e.classList.remove(Ms),e.classList.add(Hs),this.removeCheck(i),a="mixed"):(e.classList.remove(Hs),e.classList.add(Ms),this.addCheck(i),a="true"),E.isNullOrUndefined(a="check"===t?"true":"uncheck"===t?"false":a)||i.setAttribute("aria-checked",a),o&&(e=[].concat([],this.checkActionNodes),s=this.getCheckEvent(i,t,n),E.isUndefined(r))&&(s.data=e),void 0!==l&&this.ensureStateChange(i,l),r||E.isNullOrUndefined(a)||(i.setAttribute("aria-checked",a),s.data[0].checked=a,this.trigger("nodeChecked",s),this.checkActionNodes=[])},p.prototype.addCheck=function(e){e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.checkedNodes.indexOf(e)||this.checkDisabledState(e)},p.prototype.removeCheck=function(e){e=this.checkedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.checkedNodes.splice(e,1)},p.prototype.getCheckEvent=function(e,t,i){this.checkActionNodes.push(this.getNodeData(e));var s=this.checkActionNodes;return{action:t,cancel:!1,isInteracted:!E.isNullOrUndefined(i),node:e,data:s}},p.prototype.finalize=function(){var e=E.select("."+L,this.element);E.isNullOrUndefined(e)||(e.setAttribute("role",_s.treeRole),this.setMultiSelect(this.allowMultiSelection),(e=E.select("."+w,this.element))&&(e.setAttribute("tabindex","0"),this.updateIdAttr(null,e)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction())},p.prototype.setTextWrap=function(){(this.allowTextWrap?E.addClass:E.removeClass)([this.element],"e-text-wrap"),E.Browser.isIE&&(this.allowTextWrap?E.addClass:E.removeClass)([this.element],"e-ie-wrap")},p.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var t=e?E.selectAll("."+w,e):this.liList,i=t.length,s=0;s<i;s++)this.calculateWrap(t[parseInt(s.toString(),10)])},p.prototype.calculateWrap=function(e){e=E.select("."+ks,e);e&&e.nextElementSibling&&(e.style.height=this.allowTextWrap?e.nextElementSibling.offsetHeight+"px":"")},p.prototype.doExpandAction=function(){var t=this,e=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[t.fields.expanded]}).length||this.isInitalExpand),this.isInitalExpand&&0<e.length)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof x.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s,n=E.select('[data-uid="'+e[parseInt(i.toString(),10)]+'"]',this.element);E.isNullOrUndefined(n)?e[parseInt(i.toString(),10)]&&-1===this.expandChildren.indexOf(e[parseInt(i.toString(),10)])&&this.expandChildren.push(e[parseInt(i.toString(),10)].toString()):(s=E.select("."+O,E.select("."+gs,n)),E.isNullOrUndefined(s)||this.expandAction(n,s,null))}this.afterFinalized()}else this.afterFinalized()},p.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),0<this.index&&(this.index=0)},p.prototype.expandCallback=function(e,t){var i,e=E.select('[data-uid="'+e+'"]',this.element);E.isNullOrUndefined(e)||(i=E.select("."+O,E.select("."+gs,e)),E.isNullOrUndefined(i))||this.expandAction(e,i,null,!1,t),t()},p.prototype.afterFinalized=function(){var e;this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,this.isLoaded&&!this.isFieldChange||this.isNodeDropped||(e={data:this.treeData},this.trigger("dataBound",e)),this.isLoaded=!0,this.isNodeDropped=!1},p.prototype.doSelectionAction=function(){var e=E.selectAll("."+As,this.element),t=this.selectedNodes;if(0<t.length){this.setProperties({selectedNodes:[]},!0);for(var i=0;i<t.length;i++){var s=E.select('[data-uid="'+t[parseInt(i.toString(),10)]+'"]',this.element);if(s&&!s.classList.contains("e-active")?this.selectNode(s,null,!0):this.selectedNodes.push(t[parseInt(i.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);E.removeClass(e,As)},p.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},p.prototype.clickHandler=function(e){var t=E.Browser.isDevice&&e.originalEvent.changedTouches&&!E.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(E.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),t&&!this.dragStartAction){var i=t.classList,s=E.closest(t,"."+w);if(s&&(!s.classList.contains(Vs)||i.contains(O)||i.contains(u))){if(3!==e.originalEvent.which){var n=E.select(".e-ripple-element",s),r=E.select("."+fs,s);if(this.removeHover(),this.setFocusElement(s),this.showCheckBox&&!s.classList.contains("e-disable")){var o,l=E.closest(t,"."+Us);if(!E.isNullOrUndefined(l))return o=E.select("."+Rs,l),this.validateCheckNode(l,o.classList.contains(Ms),s,e.originalEvent),void this.triggerClickEvent(e.originalEvent,s)}i.contains(O)?this.expandAction(s,t,e):i.contains(u)?this.collapseNode(s,t,e):n&&r?r.classList.contains(Bs)&&r.classList.contains(O)?this.expandAction(s,r,e):r.classList.contains(Bs)&&r.classList.contains(u)?this.collapseNode(s,r,e):i.contains(L)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1):i.contains(L)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,s)}}},p.prototype.nodeCheckedEvent=function(e,t,i){e=this.getCheckEvent(e,t?"uncheck":"check",i);e.data=e.data.splice(0,e.data.length-1),this.trigger("nodeChecked",e)},p.prototype.updateOldCheckedData=function(e){var t,i=this,e=new x.DataManager(e),s=e.executeLocal((new x.Query).where("isChecked","equal","true",!0)),n=e.executeLocal((new x.Query).where("isChecked","equal","false",!0));if(0<n.length&&-1!==(t=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id})))return this.OldCheckedData.splice(t,1),void(0<(e=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id})).length&&e.forEach(function(t){var e=i.OldCheckedData.findIndex(function(e){return e.id===t.id});-1!==e&&i.OldCheckedData.splice(e,1)}));0<s.length&&-1===(t=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id}))&&this.OldCheckedData.push(s[0])},p.prototype.triggerClickEvent=function(e,t){this.trigger("nodeClicked",{event:e,node:t})},p.prototype.expandNode=function(e,t,i){var s,n,r,o,l,a=this;this.renderReactTemplates(),t.classList.contains(us)&&this.hideSpinner(t),this.initialRender||t.classList.add("interaction"),!0!==i||!0===i&&e.classList.contains("e-expanded")?!0!==this.preventExpand&&(E.removeClass([t],O),E.addClass([t],u),n=s=0,r=E.select("."+L,e),o=e,this.isAnimate&&!this.isRefreshed?(this.setHeight(o,r),l=E.select("."+w+"."+ps,e),this.aniObj.animate(r,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===E.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){o.style.overflow="hidden",!E.isNullOrUndefined(l)&&l instanceof HTMLElement&&l.classList.add(Fs),s=o.offsetHeight,n=E.select("."+gs,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,s,n)},end:function(e){e.element.style.display="block",!E.isNullOrUndefined(l)&&l instanceof HTMLElement&&l.classList.remove(Fs),a.expandedNode(o,r,t)}})):this.expandedNode(o,r,t)):(E.select("."+L,e).style.display="none",this.fields.dataSource instanceof x.DataManager==!0&&(this.preventExpand=!1)),this.initialRender&&t.classList.add("interaction")},p.prototype.expandedNode=function(e,t,i){t.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",E.removeClass([i],ms),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},p.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),E.removeClass([e],Ps);e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.expandedNodes.indexOf(e)||this.expandedNodes.push(e)},p.prototype.collapseNode=function(t,i,e){var s,n=this;i.classList.contains(ms)||(E.addClass([i],ms),this.isLoaded?(s=this.getExpandEvent(t,e),this.isInteracted=s.isInteracted,this.trigger("nodeCollapsing",s,function(e){e.cancel?E.removeClass([i],ms):n.nodeCollapseAction(t,i,e)})):this.nodeCollapseAction(t,i,s))},p.prototype.nodeCollapseAction=function(e,t,i){var s=this,n=(E.removeClass([t],u),E.addClass([t],O),0),r=0,o=E.select("."+L,e),l=e,a=E.select("."+w+"."+ps,e);this.isAnimate?this.aniObj.animate(o,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===E.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){l.style.overflow="hidden",!E.isNullOrUndefined(a)&&a instanceof HTMLElement&&a.classList.add(Fs),n=E.select("."+gs,e).offsetHeight,r=l.offsetHeight},progress:function(e){s.animateHeight(e,n,r)},end:function(e){e.element.style.display="none",!E.isNullOrUndefined(a)&&a instanceof HTMLElement&&a.classList.remove(Fs),s.collapsedNode(l,o,t,i)}}):this.collapsedNode(l,o,t,i)},p.prototype.collapsedNode=function(e,t,i,s){t.style.display="none",e.style.overflow="",e.style.height="",E.removeClass([i],ms),this.removeExpand(e),this.isLoaded&&((s=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",s))},p.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);t=this.expandedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.expandedNodes.splice(t,1)},p.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),E.addClass([e],Ps)},p.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=""},p.prototype.animateHeight=function(e,t,i){var s=(e.duration-e.timeStamp)/e.duration;e.element.parentElement.style.height=(i-t)*s+t+"px"},p.prototype.renderChildNodes=function(t,i,s,n,e){var r,o,l,a=this,d=E.select("div."+fs,t);E.isNullOrUndefined(d)||(this.showSpinner(d),this.fields.dataSource instanceof x.DataManager?(o=this.parents(t,"."+L).length,l=this.getChildFields(this.fields,o,1),E.isNullOrUndefined(l)||E.isNullOrUndefined(l.dataSource)?(E.detach(d),this.removeExpand(t,!0)):(this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager&&this.isOffline?(this.treeList.pop(),r=this.getChildNodes(this.treeData,t.getAttribute("data-uid")),this.loadChild(r,l,d,t,i,s,n)):l.dataSource.executeQuery(this.getQuery(l,t.getAttribute("data-uid"))).then(function(e){a.treeList.pop(),r=e.result,1===a.dataType&&(a.dataType=2),a.loadChild(r,l,d,t,i,s,n)}).catch(function(e){a.trigger("actionFailure",{error:e})}))):(r=this.getChildNodes(this.treeData,t.getAttribute("data-uid"),!1,parseFloat(t.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(r),E.isNullOrUndefined(r)||0===r.length?(E.detach(d),d.classList.contains(us)&&this.hideSpinner(d),this.removeExpand(t,!0)):(this.listBaseOption.ariaAttributes.level=parseFloat(t.getAttribute("aria-level"))+1,t.appendChild(U.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(t,d,n),this.setSelectionForChildNodes(r),this.ensureCheckNode(t,e),this.finalizeNode(t,e,i),this.disableTreeNodes(r),this.renderSubChild(t,i,n,e))))},p.prototype.loadChild=function(e,t,i,s,n,r,o){this.currentLoadData=e,E.isNullOrUndefined(e)||0===e.length?(E.detach(i),this.removeExpand(s,!0)):(this.updateListProp(t),this.fields.dataSource instanceof x.DataManager&&!this.isOffline&&(t=s.getAttribute("data-uid"),t=this.getNodeObject(t),E.setValue("child",e,t)),this.listBaseOption.ariaAttributes.level=parseFloat(s.getAttribute("aria-level"))+1,s.appendChild(U.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(s,i,o),this.setSelectionForChildNodes(e),this.ensureCheckNode(s),this.finalizeNode(s),this.disableTreeNodes(e),this.renderSubChild(s,n,o)),r&&r(),n&&this.expandedNodes.push(s.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.disableTreeNodes=function(e){if(!E.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},p.prototype.setSelectionForChildNodes=function(e){if(!E.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},p.prototype.ensureCheckNode=function(e,t){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck)&&(this.ensureChildCheckState(e,null,t),t&&!E.select("."+Ms,this.element)&&!E.select("."+Hs,this.element)||this.ensureParentCheckState(e)),this.currentLoadData=null},p.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildMapper=function(e){return"string"==typeof e.child||E.isNullOrUndefined(e.child)?e:e.child},p.prototype.getChildNodes=function(e,t,i,s){var n,r=this;if(void 0===i&&(i=!1),!E.isNullOrUndefined(e)){if(1===this.dataType)return this.getChildGroup(this.groupedData,t,i);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,t)||this.findNestedChildNodes(e,t,s)||[];if(this.isChildObject()){for(var o=E.isNullOrUndefined(s)?this.fields.child:this.fields,l=1;l<s&&!E.isNullOrUndefined(o.child);)o=o.child,l++;this.updateListProp(o);i=e.findIndex(function(e){return E.getValue(r.fields.id,e)&&E.getValue(r.fields.id,e).toString()===t});if(-1!==i)return E.getValue("child",e[parseInt(i.toString(),10)]);if(-1===i)for(var a=0,d=e.length;a<d;a++){var h=E.getValue("child",e[parseInt(a.toString(),10)]),c=E.isNullOrUndefined(h)?-1:h.findIndex(function(e){return E.getValue(r.fields.child.id,e)&&E.getValue(r.fields.child.id,e).toString()===t});if(-1!==c)return E.getValue("child",h[parseInt(c.toString(),10)]);if(!E.isNullOrUndefined(h)&&void 0!==(n=this.getChildNodes(h,t,!1,s)))break}}}return n},p.prototype.findChildNodes=function(e,t,i){var s=e.findIndex(function(e){e=E.getValue(t,e);return e&&e.toString()===i});return-1!==s?E.getValue(this.fields.child,e[s]):null},p.prototype.findNestedChildNodes=function(e,t,i){for(var s=0,n=e;s<n.length;s++){var r=n[s],r=E.getValue(this.fields.child,r);if(!E.isNullOrUndefined(r)){var o=this.findChildNodes(r,this.fields.id,t);if(o)return o;o=this.getChildNodes(r,t,!1,i);if(o&&0<o.length)return o}}},p.prototype.getChildGroup=function(e,t,i){if(!E.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){if(E.isNullOrUndefined(e[parseInt(s.toString(),10)][0])||E.isNullOrUndefined(E.getValue(this.fields.parentID,e[parseInt(s.toString(),10)][0])))return i?e[parseInt(s.toString(),10)]:[];if(E.getValue(this.fields.parentID,e[parseInt(s.toString(),10)][0]).toString()===t)return e[parseInt(s.toString(),10)]}},p.prototype.renderSubChild=function(e,t,i,s){if(t)for(var n=E.selectAll("."+O,e),r=0,o=n.length;r<o;r++){var l=n[parseInt(r.toString(),10)];e.querySelector(".e-icons")!==n[parseInt(r.toString(),10)]&&(l=E.closest(l,"."+w),this.expandArgs=this.getExpandEvent(l,null),!0!==i&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(l,t,null,i,s))}},p.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))},p.prototype.isActive=function(e){return!!e.classList.contains(ps)},p.prototype.selectNode=function(t,i,s){var e,n=this;E.isNullOrUndefined(t)||!this.allowMultiSelection&&this.isActive(t)&&!E.isNullOrUndefined(i)?this.setFocusElement(t):this.isLoaded?(e=this.getSelectEvent(t,"select",i),this.trigger("nodeSelecting",e,function(e){e.cancel||e.node.classList.contains(Vs)||n.nodeSelectAction(t,i,e,s)})):this.nodeSelectAction(t,i,e,s)},p.prototype.nodeSelectAction=function(e,t,i,s){if(this.allowMultiSelection&&(s||t&&(t.ctrlKey||t.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&t&&t.shiftKey){this.startNode||(this.startNode=e);var s=this.liList.indexOf(this.startNode),n=this.liList.indexOf(e);n<s&&(t=s,s=n,n=t);for(var r=s;r<=n;r++){var o=this.liList[parseInt(r.toString(),10)];E.isVisible(o)&&!o.classList.contains("e-disable")&&this.addSelect(o)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(i.nodeData=this.getNodeData(e),this.trigger("nodeSelected",i),this.isRightClick=!1),this.isRightClick=!1},p.prototype.unselectNode=function(t,e){var i,s=this;this.isLoaded?(i=this.getSelectEvent(t,"un-select",e),this.trigger("nodeSelecting",i,function(e){e.cancel||s.nodeUnselectAction(t,e)})):this.nodeUnselectAction(t,i)},p.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},p.prototype.setFocusElement=function(e){var t;E.isNullOrUndefined(e)||((t=this.getFocusedNode())&&(E.removeClass([t],js),t.setAttribute("tabindex","-1")),E.addClass([e],js),e.setAttribute("tabindex","0"),E.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(t,e))},p.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),E.addClass([e],ps);e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.selectedNodes.indexOf(e)||this.selectedNodes.push(e)},p.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),E.removeClass([e],ps);e=this.selectedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.selectedNodes.splice(e,1)},p.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+ps),t=0,i=e;t<i.length;t++){var s=i[t];this.allowMultiSelection?s.setAttribute("aria-selected","false"):s.removeAttribute("aria-selected")}E.removeClass(e,ps),this.setProperties({selectedNodes:[]},!0)},p.prototype.getSelectEvent=function(e,t,i){var s=this.getNodeData(e);return{action:t,cancel:!1,isInteracted:!E.isNullOrUndefined(i),node:e,nodeData:s}},p.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?E.Browser.isDevice?"Click":"DblClick":this.expandOn},p.prototype.expandHandler=function(e){var t=E.Browser.isDevice&&e.originalEvent.changedTouches&&!E.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!t||t.classList.contains(vs)||t.classList.contains(as)||t.classList.contains(L)||t.classList.contains(w)||t.classList.contains(fs)||this.showCheckBox&&E.closest(t,"."+Us)||this.expandCollapseAction(E.closest(t,"."+w),e)},p.prototype.expandCollapseAction=function(e,t){var i,s=E.select("div."+fs,e);s&&!s.classList.contains(ms)&&((i=s.classList).contains(O)?this.expandAction(e,s,t):i.contains(u)&&this.collapseNode(e,s,t))},p.prototype.expandAction=function(t,i,e,s,n,r){var o=this;i.classList.contains(ms)||(E.addClass([i],ms),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(t,e),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(e){e.cancel?E.removeClass([i],ms):o.nodeExpandAction(t,i,s,n,r)})):this.nodeExpandAction(t,i,s,n,r))},p.prototype.nodeExpandAction=function(e,t,i,s,n){var r=E.select("."+L,e);if(r&&"UL"===r.nodeName)this.expandNode(e,t);else{this.isFirstRender=!0,this.renderChildNodes(e,i,s,null,n);for(var o=E.selectAll("."+w,e),l=0;l<o.length;l++){var a,d=this.getId(o[parseInt(l.toString(),10)]);-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren&&(a=E.select("."+O,E.select("."+gs,o[parseInt(l.toString(),10)])),E.isNullOrUndefined(a)||this.expandAction(o[parseInt(l.toString(),10)],a,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1))}}},p.prototype.keyActionHandler=function(i){var s=this,e=i.target,n=this.getFocusedNode();e&&e.classList.contains(vs)?(e=e,"enter"===i.action?e.blur():"escape"===i.action&&(e.value=this.oldText,e.blur())):(i.preventDefault(),e={cancel:!1,event:i,node:n},this.trigger("keyPress",e,function(e){if(!e.cancel)switch(i.action){case"space":s.showCheckBox?s.checkNode(i):s.toggleSelect(n,i);break;case"moveRight":s.openNode(!s.enableRtl,i);break;case"moveLeft":s.openNode(!!s.enableRtl,i);break;case"shiftDown":s.shiftKeySelect(!0,i);break;case"moveDown":case"ctrlDown":case"csDown":s.navigateNode(!0);break;case"shiftUp":s.shiftKeySelect(!1,i);break;case"moveUp":case"ctrlUp":case"csUp":s.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":s.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":s.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":s.toggleSelect(n,i);break;case"f2":s.allowEditing&&!n.classList.contains("e-disable")&&s.createTextbox(n);break;case"ctrlA":var t;s.allowMultiSelection&&(t=E.selectAll("."+w+":not(."+ps+")",s.element),s.selectGivenNodes(t))}}))},p.prototype.navigateToFocus=function(e){var t,i=this.getFocusedNode().querySelector("."+gs),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);E.isNullOrUndefined(n)||(t=n.getBoundingClientRect(),s.bottom>t.bottom?n.scrollTop+=s.bottom-t.bottom:s.top<t.top&&(n.scrollTop-=t.top-s.top)),this.isVisibleInViewport(i)||i.scrollIntoView(e)},p.prototype.isVisibleInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},p.prototype.getScrollParent=function(e){return E.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},p.prototype.shiftKeySelect=function(e,t){var i;this.allowMultiSelection?(i=this.getFocusedNode(),i=e?this.getNextNode(i):this.getPrevNode(i),this.removeHover(),this.setFocusElement(i),this.toggleSelect(i,t,!1),this.navigateToFocus(!e)):this.navigateNode(e)},p.prototype.checkNode=function(e){var t=this.getFocusedNode(),i=E.select("."+Us,t),s=E.select(" ."+Rs,i).classList.contains(Ms);t.classList.contains("e-disable")||0===t.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(i,s,t,e)},p.prototype.validateCheckNode=function(t,i,s,n){var r=this,e=E.closest(t,"."+w),o=(this.checkActionNodes=[],i?"false":"true"),o=(E.isNullOrUndefined(o)||e.setAttribute("aria-checked",o),this.getCheckEvent(e,i?"uncheck":"check",n));this.trigger("nodeChecking",o,function(e){e.cancel||r.nodeCheckingAction(t,i,s,e,n)})},p.prototype.nodeCheckingAction=function(e,t,i,s,n){var r;-1===this.checkedElement.indexOf(i.getAttribute("data-uid"))&&(this.checkedElement.push(i.getAttribute("data-uid")),this.autoCheck)&&(null!==(r=this.getChildNodes(this.treeData,i.getAttribute("data-uid")))?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null),this.changeState(e,t?"uncheck":"check",n,!0),this.autoCheck&&(this.ensureChildCheckState(i),this.updateOldCheckedData([this.getNodeData(i)]),this.ensureParentCheckState(E.closest(E.closest(i,"."+L),"."+w)),r=void 0,"check"===s.action?r=!0:"uncheck"===s.action&&(r=!1),this.ensureStateChange(i,r)),this.nodeCheckedEvent(e,t,n)},p.prototype.ensureStateChange=function(e,t){var i=this,s=E.select("."+L,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck){var o=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.parentID,"equal",n,!0)),e=o.filter(function(e){return-1!==i.checkedNodes.indexOf(e[r.id].toString())},this);-1!==this.checkedNodes.indexOf(n)&&e.length!==o.length&&this.isFilter&&0<e.length&&(o=e);for(var l=0;l<o.length;l++){var a,d=o[parseInt(l.toString(),10)][this.fields.id]?o[parseInt(l.toString(),10)][this.fields.id].toString():null,h=o[parseInt(l.toString(),10)][this.fields.isChecked]?o[parseInt(l.toString(),10)][this.fields.isChecked].toString():null;-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)?(this.checkDisabledState(d,o[l]),a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)?(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))&&(h=this.getChildNodes(this.treeData,d),this.getChildItems(h,t),-1!==this.parentNodeCheck.indexOf(d))&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):(a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t))}}else if(1!==this.dataType||this.autoCheck)(a=this.getChildNodes(this.treeData,n))&&(0<(e=a.filter(function(e){e=String(e[Object.keys(e)[0]]);return-1!==i.checkedNodes.indexOf(e)})).length&&a.length&&this.isFilter&&(a=e),this.childStateChange(a,n,s,t));else if(t)for(l=0;l<this.treeData.length;l++){var c=this.treeData[parseInt(l.toString(),10)][this.fields.id]?this.treeData[parseInt(l.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.checkDisabledState(c,this.treeData[l])}else{for(var p=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.isChecked,"equal",!0,!1)),l=0;l<p.length;l++){var u=p[parseInt(l.toString(),10)][this.fields.id]?p[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(u)&&this.checkedNodes.splice(this.checkedNodes.indexOf(u),1),this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.checkedNodes=[]}},p.prototype.checkDisabledState=function(e,t){var i,s=this.checkDisabledChildren;s||(i=!0,this.loadOnDemand&&this.fields.htmlAttributes&&(t=E.isNullOrUndefined(t)?t:this.getNodeObject(e),E.isNullOrUndefined(t)||(t=t[this.fields.htmlAttributes])&&!E.isNullOrUndefined(t.class)&&-1!==t.class.indexOf(Ds)&&(i=!1)),s=(t=E.select('[data-uid="'+e+'"]',this.element))?!t.classList.contains(Ds):-1===this.disableNode.indexOf(e)&&i),s&&this.checkedNodes.push(e)},p.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null,n=(-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null),this.getChildNodes(this.treeData,s));0<n.length&&this.getChildItems(n,t)}},p.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",o=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null,o=(this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-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"===o&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[])),this.getChildNodes([e[parseInt(n.toString(),10)]],r));o&&this.childStateChange(o,t,i,s)}},p.prototype.allCheckNode=function(e,t,i,s,n){if(e)for(var r=0;r<e.length;r++){var o,l=E.getValue(this.fields.id,e[parseInt(r.toString(),10)]),a=this.element.querySelector('[data-uid="'+l+'"]'),a=(!1===n||-1!==this.checkedElement.indexOf(l.toString())||(null!==a||E.isNullOrUndefined(e[parseInt(r.toString(),10)][this.fields.isChecked])||-1!==t.indexOf(l.toString()))&&0!==s&&2!==i||(!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?t.push(l.toString()):s=null,s=!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?0:null),-1===t.indexOf(l.toString())&&E.isNullOrUndefined(i)&&t.push(l.toString()),E.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]));(!0===E.getValue(this.fields.hasChildren,e[parseInt(r.toString(),10)])||a)&&(l=E.getValue(this.fields.id,e[parseInt(r.toString(),10)]),o=void 0,o=1===this.dataType?this.getChildNodes(this.treeData,l.toString()):a)&&(E.isNullOrUndefined(n)?this.allCheckNode(o,t,i,s):this.allCheckNode(o,t,i,s,n),s=null),s=null}},p.prototype.openNode=function(e,t){var i=this.getFocusedNode(),s=E.select("div."+fs,i);e?s&&(s.classList.contains(O)?this.expandAction(i,s,t):this.focusNextNode(i,!0)):s&&s.classList.contains(u)?this.collapseNode(i,s,t):(e=E.closest(E.closest(i,"."+L),"."+w))&&!e.classList.contains("e-disable")&&(this.setFocus(i,e),this.navigateToFocus(!0))},p.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},p.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))},p.prototype.getFocusedNode=function(){var e,t,i=E.select("."+w+'[tabindex="0"]',this.element);return E.isNullOrUndefined(i)||"mixed"!==(t=i.getAttribute("aria-checked"))&&"false"!==t||(this.isFilter=!1),E.isNullOrUndefined(i)&&(e=E.select("."+w,this.element)),E.isNullOrUndefined(i)?E.isNullOrUndefined(e)?this.element.firstElementChild:e:i},p.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")&&(e=i.lastChild,null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")||null==i.nextSibling&&e.classList.contains(gs)?this.focusNextNode(i,!1):this.focusNextNode(i,t))},p.prototype.getNextNode=function(e){var t,i=this.liList.indexOf(e);do{if(i++,t=this.liList[parseInt(i.toString(),10)],E.isNullOrUndefined(t))return e}while(!E.isVisible(t));return t},p.prototype.getPrevNode=function(e){var t,i=this.liList.indexOf(e);do{if(i--,t=this.liList[parseInt(i.toString(),10)],E.isNullOrUndefined(t))return e}while(!E.isVisible(t));return t},p.prototype.getRootNode=function(){for(var e,t=0;e=this.liList[parseInt(t.toString(),10)],t++,!E.isVisible(e););return e},p.prototype.getEndNode=function(){for(var e,t=this.liList.length-1;e=this.liList[parseInt(t.toString(),10)],t--,!E.isVisible(e););return e},p.prototype.setFocus=function(e,t){E.removeClass([e],js),e.setAttribute("tabindex","-1"),t.classList.contains("e-disable")||(E.addClass([t],js),t.setAttribute("tabindex","0"),t.focus(),E.EventHandler.add(t,"blur",this.focusOut,this),this.updateIdAttr(e,t))},p.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")},p.prototype.focusIn=function(){var e;this.mouseDownStatus||((e=this.getFocusedNode()).classList.contains("e-disable")?(e.setAttribute("tabindex","-1"),this.navigateNode(!0)):(e.setAttribute("tabindex","0"),E.addClass([e],js),E.EventHandler.add(e,"blur",this.focusOut,this)),this.mouseDownStatus=!1)},p.prototype.focusOut=function(e){var t=this.getFocusedNode();e.target===t&&(E.removeClass([t],js),E.EventHandler.remove(t,"blur",this.focusOut))},p.prototype.onMouseOver=function(e){var t;E.Browser.isDevice||(t=(e=e.target).classList,!(e=E.closest(e,"."+w))||t.contains(L)||t.contains(w)?this.removeHover():e&&!e.classList.contains("e-disable")&&this.setHover(e))},p.prototype.setHover=function(e){e.classList.contains(cs)||e.classList.contains(Vs)||(this.removeHover(),E.addClass([e],cs))},p.prototype.onMouseLeave=function(){this.removeHover()},p.prototype.removeHover=function(){var e=E.selectAll("."+cs,this.element);e&&e.length&&E.removeClass(e,cs)},p.prototype.getNodeData=function(e,t){var i,s,n,r,o,l,a,d;return!E.isNullOrUndefined(e)&&e.classList.contains(w)&&!E.isNullOrUndefined(E.closest(e,"."+ds))&&E.closest(e,"."+ds).classList.contains(as)?(i=e.getAttribute("data-uid"),t=this.getText(e,t),s=(s=E.closest(e.parentNode,"."+w))?s.getAttribute("data-uid"):null,n=e.classList.contains(ps),r=!e.classList.contains(Vs),o="true"===e.getAttribute("aria-expanded"),l=null!==e.getAttribute("aria-expanded")||null!=(E.select("."+O,e)||E.select("."+u,e)),a=null,d=E.select("."+Us,e),{id:i,text:t,parentID:s,selected:n,selectable:r,expanded:o,isChecked:a=this.showCheckBox&&d?e.getAttribute("aria-checked"):a,hasChildren:l}):{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},p.prototype.getText=function(e,t){var i;return t?(t=this.getNodeObject(e.getAttribute("data-uid")),i=parseFloat(e.getAttribute("aria-level")),i=this.getFields(this.fields,i,1),E.getValue(i.text,t)):E.select("."+hs,e).textContent},p.prototype.getExpandEvent=function(e,t){var i=this.getNodeData(e);return{cancel:!1,isInteracted:!E.isNullOrUndefined(t),node:e,nodeData:i,event:t}},p.prototype.renderNodeTemplate=function(e,t,i){e=this.nodeTemplateFn(e,this,"nodeTemplate"+i,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,t,this.root);e&&(e=Array.prototype.slice.call(e),E.append(e,t))},p.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},p.prototype.reRenderNodes=function(){this.updateListProp(this.fields),E.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",E.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},p.prototype.setCssClass=function(e,t){E.isNullOrUndefined(e)||""===e||E.removeClass([this.element],e.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass([this.element],t.split(" "))},p.prototype.editingHandler=function(e){var e=e.target;!e||e.classList.contains(as)||e.classList.contains(L)||e.classList.contains(w)||e.classList.contains(fs)||e.classList.contains(vs)||e.classList.contains(ys)||(e=E.closest(e,"."+w),this.createTextbox(e))},p.prototype.createTextbox=function(i){var s=this,e=E.select("."+bs,this.element),n=(e&&e.blur(),E.select("."+hs,i)),e=(this.updateOldText(i),this.createElement("input",{className:bs,attrs:{value:this.oldText}})),r=this.getEditEvent(i,null,e.outerHTML);this.trigger("nodeEditing",r,function(e){var t;e.cancel||(t="width:"+(n.offsetWidth+5)+"px",E.addClass([i],Cs),E.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(i),s.isReact?setTimeout(function(){s.renderTextBox(r,n,t)},5):s.renderTextBox(r,n,t))})},p.prototype.renderTextBox=function(e,t,i){t.innerHTML=e.innerHtml;e=E.select("."+bs,t),this.inputObj=B.Input.createInput({element:e,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.setAttribute("style",i),e.focus(),t=e;t.setSelectionRange(0,t.value.length),this.wireInputEvents(e)},p.prototype.updateOldText=function(e){var t=e.getAttribute("data-uid"),t=(this.editData=this.getNodeObject(t),parseFloat(e.getAttribute("aria-level")));this.editFields=this.getFields(this.fields,t,1),this.oldText=E.getValue(this.editFields.text,this.editData)},p.prototype.inputFocusOut=function(e){var t,i,s;E.select("."+bs,this.element)&&(t=(e=e.target).value,i=E.closest(e,"."+hs),s=E.closest(e,"."+w),E.detach(this.inputObj.container),B.Input.destroy({element:e,properties:this.properties}),this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("update",null,s,t,null,null,!0):this.appendNewText(s,i,t,!0),E.EventHandler.remove(e,"blur",this.inputFocusOut),this.inputObj=null,E.detach(e))},p.prototype.appendNewText=function(t,i,s,n){var r=this,e=this.getEditEvent(t,s,null);this.trigger("nodeEdited",e,function(e){s=e.cancel?e.oldText:e.newText,r.updateText(t,i,s,n),e.oldText!==s&&r.triggerEvent("nodeEdited",[r.getNode(t)])})},p.prototype.updateText=function(e,t,i,s){var n=E.setValue(this.editFields.text,i,this.editData);E.isNullOrUndefined(this.nodeTemplateFn)?this.enableHtmlSanitizer?t.innerText=E.SanitizeHtmlHelper.sanitize(i):t.innerHTML=i:(t.innerText="",i=e.getAttribute("data-uid"),this.renderNodeTemplate(n,t,i),this.renderReactTemplates()),s&&(E.removeClass([e],Cs),e.focus(),E.EventHandler.add(e,"blur",this.focusOut,this),E.addClass([e],js)),this.allowTextWrap&&this.calculateWrap(e)},p.prototype.getElement=function(e){return E.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?E.getElement(e):null},p.prototype.getId=function(e){return E.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?E.getElement(e).getAttribute("data-uid"):null},p.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},p.prototype.getNodeObject=function(e){if(!E.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var t=0,i=this.treeData.length;t<i;t++){var s=E.getValue(this.fields.id,this.treeData[parseInt(t.toString(),10)]);if(!E.isNullOrUndefined(this.treeData[parseInt(t.toString(),10)])&&!E.isNullOrUndefined(s)&&s.toString()===e)return this.treeData[parseInt(t.toString(),10)]}}},p.prototype.getChildNodeObject=function(e,t,i){if(!E.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){var r=E.getValue(t.id,e[parseInt(s.toString(),10)]);if(e[parseInt(s.toString(),10)]&&r&&r.toString()===i)return e[parseInt(s.toString(),10)];if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(s.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(s.toString(),10)]))){if(void 0!==(o=this.getChildNodeObject(E.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)))break}else if(this.isChildObject()){l=E.getValue("child",e[parseInt(s.toString(),10)]);if(void 0!==(o=this.getChildNodeObject(l,this.getChildMapper(t),i)))break}}else{var o,l=E.getValue(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(o=this.getChildNodeObject(l,this.getChildMapper(t),i)))break}}return o},p.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},p.prototype.initializeDrag=function(){var s,n=this;this.dragObj=new E.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+gs,enableTapHold:!0,tapHoldThreshold:100,helper:function(e){n.dragTarget=e.sender.target;var t=E.closest(n.dragTarget,"."+as),i=E.closest(n.dragTarget,"."+gs);return n.dragLi=E.closest(n.dragTarget,"."+w),n.fullRowSelect&&!i&&n.dragTarget.classList.contains(ks)&&(i=n.dragTarget.nextElementSibling),!(!(n.dragTarget&&e.element.isSameNode(t)&&i)||n.dragTarget.classList.contains(as)||n.dragTarget.classList.contains(L)||n.dragTarget.classList.contains(w)||n.dragLi.classList.contains("e-disable"))&&(e=i.cloneNode(!0),E.isNullOrUndefined(E.select("div."+fs,e))&&(t=n.createElement("div",{className:fs+" "+O}),e.insertBefore(t,e.children[0])),i="e-drag-item "+as+" "+n.cssClass+" "+(n.enableRtl?"e-rtl":""),(s=n.createElement("div",{className:i})).appendChild(e),1<(t=n.selectedNodes.length)&&n.allowMultiSelection&&n.dragLi.classList.contains(ps)&&(i=n.createElement("span",{className:"e-drop-count",innerHTML:""+t}),s.appendChild(i)),document.body.appendChild(s),document.body.style.cursor="",n.dragData=n.getNodeData(n.dragLi),s)},dragStart:function(t){E.addClass([n.element],Es);var e,i=E.closest(t.target,".e-list-item"),i=(i&&(e=parseInt(i.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,null,t.target,null,s,e));i.draggedNode.classList.contains(Cs)?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.trigger("nodeDragStart",i,function(e){e.cancel?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.dragStartAction=!0})},drag:function(e){n.dragObj.setProperties({cursorAt:{top:!E.isNullOrUndefined(e.event.targetTouches)||E.Browser.isDevice?60:-20}}),n.dragAction(e,s)},dragStop:function(t){E.removeClass([n.element],Es),t.target.classList.contains("e-sibling")||n.removeVirtualEle();var e,i=t.target,s=E.closest(i,"."+Is),s=(i&&s||(E.detach(t.helper),document.body.style.cursor=""),E.closest(i,".e-list-item")),s=(s&&(e=parseInt(s.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,i,i,null,t.helper,e));s.preventTargetExpand=!1,n.trigger("nodeDragStop",s,function(e){n.dragParent=e.draggedParentNode,n.preventExpand=e.preventTargetExpand,e.cancel&&(t.helper.parentNode&&E.detach(t.helper),document.body.style.cursor="",i.classList.contains("e-sibling"))&&n.removeVirtualEle(),n.dragStartAction=!1})}}),this.dropObj=new E.Droppable(this.element,{out:function(e){!E.isNullOrUndefined(e)&&!e.target.classList.contains(xs)&&n.dropObj.dragData.default&&n.dropObj.dragData.default.helper.classList.contains(as)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){n.dropAction(e),n.removeVirtualEle()}})},p.prototype.dragCancelAction=function(e){E.detach(e),E.removeClass([this.element],Es),this.dragStartAction=!1},p.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},p.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},p.prototype.dragAction=function(e,t){var i,s,n,r,o,l=E.closest(e.target,"."+Is),a=E.closest(e.target,"."+gs),d=E.select("div."+fs,t),h=(E.removeClass([d],[Ns,Os,ws,Ls]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="",e.target.classList),c=e.event,p=this.getOffsetY(c,e.target),c=this.getOffsetX(c,e.target),a=(this.fullRowSelect&&!a&&!E.isNullOrUndefined(h)&&h.contains(ks)&&(a=e.target.nextElementSibling),l?(h=E.closest(e.target,"."+w),i=E.closest(e.target,"."+Us),s=E.closest(e.target,"."+u),n=E.closest(e.target,"."+O),!l.classList.contains(as)||a&&!h.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,h)?this.hasTemplate&&h?(l=E.select(this.fullRowSelect?"."+ks:"."+gs,h),e&&!n&&!s&&p<7&&!i||n&&p<5||s&&c<3?(r=this.fullRowSelect?1:0,this.appendIndicator(h,d,r)):e&&!n&&!s&&!i&&l&&p>l.offsetHeight-10||n&&19<p||s&&19<c?(r=this.fullRowSelect?2:1,this.appendIndicator(h,d,r)):(E.addClass([d],Ns),this.isDropIn=!0)):h&&e&&!n&&!s&&p<7&&!i||n&&p<5||s&&c<3?(r=this.fullRowSelect?1:0,this.appendIndicator(h,d,r)):h&&e&&!n&&!s&&0<e.target.offsetHeight&&p>e.target.offsetHeight-10&&!i||n&&19<p||s&&19<c?(r=this.fullRowSelect?2:1,this.appendIndicator(h,d,r)):(E.addClass([d],Ns),this.isDropIn=!0):"LI"!==e.target.nodeName||h.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,h)?e.target.classList.contains(xs)?E.addClass([d],Os):E.addClass([d],ws):(E.addClass([d],Os),this.renderVirtualEle(e))):(E.addClass([d],Ls),document.body.style.cursor="not-allowed"),E.closest(e.target,".e-list-item")),l=(a&&(o=parseInt(a.getAttribute("aria-level"),10)),this.getDragEvent(e.event,this,e.target,e.target,null,t,o));l.dropIndicator&&E.removeClass([d],l.dropIndicator),this.trigger("nodeDragging",l),l.dropIndicator&&E.addClass([d],l.dropIndicator)},p.prototype.appendIndicator=function(e,t,i){E.addClass([t],Os);t=this.createElement("div",{className:xs});e.insertBefore(t,e.children[parseInt(i.toString(),10)])},p.prototype.dropAction=function(e){for(var t,i=e.event,s=this.getOffsetY(i,e.target),n=e.target,i=!1,r=[],o=[],l=e.dragData.draggable,a=0;a<l.ej2_instances.length;a++)if(l.ej2_instances[parseInt(a.toString(),10)]instanceof en){t=l.ej2_instances[parseInt(a.toString(),10)];break}if(t&&t.dragTarget){var d=t.dragTarget,d=E.closest(d,"."+w),h=E.closest(n,"."+w);if(o.push(d),null==h&&n.classList.contains(as)&&(h=n.firstElementChild),E.detach(e.droppedElement),document.body.style.cursor="",!h||h.isSameNode(d)||this.isDescendant(d,h))return void(this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1));if(t.allowMultiSelection&&d.classList.contains(ps)){var c=E.selectAll("."+ps,t.element),o=c;if(e.target.offsetHeight<=33&&s>e.target.offsetHeight-10&&6<s)for(a=c.length-1;0<=a;a--)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s);else for(a=0;a<c.length;a++)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s)}else this.appendNode(n,d,h,e,t,s);d=parseInt(d.getAttribute("aria-level"),10),i=!0}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1);for(a=0;a<o.length;a++)r.push(this.getNode(o[parseInt(a.toString(),10)]));this.trigger("nodeDropped",this.getDragEvent(e.event,t,n,e.target,e.dragData.draggedElement,null,d,i)),t.element.id!==this.element.id&&(t.triggerEvent("nodeDropped",r),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",r)},p.prototype.appendNode=function(e,t,i,s,n,r){var o=E.closest(e,"."+Us),l=E.closest(s.target,"."+u),a=E.closest(s.target,"."+O);t.classList.contains("e-disable")||o||!(a&&s.event.offsetY<5||l&&s.event.offsetX<3||a&&19<s.event.offsetY||l&&19<s.event.offsetX||!a&&!l)?this.dropAsChildNode(t,i,n,null,s,r,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(t,i,s,n):e.firstElementChild&&e.classList.contains(as)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(t,i,s,n):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(t,i,s,n):this.dropAsChildNode(t,i,n,null,s,r,null,e),this.showCheckBox&&this.ensureIndeterminate()},p.prototype.dropAsSiblingNode=function(e,t,i,s){var n,r,o=E.closest(t,"."+L),l=E.closest(e,"."+L),a=E.closest(l,"."+w);0<i.target.offsetHeight&&i.event.offsetY>i.target.offsetHeight-2?n=!1:i.event.offsetY<2?n=!0:(i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible"))&&(i.event.offsetY<5||i.event.offsetX<3?n=!0:(15<i.event.offsetY||17<i.event.offsetX)&&(n=!1)),i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible")?(r=i.target.closest("li"),o.insertBefore(e,n?r:r.nextElementSibling)):o.insertBefore(e,n?i.target:i.target.nextElementSibling),this.moveData(e,t,o,n,s),this.updateElement(l,a),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},p.prototype.dropAsChildNode=function(e,t,i,s,n,r,o,l){var a,d=E.closest(e,"."+L),h=E.closest(d,"."+w),c=E.closest(t,"."+L);n&&n.target&&(a=E.select(this.fullRowSelect?"."+ks:"."+gs,t)),n&&(r<7&&!l.classList.contains("e-sibling")||l.classList.contains("e-sibling")&&!t.lastChild.classList.contains("e-sibling"))&&!o?(c.insertBefore(e,t),this.moveData(e,t,c,!0,i)):n&&0<n.target.offsetHeight&&r>n.target.offsetHeight-10&&!o&&!this.hasTemplate||this.hasTemplate&&a&&r>a.offsetHeight-10&&!o?(c.insertBefore(e,t.nextElementSibling),this.moveData(e,t,c,!1,i)):(l=this.expandParent(t),n=E.isNullOrUndefined(s)?null:l.childNodes[parseInt(s.toString(),10)],l.insertBefore(e,n),this.moveData(e,n,l,!0,i)),this.updateElement(d,h),this.updateAriaLevel(e),i.element.id===this.element.id?this.updateList():(i.updateInstance(),this.updateInstance())},p.prototype.moveData=function(e,t,i,s,n){var i=E.closest(i,"."+w),e=this.getId(e),r=n.updateChildField(n.treeData,n.fields,e,null,null,!0),t=this.getId(t),t=this.getDataPos(this.treeData,this.fields,t),i=this.getId(i);if(1===this.dataType){this.updateField(this.treeData,this.fields,i,"hasChildren",!0);var o,l=E.isNullOrUndefined(t)?this.treeData.length:s?t:t+1;if(E.isNullOrUndefined(i)&&!this.hasPid?delete r[0][this.fields.parentID]:(o=this.isNumberTypeId?parseFloat(i):i,E.setValue(this.fields.parentID,o,r[0])),this.treeData.splice(l,0,r[0]),n.element.id!==this.element.id){var a=n.removeChildNodes(e);l++;for(var d=0,h=a.length;d<h;d++)this.treeData.splice(l,0,a[parseInt(d.toString(),10)]),l++;n.groupedData=n.getGroupedData(n.treeData,n.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,i,r,s?t:t+1)},p.prototype.expandParent=function(e){var t,i=E.select("div."+O+", div."+u,e),s=(i&&i.classList.contains(O)&&!0!==this.preventExpand&&this.expandAction(e,i,null),E.select("."+L,e)),n=(!0===this.preventExpand&&!s&&i&&this.renderChildNodes(e),s=E.select("."+L,e),!E.isNullOrUndefined(s)&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(s.style.display="none"),E.isNullOrUndefined(s)||!1!==this.preventExpand||(s.style.display="block"),E.isNullOrUndefined(s)&&!0===this.preventExpand&&(E.isNullOrUndefined(i)&&U.ListBase.generateIcon(this.createElement,e,O,this.listBaseOption),(t=E.select("div."+O+", div."+u,e))&&t.classList.add("e-icon-expandable"),s=U.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),t?E.removeClass([t],u):U.ListBase.generateIcon(this.createElement,e,O,this.listBaseOption),e.setAttribute("aria-expanded","false"),s.style.display="none"),E.isNullOrUndefined(s)&&(n=this.expandArgs,(E.isNullOrUndefined(n)||n&&"nodeExpanding"!==n.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),E.isNullOrUndefined(i)&&U.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),(t=E.select("div."+O+", div."+u,e))||(U.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),t=E.select("div."+fs,e)),E.removeClass([t],O),s=U.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))),E.select("div."+u,e));return!E.isNullOrUndefined(s)&&n&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(E.removeClass([n],u),e.setAttribute("aria-expanded","false"),E.addClass([n],O)),s},p.prototype.updateElement=function(e,t){var i;t&&0===e.childElementCount&&(i=E.select("div."+fs,t),E.detach(e),E.detach(i),e=this.getId(t),this.updateField(this.treeData,this.fields,e,"hasChildren",!1),this.removeExpand(t,!0))},p.prototype.updateAriaLevel=function(e){var t=this.parents(e,"."+L).length;e.setAttribute("aria-level",""+t),this.updateChildAriaLevel(E.select("."+L,e),t+1)},p.prototype.updateChildAriaLevel=function(e,t){if(!E.isNullOrUndefined(e))for(var i=e.childNodes,s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)];r.setAttribute("aria-level",""+t),this.updateChildAriaLevel(E.select("."+L,r),t+1)}},p.prototype.renderVirtualEle=function(e){var t=e.event,t=this.getOffsetY(t,e.target),t=(t>e.target.offsetHeight-2?i=!1:t<2&&(i=!0),this.createElement("div",{className:xs})),i=this.fullRowSelect?i?1:2:i?0:1;e.target.insertBefore(t,e.target.children[parseInt(i.toString(),10)])},p.prototype.removeVirtualEle=function(){var e=E.select("."+xs);e&&E.detach(e)},p.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},p.prototype.getDragEvent=function(e,t,i,s,n,r,o,l){var a=i?E.closest(i,"."+w):null,d=a?this.getNodeData(a):null,h=t?t.dragLi:n,n=t?t.dragData:null,c=i?this.parents(i,"."+w):null,p=t.dragLi.parentElement,u=t.dragLi?E.closest(p,"."+w):null,m=null,f=null,g=[Os,Ns,ws,Ls],v=null,y=!0===l?h:a,b=y?E.closest(y,".e-list-parent"):null,C=0,S=null,u=t.dragLi&&null===u?E.closest(p,"."+as):u;if(u=!0===l?this.dragParent:u,r)for(;C<4;){if(E.select("."+fs,r).classList.contains(g[parseInt(C.toString(),10)])){v=g[parseInt(C.toString(),10)];break}C++}if(b){for(var I=0,C=0;C<b.childElementCount;C++){if(I=!0!==l&&b.children[parseInt(C.toString(),10)]===h&&a!==h?++I:I,!0!==l&&b.children[parseInt(C.toString(),10)].classList.contains("e-hover")){f=23<=e.offsetY?C+1:C;break}if(b.children[parseInt(C.toString(),10)]===y){e.offsetY,f=C;break}}f=0!==I?--f:f,S=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}return i&&(m=0===c.length?null:i.classList.contains(w)?c[0]:c[1]),a===h&&(m=a),i&&s.offsetHeight<=33&&e.offsetY<s.offsetHeight-10&&6<e.offsetY&&(m=a,!0!==l)&&(o=++o,f=(t=m?E.select(".e-list-parent",m):null)?t.children.length:0,this.fields.dataSource instanceof x.DataManager||null!==t||!m||(f=(p=m.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,m.getAttribute("data-uid").toString()):null)?p.length:0)),{cancel:!1,clonedNode:r,event:e,draggedNode:h,draggedNodeData:n,droppedNode:a,droppedNodeData:d,dropIndex:f,dropLevel:o,draggedParentNode:u,dropTarget:m,dropIndicator:v,target:s,position:S}},p.prototype.addFullRow=function(e){var t=this.liList.length;if(e)for(var i=0;i<t;i++)this.createFullRow(this.liList[parseInt(i.toString(),10)]);else for(i=0;i<t;i++){var s=E.select("."+ks,this.liList[parseInt(i.toString(),10)]);E.detach(s)}},p.prototype.createFullRow=function(e){var t=this.createElement("div",{className:ks});e.insertBefore(t,e.childNodes[0])},p.prototype.addMultiSelect=function(e){if(e)for(var t=0,i=E.selectAll("."+w+':not([aria-selected="true"])',this.element);t<i.length;t++)i[t].setAttribute("aria-selected","false");else for(var s=0,n=E.selectAll("."+w+'[aria-selected="false"]',this.element);s<n.length;s++)n[s].removeAttribute("aria-selected")},p.prototype.collapseByLevel=function(e,t,i,s){if(s=E.isNullOrUndefined(s)?1:s,0<t&&!E.isNullOrUndefined(e))for(var n=this.getVisibleNodes(i,e.childNodes),r=0,o=n.length;r<o;r++){var l=n[parseInt(r.toString(),10)],a=E.select("."+u,E.select("."+gs,l));t<=s&&!E.isNullOrUndefined(a)&&this.collapseNode(l,a,null),this.collapseByLevel(E.select("."+L,l),t,i,s+1)}},p.prototype.collapseAllNodes=function(e){for(var t=this.getVisibleNodes(e,E.selectAll("."+u,this.element)),i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)],r=E.closest(n,"."+w);this.collapseNode(r,n,null)}},p.prototype.expandByLevel=function(e,t,i){if(0<t&&!E.isNullOrUndefined(e))for(var s=this.getVisibleNodes(i,e.childNodes),n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)],l=E.select("."+O,E.select("."+gs,o));E.isNullOrUndefined(l)||this.expandAction(o,l,null),this.expandByLevel(E.select("."+L,o),t-1,i)}},p.prototype.expandAllNodes=function(e){for(var t=0,i=this.getVisibleNodes(e,E.selectAll("."+O,this.element));t<i.length;t++){var s=i[t],n=E.closest(s,"."+w);this.expandAction(n,s,null,!0,null,!0)}},p.prototype.getVisibleNodes=function(e,t){var i=Array.prototype.slice.call(t);if(e)for(var s=0;s<i.length;s++)E.isVisible(i[parseInt(s.toString(),10)])||(i.splice(s,1),s--);return i},p.prototype.removeNode=function(e){var t=E.closest(e,"."+L),i=E.closest(t,"."+w);E.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),E.detach(e),this.updateElement(t,i),this.removeData(e)},p.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},p.prototype.updateList=function(){this.liList=Array.prototype.slice.call(E.selectAll("."+w,this.element))},p.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=E.selectAll("."+ps,this.element);this.selectGivenNodes(e)},p.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=E.selectAll('[aria-expanded="true"]',this.element),t=0,i=e.length;t<i;t++)this.addExpand(e[parseInt(t.toString(),10)])},p.prototype.removeData=function(e){var t,i,s,n;1===this.dataType?(t=new x.DataManager(this.treeData),n=this.getId(e),i={},s=this.isNumberTypeId?parseFloat(n):n,i[this.fields.id]=s,t.remove(this.fields.id,i),this.removeChildNodes(n)):(n=this.getId(e),this.updateChildField(this.treeData,this.fields,n,null,null,!0))},p.prototype.removeChildNodes=function(e){var t=this.getChildGroup(this.groupedData,e,!1),i=[];if(t)for(var s=0,n=t.length;s<n;s++){var r=new x.DataManager(this.treeData),o=E.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString(),l={},a=this.isNumberTypeId?parseFloat(o):o,a=(l[this.fields.id]=a,r.remove(this.fields.id,l));i.push(a[0]),this.removeChildNodes(o)}return i},p.prototype.doGivenAction=function(e,t,i){for(var s=0,n=e.length;s<n;s++){var r,o=this.getElement(e[parseInt(s.toString(),10)]);E.isNullOrUndefined(o)||(r=E.select("."+t,E.select("."+gs,o)),E.isNullOrUndefined(r))||(i?this.expandAction(o,r,null):this.collapseNode(o,r,null))}},p.prototype.addGivenNodes=function(e,t,i,s,n){if(0!==e.length){var r,o,l=this.getSortedData(e),a=t?parseFloat(t.getAttribute("aria-level"))+1:1,d=(s&&this.updateMapper(a),U.ListBase.createListItemFromJson(this.createElement,l,this.listBaseOption,a)),h=this.getId(t),c=(E.isNullOrUndefined(t)||(r=E.select("div."+fs,t)),1===this.dataType&&r&&r.classList.contains(O)&&this.preventExpand&&!E.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,h,e,i),this.isFirstRender=!1),o=n||(t?this.expandParent(t):E.select("."+L,this.element)),E.isNullOrUndefined(i)?null:o.childNodes[parseInt(i.toString(),10)]);if(!this.isFirstRender||1===this.dataType){s=this.expandArgs;if(c||"None"===this.sortOrder){for(var p=0;p<d.length;p++)o.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||E.isNullOrUndefined(t)||this.preventExpand||E.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=E.select("div."+fs,t))&&u.classList.contains(O)&&(E.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===o.childNodes.length){for(var u,p=0;p<d.length;p++)o.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||E.isNullOrUndefined(t)||this.preventExpand||E.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=E.select("div."+fs,t))&&u.classList.contains(O)&&(E.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}else for(var m=o.childNodes,p=0;p<d.length;p++)for(var f=0;f<m.length;f++){if("Ascending"===this.sortOrder?m[parseInt(f.toString(),10)].textContent.toUpperCase()>d[parseInt(p.toString(),10)].innerText.toUpperCase():m[parseInt(f.toString(),10)].textContent.toUpperCase()<d[parseInt(p.toString(),10)].innerText.toUpperCase()){o.insertBefore(d[parseInt(p.toString(),10)],m[parseInt(f.toString(),10)]);break}o.insertBefore(d[parseInt(p.toString(),10)],m[m.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,h,"hasChildren",!0);for(var g,l=this.getId(c),v=E.isNullOrUndefined(l)?this.treeData.length:this.getDataPos(this.treeData,this.fields,l),f=0;f<e.length;f++)E.isNullOrUndefined(h)||(g=this.isNumberTypeId?parseFloat(h):h,E.setValue(this.fields.parentID,g,e[parseInt(f.toString(),10)])),this.treeData.splice(v,0,e[parseInt(f.toString(),10)]),v++}this.finalizeNode(o)}},p.prototype.updateMapper=function(e){e=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(e)},p.prototype.updateListProp=function(e){e=this.getActualProperties(e);this.listBaseOption.fields=e,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(e,"navigateUrl")?e.navigateUrl:"navigateUrl"},p.prototype.getDataPos=function(e,t,i){for(var s=null,n=0,r=e.length;n<r;n++){var o=E.getValue(t.id,e[parseInt(n.toString(),10)]);if(e[parseInt(n.toString(),10)]&&o&&o.toString()===i)return n;if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(n.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(n.toString(),10)]))){o=E.getValue("child",e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(o,this.getChildMapper(t),i)))break}}else{o=E.getValue(t.child,e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(o,this.getChildMapper(t),i)))break}}return s},p.prototype.addChildData=function(e,t,i,s,n){if(E.isNullOrUndefined(i)){n=E.isNullOrUndefined(n)?e.length:n;for(var r=0,o=s.length;r<o;r++)e.splice(n,0,s[parseInt(r.toString(),10)]),n++}else for(var l=0,a=e.length;l<a;l++){var d=E.getValue(t.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&d&&d.toString()===i){if("string"==typeof t.child&&Object.prototype.hasOwnProperty.call(e[parseInt(l.toString(),10)],t.child)&&null!==e[parseInt(l.toString(),10)][t.child]||this.fields.dataSource instanceof x.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(l.toString(),10)],"child")){var h="string"==typeof t.child?t.child:"child",c=E.getValue(h,e[parseInt(l.toString(),10)]);E.isNullOrUndefined(c)&&(c=[]),n=E.isNullOrUndefined(n)?c.length:n;for(r=0,o=s.length;r<o;r++)c.splice(n,0,s[parseInt(r.toString(),10)]),n++}else{h="string"==typeof t.child?t.child:"child";e[parseInt(l.toString(),10)][""+h]=s}return!0}if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(l.toString(),10)]))){c=E.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(p=this.addChildData(c,this.getChildMapper(t),i,s,n)))break}}else{var p,d=E.getValue(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(p=this.addChildData(d,this.getChildMapper(t),i,s,n)))break}}return p},p.prototype.doDisableAction=function(e){var e=this.nodeType(e),t=this.checkValidId(e);this.validArr=[];for(var i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)][this.fields.id].toString(),n=(n&&-1===this.disableNode.indexOf(n)&&this.disableNode.push(n),this.getElement(n));n&&(n.setAttribute("aria-disabled","true"),E.addClass([n],Ds))}},p.prototype.doEnableAction=function(e){for(var t=this.nodeType(e),i=0,s=t.length;i<s;i++){var n=this.getElement(t[parseInt(i.toString(),10)]),r=t[parseInt(i.toString(),10)];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),n&&(n.removeAttribute("aria-disabled"),E.removeClass([n],Ds))}},p.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},p.prototype.checkValidId=function(t){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(e){return-1!==t.indexOf(e[i.fields.id]?e[i.fields.id].toString():null)});else if(2===this.dataType)for(var e=0;e<this.treeData.length;e++){var s=this.treeData[parseInt(e.toString(),10)][this.fields.id]?this.treeData[parseInt(e.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(this.treeData[parseInt(e.toString(),10)]),E.getValue(this.fields.child.toString(),this.treeData[parseInt(e.toString(),10)]));s&&this.filterNestedChild(s,t)}return this.validArr},p.prototype.filterNestedChild=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(e[parseInt(i.toString(),10)]),E.getValue(this.fields.child.toString(),e[parseInt(i.toString(),10)]));s&&this.filterNestedChild(s,t)}},p.prototype.setTouchClass=function(){var e=E.closest(this.element,".e-bigger");this.touchClass=E.isNullOrUndefined(e)?"":"e-small"},p.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[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var o=this.checkedNodes,l=0,r=o.length;l<r;l++)this.updateField(this.treeData,this.fields,o[parseInt(l.toString(),10)],"isChecked",!0)}},p.prototype.removeField=function(e,t,i){if(!E.isNullOrUndefined(e)&&!E.isNullOrUndefined(t))for(var s=0,n=e.length;s<n;s++){for(var r=0;r<i.length;r++){var o=this.getMapperProp(t,i[parseInt(r.toString(),10)]);E.isNullOrUndefined(e[parseInt(s.toString(),10)][""+o])||delete e[parseInt(s.toString(),10)][""+o]}"string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(s.toString(),10)]))?this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(s.toString(),10)]))&&this.removeField(E.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i):this.removeField(E.getValue(t.child,e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)}},p.prototype.getMapperProp=function(e,t){switch(t){case"selected":return E.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return E.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return E.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return E.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return t}},p.prototype.updateField=function(e,t,i,s,n){var r;E.isNullOrUndefined(i)||(1===this.dataType?(r=this.isNumberTypeId?parseFloat(i):i,r=new x.DataManager(this.treeData).executeLocal((new x.Query).where(t.id,"equal",r,!1)),E.setValue(this.getMapperProp(t,s),n,r[0])):this.updateChildField(e,t,i,s,n))},p.prototype.updateChildField=function(e,t,i,s,n,r){if(!E.isNullOrUndefined(e))for(var o=0,l=e.length;o<l;o++){var a=E.getValue(t.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&!E.isNullOrUndefined(a)&&a.toString()===i)return d=r?e.splice(o,1):(E.setValue(this.getMapperProp(t,s),n,e[parseInt(o.toString(),10)]),[]);if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(o.toString(),10)]))){a=E.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}else{var d,a=E.getValue(t.child,e[parseInt(o.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}return d},p.prototype.triggerEvent=function(e,t){if(this.renderReactTemplates(),"addNodes"===e){for(var i=[],s=0;s<t.length;s++)i.push(this.getNode(this.getElement(E.isNullOrUndefined(t[parseInt(s.toString(),10)][this.fields.id])?E.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString():null)));t=i}e={data:this.treeData,action:e,nodeData:t};this.trigger("dataSourceChanged",e)},p.prototype.wireInputEvents=function(e){E.EventHandler.add(e,"blur",this.inputFocusOut,this)},p.prototype.wireEditingEvents=function(e){var t=this;e&&!this.disabled?this.touchEditObj=new E.Touch(this.element,{tap:function(e){t.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),t.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},p.prototype.wireClickEvent=function(e){var t=this;e?this.touchClickObj=new E.Touch(this.element,{tap:function(e){t.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},p.prototype.wireExpandOnEvent=function(e){var t=this;e?this.touchExpandObj=new E.Touch(this.element,{tap:function(e){("Click"===t.expandOnType||"DblClick"===t.expandOnType&&t.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&t.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},p.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&E.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},p.prototype.preventContextMenu=function(e){e.preventDefault()},p.prototype.wireEvents=function(){E.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),E.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),E.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},p.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),E.EventHandler.remove(this.element,"mouseover",this.onMouseOver),E.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},p.prototype.parents=function(e,t){for(var i=[],s=e.parentNode;!E.isNullOrUndefined(s);)E.matches(s,t)&&i.push(s),s=s.parentNode;return i},p.prototype.isDoubleTapped=function(e){var t,i=e.originalEvent.target;return i&&e.tapCount&&(1===e.tapCount?this.firstTap=E.closest(i,"."+w):2===e.tapCount&&(t=E.closest(i,"."+w))),this.firstTap===t},p.prototype.isDescendant=function(e,t){for(var i=t.parentNode;!E.isNullOrUndefined(i);){if(i===e)return!0;i=i.parentNode}return!1},p.prototype.showSpinner=function(e){E.addClass([e],us),g.createSpinner({target:e,width:E.Browser.isDevice?16:14},this.createElement),g.showSpinner(e)},p.prototype.hideSpinner=function(e){g.hideSpinner(e),e.innerHTML="",E.removeClass([e],us)},p.prototype.setCheckedNodes=function(e){1<(e=JSON.parse(JSON.stringify(e))).length&&"function"==typeof this.nodeChecked&&0<this.nodeChecked.length&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),0<e.length&&this.checkAll(e)},p.prototype.setValidCheckedNode=function(e,t){if(void 0===t&&(t=[]),1===this.dataType){var i=this.fields,i=new x.DataManager(this.treeData).executeLocal((new x.Query).where(i.id,"equal",e,!0));if(i[0]&&(this.setChildCheckState(i,e,i[0],t),this.autoCheck)){for(var i=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,s=this.getChildNodes(this.treeData,i),n=0,r=0;r<s.length;r++){var o=s[parseInt(r.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(o)&&n++}n===s.length&&-1===this.checkedNodes.indexOf(i)&&i&&this.checkDisabledState(i)}}else if(2===this.dataType)for(var l=0;l<this.treeData.length;l++){if((this.treeData[parseInt(l.toString(),10)][this.fields.id]?this.treeData[parseInt(l.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var a=E.getValue(this.fields.child.toString(),this.treeData[parseInt(l.toString(),10)]);a&&this.setChildCheckState(a,e,this.treeData[parseInt(l.toString(),10)],t)}},p.prototype.setChildCheckState=function(e,t,i,s){void 0===s&&(s=[]);var n,r=0;if(1===this.dataType){i&&(n=i[this.fields.id]?i[this.fields.id].toString():null);for(var o=0;o<e.length;o++){var l=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():null,a=(i&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.checkDisabledState(l,e[o]),l===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),this.getChildNodes(this.treeData,l)),d=1===s.length&&s[0]===l;a.length!==t.length&&!d||this.setChildCheckState(a,t,i)}}else{i&&(n=i[this.fields.id]?i[this.fields.id].toString():"");for(o=0;o<e.length;o++){var h=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",d=1===[t].length&&0===s.length;i&&n&&this.autoCheck&&(-1===this.checkedNodes.indexOf(n)||-1!==this.checkedNodes.indexOf(h)||h!==t&&!d||this.checkDisabledState(h,e[o])),h===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),(a=E.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]))&&this.setChildCheckState(a,t,e[parseInt(o.toString(),10)]),-1!==this.checkedNodes.indexOf(h)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkDisabledState(n,i)}}},p.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},p.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[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},p.prototype.updateChildPosition=function(e,t,i,s,n){for(var r=0,o=e.length;r<o;r++){var l=E.getValue(t.id,e[parseInt(r.toString(),10)]);if(e[parseInt(r.toString(),10)]&&l&&l.toString()===i)return e[parseInt(r.toString(),10)]=s[0],!0;if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(r.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(r.toString(),10)]))){l=E.getValue("child",e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(l,this.getChildMapper(t),i,s,n)))break}}else{var a,l=E.getValue(t.child,e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(l,this.getChildMapper(t),i,s,n)))break}}return a},p.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},p.prototype.crudOperation=function(e,t,i,s,n,r,o){var l,a=this,d=this.fields.dataSource,h=[],c=this.getQuery(this.fields),p=this.fields.id,u={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];t?m=this.nodeType(t):i&&("string"==typeof i?m[0]=i.toString():"object"==typeof i&&(m[0]=i.getAttribute("data-uid").toString()));for(var f=0,g=m.length;f<g;f++){var v=this.getElement(m[parseInt(f.toString(),10)]);E.isNullOrUndefined(v)||(v=this.getNodeObject(m[parseInt(f.toString(),10)]),h.push(v))}switch(e){case"delete":(l=1===t.length?d.remove(p,h[0],c.fromTable,c):(u.deletedRecords=h,d.saveChanges(u,p,c.fromTable,c))).then(function(){return a.deleteSuccess(m)}).catch(function(e){return a.dmFailure(e)});break;case"update":h[0][this.fields.text]=s,(l=d.update(p,h[0],c.fromTable,c)).then(function(){return a.editSucess(i,s,o)}).catch(function(e){return a.dmFailure(e,i,o)});break;case"insert":if(1===n.length)l=d.insert(n[0],c.fromTable,c);else{for(var y=[],f=0,g=n.length;f<g;f++)y.push(n[parseInt(f.toString(),10)]);u.addedRecords=y,l=d.saveChanges(u,p,c.fromTable,c)}l.then(function(){var e=a.getElement(i);a.addSuccess(n,e,r),a.preventExpand=!1}).catch(function(e){return a.dmFailure(e)})}},p.prototype.deleteSuccess=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=this.getElement(e[parseInt(i.toString(),10)]);t.push(this.getNode(n)),E.isNullOrUndefined(n)||this.removeNode(n)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent("removeNode",t)},p.prototype.editSucess=function(e,t,i){var e=this.getElement(e),s=E.select("."+hs,e);this.appendNewText(e,s,t,i)},p.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+fs):null;t&&r&&r.classList.contains(O)&&null===t.querySelector("."+L)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+L),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},p.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},p.prototype.updatePreviousText=function(e,t){var e=this.getElement(e),i=E.select("."+hs,e);this.updateText(e,i,this.oldText,t)},p.prototype.getHierarchicalParentId=function(t,e,i){var s=this;if(-1===e.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t}))for(var n=0;n<e.length;n++){var r=E.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]);if(!E.isNullOrUndefined(r)){if(-1!==r.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t})){i.push(e[parseInt(n.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(e[parseInt(n.toString(),10)][this.fields.id].toString(),this.treeData,i);break}this.getHierarchicalParentId(t,r,i)}}return i},p.prototype.onPropertyChanged=function(e,t){for(var i,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":1<this.selectedNodes.length&&(i=this.getElement(this.selectedNodes[0]),this.isLoaded=!1,this.removeSelectAll(),this.selectNode(i,null),this.isLoaded=!0),this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=t.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:E.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.isReact&&(!this.isReact||this.fields.dataSource instanceof x.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),o=0;o<r.length;)"true"!==r[parseInt(o.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(r[parseInt(o.toString(),10)],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},p.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,$s.prototype.destroy.call(this)},p.prototype.addNodes=function(e,t,i,s){if(!E.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var n=this.getElement(t);if(this.preventExpand=s,this.fields.dataSource instanceof x.DataManager)this.isOffline?this.addSuccess(e,n,i):this.crudOperation("insert",null,t,null,e,i,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,n,i);else{if(n)this.addGivenNodes(e,n,i);else{e=this.getSortedData(e);for(var r=0;r<e.length;r++){var o=E.getValue(this.fields.parentID,e[parseInt(r.toString(),10)]),n=o&&this.getElement(o.toString());!E.isNullOrUndefined(o)&&E.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(o),this.preventExpand=s,this.isHiddenItem=!1,n=this.getElement(o.toString())),this.addGivenNodes([e[parseInt(r.toString(),10)]],n,i)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&n&&this.ensureParentCheckState(n),this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},p.prototype.beginEdit=function(e){e=this.getElement(e);E.isNullOrUndefined(e)||this.disabled||this.createTextbox(e)},p.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},p.prototype.collapseAll=function(e,t,i){E.isNullOrUndefined(e)?0<t?this.collapseByLevel(E.select("."+L,this.element),t,i):this.collapseAllNodes(i):this.doGivenAction(e,u,!1)},p.prototype.disableNodes=function(e){E.isNullOrUndefined(e)||this.doDisableAction(e)},p.prototype.enableNodes=function(e){E.isNullOrUndefined(e)||this.doEnableAction(e)},p.prototype.ensureVisible=function(e){var t=[];if(1===this.dataType)for(var i=this.getTreeData(e);0!==i.length&&!E.isNullOrUndefined(i[0][this.fields.parentID]);)t.push(i[0][this.fields.parentID].toString()),i=this.getTreeData(i[0][this.fields.parentID].toString());else 2===this.dataType&&(t=this.getHierarchicalParentId(e,this.treeData,t));this.expandAll(t.reverse(),null,null,this.isHiddenItem);var s=this.getElement(e);E.isNullOrUndefined(s)||("object"==typeof e&&(e=this.parents(s,"."+w),this.expandAll(e)),setTimeout(function(){s.scrollIntoView({behavior:"smooth"})},450))},p.prototype.expandAll=function(e,t,i,s){this.isAnimate=!s,E.isNullOrUndefined(e)?0<t?this.expandByLevel(E.select("."+L,this.element),t,i):(this.expandAllNodes(i),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,O,!0),this.isAnimate=!0},p.prototype.getAllCheckedNodes=function(){return this.checkedNodes},p.prototype.getDisabledNodes=function(){return this.disableNode},p.prototype.getNode=function(e){e=this.getElement(e);return this.getNodeData(e,!0)},p.prototype.getTreeData=function(e){var e=this.getId(e);return this.updatePersistProp(),E.isNullOrUndefined(e)?this.treeData:(e=this.getNodeObject(e),E.isNullOrUndefined(e)?[]:[e])},p.prototype.moveNodes=function(e,t,i,s){if(!E.isNullOrUndefined(e)&&0!==e.length){var n=this.getElement(t),r=[];E.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.ensureVisible(t),this.isHiddenItem=!1,n=this.getElement(t));for(var o=0;o<e.length;o++){var l=this.getElement(e[parseInt(o.toString(),10)]);r.push(this.getNode(l)),E.isNullOrUndefined(l)||n.isSameNode(l)||this.isDescendant(l,n)||(this.preventExpand=s,this.dropAsChildNode(l,n,this,i,null,null,null,n))}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",r)}},p.prototype.refreshNode=function(e,t){if(!E.isNullOrUndefined(e)&&!E.isNullOrUndefined(t)){var i,s,n,r,o,l,a=!1,d=(1===this.dataType&&1<t.length?a=!0:2===this.dataType&&1===t.length&&(d=E.getValue(this.fields.child.toString(),t[0]),E.isNullOrUndefined(d)||(a=!0)),this.getElement(e)),h=d?d.getAttribute("data-uid"):e?e.toString():null;if(this.refreshData=this.getNodeObject(h),t=JSON.parse(JSON.stringify(t)),1===this.dataType&&a){for(var c=0;c<t.length;c++)if(E.isNullOrUndefined(t[parseInt(c.toString(),10)][this.fields.parentID])){s=t[parseInt(c.toString(),10)],t.splice(c,1);break}i=E.extend({},this.refreshData,s)}else i=E.extend({},this.refreshData,t[0]);E.isNullOrUndefined(d)?this.updatePosition(h,i,a,t):(this.isRefreshed=!0,l=parseFloat(d.getAttribute("aria-level")),l=U.ListBase.createListItemFromJson(this.createElement,[i],this.listBaseOption,l),o=E.select("."+L,d),n=E.getValue(this.fields.child.toString(),i),a&&o||a&&!E.isNullOrUndefined(n)?(n=d.parentElement,r=Array.prototype.indexOf.call(n.childNodes,d),E.remove(d),n.insertBefore(l[0],n.childNodes[parseInt(r.toString(),10)]),this.updatePosition(h,i,a,t),a&&o&&this.expandAll([h])):(n=E.select("."+gs,d),r=E.select("."+gs,l[0]),o=E.select("div."+fs,n),l=E.select("div."+fs,r),o&&l&&(l.classList.contains(O)&&o.classList.contains(u)?(E.removeClass([l],O),E.addClass([l],u)):l.classList.contains(u)&&o.classList.contains(O)?(E.removeClass([l],u),E.addClass([l],O)):o.classList.contains("interaction")&&E.addClass([l],"interaction")),E.remove(n),(o=E.select("."+ks,d)).parentNode.insertBefore(r,o.nextSibling),this.updatePosition(h,i,a,t)),d=this.getElement(e),i[this.fields.tooltip]&&d.setAttribute("title",i[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(i,this.fields.htmlAttributes)&&i[this.fields.htmlAttributes]&&(E.merge(l={},i[this.fields.htmlAttributes]),l.class?(E.addClass([d],l.class.split(" ")),delete l.class):E.attributes(d,l)),-1!==this.selectedNodes.indexOf(h)&&(d.setAttribute("aria-selected","true"),E.addClass([d],ps)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(d)]))}},p.prototype.removeNodes=function(e){E.isNullOrUndefined(e)||(this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},p.prototype.updateNode=function(t,i){var s,n,e,r=this;E.isNullOrUndefined(t)||E.isNullOrUndefined(i)||!this.allowEditing||(s=this.getElement(t),E.isNullOrUndefined(s))||(n=E.select("."+hs,s),this.updateOldText(s),e=this.getEditEvent(s,null,null),this.trigger("nodeEditing",e,function(e){e.cancel||(r.fields.dataSource instanceof x.DataManager&&!r.isOffline?r.crudOperation("update",null,t,i,null,null,!1):r.appendNewText(s,n,i,!1))}))},c([E.Property(!(p.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)}))],p.prototype,"allowDragAndDrop",void 0),c([E.Property(!1)],p.prototype,"allowEditing",void 0),c([E.Property(!1)],p.prototype,"allowMultiSelection",void 0),c([E.Property(!1)],p.prototype,"allowTextWrap",void 0),c([E.Complex({},Js)],p.prototype,"animation",void 0),c([E.Property()],p.prototype,"checkedNodes",void 0),c([E.Property(!0)],p.prototype,"checkDisabledChildren",void 0),c([E.Property("")],p.prototype,"cssClass",void 0),c([E.Property(!1)],p.prototype,"disabled",void 0),c([E.Property(null)],p.prototype,"dragArea",void 0),c([E.Property(!0)],p.prototype,"enableHtmlSanitizer",void 0),c([E.Property(!1)],p.prototype,"enablePersistence",void 0),c([E.Property()],p.prototype,"expandedNodes",void 0),c([E.Property("Auto")],p.prototype,"expandOn",void 0),c([E.Complex({},zs)],p.prototype,"fields",void 0),c([E.Property(!0)],p.prototype,"fullRowSelect",void 0),c([E.Property(!0)],p.prototype,"loadOnDemand",void 0),c([E.Property()],p.prototype,"locale",void 0),c([E.Property()],p.prototype,"nodeTemplate",void 0),c([E.Property()],p.prototype,"selectedNodes",void 0),c([E.Property("None")],p.prototype,"sortOrder",void 0),c([E.Property(!1)],p.prototype,"showCheckBox",void 0),c([E.Property(!0)],p.prototype,"autoCheck",void 0),c([E.Property(!1)],p.prototype,"fullRowNavigable",void 0),c([E.Event()],p.prototype,"actionFailure",void 0),c([E.Event()],p.prototype,"created",void 0),c([E.Event()],p.prototype,"dataBound",void 0),c([E.Event()],p.prototype,"dataSourceChanged",void 0),c([E.Event()],p.prototype,"drawNode",void 0),c([E.Event()],p.prototype,"destroyed",void 0),c([E.Event()],p.prototype,"keyPress",void 0),c([E.Event()],p.prototype,"nodeChecked",void 0),c([E.Event()],p.prototype,"nodeChecking",void 0),c([E.Event()],p.prototype,"nodeClicked",void 0),c([E.Event()],p.prototype,"nodeCollapsed",void 0),c([E.Event()],p.prototype,"nodeCollapsing",void 0),c([E.Event()],p.prototype,"nodeDragging",void 0),c([E.Event()],p.prototype,"nodeDragStart",void 0),c([E.Event()],p.prototype,"nodeDragStop",void 0),c([E.Event()],p.prototype,"nodeDropped",void 0),c([E.Event()],p.prototype,"nodeEdited",void 0),c([E.Event()],p.prototype,"nodeEditing",void 0),c([E.Event()],p.prototype,"nodeExpanded",void 0),c([E.Event()],p.prototype,"nodeExpanding",void 0),c([E.Event()],p.prototype,"nodeSelected",void 0),c([E.Event()],p.prototype,"nodeSelecting",void 0);var $s,en,l=en=c([E.NotifyPropertyChanges],p);function p(e,t){e=$s.call(this,e,t)||this;return e.isRefreshed=!1,e.preventExpand=!1,e.checkedElement=[],e.disableNode=[],e.validArr=[],e.validNodes=[],e.expandChildren=[],e.isFieldChange=!1,e.changeDataSource=!1,e.hasTemplate=!1,e.isFirstRender=!1,e.isNodeDropped=!1,e.isInteracted=!1,e.isRightClick=!1,e.mouseDownStatus=!1,e.isDropIn=!1,e.OldCheckedData=[],e.isHiddenItem=!1,e}tn=function(e,t){return(tn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var tn,sn,c=function(e,t){function i(){this.constructor=e}tn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},nn="e-sidebar",rn="e-close",on="e-open",ln="e-transition",an="e-sidebar-overlay",dn="e-right",hn="e-left",cn="e-over",pn="e-push",un="e-slide",mn="e-visibility",fn="e-disable-animation",gn="e-sidebar-context",vn="e-sidebar-absolute",c=(sn=E.Component,c(k,sn),k.prototype.preRender=function(){this.setWidth()},k.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},k.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),E.Browser.isDevice&&(this.windowWidth=window.innerWidth)},k.prototype.setEnableRTL=function(){(this.enableRtl?E.addClass:E.removeClass)([this.element],"e-rtl")},k.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]),E.addClass([this.element],vn),E.addClass([this.target],gn),this.targetEle=this.getTargetElement())},k.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!E.isNullOrUndefined(e)&&e.classList.contains(nn);)e=e.nextElementSibling;return e},k.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},k.prototype.setWidth=function(){this.enableDock&&"Left"===this.position||this.enableDock&&"Right"===this.position?E.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||E.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},k.prototype.setDimension=function(e){return e="number"==typeof e?E.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:E.formatUnit(e):"100%"},k.prototype.setZindex=function(){E.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},k.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&E.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");E.isNullOrUndefined(e||this.targetEle)||E.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||E.addClass([this.element],[mn]),E.removeClass([this.element],[on,rn,dn,hn,un,pn,cn]),this.element.classList.add(nn),E.addClass([this.element],"Right"===this.position?dn:hn),this.enableDock&&E.addClass([this.element],"e-dock"),E.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||E.Browser.isDevice?this.isOpen||E.addClass([this.element],[rn,fn]):this.show()},k.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(rn)||e||this.hide()},k.prototype.transitionEnd=function(e){this.setDock(),E.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,E.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},k.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!E.isNullOrUndefined(this.defaultBackdropDiv)?E.removeClass([this.defaultBackdropDiv],an):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},k.prototype.hide=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!E.isNullOrUndefined(e),event:e||null};this.trigger("close",e,function(e){e.cancel||t.element.classList.contains(rn)||(t.element.classList.contains(on)&&!t.animate&&t.triggerChange(),E.addClass([t.element],rn),E.removeClass([t.element],on),E.setStyleAttribute(t.element,{width:E.formatUnit(t.enableDock?t.dockSize:t.width)}),t.setType(t.type),e=document.querySelector(".e-main-content")||t.targetEle,!t.enableDock&&e&&(e.style.transform="translateX(0px)",e.style["Left"===t.position?"marginLeft":"marginRight"]="0px"),t.destroyBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.remove("e-sidebar-overflow"),t.setProperties({isOpen:!1},!0),t.enableDock&&setTimeout(function(){return t.setTimeOut()},50),E.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},k.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(on)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(rn)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},k.prototype.show=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!E.isNullOrUndefined(e),event:e||null};this.trigger("open",e,function(e){e.cancel||(E.removeClass([t.element],[mn,fn]),t.element.classList.contains(on))||(t.element.classList.contains(rn)&&!t.animate&&t.triggerChange(),E.addClass([t.element],[on,ln]),E.setStyleAttribute(t.element,{transform:""}),E.removeClass([t.element],rn),E.setStyleAttribute(t.element,{width:E.formatUnit(t.width)}),t.setType(t.type),t.createBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.add("e-sidebar-overflow"),t.setProperties({isOpen:!0},!0),E.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},k.prototype.setAnimation=function(){this.animate?E.removeClass([this.element],fn):E.addClass([this.element],fn)},k.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},k.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?E.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&E.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(rn)&&this.enableDock&&E.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},k.prototype.createBackDrop=function(){var e,t;this.target&&this.showBackdrop&&this.getState()?(e=this.target,t=document.querySelector(".e-main-content")||this.targetEle,this.defaultBackdropDiv=this.createElement("div"),E.addClass([this.defaultBackdropDiv],an),E.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),t.appendChild(this.defaultBackdropDiv)):this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className=an,this.modal.style.display="block",document.body.appendChild(this.modal))},k.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},k.prototype.getModuleName=function(){return"sidebar"},k.prototype.toggle=function(){this.element.classList.contains(on)?this.hide():this.show()},k.prototype.getState=function(){return!!this.element.classList.contains(on)},k.prototype.setMediaQuery=function(){this.mediaQuery&&(("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide())},k.prototype.resize=function(){E.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(E.Browser.isDevice?E.addClass([this.element],cn):E.addClass([this.element],pn)),this.setMediaQuery(),E.Browser.isDevice&&(this.windowWidth=window.innerWidth)},k.prototype.documentclickHandler=function(e){E.closest(e.target,".e-control."+nn)||this.hide(e)},k.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&50<=e.distanceX&&.5<=e.velocity?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection||this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&50<=e.distanceX&&.5<=e.velocity&&this.show()},k.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new E.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new E.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},k.prototype.wireEvents=function(){this.setEnableGestures(),E.EventHandler.add(window,"resize",this.resize,this)},k.prototype.unWireEvents=function(){E.EventHandler.remove(window,"resize",this.resize),E.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},k.prototype.onPropertyChanged=function(e,t){for(var i=document.querySelector(".e-main-content")||this.targetEle,s=this.isServerRendered,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){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),E.removeClass([this.element],[mn]),this.addClass(),E.addClass([this.element],"Auto"===this.type?E.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),i&&(i.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(E.removeClass([this.element],hn),E.addClass([this.element],dn)):(E.removeClass([this.element],dn),E.addClass([this.element],hn)),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),E.isNullOrUndefined(this.target)&&(E.removeClass([this.element],vn),E.removeClass([t.target],gn),E.setStyleAttribute(i,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,sn.prototype.refresh.call(this),this.isServerRendered=s;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()}},k.prototype.setType=function(e){var t=this.element.getBoundingClientRect().width,i=(this.setZindex(),document.querySelector(".e-main-content")||this.targetEle),s=(i&&(i.style.transform="translateX(0px)",E.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(i.style["Left"===this.position?"marginLeft":"marginRight"]="0px")),this.position,t+"px"),n="Left"===this.position?t:-t;switch(E.removeClass([this.element],[pn,cn,un]),e){case"Push":E.addClass([this.element],[pn]),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s);break;case"Slide":E.addClass([this.element],[un]),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style.transform="translateX("+n+"px)");break;case"Over":E.addClass([this.element],[cn]),this.enableDock&&(this.element.classList.contains(rn)||this.isOpen)&&i&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":E.addClass([this.element],[ln]),E.Browser.isDevice?i&&this.enableDock&&!this.getState()?(i.style["Left"===this.position?"marginLeft":"marginRight"]=s,E.addClass([this.element],pn)):E.addClass([this.element],cn):(E.addClass([this.element],pn),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s)),this.createBackDrop()}},k.prototype.destroy=function(){sn.prototype.destroy.call(this),this.target&&E.removeClass([this.target],gn),this.destroyBackDrop(),this.element&&(E.removeClass([this.element],[on,rn,pn,un,cn,hn,dn,ln,fn]),E.removeClass([this.element],vn),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",E.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var e=document.querySelector(".e-main-content")||this.targetEle;E.isNullOrUndefined(e)||(e.style.margin="",e.style.transform=""),this.unWireEvents()},f([E.Property("auto")],k.prototype,"dockSize",void 0),f([E.Property(null)],k.prototype,"mediaQuery",void 0),f([E.Property(!1)],k.prototype,"enableDock",void 0),f([E.Property("en-US")],k.prototype,"locale",void 0),f([E.Property(!1)],k.prototype,"enablePersistence",void 0),f([E.Property(!0)],k.prototype,"enableGestures",void 0),f([E.Property(!1)],k.prototype,"isOpen",void 0),f([E.Property(!1)],k.prototype,"enableRtl",void 0),f([E.Property(!0)],k.prototype,"animate",void 0),f([E.Property("auto")],k.prototype,"height",void 0),f([E.Property(!1)],k.prototype,"closeOnDocumentClick",void 0),f([E.Property("Left")],k.prototype,"position",void 0),f([E.Property(null)],k.prototype,"target",void 0),f([E.Property(!1)],k.prototype,"showBackdrop",void 0),f([E.Property("Auto")],k.prototype,"type",void 0),f([E.Property("auto")],k.prototype,"width",void 0),f([E.Property(1e3)],k.prototype,"zIndex",void 0),f([E.Event()],k.prototype,"created",void 0),f([E.Event()],k.prototype,"close",void 0),f([E.Event()],k.prototype,"open",void 0),f([E.Event()],k.prototype,"change",void 0),f([E.Event()],k.prototype,"destroyed",void 0),f([E.NotifyPropertyChanges],k));function k(e,t){e=sn.call(this,e,t)||this;return e.documentClickContext=e.documentclickHandler.bind(e),e}yn=function(e,t){return(yn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var yn,bn,f=function(e,t){function i(){this.constructor=e}yn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},A=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Cn="e-icon-right",Sn="e-breadcrumb-text",In="e-breadcrumb-icon",En="e-breadcrumb-menu",xn="e-breadcrumb-item",Nn="e-breadcrumb-popup",On="e-breadcrumb-wrap-mode",wn="e-breadcrumb-scroll-mode",Ln="tabindex",kn="e-disabled",An="aria-disabled",Tn=".",Pn=((Pn=a.BreadcrumbOverflowMode||(a.BreadcrumbOverflowMode={})).Hidden="Hidden",Pn.Collapsed="Collapsed",Pn.Menu="Menu",Pn.Wrap="Wrap",Pn.Scroll="Scroll",Pn.None="None",bn=E.ChildProperty,f(Dn,bn),A([E.Property("")],Dn.prototype,"text",void 0),A([E.Property("")],Dn.prototype,"id",void 0),A([E.Property("")],Dn.prototype,"url",void 0),A([E.Property(null)],Dn.prototype,"iconCss",void 0),A([E.Property(!1)],Dn.prototype,"disabled",void 0),Dn);function Dn(){return null!==bn&&bn.apply(this,arguments)||this}Mn=E.Component,f(T,Mn),T.prototype.preRender=function(){},T.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},T.prototype.initialize=function(){this._maxItems=this.maxItems,E.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&E.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(kn),this.element.setAttribute(An,"true")),"Wrap"===this.overflowMode?this.element.classList.add(On):"Scroll"===this.overflowMode&&this.element.classList.add(wn),this.initItems(),this.initPvtProps()},T.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&0<this._maxItems&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(0<=this._maxItems?(this.startIndex=1<this._maxItems?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},T.prototype.getEndIndex=function(){var i,s=this;return this.activeItem?this.items.forEach(function(e,t){e.url!==s.activeItem&&e.text!==s.activeItem||(i=t)}):i=this.items.length-1,i},T.prototype.initItems=function(){if(!this.items.length){var e,t=void 0,i=void 0,s=[];i=(this.url?(t=(e=new URL(this.url,window.location.origin)).origin+"/",e):(t=window.location.origin+"/",window.location)).href.split(t)[1].split("/"),s.push({iconCss:"e-icons e-home",url:t});for(var n=0;n<i.length;n++)i[n]&&(s.push({text:i[n],url:t+i[n]}),t+=i[n]+"/");this.setProperties({items:s},!0)}},T.prototype.renderItems=function(e){var t,i,n=this,r=this.element.classList.contains(Cn),s=e.length;if(s){for(var o,l,a=void 0,d=0,h=void 0,c=2*s-1,p=!1,u=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),f=this.hasField(e,"iconCss"),g="Collapsed"===this.overflowMode&&0<this._maxItems&&s>this._maxItems&&!this.isExpanded,v="Hidden"===this.overflowMode&&0<this._maxItems,y=("Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML=""),{moduleName:this.getModuleName(),showIcon:f,itemNavigable:!0,itemCreated:function(e){var t=e.curData.isLastItem,i=(t&&e.item.children.length&&!n.itemTemplate&&(delete e.curData.isLastItem,l||n.enableActiveItemNavigation||(e.item.innerHTML=n.createElement("span",{className:Sn,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||n.itemTemplate||e.item.classList.add("e-icon-item"),v&&e.item.setAttribute("item-index",d.toString()),{item:E.extend({},e.curData.properties||e.curData),element:e.item,cancel:!1}),s=(n.trigger("beforeItemRender",i),p=i.cancel,r||i.element.classList.contains(Cn));s&&e.curData.iconCss&&!n.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(Tn+In)),i.item.disabled&&(e.item.setAttribute(An,"true"),e.item.classList.add(kn)),i.item.id&&e.item.setAttribute("id",i.item.id),(i.item.disabled||n.disabled)&&e.item.children.length&&!n.itemTemplate&&e.item.children[0].setAttribute(Ln,"-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),t&&!n.enableActiveItemNavigation||i.item.disabled||n.disabled||(e.item.children[0].setAttribute(Ln,"0"),E.EventHandler.add(e.item.children[0],"keydown",n.keyDownHandler,n))),e.item.removeAttribute("role"),t&&e.item.setAttribute("data-active-item",""),n.itemTemplate||n.beforeItemRenderChanges(e.curData,i.item,e.item,s)}}),b=0;b<c;b%2&&d++,b++)if(o=this.activeItem&&(this.activeItem===e[d].url||this.activeItem===e[d].text),!(g&&1<b&&b<c-2)&&(!v||!(d<this.startIndex||d>this.endIndex)||b%2&&d===this.startIndex-1||0===d)){b%2?(h=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||E.isNullOrUndefined(this.separatorTemplate)?y.template=E.initializeCSPTemplate(function(){return"/"}):y.template=this.separatorTemplate,i=!(y.itemClass="e-breadcrumb-separator"),t=[{previousItem:e[d],nextItem:e[d+1]}]):(y.itemClass="",i=!this.itemTemplate||(y.template=this.itemTemplate,!1),(t=[E.extend({},e[d].properties||e[d])])[0].url||this.itemTemplate||(t=[E.extend({},t[0],{isEmptyUrl:!0,url:"#"})]),a=(v||"Menu"===this.overflowMode)&&d===this.endIndex,(b!==c-1&&!a||this.itemTemplate)&&!o||(t[0].isLastItem=!0));var C=u,S=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(d>=this.startIndex&&d<=S&&(!(b%2)||d!==S)&&this.endIndex>=this._maxItems&&0<this._maxItems||0===this._maxItems)){if(b%2)continue;C=this.popupUl,a&&(l=!0)}else"Wrap"===this.overflowMode&&(C=0===b?m:h);var S=U.ListBase.createList(this.createElement,t,y,i,this).childNodes;if(p){if(v||g||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(d,1),this.initPvtProps(),this.reRenderItems();b!==c-1&&!a||E.remove(C.lastElementChild)}else E.append(S,C);if("Wrap"===this.overflowMode&&0!==b&&b%2==0&&u.appendChild(h),g&&1===b&&(S=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}}),E.EventHandler.add(S,"keyup",this.expandHandler,this),u.appendChild(S)),"Menu"===this.overflowMode&&this.startIndex===b&&this.endIndex>=this._maxItems&&0<=this._maxItems&&(C=this.getMenuElement(),E.EventHandler.add(C,"keyup",this.keyDownHandler,this),u.appendChild(C)),o||a)break;p&&b++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){n.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(m),this.element.appendChild(u),this.isReact||this.calculateMaxItems()}},T.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e,t,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);"Menu"===this.overflowMode&&(t=this.getMenuElement(),this.element.appendChild(t),n+=t.offsetWidth,E.remove(t));for(var r=0;r<s.length-2;r++){if(i<n){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(-1<this.maxItems&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&i<(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth))return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(En)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&0<this._maxItems){i=0;if((s=this.element.querySelectorAll(Tn+xn)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},T.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},T.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},T.prototype.beforeItemRenderChanges=function(e,t,i,s){var n,r=i.querySelector(".e-anchor-wrap");r&&r.parentElement.setAttribute("aria-label","home"),t.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=t.text)}),t.iconCss!==e.iconCss&&r&&((n=i.querySelector(Tn+In))?t.iconCss?(E.removeClass([n],e.iconCss.split(" ")),E.addClass([n],t.iconCss.split(" "))):E.remove(n):t.iconCss&&(n=this.createElement("span",{className:In+" "+t.iconCss}),s?E.append([n],r):r.insertBefore(n,r.childNodes[0]))),t.url!==e.url&&this.enableNavigation&&(s=i.querySelector("a."+Sn))&&(t.url?s.setAttribute("href",t.url):s.removeAttribute("href"))},T.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},T.prototype.clickHandler=function(e){var t=E.closest(e.target,Tn+xn+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),t&&(E.closest(e.target,Tn+Sn)||this.itemTemplate)){var i=void 0,i=("Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(Tn+xn)):[].slice.call(t.parentElement.children)).indexOf(t),t=("Menu"===this.overflowMode?E.closest(e.target,Tn+Nn)?(i+=this.startIndex,this.endIndex=i,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector(Tn+En)?i>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(Tn+En))?(i+=2*this.popupUl.childElementCount-2,i=Math.floor(i/2),this.endIndex=i):this.startIndex=this.endIndex=i:(i=Math.floor(i/2),this.startIndex=this.endIndex=i):i=Math.floor(i/2),"Hidden"===this.overflowMode&&0<this._maxItems&&0!==this.endIndex&&(i=parseInt(t.getAttribute("item-index"),10),1<this.startIndex&&(this.startIndex-=this.endIndex-i),this.endIndex=i),{element:t,item:this.items[i],event:e,cancel:!1});if(this.trigger("itemClick",t),t.cancel)return;this.items[i]&&(this.activeItem=this.items[i].url||this.items[i].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(En)&&!this.isPopupCreated&&this.renderPopup()},T.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:Nn+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new g.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector(Tn+En),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},T.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!E.closest(e.target,Tn+En)&&!E.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element))},T.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},T.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},T.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},T.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},T.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===t.overflowMode?this.element.classList.remove(On):"Wrap"===e.overflowMode&&this.element.classList.add(On),"Scroll"===t.overflowMode?this.element.classList.remove(wn):"Scroll"===e.overflowMode&&this.element.classList.add(wn);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(t.cssClass&&-1<t.cssClass.indexOf(Cn)&&!(e.cssClass&&-1<e.cssClass.indexOf(Cn))||!(t.cssClass&&-1<t.cssClass.indexOf(Cn))&&e.cssClass&&-1<e.cssClass.indexOf(Cn))&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(kn),this.element.setAttribute(An,e.disabled+"")}},T.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),E.EventHandler.add(document,"click",this.delegateClickHanlder,this),E.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},T.prototype.popupWireEvents=function(){E.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),E.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},T.prototype.unWireEvents=function(){E.EventHandler.remove(document,"click",this.delegateClickHanlder),E.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(E.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),E.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},T.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},T.prototype.getModuleName=function(){return"breadcrumb"},T.prototype.destroy=function(){var t=this,e=(this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element)),[]),i=["aria-label"];this.cssClass&&e.concat(this.cssClass.split(" ")),this.enableRtl&&e.push("e-rtl"),this.disabled&&(e.push(kn),i.push(An)),"Wrap"===this.overflowMode?e.push(On):"Scroll"===this.overflowMode&&e.push(wn),this.unWireEvents(),this.element.innerHTML="",E.removeClass([this.element],e),i.forEach(function(e){t.element.removeAttribute(e)}),Mn.prototype.destroy.call(this)},A([E.Property("")],T.prototype,"url",void 0),A([E.Collection([],Pn)],T.prototype,"items",void 0),A([E.Property("")],T.prototype,"activeItem",void 0),A([E.Property(-1)],T.prototype,"maxItems",void 0),A([E.Property("Menu")],T.prototype,"overflowMode",void 0),A([E.Property("")],T.prototype,"cssClass",void 0),A([E.Property(null)],T.prototype,"itemTemplate",void 0),A([E.Property("/")],T.prototype,"separatorTemplate",void 0),A([E.Property(!0)],T.prototype,"enableNavigation",void 0),A([E.Property(!1)],T.prototype,"enableActiveItemNavigation",void 0),A([E.Property(!1)],T.prototype,"disabled",void 0),A([E.Property("")],T.prototype,"locale",void 0),A([E.Event()],T.prototype,"beforeItemRender",void 0),A([E.Event()],T.prototype,"itemClick",void 0),A([E.Event()],T.prototype,"created",void 0);var Mn,f=A([E.NotifyPropertyChanges],T);function T(e,t){e=Mn.call(this,e,t)||this;return e.isPopupCreated=!1,e}Hn=function(e,t){return(Hn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Hn,Un,A=function(e,t){function i(){this.constructor=e}Hn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},P=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Rn="e-carousel",Bn="e-active",jn="e-rtl",qn="e-partial",Fn="e-swipe",Wn="e-carousel-slide-container",Vn="e-carousel-items",_n="e-carousel-item",zn="e-previous",Kn="e-carousel-navigators",Xn="e-carousel-indicators",Yn="e-indicator-bars",Gn="e-indicator-bar",Qn="e-indicator",Jn="e-icons",Zn="e-play-pause",$n="e-play-icon",er="e-pause-icon",tr="e-previous-button",ir="e-next-button",sr="e-play-button",nr="e-round",rr="e-hover-arrows",or="e-carousel-hover",lr="e-template",ar="e-carousel-slide-animation",dr="e-carousel-fade-animation",hr="e-carousel-custom-animation",cr="e-carousel-animation-none",pr="e-prev",ur="e-next",mr="e-transition-start",fr="e-transition-end",gr=((gr=a.CarouselSwipeMode||(a.CarouselSwipeMode={}))[gr.Touch=1]="Touch",gr[gr.Mouse=2]="Mouse",Un=E.ChildProperty,A(vr,Un),P([E.Property()],vr.prototype,"cssClass",void 0),P([E.Property()],vr.prototype,"interval",void 0),P([E.Property()],vr.prototype,"template",void 0),P([E.Property()],vr.prototype,"htmlAttributes",void 0),vr);function vr(){return null!==Un&&Un.apply(this,arguments)||this}yr=E.Component,A(D,yr),D.prototype.getModuleName=function(){return Rn.replace("e-","")},D.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},D.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new E.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},D.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},D.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++){var r,o=n[s];switch(o){case"animationEffect":this.applyAnimation();break;case"cssClass":E.classList(this.element,[e.cssClass],[t.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,t.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector("."+Vn)&&this.renderTouchActions();break;case"loop":this.loop&&E.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),e.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":(r=[].slice.call(this.element.querySelectorAll("."+tr+",\n ."+ir+", ."+sr))).push(this.element),this.enableRtl?E.addClass(r,jn):E.removeClass(r,jn),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(r=this.loop?this.getNumOfItems():0,l=this.itemsContainer.firstElementChild.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(l,this.selectedIndex+r));break;case"buttonsVisibility":if(i=this.element.querySelector("."+Kn))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),E.remove(i);break;case"VisibleOnHover":E.addClass([].slice.call(i.childNodes),rr);break;case"Visible":E.removeClass([].slice.call(i.childNodes),rr)}else this.renderNavigators(),this.renderPlayButton();break;case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(this.width)});break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&E.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(i=this.element.querySelector("."+Xn))&&(this.resetTemplates(["indicatorsTemplate"]),E.remove(i)),this.renderIndicators();break;case"showPlayButton":i=this.element.querySelector("."+Zn),!this.showPlayButton&&i&&(E.remove(i),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var l="dataSource"===o?this.dataSource:this.items;!E.isNullOrUndefined(l)&&0<l.length&&this.selectedIndex>=l.length&&(this.setActiveSlide(l.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?E.addClass([this.element],qn):E.removeClass([this.element],qn),this.reRenderSlides();break;case"swipeMode":E.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),E.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),E.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},D.prototype.reRenderSlides=function(){var e=this.element.querySelector("."+Vn);e&&(this.resetTemplates(["itemTemplate"]),E.remove(e)),this.renderSlides()},D.prototype.reRenderIndicators=function(){var e=this.element.querySelector("."+Xn);e&&(this.resetTemplates(["indicatorsTemplate"]),E.remove(e)),this.renderIndicators()},D.prototype.initialize=function(){var e=[];e.push(Rn),this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push(jn),this.partialVisible&&e.push(qn),this.swipeMode!==(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)&&e.push(Fn),E.addClass([this.element],e),E.setStyleAttribute(this.element,{width:E.formatUnit(this.width),height:E.formatUnit(this.height)}),E.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},D.prototype.renderSlides=function(){var i=this,e=this.element.querySelector("."+Wn),e=(e||(e=this.createElement("div",{className:Wn,attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(e)),this.itemsContainer=this.createElement("div",{className:Vn,attrs:{"aria-live":this.autoPlay?"off":"polite"}}),e.appendChild(this.itemsContainer),this.getNumOfItems()),t=(0<e&&this.loop&&(0<this.items.length?this.items.slice(-e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(-e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),0<this.items.length?(this.slideItems=this.items,this.items.forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer)})):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer)})),0<e&&this.loop&&(0<this.items.length?this.items.slice(0,e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(0,e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length),E.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth),e=(this.itemsContainer.style.transitionProperty="none",this.loop?e:0);this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},D.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},D.prototype.renderSlide=function(e,t,i,s,n){void 0===n&&(n=!1);i=this.createElement("div",{id:E.getUniqueID("carousel_item"),className:_n+" "+(e.cssClass||"")+" "+(this.selectedIndex!==i||n?"":Bn),attrs:{"aria-hidden":this.selectedIndex!==i||n?"true":"false","data-index":i.toString(),role:"group","aria-roledescription":"slide"}}),n&&i.classList.add("e-cloned"),E.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,i),n=this.element.id+"_template",t=this.templateParser(t)(e,this,"itemTemplate",n,!1);E.append(t,i),s.appendChild(i)},D.prototype.renderNavigators=function(){var e;"Hidden"!==this.buttonsVisibility&&(e=this.createElement("div",{className:Kn}),this.element.querySelector("."+Wn).insertAdjacentElement("afterend",e),!E.isNullOrUndefined(this.slideItems)&&1<this.slideItems.length&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates())},D.prototype.renderNavigatorButton=function(e){var t,i,s=this.createElement("div",{className:("Previous"===e?zn:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?rr:"")});"Previous"===e&&this.previousButtonTemplate?(E.addClass([s],lr),i=this.element.id+"_previousButtonTemplate",t=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",i,!1),E.append(t,s)):"Next"===e&&this.nextButtonTemplate?(E.addClass([s],lr),i=this.element.id+"_nextButtonTemplate",t=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",i,!1),E.append(t,s)):(i=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}}),new R.Button({cssClass:"e-flat "+nr+" "+("Previous"===e?tr:ir),iconCss:Jn+" "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(i),s.appendChild(i)),this.element.querySelector("."+Kn).appendChild(s),E.EventHandler.add(s,"click",this.navigatorClickHandler,this)},D.prototype.renderPlayButton=function(){var e,t,i,s;E.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1||(e=this.createElement("div",{className:Zn+" "+("VisibleOnHover"===this.buttonsVisibility?rr:"")}),this.playButtonTemplate?(E.addClass([e],lr),t=this.element.id+"_playButtonTemplate",t=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",t,!1),E.append(t,e)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=new R.Button({cssClass:"e-flat "+nr+" "+sr,iconCss:Jn+" "+(this.autoPlay&&!s?er:$n),isToggle:!0,enableRtl:this.enableRtl}),s&&(this.setProperties({autoPlay:!1},!0),t.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),i.appendTo(t),e.appendChild(t)),(s=this.element.querySelector("."+Kn)).insertBefore(e,s.lastElementChild),this.renderTemplates(),E.EventHandler.add(e,"click",this.playButtonClickHandler,this))},D.prototype.renderIndicators=function(){var s=this;if(this.showIndicators&&!E.isNullOrUndefined(this.indicatorsType)){var e,t="e-default",t=(this.indicatorsTemplate||(t="e-"+this.indicatorsType.toLowerCase()),this.createElement("div",{className:Xn+" "+t})),n=this.createElement("div",{className:Yn});if(t.appendChild(n),this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):((e=this.createElement("div",{className:Gn})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),e.style.setProperty("--carousel-items-count",""+this.slideItems.length),n.appendChild(e));break;case"Default":case"Dynamic":this.slideItems.forEach(function(e,t){var i=s.createElement("div",{className:Gn+" "+(s.selectedIndex===t?Bn:s.selectedIndex-1===t?pr:s.selectedIndex+1===t?ur:""),attrs:{"data-index":t.toString(),"aria-current":s.selectedIndex===t?"true":"false"}});i.style.setProperty("--carousel-items-current",""+s.selectedIndex),s.indicatorsTemplate?s.renderIndicatorTemplate(i,t):"Default"===s.indicatorsType&&(t=s.createElement("button",{className:Qn,attrs:{type:"button","aria-label":s.localeObj.getConstant("slide")+" "+(t+1)+" "+s.localeObj.getConstant("of")+" "+s.slideItems.length}}),i.appendChild(t),t.appendChild(s.createElement("div",{})),new R.Button({cssClass:"e-flat e-small"}).appendTo(t)),n.appendChild(i),"Default"===s.indicatorsType&&E.EventHandler.add(i,"click",s.indicatorClickHandler,s)})}this.element.appendChild(t)}},D.prototype.renderIndicatorTemplate=function(e,t){void 0===t&&(t=0),E.addClass([e],lr);var i=this.element.id+"_indicatorsTemplate",t=this.templateParser(this.indicatorsTemplate)({index:t,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",i,!1);E.append(t,e)},D.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},D.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new E.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},D.prototype.applyAnimation=function(){switch(E.removeClass([this.element],[hr,dr,ar,cr]),this.animationEffect){case"Slide":E.addClass([this.element],ar);break;case"Fade":E.addClass([this.element],dr);break;case"None":E.addClass([this.element],cr);break;case"Custom":E.addClass([this.element],hr)}},D.prototype.autoSlide=function(){E.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},D.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+_n+"."+Bn)||this.element.querySelector("."+Xn+" ."+Bn);E.isNullOrUndefined(e)||(e=parseInt(e.dataset.index,10),this.loop||e!==this.slideItems.length-1?(e=(e+1)%this.slideItems.length,this.element.classList.contains(or)||this.setActiveSlide(e,"Next"),this.autoSlide()):this.resetSlideInterval())},D.prototype.applySlideInterval=function(){var e,t=this;this.autoPlay&&!this.element.classList.contains(or)&&(e=this.interval,0<this.items.length&&!E.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(e=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return t.autoSlideChange()},e))},D.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},D.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},D.prototype.setActiveSlide=function(s,n,r){var o,l,e,t,a=this;void 0===r&&(r=!1),0<this.element.querySelectorAll("."+_n+"."+pr+",."+_n+"."+ur).length||(s=E.isNullOrUndefined(s)?0:s,o=[].slice.call(this.element.querySelectorAll("."+_n+":not(.e-cloned)")),t=this.element.querySelector("."+_n+"."+Bn),E.isNullOrUndefined(t)&&this.showIndicators?(e=this.element.querySelector("."+Gn+"."+Bn),e=parseInt(e.dataset.index,10),E.addClass([o[parseInt(e.toString(),10)]],Bn)):E.isNullOrUndefined(t)?E.addClass([o[parseInt(s.toString(),10)]],Bn):(l=parseInt(t.dataset.index,10),e=o[parseInt(s.toString(),10)],t={currentIndex:l,nextIndex:s,currentSlide:t,nextSlide:e,slideDirection:n,isSwiped:r,cancel:!1},this.trigger("slideChanging",t,function(e){var t,i;e.cancel||(a.setProperties({selectedIndex:s},!0),E.attributes(e.currentSlide,{"aria-hidden":"true"}),E.attributes(e.nextSlide,{"aria-hidden":"false"}),a.refreshIndicators(l,s),a.slideChangedEventArgs={currentIndex:e.nextIndex,previousIndex:e.currentIndex,currentSlide:e.nextSlide,previousSlide:e.currentSlide,slideDirection:n,isSwiped:r},t=o[parseInt(s.toString(),10)].clientWidth,i=a.getNumOfItems(),a.isSwipe||(a.itemsContainer.style.transitionDuration="0.6s"),a.isSwipe=!1,"Fade"===a.animationEffect?a.itemsContainer.classList.add("e-fade-in-out"):a.itemsContainer.style.transitionProperty="transform",a.loop?0===a.slideChangedEventArgs.currentIndex&&"Next"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.getTranslateX(t,o.length+i):a.slideChangedEventArgs.currentIndex===a.slideItems.length-1&&"Previous"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.partialVisible?a.getTranslateX(t):"translateX(0px)":a.itemsContainer.style.transform=a.getTranslateX(t,s+i):a.itemsContainer.style.transform=a.getTranslateX(t,s),"Slide"===a.animationEffect?"Previous"===n?(E.addClass([e.nextSlide],pr),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),E.addClass([e.currentSlide,e.nextSlide],fr)):(E.addClass([e.nextSlide],ur),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),E.addClass([e.currentSlide,e.nextSlide],mr)):"Fade"===a.animationEffect?(E.removeClass([e.currentSlide],Bn),E.addClass([e.nextSlide],Bn)):"Custom"===a.animationEffect?"Previous"===n?(E.addClass([e.nextSlide],ur),E.addClass([e.currentSlide],pr)):(E.addClass([e.currentSlide],pr),E.addClass([e.nextSlide],ur)):a.onTransitionEnd(),a.handleNavigatorsActions(s))})))},D.prototype.onTransitionEnd=function(){var e,t=this,i=(E.removeClass(this.element.querySelectorAll("."+Vn),"e-fade-in-out"),this.getNumOfItems());this.slideChangedEventArgs&&(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)&&(e=this.slideChangedEventArgs.currentSlide.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(e,this.slideChangedEventArgs.currentIndex+i)),E.addClass([this.slideChangedEventArgs.currentSlide],Bn),E.removeClass([this.slideChangedEventArgs.previousSlide],Bn),this.trigger("slideChanged",this.slideChangedEventArgs,function(){E.removeClass(t.element.querySelectorAll("."+_n),[pr,ur,mr,fr]),t.slideChangedEventArgs=null}))},D.prototype.refreshIndicators=function(e,t){var i=this,s=this.element.querySelector("."+Yn);if(!E.isNullOrUndefined(s)){var n=[].slice.call(s.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":E.attributes(n[parseInt(e.toString(),10)],{"aria-current":"false"}),E.attributes(n[parseInt(t.toString(),10)],{"aria-current":"true"}),E.removeClass(n,[Bn,pr,ur]),E.addClass([n[parseInt(t.toString(),10)]],Bn),n[t-1]&&E.addClass([n[t-1]],pr),n[t+1]&&E.addClass([n[t+1]],ur),n.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+i.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},D.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?E.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},D.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}},D.prototype.getNavigatorState=function(e,t){e=e.querySelector("."+(t?tr:ir));return!!e&&E.getInstance(e,R.Button).disabled},D.prototype.navigatorClickHandler=function(e){var e=e.currentTarget;this.getNavigatorState(e,e.classList.contains(zn))||(e=e.classList.contains(zn)?"Previous":"Next",this.setActiveSlide(this.getSlideIndex(e),e),this.autoSlide())},D.prototype.indicatorClickHandler=function(e){e=E.closest(e.target,"."+Gn),e=parseInt(e.dataset.index,10);this.selectedIndex!==e&&(this.setActiveSlide(e,this.selectedIndex>e?"Previous":"Next"),this.autoSlide())},D.prototype.playButtonClickHandler=function(e,t){void 0===t&&(t=!1);var i,s=this.element.querySelector("."+sr);s&&(i=E.getInstance(s,R.Button),t||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),i.iconCss=Jn+" "+(this.autoPlay?er:$n),i.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide())},D.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var t,i,s=!1,n=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&n.classList.contains(Qn)?n.click():n.classList.contains(Rn)||n.classList.contains(sr)?this.playButtonClickHandler(e):n.classList.contains(ir)?this.next():n.classList.contains(tr)&&this.prev();break;case"end":i=this.slideItems.length-1,t="Next",s=!0;break;case"home":t="Previous",s=!(i=0);break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&E.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),t="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",i=this.getSlideIndex(t),s=!this.isSuspendSlideTransition(i,t)}s&&(this.setActiveSlide(i,t),this.autoSlide())}},D.prototype.swipeHandler=function(e){var t;this.element.classList.contains(or)||E.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(e="Right"===e.swipeDirection?"Previous":"Next",t=this.getSlideIndex(e),this.isSuspendSlideTransition(t,e))||(this.setActiveSlide(t,e,!0),this.autoSlide())},D.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},D.prototype.handleNavigatorsActions=function(e){var t,i,s,n;"Hidden"!==this.buttonsVisibility&&(this.showPlayButton&&(t=this.element.querySelector("."+sr),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=E.isNullOrUndefined(this.playButtonTemplate)&&t&&s,i=E.isNullOrUndefined(this.playButtonTemplate)&&t&&!s?!t.classList.contains(Bn):i)&&(this.setProperties({autoPlay:!s},!0),t.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(n=E.getInstance(t,R.Button)).iconCss=Jn+" "+(this.autoPlay?er:$n),n.dataBind()),(i=this.element.querySelector("."+tr))&&E.isNullOrUndefined(this.previousButtonTemplate)&&((n=E.getInstance(i,R.Button)).disabled=!this.loop&&0===e,n.dataBind()),s=this.element.querySelector("."+ir))&&E.isNullOrUndefined(this.nextButtonTemplate)&&((n=E.getInstance(s,R.Button)).disabled=!this.loop&&e===this.slideItems.length-1,n.dataBind())},D.prototype.onHoverActions=function(e){var t=this.element.querySelector("."+Kn);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&t&&E.removeClass([].slice.call(t.childNodes),rr),this.pauseOnHover&&E.addClass([this.element],or);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&t&&E.addClass([].slice.call(t.childNodes),rr),E.removeClass([this.element],or),this.isSwipe&&this.swipStop()}this.autoSlide()},D.prototype.onFocusActions=function(e){switch(e.type){case"focusin":E.addClass([this.element],or);break;case"focusout":E.removeClass([this.element],or)}this.autoSlide()},D.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=t[e],i=E.getInstance(i,R.Button);i&&i.destroy()}},D.prototype.getNumOfItems=function(){return this.partialVisible?2:1},D.prototype.getTranslateValue=function(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0},D.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=(e.touches?e.touches[0]:e).pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},D.prototype.swiping=function(e){this.itemsContainer.classList.contains("e-swipe-start")&&(this.isSwipe=!0,e.preventDefault(),e=(e.touches?e.touches[0]:e).pageX,e=this.prevPageX-e,!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&0<e||this.selectedIndex===this.itemsContainer.childElementCount-1&&e<0)||!this.enableRtl&&(0===this.selectedIndex&&e<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&0<e))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?e:-e))+"px)"))},D.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,t=(t=this.getTranslateValue(this.itemsContainer)-this.initialTranslate)<0?-1*t:t;this.isSwipe&&(i=t*(E.Browser.isDevice?6:1.66),this.itemsContainer.style.transitionDuration=(E.Browser.isDevice?t:i)/e/10+"s");var t=this.itemsContainer.firstElementChild.clientWidth/2,i=(this.itemsContainer.classList.remove("e-swipe-start"),this.getTranslateValue(this.itemsContainer));i-this.initialTranslate<-t?this.swipeNavigation(!this.enableRtl):i-this.initialTranslate>t?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},D.prototype.swipeNavigation=function(e){e?this.next():this.prev()},D.prototype.swipeModehandlers=function(){(this.swipeMode&a.CarouselSwipeMode.Touch)===a.CarouselSwipeMode.Touch&&(E.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&a.CarouselSwipeMode.Mouse)===a.CarouselSwipeMode.Mouse&&(E.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)==(a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)&&(E.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},D.prototype.resizeHandler=function(){var e,t;this.itemsContainer&&this.itemsContainer.firstElementChild&&(e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth,this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex))},D.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.enableTouchSwipe&&this.swipeModehandlers(),E.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),E.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),E.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),E.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),E.EventHandler.add(window,"resize",this.resizeHandler,this)},D.prototype.unWireEvents=function(){var t=this;[].slice.call(this.element.querySelectorAll("."+Gn)).forEach(function(e){E.EventHandler.remove(e,"click",t.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+zn+",.e-next")).forEach(function(e){E.EventHandler.remove(e,"click",t.navigatorClickHandler)});var e=this.element.querySelector("."+Zn);e&&E.EventHandler.remove(e,"click",this.playButtonClickHandler),E.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),E.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),E.EventHandler.clearEvents(this.element),E.EventHandler.clearEvents(this.itemsContainer),E.EventHandler.remove(window,"resize",this.resizeHandler)},D.prototype.prev=function(){var e;!this.loop&&0===this.selectedIndex||(e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1,this.setActiveSlide(e,"Previous"),this.autoSlide())},D.prototype.next=function(){var e;!this.loop&&this.selectedIndex===this.slideItems.length-1||(e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1,this.setActiveSlide(e,"Next"),this.autoSlide())},D.prototype.play=function(){var e=this.element.querySelector("."+$n);this.showPlayButton&&e&&(E.classList(e,[er],[$n]),this.element.querySelector("."+sr).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},D.prototype.pause=function(){var e=this.element.querySelector("."+er);this.showPlayButton&&e&&(this.element.querySelector("."+sr).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),E.classList(e,[$n],[er])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},D.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},D.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},D.prototype.destroy=function(){var t=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){t.element.removeChild(e)}),E.removeClass([this.element],[Rn,this.cssClass,jn,Fn]),["role","style"].forEach(function(e){t.element.removeAttribute(e)}),this.itemsContainer=null,yr.prototype.destroy.call(this)},P([E.Collection([],gr)],D.prototype,"items",void 0),P([E.Property("Slide")],D.prototype,"animationEffect",void 0),P([E.Property()],D.prototype,"previousButtonTemplate",void 0),P([E.Property()],D.prototype,"nextButtonTemplate",void 0),P([E.Property()],D.prototype,"indicatorsTemplate",void 0),P([E.Property()],D.prototype,"playButtonTemplate",void 0),P([E.Property()],D.prototype,"cssClass",void 0),P([E.Property([])],D.prototype,"dataSource",void 0),P([E.Property()],D.prototype,"itemTemplate",void 0),P([E.Property(0)],D.prototype,"selectedIndex",void 0),P([E.Property("100%")],D.prototype,"width",void 0),P([E.Property("100%")],D.prototype,"height",void 0),P([E.Property(5e3)],D.prototype,"interval",void 0),P([E.Property(!0)],D.prototype,"autoPlay",void 0),P([E.Property(!0)],D.prototype,"pauseOnHover",void 0),P([E.Property(!0)],D.prototype,"loop",void 0),P([E.Property(!1)],D.prototype,"showPlayButton",void 0),P([E.Property(!0)],D.prototype,"enableTouchSwipe",void 0),P([E.Property(!0)],D.prototype,"allowKeyboardInteraction",void 0),P([E.Property(!0)],D.prototype,"showIndicators",void 0),P([E.Property("Default")],D.prototype,"indicatorsType",void 0),P([E.Property("Visible")],D.prototype,"buttonsVisibility",void 0),P([E.Property(!1)],D.prototype,"partialVisible",void 0),P([E.Property(a.CarouselSwipeMode.Touch)],D.prototype,"swipeMode",void 0),P([E.Property()],D.prototype,"htmlAttributes",void 0),P([E.Event()],D.prototype,"slideChanging",void 0),P([E.Event()],D.prototype,"slideChanged",void 0);var yr,A=P([E.NotifyPropertyChanges],D);function D(e,t){e=yr.call(this,e,t)||this;return e.isSwipe=!1,e}br=function(e,t){return(br=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var br,Cr,P=function(e,t){function i(){this.constructor=e}br(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Sr=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Ir="e-appbar",Er="e-horizontal-bottom",xr="e-sticky",Nr="e-prominent",Or="e-dense",wr="e-rtl",Lr="e-light",kr="e-primary",Ar="e-inherit",P=(Cr=E.Component,P(Tr,Cr),Tr.prototype.destroy=function(){Cr.prototype.destroy.call(this),this.element.classList.remove(Ir),this.element.removeAttribute("style"),this.element.removeAttribute("role")},Tr.prototype.getModuleName=function(){return"appbar"},Tr.prototype.getPersistData=function(){return this.addOnPersist([])},Tr.prototype.preRender=function(){},Tr.prototype.render=function(){this.element.classList.add(Ir),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&E.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add(Er),this.isSticky&&this.element.classList.add(xr),this.enableRtl&&this.element.classList.add(wr),this.setHeightMode(),this.setColorMode(),E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},Tr.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"mode":E.removeClass([this.element],[Or,Nr]),this.setHeightMode();break;case"position":"Bottom"===this.position?E.addClass([this.element],Er):E.removeClass([this.element],Er);break;case"cssClass":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?E.addClass([this.element],xr):E.removeClass([this.element],xr);break;case"htmlAttributes":if(!E.isNullOrUndefined(this.htmlAttributes)){if(!E.isNullOrUndefined(t.htmlAttributes))for(var n=0,r=Object.keys(t.htmlAttributes);n<r.length;n++){var o=r[n];"class"===o?E.removeClass([this.element],t.htmlAttributes[""+o]):this.element.removeAttribute(o)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":E.removeClass([this.element],["e-dark",kr,Ar,Lr]),this.setColorMode();break;case"enableRtl":this.enableRtl?E.addClass([this.element],wr):E.removeClass([this.element],wr)}},Tr.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?E.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},Tr.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add(Nr):"Dense"===this.mode&&this.element.classList.add(Or)},Tr.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add(Lr);break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add(kr);break;case"Inherit":this.element.classList.add(Ar)}},Sr([E.Property("Regular")],Tr.prototype,"mode",void 0),Sr([E.Property("Top")],Tr.prototype,"position",void 0),Sr([E.Property()],Tr.prototype,"cssClass",void 0),Sr([E.Property(!1)],Tr.prototype,"isSticky",void 0),Sr([E.Property()],Tr.prototype,"htmlAttributes",void 0),Sr([E.Property("Light")],Tr.prototype,"colorMode",void 0),Sr([E.Event()],Tr.prototype,"created",void 0),Sr([E.Event()],Tr.prototype,"destroyed",void 0),Sr([E.NotifyPropertyChanges],Tr));function Tr(e,t){return Cr.call(this,e,t)||this}Pr=function(e,t){return(Pr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Pr,Dr,Sr=function(e,t){function i(){this.constructor=e}Pr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Mr="--progress-position",Hr="e-vertical",Ur="e-horizontal",Rr="e-stepper-steps",Br=((Br=a.StepStatus||(a.StepStatus={})).NotStarted="NotStarted",Br.InProgress="InProgress",Br.Completed="Completed",Dr=E.ChildProperty,Sr(jr,Dr),M([E.Property("")],jr.prototype,"cssClass",void 0),M([E.Property(!1)],jr.prototype,"disabled",void 0),M([E.Property("")],jr.prototype,"iconCss",void 0),M([E.Property(null)],jr.prototype,"isValid",void 0),M([E.Property("")],jr.prototype,"label",void 0),M([E.Property(!1)],jr.prototype,"optional",void 0),M([E.Property(a.StepStatus.NotStarted)],jr.prototype,"status",void 0),M([E.Property("")],jr.prototype,"text",void 0),jr);function jr(){return null!==Dr&&Dr.apply(this,arguments)||this}(Fr=a.StepperOrientation||(a.StepperOrientation={})).Horizontal="Horizontal",Fr.Vertical="Vertical";qr=E.Component,Sr(Wr,qr),Wr.prototype.preRender=function(){},Wr.prototype.getModuleName=function(){return"stepperBase"},Wr.prototype.getPersistData=function(){return this.addOnPersist([])},Wr.prototype.render=function(){},Wr.prototype.updateOrientaion=function(e){(e.classList.contains(Ur)||e.classList.contains(Hr))&&e.classList.remove(Ur,Hr),E.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},Wr.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t,i=e.querySelector("li").querySelector(".e-step-label-container");this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains(Hr)&&(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")?(t=e.querySelector("."+Rr),this.progressStep.style.setProperty(Mr,t.offsetWidth/2+"px")):this.progressStep.style.setProperty(Mr,this.progressBarPosition/2-1+"px")),i&&i.classList.contains("e-label-before")&&this.progressStep.style.setProperty(Mr,this.progressBarPosition-1+5+"px"),e.classList.contains(Ur)&&this.setProgressPosition(e)},Wr.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild,i=(!0!==t&&(t=0,t=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",t+"px")),e.querySelector("."+Rr).lastChild.firstChild);e.classList.contains("e-rtl")?(t=s.offsetLeft+s.offsetWidth-e.querySelector("."+Rr).offsetWidth,this.progressStep.style.setProperty("--progress-left-position",Math.abs(t)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(i.offsetLeft-s.offsetLeft)+"px")):(this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",i.offsetWidth+i.offsetLeft-2-(s.offsetLeft+2)+"px"))},Wr.prototype.onPropertyChanged=function(e,t){},M([E.Collection([],Br)],Wr.prototype,"steps",void 0),M([E.Property("")],Wr.prototype,"cssClass",void 0),M([E.Property(!1)],Wr.prototype,"readOnly",void 0),M([E.Property(a.StepperOrientation.Horizontal)],Wr.prototype,"orientation",void 0),M([E.Event()],Wr.prototype,"created",void 0);var qr,Fr=M([E.NotifyPropertyChanges],Wr);function Wr(e,t){return qr.call(this,e,t)||this}Vr=function(e,t){return(Vr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Vr,_r,Sr=function(e,t){function i(){this.constructor=e}Vr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},zr="e-indicator",Kr="e-step-text-container",Xr="e-step-selected",Yr="e-step-inprogress",Gr="e-step-notstarted",Qr="e-step-focus",Jr="e-step-completed",Zr="e-step-disabled",$r="e-stepper-readonly",eo="--progress-value",to="e-rtl",io="e-step-template",so="e-label-after",no="e-label-before",ro="e-vertical",oo="e-horizontal",lo="e-step-item",ao="e-step-text",ho="e-text",co="e-step-label",po="e-label",uo="e-step-type-indicator",mo="e-step-type-label",fo="e-step-indicator",go="e-stepper-tooltip",vo="e-linear",yo=(_r=E.ChildProperty,Sr(bo,_r),M([E.Property(!0)],bo.prototype,"enable",void 0),M([E.Property(2e3)],bo.prototype,"duration",void 0),M([E.Property(0)],bo.prototype,"delay",void 0),bo);function bo(){return null!==_r&&_r.apply(this,arguments)||this}(So=a.StepLabelPosition||(a.StepLabelPosition={})).Top="Top",So.Bottom="Bottom",So.Start="Start",So.End="End",(So=a.StepType||(a.StepType={})).Default="Default",So.Label="Label",So.Indicator="Indicator";Sr(H,Co=Fr),H.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()));this.l10n=new E.L10n("stepper",{optional:"Optional"},this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},H.prototype.getModuleName=function(){return"stepper"},H.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},H.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&E.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add($r),this.enableRtl&&this.element.classList.add(to),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),0<this.steps.length&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},H.prototype.initiateProgressBar=function(){var e=this;1<this.steps.length&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},H.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},H.prototype.renderDefault=function(e){e=this.steps[parseInt(e.toString(),10)];return!e.iconCss&&!e.text&&!e.label},H.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?(0<=this.animation.duration&&e&&e.style.setProperty("--duration",this.animation.duration+"ms"),0<=this.animation.delay&&e&&e.style.setProperty("--delay",this.animation.delay+"ms")):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},H.prototype.updateStepType=function(){var e;E.isNullOrUndefined(this.stepType)||(e=this.stepType.toLowerCase(),-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition()))},H.prototype.wireEvents=function(){E.EventHandler.add(window,"resize",this.updateResize,this),E.EventHandler.add(window,"click",this.updateStepFocus,this)},H.prototype.unWireEvents=function(){E.EventHandler.remove(window,"resize",this.updateResize),E.EventHandler.remove(window,"click",this.updateStepFocus)},H.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains(oo)&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateStepFocus=function(){var e;this.isKeyNavFocus&&(this.isKeyNavFocus=!1,e=this.element.querySelector("."+Qr))&&(e.classList.remove(Qr),this.element.classList.remove("e-steps-focus"))},H.prototype.updateStepperStatus=function(e){for(var t=0;t<this.steps.length;t++){var i=this.steps[parseInt(t.toString(),10)],s=i.status.toLowerCase();if(e&&0===this.activeStep&&0===t&&(o=this.isProtectedOnChange,this.isProtectedOnChange=!0,i.status=a.StepStatus.InProgress,this.isProtectedOnChange=o),i&&"notstarted"!==s&&t===this.activeStep)for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],o=(r.classList.remove(Xr,Yr,Jr,Gr),this.isProtectedOnChange);this.isProtectedOnChange=!0,"completed"===s?this.updateStatusClass(n,t,r):this.updateStatusClass(n,t,r,!0),this.isProtectedOnChange=o}else i&&"notstarted"!==s&&t!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},H.prototype.updateStatusClass=function(e,t,i,s){var n=this.steps[parseInt(e.toString(),10)];e<t?(i.classList.add(Jr),n.status=a.StepStatus.Completed):e===t?i.classList.add(s?Yr:Jr,Xr):i.classList.add(Gr)},H.prototype.renderItems=function(){for(var t=this,e=this.element.classList.contains(oo),i=this.element.classList.contains(ro),s=E.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),n=0;n<this.steps.length;n++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var r,o,l,a=this.createElement("span",{className:"e-step"}),d=this.steps[parseInt(n.toString(),10)],h=!!d.label,c=!!d.text,p=this.element.classList.contains(uo),c=(this.stepperItemContainer.classList[0===n?"add":"remove"](Xr,Yr),this.stepperItemContainer.classList[0!==n?"add":"remove"](Gr),e&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(n)&&(E.isNullOrUndefined(this.template)||""===this.template)?((r=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase())&&a.classList.add("e-icons",fo),r||null!=d.isValid||(a.classList.add("e-step-content"),a.innerHTML=(n+1).toString()),this.stepperItemContainer.appendChild(a)):!E.isNullOrUndefined(this.template)&&""!==this.template||(r=!0,!(d.iconCss||!d.iconCss&&c&&h)||(c||h)&&this.element.classList.contains(mo)||(d.iconCss?(l=d.iconCss.trim().split(" "),(o=a.classList).add.apply(o,[zr].concat(l)),this.stepperItemContainer.classList.add(lo)):!d.iconCss&&c&&h&&(a.classList.add(zr),a.innerHTML=d.text,this.stepperItemContainer.classList.add(lo)),this.stepperItemContainer.appendChild(a),(e&&("start"===s||"end"===s)&&h||i&&("top"===s||"bottom"===s)&&h)&&!p&&(this.element.classList.add("e-label-"+s),this.createTextLabelElement(d.label),r=!1)),!c||d.iconCss&&p||!r||d.iconCss&&h||(!d.iconCss&&p||(!d.iconCss||this.element.classList.contains(mo))&&!h?(d.iconCss||h||this.element.classList.add("e-step-type-indicator"),this.checkValidState(d,a),h=!1):(h||this.createTextLabelElement(d.text),h&&this.element.classList.contains(mo)&&(this.createElement("span",{className:ho}).innerText=d.label),c=!h)),!h)||d.iconCss&&p||!r||(d.iconCss||c||!p?(!this.element.classList.contains(mo)||!c||this.element.classList.contains(mo)&&h)&&(this.createTextLabelElement(d.label,!0),this.updateLabelPosition(),(d.iconCss||c||this.stepperItemContainer.classList.contains(lo))&&!this.element.classList.contains(mo)||(this.stepperItemContainer.classList.add("e-step-label-only"),null!==d.isValid&&(o=this.createElement("span",{className:"e-step-validation-icon e-icons"}),this.labelContainer.appendChild(o)))):this.checkValidState(d,a,!0)),d.optional&&(l=this.createElement("span",{className:"e-step-label-optional"}),this.l10n.setLocale(this.locale),p=this.l10n.getConstant("optional"),l.innerText=p,(h&&this.labelContainer&&(this.element.classList.contains(so)&&!this.stepperItemContainer.classList.contains("e-step-label-only")||e&&this.element.classList.contains(no)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||i&&this.element.classList.contains(no)?this.labelContainer:this.stepperItemContainer).appendChild(l),null!==d.isValid)&&this.stepperItemContainer.classList.add(d.isValid?"e-step-valid":"e-step-error"),d.cssClass&&E.addClass([this.stepperItemContainer],d.cssClass.trim().split(" ")),d.disabled&&(this.stepperItemContainer.classList[d.disabled?"add":"remove"](Zr),E.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==d.isValid&&(d.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(n,!1),this.stepperItemContainer.classList.contains(Yr)?E.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):E.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,n),this.stepperItemElements.push(this.stepperItemContainer),{element:this.stepperItemContainer,index:n});this.trigger("beforeStepRender",c,function(e){t.stepperItemList.appendChild(e.element)}),i&&(this.isAngular&&this.template?setTimeout(function(){t.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(i&&this.element.classList.contains(no))for(var u=this.stepperItemList.querySelectorAll("."+po),m=0;m<u.length;m++)u[parseInt(m.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},H.prototype.createTextLabelElement=function(e,t){var i=this.createElement("span",{className:(t=void 0===t?!1:t)?po:Kr+" "+ho});i.innerText=e,(t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer):this.stepperItemContainer).appendChild(i),this.stepperItemContainer.classList.add(t?co:ao)},H.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(no),t=this.stepperItemContainer.classList.contains(lo)&&!this.stepperItemContainer.classList.contains(ao)&&!this.stepperItemContainer.classList.contains(co),i=this.stepperItemContainer.querySelector("."+Kr);i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e?(i=this.stepperItemContainer.querySelector("."+po).offsetWidth+15,this.beforeLabelWidth=Math.max(this.beforeLabelWidth,i),e=this.element.querySelector("ol").lastChild.querySelector("."+zr),i=this.stepperItemContainer.querySelector("."+Kr),e||i?(e=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+zr)||i).offsetWidth/2,this.progressBarPosition=Math.max(this.progressBarPosition,e)):this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)):(i=this.element.querySelector("ol").lastChild,e=(t?this.stepperItemContainer:i.firstChild).offsetWidth,this.progressBarPosition=Math.max(this.progressBarPosition,e))},H.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label||e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(zr),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(lo))},H.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains(oo)?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},H.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},H.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(E.removeClass([this.labelContainer],e),E.removeClass([this.element],e))},H.prototype.checkValidStep=function(){for(var a=this.element.classList.contains(uo),d=this,e=0;e<this.steps.length;e++)!function(e){var t,i,s,n,r,o=d.steps[parseInt(e.toString(),10)],l=d.stepperItemElements[parseInt(e.toString(),10)];null!==o.isValid&&(r=void 0,a&&!o.iconCss?r=l.querySelector("."+zr):t=l.querySelector("."+zr),!r&&a&&d.renderDefault(e)&&(r=l.querySelector("."+fo)),i=l.querySelector(".e-step-validation-icon"),o=o.iconCss.trim().split(" "),n=(s=l.classList.contains("e-step-valid"))?"e-check":"e-circle-info",r&&(r.classList.remove(fo),""!==r.innerHTML&&(r.innerHTML=""),r.classList.add("e-icons",n,zr)),d.renderDefault(e)&&!a&&l.querySelector(".e-step").classList.add("e-icons",n,zr),t&&(""!==t.innerHTML?t.innerHTML="":0<o.length&&o.forEach(function(e){t.classList.remove(e)}),t.classList.add("e-icons",n)),i)&&(i.classList.add(s?"e-circle-check":"e-circle-info"),d.element.classList.contains(ro))&&(r=l.querySelector("."+po),o=(e=l.querySelector("."+ho))?e.offsetWidth+e.getBoundingClientRect().left:r.offsetWidth+r.getBoundingClientRect().left,l.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",o+20+"px"))}(e)},H.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new g.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?go+" "+this.cssClass:go,position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):E.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},H.prototype.wireItemsEvents=function(e,t){E.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,t),this),E.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,t),this),E.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},H.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var t=this.stepperItemElements[parseInt(e.toString(),10)];E.EventHandler.remove(t,"click",this.linearModeHandler.bind(this,t,e)),E.EventHandler.remove(t,"mouseover",this.openStepperTooltip.bind(this,e)),E.EventHandler.remove(t,"mouseleave",this.closeStepperTooltip)}},H.prototype.linearModeHandler=function(e,t,i){var s;this.linear&&(s=t-this.activeStep,1!==Math.abs(s))||this.stepClickHandler(t,i,e)},H.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen&&(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)&&(e="inprogress"===t.status.toLowerCase()?go+" e-step-inprogress-tip "+(this.cssClass||""):go+" "+(this.cssClass||""),this.tooltipObj.setProperties({cssClass:e.trim()})),this.tooltipOpen=!0)},H.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},H.prototype.updateTooltipContent=function(e){var t,i,s;this.showTooltip&&(this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]),t=void 0,e=this.steps[parseInt(e.toString(),10)],this.tooltipTemplate?(t=this.createElement("span",{className:"e-stepper-tooltip-content"}),i=this.getTemplateFunction(this.tooltipTemplate),E.append(i({value:e},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},!0)):(s=e.label||e.text,this.tooltipObj.setProperties({content:E.initializeCSPTemplate(function(){return s})},!0)),this.renderReactTemplates())},H.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},H.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},H.prototype.renderItemContent=function(e,t){var i,s=this.stepperItemList.querySelectorAll("li");t&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template&&((t?s[parseInt(e.toString(),10)]:this.stepperItemContainer).classList.add(io),i=this.steps[parseInt(e.toString(),10)],E.append(this.templateFunction({step:i,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),t?s[parseInt(e.toString(),10)]:this.stepperItemContainer)),this.renderReactTemplates()},H.prototype.removeItemContent=function(e){e.classList.remove(io);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},H.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},H.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return E.compile(t);var i="";try{var e=E.select(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return E.compile(i)},H.prototype.navigateToStep=function(t,i,s,n,e){var r,o=this,l={element:s,event:i,isInteracted:n,previousStep:this.activeStep,activeStep:t,cancel:!1};!1!==e?(r=this.activeStep,this.trigger("stepChanging",l,function(e){e.cancel||(o.navigationHandler(t),e={element:s,event:i,isInteracted:n,previousStep:r,activeStep:o.activeStep},o.trigger("stepChanged",e))})):this.navigationHandler(t)},H.prototype.navigationHandler=function(e,t,i){e=Math.min(e,this.steps.length-1);var s=this.stepperItemElements.length,s=(0<=e&&e<s-1&&(e=this.stepperItemElements[parseInt(e.toString(),10)].classList.contains(Zr)?this.activeStep:e),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.activeStep=parseInt(e.toString(),10),this.isProtectedOnChange=s;for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],o=this.steps[parseInt(n.toString(),10)],l=(r.classList.remove(Xr,Yr,Jr,Gr),n===this.activeStep&&r.classList.add(Xr),0<=this.activeStep&&this.progressbar?this.element.classList.contains(oo)?this.calculateProgressbarPos():this.progressbar.style.setProperty(eo,100/(this.steps.length-1)*e+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty(eo,"0%"),n===this.activeStep?r.classList.add(Yr):0<this.activeStep&&n<this.activeStep?r.classList.add(Jr):r.classList.add(Gr),r.classList.contains(Yr)?E.attributes(r,{tabindex:"0","aria-current":"true"}):E.attributes(r,{tabindex:"-1","aria-current":"false"}),this.isProtectedOnChange);!(this.isProtectedOnChange=!0)!==i&&(n<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===o.status.toLowerCase()?o.status=a.StepStatus.Completed:n===this.activeStep?o.status=a.StepStatus.InProgress:n>this.activeStep&&(o.status=a.StepStatus.NotStarted),t&&this.activeStep===n&&(o.status=t),"completed"===o.status.toLowerCase()&&(r.classList.remove(Xr,Yr,Gr),r.classList.add(Jr)),"notstarted"===o.status.toLowerCase())&&(r.classList.remove(Xr,Yr,Jr),r.classList.add(Gr)),this.isProtectedOnChange=l,this.updateIndicatorStatus(n,r)}this.updateStepInteractions()},H.prototype.calculateProgressbarPos=function(){var e,i,s,t,n,r=this;(this.element.classList.contains(no)||this.element.classList.contains(so))&&!this.element.classList.contains(uo)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(lo)?(n=this.element.querySelector(".e-stepper-progressbar"),t=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,e=0===this.activeStep?0:(t.offsetLeft-n.offsetLeft+t.offsetWidth/2)/n.offsetWidth*100,this.element.classList.contains(to)&&(e=(n.getBoundingClientRect().right-t.getBoundingClientRect().right+t.offsetWidth/2)/n.offsetWidth*100),this.progressbar.style.setProperty(eo,e+"%")):(s=i=0,this.stepperItemElements.forEach(function(e,t){e=e.offsetWidth;i+=e,t<=r.activeStep&&(s+=t===r.activeStep&&0!==t?e/2:e)}),t=(this.stepperItemList.offsetWidth-i)/(this.stepperItemElements.length-1),n=(s+t*this.activeStep)/this.stepperItemList.offsetWidth*100,this.progressbar.style.setProperty(eo,n+"%"))},H.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(uo)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(Jr)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(zr,"e-icons","e-check")):(t.classList.contains(Yr)||t.classList.contains(Gr))&&(t.firstChild.classList.remove(zr,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},H.prototype.updateStepInteractions=function(){var i=this;this.element.classList.toggle(vo,this.linear),this.stepperItemElements.forEach(function(e,t){e.classList.toggle("e-previous",t===i.activeStep-1),e.classList.toggle("e-next",t===i.activeStep+1)})},H.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)E.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},H.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},H.prototype.previousStep=function(){0<this.activeStep&&this.navigateToStep(this.activeStep-1,null,null,!1)},H.prototype.reset=function(){var e;0===this.activeStep?this.updateStepInteractions():(e=!!this.stepperItemElements[0].classList.contains(Zr),this.navigateToStep(e?-1:0,null,null,!1))},H.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateElementClassArray=function(){E.removeClass([this.element],[to,$r,"e-steps-focus",so,no,"e-label-top","e-label-bottom","e-label-start","e-label-end",uo,mo,ro,oo,vo])},H.prototype.destroy=function(){Co.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&E.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&E.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},H.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},H.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains(oo)?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},H.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=(s=this.element.querySelector("."+Qr))||this.element.querySelector("."+Xr),n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(Qr))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(Qr),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){for(var s=r,r=e?r+1:r-1;0<=r&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(Zr);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(s.toString(),10)].classList.contains(Qr)&&n[parseInt(s.toString(),10)].classList.remove(Qr),0<=(r="home"!==t.action&&"end"!==t.action?r:"home"===t.action?i?n.length-1:0:i?0:n.length-1)&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(Qr)}else"space"!==t.action&&"enter"!==t.action||(s=!1,this.linear&&(i=this.activeStep-r,1!==Math.abs(i))||(this.navigateToStep(r,null,null,!0),s=!0),s&&(this.updateStepFocus(),this.stepperItemElements[r].focus()))},H.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains($r)&&this.element.classList.add($r),this.enableRtl&&!this.element.classList.contains(to)&&this.element.classList.add(to),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,o=0;o<r;o++){var l=Object.keys(e[n])[o];"status"===l?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===l&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},H.prototype.updateDynamicActiveStep=function(e,t){this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,0<=this.activeStep&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(Zr)&&(this.activeStep=t),this.linear?(e=t-this.activeStep,1===Math.abs(e)&&this.navigateToStep(this.activeStep,null,null,!0)):this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicCssClass=function(e,t){t&&E.removeClass([this.element],t.trim().split(" ")),e&&E.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?go+" "+this.cssClass:go})},H.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"](to);break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"]($r);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},M([E.Property(0)],H.prototype,"activeStep",void 0),M([E.Complex({},yo)],H.prototype,"animation",void 0),M([E.Property(!1)],H.prototype,"linear",void 0),M([E.Property(!1)],H.prototype,"showTooltip",void 0),M([E.Property("")],H.prototype,"template",void 0),M([E.Property("")],H.prototype,"tooltipTemplate",void 0),M([E.Property(a.StepLabelPosition.Bottom)],H.prototype,"labelPosition",void 0),M([E.Property(a.StepType.Default)],H.prototype,"stepType",void 0),M([E.Event()],H.prototype,"stepChanged",void 0),M([E.Event()],H.prototype,"stepChanging",void 0),M([E.Event()],H.prototype,"stepClick",void 0),M([E.Event()],H.prototype,"beforeStepRender",void 0);var Co,So=M([E.NotifyPropertyChanges],H);function H(e,t){e=Co.call(this,e,t)||this;return e.stepperItemElements=[],e}a.Accordion=e,a.AccordionActionSettings=Jt,a.AccordionAnimationSettings=ei,a.AccordionItem=si,a.ActionSettings=Ys,a.AppBar=P,a.Breadcrumb=f,a.BreadcrumbItem=Pn,a.Carousel=A,a.CarouselItem=gr,a.ContextMenu=n,a.FieldSettings=je,a.FieldsSettings=zs,a.HScroll=ee,a.Header=es,a.Item=Nt,a.Menu=F,a.MenuAnimationSettings=ze,a.MenuItem=We,a.NodeAnimationSettings=Js,a.Sidebar=c,a.Step=Br,a.Stepper=So,a.StepperAnimationSettings=yo,a.StepperBase=Fr,a.Tab=ci,a.TabActionSettings=Yi,a.TabAnimationSettings=Ji,a.TabItem=ss,a.Toolbar=Lt,a.TreeView=l,a.VScroll=fe,a.addScrolling=ge,a.destroyScroll=ye,Object.defineProperty(a,"__esModule",{value:!0})});
1
+ /*!
2
+ * filename: ej2-navigations.umd.min.js
3
+ * version : 28.1.39
4
+ * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-inputs")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-lists","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-data","@syncfusion/ej2-inputs"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Lists,e.ej2Popups,e.ej2Buttons,e.ej2Data,e.ej2Inputs)}(this,function(a,E,U,g,R,x,B){"use strict";j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var j,q,F=function(e,t){function i(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},W="e-rtl",V="e-overlay",_="e-nav-arrow",z="e-nav-right-arrow",K="e-nav-left-arrow",X="e-scroll-nav",Y="e-scroll-right-nav",G="e-scroll-left-nav",Q="e-scroll-device",J="e-scroll-overlay",Z="e-scroll-right-overlay",$="e-scroll-left-overlay",ee=(q=E.Component,F(t,q),t.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("hscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(W)},t.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollHandler,this),this.isDevice?(this.element.classList.add(Q),this.createOverlay(this.element)):this.createNavIcon(this.element),this.setScrollState()},t.prototype.setScrollState=function(){E.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetWidth,this.customStep=!1):this.customStep=!0},t.prototype.initialize=function(){for(var e=this.createElement("div",{className:"e-hscroll-content"}),t=this.createElement("div",{className:"e-hscroll-bar"}),i=(t.setAttribute("tabindex","-1"),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},t.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},t.prototype.getModuleName=function(){return"hScroll"},t.prototype.destroy=function(){var e=this.element,t=(e.style.display="",e.classList.remove("e-hscroll"),e.classList.remove(Q),e.classList.remove(W),E.selectAll(".e-"+e.id+"_nav."+X,e)),i=E.selectAll("."+J,e);[].slice.call(i).forEach(function(e){E.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollHandler),this.touchModule.destroy(),this.touchModule=null,q.prototype.destroy.call(this)},t.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+V+")",this.element);t?this.element.classList.add(V):this.element.classList.remove(V),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},t.prototype.createOverlay=function(e){var t=e.id.concat("_nav"),i=this.createElement("div",{className:J+" "+Z}),s="e-"+e.id.concat("_nav "+X+" "+Y),t=this.createElement("div",{id:t.concat("_right"),className:s}),s=this.createElement("div",{className:z+" "+_+" e-icons"}),s=(t.appendChild(s),this.createElement("div",{className:J+" "+$}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},t.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+X+" "+Y),s={role:"button",id:t.concat("_right"),"aria-label":"Scroll right"},i=this.createElement("div",{className:i,attrs:s}),s=(i.setAttribute("aria-disabled","false"),this.createElement("div",{className:z+" "+_+" e-icons"})),n="e-"+e.id.concat("_nav "+X+" "+G),t={role:"button",id:t.concat("_left"),"aria-label":"Scroll left"},n=this.createElement("div",{className:n+" "+V,attrs:t}),t=(n.setAttribute("aria-disabled","true"),this.createElement("div",{className:K+" "+_+" e-icons"}));n.appendChild(t),i.appendChild(s),e.appendChild(i),e.insertBefore(n,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),n.classList.add("e-ie-align")),this.eventBinding([i,n])},t.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},t.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},t.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new E.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.EventHandler.add(e,"click",t.clickEventHandler,t)})},t.prototype.repeatScroll=function(){clearInterval(this.timeout)},t.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,X)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},t.prototype.contains=function(e,t){return e.classList.contains(t)},t.prototype.eleScrolling=function(e,t,i){var s=this.element,n=t.classList;n.contains(X)&&(n=t.querySelector("."+_).classList),this.contains(s,W)&&this.browserCheck&&(e=-e),!this.contains(s,W)||this.browserCheck||this.ieCheck?n.contains(z)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i):n.contains(K)?this.frameScrollRequest(e,"add",i):this.frameScrollRequest(e,"",i)},t.prototype.clickEventHandler=function(e){this.eleScrolling(this.scrollStep,e.target,!1)},t.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Left"===t.swipeDirection?s.scrollLeft+=n*e:"Right"===t.swipeDirection&&(s.scrollLeft-=n*e),r-=.5,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceX/(10*t.velocity):t.distanceX/t.velocity,r=.5;i()},t.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollLeft+=e:this.scrollEle.scrollLeft-=e,this.enableRtl&&0<this.scrollEle.scrollLeft&&(this.scrollEle.scrollLeft=0)},t.prototype.frameScrollRequest=function(i,s,e){var n,r=this,o=10;e?this.scrollUpdating(i,s):(this.customStep||[].slice.call(E.selectAll("."+J,this.element)).forEach(function(e){i-=e.offsetWidth}),(n=function(){var e,t=r.contains(r.element,W)&&r.browserCheck?(e=-i,-o):(e=i,o);e<o?window.cancelAnimationFrame(t):(r.scrollUpdating(t,s),i-=t,window.requestAnimationFrame(n))})())},t.prototype.touchHandler=function(e){var t=this.scrollEle,i=e.distanceX;this.ieCheck&&this.contains(this.element,W)&&(i=-i),"Left"===e.scrollDirection?t.scrollLeft=t.scrollLeft+i:"Right"===e.scrollDirection&&(t.scrollLeft=t.scrollLeft-i)},t.prototype.arrowDisabling=function(e,t){var i;this.isDevice?(i=(E.isNullOrUndefined(e)?t:e).querySelector("."+_),E.isNullOrUndefined(e)?E.classList(i,[z],[K]):E.classList(i,[K],[z])):e&&t&&(e.classList.add(V),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(V),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},t.prototype.scrollHandler=function(e){var e=e.target,t=e.offsetWidth,i=(this.element,this.element.querySelector("."+G)),s=this.element.querySelector("."+Y),n=this.element.querySelector("."+$),r=this.element.querySelector("."+Z),o=e.scrollLeft;o<=0&&(o=-o),this.isDevice&&(!this.enableRtl||this.browserCheck||this.ieCheck||(n=this.element.querySelector("."+Z),r=this.element.querySelector("."+$)),n.style.width=o<40?o+"px":"40px",e.scrollWidth-Math.ceil(t+o)<40?r.style.width=e.scrollWidth-Math.ceil(t+o)+"px":r.style.width="40px"),0===o?this.arrowDisabling(i,s):Math.ceil(t+o+.1)>=e.scrollWidth?this.arrowDisabling(s,i):(n=this.element.querySelector("."+X+"."+V))&&(n.classList.remove(V),n.setAttribute("aria-disabled","false"),n.setAttribute("tabindex","0"))},t.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(W):this.element.classList.remove(W)}},e([E.Property(null)],t.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],t));function t(e,t){return q.call(this,e,t)||this}te=function(e,t){return(te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var te,ie,F=function(e,t){function i(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},se="e-rtl",ne="e-overlay",re="e-nav-arrow",oe="e-nav-up-arrow",le="e-nav-down-arrow",ae="e-scroll-nav",de="e-scroll-up-nav",he="e-scroll-down-nav",ce="e-scroll-device",pe="e-scroll-overlay",ue="e-scroll-up-overlay",me="e-scroll-down-overlay",fe=(ie=E.Component,F(i,ie),i.prototype.preRender=function(){this.browser=E.Browser.info.name,this.browserCheck="mozilla"===this.browser,this.isDevice=E.Browser.isDevice,this.customStep=!0;var e=this.element;this.ieCheck="edge"===this.browser||"msie"===this.browser,this.initialize(),""===e.id&&(e.id=E.getUniqueID("vscroll"),this.uniqueId=!0),e.style.display="block",this.enableRtl&&e.classList.add(se)},i.prototype.render=function(){this.touchModule=new E.Touch(this.element,{scroll:this.touchHandler.bind(this),swipe:this.swipeHandler.bind(this)}),E.EventHandler.add(this.scrollEle,"scroll",this.scrollEventHandler,this),this.isDevice?(this.element.classList.add(ce),this.createOverlayElement(this.element)):this.createNavIcon(this.element),this.setScrollState(),E.EventHandler.add(this.element,"wheel",this.wheelEventHandler,this)},i.prototype.setScrollState=function(){E.isNullOrUndefined(this.scrollStep)||this.scrollStep<0?(this.scrollStep=this.scrollEle.offsetHeight,this.customStep=!1):this.customStep=!0},i.prototype.initialize=function(){for(var e=E.createElement("div",{className:"e-vscroll-content"}),t=E.createElement("div",{className:"e-vscroll-bar"}),i=(t.setAttribute("tabindex","-1"),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.overflow="hidden",this.scrollEle=t,this.scrollItems=e},i.prototype.getPersistData=function(){return this.addOnPersist(["scrollStep"])},i.prototype.getModuleName=function(){return"vScroll"},i.prototype.destroy=function(){var e=this.element,t=(e.style.display="",E.removeClass([this.element],["e-vscroll",ce,se]),E.selectAll(".e-"+e.id+"_nav."+ae,e)),i=E.selectAll("."+pe,e);[].slice.call(i).forEach(function(e){E.detach(e)});for(var s=0,n=[].slice.call(this.scrollItems.children);s<n.length;s++){var r=n[s];e.appendChild(r)}this.uniqueId&&this.element.removeAttribute("id"),E.detach(this.scrollEle),0<t.length&&(E.detach(t[0]),E.isNullOrUndefined(t[1])||E.detach(t[1])),E.EventHandler.remove(this.scrollEle,"scroll",this.scrollEventHandler),this.touchModule.destroy(),this.touchModule=null,ie.prototype.destroy.call(this)},i.prototype.disable=function(t){var e=E.selectAll(".e-scroll-nav:not(."+ne+")",this.element);t?this.element.classList.add(ne):this.element.classList.remove(ne),[].slice.call(e).forEach(function(e){e.setAttribute("tabindex",t?"-1":"0")})},i.prototype.createOverlayElement=function(e){var t=e.id.concat("_nav"),i=E.createElement("div",{className:pe+" "+me}),s="e-"+e.id.concat("_nav "+ae+" "+he),t=E.createElement("div",{id:t.concat("down"),className:s}),s=E.createElement("div",{className:le+" "+re+" e-icons"}),s=(t.appendChild(s),E.createElement("div",{className:pe+" "+ue}));this.ieCheck&&t.classList.add("e-ie-align"),e.appendChild(i),e.appendChild(t),e.insertBefore(s,e.firstChild),this.eventBinding([t])},i.prototype.createNavIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav "+ae+" "+he),i=E.createElement("div",{id:t.concat("_down"),className:i}),s=(i.setAttribute("aria-disabled","false"),E.createElement("div",{className:le+" "+re+" e-icons"})),n="e-"+e.id.concat("_nav "+ae+" "+de),t=E.createElement("div",{id:t.concat("_up"),className:n+" "+ne}),n=(t.setAttribute("aria-disabled","true"),E.createElement("div",{className:oe+" "+re+" e-icons"}));t.appendChild(n),i.appendChild(s),i.setAttribute("tabindex","0"),e.appendChild(i),e.insertBefore(t,e.firstChild),this.ieCheck&&(i.classList.add("e-ie-align"),t.classList.add("e-ie-align")),this.eventBinding([i,t])},i.prototype.onKeyPress=function(e){var t=this;"Enter"===e.key&&(this.keyTimer=window.setTimeout(function(){t.keyTimeout=!0,t.eleScrolling(10,e.target,!0)},100))},i.prototype.onKeyUp=function(e){"Enter"===e.key&&(this.keyTimeout?this.keyTimeout=!1:e.target.click(),clearTimeout(this.keyTimer))},i.prototype.eventBinding=function(e){var t=this;[].slice.call(e).forEach(function(e){new E.Touch(e,{tapHold:t.tabHoldHandler.bind(t),tapHoldThreshold:500}),e.addEventListener("keydown",t.onKeyPress.bind(t)),e.addEventListener("keyup",t.onKeyUp.bind(t)),e.addEventListener("mouseup",t.repeatScroll.bind(t)),e.addEventListener("touchend",t.repeatScroll.bind(t)),e.addEventListener("contextmenu",function(e){e.preventDefault()}),E.EventHandler.add(e,"click",t.clickEventHandler,t)})},i.prototype.repeatScroll=function(){clearInterval(this.timeout)},i.prototype.tabHoldHandler=function(e){var t=this,i=e.originalEvent.target,i=this.contains(i,ae)?i.firstElementChild:i,s=10;this.timeout=window.setInterval(function(){t.eleScrolling(s,i,!0)},50)},i.prototype.contains=function(e,t){return e.classList.contains(t)},i.prototype.eleScrolling=function(e,t,i){var s=t.classList;(s=s.contains(ae)?t.querySelector("."+re).classList:s).contains(le)?this.frameScrollRequest(e,"add",i):s.contains(oe)&&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,0<e.deltaY?"add":"",!1)},i.prototype.swipeHandler=function(t){function i(){var e=Math.sin(r);e<=0?window.cancelAnimationFrame(e):("Up"===t.swipeDirection?s.scrollTop+=n*e:"Down"===t.swipeDirection&&(s.scrollTop-=n*e),r-=.02,window.requestAnimationFrame(i))}var s=this.scrollEle,n=t.velocity<=1?t.distanceY/(10*t.velocity):t.distanceY/t.velocity,r=.5;i()},i.prototype.scrollUpdating=function(e,t){"add"===t?this.scrollEle.scrollTop+=e:this.scrollEle.scrollTop-=e},i.prototype.frameScrollRequest=function(t,e,i){var s,n=this,r=10;i?this.scrollUpdating(t,e):(this.customStep||[].slice.call(E.selectAll("."+pe,this.element)).forEach(function(e){t-=e.offsetHeight}),(s=function(){t<r?window.cancelAnimationFrame(r):(n.scrollUpdating(r,e),t-=r,window.requestAnimationFrame(s))})())},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,t){var i;this.isDevice?(i=(E.isNullOrUndefined(e)?t:e).querySelector("."+re),E.isNullOrUndefined(e)?E.classList(i,[le],[oe]):E.classList(i,[oe],[le])):(e.classList.add(ne),e.setAttribute("aria-disabled","true"),e.removeAttribute("tabindex"),t.classList.remove(ne),t.setAttribute("aria-disabled","false"),t.setAttribute("tabindex","0")),this.repeatScroll()},i.prototype.scrollEventHandler=function(e){var e=e.target,t=e.offsetHeight,i=this.element.querySelector("."+de),s=this.element.querySelector("."+he),n=this.element.querySelector("."+ue),r=this.element.querySelector("."+me),o=e.scrollTop;o<=0&&(o=-o),this.isDevice&&(n.style.height=o<40?o+"px":"40px",e.scrollHeight-Math.ceil(t+o)<40?r.style.height=e.scrollHeight-Math.ceil(t+o)+"px":r.style.height="40px"),0===o?this.arrowDisabling(i,s):Math.ceil(t+o+.1)>=e.scrollHeight?this.arrowDisabling(s,i):(n=this.element.querySelector("."+ae+"."+ne))&&(n.classList.remove(ne),n.setAttribute("aria-disabled","false"),n.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(se):this.element.classList.remove(se)}},e([E.Property(null)],i.prototype,"scrollStep",void 0),e([E.NotifyPropertyChanges],i));function i(e,t){return ie.call(this,e,t)||this}function ge(e,t,i,s,n,r){var o,l=t.parentElement,a="vscroll"===s?(o=r||t.getBoundingClientRect().height,i.getBoundingClientRect().height):(o=t.getBoundingClientRect().width,i.getBoundingClientRect().width);return o<a?ve(e,t,i,s,n,r):l&&(l=l.getBoundingClientRect().width)<o&&"hscroll"===s?(t.style.maxWidth=(a=l)+"px",ve(e,t,i,s,n,r)):i}function ve(e,t,i,s,n,r){e=e("div",{className:"e-menu-"+s});return t.appendChild(e),e.appendChild(i),r?(e.style.overflow="hidden",e.style.height=r+"px"):(e.style.maxHeight=t.style.maxHeight,t.style.overflow="hidden"),"vscroll"===s?new fe({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetHeight/2:new ee({enableRtl:n},e).scrollStep=E.select(".e-"+s+"-bar",t).offsetWidth,e}function ye(e,t,i){var s;e&&((s=E.select(".e-menu-parent",t))?i&&i!==s||(e.destroy(),t.parentElement.appendChild(s),E.detach(t)):(e.destroy(),E.detach(t)))}be=function(e,t){return(be=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var be,Ce,F=function(e,t){function i(){this.constructor=e}be(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Se="enter",Ie="escape",v="e-focused",Ee="e-menu-header",y="e-selected",xe="e-separator",Ne="uparrow",Oe="downarrow",we="leftarrow",Le="rightarrow",ke="home",Ae="end",Te="tab",Pe="e-caret",De="e-menu-item",Me="e-disabled",He="e-menu-hide",Ue="e-icons",Re="e-rtl",Be="e-menu-popup",je=(Ce=E.ChildProperty,F(qe,Ce),e([E.Property("id")],qe.prototype,"itemId",void 0),e([E.Property("parentId")],qe.prototype,"parentId",void 0),e([E.Property("text")],qe.prototype,"text",void 0),e([E.Property("iconCss")],qe.prototype,"iconCss",void 0),e([E.Property("url")],qe.prototype,"url",void 0),e([E.Property("separator")],qe.prototype,"separator",void 0),e([E.Property("items")],qe.prototype,"children",void 0),qe);function qe(){return null!==Ce&&Ce.apply(this,arguments)||this}Fe=E.ChildProperty,F(Ve,Fe),e([E.Property(null)],Ve.prototype,"iconCss",void 0),e([E.Property("")],Ve.prototype,"id",void 0),e([E.Property(!1)],Ve.prototype,"separator",void 0),e([E.Collection([],Ve)],Ve.prototype,"items",void 0),e([E.Property("")],Ve.prototype,"text",void 0),e([E.Property("")],Ve.prototype,"url",void 0),e([E.Property()],Ve.prototype,"htmlAttributes",void 0);var Fe,We=Ve;function Ve(){return null!==Fe&&Fe.apply(this,arguments)||this}_e=E.ChildProperty,F(Ke,_e),e([E.Property("SlideDown")],Ke.prototype,"effect",void 0),e([E.Property(400)],Ke.prototype,"duration",void 0),e([E.Property("ease")],Ke.prototype,"easing",void 0);var _e,ze=Ke;function Ke(){return null!==_e&&_e.apply(this,arguments)||this}Xe=E.Component,F(s,Xe),s.prototype.preRender=function(){if(this.isMenu||(i=void 0,"EJS-CONTEXTMENU"===this.element.tagName?(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName()),className:"e-control e-lib e-"+this.getModuleName()}),t=E.getValue("ej2_instances",this.element),E.removeClass([this.element],["e-control","e-lib","e-"+this.getModuleName()]),this.clonedElement=this.element,this.element=i,E.setValue("ej2_instances",t,this.element)):(i=this.createElement("ul",{id:E.getUniqueID(this.getModuleName())}),E.append([].slice.call(this.element.cloneNode(!0).children),i),(t=this.element.nextElementSibling)?this.element.parentElement.insertBefore(i,t):this.element.parentElement.appendChild(i),this.clonedElement=i),this.clonedElement.style.display="none"),"EJS-MENU"===this.element.tagName){for(var e=this.element,t=E.getValue("ej2_instances",e),i=this.createElement("ul"),s=this.createElement("EJS-MENU",{className:"e-"+this.getModuleName()+"-wrapper"}),n=0,r=e.attributes.length;n<r;n++)i.setAttribute(e.attributes[n].nodeName,e.attributes[n].nodeValue);e.parentNode.insertBefore(s,e),E.detach(e),e=i,s.appendChild(e),E.setValue("ej2_instances",t,e),this.clonedElement=s,this.element=e,this.element.id||(this.element.id=E.getUniqueID(this.getModuleName()))}},s.prototype.render=function(){var e=this,t=(this.initialize(),this.renderItems(),this.wireEvents(),this.renderComplete(),this.getWrapper());this.template&&this.enableScrolling&&(this.isReact||this.isAngular)&&requestAnimationFrame(function(){ge(e.createElement,t,e.element,"hscroll",e.enableRtl)})},s.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&&E.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&e.classList.add(Re),e.appendChild(this.element),this.isMenu&&this.hamburgerMode&&(this.target||this.createHeaderContainer(e)),this.defaultOption=this.showItemOnClick},s.prototype.renderItems=function(){this.items.length||(e=U.ListBase.createJsonFromElement(this.element,{fields:{child:"items"}}),this.setProperties({items:e},!0),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="");var e=this.createItems(this.items);E.append(Array.prototype.slice.call(e.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&&(e=this.getWrapper(),this.element.classList.contains("e-vertical")?ge(this.createElement,e,this.element,"vscroll",this.enableRtl):ge(this.createElement,e,this.element,"hscroll",this.enableRtl))):(this.element.parentElement.setAttribute("role","dialog"),this.element.parentElement.setAttribute("aria-label","context menu"))},s.prototype.wireEvents=function(){var e=this.getWrapper();if(this.target){for(var t=void 0,i=E.selectAll(this.target),s=0,n=i.length;s<n;s++)t=i[s],this.isMenu?E.EventHandler.add(t,"click",this.menuHeaderClickHandler,this):E.Browser.isIos?new E.Touch(t,{tapHold:this.touchHandler.bind(this)}):E.EventHandler.add(t,"contextmenu",this.cmenuHandler,this);if(this.targetElement=t,!this.isMenu){E.EventHandler.add(this.targetElement,"scroll",this.scrollHandler,this);for(var r=0,o=g.getScrollableParent(this.targetElement);r<o.length;r++){var l=o[r];E.EventHandler.add(l,"scroll",this.scrollHandler,this)}}}E.Browser.isDevice||(this.delegateMoverHandler=this.moverHandler.bind(this),this.delegateMouseDownHandler=this.mouseDownHandler.bind(this),E.EventHandler.add(this.isMenu?document:e,"mouseover",this.delegateMoverHandler,this),E.EventHandler.add(document,"mousedown",this.delegateMouseDownHandler,this),E.EventHandler.add(document,"keydown",this.domKeyHandler,this),this.isMenu)||this.target||E.EventHandler.add(document,"scroll",this.scrollHandler,this),this.delegateClickHandler=this.clickHandler.bind(this),E.EventHandler.add(document,"click",this.delegateClickHandler,this),this.wireKeyboardEvent(e),this.rippleFn=E.rippleEffect(e,{selector:"."+De})},s.prototype.wireKeyboardEvent=function(e){var t={downarrow:Oe,uparrow:Ne,enter:Se,leftarrow:we,rightarrow:Le,escape:Ie};this.isMenu&&(t.home=ke,t.end=Ae,t.tab=Te),new E.KeyboardEvents(e,{keyAction:this.keyBoardHandler.bind(this),keyConfigs:t})},s.prototype.mouseDownHandler=function(e){E.closest(e.target,".e-"+this.getModuleName()+"-wrapper")===this.getWrapper()||E.closest(e.target,".e-"+this.getModuleName()+"-popup")||this.closeMenu(this.isMenu?null:this.navIdx.length,e)},s.prototype.keyHandler=function(e){38!==e.keyCode&&40!==e.keyCode||e.target&&(e.target.classList.contains("e-contextmenu")||e.target.classList.contains("e-menu-item"))&&e.preventDefault()},s.prototype.domKeyHandler=function(e){27===e.keyCode&&(e.action=Ie,this.leftEscKeyHandler(e))},s.prototype.keyBoardHandler=function(e){var t="",i=e.target,s=this.isMenu&&!this.hamburgerMode&&!this.element.classList.contains("e-vertical")&&this.navIdx.length<1;if(e.preventDefault(),this.enableScrolling&&13===e.keyCode&&i.classList.contains("e-scroll-nav")&&this.removeLIStateByClass([v,y],[E.closest(i,".e-"+this.getModuleName()+"-wrapper")]),s)switch(e.action){case Le:t=Le,e.action=Oe;break;case we:t=we,e.action=Ne;break;case Oe:t=Oe,e.action=Le;break;case Ne:t=Ne,e.action=""}else if(this.enableRtl)switch(e.action){case we:s=!0,t=we,e.action=Le;break;case Le:s=!0,t=Le,e.action=we}switch(e.action){case Oe:case Ne:case Ae:case ke:case Te:this.upDownKeyHandler(e);break;case Le:this.rightEnterKeyHandler(e);break;case we:this.leftEscKeyHandler(e);break;case Se:this.hamburgerMode&&"SPAN"===i.tagName&&i.classList.contains("e-menu-icon")?this.menuHeaderClickHandler(e):this.rightEnterKeyHandler(e)}s&&(e.action=t)},s.prototype.upDownKeyHandler=function(e){var t=this.getUlByNavIdx(),i=e.action===Oe||e.action===ke||e.action===Te?0:t.childElementCount-1,s=i,n=this.getLIByClass(t,v),n=(n&&(e.action!==Ae&&e.action!==ke&&(s=this.getIdx(t,n)),n.classList.remove(v),e.action!==Ae)&&e.action!==ke&&(e.action===Oe?s++:s--,s===(e.action===Oe?t.childElementCount:-1))&&(s=i),t.children[s]),s=this.isValidLI(n,s,e.action);t.children[s].classList.add(v),t.children[s].focus()},s.prototype.isValidLI=function(e,t,i){var s=this.getUlByNavIdx(),n=i===Oe||i===ke||i===Te?0:s.childElementCount-1;return(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))&&(i===Oe&&t===s.childElementCount-1||i===Ne&&0===t?t=n:i===Oe||i===Le||"tab"===i&&e.classList.contains(xe)?t++:t--),t=(e=s.children[t])&&(e.classList.contains(xe)||e.classList.contains(Me)||e.classList.contains(He))?this.isValidLI(e,t,i):t},s.prototype.getUlByNavIdx=function(e){var t,i,s=this;return void 0===e&&(e=this.navIdx.length),this.isMenu?(t=[this.getWrapper()].concat([].slice.call(E.selectAll("."+Be)))[e],i=[],E.selectAll("."+Be).forEach(function(e){(s.element.id===e.id.split("-")[2]||e.id.split("-")[2]+"-"+e.id.split("-")[3])&&i.push(e)}),t=[this.getWrapper()].concat([].slice.call(i))[e],E.isNullOrUndefined(t)?null:E.select(".e-menu-parent",t)):document.body.contains(this.element)||0!==e?this.getWrapper().children[e]:null},s.prototype.rightEnterKeyHandler=function(e){var t=this.getUlByNavIdx(),i=this.getLIByClass(t,v);if(i){var t=this.getIdx(t,i),s=this.navIdx.concat(t),n=this.getItem(s);if(n.items.length)this.navIdx.push(t),this.keyType="right",this.action=e.action,this.openMenu(i,n,-1,-1,e);else if(e.action===Se){this.isMenu&&0===this.navIdx.length?this.removeLIStateByClass([y],[this.getWrapper()]):i.classList.remove(v),i.classList.add(y),this.trigger("select",{element:i,item:n,event:e});s=i.querySelector(".e-menu-url");if(n.url&&s)switch(s.getAttribute("target")){case"_blank":window.open(n.url,"_blank");break;case"_parent":window.parent.location.href=n.url;break;default:window.location.href=n.url}this.closeMenu(null,e);t=this.getLIByClass(this.getUlByNavIdx(),y);t&&(t.classList.add(v),t.focus())}}},s.prototype.leftEscKeyHandler=function(e){this.navIdx.length?(this.keyType="left",this.closeMenu(this.navIdx.length,e)):e.action===Ie&&this.closeMenu(null,e)},s.prototype.scrollHandler=function(e){this.closeMenu(null,e)},s.prototype.touchHandler=function(e){this.isTapHold=!0,this.cmenuHandler(e.originalEvent)},s.prototype.cmenuHandler=function(e){e.preventDefault(),this.currentTarget=e.target,this.isCMenu=!0,this.pageX=e.changedTouches?e.changedTouches[0].pageX+1:e.pageX+1,this.pageY=e.changedTouches?e.changedTouches[0].pageY+1:e.pageY+1,this.closeMenu(null,e),this.isCMenu&&(this.canOpen(e.target)&&this.openMenu(null,null,this.pageY,this.pageX,e),this.isCMenu=!1)},s.prototype.closeMenu=function(l,a,d){var e,h,c,t,p,i,s,n,u,m,f=this;void 0===l&&(l=0),void 0===a&&(a=null),this.isMenuVisible()&&(e=void 0,c=this.getWrapper(),t=void 0,i=this.getPopups(),s=!1,n=this.isMenu?i.length+1:c.childElementCount,u=this.isMenu&&1!==n?E.select(".e-ul",i[n-2]):E.selectAll(".e-menu-parent",c)[n-1],this.isMenu&&u.classList.contains("e-menu")&&((e=this.getLIByClass(u,y))&&e.classList.remove(y),s=!0),s||(m=a&&a.target&&this.getLI(a.target),this.cli=m||u.children[0],h=this.navIdx.length?this.getItem(this.navIdx):null,p=(h||this).items,t={element:u,parentItem:h,items:p,event:a,cancel:!1,isFocused:!0},this.trigger("beforeClose",t,function(e){var t,i,s,n="",r=!e.cancel,o=((r||f.isCMenu)&&(f.isMenu?(t=E.closest(u,"."+Be),f.hamburgerMode&&(t.parentElement.style.minHeight="",E.closest(u,".e-menu-item").setAttribute("aria-expanded","false")),f.unWireKeyboardEvent(t),ye(E.getInstance(t.children[0],fe),t.children[0]),(o=E.getInstance(t,g.Popup)).hide(),n=t.id,o.destroy(),E.detach(t)):(f.isContextMenuClosed=!1,f.toggleAnimation(u,!1)),f.trigger("onClose",{element:u,parentItem:h,items:p}),f.navIdx.pop(),0===f.navIdx.length&&a&&"keyup"===a.type&&(f.showSubMenu=!1),f.isMenu||(E.EventHandler.remove(u,"keydown",f.keyHandler),"right"===f.keyType&&(f.keyType=""))),f.updateReactTemplate(),f.getWrapper()&&f.getUlByNavIdx()),n=(f.isCMenu&&(f.canOpen(a.target)&&f.openMenu(null,null,f.pageY,f.pageX,a),f.isCMenu=!1),f.isMenu&&o&&n.length?(t=new RegExp("(.*)-ej2menu-"+f.element.id+"-popup").exec(n)[1],i=o.querySelector('[id="'+t+'"]'),s=m&&o.querySelector('[id="'+m.id+'"]')):o&&(i=o.querySelector(".e-menu-item.e-selected"),s=m&&o.querySelector('[id="'+m.id+'"]')),m&&m.querySelectorAll(".e-menu-item"));r&&f.hamburgerMode&&l&&!n.length?f.afterCloseMenu(a):r&&!f.hamburgerMode&&i&&!s&&"left"!==f.keyType&&(f.navIdx.length||!f.isMenu&&0===f.navIdx.length)?(t=a&&a.target.classList&&(a.target.classList.contains("e-vscroll")||a.target.classList.contains("e-scroll-nav"))?E.closest(a.target,".e-menu-wrapper"):null)?(t=t.querySelector(".e-menu-item"),(f.showItemOnClick||t&&f.getIndex(t.id,!0).length<=f.navIdx.length)&&f.closeMenu(f.navIdx[f.navIdx.length-1],a,!0)):a&&a.target.classList&&a.target.classList.contains("e-nav-arrow")||f.closeMenu(f.navIdx[f.navIdx.length-1],a):r&&!d&&!l&&(f.hamburgerMode&&f.navIdx.length||1===f.navIdx.length&&m&&o!==m.parentElement)||r&&E.isNullOrUndefined(l)&&f.navIdx.length?f.closeMenu(null,a):!r||f.isMenu||l||0!==f.navIdx.length||f.isMenusClosed||f.isCmenuHover?r&&f.isMenu&&a&&a.target&&0!==f.navIdx.length&&E.closest(a.target,".e-menu-parent.e-control")?f.closeMenu(0,a):r&&!f.isMenu&&E.selectAll(".e-menu-parent",c)[l-1]&&3===a.which?f.closeMenu(null,a):(!r||"right"!==f.keyType&&"click"!==f.keyType?(n=f.getUlByNavIdx(),(i=f.getLIByClass(n,y))&&(i.setAttribute("aria-expanded","false"),i.classList.remove(y),e.isFocused&&m||"left"===f.keyType)&&(i.classList.add(v),a.target&&a.target.classList.contains("e-edit-template")||i.focus()),!r&&f.hamburgerMode&&m&&"false"===m.getAttribute("aria-expanded")&&"true"===m.getAttribute("aria-haspopup")&&(E.closest(m,".e-menu-parent.e-control")?f.navIdx=[]:f.navIdx.pop(),f.navIdx.push(f.cliIdx),s=f.getItem(f.navIdx),m.setAttribute("aria-expanded","true"),f.openMenu(m,s,-1,-1,a))):f.afterCloseMenu(a),f.navIdx.length<1&&("Hover"!==f.showSubMenuOn&&"Click"!==f.showSubMenuOn||(f.showItemOnClick=f.defaultOption,f.showSubMenuOn="Auto"))):(f.isMenusClosed=!0,f.closeMenu(0,a)),f.removeStateWrapper()})))},s.prototype.updateReactTemplate=function(){var e;this.isReact&&this.template&&0===this.navIdx.length&&(e=void 0,this.portals&&(e=this.portals.splice(0,this.items.length)),this.clearTemplate(["template"]),this.portals=e,this.renderReactTemplates())},s.prototype.getMenuItemModel=function(e,t){if(E.isNullOrUndefined(e))return null;E.isNullOrUndefined(t)&&(t=0);t=this.getFields(t);return{text:e[t.text],id:e[t.id],items:e[t.child],separator:e[t.separator],iconCss:e[t.iconCss],url:e[t.url]}},s.prototype.getPopups=function(){var t=this,i=[];return[].slice.call(document.querySelectorAll("."+Be)).forEach(function(e){!E.isNullOrUndefined(e.querySelector("."+De))&&t.getIndex(e.querySelector("."+De).id,!0).length&&i.push(e)}),i},s.prototype.isMenuVisible=function(){return 0<this.navIdx.length||this.element.classList.contains("e-contextmenu")&&E.isVisible(this.element).valueOf()},s.prototype.canOpen=function(e){var t=!0;if(this.filter)for(var t=!1,i=this.filter.split(" "),s=0,n=i.length;s<n;s++)if(E.closest(e,"."+i[s])){t=!0;break}return t},s.prototype.openMenu=function(e,t,i,s,n,r){var o,l=this,a=(void 0===i&&(i=0),void 0===s&&(s=0),void 0===n&&(n=null),void 0===r&&(r=this.targetElement),this.getWrapper()),d=(this.lItem=e,""!==this.element.id?this.element.id:"menu");this.isMenusClosed=!1,E.isNullOrUndefined(i)&&(i=-1),E.isNullOrUndefined(s)&&(s=-1),e?(this.uList=this.createItems(t[this.getField("children",this.navIdx.length-1)]),!this.isMenu&&E.Browser.isDevice&&(a.lastChild.style.display="none",o={text:t[this.getField("text")].toString(),iconCss:Ue+" e-previous"},this.template&&(t.iconCss=(t.iconCss||"")+Ue+" e-previous"),o=new We(this.items[0],"items",this.template?t:o,!0),(o=this.createItems([o]).children[0]).classList.add(Ee),this.uList.insertBefore(o,this.uList.children[0])),this.isMenu?(this.popupWrapper=this.createElement("div",{className:"e-"+this.getModuleName()+"-wrapper "+Be,id:e.id+"-ej2menu-"+d+"-popup"}),(this.hamburgerMode?(i=e.offsetHeight,e):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&&E.addClass([this.popupWrapper],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.popupObj.hide()),this.hamburgerMode||this.showItemOnClick||!this.hoverDelay?this.triggerBeforeOpen(e,this.uList,t,n,0,0,"menu"):(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,t,n,0,0,"menu")},this.hoverDelay))):(this.uList.style.zIndex=this.element.style.zIndex,a.appendChild(this.uList),!this.showItemOnClick&&this.hoverDelay?(window.clearInterval(this.timer),this.timer=window.setTimeout(function(){l.triggerBeforeOpen(e,l.uList,t,n,i,s,"none")},this.hoverDelay)):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))):(this.uList=this.element,this.uList.style.zIndex=g.getZindexPartial(r||this.element).toString(),E.isNullOrUndefined(n)?((o=document.createEvent("MouseEvents")).initEvent("click",!0,!1),(d=this.copyObject(o,{})).target=d.srcElement=r,d.currentTarget=r,this.triggerBeforeOpen(e,this.uList,t,d,i,s,"none")):this.triggerBeforeOpen(e,this.uList,t,n,i,s,"none"))},s.prototype.copyObject=function(e,t){for(var i in e)t[""+i]=e[""+i];return t},s.prototype.calculateIndentSize=function(e,t){var i=getComputedStyle(t),i=parseInt(i.textIndent,10),s=(this.navIdx.length<2&&!t.classList.contains("e-blankicon")?i*=2:i+=i/4,e.style.textIndent=i+"px",e.querySelectorAll(".e-blankicon"));if(s&&s.length)for(var t=e.querySelector(".e-menu-icon"),e=getComputedStyle(t),n=parseInt(e.marginRight,10)+t.offsetWidth+i,r=0;r<s.length;r++)s[r].style.textIndent=n+"px"},s.prototype.generatePopup=function(e,t,i,s){var n=this,r=new g.Popup(e,{actionOnScroll:this.hamburgerMode?"none":"reposition",relateTo:i,collision:this.hamburgerMode?{X:"none",Y:"none"}:{X:s||this.enableRtl?"none":"flip",Y:"fit"},position:s&&!this.hamburgerMode?{X:"right",Y:"top"}:{X:"left",Y:"bottom"},targetType:"relative",enableRtl:this.enableRtl,content:t,open:function(){var e=E.select(".e-menu-vscroll",r.element),e=(e&&(e.style.height="inherit",e.style.maxHeight=""),E.select(".e-ul",r.element));r.element.style.maxHeight="",e.focus(),n.triggerOpen(e)}});return r},s.prototype.createHeaderContainer=function(e){e=e||this.getWrapper();var t=this.createElement("span",{className:"e-"+this.getModuleName()+"-header"}),i=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(this.title):this.title,i=this.createElement("span",{className:"e-"+this.getModuleName()+"-title",innerHTML:i}),s=this.createElement("span",{className:"e-icons e-"+this.getModuleName()+"-icon",attrs:{tabindex:"0"}});t.appendChild(i),t.appendChild(s),e.insertBefore(t,this.element)},s.prototype.openHamburgerMenu=function(e){this.hamburgerMode&&this.triggerBeforeOpen(null,this.element,null,e,0,0,"hamburger")},s.prototype.closeHamburgerMenu=function(t){var i=this,e={element:this.element,parentItem:null,event:t,items:this.items,cancel:!1};this.trigger("beforeClose",e,function(e){e.cancel||(i.closeMenu(null,t),i.element.classList.add("e-hide-menu"),i.trigger("onClose",{element:i.element,parentItem:null,items:i.items}))})},s.prototype.callFit=function(e,t,i,s,n){return g.fit(e,null,{X:t,Y:i},{top:s,left:n})},s.prototype.triggerBeforeOpen=function(s,n,r,o,e,t,i){var l,a=this,d=s?r[this.getField("children",this.navIdx.length-1)]:this.items,h=i;this.trigger("beforeOpen",{element:n,items:d,parentItem:r,event:o,cancel:!1,top:e,left:t,showSubMenuOn:"Auto"},function(e){switch(h){case"menu":a.hamburgerMode||("Auto"!==e.showSubMenuOn&&(a.showItemOnClick=!a.defaultOption,a.showSubMenuOn=e.showSubMenuOn),a.top=e.top,a.left=e.left),a.popupWrapper.style.display="block",a.hamburgerMode||(a.popupWrapper.style.maxHeight=a.popupWrapper.getBoundingClientRect().height+"px",a.enableScrolling&&ge(a.createElement,a.popupWrapper,a.uList,"vscroll",a.enableRtl),a.checkScrollOffset(o)),a.hamburgerMode||a.left||a.top?(a.popupObj.collision={X:"none",Y:"none"},a.popupWrapper.style.display=""):(a.popupObj.refreshPosition(a.lItem,!0),a.left=parseInt(a.popupWrapper.style.left,10),a.top=parseInt(a.popupWrapper.style.top,10),a.enableRtl&&(a.left=a.isNestedOrVertical?a.left-a.popupWrapper.offsetWidth-a.lItem.parentElement.offsetWidth+2:a.left-a.popupWrapper.offsetWidth+a.lItem.offsetWidth),a.template&&(a.isReact||a.isAngular)?requestAnimationFrame(function(){a.collision(),a.popupWrapper.style.display=""}):(a.collision(),a.popupWrapper.style.display=""));break;case"none":a.top=e.top,a.left=e.left,a.isContextMenuClosed=!0,l=e.element,a.enableScrolling&&a.isCMenu&&l&&l.parentElement&&(l.style.height=l.parentElement.style.height);break;case"hamburger":e.cancel||(a.element.classList.remove("e-hide-menu"),a.triggerOpen(a.element))}var t,i;"hamburger"!==h&&(e.cancel?(a.isMenu?(a.popupObj.destroy(),E.detach(a.popupWrapper)):-1<n.className.indexOf("e-ul")&&E.detach(n),a.navIdx.pop()):a.isMenu?a.hamburgerMode?(a.popupWrapper.style.top=a.top+"px",a.popupWrapper.style.left="0px",a.toggleAnimation(a.popupWrapper)):(a.setBlankIconStyle(a.popupWrapper),a.wireKeyboardEvent(a.popupWrapper),E.rippleEffect(a.popupWrapper,{selector:"."+De}),a.popupWrapper.style.left=a.left+"px",a.popupWrapper.style.top=a.top+"px",t="None"!==a.animationSettings.effect?{name:a.animationSettings.effect,duration:a.animationSettings.duration,timingFunction:a.animationSettings.easing}:null,a.popupObj.show(t,a.lItem),E.Browser.isDevice&&(a.popupWrapper.style.left=a.left+"px")):(a.setBlankIconStyle(a.uList),a.setPosition(a.lItem,a.uList,a.top,a.left),a.toggleAnimation(a.uList))),"right"===a.keyType&&(t=a.getUlByNavIdx(),s.classList.remove(v),a.isMenu&&1===a.navIdx.length&&a.removeLIStateByClass([y],[a.getWrapper()]),s.classList.add(y),a.action===Se&&a.trigger("select",{element:s,item:r,event:o}),s.focus(),t=a.getUlByNavIdx(),i=a.isValidLI(t.children[0],0,a.action),t.children[i].classList.add(v),t.children[i].focus())})},s.prototype.collision=function(){var e,t=g.isCollide(this.popupWrapper,null,this.left,this.top);(this.isNestedOrVertical||this.enableRtl)&&(-1<t.indexOf("right")||-1<t.indexOf("left"))&&(this.popupObj.collision.X="none",e=E.closest(this.lItem,".e-"+this.getModuleName()+"-wrapper").offsetWidth,this.left=this.enableRtl?g.calculatePosition(this.lItem,this.isNestedOrVertical?"right":"left","top").left:this.left-this.popupWrapper.offsetWidth-e+2),(-1<(t=g.isCollide(this.popupWrapper,null,this.left,this.top)).indexOf("left")||-1<t.indexOf("right"))&&(this.left=this.callFit(this.popupWrapper,!0,!1,this.top,this.left).left),this.popupWrapper.style.left=this.left+"px"},s.prototype.setBlankIconStyle=function(e){var t,i,s,n,r=[].slice.call(e.getElementsByClassName("e-blankicon"));r.length&&(e=e.querySelector(".e-menu-item:not(.e-blankicon):not(.e-separator)"))&&(i=e.querySelector(".e-menu-icon"))&&(t=this.enableRtl?{padding:"paddingRight",margin:"marginLeft"}:{padding:"paddingLeft",margin:"marginRight"},i=getComputedStyle(i),s=parseInt(i.fontSize,10),n=(s=parseInt(i.width,10)&&parseInt(i.width,10)>s?parseInt(i.width,10):s)+parseInt(i[t.margin],10)+parseInt(getComputedStyle(e)[t.padding],10)+"px",r.forEach(function(e){e.style[t.padding]=n}))},s.prototype.checkScrollOffset=function(e){var t,i=this.getWrapper();i.children[0].classList.contains("e-menu-hscroll")&&1===this.navIdx.length&&(e=E.isNullOrUndefined(e)?this.element:E.closest(e.target,"."+De),(i=E.select(".e-hscroll-bar",i)).scrollLeft>e.offsetLeft&&(i.scrollLeft-=i.scrollLeft-e.offsetLeft),(t=i.scrollLeft+i.offsetWidth)<(e=e.offsetLeft+e.offsetWidth))&&(i.scrollLeft+=e-t)},s.prototype.setPosition=function(e,t,i,s){this.toggleVisiblity(t),t===this.element||-1<s&&-1<i?(-1<(r=g.isCollide(t,null,s,i)).indexOf("right")&&(s-=t.offsetWidth),-1<r.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top-20)<0&&-1<(n=pageYOffset+document.documentElement.clientHeight-t.getBoundingClientRect().height)&&(i=n),-1<(r=g.isCollide(t,null,s,i)).indexOf("left")&&(s=(o=this.callFit(t,!0,!1,i,s)).left)):E.Browser.isDevice?(i=Number(this.element.style.top.replace("px","")),s=Number(this.element.style.left.replace("px",""))):(n=this.enableRtl?"left":"right",i=(o=g.calculatePosition(e,n,"top")).top,s=o.left,(n=-1<(r=g.isCollide(t,null,this.enableRtl?s-t.offsetWidth:s,i)).indexOf("left")||-1<r.indexOf("right"))&&(s=(o=g.calculatePosition(e,this.enableRtl?"right":"left","top")).left),(this.enableRtl||n)&&(s=this.enableRtl&&n?s:s-t.offsetWidth),-1<r.indexOf("bottom")&&(i=(o=this.callFit(t,!1,!0,i,s)).top)),this.toggleVisiblity(t,!1),this.isCMenu&&this.enableScrolling&&t&&(t.style.height="");var n,r,o,e=E.closest(this.element,".e-"+this.getModuleName()+"-wrapper");!this.isMenu&&this.enableScrolling&&t&&e&&0<e.offsetHeight?(n=E.closest(t,".e-menu-vscroll"),t.style.display="block",n&&ye(E.getInstance(n,fe),n),r=Math.ceil(this.getMenuWidth(t,t.offsetWidth,this.enableRtl)),o=ge(this.createElement,e,t,"vscroll",this.enableRtl,e.offsetHeight),Object.assign(o.style,{top:i+"px",left:s+"px",width:r+"px",position:"absolute",display:"none"})):(t.style.top=i+"px",t.style.left=s+"px")},s.prototype.getMenuWidth=function(e,t,i){e=e.getElementsByClassName(Pe)[0];return e&&(t+=parseInt(getComputedStyle(e)[i?"marginRight":"marginLeft"],10)),t<120?120:t},s.prototype.toggleVisiblity=function(e,t){e.style.visibility=(t=void 0===t?!0:t)?"hidden":"",e.style.display=t?"block":"none"},s.prototype.createItems=function(e){var i=this,s=this.navIdx?this.navIdx.length:0,t=this.getFields(s),n=this.hasField(e,this.getField("iconCss",s)),r={showIcon:n,moduleName:"menu",fields:t,template:this.template,itemNavigable:!0,itemCreating:function(e){e.curData[e.fields[t.id]]||(e.curData[e.fields[t.id]]=E.getUniqueID("menuitem")),E.isNullOrUndefined(e.curData.htmlAttributes)&&(e.curData.htmlAttributes={}),E.Browser.isIE?(e.curData.htmlAttributes.role||(e.curData.htmlAttributes.role="menuitem"),e.curData.htmlAttributes.tabindex||(e.curData.htmlAttributes.tabindex="-1")):Object.assign(e.curData.htmlAttributes,{role:e.curData.htmlAttributes.role||"menuitem",tabindex:e.curData.htmlAttributes.tabindex||"-1"}),!i.isMenu||e.curData[i.getField("separator",s)]||e.curData.htmlAttributes["aria-label"]||(e.curData.htmlAttributes["aria-label"]=e.curData[e.fields.text]||e.curData[e.fields.id]),""===e.curData[e.fields[t.iconCss]]&&(e.curData[e.fields[t.iconCss]]=null)},itemCreated:function(e){e.curData[i.getField("separator",s)]&&(e.item.classList.add(xe),e.curData.htmlAttributes.role||e.item.setAttribute("role","separator")),!n||e.curData[e.fields.iconCss]||e.curData[i.getField("separator",s)]||e.item.classList.add("e-blankicon"),e.curData[e.fields.child]&&e.curData[e.fields.child].length&&(t=i.createElement("span",{className:Ue+" "+Pe}),e.item.appendChild(t),e.item.setAttribute("aria-haspopup","true"),e.item.setAttribute("aria-expanded","false"),e.item.classList.add("e-menu-caret-icon")),i.isMenu&&i.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"),e.item.removeAttribute("aria-level"));var t={item:e.curData,element:e.item};i.trigger("beforeItemRender",t)}},e=(this.setProperties({items:this.items},!0),this.isMenu&&(r.templateID=this.element.id+"Template"),U.ListBase.createList(this.createElement,e,r,!this.template,this));return e.setAttribute("tabindex","0"),this.isMenu?e.setAttribute("role","menu"):e.setAttribute("role","menubar"),e},s.prototype.moverHandler=function(e){var t=e.target,i=(this.liTrgt=t,this.isMenu||(this.isCmenuHover=!0),this.getLI(t)),s=i?E.closest(i,".e-"+this.getModuleName()+"-wrapper"):this.getWrapper(),n=this.getWrapper(),r=new RegExp("-ej2menu-(.*)-popup"),o=!1;if(s){if((""!==s.id?r.exec(s.id)[1]:s.querySelector("ul").id)!==this.element.id){if(this.removeLIStateByClass([v,y],[this.getWrapper()]),!this.navIdx.length)return;o=!0}i&&E.closest(i,".e-"+this.getModuleName()+"-wrapper")&&!o?(this.removeLIStateByClass([v],this.isMenu?[s].concat(this.getPopups()):[s]),this.removeLIStateByClass([v],this.isMenu?[n].concat(this.getPopups()):[n]),i.classList.add(v),this.showItemOnClick||this.clickHandler(e)):this.isMenu&&this.showItemOnClick&&!o&&this.removeLIStateByClass([v],[s].concat(this.getPopups())),this.isMenu&&(this.showItemOnClick||t.parentElement===s||E.closest(t,".e-"+this.getModuleName()+"-popup")||i&&this.getIndex(i.id,!0).length||"Hover"===this.showSubMenuOn?o&&!this.showItemOnClick&&this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e)):(this.removeLIStateByClass([v],[s]),this.navIdx.length&&(this.isClosed=!0,this.closeMenu(null,e))),this.isClosed||this.removeStateWrapper(),this.isClosed=!1),this.isMenu||(this.isCmenuHover=!1)}},s.prototype.removeStateWrapper=function(){var e;this.liTrgt&&(e=E.closest(this.liTrgt,".e-menu-vscroll"),"DIV"===this.liTrgt.tagName)&&e&&this.removeLIStateByClass([v,y],[e])},s.prototype.removeLIStateByClass=function(e,i){for(var s,t=0;t<i.length;t++)!function(t){e.forEach(function(e){(s=E.select("."+e,i[t]))&&s.classList.remove(e)})}(t)},s.prototype.getField=function(e,t){void 0===t&&(t=0);e=this.fields[""+e];return"string"==typeof e?e:(e[t]||e[e.length-1]).toString()},s.prototype.getFields=function(e){return{id:this.getField("itemId",e=void 0===e?0: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)}},s.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},s.prototype.menuHeaderClickHandler=function(e){var t=E.closest(e.target,".e-menu-wrapper");t&&t.querySelector("ul.e-menu-parent").id!==this.element.id||(-1<this.element.className.indexOf("e-hide-menu")?this.openHamburgerMenu(e):this.closeHamburgerMenu(e))},s.prototype.clickHandler=function(e){this.isTapHold=this.isTapHold&&!1;var t,i=this.getWrapper(),s=e.target,n=this.cli=this.getLI(s),r=new RegExp("-ej2menu-(.*)-popup"),o=n?E.closest(n,".e-"+this.getModuleName()+"-wrapper"):null,l=n&&o&&(this.isMenu?0<this.getIndex(n.id,!0).length:i.firstElementChild.id===o.firstElementChild.id);if(E.Browser.isDevice&&this.isMenu&&(this.removeLIStateByClass([v],[i].concat(this.getPopups())),this.mouseDownHandler(e)),n&&o&&this.isMenu){var r=o.id?r.exec(o.id)[1]:o.querySelector(".e-menu-parent").id;if(this.element.id!==r)return}l&&"click"===e.type&&!n.classList.contains(Ee)&&(this.setLISelected(n),o=this.getIndex(n.id,!0),r=this.getItem(o),this.trigger("select",{element:n,item:r,event:e})),l&&("mouseover"===e.type||E.Browser.isDevice||this.showItemOnClick)?(o=void 0,n.classList.contains(Ee)?(o=i.children[this.navIdx.length-1],this.toggleAnimation(o),(t=this.getLIByClass(o,y))&&t.classList.remove(y),E.detach(n.parentNode),this.navIdx.pop()):n.classList.contains(xe)||(this.showSubMenu=!0,r=n.parentNode,E.isNullOrUndefined(r))||(this.cliIdx=this.getIdx(r,n),!this.isMenu&&E.Browser.isDevice||(l=this.isMenu?Array.prototype.indexOf.call([i].concat(this.getPopups()),E.closest(r,".e-"+this.getModuleName()+"-wrapper")):this.getIdx(i,r),this.navIdx[l]===this.cliIdx&&(this.showSubMenu=!1),l===this.navIdx.length)||"mouseover"===e.type&&!this.showSubMenu||((t=this.getLIByClass(r,y))&&t.classList.remove(y),this.isClosed=!0,this.keyType="click",this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!0)),this.closeMenu(l+1,e),this.showItemOnClick&&(this.setLISelected(n),this.isMenu||(this.isCmenuHover=!1))),this.isClosed||this.afterCloseMenu(e),this.isClosed=!1)):"DIV"===s.tagName&&E.closest(s,".e-menu-vscroll")&&(this.navIdx.length||!this.isMenu&&this.enableScrolling&&0===this.navIdx.length)?(o=this.isMenu?E.closest(s,"."+Be):E.closest(s,".e-menu-vscroll"),(r=this.isMenu?Array.prototype.indexOf.call(this.getPopups(),o)+1:this.getIdx(i,E.select("ul.e-menu-parent",o)))<this.navIdx.length&&(this.closeMenu(r+1,e),o)&&this.removeLIStateByClass([v,y],[o])):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("."+De).id,!0).length:s.parentElement===i)||(n||this.removeLIStateByClass([y],[i]),(!this.isAnimationNone&&!n||n&&!n.querySelector("."+Pe))&&(navigator.platform.toUpperCase().indexOf("MAC")<0||0<=navigator.platform.toUpperCase().indexOf("MAC")&&!e.ctrlKey)&&this.closeMenu(null,e))},s.prototype.afterCloseMenu=function(e){var t,i,s;E.isNullOrUndefined(e)||(this.showSubMenu&&(t=this.showItemOnClick&&0===this.navIdx.length?E.closest(e.target,".e-menu-parent.e-control"):E.closest(this.element,".e-menu-parent.e-control"),i=this.navIdx.concat(this.cliIdx),(s=this.getItem(i))&&s[this.getField("children",i.length-1)]&&s[this.getField("children",i.length-1)].length?(("mouseover"===e.type||E.Browser.isDevice&&this.isMenu)&&this.setLISelected(this.cli),(!this.hamburgerMode&&t||this.hamburgerMode&&"false"===this.cli.getAttribute("aria-expanded"))&&(this.cli.setAttribute("aria-expanded","true"),this.navIdx.push(this.cliIdx),this.openMenu(this.cli,s,null,null,e))):"mouseover"!==e.type&&this.closeMenu(null,e),!t)&&(i=this.getUlByNavIdx(),s=this.getLIByClass(i,y))&&(s.setAttribute("aria-expanded","false"),s.classList.remove(y)),this.keyType="")},s.prototype.setLISelected=function(e){var t=this.getLIByClass(e.parentElement,y);t&&t.classList.remove(y),this.isMenu||e.classList.remove(v),e.classList.add(y)},s.prototype.getLIByClass=function(e,t){if(e&&e.children)for(var i=0,s=e.children.length;i<s;i++)if(e.children[i].classList.contains(t))return e.children[i];return null},s.prototype.getItemIndex=function(e,t){e="string"==typeof e?e:e.id;return this.getIndex(e,!1!==t)},s.prototype.setItem=function(e,t,i){t=i?t||e.id:t||e.text,t=this.getIndex(t,i),i=this.getItem(t);Object.assign(i,e)},s.prototype.getItem=function(e){var t=(e=e.slice()).pop();return this.getItems(e)[t]},s.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},s.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])},s.prototype.getIdx=function(e,t,i){void 0===i&&(i=!0);var s=!this.isMenu&&this.enableScrolling&&E.select(".e-menu-vscroll",e)?E.selectAll(".e-menu-parent",e):Array.from(e.children),s=Array.prototype.indexOf.call(s,t);return i&&e.children[0].classList.contains(Ee)&&s--,s},s.prototype.getLI=function(e){return"LI"===e.tagName&&e.classList.contains("e-menu-item")?e:E.closest(e,"li.e-menu-item")},s.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)}},s.prototype.removeChildElement=function(e){for(;e.firstElementChild;)e.removeChild(e.firstElementChild);return e},s.prototype.onPropertyChanged=function(d,h){for(var c=this,p=this.getWrapper(),u=this,e=0,t=Object.keys(d);e<t.length;e++)!function(e){switch(e){case"cssClass":h.cssClass&&E.removeClass([p],h.cssClass.split(" ")),d.cssClass&&E.addClass([p],d.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":u.enableRtl?p.classList.add(Re):p.classList.remove(Re);break;case"showItemOnClick":u.unWireEvents(),u.showItemOnClick=d.showItemOnClick,u.wireEvents();break;case"enableScrolling":var t,i;d.enableScrolling?(u.element.classList.contains("e-vertical")?ge(u.createElement,p,u.element,"vscroll",u.enableRtl):ge(u.createElement,p,u.element,"hscroll",u.enableRtl),u.getPopups().forEach(function(e){t=E.select(".e-ul",e),ge(c.createElement,e,t,"vscroll",c.enableRtl)})):(i=p.children[0],u.element.classList.contains("e-vertical")||!u.isMenu?ye(E.getInstance(i,fe),i):ye(E.getInstance(i,ee),i),p.style.overflow="",p.appendChild(u.element),u.getPopups().forEach(function(e){i=e.children[0],ye(E.getInstance(i,fe),i),e.style.overflow=""}));break;case"items":var s,n,r=void 0;if(u.isReact&&u.template&&u.clearTemplate(["template"]),Object.keys(h.items).length)for(var o=Object.keys(d.items),l=0;l<o.length;l++)(r=u.getChangedItemIndex(d,[],Number(o[l]))).length<=u.getWrapper().children.length&&(s=r.pop(),n=u.getItems(r),u.insertAfter([n[s]],n[s].text),u.removeItem(n,r,s),u.setItems(n,r)),r.length=0;else{if(u.updateItem(u.element,u.items),u.enableScrolling&&u.element.parentElement.classList.contains("e-custom-scroll")&&(u.element.classList.contains("e-vertical")?ge(u.createElement,p,u.element,"vscroll",u.enableRtl):ge(u.createElement,p,u.element,"hscroll",u.enableRtl)),!u.hamburgerMode)for(var l=1,a=p.childElementCount;l<a;l++)E.detach(p.lastElementChild);u.navIdx=[]}}}(t[e])},s.prototype.updateItem=function(t,e){var i;E.isBlazor()&&!this.isMenu?t=this.removeChildElement(t):(this.enableScrolling&&(i=this.getWrapper().children[0],this.element.classList.contains("e-vertical")?ye(E.getInstance(i,fe),i):ye(E.getInstance(i,ee),i)),t.innerHTML=""),[].slice.call(this.createItems(e).children).forEach(function(e){t.appendChild(e)})},s.prototype.getChangedItemIndex=function(e,t,i){t.push(i);var s=Object.keys(e.items[i]).pop();return"items"===s?(e=e.items[i],(i=Object.keys(e.items).pop())&&this.getChangedItemIndex(e,t,Number(i))):"isParentArray"===s&&1<t.length&&t.pop(),t},s.prototype.removeItem=function(e,t,i){e.splice(i,1);e=this.getWrapper().children;t.length<e.length&&E.detach(e[t.length].children[i])},s.prototype.unWireEvents=function(e){void 0===e&&(e=this.target);var t=this.getWrapper();if(e){for(var i,s=void 0,n=E.selectAll(e),r=0,o=n.length;r<o;r++)i=n[r],this.isMenu?E.EventHandler.remove(i,"click",this.menuHeaderClickHandler):E.Browser.isIos?(s=E.getInstance(i,E.Touch))&&s.destroy():E.EventHandler.remove(i,"contextmenu",this.cmenuHandler);if(!this.isMenu){E.EventHandler.remove(this.targetElement,"scroll",this.scrollHandler);for(var l=0,a=g.getScrollableParent(this.targetElement);l<a.length;l++){var d=a[l];E.EventHandler.remove(d,"scroll",this.scrollHandler)}}}E.Browser.isDevice||(E.EventHandler.remove(this.isMenu?document:t,"mouseover",this.delegateMoverHandler),E.EventHandler.remove(document,"mousedown",this.delegateMouseDownHandler),E.EventHandler.remove(document,"keydown",this.domKeyHandler),this.isMenu)||this.target||E.EventHandler.remove(document,"scroll",this.scrollHandler),E.EventHandler.remove(document,"click",this.delegateClickHandler),this.unWireKeyboardEvent(t),this.rippleFn()},s.prototype.unWireKeyboardEvent=function(e){e=E.getInstance(e,E.KeyboardEvents);e&&e.destroy()},s.prototype.toggleAnimation=function(e,t){var i,s,n=this,r=(void 0===t&&(t=!0),this.enableScrolling&&!this.isMenu&&E.closest(e,".e-menu-vscroll")?E.closest(e,".e-menu-vscroll"):e);"None"!==this.animationSettings.effect&&t?this.animation.animate(r,{name:this.animationSettings.effect,duration:this.animationSettings.duration,timingFunction:this.animationSettings.easing,begin:function(e){n.hamburgerMode?(s=e.element.parentElement,e.element.style.position="absolute",s&&(i=s.offsetHeight),e.element.style.maxHeight=e.element.offsetHeight+"px",s&&(s.style.maxHeight="")):(e.element.style.display="block",e.element.style.maxHeight=n.isMenu?e.element.getBoundingClientRect().height+"px":e.element.scrollHeight+"px")},progress:function(e){n.hamburgerMode&&s&&(s.style.minHeight=i+e.element.offsetHeight+"px")},end:function(e){n.hamburgerMode?(e.element.style.position="",e.element.style.maxHeight="",s&&(s.style.minHeight=""),e.element.style.top="0px",e.element.children[0].focus(),n.triggerOpen(e.element.children[0])):n.end(e.element,t)}}):(this.hamburgerMode&&e&&(e.style.top="0px"),this.isAnimationNone="None"===this.animationSettings.effect,this.end(e,t))},s.prototype.triggerOpen=function(e){var t=this.navIdx.length?this.getItem(this.navIdx):null,t={element:e,parentItem:t,items:(t||this).items};this.trigger("onOpen",t),this.isMenu||E.EventHandler.add(e,"keydown",this.keyHandler,this)},s.prototype.end=function(e,t){var i;t&&this.isContextMenuClosed?((this.isMenu||!E.Browser.isDevice||!this.isMenu&&this.isAnimationNone&&E.Browser.isDevice)&&(e.style.display="block"),e.style.maxHeight="",(i=this.enableScrolling&&!this.isMenu?E.closest(e,".e-menu-vscroll"):null)&&(i.style.display="block"),this.triggerOpen(e),e.querySelector("."+v)?e.querySelector("."+v).focus():(t=this.getWrapper().children[this.getIdx(this.getWrapper(),e)-1],this.currentTarget&&(this.currentTarget.classList.contains("e-numerictextbox")||this.currentTarget.classList.contains("e-textbox")||"INPUT"===this.currentTarget.tagName)||(t?t.querySelector("."+y):this.element).focus())):((i=this.enableScrolling&&!this.isMenu?E.closest(e,".e-menu-vscroll"):null)&&ye(E.getInstance(i,fe),i),e===this.element?((t=this.getLIByClass(this.element,v))&&t.classList.remove(v),(i=this.getLIByClass(this.element,y))&&i.classList.remove(y),e.style.display="none",this.isAnimationNone=!1):E.detach(e))},s.prototype.getPersistData=function(){return""},s.prototype.getWrapper=function(){return E.closest(this.element,".e-"+this.getModuleName()+"-wrapper")},s.prototype.getIndex=function(e,t,i,s,n,r){void 0===s&&(s=[]),void 0===r&&(r=0),r=(n=void 0===n?!1:n)?r+1:0;for(var o=0,l=(i=void 0===i?this.items:i).length;o<l;o++){var a=i[o],d=t?a[this.getField("itemId",r)]:a[this.getField("text",r)];if((a.htmlAttributes&&"id"in a.htmlAttributes?a.htmlAttributes.id:d)===e){s.push(o);break}if(a[this.getField("children",r)]&&a[this.getField("children",r)].length){if(-1!==(s=this.getIndex(e,t,a[this.getField("children",r)],s,!0,r))[s.length-1]){s.unshift(o);break}o!==l-1&&s.pop()}else o===l-1&&s.push(-1)}return n||-1!==s[0]?s:[]},s.prototype.enableItems=function(e,t,i){void 0===t&&(t=!0);for(var s,n,r,o=Me,l=0;l<e.length;l++){if(r=this.getIndex(e[l],i),this.navIdx.length){if(1!==r.length){for(var a=!1,d=0,h=r.length-1;d<h;d++)if(r[d]!==this.navIdx[d]){a=!0;break}if(a)continue}}else if(1!==r.length)continue;n=r.pop(),(s=this.getUlByNavIdx(r.length))&&!E.isNullOrUndefined(n)&&(t?this.isMenu?(s.children[n].classList.remove(o),s.children[n].removeAttribute("aria-disabled")):(E.Browser.isDevice&&!s.classList.contains("e-contextmenu")?s.children[n+1]:s.children[n]).classList.remove(o):this.isMenu?(s.children[n].classList.add(o),s.children[n].setAttribute("aria-disabled","true")):(E.Browser.isDevice&&!s.classList.contains("e-contextmenu")?s.children[n+1]:s.children[n]).classList.add(o))}},s.prototype.showItems=function(e,t){this.showHideItems(e,!1,t)},s.prototype.hideItems=function(e,t){this.showHideItems(e,!0,t)},s.prototype.showHideItems=function(e,t,i){for(var s=0;s<e.length;s++){var n=(o=this.getIndex(e[s],i)).pop(),r=this.getUlByNavIdx(o.length),o=this.getItems(o);r&&(o=i?r.children[n].id:o[n].text.toString(),t&&o===e[s]?r.children[n].classList.add(He):t||o!==e[s]||r.children[n].classList.remove(He))}},s.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),E.isNullOrUndefined(i)||this.removeItem(n,s,i)},s.prototype.insertAfter=function(e,t,i){this.insertItems(e,t,i)},s.prototype.insertBefore=function(e,t,i){this.insertItems(e,t,i,!1)},s.prototype.insertItems=function(e,t,i,s){var n;void 0===s&&(s=!0);for(var r=0;r<e.length;r++){o=(n=this.getIndex(t,i)).pop(),l=this.getItems(n),(a=new We(l[0],"items",e[r],!0)).parentObj=l[0].parentObj,l.splice(s?o+1:o,0,a);var o,l,a=this.isMenu?[this.getWrapper()].concat(this.getPopups()):[].slice.call(this.getWrapper().children);!E.isNullOrUndefined(o)&&n.length<a.length&&(o=s?o+1:o,l=this.createItems(l).children[o],(a=this.isMenu?E.select(".e-menu-parent",a[n.length]):a[n.length]).insertBefore(l,a.children[o]),r!==e.length-1||this.isMenu||"block"!==a.style.display||(this.setPosition(null,a,parseFloat(a.style.top),parseFloat(a.style.left)),a.style.display="block"))}},s.prototype.removeAttributes=function(){var t=this;["top","left","display","z-index"].forEach(function(e){t.element.style.removeProperty(e)}),["role","tabindex","class","style"].forEach(function(e){"class"===e&&t.element.classList.contains("e-menu-parent")&&t.element.classList.remove("e-menu-parent"),-1!==["class","style"].indexOf(e)&&t.element.getAttribute(e)||t.element.removeAttribute(e),t.isMenu&&"class"===e&&t.element.classList.contains("e-vertical")&&t.element.classList.remove("e-vertical")})},s.prototype.destroy=function(){var e,t=this.getWrapper();t&&(this.unWireEvents(),this.isMenu?(this.closeMenu(),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",this.removeAttributes(),t.parentNode.insertBefore(this.element,t)):(this.clonedElement.style.display="","EJS-CONTEXTMENU"===this.clonedElement.tagName?(E.addClass([this.clonedElement],["e-control","e-lib","e-"+this.getModuleName()]),this.element=this.clonedElement):(this.refreshing&&this.clonedElement.childElementCount&&"LI"===this.clonedElement.children[0].tagName&&this.setProperties({items:[]},!0),document.getElementById(this.clonedElement.id)&&((e=this.clonedElement.nextElementSibling)&&e!==t?this.clonedElement.parentElement.insertBefore(this.element,e):this.clonedElement.parentElement.appendChild(this.element),E.isBlazor()&&!this.isMenu?this.element=this.removeChildElement(this.element):this.element.innerHTML="",E.append([].slice.call(this.clonedElement.children),this.element),E.detach(this.clonedElement),this.removeAttributes()))),this.clonedElement=null,E.detach(t),Xe.prototype.destroy.call(this),this.template)&&this.clearTemplate(["template"]),this.rippleFn=null},e([E.Event()],s.prototype,"beforeItemRender",void 0),e([E.Event()],s.prototype,"beforeOpen",void 0),e([E.Event()],s.prototype,"onOpen",void 0),e([E.Event()],s.prototype,"beforeClose",void 0),e([E.Event()],s.prototype,"onClose",void 0),e([E.Event()],s.prototype,"select",void 0),e([E.Event()],s.prototype,"created",void 0),e([E.Property("")],s.prototype,"cssClass",void 0),e([E.Property(0)],s.prototype,"hoverDelay",void 0),e([E.Property(!1)],s.prototype,"showItemOnClick",void 0),e([E.Property("")],s.prototype,"target",void 0),e([E.Property("")],s.prototype,"filter",void 0),e([E.Property(null)],s.prototype,"template",void 0),e([E.Property(!1)],s.prototype,"enableScrolling",void 0),e([E.Property(!0)],s.prototype,"enableHtmlSanitizer",void 0),e([E.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],s.prototype,"fields",void 0),e([E.Collection([],We)],s.prototype,"items",void 0),e([E.Complex({duration:400,easing:"ease",effect:"SlideDown"},ze)],s.prototype,"animationSettings",void 0);var Xe,F=e([E.NotifyPropertyChanges],s);function s(e,t){e=Xe.call(this,e,t)||this;return e.navIdx=[],e.animation=new E.Animation({}),e.isTapHold=!1,e.tempItem=[],e.showSubMenuOn="Auto",e.isAnimationNone=!1,e}Ye=function(e,t){return(Ye=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ye,Ge,e=function(e,t){function i(){this.constructor=e}Ye(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Qe="e-vertical",m="e-toolbar-items",b="e-toolbar-item",Je="e-rtl",C="e-separator",Ze="e-popup-up-icon",$e="e-popup-down-icon",et="e-popup-open",tt="e-template",it="e-overlay",st="e-toolbar-text",nt="e-popup-text",rt="e-overflow-show",ot="e-overflow-hide",lt="e-hor-nav",at="e-scroll-nav",dt="e-toolbar-center",ht="e-tbar-pos",ct="e-hscroll-bar",pt="e-toolbar-pop",ut="e-toolbar-popup",mt="e-nav-active",ft="e-ignore",gt="e-popup-alone",vt="e-hidden",yt="e-toolbar-multirow",bt="e-multirow-pos",Ct="e-multirow-separator",St="e-extended-separator",It="e-extended-toolbar",Et="e-toolbar-extended",xt="e-tbar-extended",Nt=(Ge=E.ChildProperty,e(Ot,Ge),n([E.Property("")],Ot.prototype,"id",void 0),n([E.Property("")],Ot.prototype,"text",void 0),n([E.Property("auto")],Ot.prototype,"width",void 0),n([E.Property("")],Ot.prototype,"cssClass",void 0),n([E.Property(!1)],Ot.prototype,"showAlwaysInPopup",void 0),n([E.Property(!1)],Ot.prototype,"disabled",void 0),n([E.Property("")],Ot.prototype,"prefixIcon",void 0),n([E.Property("")],Ot.prototype,"suffixIcon",void 0),n([E.Property(!0)],Ot.prototype,"visible",void 0),n([E.Property("None")],Ot.prototype,"overflow",void 0),n([E.Property("")],Ot.prototype,"template",void 0),n([E.Property("Button")],Ot.prototype,"type",void 0),n([E.Property("Both")],Ot.prototype,"showTextOn",void 0),n([E.Property(null)],Ot.prototype,"htmlAttributes",void 0),n([E.Property("")],Ot.prototype,"tooltipText",void 0),n([E.Property("Left")],Ot.prototype,"align",void 0),n([E.Event()],Ot.prototype,"click",void 0),n([E.Property(-1)],Ot.prototype,"tabIndex",void 0),Ot);function Ot(){return null!==Ge&&Ge.apply(this,arguments)||this}wt=E.Component,e(r,wt),r.prototype.destroy=function(){var t=this,e=((this.isReact||this.isAngular)&&this.clearTemplate(),this.element.querySelectorAll(".e-control.e-btn"));for([].slice.call(e).forEach(function(e){E.isNullOrUndefined(e)||E.isNullOrUndefined(e.ej2_instances)||E.isNullOrUndefined(e.ej2_instances[0])||e.ej2_instances[0].isDestroyed||e.ej2_instances[0].destroy()}),this.unwireEvents(),this.tempId.forEach(function(e){E.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")}),this.destroyItems();this.element.lastElementChild;)this.element.removeChild(this.element.lastElementChild);this.trgtEle&&(this.element.appendChild(this.ctrlTem),this.trgtEle=null,this.ctrlTem=null),this.popObj&&(this.popObj.destroy(),E.detach(this.popObj.element)),this.activeEle&&(this.activeEle=null),this.popObj=null,this.tbarAlign=null,this.tbarItemsCol=[],this.remove(this.element,"e-toolpop"),this.cssClass&&E.removeClass([this.element],this.cssClass.split(" ")),this.element.removeAttribute("style"),["aria-disabled","aria-orientation","role"].forEach(function(e){return t.element.removeAttribute(e)}),wt.prototype.destroy.call(this)},r.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(Qe),this.isExtendedOpen=!1,this.popupPriCount=0,this.enableRtl&&this.add(this.element,Je)},r.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resizeContext),window.addEventListener("orientationchange",this.orientationChangeContext),this.allowKeyboard&&this.wireKeyboardEvent()},r.prototype.wireKeyboardEvent=function(){this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs}),E.EventHandler.add(this.element,"keydown",this.docKeyDown,this),this.updateTabIndex("0")},r.prototype.updateTabIndex=function(e){var t,i=this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )");E.isNullOrUndefined(i)||E.isNullOrUndefined(i.firstElementChild)||(t=i.firstElementChild.getAttribute("data-tabindex"))&&"-1"===t&&"INPUT"!==i.firstElementChild.tagName&&i.firstElementChild.setAttribute("tabindex",e)},r.prototype.unwireKeyboardEvent=function(){this.keyModule&&(E.EventHandler.remove(this.element,"keydown",this.docKeyDown),this.keyModule.destroy(),this.keyModule=null)},r.prototype.docKeyDown=function(e){var t;"INPUT"!==e.target.tagName&&(t=!E.isNullOrUndefined(this.popObj)&&E.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode,9===e.keyCode&&!0===e.target.classList.contains("e-hor-nav")&&t&&this.popObj.hide({name:"FadeOut",duration:100}),40!==e.keyCode&&38!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||e.preventDefault())},r.prototype.unwireEvents=function(){E.EventHandler.remove(this.element,"click",this.clickHandler),this.destroyScroll(),this.unwireKeyboardEvent(),window.removeEventListener("resize",this.resizeContext),window.removeEventListener("orientationchange",this.orientationChangeContext),document.removeEventListener("scroll",this.clickEvent),document.removeEventListener("click",this.scrollEvent),this.scrollEvent=null,this.clickEvent=null},r.prototype.clearProperty=function(){this.tbarEle=[],this.tbarAlgEle={lefts:[],centers:[],rights:[]}},r.prototype.docEvent=function(e){e=E.closest(e.target,".e-popup");this.popObj&&E.isVisible(this.popObj.element)&&!e&&"Popup"===this.overflowMode&&this.popObj.hide({name:"FadeOut",duration:100})},r.prototype.destroyScroll=function(){this.scrollModule&&(this.tbarAlign&&this.add(this.scrollModule.element,ht),this.scrollModule.destroy(),this.scrollModule=null)},r.prototype.destroyItems=function(){var e;this.element&&[].slice.call(this.element.querySelectorAll("."+b)).forEach(function(e){E.detach(e)}),this.tbarAlign&&(e=this.element.querySelector("."+m),[].slice.call(e.children).forEach(function(e){E.detach(e)}),this.tbarAlign=!1,this.remove(e,ht)),this.clearProperty()},r.prototype.destroyMode=function(){this.scrollModule&&(this.remove(this.scrollModule.element,Je),this.destroyScroll()),this.remove(this.element,xt),this.remove(this.element,It);var e=this.element.querySelector(".e-toolbar-multirow");e&&this.remove(e,yt),this.popObj&&this.popupRefresh(this.popObj.element,!0)},r.prototype.add=function(e,t){e.classList.add(t)},r.prototype.remove=function(e,t){e.classList.remove(t)},r.prototype.elementFocus=function(e){var t=e.firstElementChild;t?(t.focus(),this.activeEleSwitch(e)):e.focus()},r.prototype.clstElement=function(e,t){e=e&&this.popObj&&E.isVisible(this.popObj.element)?this.popObj.element.querySelector("."+b):this.element===t||e?this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )"):E.closest(t,"."+b);return e},r.prototype.keyHandling=function(e,t,i,s,n){var r,o,l,a,d=this.popObj,h=this.element,c={name:"FadeOut",duration:100},p="moveUp"===t.action?"previous":"next";switch(t.action){case"moveRight":this.isVertical||(h===i?this.elementFocus(e):s||this.eleFocus(e,"next"));break;case"moveLeft":this.isVertical||s||this.eleFocus(e,"previous");break;case"home":case"end":e&&(l=E.closest(e,".e-popup"),o=this.element.querySelector("."+Et),(l="Extended"===this.overflowMode&&o&&o.classList.contains("e-popup-open")?"end"===t.action?o:null:l)?E.isVisible(this.popObj.element)&&(a=[].slice.call(l.children),r="home"===t.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)):(a=this.element.querySelectorAll("."+m+" ."+b+":not(."+C+")"),r="home"===t.action?this.focusFirstVisibleEle(a):this.focusLastVisibleEle(a)),r)&&this.elementFocus(r);break;case"moveUp":case"moveDown":this.isVertical?"moveUp"===t.action?this.eleFocus(e,"previous"):this.eleFocus(e,"next"):d&&E.closest(i,".e-popup")?(l=(o=d.element).firstElementChild,"previous"==p&&l===e?o.lastElementChild.firstChild.focus():"next"==p&&o.lastElementChild===e?l.firstChild.focus():this.eleFocus(e,p)):"moveDown"===t.action&&d&&E.isVisible(d.element)&&this.elementFocus(e);break;case"tab":n||s||(a=e.firstElementChild,h===i&&(this.activeEle||(this.activeEleRemove(a),a)).focus());break;case"popupClose":d&&"Extended"!==this.overflowMode&&d.hide(c);break;case"popupOpen":s&&(d&&!E.isVisible(d.element)?(d.element.style.top=h.offsetHeight+"px",d.show({name:"FadeIn",duration:100})):d.hide(c))}},r.prototype.keyActionHandler=function(e){var t,i,s,n=e.target;"INPUT"!==n.tagName&&"TEXTAREA"!==n.tagName&&!this.element.classList.contains(it)&&(e.preventDefault(),t=n.classList.contains(lt),i=n.classList.contains(at),(s=this.clstElement(t,n))||i)&&this.keyHandling(s,e,n,t,i)},r.prototype.disable=function(e){var t=this.element;e?t.classList.add(it):t.classList.remove(it),this.activeEle&&this.activeEle.setAttribute("tabindex",this.activeEle.getAttribute("data-tabindex")),this.scrollModule&&this.scrollModule.disable(e),this.popObj&&(E.isVisible(this.popObj.element)&&"Extended"!==this.overflowMode&&this.popObj.hide(),t.querySelector("#"+t.id+"_nav").setAttribute("tabindex",e?"-1":"0"))},r.prototype.eleContains=function(e){return e.classList.contains(C)||e.classList.contains(it)||e.getAttribute("disabled")||e.classList.contains(vt)||!E.isVisible(e)||!e.classList.contains(b)},r.prototype.focusFirstVisibleEle=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(vt)&&!i.classList.contains(it))return i;t++}},r.prototype.focusLastVisibleEle=function(e){for(var t=e.length-1;0<=t;){var i=e[parseInt(t.toString(),10)];if(!i.classList.contains(vt)&&!i.classList.contains(it))return i;t--}},r.prototype.eleFocus=function(e,t){var i,s=Object(e)[t+"ElementSibling"];s?this.eleContains(s)?this.eleFocus(s,t):this.elementFocus(s):this.tbarAlign?(s=Object(e.parentElement)[t+"ElementSibling"],E.isNullOrUndefined(s)||0!==s.children.length||(s=Object(s)[t+"ElementSibling"]),!E.isNullOrUndefined(s)&&0<s.children.length&&("next"===t?(i=s.querySelector("."+b),this.eleContains(i)?this.eleFocus(i,t):(i.firstElementChild.focus(),this.activeEleSwitch(i))):(i=s.lastElementChild,this.eleContains(i)?this.eleFocus(i,t):this.elementFocus(i)))):E.isNullOrUndefined(e)||(s=this.element.querySelectorAll("."+m+" ."+b+":not(."+C+"):not(."+it+"):not(."+vt+")"),"next"===t&&s?this.elementFocus(s[0]):"previous"===t&&s&&this.elementFocus(s[s.length-1]))},r.prototype.clickHandler=function(e){var t,i=this,s=e.target,n=this.element,r=!E.isNullOrUndefined(E.closest(s,"."+pt)),o=s.classList,l=(l=E.closest(s,"."+lt))||s,s=(((o=n.children[0].classList.contains("e-hscroll")||n.children[0].classList.contains("e-vscroll")||!o.contains(lt)?o:s.querySelector(".e-icons").classList).contains(Ze)||o.contains($e))&&this.popupClickHandler(n,l,Je),E.closest(e.target,"."+b));(E.isNullOrUndefined(s)||s.classList.contains(it))&&!l.classList.contains(lt)||(o={originalEvent:e,item:t=s?this.items[this.tbarEle.indexOf(s)]:t},(t&&!E.isNullOrUndefined(t.click)&&"object"==typeof t.click?!E.isNullOrUndefined(t.click.observers)&&0<t.click.observers.length:!E.isNullOrUndefined(t)&&!E.isNullOrUndefined(t.click))&&this.trigger("items["+this.tbarEle.indexOf(s)+"].click",o),o.cancel)||this.trigger("clicked",o,function(e){!E.isNullOrUndefined(i.popObj)&&r&&!e.cancel&&"Popup"===i.overflowMode&&e.item&&"Input"!==e.item.type&&i.popObj.hide({name:"FadeOut",duration:100})})},r.prototype.popupClickHandler=function(e,t,i){var s=this.popObj;E.isVisible(s.element)?(t.classList.remove(mt),s.hide({name:"FadeOut",duration:100})):(e.classList.contains(i)&&(s.enableRtl=!0,s.position={X:"left",Y:"top"}),0!==s.offsetX||e.classList.contains(i)||(s.enableRtl=!1,s.position={X:"right",Y:"top"}),"Extended"===this.overflowMode&&(s.element.style.minHeight="0px",s.width=this.getToolbarPopupWidth(this.element)),s.dataBind(),s.refreshPosition(),s.element.style.top=this.getElementOffsetY()+"px",t.classList.add(mt),s.show({name:"FadeIn",duration:100}))},r.prototype.getToolbarPopupWidth=function(e){e=window.getComputedStyle(e);return parseFloat(e.width)+2*parseFloat(e.borderRightWidth)},r.prototype.render=function(){var e=this;this.initialize(),this.renderControl(),this.wireEvents(),this.clickEvent=this.docEvent.bind(this),this.scrollEvent=this.docEvent.bind(this),this.renderComplete(),this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow()})},r.prototype.initialize=function(){var e=E.formatUnit(this.width),t=E.formatUnit(this.height),t=("msie"===E.Browser.info.name&&"auto"===this.height&&"MultiRow"!==this.overflowMode||E.setStyleAttribute(this.element,{height:t}),E.setStyleAttribute(this.element,{width:e}),{role:"toolbar","aria-disabled":"false","aria-orientation":this.isVertical?"vertical":"horizontal"});E.attributes(this.element,t),this.cssClass&&E.addClass([this.element],this.cssClass.split(" "))},r.prototype.renderControl=function(){var e=this.element;this.trgtEle=0<e.children.length?e.querySelector("div"):null,this.tbarAlgEle={lefts:[],centers:[],rights:[]},this.renderItems(),this.renderLayout()},r.prototype.renderLayout=function(){this.renderOverflowMode(),this.tbarAlign&&this.itemPositioning(),this.popObj&&1<this.popObj.element.childElementCount&&this.checkPopupRefresh(this.element,this.popObj.element)&&this.popupRefresh(this.popObj.element,!1),this.separator()},r.prototype.itemsAlign=function(e,t){var i,s;this.tbarEle||(this.tbarEle=[]);for(var n=0;n<e.length;n++)i=this.renderSubComponent(e[parseInt(n.toString(),10)],n),-1===this.tbarEle.indexOf(i)&&this.tbarEle.push(i),this.tbarAlign||this.tbarItemAlign(e[parseInt(n.toString(),10)],t,n),((s=t.querySelector(".e-toolbar-"+e[parseInt(n.toString(),10)].align.toLowerCase()))?(e[parseInt(n.toString(),10)].showAlwaysInPopup&&"Show"!==e[parseInt(n.toString(),10)].overflow||this.tbarAlgEle[(e[parseInt(n.toString(),10)].align+"s").toLowerCase()].push(i),s):t).appendChild(i);this.isReact&&(this.notify("render-react-toolbar-template",this.portals),this.renderReactTemplates())},r.prototype.changeOrientation=function(){var e=this.element;this.isVertical?(e.classList.remove(Qe),this.isVertical=!1,"auto"!==this.height&&"100%"!==this.height||(e.style.height=this.height),e.setAttribute("aria-orientation","horizontal")):(e.classList.add(Qe),this.isVertical=!0,e.setAttribute("aria-orientation","vertical"),E.setStyleAttribute(this.element,{height:E.formatUnit(this.height),width:E.formatUnit(this.width)})),this.destroyMode(),this.refreshOverflow()},r.prototype.initScroll=function(e,t){!this.scrollModule&&this.checkOverflow(e,t[0])&&(this.tbarAlign&&this.element.querySelector("."+m+" ."+dt).removeAttribute("style"),this.isVertical?this.scrollModule=new fe({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]):this.scrollModule=new ee({scrollStep:this.scrollStep,enableRtl:this.enableRtl},t[0]),this.cssClass&&E.addClass([t[0]],this.cssClass.split(" ")),(e=this.scrollModule.element.querySelector("."+ct+", .e-vscroll-bar"))&&e.removeAttribute("tabindex"),this.remove(this.scrollModule.element,ht),E.setStyleAttribute(this.element,{overflow:"hidden"}))},r.prototype.itemWidthCal=function(e){var t,i=this,s=0;return[].slice.call(E.selectAll("."+b,e)).forEach(function(e){E.isVisible(e)&&(t=window.getComputedStyle(e),s=(s=(s+=i.isVertical?e.offsetHeight:e.offsetWidth)+parseFloat(i.isVertical?t.marginTop:t.marginRight))+parseFloat(i.isVertical?t.marginBottom:t.marginLeft))}),s},r.prototype.getScrollCntEle=function(e){var t=this.isVertical?".e-vscroll-content":".e-hscroll-content";return e.querySelector(t)},r.prototype.checkOverflow=function(e,t){var i,s,n;return!(E.isNullOrUndefined(e)||E.isNullOrUndefined(t)||!E.isVisible(e))&&(i=this.isVertical?e.offsetHeight:e.offsetWidth,s=this.isVertical?t.offsetHeight:t.offsetWidth,(this.tbarAlign||this.scrollModule||i===s)&&(s=this.itemWidthCal(this.scrollModule?this.getScrollCntEle(t):t)),t=e.querySelector("."+lt),e=e.querySelector("."+at),n=0,t?n=this.isVertical?t.offsetHeight:t.offsetWidth:e&&(n=this.isVertical?2*e.offsetHeight:2*e.offsetWidth),i-n<s)},r.prototype.refreshOverflow=function(){this.resize()},r.prototype.toolbarAlign=function(e){this.tbarAlign&&(this.add(e,ht),this.itemPositioning())},r.prototype.renderOverflowMode=function(){var e=this.element,t=e.querySelector("."+m),i=0<this.popupPriCount;if(e&&0<e.children.length)switch(this.offsetWid=e.offsetWidth,this.remove(this.element,"e-toolpop"),"msie"===E.Browser.info.name&&"auto"===this.height&&(e.style.height=""),this.overflowMode){case"Scrollable":E.isNullOrUndefined(this.scrollModule)&&this.initScroll(e,[].slice.call(e.getElementsByClassName(m)));break;case"Popup":this.add(this.element,"e-toolpop"),this.tbarAlign&&this.removePositioning(),(this.checkOverflow(e,t)||i)&&this.setOverflowAttributes(e),this.toolbarAlign(t);break;case"MultiRow":this.add(t,yt),this.checkOverflow(e,t)&&this.tbarAlign&&(this.removePositioning(),this.add(t,bt)),"hidden"===e.style.overflow&&(e.style.overflow=""),"msie"!==E.Browser.info.name&&"auto"===e.style.height||(e.style.height="auto");break;case"Extended":this.add(this.element,It),(this.checkOverflow(e,t)||i)&&(this.tbarAlign&&this.removePositioning(),this.setOverflowAttributes(e)),this.toolbarAlign(t)}},r.prototype.setOverflowAttributes=function(e){this.createPopupEle(e,[].slice.call(E.selectAll("."+m+" ."+b,e)));E.attributes(this.element.querySelector("."+lt),{tabindex:"0",role:"button","aria-haspopup":"true","aria-label":"overflow"})},r.prototype.separator=function(){var e=this.element,t=[].slice.call(e.querySelectorAll("."+C)),i=e.querySelector("."+Ct),e=e.querySelector("."+St),i="MultiRow"===this.overflowMode?i:e;null!==i&&("MultiRow"===this.overflowMode?i.classList.remove(Ct):"Extended"===this.overflowMode&&i.classList.remove(St));for(var s=0;s<=t.length-1;s++)t[parseInt(s.toString(),10)].offsetLeft<30&&0!==t[parseInt(s.toString(),10)].offsetLeft&&("MultiRow"===this.overflowMode?t[parseInt(s.toString(),10)].classList.add(Ct):"Extended"===this.overflowMode&&t[parseInt(s.toString(),10)].classList.add(St))},r.prototype.createPopupEle=function(e,t){var i=e.querySelector("."+lt),s=this.isVertical,i=(i||this.createPopupIcon(e),i=e.querySelector("."+lt),s?i.offsetHeight:i.offsetWidth),s=(s?e.offsetHeight:e.offsetWidth)-i;this.element.classList.remove("e-rtl"),E.setStyleAttribute(this.element,{direction:"initial"}),this.checkPriority(e,t,s,!0),this.enableRtl&&this.element.classList.add("e-rtl"),this.element.style.removeProperty("direction"),this.createPopup()},r.prototype.pushingPoppedEle=function(i,s,n,r,o){for(var l,e=i.element,t=[].slice.call(E.selectAll("."+ut,e.querySelector("."+m))),a=(E.selectAll("."+rt,n),0),d=0,h=(t.forEach(function(e,t){l=E.selectAll("."+rt,n),e.classList.contains(rt)&&0<l.length?(i.tbResize&&l.length>t?n.insertBefore(e,l[parseInt(t.toString(),10)]):n.insertBefore(e,n.children[l.length]),++d):e.classList.contains(rt)||i.tbResize&&e.classList.contains(ot)&&0<n.children.length&&0===l.length?(n.insertBefore(e,n.firstChild),++d):e.classList.contains(ot)?s.push(e):i.tbResize?(n.insertBefore(e,n.childNodes[a+d]),++a):n.appendChild(e),e.classList.contains(C)?E.setStyleAttribute(e,{display:"",height:o+"px"}):E.setStyleAttribute(e,{display:"",height:r+"px"})}),s.forEach(function(e){n.appendChild(e)}),E.selectAll("."+b,e.querySelector("."+m))),c=h.length-1;0<=c;c--){var p=h[parseInt(c.toString(),10)];if(!p.classList.contains(C)||"Extended"===this.overflowMode)break;E.setStyleAttribute(p,{display:"none"})}},r.prototype.createPopup=function(){var e,t,i,s=this.element,n=("Extended"===this.overflowMode&&(e=s.querySelector("."+C),e="auto"===s.style.height||""===s.style.height?null:e&&e.offsetHeight),s.querySelector("."+b+":not(."+C+"):not(."+ut+")")),n="auto"===s.style.height||""===s.style.height?null:n&&n.offsetHeight;i=E.select("#"+s.id+"_popup."+pt,s)?E.select("#"+s.id+"_popup."+pt,s):(i=this.createElement("div",{id:s.id+"_popup",className:pt+" "+Et}),t=this.createElement("div",{id:s.id+"_popup",className:pt}),"Extended"===this.overflowMode?i:t),this.pushingPoppedEle(this,[],i,n,e),this.popupInit(s,i)},r.prototype.getElementOffsetY=function(){return"Extended"===this.overflowMode&&"border-box"===window.getComputedStyle(this.element).getPropertyValue("box-sizing")?this.element.clientHeight:this.element.offsetHeight},r.prototype.popupInit=function(e,t){var i;this.popObj?"Extended"!==this.overflowMode&&(i=this.popObj.element,E.setStyleAttribute(i,{maxHeight:"",display:"block"}),E.setStyleAttribute(i,{maxHeight:i.offsetHeight+"px",display:""})):(e.appendChild(t),this.cssClass&&E.addClass([t],this.cssClass.split(" ")),E.setStyleAttribute(this.element,{overflow:""}),i=new g.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"}}),"Extended"===this.overflowMode&&(i.width=this.getToolbarPopupWidth(this.element),i.offsetX=0),i.appendTo(t),document.addEventListener("scroll",this.clickEvent),document.addEventListener("click",this.scrollEvent),"Extended"!==this.overflowMode&&(i.element.style.maxHeight=i.element.offsetHeight+"px"),this.isVertical&&(i.element.style.visibility="hidden"),this.isExtendedOpen?((e=this.element.querySelector("."+lt)).classList.add(mt),E.classList(e.firstElementChild,[Ze],[$e]),this.element.querySelector("."+Et).classList.add(et)):i.hide(),this.popObj=i)},r.prototype.tbarPopupHandler=function(e){"Extended"===this.overflowMode&&(e?this.add(this.element,xt):this.remove(this.element,xt))},r.prototype.popupOpen=function(e){var t=this.popObj,i=(this.isVertical||(t.offsetY=this.getElementOffsetY(),t.dataBind()),this.popObj.element),s=this.popObj.element.parentElement,n=s.querySelector("."+lt),r=(n.setAttribute("aria-expanded","true"),"Extended"===this.overflowMode?t.element.style.minHeight="":(E.setStyleAttribute(t.element,{height:"auto",maxHeight:""}),t.element.style.maxHeight=t.element.offsetHeight+"px"),i.offsetTop+i.offsetHeight+g.calculatePosition(s).top),o=n.firstElementChild,n=(n.classList.add(mt),E.classList(o,[Ze],[$e]),this.tbarPopupHandler(!0),E.isNullOrUndefined(window.scrollY)?0:window.scrollY);if(!this.isVertical&&window.innerHeight+n<r&&this.element.offsetTop<i.offsetHeight){var l=i.offsetHeight-(r-window.innerHeight-n+5);t.height=l+"px";for(var a=0;a<=i.childElementCount;a++){var d=i.children[parseInt(a.toString(),10)];if(d.offsetTop+d.offsetHeight>l){l=d.offsetTop;break}}"Extended"!==this.overflowMode&&E.setStyleAttribute(t.element,{maxHeight:l+"px"})}else this.isVertical&&"Extended"!==this.overflowMode&&(o=this.element.getBoundingClientRect(),E.setStyleAttribute(t.element,{maxHeight:o.top+this.element.offsetHeight+"px",bottom:0,visibility:""}));t&&((r=i.getBoundingClientRect()).right>document.documentElement.clientWidth&&r.width>s.getBoundingClientRect().width&&(t.collision={Y:"none"},t.dataBind()),t.refreshPosition())},r.prototype.popupClose=function(e){var t=this.element.querySelector("."+lt),i=(t.setAttribute("aria-expanded","false"),t.firstElementChild);t.classList.remove(mt),E.classList(i,[$e],[Ze]),this.tbarPopupHandler(!1)},r.prototype.checkPriority=function(e,t,i,s){for(var n,r,o=0<this.popupPriCount,l=i,a=0,d=0,h=0,c=function(t,e){var i=!1;return e.forEach(function(e){t.classList.contains(e)&&(i=!0)}),i},p=t.length-1;0<=p;p--){var u,m=void 0,f=window.getComputedStyle(t[parseInt(p.toString(),10)]),f=(this.isVertical?(m=parseFloat(f.marginTop),m+=parseFloat(f.marginBottom)):(m=parseFloat(f.marginRight),m+=parseFloat(f.marginLeft)),t[parseInt(p.toString(),10)]===this.tbarEle[0]),f=(f&&(this.tbarEleMrgn=m),n=this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth,f?n+m:n);c(t[parseInt(p.toString(),10)],[gt])&&o&&(t[parseInt(p.toString(),10)].classList.add(ut),this.isVertical?E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++),(this.isVertical?t[parseInt(p.toString(),10)].offsetTop+t[parseInt(p.toString(),10)].offsetHeight+m>i:t[parseInt(p.toString(),10)].offsetLeft+t[parseInt(p.toString(),10)].offsetWidth+m>i)&&(t[parseInt(p.toString(),10)].classList.contains(C)?"Extended"===this.overflowMode?(c(u=t[parseInt(p.toString(),10)],[C,ft])&&(t[parseInt(p.toString(),10)].classList.add(ut),h++),d++):"Popup"===this.overflowMode&&(0<a&&d===h&&c(u=t[p+d+(a-1)],[C,ft])&&E.setStyleAttribute(u,{display:"none"}),a++,h=d=0):d++,t[parseInt(p.toString(),10)].classList.contains(rt)&&s||c(t[parseInt(p.toString(),10)],[C,ft])?i-=(this.isVertical?t[parseInt(p.toString(),10)].offsetHeight:t[parseInt(p.toString(),10)].offsetWidth)+m:(t[parseInt(p.toString(),10)].classList.add(ut),this.isVertical?E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minHeight:f+"px"}):E.setStyleAttribute(t[parseInt(p.toString(),10)],{display:"none",minWidth:f+"px"}),h++))}s&&(r=E.selectAll("."+b+":not(."+ut+")",this.element),this.checkPriority(e,r,l,!1))},r.prototype.createPopupIcon=function(e){var t=e.id.concat("_nav"),i="e-"+e.id.concat("_nav e-hor-nav"),i="Extended"===this.overflowMode?i+" e-expended-nav":i,t=this.createElement("div",{id:t,className:i}),i=("msie"!==E.Browser.info.name&&"edge"!==E.Browser.info.name||t.classList.add("e-ie-align"),this.createElement("div",{className:$e+" e-icons"}));t.appendChild(i),t.setAttribute("tabindex","0"),t.setAttribute("role","button"),e.appendChild(t)},r.prototype.tbarPriRef=function(e,t,i,s,n,r,o,l,a){function d(e,t){return e.classList.contains(t)}var h,c,p,u=this.popObj.element,u=E.selectAll("."+ut+":not(."+rt+")",u).length;0===E.selectAll(".e-toolbar-item:not(.e-separator):not(.e-overflow-show)",e).length?(h=e.children[t-(t-i)-1],c=!E.isNullOrUndefined(h)&&d(h,ft),!E.isNullOrUndefined(h)&&d(h,C)&&!E.isVisible(h)||c?(h.style.display="unset",c=h.offsetWidth+2*parseFloat(window.getComputedStyle(h).marginRight),p=h.previousElementSibling,r+c<o||n?(e.insertBefore(s,e.children[t+l-(t-i)]),E.isNullOrUndefined(p)||(p.style.display="")):(E.setStyleAttribute(s,a),p.classList.contains(C)&&(p.style.display="none")),h.style.display=""):e.insertBefore(s,e.children[t+l-(t-i)])):e.insertBefore(s,e.children[t+l-u])},r.prototype.popupRefresh=function(e,t){var i,s=this,n=this.element,r=this.isVertical,o=n.querySelector("."+m),l=n.querySelector("."+lt);E.isNullOrUndefined(l)||(o.removeAttribute("style"),e.style.display="block",n=r?n.offsetHeight-(l.offsetHeight+o.offsetHeight):n.offsetWidth-(l.offsetWidth+o.offsetWidth),i=0,[].slice.call(e.children).forEach(function(e){i+=s.popupEleWidth(e),E.setStyleAttribute(e,{position:""})}),n+(r?l.offsetHeight:l.offsetWidth)>i&&0===this.popupPriCount&&(t=!0),this.popupEleRefresh(n,e,t),e.style.display="",0===e.children.length&&l&&this.popObj&&(E.detach(l),this.popObj.destroy(),E.detach(this.popObj.element),this.popObj=null))},r.prototype.ignoreEleFetch=function(t,i){var e=[].slice.call(i.querySelectorAll("."+ft)),s=[],n=0;return 0<e.length?(e.forEach(function(e){s.push([].slice.call(i.children).indexOf(e))}),s.forEach(function(e){e<=t&&n++}),n):0},r.prototype.checkPopupRefresh=function(e,t){t.style.display="block";var i=this.popupEleWidth(t.firstElementChild),s=(t.firstElementChild.style.removeProperty("Position"),e.offsetWidth-e.querySelector("."+lt).offsetWidth),e=e.querySelector("."+m).offsetWidth;return t.style.removeProperty("display"),i+e<s},r.prototype.popupEleWidth=function(e){e.style.position="absolute";var t,i=this.isVertical?e.offsetHeight:e.offsetWidth,s=e.querySelector(".e-tbar-btn-text");return(e.classList.contains("e-tbtn-align")||e.classList.contains(nt))&&(t=e.children[0],!E.isNullOrUndefined(s)&&e.classList.contains(nt)?s.style.display="none":!E.isNullOrUndefined(s)&&e.classList.contains(st)&&(s.style.display="block"),t.style.minWidth="0%",i=parseFloat(this.isVertical?e.style.minHeight:e.style.minWidth),t.style.minWidth="",t.style.minHeight="",E.isNullOrUndefined(s)||(s.style.display="")),i},r.prototype.popupEleRefresh=function(r,e,o){for(var l,a,d=0<this.popupPriCount,h=this.tbarEle,c=this.element.querySelector("."+m),p=0,u=this,t=0,i=[].slice.call(e.children);t<i.length&&"break"!==function(e){var t,i,s,n;return e.classList.contains(gt)&&d&&!o?"continue":(t=u.popupEleWidth(e),e===u.tbarEle[0]&&(t+=u.tbarEleMrgn),e.style.position="",t<r||o?(i={minWidth:e.style.minWidth,height:e.style.height,minHeight:e.style.minHeight},E.setStyleAttribute(e,{minWidth:"",height:"",minHeight:""}),e.classList.contains(ot)||e.classList.remove(ut),a=u.tbarEle.indexOf(e),u.tbarAlign&&(s=u.items[parseInt(a.toString(),10)].align,a=u.tbarAlgEle[(s+"s").toLowerCase()].indexOf(e),h=u.tbarAlgEle[(s+"s").toLowerCase()],c=u.element.querySelector("."+m+" .e-toolbar-"+s.toLowerCase())),n=0,"Extended"!==u.overflowMode&&h.slice(0,a).forEach(function(e){(e.classList.contains(rt)||e.classList.contains(C))&&(e.classList.contains(C)&&(e.style.display="",r-=e.offsetWidth),n++)}),p=u.ignoreEleFetch(a,c),e.classList.contains(rt)?u.tbarPriRef(c,a,n,e,o,t,r,p,i):0===a?c.insertBefore(e,c.firstChild):(l=E.selectAll("."+rt,u.popObj.element).length,c.insertBefore(e,c.children[a+p-l])),r-=e.offsetWidth,void(e.style.height="")):"break")}(i[t]);t++);this.checkOverflow(this.element,this.element.getElementsByClassName(m)[0])&&!o&&this.renderOverflowMode()},r.prototype.removePositioning=function(){var e=this.element.querySelector("."+m);!E.isNullOrUndefined(e)&&e.classList.contains(ht)&&(this.remove(e,ht),(e=[].slice.call(e.childNodes))[1].removeAttribute("style"),e[2].removeAttribute("style"))},r.prototype.refreshPositioning=function(){var e=this.element.querySelector("."+m);this.add(e,ht),this.itemPositioning()},r.prototype.itemPositioning=function(){var e,t,i,s=this.element.querySelector("."+m);E.isNullOrUndefined(s)||!s.classList.contains(ht)||(t=this.element.querySelector("."+lt),e=this.scrollModule?(e=this.isVertical?"e-vscroll-content":"e-hscroll-content",[].slice.call(s.querySelector("."+e).children)):[].slice.call(s.childNodes),s=this.isVertical?e[0].offsetHeight+e[2].offsetHeight:e[0].offsetWidth+e[2].offsetWidth,i=this.isVertical?this.element.offsetHeight:this.element.offsetWidth,t&&(i-=this.isVertical?t.offsetHeight:t.offsetWidth,t=(this.isVertical?t.offsetHeight:t.offsetWidth)+"px",e[2].removeAttribute("style"),this.isVertical?this.enableRtl?e[2].style.top=t:e[2].style.bottom=t:this.enableRtl?e[2].style.left=t:e[2].style.right=t),i<=s)||(t=(i-s-(this.isVertical?e[1].offsetHeight:e[1].offsetWidth))/2,e[1].removeAttribute("style"),i=(this.isVertical?e[0].offsetHeight:e[0].offsetWidth)+t+"px",this.isVertical?this.enableRtl?e[1].style.marginBottom=i:e[1].style.marginTop=i:this.enableRtl?e[1].style.marginRight=i:e[1].style.marginLeft=i)},r.prototype.tbarItemAlign=function(e,t,i){var s,n,r=this;e.showAlwaysInPopup&&"Show"!==e.overflow||((s=[]).push(this.createElement("div",{className:"e-toolbar-left",attrs:{role:"group"}})),s.push(this.createElement("div",{className:dt,attrs:{role:"group"}})),s.push(this.createElement("div",{className:"e-toolbar-right",attrs:{role:"group"}})),0===i&&"Left"!==e.align?(s.forEach(function(e){t.appendChild(e)}),this.tbarAlign=!0,this.add(t,ht)):"Left"!==e.align&&(i=t.childNodes,n=s[0],[].slice.call(i).forEach(function(e){r.tbarAlgEle.lefts.push(e),n.appendChild(e)}),t.appendChild(n),t.appendChild(s[1]),t.appendChild(s[2]),this.tbarAlign=!0,this.add(t,ht)))},r.prototype.ctrlTemplate=function(){var t=this;this.ctrlTem=this.trgtEle.cloneNode(!0),this.add(this.trgtEle,m),this.tbarEle=[],[].slice.call(this.trgtEle.children).forEach(function(e){"DIV"===e.tagName&&(t.tbarEle.push(e),E.isNullOrUndefined(e.firstElementChild)||e.firstElementChild.setAttribute("aria-disabled","false"),t.add(e,b))})},r.prototype.renderItems=function(){var e,t=this.element,i=this.items;null!=this.trgtEle?this.ctrlTemplate():t&&0<i.length&&(e=void 0,e=(e=t&&0<t.children.length?t.querySelector("."+m):e)||this.createElement("div",{className:m}),this.itemsAlign(i,e),t.appendChild(e))},r.prototype.setAttr=function(e,t){for(var i,s=Object.keys(e),n=0;n<s.length;n++)"class"===(i=s[parseInt(n.toString(),10)])?this.add(t,e[""+i]):t.setAttribute(i,e[""+i])},r.prototype.enableItems=function(e,t){function i(e,t){e?(t.classList.remove(it),E.isNullOrUndefined(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","false")):(t.classList.add(it),E.isNullOrUndefined(t.firstElementChild)||t.firstElementChild.setAttribute("aria-disabled","true"))}var s,n=e,r=n.length;E.isNullOrUndefined(t)&&(t=!0);if(!E.isNullOrUndefined(r)&&1<=r){for(var o=0,l=[].slice.call(n);o<r;o++){var a=l[parseInt(o.toString(),10)];if("number"==typeof a){if(s=this.getElementByIndex(a),E.isNullOrUndefined(s))return;n[parseInt(o.toString(),10)]=s}else s=a;i(t,s)}t?E.removeClass(n,it):E.addClass(n,it)}else{if("number"==typeof n){if(s=this.getElementByIndex(n),E.isNullOrUndefined(s))return}else s=e;i(t,s)}},r.prototype.getElementByIndex=function(e){return this.tbarEle[parseInt(e.toString(),10)]?this.tbarEle[parseInt(e.toString(),10)]:null},r.prototype.addItems=function(e,t){this.extendedOpen();var i,s=this.element.querySelector("."+m);if(E.isNullOrUndefined(s))this.itemsRerender(e);else{var n,r="Left";E.isNullOrUndefined(t)&&(t=0),e.forEach(function(e){E.isNullOrUndefined(e.align)||"Left"===e.align||"Left"!==r||(r=e.align)});for(var o=0,l=e;o<l.length;o++){var a,d,h=l[o];E.isNullOrUndefined(h.type)&&(h.type="Button"),i=E.selectAll("."+b,this.element),h.align=r,n=this.renderSubComponent(h,t),this.tbarEle.length>=t&&0<=i.length&&(E.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),a="L"===h.align[0]?0:"C"===h.align[0]?1:2,d=void 0,this.tbarAlign||"Left"===r?this.tbarAlign?((d=E.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).insertBefore(n,d.children[parseInt(t.toString(),10)]),this.tbarAlgEle[(h.align+"s").toLowerCase()].splice(t,0,n),this.refreshPositioning()):0===i.length?(i=E.selectAll("."+m,this.element))[0].appendChild(n):i[0].parentNode.insertBefore(n,i[parseInt(t.toString(),10)]):(this.tbarItemAlign(h,s,1),this.tbarAlign=!0,(d=E.closest(i[0],"."+m).children[parseInt(a.toString(),10)]).appendChild(n),this.tbarAlgEle[(h.align+"s").toLowerCase()].push(n),this.refreshPositioning()),this.items.splice(t,0,h),h.template&&this.tbarEle.splice(this.tbarEle.length-1,1),this.tbarEle.splice(t,0,n),t++,this.offsetWid=s.offsetWidth)}s.style.width="",this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()}},r.prototype.removeItems=function(e){var t=e,i=[].slice.call(E.selectAll("."+b,this.element));if("number"==typeof t)o=parseInt(e.toString(),10),this.removeItemByIndex(o,i);else if(t&&1<t.length)for(var s=0,n=[].slice.call(t);s<n.length;s++){var r=n[s],o=this.tbarEle.indexOf(r);this.removeItemByIndex(o,i),i=E.selectAll("."+b,this.element)}else{r=t&&t.length&&1===t.length?t[0]:e;o=i.indexOf(r),this.removeItemByIndex(o,i)}this.resize()},r.prototype.removeItemByIndex=function(e,t){var i,s;this.tbarEle[parseInt(e.toString(),10)]&&t[parseInt(e.toString(),10)]&&(i=this.tbarEle.indexOf(t[parseInt(e.toString(),10)]),this.tbarAlign&&(s=this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].indexOf(this.tbarEle[parseInt(i.toString(),10)]),this.tbarAlgEle[(this.items[parseInt(i.toString(),10)].align+"s").toLowerCase()].splice(parseInt(s.toString(),10),1)),this.isReact&&this.clearToolbarTemplate(t[parseInt(e.toString(),10)]),s=t[parseInt(e.toString(),10)].querySelector(".e-control.e-btn"),E.isNullOrUndefined(s)||E.isNullOrUndefined(s.ej2_instances[0])||s.ej2_instances[0].isDestroyed||s.ej2_instances[0].destroy(),E.detach(t[parseInt(e.toString(),10)]),this.items.splice(i,1),this.tbarEle.splice(i,1))},r.prototype.templateRender=function(e,t,i,s){var n=i.type,r=e;if("object"==typeof e&&(a="function"==typeof r.appendTo),"string"!=typeof e&&a)"Input"===n&&(o=this.createElement("input"),i.id?o.id=i.id:o.id=E.getUniqueID("tbr-ipt"),t.appendChild(o),r.appendTo(o));else{var o,l,a=void 0,n=new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i),i="string"==typeof e?e.trim():e;try{"object"!=typeof e||E.isNullOrUndefined(e.tagName)?"string"==typeof e&&n.test(i)?t.innerHTML=i:document.querySelectorAll(i).length?(l=(o=document.querySelector(i)).outerHTML.trim(),t.appendChild(o),o.style.display="",E.isNullOrUndefined(l)||this.tempId.push(i)):a=E.compile(i):t.appendChild(e)}catch(e){a=E.compile(i)}r=void 0;E.isNullOrUndefined(a)||(r=a({},this,"template",this.element.id+s+"_template",this.isStringTemplate,void 0,void 0,this.root)),!E.isNullOrUndefined(r)&&0<r.length&&[].slice.call(r).forEach(function(e){E.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)})}this.add(t,tt);n=t.firstElementChild;E.isNullOrUndefined(n)||(n.setAttribute("tabindex",E.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n)),n.setAttribute("data-tabindex",E.isNullOrUndefined(n.getAttribute("tabIndex"))?"-1":this.getDataTabindex(n))),this.tbarEle.push(t)},r.prototype.buttonRendering=function(e,t){var i,s,n=this.createElement("button",{className:"e-tbar-btn"}),r=(n.setAttribute("type","button"),e.text),o=(e.id?n.id=e.id:n.id=E.getUniqueID("e-tbr-btn"),this.createElement("span",{className:"e-tbar-btn-text"})),r=(r?(o.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(r):r,n.appendChild(o),n.classList.add("e-tbtn-txt")):this.add(t,"e-tbtn-align"),(e.prefixIcon||e.suffixIcon)&&(s=e.prefixIcon&&e.suffixIcon||e.prefixIcon?(i=e.prefixIcon+" e-icons","Left"):(i=e.suffixIcon+" e-icons","Right")),new R.Button({iconCss:i,iconPosition:s}));return r.createElement=this.createElement,r.appendTo(n),e.width&&E.setStyleAttribute(n,{width:E.formatUnit(e.width)}),n},r.prototype.renderSubComponent=function(e,t){var i,s=this.createElement("div",{className:b}),n=this.createElement("div",{innerHTML:this.enableHtmlSanitizer&&!E.isNullOrUndefined(e.tooltipText)?E.SanitizeHtmlHelper.sanitize(e.tooltipText):e.tooltipText});if(this.tbarEle||(this.tbarEle=[]),e.htmlAttributes&&this.setAttr(e.htmlAttributes,s),e.tooltipText&&s.setAttribute("title",n.textContent),e.cssClass&&(s.className=s.className+" "+e.cssClass),e.template)this.templateRender(e.template,s,e,t);else switch(e.type){case"Button":(i=this.buttonRendering(e,s)).setAttribute("tabindex",E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("data-tabindex",E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString()),i.setAttribute("aria-label",e.text||e.tooltipText),i.setAttribute("aria-disabled","false"),s.appendChild(i),s.addEventListener("click",this.itemClick.bind(this));break;case"Separator":this.add(s,C)}return e.showTextOn&&("Toolbar"===(n=e.showTextOn)?(this.add(s,st),this.add(s,"e-tbtn-align")):"Overflow"===n&&this.add(s,nt)),e.overflow&&("Show"===(t=e.overflow)?this.add(s,rt):"Hide"!==t||s.classList.contains(C)||this.add(s,ot)),"Show"!==e.overflow&&e.showAlwaysInPopup&&!s.classList.contains(C)&&(this.add(s,gt),this.popupPriCount++),e.disabled&&this.add(s,it),!1===e.visible&&this.add(s,vt),s},r.prototype.getDataTabindex=function(e){return E.isNullOrUndefined(e.getAttribute("data-tabindex"))?"-1":e.getAttribute("data-tabindex")},r.prototype.itemClick=function(e){this.activeEleSwitch(e.currentTarget)},r.prototype.activeEleSwitch=function(e){this.activeEleRemove(e.firstElementChild),this.activeEle.focus()},r.prototype.activeEleRemove=function(e){var t,i=this.element.querySelector("."+b+":not(."+it+" ):not(."+C+" ):not(."+vt+" )");E.isNullOrUndefined(this.activeEle)||(this.activeEle.setAttribute("tabindex",this.getDataTabindex(this.activeEle)),i&&i.removeAttribute("tabindex"),i=this.activeEle),this.activeEle=e,"-1"===this.getDataTabindex(this.activeEle)&&(E.isNullOrUndefined(this.trgtEle)&&!e.parentElement.classList.contains(tt)?(!E.isNullOrUndefined(this.element.querySelector(".e-hor-nav"))&&this.element.querySelector(".e-hor-nav").classList.contains("e-nav-active")?(this.updateTabIndex("0"),t="-1"===this.getDataTabindex(i)?"0":this.getDataTabindex(i),i.setAttribute("tabindex",t)):this.updateTabIndex("-1"),e.removeAttribute("tabindex")):(i=parseInt(this.getDataTabindex(this.activeEle),10)+1,this.activeEle.setAttribute("tabindex",i.toString())))},r.prototype.getPersistData=function(){return this.addOnPersist([])},r.prototype.getModuleName=function(){return"toolbar"},r.prototype.itemsRerender=function(e){this.items=this.tbarItemsCol,(this.isReact||this.isAngular)&&this.clearTemplate(),this.destroyMode(),this.destroyItems(),this.items=e,this.tbarItemsCol=this.items,this.renderItems(),this.renderOverflowMode(),this.isReact&&this.renderReactTemplates()},r.prototype.resize=function(){var e,t=this.element,i=(this.tbResize=!0,this.tbarAlign&&this.itemPositioning(),this.popObj&&"Popup"===this.overflowMode&&this.popObj.hide(),this.checkOverflow(t,t.getElementsByClassName(m)[0]));i||(this.destroyScroll(),e=t.querySelector("."+m),E.isNullOrUndefined(e))||(this.remove(e,bt),this.tbarAlign&&this.add(e,ht)),i&&this.scrollModule&&this.offsetWid===t.offsetWidth||((this.offsetWid>t.offsetWidth||i)&&this.renderOverflowMode(),this.popObj&&("Extended"===this.overflowMode&&(this.popObj.width=this.getToolbarPopupWidth(this.element)),this.tbarAlign&&this.removePositioning(),this.popupRefresh(this.popObj.element,!1),this.tbarAlign)&&this.refreshPositioning(),this.element.querySelector("."+ct)&&(this.scrollStep=this.element.querySelector("."+ct).offsetWidth),this.offsetWid=t.offsetWidth,this.tbResize=!1,this.separator())},r.prototype.orientationChange=function(){var e=this;setTimeout(function(){e.resize()},500)},r.prototype.extendedOpen=function(){var e=this.element.querySelector("."+Et);"Extended"===this.overflowMode&&e&&(this.isExtendedOpen=e.classList.contains(et))},r.prototype.updateHideEleTabIndex=function(e,t,i,s,n){i&&(s=n.indexOf(e));for(var r=n[++s];r;){if(!this.eleContains(r)){var o=r.firstElementChild.getAttribute("data-tabindex");t&&"-1"===o?r.firstElementChild.setAttribute("tabindex","0"):o!==r.firstElementChild.getAttribute("tabindex")&&r.firstElementChild.setAttribute("tabindex",o);break}r=n[++s]}},r.prototype.clearToolbarTemplate=function(e){if(this.registeredTemplate&&this.registeredTemplate.template)for(var t=this.registeredTemplate,i=0;i<t.template.length;i++){var s=t.template[parseInt(i.toString(),10)].rootNodes[0],n=E.closest(s,"."+b);if(!E.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],[t.template[parseInt(i.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var r=this.portals,i=0;i<r.length;i++){var o=r[parseInt(i.toString(),10)],n=E.closest(o.containerInfo,"."+b);if(!E.isNullOrUndefined(n)&&n===e){this.clearTemplate(["template"],i);break}}},r.prototype.onPropertyChanged=function(e,t){var i=this.element;this.extendedOpen();for(var s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"items":if(e.items instanceof Array&&t.items instanceof Array)this.itemsRerender(e.items);else for(var r=Object.keys(e.items),o=0;o<r.length;o++){var l=parseInt(Object.keys(e.items)[parseInt(o.toString(),10)],10),a=Object.keys(e.items[parseInt(l.toString(),10)])[0],d=Object(e.items[parseInt(l.toString(),10)])[""+a];if(this.tbarAlign||"align"===a){this.refresh(),this.trigger("created");break}var h="overflow"===a&&0!==this.popupPriCount,a=(("showAlwaysInPopup"===a&&!d||this.items[parseInt(l.toString(),10)].showAlwaysInPopup&&h)&&--this.popupPriCount,E.isNullOrUndefined(this.scrollModule)&&this.destroyMode(),[].slice.call(E.selectAll("."+m+" ."+b,i)));this.isReact&&this.items[parseInt(l.toString(),10)].template&&this.clearToolbarTemplate(a[parseInt(l.toString(),10)]),E.detach(a[parseInt(l.toString(),10)]),this.tbarEle.splice(l,1),this.addItems([this.items[parseInt(l.toString(),10)]],l),this.items.splice(l,1),this.items[parseInt(l.toString(),10)].template&&this.tbarEle.splice(this.items.length,1)}break;case"width":E.setStyleAttribute(i,{width:E.formatUnit(e.width)}),this.refreshOverflow();break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)});break;case"overflowMode":this.destroyMode(),this.renderOverflowMode(),this.enableRtl&&this.add(i,Je),this.refreshOverflow();break;case"enableRtl":e.enableRtl?this.add(i,Je):this.remove(i,Je),E.isNullOrUndefined(this.scrollModule)||(e.enableRtl?this.add(this.scrollModule.element,Je):this.remove(this.scrollModule.element,Je)),E.isNullOrUndefined(this.popObj)||(e.enableRtl?this.add(this.popObj.element,Je):this.remove(this.popObj.element,Je)),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":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.split(" "));break;case"allowKeyboard":this.unwireKeyboardEvent(),e.allowKeyboard&&this.wireKeyboardEvent()}},r.prototype.hideItem=function(e,t){var i,s,n="object"==typeof e,r=e;!n&&E.isNullOrUndefined(r)||(i=[].slice.call(E.selectAll("."+b,this.element)),n?s=e:this.tbarEle[parseInt(r.toString(),10)]&&(s=[].slice.call(E.selectAll("."+b,this.element))[parseInt(r.toString(),10)]),s&&(t?(s.classList.add(vt),s.classList.contains(C)||!E.isNullOrUndefined(s.firstElementChild.getAttribute("tabindex"))&&"-1"===s.firstElementChild.getAttribute("tabindex")||this.updateHideEleTabIndex(s,t,n,r,i)):(s.classList.remove(vt),s.classList.contains(C)||this.updateHideEleTabIndex(s,t,n,r,i)),this.refreshOverflow()))},n([E.Collection([],Nt)],r.prototype,"items",void 0),n([E.Property("auto")],r.prototype,"width",void 0),n([E.Property("auto")],r.prototype,"height",void 0),n([E.Property("")],r.prototype,"cssClass",void 0),n([E.Property("Scrollable")],r.prototype,"overflowMode",void 0),n([E.Property()],r.prototype,"scrollStep",void 0),n([E.Property(!0)],r.prototype,"enableCollision",void 0),n([E.Property(!0)],r.prototype,"enableHtmlSanitizer",void 0),n([E.Property(!0)],r.prototype,"allowKeyboard",void 0),n([E.Event()],r.prototype,"clicked",void 0),n([E.Event()],r.prototype,"created",void 0),n([E.Event()],r.prototype,"destroyed",void 0),n([E.Event()],r.prototype,"beforeCreate",void 0);var wt,Lt=n([E.NotifyPropertyChanges],r);function r(e,t){e=wt.call(this,e,t)||this;return e.resizeContext=e.resize.bind(e),e.orientationChangeContext=e.orientationChange.bind(e),e.keyConfigs={moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow",popupOpen:"enter",popupClose:"escape",tab:"tab",home:"home",end:"end"},e}kt=function(e,t){return(kt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var kt,At,e=function(e,t){function i(){this.constructor=e}kt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Tt="e-acrdn-root",Pt="e-accordion",Dt="e-acrdn-item",Mt="e-item-focus",Ht="e-hide",Ut="e-acrdn-header",Rt="e-acrdn-header-content",Bt="e-acrdn-panel",jt="e-acrdn-content",qt="e-toggle-icon",Ft="e-expand-icon",Wt="e-rtl",Vt="e-content-hide",_t="e-select",zt="e-selected",Kt="e-active",Xt="e-overlay",Yt="e-toggle-animation",Gt="e-expand-state",Qt="e-accordion-container",Jt=(At=E.ChildProperty,e(Zt,At),n([E.Property("SlideDown")],Zt.prototype,"effect",void 0),n([E.Property(400)],Zt.prototype,"duration",void 0),n([E.Property("linear")],Zt.prototype,"easing",void 0),Zt);function Zt(){return null!==At&&At.apply(this,arguments)||this}$t=E.ChildProperty,e(ti,$t),n([E.Complex({effect:"SlideUp",duration:400,easing:"linear"},Jt)],ti.prototype,"collapse",void 0),n([E.Complex({effect:"SlideDown",duration:400,easing:"linear"},Jt)],ti.prototype,"expand",void 0);var $t,ei=ti;function ti(){return null!==$t&&$t.apply(this,arguments)||this}ii=E.ChildProperty,e(ni,ii),n([E.Property(null)],ni.prototype,"content",void 0),n([E.Property(null)],ni.prototype,"header",void 0),n([E.Property(null)],ni.prototype,"cssClass",void 0),n([E.Property(null)],ni.prototype,"iconCss",void 0),n([E.Property(!1)],ni.prototype,"expanded",void 0),n([E.Property(!0)],ni.prototype,"visible",void 0),n([E.Property(!1)],ni.prototype,"disabled",void 0),n([E.Property()],ni.prototype,"id",void 0);var ii,si=ni;function ni(){return null!==ii&&ii.apply(this,arguments)||this}ri=E.Component,e(o,ri),o.prototype.destroy=function(){(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate();var t=this.element;if(ri.prototype.destroy.call(this),this.unWireEvents(),this.isDestroy=!0,this.restoreContent(null),[].slice.call(t.children).forEach(function(e){t.removeChild(e)}),this.trgtEle){for(this.trgtEle=null;this.ctrlTem.firstElementChild;)t.appendChild(this.ctrlTem.firstElementChild);this.ctrlTem=null}t.classList.remove(Tt),t.removeAttribute("style"),this.element.removeAttribute("data-ripple"),!this.isNested&&E.isRippleEnabled&&this.removeRippleEffect()},o.prototype.preRender=function(){var e=E.closest(this.element,"."+Bt);this.isNested=!1,this.templateEle=[],this.isDestroy||(this.isDestroy=!1),e&&e.firstElementChild&&e.firstElementChild.firstElementChild?e.firstElementChild.firstElementChild.classList.contains(Pt)&&(e.classList.add("e-nested"),this.isNested=!0):this.element.classList.add(Tt),this.enableRtl&&this.add(this.element,Wt)},o.prototype.add=function(e,t){e.classList.add(t)},o.prototype.remove=function(e,t){e.classList.remove(t)},o.prototype.render=function(){this.initializeHeaderTemplate(),this.initializeItemTemplate(),this.initialize(),this.renderControl(),this.wireEvents(),this.renderComplete()},o.prototype.initialize=function(){var e=E.formatUnit(this.width),t=E.formatUnit(this.height);E.setStyleAttribute(this.element,{width:e,height:t}),E.isNullOrUndefined(this.initExpand)&&(this.initExpand=[]),!E.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices)},o.prototype.renderControl=function(){this.trgtEle=0<this.element.children.length?E.select("div",this.element):null,this.renderItems(),this.initItemExpand()},o.prototype.wireFocusEvents=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Dt));e<t.length;e++){var i=t[e],s=i.querySelector("."+Ut);0<i.childElementCount&&s&&(E.EventHandler.clearEvents(s),E.EventHandler.add(s,"focus",this.focusIn,this),E.EventHandler.add(s,"blur",this.focusOut,this))}},o.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"click",this.clickHandler),E.isNullOrUndefined(this.keyModule)||this.keyModule.destroy()},o.prototype.wireEvents=function(){E.EventHandler.add(this.element,"click",this.clickHandler,this),this.isNested||this.isDestroy||(this.removeRippleEffect=E.rippleEffect(this.element,{selector:"."+Ut})),this.isNested||(this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}))},o.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}},o.prototype.initializeHeaderTemplate=function(){this.headerTemplate&&(this.headerTemplateFn=this.templateParser(this.headerTemplate))},o.prototype.initializeItemTemplate=function(){this.itemTemplate&&(this.itemTemplateFn=this.templateParser(this.itemTemplate))},o.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},o.prototype.getItemTemplate=function(){return this.itemTemplateFn},o.prototype.focusIn=function(e){e.target.parentElement.classList.add(Mt)},o.prototype.focusOut=function(e){e.target.parentElement.classList.remove(Mt)},o.prototype.ctrlTemplate=function(){this.ctrlTem=this.element.cloneNode(!0);var e=E.select("."+Qt,this.element),t=(e||this.element).children,i=[];[].slice.call(t).forEach(function(e){i.push({header:0<e.childElementCount&&e.children[0]?e.children[0]:"",content:1<e.childElementCount&&e.children[1]?e.children[1]:""}),e.parentNode.removeChild(e)}),e&&this.element.removeChild(e),this.setProperties({items:i},!0)},o.prototype.toggleIconGenerate=function(){var e=this.createElement("div",{className:qt}),t=this.createElement("span",{className:"e-tgl-collapse-icon e-icons"});return e.appendChild(t),e},o.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[parseInt(t.toString(),10)]);this.isReact&&this.renderReactTemplates()}},o.prototype.renderItems=function(){var i,s,e,n=this,r=this.element;E.isNullOrUndefined(this.trgtEle)||this.ctrlTemplate(),!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?this.dataSource.forEach(function(e,t){s=n.renderInnerItem(e,t),r.appendChild(s),0<s.childElementCount&&(E.EventHandler.add(s.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(s.querySelector("."+Ut),"blur",n.focusOut,n))}):(e=this.items,r&&0<e.length&&e.forEach(function(e,t){i=n.renderInnerItem(e,t),r.appendChild(i),0<i.childElementCount&&(E.EventHandler.add(i.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(i.querySelector("."+Ut),"blur",n.focusOut,n))})),this.isReact&&this.renderReactTemplates()},o.prototype.clickHandler=function(e){var t,i,s,n,r,o,l=e.target,a=this.getItems(),d={};E.closest(l,"."+Pt)===this.element&&(l.classList.add("e-target"),i=E.closest(l,"."+Dt),s=E.closest(l,"."+Ut),n=E.closest(l,"."+Bt),i&&(E.isNullOrUndefined(s)||E.isNullOrUndefined(n))&&(s=i.children[0],n=i.children[1]),s&&(t=E.select("."+qt,s)),s?r=E.closest(s,"."+Dt):n&&(r=E.closest(n,"."+Dt)),o=this.getIndexByItem(i),r&&(d.item=a[this.getIndexByItem(r)]),d.originalEvent=e,!E.isNullOrUndefined(t)&&i.childElementCount<=1&&(E.isNullOrUndefined(n)||!E.isNullOrUndefined(E.select("."+Ut+" ."+qt,r)))&&(i.appendChild(this.contentRendering(o)),this.ariaAttrUpdate(i)),this.afterContentRender(l,d,i,s,n,r),this.isReact)&&this.renderReactTemplates()},o.prototype.afterContentRender=function(l,e,a,d,h,c){var p=this,u=[];this.trigger("clicked",e,function(e){if(!e.cancel){var e=h&&!E.isNullOrUndefined(E.select(".e-target",h)),t=h&&!E.isNullOrUndefined(E.select("."+Pt,h))&&E.isNullOrUndefined(E.closest(l,".e-acrdn-panel .e-accordion")),i=h&&E.isNullOrUndefined(E.select("."+Pt,h))||!(E.closest(l,"."+Pt)===p.element),e=e&&(t||i);if(l.classList.remove("e-target"),!(l.classList.contains(Bt)||l.classList.contains(jt)||e)){t=p.element.querySelector("."+Qt),i=(t||p.element).children,e=([].slice.call(i).forEach(function(e){e.classList.contains(Kt)&&u.push(e)}),[].slice.call(p.element.querySelectorAll("."+Dt+" [e-animate]")));if(0<e.length)for(var s=0,n=e;s<n.length;s++){var r=n[s];u.push(r.parentElement)}var o,t=-1!==u.indexOf(c)&&"true"===h.getAttribute("e-animate");E.isNullOrUndefined(a)||E.isNullOrUndefined(d)||(i=E.select("."+Bt,a),e=E.closest(a,"."+Tt).querySelector("."+Gt),E.isNullOrUndefined(i))||(o=e===a,!E.isVisible(i)||t&&!c.classList.contains(zt)?(0<u.length&&"Single"===p.expandMode&&!t&&u.forEach(function(e){p.collapse(E.select("."+Bt,e)),e.classList.remove(Gt)}),p.expand(i)):p.collapse(i),E.isNullOrUndefined(e))||o||e.classList.remove(Gt)}}})},o.prototype.eleMoveFocus=function(e,t,i){var s,n=E.closest(i,"."+Dt);i===t?s=("moveUp"===e?i.lastElementChild:i).querySelector("."+Ut):i.classList.contains(Ut)&&(n="moveUp"===e?n.previousElementSibling:n.nextElementSibling)&&(s=E.select("."+Ut,n)),s&&s.focus()},o.prototype.keyActionHandler=function(e){var t=e.target,i=E.closest(e.target,Ut);if(!E.isNullOrUndefined(i)||t.classList.contains(Pt)||t.classList.contains(Ut)){var s,n=this.element;switch(e.action){case"moveUp":case"moveDown":this.eleMoveFocus(e.action,n,t);break;case"space":case"enter":s=t.nextElementSibling,(E.isNullOrUndefined(s)||!s.classList.contains(Bt)||"true"!==s.getAttribute("e-animate"))&&t.click(),e.preventDefault();break;case"home":case"end":("home"===e.action?n.firstElementChild:n.lastElementChild).children[0].focus(),e.preventDefault()}}},o.prototype.headerEleGenerate=function(){var e=this.createElement("div",{className:Ut,id:E.getUniqueID("acrdn_header")});return E.attributes(e,{tabindex:"0",role:"button","aria-disabled":"false","aria-expanded":"false"}),e},o.prototype.renderInnerItem=function(e,t){var i,s,n,r=this.createElement("div",{className:Dt,id:e.id||E.getUniqueID("acrdn_item")});return this.headerTemplate?(n=this.headerEleGenerate(),i=this.createElement("div",{className:Rt}),n.appendChild(i),E.append(this.getHeaderTemplate()(e,this,"headerTemplate",this.element.id+"_headerTemplate",!1),i),r.appendChild(n),n.appendChild(this.toggleIconGenerate()),this.add(r,_t)):(i=(e.header&&this.angularnativeCondiCheck(e,"header")&&(s=e.header,this.enableHtmlSanitizer&&"string"==typeof e.header&&(s=E.SanitizeHtmlHelper.sanitize(e.header)),n=this.headerEleGenerate(),i=this.createElement("div",{className:Rt}),n.appendChild(i),n.appendChild(this.fetchElement(i,s,t)),r.appendChild(n)),E.select("."+Ut,r)),!e.expanded||E.isNullOrUndefined(t)||this.enablePersistence||-1===this.initExpand.indexOf(t)&&this.initExpand.push(t),e.cssClass&&E.addClass([r],e.cssClass.split(" ")),e.disabled&&E.addClass([r],Xt),!1===e.visible&&E.addClass([r],Ht),e.iconCss&&(s=this.createElement("div",{className:"e-acrdn-header-icon"}),n=this.createElement("span",{className:e.iconCss+" e-icons"}),s.appendChild(n),E.isNullOrUndefined(i)?((i=this.headerEleGenerate()).appendChild(s),r.appendChild(i)):i.insertBefore(s,i.childNodes[0])),e.content&&this.angularnativeCondiCheck(e,"content")&&(t=this.toggleIconGenerate(),E.isNullOrUndefined(i)&&(i=this.headerEleGenerate(),r.appendChild(i)),i.appendChild(t),this.add(r,_t))),r},o.prototype.angularnativeCondiCheck=function(e,t){t="content"===t?e.content:e.header;return!(this.isAngular&&!E.isNullOrUndefined(t.elementRef)&&(e=t.elementRef.nativeElement.data,!E.isNullOrUndefined(e))&&""!==e&&-1!==e.indexOf("bindings=")&&(e=JSON.parse(t.elementRef.nativeElement.data.replace("bindings=","")),!E.isNullOrUndefined(e))&&"false"===e["ng-reflect-ng-if"])},o.prototype.fetchElement=function(t,i,e){var s,n,r,o;try{document.querySelectorAll(i).length&&"Button"!==i?(n=(r=document.querySelector(i)).outerHTML.trim(),t.appendChild(r),r.style.display=""):s=E.compile(i)}catch(e){"string"==typeof i?t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(i):i:i instanceof HTMLElement?(t.appendChild(i),this.trgtEle&&(t.firstElementChild.style.display="")):s=E.compile(i)}return E.isNullOrUndefined(s)||(this.isReact&&this.renderReactTemplates(),o=r=void 0,t.classList.contains(Rt)?(r=this.element.id+e+"_header",o="header"):t.classList.contains(jt)&&(r=this.element.id+e+"_content",o="content"),o=s({},this,o,r,this.isStringTemplate)),E.isNullOrUndefined(o)||!(0<o.length)||E.isNullOrUndefined(o[0].tagName)&&1===o.length?0===t.childElementCount&&(t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(i):i):[].slice.call(o).forEach(function(e){E.isNullOrUndefined(e.tagName)||(e.style.display=""),t.appendChild(e)}),E.isNullOrUndefined(n)||-1===this.templateEle.indexOf(i)&&this.templateEle.push(i),t},o.prototype.ariaAttrUpdate=function(e){var t=E.select("."+Ut,e),e=E.select("."+Bt,e);t.setAttribute("aria-controls",e.id),e.setAttribute("aria-labelledby",t.id),e.setAttribute("role","region")},o.prototype.contentRendering=function(e){var t,i=this.createElement("div",{className:Bt+" "+Vt,id:E.getUniqueID("acrdn_panel")}),s=(E.attributes(i,{"aria-hidden":"true"}),this.createElement("div",{className:jt}));return!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length?(this.isReact&&this.renderReactTemplates(),E.append(this.getItemTemplate()(this.dataSource[parseInt(e.toString(),10)],this,"itemTemplate",this.element.id+"_itemTemplate",!1),s),i.appendChild(s)):(t=this.items[parseInt(e.toString(),10)].content,this.enableHtmlSanitizer&&"string"==typeof t&&(t=E.SanitizeHtmlHelper.sanitize(t)),i.appendChild(this.fetchElement(s,t,e))),i},o.prototype.expand=function(t){var i,s,n,r=this,e=this.getItems(),o=E.closest(t,"."+Dt);E.isNullOrUndefined(t)||E.isVisible(t)&&"true"!==t.getAttribute("e-animate")||o.classList.contains(Xt)||(i=E.closest(o,"."+Tt).querySelector("."+Gt),s={name:this.animation.expand.effect,duration:this.animation.expand.duration,timingFunction:this.animation.expand.easing},n=E.select("."+qt,o).firstElementChild,e={element:o,item:e[this.getIndexByItem(o)],index:this.getIndexByItem(o),content:o.querySelector("."+Bt),isExpanded:!0},this.trigger("expanding",e,function(e){e.cancel||(n.classList.add(Yt),r.expandedItemsPush(o),E.isNullOrUndefined(i)||i.classList.remove(Gt),o.classList.add(Gt),"None"===s.name&&"Enable"!==E.animationMode||"Disable"===E.animationMode?(r.expandProgress("begin",n,t,o,e),r.expandProgress("end",n,t,o,e)):r.expandAnimation(s.name,n,t,o,s,e))}))},o.prototype.expandAnimation=function(e,t,i,s,n,r){var o,l=this;"None"===e&&"Enable"===E.animationMode&&(n.name=e="SlideDown"),this.lastActiveItemId=s.id,"SlideDown"===e?(n.begin=function(){l.expandProgress("begin",t,i,s,r),i.style.position="absolute",o=s.offsetHeight,i.style.maxHeight=i.offsetHeight+"px",s.style.maxHeight=""},n.progress=function(){s.style.minHeight=o+i.offsetHeight+"px"},n.end=function(){E.setStyleAttribute(i,{position:"",maxHeight:""}),s.style.minHeight="",l.expandProgress("end",t,i,s,r)}):(n.begin=function(){l.expandProgress("begin",t,i,s,r)},n.end=function(){l.expandProgress("end",t,i,s,r)}),new E.Animation(n).animate(i)},o.prototype.expandProgress=function(e,t,i,s,n){this.remove(i,Vt),this.add(s,zt),this.add(t,Ft),"end"===e&&(this.add(s,Kt),i.setAttribute("aria-hidden","false"),E.attributes(i.previousElementSibling,{"aria-expanded":"true"}),t.classList.remove(Yt),this.trigger("expanded",n))},o.prototype.expandedItemsPush=function(e){var t,e=this.getIndexByItem(e);-1===this.expandedIndices.indexOf(e)&&((t=[].slice.call(this.expandedIndices)).push(e),this.setProperties({expandedIndices:t},!0))},o.prototype.getIndexByItem=function(e){var t=this.getItemElements();return[].slice.call(t).indexOf(e)},o.prototype.getItemElements=function(){var t=[],e=this.element.children;return[].slice.call(e).forEach(function(e){e.classList.contains(Dt)&&t.push(e)}),t},o.prototype.expandedItemsPop=function(e){var e=this.getIndexByItem(e),t=[].slice.call(this.expandedIndices);t.splice(t.indexOf(e),1),this.setProperties({expandedIndices:t},!0)},o.prototype.collapse=function(t){var i,s,n,e,r=this;E.isNullOrUndefined(t)||(e=this.getItems(),i=E.closest(t,"."+Dt),E.isVisible(t)&&!i.classList.contains(Xt)&&(s={name:this.animation.collapse.effect,duration:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing},n=E.select("."+qt,i).firstElementChild,e={element:i,item:e[this.getIndexByItem(i)],index:this.getIndexByItem(i),content:i.querySelector("."+Bt),isExpanded:!1},this.trigger("expanding",e,function(e){e.cancel||(r.expandedItemsPop(i),i.classList.remove(Gt),n.classList.add(Yt),"None"===s.name&&"Enable"!==E.animationMode||"Disable"===E.animationMode?(r.collapseProgress("begin",n,t,i,e),r.collapseProgress("end",n,t,i,e)):r.collapseAnimation(s.name,t,i,n,s,e))})))},o.prototype.collapseAnimation=function(e,t,i,s,n,r){var o,l,a,d,h=this;"None"===e&&"Enable"===E.animationMode&&(n.name=e="SlideUp"),this.lastActiveItemId=i.id,"SlideUp"===e?(n.begin=function(){a=i.offsetHeight,i.style.minHeight=a+"px",t.style.position="absolute",o=i.offsetHeight,l=t.offsetHeight,t.style.maxHeight=l+"px",h.collapseProgress("begin",s,t,i,r)},n.progress=function(){(d=o-(l-t.offsetHeight))<a&&(i.style.minHeight=d+"px")},n.end=function(){t.style.display="none",h.collapseProgress("end",s,t,i,r),i.style.minHeight="",E.setStyleAttribute(t,{position:"",maxHeight:"",display:""})}):(n.begin=function(){h.collapseProgress("begin",s,t,i,r)},n.end=function(){h.collapseProgress("end",s,t,i,r)}),new E.Animation(n).animate(t)},o.prototype.collapseProgress=function(e,t,i,s,n){this.remove(t,Ft),this.remove(s,zt),"end"===e&&(this.add(i,Vt),t.classList.remove(Yt),this.remove(s,Kt),i.setAttribute("aria-hidden","true"),E.attributes(i.previousElementSibling,{"aria-expanded":"false"}),this.trigger("expanded",n))},o.prototype.getModuleName=function(){return"accordion"},o.prototype.getItems=function(){var e=this.itemTemplate&&this.headerTemplate?this.dataSource:this.items;return e},o.prototype.addItem=function(e,s){var n=this,r=this.element,o=this.getItemElements(),l=this.getItems();E.isNullOrUndefined(s)&&(s=l.length),r.childElementCount>=s&&(e instanceof Array?e:[e]).forEach(function(e,t){var t=s+t,i=(l.splice(t,0,e),n.renderInnerItem(e,t));r.childElementCount===t?r.appendChild(i):r.insertBefore(i,o[parseInt(t.toString(),10)]),E.EventHandler.add(i.querySelector("."+Ut),"focus",n.focusIn,n),E.EventHandler.add(i.querySelector("."+Ut),"blur",n.focusOut,n),n.expandedIndices=[],n.expandedItemRefresh(),e&&e.expanded&&n.expandItem(!0,t)}),this.isReact&&this.renderReactTemplates()},o.prototype.expandedItemRefresh=function(){var t=this,e=this.getItemElements();[].slice.call(e).forEach(function(e){e.classList.contains(zt)&&t.expandedItemsPush(e)})},o.prototype.removeItem=function(e){(this.isReact||this.isAngular)&&(i=E.selectAll("."+Dt,this.element)[parseInt(e.toString(),10)],t=E.select("."+Rt,i),i=E.select("."+jt,i),this.clearAccordionTemplate(t,0<this.dataSource.length?"headerTemplate":"header",Rt),this.clearAccordionTemplate(i,0<this.dataSource.length?"itemTemplate":"content",jt));var t=this.getItemElements()[parseInt(e.toString(),10)],i=this.getItems();E.isNullOrUndefined(t)||(this.restoreContent(e),E.detach(t),i.splice(e,1),this.expandedIndices=[],this.expandedItemRefresh())},o.prototype.select=function(e){e=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(e)||E.isNullOrUndefined(E.select("."+Ut,e))||e.children[0].focus()},o.prototype.hideItem=function(e,t){e=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(e)||((t=E.isNullOrUndefined(t)?!0:t)?this.add(e,Ht):this.remove(e,Ht))},o.prototype.enableItem=function(e,t){var i,s=this.getItemElements()[parseInt(e.toString(),10)];E.isNullOrUndefined(s)||(i=s.firstElementChild,t?(this.remove(s,Xt),E.attributes(i,{tabindex:"0","aria-disabled":"false"}),i.focus()):(s.classList.contains(Kt)&&(this.expandItem(!1,e),this.eleMoveFocus("movedown",this.element,i)),this.add(s,Xt),i.setAttribute("aria-disabled","true"),i.removeAttribute("tabindex")))},o.prototype.expandItem=function(t,e){var i,s,n,r=this,o=this.getItemElements();E.isNullOrUndefined(e)?"Single"===this.expandMode&&t?(n=o[o.length-1],this.itemExpand(t,n,this.getIndexByItem(n))):(i=E.select("#"+this.lastActiveItemId,this.element),[].slice.call(o).forEach(function(e){r.itemExpand(t,e,r.getIndexByItem(e)),e.classList.remove(Gt)}),(s=E.select("."+Gt,this.element))&&s.classList.remove(Gt),i&&i.classList.add(Gt)):(n=o[parseInt(e.toString(),10)],E.isNullOrUndefined(n)||!n.classList.contains(_t)||n.classList.contains(Kt)&&t||("Single"===this.expandMode&&this.expandItem(!1),this.itemExpand(t,n,e)))},o.prototype.itemExpand=function(e,t,i){var s=t.children[1];t.classList.contains(Xt)||(E.isNullOrUndefined(s)&&e?(s=this.contentRendering(i),t.appendChild(s),this.ariaAttrUpdate(t),this.expand(s)):E.isNullOrUndefined(s)||(e?this.expand(s):this.collapse(s)),this.isReact&&this.renderReactTemplates())},o.prototype.destroyItems=function(){this.restoreContent(null),(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(),[].slice.call(this.element.querySelectorAll("."+Dt)).forEach(function(e){E.detach(e)})},o.prototype.restoreContent=function(e){var t=E.isNullOrUndefined(e)?this.element:this.element.querySelectorAll("."+Dt)[parseInt(e.toString(),10)];this.templateEle.forEach(function(e){E.isNullOrUndefined(t.querySelector(e))||(document.body.appendChild(t.querySelector(e)).style.display="none")})},o.prototype.updateItem=function(e,t){var i,s,n;E.isNullOrUndefined(e)||(i=(s=this.getItems())[parseInt(t.toString(),10)],s.splice(t,1),this.restoreContent(t),s=E.select("."+Rt,e),n=E.select("."+jt,e),(this.isReact||this.isAngular)&&(this.clearAccordionTemplate(s,"header",Rt),this.clearAccordionTemplate(n,"content",jt)),E.detach(e),this.addItem(i,t))},o.prototype.setTemplate=function(e,t,i){this.fetchElement(t,e,i),this.isReact&&this.renderReactTemplates()},o.prototype.clearAccordionTemplate=function(e,t,i){if(this.registeredTemplate&&this.registeredTemplate[""+t])for(var s=this.registeredTemplate,n=0;n<s[""+t].length;n++){var r=s[""+t][parseInt(n.toString(),10)].rootNodes[0],o=E.closest(r,"."+i);if(!E.isNullOrUndefined(o)&&o===e||E.isNullOrUndefined(r.parentNode)){this.clearTemplate([t],[s[""+t][parseInt(n.toString(),10)]]);break}}else if(this.portals&&0<this.portals.length)for(var l=this.portals,n=0;n<l.length;n++){var a=l[parseInt(n.toString(),10)],o=E.closest(a.containerInfo,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],n);break}}},o.prototype.getPersistData=function(){return this.addOnPersist(["expandedIndices"])},o.prototype.onPropertyChanged=function(e,t){for(var i=this.element,s=!1,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){case"items":if(e.items instanceof Array&&t.items instanceof Array)s=!0;else for(var o=Object.keys(e.items),l=0;l<o.length;l++)for(var a=parseInt(Object.keys(e.items)[parseInt(l.toString(),10)],10),d=Object.keys(e.items[parseInt(a.toString(),10)]),h=0;h<d.length;h++){var c=E.selectAll("."+Dt,this.element)[parseInt(a.toString(),10)],p=Object(t.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],u=Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]],m=d[parseInt(h.toString(),10)],f=E.select("."+jt,c);("header"===m||"iconCss"===m||"expanded"===m||"content"===m&&""===p)&&this.updateItem(c,a),"cssClass"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||(p&&E.removeClass([c],p.split(" ")),u&&E.addClass([c],u.split(" "))),"visible"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||(!1===Object(e.items[parseInt(a.toString(),10)])[""+d[parseInt(h.toString(),10)]]?c.classList.add(Ht):c.classList.remove(Ht)),"disabled"!==d[parseInt(h.toString(),10)]||E.isNullOrUndefined(c)||this.enableItem(a,!u),d.indexOf("header")<0&&"content"===d[parseInt(h.toString(),10)]&&!E.isNullOrUndefined(c)&&2===c.children.length&&("function"==typeof u?((this.isAngular||this.isReact)&&this.clearAccordionTemplate(f,d[parseInt(h.toString(),10)],jt),(m=c.querySelector("."+jt)).innerHTML="",this.setTemplate(u,m,a)):(c.classList.contains(zt)&&this.expandItem(!1,a),E.detach(c.querySelector("."+Bt))))}break;case"dataSource":case"expandedIndices":null===this.expandedIndices&&(this.expandedIndices=[]),s=!0;break;case"headerTemplate":this.initializeHeaderTemplate(),s=!0;break;case"itemTemplate":this.initializeItemTemplate(),s=!0;break;case"enableRtl":e.enableRtl?this.add(i,Wt):this.remove(i,Wt);break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)});break;case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(e.width)});break;case"expandMode":"Single"===e.expandMode&&!E.isNullOrUndefined(this.expandedIndices)&&1<this.expandedIndices.length&&this.expandItem(!1)}s&&(this.initExpand=[],!E.isNullOrUndefined(this.expandedIndices)&&0<this.expandedIndices.length&&(this.initExpand=this.expandedIndices),this.destroyItems(),this.renderItems(),this.initItemExpand())},n([E.Collection([],si)],o.prototype,"items",void 0),n([E.Property([])],o.prototype,"dataSource",void 0),n([E.Property()],o.prototype,"itemTemplate",void 0),n([E.Property()],o.prototype,"headerTemplate",void 0),n([E.Property("100%")],o.prototype,"width",void 0),n([E.Property("auto")],o.prototype,"height",void 0),n([E.Property([])],o.prototype,"expandedIndices",void 0),n([E.Property("Multiple")],o.prototype,"expandMode",void 0),n([E.Property(!0)],o.prototype,"enableHtmlSanitizer",void 0),n([E.Complex({},ei)],o.prototype,"animation",void 0),n([E.Event()],o.prototype,"clicked",void 0),n([E.Event()],o.prototype,"expanding",void 0),n([E.Event()],o.prototype,"expanded",void 0),n([E.Event()],o.prototype,"created",void 0),n([E.Event()],o.prototype,"destroyed",void 0);var ri,e=n([E.NotifyPropertyChanges],o);function o(e,t){e=ri.call(this,e,t)||this;return e.keyConfigs={moveUp:"uparrow",moveDown:"downarrow",enter:"enter",space:"space",home:"home",end:"end"},e}oi=function(e,t){return(oi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var oi,li,n=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},n=(function(e,t){function i(){this.constructor=e}oi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(ai,li=F),ai.prototype.preRender=function(){this.isMenu=!1,this.element.id=this.element.id||E.getUniqueID("ej2-contextmenu"),li.prototype.preRender.call(this)},ai.prototype.initialize=function(){this.template=this.itemTemplate||null,li.prototype.initialize.call(this),E.attributes(this.element,{role:"menubar",tabindex:"0"}),this.element.style.zIndex=g.getZindexPartial(this.element).toString()},ai.prototype.open=function(e,t,i){li.prototype.openMenu.call(this,null,null,e,t,null,i)},ai.prototype.close=function(){li.prototype.closeMenu.call(this)},ai.prototype.onPropertyChanged=function(e,t){li.prototype.onPropertyChanged.call(this,e,t);for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"filter":this.close(),this.filter=e.filter;break;case"target":this.unWireEvents(t.target),this.wireEvents();break;case"itemTemplate":this.itemTemplate=e.itemTemplate,this.refresh()}},ai.prototype.getModuleName=function(){return"contextmenu"},n([E.Property("")],ai.prototype,"target",void 0),n([E.Property("")],ai.prototype,"filter",void 0),n([E.Collection([],We)],ai.prototype,"items",void 0),n([E.Property(null)],ai.prototype,"itemTemplate",void 0),n([E.Property(!1)],ai.prototype,"enableScrolling",void 0),n([E.NotifyPropertyChanges],ai));function ai(e,t){return li.call(this,e,t)||this}di=function(e,t){return(di=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var di,hi,ci=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},pi="e-vertical",ui="e-hamburger",F=(function(e,t){function i(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(mi,hi=F),mi.prototype.getModuleName=function(){return"menu"},mi.prototype.preRender=function(){if(this.isMenu=!0,this.element.id=this.element.id||E.getUniqueID("ej2-menu"),this.template)try{"function"!=typeof this.template&&document.querySelectorAll(this.template).length&&(this.template=document.querySelector(this.template).innerHTML.trim(),this.clearChanges())}catch(e){}this.updateMenuItems(this.items),hi.prototype.preRender.call(this)},mi.prototype.initialize=function(){hi.prototype.initialize.call(this),E.attributes(this.element,{role:"menubar",tabindex:"0"}),"Vertical"===this.orientation?(this.element.classList.add(pi),this.hamburgerMode&&!this.target&&this.element.previousElementSibling.classList.add(pi),this.element.setAttribute("aria-orientation","vertical")):E.Browser.isDevice&&!this.enableScrolling&&this.element.parentElement.classList.add("e-scrollable"),this.hamburgerMode&&(this.element.parentElement.classList.add(ui),"Horizontal"===this.orientation)&&this.element.classList.add("e-hide-menu")},mi.prototype.updateMenuItems=function(e){this.tempItems=e,this.items=[],this.tempItems.map(this.createMenuItems,this),this.setProperties({items:this.items},!0),this.tempItems=[]},mi.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e);s<n.length;s++)switch(n[s]){case"orientation":"Vertical"===e.orientation?(this.element.classList.add(pi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.add(pi),this.element.classList.remove("e-hide-menu")),this.element.setAttribute("aria-orientation","vertical")):(this.element.classList.remove(pi),this.hamburgerMode&&(this.target||this.element.previousElementSibling.classList.remove(pi),this.element.classList.add("e-hide-menu")),this.element.removeAttribute("aria-orientation"));break;case"items":Object.keys(t.items).length||this.updateMenuItems(e.items);break;case"hamburgerMode":this.element.previousElementSibling||hi.prototype.createHeaderContainer.call(this),e.hamburgerMode?(this.element.parentElement.classList.add(ui),[].slice.call(this.element.getElementsByClassName("e-blankicon")).forEach(function(e){e.style[i.enableRtl?"paddingRight":"paddingLeft"]=""})):(this.element.parentElement.classList.remove(ui),"Vertical"===this.orientation&&this.setBlankIconStyle(this.element)),"Vertical"===this.orientation?(this.target||this.element.previousElementSibling.classList.add(pi),this.element.classList.remove("e-hide-menu")):(this.target?this.element.previousElementSibling.classList.add(pi):this.element.previousElementSibling.classList.remove(pi),this.element.classList[e.hamburgerMode?"add":"remove"]("e-hide-menu"));break;case"title":this.hamburgerMode&&this.element.previousElementSibling&&(e.title=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e.title):e.title,this.element.previousElementSibling.querySelector(".e-menu-title").innerHTML=e.title);break;case"target":this.hamburgerMode&&(this.unWireEvents(t.target),this.wireEvents(),"Horizontal"===this.orientation)&&(e.target?this.element.previousElementSibling.classList.add(pi):(this.element.previousElementSibling||hi.prototype.createHeaderContainer.call(this),this.element.previousElementSibling.classList.remove(pi)),this.element.classList.add("e-hide-menu"));break;case"template":this.template=e.template,this.refresh()}hi.prototype.onPropertyChanged.call(this,e,t)},mi.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)},mi.prototype.open=function(){hi.prototype.openHamburgerMenu.call(this)},mi.prototype.close=function(){hi.prototype.closeHamburgerMenu.call(this)},ci([E.Property("Horizontal")],mi.prototype,"orientation",void 0),ci([E.Property("")],mi.prototype,"target",void 0),ci([E.Property(null)],mi.prototype,"template",void 0),ci([E.Property(!1)],mi.prototype,"enableScrolling",void 0),ci([E.Property(!1)],mi.prototype,"hamburgerMode",void 0),ci([E.Property("Menu")],mi.prototype,"title",void 0),ci([E.Property(!0)],mi.prototype,"enableHtmlSanitizer",void 0),ci([E.Complex({itemId:"id",text:"text",parentId:"parentId",iconCss:"iconCss",url:"url",separator:"separator",children:"items"},je)],mi.prototype,"fields",void 0),ci([E.NotifyPropertyChanges],mi));function mi(e,t){e=hi.call(this,e,t)||this;return e.tempItems=[],e}fi=function(e,t){return(fi=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var fi,gi,ci=function(e,t){function i(){this.constructor=e}fi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},vi="e-tab",yi="e-tab-header",S="e-content",bi="e-nested",Ci="e-item",Si="e-template",Ii="e-rtl",d="e-active",Ei="e-disable",I="e-hidden",xi="e-focused",Ni="e-icons",Oi="e-icon",wi="e-icon-tab",Li="e-close-icon",ki="e-close-show",Ai="e-tab-text",Ti="e-indicator",Pi="e-tab-wrap",Di="e-text-wrap",Mi="e-tab-icon",Hi="e-toolbar-items",N="e-toolbar-item",Ui="e-toolbar-pop",Ri="e-toolbar-popup",Bi="e-progress",ji="e-overlay",qi="e-vertical-tab",Fi="e-vertical",Wi="e-vertical-left",Vi="e-vertical-right",_i="e-horizontal-bottom",zi="e-fill-mode",Ki="tabitem_",Xi="e-reorder-active-item",Yi=(gi=E.ChildProperty,ci(Gi,gi),l([E.Property("SlideLeftIn")],Gi.prototype,"effect",void 0),l([E.Property(600)],Gi.prototype,"duration",void 0),l([E.Property("ease")],Gi.prototype,"easing",void 0),Gi);function Gi(){return null!==gi&&gi.apply(this,arguments)||this}Qi=E.ChildProperty,ci(Zi,Qi),l([E.Complex({effect:"SlideLeftIn",duration:600,easing:"ease"},Yi)],Zi.prototype,"previous",void 0),l([E.Complex({effect:"SlideRightIn",duration:600,easing:"ease"},Yi)],Zi.prototype,"next",void 0);var Qi,Ji=Zi;function Zi(){return null!==Qi&&Qi.apply(this,arguments)||this}$i=E.ChildProperty,ci(ts,$i),l([E.Property("")],ts.prototype,"text",void 0),l([E.Property("")],ts.prototype,"iconCss",void 0),l([E.Property("left")],ts.prototype,"iconPosition",void 0);var $i,es=ts;function ts(){return null!==$i&&$i.apply(this,arguments)||this}is=E.ChildProperty,ci(ns,is),l([E.Complex({},es)],ns.prototype,"header",void 0),l([E.Property(null)],ns.prototype,"headerTemplate",void 0),l([E.Property("")],ns.prototype,"content",void 0),l([E.Property("")],ns.prototype,"cssClass",void 0),l([E.Property(!1)],ns.prototype,"disabled",void 0),l([E.Property(!0)],ns.prototype,"visible",void 0),l([E.Property()],ns.prototype,"id",void 0),l([E.Property(-1)],ns.prototype,"tabIndex",void 0);var is,ss=ns;function ns(){return null!==is&&is.apply(this,arguments)||this}rs=E.Component,ci(h,rs),h.prototype.destroy=function(){if((this.isReact||this.isAngular)&&this.clearTemplate(),E.isNullOrUndefined(this.tbObj)||(this.tbObj.destroy(),this.tbObj=null),this.unWireEvents(),this.element.removeAttribute("aria-disabled"),this.expTemplateContent(),this.isTemplate){var e=E.select(".e-tab > ."+S,this.element);this.element.classList.remove(Si),E.isNullOrUndefined(e)||(e.innerHTML=this.cnt)}else for(;this.element.firstElementChild;)E.remove(this.element.firstElementChild);if(this.btnCls&&(this.btnCls=null),this.hdrEle=null,this.cntEle=null,this.tbItems=null,this.tbItem=null,this.tbPop=null,this.prevItem=null,this.popEle=null,this.bdrLine=null,this.content=null,this.dragItem=null,this.cloneElement=null,this.draggingItems=[],this.draggableItems&&0<this.draggableItems.length){for(var t=0;t<this.draggableItems.length;t++)this.draggableItems[t].destroy(),this.draggableItems[t]=null;this.draggableItems=[]}rs.prototype.destroy.call(this),this.trigger("destroyed")},h.prototype.refresh=function(){this.isReact&&this.clearTemplate(),rs.prototype.refresh.call(this),this.isReact&&this.renderReactTemplates()},h.prototype.refreshOverflow=function(){E.isNullOrUndefined(this.tbObj)||this.tbObj.refreshOverflow()},h.prototype.preRender=function(){var e=E.closest(this.element,"."+S),e=(this.prevIndex=0,this.isNested=!1,this.isPopup=!1,this.initRender=!0,this.isSwiped=!1,this.itemIndexArray=[],this.templateEle=[],this.allowDragAndDrop&&(this.dragArea=E.isNullOrUndefined(this.dragArea)?"#"+this.element.id+" ."+yi:this.dragArea),E.isNullOrUndefined(e)||(e.parentElement.classList.add(bi),this.isNested=!0),E.Browser.info.name),e="msie"===e?"e-ie":"edge"===e?"e-edge":"safari"===e?"e-safari":"";E.setStyleAttribute(this.element,{width:E.formatUnit(this.width),height:E.formatUnit(this.height)}),this.setCssClass(this.element,this.cssClass,!0),E.attributes(this.element,{"aria-disabled":"false"}),this.setCssClass(this.element,e,!0),this.updatePopAnimationConfig()},h.prototype.render=function(){var e=this;this.btnCls=this.createElement("span",{className:Ni+" "+Li,attrs:{title:this.title}}),this.tabId=0<this.element.id.length?"-"+this.element.id:E.getRandomId(),this.renderContainer(),this.wireEvents(),this.initRender=!1,this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){e.refreshOverflow(),e.refreshActiveBorder()})},h.prototype.renderContainer=function(){var e=this.element;this.items.forEach(function(e,t){E.isNullOrUndefined(e.id)&&!E.isNullOrUndefined(e.setProperties)&&e.setProperties({id:Ki+t.toString()},!0)}),0<this.items.length&&0===e.children.length?(e.appendChild(this.createElement("div",{className:S})),this.setOrientation(this.headerPlacement,this.createElement("div",{className:yi})),this.isTemplate=!1):0<this.element.children.length&&(this.isTemplate=!0,e.classList.add(Si),e=e.querySelector("."+yi))&&"Bottom"===this.headerPlacement&&this.setOrientation(this.headerPlacement,e),E.isNullOrUndefined(E.select("."+yi,this.element))||E.isNullOrUndefined(E.select("."+S,this.element))||(this.renderHeader(),this.tbItems=E.select("."+yi+" ."+Hi,this.element),E.isNullOrUndefined(this.tbItems)||E.rippleEffect(this.tbItems,{selector:".e-tab-wrap"}),this.renderContent(),0<E.selectAll("."+N,this.element).length&&(this.tbItems=E.select("."+yi+" ."+Hi,this.element),this.bdrLine=this.createElement("div",{className:Ti+" "+I+" e-ignore"}),e=E.select("."+this.scrCntClass,this.tbItems),E.isNullOrUndefined(e)?this.tbItems.insertBefore(this.bdrLine,this.tbItems.firstChild):e.insertBefore(this.bdrLine,e.firstChild),this.setContentHeight(!0),this.select(this.selectedItem)),this.setRTL(this.enableRtl))},h.prototype.renderHeader=function(){var n=this,e=this.headerPlacement,t=[];if(this.hdrEle=this.getTabHeader(),this.addVerticalClass(),this.isTemplate){1<this.element.children.length&&this.element.children[1].classList.contains(yi)&&this.setProperties({headerPlacement:"Bottom"},!0);for(var r,i=this.hdrEle.children.length,s=[],o=0;o<i;o++)s.push(this.hdrEle.children.item(o));0<i&&(r=this.createElement("div",{className:"e-items"}),this.hdrEle.appendChild(r),s.forEach(function(e,t){n.lastIndex=t;var i={className:Ci,id:Ci+n.tabId+"_"+t},s=n.createElement("span",{className:Ai,attrs:{role:"presentation"}}).outerHTML,s=n.createElement("div",{className:Di,innerHTML:s+n.btnCls.outerHTML}).outerHTML,s=n.createElement("div",{className:Pi,innerHTML:s,attrs:{role:"tab",tabIndex:"-1","aria-selected":"false","aria-controls":S+n.tabId+"_"+t,"aria-disabled":"false"}});s.querySelector("."+Ai).appendChild(e),r.appendChild(n.createElement("div",i)),E.selectAll("."+Ci,r)[t].appendChild(s)}))}else t=this.parseObject(this.items,0);this.tbObj=new Lt({width:"Left"===e||"Right"===e?"auto":"100%",height:"Left"===e||"Right"===e?"100%":"auto",overflowMode:this.overflowMode,items:0!==t.length?t:[],clicked:this.clickHandler.bind(this),scrollStep:this.scrollStep,enableHtmlSanitizer:this.enableHtmlSanitizer,cssClass:this.cssClass}),this.tbObj.isStringTemplate=!0,this.tbObj.createElement=this.createElement,this.tbObj.appendTo(this.hdrEle),E.attributes(this.hdrEle,{role:"tablist"}),E.isNullOrUndefined(this.element.getAttribute("aria-label"))?E.isNullOrUndefined(this.element.getAttribute("aria-labelledby"))||(this.hdrEle.setAttribute("aria-labelledby",this.element.getAttribute("aria-labelledby")),this.element.removeAttribute("aria-labelledby")):(this.hdrEle.setAttribute("aria-label",this.element.getAttribute("aria-label")),this.element.removeAttribute("aria-label")),this.setCloseButton(this.showCloseButton);e=this.tbObj.element.querySelector("."+Hi);E.isNullOrUndefined(e)||!E.isNullOrUndefined(e.id)&&""!==e.id||(e.id=this.element.id+"_tab_header_items")},h.prototype.createContentElement=function(e){var t=this.createElement("div",{id:S+this.tabId+"_"+e,className:Ci,attrs:{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+e}});return(-1!==["Dynamic","Demand"].indexOf(this.loadOn)||"Init"===this.loadOn&&e===Number(this.extIndex(this.itemIndexArray[0])))&&E.addClass([t],d),t},h.prototype.renderContent=function(){this.cntEle=E.select("."+S,this.element);var e=E.selectAll("."+N,this.element);if(this.isTemplate){this.cnt=0<this.cntEle.children.length?this.cntEle.innerHTML:"";for(var t=this.cntEle.children,i=0;i<e.length;i++)t.length-1>=i&&(E.addClass([t.item(i)],Ci),E.attributes(t.item(i),{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+i}),t.item(i).id=S+this.tabId+"_"+i)}else if(0<E.selectAll("."+N,this.element).length)if("Init"===this.loadOn)for(i=0;i<this.itemIndexArray.length;i++)this.itemIndexArray[i]&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[i]))));else"Dynamic"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(0<this.selectedItem?this.selectedItem:Number(this.extIndex(this.itemIndexArray[0]))))},h.prototype.reRenderItems=function(){this.renderContainer(),E.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents()},h.prototype.parseObject=function(e,h){var c,p=this,u=Array.prototype.slice.call(E.selectAll(".e-tab-header ."+N,this.element)),m=this.lastIndex,f=(!this.isReplace&&0<u.length&&(m=this.getMaxIndicesFromItems(u)),[]),g=[];return e.forEach(function(e,t){var i,s,n,r,o,l,a=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,d=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss;E.isNullOrUndefined(e.headerTemplate)&&(E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.text)||0===e.header.text.length&&""===d)?g.push(t):("string"==typeof(o=e.headerTemplate||e.header.text)&&p.enableHtmlSanitizer&&(o=E.SanitizeHtmlHelper.sanitize(o)),p.isReplace&&!E.isNullOrUndefined(p.tbId)&&""!==p.tbId?(i=parseInt(p.tbId.substring(p.tbId.lastIndexOf("_")+1),10),p.tbId=""):i=h+t,p.lastIndex=0===u.length?t:p.isReplace?i:m+1+t,i=e.disabled?" "+Ei+" "+ji:"",s=!1===e.visible?" "+I:"",c=p.createElement("div",{className:Ai,attrs:{role:"presentation"}}),n=o instanceof Object?o.outerHTML:o,n=!E.isNullOrUndefined(n)&&""!==n,E.isNullOrUndefined(o.tagName)?p.headerTextCompile(c,o,t):c.appendChild(o),l=p.createElement("span",{className:Ni+" "+Mi+" "+Oi+"-"+a+" "+d}),(r=p.createElement("div",{className:Di})).appendChild(c),""!==o&&void 0!==o&&""!==d?("left"===a||"top"===a?r.insertBefore(l,r.firstElementChild):r.appendChild(l),p.isIconAlone=!1):(""===d?c:l)===l&&(E.detach(c),r.appendChild(l),p.isIconAlone=!0),o=E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),l=e.disabled?{role:"tab","aria-disabled":"true"}:{tabIndex:o,"data-tabindex":o,role:"tab","aria-selected":"false","aria-disabled":"false"},r.appendChild(p.btnCls.cloneNode(!0)),(o=p.createElement("div",{className:Pi,attrs:l})).appendChild(r),p.itemIndexArray instanceof Array&&p.itemIndexArray.splice(h+t,0,Ci+p.tabId+"_"+p.lastIndex),(l={htmlAttributes:{id:Ci+p.tabId+"_"+p.lastIndex,"data-id":e.id},template:o}).cssClass=(void 0!==e.cssClass?e.cssClass:" ")+" "+i+" "+s+" "+(""!==d?"e-i"+a:"")+" "+(n?"":Oi),"top"!==a&&"bottom"!==a||p.element.classList.add("e-vertical-icon"),f.push(l),t++)}),this.isAdd||g.forEach(function(e){p.items.splice(e,1)}),this.isIconAlone?this.element.classList.add(wi):this.element.classList.remove(wi),f},h.prototype.removeActiveClass=function(){var e=this.getTabHeader();e&&(e=E.selectAll("."+N+"."+d,e),[].slice.call(e).forEach(function(e){return e.classList.remove(d)}),[].slice.call(e).forEach(function(e){return e.firstElementChild.setAttribute("aria-selected","false")}))},h.prototype.checkPopupOverflow=function(e){this.tbPop=E.select("."+Ui,this.element);var t=E.select(".e-hor-nav",this.element),i=E.select("."+Hi,this.element),s=i.lastChild,n=!1;return(n=!this.isVertical()&&(this.enableRtl&&t.offsetLeft+t.offsetWidth>i.offsetLeft||!this.enableRtl&&t.offsetLeft<i.offsetWidth)||this.isVertical()&&t.offsetTop<s.offsetTop+s.offsetHeight?!0:n)&&(e.classList.add(Ri),this.tbPop.insertBefore(e,E.selectAll("."+Ri,this.tbPop)[0])),!0},h.prototype.popupHandler=function(e){var t=e.querySelector(".e-ripple-element"),t=(E.isNullOrUndefined(t)||(t.outerHTML="",e.querySelector("."+Pi).classList.remove("e-ripple")),this.tbItem=E.selectAll("."+Hi+" ."+N,this.hdrEle),this.tbItem[this.tbItem.length-1]);return 0!==this.tbItem.length&&(e.classList.remove(Ri),e.removeAttribute("style"),this.tbItems.appendChild(e),this.actEleId=e.id,this.checkPopupOverflow(t)&&(e=this.tbItems.lastChild.previousElementSibling,this.checkPopupOverflow(e)),this.isPopup=!0),E.selectAll("."+N,this.tbItems).length-1},h.prototype.setCloseButton=function(e){var t=E.select("."+yi,this.element);!0===e?t.classList.add(ki):t.classList.remove(ki),this.refreshOverflow(),this.refreshActiveTabBorder()},h.prototype.prevCtnAnimation=function(e,t){this.enableRtl||this.element.classList.contains(Ii);e=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;return e},h.prototype.triggerPrevAnimation=function(e,t){var i=this,t=this.prevCtnAnimation(t,this.selectedItem);E.isNullOrUndefined(t)?e.classList.remove(d):(t.begin=function(){E.setStyleAttribute(e,{position:"absolute"}),e.classList.add(Bi),e.classList.add("e-view")},t.end=function(){e.style.display="none",e.classList.remove(d),e.classList.remove(Bi),e.classList.remove("e-view"),E.setStyleAttribute(e,{display:"",position:""}),0!==e.childNodes.length||i.isTemplate||E.detach(e)},new E.Animation(t).animate(e))},h.prototype.triggerAnimation=function(e,t){var i,s,n,r=this,o=this.prevIndex,l=([].slice.call(this.element.querySelector("."+S).children).forEach(function(e){e.id===r.prevActiveEle&&(i=e)}),this.tbItem[o]),a=this.getTrgContent(this.cntEle,this.extIndex(e)),l=(E.isNullOrUndefined(i)&&!E.isNullOrUndefined(l)&&(e=this.extIndex(l.id),i=this.getTrgContent(this.cntEle,e)),E.isNullOrUndefined(a)||(this.prevActiveEle=a.id),E.isNullOrUndefined(this.animation)||E.isNullOrUndefined(this.animation.next.effect)||E.isNullOrUndefined(this.animation.previous.effect)||"None"===this.animation.previous.effect||"None"===this.animation.next.effect);this.initRender||!1===t||l?i&&i!==a&&i.classList.remove(d):(s=E.select("."+S,this.element),this.prevIndex>this.selectedItem&&!this.isPopup?n={name:"None"===(e=this.animation.previous.effect)?"":"SlideLeftIn"!==e?e:"SlideLeftIn",duration:0===this.animation.previous.duration&&"Enable"===E.animationMode?600:this.animation.previous.duration,timingFunction:this.animation.previous.easing}:(this.isPopup||this.prevIndex<this.selectedItem||this.prevIndex===this.selectedItem)&&(n={name:"None"===(t=this.animation.next.effect)?"":"SlideRightIn"!==t?t:"SlideRightIn",duration:0===this.animation.next.duration&&"Enable"===E.animationMode?600:this.animation.next.duration,timingFunction:this.animation.next.easing}),n.progress=function(){s.classList.add(Bi),r.setActiveBorder()},n.end=function(){s.classList.remove(Bi),a.classList.add(d)},this.initRender||E.isNullOrUndefined(i)||this.triggerPrevAnimation(i,o),this.isPopup=!1,""===n.name?a.classList.add(d):new E.Animation(n).animate(a))},h.prototype.keyPressed=function(e){var t=E.closest(e,"."+yi+" ."+N),i=this.getEleIndex(t);!E.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():E.isNullOrUndefined(t)||!1!==t.classList.contains(d)||(this.selectTab(i,null,!0),E.isNullOrUndefined(this.popEle))||this.popObj.hide(this.hide)},h.prototype.getTabHeader=function(){var e;if(!E.isNullOrUndefined(this.element))return 0<(e=[].slice.call(this.element.children).filter(function(e){return e.classList.contains(yi)})).length?e[0]:(e=[].slice.call(this.element.children).filter(function(e){return!e.classList.contains("blazor-template")})[0])?[].slice.call(e.children).filter(function(e){return e.classList.contains(yi)})[0]:void 0},h.prototype.getEleIndex=function(e){return Array.prototype.indexOf.call(E.selectAll("."+N,this.getTabHeader()),e)},h.prototype.extIndex=function(e){return e.replace(Ci+this.tabId+"_","")},h.prototype.getMaxIndicesFromItems=function(e){var t=this,i=[];return e.forEach(function(e){i.push(t.getIndexFromEle(e.id))}),Math.max.apply(Math,i)},h.prototype.expTemplateContent=function(){var t=this;this.templateEle.forEach(function(e){E.isNullOrUndefined(t.element.querySelector(e))||(document.body.appendChild(t.element.querySelector(e)).style.display="none")})},h.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()},h.prototype.compileElement=function(t,e,i,s){var n,r;"string"==typeof e?(e=e.trim(),this.isVue?n=E.compile(this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e):e):t.innerHTML=this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(e):e):n=E.compile(e),E.isNullOrUndefined(n)||(r=n({},this,i)),!E.isNullOrUndefined(n)&&0<r.length&&[].slice.call(r).forEach(function(e){t.appendChild(e)})},h.prototype.headerTextCompile=function(e,t,i){this.compileElement(e,t,"headerTemplate",i)},h.prototype.getContent=function(e,t,i,s){var n,r;"string"==typeof(t=E.isNullOrUndefined(t)?"":t)||E.isNullOrUndefined(t.innerHTML)?("."===(t="string"==typeof t&&this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(t):t)[0]||"#"===t[0])&&document.querySelectorAll(t).length?(r=(n=document.querySelector(t)).outerHTML.trim(),"clone"===i?e.appendChild(n.cloneNode(!0)):(e.appendChild(n),n.style.display="")):this.templateCompile(e,t,s):e.appendChild(t),E.isNullOrUndefined(r)||-1===this.templateEle.indexOf(t.toString())&&this.templateEle.push(t.toString())},h.prototype.getTrgContent=function(e,t){e=this.element.classList.contains(bi)?E.select("."+bi+"> ."+S+" > #"+S+this.tabId+"_"+t,this.element):this.findEle(e.children,S+this.tabId+"_"+t);return e},h.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},h.prototype.isVertical=function(){var e="Left"===this.headerPlacement||"Right"===this.headerPlacement;return this.scrCntClass=e?"e-vscroll-content":"e-hscroll-content",e},h.prototype.addVerticalClass=function(){var e;this.isVertical()&&(e="Left"===this.headerPlacement?Wi:Vi,E.addClass([this.hdrEle],[Fi,e]),this.element.classList.contains(bi)?E.addClass([this.hdrEle],[qi,e]):E.addClass([this.element],[qi,e])),"Bottom"===this.headerPlacement&&E.addClass([this.hdrEle],[_i])},h.prototype.updatePopAnimationConfig=function(){this.show={name:this.isVertical()?"FadeIn":"SlideDown",duration:100},this.hide={name:this.isVertical()?"FadeOut":"SlideUp",duration:100}},h.prototype.changeOrientation=function(e){this.setOrientation(e,this.hdrEle);var e=this.hdrEle.querySelector("."+d),t=!!this.hdrEle.classList.contains(Fi);E.removeClass([this.element],[qi]),E.removeClass([this.hdrEle],[Fi,Wi,Vi]),t!==this.isVertical()&&(this.changeToolbarOrientation(),!E.isNullOrUndefined(e))&&e.classList.contains(Ri)&&this.popupHandler(e),this.addVerticalClass(),this.setActiveBorder(),this.focusItem()},h.prototype.focusItem=function(){var e=E.select(" #"+Ci+this.tabId+"_"+this.selectedItem,this.hdrEle);E.isNullOrUndefined(e)||e.firstElementChild.focus()},h.prototype.changeToolbarOrientation=function(){this.tbObj.setProperties({height:this.isVertical()?"100%":"auto",width:this.isVertical()?"auto":"100%"},!0),this.tbObj.changeOrientation(),this.updatePopAnimationConfig()},h.prototype.setOrientation=function(e,t){var i=Array.prototype.indexOf.call(this.element.children,t),s=Array.prototype.indexOf.call(this.element.children,this.element.querySelector("."+S));"Bottom"===e&&i<s?this.element.appendChild(t):(E.removeClass([t],[_i]),this.element.insertBefore(t,E.select("."+S,this.element)))},h.prototype.setCssClass=function(e,t,i){if(""!==t&&!E.isNullOrUndefined(t))for(var s=t.split(" "),n=0;n<s.length;n++)i?e.classList.add(s[n]):e.classList.remove(s[n])},h.prototype.loadContentInitMode=function(e){if(e){if("Init"===this.loadOn)for(var t=0;t<this.items.length;t++)this.cntEle.children.item(t)&&this.getContent(this.cntEle.children.item(t),this.items[t].content,"render",t);this.prevIndex!==this.selectedItem&&e.classList.remove(d)}},h.prototype.loadContentElement=function(){var e;this.isTemplate||(e=this.cntEle.children.item(0),this.loadContentInitMode(e))},h.prototype.setContentHeight=function(e){if(this.element.classList.contains(zi)&&E.removeClass([this.element],[zi]),!E.isNullOrUndefined(this.cntEle)){var t=this.getTabHeader();if("None"===this.heightAdjustMode)this.loadContentElement(),"auto"===this.height||this.isVertical()||E.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-t.offsetHeight+"px"});else if("Fill"===this.heightAdjustMode)E.addClass([this.element],[zi]),E.setStyleAttribute(this.element,{height:"100%"}),this.loadContentElement(),this.cntEle.style.height="calc(100% - "+this.hdrEle.offsetHeight+"px)";else if("Auto"===this.heightAdjustMode){if(!0===this.isTemplate)for(var i=E.selectAll("."+S+" > ."+Ci,this.element),s=0;s<i.length;s++)i[s].setAttribute("style","display:block; visibility: visible"),this.maxHeight=Math.max(this.maxHeight,this.getHeight(i[s])),i[s].style.removeProperty("display"),i[s].style.removeProperty("visibility");else{this.cntEle=E.select("."+S,this.element),!0===e&&"Demand"===this.loadOn&&this.cntEle.appendChild(this.createContentElement(Number(this.extIndex(this.itemIndexArray[0]))));for(var n=this.cntEle.children.item(0),s=0;s<this.items.length;s++)for(this.getContent(n,this.items[s].content,"clone",s),this.maxHeight=Math.max(this.maxHeight,this.getHeight(n));n.firstChild;)n.removeChild(n.firstChild);(this.isReact||this.isAngular||this.isVue)&&this.clearTemplate(["content"]),this.templateEle=[],"Demand"===this.loadOn&&this.getContent(n,this.items[0].content,"render",0),this.loadContentInitMode(n)}E.setStyleAttribute(this.cntEle,{height:this.maxHeight+"px"})}else this.loadContentElement(),E.setStyleAttribute(this.cntEle,{height:"auto"})}},h.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"))},h.prototype.setActiveBorder=function(){var e,t,i=this.getTabHeader(),s=E.select("."+N+"."+d,i);E.isNullOrUndefined(s)||(this.reorderActiveTab?i&&i.classList.remove(Xi):(s.classList.contains(Ri)&&!this.bdrLine.classList.contains(I)&&this.bdrLine.classList.add(I),i&&!i.classList.contains(Xi)&&i.classList.add(Xi)),e=E.closest(s,"."+vi),this.element!==e)||(this.tbItems=E.select("."+Hi,i),e=E.select("."+Ti,i),i=E.select("."+Hi+" ."+this.scrCntClass,i),this.isVertical()?(E.setStyleAttribute(e,{left:"",right:""}),0!==(E.isNullOrUndefined(i)?this.tbItems:i).offsetHeight?E.setStyleAttribute(e,{top:s.offsetTop+"px",height:s.offsetHeight+"px"}):E.setStyleAttribute(e,{top:0,height:0})):("MultiRow"===this.overflowMode?(t="Bottom"===this.headerPlacement?s.offsetTop:s.offsetHeight+s.offsetTop,E.setStyleAttribute(e,{top:t+"px",height:""})):E.setStyleAttribute(e,{top:"",height:""}),0!==(t=(E.isNullOrUndefined(i)?this.tbItems:i).offsetWidth)?E.setStyleAttribute(e,{left:s.offsetLeft+"px",right:t-(s.offsetLeft+s.offsetWidth)+"px"}):E.setStyleAttribute(e,{left:"auto",right:"auto"})),E.isNullOrUndefined(this.bdrLine))||s.classList.contains(Ri)||this.bdrLine.classList.remove(I)},h.prototype.setActive=function(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1),this.tbItem=E.selectAll("."+N,this.getTabHeader());var s=this.tbItem[e];if(!(e<0||isNaN(e)||0===this.tbItem.length||!E.isNullOrUndefined(s)&&s.classList.contains(Ei)))if(0<=e&&!t&&(this.allowServerDataBinding=!1,this.setProperties({selectedItem:e},!0),this.allowServerDataBinding=!0,this.initRender||this.serverDataBind()),s.classList.contains(d))this.setActiveBorder();else{this.isTemplate||E.attributes(s.firstElementChild,{"aria-controls":S+this.tabId+"_"+this.extIndex(s.id)});var n=s.id,r=(this.removeActiveClass(),s.classList.add(d),s.firstElementChild.setAttribute("aria-selected","true"),Number(this.extIndex(n)));if(E.isNullOrUndefined(this.prevActiveEle)&&(this.prevActiveEle=S+this.tabId+"_"+r),this.isTemplate)0<E.select("."+S,this.element).children.length&&(r=this.findEle(E.select("."+S,this.element).children,S+this.tabId+"_"+r),E.isNullOrUndefined(r)||r.classList.add(d),this.triggerAnimation(n,this.enableAnimation));else{for(this.cntEle=E.select(".e-tab > ."+S,this.element);"Dynamic"===this.loadOn&&this.cntEle.firstElementChild;)this.cntEle.removeChild(this.cntEle.firstElementChild);var o,l,r=this.getTrgContent(this.cntEle,this.extIndex(n));E.isNullOrUndefined(r)?(this.cntEle.appendChild(this.createElement("div",{id:S+this.tabId+"_"+this.extIndex(n),className:Ci+" "+d,attrs:{role:"tabpanel","aria-labelledby":Ci+this.tabId+"_"+this.extIndex(n)}})),o=this.getTrgContent(this.cntEle,this.extIndex(n)),l=Array.prototype.indexOf.call(this.itemIndexArray,n),this.getContent(o,this.items[l].content,"render",l)):r.classList.add(d),this.triggerAnimation(n,this.enableAnimation)}this.setActiveBorder(),this.refreshItemVisibility(s),this.initRender||t||(o={previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:s,selectedIndex:e,selectedContent:E.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:i,preventFocus:!1},this.trigger("selected",o,function(e){e.preventFocus||s.firstElementChild.focus()}))}},h.prototype.setItems=function(e){this.isReplace=!0,this.tbItems=E.select("."+Hi,this.getTabHeader()),this.tbObj.items=this.parseObject(e,0),this.tbObj.dataBind(),this.isReplace=!1},h.prototype.setRTL=function(e){this.tbObj.enableRtl=e,this.tbObj.dataBind(),this.setCssClass(this.element,Ii,e),this.refreshActiveBorder()},h.prototype.refreshActiveBorder=function(){E.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(I),this.setActiveBorder()},h.prototype.showPopup=function(e){var t=E.select(".e-popup.e-toolbar-pop",this.hdrEle);t&&t.classList.contains("e-popup-close")&&((t=t&&t.ej2_instances[0]).position.X="Left"===this.headerPlacement||this.element.classList.contains(Ii)?"left":"right",t.dataBind(),t.show(e))},h.prototype.bindDraggable=function(){var e,t=this;this.allowDragAndDrop&&(e=this.element.querySelector("."+yi))&&Array.prototype.slice.call(e.querySelectorAll("."+N)).forEach(function(e){t.initializeDrag(e)})},h.prototype.bindSwipeEvents=function(){"None"!==this.swipeMode&&(this.touchModule=new E.Touch(this.cntEle,{swipe:this.swipeHandler.bind(this)}))},h.prototype.wireEvents=function(){this.bindDraggable(),window.addEventListener("resize",this.resizeContext),E.EventHandler.add(this.element,"mouseover",this.hoverHandler,this),E.EventHandler.add(this.element,"keydown",this.spaceKeyDown,this),E.isNullOrUndefined(this.cntEle)||this.bindSwipeEvents(),this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}),this.tabKeyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:{openPopup:"shift+f10",tab:"tab",shiftTab:"shift+tab"},eventName:"keydown"})},h.prototype.unWireEvents=function(){E.isNullOrUndefined(this.keyModule)||this.keyModule.destroy(),E.isNullOrUndefined(this.tabKeyModule)||this.tabKeyModule.destroy(),E.isNullOrUndefined(this.cntEle)||E.isNullOrUndefined(this.touchModule)||(this.touchModule.destroy(),this.touchModule=null),window.removeEventListener("resize",this.resizeContext),E.EventHandler.remove(this.element,"mouseover",this.hoverHandler),E.EventHandler.remove(this.element,"keydown",this.spaceKeyDown),this.element.classList.remove(Ii),this.element.classList.remove(xi)},h.prototype.clickHandler=function(e){this.element.classList.remove(xi);var t=e.originalEvent.target,i=E.closest(t,"."+N),s=this.getEleIndex(i);t.classList.contains(Li)?this.removeTab(s):this.isVertical()&&E.closest(t,".e-hor-nav")?this.showPopup(this.show):(this.isPopup=!1,E.isNullOrUndefined(i)||s===this.selectedItem||this.selectTab(s,e.originalEvent,!0))},h.prototype.swipeHandler=function(e){if(!(e.velocity<3&&E.isNullOrUndefined(e.originalEvent.changedTouches)||"Touch"===this.swipeMode&&("mouseup"===e.originalEvent.type||"mouseleave"===e.originalEvent.type)||"Mouse"===this.swipeMode&&"touchend"===e.originalEvent.type||"None"===this.swipeMode)){this.isNested&&this.element.setAttribute("data-swipe","true");var t=this.element.querySelector('[data-swipe="true"]');if(t)t.removeAttribute("data-swipe");else{if(this.isSwiped=!0,"Right"===e.swipeDirection&&0!==this.selectedItem){for(var i=this.selectedItem-1;0<=i;i--)if(!this.tbItem[i].classList.contains(I)){this.selectTab(i,null,!0);break}}else if("Left"===e.swipeDirection&&this.selectedItem!==E.selectAll("."+N,this.element).length-1)for(var s=this.selectedItem+1;s<this.tbItem.length;s++)if(!this.tbItem[s].classList.contains(I)){this.selectTab(s,null,!0);break}this.isSwiped=!1}}},h.prototype.spaceKeyDown=function(e){var t;(32===e.keyCode&&32===e.which||35===e.keyCode&&35===e.which)&&(t=E.closest(e.target,"."+yi),E.isNullOrUndefined(t)||e.preventDefault())},h.prototype.keyHandler=function(e){if(!this.element.classList.contains(Ei)){this.element.classList.add(xi);var t,i=e.target,s=this.getTabHeader(),n=E.select("."+d,s),r=(this.popEle=E.select("."+Ui,s),E.isNullOrUndefined(this.popEle)||(this.popObj=this.popEle.ej2_instances[0]),E.closest(document.activeElement,"."+N)),o=E.closest(i,"."+N);switch(e.action){case"space":case"enter":i.parentElement.classList.contains(Ei)||("enter"===e.action&&i.classList.contains("e-hor-nav")?this.showPopup(this.show):this.keyPressed(i));break;case"tab":case"shiftTab":i.classList.contains(Pi)&&!1===E.closest(i,"."+N).classList.contains(d)&&i.setAttribute("tabindex",i.getAttribute("data-tabindex")),this.popObj&&E.isVisible(this.popObj.element)&&this.popObj.hide(this.hide),E.isNullOrUndefined(n)||"-1"!==n.children.item(0).getAttribute("tabindex")||n.children.item(0).setAttribute("tabindex","0");break;case"moveLeft":case"moveRight":E.isNullOrUndefined(r)||this.refreshItemVisibility(r);break;case"openPopup":e.preventDefault(),!E.isNullOrUndefined(this.popEle)&&this.popEle.classList.contains("e-popup-close")&&this.popObj.show(this.show);break;case"delete":!0!==this.showCloseButton||E.isNullOrUndefined(o)||(t=o.nextSibling,!E.isNullOrUndefined(t)&&t.classList.contains(N)&&t.firstElementChild.focus(),this.removeTab(this.getEleIndex(o))),this.setActiveBorder()}}},h.prototype.refreshItemVisibility=function(e){var t,i,s,n,r=E.select("."+this.scrCntClass,this.tbItems);this.isVertical()||E.isNullOrUndefined(r)||(i=(t=(r=E.select(".e-hscroll-bar",this.tbItems)).scrollLeft)+r.offsetWidth,s=e.offsetLeft,n=e.offsetWidth,e=e.offsetLeft+e.offsetWidth,t<s&&i<e?r.scrollLeft=t+(n-(i-s)):s<t&&e<i&&(r.scrollLeft=t-(n-(e-t))))},h.prototype.getIndexFromEle=function(e){return parseInt(e.substring(e.lastIndexOf("_")+1),10)},h.prototype.hoverHandler=function(e){e=e.target;!E.isNullOrUndefined(e.classList)&&e.classList.contains(Li)&&e.setAttribute("title",new E.L10n("tab",{closeButtonTitle:this.title},this.locale).getConstant("closeButtonTitle"))},h.prototype.evalOnPropertyChangeItems=function(e,t){var i=this;if(e.items instanceof Array&&t.items instanceof Array)if(this.lastIndex=0,E.isNullOrUndefined(this.tbObj))this.reRenderItems();else{(this.isReact||this.isAngular)&&this.clearTemplate(),this.setItems(e.items),0<this.templateEle.length&&this.expTemplateContent(),this.templateEle=[];for(var s=E.select(".e-tab > ."+S,this.element);s.firstElementChild;)E.detach(s.firstElementChild);this.select(this.selectedItem),this.draggableItems=[],this.bindDraggable()}else{for(var n=Object.keys(e.items),r=0;r<n.length;r++)for(var o=parseInt(Object.keys(e.items)[r],10),l=Object.keys(e.items[o]),a=0;a<l.length;a++){var d,h,c=Object(t.items[o])[l[a]],p=Object(e.items[o])[l[a]],u=this.element.querySelectorAll("."+N)[o],m=void 0,m=u&&!E.isNullOrUndefined(u.id)&&""!==u.id?this.getIndexFromEle(u.id):o,f=E.select("."+Hi+" #"+Ci+this.tabId+"_"+m,this.element),m=E.select("."+S+" #"+S+this.tabId+"_"+m,this.element);"header"!==l[a]&&"headerTemplate"!==l[a]||(h=E.isNullOrUndefined(this.items[o].header)||E.isNullOrUndefined(this.items[o].header.iconCss)?"":this.items[o].header.iconCss,d=this.items[o].headerTemplate||this.items[o].header.text,"headerTemplate"===l[a]&&this.clearTabTemplate(f,l[a],N),""===d&&""===h?this.removeTab(o):(this.tbId=u.id,(d=[]).push(this.items[o]),this.items.splice(o,1),this.itemIndexArray.splice(o,1),this.tbObj.items.splice(o,1),h=f.classList.contains(I),E.detach(f),this.isReplace=!0,this.addTab(d,o),h&&this.hideTab(o),this.isReplace=!1)),"content"!==l[a]||E.isNullOrUndefined(m)||(("string"==typeof p||E.isNullOrUndefined(p.innerHTML))&&("."===p[0]||"#"===p[0])&&p.length?(u=document.querySelector(p),m.appendChild(u),u.style.display=""):""===p&&"#"===c[0]?(document.body.appendChild(this.element.querySelector(c)).style.display="none",m.innerHTML=p):this.isAngular||this.isReact?(this.clearTabTemplate(m,l[a],Ci),m.innerHTML="",this.templateCompile(m,p,o)):"function"!=typeof p&&(m.innerHTML=p)),"cssClass"===l[a]&&(E.isNullOrUndefined(f)||(f.classList.remove(c),f.classList.add(p)),E.isNullOrUndefined(m)||(m.classList.remove(c),m.classList.add(p))),"disabled"===l[a]&&this.enableTab(o,!0!==p),"visible"===l[a]&&this.hideTab(o,!0!==p)}this.isReact&&this.portals&&0<this.portals.length&&this.renderReactTemplates(function(){i.refreshActiveTabBorder()})}},h.prototype.clearTabTemplate=function(e,t,i){if(this.clearTemplates)if(this.registeredTemplate&&this.registeredTemplate[t])for(var s=this.registeredTemplate,n=0;n<s[t].length;n++){var r=s[t][n].rootNodes[0],o=E.closest(r,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],[s[t][n]]);break}}else if(this.portals&&0<this.portals.length)for(var l=this.portals,n=0;n<l.length;n++){var a=l[n],o=E.closest(a.containerInfo,"."+i);if(!E.isNullOrUndefined(o)&&o===e){this.clearTemplate([t],n);break}}},h.prototype.initializeDrag=function(e){var o=this,e=new E.Draggable(e,{dragArea:this.dragArea,dragTarget:"."+N,clone:!0,helper:this.helper.bind(this),dragStart:this.itemDragStart.bind(this),drag:function(e){var t,i,s,n=o.getEleIndex(o.dragItem),r={draggedItem:o.dragItem,event:e.event,target:e.target,droppedItem:e.target.closest("."+N),clonedElement:o.cloneElement,index:n};(E.isNullOrUndefined(e.target.closest("."+vi))||e.target.closest("."+vi).isEqualNode(o.element)||o.dragArea==="."+yi)&&(e.target.closest(o.dragArea)||"Popup"===o.overflowMode?(document.body.style.cursor="",o.dragItem.querySelector("."+Pi).style.visibility="hidden",o.cloneElement.classList.contains(I)&&E.removeClass([o.cloneElement],I)):(document.body.style.cursor="not-allowed",E.addClass([o.cloneElement],I),o.dragItem.classList.contains(I)&&E.removeClass([o.dragItem],I),o.dragItem.querySelector("."+Pi).style.visibility="visible"),"Scrollable"!==o.overflowMode||E.isNullOrUndefined(o.element.querySelector(".e-hscroll"))||(t=o.element.querySelector(".e-scroll-right-nav"),s=o.element.querySelector(".e-scroll-left-nav"),i=o.element.querySelector(".e-hscroll-bar"),!E.isNullOrUndefined(t)&&Math.abs(t.offsetWidth/2+t.offsetLeft)>o.cloneElement.offsetLeft+o.cloneElement.offsetWidth&&(i.scrollLeft-=10),!E.isNullOrUndefined(s)&&Math.abs(s.offsetLeft+s.offsetWidth-o.cloneElement.offsetLeft)>s.offsetWidth/2&&(i.scrollLeft+=10)),o.cloneElement.style.pointerEvents="none",t=E.closest(e.target,"."+N+".e-draggable"),s=0,"Scrollable"!==o.overflowMode||E.isNullOrUndefined(o.element.querySelector(".e-hscroll"))||(s=o.element.querySelector(".e-hscroll-content").offsetWidth),null!=t&&!t.isSameNode(o.dragItem)&&t.closest("."+vi).isSameNode(o.dragItem.closest("."+vi))&&((i=o.getEleIndex(t))<n&&Math.abs(t.offsetLeft+t.offsetWidth-o.cloneElement.offsetLeft)>t.offsetWidth/2&&o.dragAction(t,n,i),n<i)&&Math.abs(t.offsetWidth/2)+t.offsetLeft-s<o.cloneElement.offsetLeft+o.cloneElement.offsetWidth&&o.dragAction(t,n,i),o.droppedIndex=o.getEleIndex(o.dragItem)),o.trigger("dragging",r)},dragStop:this.itemDragStop.bind(this)});this.draggableItems.push(e)},h.prototype.helper=function(e){return this.cloneElement=this.createElement("div"),e.element&&(this.cloneElement=e.element.cloneNode(!0),E.addClass([this.cloneElement],"e-tab-clone-element"),this.element.querySelector("."+yi).classList.contains(ki)&&E.addClass([this.cloneElement],ki),E.removeClass([this.cloneElement.querySelector("."+Pi)],"e-ripple"),E.isNullOrUndefined(this.cloneElement.querySelector(".e-ripple-element"))||E.remove(this.cloneElement.querySelector(".e-ripple-element")),document.body.appendChild(this.cloneElement)),this.cloneElement},h.prototype.itemDragStart=function(t){var i=this,e=(this.draggingItems=this.items.map(function(e){return e}),this.dragItem=t.element,{draggedItem:t.element,event:t.event,target:t.target,droppedItem:null,index:this.getEleIndex(this.dragItem),clonedElement:this.cloneElement,cancel:!1});this.trigger("onDragStart",e,function(e){e.cancel?(e=t.element.ej2_instances[0],E.isNullOrUndefined(e)||e.intDestroy(t.event),E.detach(i.cloneElement)):(i.removeActiveClass(),E.addClass([i.tbItems.querySelector("."+Ti)],I),i.dragItem.querySelector("."+Pi).style.visibility="hidden")})},h.prototype.dragAction=function(e,t,i){var s,n;0<this.items.length&&(s=this.draggingItems[t],this.draggingItems.splice(t,1),this.draggingItems.splice(i,0,s)),"MultiRow"===this.overflowMode&&e.parentNode.insertBefore(this.dragItem,e.nextElementSibling),i<t&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e):"Extended"===this.overflowMode?e.isSameNode(e.parentElement.lastChild)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(e.parentElement.lastChild,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)):(s=e.parentElement.lastChild,e.isSameNode(s)?(n=this.dragItem.parentNode,e.parentNode.insertBefore(this.dragItem,e),n.insertBefore(s,n.childNodes[0])):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))),t<i&&(this.dragItem.parentElement.isSameNode(e.parentElement)?this.dragItem.parentNode.insertBefore(this.dragItem,e.nextElementSibling):"Extended"===this.overflowMode?(this.dragItem.parentElement.appendChild(e.parentElement.firstElementChild),e.parentNode.insertBefore(this.dragItem,e.nextSibling)):(this.dragItem.parentNode.insertBefore(e.parentElement.lastChild,this.dragItem.parentElement.childNodes[0]),e.parentNode.insertBefore(this.dragItem,e)))},h.prototype.itemDragStop=function(e){var t=this,e=(E.detach(this.cloneElement),this.cloneElement=null,this.dragItem.querySelector("."+Pi).style.visibility="visible",document.body.style.cursor="",{draggedItem:this.dragItem,event:e.event,target:e.target,droppedItem:this.tbItem[this.droppedIndex],clonedElement:null,index:this.droppedIndex,cancel:!1});this.trigger("dragged",e,function(e){e.cancel?t.refresh():0<t.items.length&&0<t.draggingItems.length?(t.items=t.draggingItems,t.selectedItem=E.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.refresh()):(t.dragItem.querySelector("."+Pi).style.visibility="",E.removeClass([t.tbItems.querySelector("."+Ti)],I),t.droppedIndex=E.isNullOrUndefined(t.droppedIndex)?t.getEleIndex(t.dragItem):t.droppedIndex,t.selectTab(t.droppedIndex,null,!0))}),this.dragItem=null,this.droppedIndex=null},h.prototype.enableTab=function(e,t){var i=E.selectAll("."+N,this.element)[e];E.isNullOrUndefined(i)||(!0===t?(i.classList.remove(Ei,ji),i.firstElementChild.setAttribute("tabindex",i.firstElementChild.getAttribute("data-tabindex"))):(i.classList.add(Ei,ji),i.firstElementChild.removeAttribute("tabindex"),i.classList.contains(d)&&this.select(e+1)),E.isNullOrUndefined(this.items[e])||(this.items[e].disabled=!t,this.dataBind()),i.firstElementChild.setAttribute("aria-disabled",!0===t?"false":"true"))},h.prototype.addTab=function(t,i){var s=this,e={addedItems:t,cancel:!1};if(this.isReplace)this.addingTabContent(t,i);else{for(var n=0,r=t;n<r.length;n++){var o=r[n];o.disabled=o.disabled||!1,o.visible=o.visible||!0}this.trigger("adding",e,function(e){e.cancel||s.addingTabContent(t,i)})}this.isReact&&this.renderReactTemplates()},h.prototype.addingTabContent=function(e,n){var t,i,r,o,l,a=this,d=0;this.hdrEle=E.select("."+yi,this.element),E.isNullOrUndefined(this.hdrEle)?(this.items=e,this.reRenderItems(),this.bindDraggable()):(0!==(i=(t=Array.from(E.selectAll(".e-tab-header ."+N,this.element))).length)&&(d=this.getMaxIndicesFromItems(t)+1),i<(n=E.isNullOrUndefined(n)?i-1:n)||n<0||isNaN(n)||(0!==i||E.isNullOrUndefined(this.hdrEle)||(this.hdrEle.style.display=""),E.isNullOrUndefined(this.bdrLine)||this.bdrLine.classList.add(I),this.tbItems=E.select("."+Hi,this.getTabHeader()),this.isAdd=!0,r=this.parseObject(e,n),this.isAdd=!1,o=0,e.forEach(function(e,t){var i,s;l=e.headerTemplate||e.header.text,E.isNullOrUndefined(e.headerTemplate||e.header)||E.isNullOrUndefined(l)||0===l.length&&!E.isNullOrUndefined(e.header)&&E.isNullOrUndefined(e.header.iconCss)||(r[t]&&(E.isNullOrUndefined(e.id)&&(e.id=Ci+a.tabId+"_"+Ki+(d+t).toString()),r[t].htmlAttributes["data-id"]=e.id),a.items.splice(n+o,0,e),o++),E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.text)||!a.isTemplate&&"Init"!==a.loadOn||(i=d+t,s=a.createElement("div",{id:S+a.tabId+"_"+i,className:Ci,attrs:{role:"tabpanel","aria-labelledby":Ci+"_"+i}}),a.cntEle.insertBefore(s,a.cntEle.children[n+t]),s=a.getTrgContent(a.cntEle,i.toString()),a.getContent(s,e.content,"render",n))}),this.tbObj.addItems(r,n),this.isReplace||this.trigger("added",{addedItems:e}),this.selectedItem===n?this.select(n):(this.setActiveBorder(),this.tbItem=E.selectAll("."+N,this.getTabHeader())),this.bindDraggable()))},h.prototype.removeTab=function(i){var e,s=this,n=E.selectAll("."+N,this.element)[i];E.isNullOrUndefined(n)||(e={removedItem:n,removedIndex:i,cancel:!1},this.trigger("removing",e,function(e){var t;e.cancel||(t=E.select("#"+Ci+s.tabId+"_"+s.extIndex(n.id),E.select("."+Hi,s.element)),E.isNullOrUndefined(t)||s.clearTabTemplate(t,"headerTemplate",N),s.tbObj.removeItems(i),s.allowDragAndDrop&&i!==Array.prototype.indexOf.call(s.itemIndexArray,n.id)&&(i=Array.prototype.indexOf.call(s.itemIndexArray,n.id)),t=s.itemIndexArray.indexOf(n.id),s.items.splice(t,1),s.itemIndexArray.splice(t,1),s.refreshActiveBorder(),t=E.select("#"+S+s.tabId+"_"+s.extIndex(n.id),E.select("."+S,s.element)),E.isNullOrUndefined(t)||(s.clearTabTemplate(t,"content",Ci),E.detach(t)),s.trigger("removed",e),s.draggableItems&&0<s.draggableItems.length&&(s.draggableItems[i].destroy(),s.draggableItems[i]=null,s.draggableItems.splice(i,1)),n.classList.contains(d)?(i=i>E.selectAll("."+N+":not(."+Ri+")",s.element).length-1?i-1:i,s.enableAnimation=!1,s.tbItem=E.selectAll("."+N,s.getTabHeader()),i=s.getSelectingTabIndex(i),i=!isNaN(i)&&0<=i&&s.tbItem.length>i?i:0,s.selectedItem=i,s.select(i)):i!==s.selectedItem&&(i<s.selectedItem&&(i=s.itemIndexArray.indexOf(s.tbItem[s.selectedItem].id),s.setProperties({selectedItem:-1<i?i:s.selectedItem},!0),s.prevIndex=s.selectedItem),s.tbItem=E.selectAll("."+N,s.getTabHeader())),0===E.selectAll("."+N,s.element).length&&(s.hdrEle.style.display="none"),s.enableAnimation=!0)}))},h.prototype.hideTab=function(e,t){var i,s=E.selectAll("."+N,this.element)[e];if(!E.isNullOrUndefined(s)){if(E.isNullOrUndefined(t)&&(t=!0),this.bdrLine.classList.add(I),!0===t)if(s.classList.add(I),0!==(i=E.selectAll("."+N+":not(."+I+")",this.tbItems)).length&&s.classList.contains(d)){if(0!==e)for(var n=e-1;0<=n;n--){if(!this.tbItem[n].classList.contains(I)){this.select(n);break}if(0===n)for(var r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(I)){this.select(r);break}}else for(r=e+1;r<this.tbItem.length;r++)if(!this.tbItem[r].classList.contains(I)){this.select(r);break}}else 0===i.length&&this.element.classList.add(I);else this.element.classList.remove(I),i=E.selectAll("."+N+":not(."+I+")",this.tbItems),s.classList.remove(I),0===i.length&&this.select(e);this.setActiveBorder(),E.isNullOrUndefined(this.items[e])||(this.items[e].visible=!t,this.dataBind()),E.isNullOrUndefined(s.firstElementChild)||s.firstElementChild.setAttribute("aria-hidden",""+t),"Popup"===this.overflowMode&&this.refreshOverflow()}},h.prototype.selectTab=function(e,t,i){void 0===t&&(t=null),this.isInteracted=i=void 0===i?!1:i,this.select(e,t)},h.prototype.select=function(t,e){var i=this,s=this.getTabHeader(),s=(this.tbItems=E.select("."+Hi,s),this.tbItem=E.selectAll("."+N,s),this.content=E.select("."+S,this.element),this.prevItem=this.tbItem[this.prevIndex],E.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),this.tbItem[t]),e=(E.isNullOrUndefined(s)?this.selectedID="0":this.selectingID=this.extIndex(s.id),E.isNullOrUndefined(this.prevItem)||this.prevItem.classList.contains(Ei)||this.prevItem.children.item(0).setAttribute("tabindex",this.prevItem.firstElementChild.getAttribute("tabindex")),{event:e,previousItem:this.prevItem,previousIndex:this.prevIndex,selectedItem:this.tbItem[this.selectedItem],selectedIndex:this.selectedItem,selectedContent:E.isNullOrUndefined(this.content)?null:E.select("#"+S+this.tabId+"_"+this.selectedID,this.content),selectingItem:s,selectingIndex:t,selectingContent:E.isNullOrUndefined(this.content)?null:E.select("#"+S+this.tabId+"_"+this.selectingID,this.content),isSwiped:this.isSwiped,isInteracted:this.isInteracted,cancel:!1});this.initRender?this.selectingContent(t,this.isInteracted):this.trigger("selecting",e,function(e){e.cancel||i.selectingContent(t,i.isInteracted)}),this.isInteracted=!1},h.prototype.getSelectingTabIndex=function(e){if(!E.isNullOrUndefined(this.tbItem[e])&&(this.tbItem[e].classList.contains(Ei)||this.tbItem[e].classList.contains(I)))for(var t=e+1;t<this.items.length;t++){if(!1===this.items[t].disabled&&!0===this.items[t].visible){e=t;break}e=0}return e},h.prototype.selectingContent=function(e,t){var i;"number"==typeof e?(e=this.getSelectingTabIndex(e),this.tbItem.length>e&&0<=e&&!isNaN(e)?(this.prevIndex=this.selectedItem,this.prevItem=this.tbItem[this.prevIndex],this.tbItem[e].classList.contains(Ri)&&this.reorderActiveTab?(this.setActive(this.popupHandler(this.tbItem[e]),null,t),!E.isNullOrUndefined(this.items)&&0<this.items.length&&this.allowDragAndDrop&&(this.tbItem=E.selectAll("."+Hi+" ."+N,this.hdrEle),i=this.items[e],this.items.splice(e,1),this.items.splice(this.tbItem.length-1,0,i),i=this.itemIndexArray[e],this.itemIndexArray.splice(e,1),this.itemIndexArray.splice(this.tbItem.length-1,0,i))):this.setActive(e,null,t)):this.setActive(0,null,t)):e instanceof HTMLElement&&this.setActive(this.getEleIndex(e),null,t)},h.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},h.prototype.disable=function(e){this.setCssClass(this.element,Ei,e),this.element.setAttribute("aria-disabled",""+e)},h.prototype.getPersistData=function(){return this.addOnPersist(["selectedItem","actEleId"])},h.prototype.getModuleName=function(){return"tab"},h.prototype.onPropertyChanged=function(e,t){for(var i=this,s=0,n=Object.keys(e).sort(function(e,t){return"items"===e?-1:"items"===t?1:0});s<n.length;s++)switch(n[s]){case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(e.width)});break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(e.height)}),this.setContentHeight(!1);break;case"cssClass":var r=this.element.querySelector("."+yi);""===t.cssClass||E.isNullOrUndefined(t.cssClass)?(this.setCssClass(this.element,e.cssClass,!0),E.isNullOrUndefined(r)||this.setCssClass(r,e.cssClass,!0)):(this.setCssClass(this.element,t.cssClass,!1),this.setCssClass(this.element,e.cssClass,!0),E.isNullOrUndefined(r)||(this.setCssClass(r,t.cssClass,!1),this.setCssClass(r,e.cssClass,!0)));break;case"items":this.evalOnPropertyChangeItems(e,t);break;case"showCloseButton":this.setCloseButton(e.showCloseButton);break;case"reorderActiveTab":this.refreshActiveTabBorder();break;case"selectedItem":this.selectedItem=t.selectedItem,this.select(e.selectedItem);break;case"headerPlacement":this.changeOrientation(e.headerPlacement);break;case"enableRtl":this.setRTL(e.enableRtl);break;case"overflowMode":this.tbObj.overflowMode=e.overflowMode,this.tbObj.dataBind(),this.refreshActiveTabBorder();break;case"heightAdjustMode":this.setContentHeight(!1),this.select(this.selectedItem);break;case"scrollStep":this.tbObj&&(this.tbObj.scrollStep=this.scrollStep);break;case"allowDragAndDrop":this.bindDraggable();break;case"swipeMode":this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.bindSwipeEvents();break;case"dragArea":this.allowDragAndDrop&&(this.draggableItems.forEach(function(e){e.dragArea=i.dragArea}),this.refresh())}},h.prototype.refreshActiveTab=function(){var e,t,i,s,n,r,o,l,a;this.isReact&&this.isTemplate&&this.clearTemplate(),this.isTemplate?(e=this.element.querySelector("."+Hi),l=this.element.querySelector("."+N+"."+d),t=this.getIndexFromEle(l.id),n=l.innerText,s=(r=this.element.querySelector("."+S).querySelector("."+d).children[0]).innerHTML,E.detach(l),E.detach(r),r={className:N+" "+Si+" "+d,id:Ci+this.tabId+"_"+t},n=this.createElement("span",{className:Ai,innerHTML:n,attrs:{role:"presentation"}}).outerHTML,n=this.createElement("div",{className:Di,innerHTML:n+this.btnCls.outerHTML}).outerHTML,l=l.firstElementChild.getAttribute("data-tabindex"),n=this.createElement("div",{className:Pi,innerHTML:n,attrs:{tabIndex:l,"data-tabindex":l,role:"tab","aria-controls":S+this.tabId+"_"+t,"aria-selected":"true","aria-disabled":"false"}}),e.insertBefore(this.createElement("div",r),e.children[t+1]),this.element.querySelector("."+N+"."+d).appendChild(n),r=this.createElement("div",{innerHTML:s}),this.element.querySelector("."+S).querySelector("."+d).appendChild(r)):this.element.querySelector("."+N+"."+d)&&(E.detach(this.element.querySelector("."+N+"."+d).children[0]),E.detach(this.element.querySelector("."+S).querySelector("."+d).children[0]),e=this.items[this.selectedItem],t=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconPosition)?"":e.header.iconPosition,n=E.isNullOrUndefined(e.header)||E.isNullOrUndefined(e.header.iconCss)?"":e.header.iconCss,s=e.headerTemplate||e.header.text,a=this.createElement("div",{className:Ai,attrs:{role:"presentation"}}),E.isNullOrUndefined(s.tagName)?this.headerTextCompile(a,s,this.selectedItem):a.appendChild(s),o=this.createElement("span",{className:Ni+" "+Mi+" "+Oi+"-"+t+" "+n}),(i=this.createElement("div",{className:Di})).appendChild(a),""!==s&&void 0!==s&&""!==n?("left"===t||"top"===t?i.insertBefore(o,i.firstElementChild):i.appendChild(o),this.isIconAlone=!1):(""===n?a:o)===o&&(E.detach(a),i.appendChild(o),this.isIconAlone=!0),l=E.isNullOrUndefined(e.tabIndex)?"-1":e.tabIndex.toString(),s=e.disabled?{}:{tabIndex:l,"data-tabindex":l,role:"tab","aria-selected":"true","aria-disabled":"false"},i.appendChild(this.btnCls.cloneNode(!0)),(n=this.createElement("div",{className:Pi,attrs:s})).appendChild(i),"top"!==t&&"bottom"!==t||this.element.classList.add("e-vertical-icon"),this.element.querySelector("."+N+"."+d).appendChild(n),r=this.createElement("div"),a=void 0,"string"==typeof(o=e.content)||E.isNullOrUndefined(o.innerHTML)?("."===(o="string"==typeof o&&this.enableHtmlSanitizer?E.SanitizeHtmlHelper.sanitize(o):o)[0]||"#"===o[0])&&document.querySelectorAll(o).length?(a=(l=document.querySelector(o)).outerHTML.trim(),r.appendChild(l),l.style.display=""):this.compileElement(r,o,"content",this.selectedItem):r.appendChild(o),E.isNullOrUndefined(a)||-1===this.templateEle.indexOf(o.toString())&&this.templateEle.push(o.toString()),this.element.querySelector(".e-item."+d).appendChild(r)),this.isReact&&this.renderReactTemplates()},h.prototype.refreshActiveTabBorder=function(){"None"===this.heightAdjustMode&&"auto"!==this.height&&this.cntEle&&!this.isVertical()&&(e=this.getTabHeader(),E.setStyleAttribute(this.cntEle,{height:this.element.clientHeight-e.offsetHeight+"px"}));var e=E.select("."+N+"."+Ri+"."+d,this.element);!E.isNullOrUndefined(e)&&this.reorderActiveTab&&this.select(this.getEleIndex(e)),this.refreshActiveBorder()},l([E.Collection([],ss)],h.prototype,"items",void 0),l([E.Property("100%")],h.prototype,"width",void 0),l([E.Property("Both")],h.prototype,"swipeMode",void 0),l([E.Property("auto")],h.prototype,"height",void 0),l([E.Property("")],h.prototype,"cssClass",void 0),l([E.Property(0)],h.prototype,"selectedItem",void 0),l([E.Property("Top")],h.prototype,"headerPlacement",void 0),l([E.Property("Content")],h.prototype,"heightAdjustMode",void 0),l([E.Property("Scrollable")],h.prototype,"overflowMode",void 0),l([E.Property("Demand")],h.prototype,"loadOn",void 0),l([E.Property(!1)],h.prototype,"enablePersistence",void 0),l([E.Property(!0)],h.prototype,"enableHtmlSanitizer",void 0),l([E.Property(!1)],h.prototype,"showCloseButton",void 0),l([E.Property(!0)],h.prototype,"reorderActiveTab",void 0),l([E.Property()],h.prototype,"scrollStep",void 0),l([E.Property()],h.prototype,"dragArea",void 0),l([E.Property(!1)],h.prototype,"allowDragAndDrop",void 0),l([E.Property(!0)],h.prototype,"clearTemplates",void 0),l([E.Complex({},Ji)],h.prototype,"animation",void 0),l([E.Event()],h.prototype,"created",void 0),l([E.Event()],h.prototype,"adding",void 0),l([E.Event()],h.prototype,"added",void 0),l([E.Event()],h.prototype,"selecting",void 0),l([E.Event()],h.prototype,"selected",void 0),l([E.Event()],h.prototype,"removing",void 0),l([E.Event()],h.prototype,"removed",void 0),l([E.Event()],h.prototype,"onDragStart",void 0),l([E.Event()],h.prototype,"dragging",void 0),l([E.Event()],h.prototype,"dragged",void 0),l([E.Event()],h.prototype,"destroyed",void 0);var rs,ci=l([E.NotifyPropertyChanges],h);function h(e,t){e=rs.call(this,e,t)||this;return e.show={},e.hide={},e.maxHeight=0,e.title="Close",e.isInteracted=!1,e.lastIndex=0,e.isAdd=!1,e.isIconAlone=!1,e.draggableItems=[],e.resizeContext=e.refreshActiveTabBorder.bind(e),e.keyConfigs={tab:"tab",home:"home",end:"end",enter:"enter",space:"space",delete:"delete",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"},e}os=function(e,t){return(os=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var os,ls,l=function(e,t){function i(){this.constructor=e}os(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},c=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},as="e-treeview",ds="e-control",u="e-icon-collapsible",O="e-icon-expandable",w="e-list-item",hs="e-list-text",L="e-list-parent",cs="e-hover",ps="e-active",us="e-icons-spinner",ms="e-process",fs="e-icons",gs="e-text-content",vs="e-input",ys="e-input-group",bs="e-tree-input",Cs="e-editing",Ss="e-interaction",Is="e-droppable",Es="e-dragging",xs="e-sibling",Ns="e-drop-in",Os="e-drop-next",ws="e-drop-out",Ls="e-no-drop",ks="e-fullrow",As="e-selected",Ts="e-expanded",Ps="e-node-collapsed",Ds="e-disable",Ms="e-check",Hs="e-stop",Us="e-treeview-checkbox",Rs="e-frame",Bs="e-ripple",js="e-node-focus",qs="e-list-img",Fs="e-animation-active",Ws="e-disabled",Vs="e-prevent",_s={treeRole:"group",itemRole:"treeitem",listRole:"group",itemText:"",wrapperRole:""},zs=(ls=E.ChildProperty,l(Ks,ls),c([E.Property("child")],Ks.prototype,"child",void 0),c([E.Property([])],Ks.prototype,"dataSource",void 0),c([E.Property("expanded")],Ks.prototype,"expanded",void 0),c([E.Property("hasChildren")],Ks.prototype,"hasChildren",void 0),c([E.Property("htmlAttributes")],Ks.prototype,"htmlAttributes",void 0),c([E.Property("iconCss")],Ks.prototype,"iconCss",void 0),c([E.Property("id")],Ks.prototype,"id",void 0),c([E.Property("imageUrl")],Ks.prototype,"imageUrl",void 0),c([E.Property("isChecked")],Ks.prototype,"isChecked",void 0),c([E.Property("parentID")],Ks.prototype,"parentID",void 0),c([E.Property(null)],Ks.prototype,"query",void 0),c([E.Property("selectable")],Ks.prototype,"selectable",void 0),c([E.Property("selected")],Ks.prototype,"selected",void 0),c([E.Property(null)],Ks.prototype,"tableName",void 0),c([E.Property("text")],Ks.prototype,"text",void 0),c([E.Property("tooltip")],Ks.prototype,"tooltip",void 0),c([E.Property("navigateUrl")],Ks.prototype,"navigateUrl",void 0),Ks);function Ks(){return null!==ls&&ls.apply(this,arguments)||this}Xs=E.ChildProperty,l(Gs,Xs),c([E.Property("SlideDown")],Gs.prototype,"effect",void 0),c([E.Property(400)],Gs.prototype,"duration",void 0),c([E.Property("linear")],Gs.prototype,"easing",void 0);var Xs,Ys=Gs;function Gs(){return null!==Xs&&Xs.apply(this,arguments)||this}Qs=E.ChildProperty,l(Zs,Qs),c([E.Complex({effect:"SlideUp",duration:400,easing:"linear"},Ys)],Zs.prototype,"collapse",void 0),c([E.Complex({effect:"SlideDown",duration:400,easing:"linear"},Ys)],Zs.prototype,"expand",void 0);var Qs,Js=Zs;function Zs(){return null!==Qs&&Qs.apply(this,arguments)||this}$s=E.Component,l(p,$s),(en=p).prototype.getModuleName=function(){return"treeview"},p.prototype.preRender=function(){var t=this;this.checkActionNodes=[],this.parentNodeCheck=[],this.dragStartAction=!1,this.isAnimate=!1,this.keyConfigs={escape:"escape",end:"end",enter:"enter",f2:"f2",home:"home",moveDown:"downarrow",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",ctrlDown:"ctrl+downarrow",ctrlUp:"ctrl+uparrow",ctrlEnter:"ctrl+enter",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",ctrlA:"ctrl+A",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftEnter:"shift+enter",shiftHome:"shift+home",shiftEnd:"shift+end",csDown:"ctrl+shift+downarrow",csUp:"ctrl+shift+uparrow",csEnter:"ctrl+shift+enter",csHome:"ctrl+shift+home",csEnd:"ctrl+shift+end",space:"space",shiftSpace:"shift+space",ctrlSpace:"ctrl+space"},this.listBaseOption={expandCollapse:!0,showIcon:!0,expandIconClass:O,ariaAttributes:_s,expandIconPosition:"Left",itemCreated:function(e){t.beforeNodeCreate(e)},enableHtmlSanitizer:this.enableHtmlSanitizer,itemNavigable:this.fullRowNavigable},this.updateListProp(this.fields),this.aniObj=new E.Animation({}),this.treeList=[],this.isLoaded=!1,this.isInitalExpand=!1,this.expandChildren=[],this.index=0,this.setTouchClass(),this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource)),E.isNullOrUndefined(this.selectedNodes)&&this.setProperties({selectedNodes:[]},!0),E.isNullOrUndefined(this.checkedNodes)&&this.setProperties({checkedNodes:[]},!0),E.isNullOrUndefined(this.expandedNodes)?this.setProperties({expandedNodes:[]},!0):this.isInitalExpand=!0},p.prototype.getPersistData=function(){return this.addOnPersist(["selectedNodes","checkedNodes","expandedNodes"])},p.prototype.render=function(){this.initialRender=!0,this.initialize(),this.setDataBinding(!1),this.setDisabledMode(),this.setExpandOnType(),this.disabled||this.setRipple(),this.wireEditingEvents(this.allowEditing),this.setDragAndDrop(this.allowDragAndDrop),this.disabled||this.wireEvents(),this.initialRender=!1,this.renderComplete()},p.prototype.initialize=function(){this.element.setAttribute("role","tree"),this.element.setAttribute("aria-activedescendant",this.element.id+"_active"),this.setCssClass(null,this.cssClass),this.setEnableRtl(),this.setFullRow(this.fullRowSelect),this.setTextWrap(),this.nodeTemplateFn=this.templateComplier(this.nodeTemplate)},p.prototype.setDisabledMode=function(){this.disabled?(this.element.classList.add(Ws),this.element.setAttribute("aria-disabled","true")):(this.element.classList.remove(Ws),this.element.setAttribute("aria-disabled","false"))},p.prototype.setEnableRtl=function(){(this.enableRtl?E.addClass:E.removeClass)([this.element],"e-rtl")},p.prototype.setRipple=function(){this.rippleFn=E.rippleEffect(this.element,{selector:".e-fullrow,.e-text-content",ignore:"."+gs+" > ."+fs+",."+ys+",."+vs+", ."+Us});var e={selector:"."+gs+" > ."+fs,isCenterRipple:!0};this.rippleIconFn=E.rippleEffect(this.element,e)},p.prototype.setFullRow=function(e){(e?E.addClass:E.removeClass)([this.element],"e-fullrow-wrap")},p.prototype.setMultiSelect=function(e){e?this.element.setAttribute("aria-multiselectable","true"):this.element.setAttribute("aria-multiselectable","false")},p.prototype.templateComplier=function(t){if(t){this.hasTemplate=!0,this.element.classList.add(Ss);try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}}this.element.classList.remove(Ss)},p.prototype.setDataBinding=function(t){var i=this;this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager?(this.isOffline=this.fields.dataSource.dataSource.offline,this.fields.dataSource.ready?this.fields.dataSource.ready.then(function(e){i.isOffline=i.fields.dataSource.dataSource.offline,i.fields.dataSource instanceof x.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(e){i.treeList.pop(),i.treeData=e.result,i.isNumberTypeId=i.getType(),i.setRootData(),t&&(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(),E.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()},p.prototype.getQuery=function(e,t){void 0===t&&(t=null);var i=[];if(e.query)s=e.query.clone();else{for(var s=new x.Query,n=this.getActualProperties(e),r=0,o=Object.keys(n);r<o.length;r++){var l=o[r];"dataSource"!==l&&"tableName"!==l&&"child"!==l&&e[""+l]&&"url"!==l&&-1===i.indexOf(e[""+l])&&i.push(e[""+l])}s.select(i),Object.prototype.hasOwnProperty.call(n,"tableName")&&s.from(e.tableName)}return U.ListBase.addSorting(this.sortOrder,e.text,s),E.isNullOrUndefined(t)||E.isNullOrUndefined(e.parentID)||s.where(e.parentID,"equal",this.isNumberTypeId?parseFloat(t):t),s},p.prototype.getType=function(){return!!this.treeData[0]&&"number"==typeof E.getValue(this.fields.id,this.treeData[0])},p.prototype.setRootData=function(){var e;this.dataType=this.getDataType(this.treeData,this.fields),1===this.dataType?(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID),e=this.getChildNodes(this.treeData,void 0,!0),E.isNullOrUndefined(e)?this.rootData=[]:this.rootData=e):this.rootData=this.treeData},p.prototype.isChildObject=function(){return"object"==typeof this.fields.child},p.prototype.renderItems=function(e){this.listBaseOption.ariaAttributes.level=1;var t=this.getSortedData(this.rootData),i=(this.ulElement=U.ListBase.createList(this.createElement,e?this.rootData:t,this.listBaseOption),this.element.appendChild(this.ulElement),this.ulElement.querySelectorAll(".e-list-item"));if(!1===this.loadOnDemand)for(var s=0;s<i.length;)this.renderChildNodes(i[parseInt(s.toString(),10)],!0,null,!0),s++;(1===E.selectAll("."+L,this.element).length&&i&&0!==i.length||this.loadOnDemand)&&this.finalizeNode(this.element),this.parentNodeCheck=[],this.parentCheckData=[],this.updateCheckedStateFromDS(),this.autoCheck&&this.showCheckBox&&!this.isLoaded&&this.updateParentCheckState()},p.prototype.updateCheckedStateFromDS=function(){if(this.validNodes=[],this.treeData&&this.showCheckBox){if(1===this.dataType){for(var e=this.fields,t=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.isChecked,"equal",!0,!1)),i=0;i<t.length;i++){var s=t[parseInt(i.toString(),10)][this.fields.id]?t[parseInt(i.toString(),10)][this.fields.id].toString():null;if(-1!==this.checkedNodes.indexOf(s)||this.isLoaded||this.checkDisabledState(s,t[i]),t[parseInt(i.toString(),10)][this.fields.hasChildren])for(var s=t[parseInt(i.toString(),10)][this.fields.id],n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.parentID,"equal",s,!1)),r=0;r<n.length;r++){var o=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(o)&&this.autoCheck&&this.checkDisabledState(o,n[r])}}for(i=0;i<this.checkedNodes.length;i++)for(var l=this.fields,a=new x.DataManager(this.treeData).executeLocal((new x.Query).where(l.id,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0)),d=(a[0]&&this.autoCheck&&(this.getCheckedNodeDetails(l,a),this.checkIndeterminateState(a[0])),0<a.length&&(c=a[0][this.fields.id]?a[0][this.fields.id].toString():null,-1<this.checkedNodes.indexOf(c))&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c),new x.DataManager(this.treeData).executeLocal((new x.Query).where(l.parentID,"equal",this.checkedNodes[parseInt(i.toString(),10)],!0))),h=0;h<d.length;h++){var c=d[parseInt(h.toString(),10)][this.fields.id]?d[parseInt(h.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.autoCheck&&this.checkDisabledState(c,d[h]),-1<this.checkedNodes.indexOf(c)&&-1===this.validNodes.indexOf(c)&&this.validNodes.push(c)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline){for(h=0;h<this.treeData.length;h++){var p=this.treeData[parseInt(h.toString(),10)][this.fields.id]?this.treeData[parseInt(h.toString(),10)][this.fields.id].toString():"",p=(this.treeData[parseInt(h.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(p)&&this.checkDisabledState(p,this.treeData[h]),-1<this.checkedNodes.indexOf(p)&&-1===this.validNodes.indexOf(p)&&this.validNodes.push(p),E.getValue(this.fields.child.toString(),this.treeData[parseInt(h.toString(),10)]));p&&this.updateChildCheckState(p,this.treeData[parseInt(h.toString(),10)])}this.validNodes=this.enablePersistence?this.checkedNodes:this.validNodes}this.setProperties({checkedNodes:this.validNodes},!0)}},p.prototype.getCheckedNodeDetails=function(e,t){var i=t[0][this.fields.parentID]?t[0][this.fields.parentID].toString():null,s=0,n=this.element.querySelector('[data-uid="'+t[0][this.fields.id]+'"]'),t=this.element.querySelector('[data-uid="'+t[0][this.fields.parentID]+'"]');if(n||t)t&&!E.select("."+Ms,t)&&this.changeState(t,"indeterminate",null,!0,!0);else{-1===this.parentNodeCheck.indexOf(i)&&this.parentNodeCheck.push(i);for(var r=this.getChildNodes(this.treeData,i),o=0;o<r.length;o++){var l=r[parseInt(o.toString(),10)][this.fields.id]?r[parseInt(o.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(l)&&s++,s===r.length&&-1===this.checkedNodes.indexOf(i)&&this.checkDisabledState(i)}n=new x.DataManager(this.treeData).executeLocal((new x.Query).where(e.id,"equal",i,!0));this.getCheckedNodeDetails(e,n)}},p.prototype.updateParentCheckState=function(){var i,e=E.selectAll("."+Hs,this.element),t=this.treeData;this.element.classList.contains("e-filtering")&&(t=this.DDTTreeData);for(var s=0;s<e.length;s++){var n=E.closest(e[parseInt(s.toString(),10)],"."+w),r=n.getAttribute("data-uid").toString(),o=void 0,l=(this.element.classList.contains("e-filtering")&&(o=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",r,!0))),i=1===this.dataType?new x.DataManager(t).executeLocal((new x.Query).where(this.fields.parentID,"equal",r,!0)):this.getChildNodes(t,r),0);if(i){for(var a=this,d=0;d<i.length;d++)!function(e){var t=i[parseInt(e.toString(),10)][a.fields.id].toString();(-1!==a.checkedNodes.indexOf(t)||a.element.classList.contains("e-filtering")&&-1!==o.findIndex(function(e){return e.id===t}))&&l++}(d);l===i.length?(r=n.getAttribute("data-uid"),-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r),this.changeState(n,"check",null,!0,!0)):0===l&&0===this.checkedNodes.length&&this.changeState(n,"uncheck",null,!0,!0)}}},p.prototype.checkIndeterminateState=function(e){var t=1===this.dataType?this.element.querySelector('[data-uid="'+e[this.fields.parentID]+'"]'):this.element.querySelector('[data-uid="'+e[this.fields.id]+'"]');t?"true"!==t.getAttribute("aria-checked")&&this.changeState(t,"indeterminate",null,!0,!0):2===this.dataType&&-1===this.parentNodeCheck.indexOf(e[this.fields.id].toString())&&this.parentNodeCheck.push(e[this.fields.id].toString())},p.prototype.updateChildCheckState=function(e,t){for(var i=0,s=t[this.fields.id]?t[this.fields.id].toString():"",n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",r=(e[parseInt(n.toString(),10)][this.fields.isChecked]&&!this.isLoaded&&-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(s)&&-1===this.checkedNodes.indexOf(r)&&this.autoCheck&&this.checkDisabledState(r,e[n]),-1!==this.checkedNodes.indexOf(r)&&this.autoCheck&&i++,-1<this.checkedNodes.indexOf(r)&&-1===this.validNodes.indexOf(r)&&this.validNodes.push(r),E.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]));r&&r.length&&(-1===this.parentCheckData.indexOf(t)&&this.parentCheckData.push(t),this.updateChildCheckState(r,e[parseInt(n.toString(),10)])),i===e.length&&this.autoCheck&&-1===this.checkedNodes.indexOf(s)&&this.checkDisabledState(s,t)}if(0!==i&&this.autoCheck){this.checkIndeterminateState(t);for(var o=0;o<this.parentCheckData.length;o++)t!==this.parentCheckData[parseInt(o.toString(),10)]&&this.parentCheckData[parseInt(o.toString(),10)]&&this.checkIndeterminateState(this.parentCheckData[parseInt(o.toString(),10)])}this.parentCheckData=[]},p.prototype.beforeNodeCreate=function(e){this.showCheckBox&&((t=R.createCheckBox(this.createElement,!0,{cssClass:this.touchClass})).classList.add(Us),s=E.select("div."+O+", div."+u,e.item),i=e.item.getAttribute("data-uid"),e.item.childNodes[0].insertBefore(t,e.item.childNodes[0].childNodes[E.isNullOrUndefined(s)?0:1]),s=E.getValue(e.fields.isChecked,e.curData),!(-1<this.checkedNodes.indexOf(i))&&(E.isNullOrUndefined(s)||"true"!==s.toString())?e.item.setAttribute("aria-checked","false"):(E.select("."+Rs,t).classList.add(Ms),e.item.setAttribute("aria-checked","true"),this.addCheck(e.item)),i=E.select("."+Rs,t),E.EventHandler.add(i,"mousedown",this.frameMouseHandler,this),E.EventHandler.add(i,"mouseup",this.frameMouseHandler,this)),this.fullRowSelect&&this.createFullRow(e.item),this.allowMultiSelection&&!e.item.classList.contains(As)&&e.item.setAttribute("aria-selected","false");var t,i,s=e.fields,s=(this.addActionClass(e,s.selected,As),this.addActionClass(e,s.expanded,Ts),e.item.setAttribute("tabindex","-1"),E.EventHandler.add(e.item,"focus",this.focusIn,this),E.isNullOrUndefined(this.nodeTemplateFn)||(t=e.item.querySelector("."+hs),i=e.item.getAttribute("data-uid"),t.innerHTML="",this.renderNodeTemplate(e.curData,t,i)),{node:e.item,nodeData:e.curData,text:e.text});this.isRefreshed||(this.trigger("drawNode",s),!1!==e.curData[this.fields.selectable])||this.showCheckBox||(e.item.classList.add(Vs),e.item.firstElementChild.setAttribute("style","cursor: not-allowed"))},p.prototype.frameMouseHandler=function(e){var t=E.select(".e-ripple-container",e.target.parentElement);R.rippleMouseHandler(e,t)},p.prototype.addActionClass=function(e,t,i){var s=e.curData,t=E.getValue(t,s);E.isNullOrUndefined(t)||"false"===t.toString()||e.item.classList.add(i)},p.prototype.getDataType=function(e,t){if(this.fields.dataSource instanceof x.DataManager){for(var i=0;i<e.length;i++)if(this.isOffline){if("string"==typeof t.child&&E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)]))&&!E.isNullOrUndefined(E.getValue(t.parentID,e[parseInt(i.toString(),10)])))return 1}else if("string"==typeof t.child&&E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)])))return 1;return 2}for(var i=0,s=e.length;i<s;i++){if("string"==typeof t.child&&(!E.isNullOrUndefined(E.getValue(t.child,e[parseInt(i.toString(),10)]))||Object.prototype.hasOwnProperty.call(e[parseInt(i.toString(),10)],t.child)))return 2;if(this.isChildObject())return 2;if(!E.isNullOrUndefined(E.getValue(t.parentID,e[parseInt(i.toString(),10)]))||!E.isNullOrUndefined(E.getValue(t.hasChildren,e[parseInt(i.toString(),10)])))return 1}return 1},p.prototype.getGroupedData=function(e,t){for(var t=(new x.Query).group(t),i=U.ListBase.getDataSource(e,t),s=[],n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].items;s.push(r)}return s},p.prototype.getSortedData=function(e){return e=e&&"None"!==this.sortOrder?U.ListBase.getDataSource(e,U.ListBase.addSorting(this.sortOrder,this.fields.text)):e},p.prototype.finalizeNode=function(e,t,i){var s=this;if(t||this.updateAttributes(e),!i){var n=E.selectAll("."+Ts,e);if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[s.fields.expanded]}).length||this.isInitalExpand),!this.isInitalExpand)for(var r=0;r<n.length;r++)this.renderChildNodes(n[parseInt(r.toString(),10)]);E.removeClass(n,Ts)}t||this.updateList(),this.isLoaded&&this.updateCheckedProp()},p.prototype.updateAttributes=function(e){for(var t=E.selectAll("."+qs,e),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].setAttribute("alt",qs);if(this.isLoaded){for(var s=E.selectAll("."+As,e),n=0;n<s.length;n++){this.selectNode(s[parseInt(n.toString(),10)],null);break}E.removeClass(s,As)}for(var r=E.selectAll("."+w+":not(."+Ts+")",e),o=0;o<r.length;o++){var l=E.select("div."+fs,r[parseInt(o.toString(),10)]);l&&l.classList.contains(O)&&this.disableExpandAttr(r[parseInt(o.toString(),10)])}},p.prototype.updateCheckedProp=function(){var e;this.showCheckBox&&(e=[].concat([],this.checkedNodes),this.setProperties({checkedNodes:e},!0))},p.prototype.ensureIndeterminate=function(){if(this.autoCheck)for(var e=E.selectAll("li",this.element),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].classList.contains(w)&&(E.select("."+L,e[parseInt(t.toString(),10)])?this.ensureParentCheckState(e[parseInt(t.toString(),10)]):this.ensureChildCheckState(e[parseInt(t.toString(),10)]));else for(var i=E.selectAll("."+Hs,this.element),t=0;t<i.length;t++)i[parseInt(t.toString(),10)].classList.remove(Hs)},p.prototype.ensureParentCheckState=function(e){var t,i,s,n,r,o,l,a,d,h,c;E.isNullOrUndefined(e)||e.classList.contains(as)||((o=e).classList.contains(w)&&(o=E.select("."+L,e)),l=E.selectAll("."+Us+" ."+Ms,o),t=E.selectAll("."+Hs,o),o=E.selectAll(this.checkDisabledChildren?"."+w:"."+w+":not(."+Ds+")",o),i=e.getElementsByClassName(Us)[0],c=o.length,l=l.length,a=[],d=[],s=e.getAttribute("data-uid"),r=!(n=!0),o.forEach(function(e){e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")?r=!0:n=!1)}),o=!1,this.element.classList.contains("e-filtering")&&(l=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("parentID","equal",s,!0)).length,0<(h=new x.DataManager(this.OldCheckedData).executeLocal((new x.Query).where("hasChildren","equal",!0,!0))).length&&this.OldCheckedData.some(function(e){return e.id===s})&&r&&(l=h.length,o=!0),c=(1===this.dataType?new x.DataManager(this.DDTTreeData).executeLocal((new x.Query).where(this.fields.parentID,"equal",s,!0)):this.getChildNodes(this.DDTTreeData,s)).length),!this.autoCheck||!this.showCheckBox||this.fields.dataSource instanceof x.DataManager||(a=this.getSelectedChildNodeDetails(s),d=new x.DataManager(this.checkActionNodes).executeLocal((new x.Query).where("parentID","equal",s,!0))),0===c&&0===l)||(c===l||o&&0<c&&d.length===a.length&&0!==d.length&&0!==a.length&&n&&this.autoCheck&&this.showCheckBox?this.changeState(i,"check",null,!0,!0):0<l&&!o&&this.autoCheck&&this.showCheckBox||0<l||0<t.length?this.changeState(i,"indeterminate",null,!0,!0):0===l&&this.changeState(i,"uncheck",null,!0,!0),h=E.closest(e,"."+L),E.isNullOrUndefined(h))||(c=E.closest(h,"."+w),this.ensureParentCheckState(c))},p.prototype.getSelectedChildNodeDetails=function(t){var i=this;return this.checkedNodes.map(function(e){return new x.DataManager(i.DDTTreeData).executeLocal((new x.Query).where("id","equal",e,!0))[0]}).filter(function(e){if(e&&"object"==typeof e&&"pid"in e){e=e.pid;if(!E.isNullOrUndefined(e))return e.toString()===t}return!1})},p.prototype.ensureChildCheckState=function(e,t,i){var s=this;if(!E.isNullOrUndefined(e)){var n=E.select("."+L,e),r=void 0;if(!E.isNullOrUndefined(n)){var o=Array.from(n.querySelectorAll("li")),r=E.selectAll("."+Us,n);this.isFilter&&(r=Array.from(r).filter(function(e){e=e.closest("li").getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),o=Array.from(o).filter(function(e){e=e.getAttribute("data-uid");return null!==e&&-1!==s.checkedNodes.indexOf(e)}),0===r.length)&&(r=E.selectAll("."+Us,n),o=Array.from(n.querySelectorAll("li")));for(var l=e.getElementsByClassName(Rs)[0].classList.contains(Ms),a=e.getElementsByClassName(Rs)[0].classList.contains(Hs),d=void 0,h=0;h<r.length;h++){var c,p=o[parseInt(h.toString(),10)].getAttribute("data-uid");E.isNullOrUndefined(this.currentLoadData)||E.isNullOrUndefined(E.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)]))?(c=r[parseInt(h.toString(),10)].getElementsByClassName(Rs)[0].classList.contains(Ms),l||c&&!this.isLoaded||-1!==this.checkedNodes.indexOf(p)&&this.isLoaded&&(a||l)?d="check":o[parseInt(h.toString(),10)].classList.contains("e-has-child")&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||a)&&-1!==this.parentNodeCheck.indexOf(p)||1===this.dataType&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&(l||a)&&-1!==this.parentNodeCheck.indexOf(p)?(d="indeterminate",this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1)):d="uncheck"):(d=E.getValue(this.fields.isChecked,this.currentLoadData[parseInt(h.toString(),10)])?"check":"uncheck","uncheck"===(d=-1!==this.ele?l?"check":"uncheck":d)&&!E.isUndefined(this.parentNodeCheck)&&this.autoCheck&&-1!==this.parentNodeCheck.indexOf(p)&&(this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(p),1),d="indeterminate")),this.changeState(r[parseInt(h.toString(),10)],d,t,!0,!0)}}this.autoCheck&&this.isLoaded&&!i&&this.updateParentCheckState()}},p.prototype.doCheckBoxAction=function(e,t){if(E.isNullOrUndefined(e)){var i=E.selectAll("."+Us,this.element);if(this.loadOnDemand)for(var s=0;s<i.length;s++)this.updateFieldChecked(i[parseInt(s.toString(),10)],t),this.changeState(i[parseInt(s.toString(),10)],t?"check":"uncheck",null,null,null,t);else for(s=0;s<i.length;s++)this.updateFieldChecked(i[parseInt(s.toString(),10)],t),this.changeState(i[parseInt(s.toString(),10)],t?"check":"uncheck")}else{e.reverse();for(var n=e.length-1;0<=n;n--){var r=this.getElement(e[parseInt(n.toString(),10)]);if(E.isNullOrUndefined(r)){if(""!==(c=e[n-e.length]?e[n-e.length].toString():e[parseInt(n.toString(),10)]?e[parseInt(n.toString(),10)].toString():null)&&t&&c)this.setValidCheckedNode(c,e),this.dynamicCheckState(c,t);else if(-1!==this.checkedNodes.indexOf(c)&&""!==c&&!t){this.checkedNodes.splice(this.checkedNodes.indexOf(c),1);var o=this.getChildNodes(this.treeData,c);if(o){for(var l=0;l<o.length;l++){var a=o[parseInt(l.toString(),10)][this.fields.id]?o[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(a)&&(this.checkedNodes.splice(this.checkedNodes.indexOf(a),1),a=this.element.querySelector('[data-uid="'+a+'"]'))&&this.changeState(a,"uncheck",null)}-1!==this.parentNodeCheck.indexOf(c)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(c),1)}c&&this.dynamicCheckState(c,t),this.updateField(this.treeData,this.fields,c,"isChecked",null)}}else{var d=E.select("."+L+" ."+Us,r);this.validateCheckNode(d,!t,r,null)}}}if(e)for(var h=0;h<e.length-1;h++){var c=e[parseInt(h.toString(),10)]?e[parseInt(h.toString(),10)].toString():"";t||this.updateField(this.treeData,this.fields,c,"isChecked",null)}this.autoCheck&&this.updateParentCheckState()},p.prototype.updateFieldChecked=function(e,t){var e=E.closest(e,"."+w),i=e.getAttribute("data-uid");"true"!==this.getNodeData(e).isChecked||t||this.updateField(this.treeData,this.fields,i,"isChecked",null)},p.prototype.dynamicCheckState=function(e,t){if(1===this.dataType){var i=0,s=new x.DataManager(this.treeData).executeLocal((new x.Query).where(this.fields.id,"equal",e,!0));if(s[0]){var n=s[0][this.fields.id]?s[0][this.fields.id].toString():null,s=s[0][this.fields.parentID]?s[0][this.fields.parentID].toString():null,r=this.element.querySelector('[data-uid="'+s+'"]'),o=this.element.querySelector('[data-uid="'+n+'"]'),l=this.getChildNodes(this.treeData,s);if(l)for(var a=0;a<l.length;a++){var d=l[parseInt(a.toString(),10)][this.fields.id]?l[parseInt(a.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(d)&&i++}-1!==this.checkedNodes.indexOf(e)&&r&&n===e&&this.autoCheck?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&o&&n===e&&!t?this.changeState(o,"uncheck",null):-1!==this.checkedNodes.indexOf(e)&&o&&n===e&&t?this.changeState(o,"check",null):-1===this.checkedNodes.indexOf(e)&&!o&&r&&n===e&&this.autoCheck&&0!==i?this.changeState(r,"indeterminate",null):-1===this.checkedNodes.indexOf(e)&&!o&&r&&n===e&&this.autoCheck&&0===i?this.changeState(r,"uncheck",null):o||r||n!==e||!this.autoCheck||this.updateIndeterminate(e,t)}}else if(2===this.dataType||this.fields.dataSource instanceof x.DataManager&&this.isOffline)for(n=void 0,r=void 0,a=0;a<this.treeData.length;a++){n=this.treeData[parseInt(a.toString(),10)][this.fields.id]?this.treeData[parseInt(a.toString(),10)][this.fields.id].toString():"",h=(r=this.element.querySelector('[data-uid="'+n+'"]'))?E.select("."+Ms,r):null,-1===this.checkedNodes.indexOf(n)&&r&&h&&!t&&this.changeState(r,"uncheck",null);var h=E.getValue(this.fields.child.toString(),this.treeData[parseInt(a.toString(),10)]);h&&this.updateChildIndeterminate(h,n,e,t,n)}},p.prototype.updateIndeterminate=function(e,t){var i,e=this.getTreeData(e),s=0,n=(1===this.dataType&&(i=e[0][this.fields.parentID]?e[0][this.fields.parentID].toString():null),this.getChildNodes(this.treeData,i));if(n)for(var r=0;r<n.length;r++){var o=n[parseInt(r.toString(),10)][this.fields.id]?n[parseInt(r.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(o)&&s++}e=this.element.querySelector('[data-uid="'+i+'"]');e&&t||!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0!==s?this.changeState(e,"indeterminate",null):!t&&e&&-1===this.parentNodeCheck.indexOf(i)&&0===s?this.changeState(e,"uncheck",null):e||(t||-1!==this.checkedNodes.indexOf(i)||-1===this.parentNodeCheck.indexOf(i)?(t&&-1===this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)||!t&&-1!==this.checkedNodes.indexOf(i)&&-1===this.parentNodeCheck.indexOf(i)&&0!==s)&&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)},p.prototype.updateChildIndeterminate=function(e,t,i,s,n){for(var r=0,o=0;o<e.length;o++){var l=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",a=(-1!==this.checkedNodes.indexOf(l)&&r++,this.element.querySelector('[data-uid="'+t+'"]')),d=a?E.select("."+Hs,a):null,h=a?E.select("."+Ms,a):null,c=this.element.querySelector('[data-uid="'+l+'"]'),p=c?E.select("."+Ms,c):null,h=(-1!==this.checkedNodes.indexOf(i)&&a&&l===i&&this.autoCheck?this.changeState(a,"indeterminate",null):-1!==this.checkedNodes.indexOf(i)||!a||c||l!==i||s?-1===this.checkedNodes.indexOf(i)&&c&&l===i&&!s?this.changeState(c,"uncheck",null):-1===this.checkedNodes.indexOf(i)&&d&&l===i&&this.autoCheck&&0===r&&!s?d.classList.remove(Hs):-1===this.checkedNodes.indexOf(i)&&!c&&h&&l===i&&0===r?this.changeState(a,"uncheck",null):-1===this.checkedNodes.indexOf(l)&&c&&p&&0===r?this.changeState(c,"uncheck",null):(!c&&!a&&l===i||-1!==this.parentNodeCheck.indexOf(t)&&this.autoCheck)&&(d=this.element.querySelector('[data-uid="'+n+'"]'),s&&0!==r?this.changeState(d,"indeterminate",null):s&&r===e.length&&-1===this.checkedNodes.indexOf(t)?this.checkDisabledState(t):s||0!==r||-1===this.parentNodeCheck.indexOf(t)||this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(t)),-1===this.parentNodeCheck.indexOf(t))&&this.parentNodeCheck.push(t):!this.autoCheck&&0!==r?this.changeState(a,"indeterminate",null):this.changeState(a,"uncheck",null),E.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]));h&&this.updateChildIndeterminate(h,l,i,s,n)}},p.prototype.changeState=function(t,i,s,n,r,o){var e,l=this,a=E.closest(t,"."+w);!this.checkDisabledChildren&&a&&(a.classList.contains(Ds)||this.disableNode&&-1!==this.disableNode.indexOf(a.getAttribute("data-uid")))||(t===a&&(t=E.select("."+Us,a)),n?this.nodeCheckAction(t,i,a,e,s,n,r,o):(this.checkActionNodes=[],e=this.getCheckEvent(a,i,s),this.trigger("nodeChecking",e,function(e){e.cancel||l.nodeCheckAction(t,i,a,e,s,n,r,o)})))},p.prototype.nodeCheckAction=function(e,t,i,s,n,r,o,l){var a,e=e.getElementsByClassName(Rs)[0];"check"!==t||e.classList.contains(Ms)?"uncheck"===t&&(e.classList.contains(Ms)||e.classList.contains(Hs))?(E.removeClass([e],[Ms,Hs]),this.removeCheck(i),a="false"):"indeterminate"===t&&this.autoCheck&&(e.classList.remove(Ms),e.classList.add(Hs),this.removeCheck(i),a="mixed"):(e.classList.remove(Hs),e.classList.add(Ms),this.addCheck(i),a="true"),E.isNullOrUndefined(a="check"===t?"true":"uncheck"===t?"false":a)||i.setAttribute("aria-checked",a),o&&(e=[].concat([],this.checkActionNodes),s=this.getCheckEvent(i,t,n),E.isUndefined(r))&&(s.data=e),void 0!==l&&this.ensureStateChange(i,l),r||E.isNullOrUndefined(a)||(i.setAttribute("aria-checked",a),s.data[0].checked=a,this.trigger("nodeChecked",s),this.checkActionNodes=[])},p.prototype.addCheck=function(e){e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.checkedNodes.indexOf(e)||this.checkDisabledState(e)},p.prototype.removeCheck=function(e){e=this.checkedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.checkedNodes.splice(e,1)},p.prototype.getCheckEvent=function(e,t,i){this.checkActionNodes.push(this.getNodeData(e));var s=this.checkActionNodes;return{action:t,cancel:!1,isInteracted:!E.isNullOrUndefined(i),node:e,data:s}},p.prototype.finalize=function(){var e=E.select("."+L,this.element);E.isNullOrUndefined(e)||(e.setAttribute("role",_s.treeRole),this.setMultiSelect(this.allowMultiSelection),(e=E.select("."+w,this.element))&&(e.setAttribute("tabindex","0"),this.updateIdAttr(null,e)),this.allowTextWrap&&this.updateWrap(),this.renderReactTemplates(),this.hasPid=!!this.rootData[0]&&Object.prototype.hasOwnProperty.call(this.rootData[0],this.fields.parentID),this.doExpandAction())},p.prototype.setTextWrap=function(){(this.allowTextWrap?E.addClass:E.removeClass)([this.element],"e-text-wrap"),E.Browser.isIE&&(this.allowTextWrap?E.addClass:E.removeClass)([this.element],"e-ie-wrap")},p.prototype.updateWrap=function(e){if(this.fullRowSelect)for(var t=e?E.selectAll("."+w,e):this.liList,i=t.length,s=0;s<i;s++)this.calculateWrap(t[parseInt(s.toString(),10)])},p.prototype.calculateWrap=function(e){e=E.select("."+ks,e);e&&e.nextElementSibling&&(e.style.height=this.allowTextWrap?e.nextElementSibling.offsetHeight+"px":"")},p.prototype.doExpandAction=function(){var t=this,e=this.expandedNodes;if(!this.loadOnDemand&&this.fields.dataSource instanceof x.DataManager&&(this.isInitalExpand=0<this.treeData.filter(function(e){return!0===e[t.fields.expanded]}).length||this.isInitalExpand),this.isInitalExpand&&0<e.length)if(this.setProperties({expandedNodes:[]},!0),this.fields.dataSource instanceof x.DataManager)this.expandGivenNodes(e);else{for(var i=0;i<e.length;i++){var s,n=E.select('[data-uid="'+e[parseInt(i.toString(),10)]+'"]',this.element);E.isNullOrUndefined(n)?e[parseInt(i.toString(),10)]&&-1===this.expandChildren.indexOf(e[parseInt(i.toString(),10)])&&this.expandChildren.push(e[parseInt(i.toString(),10)].toString()):(s=E.select("."+O,E.select("."+gs,n)),E.isNullOrUndefined(s)||this.expandAction(n,s,null))}this.afterFinalized()}else this.afterFinalized()},p.prototype.expandGivenNodes=function(e){var t=this;this.expandCallback(e[this.index],function(){t.index++,t.index<e.length?t.expandGivenNodes(e):t.afterFinalized()}),0<this.index&&(this.index=0)},p.prototype.expandCallback=function(e,t){var i,e=E.select('[data-uid="'+e+'"]',this.element);E.isNullOrUndefined(e)||(i=E.select("."+O,E.select("."+gs,e)),E.isNullOrUndefined(i))||this.expandAction(e,i,null,!1,t),t()},p.prototype.afterFinalized=function(){var e;this.doSelectionAction(),this.updateCheckedProp(),this.isAnimate=!0,this.isInitalExpand=!1,this.isLoaded&&!this.isFieldChange||this.isNodeDropped||(e={data:this.treeData},this.trigger("dataBound",e)),this.isLoaded=!0,this.isNodeDropped=!1},p.prototype.doSelectionAction=function(){var e=E.selectAll("."+As,this.element),t=this.selectedNodes;if(0<t.length){this.setProperties({selectedNodes:[]},!0);for(var i=0;i<t.length;i++){var s=E.select('[data-uid="'+t[parseInt(i.toString(),10)]+'"]',this.element);if(s&&!s.classList.contains("e-active")?this.selectNode(s,null,!0):this.selectedNodes.push(t[parseInt(i.toString(),10)]),!this.allowMultiSelection)break}}else this.selectGivenNodes(e);E.removeClass(e,As)},p.prototype.selectGivenNodes=function(e){for(var t=0;t<e.length&&(e[parseInt(t.toString(),10)].classList.contains("e-disable")||this.selectNode(e[parseInt(t.toString(),10)],null,!0),this.allowMultiSelection);t++);},p.prototype.clickHandler=function(e){var t=E.Browser.isDevice&&e.originalEvent.changedTouches&&!E.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;if(E.EventHandler.remove(this.element,"contextmenu",this.preventContextMenu),t&&!this.dragStartAction){var i=t.classList,s=E.closest(t,"."+w);if(s&&(!s.classList.contains(Vs)||i.contains(O)||i.contains(u))){if(3!==e.originalEvent.which){var n=E.select(".e-ripple-element",s),r=E.select("."+fs,s);if(this.removeHover(),this.setFocusElement(s),this.showCheckBox&&!s.classList.contains("e-disable")){var o,l=E.closest(t,"."+Us);if(!E.isNullOrUndefined(l))return o=E.select("."+Rs,l),this.validateCheckNode(l,o.classList.contains(Ms),s,e.originalEvent),void this.triggerClickEvent(e.originalEvent,s)}i.contains(O)?this.expandAction(s,t,e):i.contains(u)?this.collapseNode(s,t,e):n&&r?r.classList.contains(Bs)&&r.classList.contains(O)?this.expandAction(s,r,e):r.classList.contains(Bs)&&r.classList.contains(u)?this.collapseNode(s,r,e):i.contains(L)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1):i.contains(L)||i.contains(w)||this.toggleSelect(s,e.originalEvent,!1)}3===e.originalEvent.which&&(this.isRightClick=!0),this.triggerClickEvent(e.originalEvent,s)}}},p.prototype.nodeCheckedEvent=function(e,t,i){e=this.getCheckEvent(e,t?"uncheck":"check",i);e.data=e.data.splice(0,e.data.length-1),this.trigger("nodeChecked",e)},p.prototype.updateOldCheckedData=function(e){var t,i=this,e=new x.DataManager(e),s=e.executeLocal((new x.Query).where("isChecked","equal","true",!0)),n=e.executeLocal((new x.Query).where("isChecked","equal","false",!0));if(0<n.length&&-1!==(t=this.OldCheckedData.findIndex(function(e){return e.id===n[0].id})))return this.OldCheckedData.splice(t,1),void(0<(e=this.OldCheckedData.filter(function(e){return e.parentID===n[0].id})).length&&e.forEach(function(t){var e=i.OldCheckedData.findIndex(function(e){return e.id===t.id});-1!==e&&i.OldCheckedData.splice(e,1)}));0<s.length&&-1===(t=this.OldCheckedData.findIndex(function(e){return e.id===s[0].id}))&&this.OldCheckedData.push(s[0])},p.prototype.triggerClickEvent=function(e,t){this.trigger("nodeClicked",{event:e,node:t})},p.prototype.expandNode=function(e,t,i){var s,n,r,o,l,a=this;this.renderReactTemplates(),t.classList.contains(us)&&this.hideSpinner(t),this.initialRender||t.classList.add("interaction"),!0!==i||!0===i&&e.classList.contains("e-expanded")?!0!==this.preventExpand&&(E.removeClass([t],O),E.addClass([t],u),n=s=0,r=E.select("."+L,e),o=e,this.isAnimate&&!this.isRefreshed?(this.setHeight(o,r),l=E.select("."+w+"."+ps,e),this.aniObj.animate(r,{name:this.animation.expand.effect,duration:0===this.animation.expand.duration&&"Enable"===E.animationMode?400:this.animation.expand.duration,timingFunction:this.animation.expand.easing,begin:function(){o.style.overflow="hidden",!E.isNullOrUndefined(l)&&l instanceof HTMLElement&&l.classList.add(Fs),s=o.offsetHeight,n=E.select("."+gs,e).offsetHeight},progress:function(e){e.element.style.display="block",a.animateHeight(e,s,n)},end:function(e){e.element.style.display="block",!E.isNullOrUndefined(l)&&l instanceof HTMLElement&&l.classList.remove(Fs),a.expandedNode(o,r,t)}})):this.expandedNode(o,r,t)):(E.select("."+L,e).style.display="none",this.fields.dataSource instanceof x.DataManager==!0&&(this.preventExpand=!1)),this.initialRender&&t.classList.add("interaction")},p.prototype.expandedNode=function(e,t,i){t.style.display="block",e.style.display="block",e.style.overflow="",e.style.height="",E.removeClass([i],ms),this.addExpand(e),this.allowTextWrap&&this.isLoaded&&this.isFirstRender&&(this.updateWrap(e),this.isFirstRender=!1),this.isLoaded&&this.expandArgs&&!this.isRefreshed&&(this.expandArgs=this.getExpandEvent(e,null),this.expandArgs.isInteracted=this.isInteracted,this.trigger("nodeExpanded",this.expandArgs)),this.isHiddenItem&&this.collapseAll([this.getNodeData(e).id])},p.prototype.addExpand=function(e){e.setAttribute("aria-expanded","true"),E.removeClass([e],Ps);e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.expandedNodes.indexOf(e)||this.expandedNodes.push(e)},p.prototype.collapseNode=function(t,i,e){var s,n=this;i.classList.contains(ms)||(E.addClass([i],ms),this.isLoaded?(s=this.getExpandEvent(t,e),this.isInteracted=s.isInteracted,this.trigger("nodeCollapsing",s,function(e){e.cancel?E.removeClass([i],ms):n.nodeCollapseAction(t,i,e)})):this.nodeCollapseAction(t,i,s))},p.prototype.nodeCollapseAction=function(e,t,i){var s=this,n=(E.removeClass([t],u),E.addClass([t],O),0),r=0,o=E.select("."+L,e),l=e,a=E.select("."+w+"."+ps,e);this.isAnimate?this.aniObj.animate(o,{name:this.animation.collapse.effect,duration:0===this.animation.collapse.duration&&"Enable"===E.animationMode?400:this.animation.collapse.duration,timingFunction:this.animation.collapse.easing,begin:function(){l.style.overflow="hidden",!E.isNullOrUndefined(a)&&a instanceof HTMLElement&&a.classList.add(Fs),n=E.select("."+gs,e).offsetHeight,r=l.offsetHeight},progress:function(e){s.animateHeight(e,n,r)},end:function(e){e.element.style.display="none",!E.isNullOrUndefined(a)&&a instanceof HTMLElement&&a.classList.remove(Fs),s.collapsedNode(l,o,t,i)}}):this.collapsedNode(l,o,t,i)},p.prototype.collapsedNode=function(e,t,i,s){t.style.display="none",e.style.overflow="",e.style.height="",E.removeClass([i],ms),this.removeExpand(e),this.isLoaded&&((s=this.getExpandEvent(e,null)).isInteracted=this.isInteracted,this.trigger("nodeCollapsed",s))},p.prototype.removeExpand=function(e,t){t?e.removeAttribute("aria-expanded"):this.disableExpandAttr(e);t=this.expandedNodes.indexOf(e.getAttribute("data-uid"));-1<t&&this.expandedNodes.splice(t,1)},p.prototype.disableExpandAttr=function(e){e.setAttribute("aria-expanded","false"),E.addClass([e],Ps)},p.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=""},p.prototype.animateHeight=function(e,t,i){var s=(e.duration-e.timeStamp)/e.duration;e.element.parentElement.style.height=(i-t)*s+t+"px"},p.prototype.renderChildNodes=function(t,i,s,n,e){var r,o,l,a=this,d=E.select("div."+fs,t);E.isNullOrUndefined(d)||(this.showSpinner(d),this.fields.dataSource instanceof x.DataManager?(o=this.parents(t,"."+L).length,l=this.getChildFields(this.fields,o,1),E.isNullOrUndefined(l)||E.isNullOrUndefined(l.dataSource)?(E.detach(d),this.removeExpand(t,!0)):(this.treeList.push("false"),this.fields.dataSource instanceof x.DataManager&&this.isOffline?(this.treeList.pop(),r=this.getChildNodes(this.treeData,t.getAttribute("data-uid")),this.loadChild(r,l,d,t,i,s,n)):l.dataSource.executeQuery(this.getQuery(l,t.getAttribute("data-uid"))).then(function(e){a.treeList.pop(),r=e.result,1===a.dataType&&(a.dataType=2),a.loadChild(r,l,d,t,i,s,n)}).catch(function(e){a.trigger("actionFailure",{error:e})}))):(r=this.getChildNodes(this.treeData,t.getAttribute("data-uid"),!1,parseFloat(t.getAttribute("aria-level"))+1),this.currentLoadData=this.getSortedData(r),E.isNullOrUndefined(r)||0===r.length?(E.detach(d),d.classList.contains(us)&&this.hideSpinner(d),this.removeExpand(t,!0)):(this.listBaseOption.ariaAttributes.level=parseFloat(t.getAttribute("aria-level"))+1,t.appendChild(U.ListBase.createList(this.createElement,this.currentLoadData,this.listBaseOption)),this.expandNode(t,d,n),this.setSelectionForChildNodes(r),this.ensureCheckNode(t,e),this.finalizeNode(t,e,i),this.disableTreeNodes(r),this.renderSubChild(t,i,n,e))))},p.prototype.loadChild=function(e,t,i,s,n,r,o){this.currentLoadData=e,E.isNullOrUndefined(e)||0===e.length?(E.detach(i),this.removeExpand(s,!0)):(this.updateListProp(t),this.fields.dataSource instanceof x.DataManager&&!this.isOffline&&(t=s.getAttribute("data-uid"),t=this.getNodeObject(t),E.setValue("child",e,t)),this.listBaseOption.ariaAttributes.level=parseFloat(s.getAttribute("aria-level"))+1,s.appendChild(U.ListBase.createList(this.createElement,e,this.listBaseOption)),this.expandNode(s,i,o),this.setSelectionForChildNodes(e),this.ensureCheckNode(s),this.finalizeNode(s),this.disableTreeNodes(e),this.renderSubChild(s,n,o)),r&&r(),n&&this.expandedNodes.push(s.getAttribute("data-uid")),0!==this.treeList.length||this.isLoaded||this.finalize()},p.prototype.disableTreeNodes=function(e){if(!E.isNullOrUndefined(this.disableNode)&&0!==this.disableNode.length)for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.disableNode&&-1!==this.disableNode.indexOf(i)&&this.doDisableAction([i]),t++}},p.prototype.setSelectionForChildNodes=function(e){if(!E.isNullOrUndefined(this.selectedNodes)&&0!==this.selectedNodes.length)for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)][this.fields.id]?e[parseInt(t.toString(),10)][this.fields.id].toString():null;void 0!==this.selectedNodes&&-1!==this.selectedNodes.indexOf(i)&&this.doSelectionAction()}},p.prototype.ensureCheckNode=function(e,t){this.showCheckBox&&(this.ele=this.checkedElement?this.checkedElement.indexOf(e.getAttribute("data-uid")):null,this.autoCheck)&&(this.ensureChildCheckState(e,null,t),t&&!E.select("."+Ms,this.element)&&!E.select("."+Hs,this.element)||this.ensureParentCheckState(e)),this.currentLoadData=null},p.prototype.getFields=function(e,t,i){return t===i?e:this.getFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildFields=function(e,t,i){return t===i?this.getChildMapper(e):this.getChildFields(this.getChildMapper(e),t,i+1)},p.prototype.getChildMapper=function(e){return"string"==typeof e.child||E.isNullOrUndefined(e.child)?e:e.child},p.prototype.getChildNodes=function(e,t,i,s){var n,r=this;if(void 0===i&&(i=!1),!E.isNullOrUndefined(e)){if(1===this.dataType)return this.getChildGroup(this.groupedData,t,i);if("string"==typeof this.fields.child)return this.findChildNodes(e,this.fields.id,t)||this.findNestedChildNodes(e,t,s)||[];if(this.isChildObject()){for(var o=E.isNullOrUndefined(s)?this.fields.child:this.fields,l=1;l<s&&!E.isNullOrUndefined(o.child);)o=o.child,l++;this.updateListProp(o);i=e.findIndex(function(e){return E.getValue(r.fields.id,e)&&E.getValue(r.fields.id,e).toString()===t});if(-1!==i)return E.getValue("child",e[parseInt(i.toString(),10)]);if(-1===i)for(var a=0,d=e.length;a<d;a++){var h=E.getValue("child",e[parseInt(a.toString(),10)]),c=E.isNullOrUndefined(h)?-1:h.findIndex(function(e){return E.getValue(r.fields.child.id,e)&&E.getValue(r.fields.child.id,e).toString()===t});if(-1!==c)return E.getValue("child",h[parseInt(c.toString(),10)]);if(!E.isNullOrUndefined(h)&&void 0!==(n=this.getChildNodes(h,t,!1,s)))break}}}return n},p.prototype.findChildNodes=function(e,t,i){var s=e.findIndex(function(e){e=E.getValue(t,e);return e&&e.toString()===i});return-1!==s?E.getValue(this.fields.child,e[s]):null},p.prototype.findNestedChildNodes=function(e,t,i){for(var s=0,n=e;s<n.length;s++){var r=n[s],r=E.getValue(this.fields.child,r);if(!E.isNullOrUndefined(r)){var o=this.findChildNodes(r,this.fields.id,t);if(o)return o;o=this.getChildNodes(r,t,!1,i);if(o&&0<o.length)return o}}},p.prototype.getChildGroup=function(e,t,i){if(!E.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){if(E.isNullOrUndefined(e[parseInt(s.toString(),10)][0])||E.isNullOrUndefined(E.getValue(this.fields.parentID,e[parseInt(s.toString(),10)][0])))return i?e[parseInt(s.toString(),10)]:[];if(E.getValue(this.fields.parentID,e[parseInt(s.toString(),10)][0]).toString()===t)return e[parseInt(s.toString(),10)]}},p.prototype.renderSubChild=function(e,t,i,s){if(t)for(var n=E.selectAll("."+O,e),r=0,o=n.length;r<o;r++){var l=n[parseInt(r.toString(),10)];e.querySelector(".e-icons")!==n[parseInt(r.toString(),10)]&&(l=E.closest(l,"."+w),this.expandArgs=this.getExpandEvent(l,null),!0!==i&&this.trigger("nodeExpanding",this.expandArgs),this.renderChildNodes(l,t,null,i,s))}},p.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))},p.prototype.isActive=function(e){return!!e.classList.contains(ps)},p.prototype.selectNode=function(t,i,s){var e,n=this;E.isNullOrUndefined(t)||!this.allowMultiSelection&&this.isActive(t)&&!E.isNullOrUndefined(i)?this.setFocusElement(t):this.isLoaded?(e=this.getSelectEvent(t,"select",i),this.trigger("nodeSelecting",e,function(e){e.cancel||e.node.classList.contains(Vs)||n.nodeSelectAction(t,i,e,s)})):this.nodeSelectAction(t,i,e,s)},p.prototype.nodeSelectAction=function(e,t,i,s){if(this.allowMultiSelection&&(s||t&&(t.ctrlKey||t.metaKey))||this.removeSelectAll(),this.allowMultiSelection&&t&&t.shiftKey){this.startNode||(this.startNode=e);var s=this.liList.indexOf(this.startNode),n=this.liList.indexOf(e);n<s&&(t=s,s=n,n=t);for(var r=s;r<=n;r++){var o=this.liList[parseInt(r.toString(),10)];E.isVisible(o)&&!o.classList.contains("e-disable")&&this.addSelect(o)}}else this.startNode=e,this.addSelect(e);this.isLoaded&&(i.nodeData=this.getNodeData(e),this.trigger("nodeSelected",i),this.isRightClick=!1),this.isRightClick=!1},p.prototype.unselectNode=function(t,e){var i,s=this;this.isLoaded?(i=this.getSelectEvent(t,"un-select",e),this.trigger("nodeSelecting",i,function(e){e.cancel||s.nodeUnselectAction(t,e)})):this.nodeUnselectAction(t,i)},p.prototype.nodeUnselectAction=function(e,t){this.removeSelect(e),this.setFocusElement(e),this.isLoaded&&(t.nodeData=this.getNodeData(e),this.trigger("nodeSelected",t))},p.prototype.setFocusElement=function(e){var t;E.isNullOrUndefined(e)||((t=this.getFocusedNode())&&(E.removeClass([t],js),t.setAttribute("tabindex","-1")),E.addClass([e],js),e.setAttribute("tabindex","0"),E.EventHandler.add(e,"blur",this.focusOut,this),this.updateIdAttr(t,e))},p.prototype.addSelect=function(e){e.setAttribute("aria-selected","true"),E.addClass([e],ps);e=e.getAttribute("data-uid");E.isNullOrUndefined(e)||-1!==this.selectedNodes.indexOf(e)||this.selectedNodes.push(e)},p.prototype.removeSelect=function(e){this.allowMultiSelection?e.setAttribute("aria-selected","false"):e.removeAttribute("aria-selected"),E.removeClass([e],ps);e=this.selectedNodes.indexOf(e.getAttribute("data-uid"));-1<e&&this.selectedNodes.splice(e,1)},p.prototype.removeSelectAll=function(){for(var e=this.element.querySelectorAll("."+ps),t=0,i=e;t<i.length;t++){var s=i[t];this.allowMultiSelection?s.setAttribute("aria-selected","false"):s.removeAttribute("aria-selected")}E.removeClass(e,ps),this.setProperties({selectedNodes:[]},!0)},p.prototype.getSelectEvent=function(e,t,i){var s=this.getNodeData(e);return{action:t,cancel:!1,isInteracted:!E.isNullOrUndefined(i),node:e,nodeData:s}},p.prototype.setExpandOnType=function(){this.expandOnType="Auto"===this.expandOn?E.Browser.isDevice?"Click":"DblClick":this.expandOn},p.prototype.expandHandler=function(e){var t=E.Browser.isDevice&&e.originalEvent.changedTouches&&!E.Browser.isIos?document.elementFromPoint(e.originalEvent.changedTouches[0].clientX,e.originalEvent.changedTouches[0].clientY):e.originalEvent.target;!t||t.classList.contains(vs)||t.classList.contains(as)||t.classList.contains(L)||t.classList.contains(w)||t.classList.contains(fs)||this.showCheckBox&&E.closest(t,"."+Us)||this.expandCollapseAction(E.closest(t,"."+w),e)},p.prototype.expandCollapseAction=function(e,t){var i,s=E.select("div."+fs,e);s&&!s.classList.contains(ms)&&((i=s.classList).contains(O)?this.expandAction(e,s,t):i.contains(u)&&this.collapseNode(e,s,t))},p.prototype.expandAction=function(t,i,e,s,n,r){var o=this;i.classList.contains(ms)||(E.addClass([i],ms),this.isLoaded&&!this.isRefreshed?(this.expandArgs=this.getExpandEvent(t,e),this.isInteracted=this.expandArgs.isInteracted,this.trigger("nodeExpanding",this.expandArgs,function(e){e.cancel?E.removeClass([i],ms):o.nodeExpandAction(t,i,s,n,r)})):this.nodeExpandAction(t,i,s,n,r))},p.prototype.nodeExpandAction=function(e,t,i,s,n){var r=E.select("."+L,e);if(r&&"UL"===r.nodeName)this.expandNode(e,t);else{this.isFirstRender=!0,this.renderChildNodes(e,i,s,null,n);for(var o=E.selectAll("."+w,e),l=0;l<o.length;l++){var a,d=this.getId(o[parseInt(l.toString(),10)]);-1!==this.expandChildren.indexOf(d)&&void 0!==this.expandChildren&&(a=E.select("."+O,E.select("."+gs,o[parseInt(l.toString(),10)])),E.isNullOrUndefined(a)||this.expandAction(o[parseInt(l.toString(),10)],a,null),this.expandChildren.splice(this.expandChildren.indexOf(d),1))}}},p.prototype.keyActionHandler=function(i){var s=this,e=i.target,n=this.getFocusedNode();e&&e.classList.contains(vs)?(e=e,"enter"===i.action?e.blur():"escape"===i.action&&(e.value=this.oldText,e.blur())):(i.preventDefault(),e={cancel:!1,event:i,node:n},this.trigger("keyPress",e,function(e){if(!e.cancel)switch(i.action){case"space":s.showCheckBox?s.checkNode(i):s.toggleSelect(n,i);break;case"moveRight":s.openNode(!s.enableRtl,i);break;case"moveLeft":s.openNode(!!s.enableRtl,i);break;case"shiftDown":s.shiftKeySelect(!0,i);break;case"moveDown":case"ctrlDown":case"csDown":s.navigateNode(!0);break;case"shiftUp":s.shiftKeySelect(!1,i);break;case"moveUp":case"ctrlUp":case"csUp":s.navigateNode(!1);break;case"home":case"shiftHome":case"ctrlHome":case"csHome":s.navigateRootNode(!0);break;case"end":case"shiftEnd":case"ctrlEnd":case"csEnd":s.navigateRootNode(!1);break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":case"shiftSpace":case"ctrlSpace":s.toggleSelect(n,i);break;case"f2":s.allowEditing&&!n.classList.contains("e-disable")&&s.createTextbox(n);break;case"ctrlA":var t;s.allowMultiSelection&&(t=E.selectAll("."+w+":not(."+ps+")",s.element),s.selectGivenNodes(t))}}))},p.prototype.navigateToFocus=function(e){var t,i=this.getFocusedNode().querySelector("."+gs),s=i.getBoundingClientRect(),n=this.getScrollParent(this.element);E.isNullOrUndefined(n)||(t=n.getBoundingClientRect(),s.bottom>t.bottom?n.scrollTop+=s.bottom-t.bottom:s.top<t.top&&(n.scrollTop-=t.top-s.top)),this.isVisibleInViewport(i)||i.scrollIntoView(e)},p.prototype.isVisibleInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},p.prototype.getScrollParent=function(e){return E.isNullOrUndefined(e)?null:e.scrollHeight>e.clientHeight?e:this.getScrollParent(e.parentElement)},p.prototype.shiftKeySelect=function(e,t){var i;this.allowMultiSelection?(i=this.getFocusedNode(),i=e?this.getNextNode(i):this.getPrevNode(i),this.removeHover(),this.setFocusElement(i),this.toggleSelect(i,t,!1),this.navigateToFocus(!e)):this.navigateNode(e)},p.prototype.checkNode=function(e){var t=this.getFocusedNode(),i=E.select("."+Us,t),s=E.select(" ."+Rs,i).classList.contains(Ms);t.classList.contains("e-disable")||0===t.getElementsByClassName("e-checkbox-disabled").length&&this.validateCheckNode(i,s,t,e)},p.prototype.validateCheckNode=function(t,i,s,n){var r=this,e=E.closest(t,"."+w),o=(this.checkActionNodes=[],i?"false":"true"),o=(E.isNullOrUndefined(o)||e.setAttribute("aria-checked",o),this.getCheckEvent(e,i?"uncheck":"check",n));this.trigger("nodeChecking",o,function(e){e.cancel||r.nodeCheckingAction(t,i,s,e,n)})},p.prototype.nodeCheckingAction=function(e,t,i,s,n){var r;-1===this.checkedElement.indexOf(i.getAttribute("data-uid"))&&(this.checkedElement.push(i.getAttribute("data-uid")),this.autoCheck)&&(null!==(r=this.getChildNodes(this.treeData,i.getAttribute("data-uid")))?this.allCheckNode(r,this.checkedElement,null,null,!1):r=null),this.changeState(e,t?"uncheck":"check",n,!0),this.autoCheck&&(this.ensureChildCheckState(i),this.updateOldCheckedData([this.getNodeData(i)]),this.ensureParentCheckState(E.closest(E.closest(i,"."+L),"."+w)),r=void 0,"check"===s.action?r=!0:"uncheck"===s.action&&(r=!1),this.ensureStateChange(i,r)),this.nodeCheckedEvent(e,t,n)},p.prototype.ensureStateChange=function(e,t){var i=this,s=E.select("."+L,e),n=e.getAttribute("data-uid"),r=this.fields;if(1===this.dataType&&this.autoCheck){var o=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.parentID,"equal",n,!0)),e=o.filter(function(e){return-1!==i.checkedNodes.indexOf(e[r.id].toString())},this);-1!==this.checkedNodes.indexOf(n)&&e.length!==o.length&&this.isFilter&&0<e.length&&(o=e);for(var l=0;l<o.length;l++){var a,d=o[parseInt(l.toString(),10)][this.fields.id]?o[parseInt(l.toString(),10)][this.fields.id].toString():null,h=o[parseInt(l.toString(),10)][this.fields.isChecked]?o[parseInt(l.toString(),10)][this.fields.isChecked].toString():null;-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(d)?(this.checkDisabledState(d,o[l]),a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t),-1!==this.parentNodeCheck.indexOf(d)&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):-1===this.checkedNodes.indexOf(n)&&null===s&&-1!==this.checkedNodes.indexOf(d)?(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))&&(h=this.getChildNodes(this.treeData,d),this.getChildItems(h,t),-1!==this.parentNodeCheck.indexOf(d))&&this.parentNodeCheck.splice(this.parentNodeCheck.indexOf(d),1)):(a=this.getChildNodes(this.treeData,d),this.getChildItems(a,t))}}else if(1!==this.dataType||this.autoCheck)(a=this.getChildNodes(this.treeData,n))&&(0<(e=a.filter(function(e){e=String(e[Object.keys(e)[0]]);return-1!==i.checkedNodes.indexOf(e)})).length&&a.length&&this.isFilter&&(a=e),this.childStateChange(a,n,s,t));else if(t)for(l=0;l<this.treeData.length;l++){var c=this.treeData[parseInt(l.toString(),10)][this.fields.id]?this.treeData[parseInt(l.toString(),10)][this.fields.id].toString():null;-1===this.checkedNodes.indexOf(c)&&this.checkDisabledState(c,this.treeData[l])}else{for(var p=new x.DataManager(this.treeData).executeLocal((new x.Query).where(r.isChecked,"equal",!0,!1)),l=0;l<p.length;l++){var u=p[parseInt(l.toString(),10)][this.fields.id]?p[parseInt(l.toString(),10)][this.fields.id].toString():null;-1!==this.checkedNodes.indexOf(u)&&this.checkedNodes.splice(this.checkedNodes.indexOf(u),1),this.updateField(this.treeData,this.fields,u,"isChecked",null)}this.checkedNodes=[]}},p.prototype.checkDisabledState=function(e,t){var i,s=this.checkDisabledChildren;s||(i=!0,this.loadOnDemand&&this.fields.htmlAttributes&&(t=E.isNullOrUndefined(t)?t:this.getNodeObject(e),E.isNullOrUndefined(t)||(t=t[this.fields.htmlAttributes])&&!E.isNullOrUndefined(t.class)&&-1!==t.class.indexOf(Ds)&&(i=!1)),s=(t=E.select('[data-uid="'+e+'"]',this.element))?!t.classList.contains(Ds):-1===this.disableNode.indexOf(e)&&i),s&&this.checkedNodes.push(e)},p.prototype.getChildItems=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,n=e[parseInt(i.toString(),10)][this.fields.isChecked]?e[parseInt(i.toString(),10)][this.fields.isChecked].toString():null,n=(-1===this.checkedNodes.indexOf(s)||t||this.checkedNodes.splice(this.checkedNodes.indexOf(s),1),-1===this.checkedNodes.indexOf(s)&&t&&this.checkDisabledState(s,e[i]),"true"!==n||t||this.updateField(this.treeData,this.fields,s,"isChecked",null),this.getChildNodes(this.treeData,s));0<n.length&&this.getChildItems(n,t)}},p.prototype.childStateChange=function(e,t,i,s){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)][this.fields.id]?e[parseInt(n.toString(),10)][this.fields.id].toString():"",o=e[parseInt(n.toString(),10)][this.fields.isChecked]?e[parseInt(n.toString(),10)][this.fields.isChecked].toString():null,o=(this.autoCheck?-1!==this.checkedNodes.indexOf(t)&&-1===this.checkedNodes.indexOf(r)?(this.checkDisabledState(r,e[n]),-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"===o&&this.updateField(this.treeData,this.fields,r,"isChecked",null)):this.autoCheck||(s?-1===this.checkedNodes.indexOf(r)&&this.checkDisabledState(r,e[n]):(-1!==this.checkedNodes.indexOf(r)&&this.checkedNodes.splice(this.checkedNodes.indexOf(r),1),this.updateField(this.treeData,this.fields,r,"isChecked",null),this.checkedNodes=[])),this.getChildNodes([e[parseInt(n.toString(),10)]],r));o&&this.childStateChange(o,t,i,s)}},p.prototype.allCheckNode=function(e,t,i,s,n){if(e)for(var r=0;r<e.length;r++){var o,l=E.getValue(this.fields.id,e[parseInt(r.toString(),10)]),a=this.element.querySelector('[data-uid="'+l+'"]'),a=(!1===n||-1!==this.checkedElement.indexOf(l.toString())||(null!==a||E.isNullOrUndefined(e[parseInt(r.toString(),10)][this.fields.isChecked])||-1!==t.indexOf(l.toString()))&&0!==s&&2!==i||(!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?t.push(l.toString()):s=null,s=!1!==e[parseInt(r.toString(),10)][this.fields.isChecked]||2===i?0:null),-1===t.indexOf(l.toString())&&E.isNullOrUndefined(i)&&t.push(l.toString()),E.getValue(this.fields.child.toString(),e[parseInt(r.toString(),10)]));(!0===E.getValue(this.fields.hasChildren,e[parseInt(r.toString(),10)])||a)&&(l=E.getValue(this.fields.id,e[parseInt(r.toString(),10)]),o=void 0,o=1===this.dataType?this.getChildNodes(this.treeData,l.toString()):a)&&(E.isNullOrUndefined(n)?this.allCheckNode(o,t,i,s):this.allCheckNode(o,t,i,s,n),s=null),s=null}},p.prototype.openNode=function(e,t){var i=this.getFocusedNode(),s=E.select("div."+fs,i);e?s&&(s.classList.contains(O)?this.expandAction(i,s,t):this.focusNextNode(i,!0)):s&&s.classList.contains(u)?this.collapseNode(i,s,t):(e=E.closest(E.closest(i,"."+L),"."+w))&&!e.classList.contains("e-disable")&&(this.setFocus(i,e),this.navigateToFocus(!0))},p.prototype.navigateNode=function(e){var t=this.getFocusedNode();this.focusNextNode(t,e)},p.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))},p.prototype.getFocusedNode=function(){var e,t,i=E.select("."+w+'[tabindex="0"]',this.element);return E.isNullOrUndefined(i)||"mixed"!==(t=i.getAttribute("aria-checked"))&&"false"!==t||(this.isFilter=!1),E.isNullOrUndefined(i)&&(e=E.select("."+w,this.element)),E.isNullOrUndefined(i)?E.isNullOrUndefined(e)?this.element.firstElementChild:e:i},p.prototype.focusNextNode=function(e,t){var i=t?this.getNextNode(e):this.getPrevNode(e);this.setFocus(e,i),this.navigateToFocus(!t),i.classList.contains("e-disable")&&(e=i.lastChild,null==i.previousSibling&&i.classList.contains("e-level-1")?this.focusNextNode(i,!0):null==i.nextSibling&&i.classList.contains("e-node-collapsed")||null==i.nextSibling&&e.classList.contains(gs)?this.focusNextNode(i,!1):this.focusNextNode(i,t))},p.prototype.getNextNode=function(e){var t,i=this.liList.indexOf(e);do{if(i++,t=this.liList[parseInt(i.toString(),10)],E.isNullOrUndefined(t))return e}while(!E.isVisible(t));return t},p.prototype.getPrevNode=function(e){var t,i=this.liList.indexOf(e);do{if(i--,t=this.liList[parseInt(i.toString(),10)],E.isNullOrUndefined(t))return e}while(!E.isVisible(t));return t},p.prototype.getRootNode=function(){for(var e,t=0;e=this.liList[parseInt(t.toString(),10)],t++,!E.isVisible(e););return e},p.prototype.getEndNode=function(){for(var e,t=this.liList.length-1;e=this.liList[parseInt(t.toString(),10)],t--,!E.isVisible(e););return e},p.prototype.setFocus=function(e,t){E.removeClass([e],js),e.setAttribute("tabindex","-1"),t.classList.contains("e-disable")||(E.addClass([t],js),t.setAttribute("tabindex","0"),t.focus(),E.EventHandler.add(t,"blur",this.focusOut,this),this.updateIdAttr(e,t))},p.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")},p.prototype.focusIn=function(){var e;this.mouseDownStatus||((e=this.getFocusedNode()).classList.contains("e-disable")?(e.setAttribute("tabindex","-1"),this.navigateNode(!0)):(e.setAttribute("tabindex","0"),E.addClass([e],js),E.EventHandler.add(e,"blur",this.focusOut,this)),this.mouseDownStatus=!1)},p.prototype.focusOut=function(e){var t=this.getFocusedNode();e.target===t&&(E.removeClass([t],js),E.EventHandler.remove(t,"blur",this.focusOut))},p.prototype.onMouseOver=function(e){var t;E.Browser.isDevice||(t=(e=e.target).classList,!(e=E.closest(e,"."+w))||t.contains(L)||t.contains(w)?this.removeHover():e&&!e.classList.contains("e-disable")&&this.setHover(e))},p.prototype.setHover=function(e){e.classList.contains(cs)||e.classList.contains(Vs)||(this.removeHover(),E.addClass([e],cs))},p.prototype.onMouseLeave=function(){this.removeHover()},p.prototype.removeHover=function(){var e=E.selectAll("."+cs,this.element);e&&e.length&&E.removeClass(e,cs)},p.prototype.getNodeData=function(e,t){var i,s,n,r,o,l,a,d;return!E.isNullOrUndefined(e)&&e.classList.contains(w)&&!E.isNullOrUndefined(E.closest(e,"."+ds))&&E.closest(e,"."+ds).classList.contains(as)?(i=e.getAttribute("data-uid"),t=this.getText(e,t),s=(s=E.closest(e.parentNode,"."+w))?s.getAttribute("data-uid"):null,n=e.classList.contains(ps),r=!e.classList.contains(Vs),o="true"===e.getAttribute("aria-expanded"),l=null!==e.getAttribute("aria-expanded")||null!=(E.select("."+O,e)||E.select("."+u,e)),a=null,d=E.select("."+Us,e),{id:i,text:t,parentID:s,selected:n,selectable:r,expanded:o,isChecked:a=this.showCheckBox&&d?e.getAttribute("aria-checked"):a,hasChildren:l}):{id:"",text:"",parentID:"",selected:!1,expanded:!1,isChecked:"",hasChildren:!1}},p.prototype.getText=function(e,t){var i;return t?(t=this.getNodeObject(e.getAttribute("data-uid")),i=parseFloat(e.getAttribute("aria-level")),i=this.getFields(this.fields,i,1),E.getValue(i.text,t)):E.select("."+hs,e).textContent},p.prototype.getExpandEvent=function(e,t){var i=this.getNodeData(e);return{cancel:!1,isInteracted:!E.isNullOrUndefined(t),node:e,nodeData:i,event:t}},p.prototype.renderNodeTemplate=function(e,t,i){e=this.nodeTemplateFn(e,this,"nodeTemplate"+i,this.element.id+"nodeTemplate",this.isStringTemplate,void 0,t,this.root);e&&(e=Array.prototype.slice.call(e),E.append(e,t))},p.prototype.destroyTemplate=function(e){this.clearTemplate(["nodeTemplate"+e.getAttribute("data-uid")])},p.prototype.reRenderNodes=function(){this.updateListProp(this.fields),E.Browser.isIE?(this.ulElement=this.element.querySelector(".e-list-parent.e-ul"),this.ulElement.parentElement.removeChild(this.ulElement)):this.element.innerHTML="",E.isNullOrUndefined(this.nodeTemplateFn)||this.clearTemplate(),this.setTouchClass(),this.setProperties({selectedNodes:[],checkedNodes:[],expandedNodes:[]},!0),this.checkedElement=[],this.isLoaded=!1,this.setDataBinding(!0)},p.prototype.setCssClass=function(e,t){E.isNullOrUndefined(e)||""===e||E.removeClass([this.element],e.split(" ")),E.isNullOrUndefined(t)||""===t||E.addClass([this.element],t.split(" "))},p.prototype.editingHandler=function(e){var e=e.target;!e||e.classList.contains(as)||e.classList.contains(L)||e.classList.contains(w)||e.classList.contains(fs)||e.classList.contains(vs)||e.classList.contains(ys)||(e=E.closest(e,"."+w),this.createTextbox(e))},p.prototype.createTextbox=function(i){var s=this,e=E.select("."+bs,this.element),n=(e&&e.blur(),E.select("."+hs,i)),e=(this.updateOldText(i),this.createElement("input",{className:bs,attrs:{value:this.oldText}})),r=this.getEditEvent(i,null,e.outerHTML);this.trigger("nodeEditing",r,function(e){var t;e.cancel||(t="width:"+(n.offsetWidth+5)+"px",E.addClass([i],Cs),E.isNullOrUndefined(s.nodeTemplateFn)||s.destroyTemplate(i),s.isReact?setTimeout(function(){s.renderTextBox(r,n,t)},5):s.renderTextBox(r,n,t))})},p.prototype.renderTextBox=function(e,t,i){t.innerHTML=e.innerHtml;e=E.select("."+bs,t),this.inputObj=B.Input.createInput({element:e,properties:{enableRtl:this.enableRtl}},this.createElement),this.inputObj.container.setAttribute("style",i),e.focus(),t=e;t.setSelectionRange(0,t.value.length),this.wireInputEvents(e)},p.prototype.updateOldText=function(e){var t=e.getAttribute("data-uid"),t=(this.editData=this.getNodeObject(t),parseFloat(e.getAttribute("aria-level")));this.editFields=this.getFields(this.fields,t,1),this.oldText=E.getValue(this.editFields.text,this.editData)},p.prototype.inputFocusOut=function(e){var t,i,s;E.select("."+bs,this.element)&&(t=(e=e.target).value,i=E.closest(e,"."+hs),s=E.closest(e,"."+w),E.detach(this.inputObj.container),B.Input.destroy({element:e,properties:this.properties}),this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("update",null,s,t,null,null,!0):this.appendNewText(s,i,t,!0),E.EventHandler.remove(e,"blur",this.inputFocusOut),this.inputObj=null,E.detach(e))},p.prototype.appendNewText=function(t,i,s,n){var r=this,e=this.getEditEvent(t,s,null);this.trigger("nodeEdited",e,function(e){s=e.cancel?e.oldText:e.newText,r.updateText(t,i,s,n),e.oldText!==s&&r.triggerEvent("nodeEdited",[r.getNode(t)])})},p.prototype.updateText=function(e,t,i,s){var n=E.setValue(this.editFields.text,i,this.editData);E.isNullOrUndefined(this.nodeTemplateFn)?this.enableHtmlSanitizer?t.innerText=E.SanitizeHtmlHelper.sanitize(i):t.innerHTML=i:(t.innerText="",i=e.getAttribute("data-uid"),this.renderNodeTemplate(n,t,i),this.renderReactTemplates()),s&&(E.removeClass([e],Cs),e.focus(),E.EventHandler.add(e,"blur",this.focusOut,this),E.addClass([e],js)),this.allowTextWrap&&this.calculateWrap(e)},p.prototype.getElement=function(e){return E.isNullOrUndefined(e)?null:"string"==typeof e?this.element.querySelector('[data-uid="'+e+'"]'):"object"==typeof e?E.getElement(e):null},p.prototype.getId=function(e){return E.isNullOrUndefined(e)?null:"string"==typeof e?e:"object"==typeof e?E.getElement(e).getAttribute("data-uid"):null},p.prototype.getEditEvent=function(e,t,i){return{cancel:!1,newText:t,node:e,nodeData:this.getNodeData(e),oldText:this.oldText,innerHtml:i}},p.prototype.getNodeObject=function(e){if(!E.isNullOrUndefined(e)){if(1!==this.dataType)return this.getChildNodeObject(this.treeData,this.fields,e);for(var t=0,i=this.treeData.length;t<i;t++){var s=E.getValue(this.fields.id,this.treeData[parseInt(t.toString(),10)]);if(!E.isNullOrUndefined(this.treeData[parseInt(t.toString(),10)])&&!E.isNullOrUndefined(s)&&s.toString()===e)return this.treeData[parseInt(t.toString(),10)]}}},p.prototype.getChildNodeObject=function(e,t,i){if(!E.isNullOrUndefined(e))for(var s=0,n=e.length;s<n;s++){var r=E.getValue(t.id,e[parseInt(s.toString(),10)]);if(e[parseInt(s.toString(),10)]&&r&&r.toString()===i)return e[parseInt(s.toString(),10)];if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(s.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(s.toString(),10)]))){if(void 0!==(o=this.getChildNodeObject(E.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)))break}else if(this.isChildObject()){l=E.getValue("child",e[parseInt(s.toString(),10)]);if(void 0!==(o=this.getChildNodeObject(l,this.getChildMapper(t),i)))break}}else{var o,l=E.getValue(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(o=this.getChildNodeObject(l,this.getChildMapper(t),i)))break}}return o},p.prototype.setDragAndDrop=function(e){e&&!this.disabled?this.initializeDrag():this.destroyDrag()},p.prototype.initializeDrag=function(){var s,n=this;this.dragObj=new E.Draggable(this.element,{enableTailMode:!0,enableAutoScroll:!0,dragArea:this.dragArea,dragTarget:"."+gs,enableTapHold:!0,tapHoldThreshold:100,helper:function(e){n.dragTarget=e.sender.target;var t=E.closest(n.dragTarget,"."+as),i=E.closest(n.dragTarget,"."+gs);return n.dragLi=E.closest(n.dragTarget,"."+w),n.fullRowSelect&&!i&&n.dragTarget.classList.contains(ks)&&(i=n.dragTarget.nextElementSibling),!(!(n.dragTarget&&e.element.isSameNode(t)&&i)||n.dragTarget.classList.contains(as)||n.dragTarget.classList.contains(L)||n.dragTarget.classList.contains(w)||n.dragLi.classList.contains("e-disable"))&&(e=i.cloneNode(!0),E.isNullOrUndefined(E.select("div."+fs,e))&&(t=n.createElement("div",{className:fs+" "+O}),e.insertBefore(t,e.children[0])),i="e-drag-item "+as+" "+n.cssClass+" "+(n.enableRtl?"e-rtl":""),(s=n.createElement("div",{className:i})).appendChild(e),1<(t=n.selectedNodes.length)&&n.allowMultiSelection&&n.dragLi.classList.contains(ps)&&(i=n.createElement("span",{className:"e-drop-count",innerHTML:""+t}),s.appendChild(i)),document.body.appendChild(s),document.body.style.cursor="",n.dragData=n.getNodeData(n.dragLi),s)},dragStart:function(t){E.addClass([n.element],Es);var e,i=E.closest(t.target,".e-list-item"),i=(i&&(e=parseInt(i.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,null,t.target,null,s,e));i.draggedNode.classList.contains(Cs)?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.trigger("nodeDragStart",i,function(e){e.cancel?(n.dragObj.intDestroy(t.event),n.dragCancelAction(s)):n.dragStartAction=!0})},drag:function(e){n.dragObj.setProperties({cursorAt:{top:!E.isNullOrUndefined(e.event.targetTouches)||E.Browser.isDevice?60:-20}}),n.dragAction(e,s)},dragStop:function(t){E.removeClass([n.element],Es),t.target.classList.contains("e-sibling")||n.removeVirtualEle();var e,i=t.target,s=E.closest(i,"."+Is),s=(i&&s||(E.detach(t.helper),document.body.style.cursor=""),E.closest(i,".e-list-item")),s=(s&&(e=parseInt(s.getAttribute("aria-level"),10)),n.getDragEvent(t.event,n,i,i,null,t.helper,e));s.preventTargetExpand=!1,n.trigger("nodeDragStop",s,function(e){n.dragParent=e.draggedParentNode,n.preventExpand=e.preventTargetExpand,e.cancel&&(t.helper.parentNode&&E.detach(t.helper),document.body.style.cursor="",i.classList.contains("e-sibling"))&&n.removeVirtualEle(),n.dragStartAction=!1})}}),this.dropObj=new E.Droppable(this.element,{out:function(e){!E.isNullOrUndefined(e)&&!e.target.classList.contains(xs)&&n.dropObj.dragData.default&&n.dropObj.dragData.default.helper.classList.contains(as)&&(document.body.style.cursor="not-allowed")},over:function(){document.body.style.cursor=""},drop:function(e){n.dropAction(e),n.removeVirtualEle()}})},p.prototype.dragCancelAction=function(e){E.detach(e),E.removeClass([this.element],Es),this.dragStartAction=!1},p.prototype.getOffsetX=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientX-t.getBoundingClientRect().left:e.offsetX},p.prototype.getOffsetY=function(e,t){var i=e.changedTouches;return i&&0<i.length?i[0].clientY-t.getBoundingClientRect().top:e.offsetY},p.prototype.dragAction=function(e,t){var i,s,n,r,o,l=E.closest(e.target,"."+Is),a=E.closest(e.target,"."+gs),d=E.select("div."+fs,t),h=(E.removeClass([d],[Ns,Os,ws,Ls]),this.isDropIn=!1,this.removeVirtualEle(),document.body.style.cursor="",e.target.classList),c=e.event,p=this.getOffsetY(c,e.target),c=this.getOffsetX(c,e.target),a=(this.fullRowSelect&&!a&&!E.isNullOrUndefined(h)&&h.contains(ks)&&(a=e.target.nextElementSibling),l?(h=E.closest(e.target,"."+w),i=E.closest(e.target,"."+Us),s=E.closest(e.target,"."+u),n=E.closest(e.target,"."+O),!l.classList.contains(as)||a&&!h.isSameNode(this.dragLi)&&!this.isDescendant(this.dragLi,h)?this.hasTemplate&&h?(l=E.select(this.fullRowSelect?"."+ks:"."+gs,h),e&&!n&&!s&&p<7&&!i||n&&p<5||s&&c<3?(r=this.fullRowSelect?1:0,this.appendIndicator(h,d,r)):e&&!n&&!s&&!i&&l&&p>l.offsetHeight-10||n&&19<p||s&&19<c?(r=this.fullRowSelect?2:1,this.appendIndicator(h,d,r)):(E.addClass([d],Ns),this.isDropIn=!0)):h&&e&&!n&&!s&&p<7&&!i||n&&p<5||s&&c<3?(r=this.fullRowSelect?1:0,this.appendIndicator(h,d,r)):h&&e&&!n&&!s&&0<e.target.offsetHeight&&p>e.target.offsetHeight-10&&!i||n&&19<p||s&&19<c?(r=this.fullRowSelect?2:1,this.appendIndicator(h,d,r)):(E.addClass([d],Ns),this.isDropIn=!0):"LI"!==e.target.nodeName||h.isSameNode(this.dragLi)||this.isDescendant(this.dragLi,h)?e.target.classList.contains(xs)?E.addClass([d],Os):E.addClass([d],ws):(E.addClass([d],Os),this.renderVirtualEle(e))):(E.addClass([d],Ls),document.body.style.cursor="not-allowed"),E.closest(e.target,".e-list-item")),l=(a&&(o=parseInt(a.getAttribute("aria-level"),10)),this.getDragEvent(e.event,this,e.target,e.target,null,t,o));l.dropIndicator&&E.removeClass([d],l.dropIndicator),this.trigger("nodeDragging",l),l.dropIndicator&&E.addClass([d],l.dropIndicator)},p.prototype.appendIndicator=function(e,t,i){E.addClass([t],Os);t=this.createElement("div",{className:xs});e.insertBefore(t,e.children[parseInt(i.toString(),10)])},p.prototype.dropAction=function(e){for(var t,i=e.event,s=this.getOffsetY(i,e.target),n=e.target,i=!1,r=[],o=[],l=e.dragData.draggable,a=0;a<l.ej2_instances.length;a++)if(l.ej2_instances[parseInt(a.toString(),10)]instanceof en){t=l.ej2_instances[parseInt(a.toString(),10)];break}if(t&&t.dragTarget){var d=t.dragTarget,d=E.closest(d,"."+w),h=E.closest(n,"."+w);if(o.push(d),null==h&&n.classList.contains(as)&&(h=n.firstElementChild),E.detach(e.droppedElement),document.body.style.cursor="",!h||h.isSameNode(d)||this.isDescendant(d,h))return void(this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1));if(t.allowMultiSelection&&d.classList.contains(ps)){var c=E.selectAll("."+ps,t.element),o=c;if(e.target.offsetHeight<=33&&s>e.target.offsetHeight-10&&6<s)for(a=c.length-1;0<=a;a--)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s);else for(a=0;a<c.length;a++)h.isSameNode(c[parseInt(a.toString(),10)])||this.isDescendant(c[parseInt(a.toString(),10)],h)||this.appendNode(n,c[parseInt(a.toString(),10)],h,e,t,s)}else this.appendNode(n,d,h,e,t,s);d=parseInt(d.getAttribute("aria-level"),10),i=!0}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1);for(a=0;a<o.length;a++)r.push(this.getNode(o[parseInt(a.toString(),10)]));this.trigger("nodeDropped",this.getDragEvent(e.event,t,n,e.target,e.dragData.draggedElement,null,d,i)),t.element.id!==this.element.id&&(t.triggerEvent("nodeDropped",r),this.isNodeDropped=!0,this.fields.dataSource=this.treeData),this.triggerEvent("nodeDropped",r)},p.prototype.appendNode=function(e,t,i,s,n,r){var o=E.closest(e,"."+Us),l=E.closest(s.target,"."+u),a=E.closest(s.target,"."+O);t.classList.contains("e-disable")||o||!(a&&s.event.offsetY<5||l&&s.event.offsetX<3||a&&19<s.event.offsetY||l&&19<s.event.offsetX||!a&&!l)?this.dropAsChildNode(t,i,n,null,s,r,!0,e):"LI"===e.nodeName?this.dropAsSiblingNode(t,i,s,n):e.firstElementChild&&e.classList.contains(as)?"UL"===e.firstElementChild.nodeName&&this.dropAsSiblingNode(t,i,s,n):e.classList.contains("e-icon-collapsible")||e.classList.contains("e-icon-expandable")?this.dropAsSiblingNode(t,i,s,n):this.dropAsChildNode(t,i,n,null,s,r,null,e),this.showCheckBox&&this.ensureIndeterminate()},p.prototype.dropAsSiblingNode=function(e,t,i,s){var n,r,o=E.closest(t,"."+L),l=E.closest(e,"."+L),a=E.closest(l,"."+w);0<i.target.offsetHeight&&i.event.offsetY>i.target.offsetHeight-2?n=!1:i.event.offsetY<2?n=!0:(i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible"))&&(i.event.offsetY<5||i.event.offsetX<3?n=!0:(15<i.event.offsetY||17<i.event.offsetX)&&(n=!1)),i.target.classList.contains("e-icon-expandable")||i.target.classList.contains("e-icon-collapsible")?(r=i.target.closest("li"),o.insertBefore(e,n?r:r.nextElementSibling)):o.insertBefore(e,n?i.target:i.target.nextElementSibling),this.moveData(e,t,o,n,s),this.updateElement(l,a),this.updateAriaLevel(e),s.element.id===this.element.id?this.updateList():(s.updateInstance(),this.updateInstance())},p.prototype.dropAsChildNode=function(e,t,i,s,n,r,o,l){var a,d=E.closest(e,"."+L),h=E.closest(d,"."+w),c=E.closest(t,"."+L);n&&n.target&&(a=E.select(this.fullRowSelect?"."+ks:"."+gs,t)),n&&(r<7&&!l.classList.contains("e-sibling")||l.classList.contains("e-sibling")&&!t.lastChild.classList.contains("e-sibling"))&&!o?(c.insertBefore(e,t),this.moveData(e,t,c,!0,i)):n&&0<n.target.offsetHeight&&r>n.target.offsetHeight-10&&!o&&!this.hasTemplate||this.hasTemplate&&a&&r>a.offsetHeight-10&&!o?(c.insertBefore(e,t.nextElementSibling),this.moveData(e,t,c,!1,i)):(l=this.expandParent(t),n=E.isNullOrUndefined(s)?null:l.childNodes[parseInt(s.toString(),10)],l.insertBefore(e,n),this.moveData(e,n,l,!0,i)),this.updateElement(d,h),this.updateAriaLevel(e),i.element.id===this.element.id?this.updateList():(i.updateInstance(),this.updateInstance())},p.prototype.moveData=function(e,t,i,s,n){var i=E.closest(i,"."+w),e=this.getId(e),r=n.updateChildField(n.treeData,n.fields,e,null,null,!0),t=this.getId(t),t=this.getDataPos(this.treeData,this.fields,t),i=this.getId(i);if(1===this.dataType){this.updateField(this.treeData,this.fields,i,"hasChildren",!0);var o,l=E.isNullOrUndefined(t)?this.treeData.length:s?t:t+1;if(E.isNullOrUndefined(i)&&!this.hasPid?delete r[0][this.fields.parentID]:(o=this.isNumberTypeId?parseFloat(i):i,E.setValue(this.fields.parentID,o,r[0])),this.treeData.splice(l,0,r[0]),n.element.id!==this.element.id){var a=n.removeChildNodes(e);l++;for(var d=0,h=a.length;d<h;d++)this.treeData.splice(l,0,a[parseInt(d.toString(),10)]),l++;n.groupedData=n.getGroupedData(n.treeData,n.fields.parentID)}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.addChildData(this.treeData,this.fields,i,r,s?t:t+1)},p.prototype.expandParent=function(e){var t,i=E.select("div."+O+", div."+u,e),s=(i&&i.classList.contains(O)&&!0!==this.preventExpand&&this.expandAction(e,i,null),E.select("."+L,e)),n=(!0===this.preventExpand&&!s&&i&&this.renderChildNodes(e),s=E.select("."+L,e),!E.isNullOrUndefined(s)&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(s.style.display="none"),E.isNullOrUndefined(s)||!1!==this.preventExpand||(s.style.display="block"),E.isNullOrUndefined(s)&&!0===this.preventExpand&&(E.isNullOrUndefined(i)&&U.ListBase.generateIcon(this.createElement,e,O,this.listBaseOption),(t=E.select("div."+O+", div."+u,e))&&t.classList.add("e-icon-expandable"),s=U.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),t?E.removeClass([t],u):U.ListBase.generateIcon(this.createElement,e,O,this.listBaseOption),e.setAttribute("aria-expanded","false"),s.style.display="none"),E.isNullOrUndefined(s)&&(n=this.expandArgs,(E.isNullOrUndefined(n)||n&&"nodeExpanding"!==n.name)&&this.trigger("nodeExpanding",this.getExpandEvent(e,null)),E.isNullOrUndefined(i)&&U.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),(t=E.select("div."+O+", div."+u,e))||(U.ListBase.generateIcon(this.createElement,e,u,this.listBaseOption),t=E.select("div."+fs,e)),E.removeClass([t],O),s=U.ListBase.generateUL(this.createElement,[],null,this.listBaseOption),e.appendChild(s),this.addExpand(e),this.trigger("nodeExpanded",this.getExpandEvent(e,null))),E.select("div."+u,e));return!E.isNullOrUndefined(s)&&n&&this.preventExpand&&"true"!==e.getAttribute("aria-expanded")&&(E.removeClass([n],u),e.setAttribute("aria-expanded","false"),E.addClass([n],O)),s},p.prototype.updateElement=function(e,t){var i;t&&0===e.childElementCount&&(i=E.select("div."+fs,t),E.detach(e),E.detach(i),e=this.getId(t),this.updateField(this.treeData,this.fields,e,"hasChildren",!1),this.removeExpand(t,!0))},p.prototype.updateAriaLevel=function(e){var t=this.parents(e,"."+L).length;e.setAttribute("aria-level",""+t),this.updateChildAriaLevel(E.select("."+L,e),t+1)},p.prototype.updateChildAriaLevel=function(e,t){if(!E.isNullOrUndefined(e))for(var i=e.childNodes,s=0,n=i.length;s<n;s++){var r=i[parseInt(s.toString(),10)];r.setAttribute("aria-level",""+t),this.updateChildAriaLevel(E.select("."+L,r),t+1)}},p.prototype.renderVirtualEle=function(e){var t=e.event,t=this.getOffsetY(t,e.target),t=(t>e.target.offsetHeight-2?i=!1:t<2&&(i=!0),this.createElement("div",{className:xs})),i=this.fullRowSelect?i?1:2:i?0:1;e.target.insertBefore(t,e.target.children[parseInt(i.toString(),10)])},p.prototype.removeVirtualEle=function(){var e=E.select("."+xs);e&&E.detach(e)},p.prototype.destroyDrag=function(){this.dragObj&&this.dropObj&&(this.dragObj.destroy(),this.dropObj.destroy())},p.prototype.getDragEvent=function(e,t,i,s,n,r,o,l){var a=i?E.closest(i,"."+w):null,d=a?this.getNodeData(a):null,h=t?t.dragLi:n,n=t?t.dragData:null,c=i?this.parents(i,"."+w):null,p=t.dragLi.parentElement,u=t.dragLi?E.closest(p,"."+w):null,m=null,f=null,g=[Os,Ns,ws,Ls],v=null,y=!0===l?h:a,b=y?E.closest(y,".e-list-parent"):null,C=0,S=null,u=t.dragLi&&null===u?E.closest(p,"."+as):u;if(u=!0===l?this.dragParent:u,r)for(;C<4;){if(E.select("."+fs,r).classList.contains(g[parseInt(C.toString(),10)])){v=g[parseInt(C.toString(),10)];break}C++}if(b){for(var I=0,C=0;C<b.childElementCount;C++){if(I=!0!==l&&b.children[parseInt(C.toString(),10)]===h&&a!==h?++I:I,!0!==l&&b.children[parseInt(C.toString(),10)].classList.contains("e-hover")){f=23<=e.offsetY?C+1:C;break}if(b.children[parseInt(C.toString(),10)]===y){e.offsetY,f=C;break}}f=0!==I?--f:f,S=this.isDropIn?"Inside":e.offsetY<7?"Before":"After"}return i&&(m=0===c.length?null:i.classList.contains(w)?c[0]:c[1]),a===h&&(m=a),i&&s.offsetHeight<=33&&e.offsetY<s.offsetHeight-10&&6<e.offsetY&&(m=a,!0!==l)&&(o=++o,f=(t=m?E.select(".e-list-parent",m):null)?t.children.length:0,this.fields.dataSource instanceof x.DataManager||null!==t||!m||(f=(p=m.hasAttribute("data-uid")?this.getChildNodes(this.fields.dataSource,m.getAttribute("data-uid").toString()):null)?p.length:0)),{cancel:!1,clonedNode:r,event:e,draggedNode:h,draggedNodeData:n,droppedNode:a,droppedNodeData:d,dropIndex:f,dropLevel:o,draggedParentNode:u,dropTarget:m,dropIndicator:v,target:s,position:S}},p.prototype.addFullRow=function(e){var t=this.liList.length;if(e)for(var i=0;i<t;i++)this.createFullRow(this.liList[parseInt(i.toString(),10)]);else for(i=0;i<t;i++){var s=E.select("."+ks,this.liList[parseInt(i.toString(),10)]);E.detach(s)}},p.prototype.createFullRow=function(e){var t=this.createElement("div",{className:ks});e.insertBefore(t,e.childNodes[0])},p.prototype.addMultiSelect=function(e){if(e)for(var t=0,i=E.selectAll("."+w+':not([aria-selected="true"])',this.element);t<i.length;t++)i[t].setAttribute("aria-selected","false");else for(var s=0,n=E.selectAll("."+w+'[aria-selected="false"]',this.element);s<n.length;s++)n[s].removeAttribute("aria-selected")},p.prototype.collapseByLevel=function(e,t,i,s){if(s=E.isNullOrUndefined(s)?1:s,0<t&&!E.isNullOrUndefined(e))for(var n=this.getVisibleNodes(i,e.childNodes),r=0,o=n.length;r<o;r++){var l=n[parseInt(r.toString(),10)],a=E.select("."+u,E.select("."+gs,l));t<=s&&!E.isNullOrUndefined(a)&&this.collapseNode(l,a,null),this.collapseByLevel(E.select("."+L,l),t,i,s+1)}},p.prototype.collapseAllNodes=function(e){for(var t=this.getVisibleNodes(e,E.selectAll("."+u,this.element)),i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)],r=E.closest(n,"."+w);this.collapseNode(r,n,null)}},p.prototype.expandByLevel=function(e,t,i){if(0<t&&!E.isNullOrUndefined(e))for(var s=this.getVisibleNodes(i,e.childNodes),n=0,r=s.length;n<r;n++){var o=s[parseInt(n.toString(),10)],l=E.select("."+O,E.select("."+gs,o));E.isNullOrUndefined(l)||this.expandAction(o,l,null),this.expandByLevel(E.select("."+L,o),t-1,i)}},p.prototype.expandAllNodes=function(e){for(var t=0,i=this.getVisibleNodes(e,E.selectAll("."+O,this.element));t<i.length;t++){var s=i[t],n=E.closest(s,"."+w);this.expandAction(n,s,null,!0,null,!0)}},p.prototype.getVisibleNodes=function(e,t){var i=Array.prototype.slice.call(t);if(e)for(var s=0;s<i.length;s++)E.isVisible(i[parseInt(s.toString(),10)])||(i.splice(s,1),s--);return i},p.prototype.removeNode=function(e){var t=E.closest(e,"."+L),i=E.closest(t,"."+w);E.isNullOrUndefined(this.nodeTemplateFn)||this.destroyTemplate(e),E.detach(e),this.updateElement(t,i),this.removeData(e)},p.prototype.updateInstance=function(){this.updateList(),this.updateSelectedNodes(),this.updateExpandedNodes()},p.prototype.updateList=function(){this.liList=Array.prototype.slice.call(E.selectAll("."+w,this.element))},p.prototype.updateSelectedNodes=function(){this.setProperties({selectedNodes:[]},!0);var e=E.selectAll("."+ps,this.element);this.selectGivenNodes(e)},p.prototype.updateExpandedNodes=function(){this.setProperties({expandedNodes:[]},!0);for(var e=E.selectAll('[aria-expanded="true"]',this.element),t=0,i=e.length;t<i;t++)this.addExpand(e[parseInt(t.toString(),10)])},p.prototype.removeData=function(e){var t,i,s,n;1===this.dataType?(t=new x.DataManager(this.treeData),n=this.getId(e),i={},s=this.isNumberTypeId?parseFloat(n):n,i[this.fields.id]=s,t.remove(this.fields.id,i),this.removeChildNodes(n)):(n=this.getId(e),this.updateChildField(this.treeData,this.fields,n,null,null,!0))},p.prototype.removeChildNodes=function(e){var t=this.getChildGroup(this.groupedData,e,!1),i=[];if(t)for(var s=0,n=t.length;s<n;s++){var r=new x.DataManager(this.treeData),o=E.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString(),l={},a=this.isNumberTypeId?parseFloat(o):o,a=(l[this.fields.id]=a,r.remove(this.fields.id,l));i.push(a[0]),this.removeChildNodes(o)}return i},p.prototype.doGivenAction=function(e,t,i){for(var s=0,n=e.length;s<n;s++){var r,o=this.getElement(e[parseInt(s.toString(),10)]);E.isNullOrUndefined(o)||(r=E.select("."+t,E.select("."+gs,o)),E.isNullOrUndefined(r))||(i?this.expandAction(o,r,null):this.collapseNode(o,r,null))}},p.prototype.addGivenNodes=function(e,t,i,s,n){if(0!==e.length){var r,o,l=this.getSortedData(e),a=t?parseFloat(t.getAttribute("aria-level"))+1:1,d=(s&&this.updateMapper(a),U.ListBase.createListItemFromJson(this.createElement,l,this.listBaseOption,a)),h=this.getId(t),c=(E.isNullOrUndefined(t)||(r=E.select("div."+fs,t)),1===this.dataType&&r&&r.classList.contains(O)&&this.preventExpand&&!E.isNullOrUndefined(this.element.offsetParent)&&!this.element.offsetParent.parentElement.classList.contains("e-filemanager")&&(this.preventExpand=!0),1!==this.dataType&&(this.addChildData(this.treeData,this.fields,h,e,i),this.isFirstRender=!1),o=n||(t?this.expandParent(t):E.select("."+L,this.element)),E.isNullOrUndefined(i)?null:o.childNodes[parseInt(i.toString(),10)]);if(!this.isFirstRender||1===this.dataType){s=this.expandArgs;if(c||"None"===this.sortOrder){for(var p=0;p<d.length;p++)o.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||E.isNullOrUndefined(t)||this.preventExpand||E.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=E.select("div."+fs,t))&&u.classList.contains(O)&&(E.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}if(!c&&("Ascending"===this.sortOrder||"Descending"===this.sortOrder))if(0===o.childNodes.length){for(var u,p=0;p<d.length;p++)o.insertBefore(d[parseInt(p.toString(),10)],c);1!==this.dataType||E.isNullOrUndefined(t)||this.preventExpand||E.isNullOrUndefined(this.element.offsetParent)||this.element.offsetParent.parentElement.classList.contains("e-filemanager")||(this.preventExpand=!1,(u=E.select("div."+fs,t))&&u.classList.contains(O)&&(E.isNullOrUndefined(s)||"nodeExpanding"!==s.name)&&this.expandAction(t,u,null))}else for(var m=o.childNodes,p=0;p<d.length;p++)for(var f=0;f<m.length;f++){if("Ascending"===this.sortOrder?m[parseInt(f.toString(),10)].textContent.toUpperCase()>d[parseInt(p.toString(),10)].innerText.toUpperCase():m[parseInt(f.toString(),10)].textContent.toUpperCase()<d[parseInt(p.toString(),10)].innerText.toUpperCase()){o.insertBefore(d[parseInt(p.toString(),10)],m[parseInt(f.toString(),10)]);break}o.insertBefore(d[parseInt(p.toString(),10)],m[m.length])}}if(1===this.dataType){this.updateField(this.treeData,this.fields,h,"hasChildren",!0);for(var g,l=this.getId(c),v=E.isNullOrUndefined(l)?this.treeData.length:this.getDataPos(this.treeData,this.fields,l),f=0;f<e.length;f++)E.isNullOrUndefined(h)||(g=this.isNumberTypeId?parseFloat(h):h,E.setValue(this.fields.parentID,g,e[parseInt(f.toString(),10)])),this.treeData.splice(v,0,e[parseInt(f.toString(),10)]),v++}this.finalizeNode(o)}},p.prototype.updateMapper=function(e){e=1===e?this.fields:this.getChildFields(this.fields,e-1,1);this.updateListProp(e)},p.prototype.updateListProp=function(e){e=this.getActualProperties(e);this.listBaseOption.fields=e,this.listBaseOption.fields.url=Object.prototype.hasOwnProperty.call(e,"navigateUrl")?e.navigateUrl:"navigateUrl"},p.prototype.getDataPos=function(e,t,i){for(var s=null,n=0,r=e.length;n<r;n++){var o=E.getValue(t.id,e[parseInt(n.toString(),10)]);if(e[parseInt(n.toString(),10)]&&o&&o.toString()===i)return n;if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(n.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(n.toString(),10)]))){o=E.getValue("child",e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(o,this.getChildMapper(t),i)))break}}else{o=E.getValue(t.child,e[parseInt(n.toString(),10)]);if(null!==(s=this.getDataPos(o,this.getChildMapper(t),i)))break}}return s},p.prototype.addChildData=function(e,t,i,s,n){if(E.isNullOrUndefined(i)){n=E.isNullOrUndefined(n)?e.length:n;for(var r=0,o=s.length;r<o;r++)e.splice(n,0,s[parseInt(r.toString(),10)]),n++}else for(var l=0,a=e.length;l<a;l++){var d=E.getValue(t.id,e[parseInt(l.toString(),10)]);if(e[parseInt(l.toString(),10)]&&d&&d.toString()===i){if("string"==typeof t.child&&Object.prototype.hasOwnProperty.call(e[parseInt(l.toString(),10)],t.child)&&null!==e[parseInt(l.toString(),10)][t.child]||this.fields.dataSource instanceof x.DataManager&&Object.prototype.hasOwnProperty.call(e[parseInt(l.toString(),10)],"child")){var h="string"==typeof t.child?t.child:"child",c=E.getValue(h,e[parseInt(l.toString(),10)]);E.isNullOrUndefined(c)&&(c=[]),n=E.isNullOrUndefined(n)?c.length:n;for(r=0,o=s.length;r<o;r++)c.splice(n,0,s[parseInt(r.toString(),10)]),n++}else{h="string"==typeof t.child?t.child:"child";e[parseInt(l.toString(),10)][""+h]=s}return!0}if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(l.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(l.toString(),10)]))){c=E.getValue("child",e[parseInt(l.toString(),10)]);if(void 0!==(p=this.addChildData(c,this.getChildMapper(t),i,s,n)))break}}else{var p,d=E.getValue(t.child,e[parseInt(l.toString(),10)]);if(void 0!==(p=this.addChildData(d,this.getChildMapper(t),i,s,n)))break}}return p},p.prototype.doDisableAction=function(e){var e=this.nodeType(e),t=this.checkValidId(e);this.validArr=[];for(var i=0,s=t.length;i<s;i++){var n=t[parseInt(i.toString(),10)][this.fields.id].toString(),n=(n&&-1===this.disableNode.indexOf(n)&&this.disableNode.push(n),this.getElement(n));n&&(n.setAttribute("aria-disabled","true"),E.addClass([n],Ds))}},p.prototype.doEnableAction=function(e){for(var t=this.nodeType(e),i=0,s=t.length;i<s;i++){var n=this.getElement(t[parseInt(i.toString(),10)]),r=t[parseInt(i.toString(),10)];r&&-1!==this.disableNode.indexOf(r)&&this.disableNode.splice(this.disableNode.indexOf(r),1),n&&(n.removeAttribute("aria-disabled"),E.removeClass([n],Ds))}},p.prototype.nodeType=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=void 0;"string"==typeof e[parseInt(i.toString(),10)]?n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].toString():null:"object"==typeof e[parseInt(i.toString(),10)]&&(n=e[parseInt(i.toString(),10)]?e[parseInt(i.toString(),10)].getAttribute("data-uid").toString():null),-1===t.indexOf(n)&&t.push(n)}return t},p.prototype.checkValidId=function(t){var i=this;if(1===this.dataType)this.validArr=this.treeData.filter(function(e){return-1!==t.indexOf(e[i.fields.id]?e[i.fields.id].toString():null)});else if(2===this.dataType)for(var e=0;e<this.treeData.length;e++){var s=this.treeData[parseInt(e.toString(),10)][this.fields.id]?this.treeData[parseInt(e.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(this.treeData[parseInt(e.toString(),10)]),E.getValue(this.fields.child.toString(),this.treeData[parseInt(e.toString(),10)]));s&&this.filterNestedChild(s,t)}return this.validArr},p.prototype.filterNestedChild=function(e,t){for(var i=0;i<e.length;i++){var s=e[parseInt(i.toString(),10)][this.fields.id]?e[parseInt(i.toString(),10)][this.fields.id].toString():null,s=(-1!==t.indexOf(s)&&this.validArr.push(e[parseInt(i.toString(),10)]),E.getValue(this.fields.child.toString(),e[parseInt(i.toString(),10)]));s&&this.filterNestedChild(s,t)}},p.prototype.setTouchClass=function(){var e=E.closest(this.element,".e-bigger");this.touchClass=E.isNullOrUndefined(e)?"":"e-small"},p.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[parseInt(t.toString(),10)],"selected",!0);for(var s=this.expandedNodes,n=0,r=s.length;n<r;n++)this.updateField(this.treeData,this.fields,s[parseInt(n.toString(),10)],"expanded",!0);if(this.showCheckBox){this.removeField(this.treeData,this.fields,["isChecked"]);for(var o=this.checkedNodes,l=0,r=o.length;l<r;l++)this.updateField(this.treeData,this.fields,o[parseInt(l.toString(),10)],"isChecked",!0)}},p.prototype.removeField=function(e,t,i){if(!E.isNullOrUndefined(e)&&!E.isNullOrUndefined(t))for(var s=0,n=e.length;s<n;s++){for(var r=0;r<i.length;r++){var o=this.getMapperProp(t,i[parseInt(r.toString(),10)]);E.isNullOrUndefined(e[parseInt(s.toString(),10)][""+o])||delete e[parseInt(s.toString(),10)][""+o]}"string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(s.toString(),10)]))?this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(s.toString(),10)]))&&this.removeField(E.getValue("child",e[parseInt(s.toString(),10)]),this.getChildMapper(t),i):this.removeField(E.getValue(t.child,e[parseInt(s.toString(),10)]),this.getChildMapper(t),i)}},p.prototype.getMapperProp=function(e,t){switch(t){case"selected":return E.isNullOrUndefined(e.selected)?"selected":e.selected;case"expanded":return E.isNullOrUndefined(e.expanded)?"expanded":e.expanded;case"isChecked":return E.isNullOrUndefined(e.isChecked)?"isChecked":e.isChecked;case"hasChildren":return E.isNullOrUndefined(e.hasChildren)?"hasChildren":e.hasChildren;default:return t}},p.prototype.updateField=function(e,t,i,s,n){var r;E.isNullOrUndefined(i)||(1===this.dataType?(r=this.isNumberTypeId?parseFloat(i):i,r=new x.DataManager(this.treeData).executeLocal((new x.Query).where(t.id,"equal",r,!1)),E.setValue(this.getMapperProp(t,s),n,r[0])):this.updateChildField(e,t,i,s,n))},p.prototype.updateChildField=function(e,t,i,s,n,r){if(!E.isNullOrUndefined(e))for(var o=0,l=e.length;o<l;o++){var a=E.getValue(t.id,e[parseInt(o.toString(),10)]);if(e[parseInt(o.toString(),10)]&&!E.isNullOrUndefined(a)&&a.toString()===i)return d=r?e.splice(o,1):(E.setValue(this.getMapperProp(t,s),n,e[parseInt(o.toString(),10)]),[]);if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(o.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(o.toString(),10)]))){a=E.getValue("child",e[parseInt(o.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}else{var d,a=E.getValue(t.child,e[parseInt(o.toString(),10)]);if(void 0!==(d=this.updateChildField(a,this.getChildMapper(t),i,s,n,r)))break}}return d},p.prototype.triggerEvent=function(e,t){if(this.renderReactTemplates(),"addNodes"===e){for(var i=[],s=0;s<t.length;s++)i.push(this.getNode(this.getElement(E.isNullOrUndefined(t[parseInt(s.toString(),10)][this.fields.id])?E.getValue(this.fields.id,t[parseInt(s.toString(),10)]).toString():null)));t=i}e={data:this.treeData,action:e,nodeData:t};this.trigger("dataSourceChanged",e)},p.prototype.wireInputEvents=function(e){E.EventHandler.add(e,"blur",this.inputFocusOut,this)},p.prototype.wireEditingEvents=function(e){var t=this;e&&!this.disabled?this.touchEditObj=new E.Touch(this.element,{tap:function(e){t.isDoubleTapped(e)&&2===e.tapCount&&(e.originalEvent.preventDefault(),t.editingHandler(e.originalEvent))}}):this.touchEditObj&&this.touchEditObj.destroy()},p.prototype.wireClickEvent=function(e){var t=this;e?this.touchClickObj=new E.Touch(this.element,{tap:function(e){t.clickHandler(e)}}):this.touchClickObj&&this.touchClickObj.destroy()},p.prototype.wireExpandOnEvent=function(e){var t=this;e?this.touchExpandObj=new E.Touch(this.element,{tap:function(e){("Click"===t.expandOnType||"DblClick"===t.expandOnType&&t.isDoubleTapped(e)&&2===e.tapCount)&&3!==e.originalEvent.which&&t.expandHandler(e)}}):this.touchExpandObj&&this.touchExpandObj.destroy()},p.prototype.mouseDownHandler=function(e){this.mouseDownStatus=!0,(e.shiftKey||e.ctrlKey)&&e.preventDefault(),e.ctrlKey&&this.allowMultiSelection&&E.EventHandler.add(this.element,"contextmenu",this.preventContextMenu,this)},p.prototype.preventContextMenu=function(e){e.preventDefault()},p.prototype.wireEvents=function(){E.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),this.wireClickEvent(!0),"None"!==this.expandOnType&&this.wireExpandOnEvent(!0),E.EventHandler.add(this.element,"mouseover",this.onMouseOver,this),E.EventHandler.add(this.element,"mouseout",this.onMouseLeave,this),this.keyboardModule=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},p.prototype.unWireEvents=function(){E.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.wireClickEvent(!1),this.wireExpandOnEvent(!1),E.EventHandler.remove(this.element,"mouseover",this.onMouseOver),E.EventHandler.remove(this.element,"mouseout",this.onMouseLeave),this.disabled||this.keyboardModule.destroy()},p.prototype.parents=function(e,t){for(var i=[],s=e.parentNode;!E.isNullOrUndefined(s);)E.matches(s,t)&&i.push(s),s=s.parentNode;return i},p.prototype.isDoubleTapped=function(e){var t,i=e.originalEvent.target;return i&&e.tapCount&&(1===e.tapCount?this.firstTap=E.closest(i,"."+w):2===e.tapCount&&(t=E.closest(i,"."+w))),this.firstTap===t},p.prototype.isDescendant=function(e,t){for(var i=t.parentNode;!E.isNullOrUndefined(i);){if(i===e)return!0;i=i.parentNode}return!1},p.prototype.showSpinner=function(e){E.addClass([e],us),g.createSpinner({target:e,width:E.Browser.isDevice?16:14},this.createElement),g.showSpinner(e)},p.prototype.hideSpinner=function(e){g.hideSpinner(e),e.innerHTML="",E.removeClass([e],us)},p.prototype.setCheckedNodes=function(e){1<(e=JSON.parse(JSON.stringify(e))).length&&"function"==typeof this.nodeChecked&&0<this.nodeChecked.length&&(this.isFilter=!0),this.uncheckAll(this.checkedNodes),this.setIndeterminate(e),0<e.length&&this.checkAll(e)},p.prototype.setValidCheckedNode=function(e,t){if(void 0===t&&(t=[]),1===this.dataType){var i=this.fields,i=new x.DataManager(this.treeData).executeLocal((new x.Query).where(i.id,"equal",e,!0));if(i[0]&&(this.setChildCheckState(i,e,i[0],t),this.autoCheck)){for(var i=i[0][this.fields.parentID]?i[0][this.fields.parentID].toString():null,s=this.getChildNodes(this.treeData,i),n=0,r=0;r<s.length;r++){var o=s[parseInt(r.toString(),10)][this.fields.id].toString();-1!==this.checkedNodes.indexOf(o)&&n++}n===s.length&&-1===this.checkedNodes.indexOf(i)&&i&&this.checkDisabledState(i)}}else if(2===this.dataType)for(var l=0;l<this.treeData.length;l++){if((this.treeData[parseInt(l.toString(),10)][this.fields.id]?this.treeData[parseInt(l.toString(),10)][this.fields.id].toString():"")===e&&-1===this.checkedNodes.indexOf(e)){this.checkDisabledState(e);break}var a=E.getValue(this.fields.child.toString(),this.treeData[parseInt(l.toString(),10)]);a&&this.setChildCheckState(a,e,this.treeData[parseInt(l.toString(),10)],t)}},p.prototype.setChildCheckState=function(e,t,i,s){void 0===s&&(s=[]);var n,r=0;if(1===this.dataType){i&&(n=i[this.fields.id]?i[this.fields.id].toString():null);for(var o=0;o<e.length;o++){var l=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():null,a=(i&&n&&this.autoCheck&&-1!==this.checkedNodes.indexOf(n)&&-1===this.checkedNodes.indexOf(l)&&this.checkDisabledState(l,e[o]),l===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),this.getChildNodes(this.treeData,l)),d=1===s.length&&s[0]===l;a.length!==t.length&&!d||this.setChildCheckState(a,t,i)}}else{i&&(n=i[this.fields.id]?i[this.fields.id].toString():"");for(o=0;o<e.length;o++){var h=e[parseInt(o.toString(),10)][this.fields.id]?e[parseInt(o.toString(),10)][this.fields.id].toString():"",d=1===[t].length&&0===s.length;i&&n&&this.autoCheck&&(-1===this.checkedNodes.indexOf(n)||-1!==this.checkedNodes.indexOf(h)||h!==t&&!d||this.checkDisabledState(h,e[o])),h===t&&-1===this.checkedNodes.indexOf(t)&&this.checkDisabledState(t),(a=E.getValue(this.fields.child.toString(),e[parseInt(o.toString(),10)]))&&this.setChildCheckState(a,t,e[parseInt(o.toString(),10)]),-1!==this.checkedNodes.indexOf(h)&&this.autoCheck&&r++,r===e.length&&-1===this.checkedNodes.indexOf(n)&&this.autoCheck&&this.checkDisabledState(n,i)}}},p.prototype.setIndeterminate=function(e){for(var t=0;t<e.length;t++)this.setValidCheckedNode(e[parseInt(t.toString(),10)],e)},p.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[parseInt(r.toString(),10)]),n++}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}else this.updateChildPosition(this.treeData,this.fields,e,[t],void 0)},p.prototype.updateChildPosition=function(e,t,i,s,n){for(var r=0,o=e.length;r<o;r++){var l=E.getValue(t.id,e[parseInt(r.toString(),10)]);if(e[parseInt(r.toString(),10)]&&l&&l.toString()===i)return e[parseInt(r.toString(),10)]=s[0],!0;if("string"!=typeof t.child||E.isNullOrUndefined(E.getValue(t.child,e[parseInt(r.toString(),10)]))){if(this.fields.dataSource instanceof x.DataManager&&!E.isNullOrUndefined(E.getValue("child",e[parseInt(r.toString(),10)]))){l=E.getValue("child",e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(l,this.getChildMapper(t),i,s,n)))break}}else{var a,l=E.getValue(t.child,e[parseInt(r.toString(),10)]);if(void 0!==(a=this.updateChildPosition(l,this.getChildMapper(t),i,s,n)))break}}return a},p.prototype.dynamicState=function(){this.setDragAndDrop(this.allowDragAndDrop),this.wireEditingEvents(this.allowEditing),this.disabled?(this.unWireEvents(),this.rippleFn(),this.rippleIconFn()):(this.wireEvents(),this.setRipple())},p.prototype.crudOperation=function(e,t,i,s,n,r,o){var l,a=this,d=this.fields.dataSource,h=[],c=this.getQuery(this.fields),p=this.fields.id,u={addedRecords:[],deletedRecords:[],changedRecords:[]},m=[];t?m=this.nodeType(t):i&&("string"==typeof i?m[0]=i.toString():"object"==typeof i&&(m[0]=i.getAttribute("data-uid").toString()));for(var f=0,g=m.length;f<g;f++){var v=this.getElement(m[parseInt(f.toString(),10)]);E.isNullOrUndefined(v)||(v=this.getNodeObject(m[parseInt(f.toString(),10)]),h.push(v))}switch(e){case"delete":(l=1===t.length?d.remove(p,h[0],c.fromTable,c):(u.deletedRecords=h,d.saveChanges(u,p,c.fromTable,c))).then(function(){return a.deleteSuccess(m)}).catch(function(e){return a.dmFailure(e)});break;case"update":h[0][this.fields.text]=s,(l=d.update(p,h[0],c.fromTable,c)).then(function(){return a.editSucess(i,s,o)}).catch(function(e){return a.dmFailure(e,i,o)});break;case"insert":if(1===n.length)l=d.insert(n[0],c.fromTable,c);else{for(var y=[],f=0,g=n.length;f<g;f++)y.push(n[parseInt(f.toString(),10)]);u.addedRecords=y,l=d.saveChanges(u,p,c.fromTable,c)}l.then(function(){var e=a.getElement(i);a.addSuccess(n,e,r),a.preventExpand=!1}).catch(function(e){return a.dmFailure(e)})}},p.prototype.deleteSuccess=function(e){for(var t=[],i=0,s=e.length;i<s;i++){var n=this.getElement(e[parseInt(i.toString(),10)]);t.push(this.getNode(n)),E.isNullOrUndefined(n)||this.removeNode(n)}this.updateInstance(),1===this.dataType&&(this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)),this.triggerEvent("removeNode",t)},p.prototype.editSucess=function(e,t,i){var e=this.getElement(e),s=E.select("."+hs,e);this.appendNewText(e,s,t,i)},p.prototype.addSuccess=function(e,t,i){var s,n=this,r=t?t.querySelector("."+fs):null;t&&r&&r.classList.contains(O)&&null===t.querySelector("."+L)?this.renderChildNodes(t,null,function(){s=t.querySelector("."+L),n.addGivenNodes(e,t,i,!0,s),n.triggerEvent("addNodes",e)}):(this.addGivenNodes(e,t,i,!0),this.triggerEvent("addNodes",e))},p.prototype.dmFailure=function(e,t,i){t&&this.updatePreviousText(t,i),this.trigger("actionFailure",{error:e})},p.prototype.updatePreviousText=function(e,t){var e=this.getElement(e),i=E.select("."+hs,e);this.updateText(e,i,this.oldText,t)},p.prototype.getHierarchicalParentId=function(t,e,i){var s=this;if(-1===e.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t}))for(var n=0;n<e.length;n++){var r=E.getValue(this.fields.child.toString(),e[parseInt(n.toString(),10)]);if(!E.isNullOrUndefined(r)){if(-1!==r.findIndex(function(e){return e[s.fields.id]&&e[s.fields.id].toString()===t})){i.push(e[parseInt(n.toString(),10)][this.fields.id].toString()),this.getHierarchicalParentId(e[parseInt(n.toString(),10)][this.fields.id].toString(),this.treeData,i);break}this.getHierarchicalParentId(t,r,i)}}return i},p.prototype.onPropertyChanged=function(e,t){for(var i,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":1<this.selectedNodes.length&&(i=this.getElement(this.selectedNodes[0]),this.isLoaded=!1,this.removeSelectAll(),this.selectNode(i,null),this.isLoaded=!0),this.setMultiSelect(this.allowMultiSelection),this.addMultiSelect(this.allowMultiSelection);break;case"allowTextWrap":this.setTextWrap(),this.updateWrap();break;case"checkedNodes":this.showCheckBox&&(this.checkedNodes=t.checkedNodes,this.setCheckedNodes(e.checkedNodes));break;case"autoCheck":this.showCheckBox&&(this.autoCheck=e.autoCheck,this.ensureIndeterminate());break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRtl();break;case"expandedNodes":this.isAnimate=!1,this.setProperties({expandedNodes:[]},!0),this.collapseAll(),this.isInitalExpand=!0,this.setProperties({expandedNodes:E.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.isReact&&(!this.isReact||this.fields.dataSource instanceof x.DataManager)||(this.element.classList.contains("e-filtering")||(this.DDTTreeData=JSON.parse(JSON.stringify(this.fields.dataSource))),this.reRenderNodes()),this.initialRender=!1,this.isAnimate=!0,this.isFieldChange=!1;break;case"fullRowSelect":this.setFullRow(this.fullRowSelect),this.addFullRow(this.fullRowSelect),this.allowTextWrap&&(this.setTextWrap(),this.updateWrap());break;case"loadOnDemand":if(!1===this.loadOnDemand&&!this.onLoaded){for(var r=this.element.querySelectorAll("li"),o=0;o<r.length;)"true"!==r[parseInt(o.toString(),10)].getAttribute("aria-expanded")&&this.renderChildNodes(r[parseInt(o.toString(),10)],!0,null,!0),o++;this.onLoaded=!0}break;case"nodeTemplate":this.hasTemplate=!1,this.nodeTemplateFn=this.templateComplier(this.nodeTemplate),this.reRenderNodes();break;case"selectedNodes":this.removeSelectAll(),this.setProperties({selectedNodes:e.selectedNodes},!0),this.doSelectionAction();break;case"showCheckBox":case"checkDisabledChildren":case"sortOrder":this.reRenderNodes();break;case"fullRowNavigable":this.setProperties({fullRowNavigable:e.fullRowNavigable},!0),this.listBaseOption.itemNavigable=e.fullRowNavigable,this.reRenderNodes()}},p.prototype.destroy=function(){this.clearTemplate(),this.element.removeAttribute("aria-activedescendant"),this.unWireEvents(),this.wireEditingEvents(!1),this.disabled||(this.rippleFn(),this.rippleIconFn()),this.setCssClass(this.cssClass,null),this.setDragAndDrop(!1),this.setFullRow(!1),this.ulElement&&this.ulElement.parentElement&&this.ulElement.parentElement.removeChild(this.ulElement),this.ulElement=null,this.liList=null,this.startNode=null,this.firstTap=null,this.expandArgs=null,this.dragLi=null,this.dragTarget=null,this.dragParent=null,this.dragObj=null,this.dropObj=null,this.inputObj=null,this.touchEditObj=null,this.touchExpandObj=null,this.touchClickObj=null,$s.prototype.destroy.call(this)},p.prototype.addNodes=function(e,t,i,s){if(!E.isNullOrUndefined(e)){e=JSON.parse(JSON.stringify(e));var n=this.getElement(t);if(this.preventExpand=s,this.fields.dataSource instanceof x.DataManager)this.isOffline?this.addSuccess(e,n,i):this.crudOperation("insert",null,t,null,e,i,this.preventExpand);else if(2===this.dataType)this.addGivenNodes(e,n,i);else{if(n)this.addGivenNodes(e,n,i);else{e=this.getSortedData(e);for(var r=0;r<e.length;r++){var o=E.getValue(this.fields.parentID,e[parseInt(r.toString(),10)]),n=o&&this.getElement(o.toString());!E.isNullOrUndefined(o)&&E.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.preventExpand=!1,this.ensureVisible(o),this.preventExpand=s,this.isHiddenItem=!1,n=this.getElement(o.toString())),this.addGivenNodes([e[parseInt(r.toString(),10)]],n,i)}}this.groupedData=this.getGroupedData(this.treeData,this.fields.parentID)}this.updateCheckedStateFromDS(),this.showCheckBox&&n&&this.ensureParentCheckState(n),this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1,this.triggerEvent("addNodes",e))}},p.prototype.beginEdit=function(e){e=this.getElement(e);E.isNullOrUndefined(e)||this.disabled||this.createTextbox(e)},p.prototype.checkAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!0)},p.prototype.collapseAll=function(e,t,i){E.isNullOrUndefined(e)?0<t?this.collapseByLevel(E.select("."+L,this.element),t,i):this.collapseAllNodes(i):this.doGivenAction(e,u,!1)},p.prototype.disableNodes=function(e){E.isNullOrUndefined(e)||this.doDisableAction(e)},p.prototype.enableNodes=function(e){E.isNullOrUndefined(e)||this.doEnableAction(e)},p.prototype.ensureVisible=function(e){var t=[];if(1===this.dataType)for(var i=this.getTreeData(e);0!==i.length&&!E.isNullOrUndefined(i[0][this.fields.parentID]);)t.push(i[0][this.fields.parentID].toString()),i=this.getTreeData(i[0][this.fields.parentID].toString());else 2===this.dataType&&(t=this.getHierarchicalParentId(e,this.treeData,t));this.expandAll(t.reverse(),null,null,this.isHiddenItem);var s=this.getElement(e);E.isNullOrUndefined(s)||("object"==typeof e&&(e=this.parents(s,"."+w),this.expandAll(e)),setTimeout(function(){s.scrollIntoView({behavior:"smooth"})},450))},p.prototype.expandAll=function(e,t,i,s){this.isAnimate=!s,E.isNullOrUndefined(e)?0<t?this.expandByLevel(E.select("."+L,this.element),t,i):(this.expandAllNodes(i),this.loadOnDemand&&!this.element.classList.contains("e-filtering")||(this.updateAttributes(this.element),this.updateList())):this.doGivenAction(e,O,!0),this.isAnimate=!0},p.prototype.getAllCheckedNodes=function(){return this.checkedNodes},p.prototype.getDisabledNodes=function(){return this.disableNode},p.prototype.getNode=function(e){e=this.getElement(e);return this.getNodeData(e,!0)},p.prototype.getTreeData=function(e){var e=this.getId(e);return this.updatePersistProp(),E.isNullOrUndefined(e)?this.treeData:(e=this.getNodeObject(e),E.isNullOrUndefined(e)?[]:[e])},p.prototype.moveNodes=function(e,t,i,s){if(!E.isNullOrUndefined(e)&&0!==e.length){var n=this.getElement(t),r=[];E.isNullOrUndefined(n)&&(this.isHiddenItem=!0,this.ensureVisible(t),this.isHiddenItem=!1,n=this.getElement(t));for(var o=0;o<e.length;o++){var l=this.getElement(e[parseInt(o.toString(),10)]);r.push(this.getNode(l)),E.isNullOrUndefined(l)||n.isSameNode(l)||this.isDescendant(l,n)||(this.preventExpand=s,this.dropAsChildNode(l,n,this,i,null,null,null,n))}this.fields.dataSource instanceof x.DataManager==!1&&(this.preventExpand=!1),this.triggerEvent("moveNodes",r)}},p.prototype.refreshNode=function(e,t){if(!E.isNullOrUndefined(e)&&!E.isNullOrUndefined(t)){var i,s,n,r,o,l,a=!1,d=(1===this.dataType&&1<t.length?a=!0:2===this.dataType&&1===t.length&&(d=E.getValue(this.fields.child.toString(),t[0]),E.isNullOrUndefined(d)||(a=!0)),this.getElement(e)),h=d?d.getAttribute("data-uid"):e?e.toString():null;if(this.refreshData=this.getNodeObject(h),t=JSON.parse(JSON.stringify(t)),1===this.dataType&&a){for(var c=0;c<t.length;c++)if(E.isNullOrUndefined(t[parseInt(c.toString(),10)][this.fields.parentID])){s=t[parseInt(c.toString(),10)],t.splice(c,1);break}i=E.extend({},this.refreshData,s)}else i=E.extend({},this.refreshData,t[0]);E.isNullOrUndefined(d)?this.updatePosition(h,i,a,t):(this.isRefreshed=!0,l=parseFloat(d.getAttribute("aria-level")),l=U.ListBase.createListItemFromJson(this.createElement,[i],this.listBaseOption,l),o=E.select("."+L,d),n=E.getValue(this.fields.child.toString(),i),a&&o||a&&!E.isNullOrUndefined(n)?(n=d.parentElement,r=Array.prototype.indexOf.call(n.childNodes,d),E.remove(d),n.insertBefore(l[0],n.childNodes[parseInt(r.toString(),10)]),this.updatePosition(h,i,a,t),a&&o&&this.expandAll([h])):(n=E.select("."+gs,d),r=E.select("."+gs,l[0]),o=E.select("div."+fs,n),l=E.select("div."+fs,r),o&&l&&(l.classList.contains(O)&&o.classList.contains(u)?(E.removeClass([l],O),E.addClass([l],u)):l.classList.contains(u)&&o.classList.contains(O)?(E.removeClass([l],u),E.addClass([l],O)):o.classList.contains("interaction")&&E.addClass([l],"interaction")),E.remove(n),(o=E.select("."+ks,d)).parentNode.insertBefore(r,o.nextSibling),this.updatePosition(h,i,a,t)),d=this.getElement(e),i[this.fields.tooltip]&&d.setAttribute("title",i[this.fields.tooltip]),Object.prototype.hasOwnProperty.call(i,this.fields.htmlAttributes)&&i[this.fields.htmlAttributes]&&(E.merge(l={},i[this.fields.htmlAttributes]),l.class?(E.addClass([d],l.class.split(" ")),delete l.class):E.attributes(d,l)),-1!==this.selectedNodes.indexOf(h)&&(d.setAttribute("aria-selected","true"),E.addClass([d],ps)),this.isRefreshed=!1,this.triggerEvent("refreshNode",[this.getNode(d)]))}},p.prototype.removeNodes=function(e){E.isNullOrUndefined(e)||(this.fields.dataSource instanceof x.DataManager&&!this.isOffline?this.crudOperation("delete",e):this.deleteSuccess(e))},p.prototype.updateNode=function(t,i){var s,n,e,r=this;E.isNullOrUndefined(t)||E.isNullOrUndefined(i)||!this.allowEditing||(s=this.getElement(t),E.isNullOrUndefined(s))||(n=E.select("."+hs,s),this.updateOldText(s),e=this.getEditEvent(s,null,null),this.trigger("nodeEditing",e,function(e){e.cancel||(r.fields.dataSource instanceof x.DataManager&&!r.isOffline?r.crudOperation("update",null,t,i,null,null,!1):r.appendNewText(s,n,i,!1))}))},c([E.Property(!(p.prototype.uncheckAll=function(e){this.showCheckBox&&this.doCheckBoxAction(e,!1)}))],p.prototype,"allowDragAndDrop",void 0),c([E.Property(!1)],p.prototype,"allowEditing",void 0),c([E.Property(!1)],p.prototype,"allowMultiSelection",void 0),c([E.Property(!1)],p.prototype,"allowTextWrap",void 0),c([E.Complex({},Js)],p.prototype,"animation",void 0),c([E.Property()],p.prototype,"checkedNodes",void 0),c([E.Property(!0)],p.prototype,"checkDisabledChildren",void 0),c([E.Property("")],p.prototype,"cssClass",void 0),c([E.Property(!1)],p.prototype,"disabled",void 0),c([E.Property(null)],p.prototype,"dragArea",void 0),c([E.Property(!0)],p.prototype,"enableHtmlSanitizer",void 0),c([E.Property(!1)],p.prototype,"enablePersistence",void 0),c([E.Property()],p.prototype,"expandedNodes",void 0),c([E.Property("Auto")],p.prototype,"expandOn",void 0),c([E.Complex({},zs)],p.prototype,"fields",void 0),c([E.Property(!0)],p.prototype,"fullRowSelect",void 0),c([E.Property(!0)],p.prototype,"loadOnDemand",void 0),c([E.Property()],p.prototype,"locale",void 0),c([E.Property()],p.prototype,"nodeTemplate",void 0),c([E.Property()],p.prototype,"selectedNodes",void 0),c([E.Property("None")],p.prototype,"sortOrder",void 0),c([E.Property(!1)],p.prototype,"showCheckBox",void 0),c([E.Property(!0)],p.prototype,"autoCheck",void 0),c([E.Property(!1)],p.prototype,"fullRowNavigable",void 0),c([E.Event()],p.prototype,"actionFailure",void 0),c([E.Event()],p.prototype,"created",void 0),c([E.Event()],p.prototype,"dataBound",void 0),c([E.Event()],p.prototype,"dataSourceChanged",void 0),c([E.Event()],p.prototype,"drawNode",void 0),c([E.Event()],p.prototype,"destroyed",void 0),c([E.Event()],p.prototype,"keyPress",void 0),c([E.Event()],p.prototype,"nodeChecked",void 0),c([E.Event()],p.prototype,"nodeChecking",void 0),c([E.Event()],p.prototype,"nodeClicked",void 0),c([E.Event()],p.prototype,"nodeCollapsed",void 0),c([E.Event()],p.prototype,"nodeCollapsing",void 0),c([E.Event()],p.prototype,"nodeDragging",void 0),c([E.Event()],p.prototype,"nodeDragStart",void 0),c([E.Event()],p.prototype,"nodeDragStop",void 0),c([E.Event()],p.prototype,"nodeDropped",void 0),c([E.Event()],p.prototype,"nodeEdited",void 0),c([E.Event()],p.prototype,"nodeEditing",void 0),c([E.Event()],p.prototype,"nodeExpanded",void 0),c([E.Event()],p.prototype,"nodeExpanding",void 0),c([E.Event()],p.prototype,"nodeSelected",void 0),c([E.Event()],p.prototype,"nodeSelecting",void 0);var $s,en,l=en=c([E.NotifyPropertyChanges],p);function p(e,t){e=$s.call(this,e,t)||this;return e.isRefreshed=!1,e.preventExpand=!1,e.checkedElement=[],e.disableNode=[],e.validArr=[],e.validNodes=[],e.expandChildren=[],e.isFieldChange=!1,e.changeDataSource=!1,e.hasTemplate=!1,e.isFirstRender=!1,e.isNodeDropped=!1,e.isInteracted=!1,e.isRightClick=!1,e.mouseDownStatus=!1,e.isDropIn=!1,e.OldCheckedData=[],e.isHiddenItem=!1,e}tn=function(e,t){return(tn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var tn,sn,c=function(e,t){function i(){this.constructor=e}tn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},f=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},nn="e-sidebar",rn="e-close",on="e-open",ln="e-transition",an="e-sidebar-overlay",dn="e-right",hn="e-left",cn="e-over",pn="e-push",un="e-slide",mn="e-visibility",fn="e-disable-animation",gn="e-sidebar-context",vn="e-sidebar-absolute",c=(sn=E.Component,c(k,sn),k.prototype.preRender=function(){this.setWidth()},k.prototype.render=function(){this.initialize(),this.wireEvents(),this.renderComplete()},k.prototype.initialize=function(){this.setTarget(),this.addClass(),this.setZindex(),this.enableDock&&this.setDock(),this.isOpen?(this.show(),this.firstRender=!0):this.setMediaQuery(),this.checkType(!0),this.setType(this.type),this.setCloseOnDocumentClick(),this.setEnableRTL(),E.Browser.isDevice&&(this.windowWidth=window.innerWidth)},k.prototype.setEnableRTL=function(){(this.enableRtl?E.addClass:E.removeClass)([this.element],"e-rtl")},k.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]),E.addClass([this.element],vn),E.addClass([this.target],gn),this.targetEle=this.getTargetElement())},k.prototype.getTargetElement=function(){for(var e=this.element.nextElementSibling;!E.isNullOrUndefined(e)&&e.classList.contains(nn);)e=e.nextElementSibling;return e},k.prototype.setCloseOnDocumentClick=function(){this.closeOnDocumentClick?(document.addEventListener("mousedown",this.documentClickContext),document.addEventListener("touchstart",this.documentClickContext)):(document.removeEventListener("mousedown",this.documentClickContext),document.removeEventListener("touchstart",this.documentClickContext))},k.prototype.setWidth=function(){this.enableDock&&"Left"===this.position||this.enableDock&&"Right"===this.position?E.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)}):this.enableDock||E.setStyleAttribute(this.element,{width:this.setDimension(this.width)})},k.prototype.setDimension=function(e){return e="number"==typeof e?E.formatUnit(e):"string"==typeof e?e.match(/px|%|em/)?e:E.formatUnit(e):"100%"},k.prototype.setZindex=function(){E.setStyleAttribute(this.element,{"z-index":""+this.zIndex})},k.prototype.addClass=function(){"EJS-SIDEBAR"===this.element.tagName&&E.addClass([this.element],"e-sidebar-display");var e=document.querySelector(".e-main-content");E.isNullOrUndefined(e||this.targetEle)||E.addClass([e||this.targetEle],["e-content-animation"]),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):null,this.enableDock||"Auto"===this.type||E.addClass([this.element],[mn]),E.removeClass([this.element],[on,rn,dn,hn,un,pn,cn]),this.element.classList.add(nn),E.addClass([this.element],"Right"===this.position?dn:hn),this.enableDock&&E.addClass([this.element],"e-dock"),E.isNullOrUndefined(this.tabIndex)||this.element.setAttribute("tabindex",this.tabIndex),"Auto"!==this.type||E.Browser.isDevice?this.isOpen||E.addClass([this.element],[rn,fn]):this.show()},k.prototype.checkType=function(e){"Push"!==this.type&&"Over"!==this.type&&"Slide"!==this.type?this.type="Auto":this.element.classList.contains(rn)||e||this.hide()},k.prototype.transitionEnd=function(e){this.setDock(),E.isNullOrUndefined(e)||this.firstRender||this.triggerChange(),this.firstRender=!1,E.EventHandler.remove(this.element,"transitionend",this.transitionEnd)},k.prototype.destroyBackDrop=function(){var e=document.querySelector(".e-main-content")||this.targetEle;this.target&&this.showBackdrop&&e&&!E.isNullOrUndefined(this.defaultBackdropDiv)?E.removeClass([this.defaultBackdropDiv],an):this.showBackdrop&&this.modal&&(this.modal.style.display="none",this.modal.outerHTML="",this.modal=null)},k.prototype.hide=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!E.isNullOrUndefined(e),event:e||null};this.trigger("close",e,function(e){e.cancel||t.element.classList.contains(rn)||(t.element.classList.contains(on)&&!t.animate&&t.triggerChange(),E.addClass([t.element],rn),E.removeClass([t.element],on),E.setStyleAttribute(t.element,{width:E.formatUnit(t.enableDock?t.dockSize:t.width)}),t.setType(t.type),e=document.querySelector(".e-main-content")||t.targetEle,!t.enableDock&&e&&(e.style.transform="translateX(0px)",e.style["Left"===t.position?"marginLeft":"marginRight"]="0px"),t.destroyBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.remove("e-sidebar-overflow"),t.setProperties({isOpen:!1},!0),t.enableDock&&setTimeout(function(){return t.setTimeOut()},50),E.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},k.prototype.setTimeOut=function(){var e=document.querySelector(".e-main-content")||this.targetEle,t=this.element.getBoundingClientRect().width;!this.element.classList.contains(on)||!e||"Over"===this.type&&this.enableDock?this.element.classList.contains(rn)&&e&&("Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.dockSize?t:this.dockSize):e.style.marginRight=this.setDimension("auto"===this.dockSize?t:this.dockSize)):"Left"===this.position?e.style.marginLeft=this.setDimension("auto"===this.width?t:this.width):e.style.marginRight=this.setDimension("auto"===this.width?t:this.width)},k.prototype.show=function(e){var t=this,e={model:this,element:this.element,cancel:!1,isInteracted:!E.isNullOrUndefined(e),event:e||null};this.trigger("open",e,function(e){e.cancel||(E.removeClass([t.element],[mn,fn]),t.element.classList.contains(on))||(t.element.classList.contains(rn)&&!t.animate&&t.triggerChange(),E.addClass([t.element],[on,ln]),E.setStyleAttribute(t.element,{transform:""}),E.removeClass([t.element],rn),E.setStyleAttribute(t.element,{width:E.formatUnit(t.width)}),t.setType(t.type),t.createBackDrop(),t.setAnimation(),"Slide"===t.type&&document.body.classList.add("e-sidebar-overflow"),t.setProperties({isOpen:!0},!0),E.EventHandler.add(t.element,"transitionend",t.transitionEnd,t))})},k.prototype.setAnimation=function(){this.animate?E.removeClass([this.element],fn):E.addClass([this.element],fn)},k.prototype.triggerChange=function(){var e={name:"change",element:this.element};this.trigger("change",e)},k.prototype.setDock=function(){this.enableDock&&"Left"===this.position&&!this.getState()?E.setStyleAttribute(this.element,{transform:"translateX(-100%) translateX("+this.setDimension(this.dockSize)+")"}):this.enableDock&&"Right"===this.position&&!this.getState()&&E.setStyleAttribute(this.element,{transform:"translateX(100%) translateX(-"+this.setDimension(this.dockSize)+")"}),this.element.classList.contains(rn)&&this.enableDock&&E.setStyleAttribute(this.element,{width:this.setDimension(this.dockSize)})},k.prototype.createBackDrop=function(){var e,t;this.target&&this.showBackdrop&&this.getState()?(e=this.target,t=document.querySelector(".e-main-content")||this.targetEle,this.defaultBackdropDiv=this.createElement("div"),E.addClass([this.defaultBackdropDiv],an),E.setStyleAttribute(this.defaultBackdropDiv,{height:e.style.height}),t.appendChild(this.defaultBackdropDiv)):this.showBackdrop&&!this.modal&&this.getState()&&(this.modal=this.createElement("div"),this.modal.className=an,this.modal.style.display="block",document.body.appendChild(this.modal))},k.prototype.getPersistData=function(){return this.addOnPersist(["type","position","isOpen"])},k.prototype.getModuleName=function(){return"sidebar"},k.prototype.toggle=function(){this.element.classList.contains(on)?this.hide():this.show()},k.prototype.getState=function(){return!!this.element.classList.contains(on)},k.prototype.setMediaQuery=function(){this.mediaQuery&&(("string"==typeof this.mediaQuery?window.matchMedia(this.mediaQuery):this.mediaQuery).matches&&this.windowWidth!==window.innerWidth?this.show():this.getState()&&this.windowWidth!==window.innerWidth&&this.hide())},k.prototype.resize=function(){E.isNullOrUndefined(this.width)||"auto"===this.width||"string"!=typeof this.width||this.width.includes("px")||this.setType(this.type),"Auto"===this.type&&(E.Browser.isDevice?E.addClass([this.element],cn):E.addClass([this.element],pn)),this.setMediaQuery(),E.Browser.isDevice&&(this.windowWidth=window.innerWidth)},k.prototype.documentclickHandler=function(e){E.closest(e.target,".e-control."+nn)||this.hide(e)},k.prototype.enableGestureHandler=function(e){!this.isOpen&&"Left"===this.position&&"Right"===e.swipeDirection&&e.startX<=20&&50<=e.distanceX&&.5<=e.velocity?this.show():this.isOpen&&"Left"===this.position&&"Left"===e.swipeDirection||this.isOpen&&"Right"===this.position&&"Right"===e.swipeDirection?this.hide(e.originalEvent):!this.isOpen&&"Right"===this.position&&"Left"===e.swipeDirection&&window.innerWidth-e.startX<=20&&50<=e.distanceX&&.5<=e.velocity&&this.show()},k.prototype.setEnableGestures=function(){this.enableGestures?(this.mainContentEle=new E.Touch(document.body,{swipe:this.enableGestureHandler.bind(this)}),this.sidebarEle=new E.Touch(this.element,{swipe:this.enableGestureHandler.bind(this)})):this.mainContentEle&&this.sidebarEle&&(this.mainContentEle.destroy(),this.sidebarEle.destroy())},k.prototype.wireEvents=function(){this.setEnableGestures(),E.EventHandler.add(window,"resize",this.resize,this)},k.prototype.unWireEvents=function(){E.EventHandler.remove(window,"resize",this.resize),E.EventHandler.remove(document,"mousedown touchstart",this.documentclickHandler),this.mainContentEle&&this.mainContentEle.destroy(),this.sidebarEle&&this.sidebarEle.destroy()},k.prototype.onPropertyChanged=function(e,t){for(var i=document.querySelector(".e-main-content")||this.targetEle,s=this.isServerRendered,n=0,r=Object.keys(e);n<r.length;n++)switch(r[n]){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),E.removeClass([this.element],[mn]),this.addClass(),E.addClass([this.element],"Auto"===this.type?E.Browser.isDevice?["e-over"]:["e-push"]:["e-"+this.type.toLowerCase()]);break;case"position":this.element.style.transform="",this.setDock(),i&&(i.style["Left"===this.position?"marginRight":"marginLeft"]="0px"),"Right"===this.position?(E.removeClass([this.element],hn),E.addClass([this.element],dn)):(E.removeClass([this.element],dn),E.addClass([this.element],hn)),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),E.isNullOrUndefined(this.target)&&(E.removeClass([this.element],vn),E.removeClass([t.target],gn),E.setStyleAttribute(i,{"margin-left":0,"margin-right":0}),document.body.insertAdjacentElement("afterbegin",this.element)),this.isServerRendered=!1,sn.prototype.refresh.call(this),this.isServerRendered=s;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()}},k.prototype.setType=function(e){var t=this.element.getBoundingClientRect().width,i=(this.setZindex(),document.querySelector(".e-main-content")||this.targetEle),s=(i&&(i.style.transform="translateX(0px)",E.Browser.isDevice||"Auto"===this.type||"Over"===this.type&&this.enableDock||(i.style["Left"===this.position?"marginLeft":"marginRight"]="0px")),this.position,t+"px"),n="Left"===this.position?t:-t;switch(E.removeClass([this.element],[pn,cn,un]),e){case"Push":E.addClass([this.element],[pn]),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s);break;case"Slide":E.addClass([this.element],[un]),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style.transform="translateX("+n+"px)");break;case"Over":E.addClass([this.element],[cn]),this.enableDock&&(this.element.classList.contains(rn)||this.isOpen)&&i&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=this.setDimension(this.dockSize));break;case"Auto":E.addClass([this.element],[ln]),E.Browser.isDevice?i&&this.enableDock&&!this.getState()?(i.style["Left"===this.position?"marginLeft":"marginRight"]=s,E.addClass([this.element],pn)):E.addClass([this.element],cn):(E.addClass([this.element],pn),i&&(this.enableDock||this.element.classList.contains(on))&&(i.style["Left"===this.position?"marginLeft":"marginRight"]=s)),this.createBackDrop()}},k.prototype.destroy=function(){sn.prototype.destroy.call(this),this.target&&E.removeClass([this.target],gn),this.destroyBackDrop(),this.element&&(E.removeClass([this.element],[on,rn,pn,un,cn,hn,dn,ln,fn]),E.removeClass([this.element],vn),this.element.style.width="",this.element.style.zIndex="",this.element.style.transform="",E.isNullOrUndefined(this.sidebarEleCopy.getAttribute("tabindex"))?this.element.removeAttribute("tabindex"):this.element.setAttribute("tabindex",this.tabIndex)),this.windowWidth=null;var e=document.querySelector(".e-main-content")||this.targetEle;E.isNullOrUndefined(e)||(e.style.margin="",e.style.transform=""),this.unWireEvents()},f([E.Property("auto")],k.prototype,"dockSize",void 0),f([E.Property(null)],k.prototype,"mediaQuery",void 0),f([E.Property(!1)],k.prototype,"enableDock",void 0),f([E.Property("en-US")],k.prototype,"locale",void 0),f([E.Property(!1)],k.prototype,"enablePersistence",void 0),f([E.Property(!0)],k.prototype,"enableGestures",void 0),f([E.Property(!1)],k.prototype,"isOpen",void 0),f([E.Property(!1)],k.prototype,"enableRtl",void 0),f([E.Property(!0)],k.prototype,"animate",void 0),f([E.Property("auto")],k.prototype,"height",void 0),f([E.Property(!1)],k.prototype,"closeOnDocumentClick",void 0),f([E.Property("Left")],k.prototype,"position",void 0),f([E.Property(null)],k.prototype,"target",void 0),f([E.Property(!1)],k.prototype,"showBackdrop",void 0),f([E.Property("Auto")],k.prototype,"type",void 0),f([E.Property("auto")],k.prototype,"width",void 0),f([E.Property(1e3)],k.prototype,"zIndex",void 0),f([E.Event()],k.prototype,"created",void 0),f([E.Event()],k.prototype,"close",void 0),f([E.Event()],k.prototype,"open",void 0),f([E.Event()],k.prototype,"change",void 0),f([E.Event()],k.prototype,"destroyed",void 0),f([E.NotifyPropertyChanges],k));function k(e,t){e=sn.call(this,e,t)||this;return e.documentClickContext=e.documentclickHandler.bind(e),e}yn=function(e,t){return(yn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var yn,bn,f=function(e,t){function i(){this.constructor=e}yn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},A=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Cn="e-icon-right",Sn="e-breadcrumb-text",In="e-breadcrumb-icon",En="e-breadcrumb-menu",xn="e-breadcrumb-item",Nn="e-breadcrumb-popup",On="e-breadcrumb-wrap-mode",wn="e-breadcrumb-scroll-mode",Ln="tabindex",kn="e-disabled",An="aria-disabled",Tn=".",Pn=((Pn=a.BreadcrumbOverflowMode||(a.BreadcrumbOverflowMode={})).Hidden="Hidden",Pn.Collapsed="Collapsed",Pn.Menu="Menu",Pn.Wrap="Wrap",Pn.Scroll="Scroll",Pn.None="None",bn=E.ChildProperty,f(Dn,bn),A([E.Property("")],Dn.prototype,"text",void 0),A([E.Property("")],Dn.prototype,"id",void 0),A([E.Property("")],Dn.prototype,"url",void 0),A([E.Property(null)],Dn.prototype,"iconCss",void 0),A([E.Property(!1)],Dn.prototype,"disabled",void 0),Dn);function Dn(){return null!==bn&&bn.apply(this,arguments)||this}Mn=E.Component,f(T,Mn),T.prototype.preRender=function(){},T.prototype.render=function(){this.initialize(),this.renderItems(this.items),this.wireEvents()},T.prototype.initialize=function(){this._maxItems=this.maxItems,E.isNullOrUndefined(this.element.getAttribute("aria-label"))&&this.element.setAttribute("aria-label","breadcrumb"),this.cssClass&&E.addClass([this.element],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&this.element.classList.add("e-rtl"),this.disabled&&(this.element.classList.add(kn),this.element.setAttribute(An,"true")),"Wrap"===this.overflowMode?this.element.classList.add(On):"Scroll"===this.overflowMode&&this.element.classList.add(wn),this.initItems(),this.initPvtProps()},T.prototype.initPvtProps=function(){"Hidden"===this.overflowMode&&0<this._maxItems&&(this.endIndex=this.getEndIndex(),this.startIndex=this.endIndex+1-(this._maxItems-1)),"Menu"===this.overflowMode&&(0<=this._maxItems?(this.startIndex=1<this._maxItems?1:0,this.endIndex=this.getEndIndex(),this.popupUl=this.createElement("ul",{attrs:{TABINDEX:"0",role:"menu"}})):this.startIndex=this.endIndex=null)},T.prototype.getEndIndex=function(){var i,s=this;return this.activeItem?this.items.forEach(function(e,t){e.url!==s.activeItem&&e.text!==s.activeItem||(i=t)}):i=this.items.length-1,i},T.prototype.initItems=function(){if(!this.items.length){var e,t=void 0,i=void 0,s=[];i=(this.url?(t=(e=new URL(this.url,window.location.origin)).origin+"/",e):(t=window.location.origin+"/",window.location)).href.split(t)[1].split("/"),s.push({iconCss:"e-icons e-home",url:t});for(var n=0;n<i.length;n++)i[n]&&(s.push({text:i[n],url:t+i[n]}),t+=i[n]+"/");this.setProperties({items:s},!0)}},T.prototype.renderItems=function(e){var t,i,n=this,r=this.element.classList.contains(Cn),s=e.length;if(s){for(var o,l,a=void 0,d=0,h=void 0,c=2*s-1,p=!1,u=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-wrapped-ol":""}),m=this.createElement("ol",{className:"Wrap"===this.overflowMode?"e-breadcrumb-first-ol":""}),f=this.hasField(e,"iconCss"),g="Collapsed"===this.overflowMode&&0<this._maxItems&&s>this._maxItems&&!this.isExpanded,v="Hidden"===this.overflowMode&&0<this._maxItems,y=("Menu"===this.overflowMode&&this.popupUl&&(this.popupUl.innerHTML=""),{moduleName:this.getModuleName(),showIcon:f,itemNavigable:!0,itemCreated:function(e){var t=e.curData.isLastItem,i=(t&&e.item.children.length&&!n.itemTemplate&&(delete e.curData.isLastItem,l||n.enableActiveItemNavigation||(e.item.innerHTML=n.createElement("span",{className:Sn,innerHTML:e.item.children[0].innerHTML}).outerHTML)),!e.curData.iconCss||e.curData.text||n.itemTemplate||e.item.classList.add("e-icon-item"),v&&e.item.setAttribute("item-index",d.toString()),{item:E.extend({},e.curData.properties||e.curData),element:e.item,cancel:!1}),s=(n.trigger("beforeItemRender",i),p=i.cancel,r||i.element.classList.contains(Cn));s&&e.curData.iconCss&&!n.itemTemplate&&e.item.querySelector(".e-anchor-wrap").appendChild(e.item.querySelector(Tn+In)),i.item.disabled&&(e.item.setAttribute(An,"true"),e.item.classList.add(kn)),i.item.id&&e.item.setAttribute("id",i.item.id),(i.item.disabled||n.disabled)&&e.item.children.length&&!n.itemTemplate&&e.item.children[0].setAttribute(Ln,"-1"),e.curData.isEmptyUrl&&(e.item.children[0].removeAttribute("href"),t&&!n.enableActiveItemNavigation||i.item.disabled||n.disabled||(e.item.children[0].setAttribute(Ln,"0"),E.EventHandler.add(e.item.children[0],"keydown",n.keyDownHandler,n))),e.item.removeAttribute("role"),t&&e.item.setAttribute("data-active-item",""),n.itemTemplate||n.beforeItemRenderChanges(e.curData,i.item,e.item,s)}}),b=0;b<c;b%2&&d++,b++)if(o=this.activeItem&&(this.activeItem===e[d].url||this.activeItem===e[d].text),!(g&&1<b&&b<c-2)&&(!v||!(d<this.startIndex||d>this.endIndex)||b%2&&d===this.startIndex-1||0===d)){b%2?(h=this.createElement("div",{className:"e-breadcrumb-item-wrapper"}),this.separatorTemplate&&"/"===this.separatorTemplate||E.isNullOrUndefined(this.separatorTemplate)?y.template=E.initializeCSPTemplate(function(){return"/"}):y.template=this.separatorTemplate,i=!(y.itemClass="e-breadcrumb-separator"),t=[{previousItem:e[d],nextItem:e[d+1]}]):(y.itemClass="",i=!this.itemTemplate||(y.template=this.itemTemplate,!1),(t=[E.extend({},e[d].properties||e[d])])[0].url||this.itemTemplate||(t=[E.extend({},t[0],{isEmptyUrl:!0,url:"#"})]),a=(v||"Menu"===this.overflowMode)&&d===this.endIndex,(b!==c-1&&!a||this.itemTemplate)&&!o||(t[0].isLastItem=!0));var C=u,S=this.startIndex+this.endIndex-this._maxItems;if("Menu"===this.overflowMode&&(d>=this.startIndex&&d<=S&&(!(b%2)||d!==S)&&this.endIndex>=this._maxItems&&0<this._maxItems||0===this._maxItems)){if(b%2)continue;C=this.popupUl,a&&(l=!0)}else"Wrap"===this.overflowMode&&(C=0===b?m:h);var S=U.ListBase.createList(this.createElement,t,y,i,this).childNodes;if(p){if(v||g||"Menu"===this.overflowMode||"Wrap"===this.overflowMode)return e.splice(d,1),this.initPvtProps(),this.reRenderItems();b!==c-1&&!a||E.remove(C.lastElementChild)}else E.append(S,C);if("Wrap"===this.overflowMode&&0!==b&&b%2==0&&u.appendChild(h),g&&1===b&&(S=this.createElement("li",{className:"e-icons e-breadcrumb-collapsed",attrs:{TABINDEX:"0"}}),E.EventHandler.add(S,"keyup",this.expandHandler,this),u.appendChild(S)),"Menu"===this.overflowMode&&this.startIndex===b&&this.endIndex>=this._maxItems&&0<=this._maxItems&&(C=this.getMenuElement(),E.EventHandler.add(C,"keyup",this.keyDownHandler,this),u.appendChild(C)),o||a)break;p&&b++}this.isReact&&(this.renderReactTemplates(),setTimeout(function(){n.calculateMaxItems()},5)),"Wrap"===this.overflowMode&&this.element.appendChild(m),this.element.appendChild(u),this.isReact||this.calculateMaxItems()}},T.prototype.calculateMaxItems=function(){if("Hidden"===this.overflowMode||"Collapsed"===this.overflowMode||"Menu"===this.overflowMode){var e,t,i=this.element.offsetWidth,s=[].slice.call(this.element.children[0].children).reverse(),n="Menu"===this.overflowMode?0:s[s.length-1].offsetWidth+(s[s.length-2]?s[s.length-2].offsetWidth:0);"Menu"===this.overflowMode&&(t=this.getMenuElement(),this.element.appendChild(t),n+=t.offsetWidth,E.remove(t));for(var r=0;r<s.length-2;r++){if(i<n){if(e=Math.ceil((r-1)/2)+("Menu"===this.overflowMode&&r<=2?0:1),(this.maxItems>e&&!(-1<this.maxItems&&-1===e)||-1===this.maxItems)&&this._maxItems!==e)return this._maxItems=e,this.initPvtProps(),this.reRenderItems();break}if("Menu"===this.overflowMode&&2===r&&i<(n+=s[s.length-1].offsetWidth+s[s.length-2].offsetWidth))return this._maxItems=1,this.initPvtProps(),this.reRenderItems();"Menu"===this.overflowMode&&s[r].classList.contains(En)||(n+=s[r].offsetWidth)}}else if(("Wrap"===this.overflowMode||"Scroll"===this.overflowMode)&&0<this._maxItems){i=0;if((s=this.element.querySelectorAll(Tn+xn)).length>this._maxItems+this._maxItems-1){for(r="Wrap"===this.overflowMode?1:0;r<this._maxItems+this._maxItems-1;r++)i+=s[r].offsetWidth;i=i+5+2*parseInt(getComputedStyle(this.element.children[0]).paddingLeft,10),"Wrap"===this.overflowMode?this.element.querySelector(".e-breadcrumb-wrapped-ol").style.width=i+"px":this.element.style.width=i+"px"}}},T.prototype.hasField=function(e,t){for(var i=0,s=e.length;i<s;i++)if(e[i][""+t])return!0;return!1},T.prototype.getMenuElement=function(){return this.createElement("li",{className:"e-icons e-breadcrumb-menu",attrs:{TABINDEX:"0"}})},T.prototype.beforeItemRenderChanges=function(e,t,i,s){var n,r=i.querySelector(".e-anchor-wrap");r&&r.parentElement.setAttribute("aria-label","home"),t.text!==e.text&&r&&r.childNodes.forEach(function(e){e.nodeType===Node.TEXT_NODE&&(e.textContent=t.text)}),t.iconCss!==e.iconCss&&r&&((n=i.querySelector(Tn+In))?t.iconCss?(E.removeClass([n],e.iconCss.split(" ")),E.addClass([n],t.iconCss.split(" "))):E.remove(n):t.iconCss&&(n=this.createElement("span",{className:In+" "+t.iconCss}),s?E.append([n],r):r.insertBefore(n,r.childNodes[0]))),t.url!==e.url&&this.enableNavigation&&(s=i.querySelector("a."+Sn))&&(t.url?s.setAttribute("href",t.url):s.removeAttribute("href"))},T.prototype.reRenderItems=function(){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&this.popupObj.element.querySelector(".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element)),this.element.innerHTML="",this.renderItems(this.items)},T.prototype.clickHandler=function(e){var t=E.closest(e.target,Tn+xn+":not(.e-breadcrumb-separator)");if(this.enableNavigation||e.preventDefault(),t&&(E.closest(e.target,Tn+Sn)||this.itemTemplate)){var i=void 0,i=("Wrap"===this.overflowMode?[].slice.call(this.element.querySelectorAll(Tn+xn)):[].slice.call(t.parentElement.children)).indexOf(t),t=("Menu"===this.overflowMode?E.closest(e.target,Tn+Nn)?(i+=this.startIndex,this.endIndex=i,"keydown"===e.type&&this.documentClickHandler(e)):this.element.querySelector(Tn+En)?i>[].slice.call(this.element.children[0].children).indexOf(this.element.querySelector(Tn+En))?(i+=2*this.popupUl.childElementCount-2,i=Math.floor(i/2),this.endIndex=i):this.startIndex=this.endIndex=i:(i=Math.floor(i/2),this.startIndex=this.endIndex=i):i=Math.floor(i/2),"Hidden"===this.overflowMode&&0<this._maxItems&&0!==this.endIndex&&(i=parseInt(t.getAttribute("item-index"),10),1<this.startIndex&&(this.startIndex-=this.endIndex-i),this.endIndex=i),{element:t,item:this.items[i],event:e,cancel:!1});if(this.trigger("itemClick",t),t.cancel)return;this.items[i]&&(this.activeItem=this.items[i].url||this.items[i].text),this.dataBind()}e.target.classList.contains("e-breadcrumb-collapsed")&&(this.isExpanded=!0,this.reRenderItems()),e.target.classList.contains(En)&&!this.isPopupCreated&&this.renderPopup()},T.prototype.renderPopup=function(){var e=this,t=this.createElement("div",{className:Nn+" "+this.cssClass+(this.enableRtl?" e-rtl":"")});document.body.appendChild(t),this.isPopupCreated=!0,this.popupObj=new g.Popup(t,{content:this.popupUl,relateTo:this.element.querySelector(Tn+En),enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},collision:{X:"fit",Y:"flip"},open:function(){e.popupUl&&e.popupUl.focus()}}),this.popupWireEvents(),this.popupObj.show()},T.prototype.documentClickHandler=function(e){"Menu"===this.overflowMode&&this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&!E.closest(e.target,Tn+En)&&!E.closest(e.target,".e-edit-template")&&(this.popupObj.hide(),this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element))},T.prototype.resize=function(){this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems()},T.prototype.expandHandler=function(e){"Enter"===e.key&&(this.isExpanded=!0,this.reRenderItems())},T.prototype.keyDownHandler=function(e){"Enter"===e.key&&this.clickHandler(e)},T.prototype.popupKeyDownHandler=function(e){"Escape"===e.key&&this.documentClickHandler(e)},T.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"items":case"enableActiveItemNavigation":this.reRenderItems();break;case"activeItem":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems();break;case"overflowMode":case"maxItems":this._maxItems=this.maxItems,this.initPvtProps(),this.reRenderItems(),"Wrap"===t.overflowMode?this.element.classList.remove(On):"Wrap"===e.overflowMode&&this.element.classList.add(On),"Scroll"===t.overflowMode?this.element.classList.remove(wn):"Scroll"===e.overflowMode&&this.element.classList.add(wn);break;case"url":this.initItems(),this.reRenderItems();break;case"cssClass":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.replace(/\s+/g," ").trim().split(" ")),(t.cssClass&&-1<t.cssClass.indexOf(Cn)&&!(e.cssClass&&-1<e.cssClass.indexOf(Cn))||!(t.cssClass&&-1<t.cssClass.indexOf(Cn))&&e.cssClass&&-1<e.cssClass.indexOf(Cn))&&this.reRenderItems();break;case"enableRtl":this.element.classList.toggle("e-rtl");break;case"disabled":this.element.classList.toggle(kn),this.element.setAttribute(An,e.disabled+"")}},T.prototype.wireEvents=function(){this.delegateClickHanlder=this.documentClickHandler.bind(this),E.EventHandler.add(document,"click",this.delegateClickHanlder,this),E.EventHandler.add(this.element,"click",this.clickHandler,this),window.addEventListener("resize",this.resize.bind(this))},T.prototype.popupWireEvents=function(){E.EventHandler.add(this.popupObj.element,"click",this.clickHandler,this),E.EventHandler.add(this.popupObj.element,"keydown",this.popupKeyDownHandler,this)},T.prototype.unWireEvents=function(){E.EventHandler.remove(document,"click",this.delegateClickHanlder),E.EventHandler.remove(this.element,"click",this.clickHandler),window.removeEventListener("resize",this.resize.bind(this)),this.popupObj&&(E.EventHandler.remove(this.popupObj.element,"click",this.clickHandler),E.EventHandler.remove(this.popupObj.element,"keydown",this.popupKeyDownHandler))},T.prototype.getPersistData=function(){return this.addOnPersist(["activeItem"])},T.prototype.getModuleName=function(){return"breadcrumb"},T.prototype.destroy=function(){var t=this,e=(this.popupObj&&this.popupObj.element.classList.contains("e-popup-open")&&(this.popupObj.destroy(),this.isPopupCreated=!1,E.detach(this.popupObj.element)),[]),i=["aria-label"];this.cssClass&&e.concat(this.cssClass.split(" ")),this.enableRtl&&e.push("e-rtl"),this.disabled&&(e.push(kn),i.push(An)),"Wrap"===this.overflowMode?e.push(On):"Scroll"===this.overflowMode&&e.push(wn),this.unWireEvents(),this.element.innerHTML="",E.removeClass([this.element],e),i.forEach(function(e){t.element.removeAttribute(e)}),Mn.prototype.destroy.call(this)},A([E.Property("")],T.prototype,"url",void 0),A([E.Collection([],Pn)],T.prototype,"items",void 0),A([E.Property("")],T.prototype,"activeItem",void 0),A([E.Property(-1)],T.prototype,"maxItems",void 0),A([E.Property("Menu")],T.prototype,"overflowMode",void 0),A([E.Property("")],T.prototype,"cssClass",void 0),A([E.Property(null)],T.prototype,"itemTemplate",void 0),A([E.Property("/")],T.prototype,"separatorTemplate",void 0),A([E.Property(!0)],T.prototype,"enableNavigation",void 0),A([E.Property(!1)],T.prototype,"enableActiveItemNavigation",void 0),A([E.Property(!1)],T.prototype,"disabled",void 0),A([E.Property("")],T.prototype,"locale",void 0),A([E.Event()],T.prototype,"beforeItemRender",void 0),A([E.Event()],T.prototype,"itemClick",void 0),A([E.Event()],T.prototype,"created",void 0);var Mn,f=A([E.NotifyPropertyChanges],T);function T(e,t){e=Mn.call(this,e,t)||this;return e.isPopupCreated=!1,e}Hn=function(e,t){return(Hn=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Hn,Un,A=function(e,t){function i(){this.constructor=e}Hn(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},P=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Rn="e-carousel",Bn="e-active",jn="e-rtl",qn="e-partial",Fn="e-swipe",Wn="e-carousel-slide-container",Vn="e-carousel-items",_n="e-carousel-item",zn="e-previous",Kn="e-carousel-navigators",Xn="e-carousel-indicators",Yn="e-indicator-bars",Gn="e-indicator-bar",Qn="e-indicator",Jn="e-icons",Zn="e-play-pause",$n="e-play-icon",er="e-pause-icon",tr="e-previous-button",ir="e-next-button",sr="e-play-button",nr="e-round",rr="e-hover-arrows",or="e-carousel-hover",lr="e-template",ar="e-carousel-slide-animation",dr="e-carousel-fade-animation",hr="e-carousel-custom-animation",cr="e-carousel-animation-none",pr="e-prev",ur="e-next",mr="e-transition-start",fr="e-transition-end",gr=((gr=a.CarouselSwipeMode||(a.CarouselSwipeMode={}))[gr.Touch=1]="Touch",gr[gr.Mouse=2]="Mouse",Un=E.ChildProperty,A(vr,Un),P([E.Property()],vr.prototype,"cssClass",void 0),P([E.Property()],vr.prototype,"interval",void 0),P([E.Property()],vr.prototype,"template",void 0),P([E.Property()],vr.prototype,"htmlAttributes",void 0),vr);function vr(){return null!==Un&&Un.apply(this,arguments)||this}yr=E.Component,A(D,yr),D.prototype.getModuleName=function(){return Rn.replace("e-","")},D.prototype.getPersistData=function(){return this.addOnPersist(["selectedIndex"])},D.prototype.preRender=function(){this.keyConfigs={home:"home",end:"end",space:"space",moveLeft:"leftarrow",moveRight:"rightarrow",moveUp:"uparrow",moveDown:"downarrow"};this.localeObj=new E.L10n(this.getModuleName(),{nextSlide:"Next slide",of:"of",pauseSlideTransition:"Pause slide transition",playSlideTransition:"Play slide transition",previousSlide:"Previous slide",slide:"Slide",slideShow:"Slide show"},this.locale)},D.prototype.render=function(){this.initialize(),this.renderSlides(),this.renderNavigators(),this.renderPlayButton(),this.renderIndicators(),this.applyAnimation(),this.wireEvents()},D.prototype.onPropertyChanged=function(e,t){for(var i,s=0,n=Object.keys(e);s<n.length;s++){var r,o=n[s];switch(o){case"animationEffect":this.applyAnimation();break;case"cssClass":E.classList(this.element,[e.cssClass],[t.cssClass]);break;case"selectedIndex":this.setActiveSlide(this.selectedIndex,t.selectedIndex>this.selectedIndex?"Previous":"Next"),this.autoSlide();break;case"htmlAttributes":E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element);break;case"enableTouchSwipe":!this.enableTouchSwipe&&this.touchModule&&this.touchModule.destroy(),this.element.querySelector("."+Vn)&&this.renderTouchActions();break;case"loop":this.loop&&E.isNullOrUndefined(this.autoSlideInterval)&&this.applySlideInterval(),this.handleNavigatorsActions(this.selectedIndex),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||this.reRenderSlides();break;case"allowKeyboardInteraction":this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),e.allowKeyboardInteraction&&this.renderKeyboardActions();break;case"enableRtl":(r=[].slice.call(this.element.querySelectorAll("."+tr+",\n ."+ir+", ."+sr))).push(this.element),this.enableRtl?E.addClass(r,jn):E.removeClass(r,jn),!this.partialVisible&&this.swipeMode===(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)||(r=this.loop?this.getNumOfItems():0,l=this.itemsContainer.firstElementChild.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(l,this.selectedIndex+r));break;case"buttonsVisibility":if(i=this.element.querySelector("."+Kn))switch(this.buttonsVisibility){case"Hidden":this.resetTemplates(["previousButtonTemplate","nextButtonTemplate"]),E.remove(i);break;case"VisibleOnHover":E.addClass([].slice.call(i.childNodes),rr);break;case"Visible":E.removeClass([].slice.call(i.childNodes),rr)}else this.renderNavigators(),this.renderPlayButton();break;case"width":E.setStyleAttribute(this.element,{width:E.formatUnit(this.width)});break;case"height":E.setStyleAttribute(this.element,{height:E.formatUnit(this.height)});break;case"autoPlay":this.showPlayButton&&E.isNullOrUndefined(this.playButtonTemplate)&&this.playButtonClickHandler(null,!0),this.autoSlide();break;case"interval":this.autoSlide();break;case"showIndicators":case"indicatorsType":(i=this.element.querySelector("."+Xn))&&(this.resetTemplates(["indicatorsTemplate"]),E.remove(i)),this.renderIndicators();break;case"showPlayButton":i=this.element.querySelector("."+Zn),!this.showPlayButton&&i&&(E.remove(i),this.resetTemplates(["playButtonTemplate"])),this.renderPlayButton();break;case"items":case"dataSource":var l="dataSource"===o?this.dataSource:this.items;!E.isNullOrUndefined(l)&&0<l.length&&this.selectedIndex>=l.length&&(this.setActiveSlide(l.length-1,"Previous"),this.autoSlide()),this.reRenderSlides(),this.reRenderIndicators();break;case"partialVisible":this.partialVisible?E.addClass([this.element],qn):E.removeClass([this.element],qn),this.reRenderSlides();break;case"swipeMode":E.EventHandler.remove(this.element,"mousedown touchstart",this.swipeStart),E.EventHandler.remove(this.element,"mousemove touchmove",this.swiping),E.EventHandler.remove(this.element,"mouseup touchend",this.swipStop),this.swipeModehandlers(),this.reRenderSlides()}}},D.prototype.reRenderSlides=function(){var e=this.element.querySelector("."+Vn);e&&(this.resetTemplates(["itemTemplate"]),E.remove(e)),this.renderSlides()},D.prototype.reRenderIndicators=function(){var e=this.element.querySelector("."+Xn);e&&(this.resetTemplates(["indicatorsTemplate"]),E.remove(e)),this.renderIndicators()},D.prototype.initialize=function(){var e=[];e.push(Rn),this.cssClass&&e.push(this.cssClass),this.enableRtl&&e.push(jn),this.partialVisible&&e.push(qn),this.swipeMode!==(~a.CarouselSwipeMode.Touch&~a.CarouselSwipeMode.Mouse)&&e.push(Fn),E.addClass([this.element],e),E.setStyleAttribute(this.element,{width:E.formatUnit(this.width),height:E.formatUnit(this.height)}),E.attributes(this.element,{role:"group","aria-roledescription":"carousel","aria-label":this.localeObj.getConstant("slideShow")}),E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},D.prototype.renderSlides=function(){var i=this,e=this.element.querySelector("."+Wn),e=(e||(e=this.createElement("div",{className:Wn,attrs:{tabindex:"0",role:"tabpanel"}}),this.element.appendChild(e)),this.itemsContainer=this.createElement("div",{className:Vn,attrs:{"aria-live":this.autoPlay?"off":"polite"}}),e.appendChild(this.itemsContainer),this.getNumOfItems()),t=(0<e&&this.loop&&(0<this.items.length?this.items.slice(-e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(-e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),0<this.items.length?(this.slideItems=this.items,this.items.forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer)})):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&(this.slideItems=this.dataSource,this.dataSource.forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer)})),0<e&&this.loop&&(0<this.items.length?this.items.slice(0,e).forEach(function(e,t){i.renderSlide(e,e.template,t,i.itemsContainer,!0)}):!E.isNullOrUndefined(this.dataSource)&&0<this.dataSource.length&&this.dataSource.slice(0,e).forEach(function(e,t){i.renderSlide(e,i.itemTemplate,t,i.itemsContainer,!0)})),this.renderTemplates(),this.itemsContainer.style.setProperty("--carousel-items-count",""+this.itemsContainer.children.length),E.isNullOrUndefined(this.itemsContainer.firstElementChild)?0:this.itemsContainer.firstElementChild.clientWidth),e=(this.itemsContainer.style.transitionProperty="none",this.loop?e:0);this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e),this.autoSlide(),this.renderTouchActions(),this.renderKeyboardActions()},D.prototype.getTranslateX=function(e,t){return void 0===t&&(t=1),this.enableRtl?"translateX("+e*t+"px)":"translateX("+-e*t+"px)"},D.prototype.renderSlide=function(e,t,i,s,n){void 0===n&&(n=!1);i=this.createElement("div",{id:E.getUniqueID("carousel_item"),className:_n+" "+(e.cssClass||"")+" "+(this.selectedIndex!==i||n?"":Bn),attrs:{"aria-hidden":this.selectedIndex!==i||n?"true":"false","data-index":i.toString(),role:"group","aria-roledescription":"slide"}}),n&&i.classList.add("e-cloned"),E.isNullOrUndefined(e.htmlAttributes)||this.setHtmlAttributes(e.htmlAttributes,i),n=this.element.id+"_template",t=this.templateParser(t)(e,this,"itemTemplate",n,!1);E.append(t,i),s.appendChild(i)},D.prototype.renderNavigators=function(){var e;"Hidden"!==this.buttonsVisibility&&(e=this.createElement("div",{className:Kn}),this.element.querySelector("."+Wn).insertAdjacentElement("afterend",e),!E.isNullOrUndefined(this.slideItems)&&1<this.slideItems.length&&(this.renderNavigatorButton("Previous"),this.renderNavigatorButton("Next")),this.renderTemplates())},D.prototype.renderNavigatorButton=function(e){var t,i,s=this.createElement("div",{className:("Previous"===e?zn:"e-next")+" "+("VisibleOnHover"===this.buttonsVisibility?rr:"")});"Previous"===e&&this.previousButtonTemplate?(E.addClass([s],lr),i=this.element.id+"_previousButtonTemplate",t=this.templateParser(this.previousButtonTemplate)({type:"Previous"},this,"previousButtonTemplate",i,!1),E.append(t,s)):"Next"===e&&this.nextButtonTemplate?(E.addClass([s],lr),i=this.element.id+"_nextButtonTemplate",t=this.templateParser(this.nextButtonTemplate)({type:"Next"},this,"nextButtonTemplate",i,!1),E.append(t,s)):(i=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant("Previous"===e?"previousSlide":"nextSlide"),type:"button"}}),new R.Button({cssClass:"e-flat "+nr+" "+("Previous"===e?tr:ir),iconCss:Jn+" "+("Previous"===e?"e-previous-icon":"e-next-icon"),enableRtl:this.enableRtl,disabled:!this.loop&&this.selectedIndex===("Previous"===e?0:this.slideItems.length-1)}).appendTo(i),s.appendChild(i)),this.element.querySelector("."+Kn).appendChild(s),E.EventHandler.add(s,"click",this.navigatorClickHandler,this)},D.prototype.renderPlayButton=function(){var e,t,i,s;E.isNullOrUndefined(this.slideItems)||"Hidden"===this.buttonsVisibility||!this.showPlayButton||this.slideItems.length<=1||(e=this.createElement("div",{className:Zn+" "+("VisibleOnHover"===this.buttonsVisibility?rr:"")}),this.playButtonTemplate?(E.addClass([e],lr),t=this.element.id+"_playButtonTemplate",t=this.templateParser(this.playButtonTemplate)({},this,"playButtonTemplate",t,!1),E.append(t,e)):(t=this.createElement("button",{attrs:{"aria-label":this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition"),type:"button"}}),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=new R.Button({cssClass:"e-flat "+nr+" "+sr,iconCss:Jn+" "+(this.autoPlay&&!s?er:$n),isToggle:!0,enableRtl:this.enableRtl}),s&&(this.setProperties({autoPlay:!1},!0),t.setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),this.itemsContainer.setAttribute("aria-live","polite")),i.appendTo(t),e.appendChild(t)),(s=this.element.querySelector("."+Kn)).insertBefore(e,s.lastElementChild),this.renderTemplates(),E.EventHandler.add(e,"click",this.playButtonClickHandler,this))},D.prototype.renderIndicators=function(){var s=this;if(this.showIndicators&&!E.isNullOrUndefined(this.indicatorsType)){var e,t="e-default",t=(this.indicatorsTemplate||(t="e-"+this.indicatorsType.toLowerCase()),this.createElement("div",{className:Xn+" "+t})),n=this.createElement("div",{className:Yn});if(t.appendChild(n),this.slideItems)switch(this.indicatorsType){case"Fraction":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):n.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?this.renderIndicatorTemplate(n,this.selectedIndex+1):((e=this.createElement("div",{className:Gn})).style.setProperty("--carousel-items-current",""+(this.selectedIndex+1)),e.style.setProperty("--carousel-items-count",""+this.slideItems.length),n.appendChild(e));break;case"Default":case"Dynamic":this.slideItems.forEach(function(e,t){var i=s.createElement("div",{className:Gn+" "+(s.selectedIndex===t?Bn:s.selectedIndex-1===t?pr:s.selectedIndex+1===t?ur:""),attrs:{"data-index":t.toString(),"aria-current":s.selectedIndex===t?"true":"false"}});i.style.setProperty("--carousel-items-current",""+s.selectedIndex),s.indicatorsTemplate?s.renderIndicatorTemplate(i,t):"Default"===s.indicatorsType&&(t=s.createElement("button",{className:Qn,attrs:{type:"button","aria-label":s.localeObj.getConstant("slide")+" "+(t+1)+" "+s.localeObj.getConstant("of")+" "+s.slideItems.length}}),i.appendChild(t),t.appendChild(s.createElement("div",{})),new R.Button({cssClass:"e-flat e-small"}).appendTo(t)),n.appendChild(i),"Default"===s.indicatorsType&&E.EventHandler.add(i,"click",s.indicatorClickHandler,s)})}this.element.appendChild(t)}},D.prototype.renderIndicatorTemplate=function(e,t){void 0===t&&(t=0),E.addClass([e],lr);var i=this.element.id+"_indicatorsTemplate",t=this.templateParser(this.indicatorsTemplate)({index:t,selectedIndex:this.selectedIndex},this,"indicatorsTemplate",i,!1);E.append(t,e)},D.prototype.renderKeyboardActions=function(){this.allowKeyboardInteraction&&(this.keyModule=new E.KeyboardEvents(this.element,{keyAction:this.keyHandler.bind(this),keyConfigs:this.keyConfigs}))},D.prototype.renderTouchActions=function(){this.enableTouchSwipe&&(this.touchModule=new E.Touch(this.element,{swipe:this.swipeHandler.bind(this)}))},D.prototype.applyAnimation=function(){switch(E.removeClass([this.element],[hr,dr,ar,cr]),this.animationEffect){case"Slide":E.addClass([this.element],ar);break;case"Fade":E.addClass([this.element],dr);break;case"None":E.addClass([this.element],cr);break;case"Custom":E.addClass([this.element],hr)}},D.prototype.autoSlide=function(){E.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(this.resetSlideInterval(),this.applySlideInterval())},D.prototype.autoSlideChange=function(){var e=this.element.querySelector("."+_n+"."+Bn)||this.element.querySelector("."+Xn+" ."+Bn);E.isNullOrUndefined(e)||(e=parseInt(e.dataset.index,10),this.loop||e!==this.slideItems.length-1?(e=(e+1)%this.slideItems.length,this.element.classList.contains(or)||this.setActiveSlide(e,"Next"),this.autoSlide()):this.resetSlideInterval())},D.prototype.applySlideInterval=function(){var e,t=this;this.autoPlay&&!this.element.classList.contains(or)&&(e=this.interval,0<this.items.length&&!E.isNullOrUndefined(this.items[this.selectedIndex||0].interval)&&(e=this.items[this.selectedIndex||0].interval),this.autoSlideInterval=setInterval(function(){return t.autoSlideChange()},e))},D.prototype.resetSlideInterval=function(){clearInterval(this.autoSlideInterval),this.autoSlideInterval=null},D.prototype.getSlideIndex=function(e){var t=this.selectedIndex||0;return"Previous"===e?--t<0&&(t=this.slideItems.length-1):++t===this.slideItems.length&&(t=0),t},D.prototype.setActiveSlide=function(s,n,r){var o,l,e,t,a=this;void 0===r&&(r=!1),0<this.element.querySelectorAll("."+_n+"."+pr+",."+_n+"."+ur).length||(s=E.isNullOrUndefined(s)?0:s,o=[].slice.call(this.element.querySelectorAll("."+_n+":not(.e-cloned)")),t=this.element.querySelector("."+_n+"."+Bn),E.isNullOrUndefined(t)&&this.showIndicators?(e=this.element.querySelector("."+Gn+"."+Bn),e=parseInt(e.dataset.index,10),E.addClass([o[parseInt(e.toString(),10)]],Bn)):E.isNullOrUndefined(t)?E.addClass([o[parseInt(s.toString(),10)]],Bn):(l=parseInt(t.dataset.index,10),e=o[parseInt(s.toString(),10)],t={currentIndex:l,nextIndex:s,currentSlide:t,nextSlide:e,slideDirection:n,isSwiped:r,cancel:!1},this.trigger("slideChanging",t,function(e){var t,i;e.cancel||(a.setProperties({selectedIndex:s},!0),E.attributes(e.currentSlide,{"aria-hidden":"true"}),E.attributes(e.nextSlide,{"aria-hidden":"false"}),a.refreshIndicators(l,s),a.slideChangedEventArgs={currentIndex:e.nextIndex,previousIndex:e.currentIndex,currentSlide:e.nextSlide,previousSlide:e.currentSlide,slideDirection:n,isSwiped:r},t=o[parseInt(s.toString(),10)].clientWidth,i=a.getNumOfItems(),a.isSwipe||(a.itemsContainer.style.transitionDuration="0.6s"),a.isSwipe=!1,"Fade"===a.animationEffect?a.itemsContainer.classList.add("e-fade-in-out"):a.itemsContainer.style.transitionProperty="transform",a.loop?0===a.slideChangedEventArgs.currentIndex&&"Next"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.getTranslateX(t,o.length+i):a.slideChangedEventArgs.currentIndex===a.slideItems.length-1&&"Previous"===a.slideChangedEventArgs.slideDirection?a.itemsContainer.style.transform=a.partialVisible?a.getTranslateX(t):"translateX(0px)":a.itemsContainer.style.transform=a.getTranslateX(t,s+i):a.itemsContainer.style.transform=a.getTranslateX(t,s),"Slide"===a.animationEffect?"Previous"===n?(E.addClass([e.nextSlide],pr),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),E.addClass([e.currentSlide,e.nextSlide],fr)):(E.addClass([e.nextSlide],ur),e.nextSlide.setAttribute("data-slide-height",e.nextSlide.offsetHeight.toString()),E.addClass([e.currentSlide,e.nextSlide],mr)):"Fade"===a.animationEffect?(E.removeClass([e.currentSlide],Bn),E.addClass([e.nextSlide],Bn)):"Custom"===a.animationEffect?"Previous"===n?(E.addClass([e.nextSlide],ur),E.addClass([e.currentSlide],pr)):(E.addClass([e.currentSlide],pr),E.addClass([e.nextSlide],ur)):a.onTransitionEnd(),a.handleNavigatorsActions(s))})))},D.prototype.onTransitionEnd=function(){var e,t=this,i=(E.removeClass(this.element.querySelectorAll("."+Vn),"e-fade-in-out"),this.getNumOfItems());this.slideChangedEventArgs&&(this.itemsContainer.style.transitionProperty="none",this.loop&&(0===this.slideChangedEventArgs.currentIndex&&"Next"===this.slideChangedEventArgs.slideDirection||this.slideChangedEventArgs.currentIndex===this.slideItems.length-1&&"Previous"===this.slideChangedEventArgs.slideDirection)&&(e=this.slideChangedEventArgs.currentSlide.clientWidth,this.itemsContainer.style.transform=this.getTranslateX(e,this.slideChangedEventArgs.currentIndex+i)),E.addClass([this.slideChangedEventArgs.currentSlide],Bn),E.removeClass([this.slideChangedEventArgs.previousSlide],Bn),this.trigger("slideChanged",this.slideChangedEventArgs,function(){E.removeClass(t.element.querySelectorAll("."+_n),[pr,ur,mr,fr]),t.slideChangedEventArgs=null}))},D.prototype.refreshIndicators=function(e,t){var i=this,s=this.element.querySelector("."+Yn);if(!E.isNullOrUndefined(s)){var n=[].slice.call(s.childNodes);switch(this.indicatorsType){case"Default":case"Dynamic":E.attributes(n[parseInt(e.toString(),10)],{"aria-current":"false"}),E.attributes(n[parseInt(t.toString(),10)],{"aria-current":"true"}),E.removeClass(n,[Bn,pr,ur]),E.addClass([n[parseInt(t.toString(),10)]],Bn),n[t-1]&&E.addClass([n[t-1]],pr),n[t+1]&&E.addClass([n[t+1]],ur),n.forEach(function(e){return e.style.setProperty("--carousel-items-current",""+i.selectedIndex)});break;case"Fraction":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.innerText=this.selectedIndex+1+" / "+this.slideItems.length;break;case"Progress":this.indicatorsTemplate?(0<s.children.length&&s.removeChild(s.firstElementChild),this.renderIndicatorTemplate(s,t+1)):s.firstElementChild.style.setProperty("--carousel-items-current",""+(this.selectedIndex+1))}}},D.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?E.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},D.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?E.compile(document.querySelector(t).innerHTML.trim()):E.compile(t)}catch(e){return E.compile(t)}},D.prototype.getNavigatorState=function(e,t){e=e.querySelector("."+(t?tr:ir));return!!e&&E.getInstance(e,R.Button).disabled},D.prototype.navigatorClickHandler=function(e){var e=e.currentTarget;this.getNavigatorState(e,e.classList.contains(zn))||(e=e.classList.contains(zn)?"Previous":"Next",this.setActiveSlide(this.getSlideIndex(e),e),this.autoSlide())},D.prototype.indicatorClickHandler=function(e){e=E.closest(e.target,"."+Gn),e=parseInt(e.dataset.index,10);this.selectedIndex!==e&&(this.setActiveSlide(e,this.selectedIndex>e?"Previous":"Next"),this.autoSlide())},D.prototype.playButtonClickHandler=function(e,t){void 0===t&&(t=!1);var i,s=this.element.querySelector("."+sr);s&&(i=E.getInstance(s,R.Button),t||this.setProperties({autoPlay:!this.autoPlay},!0),s.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),i.iconCss=Jn+" "+(this.autoPlay?er:$n),i.dataBind(),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),this.autoPlay&&!this.loop&&this.selectedIndex===this.slideItems.length-1&&this.setActiveSlide(0,"Next"),this.autoSlide())},D.prototype.keyHandler=function(e){if(this.allowKeyboardInteraction){var t,i,s=!1,n=e.target;switch(e.preventDefault(),e.action){case"space":this.showIndicators&&n.classList.contains(Qn)?n.click():n.classList.contains(Rn)||n.classList.contains(sr)?this.playButtonClickHandler(e):n.classList.contains(ir)?this.next():n.classList.contains(tr)&&this.prev();break;case"end":i=this.slideItems.length-1,t="Next",s=!0;break;case"home":t="Previous",s=!(i=0);break;case"moveUp":case"moveLeft":case"moveDown":case"moveRight":this.showIndicators&&E.isNullOrUndefined(this.indicatorsTemplate)&&this.element.focus(),t="moveUp"===e.action||"moveLeft"===e.action?"Previous":"Next",i=this.getSlideIndex(t),s=!this.isSuspendSlideTransition(i,t)}s&&(this.setActiveSlide(i,t),this.autoSlide())}},D.prototype.swipeHandler=function(e){var t;this.element.classList.contains(or)||E.isNullOrUndefined(this.slideItems)||this.slideItems.length<=1||(e="Right"===e.swipeDirection?"Previous":"Next",t=this.getSlideIndex(e),this.isSuspendSlideTransition(t,e))||(this.setActiveSlide(t,e,!0),this.autoSlide())},D.prototype.isSuspendSlideTransition=function(e,t){return!this.loop&&("Next"===t&&0===e||"Previous"===t&&e===this.slideItems.length-1)},D.prototype.handleNavigatorsActions=function(e){var t,i,s,n;"Hidden"!==this.buttonsVisibility&&(this.showPlayButton&&(t=this.element.querySelector("."+sr),s=this.selectedIndex===this.slideItems.length-1&&!this.loop,i=E.isNullOrUndefined(this.playButtonTemplate)&&t&&s,i=E.isNullOrUndefined(this.playButtonTemplate)&&t&&!s?!t.classList.contains(Bn):i)&&(this.setProperties({autoPlay:!s},!0),t.setAttribute("aria-label",this.localeObj.getConstant(this.autoPlay?"pauseSlideTransition":"playSlideTransition")),this.itemsContainer.setAttribute("aria-live",this.autoPlay?"off":"polite"),(n=E.getInstance(t,R.Button)).iconCss=Jn+" "+(this.autoPlay?er:$n),n.dataBind()),(i=this.element.querySelector("."+tr))&&E.isNullOrUndefined(this.previousButtonTemplate)&&((n=E.getInstance(i,R.Button)).disabled=!this.loop&&0===e,n.dataBind()),s=this.element.querySelector("."+ir))&&E.isNullOrUndefined(this.nextButtonTemplate)&&((n=E.getInstance(s,R.Button)).disabled=!this.loop&&e===this.slideItems.length-1,n.dataBind())},D.prototype.onHoverActions=function(e){var t=this.element.querySelector("."+Kn);switch(e.type){case"mouseenter":"VisibleOnHover"===this.buttonsVisibility&&t&&E.removeClass([].slice.call(t.childNodes),rr),this.pauseOnHover&&E.addClass([this.element],or);break;case"mouseleave":"VisibleOnHover"===this.buttonsVisibility&&t&&E.addClass([].slice.call(t.childNodes),rr),E.removeClass([this.element],or),this.isSwipe&&this.swipStop()}this.autoSlide()},D.prototype.onFocusActions=function(e){switch(e.type){case"focusin":E.addClass([this.element],or);break;case"focusout":E.removeClass([this.element],or)}this.autoSlide()},D.prototype.destroyButtons=function(){for(var e=0,t=[].slice.call(this.element.querySelectorAll(".e-control.e-btn"));e<t.length;e++){var i=t[e],i=E.getInstance(i,R.Button);i&&i.destroy()}},D.prototype.getNumOfItems=function(){return this.partialVisible?2:1},D.prototype.getTranslateValue=function(e){e=getComputedStyle(e);return window.WebKitCSSMatrix?new WebKitCSSMatrix(e.webkitTransform).m41:0},D.prototype.swipeStart=function(e){this.timeStampStart||(this.timeStampStart=Date.now()),e.preventDefault(),this.isSwipe=!1,this.itemsContainer.classList.add("e-swipe-start"),this.prevPageX=(e.touches?e.touches[0]:e).pageX,this.initialTranslate=this.getTranslateValue(this.itemsContainer)},D.prototype.swiping=function(e){this.itemsContainer.classList.contains("e-swipe-start")&&(this.isSwipe=!0,e.preventDefault(),e=(e.touches?e.touches[0]:e).pageX,e=this.prevPageX-e,!this.loop&&(this.enableRtl&&(0===this.selectedIndex&&0<e||this.selectedIndex===this.itemsContainer.childElementCount-1&&e<0)||!this.enableRtl&&(0===this.selectedIndex&&e<0||this.selectedIndex===this.itemsContainer.childElementCount-1&&0<e))||(this.itemsContainer.style.transform="translateX("+(this.initialTranslate+(this.enableRtl?e:-e))+"px)"))},D.prototype.swipStop=function(){var e=Date.now()-this.timeStampStart,t=(t=this.getTranslateValue(this.itemsContainer)-this.initialTranslate)<0?-1*t:t;this.isSwipe&&(i=t*(E.Browser.isDevice?6:1.66),this.itemsContainer.style.transitionDuration=(E.Browser.isDevice?t:i)/e/10+"s");var t=this.itemsContainer.firstElementChild.clientWidth/2,i=(this.itemsContainer.classList.remove("e-swipe-start"),this.getTranslateValue(this.itemsContainer));i-this.initialTranslate<-t?this.swipeNavigation(!this.enableRtl):i-this.initialTranslate>t?this.swipeNavigation(this.enableRtl):(this.itemsContainer.style.transform="translateX("+this.initialTranslate+"px)","Fade"===this.animationEffect&&this.itemsContainer.classList.add("e-fade-in-out"))},D.prototype.swipeNavigation=function(e){e?this.next():this.prev()},D.prototype.swipeModehandlers=function(){(this.swipeMode&a.CarouselSwipeMode.Touch)===a.CarouselSwipeMode.Touch&&(E.EventHandler.add(this.itemsContainer,"touchstart",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"touchmove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"touchend",this.swipStop,this)),(this.swipeMode&a.CarouselSwipeMode.Mouse)===a.CarouselSwipeMode.Mouse&&(E.EventHandler.add(this.itemsContainer,"mousedown",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"mousemove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"mouseup",this.swipStop,this)),0===this.swipeMode&&(this.swipeMode&a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)==(a.CarouselSwipeMode.Mouse&a.CarouselSwipeMode.Touch)&&(E.EventHandler.add(this.itemsContainer,"mousedown touchstart",this.swipeStart,this),E.EventHandler.add(this.itemsContainer,"mousemove touchmove",this.swiping,this),E.EventHandler.add(this.itemsContainer,"mouseup touchend",this.swipStop,this))},D.prototype.resizeHandler=function(){var e,t;this.itemsContainer&&this.itemsContainer.firstElementChild&&(e=this.getNumOfItems(),t=this.itemsContainer.firstElementChild.clientWidth,this.loop?this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex+e):this.itemsContainer.style.transform=this.getTranslateX(t,this.selectedIndex))},D.prototype.wireEvents=function(){"Custom"!==this.animationEffect&&this.enableTouchSwipe&&this.swipeModehandlers(),E.EventHandler.add(this.element,"focusin focusout",this.onFocusActions,this),E.EventHandler.add(this.element,"mouseenter mouseleave",this.onHoverActions,this),E.EventHandler.add(this.element.firstElementChild,"animationend",this.onTransitionEnd,this),E.EventHandler.add(this.element.firstElementChild,"transitionend",this.onTransitionEnd,this),E.EventHandler.add(window,"resize",this.resizeHandler,this)},D.prototype.unWireEvents=function(){var t=this;[].slice.call(this.element.querySelectorAll("."+Gn)).forEach(function(e){E.EventHandler.remove(e,"click",t.indicatorClickHandler)});[].slice.call(this.element.querySelectorAll("."+zn+",.e-next")).forEach(function(e){E.EventHandler.remove(e,"click",t.navigatorClickHandler)});var e=this.element.querySelector("."+Zn);e&&E.EventHandler.remove(e,"click",this.playButtonClickHandler),E.EventHandler.remove(this.element.firstElementChild,"animationend",this.onTransitionEnd),E.EventHandler.remove(this.element.firstElementChild,"transitionend",this.onTransitionEnd),E.EventHandler.clearEvents(this.element),E.EventHandler.clearEvents(this.itemsContainer),E.EventHandler.remove(window,"resize",this.resizeHandler)},D.prototype.prev=function(){var e;!this.loop&&0===this.selectedIndex||(e=0===this.selectedIndex?this.slideItems.length-1:this.selectedIndex-1,this.setActiveSlide(e,"Previous"),this.autoSlide())},D.prototype.next=function(){var e;!this.loop&&this.selectedIndex===this.slideItems.length-1||(e=this.selectedIndex===this.slideItems.length-1?0:this.selectedIndex+1,this.setActiveSlide(e,"Next"),this.autoSlide())},D.prototype.play=function(){var e=this.element.querySelector("."+$n);this.showPlayButton&&e&&(E.classList(e,[er],[$n]),this.element.querySelector("."+sr).setAttribute("aria-label",this.localeObj.getConstant("pauseSlideTransition"))),this.setProperties({autoPlay:!0},!0),this.itemsContainer.setAttribute("aria-live","off"),this.applySlideInterval()},D.prototype.pause=function(){var e=this.element.querySelector("."+er);this.showPlayButton&&e&&(this.element.querySelector("."+sr).setAttribute("aria-label",this.localeObj.getConstant("playSlideTransition")),E.classList(e,[$n],[er])),this.setProperties({autoPlay:!1},!0),this.itemsContainer.setAttribute("aria-live","off"),this.resetSlideInterval()},D.prototype.renderTemplates=function(){(this.isAngular||this.isReact)&&this.renderReactTemplates()},D.prototype.resetTemplates=function(e){(this.isAngular||this.isReact)&&this.clearTemplate(e)},D.prototype.destroy=function(){var t=this;this.resetTemplates(),this.touchModule&&(this.touchModule.destroy(),this.touchModule=null),this.keyModule&&(this.keyModule.destroy(),this.keyModule=null),this.resetSlideInterval(),this.destroyButtons(),this.unWireEvents(),[].slice.call(this.element.children).forEach(function(e){t.element.removeChild(e)}),E.removeClass([this.element],[Rn,this.cssClass,jn,Fn]),["role","style"].forEach(function(e){t.element.removeAttribute(e)}),this.itemsContainer=null,yr.prototype.destroy.call(this)},P([E.Collection([],gr)],D.prototype,"items",void 0),P([E.Property("Slide")],D.prototype,"animationEffect",void 0),P([E.Property()],D.prototype,"previousButtonTemplate",void 0),P([E.Property()],D.prototype,"nextButtonTemplate",void 0),P([E.Property()],D.prototype,"indicatorsTemplate",void 0),P([E.Property()],D.prototype,"playButtonTemplate",void 0),P([E.Property()],D.prototype,"cssClass",void 0),P([E.Property([])],D.prototype,"dataSource",void 0),P([E.Property()],D.prototype,"itemTemplate",void 0),P([E.Property(0)],D.prototype,"selectedIndex",void 0),P([E.Property("100%")],D.prototype,"width",void 0),P([E.Property("100%")],D.prototype,"height",void 0),P([E.Property(5e3)],D.prototype,"interval",void 0),P([E.Property(!0)],D.prototype,"autoPlay",void 0),P([E.Property(!0)],D.prototype,"pauseOnHover",void 0),P([E.Property(!0)],D.prototype,"loop",void 0),P([E.Property(!1)],D.prototype,"showPlayButton",void 0),P([E.Property(!0)],D.prototype,"enableTouchSwipe",void 0),P([E.Property(!0)],D.prototype,"allowKeyboardInteraction",void 0),P([E.Property(!0)],D.prototype,"showIndicators",void 0),P([E.Property("Default")],D.prototype,"indicatorsType",void 0),P([E.Property("Visible")],D.prototype,"buttonsVisibility",void 0),P([E.Property(!1)],D.prototype,"partialVisible",void 0),P([E.Property(a.CarouselSwipeMode.Touch)],D.prototype,"swipeMode",void 0),P([E.Property()],D.prototype,"htmlAttributes",void 0),P([E.Event()],D.prototype,"slideChanging",void 0),P([E.Event()],D.prototype,"slideChanged",void 0);var yr,A=P([E.NotifyPropertyChanges],D);function D(e,t){e=yr.call(this,e,t)||this;return e.isSwipe=!1,e}br=function(e,t){return(br=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var br,Cr,P=function(e,t){function i(){this.constructor=e}br(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Sr=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Ir="e-appbar",Er="e-horizontal-bottom",xr="e-sticky",Nr="e-prominent",Or="e-dense",wr="e-rtl",Lr="e-light",kr="e-primary",Ar="e-inherit",P=(Cr=E.Component,P(Tr,Cr),Tr.prototype.destroy=function(){Cr.prototype.destroy.call(this),this.element.classList.remove(Ir),this.element.removeAttribute("style"),this.element.removeAttribute("role")},Tr.prototype.getModuleName=function(){return"appbar"},Tr.prototype.getPersistData=function(){return this.addOnPersist([])},Tr.prototype.preRender=function(){},Tr.prototype.render=function(){this.element.classList.add(Ir),"HEADER"!==this.element.tagName&&this.element.setAttribute("role","banner"),this.cssClass&&E.addClass([this.element],this.cssClass.split(" ")),"Bottom"===this.position&&this.element.classList.add(Er),this.isSticky&&this.element.classList.add(xr),this.enableRtl&&this.element.classList.add(wr),this.setHeightMode(),this.setColorMode(),E.isNullOrUndefined(this.htmlAttributes)||this.setHtmlAttributes(this.htmlAttributes,this.element)},Tr.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"mode":E.removeClass([this.element],[Or,Nr]),this.setHeightMode();break;case"position":"Bottom"===this.position?E.addClass([this.element],Er):E.removeClass([this.element],Er);break;case"cssClass":t.cssClass&&E.removeClass([this.element],t.cssClass.split(" ")),e.cssClass&&E.addClass([this.element],e.cssClass.split(" "));break;case"isSticky":this.isSticky?E.addClass([this.element],xr):E.removeClass([this.element],xr);break;case"htmlAttributes":if(!E.isNullOrUndefined(this.htmlAttributes)){if(!E.isNullOrUndefined(t.htmlAttributes))for(var n=0,r=Object.keys(t.htmlAttributes);n<r.length;n++){var o=r[n];"class"===o?E.removeClass([this.element],t.htmlAttributes[""+o]):this.element.removeAttribute(o)}this.setHtmlAttributes(e.htmlAttributes,this.element)}break;case"colorMode":E.removeClass([this.element],["e-dark",kr,Ar,Lr]),this.setColorMode();break;case"enableRtl":this.enableRtl?E.addClass([this.element],wr):E.removeClass([this.element],wr)}},Tr.prototype.setHtmlAttributes=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++){var n=s[i];"class"===n?E.addClass([t],e[""+n]):t.setAttribute(n,e[""+n])}},Tr.prototype.setHeightMode=function(){"Prominent"===this.mode?this.element.classList.add(Nr):"Dense"===this.mode&&this.element.classList.add(Or)},Tr.prototype.setColorMode=function(){switch(this.colorMode){case"Light":this.element.classList.add(Lr);break;case"Dark":this.element.classList.add("e-dark");break;case"Primary":this.element.classList.add(kr);break;case"Inherit":this.element.classList.add(Ar)}},Sr([E.Property("Regular")],Tr.prototype,"mode",void 0),Sr([E.Property("Top")],Tr.prototype,"position",void 0),Sr([E.Property()],Tr.prototype,"cssClass",void 0),Sr([E.Property(!1)],Tr.prototype,"isSticky",void 0),Sr([E.Property()],Tr.prototype,"htmlAttributes",void 0),Sr([E.Property("Light")],Tr.prototype,"colorMode",void 0),Sr([E.Event()],Tr.prototype,"created",void 0),Sr([E.Event()],Tr.prototype,"destroyed",void 0),Sr([E.NotifyPropertyChanges],Tr));function Tr(e,t){return Cr.call(this,e,t)||this}Pr=function(e,t){return(Pr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Pr,Dr,Sr=function(e,t){function i(){this.constructor=e}Pr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},Mr="--progress-position",Hr="e-vertical",Ur="e-horizontal",Rr="e-stepper-steps",Br=((Br=a.StepStatus||(a.StepStatus={})).NotStarted="NotStarted",Br.InProgress="InProgress",Br.Completed="Completed",Dr=E.ChildProperty,Sr(jr,Dr),M([E.Property("")],jr.prototype,"cssClass",void 0),M([E.Property(!1)],jr.prototype,"disabled",void 0),M([E.Property("")],jr.prototype,"iconCss",void 0),M([E.Property(null)],jr.prototype,"isValid",void 0),M([E.Property("")],jr.prototype,"label",void 0),M([E.Property(!1)],jr.prototype,"optional",void 0),M([E.Property(a.StepStatus.NotStarted)],jr.prototype,"status",void 0),M([E.Property("")],jr.prototype,"text",void 0),jr);function jr(){return null!==Dr&&Dr.apply(this,arguments)||this}(Fr=a.StepperOrientation||(a.StepperOrientation={})).Horizontal="Horizontal",Fr.Vertical="Vertical";qr=E.Component,Sr(Wr,qr),Wr.prototype.preRender=function(){},Wr.prototype.getModuleName=function(){return"stepperBase"},Wr.prototype.getPersistData=function(){return this.addOnPersist([])},Wr.prototype.render=function(){},Wr.prototype.updateOrientaion=function(e){(e.classList.contains(Ur)||e.classList.contains(Hr))&&e.classList.remove(Ur,Hr),E.isNullOrUndefined(this.orientation)||e.classList.add("e-"+this.orientation.toLocaleLowerCase())},Wr.prototype.renderProgressBar=function(e){this.progressStep=this.createElement("div",{className:"e-stepper-progressbar"}),this.progressbar=this.createElement("div",{className:"e-progressbar-value"});var t,i=e.querySelector("li").querySelector(".e-step-label-container");this.progressStep.appendChild(this.progressbar),e.prepend(this.progressStep),this.progressbar.style.setProperty("--progress-value","0%"),e.classList.contains(Hr)&&(e.classList.contains("e-label-bottom")||e.classList.contains("e-label-top")?(t=e.querySelector("."+Rr),this.progressStep.style.setProperty(Mr,t.offsetWidth/2+"px")):this.progressStep.style.setProperty(Mr,this.progressBarPosition/2-1+"px")),i&&i.classList.contains("e-label-before")&&this.progressStep.style.setProperty(Mr,this.progressBarPosition-1+5+"px"),e.classList.contains(Ur)&&this.setProgressPosition(e)},Wr.prototype.setProgressPosition=function(e,t){var i=e.querySelector(".e-step-container"),s=i.firstElementChild,i=(!0!==t&&(t=0,t=e.classList.contains("e-label-before")?i.offsetParent.offsetHeight-s.offsetHeight/2-1:s.offsetHeight/2,this.progressStep.style.setProperty("--progress-top-position",t+"px")),e.querySelector("."+Rr).lastChild.firstChild);e.classList.contains("e-rtl")?(t=s.offsetLeft+s.offsetWidth-e.querySelector("."+Rr).offsetWidth,this.progressStep.style.setProperty("--progress-left-position",Math.abs(t)+"px"),this.progressStep.style.setProperty("--progress-bar-width",Math.abs(i.offsetLeft-s.offsetLeft)+"px")):(this.progressStep.style.setProperty("--progress-left-position",s.offsetLeft+1+"px"),this.progressStep.style.setProperty("--progress-bar-width",i.offsetWidth+i.offsetLeft-2-(s.offsetLeft+2)+"px"))},Wr.prototype.onPropertyChanged=function(e,t){},M([E.Collection([],Br)],Wr.prototype,"steps",void 0),M([E.Property("")],Wr.prototype,"cssClass",void 0),M([E.Property(!1)],Wr.prototype,"readOnly",void 0),M([E.Property(a.StepperOrientation.Horizontal)],Wr.prototype,"orientation",void 0),M([E.Event()],Wr.prototype,"created",void 0);var qr,Fr=M([E.NotifyPropertyChanges],Wr);function Wr(e,t){return qr.call(this,e,t)||this}Vr=function(e,t){return(Vr=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Vr,_r,Sr=function(e,t){function i(){this.constructor=e}Vr(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},M=function(e,t,i,s){var n,r=arguments.length,o=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;0<=l;l--)(n=e[l])&&(o=(r<3?n(o):3<r?n(t,i,o):n(t,i))||o);return 3<r&&o&&Object.defineProperty(t,i,o),o},zr="e-indicator",Kr="e-step-text-container",Xr="e-step-selected",Yr="e-step-inprogress",Gr="e-step-notstarted",Qr="e-step-focus",Jr="e-step-completed",Zr="e-step-disabled",$r="e-stepper-readonly",eo="--progress-value",to="e-rtl",io="e-step-template",so="e-label-after",no="e-label-before",ro="e-vertical",oo="e-horizontal",lo="e-step-item",ao="e-step-text",ho="e-text",co="e-step-label",po="e-label",uo="e-step-type-indicator",mo="e-step-type-label",fo="e-step-indicator",go="e-stepper-tooltip",vo="e-linear",yo=(_r=E.ChildProperty,Sr(bo,_r),M([E.Property(!0)],bo.prototype,"enable",void 0),M([E.Property(2e3)],bo.prototype,"duration",void 0),M([E.Property(0)],bo.prototype,"delay",void 0),bo);function bo(){return null!==_r&&_r.apply(this,arguments)||this}(So=a.StepLabelPosition||(a.StepLabelPosition={})).Top="Top",So.Bottom="Bottom",So.Start="Start",So.End="End",(So=a.StepType||(a.StepType={})).Default="Default",So.Label="Label",So.Indicator="Indicator";Sr(H,Co=Fr),H.prototype.preRender=function(){this.element.id||(this.element.id=E.getUniqueID("e-"+this.getModuleName()));this.l10n=new E.L10n("stepper",{optional:"Optional"},this.locale),this.keyConfigs={downarrow:"downarrow",leftarrow:"leftarrow",rightarrow:"rightarrow",uparrow:"uparrow",space:"space",enter:"enter",home:"home",end:"end",tab:"tab",shiftTab:"shift+tab",escape:"escape"},this.tooltipOpen=!1},H.prototype.getModuleName=function(){return"stepper"},H.prototype.render=function(){this.initialize(),this.navigationHandler(this.activeStep,null,!1),this.updateStepperStatus(!0)},H.prototype.initialize=function(){this.element.setAttribute("aria-label",this.element.id),this.updatePosition(),this.stepperItemList=this.createElement("ol",{className:"e-stepper-steps"}),this.updateOrientaion(this.element),this.updateStepType(),this.element.appendChild(this.stepperItemList),this.cssClass&&E.addClass([this.element],this.cssClass.trim().split(" ")),this.readOnly&&this.element.classList.add($r),this.enableRtl&&this.element.classList.add(to),this.wireEvents(),this.updateTemplateFunction(),this.renderItems(),0<this.steps.length&&(this.initiateProgressBar(),this.checkValidStep(),this.updateAnimation(),this.updateTooltip(),this.wireKeyboardEvent())},H.prototype.initiateProgressBar=function(){var e=this;1<this.steps.length&&(this.isAngular&&this.template?setTimeout(function(){e.renderProgressBar(e.element)}):this.renderProgressBar(this.element))},H.prototype.updatePosition=function(){this.progressBarPosition=this.beforeLabelWidth=this.textEleWidth=0},H.prototype.renderDefault=function(e){e=this.steps[parseInt(e.toString(),10)];return!e.iconCss&&!e.text&&!e.label},H.prototype.updateAnimation=function(){var e=this.element.querySelector(".e-progressbar-value");this.animation.enable?(0<=this.animation.duration&&e&&e.style.setProperty("--duration",this.animation.duration+"ms"),0<=this.animation.delay&&e&&e.style.setProperty("--delay",this.animation.delay+"ms")):e&&(e.style.setProperty("--delay","0ms"),e.style.setProperty("--duration","0ms"))},H.prototype.updateStepType=function(){var e;E.isNullOrUndefined(this.stepType)||(e=this.stepType.toLowerCase(),-1!==["indicator","label","default"].indexOf(e)&&("default"!==e&&this.element.classList.add("e-step-type-"+e),"indicator"!==e&&"label"!==e||!this.labelContainer||this.clearLabelPosition()))},H.prototype.wireEvents=function(){E.EventHandler.add(window,"resize",this.updateResize,this),E.EventHandler.add(window,"click",this.updateStepFocus,this)},H.prototype.unWireEvents=function(){E.EventHandler.remove(window,"resize",this.updateResize),E.EventHandler.remove(window,"click",this.updateStepFocus)},H.prototype.updateResize=function(){this.stepperItemList&&this.progressbar&&this.element.classList.contains(oo)&&this.setProgressPosition(this.element,!0),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateStepFocus=function(){var e;this.isKeyNavFocus&&(this.isKeyNavFocus=!1,e=this.element.querySelector("."+Qr))&&(e.classList.remove(Qr),this.element.classList.remove("e-steps-focus"))},H.prototype.updateStepperStatus=function(e){for(var t=0;t<this.steps.length;t++){var i=this.steps[parseInt(t.toString(),10)],s=i.status.toLowerCase();if(e&&0===this.activeStep&&0===t&&(o=this.isProtectedOnChange,this.isProtectedOnChange=!0,i.status=a.StepStatus.InProgress,this.isProtectedOnChange=o),i&&"notstarted"!==s&&t===this.activeStep)for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],o=(r.classList.remove(Xr,Yr,Jr,Gr),this.isProtectedOnChange);this.isProtectedOnChange=!0,"completed"===s?this.updateStatusClass(n,t,r):this.updateStatusClass(n,t,r,!0),this.isProtectedOnChange=o}else i&&"notstarted"!==s&&t!==this.activeStep&&this.navigationHandler(this.activeStep,null,!0)}},H.prototype.updateStatusClass=function(e,t,i,s){var n=this.steps[parseInt(e.toString(),10)];e<t?(i.classList.add(Jr),n.status=a.StepStatus.Completed):e===t?i.classList.add(s?Yr:Jr,Xr):i.classList.add(Gr)},H.prototype.renderItems=function(){for(var t=this,e=this.element.classList.contains(oo),i=this.element.classList.contains(ro),s=E.isNullOrUndefined(this.labelPosition)?"":this.labelPosition.toLowerCase(),n=0;n<this.steps.length;n++){this.stepperItemContainer=this.createElement("li",{className:"e-step-container"});var r,o,l,a=this.createElement("span",{className:"e-step"}),d=this.steps[parseInt(n.toString(),10)],h=!!d.label,c=!!d.text,p=this.element.classList.contains(uo),c=(this.stepperItemContainer.classList[0===n?"add":"remove"](Xr,Yr),this.stepperItemContainer.classList[0!==n?"add":"remove"](Gr),e&&this.stepperItemContainer.style.setProperty("--max-width",100/this.steps.length+"%"),this.renderDefault(n)&&(E.isNullOrUndefined(this.template)||""===this.template)?((r=!this.element.classList.contains("e-step-type-default")&&"indicator"===this.stepType.toLowerCase())&&a.classList.add("e-icons",fo),r||null!=d.isValid||(a.classList.add("e-step-content"),a.innerHTML=(n+1).toString()),this.stepperItemContainer.appendChild(a)):!E.isNullOrUndefined(this.template)&&""!==this.template||(r=!0,!(d.iconCss||!d.iconCss&&c&&h)||(c||h)&&this.element.classList.contains(mo)||(d.iconCss?(l=d.iconCss.trim().split(" "),(o=a.classList).add.apply(o,[zr].concat(l)),this.stepperItemContainer.classList.add(lo)):!d.iconCss&&c&&h&&(a.classList.add(zr),a.innerHTML=d.text,this.stepperItemContainer.classList.add(lo)),this.stepperItemContainer.appendChild(a),(e&&("start"===s||"end"===s)&&h||i&&("top"===s||"bottom"===s)&&h)&&!p&&(this.element.classList.add("e-label-"+s),this.createTextLabelElement(d.label),r=!1)),!c||d.iconCss&&p||!r||d.iconCss&&h||(!d.iconCss&&p||(!d.iconCss||this.element.classList.contains(mo))&&!h?(d.iconCss||h||this.element.classList.add("e-step-type-indicator"),this.checkValidState(d,a),h=!1):(h||this.createTextLabelElement(d.text),h&&this.element.classList.contains(mo)&&(this.createElement("span",{className:ho}).innerText=d.label),c=!h)),!h)||d.iconCss&&p||!r||(d.iconCss||c||!p?(!this.element.classList.contains(mo)||!c||this.element.classList.contains(mo)&&h)&&(this.createTextLabelElement(d.label,!0),this.updateLabelPosition(),(d.iconCss||c||this.stepperItemContainer.classList.contains(lo))&&!this.element.classList.contains(mo)||(this.stepperItemContainer.classList.add("e-step-label-only"),null!==d.isValid&&(o=this.createElement("span",{className:"e-step-validation-icon e-icons"}),this.labelContainer.appendChild(o)))):this.checkValidState(d,a,!0)),d.optional&&(l=this.createElement("span",{className:"e-step-label-optional"}),this.l10n.setLocale(this.locale),p=this.l10n.getConstant("optional"),l.innerText=p,(h&&this.labelContainer&&(this.element.classList.contains(so)&&!this.stepperItemContainer.classList.contains("e-step-label-only")||e&&this.element.classList.contains(no)&&!this.stepperItemContainer.classList.contains("e-step-label-only"))||i&&this.element.classList.contains(no)?this.labelContainer:this.stepperItemContainer).appendChild(l),null!==d.isValid)&&this.stepperItemContainer.classList.add(d.isValid?"e-step-valid":"e-step-error"),d.cssClass&&E.addClass([this.stepperItemContainer],d.cssClass.trim().split(" ")),d.disabled&&(this.stepperItemContainer.classList[d.disabled?"add":"remove"](Zr),E.attributes(this.stepperItemContainer,{tabindex:"-1","aria-disabled":"true"})),null!==d.isValid&&(d.isValid?this.stepperItemContainer.classList.add("e-step-valid"):this.stepperItemContainer.classList.add("e-step-error")),this.renderItemContent(n,!1),this.stepperItemContainer.classList.contains(Yr)?E.attributes(this.stepperItemContainer,{tabindex:"0","aria-current":"true"}):E.attributes(this.stepperItemContainer,{tabindex:"-1"}),this.wireItemsEvents(this.stepperItemContainer,n),this.stepperItemElements.push(this.stepperItemContainer),{element:this.stepperItemContainer,index:n});this.trigger("beforeStepRender",c,function(e){t.stepperItemList.appendChild(e.element)}),i&&(this.isAngular&&this.template?setTimeout(function(){t.calculateProgressBarPosition()}):this.calculateProgressBarPosition())}if(i&&this.element.classList.contains(no))for(var u=this.stepperItemList.querySelectorAll("."+po),m=0;m<u.length;m++)u[parseInt(m.toString(),10)].style.setProperty("--label-width",this.beforeLabelWidth+5+"px")},H.prototype.createTextLabelElement=function(e,t){var i=this.createElement("span",{className:(t=void 0===t?!1:t)?po:Kr+" "+ho});i.innerText=e,(t?(this.labelContainer=this.createElement("span",{className:"e-step-label-container"}),this.labelContainer):this.stepperItemContainer).appendChild(i),this.stepperItemContainer.classList.add(t?co:ao)},H.prototype.calculateProgressBarPosition=function(){var e=!!this.element.classList.contains(no),t=this.stepperItemContainer.classList.contains(lo)&&!this.stepperItemContainer.classList.contains(ao)&&!this.stepperItemContainer.classList.contains(co),i=this.stepperItemContainer.querySelector("."+Kr);i&&(this.textEleWidth=this.textEleWidth<i.offsetWidth?i.offsetWidth:this.textEleWidth),e?(i=this.stepperItemContainer.querySelector("."+po).offsetWidth+15,this.beforeLabelWidth=Math.max(this.beforeLabelWidth,i),e=this.element.querySelector("ol").lastChild.querySelector("."+zr),i=this.stepperItemContainer.querySelector("."+Kr),e||i?(e=this.beforeLabelWidth+(this.stepperItemContainer.querySelector("."+zr)||i).offsetWidth/2,this.progressBarPosition=Math.max(this.progressBarPosition,e)):this.progressBarPosition=Math.max(this.progressBarPosition,this.beforeLabelWidth/2)):(i=this.element.querySelector("ol").lastChild,e=(t?this.stepperItemContainer:i.firstChild).offsetWidth,this.progressBarPosition=Math.max(this.progressBarPosition,e))},H.prototype.checkValidState=function(e,t,i){null==e.isValid?(t.classList.add("e-step-content"),t.innerHTML=i?e.label:e.label||e.text,this.stepperItemContainer.appendChild(t)):(t.classList.add(zr),this.stepperItemContainer.appendChild(t),this.stepperItemContainer.classList.add(lo))},H.prototype.updateCurrentLabel=function(){var e=this.labelPosition.toLowerCase();return this.element.classList.contains(oo)?"top"===e?"before":"bottom"===e?"after":e:"start"===e?"before":"end"===e?"after":e},H.prototype.updateLabelPosition=function(){this.clearLabelPosition(),this.labelContainer.classList.add("e-label-"+this.updateCurrentLabel()),"start"===this.labelPosition.toLowerCase()&&"vertical"===this.orientation.toLowerCase()&&this.stepperItemContainer.firstChild?this.stepperItemContainer.firstChild.before(this.labelContainer):this.stepperItemContainer.appendChild(this.labelContainer),this.element.classList.add("e-label-"+this.updateCurrentLabel())},H.prototype.clearLabelPosition=function(){var e=this.labelContainer.classList.value.match(/(e-label-[after|before]+)/g);e&&(E.removeClass([this.labelContainer],e),E.removeClass([this.element],e))},H.prototype.checkValidStep=function(){for(var a=this.element.classList.contains(uo),d=this,e=0;e<this.steps.length;e++)!function(e){var t,i,s,n,r,o=d.steps[parseInt(e.toString(),10)],l=d.stepperItemElements[parseInt(e.toString(),10)];null!==o.isValid&&(r=void 0,a&&!o.iconCss?r=l.querySelector("."+zr):t=l.querySelector("."+zr),!r&&a&&d.renderDefault(e)&&(r=l.querySelector("."+fo)),i=l.querySelector(".e-step-validation-icon"),o=o.iconCss.trim().split(" "),n=(s=l.classList.contains("e-step-valid"))?"e-check":"e-circle-info",r&&(r.classList.remove(fo),""!==r.innerHTML&&(r.innerHTML=""),r.classList.add("e-icons",n,zr)),d.renderDefault(e)&&!a&&l.querySelector(".e-step").classList.add("e-icons",n,zr),t&&(""!==t.innerHTML?t.innerHTML="":0<o.length&&o.forEach(function(e){t.classList.remove(e)}),t.classList.add("e-icons",n)),i)&&(i.classList.add(s?"e-circle-check":"e-circle-info"),d.element.classList.contains(ro))&&(r=l.querySelector("."+po),o=(e=l.querySelector("."+ho))?e.offsetWidth+e.getBoundingClientRect().left:r.offsetWidth+r.getBoundingClientRect().left,l.querySelector(".e-step-validation-icon").style.setProperty("--icon-position",o+20+"px"))}(e)},H.prototype.updateTooltip=function(){this.showTooltip?(this.tooltipObj=new g.Tooltip({target:".e-step-container",windowCollision:!0,opensOn:"Custom",cssClass:this.cssClass?go+" "+this.cssClass:go,position:"TopCenter"}),this.tooltipObj.appendTo(this.stepperItemList)):E.isNullOrUndefined(this.tooltipObj)||(this.tooltipObj.destroy(),this.tooltipObj=null)},H.prototype.wireItemsEvents=function(e,t){E.EventHandler.add(e,"click",this.linearModeHandler.bind(this,e,t),this),E.EventHandler.add(e,"mouseover",this.openStepperTooltip.bind(this,t),this),E.EventHandler.add(e,"mouseleave",this.closeStepperTooltip,this)},H.prototype.unWireItemsEvents=function(){for(var e=0;e<this.steps.length;e++){var t=this.stepperItemElements[parseInt(e.toString(),10)];E.EventHandler.remove(t,"click",this.linearModeHandler.bind(this,t,e)),E.EventHandler.remove(t,"mouseover",this.openStepperTooltip.bind(this,e)),E.EventHandler.remove(t,"mouseleave",this.closeStepperTooltip)}},H.prototype.linearModeHandler=function(e,t,i){var s;this.linear&&(s=t-this.activeStep,1!==Math.abs(s))||this.stepClickHandler(t,i,e)},H.prototype.openStepperTooltip=function(e){var t=this.steps[parseInt(e.toString(),10)];this.showTooltip&&(t.label||t.text)&&!this.tooltipOpen&&(this.updateTooltipContent(e),this.tooltipObj.open(this.stepperItemElements[parseInt(e.toString(),10)]),"label"!==this.stepType.toLocaleLowerCase()&&("indicator"===this.stepType.toLocaleLowerCase()||""!==t.label&&""!==t.iconCss||null===t.label&&""===t.iconCss&&""!==t.text)&&(e="inprogress"===t.status.toLowerCase()?go+" e-step-inprogress-tip "+(this.cssClass||""):go+" "+(this.cssClass||""),this.tooltipObj.setProperties({cssClass:e.trim()})),this.tooltipOpen=!0)},H.prototype.closeStepperTooltip=function(){this.tooltipOpen&&(this.tooltipObj.close(),this.tooltipOpen=!1)},H.prototype.updateTooltipContent=function(e){var t,i,s;this.showTooltip&&(this.isReact&&this.clearTemplate(["stepperTooltipTemplate"]),t=void 0,e=this.steps[parseInt(e.toString(),10)],this.tooltipTemplate?(t=this.createElement("span",{className:"e-stepper-tooltip-content"}),i=this.getTemplateFunction(this.tooltipTemplate),E.append(i({value:e},this,"stepperTooltipTemplate",this.element.id+"tooltipTemplate",this.isStringTemplate),t),this.tooltipObj.setProperties({content:t},!0)):(s=e.label||e.text,this.tooltipObj.setProperties({content:E.initializeCSPTemplate(function(){return s})},!0)),this.renderReactTemplates())},H.prototype.stepClickHandler=function(e,t,i){var s={element:i,event:t,previousStep:this.activeStep,activeStep:e};this.trigger("stepClick",s),this.navigateToStep(e,t,i,!0)},H.prototype.updateTemplateFunction=function(){this.templateFunction=this.template?this.getTemplateFunction(this.template):null},H.prototype.renderItemContent=function(e,t){var i,s=this.stepperItemList.querySelectorAll("li");t&&this.removeItemContent(s[parseInt(e.toString(),10)]),this.template&&((t?s[parseInt(e.toString(),10)]:this.stepperItemContainer).classList.add(io),i=this.steps[parseInt(e.toString(),10)],E.append(this.templateFunction({step:i,currentStep:e},this,"stepperTemplate",this.element.id+"_stepperTemplate",this.isStringTemplate),t?s[parseInt(e.toString(),10)]:this.stepperItemContainer)),this.renderReactTemplates()},H.prototype.removeItemContent=function(e){e.classList.remove(io);for(var t=e.firstElementChild,i=0;i<e.childElementCount;i++)t.remove()},H.prototype.updateContent=function(){this.isReact&&this.clearTemplate(["stepperTemplate"]);for(var e=0;e<this.steps.length;e++)this.renderItemContent(e,!0)},H.prototype.getTemplateFunction=function(t){if("string"!=typeof t)return E.compile(t);var i="";try{var e=E.select(t),i=e?"SCRIPT"===e.tagName?e.innerHTML:e.outerHTML:t}catch(e){i=t}return E.compile(i)},H.prototype.navigateToStep=function(t,i,s,n,e){var r,o=this,l={element:s,event:i,isInteracted:n,previousStep:this.activeStep,activeStep:t,cancel:!1};!1!==e?(r=this.activeStep,this.trigger("stepChanging",l,function(e){e.cancel||(o.navigationHandler(t),e={element:s,event:i,isInteracted:n,previousStep:r,activeStep:o.activeStep},o.trigger("stepChanged",e))})):this.navigationHandler(t)},H.prototype.navigationHandler=function(e,t,i){e=Math.min(e,this.steps.length-1);var s=this.stepperItemElements.length,s=(0<=e&&e<s-1&&(e=this.stepperItemElements[parseInt(e.toString(),10)].classList.contains(Zr)?this.activeStep:e),this.isProtectedOnChange);this.isProtectedOnChange=!0,this.activeStep=parseInt(e.toString(),10),this.isProtectedOnChange=s;for(var n=0;n<this.steps.length;n++){var r=this.stepperItemElements[parseInt(n.toString(),10)],o=this.steps[parseInt(n.toString(),10)],l=(r.classList.remove(Xr,Yr,Jr,Gr),n===this.activeStep&&r.classList.add(Xr),0<=this.activeStep&&this.progressbar?this.element.classList.contains(oo)?this.calculateProgressbarPos():this.progressbar.style.setProperty(eo,100/(this.steps.length-1)*e+"%"):this.activeStep<0&&this.progressbar&&this.progressbar.style.setProperty(eo,"0%"),n===this.activeStep?r.classList.add(Yr):0<this.activeStep&&n<this.activeStep?r.classList.add(Jr):r.classList.add(Gr),r.classList.contains(Yr)?E.attributes(r,{tabindex:"0","aria-current":"true"}):E.attributes(r,{tabindex:"-1","aria-current":"false"}),this.isProtectedOnChange);!(this.isProtectedOnChange=!0)!==i&&(n<this.activeStep||this.steps.length-1===this.activeStep&&"completed"===o.status.toLowerCase()?o.status=a.StepStatus.Completed:n===this.activeStep?o.status=a.StepStatus.InProgress:n>this.activeStep&&(o.status=a.StepStatus.NotStarted),t&&this.activeStep===n&&(o.status=t),"completed"===o.status.toLowerCase()&&(r.classList.remove(Xr,Yr,Gr),r.classList.add(Jr)),"notstarted"===o.status.toLowerCase())&&(r.classList.remove(Xr,Yr,Jr),r.classList.add(Gr)),this.isProtectedOnChange=l,this.updateIndicatorStatus(n,r)}this.updateStepInteractions()},H.prototype.calculateProgressbarPos=function(){var e,i,s,t,n,r=this;(this.element.classList.contains(no)||this.element.classList.contains(so))&&!this.element.classList.contains(uo)&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(lo)?(n=this.element.querySelector(".e-stepper-progressbar"),t=this.stepperItemElements[parseInt(this.activeStep.toString(),10)].firstChild,e=0===this.activeStep?0:(t.offsetLeft-n.offsetLeft+t.offsetWidth/2)/n.offsetWidth*100,this.element.classList.contains(to)&&(e=(n.getBoundingClientRect().right-t.getBoundingClientRect().right+t.offsetWidth/2)/n.offsetWidth*100),this.progressbar.style.setProperty(eo,e+"%")):(s=i=0,this.stepperItemElements.forEach(function(e,t){e=e.offsetWidth;i+=e,t<=r.activeStep&&(s+=t===r.activeStep&&0!==t?e/2:e)}),t=(this.stepperItemList.offsetWidth-i)/(this.stepperItemElements.length-1),n=(s+t*this.activeStep)/this.stepperItemList.offsetWidth*100,this.progressbar.style.setProperty(eo,n+"%"))},H.prototype.updateIndicatorStatus=function(e,t){this.renderDefault(e)&&this.element.classList.contains(uo)&&!t.classList.contains("e-step-valid")&&!t.classList.contains("e-step-error")&&(t.classList.contains(Jr)?(t.firstChild.classList.remove("e-icons","e-step-indicator"),t.firstChild.classList.add(zr,"e-icons","e-check")):(t.classList.contains(Yr)||t.classList.contains(Gr))&&(t.firstChild.classList.remove(zr,"e-icons","e-check"),t.firstChild.classList.add("e-icons","e-step-indicator")))},H.prototype.updateStepInteractions=function(){var i=this;this.element.classList.toggle(vo,this.linear),this.stepperItemElements.forEach(function(e,t){e.classList.toggle("e-previous",t===i.activeStep-1),e.classList.toggle("e-next",t===i.activeStep+1)})},H.prototype.removeItemElements=function(){for(var e=0;e<this.stepperItemElements.length;e++)E.remove(this.stepperItemElements[parseInt(e.toString(),10)]);this.stepperItemElements=[]},H.prototype.nextStep=function(){this.activeStep!==this.steps.length-1&&this.navigateToStep(this.activeStep+1,null,null,!1)},H.prototype.previousStep=function(){0<this.activeStep&&this.navigateToStep(this.activeStep-1,null,null,!1)},H.prototype.reset=function(){var e;0===this.activeStep?this.updateStepInteractions():(e=!!this.stepperItemElements[0].classList.contains(Zr),this.navigateToStep(e?-1:0,null,null,!1))},H.prototype.refreshProgressbar=function(){this.stepperItemList&&this.progressbar&&this.setProgressPosition(this.element),this.navigateToStep(this.activeStep,null,null,!1,!1)},H.prototype.updateElementClassArray=function(){E.removeClass([this.element],[to,$r,"e-steps-focus",so,no,"e-label-top","e-label-bottom","e-label-start","e-label-end",uo,mo,ro,oo,vo])},H.prototype.destroy=function(){Co.prototype.destroy.call(this),this.unWireEvents(),this.unWireItemsEvents(),this.removeItemElements(),this.clearTemplate(),this.stepperItemList&&E.remove(this.stepperItemList),this.stepperItemList=null,this.progressStep&&E.remove(this.progressStep),this.progressStep=null,this.progressbar=null,this.progressBarPosition=null,this.stepperItemContainer=null,this.textContainer=null,this.labelContainer=null,this.updateElementClassArray(),this.element.removeAttribute("aria-label"),this.showTooltip&&(this.tooltipObj.destroy(),this.tooltipObj=null),this.keyboardModuleStepper&&this.keyboardModuleStepper.destroy(),this.keyboardModuleStepper=null},H.prototype.wireKeyboardEvent=function(){this.keyboardModuleStepper=new E.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},H.prototype.keyActionHandler=function(e){if(!this.readOnly)switch(e.action){case"uparrow":case"downarrow":case"leftarrow":case"rightarrow":case"tab":case"shiftTab":this.handleNavigation(this.enableRtl&&this.element.classList.contains(oo)?"leftarrow"===e.action||"tab"===e.action||"uparrow"===e.action:"rightarrow"===e.action||"tab"===e.action||"downarrow"===e.action,e);break;case"space":case"enter":case"escape":this.handleNavigation(null,e);break;case"home":case"end":this.handleNavigation(null,e,this.enableRtl)}},H.prototype.handleNavigation=function(e,t,i){this.isKeyNavFocus=!0,this.element.classList.add("e-steps-focus");var s=(s=this.element.querySelector("."+Qr))||this.element.querySelector("."+Xr),n=Array.prototype.slice.call(this.stepperItemList.children),r=n.indexOf(s);if("tab"===t.action||"shiftTab"===t.action||"downarrow"===t.action||"uparrow"===t.action||"space"===t.action||"home"===t.action||"end"===t.action)if("tab"===t.action&&r===n.length-1||"shiftTab"===t.action&&0===r){if(s.classList.contains(Qr))return void this.updateStepFocus()}else t.preventDefault();if("escape"===t.action&&(n[parseInt(r.toString(),10)].classList.remove(Qr),this.element.classList.remove("e-steps-focus")),"space"!==t.action&&"enter"!==t.action){for(var s=r,r=e?r+1:r-1;0<=r&&r<n.length&&n[parseInt(r.toString(),10)].classList.contains(Zr);)r=e?r+1:r-1;r=r<0?0:r>n.length-1?n.length-1:r,n[parseInt(s.toString(),10)].classList.contains(Qr)&&n[parseInt(s.toString(),10)].classList.remove(Qr),0<=(r="home"!==t.action&&"end"!==t.action?r:"home"===t.action?i?n.length-1:0:i?0:n.length-1)&&r<n.length&&n[parseInt(r.toString(),10)].classList.add(Qr)}else"space"!==t.action&&"enter"!==t.action||(s=!1,this.linear&&(i=this.activeStep-r,1!==Math.abs(i))||(this.navigateToStep(r,null,null,!0),s=!0),s&&(this.updateStepFocus(),this.stepperItemElements[r].focus()))},H.prototype.renderStepperItems=function(e,t){this.updateElementClassArray(),this.removeItemElements(),this.element.querySelector(".e-stepper-progressbar").remove(),e&&this.updatePosition(),t&&this.updateStepType(),this.readOnly&&!this.element.classList.contains($r)&&this.element.classList.add($r),this.enableRtl&&!this.element.classList.contains(to)&&this.element.classList.add(to),this.updateOrientaion(this.element),this.renderItems(),this.renderProgressBar(this.element),this.checkValidStep(),this.updateAnimation(),this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicSteps=function(e,t){if(e instanceof Array&&t instanceof Array)this.renderStepperItems(!0,!0);else for(var i=Object.keys(e),s=0;s<i.length;s++)for(var n=parseInt(Object.keys(e)[s],10),r=Object.keys(e[n]).length,o=0;o<r;o++){var l=Object.keys(e[n])[o];"status"===l?this.activeStep===n?this.navigationHandler(n,e[n].status):this.steps[n].status=t[n].status:(this.removeItemElements(),this.renderItems(),this.updateStepperStatus()),"label"===l&&(this.steps[n].iconCss||this.steps[n].text)&&"default"===this.stepType.toLowerCase()&&this.refreshProgressbar(),this.updateStepInteractions(),this.checkValidStep()}},H.prototype.updateDynamicActiveStep=function(e,t){this.activeStep=e>this.steps.length-1||e<-1?t:this.activeStep,0<=this.activeStep&&this.stepperItemElements[parseInt(this.activeStep.toString(),10)].classList.contains(Zr)&&(this.activeStep=t),this.linear?(e=t-this.activeStep,1===Math.abs(e)&&this.navigateToStep(this.activeStep,null,null,!0)):this.navigateToStep(this.activeStep,null,this.stepperItemElements[this.activeStep],!0)},H.prototype.updateDynamicCssClass=function(e,t){t&&E.removeClass([this.element],t.trim().split(" ")),e&&E.addClass([this.element],e.trim().split(" ")),this.tooltipObj&&this.tooltipObj.setProperties({cssClass:this.cssClass?go+" "+this.cssClass:go})},H.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"steps":this.updateDynamicSteps(e.steps,t.steps);break;case"orientation":this.updateOrientaion(this.element),this.renderStepperItems(!0);break;case"activeStep":this.updateDynamicActiveStep(e.activeStep,t.activeStep);break;case"enableRtl":this.element.classList[this.enableRtl?"add":"remove"](to);break;case"readOnly":this.element.classList[this.readOnly?"add":"remove"]($r);break;case"cssClass":this.updateDynamicCssClass(e.cssClass,t.cssClass);break;case"labelPosition":this.renderStepperItems(!0);break;case"showTooltip":this.updateTooltip();break;case"stepType":this.renderStepperItems(!0,!0);break;case"template":this.updateTemplateFunction(),this.updateContent();break;case"animation":this.updateAnimation();break;case"linear":this.updateStepInteractions()}},M([E.Property(0)],H.prototype,"activeStep",void 0),M([E.Complex({},yo)],H.prototype,"animation",void 0),M([E.Property(!1)],H.prototype,"linear",void 0),M([E.Property(!1)],H.prototype,"showTooltip",void 0),M([E.Property("")],H.prototype,"template",void 0),M([E.Property("")],H.prototype,"tooltipTemplate",void 0),M([E.Property(a.StepLabelPosition.Bottom)],H.prototype,"labelPosition",void 0),M([E.Property(a.StepType.Default)],H.prototype,"stepType",void 0),M([E.Event()],H.prototype,"stepChanged",void 0),M([E.Event()],H.prototype,"stepChanging",void 0),M([E.Event()],H.prototype,"stepClick",void 0),M([E.Event()],H.prototype,"beforeStepRender",void 0);var Co,So=M([E.NotifyPropertyChanges],H);function H(e,t){e=Co.call(this,e,t)||this;return e.stepperItemElements=[],e}a.Accordion=e,a.AccordionActionSettings=Jt,a.AccordionAnimationSettings=ei,a.AccordionItem=si,a.ActionSettings=Ys,a.AppBar=P,a.Breadcrumb=f,a.BreadcrumbItem=Pn,a.Carousel=A,a.CarouselItem=gr,a.ContextMenu=n,a.FieldSettings=je,a.FieldsSettings=zs,a.HScroll=ee,a.Header=es,a.Item=Nt,a.Menu=F,a.MenuAnimationSettings=ze,a.MenuItem=We,a.NodeAnimationSettings=Js,a.Sidebar=c,a.Step=Br,a.Stepper=So,a.StepperAnimationSettings=yo,a.StepperBase=Fr,a.Tab=ci,a.TabActionSettings=Yi,a.TabAnimationSettings=Ji,a.TabItem=ss,a.Toolbar=Lt,a.TreeView=l,a.VScroll=fe,a.addScrolling=ge,a.destroyScroll=ye,Object.defineProperty(a,"__esModule",{value:!0})});
2
11
  //# sourceMappingURL=ej2-navigations.umd.min.js.map