@syncfusion/ej2-dropdowns 28.2.12 → 29.1.33

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.
Files changed (135) hide show
  1. package/README.md +1 -1
  2. package/dist/ej2-dropdowns.min.js +2 -2
  3. package/dist/ej2-dropdowns.umd.min.js +2 -2
  4. package/dist/ej2-dropdowns.umd.min.js.map +1 -1
  5. package/dist/es6/ej2-dropdowns.es2015.js +113 -61
  6. package/dist/es6/ej2-dropdowns.es2015.js.map +1 -1
  7. package/dist/es6/ej2-dropdowns.es5.js +112 -60
  8. package/dist/es6/ej2-dropdowns.es5.js.map +1 -1
  9. package/dist/global/ej2-dropdowns.min.js +2 -2
  10. package/dist/global/ej2-dropdowns.min.js.map +1 -1
  11. package/dist/global/index.d.ts +1 -1
  12. package/package.json +13 -13
  13. package/src/auto-complete/auto-complete.js +4 -3
  14. package/src/drop-down-list/drop-down-list.js +34 -23
  15. package/src/drop-down-tree/drop-down-tree-model.d.ts +1 -1
  16. package/src/drop-down-tree/drop-down-tree.d.ts +1 -1
  17. package/src/drop-down-tree/drop-down-tree.js +3 -3
  18. package/src/mention/mention-model.d.ts +8 -0
  19. package/src/mention/mention.d.ts +7 -0
  20. package/src/mention/mention.js +27 -7
  21. package/src/multi-select/multi-select.js +44 -24
  22. package/styles/bds-lite.css +7 -0
  23. package/styles/bds.css +7 -0
  24. package/styles/bootstrap-dark-lite.css +11 -4
  25. package/styles/bootstrap-dark.css +11 -4
  26. package/styles/bootstrap-lite.css +7 -0
  27. package/styles/bootstrap.css +7 -0
  28. package/styles/bootstrap4-lite.css +18 -11
  29. package/styles/bootstrap4.css +18 -11
  30. package/styles/bootstrap5-dark-lite.css +38 -31
  31. package/styles/bootstrap5-dark.css +38 -31
  32. package/styles/bootstrap5-lite.css +9 -2
  33. package/styles/bootstrap5.3-lite.css +12 -4
  34. package/styles/bootstrap5.3.css +12 -4
  35. package/styles/bootstrap5.css +9 -2
  36. package/styles/drop-down-base/_bootstrap-dark-definition.scss +3 -1
  37. package/styles/drop-down-base/_bootstrap4-definition.scss +3 -1
  38. package/styles/drop-down-base/bootstrap-dark.css +2 -2
  39. package/styles/drop-down-base/bootstrap4.css +5 -5
  40. package/styles/drop-down-base/bootstrap5-dark.css +13 -13
  41. package/styles/drop-down-base/fabric-dark.css +2 -2
  42. package/styles/drop-down-base/fabric.css +2 -2
  43. package/styles/drop-down-list/_layout.scss +1 -1
  44. package/styles/drop-down-list/bootstrap5-dark.css +2 -2
  45. package/styles/drop-down-tree/_bds-definition.scss +0 -1
  46. package/styles/drop-down-tree/_bigger.scss +5 -0
  47. package/styles/drop-down-tree/_bootstrap4-definition.scss +5 -3
  48. package/styles/drop-down-tree/_layout.scss +5 -1
  49. package/styles/drop-down-tree/_material-definition.scss +4 -2
  50. package/styles/drop-down-tree/bds.css +3 -0
  51. package/styles/drop-down-tree/bootstrap-dark.css +3 -0
  52. package/styles/drop-down-tree/bootstrap.css +3 -0
  53. package/styles/drop-down-tree/bootstrap4.css +4 -1
  54. package/styles/drop-down-tree/bootstrap5-dark.css +9 -6
  55. package/styles/drop-down-tree/bootstrap5.3.css +3 -3
  56. package/styles/drop-down-tree/bootstrap5.css +3 -0
  57. package/styles/drop-down-tree/fabric-dark.css +3 -0
  58. package/styles/drop-down-tree/fabric.css +3 -0
  59. package/styles/drop-down-tree/fluent-dark.css +3 -0
  60. package/styles/drop-down-tree/fluent.css +3 -0
  61. package/styles/drop-down-tree/fluent2.css +9 -0
  62. package/styles/drop-down-tree/highcontrast-light.css +3 -0
  63. package/styles/drop-down-tree/highcontrast.css +3 -0
  64. package/styles/drop-down-tree/material-dark.css +3 -0
  65. package/styles/drop-down-tree/material.css +4 -1
  66. package/styles/drop-down-tree/material3-dark.css +3 -0
  67. package/styles/drop-down-tree/material3.css +3 -0
  68. package/styles/drop-down-tree/tailwind-dark.css +5 -2
  69. package/styles/drop-down-tree/tailwind.css +3 -0
  70. package/styles/drop-down-tree/tailwind3.css +3 -0
  71. package/styles/fabric-dark-lite.css +10 -3
  72. package/styles/fabric-dark.css +10 -3
  73. package/styles/fabric-lite.css +14 -7
  74. package/styles/fabric.css +14 -7
  75. package/styles/fluent-dark-lite.css +7 -0
  76. package/styles/fluent-dark.css +7 -0
  77. package/styles/fluent-lite.css +7 -0
  78. package/styles/fluent.css +7 -0
  79. package/styles/fluent2-lite.css +12 -1
  80. package/styles/fluent2.css +18 -1
  81. package/styles/highcontrast-light-lite.css +7 -0
  82. package/styles/highcontrast-light.css +7 -0
  83. package/styles/highcontrast-lite.css +7 -0
  84. package/styles/highcontrast.css +7 -0
  85. package/styles/list-box/_bootstrap-dark-definition.scss +3 -1
  86. package/styles/list-box/_bootstrap4-definition.scss +3 -1
  87. package/styles/list-box/_layout.scss +7 -3
  88. package/styles/list-box/bootstrap-dark.css +1 -1
  89. package/styles/list-box/bootstrap4.css +1 -1
  90. package/styles/list-box/bootstrap5-dark.css +3 -3
  91. package/styles/list-box/bootstrap5.3.css +5 -1
  92. package/styles/list-box/fabric-dark.css +1 -1
  93. package/styles/list-box/fabric.css +1 -1
  94. package/styles/list-box/fluent2.css +5 -1
  95. package/styles/list-box/tailwind3.css +6 -2
  96. package/styles/material-dark-lite.css +9 -2
  97. package/styles/material-dark.css +9 -2
  98. package/styles/material-lite.css +13 -6
  99. package/styles/material.css +13 -6
  100. package/styles/material3-dark-lite.css +9 -2
  101. package/styles/material3-dark.css +9 -2
  102. package/styles/material3-lite.css +9 -2
  103. package/styles/material3.css +9 -2
  104. package/styles/multi-select/_bootstrap4-definition.scss +5 -3
  105. package/styles/multi-select/_layout.scss +3 -0
  106. package/styles/multi-select/_material-dark-definition.scss +4 -2
  107. package/styles/multi-select/_material-definition.scss +7 -5
  108. package/styles/multi-select/_material3-definition.scss +4 -2
  109. package/styles/multi-select/bds.css +4 -0
  110. package/styles/multi-select/bootstrap-dark.css +5 -1
  111. package/styles/multi-select/bootstrap.css +4 -0
  112. package/styles/multi-select/bootstrap4.css +8 -4
  113. package/styles/multi-select/bootstrap5-dark.css +11 -7
  114. package/styles/multi-select/bootstrap5.3.css +4 -0
  115. package/styles/multi-select/bootstrap5.css +6 -2
  116. package/styles/multi-select/fabric-dark.css +4 -0
  117. package/styles/multi-select/fabric.css +8 -4
  118. package/styles/multi-select/fluent-dark.css +4 -0
  119. package/styles/multi-select/fluent.css +4 -0
  120. package/styles/multi-select/fluent2.css +4 -0
  121. package/styles/multi-select/highcontrast-light.css +4 -0
  122. package/styles/multi-select/highcontrast.css +4 -0
  123. package/styles/multi-select/material-dark.css +6 -2
  124. package/styles/multi-select/material.css +9 -5
  125. package/styles/multi-select/material3-dark.css +6 -2
  126. package/styles/multi-select/material3.css +6 -2
  127. package/styles/multi-select/tailwind-dark.css +4 -0
  128. package/styles/multi-select/tailwind.css +4 -0
  129. package/styles/multi-select/tailwind3.css +4 -0
  130. package/styles/tailwind-dark-lite.css +9 -2
  131. package/styles/tailwind-dark.css +9 -2
  132. package/styles/tailwind-lite.css +7 -0
  133. package/styles/tailwind.css +7 -0
  134. package/styles/tailwind3-lite.css +13 -2
  135. package/styles/tailwind3.css +13 -2
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * filename: ej2-dropdowns.umd.min.js
3
- * version : 28.2.12
3
+ * version : 29.1.33
4
4
  * Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
7
7
  * licensing@syncfusion.com. Any infringement will be prosecuted under
8
8
  * applicable laws.
9
9
  */
10
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-lists","@syncfusion/ej2-notifications","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-navigations"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Data,t.ej2Lists,t.ej2Notifications,t.ej2Popups,t.ej2Inputs,t.ej2Buttons,t.ej2Navigations)}(this,function(t,P,c,U,V,o,h,H,F){"use strict";var v="",W="",q="",g=[],M="";function j(t,e,i,s,l,n,a,o,r){var h;if(n&&""!==v?v===W&&(q=String.fromCharCode(t)):""!==q?(v=q+String.fromCharCode(t),q=""):v+=String.fromCharCode(t),o?(setTimeout(function(){q=""},700),setTimeout(function(){v=""},3e3)):setTimeout(function(){v=""},1e3),v=s?v.toLowerCase():v,M!==l||W!==v||r){var u=e,p=v.length,d=void 0,c=i=i?i+1:0;for(g=[];d=u[h=-1===(c=c===u.length?-1:c)?0:c],(s?d.innerText.toLowerCase():d.innerText).substr(0,p)===v&&g.push(u[h]),++c!==i;);if(W=v,M=l,o){for(var m=!1,f=0;f<g.length;f++)if(a&&g[f].textContent.toLowerCase()===a.toLowerCase()){h=f,m=!0;break}return a&&m&&(h+=1),g[h]||g[0]}return g[0]}for(var c=0;c<g.length;c++){if(g[c].classList.contains("e-active")){h=c;break}if(a&&g[c].textContent.toLowerCase()===a.toLowerCase()){h=c;break}}return h+=1,o?g[h]&&g.length-1!==h?g[h]:g[g.length]:g[h]||g[0]}function d(t,a,o,r,h,u,p,d){var e=a,c=(r=null==r||r,{item:null,index:null});if(t&&t.length)for(var m=t.length,f=R(f=r?t.toLocaleLowerCase():t),i=0,s=e;i<s.length;i++){var l=function(t,e){var i,s,l,e=e[t],n=(a&&h&&(s=e,l=u.text.split("."),h.filter(function(e){Array.prototype.slice.call(l).forEach(function(t){("object"===p&&!e.isHeader&&-1!==s.textContent.toString().indexOf(e[t])&&s.getAttribute("data-value")===e[u.value].toString()||"string"===p&&-1!==s.textContent.toString().indexOf(e))&&(i="object"===p?e[t]:e)})})),(h&&i?r?i.toString().toLocaleLowerCase():i:r?e.textContent.toLocaleLowerCase():e.textContent).replace(/^\s+|\s+$/g,""));if(d&&n&&f&&(n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,""),f=f.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===o&&n===f||"StartsWith"===o&&n.substr(0,m)===f||"EndsWith"===o&&n.substr(n.length-f.length)===f||"Contains"===o&&new RegExp(f,"g").test(n))return{value:{item:c.item=e,index:c.index=t}}}(i,s);if("object"==typeof l)return l.value}return c}function R(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(t){M===t&&(v=W=M="",g=[])}function K(t,e,i,s){/<[^>]*>/g.test(t.innerText)&&(t.innerText=t.innerText.replace(/[\u00A0-\u9999<>&]/g,function(t){return"&#"+t.charCodeAt(0)+";"})),""!==e&&(i=i?"gim":"gm",e=/^[a-zA-Z0-9- ]*$/.test(e)?e:e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),function t(e,i){for(var s=0;e.childNodes&&s<e.childNodes.length;s++){if(3===e.childNodes[s].nodeType&&""!==e.childNodes[s].textContent.trim()){var l=e.childNodes[s].nodeValue.trim().replace(i,'<span class="e-highlight">$1</span>');e.childNodes[s].nodeValue="",e.innerHTML=e.innerHTML.trim()+l;break}t(e.childNodes[s],i)}}(t,new RegExp("StartsWith"===s?"^("+e+")":"EndsWith"===s?"("+e+")$":"("+e+")",i)))}function _(t){for(var e=t.querySelectorAll(".e-highlight"),i=e.length-1;0<=i;i--){var s=e[i].parentNode,l=document.createTextNode(e[i].textContent);s.replaceChild(l,e[i])}}var G=function(){return(G=Object.assign||function(t){for(var e,i=1,s=arguments.length;i<s;i++)for(var l in e=arguments[i])Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t}).apply(this,arguments)},Q=function(n,a,o,r){return new(o=o||Promise)(function(t,e){function i(t){try{l(r.next(t))}catch(t){e(t)}}function s(t){try{l(r.throw(t))}catch(t){e(t)}}function l(e){e.done?t(e.value):new o(function(t){t(e.value)}).then(i,s)}l((r=r.apply(n,a||[])).next())})},J=function(s,l){var n,a,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(i){return function(t){var e=[i,t];if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=2&e[0]?a.return:e[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,e[1])).done)return o;switch(a=0,(e=o?[2&e[0],o.value]:e)[0]){case 0:case 1:o=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++,a=e[1],e=[0];continue;case 7:e=r.ops.pop(),r.trys.pop();continue;default:if(!(o=0<(o=r.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3]))r.label=e[1];else if(6===e[0]&&r.label<o[1])r.label=o[1],o=e;else{if(!(o&&r.label<o[2])){o[2]&&r.ops.pop(),r.trys.pop();continue}r.label=o[2],r.ops.push(e)}}e=l.call(s,r)}catch(t){e=[6,t],a=0}finally{n=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}}},X=(e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},e.prototype.bindScrollEvent=function(t){var e=this;this.component=t.component,this.observe(function(t){return e.scrollListener(t)})},e.prototype.observe=function(t){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),P.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new P.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),P.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(t),this)},e.prototype.getModuleName=function(){return"VirtualScroll"},e.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},e.prototype.getPageQuery=function(t,e,i){return t=0===i||this.parent.allowFiltering||"autocomplete"===this.component?t:t.skip(e)},e.prototype.setGeneratedData=function(t,e){for(var i,s=0,l=this.parent.listData.length+this.parent.virtualItemStartIndex,n=this.parent.virtualItemStartIndex;n<l;n++)this.parent.generatedDataObject[n]||null!==e&&0<this.parent.listData.slice(s,s+1).length&&0<(i=this.parent.listData.slice(s,s+1)).length&&(this.parent.generatedDataObject[n]=i),s++},e.prototype.generateAndExecuteQueryAsync=function(t,e,i,s){void 0===e&&(e=0),void 0===i&&(i=0);var l=this.parent.dataSource,s=((s=void 0===s?!1:s)||(t=P.isNullOrUndefined(this.parent.query)?this.getPageQuery(t,e,i):(s=this.removeSkipAndTakeEvents(this.parent.query.clone()),this.getPageQuery(s,e,i))),this.parent.isCustomFilter);"combobox"===this.component&&(e=0,this.parent.dataSource instanceof c.DataManager?e=this.parent.dataSource.dataSource.json.length:this.parent.dataSource&&0<this.parent.dataSource.length&&(e=this.parent.dataSource.length),0<e)&&(this.parent.isCustomFilter=e===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter),this.parent.resetList(l,this.parent.fields,t),this.parent.isCustomFilter=s},e.prototype.removeSkipAndTakeEvents=function(t){return t.queries=t.queries.filter(function(t){return"onSkip"!==t.fn&&"onTake"!==t.fn}),t},e.prototype.setCurrentViewDataAsync=function(t){var e=[],i=!1,s=!0,l=(P.isNullOrUndefined(this.component)&&(this.component=t.component),this.parent.viewPortInfo.endIndex);if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()&&(this.parent.viewPortInfo.startIndex<this.parent.value.length?(l=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex?(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount?((a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof c.DataManager&&this.parent.appendUncheckList,s=!1):(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),s=!1):0!==this.parent.viewPortInfo.startIndex&&(this.parent.updateVirtualReOrderList(!0),(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),s=!1),0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof c.DataManager&&this.parent.appendUncheckList)):(t=this.parent.list.querySelectorAll(".e-reorder")[0],this.parent.list.querySelector(".e-virtual-ddl-content")&&t&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(t),u=this.parent.getForQuery(this.parent.value).clone(),t=0<=this.parent.viewPortInfo.startIndex-this.parent.value.length?this.parent.viewPortInfo.startIndex-this.parent.value.length:0,u=u.skip(t),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1),this.parent.totalItemsCount()),s)for(var n=this.parent.viewPortInfo.startIndex;n<l;n++){var a,o=n,r=("multiselect"===this.component&&"CheckBox"===this.parent.mode&&(a=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),this.parent.generatedDataObject[o]);if("multiselect"===this.component&&this.parent.hideSelectedItem){if(r){var h=P.getValue(this.parent.fields.value,r[0]);if(this.parent.value&&null!==h&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.value.indexOf(h)<0){var u=this.parent.getForQuery(this.parent.value).clone();u=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&e.push(r[0])}o===l-1&&e.length!==this.parent.itemCount&&this.parent.hideSelectedItem&&(u=this.parent.value&&0<this.parent.value.length?this.parent.getForQuery(this.parent.value).clone():new c.Query,u=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0)}else r&&e.push(r[0]);this.parent.setCurrentView=!1}!i&&s&&("multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&e.splice(0,0,this.parent.virtualCustomData),"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&0<this.parent.virtualCustomSelectData.length&&(e=e.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(e,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode)),"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.dataSource instanceof c.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;t=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],t?t.style=this.parent.GetVirtualTrackHeight():!t&&0<this.parent.skeletonCount&&this.parent.popupWrapper&&(s=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()}),this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)),this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item"),t=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];t&&(t.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!P.isNullOrUndefined(this.parent.currentFocuedListElement)&&(s=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value")),this.parent.addListFocus(s),this.parent.isScrollChanged=!1)},e.prototype.generateQueryAndSetQueryIndexAsync=function(t,e){var i=!1,s=0,l=0,n=this.parent.viewPortInfo.endIndex;if(!e&&0!==n)for(var a=this.parent.viewPortInfo.startIndex;a<=n;a++)a in this.parent.generatedDataObject||(i?l=a===n?a:a+1:(i=!0,s=l=a));!i||this.parent.totalItemCount===s&&this.parent.totalItemCount===l||(this.parent.virtualItemStartIndex=s,this.parent.virtualItemEndIndex=l,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(t,s,l),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),this.parent.dataSource instanceof c.DataManager&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.isRequesting)||this.setCurrentViewDataAsync()},e.prototype.dataProcessAsync=function(t){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new c.Query,t)},e.prototype.virtualScrollRefreshAsync=function(){return Q(this,void 0,void 0,function(){return J(this,function(t){switch(t.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!P.isNullOrUndefined(this.parent.filterInput)&&!P.isNullOrUndefined(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,!this.parent.allowFiltering&&"autocomplete"!==this.component||(P.isNullOrUndefined(this.parent.typedString)||"combobox"===this.component&&!P.isNullOrUndefined(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.dataSource instanceof c.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return t.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof c.DataManager&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},e.prototype.scrollListener=function(t){var e,i,s=this;this.parent.isPreventScrollAction||this.parent.isVirtualTrackHeight||(this.parent.preventSetCurrentData=!1,e=t.sentinel,i=this.parent.previousStartIndex,this.parent.viewPortInfo=this.getInfoFromView(t.direction,e,t.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===i||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=G({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){s.parent.pageCount=s.parent.getPageCount(),s.virtualScrollRefreshAsync().then(function(){s.parent.popupObj&&(s.parent.list=s.parent.popupObj.element.querySelector(".e-content")||P.select(".e-content"),s.parent.updateSelectionList(),s.parent.liCollections=s.parent.getItems()),s.parent.isKeyBoardAction=!1,s.parent.isVirtualScrolling=!1,s.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo)},e.prototype.getInfoFromView=function(t,e,i,s){var l,n,t={direction:t,sentinelInfo:e,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},e=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,a=this.parent.listItemHeight,i=i.top/a,e=e/a,o=i+e,r=this.parent.virtualItemCount/4,h=this.parent.totalItemCount;return"down"===t.direction?(n=Math.round(o)-Math.round(r),(P.isNullOrUndefined(t.startIndex)||o>t.startIndex+Math.round(this.parent.virtualItemCount/2+r)&&t.endIndex!==h)&&(t.startIndex=0<=n?Math.round(n):0,t.startIndex=t.startIndex>i?Math.floor(i):t.startIndex,l=t.startIndex+this.parent.virtualItemCount,t.startIndex=l<o?Math.ceil(o)-this.parent.virtualItemCount:t.startIndex,t.endIndex=l<h?l:h,t.startIndex=h<=l?0<t.endIndex-this.parent.virtualItemCount?t.endIndex-this.parent.virtualItemCount:0:t.startIndex,t.currentPageNumber=Math.ceil(t.endIndex/this.parent.virtualItemCount))):"up"===t.direction&&(t.startIndex&&t.endIndex||Math.ceil(i)>this.parent.previousStartIndex)&&(i<Math.round((t.startIndex*a+r*a)/a)||Math.ceil(i)>this.parent.previousStartIndex)&&(l=Math.round(i+(e<r?r:e+e/4)),t.endIndex=l<h?l:h,n=t.endIndex-this.parent.virtualItemCount,t.startIndex=0<n?n:0,t.endIndex=n<0?this.parent.virtualItemCount:t.endIndex,t.currentPageNumber=Math.ceil(t.startIndex/this.parent.virtualItemCount)),s?this.parent.scrollPreStartIndex=t.startIndex:(this.parent.previousStartIndex=t.startIndex,this.parent.startIndex=t.startIndex,this.parent.previousEndIndex=t.endIndex),t},e.prototype.virtualScrollHandler=function(t){var a=this,e="chrome"===P.Browser.info.name?200:100,o=0,r=P.debounce(t,e),h=P.debounce(t,50);return function(t){var e=t.target.scrollTop,t=t.target.scrollLeft,i=o<e&&!a.parent.isUpwardScrolling?"down":"up",s=(o=e,a.sentinelInfo[i]),l=a.parent.scrollPreStartIndex,n={top:e,left:t},n=(a.parent.list&&0<a.parent.list.querySelectorAll(".e-virtual-list").length&&(a.getInfoFromView(i,s,n,!0),a.parent.scrollPreStartIndex===l||a.parent.isPreventScrollAction||(a.parent.isScrollActionTriggered=!0,a.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+e+"px)")),r);(n="X"===s.axis?h:n)({direction:i,sentinel:s,offset:{top:e,left:t},focusElement:document.activeElement})}},e.prototype.destroy=function(){this.removeEventListener()},e);function e(t){var s=this;this.sentinelInfo={up:{check:function(t,e){t=t.top-s.containerElementRect.top;return e.entered=0<=t,0<=t+s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"},down:{check:function(t,e){var i=t.bottom;return e.entered=t.bottom<=s.containerElementRect.bottom,i-s.parent.listItemHeight*s.parent.virtualItemCount/2<=s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"}},this.parent=t,this.removeEventListener(),this.addEventListener()}Y=function(t,e){return(Y=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Y,$,Z=function(t,e){function i(){this.constructor=t}Y(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},tt=($=P.ChildProperty,Z(et,$),i([P.Property()],et.prototype,"text",void 0),i([P.Property()],et.prototype,"value",void 0),i([P.Property()],et.prototype,"iconCss",void 0),i([P.Property()],et.prototype,"groupBy",void 0),i([P.Property()],et.prototype,"htmlAttributes",void 0),i([P.Property()],et.prototype,"disabled",void 0),et);function et(){return null!==$&&$.apply(this,arguments)||this}var it,y={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},Z=(it=P.Component,Z(s,it),s.prototype.getPropObject=function(t,e,i){var s=new Object,l=new Object,e=(s[t]=e[t],l[t]=i[t],new Object);return e.newProperty=s,e.oldProperty=l,e},s.prototype.getValueByText=function(t,e,i){var s=null;return s=P.isNullOrUndefined(this.listData)?s:e?this.checkValueCase(t,!0,i):this.checkValueCase(t,!1,i)},s.prototype.checkValueCase=function(i,t,e,s){var l=this,n=s?i:null;if(!P.isNullOrUndefined(this.listData)){var a,o=this.listData,r=this.fields,h=this.typeOfData(o).typeof;if("string"===h||"number"===h||"boolean"===h)for(var u=0,p=o;u<p.length;u++){var d=p[u];P.isNullOrUndefined(d)||(e?n=this.checkingAccent(String(d),i,t):t?this.checkIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,t)):this.checkNonIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,t,s)))}else t?o.filter(function(t){var e=P.getValue(r.value,t);!P.isNullOrUndefined(e)&&l.checkIgnoreCase(P.getValue(r.text,t).toString(),i)&&(n=P.getValue(r.value,t))}):s?(a=null,a=n,o.filter(function(t){var e=P.getValue(r.value,t);P.isNullOrUndefined(e)||P.isNullOrUndefined(n)||e.toString()!==a.toString()||(n=P.getValue(r.text,t))})):o.filter(function(t){l.checkNonIgnoreCase(P.getValue(r.text,t),i)&&(n=P.getValue(r.value,t))})}return n},s.prototype.checkingAccent=function(t,e,i){var s=c.DataUtil.ignoreDiacritics(String(t)),l=c.DataUtil.ignoreDiacritics(e.toString()),n=null;return i?this.checkIgnoreCase(s,l)&&(n=this.getItemValue(String(t),e,i)):this.checkNonIgnoreCase(String(t),e)&&(n=this.getItemValue(String(t),e,i)),n},s.prototype.checkIgnoreCase=function(t,e){return String(t).toLowerCase()===e.toString().toLowerCase()},s.prototype.checkNonIgnoreCase=function(t,e){return String(t)===e.toString()},s.prototype.getItemValue=function(t,e,i,s){var l=this.listData,l=this.typeOfData(l).typeof;return s?t.toString():i?"string"===l?String(t):this.getFormattedValue(String(t)):"string"===l?e:this.getFormattedValue(e)},s.prototype.templateCompiler=function(t){var e=!1;if("function"!=typeof t&&t)try{e=!!P.selectAll(t,document).length}catch(t){e=!1}return e},s.prototype.l10nUpdate=function(t){var e="listbox"===this.getModuleName()?this.ulElement:this.list;if(!P.isNullOrUndefined(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=t?this.actionFailureTemplate:this.noRecordsTemplate,s=void 0,l=t?this.actionFailureTemplateId:this.noRecordsTemplateId,n=(e.innerHTML="",this.templateCompiler(i)),s="function"!=typeof i&&n?P.compile(P.select(i,document).innerHTML.trim()):P.compile(i),a=t?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof i?s({},this,a,l,this.isStringTemplate,null):s({},this,a,l,this.isStringTemplate,null,e))&&0<o.length)for(var r=0;r<o.length;r++)"listbox"===this.getModuleName()&&"noRecordsTemplate"==a?"#text"===o[r].nodeName?((h=this.createElement("li")).textContent=o[r].textContent,h.classList.add("e-list-nrt"),h.setAttribute("role","option"),e.appendChild(h)):(o[r].classList.add("e-list-nr-template"),e.appendChild(o[r])):(o[r]instanceof HTMLElement||o[r]instanceof Text&&""!==o[r].textContent)&&e.appendChild(o[r]);this.renderReactTemplates()}else{var h,n=new P.L10n(this.getLocaleName(),{},this.locale),i=(""!==n.getConstant("actionFailureTemplate")||""!==n.getConstant("noRecordsTemplate")?this.l10n=n:this.l10n=new P.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale),t?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate"));"listbox"===this.getModuleName()?((h=this.createElement("li")).textContent=i,e.appendChild(h),h.classList.add("e-list-nrt"),h.setAttribute("role","option")):P.isNullOrUndefined(e)||(e.innerHTML=i)}},s.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},s.prototype.updateIncrementalInfo=function(t,e){this.viewPortInfo.startIndex=t,this.viewPortInfo.endIndex=e,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},s.prototype.updateIncrementalView=function(t,e){this.viewPortInfo.startIndex=t,this.viewPortInfo.endIndex=e,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")},s.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},s.prototype.getFilteringSkeletonCount=function(){var t=this.skeletonCount,e=(this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,!0);"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof c.DataManager&&!(this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,e=!1),this.list.classList.contains(y.noData)||(t!==this.skeletonCount&&e?this.UpdateSkeleton(!0,Math.abs(t-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),0<this.list.getElementsByClassName("e-virtual-ddl").length?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&this.list.querySelector(".e-dropdownbase")&&(e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.querySelector(".e-dropdownbase").appendChild(e)),0<this.list.getElementsByClassName("e-virtual-ddl-content").length&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},s.prototype.getSkeletonCount=function(t){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var e=0<this.virtualListHeight&&0<this.listItemHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*e<this.itemCount?this.itemCount:4*e,this.itemCount=t?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},s.prototype.GetVirtualTrackHeight=function(){var t=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,t="height: "+((this.isVirtualTrackHeight?0:t)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?t:"height: 0px;"},s.prototype.getTransformValues=function(){var t=this.viewPortInfo.startIndex*this.listItemHeight;return t-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(t=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:t)+"px);"},s.prototype.UpdateSkeleton=function(t,e){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||t)&&this.isVirtualizationEnabled)for(var l=t?e:this.skeletonCount,n=0;n<l;n++){var a=this.createElement("li",{className:y.virtualList,styles:"overflow: inherit"}),o=(this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),new V.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"}));o.appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}},s.prototype.getLocaleName=function(){return"drop-down-base"},s.prototype.getTextByValue=function(t){return this.checkValueCase(t,!1,!1,!0)},s.prototype.getFormattedValue=function(t){if(this.listData&&this.listData.length){var e=void 0,e=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&0<this.properties.value.length?this.typeOfData(this.properties.value):this.typeOfData(this.listData);if("number"==typeof P.getValue(this.fields.value||"value",e.item)||"number"===e.typeof)return parseFloat(t);if("boolean"==typeof P.getValue(this.fields.value||"value",e.item)||"boolean"===e.typeof)return"true"===t||""+t=="true"}return t},s.prototype.setEnableRtl=function(){P.isNullOrUndefined(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?P.addClass(this.enableRtlElements,y.rtl):P.removeClass(this.enableRtlElements,y.rtl))},s.prototype.initialize=function(t){var e;this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName?(e=U.ListBase.createJsonFromElement(this.element),this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(e,this.fields)):"SELECT"===this.element.tagName?(this.dataSource instanceof Array?0<this.dataSource.length:!P.isNullOrUndefined(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,t)},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.updateDataAttribute=function(t){for(var e=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},s=0;s<this.element.attributes.length;s++)-1!==e.indexOf(this.element.attributes[s].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[s].name||(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));P.extend(i,t,i),this.setProperties({htmlAttributes:i},!0)},s.prototype.renderItemsBySelect=function(){var t=this.element,e=t.querySelectorAll("select>optgroup"),i="multiselect"===this.getModuleName()&&this.isGroupChecking&&0<e.length,s=i?{value:"value",text:"text",groupBy:"categeory"}:{value:"value",text:"text"},l=[],n=t.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,s),e.length){for(var a=0;a<e.length;a++){var o=e[a],r={},h=(r[s.text]=o.label,r.isHeader=!0,o.querySelectorAll("option"));i?this.getJSONfromOption(l,h,s,o.label):(l.push(r),this.getJSONfromOption(l,h,s))}t.querySelectorAll("select>option")}this.updateFields(s.text,s.value,(i?s:this.fields).groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,s)},s.prototype.updateFields=function(t,e,i,s,l,n){t={fields:{text:t,value:e,groupBy:P.isNullOrUndefined(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:P.isNullOrUndefined(s)?this.fields&&this.fields.htmlAttributes:s,iconCss:P.isNullOrUndefined(l)?this.fields&&this.fields.iconCss:l,disabled:P.isNullOrUndefined(n)?this.fields&&this.fields.disabled:n}};this.setProperties(t,!0)},s.prototype.getJSONfromOption=function(t,e,i,s){void 0===s&&(s=null);for(var l=0,n=e;l<n.length;l++){var a=n[l],o={};o[i.text]=a.innerText,o[i.value]=P.isNullOrUndefined(a.getAttribute(i.value))?a.innerText:a.getAttribute(i.value),P.isNullOrUndefined(s)||(o[i.groupBy]=s),t.push(o)}},s.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},s.prototype.setListData=function(r,h,t,u){var p,d=this,t=(h=h||this.fields,{cancel:!(this.isActive=!0),data:r,query:t});this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",t,function(l){if(!l.cancel)if(d.isRequesting=!0,d.showSpinner(),r instanceof c.DataManager){var n=!(d.isRequested=!0);d.isDataFetched?d.emptyDataRequest(h):l.data.executeQuery(d.getQuery(l.query)).then(function(t){d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange;var e=!0;if(!d.virtualSelectAll){for(var i=d.getQuery(l.query),s=0;s<i.queries.length;s++)"onWhere"===i.queries[s].fn&&(n=!0);if(d.isVirtualizationEnabled&&0!==t.count&&t.count<2*d.itemCount){if(i)for(s=0;s<i.queries.length;s++)"onTake"===i.queries[s].fn&&(i.queries[s].e.nos=t.count),"multiselect"!==d.getModuleName()||"or"!==i.queries[s].e.condition&&"equal"!==i.queries[s].e.operator||d.isCustomFiltering||(e=!1)}else if(d.isVirtualTrackHeight=!1,i)for(s=0;s<i.queries.length;s++)"multiselect"===d.getModuleName()&&(i.queries[s].e&&"or"===i.queries[s].e.condition||i.queries[s].e&&"equal"===i.queries[s].e.operator)&&(e=!1)}e&&(d.dataCount=d.totalItemCount=t.count),d.trigger("actionComplete",t,function(t){var e;t.cancel||(d.isRequesting=!1,d.isCustomFiltering=!1,e=t.result,d.isIncrementalRequest?p=d.renderItems(e,h):((!d.isVirtualizationEnabled&&0===e.length||d.isVirtualizationEnabled&&0===e.length&&!n)&&(d.isDataFetched=!0),n||(d.remoteDataCount=t.count),d.dataCount=d.virtualSelectAll?d.dataCount:t.count,d.totalItemCount=d.virtualSelectAll?d.totalItemCount:t.count,p=d.renderItems(e,h),d.appendUncheckList=!1,d.onActionComplete(p,e,t),d.groupTemplate&&d.renderGroupTemplate(p),d.isRequested=!1,d.bindChildItems(e,p,h,t),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):(d.isVirtualizationEnabled&&d.setCurrentView&&d.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=d.keyboardEvent&&d.handleVirtualKeyboardActions(d.keyboardEvent,d.pageCount),d.isVirtualizationEnabled&&(d.getFilteringSkeletonCount(),d.updatePopupPosition()),d.virtualSelectAll&&d.virtualSelectAllData&&(d.virtualSelectionAll(d.virtualSelectAllState,d.liCollections,d.CurrentEvent),d.virtualSelectAllState=!1,d.CurrentEvent=null,d.virtualSelectAll=!1))))})}).catch(function(t){d.isRequested=!1,d.isRequesting=!1,d.onActionFailure(t),d.hideSpinner()})}else{var t=!(d.isRequesting=!1),e=void 0,i=(d.isVirtualizationEnabled&&!d.virtualGroupDataSource&&d.fields.groupBy&&(o=new c.DataManager(d.dataSource).executeLocal((new c.Query).group(d.fields.groupBy)),d.virtualGroupDataSource=o.records),d.isVirtualizationEnabled&&d.virtualGroupDataSource&&!d.isCustomDataUpdated?new c.DataManager(d.virtualGroupDataSource):new c.DataManager(l.data)),e=d.getQuery(l.query).executeLocal(i);if(!d.virtualSelectAll){var s=d.getQuery(l.query);if(d.isVirtualizationEnabled&&0!==e.count&&e.count<2*d.itemCount){if(s){for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&(s.queries[a].e.nos=e.count,e=s.executeLocal(i)),"multiselect"!==d.getModuleName()||"or"!==s.queries[a].e.condition&&"equal"!==s.queries[a].e.operator||d.isCustomFiltering||(t=!1);t&&(e=s.executeLocal(i),d.isVirtualTrackHeight=!(d.dataSource instanceof c.DataManager||d.isCustomDataUpdated))}}else if(d.isVirtualTrackHeight=!1,s)for(a=0;a<s.queries.length;a++)"multiselect"===d.getModuleName()&&(s.queries[a].e&&"or"===s.queries[a].e.condition||s.queries[a].e&&"equal"===s.queries[a].e.operator)&&(t=!1)}!t||d.dataSource instanceof c.DataManager||d.isCustomDataUpdated||d.virtualSelectAll||(d.dataCount=d.totalItemCount=d.virtualSelectAll?e.length:e.count);var o={cancel:!1,result:e=d.isVirtualizationEnabled?e.result:e};d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange,d.trigger("actionComplete",o,function(t){d.isCustomFiltering=!1,d.isIncrementalRequest?p=d.renderItems(t.result,h):t.cancel||(p=d.renderItems(t.result,h),d.onActionComplete(p,t.result,u),d.groupTemplate&&d.renderGroupTemplate(p),d.bindChildItems(t.result,p,h),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):setTimeout(function(){"multiselect"===d.getModuleName()&&null!=d.itemTemplate&&0<p.childElementCount&&(0<p.children[0].childElementCount||d.fields.groupBy&&p.children[1]&&0<p.children[1].childElementCount)&&d.updateDataList()}))})}})},s.prototype.handleVirtualKeyboardActions=function(t,e){},s.prototype.updatePopupState=function(){},s.prototype.updatePopupPosition=function(){},s.prototype.virtualSelectionAll=function(t,e,i){},s.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},s.prototype.bindChildItems=function(e,i,s,l){var n=this;100<=e.length&&"autocomplete"===this.getModuleName()?setTimeout(function(){var t=n.remainingItems(n.sortedData,s);P.append(t,i),n.liCollections=n.list.querySelectorAll("."+y.li),n.updateListValues(),n.raiseDataBound(e,l)},0):this.raiseDataBound(e,l)},s.prototype.isObjectInArray=function(i,t){return t.some(function(e){return Object.keys(i).every(function(t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]===i[t]})})},s.prototype.updateListValues=function(){},s.prototype.findListElement=function(t,e,i,s){var l=null;if(t)for(var n=[].slice.call(t.querySelectorAll(e)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},s.prototype.raiseDataBound=function(t,e){this.hideSpinner(),this.trigger("dataBound",{items:t,e:e})},s.prototype.remainingItems=function(t,e){var i,t=new c.DataManager(t).executeLocal((new c.Query).skip(100));return this.itemTemplate?(i=this.templateListItem(t,e),[].slice.call(i.childNodes)):"string"===(i=this.typeOfData(t).typeof)||"number"===i||"boolean"===i?U.ListBase.createListItemFromArray(this.createElement,t,!0,this.listOption(t,e),this):U.ListBase.createListItemFromJson(this.createElement,t,this.listOption(t,e),1,!0,this)},s.prototype.emptyDataRequest=function(t){var e=[];this.onActionComplete(this.renderItems(e,t),e),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},s.prototype.showSpinner=function(){},s.prototype.hideSpinner=function(){},s.prototype.onActionFailure=function(t){this.liCollections=[],this.trigger("actionFailure",t),this.l10nUpdate(!0),P.isNullOrUndefined(this.list)||P.addClass([this.list],y.noData)},s.prototype.onActionComplete=function(t,e,i){if(this.listData=e,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&t.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var s=0;s<t.childElementCount;s++)t.children[s].classList.contains("e-list-group-item")&&(P.isNullOrUndefined(t.children[s].innerHTML)||""===t.children[s].innerHTML)&&P.addClass([t.children[s]],"e-hide-group-header"),t.children[0].classList.contains("e-hide-group-header")&&P.setStyleAttribute(t.children[1],{zIndex:11});P.isNullOrUndefined(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(t),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,e,this.bindEvent))},s.prototype.postRender=function(t,e,i){if(this.fields.disabled)for(var s,l=t.querySelectorAll("."+y.li),n=0;n<l.length;n++)JSON.parse(JSON.stringify(this.listData[n]))[this.fields.disabled]&&(P.isNullOrUndefined(this.fields.groupBy)?this.disableListItem(l[n]):(s=this.listData[n],s=P.getValue(this.fields.value||"value",s),s=t.querySelector('li[data-value="'+s+'"]'),P.isNullOrUndefined(s)||this.disableListItem(s)));var a=this.fields.disabled?t.querySelector("."+y.li+":not(.e-disabled"):t.querySelector("."+y.li),o=t.querySelector("."+y.selected);a&&!o&&(a=this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex&&(o=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<o.length?o[2]:a)&&a.classList.add(y.focus),e.length<=0?(this.l10nUpdate(),P.addClass([t],y.noData)):t.classList.remove(y.noData)},s.prototype.getQuery=function(t){return t||this.query||new c.Query},s.prototype.updateVirtualizationProperties=function(t,e,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=t,this.isAllowFiltering=e,this.isCheckBoxSelection=i},s.prototype.renderGroupTemplate=function(t){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+y.group)){var e,i=this.dataSource,s={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},t=t.querySelectorAll("."+y.group),l=this.templateCompiler(this.groupTemplate);if(e="function"!=typeof this.groupTemplate&&l?(l=P.select(this.groupTemplate,document).innerHTML.trim(),U.ListBase.renderGroupTemplate(l,i,this.fields.properties,t,s,this)):U.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,t,s,this),this.isGroupChecking)for(var n=0;n<e.length;n++)this.notify("addItem",{module:"CheckBoxSelection",item:e[n]});this.renderReactTemplates()}},s.prototype.createListItems=function(t,e){var i;return t?(e.groupBy||this.element.querySelector("optgroup")?(e.groupBy&&("None"!==this.sortOrder&&(t=this.getSortedDataSource(t)),t=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?U.ListBase.groupDataSource(t,e,this.sortOrder):U.ListBase.groupDataSource(t,e.properties,this.sortOrder)),P.addClass([this.list],y.grouping)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(t=this.getSortedDataSource(t)),e=this.listOption(t,e),i=100<t.length?new c.DataManager(t).executeLocal((new c.Query).take(100)):t,this.sortedData=t,U.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?i:t,e,!0,this)):null},s.prototype.listOption=function(t,e){var i=!P.isNullOrUndefined(e.iconCss),s=P.isNullOrUndefined(e.properties)?e:e.properties,s=null!==e.text||null!==e.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return P.extend({},s,e,!0)},s.prototype.setFloatingHeader=function(t){P.isNullOrUndefined(this.list)||this.list.classList.contains(y.noData)||(P.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:y.fixedHead}),P.isNullOrUndefined(this.list)||this.list.querySelector("li").classList.contains(y.group)||(this.fixedHeaderElement.style.display="none"),P.isNullOrUndefined(this.fixedHeaderElement)||P.isNullOrUndefined(this.list)||P.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),P.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(t))},s.prototype.scrollStop=function(t,e){for(var i=P.isNullOrUndefined(t)?this.list:t.target,t=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),s=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),s=parseInt(s,10),t="multiselect"===this.getModuleName()?parseFloat(t):parseInt(t,10),t=Math.round(i.scrollTop/(t+s)),l=this.list.querySelectorAll("li:not(.e-hide-listitem)"),n=this.list.querySelectorAll(".e-virtual-list").length,a=t;-1<a;a--){var o=this.isVirtualizationEnabled?a+n:a;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(o,l,i))break;!e||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.selected)&&"autocomplete"!==this.getModuleName()||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.focus)&&this.getModuleName()}else if(this.updateGroupHeader(o,l,i))break}},s.prototype.getPageCount=function(t){var e;return this.list?(e=this.list.classList.contains(y.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),e=Math.round(this.list.getBoundingClientRect().height/parseInt(e,10)),t?e:Math.round(e)):0},s.prototype.updateGroupHeader=function(t,e,i){return!P.isNullOrUndefined(e[t])&&e[t].classList.contains(y.group)?(this.updateGroupFixedHeader(e[t],i),!0):(this.fixedHeaderElement.style.display="none",!(this.fixedHeaderElement.style.top="none"))},s.prototype.updateGroupFixedHeader=function(t,e){this.fixedHeaderElement&&(P.isNullOrUndefined(t.innerHTML)||(this.fixedHeaderElement.innerHTML=t.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},s.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},s.prototype.renderItems=function(t,e,i){if(this.itemTemplate&&t){var s,l,n=t="multiselect"===this.getModuleName()&&this.virtualSelectAll?(this.virtualSelectAllData=t).slice(this.virtualItemStartIndex,this.virtualItemEndIndex):t,a=(n&&e.groupBy?("None"!==this.sortOrder&&(n=this.getSortedDataSource(n)),n=U.ListBase.groupDataSource(n,e.properties,this.sortOrder)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(n=this.getSortedDataSource(n)),100<(this.sortedData=n).length?new c.DataManager(n).executeLocal((new c.Query).take(100)):n),a=this.templateListItem("autocomplete"===this.getModuleName()?a:n,e);if(this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+y.li),this.incrementalUlElement=a,this.incrementalListData=t,a;this.isVirtualizationEnabled&&(s=this.list.querySelector(".e-list-parent"),l=this.list.querySelector(".e-virtual-ddl-content"),t.length>=this.virtualizedItemsCount&&s&&l||s&&l&&this.isAllowFiltering||s&&l&&"autocomplete"===this.getModuleName()?("multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(l.appendChild(a),i=!0):l.replaceChild(a,s),n=this.list.querySelectorAll(".e-reorder"),this.list.querySelector(".e-virtual-ddl-content")&&n&&0<n.length&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(n[0]),this.updateListElements(t)):l||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(t)))}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(t=(this.virtualSelectAllData=t).slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),a=this.createListItems(t,e),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+y.li),this.incrementalUlElement=a,this.incrementalListData=t,a;this.isVirtualizationEnabled&&(s=this.list.querySelector(".e-list-parent:not(.e-reorder)"),l=this.list.querySelector(".e-virtual-ddl-content"),!s&&this.list.querySelector(".e-list-parent.e-reorder")&&(s=this.list.querySelector(".e-list-parent.e-reorder")),t.length>=this.virtualizedItemsCount&&s&&l||s&&l&&this.isAllowFiltering||s&&l&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(this.appendUncheckList?l.appendChild(a):l.replaceChild(a,s),this.updateListElements(t)):l&&l.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(t)))}return a},s.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},s.prototype.updateListElements=function(t){this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.listData=t,this.postRender(this.list,t,this.bindEvent)},s.prototype.templateListItem=function(t,e){var i=this.listOption(t,e),s=(i.templateID=this.itemTemplateId,i.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate));return s="function"!=typeof this.itemTemplate&&s?(s=P.select(this.itemTemplate,document).innerHTML.trim(),U.ListBase.renderContentTemplate(this.createElement,s,t,e.properties,i,this)):U.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,t,e.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s},s.prototype.typeOfData=function(t){for(var e={typeof:null,item:null},i=0;!P.isNullOrUndefined(t)&&i<t.length;i++)if(!P.isNullOrUndefined(t[i])&&!("string"==typeof t[i]||"number"==typeof t[i]||"boolean"==typeof t[i]?P.isNullOrUndefined(t[i]):P.isNullOrUndefined(P.getValue(this.fields.value||"value",t[i]))))return{typeof:typeof t[i],item:t[i]};return e},s.prototype.setFixedHeader=function(){P.isNullOrUndefined(this.list)||(this.list.parentElement.style.display="block");var t=0,t=(this.list&&this.list.parentElement&&(t=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(t))&&(t=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)),P.isNullOrUndefined(this.liCollections)||(t=this.getValidLi().offsetWidth-t,this.fixedHeaderElement.style.width=t.toString()+"px"),P.setStyleAttribute(this.fixedHeaderElement,{zIndex:10}),this.ulElement.querySelector("."+y.group+":not(.e-hide-listitem)"));this.fixedHeaderElement.innerHTML=t.innerHTML},s.prototype.getSortedDataSource=function(t){var e;return t&&"None"!==this.sortOrder&&(e=this.fields.text||"text","string"!==this.typeOfData(t).typeof&&"number"!==this.typeOfData(t).typeof&&"boolean"!==this.typeOfData(t).typeof||(e=""),t=U.ListBase.getDataSource(t,U.ListBase.addSorting(this.sortOrder,e))),t},s.prototype.getIndexByValue=function(t){for(var e,i=[],i=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems(),s=0;s<i.length;s++)if(!P.isNullOrUndefined(t)&&i[s].getAttribute("data-value")===t.toString()){e=s;break}return e},s.prototype.getIndexByValueFilter=function(t,e){var i;if(!e)return null;var s=e.querySelectorAll("li:not(.e-list-group-item)");if(s)for(var l=0;l<s.length;l++)if(!P.isNullOrUndefined(t)&&s[l].getAttribute("data-value")===t.toString()){i=l;break}return i},s.prototype.dispatchEvent=function(t,e){var i=document.createEvent("HTMLEvents");i.initEvent(e,!1,!0),t&&t.dispatchEvent(i)},s.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},s.prototype.resetList=function(t,e,i,s){this.list&&(("SELECT"===this.element.tagName&&0<this.element.options.length||"UL"===this.element.tagName&&0<this.element.childNodes.length)&&!(t instanceof Array?0<t.length:!P.isNullOrUndefined(t))&&this.selectData&&0<this.selectData.length&&(t=this.selectData),t="combobox"===this.getModuleName()&&this.selectData&&t instanceof Array&&t.length<this.selectData.length&&this.addedNewItem?this.selectData:t,this.addedNewItem=!1,this.setListData(t,e,i,s))},s.prototype.updateSelectElementData=function(t){(t||this.isVirtualizationEnabled)&&P.isNullOrUndefined(this.selectData)&&this.listData&&0<this.listData.length&&(this.selectData=this.listData)},s.prototype.updateSelection=function(){},s.prototype.renderList=function(){this.render()},s.prototype.updateDataSource=function(t,e){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof c.DataManager?this.dataSource.dataSource.json.length:0},s.prototype.setUpdateInitial=function(t,e,i){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var s={},l=0;t.length>l;l++)e[t[l]]&&"fields"===t[l]?(this.setFields(),s[t[l]]=e[t[l]]):e[t[l]]&&(s[t[l]]=e[t[l]]);0<Object.keys(s).length&&(-1===Object.keys(s).indexOf("dataSource")&&(s.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||P.isNullOrUndefined(e.dataSource)&&P.isNullOrUndefined(e.sortOrder))||this.updateDataSource(s,i):(this.isDynamicData=!0,this.updateDataSource(s,i)))},s.prototype.onPropertyChanged=function(t,e){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],t),this.setUpdateInitial(["sortOrder","itemTemplate"],t);for(var i,s=0,l=Object.keys(t);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement&&(i=this.ulElement.querySelector("."+y.group),this.fixedHeaderElement.innerHTML=i.innerHTML);break;case"locale":this.list&&!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:t.zIndex},!0),this.setZIndex()}},s.prototype.render=function(t,e){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:y.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:y.content}),this.list.classList.add(y.root),this.setFields();this.rippleFun=P.rippleEffect(this.list,{duration:300,selector:"."+y.li});var i=this.element.querySelector("select>optgroup");!this.fields.groupBy&&P.isNullOrUndefined(i)||this.isGroupChecking||(P.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),P.EventHandler.add(document,"scroll",this.updateGroupFixedHeader,this)),"dropdownbase"===this.getModuleName()&&(this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),P.removeClass([this.element],y.root),this.element.style.display="none",i=this.createElement("div"),this.element.parentElement.insertBefore(i,this.element),i.appendChild(this.element),i.appendChild(this.list)),this.setEnableRtl(),e||this.initialize(t)},s.prototype.removeScrollEvent=function(){this.list&&P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},s.prototype.getModuleName=function(){return"dropdownbase"},s.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+y.li)},s.prototype.addItem=function(t,e){this.list&&(this.list.textContent!==this.noRecordsTemplate||"listbox"===this.getModuleName())||this.renderList(),"None"!==this.sortOrder&&P.isNullOrUndefined(e)&&((s=[].slice.call(this.listData)).push(t),s=this.getSortedDataSource(s),e=(this.fields.groupBy?s=U.ListBase.groupDataSource(s,this.fields.properties,this.sortOrder):s).indexOf(t));for(var i,s=this.getItems().length,l=0===s,n=this.list.querySelector("."+y.selected),a=(t=t instanceof Array?t:[t],i=P.isNullOrUndefined(e)||e<0||s-1<e?s:e,this.fields),o=(t&&a.groupBy&&(t=U.ListBase.groupDataSource(t,a.properties)),[]),r=0;r<t.length;r++){var h,u=t[r],p=u.isHeader,d=this.createElement("li",{className:p?y.group:y.li,id:"option-add-"+r}),c=u instanceof Object?P.getValue(a.text,u):u;p&&(d.innerText=c),this.itemTemplate&&!p?(h=this.templateCompiler(this.itemTemplate),(h=("function"!=typeof this.itemTemplate&&h?P.compile(P.select(this.itemTemplate,document).innerHTML.trim()):P.compile(this.itemTemplate))(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d))&&P.append(h,d)):p||d.appendChild(document.createTextNode(c)),d.setAttribute("data-value",u instanceof Object?P.getValue(a.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),o.push(d),"listbox"===this.getModuleName()?(this.listData.splice(l?this.listData.length:i,0,u),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(u),"None"===this.sortOrder&&P.isNullOrUndefined(e)&&0===i&&(i=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(d,u,l?null:i+r):this.updateActionCompleteData(d,u,i),this.trigger("beforeItemRender",{element:d,item:u})}if(0===s&&P.isNullOrUndefined(this.list.querySelector("ul")))P.isNullOrUndefined(this.list)||(this.list.innerHTML="",this.list.classList.remove(y.noData),this.isAddNewItemTemplate=!0,P.isNullOrUndefined(this.ulElement))||this.list.appendChild(this.ulElement),this.liCollections=o,P.isNullOrUndefined(o)||P.isNullOrUndefined(this.ulElement)||P.append(o,this.ulElement),this.updateAddItemList(this.list,s);else{"listbox"===this.getModuleName()&&0===s&&(this.ulElement.innerHTML="");for(var m=[],r=0;r<t.length;r++){for(var f=this.ulElement.querySelectorAll(".e-list-group-item"),v=0;v<f.length;v++)m[v]=f[v].innerText;if(-1<m.indexOf(o[r].innerText)&&a.groupBy){for(v=0;v<f.length;v++)if(m[v]===o[r].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(o[r+1],f[v+1]):this.ulElement.insertBefore(o[r+1],this.ulElement.childNodes[e]),r+=1;break}}else this.liCollections[i]&&this.liCollections[i].parentNode?this.liCollections[i].parentNode.insertBefore(o[r],this.liCollections[i]):e&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(o[r],this.ulElement.childNodes[e+r]):this.ulElement.appendChild(o[r]);var g=[].slice.call(this.liCollections);g.splice(i,0,o[r]),this.liCollections=g,i+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),!n&&0!==e||this.updateSelection(),this.addedNewItem=!0},s.prototype.isDisabledElement=function(t){return!(!t||!t.classList.contains("e-disabled"))},s.prototype.isDisabledItemByIndex=function(t){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[t])},s.prototype.disableListItem=function(t){t.classList.add("e-disabled"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-selected","false")},s.prototype.validationAttribute=function(t,e){for(var i,s=t.getAttribute("name")?t.getAttribute("name"):t.getAttribute("id"),l=(e.setAttribute("name",s),t.removeAttribute("name"),["required","aria-required","form"]),n=0;n<l.length;n++)t.getAttribute(l[n])&&(i=t.getAttribute(l[n]),e.setAttribute(l[n],i),t.removeAttribute(l[n]))},s.prototype.setZIndex=function(){},s.prototype.updateActionCompleteData=function(t,e,i){},s.prototype.updateAddItemList=function(t,e){},s.prototype.updateDataList=function(){},s.prototype.getDataByValue=function(t){if(!P.isNullOrUndefined(this.listData)){var e=this.typeOfData(this.listData).typeof;if("string"===e||"number"===e||"boolean"===e)for(var i=0,s=this.listData;i<s.length;i++){var l=s[i];if(!P.isNullOrUndefined(l)&&l===t)return l}else for(var n=0,a=this.listData;n<a.length;n++){l=a[n];if(!P.isNullOrUndefined(l)&&P.getValue(this.fields.value||"value",l)===t)return l}}return null},s.prototype.destroy=function(){document&&(P.EventHandler.remove(document,"scroll",this.updateGroupFixedHeader),document.body.contains(this.list))&&(P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),P.isNullOrUndefined(this.rippleFun)||this.rippleFun(),P.detach(this.list)),this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.rippleFun=null,it.prototype.destroy.call(this)},i([P.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},tt)],s.prototype,"fields",void 0),i([P.Property(null)],s.prototype,"itemTemplate",void 0),i([P.Property(null)],s.prototype,"groupTemplate",void 0),i([P.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),i([P.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),i([P.Property("None")],s.prototype,"sortOrder",void 0),i([P.Property([])],s.prototype,"dataSource",void 0),i([P.Property(null)],s.prototype,"query",void 0),i([P.Property("StartsWith")],s.prototype,"filterType",void 0),i([P.Property(!0)],s.prototype,"ignoreCase",void 0),i([P.Property(1e3)],s.prototype,"zIndex",void 0),i([P.Property(!1)],s.prototype,"ignoreAccent",void 0),i([P.Property()],s.prototype,"locale",void 0),i([P.Event()],s.prototype,"actionBegin",void 0),i([P.Event()],s.prototype,"actionComplete",void 0),i([P.Event()],s.prototype,"actionFailure",void 0),i([P.Event()],s.prototype,"select",void 0),i([P.Event()],s.prototype,"dataBound",void 0),i([P.Event()],s.prototype,"created",void 0),i([P.Event()],s.prototype,"destroyed",void 0),i([P.NotifyPropertyChanges],s));function s(t,e){t=it.call(this,t,e)||this;return t.preventChange=!1,t.isPreventChange=!1,t.isDynamicDataChange=!1,t.addedNewItem=!1,t.isAddNewItemTemplate=!1,t.isRequesting=!1,t.isVirtualizationEnabled=!1,t.isCustomDataUpdated=!1,t.isAllowFiltering=!1,t.virtualizedItemsCount=0,t.isCheckBoxSelection=!1,t.totalItemCount=0,t.dataCount=0,t.remoteDataCount=-1,t.isRemoteDataUpdated=!1,t.isIncrementalRequest=!1,t.itemCount=30,t.virtualListHeight=0,t.isVirtualScrolling=!1,t.isPreventScrollAction=!1,t.scrollPreStartIndex=0,t.isScrollActionTriggered=!1,t.previousStartIndex=0,t.isMouseScrollAction=!1,t.isKeyBoardAction=!1,t.isScrollChanged=!1,t.isUpwardScrolling=!1,t.startIndex=0,t.currentPageNumber=0,t.pageCount=0,t.isPreventKeyAction=!1,t.generatedDataObject={},t.skeletonCount=32,t.isVirtualTrackHeight=!1,t.virtualSelectAll=!1,t.incrementalQueryString="",t.incrementalEndIndex=0,t.incrementalStartIndex=0,t.incrementalPreQueryString="",t.isObjectCustomValue=!1,t.appendUncheckList=!1,t.getInitialData=!1,t.preventPopupOpen=!0,t.virtualSelectAllState=!1,t.CurrentEvent=null,t.isDynamicData=!1,t.isPrimitiveData=!1,t.isCustomFiltering=!1,t.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},t.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},t.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},t}st=function(t,e){return(st=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var st,m,i=function(t,e){function i(){this.constructor=t}st(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},l=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},f={root:"e-dropdownlist",hover:y.hover,selected:y.selected,rtl:y.rtl,li:y.li,disable:y.disabled,base:y.root,focus:y.focus,content:y.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},lt={container:null,buttons:[]},i=(i(n,m=Z),n.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),m.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},n.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},n.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},n.prototype.requiredModules=function(){var t=[];return this.enableVirtualization&&t.push({args:[this],member:"VirtualScroll"}),t},n.prototype.renderList=function(t,e){m.prototype.render.call(this,t,e),this.dataSource instanceof c.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},n.prototype.floatLabelChange=function(){var t;"dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType&&(t=this.inputWrapper.container.querySelector(".e-float-text"),""!==this.inputElement.value||this.isInteracted?P.classList(t,["e-label-top"],["e-label-bottom"]):P.classList(t,["e-label-bottom"],["e-label-top"]))},n.prototype.resetHandler=function(t){t.preventDefault(),this.clearAll(t),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},n.prototype.resetFocusElement=function(){var t;this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!P.isNullOrUndefined(this.ulElement)&&(t=this.fields.disabled?this.ulElement.querySelector("."+f.li+":not(.e-disabled)"):this.ulElement.querySelector("."+f.li),t=this.enableVirtualization?this.liCollections[this.skeletonCount]:t)&&t.classList.add(f.focus)},n.prototype.clearAll=function(t,e){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,!P.isNullOrUndefined(e)&&(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof c.DataManager||0!==e.dataSource.length))||(this.isActive=!0,this.resetSelection(e));e=this.getItemData();!this.allowObjectBinding&&this.previousValue===e.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value||e:e.value?this.getDataByValue(e.value):e])?(this.checkAndResetCache(),this.enableVirtualization&&this.list&&this.updateInitialData()):(this.onChangeEvent(t),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData())},n.prototype.resetSelection=function(t){this.list&&(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t.dataSource)&&(t.dataSource instanceof c.DataManager||0!==t.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!P.isNullOrUndefined(this.actionCompleteData.ulElement)&&!P.isNullOrUndefined(this.actionCompleteData.list)&&0<this.actionCompleteData.list.length&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(t.dataSource))),P.isNullOrUndefined(this.hiddenElement)||(this.hiddenElement.innerHTML=""),P.isNullOrUndefined(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(P.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},n.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i,s=e[t];"class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&P.addClass([this.inputWrapper.container],i.split(" ")):"disabled"===s&&"disabled"===this.htmlAttributes[""+s]?(this.enabled=!1,this.setEnable()):"readonly"!==s||P.isNullOrUndefined(this.htmlAttributes[""+s])?"style"===s?this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+s]):"aria-label"===s?"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+s]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+s]):(i=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||i.push("tabindex"),-1<["name","required"].indexOf(s)||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):-1<i.indexOf(s)?"placeholder"===s?h.Input.setPlaceholder(this.htmlAttributes[""+s],this.inputElement):this.inputElement.setAttribute(s,this.htmlAttributes[""+s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])):(this.readonly=!0,this.dataBind())}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},n.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},n.prototype.setEnableRtl=function(){P.isNullOrUndefined(this.inputElement)||P.isNullOrUndefined(this.inputElement.parentElement)||h.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},n.prototype.setEnable=function(){h.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(P.removeClass([this.inputWrapper.container],f.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),P.addClass([this.inputWrapper.container],f.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},n.prototype.getPersistData=function(){return this.addOnPersist(["value"])},n.prototype.getLocaleName=function(){return"drop-down-list"},n.prototype.preventTabIndex=function(t){"dropdownlist"===this.getModuleName()&&(t.tabIndex=-1)},n.prototype.targetElement=function(){return P.isNullOrUndefined(this.inputWrapper)?null:this.inputWrapper.container},n.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},n.prototype.getElementByText=function(t){return this.getElementByValue(this.getValueByText(t))},n.prototype.getElementByValue=function(t){for(var e,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===t){e=l;break}}return e},n.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof c.DataManager?this.initialRemoteRender=!0:this.updateValues()},n.prototype.isDisableItemValue=function(t){var e;return"object"==typeof t?(e=JSON.parse(JSON.stringify(t))[this.fields.value],this.isDisabledItemByIndex(this.getIndexByValue(e))):this.isDisabledItemByIndex(this.getIndexByValue(t))},n.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),this.selectedValueInfo=this.viewPortInfo,P.isNullOrUndefined(this.value))if(this.text&&P.isNullOrUndefined(this.value)){var t=this.getElementByText(this.text);if(P.isNullOrUndefined(t))return void this.setProperties({text:null});this.setSelection(t,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value;this.setSelection(this.getElementByValue(t),null)}this.setHiddenValue(),h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},n.prototype.onBlurHandler=function(t){var e,i,s;this.enabled&&(e=t.relatedTarget,i=t.target,s=this.isPreventBlur,this.isPreventBlur=!1,s&&!this.isDocumentClick&&this.isPopupOpen&&(!P.isNullOrUndefined(i)||!this.isFilterLayout()&&P.isNullOrUndefined(e))?("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput:this.targetElement()).focus():this.isDocumentClick||!P.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(f.mobileFilter)?this.beforePopupOpen||(this.isDocumentClick=!1):(("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&e!==this.inputElement&&(document.activeElement!==e||document.activeElement===e&&i.classList.contains(f.inputFocus))||P.isNullOrUndefined(e)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&i!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(e)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(t),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1))},n.prototype.focusOutAction=function(t){this.isInteracted=!1,this.focusOut(t),this.onFocusOut(t)},n.prototype.onFocusOut=function(t){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(t)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&P.addClass([this.inputWrapper.clearButton],f.clearIconHide),this.trigger("blur"))},n.prototype.onFocus=function(t){this.isInteracted||(this.isInteracted=!0,this.trigger("focus",{isInteracted:!!t,event:t})),this.updateIconState(),this.isFocused=!0},n.prototype.resizingWireEvent=function(){P.EventHandler.add(document,"mousemove",this.resizePopup,this),P.EventHandler.add(document,"mouseup",this.stopResizing,this),P.EventHandler.add(document,"touchmove",this.resizePopup,this),P.EventHandler.add(document,"touchend",this.stopResizing,this)},n.prototype.resizingUnWireEvent=function(){P.EventHandler.remove(document,"mousemove",this.resizePopup),P.EventHandler.remove(document,"mouseup",this.stopResizing),P.EventHandler.remove(document,"touchmove",this.resizePopup),P.EventHandler.remove(document,"touchend",this.stopResizing)},n.prototype.resetValueHandler=function(t){var e=P.closest(this.inputElement,"form");e&&t.target===e&&(t=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value"),this.text=t)},n.prototype.wireEvent=function(){P.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),P.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),P.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),P.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},n.prototype.bindCommonEvent=function(){P.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var t=P.closest(this.inputElement,"form");t&&P.EventHandler.add(t,"reset",this.resetValueHandler,this),P.Browser.isDevice?this.keyboardModule=new P.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new P.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},n.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},n.prototype.bindClearEvent=function(){this.showClearButton&&P.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},n.prototype.unBindCommonEvent=function(){!P.isNullOrUndefined(this.inputWrapper)&&this.targetElement()&&P.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var t=this.inputElement&&P.closest(this.inputElement,"form");t&&P.EventHandler.remove(t,"reset",this.resetValueHandler),P.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&P.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},n.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?P.addClass([this.inputWrapper.clearButton],f.clearIconHide):P.removeClass([this.inputWrapper.clearButton],f.clearIconHide))},n.prototype.wireListEvents=function(){P.isNullOrUndefined(this.list)||(P.EventHandler.add(this.list,"click",this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},n.prototype.onSearch=function(t){32!==t.charCode&&13!==t.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=t,this.onServerIncrementalSearch(t))},n.prototype.onServerIncrementalSearch=function(t){this.isRequested||P.isNullOrUndefined(this.list)||P.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(t)},n.prototype.startResizing=function(t){this.isResizing=!0,this.trigger("resizeStart",t);var e=(t instanceof MouseEvent?t:t.touches[0]).clientX,i=(t instanceof MouseEvent?t:t.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=e,this.originalMouseY=i),this.resizingWireEvent(),t&&t.preventDefault()},n.prototype.resizePopup=function(t){var e,i,s,l;this.isResizing&&(this.trigger("resizing",t),e=(t instanceof MouseEvent?t:t.touches[0]).clientX,i=(t instanceof MouseEvent?t:t.touches[0]).clientY,e=e-this.originalMouseX,i=i-this.originalMouseY,this.list&&this.list.parentElement&&(s=(s=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,l=(l=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+e,s),this.resizeHeight=Math.max(this.originalHeight+i,l),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),t)&&t.preventDefault()},n.prototype.stopResizing=function(t){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",t),this.resizingUnWireEvent()),t&&t.preventDefault()},n.prototype.onMouseClick=function(t){var e=t.target,e=(this.keyboardEvent=null,P.closest(e,"."+y.li));this.isValidLI(e)&&!this.isDisabledElement(e)&&(this.setSelection(e,t),P.Browser.isDevice&&this.isFilterLayout()?history.back():this.closePopup(100,t))},n.prototype.onMouseOver=function(t){t=P.closest(t.target,"."+y.li);this.setHover(t)},n.prototype.setHover=function(t){this.enabled&&this.isValidLI(t)&&!t.classList.contains(y.hover)&&(this.removeHover(),P.addClass([t],y.hover))},n.prototype.onMouseLeave=function(){this.removeHover()},n.prototype.removeHover=function(){var t;this.list&&(t=this.list.querySelectorAll("."+y.hover))&&t.length&&P.removeClass(t,y.hover)},n.prototype.isValidLI=function(t){return t&&t.hasAttribute("role")&&"option"===t.getAttribute("role")},n.prototype.updateIncrementalItemIndex=function(t,e){this.incrementalStartIndex=t,this.incrementalEndIndex=e},n.prototype.incrementalSearch=function(t){if(0<this.liCollections.length)if(this.enableVirtualization){for(var e=!1,i=!1,s=this.ulElement.getElementsByClassName("e-active")[0],l=s?s.textContent:null,n=(""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(t.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(t.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?i=!0:this.incrementalQueryString=String.fromCharCode(t.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(e=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),e=!0),0===this.viewPortInfo.startIndex&&!e||this.updateIncrementalView(0,this.itemCount),j(t.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,i,l,!0));P.isNullOrUndefined(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),e=!0,0===this.viewPortInfo.startIndex&&!e||this.updateIncrementalView(0,this.itemCount),n=j(t.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0),P.isNullOrUndefined(n));)if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100);break}P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),e=!0,0===this.viewPortInfo.startIndex&&!e||this.updateIncrementalView(0,this.itemCount),n=j(t.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0));var a,o=n&&this.getIndexByValue(n.getAttribute("data-value"));if(o)o-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!P.isNullOrUndefined(n)&&!P.isNullOrUndefined(n.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===n.getAttribute("data-value").toString()){o=r,o=this.incrementalStartIndex+o;break}!o||this.viewPortInfo.startIndex>=o&&o>=this.viewPortInfo.endIndex||(h=0<o-(this.itemCount/2-2)?o-(this.itemCount/2-2):0,a=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,a)),P.isNullOrUndefined(n)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(n.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,a=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,a)),n=this.getElementByValue(n.getAttribute("data-value")),this.setSelection(n,t),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(s=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.list.scrollTop=s-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight),this.incrementalPreQueryString=this.incrementalQueryString)}else{var h,n=void 0;n=this.fields.disabled?(h=this.list.querySelectorAll("."+y.li+":not(.e-disabled)"),j(t.charCode,h,this.activeIndex,!0,this.element.id)):j(t.charCode,this.liCollections,this.activeIndex,!0,this.element.id),P.isNullOrUndefined(n)||(this.setSelection(n,t),this.setScrollPosition())}},n.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],f.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},n.prototype.showSpinner=function(){P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=P.Browser.isDevice&&!P.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!P.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],P.addClass([this.spinnerElement],f.disableIcon),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement))},n.prototype.keyActionHandler=function(t){if(this.enabled){this.keyboardEvent=t,this.isPreventKeyAction&&this.enableVirtualization&&t.preventDefault();var e="pageUp"===t.action||"pageDown"===t.action,i="dropdownlist"!==this.getModuleName()&&("home"===t.action||"end"===t.action),s=(this.isEscapeKey="escape"===t.action,this.isTabKey=!this.isPopupOpen&&"tab"===t.action,"down"===t.action||"up"===t.action||"pageUp"===t.action||"pageDown"===t.action||"home"===t.action||"end"===t.action);if((!(this.isEditTextBox()||e||i)||this.isPopupOpen)&&!this.readonly){e="tab"===t.action||"close"===t.action;if(!P.isNullOrUndefined(this.list)||this.isRequested||e||"escape"===t.action||(this.searchKeyEvent=t,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===t.type||40!==t.keyCode&&38!==t.keyCode))||(this.renderList(t),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),!(P.isNullOrUndefined(this.list)||!P.isNullOrUndefined(this.liCollections)&&s&&0===this.liCollections.length||this.isRequested))switch((e&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===t.action)&&t.preventDefault(),this.isSelected="escape"!==t.action&&this.isSelected,this.isTyped=!s&&"escape"!==t.action&&this.isTyped,t.action){case"down":case"up":this.updateUpDownAction(t);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),t),t.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),t),t.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(t);break;case"space":"dropdownlist"!==this.getModuleName()||this.beforePopupOpen||(this.showPopup(),t.preventDefault());break;case"open":this.showPopup(t);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(t),this.focusDropDown(t);break;case"enter":this.selectCurrentItem(t);break;case"tab":this.selectCurrentValueOnTab(t);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(t),this.focusDropDown(t))}}}},n.prototype.updateUpDownAction=function(t,e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(n=this.getItemData().value,P.isNullOrUndefined(n)&&(n="null"),a=this.getIndexByValue(n),P.isNullOrUndefined(a)||(this.activeIndex=a));var i,s,l,n,a,o,r=this.list.querySelector("."+f.focus);this.isSelectFocusItem(r)&&!e?(this.setSelection(r,t),this.enableVirtualization&&(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.fields.groupBy&&(l=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-l:l-this.selectedLI.offsetHeight),this.list.scrollTop=l-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight)):P.isNullOrUndefined(this.liCollections)||(r=this.activeIndex,h="down"===t.action?this.activeIndex+1:this.activeIndex-1,h=e?r:h,r=0,i=void("autocomplete"===this.getModuleName()&&(r="down"===t.action&&P.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,h=h<0?this.liCollections.length-1:h===this.liCollections.length?0:h)),("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)&&(i=this.enableVirtualization?e?"autocomplete"===this.getModuleName()?(n=this.getFormattedValue(this.selectedLI.getAttribute("data-value")),this.getElementByValue(n)):this.getElementByValue(this.getItemData().value):(i=P.isNullOrUndefined(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[h],P.isNullOrUndefined(i)||i.classList.contains("e-virtual-list")?null:i):P.isNullOrUndefined(this.activeIndex)?this.liCollections[r]:this.liCollections[h]),P.isNullOrUndefined(i)?this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===t.action||0!==this.viewPortInfo.startIndex&&"up"===t.action)&&("down"===t.action?(this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,n="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null,(s=this.getDataByValue(n))&&(this.itemData=s)):"up"===t.action&&(this.viewPortInfo.startIndex=0<this.viewPortInfo.startIndex-this.itemCount?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,n="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null,s=this.getDataByValue(n))&&(this.itemData=s),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(t,this.pageCount)):(r=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus"),this.setSelection(i,t),r&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!e&&(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,l=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-l:l-this.selectedLI.offsetHeight,this.list.scrollTop=l-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight))),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(n=this.getItemData().value,a=this.getIndexByValueFilter(n,this.actionCompleteData.ulElement),P.isNullOrUndefined(a)||(this.activeIndex=a)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(var h=0;h<this.liCollections.length;h++)if(this.liCollections[h].classList.contains(f.focus)||this.liCollections[h].classList.contains(f.selected)){o=h;break}null!=o&&this.isDisabledElement(this.liCollections[o])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===o&&"down"===t.action&&(t.action="up"),0===o)&&"up"===t.action&&(t.action="down"),this.updateUpDownAction(t)),t.preventDefault()}},n.prototype.updateHomeEndAction=function(t,e){var i;"dropdownlist"===this.getModuleName()&&(i=0,"home"===t.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),t.preventDefault(),this.activeIndex===i?e&&this.setSelection(this.liCollections[i],t):!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled")||this.setSelection(this.liCollections[i],t))},n.prototype.selectCurrentValueOnTab=function(t){"autocomplete"===this.getModuleName()?this.selectCurrentItem(t):this.isPopupOpen&&(this.hidePopup(t),this.focusDropDown(t))},n.prototype.mobileKeyActionHandler=function(t){!this.enabled||this.isEditTextBox()&&!this.isPopupOpen||this.readonly||(void 0!==this.list||this.isRequested||(this.searchKeyEvent=t,this.renderList()),P.isNullOrUndefined(this.list))||!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested||"enter"===t.action&&this.selectCurrentItem(t)},n.prototype.handleVirtualKeyboardActions=function(t,e){switch(t.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(t,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),t,!0),t.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection(P.isNullOrUndefined(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),t,!0),t.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(t,!0)}this.keyboardEvent=null},n.prototype.selectCurrentItem=function(t){var e;this.isPopupOpen?(e=this.list.querySelector("."+f.focus),this.isDisabledElement(e)||(e&&(this.setSelection(e,t),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(t)),this.hidePopup(t),this.focusDropDown(t))):this.showPopup()},n.prototype.isSelectFocusItem=function(t){return!P.isNullOrUndefined(t)},n.prototype.pageUpSelection=function(t,e,i){var s=0<=t?this.liCollections[t+1]:this.liCollections[0];if(!this.enableVirtualization&&s&&s.classList.contains("e-disabled"))for(var l=0<=t?t+1:0;l<this.liCollections.length&&(!(s=this.liCollections[l])||s.classList.contains("e-disabled"));)if(--l<0)return;this.enableVirtualization&&null==this.activeIndex&&(s=this.liCollections.length>=t&&0<=t?this.liCollections[t+this.skeletonCount+1]:this.liCollections[0]),!P.isNullOrUndefined(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(s,e),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.PageUpDownSelection=function(t,e){this.enableVirtualization&&(P.isNullOrUndefined(t)||("autocomplete"===this.getModuleName()||t.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||t.classList.contains("e-item-focus")))||this.setSelection(t,e)},n.prototype.pageDownSelection=function(t,e,i){var s=this.getItems(),l=t<=s.length?this.liCollections[t-1]:this.liCollections[s.length-1];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(;0<=t&&t<this.liCollections.length&&(!(l=t<=s.length?this.liCollections[t-1]:this.liCollections[s.length-1])||l.classList.contains("e-disabled"));)t++;this.enableVirtualization&&0<this.skeletonCount&&(l=(t="dropdownlist"===this.getModuleName()&&this.allowFiltering?t+1:t)<s.length?this.liCollections[t]:this.liCollections[s.length-1]),this.enableVirtualization&&null==this.activeIndex&&(l=t<=s.length?this.liCollections[t+this.skeletonCount-1]:this.liCollections[s.length-1]),this.PageUpDownSelection(l,e),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.unWireEvent=function(){P.isNullOrUndefined(this.inputWrapper)||(P.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),P.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),P.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),P.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},n.prototype.unWireListEvents=function(){this.list&&(P.EventHandler.remove(this.list,"click",this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},n.prototype.checkSelector=function(t){return'[id="'+t.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},n.prototype.onDocumentClick=function(t){var e=t.target;!P.isNullOrUndefined(this.popupObj)&&P.closest(e,this.checkSelector(this.popupObj.element.id))||P.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.contains(t.target)?e===this.inputElement||this.allowFiltering&&e===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&P.Browser.isDevice&&e===this.inputWrapper.buttons[0]||(this.isPreventBlur=(P.Browser.isIE||"edge"===P.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),t.preventDefault()):(this.inputWrapper.container.classList.contains(f.inputFocus)||this.isPopupOpen)&&(this.isDocumentClick=!0,e=this.isRequested,"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(t),this.isInteracted=!1,e||(this.onFocusOut(t),this.inputWrapper.container.classList.remove(f.inputFocus)))},n.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(f.inputFocus))},n.prototype.focusDropDown=function(t){!this.initial&&this.isFilterLayout()&&this.focusIn(t)},n.prototype.dropDownClick=function(t){var e,i;3===t.which||2===t.button||(this.keyboardEvent=null,this.targetElement().classList.contains(f.disable))||this.inputWrapper.clearButton===t.target||((i=t.target)===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||t.preventDefault(),this.readonly?this.focusIn(t):(this.isPopupOpen?(this.hidePopup(t),this.isFilterLayout()&&this.focusDropDown(t)):(this.focusIn(t),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(t)),i=(e=this).element.tagName===this.getNgDirective()&&this.itemTemplate?500:100,this.isSecondClick||setTimeout(function(){e.cloneElements(),e.isSecondClick=!0,e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof c.DataManager&&!e.list.querySelector("ul"))},i)))},n.prototype.cloneElements=function(){var t;this.list&&(t=this.list.querySelector("ul"))&&(t=t.cloneNode?t.cloneNode(!0):t,this.actionCompleteData.ulElement=t)},n.prototype.updateSelectedItem=function(e,i,s,l){var t,n=this,a=(this.removeSelection(),e.classList.add(y.selected),this.removeHover(),null!==e.getAttribute("data-value")?this.getFormattedValue(e.getAttribute("data-value")):null),o=this.getDataByValue(a);this.initial||s||P.isNullOrUndefined(i)?(this.selectEventCallback(e,i,s,o,a),l&&this.setSelectOptions(e,i)):(t=this.detachChanges(o),this.isSelected=!0,this.trigger("select",{e:i,item:e,itemData:t,isInteracted:!!i,cancel:!1},function(t){t.cancel?e.classList.remove(y.selected):(n.selectEventCallback(e,i,s,o,a),l&&n.setSelectOptions(e,i))}))},n.prototype.selectEventCallback=function(t,e,i,s,l){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,this.itemData!==s&&(this.previousValue=P.isNullOrUndefined(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=t,this.itemData=s;var s=this.list.querySelector("."+y.focus);s&&P.removeClass([s],y.focus),t.setAttribute("aria-selected","true"),P.isNullOrUndefined(l)&&(l="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()?(s=this.getIndexByValueFilter(l,this.actionCompleteData.ulElement),P.isNullOrUndefined(s)?this.activeIndex=this.getIndexByValue(l):this.activeIndex=s):(this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof c.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(l))},n.prototype.activeItem=function(t){this.isValidLI(t)&&!t.classList.contains(y.selected)&&(this.removeSelection(),t.classList.add(y.selected),this.removeHover(),t.setAttribute("aria-selected","true"))},n.prototype.setValue=function(t){var e=this.getItemData(),t=(this.isTouched=!P.isNullOrUndefined(t),null===e.value?h.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):h.Input.setValue(e.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():P.isNullOrUndefined(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||(P.detach(this.valueTempElement),this.inputElement.style.display="block"),P.isNullOrUndefined(e.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(e.value,this.actionCompleteData.ulElement)),f.clearIcon),t=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+t);return this.isFiltering()&&t&&t.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===e.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value||e:e.value?this.getDataByValue(e.value):e])?!(this.isSelected=!1):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},n.prototype.setSelection=function(t,e){var i,s,l;this.isValidLI(t)&&(!t.classList.contains(y.selected)||this.isPopupOpen&&this.isSelected&&t.classList.contains(y.selected))?this.updateSelectedItem(t,e,!1,!0):(this.setSelectOptions(t,e),this.enableVirtualization&&this.value&&(t=this.isPrimitiveData?"":this.fields.value,e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.dataSource instanceof c.DataManager?(i=new c.DataManager(this.virtualGroupDataSource).executeLocal((new c.Query).where(new c.Predicate(t,"equal",e))))&&0<i.length&&(this.itemData=i[0],s=this.getItemData(),l=this.allowObjectBinding?this.getDataByValue(s.value):s.value,this.value===s.value&&this.text!==s.text||this.value!==s.value&&this.text===s.text)&&this.setProperties({text:s.text&&s.text.toString(),value:l}):(i=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(new c.Predicate(t,"equal",e))))&&0<i.length&&(this.itemData=i[0],s=this.getItemData(),l=this.allowObjectBinding?this.getDataByValue(s.value):s.value,this.value===s.value&&this.text!==s.text||this.value!==s.value&&this.text===s.text)&&this.setProperties({text:s.text&&s.text.toString(),value:l})))},n.prototype.setSelectOptions=function(t,e){this.list&&this.removeHover(),this.previousSelectedLI=P.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=t,this.setValue(e)||((!this.isPopupOpen&&!P.isNullOrUndefined(t)||this.isPopupOpen&&!P.isNullOrUndefined(e)&&("keydown"!==e.type||"keydown"===e.type&&"enter"===e.action))&&(this.isSelectCustom=!1,this.onChangeEvent(e)),!this.isPopupOpen||P.isNullOrUndefined(this.selectedLI)||null===this.itemData||e&&"click"===e.type||this.setScrollPosition(e),"mozilla"!==P.Browser.info.name&&this.targetElement()&&(P.attributes(this.targetElement(),{"aria-describedby":(""!==this.inputElement.id?this.inputElement:this.element).id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.dropdownCompiler=function(t){var e=!1;if("function"!=typeof t&&t)try{e=!!document.querySelectorAll(t).length}catch(t){e=!1}return e},n.prototype.setValueTemplate=function(){this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement)&&(P.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:f.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var t=this.dropdownCompiler(this.valueTemplate),t="function"!=typeof this.valueTemplate&&t?P.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):P.compile(this.valueTemplate),t=t(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);t&&0<t.length&&P.append(t,this.valueTempElement),this.renderReactTemplates()},n.prototype.removeSelection=function(){var t;this.list&&(t=this.list.querySelectorAll("."+y.selected)).length&&(P.removeClass(t,y.selected),t[0].removeAttribute("aria-selected"))},n.prototype.getItemData=function(){var t,e,i=this.fields,s=this.itemData;return P.isNullOrUndefined(s)||(t=P.getValue(i.value,s),e=P.getValue(i.text,s)),{value:P.isNullOrUndefined(s)||P.isUndefined(t)?s:t,text:P.isNullOrUndefined(s)||P.isUndefined(t)?s:e}},n.prototype.onChangeEvent=function(t,e){var i=this,s=this.getItemData(),l=this.isSelectCustom?null:this.activeIndex,n=(this.enableVirtualization&&(n=this.dataSource instanceof c.DataManager?this.virtualGroupDataSource:this.dataSource,s.value)&&n&&0<n.length&&-1!==(n=n.findIndex(function(t){return!P.isNullOrUndefined(s.value)&&P.getValue(i.fields.value,t)===s.value}))&&(l=n),this.allowObjectBinding?e?this.value:this.getDataByValue(s.value):s.value);this.setProperties({index:l,text:s.text&&s.text.toString(),value:n},!0),this.detachChangeEvent(t)},n.prototype.detachChanges=function(t){t="string"==typeof t||"boolean"==typeof t||"number"==typeof t?Object.defineProperties({},{value:{value:t,enumerable:!0},text:{value:t,enumerable:!0}}):t;return t},n.prototype.detachChangeEvent=function(t){var e,i;this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=P.isNullOrUndefined(this.text)?"":this.text,this.initial||(i=this.detachChanges(this.itemData),e=void 0,e="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue(),i={e:t,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:e,isInteracted:!!t,value:this.value,element:this.element,event:t},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),!P.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||P.removeClass([this.inputWrapper.container],"e-valid-input")},n.prototype.setHiddenValue=function(){var t,e,i;P.isNullOrUndefined(this.value)?this.hiddenElement.innerHTML="":(t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.hiddenElement.querySelector("option")?((i=this.hiddenElement.querySelector("option")).textContent=this.text,i.setAttribute("value",t.toString())):P.isNullOrUndefined(this.hiddenElement)||((e=document.createElement("option")).text=this.text,e.setAttribute("selected",""),this.hiddenElement.appendChild(e),(i=this.hiddenElement.querySelector("option")).setAttribute("value",t.toString())))},n.prototype.onFilterUp=function(t){if(t.ctrlKey&&86===t.keyCode||!this.isValidKey&&40!==t.keyCode&&38!==t.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=t,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,t.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(t)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),t.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&0<this.queryString.length||""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(t)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName())&&(this.preventAutoFill=!0,this.searchLists(t),"autocomplete"===this.getModuleName())&&this.hidePopup(),t.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&P.isNullOrUndefined(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(t),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},n.prototype.onFilterDown=function(t){switch(t.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,t.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&t.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},n.prototype.removeFillSelection=function(){var t;this.isInteracted&&(t=this.getSelectionPoints(),this.inputElement.setSelectionRange(t.end,t.end))},n.prototype.getQuery=function(t){var e,i,s;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput?(e=t?t.clone():this.query?this.query.clone():new c.Query,i=""===this.typedString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==s)&&"number"!==s?("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString)&&(s=this.fields.text||"",e.where(s,i,this.typedString,this.ignoreCase,this.ignoreAccent)):e.where("",i,this.typedString,this.ignoreCase,this.ignoreAccent)):e=this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery)?this.customFilterQuery.clone():t?t.clone():this.query?this.query.clone():new c.Query,this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var l=this.getTakeValue(),n=!1;if(e)for(var a=0;a<e.queries.length;a++)if("onSkip"===e.queries[a].fn){n=!0;break}var o=0,r=0;if(e&&0<e.queries.length)for(a=0;a<e.queries.length;a++)"onSkip"===e.queries[a].fn&&(r=e.queries[a].e.nos),"onTake"===e.queries[a].fn&&(o=l<=e.queries[a].e.nos?e.queries[a].e.nos:l);if(o<=0&&this.query&&0<this.query.queries.length)for(a=0;a<this.query.queries.length;a++)"onTake"===this.query.queries[a].fn&&(o=l<=this.query.queries[a].e.nos?this.query.queries[a].e.nos:l);if(e&&0<e.queries.length)for(a=0;a<e.queries.length;a++)"onSkip"===e.queries[a].fn?(r=e.queries[a].e.nos,e.queries.splice(a,1),n=!1,--a):"onTake"===e.queries[a].fn&&(o=e.queries[a].e.nos<=o?o:e.queries[a].e.nos,e.queries.splice(a,1),--a);!this.allowFiltering&&this.isPopupOpen&&n||(0<r?e.skip(r):e.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):0<o?e.take(o):e.take(l),e.requiresCount()}return e},n.prototype.getSelectionPoints=function(){var t=this.inputElement;return{start:Math.abs(t.selectionStart),end:Math.abs(t.selectionEnd)}},n.prototype.searchLists=function(t){var s,l=this;this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+f.clearIcon)&&(this.filterInput.parentElement.querySelector("."+f.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering()&&(this.checkAndResetCache(),s={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(t,e,i){s.cancel||(l.isCustomFilter=!0,l.customFilterQuery=e&&e.clone(),l.filteringAction(t,e,i))},baseEventArgs:t,cancel:!1},this.trigger("filtering",s,function(t){t.cancel||l.isCustomFilter||t.preventDefaultAction||l.filteringAction(l.dataSource,null,l.fields)}))},n.prototype.filter=function(t,e,i){this.isCustomFilter=!0,this.filteringAction(t,e,i)},n.prototype.filteringAction=function(t,e,i){var s,l;P.isNullOrUndefined(this.filterInput)||(this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData),s=this.list.classList.contains(y.noData),""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,e=""===this.filterInput.value.trim()?null:e,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(t,i,e),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(y.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),P.attributes(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&s&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),this.list.querySelector(".e-virtual-ddl")||(l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)))):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,P.isNullOrUndefined(this.actionCompleteData.ulElement)||P.isNullOrUndefined(this.actionCompleteData.list)||(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(t,i,e),s)&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),this.list.querySelector(".e-virtual-ddl")||(l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l))),this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)),this.isTyped=!0,P.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements())},n.prototype.setSearchBox=function(t){var e,i;return this.isFiltering()?(e=t.querySelector("."+f.filterParent)?t.querySelector("."+f.filterParent):this.createElement("span",{className:f.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:f.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),i=!1,P.Browser.isDevice&&this.isDeviceFullScreen&&(i=!0),this.filterInputObj=h.Input.createInput({element:this.filterInput,buttons:i?[f.backIcon,f.filterBarClearIcon]:[f.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),P.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?P.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&P.addClass([this.filterInputObj.container],"e-filled")),P.append([this.filterInputObj.container],e),P.prepend([e],t),P.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+f.clearIcon),!P.Browser.isDevice&&this.clearIconElement&&(P.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),P.Browser.isDevice?this.searchKeyModule=new P.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new P.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),P.EventHandler.add(this.filterInput,"input",this.onInput,this),P.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),P.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),P.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),P.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj):lt},n.prototype.onInput=function(t){!P.isNullOrUndefined(t)&&!P.isNullOrUndefined(t.data)&&1<t.data.length&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=t.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),P.Browser.isDevice&&"mozilla"===P.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(t))},n.prototype.pasteHandler=function(t){var e=this;setTimeout(function(){e.typedString=e.filterInput.value,"combobox"===e.getModuleName()&&e.isFiltering()&&P.isNullOrUndefined(e.list)&&e.renderList(),e.searchLists(t)})},n.prototype.onActionFailure=function(t){m.prototype.onActionFailure.call(this,t),this.beforePopupOpen&&this.renderPopup()},n.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&P.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},n.prototype.onActionComplete=function(t,e,i,s){var l,n,a,o,r,h,u,p=this;this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.isNotSearchList&&!this.enableVirtualization?this.isNotSearchList=!1:this.getInitialData?(this.updateActionCompleteDataValues(t,e),this.getInitialData=!1,this.isReactTemplateUpdate=!0,this.searchLists(this.filterArgs)):(l=this.itemCount,!this.isActive&&P.isNullOrUndefined(t)||(n=this.selectedLI?this.selectedLI.cloneNode(!0):null,m.prototype.onActionComplete.call(this,t,e,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!P.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!P.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),P.isNullOrUndefined(t)||P.attributes(t,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender?(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,!(this.value&&this.dataSource instanceof c.DataManager)||(a=P.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,o=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(a,this.value):this.value,r=this.fields.value.split("."),u=e.some(function(t){return P.isNullOrUndefined(t[a])&&1<r.length?p.checkFieldValue(t,r)===o:t[a]===o}),u=this.enableVirtualization&&this.virtualGroupDataSource?this.virtualGroupDataSource.some(function(t){return P.isNullOrUndefined(t[a])&&1<r.length?p.checkFieldValue(t,r)===o:t[a]===o}):u)?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new c.Predicate(a,"equal",o))).then(function(t){0<t.result.length&&p.addItem(t.result,e.length),p.updateValues()}),this.initial=!1):"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue(),"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped?((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||P.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof c.DataManager||!P.isNullOrUndefined(this.dataSource)&&!P.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&("EJS-COMBOBOX"===this.element.tagName||this.isReact)&&this.allowFiltering?setTimeout(function(){p.updateActionCompleteDataValues(t,e)},0):this.updateActionCompleteDataValues(t,e)),this.isDynamicData&&(u=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.itemData=this.getDataByValue(u),this.selectedLI=this.getElementByValue(u),this.isDynamicData=!1),((this.allowCustom||this.allowFiltering&&!this.isValueInList(e,this.value)&&this.dataSource instanceof c.DataManager)&&!this.enableVirtualization||(this.allowCustom||this.allowFiltering&&this.isValueInList(e,this.value))&&!this.enableVirtualization&&(h=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,!P.isNullOrUndefined(this.value))&&n&&n.getAttribute("data-value")===h.toString())&&this.addNewItem(e,n),(!P.isNullOrUndefined(this.itemData)||P.isNullOrUndefined(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(t,e)):this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()?(h=this.getItemData().value,this.activeIndex=this.getIndexByValue(h),u=this.findListElement(this.list,"li","data-value",h),this.selectedLI=u):this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount),this.beforePopupOpen&&(this.renderPopup(i),this.enableVirtualization&&!this.list.querySelector(".e-virtual-list")&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item")),this.enableVirtualization)&&l!==this.itemCount&&this.resetList(this.dataSource,this.fields)))},n.prototype.isValueInList=function(t,e){if(Array.isArray(t)){for(var i=0;i<t.length;i++)if(t[i]===e)return!0}else if("object"==typeof t&&null!==t)for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===e)return!0;return!1},n.prototype.checkFieldValue=function(t,e){var i=t;return e.forEach(function(t){i=i[t]}),i},n.prototype.updateActionCompleteDataValues=function(t,e){this.actionCompleteData={ulElement:t.cloneNode(!0),list:e,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},n.prototype.addNewItem=function(t,e){var i,s=this;P.isNullOrUndefined(this.itemData)||P.isNullOrUndefined(e)||(i=this.getItemData().value,t.some(function(t){return("string"==typeof t||"number"==typeof t||"boolean"==typeof t)&&t===i||P.getValue(s.fields.value,t)===i}))||this.addItem(this.itemData)},n.prototype.updateActionCompleteData=function(t,e,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(t,e,i)},0):this.actionCompleteDataUpdate(t,e,i))},n.prototype.actionCompleteDataUpdate=function(t,e,i){null!==i?this.actionCompleteData.ulElement.insertBefore(t.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(t.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(e)<0&&this.actionCompleteData.list.push(e)},n.prototype.focusIndexItem=function(){var t=this.getItemData().value,t=(this.activeIndex=this.enableVirtualization&&!P.isNullOrUndefined(t)||!this.enableVirtualization?this.getIndexByValue(t):this.activeIndex,this.findListElement(this.list,"li","data-value",t));this.selectedLI=t,this.activeItem(t),this.enableVirtualization&&P.isNullOrUndefined(t)||this.removeFocus()},n.prototype.updateSelection=function(){var t=this.list.querySelector("."+y.selected);t?(this.setProperties({index:this.getIndexByValue(t.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+y.li).classList.add(f.focus))},n.prototype.updateSelectionList=function(){var t;this.list&&this.list.querySelector(".e-active")||P.isNullOrUndefined(this.value)||"autocomplete"===this.getModuleName()||(t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value):this.value,!(t=this.findListElement(this.list,"li","data-value",t)))||t.classList.add("e-active")},n.prototype.removeFocus=function(){var t=this.list.querySelectorAll("."+f.focus);t&&t.length&&P.removeClass(t,f.focus)},n.prototype.renderPopup=function(h){var u=this;this.popupObj&&document.body.contains(this.popupObj.element)?this.refreshPopup():this.trigger("beforeOpen",{cancel:!1},function(t){var e;if(t.cancel)u.beforePopupOpen=!1;else{var t=u.createElement("div",{id:u.element.id+"_popup",className:"e-ddl e-popup "+(null!==u.cssClass?u.cssClass:"")}),i=(t.setAttribute("aria-label",u.element.id),t.setAttribute("role","dialog"),u.setSearchBox(t)),s=(u.listContainerHeight=u.allowFiltering&&"dropdownlist"===u.getModuleName()&&P.Browser.isDevice?P.formatUnit(Math.round(window.outerHeight).toString()+"px"):P.formatUnit(u.popupHeight),u.headerTemplate&&(u.setHeaderTemplate(t),u.isUpdateHeaderHeight=0!==u.header.offsetHeight),P.append([u.list],t),u.footerTemplate&&(u.setFooterTemplate(t),u.isUpdateFooterHeight=0!==u.footer.offsetHeight),document.body.appendChild(t),t.style.top="0px",e=t.clientHeight,u.enableVirtualization&&u.itemTemplate&&(s=t.querySelectorAll("li.e-list-item:not(.e-virtual-list)"),u.listItemHeight=0<s.length?Math.ceil(s[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(s[0]).marginBottom,10):0),u.enableVirtualization&&!u.list.classList.contains(y.noData)&&(u.getSkeletonCount(),u.skeletonCount=u.totalItemCount<2*u.itemCount&&(!(u.dataSource instanceof c.DataManager)||u.dataSource instanceof c.DataManager&&u.totalItemCount<=u.itemCount)?0:u.skeletonCount,u.list.querySelector(".e-virtual-ddl-content")?u.list.getElementsByClassName("e-virtual-ddl-content")[0].style=u.getTransformValues():u.list.appendChild(u.createElement("div",{className:"e-virtual-ddl-content",styles:u.getTransformValues()})).appendChild(u.list.querySelector(".e-list-parent")),u.UpdateSkeleton(),u.liCollections=u.list.querySelectorAll("."+y.li),u.virtualItemCount=u.itemCount,u.list.querySelector(".e-virtual-ddl")?u.list.getElementsByClassName("e-virtual-ddl")[0].style=u.GetVirtualTrackHeight():(s=u.createElement("div",{id:u.element.id+"_popup",className:"e-virtual-ddl",styles:u.GetVirtualTrackHeight()}),t.querySelector(".e-dropdownbase").appendChild(s))),t.style.visibility="hidden","auto"!==u.popupHeight?(u.searchBoxHeight=0,P.isNullOrUndefined(i.container)||"combobox"===u.getModuleName()||"autocomplete"===u.getModuleName()||(u.searchBoxHeight=i.container.parentElement.getBoundingClientRect().height,u.listContainerHeight=(parseInt(u.listContainerHeight,10)-u.searchBoxHeight).toString()+"px"),u.headerTemplate&&(u.header=u.header||t.querySelector(".e-ddl-header"),l=Math.round(u.header.getBoundingClientRect().height),u.listContainerHeight=(parseInt(u.listContainerHeight,10)-(l+u.searchBoxHeight)).toString()+"px"),u.footerTemplate&&(u.footer=u.footer||t.querySelector(".e-ddl-footer"),l=Math.round(u.footer.getBoundingClientRect().height),u.listContainerHeight=(parseInt(u.listContainerHeight,10)-(l+u.searchBoxHeight)).toString()+"px"),u.list.style.maxHeight=(parseInt(u.listContainerHeight,10)-2).toString()+"px",t.style.maxHeight=P.formatUnit(u.popupHeight)):t.style.height="auto",0),l=void 0;u.isPreventScrollAction=!0,!P.isNullOrUndefined(u.selectedLI)&&!P.isNullOrUndefined(u.activeIndex)&&0<=u.activeIndex||u.enableVirtualization?u.setScrollPosition():u.list.scrollTop=0,P.Browser.isDevice&&u.isDeviceFullScreen&&!u.allowFiltering&&("dropdownlist"===u.getModuleName()||u.isDropDownClick&&"combobox"===u.getModuleName())&&(s=u.getOffsetValue(t),r=u.isEmptyList()?u.list:u.liCollections[0],P.isNullOrUndefined(u.inputElement)||(l=-(parseInt(getComputedStyle(r).textIndent,10)-parseInt(getComputedStyle(u.inputElement).paddingLeft,10)+parseInt(getComputedStyle(u.inputElement.parentElement).borderLeftWidth,10)))),u.createPopup(t,s,l),u.popupContentElement=u.popupObj.element.querySelector(".e-content"),u.getFocusElement(),u.checkCollision(t),P.Browser.isDevice&&(parseInt(u.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==u.getModuleName()||!u.allowFiltering)&&u.popupObj.element.classList.add("e-wide-popup"),u.popupObj.element.classList.add(f.device),("dropdownlist"===u.getModuleName()||"combobox"===u.getModuleName()&&!u.allowFiltering&&u.isDropDownClick)&&(u.popupObj.collision={X:"fit",Y:"fit"}),u.isFilterLayout())&&u.isDeviceFullScreen&&(u.popupObj.element.classList.add(f.mobileFilter),u.popupObj.position={X:0,Y:0},u.popupObj.dataBind(),P.attributes(u.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),P.addClass([document.body,u.popupObj.element],f.popupFullScreen),u.setSearchBoxPosition(),u.backIconElement=i.container.querySelector(".e-back-icon"),u.clearIconElement=i.container.querySelector("."+f.clearIcon),P.EventHandler.add(u.backIconElement,"click",u.clickOnBackIcon,u),P.EventHandler.add(u.clearIconElement,"click",u.clearText,u)),t.style.visibility="visible",P.addClass([t],"e-popup-close");for(var n=0,a=u.popupObj.getScrollableParent(u.inputWrapper.container);n<a.length;n++){var o=a[n];P.EventHandler.add(o,"scroll",u.scrollHandler,u)}P.isNullOrUndefined(u.list)||(u.unWireListEvents(),u.wireListEvents()),u.selectedElementID=u.selectedLI?u.selectedLI.id:null,u.enableVirtualization&&(u.notify("bindScrollEvent",{module:"VirtualScroll",component:u.getModuleName(),enable:u.enableVirtualization}),setTimeout(function(){(u.value||u.list.querySelector(".e-active"))&&(u.updateSelectionList(),u.selectedValueInfo&&u.viewPortInfo&&u.viewPortInfo.offsets.top?u.list.scrollTop=u.viewPortInfo.offsets.top:u.scrollBottom(!0,!0))},5)),P.attributes(u.targetElement(),{"aria-expanded":"true","aria-owns":u.element.id+"_popup","aria-controls":u.element.id}),"dropdownlist"!==u.getModuleName()&&u.list.classList.contains("e-nodata")&&(P.attributes(u.targetElement(),{"aria-activedescendant":"no-record"}),u.popupContentElement.setAttribute("role","status"),u.popupContentElement.setAttribute("id","no-record")),u.inputElement.setAttribute("aria-expanded","true"),u.inputElement.setAttribute("aria-controls",u.element.id+"_popup");var r=u.isFiltering()?u.filterInput.parentElement:u.inputWrapper.container,s=(P.addClass([r],[f.inputFocus]),u.beforePopupOpen=!0,u.popupObj);u.trigger("open",{popup:s,event:h,cancel:!1,animation:{name:"FadeIn",duration:100}},function(t){t.cancel?(u.beforePopupOpen=!1,u.destroyPopup()):(P.isNullOrUndefined(u.inputWrapper)||P.addClass([u.inputWrapper.container],[f.iconAnimation]),u.renderReactTemplates(),u.isReact&&u.isFiltering()&&u.dataSource instanceof c.DataManager&&u.list.querySelector("ul")&&!u.isSecondClick&&u.executeCloneElements(),P.isNullOrUndefined(u.popupObj)||u.popupObj.show(new P.Animation(t.animation),1e3===u.zIndex?u.element:null),u.isReact&&setTimeout(function(){var t,e;!u.popupHeight||!u.list||"auto"===u.popupHeight||"dropdownlist"===u.getModuleName()&&u.allowFiltering||(t="string"==typeof u.popupHeight?parseInt(u.popupHeight,10):u.popupHeight,!u.isUpdateHeaderHeight&&u.headerTemplate&&u.header&&(e=""===u.list.style.maxHeight?t:parseInt(u.list.style.maxHeight,10),u.list.style.maxHeight=(e-u.header.offsetHeight).toString()+"px",u.isUpdateHeaderHeight=!0),!u.isUpdateFooterHeight&&u.footerTemplate&&u.footer&&(e=""===u.list.style.maxHeight?t:parseInt(u.list.style.maxHeight,10),u.list.style.maxHeight=(e-u.footer.offsetHeight).toString()+"px",u.isUpdateFooterHeight=!0))},15))}),!u.allowResize||"dropdownlist"===u.getModuleName()&&P.Browser.isDevice&&u.isDeviceFullScreen&&u.allowFiltering||(u.resizer=u.createElement("div",{id:u.element.id+"_resize-popup",className:f.resizeIcon}),u.list&&u.list.parentElement&&(u.list.parentElement.classList.add("e-resize"),"auto"!==u.popupHeight.toString().toLowerCase()&&e>parseInt(u.popupHeight.toString(),10)&&(u.list.parentElement.style.height="100%"),u.list.parentElement.style.paddingBottom="dropdownlist"===u.getModuleName()&&u.allowFiltering&&u.searchBoxHeight?(u.searchBoxHeight+16).toString()+"px":16..toString()+"px",(u.header||u.footer||u.itemTemplate)&&(u.list.parentElement.style.paddingBottom=(parseInt(u.list.parentElement.style.maxHeight,10)-parseInt(u.list.style.maxHeight,10)+16).toString()+"px"),u.list.parentElement.appendChild(u.resizer),u.list.parentElement.style.width=u.resizeWidth+"px",u.list.parentElement.style.height=u.resizeHeight+"px",u.list.parentElement.style.maxHeight=u.resizeHeight+"px",u.list.style.maxHeight=u.resizeHeight+"px"),P.EventHandler.add(u.resizer,"mousedown",u.startResizing,u),P.EventHandler.add(u.resizer,"touchstart",u.startResizing,u))}})},n.prototype.checkCollision=function(t){P.Browser.isDevice&&(!P.Browser.isDevice||"dropdownlist"===this.getModuleName()||this.isDropDownClick)||(0<o.isCollide(t).length&&(t.style.marginTop=-parseInt(getComputedStyle(t).marginTop,10)+"px"),this.popupObj.resolveCollision())},n.prototype.getOffsetValue=function(t){var t=getComputedStyle(t),e=parseInt(t.borderTopWidth,10),t=parseInt(t.borderBottomWidth,10);return this.setPopupPosition(e+t)},n.prototype.createPopup=function(t,e,i){var s=this;this.popupObj=new o.Popup(t,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:e,enableRtl:this.enableRtl,offsetX:i,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){s.isDocumentClick||s.focusDropDown(),s.isReact&&s.clearTemplate(["headerTemplate","footerTemplate"]),s.isNotSearchList=!1,s.isDocumentClick=!1,s.destroyPopup(),s.isFiltering()&&s.actionCompleteData.list&&0<s.actionCompleteData.list.length?(s.isActive=!0,s.isReactTemplateUpdate&&s.isReact&&s.itemTemplate&&!s.enableVirtualization&&(s.actionCompleteData.ulElement=s.renderItems(s.actionCompleteData.list,s.fields),s.isReactTemplateUpdate=!1),s.enableVirtualization?s.onActionComplete(s.ulElement,s.listData,null,!0):s.onActionComplete(s.actionCompleteData.ulElement,s.actionCompleteData.list,null,!0)):s.enableVirtualization&&s.focusIndexItem()},open:function(){P.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0;var t=s.actionCompleteData&&s.actionCompleteData.ulElement&&s.actionCompleteData.ulElement.querySelector("li"),e=s.list.querySelector("ul li");P.isNullOrUndefined(s.ulElement)||P.isNullOrUndefined(s.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(s.ulElement)||P.isNullOrUndefined(s.ulElement.getElementsByClassName("e-active")[0])||P.attributes(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-item-focus")[0].id}),s.isFiltering()&&s.itemTemplate&&s.element.tagName===s.getNgDirective()&&t&&e&&t.textContent!==e.textContent&&"EJS-COMBOBOX"!==s.element.tagName&&s.cloneElements(),s.isFilterLayout()&&(P.removeClass([s.inputWrapper.container],[f.inputFocus]),s.isFilterFocus=!0,s.filterInput.focus(),s.inputWrapper.clearButton)&&P.addClass([s.inputWrapper.clearButton],f.clearIconHide),s.activeStateChange()},targetExitViewport:function(){P.Browser.isDevice||s.hidePopup()}})},n.prototype.isEmptyList=function(){return!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},n.prototype.getFocusElement=function(){},n.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},n.prototype.scrollHandler=function(){P.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},n.prototype.isElementInViewport=function(t){t=t.getBoundingClientRect();return 0<=t.top&&0<=t.left&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth},n.prototype.setSearchBoxPosition=function(){var t=this.filterInput.parentElement.getBoundingClientRect().height,t=(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-t+"px",this.list.style.height=window.innerHeight-t+"px",this.filterInput.parentElement.querySelector("."+f.clearIcon));P.detach(this.filterInput),t.parentElement.insertBefore(this.filterInput,t)},n.prototype.setPopupPosition=function(t){var e,i=this.list.querySelector("."+f.focus)||this.selectedLI,s=this.isEmptyList()?this.list:this.liCollections[0],l=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],n=s.getBoundingClientRect().height,a=(this.listItemHeight=n+parseInt(window.getComputedStyle(s).marginBottom,10),this.list.offsetHeight/2),s=(P.isNullOrUndefined(i)?s:i).offsetTop,l=(l.offsetTop-a<s&&!P.isNullOrUndefined(this.liCollections)&&0<this.liCollections.length&&!P.isNullOrUndefined(i)?(l=this.list.offsetHeight/n,e=parseInt(getComputedStyle(this.list).paddingBottom,10),e=(l-(this.liCollections.length-this.activeIndex))*n-t+e,this.list.scrollTop=i.offsetTop):a<s&&!this.enableVirtualization?(e=a-n/2,this.list.scrollTop=s-a+n/2):e=s,this.inputWrapper.container.offsetHeight);return-(e=e+n+t-(n-l)/2)},n.prototype.setWidth=function(){var t,e=P.formatUnit(this.popupWidth);return-1<e.indexOf("%")&&(e=(this.inputWrapper.container.offsetWidth*parseFloat(e)/100).toString()+"px"),P.Browser.isDevice&&-1<e.indexOf("px")&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())&&(t=this.isEmptyList()?this.list:this.liCollections[0],e=parseInt(e,10)+2*(parseInt(getComputedStyle(t).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"),e},n.prototype.scrollBottom=function(t,e,i){var s,l,n,a,o,r,h,u,p=this;void 0===e&&(e=!1),void 0===i&&(i=null),P.isNullOrUndefined(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+y.li),!P.isNullOrUndefined(this.selectedLI))&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount]),P.isNullOrUndefined(this.selectedLI)||(s=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,this.isUpwardScrolling=!1,r=this.list.querySelectorAll(".e-virtual-list").length,l=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,u=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+s):this.selectedLI.offsetTop,h=this.list.offsetHeight,n=u-r*(this.selectedLI.offsetHeight+s)+(this.selectedLI.offsetHeight+s)-this.list.scrollTop,o=this.list.scrollTop+n-h,a=!1,o=t?o+2*parseInt(getComputedStyle(this.list).paddingTop,10):o+parseInt(getComputedStyle(this.list).paddingTop,10),u=u-r*(this.selectedLI.offsetHeight+s)+(this.selectedLI.offsetHeight+s)-this.list.scrollTop,u=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?u-this.fixedHeaderElement.offsetHeight:u,0!==this.activeIndex||this.enableVirtualization?(h<n||!(0<u&&this.list.offsetHeight>u))&&(r=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,h="pageDown"===i?this.getPageCount()-2:1,!this.enableVirtualization||this.isKeyBoardAction||e?this.isKeyBoardAction&&this.enableVirtualization&&l&&r===l&&"end"!==i&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=o:(this.enableVirtualization&&(h="pageDown"===i?this.getPageCount()+1:h),this.list.scrollTop+=(this.selectedLI.offsetHeight+s)*h),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===i?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=o):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?t&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,a=this.isKeyBoardAction):(this.list.scrollTop=0,a=this.isKeyBoardAction),this.isKeyBoardAction=a,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===i&&setTimeout(function(){p.scrollStop(null,!0)},100))},n.prototype.scrollTop=function(t){var e,i,s,l,n,a;void 0===t&&(t=null),P.isNullOrUndefined(this.selectedLI)||(e=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,n=this.list.querySelectorAll(".e-virtual-list").length,s=(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+e):this.selectedLI.offsetTop)-n*(this.selectedLI.offsetHeight+e)-this.list.scrollTop,i=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,s=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s,l=l-n*(this.selectedLI.offsetHeight+e)+(this.selectedLI.offsetHeight+e)-this.list.scrollTop,n=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&s<=0,0!==this.activeIndex||this.enableVirtualization?s<0||n?(n=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,a="pageUp"===t?this.getPageCount()-2:1,this.enableVirtualization&&(a="pageUp"===t?this.getPageCount():a),this.enableVirtualization&&this.isKeyBoardAction&&i&&n===i&&"home"!==t&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+e)*a,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===t?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===t&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+s)):0<l&&this.list.offsetHeight>l||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0)},n.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},n.prototype.isEditTextBox=function(){return!1},n.prototype.isFiltering=function(){return this.allowFiltering},n.prototype.isPopupButton=function(){return!0},n.prototype.setScrollPosition=function(t){if(this.isPreventScrollAction=!0,P.isNullOrUndefined(t))this.scrollBottom(!0);else switch(t.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,t.action);break;default:this.isKeyBoardAction="up"===t.action||"pageUp"===t.action||"open"===t.action,this.scrollTop(t.action)}this.isKeyBoardAction=!1},n.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())},n.prototype.setEleWidth=function(t){P.isNullOrUndefined(t)||("number"==typeof t?this.inputWrapper.container.style.width=P.formatUnit(t):"string"==typeof t&&(this.inputWrapper.container.style.width=t.match(/px|%|em/)?t:P.formatUnit(t)))},n.prototype.closePopup=function(t,e){var i=this,s=!P.isNullOrUndefined(this.filterInput)&&!P.isNullOrUndefined(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var l=0,n=this.popupObj.getScrollableParent(this.inputWrapper.container);l<n.length;l++){var a=n[l];P.EventHandler.remove(a,"scroll",this.scrollHandler)}P.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&P.removeClass([document.body,this.popupObj.element],f.popupFullScreen),this.isFilterLayout()&&(P.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&P.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(P.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),P.EventHandler.remove(this.clearIconElement,"click",this.clearText)),P.isNullOrUndefined(this.filterInput)||(P.EventHandler.remove(this.filterInput,"input",this.onInput),P.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),P.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),P.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),P.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),P.attributes(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(f.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&0<this.viewPortInfo.endIndex?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!P.isNullOrUndefined(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!P.isNullOrUndefined(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;t={popup:this.popupObj,cancel:!1,animation:{name:"FadeOut",duration:100,delay:t||0},event:e||null};this.trigger("close",t,function(t){var e;"dropdownlist"===i.getModuleName()&&h.Input.destroy({element:i.filterInput,floatLabelType:i.floatLabelType,properties:{placeholder:i.filterBarPlaceholder},buttons:i.clearIconElement},i.clearIconElement),i.filterInputObj=null,P.isNullOrUndefined(i.popupObj)||P.isNullOrUndefined(i.popupObj.element.querySelector(".e-fixed-head"))||((e=i.popupObj.element.querySelector(".e-fixed-head")).parentNode.removeChild(e),i.fixedHeaderElement=null),t.cancel||("autocomplete"===i.getModuleName()&&i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new P.Animation(t.animation)):i.destroyPopup())}),P.Browser.isDevice&&!t.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup"),e=this.dataSource instanceof c.DataManager?this.virtualGroupDataSource&&this.virtualGroupDataSource.length?this.virtualGroupDataSource.length:0:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.enableVirtualization&&this.isFiltering()&&s&&this.totalItemCount!==e&&(this.updateInitialData(),this.checkAndResetCache())}},n.prototype.updateInitialData=function(){var t,e,i=this.selectData;P.isNullOrUndefined(i)||(t=this.renderItems(i,this.fields),this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement&&(e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(e)),"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=i,this.updateActionCompleteDataValues(t,i),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},n.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(P.EventHandler.remove(this.resizer,"mousedown",this.startResizing),P.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),P.detach(this.popupObj.element))},n.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},n.prototype.render=function(){this.preselectedIndex=P.isNullOrUndefined(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,P.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),P.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var t=this.cssClass,t=(P.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass.replace(/\s+/g," ").trim()),!P.isNullOrUndefined(P.closest(this.element,"fieldset"))&&P.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=h.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[f.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:t,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:f.hiddenElement}}),P.prepend([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=P.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!P.isNullOrUndefined(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.element.getAttribute("id")?this.element.getAttribute("id"):P.getUniqueID("ej2_dropdownlist")),t=(this.element.id=t,this.hiddenElement.id=t+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||P.attributes(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),P.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text?(this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index)&&(this.activeIndex=this.index+this.skeletonCount),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount)):"SELECT"===this.element.tagName&&this.element.options[0]&&(t=this.element,this.value=this.allowObjectBinding?this.getDataByValue(t.options[t.selectedIndex].value):t.options[t.selectedIndex].value,this.text=P.isNullOrUndefined(this.value)?null:t.options[t.selectedIndex].textContent,this.initValue()),this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(t){t.stopImmediatePropagation()},this.inputElement.onchange=function(t){t.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),P.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.inputWrapper.container.getElementsByClassName("e-float-text")[0]);P.isNullOrUndefined(this.element.id)||""===this.element.id||P.isNullOrUndefined(t)||(t.id="label_"+this.element.id.replace(/ /g,"_"),P.attributes(this.inputElement,{"aria-labelledby":t.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount},n.prototype.getListHeight=function(){var t=this.createElement("div",{className:"e-dropdownbase"}),e=this.createElement("li",{className:"e-list-item"}),i=P.formatUnit(this.popupHeight),i=(t.style.height=parseInt(i,10).toString()+"px",t.appendChild(e),document.body.appendChild(t),this.virtualListHeight=t.getBoundingClientRect().height,Math.ceil(e.getBoundingClientRect().height)+parseInt(window.getComputedStyle(e).marginBottom,10));return t.remove(),i},n.prototype.setFooterTemplate=function(t){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),P.addClass([this.footer],f.footer));var e=this.dropdownCompiler(this.footerTemplate),e="function"!=typeof this.footerTemplate&&e?P.compile(P.select(this.footerTemplate,document).innerHTML.trim()):P.compile(this.footerTemplate),e=e({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);e&&0<e.length&&P.append(e,this.footer),P.append([this.footer],t)},n.prototype.setHeaderTemplate=function(t){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),P.addClass([this.header],f.header));var e=this.dropdownCompiler(this.headerTemplate),e="function"!=typeof this.headerTemplate&&e?P.compile(P.select(this.headerTemplate,document).innerHTML.trim()):P.compile(this.headerTemplate),e=e({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header),e=(e&&e.length&&P.append(e,this.header),t.querySelector("div.e-content"));t.insertBefore(this.header,e)},n.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},n.prototype.setOldText=function(t){this.text=t},n.prototype.setOldValue=function(t){this.value=t},n.prototype.refreshPopup=function(){P.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||P.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(P.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},n.prototype.checkData=function(t){!t.dataSource||P.isNullOrUndefined(Object.keys(t.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&t.dataSource instanceof c.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var e=-1!==Object.keys(t).indexOf("value")&&P.isNullOrUndefined(t.value),i=-1!==Object.keys(t).indexOf("text")&&P.isNullOrUndefined(t.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(e||i)&&(this.itemData=null),this.allowFiltering&&t.dataSource&&!P.isNullOrUndefined(Object.keys(t.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&t.query&&!P.isNullOrUndefined(Object.keys(t.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},n.prototype.updateDataSource=function(t,e){""===this.inputElement.value&&(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t.dataSource)&&(t.dataSource instanceof c.DataManager||0!==t.dataSource.length))||this.clearAll(null,t),this.fields.groupBy&&t.fields&&!this.isGroupChecking&&this.list&&(P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),P.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t.dataSource)&&(t.dataSource instanceof c.DataManager||0!==t.dataSource.length)||t.dataSource instanceof c.DataManager||!P.isNullOrUndefined(t)&&Array.isArray(t.dataSource)&&!P.isNullOrUndefined(e)&&Array.isArray(e.dataSource)&&t.dataSource.length!==e.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},n.prototype.checkCustomValue=function(){var t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,e=(this.itemData=this.getDataByValue(t),this.getItemData()),i=this.allowObjectBinding?this.itemData:e.value,s=P.isNullOrUndefined(i)?null:this.index;P.isNullOrUndefined(s)&&t===i||this.isAngular?this.setProperties({text:e.text&&e.text.toString(),value:i}):this.setProperties({text:e.text&&e.text.toString(),index:s,value:i})},n.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},n.prototype.onPropertyChanged=function(n,a){for(var o=this,r=(P.isNullOrUndefined(n.dataSource)||this.isTouched||!P.isNullOrUndefined(n.value)||!P.isNullOrUndefined(n.index)||P.isNullOrUndefined(this.preselectedIndex)||P.isNullOrUndefined(this.index)||(n.index=this.index),P.isNullOrUndefined(n.value)&&P.isNullOrUndefined(n.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(n),this.setUpdateInitial(["fields","query","dataSource"],n)),this),t=0,e=Object.keys(n);t<e.length;t++){var i=function(t){switch(t){case"query":case"dataSource":r.getSkeletonCount(),r.checkAndResetCache();break;case"htmlAttributes":r.setHTMLAttributes();break;case"width":r.setEleWidth(n.width),h.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"placeholder":h.Input.setPlaceholder(n.placeholder,r.inputElement);break;case"filterBarPlaceholder":r.filterInput&&h.Input.setPlaceholder(n.filterBarPlaceholder,r.filterInput);break;case"readonly":"dropdownlist"!==r.getModuleName()&&h.Input.setReadonly(n.readonly,r.inputElement),r.setReadOnly();break;case"cssClass":r.setCssClass(n.cssClass,a.cssClass),h.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"enableRtl":r.setEnableRtl();break;case"enabled":r.setEnable();break;case"text":var e;r.fields.disabled&&(n.text=n.text&&!r.isDisabledItemByIndex(r.getIndexByValue(r.getValueByText(n.text)))?n.text:null),null===n.text?r.clearAll():r.enableVirtualization?(r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})):(r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),r.initialRemoteRender||(l=r.getElementByText(n.text),r.checkValidLi(l)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.text,a.text,"text"):n.text&&r.dataSource instanceof c.DataManager?(e=r.getItems().length,s=P.isNullOrUndefined(r.fields.text)?r.fields.value:r.fields.text,r.typedString="",r.dataSource.executeQuery(r.getQuery(r.query).where(new c.Predicate(s,"equal",n.text))).then(function(t){0<t.result.length?(o.addItem(t.result,e),o.updateValues()):o.setOldText(a.text)})):"autocomplete"===r.getModuleName()?r.setInputValue(n,a):r.setOldText(a.text)),r.updateInputFields()));break;case"value":if(r.fields.disabled&&(n.value=null==n.value||r.isDisableItemValue(n.value)?null:n.value),null===n.value)r.clearAll();else{if(r.allowObjectBinding&&!P.isNullOrUndefined(n.value)&&!P.isNullOrUndefined(a.value)&&r.isObjectInArray(n.value,[a.value]))return{value:void 0};var i;r.enableVirtualization?(r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange):(r.notify("beforeValueChange",{newProp:n}),r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),r.initialRemoteRender||(l=r.allowObjectBinding&&!P.isNullOrUndefined(n.value)?P.getValue(r.fields.value||"",n.value):n.value,l=r.getElementByValue(l),r.checkValidLi(l)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.value,a.value,"value"):n.value&&r.dataSource instanceof c.DataManager?(i=r.getItems().length,s=P.isNullOrUndefined(r.fields.value)?r.fields.text:r.fields.value,r.typedString="",l=r.allowObjectBinding&&!P.isNullOrUndefined(n.value)?P.getValue(s,n.value):n.value,r.dataSource.executeQuery(r.getQuery(r.query).where(new c.Predicate(s,"equal",l))).then(function(t){0<t.result.length?(o.addItem(t.result,i),o.updateValues()):o.setOldValue(a.value)})):"autocomplete"===r.getModuleName()?r.setInputValue(n,a):r.setOldValue(a.value)),r.updateInputFields(),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange))}break;case"index":var s;r.fields.disabled&&(n.index=null==n.index||r.isDisabledItemByIndex(n.index)?null:n.index),null===n.index?r.clearAll():(r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender&&r.liCollections&&(s=r.liCollections[n.index],r.checkValidLi(s)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.index,a.index,"index"):r.index=a.index),r.updateInputFields()));break;case"footerTemplate":r.popupObj&&r.setFooterTemplate(r.popupObj.element);break;case"headerTemplate":r.popupObj&&r.setHeaderTemplate(r.popupObj.element);break;case"valueTemplate":P.isNullOrUndefined(r.itemData)||null===r.valueTemplate||r.setValueTemplate();break;case"allowFiltering":r.allowFiltering&&(r.actionCompleteData={ulElement:r.ulElement,list:r.listData,isUpdated:!0},r.actionData=r.actionCompleteData,r.updateSelectElementData(r.allowFiltering));break;case"floatLabelType":h.Input.removeFloating(r.inputWrapper),h.Input.addFloating(r.inputElement,n.floatLabelType,r.placeholder,r.createElement),!P.isNullOrUndefined(r.inputWrapper.buttons[0])&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==r.floatLabelType&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":r.inputWrapper.clearButton||(h.Input.setClearButton(n.showClearButton,r.inputElement,r.inputWrapper,null,r.createElement),r.bindClearEvent());break;default:var l=r.getPropObject(t,n,a);m.prototype.onPropertyChanged.call(r,l.newProperty,l.oldProperty)}}(e[t]);if("object"==typeof i)return i.value}},n.prototype.checkValidLi=function(t){return!!this.isValidLI(t)&&(this.setSelection(t,null),!0)},n.prototype.setSelectionData=function(e,i,s){var l,n=this;this.updateListValues=function(){var t;"text"===s?(l=n.getElementByText(e),n.checkValidLi(l)||n.setOldText(i)):"value"===s?(t=n.fields.value||"",n.allowObjectBinding&&!P.isNullOrUndefined(e)&&P.getValue(t,e),l=n.getElementByValue(e),n.checkValidLi(l)||n.setOldValue(i)):"index"===s&&(l=n.liCollections[e],n.checkValidLi(l)||(n.index=i))}},n.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},n.prototype.setReadOnly=function(){this.readonly?P.addClass([this.inputWrapper.container],["e-readonly"]):P.removeClass([this.inputWrapper.container],["e-readonly"])},n.prototype.setInputValue=function(t,e){},n.prototype.setCssClass=function(t,e){P.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),P.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),h.Input.setCssClass(t,[this.inputWrapper.container],e),this.popupObj&&h.Input.setCssClass(t,[this.popupObj.element],e)},n.prototype.getModuleName=function(){return"dropdownlist"},n.prototype.showPopup=function(t){this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof c.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):(P.isNullOrUndefined(this.list)||!P.isUndefined(this.list)&&(this.list.classList.contains(y.noData)||this.list.querySelectorAll("."+y.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(t)),this.enableVirtualization&&this.listData&&this.listData.length&&(P.isNullOrUndefined(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(t),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&0<this.selectedValueInfo.startIndex&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()))},n.prototype.executeCloneElements=function(){var t=this,e=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout(function(){t.cloneElements(),t.isSecondClick=!(t.isReact&&t.isFiltering()&&t.dataSource instanceof c.DataManager&&!t.list.querySelector("ul"))},e)},n.prototype.invokeRenderPopup=function(t){var e;P.Browser.isDevice&&this.isFilterLayout()&&(e=this,window.onpopstate=function(){e.hidePopup()},history.pushState({},"")),P.isNullOrUndefined(this.list)||P.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(y.noData)||this.renderPopup(t)},n.prototype.renderHightSearch=function(){},n.prototype.hidePopup=function(t){this.isEscapeKey&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.inputElement)||h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,P.isNullOrUndefined(this.index)?this.resetSelection():(e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value):this.value,e=this.findListElement(this.ulElement,"li","data-value",e),this.selectedLI=this.liCollections[this.index]||e,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate)&&null!==this.itemData&&this.setValueTemplate())),this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,t);var e=this.getItemData(),i=!P.isNullOrUndefined(this.selectedLI);i&&this.enableVirtualization&&this.selectedLI.classList&&(i=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||i&&this.inputElement.value!==e.text)&&(this.isSelectCustom=!1,this.clearAll(t))},n.prototype.focusIn=function(t){var e;this.enabled&&!this.targetElement().classList.contains(f.disable)&&(e=!1,this.preventFocus&&P.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),e=!(this.preventFocus=!1)),e||this.targetElement().focus(),P.addClass([this.inputWrapper.container],[f.inputFocus]),this.onFocus(t),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},n.prototype.focusOut=function(t){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(t),this.targetElement()&&this.targetElement().blur(),P.removeClass([this.inputWrapper.container],[f.inputFocus]),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},n.prototype.disableItem=function(t){if(this.fields.disabled){this.list||this.renderList();var e,i,s=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof t)s=this.getIndexByValue(t);else if("object"==typeof t){if(t instanceof HTMLLIElement){for(var l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===t){s=this.getIndexByValue(t.getAttribute("data-value"));break}}else for(var n=JSON.parse(JSON.stringify(t))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===n){s=this.getIndexByValue(n);break}}else s=t;s<this.liCollections.length&&-1<s&&!JSON.parse(JSON.stringify(this.listData[s]))[this.fields.disabled]&&(e=this.liCollections[s])&&(this.disableListItem(e),(i=JSON.parse(JSON.stringify(this.listData[s])))[this.fields.disabled]=!0,this.listData[s]=i,this.dataSource=this.listData,e.classList.contains(f.focus)&&this.removeFocus(),e.classList.contains(f.selected))&&this.clear()}}},n.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),z(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&this.popupObj.hide(),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var t=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],e=0;e<t.length;e++)this.inputElement.removeAttribute(t[e]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),h.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName!==this.getNgDirective()&&this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),P.detach(this.inputWrapper.container)),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!P.isNullOrUndefined(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!P.isNullOrUndefined(this.inputElement.onselect)&&(this.inputElement.onselect=null),h.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,m.prototype.destroy.call(this)}},n.prototype.getItems=function(){return this.list||(this.dataSource instanceof c.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?m.prototype.getItems.call(this):[]},n.prototype.getDataByValue=function(t){return m.prototype.getDataByValue.call(this,t)},n.prototype.clear=function(){this.value=null},l([P.Property(null)],n.prototype,"cssClass",void 0),l([P.Property("100%")],n.prototype,"width",void 0),l([P.Property(!0)],n.prototype,"enabled",void 0),l([P.Property(!1)],n.prototype,"enablePersistence",void 0),l([P.Property("300px")],n.prototype,"popupHeight",void 0),l([P.Property("100%")],n.prototype,"popupWidth",void 0),l([P.Property(null)],n.prototype,"placeholder",void 0),l([P.Property(null)],n.prototype,"filterBarPlaceholder",void 0),l([P.Property({})],n.prototype,"htmlAttributes",void 0),l([P.Property(null)],n.prototype,"query",void 0),l([P.Property(null)],n.prototype,"valueTemplate",void 0),l([P.Property(null)],n.prototype,"headerTemplate",void 0),l([P.Property(null)],n.prototype,"footerTemplate",void 0),l([P.Property(!1)],n.prototype,"allowFiltering",void 0),l([P.Property(!0)],n.prototype,"isDeviceFullScreen",void 0),l([P.Property(!1)],n.prototype,"readonly",void 0),l([P.Property(!1)],n.prototype,"enableVirtualization",void 0),l([P.Property(!1)],n.prototype,"allowResize",void 0),l([P.Property(null)],n.prototype,"text",void 0),l([P.Property(null)],n.prototype,"value",void 0),l([P.Property(!1)],n.prototype,"allowObjectBinding",void 0),l([P.Property(null)],n.prototype,"index",void 0),l([P.Property("Never")],n.prototype,"floatLabelType",void 0),l([P.Property(!1)],n.prototype,"showClearButton",void 0),l([P.Event()],n.prototype,"filtering",void 0),l([P.Event()],n.prototype,"change",void 0),l([P.Event()],n.prototype,"beforeOpen",void 0),l([P.Event()],n.prototype,"open",void 0),l([P.Event()],n.prototype,"close",void 0),l([P.Event()],n.prototype,"blur",void 0),l([P.Event()],n.prototype,"focus",void 0),l([P.Event()],n.prototype,"resizeStop",void 0),l([P.Event()],n.prototype,"resizing",void 0),l([P.Event()],n.prototype,"resizeStart",void 0),l([P.NotifyPropertyChanges],n));function n(t,e){t=m.call(this,t,e)||this;return t.isListSearched=!1,t.preventChange=!1,t.isTouched=!1,t.isFocused=!1,t.autoFill=!1,t.isUpdateHeaderHeight=!1,t.isUpdateFooterHeight=!1,t.isReactTemplateUpdate=!1,t}nt=function(t,e){return(nt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var nt,at,l=function(t,e){function i(){this.constructor=t}nt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},a=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},ot="e-rtl",rt="e-ddt-hidden",ht="e-input-group-icon e-ddt-icon e-icons",r="e-show-chip",ut="e-show-clear",pt="e-show-dd-icon",u="e-chip-input",dt="e-input-focus",ct="e-input-group",mt="e-icon-anim",ft="e-chips",vt="e-chipcontent",gt="e-chips-close",C="e-icon-hide",yt="e-ddt-icon-hide",Ct="e-list-parent",bt="e-dropdown",St="e-disabled",Et="e-selectall-parent",xt="e-hide-selectall",It="e-all-text",wt="e-frame",Ot="e-check",At="e-checkbox-wrapper",Dt="e-filter-wrap",kt="e-ddt-icon",Nt="e-ddt-footer",Lt="e-ddt-header",Bt="e-no-data",Tt="e-remain",Vt="e-overflow",Pt="e-show-text",Ut="e-total-count",Ht="e-wrap-count",Ft=(at=P.ChildProperty,l(p,at),a([P.Property("child")],p.prototype,"child",void 0),a([P.Property([])],p.prototype,"dataSource",void 0),a([P.Property("expanded")],p.prototype,"expanded",void 0),a([P.Property("hasChildren")],p.prototype,"hasChildren",void 0),a([P.Property("htmlAttributes")],p.prototype,"htmlAttributes",void 0),a([P.Property("iconCss")],p.prototype,"iconCss",void 0),a([P.Property("imageUrl")],p.prototype,"imageUrl",void 0),a([P.Property("parentValue")],p.prototype,"parentValue",void 0),a([P.Property(null)],p.prototype,"query",void 0),a([P.Property("selectable")],p.prototype,"selectable",void 0),a([P.Property("selected")],p.prototype,"selected",void 0),a([P.Property(null)],p.prototype,"tableName",void 0),a([P.Property("text")],p.prototype,"text",void 0),a([P.Property("tooltip")],p.prototype,"tooltip",void 0),a([P.Property("value")],p.prototype,"value",void 0),p);function p(){return null!==at&&at.apply(this,arguments)||this}Wt=P.ChildProperty,l(Mt,Wt),a([P.Property(!1)],Mt.prototype,"autoCheck",void 0),a([P.Property(!0)],Mt.prototype,"checkDisabledChildren",void 0),a([P.Property("Auto")],Mt.prototype,"expandOn",void 0),a([P.Property(!1)],Mt.prototype,"loadOnDemand",void 0);var Wt,qt=Mt;function Mt(){return null!==Wt&&Wt.apply(this,arguments)||this}jt=P.Component,l(b,jt),b.prototype.getPersistData=function(){return this.addOnPersist(["value"])},b.prototype.getLocaleName=function(){return"drop-down-tree"},b.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",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",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",ctrlA:"ctrl+A"}},b.prototype.render=function(){var t=P.select("#"+this.element.id+"_tree",document),e=(t&&(e=P.select("#"+this.element.id+"_options",document),P.detach(e||t.parentElement)),"INPUT"===this.element.tagName?(this.inputEle=this.element,P.isNullOrUndefined(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),P.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(P.isNullOrUndefined(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=h.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[ht]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains(ct)||this.inputWrapper.classList.add(ct),this.showDropDownIcon&&this.inputWrapper.classList.add(pt),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add(bt),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),P.addClass([this.popupDiv],yt),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof c.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:Vt+" "+C}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&P.addClass([this.overFlowWrapper],Pt))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText)||this.updateView(),this.wireEvents(),P.select("."+Ct,this.treeObj.element));e&&e.getAttribute("aria-multiselectable")&&e.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},b.prototype.hideCheckAll=function(t){var e=P.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector("."+Et);P.isNullOrUndefined(e)||(t&&!e.classList.contains(xt)?P.addClass([e],xt):!t&&e.classList.contains(xt)&&P.removeClass([e],xt))},b.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:Dt});var t=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(t),P.prepend([this.filterContainer],this.popupEle),this.filterObj=new h.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new P.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.filterKeyAction=function(e){var i,s=this;this.trigger("keyPress",{cancel:!1,event:e},function(t){if(!t.cancel)switch(e.action){case"altUp":s.isPopupOpen&&s.hidePopup();break;case"shiftTab":P.addClass([s.inputWrapper],[dt]);break;case"moveDown":e.preventDefault(),s.filterObj.element.blur(),(i=s.treeObj.element.querySelector("li"))&&i.focus()}})},b.prototype.filterChangeHandler=function(t){var e=this;P.isNullOrUndefined(t.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){e.filterHandler(t.value,t.event)},this.filterDelayTime))},b.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},b.prototype.filterHandler=function(t,e){var l=this,i=(this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData()),this.cloneFields(this.fields)),e={cancel:!1,preventDefaultAction:!1,event:e,text:t.trim(),fields:i};this.trigger("filtering",e,function(t){if(!t.cancel){var e=!1,i=void 0;if(l.isFilteredData=!0,""===t.text?(l.isFilteredData=!1,l.isFilterRestore=!0,i=l.cloneFields(l.fields),l.treeObj.element.classList.remove("e-filtering")):(t.preventDefaultAction?i=t.fields:1===l.treeDataType?i=l.selfReferencefilter(t.text,t.fields):l.fields.dataSource instanceof c.DataManager?((i=l.remoteDataFilter(t.text,t.fields)).child=l.fields.child,l.treeObj.fields=l.getTreeFields(t.fields),l.treeObj.dataBind(),e=!0):i=l.nestedFilter(t.text,t.fields),l.treeObj.element.classList.add("e-filtering")),l.hideCheckAll(l.isFilteredData),!e&&(l.isRemoteData&&(l.isChildObject()?i.child=l.fields.child:i=t.fields),l.treeObj.fields=l.getTreeFields(i),l.treeObj.dataBind(),l.popupObj&&l.popupObj.refreshPosition(),l.hasTemplate&&l.portals&&l.treeObj.portals)){for(var s=0;s<l.treeObj.portals.length;s++)-1===l.portals.indexOf(l.treeObj.portals[s])&&l.portals.push(l.treeObj.portals[s]);l.isReact&&l.renderReactTemplates()}}})},b.prototype.remoteDataFilter=function(e,t){var i=this;return t.dataSource=this.treeData.map(function(t){return i.remoteChildFilter(e,t)}).filter(function(t){return!P.isNullOrUndefined(t)}),t},b.prototype.remoteChildFilter=function(t,e,i,s){var l=this.isChildObject()?e.child:e[this.fields.child];if(P.isNullOrUndefined(l))return this.isMatchedNode(t,e,i,s)?e:null;for(var n=[],a=0;a<l.length;a++){var o=this.remoteChildFilter(t,l[a],!0,!0);P.isNullOrUndefined(o)||n.push(o)}i=Object.assign({},e);return s=!1,0!==n.length?i.child=n:(i.child=null,i=this.isMatchedNode(t,i)?i:null),i},b.prototype.nestedFilter=function(t,e){for(var i=[],s=0;s<this.treeData.length;s++){var l=this.nestedChildFilter(t,this.treeData[parseInt(s.toString(),10)]);P.isNullOrUndefined(l)||i.push(l)}return e.dataSource=i,e},b.prototype.nestedChildFilter=function(t,e){var i=e[this.fields.child];if(P.isNullOrUndefined(i))return this.isMatchedNode(t,e)?e:null;for(var s=[],l=0;l<i.length;l++){var n=this.nestedChildFilter(t,i[parseInt(l.toString(),10)]);P.isNullOrUndefined(n)||s.push(n)}e=Object.assign({},e);return 0!==s.length?(e[this.fields.child]=s,e):(e[this.fields.child]=null,this.isMatchedNode(t,e)?e:null)},b.prototype.selfReferencefilter=function(t,e){for(var i=[],s=[],l=0;l<this.treeData.length;l++)this.isMatchedNode(t,this.treeData[l])&&i.push(this.treeData[l]);for(l=0;l<i.length;l++)if(-1===s.indexOf(i[l])){s.push(i[l]);for(var n=i[parseInt(l.toString(),10)][this.fields.parentValue];!P.isNullOrUndefined(n);){for(var a=null,o=0;o<this.treeData.length;o++){var r=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!P.isNullOrUndefined(r)&&r===n){a=this.treeData[o];break}}if(P.isNullOrUndefined(a)||-1!==s.indexOf(a))break;s.push(a),n=a[this.fields.parentValue]}}return e.dataSource=s,e},b.prototype.isMatchedNode=function(t,e,i,s){i=i&&s&&this.isChildObject()?e[this.fields.child.text]:e[this.fields.text];if(!i&&!P.isNullOrUndefined(this.fields.child.text)){for(var l=this.fields.child;!e[l.text];)l=l.child;i=e[l.text]}return this.ignoreCase&&(i=i.toLowerCase(),t=t.toLowerCase()),this.ignoreAccent&&(i=c.DataUtil.ignoreDiacritics(i),t=c.DataUtil.ignoreDiacritics(t)),"StartsWith"===this.filterType?i.slice(0,t.length)===t:"EndsWith"===this.filterType?i.slice(-t.length)===t:-1!==i.indexOf(t)},b.prototype.wireEvents=function(){P.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),P.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),P.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),P.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),P.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),P.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),P.EventHandler.add(window,"resize",this.windowResize,this);var t=P.closest(this.inputWrapper,"form");t&&P.EventHandler.add(t,"reset",this.resetValueHandler,this),this.keyboardModule=new P.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.wireTreeEvents=function(){this.keyboardModule=new P.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new P.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.unWireEvents=function(){P.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),P.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),P.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),P.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),P.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),P.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),P.EventHandler.remove(window,"resize",this.windowResize);var t=P.closest(this.inputWrapper,"form");t&&P.EventHandler.remove(t,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&P.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},b.prototype.dropDownClick=function(t){this.enabled&&!this.readonly&&(this.isClearButtonClick?this.isClearButtonClick=!1:(this.isPopupOpen?this.hidePopup():(this.focusIn(t),this.renderPopup()),this.showOverAllClear()))},b.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},b.prototype.onMouseLeave=function(){this.inputFocus||(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ut))},b.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},b.prototype.focusOut=function(t){var e;!this.enabled||this.readonly||!this.inputFocus||(P.Browser.isIE||"edge"===P.Browser.info.name)&&t.target===this.inputWrapper||(e=t.relatedTarget)===this.inputEle||!P.isNullOrUndefined(e)||t.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(t)},b.prototype.onFocusOut=function(t){var e;this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=P.select(".e-clear-icon",this.inputWrapper).offsetWidth,P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ut)),P.removeClass([this.inputWrapper],[dt]),(this.allowMultiSelection||this.showCheckBox)&&(e=!!this.value&&!!this.value.length,"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u)),e&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText)&&e&&this.updateView(),this.changeOnBlur&&this.triggerChangeEvent(t),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},b.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?P.addClass([this.inputWrapper,this.overFlowWrapper],Pt):P.addClass([this.inputWrapper],r),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&P.addClass([this.chipWrapper],C),P.addClass([this.inputEle],u),this.updateOverFlowView()),this.ensurePlaceHolder())},b.prototype.triggerChangeEvent=function(t){this.ddtCompareValues(this.oldValue,this.value)&&!this.isChipDelete||this.removeValue||(t={e:t,oldValue:this.oldValue,value:this.value,isInteracted:!!t,element:this.element},this.trigger("change",t),this.setOldValue())},b.prototype.ddtCompareValues=function(t,e){if(null===t||null===e)return(null===t||0===t.length)&&e===t;if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},b.prototype.focusIn=function(t){!this.enabled||this.readonly||this.inputFocus||(this.showOverAllClear(),this.inputFocus=!0,P.addClass([this.inputWrapper],[dt]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(P.removeClass([this.chipWrapper],C),P.addClass([this.inputEle],u),this.showOrHideValueTemplate(!1,!0)),P.addClass([this.inputWrapper],r),this.popupObj)&&this.popupObj.refreshPosition(),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&P.addClass([this.overFlowWrapper],C),"Delimiter"===this.mode?(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u),this.showOrHideValueTemplate(!0)):P.addClass([this.inputWrapper],r),P.removeClass([this.inputWrapper],Pt),this.ensurePlaceHolder())),this.trigger("focus",{isInteracted:!!t,event:t}))},b.prototype.treeAction=function(e){var i=this;this.trigger("keyPress",{cancel:!1,event:e},function(t){if(t.cancel)e.stopImmediatePropagation();else switch(e.action){case"escape":case"altUp":i.inputWrapper.focus(),e.preventDefault(),i.isPopupOpen&&i.hidePopup();break;case"tab":i.isPopupOpen&&i.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.showCheckBox||(i.isValueChange=!0,i.keyEventArgs=e);break;case"space":i.isValueChange=!0,i.keyEventArgs=e;break;case"ctrlA":i.allowMultiSelection&&i.selectAll(!0)}})},b.prototype.keyActionHandler=function(e){var i=this;this.trigger("keyPress",{cancel:!1,event:e},function(t){if(!t.cancel)switch(e.action){case"escape":case"altUp":i.isPopupOpen&&i.hidePopup();break;case"shiftTab":i.isPopupOpen&&i.hidePopup(),i.inputFocus&&i.onFocusOut();break;case"altDown":i.isPopupOpen||(i.showPopup(),e.preventDefault());break;case"moveDown":i.showSelectAll&&i.showCheckBox&&i.checkAllParent.focus();break;case"tab":!i.isPopupOpen&&i.inputFocus&&i.onFocusOut()}})},b.prototype.checkAllAction=function(e){var i,s=this;this.trigger("keyPress",{cancel:!1,event:e},function(t){if(!t.cancel)switch(e.action){case"space":s.clickHandler(e);break;case"moveDown":e.preventDefault(),(i=s.treeObj.element.querySelector('li[tabindex="0"]')||s.treeObj.element.querySelector("li")).focus(),P.addClass([i],["e-node-focus"])}})},b.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},b.prototype.resetValueHandler=function(t){var e=P.closest(this.inputWrapper,"form");e&&t.target===e&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},b.prototype.getAriaAttributes=function(){return{}},b.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove(Ut),P.removeClass([this.overFlowWrapper],C),this.value&&this.value.length){var t,e="",i=void 0,s=void 0,l=1,n=void 0,a=void 0,o=0,r=(this.overFlowWrapper.innerHTML="",this.l10n=new P.L10n(this.getLocaleName(),{overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},this.locale),this.l10n.getConstant("overflowCountTemplate")),h=this.l10n.getConstant("totalCountTemplate"),u=this.createElement("span",{className:Tt}),p=(this.overFlowWrapper.appendChild(u),u.innerText=r.replace("${count}",this.value.length.toString()),u.offsetWidth);if(P.remove(u),this.showDropDownIcon&&(o=P.select("."+kt,this.inputWrapper).offsetWidth),!P.isNullOrUndefined(this.value))if("Box"!==this.mode){if(this.valueTemplate)return a=this.updateChipAndValueTemplate(!1,o,p),this.checkRemainingTemplate(a,u,r,h),void this.updateDelimMode();for(var d=0;!P.isNullOrUndefined(this.value[d]);d++){if(e=(e+=0===d?"":this.delimiterChar+" ")+(i=this.getOverflowVal(d)),i=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=P.SanitizeHtmlHelper.sanitize(e):this.overFlowWrapper.innerHTML=e,n=this.overFlowWrapper.offsetWidth,t=this.inputWrapper.offsetWidth,n+o+this.clearIconWidth>t){for(void 0!==s&&""!==s&&(i=s,d=l+1),this.overFlowWrapper.innerHTML=i,a=this.value.length-d,n=this.overFlowWrapper.offsetWidth;n+p+o+this.clearIconWidth>=t&&0!==n&&""!==this.overFlowWrapper.innerHTML;){var c=this.overFlowWrapper.innerHTML.split(this.delimiterChar);c.pop(),this.overFlowWrapper.innerHTML=c.join(this.delimiterChar),a++,n=this.overFlowWrapper.offsetWidth}break}n+p+o+this.clearIconWidth<=t?(s=e,l=d):0===d&&(s="",l=-1)}}else a=this.updateChipAndValueTemplate(!0,o,p);this.checkRemainingTemplate(a,u,r,h)}else this.overFlowWrapper.innerHTML="",P.addClass([this.overFlowWrapper],C);this.updateDelimMode()},b.prototype.checkRemainingTemplate=function(t,e,i,s){0<t&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(e,t,i,s)),"Box"!==this.mode||this.overFlowWrapper.classList.contains(Ut)||P.addClass([e],Ht)},b.prototype.updateChipAndValueTemplate=function(t,e,i){void 0===e&&(e=0);for(var s,l,n,a,o,r,h=1,u=(P.addClass([t?this.chipWrapper:this.valueTemplateContainer],C),(t?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0)),p=t?P.selectAll("."+ft,u):Array.prototype.slice.call(u.children),d=0;d<p.length;d++){if(n=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(p[d]),s=this.overFlowWrapper.innerHTML,o=this.overFlowWrapper.offsetWidth,l=this.inputWrapper.offsetWidth,o+e+this.clearIconWidth>l){for(void 0!==a&&""!==a&&(n=a,d=h+1),this.overFlowWrapper.innerHTML=n,r=this.value.length-d,o=this.overFlowWrapper.offsetWidth;o+i+e+this.clearIconWidth>=l&&0!==o&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),r++,o=this.overFlowWrapper.offsetWidth;break}o+i+e+this.clearIconWidth<=l?(a=s,h=d):0===d&&(a="",h=-1)}return r},b.prototype.updateRemainTemplate=function(t,e,i,s){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),t.innerHTML="",t.innerText=(this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?i:s).replace("${count}",e.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(P.addClass([this.overFlowWrapper],Ut),P.removeClass([this.overFlowWrapper],Ht)):P.removeClass([this.overFlowWrapper],Ut),t},b.prototype.getOverflowVal=function(t){t=this.getSelectedData(this.value[parseInt(t.toString(),10)]);return P.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",t)},b.prototype.updateDelimMode=function(){"Box"!==this.mode?P.select("."+Tt,this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains(Ut)?(P.addClass([this.overFlowWrapper],Ht),P.addClass([this.overFlowWrapper],Pt)):(this.overFlowWrapper.classList.remove(Ht),P.removeClass([this.overFlowWrapper],Ht)):P.select("."+Tt,this.overFlowWrapper)&&this.overFlowWrapper.classList.remove(Ht)},b.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:rt,tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:rt,"aria-label":this.getModuleName()}}),P.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},b.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ut),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},b.prototype.validationAttribute=function(){for(var t=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id"),e=(this.hiddenElement.setAttribute("name",t),this.inputEle.removeAttribute("name"),["required","aria-required","form"]),i=0;i<e.length;i++){var s=this.inputEle.getAttribute(e[i]);s&&(this.hiddenElement.setAttribute(e[i],s),this.inputEle.removeAttribute(e[i]))}},b.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),P.addClass([this.inputWrapper],r),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?P.addClass([this.inputEle],u):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&P.addClass([this.chipWrapper],C))},b.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox||"Box"!==this.mode&&("Default"!==this.mode||!this.inputFocus))},b.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:Et,attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:It}),this.selectAllSpan.textContent="";var t=P.closest(this.element,".e-bigger"),t=P.isNullOrUndefined(t)?"":"e-small";this.checkBoxElement=H.createCheckBox(this.createElement,!0,{cssClass:t}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),P.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},b.prototype.clickHandler=function(t){var e=t.currentTarget&&t.currentTarget.classList.contains(Et)?t.currentTarget.firstElementChild.lastElementChild:t.target;this.checkWrapper=P.closest(e,"."+At),P.isNullOrUndefined(this.checkWrapper)||(this.isClicked=!0,e=P.select("."+wt,this.checkWrapper),this.changeState(this.checkWrapper,e.classList.contains(Ot)?"uncheck":"check",t),this.isClicked=!1),t.preventDefault()},b.prototype.changeState=function(t,e,i){var s,l=t.getElementsByClassName(wt)[0];"check"!==e||l.classList.contains(Ot)?"uncheck"===e&&l.classList.contains(Ot)&&(l.classList.remove(Ot),s="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!1)):(l.classList.add(Ot),s="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),P.isNullOrUndefined(s="check"===e?"true":"false")||t.parentElement.setAttribute("aria-checked",s)},b.prototype.setLocale=function(t){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var e=t?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=P.compile(e)({},this,t?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else this.selectAllSpan.textContent=t?this.unSelectAllText:this.selectAllText},b.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var t=this.element.getAttribute("id");this.hiddenElement.id=t+"_hidden",this.inputWrapper.setAttribute("tabindex",this.inputWrapper.classList.contains("e-disabled")?"-1":"0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),P.attributes(this.inputWrapper,this.getAriaAttributes())},b.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];"class"===i?this.inputWrapper.classList.add(this.htmlAttributes[""+i]):"disabled"===i?(this.setProperties({enabled:!1},!0),this.setEnable()):"readonly"===i?(this.setProperties({readonly:!0},!0),this.dataBind()):"style"===i?this.inputWrapper.setAttribute("style",this.htmlAttributes[""+i]):0===i.indexOf("data")||-1<["name","required"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(i)&&"placeholder"===i?h.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}},b.prototype.updateDataAttribute=function(){for(var t=this.htmlAttributes,e=["class","style","id","type"],i={},s=0;s<this.element.attributes.length;s++)-1===e.indexOf(this.element.attributes[s].name)&&"readonly"!==this.element.attributes[s].name&&(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));P.extend(i,t,i),this.setProperties({htmlAttributes:i},!0)},b.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(P.removeClass([this.overAllClear],C),P.addClass([this.inputWrapper],ut)):(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ut)))},b.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var t=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var e=this.value.length-1;0<=e;e--)t=this.treeObj.getTreeData(this.value[e])[0],P.isNullOrUndefined(t)&&this.value.splice(e,1);0!==this.value.length&&this.setValidValue()}else t=this.treeObj.getTreeData(this.value[0])[0],P.isNullOrUndefined(t)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:t[this.fields.text]},!0),this.setValidValue())}},b.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var t=void 0,e=[];if(this.showCheckBox||this.allowMultiSelection){for(var i=this.text.split(this.delimiterChar),s=0;s<i.length;s++)t=this.getItems(i[s]),P.isNullOrUndefined(t)||e.push(t[this.fields.value].toString());0!==e.length?(this.setOldValue(),this.setProperties({value:e},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else t=this.getItems(this.text),P.isNullOrUndefined(t)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[t[this.fields.value].toString()]},!0),this.setValidValue())}},b.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),0<this.treeObj.selectedNodes.length&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&0<this.treeObj.checkedNodes.length&&(this.setProperties({value:this.treeObj.checkedNodes},!0),P.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},b.prototype.setValueTemplate=function(){var t,e=this;this.valueTemplate&&(t=this.initializeValueTemplate(),this.getValueTemplateElement(this.value[0],t),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),this.showOrHideValueTemplate(!0))},b.prototype.getValueTemplateElement=function(t,e){e=e(this.getNodeData(t,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);e&&(e=Array.prototype.slice.call(e),P.append(e,this.valueTemplateContainer))},b.prototype.setValidValue=function(){var t,e=this;this.showCheckBox||this.allowMultiSelection?(this.showCheckBox?(this.value.length!==this.treeObj.checkedNodes.length||0<this.value.filter(function(t){return-1===e.treeObj.checkedNodes.indexOf(t)}).length||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind()):(h.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate(),t=this.value[0].toString(),this.treeObj.selectedNodes[0]!==t&&(P.setValue("selectedNodes",[t],this.treeObj),this.fields.dataSource instanceof c.DataManager)&&this.updateSelectedValues()),this.currentText=this.text,this.currentValue=this.value,!P.isNullOrUndefined(this.value)&&0<this.value.length&&!P.isNullOrUndefined(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},b.prototype.getItems=function(t){var e;if(1===this.treeDataType)for(var i=0;i<this.treeItems.length;i++){var s=P.getValue(this.fields.text,this.treeItems[parseInt(i.toString(),10)]);if(!P.isNullOrUndefined(this.treeItems[i])&&!P.isNullOrUndefined(s)&&s===t){e=this.treeItems[i];break}}else e=this.getNestedItems(this.treeItems,this.fields,t);return e},b.prototype.getNestedItems=function(t,e,i){for(var s=0,l=t.length;s<l;s++){var n=P.getValue(this.fields.text,t[parseInt(s.toString(),10)]);if(t[s]&&n&&n.toString()===i)return t[s];if("string"!=typeof e.child||P.isNullOrUndefined(P.getValue(e.child,t[s]))){if(this.fields.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(P.getValue("child",t[s])))if(void 0!==(a=this.getNestedItems(P.getValue("child",t[parseInt(s.toString(),10)]),this.getChildType(e),i)))break}else{var a,n=P.getValue(e.child,t[parseInt(s.toString(),10)]);if(void 0!==(a=this.getNestedItems(n,this.getChildType(e),i)))break}}return a},b.prototype.getChildType=function(t){return"string"==typeof t.child||P.isNullOrUndefined(t.child)?t:t.child},b.prototype.renderTree=function(){this.treeObj=new F.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren}),this.treeObj.root=this.root||this,this.treeObj.appendTo(this.tree)},b.prototype.renderPopup=function(){var s=this,l=(this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1)),!1);this.trigger("beforeOpen",{cancel:!1},function(t){var e,i;t.cancel?l=!0:(P.addClass([s.inputWrapper],[mt]),s.isFirstRender?(s.popupEle=s.createElement("div",{id:s.element.id+"_options",className:"e-ddt e-popup "+(null!=s.cssClass?s.cssClass:"")}),s.popupEle.setAttribute("role","region"),s.popupEle.setAttribute("aria-label",s.element.id),document.body.appendChild(s.popupEle),s.createPopup(s.popupEle)):(s.popupEle=s.popupObj.element,s.isReact&&s.isFilterRestore&&(s.treeObj.refresh(),s.isFilteredData=!0,s.popupEle.removeChild(s.filterContainer)))),(s.isFirstRender&&!l||s.isFilteredData)&&(s.isFilteredData=!1,P.prepend([s.popupDiv],s.popupEle),P.removeClass([s.popupDiv],yt),s.allowFiltering&&s.renderFilter(),s.showCheckBox&&s.showSelectAll&&!s.popupDiv.classList.contains(Bt)&&(s.createSelectAllWrapper(),s.popupEle.insertBefore(s.checkAllParent,s.popupDiv)),s.headerTemplate&&s.setHeaderTemplate(),s.footerTemplate&&s.setFooterTemplate(),s.isFirstRender=!1,s.hasTemplate)&&s.portals&&(s.treeObj.portals&&(s.portals=s.portals.concat(s.treeObj.portals.filter(function(t){return!s.portals.includes(t)}))),s.isReact)&&s.renderReactTemplates(s.reactCallBack),l||(P.attributes(s.inputEle,{"aria-expanded":"true"}),s.popupObj.show(null,1e3===s.zIndex?s.inputEle:null),P.removeClass([s.popupEle],yt),s.updatePopupHeight(),s.popupObj.refreshPosition(),!s.showSelectAll&&!s.allowFiltering&&!s.popupDiv.classList.contains(Bt)&&0<s.treeItems.length&&((i=null!=s.value&&null!=s.text?s.treeObj.element.querySelector('[data-uid="'+s.value[0]+'"]'):null)?(s.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),i.setAttribute("tabindex","0")):(e=s.treeObj.element.querySelector(".e-node-focus"),i=s.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||s.treeObj.element.querySelector("li:not(.e-disable)"),s.removeFocus(i,e)),s.updateFocus(i)),0<s.treeObj.checkedNodes.length&&!s.isFilterRestore&&(t=s.treeObj.element.querySelectorAll("li"),s.treeObj.element.querySelectorAll("li[aria-checked=true]").length===t.length)&&s.checkBoxElement&&(t=P.closest(s.checkBoxElement,"."+At),s.changeState(t,"check"),s.checkSelectAll=!1),s.showSelectAll&&!s.allowFiltering&&(e=s.treeObj.element.querySelector(".e-node-focus"),i=s.popupEle.querySelector(".e-selectall-parent"),s.removeFocus(i,e),s.updateFocus(i)),s.allowFiltering&&(i=s.treeObj.element.querySelector("li.e-node-focus"),P.isNullOrUndefined(i)||P.removeClass([i],"e-node-focus"),P.removeClass([s.inputWrapper],[dt]),s.filterObj.element.focus()),t={popup:s.popupObj},s.trigger("open",t))})},b.prototype.removeFocus=function(t,e){e&&e!==t&&(e.setAttribute("tabindex","-1"),P.removeClass([e],"e-node-focus"))},b.prototype.updateFocus=function(t){P.isNullOrUndefined(t)||(t.focus(),P.addClass([t],["e-node-focus"]))},b.prototype.reactCallBack=function(){P.isNullOrUndefined(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},b.prototype.updatePopupHeight=function(){var t,e;this.isFirstRender||(t=this.getHeight(),this.popupEle.style.maxHeight=t,this.allowFiltering&&(e=Math.round(this.filterContainer.getBoundingClientRect().height),t=P.formatUnit(parseInt(t,10)-e+"px")),this.headerTemplate&&(e=Math.round(this.header.getBoundingClientRect().height),t=P.formatUnit(parseInt(t,10)-e+"px")),this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains(Bt)&&(e=Math.round(this.checkAllParent.getBoundingClientRect().height),t=P.formatUnit(parseInt(t,10)-e+"px")),this.footerTemplate&&(e=Math.round(this.footer.getBoundingClientRect().height),t=P.formatUnit(parseInt(t,10)-e+"px")),e=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10),e+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),t=P.formatUnit(parseInt(t,10)-e+"px"),this.popupDiv.style.maxHeight=t)},b.prototype.createPopup=function(t){var e=this;this.isFirstRender&&(this.popupObj=new o.Popup(t,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){e.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",e.documentClickContext),e.isPopupOpen=!0},targetExitViewport:function(){P.Browser.isDevice||e.hidePopup()}}))},b.prototype.setElementWidth=function(t){var e=this.inputWrapper;P.isNullOrUndefined(t)||("number"==typeof t?e.style.width=P.formatUnit(t):"string"==typeof t&&(e.style.width=t.match(/px|%|em/)?t:P.formatUnit(t)))},b.prototype.setWidth=function(){var t=P.formatUnit(this.popupWidth);return-1<t.indexOf("%")?t=(this.inputWrapper.offsetWidth*parseFloat(t)/100).toString()+"px":"string"==typeof this.popupWidth&&(t=this.popupWidth.match(/px|em/)?this.popupWidth:t),t},b.prototype.getHeight=function(){var t=P.formatUnit(this.popupHeight);return-1<t.indexOf("%")?t=(document.documentElement.clientHeight*parseFloat(t)/100).toString()+"px":"string"==typeof this.popupHeight&&(t=this.popupHeight.match(/px|em/)?this.popupHeight:t),t},b.prototype.onDocumentClick=function(t){var e=t.target,i=P.closest(e,"."+Ct),s=P.closest(e,"."+Dt),l=P.closest(e,"."+Lt),n=P.closest(e,"."+Nt),a=!!e.classList.contains(bt)||P.matches(e,".e-ddt .e-popup")||P.matches(e,".e-ddt .e-treeview");this.isPopupOpen&&(!P.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.contains(e)||i||a||l||n)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&e.classList.contains(gt)||this.isPopupOpen&&(e.classList.contains(Et)||e.classList.contains(It)||e.classList.contains(wt)))?(this.isDocumentClick=!1,t.preventDefault()):P.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.contains(e)||!this.inputFocus||s||this.focusOut(t)},b.prototype.onActionFailure=function(t){this.trigger("actionFailure",t),this.l10nUpdate(!0),P.addClass([this.popupDiv],Bt)},b.prototype.OnDataBound=function(t){this.treeItems=t.data,this.treeItems.length<=0?(this.l10nUpdate(),P.addClass([this.popupDiv],Bt),this.hideCheckAll(!0)):this.popupDiv.classList.contains(Bt)&&1<=this.treeItems.length&&(P.removeClass([this.popupDiv],Bt),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);t={data:t.data};this.trigger("dataBound",t),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},b.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value||[]:this.treeObj.selectedNodes=this.value||[]},b.prototype.setCssClass=function(t,e){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];P.isNullOrUndefined(e)||""===e||P.removeClass(i,e.split(" ")),P.isNullOrUndefined(t)||""===t||P.addClass(i,t.split(" "))},b.prototype.setEnableRTL=function(t){t?this.inputWrapper.classList.add(ot):this.inputWrapper.classList.remove(ot),this.popupObj&&(this.popupObj.enableRtl=t,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=t,this.treeObj.dataBind())},b.prototype.setEnable=function(){h.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(P.removeClass([this.inputWrapper],St),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),P.addClass([this.inputWrapper],St),this.inputWrapper&&this.inputWrapper.classList.contains(dt)&&P.removeClass([this.inputWrapper],[dt]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},b.prototype.cloneFields=function(t){return{dataSource:t.dataSource,value:t.value,text:t.text,parentValue:t.parentValue,child:this.cloneChildField(t.child),hasChildren:t.hasChildren,expanded:t.expanded,iconCss:t.iconCss,imageUrl:t.imageUrl,htmlAttributes:t.htmlAttributes,query:t.query,selected:t.selected,selectable:t.selectable,tableName:t.tableName,tooltip:t.tooltip}},b.prototype.cloneChildField=function(t){return"string"==typeof t?t:{dataSource:t.dataSource,value:t.value,text:t.text,parentValue:t.parentValue,child:t.child?this.cloneChildField(t.child):null,hasChildren:t.hasChildren,expanded:t.expanded,iconCss:t.iconCss,imageUrl:t.imageUrl,htmlAttributes:t.htmlAttributes,query:t.query,selected:t.selected,selectable:t.selectable,tableName:t.tableName,tooltip:t.tooltip}},b.prototype.getTreeFields=function(t){return{dataSource:t.dataSource,id:t.value,text:t.text,parentID:t.parentValue,child:this.getTreeChildren(t.child),hasChildren:t.hasChildren,expanded:t.expanded,iconCss:t.iconCss,imageUrl:t.imageUrl,isChecked:t.selected,htmlAttributes:t.htmlAttributes,query:t.query,selectable:t.selectable,selected:t.selected,tableName:t.tableName,tooltip:t.tooltip}},b.prototype.getTreeChildren=function(t){var e;return"string"==typeof t?t:P.isNullOrUndefined(t)?null:(e=t=this.getActualProperties(t),t.value&&(e.id=t.value),t.parentValue&&(e.parentID=t.parentValue),t.child&&(e.child=this.getTreeChildren(t.child)),t.selected&&this.showCheckBox&&(e.isChecked=t.selected),e)},b.prototype.getTreeDataType=function(t,e){if(this.fields.dataSource instanceof c.DataManager){for(var i=0;i<t.length;i++)if("string"==typeof e.child&&P.isNullOrUndefined(P.getValue(e.child,t[i])))return 1;return 2}P.isNullOrUndefined(this.fields.dataSource)&&(this.fields.dataSource=[]);for(var i=0,s=this.fields.dataSource.length;i<s;i++){if("string"==typeof e.child&&!P.isNullOrUndefined(P.getValue(e.child,this.fields.dataSource[i])))return 2;if(!P.isNullOrUndefined(P.getValue(e.parentValue,this.fields.dataSource[i]))||!P.isNullOrUndefined(P.getValue(e.hasChildren,this.fields.dataSource[i])))return 1}return 1},b.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.setProperties({value:this.oldValue},!0),this.treeObj.dataBind(),this.updateValue(this.value)},b.prototype.getEventArgs=function(t){var e,i=t.data,s=t.nodeData;return this.showCheckBox&&("check"===t.action?e="select":"uncheck"===t.action&&(e="un-select")),{action:this.showCheckBox?e:t.action,isInteracted:!!this.isClicked||t.isInteracted,item:t.node,itemData:this.showCheckBox?i[0]:s}},b.prototype.onBeforeSelect=function(t){t.isInteracted&&(this.setOldValue(),null===this.value)&&this.setProperties({value:[]},!0)},b.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},b.prototype.onNodeSelected=function(t){var e,i;this.showCheckBox||(i=this.getEventArgs(t),this.trigger("select",i),t.isInteracted&&(i=P.getValue("id",t.nodeData).toString(),this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[i]},!0),e=this.itemTemplate?P.getValue("text",this.treeObj.getNode(i)):P.getValue("text",t.nodeData).toString(),h.Input.setValue(e,this.inputEle,this.floatLabelType),this.setProperties({text:e},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!P.isNullOrUndefined(this.value)&&0<this.value.length&&this.inputWrapper.setAttribute("aria-label",t.nodeData.text.toString()),P.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),P.attributes(this.inputWrapper,{"aria-activedescendant":i.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1))},b.prototype.onNodeClicked=function(t){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(t.event),this.isNodeSelected=!1);var e=t.event.target;(e.classList.contains("e-fullrow")||e.classList.contains("e-list-text"))&&this.showCheckBox&&(this.isClicked=!0,"true"===this.treeObj.getNode(t.node).isChecked?this.treeObj.uncheckAll([t.node]):this.treeObj.checkAll([t.node]),this.isClicked=!1,this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(t.event)},b.prototype.onNodeChecked=function(t){var e,i,s=this.getEventArgs(t);this.trigger("select",s),this.isFilteredData&&"uncheck"===t.action&&(s=P.getValue("id",t.data[0]).toString(),this.removeSelectedData(s,!0)),(!this.isChipDelete&&t.isInteracted||!this.isFilteredData&&"check"===t.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement&&(s=this.treeObj.element.querySelectorAll("li"),e=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),(i=P.closest(this.checkBoxElement,"."+At))&&"uncheck"===t.action&&(t.isInteracted||0===e.length||!P.isNullOrUndefined(t.data[0])&&"false"===t.data[0].isChecked)||!t.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(i,"uncheck"),this.isReverseUpdate=!1):i&&"check"===t.action&&e.length===s.length&&(t.isInteracted||this.isCheckAllCalled||!P.isNullOrUndefined(t.data[0])&&"true"===t.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(i,"check"),this.isReverseUpdate=!1)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},b.prototype.beforeCheck=function(t){t.isInteracted&&this.setOldValue()},b.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var t=0;t<this.treeObj.portals.length;t++)-1===this.portals.indexOf(this.treeObj.portals[t])&&this.portals.push(this.treeObj.portals[t]);this.renderReactTemplates()}},b.prototype.updateClearButton=function(t){if(t?this.inputWrapper.contains(this.overAllClear)?(P.removeClass([this.overAllClear],C),P.addClass([this.inputWrapper],ut)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ut)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var e=P.selectAll("."+gt,this.chipWrapper),i=0;i<e.length;i++)t?P.removeClass([e[i]],C):P.addClass([e[i]],C)},b.prototype.updateDropDownIconState=function(t){var e=P.select("."+kt,this.inputWrapper);t?(e?P.removeClass([e],C):h.Input.appendSpan(ht,this.inputWrapper,this.createElement),P.addClass([this.inputWrapper],pt)):(P.addClass([e],C),P.removeClass([this.inputWrapper],pt))},b.prototype.updateMode=function(){var t,e;"Custom"!==this.mode&&("Delimiter"!==this.mode?(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),t=this.getValidMode(),this.chipWrapper.classList.contains(C)&&t?(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0),P.addClass([this.inputWrapper],r)):t||(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),this.showOrHideValueTemplate(!0)),e=null!==this.value&&0!==this.value.length,t&&e?P.addClass([this.inputEle],u):P.removeClass([this.inputEle],u)):this.inputEle.classList.contains(u)&&(P.removeClass([this.inputEle],u),this.chipWrapper)&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),this.showOrHideValueTemplate(!0)))},b.prototype.ensurePlaceHolder=function(){(P.isNullOrUndefined(this.value)||null!==this.value&&0===this.value.length)&&(P.removeClass([this.inputEle],u),this.chipWrapper)&&(P.addClass([this.chipWrapper],C),this.showOrHideValueTemplate(!0))},b.prototype.ensureClearIconPosition=function(t){"Never"!==t&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},b.prototype.setMultiSelectValue=function(t){var e=this;if(this.isFilteredData){for(var i=(i=P.isNullOrUndefined(this.value)?[]:this.value).filter(function(t){t=e.treeObj.getTreeData(t);return!Array.isArray(t)||t.every(function(t){return t.selected})}),s=0;s<t.length;s++)!P.isNullOrUndefined(this.value)&&-1!==this.value.indexOf(t[s])||i.push(t[s]);this.setProperties({value:i},!0)}else this.setProperties({value:this.isFromFilterChange&&t&&0===t.length?this.value:t},!0),this.isFromFilterChange=!1,!t||0===t.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},b.prototype.setMultiSelect=function(){this.showCheckBox&&!this.isDynamicChange?this.setMultiSelectValue(this.treeObj.checkedNodes.slice()):(t=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null,this.setMultiSelectValue(t),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())),this.selectedText=[];var t=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!t&&(P.removeClass([this.inputEle],u),P.detach(this.chipWrapper));this.getValidMode()&&null!==this.value&&(P.addClass([this.inputEle],u),this.chipWrapper)&&(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0));t=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!t&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputEle],u),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},b.prototype.getSelectedData=function(t){var e=null;if(this.isFilteredData)for(var i=0;i<this.selectedData.length;i++)if(P.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[i]).toString()===t){e=this.selectedData[i];break}return P.isNullOrUndefined(e)&&(e=this.treeSettings.loadOnDemand?this.getNodeData(t,this.treeItems):this.treeObj.getNode(t),P.isNullOrUndefined(e)||this.selectedData.push(e)),e},b.prototype.getNodeData=function(t,e){if(!P.isNullOrUndefined(t)){if(1!==this.treeDataType)return this.getChildNodeData(e,this.fields,t);for(var i=0,s=e.length;i<s;i++){var l=P.getValue(this.fields.value,e[i]);if(!P.isNullOrUndefined(e[i])&&!P.isNullOrUndefined(l)&&l.toString()===t)return e[i]}}},b.prototype.getChildNodeData=function(t,e,i){if(!P.isNullOrUndefined(t))for(var s=0,l=t.length;s<l;s++){var n=P.getValue(e.value,t[s]);if(t[s]&&n&&n.toString()===i)return t[s];if("string"!=typeof e.child||P.isNullOrUndefined(P.getValue(e.child,t[s]))){if(this.fields.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(P.getValue("child",t[s])))if(void 0!==(a=this.getChildNodeData(P.getValue("child",t[s]),this.getChildMapperFields(e),i)))break}else{var a,n=P.getValue(e.child,t[s]);if(void 0!==(a=this.getChildNodeData(n,this.getChildMapperFields(e),i)))break}}return a},b.prototype.getChildMapperFields=function(t){return"string"==typeof t.child||P.isNullOrUndefined(t.child)?t:t.child},b.prototype.removeSelectedData=function(t,e){var i=P.isNullOrUndefined(this.value)?[]:this.value.slice();i.splice(i.indexOf(t),1),this.setProperties({value:i},e);for(var s=0;s<this.selectedData.length;s++)if(P.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===t){this.selectedData.splice(s,1);break}},b.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);else this.valueTemplateContainer=this.createElement("span",{className:Vt+" "+Pt+" e-input-value "+C});return this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},b.prototype.showOrHideValueTemplate=function(t,e){void 0===e&&(e=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(t?(P.removeClass([this.valueTemplateContainer],C),P.addClass([this.inputWrapper],r),P.addClass([this.inputEle],u)):(P.addClass([this.valueTemplateContainer],C),e||(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u))))},b.prototype.updateSelectedValues=function(){var t,e=this,i=this.dataValue="",s=this.hiddenElement.innerHTML="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!P.isNullOrUndefined(this.value)){for(var l=this.initializeValueTemplate(),n=0,a=this.value.length;n<a;n++)t=this.getSelectedData(this.value[n]),t=P.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",t),this.selectedText.push(t),t=this.selectedText[this.selectedText.length-1],1<this.selectedText.length?(this.dataValue+=this.delimiterChar+" "+t,i+=","+t):(this.dataValue+=t,i+=t),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(t,this.value[n]),s+='<option selected value ="'+this.value[n]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[n],l);this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(t){return!e.portals.includes(t)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),1<=this.selectedText.length&&this.setProperties({text:i},!0),this.hiddenElement.innerHTML=s,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var o=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||o||(this.chipWrapper&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r)),this.showOrHideValueTemplate(!0)),h.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===i?this.setProperties({text:null},!0):this.setProperties({text:i},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!P.isNullOrUndefined(this.value)&&0<this.value.length&&!P.isNullOrUndefined(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},b.prototype.setChipValues=function(t,e){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var e=this.createElement("span",{className:ft,attrs:{"data-value":e}}),i=this.createElement("span",{className:vt}),s=this.createElement("span",{className:gt+" e-icons"});this.enableHtmlSanitizer?i.innerText=P.SanitizeHtmlHelper.sanitize(t):i.innerHTML=t,e.appendChild(i),this.chipCollection.appendChild(e),this.showClearButton&&(e.appendChild(s),P.EventHandler.add(s,"mouseup",this.removeChip,this))},b.prototype.setTagValues=function(){var t,e,i,s;null===this.value||null==this.text||0===this.value.length?this.inputWrapper.contains(this.chipWrapper)&&P.addClass([this.chipWrapper],C):(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(r)||P.addClass([this.inputWrapper],r),t=this.createElement("span",{className:ft}),this.inputEle.classList.contains(u)||P.addClass([this.inputEle],u),this.chipWrapper.classList.contains(C)&&(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0)),e=this.createElement("span",{className:vt}),s=this.customTemplate,i=this.customTemplateId,(s=this.templateComplier(s)({value:this.value,text:this.text},this,"customTemplate",i,this.isStringTemplate,void 0,e))&&(s=Array.prototype.slice.call(s),P.append(s,e)),t.appendChild(e),this.chipCollection.appendChild(t),this.isReact&&this.renderReactTemplates())},b.prototype.setSelectAllWrapper=function(t){this.isFirstRender||(t&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(P.detach(this.checkAllParent),this.checkAllParent=null))},b.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),P.addClass([this.header],Lt));var t=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);t&&(t=Array.prototype.slice.call(t),P.append(t,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent||this.popupDiv)},b.prototype.templateComplier=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?P.compile(document.querySelector(t).innerHTML.trim()):P.compile(t)}catch(t){}return P.compile(t)},b.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),P.addClass([this.footer],Nt));var t=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);t&&(t=Array.prototype.slice.call(t),P.append(t,this.footer)),P.append([this.footer],this.popupEle)},b.prototype.clearAll=function(t){!this.enabled||this.readonly||(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),t&&(this.isClearButtonClick=!0),this.changeOnBlur)||this.triggerChangeEvent(t)},b.prototype.removeChip=function(t){var e,i;this.enabled&&!this.readonly&&(t.target.classList.contains("e-chips-close")&&!this.isPopupOpen&&(t.stopPropagation(),t.preventDefault()),i=(e=t.target.parentElement).getAttribute("data-value"),this.chipCollection&&e&&P.remove(e),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(i,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([i]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(t),this.isChipDelete=!1,this.ensurePlaceHolder())},b.prototype.resetValue=function(t){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(h.Input.setValue(null,this.inputEle,this.floatLabelType),t||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],P.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||t?t&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},b.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},b.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},b.prototype.selectAllItems=function(t){if(this.showCheckBox)t?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=t;else if(this.allowMultiSelection)if(t){for(var e,i=P.selectAll("li",this.treeObj.element),s=[],l=0;l<i.length;l++)e=i[l].getAttribute("data-uid").toString(),s.push(e);this.treeObj.selectedNodes=s}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(t?this.updateView():this.updateOverflowWrapper(!0))},b.prototype.updateTreeSettings=function(t){if("autoCheck"===t)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===t)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===t)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===t&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},b.prototype.updateCheckBoxState=function(t){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=t,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},b.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},b.prototype.l10nUpdate=function(t){var e,i,s;this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate?(s=t?this.actionFailureTemplate:this.noRecordsTemplate,e=t?this.actionFailureTemplateId:this.noRecordsTemplateId,i=t?"actionFailureTemplate":"noRecordsTemplate",(s=this.templateComplier(s)({},this,i,e,this.isStringTemplate,void 0,this.noRecord))&&(s=Array.prototype.slice.call(s),P.append(s,this.noRecord))):(this.l10n=new P.L10n(this.getLocaleName(),{noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"},this.locale),this.noRecord.innerHTML=t?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")),P.addClass([this.noRecord],"e-ddt-nodata"),P.prepend([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},b.prototype.updateRecordTemplate=function(t){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(t),this.hasTemplate)&&this.updateTemplate()},b.prototype.updateOverflowWrapper=function(t){t?this.inputWrapper.contains(this.overFlowWrapper)&&t&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:Vt+" "+C}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},b.prototype.updateMultiSelection=function(t){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=t,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},b.prototype.updateAllowFiltering=function(t){this.isFirstRender||(t?this.renderFilter():this.destroyFilter())},b.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},b.prototype.updateValue=function(t){this.isDynamicChange=!0,P.isNullOrUndefined(t)||0===t.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},b.prototype.updateText=function(t){P.isNullOrUndefined(t)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},b.prototype.updateModelMode=function(){var t;!this.allowMultiSelection&&!this.showCheckBox||(this.wrapText||(t=P.select(".e-overflow:not(.e-input-value)",this.inputWrapper))&&(t.innerHTML=""),this.updateMode(),this.setMultiSelect(),this.wrapText)||!this.value||0===this.value.length||(this.updateOverFlowView(),P.addClass([this.inputEle],u),"Box"===this.mode?P.removeClass([this.overFlowWrapper,this.inputWrapper],Pt):P.addClass([this.overFlowWrapper,this.inputWrapper],Pt))},b.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},b.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"width":this.setElementWidth(t.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":h.Input.setPlaceholder(t.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(t.cssClass,e.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":h.Input.setReadonly(t.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":h.Input.removeFloating(this.inputObj),h.Input.addFloating(this.inputEle,t.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(t.floatLabelType);break;case"showClearButton":this.updateClearButton(t.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(t.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":JSON.stringify(e.value)!==JSON.stringify(t.value)&&(this.oldValue=e.value,this.updateValue(t.value));break;case"text":this.updateText(t.text);break;case"allowMultiSelection":this.updateMultiSelection(t.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&P.detach(this.overFlowWrapper),this.chipWrapper&&P.detach(this.chipWrapper),this.setTagValues()):("Custom"===e.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(t.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(t.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var l=0,n=Object.keys(t.treeSettings);l<n.length;l++){var a=n[l];this.updateTreeSettings(a)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=t.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(t.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=t.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=t.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(P.addClass([this.overFlowWrapper],C),this.chipWrapper&&"Box"===this.mode?P.removeClass([this.chipWrapper],C):(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u)),this.ensurePlaceHolder()):this.updateView()}},b.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},b.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),P.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),h.Input.setValue(null,this.inputEle,this.floatLabelType),P.detach(this.inputWrapper),P.detach(this.popupDiv),P.detach(this.hiddenElement),h.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(u),P.detach(this.inputObj.container),this.inputObj.buttons.length&&P.detach(this.inputObj.buttons[0]),this.inputObj=null;0<this.hiddenElement.options.length;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var t=0,e=P.selectAll(".e-chips-close",this.chipCollection);t<e.length;t++){var i=e[t];P.EventHandler.remove(i,"mouseup",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,jt.prototype.destroy.call(this),this.setProperties({value:[]},!0)},b.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),P.detach(this.filterObj.element),P.detach(this.filterContainer),this.filterObj=null)},b.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),P.detach(this.popupObj.element))},b.prototype.ensureVisible=function(t){this.treeObj.ensureVisible(t)},b.prototype.getData=function(t){return this.treeObj.getTreeData(t)},b.prototype.hidePopup=function(){var t={popup:this.popupObj,cancel:!1};this.trigger("close",t),t.cancel||(this.inputWrapper.classList.remove(mt),this.popupEle&&P.addClass([this.popupEle],yt),P.attributes(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering)&&P.addClass([this.inputWrapper],[dt]),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide)&&(this.isFirstRender=!0,this.destroyPopup()))},b.prototype.selectAll=function(t){this.selectAllItems(t)},b.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},b.prototype.getModuleName=function(){return"dropdowntree"},a([P.Property("The Request Failed")],b.prototype,"actionFailureTemplate",void 0),a([P.Property(!1)],b.prototype,"allowFiltering",void 0),a([P.Property(!1)],b.prototype,"allowMultiSelection",void 0),a([P.Property(!0)],b.prototype,"changeOnBlur",void 0),a([P.Property("")],b.prototype,"cssClass",void 0),a([P.Property("${value.length} item(s) selected")],b.prototype,"customTemplate",void 0),a([P.Property(",")],b.prototype,"delimiterChar",void 0),a([P.Property(!0)],b.prototype,"enabled",void 0),a([P.Complex({},Ft)],b.prototype,"fields",void 0),a([P.Property(null)],b.prototype,"filterBarPlaceholder",void 0),a([P.Property("StartsWith")],b.prototype,"filterType",void 0),a([P.Property("Never")],b.prototype,"floatLabelType",void 0),a([P.Property(null)],b.prototype,"footerTemplate",void 0),a([P.Property(!1)],b.prototype,"ignoreAccent",void 0),a([P.Property(!0)],b.prototype,"ignoreCase",void 0),a([P.Property(null)],b.prototype,"headerTemplate",void 0),a([P.Property({})],b.prototype,"htmlAttributes",void 0),a([P.Property(null)],b.prototype,"itemTemplate",void 0),a([P.Property("Default")],b.prototype,"mode",void 0),a([P.Property("No Records Found")],b.prototype,"noRecordsTemplate",void 0),a([P.Property(null)],b.prototype,"placeholder",void 0),a([P.Property("300px")],b.prototype,"popupHeight",void 0),a([P.Property("100%")],b.prototype,"popupWidth",void 0),a([P.Property(!1)],b.prototype,"readonly",void 0),a([P.Property(!1)],b.prototype,"showSelectAll",void 0),a([P.Property("Select All")],b.prototype,"selectAllText",void 0),a([P.Property(!1)],b.prototype,"showCheckBox",void 0),a([P.Property(!0)],b.prototype,"destroyPopupOnHide",void 0),a([P.Property(!0)],b.prototype,"enableHtmlSanitizer",void 0),a([P.Property(!0)],b.prototype,"showClearButton",void 0),a([P.Property(!0)],b.prototype,"showDropDownIcon",void 0),a([P.Property("None")],b.prototype,"sortOrder",void 0),a([P.Property(null)],b.prototype,"text",void 0),a([P.Complex({},qt)],b.prototype,"treeSettings",void 0),a([P.Property("Unselect All")],b.prototype,"unSelectAllText",void 0),a([P.Property(null)],b.prototype,"value",void 0),a([P.Property(null)],b.prototype,"valueTemplate",void 0),a([P.Property("100%")],b.prototype,"width",void 0),a([P.Property(1e3)],b.prototype,"zIndex",void 0),a([P.Property(!1)],b.prototype,"wrapText",void 0),a([P.Event()],b.prototype,"actionFailure",void 0),a([P.Event()],b.prototype,"beforeOpen",void 0),a([P.Event()],b.prototype,"change",void 0),a([P.Event()],b.prototype,"close",void 0),a([P.Event()],b.prototype,"blur",void 0),a([P.Event()],b.prototype,"created",void 0),a([P.Event()],b.prototype,"dataBound",void 0),a([P.Event()],b.prototype,"destroyed",void 0),a([P.Event()],b.prototype,"filtering",void 0),a([P.Event()],b.prototype,"focus",void 0),a([P.Event()],b.prototype,"keyPress",void 0),a([P.Event()],b.prototype,"open",void 0),a([P.Event()],b.prototype,"select",void 0);var jt,l=a([P.NotifyPropertyChanges],b);function b(t,e){t=jt.call(this,t,e)||this;return t.filterTimer=null,t.isFilteredData=!1,t.isFilterRestore=!1,t.selectedData=[],t.filterDelayTime=300,t.isClicked=!1,t.documentClickContext=t.onDocumentClick.bind(t),t.isCheckAllCalled=!1,t.isFromFilterChange=!1,t}Rt=function(t,e){return(Rt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Rt,S,a=function(t,e){function i(){this.constructor=t}Rt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},E=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},zt="e-atc-spinner-icon",Kt=(f.root="e-combobox",{container:null,buttons:[]}),a=(a(x,S=i),x.prototype.preRender=function(){S.prototype.preRender.call(this)},x.prototype.getLocaleName=function(){return"combo-box"},x.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(P.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),P.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),P.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),P.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),P.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),P.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},x.prototype.preventBlur=function(t){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(f.input)||!P.Browser.isDevice)&&P.Browser.isDevice||t.preventDefault()},x.prototype.onBlurHandler=function(t){var e=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;P.isNullOrUndefined(this.listData)||P.isNullOrUndefined(e)||e===this.text||this.customValue(t),S.prototype.onBlurHandler.call(this,t)},x.prototype.targetElement=function(){return this.inputElement},x.prototype.setOldText=function(t){h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},x.prototype.setOldValue=function(t){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},x.prototype.valueMuteChange=function(t){t=this.allowObjectBinding&&!P.isNullOrUndefined(t)?P.getValue(this.fields.value||"",t):t;var e,i,s,l=P.isNullOrUndefined(t)?null:t.toString(),l=(h.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),{}),n=(this.allowObjectBinding&&(t=this.getDataByValue(t),P.isNullOrUndefined(t))&&(e=this.fields,s=i=!1,this.allowObjectBinding&&((n=Object.keys(this.value)).forEach(function(t){t===e.value&&(s=!0)}),n.forEach(function(t){t===e.text&&(i=!0)})),l={text:s?i?P.getValue(e.text,this.value):P.getValue(e.value,this.value):null,value:s?this.value:null,index:null}),this.allowObjectBinding?this.setProperties(l,!0):this.setProperties({value:t,text:t&&t.toString(),index:null},!0),this.activeIndex=this.index,this.fields),l={};l[n.text]=P.isNullOrUndefined(t)?null:t.toString(),l[n.value]=P.isNullOrUndefined(t)?null:t.toString(),this.itemData=l,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},x.prototype.updateValues=function(){var t,e,i,s,l,n,a;this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),P.isNullOrUndefined(this.value)?this.text&&P.isNullOrUndefined(this.value)?(t=this.getElementByText(this.text))?this.setSelection(t,null):(h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue()):this.setSelection(this.liCollections[this.activeIndex],null):(s=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,t=this.getElementByValue(s),s=!P.isNullOrUndefined(t),this.enableVirtualization&&this.value&&(e=this.fields.value||"",i=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.dataSource instanceof c.DataManager?(l=new c.DataManager(this.virtualGroupDataSource).executeLocal((new c.Query).where(new c.Predicate(e,"equal",i))))&&0<l.length&&(this.itemData=l[0],s=!0,n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:a}):(l=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(new c.Predicate(e,"equal",i))))&&0<l.length&&(this.itemData=l[0],s=!0,n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:a})),t?this.setSelection(t,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!s?this.valueMuteChange(this.value):this.enableVirtualization&&(!this.enableVirtualization||s)||this.valueMuteChange(null)),this.setHiddenValue(),h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},x.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?P.removeClass([this.inputWrapper.clearButton],f.clearIconHide):P.addClass([this.inputWrapper.clearButton],f.clearIconHide))},x.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},x.prototype.searchLists=function(t){this.isTyped=!0,this.isFiltering()?(S.prototype.searchLists.call(this,t),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+f.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+f.li)),this.incrementalSearch(t))},x.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},x.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:Kt},x.prototype.onActionComplete=function(t,e,i,s){var l=this;S.prototype.onActionComplete.call(this,t,e,i),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout(function(){l.inlineSearch()})},x.prototype.getFocusElement=function(){var t=this.isSelectCustom?{text:""}:this.getItemData(),e=P.isNullOrUndefined(this.list)?this.list:this.list.querySelector("."+f.selected);if(t.text&&t.text.toString()===this.inputElement.value&&!P.isNullOrUndefined(e))return e;if((P.Browser.isDevice&&!this.isDropDownClick||!P.Browser.isDevice)&&!P.isNullOrUndefined(this.liCollections)&&0<this.liCollections.length){var i=this.inputElement.value,s=this.sortedData,l=this.typeOfData(s).typeof,n=d(i,this.liCollections,this.filterType,!0,s,this.fields,l,this.ignoreAccent);if(this.enableVirtualization&&""!==i&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var a=!1,t=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,e=0===this.incrementalEndIndex;for((t||e)&&(a=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=e?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0),0===this.viewPortInfo.startIndex&&!a||this.updateIncrementalView(0,this.itemCount),n=d(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l);P.isNullOrUndefined(n.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0,0===this.viewPortInfo.startIndex&&!a||this.updateIncrementalView(0,this.itemCount),n=d(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l),!P.isNullOrUndefined(n)){n.index=n.index+this.incrementalStartIndex;break}if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}}t=0<n.index-(this.itemCount/2-2)?n.index-(this.itemCount/2-2):0,e=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;t!==this.viewPortInfo.startIndex&&this.updateIncrementalView(t,e),P.isNullOrUndefined(n.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(t=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,e=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(t,e),n.item=this.getElementByValue(n.item.getAttribute("data-value"))),n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}var o,r,h,u,p,t=n.item;return P.isNullOrUndefined(t)?this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0)):(e=this.getIndexByValue(t.getAttribute("data-value"))-1,o=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10),isNaN(o)||"autocomplete"===this.getModuleName()||(this.removeFocus(),r=this.fields.groupBy?this.liCollections[0].offsetHeight:0,this.enableVirtualization?(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(u=t.offsetTop+(this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0)*(h=t.offsetHeight),p=this.list.querySelectorAll(".e-virtual-list").length,this.list.scrollTop=u-p*h)):this.list.scrollTop=e*o+r,P.addClass([t],f.focus))),t}return null},x.prototype.setValue=function(t){return(t&&"keydown"===t.type&&"enter"===t.action||t&&"click"===t.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&t&&"keydown"===t.type&&"enter"!==t.action?(this.preventAutoFill=!1,this.inlineSearch(t),!1):S.prototype.setValue.call(this,t)},x.prototype.checkCustomValue=function(){var t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,t=(this.itemData=this.getDataByValue(t),this.getItemData()),e=this.allowObjectBinding?this.itemData:t.value;this.allowCustom&&P.isNullOrUndefined(t.value)&&P.isNullOrUndefined(t.text)||this.setProperties({value:e},!this.allowCustom)},x.prototype.showSpinner=function(){P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||h.Input.appendSpan("e-input-group-icon "+zt,this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,P.addClass([this.spinnerElement],f.disableIcon),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement))},x.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],f.disableIcon),this.spinnerElement.classList.contains(zt)?P.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},x.prototype.setAutoFill=function(t,e){var i,s;e||this.setHoverList(t),this.autofill&&!this.preventAutoFill&&(i=this.getTextByValue(t.getAttribute("data-value")).toString(),s=this.getFormattedValue(t.getAttribute("data-value")),"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(t,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(t.getAttribute("data-value"))):this.getFormattedValue(t.getAttribute("data-value"))):this.updateSelectedItem(t,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,e))},x.prototype.isAndroidAutoFill=function(t){var e,i,s,l;return!!P.Browser.isAndroid&&(l=this.getSelectionPoints(),e=this.prevSelectPoints.end,i=l.end,s=this.prevSelectPoints.start,l=l.start,0!==e)&&(e===t.length&&s===t.length||l<s&&i<e||e===i&&s===l)},x.prototype.clearAll=function(t,e){(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e)&&P.isNullOrUndefined(e.dataSource))&&S.prototype.clearAll.call(this,t),this.isFiltering()&&!P.isNullOrUndefined(t)&&t.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(t))},x.prototype.isSelectFocusItem=function(t){return!P.isNullOrUndefined(t)},x.prototype.inlineSearch=function(t){var e,t=t&&("down"===t.action||"up"===t.action||"home"===t.action||"end"===t.action||"pageUp"===t.action||"pageDown"===t.action),i=t?this.liCollections[this.activeIndex]:this.getFocusElement();P.isNullOrUndefined(i)?P.isNullOrUndefined(this.inputElement)||""!==this.inputElement.value?(this.activeIndex=null,this.removeSelection(),this.liCollections&&0<this.liCollections.length&&!this.isCustomFilter&&this.removeFocus()):(this.activeIndex=null,P.isNullOrUndefined(this.list)||(this.enableVirtualization||(this.list.scrollTop=0),e=this.list.querySelector("."+f.li),this.setHoverList(e))):(t||(e=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(e),this.activeIndex=P.isNullOrUndefined(this.activeIndex)?null:this.activeIndex),this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(i,t))},x.prototype.incrementalSearch=function(t){this.showPopup(t),P.isNullOrUndefined(this.listData)||(this.inlineSearch(t),t.preventDefault())},x.prototype.setAutoFillSelection=function(t,e){void 0===e&&(e=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);s&&s.toLowerCase()===t.substr(0,i.start).toLowerCase()?(s=s+t.substr(s.length,t.length),h.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)):e&&(h.Input.setValue(t,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},x.prototype.getValueByText=function(t){return S.prototype.getValueByText.call(this,t,!0,this.ignoreAccent)},x.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(P.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),P.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(P.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),P.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),P.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),P.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},x.prototype.setSelection=function(t,e){S.prototype.setSelection.call(this,t,e),P.isNullOrUndefined(t)||this.autofill||this.isDropDownClick||this.removeFocus()},x.prototype.selectCurrentItem=function(t){var e;if(this.isPopupOpen){if(e=this.isSelected?this.list.querySelector("."+f.selected):this.list.querySelector("."+f.focus),this.isDisabledElement(e))return;e&&(this.setSelection(e,t),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(t))}"enter"===t.action&&""===this.inputElement.value?this.clearAll(t):this.isTyped&&!this.isSelected&&P.isNullOrUndefined(e)&&this.customValue(t),this.hidePopup(t)},x.prototype.setHoverList=function(t){this.removeSelection(),this.isValidLI(t)&&!t.classList.contains(f.selected)&&(this.removeFocus(),t.classList.add(f.focus))},x.prototype.targetFocus=function(t){P.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(t),h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},x.prototype.dropDownClick=function(t){t.preventDefault(),P.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),S.prototype.dropDownClick.call(this,t)},x.prototype.customValue=function(e){var i,s,t,l,n=this,a=this.getValueByText(this.inputElement.value);this.allowCustom||""===this.inputElement.value?""!==this.inputElement.value?(i=this.value,P.isNullOrUndefined(a)?(t={text:s=""===this.inputElement.value?null:this.inputElement.value,item:{}},this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(s,t,i):this.trigger("customValueSpecifier",t,function(t){n.updateCustomValueCallback(s,t,i,e)})):(this.isSelectCustom=!1,a=this.allowObjectBinding?this.getDataByValue(a):a,this.setProperties({value:a}),(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&i&&this.value&&!this.isObjectInArray(i,[this.value]))&&this.onChangeEvent(e))):this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0):(t=this.previousValue,l=this.value,a=this.allowObjectBinding?this.getDataByValue(a):a,this.setProperties({value:a}),P.isNullOrUndefined(this.value)&&h.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&t===this.value||this.allowObjectBinding&&t&&this.isObjectInArray(t,[this.value]))&&(!this.allowObjectBinding&&l!==this.value||this.allowObjectBinding&&l&&!this.isObjectInArray(l,[this.value]))&&this.onChangeEvent(null))},x.prototype.updateCustomValueCallback=function(t,e,i,s){var l=this,n=this.fields,e=e.item,a={},o=(e&&P.getValue(n.text,e)&&P.getValue(n.value,e)?a=e:(P.setValue(n.text,t,a),P.setValue(n.value,t,a)),this.itemData=a,{}),t=(this.allowObjectBinding&&(e=this.listData&&0<this.listData.length?Object.keys(this.listData[0]):Object.keys(this.itemData),(e=this.listData&&0<this.listData.length||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)?e:this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)).forEach(function(t){o[t]=t===n.value||t===n.text?P.getValue(n.value,l.itemData):null})),{text:P.getValue(n.text,this.itemData),value:this.allowObjectBinding?o:P.getValue(n.value,this.itemData),index:null});this.setProperties(t,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&(null==i&&null!==this.value||i&&!this.isObjectInArray(i,[this.value])))&&this.onChangeEvent(s,!0)},x.prototype.onPropertyChanged=function(t,e){"combobox"===this.getModuleName()&&(this.checkData(t),this.setUpdateInitial(["fields","query","dataSource"],t,e));for(var i=0,s=Object.keys(t);i<s.length;i++){var l=s[i];switch(l){case"readonly":h.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),P.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),P.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&P.isNullOrUndefined(this.list)&&S.prototype.renderList.call(this);break;case"allowCustom":break;default:var n=this.getPropObject(l,t,e);S.prototype.onPropertyChanged.call(this,n.newProperty,n.oldProperty),this.isFiltering()&&"dataSource"===l&&P.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&S.prototype.renderList.call(this)}}},x.prototype.render=function(){S.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},x.prototype.getModuleName=function(){return"combobox"},x.prototype.addItem=function(t,e){S.prototype.addItem.call(this,t,e)},x.prototype.filter=function(t,e,i){S.prototype.filter.call(this,t,e,i)},x.prototype.showPopup=function(t){S.prototype.showPopup.call(this,t)},x.prototype.hidePopup=function(t){var e=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!P.isNullOrUndefined(this.listData)){var i,s=this.isEscapeKey,l=(this.isEscapeKey&&(h.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection(),this.isSelectCustom?{text:""}:this.getItemData()),n=P.isNullOrUndefined(this.list)?null:this.list.querySelector("."+f.selected);if(this.inputElement&&l.text===this.inputElement.value&&!P.isNullOrUndefined(n))return this.isSelected&&(this.onChangeEvent(t),this.isSelectCustom=!1),void S.prototype.hidePopup.call(this,t);"combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()&&(l=this.sortedData,n=this.typeOfData(l).typeof,i=d(this.inputElement.value,this.liCollections,"Equal",!0,l,this.fields,n),this.selectedLI=i.item,P.isNullOrUndefined(i.index)&&(i.index=d(this.inputElement.value,this.liCollections,"StartsWith",!0,l,this.fields,n).index),this.activeIndex=i.index,P.isNullOrUndefined(this.selectedLI)?s&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)),this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(t)}l=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value;P.isNullOrUndefined(this.listData)&&this.allowCustom&&!P.isNullOrUndefined(e)&&e!==l&&this.customValue(),S.prototype.hidePopup.call(this,t)},x.prototype.focusIn=function(){this.enabled&&(P.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),S.prototype.focusIn.call(this))},x.prototype.clear=function(){this.value=null},x.prototype.focusOut=function(t){S.prototype.focusOut.call(this,t)},x.prototype.getItems=function(){return S.prototype.getItems.call(this)},x.prototype.getDataByValue=function(t){return S.prototype.getDataByValue.call(this,t)},E([P.Property(!(x.prototype.renderHightSearch=function(){}))],x.prototype,"autofill",void 0),E([P.Property(!0)],x.prototype,"allowCustom",void 0),E([P.Property({})],x.prototype,"htmlAttributes",void 0),E([P.Property(!1)],x.prototype,"allowFiltering",void 0),E([P.Property(!0)],x.prototype,"isDeviceFullScreen",void 0),E([P.Property(null)],x.prototype,"query",void 0),E([P.Property(null)],x.prototype,"index",void 0),E([P.Property(!0)],x.prototype,"showClearButton",void 0),E([P.Property(!1)],x.prototype,"enableRtl",void 0),E([P.Event()],x.prototype,"customValueSpecifier",void 0),E([P.Event()],x.prototype,"filtering",void 0),E([P.Property(null)],x.prototype,"valueTemplate",void 0),E([P.Property("Never")],x.prototype,"floatLabelType",void 0),E([P.Property(null)],x.prototype,"filterBarPlaceholder",void 0),E([P.Property(null)],x.prototype,"cssClass",void 0),E([P.Property(null)],x.prototype,"headerTemplate",void 0),E([P.Property(null)],x.prototype,"footerTemplate",void 0),E([P.Property(null)],x.prototype,"placeholder",void 0),E([P.Property("100%")],x.prototype,"width",void 0),E([P.Property("300px")],x.prototype,"popupHeight",void 0),E([P.Property("100%")],x.prototype,"popupWidth",void 0),E([P.Property(!1)],x.prototype,"readonly",void 0),E([P.Property(null)],x.prototype,"text",void 0),E([P.Property(null)],x.prototype,"value",void 0),E([P.Property(!1)],x.prototype,"allowObjectBinding",void 0),E([P.NotifyPropertyChanges],x));function x(t,e){return S.call(this,t,e)||this}_t=function(t,e){return(_t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var _t,I,E=function(t,e){function i(){this.constructor=t}_t(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},w=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},E=(f.root="e-autocomplete",f.icon="e-input-group-icon e-ddl-icon e-search-icon",E(O,I=a),O.prototype.preRender=function(){I.prototype.preRender.call(this)},O.prototype.getLocaleName=function(){return"auto-complete"},O.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},O.prototype.getQuery=function(t){var e,i=t?t.clone():this.query?this.query.clone():new c.Query,t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,s=""!==this.queryString||P.isNullOrUndefined(t)?this.filterType:"equal",t=""!==this.queryString||P.isNullOrUndefined(t)?this.queryString:t;if(this.isFiltered)if(this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery))i=this.customFilterQuery.clone();else if(!this.enableVirtualization)return i;if(null!==this.queryString&&""!==this.queryString&&(e=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==e)&&"number"!==e?(e=P.isNullOrUndefined(this.fields.value)?"":this.fields.value,i.where(e,s,t,this.ignoreCase,this.ignoreAccent)):i.where("",s,t,this.ignoreCase,this.ignoreAccent)),!P.isNullOrUndefined(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(var l=0;l<i.queries.length;l++)"onTake"===i.queries[l].fn&&i.queries.splice(l,1);i.take(this.suggestionCount)}if(this.enableVirtualization){var n=0,a=0,o=this.getTakeValue();if(i&&0<i.queries.length)for(l=0;l<i.queries.length;l++)"onSkip"===i.queries[l].fn&&(a=i.queries[l].e.nos),"onTake"===i.queries[l].fn&&(n=o<=i.queries[l].e.nos?i.queries[l].e.nos:o);if(n<=0&&this.query&&0<this.query.queries.length)for(var r,l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=o<=(r=this.query.queries[l].e.nos)?r:o);if(i&&0<i.queries.length)for(var h,l=0;l<i.queries.length;l++)"onSkip"===i.queries[l].fn?(a=i.queries[l].e.nos,i.queries.splice(l,1),--l):"onTake"===i.queries[l].fn&&(n=(h=i.queries[l].e.nos)<=n?n:h,i.queries.splice(l,1),--l);0<a&&this.virtualItemStartIndex<=a?i.skip(a):i.skip(this.virtualItemStartIndex),0<n&&o<=n?i.take(n):i.take(o),i.requiresCount()}return i},O.prototype.searchLists=function(e){var s,l=this;this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.checkAndResetCache(),P.isNullOrUndefined(this.list)&&I.prototype.renderList.call(this,e,!0),this.queryString=this.filterInput.value,"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode?(this.isSelected=!1,this.activeIndex=null,s={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(t,e,i){s.cancel||(l.isFiltered=!0,l.customFilterQuery=e,l.filterAction(t,e,i))},cancel:!1},this.trigger("filtering",s,function(t){t.cancel||l.isFiltered||t.preventDefaultAction||(l.searchList=!0,l.filterAction(l.dataSource,null,l.fields,e))})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields,null,e))},O.prototype.filter=function(t,e,i){this.isFiltered=!0,this.filterAction(t,e,i)},O.prototype.filterAction=function(t,e,i,s){this.beforePopupOpen=!0;var l;this.list.classList.contains("e-nodata");""!==this.queryString&&this.queryString.length>=this.minLength?(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(t,i,e,s),t=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!t&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")&&(l=this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()}),this.list.appendChild(l).appendChild(this.list.querySelector(".e-list-parent"))),!this.list.querySelector(".e-virtual-ddl"))&&this.list.parentElement&&(l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()):(this.hidePopup(s),this.beforePopupOpen=!1),this.renderReactTemplates()},O.prototype.clearAll=function(t,e){(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e)&&P.isNullOrUndefined(e.dataSource))&&(I.prototype.clearAll.call(this,t),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},O.prototype.onActionComplete=function(t,e,i,s){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),I.prototype.onActionComplete.call(this,t,e,i);t=this.list.querySelector("."+f.li);P.isNullOrUndefined(t)||P.removeClass([t],f.focus),P.isNullOrUndefined(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},O.prototype.postBackAction=function(){var t,e,i;this.autofill&&!P.isNullOrUndefined(this.liCollections[0])&&this.searchList&&(i=[this.liCollections[0]],t=this.listData,e=this.typeOfData(t).typeof,i=d(this.inputElement.value,i,"StartsWith",this.ignoreCase,t,this.fields,e),this.searchList=!1,P.isNullOrUndefined(i.item)||I.prototype.setAutoFill.call(this,this.liCollections[0],!0))},O.prototype.setSelection=function(t,e){var i;this.isValidLI(t)?!P.isNullOrUndefined(e)&&"keydown"===e.type&&"enter"!==e.action&&"tab"!==e.action&&this.isValidLI(t)?(i=this.getFormattedValue(t.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i),this.setHoverList(t),this.selectedLI=t,this.setScrollPosition(e),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,i=e&&"down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action,I.prototype.setAutoFill.call(this,t,i))):(I.prototype.setSelection.call(this,t,e),this.isFiltered=!1):this.selectedLI=t},O.prototype.listOption=function(t,e){var i,s=this,t=I.prototype.listOption.call(this,t,e);return P.isNullOrUndefined(t.itemCreated)?t.itemCreated=function(t){s.highlight&&(s.element.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout(function(){K(t.item,s.queryString,s.ignoreCase,s.filterType)},0):K(t.item,s.queryString,s.ignoreCase,s.filterType))}:(i=t.itemCreated,t.itemCreated=function(t){s.highlight&&K(t.item,s.queryString,s.ignoreCase,s.filterType),i.apply(s,[t])}),t},O.prototype.isFiltering=function(){return!0},O.prototype.renderPopup=function(t){this.enableVirtualization||(this.list.scrollTop=0),I.prototype.renderPopup.call(this,t)},O.prototype.isEditTextBox=function(){return!1},O.prototype.isPopupButton=function(){return this.showPopupButton},O.prototype.isSelectFocusItem=function(t){return!1},O.prototype.setInputValue=function(e,t){var i,s,l,n,a=t&&t.text?t.text:t&&t.value,t=e&&e.text?e.text:(e&&e.value?e:this).value;this.allowObjectBinding&&(a=P.isNullOrUndefined(a)?a:P.getValue(this.fields.value||"",a),t=P.isNullOrUndefined(t)?t:P.getValue(this.fields.value||"",t)),!t||""!==this.typedString||this.allowCustom||this.dataSource instanceof c.DataManager?e&&(e.text?this.setOldText(a):this.setOldValue(a)):(i="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,s=this.getItems().length,l=new c.Query,new c.DataManager((n=this).dataSource).executeQuery(l.where(new c.Predicate(i,"equal",t))).then(function(t){0<t.result.length?(n.value=""!==i?n.allowObjectBinding?t.result[0]:t.result[0][n.fields.value].toString():t.result[0].toString(),n.addItem(t.result,s),n.updateValues()):e&&e.text?n.setOldText(a):e&&e.value?n.setOldValue(a):n.updateValues()}))},O.prototype.showPopup=function(t){this.enabled&&(this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.preventAutoFill=!0,P.isNullOrUndefined(this.list)?this.renderList(t):this.resetList(this.dataSource,this.fields,null,t)))},O.prototype.hidePopup=function(t){I.prototype.hidePopup.call(this,t),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},O.prototype.onPropertyChanged=function(t,e){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],t);for(var i=0,s=Object.keys(t);i<s.length;i++){var l,n=s[i];"showPopupButton"===n?this.showPopupButton?(l=h.Input.appendSpan(f.icon,this.inputWrapper.container,this.createElement),this.inputWrapper.buttons[0]=l,h.Input.calculateWidth(this.inputElement,this.inputWrapper.container),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&P.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)):(P.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null):(l=this.getPropObject(n,t,e),I.prototype.onPropertyChanged.call(this,l.newProperty,l.oldProperty))}},O.prototype.renderHightSearch=function(){if(this.highlight)for(var t=0;t<this.liCollections.length;t++)this.ulElement.querySelector(".e-active")||(_(this.liCollections[t]),K(this.liCollections[t],this.queryString,this.ignoreCase,this.filterType)),0},O.prototype.getModuleName=function(){return"autocomplete"},O.prototype.render=function(){I.prototype.render.call(this)},w([P.Complex({value:null,iconCss:null,groupBy:null,disabled:null},tt)],O.prototype,"fields",void 0),w([P.Property(!0)],O.prototype,"ignoreCase",void 0),w([P.Property(!1)],O.prototype,"showPopupButton",void 0),w([P.Property(!1)],O.prototype,"highlight",void 0),w([P.Property(20)],O.prototype,"suggestionCount",void 0),w([P.Property({})],O.prototype,"htmlAttributes",void 0),w([P.Property(null)],O.prototype,"query",void 0),w([P.Property(1)],O.prototype,"minLength",void 0),w([P.Property("Contains")],O.prototype,"filterType",void 0),w([P.Event()],O.prototype,"filtering",void 0),w([P.Property(null)],O.prototype,"index",void 0),w([P.Property("Never")],O.prototype,"floatLabelType",void 0),w([P.Property(null)],O.prototype,"valueTemplate",void 0),w([P.Property(null)],O.prototype,"filterBarPlaceholder",void 0),w([P.Property(!1)],O.prototype,"allowFiltering",void 0),w([P.Property(null)],O.prototype,"text",void 0),w([P.NotifyPropertyChanges],O));function O(t,e){t=I.call(this,t,e)||this;return t.isFiltered=!1,t.searchList=!1,t}var Gt="e-float-line",Qt="e-float-text",Jt="e-label-top",Xt="e-label-bottom";function Yt(t,e,i,s,l,n,a){var o=P.createElement("span",{className:Gt}),r=P.createElement("label",{className:Qt}),h=i.getAttribute("id")?i.getAttribute("id"):P.getUniqueID("ej2_multiselect");i.id=h,P.isNullOrUndefined(i.id)||""===i.id||(r.id="label_"+i.id.replace(/ /g,"_"),r.setAttribute("for",i.id),P.attributes(s,{"aria-labelledby":r.id})),P.isNullOrUndefined(s.placeholder)||""===s.placeholder||(r.innerText=se(s.placeholder),s.removeAttribute("placeholder")),r.innerText=se(a),e.appendChild(o),e.appendChild(r),t.classList.add("e-float-input"),$t(l,r),"Always"===n&&(r.classList.contains(Xt)&&P.removeClass([r],Xt),P.addClass([r],Jt))}function $t(t,e){t&&0<t.length?(P.addClass([e],Jt),P.removeClass([e],Xt)):(P.removeClass([e],Jt),P.addClass([e],Xt))}function Zt(t,e,i,s,l,n,a){var o,r=e.querySelector("."+Qt),e=e.querySelector("."+Gt);P.isNullOrUndefined(r)?te(l,s,o=null!==a?a:""):(o=r.innerText,P.detach(i.querySelector("."+Qt)),te(l,s,o),P.isNullOrUndefined(e)||P.detach(i.querySelector("."+Gt))),t.classList.remove("e-float-input")}function te(t,e,i){t&&t.length?e.placeholder="":e.placeholder=i}function ee(t,e){t.classList.add("e-input-focus");t=e.querySelector("."+Qt);P.isNullOrUndefined(t)||(P.addClass([t],Jt),t.classList.contains(Xt)&&P.removeClass([t],Xt))}function ie(t,e,i,s,l){t.classList.remove("e-input-focus");t=e.querySelector("."+Qt);i&&i.length<=0&&"Auto"===s&&!P.isNullOrUndefined(t)&&(t.classList.contains(Jt)&&P.removeClass([t],Jt),P.addClass([t],Xt))}function se(t){var e,i="";return P.isNullOrUndefined(t)||""===t||((e=document.createElement("span")).innerHTML='<input placeholder="'+t+'"/>',i=e.children[0].placeholder),i}le=function(t,e){return(le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var le,A,w=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},ne="e-input-focus",ae="e-disabled",D="e-hide-listitem",oe="e-chips",re="e-chips-close",he="e-chip-selected",ue="e-delimiter",pe="e-zero-size",de="e-chips-close e-close-hooker",ce="e-delim-values",me="e-close-icon-hide",fe="e-ddl-disable-icon",ve="e-ms-spinner-icon",ge="e-input-group-icon e-ddl-icon",ye="e-icon-anim",Ce="e-delim-total",be="e-search-custom-width",Se="e-input-filter",w=(function(t,e){function i(){this.constructor=t}le(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(k,A=Z),k.prototype.enableRTL=function(t){t?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=t,this.popupObj.dataBind())},k.prototype.requiredModules=function(){var t,e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode&&(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox&&(t=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=t),this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,e.push({member:"CheckBoxSelection",args:[this]})),e},k.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var t=0,e=Object.keys(this.htmlAttributes);t<e.length;t++){var i=e[t];switch(i){case"class":var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&(P.addClass([this.overAllWrapper],s.split(" ")),P.addClass([this.popupWrapper],s.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(i,this.htmlAttributes[""+i]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:-1<["id"].indexOf(i)?this.element.setAttribute(i,this.htmlAttributes[""+i]):0===i.indexOf("data")||-1<["name","required","aria-required","form"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","role","style","class"].indexOf(i)?this.overAllWrapper.setAttribute(i,this.htmlAttributes[""+i]):"size"===i||P.isNullOrUndefined(this.inputElement)||this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}}},k.prototype.updateReadonly=function(t){P.isNullOrUndefined(this.inputElement)||(t||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},k.prototype.updateClearButton=function(t){t?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove(me)):(this.overAllClear.style.display="none",this.componentWrapper.classList.add(me))},k.prototype.updateCssClass=function(){var t;P.isNullOrUndefined(this.cssClass)||""===this.cssClass||(t=this.cssClass,""!==(t=this.cssClass.replace(/\s+/g," ").trim())&&(P.addClass([this.overAllWrapper],t.split(" ")),P.addClass([this.popupWrapper],t.split(" "))))},k.prototype.updateOldPropCssClass=function(t){P.isNullOrUndefined(t)||""===t||""!==(t=t.replace(/\s+/g," ").trim())&&(P.removeClass([this.overAllWrapper],t.split(" ")),P.removeClass([this.popupWrapper],t.split(" ")))},k.prototype.onPopupShown=function(t){var e,i=this,t=(P.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering&&(e=this,window.onpopstate=function(){e.hidePopup(),e.inputElement.focus()},history.pushState({},"")),{popup:this.popupObj,event:t,cancel:!1,animation:{name:"FadeIn",duration:100}});this.trigger("open",t,function(t){t.cancel||(i.focusAtFirstListItem(!0),i.popupObj&&document.body.appendChild(i.popupObj.element),"CheckBox"===i.mode&&i.enableGroupCheckBox&&!P.isNullOrUndefined(i.fields.groupBy)&&i.updateListItems(i.list.querySelectorAll("li.e-list-item"),i.mainList.querySelectorAll("li.e-list-item")),"CheckBox"!==i.mode&&!i.showDropDownIcon||P.addClass([i.overAllWrapper],[ye]),i.refreshPopup(),i.renderReactTemplates(),i.popupObj&&i.popupObj.show(t.animation,1e3===i.zIndex?i.element:null),i.isReact&&setTimeout(function(){var t,e;i.popupHeight&&i.list&&"auto"!==i.popupHeight&&(t="string"==typeof i.popupHeight?parseInt(i.popupHeight,10):i.popupHeight,!i.isUpdateHeaderHeight&&i.headerTemplate&&i.header&&(e=""===i.list.style.maxHeight?t:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(e-i.header.offsetHeight).toString()+"px",i.isUpdateHeaderHeight=!0),!i.isUpdateFooterHeight)&&i.footerTemplate&&i.footer&&(e=""===i.list.style.maxHeight?t:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(e-i.footer.offsetHeight).toString()+"px",i.isUpdateFooterHeight=!0)},15),P.attributes(i.inputElement,{"aria-expanded":"true","aria-owns":i.element.id+"_popup","aria-controls":i.element.id}),i.updateAriaActiveDescendant(),i.isFirstClick&&!i.enableVirtualization&&i.loadTemplate(),"CheckBox"===i.mode&&i.showSelectAll&&P.EventHandler.add(i.popupObj.element,"click",i.clickHandler,i))})},k.prototype.updateVirtualReOrderList=function(t){var e=this.getForQuery(this.value,!0).clone();this.isVirtualReorder=!0,this.enableVirtualization&&this.dataSource instanceof c.DataManager?this.resetList(this.selectedListData,this.fields,e):this.resetList(this.dataSource,this.fields,e),this.isVirtualReorder=!1,this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():(e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(e)),this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),t&&this.loadTemplate()},k.prototype.updateListItems=function(t,e){for(var i=0;i<t.length;i++)this.findGroupStart(t[i]),this.findGroupStart(e[i]);this.deselectHeader()},k.prototype.loadTemplate=function(){var t;this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode&&(t=this.list.querySelectorAll(".e-reorder")[0],this.list.querySelector(".e-virtual-ddl-content"))&&t&&this.list.querySelector(".e-virtual-ddl-content").removeChild(t),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},k.prototype.setScrollPosition=function(){var t;(!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!P.isNullOrUndefined(this.value)&&0<this.value.length&&(t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],t=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",t),P.isNullOrUndefined(t)||this.scrollBottom(t,void 0,!1,null,!0)),this.enableVirtualization&&(t=this.list.querySelector("."+y.focus),this.isKeyBoardAction=!1,this.scrollBottom(t,void 0,!1,null,!0))},k.prototype.focusAtFirstListItem=function(t){var e;this.ulElement&&this.ulElement.querySelector("li."+y.li)&&(e=void 0,"CheckBox"===this.mode?this.removeFocus():(this.enableVirtualization?(e=this.fields.disabled?this.ulElement.querySelector("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem):not(."+ae+")"):this.ulElement.querySelector("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"),t&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(e=(t=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<t.length?t[2]:e)):e=this.fields.disabled?this.ulElement.querySelector("li."+y.li+":not(."+D+"):not(."+ae+")"):this.ulElement.querySelector("li."+y.li+":not(."+D+")"),null!==e&&(this.removeFocus(),this.addListFocus(e))))},k.prototype.focusAtLastListItem=function(t){var e;t?e=d(t,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?d(this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):e=null,e&&null!==e.item&&(this.addListFocus(e.item),(this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(e.item,e.index)},k.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},k.prototype.updateListARIA=function(){P.isNullOrUndefined(this.ulElement)||P.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var t=!(P.isNullOrUndefined(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||P.isNullOrUndefined(this.inputElement)||P.attributes(this.inputElement,this.getAriaAttributes()),t&&P.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(t?"true":"false")},k.prototype.ensureAriaDisabled=function(t){var e;this.htmlAttributes&&this.htmlAttributes["aria-disabled"]&&(e=this.htmlAttributes,P.extend(e,{"aria-disabled":t},e),this.setProperties({htmlAttributes:e},!0))},k.prototype.removelastSelection=function(t){var e,i;null!==this.chipCollectionWrapper.querySelector("span."+he)?this.removeSelectedChip(t):(e=(e=this.chipCollectionWrapper.querySelectorAll("span."+oe))[e.length-1].getAttribute("data-value"),P.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),i=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e)):this.getFormattedValue(e),this.allowCustomValue&&("false"!==e&&!1===i||!P.isNullOrUndefined(i)&&"NaN"===i.toString())&&(i=e),this.removeValue(i,t),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,t),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize())},k.prototype.onActionFailure=function(t){A.prototype.onActionFailure.call(this,t),this.renderPopup(),this.onPopupShown()},k.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},k.prototype.getForQuery=function(t,e){var i=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&t){if(e)for(var s=this.viewPortInfo.startIndex,l=s+this.viewPortInfo.endIndex<=t.length&&t[s+this.viewPortInfo.endIndex]?s+this.viewPortInfo.endIndex:t.length,n=s;n<l;n++)var a=this.allowObjectBinding?P.getValue(this.fields.value||"",t[n]):t[n],o=n===s?new c.Predicate(i,"equal",a):o.or(i,"equal",a);else for(n=0;n<t.length;n++){a=this.allowObjectBinding?P.getValue(this.fields.value||"",t[n]):t[n];o=this.isaddNonPresentItems?0===n?new c.Predicate(i,"equal",t[n]):o.or(i,"equal",t[n]):0===n?new c.Predicate(i,"notequal",a):o.and(i,"notequal",a)}return(new c.Query).where(o)}for(n=0;n<t.length;n++)o=0===n?new c.Predicate(i,"equal",t[n]):o.or(i,"equal",t[n]);return(this.dataSource instanceof c.DataManager&&this.dataSource.adaptor instanceof c.JsonAdaptor?new c.Query:this.getQuery(this.query).clone()).where(o)},k.prototype.onActionComplete=function(t,e,i,s){var l=this;this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.value&&e&&0<e.length&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction&&e.every(function(t){var e=P.getValue(l.fields.value||"",t);return l.value.some(function(t){t=l.allowObjectBinding?P.getValue(l.fields.value||"",t):t;return e===t})})&&(t.innerHTML="",e=[]),A.prototype.onActionComplete.call(this,t,e,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);if(!P.isNullOrUndefined(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&0<this.listData.length)for(var n=0;n<this.value.length;n++){var a=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[n]):this.value[n];this.findListElement(this.allowFiltering&&!P.isNullOrUndefined(this.mainList)?this.mainList:t,"li","data-value",a)||this.dataSource instanceof c.DataManager||(this.value.splice(n,1),--n)}var o=[];0<(o=P.isNullOrUndefined(this.value)?o:this.presentItemValue(this.ulElement)).length&&this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(this.value)&&null!=this.listData?(this.isaddNonPresentItems=!0,this.addNonPresentItems(o,this.ulElement,this.listData),this.isaddNonPresentItems=!1):this.updateActionList(t,e,i),this.dataSource instanceof c.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value&&(o=new c.Query,o=this.allowFiltering?o.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):o,this.checkForCustomValue(o,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue),"CheckBox"!==this.mode||!this.enableGroupCheckBox||P.isNullOrUndefined(this.fields.groupBy)||P.isNullOrUndefined(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof c.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},k.prototype.updateActionList=function(t,e,i,s){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?!P.isNullOrUndefined(this.mainData)&&0!==this.mainData.length||(this.mainData=e):(this.mainList=t.cloneNode?t.cloneNode(!0):t,this.mainData=e,this.mainListCollection=this.liCollections),(this.remoteCustomValue||e.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!P.isNullOrUndefined(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof c.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),P.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),P.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(P.isNullOrUndefined(this.text)||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof c.DataManager)?this.initialValueUpdate(this.listData,!0):this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode)&&this.changeOnBlur&&this.updateValueState(null,this.value,null),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(i)))},k.prototype.refreshSelection=function(){var t=this.hideSelectedItem?D:y.selected;if(!P.isNullOrUndefined(this.value))for(var e=0;!P.isNullOrUndefined(this.value[e]);e++){var i,s=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[e]):this.value[e];(i=this.findListElement(this.list,"li","data-value",s))&&(P.addClass([i],t),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(y.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(y.group))&&P.addClass([i.previousElementSibling],t),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(D)&&this.hideGroupItem(s),this.hideSelectedItem&&i.classList.contains(y.focus)&&(P.removeClass([i],y.focus),0<(s=i.parentElement.querySelectorAll("."+y.li+":not(."+D+"):not(."+ae+")")).length?(P.addClass([s[0]],y.focus),this.updateAriaActiveDescendant()):this.list&&0<this.list.querySelectorAll("."+y.li).length||(this.l10nUpdate(),P.addClass([this.list],y.noData))),i.setAttribute("aria-selected","true"),"CheckBox"===this.mode)&&i.classList.contains("e-active")&&0===i.getElementsByClassName("e-check").length&&(s={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null},this.notify("updatelist",s))}this.checkSelectAll(),this.checkMaxSelection()},k.prototype.hideGroupItem=function(t){for(var e,i=this.hideSelectedItem?D:y.selected,s=e=this.findListElement(this.ulElement,"li","data-value",t),l=0,n=0,a=!0,o=!0;!(a=e&&e.previousElementSibling&&!e.previousElementSibling.classList.contains(D)&&e.previousElementSibling.classList.contains(y.li)?!1:a)||!e||e.previousElementSibling&&e.previousElementSibling.classList.contains(y.group)?l=10:e=e.previousElementSibling,!(o=s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(D)&&s.nextElementSibling.classList.contains(y.li)?!1:o)||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(y.group)?n=10:s=s.nextElementSibling,l<10||n<10;);a&&o&&!e.previousElementSibling.classList.contains(D)?P.addClass([e.previousElementSibling],i):a&&o&&e.previousElementSibling.classList.contains(D)&&P.removeClass([e.previousElementSibling],i)},k.prototype.getValidLi=function(){var t=this.ulElement.querySelector("li."+y.li+":not(."+D+")");return P.isNullOrUndefined(t)?this.liCollections[0]:t},k.prototype.checkSelectAll=function(){var t=(P.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active"):this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)")).length,e=this.list.querySelectorAll("li.e-list-item"),i=(this.enableVirtualization?this.list.querySelectorAll("li."+y.li+":not(.e-virtual-list)"):P.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li."+y.li):this.list.querySelectorAll("li."+y.li+":not(.e-disabled)")).length,s=this.list.querySelectorAll("li."+y.selected).length;if(this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(s-=t),!this.enableVirtualization&&(i===s||s===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.virtualSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):i!==s&&"CheckBox"===this.mode&&this.showSelectAll&&(!this.enableVirtualization||this.enableVirtualization&&!this.virtualSelectAll)&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var l=0;l<e.length;l++)this.findGroupStart(e[l]);this.deselectHeader()}},k.prototype.openClick=function(t){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(t)},k.prototype.keyUp=function(t){var e;"CheckBox"!==this.mode||this.openOnClick||(e=String.fromCharCode(t.keyCode).match(/\w/),P.isNullOrUndefined(e))||(this.isValidKey=!0),this.isValidKey=this.isPopupOpen()&&8===t.keyCode||this.isValidKey,this.isValidKey=(!t.ctrlKey||86!==t.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),t.keyCode,this.search(t))},k.prototype.filter=function(t,e,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(t,e,i)},k.prototype.getQuery=function(t){var e,i=t?t.clone():this.query?this.query.clone():new c.Query;if(this.isFiltered){if(this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery))return i=this.customFilterQuery.clone(),this.virtualFilterQuery(i);if(!this.enableVirtualization)return i}return this.filterAction?((null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim())&&(e=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==e)&&"number"!==e?(!this.enableVirtualization||""===this.targetElement()||this.isClearAllAction)&&this.enableVirtualization||(e=this.fields,i.where(P.isNullOrUndefined(e.text)?"":e.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)):i.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)),this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(t||this.query||new c.Query).take(this.maximumSelectionLength).requiresCount():i):this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(t||this.query||new c.Query).take(this.maximumSelectionLength).requiresCount():t||this.query||new c.Query},k.prototype.virtualFilterQuery=function(t){for(var e=this.getTakeValue(),i=!0,s=!0,l=0;l<t.queries.length;l++)"multiselect"===this.getModuleName()&&(t.queries[l].e&&"or"===t.queries[l].e.condition||t.queries[l].e&&"equal"===t.queries[l].e.operator)&&(i=!1),"onSkip"===t.queries[l].fn&&(s=!1),t.queries[l].fn;var n=0;if(t&&0<t.queries.length)for(l=0;l<t.queries.length;l++)"onTake"===t.queries[l].fn&&(n=e<=t.queries[l].e.nos?t.queries[l].e.nos:e);if(n<=0&&this.query&&0<this.query.queries.length)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=e<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:e);if(t&&0<t.queries.length)for(l=0;l<t.queries.length;l++)"onTake"===t.queries[l].fn&&(n=t.queries[l].e.nos<=n?n:t.queries[l].e.nos,t.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s&&!this.isVirtualReorder)&&(i?t.skip(this.virtualItemStartIndex):t.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?t.take(this.incrementalEndIndex):0<n?t.take(n):t.take(e),t.requiresCount(),this.customFilterQuery=null,t},k.prototype.getTakeValue=function(){return this.allowFiltering&&P.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},k.prototype.dataUpdater=function(t,e,i){this.isDataFetched=!1;var s,l,n,a=this.list.classList.contains(y.noData);""===this.targetElement().trim()?(s=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&0<this.value.length)&&(l=this.remoteCustomValue=!1,this.allowCustomValue&&0===s.querySelectorAll("li").length&&0<this.mainData.length&&(this.mainData=[]),this.enableVirtualization&&(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&0<this.value.length&&"CheckBox"===this.mode?(this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),l=!0):(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(t,i,e),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),!a&&!this.allowCustomValue||this.list.classList.contains(y.noData)||(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),this.list.querySelector(".e-virtual-ddl"))||(n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(n)))),this.onActionComplete(s,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),l||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))):(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder"))&&this.list.querySelector(".e-list-parent.e-reorder").remove(),this.resetList(t,i,e),this.enableVirtualization&&(a||this.allowCustomValue)&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")||(n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(n))),this.allowCustomValue&&(t instanceof c.DataManager?(this.remoteCustomValue=!0,this.tempQuery=e):this.checkForCustomValue(e,i))),this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},k.prototype.checkForCustomValue=function(t,e){var i,s,l,n,a,o=!this.getValueByText(this.inputElement.value,this.ignoreCase),r=e||this.fields;this.allowCustomValue&&o?(n=this.inputElement.value,(a=!P.isNullOrUndefined(this.mainData)&&0<this.mainData.length?this.mainData[0]:this.mainData)&&"string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a?(i={},P.setValue(r.text,n,i),"number"==typeof P.getValue(this.fields.value||"value",a)&&this.fields.value!==this.fields.text?P.setValue(r.value,Math.random(),i):P.setValue(r.value,n,i),s={},this.allowObjectBinding&&(this.listData&&0<this.listData.length?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(i)).forEach(function(t){s[t]=t===e.value||t===e.text?P.getValue(e.value,i):null}),i=this.allowObjectBinding?s:i,this.enableVirtualization?(this.virtualCustomData=i,l=this.dataSource instanceof c.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource)),this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&l.concat(this.virtualCustomSelectData),l.splice(0,0,i),this.isCustomDataUpdated=!0,n=this.totalItemCount,this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(l,r,t),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof c.DataManager?n:this.totalItemCount):(this.dataSource instanceof c.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(l=JSON.parse(JSON.stringify(this.listData))).splice(0,0,i),this.resetList(l,r,t))):this.listData&&((l=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),l[0]="number"!=typeof a||isNaN(parseFloat(l[0]))?l[0]:parseFloat(l[0]),l[0]="boolean"==typeof a?"true"===l[0]||"false"!==l[0]&&l[0]:l[0],this.resetList(l,r))):this.listData&&this.mainData&&!o&&this.allowCustomValue&&(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue?(this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,r,t)):!this.allowFiltering&&this.list&&(n=this.list.querySelectorAll("li."+y.li+":not(.e-hide-listitem)"),a=d(this.targetElement(),n,"StartsWith",this.ignoreCase))&&null!==a.item&&this.addListFocus(a.item)),this.value&&this.value.length&&this.refreshSelection()},k.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},k.prototype.wrapperClick=function(t){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled)if(t.target===this.overAllClear)t.preventDefault();else{if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(t.target&&-1!==t.target.classList.toString().indexOf(re))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&t.target&&t.target.className===ge)?this.showPopup(t):(this.hidePopup(t),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(ne)||this.overAllWrapper.classList.add(ne)))}this.targetElement()&&""!==this.targetElement()||t.preventDefault()}},k.prototype.enable=function(t){t?(this.overAllWrapper.classList.remove(ae),this.inputElement.removeAttribute("disabled"),P.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add(ae),this.inputElement.setAttribute("disabled","true"),P.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==t&&(this.enabled=t),this.hidePopup()},k.prototype.onBlurHandler=function(t,e){var i;this.isBlurDispatching&&this.isAngular?this.isBlurDispatching=!1:(P.isNullOrUndefined(t)||(i=t.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(i)?"CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&P.addClass([this.overAllWrapper],"e-valid-input"):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(P.isNullOrUndefined(this.value)||0===this.value.length)&&P.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!P.Browser.isIE||P.isNullOrUndefined(t)||e?this.scrollFocusStatus?(P.isNullOrUndefined(t)||t.preventDefault(),this.inputElement.focus(),this.scrollFocusStatus=!1):(this.inputFocus=!1,this.overAllWrapper.classList.remove(ne),this.addTagOnBlur&&(i=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),e=this.findListElement(this.list,"li","data-value",i),i=this.hideSelectedItem?D:y.selected,e)&&!e.classList.contains(i)&&(this.updateListSelection(e,t),"Delimiter"===this.mode)&&this.updateDelimeter(this.delimiterChar),this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(t,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(t),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,P.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),ie(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!P.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")):(this.inputFocus=!1,this.overAllWrapper.classList.remove(ne))))},k.prototype.calculateWidth=function(){var t;this.overAllWrapper&&(t=!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top")?this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10):(t=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10),this.overAllWrapper.clientWidth-(t+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(t,this.overAllWrapper,this.getModuleName())},k.prototype.checkPlaceholderSize=function(){var t;this.showDropDownIcon?(t=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10),this.setPlaceholderSize(t)):P.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},k.prototype.setPlaceholderSize=function(t){P.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(t+10)+"px":P.addClass([this.searchWrapper],be):P.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),P.removeClass([this.searchWrapper],be))},k.prototype.refreshInputHight=function(){P.isNullOrUndefined(this.searchWrapper)||(this.value&&this.value.length||!P.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add(pe):this.searchWrapper.classList.remove(pe))},k.prototype.validateValues=function(t,e){return JSON.stringify(t.slice().sort())!==JSON.stringify(e.slice().sort())},k.prototype.updateValueState=function(t,e,i){this.initStatus&&this.validateValues(e||[],i||[])&&(i={e:t,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,e),isInteracted:!!t,element:this.element,event:t},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")),this.selectedValueInfo=this.viewPortInfo},k.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},k.prototype.updateAriaActiveDescendant=function(){P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||P.attributes(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},k.prototype.pageUpSelection=function(t,e){var i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),s=0<=t?i[t+1]:i[0];if(this.fields.disabled&&s&&!this.enableVirtualization){for(;s&&(s.classList.contains("e-disabled")||s.classList.contains(D)||s.classList.contains(".e-reorder-hide")||s.classList.contains("e-list-group-item"));)s=s.previousElementSibling;if(!s)return}this.enableVirtualization&&e&&(s=this.liCollections.length>=t&&0<=t?this.liCollections[t]:this.liCollections[this.skeletonCount]),!P.isNullOrUndefined(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.enableVirtualization?(P.isNullOrUndefined(s)||s.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=s):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode))},k.prototype.pageDownSelection=function(t,e){var i=this.getItems(),s=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),l=t<=s.length?s[t-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(D)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&0<this.skeletonCount&&(l=t<i.length?this.liCollections[t]:this.liCollections[i.length-1]),this.enableVirtualization&&e&&(l=t<=i.length?this.liCollections[t]:this.liCollections[i.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},k.prototype.getItems=function(){return this.list||A.prototype.render.call(this),this.ulElement&&0<this.ulElement.querySelectorAll("."+y.li).length?this.ulElement.querySelectorAll("."+y.li+":not(."+D+")"):[]},k.prototype.focusInHandler=function(t){var e=this;return!!this.enabled&&(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode)&&(this.viewWrapper.style.display="none"),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove(pe),this.checkPlaceholderSize(),this.focused&&(this.trigger("focus",{isInteracted:!!t,event:t}),this.focused=!1),this.overAllWrapper.classList.contains(ne)||this.overAllWrapper.classList.add(ne),ee(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout(function(){e.calculateWidth()},150),!0)},k.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add(ue)},k.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove(ue)},k.prototype.expandTextbox=function(){var t,e=5;this.placeholder&&(t=this.placeholder.charCodeAt(0),e=e>this.inputElement.placeholder.length?e:this.inputElement.placeholder.length*(44032<=t&&t<=55215?1.5:19968<=t&&t<=40959?2:1)),this.inputElement.value.length>e?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=e},k.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},k.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},k.prototype.checkTextLength=function(){return this.targetElement().length<1},k.prototype.popupKeyActions=function(t){switch(t.keyCode){case 38:this.hidePopup(t),"CheckBox"===this.mode&&this.inputElement.focus(),t.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(t),t.preventDefault())}},k.prototype.updatePopupPosition=function(){this.refreshPopup()},k.prototype.updateAriaAttribute=function(){var t,e=this.list.querySelector("."+y.focus);P.isNullOrUndefined(e)||(this.inputElement.setAttribute("aria-activedescendant",e.id),this.allowFiltering?(t=this.popupWrapper.querySelector("."+Se))&&t.setAttribute("aria-activedescendant",e.id):"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",e.id))},k.prototype.homeNavigation=function(t,e){this.removeFocus(),this.enableVirtualization&&(t?this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)):this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&0<this.value.length&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),s=(new c.Query).clone(),this.value&&0<this.value.length&&(s=(s=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,s))),this.UpdateSkeleton();var i,s=this.ulElement.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)");0<s.length&&(i=s[t?0:s.length-1],this.enableVirtualization&&t&&(i=s[this.skeletonCount]),this.removeFocus(),i.classList.add(y.focus),this.enableVirtualization&&t?this.scrollTop(i,void 0,this.keyboardEvent.keyCode):e||this.scrollBottom(i,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant())},k.prototype.updateSelectionList=function(){if(!P.isNullOrUndefined(this.value)&&this.value.length)for(var t=0;t<this.value.length;t++){var e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[t]):this.value[t],e=this.getElementByValue(e);e&&!e.classList.contains(y.selected)&&e.classList.add("e-active")}},k.prototype.handleVirtualKeyboardActions=function(t,e){var i,s=this.list.querySelector("."+y.focus);switch(this.isKeyBoardAction=!0,t.keyCode){case 40:this.arrowDown(t,!0);break;case 38:this.arrowUp(t,!0);break;case 33:t.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:t.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===t.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},k.prototype.onKeyDown=function(t){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=t,this.isPreventKeyAction&&this.enableVirtualization&&t.preventDefault(),this.keyCode=t.keyCode,this.keyDownStatus=!0,!(111<t.keyCode&&t.keyCode<124)))if(t.altKey)this.popupKeyActions(t);else{if(this.isPopupOpen()){var e=this.list.querySelector("."+y.focus),i=void 0;switch(t.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===t.keyCode);break;case 33:return t.preventDefault(),void(e&&(i=this.getIndexByValue(e.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return t.preventDefault(),void(e&&(i=this.getIndexByValue(e.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(t);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(t);break;case 27:return t.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(t),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return t.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(t),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(t),void(this.isKeyBoardAction=!1);case 9:t.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(t),this.inputElement.focus(),this.overAllWrapper.classList.add(ne)}}else switch(t.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return t.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(t),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(t)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},k.prototype.arrowDown=function(t,e){t.preventDefault(),this.moveByList(1,e),this.keyAction=!0,(document.activeElement.classList.contains(Se)||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&P.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},k.prototype.arrowUp=function(t,e){t.preventDefault(),this.keyAction=!0;var t=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),i=(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&(t=this.list.querySelectorAll("li."+y.li+",li."+y.group+":not(."+D+"):not(.e-reorder-hide)")),this.list.querySelector("li."+y.focus));this.focusFirstListItem=!P.isNullOrUndefined(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),Array.prototype.slice.call(t).indexOf(i)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,e),this.updateAriaAttribute()},k.prototype.spaceKeySelection=function(t){var e,i;"CheckBox"===this.mode&&(i=this.list.querySelector("li."+y.focus),e=document.getElementsByClassName("e-selectall-parent")[0],(!P.isNullOrUndefined(i)||e&&e.classList.contains("e-item-focus"))&&(t.preventDefault(),this.keyAction=!0),this.selectByKey(t),this.keyAction)&&(i=this.list.querySelector("li."+y.focus),!P.isNullOrUndefined(i))&&e&&e.classList.contains("e-item-focus")&&i.classList.remove("e-item-focus"),this.checkPlaceholderSize()},k.prototype.checkBackCommand=function(t){(8===t.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},k.prototype.keyNavigation=function(t){var e;if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(t.keyCode){case 37:t.preventDefault(),this.moveBy(-1,t);break;case 39:t.preventDefault(),this.moveBy(1,t);break;case 8:this.removelastSelection(t);break;case 46:this.removeSelectedChip(t)}else 8===t.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length&&(t.preventDefault(),e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.removeValue(this.value[this.value.length-1],t),this.updateDelimeter(this.delimiterChar,t),this.focusAtLastListItem(e))},k.prototype.selectByKey=function(t){this.removeChipSelection(),this.selectListByKey(t),this.hideSelectedItem&&this.focusAtFirstListItem()},k.prototype.escapeAction=function(){var t=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(t=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,t)&&("CheckBox"!==this.mode&&(this.value=t,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},k.prototype.scrollBottom=function(t,e,i,s,l){void 0===i&&(i=!1),void 0===s&&(s=null),void 0===l&&(l=!1);var n=(t=!P.isNullOrUndefined(t)&&t.classList.contains("e-virtual-list")||this.enableVirtualization&&P.isNullOrUndefined(t)?this.liCollections[this.skeletonCount]:t)&&!isNaN(parseInt(window.getComputedStyle(t).marginBottom,10))?parseInt(window.getComputedStyle(t).marginBottom,10):0,a=(this.isUpwardScrolling=!1,this.list.querySelectorAll(".e-virtual-list").length),o=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,r=this.virtualListInfo&&this.virtualListInfo.startIndex?t.offsetTop+this.virtualListInfo.startIndex*(t.offsetHeight+n):t.offsetTop,h=this.list.offsetHeight,u=r-a*(t.offsetHeight+n)+(t.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1,r=r-a*(t.offsetHeight+n)+(t.offsetHeight+n)-this.list.scrollTop,r=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r;0!==e||this.enableVirtualization?(h<u||!(0<r&&this.list.offsetHeight>r))&&(a=t?t.getAttribute("data-value"):null,e=34===s?this.getPageCount()-1:1,!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&o&&a===o&&35!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(t.offsetHeight+n)*e,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?l&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction):this.list.scrollTop=0,this.isKeyBoardAction=d},k.prototype.scrollTop=function(t,e,i){void 0===i&&(i=null);var s=this.list.querySelectorAll(".e-virtual-list").length,l=t&&!isNaN(parseInt(window.getComputedStyle(t).marginBottom,10))?parseInt(window.getComputedStyle(t).marginBottom,10):0,n=this.virtualListInfo&&this.virtualListInfo.startIndex?t.offsetTop+this.virtualListInfo.startIndex*(t.offsetHeight+l):t.offsetTop,a=n-s*(t.offsetHeight+l)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,a=this.fields.groupBy&&!P.isUndefined(this.fixedHeaderElement)?a-this.fixedHeaderElement.offsetHeight:a,n=n-s*(t.offsetHeight+l)+(t.offsetHeight+l)-this.list.scrollTop,s=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&a<=0;0!==e||this.enableVirtualization?a<0||s?(e=t?t.getAttribute("data-value"):null,s=33===i?this.getPageCount()-2:1,this.enableVirtualization&&this.isKeyBoardAction&&o&&e===o&&36!==i&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(t.offsetHeight+l)*s,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===i?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+a)):0<n&&this.list.offsetHeight>n||(this.list.scrollTop=t.offsetTop-(this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0},k.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},k.prototype.selectListByKey=function(t){var e,i,s=this.list.querySelector("li."+y.focus),l=this.value&&this.value.length?this.value.length:0,n=(null!==s&&(t.preventDefault(),s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength?(this.updateListSelection(s,t),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,t),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(e=s.firstElementChild.lastElementChild,this.findGroupStart(e),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,t),n=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent,n),this.changeOnBlur||this.updateValueState(t,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(s)&&l<this.maximumSelectionLength&&((e=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,t,s):this.selectAllItem(!0,t,s)),this.refreshSelection(),this.closePopupOnSelect)&&this.hidePopup(t),document.getElementsByClassName("e-selectall-parent")[0]);n&&n.classList.contains("e-item-focus")&&((l=n.childNodes[0]).classList.contains("e-check")?(l.classList.remove("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!1,t,s)):(l.classList.add("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!0,t,s))),this.refreshPlaceHolder()},k.prototype.refreshListItems=function(t,e){var i;(this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData?(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.enableVirtualization?this.allowCustomValue&&this.virtualCustomData&&null==t&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount?(this.virtualCustomData=null,this.renderItems(this.mainData,this.fields)):this.allowFiltering&&e?(this.updateInitialData(),this.onActionComplete(i,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&(e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(e))):this.onActionComplete(this.list,this.listData):this.onActionComplete(i,this.mainData),this.focusAtLastListItem(t),this.value&&this.value.length&&this.refreshSelection()):!P.isNullOrUndefined(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},k.prototype.removeSelectedChip=function(t){var e,i=this.chipCollectionWrapper.querySelector("span."+he);null!==i&&(P.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(e=i.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(e,t)),e=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i.getAttribute("data-value"))):i.getAttribute("data-value"),this.removeValue(e,t),this.updateDelimeter(this.delimiterChar,t),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(t),this.checkPlaceholderSize()},k.prototype.moveByTop=function(t){var e=this.list.querySelectorAll("li."+y.li);1<e.length&&(this.removeFocus(),t=t?0:e.length-1,this.addListFocus(e[t]),this.scrollBottom(e[t],t)),this.updateAriaAttribute()},k.prototype.clickHandler=function(t){var t=t.target.className,e=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==t&&"e-input-group e-control-wrapper e-input-focus"!==t||!e.classList.contains("e-item-focus")||e.classList.remove("e-item-focus")},k.prototype.moveByList=function(t,e){if(this.list){var i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),s=("CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+y.li+",li."+y.group+":not(."+D+"):not(.e-reorder-hide)")),this.list.querySelector("li."+y.focus)),l=(this.enableVirtualization&&e&&!P.isNullOrUndefined(this.currentFocuedListElement)&&(s=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value")))),-1),n=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===t&&!P.isNullOrUndefined(n)&&!n.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&1<this.liCollections.length)!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):n.classList.contains("e-item-focus")||n.classList.add("e-item-focus");else if(i.length){"CheckBox"===this.mode&&this.showSelectAll&&!P.isNullOrUndefined(n&&-1===t)&&(!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):this.focusFirstListItem&&!n.classList.contains("e-item-focus")&&n.classList.add("e-item-focus"));for(var a,o=0;o<i.length;o++)if(i[o]===s){l=o;break}0<t?l<i.length-1&&(this.removeFocus(),this.enableVirtualization&&e?this.addListFocus(i[l]):this.enableVirtualization&&i[l+1].classList.contains("e-virtual-list")?this.addListFocus(i[this.skeletonCount]):this.addListFocus(i[++l]),-1<l)&&(this.updateCheck(i[l]),this.scrollBottom(i[l],l),this.currentFocuedListElement=i[l]):0<l&&(this.enableVirtualization?(n=i[l-1].classList.contains("e-virtual-list"),a=e?l:l-1,!e&&n||this.removeFocus(),!e&&n||(this.addListFocus(i[a]),this.updateCheck(i[a]),this.scrollTop(i[a],l),this.currentFocuedListElement=i[a])):(this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l)))}}e=this.list?this.list.querySelector(".e-item-focus"):null;this.isDisabledElement(e)&&(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&e===this.list.querySelector("li.e-list-group-item")?this.removeFocus():(0===(o=this.getIndexByValue(e.getAttribute("data-value")))&&(t=1),o===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(t=-1),this.moveByList(t)))},k.prototype.getElementByValue=function(t){for(var e,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===t){e=l;break}}return e},k.prototype.updateCheck=function(t){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(t.firstElementChild.lastElementChild.classList.contains("e-check")?t.classList.add("e-active"):t.classList.remove("e-active"))},k.prototype.moveBy=function(t,e){var i,s=this.chipCollectionWrapper.querySelectorAll("span."+oe),l=this.chipCollectionWrapper.querySelector("span."+he);null===l?t<0&&this.addChipSelection(s[s.length-1],e):t<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,e)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,e))},k.prototype.chipClick=function(t){var e;this.enabled&&(e=P.closest(t.target,"."+oe),this.removeChipSelection(),this.addChipSelection(e,t))},k.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},k.prototype.addChipSelection=function(t,e){P.addClass([t],he),this.trigger("chipSelection",e)},k.prototype.onChipRemove=function(t){var e,i;3!==t.which&&2!==t.button&&this.enabled&&!this.readonly&&(i=t.target.parentElement.getAttribute("data-value"),e=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i),this.allowCustomValue&&("false"!==i&&!1===e||!P.isNullOrUndefined(e)&&"NaN"===e.toString())&&(e=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(t),this.inputFocus||this.inputElement.focus(),this.removeValue(e,t),e=this.allowObjectBinding?P.getValue(this.fields.value||"",e):e,P.isNullOrUndefined(this.findListElement(this.list,"li","data-value",e))&&this.mainList&&this.listData&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,this.mainData)),this.updateDelimeter(this.delimiterChar,t),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",t.preventDefault())},k.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},k.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!P.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=se(this.placeholder):this.setFloatLabelType(),this.expandTextbox()},k.prototype.removeAllItems=function(t,e,i,s,l){var n=this.allowObjectBinding?this.indexOfObjectInArray(t,this.value):this.value.indexOf(t),a=this.value.slice(0),a=(a.splice(n,1),this.setProperties({value:[].concat([],a)},!0),s.setAttribute("aria-selected","false"),this.hideSelectedItem?D:y.selected),a=(P.removeClass([s],a),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:s,e:this,index:n}),this.invokeCheckboxSelection(s,e,i),this.allowObjectBinding?P.getValue(this.fields.value||"",t):t);this.updateMainList(!0,a,l),this.updateChipStatus()},k.prototype.invokeCheckboxSelection=function(t,e,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:t,e:e}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},k.prototype.removeValue=function(i,s,l,n){var a,o,r=this,h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(this.getFormattedValue(i)),t=(-1===h&&this.allowCustomValue&&!P.isNullOrUndefined(i)&&(h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(i.toString())),s&&s.target),u=(n=!!(n||t&&t.classList.contains("e-close-hooker"))||null,this.hideSelectedItem?D:y.selected);-1!==h&&(t=this.allowObjectBinding?P.getValue(this.fields.value||"",i):i,a=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",t),o=this.allowObjectBinding?i:this.getDataByValue(i),this.trigger("removing",{e:s,item:a,itemData:o,isInteracted:!!s,cancel:!1},function(t){var e;t.cancel?r.removeIndex++:(r.isRemoveSelection=!!r.enableVirtualization||r.isRemoveSelection,r.currentRemoveValue=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,r.virtualSelectAll=!1,(e=r.value.slice(0)).splice(h,1),r.enableVirtualization&&"CheckBox"===r.mode&&r.selectedListData.splice(h,1),r.setProperties({value:[].concat([],e)},!0),r.enableVirtualization&&(e=0===h&&r.text.split(r.delimiterChar)&&1===r.text.split(r.delimiterChar).length?r.text.replace(r.text.split(r.delimiterChar)[h],""):0===h?r.text.replace(r.text.split(r.delimiterChar)[h]+r.delimiterChar,""):r.text.replace(r.delimiterChar+r.text.split(r.delimiterChar)[h],""),r.setProperties({text:e.toString()},!0)),null!==a&&(e=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,e=r.findListElement(r.mainList,"li","data-value",e),a.setAttribute("aria-selected","false"),P.removeClass([a],u),e&&(e.setAttribute("aria-selected","false"),P.removeClass([a,e],u)),r.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:a,e:r,index:h}),r.invokeCheckboxSelection(a,s,n)),e=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,r.hideSelectedItem&&r.fields.groupBy&&a&&r.hideGroupItem(e),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&r.isPopupOpen()&&A.prototype.scrollStop.call(r),r.updateMainList(!0,e),r.removeChip(e,n),r.updateChipStatus(),(r.value&&r.value.length?r.value.length:0)<r.maximumSelectionLength&&(e=r.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.removeClass(e,"e-disable")),r.trigger("removed",t),t=!(!(e=s&&s.currentTarget)||!e.classList.contains("e-selectall-parent"))||null,!r.changeOnBlur&&!n&&s&&l&&!t&&r.isSelectAllTarget&&r.updateValueState(s,r.value,r.tempValues),l&&(r.selectAllEventData.push(o),r.selectAllEventEle.push(a)),1===l&&(r.changeOnBlur||r.updateValueState(s,r.value,r.tempValues),e={event:s,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!s,isChecked:!1},r.trigger("selectedAll",e),r.selectAllEventData=[],r.selectAllEventEle=[]),!n||1!==l&&null!==l||r.clearAllCallback(s,n),r.isPopupOpen()&&a&&a.parentElement.classList.contains("e-reorder")&&(r.hideSelectedItem&&r.value&&Array.isArray(r.value)&&0<r.value.length&&r.totalItemsCount(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})))}))},k.prototype.updateMainList=function(t,e,i){(this.allowFiltering||"CheckBox"===this.mode)&&(i=i||this.findListElement(this.mainList,"li","data-value",e))&&(t?(i.setAttribute("aria-selected","false"),P.removeClass([i],this.hideSelectedItem?D:y.selected),"CheckBox"===this.mode&&P.removeClass([i.firstElementChild.lastElementChild],"e-check")):(i.setAttribute("aria-selected","true"),P.addClass([i],this.hideSelectedItem?D:y.selected),"CheckBox"===this.mode&&P.addClass([i.firstElementChild.lastElementChild],"e-check")))},k.prototype.removeChip=function(t,e){!this.chipCollectionWrapper||this.enableVirtualization&&e||(e=this.findListElement(this.chipCollectionWrapper,"span","data-value",t))&&P.remove(e)},k.prototype.setWidth=function(t){P.isNullOrUndefined(t)||("number"==typeof t?this.overAllWrapper.style.width=P.formatUnit(t):"string"==typeof t&&(this.overAllWrapper.style.width=t.match(/px|%|em/)?t:P.formatUnit(t)))},k.prototype.updateChipStatus=function(){this.value&&this.value.length?(P.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(P.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),P.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},k.prototype.indexOfObjectInArray=function(i,s){for(var t=0;t<s.length;t++){var e=function(t){var e=s[t];if(Object.keys(i).every(function(t){return e.hasOwnProperty(t)&&e[t]===i[t]}))return{value:t}}(t);if("object"==typeof e)return e.value}return-1},k.prototype.addValue=function(t,e,i){this.value||(this.value=[]);var s=this.allowObjectBinding?this.getDataByValue(t):t,l=((this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(t),this.value)||!this.allowObjectBinding&&this.value.indexOf(s)<0)&&(this.setProperties({value:[].concat([],this.value,[s])},!0),this.enableVirtualization&&!this.isSelectAllLoop&&(s=this.viewWrapper.innerHTML,l=void 0,s=(s+=1===this.value.length?"":this.delimiterChar+" ")+(l=this.getOverflowVal(this.value.length-1)),l=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,s)),this.enableVirtualization)&&"CheckBox"===this.mode&&(s=[],this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],l=e,l=null!=this.text&&""!==this.text?this.text+this.delimiterChar+l:l,s.push(l),this.setProperties({text:s.toString()},!0)),this.findListElement(this.list,"li","data-value",t));this.removeFocus(),l&&(this.addListFocus(l),this.addListSelection(l)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(e,t,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(t),this.updateChipStatus(),this.checkMaxSelection()},k.prototype.checkMaxSelection=function(){var t,e=this.value&&this.value.length?this.value.length:0;e===this.maximumSelectionLength&&(t=this.list.querySelectorAll("li."+y.li+".e-active"),P.removeClass(t,"e-disable"),t=this.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.addClass(t,"e-disable")),e<this.maximumSelectionLength&&(t=this.list.querySelectorAll("li."+y.li),P.removeClass(t,"e-disable"))},k.prototype.dispatchSelect=function(e,i,s,t,l,n,a){var o,r=this,h=this.listData;this.initStatus&&!t&&(e=this.allowObjectBinding?P.getValue(this.fields.value||"",e):e,o=n||this.getDataByValue(e),this.trigger("select",{e:i,item:s,itemData:o,isInteracted:!!i,cancel:!1},function(t){t.cancel||(l&&(r.selectAllEventData.push(o),r.selectAllEventEle.push(s)),1===l&&(t={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0},r.trigger("selectedAll",t),r.selectAllEventData=[]),r.allowCustomValue&&r.isServerRendered&&r.listData!==h&&(r.listData=h),e=r.allowObjectBinding?r.getDataByValue(e):e,r.enableVirtualization&&(P.isNullOrUndefined(r.selectedListData)?r.selectedListData=[r.getDataByValue(e)]:n?Array.isArray(r.selectedListData)?r.selectedListData.push(n):r.selectedListData=[r.selectedListData,n]:Array.isArray(r.selectedListData)?r.selectedListData.push(r.getDataByValue(e)):r.selectedListData=[r.selectedListData,r.getDataByValue(e)]),(r.enableVirtualization&&e||!r.enableVirtualization)&&r.updateListSelectEventCallback(e,s,i,a),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&A.prototype.scrollStop.call(r))}))},k.prototype.addChip=function(t,e,i){this.chipCollectionWrapper&&this.getChip(t,e,i)},k.prototype.removeChipFocus=function(){var t=this.chipCollectionWrapper.querySelectorAll("span."+oe+"."+he);if(P.removeClass(t,he),P.Browser.isDevice)for(var e=this.chipCollectionWrapper.querySelectorAll("span."+re.split(" ")[0]),i=0;i<e.length;i++)e[i].style.display="none"},k.prototype.onMobileChipInteraction=function(t){var e=P.closest(t.target,"."+oe),i=e.querySelector("span."+re.split(" ")[0]);this.enabled&&!this.readonly&&(e.classList.contains(he)||(this.removeChipFocus(),i.style.display="",e.classList.add(he)),this.refreshPopup(),t.preventDefault())},k.prototype.multiCompiler=function(t){var e=!1;if("function"!=typeof t&&t)try{e=!!P.selectAll(t,document).length}catch(t){e=!1}return e},k.prototype.encodeHtmlEntities=function(t){return t.replace(/[\u00A0-\u9999<>&]/g,function(t){return"&#"+t.charCodeAt(0)+";"})},k.prototype.getChip=function(t,e,i){var s=this,l={text:e,value:e},n=this.createElement("span",{className:oe,attrs:{"data-value":e,title:t}}),a=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:re}),e=(this.mainData&&(l=this.getDataByValue(e)),this.valueTemplate&&!P.isNullOrUndefined(l)?(e=this.multiCompiler(this.valueTemplate),(e=("function"!=typeof this.valueTemplate&&e?P.compile(P.select(this.valueTemplate,document).innerHTML.trim()):P.compile(this.valueTemplate))(l,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a))&&0<e.length&&P.append(e,a),this.renderReactTemplates()):this.enableHtmlSanitizer?a.innerText=t:a.innerHTML=this.encodeHtmlEntities(t.toString()),n.appendChild(a),{isInteracted:!!i,itemData:l,e:i,setClass:function(t){P.addClass([n],t)},cancel:!1});this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",e,function(t){t.cancel||(P.Browser.isDevice?(n.classList.add("e-mob-chip"),P.append([o],n),o.style.display="none",P.EventHandler.add(n,"click",s.onMobileChipInteraction,s)):(P.EventHandler.add(n,"mousedown",s.chipClick,s),s.showClearButton&&n.appendChild(o)),P.EventHandler.add(o,"mousedown",s.onChipRemove,s),s.chipCollectionWrapper.appendChild(n),!s.changeOnBlur&&i&&s.updateValueState(i,s.value,s.tempValues))})},k.prototype.calcPopupWidth=function(){var t=P.formatUnit(this.popupWidth);return t=-1<t.indexOf("%")?(this.componentWrapper.offsetWidth*parseFloat(t)/100).toString()+"px":t},k.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},k.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},k.prototype.listOption=function(t,e){var i=!P.isNullOrUndefined(e.iconCss),s=P.isNullOrUndefined(e.properties)?e:e.properties;return this.listCurrentOptions=null!==e.text||null!==e.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},P.extend(this.listCurrentOptions,this.listCurrentOptions,e,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:t,fieldProperty:s}),this.listCurrentOptions},k.prototype.renderPopup=function(){var t,e,i=this;this.list||A.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering?this.refreshPopup():this.popupObj||P.isNullOrUndefined(this.popupWrapper)||(document.body.appendChild(this.popupWrapper),t=this.popupWrapper.querySelector(".e-filter-parent"),"CheckBox"===this.mode&&!this.allowFiltering&&t&&this.filterParent&&(t.remove(),this.filterParent=null),t=parseInt(this.popupHeight,10),this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),t-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),P.append([this.list],this.popupWrapper),!this.list.classList.contains(y.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(y.noData)&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")?this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content",styles:this.getTransformValues()})).appendChild(this.list.querySelector(".e-list-parent")):this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():(e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(e))),this.footerTemplate&&(this.setFooterTemplate(),t-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),t-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),t=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(t-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(t-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),t=parseInt(this.popupHeight,10)),"CheckBox"===this.mode&&(e={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper},this.allowFiltering&&(this.notify("searchBox",e),t-=this.searchBoxHeight),P.addClass([this.popupWrapper],"e-checkbox")),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(t),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight),this.popupObj=new o.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){var t;i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),t=i.popupWrapper.querySelector("."+Se),"CheckBox"===i.mode&&t&&document.activeElement===t&&t.blur(),P.detach(i.popupObj.element))},open:function(){var t;i.popupObj.resolveCollision(),i.isFirstClick||(!(t=i.list.querySelector("ul"))||"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||(i.mainList=t.cloneNode?t.cloneNode(!0):t),i.isFirstClick=!0),i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||i.enableVirtualization||(i.loadTemplate(),i.enableVirtualization&&"CheckBox"===i.mode&&i.UpdateSkeleton()),i.isPreventScrollAction=!0,i.setScrollPosition(),!i.list.classList.contains(y.noData)&&i.getItems()[1]&&0!==i.getItems()[1].offsetHeight&&(i.listItemHeight=i.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(i.getItems()[1]).marginBottom,10),i.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(i.list.getElementsByClassName("e-virtual-ddl-content")[0].style=i.getTransformValues()),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"}),i.enableVirtualization&&(i.notify("bindScrollEvent",{module:"VirtualScroll",component:i.getModuleName(),enable:i.enableVirtualization}),setTimeout(function(){i.value?i.updateSelectionList():i.viewPortInfo&&i.viewPortInfo.offsets.top&&(i.list.scrollTop=i.viewPortInfo.offsets.top)},5))},targetExitViewport:function(){P.Browser.isDevice||i.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&P.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility="")},k.prototype.checkCollision=function(t){"CheckBox"===this.mode&&P.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||(0<o.isCollide(t).length&&(t.style.marginTop=-parseInt(getComputedStyle(t).marginTop,10)+"px"),this.popupObj.resolveCollision())},k.prototype.setHeaderTemplate=function(){this.header&&this.header.remove(),this.header=this.createElement("div"),P.addClass([this.header],"e-ddl-header");var t=this.multiCompiler(this.headerTemplate),t="function"!=typeof this.headerTemplate&&t?P.compile(P.select(this.headerTemplate,document).innerHTML.trim()):P.compile(this.headerTemplate),t=t({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);t&&0<t.length&&P.append(t,this.header),"CheckBox"===this.mode&&this.showSelectAll?P.prepend([this.header],this.popupWrapper):P.append([this.header],this.popupWrapper),P.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},k.prototype.setFooterTemplate=function(){this.footer&&this.footer.remove(),this.footer=this.createElement("div"),P.addClass([this.footer],"e-ddl-footer");var t=this.multiCompiler(this.footerTemplate),t="function"!=typeof this.footerTemplate&&t?P.compile(P.select(this.footerTemplate,document).innerHTML.trim()):P.compile(this.footerTemplate),t=t({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);t&&0<t.length&&P.append(t,this.footer),P.append([this.footer],this.popupWrapper),P.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},k.prototype.updateInitialData=function(){var t,e=this.selectData;this.renderItems(e,this.fields);this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&(t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)),this.listData=e,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},k.prototype.clearAll=function(t){if(this.enabled&&!this.readonly){var e=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&0<this.value.length){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode)&&this.targetInputElement&&(this.targetInputElement.value="");var i=this.list&&this.list.querySelectorAll("li.e-list-item");if(i&&0<i.length)this.selectAllItems(!1,t);else for(this.removeIndex=0,e=this.value[this.removeIndex];this.removeIndex<this.value.length;e=this.value[this.removeIndex])this.removeValue(e,t,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(t);this.checkAndResetCache(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,P.EventHandler.add(document,"mouseup",this.preventSelection,this)},k.prototype.preventSelection=function(t){this.isClearAllItem&&t.stopPropagation(),this.isClearAllItem=!1,P.EventHandler.remove(document,"mouseup",this.preventSelection)},k.prototype.clearAllCallback=function(t,e){var i,s=this.value?this.value.slice():[];this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,this.mainData)),this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,t),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(t,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur)&&e&&(P.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(t,this.value,this.tempValues),this.changeOnBlur||!e||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(t,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),t.preventDefault()},k.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},k.prototype.resetValueHandler=function(t){var e;P.isNullOrUndefined(this.inputElement)||(e=P.closest(this.inputElement,"form"))&&t.target===e&&(t=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value"),this.text=t)},k.prototype.wireEvent=function(){P.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),P.EventHandler.add(window,"resize",this.windowResize,this),P.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),P.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),P.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),P.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var t=P.closest(this.inputElement,"form");t&&P.EventHandler.add(t,"reset",this.resetValueHandler,this),P.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),P.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),P.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},k.prototype.onInput=function(t){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,P.Browser.isDevice&&"mozilla"===P.Browser.info.name&&this.search(t)},k.prototype.pasteHandler=function(t){var e=this;setTimeout(function(){e.expandTextbox(),e.search(t)})},k.prototype.search=function(t){var s=this;if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,P.isNullOrUndefined(t)||(this.keyCode=t.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(t),this.openClick(t),!this.checkTextLength()||this.allowFiltering||P.isNullOrUndefined(t)||8===t.keyCode){var e=this.targetElement();if(this.allowFiltering){this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache();var l={preventDefaultAction:this.isRequesting=!1,text:this.targetElement(),updateData:function(t,e,i){l.cancel||(s.isFiltered=!0,s.customFilterQuery=e,s.remoteFilterAction=!0,s.isCustomFiltering=!0,s.dataUpdater(t,e,i))},event:t,cancel:!1};this.trigger("filtering",l,function(t){s.isFilterPrevented=t.cancel,t.cancel||s.isFiltered||t.preventDefaultAction||(s.filterAction=!0,s.isFilteringAction=!0,s.dataSource instanceof c.DataManager&&s.allowCustomValue&&(s.isCustomRendered=!1),s.dataUpdater(s.dataSource,null,s.fields),s.isFilteringAction=!1)})}else if(this.allowCustomValue){t=new c.Query,t=this.allowFiltering&&""!==e?t.where(this.fields.text,"startswith",e,this.ignoreCase,this.ignoreAccent):t;this.enableVirtualization?this.dataUpdater(this.dataSource,t,this.fields):this.dataUpdater(this.mainData,t,this.fields),this.UpdateSkeleton()}else{var e=this.list.querySelectorAll("li."+y.li+":not(.e-hide-listitem)"),i=this.typeOfData(this.listData).typeof,n=d(this.targetElement(),e,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var a,o,r=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(r=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!1),0===this.viewPortInfo.startIndex&&!r||this.updateIncrementalView(0,this.itemCount),n=d(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i);P.isNullOrUndefined(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0,0===this.viewPortInfo.startIndex&&!r||this.updateIncrementalView(0,this.itemCount),n=d(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i),P.isNullOrUndefined(n));)if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}!n.index||this.viewPortInfo.startIndex>=n.index&&n.index>=this.viewPortInfo.endIndex||(o=(a=0<n.index-(this.itemCount/2-2)?n.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:a+this.itemCount,a!==this.viewPortInfo.startIndex&&this.updateIncrementalView(a,o)),P.isNullOrUndefined(n.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(n.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(a=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,o=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(a,o)),n.item=this.getElementByValue(n.item.getAttribute("data-value"))),n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}n&&n.item?(this.addListFocus(n.item),this.list.scrollTop=n.item.offsetHeight*n.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},k.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),A.prototype.preRender.call(this)},k.prototype.getLocaleName=function(){return"multi-select"},k.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.isaddNonPresentItems=!1,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},k.prototype.updateData=function(n,a,o){var r,h="",u="Delimiter"===this.mode||"CheckBox"===this.mode,p=[],t=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),P.isNullOrUndefined(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!P.isNullOrUndefined(this.value)){for(var d,c=this.value.length,m="",f=this,e=0;e<c;e++){var i=function(t){var e,i,s=f.allowObjectBinding?P.getValue(f.fields.value||"",f.value[t]):f.value[t],l=f.findListElement(P.isNullOrUndefined(f.mainList)?f.ulElement:f.mainList,"li","data-value",s);if(f.enableVirtualization&&(l=f.findListElement(P.isNullOrUndefined(f.list)?f.ulElement:f.list,"li","data-value",s)),P.isNullOrUndefined(l)&&!f.allowCustomValue&&!f.enableVirtualization&&f.listData&&0<f.listData.length)f.value.splice(t,1),--t,--c;else{if(f.listData){if(f.enableVirtualization)return u&&!f.isDynamicRemoteVirtualData&&(h=f.delimiterWrapper&&""===f.delimiterWrapper.innerHTML?h:f.delimiterWrapper.innerHTML),l=f.allowObjectBinding?P.getValue(f.fields.value||"",f.value[f.value.length-1]):f.value[f.value.length-1],f.isRemoveSelection?(h=f.text.replace(/,/g,n+" ")+n+" ",p=f.text.split(n)):(r=o&&u?f.text:f.getTextByValue(l),i=f.isDynamicRemoteVirtualData&&null!=l&&""!==l&&!o?f.getTextByValue(l):o?f.text:f.text&&""!==f.text?f.text+f.delimiterChar+r:r,h+=r+n+" ",p.push(i),m=f.hiddenElement.innerHTML),a&&a.currentTarget&&a.currentTarget.classList.contains("e-chips-close")||a&&"Backspace"===a.key?(e=a.target.parentElement.getAttribute("data-value"),"Backspace"===a.key?(i=f.hiddenElement.lastChild)&&f.hiddenElement.removeChild(i):f.hiddenElement.childNodes.forEach(function(t){t.value===e&&t.parentNode.removeChild(t)}),m=f.hiddenElement.innerHTML):m+="<option selected value='"+l+"'>"+t+"</option>",d=t,"break";r=f.getTextByValue(s)}else r=s;h+=r+n+" ",p.push(r)}m+='<option selected value="'+s+'">'+t+"</option>",d=t}(e),e=d;if("break"===i)break}P.isNullOrUndefined(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=m)}var s=a&&a.target&&a.target.classList.contains("e-chips-close"),s=(this.enableVirtualization&&(!this.enableVirtualization||"CheckBox"===this.mode||s)||this.setProperties({text:p.toString()},!0),u&&(this.updateWrapperText(this.delimiterWrapper,h),this.delimiterWrapper.setAttribute("id",P.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id)),a&&a.target),s=!(!s||!s.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&a&&!s||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(a,this.value,this.tempValues)),this.listData=t,this.addValidInputClass()},k.prototype.initialTextUpdate=function(){if(P.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var t,e=this.text.split(this.delimiterChar),i=[],s=0;e.length>s;s++){var l=this.getValueByText(e[s]);P.isNullOrUndefined(l)?this.allowCustomValue&&i.push(e[s]):i.push(l)}i&&i.length&&(t=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:t},!0))}},k.prototype.renderList=function(t){!t&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(t=!0),A.prototype.render.call(this,null,t),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},k.prototype.initialValueUpdate=function(t,e){if(this.list){var i=void 0,s=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!P.isNullOrUndefined(this.value))for(var l=0;!P.isNullOrUndefined(this.value[l]);l++){var n,a,o,r,h=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[l]):this.value[l],s=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),u=!1;if(this.enableVirtualization){if((i=null)!=t&&0<t.length)for(var p=0;p<t.length;p++)if(this.isPrimitiveData&&t[p]===h||!this.isPrimitiveData&&P.getValue(this.fields.value||"value",t[p])===h){i=this.isPrimitiveData?t[p]:P.getValue(this.fields.text,t[p]),this.enableVirtualization&&(P.isNullOrUndefined(this.selectedListData)?this.selectedListData=[t[p]]:Array.isArray(this.selectedListData)?this.selectedListData.push(t[p]):this.selectedListData=[this.selectedListData,t[p]]);break}P.isNullOrUndefined(i)&&this.allowCustomValue&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&e)&&(i=this.getTextByValue(h),u=!0)}else i=this.getTextByValue(h);s&&"true"!==s.getAttribute("aria-selected")||s&&"true"===s.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=h&&null!=i&&!u?(o=[],r=this.isDynamicRemoteVirtualData&&null!=i&&""!==i&&0===l||null==this.text||""===this.text||this.text.includes(i)?i:this.text+this.delimiterChar+i,o.push(r),this.setProperties({text:o.toString()},!0),this.addChip(i,h),this.addListSelection(s)):(!this.enableVirtualization&&h&&this.allowCustomValue||this.enableVirtualization&&h&&this.allowCustomValue&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&e))&&(u=this.listData.length,P.setValue(this.fields.text,h,n={}),P.setValue(this.fields.value,h,n),a=this.popupWrapper.querySelector("."+y.noData),this.enableVirtualization||this.addItem(n,u),this.enableVirtualization&&(this.virtualCustomSelectData&&0<=this.virtualCustomSelectData.length?this.virtualCustomSelectData.push(n):this.virtualCustomSelectData=[n]),s=s||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),this.popupWrapper.contains(a)&&(this.list.setAttribute("style",a.getAttribute("style")),this.popupWrapper.replaceChild(this.list,a),this.wireListEvents()),r=null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i,(o=[]).push(r),this.setProperties({text:o.toString()},!0),this.addChip(i,h),this.addListSelection(s))}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,e),"CheckBox"!==this.mode||!this.showSelectAll||!P.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},k.prototype.updateActionCompleteData=function(t,e){this.value&&(!this.allowObjectBinding&&-1<this.value.indexOf(t.getAttribute("data-value"))||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(t.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem)&&P.addClass([t],D)},k.prototype.updateAddItemList=function(t,e){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+y.noData)&&t?(this.list=t,this.mainList=this.ulElement=t.querySelector("ul"),P.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=t,this.mainList=this.ulElement=t.querySelector("ul"))},k.prototype.updateDataList=function(){var t,e,i;this.mainList&&this.ulElement&&!(this.isFiltered||this.filterAction||this.targetElement().trim())&&(t=this.mainList.childElementCount<this.ulElement.childElementCount,e=0<this.ulElement.childElementCount&&0<this.ulElement.children[0].childElementCount&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&0<this.ulElement.childElementCount&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(0<this.ulElement.children[0].childElementCount||this.fields.groupBy&&this.ulElement.children[1]&&0<this.ulElement.children[1].childElementCount),t||e||i)&&(this.mainList=this.ulElement)},k.prototype.isValidLI=function(t){return t&&!t.classList.contains(y.disabled)&&!t.classList.contains(y.group)&&t.classList.contains(y.li)},k.prototype.updateListSelection=function(t,e,i){var s=t.getAttribute("data-value"),l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!P.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(l)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(l,this.value)?this.dispatchSelect(l,e,t,"true"===t.getAttribute("aria-selected"),i):this.removeValue(l,e,i)},k.prototype.updateListSelectEventCallback=function(e,t,i,s){var l,n,a=this,o=(e=this.allowObjectBinding?P.getValue(this.fields.value||"",e):e,s||this.getTextByValue(e));(this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",e)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)?(l=t&&t.cloneNode(!0),s=this.fields.value||"value",this.allowCustomValue&&this.mainData.length&&"number"==typeof P.getValue(s,this.mainData[0])&&(e=isNaN(parseFloat(e.toString()))?e:parseFloat(e.toString())),n=this.getDataByValue(e),this.trigger("customValueSelection",{newData:n,cancel:!1},function(t){t.cancel||(a.enableVirtualization&&a.virtualCustomData?a.virtualCustomSelectData&&0<=a.virtualCustomSelectData.length?a.virtualCustomSelectData.push(n):a.virtualCustomSelectData=[n]:(P.append([l],a.mainList),a.mainData.push(n)),a.remoteCustomValue=!1,a.addValue(e,o,i))})):(this.remoteCustomValue=!1,this.addValue(e,o,i))},k.prototype.removeListSelection=function(){var t=this.hideSelectedItem?D:y.selected,e=this.list.querySelectorAll("."+t),i=e.length;if(e&&e.length)for(P.removeClass(e,t);0<i;)e[i-1].setAttribute("aria-selected","false"),i--;if(!P.isNullOrUndefined(this.mainList)){var s=this.mainList.querySelectorAll("."+t),l=s.length;if(s&&s.length)for(P.removeClass(s,t);0<l;)s[l-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(e&&e.length>l-1&&P.removeClass([e[l-1].firstElementChild.lastElementChild],"e-check"),P.removeClass([s[l-1].firstElementChild.lastElementChild],"e-check")),l--}},k.prototype.removeHover=function(){var t=this.list.querySelectorAll("."+y.hover);t&&t.length&&P.removeClass(t,y.hover)},k.prototype.removeFocus=function(){var t,e;this.list&&this.mainList&&(t=this.list.querySelectorAll("."+y.focus),e=this.mainList.querySelectorAll("."+y.focus),t)&&t.length&&(P.removeClass(t,y.focus),P.removeClass(e,y.focus))},k.prototype.addListHover=function(t){(this.enabled&&this.isValidLI(t)||null!==t&&t.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy))&&(this.removeHover(),P.addClass([t],y.hover))},k.prototype.addListFocus=function(t){this.enabled&&(this.isValidLI(t)||this.fields.disabled&&this.isDisabledElement(t))?(this.removeFocus(),P.addClass([t],y.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&(P.addClass([t],y.focus),this.updateAriaActiveDescendant())},k.prototype.addListSelection=function(t,e){var i=this.hideSelectedItem?D:y.selected;this.isValidLI(t)&&!t.classList.contains(y.hover)&&(P.addClass([t],i),this.updateMainList(!1,t.getAttribute("data-value"),e),t.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&t.classList.contains("e-active")&&0===t.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:t,e:this}),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:t,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=t.id)},k.prototype.updateDelimeter=function(t,e,i){this.updateData(t,e,i)},k.prototype.onMouseClick=function(t){var e,i,s,l=this;this.isClearAllItem||(this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null,i=t.target,e=P.closest(i,"."+y.li),this.enableVirtualization&&e&&e.classList.contains("e-virtual-list"))||(P.closest(i,"."+y.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy?((i=i.classList.contains("e-list-group-item")?i.firstElementChild.lastElementChild:t.target).classList.contains("e-check")?(this.selectAllItem(!1,t),i.classList.remove("e-check"),i.classList.remove("e-stop"),P.closest(i,".e-list-group-item").classList.remove("e-active"),i.setAttribute("aria-selected","false")):(this.selectAllItem(!0,t),i.classList.remove("e-stop"),i.classList.add("e-check"),P.closest(i,".e-list-group-item").classList.add("e-active"),i.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll()):(this.isValidLI(e)?(s=this.value&&this.value.length?this.value.length:0,e.classList.contains("e-active")&&(s-=1),s<this.maximumSelectionLength&&(this.updateListSelection(e,t),this.checkPlaceholderSize(),this.addListFocus(e),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(e.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&50<this.value.length?setTimeout(function(){l.updateDelimeter(l.delimiterChar,t)},0):this.updateDelimeter(this.delimiterChar,t),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,t),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(t):t.preventDefault(),s=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),this.findGroupStart(i),"CheckBox"!==this.mode&&this.refreshListItems(P.isNullOrUndefined(e)?null:e.textContent,s)):t.preventDefault(),this.enableVirtualization&&this.hideSelectedItem&&(i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(e=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,i.length<e+2)&&(s=(s=this.getForQuery(this.value).clone()).skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,s),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():(i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(i)),this.list.querySelector(".e-virtual-ddl-content"))&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.refreshPlaceHolder(),this.deselectHeader()))},k.prototype.findGroupStart=function(t){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)){var e;if(this.itemTemplate&&!t.getElementsByClassName("e-frame").length)for(;!t.getElementsByClassName("e-frame").length;)t=t.parentElement;for(t.classList.contains("e-frame")&&(t=t.parentElement.parentElement),e=this.findGroupAttrtibutes(t,0,0,0,0),e=this.findGroupAttrtibutes(t,e[0],e[1],e[2],1);!t.classList.contains("e-list-group-item")&&null!=(t=(t=t.classList.contains("e-list-icon")?t.parentElement:t).previousElementSibling););this.updateCheckBox(t,e[0],e[1],e[2])}},k.prototype.findGroupAttrtibutes=function(t,e,i,s,l){for(;!t.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(t)||((t=t.classList.contains("e-list-icon")?t.parentElement:t).getElementsByClassName("e-frame")[0].classList.contains("e-check")&&t.classList.contains("e-list-item")?e++:t.classList.contains("e-list-item")&&i++,s++),null!=(t=l?t.nextElementSibling:t.previousElementSibling)););return[e,i,s]},k.prototype.updateCheckBox=function(t,e,i,s){var l;null===t||!P.isNullOrUndefined(this.fields.disabled)&&0===s||(l=t.getElementsByClassName("e-frame")[0],s===e?(l.classList.remove("e-stop"),l.classList.add("e-check"),P.closest(l,".e-list-group-item").classList.add("e-active"),t.setAttribute("aria-selected","true")):s===i?(l.classList.remove("e-check"),l.classList.remove("e-stop"),P.closest(l,".e-list-group-item").classList.remove("e-active"),t.setAttribute("aria-selected","false")):this.maximumSelectionLength===e-1?(l.classList.remove("e-stop"),t.setAttribute("aria-selected","true"),P.closest(l,".e-list-group-item").classList.add("e-active"),l.classList.add("e-check")):(l.classList.remove("e-check"),l.classList.add("e-stop"),P.closest(l,".e-list-group-item").classList.add("e-active"),t.setAttribute("aria-selected","false")))},k.prototype.disableGroupHeader=function(){var t=this.list.querySelectorAll("li.e-list-group-item");if(t)for(var e=0;e<t.length;e++){for(var i=!0,s=t[e].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(t[e])}},k.prototype.deselectHeader=function(){var t=this.value&&this.value.length?this.value.length:0,e=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");t<this.maximumSelectionLength&&P.removeClass(e,"e-disable"),t===this.maximumSelectionLength&&P.addClass(e,"e-disable")},k.prototype.onMouseOver=function(t){var e=P.closest(t.target,"."+y.li);null===e&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(e=P.closest(t.target,"."+y.group)),this.addListHover(e)},k.prototype.onMouseLeave=function(){this.removeHover()},k.prototype.onListMouseDown=function(t){t.preventDefault(),this.scrollFocusStatus=!0},k.prototype.onDocumentClick=function(t){var e;"CheckBox"!==this.mode&&(e=t.target,!P.isNullOrUndefined(this.popupObj)&&P.closest(e,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(t.target)?this.scrollFocusStatus=(P.Browser.isIE||"edge"===P.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1)},k.prototype.wireListEvents=function(){P.isNullOrUndefined(this.list)||(P.EventHandler.add(document,"mousedown",this.onDocumentClick,this),P.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),P.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},k.prototype.unwireListEvents=function(){P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(P.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),P.EventHandler.remove(this.list,"mouseup",this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},k.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},k.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},k.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},k.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},k.prototype.showSpinner=function(){var t;P.isNullOrUndefined(this.spinnerElement)&&(t=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons"),"none"!==this.overAllClear.style.display||t?this.spinnerElement=t||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:de+" "+ve}),this.componentWrapper.appendChild(this.spinnerElement)),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),P.addClass([this.spinnerElement],fe),o.showSpinner(this.spinnerElement))},k.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],fe),this.spinnerElement.classList.contains(ve)?P.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},k.prototype.updateWrapperText=function(t,e){this.valueTemplate||!this.enableHtmlSanitizer?t.innerHTML=this.encodeHtmlEntities(e):t.innerText=e},k.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),P.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove(Ce)),this.value&&this.value.length){var t="",e=void 0,i=void 0,s=1,l=void 0,n=void 0,a=0,o=void 0,r=(this.enableVirtualization||this.updateWrapperText(this.viewWrapper,t),{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"}),h=new P.L10n(this.getLocaleName(),r,this.locale),r=(h=""===(h=""===h.getConstant("actionFailureTemplate")?new P.L10n("dropdowns",r,this.locale):h).getConstant("noRecordsTemplate")?new P.L10n("dropdowns",r,this.locale):h).getConstant("overflowCountTemplate"),h=h.getConstant("totalCountTemplate"),u=this.createElement("span",{className:"e-remain"}),p=r.replace("${count}",this.value.length.toString()),d=(u.innerText=p,this.viewWrapper.appendChild(u),this.renderReactTemplates(),u.offsetWidth);if(P.remove(u),this.showDropDownIcon&&(a=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!P.isNullOrUndefined(this.value)&&(this.allowCustomValue||this.listData&&0<this.listData.length))for(var c=0;!P.isNullOrUndefined(this.value[c]);c++){var m=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?m&&(t=(t+=0===c?"":this.delimiterChar+" ")+(e=m[c]),e=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,t)):(t=(t+=0===c?"":this.delimiterChar+" ")+(e=this.getOverflowVal(c)),e=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,t)),l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),l+a+this.clearIconWidth>o){for(void 0!==i&&""!==i&&(e=i,c=s+1),this.updateWrapperText(this.viewWrapper,e),n=this.value.length-c,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);l+d+a+this.clearIconWidth>o&&0!==l&&""!==this.viewWrapper.innerHTML;)this.viewWrapper.innerHTML=[].join(this.delimiterChar),n=this.value.length,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);break}l+d+a+this.clearIconWidth<=o?(i=t,s=c):0===c&&(i="",s=-1)}0<n&&(p=o-a-this.clearIconWidth,this.viewWrapper.appendChild(this.updateRemainTemplate(u,this.viewWrapper,n,r,h,p)),this.updateRemainWidth(this.viewWrapper,p),this.updateRemainingText(u,a,n,r,h))}else P.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},k.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},k.prototype.updateRemainWidth=function(t,e){t.classList.contains(Ce)&&e<t.offsetWidth+parseInt(window.getComputedStyle(t).paddingLeft,10)+parseInt(window.getComputedStyle(t).paddingLeft,10)&&(t.style.width=e+"px")},k.prototype.updateRemainTemplate=function(t,e,i,s,l,n){e.firstChild&&3===e.firstChild.nodeType&&""===e.firstChild.nodeValue&&e.removeChild(e.firstChild),t.innerHTML="";s=s.replace("${count}",i.toString()),l=l.replace("${count}",i.toString());return t.innerText=e.firstChild&&3===e.firstChild.nodeType?s:l,e.firstChild&&3===e.firstChild.nodeType?e.classList.remove(Ce):(e.classList.add(Ce),this.updateRemainWidth(e,n)),t},k.prototype.updateRemainingText=function(t,e,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(n<=a+e&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;n<a+e&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var o=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);o.pop(),this.viewWrapper.firstChild.nodeValue=o.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}this.updateRemainTemplate(t,this.viewWrapper,i,s,l,n-e)}},k.prototype.getOverflowVal=function(t){var e,i,s;return this.mainData&&this.mainData.length?(i=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[t]):this.value[t],"CheckBox"===this.mode?(s=this.listData,this.listData=this.mainData,e=this.getTextByValue(i),this.listData=s):e=this.getTextByValue(i)):e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[t]):this.value[t],e},k.prototype.unWireEvent=function(){var t;P.isNullOrUndefined(this.componentWrapper)||P.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),P.EventHandler.remove(window,"resize",this.windowResize),P.isNullOrUndefined(this.inputElement)||(P.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),P.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.keyUp),(t=P.closest(this.inputElement,"form"))&&P.EventHandler.remove(t,"reset",this.resetValueHandler),P.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)),P.isNullOrUndefined(this.componentWrapper)||(P.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),P.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),P.isNullOrUndefined(this.overAllClear)||P.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),P.isNullOrUndefined(this.inputElement)||P.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},k.prototype.resizingWireEvent=function(){P.EventHandler.add(document,"mousemove",this.resizePopup,this),P.EventHandler.add(document,"mouseup",this.stopResizing,this),P.EventHandler.add(document,"touchmove",this.resizePopup,this),P.EventHandler.add(document,"touchend",this.stopResizing,this)},k.prototype.resizingUnWireEvent=function(){P.EventHandler.remove(document,"mousemove",this.resizePopup),P.EventHandler.remove(document,"mouseup",this.stopResizing),P.EventHandler.remove(document,"touchmove",this.resizePopup),P.EventHandler.remove(document,"touchend",this.stopResizing)},k.prototype.selectAllItem=function(t,e,i){var s;if(P.isNullOrUndefined(this.list)||(s=this.list.querySelectorAll(t?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&e&&e.target&&P.closest(e.target,".e-close-hooker")&&this.allowFiltering&&(s=this.mainList.querySelectorAll(t?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)){var l=e?this.groupTemplate?P.closest(e.target,".e-list-group-item"):e.target:null;if((l=(l=e&&32===e.keyCode?i:l)&&l.classList.contains("e-frame")?l.parentElement.parentElement:l)&&l.classList.contains("e-list-group-item")){var n,a=l.nextElementSibling;if(P.isNullOrUndefined(a))return;for(;a.classList.contains("e-list-item");)if(this.fields.disabled&&this.isDisabledElement(a)||(t?a.firstElementChild.lastElementChild.classList.contains("e-check")||(n=this.value&&this.value.length?this.value.length:0,a.classList.contains("e-active")&&--n,n<this.maximumSelectionLength&&this.updateListSelection(a,e)):a.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(a,e)),null==(a=a.nextElementSibling))break;l.classList.contains("e-list-group-item")&&((i=this.list.getElementsByClassName("e-item-focus")[0])&&i.classList.remove("e-item-focus"),t?l.classList.add("e-active"):l.classList.remove("e-active"),l.classList.add("e-item-focus"),this.updateAriaActiveDescendant()),this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&e&&this.updateValueState(e,this.value,this.tempValues)}else this.updateValue(e,s,t)}else this.updateValue(e,s,t);this.addValidInputClass()},k.prototype.virtualSelectionAll=function(t,e,s){var l=this,i=0,n=e.length,a=this.maximumSelectionLength;if(t){this.virtualSelectAll=!0,n=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:n,this.listData=this.virtualSelectAllData;var t=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),o=document.createDocumentFragment(),r=(t.forEach(function(t){o.appendChild(t.cloneNode(!0))}),e.forEach(function(t){o.appendChild(t.cloneNode(!0))}),o.childNodes);if(this.virtualSelectAllData instanceof Array){for(;i<n&&i<=50&&i<a;){if(this.isSelectAllTarget=n===i+1,r[i]){var h=this.allowObjectBinding?this.getDataByValue(r[i].getAttribute("data-value")):this.getFormattedValue(r[i].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.updateListSelection(r[i],s,n-i)}else{h=P.getValue(this.fields.value||"",this.virtualSelectAllData[i]);if(h=this.allowObjectBinding?this.getDataByValue(h):h,!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.value&&null!=h&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.dispatchSelect(h,s,null,!1,n)}i++}50<n&&setTimeout(function(){var t;l.virtualSelectAllData&&0<l.virtualSelectAllData.length&&l.virtualSelectAllData.map(function(t){var e,i;l.value&&null!=t[l.fields.value]&&Array.isArray(l.value)&&(!l.allowObjectBinding&&l.value.indexOf(t[l.fields.value])<0||l.allowObjectBinding&&!l.isObjectInArray(t[l.fields.value],l.value))&&(e=t[l.fields.value],i=t[l.fields.text].toString(),l.dispatchSelect(e,s,null,!1,n,t,i))}),l.updatedataValueItems(s),l.isSelectAllLoop=!1,l.changeOnBlur||(l.updateValueState(s,l.value,l.tempValues),l.isSelectAll=l.isSelectAll&&!l.isSelectAll),l.updateHiddenElement(!0),l.popupWrapper&&e[i-1]&&e[i-1].classList.contains("e-item-focus")&&(t=document.getElementsByClassName("e-selectall-parent")[0])&&t.classList.contains("e-item-focus")&&e[i-1].classList.remove("e-item-focus")},0)}}else this.virtualSelectAllData&&0<this.virtualSelectAllData.length&&this.virtualSelectAllData.map(function(t){l.virtualSelectAll=!0,l.removeValue(l.value[i],s,l.value.length-i)}),this.updatedataValueItems(s),this.changeOnBlur||(this.updateValueState(s,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.virtualSelectAll=!1,P.isNullOrUndefined(this.viewPortInfo.startIndex)||P.isNullOrUndefined(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});t=this.list.getElementsByClassName("e-virtual-ddl")[0],t&&(t.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton(),t=this.list.getElementsByClassName("e-virtual-ddl-content")[0];t&&(t.style=this.getTransformValues())},k.prototype.updateValue=function(e,i,t){var s=this,l=i.length,n={event:e,items:t?i:[],itemData:t?this.listData:[],isInteracted:!!e,isChecked:t,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",n),i&&i.length||this.enableVirtualization&&!t){var a=0,o=0,o=this.enableGroupCheckBox?t?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:t?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;if(n.preventSelectEvent){for(var r=0;r<i.length&&r<o;r++){this.removeHover();var h=i[r].getAttribute("data-value"),h=this.getFormattedValue(h),h=this.allowObjectBinding?this.getDataByValue(h):h,u=this.mainList?this.mainList.querySelectorAll(t?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[r]:null;t?(this.value=this.value||[],(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.setProperties({value:[].concat([],this.value,[h])},!0),this.removeFocus(),this.addListSelection(i[r],u),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(h,e,!1,i[r],u),this.enableGroupCheckBox&&this.findGroupStart(i[r])}t||(this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength&&(p=this.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.removeClass(p,"e-disable"));var p={event:e,items:t?i:[],itemData:t?this.listData:[],isInteracted:!!e,isChecked:t};this.trigger("selectedAll",p)}else if(this.enableVirtualization)this.virtualSelectAllState=t,this.virtualSelectAll=!0,this.CurrentEvent=e,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new c.Query),this.virtualSelectAllData&&this.virtualSelectionAll(t,i,e);else{for(;a<l&&a<=50&&a<o;)this.isSelectAllTarget=l===a+1,this.updateListSelection(i[a],e,l-a),this.enableGroupCheckBox&&this.findGroupStart(i[a]),a++;50<l&&setTimeout(function(){for(;a<l&&a<o;)s.isSelectAllTarget=l===a+1,s.updateListSelection(i[a],e,l-a),s.enableGroupCheckBox&&s.findGroupStart(i[a]),a++;var t;s.updatedataValueItems(e),s.changeOnBlur||(s.updateValueState(e,s.value,s.tempValues),s.isSelectAll=s.isSelectAll&&!s.isSelectAll),s.updateHiddenElement(),s.popupWrapper&&i[a-1].classList.contains("e-item-focus")&&(t=document.getElementsByClassName("e-selectall-parent")[0])&&t.classList.contains("e-item-focus")&&i[a-1].classList.remove("e-item-focus")},0)}}this.updatedataValueItems(e),this.checkPlaceholderSize(),l<=50&&!n.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(e,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.enableVirtualization&&this.value&&0<this.value.length||!this.enableVirtualization)&&this.updateHiddenElement()},k.prototype.updateHiddenElement=function(i){var s=this,l="",n="",a="",o=[];"CheckBox"===this.mode&&(this.value.map(function(t,e){l+='<option selected value ="'+t+'">'+e+"</option>",i||(a=s.listData?s.getTextByValue(t):t,n+=a+s.delimiterChar+" ",o.push(a))}),this.hiddenElement.innerHTML=l,i||(this.updateWrapperText(this.delimiterWrapper,n),this.setProperties({text:o.toString()},!0)),this.delimiterWrapper.setAttribute("id",P.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},k.prototype.updatedataValueItems=function(t){this.deselectHeader(),this.textboxValueUpdate(t)},k.prototype.textboxValueUpdate=function(t){var e=t&&t.target&&(P.closest(t.target,".e-selectall-parent")||P.closest(t.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||e)?this.searchWrapper.classList.remove(pe):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!e&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,t),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,t),this.refreshPlaceHolder()},k.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},k.prototype.updateDataSource=function(t){P.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},k.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},k.prototype.selectAllItems=function(e,i){var t,s=this;P.isNullOrUndefined(this.list)?(this.selectAllAction=function(){var t;"CheckBox"===s.mode&&s.showSelectAll&&(t={module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:e?"check":"uncheck"},s.notify("checkSelectAll",t)),s.selectAllItem(e,i),s.selectAllAction=null},A.prototype.render.call(this)):(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll&&(t={value:e?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"},this.notify("checkSelectAll",t)),this.selectAllItem(e,i)),this.dataSource instanceof c.DataManager&&!(this.dataSource instanceof c.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.prototype.onPropertyChanged=function(t,e){(t.dataSource&&!P.isNullOrUndefined(Object.keys(t.dataSource))||t.query&&!P.isNullOrUndefined(Object.keys(t.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],t));for(var i=0,s=Object.keys(t);i<s.length;i++){var l,n=s[i];switch(n){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(P.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(t.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,e.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")&&(a=this.list.querySelectorAll("li."+y.li+".e-active.e-disable"),P.removeClass(a,"e-disable")),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(t.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:t.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(t.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(e.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(t.enableRtl),A.prototype.onPropertyChanged.call(this,t,e);break;case"allowResize":this.allowResize=t.allowResize,!this.allowResize&&this.popupObj&&(l=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(l),this.popupWrapper.style.height=P.formatUnit(this.popupHeight),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight));break;case"readonly":this.updateReadonly(t.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(t.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":this.popupObj&&(l=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(l),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight));break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":P.isNullOrUndefined(this.fields.groupBy)&&this.removeScrollEvent();break;default:var a=this.getPropObject(n,t,e);A.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty)}}},k.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},k.prototype.totalItemsCount=function(){var t;if(this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?t=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):t=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==t?t:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==t&&this.value?t-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length)for(var e=0;e<this.virtualCustomSelectData.length;e++)for(var i=0;i<this.value.length;i++)(this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[i]):this.value[i])===P.getValue(this.fields.value||"",this.virtualCustomSelectData[e])&&(this.totalItemCount+=1)}else this.totalItemCount=0!==t?t:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&(this.totalItemCount+=this.virtualCustomSelectData.length)},k.prototype.presentItemValue=function(t){for(var e=[],i=0;i<this.value.length;i++){var s=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[i]):this.value[i];this.findListElement(this.allowFiltering&&!P.isNullOrUndefined(this.mainList)?this.mainList:t,"li","data-value",s)||(s=this.allowObjectBinding?this.getDataByValue(this.value[i]):this.value[i],e.push(s))}return e},k.prototype.addNonPresentItems=function(t,e,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(t)).then(function(t){0<t.result.length&&l.addItem(t.result,i.length),l.updateActionList(e,i,s)})},k.prototype.updateVal=function(t,e,i){var s;this.list&&(!(this.dataSource instanceof c.DataManager)||this.listData&&this.mainList&&this.mainData)?(s=[],P.isNullOrUndefined(this.value)||this.allowCustomValue||(s=this.presentItemValue(this.ulElement)),"value"===i&&0<s.length&&this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(this.value)&&null!=this.listData?(this.mainData=null,this.setDynValue=!0,this.isaddNonPresentItems=!0,this.addNonPresentItems(s,this.ulElement,this.listData),this.isaddNonPresentItems=!1):("text"===i&&(this.initialTextUpdate(),t=this.value),!P.isNullOrUndefined(this.value)&&0!==this.value.length||(this.tempValues=e),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData&&(s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(s,this.mainData)),this.enableVirtualization?!this.enableVirtualization||this.dataSource instanceof c.DataManager?this.isInitRemoteVirtualData||(this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()):this.initialValueUpdate(this.dataSource,!0):this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,t,e),this.checkPlaceholderSize())):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,t,e)},k.prototype.addItem=function(t,e){A.prototype.addItem.call(this,t,e)},k.prototype.hidePopup=function(t){var e,i=this;this.isPopupOpen()&&(e={name:"FadeOut",duration:100,delay:100},this.customFilterQuery=null,e={popup:this.popupObj,cancel:!1,animation:e,event:t||null},this.trigger("close",e,function(t){var e;t.cancel||(i.fields.groupBy&&"CheckBox"!==i.mode&&i.fixedHeaderElement&&(P.remove(i.fixedHeaderElement),i.fixedHeaderElement=null),i.beforePopupOpen=!1,i.overAllWrapper.classList.remove(ye),e="CheckBox"===i.mode?i.targetElement():null,i.popupObj.hide(new P.Animation(t.animation)),P.attributes(i.inputElement,{"aria-expanded":"false"}),i.inputElement.removeAttribute("aria-owns"),i.inputElement.removeAttribute("aria-activedescendant"),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"clear"}),i.popupObj.hide(),P.removeClass([document.body,i.popupObj.element],"e-popup-full-page"),P.EventHandler.remove(i.list,"keydown",i.onKeyDown),"CheckBox"===i.mode&&i.showSelectAll&&P.EventHandler.remove(i.popupObj.element,"click",i.clickHandler),i.list&&i.list.parentElement&&i.allowResize&&(i.resizer&&i.list.parentElement.contains(i.resizer)&&i.list.parentElement.removeChild(i.resizer),i.list.parentElement.classList.contains("e-resize")&&i.list.parentElement.classList.remove("e-resize"),i.list.parentElement.style.boxSizing="",i.list.parentElement.style.paddingBottom="",t=parseInt(i.popupHeight,10),i.list.style.maxHeight=P.formatUnit(t),i.list.parentElement.style.height=P.formatUnit(i.popupHeight),i.list.parentElement.style.maxHeight=P.formatUnit(i.popupHeight)),i.resizer&&(P.EventHandler.remove(i.resizer,"mousedown",i.startResizing),i.resizer.remove()),t=void(i.enableVirtualization&&"CheckBox"===i.mode&&i.value&&0<i.value.length&&i.enableSelectionOrder&&(i.viewPortInfo.startIndex=i.virtualItemStartIndex=0,i.viewPortInfo.endIndex=i.virtualItemEndIndex=0<i.viewPortInfo.startIndex?i.viewPortInfo.endIndex:i.itemCount,i.virtualListInfo=i.viewPortInfo,i.previousStartIndex=0,i.previousEndIndex=i.itemCount)),i.dataSource instanceof c.DataManager?0<=i.remoteDataCount?i.totalItemCount=i.dataCount=i.remoteDataCount:i.resetList(i.dataSource):t=i.dataSource&&i.dataSource.length?i.dataSource.length:0,i.enableVirtualization&&(i.allowFiltering||i.allowCustomValue)&&(i.targetElement()||e)&&i.totalItemCount!==t&&(i.checkAndResetCache(),i.updateInitialData()),i.virtualCustomData&&i.viewPortInfo&&0===i.viewPortInfo.startIndex&&i.viewPortInfo.endIndex===i.itemCount&&i.renderItems(i.mainData,i.fields),i.virtualCustomData=null,i.isVirtualTrackHeight=!1)}))},k.prototype.showPopup=function(n){var a=this;this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.trigger("beforeOpen",{cancel:!1},function(t){if(!t.cancel)if(a.ulElement){"CheckBox"===a.mode&&P.Browser.isDevice&&a.allowFiltering&&a.isDeviceFullScreen&&a.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode});var t=a.ulElement.querySelectorAll("li.e-list-item").length,e=a.ulElement.querySelectorAll("li."+y.li+"."+D).length;if(0<t&&t===e&&e===a.mainData.length&&(""===a.targetElement()||!a.allowCustomValue))a.beforePopupOpen=!1;else{if(a.onPopupShown(n),a.enableVirtualization&&a.listData&&a.listData.length&&(P.isNullOrUndefined(a.value)||"dropdownlist"!==a.getModuleName()&&"combobox"!==a.getModuleName()||a.removeHover(),a.beforePopupOpen||(a.hideSelectedItem&&a.value&&Array.isArray(a.value)&&0<a.value.length&&a.totalItemsCount(),a.preventSetCurrentData)||P.isNullOrUndefined(a.viewPortInfo.startIndex)||P.isNullOrUndefined(a.viewPortInfo.endIndex)||a.notify("setCurrentViewDataAsync",{component:a.getModuleName(),module:"VirtualScroll"})),a.enableVirtualization&&!a.allowFiltering&&null!=a.selectedValueInfo&&0<a.selectedValueInfo.startIndex&&null!=a.value&&a.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),a.enableVirtualization)a.updatevirtualizationList();else if(a.value&&a.value.length){a.getItems();for(var i=0,s=a.value;i<s.length;i++){var l=s[i],l=a.allowObjectBinding?P.getValue(a.fields.value||"",l):l;(l=a.getElementByValue(l))&&a.addListSelection(l)}}a.allowResize&&a.setResize(),a.preventSetCurrentData=!0}}else a.beforePopupOpen=!0,"CheckBox"===a.mode&&P.Browser.isDevice&&a.allowFiltering&&a.isDeviceFullScreen&&a.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode}),A.prototype.render.call(a,n)}))},k.prototype.selectAll=function(t){this.isSelectAll=!0,this.selectAllItems(t)},k.prototype.getModuleName=function(){return"multiselect"},k.prototype.clear=function(){var t=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){t.setProperties({value:null},!0)},0):this.setProperties({value:null},!0)},k.prototype.render=function(){!P.isNullOrUndefined(this.value)&&0<this.value.length&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view "+ce,styles:"display:none;"}),this.overAllClear=this.createElement("span",{className:de,styles:"display:none;"}),this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&P.addClass([this.overAllWrapper],"e-checkbox"),P.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:ce,styles:"display:none"}),this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection",styles:"display:none"}),"Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",P.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",P.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!P.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add(me),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),P.isNullOrUndefined(this.inputElement)||(P.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label"))||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?Yt(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var t=this.element.getAttribute("id")?this.element.getAttribute("id"):P.getUniqueID("ej2_dropdownlist");this.element.id=t,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!P.isNullOrUndefined(P.closest(this.element,"fieldset"))&&P.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},k.prototype.setResize=function(){var t;this.list&&this.list.parentElement&&P.isNullOrUndefined(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement&&(this.list.parentElement.classList.add("e-resize"),"auto"!==this.popupHeight.toString().toLowerCase()&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box",t="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16,this.list.parentElement.style.paddingBottom=t+"px",this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px"),this.resizer&&(P.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),P.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},k.prototype.startResizing=function(t){this.isResizing=!0,this.trigger("resizeStart",t);var e=(t instanceof MouseEvent?t:t.touches[0]).clientX,i=(t instanceof MouseEvent?t:t.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=e,this.originalMouseY=i),this.resizingWireEvent(),t&&t.preventDefault()},k.prototype.resizePopup=function(t){var e,i,s,l;this.isResizing&&(this.trigger("resizing",t),e=(t instanceof MouseEvent?t:t.touches[0]).clientX,i=(t instanceof MouseEvent?t:t.touches[0]).clientY,e=e-this.originalMouseX,i=i-this.originalMouseY,this.resizeWidth=Math.max(this.originalWidth+e,100),this.resizeHeight=Math.max(this.originalHeight+i,130),this.list&&this.list.parentElement&&(s=(s=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,l=(l=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+e,s),this.resizeHeight=Math.max(this.originalHeight+i,l),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),t)&&t.preventDefault()},k.prototype.stopResizing=function(t){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",t),this.resizingUnWireEvent()),t&&t.preventDefault()},k.prototype.getListHeight=function(){var t=this.createElement("div",{className:"e-dropdownbase"}),e=this.createElement("li",{className:"e-list-item"}),i=P.formatUnit(this.popupHeight),i=(t.style.height=parseInt(i,10).toString()+"px",t.appendChild(e),document.body.appendChild(t),this.virtualListHeight=t.getBoundingClientRect().height,Math.ceil(e.getBoundingClientRect().height)+parseInt(window.getComputedStyle(e).marginBottom,10));return t.remove(),i},k.prototype.removeDisabledItemsValue=function(t){if(t){for(var e=[],i=0,s=0;s<t.length;s++){var l=t[s];null==(l="object"==typeof l?JSON.parse(JSON.stringify(l))[this.fields.value]:l)||this.isDisabledItemByIndex(this.getIndexByValue(l))||(e[i++]=t[s])}this.value=0<e.length?e:null}},k.prototype.checkInitialValue=function(){var e,i=this,t=(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.dataSource instanceof Array?0<this.dataSource.length:!P.isNullOrUndefined(this.dataSource));if((!this.value||!this.value.length)&&P.isNullOrUndefined(this.text)&&!t&&"SELECT"===this.element.tagName&&0<this.element.options.length){for(var s=this.element.options,l=[],n="",a=0,o=s.length;a<o;a++){var r=s[a];P.isNullOrUndefined(r.getAttribute("selected"))||(r.getAttribute("value")?(d=this.allowObjectBinding?this.getDataByValue(r.getAttribute("value")):r.getAttribute("value"),l.push(d)):n+=r.text+this.delimiterChar)}0<l.length?this.setProperties({value:l},!0):""!==n&&this.setProperties({text:n},!0),(0<l.length||""!==n)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if(!(this.value&&this.value.length||!P.isNullOrUndefined(this.text))||this.list||A.prototype.render.call(this),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),P.isNullOrUndefined(this.text)||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){if(this.enableVirtualization){for(var h=this.isPrimitiveData?"":this.fields.value,u=void 0,p=0;p<this.value.length;p++)var d=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[p]):this.value[p],u=0===p?new c.Predicate(h,"equal",d):u.or(h,"equal",d);this.dataSource instanceof c.DataManager?this.dataSource.executeQuery((new c.Query).where(u)).then(function(t){0<t.result.length&&(e=t.result,i.initStatus=!1,i.isInitRemoteVirtualData=!0,setTimeout(function(){i.initialValueUpdate(e,!0),i.initialUpdate(),i.isInitRemoteVirtualData=!1},100),i.initStatus=!0)}):e=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(u))}this.dataSource instanceof c.DataManager?this.setInitialValue=function(){i.initStatus=!1,i.enableVirtualization&&(!i.enableVirtualization||i.dataSource instanceof c.DataManager)||i.initialValueUpdate(e),i.initialUpdate(),i.setInitialValue=null,i.initStatus=!0}:(this.initialValueUpdate(e,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),P.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},k.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},k.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var t,e,i=0,s=this.value;i<s.length;i++){var l=s[i],l=this.allowObjectBinding?P.getValue(this.fields.value||"",l):l;(l=this.getElementByValue(l))&&this.addListSelection(l)}this.enableVirtualization&&this.hideSelectedItem&&(e=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(t=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,e.length<t+2)&&(e=(e=this.getForQuery(this.value).clone()).skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,e))}},k.prototype.setFloatLabelType=function(){Zt(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&Yt(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},k.prototype.addValidInputClass=function(){P.isNullOrUndefined(this.overAllWrapper)||(!P.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?P.addClass([this.overAllWrapper],"e-valid-input"):P.removeClass([this.overAllWrapper],"e-valid-input"))},k.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:ge}),this.componentWrapper.appendChild(this.dropIcon),P.addClass([this.componentWrapper],["e-down-icon"])):P.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),P.removeClass([this.componentWrapper],["e-down-icon"]))},k.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},k.prototype.disableItem=function(t){if(this.fields.disabled){this.list||this.renderList();var e,i,s=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof t)s=this.getIndexByValue(t);else if("object"==typeof t){if(t instanceof HTMLLIElement){for(var l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===t){s=this.getIndexByValue(t.getAttribute("data-value"));break}}else for(var n=JSON.parse(JSON.stringify(t))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===n){s=this.getIndexByValue(n);break}}else s=t;s<this.liCollections.length&&-1<s&&!JSON.parse(JSON.stringify(this.listData[s]))[this.fields.disabled]&&(e=this.liCollections[s])&&(this.disableListItem(e),(i=JSON.parse(JSON.stringify(this.listData[s])))[this.fields.disabled]=!0,this.listData[s]=i,e.classList.contains(y.focus)&&this.removeFocus(),(e.classList.contains(D)||e.classList.contains(y.selected))&&(i=this.value,this.removeDisabledItemsValue(this.value),this.updateVal(this.value,i,"value")),"CheckBox"===this.mode)&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&this.disableGroupHeader()}}},k.prototype.destroy=function(){this.isReact&&this.clearTemplate(),P.isNullOrUndefined(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var t=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],e=t.length;if(!P.isNullOrUndefined(this.inputElement))for(;0<e;)this.inputElement.removeAttribute(t[e-1]),e--;for(P.isNullOrUndefined(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName!==this.getNgDirective()&&this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),P.remove(this.overAllWrapper)),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var i=this.overAllWrapper.querySelector("select.e-multi-hidden");for(i&&i.parentElement&&i.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var s=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],l=0;l<s.length;l++)this.inputElement.removeAttribute(s[l]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,A.prototype.destroy.call(this)},w([P.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},tt)],k.prototype,"fields",void 0),w([P.Property(!1)],k.prototype,"enablePersistence",void 0),w([P.Property(null)],k.prototype,"groupTemplate",void 0),w([P.Property("No records found")],k.prototype,"noRecordsTemplate",void 0),w([P.Property("Request failed")],k.prototype,"actionFailureTemplate",void 0),w([P.Property("None")],k.prototype,"sortOrder",void 0),w([P.Property(!0)],k.prototype,"enabled",void 0),w([P.Property(!0)],k.prototype,"enableHtmlSanitizer",void 0),w([P.Property(!1)],k.prototype,"enableVirtualization",void 0),w([P.Property([])],k.prototype,"dataSource",void 0),w([P.Property(null)],k.prototype,"query",void 0),w([P.Property("StartsWith")],k.prototype,"filterType",void 0),w([P.Property(1e3)],k.prototype,"zIndex",void 0),w([P.Property(!1)],k.prototype,"ignoreAccent",void 0),w([P.Property()],k.prototype,"locale",void 0),w([P.Property(!1)],k.prototype,"enableGroupCheckBox",void 0),w([P.Property(null)],k.prototype,"cssClass",void 0),w([P.Property("100%")],k.prototype,"width",void 0),w([P.Property("300px")],k.prototype,"popupHeight",void 0),w([P.Property("100%")],k.prototype,"popupWidth",void 0),w([P.Property(null)],k.prototype,"placeholder",void 0),w([P.Property(null)],k.prototype,"filterBarPlaceholder",void 0),w([P.Property({})],k.prototype,"htmlAttributes",void 0),w([P.Property(null)],k.prototype,"valueTemplate",void 0),w([P.Property(null)],k.prototype,"headerTemplate",void 0),w([P.Property(null)],k.prototype,"footerTemplate",void 0),w([P.Property(null)],k.prototype,"itemTemplate",void 0),w([P.Property(null)],k.prototype,"allowFiltering",void 0),w([P.Property(!0)],k.prototype,"isDeviceFullScreen",void 0),w([P.Property(!0)],k.prototype,"changeOnBlur",void 0),w([P.Property(!1)],k.prototype,"allowCustomValue",void 0),w([P.Property(!0)],k.prototype,"showClearButton",void 0),w([P.Property(1e3)],k.prototype,"maximumSelectionLength",void 0),w([P.Property(!1)],k.prototype,"readonly",void 0),w([P.Property(!1)],k.prototype,"allowResize",void 0),w([P.Property(null)],k.prototype,"text",void 0),w([P.Property(null)],k.prototype,"value",void 0),w([P.Property(!1)],k.prototype,"allowObjectBinding",void 0),w([P.Property(!0)],k.prototype,"hideSelectedItem",void 0),w([P.Property(!0)],k.prototype,"closePopupOnSelect",void 0),w([P.Property("Default")],k.prototype,"mode",void 0),w([P.Property(",")],k.prototype,"delimiterChar",void 0),w([P.Property(!0)],k.prototype,"ignoreCase",void 0),w([P.Property(!1)],k.prototype,"showDropDownIcon",void 0),w([P.Property("Never")],k.prototype,"floatLabelType",void 0),w([P.Property(!1)],k.prototype,"showSelectAll",void 0),w([P.Property("Select All")],k.prototype,"selectAllText",void 0),w([P.Property("Unselect All")],k.prototype,"unSelectAllText",void 0),w([P.Property(!0)],k.prototype,"enableSelectionOrder",void 0),w([P.Property(!0)],k.prototype,"openOnClick",void 0),w([P.Property(!1)],k.prototype,"addTagOnBlur",void 0),w([P.Event()],k.prototype,"change",void 0),w([P.Event()],k.prototype,"removing",void 0),w([P.Event()],k.prototype,"removed",void 0),w([P.Event()],k.prototype,"beforeSelectAll",void 0),w([P.Event()],k.prototype,"selectedAll",void 0),w([P.Event()],k.prototype,"beforeOpen",void 0),w([P.Event()],k.prototype,"open",void 0),w([P.Event()],k.prototype,"close",void 0),w([P.Event()],k.prototype,"blur",void 0),w([P.Event()],k.prototype,"focus",void 0),w([P.Event()],k.prototype,"chipSelection",void 0),w([P.Event()],k.prototype,"resizeStop",void 0),w([P.Event()],k.prototype,"resizing",void 0),w([P.Event()],k.prototype,"resizeStart",void 0),w([P.Event()],k.prototype,"filtering",void 0),w([P.Event()],k.prototype,"tagging",void 0),w([P.Event()],k.prototype,"customValueSelection",void 0),w([P.NotifyPropertyChanges],k));function k(t,e){t=A.call(this,t,e)||this;return t.clearIconWidth=0,t.previousFilterText="",t.storedSelectAllHeight=0,t.isUpdateHeaderHeight=!1,t.isUpdateFooterHeight=!1,t.isBlurDispatching=!1,t.isFilterPrevented=!1,t.isFilteringAction=!1,t.isVirtualReorder=!1,t.isValidKey=!1,t.selectAllEventData=[],t.selectAllEventEle=[],t.preventSetCurrentData=!1,t.isSelectAllLoop=!1,t.scrollFocusStatus=!1,t.keyDownStatus=!1,t}var Ee="e-frame",xe="e-check",Ie="e-checkbox-wrapper",we="e-stop",Oe="e-input-group-icon e-clear-icon e-icons",Ae="e-clear-icon",De="e-popup-full-page",ke="e-input-focus",Ne=(N.prototype.getModuleName=function(){return"CheckBoxSelection"},N.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),P.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},N.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},N.prototype.listOption=function(t){var e,i=this;P.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated)?this.parent.listCurrentOptions.itemCreated=function(t){i.checboxCreate(t)}:(e=this.parent.listCurrentOptions.itemCreated,this.parent.listCurrentOptions.itemCreated=function(t){i.checboxCreate(t),e.apply(i,[t])})},N.prototype.setPlaceholder=function(t){h.Input.setPlaceholder(t.filterBarPlaceholder,this.filterInput)},N.prototype.checboxCreate=function(t){var e,i,t=P.isNullOrUndefined(t.item)?t:t.item;return(this.parent.enableGroupCheckBox||"e-list-group-item "!==t.className&&"e-list-group-item"!==t.className)&&(e=H.createCheckBox(this.parent.createElement,!0),i=P.select("div.e-icons",t),t.insertBefore(e,t.childNodes[P.isNullOrUndefined(i)?0:1]),P.select("."+Ee,e),this.parent.enableGroupCheckBox)&&this.parent.popupWrapper.classList.add("e-multiselect-group"),t},N.prototype.setSelectAll=function(){this.parent.showSelectAll?(P.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(P.isNullOrUndefined(this.parent.filterParent)?P.append([this.checkAllParent],this.parent.popupWrapper):P.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(P.isNullOrUndefined(this.parent.filterParent)?P.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),P.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):P.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},N.prototype.destroy=function(){this.removeEventListener(),P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},N.prototype.listSelection=function(t){var e;e=P.isNullOrUndefined(t.e)?(t.li.querySelector(".e-checkbox-wrapper")||t.li.lastElementChild).childNodes[1]:(t.li.querySelector(".e-checkbox-wrapper .e-frame"),!P.isNullOrUndefined(t.e.target)&&t.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(t.e.target))?t.e.target:t.li.querySelector(".e-checkbox-wrapper").childNodes[1]),(this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(e=t.li.firstElementChild.childNodes[1]),P.isNullOrUndefined(e)||(this.checkWrapper=P.closest(e,"."+Ie)),P.isNullOrUndefined(this.checkWrapper)||(e=P.select("."+Ee,this.checkWrapper),this.validateCheckNode(this.checkWrapper,e.classList.contains(xe),t.li,t.e,!1))},N.prototype.validateCheckNode=function(t,e,i,s,l){this.changeState(t,e?"uncheck":"check",s,!0,l)},N.prototype.clickHandler=function(t){var e=t.currentTarget.classList.contains(this.checkAllParent.className)||t.currentTarget.classList.value===this.checkAllParent.className?t.currentTarget.firstElementChild.lastElementChild:t.currentTarget;this.checkWrapper=P.closest(e,"."+Ie);P.isNullOrUndefined(this.checkWrapper)||(e=P.select("."+Ee,this.checkWrapper),this.validateCheckNode(this.checkWrapper,e.classList.contains(xe),null,t,!0)),t.preventDefault()},N.prototype.changeState=function(t,e,i,s,l){t=t.getElementsByClassName(Ee)[0];"check"!==e||t.classList.contains(xe)?"uncheck"===e&&(t.classList.contains(xe)||t.classList.contains(we))?(P.removeClass([t],[xe,we]),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):"indeterminate"!==e||t.classList.contains(we)||(P.removeClass([t],[xe]),t.classList.add(we),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):(t.classList.remove(we),t.classList.add(xe),l&&(this.parent.selectAllItems(!0,i),this.setLocale(!0)))},N.prototype.setSearchBox=function(t){var e;if(P.isNullOrUndefined(this.parent.filterParent))return this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element),e=!1,P.Browser.isDevice&&this.parent.isDeviceFullScreen&&(this.parent.mobFilter=!(e=!0)),this.filterInputObj=h.Input.createInput({element:this.filterInput,buttons:e?["e-input-group-icon e-back-icon e-icons",Oe]:[Oe],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),P.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?P.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&P.addClass([this.filterInputObj.container],"e-filled")),P.append([this.filterInputObj.container],this.parent.filterParent),P.prepend([this.parent.filterParent],t.popupElement),P.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":t.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+Ae),!P.Browser.isDevice&&this.clearIconElement&&(P.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),P.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),P.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),P.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),P.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),P.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj},N.prototype.clickOnBackIcon=function(t){this.parent.hidePopup(),P.removeClass([document.body,this.parent.popupObj.element],De),this.parent.inputElement.focus()},N.prototype.clearText=function(t){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&(P.isNullOrUndefined(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(t),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),t.preventDefault()},N.prototype.preventListSelection=function(t){t.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},N.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector("."+Ae),this.clearIconElement.style.visibility="hidden",P.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),P.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},N.prototype.setSearchBoxPosition=function(){var t=this.filterInput.parentElement.getBoundingClientRect().height,e=0,i=0,s=0,t=(this.checkAllParent&&(e=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(s=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(i=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-t-e-s-i+"px",this.parent.list.style.height=window.innerHeight-t-e-s-i+"px",this.filterInput.parentElement.querySelector("."+Ae));P.detach(this.filterInput),t.parentElement.insertBefore(this.filterInput,t)},N.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&(P.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),P.addClass([document.body,this.parent.popupObj.element],De),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},N.prototype.targetElement=function(){return P.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},N.prototype.onBlurHandler=function(t){var e;this.parent.element.classList.contains("e-listbox")||(e=void 0,this.parent.keyAction)||(P.Browser.isIE&&(e=!P.isNullOrUndefined(t)&&t.target),P.Browser.isIE||(e=!P.isNullOrUndefined(t)&&t.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(e)&&!P.Browser.isIE&&this.filterInput?this.filterInput.focus():this.parent.scrollFocusStatus&&this.filterInput?(t.preventDefault(),this.filterInput.focus(),this.parent.scrollFocusStatus=!1):(this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(t,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove(ke),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!P.Browser.isDevice&&this.parent.hidePopup()))},N.prototype.onDocumentClick=function(t){var e;"listbox"!==this.parent.getLocaleName()&&(e=t.target,P.isNullOrUndefined(this.parent.popupObj)||!P.closest(e,'[id="'+this.parent.popupObj.element.id+'"]')||this.filterInput&&""!==this.filterInput.value||t.preventDefault(),!P.isNullOrUndefined(this.parent.popupObj)&&P.closest(e,'[id="'+this.parent.popupObj.element.id+'"]')||P.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(t.target)?this.parent.scrollFocusStatus=(P.Browser.isIE||"edge"===P.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(y.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(t,!0),this.parent.focused=!0),P.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(t.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(P.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(t)),this.filterInput===e)&&this.filterInput.focus()},N.prototype.getFocus=function(t){this.parent.overAllWrapper.classList.remove(ke),this.parent.keyAction&&"clear"!==t.value&&"focus"!==t.value?this.parent.keyAction=!1:("focus"===t.value&&(this.filterInput.focus(),this.parent.removeFocus(),P.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===t.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden"))},N.prototype.checkSelectAll=function(t){"check"===t.value&&(this.changeState(this.checkAllParent,t.value,null,null,!1),this.setLocale(!0)),"uncheck"===t.value&&(this.changeState(this.checkAllParent,t.value,null,null,!1),this.setLocale()),"indeterminate"===t.value&&(this.changeState(this.checkAllParent,t.value,null,null,!1),this.setLocale())},N.prototype.setLocale=function(t){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var e=t?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=P.compile(e)({},this.parent,t?"unSelectAllText":"selectAllText",null,!this.parent.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else{e=new P.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===e.getConstant("selectAllText")&&(e=new P.L10n("dropdowns",{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.parent.locale)),P.isNullOrUndefined(this.selectAllSpan)||(this.selectAllSpan.textContent=t?e.getConstant("unSelectAllText"):e.getConstant("selectAllText"))}},N.prototype.getActiveList=function(t){t.li.classList.contains("e-active")?this.activeLi.push(t.li.cloneNode(!0)):this.activeLi.splice(t.index,1)},N.prototype.setReorder=function(t){var e,i,s;this.parent.enableSelectionOrder&&!P.isNullOrUndefined(this.parent.value)&&(s=this.parent.ulElement.querySelectorAll("li.e-active").length,e=void 0,i=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"}),0<s&&(this.parent.ulElement.querySelectorAll("li.e-active").forEach(function(t){i.appendChild(t)}),e=this.parent.ulElement.querySelectorAll("li.e-active"),P.addClass(e,"e-reorder-hide"),this.parent.enableVirtualization?(s=this.parent.list.querySelector(".e-virtual-ddl-content"),P.prepend([i],s)):P.prepend([i],this.parent.list)),this.parent.focusAtFirstListItem())},N);function N(t){this.activeLi=[],this.activeEle=[],this.parent=t,this.removeEventListener(),this.addEventListener()}Le=function(t,e){return(Le=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var Le,Be,Te=function(t,e){function i(){this.constructor=t}Le(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},L=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},Ve=(Be=P.ChildProperty,Te(Pe,Be),L([P.Property("Multiple")],Pe.prototype,"mode",void 0),L([P.Property(!1)],Pe.prototype,"showCheckbox",void 0),L([P.Property(!1)],Pe.prototype,"showSelectAll",void 0),L([P.Property("Left")],Pe.prototype,"checkboxPosition",void 0),Pe);function Pe(){return null!==Be&&Be.apply(this,arguments)||this}Ue=P.ChildProperty,Te(Fe,Ue),L([P.Property([])],Fe.prototype,"items",void 0),L([P.Property("Right")],Fe.prototype,"position",void 0);var Ue,He=Fe;function Fe(){return null!==Ue&&Ue.apply(this,arguments)||this}Te(B,We=Z),(qe=B).prototype.addItem=function(t,e){We.prototype.addItem.call(this,t,e),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new c.Query,this.fields)},B.prototype.render=function(){var t,e;this.isAngular&&this.allowFiltering&&(e=(t=this.element).cloneNode(!0),t.parentNode.replaceChild(e,t),this.element=e,P.setValue("ej2_instances",[this],this.element)),this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),We.prototype.render.call(this),this.setEnabled(),this.renderComplete()},B.prototype.initWrapper=function(){for(var t=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}}),e=(t.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation"),this.list.querySelectorAll(".e-list-group-item")),i=0;i<e.length;i++)e[i].removeAttribute("tabindex"),e[i].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(t,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(y.focus),this.itemTemplate&&this.renderReactTemplates(),P.removeClass([this.list],[y.content,y.root]),this.validationAttribute(this.element,t),this.list.setAttribute("role","listbox"),P.attributes(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},B.prototype.updateSelectionSettings=function(){var t;this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length&&(t=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.showSelectAll=!0,this.selectAllText=t.getConstant("selectAllText"),this.unSelectAllText=t.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}))},B.prototype.initDraggable=function(){var s=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new U.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return s.createElement("span",{className:"e-placeholder"})},helper:function(t){var e=s.list.cloneNode(),t=t.sender.cloneNode(!0),i=(e.appendChild(t),s.getItems()[0]);return e.style.width=i.offsetWidth+"px",e.style.height=i.offsetHeight+"px",1<(s.value&&s.value.length)&&s.isSelected(t)&&t.appendChild(s.createElement("span",{className:"e-list-badge",innerHTML:s.value.length+""})),e.style.zIndex=o.getZindexPartial(s.element)+"",e}})},B.prototype.updateActionCompleteData=function(t,e,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,e)},B.prototype.initToolbar=function(){var t,e=this.toolbarSettings.position,i=this.element.getAttribute("data-value"),s=(this.toolbarSettings.items=P.isNullOrUndefined(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length&&(t=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),s=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+e.toLowerCase()}),this.list.parentElement.insertBefore(s,this.list),s.appendChild("Right"===e?this.list:t),s.appendChild("Right"===e?t:this.list),this.createButtons(t),this.element.id||(this.element.id=P.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()),this.element.getAttribute("data-value"));i&&s&&i!==s?(this.tBListBox=P.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):s&&(this.tBListBox=P.getComponent(document.getElementById(s),this.getModuleName()),this.tBListBox.updateToolBarState())},B.prototype.createButtons=function(e){var i,s=this,l=new P.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(t){i=l.getConstant(t),i=s.createElement("button",{attrs:{type:"button","data-value":t,title:i,"aria-label":i}}),e.appendChild(i),new H.Button({iconCss:"e-icons e-"+t.toLowerCase()},i).createElement=s.createElement})},B.prototype.validationAttribute=function(t,e){this.inputFormName&&t.setAttribute("name",this.inputFormName),We.prototype.validationAttribute.call(this,t,e),e.required=t.required,t.required=!1},B.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=P.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?P.addClass([this.list],"e-filter-list"):P.removeClass([this.list],"e-filter-list")},B.prototype.setCssClass=function(){var t=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&P.addClass([t],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&P.addClass([this.list],"e-rtl")},B.prototype.setEnable=function(){var t=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?P.removeClass([t],U.cssClass.disabled):P.addClass([t],U.cssClass.disabled)},B.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=P.formatUnit(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),o.createSpinner({target:this.spinner},this.createElement),o.showSpinner(this.spinner)},B.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&o.hideSpinner(this.spinner),this.spinner.parentElement&&P.detach(this.spinner)},B.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},B.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var t=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(t)},B.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+Me.clearIcon)&&(this.filterInput.parentElement.querySelector("."+Me.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},B.prototype.onActionComplete=function(t,e,i){var s,l,n,a,o=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(s=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===e.length&&(a=t.childNodes[0])&&t.removeChild(a),this.allowFiltering&&(l=this.list.getElementsByClassName("e-input-filter")[0])&&(n=l.selectionStart),We.prototype.onActionComplete.call(this,t,e,i),this.allowFiltering&&!P.isNullOrUndefined(s)&&(this.list.insertBefore(s,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(s),a=s.querySelector(".e-input-filter"))&&(a.addEventListener("focus",function(){s.childNodes[0].classList.contains("e-input-focus")||s.childNodes[0].classList.add("e-input-focus")}),a.addEventListener("blur",function(){s.childNodes[0].classList.contains("e-input-focus")&&s.childNodes[0].classList.remove("e-input-focus")})),this.initWrapper(),this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],P.extend(this.jsonData,e,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],P.extend(this.jsonData,e,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(l=this.list.getElementsByClassName("e-input-filter")[0],P.isNullOrUndefined(l))return;l.selectionStart=n,l.selectionEnd=n,(""!==l.value||""===l.value&&this.isBackSpace)&&(l.focus(),setTimeout(function(){o.isBackSpace=!1}))}this.toolbarSettings.items.length&&this.scope&&-1<this.scope.indexOf("#")&&!P.isNullOrUndefined(i)&&(t=this.scope.replace("#",""),P.getComponent(document.getElementById(t),this.getModuleName()).initToolbar()),this.initLoad=!1},B.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},B.prototype.triggerDragStart=function(e){var i,s=this,t=P.extend(this.getDragArgs(e),{dragSelected:!0},{cancel:!1});P.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",t,function(t){s.allowDragAll=t.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&P.detach(i),t.cancel&&(e.cancel=!0)})},B.prototype.triggerDrag=function(t){var e,i,s=this,l=10,n=(this.itemTemplate&&t.target&&(t.target&&t.target.closest(".e-list-item")?l=t.target.closest(".e-list-item").scrollHeight:(n=t.element.querySelector(".e-list-item"))&&(l=n.scrollHeight)),t.event);this.stopTimer(),t.target&&(t.target.classList.contains("e-listbox-wrapper")||t.target.classList.contains("e-list-item")||t.target.classList.contains("e-filter-parent")||t.target.classList.contains("e-input-group")||t.target.closest(".e-list-item"))&&(i=t.target.classList.contains("e-list-item")||t.target.classList.contains("e-filter-parent")||t.target.classList.contains("e-input-group")||t.target.closest(".e-list-item")?t.target.closest(".e-listbox-wrapper"):t.target,e=this.allowFiltering?i.querySelector(".e-list-parent"):i)&&((i=e.getBoundingClientRect()).y+e.offsetHeight-(n.clientY+36)<1?this.timer=window.setInterval(function(){s.setScrollDown(e,l,!0)},70):n.clientY-36-i.y<1&&(this.timer=window.setInterval(function(){s.setScrollDown(e,l,!1)},70))),null!==t.target&&this.trigger("drag",this.getDragArgs(t))},B.prototype.setScrollDown=function(t,e,i){t.scrollTop=i?t.scrollTop+e:t.scrollTop-e},B.prototype.stopTimer=function(){window.clearInterval(this.timer)},B.prototype.beforeDragEnd=function(t){this.stopTimer();var e=[];this.dragValue=this.getFormattedValue(t.droppedElement.getAttribute("data-value")),-1<this.value.indexOf(this.dragValue)?t.items=this.getDataByValues(this.value):t.items=this.getDataByValues([this.dragValue]),P.extend(e,t.items),this.trigger("beforeDrop",t),JSON.stringify(t.items)!==JSON.stringify(e)&&(this.customDraggedItem=t.items)},B.prototype.dragEnd=function(a){var o,e,l,r,h,u,p,n,d,c,m,f,v,g,y,t,i,s,C,b=this,S=this.getFormattedValue(a.droppedElement.getAttribute("data-value")),E=this.getComponent(a.droppedElement),x=this.getDragArgs({target:a.droppedElement},!0),I={previousData:this.dataSource},w={previousData:E.dataSource},x=P.extend({},x,{target:a.target,source:{previousData:this.dataSource},previousIndex:a.previousIndex,currentIndex:a.currentIndex}),O=(E!==this&&(s=P.extend(I,{currentData:this.listData}),x=P.extend(x,{source:s,destination:w})),P.Browser.isIos&&(this.list.style.overflow=""),this.getComponent(a.target)),A=(O&&0===O.listData.length&&(C=O.ulElement.childNodes[0])&&O.ulElement.removeChild(C),E===this?(l=this.ulElement,r=[].slice.call(this.listData),h=[].slice.call(this.liCollections),u=[].slice.call(this.jsonData),p=[].slice.call(this.sortedData),n=a.currentIndex,d=a.currentIndex=this.getCurIdx(this,a.currentIndex),O=r.indexOf(this.getDataByValue(S)),C=u.indexOf(this.getDataByValue(S)),t=p.indexOf(this.getDataByValue(S)),r.splice(d,0,r.splice(O,1)[0]),p.splice(n,0,p.splice(t,1)[0]),u.splice(d,0,u.splice(C,1)[0]),h.splice(d,0,h.splice(O,1)[0]),this.allowDragAll&&(e=this.value&&-1<Array.prototype.indexOf.call(this.value,S)?this.value:[S],P.isNullOrUndefined(this.customDraggedItem)||(e=[],this.customDraggedItem.forEach(function(t){e.push(P.getValue(b.fields.value,t))})),e.forEach(function(t){var e,i,s;t!==S&&(e=r.indexOf(b.getDataByValue(t)),i=u.indexOf(b.getDataByValue(t)),s=p.indexOf(b.getDataByValue(t)),d<e&&d++,u.splice(d,0,u.splice(i,1)[0]),r.splice(d,0,r.splice(e,1)[0]),p.splice(n,0,p.splice(s,1)[0]),h.splice(d,0,h.splice(e,1)[0]),l.insertBefore(b.getItems()[b.getIndexByValue(t)],l.getElementsByClassName("e-placeholder")[0]))})),this.listData=r,this.jsonData=u,this.sortedData=p,this.liCollections=h):(m=[].slice.call(this.liCollections),f=a.currentIndex=this.getCurIdx(E,a.currentIndex),v=E.ulElement,r=[].slice.call(E.listData),h=[].slice.call(E.liCollections),u=[].slice.call(E.jsonData),p=[].slice.call(E.sortedData),e=this.value&&-1<Array.prototype.indexOf.call(this.value,S)&&this.allowDragAll?this.value:[S],P.isNullOrUndefined(this.customDraggedItem)||(e=[],this.customDraggedItem.forEach(function(t){e.push(P.getValue(b.fields.value,t))})),g=[].slice.call(this.listData),y=[].slice.call(this.sortedData),e.forEach(function(t){o=b.getDataByValue(t);var e=b.listData.indexOf(o),i=b.jsonData.indexOf(o),s=b.sortedData.indexOf(o),i=(g.splice(e,1),b.jsonData.splice(i,1),y.splice(s,1),b.listData=g,b.sortedData=y,t===S?a.currentIndex:f);if(r.splice(i,0,o),u.splice(i,0,o),p.splice(i,0,o),h.splice(i,0,m.splice(e,1)[0]),t)c=b.getItems()[b.getIndexByValue(t)];else for(var l=b.getItems(),n=0;n<l.length;n++)if(null===l[n].getAttribute("data-value")&&l[n].classList.contains("e-list-item")){c=l[n];break}c=c||a.helper,b.removeSelected(b,t===S?[a.droppedElement]:[c]),v.insertBefore(c,v.getElementsByClassName("e-placeholder")[0]),f++}),this.fields.groupBy&&(i=this.renderItems(this.listData,this.fields),this.updateListItems(i,this.ulElement),this.setSelection()),("None"!==E.sortOrder||this.selectionSettings.showCheckbox!==E.selectionSettings.showCheckbox||E.fields.groupBy||E.itemTemplate||this.itemTemplate)&&(t=P.getComponent(v,"sortable"),i=E.renderItems(r,E.fields),E.updateListItems(i,v),this.setSelection(),t.placeHolderElement&&v.appendChild(t.placeHolderElement),v.appendChild(a.helper),E.setSelection()),this.liCollections=m,E.liCollections=h,E.jsonData=P.extend([],[],u,!1),E.listData=P.extend([],[],r,!1),"None"===E.sortOrder&&(E.sortedData=P.extend([],[],p,!1)),0===this.listData.length&&this.l10nUpdate()),x=this===E?(s=P.extend(I,{currentData:r}),P.extend(x,{source:s})):(C=P.extend(w,{currentData:r}),P.extend(x,{destination:C})),P.isNullOrUndefined(this.customDraggedItem)||(x.items=this.customDraggedItem),this.trigger("drop",x),x.elements);if(A.length)for(var D=0;D<A.length;D++)A[D].classList.remove("e-grabbed");0<this.toolbarSettings.items.length?this.updateToolBarState():this.tBListBox&&0<this.tBListBox.toolbarSettings.items.length&&this.tBListBox.updateToolBarState()},B.prototype.updateListItems=function(t,e){e.innerHTML="",e.append.apply(e,t.childNodes)},B.prototype.removeSelected=function(t,e){t.selectionSettings.showCheckbox?e.forEach(function(t){t.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):P.removeClass(e,U.cssClass.selected)},B.prototype.getCurIdx=function(t,e){return t.fields.groupBy&&(e-=[].slice.call(t.ulElement.children).slice(0,e).filter(function(t){return t.classList.contains(U.cssClass.group)}).length),e},B.prototype.getComponent=function(t){var e,t="EJS-LISTBOX"===this.element.tagName?P.closest(t,".e-listbox"):P.closest(t,".e-listbox-wrapper")&&P.closest(t,".e-listbox-wrapper").querySelector(".e-listbox");return e=t?P.getComponent(t,this.getModuleName()):e},B.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},B.prototype.listOption=function(t,e){return this.listCurrentOptions=We.prototype.listOption.call(this,t,e),this.listCurrentOptions=P.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},B.prototype.triggerBeforeItemRender=function(t){t.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:t.item,item:t.curData})},B.prototype.requiredModules=function(){var t=[];return this.selectionSettings.showCheckbox&&t.push({member:"CheckBoxSelection",args:[this]}),t},B.prototype.enableItems=function(t,e,i){var s,l,n=this;void 0===e&&(e=!0),t.forEach(function(t){(s=n.findListElement(n.list,"li","data-value",i?t:n.getValueByText(t)))&&(e?(P.removeClass([s],U.cssClass.disabled),s.removeAttribute("aria-disabled")):(P.addClass([s],U.cssClass.disabled),s.setAttribute("aria-disabled","true")))}),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&0<this.toolbarSettings.items.length&&(l=!1,this.ulElement.childNodes.forEach(function(t){t.classList.contains("e-disabled")||(l=!0)}),l||(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0))},B.prototype.selectItems=function(t,e,i){(e=void 0===e?!0:e)&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach(function(t){t.classList.remove("e-active"),t.removeAttribute("aria-selected"),P.removeClass([t],U.cssClass.selected)}),this.setSelection(t,e,!i),this.updateSelectedOptions();for(var s=[],l=0;l<t.length;l++)for(var n=this.list.querySelectorAll('[aria-selected="true"]'),a=0;a<n.length;a++)t[l]===this.getFormattedValue(n[a].getAttribute("data-value"))&&s.push(n[a]);this.triggerChange(s,null)},B.prototype.selectAll=function(t){this.selectAllItems(t=void 0===t?!0:t)},B.prototype.addItems=function(t,e){We.prototype.addItem.call(this,t,e),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new c.Query,this.fields)},B.prototype.removeItems=function(t,e){this.removeItem(t,e)},B.prototype.removeItem=function(t,e){var i=this,s=[],l=this.list.querySelectorAll("."+y.li);if(t){t=t instanceof Array?t:[t];for(var n=this.fields,a={},o=[],r=(P.extend(o,[],this.jsonData),[]),h=[],u=0;u<o.length;u++)a[o[u]instanceof Object?o[u][n.value]:o[u].toString()]=u;for(var p=0;p<t.length;p++){var d=t[p]instanceof Object?t[p][n.value]:t[p].toString();Object.prototype.hasOwnProperty.call(a,d)&&(s.push(l[d=a[d]]),r.push(d),h.push(d))}r.sort(function(t,e){return e-t}).forEach(function(t){i.listData.splice(t,1),i.jsonData.splice(t,1)});for(var c=h.length-1;0<=c;c--)this.updateLiCollection(h[c])}else s.push(l[e=e||0]),this.listData.splice(e,1),this.jsonData.splice(e,1),this.updateLiCollection(e);for(u=0;u<s.length;u++)this.ulElement.removeChild(s[u]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},B.prototype.getDataByValues=function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.getDataByValue(t[i]));return e},B.prototype.moveUp=function(t){t=t?this.getElemByValue(t):this.getSelectedItems();this.moveUpDown(!0,!1,t)},B.prototype.moveDown=function(t){t=t?this.getElemByValue(t):this.getSelectedItems();this.moveUpDown(!1,!1,t)},B.prototype.moveTop=function(t){t=t?this.getElemByValue(t):this.getSelectedItems();this.moveUpDown(null,!1,t,!0)},B.prototype.moveBottom=function(t){t=t?this.getElemByValue(t):this.getSelectedItems();this.moveUpDown(!0,!1,t,!1,!0)},B.prototype.moveTo=function(t,e,i){t=t?this.getElemByValue(t):this.getSelectedItems(),i=i?P.getComponent(i,qe):this.getScopedListBox();this.moveData(this,i,!1,t,e)},B.prototype.moveAllTo=function(t,e){this.toolbarAction="moveAllTo",0<this.listData.length&&(t=t?P.getComponent(t,qe):this.getScopedListBox(),this.moveAllData(this,t,!1,e))},B.prototype.getDataList=function(){return this.jsonData},B.prototype.getSortedList=function(){var t;if(e=t=this.sortedData,this.fields.groupBy)for(var e=[],i=0;i<t.length;i++)t[i].isHeader||e.push(t[i]);return e},B.prototype.getElemByValue=function(t){for(var e=[],i=0;i<t.length;i++)e.push(this.ulElement.querySelector('[data-value ="'+t[i]+'"]'));return e},B.prototype.updateLiCollection=function(t){var e=[].slice.call(this.liCollections);e.splice(t,1),this.liCollections=e},B.prototype.selectAllItems=function(i,t){var s=this;if([].slice.call(this.getItems()).forEach(function(t){var e;t.classList.contains(U.cssClass.disabled)||(s.selectionSettings.showCheckbox?(!(e=t.getElementsByClassName("e-check")[0])&&i||e&&!i)&&(s.notify("updatelist",{li:t,module:"listbox"}),s.maximumSelectionLength>=s.list.querySelectorAll(".e-list-item span.e-check").length)&&s.checkMaxSelection():i?t.classList.add(U.cssClass.selected):t.classList.remove(U.cssClass.selected))}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),n=0;if(i)for(var a=this,n=0;n<l.length;n++)!function(){var e=a.getFormattedValue(l[n].getAttribute("data-value"));a.value.some(function(t){return t===e})||a.value.push(a.getFormattedValue(l[n].getAttribute("data-value")))}();else{var o=this;for(n=0;n<l.length;n++)!function(){var e=o.getFormattedValue(l[n].getAttribute("data-value"));o.value=o.value.filter(function(t){return t!==e})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),t)},B.prototype.updateMainList=function(){var t=this.mainList.querySelectorAll(".e-list-item"),e=this.ulElement.querySelectorAll(".e-list-item"),i=t.length,s=e.length;if(this.selectionSettings.showCheckbox||1<document.querySelectorAll("ul").length||i!==s)for(var l=0,n=0,a=0;l<i;){if(this.value)for(;n<this.value.length;n++)t[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&t[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),1<document.querySelectorAll("ul").length&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,n=a=0}},B.prototype.wireEvents=function(){var t=P.closest(this.element,"form"),e="EJS-LISTBOX"===this.element.tagName?this.element:this.list;P.EventHandler.add(this.list,"click",this.clickHandler,this),P.EventHandler.add(e,"keydown",this.keyDownHandler,this),P.EventHandler.add(e,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&P.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),t&&P.EventHandler.add(t,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},B.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&P.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},B.prototype.unwireEvents=function(){var t=P.closest(this.element,"form"),e="EJS-LISTBOX"===this.element.tagName?this.element:this.list;P.EventHandler.remove(this.list,"click",this.clickHandler),P.EventHandler.remove(e,"keydown",this.keyDownHandler),P.EventHandler.remove(e,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&P.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&P.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),t&&P.EventHandler.remove(t,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},B.prototype.clickHandler=function(t){var e=P.closest(t.target,".e-list-item");P.isNullOrUndefined(e)||this.selectHandler(t)},B.prototype.checkSelectAll=function(){for(var t=0,e=this.list.querySelectorAll("li."+y.li),i=0;i<e.length;i++)e[i].classList.contains("e-disabled")||t++;var s=this.getSelectedItems().length;this.showSelectAll&&t&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:t===s?"check":0===s?"uncheck":"indeterminate"})},B.prototype.getQuery=function(t){var e,i,s=t?t.clone():this.query?this.query.clone():new c.Query;return this.allowFiltering?(e=""===this.inputString?"contains":this.filterType,null===(i=this.typeOfData(this.dataSource).typeof)&&(i=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof c.DataManager||"string"!==i)&&"number"!==i?(i=this.fields.text||"",s.where(i,e,this.inputString,this.ignoreCase,this.ignoreAccent)):s.where("",e,this.inputString,this.ignoreCase,this.ignoreAccent)):s=t||this.query||new c.Query,s},B.prototype.setFiltering=function(){var t;if(this.initLoad||P.isNullOrUndefined(this.filterParent))return this.filterParent=this.createElement("span",{className:Me.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:Me.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),t=h.Input.createInput({element:this.filterInput,buttons:[Me.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),P.append([t.container],this.filterParent),P.prepend([this.filterParent],this.list),P.attributes(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?P.addClass([this.list],"e-filter-list"):0<this.height.toString().indexOf("%")&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important"),t},B.prototype.filterWireEvents=function(t){t&&(this.filterInput=t.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+Me.clearIcon),this.clearFilterIconElem&&(P.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),t||(this.clearFilterIconElem.style.visibility="hidden")),P.EventHandler.add(this.filterInput,"input",this.onInput,this),P.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),P.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},B.prototype.selectHandler=function(t,e){var i,s,l=!0,n=P.closest(t.target,".e-list-item"),a=[n];n&&n.parentElement&&(s=[].slice.call(n.parentElement.children).indexOf(n),this.selectionSettings.showCheckbox?l=!n.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(t.ctrlKey||t.metaKey||P.Browser.isDevice)&&this.isSelected(n)?(n.classList.remove(U.cssClass.selected),n.removeAttribute("aria-selected"),l=!1):"Multiple"===this.selectionSettings.mode&&(t.ctrlKey||t.metaKey||P.Browser.isDevice)||(this.getSelectedItems().forEach(function(t){t.removeAttribute("aria-selected")}),P.removeClass(this.getSelectedItems(),U.cssClass.selected)),t.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?a=[].slice.call(n.parentElement.children).slice(Math.min(s,this.prevSelIdx),Math.max(s,this.prevSelIdx)+1).filter(function(t){return t.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(n.parentElement.children).indexOf(n),l?(this.selectionSettings.showCheckbox||P.addClass(a,U.cssClass.selected),a.forEach(function(t){t.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",n.id)):a.forEach(function(t){t.setAttribute("aria-selected","false")}),e||!(this.maximumSelectionLength>(this.value&&this.value.length))&&l||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&l||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:n,e:t,module:"listbox"}),this.allowFiltering&&!e&&(i=this.getFormattedValue(n.getAttribute("data-value")),l?(P.extend(s=[],this.value),s.push(i),this.value=s):this.value=this.value.filter(function(t){return t!==i}),document.querySelectorAll("ul").length<2)&&this.updateMainList(),this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),t),this.list)&&this.checkMaxSelection()},B.prototype.triggerChange=function(t,e){this.trigger("change",{elements:t,items:this.getDataByElements(t),value:this.value,event:e})},B.prototype.getDataByElems=function(t){for(var e=[],i=t.length,s=0;s<i;s++){var l=t[s].getAttribute("data-value"),l=this.getFormattedValue(l);e.push(this.getDataByValue(l))}return e},B.prototype.getDataByElements=function(t){var e,i=[],s=0;if(P.isNullOrUndefined(this.listData))return null;var l=this.typeOfData(this.listData).typeof;if("string"===l||"number"===l||"boolean"===l)for(var n=0,a=this.listData;n<a.length;n++){for(var o=a[n],r=s,h=t.length;r<h;r++)if(e=this.getFormattedValue(t[r].getAttribute("data-value")),!P.isNullOrUndefined(o)&&o===e){s=r,i.push(o);break}if(t.length===i.length)break}else for(var u=0,p=this.listData;u<p.length;u++){for(o=p[u],r=s,h=t.length;r<h;r++)if(e=this.getFormattedValue(t[r].getAttribute("data-value")),!P.isNullOrUndefined(o)&&P.getValue(this.fields.value||"value",o)===e){s=r,i.push(o);break}if(t.length===i.length)break}return i},B.prototype.checkMaxSelection=function(){var t=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox)for(var e=0,i=this.list.getElementsByClassName("e-list-item");e<i.length;e++)i[e].querySelector(".e-frame.e-check")||(t===this.maximumSelectionLength?i[e].classList.add("e-disable"):i[e].classList.contains("e-disable")&&i[e].classList.remove("e-disable"))},B.prototype.toolbarClickHandler=function(t){t=P.closest(t.target,"button");if(t&&(this.toolbarAction=t.getAttribute("data-value"),!t.disabled))switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}},B.prototype.moveUpDown=function(s,t,e,l,n){var i,a=this,o=this.getSelectedItems();e&&(o=e),(s&&this.isSelected(this.ulElement.firstElementChild)||!s&&this.isSelected(this.ulElement.lastElementChild))&&!e||(i={cancel:!1,items:e=this.getDataByElems(o),eventName:this.toolbarAction},this.trigger("actionBegin",i),i.cancel)||((s?o:o.reverse()).forEach(function(t){var e=Array.prototype.indexOf.call(a.ulElement.querySelectorAll(".e-list-item"),t),i=Array.prototype.indexOf.call(a.ulElement.children,t);l?(U.moveTo(a.ulElement,a.ulElement,[i],0),a.changeData(i,0,e,t)):n?(U.moveTo(a.ulElement,a.ulElement,[i],a.ulElement.querySelectorAll(".e-list-item").length),a.changeData(i,a.ulElement.querySelectorAll(".e-list-item").length,e,t)):(U.moveTo(a.ulElement,a.ulElement,[i],s?i-1:i+2),a.changeData(i,s?i-1:i+1,s?e-1:e+1,t))}),this.trigger("actionComplete",{items:e,eventName:this.toolbarAction}),o[0].focus(),!t&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(s?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())},B.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},B.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},B.prototype.moveData=function(i,t,e,s,l){var n=[],a=[],o=[],r=[],h=[].slice.call(i.listData),u=[].slice.call(t.listData),p=[].slice.call(i.sortedData),d=[].slice.call(t.sortedData),c=[].slice.call(i.liCollections),m=[],f=[].slice.call(t.liCollections),v=[],g=[],y=i.getSelectedItems(),s=(s&&(y=s),"None"!==t.sortOrder||t.selectionSettings.showCheckbox!==i.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||i.itemTemplate);if(i.value=[],y.length){this.removeSelected(i,y);var C,b=Array.prototype.slice.call(i.ulElement.children),S=Array.prototype.slice.call(i.ulElement.querySelectorAll(".e-list-item")),E=i.listData,x=i.sortedData,I=i.jsonData,w={};if(199<y.length)for(var O=0,A=i.listData;O<A.length;O++){var D,k=A[O];P.isNullOrUndefined(k)||(D=i.getFormattedValue(P.getValue(i.fields.value||"value",k)),w[D]=k)}y.forEach(function(t){var e;C=y.length<200?i.getDataByElems([t])[0]:(e=t.getAttribute("data-value"),e=i.getFormattedValue(e),w[e]),n.push(b.indexOf(t)),m.push(S.indexOf(t)),a.push(E.indexOf(C)),r.push(x.indexOf(C)),o.push(I.indexOf(C))}),"None"!==this.sortOrder?r.forEach(function(t){v.push(i.sortedData[t])}):o.forEach(function(t){v.push(i.jsonData[t])});var N={cancel:!1,items:v,eventName:this.toolbarAction};if(i.trigger("actionBegin",N),N.cancel)return;var L=[],B=(m.sort(function(t,e){return t-e}).reverse().forEach(function(t){L.push(c.splice(t,1)[0])}),i.liCollections=c,l?(N=f.splice(0,l),t.liCollections=N.concat(L.reverse()).concat(f)):t.liCollections=f.concat(L.reverse()),0===t.listData.length&&(N=t.ulElement.childNodes[0])&&t.ulElement.removeChild(N),a.sort(function(t,e){return e-t}).forEach(function(t){h.splice(t,1)[0]}),r.sort(function(t,e){return e-t}).forEach(function(t){p.splice(t,1)[0]}),o.slice().reverse().forEach(function(t){g.push(i.jsonData.splice(t,1)[0])}),s?i.fields.groupBy?(T=i.renderItems(h,i.fields),i.updateListItems(T,i.ulElement)):y.forEach(function(t){P.detach(t)}):(U.moveTo(i.ulElement,t.ulElement,n,l),i.trigger("actionComplete",{items:v,eventName:this.toolbarAction})),t.mainList.childElementCount!==t.jsonData.length&&(t.mainList=t.ulElement),[].slice.call(t.jsonData)),d=[].slice.call(t.sortedData);this.selectNextList(y,m,a,i),e&&this.list.focus(),i.listData=h,i.sortedData=p,l=l||u.length;for(var T,V=v.length-1;0<=V;V--)u.splice(l,0,v[V]),B.splice(l,0,v[V]),d.splice(l,0,v[V]);t.listData=u,t.jsonData=B,t.sortedData=d,s&&(T=t.renderItems(u,t.fields),t.updateListItems(T,t.ulElement),t.setSelection(),i.trigger("actionComplete",{items:v,eventName:this.toolbarAction})),i.updateSelectedOptions(),0===i.listData.length&&i.l10nUpdate()}1===i.value.length&&i.getSelectedItems().length&&(i.value[0]=i.getFormattedValue(i.getSelectedItems()[0].getAttribute("data-value"))),i.liCollections.length===i.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction&&(f=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],N="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo",f)&&(f.querySelector('[data-value="'+N+'"]').disabled=!0)},B.prototype.selectNextList=function(t,e,i,s){var l=s.ulElement.querySelectorAll(".e-list-item").length;1===t.length&&l&&!s.selectionSettings.showCheckbox&&(t=l<=e[0]?l-1:e[0],e=s.ulElement.querySelectorAll(".e-list-item")[t],-1<(e=s.getValidIndex(e,t,l===i[0]?38:40)))&&s.ulElement.querySelectorAll(".e-list-item")[e].classList.add(U.cssClass.selected)},B.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},B.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},B.prototype.moveAllData=function(t,e,i,s){var l=[].slice.call(e.listData),n=[].slice.call(e.jsonData),a="None"!==e.sortOrder||e.selectionSettings.showCheckbox!==t.selectionSettings.showCheckbox||e.fields.groupBy||e.itemTemplate||t.itemTemplate,o=[],r=[],h=[],u=(this.removeSelected(t,t.getSelectedItems()),[].slice.call(t.listData)),p={cancel:!1,items:u,eventName:this.toolbarAction};if(t.trigger("actionBegin",p),!p.cancel){0===e.listData.length&&(p=e.ulElement.childNodes[0])&&e.ulElement.removeChild(p),0<t.listData.length&&(h=Array.apply(null,{length:t.ulElement.childElementCount}).map(Number.call,Number));for(var d=t.ulElement.childNodes,c=t.ulElement.childElementCount,m=[],f=0;f<c;f++){var v=d[f];v.classList.contains("e-disabled")?(o.push(v),null!=this.sortOrder?r.push(t.sortedData[f]):r.push(t.listData[f])):m.push(f)}U.moveTo(t.ulElement,e.ulElement,h=m,s),t.trigger("actionComplete",{items:u,eventName:this.toolbarAction}),i&&this.list.focus(),s=s||l.length;for(f=0;f<h.length;f++)null!=this.sortOrder?l.splice(s+f,0,t.sortedData[h[f]]):l.splice(s+f,0,t.listData[h[f]]);for(f=0;f<h.length;f++)n.splice(s+f,0,t.jsonData[h[f]]);for(var p=[],u=(0<o.length?(t.liCollections=o,p=[].slice.call(t.liCollections)):(p=[].slice.call(t.liCollections),t.liCollections=[]),[].slice.call(e.liCollections)),g=(s?(i=u.splice(0,s),e.liCollections=i.concat(p).concat(u)):e.liCollections=u.concat(p),t.value=[],(l=(l=l.filter(function(t){return void 0!==t})).filter(function(t){return!0!==t.isHeader})).filter(function(t){return-1===e.jsonData.indexOf(t)})),f=0;f<g.length;f++)e.jsonData.splice(s+f,0,g[f]);if(e.listData=l,t.listData.length===t.jsonData.length)t.listData=t.sortedData=t.jsonData=r;else if(t.allowFiltering){var y=[];if(0<o.length){for(f=0;f<o.length;f++)y.push(t.getDataByValue(o[f].getAttribute("data-value")));t.listData=t.listData.filter(function(e){return!y.some(function(t){return e===t})})}for(f=0;f<t.listData.length;f++)for(var C=0;C<t.jsonData.length;C++)t.listData[f]===t.jsonData[C]&&t.jsonData.splice(C,1);0<o.length?(t.listData=y,t.sortedData=[]):t.listData=t.sortedData=[]}a?(i=e.renderItems(l,e.fields),e.updateListItems(i,e.ulElement)):e.sortedData=l,t.updateSelectedOptions(),0<o.length&&(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0),0===t.listData.length&&0===o.length&&t.l10nUpdate()}},B.prototype.changeData=function(t,e,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),o=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),s=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),r=[].slice.call(this.liCollections);l.splice(e,0,l.splice(t,1)[0]),n.splice(i,0,n.splice(o,1)[0]),a.splice(e,0,a.splice(s,1)[0]),r.splice(e,0,r.splice(t,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=r,this.sortedData=a},B.prototype.getSelectedItems=function(){var e=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(t){e.push(P.closest(t,".e-list-item"))}):e=[].slice.call(this.ulElement.getElementsByClassName(U.cssClass.selected)),e},B.prototype.getScopedListBox=function(){var e,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(t){P.getComponent(t,i.getModuleName())&&(e=P.getComponent(t,i.getModuleName()))}),e},B.prototype.getGrabbedItems=function(t){for(var e=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(t.target.getAttribute("data-value"))){e=!0;break}if(e)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},B.prototype.getDragArgs=function(t,e){var i=this.getGrabbedItems(t);return i.length?e&&i.push(t.target):i=[t.target],{elements:i,event:t.event,items:this.getDataByElems(i)}},B.prototype.onKeyDown=function(t){this.keyDownHandler(t),t.stopPropagation()},B.prototype.keyDownHandler=function(t){var e;-1<[32,35,36,37,38,39,40,65].indexOf(t.keyCode)&&(!this.allowFiltering||this.allowFiltering&&t.target!==this.filterInput)?t.target&&-1<t.target.className.indexOf("e-edit-template")||(t.preventDefault(),32===t.keyCode&&this.ulElement.children.length?this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}):65===t.keyCode&&t.ctrlKey&&"Multiple"===this.selectionSettings.mode?this.selectAll():(38===t.keyCode||40===t.keyCode)&&t.ctrlKey&&t.shiftKey?this.moveUpDown(38===t.keyCode,!0):!this.toolbarSettings.items.length&&!this.tBListBox||39!==t.keyCode&&37!==t.keyCode||!t.ctrlKey?37!==t.keyCode&&39!==t.keyCode&&"KeyA"!==t.code&&this.upDownKeyHandler(t):(e=this.tBListBox||this.getScopedListBox(),39===t.keyCode?t.shiftKey?this.moveAllData(this,e,!0):this.moveData(this,e,!0):t.shiftKey?this.moveAllData(e,this,!0):this.moveData(e,this,!0))):!this.allowFiltering||40!==t.keyCode&&38!==t.keyCode||this.upDownKeyHandler(t)},B.prototype.upDownKeyHandler=function(t){var e=this.ulElement,i=40===t.keyCode||36===t.keyCode?0:e.childElementCount-1,s=e.getElementsByClassName("e-focused")[0]||e.getElementsByClassName(U.cssClass.selected)[0];if(s){if(35!==t.keyCode&&36!==t.keyCode&&(i=Array.prototype.indexOf.call(e.children,s),40===t.keyCode?i++:i--,i<0||i>e.childElementCount-1))return;P.removeClass([s],"e-focused")}var l=e.children[i];if(l)if(-1===(i=this.getValidIndex(l,i,t.keyCode)))P.addClass([s],"e-focused");else if(e.children[i].focus(),e.children[i].classList.add("e-focused"),t.ctrlKey&&(this.selectionSettings.showCheckbox||!t.shiftKey||36!==t.keyCode&&35!==t.keyCode)||this.selectHandler({target:e.children[i],ctrlKey:t.ctrlKey,shiftKey:t.shiftKey},!0),this.selectionSettings.showCheckbox&&t.ctrlKey&&t.shiftKey&&(36===t.keyCode||35===t.keyCode))for(var l=Array.prototype.indexOf.call(e.children,s),i="Home"===t.code?0:l,n="Home"===t.code?l:e.children.length-1,a=i;a<=n;a++){var o=e.children[a];this.notify("updatelist",{li:o,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:t.ctrlKey,shiftKey:t.shiftKey},module:"listbox"})}},B.prototype.KeyUp=function(t){var e,i,s,l=this;this.allowFiltering&&t.ctrlKey&&65===t.keyCode?t.preventDefault():(e=(i=String.fromCharCode(t.keyCode)).match(/\w/),i=i.match(/[A-Za-z0-9\u00C0-\u024F ]/),P.isNullOrUndefined(e)&&P.isNullOrUndefined(i)||(this.isValidKey=!0),this.isBackSpace=8===t.keyCode,this.isValidKey=8===t.keyCode||46===t.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,t.keyCode,this.allowFiltering)&&(s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(t,e,i){s.cancel||(l.isFiltered=!0,l.remoteFilterAction=!0,l.preventDefActionFilter=s.preventDefaultAction,l.dataUpdater(t,e,i),l.preventDefActionFilter=!1)},event:t,cancel:!1},this.trigger("filtering",s,function(t){l.isDataFetched=!1,t.cancel||""!==l.filterInput.value&&l.isFiltered||(l.preventDefActionFilter=!1,t.cancel||l.isCustomFiltering||t.preventDefaultAction||(l.inputString=l.filterInput.value,l.filteringAction(l.jsonData,new c.Query,l.fields),0<l.toolbarSettings.items.length&&l.updateToolBarState()),l.isFiltered)||l.isCustomFiltering||t.preventDefaultAction||l.dataUpdater(l.jsonData,new c.Query,l.fields)})))},B.prototype.filter=function(t,e,i){this.isCustomFiltering=!0,this.filteringAction(t,e,i)},B.prototype.filteringAction=function(t,e,i){this.resetList(t,i,e)},B.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],P.isNullOrUndefined(this.targetInputElement)?null:this.targetInputElement.value},B.prototype.dataUpdater=function(t,e,i){var s;this.isDataFetched=!1,this.targetElement()&&""===this.targetElement().trim()?(s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})):this.resetList(t,i,e)},B.prototype.focusOutHandler=function(){var t=this.list.getElementsByClassName("e-focused")[0];t&&t.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},B.prototype.resizeHandler=function(){!this.list||this.cssClass&&-1<this.cssClass.indexOf("e-horizontal-listbox")||0<this.list.getElementsByClassName("e-filter-parent").length&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},B.prototype.getValidIndex=function(t,e,i){var s=this.ulElement;return(t.classList.contains("e-disabled")||t.classList.contains(U.cssClass.group))&&(40===i||36===i?e++:e--),e<0||e===s.childElementCount?-1:(t=s.childNodes[e]).classList.contains("e-disabled")||t.classList.contains(U.cssClass.group)?this.getValidIndex(t,e,i):e},B.prototype.updateSelectedOptions=function(){var e=this,i=[],t=[];if(P.extend(t,this.value),this.getSelectedItems().forEach(function(t){t.classList.contains("e-grabbed")||i.push(e.getFormattedValue(t.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var s=0;s<i.length;s++)-1<t.indexOf(i[s])||t.push(i[s]);this.setProperties({value:t},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},B.prototype.clearSelection=function(e){var i,s=this;void 0===e&&(e=this.value),this.selectionSettings.showCheckbox&&this.getSelectedItems().forEach(function(t){i=s.getFormattedValue(t.getAttribute("data-value")),e.indexOf(i)<0&&(t.getElementsByClassName("e-check")[0].classList.remove("e-check"),t.removeAttribute("aria-selected"))})},B.prototype.setSelection=function(t,e,i,s){var l,n,a=this;void 0===t&&(t=this.value),void 0===e&&(e=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),t&&t.forEach(function(t){t=i?a.getValueByText(t):t;(l="string"==typeof t?(t=t.split("\\").join("\\\\"),a.list.querySelector('[data-value="'+t.replace(/"/g,'\\"')+'"]')):a.list.querySelector('[data-value="'+t+'"]'))&&(n=a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):l.classList.contains("e-selected"),!e&&n||e&&!n&&l)&&(a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?(a.notify("updatelist",{li:l,module:"listbox"}),s&&l.focus()):e&&!l.classList.contains("e-disabled")?(l.classList.add(U.cssClass.selected),l.setAttribute("aria-selected","true"),s&&l.focus()):(l.classList.remove(U.cssClass.selected),l.removeAttribute("aria-selected")))}),this.updateSelectTag()},B.prototype.updateSelectTag=function(){var t=this.getSelectTag(),e="";if(!P.isNullOrUndefined(t)){if(t.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)e+="<option selected>"+this.value[i]+"</option>";t.innerHTML+=e;for(i=0,s=t.childNodes.length;i<s;i++)t.childNodes[i].setAttribute("value",this.value[i].toString())}this.checkSelectAll()}},B.prototype.checkDisabledState=function(t){return P.isNullOrUndefined(t.ulElement)?!(!P.isNullOrUndefined(this.dataSource)&&P.isNullOrUndefined(this.dataSource.length)):0<t.ulElement.querySelectorAll(".e-disabled").length?t.liCollections.length===t.ulElement.querySelectorAll(".e-disabled").length:0===t.ulElement.querySelectorAll("."+U.cssClass.li).length},B.prototype.updateToolBarState=function(){var i,s,l=this;this.toolbarSettings.items.length&&(i=this.getScopedListBox(),s=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],this.toolbarSettings.items.forEach(function(t){var e=s.querySelector('[data-value="'+t+'"]');switch(t){case"moveAllTo":e.disabled=l.checkDisabledState(l);break;case"moveAllFrom":e.disabled=l.checkDisabledState(i);break;case"moveFrom":e.disabled=!i.value||!i.value.length;break;case"moveUp":e.disabled=!(l.value&&l.value.length&&!l.isSelected(l.ulElement.children[0]));break;case"moveDown":e.disabled=!(l.value&&l.value.length&&!l.isSelected(l.ulElement.children[l.ulElement.childElementCount-1]));break;default:e.disabled=!l.value||!l.value.length}}))},B.prototype.setCheckboxPosition=function(){var t=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||t.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&t.classList.add("e-right")},B.prototype.showCheckbox=function(t){var e=0,i=this.list.lastElementChild.querySelectorAll("li"),s=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(t)this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]&&(t=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.showSelectAll=!0,this.selectAllText=t.getConstant("selectAllText"),this.unSelectAllText=t.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll());else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]);e<s;e++)i[e].classList.contains("e-list-item")&&i[e].removeChild(i[e].getElementsByClassName("e-checkbox-wrapper")[0]),i[e].hasAttribute("aria-selected")&&i[e].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},B.prototype.isSelected=function(t){return!P.isNullOrUndefined(t)&&(t.classList.contains(U.cssClass.selected)||null!==t.querySelector(".e-check"))},B.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},B.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},B.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},B.prototype.getModuleName=function(){return"listbox"},B.prototype.getPersistData=function(){return this.addOnPersist(["value"])},B.prototype.getLocaleName=function(){return"listbox"},B.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),P.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),We.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},B.prototype.onPropertyChanged=function(t,e){var i=this.toolbarSettings.items.length?this.list.parentElement:this.list;We.prototype.onPropertyChanged.call(this,t,e),this.setUpdateInitial(["fields","query","dataSource"],t);for(var s=0,l=Object.keys(t);s<l.length;s++)switch(l[s]){case"cssClass":e.cssClass&&P.removeClass([i],e.cssClass.split(" ")),t.cssClass&&P.addClass([i],t.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":t.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":P.removeClass(this.list.querySelectorAll("."+U.cssClass.selected),U.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":t.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&P.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,P.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&h.Input.setPlaceholder(t.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(P.getComponent(this.ulElement,"sortable").scope=t.scope),this.toolbarSettings.items.length&&(e.scope&&(P.getComponent(document.querySelector(e.scope),this.getModuleName()).tBListBox=null),t.scope)&&(P.getComponent(document.querySelector(t.scope),this.getModuleName()).tBListBox=this);break;case"toolbarSettings":var n=void 0,a=t.toolbarSettings.position,o=this.getToolElem();a&&(P.removeClass([i],["e-right","e-left"]),i.classList.add("e-"+a.toLowerCase()),"Left"===a?i.insertBefore(o,this.list):i.appendChild(o)),t.toolbarSettings.items&&(e.toolbarSettings.items=P.isNullOrUndefined(e.toolbarSettings.items)?[]:e.toolbarSettings.items,e.toolbarSettings&&e.toolbarSettings.items.length&&((n=this.list.parentElement).parentElement.insertBefore(this.list,n),P.detach(n)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":a=t.selectionSettings.showSelectAll,o=t.selectionSettings.showCheckbox;P.isNullOrUndefined(a)||(this.showSelectAll=a,this.showSelectAll&&(n=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=n.getConstant("selectAllText"),this.unSelectAllText=n.getConstant("selectAllText"),this.popupWrapper=this.list),this.notify("selectAll",{}),this.checkSelectAll()),P.isNullOrUndefined(o)||this.showCheckbox(o),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}},L([P.Property("")],B.prototype,"cssClass",void 0),L([P.Property([])],B.prototype,"value",void 0),L([P.Property("")],B.prototype,"height",void 0),L([P.Property(!0)],B.prototype,"enabled",void 0),L([P.Property(!1)],B.prototype,"enablePersistence",void 0),L([P.Property(!1)],B.prototype,"allowDragAndDrop",void 0),L([P.Property(1e3)],B.prototype,"maximumSelectionLength",void 0),L([P.Property(!1)],B.prototype,"allowFiltering",void 0),L([P.Property("")],B.prototype,"scope",void 0),L([P.Property(!0)],B.prototype,"ignoreCase",void 0),L([P.Property(null)],B.prototype,"filterBarPlaceholder",void 0),L([P.Property("None")],B.prototype,"sortOrder",void 0),L([P.Event()],B.prototype,"beforeItemRender",void 0),L([P.Event()],B.prototype,"filtering",void 0),L([P.Event()],B.prototype,"select",void 0),L([P.Event()],B.prototype,"change",void 0),L([P.Event()],B.prototype,"beforeDrop",void 0),L([P.Event()],B.prototype,"dragStart",void 0),L([P.Event()],B.prototype,"drag",void 0),L([P.Event()],B.prototype,"drop",void 0),L([P.Event()],B.prototype,"dataBound",void 0),L([P.Property(null)],B.prototype,"groupTemplate",void 0),L([P.Property("Request failed")],B.prototype,"actionFailureTemplate",void 0),L([P.Property(1e3)],B.prototype,"zIndex",void 0),L([P.Property(!1)],B.prototype,"ignoreAccent",void 0),L([P.Complex({},He)],B.prototype,"toolbarSettings",void 0),L([P.Complex({},Ve)],B.prototype,"selectionSettings",void 0);var We,qe,Te=qe=L([P.NotifyPropertyChanges],B);function B(t,e){t=We.call(this,t,e)||this;return t.isValidKey=!1,t.isBackSpace=!1,t.isDataSourceUpdate=!1,t.keyDownStatus=!1,t}var Me={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"};je=function(t,e){return(je=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var je,Re,L=function(t,e,i,s){var l,n=arguments.length,a=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;0<=o;o--)(l=t[o])&&(a=(n<3?l(a):3<n?l(e,i,a):l(e,i))||a);return 3<n&&a&&Object.defineProperty(e,i,a),a},L=(function(t,e){function i(){this.constructor=t}je(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(T,Re=Z),T.prototype.onPropertyChanged=function(t,e){for(var i=0,s=Object.keys(t);i<s.length;i++)switch(s[i]){case"minLength":this.minLength=t.minLength;break;case"suffixText":this.suffixText=t.suffixText;break;case"allowSpaces":this.allowSpaces=t.allowSpaces;break;case"mentionChar":this.mentionChar=t.mentionChar;break;case"showMentionChar":this.showMentionChar=t.showMentionChar;break;case"cssClass":this.updateCssClass(t.cssClass,e.cssClass)}},T.prototype.updateCssClass=function(t,e){P.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),P.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),this.setCssClass(t,[this.inputElement],e),this.popupObj&&this.setCssClass(t,[this.popupObj.element],e)},T.prototype.setCssClass=function(t,e,i){P.isNullOrUndefined(i)||""===i||P.removeClass(e,i.split(" ")),P.isNullOrUndefined(t)||""===t||P.addClass(e,t.split(" "))},T.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},T.prototype.preRender=function(){this.initializeData(),Re.prototype.preRender.call(this)},T.prototype.render=function(){var t="string"==typeof this.target;this.inputElement=P.isNullOrUndefined(this.target)?this.element:this.checkAndUpdateInternalComponent(t?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),P.addClass([this.inputElement],["e-mention"]),P.isNullOrUndefined(this.target))&&P.addClass([this.inputElement],["e-editable-element"]),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},T.prototype.wireEvent=function(){P.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},T.prototype.unWireEvent=function(){P.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},T.prototype.bindCommonEvent=function(){P.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},T.prototype.hideSpinner=function(){this.hideWaitingSpinner()},T.prototype.hideWaitingSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||o.hideSpinner(this.spinnerElement),P.isNullOrUndefined(this.spinnerTemplate)||P.isNullOrUndefined(this.spinnerTemplateElement)||P.detach(this.spinnerTemplateElement)},T.prototype.checkAndUpdateInternalComponent=function(t){if(!this.isVue&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===t.nodeName&&t.classList.contains("e-rte-hidden")){var e=t.parentElement;if(e&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content")}return t&&t.parentElement&&t.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),t},T.prototype.showWaitingSpinner=function(){P.isNullOrUndefined(this.popupObj)||(P.isNullOrUndefined(this.spinnerTemplate)&&P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement)),P.isNullOrUndefined(this.spinnerTemplate))||this.setSpinnerTemplate()},T.prototype.keyDownHandler=function(t){var e=!0;switch(t.keyCode){case 38:t.action=t.altKey?"hide":"up";break;case 40:t.action=t.altKey?"open":"down";break;case 33:t.action="pageUp";break;case 34:t.action="pageDown";break;case 36:t.action="home";break;case 35:t.action="end";break;case 9:t.action=t.shiftKey?"close":"tab";break;case 27:t.action="escape";break;case 32:t.action="space";break;case 13:t.action="enter";break;default:e=!1}e&&this.keyActionHandler(t)},T.prototype.keyActionHandler=function(t){var e,i="down"===t.action||"up"===t.action||"pageUp"===t.action||"pageDown"===t.action||"home"===t.action||"end"===t.action,s="tab"===t.action||"close"===t.action;if(void 0!==this.list||this.isRequested||s||"escape"===t.action||"space"===t.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!(P.isNullOrUndefined(this.list)||!P.isNullOrUndefined(this.liCollections)&&i&&0===this.liCollections.length||this.isRequested))switch("escape"===t.action&&t.preventDefault(),this.isSelected="escape"!==t.action&&this.isSelected,t.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(t);break;case"tab":this.isPopupOpen&&(t.preventDefault(),(e=this.list.querySelector("."+y.selected))&&(this.isSelected=!0,this.setSelection(e,t)),this.isPopupOpen)&&this.hidePopup(t);break;case"enter":this.isPopupOpen&&(t.preventDefault(),this.popupObj)&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,t,!1,!0);break;case"escape":this.isPopupOpen&&this.hidePopup(t)}},T.prototype.updateUpDownAction=function(t){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var e,i=this.list.querySelector("."+y.focus);this.isSelectFocusItem(i)?this.setSelection(i,t):P.isNullOrUndefined(this.liCollections)||(i=this.list.querySelector("."+y.selected),P.isNullOrUndefined(i)||(i=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i)),s="down"===t.action?this.activeIndex+1:this.activeIndex-1,i=0,i="down"===t.action&&P.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,s=s<0?this.liCollections.length-1:s===this.liCollections.length?0:s,i=P.isNullOrUndefined(this.activeIndex)?this.liCollections[i]:this.liCollections[s],P.isNullOrUndefined(i))||this.setSelection(i,t);for(var s=0;s<this.liCollections.length;s++)if(this.liCollections[s].classList.contains(y.focus)||this.liCollections[s].classList.contains(y.selected)){e=s;break}null!=e&&this.isDisabledElement(this.liCollections[e])&&this.updateUpDownAction(t),this.isPopupOpen&&t.preventDefault()}},T.prototype.isSelectFocusItem=function(t){return!P.isNullOrUndefined(t)},T.prototype.unBindCommonEvent=function(){P.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},T.prototype.onKeyUp=function(t){var e,i,s,l,n,a;this.isUpDownKey&&this.isPopupOpen&&229===t.keyCode?this.isUpDownKey=!1:(this.isTyped="Enter"!==t.code&&"Space"!==t.code&&"ArrowDown"!==t.code&&"ArrowUp"!==t.code,i=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image")),document.activeElement===this.inputElement||i||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),e=this.range.startContainer.textContent.split("")),i=this.getTextRange(),s=this.getLastLetter(i),l=this.mentionChar.toString()+this.mentionChar.toString(),n=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),a=new RegExp("[a-zA-Z]","g"),"Shift"!==t.key&&37!==t.keyCode&&39!==t.keyCode&&(this.beforePopupOpen&&this.isPopupOpen&&s===l?this.hidePopup():!i||!s||"Enter"===t.code||27===t.keyCode||s.match(n)&&1<s.match(n).length||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&0<this.range.startContainer.textContent.split("").length&&(1===e.length||-1===e[e.length-2].indexOf("")||1===this.range.startContainer.nodeType)?this.isPopupOpen&&this.allowSpaces&&i&&""!==i.trim()&&a.test(i)&&-1!==i.indexOf(this.mentionChar)&&!this.isMatchedText()&&1<i.length&&" "!==i.replace(/\u00A0/g," ").charAt(i.length-2)&&this.list&&0<this.list.querySelectorAll("ul").length&&"Enter"!==t.code?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(t)):!this.isPopupOpen||this.allowSpaces&&s||"ArrowDown"===t.code||"ArrowUp"===t.code?"Backspace"!==t.key&&"Delete"!==t.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0):(s.includes(this.mentionChar)&&(this.queryString=s.replace(this.mentionChar,"")),this.mentionChar.charCodeAt(0)!==s.charCodeAt(0)||""===this.queryString||38===t.keyCode||40===t.keyCode||this.lineBreak?0===s.indexOf(this.mentionChar)&&!this.isPopupOpen&&8!==t.keyCode&&(!this.popupObj||P.isNullOrUndefined(this.target)&&!document.body.contains(this.popupObj.element)||!P.isNullOrUndefined(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(t),this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)&&this.initValue(),!this.isPopupOpen&&38!==t.keyCode&&40!==t.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&i&&""!==i.trim()&&i.replace(" "," ").lastIndexOf(" ")<i.length-1&&38!==t.keyCode&&40!==t.keyCode&&8!==t.keyCode&&(this.mentionChar.charCodeAt(0)===s.charCodeAt(0)||this.liCollections&&0<this.liCollections.length)?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(t)):""===this.queryString&&this.isPopupOpen&&38!==t.keyCode&&40!==t.keyCode&&this.mentionChar.charCodeAt(0)===s.charCodeAt(0)&&(this.searchLists(t),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(t),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(!this.isContentEditable(this.inputElement)||this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==t.keyCode)&&this.showPopup()),this.isListResetted=!1)))},T.prototype.isMatchedText=function(){for(var t=!1,e=0;e<(this.liCollections&&this.liCollections.length);e++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[e].getAttribute("data-value").toLowerCase()&&(t=!0);return t},T.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},T.prototype.searchLists=function(t){var s,l=this;this.isDataFetched=!1,P.isNullOrUndefined(this.list)&&(Re.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"===t.type||40!==t.keyCode&&38!==t.keyCode?(this.isSelected=!1,this.activeIndex=null,s={preventDefaultAction:!1,text:this.queryString,updateData:function(t,e,i){s.cancel||(l.isFiltered=!0,l.filterAction(t,e,i))},cancel:!1},this.trigger("filtering",s,function(t){t.cancel||l.isFiltered||t.preventDefaultAction||l.filterAction(l.dataSource,null,l.fields)})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields))},T.prototype.filterAction=function(t,e,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(t,i,e),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},T.prototype.onActionComplete=function(t,e,i,s){Re.prototype.onActionComplete.call(this,t,e,i),this.isActive&&(P.isNullOrUndefined(t)||(P.attributes(t,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&-1<this.cssClass.indexOf("e-slash-menu")&&(t.id=this.inputElement.id+"_slash_menu_options")),(e=this.fields.disabled?t.querySelector("."+y.li+":not(.e-disabled)"):t.querySelector("."+y.li))&&(e.classList.add(y.selected),this.selectedLI=e,i=this.getFormattedValue(e.getAttribute("data-value")),this.selectEventCallback(e,this.getDataByValue(i),i,!0)),this.beforePopupOpen)&&this.isPopupOpen&&(P.isNullOrUndefined(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())},T.prototype.setDataIndex=function(){for(var t=0;this.liCollections&&t<this.liCollections.length;t++)this.liCollections[t].setAttribute("data-index",t.toString())},T.prototype.listOption=function(t,e){var i,s=this,t=Re.prototype.listOption.call(this,t,e);return P.isNullOrUndefined(t.itemCreated)?t.itemCreated=function(t){s.highlight&&(s.inputElement.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout(function(){K(t.item,s.queryString,s.ignoreCase,s.filterType)},0):K(t.item,s.queryString,s.ignoreCase,s.filterType))}:(i=t.itemCreated,t.itemCreated=function(t){s.highlight&&K(t.item,s.queryString,s.ignoreCase,s.filterType),i.apply(s,[t])}),t},T.prototype.elementValue=function(){return(this.isContentEditable(this.inputElement)?this.inputElement.textContent:this.inputElement.value).replace(this.mentionChar,"")},T.prototype.getQuery=function(t){var e,i=t?t.clone():this.query?this.query.clone():new c.Query,t=""!==this.queryString||P.isNullOrUndefined(this.elementValue())?this.filterType:"equal",s=""!==this.queryString||P.isNullOrUndefined(this.elementValue())?this.queryString:this.elementValue();if(!this.isFiltered&&(null!==this.queryString&&""!==this.queryString&&(e=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==e)&&"number"!==e?(e=P.isNullOrUndefined(this.fields.text)?"":this.fields.text,i.where(e,t,s,this.ignoreCase,this.ignoreAccent)):i.where("",t,s,this.ignoreCase,this.ignoreAccent)),!P.isNullOrUndefined(this.suggestionCount))){if(25!==this.suggestionCount)for(var l=0;l<i.queries.length;l++)"onTake"===i.queries[l].fn&&i.queries.splice(l,1);i.take(this.suggestionCount)}return i},T.prototype.renderHightSearch=function(){if(this.highlight)for(var t=0;t<this.liCollections.length;t++)this.ulElement.querySelector(".e-active")||(_(this.liCollections[t]),K(this.liCollections[t],this.queryString,this.ignoreCase,this.filterType))},T.prototype.getTextRange=function(){var t,e,i;return this.isContentEditable(this.inputElement)?this.range&&(e=this.range.startContainer,P.isNullOrUndefined(e)||(e=e.textContent,i=this.range.startOffset,e&&0<=i&&(t=e.substring(0,i)))):(e=this.inputElement,P.isNullOrUndefined(e)||(i=e.selectionStart,e.value&&0<=i&&(t=e.value.substring(0,i)))),t},T.prototype.getLastLetter=function(t){return P.isNullOrUndefined(t)?"":(t=(-1<t.indexOf("​")?t.replace(/\u200B/g,""):t).replace(/\u00A0/g," ").split(/\s+/))[t.length-1].trim()},T.prototype.isContentEditable=function(t){return t&&"INPUT"!==t.nodeName&&"TEXTAREA"!==t.nodeName},T.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)&&this.initValue(),this.renderPopup(),P.attributes(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},T.prototype.hidePopup=function(t){this.removeSelection(),this.closePopup(0,t)},T.prototype.closePopup=function(t,e){var i,s=this;this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen&&(P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1,i=this.popupObj,this.trigger("closed",{popup:i,cancel:!1,animation:{name:"FadeOut",duration:100,delay:t||0},event:e||null},function(t){!t.cancel&&s.popupObj&&(s.isPopupOpen?s.popupObj.hide(new P.Animation(t.animation)):s.destroyPopup())}))},T.prototype.renderPopup=function(){var a=this;this.trigger("beforeOpen",{cancel:!1},function(t){var e,i,s,l,n;t.cancel?a.beforePopupOpen=!1:(P.isNullOrUndefined(a.target)?e=a.createElement("div",{id:a.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=a.cssClass?a.cssClass:"")}):(e=a.element,null!=a.cssClass&&P.addClass([e],a.cssClass.split(" "))),a.isRTE&&a.cssClass&&-1<a.cssClass.indexOf("e-slash-menu")?e.id=a.inputElement.id+"_slash_menu_popup":P.isNullOrUndefined(a.target)||(e.id=a.inputElement.id+"_popup"),a.listHeight=P.formatUnit(a.popupHeight),P.isNullOrUndefined(a.list.querySelector("li"))||a.initRemoteRender||(t=a.list.querySelector("."+y.focus),P.isNullOrUndefined(t))||(a.selectedLI=t,n=a.getFormattedValue(t.getAttribute("data-value")),a.selectEventCallback(t,a.getDataByValue(n),n,!0)),P.append([a.list],e),a.inputElement.parentElement&&(t=a.inputElement.parentElement.closest(".e-richtexteditor"))&&e.firstElementChild&&0<e.firstElementChild.childElementCount&&(e.firstElementChild.setAttribute("aria-owns",t.id),P.addClass([e],"e-rte-elements")),a.popupObj&&document.body.contains(a.popupObj.element)&&(document.contains(e)||!P.isNullOrUndefined(a.target))||document.body.appendChild(e),e.style.visibility="hidden",a.setHeight(e),a.initializePopup(e,0,0),a.checkCollision(e),e.style.visibility="visible",s=e.parentElement.offsetWidth-e.offsetWidth,l=e.offsetHeight,P.addClass([e],["e-mention","e-popup","e-popup-close"]),P.isNullOrUndefined(a.list)||(a.unWireListEvents(),a.wireListEvents()),a.selectedElementID=a.selectedLI?a.selectedLI.id:null,P.attributes(a.inputElement,{"aria-owns":a.inputElement.id+"_options","aria-activedescendant":a.selectedElementID}),null==a.selectedElementID&&a.inputElement.removeAttribute("aria-activedescendant"),a.beforePopupOpen=!0,n=a.popupObj,a.trigger("opened",{popup:n,cancel:!1,animation:{name:"FadeIn",duration:100}},function(t){t.cancel?(a.beforePopupOpen=!1,a.destroyPopup()):(a.renderReactTemplates(),a.popupObj&&a.popupObj.show(new P.Animation(t.animation),1e3===a.zIndex?a.inputElement:null),P.isNullOrUndefined(a.getTriggerCharPosition())||(i=a.getCoordinates(a.inputElement,a.getTriggerCharPosition()),a.isCollided?(0<a.collision.length&&-1<a.collision.indexOf("right")&&-1===a.collision.indexOf("bottom")?e.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(s.toString(),"px;\nposition: absolute;\n display: block;"):a.collision&&0<a.collision.length&&-1<a.collision.indexOf("bottom")&&-1===a.collision.indexOf("right")?(e.style.left=P.formatUnit(i.left),e.style.top=P.formatUnit(i.top-parseInt(l.toString(),10))):a.collision&&0<a.collision.length&&-1<a.collision.indexOf("bottom")&&-1<a.collision.indexOf("right")?(e.style.left=P.formatUnit(s),e.style.top=P.formatUnit(i.top-parseInt(l.toString(),10))):(e.style.left=P.formatUnit(i.left),e.style.top=P.formatUnit(i.top-parseInt(a.popupHeight.toString(),10))),a.isCollided=!1,a.collision=[]):e.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(i.left.toString(),"px;\nposition: absolute;\n display: block;"),e.style.width="100%"===a.popupWidth||P.isNullOrUndefined(a.popupWidth)?"auto":P.formatUnit(a.popupWidth),a.setHeight(e),e.style.zIndex=(1e3===a.zIndex?o.getZindexPartial(e):a.zIndex).toString()))}))})},T.prototype.setHeight=function(t){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",t.style.maxHeight=P.formatUnit(this.popupHeight)):t.style.height="auto"},T.prototype.checkCollision=function(t){var e;(!P.Browser.isDevice||P.Browser.isDevice&&"mention"!==this.getModuleName())&&(e=this.getCoordinates(this.inputElement,this.getTriggerCharPosition()),this.collision=o.isCollide(t,null,e.left,e.top),0<this.collision.length&&(t.style.marginTop=-parseInt(getComputedStyle(t).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision())},T.prototype.getTriggerCharPosition=function(){var t,e=this.getTextRange();return(t=null!=e&&(t=0)<=(e=e.lastIndexOf(this.mentionChar))?e:t)||0},T.prototype.initializePopup=function(t,e,i){var s=this;this.popupObj=new o.Popup(t,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:e,enableRtl:this.enableRtl,offsetX:i,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){s.destroyPopup()},open:function(){P.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0,s.setDataIndex()}})},T.prototype.setWidth=function(){var t=P.formatUnit(this.popupWidth);return t=-1<t.indexOf("%")?(this.inputElement.offsetWidth*parseFloat(t)/100).toString()+"px":t},T.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),P.isNullOrUndefined(this.target)?P.detach(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},T.prototype.onDocumentClick=function(t){var e=t.target;!P.isNullOrUndefined(this.popupObj)&&P.closest(e,"#"+this.popupObj.element.id)||this.hidePopup(t)},T.prototype.getCoordinates=function(t,e){var i,s,l,n,a,o=this.isContentEditable(this.inputElement)?(o=this.getTriggerCharPosition(),c=this.range,a=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(a.setStart(c.startContainer,o),a.setEnd(c.startContainer,o)):(a.setStart(c.startContainer,c.startOffset),a.setEnd(c.startContainer,c.endOffset)),this.isTyped=!1,a.collapse(!1),0===a.getBoundingClientRect().top?a.startContainer.getClientRects()[0]:a.getBoundingClientRect()):(i=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(i),n=getComputedStyle(t),i.style.position="absolute",i.style.visibility="hidden",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach(function(t){i.style[t]=n[t]}),i.textContent=t.value.substring(0,e),"INPUT"===this.inputElement.nodeName&&(i.textContent=i.textContent.replace(/\s/g," ")),(s=this.createElement("span")).textContent=t.value.substring(e)||".",i.appendChild(s),t.getBoundingClientRect()),r=o.top,h=o.left,u=document.querySelectorAll("iframe");if(0<u.length)for(var p=0;p<u.length;p++){var d=u[p];d.contentDocument&&d.contentDocument.contains(t)&&(r+=(d=d.getBoundingClientRect()).top,h+=d.left)}var c=document.documentElement,e=(window.pageXOffset||c.scrollLeft)-(c.clientLeft||0),o=(window.pageYOffset||c.scrollTop)-(c.clientTop||0),m=0;if(!P.isNullOrUndefined(a)&&0===a.getBoundingClientRect().top)for(var f,v,p=0;p<this.range.startContainer.childNodes.length;p++)this.range.startContainer.childNodes[p].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[p].textContent.trim()?m+=this.range.startContainer.childNodes[p].getClientRects()[0].width:""!==this.range.startContainer.childNodes[p].textContent&&((f=document.createElement("span")).innerHTML=this.range.startContainer.childNodes[p].nodeValue,document.body.appendChild(f),v=f.offsetWidth,document.body.removeChild(f),m+=v);return this.isContentEditable(this.inputElement)?l=this.collision&&0<this.collision.length&&-1<this.collision.indexOf("right")&&-1===this.collision.indexOf("bottom")?{top:r+o+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:h+e+m}:{top:r+o+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:h+e+m}:(l={top:r+o+s.offsetTop+parseInt(n.borderTopWidth,10)+parseInt(n.fontSize,10)+3-t.scrollTop-(this.isCollided?10:0),left:h+e+s.offsetLeft+parseInt(n.borderLeftWidth,10)},document.body.removeChild(i)),l},T.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof c.DataManager?this.initRemoteRender=!0:this.updateValues()},T.prototype.updateValues=function(){var t=this.list.querySelector("."+y.focus);P.isNullOrUndefined(t)||this.setSelection(t,null)},T.prototype.renderList=function(){Re.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},T.prototype.wireListEvents=function(){P.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},T.prototype.unWireListEvents=function(){P.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},T.prototype.onMouseClick=function(t){var e=t.target,e=P.closest(e,"."+y.li);!this.isValidLI(e)||this.isDisabledElement(e)||(this.isSelected=!0,this.setSelection(e,t),this.closePopup(100,t),this.inputElement.focus(),this.isRTE)||t.preventDefault()},T.prototype.updateSelectedItem=function(e,i,t,s){var l=this,n=(this.removeSelection(),e.classList.add(y.selected),this.removeHover(),this.getFormattedValue(e.getAttribute("data-value"))),a=this.getDataByValue(n);t||P.isNullOrUndefined(i)||"down"===i.action||"up"===i.action?(this.selectEventCallback(e,a,n),s&&this.setSelectOptions(e,i)):(t=this.detachChanges(a),this.isSelected=!0,this.trigger("select",{e:i,item:e,itemData:t,isInteracted:!!i,cancel:!1},function(t){t.cancel?(e.classList.remove(y.selected),l.isSelected=!1,l.isSelectCancel=!0):(l.selectEventCallback(e,a,n),s&&l.setSelectOptions(e,i))}))},T.prototype.setSelection=function(t,e){this.isValidLI(t)&&(!t.classList.contains(y.selected)||this.isPopupOpen&&this.isSelected&&t.classList.contains(y.selected))?this.updateSelectedItem(t,e,!1,!0):this.setSelectOptions(t,e)},T.prototype.setSelectOptions=function(t,e){this.list&&this.removeHover(),this.previousSelectedLI=P.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=t,this.isPopupOpen&&!P.isNullOrUndefined(this.selectedLI)&&this.setScrollPosition(e),e&&(38===e.keyCode||40===e.keyCode)||P.isNullOrUndefined(e)||this.setValue(e)},T.prototype.setScrollPosition=function(t){if(P.isNullOrUndefined(t))this.scrollBottom(!0);else switch(t.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},T.prototype.scrollBottom=function(t){var e,i,s;P.isNullOrUndefined(this.selectedLI)||(e=this.list.offsetHeight,i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,s=this.list.scrollTop+i-e,s=t?s+2*parseInt(getComputedStyle(this.list).paddingTop,10):s,t=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,0===this.activeIndex?this.list.scrollTop=0:(e<i||!(0<t&&this.list.offsetHeight>t))&&(this.list.scrollTop=s))},T.prototype.scrollTop=function(){var t,e;P.isNullOrUndefined(this.selectedLI)||(t=P.isNullOrUndefined(this.fields.groupBy)||P.isNullOrUndefined(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight),t=this.fields.groupBy&&t,e=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,0===this.activeIndex?this.list.scrollTop=0:t<0?this.list.scrollTop=this.list.scrollTop+t:0<e&&this.list.offsetHeight>e||(this.list.scrollTop=this.selectedLI.offsetTop))},T.prototype.selectEventCallback=function(t,e,i,s){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=t,this.itemData=e;e=this.list.querySelector("."+y.focus);e&&P.removeClass([e],y.focus),s&&P.addClass([t],y.selected),t.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(i)},T.prototype.detachChanges=function(t){t="string"==typeof t||"boolean"==typeof t||"number"==typeof t?Object.defineProperties({},{value:{value:t,enumerable:!0},text:{value:t,enumerable:!0}}):t;return t},T.prototype.setValue=function(t){return this.isReact?P.isNullOrUndefined(this.displayTemplate)?this.updateMentionValue(t):this.setDisplayTemplate(t):(P.isNullOrUndefined(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(t)),!0},T.prototype.updateMentionValue=function(t){var e,i,s=this.getItemData(),l="string"==typeof this.suffixText?this.suffixText:"",n=this.inputElement.ownerDocument.getSelection(),a=this.getTriggerCharPosition();if(this.isSelectCancel)this.isSelectCancel=!1;else{if(null!==s.text&&(e=this.mentionVal(s.text)),this.isContentEditable(this.inputElement)){i=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(i=this.range.endOffset),s=this.range,p=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(p.setStart(s.startContainer,a),p.setEnd(s.startContainer,i)):""!==s.commonAncestorContainer.textContent.trim()&&!P.isNullOrUndefined(s.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(p.setStart(s.startContainer,s.startOffset-1),p.setEnd(s.startContainer,s.endOffset-1)):(p.setStart(s.startContainer,s.startOffset),p.setEnd(s.startContainer,s.endOffset)),this.isTyped=!1,p.deleteContents(),p.startContainer.parentElement.normalize();for(var o,r=this.createElement("div"),h=(r.innerHTML=e,document.createDocumentFragment()),u=void 0;o=r.firstChild;)u=h.appendChild(o);p.insertNode(h),u&&(p=p.cloneRange(),this.isRTE?p.setStart(u,u.textContent.length):p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p)),this.isPopupOpen&&this.hidePopup(),P.isNullOrUndefined(t.pointerType)||"mouse"!==t.pointerType||(s=new CustomEvent("content-changed",{detail:{click:!0}}),this.inputElement.dispatchEvent(s))}else{var n=this.inputElement,p=this.getTextRange().substring(a+this.mentionChar.length,this.getTextRange().length);e+=l,i=a+this.mentionChar.length,i+=p.length,n.value=n.value.substring(0,a)+e+n.value.substring(i,n.value.length),n.selectionStart=a+e.length,n.selectionEnd=a+e.length,this.isPopupOpen&&this.hidePopup()}this.onChangeEvent(t)}},T.prototype.mentionVal=function(t){var e=this.showMentionChar?this.mentionChar:"";return P.isNullOrUndefined(this.displayTemplate)||P.isNullOrUndefined(this.displayTempElement)||(t=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?P.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+e+t+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):'<span contenteditable="false" class="e-mention-chip">'+e+t+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):e+t},T.prototype.setDisplayTemplate=function(t){var e=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement)&&(P.detach(this.displayTempElement),this.displayTempElement=null),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var i=P.compile(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);i&&0<i.length&&P.append(i,this.displayTempElement),this.isReact?this.renderTemplates(function(){e.updateMentionValue(t)}):this.renderTemplates()},T.prototype.renderTemplates=function(t){this.renderReactTemplates(t)},T.prototype.setSpinnerTemplate=function(){var t=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement)&&(P.detach(this.spinnerTemplateElement),this.spinnerTemplateElement=null),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var e=P.compile(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(e&&0<e.length)for(var i=0;i<e.length;i++)this.spinnerTemplateElement.appendChild(e[i]);this.isReact?this.renderTemplates(function(){t.popupObj.element.appendChild(t.spinnerTemplateElement)}):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},T.prototype.onChangeEvent=function(t){this.isSelected=!1;var e=this.detachMentionChanges(this.itemData),i="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,e={e:t,item:this.item,itemData:e,previousItem:this.previousSelectedLI,previousItemData:i,isInteracted:!!t,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",e)},T.prototype.detachMentionChanges=function(t){t="string"==typeof t||"boolean"==typeof t||"number"==typeof t?Object.defineProperties({},{value:{value:t,enumerable:!0},text:{value:t,enumerable:!0}}):t;return t},T.prototype.getItemData=function(){var t,e,i=this.fields,s=this.itemData;return P.isNullOrUndefined(s)||(t=P.getValue(i.value,s),e=P.getValue(i.text,s)),{value:P.isNullOrUndefined(s)||P.isUndefined(t)?s:t,text:P.isNullOrUndefined(s)||P.isUndefined(t)?s:e}},T.prototype.removeSelection=function(){var t;this.list&&(t=this.list.querySelectorAll("."+y.selected)).length&&(P.removeClass(t,y.selected),t[0].removeAttribute("aria-selected"))},T.prototype.onMouseOver=function(t){t=P.closest(t.target,"."+y.li);this.setHover(t)},T.prototype.setHover=function(t){this.isValidLI(t)&&!t.classList.contains(y.hover)&&(this.removeHover(),P.addClass([t],y.hover))},T.prototype.removeHover=function(){var t;this.list&&(t=this.list.querySelectorAll("."+y.hover))&&t.length&&P.removeClass(t,y.hover)},T.prototype.isValidLI=function(t){return t&&t.hasAttribute("role")&&"option"===t.getAttribute("role")},T.prototype.onMouseLeave=function(){this.removeHover()},T.prototype.search=function(t,e,i){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var s=this.getTextRange(),s=(this.queryString=t,this.getLastLetter(s));this.ignoreCase&&(t===s||t===s.toLowerCase())||!this.ignoreCase&&t===s?(this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)?(this.renderList(),this.renderPopup()):this.isPopupOpen||this.renderPopup(),this.popupObj.element.style.left=P.formatUnit(e),this.popupObj.element.style.top=P.formatUnit(i)):this.isPopupOpen&&this.hidePopup()},T.prototype.disableItem=function(t){if(this.fields.disabled){this.list||this.renderList();var e,i=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof t)i=this.getIndexByValue(t);else if("object"==typeof t){if(t instanceof HTMLLIElement){for(var s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===t){i=this.getIndexByValue(t.getAttribute("data-value"));break}}else for(var l=JSON.parse(JSON.stringify(t))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===l){i=this.getIndexByValue(l);break}}else i=t;i<this.liCollections.length&&-1<i&&!JSON.parse(JSON.stringify(this.listData[i]))[this.fields.disabled]&&(e=this.liCollections[i])&&(this.disableListItem(e),(e=JSON.parse(JSON.stringify(this.listData[i])))[this.fields.disabled]=!0,this.listData[i]=e,this.dataSource=this.listData)}}},T.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,Re.prototype.destroy.call(this))},T.prototype.getLocaleName=function(){return"mention"},T.prototype.getNgDirective=function(){return"EJS-MENTION"},T.prototype.getModuleName=function(){return"mention"},L([P.Property(null)],T.prototype,"cssClass",void 0),L([P.Property("@")],T.prototype,"mentionChar",void 0),L([P.Property(!1)],T.prototype,"showMentionChar",void 0),L([P.Property(!1)],T.prototype,"allowSpaces",void 0),L([P.Property(null)],T.prototype,"suffixText",void 0),L([P.Property(25)],T.prototype,"suggestionCount",void 0),L([P.Property(0)],T.prototype,"minLength",void 0),L([P.Property("None")],T.prototype,"sortOrder",void 0),L([P.Property(!0)],T.prototype,"ignoreCase",void 0),L([P.Property(!1)],T.prototype,"highlight",void 0),L([P.Property()],T.prototype,"locale",void 0),L([P.Property("auto")],T.prototype,"popupWidth",void 0),L([P.Property("300px")],T.prototype,"popupHeight",void 0),L([P.Property(null)],T.prototype,"displayTemplate",void 0),L([P.Property(null)],T.prototype,"itemTemplate",void 0),L([P.Property("No records found")],T.prototype,"noRecordsTemplate",void 0),L([P.Property(null)],T.prototype,"spinnerTemplate",void 0),L([P.Property()],T.prototype,"target",void 0),L([P.Property([])],T.prototype,"dataSource",void 0),L([P.Property(null)],T.prototype,"query",void 0),L([P.Property("Contains")],T.prototype,"filterType",void 0),L([P.Complex({text:null,value:null,iconCss:null,groupBy:null},tt)],T.prototype,"fields",void 0),L([P.Event()],T.prototype,"actionBegin",void 0),L([P.Event()],T.prototype,"actionComplete",void 0),L([P.Event()],T.prototype,"actionFailure",void 0),L([P.Event()],T.prototype,"change",void 0),L([P.Event()],T.prototype,"beforeOpen",void 0),L([P.Event()],T.prototype,"opened",void 0),L([P.Event()],T.prototype,"closed",void 0),L([P.Event()],T.prototype,"select",void 0),L([P.Event()],T.prototype,"filtering",void 0),L([P.Event()],T.prototype,"created",void 0),L([P.Event()],T.prototype,"destroyed",void 0),L([P.NotifyPropertyChanges],T));function T(t,e){return Re.call(this,t,e)||this}t.AutoComplete=E,t.CheckBoxSelection=Ne,t.ComboBox=a,t.DropDownBase=Z,t.DropDownList=i,t.DropDownTree=l,t.FieldSettings=tt,t.Fields=Ft,t.ListBox=Te,t.Mention=L,t.MultiSelect=w,t.Search=d,t.SelectionSettings=Ve,t.ToolbarSettings=He,t.TreeSettings=qt,t.VirtualScroll=X,t.createFloatLabel=Yt,t.dropDownBaseClasses=y,t.dropDownListClasses=f,t.encodePlaceholder=se,t.escapeCharRegExp=R,t.floatLabelBlur=ie,t.floatLabelFocus=ee,t.highlightSearch=K,t.incrementalSearch=j,t.removeFloating=Zt,t.resetIncrementalSearchValues=z,t.revertHighlightSearch=_,t.setPlaceHolder=te,t.updateFloatLabelState=$t,Object.defineProperty(t,"__esModule",{value:!0})});
10
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-lists"),require("@syncfusion/ej2-notifications"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-navigations")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-lists","@syncfusion/ej2-notifications","@syncfusion/ej2-popups","@syncfusion/ej2-inputs","@syncfusion/ej2-buttons","@syncfusion/ej2-navigations"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2Lists,e.ej2Notifications,e.ej2Popups,e.ej2Inputs,e.ej2Buttons,e.ej2Navigations)}(this,function(e,P,c,U,V,o,h,H,F){"use strict";var v="",W="",q="",g=[],M="";function j(e,t,i,s,l,n,a,o,r){var h;if(n&&""!==v?v===W&&(q=String.fromCharCode(e)):""!==q?(v=q+String.fromCharCode(e),q=""):v+=String.fromCharCode(e),o?(setTimeout(function(){q=""},700),setTimeout(function(){v=""},3e3)):setTimeout(function(){v=""},1e3),v=s?v.toLowerCase():v,M!==l||W!==v||r){var u=t,p=v.length,d=void 0,c=i=i?i+1:0;for(g=[];d=u[h=-1===(c=c===u.length?-1:c)?0:c],(s?d.innerText.toLowerCase():d.innerText).substr(0,p)===v&&g.push(u[h]),++c!==i;);if(W=v,M=l,o){for(var m=!1,f=0;f<g.length;f++)if(a&&g[f].textContent.toLowerCase()===a.toLowerCase()){h=f,m=!0;break}return a&&m&&(h+=1),g[h]||g[0]}return g[0]}for(var c=0;c<g.length;c++){if(g[c].classList.contains("e-active")){h=c;break}if(a&&g[c].textContent.toLowerCase()===a.toLowerCase()){h=c;break}}return h+=1,o?g[h]&&g.length-1!==h?g[h]:g[g.length]:g[h]||g[0]}function d(e,a,o,r,h,u,p,d){var t=a,c=(r=null==r||r,{item:null,index:null});if(e&&e.length)for(var m=e.length,f=R(f=r?e.toLocaleLowerCase():e),i=0,s=t;i<s.length;i++){var l=function(e,t){var i,s,l,t=t[e],n=(a&&h&&(s=t,l=u.text.split("."),h.filter(function(t){Array.prototype.slice.call(l).forEach(function(e){("object"===p&&!t.isHeader&&-1!==s.textContent.toString().indexOf(t[e])&&s.getAttribute("data-value")===t[u.value].toString()||"string"===p&&-1!==s.textContent.toString().indexOf(t))&&(i="object"===p?t[e]:t)})})),(h&&i?r?i.toString().toLocaleLowerCase():i:r?t.textContent.toLocaleLowerCase():t.textContent).replace(/^\s+|\s+$/g,""));if(d&&n&&f&&(n=n.normalize("NFD").replace(/[\u0300-\u036f]/g,""),f=f.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),"Equal"===o&&n===f||"StartsWith"===o&&n.substr(0,m)===f||"EndsWith"===o&&n.substr(n.length-f.length)===f||"Contains"===o&&new RegExp(f,"g").test(n))return{value:{item:c.item=t,index:c.index=e}}}(i,s);if("object"==typeof l)return l.value}return c}function R(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function z(e){M===e&&(v=W=M="",g=[])}function K(e,t,i,s){/<[^>]*>/g.test(e.innerText)&&(e.innerText=e.innerText.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})),""!==t&&(i=i?"gim":"gm",t=/^[a-zA-Z0-9- ]*$/.test(t)?t:t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),function e(t,i){for(var s=0;t.childNodes&&s<t.childNodes.length;s++){if(3===t.childNodes[s].nodeType&&""!==t.childNodes[s].textContent.trim()){var l=t.childNodes[s].nodeValue.trim().replace(i,'<span class="e-highlight">$1</span>');t.childNodes[s].nodeValue="",t.innerHTML=t.innerHTML.trim()+l;break}e(t.childNodes[s],i)}}(e,new RegExp("StartsWith"===s?"^("+t+")":"EndsWith"===s?"("+t+")$":"("+t+")",i)))}function _(e){for(var t=e.querySelectorAll(".e-highlight"),i=t.length-1;0<=i;i--){var s=t[i].parentNode,l=document.createTextNode(t[i].textContent);s.replaceChild(l,t[i])}}var G=function(){return(G=Object.assign||function(e){for(var t,i=1,s=arguments.length;i<s;i++)for(var l in t=arguments[i])Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l]);return e}).apply(this,arguments)},Q=function(n,a,o,r){return new(o=o||Promise)(function(e,t){function i(e){try{l(r.next(e))}catch(e){t(e)}}function s(e){try{l(r.throw(e))}catch(e){t(e)}}function l(t){t.done?e(t.value):new o(function(e){e(t.value)}).then(i,s)}l((r=r.apply(n,a||[])).next())})},J=function(s,l){var n,a,o,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(o=2&t[0]?a.return:t[0]?a.throw||((o=a.return)&&o.call(a),0):a.next)&&!(o=o.call(a,t[1])).done)return o;switch(a=0,(t=o?[2&t[0],o.value]:t)[0]){case 0:case 1:o=t;break;case 4:return r.label++,{value:t[1],done:!1};case 5:r.label++,a=t[1],t=[0];continue;case 7:t=r.ops.pop(),r.trys.pop();continue;default:if(!(o=0<(o=r.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){r=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3]))r.label=t[1];else if(6===t[0]&&r.label<o[1])r.label=o[1],o=t;else{if(!(o&&r.label<o[2])){o[2]&&r.ops.pop(),r.trys.pop();continue}r.label=o[2],r.ops.push(t)}}t=l.call(s,r)}catch(e){t=[6,e],a=0}finally{n=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},X=(t.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("observe",this.observe,this),this.parent.on("setGeneratedData",this.setGeneratedData,this),this.parent.on("dataProcessAsync",this.dataProcessAsync,this),this.parent.on("setCurrentViewDataAsync",this.setCurrentViewDataAsync,this),this.parent.on("bindScrollEvent",this.bindScrollEvent,this))},t.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("observe",this.observe),this.parent.off("setGeneratedData",this.setGeneratedData),this.parent.off("dataProcessAsync",this.dataProcessAsync),this.parent.off("setCurrentViewDataAsync",this.setCurrentViewDataAsync),this.parent.off("bindScrollEvent",this.bindScrollEvent))},t.prototype.bindScrollEvent=function(e){var t=this;this.component=e.component,this.observe(function(e){return t.scrollListener(e)})},t.prototype.observe=function(e){this.containerElementRect=this.parent.popupContentElement.getBoundingClientRect(),P.EventHandler.add(this.parent.popupContentElement,"wheel mousedown",this.popupScrollHandler,this),this.touchModule=new P.Touch(this.parent.popupContentElement,{scroll:this.popupScrollHandler.bind(this)}),P.EventHandler.add(this.parent.popupContentElement,"scroll",this.virtualScrollHandler(e),this)},t.prototype.getModuleName=function(){return"VirtualScroll"},t.prototype.popupScrollHandler=function(){this.parent.isMouseScrollAction=!0,this.parent.isPreventScrollAction=!1},t.prototype.getPageQuery=function(e,t,i){return e=0===i||this.parent.allowFiltering||"autocomplete"===this.component?e:e.skip(t)},t.prototype.setGeneratedData=function(e,t){for(var i,s=0,l=this.parent.listData.length+this.parent.virtualItemStartIndex,n=this.parent.virtualItemStartIndex;n<l;n++)this.parent.generatedDataObject[n]||null!==t&&0<this.parent.listData.slice(s,s+1).length&&0<(i=this.parent.listData.slice(s,s+1)).length&&(this.parent.generatedDataObject[n]=i),s++},t.prototype.generateAndExecuteQueryAsync=function(e,t,i,s){void 0===t&&(t=0),void 0===i&&(i=0);var l=this.parent.dataSource,s=((s=void 0===s?!1:s)||(e=P.isNullOrUndefined(this.parent.query)?this.getPageQuery(e,t,i):(s=this.removeSkipAndTakeEvents(this.parent.query.clone()),this.getPageQuery(s,t,i))),this.parent.isCustomFilter);"combobox"===this.component&&(t=0,this.parent.dataSource instanceof c.DataManager?t=this.parent.dataSource.dataSource.json.length:this.parent.dataSource&&0<this.parent.dataSource.length&&(t=this.parent.dataSource.length),0<t)&&(this.parent.isCustomFilter=t===this.parent.totalItemCount&&this.parent.queryString!==this.parent.typedString||this.parent.isCustomFilter),this.parent.resetList(l,this.parent.fields,e),this.parent.isCustomFilter=s},t.prototype.removeSkipAndTakeEvents=function(e){return e.queries=e.queries.filter(function(e){return"onSkip"!==e.fn&&"onTake"!==e.fn}),e},t.prototype.setCurrentViewDataAsync=function(e){var t=[],i=!1,s=!0,l=(P.isNullOrUndefined(this.component)&&(this.component=e.component),this.parent.viewPortInfo.endIndex);if("multiselect"===this.component&&"CheckBox"===this.parent.mode&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.enableSelectionOrder&&""===this.parent.targetElement().trim()&&(this.parent.viewPortInfo.startIndex<this.parent.value.length?(l=this.parent.viewPortInfo.endIndex-this.parent.value.length,0===this.parent.viewPortInfo.startIndex?(this.parent.updateVirtualReOrderList(!0),this.parent.value.length<this.parent.itemCount&&this.parent.value.length!==this.parent.totalItemCount?((a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof c.DataManager&&this.parent.appendUncheckList,s=!1):(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),s=!1):0!==this.parent.viewPortInfo.startIndex&&(this.parent.updateVirtualReOrderList(!0),(a=this.parent.list.querySelector(".e-list-parent:not(.e-reorder)"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),s=!1),0!==this.parent.viewPortInfo.startIndex&&this.parent.viewPortInfo.startIndex-this.parent.value.length!==this.parent.itemCount&&this.parent.viewPortInfo.startIndex+this.parent.itemCount>this.parent.value.length&&(u=(u=this.parent.getForQuery(this.parent.value).clone()).skip(0).take(this.parent.itemCount-(this.parent.value.length-this.parent.viewPortInfo.startIndex)),this.parent.appendUncheckList=!0,this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1,this.parent.appendUncheckList=this.parent.dataSource instanceof c.DataManager&&this.parent.appendUncheckList)):(e=this.parent.list.querySelectorAll(".e-reorder")[0],this.parent.list.querySelector(".e-virtual-ddl-content")&&e&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(e),u=this.parent.getForQuery(this.parent.value).clone(),e=0<=this.parent.viewPortInfo.startIndex-this.parent.value.length?this.parent.viewPortInfo.startIndex-this.parent.value.length:0,u=u.skip(e),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),s=!1),this.parent.totalItemsCount()),s)for(var n=this.parent.viewPortInfo.startIndex;n<l;n++){var a,o=n,r=("multiselect"===this.component&&"CheckBox"===this.parent.mode&&(a=this.parent.list.querySelector(".e-list-parent.e-reorder"))&&this.parent.list.querySelector(".e-virtual-ddl-content").removeChild(a),this.parent.generatedDataObject[o]);if("multiselect"===this.component&&this.parent.hideSelectedItem){if(r){var h=P.getValue(this.parent.fields.value,r[0]);if(this.parent.value&&null!==h&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.value.indexOf(h)<0){var u=this.parent.getForQuery(this.parent.value).clone();u=this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0;break}(null===this.parent.value||this.parent.value&&0===this.parent.value.length)&&t.push(r[0])}o===l-1&&t.length!==this.parent.itemCount&&this.parent.hideSelectedItem&&(u=this.parent.value&&0<this.parent.value.length?this.parent.getForQuery(this.parent.value).clone():new c.Query,u=this.parent.value&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount+this.parent.value.length&&this.parent.hideSelectedItem?u.skip(this.parent.totalItemCount-this.parent.itemCount):u.skip(this.parent.viewPortInfo.startIndex),this.parent.setCurrentView=!1,this.parent.resetList(this.parent.dataSource,this.parent.fields,u),i=!0)}else r&&t.push(r[0]);this.parent.setCurrentView=!1}!i&&s&&("multiselect"===this.component&&this.parent.allowCustomValue&&0===this.parent.viewPortInfo.startIndex&&this.parent.virtualCustomData&&t.splice(0,0,this.parent.virtualCustomData),"multiselect"===this.component&&this.parent.allowCustomValue&&this.parent.viewPortInfo.endIndex===this.parent.totalItemCount&&this.parent.virtualCustomSelectData&&0<this.parent.virtualCustomSelectData.length&&(t=t.concat(this.parent.virtualCustomSelectData)),this.parent.renderItems(t,this.parent.fields,"multiselect"===this.component&&"CheckBox"===this.parent.mode)),"multiselect"===this.component&&(this.parent.updatevirtualizationList(),this.parent.checkMaxSelection()),this.parent.getSkeletonCount(),this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.dataSource instanceof c.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount;e=this.parent.list.getElementsByClassName("e-virtual-ddl")[0],e?e.style=this.parent.GetVirtualTrackHeight():!e&&0<this.parent.skeletonCount&&this.parent.popupWrapper&&(s=this.parent.createElement("div",{id:this.parent.element.id+"_popup",className:"e-virtual-ddl",styles:this.parent.GetVirtualTrackHeight()}),this.parent.popupWrapper.querySelector(".e-dropdownbase").appendChild(s)),this.parent.UpdateSkeleton(),this.parent.liCollections=this.parent.list.querySelectorAll(".e-list-item"),e=this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0];e&&(e.style=this.parent.getTransformValues()),this.parent.fields.groupBy&&this.parent.scrollStop(),40===this.parent.keyCode&&this.parent.isScrollChanged&&this.parent.hideSelectedItem&&!P.isNullOrUndefined(this.parent.currentFocuedListElement)&&(s=this.parent.getElementByValue(this.parent.currentFocuedListElement.getAttribute("data-value")),this.parent.addListFocus(s),this.parent.isScrollChanged=!1)},t.prototype.generateQueryAndSetQueryIndexAsync=function(e,t){var i=!1,s=0,l=0,n=this.parent.viewPortInfo.endIndex;if(!t&&0!==n)for(var a=this.parent.viewPortInfo.startIndex;a<=n;a++)a in this.parent.generatedDataObject||(i?l=a===n?a:a+1:(i=!0,s=l=a));!i||this.parent.totalItemCount===s&&this.parent.totalItemCount===l||(this.parent.virtualItemStartIndex=s,this.parent.virtualItemEndIndex=l,this.parent.setCurrentView=!0,this.generateAndExecuteQueryAsync(e,s,l),"multiselect"===this.component&&this.parent.hideSelectedItem&&this.parent.value&&Array.isArray(this.parent.value)&&0<this.parent.value.length&&this.parent.totalItemsCount(),"multiselect"===this.component&&this.parent.virtualItemStartIndex===this.parent.virtualItemEndIndex&&(this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex)),this.parent.dataSource instanceof c.DataManager&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.isRequesting)||this.setCurrentViewDataAsync()},t.prototype.dataProcessAsync=function(e){this.parent.selectedValueInfo=null,this.parent.virtualItemStartIndex=this.parent.viewPortInfo.startIndex,this.parent.virtualItemEndIndex=this.parent.viewPortInfo.endIndex,this.generateQueryAndSetQueryIndexAsync(new c.Query,e)},t.prototype.virtualScrollRefreshAsync=function(){return Q(this,void 0,void 0,function(){return J(this,function(e){switch(e.label){case 0:return this.parent.isCustomFilter=!(this.parent.isTyped||"combobox"===this.component&&this.parent.allowFiltering&&this.parent.queryString!==this.parent.typedString||!P.isNullOrUndefined(this.parent.filterInput)&&!P.isNullOrUndefined(this.parent.filterInput.value)&&""!==this.parent.filterInput.value&&"combobox"!==this.component)&&!("autocomplete"===this.component&&null!=this.parent.value)||this.parent.isCustomFilter,!this.parent.allowFiltering&&"autocomplete"!==this.component||(P.isNullOrUndefined(this.parent.typedString)||"combobox"===this.component&&!P.isNullOrUndefined(this.parent.typedString)&&this.parent.allowFiltering?(this.parent.getSkeletonCount(!0),"combobox"===this.component&&(this.parent.skeletonCount=0!==this.parent.totalItemCount&&this.parent.totalItemCount<2*this.parent.itemCount&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.dataSource instanceof c.DataManager&&this.parent.totalItemCount<=this.parent.itemCount)?0:this.parent.skeletonCount)):(this.parent.viewPortInfo.endIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.endIndex=this.parent.dataCount),this.parent.viewPortInfo.startIndex>=this.parent.dataCount&&(this.parent.viewPortInfo.startIndex=this.parent.dataCount-this.parent.itemCount))),[4,this.dataProcessAsync()];case 1:return e.sent(),null==this.parent.keyboardEvent||this.parent.dataSource instanceof c.DataManager&&(!(this.parent.dataSource instanceof c.DataManager)||this.parent.isRequesting)||this.parent.handleVirtualKeyboardActions(this.parent.keyboardEvent,this.parent.pageCount),this.parent.customFilterQuery||(this.parent.isCustomFilter=!1),[2]}})})},t.prototype.scrollListener=function(e){var t,i,s=this;this.parent.isPreventScrollAction||this.parent.isVirtualTrackHeight||(this.parent.preventSetCurrentData=!1,t=e.sentinel,i=this.parent.previousStartIndex,this.parent.viewPortInfo=this.getInfoFromView(e.direction,t,e.offset,!1),this.parent.isUpwardScrolling=!1,this.parent.previousStartIndex===i||this.parent.isKeyBoardAction?this.parent.isScrollActionTriggered&&(this.parent.isPreventKeyAction=!1,this.parent.isScrollActionTriggered=!1,this.parent.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.parent.getTransformValues()):(this.parent.isScrollActionTriggered=!1,this.parent.currentPageNumber=this.parent.viewPortInfo.currentPageNumber,this.parent.virtualListInfo=G({},this.parent.viewPortInfo),this.parent.isPreventKeyAction=!0,this.parent.isVirtualScrolling=!0,setTimeout(function(){s.parent.pageCount=s.parent.getPageCount(),s.virtualScrollRefreshAsync().then(function(){s.parent.popupObj&&(s.parent.list=s.parent.popupObj.element.querySelector(".e-content")||P.select(".e-content"),s.parent.updateSelectionList(),s.parent.liCollections=s.parent.getItems()),s.parent.isKeyBoardAction=!1,s.parent.isVirtualScrolling=!1,s.parent.isPreventKeyAction=!1})},5)),this.parent.previousInfo=this.parent.viewPortInfo)},t.prototype.getInfoFromView=function(e,t,i,s){var l,n,e={direction:e,sentinelInfo:t,offsets:i,startIndex:this.parent.previousStartIndex,endIndex:this.parent.previousEndIndex},t=this.parent.popupContentElement?this.parent.popupContentElement.getBoundingClientRect().height:0,a=this.parent.listItemHeight,i=i.top/a,t=t/a,o=i+t,r=this.parent.virtualItemCount/4,h=this.parent.totalItemCount;return"down"===e.direction?(n=Math.round(o)-Math.round(r),(P.isNullOrUndefined(e.startIndex)||o>e.startIndex+Math.round(this.parent.virtualItemCount/2+r)&&e.endIndex!==h)&&(e.startIndex=0<=n?Math.round(n):0,e.startIndex=e.startIndex>i?Math.floor(i):e.startIndex,l=e.startIndex+this.parent.virtualItemCount,e.startIndex=l<o?Math.ceil(o)-this.parent.virtualItemCount:e.startIndex,e.endIndex=l<h?l:h,e.startIndex=h<=l?0<e.endIndex-this.parent.virtualItemCount?e.endIndex-this.parent.virtualItemCount:0:e.startIndex,e.currentPageNumber=Math.ceil(e.endIndex/this.parent.virtualItemCount))):"up"===e.direction&&(e.startIndex&&e.endIndex||Math.ceil(i)>this.parent.previousStartIndex)&&(i<Math.round((e.startIndex*a+r*a)/a)||Math.ceil(i)>this.parent.previousStartIndex)&&(l=Math.round(i+(t<r?r:t+t/4)),e.endIndex=l<h?l:h,n=e.endIndex-this.parent.virtualItemCount,e.startIndex=0<n?n:0,e.endIndex=n<0?this.parent.virtualItemCount:e.endIndex,e.currentPageNumber=Math.ceil(e.startIndex/this.parent.virtualItemCount)),s?this.parent.scrollPreStartIndex=e.startIndex:(this.parent.previousStartIndex=e.startIndex,this.parent.startIndex=e.startIndex,this.parent.previousEndIndex=e.endIndex),e},t.prototype.virtualScrollHandler=function(e){var a=this,t="chrome"===P.Browser.info.name?200:100,o=0,r=P.debounce(e,t),h=P.debounce(e,50);return function(e){var t=e.target.scrollTop,e=e.target.scrollLeft,i=o<t&&!a.parent.isUpwardScrolling?"down":"up",s=(o=t,a.sentinelInfo[i]),l=a.parent.scrollPreStartIndex,n={top:t,left:e},n=(a.parent.list&&0<a.parent.list.querySelectorAll(".e-virtual-list").length&&(a.getInfoFromView(i,s,n,!0),a.parent.scrollPreStartIndex===l||a.parent.isPreventScrollAction||(a.parent.isScrollActionTriggered=!0,a.parent.list.querySelector(".e-virtual-ddl-content").style.transform="translate(0px,"+t+"px)")),r);(n="X"===s.axis?h:n)({direction:i,sentinel:s,offset:{top:t,left:e},focusElement:document.activeElement})}},t.prototype.destroy=function(){this.removeEventListener()},t);function t(e){var s=this;this.sentinelInfo={up:{check:function(e,t){e=e.top-s.containerElementRect.top;return t.entered=0<=e,0<=e+s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=s.containerElementRect.bottom,i-s.parent.listItemHeight*s.parent.virtualItemCount/2<=s.parent.listItemHeight*s.parent.virtualItemCount/2},axis:"Y"}},this.parent=e,this.removeEventListener(),this.addEventListener()}Y=function(e,t){return(Y=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 Y,$,Z=function(e,t){function i(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},i=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},ee=($=P.ChildProperty,Z(te,$),i([P.Property()],te.prototype,"text",void 0),i([P.Property()],te.prototype,"value",void 0),i([P.Property()],te.prototype,"iconCss",void 0),i([P.Property()],te.prototype,"groupBy",void 0),i([P.Property()],te.prototype,"htmlAttributes",void 0),i([P.Property()],te.prototype,"disabled",void 0),te);function te(){return null!==$&&$.apply(this,arguments)||this}var ie,y={root:"e-dropdownbase",rtl:"e-rtl",content:"e-content",selected:"e-active",hover:"e-hover",noData:"e-nodata",fixedHead:"e-fixed-head",focus:"e-item-focus",li:"e-list-item",group:"e-list-group-item",disabled:"e-disabled",grouping:"e-dd-group",virtualList:"e-list-item e-virtual-list"},Z=(ie=P.Component,Z(s,ie),s.prototype.getPropObject=function(e,t,i){var s=new Object,l=new Object,t=(s[e]=t[e],l[e]=i[e],new Object);return t.newProperty=s,t.oldProperty=l,t},s.prototype.getValueByText=function(e,t,i){var s=null;return s=P.isNullOrUndefined(this.listData)?s:t?this.checkValueCase(e,!0,i):this.checkValueCase(e,!1,i)},s.prototype.checkValueCase=function(i,e,t,s){var l=this,n=s?i:null;if(!P.isNullOrUndefined(this.listData)){var a,o=this.listData,r=this.fields,h=this.typeOfData(o).typeof;if("string"===h||"number"===h||"boolean"===h)for(var u=0,p=o;u<p.length;u++){var d=p[u];P.isNullOrUndefined(d)||(t?n=this.checkingAccent(String(d),i,e):e?this.checkIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,e)):this.checkNonIgnoreCase(String(d),i)&&(n=this.getItemValue(String(d),i,e,s)))}else e?o.filter(function(e){var t=P.getValue(r.value,e);!P.isNullOrUndefined(t)&&l.checkIgnoreCase(P.getValue(r.text,e).toString(),i)&&(n=P.getValue(r.value,e))}):s?(a=null,a=n,o.filter(function(e){var t=P.getValue(r.value,e);P.isNullOrUndefined(t)||P.isNullOrUndefined(n)||t.toString()!==a.toString()||(n=P.getValue(r.text,e))})):o.filter(function(e){l.checkNonIgnoreCase(P.getValue(r.text,e),i)&&(n=P.getValue(r.value,e))})}return n},s.prototype.checkingAccent=function(e,t,i){var s=c.DataUtil.ignoreDiacritics(String(e)),l=c.DataUtil.ignoreDiacritics(t.toString()),n=null;return i?this.checkIgnoreCase(s,l)&&(n=this.getItemValue(String(e),t,i)):this.checkNonIgnoreCase(String(e),t)&&(n=this.getItemValue(String(e),t,i)),n},s.prototype.checkIgnoreCase=function(e,t){return String(e).toLowerCase()===t.toString().toLowerCase()},s.prototype.checkNonIgnoreCase=function(e,t){return String(e)===t.toString()},s.prototype.getItemValue=function(e,t,i,s){var l=this.listData,l=this.typeOfData(l).typeof;return s?e.toString():i?"string"===l?String(e):this.getFormattedValue(String(e)):"string"===l?t:this.getFormattedValue(t)},s.prototype.templateCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!P.selectAll(e,document).length}catch(e){t=!1}return t},s.prototype.l10nUpdate=function(e){var t="listbox"===this.getModuleName()?this.ulElement:this.list;if(!P.isNullOrUndefined(this.noRecordsTemplate)&&"No records found"!==this.noRecordsTemplate||"Request failed"!==this.actionFailureTemplate){var i=e?this.actionFailureTemplate:this.noRecordsTemplate,s=void 0,l=e?this.actionFailureTemplateId:this.noRecordsTemplateId,n=(t.innerHTML="",this.templateCompiler(i)),s="function"!=typeof i&&n?P.compile(P.select(i,document).innerHTML.trim()):P.compile(i),a=e?"actionFailureTemplate":"noRecordsTemplate",o=void 0;if((o=this.isReact&&"function"==typeof i?s({},this,a,l,this.isStringTemplate,null):s({},this,a,l,this.isStringTemplate,null,t))&&0<o.length)for(var r=0;r<o.length;r++)"listbox"===this.getModuleName()&&"noRecordsTemplate"==a?"#text"===o[r].nodeName?((h=this.createElement("li")).textContent=o[r].textContent,h.classList.add("e-list-nrt"),h.setAttribute("role","option"),t.appendChild(h)):(o[r].classList.add("e-list-nr-template"),t.appendChild(o[r])):(o[r]instanceof HTMLElement||o[r]instanceof Text&&""!==o[r].textContent)&&t.appendChild(o[r]);this.renderReactTemplates()}else{var h,n=new P.L10n(this.getLocaleName(),{},this.locale),i=(""!==n.getConstant("actionFailureTemplate")||""!==n.getConstant("noRecordsTemplate")?this.l10n=n:this.l10n=new P.L10n("listbox"===this.getModuleName()?"listbox":"mention"===this.getModuleName()?"mention":"dropdowns",{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed"},this.locale),e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate"));"listbox"===this.getModuleName()?((h=this.createElement("li")).textContent=i,t.appendChild(h),h.classList.add("e-list-nrt"),h.setAttribute("role","option")):P.isNullOrUndefined(t)||(t.innerHTML=i)}},s.prototype.checkAndResetCache=function(){this.isVirtualizationEnabled&&(this.generatedDataObject={},this.virtualItemStartIndex=this.virtualItemEndIndex=0,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.selectedValueInfo=null)},s.prototype.updateIncrementalInfo=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.isIncrementalRequest=!0,this.resetList(this.dataSource,this.fields,this.query),this.isIncrementalRequest=!1},s.prototype.updateIncrementalView=function(e,t){this.viewPortInfo.startIndex=e,this.viewPortInfo.endIndex=t,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")},s.prototype.updateVirtualItemIndex=function(){this.virtualItemStartIndex=this.viewPortInfo.startIndex,this.virtualItemEndIndex=this.viewPortInfo.endIndex,this.virtualListInfo=this.viewPortInfo},s.prototype.getFilteringSkeletonCount=function(){var e=this.skeletonCount,t=(this.getSkeletonCount(!0),this.skeletonCount=this.dataCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,!0);"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||!(this.totalItemCount<2*this.itemCount)||this.dataSource instanceof c.DataManager&&!(this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)||(this.skeletonCount=0,t=!1),this.list.classList.contains(y.noData)||(e!==this.skeletonCount&&t?this.UpdateSkeleton(!0,Math.abs(e-this.skeletonCount)):this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),0<this.list.getElementsByClassName("e-virtual-ddl").length?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&this.list.querySelector(".e-dropdownbase")&&(t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl",styles:this.GetVirtualTrackHeight()}),this.list.querySelector(".e-dropdownbase").appendChild(t)),0<this.list.getElementsByClassName("e-virtual-ddl-content").length&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},s.prototype.getSkeletonCount=function(e){this.virtualListHeight=null!=this.listContainerHeight?parseInt(this.listContainerHeight,10):this.virtualListHeight;var t=0<this.virtualListHeight&&0<this.listItemHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0;this.skeletonCount=4*t<this.itemCount?this.itemCount:4*t,this.itemCount=e?this.itemCount:this.skeletonCount,this.virtualItemCount=this.itemCount,this.skeletonCount=Math.floor(this.skeletonCount/2)},s.prototype.GetVirtualTrackHeight=function(){var e=this.totalItemCount===this.viewPortInfo.endIndex?this.totalItemCount*this.listItemHeight-this.itemCount*this.listItemHeight:this.totalItemCount*this.listItemHeight,e="height: "+((this.isVirtualTrackHeight?0:e)-this.itemCount*this.listItemHeight)+"px;";return"autocomplete"!==this.getModuleName()&&"multiselect"!==this.getModuleName()||0!==this.skeletonCount?e:"height: 0px;"},s.prototype.getTransformValues=function(){var e=this.viewPortInfo.startIndex*this.listItemHeight;return e-=this.skeletonCount*this.listItemHeight,"transform: translate(0px, "+(e=0===this.viewPortInfo.startIndex&&this.listData&&0===this.listData.length||0===this.skeletonCount?0:e)+"px);"},s.prototype.UpdateSkeleton=function(e,t){var i=this.list.querySelector(".e-virtual-ddl-content"),s=this.list.querySelector(".e-virtual-list");if(i&&(!s||e)&&this.isVirtualizationEnabled)for(var l=e?t:this.skeletonCount,n=0;n<l;n++){var a=this.createElement("li",{className:y.virtualList,styles:"overflow: inherit"}),o=(this.isVirtualizationEnabled&&this.itemTemplate&&(a.style.height=this.listItemHeight-parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)+"px"),new V.Skeleton({shape:"Text",height:"10px",width:"95%",cssClass:"e-skeleton-text"}));o.appendTo(this.createElement("div")),a.appendChild(o.element),i.firstChild&&i.firstChild.insertBefore(a,i.firstChild.children[0])}},s.prototype.getLocaleName=function(){return"drop-down-base"},s.prototype.getTextByValue=function(e){return this.checkValueCase(e,!1,!1,!0)},s.prototype.getFormattedValue=function(e){if(this.listData&&this.listData.length){var t=void 0,t=this.properties.allowCustomValue&&this.properties.value&&this.properties.value instanceof Array&&0<this.properties.value.length?this.typeOfData(this.properties.value):this.typeOfData(this.listData);if("number"==typeof P.getValue(this.fields.value||"value",t.item)||"number"===t.typeof)return parseFloat(e);if("boolean"==typeof P.getValue(this.fields.value||"value",t.item)||"boolean"===t.typeof)return"true"===e||""+e=="true"}return e},s.prototype.setEnableRtl=function(){P.isNullOrUndefined(this.enableRtlElements)||(this.list&&this.enableRtlElements.push(this.list),this.enableRtl?P.addClass(this.enableRtlElements,y.rtl):P.removeClass(this.enableRtlElements,y.rtl))},s.prototype.initialize=function(e){var t;this.bindEvent=!0,this.preventPopupOpen=!0,this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate","UL"===this.element.tagName?(t=U.ListBase.createJsonFromElement(this.element),this.setProperties({fields:{text:"text",value:"text"}},!0),this.resetList(t,this.fields)):"SELECT"===this.element.tagName?(this.dataSource instanceof Array?0<this.dataSource.length:!P.isNullOrUndefined(this.dataSource))?this.isDynamicDataChange&&this.setListData(this.dataSource,this.fields,this.query):this.renderItemsBySelect():this.setListData(this.dataSource,this.fields,this.query,e)},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.updateDataAttribute=function(e){for(var t=["class","style","id","type","aria-expanded","aria-autocomplete","aria-readonly"],i={},s=0;s<this.element.attributes.length;s++)-1!==t.indexOf(this.element.attributes[s].name)||"dropdownlist"===this.getModuleName()&&"readonly"===this.element.attributes[s].name||(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));P.extend(i,e,i),this.setProperties({htmlAttributes:i},!0)},s.prototype.renderItemsBySelect=function(){var e=this.element,t=e.querySelectorAll("select>optgroup"),i="multiselect"===this.getModuleName()&&this.isGroupChecking&&0<t.length,s=i?{value:"value",text:"text",groupBy:"categeory"}:{value:"value",text:"text"},l=[],n=e.querySelectorAll("select>option");if(this.getJSONfromOption(l,n,s),t.length){for(var a=0;a<t.length;a++){var o=t[a],r={},h=(r[s.text]=o.label,r.isHeader=!0,o.querySelectorAll("option"));i?this.getJSONfromOption(l,h,s,o.label):(l.push(r),this.getJSONfromOption(l,h,s))}e.querySelectorAll("select>option")}this.updateFields(s.text,s.value,(i?s:this.fields).groupBy,this.fields.htmlAttributes,this.fields.iconCss,this.fields.disabled),this.resetList(l,s)},s.prototype.updateFields=function(e,t,i,s,l,n){e={fields:{text:e,value:t,groupBy:P.isNullOrUndefined(i)?this.fields&&this.fields.groupBy:i,htmlAttributes:P.isNullOrUndefined(s)?this.fields&&this.fields.htmlAttributes:s,iconCss:P.isNullOrUndefined(l)?this.fields&&this.fields.iconCss:l,disabled:P.isNullOrUndefined(n)?this.fields&&this.fields.disabled:n}};this.setProperties(e,!0)},s.prototype.getJSONfromOption=function(e,t,i,s){void 0===s&&(s=null);for(var l=0,n=t;l<n.length;l++){var a=n[l],o={};o[i.text]=a.innerText,o[i.value]=P.isNullOrUndefined(a.getAttribute(i.value))?a.innerText:a.getAttribute(i.value),P.isNullOrUndefined(s)||(o[i.groupBy]=s),e.push(o)}},s.prototype.preRender=function(){this.scrollTimer=-1,this.enableRtlElements=[],this.isRequested=!1,this.isDataFetched=!1,this.itemTemplateId=this.element.id+"ItemTemplate",this.displayTemplateId=this.element.id+"DisplayTemplate",this.spinnerTemplateId=this.element.id+"SpinnerTemplate",this.valueTemplateId=this.element.id+"ValueTemplate",this.groupTemplateId=this.element.id+"GroupTemplate",this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate"},s.prototype.setListData=function(r,h,e,u){var p,d=this,e=(h=h||this.fields,{cancel:!(this.isActive=!0),data:r,query:e});this.isPreventChange=!(!this.isAngular||!this.preventChange)||this.isPreventChange,this.isRequesting||this.trigger("actionBegin",e,function(l){if(!l.cancel)if(d.isRequesting=!0,d.showSpinner(),r instanceof c.DataManager){var n=!(d.isRequested=!0);d.isDataFetched?d.emptyDataRequest(h):l.data.executeQuery(d.getQuery(l.query)).then(function(e){d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange;var t=!0;if(!d.virtualSelectAll){for(var i=d.getQuery(l.query),s=0;s<i.queries.length;s++)"onWhere"===i.queries[s].fn&&(n=!0);if(d.isVirtualizationEnabled&&0!==e.count&&e.count<2*d.itemCount){if(i)for(s=0;s<i.queries.length;s++)"onTake"===i.queries[s].fn&&(i.queries[s].e.nos=e.count),"multiselect"!==d.getModuleName()||"or"!==i.queries[s].e.condition&&"equal"!==i.queries[s].e.operator||d.isCustomFiltering||(t=!1)}else if(d.isVirtualTrackHeight=!1,i)for(s=0;s<i.queries.length;s++)"multiselect"===d.getModuleName()&&(i.queries[s].e&&"or"===i.queries[s].e.condition||i.queries[s].e&&"equal"===i.queries[s].e.operator)&&(t=!1)}t&&(d.dataCount=d.totalItemCount=e.count),d.trigger("actionComplete",e,function(e){var t;e.cancel||(d.isRequesting=!1,d.isCustomFiltering=!1,t=e.result,d.isIncrementalRequest?p=d.renderItems(t,h):((!d.isVirtualizationEnabled&&0===t.length||d.isVirtualizationEnabled&&0===t.length&&!n)&&(d.isDataFetched=!0),n||(d.remoteDataCount=e.count),d.dataCount=d.virtualSelectAll?d.dataCount:e.count,d.totalItemCount=d.virtualSelectAll?d.totalItemCount:e.count,p=d.renderItems(t,h),d.appendUncheckList=!1,d.onActionComplete(p,t,e),d.groupTemplate&&d.renderGroupTemplate(p),d.isRequested=!1,d.bindChildItems(t,p,h,e),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):(d.isVirtualizationEnabled&&d.setCurrentView&&d.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),null!=d.keyboardEvent&&d.handleVirtualKeyboardActions(d.keyboardEvent,d.pageCount),d.isVirtualizationEnabled&&(d.getFilteringSkeletonCount(),d.updatePopupPosition()),d.virtualSelectAll&&d.virtualSelectAllData&&(d.virtualSelectionAll(d.virtualSelectAllState,d.liCollections,d.CurrentEvent),d.virtualSelectAllState=!1,d.CurrentEvent=null,d.virtualSelectAll=!1))))})}).catch(function(e){d.isRequested=!1,d.isRequesting=!1,d.onActionFailure(e),d.hideSpinner()})}else{var e=!(d.isRequesting=!1),t=void 0,i=(d.isVirtualizationEnabled&&!d.virtualGroupDataSource&&d.fields.groupBy&&(o=new c.DataManager(d.dataSource).executeLocal((new c.Query).group(d.fields.groupBy)),d.virtualGroupDataSource=o.records),d.isVirtualizationEnabled&&d.virtualGroupDataSource&&!d.isCustomDataUpdated?new c.DataManager(d.virtualGroupDataSource):new c.DataManager(l.data)),t=d.getQuery(l.query).executeLocal(i);if(!d.virtualSelectAll){var s=d.getQuery(l.query);if(d.isVirtualizationEnabled&&0!==t.count&&t.count<2*d.itemCount){if(s){for(var a=0;a<s.queries.length;a++)"onTake"===s.queries[a].fn&&(s.queries[a].e.nos=t.count,t=s.executeLocal(i)),"multiselect"!==d.getModuleName()||"or"!==s.queries[a].e.condition&&"equal"!==s.queries[a].e.operator||d.isCustomFiltering||(e=!1);e&&(t=s.executeLocal(i),d.isVirtualTrackHeight=!(d.dataSource instanceof c.DataManager||d.isCustomDataUpdated))}}else if(d.isVirtualTrackHeight=!1,s)for(a=0;a<s.queries.length;a++)"multiselect"===d.getModuleName()&&(s.queries[a].e&&"or"===s.queries[a].e.condition||s.queries[a].e&&"equal"===s.queries[a].e.operator)&&(e=!1)}!e||d.dataSource instanceof c.DataManager||d.isCustomDataUpdated||d.virtualSelectAll||(d.dataCount=d.totalItemCount=d.virtualSelectAll?t.length:t.count);var o={cancel:!1,result:t=d.isVirtualizationEnabled?t.result:t};d.isPreventChange=!(!d.isAngular||!d.preventChange)||d.isPreventChange,d.trigger("actionComplete",o,function(e){d.isCustomFiltering=!1,d.isIncrementalRequest?p=d.renderItems(e.result,h):e.cancel||(p=d.renderItems(e.result,h),d.onActionComplete(p,e.result,u),d.groupTemplate&&d.renderGroupTemplate(p),d.bindChildItems(e.result,p,h),d.getInitialData?(d.getInitialData=!1,d.preventPopupOpen=!1):setTimeout(function(){"multiselect"===d.getModuleName()&&null!=d.itemTemplate&&0<p.childElementCount&&(0<p.children[0].childElementCount||d.fields.groupBy&&p.children[1]&&0<p.children[1].childElementCount)&&d.updateDataList()}))})}})},s.prototype.handleVirtualKeyboardActions=function(e,t){},s.prototype.updatePopupState=function(){},s.prototype.updatePopupPosition=function(){},s.prototype.virtualSelectionAll=function(e,t,i){},s.prototype.updateRemoteData=function(){this.setListData(this.dataSource,this.fields,this.query)},s.prototype.bindChildItems=function(t,i,s,l){var n=this;100<=t.length&&"autocomplete"===this.getModuleName()?setTimeout(function(){var e=n.remainingItems(n.sortedData,s);P.append(e,i),n.liCollections=n.list.querySelectorAll("."+y.li),n.updateListValues(),n.raiseDataBound(t,l)},0):this.raiseDataBound(t,l)},s.prototype.isObjectInArray=function(i,e){return e.some(function(t){return Object.keys(i).every(function(e){return Object.prototype.hasOwnProperty.call(t,e)&&t[e]===i[e]})})},s.prototype.updateListValues=function(){},s.prototype.findListElement=function(e,t,i,s){var l=null;if(e)for(var n=[].slice.call(e.querySelectorAll(t)),a=0;a<n.length;a++)if(n[a].getAttribute(i)===s+""){l=n[a];break}return l},s.prototype.raiseDataBound=function(e,t){this.hideSpinner(),this.trigger("dataBound",{items:e,e:t})},s.prototype.remainingItems=function(e,t){var i,e=new c.DataManager(e).executeLocal((new c.Query).skip(100));return this.itemTemplate?(i=this.templateListItem(e,t),[].slice.call(i.childNodes)):"string"===(i=this.typeOfData(e).typeof)||"number"===i||"boolean"===i?U.ListBase.createListItemFromArray(this.createElement,e,!0,this.listOption(e,t),this):U.ListBase.createListItemFromJson(this.createElement,e,this.listOption(e,t),1,!0,this)},s.prototype.emptyDataRequest=function(e){var t=[];this.onActionComplete(this.renderItems(t,e),t),this.isRequested=!1,this.isRequesting=!1,this.hideSpinner()},s.prototype.showSpinner=function(){},s.prototype.hideSpinner=function(){},s.prototype.onActionFailure=function(e){this.liCollections=[],this.trigger("actionFailure",e),this.l10nUpdate(!0),P.isNullOrUndefined(this.list)||P.addClass([this.list],y.noData)},s.prototype.onActionComplete=function(e,t,i){if(this.listData=t,!this.isVirtualizationEnabled||this.isCustomDataUpdated||this.virtualSelectAll||this.notify("setGeneratedData",{module:"VirtualScroll"}),"listbox"!==this.getModuleName()&&e.setAttribute("tabindex","0"),this.isReact&&this.clearTemplate(["itemTemplate","groupTemplate","actionFailureTemplate","noRecordsTemplate"]),this.isVirtualizationEnabled||(this.fixedHeaderElement=P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement:null),"multiselect"===this.getModuleName()&&this.properties.allowCustomValue&&this.fields.groupBy)for(var s=0;s<e.childElementCount;s++)e.children[s].classList.contains("e-list-group-item")&&(P.isNullOrUndefined(e.children[s].innerHTML)||""===e.children[s].innerHTML)&&P.addClass([e.children[s]],"e-hide-group-header"),e.children[0].classList.contains("e-hide-group-header")&&P.setStyleAttribute(e.children[1],{zIndex:11});P.isNullOrUndefined(this.list)||this.isVirtualizationEnabled||(this.list.innerHTML="",this.list.appendChild(e),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.postRender(this.list,t,this.bindEvent))},s.prototype.postRender=function(e,t,i){if(this.fields.disabled)for(var s,l=e.querySelectorAll("."+y.li),n=0;n<l.length;n++)JSON.parse(JSON.stringify(this.listData[n]))[this.fields.disabled]&&(P.isNullOrUndefined(this.fields.groupBy)?this.disableListItem(l[n]):(s=this.listData[n],s=P.getValue(this.fields.value||"value",s),s=e.querySelector('li[data-value="'+s+'"]'),P.isNullOrUndefined(s)||this.disableListItem(s)));var a=this.fields.disabled?e.querySelector("."+y.li+":not(.e-disabled"):e.querySelector("."+y.li),o=e.querySelector("."+y.selected);a&&!o&&(a=this.isVirtualizationEnabled&&0!==this.viewPortInfo.startIndex&&(o=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<o.length?o[2]:a)&&a.classList.add(y.focus),t.length<=0?(this.l10nUpdate(),P.addClass([e],y.noData)):e.classList.remove(y.noData)},s.prototype.getQuery=function(e){return e||this.query||new c.Query},s.prototype.updateVirtualizationProperties=function(e,t,i){this.isVirtualizationEnabled=!0,this.virtualizedItemsCount=e,this.isAllowFiltering=t,this.isCheckBoxSelection=i},s.prototype.renderGroupTemplate=function(e){if(null!==this.fields.groupBy&&this.dataSource||this.element.querySelector("."+y.group)){var t,i=this.dataSource,s={groupTemplateID:this.groupTemplateId,isStringTemplate:this.isStringTemplate},e=e.querySelectorAll("."+y.group),l=this.templateCompiler(this.groupTemplate);if(t="function"!=typeof this.groupTemplate&&l?(l=P.select(this.groupTemplate,document).innerHTML.trim(),U.ListBase.renderGroupTemplate(l,i,this.fields.properties,e,s,this)):U.ListBase.renderGroupTemplate(this.groupTemplate,i,this.fields.properties,e,s,this),this.isGroupChecking)for(var n=0;n<t.length;n++)this.notify("addItem",{module:"CheckBoxSelection",item:t[n]});this.renderReactTemplates()}},s.prototype.createListItems=function(e,t){var i;return e?(t.groupBy||this.element.querySelector("optgroup")?(t.groupBy&&("None"!==this.sortOrder&&(e=this.getSortedDataSource(e)),e=this.element.querySelector("optgroup")&&this.isGroupChecking&&"multiselect"===this.getModuleName()?U.ListBase.groupDataSource(e,t,this.sortOrder):U.ListBase.groupDataSource(e,t.properties,this.sortOrder)),P.addClass([this.list],y.grouping)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(e=this.getSortedDataSource(e)),t=this.listOption(e,t),i=100<e.length?new c.DataManager(e).executeLocal((new c.Query).take(100)):e,this.sortedData=e,U.ListBase.createList(this.createElement,"autocomplete"===this.getModuleName()?i:e,t,!0,this)):null},s.prototype.listOption=function(e,t){var i=!P.isNullOrUndefined(t.iconCss),s=P.isNullOrUndefined(t.properties)?t:t.properties,s=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}};return P.extend({},s,t,!0)},s.prototype.setFloatingHeader=function(e){P.isNullOrUndefined(this.list)||this.list.classList.contains(y.noData)||(P.isNullOrUndefined(this.fixedHeaderElement)&&(this.fixedHeaderElement=this.createElement("div",{className:y.fixedHead}),P.isNullOrUndefined(this.list)||this.list.querySelector("li").classList.contains(y.group)||(this.fixedHeaderElement.style.display="none"),P.isNullOrUndefined(this.fixedHeaderElement)||P.isNullOrUndefined(this.list)||P.prepend([this.fixedHeaderElement],this.list),this.setFixedHeader()),P.isNullOrUndefined(this.fixedHeaderElement)||"0"!==this.fixedHeaderElement.style.zIndex||this.setFixedHeader(),this.scrollStop(e))},s.prototype.scrollStop=function(e,t){for(var i=P.isNullOrUndefined(e)?this.list:e.target,e=getComputedStyle(this.getValidLi(),null).getPropertyValue("height"),s=getComputedStyle(this.getValidLi(),null).getPropertyValue("margin-bottom"),s=parseInt(s,10),e="multiselect"===this.getModuleName()?parseFloat(e):parseInt(e,10),e=Math.round(i.scrollTop/(e+s)),l=this.list.querySelectorAll("li:not(.e-hide-listitem)"),n=this.list.querySelectorAll(".e-virtual-list").length,a=e;-1<a;a--){var o=this.isVirtualizationEnabled?a+n:a;if(this.isVirtualizationEnabled){if(this.fixedHeaderElement&&this.updateGroupHeader(o,l,i))break;!t||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.selected)&&"autocomplete"!==this.getModuleName()||!P.isNullOrUndefined(l[o])&&l[o].classList.contains(y.focus)&&this.getModuleName()}else if(this.updateGroupHeader(o,l,i))break}},s.prototype.getPageCount=function(e){var t;return this.list?(t=this.list.classList.contains(y.noData)?null:getComputedStyle(this.getItems()[0],null).getPropertyValue("height"),t=Math.round(this.list.getBoundingClientRect().height/parseInt(t,10)),e?t:Math.round(t)):0},s.prototype.updateGroupHeader=function(e,t,i){return!P.isNullOrUndefined(t[e])&&t[e].classList.contains(y.group)?(this.updateGroupFixedHeader(t[e],i),!0):(this.fixedHeaderElement.style.display="none",!(this.fixedHeaderElement.style.top="none"))},s.prototype.updateGroupFixedHeader=function(e,t){this.fixedHeaderElement&&(P.isNullOrUndefined(e.innerHTML)||(this.fixedHeaderElement.innerHTML=e.innerHTML),this.fixedHeaderElement.style.position="fixed",this.fixedHeaderElement.style.top=this.list.parentElement.offsetTop+this.list.offsetTop-window.scrollY+"px",this.fixedHeaderElement.style.display="block")},s.prototype.getValidLi=function(){return this.isVirtualizationEnabled&&this.liCollections[0].classList.contains("e-virtual-list")?this.liCollections[this.skeletonCount]:this.liCollections[0]},s.prototype.renderItems=function(e,t,i){if(this.itemTemplate&&e){var s,l,n=e="multiselect"===this.getModuleName()&&this.virtualSelectAll?(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex):e,a=(n&&t.groupBy?("None"!==this.sortOrder&&(n=this.getSortedDataSource(n)),n=U.ListBase.groupDataSource(n,t.properties,this.sortOrder)):"listbox"===this.getModuleName()&&("listbox"!==this.getModuleName()||this.preventDefActionFilter)||(n=this.getSortedDataSource(n)),100<(this.sortedData=n).length?new c.DataManager(n).executeLocal((new c.Query).take(100)):n),a=this.templateListItem("autocomplete"===this.getModuleName()?a:n,t);if(this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+y.li),this.incrementalUlElement=a,this.incrementalListData=e,a;this.isVirtualizationEnabled&&(s=this.list.querySelector(".e-list-parent"),l=this.list.querySelector(".e-virtual-ddl-content"),e.length>=this.virtualizedItemsCount&&s&&l||s&&l&&this.isAllowFiltering||s&&l&&"autocomplete"===this.getModuleName()?("multiselect"===this.getModuleName()&&this.isCheckBoxSelection&&this.appendUncheckList&&this.list&&this.list.querySelector(".e-active")?(l.appendChild(a),i=!0):l.replaceChild(a,s),n=this.list.querySelectorAll(".e-reorder"),this.list.querySelector(".e-virtual-ddl-content")&&n&&0<n.length&&!i&&this.list.querySelector(".e-virtual-ddl-content").removeChild(n[0]),this.updateListElements(e)):l||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e)))}else{if("multiselect"===this.getModuleName()&&this.virtualSelectAll&&(e=(this.virtualSelectAllData=e).slice(this.virtualItemStartIndex,this.virtualItemEndIndex)),a=this.createListItems(e,t),this.isIncrementalRequest)return this.incrementalLiCollections=a.querySelectorAll("."+y.li),this.incrementalUlElement=a,this.incrementalListData=e,a;this.isVirtualizationEnabled&&(s=this.list.querySelector(".e-list-parent:not(.e-reorder)"),l=this.list.querySelector(".e-virtual-ddl-content"),!s&&this.list.querySelector(".e-list-parent.e-reorder")&&(s=this.list.querySelector(".e-list-parent.e-reorder")),e.length>=this.virtualizedItemsCount&&s&&l||s&&l&&this.isAllowFiltering||s&&l&&("autocomplete"===this.getModuleName()||"multiselect"===this.getModuleName())?(this.appendUncheckList?l.appendChild(a):l.replaceChild(a,s),this.updateListElements(e)):l&&l.firstChild||(this.list.innerHTML="",this.createVirtualContent(),this.list.querySelector(".e-virtual-ddl-content").appendChild(a),this.updateListElements(e)))}return a},s.prototype.createVirtualContent=function(){this.list.querySelector(".e-virtual-ddl-content")||this.list.appendChild(this.createElement("div",{className:"e-virtual-ddl-content"}))},s.prototype.updateListElements=function(e){this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.listData=e,this.postRender(this.list,e,this.bindEvent)},s.prototype.templateListItem=function(e,t){var i=this.listOption(e,t),s=(i.templateID=this.itemTemplateId,i.isStringTemplate=this.isStringTemplate,this.templateCompiler(this.itemTemplate));return s="function"!=typeof this.itemTemplate&&s?(s=P.select(this.itemTemplate,document).innerHTML.trim(),U.ListBase.renderContentTemplate(this.createElement,s,e,t.properties,i,this)):U.ListBase.renderContentTemplate(this.createElement,this.itemTemplate,e,t.properties,i,this),this.isVirtualizationEnabled&&this.isReact&&this.renderReactTemplates(),s},s.prototype.typeOfData=function(e){for(var t={typeof:null,item:null},i=0;!P.isNullOrUndefined(e)&&i<e.length;i++)if(!P.isNullOrUndefined(e[i])&&!("string"==typeof e[i]||"number"==typeof e[i]||"boolean"==typeof e[i]?P.isNullOrUndefined(e[i]):P.isNullOrUndefined(P.getValue(this.fields.value||"value",e[i]))))return{typeof:typeof e[i],item:e[i]};return t},s.prototype.setFixedHeader=function(){P.isNullOrUndefined(this.list)||(this.list.parentElement.style.display="block");var e=0,e=(this.list&&this.list.parentElement&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-width"),10),isNaN(e))&&(e=parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-top-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-left-width"),10)+parseInt(document.defaultView.getComputedStyle(this.list.parentElement,null).getPropertyValue("border-right-width"),10)),P.isNullOrUndefined(this.liCollections)||(e=this.getValidLi().offsetWidth-e,this.fixedHeaderElement.style.width=e.toString()+"px"),P.setStyleAttribute(this.fixedHeaderElement,{zIndex:10}),this.ulElement.querySelector("."+y.group+":not(.e-hide-listitem)"));this.fixedHeaderElement.innerHTML=e.innerHTML},s.prototype.getSortedDataSource=function(e){var t;return e&&"None"!==this.sortOrder&&(t=this.fields.text||"text","string"!==this.typeOfData(e).typeof&&"number"!==this.typeOfData(e).typeof&&"boolean"!==this.typeOfData(e).typeof||(t=""),e=U.ListBase.getDataSource(e,U.ListBase.addSorting(this.sortOrder,t))),e},s.prototype.getIndexByValue=function(e){for(var t,i=[],i=this.fields.disabled&&"multiselect"===this.getModuleName()&&this.liCollections?this.liCollections:this.getItems(),s=0;s<i.length;s++)if(!P.isNullOrUndefined(e)&&i[s].getAttribute("data-value")===e.toString()){t=s;break}return t},s.prototype.getIndexByValueFilter=function(e,t){var i;if(!t)return null;var s=t.querySelectorAll("li:not(.e-list-group-item)");if(s)for(var l=0;l<s.length;l++)if(!P.isNullOrUndefined(e)&&s[l].getAttribute("data-value")===e.toString()){i=l;break}return i},s.prototype.dispatchEvent=function(e,t){var i=document.createEvent("HTMLEvents");i.initEvent(t,!1,!0),e&&e.dispatchEvent(i)},s.prototype.setFields=function(){this.fields.value&&!this.fields.text?this.updateFields(this.fields.value,this.fields.value):!this.fields.value&&this.fields.text?this.updateFields(this.fields.text,this.fields.text):this.fields.value||this.fields.text||(this.isPrimitiveData=!0,this.updateFields("text","text"))},s.prototype.resetList=function(e,t,i,s){this.list&&(("SELECT"===this.element.tagName&&0<this.element.options.length||"UL"===this.element.tagName&&0<this.element.childNodes.length)&&!(e instanceof Array?0<e.length:!P.isNullOrUndefined(e))&&this.selectData&&0<this.selectData.length&&(e=this.selectData),e="combobox"===this.getModuleName()&&this.selectData&&e instanceof Array&&e.length<this.selectData.length&&this.addedNewItem?this.selectData:e,this.addedNewItem=!1,this.setListData(e,t,i,s))},s.prototype.updateSelectElementData=function(e){(e||this.isVirtualizationEnabled)&&P.isNullOrUndefined(this.selectData)&&this.listData&&0<this.listData.length&&(this.selectData=this.listData)},s.prototype.updateSelection=function(){},s.prototype.renderList=function(){this.render()},s.prototype.updateDataSource=function(e,t){this.resetList(this.dataSource),this.totalItemCount=this.dataSource instanceof c.DataManager?this.dataSource.dataSource.json.length:0},s.prototype.setUpdateInitial=function(e,t,i){this.isDataFetched=!1,this.isPrimitiveData=!1;for(var s={},l=0;e.length>l;l++)t[e[l]]&&"fields"===e[l]?(this.setFields(),s[e[l]]=t[e[l]]):t[e[l]]&&(s[e[l]]=t[e[l]]);0<Object.keys(s).length&&(-1===Object.keys(s).indexOf("dataSource")&&(s.dataSource=this.dataSource),"listbox"===this.getModuleName()?this.isReact&&(!this.isReact||P.isNullOrUndefined(t.dataSource)&&P.isNullOrUndefined(t.sortOrder))||this.updateDataSource(s,i):(this.isDynamicData=!0,this.updateDataSource(s,i)))},s.prototype.onPropertyChanged=function(e,t){"dropdownbase"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e),this.setUpdateInitial(["sortOrder","itemTemplate"],e);for(var i,s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"query":case"sortOrder":case"dataSource":case"itemTemplate":break;case"enableRtl":this.setEnableRtl();break;case"groupTemplate":this.renderGroupTemplate(this.list),this.ulElement&&this.fixedHeaderElement&&(i=this.ulElement.querySelector("."+y.group),this.fixedHeaderElement.innerHTML=i.innerHTML);break;case"locale":this.list&&!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length&&this.l10nUpdate();break;case"zIndex":this.setProperties({zIndex:e.zIndex},!0),this.setZIndex()}},s.prototype.render=function(e,t){"listbox"===this.getModuleName()?this.list=this.createElement("div",{className:y.content,attrs:{tabindex:"0"}}):this.list=this.createElement("div",{className:y.content}),this.list.classList.add(y.root),this.setFields();this.rippleFun=P.rippleEffect(this.list,{duration:300,selector:"."+y.li});var i=this.element.querySelector("select>optgroup");!this.fields.groupBy&&P.isNullOrUndefined(i)||this.isGroupChecking||(P.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this),P.EventHandler.add(document,"scroll",this.updateGroupFixedHeader,this)),"dropdownbase"===this.getModuleName()&&(this.element.getAttribute("tabindex")&&this.list.setAttribute("tabindex",this.element.getAttribute("tabindex")),P.removeClass([this.element],y.root),this.element.style.display="none",i=this.createElement("div"),this.element.parentElement.insertBefore(i,this.element),i.appendChild(this.element),i.appendChild(this.list)),this.setEnableRtl(),t||this.initialize(e)},s.prototype.removeScrollEvent=function(){this.list&&P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader)},s.prototype.getModuleName=function(){return"dropdownbase"},s.prototype.getItems=function(){return this.ulElement.querySelectorAll("."+y.li)},s.prototype.addItem=function(e,t){this.list&&(this.list.textContent!==this.noRecordsTemplate||"listbox"===this.getModuleName())||this.renderList(),"None"!==this.sortOrder&&P.isNullOrUndefined(t)&&((s=[].slice.call(this.listData)).push(e),s=this.getSortedDataSource(s),t=(this.fields.groupBy?s=U.ListBase.groupDataSource(s,this.fields.properties,this.sortOrder):s).indexOf(e));for(var i,s=this.getItems().length,l=0===s,n=this.list.querySelector("."+y.selected),a=(e=e instanceof Array?e:[e],i=P.isNullOrUndefined(t)||t<0||s-1<t?s:t,this.fields),o=(e&&a.groupBy&&(e=U.ListBase.groupDataSource(e,a.properties)),[]),r=0;r<e.length;r++){var h,u=e[r],p=u.isHeader,d=this.createElement("li",{className:p?y.group:y.li,id:"option-add-"+r}),c=u instanceof Object?P.getValue(a.text,u):u;p&&(d.innerText=c),this.itemTemplate&&!p?(h=this.templateCompiler(this.itemTemplate),(h=("function"!=typeof this.itemTemplate&&h?P.compile(P.select(this.itemTemplate,document).innerHTML.trim()):P.compile(this.itemTemplate))(u,this,"itemTemplate",this.itemTemplateId,this.isStringTemplate,null,d))&&P.append(h,d)):p||d.appendChild(document.createTextNode(c)),d.setAttribute("data-value",u instanceof Object?P.getValue(a.value,u):u),d.setAttribute("role","option"),this.notify("addItem",{module:"CheckBoxSelection",item:d}),o.push(d),"listbox"===this.getModuleName()?(this.listData.splice(l?this.listData.length:i,0,u),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData)):this.listData.push(u),"None"===this.sortOrder&&P.isNullOrUndefined(t)&&0===i&&(i=null),"listbox"===this.getModuleName()?this.updateActionCompleteData(d,u,l?null:i+r):this.updateActionCompleteData(d,u,i),this.trigger("beforeItemRender",{element:d,item:u})}if(0===s&&P.isNullOrUndefined(this.list.querySelector("ul")))P.isNullOrUndefined(this.list)||(this.list.innerHTML="",this.list.classList.remove(y.noData),this.isAddNewItemTemplate=!0,P.isNullOrUndefined(this.ulElement))||this.list.appendChild(this.ulElement),this.liCollections=o,P.isNullOrUndefined(o)||P.isNullOrUndefined(this.ulElement)||P.append(o,this.ulElement),this.updateAddItemList(this.list,s);else{"listbox"===this.getModuleName()&&0===s&&(this.ulElement.innerHTML="");for(var m=[],r=0;r<e.length;r++){for(var f=this.ulElement.querySelectorAll(".e-list-group-item"),v=0;v<f.length;v++)m[v]=f[v].innerText;if(-1<m.indexOf(o[r].innerText)&&a.groupBy){for(v=0;v<f.length;v++)if(m[v]===o[r].innerText){"None"===this.sortOrder?this.ulElement.insertBefore(o[r+1],f[v+1]):this.ulElement.insertBefore(o[r+1],this.ulElement.childNodes[t]),r+=1;break}}else this.liCollections[i]&&this.liCollections[i].parentNode?this.liCollections[i].parentNode.insertBefore(o[r],this.liCollections[i]):t&&"listbox"===this.getModuleName()?this.ulElement.insertBefore(o[r],this.ulElement.childNodes[t+r]):this.ulElement.appendChild(o[r]);var g=[].slice.call(this.liCollections);g.splice(i,0,o[r]),this.liCollections=g,i+=1,"multiselect"===this.getModuleName()&&this.updateDataList()}}"listbox"===this.getModuleName()&&this.isReact&&this.renderReactTemplates(),!n&&0!==t||this.updateSelection(),this.addedNewItem=!0},s.prototype.isDisabledElement=function(e){return!(!e||!e.classList.contains("e-disabled"))},s.prototype.isDisabledItemByIndex=function(e){return!(!this.fields.disabled||!this.liCollections)&&this.isDisabledElement(this.liCollections[e])},s.prototype.disableListItem=function(e){e.classList.add("e-disabled"),e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")},s.prototype.validationAttribute=function(e,t){for(var i,s=e.getAttribute("name")?e.getAttribute("name"):e.getAttribute("id"),l=(t.setAttribute("name",s),e.removeAttribute("name"),["required","aria-required","form"]),n=0;n<l.length;n++)e.getAttribute(l[n])&&(i=e.getAttribute(l[n]),t.setAttribute(l[n],i),e.removeAttribute(l[n]))},s.prototype.setZIndex=function(){},s.prototype.updateActionCompleteData=function(e,t,i){},s.prototype.updateAddItemList=function(e,t){},s.prototype.updateDataList=function(){},s.prototype.getDataByValue=function(e){if(!P.isNullOrUndefined(this.listData)){var t=this.typeOfData(this.listData).typeof;if("string"===t||"number"===t||"boolean"===t)for(var i=0,s=this.listData;i<s.length;i++){var l=s[i];if(!P.isNullOrUndefined(l)&&l===e)return l}else for(var n=0,a=this.listData;n<a.length;n++){l=a[n];if(!P.isNullOrUndefined(l)&&P.getValue(this.fields.value||"value",l)===e)return l}}return null},s.prototype.destroy=function(){document&&(P.EventHandler.remove(document,"scroll",this.updateGroupFixedHeader),document.body.contains(this.list))&&(P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),P.isNullOrUndefined(this.rippleFun)||this.rippleFun(),P.detach(this.list)),this.liCollections=null,this.ulElement=null,this.list=null,this.enableRtlElements=null,this.rippleFun=null,ie.prototype.destroy.call(this)},i([P.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},ee)],s.prototype,"fields",void 0),i([P.Property(null)],s.prototype,"itemTemplate",void 0),i([P.Property(null)],s.prototype,"groupTemplate",void 0),i([P.Property("No records found")],s.prototype,"noRecordsTemplate",void 0),i([P.Property("Request failed")],s.prototype,"actionFailureTemplate",void 0),i([P.Property("None")],s.prototype,"sortOrder",void 0),i([P.Property([])],s.prototype,"dataSource",void 0),i([P.Property(null)],s.prototype,"query",void 0),i([P.Property("StartsWith")],s.prototype,"filterType",void 0),i([P.Property(!0)],s.prototype,"ignoreCase",void 0),i([P.Property(1e3)],s.prototype,"zIndex",void 0),i([P.Property(!1)],s.prototype,"ignoreAccent",void 0),i([P.Property()],s.prototype,"locale",void 0),i([P.Event()],s.prototype,"actionBegin",void 0),i([P.Event()],s.prototype,"actionComplete",void 0),i([P.Event()],s.prototype,"actionFailure",void 0),i([P.Event()],s.prototype,"select",void 0),i([P.Event()],s.prototype,"dataBound",void 0),i([P.Event()],s.prototype,"created",void 0),i([P.Event()],s.prototype,"destroyed",void 0),i([P.NotifyPropertyChanges],s));function s(e,t){e=ie.call(this,e,t)||this;return e.preventChange=!1,e.isPreventChange=!1,e.isDynamicDataChange=!1,e.addedNewItem=!1,e.isAddNewItemTemplate=!1,e.isRequesting=!1,e.isVirtualizationEnabled=!1,e.isCustomDataUpdated=!1,e.isAllowFiltering=!1,e.virtualizedItemsCount=0,e.isCheckBoxSelection=!1,e.totalItemCount=0,e.dataCount=0,e.remoteDataCount=-1,e.isRemoteDataUpdated=!1,e.isIncrementalRequest=!1,e.itemCount=30,e.virtualListHeight=0,e.isVirtualScrolling=!1,e.isPreventScrollAction=!1,e.scrollPreStartIndex=0,e.isScrollActionTriggered=!1,e.previousStartIndex=0,e.isMouseScrollAction=!1,e.isKeyBoardAction=!1,e.isScrollChanged=!1,e.isUpwardScrolling=!1,e.startIndex=0,e.currentPageNumber=0,e.pageCount=0,e.isPreventKeyAction=!1,e.generatedDataObject={},e.skeletonCount=32,e.isVirtualTrackHeight=!1,e.virtualSelectAll=!1,e.incrementalQueryString="",e.incrementalEndIndex=0,e.incrementalStartIndex=0,e.incrementalPreQueryString="",e.isObjectCustomValue=!1,e.appendUncheckList=!1,e.getInitialData=!1,e.preventPopupOpen=!0,e.virtualSelectAllState=!1,e.CurrentEvent=null,e.isDynamicData=!1,e.isPrimitiveData=!1,e.isCustomFiltering=!1,e.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e.selectedValueInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:0},e}se=function(e,t){return(se=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 se,m,i=function(e,t){function i(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},f={root:"e-dropdownlist",hover:y.hover,selected:y.selected,rtl:y.rtl,li:y.li,disable:y.disabled,base:y.root,focus:y.focus,content:y.content,input:"e-input-group",inputFocus:"e-input-focus",icon:"e-input-group-icon e-ddl-icon",iconAnimation:"e-icon-anim",value:"e-input-value",device:"e-ddl-device",backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",resizeIcon:"e-resizer-right e-icons",filterParent:"e-filter-parent",mobileFilter:"e-ddl-device-filter",footer:"e-ddl-footer",header:"e-ddl-header",clearIcon:"e-clear-icon",clearIconHide:"e-clear-icon-hide",popupFullScreen:"e-popup-full-page",disableIcon:"e-ddl-disable-icon",hiddenElement:"e-ddl-hidden",virtualList:"e-list-item e-virtual-list"},le={container:null,buttons:[]},i=(i(n,m=Z),n.prototype.preRender=function(){this.valueTempElement=null,this.element.style.opacity="0",this.initializeData(),m.prototype.preRender.call(this),this.activeIndex=this.index,this.queryString=""},n.prototype.initializeData=function(){this.isPopupOpen=!1,this.isDocumentClick=!1,this.isInteracted=!1,this.isFilterFocus=!1,this.beforePopupOpen=!1,this.initial=!0,this.initialRemoteRender=!1,this.isNotSearchList=!1,this.isTyped=!1,this.isSelected=!1,this.preventFocus=!1,this.preventAutoFill=!1,this.isValidKey=!1,this.typedString="",this.isEscapeKey=!1,this.isPreventBlur=!1,this.isTabKey=!1,this.actionCompleteData={isUpdated:!1},this.actionData={isUpdated:!1},this.prevSelectPoints={},this.isSelectCustom=!1,this.isDropDownClick=!1,this.preventAltUp=!1,this.isCustomFilter=!1,this.isSecondClick=!1,this.previousValue=null,this.keyConfigure={tab:"tab",enter:"13",escape:"27",end:"35",home:"36",down:"40",up:"38",pageUp:"33",pageDown:"34",open:"alt+40",close:"shift+tab",hide:"alt+38",space:"32"},this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},n.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},n.prototype.requiredModules=function(){var e=[];return this.enableVirtualization&&e.push({args:[this],member:"VirtualScroll"}),e},n.prototype.renderList=function(e,t){m.prototype.render.call(this,e,t),this.dataSource instanceof c.DataManager||(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0),this.enableVirtualization&&this.isFiltering()&&"combobox"===this.getModuleName()&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),this.unWireListEvents(),this.wireListEvents()},n.prototype.floatLabelChange=function(){var e;"dropdownlist"===this.getModuleName()&&"Auto"===this.floatLabelType&&(e=this.inputWrapper.container.querySelector(".e-float-text"),""!==this.inputElement.value||this.isInteracted?P.classList(e,["e-label-top"],["e-label-bottom"]):P.classList(e,["e-label-bottom"],["e-label-top"]))},n.prototype.resetHandler=function(e){e.preventDefault(),this.clearAll(e),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=0)},n.prototype.resetFocusElement=function(){var e;this.removeHover(),this.removeSelection(),this.removeFocus(),this.list.scrollTop=0,"autocomplete"!==this.getModuleName()&&!P.isNullOrUndefined(this.ulElement)&&(e=this.fields.disabled?this.ulElement.querySelector("."+f.li+":not(.e-disabled)"):this.ulElement.querySelector("."+f.li),e=this.enableVirtualization?this.liCollections[this.skeletonCount]:e)&&e.classList.add(f.focus)},n.prototype.clearAll=function(e,t){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,!P.isNullOrUndefined(t)&&(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t.dataSource)&&(t.dataSource instanceof c.DataManager||0!==t.dataSource.length))||(this.isActive=!0,this.resetSelection(t));t=this.getItemData();!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom?this.value||t:t.value?this.getDataByValue(t.value):t])?(this.checkAndResetCache(),this.enableVirtualization&&this.list&&this.updateInitialData()):(this.onChangeEvent(e),this.checkAndResetCache(),this.enableVirtualization&&this.updateInitialData())},n.prototype.resetSelection=function(e){this.list&&(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof c.DataManager||0!==e.dataSource.length)?(this.allowFiltering&&"autocomplete"!==this.getModuleName()&&!P.isNullOrUndefined(this.actionCompleteData.ulElement)&&!P.isNullOrUndefined(this.actionCompleteData.list)&&0<this.actionCompleteData.list.length&&this.onActionComplete(this.actionCompleteData.ulElement.cloneNode(!0),this.actionCompleteData.list),this.resetFocusElement()):(this.selectedLI=null,this.actionCompleteData.isUpdated=!1,this.actionCompleteData.ulElement=null,this.actionCompleteData.list=null,this.resetList(e.dataSource))),P.isNullOrUndefined(this.hiddenElement)||(this.hiddenElement.innerHTML=""),P.isNullOrUndefined(this.inputElement)||(this.inputElement.value=""),this.value=null,this.itemData=null,this.text=null,this.index=null,this.activeIndex=null,this.item=null,this.queryString="",this.valueTempElement&&(P.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.setSelection(null,null),this.isSelectCustom=!1,this.updateIconState(),this.cloneElements()},n.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i,s=t[e];"class"===s?""!==(i=this.htmlAttributes[""+s].replace(/\s+/g," ").trim())&&P.addClass([this.inputWrapper.container],i.split(" ")):"disabled"===s&&"disabled"===this.htmlAttributes[""+s]?(this.enabled=!1,this.setEnable()):"readonly"!==s||P.isNullOrUndefined(this.htmlAttributes[""+s])?"style"===s?this.inputWrapper.container.setAttribute("style",this.htmlAttributes[""+s]):"aria-label"===s?"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&this.inputWrapper.container.setAttribute("aria-label",this.htmlAttributes[""+s]):this.inputElement.setAttribute("aria-label",this.htmlAttributes[""+s]):(i=["title","id","placeholder","role","autocomplete","autocapitalize","spellcheck","minlength","maxlength"],"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||i.push("tabindex"),-1<["name","required"].indexOf(s)||0===s.indexOf("data")?this.hiddenElement.setAttribute(s,this.htmlAttributes[""+s]):-1<i.indexOf(s)?"placeholder"===s?h.Input.setPlaceholder(this.htmlAttributes[""+s],this.inputElement):this.inputElement.setAttribute(s,this.htmlAttributes[""+s]):this.inputWrapper.container.setAttribute(s,this.htmlAttributes[""+s])):(this.readonly=!0,this.dataBind())}"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.inputWrapper.container.removeAttribute("tabindex")},n.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false","aria-live":"polite","aria-labelledby":this.hiddenElement.id}},n.prototype.setEnableRtl=function(){P.isNullOrUndefined(this.inputElement)||P.isNullOrUndefined(this.inputElement.parentElement)||h.Input.setEnableRtl(this.enableRtl,[this.inputElement.parentElement]),this.popupObj&&(this.popupObj.enableRtl=this.enableRtl,this.popupObj.dataBind())},n.prototype.setEnable=function(){h.Input.setEnabled(this.enabled,this.inputElement),this.enabled?(P.removeClass([this.inputWrapper.container],f.disable),this.inputElement.setAttribute("aria-disabled","false"),this.targetElement().setAttribute("tabindex",this.tabIndex),this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","false"),this.inputWrapper.container.removeAttribute("disabled"))):(this.hidePopup(),P.addClass([this.inputWrapper.container],f.disable),this.inputElement.setAttribute("aria-disabled","true"),this.targetElement().tabIndex=-1,this.inputWrapper&&this.inputWrapper.container&&(this.inputWrapper.container.setAttribute("aria-disabled","true"),this.inputWrapper.container.setAttribute("disabled","")))},n.prototype.getPersistData=function(){return this.addOnPersist(["value"])},n.prototype.getLocaleName=function(){return"drop-down-list"},n.prototype.preventTabIndex=function(e){"dropdownlist"===this.getModuleName()&&(e.tabIndex=-1)},n.prototype.targetElement=function(){return P.isNullOrUndefined(this.inputWrapper)?null:this.inputWrapper.container},n.prototype.getNgDirective=function(){return"EJS-DROPDOWNLIST"},n.prototype.getElementByText=function(e){return this.getElementByValue(this.getValueByText(e))},n.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},n.prototype.initValue=function(){this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.renderList(),this.dataSource instanceof c.DataManager?this.initialRemoteRender=!0:this.updateValues()},n.prototype.isDisableItemValue=function(e){var t;return"object"==typeof e?(t=JSON.parse(JSON.stringify(e))[this.fields.value],this.isDisabledItemByIndex(this.getIndexByValue(t))):this.isDisabledItemByIndex(this.getIndexByValue(e))},n.prototype.updateValues=function(){if(this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),this.selectedValueInfo=this.viewPortInfo,P.isNullOrUndefined(this.value))if(this.text&&P.isNullOrUndefined(this.value)){var e=this.getElementByText(this.text);if(P.isNullOrUndefined(e))return void this.setProperties({text:null});this.setSelection(e,null)}else this.setSelection(this.liCollections[this.activeIndex],null);else{e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value;this.setSelection(this.getElementByValue(e),null)}this.setHiddenValue(),h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},n.prototype.onBlurHandler=function(e){var t,i,s;this.enabled&&(t=e.relatedTarget,i=e.target,s=this.isPreventBlur,this.isPreventBlur=!1,s&&!this.isDocumentClick&&this.isPopupOpen&&(!P.isNullOrUndefined(i)||!this.isFilterLayout()&&P.isNullOrUndefined(t))?("dropdownlist"===this.getModuleName()&&this.allowFiltering&&this.isPopupOpen?this.filterInput:this.targetElement()).focus():this.isDocumentClick||!P.isNullOrUndefined(this.popupObj)&&document.body.contains(this.popupObj.element)&&this.popupObj.element.classList.contains(f.mobileFilter)?this.beforePopupOpen||(this.isDocumentClick=!1):(("dropdownlist"===this.getModuleName()&&!this.isFilterFocus&&t!==this.inputElement&&(document.activeElement!==t||document.activeElement===t&&i.classList.contains(f.inputFocus))||P.isNullOrUndefined(t)&&"dropdownlist"===this.getModuleName()&&this.allowFiltering&&i!==this.inputWrapper.container||"dropdownlist"!==this.getModuleName()&&!this.inputWrapper.container.contains(t)||this.isTabKey)&&(this.isDocumentClick=!!this.isPopupOpen,this.focusOutAction(e),this.isTabKey=!1),!this.isRequested||this.isPopupOpen||this.isPreventBlur||(this.isActive=!1,this.beforePopupOpen=!1),this.isFocused=!1))},n.prototype.focusOutAction=function(e){this.isInteracted=!1,this.focusOut(e),this.onFocusOut(e)},n.prototype.onFocusOut=function(e){this.enabled&&(this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.floatLabelChange(),this.dispatchEvent(this.hiddenElement,"change"),"dropdownlist"===this.getModuleName()&&"INPUT"!==this.element.tagName&&this.dispatchEvent(this.inputElement,"blur"),this.inputWrapper.clearButton&&P.addClass([this.inputWrapper.clearButton],f.clearIconHide),this.trigger("blur"))},n.prototype.onFocus=function(e){this.isInteracted||(this.isInteracted=!0,this.trigger("focus",{isInteracted:!!e,event:e})),this.updateIconState(),this.isFocused=!0},n.prototype.resizingWireEvent=function(){P.EventHandler.add(document,"mousemove",this.resizePopup,this),P.EventHandler.add(document,"mouseup",this.stopResizing,this),P.EventHandler.add(document,"touchmove",this.resizePopup,this),P.EventHandler.add(document,"touchend",this.stopResizing,this)},n.prototype.resizingUnWireEvent=function(){P.EventHandler.remove(document,"mousemove",this.resizePopup),P.EventHandler.remove(document,"mouseup",this.stopResizing),P.EventHandler.remove(document,"touchmove",this.resizePopup),P.EventHandler.remove(document,"touchend",this.stopResizing)},n.prototype.resetValueHandler=function(e){var t=P.closest(this.inputElement,"form");t&&e.target===t&&(e=this.element.tagName===this.getNgDirective()?null:this.inputElement.getAttribute("value"),this.text=e)},n.prototype.wireEvent=function(){P.EventHandler.add(this.inputWrapper.container,"mousedown",this.dropDownClick,this),P.EventHandler.add(this.inputWrapper.container,"focus",this.focusIn,this),P.EventHandler.add(this.inputWrapper.container,"keypress",this.onSearch,this),P.EventHandler.add(window,"resize",this.windowResize,this),this.bindCommonEvent()},n.prototype.bindCommonEvent=function(){P.EventHandler.add(this.targetElement(),"blur",this.onBlurHandler,this);var e=P.closest(this.inputElement,"form");e&&P.EventHandler.add(e,"reset",this.resetValueHandler,this),P.Browser.isDevice?this.keyboardModule=new P.KeyboardEvents(this.targetElement(),{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.keyboardModule=new P.KeyboardEvents(this.targetElement(),{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),this.bindClearEvent()},n.prototype.windowResize=function(){this.isPopupOpen&&this.popupObj.refreshPosition(this.inputWrapper.container)},n.prototype.bindClearEvent=function(){this.showClearButton&&P.EventHandler.add(this.inputWrapper.clearButton,"mousedown",this.resetHandler,this)},n.prototype.unBindCommonEvent=function(){!P.isNullOrUndefined(this.inputWrapper)&&this.targetElement()&&P.EventHandler.remove(this.targetElement(),"blur",this.onBlurHandler);var e=this.inputElement&&P.closest(this.inputElement,"form");e&&P.EventHandler.remove(e,"reset",this.resetValueHandler),P.Browser.isDevice||this.keyboardModule.destroy(),this.showClearButton&&P.EventHandler.remove(this.inputWrapper.clearButton,"mousedown",this.resetHandler)},n.prototype.updateIconState=function(){this.showClearButton&&(""===this.inputElement.value||this.readonly?P.addClass([this.inputWrapper.clearButton],f.clearIconHide):P.removeClass([this.inputWrapper.clearButton],f.clearIconHide))},n.prototype.wireListEvents=function(){P.isNullOrUndefined(this.list)||(P.EventHandler.add(this.list,"click",this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},n.prototype.onSearch=function(e){32!==e.charCode&&13!==e.charCode&&(void 0===this.list&&this.renderList(),this.searchKeyEvent=e,this.onServerIncrementalSearch(e))},n.prototype.onServerIncrementalSearch=function(e){this.isRequested||P.isNullOrUndefined(this.list)||P.isNullOrUndefined(this.list.querySelector("li"))||!this.enabled||this.readonly||this.incrementalSearch(e)},n.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},n.prototype.resizePopup=function(e){var t,i,s,l;this.isResizing&&(this.trigger("resizing",e),t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY,t=t-this.originalMouseX,i=i-this.originalMouseY,this.list&&this.list.parentElement&&(s=(s=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,l=(l=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+t,s),this.resizeHeight=Math.max(this.originalHeight+i,l),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),e)&&e.preventDefault()},n.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},n.prototype.onMouseClick=function(e){var t=e.target,t=(this.keyboardEvent=null,P.closest(t,"."+y.li));this.isValidLI(t)&&!this.isDisabledElement(t)&&(this.setSelection(t,e),P.Browser.isDevice&&this.isFilterLayout()?history.back():this.closePopup(100,e))},n.prototype.onMouseOver=function(e){e=P.closest(e.target,"."+y.li);this.setHover(e)},n.prototype.setHover=function(e){this.enabled&&this.isValidLI(e)&&!e.classList.contains(y.hover)&&(this.removeHover(),P.addClass([e],y.hover))},n.prototype.onMouseLeave=function(){this.removeHover()},n.prototype.removeHover=function(){var e;this.list&&(e=this.list.querySelectorAll("."+y.hover))&&e.length&&P.removeClass(e,y.hover)},n.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},n.prototype.updateIncrementalItemIndex=function(e,t){this.incrementalStartIndex=e,this.incrementalEndIndex=t},n.prototype.incrementalSearch=function(e){if(0<this.liCollections.length)if(this.enableVirtualization){for(var t=!1,i=!1,s=this.ulElement.getElementsByClassName("e-active")[0],l=s?s.textContent:null,n=(""===this.incrementalQueryString?(this.incrementalQueryString=String.fromCharCode(e.charCode),this.incrementalPreQueryString=this.incrementalQueryString):String.fromCharCode(e.charCode).toLocaleLowerCase()===this.incrementalPreQueryString.toLocaleLowerCase()?i=!0:this.incrementalQueryString=String.fromCharCode(e.charCode),(this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(t=!0,this.incrementalStartIndex=this.incrementalEndIndex,0===this.incrementalEndIndex?this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100:this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0),0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),j(e.charCode,this.incrementalLiCollections,this.activeIndex,!0,this.element.id,i,l,!0));P.isNullOrUndefined(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.updateIncrementalItemIndex(this.incrementalEndIndex,this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),n=j(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0),P.isNullOrUndefined(n));)if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100);break}P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount&&(this.updateIncrementalItemIndex(0,this.totalItemCount<100?this.totalItemCount:100),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),t=!0,0===this.viewPortInfo.startIndex&&!t||this.updateIncrementalView(0,this.itemCount),n=j(e.charCode,this.incrementalLiCollections,0,!0,this.element.id,i,l,!0,!0));var a,o=n&&this.getIndexByValue(n.getAttribute("data-value"));if(o)o-=this.skeletonCount;else for(var r=0;r<this.incrementalLiCollections.length;r++)if(!P.isNullOrUndefined(n)&&!P.isNullOrUndefined(n.getAttribute("data-value"))&&this.incrementalLiCollections[r].getAttribute("data-value")===n.getAttribute("data-value").toString()){o=r,o=this.incrementalStartIndex+o;break}!o||this.viewPortInfo.startIndex>=o&&o>=this.viewPortInfo.endIndex||(h=0<o-(this.itemCount/2-2)?o-(this.itemCount/2-2):0,a=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,a)),P.isNullOrUndefined(n)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(n.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(h=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,a=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(h,a)),n=this.getElementByValue(n.getAttribute("data-value")),this.setSelection(n,e),this.setScrollPosition(),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(s=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.list.scrollTop=s-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight),this.incrementalPreQueryString=this.incrementalQueryString)}else{var h,n=void 0;n=this.fields.disabled?(h=this.list.querySelectorAll("."+y.li+":not(.e-disabled)"),j(e.charCode,h,this.activeIndex,!0,this.element.id)):j(e.charCode,this.liCollections,this.activeIndex,!0,this.element.id),P.isNullOrUndefined(n)||(this.setSelection(n,e),this.setScrollPosition())}},n.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],f.disableIcon),this.spinnerElement.innerHTML="",this.spinnerElement=null)},n.prototype.showSpinner=function(){P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=P.Browser.isDevice&&!P.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[1]||!P.isNullOrUndefined(this.filterInputObj)&&this.filterInputObj.buttons[0]||this.inputWrapper.buttons[0],P.addClass([this.spinnerElement],f.disableIcon),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement))},n.prototype.keyActionHandler=function(e){if(this.enabled){this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault();var t="pageUp"===e.action||"pageDown"===e.action,i="dropdownlist"!==this.getModuleName()&&("home"===e.action||"end"===e.action),s=(this.isEscapeKey="escape"===e.action,this.isTabKey=!this.isPopupOpen&&"tab"===e.action,"down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action);if((!(this.isEditTextBox()||t||i)||this.isPopupOpen)&&!this.readonly){t="tab"===e.action||"close"===e.action;if(!P.isNullOrUndefined(this.list)||this.isRequested||t||"escape"===e.action||(this.searchKeyEvent=e,this.enableVirtualization&&(!this.enableVirtualization||"autocomplete"===this.getModuleName()||"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode))||(this.renderList(e),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),!(P.isNullOrUndefined(this.list)||!P.isNullOrUndefined(this.liCollections)&&s&&0===this.liCollections.length||this.isRequested))switch((t&&"autocomplete"!==this.getModuleName()&&this.isPopupOpen||"escape"===e.action)&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,this.isTyped=!s&&"escape"!==e.action&&this.isTyped,e.action){case"down":case"up":this.updateUpDownAction(e);break;case"pageUp":this.pageUpSelection(this.activeIndex-this.getPageCount(),e),e.preventDefault();break;case"pageDown":this.pageDownSelection(this.activeIndex+this.getPageCount(),e),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e);break;case"space":"dropdownlist"!==this.getModuleName()||this.beforePopupOpen||(this.showPopup(),e.preventDefault());break;case"open":this.showPopup(e);break;case"hide":this.preventAltUp=this.isPopupOpen,this.hidePopup(e),this.focusDropDown(e);break;case"enter":this.selectCurrentItem(e);break;case"tab":this.selectCurrentValueOnTab(e);break;case"escape":case"close":this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))}}}},n.prototype.updateUpDownAction=function(e,t){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(n=this.getItemData().value,P.isNullOrUndefined(n)&&(n="null"),a=this.getIndexByValue(n),P.isNullOrUndefined(a)||(this.activeIndex=a));var i,s,l,n,a,o,r=this.list.querySelector("."+f.focus);this.isSelectFocusItem(r)&&!t?(this.setSelection(r,e),this.enableVirtualization&&(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,this.fields.groupBy&&(l=this.virtualListInfo&&0===this.virtualListInfo.startIndex?this.selectedLI.offsetHeight-l:l-this.selectedLI.offsetHeight),this.list.scrollTop=l-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight)):P.isNullOrUndefined(this.liCollections)||(r=this.activeIndex,h="down"===e.action?this.activeIndex+1:this.activeIndex-1,h=t?r:h,r=0,i=void("autocomplete"===this.getModuleName()&&(r="down"===e.action&&P.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,h=h<0?this.liCollections.length-1:h===this.liCollections.length?0:h)),("autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&this.isPopupOpen)&&(i=this.enableVirtualization?t?"autocomplete"===this.getModuleName()?(n=this.getFormattedValue(this.selectedLI.getAttribute("data-value")),this.getElementByValue(n)):this.getElementByValue(this.getItemData().value):(i=P.isNullOrUndefined(this.activeIndex)?this.liCollections[this.skeletonCount]:this.liCollections[h],P.isNullOrUndefined(i)||i.classList.contains("e-virtual-list")?null:i):P.isNullOrUndefined(this.activeIndex)?this.liCollections[r]:this.liCollections[h]),P.isNullOrUndefined(i)?this.enableVirtualization&&!this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&(this.viewPortInfo.endIndex!==this.totalItemCount&&"down"===e.action||0!==this.viewPortInfo.startIndex&&"up"===e.action)&&("down"===e.action?(this.viewPortInfo.startIndex=this.viewPortInfo.startIndex+this.itemCount<this.totalItemCount-this.itemCount?this.viewPortInfo.startIndex+this.itemCount:this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,n="null"!==this.liCollections[0].getAttribute("data-value")?this.getFormattedValue(this.liCollections[0].getAttribute("data-value")):null,(s=this.getDataByValue(n))&&(this.itemData=s)):"up"===e.action&&(this.viewPortInfo.startIndex=0<this.viewPortInfo.startIndex-this.itemCount?this.viewPortInfo.startIndex-this.itemCount:0,this.viewPortInfo.endIndex=this.viewPortInfo.startIndex+this.itemCount,this.updateVirtualItemIndex(),this.isCustomFilter="combobox"===this.getModuleName()||this.isCustomFilter,this.resetList(this.dataSource,this.fields,this.query),this.isCustomFilter="combobox"!==this.getModuleName()&&this.isCustomFilter,n="null"!==this.liCollections[this.liCollections.length-1].getAttribute("data-value")?this.getFormattedValue(this.liCollections[this.liCollections.length-1].getAttribute("data-value")):null,s=this.getDataByValue(n))&&(this.itemData=s),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul"),this.handleVirtualKeyboardActions(e,this.pageCount)):(r=this.liCollections[this.skeletonCount]&&this.liCollections[this.skeletonCount].classList.contains("e-item-focus"),this.setSelection(i,e),r&&this.enableVirtualization&&"autocomplete"===this.getModuleName()&&!t&&(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*this.selectedLI.offsetHeight:this.selectedLI.offsetTop,l=this.virtualListInfo&&0===this.virtualListInfo.startIndex&&this.fields.groupBy?this.selectedLI.offsetHeight-l:l-this.selectedLI.offsetHeight,this.list.scrollTop=l-this.list.querySelectorAll(".e-virtual-list").length*this.selectedLI.offsetHeight))),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&(n=this.getItemData().value,a=this.getIndexByValueFilter(n,this.actionCompleteData.ulElement),P.isNullOrUndefined(a)||(this.activeIndex=a)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&this.filterInput&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}));for(var h=0;h<this.liCollections.length;h++)if(this.liCollections[h].classList.contains(f.focus)||this.liCollections[h].classList.contains(f.selected)){o=h;break}null!=o&&this.isDisabledElement(this.liCollections[o])&&("autocomplete"!==this.getModuleName()&&(this.liCollections.length-1===o&&"down"===e.action&&(e.action="up"),0===o)&&"up"===e.action&&(e.action="down"),this.updateUpDownAction(e)),e.preventDefault()}},n.prototype.updateHomeEndAction=function(e,t){var i;"dropdownlist"===this.getModuleName()&&(i=0,"home"===e.action?(i=0,this.enableVirtualization&&this.isPopupOpen?i=this.skeletonCount:this.enableVirtualization&&!this.isPopupOpen&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query))):(this.enableVirtualization&&!this.isPopupOpen&&this.viewPortInfo.endIndex!==this.totalItemCount&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)),i=this.getItems().length-1),e.preventDefault(),this.activeIndex===i?t&&this.setSelection(this.liCollections[i],e):!this.enableVirtualization&&this.liCollections[i]&&this.liCollections[i].classList.contains("e-disabled")||this.setSelection(this.liCollections[i],e))},n.prototype.selectCurrentValueOnTab=function(e){"autocomplete"===this.getModuleName()?this.selectCurrentItem(e):this.isPopupOpen&&(this.hidePopup(e),this.focusDropDown(e))},n.prototype.mobileKeyActionHandler=function(e){!this.enabled||this.isEditTextBox()&&!this.isPopupOpen||this.readonly||(void 0!==this.list||this.isRequested||(this.searchKeyEvent=e,this.renderList()),P.isNullOrUndefined(this.list))||!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length||this.isRequested||"enter"===e.action&&this.selectCurrentItem(e)},n.prototype.handleVirtualKeyboardActions=function(e,t){switch(e.action){case"down":case"up":null==this.itemData&&"autocomplete"!==this.getModuleName()||this.updateUpDownAction(e,!0);break;case"pageUp":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))+this.getPageCount()-1:this.getIndexByValue(this.previousValue),this.pageUpSelection(this.activeIndex-this.getPageCount(),e,!0),e.preventDefault();break;case"pageDown":this.activeIndex="autocomplete"===this.getModuleName()?this.getIndexByValue(this.selectedLI.getAttribute("data-value"))-this.getPageCount():this.getIndexByValue(this.previousValue),this.pageDownSelection(P.isNullOrUndefined(this.activeIndex)?2*this.getPageCount():this.activeIndex+this.getPageCount(),e,!0),e.preventDefault();break;case"home":case"end":this.isMouseScrollAction=!0,this.updateHomeEndAction(e,!0)}this.keyboardEvent=null},n.prototype.selectCurrentItem=function(e){var t;this.isPopupOpen?(t=this.list.querySelector("."+f.focus),this.isDisabledElement(t)||(t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e)),this.hidePopup(e),this.focusDropDown(e))):this.showPopup()},n.prototype.isSelectFocusItem=function(e){return!P.isNullOrUndefined(e)},n.prototype.pageUpSelection=function(e,t,i){var s=0<=e?this.liCollections[e+1]:this.liCollections[0];if(!this.enableVirtualization&&s&&s.classList.contains("e-disabled"))for(var l=0<=e?e+1:0;l<this.liCollections.length&&(!(s=this.liCollections[l])||s.classList.contains("e-disabled"));)if(--l<0)return;this.enableVirtualization&&null==this.activeIndex&&(s=this.liCollections.length>=e&&0<=e?this.liCollections[e+this.skeletonCount+1]:this.liCollections[0]),!P.isNullOrUndefined(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.PageUpDownSelection(s,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.PageUpDownSelection=function(e,t){this.enableVirtualization&&(P.isNullOrUndefined(e)||("autocomplete"===this.getModuleName()||e.classList.contains("e-active"))&&("autocomplete"!==this.getModuleName()||e.classList.contains("e-item-focus")))||this.setSelection(e,t)},n.prototype.pageDownSelection=function(e,t,i){var s=this.getItems(),l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1];if(!this.enableVirtualization&&l&&l.classList.contains("e-disabled"))for(;0<=e&&e<this.liCollections.length&&(!(l=e<=s.length?this.liCollections[e-1]:this.liCollections[s.length-1])||l.classList.contains("e-disabled"));)e++;this.enableVirtualization&&0<this.skeletonCount&&(l=(e="dropdownlist"===this.getModuleName()&&this.allowFiltering?e+1:e)<s.length?this.liCollections[e]:this.liCollections[s.length-1]),this.enableVirtualization&&null==this.activeIndex&&(l=e<=s.length?this.liCollections[e+this.skeletonCount-1]:this.liCollections[s.length-1]),this.PageUpDownSelection(l,t),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.filterInput,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.unWireEvent=function(){P.isNullOrUndefined(this.inputWrapper)||(P.EventHandler.remove(this.inputWrapper.container,"mousedown",this.dropDownClick),P.EventHandler.remove(this.inputWrapper.container,"keypress",this.onSearch),P.EventHandler.remove(this.inputWrapper.container,"focus",this.focusIn),P.EventHandler.remove(window,"resize",this.windowResize)),this.unBindCommonEvent()},n.prototype.unWireListEvents=function(){this.list&&(P.EventHandler.remove(this.list,"click",this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},n.prototype.checkSelector=function(e){return'[id="'+e.replace(/(:|\.|\[|\]|,|=|@|\\|\/|#)/g,"\\$1")+'"]'},n.prototype.onDocumentClick=function(e){var t=e.target;!P.isNullOrUndefined(this.popupObj)&&P.closest(t,this.checkSelector(this.popupObj.element.id))||P.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.container.contains(e.target)?t===this.inputElement||this.allowFiltering&&t===this.filterInput||"combobox"===this.getModuleName()&&!this.allowFiltering&&P.Browser.isDevice&&t===this.inputWrapper.buttons[0]||(this.isPreventBlur=(P.Browser.isIE||"edge"===P.Browser.info.name)&&(document.activeElement===this.targetElement()||document.activeElement===this.filterInput),e.preventDefault()):(this.inputWrapper.container.classList.contains(f.inputFocus)||this.isPopupOpen)&&(this.isDocumentClick=!0,t=this.isRequested,"combobox"===this.getModuleName()&&this.isTyped&&(this.isInteracted=!1),this.hidePopup(e),this.isInteracted=!1,t||(this.onFocusOut(e),this.inputWrapper.container.classList.remove(f.inputFocus)))},n.prototype.activeStateChange=function(){this.isDocumentClick&&(this.hidePopup(),this.onFocusOut(),this.inputWrapper.container.classList.remove(f.inputFocus))},n.prototype.focusDropDown=function(e){!this.initial&&this.isFilterLayout()&&this.focusIn(e)},n.prototype.dropDownClick=function(e){var t,i;3===e.which||2===e.button||(this.keyboardEvent=null,this.targetElement().classList.contains(f.disable))||this.inputWrapper.clearButton===e.target||((i=e.target)===this.inputElement||this.allowFiltering&&i===this.filterInput||"combobox"===this.getModuleName()||e.preventDefault(),this.readonly?this.focusIn(e):(this.isPopupOpen?(this.hidePopup(e),this.isFilterLayout()&&this.focusDropDown(e)):(this.focusIn(e),this.floatLabelChange(),this.queryString=""===this.inputElement.value.trim()?null:this.inputElement.value,this.isDropDownClick=!0,this.showPopup(e)),i=(t=this).element.tagName===this.getNgDirective()&&this.itemTemplate?500:100,this.isSecondClick||setTimeout(function(){t.cloneElements(),t.isSecondClick=!0,t.isSecondClick=!(t.isReact&&t.isFiltering()&&t.dataSource instanceof c.DataManager&&!t.list.querySelector("ul"))},i)))},n.prototype.cloneElements=function(){var e;this.list&&(e=this.list.querySelector("ul"))&&(e=e.cloneNode?e.cloneNode(!0):e,this.actionCompleteData.ulElement=e)},n.prototype.updateSelectedItem=function(t,i,s,l){var e,n=this,a=(this.removeSelection(),t.classList.add(y.selected),this.removeHover(),null!==t.getAttribute("data-value")?this.getFormattedValue(t.getAttribute("data-value")):null),o=this.getDataByValue(a);this.initial||s||P.isNullOrUndefined(i)?(this.selectEventCallback(t,i,s,o,a),l&&this.setSelectOptions(t,i)):(e=this.detachChanges(o),this.isSelected=!0,this.trigger("select",{e:i,item:t,itemData:e,isInteracted:!!i,cancel:!1},function(e){e.cancel?t.classList.remove(y.selected):(n.selectEventCallback(t,i,s,o,a),l&&n.setSelectOptions(t,i))}))},n.prototype.selectEventCallback=function(e,t,i,s,l){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,this.itemData!==s&&(this.previousValue=P.isNullOrUndefined(this.itemData)?null:"object"!=typeof this.itemData||this.allowObjectBinding?this.itemData:this.checkFieldValue(this.itemData,this.fields.value.split("."))),this.item=e,this.itemData=s;var s=this.list.querySelector("."+y.focus);s&&P.removeClass([s],y.focus),e.setAttribute("aria-selected","true"),P.isNullOrUndefined(l)&&(l="null"),this.allowFiltering&&!this.enableVirtualization&&"autocomplete"!==this.getModuleName()?(s=this.getIndexByValueFilter(l,this.actionCompleteData.ulElement),P.isNullOrUndefined(s)?this.activeIndex=this.getIndexByValue(l):this.activeIndex=s):(this.enableVirtualization&&null==this.activeIndex&&this.dataSource instanceof c.DataManager&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.ulElement=this.list.querySelector("ul")),this.activeIndex=this.getIndexByValue(l))},n.prototype.activeItem=function(e){this.isValidLI(e)&&!e.classList.contains(y.selected)&&(this.removeSelection(),e.classList.add(y.selected),this.removeHover(),e.setAttribute("aria-selected","true"))},n.prototype.setValue=function(e){var t=this.getItemData(),e=(this.isTouched=!P.isNullOrUndefined(e),null===t.value?h.Input.setValue(null,this.inputElement,this.floatLabelType,this.showClearButton):h.Input.setValue(t.text,this.inputElement,this.floatLabelType,this.showClearButton),this.valueTemplate&&null!==this.itemData?this.setValueTemplate():P.isNullOrUndefined(this.valueTempElement)||this.inputElement.previousSibling!==this.valueTempElement||(P.detach(this.valueTempElement),this.inputElement.style.display="block"),P.isNullOrUndefined(t.value)||this.enableVirtualization||!this.allowFiltering||(this.activeIndex=this.getIndexByValueFilter(t.value,this.actionCompleteData.ulElement)),f.clearIcon),e=this.isFiltering()&&this.filterInput&&"combobox"===this.getModuleName()&&this.filterInput.parentElement.querySelector("."+e);return this.isFiltering()&&e&&e.style.removeProperty("visibility"),!this.allowObjectBinding&&this.previousValue===t.value||this.allowObjectBinding&&null!=this.previousValue&&this.isObjectInArray(this.previousValue,[this.allowCustom&&this.isObjectCustomValue?this.value||t:t.value?this.getDataByValue(t.value):t])?!(this.isSelected=!1):(this.isSelected=!this.initial,this.isSelectCustom=!1,"dropdownlist"===this.getModuleName()&&this.updateIconState(),!1)},n.prototype.setSelection=function(e,t){var i,s,l;this.isValidLI(e)&&(!e.classList.contains(y.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(y.selected))?this.updateSelectedItem(e,t,!1,!0):(this.setSelectOptions(e,t),this.enableVirtualization&&this.value&&(e=this.isPrimitiveData?"":this.fields.value,t=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.dataSource instanceof c.DataManager?(i=new c.DataManager(this.virtualGroupDataSource).executeLocal((new c.Query).where(new c.Predicate(e,"equal",t))))&&0<i.length&&(this.itemData=i[0],s=this.getItemData(),l=this.allowObjectBinding?this.getDataByValue(s.value):s.value,this.value===s.value&&this.text!==s.text||this.value!==s.value&&this.text===s.text)&&this.setProperties({text:s.text&&s.text.toString(),value:l}):(i=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(new c.Predicate(e,"equal",t))))&&0<i.length&&(this.itemData=i[0],s=this.getItemData(),l=this.allowObjectBinding?this.getDataByValue(s.value):s.value,this.value===s.value&&this.text!==s.text||this.value!==s.value&&this.text===s.text)&&this.setProperties({text:s.text&&s.text.toString(),value:l})))},n.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=P.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.setValue(t)||((!this.isPopupOpen&&!P.isNullOrUndefined(e)||this.isPopupOpen&&!P.isNullOrUndefined(t)&&("keydown"!==t.type||"keydown"===t.type&&"enter"===t.action))&&(this.isSelectCustom=!1,this.onChangeEvent(t)),!this.isPopupOpen||P.isNullOrUndefined(this.selectedLI)||null===this.itemData||t&&"click"===t.type||this.setScrollPosition(t),"mozilla"!==P.Browser.info.name&&this.targetElement()&&(P.attributes(this.targetElement(),{"aria-describedby":(""!==this.inputElement.id?this.inputElement:this.element).id}),this.targetElement().removeAttribute("aria-live")),!this.isPopupOpen||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])?!this.isPopupOpen||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-active")[0])||P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}))},n.prototype.dropdownCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!document.querySelectorAll(e).length}catch(e){t=!1}return t},n.prototype.setValueTemplate=function(){this.isReact&&(this.clearTemplate(["valueTemplate"]),this.valueTempElement)&&(P.detach(this.valueTempElement),this.inputElement.style.display="block",this.valueTempElement=null),this.valueTempElement||(this.valueTempElement=this.createElement("span",{className:f.value}),this.inputElement.parentElement.insertBefore(this.valueTempElement,this.inputElement),this.inputElement.style.display="none"),this.isReact||(this.valueTempElement.innerHTML="");var e=this.dropdownCompiler(this.valueTemplate),e="function"!=typeof this.valueTemplate&&e?P.compile(document.querySelector(this.valueTemplate).innerHTML.trim()):P.compile(this.valueTemplate),e=e(this.itemData,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,this.valueTempElement);e&&0<e.length&&P.append(e,this.valueTempElement),this.renderReactTemplates()},n.prototype.removeSelection=function(){var e;this.list&&(e=this.list.querySelectorAll("."+y.selected)).length&&(P.removeClass(e,y.selected),e[0].removeAttribute("aria-selected"))},n.prototype.getItemData=function(){var e,t,i=this.fields,s=this.itemData;return P.isNullOrUndefined(s)||(e=P.getValue(i.value,s),t=P.getValue(i.text,s)),{value:P.isNullOrUndefined(s)||P.isUndefined(e)?s:e,text:P.isNullOrUndefined(s)||P.isUndefined(e)?s:t}},n.prototype.onChangeEvent=function(e,t){var i=this,s=this.getItemData(),l=this.isSelectCustom?null:this.activeIndex,n=(this.enableVirtualization&&(n=this.dataSource instanceof c.DataManager?this.virtualGroupDataSource:this.dataSource,s.value)&&n&&0<n.length&&-1!==(n=n.findIndex(function(e){return!P.isNullOrUndefined(s.value)&&P.getValue(i.fields.value,e)===s.value}))&&(l=n),this.allowObjectBinding?t?this.value:this.getDataByValue(s.value):s.value);this.setProperties({index:l,text:s.text&&s.text.toString(),value:n},!0),this.detachChangeEvent(e)},n.prototype.detachChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},n.prototype.detachChangeEvent=function(e){var t,i;this.isSelected=!1,this.previousValue=this.value,this.activeIndex=this.enableVirtualization?this.getIndexByValue(this.value):this.index,this.typedString=P.isNullOrUndefined(this.text)?"":this.text,this.initial||(i=this.detachChanges(this.itemData),t=void 0,t="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,this.setHiddenValue(),i={e:e,item:this.item,itemData:i,previousItem:this.previousSelectedLI,previousItemData:t,isInteracted:!!e,value:this.value,element:this.element,event:e},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i)),!P.isNullOrUndefined(this.value)&&""!==this.value||"Always"===this.floatLabelType||P.removeClass([this.inputWrapper.container],"e-valid-input")},n.prototype.setHiddenValue=function(){var e,t,i;P.isNullOrUndefined(this.value)?this.hiddenElement.innerHTML="":(e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.hiddenElement.querySelector("option")?((i=this.hiddenElement.querySelector("option")).textContent=this.text,i.setAttribute("value",e.toString())):P.isNullOrUndefined(this.hiddenElement)||((t=document.createElement("option")).text=this.text,t.setAttribute("selected",""),this.hiddenElement.appendChild(t),(i=this.hiddenElement.querySelector("option")).setAttribute("value",e.toString())))},n.prototype.onFilterUp=function(e){if(e.ctrlKey&&86===e.keyCode||!this.isValidKey&&40!==e.keyCode&&38!==e.keyCode)this.isValidKey=!1;else switch(this.isValidKey=!1,this.filterArgs=e,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,e.keyCode){case 38:case 40:"autocomplete"!==this.getModuleName()||this.isPopupOpen||this.preventAltUp||this.isRequested?this.preventAutoFill=!1:(this.preventAutoFill=!0,this.searchLists(e)),this.preventAltUp=!1,"autocomplete"!==this.getModuleName()||P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||P.attributes(this.targetElement(),{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id}),e.preventDefault();break;case 46:case 8:this.typedString=this.filterInput.value,!this.isPopupOpen&&""!==this.typedString||this.isPopupOpen&&0<this.queryString.length||""===this.typedString&&""===this.queryString&&"autocomplete"!==this.getModuleName()?(this.preventAutoFill=!0,this.searchLists(e)):""===this.typedString&&(this.list&&this.resetFocusElement(),this.activeIndex=null,"dropdownlist"!==this.getModuleName())&&(this.preventAutoFill=!0,this.searchLists(e),"autocomplete"===this.getModuleName())&&this.hidePopup(),e.preventDefault();break;default:this.isFiltering()&&"combobox"===this.getModuleName()&&P.isNullOrUndefined(this.list)&&(this.getInitialData=!0,this.renderList(),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()),this.typedString=this.filterInput.value,this.preventAutoFill=!1,this.getInitialData||this.searchLists(e),(this.enableVirtualization&&"autocomplete"!==this.getModuleName()||"autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()}},n.prototype.onFilterDown=function(e){switch(e.keyCode){case 13:break;case 40:case 38:this.queryString=this.filterInput.value,e.preventDefault();break;case 9:this.isPopupOpen&&"autocomplete"!==this.getModuleName()&&e.preventDefault();break;default:this.prevSelectPoints=this.getSelectionPoints(),this.queryString=this.filterInput.value}},n.prototype.removeFillSelection=function(){var e;this.isInteracted&&(e=this.getSelectionPoints(),this.inputElement.setSelectionRange(e.end,e.end))},n.prototype.getQuery=function(e){var t,i,s;if(!this.isCustomFilter&&this.allowFiltering&&this.filterInput?(t=e?e.clone():this.query?this.query.clone():new c.Query,i=""===this.typedString?"contains":this.filterType,s=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==s)&&"number"!==s?("combobox"!==this.getModuleName()||this.isFiltering()&&"combobox"===this.getModuleName()&&""!==this.typedString)&&(s=this.fields.text||"",t.where(s,i,this.typedString,this.ignoreCase,this.ignoreAccent)):t.where("",i,this.typedString,this.ignoreCase,this.ignoreAccent)):t=this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery)?this.customFilterQuery.clone():e?e.clone():this.query?this.query.clone():new c.Query,this.enableVirtualization&&0!==this.viewPortInfo.endIndex){var l=this.getTakeValue(),n=!1;if(t)for(var a=0;a<t.queries.length;a++)if("onSkip"===t.queries[a].fn){n=!0;break}var o=0,r=0;if(t&&0<t.queries.length)for(a=0;a<t.queries.length;a++)"onSkip"===t.queries[a].fn&&(r=t.queries[a].e.nos),"onTake"===t.queries[a].fn&&(o=l<=t.queries[a].e.nos?t.queries[a].e.nos:l);if(o<=0&&this.query&&0<this.query.queries.length)for(a=0;a<this.query.queries.length;a++)"onTake"===this.query.queries[a].fn&&(o=l<=this.query.queries[a].e.nos?this.query.queries[a].e.nos:l);if(t&&0<t.queries.length)for(a=0;a<t.queries.length;a++)"onSkip"===t.queries[a].fn?(r=t.queries[a].e.nos,t.queries.splice(a,1),n=!1,--a):"onTake"===t.queries[a].fn&&(o=t.queries[a].e.nos<=o?o:t.queries[a].e.nos,t.queries.splice(a,1),--a);!this.allowFiltering&&this.isPopupOpen&&n||(0<r?t.skip(r):t.skip(this.virtualItemStartIndex)),this.isIncrementalRequest?t.take(this.incrementalEndIndex):0<o?t.take(o):t.take(l),t.requiresCount()}return t},n.prototype.getSelectionPoints=function(){var e=this.inputElement;return{start:Math.abs(e.selectionStart),end:Math.abs(e.selectionEnd)}},n.prototype.searchLists=function(e){var s,l=this;this.isTyped=!0,this.activeIndex=null,this.isListSearched=!0,this.filterInput.parentElement.querySelector("."+f.clearIcon)&&(this.filterInput.parentElement.querySelector("."+f.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible"),this.isDataFetched=!1,this.isFiltering()&&(this.checkAndResetCache(),s={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(e,t,i){s.cancel||(l.isCustomFilter=!0,l.customFilterQuery=t&&t.clone(),l.filteringAction(e,t,i))},baseEventArgs:e,cancel:!1},this.trigger("filtering",s,function(e){e.cancel||l.isCustomFilter||e.preventDefaultAction||l.filteringAction(l.dataSource,null,l.fields)}))},n.prototype.filter=function(e,t,i){this.isCustomFilter=!0,this.filteringAction(e,t,i)},n.prototype.filteringAction=function(e,t,i){var s,l,n;P.isNullOrUndefined(this.filterInput)||(this.beforePopupOpen=!(!this.isPopupOpen&&"combobox"===this.getModuleName()&&""===this.filterInput.value||this.getInitialData),s=this.list.classList.contains(y.noData),""!==this.filterInput.value.trim()||this.itemTemplate?(this.isNotSearchList=!1,t=""===this.filterInput.value.trim()?null:t,this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t),"dropdownlist"===this.getModuleName()&&this.list.classList.contains(y.noData)&&(this.popupContentElement.setAttribute("role","status"),this.popupContentElement.setAttribute("id","no-record"),P.attributes(this.filterInputObj.container,{"aria-activedescendant":"no-record"})),this.enableVirtualization&&s&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((l=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(l).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(n)))):(this.actionCompleteData.isUpdated=!1,this.isTyped=!1,P.isNullOrUndefined(this.actionCompleteData.ulElement)||P.isNullOrUndefined(this.actionCompleteData.list)||(this.enableVirtualization&&(this.isFiltering()&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),s)&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((l=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(l).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl")||((n=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(n))),this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list)),this.isTyped=!0,P.isNullOrUndefined(this.itemData)||"dropdownlist"!==this.getModuleName()||(this.focusIndexItem(),this.setScrollPosition()),this.isNotSearchList=!0),this.enableVirtualization&&this.getFilteringSkeletonCount(),this.renderReactTemplates(),this.filterInput&&""===this.filterInput.value&&"combobox"===this.getModuleName()&&this.executeCloneElements())},n.prototype.setSearchBox=function(e){var t,i;return this.isFiltering()?(t=e.querySelector("."+f.filterParent)?e.querySelector("."+f.filterParent):this.createElement("span",{className:f.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:f.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),i=!1,P.Browser.isDevice&&this.isDeviceFullScreen&&(i=!0),this.filterInputObj=h.Input.createInput({element:this.filterInput,buttons:i?[f.backIcon,f.filterBarClearIcon]:[f.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),P.isNullOrUndefined(this.cssClass)||(-1!==this.cssClass.split(" ").indexOf("e-outline")?P.addClass([this.filterInputObj.container],"e-outline"):-1!==this.cssClass.split(" ").indexOf("e-filled")&&P.addClass([this.filterInputObj.container],"e-filled")),P.append([this.filterInputObj.container],t),P.prepend([t],e),P.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+f.clearIcon),!P.Browser.isDevice&&this.clearIconElement&&(P.EventHandler.add(this.clearIconElement,"click",this.clearText,this),this.clearIconElement.style.visibility="hidden"),P.Browser.isDevice?this.searchKeyModule=new P.KeyboardEvents(this.filterInput,{keyAction:this.mobileKeyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}):this.searchKeyModule=new P.KeyboardEvents(this.filterInput,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigure,eventName:"keydown"}),P.EventHandler.add(this.filterInput,"input",this.onInput,this),P.EventHandler.add(this.filterInput,"keyup",this.onFilterUp,this),P.EventHandler.add(this.filterInput,"keydown",this.onFilterDown,this),P.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),P.EventHandler.add(this.filterInput,"paste",this.pasteHandler,this),this.filterInputObj):le},n.prototype.onInput=function(e){!P.isNullOrUndefined(e)&&!P.isNullOrUndefined(e.data)&&1<e.data.length&&this.autoFill&&("combobox"===this.getModuleName()||"autocomplete"===this.getModuleName())&&(this.inputElement.value=e.data),this.isValidKey=!0,"combobox"===this.getModuleName()&&this.updateIconState(),P.Browser.isDevice&&"mozilla"===P.Browser.info.name&&(this.typedString=this.filterInput.value,this.preventAutoFill=!0,this.searchLists(e))},n.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.typedString=t.filterInput.value,"combobox"===t.getModuleName()&&t.isFiltering()&&P.isNullOrUndefined(t.list)&&t.renderList(),t.searchLists(e)})},n.prototype.onActionFailure=function(e){m.prototype.onActionFailure.call(this,e),this.beforePopupOpen&&this.renderPopup()},n.prototype.getTakeValue=function(){return this.allowFiltering&&"dropdownlist"===this.getModuleName()&&P.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},n.prototype.onActionComplete=function(e,t,i,s){var l,n,a,o,r,h,u,p=this;this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.isNotSearchList&&!this.enableVirtualization?this.isNotSearchList=!1:this.getInitialData?(this.updateActionCompleteDataValues(e,t),this.getInitialData=!1,this.isReactTemplateUpdate=!0,this.searchLists(this.filterArgs)):(l=this.itemCount,!this.isActive&&P.isNullOrUndefined(e)||(n=this.selectedLI?this.selectedLI.cloneNode(!0):null,m.prototype.onActionComplete.call(this,e,t,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering),this.isRequested&&!P.isNullOrUndefined(this.searchKeyEvent)&&"keydown"===this.searchKeyEvent.type&&(this.isRequested=!1,this.keyActionHandler(this.searchKeyEvent),this.searchKeyEvent=null),this.isRequested&&!P.isNullOrUndefined(this.searchKeyEvent)&&(this.incrementalSearch(this.searchKeyEvent),this.searchKeyEvent=null),this.enableVirtualization||(this.list.scrollTop=0),P.isNullOrUndefined(e)||P.attributes(e,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"listbox"}),this.initialRemoteRender?(this.initial=!0,this.activeIndex=this.index,this.initialRemoteRender=!1,!(this.value&&this.dataSource instanceof c.DataManager)||(a=P.isNullOrUndefined(this.fields.value)?this.fields.text:this.fields.value,o=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(a,this.value):this.value,r=this.fields.value.split("."),u=t.some(function(e){return P.isNullOrUndefined(e[a])&&1<r.length?p.checkFieldValue(e,r)===o:e[a]===o}),u=this.enableVirtualization&&this.virtualGroupDataSource?this.virtualGroupDataSource.some(function(e){return P.isNullOrUndefined(e[a])&&1<r.length?p.checkFieldValue(e,r)===o:e[a]===o}):u)?this.updateValues():this.dataSource.executeQuery(this.getQuery(this.query).where(new c.Predicate(a,"equal",o))).then(function(e){0<e.result.length&&p.addItem(e.result,t.length),p.updateValues()}),this.initial=!1):"autocomplete"===this.getModuleName()&&this.value&&this.setInputValue(),"autocomplete"!==this.getModuleName()&&this.isFiltering()&&!this.isTyped?((!this.actionCompleteData.isUpdated||!this.isCustomFilter&&!this.isFilterFocus||P.isNullOrUndefined(this.itemData)&&this.allowFiltering&&(this.dataSource instanceof c.DataManager||!P.isNullOrUndefined(this.dataSource)&&!P.isNullOrUndefined(this.dataSource.length)&&0!==this.dataSource.length))&&(this.itemTemplate&&("EJS-COMBOBOX"===this.element.tagName||this.isReact)&&this.allowFiltering?setTimeout(function(){p.updateActionCompleteDataValues(e,t)},0):this.updateActionCompleteDataValues(e,t)),this.isDynamicData&&(u=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.itemData=this.getDataByValue(u),this.selectedLI=this.getElementByValue(u),this.isDynamicData=!1),((this.allowCustom||this.allowFiltering&&!this.isValueInList(t,this.value)&&this.dataSource instanceof c.DataManager)&&!this.enableVirtualization||(this.allowCustom||this.allowFiltering&&this.isValueInList(t,this.value))&&!this.enableVirtualization&&(h=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,!P.isNullOrUndefined(this.value))&&n&&n.getAttribute("data-value")===h.toString())&&this.addNewItem(t,n),(!P.isNullOrUndefined(this.itemData)||P.isNullOrUndefined(this.itemData)&&this.enableVirtualization)&&(this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.focusIndexItem()),this.enableVirtualization&&this.updateActionCompleteDataValues(e,t)):this.enableVirtualization&&"autocomplete"!==this.getModuleName()&&!this.isFiltering()?(h=this.getItemData().value,this.activeIndex=this.getIndexByValue(h),u=this.findListElement(this.list,"li","data-value",h),this.selectedLI=u):this.enableVirtualization&&"autocomplete"===this.getModuleName()&&(this.activeIndex=this.skeletonCount),this.beforePopupOpen&&(this.renderPopup(i),this.enableVirtualization&&!this.list.querySelector(".e-virtual-list")&&(this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item")),this.enableVirtualization)&&l!==this.itemCount&&this.resetList(this.dataSource,this.fields)))},n.prototype.isValueInList=function(e,t){if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return!0}else if("object"==typeof e&&null!==e)for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&e[s]===t)return!0;return!1},n.prototype.checkFieldValue=function(e,t){var i=e;return t.forEach(function(e){i=i[e]}),i},n.prototype.updateActionCompleteDataValues=function(e,t){this.actionCompleteData={ulElement:e.cloneNode(!0),list:t,isUpdated:!0},this.actionData.list!==this.actionCompleteData.list&&this.actionCompleteData.ulElement&&this.actionCompleteData.list&&(this.actionData=this.actionCompleteData)},n.prototype.addNewItem=function(e,t){var i,s=this;P.isNullOrUndefined(this.itemData)||P.isNullOrUndefined(t)||(i=this.getItemData().value,e.some(function(e){return("string"==typeof e||"number"==typeof e||"boolean"==typeof e)&&e===i||P.getValue(s.fields.value,e)===i}))||this.addItem(this.itemData)},n.prototype.updateActionCompleteData=function(e,t,i){var s=this;"autocomplete"!==this.getModuleName()&&this.actionCompleteData.ulElement&&(this.itemTemplate&&"EJS-COMBOBOX"===this.element.tagName&&this.allowFiltering?setTimeout(function(){s.actionCompleteDataUpdate(e,t,i)},0):this.actionCompleteDataUpdate(e,t,i))},n.prototype.actionCompleteDataUpdate=function(e,t,i){null!==i?this.actionCompleteData.ulElement.insertBefore(e.cloneNode(!0),this.actionCompleteData.ulElement.childNodes[i]):this.actionCompleteData.ulElement.appendChild(e.cloneNode(!0)),this.isFiltering()&&this.actionCompleteData.list&&this.actionCompleteData.list.indexOf(t)<0&&this.actionCompleteData.list.push(t)},n.prototype.focusIndexItem=function(){var e=this.getItemData().value,e=(this.activeIndex=this.enableVirtualization&&!P.isNullOrUndefined(e)||!this.enableVirtualization?this.getIndexByValue(e):this.activeIndex,this.findListElement(this.list,"li","data-value",e));this.selectedLI=e,this.activeItem(e),this.enableVirtualization&&P.isNullOrUndefined(e)||this.removeFocus()},n.prototype.updateSelection=function(){var e=this.list.querySelector("."+y.selected);e?(this.setProperties({index:this.getIndexByValue(e.getAttribute("data-value"))}),this.activeIndex=this.index):(this.removeFocus(),this.list.querySelector("."+y.li).classList.add(f.focus))},n.prototype.updateSelectionList=function(){var e;this.list&&this.list.querySelector(".e-active")||P.isNullOrUndefined(this.value)||"autocomplete"===this.getModuleName()||(e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value):this.value,!(e=this.findListElement(this.list,"li","data-value",e)))||e.classList.add("e-active")},n.prototype.removeFocus=function(){var e=this.list.querySelectorAll("."+f.focus);e&&e.length&&P.removeClass(e,f.focus)},n.prototype.renderPopup=function(h){var u=this;this.popupObj&&document.body.contains(this.popupObj.element)?this.refreshPopup():this.trigger("beforeOpen",{cancel:!1},function(e){var t;if(e.cancel)u.beforePopupOpen=!1;else{var e=u.createElement("div",{id:u.element.id+"_popup",className:"e-ddl e-popup "+(null!==u.cssClass?u.cssClass:"")}),i=(e.setAttribute("aria-label",u.element.id),e.setAttribute("role","dialog"),u.setSearchBox(e)),s=(u.listContainerHeight=u.allowFiltering&&"dropdownlist"===u.getModuleName()&&P.Browser.isDevice?P.formatUnit(Math.round(window.outerHeight).toString()+"px"):P.formatUnit(u.popupHeight),u.headerTemplate&&(u.setHeaderTemplate(e),u.isUpdateHeaderHeight=0!==u.header.offsetHeight),P.append([u.list],e),u.footerTemplate&&(u.setFooterTemplate(e),u.isUpdateFooterHeight=0!==u.footer.offsetHeight),document.body.appendChild(e),e.style.top="0px",t=e.clientHeight,u.enableVirtualization&&u.itemTemplate&&(s=e.querySelectorAll("li.e-list-item:not(.e-virtual-list)"),u.listItemHeight=0<s.length?Math.ceil(s[0].getBoundingClientRect().height)+parseInt(window.getComputedStyle(s[0]).marginBottom,10):0),u.enableVirtualization&&!u.list.classList.contains(y.noData)&&(u.getSkeletonCount(),u.skeletonCount=u.totalItemCount<2*u.itemCount&&(!(u.dataSource instanceof c.DataManager)||u.dataSource instanceof c.DataManager&&u.totalItemCount<=u.itemCount)?0:u.skeletonCount,u.list.querySelector(".e-virtual-ddl-content")?u.list.getElementsByClassName("e-virtual-ddl-content")[0].style=u.getTransformValues():((s=u.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=u.getTransformValues(),u.list.appendChild(s).appendChild(u.list.querySelector(".e-list-parent"))),u.UpdateSkeleton(),u.liCollections=u.list.querySelectorAll("."+y.li),u.virtualItemCount=u.itemCount,u.list.querySelector(".e-virtual-ddl")?u.list.getElementsByClassName("e-virtual-ddl")[0].style=u.GetVirtualTrackHeight():((s=u.createElement("div",{id:u.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=u.GetVirtualTrackHeight(),e.querySelector(".e-dropdownbase").appendChild(s))),e.style.visibility="hidden","auto"!==u.popupHeight?(u.searchBoxHeight=0,P.isNullOrUndefined(i.container)||"combobox"===u.getModuleName()||"autocomplete"===u.getModuleName()||(u.searchBoxHeight=i.container.parentElement.getBoundingClientRect().height,u.listContainerHeight=(parseInt(u.listContainerHeight,10)-u.searchBoxHeight).toString()+"px"),u.headerTemplate&&(u.header=u.header||e.querySelector(".e-ddl-header"),l=Math.round(u.header.getBoundingClientRect().height),u.listContainerHeight=(parseInt(u.listContainerHeight,10)-(l+u.searchBoxHeight)).toString()+"px"),u.footerTemplate&&(u.footer=u.footer||e.querySelector(".e-ddl-footer"),l=Math.round(u.footer.getBoundingClientRect().height),u.listContainerHeight=(parseInt(u.listContainerHeight,10)-(l+u.searchBoxHeight)).toString()+"px"),u.list.style.maxHeight=(parseInt(u.listContainerHeight,10)-2).toString()+"px",e.style.maxHeight=P.formatUnit(u.popupHeight)):e.style.height="auto",0),l=void 0;u.isPreventScrollAction=!0,!P.isNullOrUndefined(u.selectedLI)&&!P.isNullOrUndefined(u.activeIndex)&&0<=u.activeIndex||u.enableVirtualization?u.setScrollPosition():u.list.scrollTop=0,P.Browser.isDevice&&u.isDeviceFullScreen&&!u.allowFiltering&&("dropdownlist"===u.getModuleName()||u.isDropDownClick&&"combobox"===u.getModuleName())&&(s=u.getOffsetValue(e),r=u.isEmptyList()?u.list:u.liCollections[0],P.isNullOrUndefined(u.inputElement)||(l=-(parseInt(getComputedStyle(r).textIndent,10)-parseInt(getComputedStyle(u.inputElement).paddingLeft,10)+parseInt(getComputedStyle(u.inputElement.parentElement).borderLeftWidth,10)))),u.createPopup(e,s,l),u.popupContentElement=u.popupObj.element.querySelector(".e-content"),u.getFocusElement(),u.checkCollision(e),P.Browser.isDevice&&(parseInt(u.popupWidth.toString(),10)>window.outerWidth&&("dropdownlist"!==u.getModuleName()||!u.allowFiltering)&&u.popupObj.element.classList.add("e-wide-popup"),u.popupObj.element.classList.add(f.device),("dropdownlist"===u.getModuleName()||"combobox"===u.getModuleName()&&!u.allowFiltering&&u.isDropDownClick)&&(u.popupObj.collision={X:"fit",Y:"fit"}),u.isFilterLayout())&&u.isDeviceFullScreen&&(u.popupObj.element.classList.add(f.mobileFilter),u.popupObj.position={X:0,Y:0},u.popupObj.dataBind(),P.attributes(u.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),P.addClass([document.body,u.popupObj.element],f.popupFullScreen),u.setSearchBoxPosition(),u.backIconElement=i.container.querySelector(".e-back-icon"),u.clearIconElement=i.container.querySelector("."+f.clearIcon),P.EventHandler.add(u.backIconElement,"click",u.clickOnBackIcon,u),P.EventHandler.add(u.clearIconElement,"click",u.clearText,u)),e.style.visibility="visible",P.addClass([e],"e-popup-close");for(var n=0,a=u.popupObj.getScrollableParent(u.inputWrapper.container);n<a.length;n++){var o=a[n];P.EventHandler.add(o,"scroll",u.scrollHandler,u)}P.isNullOrUndefined(u.list)||(u.unWireListEvents(),u.wireListEvents()),u.selectedElementID=u.selectedLI?u.selectedLI.id:null,u.enableVirtualization&&(u.notify("bindScrollEvent",{module:"VirtualScroll",component:u.getModuleName(),enable:u.enableVirtualization}),setTimeout(function(){(u.value||u.list.querySelector(".e-active"))&&(u.updateSelectionList(),u.selectedValueInfo&&u.viewPortInfo&&u.viewPortInfo.offsets.top?u.list.scrollTop=u.viewPortInfo.offsets.top:u.scrollBottom(!0,!0))},5)),P.attributes(u.targetElement(),{"aria-expanded":"true","aria-owns":u.element.id+"_popup","aria-controls":u.element.id}),"dropdownlist"!==u.getModuleName()&&u.list.classList.contains("e-nodata")&&(P.attributes(u.targetElement(),{"aria-activedescendant":"no-record"}),u.popupContentElement.setAttribute("role","status"),u.popupContentElement.setAttribute("id","no-record")),u.inputElement.setAttribute("aria-expanded","true"),u.inputElement.setAttribute("aria-controls",u.element.id+"_popup");var r=u.isFiltering()?u.filterInput.parentElement:u.inputWrapper.container,s=(P.addClass([r],[f.inputFocus]),u.beforePopupOpen=!0,u.popupObj);u.trigger("open",{popup:s,event:h,cancel:!1,animation:{name:"FadeIn",duration:100}},function(e){e.cancel?(u.beforePopupOpen=!1,u.destroyPopup()):(P.isNullOrUndefined(u.inputWrapper)||P.addClass([u.inputWrapper.container],[f.iconAnimation]),u.renderReactTemplates(),u.isReact&&u.isFiltering()&&u.dataSource instanceof c.DataManager&&u.list.querySelector("ul")&&!u.isSecondClick&&u.executeCloneElements(),P.isNullOrUndefined(u.popupObj)||u.popupObj.show(new P.Animation(e.animation),1e3===u.zIndex?u.element:null),u.isReact&&setTimeout(function(){var e,t;!u.popupHeight||!u.list||"auto"===u.popupHeight||"dropdownlist"===u.getModuleName()&&u.allowFiltering||(e="string"==typeof u.popupHeight?parseInt(u.popupHeight,10):u.popupHeight,!u.isUpdateHeaderHeight&&u.headerTemplate&&u.header&&(t=""===u.list.style.maxHeight?e:parseInt(u.list.style.maxHeight,10),u.list.style.maxHeight=(t-u.header.offsetHeight).toString()+"px",u.isUpdateHeaderHeight=!0),!u.isUpdateFooterHeight&&u.footerTemplate&&u.footer&&(t=""===u.list.style.maxHeight?e:parseInt(u.list.style.maxHeight,10),u.list.style.maxHeight=(t-u.footer.offsetHeight).toString()+"px",u.isUpdateFooterHeight=!0))},15))}),!u.allowResize||"dropdownlist"===u.getModuleName()&&P.Browser.isDevice&&u.isDeviceFullScreen&&u.allowFiltering||(u.resizer=u.createElement("div",{id:u.element.id+"_resize-popup",className:f.resizeIcon}),u.list&&u.list.parentElement&&(u.list.parentElement.classList.add("e-resize"),"auto"!==u.popupHeight.toString().toLowerCase()&&t>=parseInt(u.popupHeight.toString(),10)-2&&(u.list.parentElement.style.height="100%"),u.list.parentElement.style.paddingBottom="dropdownlist"===u.getModuleName()&&u.allowFiltering&&u.searchBoxHeight?(u.searchBoxHeight+16).toString()+"px":16..toString()+"px",(u.header||u.footer||u.itemTemplate)&&(u.list.parentElement.style.paddingBottom=(parseInt(u.list.parentElement.style.maxHeight,10)-parseInt(u.list.style.maxHeight,10)+16).toString()+"px"),u.list.parentElement.appendChild(u.resizer),u.list.parentElement.style.width=u.resizeWidth+"px",u.list.parentElement.style.height=u.resizeHeight+"px",u.list.parentElement.style.maxHeight=u.resizeHeight+"px",u.list.style.maxHeight=u.resizeHeight+"px"),P.EventHandler.add(u.resizer,"mousedown",u.startResizing,u),P.EventHandler.add(u.resizer,"touchstart",u.startResizing,u))}})},n.prototype.checkCollision=function(e){P.Browser.isDevice&&(!P.Browser.isDevice||"dropdownlist"===this.getModuleName()||this.isDropDownClick)||(0<o.isCollide(e).length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},n.prototype.getOffsetValue=function(e){var e=getComputedStyle(e),t=parseInt(e.borderTopWidth,10),e=parseInt(e.borderBottomWidth,10);return this.setPopupPosition(t+e)},n.prototype.createPopup=function(e,t,i){var s=this;this.popupObj=new o.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputWrapper.container,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},zIndex:this.zIndex,close:function(){s.isDocumentClick||s.focusDropDown(),s.isReact&&s.clearTemplate(["headerTemplate","footerTemplate"]),s.isNotSearchList=!1,s.isDocumentClick=!1,s.destroyPopup(),s.isFiltering()&&s.actionCompleteData.list&&0<s.actionCompleteData.list.length?(s.isActive=!0,s.isReactTemplateUpdate&&s.isReact&&s.itemTemplate&&!s.enableVirtualization&&(s.actionCompleteData.ulElement=s.renderItems(s.actionCompleteData.list,s.fields),s.isReactTemplateUpdate=!1),s.enableVirtualization?s.onActionComplete(s.ulElement,s.listData,null,!0):s.onActionComplete(s.actionCompleteData.ulElement,s.actionCompleteData.list,null,!0)):s.enableVirtualization&&s.focusIndexItem()},open:function(){P.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0;var e=s.actionCompleteData&&s.actionCompleteData.ulElement&&s.actionCompleteData.ulElement.querySelector("li"),t=s.list.querySelector("ul li");P.isNullOrUndefined(s.ulElement)||P.isNullOrUndefined(s.ulElement.getElementsByClassName("e-item-focus")[0])?P.isNullOrUndefined(s.ulElement)||P.isNullOrUndefined(s.ulElement.getElementsByClassName("e-active")[0])||P.attributes(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-active")[0].id}):P.attributes(s.targetElement(),{"aria-activedescendant":s.ulElement.getElementsByClassName("e-item-focus")[0].id}),s.isFiltering()&&s.itemTemplate&&s.element.tagName===s.getNgDirective()&&e&&t&&e.textContent!==t.textContent&&"EJS-COMBOBOX"!==s.element.tagName&&s.cloneElements(),s.isFilterLayout()&&(P.removeClass([s.inputWrapper.container],[f.inputFocus]),s.isFilterFocus=!0,s.filterInput.focus(),s.inputWrapper.clearButton)&&P.addClass([s.inputWrapper.clearButton],f.clearIconHide),s.activeStateChange()},targetExitViewport:function(){P.Browser.isDevice||s.hidePopup()}})},n.prototype.isEmptyList=function(){return!P.isNullOrUndefined(this.liCollections)&&0===this.liCollections.length},n.prototype.getFocusElement=function(){},n.prototype.isFilterLayout=function(){return"dropdownlist"===this.getModuleName()&&this.allowFiltering},n.prototype.scrollHandler=function(){P.Browser.isDevice&&("dropdownlist"===this.getModuleName()&&!this.isFilterLayout()||"combobox"===this.getModuleName()&&!this.allowFiltering&&this.isDropDownClick)&&this.element&&!this.isElementInViewport(this.element)&&this.hidePopup()},n.prototype.isElementInViewport=function(e){e=e.getBoundingClientRect();return 0<=e.top&&0<=e.left&&e.bottom<=window.innerHeight&&e.right<=window.innerWidth},n.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,e=(this.popupObj.element.style.maxHeight="100%",this.popupObj.element.style.width="100%",this.list.style.maxHeight=window.innerHeight-e+"px",this.list.style.height=window.innerHeight-e+"px",this.filterInput.parentElement.querySelector("."+f.clearIcon));P.detach(this.filterInput),e.parentElement.insertBefore(this.filterInput,e)},n.prototype.setPopupPosition=function(e){var t,i=this.list.querySelector("."+f.focus)||this.selectedLI,s=this.isEmptyList()?this.list:this.liCollections[0],l=this.isEmptyList()?this.list:this.liCollections[this.getItems().length-1],n=s.getBoundingClientRect().height,a=(this.listItemHeight=n+parseInt(window.getComputedStyle(s).marginBottom,10),this.list.offsetHeight/2),s=(P.isNullOrUndefined(i)?s:i).offsetTop,l=(l.offsetTop-a<s&&!P.isNullOrUndefined(this.liCollections)&&0<this.liCollections.length&&!P.isNullOrUndefined(i)?(l=this.list.offsetHeight/n,t=parseInt(getComputedStyle(this.list).paddingBottom,10),t=(l-(this.liCollections.length-this.activeIndex))*n-e+t,this.list.scrollTop=i.offsetTop):a<s&&!this.enableVirtualization?(t=a-n/2,this.list.scrollTop=s-a+n/2):t=s,this.inputWrapper.container.offsetHeight);return-(t=t+n+e-(n-l)/2)},n.prototype.setWidth=function(){var e,t=P.formatUnit(this.popupWidth);return-1<t.indexOf("%")&&(t=(this.inputWrapper.container.offsetWidth*parseFloat(t)/100).toString()+"px"),P.Browser.isDevice&&-1<t.indexOf("px")&&!this.allowFiltering&&("dropdownlist"===this.getModuleName()||this.isDropDownClick&&"combobox"===this.getModuleName())&&(e=this.isEmptyList()?this.list:this.liCollections[0],t=parseInt(t,10)+2*(parseInt(getComputedStyle(e).textIndent,10)-parseInt(getComputedStyle(this.inputElement).paddingLeft,10)+parseInt(getComputedStyle(this.inputElement.parentElement).borderLeftWidth,10))+"px"),t},n.prototype.scrollBottom=function(e,t,i){var s,l,n,a,o,r,h,u,p=this;void 0===t&&(t=!1),void 0===i&&(i=null),P.isNullOrUndefined(this.selectedLI)&&this.enableVirtualization&&(this.selectedLI=this.list.querySelector("."+y.li),!P.isNullOrUndefined(this.selectedLI))&&this.selectedLI.classList.contains("e-virtual-list")&&(this.selectedLI=this.liCollections[this.skeletonCount]),P.isNullOrUndefined(this.selectedLI)||(s=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,this.isUpwardScrolling=!1,r=this.list.querySelectorAll(".e-virtual-list").length,l=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,u=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+s):this.selectedLI.offsetTop,h=this.list.offsetHeight,n=u-r*(this.selectedLI.offsetHeight+s)+(this.selectedLI.offsetHeight+s)-this.list.scrollTop,o=this.list.scrollTop+n-h,a=!1,o=e?o+2*parseInt(getComputedStyle(this.list).paddingTop,10):o+parseInt(getComputedStyle(this.list).paddingTop,10),u=u-r*(this.selectedLI.offsetHeight+s)+(this.selectedLI.offsetHeight+s)-this.list.scrollTop,u=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?u-this.fixedHeaderElement.offsetHeight:u,0!==this.activeIndex||this.enableVirtualization?(h<n||!(0<u&&this.list.offsetHeight>u))&&(r=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,h="pageDown"===i?this.getPageCount()-2:1,!this.enableVirtualization||this.isKeyBoardAction||t?this.isKeyBoardAction&&this.enableVirtualization&&l&&r===l&&"end"!==i&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.enableVirtualization&&this.itemTemplate?this.list.scrollTop+=o:(this.enableVirtualization&&(h="pageDown"===i?this.getPageCount()+1:h),this.list.scrollTop+=(this.selectedLI.offsetHeight+s)*h),this.isPreventKeyAction=!this.IsScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"end"===i?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):("pageDown"===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=o):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?e&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,a=this.isKeyBoardAction):(this.list.scrollTop=0,a=this.isKeyBoardAction),this.isKeyBoardAction=a,this.enableVirtualization&&this.fields.groupBy&&this.fixedHeaderElement&&"down"===i&&setTimeout(function(){p.scrollStop(null,!0)},100))},n.prototype.scrollTop=function(e){var t,i,s,l,n,a;void 0===e&&(e=null),P.isNullOrUndefined(this.selectedLI)||(t=this.selectedLI&&!isNaN(parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10))?parseInt(window.getComputedStyle(this.selectedLI).marginBottom,10):0,n=this.list.querySelectorAll(".e-virtual-list").length,s=(l=this.virtualListInfo&&this.virtualListInfo.startIndex?this.selectedLI.offsetTop+this.virtualListInfo.startIndex*(this.selectedLI.offsetHeight+t):this.selectedLI.offsetTop)-n*(this.selectedLI.offsetHeight+t)-this.list.scrollTop,i=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,s=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?s-this.fixedHeaderElement.offsetHeight:s,l=l-n*(this.selectedLI.offsetHeight+t)+(this.selectedLI.offsetHeight+t)-this.list.scrollTop,n=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&s<=0,0!==this.activeIndex||this.enableVirtualization?s<0||n?(n=this.selectedLI?this.selectedLI.getAttribute("data-value"):null,a="pageUp"===e?this.getPageCount()-2:1,this.enableVirtualization&&(a="pageUp"===e?this.getPageCount():a),this.enableVirtualization&&this.isKeyBoardAction&&i&&n===i&&"home"!==e&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.list.scrollTop-=(this.selectedLI.offsetHeight+t)*a,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&"home"===e?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):("pageUp"===e&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+s)):0<l&&this.list.offsetHeight>l||(this.list.scrollTop=this.selectedLI.offsetTop-(this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0)},n.prototype.IsScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},n.prototype.isEditTextBox=function(){return!1},n.prototype.isFiltering=function(){return this.allowFiltering},n.prototype.isPopupButton=function(){return!0},n.prototype.setScrollPosition=function(e){if(this.isPreventScrollAction=!0,P.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.isKeyBoardAction=!0,this.scrollBottom(!1,!1,e.action);break;default:this.isKeyBoardAction="up"===e.action||"pageUp"===e.action||"open"===e.action,this.scrollTop(e.action)}this.isKeyBoardAction=!1},n.prototype.clearText=function(){this.filterInput.value=this.typedString="",this.searchLists(null),this.enableVirtualization&&(this.list.scrollTop=0,this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]&&(this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight()),this.getSkeletonCount(),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues())},n.prototype.setEleWidth=function(e){P.isNullOrUndefined(e)||("number"==typeof e?this.inputWrapper.container.style.width=P.formatUnit(e):"string"==typeof e&&(this.inputWrapper.container.style.width=e.match(/px|%|em/)?e:P.formatUnit(e)))},n.prototype.closePopup=function(e,t){var i=this,s=!P.isNullOrUndefined(this.filterInput)&&!P.isNullOrUndefined(this.filterInput.value)&&""!==this.filterInput.value;"combobox"===this.getModuleName()&&this.typedString;if(this.isTyped=!1,this.isVirtualTrackHeight=!1,this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen){this.keyboardEvent=null,P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.isActive=!1,this.isDropDownClick=!1,this.preventAutoFill=!1;for(var l=0,n=this.popupObj.getScrollableParent(this.inputWrapper.container);l<n.length;l++){var a=n[l];P.EventHandler.remove(a,"scroll",this.scrollHandler)}P.Browser.isDevice&&this.isFilterLayout()&&this.isDeviceFullScreen&&P.removeClass([document.body,this.popupObj.element],f.popupFullScreen),this.isFilterLayout()&&(P.Browser.isDevice||(this.searchKeyModule.destroy(),this.clearIconElement&&P.EventHandler.remove(this.clearIconElement,"click",this.clearText)),this.backIconElement&&(P.EventHandler.remove(this.backIconElement,"click",this.clickOnBackIcon),P.EventHandler.remove(this.clearIconElement,"click",this.clearText)),P.isNullOrUndefined(this.filterInput)||(P.EventHandler.remove(this.filterInput,"input",this.onInput),P.EventHandler.remove(this.filterInput,"keyup",this.onFilterUp),P.EventHandler.remove(this.filterInput,"keydown",this.onFilterDown),P.EventHandler.remove(this.filterInput,"blur",this.onBlurHandler),P.EventHandler.remove(this.filterInput,"paste",this.pasteHandler)),this.allowFiltering&&"dropdownlist"===this.getModuleName()&&(this.filterInput.removeAttribute("aria-activedescendant"),this.filterInput.removeAttribute("aria-disabled"),this.filterInput.removeAttribute("role"),this.filterInput.removeAttribute("autocomplete"),this.filterInput.removeAttribute("autocapitalize"),this.filterInput.removeAttribute("spellcheck")),this.filterInput=null),P.attributes(this.targetElement(),{"aria-expanded":"false"}),this.inputElement.setAttribute("aria-expanded","false"),this.targetElement().removeAttribute("aria-owns"),this.targetElement().removeAttribute("aria-activedescendant"),this.inputWrapper.container.classList.remove(f.iconAnimation),this.isFiltering()&&(this.actionCompleteData.isUpdated=!1),this.enableVirtualization&&(null==this.value||this.isTyped?(this.viewPortInfo.endIndex=this.viewPortInfo&&0<this.viewPortInfo.endIndex?this.viewPortInfo.endIndex:this.itemCount,("autocomplete"===this.getModuleName()||"dropdownlist"===this.getModuleName()&&!P.isNullOrUndefined(this.typedString)&&""!==this.typedString||"combobox"===this.getModuleName()&&this.allowFiltering&&!P.isNullOrUndefined(this.typedString)&&""!==this.typedString)&&this.checkAndResetCache()):"autocomplete"===this.getModuleName()&&this.checkAndResetCache(),"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||0===this.skeletonCount||this.getSkeletonCount(!0)),this.beforePopupOpen=!1;e={popup:this.popupObj,cancel:!1,animation:{name:"FadeOut",duration:100,delay:e||0},event:t||null};this.trigger("close",e,function(e){var t;"dropdownlist"===i.getModuleName()&&h.Input.destroy({element:i.filterInput,floatLabelType:i.floatLabelType,properties:{placeholder:i.filterBarPlaceholder},buttons:i.clearIconElement},i.clearIconElement),i.filterInputObj=null,P.isNullOrUndefined(i.popupObj)||P.isNullOrUndefined(i.popupObj.element.querySelector(".e-fixed-head"))||((t=i.popupObj.element.querySelector(".e-fixed-head")).parentNode.removeChild(t),i.fixedHeaderElement=null),e.cancel||("autocomplete"===i.getModuleName()&&i.rippleFun(),i.isPopupOpen?i.popupObj.hide(new P.Animation(e.animation)):i.destroyPopup())}),P.Browser.isDevice&&!e.cancel&&this.popupObj.element.classList.contains("e-wide-popup")&&this.popupObj.element.classList.remove("e-wide-popup"),t=this.dataSource instanceof c.DataManager?this.virtualGroupDataSource&&this.virtualGroupDataSource.length?this.virtualGroupDataSource.length:0:this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.enableVirtualization&&this.isFiltering()&&s&&this.totalItemCount!==t&&(this.updateInitialData(),this.checkAndResetCache())}},n.prototype.updateInitialData=function(){var e,t,i=this.selectData;P.isNullOrUndefined(i)||(e=this.renderItems(i,this.fields),this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},"combobox"===this.getModuleName()&&(this.typedString=""),this.previousStartIndex=0,this.previousEndIndex=0,this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&this.list.parentElement&&((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(t)),"autocomplete"!==this.getModuleName()&&0!==this.totalItemCount&&this.totalItemCount>2*this.itemCount&&this.getSkeletonCount(),this.UpdateSkeleton(),this.listData=i,this.updateActionCompleteDataValues(e,i),this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()))},n.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isFilterFocus=!1,this.inputElement.removeAttribute("aria-controls"),this.popupObj&&(this.resizer&&(P.EventHandler.remove(this.resizer,"mousedown",this.startResizing),P.EventHandler.remove(this.resizer,"touchstart",this.startResizing)),this.popupObj.destroy(),P.detach(this.popupObj.element))},n.prototype.clickOnBackIcon=function(){this.hidePopup(),this.focusIn()},n.prototype.render=function(){this.preselectedIndex=P.isNullOrUndefined(this.index)?null:this.index,"INPUT"===this.element.tagName?(this.inputElement=this.element,P.isNullOrUndefined(this.inputElement.getAttribute("role"))&&this.inputElement.setAttribute("role","combobox"),P.isNullOrUndefined(this.inputElement.getAttribute("type"))&&this.inputElement.setAttribute("type","text"),this.inputElement.setAttribute("aria-expanded","false")):(this.inputElement=this.createElement("input",{attrs:{role:"combobox",type:"text"}}),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.parentElement.insertBefore(this.inputElement,this.element),this.preventTabIndex(this.inputElement));var e=this.cssClass,e=(P.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass.replace(/\s+/g," ").trim()),!P.isNullOrUndefined(P.closest(this.element,"fieldset"))&&P.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.inputWrapper=h.Input.createInput({element:this.inputElement,buttons:this.isPopupButton()?[f.icon]:null,floatLabelType:this.floatLabelType,properties:{readonly:"dropdownlist"===this.getModuleName()||this.readonly,placeholder:this.placeholder,cssClass:e,enabled:this.enabled,enableRtl:this.enableRtl,showClearButton:this.showClearButton}},this.createElement),this.element.tagName===this.getNgDirective()?this.element.appendChild(this.inputWrapper.container):this.inputElement.parentElement.insertBefore(this.element,this.inputElement),this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:f.hiddenElement}}),P.prepend([this.hiddenElement],this.inputWrapper.container),this.hiddenElement.hasAttribute("aria-label")||this.hiddenElement.setAttribute("aria-label",this.getModuleName()),this.validationAttribute(this.element,this.hiddenElement),this.setReadOnly(),this.setFields(),this.inputWrapper.container.style.width=P.formatUnit(this.width),this.inputWrapper.container.classList.add("e-ddl"),"Never"!==this.floatLabelType&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container),!P.isNullOrUndefined(this.inputWrapper.buttons[0])&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType&&this.inputWrapper.container.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.wireEvent(),this.tabIndex=this.element.hasAttribute("tabindex")?this.element.getAttribute("tabindex"):"0",this.element.removeAttribute("tabindex"),this.element.getAttribute("id")?this.element.getAttribute("id"):P.getUniqueID("ej2_dropdownlist")),e=(this.element.id=e,this.hiddenElement.id=e+"_hidden",this.targetElement().setAttribute("tabindex",this.tabIndex),"autocomplete"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.readonly?"dropdownlist"===this.getModuleName()&&(this.targetElement().hasAttribute("aria-label")||P.attributes(this.targetElement(),{"aria-label":this.getModuleName()}),this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.inputElement.setAttribute("aria-expanded","false")):this.inputElement.hasAttribute("aria-label")||this.inputElement.setAttribute("aria-label",this.getModuleName()),P.attributes(this.targetElement(),this.getAriaAttributes()),this.updateDataAttribute(this.htmlAttributes),this.setHTMLAttributes(),this.targetElement()===this.inputElement&&this.inputElement.removeAttribute("aria-labelledby"),null!==this.value||null!==this.activeIndex||null!==this.text?(this.enableVirtualization&&(this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),null!==this.index)&&(this.activeIndex=this.index+this.skeletonCount),this.initValue(),this.selectedValueInfo=this.viewPortInfo,this.enableVirtualization&&(this.activeIndex=this.activeIndex+this.skeletonCount)):"SELECT"===this.element.tagName&&this.element.options[0]&&(e=this.element,this.value=this.allowObjectBinding?this.getDataByValue(e.options[e.selectedIndex].value):e.options[e.selectedIndex].value,this.text=P.isNullOrUndefined(this.value)?null:e.options[e.selectedIndex].textContent,this.initValue()),this.setEnabled(),this.preventTabIndex(this.element),this.enabled||(this.targetElement().tabIndex=-1),this.initial=!1,this.element.style.opacity="",this.inputElement.onselect=function(e){e.stopImmediatePropagation()},this.inputElement.onchange=function(e){e.stopImmediatePropagation()},this.element.hasAttribute("autofocus")&&this.focusIn(),P.isNullOrUndefined(this.text)||this.inputElement.setAttribute("value",this.text),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),this.inputWrapper.container.getElementsByClassName("e-float-text")[0]);P.isNullOrUndefined(this.element.id)||""===this.element.id||P.isNullOrUndefined(e)||(e.id="label_"+this.element.id.replace(/ /g,"_"),P.attributes(this.inputElement,{"aria-labelledby":e.id})),this.renderComplete(),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount},n.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=P.formatUnit(this.popupHeight),i=(e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height,Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10));return e.remove(),i},n.prototype.setFooterTemplate=function(e){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),P.addClass([this.footer],f.footer));var t=this.dropdownCompiler(this.footerTemplate),t="function"!=typeof this.footerTemplate&&t?P.compile(P.select(this.footerTemplate,document).innerHTML.trim()):P.compile(this.footerTemplate),t=t({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);t&&0<t.length&&P.append(t,this.footer),P.append([this.footer],e)},n.prototype.setHeaderTemplate=function(e){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),P.addClass([this.header],f.header));var t=this.dropdownCompiler(this.headerTemplate),t="function"!=typeof this.headerTemplate&&t?P.compile(P.select(this.headerTemplate,document).innerHTML.trim()):P.compile(this.headerTemplate),t=t({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header),t=(t&&t.length&&P.append(t,this.header),e.querySelector("div.e-content"));e.insertBefore(this.header,t)},n.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},n.prototype.setOldText=function(e){this.text=e},n.prototype.setOldValue=function(e){this.value=e},n.prototype.refreshPopup=function(){P.isNullOrUndefined(this.popupObj)||!document.body.contains(this.popupObj.element)||(!this.allowFiltering||P.Browser.isDevice&&this.isFilterLayout())&&"autocomplete"!==this.getModuleName()||(P.removeClass([this.popupObj.element],"e-popup-close"),this.popupObj.refreshPosition(this.inputWrapper.container),this.popupObj.resolveCollision())},n.prototype.checkData=function(e){!e.dataSource||P.isNullOrUndefined(Object.keys(e.dataSource))||!this.itemTemplate||!this.allowFiltering||this.isListSearched&&e.dataSource instanceof c.DataManager||(this.list&&!this.isReact?this.list.innerHTML="":this.list=null,this.actionCompleteData={ulElement:null,list:null,isUpdated:!1}),this.isListSearched=!1;var t=-1!==Object.keys(e).indexOf("value")&&P.isNullOrUndefined(e.value),i=-1!==Object.keys(e).indexOf("text")&&P.isNullOrUndefined(e.text);"autocomplete"!==this.getModuleName()&&this.allowFiltering&&(t||i)&&(this.itemData=null),this.allowFiltering&&e.dataSource&&!P.isNullOrUndefined(Object.keys(e.dataSource))?(this.actionCompleteData={ulElement:null,list:null,isUpdated:!1},this.actionData=this.actionCompleteData):this.allowFiltering&&e.query&&!P.isNullOrUndefined(Object.keys(e.query))&&(this.actionCompleteData="combobox"===this.getModuleName()?{ulElement:null,list:null,isUpdated:!1}:this.actionCompleteData,this.actionData=this.actionCompleteData)},n.prototype.updateDataSource=function(e,t){""===this.inputElement.value&&(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof c.DataManager||0!==e.dataSource.length))||this.clearAll(null,e),this.fields.groupBy&&e.fields&&!this.isGroupChecking&&this.list&&(P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),P.EventHandler.add(this.list,"scroll",this.setFloatingHeader,this)),(P.isNullOrUndefined(e)||!P.isNullOrUndefined(e.dataSource)&&(e.dataSource instanceof c.DataManager||0!==e.dataSource.length)||e.dataSource instanceof c.DataManager||!P.isNullOrUndefined(e)&&Array.isArray(e.dataSource)&&!P.isNullOrUndefined(t)&&Array.isArray(t.dataSource)&&e.dataSource.length!==t.dataSource.length)&&(this.typedString="",this.resetList(this.dataSource)),this.isCustomFilter||this.isFilterFocus||document.activeElement===this.filterInput||this.checkCustomValue()},n.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,t=(this.itemData=this.getDataByValue(e),this.getItemData()),i=this.allowObjectBinding?this.itemData:t.value,s=P.isNullOrUndefined(i)?null:this.index;P.isNullOrUndefined(s)&&e===i||this.isAngular?this.setProperties({text:t.text&&t.text.toString(),value:i}):this.setProperties({text:t.text&&t.text.toString(),index:s,value:i})},n.prototype.updateInputFields=function(){"dropdownlist"===this.getModuleName()&&h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},n.prototype.onPropertyChanged=function(n,a){for(var o=this,r=(P.isNullOrUndefined(n.dataSource)||this.isTouched||!P.isNullOrUndefined(n.value)||!P.isNullOrUndefined(n.index)||P.isNullOrUndefined(this.preselectedIndex)||P.isNullOrUndefined(this.index)||(n.index=this.index),P.isNullOrUndefined(n.value)&&P.isNullOrUndefined(n.index)||(this.isTouched=!0),"dropdownlist"===this.getModuleName()&&(this.checkData(n),this.setUpdateInitial(["fields","query","dataSource"],n)),this),e=0,t=Object.keys(n);e<t.length;e++){var i=function(e){switch(e){case"query":case"dataSource":r.getSkeletonCount(),r.checkAndResetCache();break;case"htmlAttributes":r.setHTMLAttributes();break;case"width":r.setEleWidth(n.width),h.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"placeholder":h.Input.setPlaceholder(n.placeholder,r.inputElement);break;case"filterBarPlaceholder":r.filterInput&&h.Input.setPlaceholder(n.filterBarPlaceholder,r.filterInput);break;case"readonly":"dropdownlist"!==r.getModuleName()&&h.Input.setReadonly(n.readonly,r.inputElement),r.setReadOnly();break;case"cssClass":r.setCssClass(n.cssClass,a.cssClass),h.Input.calculateWidth(r.inputElement,r.inputWrapper.container);break;case"enableRtl":r.setEnableRtl();break;case"enabled":r.setEnable();break;case"text":var t;r.fields.disabled&&(n.text=n.text&&!r.isDisabledItemByIndex(r.getIndexByValue(r.getValueByText(n.text)))?n.text:null),null===n.text?r.clearAll():r.enableVirtualization?(r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})):(r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),r.initialRemoteRender||(l=r.getElementByText(n.text),r.checkValidLi(l)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.text,a.text,"text"):n.text&&r.dataSource instanceof c.DataManager?(t=r.getItems().length,s=P.isNullOrUndefined(r.fields.text)?r.fields.value:r.fields.text,r.typedString="",r.dataSource.executeQuery(r.getQuery(r.query).where(new c.Predicate(s,"equal",n.text))).then(function(e){0<e.result.length?(o.addItem(e.result,t),o.updateValues()):o.setOldText(a.text)})):"autocomplete"===r.getModuleName()?r.setInputValue(n,a):r.setOldText(a.text)),r.updateInputFields()));break;case"value":if(r.fields.disabled&&(n.value=null==n.value||r.isDisableItemValue(n.value)?null:n.value),null===n.value)r.clearAll();else{if(r.allowObjectBinding&&!P.isNullOrUndefined(n.value)&&!P.isNullOrUndefined(a.value)&&r.isObjectInArray(n.value,[a.value]))return{value:void 0};var i;r.enableVirtualization?(r.updateValues(),r.updateInputFields(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"}),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange):(r.notify("beforeValueChange",{newProp:n}),r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),r.initialRemoteRender||(l=r.allowObjectBinding&&!P.isNullOrUndefined(n.value)?P.getValue(r.fields.value||"",n.value):n.value,l=r.getElementByValue(l),r.checkValidLi(l)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.value,a.value,"value"):n.value&&r.dataSource instanceof c.DataManager?(i=r.getItems().length,s=P.isNullOrUndefined(r.fields.value)?r.fields.text:r.fields.value,r.typedString="",l=r.allowObjectBinding&&!P.isNullOrUndefined(n.value)?P.getValue(s,n.value):n.value,r.dataSource.executeQuery(r.getQuery(r.query).where(new c.Predicate(s,"equal",l))).then(function(e){0<e.result.length?(o.addItem(e.result,i),o.updateValues()):o.setOldValue(a.value)})):"autocomplete"===r.getModuleName()?r.setInputValue(n,a):r.setOldValue(a.value)),r.updateInputFields(),r.preventChange=r.isAngular&&r.preventChange?!r.preventChange:r.preventChange))}break;case"index":var s;r.fields.disabled&&(n.index=null==n.index||r.isDisabledItemByIndex(n.index)?null:n.index),null===n.index?r.clearAll():(r.list||(r.dataSource instanceof c.DataManager&&(r.initialRemoteRender=!0),r.renderList()),!r.initialRemoteRender&&r.liCollections&&(s=r.liCollections[n.index],r.checkValidLi(s)||(r.liCollections&&100===r.liCollections.length&&"autocomplete"===r.getModuleName()&&100<r.listData.length?r.setSelectionData(n.index,a.index,"index"):r.index=a.index),r.updateInputFields()));break;case"footerTemplate":r.popupObj&&r.setFooterTemplate(r.popupObj.element);break;case"headerTemplate":r.popupObj&&r.setHeaderTemplate(r.popupObj.element);break;case"valueTemplate":P.isNullOrUndefined(r.itemData)||null===r.valueTemplate||r.setValueTemplate();break;case"allowFiltering":r.allowFiltering&&(r.actionCompleteData={ulElement:r.ulElement,list:r.listData,isUpdated:!0},r.actionData=r.actionCompleteData,r.updateSelectElementData(r.allowFiltering));break;case"floatLabelType":h.Input.removeFloating(r.inputWrapper),h.Input.addFloating(r.inputElement,n.floatLabelType,r.placeholder,r.createElement),!P.isNullOrUndefined(r.inputWrapper.buttons[0])&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0]&&"Never"!==r.floatLabelType&&r.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon");break;case"showClearButton":r.inputWrapper.clearButton||(h.Input.setClearButton(n.showClearButton,r.inputElement,r.inputWrapper,null,r.createElement),r.bindClearEvent());break;default:var l=r.getPropObject(e,n,a);m.prototype.onPropertyChanged.call(r,l.newProperty,l.oldProperty)}}(t[e]);if("object"==typeof i)return i.value}},n.prototype.checkValidLi=function(e){return!!this.isValidLI(e)&&(this.setSelection(e,null),!0)},n.prototype.setSelectionData=function(t,i,s){var l,n=this;this.updateListValues=function(){var e;"text"===s?(l=n.getElementByText(t),n.checkValidLi(l)||n.setOldText(i)):"value"===s?(e=n.fields.value||"",n.allowObjectBinding&&!P.isNullOrUndefined(t)&&P.getValue(e,t),l=n.getElementByValue(t),n.checkValidLi(l)||n.setOldValue(i)):"index"===s&&(l=n.liCollections[t],n.checkValidLi(l)||(n.index=i))}},n.prototype.updatePopupState=function(){this.beforePopupOpen&&(this.beforePopupOpen=!1,this.showPopup())},n.prototype.setReadOnly=function(){this.readonly?P.addClass([this.inputWrapper.container],["e-readonly"]):P.removeClass([this.inputWrapper.container],["e-readonly"])},n.prototype.setInputValue=function(e,t){},n.prototype.setCssClass=function(e,t){P.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),P.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),h.Input.setCssClass(e,[this.inputWrapper.container],t),this.popupObj&&h.Input.setCssClass(e,[this.popupObj.element],t)},n.prototype.getModuleName=function(){return"dropdownlist"},n.prototype.showPopup=function(e){this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.isReact&&"combobox"===this.getModuleName()&&this.itemTemplate&&this.isCustomFilter&&this.isAddNewItemTemplate&&(this.renderList(),this.isAddNewItemTemplate=!1),this.isFiltering()&&this.dataSource instanceof c.DataManager&&this.actionData.list!==this.actionCompleteData.list&&this.actionData.list&&this.actionData.ulElement&&(this.actionCompleteData=this.actionData,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)),this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.isFiltering()&&!this.isActive&&this.actionCompleteData.list&&this.actionCompleteData.list[0]?(this.isActive=!0,this.onActionComplete(this.actionCompleteData.ulElement,this.actionCompleteData.list,null,!0)):(P.isNullOrUndefined(this.list)||!P.isUndefined(this.list)&&(this.list.classList.contains(y.noData)||this.list.querySelectorAll("."+y.li).length<=0))&&(this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&(this.isSecondClick=!1),this.renderList(e)),this.enableVirtualization&&this.listData&&this.listData.length&&(P.isNullOrUndefined(this.value)||"dropdownlist"!==this.getModuleName()&&"combobox"!==this.getModuleName()||this.removeHover(),this.beforePopupOpen||this.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})),this.beforePopupOpen&&this.invokeRenderPopup(e),this.enableVirtualization&&!this.allowFiltering&&null!=this.selectedValueInfo&&0<this.selectedValueInfo.startIndex&&null!=this.value&&this.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),this.isSecondClick||this.isDropDownClick||this.executeCloneElements()))},n.prototype.executeCloneElements=function(){var e=this,t=this.element.tagName===this.getNgDirective()&&this.itemTemplate?500:100;this.isReact&&this.isFiltering()&&null!=this.itemTemplate&&setTimeout(function(){e.cloneElements(),e.isSecondClick=!(e.isReact&&e.isFiltering()&&e.dataSource instanceof c.DataManager&&!e.list.querySelector("ul"))},t)},n.prototype.invokeRenderPopup=function(e){var t;P.Browser.isDevice&&this.isFilterLayout()&&(t=this,window.onpopstate=function(){t.hidePopup()},history.pushState({},"")),P.isNullOrUndefined(this.list)||P.isNullOrUndefined(this.list.children[0])&&!this.list.classList.contains(y.noData)||this.renderPopup(e)},n.prototype.renderHightSearch=function(){},n.prototype.hidePopup=function(e){this.isEscapeKey&&"dropdownlist"===this.getModuleName()&&(P.isNullOrUndefined(this.inputElement)||h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1,P.isNullOrUndefined(this.index)?this.resetSelection():(t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value):this.value,t=this.findListElement(this.ulElement,"li","data-value",t),this.selectedLI=this.liCollections[this.index]||t,this.selectedLI&&(this.updateSelectedItem(this.selectedLI,null,!0),this.valueTemplate)&&null!==this.itemData&&this.setValueTemplate())),this.isVirtualTrackHeight=!1,this.customFilterQuery=null,this.closePopup(0,e);var t=this.getItemData(),i=!P.isNullOrUndefined(this.selectedLI);i&&this.enableVirtualization&&this.selectedLI.classList&&(i=this.selectedLI.classList.contains("e-active")),this.inputElement&&""===this.inputElement.value&&!this.isInteracted&&(this.isSelectCustom||i&&this.inputElement.value!==t.text)&&(this.isSelectCustom=!1,this.clearAll(e))},n.prototype.focusIn=function(e){var t;this.enabled&&!this.targetElement().classList.contains(f.disable)&&(t=!1,this.preventFocus&&P.Browser.isDevice&&(this.inputWrapper.container.tabIndex=1,this.inputWrapper.container.focus(),t=!(this.preventFocus=!1)),t||this.targetElement().focus(),P.addClass([this.inputWrapper.container],[f.inputFocus]),this.onFocus(e),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},n.prototype.focusOut=function(e){this.enabled&&(this.enableVirtualization||"combobox"!==this.getModuleName()&&"autocomplete"!==this.getModuleName()||(this.isTyped=!0),this.hidePopup(e),this.targetElement()&&this.targetElement().blur(),P.removeClass([this.inputWrapper.container],[f.inputFocus]),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},n.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i,s=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)s=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===e){s=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var n=JSON.parse(JSON.stringify(e))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===n){s=this.getIndexByValue(n);break}}else s=e;s<this.liCollections.length&&-1<s&&!JSON.parse(JSON.stringify(this.listData[s]))[this.fields.disabled]&&(t=this.liCollections[s])&&(this.disableListItem(t),(i=JSON.parse(JSON.stringify(this.listData[s])))[this.fields.disabled]=!0,this.listData[s]=i,this.dataSource=this.listData,t.classList.contains(f.focus)&&this.removeFocus(),t.classList.contains(f.selected))&&this.clear()}}},n.prototype.destroy=function(){if(this.isActive=!1,this.showClearButton&&(this.clearButton=document.getElementsByClassName("e-clear-icon")[0]),z(this.element.id),this.isReact&&this.clearTemplate(),this.hidePopup(),this.popupObj&&this.popupObj.hide(),this.unWireEvent(),this.list&&this.unWireListEvents(),!this.element||this.element.classList.contains("e-"+this.getModuleName())){if(this.inputElement){for(var e=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-describedby","aria-label"],t=0;t<e.length;t++)this.inputElement.removeAttribute(e[t]);this.inputElement.setAttribute("tabindex",this.tabIndex),this.inputElement.classList.remove("e-input"),h.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton)}this.element.style.display="block",this.inputWrapper.container&&this.inputWrapper.container.parentElement&&(this.inputWrapper.container.parentElement.tagName!==this.getNgDirective()&&this.inputWrapper.container.parentElement.insertBefore(this.element,this.inputWrapper.container),P.detach(this.inputWrapper.container)),delete this.hiddenElement,this.filterInput=null,this.keyboardModule=null,this.ulElement=null,this.list=null,this.clearIconElement=null,this.popupObj=null,this.popupContentElement=null,this.rippleFun=null,this.selectedLI=null,this.liCollections=null,this.item=null,this.footer=null,this.header=null,this.previousSelectedLI=null,this.valueTempElement=null,this.actionData.ulElement=null,this.inputElement&&!P.isNullOrUndefined(this.inputElement.onchange)&&(this.inputElement.onchange=null),this.inputElement&&!P.isNullOrUndefined(this.inputElement.onselect)&&(this.inputElement.onselect=null),h.Input.destroy({element:this.inputElement,floatLabelType:this.floatLabelType,properties:this.properties,buttons:this.inputWrapper.container.querySelectorAll(".e-input-group-icon")[0]},this.clearButton),this.clearButton=null,this.inputElement=null,this.inputWrapper=null,m.prototype.destroy.call(this)}},n.prototype.getItems=function(){return this.list||(this.dataSource instanceof c.DataManager&&(this.initialRemoteRender=!0),this.renderList()),this.ulElement?m.prototype.getItems.call(this):[]},n.prototype.getDataByValue=function(e){return m.prototype.getDataByValue.call(this,e)},n.prototype.clear=function(){this.value=null},l([P.Property(null)],n.prototype,"cssClass",void 0),l([P.Property("100%")],n.prototype,"width",void 0),l([P.Property(!0)],n.prototype,"enabled",void 0),l([P.Property(!1)],n.prototype,"enablePersistence",void 0),l([P.Property("300px")],n.prototype,"popupHeight",void 0),l([P.Property("100%")],n.prototype,"popupWidth",void 0),l([P.Property(null)],n.prototype,"placeholder",void 0),l([P.Property(null)],n.prototype,"filterBarPlaceholder",void 0),l([P.Property({})],n.prototype,"htmlAttributes",void 0),l([P.Property(null)],n.prototype,"query",void 0),l([P.Property(null)],n.prototype,"valueTemplate",void 0),l([P.Property(null)],n.prototype,"headerTemplate",void 0),l([P.Property(null)],n.prototype,"footerTemplate",void 0),l([P.Property(!1)],n.prototype,"allowFiltering",void 0),l([P.Property(!0)],n.prototype,"isDeviceFullScreen",void 0),l([P.Property(!1)],n.prototype,"readonly",void 0),l([P.Property(!1)],n.prototype,"enableVirtualization",void 0),l([P.Property(!1)],n.prototype,"allowResize",void 0),l([P.Property(null)],n.prototype,"text",void 0),l([P.Property(null)],n.prototype,"value",void 0),l([P.Property(!1)],n.prototype,"allowObjectBinding",void 0),l([P.Property(null)],n.prototype,"index",void 0),l([P.Property("Never")],n.prototype,"floatLabelType",void 0),l([P.Property(!1)],n.prototype,"showClearButton",void 0),l([P.Event()],n.prototype,"filtering",void 0),l([P.Event()],n.prototype,"change",void 0),l([P.Event()],n.prototype,"beforeOpen",void 0),l([P.Event()],n.prototype,"open",void 0),l([P.Event()],n.prototype,"close",void 0),l([P.Event()],n.prototype,"blur",void 0),l([P.Event()],n.prototype,"focus",void 0),l([P.Event()],n.prototype,"resizeStop",void 0),l([P.Event()],n.prototype,"resizing",void 0),l([P.Event()],n.prototype,"resizeStart",void 0),l([P.NotifyPropertyChanges],n));function n(e,t){e=m.call(this,e,t)||this;return e.isListSearched=!1,e.preventChange=!1,e.isTouched=!1,e.isFocused=!1,e.autoFill=!1,e.isUpdateHeaderHeight=!1,e.isUpdateFooterHeight=!1,e.isReactTemplateUpdate=!1,e}ne=function(e,t){return(ne=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 ne,ae,l=function(e,t){function i(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},a=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},oe="e-rtl",re="e-ddt-hidden",he="e-input-group-icon e-ddt-icon e-icons",r="e-show-chip",ue="e-show-clear",pe="e-show-dd-icon",u="e-chip-input",de="e-input-focus",ce="e-input-group",me="e-icon-anim",fe="e-chips",ve="e-chipcontent",ge="e-chips-close",C="e-icon-hide",ye="e-ddt-icon-hide",Ce="e-list-parent",be="e-dropdown",Se="e-disabled",Ee="e-selectall-parent",xe="e-hide-selectall",Ie="e-all-text",we="e-frame",Oe="e-check",Ae="e-checkbox-wrapper",De="e-filter-wrap",ke="e-ddt-icon",Ne="e-ddt-footer",Le="e-ddt-header",Be="e-no-data",Te="e-remain",Ve="e-overflow",Pe="e-show-text",Ue="e-total-count",He="e-wrap-count",Fe=(ae=P.ChildProperty,l(p,ae),a([P.Property("child")],p.prototype,"child",void 0),a([P.Property([])],p.prototype,"dataSource",void 0),a([P.Property("expanded")],p.prototype,"expanded",void 0),a([P.Property("hasChildren")],p.prototype,"hasChildren",void 0),a([P.Property("htmlAttributes")],p.prototype,"htmlAttributes",void 0),a([P.Property("iconCss")],p.prototype,"iconCss",void 0),a([P.Property("imageUrl")],p.prototype,"imageUrl",void 0),a([P.Property("parentValue")],p.prototype,"parentValue",void 0),a([P.Property(null)],p.prototype,"query",void 0),a([P.Property("selectable")],p.prototype,"selectable",void 0),a([P.Property("selected")],p.prototype,"selected",void 0),a([P.Property(null)],p.prototype,"tableName",void 0),a([P.Property("text")],p.prototype,"text",void 0),a([P.Property("tooltip")],p.prototype,"tooltip",void 0),a([P.Property("value")],p.prototype,"value",void 0),p);function p(){return null!==ae&&ae.apply(this,arguments)||this}We=P.ChildProperty,l(Me,We),a([P.Property(!1)],Me.prototype,"autoCheck",void 0),a([P.Property(!0)],Me.prototype,"checkDisabledChildren",void 0),a([P.Property("Auto")],Me.prototype,"expandOn",void 0),a([P.Property(!1)],Me.prototype,"loadOnDemand",void 0);var We,qe=Me;function Me(){return null!==We&&We.apply(this,arguments)||this}je=P.Component,l(b,je),b.prototype.getPersistData=function(){return this.addOnPersist(["value"])},b.prototype.getLocaleName=function(){return"drop-down-tree"},b.prototype.preRender=function(){this.inputFocus=!1,this.isPopupOpen=!1,this.isFirstRender=!0,this.isInitialized=!1,this.currentText=null,this.currentValue=null,this.oldValue=null,this.removeValue=!1,this.selectedText=[],this.treeItems=[],this.dataValue=null,this.isNodeSelected=!1,this.isDynamicChange=!1,this.clearIconWidth=0,this.headerTemplateId=this.element.id+"HeaderTemplate",this.footerTemplateId=this.element.id+"FooterTemplate",this.actionFailureTemplateId=this.element.id+"ActionFailureTemplate",this.noRecordsTemplateId=this.element.id+"NoRecordsTemplate",this.customTemplateId=this.element.id+"CustomTemplate",this.keyConfigs={escape:"escape",altUp:"alt+uparrow",altDown:"alt+downarrow",tab:"tab",shiftTab:"shift+tab",end:"end",enter:"enter",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",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",ctrlA:"ctrl+A"}},b.prototype.render=function(){var e=P.select("#"+this.element.id+"_tree",document),t=(e&&(t=P.select("#"+this.element.id+"_options",document),P.detach(t||e.parentElement)),"INPUT"===this.element.tagName?(this.inputEle=this.element,P.isNullOrUndefined(this.inputEle.getAttribute("role"))&&(this.inputEle.setAttribute("aria-expanded","false"),this.inputEle.setAttribute("role","combobox"),this.inputEle.setAttribute("aria-haspopup","tree"),this.inputEle.setAttribute("aria-controls",this.element.id+"_options")),P.isNullOrUndefined(this.inputEle.getAttribute("type"))&&this.inputEle.setAttribute("type","text")):(P.isNullOrUndefined(this.element.id)?this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text"}}):this.inputEle=this.createElement("input",{attrs:{role:"textbox",type:"text",id:this.element.id+"_textbox"}}),this.element.parentElement.insertBefore(this.inputEle,this.element)),this.inputObj=h.Input.createInput({element:this.inputEle,floatLabelType:this.floatLabelType,buttons:this.showDropDownIcon?[he]:null,properties:{readonly:!0,placeholder:this.placeholder,enabled:this.enabled,cssClass:this.cssClass,enableRtl:this.enableRtl}},this.createElement),this.inputWrapper=this.inputObj.container,this.inputWrapper.classList.contains(ce)||this.inputWrapper.classList.add(ce),this.showDropDownIcon&&this.inputWrapper.classList.add(pe),this.element.tagName===this.getDirective()&&this.element.appendChild(this.inputWrapper),this.createHiddenElement(),this.createClearIcon(),this.inputWrapper.classList.add("e-ddt"),this.setElementWidth(this.width),this.updateDataAttribute(),this.setHTMLAttributes(),this.setAttributes(),this.popupDiv=this.createElement("div",{className:"e-popup-content"}),this.popupDiv.classList.add(be),this.tree=this.createElement("div",{id:this.element.id+"_tree"}),this.popupDiv.appendChild(this.tree),this.destroyPopupOnHide||document.body.appendChild(this.popupDiv),this.wireTreeEvents(),P.addClass([this.popupDiv],ye),this.renderTree(),this.isRemoteData=this.fields.dataSource instanceof c.DataManager,(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.createChip(),this.wrapText||"Custom"===this.mode||(this.overFlowWrapper=this.createElement("span",{className:Ve+" "+C}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement),"Box"!==this.mode&&P.addClass([this.overFlowWrapper],Pe))),this.isRemoteData||(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText)||this.updateView(),this.wireEvents(),P.select("."+Ce,this.treeObj.element));t&&t.getAttribute("aria-multiselectable")&&t.removeAttribute("aria-multiselectable"),this.setOldValue(),this.isRemoteData||(this.isInitialized=!0),this.hasTemplate=this.itemTemplate||this.headerTemplate||this.footerTemplate||this.actionFailureTemplate||this.noRecordsTemplate||this.customTemplate||this.valueTemplate,this.renderComplete()},b.prototype.hideCheckAll=function(e){var t=P.isNullOrUndefined(this.popupEle)?null:this.popupEle.querySelector("."+Ee);P.isNullOrUndefined(t)||(e&&!t.classList.contains(xe)?P.addClass([t],xe):!e&&t.classList.contains(xe)&&P.removeClass([t],xe))},b.prototype.renderFilter=function(){this.filterContainer=this.createElement("div",{id:this.element.id+"_filter_wrap",className:De});var e=this.createElement("input",{id:this.element.id+"_filter",attrs:{autocomplete:"off","aria-label":this.filterBarPlaceholder}});this.filterContainer.appendChild(e),P.prepend([this.filterContainer],this.popupEle),this.filterObj=new h.TextBox({value:"",showClearButton:!0,placeholder:this.filterBarPlaceholder,input:this.filterChangeHandler.bind(this)}),this.filterObj.appendTo("#"+this.element.id+"_filter"),this.keyboardModule=new P.KeyboardEvents(this.filterObj.element,{keyAction:this.filterKeyAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.filterKeyAction=function(t){var i,s=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"altUp":s.isPopupOpen&&s.hidePopup();break;case"shiftTab":P.addClass([s.inputWrapper],[de]);break;case"moveDown":t.preventDefault(),s.filterObj.element.blur(),(i=s.treeObj.element.querySelector("li"))&&i.focus()}})},b.prototype.filterChangeHandler=function(e){var t=this;P.isNullOrUndefined(e.value)||(window.clearTimeout(this.filterTimer),this.filterTimer=window.setTimeout(function(){t.filterHandler(e.value,e.event)},this.filterDelayTime))},b.prototype.isChildObject=function(){return"object"==typeof this.treeObj.fields.child},b.prototype.filterHandler=function(e,t){var l=this,i=(this.isFromFilterChange=!0,this.isFilteredData||(this.isRemoteData&&(this.treeObj.expandedNodes=[]),this.treeData=this.treeObj.getTreeData()),this.cloneFields(this.fields)),t={cancel:!1,preventDefaultAction:!1,event:t,text:e.trim(),fields:i};this.trigger("filtering",t,function(e){if(!e.cancel){var t=!1,i=void 0;if(l.isFilteredData=!0,""===e.text?(l.isFilteredData=!1,l.isFilterRestore=!0,i=l.cloneFields(l.fields),l.treeObj.element.classList.remove("e-filtering")):(e.preventDefaultAction?i=e.fields:1===l.treeDataType?i=l.selfReferencefilter(e.text,e.fields):l.fields.dataSource instanceof c.DataManager?((i=l.remoteDataFilter(e.text,e.fields)).child=l.fields.child,l.treeObj.fields=l.getTreeFields(e.fields),l.treeObj.dataBind(),t=!0):i=l.nestedFilter(e.text,e.fields),l.treeObj.element.classList.add("e-filtering")),l.hideCheckAll(l.isFilteredData),!t&&(l.isRemoteData&&(l.isChildObject()?i.child=l.fields.child:i=e.fields),l.treeObj.fields=l.getTreeFields(i),l.treeObj.dataBind(),l.popupObj&&l.popupObj.refreshPosition(),l.hasTemplate&&l.portals&&l.treeObj.portals)){for(var s=0;s<l.treeObj.portals.length;s++)-1===l.portals.indexOf(l.treeObj.portals[s])&&l.portals.push(l.treeObj.portals[s]);l.isReact&&l.renderReactTemplates()}}})},b.prototype.remoteDataFilter=function(t,e){var i=this;return e.dataSource=this.treeData.map(function(e){return i.remoteChildFilter(t,e)}).filter(function(e){return!P.isNullOrUndefined(e)}),e},b.prototype.remoteChildFilter=function(e,t,i,s){var l=this.isChildObject()?t.child:t[this.fields.child];if(P.isNullOrUndefined(l))return this.isMatchedNode(e,t,i,s)?t:null;for(var n=[],a=0;a<l.length;a++){var o=this.remoteChildFilter(e,l[a],!0,!0);P.isNullOrUndefined(o)||n.push(o)}i=Object.assign({},t);return s=!1,0!==n.length?i.child=n:(i.child=null,i=this.isMatchedNode(e,i)?i:null),i},b.prototype.nestedFilter=function(e,t){for(var i=[],s=0;s<this.treeData.length;s++){var l=this.nestedChildFilter(e,this.treeData[parseInt(s.toString(),10)]);P.isNullOrUndefined(l)||i.push(l)}return t.dataSource=i,t},b.prototype.nestedChildFilter=function(e,t){var i=t[this.fields.child];if(P.isNullOrUndefined(i))return this.isMatchedNode(e,t)?t:null;for(var s=[],l=0;l<i.length;l++){var n=this.nestedChildFilter(e,i[parseInt(l.toString(),10)]);P.isNullOrUndefined(n)||s.push(n)}t=Object.assign({},t);return 0!==s.length?(t[this.fields.child]=s,t):(t[this.fields.child]=null,this.isMatchedNode(e,t)?t:null)},b.prototype.selfReferencefilter=function(e,t){for(var i=[],s=[],l=0;l<this.treeData.length;l++)this.isMatchedNode(e,this.treeData[l])&&i.push(this.treeData[l]);for(l=0;l<i.length;l++)if(-1===s.indexOf(i[l])){s.push(i[l]);for(var n=i[parseInt(l.toString(),10)][this.fields.parentValue];!P.isNullOrUndefined(n);){for(var a=null,o=0;o<this.treeData.length;o++){var r=this.treeData[parseInt(o.toString(),10)][this.fields.value];if(!P.isNullOrUndefined(r)&&r===n){a=this.treeData[o];break}}if(P.isNullOrUndefined(a)||-1!==s.indexOf(a))break;s.push(a),n=a[this.fields.parentValue]}}return t.dataSource=s,t},b.prototype.isMatchedNode=function(e,t,i,s){i=i&&s&&this.isChildObject()?t[this.fields.child.text]:t[this.fields.text];if(!i&&!P.isNullOrUndefined(this.fields.child.text)){for(var l=this.fields.child;!t[l.text];)l=l.child;i=t[l.text]}return this.ignoreCase&&(i=i.toLowerCase(),e=e.toLowerCase()),this.ignoreAccent&&(i=c.DataUtil.ignoreDiacritics(i),e=c.DataUtil.ignoreDiacritics(e)),"StartsWith"===this.filterType?i.slice(0,e.length)===e:"EndsWith"===this.filterType?i.slice(-e.length)===e:-1!==i.indexOf(e)},b.prototype.wireEvents=function(){P.EventHandler.add(this.inputWrapper,"mouseup",this.dropDownClick,this),P.EventHandler.add(this.inputWrapper,"focus",this.focusIn,this),P.EventHandler.add(this.inputWrapper,"blur",this.focusOut,this),P.EventHandler.add(this.inputWrapper,"mousemove",this.mouseIn,this),P.EventHandler.add(this.inputWrapper,"mouseout",this.onMouseLeave,this),P.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),P.EventHandler.add(window,"resize",this.windowResize,this);var e=P.closest(this.inputWrapper,"form");e&&P.EventHandler.add(e,"reset",this.resetValueHandler,this),this.keyboardModule=new P.KeyboardEvents(this.inputWrapper,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.wireTreeEvents=function(){this.keyboardModule=new P.KeyboardEvents(this.tree,{keyAction:this.treeAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.wireCheckAllWrapperEvents=function(){this.keyboardModule=new P.KeyboardEvents(this.checkAllParent,{keyAction:this.checkAllAction.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})},b.prototype.unWireEvents=function(){P.EventHandler.remove(this.inputWrapper,"mouseup",this.dropDownClick),P.EventHandler.remove(this.inputWrapper,"focus",this.focusIn),P.EventHandler.remove(this.inputWrapper,"blur",this.focusOut),P.EventHandler.remove(this.inputWrapper,"mousemove",this.mouseIn),P.EventHandler.remove(this.inputWrapper,"mouseout",this.onMouseLeave),P.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),P.EventHandler.remove(window,"resize",this.windowResize);var e=P.closest(this.inputWrapper,"form");e&&P.EventHandler.remove(e,"reset",this.resetValueHandler),this.keyboardModule.destroy(),this.showSelectAll&&this.checkAllParent&&P.EventHandler.remove(this.checkAllParent,"mouseup",this.clickHandler),document.removeEventListener("mousedown",this.documentClickContext)},b.prototype.dropDownClick=function(e){this.enabled&&!this.readonly&&(this.isClearButtonClick?this.isClearButtonClick=!1:(this.isPopupOpen?this.hidePopup():(this.focusIn(e),this.renderPopup()),this.showOverAllClear()))},b.prototype.mouseIn=function(){!this.enabled&&this.readonly||this.showOverAllClear()},b.prototype.onMouseLeave=function(){this.inputFocus||(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ue))},b.prototype.getDirective=function(){return"EJS-DROPDOWNTREE"},b.prototype.focusOut=function(e){var t;!this.enabled||this.readonly||!this.inputFocus||(P.Browser.isIE||"edge"===P.Browser.info.name)&&e.target===this.inputWrapper||(t=e.relatedTarget)===this.inputEle||!P.isNullOrUndefined(t)||e.target===this.inputWrapper&&this.isPopupOpen||this.onFocusOut(e)},b.prototype.onFocusOut=function(e){var t;this.inputFocus=!1,this.isPopupOpen&&this.hidePopup(),this.isClearButtonClick&&(this.isClearButtonClick=!1),this.showClearButton&&(this.clearIconWidth=P.select(".e-clear-icon",this.inputWrapper).offsetWidth,P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ue)),P.removeClass([this.inputWrapper],[de]),(this.allowMultiSelection||this.showCheckBox)&&(t=!!this.value&&!!this.value.length,"Delimiter"!==this.mode&&"Custom"!==this.mode&&this.chipWrapper&&"Default"===this.mode&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u)),t&&"Custom"!==this.mode&&this.showOrHideValueTemplate(!0),!this.wrapText)&&t&&this.updateView(),this.changeOnBlur&&this.triggerChangeEvent(e),this.removeValue=!1,this.setOldValue(),this.trigger("blur")},b.prototype.updateView=function(){!this.showCheckBox&&!this.allowMultiSelection||"Custom"===this.mode||this.inputFocus||("Box"!==this.mode?P.addClass([this.inputWrapper,this.overFlowWrapper],Pe):P.addClass([this.inputWrapper],r),this.value&&0!==this.value.length&&(this.inputWrapper.contains(this.chipWrapper)&&P.addClass([this.chipWrapper],C),P.addClass([this.inputEle],u),this.updateOverFlowView()),this.ensurePlaceHolder())},b.prototype.triggerChangeEvent=function(e){this.ddtCompareValues(this.oldValue,this.value)&&!this.isChipDelete||this.removeValue||(e={e:e,oldValue:this.oldValue,value:this.value,isInteracted:!!e,element:this.element},this.trigger("change",e),this.setOldValue())},b.prototype.ddtCompareValues=function(e,t){if(null===e||null===t)return(null===e||0===e.length)&&t===e;if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0},b.prototype.focusIn=function(e){!this.enabled||this.readonly||this.inputFocus||(this.showOverAllClear(),this.inputFocus=!0,P.addClass([this.inputWrapper],[de]),(this.allowMultiSelection||this.showCheckBox)&&("Delimiter"!==this.mode&&this.inputFocus&&(this.chipWrapper&&this.value&&0!==this.value.length&&(P.removeClass([this.chipWrapper],C),P.addClass([this.inputEle],u),this.showOrHideValueTemplate(!1,!0)),P.addClass([this.inputWrapper],r),this.popupObj)&&this.popupObj.refreshPosition(),this.wrapText||"Custom"===this.mode||(this.inputWrapper.contains(this.overFlowWrapper)&&P.addClass([this.overFlowWrapper],C),"Delimiter"===this.mode?(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u),this.showOrHideValueTemplate(!0)):P.addClass([this.inputWrapper],r),P.removeClass([this.inputWrapper],Pe),this.ensurePlaceHolder())),this.trigger("focus",{isInteracted:!!e,event:e}))},b.prototype.treeAction=function(t){var i=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(e.cancel)t.stopImmediatePropagation();else switch(t.action){case"escape":case"altUp":i.inputWrapper.focus(),t.preventDefault(),i.isPopupOpen&&i.hidePopup();break;case"tab":i.isPopupOpen&&i.hidePopup();break;case"enter":case"ctrlEnter":case"shiftEnter":case"csEnter":i.showCheckBox||(i.isValueChange=!0,i.keyEventArgs=t);break;case"space":i.isValueChange=!0,i.keyEventArgs=t;break;case"ctrlA":i.allowMultiSelection&&i.selectAll(!0)}})},b.prototype.keyActionHandler=function(t){var i=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"escape":case"altUp":i.isPopupOpen&&i.hidePopup();break;case"shiftTab":i.isPopupOpen&&i.hidePopup(),i.inputFocus&&i.onFocusOut();break;case"altDown":i.isPopupOpen||(i.showPopup(),t.preventDefault());break;case"moveDown":i.showSelectAll&&i.showCheckBox&&i.checkAllParent.focus();break;case"tab":!i.isPopupOpen&&i.inputFocus&&i.onFocusOut()}})},b.prototype.checkAllAction=function(t){var i,s=this;this.trigger("keyPress",{cancel:!1,event:t},function(e){if(!e.cancel)switch(t.action){case"space":s.clickHandler(t);break;case"moveDown":t.preventDefault(),(i=s.treeObj.element.querySelector('li[tabindex="0"]')||s.treeObj.element.querySelector("li")).focus(),P.addClass([i],["e-node-focus"])}})},b.prototype.windowResize=function(){this.popupObj&&(this.popupObj.setProperties({width:this.setWidth()}),this.popupObj.refreshPosition())},b.prototype.resetValueHandler=function(e){var t=P.closest(this.inputWrapper,"form");t&&e.target===t&&(this.isDynamicChange=!0,this.setProperties({value:null},!0),this.resetValue(!0),this.isDynamicChange=!1)},b.prototype.getAriaAttributes=function(){return{}},b.prototype.updateOverFlowView=function(){if(this.overFlowWrapper.classList.remove(Ue),P.removeClass([this.overFlowWrapper],C),this.value&&this.value.length){var e,t="",i=void 0,s=void 0,l=1,n=void 0,a=void 0,o=0,r=(this.overFlowWrapper.innerHTML="",this.l10n=new P.L10n(this.getLocaleName(),{overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"},this.locale),this.l10n.getConstant("overflowCountTemplate")),h=this.l10n.getConstant("totalCountTemplate"),u=this.createElement("span",{className:Te}),p=(this.overFlowWrapper.appendChild(u),u.innerText=r.replace("${count}",this.value.length.toString()),u.offsetWidth);if(P.remove(u),this.showDropDownIcon&&(o=P.select("."+ke,this.inputWrapper).offsetWidth),!P.isNullOrUndefined(this.value))if("Box"!==this.mode){if(this.valueTemplate)return a=this.updateChipAndValueTemplate(!1,o,p),this.checkRemainingTemplate(a,u,r,h),void this.updateDelimMode();for(var d=0;!P.isNullOrUndefined(this.value[d]);d++){if(t=(t+=0===d?"":this.delimiterChar+" ")+(i=this.getOverflowVal(d)),i=this.overFlowWrapper.innerHTML,this.enableHtmlSanitizer?this.overFlowWrapper.innerText=P.SanitizeHtmlHelper.sanitize(t):this.overFlowWrapper.innerHTML=t,n=this.overFlowWrapper.offsetWidth,e=this.inputWrapper.offsetWidth,n+o+this.clearIconWidth>e){for(void 0!==s&&""!==s&&(i=s,d=l+1),this.overFlowWrapper.innerHTML=i,a=this.value.length-d,n=this.overFlowWrapper.offsetWidth;n+p+o+this.clearIconWidth>=e&&0!==n&&""!==this.overFlowWrapper.innerHTML;){var c=this.overFlowWrapper.innerHTML.split(this.delimiterChar);c.pop(),this.overFlowWrapper.innerHTML=c.join(this.delimiterChar),a++,n=this.overFlowWrapper.offsetWidth}break}n+p+o+this.clearIconWidth<=e?(s=t,l=d):0===d&&(s="",l=-1)}}else a=this.updateChipAndValueTemplate(!0,o,p);this.checkRemainingTemplate(a,u,r,h)}else this.overFlowWrapper.innerHTML="",P.addClass([this.overFlowWrapper],C);this.updateDelimMode()},b.prototype.checkRemainingTemplate=function(e,t,i,s){0<e&&this.overFlowWrapper.appendChild(this.updateRemainTemplate(t,e,i,s)),"Box"!==this.mode||this.overFlowWrapper.classList.contains(Ue)||P.addClass([t],He)},b.prototype.updateChipAndValueTemplate=function(e,t,i){void 0===t&&(t=0);for(var s,l,n,a,o,r,h=1,u=(P.addClass([e?this.chipWrapper:this.valueTemplateContainer],C),(e?this.chipWrapper:this.valueTemplateContainer).cloneNode(!0)),p=e?P.selectAll("."+fe,u):Array.prototype.slice.call(u.children),d=0;d<p.length;d++){if(n=this.overFlowWrapper.innerHTML,this.overFlowWrapper.appendChild(p[d]),s=this.overFlowWrapper.innerHTML,o=this.overFlowWrapper.offsetWidth,l=this.inputWrapper.offsetWidth,o+t+this.clearIconWidth>l){for(void 0!==a&&""!==a&&(n=a,d=h+1),this.overFlowWrapper.innerHTML=n,r=this.value.length-d,o=this.overFlowWrapper.offsetWidth;o+i+t+this.clearIconWidth>=l&&0!==o&&""!==this.overFlowWrapper.innerHTML;)this.overFlowWrapper.removeChild(this.overFlowWrapper.lastChild),r++,o=this.overFlowWrapper.offsetWidth;break}o+i+t+this.clearIconWidth<=l?(a=s,h=d):0===d&&(a="",h=-1)}return r},b.prototype.updateRemainTemplate=function(e,t,i,s){return this.overFlowWrapper.firstChild&&3===this.overFlowWrapper.firstChild.nodeType&&""===this.overFlowWrapper.firstChild.nodeValue&&this.overFlowWrapper.removeChild(this.overFlowWrapper.firstChild),e.innerHTML="",e.innerText=(this.overFlowWrapper.firstChild&&(3===this.overFlowWrapper.firstChild.nodeType||"Box"===this.mode||this.valueTemplateContainer)?i:s).replace("${count}",t.toString()),!this.overFlowWrapper.firstChild||3!==this.overFlowWrapper.firstChild.nodeType&&"Box"!==this.mode?(P.addClass([this.overFlowWrapper],Ue),P.removeClass([this.overFlowWrapper],He)):P.removeClass([this.overFlowWrapper],Ue),e},b.prototype.getOverflowVal=function(e){e=this.getSelectedData(this.value[parseInt(e.toString(),10)]);return P.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",e)},b.prototype.updateDelimMode=function(){"Box"!==this.mode?P.select("."+Te,this.overFlowWrapper)&&!this.overFlowWrapper.classList.contains(Ue)?(P.addClass([this.overFlowWrapper],He),P.addClass([this.overFlowWrapper],Pe)):(this.overFlowWrapper.classList.remove(He),P.removeClass([this.overFlowWrapper],He)):P.select("."+Te,this.overFlowWrapper)&&this.overFlowWrapper.classList.remove(He)},b.prototype.createHiddenElement=function(){this.allowMultiSelection||this.showCheckBox?this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:re,tabindex:"-1",multiple:"","aria-label":this.getModuleName()}}):this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",tabindex:"-1",class:re,"aria-label":this.getModuleName()}}),P.prepend([this.hiddenElement],this.inputWrapper),this.validationAttribute()},b.prototype.createClearIcon=function(){this.overAllClear=this.createElement("span",{className:"e-clear-icon e-icons"}),P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ue),this.showClearButton&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},b.prototype.validationAttribute=function(){for(var e=this.inputEle.getAttribute("name")?this.inputEle.getAttribute("name"):this.inputEle.getAttribute("id"),t=(this.hiddenElement.setAttribute("name",e),this.inputEle.removeAttribute("name"),["required","aria-required","form"]),i=0;i<t.length;i++){var s=this.inputEle.getAttribute(t[i]);s&&(this.hiddenElement.setAttribute(t[i],s),this.inputEle.removeAttribute(t[i]))}},b.prototype.createChip=function(){this.inputWrapper.contains(this.chipWrapper)||(this.chipWrapper=this.createElement("span",{className:"e-chips-wrapper"}),this.chipCollection=this.createElement("span",{className:"e-chips-collection"}),this.chipWrapper.appendChild(this.chipCollection),this.inputWrapper.insertBefore(this.chipWrapper,this.hiddenElement),P.addClass([this.inputWrapper],r),this.getValidMode()&&null!==this.value&&this.value&&0!==this.value.length?P.addClass([this.inputEle],u):(null===this.value||this.value&&0===this.value.length||this.checkWrapper)&&P.addClass([this.chipWrapper],C))},b.prototype.getValidMode=function(){return!(!this.allowMultiSelection&&!this.showCheckBox||"Box"!==this.mode&&("Default"!==this.mode||!this.inputFocus))},b.prototype.createSelectAllWrapper=function(){this.checkAllParent=this.createElement("div",{className:Ee,attrs:{tabindex:"0"}}),this.selectAllSpan=this.createElement("span",{className:Ie}),this.selectAllSpan.textContent="";var e=P.closest(this.element,".e-bigger"),e=P.isNullOrUndefined(e)?"":"e-small";this.checkBoxElement=H.createCheckBox(this.createElement,!0,{cssClass:e}),this.checkBoxElement.setAttribute("role","checkbox"),this.checkAllParent.appendChild(this.checkBoxElement),this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),P.EventHandler.add(this.checkAllParent,"mouseup",this.clickHandler,this),this.wireCheckAllWrapperEvents()},b.prototype.clickHandler=function(e){var t=e.currentTarget&&e.currentTarget.classList.contains(Ee)?e.currentTarget.firstElementChild.lastElementChild:e.target;this.checkWrapper=P.closest(t,"."+Ae),P.isNullOrUndefined(this.checkWrapper)||(this.isClicked=!0,t=P.select("."+we,this.checkWrapper),this.changeState(this.checkWrapper,t.classList.contains(Oe)?"uncheck":"check",e),this.isClicked=!1),e.preventDefault()},b.prototype.changeState=function(e,t,i){var s,l=e.getElementsByClassName(we)[0];"check"!==t||l.classList.contains(Oe)?"uncheck"===t&&l.classList.contains(Oe)&&(l.classList.remove(Oe),s="false",this.isReverseUpdate||(this.treeObj.uncheckAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!1)):(l.classList.add(Oe),s="true",this.isReverseUpdate||(this.setOldValue(),this.isCheckAllCalled=!0,this.treeObj.checkAll(),this.changeOnBlur)||this.triggerChangeEvent(i),this.setLocale(!0)),this.setMultiSelect(),this.ensurePlaceHolder(),P.isNullOrUndefined(s="check"===t?"true":"false")||e.parentElement.setAttribute("aria-checked",s)},b.prototype.setLocale=function(e){if(this.selectAllSpan)if("Select All"!==this.selectAllText||"Unselect All"!==this.unSelectAllText){var t=e?this.unSelectAllText:this.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=P.compile(t)({},this,e?"unSelectAllText":"selectAllText",null,!this.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else this.selectAllSpan.textContent=e?this.unSelectAllText:this.selectAllText},b.prototype.setAttributes=function(){this.inputEle.setAttribute("tabindex","-1"),this.inputEle.setAttribute("aria-label",this.getModuleName());var e=this.element.getAttribute("id");this.hiddenElement.id=e+"_hidden",this.inputWrapper.setAttribute("tabindex",this.inputWrapper.classList.contains("e-disabled")?"-1":"0"),this.inputWrapper.setAttribute("aria-label",this.getModuleName()),P.attributes(this.inputWrapper,this.getAriaAttributes())},b.prototype.setHTMLAttributes=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];"class"===i?this.inputWrapper.classList.add(this.htmlAttributes[""+i]):"disabled"===i?(this.setProperties({enabled:!1},!0),this.setEnable()):"readonly"===i?(this.setProperties({readonly:!0},!0),this.dataBind()):"style"===i?this.inputWrapper.style.cssText=this.htmlAttributes[""+i]:0===i.indexOf("data")||-1<["name","required"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","id","placeholder","aria-placeholder","role","autocorrect","autocomplete","autocapitalize","spellcheck","minlength","maxlength"].indexOf(i)&&"placeholder"===i?h.Input.setPlaceholder(this.htmlAttributes[""+i],this.inputEle):this.inputEle.setAttribute(i,this.htmlAttributes[""+i])}},b.prototype.updateDataAttribute=function(){for(var e=this.htmlAttributes,t=["class","style","id","type"],i={},s=0;s<this.element.attributes.length;s++)-1===t.indexOf(this.element.attributes[s].name)&&"readonly"!==this.element.attributes[s].name&&(i[this.element.attributes[s].name]=this.element.getAttribute(this.element.attributes[s].name));P.extend(i,e,i),this.setProperties({htmlAttributes:i},!0)},b.prototype.showOverAllClear=function(){this.enabled&&!this.readonly&&this.overAllClear&&(!!this.value&&!!this.value.length&&this.showClearButton?(P.removeClass([this.overAllClear],C),P.addClass([this.inputWrapper],ue)):(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ue)))},b.prototype.setTreeValue=function(){if(null!==this.value&&0!==this.value.length){var e=void 0;if(this.showCheckBox||this.allowMultiSelection){for(var t=this.value.length-1;0<=t;t--)e=this.treeObj.getTreeData(this.value[t])[0],P.isNullOrUndefined(e)&&this.value.splice(t,1);0!==this.value.length&&this.setValidValue()}else e=this.treeObj.getTreeData(this.value[0])[0],P.isNullOrUndefined(e)?this.setProperties({value:this.currentValue},!0):(this.setProperties({text:e[this.fields.text]},!0),this.setValidValue())}},b.prototype.setTreeText=function(){if((null===this.value||this.isInitialized)&&null!==this.text){var e=void 0,t=[];if(this.showCheckBox||this.allowMultiSelection){for(var i=this.text.split(this.delimiterChar),s=0;s<i.length;s++)e=this.getItems(i[s]),P.isNullOrUndefined(e)||t.push(e[this.fields.value].toString());0!==t.length?(this.setOldValue(),this.setProperties({value:t},!0),this.setValidValue()):this.setProperties({text:this.currentText},!0)}else e=this.getItems(this.text),P.isNullOrUndefined(e)?this.setProperties({text:this.currentText},!0):(this.setOldValue(),this.setProperties({value:[e[this.fields.value].toString()]},!0),this.setValidValue())}},b.prototype.setSelectedValue=function(){null!==this.value&&0!==this.value.length||this.isInitialized||(this.setOldValue(),0<this.treeObj.selectedNodes.length&&!this.showCheckBox?(this.setProperties({value:this.treeObj.selectedNodes},!0),this.allowMultiSelection&&this.updateMode()):this.showCheckBox&&this.treeObj.checkedNodes&&0<this.treeObj.checkedNodes.length&&(this.setProperties({value:this.treeObj.checkedNodes},!0),P.setValue("selectedNodes",[],this.treeObj),this.treeObj.dataBind(),this.updateMode()),this.updateSelectedValues(),this.currentText=this.text,this.currentValue=this.value)},b.prototype.setValueTemplate=function(){var e,t=this;this.valueTemplate&&(e=this.initializeValueTemplate(),this.getValueTemplateElement(this.value[0],e),this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(e){return!t.portals.includes(e)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),this.showOrHideValueTemplate(!0))},b.prototype.getValueTemplateElement=function(e,t){t=t(this.getNodeData(e,this.isFilteredData?this.treeData:this.treeItems),this,"valueTemplate",this.element.id+"valueTemplate",this.isStringTemplate,void 0,this.valueTemplateContainer);t&&(t=Array.prototype.slice.call(t),P.append(t,this.valueTemplateContainer))},b.prototype.setValidValue=function(){var e,t=this;this.showCheckBox||this.allowMultiSelection?(this.showCheckBox?(this.value.length!==this.treeObj.checkedNodes.length||0<this.value.filter(function(e){return-1===t.treeObj.checkedNodes.indexOf(e)}).length||this.treeSettings.autoCheck)&&(this.treeObj.checkedNodes=this.value.slice(),this.treeObj.dataBind(),this.setMultiSelect()):(this.treeObj.selectedNodes=this.value.slice(),this.selectedText=[],this.updateSelectedValues()),this.treeObj.dataBind()):(h.Input.setValue(this.text,this.inputEle,this.floatLabelType),this.setValueTemplate(),e=this.value[0].toString(),this.treeObj.selectedNodes[0]!==e&&(P.setValue("selectedNodes",[e],this.treeObj),this.fields.dataSource instanceof c.DataManager)&&this.updateSelectedValues()),this.currentText=this.text,this.currentValue=this.value,!P.isNullOrUndefined(this.value)&&0<this.value.length&&!P.isNullOrUndefined(this.currentText)&&this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")),this.isInitialized&&this.triggerChangeEvent()},b.prototype.getItems=function(e){var t;if(1===this.treeDataType)for(var i=0;i<this.treeItems.length;i++){var s=P.getValue(this.fields.text,this.treeItems[parseInt(i.toString(),10)]);if(!P.isNullOrUndefined(this.treeItems[i])&&!P.isNullOrUndefined(s)&&s===e){t=this.treeItems[i];break}}else t=this.getNestedItems(this.treeItems,this.fields,e);return t},b.prototype.getNestedItems=function(e,t,i){for(var s=0,l=e.length;s<l;s++){var n=P.getValue(this.fields.text,e[parseInt(s.toString(),10)]);if(e[s]&&n&&n.toString()===i)return e[s];if("string"!=typeof t.child||P.isNullOrUndefined(P.getValue(t.child,e[s]))){if(this.fields.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(P.getValue("child",e[s])))if(void 0!==(a=this.getNestedItems(P.getValue("child",e[parseInt(s.toString(),10)]),this.getChildType(t),i)))break}else{var a,n=P.getValue(t.child,e[parseInt(s.toString(),10)]);if(void 0!==(a=this.getNestedItems(n,this.getChildType(t),i)))break}}return a},b.prototype.getChildType=function(e){return"string"==typeof e.child||P.isNullOrUndefined(e.child)?e:e.child},b.prototype.renderTree=function(){this.treeObj=new F.TreeView({fields:this.getTreeFields(this.fields),enableRtl:this.enableRtl,nodeSelected:this.onNodeSelected.bind(this),nodeChecked:this.onNodeChecked.bind(this),nodeChecking:this.beforeCheck.bind(this),nodeExpanded:this.onNodeExpanded.bind(this),actionFailure:this.onActionFailure.bind(this),nodeClicked:this.onNodeClicked.bind(this),dataBound:this.OnDataBound.bind(this),allowMultiSelection:this.allowMultiSelection,enableHtmlSanitizer:this.enableHtmlSanitizer,showCheckBox:this.showCheckBox,autoCheck:this.treeSettings.autoCheck,sortOrder:this.sortOrder,expandOn:this.treeSettings.expandOn,loadOnDemand:this.treeSettings.loadOnDemand,nodeSelecting:this.onBeforeSelect.bind(this),nodeTemplate:this.itemTemplate,checkDisabledChildren:this.treeSettings.checkDisabledChildren}),this.treeObj.root=this.root||this,this.treeObj.appendTo(this.tree)},b.prototype.renderPopup=function(){var s=this,l=(this.isFilteredData&&(this.treeObj.element.classList.remove("e-filtering"),this.filterObj.value="",this.treeObj.fields=this.getTreeFields(this.fields),this.isFilterRestore=!0,this.isFilteredData=!1,this.hideCheckAll(!1)),!1);this.trigger("beforeOpen",{cancel:!1},function(e){var t,i;e.cancel?l=!0:(P.addClass([s.inputWrapper],[me]),s.isFirstRender?(s.popupEle=s.createElement("div",{id:s.element.id+"_options",className:"e-ddt e-popup "+(null!=s.cssClass?s.cssClass:"")}),s.popupEle.setAttribute("role","region"),s.popupEle.setAttribute("aria-label",s.element.id),document.body.appendChild(s.popupEle),s.createPopup(s.popupEle)):(s.popupEle=s.popupObj.element,s.isReact&&s.isFilterRestore&&(s.treeObj.refresh(),s.isFilteredData=!0,s.popupEle.removeChild(s.filterContainer)))),(s.isFirstRender&&!l||s.isFilteredData)&&(s.isFilteredData=!1,P.prepend([s.popupDiv],s.popupEle),P.removeClass([s.popupDiv],ye),s.allowFiltering&&s.renderFilter(),s.showCheckBox&&s.showSelectAll&&!s.popupDiv.classList.contains(Be)&&(s.createSelectAllWrapper(),s.popupEle.insertBefore(s.checkAllParent,s.popupDiv)),s.headerTemplate&&s.setHeaderTemplate(),s.footerTemplate&&s.setFooterTemplate(),s.isFirstRender=!1,s.hasTemplate)&&s.portals&&(s.treeObj.portals&&(s.portals=s.portals.concat(s.treeObj.portals.filter(function(e){return!s.portals.includes(e)}))),s.isReact)&&s.renderReactTemplates(s.reactCallBack),l||(P.attributes(s.inputEle,{"aria-expanded":"true"}),s.popupObj.show(null,1e3===s.zIndex?s.inputEle:null),P.removeClass([s.popupEle],ye),s.updatePopupHeight(),s.popupObj.refreshPosition(),!s.showSelectAll&&!s.allowFiltering&&!s.popupDiv.classList.contains(Be)&&0<s.treeItems.length&&((i=null!=s.value&&null!=s.text?s.treeObj.element.querySelector('[data-uid="'+s.value[0]+'"]'):null)?(s.treeObj.element.querySelector("li").setAttribute("tabindex","-1"),i.setAttribute("tabindex","0")):(t=s.treeObj.element.querySelector(".e-node-focus"),i=s.treeObj.element.querySelector('li[tabindex="0"]:not(.e-disable)')||s.treeObj.element.querySelector("li:not(.e-disable)"),s.removeFocus(i,t)),s.updateFocus(i)),0<s.treeObj.checkedNodes.length&&!s.isFilterRestore&&(e=s.treeObj.element.querySelectorAll("li:not(.e-disable)"),s.treeObj.element.querySelectorAll("li[aria-checked=true]").length===e.length)&&s.checkBoxElement&&(e=P.closest(s.checkBoxElement,"."+Ae),s.changeState(e,"check"),s.checkSelectAll=!1),s.showSelectAll&&!s.allowFiltering&&(t=s.treeObj.element.querySelector(".e-node-focus"),i=s.popupEle.querySelector(".e-selectall-parent"),s.removeFocus(i,t),s.updateFocus(i)),s.allowFiltering&&(i=s.treeObj.element.querySelector("li.e-node-focus"),P.isNullOrUndefined(i)||P.removeClass([i],"e-node-focus"),P.removeClass([s.inputWrapper],[de]),s.filterObj.element.focus()),e={popup:s.popupObj},s.trigger("open",e))})},b.prototype.removeFocus=function(e,t){t&&t!==e&&(t.setAttribute("tabindex","-1"),P.removeClass([t],"e-node-focus"))},b.prototype.updateFocus=function(e){P.isNullOrUndefined(e)||(e.focus(),P.addClass([e],["e-node-focus"]))},b.prototype.reactCallBack=function(){P.isNullOrUndefined(this.popupObj)||(this.updatePopupHeight(),this.popupObj.refreshPosition())},b.prototype.updatePopupHeight=function(){var e,t;this.isFirstRender||(e=this.getHeight(),this.popupEle.style.maxHeight=e,this.allowFiltering&&(t=Math.round(this.filterContainer.getBoundingClientRect().height),e=P.formatUnit(parseInt(e,10)-t+"px")),this.headerTemplate&&(t=Math.round(this.header.getBoundingClientRect().height),e=P.formatUnit(parseInt(e,10)-t+"px")),this.showCheckBox&&this.showSelectAll&&!this.popupDiv.classList.contains(Be)&&(t=Math.round(this.checkAllParent.getBoundingClientRect().height),e=P.formatUnit(parseInt(e,10)-t+"px")),this.footerTemplate&&(t=Math.round(this.footer.getBoundingClientRect().height),e=P.formatUnit(parseInt(e,10)-t+"px")),t=parseInt(window.getComputedStyle(this.popupEle).borderTopWidth,10),t+=parseInt(window.getComputedStyle(this.popupEle).borderBottomWidth,10),e=P.formatUnit(parseInt(e,10)-t+"px"),this.popupDiv.style.maxHeight=e)},b.prototype.createPopup=function(e){var t=this;this.isFirstRender&&(this.popupObj=new o.Popup(e,{width:this.setWidth(),targetType:"relative",collision:{X:"flip",Y:"flip"},relateTo:this.inputWrapper,zIndex:this.zIndex,enableRtl:this.enableRtl,position:{X:"left",Y:"bottom"},close:function(){t.isPopupOpen=!1},open:function(){document.addEventListener("mousedown",t.documentClickContext),t.isPopupOpen=!0},targetExitViewport:function(){P.Browser.isDevice||t.hidePopup()}}))},b.prototype.setElementWidth=function(e){var t=this.inputWrapper;P.isNullOrUndefined(e)||("number"==typeof e?t.style.width=P.formatUnit(e):"string"==typeof e&&(t.style.width=e.match(/px|%|em/)?e:P.formatUnit(e)))},b.prototype.setWidth=function(){var e=P.formatUnit(this.popupWidth);return-1<e.indexOf("%")?e=(this.inputWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupWidth&&(e=this.popupWidth.match(/px|em/)?this.popupWidth:e),e},b.prototype.getHeight=function(){var e=P.formatUnit(this.popupHeight);return-1<e.indexOf("%")?e=(document.documentElement.clientHeight*parseFloat(e)/100).toString()+"px":"string"==typeof this.popupHeight&&(e=this.popupHeight.match(/px|em/)?this.popupHeight:e),e},b.prototype.onDocumentClick=function(e){var t=e.target,i=P.closest(t,"."+Ce),s=P.closest(t,"."+De),l=P.closest(t,"."+Le),n=P.closest(t,"."+Ne),a=!!t.classList.contains(be)||P.matches(t,".e-ddt .e-popup")||P.matches(t,".e-ddt .e-treeview");this.isPopupOpen&&(!P.isNullOrUndefined(this.inputWrapper)&&this.inputWrapper.contains(t)||i||a||l||n)||(this.allowMultiSelection||this.showCheckBox)&&(this.isPopupOpen&&t.classList.contains(ge)||this.isPopupOpen&&(t.classList.contains(Ee)||t.classList.contains(Ie)||t.classList.contains(we)))?(this.isDocumentClick=!1,e.preventDefault()):P.isNullOrUndefined(this.inputWrapper)||this.inputWrapper.contains(t)||!this.inputFocus||s||this.focusOut(e)},b.prototype.onActionFailure=function(e){this.trigger("actionFailure",e),this.l10nUpdate(!0),P.addClass([this.popupDiv],Be)},b.prototype.OnDataBound=function(e){this.treeItems=e.data,this.treeItems.length<=0?(this.l10nUpdate(),P.addClass([this.popupDiv],Be),this.hideCheckAll(!0)):this.popupDiv.classList.contains(Be)&&1<=this.treeItems.length&&(P.removeClass([this.popupDiv],Be),this.hideCheckAll(!1)),this.isFilteredData||(this.treeDataType=this.getTreeDataType(this.treeItems,this.fields)),this.isFirstRender&&this.isRemoteData&&(this.setTreeValue(),this.setTreeText(),this.updateHiddenValue(),this.setSelectedValue(),this.wrapText||this.updateView(),this.treeObj.element.focus(),this.isInitialized=!0);e={data:e.data};this.trigger("dataBound",e),null===this.filterObj&&(this.isFilteredData=!1),this.isFilteredData&&this.treeObj.expandAll(),this.isFilterRestore&&(this.restoreFilterSelection(),this.showSelectAll||(this.isFilterRestore=!1))},b.prototype.restoreFilterSelection=function(){this.showCheckBox?this.treeObj.checkedNodes=this.value||[]:this.treeObj.selectedNodes=this.value||[]},b.prototype.setCssClass=function(e,t){var i=this.popupObj?[this.inputWrapper,this.popupObj.element]:[this.inputWrapper];P.isNullOrUndefined(t)||""===t||P.removeClass(i,t.split(" ")),P.isNullOrUndefined(e)||""===e||P.addClass(i,e.split(" "))},b.prototype.setEnableRTL=function(e){e?this.inputWrapper.classList.add(oe):this.inputWrapper.classList.remove(oe),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind()),this.treeObj&&(this.treeObj.enableRtl=e,this.treeObj.dataBind())},b.prototype.setEnable=function(){h.Input.setEnabled(this.enabled,this.inputEle),this.enabled?(P.removeClass([this.inputWrapper],Se),this.inputEle.setAttribute("aria-disabled","false"),this.inputWrapper.setAttribute("aria-disabled","false")):(this.isPopupOpen&&this.hidePopup(),P.addClass([this.inputWrapper],Se),this.inputWrapper&&this.inputWrapper.classList.contains(de)&&P.removeClass([this.inputWrapper],[de]),this.inputEle.setAttribute("aria-disabled","true"),this.inputWrapper.setAttribute("aria-disabled","true"))},b.prototype.cloneFields=function(e){return{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:this.cloneChildField(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},b.prototype.cloneChildField=function(e){return"string"==typeof e?e:{dataSource:e.dataSource,value:e.value,text:e.text,parentValue:e.parentValue,child:e.child?this.cloneChildField(e.child):null,hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,htmlAttributes:e.htmlAttributes,query:e.query,selected:e.selected,selectable:e.selectable,tableName:e.tableName,tooltip:e.tooltip}},b.prototype.getTreeFields=function(e){return{dataSource:e.dataSource,id:e.value,text:e.text,parentID:e.parentValue,child:this.getTreeChildren(e.child),hasChildren:e.hasChildren,expanded:e.expanded,iconCss:e.iconCss,imageUrl:e.imageUrl,isChecked:e.selected,htmlAttributes:e.htmlAttributes,query:e.query,selectable:e.selectable,selected:e.selected,tableName:e.tableName,tooltip:e.tooltip}},b.prototype.getTreeChildren=function(e){var t;return"string"==typeof e?e:P.isNullOrUndefined(e)?null:(t=e=this.getActualProperties(e),e.value&&(t.id=e.value),e.parentValue&&(t.parentID=e.parentValue),e.child&&(t.child=this.getTreeChildren(e.child)),e.selected&&this.showCheckBox&&(t.isChecked=e.selected),t)},b.prototype.getTreeDataType=function(e,t){if(this.fields.dataSource instanceof c.DataManager){for(var i=0;i<e.length;i++)if("string"==typeof t.child&&P.isNullOrUndefined(P.getValue(t.child,e[i])))return 1;return 2}P.isNullOrUndefined(this.fields.dataSource)&&(this.fields.dataSource=[]);for(var i=0,s=this.fields.dataSource.length;i<s;i++){if("string"==typeof t.child&&!P.isNullOrUndefined(P.getValue(t.child,this.fields.dataSource[i])))return 2;if(!P.isNullOrUndefined(P.getValue(t.parentValue,this.fields.dataSource[i]))||!P.isNullOrUndefined(P.getValue(t.hasChildren,this.fields.dataSource[i])))return 1}return 1},b.prototype.setFields=function(){this.resetValue(),this.hasTemplate&&this.updateTemplate(),this.treeObj.fields=this.getTreeFields(this.fields),this.setProperties({value:this.oldValue},!0),this.treeObj.dataBind(),this.updateValue(this.value)},b.prototype.getEventArgs=function(e){var t,i=e.data,s=e.nodeData;return this.showCheckBox&&("check"===e.action?t="select":"uncheck"===e.action&&(t="un-select")),{action:this.showCheckBox?t:e.action,isInteracted:!!this.isClicked||e.isInteracted,item:e.node,itemData:this.showCheckBox?i[0]:s}},b.prototype.onBeforeSelect=function(e){e.isInteracted&&(this.setOldValue(),null===this.value)&&this.setProperties({value:[]},!0)},b.prototype.updateHiddenValue=function(){this.allowMultiSelection||this.showCheckBox||(this.value&&this.value.length?this.hiddenElement.innerHTML='<option selected value ="'+this.value[0]+'">'+this.text+"</option>":this.hiddenElement.innerHTML="")},b.prototype.onNodeSelected=function(e){var t,i;this.showCheckBox||(i=this.getEventArgs(e),this.trigger("select",i),e.isInteracted&&(i=P.getValue("id",e.nodeData).toString(),this.allowMultiSelection?this.allowMultiSelection&&this.setMultiSelect():(this.hiddenElement.innerHTML="",this.setProperties({value:[i]},!0),t=this.itemTemplate?P.getValue("text",this.treeObj.getNode(i)):P.getValue("text",e.nodeData).toString(),h.Input.setValue(t,this.inputEle,this.floatLabelType),this.setProperties({text:t},!0),this.currentText=this.text,this.currentValue=this.value,this.setValueTemplate(),!P.isNullOrUndefined(this.value)&&0<this.value.length&&this.inputWrapper.setAttribute("aria-label",e.nodeData.text.toString()),P.attributes(this.inputWrapper,{"aria-describedby":this.element.id}),P.attributes(this.inputWrapper,{"aria-activedescendant":i.toString()}),this.updateHiddenValue(),this.showOverAllClear(),this.hidePopup(),this.isNodeSelected=!0)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1))},b.prototype.onNodeClicked=function(e){!this.changeOnBlur&&this.isNodeSelected&&(this.triggerChangeEvent(e.event),this.isNodeSelected=!1);var t=e.event.target;(t.classList.contains("e-fullrow")||t.classList.contains("e-list-text"))&&this.showCheckBox&&(this.isClicked=!0,"true"===this.treeObj.getNode(e.node).isChecked?this.treeObj.uncheckAll([e.node]):this.treeObj.checkAll([e.node]),this.isClicked=!1,this.setMultiSelect(),this.ensurePlaceHolder()),this.changeOnBlur||!this.allowMultiSelection&&!this.showCheckBox||this.triggerChangeEvent(e.event)},b.prototype.onNodeChecked=function(e){var t,i,s=this.getEventArgs(e);this.trigger("select",s),this.isFilteredData&&"uncheck"===e.action&&(s=P.getValue("id",e.data[0]).toString(),this.removeSelectedData(s,!0)),(!this.isChipDelete&&e.isInteracted||!this.isFilteredData&&"check"===e.action&&this.isFromFilterChange)&&(this.setMultiSelect(),this.ensurePlaceHolder()),this.showSelectAll&&this.checkBoxElement&&(s=this.treeObj.element.querySelectorAll("li:not(.e-disable)"),t=this.treeObj.element.querySelectorAll("li[aria-checked=true]"),(i=P.closest(this.checkBoxElement,"."+Ae))&&"uncheck"===e.action&&(e.isInteracted||0===t.length||!P.isNullOrUndefined(e.data[0])&&"false"===e.data[0].isChecked)||!e.isInteracted&&this.isFilterRestore?(this.isFilterRestore=!1,this.isReverseUpdate=!0,this.changeState(i,"uncheck"),this.isReverseUpdate=!1):i&&"check"===e.action&&t.length===s.length&&(e.isInteracted||this.isCheckAllCalled||!P.isNullOrUndefined(e.data[0])&&"true"===e.data[0].isChecked)&&(this.isReverseUpdate=!0,this.isCheckAllCalled=!1,this.changeState(i,"check"),this.isReverseUpdate=!1)),this.isValueChange&&!this.changeOnBlur&&(this.triggerChangeEvent(this.keyEventArgs),this.isValueChange=!1)},b.prototype.beforeCheck=function(e){e.isInteracted&&this.setOldValue()},b.prototype.onNodeExpanded=function(){if(this.hasTemplate&&this.portals&&this.treeObj.portals){for(var e=0;e<this.treeObj.portals.length;e++)-1===this.portals.indexOf(this.treeObj.portals[e])&&this.portals.push(this.treeObj.portals[e]);this.renderReactTemplates()}},b.prototype.updateClearButton=function(e){if(e?this.inputWrapper.contains(this.overAllClear)?(P.removeClass([this.overAllClear],C),P.addClass([this.inputWrapper],ue)):this.inputEle.parentElement.insertBefore(this.overAllClear,this.inputEle.nextSibling):(P.addClass([this.overAllClear],C),P.removeClass([this.inputWrapper],ue)),(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper)for(var t=P.selectAll("."+ge,this.chipWrapper),i=0;i<t.length;i++)e?P.removeClass([t[i]],C):P.addClass([t[i]],C)},b.prototype.updateDropDownIconState=function(e){var t=P.select("."+ke,this.inputWrapper);e?(t?P.removeClass([t],C):h.Input.appendSpan(he,this.inputWrapper,this.createElement),P.addClass([this.inputWrapper],pe)):(P.addClass([t],C),P.removeClass([this.inputWrapper],pe))},b.prototype.updateMode=function(){var e,t;"Custom"!==this.mode&&("Delimiter"!==this.mode?(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),e=this.getValidMode(),this.chipWrapper.classList.contains(C)&&e?(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0),P.addClass([this.inputWrapper],r)):e||(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),this.showOrHideValueTemplate(!0)),t=null!==this.value&&0!==this.value.length,e&&t?P.addClass([this.inputEle],u):P.removeClass([this.inputEle],u)):this.inputEle.classList.contains(u)&&(P.removeClass([this.inputEle],u),this.chipWrapper)&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r),this.showOrHideValueTemplate(!0)))},b.prototype.ensurePlaceHolder=function(){(P.isNullOrUndefined(this.value)||null!==this.value&&0===this.value.length)&&(P.removeClass([this.inputEle],u),this.chipWrapper)&&(P.addClass([this.chipWrapper],C),this.showOrHideValueTemplate(!0))},b.prototype.ensureClearIconPosition=function(e){"Never"!==e&&this.inputWrapper.insertBefore(this.overAllClear,this.inputObj.buttons[0])},b.prototype.setMultiSelectValue=function(e){var t=this;if(this.isFilteredData){for(var i=(i=P.isNullOrUndefined(this.value)?[]:this.value).filter(function(e){e=t.treeObj.getTreeData(e);return!Array.isArray(e)||e.every(function(e){return e.selected})}),s=0;s<e.length;s++)!P.isNullOrUndefined(this.value)&&-1!==this.value.indexOf(e[s])||i.push(e[s]);this.setProperties({value:i},!0)}else this.setProperties({value:this.isFromFilterChange&&e&&0===e.length?this.value:e},!0),this.isFromFilterChange=!1,!e||0===e.length||this.showCheckBox||this.ddtCompareValues(this.treeObj.selectedNodes,this.value.slice())||(this.treeObj.selectedNodes=this.value.slice(),this.treeObj.dataBind())},b.prototype.setMultiSelect=function(){this.showCheckBox&&!this.isDynamicChange?this.setMultiSelectValue(this.treeObj.checkedNodes.slice()):(e=this.allowMultiSelection?this.showCheckBox?this.treeObj.checkedNodes:this.treeObj.selectedNodes:this.value?this.showCheckBox?this.value:[this.value[0]]:null,this.setMultiSelectValue(e),this.showCheckBox&&null!==this.value&&(this.treeObj.checkedNodes=this.value,this.treeObj.dataBind())),this.selectedText=[];var e=!!this.allowMultiSelection||!!this.showCheckBox;this.inputWrapper.contains(this.chipWrapper)&&!e&&(P.removeClass([this.inputEle],u),P.detach(this.chipWrapper));this.getValidMode()&&null!==this.value&&(P.addClass([this.inputEle],u),this.chipWrapper)&&(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0));e=!!this.value&&!!this.value.length;this.chipWrapper&&"Box"===this.mode&&!e&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputEle],u),this.showOrHideValueTemplate(!0)),this.updateSelectedValues()},b.prototype.getSelectedData=function(e){var t=null;if(this.isFilteredData)for(var i=0;i<this.selectedData.length;i++)if(P.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[i]).toString()===e){t=this.selectedData[i];break}return P.isNullOrUndefined(t)&&(t=this.treeSettings.loadOnDemand?this.getNodeData(e,this.treeItems):this.treeObj.getNode(e),P.isNullOrUndefined(t)||this.selectedData.push(t)),t},b.prototype.getNodeData=function(e,t){if(!P.isNullOrUndefined(e)){if(1!==this.treeDataType)return this.getChildNodeData(t,this.fields,e);for(var i=0,s=t.length;i<s;i++){var l=P.getValue(this.fields.value,t[i]);if(!P.isNullOrUndefined(t[i])&&!P.isNullOrUndefined(l)&&l.toString()===e)return t[i]}}},b.prototype.getChildNodeData=function(e,t,i){if(!P.isNullOrUndefined(e))for(var s=0,l=e.length;s<l;s++){var n=P.getValue(t.value,e[s]);if(e[s]&&n&&n.toString()===i)return e[s];if("string"!=typeof t.child||P.isNullOrUndefined(P.getValue(t.child,e[s]))){if(this.fields.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(P.getValue("child",e[s])))if(void 0!==(a=this.getChildNodeData(P.getValue("child",e[s]),this.getChildMapperFields(t),i)))break}else{var a,n=P.getValue(t.child,e[s]);if(void 0!==(a=this.getChildNodeData(n,this.getChildMapperFields(t),i)))break}}return a},b.prototype.getChildMapperFields=function(e){return"string"==typeof e.child||P.isNullOrUndefined(e.child)?e:e.child},b.prototype.removeSelectedData=function(e,t){var i=P.isNullOrUndefined(this.value)?[]:this.value.slice();i.splice(i.indexOf(e),1),this.setProperties({value:i},t);for(var s=0;s<this.selectedData.length;s++)if(P.getValue(this.treeSettings.loadOnDemand?this.fields.value:"id",this.selectedData[s]).toString()===e){this.selectedData.splice(s,1);break}},b.prototype.initializeValueTemplate=function(){if(!this.valueTemplate)return null;if(this.valueTemplateContainer)for(;this.valueTemplateContainer.firstChild;)this.valueTemplateContainer.removeChild(this.valueTemplateContainer.firstChild);else this.valueTemplateContainer=this.createElement("span",{className:Ve+" "+Pe+" e-input-value "+C});return this.inputWrapper.insertBefore(this.valueTemplateContainer,this.inputEle),this.templateComplier(this.valueTemplate)},b.prototype.showOrHideValueTemplate=function(e,t){void 0===t&&(t=!1),this.valueTemplateContainer&&"Box"!==this.mode&&(e?(P.removeClass([this.valueTemplateContainer],C),P.addClass([this.inputWrapper],r),P.addClass([this.inputEle],u)):(P.addClass([this.valueTemplateContainer],C),t||(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u))))},b.prototype.updateSelectedValues=function(){var e,t=this,i=this.dataValue="",s=this.hiddenElement.innerHTML="";if(this.isChipDelete&&!this.treeSettings.autoCheck||!this.inputWrapper.contains(this.chipWrapper)||(this.chipCollection.innerHTML=""),this.isFilteredData||(this.selectedData=[]),!P.isNullOrUndefined(this.value)){for(var l=this.initializeValueTemplate(),n=0,a=this.value.length;n<a;n++)e=this.getSelectedData(this.value[n]),e=P.getValue(this.treeSettings.loadOnDemand?this.fields.text:"text",e),this.selectedText.push(e),e=this.selectedText[this.selectedText.length-1],1<this.selectedText.length?(this.dataValue+=this.delimiterChar+" "+e,i+=","+e):(this.dataValue+=e,i+=e),"Custom"===this.mode||"Delimiter"===this.mode||this.isChipDelete&&!this.treeSettings.autoCheck||!this.allowMultiSelection&&!this.showCheckBox||this.setChipValues(e,this.value[n]),s+='<option selected value ="'+this.value[n]+'">'+this.selectedText[this.selectedText.length-1]+"</option>",this.valueTemplate&&this.getValueTemplateElement(this.value[n],l);this.hasTemplate&&this.portals&&(this.treeObj.portals&&(this.portals=this.portals.concat(this.treeObj.portals.filter(function(e){return!t.portals.includes(e)}))),this.isReact)&&this.renderReactTemplates(this.reactCallBack),1<=this.selectedText.length&&this.setProperties({text:i},!0),this.hiddenElement.innerHTML=s,"Custom"===this.mode&&(this.allowMultiSelection||this.showCheckBox)&&this.setTagValues()}var o=this.getValidMode();"Custom"===this.mode||"Box"===this.mode||!this.allowMultiSelection&&!this.showCheckBox||o||(this.chipWrapper&&(P.addClass([this.chipWrapper],C),P.removeClass([this.inputWrapper],r)),this.showOrHideValueTemplate(!0)),h.Input.setValue(this.dataValue,this.inputEle,this.floatLabelType),""===i?this.setProperties({text:null},!0):this.setProperties({text:i},!0),this.showClearButton&&this.inputFocus&&this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&this.popupObj&&this.popupObj.refreshPosition(),this.currentText=this.text,this.currentValue=this.value,!P.isNullOrUndefined(this.value)&&0<this.value.length&&!P.isNullOrUndefined(this.currentText)?this.inputWrapper.setAttribute("aria-label",this.currentText.replace(/,/g,", ")):this.inputWrapper.setAttribute("aria-label",this.getModuleName())},b.prototype.setChipValues=function(e,t){this.inputWrapper.contains(this.chipWrapper)||this.createChip();var t=this.createElement("span",{className:fe,attrs:{"data-value":t}}),i=this.createElement("span",{className:ve}),s=this.createElement("span",{className:ge+" e-icons"});this.enableHtmlSanitizer?i.innerText=P.SanitizeHtmlHelper.sanitize(e):i.innerHTML=e,t.appendChild(i),this.chipCollection.appendChild(t),this.showClearButton&&(t.appendChild(s),P.EventHandler.add(s,"mouseup",this.removeChip,this))},b.prototype.setTagValues=function(){var e,t,i,s;null===this.value||null==this.text||0===this.value.length?this.inputWrapper.contains(this.chipWrapper)&&P.addClass([this.chipWrapper],C):(this.inputWrapper.contains(this.chipWrapper)||this.createChip(),this.inputWrapper.classList.contains(r)||P.addClass([this.inputWrapper],r),e=this.createElement("span",{className:fe}),this.inputEle.classList.contains(u)||P.addClass([this.inputEle],u),this.chipWrapper.classList.contains(C)&&(P.removeClass([this.chipWrapper],C),this.showOrHideValueTemplate(!1,!0)),t=this.createElement("span",{className:ve}),s=this.customTemplate,i=this.customTemplateId,(s=this.templateComplier(s)({value:this.value,text:this.text},this,"customTemplate",i,this.isStringTemplate,void 0,t))&&(s=Array.prototype.slice.call(s),P.append(s,t)),e.appendChild(t),this.chipCollection.appendChild(e),this.isReact&&this.renderReactTemplates())},b.prototype.setSelectAllWrapper=function(e){this.isFirstRender||(e&&!this.popupEle.contains(this.checkAllParent)&&this.showCheckBox?(this.createSelectAllWrapper(),this.popupEle.insertBefore(this.checkAllParent,this.popupDiv)):this.popupEle.contains(this.checkAllParent)&&(P.detach(this.checkAllParent),this.checkAllParent=null))},b.prototype.setHeaderTemplate=function(){this.header?this.header.innerHTML="":(this.header=this.createElement("div"),P.addClass([this.header],Le));var e=this.templateComplier(this.headerTemplate)({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,void 0,this.header);e&&(e=Array.prototype.slice.call(e),P.append(e,this.header)),this.popupEle.insertBefore(this.header,this.checkAllParent||this.popupDiv)},b.prototype.templateComplier=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?P.compile(document.querySelector(e).innerHTML.trim()):P.compile(e)}catch(e){}return P.compile(e)},b.prototype.setFooterTemplate=function(){this.footer?this.isReact&&"function"==typeof this.footerTemplate?this.clearTemplate(["footerTemplate"]):this.footer.innerHTML="":(this.footer=this.createElement("div"),P.addClass([this.footer],Ne));var e=this.templateComplier(this.footerTemplate)({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,void 0,this.footer);e&&(e=Array.prototype.slice.call(e),P.append(e,this.footer)),P.append([this.footer],this.popupEle)},b.prototype.clearAll=function(e){!this.enabled||this.readonly||(this.resetValue(),this.showOverAllClear(),(this.allowMultiSelection||this.showCheckBox)&&(this.popupObj&&this.popupObj.refreshPosition(),this.wrapText||this.updateOverflowWrapper(!0)),e&&(this.isClearButtonClick=!0),this.changeOnBlur)||this.triggerChangeEvent(e)},b.prototype.removeChip=function(e){var t,i;this.enabled&&!this.readonly&&(e.target.classList.contains("e-chips-close")&&!this.isPopupOpen&&(e.stopPropagation(),e.preventDefault()),i=(t=e.target.parentElement).getAttribute("data-value"),this.chipCollection&&t&&P.remove(t),this.isChipDelete=!0,this.isClearButtonClick=!0,this.removeSelectedData(i,!0),this.selectedText=[],this.allowMultiSelection&&(this.treeObj.selectedNodes=this.value.slice(),this.updateSelectedValues()),this.showCheckBox&&(this.treeObj.uncheckAll([i]),this.clearCheckAll(),this.setMultiSelect()),this.triggerChangeEvent(e),this.isChipDelete=!1,this.ensurePlaceHolder())},b.prototype.resetValue=function(e){Array.isArray(this.value)&&0===this.value.length&&null==this.text||(h.Input.setValue(null,this.inputEle,this.floatLabelType),e||(this.setOldValue(),this.setProperties({value:[]},!0),this.showOrHideValueTemplate(!1)),!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.inputWrapper.setAttribute("aria-label",this.getModuleName()),this.dataValue=null,this.setProperties({text:null},!0),this.selectedData=[],P.setValue("selectedNodes",[],this.treeObj),this.hiddenElement.innerHTML="",this.showCheckBox&&(this.treeObj.uncheckAll(),this.setMultiSelect(),this.clearCheckAll()),null!==this.oldValue||e?e&&this.triggerChangeEvent():this.removeValue=!0,(this.allowMultiSelection||this.showCheckBox)&&this.chipWrapper&&(this.chipCollection.innerHTML="",this.wrapText||this.updateOverflowWrapper(!0),this.ensurePlaceHolder()))},b.prototype.clearCheckAll=function(){this.showSelectAll&&this.value&&0===this.value.length&&this.setLocale(!1)},b.prototype.setOldValue=function(){this.oldValue=Array.isArray(this.value)?this.value.slice():this.value},b.prototype.selectAllItems=function(e){if(this.showCheckBox)e?(this.isCheckAllCalled=!0,this.treeObj.checkAll()):this.treeObj.uncheckAll(),this.checkSelectAll=e;else if(this.allowMultiSelection)if(e){for(var t,i=P.selectAll("li",this.treeObj.element),s=[],l=0;l<i.length;l++)t=i[l].getAttribute("data-uid").toString(),s.push(t);this.treeObj.selectedNodes=s}else this.treeObj.selectedNodes=[];this.updateMode(),this.setMultiSelect(),this.wrapText||(e?this.updateView():this.updateOverflowWrapper(!0))},b.prototype.updateTreeSettings=function(e){if("autoCheck"===e)this.treeObj.autoCheck=this.treeSettings.autoCheck;else if("loadOnDemand"===e)this.treeObj.loadOnDemand=this.treeSettings.loadOnDemand;else{if("expandOn"===e)return this.treeObj.expandOn=this.treeSettings.expandOn,void this.treeObj.dataBind();"checkDisabledChildren"===e&&(this.treeObj.checkDisabledChildren=this.treeSettings.checkDisabledChildren)}this.treeObj.dataBind(),this.setMultiSelect(),this.updateValue(this.value)},b.prototype.updateCheckBoxState=function(e){this.hasTemplate&&this.updateTemplate(),this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.showCheckBox=e,this.treeObj.dataBind(),this.isDynamicChange=!0,this.setSelectAllWrapper(this.showSelectAll),this.showSelectAll&&this.setLocale(),this.showCheckBox&&this.updateMode(),this.setMultiSelect(),this.isDynamicChange=!1},b.prototype.updateTemplate=function(){this.popupObj&&(this.clearTemplate(),this.portals=[],this.popupObj.destroy(),this.isPopupOpen?(this.hidePopup(),this.isFirstRender=!0,this.renderPopup()):this.isFirstRender=!0)},b.prototype.l10nUpdate=function(e){var t,i,s;this.noRecord?this.noRecord.innerHTML="":this.noRecord=this.createElement("div"),"No Records Found"!==this.noRecordsTemplate||"The Request Failed"!==this.actionFailureTemplate?(s=e?this.actionFailureTemplate:this.noRecordsTemplate,t=e?this.actionFailureTemplateId:this.noRecordsTemplateId,i=e?"actionFailureTemplate":"noRecordsTemplate",(s=this.templateComplier(s)({},this,i,t,this.isStringTemplate,void 0,this.noRecord))&&(s=Array.prototype.slice.call(s),P.append(s,this.noRecord))):(this.l10n=new P.L10n(this.getLocaleName(),{noRecordsTemplate:"No Records Found",actionFailureTemplate:"The Request Failed"},this.locale),this.noRecord.innerHTML=e?this.l10n.getConstant("actionFailureTemplate"):this.l10n.getConstant("noRecordsTemplate")),P.addClass([this.noRecord],"e-ddt-nodata"),P.prepend([this.noRecord],this.popupDiv),this.treeObj&&this.treeObj.element.removeAttribute("aria-activedescendant")},b.prototype.updateRecordTemplate=function(e){this.treeItems&&this.treeItems.length<=0&&(this.l10nUpdate(e),this.hasTemplate)&&this.updateTemplate()},b.prototype.updateOverflowWrapper=function(e){e?this.inputWrapper.contains(this.overFlowWrapper)&&e&&(this.overFlowWrapper.innerHTML=""):this.inputWrapper.contains(this.overFlowWrapper)||(this.overFlowWrapper=this.createElement("span",{className:Ve+" "+C}),this.inputWrapper.insertBefore(this.overFlowWrapper,this.hiddenElement))},b.prototype.updateMultiSelection=function(e){this.wrapText||this.updateOverflowWrapper(!1),this.treeObj.allowMultiSelection=e,this.treeObj.dataBind(),this.updateOption(),this.allowMultiSelection&&this.updateMode(),this.setMultiSelect()},b.prototype.updateAllowFiltering=function(e){this.isFirstRender||(e?this.renderFilter():this.destroyFilter())},b.prototype.updateFilterPlaceHolder=function(){this.filterObj&&(this.filterObj.placeholder=this.filterBarPlaceholder,this.filterObj.element.setAttribute("aria-label",this.filterBarPlaceholder))},b.prototype.updateValue=function(e){this.isDynamicChange=!0,P.isNullOrUndefined(e)||0===e.length?this.resetValue(!0):(this.setTreeValue(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue(),this.isDynamicChange=!1},b.prototype.updateText=function(e){P.isNullOrUndefined(e)?this.resetValue():(this.setTreeText(),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText||(this.updateOverflowWrapper(!1),this.updateView())),this.updateHiddenValue()},b.prototype.updateModelMode=function(){var e;!this.allowMultiSelection&&!this.showCheckBox||(this.wrapText||(e=P.select(".e-overflow:not(.e-input-value)",this.inputWrapper))&&(e.innerHTML=""),this.updateMode(),this.setMultiSelect(),this.wrapText)||!this.value||0===this.value.length||(this.updateOverFlowView(),P.addClass([this.inputEle],u),"Box"===this.mode?P.removeClass([this.overFlowWrapper,this.inputWrapper],Pe):P.addClass([this.overFlowWrapper,this.inputWrapper],Pe))},b.prototype.updateOption=function(){this.hiddenElement.hasAttribute("multiple")||!this.allowMultiSelection&&!this.showCheckBox?!this.hiddenElement.hasAttribute("multiple")||this.allowMultiSelection||this.showCheckBox||this.hiddenElement.removeAttribute("multiple"):this.hiddenElement.setAttribute("multiple","")},b.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"width":this.setElementWidth(e.width),this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"placeholder":h.Input.setPlaceholder(e.placeholder,this.inputEle);break;case"cssClass":this.setCssClass(e.cssClass,t.cssClass);break;case"enableRtl":this.setEnableRTL(this.enableRtl);break;case"fields":this.setFields();break;case"readonly":h.Input.setReadonly(e.readonly,this.inputEle);break;case"enabled":this.setEnable();break;case"floatLabelType":h.Input.removeFloating(this.inputObj),h.Input.addFloating(this.inputEle,e.floatLabelType,this.placeholder,this.createElement),this.ensureClearIconPosition(e.floatLabelType);break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"allowFiltering":this.updateAllowFiltering(e.allowFiltering);break;case"filterBarPlaceholder":this.updateFilterPlaceHolder();break;case"value":JSON.stringify(t.value)!==JSON.stringify(e.value)&&(this.oldValue=t.value,this.updateValue(e.value));break;case"text":this.updateText(e.text);break;case"allowMultiSelection":this.updateMultiSelection(e.allowMultiSelection);break;case"mode":if(!this.showCheckBox&&!this.allowMultiSelection)return;"Custom"===this.mode?(this.overFlowWrapper&&P.detach(this.overFlowWrapper),this.chipWrapper&&P.detach(this.chipWrapper),this.setTagValues()):("Custom"===t.mode&&this.updateOverflowWrapper(this.wrapText),this.updateModelMode());break;case"delimiterChar":if("Box"===this.mode)return;(this.showCheckBox||this.allowMultiSelection)&&this.setMultiSelect();break;case"selectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale();break;case"unSelectAllText":this.showCheckBox&&this.showSelectAll&&this.setLocale(!1);break;case"showSelectAll":this.showCheckBox&&(this.setSelectAllWrapper(e.showSelectAll),this.updatePopupHeight());break;case"showCheckBox":this.updateCheckBoxState(e.showCheckBox),this.wrapText||this.updateOverflowWrapper(!0),this.updatePopupHeight(),this.updateOption();break;case"treeSettings":for(var l=0,n=Object.keys(e.treeSettings);l<n.length;l++){var a=n[l];this.updateTreeSettings(a)}break;case"customTemplate":if("Custom"!==this.mode)return;this.chipCollection.innerHTML="",this.setTagValues();break;case"sortOrder":this.hasTemplate&&this.updateTemplate(),this.treeObj.sortOrder=e.sortOrder,this.treeObj.dataBind(),this.updateValue(this.value);break;case"showDropDownIcon":this.updateDropDownIconState(e.showDropDownIcon);break;case"popupWidth":this.popupObj&&(this.popupObj.element.style.width=this.setWidth());break;case"popupHeight":this.popupObj&&this.updatePopupHeight();break;case"zIndex":this.popupObj&&(this.popupObj.zIndex=e.zIndex,this.popupObj.dataBind());break;case"headerTemplate":case"footerTemplate":this.updateTemplate();break;case"itemTemplate":this.updateTemplate(),this.treeObj.nodeTemplate=e.itemTemplate,this.treeObj.dataBind();break;case"noRecordsTemplate":this.updateRecordTemplate();break;case"actionFailureTemplate":this.updateRecordTemplate(!0);break;case"htmlAttributes":this.setHTMLAttributes();break;case"wrapText":this.updateOverflowWrapper(this.wrapText),!this.allowMultiSelection&&!this.showCheckBox||this.wrapText?(P.addClass([this.overFlowWrapper],C),this.chipWrapper&&"Box"===this.mode?P.removeClass([this.chipWrapper],C):(P.removeClass([this.inputWrapper],r),P.removeClass([this.inputEle],u)),this.ensurePlaceHolder()):this.updateView()}},b.prototype.clear=function(){this.clearAll(),this.inputFocus?this.onFocusOut():(this.changeOnBlur&&this.triggerChangeEvent(),this.removeValue=!1)},b.prototype.destroy=function(){for(this.clearTemplate(),this.unWireEvents(),this.setCssClass(null,this.cssClass),this.setProperties({text:null},!0),this.treeObj.destroy(),this.destroyFilter(),this.popupObj&&(this.popupObj.destroy(),P.detach(this.popupObj.element)),this.element.tagName!==this.getDirective()&&this.inputWrapper.parentElement.insertBefore(this.element,this.inputWrapper),h.Input.setValue(null,this.inputEle,this.floatLabelType),P.detach(this.inputWrapper),P.detach(this.popupDiv),P.detach(this.hiddenElement),h.Input.setRipple(!1,[this.inputObj]),this.element.classList.remove("e-input"),(this.showCheckBox||this.allowMultiSelection||this.value&&this.valueTemplateContainer)&&this.element.classList.remove(u),P.detach(this.inputObj.container),this.inputObj.buttons.length&&P.detach(this.inputObj.buttons[0]),this.inputObj=null;0<this.hiddenElement.options.length;)this.hiddenElement.remove(0);if(this.hiddenElement.innerHTML="",this.hiddenElement=null,this.inputWrapper.innerHTML="",this.inputWrapper=null,this.popupDiv=null,this.tree=null,this.popupObj=null,this.treeObj=null,this.overAllClear=null,this.chipCollection)for(var e=0,t=P.selectAll(".e-chips-close",this.chipCollection);e<t.length;e++){var i=t[e];P.EventHandler.remove(i,"mouseup",this.removeChip)}this.chipWrapper=null,this.chipCollection=null,this.checkAllParent=null,this.selectAllSpan=null,this.checkBoxElement=null,this.checkWrapper=null,this.popupEle=null,this.header=null,this.footer=null,this.overFlowWrapper=null,this.keyboardModule=null,je.prototype.destroy.call(this),this.setProperties({value:[]},!0)},b.prototype.destroyFilter=function(){this.filterObj&&(this.filterObj.destroy(),P.detach(this.filterObj.element),P.detach(this.filterContainer),this.filterObj=null)},b.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.isReact&&this.clearTemplate(["headerTemplate","footerTemplate","itemTemplate","actionFailureTemplate","noRecordsTemplate"]),this.popupObj&&(this.popupObj.destroy(),P.detach(this.popupObj.element))},b.prototype.ensureVisible=function(e){this.treeObj.ensureVisible(e)},b.prototype.getData=function(e){return this.treeObj.getTreeData(e)},b.prototype.hidePopup=function(){var e={popup:this.popupObj,cancel:!1};this.trigger("close",e),e.cancel||(this.inputWrapper.classList.remove(me),this.popupEle&&P.addClass([this.popupEle],ye),P.attributes(this.inputEle,{"aria-expanded":"false"}),this.popupObj&&this.isPopupOpen&&(this.popupObj.hide(),this.inputFocus&&(this.inputWrapper.focus(),this.allowFiltering)&&P.addClass([this.inputWrapper],[de]),this.isFilteredData&&(this.treeObj.treeData=this.treeData),this.destroyPopupOnHide)&&(this.isFirstRender=!0,this.destroyPopup()))},b.prototype.selectAll=function(e){this.selectAllItems(e)},b.prototype.showPopup=function(){!this.enabled||this.readonly||this.isPopupOpen||(this.renderPopup(),this.focusIn())},b.prototype.getModuleName=function(){return"dropdowntree"},a([P.Property("The Request Failed")],b.prototype,"actionFailureTemplate",void 0),a([P.Property(!1)],b.prototype,"allowFiltering",void 0),a([P.Property(!1)],b.prototype,"allowMultiSelection",void 0),a([P.Property(!0)],b.prototype,"changeOnBlur",void 0),a([P.Property("")],b.prototype,"cssClass",void 0),a([P.Property("${value.length} item(s) selected")],b.prototype,"customTemplate",void 0),a([P.Property(",")],b.prototype,"delimiterChar",void 0),a([P.Property(!0)],b.prototype,"enabled",void 0),a([P.Complex({},Fe)],b.prototype,"fields",void 0),a([P.Property(null)],b.prototype,"filterBarPlaceholder",void 0),a([P.Property("StartsWith")],b.prototype,"filterType",void 0),a([P.Property("Never")],b.prototype,"floatLabelType",void 0),a([P.Property(null)],b.prototype,"footerTemplate",void 0),a([P.Property(!1)],b.prototype,"ignoreAccent",void 0),a([P.Property(!0)],b.prototype,"ignoreCase",void 0),a([P.Property(null)],b.prototype,"headerTemplate",void 0),a([P.Property({})],b.prototype,"htmlAttributes",void 0),a([P.Property(null)],b.prototype,"itemTemplate",void 0),a([P.Property("Default")],b.prototype,"mode",void 0),a([P.Property("No Records Found")],b.prototype,"noRecordsTemplate",void 0),a([P.Property(null)],b.prototype,"placeholder",void 0),a([P.Property("300px")],b.prototype,"popupHeight",void 0),a([P.Property("100%")],b.prototype,"popupWidth",void 0),a([P.Property(!1)],b.prototype,"readonly",void 0),a([P.Property(!1)],b.prototype,"showSelectAll",void 0),a([P.Property("Select All")],b.prototype,"selectAllText",void 0),a([P.Property(!1)],b.prototype,"showCheckBox",void 0),a([P.Property(!0)],b.prototype,"destroyPopupOnHide",void 0),a([P.Property(!0)],b.prototype,"enableHtmlSanitizer",void 0),a([P.Property(!0)],b.prototype,"showClearButton",void 0),a([P.Property(!0)],b.prototype,"showDropDownIcon",void 0),a([P.Property("None")],b.prototype,"sortOrder",void 0),a([P.Property(null)],b.prototype,"text",void 0),a([P.Complex({},qe)],b.prototype,"treeSettings",void 0),a([P.Property("Unselect All")],b.prototype,"unSelectAllText",void 0),a([P.Property(null)],b.prototype,"value",void 0),a([P.Property(null)],b.prototype,"valueTemplate",void 0),a([P.Property("100%")],b.prototype,"width",void 0),a([P.Property(1e3)],b.prototype,"zIndex",void 0),a([P.Property(!1)],b.prototype,"wrapText",void 0),a([P.Event()],b.prototype,"actionFailure",void 0),a([P.Event()],b.prototype,"beforeOpen",void 0),a([P.Event()],b.prototype,"change",void 0),a([P.Event()],b.prototype,"close",void 0),a([P.Event()],b.prototype,"blur",void 0),a([P.Event()],b.prototype,"created",void 0),a([P.Event()],b.prototype,"dataBound",void 0),a([P.Event()],b.prototype,"destroyed",void 0),a([P.Event()],b.prototype,"filtering",void 0),a([P.Event()],b.prototype,"focus",void 0),a([P.Event()],b.prototype,"keyPress",void 0),a([P.Event()],b.prototype,"open",void 0),a([P.Event()],b.prototype,"select",void 0);var je,l=a([P.NotifyPropertyChanges],b);function b(e,t){e=je.call(this,e,t)||this;return e.filterTimer=null,e.isFilteredData=!1,e.isFilterRestore=!1,e.selectedData=[],e.filterDelayTime=300,e.isClicked=!1,e.documentClickContext=e.onDocumentClick.bind(e),e.isCheckAllCalled=!1,e.isFromFilterChange=!1,e}Re=function(e,t){return(Re=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 Re,S,a=function(e,t){function i(){this.constructor=e}Re(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},E=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},ze="e-atc-spinner-icon",Ke=(f.root="e-combobox",{container:null,buttons:[]}),a=(a(x,S=i),x.prototype.preRender=function(){S.prototype.preRender.call(this)},x.prototype.getLocaleName=function(){return"combo-box"},x.prototype.wireEvent=function(){"combobox"===this.getModuleName()&&(P.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.preventBlur,this),P.EventHandler.add(this.inputWrapper.container,"blur",this.onBlurHandler,this)),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.EventHandler.add(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick,this),P.EventHandler.add(this.inputElement,"focus",this.targetFocus,this),this.readonly||(P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),P.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this),P.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this),P.EventHandler.add(window,"resize",this.windowResize,this)),this.bindCommonEvent()},x.prototype.preventBlur=function(e){(this.allowFiltering||document.activeElement===this.inputElement||document.activeElement.classList.contains(f.input)||!P.Browser.isDevice)&&P.Browser.isDevice||e.preventDefault()},x.prototype.onBlurHandler=function(e){var t=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;P.isNullOrUndefined(this.listData)||P.isNullOrUndefined(t)||t===this.text||this.customValue(e),S.prototype.onBlurHandler.call(this,e)},x.prototype.targetElement=function(){return this.inputElement},x.prototype.setOldText=function(e){h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue(),this.removeSelection()},x.prototype.setOldValue=function(e){this.allowCustom?(this.selectedLI=this.getElementByValue(this.value),this.valueMuteChange(this.value)):this.valueMuteChange(null),this.removeSelection(),this.setHiddenValue()},x.prototype.valueMuteChange=function(e){e=this.allowObjectBinding&&!P.isNullOrUndefined(e)?P.getValue(this.fields.value||"",e):e;var t,i,s,l=P.isNullOrUndefined(e)?null:e.toString(),l=(h.Input.setValue(l,this.inputElement,this.floatLabelType,this.showClearButton),{}),n=(this.allowObjectBinding&&(e=this.getDataByValue(e),P.isNullOrUndefined(e))&&(t=this.fields,s=i=!1,this.allowObjectBinding&&((n=Object.keys(this.value)).forEach(function(e){e===t.value&&(s=!0)}),n.forEach(function(e){e===t.text&&(i=!0)})),l={text:s?i?P.getValue(t.text,this.value):P.getValue(t.value,this.value):null,value:s?this.value:null,index:null}),this.allowObjectBinding?this.setProperties(l,!0):this.setProperties({value:e,text:e&&e.toString(),index:null},!0),this.activeIndex=this.index,this.fields),l={};l[n.text]=P.isNullOrUndefined(e)?null:e.toString(),l[n.value]=P.isNullOrUndefined(e)?null:e.toString(),this.itemData=l,this.item=null,(!this.allowObjectBinding&&this.previousValue!==this.value||this.allowObjectBinding&&this.previousValue&&this.value&&!this.isObjectInArray(this.previousValue,[this.value]))&&this.detachChangeEvent(null)},x.prototype.updateValues=function(){var e,t,i,s,l,n,a;this.fields.disabled&&(null!=this.value&&(this.value=this.isDisableItemValue(this.value)?null:this.value),null!=this.text&&(this.text=this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?null:this.text),null!=this.index)&&(this.index=this.isDisabledItemByIndex(this.index)?null:this.index,this.activeIndex=this.index),P.isNullOrUndefined(this.value)?this.text&&P.isNullOrUndefined(this.value)?(e=this.getElementByText(this.text))?this.setSelection(e,null):(h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton),this.customValue()):this.setSelection(this.liCollections[this.activeIndex],null):(s=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,e=this.getElementByValue(s),s=!P.isNullOrUndefined(e),this.enableVirtualization&&this.value&&(t=this.fields.value||"",i=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,this.dataSource instanceof c.DataManager?(l=new c.DataManager(this.virtualGroupDataSource).executeLocal((new c.Query).where(new c.Predicate(t,"equal",i))))&&0<l.length&&(this.itemData=l[0],s=!0,n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:a}):(l=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(new c.Predicate(t,"equal",i))))&&0<l.length&&(this.itemData=l[0],s=!0,n=this.getItemData(),a=this.allowObjectBinding?this.getDataByValue(n.value):n.value,this.value===n.value&&this.text!==n.text||this.value!==n.value&&this.text===n.text)&&this.setProperties({text:n.text&&n.text.toString(),value:a})),e?this.setSelection(e,null):!this.enableVirtualization&&this.allowCustom||this.allowCustom&&this.enableVirtualization&&!s?this.valueMuteChange(this.value):this.enableVirtualization&&(!this.enableVirtualization||s)||this.valueMuteChange(null)),this.setHiddenValue(),h.Input.setValue(this.text,this.inputElement,this.floatLabelType,this.showClearButton)},x.prototype.updateIconState=function(){this.showClearButton&&(this.inputElement&&""!==this.inputElement.value&&!this.readonly?P.removeClass([this.inputWrapper.clearButton],f.clearIconHide):P.addClass([this.inputWrapper.clearButton],f.clearIconHide))},x.prototype.getAriaAttributes=function(){return{role:"combobox","aria-autocomplete":"both","aria-labelledby":this.hiddenElement.id,"aria-expanded":"false","aria-readonly":this.readonly?this.readonly.toString():"false",autocomplete:"off",autocapitalize:"off",spellcheck:"false"}},x.prototype.searchLists=function(e){this.isTyped=!0,this.isFiltering()?(S.prototype.searchLists.call(this,e),this.ulElement&&""===this.filterInput.value.trim()&&this.setHoverList(this.ulElement.querySelector("."+f.li))):(this.ulElement&&""===this.inputElement.value&&this.preventAutoFill&&this.setHoverList(this.ulElement.querySelector("."+f.li)),this.incrementalSearch(e))},x.prototype.getNgDirective=function(){return"EJS-COMBOBOX"},x.prototype.setSearchBox=function(){return this.filterInput=this.inputElement,this.isFiltering()||this.isReact&&"combobox"===this.getModuleName()?this.inputWrapper:Ke},x.prototype.onActionComplete=function(e,t,i,s){var l=this;S.prototype.onActionComplete.call(this,e,t,i),this.isSelectCustom&&this.removeSelection(),this.preventAutoFill||"combobox"!==this.getModuleName()||!this.isTyped||this.enableVirtualization||setTimeout(function(){l.inlineSearch()})},x.prototype.getFocusElement=function(){var e=this.isSelectCustom?{text:""}:this.getItemData(),t=P.isNullOrUndefined(this.list)?this.list:this.list.querySelector("."+f.selected);if(e.text&&e.text.toString()===this.inputElement.value&&!P.isNullOrUndefined(t))return t;if((P.Browser.isDevice&&!this.isDropDownClick||!P.Browser.isDevice)&&!P.isNullOrUndefined(this.liCollections)&&0<this.liCollections.length){var i=this.inputElement.value,s=this.sortedData,l=this.typeOfData(s).typeof,n=d(i,this.liCollections,this.filterType,!0,s,this.fields,l,this.ignoreAccent);if(this.enableVirtualization&&""!==i&&"autocomplete"!==this.getModuleName()&&this.isTyped&&!this.allowFiltering){var a=!1,e=this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount,t=0===this.incrementalEndIndex;for((e||t)&&(a=!0,this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=t?Math.min(100,this.totalItemCount):Math.min(this.incrementalEndIndex+100,this.totalItemCount),this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0),0===this.viewPortInfo.startIndex&&!a||this.updateIncrementalView(0,this.itemCount),n=d(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l);P.isNullOrUndefined(n.item)&&this.incrementalEndIndex<this.totalItemCount;){if(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),a=!0,0===this.viewPortInfo.startIndex&&!a||this.updateIncrementalView(0,this.itemCount),n=d(i,this.incrementalLiCollections,this.filterType,!0,s,this.fields,l),!P.isNullOrUndefined(n)){n.index=n.index+this.incrementalStartIndex;break}if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}}e=0<n.index-(this.itemCount/2-2)?n.index-(this.itemCount/2-2):0,t=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount;e!==this.viewPortInfo.startIndex&&this.updateIncrementalView(e,t),P.isNullOrUndefined(n.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(e=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,t=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(e,t),n.item=this.getElementByValue(n.item.getAttribute("data-value"))),n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}var o,r,h,u,p,e=n.item;return P.isNullOrUndefined(e)?this.isSelectCustom&&""!==this.inputElement.value.trim()&&(this.removeFocus(),this.enableVirtualization||(this.list.scrollTop=0)):(t=this.getIndexByValue(e.getAttribute("data-value"))-1,o=parseInt(getComputedStyle(this.liCollections[0],null).getPropertyValue("height"),10),isNaN(o)||"autocomplete"===this.getModuleName()||(this.removeFocus(),r=this.fields.groupBy?this.liCollections[0].offsetHeight:0,this.enableVirtualization?(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.enableVirtualization&&!this.fields.groupBy&&(u=e.offsetTop+(this.virtualListInfo&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex:0)*(h=e.offsetHeight),p=this.list.querySelectorAll(".e-virtual-list").length,this.list.scrollTop=u-p*h)):this.list.scrollTop=t*o+r,P.addClass([e],f.focus))),e}return null},x.prototype.setValue=function(e){return(e&&"keydown"===e.type&&"enter"===e.action||e&&"click"===e.type)&&this.removeFillSelection(),this.autofill&&"combobox"===this.getModuleName()&&e&&"keydown"===e.type&&"enter"!==e.action?(this.preventAutoFill=!1,this.inlineSearch(e),!1):S.prototype.setValue.call(this,e)},x.prototype.checkCustomValue=function(){var e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,e=(this.itemData=this.getDataByValue(e),this.getItemData()),t=this.allowObjectBinding?this.itemData:e.value;this.allowCustom&&P.isNullOrUndefined(e.value)&&P.isNullOrUndefined(e.text)||this.setProperties({value:t},!this.allowCustom)},x.prototype.showSpinner=function(){P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement="autocomplete"===this.getModuleName()?this.inputWrapper.buttons[0]||this.inputWrapper.clearButton||h.Input.appendSpan("e-input-group-icon "+ze,this.inputWrapper.container,this.createElement):this.inputWrapper.buttons[0]||this.inputWrapper.clearButton,P.addClass([this.spinnerElement],f.disableIcon),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement))},x.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],f.disableIcon),this.spinnerElement.classList.contains(ze)?P.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},x.prototype.setAutoFill=function(e,t){var i,s;t||this.setHoverList(e),this.autofill&&!this.preventAutoFill&&(i=this.getTextByValue(e.getAttribute("data-value")).toString(),s=this.getFormattedValue(e.getAttribute("data-value")),"combobox"===this.getModuleName()&&(!this.isSelected&&!this.allowObjectBinding&&this.previousValue!==s||this.allowObjectBinding&&this.previousValue&&s&&!this.isObjectInArray(this.previousValue,[this.getDataByValue(s)])?(this.updateSelectedItem(e,null),this.isSelected=!0,this.previousValue=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(e.getAttribute("data-value"))):this.getFormattedValue(e.getAttribute("data-value"))):this.updateSelectedItem(e,null,!0)),this.isAndroidAutoFill(i)||this.setAutoFillSelection(i,t))},x.prototype.isAndroidAutoFill=function(e){var t,i,s,l;return!!P.Browser.isAndroid&&(l=this.getSelectionPoints(),t=this.prevSelectPoints.end,i=l.end,s=this.prevSelectPoints.start,l=l.start,0!==t)&&(t===e.length&&s===e.length||l<s&&i<t||t===i&&s===l)},x.prototype.clearAll=function(e,t){(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t)&&P.isNullOrUndefined(t.dataSource))&&S.prototype.clearAll.call(this,e),this.isFiltering()&&!P.isNullOrUndefined(e)&&e.target===this.inputWrapper.clearButton&&(this.typedString=this.filterInput.value,this.searchLists(e))},x.prototype.isSelectFocusItem=function(e){return!P.isNullOrUndefined(e)},x.prototype.inlineSearch=function(e){var t,e=e&&("down"===e.action||"up"===e.action||"home"===e.action||"end"===e.action||"pageUp"===e.action||"pageDown"===e.action),i=e?this.liCollections[this.activeIndex]:this.getFocusElement();P.isNullOrUndefined(i)?P.isNullOrUndefined(this.inputElement)||""!==this.inputElement.value?(this.activeIndex=null,this.removeSelection(),this.liCollections&&0<this.liCollections.length&&!this.isCustomFilter&&this.removeFocus()):(this.activeIndex=null,P.isNullOrUndefined(this.list)||(this.enableVirtualization||(this.list.scrollTop=0),t=this.list.querySelector("."+f.li),this.setHoverList(t))):(e||(t=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(t),this.activeIndex=P.isNullOrUndefined(this.activeIndex)?null:this.activeIndex),this.preventAutoFill=""!==this.inputElement.value&&this.preventAutoFill,this.setAutoFill(i,e))},x.prototype.incrementalSearch=function(e){this.showPopup(e),P.isNullOrUndefined(this.listData)||(this.inlineSearch(e),e.preventDefault())},x.prototype.setAutoFillSelection=function(e,t){void 0===t&&(t=!1);var i=this.getSelectionPoints(),s=this.inputElement.value.substr(0,i.start);s&&s.toLowerCase()===e.substr(0,i.start).toLowerCase()?(s=s+e.substr(s.length,e.length),h.Input.setValue(s,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(i.start,this.inputElement.value.length)):t&&(h.Input.setValue(e,this.inputElement,this.floatLabelType,this.showClearButton),this.inputElement.setSelectionRange(0,this.inputElement.value.length))},x.prototype.getValueByText=function(e){return S.prototype.getValueByText.call(this,e,!0,this.ignoreAccent)},x.prototype.unWireEvent=function(){"combobox"===this.getModuleName()&&(P.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.preventBlur),P.EventHandler.remove(this.inputWrapper.container,"blur",this.onBlurHandler)),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.EventHandler.remove(this.inputWrapper.buttons[0],"mousedown",this.dropDownClick),this.inputElement&&(P.EventHandler.remove(this.inputElement,"focus",this.targetFocus),this.readonly||(P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),P.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown),P.EventHandler.remove(this.inputElement,"paste",this.pasteHandler),P.EventHandler.remove(window,"resize",this.windowResize))),this.unBindCommonEvent()},x.prototype.setSelection=function(e,t){S.prototype.setSelection.call(this,e,t),P.isNullOrUndefined(e)||this.autofill||this.isDropDownClick||this.removeFocus()},x.prototype.selectCurrentItem=function(e){var t;if(this.isPopupOpen){if(t=this.isSelected?this.list.querySelector("."+f.selected):this.list.querySelector("."+f.focus),this.isDisabledElement(t))return;t&&(this.setSelection(t,e),this.isTyped=!1),this.isSelected&&(this.isSelectCustom=!1,this.onChangeEvent(e))}"enter"===e.action&&""===this.inputElement.value?this.clearAll(e):this.isTyped&&!this.isSelected&&P.isNullOrUndefined(t)&&this.customValue(e),this.hidePopup(e)},x.prototype.setHoverList=function(e){this.removeSelection(),this.isValidLI(e)&&!e.classList.contains(f.selected)&&(this.removeFocus(),e.classList.add(f.focus))},x.prototype.targetFocus=function(e){P.Browser.isDevice&&!this.allowFiltering&&(this.preventFocus=!1),this.onFocus(e),h.Input.calculateWidth(this.inputElement,this.inputWrapper.container)},x.prototype.dropDownClick=function(e){e.preventDefault(),P.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),S.prototype.dropDownClick.call(this,e)},x.prototype.customValue=function(t){var i,s,e,l,n=this,a=this.getValueByText(this.inputElement.value);this.allowCustom||""===this.inputElement.value?""!==this.inputElement.value?(i=this.value,P.isNullOrUndefined(a)?(e={text:s=""===this.inputElement.value?null:this.inputElement.value,item:{}},this.isObjectCustomValue=!0,this.initial?this.updateCustomValueCallback(s,e,i):this.trigger("customValueSpecifier",e,function(e){n.updateCustomValueCallback(s,e,i,t)})):(this.isSelectCustom=!1,a=this.allowObjectBinding?this.getDataByValue(a):a,this.setProperties({value:a}),(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&i&&this.value&&!this.isObjectInArray(i,[this.value]))&&this.onChangeEvent(t))):this.allowCustom&&this.isFocused&&(this.isSelectCustom=!0):(e=this.previousValue,l=this.value,a=this.allowObjectBinding?this.getDataByValue(a):a,this.setProperties({value:a}),P.isNullOrUndefined(this.value)&&h.Input.setValue("",this.inputElement,this.floatLabelType,this.showClearButton),this.autofill&&(!this.allowObjectBinding&&e===this.value||this.allowObjectBinding&&e&&this.isObjectInArray(e,[this.value]))&&(!this.allowObjectBinding&&l!==this.value||this.allowObjectBinding&&l&&!this.isObjectInArray(l,[this.value]))&&this.onChangeEvent(null))},x.prototype.updateCustomValueCallback=function(e,t,i,s){var l=this,n=this.fields,t=t.item,a={},o=(t&&P.getValue(n.text,t)&&P.getValue(n.value,t)?a=t:(P.setValue(n.text,e,a),P.setValue(n.value,e,a)),this.itemData=a,{}),e=(this.allowObjectBinding&&(t=this.listData&&0<this.listData.length?Object.keys(this.listData[0]):Object.keys(this.itemData),(t=this.listData&&0<this.listData.length||!("autocomplete"===this.getModuleName()||"combobox"===this.getModuleName()&&this.allowFiltering)?t:this.firstItem?Object.keys(this.firstItem):Object.keys(this.itemData)).forEach(function(e){o[e]=e===n.value||e===n.text?P.getValue(n.value,l.itemData):null})),{text:P.getValue(n.text,this.itemData),value:this.allowObjectBinding?o:P.getValue(n.value,this.itemData),index:null});this.setProperties(e,!0),this.setSelection(null,null),this.isSelectCustom=!0,this.isObjectCustomValue=!1,(!this.allowObjectBinding&&i!==this.value||this.allowObjectBinding&&(null==i&&null!==this.value||i&&!this.isObjectInArray(i,[this.value])))&&this.onChangeEvent(s,!0)},x.prototype.onPropertyChanged=function(e,t){"combobox"===this.getModuleName()&&(this.checkData(e),this.setUpdateInitial(["fields","query","dataSource"],e,t));for(var i=0,s=Object.keys(e);i<s.length;i++){var l=s[i];switch(l){case"readonly":h.Input.setReadonly(this.readonly,this.inputElement),this.readonly?(P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.onFilterUp),P.EventHandler.remove(this.inputElement,"keydown",this.onFilterDown)):(P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"keyup",this.onFilterUp,this),P.EventHandler.add(this.inputElement,"keydown",this.onFilterDown,this)),this.setReadOnly();break;case"allowFiltering":this.setSearchBox(),this.isFiltering()&&"combobox"===this.getModuleName()&&P.isNullOrUndefined(this.list)&&S.prototype.renderList.call(this);break;case"allowCustom":break;default:var n=this.getPropObject(l,e,t);S.prototype.onPropertyChanged.call(this,n.newProperty,n.oldProperty),this.isFiltering()&&"dataSource"===l&&P.isNullOrUndefined(this.list)&&this.itemTemplate&&"combobox"===this.getModuleName()&&S.prototype.renderList.call(this)}}},x.prototype.render=function(){S.prototype.render.call(this),this.setSearchBox(),this.renderComplete(),this.autoFill=this.autofill},x.prototype.getModuleName=function(){return"combobox"},x.prototype.addItem=function(e,t){S.prototype.addItem.call(this,e,t)},x.prototype.filter=function(e,t,i){S.prototype.filter.call(this,e,t,i)},x.prototype.showPopup=function(e){S.prototype.showPopup.call(this,e)},x.prototype.hidePopup=function(e){var t=this.inputElement&&""===this.inputElement.value?null:this.inputElement&&this.inputElement.value;if(!P.isNullOrUndefined(this.listData)){var i,s=this.isEscapeKey,l=(this.isEscapeKey&&(h.Input.setValue(this.typedString,this.inputElement,this.floatLabelType,this.showClearButton),this.isEscapeKey=!1),this.autofill&&this.removeFillSelection(),this.isSelectCustom?{text:""}:this.getItemData()),n=P.isNullOrUndefined(this.list)?null:this.list.querySelector("."+f.selected);if(this.inputElement&&l.text===this.inputElement.value&&!P.isNullOrUndefined(n))return this.isSelected&&(this.onChangeEvent(e),this.isSelectCustom=!1),void S.prototype.hidePopup.call(this,e);"combobox"===this.getModuleName()&&""!==this.inputElement.value.trim()&&(l=this.sortedData,n=this.typeOfData(l).typeof,i=d(this.inputElement.value,this.liCollections,"Equal",!0,l,this.fields,n),this.selectedLI=i.item,P.isNullOrUndefined(i.index)&&(i.index=d(this.inputElement.value,this.liCollections,"StartsWith",!0,l,this.fields,n).index),this.activeIndex=i.index,P.isNullOrUndefined(this.selectedLI)?s&&(this.isSelectCustom=!0,this.removeSelection()):this.updateSelectedItem(this.selectedLI,null,!0)),this.isEscapeKey||!this.isTyped||this.isInteracted||this.customValue(e)}l=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value;P.isNullOrUndefined(this.listData)&&this.allowCustom&&!P.isNullOrUndefined(t)&&t!==l&&this.customValue(),S.prototype.hidePopup.call(this,e)},x.prototype.focusIn=function(){this.enabled&&(P.Browser.isDevice&&!this.isFiltering()&&(this.preventFocus=!0),S.prototype.focusIn.call(this))},x.prototype.clear=function(){this.value=null},x.prototype.focusOut=function(e){S.prototype.focusOut.call(this,e)},x.prototype.getItems=function(){return S.prototype.getItems.call(this)},x.prototype.getDataByValue=function(e){return S.prototype.getDataByValue.call(this,e)},E([P.Property(!(x.prototype.renderHightSearch=function(){}))],x.prototype,"autofill",void 0),E([P.Property(!0)],x.prototype,"allowCustom",void 0),E([P.Property({})],x.prototype,"htmlAttributes",void 0),E([P.Property(!1)],x.prototype,"allowFiltering",void 0),E([P.Property(!0)],x.prototype,"isDeviceFullScreen",void 0),E([P.Property(null)],x.prototype,"query",void 0),E([P.Property(null)],x.prototype,"index",void 0),E([P.Property(!0)],x.prototype,"showClearButton",void 0),E([P.Property(!1)],x.prototype,"enableRtl",void 0),E([P.Event()],x.prototype,"customValueSpecifier",void 0),E([P.Event()],x.prototype,"filtering",void 0),E([P.Property(null)],x.prototype,"valueTemplate",void 0),E([P.Property("Never")],x.prototype,"floatLabelType",void 0),E([P.Property(null)],x.prototype,"filterBarPlaceholder",void 0),E([P.Property(null)],x.prototype,"cssClass",void 0),E([P.Property(null)],x.prototype,"headerTemplate",void 0),E([P.Property(null)],x.prototype,"footerTemplate",void 0),E([P.Property(null)],x.prototype,"placeholder",void 0),E([P.Property("100%")],x.prototype,"width",void 0),E([P.Property("300px")],x.prototype,"popupHeight",void 0),E([P.Property("100%")],x.prototype,"popupWidth",void 0),E([P.Property(!1)],x.prototype,"readonly",void 0),E([P.Property(null)],x.prototype,"text",void 0),E([P.Property(null)],x.prototype,"value",void 0),E([P.Property(!1)],x.prototype,"allowObjectBinding",void 0),E([P.NotifyPropertyChanges],x));function x(e,t){return S.call(this,e,t)||this}_e=function(e,t){return(_e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var _e,I,E=function(e,t){function i(){this.constructor=e}_e(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},w=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},E=(f.root="e-autocomplete",f.icon="e-input-group-icon e-ddl-icon e-search-icon",E(O,I=a),O.prototype.preRender=function(){I.prototype.preRender.call(this)},O.prototype.getLocaleName=function(){return"auto-complete"},O.prototype.getNgDirective=function(){return"EJS-AUTOCOMPLETE"},O.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new c.Query,e=this.allowObjectBinding&&!P.isNullOrUndefined(this.value)?P.getValue(this.fields.value||"",this.value):this.value,s=""!==this.queryString||P.isNullOrUndefined(e)?this.filterType:"equal",e=""!==this.queryString||P.isNullOrUndefined(e)?this.queryString:e;if(this.isFiltered)if(this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery))i=this.customFilterQuery.clone();else if(!this.enableVirtualization)return i;if(null!==this.queryString&&""!==this.queryString&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==t)&&"number"!==t?(t=P.isNullOrUndefined(this.fields.value)?"":this.fields.value,i.where(t,s,e,this.ignoreCase,this.ignoreAccent)):i.where("",s,e,this.ignoreCase,this.ignoreAccent)),!P.isNullOrUndefined(this.suggestionCount)&&!this.enableVirtualization){if(20!==this.suggestionCount)for(var l=0;l<i.queries.length;l++)"onTake"===i.queries[l].fn&&i.queries.splice(l,1);i.take(this.suggestionCount)}if(this.enableVirtualization){var n=0,a=0,o=this.getTakeValue();if(i&&0<i.queries.length)for(l=0;l<i.queries.length;l++)"onSkip"===i.queries[l].fn&&(a=i.queries[l].e.nos),"onTake"===i.queries[l].fn&&(n=o<=i.queries[l].e.nos?i.queries[l].e.nos:o);if(n<=0&&this.query&&0<this.query.queries.length)for(var r,l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=o<=(r=this.query.queries[l].e.nos)?r:o);if(i&&0<i.queries.length)for(var h,l=0;l<i.queries.length;l++)"onSkip"===i.queries[l].fn?(a=i.queries[l].e.nos,i.queries.splice(l,1),--l):"onTake"===i.queries[l].fn&&(n=(h=i.queries[l].e.nos)<=n?n:h,i.queries.splice(l,1),--l);0<a&&this.virtualItemStartIndex<=a?i.skip(a):i.skip(this.virtualItemStartIndex),0<n&&o<=n?i.take(n):i.take(o),i.requiresCount()}return i},O.prototype.searchLists=function(t){var s,l=this;this.isTyped=!0,this.isDataFetched=this.isSelectCustom=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.checkAndResetCache(),P.isNullOrUndefined(this.list)&&I.prototype.renderList.call(this,t,!0),this.queryString=this.filterInput.value,"mousedown"===t.type||40!==t.keyCode&&38!==t.keyCode?(this.isSelected=!1,this.activeIndex=null,s={preventDefaultAction:this.isRequesting=!1,text:this.filterInput.value,updateData:function(e,t,i){s.cancel||(l.isFiltered=!0,l.customFilterQuery=t,l.filterAction(e,t,i))},cancel:!1},this.trigger("filtering",s,function(e){e.cancel||l.isFiltered||e.preventDefaultAction||(l.searchList=!0,l.filterAction(l.dataSource,null,l.fields,t))})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields,null,t))},O.prototype.filter=function(e,t,i){this.isFiltered=!0,this.filterAction(e,t,i)},O.prototype.filterAction=function(e,t,i,s){this.beforePopupOpen=!0;var l;this.list.classList.contains("e-nodata");""!==this.queryString&&this.queryString.length>=this.minLength?(this.enableVirtualization&&this.isFiltering()&&this.isTyped&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.resetList(e,i,t,s),e=this.list.classList.contains("e-nodata"),this.enableVirtualization&&!e&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")&&((l=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(l).appendChild(this.list.querySelector(".e-list-parent"))),!this.list.querySelector(".e-virtual-ddl"))&&this.list.parentElement&&((l=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.list.parentElement.querySelector(".e-dropdownbase").appendChild(l)),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount()):(this.hidePopup(s),this.beforePopupOpen=!1),this.renderReactTemplates()},O.prototype.clearAll=function(e,t){(P.isNullOrUndefined(t)||!P.isNullOrUndefined(t)&&P.isNullOrUndefined(t.dataSource))&&(I.prototype.clearAll.call(this,e),this.checkAndResetCache()),this.beforePopupOpen&&this.hidePopup()},O.prototype.onActionComplete=function(e,t,i,s){this.enableVirtualization||(this.fixedHeaderElement=null),("autocomplete"===this.getModuleName()&&!(this.dataSource instanceof c.DataManager)||"autocomplete"===this.getModuleName()&&this.dataSource instanceof c.DataManager&&0!==this.totalItemCount)&&this.getFilteringSkeletonCount(),I.prototype.onActionComplete.call(this,e,t,i);e=this.list.querySelector("."+f.li);P.isNullOrUndefined(e)||P.removeClass([e],f.focus),P.isNullOrUndefined(this.itemData)||this.enableVirtualization||this.focusIndexItem(),this.postBackAction()},O.prototype.postBackAction=function(){var e,t,i;this.autofill&&!P.isNullOrUndefined(this.liCollections[0])&&this.searchList&&(i=[this.liCollections[0]],e=this.listData,t=this.typeOfData(e).typeof,i=d(this.inputElement.value,i,"StartsWith",this.ignoreCase,e,this.fields,t),this.searchList=!1,P.isNullOrUndefined(i.item)||I.prototype.setAutoFill.call(this,this.liCollections[0],!0))},O.prototype.setSelection=function(e,t){var i;this.isValidLI(e)?!P.isNullOrUndefined(t)&&"keydown"===t.type&&"enter"!==t.action&&"tab"!==t.action&&this.isValidLI(e)?(i=this.getFormattedValue(e.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i),this.setHoverList(e),this.selectedLI=e,this.setScrollPosition(t),this.autofill&&this.isPopupOpen&&(this.preventAutoFill=!1,i=t&&"down"===t.action||"up"===t.action||"home"===t.action||"end"===t.action||"pageUp"===t.action||"pageDown"===t.action,I.prototype.setAutoFill.call(this,e,i))):(I.prototype.setSelection.call(this,e,t),this.isFiltered=!1):this.selectedLI=e},O.prototype.listOption=function(e,t){var i,s=this,e=I.prototype.listOption.call(this,e,t);return P.isNullOrUndefined(e.itemCreated)?e.itemCreated=function(e){s.highlight&&(s.element.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout(function(){K(e.item,s.queryString,s.ignoreCase,s.filterType)},0):K(e.item,s.queryString,s.ignoreCase,s.filterType))}:(i=e.itemCreated,e.itemCreated=function(e){s.highlight&&K(e.item,s.queryString,s.ignoreCase,s.filterType),i.apply(s,[e])}),e},O.prototype.isFiltering=function(){return!0},O.prototype.renderPopup=function(e){this.enableVirtualization||(this.list.scrollTop=0),I.prototype.renderPopup.call(this,e)},O.prototype.isEditTextBox=function(){return!1},O.prototype.isPopupButton=function(){return this.showPopupButton},O.prototype.isSelectFocusItem=function(e){return!1},O.prototype.setInputValue=function(t,e){var i,s,l,n,a=e&&e.text?e.text:e&&e.value,e=t&&t.text?t.text:(t&&t.value?t:this).value;this.allowObjectBinding&&(a=P.isNullOrUndefined(a)?a:P.getValue(this.fields.value||"",a),e=P.isNullOrUndefined(e)?e:P.getValue(this.fields.value||"",e)),!e||""!==this.typedString||this.allowCustom||this.dataSource instanceof c.DataManager?t&&(t.text?this.setOldText(a):this.setOldValue(a)):(i="string"===this.typeOfData(this.dataSource).typeof?"":this.fields.value,s=this.getItems().length,l=new c.Query,new c.DataManager((n=this).dataSource).executeQuery(l.where(new c.Predicate(i,"equal",e))).then(function(e){0<e.result.length?(n.value=""!==i?n.allowObjectBinding?e.result[0]:e.result[0][n.fields.value].toString():e.result[0].toString(),n.addItem(e.result,s),n.updateValues()):t&&t.text?n.setOldText(a):t&&t.value?n.setOldValue(a):n.updateValues()}))},O.prototype.showPopup=function(e){this.enabled&&(this.beforePopupOpen?this.refreshPopup():(this.beforePopupOpen=!0,this.preventAutoFill=!0,P.isNullOrUndefined(this.list)?this.renderList(e):this.resetList(this.dataSource,this.fields,null,e)))},O.prototype.hidePopup=function(e){I.prototype.hidePopup.call(this,e),this.activeIndex=null,this.virtualListInfo=this.viewPortInfo,this.previousStartIndex=this.viewPortInfo.startIndex,this.startIndex=this.viewPortInfo.startIndex,this.previousEndIndex=this.viewPortInfo.endIndex},O.prototype.onPropertyChanged=function(e,t){"autocomplete"===this.getModuleName()&&this.setUpdateInitial(["fields","query","dataSource"],e);for(var i=0,s=Object.keys(e);i<s.length;i++){var l,n=s[i];"showPopupButton"===n?this.showPopupButton?(l=h.Input.appendSpan(f.icon,this.inputWrapper.container,this.createElement),this.inputWrapper.buttons[0]=l,h.Input.calculateWidth(this.inputElement,this.inputWrapper.container),P.isNullOrUndefined(this.inputWrapper.buttons[0])||P.isNullOrUndefined(this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0])||"Never"===this.floatLabelType||this.inputWrapper.container.getElementsByClassName("e-float-text-overflow")[0].classList.add("e-icon"),this.inputWrapper&&this.inputWrapper.buttons&&this.inputWrapper.buttons[0]&&P.EventHandler.add(this.inputWrapper.buttons[0],"click",this.dropDownClick,this)):(P.detach(this.inputWrapper.buttons[0]),this.inputWrapper.buttons[0]=null):(l=this.getPropObject(n,e,t),I.prototype.onPropertyChanged.call(this,l.newProperty,l.oldProperty))}},O.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(_(this.liCollections[e]),K(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType)),0},O.prototype.getModuleName=function(){return"autocomplete"},O.prototype.render=function(){I.prototype.render.call(this)},w([P.Complex({value:null,iconCss:null,groupBy:null,disabled:null},ee)],O.prototype,"fields",void 0),w([P.Property(!0)],O.prototype,"ignoreCase",void 0),w([P.Property(!1)],O.prototype,"showPopupButton",void 0),w([P.Property(!1)],O.prototype,"highlight",void 0),w([P.Property(20)],O.prototype,"suggestionCount",void 0),w([P.Property({})],O.prototype,"htmlAttributes",void 0),w([P.Property(null)],O.prototype,"query",void 0),w([P.Property(1)],O.prototype,"minLength",void 0),w([P.Property("Contains")],O.prototype,"filterType",void 0),w([P.Event()],O.prototype,"filtering",void 0),w([P.Property(null)],O.prototype,"index",void 0),w([P.Property("Never")],O.prototype,"floatLabelType",void 0),w([P.Property(null)],O.prototype,"valueTemplate",void 0),w([P.Property(null)],O.prototype,"filterBarPlaceholder",void 0),w([P.Property(!1)],O.prototype,"allowFiltering",void 0),w([P.Property(null)],O.prototype,"text",void 0),w([P.NotifyPropertyChanges],O));function O(e,t){e=I.call(this,e,t)||this;return e.isFiltered=!1,e.searchList=!1,e}var Ge="e-float-line",Qe="e-float-text",Je="e-label-top",Xe="e-label-bottom";function Ye(e,t,i,s,l,n,a){var o=P.createElement("span",{className:Ge}),r=P.createElement("label",{className:Qe}),h=i.getAttribute("id")?i.getAttribute("id"):P.getUniqueID("ej2_multiselect");i.id=h,P.isNullOrUndefined(i.id)||""===i.id||(r.id="label_"+i.id.replace(/ /g,"_"),r.setAttribute("for",i.id),P.attributes(s,{"aria-labelledby":r.id})),P.isNullOrUndefined(s.placeholder)||""===s.placeholder||(r.innerText=st(s.placeholder),s.removeAttribute("placeholder")),r.innerText=st(a),t.appendChild(o),t.appendChild(r),e.classList.add("e-float-input"),$e(l,r),"Always"===n&&(r.classList.contains(Xe)&&P.removeClass([r],Xe),P.addClass([r],Je))}function $e(e,t){e&&0<e.length?(P.addClass([t],Je),P.removeClass([t],Xe)):(P.removeClass([t],Je),P.addClass([t],Xe))}function Ze(e,t,i,s,l,n,a){var o,r=t.querySelector("."+Qe),t=t.querySelector("."+Ge);P.isNullOrUndefined(r)?et(l,s,o=null!==a?a:""):(o=r.innerText,P.detach(i.querySelector("."+Qe)),et(l,s,o),P.isNullOrUndefined(t)||P.detach(i.querySelector("."+Ge))),e.classList.remove("e-float-input")}function et(e,t,i){e&&e.length?t.placeholder="":t.placeholder=i}function tt(e,t){e.classList.add("e-input-focus");e=t.querySelector("."+Qe);P.isNullOrUndefined(e)||(P.addClass([e],Je),e.classList.contains(Xe)&&P.removeClass([e],Xe))}function it(e,t,i,s,l){e.classList.remove("e-input-focus");e=t.querySelector("."+Qe);i&&i.length<=0&&"Auto"===s&&!P.isNullOrUndefined(e)&&(e.classList.contains(Je)&&P.removeClass([e],Je),P.addClass([e],Xe))}function st(e){var t,i="";return P.isNullOrUndefined(e)||""===e||((t=document.createElement("span")).innerHTML='<input placeholder="'+e+'"/>',i=t.children[0].placeholder),i}lt=function(e,t){return(lt=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 lt,A,w=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},nt="e-input-focus",at="e-disabled",D="e-hide-listitem",ot="e-chips",rt="e-chips-close",ht="e-chip-selected",ut="e-delimiter",pt="e-zero-size",dt="e-chips-close e-close-hooker",ct="e-delim-values",mt="e-close-icon-hide",ft="e-ddl-disable-icon",vt="e-ms-spinner-icon",gt="e-input-group-icon e-ddl-icon",yt="e-icon-anim",Ct="e-delim-total",bt="e-search-custom-width",St="e-input-filter",w=(function(e,t){function i(){this.constructor=e}lt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(k,A=Z),k.prototype.enableRTL=function(e){e?this.overAllWrapper.classList.add("e-rtl"):this.overAllWrapper.classList.remove("e-rtl"),this.popupObj&&(this.popupObj.enableRtl=e,this.popupObj.dataBind())},k.prototype.requiredModules=function(){var e,t=[];return this.enableVirtualization&&t.push({args:[this],member:"VirtualScroll"}),"CheckBox"===this.mode&&(this.isGroupChecking=this.enableGroupCheckBox,this.enableGroupCheckBox&&(e=this.isProtectedOnChange,this.isProtectedOnChange=!0,this.enableSelectionOrder=!1,this.isProtectedOnChange=e),this.allowCustomValue=!1,this.hideSelectedItem=!1,this.closePopupOnSelect=!1,t.push({member:"CheckBoxSelection",args:[this]})),t},k.prototype.updateHTMLAttribute=function(){if(Object.keys(this.htmlAttributes).length)for(var e=0,t=Object.keys(this.htmlAttributes);e<t.length;e++){var i=t[e];switch(i){case"class":var s=this.htmlAttributes[""+i].replace(/\s+/g," ").trim();""!==s&&(P.addClass([this.overAllWrapper],s.split(" ")),P.addClass([this.popupWrapper],s.split(" ")));break;case"disabled":this.enable(!1);break;case"placeholder":this.placeholder||(this.inputElement.setAttribute(i,this.htmlAttributes[""+i]),this.setProperties({placeholder:this.inputElement.placeholder},!0),this.refreshPlaceHolder());break;default:-1<["id"].indexOf(i)?this.element.setAttribute(i,this.htmlAttributes[""+i]):0===i.indexOf("data")||-1<["name","required","aria-required","form"].indexOf(i)?this.hiddenElement.setAttribute(i,this.htmlAttributes[""+i]):-1<["title","role","style","class"].indexOf(i)?this.overAllWrapper.setAttribute(i,this.htmlAttributes[""+i]):"size"===i||P.isNullOrUndefined(this.inputElement)||this.inputElement.setAttribute(i,this.htmlAttributes[""+i])}}},k.prototype.updateReadonly=function(e){P.isNullOrUndefined(this.inputElement)||(e||"CheckBox"===this.mode?this.inputElement.setAttribute("readonly","true"):this.inputElement.removeAttribute("readonly"))},k.prototype.updateClearButton=function(e){e?(this.overAllClear.parentNode?this.overAllClear.style.display="":this.componentWrapper.appendChild(this.overAllClear),this.componentWrapper.classList.remove(mt)):(this.overAllClear.style.display="none",this.componentWrapper.classList.add(mt))},k.prototype.updateCssClass=function(){var e;P.isNullOrUndefined(this.cssClass)||""===this.cssClass||(e=this.cssClass,""!==(e=this.cssClass.replace(/\s+/g," ").trim())&&(P.addClass([this.overAllWrapper],e.split(" ")),P.addClass([this.popupWrapper],e.split(" "))))},k.prototype.updateOldPropCssClass=function(e){P.isNullOrUndefined(e)||""===e||""!==(e=e.replace(/\s+/g," ").trim())&&(P.removeClass([this.overAllWrapper],e.split(" ")),P.removeClass([this.popupWrapper],e.split(" ")))},k.prototype.onPopupShown=function(e){var t,i=this,e=(P.Browser.isDevice&&"CheckBox"===this.mode&&this.allowFiltering&&(t=this,window.onpopstate=function(){t.hidePopup(),t.inputElement.focus()},history.pushState({},"")),{popup:this.popupObj,event:e,cancel:!1,animation:{name:"FadeIn",duration:100}});this.trigger("open",e,function(e){e.cancel||(i.focusAtFirstListItem(!0),i.popupObj&&document.body.appendChild(i.popupObj.element),"CheckBox"===i.mode&&i.enableGroupCheckBox&&!P.isNullOrUndefined(i.fields.groupBy)&&i.updateListItems(i.list.querySelectorAll("li.e-list-item"),i.mainList.querySelectorAll("li.e-list-item")),"CheckBox"!==i.mode&&!i.showDropDownIcon||P.addClass([i.overAllWrapper],[yt]),i.refreshPopup(),i.renderReactTemplates(),i.popupObj&&i.popupObj.show(e.animation,1e3===i.zIndex?i.element:null),i.isReact&&setTimeout(function(){var e,t;i.popupHeight&&i.list&&"auto"!==i.popupHeight&&(e="string"==typeof i.popupHeight?parseInt(i.popupHeight,10):i.popupHeight,!i.isUpdateHeaderHeight&&i.headerTemplate&&i.header&&(t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(t-i.header.offsetHeight).toString()+"px",i.isUpdateHeaderHeight=!0),!i.isUpdateFooterHeight)&&i.footerTemplate&&i.footer&&(t=""===i.list.style.maxHeight?e:parseInt(i.list.style.maxHeight,10),i.list.style.maxHeight=(t-i.footer.offsetHeight).toString()+"px",i.isUpdateFooterHeight=!0)},15),P.attributes(i.inputElement,{"aria-expanded":"true","aria-owns":i.element.id+"_popup","aria-controls":i.element.id}),i.updateAriaActiveDescendant(),i.isFirstClick&&!i.enableVirtualization&&i.loadTemplate(),"CheckBox"===i.mode&&i.showSelectAll&&P.EventHandler.add(i.popupObj.element,"click",i.clickHandler,i))})},k.prototype.updateVirtualReOrderList=function(e){var t=this.getForQuery(this.value,!0).clone();this.isVirtualReorder=!0,this.enableVirtualization&&this.dataSource instanceof c.DataManager?this.resetList(this.selectedListData,this.fields,t):this.resetList(this.dataSource,this.fields,t),this.isVirtualReorder=!1,this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t)),this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),e&&this.loadTemplate()},k.prototype.updateListItems=function(e,t){for(var i=0;i<e.length;i++)this.findGroupStart(e[i]),this.findGroupStart(t[i]);this.deselectHeader()},k.prototype.loadTemplate=function(){var e;this.refreshListItems(null),this.enableVirtualization&&this.list&&"CheckBox"===this.mode&&(e=this.list.querySelectorAll(".e-reorder")[0],this.list.querySelector(".e-virtual-ddl-content"))&&e&&this.list.querySelector(".e-virtual-ddl-content").removeChild(e),"CheckBox"===this.mode&&this.removeFocus(),this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}),this.isPreventScrollAction=!0},k.prototype.setScrollPosition=function(){var e;(!this.hideSelectedItem&&"CheckBox"!==this.mode||"CheckBox"===this.mode&&!this.enableSelectionOrder)&&!P.isNullOrUndefined(this.value)&&0<this.value.length&&(e=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],e=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",e),P.isNullOrUndefined(e)||this.scrollBottom(e,void 0,!1,null,!0)),this.enableVirtualization&&(e=this.list.querySelector("."+y.focus),this.isKeyBoardAction=!1,this.scrollBottom(e,void 0,!1,null,!0))},k.prototype.focusAtFirstListItem=function(e){var t;this.ulElement&&this.ulElement.querySelector("li."+y.li)&&(t=void 0,"CheckBox"===this.mode?this.removeFocus():(this.enableVirtualization?(t=this.fields.disabled?this.ulElement.querySelector("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem):not(."+at+")"):this.ulElement.querySelector("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"),e&&this.viewPortInfo&&0!==this.viewPortInfo.startIndex&&(t=(e=this.ulElement.querySelectorAll("li."+y.li+":not(.e-virtual-list):not(.e-hide-listitem)"))&&0<e.length?e[2]:t)):t=this.fields.disabled?this.ulElement.querySelector("li."+y.li+":not(."+D+"):not(."+at+")"):this.ulElement.querySelector("li."+y.li+":not(."+D+")"),null!==t&&(this.removeFocus(),this.addListFocus(t))))},k.prototype.focusAtLastListItem=function(e){var t;e?t=d(e,this.liCollections,"StartsWith",this.ignoreCase):this.value&&this.value.length?d(this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.liCollections,"StartsWith",this.ignoreCase):t=null,t&&null!==t.item&&(this.addListFocus(t.item),(this.allowCustomValue||this.allowFiltering)&&this.isPopupOpen()&&this.closePopupOnSelect&&!this.enableVirtualization||this.closePopupOnSelect&&!this.enableVirtualization)&&this.scrollBottom(t.item,t.index)},k.prototype.getAriaAttributes=function(){return{"aria-disabled":"false",role:"combobox","aria-expanded":"false"}},k.prototype.updateListARIA=function(){P.isNullOrUndefined(this.ulElement)||P.attributes(this.ulElement,{id:this.element.id+"_options",role:"listbox","aria-hidden":"false","aria-label":"list"});var e=!(P.isNullOrUndefined(this.inputElement)||!this.inputElement.disabled);this.isPopupOpen()||P.isNullOrUndefined(this.inputElement)||P.attributes(this.inputElement,this.getAriaAttributes()),e&&P.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled(e?"true":"false")},k.prototype.ensureAriaDisabled=function(e){var t;this.htmlAttributes&&this.htmlAttributes["aria-disabled"]&&(t=this.htmlAttributes,P.extend(t,{"aria-disabled":e},t),this.setProperties({htmlAttributes:t},!0))},k.prototype.removelastSelection=function(e){var t,i;null!==this.chipCollectionWrapper.querySelector("span."+ht)?this.removeSelectedChip(e):(t=(t=this.chipCollectionWrapper.querySelectorAll("span."+ot))[t.length-1].getAttribute("data-value"),P.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),i=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(t)):this.getFormattedValue(t),this.allowCustomValue&&("false"!==t&&!1===i||!P.isNullOrUndefined(i)&&"NaN"===i.toString())&&(i=t),this.removeValue(i,e),this.removeChipSelection(),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty(),this.mainList&&this.listData&&this.refreshSelection(),this.checkPlaceholderSize())},k.prototype.onActionFailure=function(e){A.prototype.onActionFailure.call(this,e),this.renderPopup(),this.onPopupShown()},k.prototype.targetElement=function(){return this.targetInputElement=this.inputElement,"CheckBox"===this.mode&&this.allowFiltering&&this.notify("targetElement",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.targetInputElement.value},k.prototype.getForQuery=function(e,t){var i=this.isPrimitiveData?"":this.fields.value;if(this.enableVirtualization&&e){if(t)for(var s=this.viewPortInfo.startIndex,l=s+this.viewPortInfo.endIndex<=e.length&&e[s+this.viewPortInfo.endIndex]?s+this.viewPortInfo.endIndex:e.length,n=s;n<l;n++)var a=this.allowObjectBinding?P.getValue(this.fields.value||"",e[n]):e[n],o=n===s?new c.Predicate(i,"equal",a):o.or(i,"equal",a);else for(n=0;n<e.length;n++){a=this.allowObjectBinding?P.getValue(this.fields.value||"",e[n]):e[n];o=this.isaddNonPresentItems?0===n?new c.Predicate(i,"equal",e[n]):o.or(i,"equal",e[n]):0===n?new c.Predicate(i,"notequal",a):o.and(i,"notequal",a)}return(new c.Query).where(o)}for(n=0;n<e.length;n++)o=0===n?new c.Predicate(i,"equal",e[n]):o.or(i,"equal",e[n]);return(this.dataSource instanceof c.DataManager&&this.dataSource.adaptor instanceof c.JsonAdaptor?new c.Query:this.getQuery(this.query).clone()).where(o)},k.prototype.onActionComplete=function(e,t,i,s){var l=this;this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(i)&&!this.virtualGroupDataSource&&(this.totalItemCount=i.count),this.value&&t&&0<t.length&&this.allowFiltering&&"CheckBox"!==this.mode&&!this.enableVirtualization&&!this.isFilterPrevented&&!this.allowCustomValue&&this.isFilteringAction&&t.every(function(e){var t=P.getValue(l.fields.value||"",e);return l.value.some(function(e){e=l.allowObjectBinding?P.getValue(l.fields.value||"",e):e;return t===e})})&&(e.innerHTML="",t=[]),A.prototype.onActionComplete.call(this,e,t,i),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.updateSelectElementData(this.allowFiltering);if(!P.isNullOrUndefined(this.value)&&!this.allowCustomValue&&!this.enableVirtualization&&this.listData&&0<this.listData.length)for(var n=0;n<this.value.length;n++){var a=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[n]):this.value[n];this.findListElement(this.allowFiltering&&!P.isNullOrUndefined(this.mainList)?this.mainList:e,"li","data-value",a)||this.dataSource instanceof c.DataManager||(this.value.splice(n,1),--n)}var o=[];0<(o=P.isNullOrUndefined(this.value)?o:this.presentItemValue(this.ulElement)).length&&this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(this.value)&&null!=this.listData?(this.isaddNonPresentItems=!0,this.addNonPresentItems(o,this.ulElement,this.listData),this.isaddNonPresentItems=!1):this.updateActionList(e,t,i),this.dataSource instanceof c.DataManager&&this.allowCustomValue&&!this.isCustomRendered&&this.inputElement.value&&""!==this.inputElement.value&&(o=new c.Query,o=this.allowFiltering?o.where(this.fields.text,"startswith",this.inputElement.value,this.ignoreCase,this.ignoreAccent):o,this.checkForCustomValue(o,this.fields),this.isCustomRendered=!0,this.remoteCustomValue=!this.enableVirtualization&&this.remoteCustomValue),"CheckBox"!==this.mode||!this.enableGroupCheckBox||P.isNullOrUndefined(this.fields.groupBy)||P.isNullOrUndefined(this.fields.disabled)||this.disableGroupHeader(),this.dataSource instanceof c.DataManager&&"CheckBox"===this.mode&&this.allowFiltering&&this.removeFocus()},k.prototype.updateActionList=function(e,t,i,s){"CheckBox"===this.mode&&this.showSelectAll&&this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.mainList||this.mainData?!P.isNullOrUndefined(this.mainData)&&0!==this.mainData.length||(this.mainData=t):(this.mainList=e.cloneNode?e.cloneNode(!0):e,this.mainData=t,this.mainListCollection=this.liCollections),(this.remoteCustomValue||t.length<=0)&&this.allowCustomValue&&this.inputFocus&&this.allowFiltering&&this.inputElement.value&&""!==this.inputElement.value&&(this.checkForCustomValue(this.tempQuery,this.fields),this.isCustomRendered)||(this.value&&this.value.length&&("CheckBox"!==this.mode&&!P.isNullOrUndefined(this.inputElement)&&""!==this.inputElement.value.trim()||"CheckBox"===this.mode||(8===this.keyCode||46===this.keyCode)&&this.allowFiltering&&this.allowCustomValue&&this.dataSource instanceof c.DataManager&&""===this.inputElement.value)&&this.refreshSelection(),this.updateListARIA(),this.unwireListEvents(),this.wireListEvents(),P.isNullOrUndefined(this.setInitialValue)||this.setInitialValue(),P.isNullOrUndefined(this.selectAllAction)||this.selectAllAction(),this.setDynValue&&(P.isNullOrUndefined(this.text)||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.enableVirtualization&&(!this.enableVirtualization||this.dataSource instanceof c.DataManager)?this.initialValueUpdate(this.listData,!0):this.initialValueUpdate(),this.initialUpdate(),this.refreshPlaceHolder(),"CheckBox"!==this.mode)&&this.changeOnBlur&&this.updateValueState(null,this.value,null),this.renderPopup(),this.beforePopupOpen&&(this.beforePopupOpen=!1,this.onPopupShown(i)))},k.prototype.refreshSelection=function(){var e=this.hideSelectedItem?D:y.selected;if(!P.isNullOrUndefined(this.value))for(var t=0;!P.isNullOrUndefined(this.value[t]);t++){var i,s=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[t]):this.value[t];(i=this.findListElement(this.list,"li","data-value",s))&&(P.addClass([i],e),this.hideSelectedItem&&i.previousSibling&&i.previousElementSibling.classList.contains(y.group)&&(!i.nextElementSibling||i.nextElementSibling.classList.contains(y.group))&&P.addClass([i.previousElementSibling],e),this.hideSelectedItem&&this.fields.groupBy&&!i.previousElementSibling.classList.contains(D)&&this.hideGroupItem(s),this.hideSelectedItem&&i.classList.contains(y.focus)&&(P.removeClass([i],y.focus),0<(s=i.parentElement.querySelectorAll("."+y.li+":not(."+D+"):not(."+at+")")).length?(P.addClass([s[0]],y.focus),this.updateAriaActiveDescendant()):this.list&&0<this.list.querySelectorAll("."+y.li).length||(this.l10nUpdate(),P.addClass([this.list],y.noData))),i.setAttribute("aria-selected","true"),"CheckBox"===this.mode)&&i.classList.contains("e-active")&&0===i.getElementsByClassName("e-check").length&&(s={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:i,e:null},this.notify("updatelist",s))}this.checkSelectAll(),this.checkMaxSelection()},k.prototype.hideGroupItem=function(e){for(var t,i=this.hideSelectedItem?D:y.selected,s=t=this.findListElement(this.ulElement,"li","data-value",e),l=0,n=0,a=!0,o=!0;!(a=t&&t.previousElementSibling&&!t.previousElementSibling.classList.contains(D)&&t.previousElementSibling.classList.contains(y.li)?!1:a)||!t||t.previousElementSibling&&t.previousElementSibling.classList.contains(y.group)?l=10:t=t.previousElementSibling,!(o=s&&s.nextElementSibling&&!s.nextElementSibling.classList.contains(D)&&s.nextElementSibling.classList.contains(y.li)?!1:o)||!s||s.nextElementSibling&&s.nextElementSibling.classList.contains(y.group)?n=10:s=s.nextElementSibling,l<10||n<10;);a&&o&&!t.previousElementSibling.classList.contains(D)?P.addClass([t.previousElementSibling],i):a&&o&&t.previousElementSibling.classList.contains(D)&&P.removeClass([t.previousElementSibling],i)},k.prototype.getValidLi=function(){var e=this.ulElement.querySelector("li."+y.li+":not(."+D+")");return P.isNullOrUndefined(e)?this.liCollections[0]:e},k.prototype.checkSelectAll=function(){var e=(P.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li.e-list-group-item.e-active"):this.list.querySelectorAll("li.e-list-group-item.e-active:not(.e-disabled)")).length,t=this.list.querySelectorAll("li.e-list-item"),i=(this.enableVirtualization?this.list.querySelectorAll("li."+y.li+":not(.e-virtual-list)"):P.isNullOrUndefined(this.fields.disabled)?this.list.querySelectorAll("li."+y.li):this.list.querySelectorAll("li."+y.li+":not(.e-disabled)")).length,s=this.list.querySelectorAll("li."+y.selected).length;if(this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(s-=e),!this.enableVirtualization&&(i===s||s===this.maximumSelectionLength)&&"CheckBox"===this.mode&&this.showSelectAll||this.enableVirtualization&&"CheckBox"===this.mode&&this.showSelectAll&&this.virtualSelectAll&&this.value&&this.value.length===this.totalItemCount?this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check"}):i!==s&&"CheckBox"===this.mode&&this.showSelectAll&&(!this.enableVirtualization||this.enableVirtualization&&!this.virtualSelectAll)&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),this.enableGroupCheckBox&&this.fields.groupBy&&!this.enableSelectionOrder){for(var l=0;l<t.length;l++)this.findGroupStart(t[l]);this.deselectHeader()}},k.prototype.openClick=function(e){this.openOnClick||"CheckBox"===this.mode||this.isPopupOpen()?this.openOnClick||"CheckBox"!==this.mode||this.isPopupOpen()||this.showPopup():""!==this.targetElement()?this.showPopup():this.hidePopup(e)},k.prototype.keyUp=function(e){var t;"CheckBox"!==this.mode||this.openOnClick||(t=String.fromCharCode(e.keyCode).match(/\w/),P.isNullOrUndefined(t))||(this.isValidKey=!0),this.isValidKey=this.isPopupOpen()&&8===e.keyCode||this.isValidKey,this.isValidKey=(!e.ctrlKey||86!==e.keyCode)&&this.isValidKey,this.isValidKey&&this.inputElement&&(this.isValidKey=!1,this.expandTextbox(),this.showOverAllClear(),e.keyCode,this.search(e))},k.prototype.filter=function(e,t,i){this.isFiltered=!0,this.remoteFilterAction=!0,this.dataUpdater(e,t,i)},k.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new c.Query;if(this.isFiltered){if(this.enableVirtualization&&!P.isNullOrUndefined(this.customFilterQuery))return i=this.customFilterQuery.clone(),this.virtualFilterQuery(i);if(!this.enableVirtualization)return i}return this.filterAction?((null!==this.targetElement()&&!this.enableVirtualization||this.enableVirtualization&&null!==this.targetElement()&&""!==this.targetElement().trim())&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==t)&&"number"!==t?(!this.enableVirtualization||""===this.targetElement()||this.isClearAllAction)&&this.enableVirtualization||(t=this.fields,i.where(P.isNullOrUndefined(t.text)?"":t.text,this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)):i.where("",this.filterType,this.targetElement(),this.ignoreCase,this.ignoreAccent)),this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(e||this.query||new c.Query).take(this.maximumSelectionLength).requiresCount():i):this.enableVirtualization&&0!==this.viewPortInfo.endIndex&&!this.virtualSelectAll?this.virtualFilterQuery(i):this.virtualSelectAll?(e||this.query||new c.Query).take(this.maximumSelectionLength).requiresCount():e||this.query||new c.Query},k.prototype.virtualFilterQuery=function(e){for(var t=this.getTakeValue(),i=!0,s=!0,l=0;l<e.queries.length;l++)"multiselect"===this.getModuleName()&&(e.queries[l].e&&"or"===e.queries[l].e.condition||e.queries[l].e&&"equal"===e.queries[l].e.operator)&&(i=!1),"onSkip"===e.queries[l].fn&&(s=!1),e.queries[l].fn;var n=0;if(e&&0<e.queries.length)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=t<=e.queries[l].e.nos?e.queries[l].e.nos:t);if(n<=0&&this.query&&0<this.query.queries.length)for(l=0;l<this.query.queries.length;l++)"onTake"===this.query.queries[l].fn&&(n=t<=this.query.queries[l].e.nos?this.query.queries[l].e.nos:t);if(e&&0<e.queries.length)for(l=0;l<e.queries.length;l++)"onTake"===e.queries[l].fn&&(n=e.queries[l].e.nos<=n?n:e.queries[l].e.nos,e.queries.splice(l,1),--l);return(this.allowFiltering&&s||!i||!this.allowFiltering&&s&&!this.isVirtualReorder)&&(i?e.skip(this.virtualItemStartIndex):e.skip(this.viewPortInfo.startIndex)),this.isIncrementalRequest?e.take(this.incrementalEndIndex):0<n?e.take(n):e.take(t),e.requiresCount(),this.customFilterQuery=null,e},k.prototype.getTakeValue=function(){return this.allowFiltering&&P.Browser.isDevice?Math.round(window.outerHeight/this.listItemHeight):this.itemCount},k.prototype.dataUpdater=function(e,t,i){this.isDataFetched=!1;var s,l,n,a,o=this.list.classList.contains(y.noData);""===this.targetElement().trim()?(s=this.enableVirtualization?this.list.cloneNode(!0):this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,(this.backCommand||this.enableVirtualization&&"CheckBox"===this.mode&&this.value&&0<this.value.length)&&(l=this.remoteCustomValue=!1,this.allowCustomValue&&0===s.querySelectorAll("li").length&&0<this.mainData.length&&(this.mainData=[]),this.enableVirtualization&&(this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null),this.value&&0<this.value.length&&"CheckBox"===this.mode?(this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"}),l=!0):(this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.resetList(e,i,t),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.UpdateSkeleton(),!o&&!this.allowCustomValue||this.list.classList.contains(y.noData)||(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),this.list.querySelector(".e-virtual-ddl"))||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a)))),this.onActionComplete(s,this.mainData),this.value&&this.value.length&&this.refreshSelection(),8!==this.keyCode&&this.focusAtFirstListItem(),l||this.notify("reOrder",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,e:this}))):(this.enableVirtualization&&this.allowFiltering&&(this.isPreventScrollAction=!0,this.list.scrollTop=0,this.previousStartIndex=0,this.virtualListInfo=null,this.list.querySelector(".e-list-parent.e-reorder"))&&this.list.querySelector(".e-list-parent.e-reorder").remove(),this.resetList(e,i,t),this.enableVirtualization&&(o||this.allowCustomValue)&&!this.list.classList.contains(y.noData)&&(this.list.querySelector(".e-virtual-ddl-content")||((n=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(n).appendChild(this.list.querySelector(".e-list-parent"))),"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")||((a=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),document.getElementsByClassName("e-multi-select-list-wrapper")[0].querySelector(".e-dropdownbase").appendChild(a))),this.allowCustomValue&&(e instanceof c.DataManager?(this.remoteCustomValue=!0,this.tempQuery=t):this.checkForCustomValue(t,i))),this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount(),this.refreshPopup(),this.allowResize&&this.setResize(),"CheckBox"===this.mode&&this.removeFocus()},k.prototype.checkForCustomValue=function(e,t){var i,s,l,n,a,o=!this.getValueByText(this.inputElement.value,this.ignoreCase),r=t||this.fields;this.allowCustomValue&&o?(n=this.inputElement.value,(a=!P.isNullOrUndefined(this.mainData)&&0<this.mainData.length?this.mainData[0]:this.mainData)&&"string"!=typeof a&&"number"!=typeof a&&"boolean"!=typeof a?(i={},P.setValue(r.text,n,i),"number"==typeof P.getValue(this.fields.value||"value",a)&&this.fields.value!==this.fields.text?P.setValue(r.value,Math.random(),i):P.setValue(r.value,n,i),s={},this.allowObjectBinding&&(this.listData&&0<this.listData.length?Object.keys(this.listData[0]):this.firstItem?Object.keys(this.firstItem):Object.keys(i)).forEach(function(e){s[e]=e===t.value||e===t.text?P.getValue(t.value,i):null}),i=this.allowObjectBinding?s:i,this.enableVirtualization?(this.virtualCustomData=i,l=this.dataSource instanceof c.DataManager?JSON.parse(JSON.stringify(this.listData)):JSON.parse(JSON.stringify(this.dataSource)),this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&l.concat(this.virtualCustomSelectData),l.splice(0,0,i),this.isCustomDataUpdated=!0,n=this.totalItemCount,this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.resetList(l,r,e),this.isCustomDataUpdated=!1,this.totalItemCount=this.enableVirtualization&&this.dataSource instanceof c.DataManager?n:this.totalItemCount):(this.dataSource instanceof c.DataManager&&this.allowCustomValue&&this.allowFiltering&&(this.remoteCustomValue=!1),(l=JSON.parse(JSON.stringify(this.listData))).splice(0,0,i),this.resetList(l,r,e))):this.listData&&((l=JSON.parse(JSON.stringify(this.listData))).splice(0,0,this.inputElement.value),l[0]="number"!=typeof a||isNaN(parseFloat(l[0]))?l[0]:parseFloat(l[0]),l[0]="boolean"==typeof a?"true"===l[0]||"false"!==l[0]&&l[0]:l[0],this.resetList(l,r))):this.listData&&this.mainData&&!o&&this.allowCustomValue&&(this.allowFiltering&&this.isRemoteSelection&&this.remoteCustomValue?(this.isRemoteSelection=!1,this.enableVirtualization||this.resetList(this.listData,r,e)):!this.allowFiltering&&this.list&&(n=this.list.querySelectorAll("li."+y.li+":not(.e-hide-listitem)"),a=d(this.targetElement(),n,"StartsWith",this.ignoreCase))&&null!==a.item&&this.addListFocus(a.item)),this.value&&this.value.length&&this.refreshSelection()},k.prototype.getNgDirective=function(){return"EJS-MULTISELECT"},k.prototype.wrapperClick=function(e){if(this.setDynValue=!1,this.keyboardEvent=null,this.isKeyBoardAction=!1,this.enabled)if(e.target===this.overAllClear)e.preventDefault();else{if(this.inputFocus||this.inputElement.focus(),!this.readonly){if(e.target&&-1!==e.target.classList.toString().indexOf(rt))return void(this.isPopupOpen()&&this.refreshPopup());!this.isPopupOpen()&&(this.openOnClick||this.showDropDownIcon&&e.target&&e.target.className===gt)?this.showPopup(e):(this.hidePopup(e),"CheckBox"===this.mode&&(this.showOverAllClear(),this.inputFocus=!0,this.overAllWrapper.classList.contains(nt)||this.overAllWrapper.classList.add(nt)))}this.targetElement()&&""!==this.targetElement()||e.preventDefault()}},k.prototype.enable=function(e){e?(this.overAllWrapper.classList.remove(at),this.inputElement.removeAttribute("disabled"),P.attributes(this.inputElement,{"aria-disabled":"false"}),this.ensureAriaDisabled("false")):(this.overAllWrapper.classList.add(at),this.inputElement.setAttribute("disabled","true"),P.attributes(this.inputElement,{"aria-disabled":"true"}),this.ensureAriaDisabled("true")),this.enabled!==e&&(this.enabled=e),this.hidePopup()},k.prototype.onBlurHandler=function(e,t){var i;this.isBlurDispatching&&this.isAngular?this.isBlurDispatching=!1:(P.isNullOrUndefined(e)||(i=e.relatedTarget),this.popupObj&&document.body.contains(this.popupObj.element)&&this.popupObj.element.contains(i)?"CheckBox"!==this.mode?this.inputElement.focus():"Auto"===this.floatLabelType&&(this.overAllWrapper.classList.contains("e-outline")||this.overAllWrapper.classList.contains("e-filled"))&&P.addClass([this.overAllWrapper],"e-valid-input"):("Auto"===this.floatLabelType&&this.overAllWrapper.classList.contains("e-outline")&&"CheckBox"===this.mode&&(P.isNullOrUndefined(this.value)||0===this.value.length)&&P.removeClass([this.overAllWrapper],"e-valid-input"),"CheckBox"!==this.mode||!P.Browser.isIE||P.isNullOrUndefined(e)||t?this.scrollFocusStatus?(P.isNullOrUndefined(e)||e.preventDefault(),this.inputElement.focus(),this.scrollFocusStatus=!1):(this.inputFocus=!1,this.overAllWrapper.classList.remove(nt),this.addTagOnBlur&&(i=this.getValueByText(this.inputElement.value,this.ignoreCase,this.ignoreAccent),t=this.findListElement(this.list,"li","data-value",i),i=this.hideSelectedItem?D:y.selected,t)&&!t.classList.contains(i)&&(this.updateListSelection(t,e),"Delimiter"===this.mode)&&this.updateDelimeter(this.delimiterChar),this.updateDataList(),this.refreshListItems(null),"Box"!==this.mode&&"CheckBox"!==this.mode&&this.updateDelimView(),this.changeOnBlur&&(this.updateValueState(e,this.value,this.tempValues),this.dispatchEvent(this.hiddenElement,"change")),this.overAllClear.style.display="none",this.isPopupOpen()&&this.hidePopup(e),this.makeTextBoxEmpty(),this.trigger("blur"),this.focused=!0,P.Browser.isDevice&&"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.removeChipFocus(),this.removeChipSelection(),this.refreshInputHight(),it(this.overAllWrapper,this.componentWrapper,this.value,this.floatLabelType,this.placeholder),this.refreshPlaceHolder(),(this.allowFiltering||!0===this.enableSelectionOrder&&"CheckBox"===this.mode)&&!P.isNullOrUndefined(this.mainList)&&(this.ulElement=this.mainList),this.checkPlaceholderSize(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.isBlurDispatching=!0,this.isAngular&&this.dispatchEvent(this.inputElement,"blur")):(this.inputFocus=!1,this.overAllWrapper.classList.remove(nt))))},k.prototype.calculateWidth=function(){var e;this.overAllWrapper&&(e=!this.showDropDownIcon||this.overAllWrapper.querySelector(".e-label-top")?this.overAllWrapper.clientWidth-2*parseInt(getComputedStyle(this.inputElement).paddingRight,10):(e=this.dropIcon.offsetWidth+parseInt(getComputedStyle(this.dropIcon).marginRight,10),this.overAllWrapper.clientWidth-(e+2*parseInt(getComputedStyle(this.inputElement).paddingRight,10))),"Never"!==this.floatLabelType)&&h.Input.calculateWidth(e,this.overAllWrapper,this.getModuleName())},k.prototype.checkPlaceholderSize=function(){var e;this.showDropDownIcon?(e=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10),this.setPlaceholderSize(e)):P.isNullOrUndefined(this.dropIcon)||this.setPlaceholderSize(this.showDropDownIcon?this.dropIcon.offsetWidth:0)},k.prototype.setPlaceholderSize=function(e){P.isNullOrUndefined(this.value)||0===this.value.length?0!==this.dropIcon.offsetWidth?this.searchWrapper.style.width="calc(100% - "+(e+10)+"px":P.addClass([this.searchWrapper],bt):P.isNullOrUndefined(this.value)||(this.searchWrapper.removeAttribute("style"),P.removeClass([this.searchWrapper],bt))},k.prototype.refreshInputHight=function(){P.isNullOrUndefined(this.searchWrapper)||(this.value&&this.value.length||!P.isNullOrUndefined(this.text)&&""!==this.text?this.searchWrapper.classList.add(pt):this.searchWrapper.classList.remove(pt))},k.prototype.validateValues=function(e,t){return JSON.stringify(e.slice().sort())!==JSON.stringify(t.slice().sort())},k.prototype.updateValueState=function(e,t,i){this.initStatus&&this.validateValues(t||[],i||[])&&(i={e:e,oldValue:(this.allowObjectBinding,i),value:(this.allowObjectBinding,t),isInteracted:!!e,element:this.element,event:e},this.isAngular&&this.preventChange?this.preventChange=!1:this.trigger("change",i),this.updateTempValue(),this.changeOnBlur||this.dispatchEvent(this.hiddenElement,"change")),this.selectedValueInfo=this.viewPortInfo},k.prototype.updateTempValue=function(){this.value?this.tempValues=(this.allowObjectBinding,this.value.slice()):this.tempValues=this.value},k.prototype.updateAriaActiveDescendant=function(){P.isNullOrUndefined(this.ulElement)||P.isNullOrUndefined(this.ulElement.getElementsByClassName("e-item-focus")[0])||P.attributes(this.inputElement,{"aria-activedescendant":this.ulElement.getElementsByClassName("e-item-focus")[0].id})},k.prototype.pageUpSelection=function(e,t){var i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),s=0<=e?i[e+1]:i[0];if(this.fields.disabled&&s&&!this.enableVirtualization){for(;s&&(s.classList.contains("e-disabled")||s.classList.contains(D)||s.classList.contains(".e-reorder-hide")||s.classList.contains("e-list-group-item"));)s=s.previousElementSibling;if(!s)return}this.enableVirtualization&&t&&(s=this.liCollections.length>=e&&0<=e?this.liCollections[e]:this.liCollections[this.skeletonCount]),!P.isNullOrUndefined(s)&&s.classList.contains("e-virtual-list")&&(s=this.liCollections[this.skeletonCount]),this.enableVirtualization?(P.isNullOrUndefined(s)||s.classList.contains("e-item-focus")?0===this.viewPortInfo.startIndex&&(this.isKeyBoardAction=!0,this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode)),this.previousFocusItem=s):(this.isKeyBoardAction=!0,this.addListFocus(s),this.scrollTop(s,this.getIndexByValue(s.getAttribute("data-value")),this.keyboardEvent.keyCode))},k.prototype.pageDownSelection=function(e,t){var i=this.getItems(),s=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),l=e<=s.length?s[e-1]:s[s.length-1];if(this.fields.disabled&&l&&!this.enableVirtualization){for(;l&&(l.classList.contains("e-disabled")||l.classList.contains(D)||l.classList.contains(".e-reorder-hide")||l.classList.contains("e-list-group-item"));)l=l.nextElementSibling;if(!l)return}this.enableVirtualization&&0<this.skeletonCount&&(l=e<i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.enableVirtualization&&t&&(l=e<=i.length?this.liCollections[e]:this.liCollections[i.length-1]),this.isKeyBoardAction=!0,this.addListFocus(l),this.previousFocusItem=l,this.scrollBottom(l,this.getIndexByValue(l.getAttribute("data-value")),!1,this.keyboardEvent.keyCode)},k.prototype.getItems=function(){return this.list||A.prototype.render.call(this),this.ulElement&&0<this.ulElement.querySelectorAll("."+y.li).length?this.ulElement.querySelectorAll("."+y.li+":not(."+D+")"):[]},k.prototype.focusInHandler=function(e){var t=this;return!!this.enabled&&(this.showOverAllClear(),this.inputFocus=!0,this.value&&this.value.length&&("Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),"CheckBox"!==this.mode)&&(this.viewWrapper.style.display="none"),"CheckBox"!==this.mode&&this.searchWrapper.classList.remove(pt),this.checkPlaceholderSize(),this.focused&&(this.trigger("focus",{isInteracted:!!e,event:e}),this.focused=!1),this.overAllWrapper.classList.contains(nt)||this.overAllWrapper.classList.add(nt),tt(this.overAllWrapper,this.componentWrapper),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),setTimeout(function(){t.calculateWidth()},150),!0)},k.prototype.showDelimWrapper=function(){"CheckBox"===this.mode?this.viewWrapper.style.display="":this.delimiterWrapper.style.display="",this.componentWrapper.classList.add(ut)},k.prototype.hideDelimWrapper=function(){this.delimiterWrapper.style.display="none",this.componentWrapper.classList.remove(ut)},k.prototype.expandTextbox=function(){var e,t=5;this.placeholder&&(e=this.placeholder.charCodeAt(0),t=t>this.inputElement.placeholder.length?t:this.inputElement.placeholder.length*(44032<=e&&e<=55215?1.5:19968<=e&&e<=40959?2:1)),this.inputElement.value.length>t?this.inputElement.size=this.inputElement.value.length:this.inputElement.size=t},k.prototype.isPopupOpen=function(){return null!==this.popupWrapper&&null!==this.popupWrapper.parentElement},k.prototype.refreshPopup=function(){this.popupObj&&this.mobFilter&&(this.popupObj.setProperties({width:this.calcPopupWidth()}),this.popupObj.refreshPosition(this.overAllWrapper),this.popupObj.resolveCollision())},k.prototype.checkTextLength=function(){return this.targetElement().length<1},k.prototype.popupKeyActions=function(e){switch(e.keyCode){case 38:this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),e.preventDefault();break;case 40:this.isPopupOpen()||(this.showPopup(e),e.preventDefault())}},k.prototype.updatePopupPosition=function(){this.refreshPopup()},k.prototype.updateAriaAttribute=function(){var e,t=this.list.querySelector("."+y.focus);P.isNullOrUndefined(t)||(this.inputElement.setAttribute("aria-activedescendant",t.id),this.allowFiltering?(e=this.popupWrapper.querySelector("."+St))&&e.setAttribute("aria-activedescendant",t.id):"CheckBox"===this.mode&&this.overAllWrapper.setAttribute("aria-activedescendant",t.id))},k.prototype.homeNavigation=function(e,t){this.removeFocus(),this.enableVirtualization&&(e?this.enableVirtualization&&0!==this.viewPortInfo.startIndex&&(this.viewPortInfo.startIndex=0,this.viewPortInfo.endIndex=this.itemCount,this.updateVirtualItemIndex(),this.resetList(this.dataSource,this.fields,this.query)):this.enableVirtualization&&(!this.value&&this.viewPortInfo.endIndex!==this.totalItemCount||this.value&&0<this.value.length&&this.viewPortInfo.endIndex!==this.totalItemCount+this.value.length)&&(this.viewPortInfo.startIndex=this.totalItemCount-this.itemCount,this.viewPortInfo.endIndex=this.totalItemCount,this.updateVirtualItemIndex(),s=(new c.Query).clone(),this.value&&0<this.value.length&&(s=(s=this.getForQuery(this.value).clone()).skip(this.totalItemCount-this.itemCount)),this.resetList(this.dataSource,this.fields,s))),this.UpdateSkeleton();var i,s=this.ulElement.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)");0<s.length&&(i=s[e?0:s.length-1],this.enableVirtualization&&e&&(i=s[this.skeletonCount]),this.removeFocus(),i.classList.add(y.focus),this.enableVirtualization&&e?this.scrollTop(i,void 0,this.keyboardEvent.keyCode):t||this.scrollBottom(i,void 0,!1,this.keyboardEvent.keyCode),this.updateAriaActiveDescendant())},k.prototype.updateSelectionList=function(){if(!P.isNullOrUndefined(this.value)&&this.value.length)for(var e=0;e<this.value.length;e++){var t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[e]):this.value[e],t=this.getElementByValue(t);t&&!t.classList.contains(y.selected)&&t.classList.add("e-active")}},k.prototype.handleVirtualKeyboardActions=function(e,t){var i,s=this.list.querySelector("."+y.focus);switch(this.isKeyBoardAction=!0,e.keyCode){case 40:this.arrowDown(e,!0);break;case 38:this.arrowUp(e,!0);break;case 33:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value"))-1,this.pageUpSelection(i,!0),this.updateAriaAttribute());break;case 34:e.preventDefault(),s&&(i=this.getIndexByValue(this.previousFocusItem.getAttribute("data-value")),this.pageDownSelection(i,!0),this.updateAriaAttribute());break;case 35:case 36:this.isMouseScrollAction=!0,this.homeNavigation(36===e.keyCode,!0),this.isPreventScrollAction=!0}this.keyboardEvent=null,this.isScrollChanged=!0,this.isKeyBoardAction=!1},k.prototype.onKeyDown=function(e){if(!this.readonly&&(this.enabled||"CheckBox"===this.mode)&&(this.preventSetCurrentData=!1,this.keyboardEvent=e,this.isPreventKeyAction&&this.enableVirtualization&&e.preventDefault(),this.keyCode=e.keyCode,this.keyDownStatus=!0,!(111<e.keyCode&&e.keyCode<124)))if(e.altKey)this.popupKeyActions(e);else{if(this.isPopupOpen()){var t=this.list.querySelector("."+y.focus),i=void 0;switch(e.keyCode){case 36:case 35:this.isMouseScrollAction=!0,this.isKeyBoardAction=!0,this.homeNavigation(36===e.keyCode);break;case 33:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageUpSelection(i-this.getPageCount()-1),this.updateAriaAttribute()));case 34:return e.preventDefault(),void(t&&(i=this.getIndexByValue(t.getAttribute("data-value")),this.pageDownSelection(i+this.getPageCount()),this.updateAriaAttribute()));case 38:this.isKeyBoardAction=!0,this.arrowUp(e);break;case 40:this.isKeyBoardAction=!0,this.arrowDown(e);break;case 27:return e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),"CheckBox"===this.mode&&this.inputElement.focus(),void(this.isKeyBoardAction=!1);case 13:return e.preventDefault(),this.isKeyBoardAction=!0,"CheckBox"!==this.mode&&this.selectByKey(e),this.checkPlaceholderSize(),void(this.isKeyBoardAction=!1);case 32:return this.isKeyBoardAction=!0,this.spaceKeySelection(e),void(this.isKeyBoardAction=!1);case 9:e.preventDefault(),this.isKeyBoardAction=!0,this.hidePopup(e),this.inputElement.focus(),this.overAllWrapper.classList.add(nt)}}else switch(e.keyCode){case 13:case 9:case 16:case 17:case 20:return;case 40:this.openOnClick&&this.showPopup();break;case 27:return e.preventDefault(),void this.escapeAction()}this.checkTextLength()&&this.keyNavigation(e),"CheckBox"===this.mode&&this.enableSelectionOrder&&(this.allowFiltering&&(this.previousFilterText=this.targetElement()),this.checkBackCommand(e)),this.expandTextbox(),"CheckBox"===this.mode&&this.showSelectAll||this.refreshPopup(),this.allowResize&&this.setResize(),this.isKeyBoardAction=!1}},k.prototype.arrowDown=function(e,t){e.preventDefault(),this.moveByList(1,t),this.keyAction=!0,(document.activeElement.classList.contains(St)||"CheckBox"===this.mode&&!this.allowFiltering&&document.activeElement!==this.list)&&P.EventHandler.add(this.list,"keydown",this.onKeyDown,this),this.updateAriaAttribute()},k.prototype.arrowUp=function(e,t){e.preventDefault(),this.keyAction=!0;var e=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),i=(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&(e=this.list.querySelectorAll("li."+y.li+",li."+y.group+":not(."+D+"):not(.e-reorder-hide)")),this.list.querySelector("li."+y.focus));this.focusFirstListItem=!P.isNullOrUndefined(this.liCollections[0])&&this.liCollections[0].classList.contains("e-item-focus"),Array.prototype.slice.call(e).indexOf(i)<=0&&"CheckBox"===this.mode&&this.allowFiltering&&(this.keyAction=!1,this.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"focus"})),this.moveByList(-1,t),this.updateAriaAttribute()},k.prototype.spaceKeySelection=function(e){var t,i;"CheckBox"===this.mode&&(i=this.list.querySelector("li."+y.focus),t=document.getElementsByClassName("e-selectall-parent")[0],(!P.isNullOrUndefined(i)||t&&t.classList.contains("e-item-focus"))&&(e.preventDefault(),this.keyAction=!0),this.selectByKey(e),this.keyAction)&&(i=this.list.querySelector("li."+y.focus),!P.isNullOrUndefined(i))&&t&&t.classList.contains("e-item-focus")&&i.classList.remove("e-item-focus"),this.checkPlaceholderSize()},k.prototype.checkBackCommand=function(e){(8===e.keyCode&&this.allowFiltering?this.targetElement()!==this.previousFilterText:""===this.targetElement())?this.backCommand=!1:this.backCommand=!0},k.prototype.keyNavigation=function(e){var t;if("Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.value&&this.value.length)switch(e.keyCode){case 37:e.preventDefault(),this.moveBy(-1,e);break;case 39:e.preventDefault(),this.moveBy(1,e);break;case 8:this.removelastSelection(e);break;case 46:this.removeSelectedChip(e)}else 8===e.keyCode&&"Delimiter"===this.mode&&this.value&&this.value.length&&(e.preventDefault(),t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],this.removeValue(this.value[this.value.length-1],e),this.updateDelimeter(this.delimiterChar,e),this.focusAtLastListItem(t))},k.prototype.selectByKey=function(e){this.removeChipSelection(),this.selectListByKey(e),this.hideSelectedItem&&this.focusAtFirstListItem()},k.prototype.escapeAction=function(){var e=this.tempValues?this.tempValues.slice():[];this.allowObjectBinding&&(e=this.tempValues?this.tempValues.slice():[]),this.value&&this.validateValues(this.value,e)&&("CheckBox"!==this.mode&&(this.value=e,this.initialValueUpdate()),"Delimiter"!==this.mode&&"CheckBox"!==this.mode?this.chipCollectionWrapper.style.display="":this.showDelimWrapper(),this.refreshPlaceHolder(),this.value.length?this.showOverAllClear():this.hideOverAllClear()),this.makeTextBoxEmpty()},k.prototype.scrollBottom=function(e,t,i,s,l){void 0===i&&(i=!1),void 0===s&&(s=null),void 0===l&&(l=!1);var n=(e=!P.isNullOrUndefined(e)&&e.classList.contains("e-virtual-list")||this.enableVirtualization&&P.isNullOrUndefined(e)?this.liCollections[this.skeletonCount]:e)&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,a=(this.isUpwardScrolling=!1,this.list.querySelectorAll(".e-virtual-list").length),o=this.list.querySelector("li:last-of-type")?this.list.querySelector("li:last-of-type").getAttribute("data-value"):null,r=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+n):e.offsetTop,h=this.list.offsetHeight,u=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,p=this.list.scrollTop+u-h,d=!1,r=r-a*(e.offsetHeight+n)+(e.offsetHeight+n)-this.list.scrollTop,r=this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?r-this.fixedHeaderElement.offsetHeight:r;0!==t||this.enableVirtualization?(h<u||!(0<r&&this.list.offsetHeight>r))&&(a=e?e.getAttribute("data-value"):null,t=34===s?this.getPageCount()-1:1,!this.enableVirtualization||this.isKeyBoardAction||i?this.isKeyBoardAction&&this.enableVirtualization&&o&&a===o&&35!==s&&!this.isVirtualScrolling?(this.isPreventKeyAction=!0,this.list.scrollTop+=(e.offsetHeight+n)*t,this.isPreventKeyAction=!this.isScrollerAtEnd()&&this.isPreventKeyAction,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1):this.enableVirtualization&&35===s?(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1,this.list.scrollTop=this.list.scrollHeight):(34===s&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=p):this.list.scrollTop=this.virtualListInfo&&this.virtualListInfo.startIndex?l&&this.virtualListInfo.startIndex?this.virtualListInfo.startIndex*this.listItemHeight+2*this.listItemHeight:this.virtualListInfo.startIndex*this.listItemHeight:0,d=this.isKeyBoardAction):this.list.scrollTop=0,this.isKeyBoardAction=d},k.prototype.scrollTop=function(e,t,i){void 0===i&&(i=null);var s=this.list.querySelectorAll(".e-virtual-list").length,l=e&&!isNaN(parseInt(window.getComputedStyle(e).marginBottom,10))?parseInt(window.getComputedStyle(e).marginBottom,10):0,n=this.virtualListInfo&&this.virtualListInfo.startIndex?e.offsetTop+this.virtualListInfo.startIndex*(e.offsetHeight+l):e.offsetTop,a=n-s*(e.offsetHeight+l)-this.list.scrollTop,o=this.list.querySelector("li.e-list-item:not(.e-virtual-list)")?this.list.querySelector("li.e-list-item:not(.e-virtual-list)").getAttribute("data-value"):null,a=this.fields.groupBy&&!P.isUndefined(this.fixedHeaderElement)?a-this.fixedHeaderElement.offsetHeight:a,n=n-s*(e.offsetHeight+l)+(e.offsetHeight+l)-this.list.scrollTop,s=this.enableVirtualization&&"autocomplete"===this.getModuleName()&&a<=0;0!==t||this.enableVirtualization?a<0||s?(t=e?e.getAttribute("data-value"):null,s=33===i?this.getPageCount()-2:1,this.enableVirtualization&&this.isKeyBoardAction&&o&&t===o&&36!==i&&!this.isVirtualScrolling?(this.isUpwardScrolling=!0,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTop-=(e.offsetHeight+l)*s,this.isPreventKeyAction=0!==this.list.scrollTop&&this.isPreventKeyAction,this.isPreventScrollAction=!1):this.enableVirtualization&&36===i?(this.isPreventScrollAction=!1,this.isPreventKeyAction=!0,this.isKeyBoardAction=!1,this.list.scrollTo(0,0)):(33===i&&this.enableVirtualization&&!this.isVirtualScrolling&&(this.isPreventKeyAction=!1,this.isKeyBoardAction=!1,this.isPreventScrollAction=!1),this.list.scrollTop=this.list.scrollTop+a)):0<n&&this.list.offsetHeight>n||(this.list.scrollTop=e.offsetTop-(this.fields.groupBy&&!P.isNullOrUndefined(this.fixedHeaderElement)?this.fixedHeaderElement.offsetHeight:0)):this.list.scrollTop=0},k.prototype.isScrollerAtEnd=function(){return this.list&&this.list.scrollTop+this.list.clientHeight>=this.list.scrollHeight},k.prototype.selectListByKey=function(e){var t,i,s=this.list.querySelector("li."+y.focus),l=this.value&&this.value.length?this.value.length:0,n=(null!==s&&(e.preventDefault(),s.classList.contains("e-active")&&(l-=1),this.isValidLI(s)&&l<this.maximumSelectionLength?(this.updateListSelection(s,e),this.addListFocus(s),"CheckBox"===this.mode?(this.updateDelimView(),this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight(),this.checkPlaceholderSize(),this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(t=s.firstElementChild.lastElementChild,this.findGroupStart(t),this.deselectHeader())):this.updateDelimeter(this.delimiterChar,e),n=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),"CheckBox"!==this.mode&&this.refreshListItems(s.textContent,n),this.changeOnBlur||this.updateValueState(e,this.value,this.tempValues),this.refreshPopup()):!this.isValidLI(s)&&l<this.maximumSelectionLength&&((t=s.firstElementChild.lastElementChild).classList.contains("e-check")?this.selectAllItem(!1,e,s):this.selectAllItem(!0,e,s)),this.refreshSelection(),this.closePopupOnSelect)&&this.hidePopup(e),document.getElementsByClassName("e-selectall-parent")[0]);n&&n.classList.contains("e-item-focus")&&((l=n.childNodes[0]).classList.contains("e-check")?(l.classList.remove("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!1,e,s)):(l.classList.add("e-check"),i={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"check",name:"checkSelectAll"},this.notify("checkSelectAll",i),this.selectAllItem(!0,e,s))),this.refreshPlaceHolder()},k.prototype.refreshListItems=function(e,t){var i;(this.allowFiltering||"CheckBox"===this.mode&&!0===this.enableSelectionOrder||this.allowCustomValue)&&this.mainList&&this.listData?(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.enableVirtualization?this.allowCustomValue&&this.virtualCustomData&&null==e&&this.virtualCustomData&&this.viewPortInfo&&0===this.viewPortInfo.startIndex&&this.viewPortInfo.endIndex===this.itemCount?(this.virtualCustomData=null,this.renderItems(this.mainData,this.fields)):this.allowFiltering&&t?(this.updateInitialData(),this.onActionComplete(i,this.mainData),this.isVirtualTrackHeight=!1,this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t))):this.onActionComplete(this.list,this.listData):this.onActionComplete(i,this.mainData),this.focusAtLastListItem(e),this.value&&this.value.length&&this.refreshSelection()):!P.isNullOrUndefined(this.fields.groupBy)&&this.value&&this.value.length&&this.refreshSelection()},k.prototype.removeSelectedChip=function(e){var t,i=this.chipCollectionWrapper.querySelector("span."+ht);null!==i&&(P.isNullOrUndefined(this.value)||(this.tempValues=(this.allowObjectBinding,this.value.slice())),null!==(t=i.nextElementSibling)&&(this.removeChipSelection(),this.addChipSelection(t,e)),t=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i.getAttribute("data-value"))):i.getAttribute("data-value"),this.removeValue(t,e),this.updateDelimeter(this.delimiterChar,e),this.makeTextBoxEmpty()),this.closePopupOnSelect&&this.hidePopup(e),this.checkPlaceholderSize()},k.prototype.moveByTop=function(e){var t=this.list.querySelectorAll("li."+y.li);1<t.length&&(this.removeFocus(),e=e?0:t.length-1,this.addListFocus(t[e]),this.scrollBottom(t[e],e)),this.updateAriaAttribute()},k.prototype.clickHandler=function(e){var e=e.target.className,t=document.getElementsByClassName("e-selectall-parent")[0];"e-input-filter e-input"!==e&&"e-input-group e-control-wrapper e-input-focus"!==e||!t.classList.contains("e-item-focus")||t.classList.remove("e-item-focus")},k.prototype.moveByList=function(e,t){if(this.list){var i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide)"),s=("CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(i=this.list.querySelectorAll("li."+y.li+",li."+y.group+":not(."+D+"):not(.e-reorder-hide)")),this.list.querySelector("li."+y.focus)),l=(this.enableVirtualization&&t&&!P.isNullOrUndefined(this.currentFocuedListElement)&&(s=this.getElementByValue(this.getFormattedValue(this.currentFocuedListElement.getAttribute("data-value")))),-1),n=document.getElementsByClassName("e-selectall-parent")[0];if("CheckBox"===this.mode&&this.showSelectAll&&1===e&&!P.isNullOrUndefined(n)&&!n.classList.contains("e-item-focus")&&0===this.list.getElementsByClassName("e-item-focus").length&&1<this.liCollections.length)!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):n.classList.contains("e-item-focus")||n.classList.add("e-item-focus");else if(i.length){"CheckBox"===this.mode&&this.showSelectAll&&!P.isNullOrUndefined(n&&-1===e)&&(!this.focusFirstListItem&&n.classList.contains("e-item-focus")?n.classList.remove("e-item-focus"):this.focusFirstListItem&&!n.classList.contains("e-item-focus")&&n.classList.add("e-item-focus"));for(var a,o=0;o<i.length;o++)if(i[o]===s){l=o;break}0<e?l<i.length-1&&(this.removeFocus(),this.enableVirtualization&&t?this.addListFocus(i[l]):this.enableVirtualization&&i[l+1].classList.contains("e-virtual-list")?this.addListFocus(i[this.skeletonCount]):this.addListFocus(i[++l]),-1<l)&&(this.updateCheck(i[l]),this.scrollBottom(i[l],l),this.currentFocuedListElement=i[l]):0<l&&(this.enableVirtualization?(n=i[l-1].classList.contains("e-virtual-list"),a=t?l:l-1,!t&&n||this.removeFocus(),!t&&n||(this.addListFocus(i[a]),this.updateCheck(i[a]),this.scrollTop(i[a],l),this.currentFocuedListElement=i[a])):(this.removeFocus(),this.addListFocus(i[--l]),this.updateCheck(i[l]),this.scrollTop(i[l],l)))}}t=this.list?this.list.querySelector(".e-item-focus"):null;this.isDisabledElement(t)&&(0===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem):not(.e-disabled)").length||38===this.keyCode&&"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&t===this.list.querySelector("li.e-list-group-item")?this.removeFocus():(0===(o=this.getIndexByValue(t.getAttribute("data-value")))&&(e=1),o===this.list.querySelectorAll(".e-list-item:not(.e-hide-listitem)").length-1&&(e=-1),this.moveByList(e)))},k.prototype.getElementByValue=function(e){for(var t,i=0,s=this.getItems();i<s.length;i++){var l=s[i];if(this.getFormattedValue(l.getAttribute("data-value"))===e){t=l;break}}return t},k.prototype.updateCheck=function(e){"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&(e.firstElementChild.lastElementChild.classList.contains("e-check")?e.classList.add("e-active"):e.classList.remove("e-active"))},k.prototype.moveBy=function(e,t){var i,s=this.chipCollectionWrapper.querySelectorAll("span."+ot),l=this.chipCollectionWrapper.querySelector("span."+ht);null===l?e<0&&this.addChipSelection(s[s.length-1],t):e<0?null!==(i=l.previousElementSibling)&&(this.removeChipSelection(),this.addChipSelection(i,t)):(i=l.nextElementSibling,this.removeChipSelection(),null!==i&&this.addChipSelection(i,t))},k.prototype.chipClick=function(e){var t;this.enabled&&(t=P.closest(e.target,"."+ot),this.removeChipSelection(),this.addChipSelection(t,e))},k.prototype.removeChipSelection=function(){this.chipCollectionWrapper&&this.removeChipFocus()},k.prototype.addChipSelection=function(e,t){P.addClass([e],ht),this.trigger("chipSelection",t)},k.prototype.onChipRemove=function(e){var t,i;3!==e.which&&2!==e.button&&this.enabled&&!this.readonly&&(i=e.target.parentElement.getAttribute("data-value"),t=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(i)):this.getFormattedValue(i),this.allowCustomValue&&("false"!==i&&!1===t||!P.isNullOrUndefined(t)&&"NaN"===t.toString())&&(t=i),this.isPopupOpen()&&"CheckBox"!==this.mode&&this.hidePopup(e),this.inputFocus||this.inputElement.focus(),this.removeValue(t,e),t=this.allowObjectBinding?P.getValue(this.fields.value||"",t):t,P.isNullOrUndefined(this.findListElement(this.list,"li","data-value",t))&&this.mainList&&this.listData&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,this.mainData)),this.updateDelimeter(this.delimiterChar,e),this.placeholder&&"Never"===this.floatLabelType?(this.makeTextBoxEmpty(),this.checkPlaceholderSize()):this.inputElement.value="",e.preventDefault())},k.prototype.makeTextBoxEmpty=function(){this.inputElement.value="",this.refreshPlaceHolder()},k.prototype.refreshPlaceHolder=function(){this.placeholder&&"Never"===this.floatLabelType?this.value&&this.value.length||!P.isNullOrUndefined(this.text)&&""!==this.text?this.inputElement.placeholder="":this.inputElement.placeholder=st(this.placeholder):this.setFloatLabelType(),this.expandTextbox()},k.prototype.removeAllItems=function(e,t,i,s,l){var n=this.allowObjectBinding?this.indexOfObjectInArray(e,this.value):this.value.indexOf(e),a=this.value.slice(0),a=(a.splice(n,1),this.setProperties({value:[].concat([],a)},!0),s.setAttribute("aria-selected","false"),this.hideSelectedItem?D:y.selected),a=(P.removeClass([s],a),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:s,e:this,index:n}),this.invokeCheckboxSelection(s,t,i),this.allowObjectBinding?P.getValue(this.fields.value||"",e):e);this.updateMainList(!0,a,l),this.updateChipStatus()},k.prototype.invokeCheckboxSelection=function(e,t,i){this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:t}),this.updateAriaActiveDescendant(),this.value&&this.value.length!==this.mainData.length&&"CheckBox"===this.mode&&this.showSelectAll&&!this.isSelectAll&&!i&&this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"})},k.prototype.removeValue=function(i,s,l,n){var a,o,r=this,h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(this.getFormattedValue(i)),e=(-1===h&&this.allowCustomValue&&!P.isNullOrUndefined(i)&&(h=this.allowObjectBinding?this.indexOfObjectInArray(i,this.value):this.value.indexOf(i.toString())),s&&s.target),u=(n=!!(n||e&&e.classList.contains("e-close-hooker"))||null,this.hideSelectedItem?D:y.selected);-1!==h&&(e=this.allowObjectBinding?P.getValue(this.fields.value||"",i):i,a=this.virtualSelectAll?null:this.findListElement(this.list,"li","data-value",e),o=this.allowObjectBinding?i:this.getDataByValue(i),this.trigger("removing",{e:s,item:a,itemData:o,isInteracted:!!s,cancel:!1},function(e){var t;e.cancel?r.removeIndex++:(r.isRemoveSelection=!!r.enableVirtualization||r.isRemoveSelection,r.currentRemoveValue=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,r.virtualSelectAll=!1,(t=r.value.slice(0)).splice(h,1),r.enableVirtualization&&"CheckBox"===r.mode&&r.selectedListData.splice(h,1),r.setProperties({value:[].concat([],t)},!0),r.enableVirtualization&&(t=0===h&&r.text.split(r.delimiterChar)&&1===r.text.split(r.delimiterChar).length?r.text.replace(r.text.split(r.delimiterChar)[h],""):0===h?r.text.replace(r.text.split(r.delimiterChar)[h]+r.delimiterChar,""):r.text.replace(r.delimiterChar+r.text.split(r.delimiterChar)[h],""),r.setProperties({text:t.toString()},!0)),null!==a&&(t=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,t=r.findListElement(r.mainList,"li","data-value",t),a.setAttribute("aria-selected","false"),P.removeClass([a],u),t&&(t.setAttribute("aria-selected","false"),P.removeClass([a,t],u)),r.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===r.mode,li:a,e:r,index:h}),r.invokeCheckboxSelection(a,s,n)),t=r.allowObjectBinding?P.getValue(r.fields.value||"",i):i,r.hideSelectedItem&&r.fields.groupBy&&a&&r.hideGroupItem(t),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&r.isPopupOpen()&&A.prototype.scrollStop.call(r),r.updateMainList(!0,t),r.removeChip(t,n),r.updateChipStatus(),(r.value&&r.value.length?r.value.length:0)<r.maximumSelectionLength&&(t=r.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.removeClass(t,"e-disable")),r.trigger("removed",e),e=!(!(t=s&&s.currentTarget)||!t.classList.contains("e-selectall-parent"))||null,!r.changeOnBlur&&!n&&s&&l&&!e&&r.isSelectAllTarget&&r.updateValueState(s,r.value,r.tempValues),l&&(r.selectAllEventData.push(o),r.selectAllEventEle.push(a)),1===l&&(r.changeOnBlur||r.updateValueState(s,r.value,r.tempValues),t={event:s,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!s,isChecked:!1},r.trigger("selectedAll",t),r.selectAllEventData=[],r.selectAllEventEle=[]),!n||1!==l&&null!==l||r.clearAllCallback(s,n),r.isPopupOpen()&&a&&a.parentElement.classList.contains("e-reorder")&&(r.hideSelectedItem&&r.value&&Array.isArray(r.value)&&0<r.value.length&&r.totalItemsCount(),r.notify("setCurrentViewDataAsync",{module:"VirtualScroll"})))}))},k.prototype.updateMainList=function(e,t,i){(this.allowFiltering||"CheckBox"===this.mode)&&(i=i||this.findListElement(this.mainList,"li","data-value",t))&&(e?(i.setAttribute("aria-selected","false"),P.removeClass([i],this.hideSelectedItem?D:y.selected),"CheckBox"===this.mode&&P.removeClass([i.firstElementChild.lastElementChild],"e-check")):(i.setAttribute("aria-selected","true"),P.addClass([i],this.hideSelectedItem?D:y.selected),"CheckBox"===this.mode&&P.addClass([i.firstElementChild.lastElementChild],"e-check")))},k.prototype.removeChip=function(e,t){!this.chipCollectionWrapper||this.enableVirtualization&&t||(t=this.findListElement(this.chipCollectionWrapper,"span","data-value",e))&&P.remove(t)},k.prototype.setWidth=function(e){P.isNullOrUndefined(e)||("number"==typeof e?this.overAllWrapper.style.width=P.formatUnit(e):"string"==typeof e&&(this.overAllWrapper.style.width=e.match(/px|%|em/)?e:P.formatUnit(e)))},k.prototype.updateChipStatus=function(){this.value&&this.value.length?(P.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display=""),"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper(),this.showOverAllClear()):(P.isNullOrUndefined(this.chipCollectionWrapper)||(this.chipCollectionWrapper.style.display="none"),P.isNullOrUndefined(this.delimiterWrapper)||(this.delimiterWrapper.style.display="none"),this.hideOverAllClear())},k.prototype.indexOfObjectInArray=function(i,s){for(var e=0;e<s.length;e++){var t=function(e){var t=s[e];if(Object.keys(i).every(function(e){return t.hasOwnProperty(e)&&t[e]===i[e]}))return{value:e}}(e);if("object"==typeof t)return t.value}return-1},k.prototype.addValue=function(e,t,i){this.value||(this.value=[]);var s=this.allowObjectBinding?this.getDataByValue(e):e,l=((this.allowObjectBinding&&!this.isObjectInArray(this.getDataByValue(e),this.value)||!this.allowObjectBinding&&this.value.indexOf(s)<0)&&(this.setProperties({value:[].concat([],this.value,[s])},!0),this.enableVirtualization&&!this.isSelectAllLoop&&(s=this.viewWrapper.innerHTML,l=void 0,s=(s+=1===this.value.length?"":this.delimiterChar+" ")+(l=this.getOverflowVal(this.value.length-1)),l=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,s)),this.enableVirtualization)&&"CheckBox"===this.mode&&(s=[],this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[this.value.length-1]):this.value[this.value.length-1],l=t,l=null!=this.text&&""!==this.text?this.text+this.delimiterChar+l:l,s.push(l),this.setProperties({text:s.toString()},!0)),this.findListElement(this.list,"li","data-value",e));this.removeFocus(),l&&(this.addListFocus(l),this.addListSelection(l)),"Delimiter"!==this.mode&&"CheckBox"!==this.mode&&this.addChip(t,e,i),this.hideSelectedItem&&this.fields.groupBy&&this.hideGroupItem(e),this.updateChipStatus(),this.checkMaxSelection()},k.prototype.checkMaxSelection=function(){var e,t=this.value&&this.value.length?this.value.length:0;t===this.maximumSelectionLength&&(e=this.list.querySelectorAll("li."+y.li+".e-active"),P.removeClass(e,"e-disable"),e=this.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.addClass(e,"e-disable")),t<this.maximumSelectionLength&&(e=this.list.querySelectorAll("li."+y.li),P.removeClass(e,"e-disable"))},k.prototype.dispatchSelect=function(t,i,s,e,l,n,a){var o,r=this,h=this.listData;this.initStatus&&!e&&(t=this.allowObjectBinding?P.getValue(this.fields.value||"",t):t,o=n||this.getDataByValue(t),this.trigger("select",{e:i,item:s,itemData:o,isInteracted:!!i,cancel:!1},function(e){e.cancel||(l&&(r.selectAllEventData.push(o),r.selectAllEventEle.push(s)),1===l&&(e={event:i,items:r.selectAllEventEle,itemData:r.selectAllEventData,isInteracted:!!i,isChecked:!0},r.trigger("selectedAll",e),r.selectAllEventData=[]),r.allowCustomValue&&r.isServerRendered&&r.listData!==h&&(r.listData=h),t=r.allowObjectBinding?r.getDataByValue(t):t,r.enableVirtualization&&(P.isNullOrUndefined(r.selectedListData)?r.selectedListData=[r.getDataByValue(t)]:n?Array.isArray(r.selectedListData)?r.selectedListData.push(n):r.selectedListData=[r.selectedListData,n]:Array.isArray(r.selectedListData)?r.selectedListData.push(r.getDataByValue(t)):r.selectedListData=[r.selectedListData,r.getDataByValue(t)]),(r.enableVirtualization&&t||!r.enableVirtualization)&&r.updateListSelectEventCallback(t,s,i,a),r.hideSelectedItem&&r.fixedHeaderElement&&r.fields.groupBy&&"CheckBox"!==r.mode&&A.prototype.scrollStop.call(r))}))},k.prototype.addChip=function(e,t,i){this.chipCollectionWrapper&&this.getChip(e,t,i)},k.prototype.removeChipFocus=function(){var e=this.chipCollectionWrapper.querySelectorAll("span."+ot+"."+ht);if(P.removeClass(e,ht),P.Browser.isDevice)for(var t=this.chipCollectionWrapper.querySelectorAll("span."+rt.split(" ")[0]),i=0;i<t.length;i++)t[i].style.display="none"},k.prototype.onMobileChipInteraction=function(e){var t=P.closest(e.target,"."+ot),i=t.querySelector("span."+rt.split(" ")[0]);this.enabled&&!this.readonly&&(t.classList.contains(ht)||(this.removeChipFocus(),i.style.display="",t.classList.add(ht)),this.refreshPopup(),e.preventDefault())},k.prototype.multiCompiler=function(e){var t=!1;if("function"!=typeof e&&e)try{t=!!P.selectAll(e,document).length}catch(e){t=!1}return t},k.prototype.encodeHtmlEntities=function(e){return e.replace(/[\u00A0-\u9999<>&]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},k.prototype.getChip=function(e,t,i){var s=this,l={text:t,value:t},n=this.createElement("span",{className:ot,attrs:{"data-value":t,title:e}}),a=this.createElement("span",{className:"e-chipcontent"}),o=this.createElement("span",{className:rt}),t=(this.mainData&&(l=this.getDataByValue(t)),this.valueTemplate&&!P.isNullOrUndefined(l)?(t=this.multiCompiler(this.valueTemplate),(t=("function"!=typeof this.valueTemplate&&t?P.compile(P.select(this.valueTemplate,document).innerHTML.trim()):P.compile(this.valueTemplate))(l,this,"valueTemplate",this.valueTemplateId,this.isStringTemplate,null,a))&&0<t.length&&P.append(t,a),this.renderReactTemplates()):this.enableHtmlSanitizer?a.innerText=e:a.innerHTML=this.encodeHtmlEntities(e.toString()),n.appendChild(a),{isInteracted:!!i,itemData:l,e:i,setClass:function(e){P.addClass([n],e)},cancel:!1});this.isPreventChange=this.isAngular&&this.preventChange,this.trigger("tagging",t,function(e){e.cancel||(P.Browser.isDevice?(n.classList.add("e-mob-chip"),P.append([o],n),o.style.display="none",P.EventHandler.add(n,"click",s.onMobileChipInteraction,s)):(P.EventHandler.add(n,"mousedown",s.chipClick,s),s.showClearButton&&n.appendChild(o)),P.EventHandler.add(o,"mousedown",s.onChipRemove,s),s.chipCollectionWrapper.appendChild(n),!s.changeOnBlur&&i&&s.updateValueState(i,s.value,s.tempValues))})},k.prototype.calcPopupWidth=function(){var e=P.formatUnit(this.popupWidth);return e=-1<e.indexOf("%")?(this.componentWrapper.offsetWidth*parseFloat(e)/100).toString()+"px":e},k.prototype.mouseIn=function(){this.enabled&&!this.readonly&&this.showOverAllClear()},k.prototype.mouseOut=function(){this.inputFocus||(this.overAllClear.style.display="none")},k.prototype.listOption=function(e,t){var i=!P.isNullOrUndefined(t.iconCss),s=P.isNullOrUndefined(t.properties)?t:t.properties;return this.listCurrentOptions=null!==t.text||null!==t.value?{fields:s,showIcon:i,ariaAttributes:{groupItemRole:"presentation"}}:{fields:{value:"text"}},P.extend(this.listCurrentOptions,this.listCurrentOptions,t,!0),"CheckBox"===this.mode&&this.notify("listoption",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,dataSource:e,fieldProperty:s}),this.listCurrentOptions},k.prototype.renderPopup=function(){var e,t,i=this;this.list||A.prototype.render.call(this),this.popupObj&&document.body.contains(this.popupObj.element)&&this.allowFiltering?this.refreshPopup():this.popupObj||P.isNullOrUndefined(this.popupWrapper)||(document.body.appendChild(this.popupWrapper),e=this.popupWrapper.querySelector(".e-filter-parent"),"CheckBox"===this.mode&&!this.allowFiltering&&e&&this.filterParent&&(e.remove(),this.filterParent=null),e=parseInt(this.popupHeight,10),this.popupWrapper.style.visibility="hidden",this.headerTemplate&&(this.setHeaderTemplate(),e-=this.header.offsetHeight,this.isUpdateHeaderHeight=0!==this.header.offsetHeight),P.append([this.list],this.popupWrapper),!this.list.classList.contains(y.noData)&&this.getItems()[1]&&(this.listItemHeight=this.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(this.getItems()[1]).marginBottom,10)),this.enableVirtualization&&!this.list.classList.contains(y.noData)&&(!this.list.querySelector(".e-virtual-ddl-content")&&this.list.querySelector(".e-list-parent")?((t=this.createElement("div",{className:"e-virtual-ddl-content"})).style.cssText=this.getTransformValues(),this.list.appendChild(t).appendChild(this.list.querySelector(".e-list-parent"))):this.list.querySelector(".e-virtual-ddl-content")&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&this.totalItemsCount(),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((t=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(t))),this.footerTemplate&&(this.setFooterTemplate(),e-=this.footer.offsetHeight,this.isUpdateFooterHeight=0!==this.footer.offsetHeight),"CheckBox"===this.mode&&this.showSelectAll?(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),e-=this.selectAllHeight):"CheckBox"!==this.mode||this.showSelectAll||this.headerTemplate||this.footerTemplate?"CheckBox"!==this.mode||this.showSelectAll||(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),e=parseInt(this.popupHeight,10),this.headerTemplate&&this.header&&(e-=this.header.offsetHeight),this.footerTemplate&&this.footer&&(e-=this.footer.offsetHeight)):(this.notify("selectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),e=parseInt(this.popupHeight,10)),"CheckBox"===this.mode&&(t={module:"CheckBoxSelection",enable:"CheckBox"===this.mode,popupElement:this.popupWrapper},this.allowFiltering&&(this.notify("searchBox",t),e-=this.searchBoxHeight),P.addClass([this.popupWrapper],"e-checkbox")),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(e),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight),this.popupObj=new o.Popup(this.popupWrapper,{width:this.calcPopupWidth(),targetType:"relative",position:this.enableRtl?{X:"right",Y:"bottom"}:{X:"left",Y:"bottom"},relateTo:this.overAllWrapper,collision:this.enableRtl?{X:"fit",Y:"flip"}:{X:"flip",Y:"flip"},offsetY:1,enableRtl:this.enableRtl,zIndex:this.zIndex,close:function(){var e;i.popupObj.element.parentElement&&(i.popupObj.unwireScrollEvents(),e=i.popupWrapper.querySelector("."+St),"CheckBox"===i.mode&&e&&document.activeElement===e&&e.blur(),P.detach(i.popupObj.element))},open:function(){var e;i.popupObj.resolveCollision(),i.isFirstClick||(!(e=i.list.querySelector("ul"))||"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||(i.mainList=e.cloneNode?e.cloneNode(!0):e),i.isFirstClick=!0),i.popupObj.wireScrollEvents(),"CheckBox"!==i.mode&&(i.allowFiltering||i.allowCustomValue)&&""!==i.targetElement().trim()||i.enableVirtualization||(i.loadTemplate(),i.enableVirtualization&&"CheckBox"===i.mode&&i.UpdateSkeleton()),i.isPreventScrollAction=!0,i.setScrollPosition(),!i.list.classList.contains(y.noData)&&i.getItems()[1]&&0!==i.getItems()[1].offsetHeight&&(i.listItemHeight=i.getItems()[1].offsetHeight+parseInt(window.getComputedStyle(i.getItems()[1]).marginBottom,10),i.list.getElementsByClassName("e-virtual-ddl-content")[0])&&(i.list.getElementsByClassName("e-virtual-ddl-content")[0].style=i.getTransformValues()),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"focus"}),i.enableVirtualization&&(i.notify("bindScrollEvent",{module:"VirtualScroll",component:i.getModuleName(),enable:i.enableVirtualization}),setTimeout(function(){i.value?i.updateSelectionList():i.viewPortInfo&&i.viewPortInfo.offsets.top&&(i.list.scrollTop=i.viewPortInfo.offsets.top)},5))},targetExitViewport:function(){P.Browser.isDevice||i.hidePopup()}}),this.checkCollision(this.popupWrapper),this.popupContentElement=this.popupObj.element.querySelector(".e-content"),"CheckBox"===this.mode&&P.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen&&this.notify("deviceSearchBox",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode}),this.allowResize&&this.setResize(),this.popupObj.close(),this.popupWrapper.style.visibility="")},k.prototype.checkCollision=function(e){"CheckBox"===this.mode&&P.Browser.isDevice&&this.allowFiltering&&this.isDeviceFullScreen||(0<o.isCollide(e).length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px"),this.popupObj.resolveCollision())},k.prototype.setHeaderTemplate=function(){this.header&&this.header.remove(),this.header=this.createElement("div"),P.addClass([this.header],"e-ddl-header");var e=this.multiCompiler(this.headerTemplate),e="function"!=typeof this.headerTemplate&&e?P.compile(P.select(this.headerTemplate,document).innerHTML.trim()):P.compile(this.headerTemplate),e=e({},this,"headerTemplate",this.headerTemplateId,this.isStringTemplate,null,this.header);e&&0<e.length&&P.append(e,this.header),"CheckBox"===this.mode&&this.showSelectAll?P.prepend([this.header],this.popupWrapper):P.append([this.header],this.popupWrapper),P.EventHandler.add(this.header,"mousedown",this.onListMouseDown,this)},k.prototype.setFooterTemplate=function(){this.footer&&this.footer.remove(),this.footer=this.createElement("div"),P.addClass([this.footer],"e-ddl-footer");var e=this.multiCompiler(this.footerTemplate),e="function"!=typeof this.footerTemplate&&e?P.compile(P.select(this.footerTemplate,document).innerHTML.trim()):P.compile(this.footerTemplate),e=e({},this,"footerTemplate",this.footerTemplateId,this.isStringTemplate,null,this.footer);e&&0<e.length&&P.append(e,this.footer),P.append([this.footer],this.popupWrapper),P.EventHandler.add(this.footer,"mousedown",this.onListMouseDown,this)},k.prototype.updateInitialData=function(){var e,t=this.selectData;this.renderItems(t,this.fields);this.list.scrollTop=0,this.virtualListInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount},this.previousStartIndex=0,this.previousEndIndex=this.itemCount,this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):this.totalItemCount=this.dataCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.getSkeletonCount(),this.skeletonCount=0!==this.totalItemCount&&this.totalItemCount<2*this.itemCount&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&this.totalItemCount<=this.itemCount)?0:this.skeletonCount,this.UpdateSkeleton(),this.list.getElementsByClassName("e-virtual-ddl")[0]?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():!this.list.querySelector(".e-virtual-ddl")&&0<this.skeletonCount&&((e=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(e)),this.listData=t,this.liCollections=this.list.querySelectorAll(".e-list-item"),this.list.getElementsByClassName("e-virtual-ddl-content")[0]&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.enableVirtualization&&this.notify("setGeneratedData",{module:"VirtualScroll"})},k.prototype.clearAll=function(e){if(this.enabled&&!this.readonly){var t=void 0;if(this.setDynValue=!1,this.isClearAllAction=!0,this.value&&0<this.value.length){this.allowFiltering&&(this.refreshListItems(null),"CheckBox"===this.mode)&&this.targetInputElement&&(this.targetInputElement.value="");var i=this.list&&this.list.querySelectorAll("li.e-list-item");if(i&&0<i.length)this.selectAllItems(!1,e);else for(this.removeIndex=0,t=this.value[this.removeIndex];this.removeIndex<this.value.length;t=this.value[this.removeIndex])this.removeValue(t,e,null,!0);this.selectedElementID=null,this.inputElement.removeAttribute("aria-activedescendant")}else this.clearAllCallback(e);this.checkAndResetCache(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.enableVirtualization&&(this.updateInitialData(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.isCustomDataUpdated||this.notify("setGeneratedData",{module:"VirtualScroll"})),this.enableVirtualization&&(this.list.scrollTop=0,this.virtualListInfo=null,this.previousStartIndex=0,this.previousEndIndex=this.itemCount),this.isClearAllAction=!1}this.isClearAllItem=!0,P.EventHandler.add(document,"mouseup",this.preventSelection,this)},k.prototype.preventSelection=function(e){this.isClearAllItem&&e.stopPropagation(),this.isClearAllItem=!1,P.EventHandler.remove(document,"mouseup",this.preventSelection)},k.prototype.clearAllCallback=function(e,t){var i,s=this.value?this.value.slice():[];this.mainList&&this.listData&&(this.allowFiltering&&"CheckBox"!==this.mode||this.allowCustomValue)&&(i=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(i,this.mainData)),this.focusAtFirstListItem(),this.updateDelimeter(this.delimiterChar,e),"Box"===this.mode||this.inputFocus&&"CheckBox"!==this.mode||this.updateDelimView(),""!==this.inputElement.value&&(this.makeTextBoxEmpty(),this.search(null)),this.checkPlaceholderSize(),this.isPopupOpen()&&this.refreshPopup(),this.allowResize&&this.setResize(),this.inputFocus||(this.changeOnBlur&&this.updateValueState(e,this.value,s),"CheckBox"!==this.mode&&this.inputElement.focus()),"CheckBox"===this.mode&&(this.refreshPlaceHolder(),this.refreshInputHight(),this.changeOnBlur)&&t&&(P.isNullOrUndefined(this.value)||0===this.value.length)&&this.updateValueState(e,this.value,this.tempValues),this.changeOnBlur||!t||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.updateValueState(e,this.value,this.tempValues),"CheckBox"===this.mode&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&this.updateListItems(this.list.querySelectorAll("li.e-list-item"),this.mainList.querySelectorAll("li.e-list-item")),e.preventDefault()},k.prototype.windowResize=function(){this.refreshPopup(),this.inputFocus&&"CheckBox"!==this.mode||!this.viewWrapper||!this.viewWrapper.parentElement||this.updateDelimView()},k.prototype.resetValueHandler=function(e){var t;P.isNullOrUndefined(this.inputElement)||(t=P.closest(this.inputElement,"form"))&&e.target===t&&(e=this.element.tagName===this.getNgDirective()?null:this.element.getAttribute("data-initial-value"),this.text=e)},k.prototype.wireEvent=function(){P.EventHandler.add(this.componentWrapper,"mousedown",this.wrapperClick,this),P.EventHandler.add(window,"resize",this.windowResize,this),P.EventHandler.add(this.inputElement,"focus",this.focusInHandler,this),P.EventHandler.add(this.inputElement,"keydown",this.onKeyDown,this),P.EventHandler.add(this.inputElement,"keyup",this.keyUp,this),"CheckBox"!==this.mode&&P.EventHandler.add(this.inputElement,"input",this.onInput,this),P.EventHandler.add(this.inputElement,"blur",this.onBlurHandler,this),P.EventHandler.add(this.componentWrapper,"mouseover",this.mouseIn,this);var e=P.closest(this.inputElement,"form");e&&P.EventHandler.add(e,"reset",this.resetValueHandler,this),P.EventHandler.add(this.componentWrapper,"mouseout",this.mouseOut,this),P.EventHandler.add(this.overAllClear,"mousedown",this.clearAll,this),P.EventHandler.add(this.inputElement,"paste",this.pasteHandler,this)},k.prototype.onInput=function(e){this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,P.Browser.isDevice&&"mozilla"===P.Browser.info.name&&this.search(e)},k.prototype.pasteHandler=function(e){var t=this;setTimeout(function(){t.expandTextbox(),t.search(e)})},k.prototype.search=function(e){var s=this;if(this.preventSetCurrentData=!1,this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,P.isNullOrUndefined(e)||(this.keyCode=e.keyCode),!this.isPopupOpen()&&this.openOnClick&&this.showPopup(e),this.openClick(e),!this.checkTextLength()||this.allowFiltering||P.isNullOrUndefined(e)||8===e.keyCode){var t=this.targetElement();if(this.allowFiltering){this.allowCustomValue&&(this.isRemoteSelection=!0),this.checkAndResetCache();var l={preventDefaultAction:this.isRequesting=!1,text:this.targetElement(),updateData:function(e,t,i){l.cancel||(s.isFiltered=!0,s.customFilterQuery=t,s.remoteFilterAction=!0,s.isCustomFiltering=!0,s.dataUpdater(e,t,i))},event:e,cancel:!1};this.trigger("filtering",l,function(e){s.isFilterPrevented=e.cancel,e.cancel||s.isFiltered||e.preventDefaultAction||(s.filterAction=!0,s.isFilteringAction=!0,s.dataSource instanceof c.DataManager&&s.allowCustomValue&&(s.isCustomRendered=!1),s.dataUpdater(s.dataSource,null,s.fields),s.isFilteringAction=!1)})}else if(this.allowCustomValue){e=new c.Query,e=this.allowFiltering&&""!==t?e.where(this.fields.text,"startswith",t,this.ignoreCase,this.ignoreAccent):e;this.enableVirtualization?this.dataUpdater(this.dataSource,e,this.fields):this.dataUpdater(this.mainData,e,this.fields),this.UpdateSkeleton()}else{var t=this.list.querySelectorAll("li."+y.li+":not(.e-hide-listitem)"),i=this.typeOfData(this.listData).typeof,n=d(this.targetElement(),t,"StartsWith",this.ignoreCase);if(this.enableVirtualization&&""!==this.targetElement().trim()&&!this.allowFiltering){var a,o,r=!1;for((this.viewPortInfo.endIndex>=this.incrementalEndIndex&&this.incrementalEndIndex<=this.totalItemCount||0===this.incrementalEndIndex)&&(r=!0,this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!1),0===this.viewPortInfo.startIndex&&!r||this.updateIncrementalView(0,this.itemCount),n=d(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i);P.isNullOrUndefined(n)&&this.incrementalEndIndex<this.totalItemCount&&(this.incrementalStartIndex=this.incrementalEndIndex,this.incrementalEndIndex=this.incrementalEndIndex+100>this.totalItemCount?this.totalItemCount:this.incrementalEndIndex+100,this.updateIncrementalInfo(this.incrementalStartIndex,this.incrementalEndIndex),r=!0,0===this.viewPortInfo.startIndex&&!r||this.updateIncrementalView(0,this.itemCount),n=d(this.targetElement(),this.incrementalLiCollections,this.filterType,!0,this.listData,this.fields,i),P.isNullOrUndefined(n));)if(P.isNullOrUndefined(n)&&this.incrementalEndIndex>=this.totalItemCount){this.incrementalStartIndex=0,this.incrementalEndIndex=this.totalItemCount<100?this.totalItemCount:100;break}!n.index||this.viewPortInfo.startIndex>=n.index&&n.index>=this.viewPortInfo.endIndex||(o=(a=0<n.index-(this.itemCount/2-2)?n.index-(this.itemCount/2-2):0)+this.itemCount>this.totalItemCount?this.totalItemCount:a+this.itemCount,a!==this.viewPortInfo.startIndex&&this.updateIncrementalView(a,o)),P.isNullOrUndefined(n.item)?(this.updateIncrementalView(0,this.itemCount),this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues(),this.list.scrollTop=0):(this.getIndexByValue(n.item.getAttribute("data-value"))-this.skeletonCount>this.itemCount/2&&(a=this.viewPortInfo.startIndex+(this.itemCount/2-2)<this.totalItemCount?this.viewPortInfo.startIndex+(this.itemCount/2-2):this.totalItemCount,o=this.viewPortInfo.startIndex+this.itemCount>this.totalItemCount?this.totalItemCount:this.viewPortInfo.startIndex+this.itemCount,this.updateIncrementalView(a,o)),n.item=this.getElementByValue(n.item.getAttribute("data-value"))),n&&n.item&&(n.item=this.getElementByValue(n.item.getAttribute("data-value")))}n&&n.item?(this.addListFocus(n.item),this.list.scrollTop=n.item.offsetHeight*n.index):""!==this.targetElement()?this.removeFocus():this.focusAtFirstListItem()}}else this.focusAtFirstListItem();this.enableVirtualization&&this.allowFiltering&&this.getFilteringSkeletonCount()},k.prototype.preRender=function(){null===this.allowFiltering&&(this.allowFiltering="CheckBox"===this.mode),this.preventSetCurrentData=!1,this.initializeData(),this.updateDataAttribute(this.htmlAttributes),A.prototype.preRender.call(this)},k.prototype.getLocaleName=function(){return"multi-select"},k.prototype.initializeData=function(){this.mainListCollection=[],this.beforePopupOpen=!1,this.filterAction=!1,this.remoteFilterAction=!1,this.isFirstClick=!1,this.mobFilter=!0,this.isFiltered=!1,this.focused=!0,this.initial=!0,this.backCommand=!0,this.isCustomRendered=!1,this.isRemoteSelection=!1,this.isSelectAllTarget=!0,this.isaddNonPresentItems=!1,this.viewPortInfo={currentPageNumber:null,direction:null,sentinelInfo:{},offsets:{},startIndex:0,endIndex:this.itemCount}},k.prototype.updateData=function(n,a,o){var r,h="",u="Delimiter"===this.mode||"CheckBox"===this.mode,p=[],e=this.listData;if(this.enableVirtualization||(this.listData=this.mainData),P.isNullOrUndefined(this.hiddenElement)||this.enableVirtualization||(this.hiddenElement.innerHTML=""),!P.isNullOrUndefined(this.value)){for(var d,c=this.value.length,m="",f=this,t=0;t<c;t++){var i=function(e){var t,i,s=f.allowObjectBinding?P.getValue(f.fields.value||"",f.value[e]):f.value[e],l=f.findListElement(P.isNullOrUndefined(f.mainList)?f.ulElement:f.mainList,"li","data-value",s);if(f.enableVirtualization&&(l=f.findListElement(P.isNullOrUndefined(f.list)?f.ulElement:f.list,"li","data-value",s)),P.isNullOrUndefined(l)&&!f.allowCustomValue&&!f.enableVirtualization&&f.listData&&0<f.listData.length)f.value.splice(e,1),--e,--c;else{if(f.listData){if(f.enableVirtualization)return u&&!f.isDynamicRemoteVirtualData&&(h=f.delimiterWrapper&&""===f.delimiterWrapper.innerHTML?h:f.delimiterWrapper.innerHTML),l=f.allowObjectBinding?P.getValue(f.fields.value||"",f.value[f.value.length-1]):f.value[f.value.length-1],f.isRemoveSelection?(h=f.text.replace(/,/g,n+" ")+n+" ",p=f.text.split(n)):(r=o&&u?f.text:f.getTextByValue(l),i=f.isDynamicRemoteVirtualData&&null!=l&&""!==l&&!o?f.getTextByValue(l):o?f.text:f.text&&""!==f.text?f.text+f.delimiterChar+r:r,h+=r+n+" ",p.push(i),m=f.hiddenElement.innerHTML),a&&a.currentTarget&&a.currentTarget.classList.contains("e-chips-close")||a&&"Backspace"===a.key?(t=a.target.parentElement.getAttribute("data-value"),"Backspace"===a.key?(i=f.hiddenElement.lastChild)&&f.hiddenElement.removeChild(i):f.hiddenElement.childNodes.forEach(function(e){e.value===t&&e.parentNode.removeChild(e)}),m=f.hiddenElement.innerHTML):m+="<option selected value='"+l+"'>"+e+"</option>",d=e,"break";r=f.getTextByValue(s)}else r=s;h+=r+n+" ",p.push(r)}m+='<option selected value="'+s+'">'+e+"</option>",d=e}(t),t=d;if("break"===i)break}P.isNullOrUndefined(this.hiddenElement)||(this.isRemoveSelection?(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)&&this.hiddenElement.removeChild(this.findListElement(this.hiddenElement,"option","value",this.currentRemoveValue)),this.isRemoveSelection=!1):this.hiddenElement.innerHTML=m)}var s=a&&a.target&&a.target.classList.contains("e-chips-close"),s=(this.enableVirtualization&&(!this.enableVirtualization||"CheckBox"===this.mode||s)||this.setProperties({text:p.toString()},!0),u&&(this.updateWrapperText(this.delimiterWrapper,h),this.delimiterWrapper.setAttribute("id",P.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id)),a&&a.target),s=!(!s||!s.classList.contains("e-close-hooker"))||null;(!this.changeOnBlur&&a&&!s||this.isSelectAll)&&(this.isSelectAll=!1,this.updateValueState(a,this.value,this.tempValues)),this.listData=e,this.addValidInputClass()},k.prototype.initialTextUpdate=function(){if(P.isNullOrUndefined(this.text))this.setProperties({value:null},!0);else{for(var e,t=this.text.split(this.delimiterChar),i=[],s=0;t.length>s;s++){var l=this.getValueByText(t[s]);P.isNullOrUndefined(l)?this.allowCustomValue&&i.push(t[s]):i.push(l)}i&&i.length&&(e=this.allowObjectBinding?this.getDataByValue(i):i,this.setProperties({value:e},!0))}},k.prototype.renderList=function(e){!e&&this.allowCustomValue&&this.list&&(this.list.textContent===this.noRecordsTemplate||this.list.querySelector(".e-ul")&&0===this.list.querySelector(".e-ul").childElementCount)&&(e=!0),A.prototype.render.call(this,null,e),this.totalItemCount=this.dataSource&&this.dataSource.length?this.dataSource.length:0,this.unwireListEvents(),this.wireListEvents()},k.prototype.initialValueUpdate=function(e,t){if(this.list){var i=void 0,s=void 0;if(this.chipCollectionWrapper&&(this.chipCollectionWrapper.innerHTML=""),this.removeListSelection(),!P.isNullOrUndefined(this.value))for(var l=0;!P.isNullOrUndefined(this.value[l]);l++){var n,a,o,r,h=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[l]):this.value[l],s=this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),u=!1;if(this.enableVirtualization){if((i=null)!=e&&0<e.length)for(var p=0;p<e.length;p++)if(this.isPrimitiveData&&e[p]===h||!this.isPrimitiveData&&P.getValue(this.fields.value||"value",e[p])===h){i=this.isPrimitiveData?e[p]:P.getValue(this.fields.text,e[p]),this.enableVirtualization&&(P.isNullOrUndefined(this.selectedListData)?this.selectedListData=[e[p]]:Array.isArray(this.selectedListData)?this.selectedListData.push(e[p]):this.selectedListData=[this.selectedListData,e[p]]);break}P.isNullOrUndefined(i)&&this.allowCustomValue&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&t)&&(i=this.getTextByValue(h),u=!0)}else i=this.getTextByValue(h);s&&"true"!==s.getAttribute("aria-selected")||s&&"true"===s.getAttribute("aria-selected")&&this.hideSelectedItem&&("Box"===this.mode||"Default"===this.mode)||this.enableVirtualization&&null!=h&&null!=i&&!u?(o=[],r=this.isDynamicRemoteVirtualData&&null!=i&&""!==i&&0===l||null==this.text||""===this.text||this.text.includes(i)?i:this.text+this.delimiterChar+i,o.push(r),this.setProperties({text:o.toString()},!0),this.addChip(i,h),this.addListSelection(s)):(!this.enableVirtualization&&h&&this.allowCustomValue||this.enableVirtualization&&h&&this.allowCustomValue&&(!(this.dataSource instanceof c.DataManager)||this.dataSource instanceof c.DataManager&&t))&&(u=this.listData.length,P.setValue(this.fields.text,h,n={}),P.setValue(this.fields.value,h,n),a=this.popupWrapper.querySelector("."+y.noData),this.enableVirtualization||this.addItem(n,u),this.enableVirtualization&&(this.virtualCustomSelectData&&0<=this.virtualCustomSelectData.length?this.virtualCustomSelectData.push(n):this.virtualCustomSelectData=[n]),s=s||this.findListElement(this.hideSelectedItem?this.ulElement:this.list,"li","data-value",h),this.popupWrapper.contains(a)&&(this.list.setAttribute("style",a.getAttribute("style")),this.popupWrapper.replaceChild(this.list,a),this.wireListEvents()),r=null!=this.text&&""!==this.text?this.text+this.delimiterChar+i:i,(o=[]).push(r),this.setProperties({text:o.toString()},!0),this.addChip(i,h),this.addListSelection(s))}"CheckBox"===this.mode?(this.updateDelimView(),this.changeOnBlur&&this.updateValueState(null,this.value,this.tempValues),this.updateDelimeter(this.delimiterChar),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,null,t),"CheckBox"!==this.mode||!this.showSelectAll||!P.isNullOrUndefined(this.value)&&this.value.length||this.notify("checkSelectAll",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,value:"uncheck"}),"Box"===this.mode||"Default"===this.mode&&this.inputFocus?this.chipCollectionWrapper.style.display="":"Delimiter"!==this.mode&&"CheckBox"!==this.mode||this.showDelimWrapper()}},k.prototype.updateActionCompleteData=function(e,t){this.value&&(!this.allowObjectBinding&&-1<this.value.indexOf(e.getAttribute("data-value"))||this.allowObjectBinding&&this.isObjectInArray(this.getDataByValue(e.getAttribute("data-value")),this.value))&&(this.mainList=this.ulElement,this.hideSelectedItem)&&P.addClass([e],D)},k.prototype.updateAddItemList=function(e,t){this.popupObj&&this.popupObj.element&&this.popupObj.element.querySelector("."+y.noData)&&e?(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"),P.remove(this.popupWrapper.querySelector(".e-content")),this.popupObj=null,this.renderPopup()):this.allowCustomValue&&(this.list=e,this.mainList=this.ulElement=e.querySelector("ul"))},k.prototype.updateDataList=function(){var e,t,i;this.mainList&&this.ulElement&&!(this.isFiltered||this.filterAction||this.targetElement().trim())&&(e=this.mainList.childElementCount<this.ulElement.childElementCount,t=0<this.ulElement.childElementCount&&0<this.ulElement.children[0].childElementCount&&this.mainList.children[0]&&this.mainList.children[0].childElementCount<this.ulElement.children[0].childElementCount,i=this.itemTemplate&&0<this.ulElement.childElementCount&&!(this.ulElement.childElementCount<this.mainList.childElementCount)&&(0<this.ulElement.children[0].childElementCount||this.fields.groupBy&&this.ulElement.children[1]&&0<this.ulElement.children[1].childElementCount),e||t||i)&&(this.mainList=this.ulElement)},k.prototype.isValidLI=function(e){return e&&!e.classList.contains(y.disabled)&&!e.classList.contains(y.group)&&e.classList.contains(y.li)},k.prototype.updateListSelection=function(e,t,i){var s=e.getAttribute("data-value"),l=this.allowObjectBinding?this.getDataByValue(this.getFormattedValue(s)):this.getFormattedValue(s);this.allowCustomValue&&("false"!==s&&!1===l||!P.isNullOrUndefined(l)&&"NaN"===l.toString())&&(l=s),this.removeHover(),!this.value||!this.allowObjectBinding&&-1===this.value.indexOf(l)||this.allowObjectBinding&&-1===this.indexOfObjectInArray(l,this.value)?this.dispatchSelect(l,t,e,"true"===e.getAttribute("aria-selected"),i):this.removeValue(l,t,i)},k.prototype.updateListSelectEventCallback=function(t,e,i,s){var l,n,a=this,o=(t=this.allowObjectBinding?P.getValue(this.fields.value||"",t):t,s||this.getTextByValue(t));(this.allowCustomValue||this.allowFiltering)&&!this.findListElement(this.mainList,"li","data-value",t)&&(!this.enableVirtualization||this.enableVirtualization&&this.virtualCustomData)?(l=e&&e.cloneNode(!0),s=this.fields.value||"value",this.allowCustomValue&&this.mainData.length&&"number"==typeof P.getValue(s,this.mainData[0])&&(t=isNaN(parseFloat(t.toString()))?t:parseFloat(t.toString())),n=this.getDataByValue(t),this.trigger("customValueSelection",{newData:n,cancel:!1},function(e){e.cancel||(a.enableVirtualization&&a.virtualCustomData?a.virtualCustomSelectData&&0<=a.virtualCustomSelectData.length?a.virtualCustomSelectData.push(n):a.virtualCustomSelectData=[n]:(P.append([l],a.mainList),a.mainData.push(n)),a.remoteCustomValue=!1,a.addValue(t,o,i))})):(this.remoteCustomValue=!1,this.addValue(t,o,i))},k.prototype.removeListSelection=function(){var e=this.hideSelectedItem?D:y.selected,t=this.list.querySelectorAll("."+e),i=t.length;if(t&&t.length)for(P.removeClass(t,e);0<i;)t[i-1].setAttribute("aria-selected","false"),i--;if(!P.isNullOrUndefined(this.mainList)){var s=this.mainList.querySelectorAll("."+e),l=s.length;if(s&&s.length)for(P.removeClass(s,e);0<l;)s[l-1].setAttribute("aria-selected","false"),"CheckBox"===this.mode&&(t&&t.length>l-1&&P.removeClass([t[l-1].firstElementChild.lastElementChild],"e-check"),P.removeClass([s[l-1].firstElementChild.lastElementChild],"e-check")),l--}},k.prototype.removeHover=function(){var e=this.list.querySelectorAll("."+y.hover);e&&e.length&&P.removeClass(e,y.hover)},k.prototype.removeFocus=function(){var e,t;this.list&&this.mainList&&(e=this.list.querySelectorAll("."+y.focus),t=this.mainList.querySelectorAll("."+y.focus),e)&&e.length&&(P.removeClass(e,y.focus),P.removeClass(t,y.focus))},k.prototype.addListHover=function(e){(this.enabled&&this.isValidLI(e)||null!==e&&e.classList.contains("e-list-group-item")&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy))&&(this.removeHover(),P.addClass([e],y.hover))},k.prototype.addListFocus=function(e){this.enabled&&(this.isValidLI(e)||this.fields.disabled&&this.isDisabledElement(e))?(this.removeFocus(),P.addClass([e],y.focus),this.updateAriaActiveDescendant()):this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&(P.addClass([e],y.focus),this.updateAriaActiveDescendant())},k.prototype.addListSelection=function(e,t){var i=this.hideSelectedItem?D:y.selected;this.isValidLI(e)&&!e.classList.contains(y.hover)&&(P.addClass([e],i),this.updateMainList(!1,e.getAttribute("data-value"),t),e.setAttribute("aria-selected","true"),"CheckBox"===this.mode&&e.classList.contains("e-active")&&0===e.getElementsByClassName("e-check").length&&this.notify("updatelist",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.notify("activeList",{module:"CheckBoxSelection",enable:"CheckBox"===this.mode,li:e,e:this}),this.chipCollectionWrapper&&this.removeChipSelection(),this.selectedElementID=e.id)},k.prototype.updateDelimeter=function(e,t,i){this.updateData(e,t,i)},k.prototype.onMouseClick=function(e){var t,i,s,l=this;this.isClearAllItem||(this.keyCode=null,this.scrollFocusStatus=!1,this.keyboardEvent=null,i=e.target,t=P.closest(i,"."+y.li),this.enableVirtualization&&t&&t.classList.contains("e-virtual-list"))||(P.closest(i,"."+y.group)&&this.enableGroupCheckBox&&"CheckBox"===this.mode&&this.fields.groupBy?((i=i.classList.contains("e-list-group-item")?i.firstElementChild.lastElementChild:e.target).classList.contains("e-check")?(this.selectAllItem(!1,e),i.classList.remove("e-check"),i.classList.remove("e-stop"),P.closest(i,".e-list-group-item").classList.remove("e-active"),i.setAttribute("aria-selected","false")):(this.selectAllItem(!0,e),i.classList.remove("e-stop"),i.classList.add("e-check"),P.closest(i,".e-list-group-item").classList.add("e-active"),i.setAttribute("aria-selected","true")),this.refreshSelection(),this.checkSelectAll()):(this.isValidLI(t)?(s=this.value&&this.value.length?this.value.length:0,t.classList.contains("e-active")&&(s-=1),s<this.maximumSelectionLength&&(this.updateListSelection(t,e),this.checkPlaceholderSize(),this.addListFocus(t),(this.allowCustomValue||this.allowFiltering)&&this.mainList&&this.listData?"CheckBox"!==this.mode&&(this.focusAtLastListItem(t.getAttribute("data-value")),this.refreshSelection()):this.makeTextBoxEmpty()),"CheckBox"===this.mode?(this.updateDelimView(),this.value&&50<this.value.length?setTimeout(function(){l.updateDelimeter(l.delimiterChar,e)},0):this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.checkSelectAll(),this.refreshPopup(),this.allowResize&&this.setResize(),this.hideSelectedItem&&this.focusAtFirstListItem(),this.closePopupOnSelect?this.hidePopup(e):e.preventDefault(),s=""!==this.targetElement().trim(),this.makeTextBoxEmpty(),this.findGroupStart(i),"CheckBox"!==this.mode&&this.refreshListItems(P.isNullOrUndefined(t)?null:t.textContent,s)):e.preventDefault(),this.enableVirtualization&&this.hideSelectedItem&&(i=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(t=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,i.length<t+2)&&(s=(s=this.getForQuery(this.value).clone()).skip(this.virtualItemStartIndex),this.resetList(this.dataSource,this.fields,s),this.UpdateSkeleton(),this.liCollections=this.list.querySelectorAll("."+y.li),this.virtualItemCount=this.itemCount,"CheckBox"!==this.mode&&(this.totalItemCount=this.value&&this.value.length?this.totalItemCount-this.value.length:this.totalItemCount),this.list.querySelector(".e-virtual-ddl")?this.list.getElementsByClassName("e-virtual-ddl")[0].style=this.GetVirtualTrackHeight():((i=this.createElement("div",{id:this.element.id+"_popup",className:"e-virtual-ddl"})).style.cssText=this.GetVirtualTrackHeight(),this.popupWrapper.querySelector(".e-dropdownbase").appendChild(i)),this.list.querySelector(".e-virtual-ddl-content"))&&(this.list.getElementsByClassName("e-virtual-ddl-content")[0].style=this.getTransformValues()),this.refreshPlaceHolder(),this.deselectHeader()))},k.prototype.findGroupStart=function(e){if(this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)){var t;if(this.itemTemplate&&!e.getElementsByClassName("e-frame").length)for(;!e.getElementsByClassName("e-frame").length;)e=e.parentElement;for(e.classList.contains("e-frame")&&(e=e.parentElement.parentElement),t=this.findGroupAttrtibutes(e,0,0,0,0),t=this.findGroupAttrtibutes(e,t[0],t[1],t[2],1);!e.classList.contains("e-list-group-item")&&null!=(e=(e=e.classList.contains("e-list-icon")?e.parentElement:e).previousElementSibling););this.updateCheckBox(e,t[0],t[1],t[2])}},k.prototype.findGroupAttrtibutes=function(e,t,i,s,l){for(;!e.classList.contains("e-list-group-item")&&(this.fields.disabled&&this.isDisabledElement(e)||((e=e.classList.contains("e-list-icon")?e.parentElement:e).getElementsByClassName("e-frame")[0].classList.contains("e-check")&&e.classList.contains("e-list-item")?t++:e.classList.contains("e-list-item")&&i++,s++),null!=(e=l?e.nextElementSibling:e.previousElementSibling)););return[t,i,s]},k.prototype.updateCheckBox=function(e,t,i,s){var l;null===e||!P.isNullOrUndefined(this.fields.disabled)&&0===s||(l=e.getElementsByClassName("e-frame")[0],s===t?(l.classList.remove("e-stop"),l.classList.add("e-check"),P.closest(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","true")):s===i?(l.classList.remove("e-check"),l.classList.remove("e-stop"),P.closest(l,".e-list-group-item").classList.remove("e-active"),e.setAttribute("aria-selected","false")):this.maximumSelectionLength===t-1?(l.classList.remove("e-stop"),e.setAttribute("aria-selected","true"),P.closest(l,".e-list-group-item").classList.add("e-active"),l.classList.add("e-check")):(l.classList.remove("e-check"),l.classList.add("e-stop"),P.closest(l,".e-list-group-item").classList.add("e-active"),e.setAttribute("aria-selected","false")))},k.prototype.disableGroupHeader=function(){var e=this.list.querySelectorAll("li.e-list-group-item");if(e)for(var t=0;t<e.length;t++){for(var i=!0,s=e[t].nextElementSibling;!s.classList.contains("e-list-group-item");){if(!this.isDisabledElement(s)){i=!1;break}if(null==(s=s.nextElementSibling))break}i&&this.disableListItem(e[t])}},k.prototype.deselectHeader=function(){var e=this.value&&this.value.length?this.value.length:0,t=this.list.querySelectorAll("li.e-list-group-item:not(.e-active)");e<this.maximumSelectionLength&&P.removeClass(t,"e-disable"),e===this.maximumSelectionLength&&P.addClass(t,"e-disable")},k.prototype.onMouseOver=function(e){var t=P.closest(e.target,"."+y.li);null===t&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)&&this.enableGroupCheckBox&&(t=P.closest(e.target,"."+y.group)),this.addListHover(t)},k.prototype.onMouseLeave=function(){this.removeHover()},k.prototype.onListMouseDown=function(e){e.preventDefault(),this.scrollFocusStatus=!0},k.prototype.onDocumentClick=function(e){var t;"CheckBox"!==this.mode&&(t=e.target,!P.isNullOrUndefined(this.popupObj)&&P.closest(t,'[id="'+this.popupObj.element.id+'"]')||this.overAllWrapper.contains(e.target)?this.scrollFocusStatus=(P.Browser.isIE||"edge"===P.Browser.info.name)&&document.activeElement===this.inputElement:this.scrollFocusStatus=!1)},k.prototype.wireListEvents=function(){P.isNullOrUndefined(this.list)||(P.EventHandler.add(document,"mousedown",this.onDocumentClick,this),P.EventHandler.add(this.list,"mousedown",this.onListMouseDown,this),P.EventHandler.add(this.list,"mouseup",this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this))},k.prototype.unwireListEvents=function(){P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.list&&(P.EventHandler.remove(this.list,"mousedown",this.onListMouseDown),P.EventHandler.remove(this.list,"mouseup",this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave))},k.prototype.hideOverAllClear=function(){this.value&&this.value.length&&""!==this.inputElement.value||(this.overAllClear.style.display="none")},k.prototype.showOverAllClear=function(){(this.value&&this.value.length||""!==this.inputElement.value)&&this.showClearButton&&!0!==this.readonly?this.overAllClear.style.display="":this.overAllClear.style.display="none"},k.prototype.focusIn=function(){document.activeElement!==this.inputElement&&this.enabled&&this.inputElement.focus()},k.prototype.focusOut=function(){document.activeElement===this.inputElement&&this.enabled&&this.inputElement.blur()},k.prototype.showSpinner=function(){var e;P.isNullOrUndefined(this.spinnerElement)&&(e=this.filterParent&&this.filterParent.querySelector(".e-clear-icon.e-icons"),"none"!==this.overAllClear.style.display||e?this.spinnerElement=e||this.overAllClear:(this.spinnerElement=this.createElement("span",{className:dt+" "+vt}),this.componentWrapper.appendChild(this.spinnerElement)),o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),P.addClass([this.spinnerElement],ft),o.showSpinner(this.spinnerElement))},k.prototype.hideSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||(o.hideSpinner(this.spinnerElement),P.removeClass([this.spinnerElement],ft),this.spinnerElement.classList.contains(vt)?P.detach(this.spinnerElement):this.spinnerElement.innerHTML="",this.spinnerElement=null)},k.prototype.updateWrapperText=function(e,t){this.valueTemplate||!this.enableHtmlSanitizer?e.innerHTML=this.encodeHtmlEntities(t):e.innerText=t},k.prototype.updateDelimView=function(){if(this.delimiterWrapper&&this.hideDelimWrapper(),this.chipCollectionWrapper&&(this.chipCollectionWrapper.style.display="none"),P.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.style.display="",this.viewWrapper.style.width="",this.viewWrapper.classList.remove(Ct)),this.value&&this.value.length){var e="",t=void 0,i=void 0,s=1,l=void 0,n=void 0,a=0,o=void 0,r=(this.enableVirtualization||this.updateWrapperText(this.viewWrapper,e),{noRecordsTemplate:"No records found",actionFailureTemplate:"Request failed",overflowCountTemplate:"+${count} more..",totalCountTemplate:"${count} selected"}),h=new P.L10n(this.getLocaleName(),r,this.locale),r=(h=""===(h=""===h.getConstant("actionFailureTemplate")?new P.L10n("dropdowns",r,this.locale):h).getConstant("noRecordsTemplate")?new P.L10n("dropdowns",r,this.locale):h).getConstant("overflowCountTemplate"),h=h.getConstant("totalCountTemplate"),u=this.createElement("span",{className:"e-remain"}),p=r.replace("${count}",this.value.length.toString()),d=(u.innerText=p,this.viewWrapper.appendChild(u),this.renderReactTemplates(),u.offsetWidth);if(P.remove(u),this.showDropDownIcon&&(a=this.dropIcon.offsetWidth+parseInt(window.getComputedStyle(this.dropIcon).marginRight,10)),this.checkClearIconWidth(),!P.isNullOrUndefined(this.value)&&(this.allowCustomValue||this.listData&&0<this.listData.length))for(var c=0;!P.isNullOrUndefined(this.value[c]);c++){var m=this.text&&this.text.split(this.delimiterChar);if(this.enableVirtualization?m&&(e=(e+=0===c?"":this.delimiterChar+" ")+(t=m[c]),t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)):(e=(e+=0===c?"":this.delimiterChar+" ")+(t=this.getOverflowVal(c)),t=this.viewWrapper.innerHTML,this.updateWrapperText(this.viewWrapper,e)),l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10),o=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),l+a+this.clearIconWidth>o){for(void 0!==i&&""!==i&&(t=i,c=s+1),this.updateWrapperText(this.viewWrapper,t),n=this.value.length-c,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);l+d+a+this.clearIconWidth>o&&0!==l&&""!==this.viewWrapper.innerHTML;)this.viewWrapper.innerHTML=[].join(this.delimiterChar),n=this.value.length,l=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);break}l+d+a+this.clearIconWidth<=o?(i=e,s=c):0===c&&(i="",s=-1)}0<n&&(p=o-a-this.clearIconWidth,this.viewWrapper.appendChild(this.updateRemainTemplate(u,this.viewWrapper,n,r,h,p)),this.updateRemainWidth(this.viewWrapper,p),this.updateRemainingText(u,a,n,r,h))}else P.isNullOrUndefined(this.viewWrapper)||(this.viewWrapper.innerHTML="",this.viewWrapper.style.display="none")},k.prototype.checkClearIconWidth=function(){this.showClearButton&&(this.clearIconWidth=this.overAllClear.offsetWidth)},k.prototype.updateRemainWidth=function(e,t){e.classList.contains(Ct)&&t<e.offsetWidth+parseInt(window.getComputedStyle(e).paddingLeft,10)+parseInt(window.getComputedStyle(e).paddingLeft,10)&&(e.style.width=t+"px")},k.prototype.updateRemainTemplate=function(e,t,i,s,l,n){t.firstChild&&3===t.firstChild.nodeType&&""===t.firstChild.nodeValue&&t.removeChild(t.firstChild),e.innerHTML="";s=s.replace("${count}",i.toString()),l=l.replace("${count}",i.toString());return e.innerText=t.firstChild&&3===t.firstChild.nodeType?s:l,t.firstChild&&3===t.firstChild.nodeType?t.classList.remove(Ct):(t.classList.add(Ct),this.updateRemainWidth(t,n)),e},k.prototype.updateRemainingText=function(e,t,i,s,l){var n=this.componentWrapper.offsetWidth-parseInt(window.getComputedStyle(this.componentWrapper).paddingLeft,10)-parseInt(window.getComputedStyle(this.componentWrapper).paddingRight,10),a=this.viewWrapper.offsetWidth+parseInt(window.getComputedStyle(this.viewWrapper).paddingRight,10);if(n<=a+t&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType){for(;n<a+t&&0!==a&&this.viewWrapper.firstChild&&3===this.viewWrapper.firstChild.nodeType;){var o=this.viewWrapper.firstChild.nodeValue.split(this.delimiterChar);o.pop(),this.viewWrapper.firstChild.nodeValue=o.join(this.delimiterChar),""===this.viewWrapper.firstChild.nodeValue&&this.viewWrapper.removeChild(this.viewWrapper.firstChild),i++,a=this.viewWrapper.offsetWidth}this.updateRemainTemplate(e,this.viewWrapper,i,s,l,n-t)}},k.prototype.getOverflowVal=function(e){var t,i,s;return this.mainData&&this.mainData.length?(i=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[e]):this.value[e],"CheckBox"===this.mode?(s=this.listData,this.listData=this.mainData,t=this.getTextByValue(i),this.listData=s):t=this.getTextByValue(i)):t=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[e]):this.value[e],t},k.prototype.unWireEvent=function(){var e;P.isNullOrUndefined(this.componentWrapper)||P.EventHandler.remove(this.componentWrapper,"mousedown",this.wrapperClick),P.EventHandler.remove(window,"resize",this.windowResize),P.isNullOrUndefined(this.inputElement)||(P.EventHandler.remove(this.inputElement,"focus",this.focusInHandler),P.EventHandler.remove(this.inputElement,"keydown",this.onKeyDown),"CheckBox"!==this.mode&&P.EventHandler.remove(this.inputElement,"input",this.onInput),P.EventHandler.remove(this.inputElement,"keyup",this.keyUp),(e=P.closest(this.inputElement,"form"))&&P.EventHandler.remove(e,"reset",this.resetValueHandler),P.EventHandler.remove(this.inputElement,"blur",this.onBlurHandler)),P.isNullOrUndefined(this.componentWrapper)||(P.EventHandler.remove(this.componentWrapper,"mouseover",this.mouseIn),P.EventHandler.remove(this.componentWrapper,"mouseout",this.mouseOut)),P.isNullOrUndefined(this.overAllClear)||P.EventHandler.remove(this.overAllClear,"mousedown",this.clearAll),P.isNullOrUndefined(this.inputElement)||P.EventHandler.remove(this.inputElement,"paste",this.pasteHandler)},k.prototype.resizingWireEvent=function(){P.EventHandler.add(document,"mousemove",this.resizePopup,this),P.EventHandler.add(document,"mouseup",this.stopResizing,this),P.EventHandler.add(document,"touchmove",this.resizePopup,this),P.EventHandler.add(document,"touchend",this.stopResizing,this)},k.prototype.resizingUnWireEvent=function(){P.EventHandler.remove(document,"mousemove",this.resizePopup),P.EventHandler.remove(document,"mouseup",this.stopResizing),P.EventHandler.remove(document,"touchmove",this.resizePopup),P.EventHandler.remove(document,"touchend",this.stopResizing)},k.prototype.selectAllItem=function(e,t,i){var s;if(P.isNullOrUndefined(this.list)||(s=this.list.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.value&&this.value.length&&t&&t.target&&P.closest(t.target,".e-close-hooker")&&this.allowFiltering&&(s=this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide):not(.e-disabled):not(.e-virtual-list)')),this.enableGroupCheckBox&&"CheckBox"===this.mode&&!P.isNullOrUndefined(this.fields.groupBy)){var l=t?this.groupTemplate?P.closest(t.target,".e-list-group-item"):t.target:null;if((l=(l=t&&32===t.keyCode?i:l)&&l.classList.contains("e-frame")?l.parentElement.parentElement:l)&&l.classList.contains("e-list-group-item")){var n,a=l.nextElementSibling;if(P.isNullOrUndefined(a))return;for(;a.classList.contains("e-list-item");)if(this.fields.disabled&&this.isDisabledElement(a)||(e?a.firstElementChild.lastElementChild.classList.contains("e-check")||(n=this.value&&this.value.length?this.value.length:0,a.classList.contains("e-active")&&--n,n<this.maximumSelectionLength&&this.updateListSelection(a,t)):a.firstElementChild.lastElementChild.classList.contains("e-check")&&this.updateListSelection(a,t)),null==(a=a.nextElementSibling))break;l.classList.contains("e-list-group-item")&&((i=this.list.getElementsByClassName("e-item-focus")[0])&&i.classList.remove("e-item-focus"),e?l.classList.add("e-active"):l.classList.remove("e-active"),l.classList.add("e-item-focus"),this.updateAriaActiveDescendant()),this.textboxValueUpdate(),this.checkPlaceholderSize(),!this.changeOnBlur&&t&&this.updateValueState(t,this.value,this.tempValues)}else this.updateValue(t,s,e)}else this.updateValue(t,s,e);this.addValidInputClass()},k.prototype.virtualSelectionAll=function(e,t,s){var l=this,i=0,n=t.length,a=this.maximumSelectionLength;if(e){this.virtualSelectAll=!0,n=this.virtualSelectAllData&&0!==this.virtualSelectAllData.length?this.virtualSelectAllData.length:n,this.listData=this.virtualSelectAllData;var e=this.createListItems(this.virtualSelectAllData.slice(0,30),this.fields).querySelectorAll("li"),o=document.createDocumentFragment(),r=(e.forEach(function(e){o.appendChild(e.cloneNode(!0))}),t.forEach(function(e){o.appendChild(e.cloneNode(!0))}),o.childNodes);if(this.virtualSelectAllData instanceof Array){for(;i<n&&i<=50&&i<a;){if(this.isSelectAllTarget=n===i+1,r[i]){var h=this.allowObjectBinding?this.getDataByValue(r[i].getAttribute("data-value")):this.getFormattedValue(r[i].getAttribute("data-value"));if(!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.updateListSelection(r[i],s,n-i)}else{h=P.getValue(this.fields.value||"",this.virtualSelectAllData[i]);if(h=this.allowObjectBinding?this.getDataByValue(h):h,!this.allowObjectBinding&&this.value&&0<=this.value.indexOf(h)||this.allowObjectBinding&&0<=this.indexOfObjectInArray(h,this.value)){i++;continue}this.value&&null!=h&&Array.isArray(this.value)&&(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.dispatchSelect(h,s,null,!1,n)}i++}50<n&&setTimeout(function(){var e;l.virtualSelectAllData&&0<l.virtualSelectAllData.length&&l.virtualSelectAllData.map(function(e){var t,i;l.value&&null!=e[l.fields.value]&&Array.isArray(l.value)&&(!l.allowObjectBinding&&l.value.indexOf(e[l.fields.value])<0||l.allowObjectBinding&&!l.isObjectInArray(e[l.fields.value],l.value))&&(t=e[l.fields.value],i=e[l.fields.text].toString(),l.dispatchSelect(t,s,null,!1,n,e,i))}),l.updatedataValueItems(s),l.isSelectAllLoop=!1,l.changeOnBlur||(l.updateValueState(s,l.value,l.tempValues),l.isSelectAll=l.isSelectAll&&!l.isSelectAll),l.updateHiddenElement(!0),l.popupWrapper&&t[i-1]&&t[i-1].classList.contains("e-item-focus")&&(e=document.getElementsByClassName("e-selectall-parent")[0])&&e.classList.contains("e-item-focus")&&t[i-1].classList.remove("e-item-focus")},0)}}else this.virtualSelectAllData&&0<this.virtualSelectAllData.length&&this.virtualSelectAllData.map(function(e){l.virtualSelectAll=!0,l.removeValue(l.value[i],s,l.value.length-i)}),this.updatedataValueItems(s),this.changeOnBlur||(this.updateValueState(s,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.updateHiddenElement(),this.setProperties({value:[]},!0),this.virtualSelectAll=!1,P.isNullOrUndefined(this.viewPortInfo.startIndex)||P.isNullOrUndefined(this.viewPortInfo.endIndex)||this.notify("setCurrentViewDataAsync",{component:this.getModuleName(),module:"VirtualScroll"});e=this.list.getElementsByClassName("e-virtual-ddl")[0],e&&(e.style=this.GetVirtualTrackHeight()),this.UpdateSkeleton(),e=this.list.getElementsByClassName("e-virtual-ddl-content")[0];e&&(e.style=this.getTransformValues())},k.prototype.updateValue=function(t,i,e){var s=this,l=i.length,n={event:t,items:e?i:[],itemData:e?this.listData:[],isInteracted:!!t,isChecked:e,preventSelectEvent:!1};if(this.trigger("beforeSelectAll",n),i&&i.length||this.enableVirtualization&&!e){var a=0,o=0,o=this.enableGroupCheckBox?e?this.maximumSelectionLength-(this.value?this.value.length:0):i.length:e?this.maximumSelectionLength-(this.value?this.value.length:0):this.maximumSelectionLength;if(n.preventSelectEvent){for(var r=0;r<i.length&&r<o;r++){this.removeHover();var h=i[r].getAttribute("data-value"),h=this.getFormattedValue(h),h=this.allowObjectBinding?this.getDataByValue(h):h,u=this.mainList?this.mainList.querySelectorAll(e?'li.e-list-item:not([aria-selected="true"]):not(.e-reorder-hide)':'li.e-list-item[aria-selected="true"]:not(.e-reorder-hide)')[r]:null;e?(this.value=this.value||[],(!this.allowObjectBinding&&this.value.indexOf(h)<0||this.allowObjectBinding&&!this.isObjectInArray(h,this.value))&&this.setProperties({value:[].concat([],this.value,[h])},!0),this.removeFocus(),this.addListSelection(i[r],u),this.updateChipStatus(),this.checkMaxSelection()):this.removeAllItems(h,t,!1,i[r],u),this.enableGroupCheckBox&&this.findGroupStart(i[r])}e||(this.value&&this.value.length?this.value.length:0)<this.maximumSelectionLength&&(p=this.list.querySelectorAll("li."+y.li+":not(.e-active)"),P.removeClass(p,"e-disable"));var p={event:t,items:e?i:[],itemData:e?this.listData:[],isInteracted:!!t,isChecked:e};this.trigger("selectedAll",p)}else if(this.enableVirtualization)this.virtualSelectAllState=e,this.virtualSelectAll=!0,this.CurrentEvent=t,this.virtualSelectAllData||this.resetList(this.dataSource,this.fields,new c.Query),this.virtualSelectAllData&&this.virtualSelectionAll(e,i,t);else{for(;a<l&&a<=50&&a<o;)this.isSelectAllTarget=l===a+1,this.updateListSelection(i[a],t,l-a),this.enableGroupCheckBox&&this.findGroupStart(i[a]),a++;50<l&&setTimeout(function(){for(;a<l&&a<o;)s.isSelectAllTarget=l===a+1,s.updateListSelection(i[a],t,l-a),s.enableGroupCheckBox&&s.findGroupStart(i[a]),a++;var e;s.updatedataValueItems(t),s.changeOnBlur||(s.updateValueState(t,s.value,s.tempValues),s.isSelectAll=s.isSelectAll&&!s.isSelectAll),s.updateHiddenElement(),s.popupWrapper&&i[a-1].classList.contains("e-item-focus")&&(e=document.getElementsByClassName("e-selectall-parent")[0])&&e.classList.contains("e-item-focus")&&i[a-1].classList.remove("e-item-focus")},0)}}this.updatedataValueItems(t),this.checkPlaceholderSize(),l<=50&&!n.preventSelectEvent&&(this.changeOnBlur||(this.updateValueState(t,this.value,this.tempValues),this.isSelectAll=this.isSelectAll&&!this.isSelectAll),this.enableVirtualization&&this.value&&0<this.value.length||!this.enableVirtualization)&&this.updateHiddenElement()},k.prototype.updateHiddenElement=function(i){var s=this,l="",n="",a="",o=[];"CheckBox"===this.mode&&(this.value.map(function(e,t){l+='<option selected value ="'+e+'">'+t+"</option>",i||(a=s.listData?s.getTextByValue(e):e,n+=a+s.delimiterChar+" ",o.push(a))}),this.hiddenElement.innerHTML=l,i||(this.updateWrapperText(this.delimiterWrapper,n),this.setProperties({text:o.toString()},!0)),this.delimiterWrapper.setAttribute("id",P.getUniqueID("delim_val")),this.inputElement.setAttribute("aria-describedby",this.delimiterWrapper.id),this.refreshInputHight(),this.refreshPlaceHolder())},k.prototype.updatedataValueItems=function(e){this.deselectHeader(),this.textboxValueUpdate(e)},k.prototype.textboxValueUpdate=function(e){var t=e&&e.target&&(P.closest(e.target,".e-selectall-parent")||P.closest(e.target,".e-close-hooker"));"Box"===this.mode||this.isPopupOpen()||"CheckBox"===this.mode&&(this.isSelectAll||t)?this.searchWrapper.classList.remove(pt):this.updateDelimView(),"CheckBox"===this.mode?(this.updateDelimView(),(!t&&!this.isSelectAll&&this.isSelectAllTarget||this.isSelectAll&&this.isSelectAllTarget)&&this.updateDelimeter(this.delimiterChar,e),this.refreshInputHight()):this.updateDelimeter(this.delimiterChar,e),this.refreshPlaceHolder()},k.prototype.setZIndex=function(){this.popupObj&&this.popupObj.setProperties({zIndex:this.zIndex})},k.prototype.updateDataSource=function(e){P.isNullOrUndefined(this.list)?this.renderPopup():this.resetList(this.dataSource),this.value&&this.value.length&&(this.setProperties({value:this.value}),this.refreshSelection())},k.prototype.onLoadSelect=function(){this.setDynValue=!0,this.renderPopup()},k.prototype.selectAllItems=function(t,i){var e,s=this;P.isNullOrUndefined(this.list)?(this.selectAllAction=function(){var e;"CheckBox"===s.mode&&s.showSelectAll&&(e={module:"CheckBoxSelection",enable:"CheckBox"===s.mode,value:t?"check":"uncheck"},s.notify("checkSelectAll",e)),s.selectAllItem(t,i),s.selectAllAction=null},A.prototype.render.call(this)):(this.selectAllAction=null,"CheckBox"===this.mode&&this.showSelectAll&&(e={value:t?"check":"uncheck",enable:"CheckBox"===this.mode,module:"CheckBoxSelection"},this.notify("checkSelectAll",e)),this.selectAllItem(t,i)),this.dataSource instanceof c.DataManager&&!(this.dataSource instanceof c.DataManager&&this.virtualSelectAllData)||(this.virtualSelectAll=!1)},k.prototype.getPersistData=function(){return this.addOnPersist(["value"])},k.prototype.onPropertyChanged=function(e,t){(e.dataSource&&!P.isNullOrUndefined(Object.keys(e.dataSource))||e.query&&!P.isNullOrUndefined(Object.keys(e.query)))&&(this.mainList=null,this.mainData=null,this.isFirstClick=!1,this.isDynamicDataChange=!0),"multiselect"===this.getModuleName()&&(this.filterAction=!1,this.setUpdateInitial(["fields","query","dataSource"],e));for(var i=0,s=Object.keys(e);i<s.length;i++){var l,n=s[i];switch(n){case"query":case"dataSource":"CheckBox"===this.mode&&this.showSelectAll&&(P.isNullOrUndefined(this.popupObj)||(this.popupObj.destroy(),this.popupObj=null),this.renderPopup());break;case"htmlAttributes":this.updateHTMLAttribute();break;case"showClearButton":this.updateClearButton(e.showClearButton);break;case"text":this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),this.updateVal(this.value,this.value,"text");break;case"value":this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.updateVal(this.value,t.value,"value"),this.addValidInputClass(),!this.closePopupOnSelect&&this.isPopupOpen()&&this.refreshPopup(),this.isPopupOpen()&&"CheckBox"===this.mode&&this.list&&this.list.querySelector(".e-active.e-disable")&&(a=this.list.querySelectorAll("li."+y.li+".e-active.e-disable"),P.removeClass(a,"e-disable")),this.preventChange=this.isAngular&&this.preventChange?!this.preventChange:this.preventChange;break;case"width":this.setWidth(e.width),this.popupObj.setProperties({width:this.calcPopupWidth()});break;case"placeholder":this.refreshPlaceHolder();break;case"filterBarPlaceholder":this.allowFiltering&&this.notify("filterBarPlaceholder",{filterBarPlaceholder:e.filterBarPlaceholder});break;case"delimiterChar":"Box"!==this.mode&&this.updateDelimView(),this.updateData(e.delimiterChar);break;case"cssClass":this.updateOldPropCssClass(t.cssClass),this.updateCssClass(),this.calculateWidth();break;case"enableRtl":this.enableRTL(e.enableRtl),A.prototype.onPropertyChanged.call(this,e,t);break;case"allowResize":this.allowResize=e.allowResize,!this.allowResize&&this.popupObj&&(l=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(l),this.popupWrapper.style.height=P.formatUnit(this.popupHeight),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight));break;case"readonly":this.updateReadonly(e.readonly),this.hidePopup();break;case"enabled":this.hidePopup(),this.enable(e.enabled);break;case"showSelectAll":this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup();break;case"showDropDownIcon":this.dropDownIcon();break;case"floatLabelType":this.setFloatLabelType(),this.addValidInputClass(),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon");break;case"enableSelectionOrder":break;case"selectAllText":this.notify("selectAllText",!1);break;case"popupHeight":this.popupObj&&(l=parseInt(this.popupHeight,10),"auto"!==this.popupHeight?(this.list.style.maxHeight=P.formatUnit(l),this.popupWrapper.style.maxHeight=P.formatUnit(this.popupHeight)):this.list.style.maxHeight=P.formatUnit(this.popupHeight));break;case"headerTemplate":case"footerTemplate":this.reInitializePoup();break;case"allowFiltering":"CheckBox"===this.mode&&this.popupObj&&this.reInitializePoup(),this.updateSelectElementData(this.allowFiltering);break;case"fields":P.isNullOrUndefined(this.fields.groupBy)&&this.removeScrollEvent();break;default:var a=this.getPropObject(n,e,t);A.prototype.onPropertyChanged.call(this,a.newProperty,a.oldProperty)}}},k.prototype.reInitializePoup=function(){this.popupObj&&(this.popupObj.destroy(),this.popupObj=null),this.renderPopup()},k.prototype.totalItemsCount=function(){var e;if(this.dataSource instanceof c.DataManager?0<=this.remoteDataCount?e=this.totalItemCount=this.dataCount=this.remoteDataCount:this.resetList(this.dataSource):e=this.dataSource&&this.dataSource.length?this.dataSource.length:0,"CheckBox"===this.mode)this.totalItemCount=0!==e?e:this.totalItemCount;else if(this.hideSelectedItem){if(this.totalItemCount=0!==e&&this.value?e-this.value.length:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length)for(var t=0;t<this.virtualCustomSelectData.length;t++)for(var i=0;i<this.value.length;i++)(this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[i]):this.value[i])===P.getValue(this.fields.value||"",this.virtualCustomSelectData[t])&&(this.totalItemCount+=1)}else this.totalItemCount=0!==e?e:this.totalItemCount,this.allowCustomValue&&this.virtualCustomSelectData&&0<this.virtualCustomSelectData.length&&(this.totalItemCount+=this.virtualCustomSelectData.length)},k.prototype.presentItemValue=function(e){for(var t=[],i=0;i<this.value.length;i++){var s=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[i]):this.value[i];this.findListElement(this.allowFiltering&&!P.isNullOrUndefined(this.mainList)?this.mainList:e,"li","data-value",s)||(s=this.allowObjectBinding?this.getDataByValue(this.value[i]):this.value[i],t.push(s))}return t},k.prototype.addNonPresentItems=function(e,t,i,s){var l=this;this.dataSource.executeQuery(this.getForQuery(e)).then(function(e){0<e.result.length&&l.addItem(e.result,i.length),l.updateActionList(t,i,s)})},k.prototype.updateVal=function(e,t,i){var s;this.list&&(!(this.dataSource instanceof c.DataManager)||this.listData&&this.mainList&&this.mainData)?(s=[],P.isNullOrUndefined(this.value)||this.allowCustomValue||(s=this.presentItemValue(this.ulElement)),"value"===i&&0<s.length&&this.dataSource instanceof c.DataManager&&!P.isNullOrUndefined(this.value)&&null!=this.listData?(this.mainData=null,this.setDynValue=!0,this.isaddNonPresentItems=!0,this.addNonPresentItems(s,this.ulElement,this.listData),this.isaddNonPresentItems=!1):("text"===i&&(this.initialTextUpdate(),e=this.value),!P.isNullOrUndefined(this.value)&&0!==this.value.length||(this.tempValues=t),this.allowCustomValue&&("Default"===this.mode||"Box"===this.mode)&&this.isReact&&this.inputFocus&&this.isPopupOpen()&&this.mainData!==this.listData&&(s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.onActionComplete(s,this.mainData)),this.enableVirtualization?!this.enableVirtualization||this.dataSource instanceof c.DataManager?this.isInitRemoteVirtualData||(this.isDynamicRemoteVirtualData=!0,this.initialValueUpdate(this.listData,!0),this.isDynamicRemoteVirtualData=!1,this.initialUpdate()):this.initialValueUpdate(this.dataSource,!0):this.initialValueUpdate(),"Box"===this.mode||this.inputFocus||this.updateDelimView(),this.inputFocus||this.refreshInputHight(),this.refreshPlaceHolder(),"CheckBox"!==this.mode&&this.changeOnBlur&&this.updateValueState(null,e,t),this.checkPlaceholderSize())):this.onLoadSelect(),this.changeOnBlur||this.updateValueState(null,e,t)},k.prototype.addItem=function(e,t){A.prototype.addItem.call(this,e,t)},k.prototype.hidePopup=function(e){var t,i=this;this.isPopupOpen()&&(t={name:"FadeOut",duration:100,delay:100},this.customFilterQuery=null,t={popup:this.popupObj,cancel:!1,animation:t,event:e||null},this.trigger("close",t,function(e){var t;e.cancel||(i.fields.groupBy&&"CheckBox"!==i.mode&&i.fixedHeaderElement&&(P.remove(i.fixedHeaderElement),i.fixedHeaderElement=null),i.beforePopupOpen=!1,i.overAllWrapper.classList.remove(yt),t="CheckBox"===i.mode?i.targetElement():null,i.popupObj.hide(new P.Animation(e.animation)),P.attributes(i.inputElement,{"aria-expanded":"false"}),i.inputElement.removeAttribute("aria-owns"),i.inputElement.removeAttribute("aria-activedescendant"),i.allowFiltering&&i.notify("inputFocus",{module:"CheckBoxSelection",enable:"CheckBox"===i.mode,value:"clear"}),i.popupObj.hide(),P.removeClass([document.body,i.popupObj.element],"e-popup-full-page"),P.EventHandler.remove(i.list,"keydown",i.onKeyDown),"CheckBox"===i.mode&&i.showSelectAll&&P.EventHandler.remove(i.popupObj.element,"click",i.clickHandler),i.list&&i.list.parentElement&&i.allowResize&&(i.resizer&&i.list.parentElement.contains(i.resizer)&&i.list.parentElement.removeChild(i.resizer),i.list.parentElement.classList.contains("e-resize")&&i.list.parentElement.classList.remove("e-resize"),i.list.parentElement.style.boxSizing="",i.list.parentElement.style.paddingBottom="",e=parseInt(i.popupHeight,10),i.list.style.maxHeight=P.formatUnit(e),i.list.parentElement.style.height=P.formatUnit(i.popupHeight),i.list.parentElement.style.maxHeight=P.formatUnit(i.popupHeight)),i.resizer&&(P.EventHandler.remove(i.resizer,"mousedown",i.startResizing),i.resizer.remove()),e=void(i.enableVirtualization&&"CheckBox"===i.mode&&i.value&&0<i.value.length&&i.enableSelectionOrder&&(i.viewPortInfo.startIndex=i.virtualItemStartIndex=0,i.viewPortInfo.endIndex=i.virtualItemEndIndex=0<i.viewPortInfo.startIndex?i.viewPortInfo.endIndex:i.itemCount,i.virtualListInfo=i.viewPortInfo,i.previousStartIndex=0,i.previousEndIndex=i.itemCount)),i.dataSource instanceof c.DataManager?0<=i.remoteDataCount?i.totalItemCount=i.dataCount=i.remoteDataCount:i.resetList(i.dataSource):e=i.dataSource&&i.dataSource.length?i.dataSource.length:0,i.enableVirtualization&&(i.allowFiltering||i.allowCustomValue)&&(i.targetElement()||t)&&i.totalItemCount!==e&&(i.checkAndResetCache(),i.updateInitialData()),i.virtualCustomData&&i.viewPortInfo&&0===i.viewPortInfo.startIndex&&i.viewPortInfo.endIndex===i.itemCount&&i.renderItems(i.mainData,i.fields),i.virtualCustomData=null,i.isVirtualTrackHeight=!1)}))},k.prototype.showPopup=function(n){var a=this;this.enabled&&(this.firstItem=this.dataSource&&0<this.dataSource.length?this.dataSource[0]:null,this.trigger("beforeOpen",{cancel:!1},function(e){if(!e.cancel)if(a.ulElement){"CheckBox"===a.mode&&P.Browser.isDevice&&a.allowFiltering&&a.isDeviceFullScreen&&a.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode});var e=a.ulElement.querySelectorAll("li.e-list-item").length,t=a.ulElement.querySelectorAll("li."+y.li+"."+D).length;if(0<e&&e===t&&t===a.mainData.length&&(""===a.targetElement()||!a.allowCustomValue))a.beforePopupOpen=!1;else{if(a.onPopupShown(n),a.enableVirtualization&&a.listData&&a.listData.length&&(P.isNullOrUndefined(a.value)||"dropdownlist"!==a.getModuleName()&&"combobox"!==a.getModuleName()||a.removeHover(),a.beforePopupOpen||(a.hideSelectedItem&&a.value&&Array.isArray(a.value)&&0<a.value.length&&a.totalItemsCount(),a.preventSetCurrentData)||P.isNullOrUndefined(a.viewPortInfo.startIndex)||P.isNullOrUndefined(a.viewPortInfo.endIndex)||a.notify("setCurrentViewDataAsync",{component:a.getModuleName(),module:"VirtualScroll"})),a.enableVirtualization&&!a.allowFiltering&&null!=a.selectedValueInfo&&0<a.selectedValueInfo.startIndex&&null!=a.value&&a.notify("dataProcessAsync",{module:"VirtualScroll",isOpen:!0}),a.enableVirtualization)a.updatevirtualizationList();else if(a.value&&a.value.length){a.getItems();for(var i=0,s=a.value;i<s.length;i++){var l=s[i],l=a.allowObjectBinding?P.getValue(a.fields.value||"",l):l;(l=a.getElementByValue(l))&&a.addListSelection(l)}}a.allowResize&&a.setResize(),a.preventSetCurrentData=!0}}else a.beforePopupOpen=!0,"CheckBox"===a.mode&&P.Browser.isDevice&&a.allowFiltering&&a.isDeviceFullScreen&&a.notify("popupFullScreen",{module:"CheckBoxSelection",enable:"CheckBox"===a.mode}),A.prototype.render.call(a,n)}))},k.prototype.selectAll=function(e){this.isSelectAll=!0,this.selectAllItems(e)},k.prototype.getModuleName=function(){return"multiselect"},k.prototype.clear=function(){var e=this;this.selectAll(!1),this.value&&this.value.length?setTimeout(function(){e.setProperties({value:null},!0)},0):this.setProperties({value:null},!0)},k.prototype.render=function(){!P.isNullOrUndefined(this.value)&&0<this.value.length&&(this.value=this.value.slice()),this.setDynValue=this.initStatus=!1,this.isSelectAll=!1,this.selectAllEventEle=[],this.searchWrapper=this.createElement("span",{className:"e-searcher "+("Box"===this.mode?"e-multiselect-box":"")}),this.viewWrapper=this.createElement("span",{className:"e-delim-view "+ct}),this.viewWrapper.style.display="none",this.overAllClear=this.createElement("span",{className:dt}),this.overAllClear.style.display="none",this.componentWrapper=this.createElement("div",{className:"e-multi-select-wrapper"}),this.overAllWrapper=this.createElement("div",{className:"e-multiselect e-input-group e-control-wrapper"}),"CheckBox"===this.mode&&P.addClass([this.overAllWrapper],"e-checkbox"),P.Browser.isDevice&&this.componentWrapper.classList.add("e-mob-wrapper"),this.setWidth(this.width),this.overAllWrapper.appendChild(this.componentWrapper),this.popupWrapper=this.createElement("div",{id:this.element.id+"_popup",className:"e-ddl e-popup e-multi-select-list-wrapper"}),this.popupWrapper.setAttribute("aria-label",this.element.id),this.popupWrapper.setAttribute("role","dialog"),"Delimiter"===this.mode||"CheckBox"===this.mode?(this.delimiterWrapper=this.createElement("span",{className:ct}),this.delimiterWrapper.style.display="none",this.componentWrapper.appendChild(this.delimiterWrapper)):(this.chipCollectionWrapper=this.createElement("span",{className:"e-chips-collection"}),this.chipCollectionWrapper.style.display="none","Default"===this.mode?this.chipCollectionWrapper.setAttribute("id",P.getUniqueID("chip_default")):"Box"===this.mode&&this.chipCollectionWrapper.setAttribute("id",P.getUniqueID("chip_box")),this.componentWrapper.appendChild(this.chipCollectionWrapper)),"Box"!==this.mode&&this.componentWrapper.appendChild(this.viewWrapper),this.componentWrapper.appendChild(this.searchWrapper),this.showClearButton&&!P.Browser.isDevice?this.componentWrapper.appendChild(this.overAllClear):this.componentWrapper.classList.add(mt),this.dropDownIcon(),this.inputElement=this.createElement("input",{className:"e-dropdownbase",attrs:{spellcheck:"false",type:"text",autocomplete:"off",tabindex:"0",role:"combobox"}}),"Default"!==this.mode&&"Box"!==this.mode||this.inputElement.setAttribute("aria-describedby",this.chipCollectionWrapper.id),P.isNullOrUndefined(this.inputElement)||(P.attributes(this.inputElement,{"aria-expanded":"false"}),this.inputElement.hasAttribute("aria-label"))||this.inputElement.setAttribute("aria-label",this.getModuleName()),this.element.tagName!==this.getNgDirective()&&(this.element.style.display="none"),this.element.tagName===this.getNgDirective()?(this.element.appendChild(this.overAllWrapper),this.searchWrapper.appendChild(this.inputElement)):(this.element.parentElement.insertBefore(this.overAllWrapper,this.element),this.searchWrapper.appendChild(this.inputElement),this.searchWrapper.appendChild(this.element),this.element.removeAttribute("tabindex")),"Never"!==this.floatLabelType?Ye(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder):"Never"===this.floatLabelType&&this.refreshPlaceHolder(),this.addValidInputClass(),this.element.style.opacity="";var e=this.element.getAttribute("id")?this.element.getAttribute("id"):P.getUniqueID("ej2_dropdownlist");this.element.id=e,this.hiddenElement=this.createElement("select",{attrs:{"aria-hidden":"true",class:"e-multi-hidden",tabindex:"-1",multiple:""}}),this.componentWrapper.appendChild(this.hiddenElement),this.validationAttribute(this.element,this.hiddenElement),"CheckBox"!==this.mode&&this.hideOverAllClear(),!P.isNullOrUndefined(P.closest(this.element,"fieldset"))&&P.closest(this.element,"fieldset").disabled&&(this.enabled=!1),this.wireEvent(),this.enable(this.enabled),this.enableRTL(this.enableRtl),this.enableVirtualization&&this.updateVirtualizationProperties(this.itemCount,this.allowFiltering,"CheckBox"===this.mode),this.listItemHeight=this.getListHeight(),this.getSkeletonCount(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=0<this.viewPortInfo.startIndex?this.viewPortInfo.endIndex:this.itemCount,this.checkInitialValue(),this.element.hasAttribute("data-val")&&this.element.setAttribute("data-val","false"),h.Input.createSpanElement(this.overAllWrapper,this.createElement),this.calculateWidth(),P.isNullOrUndefined(this.overAllWrapper)||P.isNullOrUndefined(this.overAllWrapper.getElementsByClassName("e-ddl-icon")[0]&&this.overAllWrapper.getElementsByClassName("e-float-text-content")[0]&&"Never"!==this.floatLabelType)||this.overAllWrapper.getElementsByClassName("e-float-text-content")[0].classList.add("e-icon"),this.renderComplete()},k.prototype.setResize=function(){var e;this.list&&this.list.parentElement&&P.isNullOrUndefined(this.list.parentElement.querySelector(".e-resizer-right.e-icons"))&&(this.resizer=this.createElement("div",{id:this.element.id+"_resize-popup",className:"e-resizer-right e-icons"})),"CheckBox"===this.mode&&this.showSelectAll&&this.selectAllHeight&&0!==this.selectAllHeight&&(this.storedSelectAllHeight=this.selectAllHeight),this.list&&this.list.parentElement&&(this.list.parentElement.classList.add("e-resize"),"auto"!==this.popupHeight.toString().toLowerCase()&&(this.list.parentElement.style.height="100%"),this.list.parentElement.style.boxSizing="border-box",e="CheckBox"===this.mode&&this.searchBoxHeight?this.searchBoxHeight+16+(this.showSelectAll?this.storedSelectAllHeight:0):16,this.list.parentElement.style.paddingBottom=e+"px",this.list.parentElement.appendChild(this.resizer),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px"),this.resizer&&(P.EventHandler.add(this.resizer,"mousedown",this.startResizing,this),P.EventHandler.add(this.resizer,"touchstart",this.startResizing,this))},k.prototype.startResizing=function(e){this.isResizing=!0,this.trigger("resizeStart",e);var t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY;this.list&&this.list.parentElement&&(this.originalWidth=this.list.parentElement.offsetWidth,this.originalHeight=this.list.parentElement.offsetHeight,this.originalMouseX=t,this.originalMouseY=i),this.resizingWireEvent(),e&&e.preventDefault()},k.prototype.resizePopup=function(e){var t,i,s,l;this.isResizing&&(this.trigger("resizing",e),t=(e instanceof MouseEvent?e:e.touches[0]).clientX,i=(e instanceof MouseEvent?e:e.touches[0]).clientY,t=t-this.originalMouseX,i=i-this.originalMouseY,this.resizeWidth=Math.max(this.originalWidth+t,100),this.resizeHeight=Math.max(this.originalHeight+i,130),this.list&&this.list.parentElement&&(s=(s=parseInt(window.getComputedStyle(this.list.parentElement).minWidth,10))||100,l=(l=parseInt(window.getComputedStyle(this.list.parentElement).minHeight,10))||120,this.resizeWidth=Math.max(this.originalWidth+t,s),this.resizeHeight=Math.max(this.originalHeight+i,l),this.list.parentElement.style.width=this.resizeWidth+"px",this.list.parentElement.style.height=this.resizeHeight+"px",this.list.parentElement.style.maxHeight=this.resizeHeight+"px",this.list.style.maxHeight=this.resizeHeight+"px",this.fixedHeaderElement)&&this.ulElement&&(this.fixedHeaderElement.style.width=this.ulElement.offsetWidth+"px"),e)&&e.preventDefault()},k.prototype.stopResizing=function(e){this.isResizing&&(this.isResizing=!1,this.trigger("resizeStop",e),this.resizingUnWireEvent()),e&&e.preventDefault()},k.prototype.getListHeight=function(){var e=this.createElement("div",{className:"e-dropdownbase"}),t=this.createElement("li",{className:"e-list-item"}),i=P.formatUnit(this.popupHeight),i=(e.style.height=parseInt(i,10).toString()+"px",e.appendChild(t),document.body.appendChild(e),this.virtualListHeight=e.getBoundingClientRect().height,Math.ceil(t.getBoundingClientRect().height)+parseInt(window.getComputedStyle(t).marginBottom,10));return e.remove(),i},k.prototype.removeDisabledItemsValue=function(e){if(e){for(var t=[],i=0,s=0;s<e.length;s++){var l=e[s];null==(l="object"==typeof l?JSON.parse(JSON.stringify(l))[this.fields.value]:l)||this.isDisabledItemByIndex(this.getIndexByValue(l))||(t[i++]=e[s])}this.value=0<t.length?t:null}},k.prototype.checkInitialValue=function(){var t,i=this,e=(this.fields.disabled&&this.removeDisabledItemsValue(this.value),this.dataSource instanceof Array?0<this.dataSource.length:!P.isNullOrUndefined(this.dataSource));if((!this.value||!this.value.length)&&P.isNullOrUndefined(this.text)&&!e&&"SELECT"===this.element.tagName&&0<this.element.options.length){for(var s=this.element.options,l=[],n="",a=0,o=s.length;a<o;a++){var r=s[a];P.isNullOrUndefined(r.getAttribute("selected"))||(r.getAttribute("value")?(d=this.allowObjectBinding?this.getDataByValue(r.getAttribute("value")):r.getAttribute("value"),l.push(d)):n+=r.text+this.delimiterChar)}0<l.length?this.setProperties({value:l},!0):""!==n&&this.setProperties({text:n},!0),(0<l.length||""!==n)&&(this.refreshInputHight(),this.refreshPlaceHolder())}if(!(this.value&&this.value.length||!P.isNullOrUndefined(this.text))||this.list||A.prototype.render.call(this),this.fields.disabled&&(this.text=this.text&&!this.isDisabledItemByIndex(this.getIndexByValue(this.getValueByText(this.text)))?this.text:null),P.isNullOrUndefined(this.text)||!P.isNullOrUndefined(this.value)&&0!==this.value.length||this.initialTextUpdate(),this.value&&this.value.length){if(this.enableVirtualization){for(var h=this.isPrimitiveData?"":this.fields.value,u=void 0,p=0;p<this.value.length;p++)var d=this.allowObjectBinding?P.getValue(this.fields.value||"",this.value[p]):this.value[p],u=0===p?new c.Predicate(h,"equal",d):u.or(h,"equal",d);this.dataSource instanceof c.DataManager?this.dataSource.executeQuery((new c.Query).where(u)).then(function(e){0<e.result.length&&(t=e.result,i.initStatus=!1,i.isInitRemoteVirtualData=!0,setTimeout(function(){i.initialValueUpdate(t,!0),i.initialUpdate(),i.isInitRemoteVirtualData=!1},100),i.initStatus=!0)}):t=new c.DataManager(this.dataSource).executeLocal((new c.Query).where(u))}this.dataSource instanceof c.DataManager?this.setInitialValue=function(){i.initStatus=!1,i.enableVirtualization&&(!i.enableVirtualization||i.dataSource instanceof c.DataManager)||i.initialValueUpdate(t),i.initialUpdate(),i.setInitialValue=null,i.initStatus=!0}:(this.initialValueUpdate(t,!0),this.initialUpdate()),this.updateTempValue()}else this.initialUpdate();this.initStatus=!0,this.checkAutoFocus(),P.isNullOrUndefined(this.text)||this.element.setAttribute("data-initial-value",this.text)},k.prototype.checkAutoFocus=function(){this.element.hasAttribute("autofocus")&&this.inputElement.focus()},k.prototype.updatevirtualizationList=function(){if(this.value&&this.value.length){for(var e,t,i=0,s=this.value;i<s.length;i++){var l=s[i],l=this.allowObjectBinding?P.getValue(this.fields.value||"",l):l;(l=this.getElementByValue(l))&&this.addListSelection(l)}this.enableVirtualization&&this.hideSelectedItem&&(t=this.list.querySelectorAll("li."+y.li+":not(."+D+"):not(.e-reorder-hide):not(.e-virtual-list)")).length&&(e=0<this.virtualListHeight?Math.floor(this.virtualListHeight/this.listItemHeight):0,t.length<e+2)&&(t=(t=this.getForQuery(this.value).clone()).skip(this.viewPortInfo.startIndex),this.resetList(this.dataSource,this.fields,t))}},k.prototype.setFloatLabelType=function(){Ze(this.overAllWrapper,this.componentWrapper,this.searchWrapper,this.inputElement,this.value,this.floatLabelType,this.placeholder),"Never"!==this.floatLabelType&&Ye(this.overAllWrapper,this.searchWrapper,this.element,this.inputElement,this.value,this.floatLabelType,this.placeholder)},k.prototype.addValidInputClass=function(){P.isNullOrUndefined(this.overAllWrapper)||(!P.isNullOrUndefined(this.value)&&this.value.length||"Always"===this.floatLabelType?P.addClass([this.overAllWrapper],"e-valid-input"):P.removeClass([this.overAllWrapper],"e-valid-input"))},k.prototype.dropDownIcon=function(){this.showDropDownIcon?(this.dropIcon=this.createElement("span",{className:gt}),this.componentWrapper.appendChild(this.dropIcon),P.addClass([this.componentWrapper],["e-down-icon"])):P.isNullOrUndefined(this.dropIcon)||(this.dropIcon.parentElement.removeChild(this.dropIcon),P.removeClass([this.componentWrapper],["e-down-icon"]))},k.prototype.initialUpdate=function(){"Box"===this.mode||this.setDynValue&&"Default"===this.mode&&this.inputFocus||this.updateDelimView(),this.viewPortInfo.startIndex=this.virtualItemStartIndex=0,this.viewPortInfo.endIndex=this.virtualItemEndIndex=this.itemCount,this.updateCssClass(),this.updateHTMLAttribute(),this.updateReadonly(this.readonly),this.refreshInputHight(),this.checkPlaceholderSize()},k.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i,s=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)s=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var l=0;l<this.liCollections.length;l++)if(this.liCollections[l]===e){s=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var n=JSON.parse(JSON.stringify(e))[this.fields.value],l=0;l<this.listData.length;l++)if(JSON.parse(JSON.stringify(this.listData[l]))[this.fields.value]===n){s=this.getIndexByValue(n);break}}else s=e;s<this.liCollections.length&&-1<s&&!JSON.parse(JSON.stringify(this.listData[s]))[this.fields.disabled]&&(t=this.liCollections[s])&&(this.disableListItem(t),(i=JSON.parse(JSON.stringify(this.listData[s])))[this.fields.disabled]=!0,this.listData[s]=i,t.classList.contains(y.focus)&&this.removeFocus(),(t.classList.contains(D)||t.classList.contains(y.selected))&&(i=this.value,this.removeDisabledItemsValue(this.value),this.updateVal(this.value,i,"value")),"CheckBox"===this.mode)&&this.enableGroupCheckBox&&!P.isNullOrUndefined(this.fields.groupBy)&&this.disableGroupHeader()}}},k.prototype.destroy=function(){this.isReact&&this.clearTemplate(),P.isNullOrUndefined(this.popupObj)||(this.popupObj.hide(),this.popupObj.destroy()),this.notify("destroy",{}),this.unwireListEvents(),this.unWireEvent();var e=["readonly","aria-disabled","placeholder","aria-label","aria-expanded"],t=e.length;if(!P.isNullOrUndefined(this.inputElement))for(;0<t;)this.inputElement.removeAttribute(e[t-1]),t--;for(P.isNullOrUndefined(this.element)||(this.element.removeAttribute("data-initial-value"),this.element.style.display="block"),this.overAllWrapper&&this.overAllWrapper.parentElement&&(this.overAllWrapper.parentElement.tagName!==this.getNgDirective()&&this.overAllWrapper.parentElement.insertBefore(this.element,this.overAllWrapper),P.remove(this.overAllWrapper)),this.popupWrapper&&this.popupWrapper.parentElement&&this.popupWrapper.parentElement.remove();this.searchWrapper&&this.searchWrapper.firstChild;)this.searchWrapper.removeChild(this.searchWrapper.firstChild);this.searchWrapper&&this.searchWrapper.parentElement&&this.searchWrapper.parentElement.remove(),this.viewWrapper&&this.viewWrapper.parentElement&&this.viewWrapper.parentElement.remove(),this.overAllClear&&this.overAllClear.parentElement&&this.overAllClear.parentElement.remove(),this.delimiterWrapper&&this.delimiterWrapper.parentElement&&this.delimiterWrapper.parentElement.remove();var i=this.overAllWrapper.querySelector("select.e-multi-hidden");for(i&&i.parentElement&&i.parentElement.remove();this.componentWrapper&&this.componentWrapper.firstChild;)this.componentWrapper.removeChild(this.componentWrapper.firstChild);for(this.componentWrapper&&this.componentWrapper.parentElement&&(this.componentWrapper.removeAttribute("class"),this.componentWrapper.parentElement.remove());this.popupWrapper&&this.popupWrapper.firstChild;)this.popupWrapper.removeChild(this.popupWrapper.firstChild);if(this.inputElement)for(var s=["readonly","aria-disabled","placeholder","aria-labelledby","aria-expanded","autocomplete","aria-readonly","autocapitalize","spellcheck","aria-autocomplete","aria-live","aria-label","aria-hidden","tabindex","aria-controls","aria-describedby","size","role","type","class"],l=0;l<s.length;l++)this.inputElement.removeAttribute(s[l]);this.inputElement&&this.inputElement.remove(),this.list=null,this.popupObj=null,this.mainData=null,this.filterParent=null,this.ulElement=null,this.componentWrapper=null,this.overAllClear=null,this.overAllWrapper=null,this.hiddenElement=null,this.searchWrapper=null,this.viewWrapper=null,this.chipCollectionWrapper=null,this.targetInputElement=null,this.popupWrapper=null,this.inputElement=null,this.delimiterWrapper=null,this.liCollections=null,this.popupContentElement=null,this.header=null,this.mainList=null,this.mainListCollection=null,this.footer=null,this.selectAllEventEle=null,A.prototype.destroy.call(this)},w([P.Complex({text:null,value:null,iconCss:null,groupBy:null,disabled:null},ee)],k.prototype,"fields",void 0),w([P.Property(!1)],k.prototype,"enablePersistence",void 0),w([P.Property(null)],k.prototype,"groupTemplate",void 0),w([P.Property("No records found")],k.prototype,"noRecordsTemplate",void 0),w([P.Property("Request failed")],k.prototype,"actionFailureTemplate",void 0),w([P.Property("None")],k.prototype,"sortOrder",void 0),w([P.Property(!0)],k.prototype,"enabled",void 0),w([P.Property(!0)],k.prototype,"enableHtmlSanitizer",void 0),w([P.Property(!1)],k.prototype,"enableVirtualization",void 0),w([P.Property([])],k.prototype,"dataSource",void 0),w([P.Property(null)],k.prototype,"query",void 0),w([P.Property("StartsWith")],k.prototype,"filterType",void 0),w([P.Property(1e3)],k.prototype,"zIndex",void 0),w([P.Property(!1)],k.prototype,"ignoreAccent",void 0),w([P.Property()],k.prototype,"locale",void 0),w([P.Property(!1)],k.prototype,"enableGroupCheckBox",void 0),w([P.Property(null)],k.prototype,"cssClass",void 0),w([P.Property("100%")],k.prototype,"width",void 0),w([P.Property("300px")],k.prototype,"popupHeight",void 0),w([P.Property("100%")],k.prototype,"popupWidth",void 0),w([P.Property(null)],k.prototype,"placeholder",void 0),w([P.Property(null)],k.prototype,"filterBarPlaceholder",void 0),w([P.Property({})],k.prototype,"htmlAttributes",void 0),w([P.Property(null)],k.prototype,"valueTemplate",void 0),w([P.Property(null)],k.prototype,"headerTemplate",void 0),w([P.Property(null)],k.prototype,"footerTemplate",void 0),w([P.Property(null)],k.prototype,"itemTemplate",void 0),w([P.Property(null)],k.prototype,"allowFiltering",void 0),w([P.Property(!0)],k.prototype,"isDeviceFullScreen",void 0),w([P.Property(!0)],k.prototype,"changeOnBlur",void 0),w([P.Property(!1)],k.prototype,"allowCustomValue",void 0),w([P.Property(!0)],k.prototype,"showClearButton",void 0),w([P.Property(1e3)],k.prototype,"maximumSelectionLength",void 0),w([P.Property(!1)],k.prototype,"readonly",void 0),w([P.Property(!1)],k.prototype,"allowResize",void 0),w([P.Property(null)],k.prototype,"text",void 0),w([P.Property(null)],k.prototype,"value",void 0),w([P.Property(!1)],k.prototype,"allowObjectBinding",void 0),w([P.Property(!0)],k.prototype,"hideSelectedItem",void 0),w([P.Property(!0)],k.prototype,"closePopupOnSelect",void 0),w([P.Property("Default")],k.prototype,"mode",void 0),w([P.Property(",")],k.prototype,"delimiterChar",void 0),w([P.Property(!0)],k.prototype,"ignoreCase",void 0),w([P.Property(!1)],k.prototype,"showDropDownIcon",void 0),w([P.Property("Never")],k.prototype,"floatLabelType",void 0),w([P.Property(!1)],k.prototype,"showSelectAll",void 0),w([P.Property("Select All")],k.prototype,"selectAllText",void 0),w([P.Property("Unselect All")],k.prototype,"unSelectAllText",void 0),w([P.Property(!0)],k.prototype,"enableSelectionOrder",void 0),w([P.Property(!0)],k.prototype,"openOnClick",void 0),w([P.Property(!1)],k.prototype,"addTagOnBlur",void 0),w([P.Event()],k.prototype,"change",void 0),w([P.Event()],k.prototype,"removing",void 0),w([P.Event()],k.prototype,"removed",void 0),w([P.Event()],k.prototype,"beforeSelectAll",void 0),w([P.Event()],k.prototype,"selectedAll",void 0),w([P.Event()],k.prototype,"beforeOpen",void 0),w([P.Event()],k.prototype,"open",void 0),w([P.Event()],k.prototype,"close",void 0),w([P.Event()],k.prototype,"blur",void 0),w([P.Event()],k.prototype,"focus",void 0),w([P.Event()],k.prototype,"chipSelection",void 0),w([P.Event()],k.prototype,"resizeStop",void 0),w([P.Event()],k.prototype,"resizing",void 0),w([P.Event()],k.prototype,"resizeStart",void 0),w([P.Event()],k.prototype,"filtering",void 0),w([P.Event()],k.prototype,"tagging",void 0),w([P.Event()],k.prototype,"customValueSelection",void 0),w([P.NotifyPropertyChanges],k));function k(e,t){e=A.call(this,e,t)||this;return e.clearIconWidth=0,e.previousFilterText="",e.storedSelectAllHeight=0,e.isUpdateHeaderHeight=!1,e.isUpdateFooterHeight=!1,e.isBlurDispatching=!1,e.isFilterPrevented=!1,e.isFilteringAction=!1,e.isVirtualReorder=!1,e.isValidKey=!1,e.selectAllEventData=[],e.selectAllEventEle=[],e.preventSetCurrentData=!1,e.isSelectAllLoop=!1,e.scrollFocusStatus=!1,e.keyDownStatus=!1,e}var Et="e-frame",xt="e-check",It="e-checkbox-wrapper",wt="e-stop",Ot="e-input-group-icon e-clear-icon e-icons",At="e-clear-icon",Dt="e-popup-full-page",kt="e-input-focus",Nt=(N.prototype.getModuleName=function(){return"CheckBoxSelection"},N.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on("updatelist",this.listSelection,this),this.parent.on("listoption",this.listOption,this),this.parent.on("selectAll",this.setSelectAll,this),this.parent.on("checkSelectAll",this.checkSelectAll,this),this.parent.on("searchBox",this.setSearchBox,this),this.parent.on("blur",this.onBlurHandler,this),this.parent.on("targetElement",this.targetElement,this),this.parent.on("deviceSearchBox",this.setDeviceSearchBox,this),this.parent.on("inputFocus",this.getFocus,this),this.parent.on("reOrder",this.setReorder,this),this.parent.on("activeList",this.getActiveList,this),this.parent.on("selectAllText",this.setLocale,this),this.parent.on("filterBarPlaceholder",this.setPlaceholder,this),P.EventHandler.add(document,"mousedown",this.onDocumentClick,this),this.parent.on("addItem",this.checboxCreate,this),this.parent.on("popupFullScreen",this.setPopupFullScreen,this))},N.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updatelist",this.listSelection),this.parent.off("listoption",this.listOption),this.parent.off("selectAll",this.setSelectAll),this.parent.off("checkSelectAll",this.checkSelectAll),this.parent.off("searchBox",this.setSearchBox),this.parent.off("blur",this.onBlurHandler),this.parent.off("targetElement",this.targetElement),this.parent.off("deviceSearchBox",this.setDeviceSearchBox),this.parent.off("inputFocus",this.getFocus),this.parent.off("reOrder",this.setReorder),this.parent.off("activeList",this.getActiveList),this.parent.off("selectAllText",this.setLocale),this.parent.off("filterBarPlaceholder",this.setPlaceholder),this.parent.off("addItem",this.checboxCreate),this.parent.off("popupFullScreen",this.setPopupFullScreen))},N.prototype.listOption=function(e){var t,i=this;P.isNullOrUndefined(this.parent.listCurrentOptions.itemCreated)?this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e)}:(t=this.parent.listCurrentOptions.itemCreated,this.parent.listCurrentOptions.itemCreated=function(e){i.checboxCreate(e),t.apply(i,[e])})},N.prototype.setPlaceholder=function(e){h.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput)},N.prototype.checboxCreate=function(e){var t,i,e=P.isNullOrUndefined(e.item)?e:e.item;return(this.parent.enableGroupCheckBox||"e-list-group-item "!==e.className&&"e-list-group-item"!==e.className)&&(t=H.createCheckBox(this.parent.createElement,!0),i=P.select("div.e-icons",e),e.insertBefore(t,e.childNodes[P.isNullOrUndefined(i)?0:1]),P.select("."+Et,t),this.parent.enableGroupCheckBox)&&this.parent.popupWrapper.classList.add("e-multiselect-group"),e},N.prototype.setSelectAll=function(){this.parent.showSelectAll?(P.isNullOrUndefined(this.checkAllParent)&&(this.checkAllParent=this.parent.createElement("div",{className:"e-selectall-parent"}),this.selectAllSpan=this.parent.createElement("span",{className:"e-all-text"}),this.selectAllSpan.textContent="",this.checkAllParent.appendChild(this.selectAllSpan),this.setLocale(),this.checboxCreate(this.checkAllParent),this.parent.headerTemplate&&(P.isNullOrUndefined(this.parent.filterParent)?P.append([this.checkAllParent],this.parent.popupWrapper):P.append([this.checkAllParent],this.parent.filterParent)),this.parent.headerTemplate||(P.isNullOrUndefined(this.parent.filterParent)?P.prepend([this.checkAllParent],this.parent.popupWrapper):this.parent.filterParent.parentNode.insertBefore(this.checkAllParent,this.parent.filterParent.nextSibling)),P.EventHandler.add(this.checkAllParent,"mousedown",this.clickHandler,this)),this.parent.list.classList.contains("e-nodata")||this.parent.listData&&this.parent.listData.length<=1&&!this.parent.enableVirtualization&&!this.parent.isDynamicDataChange||this.parent.isDynamicDataChange&&this.parent.listData&&this.parent.listData.length<=1?this.checkAllParent.style.display="none":this.checkAllParent.style.display="block",this.parent.selectAllHeight=this.checkAllParent.getBoundingClientRect().height):P.isNullOrUndefined(this.checkAllParent)||(this.checkAllParent.parentElement.removeChild(this.checkAllParent),this.checkAllParent=null)},N.prototype.destroy=function(){this.removeEventListener(),P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.checkAllParent=null,this.clearIconElement=null,this.filterInput=null,this.filterInputObj=null,this.checkWrapper=null,this.selectAllSpan=null},N.prototype.listSelection=function(e){var t;t=P.isNullOrUndefined(e.e)?(e.li.querySelector(".e-checkbox-wrapper")||e.li.lastElementChild).childNodes[1]:(e.li.querySelector(".e-checkbox-wrapper .e-frame"),!P.isNullOrUndefined(e.e.target)&&e.e.target.classList.contains("e-frame")&&(!this.parent.showSelectAll||this.checkAllParent&&!this.checkAllParent.contains(e.e.target))?e.e.target:e.li.querySelector(".e-checkbox-wrapper").childNodes[1]),(this.parent.itemTemplate||this.parent.enableGroupCheckBox)&&(t=e.li.firstElementChild.childNodes[1]),P.isNullOrUndefined(t)||(this.checkWrapper=P.closest(t,"."+It)),P.isNullOrUndefined(this.checkWrapper)||(t=P.select("."+Et,this.checkWrapper),this.validateCheckNode(this.checkWrapper,t.classList.contains(xt),e.li,e.e,!1))},N.prototype.validateCheckNode=function(e,t,i,s,l){this.changeState(e,t?"uncheck":"check",s,!0,l)},N.prototype.clickHandler=function(e){var t=e.currentTarget.classList.contains(this.checkAllParent.className)||e.currentTarget.classList.value===this.checkAllParent.className?e.currentTarget.firstElementChild.lastElementChild:e.currentTarget;this.checkWrapper=P.closest(t,"."+It);P.isNullOrUndefined(this.checkWrapper)||(t=P.select("."+Et,this.checkWrapper),this.validateCheckNode(this.checkWrapper,t.classList.contains(xt),null,e,!0)),e.preventDefault()},N.prototype.changeState=function(e,t,i,s,l){e=e.getElementsByClassName(Et)[0];"check"!==t||e.classList.contains(xt)?"uncheck"===t&&(e.classList.contains(xt)||e.classList.contains(wt))?(P.removeClass([e],[xt,wt]),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):"indeterminate"!==t||e.classList.contains(wt)||(P.removeClass([e],[xt]),e.classList.add(wt),l&&(this.parent.selectAllItems(!1,i),this.setLocale())):(e.classList.remove(wt),e.classList.add(xt),l&&(this.parent.selectAllItems(!0,i),this.setLocale(!0)))},N.prototype.setSearchBox=function(e){var t;if(P.isNullOrUndefined(this.parent.filterParent))return this.parent.filterParent=this.parent.createElement("span",{className:"e-filter-parent"}),this.filterInput=this.parent.createElement("input",{attrs:{type:"text"},className:"e-input-filter"}),this.parent.element.parentNode.insertBefore(this.filterInput,this.parent.element),t=!1,P.Browser.isDevice&&this.parent.isDeviceFullScreen&&(this.parent.mobFilter=!(t=!0)),this.filterInputObj=h.Input.createInput({element:this.filterInput,buttons:t?["e-input-group-icon e-back-icon e-icons",Ot]:[Ot],properties:{placeholder:this.parent.filterBarPlaceholder}},this.parent.createElement),P.isNullOrUndefined(this.parent.cssClass)||(-1!==this.parent.cssClass.split(" ").indexOf("e-outline")?P.addClass([this.filterInputObj.container],"e-outline"):-1!==this.parent.cssClass.split(" ").indexOf("e-filled")&&P.addClass([this.filterInputObj.container],"e-filled")),P.append([this.filterInputObj.container],this.parent.filterParent),P.prepend([this.parent.filterParent],e.popupElement),P.attributes(this.filterInput,{"aria-disabled":"false",role:"combobox",autocomplete:"off",autocapitalize:"off",spellcheck:"false","aria-label":"multiselect","aria-expanded":"true","aria-controls":e.popupElement.id}),this.clearIconElement=this.filterInput.parentElement.querySelector("."+At),!P.Browser.isDevice&&this.clearIconElement&&(P.EventHandler.add(this.clearIconElement,"mousedown",this.clearText,this),this.clearIconElement.style.visibility="hidden"),P.EventHandler.add(this.filterInput,"input",this.parent.onInput,this.parent),P.EventHandler.add(this.filterInput,"keyup",this.parent.keyUp,this.parent),P.EventHandler.add(this.filterInput,"keydown",this.parent.onKeyDown,this.parent),P.EventHandler.add(this.filterInput,"blur",this.onBlurHandler,this),P.EventHandler.add(this.filterInput,"paste",this.parent.pasteHandler,this.parent),this.parent.searchBoxHeight=this.filterInputObj.container.parentElement.getBoundingClientRect().height,this.filterInputObj},N.prototype.clickOnBackIcon=function(e){this.parent.hidePopup(),P.removeClass([document.body,this.parent.popupObj.element],Dt),this.parent.inputElement.focus()},N.prototype.clearText=function(e){this.parent.targetInputElement.value="",this.parent.allowFiltering&&""===this.parent.targetInputElement.value&&this.parent.search(null),this.parent.refreshListItems(null),this.parent.refreshPopup(),this.clearIconElement.style.visibility="hidden",this.filterInput.focus(),(!this.parent.enableVirtualization||this.parent.enableVirtualization&&(P.isNullOrUndefined(this.parent.value)||this.parent.value&&0===this.parent.value.length))&&this.setReorder(e),this.boundPreventListSelection=this.preventListSelection.bind(this),this.parent.popupWrapper.addEventListener("mouseup",this.boundPreventListSelection,!0),e.preventDefault()},N.prototype.preventListSelection=function(e){e.stopPropagation(),this.parent.popupWrapper.removeEventListener("mouseup",this.boundPreventListSelection,!0),this.boundPreventListSelection=null},N.prototype.setDeviceSearchBox=function(){this.parent.popupObj.element.classList.add("e-ddl-device"),this.parent.popupObj.element.classList.add("e-ddl-device-filter"),this.parent.popupObj.position={X:0,Y:0},this.parent.popupObj.dataBind(),this.setSearchBoxPosition(),this.backIconElement=this.filterInputObj.container.querySelector(".e-back-icon"),this.clearIconElement=this.filterInputObj.container.querySelector("."+At),this.clearIconElement.style.visibility="hidden",P.EventHandler.add(this.backIconElement,"click",this.clickOnBackIcon,this),P.EventHandler.add(this.clearIconElement,"click",this.clearText,this)},N.prototype.setSearchBoxPosition=function(){var e=this.filterInput.parentElement.getBoundingClientRect().height,t=0,i=0,s=0,e=(this.checkAllParent&&(t=this.checkAllParent.getBoundingClientRect().height),this.parent.header&&(s=this.parent.header.getBoundingClientRect().height),this.parent.footer&&(i=this.parent.footer.getBoundingClientRect().height),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%",this.parent.list.style.maxHeight=window.innerHeight-e-t-s-i+"px",this.parent.list.style.height=window.innerHeight-e-t-s-i+"px",this.filterInput.parentElement.querySelector("."+At));P.detach(this.filterInput),e.parentElement.insertBefore(this.filterInput,e)},N.prototype.setPopupFullScreen=function(){this.parent&&this.parent.popupObj&&(P.attributes(this.parent.popupObj.element,{style:"left:0px;right:0px;top:0px;bottom:0px;"}),P.addClass([document.body,this.parent.popupObj.element],Dt),this.parent.popupObj.element.style.maxHeight="100%",this.parent.popupObj.element.style.width="100%")},N.prototype.targetElement=function(){return P.isNullOrUndefined(this.clearIconElement)||(this.parent.targetInputElement=this.filterInput,this.clearIconElement.style.visibility=""===this.parent.targetInputElement.value?"hidden":"visible"),this.parent.targetInputElement.value},N.prototype.onBlurHandler=function(e){var t;this.parent.element.classList.contains("e-listbox")||(t=void 0,this.parent.keyAction)||(P.Browser.isIE&&(t=!P.isNullOrUndefined(e)&&e.target),P.Browser.isIE||(t=!P.isNullOrUndefined(e)&&e.relatedTarget),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&this.parent.popupObj.element.contains(t)&&!P.Browser.isIE&&this.filterInput?this.filterInput.focus():this.parent.scrollFocusStatus&&this.filterInput?(e.preventDefault(),this.filterInput.focus(),this.parent.scrollFocusStatus=!1):(this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.updateValueState(e,this.parent.value,this.parent.tempValues),this.parent.dispatchEvent(this.parent.hiddenElement,"change")),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&(this.parent.inputFocus=!1,this.parent.overAllWrapper.classList.remove(kt),this.parent.trigger("blur"),this.parent.focused=!0),this.parent.popupObj&&document.body.contains(this.parent.popupObj.element)&&!this.parent.popupObj.element.classList.contains("e-popup-close")&&!P.Browser.isDevice&&this.parent.hidePopup()))},N.prototype.onDocumentClick=function(e){var t;"listbox"!==this.parent.getLocaleName()&&(t=e.target,P.isNullOrUndefined(this.parent.popupObj)||!P.closest(t,'[id="'+this.parent.popupObj.element.id+'"]')||this.filterInput&&""!==this.filterInput.value||e.preventDefault(),!P.isNullOrUndefined(this.parent.popupObj)&&P.closest(t,'[id="'+this.parent.popupObj.element.id+'"]')||P.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)?this.parent.scrollFocusStatus=(P.Browser.isIE||"edge"===P.Browser.info.name)&&document.activeElement===this.filterInput:(this.parent.overAllWrapper.classList.contains(y.focus)||this.parent.isPopupOpen())&&(this.parent.inputFocus=!1,this.parent.scrollFocusStatus=!1,this.parent.hidePopup(),this.parent.onBlurHandler(e,!0),this.parent.focused=!0),P.isNullOrUndefined(this.parent.overAllWrapper)||this.parent.overAllWrapper.contains(e.target)||!this.parent.overAllWrapper.classList.contains("e-input-focus")||this.parent.isPopupOpen()||(P.Browser.isIE?this.parent.onBlurHandler():this.parent.onBlurHandler(e)),this.filterInput===t)&&this.filterInput.focus()},N.prototype.getFocus=function(e){this.parent.overAllWrapper.classList.remove(kt),this.parent.keyAction&&"clear"!==e.value&&"focus"!==e.value?this.parent.keyAction=!1:("focus"===e.value&&(this.filterInput.focus(),this.parent.removeFocus(),P.EventHandler.remove(this.parent.list,"keydown",this.parent.onKeyDown)),"clear"===e.value&&(this.filterInput.value="",this.clearIconElement.style.visibility="hidden"))},N.prototype.checkSelectAll=function(e){"check"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale(!0)),"uncheck"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale()),"indeterminate"===e.value&&(this.changeState(this.checkAllParent,e.value,null,null,!1),this.setLocale())},N.prototype.setLocale=function(e){if("Select All"!==this.parent.selectAllText||"Unselect All"!==this.parent.unSelectAllText){var t=e?this.parent.unSelectAllText:this.parent.selectAllText;this.selectAllSpan.textContent="";for(var i=0,s=P.compile(t)({},this.parent,e?"unSelectAllText":"selectAllText",null,!this.parent.isStringTemplate);i<s.length;i++){var l=s[i];this.selectAllSpan.textContent=l.textContent}}else{t=new P.L10n(this.parent.getLocaleName(),{},this.parent.locale);""===t.getConstant("selectAllText")&&(t=new P.L10n("dropdowns",{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.parent.locale)),P.isNullOrUndefined(this.selectAllSpan)||(this.selectAllSpan.textContent=e?t.getConstant("unSelectAllText"):t.getConstant("selectAllText"))}},N.prototype.getActiveList=function(e){e.li.classList.contains("e-active")?this.activeLi.push(e.li.cloneNode(!0)):this.activeLi.splice(e.index,1)},N.prototype.setReorder=function(e){var t,i,s;this.parent.enableSelectionOrder&&!P.isNullOrUndefined(this.parent.value)&&(s=this.parent.ulElement.querySelectorAll("li.e-active").length,t=void 0,i=this.parent.createElement("ul",{className:"e-list-parent e-ul e-reorder"}),0<s&&(this.parent.ulElement.querySelectorAll("li.e-active").forEach(function(e){i.appendChild(e)}),t=this.parent.ulElement.querySelectorAll("li.e-active"),P.addClass(t,"e-reorder-hide"),this.parent.enableVirtualization?(s=this.parent.list.querySelector(".e-virtual-ddl-content"),P.prepend([i],s)):P.prepend([i],this.parent.list)),this.parent.focusAtFirstListItem())},N);function N(e){this.activeLi=[],this.activeEle=[],this.parent=e,this.removeEventListener(),this.addEventListener()}Lt=function(e,t){return(Lt=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 Lt,Bt,Tt=function(e,t){function i(){this.constructor=e}Lt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},L=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},Vt=(Bt=P.ChildProperty,Tt(Pt,Bt),L([P.Property("Multiple")],Pt.prototype,"mode",void 0),L([P.Property(!1)],Pt.prototype,"showCheckbox",void 0),L([P.Property(!1)],Pt.prototype,"showSelectAll",void 0),L([P.Property("Left")],Pt.prototype,"checkboxPosition",void 0),Pt);function Pt(){return null!==Bt&&Bt.apply(this,arguments)||this}Ut=P.ChildProperty,Tt(Ft,Ut),L([P.Property([])],Ft.prototype,"items",void 0),L([P.Property("Right")],Ft.prototype,"position",void 0);var Ut,Ht=Ft;function Ft(){return null!==Ut&&Ut.apply(this,arguments)||this}Tt(B,Wt=Z),(qt=B).prototype.addItem=function(e,t){Wt.prototype.addItem.call(this,e,t),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new c.Query,this.fields)},B.prototype.render=function(){var e,t;this.isAngular&&this.allowFiltering&&(t=(e=this.element).cloneNode(!0),e.parentNode.replaceChild(t,e),this.element=t,P.setValue("ej2_instances",[this],this.element)),this.inputString="",this.initLoad=!0,this.isCustomFiltering=!1,this.initialSelectedOptions=this.value,this.inputFormName=this.element.getAttribute("name"),Wt.prototype.render.call(this),this.setEnabled(),this.renderComplete()},B.prototype.initWrapper=function(){for(var e=this.createElement("select",{className:"e-hidden-select",attrs:{multiple:""}}),t=(e.style.visibility="hidden",this.list.classList.add("e-listbox-wrapper"),this.list.querySelector(".e-list-parent").setAttribute("role","presentation"),this.list.querySelectorAll(".e-list-group-item")),i=0;i<t.length;i++)t[i].removeAttribute("tabindex"),t[i].setAttribute("role","option");this.itemTemplate&&this.list.classList.add("e-list-template"),this.list.classList.add("e-wrapper"),this.list.classList.add("e-lib"),"EJS-LISTBOX"===this.element.tagName?(this.element.setAttribute("tabindex","0"),this.initLoad&&this.element.appendChild(this.list)):(this.initLoad&&this.element.parentElement&&this.element.parentElement.insertBefore(this.list,this.element),this.list.insertBefore(this.element,this.list.firstChild),this.element.style.display="none"),this.list.insertBefore(e,this.list.firstChild),this.list.getElementsByClassName("e-list-item")[0]&&this.list.getElementsByClassName("e-list-item")[0].classList.remove(y.focus),this.itemTemplate&&this.renderReactTemplates(),P.removeClass([this.list],[y.content,y.root]),this.validationAttribute(this.element,e),this.list.setAttribute("role","listbox"),P.attributes(this.list,{role:"listbox","aria-label":"listbox","aria-multiselectable":"Multiple"===this.selectionSettings.mode?"true":"false"}),this.updateSelectionSettings()},B.prototype.updateSelectionSettings=function(){var e;this.selectionSettings.showCheckbox&&this.selectionSettings.showSelectAll&&this.liCollections.length&&(e=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}))},B.prototype.initDraggable=function(){var s=this;this.ulElement&&(this.ulElement.id=this.element.id+"_parent"),this.allowDragAndDrop&&new U.Sortable(this.ulElement,{scope:this.scope,itemClass:"e-list-item",beforeDragStart:this.triggerDragStart.bind(this),drag:this.triggerDrag.bind(this),beforeDrop:this.beforeDragEnd.bind(this),drop:this.dragEnd.bind(this),placeHolder:function(){return s.createElement("span",{className:"e-placeholder"})},helper:function(e){var t=s.list.cloneNode(),e=e.sender.cloneNode(!0),i=(t.appendChild(e),s.getItems()[0]);return t.style.width=i.offsetWidth+"px",t.style.height=i.offsetHeight+"px",1<(s.value&&s.value.length)&&s.isSelected(e)&&e.appendChild(s.createElement("span",{className:"e-list-badge",innerHTML:s.value.length+""})),t.style.zIndex=o.getZindexPartial(s.element)+"",t}})},B.prototype.updateActionCompleteData=function(e,t,i){this.jsonData.splice(null===i?this.jsonData.length:i,0,t)},B.prototype.initToolbar=function(){var e,t=this.toolbarSettings.position,i=this.element.getAttribute("data-value"),s=(this.toolbarSettings.items=P.isNullOrUndefined(this.toolbarSettings.items)?[]:this.toolbarSettings.items,this.toolbarSettings.items.length&&(e=this.createElement("div",{className:"e-listbox-tool",attrs:{role:"toolbar"}}),s=this.createElement("div",{className:"e-listboxtool-wrapper e-lib e-"+t.toLowerCase()}),this.list.parentElement.insertBefore(s,this.list),s.appendChild("Right"===t?this.list:e),s.appendChild("Right"===t?e:this.list),this.createButtons(e),this.element.id||(this.element.id=P.getUniqueID("e-"+this.getModuleName())),this.scope?document.querySelector(this.scope).setAttribute("data-value",this.element.id):this.updateToolBarState()),this.element.getAttribute("data-value"));i&&s&&i!==s?(this.tBListBox=P.getComponent(document.getElementById(i),this.getModuleName()),this.tBListBox.updateToolBarState()):s&&(this.tBListBox=P.getComponent(document.getElementById(s),this.getModuleName()),this.tBListBox.updateToolBarState())},B.prototype.createButtons=function(t){var i,s=this,l=new P.L10n(this.getModuleName(),{moveUp:"Move Up",moveDown:"Move Down",moveTo:"Move To",moveFrom:"Move From",moveAllTo:"Move All To",moveAllFrom:"Move All From"},this.locale);this.toolbarSettings.items.forEach(function(e){i=l.getConstant(e),i=s.createElement("button",{attrs:{type:"button","data-value":e,title:i,"aria-label":i}}),t.appendChild(i),new H.Button({iconCss:"e-icons e-"+e.toLowerCase()},i).createElement=s.createElement})},B.prototype.validationAttribute=function(e,t){this.inputFormName&&e.setAttribute("name",this.inputFormName),Wt.prototype.validationAttribute.call(this,e,t),t.required=e.required,e.required=!1},B.prototype.setHeight=function(){(this.toolbarSettings.items.length?this.list.parentElement:this.list).style.height=P.formatUnit(this.height),this.allowFiltering&&this.height.toString().indexOf("%")<0?P.addClass([this.list],"e-filter-list"):P.removeClass([this.list],"e-filter-list")},B.prototype.setCssClass=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.cssClass&&P.addClass([e],this.cssClass.replace(/\s+/g," ").trim().split(" ")),this.enableRtl&&P.addClass([this.list],"e-rtl")},B.prototype.setEnable=function(){var e=this.toolbarSettings.items.length?this.list.parentElement:this.list;this.enabled?P.removeClass([e],U.cssClass.disabled):P.addClass([e],U.cssClass.disabled)},B.prototype.showSpinner=function(){this.spinner||(this.spinner=this.createElement("div",{className:"e-listbox-wrapper"})),this.spinner.style.height=P.formatUnit(this.height),this.element.parentElement&&this.element.parentElement.insertBefore(this.spinner,this.element.nextSibling),o.createSpinner({target:this.spinner},this.createElement),o.showSpinner(this.spinner)},B.prototype.hideSpinner=function(){this.spinner.querySelector(".e-spinner-pane")&&o.hideSpinner(this.spinner),this.spinner.parentElement&&P.detach(this.spinner)},B.prototype.onInput=function(){this.isDataSourceUpdate=!1,this.keyDownStatus?this.isValidKey=!0:this.isValidKey=!1,this.keyDownStatus=!1,this.refreshClearIcon()},B.prototype.clearText=function(){this.filterInput.value="",this.refreshClearIcon();var e=document.createEvent("KeyboardEvent");this.isValidKey=!0,this.KeyUp(e)},B.prototype.refreshClearIcon=function(){this.filterInput.parentElement.querySelector("."+Mt.clearIcon)&&(this.filterInput.parentElement.querySelector("."+Mt.clearIcon).style.visibility=""===this.filterInput.value?"hidden":"visible")},B.prototype.onActionComplete=function(e,t,i){var s,l,n,a,o=this;if(this.allowFiltering&&this.list.getElementsByClassName("e-filter-parent")[0]&&(s=this.list.getElementsByClassName("e-filter-parent")[0].cloneNode(!0)),0===t.length&&(a=e.childNodes[0])&&e.removeChild(a),this.allowFiltering&&(l=this.list.getElementsByClassName("e-input-filter")[0])&&(n=l.selectionStart),Wt.prototype.onActionComplete.call(this,e,t,i),this.allowFiltering&&!P.isNullOrUndefined(s)&&(this.list.insertBefore(s,this.list.firstElementChild),this.filterParent=this.list.getElementsByClassName("e-filter-parent")[0],this.filterWireEvents(s),a=s.querySelector(".e-input-filter"))&&(a.addEventListener("focus",function(){s.childNodes[0].classList.contains("e-input-focus")||s.childNodes[0].classList.add("e-input-focus")}),a.addEventListener("blur",function(){s.childNodes[0].classList.contains("e-input-focus")&&s.childNodes[0].classList.remove("e-input-focus")})),this.initWrapper(),this.setSelection(this.value,!0,!1,!this.isRendered),this.initDraggable(),this.mainList=this.ulElement,this.initLoad)this.jsonData=[],P.extend(this.jsonData,t,[]),this.initToolbarAndStyles(),this.wireEvents(),this.showCheckbox&&this.setCheckboxPosition(),this.allowFiltering&&this.setFiltering();else if(this.isDataSourceUpdate&&(this.jsonData=[],P.extend(this.jsonData,t,[]),this.isDataSourceUpdate=!1),this.allowFiltering){if(l=this.list.getElementsByClassName("e-input-filter")[0],P.isNullOrUndefined(l))return;l.selectionStart=n,l.selectionEnd=n,(""!==l.value||""===l.value&&this.isBackSpace)&&(l.focus(),setTimeout(function(){o.isBackSpace=!1}))}this.toolbarSettings.items.length&&this.scope&&-1<this.scope.indexOf("#")&&!P.isNullOrUndefined(i)&&(e=this.scope.replace("#",""),P.getComponent(document.getElementById(e),this.getModuleName()).initToolbar()),this.initLoad=!1},B.prototype.initToolbarAndStyles=function(){this.initToolbar(),this.setCssClass(),this.setEnable(),this.setHeight()},B.prototype.triggerDragStart=function(t){var i,s=this,e=P.extend(this.getDragArgs(t),{dragSelected:!0},{cancel:!1});P.Browser.isIos&&(this.list.style.overflow="hidden"),this.trigger("dragStart",e,function(e){s.allowDragAll=e.dragSelected,s.allowDragAll||(i=s.ulElement.getElementsByClassName("e-list-badge")[0])&&P.detach(i),e.cancel&&(t.cancel=!0)})},B.prototype.triggerDrag=function(e){var t,i,s=this,l=10,n=(this.itemTemplate&&e.target&&(e.target&&e.target.closest(".e-list-item")?l=e.target.closest(".e-list-item").scrollHeight:(n=e.element.querySelector(".e-list-item"))&&(l=n.scrollHeight)),e.event);this.stopTimer(),e.target&&(e.target.classList.contains("e-listbox-wrapper")||e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item"))&&(i=e.target.classList.contains("e-list-item")||e.target.classList.contains("e-filter-parent")||e.target.classList.contains("e-input-group")||e.target.closest(".e-list-item")?e.target.closest(".e-listbox-wrapper"):e.target,t=this.allowFiltering?i.querySelector(".e-list-parent"):i)&&((i=t.getBoundingClientRect()).y+t.offsetHeight-(n.clientY+36)<1?this.timer=window.setInterval(function(){s.setScrollDown(t,l,!0)},70):n.clientY-36-i.y<1&&(this.timer=window.setInterval(function(){s.setScrollDown(t,l,!1)},70))),null!==e.target&&this.trigger("drag",this.getDragArgs(e))},B.prototype.setScrollDown=function(e,t,i){e.scrollTop=i?e.scrollTop+t:e.scrollTop-t},B.prototype.stopTimer=function(){window.clearInterval(this.timer)},B.prototype.beforeDragEnd=function(e){this.stopTimer();var t=[];this.dragValue=this.getFormattedValue(e.droppedElement.getAttribute("data-value")),-1<this.value.indexOf(this.dragValue)?e.items=this.getDataByValues(this.value):e.items=this.getDataByValues([this.dragValue]),P.extend(t,e.items),this.trigger("beforeDrop",e),JSON.stringify(e.items)!==JSON.stringify(t)&&(this.customDraggedItem=e.items)},B.prototype.dragEnd=function(a){var o,t,l,r,h,u,p,n,d,c,m,f,v,g,y,e,i,s,C,b=this,S=this.getFormattedValue(a.droppedElement.getAttribute("data-value")),E=this.getComponent(a.droppedElement),x=this.getDragArgs({target:a.droppedElement},!0),I={previousData:this.dataSource},w={previousData:E.dataSource},x=P.extend({},x,{target:a.target,source:{previousData:this.dataSource},previousIndex:a.previousIndex,currentIndex:a.currentIndex}),O=(E!==this&&(s=P.extend(I,{currentData:this.listData}),x=P.extend(x,{source:s,destination:w})),P.Browser.isIos&&(this.list.style.overflow=""),this.getComponent(a.target)),A=(O&&0===O.listData.length&&(C=O.ulElement.childNodes[0])&&O.ulElement.removeChild(C),E===this?(l=this.ulElement,r=[].slice.call(this.listData),h=[].slice.call(this.liCollections),u=[].slice.call(this.jsonData),p=[].slice.call(this.sortedData),n=a.currentIndex,d=a.currentIndex=this.getCurIdx(this,a.currentIndex),O=r.indexOf(this.getDataByValue(S)),C=u.indexOf(this.getDataByValue(S)),e=p.indexOf(this.getDataByValue(S)),r.splice(d,0,r.splice(O,1)[0]),p.splice(n,0,p.splice(e,1)[0]),u.splice(d,0,u.splice(C,1)[0]),h.splice(d,0,h.splice(O,1)[0]),this.allowDragAll&&(t=this.value&&-1<Array.prototype.indexOf.call(this.value,S)?this.value:[S],P.isNullOrUndefined(this.customDraggedItem)||(t=[],this.customDraggedItem.forEach(function(e){t.push(P.getValue(b.fields.value,e))})),t.forEach(function(e){var t,i,s;e!==S&&(t=r.indexOf(b.getDataByValue(e)),i=u.indexOf(b.getDataByValue(e)),s=p.indexOf(b.getDataByValue(e)),d<t&&d++,u.splice(d,0,u.splice(i,1)[0]),r.splice(d,0,r.splice(t,1)[0]),p.splice(n,0,p.splice(s,1)[0]),h.splice(d,0,h.splice(t,1)[0]),l.insertBefore(b.getItems()[b.getIndexByValue(e)],l.getElementsByClassName("e-placeholder")[0]))})),this.listData=r,this.jsonData=u,this.sortedData=p,this.liCollections=h):(m=[].slice.call(this.liCollections),f=a.currentIndex=this.getCurIdx(E,a.currentIndex),v=E.ulElement,r=[].slice.call(E.listData),h=[].slice.call(E.liCollections),u=[].slice.call(E.jsonData),p=[].slice.call(E.sortedData),t=this.value&&-1<Array.prototype.indexOf.call(this.value,S)&&this.allowDragAll?this.value:[S],P.isNullOrUndefined(this.customDraggedItem)||(t=[],this.customDraggedItem.forEach(function(e){t.push(P.getValue(b.fields.value,e))})),g=[].slice.call(this.listData),y=[].slice.call(this.sortedData),t.forEach(function(e){o=b.getDataByValue(e);var t=b.listData.indexOf(o),i=b.jsonData.indexOf(o),s=b.sortedData.indexOf(o),i=(g.splice(t,1),b.jsonData.splice(i,1),y.splice(s,1),b.listData=g,b.sortedData=y,e===S?a.currentIndex:f);if(r.splice(i,0,o),u.splice(i,0,o),p.splice(i,0,o),h.splice(i,0,m.splice(t,1)[0]),e)c=b.getItems()[b.getIndexByValue(e)];else for(var l=b.getItems(),n=0;n<l.length;n++)if(null===l[n].getAttribute("data-value")&&l[n].classList.contains("e-list-item")){c=l[n];break}c=c||a.helper,b.removeSelected(b,e===S?[a.droppedElement]:[c]),v.insertBefore(c,v.getElementsByClassName("e-placeholder")[0]),f++}),this.fields.groupBy&&(i=this.renderItems(this.listData,this.fields),this.updateListItems(i,this.ulElement),this.setSelection()),("None"!==E.sortOrder||this.selectionSettings.showCheckbox!==E.selectionSettings.showCheckbox||E.fields.groupBy||E.itemTemplate||this.itemTemplate)&&(e=P.getComponent(v,"sortable"),i=E.renderItems(r,E.fields),E.updateListItems(i,v),this.setSelection(),e.placeHolderElement&&v.appendChild(e.placeHolderElement),v.appendChild(a.helper),E.setSelection()),this.liCollections=m,E.liCollections=h,E.jsonData=P.extend([],[],u,!1),E.listData=P.extend([],[],r,!1),"None"===E.sortOrder&&(E.sortedData=P.extend([],[],p,!1)),0===this.listData.length&&this.l10nUpdate()),x=this===E?(s=P.extend(I,{currentData:r}),P.extend(x,{source:s})):(C=P.extend(w,{currentData:r}),P.extend(x,{destination:C})),P.isNullOrUndefined(this.customDraggedItem)||(x.items=this.customDraggedItem),this.trigger("drop",x),x.elements);if(A.length)for(var D=0;D<A.length;D++)A[D].classList.remove("e-grabbed");0<this.toolbarSettings.items.length?this.updateToolBarState():this.tBListBox&&0<this.tBListBox.toolbarSettings.items.length&&this.tBListBox.updateToolBarState()},B.prototype.updateListItems=function(e,t){t.innerHTML="",t.append.apply(t,e.childNodes)},B.prototype.removeSelected=function(e,t){e.selectionSettings.showCheckbox?t.forEach(function(e){e.getElementsByClassName("e-frame")[0].classList.remove("e-check")}):P.removeClass(t,U.cssClass.selected)},B.prototype.getCurIdx=function(e,t){return e.fields.groupBy&&(t-=[].slice.call(e.ulElement.children).slice(0,t).filter(function(e){return e.classList.contains(U.cssClass.group)}).length),t},B.prototype.getComponent=function(e){var t,e="EJS-LISTBOX"===this.element.tagName?P.closest(e,".e-listbox"):P.closest(e,".e-listbox-wrapper")&&P.closest(e,".e-listbox-wrapper").querySelector(".e-listbox");return t=e?P.getComponent(e,this.getModuleName()):t},B.prototype.setEnabled=function(){this.element.setAttribute("aria-disabled",this.enabled?"false":"true")},B.prototype.listOption=function(e,t){return this.listCurrentOptions=Wt.prototype.listOption.call(this,e,t),this.listCurrentOptions=P.extend({},this.listCurrentOptions,{itemCreated:this.triggerBeforeItemRender.bind(this)},!0),this.notify("listoption",{module:"CheckBoxSelection"}),this.listCurrentOptions},B.prototype.triggerBeforeItemRender=function(e){e.item.setAttribute("tabindex","-1"),this.trigger("beforeItemRender",{element:e.item,item:e.curData})},B.prototype.requiredModules=function(){var e=[];return this.selectionSettings.showCheckbox&&e.push({member:"CheckBoxSelection",args:[this]}),e},B.prototype.enableItems=function(e,t,i){var s,l,n=this;void 0===t&&(t=!0),e.forEach(function(e){(s=n.findListElement(n.list,"li","data-value",i?e:n.getValueByText(e)))&&(t?(P.removeClass([s],U.cssClass.disabled),s.removeAttribute("aria-disabled")):(P.addClass([s],U.cssClass.disabled),s.setAttribute("aria-disabled","true")))}),this.allowFiltering&&this.filterInput&&""!==this.filterInput.value&&0<this.toolbarSettings.items.length&&(l=!1,this.ulElement.childNodes.forEach(function(e){e.classList.contains("e-disabled")||(l=!0)}),l||(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="moveAllTo"]').disabled=!0))},B.prototype.selectItems=function(e,t,i){(t=void 0===t?!0:t)&&!this.selectionSettings.showCheckbox&&"Single"===this.selectionSettings.mode&&this.getSelectedItems().forEach(function(e){e.classList.remove("e-active"),e.removeAttribute("aria-selected"),P.removeClass([e],U.cssClass.selected)}),this.setSelection(e,t,!i),this.updateSelectedOptions();for(var s=[],l=0;l<e.length;l++)for(var n=this.list.querySelectorAll('[aria-selected="true"]'),a=0;a<n.length;a++)e[l]===this.getFormattedValue(n[a].getAttribute("data-value"))&&s.push(n[a]);this.triggerChange(s,null)},B.prototype.selectAll=function(e){this.selectAllItems(e=void 0===e?!0:e)},B.prototype.addItems=function(e,t){Wt.prototype.addItem.call(this,e,t),this.allowFiltering&&""!==this.filterInput.value&&this.filteringAction(this.jsonData,new c.Query,this.fields)},B.prototype.removeItems=function(e,t){this.removeItem(e,t)},B.prototype.removeItem=function(e,t){var i=this,s=[],l=this.list.querySelectorAll("."+y.li);if(e){e=e instanceof Array?e:[e];for(var n=this.fields,a={},o=[],r=(P.extend(o,[],this.jsonData),[]),h=[],u=0;u<o.length;u++)a[o[u]instanceof Object?o[u][n.value]:o[u].toString()]=u;for(var p=0;p<e.length;p++){var d=e[p]instanceof Object?e[p][n.value]:e[p].toString();Object.prototype.hasOwnProperty.call(a,d)&&(s.push(l[d=a[d]]),r.push(d),h.push(d))}r.sort(function(e,t){return t-e}).forEach(function(e){i.listData.splice(e,1),i.jsonData.splice(e,1)});for(var c=h.length-1;0<=c;c--)this.updateLiCollection(h[c])}else s.push(l[t=t||0]),this.listData.splice(t,1),this.jsonData.splice(t,1),this.updateLiCollection(t);for(u=0;u<s.length;u++)this.ulElement.removeChild(s[u]);0===this.listData.length&&this.l10nUpdate(),this.listData.length!==this.sortedData.length&&(this.sortedData=this.listData),this.value=[],this.updateToolBarState()},B.prototype.getDataByValues=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.getDataByValue(e[i]));return t},B.prototype.moveUp=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,e)},B.prototype.moveDown=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!1,!1,e)},B.prototype.moveTop=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(null,!1,e,!0)},B.prototype.moveBottom=function(e){e=e?this.getElemByValue(e):this.getSelectedItems();this.moveUpDown(!0,!1,e,!1,!0)},B.prototype.moveTo=function(e,t,i){e=e?this.getElemByValue(e):this.getSelectedItems(),i=i?P.getComponent(i,qt):this.getScopedListBox();this.moveData(this,i,!1,e,t)},B.prototype.moveAllTo=function(e,t){this.toolbarAction="moveAllTo",0<this.listData.length&&(e=e?P.getComponent(e,qt):this.getScopedListBox(),this.moveAllData(this,e,!1,t))},B.prototype.getDataList=function(){return this.jsonData},B.prototype.getSortedList=function(){var e;if(t=e=this.sortedData,this.fields.groupBy)for(var t=[],i=0;i<e.length;i++)e[i].isHeader||t.push(e[i]);return t},B.prototype.getElemByValue=function(e){for(var t=[],i=0;i<e.length;i++)t.push(this.ulElement.querySelector('[data-value ="'+e[i]+'"]'));return t},B.prototype.updateLiCollection=function(e){var t=[].slice.call(this.liCollections);t.splice(e,1),this.liCollections=t},B.prototype.selectAllItems=function(i,e){var s=this;if([].slice.call(this.getItems()).forEach(function(e){var t;e.classList.contains(U.cssClass.disabled)||(s.selectionSettings.showCheckbox?(!(t=e.getElementsByClassName("e-check")[0])&&i||t&&!i)&&(s.notify("updatelist",{li:e,module:"listbox"}),s.maximumSelectionLength>=s.list.querySelectorAll(".e-list-item span.e-check").length)&&s.checkMaxSelection():i?e.classList.add(U.cssClass.selected):e.classList.remove(U.cssClass.selected))}),this.updateSelectedOptions(),this.allowFiltering&&this.selectionSettings.showCheckbox){var l=this.list.getElementsByTagName("li"),n=0;if(i)for(var a=this,n=0;n<l.length;n++)!function(){var t=a.getFormattedValue(l[n].getAttribute("data-value"));a.value.some(function(e){return e===t})||a.value.push(a.getFormattedValue(l[n].getAttribute("data-value")))}();else{var o=this;for(n=0;n<l.length;n++)!function(){var t=o.getFormattedValue(l[n].getAttribute("data-value"));o.value=o.value.filter(function(e){return e!==t})}()}document.querySelectorAll("ul").length<2&&this.updateMainList()}this.triggerChange(this.getSelectedItems(),e)},B.prototype.updateMainList=function(){var e=this.mainList.querySelectorAll(".e-list-item"),t=this.ulElement.querySelectorAll(".e-list-item"),i=e.length,s=t.length;if(this.selectionSettings.showCheckbox||1<document.querySelectorAll("ul").length||i!==s)for(var l=0,n=0,a=0;l<i;){if(this.value)for(;n<this.value.length;n++)e[l].getAttribute("data-value")===this.value[n]&&a++;!a&&this.selectionSettings.showCheckbox&&e[l].getElementsByClassName("e-frame")[0].classList.remove("e-check"),1<document.querySelectorAll("ul").length&&a&&i!==s?(this.mainList.removeChild(this.mainList.getElementsByTagName("li")[l]),l=0):l++,n=a=0}},B.prototype.wireEvents=function(){var e=P.closest(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;P.EventHandler.add(this.list,"click",this.clickHandler,this),P.EventHandler.add(t,"keydown",this.keyDownHandler,this),P.EventHandler.add(t,"focusout",this.focusOutHandler,this),this.wireToolbarEvent(),this.selectionSettings.showCheckbox&&P.EventHandler.remove(document,"mousedown",this.checkBoxSelectionModule.onDocumentClick),(this.fields.groupBy||this.element.querySelector("select>optgroup"))&&P.EventHandler.remove(this.list,"scroll",this.setFloatingHeader),e&&P.EventHandler.add(e,"reset",this.formResetHandler,this),window.addEventListener("resize",this.resizeHandler.bind(this))},B.prototype.wireToolbarEvent=function(){this.toolbarSettings.items.length&&P.EventHandler.add(this.getToolElem(),"click",this.toolbarClickHandler,this)},B.prototype.unwireEvents=function(){var e=P.closest(this.element,"form"),t="EJS-LISTBOX"===this.element.tagName?this.element:this.list;P.EventHandler.remove(this.list,"click",this.clickHandler),P.EventHandler.remove(t,"keydown",this.keyDownHandler),P.EventHandler.remove(t,"focusout",this.focusOutHandler),this.allowFiltering&&this.clearFilterIconElem&&P.EventHandler.remove(this.clearFilterIconElem,"click",this.clearText),this.toolbarSettings.items.length&&P.EventHandler.remove(this.getToolElem(),"click",this.toolbarClickHandler),e&&P.EventHandler.remove(e,"reset",this.formResetHandler),window.removeEventListener("resize",this.resizeHandler.bind(this))},B.prototype.clickHandler=function(e){var t=P.closest(e.target,".e-list-item");P.isNullOrUndefined(t)||this.selectHandler(e)},B.prototype.checkSelectAll=function(){for(var e=0,t=this.list.querySelectorAll("li."+y.li),i=0;i<t.length;i++)t[i].classList.contains("e-disabled")||e++;var s=this.getSelectedItems().length;this.showSelectAll&&e&&this.notify("checkSelectAll",{module:"CheckBoxSelection",value:e===s?"check":0===s?"uncheck":"indeterminate"})},B.prototype.getQuery=function(e){var t,i,s=e?e.clone():this.query?this.query.clone():new c.Query;return this.allowFiltering?(t=""===this.inputString?"contains":this.filterType,null===(i=this.typeOfData(this.dataSource).typeof)&&(i=this.typeOfData(this.jsonData).typeof),(this.dataSource instanceof c.DataManager||"string"!==i)&&"number"!==i?(i=this.fields.text||"",s.where(i,t,this.inputString,this.ignoreCase,this.ignoreAccent)):s.where("",t,this.inputString,this.ignoreCase,this.ignoreAccent)):s=e||this.query||new c.Query,s},B.prototype.setFiltering=function(){var e;if(this.initLoad||P.isNullOrUndefined(this.filterParent))return this.filterParent=this.createElement("span",{className:Mt.filterParent}),this.filterInput=this.createElement("input",{attrs:{type:"text"},className:Mt.filterInput}),this.element.parentNode.insertBefore(this.filterInput,this.element),e=h.Input.createInput({element:this.filterInput,buttons:[Mt.filterBarClearIcon],properties:{placeholder:this.filterBarPlaceholder}},this.createElement),P.append([e.container],this.filterParent),P.prepend([this.filterParent],this.list),P.attributes(this.filterInput,{"aria-disabled":"false","aria-label":"search list item",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false",role:"textbox"}),this.height.toString().indexOf("%")<0?P.addClass([this.list],"e-filter-list"):0<this.height.toString().indexOf("%")&&(this.ulElement.style.height=this.ulElement.offsetHeight-this.filterParent.offsetHeight+"px"),this.inputString=this.filterInput.value,this.filterWireEvents(),this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important"),e},B.prototype.filterWireEvents=function(e){e&&(this.filterInput=e.querySelector(".e-input-filter")),this.clearFilterIconElem=this.filterInput.parentElement.querySelector("."+Mt.clearIcon),this.clearFilterIconElem&&(P.EventHandler.add(this.clearFilterIconElem,"click",this.clearText,this),e||(this.clearFilterIconElem.style.visibility="hidden")),P.EventHandler.add(this.filterInput,"input",this.onInput,this),P.EventHandler.add(this.filterInput,"keyup",this.KeyUp,this),P.EventHandler.add(this.filterInput,"keydown",this.onKeyDown,this)},B.prototype.selectHandler=function(e,t){var i,s,l=!0,n=P.closest(e.target,".e-list-item"),a=[n];n&&n.parentElement&&(s=[].slice.call(n.parentElement.children).indexOf(n),this.selectionSettings.showCheckbox?l=!n.getElementsByClassName("e-frame")[0].classList.contains("e-check"):(e.ctrlKey||e.metaKey||P.Browser.isDevice)&&this.isSelected(n)?(n.classList.remove(U.cssClass.selected),n.removeAttribute("aria-selected"),l=!1):"Multiple"===this.selectionSettings.mode&&(e.ctrlKey||e.metaKey||P.Browser.isDevice)||(this.getSelectedItems().forEach(function(e){e.removeAttribute("aria-selected")}),P.removeClass(this.getSelectedItems(),U.cssClass.selected)),e.shiftKey&&!this.selectionSettings.showCheckbox&&"Single"!==this.selectionSettings.mode?a=[].slice.call(n.parentElement.children).slice(Math.min(s,this.prevSelIdx),Math.max(s,this.prevSelIdx)+1).filter(function(e){return e.classList.contains("e-list-item")}):this.prevSelIdx=[].slice.call(n.parentElement.children).indexOf(n),l?(this.selectionSettings.showCheckbox||P.addClass(a,U.cssClass.selected),a.forEach(function(e){e.setAttribute("aria-selected","true")}),this.list.setAttribute("aria-activedescendant",n.id)):a.forEach(function(e){e.setAttribute("aria-selected","false")}),t||!(this.maximumSelectionLength>(this.value&&this.value.length))&&l||!(this.maximumSelectionLength>=(this.value&&this.value.length))&&l||this.maximumSelectionLength<(this.value&&this.value.length)||this.notify("updatelist",{li:n,e:e,module:"listbox"}),this.allowFiltering&&!t&&(i=this.getFormattedValue(n.getAttribute("data-value")),l?(P.extend(s=[],this.value),s.push(i),this.value=s):this.value=this.value.filter(function(e){return e!==i}),document.querySelectorAll("ul").length<2)&&this.updateMainList(),this.updateSelectedOptions(),this.triggerChange(this.getSelectedItems(),e),this.list)&&this.checkMaxSelection()},B.prototype.triggerChange=function(e,t){this.trigger("change",{elements:e,items:this.getDataByElements(e),value:this.value,event:t})},B.prototype.getDataByElems=function(e){for(var t=[],i=e.length,s=0;s<i;s++){var l=e[s].getAttribute("data-value"),l=this.getFormattedValue(l);t.push(this.getDataByValue(l))}return t},B.prototype.getDataByElements=function(e){var t,i=[],s=0;if(P.isNullOrUndefined(this.listData))return null;var l=this.typeOfData(this.listData).typeof;if("string"===l||"number"===l||"boolean"===l)for(var n=0,a=this.listData;n<a.length;n++){for(var o=a[n],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!P.isNullOrUndefined(o)&&o===t){s=r,i.push(o);break}if(e.length===i.length)break}else for(var u=0,p=this.listData;u<p.length;u++){for(o=p[u],r=s,h=e.length;r<h;r++)if(t=this.getFormattedValue(e[r].getAttribute("data-value")),!P.isNullOrUndefined(o)&&P.getValue(this.fields.value||"value",o)===t){s=r,i.push(o);break}if(e.length===i.length)break}return i},B.prototype.checkMaxSelection=function(){var e=this.list.querySelectorAll(".e-list-item span.e-check").length;if(this.selectionSettings.showCheckbox)for(var t=0,i=this.list.getElementsByClassName("e-list-item");t<i.length;t++)i[t].querySelector(".e-frame.e-check")||(e===this.maximumSelectionLength?i[t].classList.add("e-disable"):i[t].classList.contains("e-disable")&&i[t].classList.remove("e-disable"))},B.prototype.toolbarClickHandler=function(e){e=P.closest(e.target,"button");if(e&&(this.toolbarAction=e.getAttribute("data-value"),!e.disabled))switch(this.toolbarAction){case"moveUp":this.moveUpDown(!0);break;case"moveDown":this.moveUpDown();break;case"moveTo":this.moveItemTo();break;case"moveFrom":this.moveItemFrom();break;case"moveAllTo":this.moveAllItemTo();break;case"moveAllFrom":this.moveAllItemFrom();break;default:this.trigger("actionBegin",{cancel:!1,items:this.getDataByElems(this.getSelectedItems()),eventName:this.toolbarAction})}},B.prototype.moveUpDown=function(s,e,t,l,n){var i,a=this,o=this.getSelectedItems();t&&(o=t),(s&&this.isSelected(this.ulElement.firstElementChild)||!s&&this.isSelected(this.ulElement.lastElementChild))&&!t||(i={cancel:!1,items:t=this.getDataByElems(o),eventName:this.toolbarAction},this.trigger("actionBegin",i),i.cancel)||((s?o:o.reverse()).forEach(function(e){var t=Array.prototype.indexOf.call(a.ulElement.querySelectorAll(".e-list-item"),e),i=Array.prototype.indexOf.call(a.ulElement.children,e);l?(U.moveTo(a.ulElement,a.ulElement,[i],0),a.changeData(i,0,t,e)):n?(U.moveTo(a.ulElement,a.ulElement,[i],a.ulElement.querySelectorAll(".e-list-item").length),a.changeData(i,a.ulElement.querySelectorAll(".e-list-item").length,t,e)):(U.moveTo(a.ulElement,a.ulElement,[i],s?i-1:i+2),a.changeData(i,s?i-1:i+1,s?t-1:t+1,e))}),this.trigger("actionComplete",{items:t,eventName:this.toolbarAction}),o[0].focus(),!e&&this.toolbarSettings.items.length&&this.getToolElem().querySelector("[data-value="+(s?"moveUp":"moveDown")+"]").focus(),this.updateToolBarState())},B.prototype.moveItemTo=function(){this.moveData(this,this.getScopedListBox())},B.prototype.moveItemFrom=function(){this.moveData(this.getScopedListBox(),this)},B.prototype.moveData=function(i,e,t,s,l){var n=[],a=[],o=[],r=[],h=[].slice.call(i.listData),u=[].slice.call(e.listData),p=[].slice.call(i.sortedData),d=[].slice.call(e.sortedData),c=[].slice.call(i.liCollections),m=[],f=[].slice.call(e.liCollections),v=[],g=[],y=i.getSelectedItems(),s=(s&&(y=s),"None"!==e.sortOrder||e.selectionSettings.showCheckbox!==i.selectionSettings.showCheckbox||e.fields.groupBy||e.itemTemplate||i.itemTemplate);if(i.value=[],y.length){this.removeSelected(i,y);var C,b=Array.prototype.slice.call(i.ulElement.children),S=Array.prototype.slice.call(i.ulElement.querySelectorAll(".e-list-item")),E=i.listData,x=i.sortedData,I=i.jsonData,w={};if(199<y.length)for(var O=0,A=i.listData;O<A.length;O++){var D,k=A[O];P.isNullOrUndefined(k)||(D=i.getFormattedValue(P.getValue(i.fields.value||"value",k)),w[D]=k)}y.forEach(function(e){var t;C=y.length<200?i.getDataByElems([e])[0]:(t=e.getAttribute("data-value"),t=i.getFormattedValue(t),w[t]),n.push(b.indexOf(e)),m.push(S.indexOf(e)),a.push(E.indexOf(C)),r.push(x.indexOf(C)),o.push(I.indexOf(C))}),"None"!==this.sortOrder?r.forEach(function(e){v.push(i.sortedData[e])}):o.forEach(function(e){v.push(i.jsonData[e])});var N={cancel:!1,items:v,eventName:this.toolbarAction};if(i.trigger("actionBegin",N),N.cancel)return;var L=[],B=(m.sort(function(e,t){return e-t}).reverse().forEach(function(e){L.push(c.splice(e,1)[0])}),i.liCollections=c,l?(N=f.splice(0,l),e.liCollections=N.concat(L.reverse()).concat(f)):e.liCollections=f.concat(L.reverse()),0===e.listData.length&&(N=e.ulElement.childNodes[0])&&e.ulElement.removeChild(N),a.sort(function(e,t){return t-e}).forEach(function(e){h.splice(e,1)[0]}),r.sort(function(e,t){return t-e}).forEach(function(e){p.splice(e,1)[0]}),o.slice().reverse().forEach(function(e){g.push(i.jsonData.splice(e,1)[0])}),s?i.fields.groupBy?(T=i.renderItems(h,i.fields),i.updateListItems(T,i.ulElement)):y.forEach(function(e){P.detach(e)}):(U.moveTo(i.ulElement,e.ulElement,n,l),i.trigger("actionComplete",{items:v,eventName:this.toolbarAction})),e.mainList.childElementCount!==e.jsonData.length&&(e.mainList=e.ulElement),[].slice.call(e.jsonData)),d=[].slice.call(e.sortedData);this.selectNextList(y,m,a,i),t&&this.list.focus(),i.listData=h,i.sortedData=p,l=l||u.length;for(var T,V=v.length-1;0<=V;V--)u.splice(l,0,v[V]),B.splice(l,0,v[V]),d.splice(l,0,v[V]);e.listData=u,e.jsonData=B,e.sortedData=d,s&&(T=e.renderItems(u,e.fields),e.updateListItems(T,e.ulElement),e.setSelection(),i.trigger("actionComplete",{items:v,eventName:this.toolbarAction})),i.updateSelectedOptions(),0===i.listData.length&&i.l10nUpdate()}1===i.value.length&&i.getSelectedItems().length&&(i.value[0]=i.getFormattedValue(i.getSelectedItems()[0].getAttribute("data-value"))),i.liCollections.length===i.ulElement.querySelectorAll(".e-disabled").length&&this.toolbarAction&&(f=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],N="moveFrom"===this.toolbarAction?"moveAllFrom":"moveAllTo",f)&&(f.querySelector('[data-value="'+N+'"]').disabled=!0)},B.prototype.selectNextList=function(e,t,i,s){var l=s.ulElement.querySelectorAll(".e-list-item").length;1===e.length&&l&&!s.selectionSettings.showCheckbox&&(e=l<=t[0]?l-1:t[0],t=s.ulElement.querySelectorAll(".e-list-item")[e],-1<(t=s.getValidIndex(t,e,l===i[0]?38:40)))&&s.ulElement.querySelectorAll(".e-list-item")[t].classList.add(U.cssClass.selected)},B.prototype.moveAllItemTo=function(){this.moveAllData(this,this.getScopedListBox())},B.prototype.moveAllItemFrom=function(){this.moveAllData(this.getScopedListBox(),this)},B.prototype.moveAllData=function(e,t,i,s){var l=[].slice.call(t.listData),n=[].slice.call(t.jsonData),a="None"!==t.sortOrder||t.selectionSettings.showCheckbox!==e.selectionSettings.showCheckbox||t.fields.groupBy||t.itemTemplate||e.itemTemplate,o=[],r=[],h=[],u=(this.removeSelected(e,e.getSelectedItems()),[].slice.call(e.listData)),p={cancel:!1,items:u,eventName:this.toolbarAction};if(e.trigger("actionBegin",p),!p.cancel){0===t.listData.length&&(p=t.ulElement.childNodes[0])&&t.ulElement.removeChild(p),0<e.listData.length&&(h=Array.apply(null,{length:e.ulElement.childElementCount}).map(Number.call,Number));for(var d=e.ulElement.childNodes,c=e.ulElement.childElementCount,m=[],f=0;f<c;f++){var v=d[f];v.classList.contains("e-disabled")?(o.push(v),null!=this.sortOrder?r.push(e.sortedData[f]):r.push(e.listData[f])):m.push(f)}U.moveTo(e.ulElement,t.ulElement,h=m,s),e.trigger("actionComplete",{items:u,eventName:this.toolbarAction}),i&&this.list.focus(),s=s||l.length;for(f=0;f<h.length;f++)null!=this.sortOrder?l.splice(s+f,0,e.sortedData[h[f]]):l.splice(s+f,0,e.listData[h[f]]);for(f=0;f<h.length;f++)n.splice(s+f,0,e.jsonData[h[f]]);for(var p=[],u=(0<o.length?(e.liCollections=o,p=[].slice.call(e.liCollections)):(p=[].slice.call(e.liCollections),e.liCollections=[]),[].slice.call(t.liCollections)),g=(s?(i=u.splice(0,s),t.liCollections=i.concat(p).concat(u)):t.liCollections=u.concat(p),e.value=[],(l=(l=l.filter(function(e){return void 0!==e})).filter(function(e){return!0!==e.isHeader})).filter(function(e){return-1===t.jsonData.indexOf(e)})),f=0;f<g.length;f++)t.jsonData.splice(s+f,0,g[f]);if(t.listData=l,e.listData.length===e.jsonData.length)e.listData=e.sortedData=e.jsonData=r;else if(e.allowFiltering){var y=[];if(0<o.length){for(f=0;f<o.length;f++)y.push(e.getDataByValue(o[f].getAttribute("data-value")));e.listData=e.listData.filter(function(t){return!y.some(function(e){return t===e})})}for(f=0;f<e.listData.length;f++)for(var C=0;C<e.jsonData.length;C++)e.listData[f]===e.jsonData[C]&&e.jsonData.splice(C,1);0<o.length?(e.listData=y,e.sortedData=[]):e.listData=e.sortedData=[]}a?(i=t.renderItems(l,t.fields),t.updateListItems(i,t.ulElement)):t.sortedData=l,e.updateSelectedOptions(),0<o.length&&(this.list.parentElement.getElementsByClassName("e-listbox-tool")[0].querySelector('[data-value="'+this.toolbarAction+'"]').disabled=!0),0===e.listData.length&&0===o.length&&e.l10nUpdate()}},B.prototype.changeData=function(e,t,i,s){var l=[].slice.call(this.listData),n=[].slice.call(this.jsonData),a=[].slice.call(this.sortedData),o=Array.prototype.indexOf.call(this.jsonData,this.getDataByElems([s])[0]),s=Array.prototype.indexOf.call(this.sortedData,this.getDataByElems([s])[0]),r=[].slice.call(this.liCollections);l.splice(t,0,l.splice(e,1)[0]),n.splice(i,0,n.splice(o,1)[0]),a.splice(t,0,a.splice(s,1)[0]),r.splice(t,0,r.splice(e,1)[0]),this.listData=l,this.jsonData=n,this.liCollections=r,this.sortedData=a},B.prototype.getSelectedItems=function(){var t=[];return this.selectionSettings.showCheckbox?[].slice.call(this.ulElement.getElementsByClassName("e-check")).forEach(function(e){t.push(P.closest(e,".e-list-item"))}):t=[].slice.call(this.ulElement.getElementsByClassName(U.cssClass.selected)),t},B.prototype.getScopedListBox=function(){var t,i=this;return this.scope&&[].slice.call(document.querySelectorAll(this.scope)).forEach(function(e){P.getComponent(e,i.getModuleName())&&(t=P.getComponent(e,i.getModuleName()))}),t},B.prototype.getGrabbedItems=function(e){for(var t=!1,i=0;i<this.value.length;i++)if(this.value[i]===this.getFormattedValue(e.target.getAttribute("data-value"))){t=!0;break}if(t)for(i=0;i<this.value.length;i++)for(var s=this.list.querySelectorAll('[aria-selected="true"]'),l=0;l<s.length;l++)this.value[i]===this.getFormattedValue(s[l].getAttribute("data-value"))&&s[l].classList.add("e-grabbed");return this.isAngular?Array.prototype.slice.call(this.element.getElementsByClassName("e-list-parent")[0].querySelectorAll(".e-grabbed")):Array.prototype.slice.call(this.element.nextElementSibling.querySelectorAll(".e-grabbed"))},B.prototype.getDragArgs=function(e,t){var i=this.getGrabbedItems(e);return i.length?t&&i.push(e.target):i=[e.target],{elements:i,event:e.event,items:this.getDataByElems(i)}},B.prototype.onKeyDown=function(e){this.keyDownHandler(e),e.stopPropagation()},B.prototype.keyDownHandler=function(e){var t;-1<[32,35,36,37,38,39,40,65].indexOf(e.keyCode)&&(!this.allowFiltering||this.allowFiltering&&e.target!==this.filterInput)?e.target&&-1<e.target.className.indexOf("e-edit-template")||(e.preventDefault(),32===e.keyCode&&this.ulElement.children.length?this.selectHandler({target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey}):65===e.keyCode&&e.ctrlKey&&"Multiple"===this.selectionSettings.mode?this.selectAll():(38===e.keyCode||40===e.keyCode)&&e.ctrlKey&&e.shiftKey?this.moveUpDown(38===e.keyCode,!0):!this.toolbarSettings.items.length&&!this.tBListBox||39!==e.keyCode&&37!==e.keyCode||!e.ctrlKey?37!==e.keyCode&&39!==e.keyCode&&"KeyA"!==e.code&&this.upDownKeyHandler(e):(t=this.tBListBox||this.getScopedListBox(),39===e.keyCode?e.shiftKey?this.moveAllData(this,t,!0):this.moveData(this,t,!0):e.shiftKey?this.moveAllData(t,this,!0):this.moveData(t,this,!0))):!this.allowFiltering||40!==e.keyCode&&38!==e.keyCode||this.upDownKeyHandler(e)},B.prototype.upDownKeyHandler=function(e){var t=this.ulElement,i=40===e.keyCode||36===e.keyCode?0:t.childElementCount-1,s=t.getElementsByClassName("e-focused")[0]||t.getElementsByClassName(U.cssClass.selected)[0];if(s){if(35!==e.keyCode&&36!==e.keyCode&&(i=Array.prototype.indexOf.call(t.children,s),40===e.keyCode?i++:i--,i<0||i>t.childElementCount-1))return;P.removeClass([s],"e-focused")}var l=t.children[i];if(l)if(-1===(i=this.getValidIndex(l,i,e.keyCode)))P.addClass([s],"e-focused");else if(t.children[i].focus(),t.children[i].classList.add("e-focused"),e.ctrlKey&&(this.selectionSettings.showCheckbox||!e.shiftKey||36!==e.keyCode&&35!==e.keyCode)||this.selectHandler({target:t.children[i],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},!0),this.selectionSettings.showCheckbox&&e.ctrlKey&&e.shiftKey&&(36===e.keyCode||35===e.keyCode))for(var l=Array.prototype.indexOf.call(t.children,s),i="Home"===e.code?0:l,n="Home"===e.code?l:t.children.length-1,a=i;a<=n;a++){var o=t.children[a];this.notify("updatelist",{li:o,e:{target:this.ulElement.getElementsByClassName("e-focused")[0],ctrlKey:e.ctrlKey,shiftKey:e.shiftKey},module:"listbox"})}},B.prototype.KeyUp=function(e){var t,i,s,l=this;this.allowFiltering&&e.ctrlKey&&65===e.keyCode?e.preventDefault():(t=(i=String.fromCharCode(e.keyCode)).match(/\w/),i=i.match(/[A-Za-z0-9\u00C0-\u024F ]/),P.isNullOrUndefined(t)&&P.isNullOrUndefined(i)||(this.isValidKey=!0),this.isBackSpace=8===e.keyCode,this.isValidKey=8===e.keyCode||46===e.keyCode||this.isValidKey,this.isValidKey&&(this.isValidKey=!1,e.keyCode,this.allowFiltering)&&(s={preventDefaultAction:!1,text:this.targetElement(),updateData:function(e,t,i){s.cancel||(l.isFiltered=!0,l.remoteFilterAction=!0,l.preventDefActionFilter=s.preventDefaultAction,l.dataUpdater(e,t,i),l.preventDefActionFilter=!1)},event:e,cancel:!1},this.trigger("filtering",s,function(e){l.isDataFetched=!1,e.cancel||""!==l.filterInput.value&&l.isFiltered||(l.preventDefActionFilter=!1,e.cancel||l.isCustomFiltering||e.preventDefaultAction||(l.inputString=l.filterInput.value,l.filteringAction(l.jsonData,new c.Query,l.fields),0<l.toolbarSettings.items.length&&l.updateToolBarState()),l.isFiltered)||l.isCustomFiltering||e.preventDefaultAction||l.dataUpdater(l.jsonData,new c.Query,l.fields)})))},B.prototype.filter=function(e,t,i){this.isCustomFiltering=!0,this.filteringAction(e,t,i)},B.prototype.filteringAction=function(e,t,i){this.resetList(e,i,t)},B.prototype.targetElement=function(){return this.targetInputElement=this.list.getElementsByClassName("e-input-filter")[0],P.isNullOrUndefined(this.targetInputElement)?null:this.targetInputElement.value},B.prototype.dataUpdater=function(e,t,i){var s;this.isDataFetched=!1,this.targetElement()&&""===this.targetElement().trim()?(s=this.mainList.cloneNode?this.mainList.cloneNode(!0):this.mainList,this.remoteCustomValue=!1,this.isAngular&&this.itemTemplate&&(s=this.renderItems(this.listData,i)),this.onActionComplete(s,this.jsonData),this.notify("reOrder",{module:"CheckBoxSelection",enable:this.selectionSettings.showCheckbox,e:this})):this.resetList(e,i,t)},B.prototype.focusOutHandler=function(){var e=this.list.getElementsByClassName("e-focused")[0];e&&e.classList.remove("e-focused"),this.allowFiltering&&this.refreshClearIcon()},B.prototype.resizeHandler=function(){!this.list||this.cssClass&&-1<this.cssClass.indexOf("e-horizontal-listbox")||0<this.list.getElementsByClassName("e-filter-parent").length&&this.allowFiltering&&this.ulElement.style.setProperty("height","calc(100% - "+this.filterParent.offsetHeight+"px)","important")},B.prototype.getValidIndex=function(e,t,i){var s=this.ulElement;return(e.classList.contains("e-disabled")||e.classList.contains(U.cssClass.group))&&(40===i||36===i?t++:t--),t<0||t===s.childElementCount?-1:(e=s.childNodes[t]).classList.contains("e-disabled")||e.classList.contains(U.cssClass.group)?this.getValidIndex(e,t,i):t},B.prototype.updateSelectedOptions=function(){var t=this,i=[],e=[];if(P.extend(e,this.value),this.getSelectedItems().forEach(function(e){e.classList.contains("e-grabbed")||i.push(t.getFormattedValue(e.getAttribute("data-value")))}),this.mainList.childElementCount===this.ulElement.childElementCount)if(this.allowFiltering&&this.selectionSettings.showCheckbox){for(var s=0;s<i.length;s++)-1<e.indexOf(i[s])||e.push(i[s]);this.setProperties({value:e},!0)}else this.setProperties({value:i},!0);this.updateSelectTag(),this.updateToolBarState(),this.tBListBox&&this.tBListBox.updateToolBarState()},B.prototype.clearSelection=function(t){var i,s=this;void 0===t&&(t=this.value),this.selectionSettings.showCheckbox&&this.getSelectedItems().forEach(function(e){i=s.getFormattedValue(e.getAttribute("data-value")),t.indexOf(i)<0&&(e.getElementsByClassName("e-check")[0].classList.remove("e-check"),e.removeAttribute("aria-selected"))})},B.prototype.setSelection=function(e,t,i,s){var l,n,a=this;void 0===e&&(e=this.value),void 0===t&&(t=!0),void 0===i&&(i=!1),void 0===s&&(s=!0),e&&e.forEach(function(e){e=i?a.getValueByText(e):e;(l="string"==typeof e?(e=e.split("\\").join("\\\\"),a.list.querySelector('[data-value="'+e.replace(/"/g,'\\"')+'"]')):a.list.querySelector('[data-value="'+e+'"]'))&&(n=a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?l.getElementsByClassName("e-frame")[0].classList.contains("e-check"):l.classList.contains("e-selected"),!t&&n||t&&!n&&l)&&(a.selectionSettings.showCheckbox&&!l.classList.contains("e-disabled")?(a.notify("updatelist",{li:l,module:"listbox"}),s&&l.focus()):t&&!l.classList.contains("e-disabled")?(l.classList.add(U.cssClass.selected),l.setAttribute("aria-selected","true"),s&&l.focus()):(l.classList.remove(U.cssClass.selected),l.removeAttribute("aria-selected")))}),this.updateSelectTag()},B.prototype.updateSelectTag=function(){var e=this.getSelectTag(),t="";if(!P.isNullOrUndefined(e)){if(e.innerHTML="",this.value){for(var i=0,s=this.value.length;i<s;i++)t+="<option selected>"+this.value[i]+"</option>";e.innerHTML+=t;for(i=0,s=e.childNodes.length;i<s;i++)e.childNodes[i].setAttribute("value",this.value[i].toString())}this.checkSelectAll()}},B.prototype.checkDisabledState=function(e){return P.isNullOrUndefined(e.ulElement)?!(!P.isNullOrUndefined(this.dataSource)&&P.isNullOrUndefined(this.dataSource.length)):0<e.ulElement.querySelectorAll(".e-disabled").length?e.liCollections.length===e.ulElement.querySelectorAll(".e-disabled").length:0===e.ulElement.querySelectorAll("."+U.cssClass.li).length},B.prototype.updateToolBarState=function(){var i,s,l=this;this.toolbarSettings.items.length&&(i=this.getScopedListBox(),s=this.list.parentElement.getElementsByClassName("e-listbox-tool")[0],this.toolbarSettings.items.forEach(function(e){var t=s.querySelector('[data-value="'+e+'"]');switch(e){case"moveAllTo":t.disabled=l.checkDisabledState(l);break;case"moveAllFrom":t.disabled=l.checkDisabledState(i);break;case"moveFrom":t.disabled=!i.value||!i.value.length;break;case"moveUp":t.disabled=!(l.value&&l.value.length&&!l.isSelected(l.ulElement.children[0]));break;case"moveDown":t.disabled=!(l.value&&l.value.length&&!l.isSelected(l.ulElement.children[l.ulElement.childElementCount-1]));break;default:t.disabled=!l.value||!l.value.length}}))},B.prototype.setCheckboxPosition=function(){var e=this.list;this.initLoad||"Left"!==this.selectionSettings.checkboxPosition||e.classList.remove("e-right"),"Right"===this.selectionSettings.checkboxPosition&&e.classList.add("e-right")},B.prototype.showCheckbox=function(e){var t=0,i=this.list.lastElementChild.querySelectorAll("li"),s=this.list.lastElementChild.getElementsByClassName("e-list-item").length;if(e)this.ulElement=this.renderItems(this.listData,this.fields),this.mainList=this.ulElement,this.list.removeChild(this.list.getElementsByTagName("ul")[0]),this.list.appendChild(this.ulElement),this.selectionSettings.showSelectAll&&!this.list.getElementsByClassName("e-selectall-parent")[0]&&(e=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.showSelectAll=!0,this.selectAllText=e.getConstant("selectAllText"),this.unSelectAllText=e.getConstant("unSelectAllText"),this.popupWrapper=this.list,this.checkBoxSelectionModule.checkAllParent=null,this.notify("selectAll",{}),this.checkSelectAll());else{for(this.list.getElementsByClassName("e-selectall-parent")[0]&&this.list.removeChild(this.list.getElementsByClassName("e-selectall-parent")[0]);t<s;t++)i[t].classList.contains("e-list-item")&&i[t].removeChild(i[t].getElementsByClassName("e-checkbox-wrapper")[0]),i[t].hasAttribute("aria-selected")&&i[t].removeAttribute("aria-selected");this.mainList=this.ulElement}this.value=[]},B.prototype.isSelected=function(e){return!P.isNullOrUndefined(e)&&(e.classList.contains(U.cssClass.selected)||null!==e.querySelector(".e-check"))},B.prototype.getSelectTag=function(){return this.list.getElementsByClassName("e-hidden-select")[0]},B.prototype.getToolElem=function(){return this.list.parentElement.getElementsByClassName("e-listbox-tool")[0]},B.prototype.formResetHandler=function(){this.value=this.initialSelectedOptions},B.prototype.getModuleName=function(){return"listbox"},B.prototype.getPersistData=function(){return this.addOnPersist(["value"])},B.prototype.getLocaleName=function(){return"listbox"},B.prototype.destroy=function(){this.unwireEvents(),"EJS-LISTBOX"===this.element.tagName?this.element.innerHTML="":(this.element.style.display="inline-block",this.toolbarSettings.items.length&&(this.list.parentElement.parentElement.insertBefore(this.list,this.list.parentElement),P.detach(this.list.nextElementSibling)),this.list.parentElement.insertBefore(this.element,this.list)),Wt.prototype.destroy.call(this),this.enableRtlElements=[],this.liCollections=null,this.list=null,this.ulElement=null,this.mainList=null,this.spinner=null,this.rippleFun=null,this.itemTemplate&&this.clearTemplate()},B.prototype.onPropertyChanged=function(e,t){var i=this.toolbarSettings.items.length?this.list.parentElement:this.list;Wt.prototype.onPropertyChanged.call(this,e,t),this.setUpdateInitial(["fields","query","dataSource"],e);for(var s=0,l=Object.keys(e);s<l.length;s++)switch(l[s]){case"cssClass":t.cssClass&&P.removeClass([i],t.cssClass.split(" ")),e.cssClass&&P.addClass([i],e.cssClass.replace(/\s+/g," ").trim().split(" "));break;case"enableRtl":e.enableRtl?this.list.classList.add("e-rtl"):this.list.classList.remove("e-rtl");break;case"value":P.removeClass(this.list.querySelectorAll("."+U.cssClass.selected),U.cssClass.selected),this.clearSelection(this.value),this.setSelection();break;case"height":this.setHeight();break;case"enabled":this.setEnable();break;case"allowDragAndDrop":e.allowDragAndDrop?this.initDraggable():this.ulElement.classList.contains("e-sortable")&&P.getComponent(this.ulElement,"sortable").destroy();break;case"allowFiltering":this.allowFiltering?this.setFiltering():(this.list.removeChild(this.list.getElementsByClassName("e-filter-parent")[0]),this.filterParent=null,P.removeClass([this.list],"e-filter-list"));break;case"filterBarPlaceholder":this.allowFiltering&&this.filterInput&&h.Input.setPlaceholder(e.filterBarPlaceholder,this.filterInput);break;case"scope":this.allowDragAndDrop&&(P.getComponent(this.ulElement,"sortable").scope=e.scope),this.toolbarSettings.items.length&&(t.scope&&(P.getComponent(document.querySelector(t.scope),this.getModuleName()).tBListBox=null),e.scope)&&(P.getComponent(document.querySelector(e.scope),this.getModuleName()).tBListBox=this);break;case"toolbarSettings":var n=void 0,a=e.toolbarSettings.position,o=this.getToolElem();a&&(P.removeClass([i],["e-right","e-left"]),i.classList.add("e-"+a.toLowerCase()),"Left"===a?i.insertBefore(o,this.list):i.appendChild(o)),e.toolbarSettings.items&&(t.toolbarSettings.items=P.isNullOrUndefined(t.toolbarSettings.items)?[]:t.toolbarSettings.items,t.toolbarSettings&&t.toolbarSettings.items.length&&((n=this.list.parentElement).parentElement.insertBefore(this.list,n),P.detach(n)),this.initToolbarAndStyles(),this.wireToolbarEvent());break;case"selectionSettings":a=e.selectionSettings.showSelectAll,o=e.selectionSettings.showCheckbox;P.isNullOrUndefined(a)||(this.showSelectAll=a,this.showSelectAll&&(n=new P.L10n(this.getModuleName(),{selectAllText:"Select All",unSelectAllText:"Unselect All"},this.locale),this.checkBoxSelectionModule.checkAllParent=null,this.showSelectAll=!0,this.selectAllText=n.getConstant("selectAllText"),this.unSelectAllText=n.getConstant("selectAllText"),this.popupWrapper=this.list),this.notify("selectAll",{}),this.checkSelectAll()),P.isNullOrUndefined(o)||this.showCheckbox(o),this.selectionSettings.showCheckbox&&this.setCheckboxPosition();break;case"dataSource":this.isDataSourceUpdate=!0,this.jsonData=[].slice.call(this.dataSource)}},L([P.Property("")],B.prototype,"cssClass",void 0),L([P.Property([])],B.prototype,"value",void 0),L([P.Property("")],B.prototype,"height",void 0),L([P.Property(!0)],B.prototype,"enabled",void 0),L([P.Property(!1)],B.prototype,"enablePersistence",void 0),L([P.Property(!1)],B.prototype,"allowDragAndDrop",void 0),L([P.Property(1e3)],B.prototype,"maximumSelectionLength",void 0),L([P.Property(!1)],B.prototype,"allowFiltering",void 0),L([P.Property("")],B.prototype,"scope",void 0),L([P.Property(!0)],B.prototype,"ignoreCase",void 0),L([P.Property(null)],B.prototype,"filterBarPlaceholder",void 0),L([P.Property("None")],B.prototype,"sortOrder",void 0),L([P.Event()],B.prototype,"beforeItemRender",void 0),L([P.Event()],B.prototype,"filtering",void 0),L([P.Event()],B.prototype,"select",void 0),L([P.Event()],B.prototype,"change",void 0),L([P.Event()],B.prototype,"beforeDrop",void 0),L([P.Event()],B.prototype,"dragStart",void 0),L([P.Event()],B.prototype,"drag",void 0),L([P.Event()],B.prototype,"drop",void 0),L([P.Event()],B.prototype,"dataBound",void 0),L([P.Property(null)],B.prototype,"groupTemplate",void 0),L([P.Property("Request failed")],B.prototype,"actionFailureTemplate",void 0),L([P.Property(1e3)],B.prototype,"zIndex",void 0),L([P.Property(!1)],B.prototype,"ignoreAccent",void 0),L([P.Complex({},Ht)],B.prototype,"toolbarSettings",void 0),L([P.Complex({},Vt)],B.prototype,"selectionSettings",void 0);var Wt,qt,Tt=qt=L([P.NotifyPropertyChanges],B);function B(e,t){e=Wt.call(this,e,t)||this;return e.isValidKey=!1,e.isBackSpace=!1,e.isDataSourceUpdate=!1,e.keyDownStatus=!1,e}var Mt={backIcon:"e-input-group-icon e-back-icon e-icons",filterBarClearIcon:"e-input-group-icon e-clear-icon e-icons",filterInput:"e-input-filter",filterParent:"e-filter-parent",clearIcon:"e-clear-icon"};jt=function(e,t){return(jt=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 jt,Rt,L=function(e,t,i,s){var l,n=arguments.length,a=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,s);else for(var o=e.length-1;0<=o;o--)(l=e[o])&&(a=(n<3?l(a):3<n?l(t,i,a):l(t,i))||a);return 3<n&&a&&Object.defineProperty(t,i,a),a},L=(function(e,t){function i(){this.constructor=e}jt(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}(T,Rt=Z),T.prototype.onPropertyChanged=function(e,t){for(var i=0,s=Object.keys(e);i<s.length;i++)switch(s[i]){case"minLength":this.minLength=e.minLength;break;case"suffixText":this.suffixText=e.suffixText;break;case"allowSpaces":this.allowSpaces=e.allowSpaces;break;case"mentionChar":this.mentionChar=e.mentionChar;break;case"showMentionChar":this.showMentionChar=e.showMentionChar;break;case"requireLeadingSpace":this.requireLeadingSpace=e.requireLeadingSpace;break;case"cssClass":this.updateCssClass(e.cssClass,t.cssClass)}},T.prototype.updateCssClass=function(e,t){P.isNullOrUndefined(t)||(t=t.replace(/\s+/g," ").trim()),P.isNullOrUndefined(e)||(e=e.replace(/\s+/g," ").trim()),this.setCssClass(e,[this.inputElement],t),this.popupObj&&this.setCssClass(e,[this.popupObj.element],t)},T.prototype.setCssClass=function(e,t,i){P.isNullOrUndefined(i)||""===i||P.removeClass(t,i.split(" ")),P.isNullOrUndefined(e)||""===e||P.addClass(t,e.split(" "))},T.prototype.initializeData=function(){this.isSelected=!1,this.isFiltered=!1,this.beforePopupOpen=!1,this.initRemoteRender=!1,this.isListResetted=!1,this.isPopupOpen=!1,this.isCollided=!1,this.lineBreak=!1,this.isRTE=!1,this.keyEventName="mousedown"},T.prototype.preRender=function(){this.initializeData(),Rt.prototype.preRender.call(this)},T.prototype.render=function(){var e="string"==typeof this.target;this.inputElement=P.isNullOrUndefined(this.target)?this.element:this.checkAndUpdateInternalComponent(e?document.querySelector(this.target):this.target),this.isContentEditable(this.inputElement)&&(this.inputElement.hasAttribute("contenteditable")||this.inputElement.setAttribute("contenteditable","true"),P.addClass([this.inputElement],["e-mention"]),P.isNullOrUndefined(this.target))&&P.addClass([this.inputElement],["e-editable-element"]),this.inputElement.setAttribute("role","textbox"),this.inputElement.setAttribute("aria-label","mention"),this.queryString=this.elementValue(),this.wireEvent()},T.prototype.wireEvent=function(){P.EventHandler.add(this.inputElement,"keyup",this.onKeyUp,this),this.bindCommonEvent()},T.prototype.unWireEvent=function(){P.EventHandler.remove(this.inputElement,"keyup",this.onKeyUp),this.unBindCommonEvent()},T.prototype.bindCommonEvent=function(){P.Browser.isDevice||this.inputElement.addEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},T.prototype.hideSpinner=function(){this.hideWaitingSpinner()},T.prototype.hideWaitingSpinner=function(){P.isNullOrUndefined(this.spinnerElement)||o.hideSpinner(this.spinnerElement),P.isNullOrUndefined(this.spinnerTemplate)||P.isNullOrUndefined(this.spinnerTemplateElement)||P.detach(this.spinnerTemplateElement)},T.prototype.checkAndUpdateInternalComponent=function(e){if(!this.isVue&&e.classList.contains("e-richtexteditor"))return e.querySelector(".e-content");if(this.isVue&&"TEXTAREA"===e.nodeName&&e.classList.contains("e-rte-hidden")){var t=e.parentElement;if(t&&t.classList.contains("e-richtexteditor"))return t.querySelector(".e-content")}return e&&e.parentElement&&e.parentElement.classList.contains("e-rte-content")&&(this.isRTE=!0,this.keyEventName="click"),e},T.prototype.showWaitingSpinner=function(){P.isNullOrUndefined(this.popupObj)||(P.isNullOrUndefined(this.spinnerTemplate)&&P.isNullOrUndefined(this.spinnerElement)&&(this.spinnerElement=this.popupObj.element,o.createSpinner({target:this.spinnerElement,width:P.Browser.isDevice?"16px":"14px"},this.createElement),o.showSpinner(this.spinnerElement)),P.isNullOrUndefined(this.spinnerTemplate))||this.setSpinnerTemplate()},T.prototype.keyDownHandler=function(e){var t=!0;switch(e.keyCode){case 38:e.action=e.altKey?"hide":"up";break;case 40:e.action=e.altKey?"open":"down";break;case 33:e.action="pageUp";break;case 34:e.action="pageDown";break;case 36:e.action="home";break;case 35:e.action="end";break;case 9:e.action=e.shiftKey?"close":"tab";break;case 27:e.action="escape";break;case 32:e.action="space";break;case 13:e.action="enter";break;default:t=!1}t&&this.keyActionHandler(e)},T.prototype.keyActionHandler=function(e){var t,i="down"===e.action||"up"===e.action||"pageUp"===e.action||"pageDown"===e.action||"home"===e.action||"end"===e.action,s="tab"===e.action||"close"===e.action;if(void 0!==this.list||this.isRequested||s||"escape"===e.action||"space"===e.action||this.mentionChar.charCodeAt(0)!==this.getLastLetter(this.getTextRange()).charCodeAt(0)||this.renderList(),!(P.isNullOrUndefined(this.list)||!P.isNullOrUndefined(this.liCollections)&&i&&0===this.liCollections.length||this.isRequested))switch("escape"===e.action&&e.preventDefault(),this.isSelected="escape"!==e.action&&this.isSelected,e.action){case"down":case"up":this.isUpDownKey=!0,this.updateUpDownAction(e);break;case"tab":this.isPopupOpen&&(e.preventDefault(),(t=this.list.querySelector("."+y.selected))&&(this.isSelected=!0,this.setSelection(t,e)),this.isPopupOpen)&&this.hidePopup(e);break;case"enter":this.isPopupOpen&&(e.preventDefault(),this.popupObj)&&this.popupObj.element.contains(this.selectedLI)&&this.updateSelectedItem(this.selectedLI,e,!1,!0);break;case"escape":this.isPopupOpen&&this.hidePopup(e)}},T.prototype.updateUpDownAction=function(e){if(!this.fields.disabled||!this.list||0!==this.list.querySelectorAll(".e-list-item:not(.e-disabled)").length){var t,i=this.list.querySelector("."+y.focus);this.isSelectFocusItem(i)?this.setSelection(i,e):P.isNullOrUndefined(this.liCollections)||(i=this.list.querySelector("."+y.selected),P.isNullOrUndefined(i)||(i=this.getFormattedValue(i.getAttribute("data-value")),this.activeIndex=this.getIndexByValue(i)),s="down"===e.action?this.activeIndex+1:this.activeIndex-1,i=0,i="down"===e.action&&P.isNullOrUndefined(this.activeIndex)?0:this.liCollections.length-1,s=s<0?this.liCollections.length-1:s===this.liCollections.length?0:s,i=P.isNullOrUndefined(this.activeIndex)?this.liCollections[i]:this.liCollections[s],P.isNullOrUndefined(i))||this.setSelection(i,e);for(var s=0;s<this.liCollections.length;s++)if(this.liCollections[s].classList.contains(y.focus)||this.liCollections[s].classList.contains(y.selected)){t=s;break}null!=t&&this.isDisabledElement(this.liCollections[t])&&this.updateUpDownAction(e),this.isPopupOpen&&e.preventDefault()}},T.prototype.isSelectFocusItem=function(e){return!P.isNullOrUndefined(e)},T.prototype.unBindCommonEvent=function(){P.Browser.isDevice||this.inputElement.removeEventListener("keydown",this.keyDownHandler.bind(this),!this.isRTE)},T.prototype.onKeyUp=function(e){var t,i,s,l,n,a,o;this.isUpDownKey&&this.isPopupOpen&&229===e.keyCode?this.isUpDownKey=!1:(this.isTyped="Enter"!==e.code&&"Space"!==e.code&&"ArrowDown"!==e.code&&"ArrowUp"!==e.code,i=!(!document.activeElement.parentElement||!document.activeElement.parentElement.querySelector(".e-rte-image")),document.activeElement===this.inputElement||i||this.inputElement.focus(),this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange(),t=this.range.startContainer.textContent.split("")),i=this.getTextRange(),s=new RegExp(this.mentionChar.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\s"),s=!i||!s.test(i),l=this.getLastLetter(i),n=i?i.charAt(Math.max(0,i.indexOf(this.mentionChar)-1)):"",s&&this.allowSpaces&&i&&i.includes(this.mentionChar)&&""!==i.split(this.mentionChar).pop()&&(!this.requireLeadingSpace||this.requireLeadingSpace&&(" "===n||0===i.indexOf(this.mentionChar)))&&(l=this.mentionChar+i.split(this.mentionChar).pop()),!this.requireLeadingSpace&&l&&l.includes(this.mentionChar)&&(l=this.mentionChar+l.split(this.mentionChar).pop()),n=this.mentionChar.toString()+this.mentionChar.toString(),a=new RegExp(this.mentionChar.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),o=new RegExp("[a-zA-Z]","g"),"Shift"!==e.key&&37!==e.keyCode&&39!==e.keyCode&&(this.beforePopupOpen&&this.isPopupOpen&&l===n?this.hidePopup():!i||!l||!l.includes(this.mentionChar)&&!this.requireLeadingSpace||"Enter"===e.code||27===e.keyCode||l.match(a)&&1<l.match(a).length||this.isContentEditable(this.inputElement)&&this.range.startContainer&&this.range.startContainer.previousElementSibling&&"BR"!==this.range.startContainer.previousElementSibling.tagName&&0<this.range.startContainer.textContent.split("").length&&(1===t.length||-1===t[t.length-2].indexOf("")||1===this.range.startContainer.nodeType)?s&&this.isPopupOpen&&this.allowSpaces&&i&&""!==i.trim()&&o.test(i)&&-1!==i.indexOf(this.mentionChar)&&!this.isMatchedText()&&1<i.length&&" "!==i.replace(/\u00A0/g," ").charAt(i.length-2)&&this.list&&0<this.list.querySelectorAll("ul").length&&"Enter"!==e.code?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):this.requireLeadingSpace&&(!this.isPopupOpen||this.allowSpaces&&l||"ArrowDown"===e.code||"ArrowUp"===e.code)?"Backspace"!==e.key&&"Delete"!==e.key||!this.range||this.range.startOffset===this.range.endOffset||this.range.deleteContents():(this.hidePopup(),this.lineBreak=!0):(l.includes(this.mentionChar)&&(this.queryString=this.requireLeadingSpace?l.replace(this.mentionChar,""):l.substring(l.lastIndexOf(this.mentionChar)+1).trim()),this.mentionChar.charCodeAt(0)!==l.charCodeAt(0)||""===this.queryString||38===e.keyCode||40===e.keyCode||this.lineBreak?(this.requireLeadingSpace?0===l.indexOf(this.mentionChar):l.includes(this.mentionChar))&&!this.isPopupOpen&&8!==e.keyCode&&(!this.popupObj||P.isNullOrUndefined(this.target)&&!document.body.contains(this.popupObj.element)||!P.isNullOrUndefined(this.target)&&document.body.contains(this.popupObj.element))?(this.initRemoteRender&&this.list&&this.list.classList.contains("e-nodata")&&this.searchLists(e),this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)&&this.initValue(),!this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.queryString.length>=this.minLength&&(this.didPopupOpenByTypingInitialChar=!0,this.showPopup(),this.initRemoteRender&&0===this.list.querySelectorAll("li").length&&this.showWaitingSpinner(),this.lineBreak=!1)):this.allowSpaces&&""!==this.queryString&&i&&""!==i.trim()&&i.replace(" "," ").lastIndexOf(" ")<i.length-1&&38!==e.keyCode&&40!==e.keyCode&&8!==e.keyCode&&(this.mentionChar.charCodeAt(0)===l.charCodeAt(0)||this.liCollections&&0<this.liCollections.length)?(this.queryString=i.substring(i.lastIndexOf(this.mentionChar)+1).replace(" "," "),this.searchLists(e)):""===this.queryString&&this.isPopupOpen&&38!==e.keyCode&&40!==e.keyCode&&this.mentionChar.charCodeAt(0)===l.charCodeAt(0)&&(this.searchLists(e),this.isListResetted||this.resetList(this.dataSource,this.fields)):(this.searchLists(e),!this.isPopupOpen&&this.queryString.length>=this.minLength&&(!this.isContentEditable(this.inputElement)||this.isContentEditable(this.inputElement)&&this.range&&this.range.startContainer!==this.inputElement&&9!==e.keyCode)&&this.showPopup()),this.isListResetted=!1)))},T.prototype.isMatchedText=function(){for(var e=!1,t=0;t<(this.liCollections&&this.liCollections.length);t++)this.getTextRange()&&this.getTextRange().substring(this.getTextRange().lastIndexOf(this.mentionChar)+1).replace(" "," ").trim()===this.liCollections[t].getAttribute("data-value").toLowerCase()&&(e=!0);return e},T.prototype.getCurrentRange=function(){return this.range=this.inputElement.ownerDocument.getSelection().getRangeAt(0),this.range},T.prototype.searchLists=function(e){var s,l=this;this.isDataFetched=!1,P.isNullOrUndefined(this.list)&&(Rt.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()),"mousedown"===e.type||40!==e.keyCode&&38!==e.keyCode?(this.isSelected=!1,this.activeIndex=null,s={preventDefaultAction:!1,text:this.queryString,updateData:function(e,t,i){s.cancel||(l.isFiltered=!0,l.filterAction(e,t,i))},cancel:!1},this.trigger("filtering",s,function(e){e.cancel||l.isFiltered||e.preventDefaultAction||l.filterAction(l.dataSource,null,l.fields)})):(this.queryString=""===this.queryString?null:this.queryString,this.beforePopupOpen=!0,this.resetList(this.dataSource,this.fields))},T.prototype.filterAction=function(e,t,i){this.beforePopupOpen=!0,this.queryString.length>=this.minLength?(this.resetList(e,i,t),this.isListResetted=!0):(this.isPopupOpen&&this.hidePopup(),this.beforePopupOpen=!1),this.setDataIndex(),this.renderReactTemplates()},T.prototype.onActionComplete=function(e,t,i,s){Rt.prototype.onActionComplete.call(this,e,t,i),this.isActive&&(P.isNullOrUndefined(e)||(P.attributes(e,{id:this.inputElement.id+"_options",role:"listbox","aria-hidden":"false"}),this.isRTE&&this.cssClass&&-1<this.cssClass.indexOf("e-slash-menu")&&(e.id=this.inputElement.id+"_slash_menu_options")),(t=this.fields.disabled?e.querySelector("."+y.li+":not(.e-disabled)"):e.querySelector("."+y.li))&&(t.classList.add(y.selected),this.selectedLI=t,i=this.getFormattedValue(t.getAttribute("data-value")),this.selectEventCallback(t,this.getDataByValue(i),i,!0)),this.beforePopupOpen)&&this.isPopupOpen&&(P.isNullOrUndefined(this.popupObj.element)||this.popupObj.element.remove(),this.renderPopup())},T.prototype.setDataIndex=function(){for(var e=0;this.liCollections&&e<this.liCollections.length;e++)this.liCollections[e].setAttribute("data-index",e.toString())},T.prototype.listOption=function(e,t){var i,s=this,e=Rt.prototype.listOption.call(this,e,t);return P.isNullOrUndefined(e.itemCreated)?e.itemCreated=function(e){s.highlight&&(s.inputElement.tagName===s.getNgDirective()&&s.itemTemplate?setTimeout(function(){K(e.item,s.queryString,s.ignoreCase,s.filterType)},0):K(e.item,s.queryString,s.ignoreCase,s.filterType))}:(i=e.itemCreated,e.itemCreated=function(e){s.highlight&&K(e.item,s.queryString,s.ignoreCase,s.filterType),i.apply(s,[e])}),e},T.prototype.elementValue=function(){return(this.isContentEditable(this.inputElement)?this.inputElement.textContent:this.inputElement.value).replace(this.mentionChar,"")},T.prototype.getQuery=function(e){var t,i=e?e.clone():this.query?this.query.clone():new c.Query,e=""!==this.queryString||P.isNullOrUndefined(this.elementValue())?this.filterType:"equal",s=""!==this.queryString||P.isNullOrUndefined(this.elementValue())?this.queryString:this.elementValue();if(!this.isFiltered&&(null!==this.queryString&&""!==this.queryString&&(t=this.typeOfData(this.dataSource).typeof,(this.dataSource instanceof c.DataManager||"string"!==t)&&"number"!==t?(t=P.isNullOrUndefined(this.fields.text)?"":this.fields.text,i.where(t,e,s,this.ignoreCase,this.ignoreAccent)):i.where("",e,s,this.ignoreCase,this.ignoreAccent)),!P.isNullOrUndefined(this.suggestionCount))){if(25!==this.suggestionCount)for(var l=0;l<i.queries.length;l++)"onTake"===i.queries[l].fn&&i.queries.splice(l,1);i.take(this.suggestionCount)}return i},T.prototype.renderHightSearch=function(){if(this.highlight)for(var e=0;e<this.liCollections.length;e++)this.ulElement.querySelector(".e-active")||(_(this.liCollections[e]),K(this.liCollections[e],this.queryString,this.ignoreCase,this.filterType))},T.prototype.getTextRange=function(){var e,t,i;return this.isContentEditable(this.inputElement)?this.range&&(t=this.range.startContainer,P.isNullOrUndefined(t)||(t=t.textContent,i=this.range.startOffset,t&&0<=i&&(e=t.substring(0,i)))):(t=this.inputElement,P.isNullOrUndefined(t)||(i=t.selectionStart,t.value&&0<=i&&(e=t.value.substring(0,i)))),e},T.prototype.getLastLetter=function(e){return P.isNullOrUndefined(e)?"":(e=(-1<e.indexOf("​")?e.replace(/\u200B/g,""):e).replace(/\u00A0/g," ").split(/\s+/))[e.length-1].trim()},T.prototype.isContentEditable=function(e){return e&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName},T.prototype.showPopup=function(){this.beforePopupOpen=!0,document.activeElement!==this.inputElement&&this.inputElement.focus(),this.queryString=this.didPopupOpenByTypingInitialChar?this.queryString:"",this.didPopupOpenByTypingInitialChar=!1,this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange()),this.isTyped||this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)&&this.initValue(),this.renderPopup(),P.attributes(this.inputElement,{"aria-activedescendant":this.selectedElementID}),null==this.selectedElementID&&this.inputElement.removeAttribute("aria-activedescendant")},T.prototype.hidePopup=function(e){this.removeSelection(),this.closePopup(0,e)},T.prototype.closePopup=function(e,t){var i,s=this;this.popupObj&&document.body.contains(this.popupObj.element)&&this.beforePopupOpen&&(P.EventHandler.remove(document,"mousedown",this.onDocumentClick),this.inputElement.removeAttribute("aria-owns"),this.inputElement.removeAttribute("aria-activedescendant"),this.beforePopupOpen=!1,i=this.popupObj,this.trigger("closed",{popup:i,cancel:!1,animation:{name:"FadeOut",duration:100,delay:e||0},event:t||null},function(e){!e.cancel&&s.popupObj&&(s.isPopupOpen?s.popupObj.hide(new P.Animation(e.animation)):s.destroyPopup())}))},T.prototype.renderPopup=function(){var a=this;this.trigger("beforeOpen",{cancel:!1},function(e){var t,i,s,l,n;e.cancel?a.beforePopupOpen=!1:(P.isNullOrUndefined(a.target)?t=a.createElement("div",{id:a.inputElement.id+"_popup",className:"e-mention e-popup "+(null!=a.cssClass?a.cssClass:"")}):(t=a.element,null!=a.cssClass&&P.addClass([t],a.cssClass.split(" "))),a.isRTE&&a.cssClass&&-1<a.cssClass.indexOf("e-slash-menu")?t.id=a.inputElement.id+"_slash_menu_popup":P.isNullOrUndefined(a.target)||(t.id=a.inputElement.id+"_popup"),a.listHeight=P.formatUnit(a.popupHeight),P.isNullOrUndefined(a.list.querySelector("li"))||a.initRemoteRender||(e=a.list.querySelector("."+y.focus),P.isNullOrUndefined(e))||(a.selectedLI=e,n=a.getFormattedValue(e.getAttribute("data-value")),a.selectEventCallback(e,a.getDataByValue(n),n,!0)),P.append([a.list],t),a.inputElement.parentElement&&(e=a.inputElement.parentElement.closest(".e-richtexteditor"))&&t.firstElementChild&&0<t.firstElementChild.childElementCount&&(t.firstElementChild.setAttribute("aria-owns",e.id),P.addClass([t],"e-rte-elements")),a.popupObj&&document.body.contains(a.popupObj.element)&&(document.contains(t)||!P.isNullOrUndefined(a.target))||document.body.appendChild(t),t.style.visibility="hidden",a.setHeight(t),a.initializePopup(t,0,0),a.checkCollision(t),t.style.visibility="visible",s=t.parentElement.offsetWidth-t.offsetWidth,l=t.offsetHeight,P.addClass([t],["e-mention","e-popup","e-popup-close"]),P.isNullOrUndefined(a.list)||(a.unWireListEvents(),a.wireListEvents()),a.selectedElementID=a.selectedLI?a.selectedLI.id:null,P.attributes(a.inputElement,{"aria-owns":a.inputElement.id+"_options","aria-activedescendant":a.selectedElementID}),null==a.selectedElementID&&a.inputElement.removeAttribute("aria-activedescendant"),a.beforePopupOpen=!0,n=a.popupObj,a.trigger("opened",{popup:n,cancel:!1,animation:{name:"FadeIn",duration:100}},function(e){e.cancel?(a.beforePopupOpen=!1,a.destroyPopup()):(a.renderReactTemplates(),a.popupObj&&a.popupObj.show(new P.Animation(e.animation),1e3===a.zIndex?a.inputElement:null),P.isNullOrUndefined(a.getTriggerCharPosition())||(i=a.getCoordinates(a.inputElement,a.getTriggerCharPosition()),a.isCollided?(0<a.collision.length&&-1<a.collision.indexOf("right")&&-1===a.collision.indexOf("bottom")?t.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(s.toString(),"px;\nposition: absolute;\n display: block;"):a.collision&&0<a.collision.length&&-1<a.collision.indexOf("bottom")&&-1===a.collision.indexOf("right")?(t.style.left=P.formatUnit(i.left),t.style.top=P.formatUnit(i.top-parseInt(l.toString(),10))):a.collision&&0<a.collision.length&&-1<a.collision.indexOf("bottom")&&-1<a.collision.indexOf("right")?(t.style.left=P.formatUnit(s),t.style.top=P.formatUnit(i.top-parseInt(l.toString(),10))):(t.style.left=P.formatUnit(i.left),t.style.top=P.formatUnit(i.top-parseInt(a.popupHeight.toString(),10))),a.isCollided=!1,a.collision=[]):t.style.cssText="top: ".concat(i.top.toString(),"px;\n left: ").concat(i.left.toString(),"px;\nposition: absolute;\n display: block;"),t.style.width="100%"===a.popupWidth||P.isNullOrUndefined(a.popupWidth)?"auto":P.formatUnit(a.popupWidth),a.setHeight(t),t.style.zIndex=(1e3===a.zIndex?o.getZindexPartial(t):a.zIndex).toString()))}))})},T.prototype.setHeight=function(e){"auto"!==this.popupHeight&&this.list?(this.list.style.maxHeight=(parseInt(this.listHeight,10)-2).toString()+"px",e.style.maxHeight=P.formatUnit(this.popupHeight)):e.style.height="auto"},T.prototype.checkCollision=function(e){var t;(!P.Browser.isDevice||P.Browser.isDevice&&"mention"!==this.getModuleName())&&(t=this.getCoordinates(this.inputElement,this.getTriggerCharPosition()),this.collision=o.isCollide(e,null,t.left,t.top),0<this.collision.length&&(e.style.marginTop=-parseInt(getComputedStyle(e).marginTop,10)+"px",this.isCollided=!0),this.popupObj.resolveCollision())},T.prototype.getTriggerCharPosition=function(){var e,t=this.getTextRange();return(e=null!=t&&(e=0)<=(t=t.lastIndexOf(this.mentionChar))?t:e)||0},T.prototype.initializePopup=function(e,t,i){var s=this;this.popupObj=new o.Popup(e,{width:this.setWidth(),targetType:"relative",relateTo:this.inputElement,collision:{X:"flip",Y:"flip"},offsetY:t,enableRtl:this.enableRtl,offsetX:i,position:{X:"left",Y:"bottom"},actionOnScroll:"hide",zIndex:this.zIndex,close:function(){s.destroyPopup()},open:function(){P.EventHandler.add(document,"mousedown",s.onDocumentClick,s),s.isPopupOpen=!0,s.setDataIndex()}})},T.prototype.setWidth=function(){var e=P.formatUnit(this.popupWidth);return e=-1<e.indexOf("%")?(this.inputElement.offsetWidth*parseFloat(e)/100).toString()+"px":e},T.prototype.destroyPopup=function(){this.isPopupOpen=!1,this.popupObj.destroy(),P.isNullOrUndefined(this.target)?P.detach(this.popupObj.element):(this.popupObj.element.innerHTML="",this.popupObj.element.removeAttribute("style"),this.popupObj.element.removeAttribute("aria-disabled")),this.list.classList.contains("e-nodata")&&(this.list=null)},T.prototype.onDocumentClick=function(e){var t=e.target;!P.isNullOrUndefined(this.popupObj)&&P.closest(t,"#"+this.popupObj.element.id)||this.hidePopup(e)},T.prototype.getCoordinates=function(e,t){var i,s,l,n,a,o=this.isContentEditable(this.inputElement)?(o=this.getTriggerCharPosition(),c=this.range,a=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(a.setStart(c.startContainer,o),a.setEnd(c.startContainer,o)):(a.setStart(c.startContainer,c.startOffset),a.setEnd(c.startContainer,c.endOffset)),this.isTyped=!1,a.collapse(!1),0===a.getBoundingClientRect().top?a.startContainer.getClientRects()[0]:a.getBoundingClientRect()):(i=this.createElement("div",{className:"e-form-mirror-div"}),document.body.appendChild(i),n=getComputedStyle(e),i.style.position="absolute",i.style.visibility="hidden",["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"].forEach(function(e){i.style[e]=n[e]}),i.textContent=e.value.substring(0,t),"INPUT"===this.inputElement.nodeName&&(i.textContent=i.textContent.replace(/\s/g," ")),(s=this.createElement("span")).textContent=e.value.substring(t)||".",i.appendChild(s),e.getBoundingClientRect()),r=o.top,h=o.left,u=document.querySelectorAll("iframe");if(0<u.length)for(var p=0;p<u.length;p++){var d=u[p];d.contentDocument&&d.contentDocument.contains(e)&&(r+=(d=d.getBoundingClientRect()).top,h+=d.left)}var c=document.documentElement,t=(window.pageXOffset||c.scrollLeft)-(c.clientLeft||0),o=(window.pageYOffset||c.scrollTop)-(c.clientTop||0),m=0;if(!P.isNullOrUndefined(a)&&0===a.getBoundingClientRect().top)for(var f,v,p=0;p<this.range.startContainer.childNodes.length;p++)this.range.startContainer.childNodes[p].nodeType!==Node.TEXT_NODE&&""!==this.range.startContainer.childNodes[p].textContent.trim()?m+=this.range.startContainer.childNodes[p].getClientRects()[0].width:""!==this.range.startContainer.childNodes[p].textContent&&((f=document.createElement("span")).innerHTML=this.range.startContainer.childNodes[p].nodeValue,document.body.appendChild(f),v=f.offsetWidth,document.body.removeChild(f),m+=v);return this.isContentEditable(this.inputElement)?l=this.collision&&0<this.collision.length&&-1<this.collision.indexOf("right")&&-1===this.collision.indexOf("bottom")?{top:r+o+parseInt(getComputedStyle(this.inputElement).fontSize,10),left:h+t+m}:{top:r+o+parseInt(getComputedStyle(this.inputElement).fontSize,10)-(this.isCollided?10:0),left:h+t+m}:(l={top:r+o+s.offsetTop+parseInt(n.borderTopWidth,10)+parseInt(n.fontSize,10)+3-e.scrollTop-(this.isCollided?10:0),left:h+t+s.offsetLeft+parseInt(n.borderLeftWidth,10)},document.body.removeChild(i)),l},T.prototype.initValue=function(){this.isDataFetched=!1,this.renderList(),this.dataSource instanceof c.DataManager?this.initRemoteRender=!0:this.updateValues()},T.prototype.updateValues=function(){var e=this.list.querySelector("."+y.focus);P.isNullOrUndefined(e)||this.setSelection(e,null)},T.prototype.renderList=function(){Rt.prototype.render.call(this),this.unWireListEvents(),this.wireListEvents()},T.prototype.wireListEvents=function(){P.EventHandler.add(this.list,this.keyEventName,this.onMouseClick,this),P.EventHandler.add(this.list,"mouseover",this.onMouseOver,this),P.EventHandler.add(this.list,"mouseout",this.onMouseLeave,this)},T.prototype.unWireListEvents=function(){P.EventHandler.remove(this.list,this.keyEventName,this.onMouseClick),P.EventHandler.remove(this.list,"mouseover",this.onMouseOver),P.EventHandler.remove(this.list,"mouseout",this.onMouseLeave)},T.prototype.onMouseClick=function(e){var t=e.target,t=P.closest(t,"."+y.li);!this.isValidLI(t)||this.isDisabledElement(t)||(this.isSelected=!0,this.setSelection(t,e),this.closePopup(100,e),this.inputElement.focus(),this.isRTE)||e.preventDefault()},T.prototype.updateSelectedItem=function(t,i,e,s){var l=this,n=(this.removeSelection(),t.classList.add(y.selected),this.removeHover(),this.getFormattedValue(t.getAttribute("data-value"))),a=this.getDataByValue(n);e||P.isNullOrUndefined(i)||"down"===i.action||"up"===i.action?(this.selectEventCallback(t,a,n),s&&this.setSelectOptions(t,i)):(e=this.detachChanges(a),this.isSelected=!0,this.trigger("select",{e:i,item:t,itemData:e,isInteracted:!!i,cancel:!1},function(e){e.cancel?(t.classList.remove(y.selected),l.isSelected=!1,l.isSelectCancel=!0):(l.selectEventCallback(t,a,n),s&&l.setSelectOptions(t,i))}))},T.prototype.setSelection=function(e,t){this.isValidLI(e)&&(!e.classList.contains(y.selected)||this.isPopupOpen&&this.isSelected&&e.classList.contains(y.selected))?this.updateSelectedItem(e,t,!1,!0):this.setSelectOptions(e,t)},T.prototype.setSelectOptions=function(e,t){this.list&&this.removeHover(),this.previousSelectedLI=P.isNullOrUndefined(this.selectedLI)?null:this.selectedLI,this.selectedLI=e,this.isPopupOpen&&!P.isNullOrUndefined(this.selectedLI)&&this.setScrollPosition(t),t&&(38===t.keyCode||40===t.keyCode)||P.isNullOrUndefined(t)||this.setValue(t)},T.prototype.setScrollPosition=function(e){if(P.isNullOrUndefined(e))this.scrollBottom(!0);else switch(e.action){case"pageDown":case"down":case"end":this.scrollBottom();break;default:this.scrollTop()}},T.prototype.scrollBottom=function(e){var t,i,s;P.isNullOrUndefined(this.selectedLI)||(t=this.list.offsetHeight,i=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,s=this.list.scrollTop+i-t,s=e?s+2*parseInt(getComputedStyle(this.list).paddingTop,10):s,e=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,0===this.activeIndex?this.list.scrollTop=0:(t<i||!(0<e&&this.list.offsetHeight>e))&&(this.list.scrollTop=s))},T.prototype.scrollTop=function(){var e,t;P.isNullOrUndefined(this.selectedLI)||(e=P.isNullOrUndefined(this.fields.groupBy)||P.isNullOrUndefined(this.fixedHeaderElement)?this.selectedLI.offsetTop-this.list.scrollTop:this.selectedLI.offsetTop-(this.list.scrollTop+this.fixedHeaderElement.offsetHeight),e=this.fields.groupBy&&e,t=this.selectedLI.offsetTop+this.selectedLI.offsetHeight-this.list.scrollTop,0===this.activeIndex?this.list.scrollTop=0:e<0?this.list.scrollTop=this.list.scrollTop+e:0<t&&this.list.offsetHeight>t||(this.list.scrollTop=this.selectedLI.offsetTop))},T.prototype.selectEventCallback=function(e,t,i,s){this.previousItemData=P.isNullOrUndefined(this.itemData)?null:this.itemData,this.item=e,this.itemData=t;t=this.list.querySelector("."+y.focus);t&&P.removeClass([t],y.focus),s&&P.addClass([e],y.selected),e.setAttribute("aria-selected","true"),this.activeIndex=this.getIndexByValue(i)},T.prototype.detachChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},T.prototype.setValue=function(e){return this.isReact?P.isNullOrUndefined(this.displayTemplate)?this.updateMentionValue(e):this.setDisplayTemplate(e):(P.isNullOrUndefined(this.displayTemplate)||this.setDisplayTemplate(),this.updateMentionValue(e)),!0},T.prototype.updateMentionValue=function(e){var t,i,s=this.getItemData(),l="string"==typeof this.suffixText?this.suffixText:"",n=this.inputElement.ownerDocument.getSelection(),a=this.getTriggerCharPosition();if(this.isSelectCancel)this.isSelectCancel=!1;else{if(null!==s.text&&(t=this.mentionVal(s.text)),this.isContentEditable(this.inputElement)){i=this.getTriggerCharPosition()+this.mentionChar.length,this.range&&this.range.startContainer.textContent.trim()!==this.mentionChar&&(i=this.range.endOffset),s=this.range,p=document.createRange(),this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)||this.getTextRange()&&this.getTextRange().trim()===this.mentionChar?(p.setStart(s.startContainer,a),p.setEnd(s.startContainer,i)):""!==s.commonAncestorContainer.textContent.trim()&&!P.isNullOrUndefined(s.commonAncestorContainer.textContent.trim())&&this.getTextRange()&&-1!==this.getTextRange().lastIndexOf(this.mentionChar)?(p.setStart(s.startContainer,s.startOffset-1),p.setEnd(s.startContainer,s.endOffset-1)):(p.setStart(s.startContainer,s.startOffset),p.setEnd(s.startContainer,s.endOffset)),this.isTyped=!1,p.deleteContents(),p.startContainer.parentElement.normalize();for(var o,r=this.createElement("div"),h=(r.innerHTML=t,document.createDocumentFragment()),u=void 0;o=r.firstChild;)u=h.appendChild(o);p.insertNode(h),u&&(p=p.cloneRange(),this.isRTE?p.setStart(u,u.textContent.length):p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p)),this.isPopupOpen&&this.hidePopup(),P.isNullOrUndefined(e.pointerType)||"mouse"!==e.pointerType||(s=new CustomEvent("content-changed",{detail:{click:!0}}),this.inputElement.dispatchEvent(s))}else{var n=this.inputElement,p=this.getTextRange().substring(a+this.mentionChar.length,this.getTextRange().length);t+=l,i=a+this.mentionChar.length,i+=p.length,n.value=n.value.substring(0,a)+t+n.value.substring(i,n.value.length),n.selectionStart=a+t.length,n.selectionEnd=a+t.length,this.isPopupOpen&&this.hidePopup()}this.onChangeEvent(e)}},T.prototype.mentionVal=function(e){var t=this.showMentionChar?this.mentionChar:"";return P.isNullOrUndefined(this.displayTemplate)||P.isNullOrUndefined(this.displayTempElement)||(e=this.displayTempElement.innerHTML),this.isContentEditable(this.inputElement)?P.Browser.isAndroid?'<span contenteditable="true" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):'<span contenteditable="false" class="e-mention-chip">'+t+e+"</span>".concat("string"==typeof this.suffixText?this.suffixText:"&#8203;"):t+e},T.prototype.setDisplayTemplate=function(e){var t=this;this.isReact&&(this.clearTemplate(["displayTemplate"]),this.displayTempElement)&&(P.detach(this.displayTempElement),this.displayTempElement=null),this.displayTempElement||(this.displayTempElement=this.createElement("div")),this.isReact||(this.displayTempElement.innerHTML="");var i=P.compile(this.displayTemplate)(this.itemData,this,"displayTemplate",this.displayTemplateId,this.isStringTemplate,null,this.displayTempElement);i&&0<i.length&&P.append(i,this.displayTempElement),this.isReact?this.renderTemplates(function(){t.updateMentionValue(e)}):this.renderTemplates()},T.prototype.renderTemplates=function(e){this.renderReactTemplates(e)},T.prototype.setSpinnerTemplate=function(){var e=this;this.isReact&&(this.clearTemplate(["spinnerTemplate"]),this.spinnerTemplateElement)&&(P.detach(this.spinnerTemplateElement),this.spinnerTemplateElement=null),this.spinnerTemplateElement||(this.spinnerTemplateElement=this.createElement("div")),this.isReact||(this.spinnerTemplateElement.innerHTML="");var t=P.compile(this.spinnerTemplate)(null,this,"spinnerTemplate",this.spinnerTemplateId,this.isStringTemplate,null,this.spinnerTemplateElement);if(t&&0<t.length)for(var i=0;i<t.length;i++)this.spinnerTemplateElement.appendChild(t[i]);this.isReact?this.renderTemplates(function(){e.popupObj.element.appendChild(e.spinnerTemplateElement)}):(this.renderTemplates(),this.popupObj.element.appendChild(this.spinnerTemplateElement))},T.prototype.onChangeEvent=function(e){this.isSelected=!1;var t=this.detachMentionChanges(this.itemData),i="string"==typeof this.previousItemData||"boolean"==typeof this.previousItemData||"number"==typeof this.previousItemData?Object.defineProperties({},{value:{value:this.previousItemData,enumerable:!0},text:{value:this.previousItemData,enumerable:!0}}):this.previousItemData,t={e:e,item:this.item,itemData:t,previousItem:this.previousSelectedLI,previousItemData:i,isInteracted:!!e,value:this.item.innerHTML,element:this.inputElement};this.trigger("change",t)},T.prototype.detachMentionChanges=function(e){e="string"==typeof e||"boolean"==typeof e||"number"==typeof e?Object.defineProperties({},{value:{value:e,enumerable:!0},text:{value:e,enumerable:!0}}):e;return e},T.prototype.getItemData=function(){var e,t,i=this.fields,s=this.itemData;return P.isNullOrUndefined(s)||(e=P.getValue(i.value,s),t=P.getValue(i.text,s)),{value:P.isNullOrUndefined(s)||P.isUndefined(e)?s:e,text:P.isNullOrUndefined(s)||P.isUndefined(e)?s:t}},T.prototype.removeSelection=function(){var e;this.list&&(e=this.list.querySelectorAll("."+y.selected)).length&&(P.removeClass(e,y.selected),e[0].removeAttribute("aria-selected"))},T.prototype.onMouseOver=function(e){e=P.closest(e.target,"."+y.li);this.setHover(e)},T.prototype.setHover=function(e){this.isValidLI(e)&&!e.classList.contains(y.hover)&&(this.removeHover(),P.addClass([e],y.hover))},T.prototype.removeHover=function(){var e;this.list&&(e=this.list.querySelectorAll("."+y.hover))&&e.length&&P.removeClass(e,y.hover)},T.prototype.isValidLI=function(e){return e&&e.hasAttribute("role")&&"option"===e.getAttribute("role")},T.prototype.onMouseLeave=function(){this.removeHover()},T.prototype.search=function(e,t,i){this.isContentEditable(this.inputElement)&&(this.range=this.getCurrentRange());var s=this.getTextRange(),s=(this.queryString=e,this.getLastLetter(s));this.ignoreCase&&(e===s||e===s.toLowerCase())||!this.ignoreCase&&e===s?(this.resetList(this.dataSource,this.fields),P.isNullOrUndefined(this.list)?(this.renderList(),this.renderPopup()):this.isPopupOpen||this.renderPopup(),this.popupObj.element.style.left=P.formatUnit(t),this.popupObj.element.style.top=P.formatUnit(i)):this.isPopupOpen&&this.hidePopup()},T.prototype.disableItem=function(e){if(this.fields.disabled){this.list||this.renderList();var t,i=-1;if(this.liCollections&&0<this.liCollections.length&&this.listData&&this.fields.disabled){if("string"==typeof e)i=this.getIndexByValue(e);else if("object"==typeof e){if(e instanceof HTMLLIElement){for(var s=0;s<this.liCollections.length;s++)if(this.liCollections[s]===e){i=this.getIndexByValue(e.getAttribute("data-value"));break}}else for(var l=JSON.parse(JSON.stringify(e))[this.fields.value],s=0;s<this.listData.length;s++)if(JSON.parse(JSON.stringify(this.listData[s]))[this.fields.value]===l){i=this.getIndexByValue(l);break}}else i=e;i<this.liCollections.length&&-1<i&&!JSON.parse(JSON.stringify(this.listData[i]))[this.fields.disabled]&&(t=this.liCollections[i])&&(this.disableListItem(t),(t=JSON.parse(JSON.stringify(this.listData[i])))[this.fields.disabled]=!0,this.listData[i]=t,this.dataSource=this.listData)}}},T.prototype.destroy=function(){this.hidePopup(),this.unWireEvent(),this.list&&this.unWireListEvents(),this.inputElement&&!this.inputElement.classList.contains("e-"+this.getModuleName())||(this.previousSelectedLI=null,this.item=null,this.selectedLI=null,this.popupObj=null,Rt.prototype.destroy.call(this))},T.prototype.getLocaleName=function(){return"mention"},T.prototype.getNgDirective=function(){return"EJS-MENTION"},T.prototype.getModuleName=function(){return"mention"},L([P.Property(null)],T.prototype,"cssClass",void 0),L([P.Property("@")],T.prototype,"mentionChar",void 0),L([P.Property(!1)],T.prototype,"showMentionChar",void 0),L([P.Property(!1)],T.prototype,"allowSpaces",void 0),L([P.Property(null)],T.prototype,"suffixText",void 0),L([P.Property(25)],T.prototype,"suggestionCount",void 0),L([P.Property(0)],T.prototype,"minLength",void 0),L([P.Property("None")],T.prototype,"sortOrder",void 0),L([P.Property(!0)],T.prototype,"ignoreCase",void 0),L([P.Property(!0)],T.prototype,"requireLeadingSpace",void 0),L([P.Property(!1)],T.prototype,"highlight",void 0),L([P.Property()],T.prototype,"locale",void 0),L([P.Property("auto")],T.prototype,"popupWidth",void 0),L([P.Property("300px")],T.prototype,"popupHeight",void 0),L([P.Property(null)],T.prototype,"displayTemplate",void 0),L([P.Property(null)],T.prototype,"itemTemplate",void 0),L([P.Property("No records found")],T.prototype,"noRecordsTemplate",void 0),L([P.Property(null)],T.prototype,"spinnerTemplate",void 0),L([P.Property()],T.prototype,"target",void 0),L([P.Property([])],T.prototype,"dataSource",void 0),L([P.Property(null)],T.prototype,"query",void 0),L([P.Property("Contains")],T.prototype,"filterType",void 0),L([P.Complex({text:null,value:null,iconCss:null,groupBy:null},ee)],T.prototype,"fields",void 0),L([P.Event()],T.prototype,"actionBegin",void 0),L([P.Event()],T.prototype,"actionComplete",void 0),L([P.Event()],T.prototype,"actionFailure",void 0),L([P.Event()],T.prototype,"change",void 0),L([P.Event()],T.prototype,"beforeOpen",void 0),L([P.Event()],T.prototype,"opened",void 0),L([P.Event()],T.prototype,"closed",void 0),L([P.Event()],T.prototype,"select",void 0),L([P.Event()],T.prototype,"filtering",void 0),L([P.Event()],T.prototype,"created",void 0),L([P.Event()],T.prototype,"destroyed",void 0),L([P.NotifyPropertyChanges],T));function T(e,t){return Rt.call(this,e,t)||this}e.AutoComplete=E,e.CheckBoxSelection=Nt,e.ComboBox=a,e.DropDownBase=Z,e.DropDownList=i,e.DropDownTree=l,e.FieldSettings=ee,e.Fields=Fe,e.ListBox=Tt,e.Mention=L,e.MultiSelect=w,e.Search=d,e.SelectionSettings=Vt,e.ToolbarSettings=Ht,e.TreeSettings=qe,e.VirtualScroll=X,e.createFloatLabel=Ye,e.dropDownBaseClasses=y,e.dropDownListClasses=f,e.encodePlaceholder=st,e.escapeCharRegExp=R,e.floatLabelBlur=it,e.floatLabelFocus=tt,e.highlightSearch=K,e.incrementalSearch=j,e.removeFloating=Ze,e.resetIncrementalSearchValues=z,e.revertHighlightSearch=_,e.setPlaceHolder=et,e.updateFloatLabelState=$e,Object.defineProperty(e,"__esModule",{value:!0})});
11
11
  //# sourceMappingURL=ej2-dropdowns.umd.min.js.map