jqwidgets-ng 18.3.0 → 19.0.0

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 (111) hide show
  1. package/esm2020/jqxgrid/angular_jqxgrid.mjs +72 -2
  2. package/fesm2015/jqwidgets-ng-jqxgrid.mjs +72 -2
  3. package/fesm2020/jqwidgets-ng-jqxgrid.mjs +72 -2
  4. package/jqwidgets/jqx-all.js +41 -26
  5. package/jqwidgets/jqxangular.js +1 -1
  6. package/jqwidgets/jqxbarcode.js +1 -1
  7. package/jqwidgets/jqxbargauge.js +1 -1
  8. package/jqwidgets/jqxbulletchart.js +1 -1
  9. package/jqwidgets/jqxbuttongroup.js +1 -1
  10. package/jqwidgets/jqxbuttons.js +1 -1
  11. package/jqwidgets/jqxcalendar.js +1 -1
  12. package/jqwidgets/jqxchart.annotations.js +1 -1
  13. package/jqwidgets/jqxchart.api.js +1 -1
  14. package/jqwidgets/jqxchart.core.js +1 -1
  15. package/jqwidgets/jqxchart.js +1 -1
  16. package/jqwidgets/jqxchart.rangeselector.js +1 -1
  17. package/jqwidgets/jqxchart.waterfall.js +1 -1
  18. package/jqwidgets/jqxcheckbox.js +1 -1
  19. package/jqwidgets/jqxcheckboxgroup.js +13 -5
  20. package/jqwidgets/jqxcolorpicker.js +1 -1
  21. package/jqwidgets/jqxcombobox.js +1 -1
  22. package/jqwidgets/jqxcomplexinput.js +1 -1
  23. package/jqwidgets/jqxcore.js +1 -1
  24. package/jqwidgets/jqxdata.export.js +1 -1
  25. package/jqwidgets/jqxdata.js +1 -1
  26. package/jqwidgets/jqxdatatable.js +1 -1
  27. package/jqwidgets/jqxdate.js +1 -1
  28. package/jqwidgets/jqxdatetimeinput.js +1 -1
  29. package/jqwidgets/jqxdocking.js +1 -1
  30. package/jqwidgets/jqxdockinglayout.js +1 -1
  31. package/jqwidgets/jqxdockpanel.js +1 -1
  32. package/jqwidgets/jqxdragdrop.js +1 -1
  33. package/jqwidgets/jqxdraw.js +1 -1
  34. package/jqwidgets/jqxdropdownbutton.js +1 -1
  35. package/jqwidgets/jqxdropdownlist.js +2 -2
  36. package/jqwidgets/jqxeditor.js +2 -2
  37. package/jqwidgets/jqxexpander.js +1 -1
  38. package/jqwidgets/jqxfileupload.js +1 -1
  39. package/jqwidgets/jqxform.js +1 -1
  40. package/jqwidgets/jqxformattedinput.js +1 -1
  41. package/jqwidgets/jqxgantt.api.js +64 -64
  42. package/jqwidgets/jqxgantt.js +1 -1
  43. package/jqwidgets/jqxgauge.js +1 -1
  44. package/jqwidgets/jqxgrid.aggregates.js +1 -1
  45. package/jqwidgets/jqxgrid.chart.js +15 -14
  46. package/jqwidgets/jqxgrid.columnsreorder.js +2 -2
  47. package/jqwidgets/jqxgrid.columnsresize.js +2 -2
  48. package/jqwidgets/jqxgrid.edit.js +2 -2
  49. package/jqwidgets/jqxgrid.export.js +1 -1
  50. package/jqwidgets/jqxgrid.filter.js +2 -2
  51. package/jqwidgets/jqxgrid.grouping.js +2 -2
  52. package/jqwidgets/jqxgrid.js +2 -2
  53. package/jqwidgets/jqxgrid.pager.js +1 -1
  54. package/jqwidgets/jqxgrid.selection.js +2 -2
  55. package/jqwidgets/jqxgrid.sort.js +1 -1
  56. package/jqwidgets/jqxgrid.storage.js +2 -2
  57. package/jqwidgets/jqxheatmap.js +1 -1
  58. package/jqwidgets/jqxinput.js +1 -1
  59. package/jqwidgets/jqxkanban.js +2 -2
  60. package/jqwidgets/jqxknob.js +1 -1
  61. package/jqwidgets/jqxknockout.js +1 -1
  62. package/jqwidgets/jqxlayout.js +1 -1
  63. package/jqwidgets/jqxlistbox.js +1 -1
  64. package/jqwidgets/jqxlistmenu.js +1 -1
  65. package/jqwidgets/jqxloader.js +1 -1
  66. package/jqwidgets/jqxmaskedinput.js +2 -2
  67. package/jqwidgets/jqxmenu.js +1 -1
  68. package/jqwidgets/jqxnavbar.js +1 -1
  69. package/jqwidgets/jqxnavigationbar.js +1 -1
  70. package/jqwidgets/jqxnotification.js +1 -1
  71. package/jqwidgets/jqxnumberinput.js +2 -2
  72. package/jqwidgets/jqxpanel.js +1 -1
  73. package/jqwidgets/jqxpasswordinput.js +1 -1
  74. package/jqwidgets/jqxpivot.js +1 -1
  75. package/jqwidgets/jqxpivotdesigner.js +1 -1
  76. package/jqwidgets/jqxpivotgrid.js +1 -1
  77. package/jqwidgets/jqxpopover.js +2 -2
  78. package/jqwidgets/jqxprogressbar.js +1 -1
  79. package/jqwidgets/jqxqrcode.js +1 -1
  80. package/jqwidgets/jqxradiobutton.js +1 -1
  81. package/jqwidgets/jqxradiobuttongroup.js +12 -5
  82. package/jqwidgets/jqxrangeselector.js +1 -1
  83. package/jqwidgets/jqxrating.js +2 -2
  84. package/jqwidgets/jqxresponsivepanel.js +1 -1
  85. package/jqwidgets/jqxribbon.js +1 -1
  86. package/jqwidgets/jqxscheduler.api.js +1 -1
  87. package/jqwidgets/jqxscheduler.js +2 -2
  88. package/jqwidgets/jqxscrollbar.js +1 -1
  89. package/jqwidgets/jqxscrollview.js +1 -1
  90. package/jqwidgets/jqxslider.js +1 -1
  91. package/jqwidgets/jqxsortable.js +1 -1
  92. package/jqwidgets/jqxsplitlayout.js +2506 -2
  93. package/jqwidgets/jqxsplitter.js +1 -1
  94. package/jqwidgets/jqxswitchbutton.js +1 -1
  95. package/jqwidgets/jqxtabs.js +1 -1
  96. package/jqwidgets/jqxtagcloud.js +1 -1
  97. package/jqwidgets/jqxtextarea.js +2 -2
  98. package/jqwidgets/jqxtimepicker.js +1 -1
  99. package/jqwidgets/jqxtoolbar.js +1 -1
  100. package/jqwidgets/jqxtooltip.js +1 -1
  101. package/jqwidgets/jqxtouch.js +1 -1
  102. package/jqwidgets/jqxtree.js +1 -1
  103. package/jqwidgets/jqxtreegrid.js +1 -1
  104. package/jqwidgets/jqxtreemap.js +1 -1
  105. package/jqwidgets/jqxvalidator.js +1 -1
  106. package/jqwidgets/jqxwindow.js +1 -1
  107. package/jqwidgets/styles/jqx.base.css +10 -0
  108. package/jqwidgets/styles/jqx.fluent.css +6 -0
  109. package/jqwidgets.d.ts +5 -0
  110. package/jqxgrid/angular_jqxgrid.d.ts +11 -1
  111. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
 
2
- /* JQX UI v18.3.0 (2023-DEC)
2
+ /* Smart UI v17.0.0 (2023-Oct)
3
3
  Copyright (c) 2011-2023 jQWidgets.
4
4
  License: https://htmlelements.com/license/ */
5
5
 
@@ -24,14 +24,14 @@ JQX("jqx-calendar",class extends JQX.BaseElement{static get properties(){return{
24
24
  /***/ 6057:
25
25
  /***/ (() => {
26
26
 
27
- (()=>{JQX.DataAdapter=window.jqxDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=JQX.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new JQX.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),void 0===e.skipFirstRow&&(t.skipFirstRow=!1),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new JQX.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new JQX.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}forEach(e){const t=this;if(e)if(t.boundHierarchy&&t.boundHierarchy.length>0){const a=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(t.boundHierarchy);for(let t=0;t<a.length;t++){e(a[t],t)}}else for(let a=0;a<t.boundSource.length;a++){e(t.boundSource[a],a)}}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new JQX.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("parent")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};if("string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType))t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0)t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0)t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0)t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0)t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType))t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType))t._bindToICS(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType))t._bindToXML(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType))t._bindToCSV(),a();else if("array"===t.dataSourceType)t._bindToArray(),a();else if("json"===t.dataSourceType){if(t.dataSource&&t.dataSource.url)return t.url=t.dataSource.url,t.dataSource.method&&(t.type=t.dataSource.method),t.dataSource.type&&(t.type=t.dataSource.type),t.dataSource.data&&(t.data=t.dataSource.data),void new e(t,(e=>{t.dataSource=e}));t._bindToJSON(),a()}}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}static BindToCSV(e,t=!1){const a=""+e,n=-1===a.indexOf(",")?"\t":",",r=a.split("\r"),i=new Array,o=[];let d=a.split("\n"),l=d.length;1===l&&r.length>1&&(d=r,l=d.length);const s=!0===t;for(let e=0;e<l;e++){const t={},a=d[e].split(n);for(let n=0;n<a.length;n++){let r=o[n],i=a[n];if(r||(o.push({name:i.trim()}),r=o[o.length-1]),i=i.trim(),1!==e||s)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}t[r.name]=i}(s||e>0)&&i.push(t)}return i}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={};let l=i[t].split(a);if(t>0){let e=[],a=0,n=!1,r=i[t];for(let t=0;t<r.length;t++)if('"'===r.charAt(t))n=!n;else if(","===r.charAt(t)&&!n){let n=r.substring(a,t);n=n.trim(),n=n.replaceAll('"',""),e.push(n),a=t+1}let o=r.substring(a);o=o.trim(),o=o.replaceAll('"',""),","===o?e.push('""'):e.push(o),l=e}for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/")&&-1===i.indexOf("-"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):i.indexOf(".")>=0&&i.lastIndexOf(".")!==i.indexOf(".")?-1===i.indexOf(",")&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}0===t&&e.skipFirstRow||(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new JQX.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),t.data=r.data,a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{let a=t.value,n=t.valueTo;if(a&&a instanceof Date){a=`'${new JQX.Utilities.DateTime(a).toString("yyyy-MM-dd")}'`}if(t.valueTo&&t.valueTo instanceof Date){n=`'${new JQX.Utilities.DateTime(n).toString("yyyy-MM-dd")}'`}switch(t.condition){case"EQUAL":return e+" = "+a;case"NOT_EQUAL":return e+" != "+a;case"GREATER_THAN":return e+" > "+a;case"GREATER_THAN_OR_EQUAL":return e+" >= "+a;case"LESS_THAN":return e+" < "+a;case"LESS_THAN_OR_EQUAL":return e+" <= "+a;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+a+" and "+e+" <= "+n+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1!==o.logicalOperators[t]&&"or"!==o.logicalOperators[t]||(s=" OR ")}l.length&&r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e).replace(/</g,"&lt;").replace(/>/g,"&gt;")}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n].replace(/</g,"&lt;").replace(/>/g,"&gt;")+"'");null===a.id?d.update=" SET "+e.join(", "):d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),null!==t.edit.row[n]?e.push("'"+t.edit.row[n]+"'"):e.push("null"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.where.indexOf("undefined")>=0&&(d.where=""),d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,edit:t.edit,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}removeById(e){const t=this,a=t.indexOf(t.dataItemById[e]);t.boundSource[a]&&t.removeAt(a)}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id]));t.boundSource[a]&&t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(JQX.Utilities.Types.isArray(e)&&JQX.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new JQX.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=JSON.parse(JSON.stringify(e.boundSource[n]));if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{if("parent"===e[t])e[t]="$"+e[t]})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=s.boundSource.canNotify;s.boundSource.canNotify=!1;const f=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let h=new Array;for(let t=0;t<e.length;t++)h[t]=f();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const p=new Array,g=new Array;let S=0;const y=function(t){let a=t;for(let n=0;n<e.length;n++){if(void 0===t[e[n]]){a=s._getDataItem(t,t.$.index);break}}if(n)for(let e in n){const t=n[e];t.name&&t.map&&(a[t.map]=a[t.name])}return a};let m=!1;for(let n=0;n<d.length;n++){let u=y(d[n]);u[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=u[a];null!=n?((""===n||void 0===n&&0===t)&&(m=!0),T[b++]={value:n,group:a,hash:h[t]}):(T[b++]={value:null,group:a,hash:h[t]},0===t&&(m=!0))}if(T.length!==e.length)break;let x=null,v="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(v=v+"_"+T[e].hash+"_"+n,void 0===g[v]||null===g[v]){if(null===x){x={$:{}},x[c.level]=0,x[c.leaf]=!1,x[o]=null,x[a]=n,x[r]=u,x.groupDataField=d,x[d]||(x[d]=x.data[d]),void 0!==u[c.expanded]?x[c.expanded]=u[c.expanded]:(x[c.expanded]=!1,s.expandHierarchy&&(x[c.expanded]=!0)),i&&(x[i]=u[i]),x[t]=new Array;let e=p.length+l;this.id&&"number"!=typeof u.$.id&&!isFinite(u.$.id)||(e="Item"+e),void 0===x.$.id&&(x.$.id=e),s._expandedRowIds[x.$.id]&&(x[c.expanded]=!0),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[x.$.id]&&(x[c.expanded]=!1),p[S++]=x}else{const e={$:{}};e[c.level]=x[c.level]+1,e[o]=x,e[a]=n,e[t]=new Array,e[r]=u,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==u[c.expanded]?e[c.expanded]=u[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=u[i]),void 0===e.$.id&&(e.$.id=x.$.id+"_"+x[t].length),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[e.$.id]&&(e[c.expanded]=!1),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),x[t][x[t].length]=e,x=e}g[v]=x}else x=g[v]}u&&(u[c.leaf]=!0),null!==x?(null===this.id?void 0===u.$.id&&(u.$.id=x.$.id+"_"+x[t].length):void 0===u.$.id&&-1===u.$.id.toString().indexOf(x.$.id)&&(u.$.id=x.$.id+"_"+u.$.id),u[o]=x,u[c.level]=x[c.level]+1,x[t][x[t].length]=u):void 0===u.$.id&&(u.$.id=f())}if(m){let e=null,t=!1;for(let a=0;a<p.length;a++){const n=p[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),p.splice(a,1);break}}if(e&&(p.push(e),t))for(let e=0;e<p.length;e++){const t=p[e];t.$.id="Item"+e,Object.keys(s._expandedRowIds).length>0&&(s._expandedRowIds[t.$.id]?t[c.expanded]=!0:t[c.expanded]=!1,s.expandHierarchy&&(t[c.expanded]=!0,s._collapsedIds&&s._collapsedIds[t.$.id]&&(t[c.expanded]=!1)))}}return s.boundSource.canNotify=u,p}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),null===o&&(o=n[e]=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(void 0!==d&&"uncategorized"!==d||(d=""),o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}},t=d;let l=parseFloat(d);l=!isNaN(l),t&&t.toDate&&(l=!1),"string"==typeof d&&d.startsWith("+")&&(l=!1),l&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("blank"===t)n=r[o.dataField][t],null==n&&(n=0),d||n++;else if("filled"===t)n=r[o.dataField][t],null==n&&(n=0),void 0!==d&&n++;else if("unique"===t)n=r[o.dataField][t],null==n&&(n=[]),-1===n.indexOf(d)&&n.push(d);else if("status"===t)n=r[o.dataField][t],null==n&&(n=[]),n[d]||(n[d]=[]),n[d].push(d);else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d&&"count"!==t)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}else if("status"===t){let e=r[o.dataField][t];null==e&&(e=[]),e[d]||(e[d]=[]),e[d].push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].status){const e=r[n.dataField].status;r[n.dataField].status=e}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&t&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;if(""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType])o=a._cachedValues[o+"_"+r.dataType];else{if("bool"===r.dataType||"boolean"===r.dataType)"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1);else if("number"===r.dataType)-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0);else if("date"===r.dataType){if(o&&"string"==typeof o&&o.indexOf("[")>=0){const e=JSON.parse(o);if(r.formatString&&JQX.Utilities.DateTime){const t=JQX.Utilities.DateTime.ParseDate(e[0],r.formatString),a=JQX.Utilities.DateTime.ParseDate(e[1],r.formatString);e[0]=t,e[1]=a}else{const t=a.$document.deserialize(""+e[0],r.dataType,!0),n=a.$document.deserialize(""+e[1],r.dataType,!0);e[0]=t,e[1]=n}o=e,n[r.name]=o;continue}if(r.formatString&&JQX.Utilities.DateTime){o=JQX.Utilities.DateTime.ParseDate(o,r.formatString)}else o=a.$document.deserialize(""+o,r.dataType,!0)}else"any"!==r.dataType&&(o="string"===r.dataType&&"null"===o?"null":a.$document.deserialize(""+o,r.dataType,!0));"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)}"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o="date"===r.dataType||"number"===r.dataType?null:0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===a.sanitizeHTML&&(o=window.JQX.Utilities.Core.sanitizeHTML(o),o.indexOf("<br")>=0&&(o=o.replaceAll("<br/>","\n\r"),o=o.replaceAll("<br>","\n\r")))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id){if(o=i[a.id],void 0===o){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};o=e()+e()}"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id)}else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new JQX.ObservableArray(a),e.observable&&(e.boundSource=new JQX.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new JQX.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",CONTAINS:"CONTAINS",DOES_NOT_CONTAIN:"DOES_NOT_CONTAIN",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];"string"==typeof t&&(t=[t]);for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];if(""!==t&&" "!==t){if("true"===t.trim()){i.push(!0);continue}if("false"===t.trim()){i.push(!1);continue}if(t.indexOf("or ")>=0||t.indexOf("and ")>=0||t.indexOf("1 ")>=0||t.indexOf("0 ")>=0||t.indexOf("| ")>=0||t.indexOf("& ")>=0){const e=t.trim().split(" ");if(e.length>1){const t=e[0].trim(),a=e[1].trim();"1"===t?i.push("or"):"0"===t?i.push("and"):i.push(t),i.push(a)}else i.push(t.trim())}else i.push(t.trim())}}n.push(i)}const r=new JQX.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new JQX.FilterGroup;let n=r.length>2?"":"and",i=0,d=[];for(let o=0;o<r.length;o++){let l=r[o];if("and"!==l&&"or"!==l){if(i++,2===i){let s=a[r[o-1]];s||(s=r[o-1]),"number"===e&&(l=parseFloat(l)),"date"===e&&(l=new Date(l));const c=t.createFilter(e,l,s);if(i=0,d.push(c),n){for(let e=0;e<d.length;e++)t.addFilter(n,d[e]);d=[]}}}else n=l}o.push(t)}else{let e=r[0];if(e&&a[e]&&(e="and"),"and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof JQX.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof JQX.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy){if(o.virtualDataSource)return;throw new Error("sort: Missing or Invalid arguments!")}"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof JQX.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new JQX.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let d=e[0][t[r]];if(void 0===d&&e[0]&&e[0].children&&e[0].data&&(d=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}o.sortComparators&&o.sortComparators[t[r]]?s[r]=o.sortComparators[t[r]]:s[r]=c(d,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){JQX.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){JQX.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){const e=function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0};return e}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber)t=function(e,t){return e.compare(t)};else if(e instanceof JQX.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new JQX.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}else t=function(e,t){return e-t}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}JQX.Ajax=window.Ajax=e})();
27
+ (()=>{JQX.DataAdapter=window.smartDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=JQX.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new JQX.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),void 0===e.skipFirstRow&&(t.skipFirstRow=!1),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new JQX.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new JQX.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}forEach(e){const t=this;if(e)if(t.boundHierarchy&&t.boundHierarchy.length>0){const a=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(t.boundHierarchy);for(let t=0;t<a.length;t++){e(a[t],t)}}else for(let a=0;a<t.boundSource.length;a++){e(t.boundSource[a],a)}}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new JQX.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("parent")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};if("string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType))t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0)t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0)t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0)t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0)t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType))t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType))t._bindToICS(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType))t._bindToXML(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType))t._bindToCSV(),a();else if("array"===t.dataSourceType)t._bindToArray(),a();else if("json"===t.dataSourceType){if(t.dataSource&&t.dataSource.url)return t.url=t.dataSource.url,t.dataSource.method&&(t.type=t.dataSource.method),t.dataSource.type&&(t.type=t.dataSource.type),t.dataSource.data&&(t.data=t.dataSource.data),void new e(t,(e=>{t.dataSource=e}));t._bindToJSON(),a()}}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}static BindToCSV(e,t=!1){const a=""+e,n=-1===a.indexOf(",")?"\t":",",r=a.split("\r"),i=new Array,o=[];let d=a.split("\n"),l=d.length;1===l&&r.length>1&&(d=r,l=d.length);const s=!0===t;for(let e=0;e<l;e++){const t={},a=d[e].split(n);for(let n=0;n<a.length;n++){let r=o[n],i=a[n];if(r||(o.push({name:i.trim()}),r=o[o.length-1]),i=i.trim(),1!==e||s)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}t[r.name]=i}(s||e>0)&&i.push(t)}return i}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={};let l=i[t].split(a);if(t>0){let e=[],a=0,n=!1,r=i[t];for(let t=0;t<r.length;t++)if('"'===r.charAt(t))n=!n;else if(","===r.charAt(t)&&!n){let n=r.substring(a,t);n=n.trim(),n=n.replaceAll('"',""),e.push(n),a=t+1}let o=r.substring(a);o=o.trim(),o=o.replaceAll('"',""),","===o?e.push('""'):e.push(o),l=e}for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/")&&-1===i.indexOf("-"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):i.indexOf(".")>=0&&i.lastIndexOf(".")!==i.indexOf(".")?-1===i.indexOf(",")&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}0===t&&e.skipFirstRow||(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new JQX.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),t.data=r.data,a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{let a=t.value,n=t.valueTo;if(a&&a instanceof Date){a=`'${new JQX.Utilities.DateTime(a).toString("yyyy-MM-dd")}'`}if(t.valueTo&&t.valueTo instanceof Date){n=`'${new JQX.Utilities.DateTime(n).toString("yyyy-MM-dd")}'`}switch(t.condition){case"EQUAL":return e+" = "+a;case"NOT_EQUAL":return e+" != "+a;case"GREATER_THAN":return e+" > "+a;case"GREATER_THAN_OR_EQUAL":return e+" >= "+a;case"LESS_THAN":return e+" < "+a;case"LESS_THAN_OR_EQUAL":return e+" <= "+a;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+a+" and "+e+" <= "+n+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1!==o.logicalOperators[t]&&"or"!==o.logicalOperators[t]||(s=" OR ")}l.length&&r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e).replace(/</g,"&lt;").replace(/>/g,"&gt;")}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n].replace(/</g,"&lt;").replace(/>/g,"&gt;")+"'");null===a.id?d.update=" SET "+e.join(", "):d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),null!==t.edit.row[n]?e.push("'"+t.edit.row[n]+"'"):e.push("null"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.where.indexOf("undefined")>=0&&(d.where=""),d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,edit:t.edit,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}removeById(e){const t=this,a=t.indexOf(t.dataItemById[e]);t.boundSource[a]&&t.removeAt(a)}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id]));t.boundSource[a]&&t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(JQX.Utilities.Types.isArray(e)&&JQX.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new JQX.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=JSON.parse(JSON.stringify(e.boundSource[n]));if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{if("parent"===e[t])e[t]="$"+e[t]})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=s.boundSource.canNotify;s.boundSource.canNotify=!1;const f=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let h=new Array;for(let t=0;t<e.length;t++)h[t]=f();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const p=new Array,g=new Array;let S=0;const y=function(t){let a=t;for(let n=0;n<e.length;n++){if(void 0===t[e[n]]){a=s._getDataItem(t,t.$.index);break}}if(n)for(let e in n){const t=n[e];t.name&&t.map&&(a[t.map]=a[t.name])}return a};let m=!1;for(let n=0;n<d.length;n++){let u=y(d[n]);u[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=u[a];null!=n?((""===n||void 0===n&&0===t)&&(m=!0),T[b++]={value:n,group:a,hash:h[t]}):(T[b++]={value:null,group:a,hash:h[t]},0===t&&(m=!0))}if(T.length!==e.length)break;let x=null,v="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(v=v+"_"+T[e].hash+"_"+n,void 0===g[v]||null===g[v]){if(null===x){x={$:{}},x[c.level]=0,x[c.leaf]=!1,x[o]=null,x[a]=n,x[r]=u,x.groupDataField=d,x[d]||(x[d]=x.data[d]),void 0!==u[c.expanded]?x[c.expanded]=u[c.expanded]:(x[c.expanded]=!1,s.expandHierarchy&&(x[c.expanded]=!0)),i&&(x[i]=u[i]),x[t]=new Array;let e=p.length+l;this.id&&"number"!=typeof u.$.id&&!isFinite(u.$.id)||(e="Item"+e),void 0===x.$.id&&(x.$.id=e),s._expandedRowIds[x.$.id]&&(x[c.expanded]=!0),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[x.$.id]&&(x[c.expanded]=!1),p[S++]=x}else{const e={$:{}};e[c.level]=x[c.level]+1,e[o]=x,e[a]=n,e[t]=new Array,e[r]=u,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==u[c.expanded]?e[c.expanded]=u[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=u[i]),void 0===e.$.id&&(e.$.id=x.$.id+"_"+x[t].length),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[e.$.id]&&(e[c.expanded]=!1),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),x[t][x[t].length]=e,x=e}g[v]=x}else x=g[v]}u&&(u[c.leaf]=!0),null!==x?(null===this.id?void 0===u.$.id&&(u.$.id=x.$.id+"_"+x[t].length):void 0===u.$.id&&-1===u.$.id.toString().indexOf(x.$.id)&&(u.$.id=x.$.id+"_"+u.$.id),u[o]=x,u[c.level]=x[c.level]+1,x[t][x[t].length]=u):void 0===u.$.id&&(u.$.id=f())}if(m){let e=null,t=!1;for(let a=0;a<p.length;a++){const n=p[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),p.splice(a,1);break}}if(e&&(p.push(e),t))for(let e=0;e<p.length;e++){const t=p[e];t.$.id="Item"+e,Object.keys(s._expandedRowIds).length>0&&(s._expandedRowIds[t.$.id]?t[c.expanded]=!0:t[c.expanded]=!1,s.expandHierarchy&&(t[c.expanded]=!0,s._collapsedIds&&s._collapsedIds[t.$.id]&&(t[c.expanded]=!1)))}}return s.boundSource.canNotify=u,p}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),null===o&&(o=n[e]=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(void 0!==d&&"uncategorized"!==d||(d=""),o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}},t=d;let l=parseFloat(d);l=!isNaN(l),t&&t.toDate&&(l=!1),"string"==typeof d&&d.startsWith("+")&&(l=!1),l&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("blank"===t)n=r[o.dataField][t],null==n&&(n=0),d||n++;else if("filled"===t)n=r[o.dataField][t],null==n&&(n=0),void 0!==d&&n++;else if("unique"===t)n=r[o.dataField][t],null==n&&(n=[]),-1===n.indexOf(d)&&n.push(d);else if("status"===t)n=r[o.dataField][t],null==n&&(n=[]),n[d]||(n[d]=[]),n[d].push(d);else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d&&"count"!==t)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}else if("status"===t){let e=r[o.dataField][t];null==e&&(e=[]),e[d]||(e[d]=[]),e[d].push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].status){const e=r[n.dataField].status;r[n.dataField].status=e}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&t&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;if(""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType])o=a._cachedValues[o+"_"+r.dataType];else{if("bool"===r.dataType||"boolean"===r.dataType)"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1);else if("number"===r.dataType)-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0);else if("date"===r.dataType){if(o&&"string"==typeof o&&o.indexOf("[")>=0){const e=JSON.parse(o);if(r.formatString&&JQX.Utilities.DateTime){const t=JQX.Utilities.DateTime.ParseDate(e[0],r.formatString),a=JQX.Utilities.DateTime.ParseDate(e[1],r.formatString);e[0]=t,e[1]=a}else{const t=a.$document.deserialize(""+e[0],r.dataType,!0),n=a.$document.deserialize(""+e[1],r.dataType,!0);e[0]=t,e[1]=n}o=e,n[r.name]=o;continue}if(r.formatString&&JQX.Utilities.DateTime){o=JQX.Utilities.DateTime.ParseDate(o,r.formatString)}else o=a.$document.deserialize(""+o,r.dataType,!0)}else"any"!==r.dataType&&(o="string"===r.dataType&&"null"===o?"null":a.$document.deserialize(""+o,r.dataType,!0));"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)}"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o="date"===r.dataType||"number"===r.dataType?null:0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===a.sanitizeHTML&&(o=window.JQX.Utilities.Core.sanitizeHTML(o),o.indexOf("<br")>=0&&(o=o.replaceAll("<br/>","\n\r"),o=o.replaceAll("<br>","\n\r")))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id){if(o=i[a.id],void 0===o){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};o=e()+e()}"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id)}else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new JQX.ObservableArray(a),e.observable&&(e.boundSource=new JQX.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new JQX.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",CONTAINS:"CONTAINS",DOES_NOT_CONTAIN:"DOES_NOT_CONTAIN",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];"string"==typeof t&&(t=[t]);for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];if(""!==t&&" "!==t){if("true"===t.trim()){i.push(!0);continue}if("false"===t.trim()){i.push(!1);continue}if(t.indexOf("or ")>=0||t.indexOf("and ")>=0||t.indexOf("1 ")>=0||t.indexOf("0 ")>=0||t.indexOf("| ")>=0||t.indexOf("& ")>=0){const e=t.trim().split(" ");if(e.length>1){const t=e[0].trim(),a=e[1].trim();"1"===t?i.push("or"):"0"===t?i.push("and"):i.push(t),i.push(a)}else i.push(t.trim())}else i.push(t.trim())}}n.push(i)}const r=new JQX.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new JQX.FilterGroup;let n=r.length>2?"":"and",i=0,d=[];for(let o=0;o<r.length;o++){let l=r[o];if("and"!==l&&"or"!==l){if(i++,2===i){let s=a[r[o-1]];s||(s=r[o-1]),"number"===e&&(l=parseFloat(l)),"date"===e&&(l=new Date(l));const c=t.createFilter(e,l,s);if(i=0,d.push(c),n){for(let e=0;e<d.length;e++)t.addFilter(n,d[e]);d=[]}}}else n=l}o.push(t)}else{let e=r[0];if(e&&a[e]&&(e="and"),"and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof JQX.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof JQX.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy){if(o.virtualDataSource)return;throw new Error("sort: Missing or Invalid arguments!")}"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof JQX.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new JQX.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let d=e[0][t[r]];if(void 0===d&&e[0]&&e[0].children&&e[0].data&&(d=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}o.sortComparators&&o.sortComparators[t[r]]?s[r]=o.sortComparators[t[r]]:s[r]=c(d,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){JQX.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){JQX.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){const e=function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0};return e}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof JQX.Utilities.DateTime||e instanceof JQX.Utilities.BigNumber)t=function(e,t){return e.compare(t)};else if(e instanceof JQX.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new JQX.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}else t=function(e,t){return e-t}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}JQX.Ajax=window.Ajax=e})();
28
28
 
29
29
  /***/ }),
30
30
 
31
31
  /***/ 2052:
32
32
  /***/ (() => {
33
33
 
34
- (()=>{const e=-1*(new Date).getTimezoneOffset(),t=[{id:"Local",offset:e,offsetHours:e/60,displayName:"",supportsDaylightSavingTime:!1},{id:"Dateline Standard Time",offset:-720,offsetHours:-12,displayName:"(UTC-12:00) International Date Line West",supportsDaylightSavingTime:!1},{id:"UTC-11",offset:-660,offsetHours:-11,displayName:"(UTC-11:00) Coordinated Universal Time-11",supportsDaylightSavingTime:!1},{id:"Hawaiteratoran Standard Time",offset:-600,offsetHours:-10,displayName:"(UTC-10:00) Hawaiterator",supportsDaylightSavingTime:!1},{id:"Alaskan Standard Time",offset:-540,offsetHours:-9,displayName:"(UTC-09:00) Alaska",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time (Mexico)",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Baja California",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Pacific Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Arizona",supportsDaylightSavingTime:!1},{id:"Mountain Standard Time (Mexico)",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",supportsDaylightSavingTime:!0},{id:"Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Mountain Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central America Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central America",supportsDaylightSavingTime:!1},{id:"Canada Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Saskatchewan",supportsDaylightSavingTime:!1},{id:"Central Standard Time (Mexico)",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",supportsDaylightSavingTime:!0},{id:"SA Pacific Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",supportsDaylightSavingTime:!1},{id:"Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Eastern Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Indiana (East)",supportsDaylightSavingTime:!0},{id:"Venezuela Standard Time",offset:-270,offsetHours:-4.5,displayName:"(UTC-04:30) Caracas",supportsDaylightSavingTime:!1},{id:"Atlantic Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Atlantic Time (Canada)",supportsDaylightSavingTime:!0},{id:"Paraguay Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Asuncion",supportsDaylightSavingTime:!0},{id:"Central Brazilian Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Cuiaba",supportsDaylightSavingTime:!0},{id:"Pacific SA Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Santiago",supportsDaylightSavingTime:!0},{id:"SA Western Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",supportsDaylightSavingTime:!1},{id:"Newfoundland Standard Time",offset:-210,offsetHours:-3.5,displayName:"(UTC-03:30) Newfoundland",supportsDaylightSavingTime:!0},{id:"SA Eastern Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Cayenne, Fortaleza",supportsDaylightSavingTime:!1},{id:"Argentina Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Buenos Aires",supportsDaylightSavingTime:!0},{id:"E. South America Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Brasilia",supportsDaylightSavingTime:!0},{id:"Bahia Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Salvador",supportsDaylightSavingTime:!0},{id:"Montevideo Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Montevideo",supportsDaylightSavingTime:!0},{id:"Greenland Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Greenland",supportsDaylightSavingTime:!0},{id:"UTC-02",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Coordinated Universal Time-02",supportsDaylightSavingTime:!1},{id:"Mid-Atlantic Standard Time",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Mid-Atlantic - Old",supportsDaylightSavingTime:!0},{id:"Azores Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Azores",supportsDaylightSavingTime:!0},{id:"Cape Verde Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Cape Verde Is.",supportsDaylightSavingTime:!1},{id:"Morocco Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Casablanca",supportsDaylightSavingTime:!0},{id:"UTC",offset:0,offsetHours:0,displayName:"(UTC) Coordinated Universal Time",supportsDaylightSavingTime:!1},{id:"GMT Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Dublin, Edinburgh, Lisbon, London",supportsDaylightSavingTime:!0},{id:"Greenwich Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Monrovia, Reykjavik",supportsDaylightSavingTime:!1},{id:"Central European Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",supportsDaylightSavingTime:!0},{id:"Namibia Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Windhoek",supportsDaylightSavingTime:!0},{id:"W. Central Africa Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) West Central Africa",supportsDaylightSavingTime:!1},{id:"W. Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",supportsDaylightSavingTime:!0},{id:"Central Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",supportsDaylightSavingTime:!0},{id:"Romance Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",supportsDaylightSavingTime:!0},{id:"FLE Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",supportsDaylightSavingTime:!0},{id:"South Africa Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Harare, Pretoria",supportsDaylightSavingTime:!1},{id:"Turkey Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Istanbul",supportsDaylightSavingTime:!0},{id:"GTB Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Athens, Bucharest",supportsDaylightSavingTime:!0},{id:"Libya Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Tripoli",supportsDaylightSavingTime:!0},{id:"E. Europe Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) E. Europe",supportsDaylightSavingTime:!0},{id:"Jordan Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Amman",supportsDaylightSavingTime:!0},{id:"Middle East Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Beirut",supportsDaylightSavingTime:!0},{id:"Egypt Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Cairo",supportsDaylightSavingTime:!0},{id:"Syria Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Damascus",supportsDaylightSavingTime:!0},{id:"Israel Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Jerusalem",supportsDaylightSavingTime:!0},{id:"Arab Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kuwait, Riyadh",supportsDaylightSavingTime:!1},{id:"E. Africa Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Nairobi",supportsDaylightSavingTime:!1},{id:"Arabic Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Baghdad",supportsDaylightSavingTime:!0},{id:"Kaliningrad Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kaliningrad, Minsk",supportsDaylightSavingTime:!0},{id:"Iran Standard Time",offset:210,offsetHours:3.5,displayName:"(UTC+03:30) Tehran",supportsDaylightSavingTime:!0},{id:"Mauritius Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Port Louis",supportsDaylightSavingTime:!0},{id:"Georgian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Tbilisi",supportsDaylightSavingTime:!1},{id:"Caucasus Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Yerevan",supportsDaylightSavingTime:!0},{id:"Arabian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Abu Dhabi, Muscat",supportsDaylightSavingTime:!1},{id:"Azerbaijan Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Baku",supportsDaylightSavingTime:!0},{id:"Russian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",supportsDaylightSavingTime:!0},{id:"Afghanistan Standard Time",offset:270,offsetHours:4.5,displayName:"(UTC+04:30) Kabul",supportsDaylightSavingTime:!1},{id:"Pakistan Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Islamabad, Karachi",supportsDaylightSavingTime:!0},{id:"West Asia Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Ashgabat, Tashkent",supportsDaylightSavingTime:!1},{id:"India Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",supportsDaylightSavingTime:!1},{id:"Sri Lanka Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Sri Jayawardenepura",supportsDaylightSavingTime:!1},{id:"Nepal Standard Time",offset:345,offsetHours:5.75,displayName:"(UTC+05:45) Kathmandu",supportsDaylightSavingTime:!1},{id:"Central Asia Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Astana",supportsDaylightSavingTime:!1},{id:"Bangladesh Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Dhaka",supportsDaylightSavingTime:!0},{id:"Ekaterinburg Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Ekaterinburg",supportsDaylightSavingTime:!0},{id:"Myanmar Standard Time",offset:390,offsetHours:6.5,displayName:"(UTC+06:30) Yangon (Rangoon)",supportsDaylightSavingTime:!1},{id:"SE Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Bangkok, Hanoi, Jakarta",supportsDaylightSavingTime:!1},{id:"N. Central Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Novosibirsk",supportsDaylightSavingTime:!0},{id:"Ulaanbaatar Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Ulaanbaatar",supportsDaylightSavingTime:!1},{id:"China Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",supportsDaylightSavingTime:!1},{id:"Singapore Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Kuala Lumpur, Singapore",supportsDaylightSavingTime:!1},{id:"North Asia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Krasnoyarsk",supportsDaylightSavingTime:!0},{id:"Taipei Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Taipei",supportsDaylightSavingTime:!1},{id:"W. Australia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Perth",supportsDaylightSavingTime:!0},{id:"Korea Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Seoul",supportsDaylightSavingTime:!1},{id:"North Asia East Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Irkutsk",supportsDaylightSavingTime:!0},{id:"Tokyo Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Osaka, Sapporo, Tokyo",supportsDaylightSavingTime:!1},{id:"AUS Central Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Darwin",supportsDaylightSavingTime:!1},{id:"Cen. Australia Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Adelaide",supportsDaylightSavingTime:!0},{id:"West Pacific Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Guam, Port Moresby",supportsDaylightSavingTime:!1},{id:"Tasmania Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Hobart",supportsDaylightSavingTime:!0},{id:"E. Australia Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Brisbane",supportsDaylightSavingTime:!1},{id:"AUS Eastern Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Canberra, Melbourne, Sydney",supportsDaylightSavingTime:!0},{id:"Yakutsk Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Yakutsk",supportsDaylightSavingTime:!0},{id:"Vladivostok Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Vladivostok",supportsDaylightSavingTime:!0},{id:"Central Pacific Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Solomon Is., New Caledonia",supportsDaylightSavingTime:!1},{id:"Magadan Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Magadan",supportsDaylightSavingTime:!0},{id:"Kamchatka Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",supportsDaylightSavingTime:!0},{id:"Fiji Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Fiji",supportsDaylightSavingTime:!0},{id:"New Zealand Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Auckland, Wellington",supportsDaylightSavingTime:!0},{id:"UTC+12",offset:720,offsetHours:12,displayName:"(UTC+12:00) Coordinated Universal Time+12",supportsDaylightSavingTime:!1},{id:"Tonga Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Nuku'alofa",supportsDaylightSavingTime:!1},{id:"Samoa Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Samoa",supportsDaylightSavingTime:!0}],a=[0,31,59,90,120,151,181,212,243,273,304,334,365],s=[0,31,60,91,121,152,182,213,244,274,305,335,366];JQX.Utilities.Assign("TimeSpan",class{constructor(){const e=this;if(e.ticksPerMillisecond=1e4,e.millisecondsPerTick=1e-4,e.ticksPerSecond=1e7,e.secondsPerTick=1e-7,e.ticksPerMinute=6e8,e.minutesPerTick=1/6e8,e.ticksPerHour=36e9,e.hoursPerTick=1/36e9,e.ticksPerDay=864e9,e.daysPerTick=1/864e9,e.millisPerSecond=1e3,e.millisPerMinute=6e4,e.millisPerHour=36e5,e.millisPerDay=864e5,e._ticks=0,1===arguments.length){if(isNaN(arguments[0]))throw new Error("Argument must be a number.");e._ticks=arguments[0]}else if(3===arguments.length)e._ticks=e.timeToMS(arguments[0],arguments[1],arguments[2],0);else if(4===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+0;e._ticks=t*e.ticksPerMillisecond}else if(5===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+arguments[4];e._ticks=t*e.ticksPerMillisecond}}ticks(){return this._ticks}days(){return parseInt(this._ticks/this.ticksPerDay)}timeToMS(e,t,a,s){return parseInt((3600*e+60*t+a+s/1e3)*this.ticksPerSecond)}hours(){return parseInt(this._ticks/this.ticksPerHour)%24}milliseconds(){return parseInt(this._ticks/this.ticksPerMillisecond)%1e3}minutes(){return parseInt(this._ticks/this.ticksPerMinute)%60}seconds(){return parseInt(this._ticks/this.ticksPerSecond)%60}totalDays(){return parseInt(this._ticks*this.daysPerTick)}totalHours(){return parseInt(this._ticks*this.hoursPerTick)}totalMilliseconds(){const e=this._ticks*this.millisecondsPerTick;return parseInt(e)}totalMinutes(){return parseInt(this._ticks*this.minutesPerTick)}totalSeconds(){return parseInt(this._ticks*this.secondsPerTick)}add(e){const t=this._ticks+e._ticks;return new JQX.Utilities.TimeSpan(t)}subtract(e){const t=this._ticks-e._ticks;return new JQX.Utilities.TimeSpan(t)}duration(){const e=this;return e._ticks>=0?new JQX.Utilities.TimeSpan(e._ticks):new JQX.Utilities.TimeSpan(-e._ticks)}equals(e){return this._ticks===e._ticks}valueOf(){return this._ticks}compare(e,t){return e._ticks>t._ticks?1:e._ticks<t._ticks?-1:0}interval(e,t){const a=e*t+(e>=0?.5:-.5);return new JQX.Utilities.TimeSpan(a*this.ticksPerMillisecond)}fromDays(e){return this.interval(e,this.millisPerDay)}fromHours(e){return this.interval(e,this.millisPerHour)}fromMilliseconds(e){return this.interval(e,1)}fromMinutes(e){return this.interval(e,this.millisPerMinute)}fromSeconds(e){return this.interval(e,this.millisPerSecond)}fromTicks(e){return new JQX.Utilities.TimeSpan(e)}toString(){return this.totalMilliseconds().toString()}negate(){return new JQX.Utilities.TimeSpan(-this._ticks)}}),JQX.Utilities.Assign("DateTime",class{constructor(){function e(e){const t=i.regexISOString.exec(e);r=new JQX.Utilities.DateTime(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),0,0,0,0,0,0,0,"UTC")}const i=this;let r;if(i.ticksPerMillisecond=1e4,i.millisecondsPerTick=1e-4,i.ticksPerSecond=1e7,i.secondsPerTick=1e-7,i.ticksPerMinute=6e8,i.minutesPerTick=1/6e8,i.ticksPerHour=36e9,i.hoursPerTick=1/36e9,i.ticksPerDay=864e9,i.daysPerTick=1/864e9,i.millisPerSecond=1e3,i.millisPerMinute=6e4,i.millisPerHour=36e5,i.millisPerDay=864e5,i.daysPerYear=365,i.daysPer4Years=1461,i.daysPer100Years=36524,i.daysPer400Years=146097,i.daysTo1601=584388,i.daysTo1899=693593,i.daysTo10000=3652059,i.minTicks=0,i.maxTicks=3155378976e9,i.maxMillis=3155378976e5,i.datePartYear=0,i.datePartDayOfYear=1,i.datePartMonth=2,i.datePartDay=3,i.daysToMonth365=a,i.daysToMonth366=s,i.minValue=new Date(0),i.maxValue=new Date(3155378976e9),i.ticksMask=0x4000000000000000,i.flagsMask=0xc000000000000000,i.localMask=0x8000000000000000,i.ticksCeiling=0x4000000000000000,i.kindUnspecified=0,i.kindUtc=0x4000000000000000,i.kindLocal=0x8000000000000000,i.kindLocalAmbiguousDst=0xc000000000000000,i.kindShift=62,i.regexTrim=/^\s+|\s+$/g,i.regexInfinity=/^[+-]?infinity$/i,i.regexHex=/^0x[a-f0-9]+$/i,i.regexParseFloat=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,i.regexISOString=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/,i.calendar={"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",FP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",FPA:"yyyy/MM/dd HH:mm:ss:fffuunnppeeaaxxoo",FPA2:"yyyy-MM-dd HH:mm:ss:fffuunnppeeaaxxoo",FT:"HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",PP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp",PT:"HH:mm:ss:fff:uu:nn:pp"},percentsymbol:"%",currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:","},i.dateData=0,i.timeZone=null,i.timeZones=t,i._codeToUnit={u:"_microsecond",uu:"_microsecond",n:"_nanosecond",nn:"_nanosecond",p:"_picosecond",pp:"_picosecond",e:"_femtosecond",ee:"_femtosecond",a:"_attosecond",aa:"_attosecond",x:"_zeptosecond",xx:"_zeptosecond",o:"_yoctosecond",oo:"_yoctosecond"},i._smallUnits=["_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"],i._microsecond=0,i._nanosecond=0,i._picosecond=0,i._femtosecond=0,i._attosecond=0,i._zeptosecond=0,i._yoctosecond=0,0===arguments.length){const e=new Date;i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else if(1===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}}else if(2===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}i.validateTimeZone(arguments[1])}else if(arguments.length>2)if("string"==typeof arguments[0]){const e=i.tryparseDate(arguments[0],arguments[2],arguments[1]);i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else{let e=arguments[0],t=arguments[1]-1,a=arguments[2],s=arguments[3]||0,r=arguments[4]||0,n=arguments[5]||0,o=arguments[6]||0,d=arguments[7]||0,l=arguments[8]||0,f=arguments[9]||0,m=arguments[10]||0,c=arguments[11]||0,u=arguments[12]||0,y=arguments[13]||0;e>=2100&&(e=2100),t>=12?t=11:t<0&&(t=0),a>31?a=i.daysInMonth(e,1+t):a<0&&(a=0),s>23?s=23:s<0&&(s=0),r>59?r=59:r<0&&(r=0),n>59?n=59:n<0&&(n=0);const p=new Date(e,t,a,s,r,n,o);e<1970&&p.setFullYear(e),i.dateData=i.dateToMS(p.getFullYear(),p.getMonth()+1,p.getDate())+i.timeToMS(p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds()),i._microsecond=d,i._nanosecond=l,i._picosecond=f,i._femtosecond=m,i._attosecond=c,i._zeptosecond=u,i._yoctosecond=y,arguments[14]&&i.validateTimeZone(arguments[14])}if(i.timeZone||i.validateTimeZone("Local"),r){const e=r.toTimeZone(i.timeZone);i.dateData=e.dateData}}static isValidDate(e){const t=this.validateDate(e);return!(!t||t&&!t.dateData)}static validateDate(e,t,a){if(e instanceof JQX.Utilities.DateTime)return e;if(e instanceof Date)return new JQX.Utilities.DateTime(e);try{if("string"==typeof e&&a)return this.parseDateString(e,t,a);if(new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}(, \d{1,2}:\d{2}:\d{1,2} [A|P]M)?$/).test(e)){const t=new Date(e);if(!isNaN(t.getTime()))return new JQX.Utilities.DateTime(t)}if("string"==typeof e)return this.parseDateString(e,t,a);if("number"==typeof e)return new JQX.Utilities.DateTime(new Date(e))}catch(e){}return t}static parseDateString(e,t,a){const s=new Date(e);if(!isNaN(s.getTime()))return e&&"string"==typeof e&&a?new JQX.Utilities.DateTime(e,a,null):new JQX.Utilities.DateTime(s);const i=e.indexOf("Date("),r=e.indexOf("DateTime("),n=e.lastIndexOf(")");let o=e;if(-1===i&&-1===r||-1===n){const t=new JQX.Utilities.DateTime,s=t.parseDate(e,a);if(s)return o=new JQX.Utilities.DateTime(s),t.copySmallTimePartValues(o),o}else{if(o=-1!==i?e.slice(i+5,n):e.slice(r+9,n),o=o.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===o.trim())return new JQX.Utilities.DateTime;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+(\s*,\s*[a-zA-Z ]+)?$)/g).test(o))return o=o.split(","),o.map((function(e,t){isNaN(o[t])?o[t]=e.trim():o[t]=parseInt(e)})),-1!==i&&o[1]++,o.unshift(null),o=new(Function.prototype.bind.apply(JQX.Utilities.DateTime,o)),o}if(""===o.trim())return t;if(!isNaN(o))return o=new Date(parseInt(o,10)),new JQX.Utilities.DateTime(o);try{const e=o.split(",");2===e.length?(e[1]=e[1].trim(),e.unshift(null),o=new(Function.prototype.bind.apply(JQX.Utilities.DateTime,e))):o=new JQX.Utilities.DateTime(o)}catch(e){o=t}return o}static fromFullTimeStamp(e){e=e.toString();const t=new JQX.Utilities.DateTime(parseFloat(e.slice(0,e.length-21)));let a=e.slice(e.length-21),s=0;for(;a.length>0;)t[t._smallUnits[s]]=parseInt(a.slice(0,3),10),a=a.slice(3),s++;return t}static getConstructorParameters(e){return[e.year(),e.month(),e.day(),e.hour(),e.minute(),e.second(),e.millisecond(),e._microsecond,e._nanosecond,e._picosecond,e._femtosecond,e._attosecond,e._zeptosecond,e._yoctosecond,e.timeZone]}static detectDisplayMode(e,t,a){if(e.calendar.patterns[t])return-1!==["d","D","M","Y","d1","d2"].indexOf(t)?"calendar":-1!==["t","T","FT","PT"].indexOf(t)?"timePicker":"default";const s=["d","M","y"],i=["h","H","m","s","t","f","u","n","p","e","a","x","o"],r=a.groups;let n=!1,o=!1;for(let e=0;e<r.length;e++){const t=r[e].charAt(0);if(-1!==s.indexOf(t)?n=!0:-1!==i.indexOf(t)&&(o=!0),n&&o)break}return n===o?"default":n?"calendar":"timePicker"}static getLocalizedNames(e){const t={names:[],namesAbbr:[],namesShort:[]},a={names:[],namesAbbr:[]};if(this[e])return this[e];for(let a=23;a<30;a++){const s=new Date(2017,6,a),i=s.toLocaleString(e,{weekday:"long"});t.names.push(i),t.namesAbbr.push(s.toLocaleString(e,{weekday:"short"})),t.namesShort.push(i.substring(0,2))}for(let t=0;t<12;t++){const s=new Date(2017,t,1).toLocaleString(e,{month:"long"});a.names.push(s),a.namesAbbr.push(s.substring(0,3))}return a.names.push(""),a.namesAbbr.push(""),this[e]={days:t,months:a},this[e]}internalMS(){return this.dateData}getDatePart(e){const t=this,a=t.internalMS();let s=parseInt(a/t.millisPerDay);const i=parseInt(s/t.daysPer400Years);s-=i*t.daysPer400Years;let r=parseInt(s/t.daysPer100Years);4===r&&(r=3),s-=r*t.daysPer100Years;const n=parseInt(s/t.daysPer4Years);s-=n*t.daysPer4Years;let o=parseInt(s/t.daysPerYear);if(4===o&&(o=3),e===t.datePartYear)return parseInt(400*i+100*r+4*n+o+1);if(s-=o*t.daysPerYear,e===t.datePartDayOfYear)return parseInt(s+1);const d=3===o&&(24!==n||3===r)?t.daysToMonth366:t.daysToMonth365;let l=s>>6;for(;s>=d[l];)l++;return e===t.datePartMonth?parseInt(l):parseInt(s-d[l-1]+1)}dayOfWeek(){const e=this.dateData;return parseInt(e/this.millisPerDay+1)%7}dayOfYear(){return this.getDatePart(this.datePartDayOfYear)}weekOfYear(e){const t=this.toDate(),a=e||this.calendar.firstDay,s=new Date(t.getFullYear(),0,1),i=Math.floor((t.getTime()-s.getTime()-6e4*(t.getTimezoneOffset()-s.getTimezoneOffset()))/864e5)+1;let r,n=s.getDay()-a;if(n=n>=0?n:n+7,n<4){if(r=Math.floor((i+n-1)/7)+1,r>52){let e=new Date(t.getFullYear()+1,0,1).getDay()-a;e=e>=0?e:e+7,r=e<4?1:53}}else r=Math.floor((i+n-1)/7);return r}subtract(e){const t=this;return new JQX.Utilities.TimeSpan(t.dateData*t.ticksPerMillisecond-e.dateData*t.ticksPerMillisecond)}dateToMS(e,t,a){const s=this;if(e>=1&&e<=9999&&t>=1&&t<=12){e=parseInt(e);const i=s.isLeapYear(e)?s.daysToMonth366:s.daysToMonth365;if(a>=1&&a<=i[t]-i[t-1]){const r=e-1;return(365*r+parseInt(r/4)-parseInt(r/100)+parseInt(r/400)+i[t-1]+a-1)*s.millisPerDay}}}isLeapYear(e){if(e<1||e>9999)throw new Error("Year out of Range");return e%4==0&&(e%100!=0||e%400==0)}timeToMS(e,t,a,s){const i=this;if(e>=0&&e<24&&t>=0&&t<60&&a>=0&&a<60){const r=parseInt(3600*e+60*t+a);return s>0&&s<1e3?r*i.millisPerSecond+s:r*i.millisPerSecond}}daysInMonth(e,t){if(t<1||t>12)throw new Error("Month out of Range");const a=this,s=a.isLeapYear(e)?a.daysToMonth366:a.daysToMonth365;return s[t]-s[t-1]}arrayIndexOf(e,t){return e.indexOf(t)}startsWith(e,t){return 0===e.indexOf(t)}endsWith(e,t){return e.substr(e.length-t.length)===t}trim(e){return(e+"").replace(this.regexTrim,"")}expandFormat(e,t){t=t||"F";let a,s=e.patterns,i=t.length;if(s[t])return s[t];if(1===i){if(a=s[t],!a)throw"Invalid date format string '"+t+"'.";t=a}else 2===i&&"%"===t.charAt(0)&&(t=t.charAt(1));return t}getEra(e,t){if(!t)return 0;if("string"==typeof e)return 0;let a,s=e.getTime();for(let e=0,i=t.length;e<i;e++)if(a=t[e].start,null===a||s>=a)return e;return 0}toUpper(e){return e.split(" ").join(" ").toUpperCase()}toUpperArray(e){const t=[];for(let a=0,s=e.length;a<s;a++)t[a]=this.toUpper(e[a]);return t}getEraYear(e,t,a,s){let i=e.getFullYear();return!s&&t.eras&&(i-="number"==typeof a?a:t.eras[a].offset),i}getDayIndex(e,t,a){const s=this,i=e.days;let r,n=e._upperDays;return n||(e._upperDays=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr),s.toUpperArray(i.namesShort)]),t=t.toUpperCase(),a?(r=s.arrayIndexOf(n[1],t),-1===r&&(r=s.arrayIndexOf(n[2],t))):r=s.arrayIndexOf(n[0],t),r}getMonthIndex(e,t,a){const s=this;let i=e.months,r=e.monthsGenitive||e.months,n=e._upperMonths,o=e._upperMonthsGen;n||(e._upperMonths=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr)],e._upperMonthsGen=o=[s.toUpperArray(r.names),s.toUpperArray(r.namesAbbr)]),t=s.toUpper(t);let d=s.arrayIndexOf(a?n[1]:n[0],t);return d<0&&(d=s.arrayIndexOf(a?o[1]:o[0],t)),d}appendPreOrPostMatch(e,t){let a=0,s=!1;for(let i=0,r=e.length;i<r;i++){const r=e.charAt(i);switch(r){case"'":s?t.push("'"):a++,s=!1;break;case"\\":s&&t.push("\\"),s=!s;break;default:t.push(r),s=!1}}return a}getTokenRegExp(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyyy|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|uu|u|nn|n|pp|p|ee|e|aa|a|xx|x|oo|o|i{1,24}|zzz|zz|z|gg|g/g}static ParseDate(e,t){return(new JQX.Utilities.DateTime).tryparseDate(e,null,t)}tryparseDate(e,t,a){const s=this;if(null==t&&(t=s.calendar),void 0!==a){if(Array.isArray(a))for(let i=0;i<a.length;i++){const r=s.parseDate(e,a[i],t);if(r)return r}const i=s.parseDate(e,a,t);if(i)return i}if(""===e)return null;if(null==e||e.substring||(e=e.toString()),null!=e&&"/Date("===e.substring(0,6)){const t=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;let a=new Date(+e.replace(/\/Date\((\d+)\)\//,"$1"));if("Invalid Date"===a){const t=e.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);a=null,t&&(a=new Date(1*t[1]+36e5*t[2]+6e4*t[3]))}if(null==a||"Invalid Date"===a||isNaN(a)){const a=t.exec(e);if(a){const e=new Date(parseInt(a[1]));if(a[2]){let t=parseInt(a[3]);"-"===a[2]&&(t=-t);const s=e.getUTCMinutes();e.setUTCMinutes(s-t)}if(!isNaN(e.valueOf()))return e}}return a}const i={jqxdate:"yyyy-MM-dd HH:mm:ss",d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",d3:"MM-dd-yyyy",d4:"MM.dd.yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",custom3:"yyyy-MM-ddTHH:mm:ss.fff+HH:mm",custom4:"yyyy-MM-ddTHH:mm:ss.fff-HH:mm",custom5:"yyyy-MM-ddTHH:mm:ss.ffffff+HH:mm",custom6:"yyyy-MM-ddTHH:mm:ss.ffffff-HH:mm",custom7:"yyyy-MM-ddTHH:mm:ss.fffffff+HH:mm",custom8:"yyyy-MM-ddTHH:mm:ss.fffffff-HH:mm",iso:"yyyy-MM-ddTHH:mm:ssZ",iso2:"yyyy-MM-ddTHH:mm.fffZ",iso_date1:"yyyy-MM-dd",iso_date2:"yyyy-MM-dd",iso_date3:"yyyy-ddd",iso_date4:"yyyy-MM-dd HH:mm",iso_date5:"yyyy-MM-dd HH:mm Z",iso_date6:"yyyy-MMM-dd",iso_date7:"yyyy-MM",iso_date8:"yyyy-MMM",iso_date9:"yyyy-MMMM",iso_date10:"yyyy-MMMM-dd",iso_time1:"HH:mm:ss.tttt",iso_time2:"HH:mm:ss",iso_time3:"HH:mm",iso_time4:"HH",iso_time5:"yyyyyy-MM-dd",iso_time6:"yyyyyy-MM-dd",iso_time7:"dd/MM/yyyy HH:mm",iso_time8:"dd.MM.yyyy HH:mm",iso_time9:"dd-MM-yyyy HH:mm",iso_time10:"MM.dd.yyyy HH:mm",iso_time11:"MM-dd-yyyy HH:mm",iso_time12:"dd/MM/yyyy",iso_time13:"MM.dd.yyyy h:mm tt",iso_time14:"MM-dd-yyyy h:mm tt",iso_time15:"MM/dd/yyyy h:mm tt"};for(let a in i){const r=s.parseDate(e,i[a],t);if(r)return r}const r=t.patterns;for(let a in r){const i=s.parseDate(e,r[a],t);if(i){if("ISO"===a){const a=s.parseDate(e,r.ISO2,t);if(a)return a}return i}}let n;if("string"==typeof e){const a=[":","/","-"," ",","];let i="",r=e=function(e,t,a){return a.replace(new RegExp(e,"g"),t)}(", ",",",e=s.trim(e));e.indexOf(":")>=0?(i=e.substring(e.indexOf(":")-2),i=s.trim(i),r=e.substring(0,e.indexOf(":")-2)):e.toUpperCase().indexOf("AM")>=0?(i=e.substring(e.toUpperCase().indexOf("AM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("AM")-2)):e.toUpperCase().indexOf("PM")>=0&&(i=e.substring(e.toUpperCase().indexOf("PM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("PM")-2));let o=new Date,d=!1;if(r){for(let e=0;e<a.length;e++)if(r.indexOf(a[e])>=0){n=r.split(a[e]);break}if(!n)return null;let e=new Array,i=new Array,l=new Array,f=null,m=null;for(let a=0;a<n.length;a++){const i=n[a],r=s.parseDate(i,"d",t)||s.parseDate(i,"dd",t)||s.parseDate(i,"ddd",t)||s.parseDate(i,"dddd",t);if(r&&(e.push(r.getDate()),i.length>2)){f=a;break}}for(let e=0;e<n.length;e++){const a=n[e],r=s.parseDate(a,"M",t)||s.parseDate(a,"MM",t)||s.parseDate(a,"MMM",t)||s.parseDate(a,"MMMM",t);if(r){if(null!=f&&f===e)continue;if(i.push(r.getMonth()),a.length>2){m=e;break}}}for(let e=0;e<n.length;e++){const a=n[e],i=s.parseDate(a,"yyyy",t);if(i){if(null!=f&&f===e)continue;if(null!=m&&m===e)continue;l.push(i.getFullYear())}}const c=new Array;for(let t=e.length-1;t>=0;t--)for(let a=0;a<i.length;a++)for(let s=0;s<l.length;s++){const r=new Date(l[s],i[a],e[t]);l[s]<1970&&r.setFullYear(l[s]),isNaN(r.getTime())||c.push(r)}c.length>0&&(o=c[0],d=!0)}if(i){const e=i.indexOf(":")>=0?i.split(":"):i,a=s.parseDate(i,"h:mm tt",t)||s.parseDate(i,"HH:mm:ss.fff",t)||s.parseDate(i,"HH:mm:ss.ff",t)||s.parseDate(i,"h:mm:ss tt",t)||s.parseDate(i,"HH:mm:ss.tttt",t)||s.parseDate(i,"HH:mm:ss",t)||s.parseDate(i,"HH:mm",t)||s.parseDate(i,"HH",t);let r=0,n=0,l=0,f=0;a&&!isNaN(a.getTime())?(r=a.getHours(),n=a.getMinutes(),l=a.getSeconds(),f=a.getMilliseconds()):(1===e.length&&(r=parseInt(e[0])),2===e.length&&(r=parseInt(e[0]),n=parseInt(e[1])),3===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),e[2].indexOf(".")>=0?(l=parseInt(e[2].toString().split(".")[0]),f=parseInt(e[2].toString().split(".")[1])):l=parseInt(e[2])),4===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),l=parseInt(e[2]),f=parseInt(e[3]))),!o||isNaN(r)||isNaN(n)||isNaN(l)||isNaN(f)||(o.setHours(r,n,l,f),d=!0)}if(d)return o}if(null!=e){n=[":","/","-"];let t=!0;for(let a=0;a<n.length;a++)-1!==e.indexOf(n[a])&&(t=!1);if(t){const t=new Number(e);if(!isNaN(t))return new Date(t)}}return null}getParseRegExp(e,t){const a=this;let s=e._parseRegExp;if(s){const e=s[t];if(e)return e}else e._parseRegExp=s={};let i,r=a.expandFormat(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),n=["^"],o=[],d=0,l=0,f=a.getTokenRegExp();for(;null!==(i=f.exec(r));){const e=r.slice(d,i.index);if(d=f.lastIndex,l+=a.appendPreOrPostMatch(e,n),l%2){n.push(i[0]);continue}let t,s=i[0],m=s.length;switch(s){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":t="(\\D+)";break;case"tt":case"t":t="(\\D*)";break;case"yyyyy":t="(\\d{1,4})";break;case"yyyy":t="(\\d{"+m+"})";break;case"fff":case"ff":case"f":t="(\\d{1,"+m+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":t="(\\d\\d?)";break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":t="(\\d{1,3})";break;case"zzz":t="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":t="([+-]?\\d\\d?)";break;case"/":t="/";break;default:if(!/i{1,24}/.test(s))throw"Invalid date format pattern '"+s+"'.";t="(\\d{"+s.length+"})"}t&&n.push(t),"/"!==s&&o.push(i[0])}a.appendPreOrPostMatch(r.slice(d),n),n.push("$");const m={regExp:n.join("").replace(/\s+/g,"\\s+"),groups:o};return s[t]=m}outOfRange(e,t,a){return e<t||e>a}expandYear(e,t){const a=this,s=new Date,i=a.getEra(s);if(t<100){let r=e.twoDigitYearMax;r="string"==typeof r?(new Date).getFullYear()%100+parseInt(r,10):r;const n=a.getEraYear(s,e,i);(t+=n-n%100)>r&&(t-=100)}return t}padZeros(e,t){let a,s=e+"";return t>1&&s.length<t?(a=["0","00","000"][t-2]+s,a.substr(a.length-t,t)):(a=s,a)}parseDate(e,t,a){const s=this;null==a&&(a=s.calendar),e=s.trim(e);const i=a,r=s.getParseRegExp(i,t),n=new RegExp(r.regExp).exec(e);if(null===n)return null;let o,d=r.groups,l=null,f=null,m=null,c=null,u=null,y=0,p=0,g=0,h=0,T=null,M=!1;for(let e=0,t=d.length;e<t;e++){const t=n[e+1];if(t){const a=d[e],r=a.length,n=parseInt(t,10);switch(a){case"dd":case"d":if(c=n,s.outOfRange(c,1,31))return null;break;case"MMM":case"MMMM":case"MMMMM":case"MMMMMM":case"MMMMMMM":case"MMMMMMMM":if(m=s.getMonthIndex(i,t,3===r),s.outOfRange(m,0,11))return null;break;case"M":case"MM":if(m=n-1,s.outOfRange(m,0,11))return null;break;case"y":case"yy":case"yyyy":if(f=r<4?s.expandYear(i,n):n,s.outOfRange(f,0,9999))return null;break;case"h":case"hh":if(y=n,12===y&&(y=0),s.outOfRange(y,0,11))return null;break;case"H":case"HH":if(y=n,s.outOfRange(y,0,23))return null;break;case"m":case"mm":if(p=n,s.outOfRange(p,0,59))return null;break;case"s":case"ss":if(g=n,s.outOfRange(g,0,59))return null;break;case"tt":case"t":if(M=i.PM&&(t===i.PM[0]||t===i.PM[1]||t===i.PM[2]),!M&&(!i.AM||t!==i.AM[0]&&t!==i.AM[1]&&t!==i.AM[2]))return null;break;case"f":case"ff":case"fff":if(h=n*Math.pow(10,3-r),s.outOfRange(h,0,999))return null;break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":if(s.outOfRange(n,0,1e3))return null;s[s._codeToUnit[a]]=n;break;case"ddd":case"dddd":if(u=s.getDayIndex(i,t,3===r),s.outOfRange(u,0,6))return null;break;case"zzz":{const e=t.split(/:/);if(2!==e.length)return null;if(o=parseInt(e[0],10),s.outOfRange(o,-12,13))return null;const a=parseInt(e[1],10);if(s.outOfRange(a,0,59))return null;T=60*o+(s.startsWith(t,"-")?-a:a);break}case"z":case"zz":if(o=n,s.outOfRange(o,-12,13))return null;T=60*o;break;case"g":case"gg":{let e=t;if(!e||!i.eras)return null;e=this.trim(e.toLowerCase());for(let t=0,a=i.eras.length;t<a;t++)if(e===i.eras[t].nathat.toLowerCase()){l=t;break}if(null===l)return null;break}default:{let e=t;e.length%3==1?e+="00":e.length%3==2&&(e+="0"),h=parseInt(e.slice(0,3),10),e=e.slice(3);let a=0;for(;e.length>0;)s[s._smallUnits[a]]=parseInt(e.slice(0,3),10),e=e.slice(3),a++}}}}let S,D=new Date,H=i.convert;if(S=D.getFullYear(),null===f?f=S:i.eras&&(f+=i.eras[l||0].offset),null===m&&(m=0),null===c&&(c=1),H){if(D=H.toGregorian(f,m,c),null===D)return null}else{if(D.setFullYear(f,m,c),D.getDate()!==c)return null;if(null!==u&&D.getDay()!==u)return null}if(M&&y<12&&(y+=12),D.setHours(y,p,g,h),null!==T){const e=D.getMinutes()-(T+D.getTimezoneOffset());D.setHours(D.getHours()+parseInt(e/60,10),e%60)}return D}toString(e,t){const a=this;void 0===e&&(e="yyyy-MM-dd HH:mm:ss");const s=a.dateData.toString()+a.getFractionsOfSecondStamp()+e+(a.timeZone||"");if(JQX.Utilities.DateTime.cache&&JQX.Utilities.DateTime.cache[s]&&!1!==a.showTodayDateAsString)return JQX.Utilities.DateTime.cache[s];const i=a.toDate();if(null==t&&(t=a.calendar),"string"==typeof i)return i;if(!e||!e.length||"i"===e){let e;return e=a.formatDate(i,t.patterns.F,t),e}const r=t.eras,n="s"===e;e=a.expandFormat(t,e);const o=[];let d,l=0,f=a.getTokenRegExp();function m(e,t){if(void 0!==e.getMonth)switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate()}}for(;;){const s=f.lastIndex,c=f.exec(e),u=e.slice(s,c?c.index:e.length);if(l+=a.appendPreOrPostMatch(u,o),!c)break;if(l%2){o.push(c[0]);continue}const y=c[0],p=y.length;let g;if(/i{1,24}/.test(y))o.push(a.getFirstNDigitsOfPrecision(y.length));else switch(y){case"ddd":case"dddd":{const e=3===p?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),p));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===p?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,p));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,r),n),p<4&&(g%=100),o.push(a.padZeros(g,p));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,p));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),p));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),p));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),p));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===p?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,p));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[y]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[y]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),p));break;case"zzz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),2)+":"+a.padZeros(60*Math.abs(a.timeZoneOffsetHours%1),2));break;case"g":case"gg":t.eras&&o.push(t.eras[a.getEra(i,r)].name);break;case"/":o.push(t["/"]);break;default:throw"Invalid date format pattern '"+y+"'."}}let c=o.join("");if(JQX.Utilities.DateTime.cache||(JQX.Utilities.DateTime.cache=new Array),a._today||(a._today=new Date),a.calendar&&a.calendar.today&&-1===e.indexOf(":")&&i.getFullYear()===a._today.getFullYear()&&i.getDate()===a._today.getDate()&&i.getMonth()===a._today.getMonth()){if(!1===a.showTodayDateAsString)return JQX.Utilities.DateTime.cache[s]=c,c;c=a.calendar.today}return JQX.Utilities.DateTime.cache[s]=c,c}getFractionsOfSecondStamp(){const e=this;return e._microsecond.toString()+e._nanosecond+e._picosecond+e._femtosecond+e._attosecond+e._zeptosecond+e._yoctosecond}getFirstNDigitsOfPrecision(e,t){const a=this;return(""+(!0!==t?a.padZeros(a.millisecond(),3):"")+a.padZeros(a._microsecond,3)+a.padZeros(a._nanosecond,3)+a.padZeros(a._picosecond,3)+a.padZeros(a._femtosecond,3)+a.padZeros(a._attosecond,3)+a.padZeros(a._zeptosecond,3)+a.padZeros(a._yoctosecond,3)).slice(0,e)}copySmallTimePartValues(e){const t=this;e._microsecond=t._microsecond,e._nanosecond=t._nanosecond,e._picosecond=t._picosecond,e._femtosecond=t._femtosecond,e._attosecond=t._attosecond,e._zeptosecond=t._zeptosecond,e._yoctosecond=t._yoctosecond}add(e,t,a){const s=this,i=s.internalMS();if(void 0===t){if(!1===a)return s.dateData=i+parseInt(e._ticks/s.ticksPerMillisecond),s;const t=new JQX.Utilities.DateTime(i+parseInt(e._ticks/s.ticksPerMillisecond));return s.copyTimeZone(t),s.copySmallTimePartValues(t),t}const r=e*t;if(r<=-s.maxMillis||r>=s.maxMillis)throw new Error("Out of Range");if(!1===a)return s.dateData=i+r,s;const n=new JQX.Utilities.DateTime(i+r);return s.copyTimeZone(n),s.copySmallTimePartValues(n),n}addDays(e,t){return this.add(e,this.millisPerDay,t)}clone(){const e=this,t=new JQX.Utilities.DateTime(e.dateData);return e.copyTimeZone(t),e.copySmallTimePartValues(t),t}clearTime(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new JQX.Utilities.DateTime(a,t,s,0,0,0,0);return e.copyTimeZone(i),i}addHours(e,t){return this.add(e,this.millisPerHour,t)}addDeciseconds(e,t){return this.add(100*e,1,t)}addCentiseconds(e,t){return this.add(10*e,1,t)}addMilliseconds(e,t){return this.add(e,1,t)}addMinutes(e,t){return this.add(e,this.millisPerMinute,t)}addMonths(e,t){const a=this;if(e<-12e4||e>12e4)throw new Error("Invalid Months Value");let s=parseInt(a.getDatePart(a.datePartYear)),i=parseInt(a.getDatePart(a.datePartMonth)),r=parseInt(a.getDatePart(a.datePartDay));if(e%12==0)s+=e/12;else{const t=i-1+e;t>=0?(i=t%12+1,s+=t/12):(i=12+(t+1)%12,s+=(t-11)/12),s=parseInt(s)}if(s<1||s>9999)throw new Error("Year out of range");const n=a.daysInMonth(s,i);if(r>n&&(r=n),!1===t)return a.dateData=a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay,a;const o=new JQX.Utilities.DateTime(a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay);return a.copyTimeZone(o),a.copySmallTimePartValues(o),o}addSeconds(e,t){return this.add(e,this.millisPerSecond,t)}addYears(e,t){return this.addMonths(12*e,t)}addMicroseconds(e,t){if(0===e)return;const a=this;let s,i;e<0&&0===a.hour()&&0===a.minute()&&0===a.second()&&0===a.millisecond()&&0===a._microsecond&&(s=parseInt(e/1e3,10)-1,i=1e3+e%1e3);const r=1e3*a.timeToMS(a.hour(),a.minute(),a.second(),a.millisecond())+a._microsecond,n=r+e;let o;if(void 0===s&&(s=parseInt(n/1e3,10)-parseInt(r/1e3,10)),void 0===i&&(i=parseInt(n%1e3,10)),0!==s&&(o=a.addMilliseconds(s,t)),!1!==t)return o||(o=a.clone()),o._microsecond=i,o;a._microsecond=i}addFractionsOfSecond(e,t,a,s,i){if(0===e)return;const r=this,n=1e3*r[s]+r[a],o=e+n;let d,l=parseInt(o/1e3,10)-parseInt(n/1e3,10),f=parseInt(o%1e3,10);if(e<0&&o<0&&f<0&&(l--,f=1e3+f),0!==l&&(d=r[i](l,t)),!1!==t)return d||(d=r.clone()),d[a]=f,d;r[a]=f}addNanoseconds(e,t){return this.addFractionsOfSecond(e,t,"_nanosecond","_microsecond","addMicroseconds")}addPicoseconds(e,t){return this.addFractionsOfSecond(e,t,"_picosecond","_nanosecond","addNanoseconds")}addFemtoseconds(e,t){return this.addFractionsOfSecond(e,t,"_femtosecond","_picosecond","addPicoseconds")}addAttoseconds(e,t){return this.addFractionsOfSecond(e,t,"_attosecond","_femtosecond","addFemtoseconds")}addZeptoseconds(e,t){return this.addFractionsOfSecond(e,t,"_zeptosecond","_attosecond","addAttoseconds")}addYoctoseconds(e,t){return this.addFractionsOfSecond(e,t,"_yoctosecond","_zeptosecond","addZeptoseconds")}getTimeZoneOffset(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),s=e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset());return{offset:-e.getTimezoneOffset()/60,dst:+s}}isInDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return this.date().getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset())}supportsDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return t.getTimezoneOffset()!==a.getTimezoneOffset()}date(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new JQX.Utilities.DateTime(a,t,s);return e.copyTimeZone(i),i}isWeekend(){return 0===this.dayOfWeek()||6===this.dayOfWeek()}toDate(e){const t=this,a=t.month(),s=t.year(),i=t.day(),r=t.hour(),n=t.minute(),o=t.second(),d=t.millisecond();let l=new Date(s,a-1,i);if(s<1970&&l.setFullYear(s),l.setHours(r,n,o,d),e){const a=t.timeZones.filter((function(t){return t.id===e}));if(a.length){let e=a[0].offset;const s=l.getTime();let i=60*l.getTimezoneOffset()*1e3;if(t.timeZone){const e=t.timeZones.filter((function(e){return e.id===t.timeZone}));e.length&&(i=60*-e[0].offset*1e3)}l=new Date(s+i+6e4*e)}}return l}toTimeZone(e){const t=this;let a=e;if(null==a&&(a="Local"),t.timeZone===a)return t.clone();const s=t.timeZones.filter((function(e){return e.id===a}));if(0===s.length)return t.clone();const i=this.toDate(a),r=new JQX.Utilities.DateTime(i);return r.timeZone=a,r.timeZoneOffset=s[0].offset,r.timeZoneOffsetHours=s[0].offsetHours,t.copySmallTimePartValues(r),r}day(){return this.getDatePart(this.datePartDay)}month(){return this.getDatePart(this.datePartMonth)}year(){return this.getDatePart(this.datePartYear)}millisecond(){return parseInt(this.internalMS()%1e3)}hour(){return parseInt(Math.floor(this.internalMS()/this.millisPerHour)%24)}minute(){return parseInt(this.internalMS()/this.millisPerMinute%60)}second(){return parseInt(this.internalMS()/this.millisPerSecond%60)}microsecond(){return this._microsecond}nanosecond(){return this._nanosecond}picosecond(){return this._picosecond}femtosecond(){return this._femtosecond}attosecond(){return this._attosecond}zeptosecond(){return this._zeptosecond}yoctosecond(){return this._yoctosecond}valueOf(){return this.dateData}equals(e){const t=this;return t.dateData===e.dateData&&t._microsecond===e._microsecond&&t._nanosecond===e._nanosecond&&t._picosecond===e._picosecond&&t._femtosecond===e._femtosecond&&t._attosecond===e._attosecond&&t._zeptosecond===e._zeptosecond&&t._yoctosecond===e._yoctosecond}equalDateParts(e){const t=this;return t.year()===e.year()&&t.month()===e.month()&&t.day()===e.day()}compare(e){const t=this;if(t.equals(e))return 0;const a=["dateData","_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"];for(let s=0;s<a.length;s++){const i=a[s];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}toDateString(){return this.toDate().toDateString()}toLocaleDateString(){return this.toDate().toLocaleDateString(this.calendar.locale)}toLocaleString(){return this.toDate().toLocaleString(this.calendar.locale)}toLocaleTimeString(){return this.toDate().toLocaleTimeString(this.calendar.locale)}validateTimeZone(e){const t=this;if("string"!=typeof e)return;const a=t.timeZones.filter((function(t){return t.id===e}));0!==a.length&&(t.timeZone=e,t.timeZoneOffset=a[0].offset,t.timeZoneOffsetHours=a[0].offsetHours)}copyTimeZone(e){const t=this;e.timeZone=t.timeZone,e.timeZoneOffset=t.timeZoneOffset,e.timeZoneOffsetHours=t.timeZoneOffsetHours}getTimeStamp(){return new JQX.Utilities.BigNumber(this.dateData.toString()+this.getFirstNDigitsOfPrecision(void 0,!0))}})})();
34
+ (()=>{const e=-1*(new Date).getTimezoneOffset(),t=[{id:"Local",offset:e,offsetHours:e/60,displayName:"",supportsDaylightSavingTime:!1},{id:"Dateline Standard Time",offset:-720,offsetHours:-12,displayName:"(UTC-12:00) International Date Line West",supportsDaylightSavingTime:!1},{id:"UTC-11",offset:-660,offsetHours:-11,displayName:"(UTC-11:00) Coordinated Universal Time-11",supportsDaylightSavingTime:!1},{id:"Hawaiteratoran Standard Time",offset:-600,offsetHours:-10,displayName:"(UTC-10:00) Hawaiterator",supportsDaylightSavingTime:!1},{id:"Alaskan Standard Time",offset:-540,offsetHours:-9,displayName:"(UTC-09:00) Alaska",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time (Mexico)",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Baja California",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Pacific Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Arizona",supportsDaylightSavingTime:!1},{id:"Mountain Standard Time (Mexico)",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",supportsDaylightSavingTime:!0},{id:"Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Mountain Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central America Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central America",supportsDaylightSavingTime:!1},{id:"Canada Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Saskatchewan",supportsDaylightSavingTime:!1},{id:"Central Standard Time (Mexico)",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",supportsDaylightSavingTime:!0},{id:"SA Pacific Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",supportsDaylightSavingTime:!1},{id:"Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Eastern Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Indiana (East)",supportsDaylightSavingTime:!0},{id:"Venezuela Standard Time",offset:-270,offsetHours:-4.5,displayName:"(UTC-04:30) Caracas",supportsDaylightSavingTime:!1},{id:"Atlantic Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Atlantic Time (Canada)",supportsDaylightSavingTime:!0},{id:"Paraguay Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Asuncion",supportsDaylightSavingTime:!0},{id:"Central Brazilian Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Cuiaba",supportsDaylightSavingTime:!0},{id:"Pacific SA Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Santiago",supportsDaylightSavingTime:!0},{id:"SA Western Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",supportsDaylightSavingTime:!1},{id:"Newfoundland Standard Time",offset:-210,offsetHours:-3.5,displayName:"(UTC-03:30) Newfoundland",supportsDaylightSavingTime:!0},{id:"SA Eastern Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Cayenne, Fortaleza",supportsDaylightSavingTime:!1},{id:"Argentina Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Buenos Aires",supportsDaylightSavingTime:!0},{id:"E. South America Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Brasilia",supportsDaylightSavingTime:!0},{id:"Bahia Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Salvador",supportsDaylightSavingTime:!0},{id:"Montevideo Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Montevideo",supportsDaylightSavingTime:!0},{id:"Greenland Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Greenland",supportsDaylightSavingTime:!0},{id:"UTC-02",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Coordinated Universal Time-02",supportsDaylightSavingTime:!1},{id:"Mid-Atlantic Standard Time",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Mid-Atlantic - Old",supportsDaylightSavingTime:!0},{id:"Azores Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Azores",supportsDaylightSavingTime:!0},{id:"Cape Verde Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Cape Verde Is.",supportsDaylightSavingTime:!1},{id:"Morocco Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Casablanca",supportsDaylightSavingTime:!0},{id:"UTC",offset:0,offsetHours:0,displayName:"(UTC) Coordinated Universal Time",supportsDaylightSavingTime:!1},{id:"GMT Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Dublin, Edinburgh, Lisbon, London",supportsDaylightSavingTime:!0},{id:"Greenwich Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Monrovia, Reykjavik",supportsDaylightSavingTime:!1},{id:"Central European Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",supportsDaylightSavingTime:!0},{id:"Namibia Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Windhoek",supportsDaylightSavingTime:!0},{id:"W. Central Africa Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) West Central Africa",supportsDaylightSavingTime:!1},{id:"W. Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",supportsDaylightSavingTime:!0},{id:"Central Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",supportsDaylightSavingTime:!0},{id:"Romance Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",supportsDaylightSavingTime:!0},{id:"FLE Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",supportsDaylightSavingTime:!0},{id:"South Africa Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Harare, Pretoria",supportsDaylightSavingTime:!1},{id:"Turkey Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Istanbul",supportsDaylightSavingTime:!0},{id:"GTB Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Athens, Bucharest",supportsDaylightSavingTime:!0},{id:"Libya Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Tripoli",supportsDaylightSavingTime:!0},{id:"E. Europe Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) E. Europe",supportsDaylightSavingTime:!0},{id:"Jordan Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Amman",supportsDaylightSavingTime:!0},{id:"Middle East Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Beirut",supportsDaylightSavingTime:!0},{id:"Egypt Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Cairo",supportsDaylightSavingTime:!0},{id:"Syria Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Damascus",supportsDaylightSavingTime:!0},{id:"Israel Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Jerusalem",supportsDaylightSavingTime:!0},{id:"Arab Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kuwait, Riyadh",supportsDaylightSavingTime:!1},{id:"E. Africa Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Nairobi",supportsDaylightSavingTime:!1},{id:"Arabic Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Baghdad",supportsDaylightSavingTime:!0},{id:"Kaliningrad Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kaliningrad, Minsk",supportsDaylightSavingTime:!0},{id:"Iran Standard Time",offset:210,offsetHours:3.5,displayName:"(UTC+03:30) Tehran",supportsDaylightSavingTime:!0},{id:"Mauritius Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Port Louis",supportsDaylightSavingTime:!0},{id:"Georgian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Tbilisi",supportsDaylightSavingTime:!1},{id:"Caucasus Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Yerevan",supportsDaylightSavingTime:!0},{id:"Arabian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Abu Dhabi, Muscat",supportsDaylightSavingTime:!1},{id:"Azerbaijan Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Baku",supportsDaylightSavingTime:!0},{id:"Russian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",supportsDaylightSavingTime:!0},{id:"Afghanistan Standard Time",offset:270,offsetHours:4.5,displayName:"(UTC+04:30) Kabul",supportsDaylightSavingTime:!1},{id:"Pakistan Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Islamabad, Karachi",supportsDaylightSavingTime:!0},{id:"West Asia Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Ashgabat, Tashkent",supportsDaylightSavingTime:!1},{id:"India Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",supportsDaylightSavingTime:!1},{id:"Sri Lanka Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Sri Jayawardenepura",supportsDaylightSavingTime:!1},{id:"Nepal Standard Time",offset:345,offsetHours:5.75,displayName:"(UTC+05:45) Kathmandu",supportsDaylightSavingTime:!1},{id:"Central Asia Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Astana",supportsDaylightSavingTime:!1},{id:"Bangladesh Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Dhaka",supportsDaylightSavingTime:!0},{id:"Ekaterinburg Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Ekaterinburg",supportsDaylightSavingTime:!0},{id:"Myanmar Standard Time",offset:390,offsetHours:6.5,displayName:"(UTC+06:30) Yangon (Rangoon)",supportsDaylightSavingTime:!1},{id:"SE Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Bangkok, Hanoi, Jakarta",supportsDaylightSavingTime:!1},{id:"N. Central Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Novosibirsk",supportsDaylightSavingTime:!0},{id:"Ulaanbaatar Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Ulaanbaatar",supportsDaylightSavingTime:!1},{id:"China Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",supportsDaylightSavingTime:!1},{id:"Singapore Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Kuala Lumpur, Singapore",supportsDaylightSavingTime:!1},{id:"North Asia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Krasnoyarsk",supportsDaylightSavingTime:!0},{id:"Taipei Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Taipei",supportsDaylightSavingTime:!1},{id:"W. Australia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Perth",supportsDaylightSavingTime:!0},{id:"Korea Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Seoul",supportsDaylightSavingTime:!1},{id:"North Asia East Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Irkutsk",supportsDaylightSavingTime:!0},{id:"Tokyo Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Osaka, Sapporo, Tokyo",supportsDaylightSavingTime:!1},{id:"AUS Central Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Darwin",supportsDaylightSavingTime:!1},{id:"Cen. Australia Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Adelaide",supportsDaylightSavingTime:!0},{id:"West Pacific Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Guam, Port Moresby",supportsDaylightSavingTime:!1},{id:"Tasmania Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Hobart",supportsDaylightSavingTime:!0},{id:"E. Australia Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Brisbane",supportsDaylightSavingTime:!1},{id:"AUS Eastern Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Canberra, Melbourne, Sydney",supportsDaylightSavingTime:!0},{id:"Yakutsk Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Yakutsk",supportsDaylightSavingTime:!0},{id:"Vladivostok Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Vladivostok",supportsDaylightSavingTime:!0},{id:"Central Pacific Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Solomon Is., New Caledonia",supportsDaylightSavingTime:!1},{id:"Magadan Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Magadan",supportsDaylightSavingTime:!0},{id:"Kamchatka Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",supportsDaylightSavingTime:!0},{id:"Fiji Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Fiji",supportsDaylightSavingTime:!0},{id:"New Zealand Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Auckland, Wellington",supportsDaylightSavingTime:!0},{id:"UTC+12",offset:720,offsetHours:12,displayName:"(UTC+12:00) Coordinated Universal Time+12",supportsDaylightSavingTime:!1},{id:"Tonga Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Nuku'alofa",supportsDaylightSavingTime:!1},{id:"Samoa Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Samoa",supportsDaylightSavingTime:!0}],a=[0,31,59,90,120,151,181,212,243,273,304,334,365],s=[0,31,60,91,121,152,182,213,244,274,305,335,366];JQX.Utilities.Assign("TimeSpan",class{constructor(){const e=this;if(e.ticksPerMillisecond=1e4,e.millisecondsPerTick=1e-4,e.ticksPerSecond=1e7,e.secondsPerTick=1e-7,e.ticksPerMinute=6e8,e.minutesPerTick=1/6e8,e.ticksPerHour=36e9,e.hoursPerTick=1/36e9,e.ticksPerDay=864e9,e.daysPerTick=1/864e9,e.millisPerSecond=1e3,e.millisPerMinute=6e4,e.millisPerHour=36e5,e.millisPerDay=864e5,e._ticks=0,1===arguments.length){if(isNaN(arguments[0]))throw new Error("Argument must be a number.");e._ticks=arguments[0]}else if(3===arguments.length)e._ticks=e.timeToMS(arguments[0],arguments[1],arguments[2],0);else if(4===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+0;e._ticks=t*e.ticksPerMillisecond}else if(5===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+arguments[4];e._ticks=t*e.ticksPerMillisecond}}ticks(){return this._ticks}days(){return parseInt(this._ticks/this.ticksPerDay)}timeToMS(e,t,a,s){return parseInt((3600*e+60*t+a+s/1e3)*this.ticksPerSecond)}hours(){return parseInt(this._ticks/this.ticksPerHour)%24}milliseconds(){return parseInt(this._ticks/this.ticksPerMillisecond)%1e3}minutes(){return parseInt(this._ticks/this.ticksPerMinute)%60}seconds(){return parseInt(this._ticks/this.ticksPerSecond)%60}totalDays(){return parseInt(this._ticks*this.daysPerTick)}totalHours(){return parseInt(this._ticks*this.hoursPerTick)}totalMilliseconds(){const e=this._ticks*this.millisecondsPerTick;return parseInt(e)}totalMinutes(){return parseInt(this._ticks*this.minutesPerTick)}totalSeconds(){return parseInt(this._ticks*this.secondsPerTick)}add(e){const t=this._ticks+e._ticks;return new JQX.Utilities.TimeSpan(t)}subtract(e){const t=this._ticks-e._ticks;return new JQX.Utilities.TimeSpan(t)}duration(){const e=this;return e._ticks>=0?new JQX.Utilities.TimeSpan(e._ticks):new JQX.Utilities.TimeSpan(-e._ticks)}equals(e){return this._ticks===e._ticks}valueOf(){return this._ticks}compare(e,t){return e._ticks>t._ticks?1:e._ticks<t._ticks?-1:0}interval(e,t){const a=e*t+(e>=0?.5:-.5);return new JQX.Utilities.TimeSpan(a*this.ticksPerMillisecond)}fromDays(e){return this.interval(e,this.millisPerDay)}fromHours(e){return this.interval(e,this.millisPerHour)}fromMilliseconds(e){return this.interval(e,1)}fromMinutes(e){return this.interval(e,this.millisPerMinute)}fromSeconds(e){return this.interval(e,this.millisPerSecond)}fromTicks(e){return new JQX.Utilities.TimeSpan(e)}toString(){return this.totalMilliseconds().toString()}negate(){return new JQX.Utilities.TimeSpan(-this._ticks)}}),JQX.Utilities.Assign("DateTime",class{constructor(){function e(e){const t=i.regexISOString.exec(e);r=new JQX.Utilities.DateTime(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),0,0,0,0,0,0,0,"UTC")}const i=this;let r;if(i.ticksPerMillisecond=1e4,i.millisecondsPerTick=1e-4,i.ticksPerSecond=1e7,i.secondsPerTick=1e-7,i.ticksPerMinute=6e8,i.minutesPerTick=1/6e8,i.ticksPerHour=36e9,i.hoursPerTick=1/36e9,i.ticksPerDay=864e9,i.daysPerTick=1/864e9,i.millisPerSecond=1e3,i.millisPerMinute=6e4,i.millisPerHour=36e5,i.millisPerDay=864e5,i.daysPerYear=365,i.daysPer4Years=1461,i.daysPer100Years=36524,i.daysPer400Years=146097,i.daysTo1601=584388,i.daysTo1899=693593,i.daysTo10000=3652059,i.minTicks=0,i.maxTicks=3155378976e9,i.maxMillis=3155378976e5,i.datePartYear=0,i.datePartDayOfYear=1,i.datePartMonth=2,i.datePartDay=3,i.daysToMonth365=a,i.daysToMonth366=s,i.minValue=new Date(0),i.maxValue=new Date(3155378976e9),i.ticksMask=0x4000000000000000,i.flagsMask=0xc000000000000000,i.localMask=0x8000000000000000,i.ticksCeiling=0x4000000000000000,i.kindUnspecified=0,i.kindUtc=0x4000000000000000,i.kindLocal=0x8000000000000000,i.kindLocalAmbiguousDst=0xc000000000000000,i.kindShift=62,i.regexTrim=/^\s+|\s+$/g,i.regexInfinity=/^[+-]?infinity$/i,i.regexHex=/^0x[a-f0-9]+$/i,i.regexParseFloat=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,i.regexISOString=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/,i.calendar={"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",FP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",FPA:"yyyy/MM/dd HH:mm:ss:fffuunnppeeaaxxoo",FPA2:"yyyy-MM-dd HH:mm:ss:fffuunnppeeaaxxoo",FT:"HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",PP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp",PT:"HH:mm:ss:fff:uu:nn:pp"},percentsymbol:"%",currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:","},i.dateData=0,i.timeZone=null,i.timeZones=t,i._codeToUnit={u:"_microsecond",uu:"_microsecond",n:"_nanosecond",nn:"_nanosecond",p:"_picosecond",pp:"_picosecond",e:"_femtosecond",ee:"_femtosecond",a:"_attosecond",aa:"_attosecond",x:"_zeptosecond",xx:"_zeptosecond",o:"_yoctosecond",oo:"_yoctosecond"},i._smallUnits=["_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"],i._microsecond=0,i._nanosecond=0,i._picosecond=0,i._femtosecond=0,i._attosecond=0,i._zeptosecond=0,i._yoctosecond=0,0===arguments.length){const e=new Date;i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else if(1===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}}else if(2===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}i.validateTimeZone(arguments[1])}else if(arguments.length>2)if("string"==typeof arguments[0]){const e=i.tryparseDate(arguments[0],arguments[2],arguments[1]);i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else{let e=arguments[0],t=arguments[1]-1,a=arguments[2],s=arguments[3]||0,r=arguments[4]||0,n=arguments[5]||0,o=arguments[6]||0,d=arguments[7]||0,l=arguments[8]||0,f=arguments[9]||0,m=arguments[10]||0,c=arguments[11]||0,u=arguments[12]||0,y=arguments[13]||0;e>=2100&&(e=2100),t>=12?t=11:t<0&&(t=0),a>31?a=i.daysInMonth(e,1+t):a<0&&(a=0),s>23?s=23:s<0&&(s=0),r>59?r=59:r<0&&(r=0),n>59?n=59:n<0&&(n=0);const p=new Date(e,t,a,s,r,n,o);e<1970&&p.setFullYear(e),i.dateData=i.dateToMS(p.getFullYear(),p.getMonth()+1,p.getDate())+i.timeToMS(p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds()),i._microsecond=d,i._nanosecond=l,i._picosecond=f,i._femtosecond=m,i._attosecond=c,i._zeptosecond=u,i._yoctosecond=y,arguments[14]&&i.validateTimeZone(arguments[14])}if(i.timeZone||i.validateTimeZone("Local"),r){const e=r.toTimeZone(i.timeZone);i.dateData=e.dateData}}static isValidDate(e){const t=this.validateDate(e);return!(!t||t&&!t.dateData)}static validateDate(e,t,a){if(e instanceof JQX.Utilities.DateTime)return e;if(e instanceof Date)return new JQX.Utilities.DateTime(e);try{if("string"==typeof e&&a)return this.parseDateString(e,t,a);if(new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}(, \d{1,2}:\d{2}:\d{1,2} [A|P]M)?$/).test(e)){const t=new Date(e);if(!isNaN(t.getTime()))return new JQX.Utilities.DateTime(t)}if("string"==typeof e)return this.parseDateString(e,t,a);if("number"==typeof e)return new JQX.Utilities.DateTime(new Date(e))}catch(e){}return t}static parseDateString(e,t,a){const s=new Date(e);if(!isNaN(s.getTime()))return e&&"string"==typeof e&&a?new JQX.Utilities.DateTime(e,a,null):new JQX.Utilities.DateTime(s);const i=e.indexOf("Date("),r=e.indexOf("DateTime("),n=e.lastIndexOf(")");let o=e;if(-1===i&&-1===r||-1===n){const t=new JQX.Utilities.DateTime,s=t.parseDate(e,a);if(s)return o=new JQX.Utilities.DateTime(s),t.copySmallTimePartValues(o),o}else{if(o=-1!==i?e.slice(i+5,n):e.slice(r+9,n),o=o.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===o.trim())return new JQX.Utilities.DateTime;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+(\s*,\s*[a-zA-Z ]+)?$)/g).test(o))return o=o.split(","),o.map((function(e,t){isNaN(o[t])?o[t]=e.trim():o[t]=parseInt(e)})),-1!==i&&o[1]++,o.unshift(null),o=new(Function.prototype.bind.apply(JQX.Utilities.DateTime,o)),o}if(""===o.trim())return t;if(!isNaN(o))return o=new Date(parseInt(o,10)),new JQX.Utilities.DateTime(o);try{const e=o.split(",");2===e.length?(e[1]=e[1].trim(),e.unshift(null),o=new(Function.prototype.bind.apply(JQX.Utilities.DateTime,e))):o=new JQX.Utilities.DateTime(o)}catch(e){o=t}return o}static fromFullTimeStamp(e){e=e.toString();const t=new JQX.Utilities.DateTime(parseFloat(e.slice(0,e.length-21)));let a=e.slice(e.length-21),s=0;for(;a.length>0;)t[t._smallUnits[s]]=parseInt(a.slice(0,3),10),a=a.slice(3),s++;return t}static getConstructorParameters(e){return[e.year(),e.month(),e.day(),e.hour(),e.minute(),e.second(),e.millisecond(),e._microsecond,e._nanosecond,e._picosecond,e._femtosecond,e._attosecond,e._zeptosecond,e._yoctosecond,e.timeZone]}static detectDisplayMode(e,t,a){if(e.calendar.patterns[t])return-1!==["d","D","M","Y","d1","d2"].indexOf(t)?"calendar":-1!==["t","T","FT","PT"].indexOf(t)?"timePicker":"default";const s=["d","M","y"],i=["h","H","m","s","t","f","u","n","p","e","a","x","o"],r=a.groups;let n=!1,o=!1;for(let e=0;e<r.length;e++){const t=r[e].charAt(0);if(-1!==s.indexOf(t)?n=!0:-1!==i.indexOf(t)&&(o=!0),n&&o)break}return n===o?"default":n?"calendar":"timePicker"}static getLocalizedNames(e){const t={names:[],namesAbbr:[],namesShort:[]},a={names:[],namesAbbr:[]};if(this[e])return this[e];for(let a=23;a<30;a++){const s=new Date(2017,6,a),i=s.toLocaleString(e,{weekday:"long"});t.names.push(i),t.namesAbbr.push(s.toLocaleString(e,{weekday:"short"})),t.namesShort.push(i.substring(0,2))}for(let t=0;t<12;t++){const s=new Date(2017,t,1).toLocaleString(e,{month:"long"});a.names.push(s),a.namesAbbr.push(s.substring(0,3))}return a.names.push(""),a.namesAbbr.push(""),this[e]={days:t,months:a},this[e]}internalMS(){return this.dateData}getDatePart(e){const t=this,a=t.internalMS();let s=parseInt(a/t.millisPerDay);const i=parseInt(s/t.daysPer400Years);s-=i*t.daysPer400Years;let r=parseInt(s/t.daysPer100Years);4===r&&(r=3),s-=r*t.daysPer100Years;const n=parseInt(s/t.daysPer4Years);s-=n*t.daysPer4Years;let o=parseInt(s/t.daysPerYear);if(4===o&&(o=3),e===t.datePartYear)return parseInt(400*i+100*r+4*n+o+1);if(s-=o*t.daysPerYear,e===t.datePartDayOfYear)return parseInt(s+1);const d=3===o&&(24!==n||3===r)?t.daysToMonth366:t.daysToMonth365;let l=s>>6;for(;s>=d[l];)l++;return e===t.datePartMonth?parseInt(l):parseInt(s-d[l-1]+1)}dayOfWeek(){const e=this.dateData;return parseInt(e/this.millisPerDay+1)%7}dayOfYear(){return this.getDatePart(this.datePartDayOfYear)}weekOfYear(e){const t=this.toDate(),a=e||this.calendar.firstDay,s=new Date(t.getFullYear(),0,1),i=Math.floor((t.getTime()-s.getTime()-6e4*(t.getTimezoneOffset()-s.getTimezoneOffset()))/864e5)+1;let r,n=s.getDay()-a;if(n=n>=0?n:n+7,n<4){if(r=Math.floor((i+n-1)/7)+1,r>52){let e=new Date(t.getFullYear()+1,0,1).getDay()-a;e=e>=0?e:e+7,r=e<4?1:53}}else r=Math.floor((i+n-1)/7);return r}subtract(e){const t=this;return new JQX.Utilities.TimeSpan(t.dateData*t.ticksPerMillisecond-e.dateData*t.ticksPerMillisecond)}dateToMS(e,t,a){const s=this;if(e>=1&&e<=9999&&t>=1&&t<=12){e=parseInt(e);const i=s.isLeapYear(e)?s.daysToMonth366:s.daysToMonth365;if(a>=1&&a<=i[t]-i[t-1]){const r=e-1;return(365*r+parseInt(r/4)-parseInt(r/100)+parseInt(r/400)+i[t-1]+a-1)*s.millisPerDay}}}isLeapYear(e){if(e<1||e>9999)throw new Error("Year out of Range");return e%4==0&&(e%100!=0||e%400==0)}timeToMS(e,t,a,s){const i=this;if(e>=0&&e<24&&t>=0&&t<60&&a>=0&&a<60){const r=parseInt(3600*e+60*t+a);return s>0&&s<1e3?r*i.millisPerSecond+s:r*i.millisPerSecond}}daysInMonth(e,t){if(t<1||t>12)throw new Error("Month out of Range");const a=this,s=a.isLeapYear(e)?a.daysToMonth366:a.daysToMonth365;return s[t]-s[t-1]}arrayIndexOf(e,t){return e.indexOf(t)}startsWith(e,t){return 0===e.indexOf(t)}endsWith(e,t){return e.substr(e.length-t.length)===t}trim(e){return(e+"").replace(this.regexTrim,"")}expandFormat(e,t){t=t||"F";let a,s=e.patterns,i=t.length;if(s[t])return s[t];if(1===i){if(a=s[t],!a)throw"Invalid date format string '"+t+"'.";t=a}else 2===i&&"%"===t.charAt(0)&&(t=t.charAt(1));return t}getEra(e,t){if(!t)return 0;if("string"==typeof e)return 0;let a,s=e.getTime();for(let e=0,i=t.length;e<i;e++)if(a=t[e].start,null===a||s>=a)return e;return 0}toUpper(e){return e.split(" ").join(" ").toUpperCase()}toUpperArray(e){const t=[];for(let a=0,s=e.length;a<s;a++)t[a]=this.toUpper(e[a]);return t}getEraYear(e,t,a,s){let i=e.getFullYear();return!s&&t.eras&&(i-="number"==typeof a?a:t.eras[a].offset),i}getDayIndex(e,t,a){const s=this,i=e.days;let r,n=e._upperDays;return n||(e._upperDays=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr),s.toUpperArray(i.namesShort)]),t=t.toUpperCase(),a?(r=s.arrayIndexOf(n[1],t),-1===r&&(r=s.arrayIndexOf(n[2],t))):r=s.arrayIndexOf(n[0],t),r}getMonthIndex(e,t,a){const s=this;let i=e.months,r=e.monthsGenitive||e.months,n=e._upperMonths,o=e._upperMonthsGen;n||(e._upperMonths=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr)],e._upperMonthsGen=o=[s.toUpperArray(r.names),s.toUpperArray(r.namesAbbr)]),t=s.toUpper(t);let d=s.arrayIndexOf(a?n[1]:n[0],t);return d<0&&(d=s.arrayIndexOf(a?o[1]:o[0],t)),d}appendPreOrPostMatch(e,t){let a=0,s=!1;for(let i=0,r=e.length;i<r;i++){const r=e.charAt(i);switch(r){case"'":s?t.push("'"):a++,s=!1;break;case"\\":s&&t.push("\\"),s=!s;break;default:t.push(r),s=!1}}return a}getTokenRegExp(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyyy|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|uu|u|nn|n|pp|p|ee|e|aa|a|xx|x|oo|o|i{1,24}|zzz|zz|z|gg|g/g}static ParseDate(e,t){return(new JQX.Utilities.DateTime).tryparseDate(e,null,t)}tryparseDate(e,t,a){const s=this;if(null==t&&(t=s.calendar),void 0!==a){if(Array.isArray(a))for(let i=0;i<a.length;i++){const r=s.parseDate(e,a[i],t);if(r)return r}const i=s.parseDate(e,a,t);if(i)return i}if(""===e)return null;if(null==e||e.substring||(e=e.toString()),null!=e&&"/Date("===e.substring(0,6)){const t=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;let a=new Date(+e.replace(/\/Date\((\d+)\)\//,"$1"));if("Invalid Date"===a){const t=e.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);a=null,t&&(a=new Date(1*t[1]+36e5*t[2]+6e4*t[3]))}if(null==a||"Invalid Date"===a||isNaN(a)){const a=t.exec(e);if(a){const e=new Date(parseInt(a[1]));if(a[2]){let t=parseInt(a[3]);"-"===a[2]&&(t=-t);const s=e.getUTCMinutes();e.setUTCMinutes(s-t)}if(!isNaN(e.valueOf()))return e}}return a}const i={smartdate:"yyyy-MM-dd HH:mm:ss",d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",d3:"MM-dd-yyyy",d4:"MM.dd.yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",custom3:"yyyy-MM-ddTHH:mm:ss.fff+HH:mm",custom4:"yyyy-MM-ddTHH:mm:ss.fff-HH:mm",custom5:"yyyy-MM-ddTHH:mm:ss.ffffff+HH:mm",custom6:"yyyy-MM-ddTHH:mm:ss.ffffff-HH:mm",custom7:"yyyy-MM-ddTHH:mm:ss.fffffff+HH:mm",custom8:"yyyy-MM-ddTHH:mm:ss.fffffff-HH:mm",iso:"yyyy-MM-ddTHH:mm:ssZ",iso2:"yyyy-MM-ddTHH:mm.fffZ",iso_date1:"yyyy-MM-dd",iso_date2:"yyyy-MM-dd",iso_date3:"yyyy-ddd",iso_date4:"yyyy-MM-dd HH:mm",iso_date5:"yyyy-MM-dd HH:mm Z",iso_date6:"yyyy-MMM-dd",iso_date7:"yyyy-MM",iso_date8:"yyyy-MMM",iso_date9:"yyyy-MMMM",iso_date10:"yyyy-MMMM-dd",iso_time1:"HH:mm:ss.tttt",iso_time2:"HH:mm:ss",iso_time3:"HH:mm",iso_time4:"HH",iso_time5:"yyyyyy-MM-dd",iso_time6:"yyyyyy-MM-dd",iso_time7:"dd/MM/yyyy HH:mm",iso_time8:"dd.MM.yyyy HH:mm",iso_time9:"dd-MM-yyyy HH:mm",iso_time10:"MM.dd.yyyy HH:mm",iso_time11:"MM-dd-yyyy HH:mm",iso_time12:"dd/MM/yyyy",iso_time13:"MM.dd.yyyy h:mm tt",iso_time14:"MM-dd-yyyy h:mm tt",iso_time15:"MM/dd/yyyy h:mm tt"};for(let a in i){const r=s.parseDate(e,i[a],t);if(r)return r}const r=t.patterns;for(let a in r){const i=s.parseDate(e,r[a],t);if(i){if("ISO"===a){const a=s.parseDate(e,r.ISO2,t);if(a)return a}return i}}let n;if("string"==typeof e){const a=[":","/","-"," ",","];let i="",r=e=function(e,t,a){return a.replace(new RegExp(e,"g"),t)}(", ",",",e=s.trim(e));e.indexOf(":")>=0?(i=e.substring(e.indexOf(":")-2),i=s.trim(i),r=e.substring(0,e.indexOf(":")-2)):e.toUpperCase().indexOf("AM")>=0?(i=e.substring(e.toUpperCase().indexOf("AM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("AM")-2)):e.toUpperCase().indexOf("PM")>=0&&(i=e.substring(e.toUpperCase().indexOf("PM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("PM")-2));let o=new Date,d=!1;if(r){for(let e=0;e<a.length;e++)if(r.indexOf(a[e])>=0){n=r.split(a[e]);break}if(!n)return null;let e=new Array,i=new Array,l=new Array,f=null,m=null;for(let a=0;a<n.length;a++){const i=n[a],r=s.parseDate(i,"d",t)||s.parseDate(i,"dd",t)||s.parseDate(i,"ddd",t)||s.parseDate(i,"dddd",t);if(r&&(e.push(r.getDate()),i.length>2)){f=a;break}}for(let e=0;e<n.length;e++){const a=n[e],r=s.parseDate(a,"M",t)||s.parseDate(a,"MM",t)||s.parseDate(a,"MMM",t)||s.parseDate(a,"MMMM",t);if(r){if(null!=f&&f===e)continue;if(i.push(r.getMonth()),a.length>2){m=e;break}}}for(let e=0;e<n.length;e++){const a=n[e],i=s.parseDate(a,"yyyy",t);if(i){if(null!=f&&f===e)continue;if(null!=m&&m===e)continue;l.push(i.getFullYear())}}const c=new Array;for(let t=e.length-1;t>=0;t--)for(let a=0;a<i.length;a++)for(let s=0;s<l.length;s++){const r=new Date(l[s],i[a],e[t]);l[s]<1970&&r.setFullYear(l[s]),isNaN(r.getTime())||c.push(r)}c.length>0&&(o=c[0],d=!0)}if(i){const e=i.indexOf(":")>=0?i.split(":"):i,a=s.parseDate(i,"h:mm tt",t)||s.parseDate(i,"HH:mm:ss.fff",t)||s.parseDate(i,"HH:mm:ss.ff",t)||s.parseDate(i,"h:mm:ss tt",t)||s.parseDate(i,"HH:mm:ss.tttt",t)||s.parseDate(i,"HH:mm:ss",t)||s.parseDate(i,"HH:mm",t)||s.parseDate(i,"HH",t);let r=0,n=0,l=0,f=0;a&&!isNaN(a.getTime())?(r=a.getHours(),n=a.getMinutes(),l=a.getSeconds(),f=a.getMilliseconds()):(1===e.length&&(r=parseInt(e[0])),2===e.length&&(r=parseInt(e[0]),n=parseInt(e[1])),3===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),e[2].indexOf(".")>=0?(l=parseInt(e[2].toString().split(".")[0]),f=parseInt(e[2].toString().split(".")[1])):l=parseInt(e[2])),4===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),l=parseInt(e[2]),f=parseInt(e[3]))),!o||isNaN(r)||isNaN(n)||isNaN(l)||isNaN(f)||(o.setHours(r,n,l,f),d=!0)}if(d)return o}if(null!=e){n=[":","/","-"];let t=!0;for(let a=0;a<n.length;a++)-1!==e.indexOf(n[a])&&(t=!1);if(t){const t=new Number(e);if(!isNaN(t))return new Date(t)}}return null}getParseRegExp(e,t){const a=this;let s=e._parseRegExp;if(s){const e=s[t];if(e)return e}else e._parseRegExp=s={};let i,r=a.expandFormat(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),n=["^"],o=[],d=0,l=0,f=a.getTokenRegExp();for(;null!==(i=f.exec(r));){const e=r.slice(d,i.index);if(d=f.lastIndex,l+=a.appendPreOrPostMatch(e,n),l%2){n.push(i[0]);continue}let t,s=i[0],m=s.length;switch(s){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":t="(\\D+)";break;case"tt":case"t":t="(\\D*)";break;case"yyyyy":t="(\\d{1,4})";break;case"yyyy":t="(\\d{"+m+"})";break;case"fff":case"ff":case"f":t="(\\d{1,"+m+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":t="(\\d\\d?)";break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":t="(\\d{1,3})";break;case"zzz":t="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":t="([+-]?\\d\\d?)";break;case"/":t="/";break;default:if(!/i{1,24}/.test(s))throw"Invalid date format pattern '"+s+"'.";t="(\\d{"+s.length+"})"}t&&n.push(t),"/"!==s&&o.push(i[0])}a.appendPreOrPostMatch(r.slice(d),n),n.push("$");const m={regExp:n.join("").replace(/\s+/g,"\\s+"),groups:o};return s[t]=m}outOfRange(e,t,a){return e<t||e>a}expandYear(e,t){const a=this,s=new Date,i=a.getEra(s);if(t<100){let r=e.twoDigitYearMax;r="string"==typeof r?(new Date).getFullYear()%100+parseInt(r,10):r;const n=a.getEraYear(s,e,i);(t+=n-n%100)>r&&(t-=100)}return t}padZeros(e,t){let a,s=e+"";return t>1&&s.length<t?(a=["0","00","000"][t-2]+s,a.substr(a.length-t,t)):(a=s,a)}parseDate(e,t,a){const s=this;null==a&&(a=s.calendar),e=s.trim(e);const i=a,r=s.getParseRegExp(i,t),n=new RegExp(r.regExp).exec(e);if(null===n)return null;let o,d=r.groups,l=null,f=null,m=null,c=null,u=null,y=0,p=0,g=0,h=0,T=null,M=!1;for(let e=0,t=d.length;e<t;e++){const t=n[e+1];if(t){const a=d[e],r=a.length,n=parseInt(t,10);switch(a){case"dd":case"d":if(c=n,s.outOfRange(c,1,31))return null;break;case"MMM":case"MMMM":case"MMMMM":case"MMMMMM":case"MMMMMMM":case"MMMMMMMM":if(m=s.getMonthIndex(i,t,3===r),s.outOfRange(m,0,11))return null;break;case"M":case"MM":if(m=n-1,s.outOfRange(m,0,11))return null;break;case"y":case"yy":case"yyyy":if(f=r<4?s.expandYear(i,n):n,s.outOfRange(f,0,9999))return null;break;case"h":case"hh":if(y=n,12===y&&(y=0),s.outOfRange(y,0,11))return null;break;case"H":case"HH":if(y=n,s.outOfRange(y,0,23))return null;break;case"m":case"mm":if(p=n,s.outOfRange(p,0,59))return null;break;case"s":case"ss":if(g=n,s.outOfRange(g,0,59))return null;break;case"tt":case"t":if(M=i.PM&&(t===i.PM[0]||t===i.PM[1]||t===i.PM[2]),!M&&(!i.AM||t!==i.AM[0]&&t!==i.AM[1]&&t!==i.AM[2]))return null;break;case"f":case"ff":case"fff":if(h=n*Math.pow(10,3-r),s.outOfRange(h,0,999))return null;break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":if(s.outOfRange(n,0,1e3))return null;s[s._codeToUnit[a]]=n;break;case"ddd":case"dddd":if(u=s.getDayIndex(i,t,3===r),s.outOfRange(u,0,6))return null;break;case"zzz":{const e=t.split(/:/);if(2!==e.length)return null;if(o=parseInt(e[0],10),s.outOfRange(o,-12,13))return null;const a=parseInt(e[1],10);if(s.outOfRange(a,0,59))return null;T=60*o+(s.startsWith(t,"-")?-a:a);break}case"z":case"zz":if(o=n,s.outOfRange(o,-12,13))return null;T=60*o;break;case"g":case"gg":{let e=t;if(!e||!i.eras)return null;e=this.trim(e.toLowerCase());for(let t=0,a=i.eras.length;t<a;t++)if(e===i.eras[t].nathat.toLowerCase()){l=t;break}if(null===l)return null;break}default:{let e=t;e.length%3==1?e+="00":e.length%3==2&&(e+="0"),h=parseInt(e.slice(0,3),10),e=e.slice(3);let a=0;for(;e.length>0;)s[s._smallUnits[a]]=parseInt(e.slice(0,3),10),e=e.slice(3),a++}}}}let S,D=new Date,H=i.convert;if(S=D.getFullYear(),null===f?f=S:i.eras&&(f+=i.eras[l||0].offset),null===m&&(m=0),null===c&&(c=1),H){if(D=H.toGregorian(f,m,c),null===D)return null}else{if(D.setFullYear(f,m,c),D.getDate()!==c)return null;if(null!==u&&D.getDay()!==u)return null}if(M&&y<12&&(y+=12),D.setHours(y,p,g,h),null!==T){const e=D.getMinutes()-(T+D.getTimezoneOffset());D.setHours(D.getHours()+parseInt(e/60,10),e%60)}return D}toString(e,t){const a=this;void 0===e&&(e="yyyy-MM-dd HH:mm:ss");const s=a.dateData.toString()+a.getFractionsOfSecondStamp()+e+(a.timeZone||"");if(JQX.Utilities.DateTime.cache&&JQX.Utilities.DateTime.cache[s]&&!1!==a.showTodayDateAsString)return JQX.Utilities.DateTime.cache[s];const i=a.toDate();if(null==t&&(t=a.calendar),"string"==typeof i)return i;if(!e||!e.length||"i"===e){let e;return e=a.formatDate(i,t.patterns.F,t),e}const r=t.eras,n="s"===e;e=a.expandFormat(t,e);const o=[];let d,l=0,f=a.getTokenRegExp();function m(e,t){if(void 0!==e.getMonth)switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate()}}for(;;){const s=f.lastIndex,c=f.exec(e),u=e.slice(s,c?c.index:e.length);if(l+=a.appendPreOrPostMatch(u,o),!c)break;if(l%2){o.push(c[0]);continue}const y=c[0],p=y.length;let g;if(/i{1,24}/.test(y))o.push(a.getFirstNDigitsOfPrecision(y.length));else switch(y){case"ddd":case"dddd":{const e=3===p?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),p));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===p?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,p));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,r),n),p<4&&(g%=100),o.push(a.padZeros(g,p));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,p));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),p));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),p));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),p));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===p?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,p));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[y]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[y]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),p));break;case"zzz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),2)+":"+a.padZeros(60*Math.abs(a.timeZoneOffsetHours%1),2));break;case"g":case"gg":t.eras&&o.push(t.eras[a.getEra(i,r)].name);break;case"/":o.push(t["/"]);break;default:throw"Invalid date format pattern '"+y+"'."}}let c=o.join("");if(JQX.Utilities.DateTime.cache||(JQX.Utilities.DateTime.cache=new Array),a._today||(a._today=new Date),a.calendar&&a.calendar.today&&-1===e.indexOf(":")&&i.getFullYear()===a._today.getFullYear()&&i.getDate()===a._today.getDate()&&i.getMonth()===a._today.getMonth()){if(!1===a.showTodayDateAsString)return JQX.Utilities.DateTime.cache[s]=c,c;c=a.calendar.today}return JQX.Utilities.DateTime.cache[s]=c,c}getFractionsOfSecondStamp(){const e=this;return e._microsecond.toString()+e._nanosecond+e._picosecond+e._femtosecond+e._attosecond+e._zeptosecond+e._yoctosecond}getFirstNDigitsOfPrecision(e,t){const a=this;return(""+(!0!==t?a.padZeros(a.millisecond(),3):"")+a.padZeros(a._microsecond,3)+a.padZeros(a._nanosecond,3)+a.padZeros(a._picosecond,3)+a.padZeros(a._femtosecond,3)+a.padZeros(a._attosecond,3)+a.padZeros(a._zeptosecond,3)+a.padZeros(a._yoctosecond,3)).slice(0,e)}copySmallTimePartValues(e){const t=this;e._microsecond=t._microsecond,e._nanosecond=t._nanosecond,e._picosecond=t._picosecond,e._femtosecond=t._femtosecond,e._attosecond=t._attosecond,e._zeptosecond=t._zeptosecond,e._yoctosecond=t._yoctosecond}add(e,t,a){const s=this,i=s.internalMS();if(void 0===t){if(!1===a)return s.dateData=i+parseInt(e._ticks/s.ticksPerMillisecond),s;const t=new JQX.Utilities.DateTime(i+parseInt(e._ticks/s.ticksPerMillisecond));return s.copyTimeZone(t),s.copySmallTimePartValues(t),t}const r=e*t;if(r<=-s.maxMillis||r>=s.maxMillis)throw new Error("Out of Range");if(!1===a)return s.dateData=i+r,s;const n=new JQX.Utilities.DateTime(i+r);return s.copyTimeZone(n),s.copySmallTimePartValues(n),n}addDays(e,t){return this.add(e,this.millisPerDay,t)}clone(){const e=this,t=new JQX.Utilities.DateTime(e.dateData);return e.copyTimeZone(t),e.copySmallTimePartValues(t),t}clearTime(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new JQX.Utilities.DateTime(a,t,s,0,0,0,0);return e.copyTimeZone(i),i}addHours(e,t){return this.add(e,this.millisPerHour,t)}addDeciseconds(e,t){return this.add(100*e,1,t)}addCentiseconds(e,t){return this.add(10*e,1,t)}addMilliseconds(e,t){return this.add(e,1,t)}addMinutes(e,t){return this.add(e,this.millisPerMinute,t)}addMonths(e,t){const a=this;if(e<-12e4||e>12e4)throw new Error("Invalid Months Value");let s=parseInt(a.getDatePart(a.datePartYear)),i=parseInt(a.getDatePart(a.datePartMonth)),r=parseInt(a.getDatePart(a.datePartDay));if(e%12==0)s+=e/12;else{const t=i-1+e;t>=0?(i=t%12+1,s+=t/12):(i=12+(t+1)%12,s+=(t-11)/12),s=parseInt(s)}if(s<1||s>9999)throw new Error("Year out of range");const n=a.daysInMonth(s,i);if(r>n&&(r=n),!1===t)return a.dateData=a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay,a;const o=new JQX.Utilities.DateTime(a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay);return a.copyTimeZone(o),a.copySmallTimePartValues(o),o}addSeconds(e,t){return this.add(e,this.millisPerSecond,t)}addYears(e,t){return this.addMonths(12*e,t)}addMicroseconds(e,t){if(0===e)return;const a=this;let s,i;e<0&&0===a.hour()&&0===a.minute()&&0===a.second()&&0===a.millisecond()&&0===a._microsecond&&(s=parseInt(e/1e3,10)-1,i=1e3+e%1e3);const r=1e3*a.timeToMS(a.hour(),a.minute(),a.second(),a.millisecond())+a._microsecond,n=r+e;let o;if(void 0===s&&(s=parseInt(n/1e3,10)-parseInt(r/1e3,10)),void 0===i&&(i=parseInt(n%1e3,10)),0!==s&&(o=a.addMilliseconds(s,t)),!1!==t)return o||(o=a.clone()),o._microsecond=i,o;a._microsecond=i}addFractionsOfSecond(e,t,a,s,i){if(0===e)return;const r=this,n=1e3*r[s]+r[a],o=e+n;let d,l=parseInt(o/1e3,10)-parseInt(n/1e3,10),f=parseInt(o%1e3,10);if(e<0&&o<0&&f<0&&(l--,f=1e3+f),0!==l&&(d=r[i](l,t)),!1!==t)return d||(d=r.clone()),d[a]=f,d;r[a]=f}addNanoseconds(e,t){return this.addFractionsOfSecond(e,t,"_nanosecond","_microsecond","addMicroseconds")}addPicoseconds(e,t){return this.addFractionsOfSecond(e,t,"_picosecond","_nanosecond","addNanoseconds")}addFemtoseconds(e,t){return this.addFractionsOfSecond(e,t,"_femtosecond","_picosecond","addPicoseconds")}addAttoseconds(e,t){return this.addFractionsOfSecond(e,t,"_attosecond","_femtosecond","addFemtoseconds")}addZeptoseconds(e,t){return this.addFractionsOfSecond(e,t,"_zeptosecond","_attosecond","addAttoseconds")}addYoctoseconds(e,t){return this.addFractionsOfSecond(e,t,"_yoctosecond","_zeptosecond","addZeptoseconds")}getTimeZoneOffset(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),s=e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset());return{offset:-e.getTimezoneOffset()/60,dst:+s}}isInDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return this.date().getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset())}supportsDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return t.getTimezoneOffset()!==a.getTimezoneOffset()}date(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new JQX.Utilities.DateTime(a,t,s);return e.copyTimeZone(i),i}isWeekend(){return 0===this.dayOfWeek()||6===this.dayOfWeek()}toDate(e){const t=this,a=t.month(),s=t.year(),i=t.day(),r=t.hour(),n=t.minute(),o=t.second(),d=t.millisecond();let l=new Date(s,a-1,i);if(s<1970&&l.setFullYear(s),l.setHours(r,n,o,d),e){const a=t.timeZones.filter((function(t){return t.id===e}));if(a.length){let e=a[0].offset;const s=l.getTime();let i=60*l.getTimezoneOffset()*1e3;if(t.timeZone){const e=t.timeZones.filter((function(e){return e.id===t.timeZone}));e.length&&(i=60*-e[0].offset*1e3)}l=new Date(s+i+6e4*e)}}return l}toTimeZone(e){const t=this;let a=e;if(null==a&&(a="Local"),t.timeZone===a)return t.clone();const s=t.timeZones.filter((function(e){return e.id===a}));if(0===s.length)return t.clone();const i=this.toDate(a),r=new JQX.Utilities.DateTime(i);return r.timeZone=a,r.timeZoneOffset=s[0].offset,r.timeZoneOffsetHours=s[0].offsetHours,t.copySmallTimePartValues(r),r}day(){return this.getDatePart(this.datePartDay)}month(){return this.getDatePart(this.datePartMonth)}year(){return this.getDatePart(this.datePartYear)}millisecond(){return parseInt(this.internalMS()%1e3)}hour(){return parseInt(Math.floor(this.internalMS()/this.millisPerHour)%24)}minute(){return parseInt(this.internalMS()/this.millisPerMinute%60)}second(){return parseInt(this.internalMS()/this.millisPerSecond%60)}microsecond(){return this._microsecond}nanosecond(){return this._nanosecond}picosecond(){return this._picosecond}femtosecond(){return this._femtosecond}attosecond(){return this._attosecond}zeptosecond(){return this._zeptosecond}yoctosecond(){return this._yoctosecond}valueOf(){return this.dateData}equals(e){const t=this;return t.dateData===e.dateData&&t._microsecond===e._microsecond&&t._nanosecond===e._nanosecond&&t._picosecond===e._picosecond&&t._femtosecond===e._femtosecond&&t._attosecond===e._attosecond&&t._zeptosecond===e._zeptosecond&&t._yoctosecond===e._yoctosecond}equalDateParts(e){const t=this;return t.year()===e.year()&&t.month()===e.month()&&t.day()===e.day()}compare(e){const t=this;if(t.equals(e))return 0;const a=["dateData","_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"];for(let s=0;s<a.length;s++){const i=a[s];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}toDateString(){return this.toDate().toDateString()}toLocaleDateString(){return this.toDate().toLocaleDateString(this.calendar.locale)}toLocaleString(){return this.toDate().toLocaleString(this.calendar.locale)}toLocaleTimeString(){return this.toDate().toLocaleTimeString(this.calendar.locale)}validateTimeZone(e){const t=this;if("string"!=typeof e)return;const a=t.timeZones.filter((function(t){return t.id===e}));0!==a.length&&(t.timeZone=e,t.timeZoneOffset=a[0].offset,t.timeZoneOffsetHours=a[0].offsetHours)}copyTimeZone(e){const t=this;e.timeZone=t.timeZone,e.timeZoneOffset=t.timeZoneOffset,e.timeZoneOffsetHours=t.timeZoneOffsetHours}getTimeStamp(){return new JQX.Utilities.BigNumber(this.dateData.toString()+this.getFirstNDigitsOfPrecision(void 0,!0))}})})();
35
35
 
36
36
  /***/ }),
37
37
 
@@ -45,7 +45,7 @@ JQX("jqx-date-time-picker",class extends JQX.BaseElement{static get properties()
45
45
  /***/ 9613:
46
46
  /***/ (() => {
47
47
 
48
- JQX.Utilities.Assign("Draw",class{constructor(t,e){const i=this;i.host=t,i.renderEngine=e||"",i.refresh();const r=["clear","removeElement","attr","getAttr","line","circle","rect","path","pieslice","pieSlicePath","text","measureText"];for(let t in r)i._addFn(JQX.Utilities.Draw.prototype,r[t])}_addFn(t,e){t[e]||(t[e]=function(){return this.renderer[e].apply(this.renderer,arguments)})}_initRenderer(t){return this.createRenderer(this,t)}_internalRefresh(){const t=this;if(t.renderer||(t.host.innerHTML="",t._initRenderer(t.host)),"none"===window.getComputedStyle(t.host).display)return;const e=t.renderer;if(!e)return;const i=e.getRect();t._render({x:1,y:1,width:i.width,height:i.height})}_render(t){this._plotRect=t}refresh(){this._internalRefresh()}getSize(){const t=this._plotRect;return{width:t.width,height:t.height}}toGreyScale(t){if(-1===t.indexOf("#"))return t;const e=this.cssToRgb(t);e[0]=e[1]=e[2]=Math.round(.3*e[0]+.59*e[1]+.11*e[2]);const i=this.rgbToHex(e[0],e[1],e[2]);return"#"+i[0]+i[1]+i[2]}decToHex(t){return t.toString(16)}hexToDec(t){return parseInt(t,16)}rgbToHex(t,e,i){return[this.decToHex(t),this.decToHex(e),this.decToHex(i)]}hexToRgb(t,e,i){return[this.hexToDec(t),this.hexToDec(e),this.hexToDec(i)]}cssToRgb(t){return t.indexOf("rgb")<=-1?this.hexToRgb(t.substring(1,3),t.substring(3,5),t.substring(5,7)):t.substring(4,t.length-1).split(",")}hslToRgb(t){let e,i,r;const s=parseFloat(t[0]),n=parseFloat(t[1]),h=parseFloat(t[2]);if(0===n)e=i=r=h;else{const t=h<.5?h*(1+n):h+n-h*n,a=2*h-t;e=this.hueToRgb(a,t,s+1/3),i=this.hueToRgb(a,t,s),r=this.hueToRgb(a,t,s-1/3)}return[255*e,255*i,255*r]}hueToRgb(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}rgbToHsl(t){const e=parseFloat(t[0])/255,i=parseFloat(t[1])/255,r=parseFloat(t[2])/255,s=Math.max(e,i,r),n=Math.min(e,i,r);let h,a,o=(s+n)/2;if(s===n)h=a=0;else{const t=s-n;switch(a=o>.5?t/(2-s-n):t/(s+n),s){case e:h=(i-r)/t+(i<r?6:0);break;case i:h=(r-e)/t+2;break;case r:h=(e-i)/t+4}h/=6}return[h,a,o]}swap(t,e){const i=t;t=e,e=i}getNum(t){if(t.constructor!==Array){if(isNaN(t))return 0}else for(let e=0;e<t.length;e++)if(!isNaN(t[e]))return t[e];return 0}_ptRotate(t,e,i,r,s){const n=Math.sqrt(Math.pow(Math.abs(t-i),2)+Math.pow(Math.abs(e-r),2)),h=Math.asin((t-i)/n)+s;return{x:t=i+Math.cos(h)*n,y:e=r+Math.sin(h)*n}}log(t,e){return Math.log(t)/(e?Math.log(e):1)}_mod(t,e){const i=Math.abs(t>e?e:t);let r=1;if(0!==i)for(;i*r<100;)r*=10;return(t*=r)%(e*=r)/r}createRenderer(t,e){const i=t;let r=i.renderer=null;return document.createElementNS&&"HTML5"!==i.renderEngine&&(r=new JQX.Utilities.SvgRenderer(this)),null!==r||"HTML5"!==i.renderEngine&&void 0!==i.renderEngine||(r=new JQX.Utilities.HTML5Renderer(this)),r.init(e),i.renderer=r,r}getByPriority(t){let e;for(let i=0;i<t.length;i++){const r=t[i];if(null!=r&&""!==r){e=r;break}}return e}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;const i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);const h=this.log(s,i);s=Math.pow(i,h);const a=this.log(r,i);r=Math.pow(i,a);const o=this.log(t,i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);const e=this.log(i.max,t),r=this.log(i.min,t);i.flip&&(n=1-n);const h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;const n=[1,2,5];let h,a=0;for(;;){let t=a%n.length,e=Math.floor(a/n.length),i=Math.pow(10,e)*n[t];if(t=(a+1)%n.length,e=Math.floor((a+1)/n.length),h=Math.pow(10,e)*n[t],s>=i&&s<h)break;a++}const o=h,l=[];let d=this.renderer._rnd(t,o,!1);const c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}_widgetToImage(t,e,i,r,s){let n=t;if(!n)return!1;void 0!==i&&""!==i||(i="image."+e);let h=n.renderEngine,a=n.animation;if(n.animation="none",n.renderEngine="HTML5",n.renderEngine!==h)try{n.refresh()}catch(t){return n.renderEngine=h,n.refresh(),n.animation=a,!1}let o=n.renderer.getContainer().firstElementChild,l=!0;"function"==typeof r&&(l=r(t,o));let d=!0;return l&&(d=this.exportImage(t,o,e,i,s)),n.renderEngine!==h&&(n.renderEngine=h,n.refresh(),n.animation=a),d}_saveAsImage(t,e){return this._widgetToImage(this,t,e)}saveAsPNG(t){return this._saveAsImage("png",t)}saveAsJPEG(t){return this._saveAsImage("jpeg",t)}exportImage(t,e,i,r,s){if(!e)return!1;let n="pdf"===i.toLowerCase();n&&(i="jpeg"),void 0!==r&&""!==r||(r="image."+i);let h=!0;if("print"!==i){try{if(e)if(n){s=s||"portrait";const n={content:{image:e.toDataURL("image/"+i),width:Math.min(e.width/1.35,"portrait"===s?515:762)},pageOrientation:s};try{pdfMake.createPdf(n).download(r)}catch(e){t.error(t.localize("missingReference",{files:"pdfmake.min.js"}))}}else{JQX.Utilities.DataExporter||t.error(t.localize("missingReference",{files:"jqx.export.js"}));const s=new JQX.Utilities.DataExporter;e.toBlob((function(t){s.downloadFile(t,i,r)}))}}catch(t){h=!1}return h}{const t=window.open("","","width=800,height=500"),i=t.document.open(),r='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>jQWidgets Chart</title></head><body><img src="'+e.toDataURL()+'" /></html>';try{i.write(r),i.close(),setTimeout((function(){t.print(),t.close()}),100)}catch(t){}}}}),JQX.Utilities.Assign("Renderer",class{constructor(t){const e=this;e.draw=t,e._gradients={},e._toRadiansCoefficient=2*Math.PI/360}pieSlicePath(t,e,i,r,s,n,h){r||(r=1);const a=Math.abs(s-n),o=a>180?1:0;a>=360&&(n=s+359.99);const l=s*this._toRadiansCoefficient,d=n*this._toRadiansCoefficient;let c=t,p=t,u=e,g=e;const f=!isNaN(i)&&i>0;f&&(h=0);const m=Math.cos(l),_=Math.sin(l),x=Math.cos(d),M=Math.sin(d);if(h+i>0){if(h>0){const i=(a/2+s)*this._toRadiansCoefficient;t+=h*Math.cos(i),e-=h*Math.sin(i)}f&&(c=t+i*m,u=e-i*_,p=t+i*x,g=e-i*M)}const y=t+r*m,w=t+r*x,N=e-r*_,v=e-r*M;let b="";const C=Math.abs(Math.abs(n-s)-360)>.02;return f?(b="M "+p+","+g,b+=" a"+i+","+i,b+=" 0 "+o+",1 "+(c-p)+","+(u-g),b+=C?" L"+y+","+N:" M"+y+","+N,b+=" a"+r+","+r,b+=" 0 "+o+",0 "+(w-y)+","+(v-N),C&&(b+=" Z")):(b="M "+w+","+v,b+=" a"+r+","+r,b+=" 0 "+o+",1 "+(y-w)+","+(N-v),C&&(b+=" L"+t+","+e,b+=" Z")),b}measureText(t,e,i,r){const s=this._getTextParts(t,e,i),n=s.width;let h=s.height;!1===r&&(h/=.6);let a={};if(isNaN(e)&&(e=0),0===e)a={width:this._rup(n),height:this._rup(h)};else{const t=e*Math.PI*2/360,i=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),s=Math.abs(n*i+h*r),o=Math.abs(n*r+h*i);a={width:this._rup(o),height:this._rup(s)}}return r&&(a.textPartsInfo=s),a}alignTextInRect(t,e,i,r,s,n,h,a,o,l){const d=o*Math.PI*2/360,c=Math.sin(d),p=Math.cos(d),u=s*c,g=s*p;"center"===h||""===h||"undefined"===h?t+=i/2:"right"===h&&(t+=i),"center"===a||"middle"===a||""===a||"undefined"===a?e+=r/2:"bottom"===a?e+=r-n/2:"top"===a&&(e+=n/2);let f="middle";-1!==(l=l||"").indexOf("top")?f="top":-1!==l.indexOf("bottom")&&(f="bottom");let m="center";return-1!==l.indexOf("left")?m="left":-1!==l.indexOf("right")&&(m="right"),"center"===m?(t-=g/2,e-=u/2):"right"===m&&(t-=g,e-=u),"top"===f?(t-=n*c,e+=n*p):"middle"===f&&(t-=n*c/2,e+=n*p/2),{x:t=this._rup(t),y:e=this._rup(e)}}adjustColor(t,e){if("string"!=typeof t)return"#000000";if(-1===t.indexOf("#"))return t;const i=this.draw;let r=i.cssToRgb(t);const s=i.rgbToHsl(r);s[2]=Math.min(1,s[2]*e),s[1]=Math.min(1,s[1]*e*1.1),r=i.hslToRgb(s),t="#";for(let e=0;e<3;e++){let s=Math.round(r[e]);s=i.decToHex(s),1===s.toString().length&&(t+="0"),t+=s}return t.toUpperCase()}_rup(t){let e=Math.round(t);return t>e&&e++,e}_ptdist(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}_rnd(t,e,i,r){if(isNaN(t))return t;void 0===r&&(r=!0);let s=t-(!0===r?t%e:this._mod(t,e));return t===s?s:(i?t>s&&(s+=e):s>t&&(s-=e),1===e?Math.round(s):s)}_ptrnd(t){if(!document.createElementNS)return Math.round(t)===t?t:this._rnd(t,1,!1,!0);const e=this._rnd(t,.5,!1,!0);return.5!==Math.abs(e-Math.round(e))?e>t?e-.5:e+.5:e}_getContrastColor(t){if(void 0===t)return;let e=this.draw.hexToRgb(t.slice(1,3),t.slice(3,5),t.slice(5,7));return(.299*e[0]+.61*e[1]+.114*e[2])/255>.6?"#000000":"#FFFFFF"}}),JQX.Utilities.Assign("SvgRenderer",class extends JQX.Utilities.Renderer{constructor(t){super(t);const e=this;e._svgns="http://www.w3.org/2000/svg",e._openGroups=[],e._clipId=0}init(t){const e=document.createElement("div");e.className="drawContainer",e.onselectstart=function(){return!1},t.appendChild(e),this.host=t,this.container=e;try{const t=document.createElementNS(this._svgns,"svg");t.setAttribute("version","1.1"),t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("overflow","hidden"),e.appendChild(t),this.canvas=t}catch(t){return!1}return this._id=(new Date).getTime(),this.clear(),!0}getType(){return"SVG"}refresh(){}getRect(){return{x:0,y:0,width:Math.max(this._rup(this.host.offsetWidth)-1,0),height:Math.max(this._rup(this.host.offsetHeight)-1,0)}}getContainer(){return this.container}clear(){for(;this.canvas.childNodes.length>0;)this.removeElement(this.canvas.firstElementChild);this._defaultParent=void 0,this._defs=document.createElementNS(this._svgns,"defs"),this._gradients={},this.canvas.appendChild(this._defs)}removeElement(t){if(void 0!==t)try{for(;t.firstChild;)this.removeElement(t.firstChild);t.parentNode?t.parentNode.removeChild(t):this.canvas.removeChild(t)}catch(t){}}beginGroup(){const t=this._activeParent(),e=document.createElementNS(this._svgns,"g");return t.appendChild(e),this._openGroups.push(e),e}endGroup(){0!==this._openGroups.length&&this._openGroups.pop()}_activeParent(){return 0===this._openGroups.length?this.canvas:this._openGroups[this._openGroups.length-1]}createClipRect(t){const e=document.createElementNS(this._svgns,"clipPath"),i=document.createElementNS(this._svgns,"rect");return this.attr(i,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"none"}),this._clipId=this._clipId||0,e.id="cl"+this._id+"_"+(++this._clipId).toString(),e.appendChild(i),this._defs.appendChild(e),e}getWindowHref(){let t=window.location.href;return t?(t=t.replace(/([\('\)])/g,"\\$1"),t=t.replace(/#.*$/,""),t):t}setClip(t,e){const i="url("+this.getWindowHref()+"#"+e.id+")";return this.attr(t,{"clip-path":i})}addHandler(t,e,i){t.addEventListener(e,i)}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}shape(t,e){const i=document.createElementNS(this._svgns,t);if(i){for(let t in e)i.setAttribute(t,e[t]);return this._activeParent().appendChild(i),i}}_getTextParts(t,e,i){const r={width:0,height:0,parts:[]};if(void 0===t)return r;const s=t.toString().split("<br>"),n=this._activeParent(),h=document.createElementNS(this._svgns,"text");this.attr(h,i);for(let t=0;t<s.length;t++){const e=s[t],i=h.ownerDocument.createTextNode(e);let a;h.appendChild(i),n.appendChild(h);try{a=h.getBBox()}catch(t){}const o=this._rup(a.width),l=this._rup(.6*a.height);h.removeChild(i),r.width=Math.max(r.width,o),r.height+=l+(t>0?4:0),r.parts.push({width:o,height:l,text:e})}return n.removeChild(h),r}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){const c=this._measureText(t,n,h,!0,this).textPartsInfo,p=c.parts,u=this._getContrastColor(arguments[11]);let g;if(o||(o="center"),l||(l="center"),(p.length>1||a)&&(g=this.beginGroup()),a){const t=this.createClipRect({x:this._rup(e)-1,y:this._rup(i)-1,width:this._rup(r)+2,height:this._rup(s)+2});this.setClip(g,t)}let f=this._activeParent(),m=0,_=0;m=c.width,_=c.height,(isNaN(r)||r<=0)&&(r=m),(isNaN(s)||s<=0)&&(s=_);const x=r||0,M=s||0;let y=0;if(!n||0===n){let t;i+=_,"center"===l||"middle"===l?i+=(M-_)/2:"bottom"===l&&(i+=M-_),r||(r=m),s||(s=_),f=this._activeParent();for(let r=p.length-1;r>=0;r--){t=document.createElementNS(this._svgns,"text"),this.attr(t,h),this.attr(t,{cursor:"default"});const s=t.ownerDocument.createTextNode(p[r].text);t.appendChild(s);let n=e;const a=p[r].width,l=p[r].height;"center"===o?n+=(x-a)/2:"right"===o&&(n+=x-a),this.attr(t,{x:this._rup(n),y:this._rup(i+y),width:this._rup(a),height:this._rup(l)}),void 0!==u&&(t.style.fill=u),f.appendChild(t),y-=p[r].height+4}return g?(this.endGroup(),g):t}const w=this.alignTextInRect(e,i,r,s,m,_,o,l,n,d);e=w.x,i=w.y;const N=this.shape("g",{transform:"translate("+e+","+i+")"}),v=this.shape("g",{transform:"rotate("+n+")"});N.appendChild(v),y=0;for(let t=p.length-1;t>=0;t--){const e=document.createElementNS(this._svgns,"text");this.attr(e,h),this.attr(e,{cursor:"default"});const i=e.ownerDocument.createTextNode(p[t].text);e.appendChild(i);let r=0;const s=p[t].width,n=p[t].height;"center"===o?r+=(c.width-s)/2:"right"===o&&(r+=c.width-s),this.attr(e,{x:this._rup(r),y:this._rup(y),width:this._rup(s),height:this._rup(n)}),v.appendChild(e),y-=n+4}return f.appendChild(N),g&&this.endGroup(),N}line(t,e,i,r,s){const n=this.shape("line",{x1:t,y1:e,x2:i,y2:r});return this.attr(n,s),n}path(t,e){const i=this.shape("path");return i.setAttribute("d",t),e&&this.attr(i,e),i}rect(t,e,i,r,s){t=this._ptrnd(t),e=this._ptrnd(e),i=Math.max(1,this._rnd(i,1,!1)),r=Math.max(1,this._rnd(r,1,!1));const n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}circle(t,e,i,r){const s=this.shape("circle",{cx:t,cy:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){const o=this.pieSlicePath(t,e,i,r,s,n,h),l=this.shape("path");return l.setAttribute("d",o),a&&this.attr(l,a),l}attr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent=e[i]:"width"===i||"height"===i?t.setAttribute(i,Math.max(0,e[i])):t.setAttribute(i,e[i])}removeAttr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent="":t.removeAttribute(e[i])}getAttr(t,e){return t.getAttribute(e)}_toLinearGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+(e?"v":"h"),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"linearGradient");this.attr(n,{x1:"0%",y1:"0%",x2:e?"0%":"100%",y2:e?"100%":"0%",id:r});for(let e=0;e<i.length;e++){const r=i[e],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}_toRadialGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+"r"+(void 0!==i?i.key:""),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"radialGradient");void 0===i?this.attr(n,{cx:"50%",cy:"50%",r:"100%",fx:"50%",fy:"50%",id:r}):this.attr(n,{cx:i.x,cy:i.y,r:i.outerRadius,id:r,gradientUnits:"userSpaceOnUse"});for(let i=0;i<e.length;i++){const r=e[i],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}}),JQX.Utilities.Assign("HTML5Renderer",class extends JQX.Utilities.Renderer{constructor(t){super(t),this._renderers=new JQX.Utilities.HTML5RenderHelpers(this)}init(t){try{this.host=t;const e=document.createElement("div"),i=document.createElement("canvas");e.className="chartContainer",e.style.position="relative",e.onselectstart=function(){return!1},i.id="__jqxCanvasWrap",i.style.width="100%",i.style.height="100%",e.appendChild(i),t.appendChild(e),this.canvas=i,i.width=t.offsetWidth,i.height=t.offsetHeight,this.ctx=i.getContext("2d"),this._elements={},this._maxId=0,this._gradientId=0,this._gradients={},this._currentPoint={x:0,y:0},this._lastCmd="",this._pos=0}catch(t){return!1}return!0}getType(){return"HTML5"}getContainer(){return this.host.getElementsByClassName("chartContainer")[0]}getRect(){return{x:0,y:0,width:this.canvas.width-1,height:this.canvas.height-1}}beginGroup(){}endGroup(){}setClip(){}createClipRect(){}addHandler(){}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}clear(){this._elements={},this._maxId=0,this._renderers._gradients={},this._gradientId=0}removeElement(t){void 0!==t&&this._elements[t.id]&&delete this._elements[t.id]}shape(t,e){let i={type:t,id:this._maxId++};for(let t in e)i[t]=e[t];return this._elements[i.id]=i,i}attr(t,e){for(let i in e)t[i]=e[i]}removeAttr(t,e){for(let i in e)delete t[e[i]]}rect(t,e,i,r,s){if(isNaN(t))throw'Invalid value for "x"';if(isNaN(e))throw'Invalid value for "y"';if(isNaN(i))throw'Invalid value for "width"';if(isNaN(r))throw'Invalid value for "height"';let n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}path(t,e){let i=this.shape("path",e);return this.attr(i,{d:t}),i}line(t,e,i,r,s){return this.path("M "+t+","+e+" L "+i+","+r,s)}circle(t,e,i,r){let s=this.shape("circle",{x:t,y:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){let o=this.path(this.pieSlicePath(t,e,i,r,s,n,h),a);return this.attr(o,{x:t,y:e,innerRadius:i,outerRadius:r,angleFrom:s,angleTo:n}),o}_getCSSStyle(t){const e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",this.host.appendChild(e);let i=window.getComputedStyle(e);return i={color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight},this.host.removeChild(e),i}_getTextParts(t,e,i){let r="Arial",s="10pt",n="";if(i&&i.class){let t=this._getCSSStyle(i.class);t.fontSize&&(s=t.fontSize),t.fontFamily&&(r=t.fontFamily),t.fontWeight&&(n=t.fontWeight)}this.ctx.font=n+" "+s+" "+r;let h={width:0,height:0,parts:[]},a=t.toString().split("<br>");for(let t=0;t<a.length;t++){let e=a[t],i=this.ctx.measureText(e).width,r=document.createElement("span");r.className="chart",r.font=this.ctx.font,r.textContent=e,this.host.appendChild(r);let s=.6*r.offsetHeight;this.host.removeChild(r),h.width=Math.max(h.width,this._rup(i)),h.height+=s+(t>0?4:0),h.parts.push({width:i,height:s,text:e})}return h}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){let c=this.shape("text",{text:t,x:e,y:i,width:r,height:s,angle:n,clip:a,halign:o,valign:l,rotateAround:d});if(h&&this.attr(c,h),c.fontFamily="Arial",c.fontSize="10pt",c.fontWeight="",c.color=this._getContrastColor(arguments[11]),h&&h.class){let t=this._getCSSStyle(h.class);c.fontFamily=t.fontFamily||c.fontFamily,c.fontSize=t.fontSize||c.fontSize,c.fontWeight=t.fontWeight||c.fontWeight,c.color=c.color||t.color}c.color=c.color||"#000000";let p=this._measureText(t,0,h,!0);return this.attr(c,{textPartsInfo:p.textPartsInfo,textWidth:p.width,textHeight:p.height}),(r<=0||isNaN(r))&&this.attr(c,{width:p.width}),(s<=0||isNaN(s))&&this.attr(c,{height:p.height}),c}_toLinearGradient(t,e,i){if(this._renderers._gradients[t])return t;let r=[];for(let e=0;e<i.length;e++)r.push({percent:i[e][0]/100,color:this.adjustColor(t,i[e][1])});let s="gr"+this._gradientId++;return this.createGradient(s,e?"vertical":"horizontal",r),s}_toRadialGradient(t,e){if(this._renderers._gradients[t])return t;let i=[];for(let r=0;r<e.length;r++)i.push({percent:e[r][0]/100,color:this.adjustColor(t,e[r][1])});let r="gr"+this._gradientId++;return this.createGradient(r,"radial",i),r}createGradient(t,e,i){this._renderers.createGradient(this,t,e,i)}refresh(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(let t in this._elements){let e=this._elements[t];this._renderers.setFillStyle(this,e),this._renderers.setStroke(this,e),this._renderers[this._elements[t].type](this.ctx,e)}}}),JQX.Utilities.Assign("HTML5RenderHelpers",class{constructor(t){this.HTML5Renderer=t,this._cmds="mlcazq"}ptrnd(t){if(.5===Math.abs(Math.round(t)-t))return t;let e=Math.round(t);return e<t&&(e-=1),e+.5}createGradient(t,e,i,r){t._gradients[e]={orientation:i,colorStops:r}}setStroke(t,e){let i=t.ctx,r=e["stroke-width"];i.strokeStyle=e.stroke||"transparent",i.lineWidth=0===r?.01:void 0!==r?r:1,void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,i.setLineDash&&(e["stroke-dasharray"]?i.setLineDash(e["stroke-dasharray"].split(",")):i.setLineDash([]))}setFillStyle(t,e){let i=t.ctx;if(i.fillStyle="transparent",void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,e.fill&&-1===e.fill.indexOf("#")&&t._gradients[e.fill]){let r,s="horizontal"!==t._gradients[e.fill].orientation,n="radial"===t._gradients[e.fill].orientation,h=this.ptrnd(e.x),a=this.ptrnd(e.y),o=this.ptrnd(e.x+(s?0:e.width)),l=this.ptrnd(e.y+(s?e.height:0));if(("circle"===e.type||"path"===e.type||"rect"===e.type)&&n){let t=this.ptrnd(e.x),s=this.ptrnd(e.y);const n=e.innerRadius||0,h=e.outerRadius||e.r||0;"rect"===e.type&&(t+=e.width/2,s+=e.height/2),r=i.createRadialGradient(t,s,n,t,s,h)}n||((isNaN(h)||isNaN(o)||isNaN(a)||isNaN(l))&&(h=0,a=0,o=s?0:i.canvas.width,l=s?i.canvas.height:0),r=i.createLinearGradient(h,a,o,l));let d=t._gradients[e.fill].colorStops;for(let t=0;t<d.length;t++)r.addColorStop(d[t].percent,d[t].color);i.fillStyle=r}else e.fill&&(i.fillStyle=e.fill)}rect(t,e){0!==e.width&&0!==e.height&&(t.fillRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height),t.strokeRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height))}circle(t,e){0!==e.r&&(t.beginPath(),t.arc(this.ptrnd(e.x),this.ptrnd(e.y),e.r,0,2*Math.PI,!1),t.closePath(),t.fill(),t.stroke())}_parsePoint(t){return{x:this._parseNumber(t),y:this._parseNumber(t)}}_parseNumber(t){let e,i=!1;for(e=this._pos;e<t.length;e++)if(t[e]>="0"&&t[e]<="9"||"."===t[e]||"e"===t[e]||"-"===t[e]&&!i||"-"===t[e]&&e>=1&&"e"===t[e-1])i=!0;else{if(i||" "!==t[e]&&","!==t[e])break;this._pos++}let r=parseFloat(t.substring(this._pos,e));if(!isNaN(r))return this._pos=e,r}_isRelativeCmd(t){return-1!==this._cmds.indexOf(t)}_parseCmd(t){for(let e=this._pos;e<t.length;e++){if(-1!==this._cmds.toLowerCase().indexOf(t[e].toLowerCase()))return this._pos=e+1,this._lastCmd=t[e],this._lastCmd;if(" "!==t[e]){if(t[e]>="0"&&t[e]<="9"){if(this._pos=e,""===this._lastCmd)break;return this._lastCmd}}else this._pos++}}_toAbsolutePoint(t){return{x:this._currentPoint.x+t.x,y:this._currentPoint.y+t.y}}path(t,e){let i,r=e.d;for(this._pos=0,this._lastCmd="",this._currentPoint={x:0,y:0},t.beginPath();this._pos<r.length;){let e=this._parseCmd(r);if(void 0===e)break;if("M"!==e&&"m"!==e)if("L"!==e&&"l"!==e)if("A"!==e&&"a"!==e)if("Z"!==e&&"z"!==e||void 0===i)if("C"!==e&&"c"!==e)if("Q"!==e&&"q"!==e);else{let e=this._parsePoint(r),i=this._parsePoint(r);t.quadraticCurveTo(e.x,e.y,i.x,i.y),this._currentPoint=i}else{let e=this._parsePoint(r),i=this._parsePoint(r),s=this._parsePoint(r);t.bezierCurveTo(e.x,e.y,i.x,i.y,s.x,s.y),this._currentPoint=s}else t.lineTo(i.x,i.y),this._currentPoint=i;else{let i=this._parseNumber(r),s=this._parseNumber(r),n=this._parseNumber(r)*(Math.PI/180),h=this._parseNumber(r),a=this._parseNumber(r),o=this._parsePoint(r);if(this._isRelativeCmd(e)&&(o=this._toAbsolutePoint(o)),0===i||0===s)continue;let l=this._currentPoint,d={x:Math.cos(n)*(l.x-o.x)/2+Math.sin(n)*(l.y-o.y)/2,y:-Math.sin(n)*(l.x-o.x)/2+Math.cos(n)*(l.y-o.y)/2},c=Math.pow(d.x,2)/Math.pow(i,2)+Math.pow(d.y,2)/Math.pow(s,2);c>1&&(i*=Math.sqrt(c),s*=Math.sqrt(c));let p=(h===a?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(s,2)-Math.pow(i,2)*Math.pow(d.y,2)-Math.pow(s,2)*Math.pow(d.x,2))/(Math.pow(i,2)*Math.pow(d.y,2)+Math.pow(s,2)*Math.pow(d.x,2)));isNaN(p)&&(p=0);let u={x:p*i*d.y/s,y:p*-s*d.x/i},g={x:(l.x+o.x)/2+Math.cos(n)*u.x-Math.sin(n)*u.y,y:(l.y+o.y)/2+Math.sin(n)*u.x+Math.cos(n)*u.y},f=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},m=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e))},_=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(m(t,e))},x=_([1,0],[(d.x-u.x)/i,(d.y-u.y)/s]),M=[(d.x-u.x)/i,(d.y-u.y)/s],y=[(-d.x-u.x)/i,(-d.y-u.y)/s],w=_(M,y);m(M,y)<=-1&&(w=Math.PI),m(M,y)>=1&&(w=0),0===a&&w>0&&(w-=2*Math.PI),1===a&&w<0&&(w+=2*Math.PI);let N=i>s?i:s,v=i>s?1:i/s,b=i>s?s/i:1;t.translate(g.x,g.y),t.rotate(n),t.scale(v,b),t.arc(0,0,N,x,x+w,1-a),t.scale(1/v,1/b),t.rotate(-n),t.translate(-g.x,-g.y)}else{let e=this._parsePoint(r);if(void 0===e)break;t.lineTo(e.x,e.y),this._currentPoint=e}else{let e=this._parsePoint(r);if(void 0===e)break;t.moveTo(e.x,e.y),this._currentPoint=e,void 0===i&&(i=e)}}t.fill(),t.stroke(),t.closePath()}text(t,e){let i=this.ptrnd(e.x),r=this.ptrnd(e.y),s=this.ptrnd(e.width),n=this.ptrnd(e.height),h=e.halign,a=e.valign,o=e.angle,l=e.rotateAround,d=e.textPartsInfo,c=d.parts,p=e.clip;void 0===p&&(p=!0),t.save(),h||(h="center"),a||(a="center"),p&&(t.rect(i,r,s,n),t.clip());let u=e.textWidth,g=e.textHeight,f=s||0,m=n||0;if(t.fillStyle=e.color,t.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,!o||0===o){r+=g,"center"===a||"middle"===a?r+=(m-g)/2:"bottom"===a&&(r+=m-g),s||(s=u),n||(n=g);let e=0;for(let s=c.length-1;s>=0;s--){let n=c[s],a=i,o=c[s].width;"center"===h?a+=(f-o)/2:"right"===h&&(a+=f-o),t.fillText(n.text,a,r+e),e-=n.height+(s>0?4:0)}return void t.restore()}let _=this.HTML5Renderer.alignTextInRect(i,r,s,n,u,g,h,a,o,l);i=_.x,r=_.y;let x=o*Math.PI*2/360;t.translate(i,r),t.rotate(x);let M=0,y=d.width;for(let e=c.length-1;e>=0;e--){let i=0;"center"===h?i+=(y-c[e].width)/2:"right"===h&&(i+=y-c[e].width),t.fillText(c[e].text,i,M),M-=c[e].height+4}t.restore()}}),JQX.Utilities.Assign("Plot",class{constructor(t){this.renderer=t}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;let i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);let h=Math.log(s)/Math.log(i);s=Math.pow(i,h);let a=Math.log(r)/Math.log(i);r=Math.pow(i,a);let o=Math.log(t)/Math.log(i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);let e=Math.log(i.max)/Math.log(t),r=Math.log(i.min)/Math.log(t);i.flip&&(n=1-n);let h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;let n,h=[1,2,5],a=0;for(;;){let t=a%h.length,e=Math.floor(a/h.length),i=Math.pow(10,e)*h[t];if(t=(a+1)%h.length,e=Math.floor((a+1)/h.length),n=Math.pow(10,e)*h[t],s>=i&&s<n)break;a++}let o=n,l=[],d=this.renderer._rnd(t,o,!1),c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}});
48
+ JQX.Utilities.Assign("Draw",class{constructor(t,e){const i=this;i.host=t,i.renderEngine=e||"",i.refresh();const r=["clear","removeElement","attr","getAttr","line","circle","rect","path","pieslice","pieSlicePath","text","measureText"];for(let t in r)i._addFn(JQX.Utilities.Draw.prototype,r[t])}_addFn(t,e){t[e]||(t[e]=function(){return this.renderer[e].apply(this.renderer,arguments)})}_initRenderer(t){return this.createRenderer(this,t)}_internalRefresh(){const t=this;if(t.renderer||(t.host.innerHTML="",t._initRenderer(t.host)),"none"===window.getComputedStyle(t.host).display)return;const e=t.renderer;if(!e)return;const i=e.getRect();t._render({x:1,y:1,width:i.width,height:i.height})}_render(t){this._plotRect=t}refresh(){this._internalRefresh()}getSize(){const t=this._plotRect;return{width:t.width,height:t.height}}toGreyScale(t){if(-1===t.indexOf("#"))return t;const e=this.cssToRgb(t);e[0]=e[1]=e[2]=Math.round(.3*e[0]+.59*e[1]+.11*e[2]);const i=this.rgbToHex(e[0],e[1],e[2]);return"#"+i[0]+i[1]+i[2]}decToHex(t){return t.toString(16)}hexToDec(t){return parseInt(t,16)}rgbToHex(t,e,i){return[this.decToHex(t),this.decToHex(e),this.decToHex(i)]}hexToRgb(t,e,i){return[this.hexToDec(t),this.hexToDec(e),this.hexToDec(i)]}cssToRgb(t){return t.indexOf("rgb")<=-1?this.hexToRgb(t.substring(1,3),t.substring(3,5),t.substring(5,7)):t.substring(4,t.length-1).split(",")}hslToRgb(t){let e,i,r;const s=parseFloat(t[0]),n=parseFloat(t[1]),h=parseFloat(t[2]);if(0===n)e=i=r=h;else{const t=h<.5?h*(1+n):h+n-h*n,a=2*h-t;e=this.hueToRgb(a,t,s+1/3),i=this.hueToRgb(a,t,s),r=this.hueToRgb(a,t,s-1/3)}return[255*e,255*i,255*r]}hueToRgb(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}rgbToHsl(t){const e=parseFloat(t[0])/255,i=parseFloat(t[1])/255,r=parseFloat(t[2])/255,s=Math.max(e,i,r),n=Math.min(e,i,r);let h,a,o=(s+n)/2;if(s===n)h=a=0;else{const t=s-n;switch(a=o>.5?t/(2-s-n):t/(s+n),s){case e:h=(i-r)/t+(i<r?6:0);break;case i:h=(r-e)/t+2;break;case r:h=(e-i)/t+4}h/=6}return[h,a,o]}swap(t,e){const i=t;t=e,e=i}getNum(t){if(t.constructor!==Array){if(isNaN(t))return 0}else for(let e=0;e<t.length;e++)if(!isNaN(t[e]))return t[e];return 0}_ptRotate(t,e,i,r,s){const n=Math.sqrt(Math.pow(Math.abs(t-i),2)+Math.pow(Math.abs(e-r),2)),h=Math.asin((t-i)/n)+s;return{x:t=i+Math.cos(h)*n,y:e=r+Math.sin(h)*n}}log(t,e){return Math.log(t)/(e?Math.log(e):1)}_mod(t,e){const i=Math.abs(t>e?e:t);let r=1;if(0!==i)for(;i*r<100;)r*=10;return(t*=r)%(e*=r)/r}createRenderer(t,e){const i=t;let r=i.renderer=null;return document.createElementNS&&"HTML5"!==i.renderEngine&&(r=new JQX.Utilities.SvgRenderer(this)),null!==r||"HTML5"!==i.renderEngine&&void 0!==i.renderEngine||(r=new JQX.Utilities.HTML5Renderer(this)),r.init(e),i.renderer=r,r}getByPriority(t){let e;for(let i=0;i<t.length;i++){const r=t[i];if(null!=r&&""!==r){e=r;break}}return e}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;const i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);const h=this.log(s,i);s=Math.pow(i,h);const a=this.log(r,i);r=Math.pow(i,a);const o=this.log(t,i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);const e=this.log(i.max,t),r=this.log(i.min,t);i.flip&&(n=1-n);const h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;const n=[1,2,5];let h,a=0;for(;;){let t=a%n.length,e=Math.floor(a/n.length),i=Math.pow(10,e)*n[t];if(t=(a+1)%n.length,e=Math.floor((a+1)/n.length),h=Math.pow(10,e)*n[t],s>=i&&s<h)break;a++}const o=h,l=[];let d=this.renderer._rnd(t,o,!1);const c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}_widgetToImage(t,e,i,r,s){let n=t;if(!n)return!1;void 0!==i&&""!==i||(i="image."+e);let h=n.renderEngine,a=n.animation;if(n.animation="none",n.renderEngine="HTML5",n.renderEngine!==h)try{n.refresh()}catch(t){return n.renderEngine=h,n.refresh(),n.animation=a,!1}let o=n.renderer.getContainer().firstElementChild,l=!0;"function"==typeof r&&(l=r(t,o));let d=!0;return l&&(d=this.exportImage(t,o,e,i,s)),n.renderEngine!==h&&(n.renderEngine=h,n.refresh(),n.animation=a),d}_saveAsImage(t,e){return this._widgetToImage(this,t,e)}saveAsPNG(t){return this._saveAsImage("png",t)}saveAsJPEG(t){return this._saveAsImage("jpeg",t)}exportImage(t,e,i,r,s){if(!e)return!1;let n="pdf"===i.toLowerCase();n&&(i="jpeg"),void 0!==r&&""!==r||(r="image."+i);let h=!0;if("print"!==i){try{if(e)if(n){s=s||"portrait";const n={content:{image:e.toDataURL("image/"+i),width:Math.min(e.width/1.35,"portrait"===s?515:762)},pageOrientation:s};try{pdfMake.createPdf(n).download(r)}catch(e){t.error(t.localize("missingReference",{files:"pdfmake.min.js"}))}}else{JQX.Utilities.DataExporter||t.error(t.localize("missingReference",{files:"jqx.export.js"}));const s=new JQX.Utilities.DataExporter;e.toBlob((function(t){s.downloadFile(t,i,r)}))}}catch(t){h=!1}return h}{const t=window.open("","","width=800,height=500"),i=t.document.open(),r='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>jQWidgets Chart</title></head><body><img src="'+e.toDataURL()+'" /></html>';try{i.write(r),i.close(),setTimeout((function(){t.print(),t.close()}),100)}catch(t){}}}}),JQX.Utilities.Assign("Renderer",class{constructor(t){const e=this;e.draw=t,e._gradients={},e._toRadiansCoefficient=2*Math.PI/360}pieSlicePath(t,e,i,r,s,n,h){r||(r=1);const a=Math.abs(s-n),o=a>180?1:0;a>=360&&(n=s+359.99);const l=s*this._toRadiansCoefficient,d=n*this._toRadiansCoefficient;let c=t,p=t,u=e,g=e;const f=!isNaN(i)&&i>0;f&&(h=0);const m=Math.cos(l),_=Math.sin(l),x=Math.cos(d),M=Math.sin(d);if(h+i>0){if(h>0){const i=(a/2+s)*this._toRadiansCoefficient;t+=h*Math.cos(i),e-=h*Math.sin(i)}f&&(c=t+i*m,u=e-i*_,p=t+i*x,g=e-i*M)}const y=t+r*m,w=t+r*x,N=e-r*_,v=e-r*M;let b="";const C=Math.abs(Math.abs(n-s)-360)>.02;return f?(b="M "+p+","+g,b+=" a"+i+","+i,b+=" 0 "+o+",1 "+(c-p)+","+(u-g),b+=C?" L"+y+","+N:" M"+y+","+N,b+=" a"+r+","+r,b+=" 0 "+o+",0 "+(w-y)+","+(v-N),C&&(b+=" Z")):(b="M "+w+","+v,b+=" a"+r+","+r,b+=" 0 "+o+",1 "+(y-w)+","+(N-v),C&&(b+=" L"+t+","+e,b+=" Z")),b}measureText(t,e,i,r){const s=this._getTextParts(t,e,i),n=s.width;let h=s.height;!1===r&&(h/=.6);let a={};if(isNaN(e)&&(e=0),0===e)a={width:this._rup(n),height:this._rup(h)};else{const t=e*Math.PI*2/360,i=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),s=Math.abs(n*i+h*r),o=Math.abs(n*r+h*i);a={width:this._rup(o),height:this._rup(s)}}return r&&(a.textPartsInfo=s),a}alignTextInRect(t,e,i,r,s,n,h,a,o,l){const d=o*Math.PI*2/360,c=Math.sin(d),p=Math.cos(d),u=s*c,g=s*p;"center"===h||""===h||"undefined"===h?t+=i/2:"right"===h&&(t+=i),"center"===a||"middle"===a||""===a||"undefined"===a?e+=r/2:"bottom"===a?e+=r-n/2:"top"===a&&(e+=n/2);let f="middle";-1!==(l=l||"").indexOf("top")?f="top":-1!==l.indexOf("bottom")&&(f="bottom");let m="center";return-1!==l.indexOf("left")?m="left":-1!==l.indexOf("right")&&(m="right"),"center"===m?(t-=g/2,e-=u/2):"right"===m&&(t-=g,e-=u),"top"===f?(t-=n*c,e+=n*p):"middle"===f&&(t-=n*c/2,e+=n*p/2),{x:t=this._rup(t),y:e=this._rup(e)}}adjustColor(t,e){if("string"!=typeof t)return"#000000";if(-1===t.indexOf("#"))return t;const i=this.draw;let r=i.cssToRgb(t);const s=i.rgbToHsl(r);s[2]=Math.min(1,s[2]*e),s[1]=Math.min(1,s[1]*e*1.1),r=i.hslToRgb(s),t="#";for(let e=0;e<3;e++){let s=Math.round(r[e]);s=i.decToHex(s),1===s.toString().length&&(t+="0"),t+=s}return t.toUpperCase()}_rup(t){let e=Math.round(t);return t>e&&e++,e}_ptdist(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}_rnd(t,e,i,r){if(isNaN(t))return t;void 0===r&&(r=!0);let s=t-(!0===r?t%e:this._mod(t,e));return t===s?s:(i?t>s&&(s+=e):s>t&&(s-=e),1===e?Math.round(s):s)}_ptrnd(t){if(!document.createElementNS)return Math.round(t)===t?t:this._rnd(t,1,!1,!0);const e=this._rnd(t,.5,!1,!0);return.5!==Math.abs(e-Math.round(e))?e>t?e-.5:e+.5:e}_getContrastColor(t){if(void 0===t)return;let e=this.draw.hexToRgb(t.slice(1,3),t.slice(3,5),t.slice(5,7));return(.299*e[0]+.61*e[1]+.114*e[2])/255>.6?"#000000":"#FFFFFF"}}),JQX.Utilities.Assign("SvgRenderer",class extends JQX.Utilities.Renderer{constructor(t){super(t);const e=this;e._svgns="http://www.w3.org/2000/svg",e._openGroups=[],e._clipId=0}init(t){const e=document.createElement("div");e.className="drawContainer",e.onselectstart=function(){return!1},t.appendChild(e),this.host=t,this.container=e;try{const t=document.createElementNS(this._svgns,"svg");t.setAttribute("version","1.1"),t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("overflow","hidden"),e.appendChild(t),this.canvas=t}catch(t){return!1}return this._id=(new Date).getTime(),this.clear(),!0}getType(){return"SVG"}refresh(){}getRect(){return{x:0,y:0,width:Math.max(this._rup(this.host.offsetWidth)-1,0),height:Math.max(this._rup(this.host.offsetHeight)-1,0)}}getContainer(){return this.container}clear(){for(;this.canvas.childNodes.length>0;)this.removeElement(this.canvas.firstElementChild);this._defaultParent=void 0,this._defs=document.createElementNS(this._svgns,"defs"),this._gradients={},this.canvas.appendChild(this._defs)}removeElement(t){if(void 0!==t)try{for(;t.firstChild;)this.removeElement(t.firstChild);t.parentNode?t.parentNode.removeChild(t):this.canvas.removeChild(t)}catch(t){}}beginGroup(){const t=this._activeParent(),e=document.createElementNS(this._svgns,"g");return t.appendChild(e),this._openGroups.push(e),e}endGroup(){0!==this._openGroups.length&&this._openGroups.pop()}_activeParent(){return 0===this._openGroups.length?this.canvas:this._openGroups[this._openGroups.length-1]}createClipRect(t){const e=document.createElementNS(this._svgns,"clipPath"),i=document.createElementNS(this._svgns,"rect");return this.attr(i,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"none"}),this._clipId=this._clipId||0,e.id="cl"+this._id+"_"+(++this._clipId).toString(),e.appendChild(i),this._defs.appendChild(e),e}getWindowHref(){let t=window.location.href;return t?(t=t.replace(/([\('\)])/g,"\\$1"),t=t.replace(/#.*$/,""),t):t}setClip(t,e){const i="url("+this.getWindowHref()+"#"+e.id+")";return this.attr(t,{"clip-path":i})}addHandler(t,e,i){t.addEventListener(e,i)}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}shape(t,e){const i=document.createElementNS(this._svgns,t);if(i){for(let t in e)i.setAttribute(t,e[t]);return this._activeParent().appendChild(i),i}}_getTextParts(t,e,i){const r={width:0,height:0,parts:[]};if(void 0===t)return r;const s=t.toString().split("<br>"),n=this._activeParent(),h=document.createElementNS(this._svgns,"text");this.attr(h,i);for(let t=0;t<s.length;t++){const e=s[t],i=h.ownerDocument.createTextNode(e);let a;h.appendChild(i),n.appendChild(h);try{a=h.getBBox()}catch(t){}const o=this._rup(a.width),l=this._rup(.6*a.height);h.removeChild(i),r.width=Math.max(r.width,o),r.height+=l+(t>0?4:0),r.parts.push({width:o,height:l,text:e})}return n.removeChild(h),r}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){const c=this._measureText(t,n,h,!0,this).textPartsInfo,p=c.parts,u=this._getContrastColor(arguments[11]);let g;if(o||(o="center"),l||(l="center"),(p.length>1||a)&&(g=this.beginGroup()),a){const t=this.createClipRect({x:this._rup(e)-1,y:this._rup(i)-1,width:this._rup(r)+2,height:this._rup(s)+2});this.setClip(g,t)}let f=this._activeParent(),m=0,_=0;m=c.width,_=c.height,(isNaN(r)||r<=0)&&(r=m),(isNaN(s)||s<=0)&&(s=_);const x=r||0,M=s||0;let y=0;if(!n||0===n){let t;i+=_,"center"===l||"middle"===l?i+=(M-_)/2:"bottom"===l&&(i+=M-_),r||(r=m),s||(s=_),f=this._activeParent();for(let r=p.length-1;r>=0;r--){t=document.createElementNS(this._svgns,"text"),this.attr(t,h),this.attr(t,{cursor:"default"});const s=t.ownerDocument.createTextNode(p[r].text);t.appendChild(s);let n=e;const a=p[r].width,l=p[r].height;"center"===o?n+=(x-a)/2:"right"===o&&(n+=x-a),this.attr(t,{x:this._rup(n),y:this._rup(i+y),width:this._rup(a),height:this._rup(l)}),void 0!==u&&(t.style.fill=u),f.appendChild(t),y-=p[r].height+4}return g?(this.endGroup(),g):t}const w=this.alignTextInRect(e,i,r,s,m,_,o,l,n,d);e=w.x,i=w.y;const N=this.shape("g",{transform:"translate("+e+","+i+")"}),v=this.shape("g",{transform:"rotate("+n+")"});N.appendChild(v),y=0;for(let t=p.length-1;t>=0;t--){const e=document.createElementNS(this._svgns,"text");this.attr(e,h),this.attr(e,{cursor:"default"});const i=e.ownerDocument.createTextNode(p[t].text);e.appendChild(i);let r=0;const s=p[t].width,n=p[t].height;"center"===o?r+=(c.width-s)/2:"right"===o&&(r+=c.width-s),this.attr(e,{x:this._rup(r),y:this._rup(y),width:this._rup(s),height:this._rup(n)}),v.appendChild(e),y-=n+4}return f.appendChild(N),g&&this.endGroup(),N}line(t,e,i,r,s){const n=this.shape("line",{x1:t,y1:e,x2:i,y2:r});return this.attr(n,s),n}path(t,e){const i=this.shape("path");return i.setAttribute("d",t),e&&this.attr(i,e),i}rect(t,e,i,r,s){t=this._ptrnd(t),e=this._ptrnd(e),i=Math.max(1,this._rnd(i,1,!1)),r=Math.max(1,this._rnd(r,1,!1));const n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}circle(t,e,i,r){const s=this.shape("circle",{cx:t,cy:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){const o=this.pieSlicePath(t,e,i,r,s,n,h),l=this.shape("path");return l.setAttribute("d",o),a&&this.attr(l,a),l}attr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent=e[i]:"width"===i||"height"===i?t.setAttribute(i,Math.max(0,e[i])):t.setAttribute(i,e[i])}removeAttr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent="":t.removeAttribute(e[i])}getAttr(t,e){return t.getAttribute(e)}_toLinearGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+(e?"v":"h"),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"linearGradient");this.attr(n,{x1:"0%",y1:"0%",x2:e?"0%":"100%",y2:e?"100%":"0%",id:r});for(let e=0;e<i.length;e++){const r=i[e],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}_toRadialGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+"r"+(void 0!==i?i.key:""),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"radialGradient");void 0===i?this.attr(n,{cx:"50%",cy:"50%",r:"100%",fx:"50%",fy:"50%",id:r}):this.attr(n,{cx:i.x,cy:i.y,r:i.outerRadius,id:r,gradientUnits:"userSpaceOnUse"});for(let i=0;i<e.length;i++){const r=e[i],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}}),JQX.Utilities.Assign("HTML5Renderer",class extends JQX.Utilities.Renderer{constructor(t){super(t),this._renderers=new JQX.Utilities.HTML5RenderHelpers(this)}init(t){try{this.host=t;const e=document.createElement("div"),i=document.createElement("canvas");e.className="chartContainer",e.style.position="relative",e.onselectstart=function(){return!1},i.id="__smartCanvasWrap",i.style.width="100%",i.style.height="100%",e.appendChild(i),t.appendChild(e),this.canvas=i,i.width=t.offsetWidth,i.height=t.offsetHeight,this.ctx=i.getContext("2d"),this._elements={},this._maxId=0,this._gradientId=0,this._gradients={},this._currentPoint={x:0,y:0},this._lastCmd="",this._pos=0}catch(t){return!1}return!0}getType(){return"HTML5"}getContainer(){return this.host.getElementsByClassName("chartContainer")[0]}getRect(){return{x:0,y:0,width:this.canvas.width-1,height:this.canvas.height-1}}beginGroup(){}endGroup(){}setClip(){}createClipRect(){}addHandler(){}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}clear(){this._elements={},this._maxId=0,this._renderers._gradients={},this._gradientId=0}removeElement(t){void 0!==t&&this._elements[t.id]&&delete this._elements[t.id]}shape(t,e){let i={type:t,id:this._maxId++};for(let t in e)i[t]=e[t];return this._elements[i.id]=i,i}attr(t,e){for(let i in e)t[i]=e[i]}removeAttr(t,e){for(let i in e)delete t[e[i]]}rect(t,e,i,r,s){if(isNaN(t))throw'Invalid value for "x"';if(isNaN(e))throw'Invalid value for "y"';if(isNaN(i))throw'Invalid value for "width"';if(isNaN(r))throw'Invalid value for "height"';let n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}path(t,e){let i=this.shape("path",e);return this.attr(i,{d:t}),i}line(t,e,i,r,s){return this.path("M "+t+","+e+" L "+i+","+r,s)}circle(t,e,i,r){let s=this.shape("circle",{x:t,y:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){let o=this.path(this.pieSlicePath(t,e,i,r,s,n,h),a);return this.attr(o,{x:t,y:e,innerRadius:i,outerRadius:r,angleFrom:s,angleTo:n}),o}_getCSSStyle(t){const e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",this.host.appendChild(e);let i=window.getComputedStyle(e);return i={color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight},this.host.removeChild(e),i}_getTextParts(t,e,i){let r="Arial",s="10pt",n="";if(i&&i.class){let t=this._getCSSStyle(i.class);t.fontSize&&(s=t.fontSize),t.fontFamily&&(r=t.fontFamily),t.fontWeight&&(n=t.fontWeight)}this.ctx.font=n+" "+s+" "+r;let h={width:0,height:0,parts:[]},a=t.toString().split("<br>");for(let t=0;t<a.length;t++){let e=a[t],i=this.ctx.measureText(e).width,r=document.createElement("span");r.className="chart",r.font=this.ctx.font,r.textContent=e,this.host.appendChild(r);let s=.6*r.offsetHeight;this.host.removeChild(r),h.width=Math.max(h.width,this._rup(i)),h.height+=s+(t>0?4:0),h.parts.push({width:i,height:s,text:e})}return h}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){let c=this.shape("text",{text:t,x:e,y:i,width:r,height:s,angle:n,clip:a,halign:o,valign:l,rotateAround:d});if(h&&this.attr(c,h),c.fontFamily="Arial",c.fontSize="10pt",c.fontWeight="",c.color=this._getContrastColor(arguments[11]),h&&h.class){let t=this._getCSSStyle(h.class);c.fontFamily=t.fontFamily||c.fontFamily,c.fontSize=t.fontSize||c.fontSize,c.fontWeight=t.fontWeight||c.fontWeight,c.color=c.color||t.color}c.color=c.color||"#000000";let p=this._measureText(t,0,h,!0);return this.attr(c,{textPartsInfo:p.textPartsInfo,textWidth:p.width,textHeight:p.height}),(r<=0||isNaN(r))&&this.attr(c,{width:p.width}),(s<=0||isNaN(s))&&this.attr(c,{height:p.height}),c}_toLinearGradient(t,e,i){if(this._renderers._gradients[t])return t;let r=[];for(let e=0;e<i.length;e++)r.push({percent:i[e][0]/100,color:this.adjustColor(t,i[e][1])});let s="gr"+this._gradientId++;return this.createGradient(s,e?"vertical":"horizontal",r),s}_toRadialGradient(t,e){if(this._renderers._gradients[t])return t;let i=[];for(let r=0;r<e.length;r++)i.push({percent:e[r][0]/100,color:this.adjustColor(t,e[r][1])});let r="gr"+this._gradientId++;return this.createGradient(r,"radial",i),r}createGradient(t,e,i){this._renderers.createGradient(this,t,e,i)}refresh(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(let t in this._elements){let e=this._elements[t];this._renderers.setFillStyle(this,e),this._renderers.setStroke(this,e),this._renderers[this._elements[t].type](this.ctx,e)}}}),JQX.Utilities.Assign("HTML5RenderHelpers",class{constructor(t){this.HTML5Renderer=t,this._cmds="mlcazq"}ptrnd(t){if(.5===Math.abs(Math.round(t)-t))return t;let e=Math.round(t);return e<t&&(e-=1),e+.5}createGradient(t,e,i,r){t._gradients[e]={orientation:i,colorStops:r}}setStroke(t,e){let i=t.ctx,r=e["stroke-width"];i.strokeStyle=e.stroke||"transparent",i.lineWidth=0===r?.01:void 0!==r?r:1,void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,i.setLineDash&&(e["stroke-dasharray"]?i.setLineDash(e["stroke-dasharray"].split(",")):i.setLineDash([]))}setFillStyle(t,e){let i=t.ctx;if(i.fillStyle="transparent",void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,e.fill&&-1===e.fill.indexOf("#")&&t._gradients[e.fill]){let r,s="horizontal"!==t._gradients[e.fill].orientation,n="radial"===t._gradients[e.fill].orientation,h=this.ptrnd(e.x),a=this.ptrnd(e.y),o=this.ptrnd(e.x+(s?0:e.width)),l=this.ptrnd(e.y+(s?e.height:0));if(("circle"===e.type||"path"===e.type||"rect"===e.type)&&n){let t=this.ptrnd(e.x),s=this.ptrnd(e.y);const n=e.innerRadius||0,h=e.outerRadius||e.r||0;"rect"===e.type&&(t+=e.width/2,s+=e.height/2),r=i.createRadialGradient(t,s,n,t,s,h)}n||((isNaN(h)||isNaN(o)||isNaN(a)||isNaN(l))&&(h=0,a=0,o=s?0:i.canvas.width,l=s?i.canvas.height:0),r=i.createLinearGradient(h,a,o,l));let d=t._gradients[e.fill].colorStops;for(let t=0;t<d.length;t++)r.addColorStop(d[t].percent,d[t].color);i.fillStyle=r}else e.fill&&(i.fillStyle=e.fill)}rect(t,e){0!==e.width&&0!==e.height&&(t.fillRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height),t.strokeRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height))}circle(t,e){0!==e.r&&(t.beginPath(),t.arc(this.ptrnd(e.x),this.ptrnd(e.y),e.r,0,2*Math.PI,!1),t.closePath(),t.fill(),t.stroke())}_parsePoint(t){return{x:this._parseNumber(t),y:this._parseNumber(t)}}_parseNumber(t){let e,i=!1;for(e=this._pos;e<t.length;e++)if(t[e]>="0"&&t[e]<="9"||"."===t[e]||"e"===t[e]||"-"===t[e]&&!i||"-"===t[e]&&e>=1&&"e"===t[e-1])i=!0;else{if(i||" "!==t[e]&&","!==t[e])break;this._pos++}let r=parseFloat(t.substring(this._pos,e));if(!isNaN(r))return this._pos=e,r}_isRelativeCmd(t){return-1!==this._cmds.indexOf(t)}_parseCmd(t){for(let e=this._pos;e<t.length;e++){if(-1!==this._cmds.toLowerCase().indexOf(t[e].toLowerCase()))return this._pos=e+1,this._lastCmd=t[e],this._lastCmd;if(" "!==t[e]){if(t[e]>="0"&&t[e]<="9"){if(this._pos=e,""===this._lastCmd)break;return this._lastCmd}}else this._pos++}}_toAbsolutePoint(t){return{x:this._currentPoint.x+t.x,y:this._currentPoint.y+t.y}}path(t,e){let i,r=e.d;for(this._pos=0,this._lastCmd="",this._currentPoint={x:0,y:0},t.beginPath();this._pos<r.length;){let e=this._parseCmd(r);if(void 0===e)break;if("M"!==e&&"m"!==e)if("L"!==e&&"l"!==e)if("A"!==e&&"a"!==e)if("Z"!==e&&"z"!==e||void 0===i)if("C"!==e&&"c"!==e)if("Q"!==e&&"q"!==e);else{let e=this._parsePoint(r),i=this._parsePoint(r);t.quadraticCurveTo(e.x,e.y,i.x,i.y),this._currentPoint=i}else{let e=this._parsePoint(r),i=this._parsePoint(r),s=this._parsePoint(r);t.bezierCurveTo(e.x,e.y,i.x,i.y,s.x,s.y),this._currentPoint=s}else t.lineTo(i.x,i.y),this._currentPoint=i;else{let i=this._parseNumber(r),s=this._parseNumber(r),n=this._parseNumber(r)*(Math.PI/180),h=this._parseNumber(r),a=this._parseNumber(r),o=this._parsePoint(r);if(this._isRelativeCmd(e)&&(o=this._toAbsolutePoint(o)),0===i||0===s)continue;let l=this._currentPoint,d={x:Math.cos(n)*(l.x-o.x)/2+Math.sin(n)*(l.y-o.y)/2,y:-Math.sin(n)*(l.x-o.x)/2+Math.cos(n)*(l.y-o.y)/2},c=Math.pow(d.x,2)/Math.pow(i,2)+Math.pow(d.y,2)/Math.pow(s,2);c>1&&(i*=Math.sqrt(c),s*=Math.sqrt(c));let p=(h===a?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(s,2)-Math.pow(i,2)*Math.pow(d.y,2)-Math.pow(s,2)*Math.pow(d.x,2))/(Math.pow(i,2)*Math.pow(d.y,2)+Math.pow(s,2)*Math.pow(d.x,2)));isNaN(p)&&(p=0);let u={x:p*i*d.y/s,y:p*-s*d.x/i},g={x:(l.x+o.x)/2+Math.cos(n)*u.x-Math.sin(n)*u.y,y:(l.y+o.y)/2+Math.sin(n)*u.x+Math.cos(n)*u.y},f=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},m=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e))},_=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(m(t,e))},x=_([1,0],[(d.x-u.x)/i,(d.y-u.y)/s]),M=[(d.x-u.x)/i,(d.y-u.y)/s],y=[(-d.x-u.x)/i,(-d.y-u.y)/s],w=_(M,y);m(M,y)<=-1&&(w=Math.PI),m(M,y)>=1&&(w=0),0===a&&w>0&&(w-=2*Math.PI),1===a&&w<0&&(w+=2*Math.PI);let N=i>s?i:s,v=i>s?1:i/s,b=i>s?s/i:1;t.translate(g.x,g.y),t.rotate(n),t.scale(v,b),t.arc(0,0,N,x,x+w,1-a),t.scale(1/v,1/b),t.rotate(-n),t.translate(-g.x,-g.y)}else{let e=this._parsePoint(r);if(void 0===e)break;t.lineTo(e.x,e.y),this._currentPoint=e}else{let e=this._parsePoint(r);if(void 0===e)break;t.moveTo(e.x,e.y),this._currentPoint=e,void 0===i&&(i=e)}}t.fill(),t.stroke(),t.closePath()}text(t,e){let i=this.ptrnd(e.x),r=this.ptrnd(e.y),s=this.ptrnd(e.width),n=this.ptrnd(e.height),h=e.halign,a=e.valign,o=e.angle,l=e.rotateAround,d=e.textPartsInfo,c=d.parts,p=e.clip;void 0===p&&(p=!0),t.save(),h||(h="center"),a||(a="center"),p&&(t.rect(i,r,s,n),t.clip());let u=e.textWidth,g=e.textHeight,f=s||0,m=n||0;if(t.fillStyle=e.color,t.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,!o||0===o){r+=g,"center"===a||"middle"===a?r+=(m-g)/2:"bottom"===a&&(r+=m-g),s||(s=u),n||(n=g);let e=0;for(let s=c.length-1;s>=0;s--){let n=c[s],a=i,o=c[s].width;"center"===h?a+=(f-o)/2:"right"===h&&(a+=f-o),t.fillText(n.text,a,r+e),e-=n.height+(s>0?4:0)}return void t.restore()}let _=this.HTML5Renderer.alignTextInRect(i,r,s,n,u,g,h,a,o,l);i=_.x,r=_.y;let x=o*Math.PI*2/360;t.translate(i,r),t.rotate(x);let M=0,y=d.width;for(let e=c.length-1;e>=0;e--){let i=0;"center"===h?i+=(y-c[e].width)/2:"right"===h&&(i+=y-c[e].width),t.fillText(c[e].text,i,M),M-=c[e].height+4}t.restore()}}),JQX.Utilities.Assign("Plot",class{constructor(t){this.renderer=t}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;let i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);let h=Math.log(s)/Math.log(i);s=Math.pow(i,h);let a=Math.log(r)/Math.log(i);r=Math.pow(i,a);let o=Math.log(t)/Math.log(i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);let e=Math.log(i.max)/Math.log(t),r=Math.log(i.min)/Math.log(t);i.flip&&(n=1-n);let h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;let n,h=[1,2,5],a=0;for(;;){let t=a%h.length,e=Math.floor(a/h.length),i=Math.pow(10,e)*h[t];if(t=(a+1)%h.length,e=Math.floor((a+1)/h.length),n=Math.pow(10,e)*h[t],s>=i&&s<n)break;a++}let o=n,l=[],d=this.renderer._rnd(t,o,!1),c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}});
49
49
 
50
50
  /***/ }),
51
51
 
@@ -59,7 +59,7 @@ JQX("jqx-drop-down-list",class extends JQX.ContentElement{static get properties(
59
59
  /***/ 6321:
60
60
  /***/ (() => {
61
61
 
62
- !function(){const e="16.0.0",t=[];let n="JQX";if(window[n]&&window[n].Version){if(window[n].Version===e)return;if(window[n].Version!==e)n+=e;else{let e=2;for(;window[n];)n+=e.toString(),e++}}const r=navigator.userAgent.indexOf("Edge")>-1&&navigator.appVersion.indexOf("Edge")>-1;document.elementsFromPoint||(document.elementsFromPoint=document.msElementsFromPoint);class o{static isBoolean(e){return"boolean"==typeof e}static isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)}static isArray(e){return Array.isArray(e)}static isObject(e){return e&&("object"==typeof e||this.isFunction(e))||!1}static isDate(e){return e instanceof Date}static isString(e){return"string"==typeof e}static isNumber(e){return"number"==typeof e}static getType(e){const t=this,n=["Boolean","Number","String","Function","Array","Date","Object"].find((n=>{if(t["is"+n](e))return n}));return n?n.toLowerCase():void 0}}class i{static animate(e,t,r,o){const i=e;if(!i||i instanceof HTMLElement==0)return;if(0===i.getElementsByClassName("jqx-ripple").length){const e=document.createElement("span");e.classList.add("jqx-ripple"),e.setAttribute("role","presentation");let t=!0,r=null;if(window[n].EnableShadowDOM&&i.enableShadowDOM&&!0!==i.isInShadowDOM){for(let e=0;e<i.shadowRoot.host.shadowRoot.children.length;e++)"link"!==i.shadowRoot.host.shadowRoot.children[e].tagName.toLowerCase()&&(r=i.shadowRoot.host.shadowRoot.children[e]);i.shadowRoot.host.shadowRoot.querySelector(".jqx-ripple")&&(t=!1)}else r=i.firstElementChild;t&&(r&&!r.noRipple&&r.offsetHeight>0?r.appendChild(e):i.appendChild(e))}let s=null;if(s=window[n].EnableShadowDOM&&i.shadowRoot?i.shadowRoot.host.shadowRoot.querySelector(".jqx-ripple"):i.getElementsByClassName("jqx-ripple")[0],!s)return;s.innerHTML="",s.classList.remove("jqx-animate"),s.style.height=s.style.width=Math.max(i.offsetHeight,i.offsetWidth)+"px";const a=window.getComputedStyle(s.parentElement),l=parseInt(a.borderLeftWidth)||0,d=parseInt(a.borderTopWidth)||0,c=i.getBoundingClientRect(),u=t-(c.left+window.pageXOffset)-s.offsetWidth/2-l,p=r-(c.top+window.pageYOffset)-s.offsetHeight/2-d;s.style.left=u+"px",s.style.top=p+"px",s.classList.add("jqx-animate"),s.addEventListener("animationend",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationend",e),s.removeEventListener("animationcancel",e)})),s.addEventListener("animationcancel",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationcancel",e),s.removeEventListener("animationend",e)}))}}class s{static easeInQuad(e,t,n,r){return n*(e/=r)*e+t}static easeOutQuad(e,t,n,r){return-n*(e/=r)*(e-2)+t}static easeInOutQuad(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}static easeInCubic(e,t,n,r){return n*(e/=r)*e*e+t}static easeOutCubic(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}static easeInOutCubic(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t}static easeInQuart(e,t,n,r){return n*(e/=r)*e*e*e+t}static easeOutQuart(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t}static easeInOutQuart(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}static easeInQuint(e,t,n,r){return n*(e/=r)*e*e*e*e+t}static easeOutQuint(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t}static easeInOutQuint(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t}static easeInSine(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}static easeOutSine(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t}static easeInOutSine(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t}static easeInExpo(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t}static easeOutExpo(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t}static easeInOutExpo(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t}static easeInCirc(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t}static easeOutCirc(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t}static easeInOutCirc(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t}static easeInElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),-s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)+t)}static easeOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),s*Math.pow(2,-10*e)*Math.sin((e*r-o)*(2*Math.PI)/i)+n+t)}static easeInOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:2==(e/=r/2)?t+n:(i||(i=r*(.3*1.5)),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*.5+n+t)}static easeInBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*(e/=r)*e*((o+1)*e-o)+t}static easeOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*((e=e/r-1)*e*((o+1)*e+o)+1)+t}static easeInOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t}static easeInBounce(e,t,n,r){return n-this.easeOutBounce(r-e,0,n,r)+t}static easeOutBounce(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}static easeInOutBounce(e,t,n,r){return e<r/2?.5*this.easeInBounce(2*e,0,n,r)+t:.5*this.easeOutBounce(2*e-r,0,n,r)+.5*n+t}}class a{static get isMobile(){const e=/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());return e||["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}static get Browser(){let e;const t=function(t){let n=t.indexOf(e);if(-1===n)return;const r=t.indexOf("rv:");return"Trident"===e&&-1!==r?parseFloat(t.substring(r+3)):parseFloat(t.substring(n+e.length+1))};let n={};return n[function(){const t=[{string:navigator.userAgent,subString:"Edge",identity:"Edge"},{string:navigator.userAgent,subString:"MSIE",identity:"IE"},{string:navigator.userAgent,subString:"Trident",identity:"IE"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Opera",identity:"Opera"},{string:navigator.userAgent,subString:"OPR",identity:"Opera"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"Safari",identity:"Safari"}];for(let n=0;n<t.length;n++){let r=t[n].string;if(e=t[n].subString,-1!==r.indexOf(t[n].subString))return t[n].identity}return"Other"}()]=!0,n.version=t(navigator.userAgent)||t(navigator.appVersion)||"Unknown",n}static toCamelCase(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}static toDash(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}static unescapeHTML(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}static escapeHTML(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(e).replace(/[&<>"'`=\/]/g,(e=>t[e]))}static sanitizeHTML(e){if(e&&(e.indexOf("onclick")>=0||e.indexOf("onload")>=0||e.indexOf("onerror")>=0))return this.escapeHTML(e);const t=new RegExp("<s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<s*/s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>","ig");return String(e).replace(t,(e=>this.escapeHTML(e)))}static createGUID(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}static getScriptLocation(){return"./"!==window[n].BaseUrl?window[n].BaseUrl:function(){if(document.currentScript){let e=document.currentScript.src,t=e.lastIndexOf("/");return e=e.substring(0,t),e}const e=new Error;let t="(",n=")";if(JQX.Utilities.Core.Browser.Safari&&(t="@",n="\n"),e.fileName)return e.fileName.replace("/jqx.element.js","");let r=e.stack.split(t);return r=r[1],r=r.split(n)[0],r=r.split(":"),r.splice(-2,2),r=r.join(":"),r.replace("/jqx.element.js","")}()}static CSSVariablesSupport(){return window.CSS&&window.CSS.supports&&window.CSS.supports("(--fake-var: 0)")}static assign(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&null!==e;let r=Object.assign({},e);return n(e)&&n(t)&&Object.keys(t).forEach((o=>{n(t[o])?o in e?r[o]=this.assign(e[o],t[o]):Object.assign(r,{[o]:t[o]}):Object.assign(r,{[o]:t[o]})})),r}static html(e,t){const n=this;let r="",o=e.childNodes;if(!t){for(let e,t=0,i=o.length;t<i&&(e=o[t]);t++){const t=["strong"];if(e instanceof HTMLElement||e.tagName&&t.indexOf(e.tagName.toLowerCase())>=0){const t=e.tagName.toLowerCase(),o=e.attributes;let i="<"+t;for(let e,t=0;e=o[t];t++)i+=" "+e.name+'="'+e.value.replace(/[&\u00A0"]/g,y.Core.escapeHTML)+'"';i+=">",["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"][t]&&(r+=i),r=r+i+n.html(e)+"</"+t+">"}else{if(8===e.nodeType)continue;r+=e.textContent.replace(/[&\u00A0<>]/g,y.Core.escapeHTML)}}return r}{const n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;e.innerHTML=t.replace(n,"<$1></$2>")}}}let l=[];class d{static watch(e){switch(e.nodeName.toLowerCase()){case"jqx-grid":case"jqx-kanban":case"jqx-table":case"jqx-pivot-table":case"jqx-scheduler":case"jqx-tabs":case"jqx-card-view":case"jqx-list-box":case"jqx-combo-box":case"jqx-drop-down-list":case"jqx-calendar":case"jqx-gauge":case"jqx-numeric-text-box":case"jqx-menu":case"jqx-tree":l.push(e);break;default:return}d.start()}static start(){d.isStarted||(d.isStarted=!0,d.interval&&clearInterval(d.interval),0===l.length||document.hidden?d.isStarted=!1:d.interval=setInterval((function(){d.observe()}),100))}static stop(){d.isStarted=!1,d.interval&&clearInterval(d.interval)}static observeElement(e){const t=e;if("test"===window.JQX.Mode||document.hidden)return void(d.interval&&clearInterval(d.interval));let n=e._computedStyle||"resize"!==t.hasStyleObserver?document.defaultView.getComputedStyle(t,null):{},r=!0,o="resize"!==t.hasStyleObserver?["paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","display","visibility","font-size","font-family","font-style","font-weight","max-height","min-height","max-width","min-width","overflow","overflow-x","overflow-y"]:[];if(e.styleProperties&&(o=o.concat(e.styleProperties)),e.observableStyleProperties&&(o=e.observableStyleProperties),!t._styleInfo){t._styleInfo=[];for(let e=0;e<o.length;e++){const r=o[e],i=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]=i}return}if(e.isHidden||"none"!==n.display&&(0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0)),e.isHidden){if(e.visibilityChangedHandler(),e.isHidden)return;r=!1}let i=[];for(let e=0;e<o.length;e++){const r=o[e],s=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]!==s&&(i[r]={oldValue:t._styleInfo[r],value:s},i.length++),t._styleInfo[r]=s}i.length>0&&(t.$.fireEvent("styleChanged",{styleProperties:i},{bubbles:!1,cancelable:!0}),i.display&&r&&t.$.fireEvent("resize",t,{bubbles:!1,cancelable:!0}))}static observe(){for(let e=0;e<l.length;e++){const t=l[e];this.observeElement(t)}}static unwatch(e){d.stop();const t=l.indexOf(e);-1!==t&&l.splice(t,1),d.start()}}let c=[];const u=[],p=["resize","down","up","move","tap","taphold","swipeleft","swiperight","swipetop","swipebottom"];class h{constructor(e){const t=this;t.target=e,t.$target=new f(e),t.$document=e.$document?e.$document:new f(document),t.id=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase();let n={handlers:{},boundEventTypes:[],listen:t.listen.bind(t),unlisten:t.unlisten.bind(t)};return t.tapHoldDelay=750,t.swipeMin=10,t.swipeMax=5e3,t.swipeDelay=1e3,t.tapHoldDelay=750,t.inputEventProperties=["clientX","clientY","pageX","pageY","screenX","screenY"],p.forEach((e=>{n[e]=t=>{n.handlers[e]=t},t[e]=e=>{if(!n.handlers[e.type]){if(("mousemove"===e.type||"pointermove"===e.type||"touchmove"===e.type)&&n.handlers.move){const r=t.createEvent(e,"move");n.handlers.move(r)}return!0}return n.handlers[e.type](e)}})),t.listen(),t.handlers=n.handlers,n}listen(e){const t=this;if("resize"===e&&t.target!==document&&t.target!==window&&!1!==t.target.hasResizeObserver)if(JQX.Utilities.Core.Browser.Firefox){if(!t.target.resizeObserver){let e,n,r,o=!1,i=t.target.offsetWidth,s=t.target.offsetHeight;const a=new ResizeObserver((()=>{if(!o)return void(o=!0);const a=new CustomEvent("resize",{bubbles:!1,cancelable:!0});n=t.target.offsetWidth,r=t.target.offsetHeight,e=n!==i||r!==s,t.target.requiresLayout&&(e=!0),e&&(t.resize(a),t.target.requiresLayout=!1)}));a.observe(t.target),t.target.resizeObserver=a}}else if(!t.target.resizeTrigger){const e=document.createElement("div");e.className="jqx-resize-trigger-container",e.innerHTML='<div class="jqx-resize-trigger-container"><div class="jqx-resize-trigger"></div></div><div class="jqx-resize-trigger-container"><div class="jqx-resize-trigger-shrink"></div></div>',e.setAttribute("aria-hidden",!0),window[n].EnableShadowDOM&&t.target.shadowRoot?t.target.shadowRoot.appendChild(e):t.target.appendChild(e),t.target.resizeTrigger=e;const r=e.childNodes[0],o=r.childNodes[0],i=e.childNodes[1],s=function(){o.style.width="100000px",o.style.height="100000px",r.scrollLeft=1e5,r.scrollTop=1e5,i.scrollLeft=1e5,i.scrollTop=1e5};let a,l,d,c,u=t.target.offsetWidth,p=t.target.offsetHeight;if(0===u||0===p){const e=function(){s(),t.target.removeEventListener("resize",e)};t.target.addEventListener("resize",e),s()}else s();t.target.resizeHandler=function(){l||(l=requestAnimationFrame((function(){if(l=0,d=t.target.offsetWidth,c=t.target.offsetHeight,a=d!==u||c!==p,t.target.requiresLayout&&(a=!0),!a)return;u=d,p=c;const e=new CustomEvent("resize",{bubbles:!1,cancelable:!0});t.resize(e),t.target.requiresLayout=!1}))),s()},r.addEventListener("scroll",t.target.resizeHandler),i.addEventListener("scroll",t.target.resizeHandler)}t.isListening||(t.isListening=!0,t.isPressed=!1,t.isReleased=!1,t.isInBounds=!1,window.PointerEvent?(t.$target.listen("pointerdown.inputEvents"+t.id,t.pointerDown.bind(t)),t.$target.listen("pointerup.inputEvents"+t.id,t.pointerUp.bind(t)),t.$target.listen("pointermove.inputEvents"+t.id,t.pointerMove.bind(t)),t.$target.listen("pointercancel.inputEvents"+t.id,t.pointerCancel.bind(t))):("ontouchstart"in window&&(t.$target.listen("touchmove.inputEvents"+t.id,t.touchMove.bind(t)),t.$target.listen("touchstart.inputEvents"+t.id,t.touchStart.bind(t)),t.$target.listen("touchend.inputEvents"+t.id,t.touchEnd.bind(t)),t.$target.listen("touchcancel.inputEvents"+t.id,t.touchCancel.bind(t))),t.$target.listen("mousedown.inputEvents"+t.id,t.mouseDown.bind(t)),t.$target.listen("mouseup.inputEvents"+t.id,t.mouseUp.bind(t)),t.$target.listen("mousemove.inputEvents"+t.id,t.mouseMove.bind(t)),t.$target.listen("mouseleave.inputEvents"+t.id,t.mouseLeave.bind(t))),t.target._handleDocumentUp||(t.target._handleDocumentUp=t.handleDocumentUp.bind(t),t.target._handleDocumentUpId=t.id,t.$document.listen("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp)))}unlisten(e){const t=this;if(t.isListening=!1,window.PointerEvent?(t.$target.unlisten("pointerdown.inputEvents"+t.id),t.$target.unlisten("pointerup.inputEvents"+t.id),t.$target.unlisten("pointermove.inputEvents"+t.id),t.$target.unlisten("pointercancel.inputEvents"+t.id)):("ontouchstart"in window&&(t.$target.unlisten("touchstart.inputEvents"+t.id),t.$target.unlisten("touchmove.inputEvents"+t.id),t.$target.unlisten("touchend.inputEvents"+t.id),t.$target.unlisten("touchcancel.inputEvents"+t.id)),t.$target.unlisten("mousedown.inputEvents"+t.id),t.$target.unlisten("mouseup.inputEvents"+t.id),t.$target.unlisten("mousemove.inputEvents"+t.id),t.$target.unlisten("mouseleave.inputEvents"+t.id)),t.target._handleDocumentUp&&(t.$document.unlisten("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp),delete t.target._handleDocumentUp,delete t.target._handleDocumentUpId),"resize"===e)if(JQX.Utilities.Core.Browser.Firefox)t.target.resizeObserver&&(t.target.resizeObserver.unobserve(t.target),delete t.target.resizeObserver);else if(t.target.resizeTrigger){const e=t.target.resizeTrigger,n=e.childNodes[0],r=e.childNodes[1];n.removeEventListener("scroll",t.target.resizeHandler),r.removeEventListener("scroll",t.target.resizeHandler),t.target.resizeHandler=null,e.parentNode.removeChild(e),delete t.target.resizeTrigger}}handleDocumentUp(e){const t=this;t.isPressed=!1,t.isReleased=!1,t.resetSwipe(e)}createEvent(e,t){const n=this,r=e.touches,o=e.changedTouches,i=r&&r.length?r[0]:o&&o.length?o[0]:void 0,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:void 0!==n.$target.element.getRootNode().host});if(s.originalEvent=e,i){for(let e=0;e<n.inputEventProperties.length;e++){const t=n.inputEventProperties[e];s[t]=i[t]}return s}for(let t in e)t in s||(s[t]=e[t]);return s}fireTap(e){const t=this;if(clearTimeout(this.tapHoldTimeout),!this.tapHoldFired&&this.isInBounds){const n=t.createEvent(e,"tap");t.tap(n)}}initTap(e){const t=this;t.isInBounds=!0,t.tapHoldFired=!1,t.tapHoldTimeout=setTimeout((function(){if(t.isInBounds){t.tapHoldFired=!0;const n=t.createEvent(e,"taphold");t.taphold(n)}}),t.tapHoldDelay)}pointerDown(e){return this.handleDown(e)}mouseDown(e){const t=this;if(!(t.isPressed||t.touchStartTime&&new Date-t.touchStartTime<500))return t.handleDown(e)}touchStart(e){const t=this;return t.touchStartTime=new Date,t.isTouchMoved=!0,t.handleDown(e)}mouseUp(e){const t=this;if(!(t.isReleased||t.touchEndTime&&new Date-t.touchEndTime<500))return t.handleUp(e)}handleDown(e){const t=this;t.isReleased=!1,t.isPressed=!0;const n=t.createEvent(e,"down");return(t.handlers.tap||t.handlers.taphold)&&t.initTap(n),(t.handlers.swipeleft||t.handlers.swiperight||t.handlers.swipetop||t.handlers.swipebottom)&&t.initSwipe(n),t.down(n)}handleUp(e){const t=this;t.isReleased=!0,t.isPressed=!1;const n=t.createEvent(e,"up"),r=t.up(n);return(t.handlers.tap||t.handlers.taphold)&&t.fireTap(n),t.resetSwipe(n),r}handleMove(e){const t=this;let n=t.move(e);return t.isPressed&&(t._maxSwipeVerticalDistance=Math.max(t._maxSwipeVerticalDistance,Math.abs(t._startY-e.pageY)),t._maxSwipeHorizontalDistance=Math.max(t._maxSwipeHorizontalDistance,Math.abs(t._startX-e.pageX)),n=t.handleSwipeEvents(e)),n}touchEnd(e){return this.touchEndTime=new Date,this.handleUp(e)}pointerUp(e){return this.handleUp(e)}pointerCancel(e){this.pointerUp(e)}touchCancel(e){this.touchEnd(e)}mouseLeave(){this.isInBounds=!1}mouseMove(e){if(!this.isTouchMoved)return this.handleMove(e)}pointerMove(e){return this.handleMove(e)}touchMove(e){const t=this,n=e.touches,r=e.changedTouches,o=n&&n.length?n[0]:r&&r.length?r[0]:void 0;for(let n=0;n<t.inputEventProperties.length;n++){const r=t.inputEventProperties[n];void 0===e[r]&&(e[r]=o[r])}return t.isTouchMoved=!0,t.handleMove(e)}handleSwipeEvents(e){const t=this;let n=!0;return(t.handlers.swipetop||t.handlers.swipebottom)&&(n=this.handleVerticalSwipeEvents(e)),!1===n||(t.handlers.swipeleft||t.handlers.swiperight)&&(n=this.handleHorizontalSwipeEvents(e)),n}handleVerticalSwipeEvents(e){let t,n;return t=e.pageY,n=t-this._startY,this.swiped(e,n,"vertical")}handleHorizontalSwipeEvents(e){let t,n;return t=e.pageX,n=t-this._startX,this.swiped(e,n,"horizontal")}swiped(e,t,n){const r=this;if(n=n||0,Math.abs(t)>=r.swipeMin&&!r._swipeEvent&&!r._swipeLocked){let o=t<0?"swipeleft":"swiperight";if("horizontal"===n?r._swipeEvent=r.createEvent(e,o):(o=t<0?"swipetop":"swipebottom",r._swipeEvent=r.createEvent(e,t<0?"swipetop":"swipebottom")),r[o]&&(r[o](this._swipeEvent),Math.abs(t)<=this.swipeMax))return e.stopImmediatePropagation(),!1}return!0}resetSwipe(){this._swipeEvent=null,clearTimeout(this._swipeTimeout)}initSwipe(e){const t=this;t._maxSwipeVerticalDistance=0,t._maxSwipeHorizontalDistance=0,t._startX=e.pageX,t._startY=e.pageY,t._swipeLocked=!1,t._swipeEvent=null,t._swipeTimeout=setTimeout((function(){t._swipeLocked=!0}),t.swipeDelay)}}class m{get scrollWidth(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.max=e)}get scrollHeight(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.max:-1}set scrollHeight(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.max=e)}get scrollLeft(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.value:-1}set scrollLeft(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.value=e)}get scrollTop(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.value:-1}set scrollTop(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.value=e)}get vScrollBar(){return this.verticalScrollBar}get hScrollBar(){return this.horizontalScrollBar}constructor(e,t,n){const r=this;r.container=e,r.horizontalScrollBar=t,r.verticalScrollBar=n,r.disableSwipeScroll=!1,r.listen()}listen(){const e=this,t=a.isMobile,n=e.horizontalScrollBar,r=e.verticalScrollBar;let o,i,s,l,d,c,u,p;e.inputEvents=new h(e.container);const m=function(e){return{amplitude:0,delta:0,initialValue:0,min:0,max:e.max,previousValue:0,pointerPosition:0,targetValue:0,scrollBar:e,value:0,velocity:0}},f=m(n),g=m(r),w=function(){const t=e.container.touchVelocityCoefficient||50;c=Date.now(),u=c-l,l=c;const n=function(e){e.delta=e.value-e.previousValue,e.previousValue=e.value;let n=t*e.delta/(1+u);e.velocity=.8*n+.2*e.velocity};n(g),n(f)},b=function(e){return p.value=e>p.max?p.max:e<p.min?p.min:e,p.scrollBar.value=p.value,e>p.max?"max":e<p.min?"min":"value"};function v(){let t,n;p.amplitude&&(e.container.$.fireEvent("kineticScroll"),t=Date.now()-l,n=-p.amplitude*Math.exp(-t/500),n>5||n<-5?(b(p.targetValue+n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(v)):b(p.targetValue))}let _;e.inputEvents.down((function(n){if(!t)return;const r=n.originalEvent.target,i=r&&r.closest?r.closest("jqx-scroll-bar"):void 0;if(i===e.horizontalScrollBar||i===e.verticalScrollBar)return;s=!0,o=!1;const a=function(e,t){e.amplitude=0,e.pointerPosition=t,e.previousValue=e.value,e.value=e.scrollBar.value,e.initialValue=e.value,e.max=e.scrollBar.max};a(g,n.clientY),a(f,n.clientX),l=Date.now(),clearInterval(d),d=setInterval(w,500)})),e.inputEvents.up((function(){if(!s)return!0;if(clearInterval(d),e.disableSwipeScroll)return void(s=!1);const t=function(e){p=e,e.amplitude=.8*e.velocity,e.targetValue=Math.round(e.value+e.amplitude),l=Date.now(),cancelAnimationFrame(i),i=requestAnimationFrame(v),e.velocity=0};g.velocity>10||g.velocity<-10?t(g):(f.velocity>10||f.velocity<-10)&&t(f),s=!1})),e.inputEvents.move((function(t){if(!s)return!0;if(e.disableSwipeScroll)return;if(o&&(t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()),f.visible=e.scrollWidth>0,g.visible=e.scrollHeight>0,!s||!f.visible&&!g.visible)return;const n=e.container.touchScrollRatio,r=e.container;let i,a;n&&("number"==typeof n?(i=-n,a=-n):"function"==typeof n&&(i=n(g.max,r.offsetHeight),a=n(f.max,r.offsetWidth))),g.ratio=i||-g.max/r.offsetHeight,g.delta=(t.clientY-g.pointerPosition)*g.ratio,f.ratio=a||-f.max/r.offsetWidth,f.delta=(t.clientX-f.pointerPosition)*f.ratio;let l="value";const d=function(t,n,r){return t.delta>5||t.delta<-5?(p=t,l=t.initialValue+t.delta>p.max?"max":t.initialValue+t.delta<p.min?"min":"value","min"===l&&0===t.initialValue||"max"===l&&t.initialValue===t.max||!t.visible||(e.container.$.fireEvent("kineticScroll"),b(t.initialValue+t.delta),w(),r.originalEvent.preventDefault(),r.originalEvent.stopPropagation(),o=!0,!1)):null};let c=d(g,t.clientY,t);if(null!==c)return c;{let e=d(f,t.clientX,t);if(null!==e)return e}})),e.scrollTo=function(t,n){const r=!1===n?f:g;let o=!1;l||(l=Date.now()),_||(_=Date.now()),Math.abs(Date.now()-_)>375?l=Date.now():o=!0,_=Date.now(),r.value=r.scrollBar.value,r.delta=t-r.value,r.max=r.scrollBar.max,t<=r.min&&(t=r.min),t>=r.max&&(t=r.max),r.targetValue=t;const s=t;let a=r.value;r.velocity=100*r.delta/(1+r.max),r.from=a;const d=function(e){return r.value=e>r.max?r.max:e<r.min?r.min:e,r.scrollBar.value=r.value,e>r.max?"max":e<r.min?"min":"value"},c=function(){let n,u=Date.now()-_,p=Math.min(1e3,Date.now()-l),h=r.velocity*Math.exp(p/175);if(o)(h<0&&r.value<=t||h>0&&r.value>=t)&&(h=0),(r.value+h<=r.min||r.value+h>=r.max)&&(h=0),h>.5||h<-.5?(d(r.value+h),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)):d(r.targetValue);else{if(u>=175)return cancelAnimationFrame(i),e.container.$.fireEvent("kineticScroll"),void(i=0);n=y.Animation.Easings.easeInSine(u,a,s-a,175),d(n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)}};cancelAnimationFrame(i),i=requestAnimationFrame(c)},e.inputEvents.listen()}unlisten(){const e=this;e.inputEvents&&e.inputEvents.unlisten(),delete e.inputEvents}}class f{constructor(e){this.events={},this.handlers={},this.element=e}hasClass(e){const t=this,n=e.split(" ");for(let e=0;e<n.length;e++)if(!t.element.classList.contains(n[e]))return!1;return!0}addClass(e){const t=this;if(t.hasClass(e))return;const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.add(n[e]);t.isNativeElement||d.observeElement(t.element)}removeClass(e){const t=this;if(0===arguments.length)return void t.element.removeAttribute("class");const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.remove(n[e]);""===t.element.className&&t.element.removeAttribute("class"),t.isNativeElement||d.observeElement(t.element)}get isCustomElement(){const e=this;return!!e.element.tagName.startsWith(n)||e.element instanceof window[n].BaseElement==1||"DIV"!==e.element.tagName&&"SPAN"!==e.element.tagName&&"BUTTON"!==e.element.tagName&&"INPUT"!==e.element.tagName&&"UL"!==e.element.tagName&&"LI"!==e.element.tagName&&document.createElement(e.element.nodeName)instanceof window[n].BaseElement==1}get isNativeElement(){return!this.isCustomElement}dispatch(e){const t=this,n=t.events[e.type];let r=!1;if(n.length>1)for(let e=0;e<n.length;e++){const t=n[e];if(t.namespace&&t.namespace.indexOf("_")>=0){r=!0;break}}r&&n.sort((function(e,t){let n=e.namespace,r=t.namespace;return n=-1===n.indexOf("_")?0:parseInt(n.substring(n.indexOf("_")+1)),r=-1===r.indexOf("_")?0:parseInt(r.substring(r.indexOf("_")+1)),n<r?-1:n>r?1:0}));for(let r=0;r<n.length;r++){const o=n[r];if(e.namespace=o.namespace,e.context=o.context,e.defaultPrevented)break;const i=o.handler.apply(t.element,[e]);if(void 0!==i&&(e.result=i,!1===i)){e.preventDefault(),e.stopPropagation();break}}return e.result}fireEvent(e,t,r){const o=this;r||(r={bubbles:!0,cancelable:!0,composed:null!==o.element.getRootNode().host}),r.detail=t||{};const i=new CustomEvent(e,r);if(i.originalStopPropagation=i.stopPropagation,i.stopPropagation=function(){return i.isPropagationStopped=!0,i.originalStopPropagation()},o.dispatchEvent(i),window[n].isVue){const t=y.Core.toDash(e);if(t!==e){const e=new CustomEvent(t,r);e.originalStopPropagation=i.stopPropagation,e.stopPropagation=function(){return e.isPropagationStopped=!0,e.originalStopPropagation()},o.dispatchEvent(e)}}return i}get isPassiveSupported(){const e=this;if(void 0!==e.supportsPassive)return e.supportsPassive;e.supportsPassive=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e.supportsPassive=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e.supportsPassive}dispatchEvent(e){const t=this,n=e.type,r=t.element.context,o=n.substring(0,1).toUpperCase()+n.substring(1);t.element.context=document,t.element["on"+o]?t.element["on"+o](e):t.element["on"+n.toLowerCase()]?t.element["on"+n.toLowerCase()](e):t.element.dispatchEvent(e),t.element.context=r}listen(e,t){const n=this,r=e.split("."),o=r.slice(1).join("."),i=r[0];n.events[i]||(n.events[i]=[]);const s={type:i,handler:t,context:n.element,namespace:o};p.indexOf(i)>=0&&(n.inputEvents||(n.inputEvents=new h(n.element)),n.inputEvents[i]((function(e){n.dispatchEvent(e)})),n.inputEvents.boundEventTypes.push(i),n.inputEvents.listen(i)),0===n.events[i].length&&(n.handlers[i]=n.dispatch.bind(n),"wheel"===i?n.element.addEventListener("wheel",n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):"touchmove"===i||"touchstart"===i||"touchend"===i?n.element.addEventListener(i,n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):n.element.addEventListener(i,n.handlers[i],!1)),n.events[i].push(s)}unlisten(e){const t=this,n=e.split("."),r=n.slice(1).join("."),o=n[0];let i=t.events[o];if(t.inputEvents&&t.inputEvents.boundEventTypes.indexOf(o)>=0&&(t.inputEvents.boundEventTypes.splice(t.inputEvents.boundEventTypes.indexOf(o),1),0===t.inputEvents.boundEventTypes.length&&t.inputEvents.unlisten(o)),i){for(let e=0;e<i.length;e++){if(""!==r){let e=i.findIndex((e=>e.namespace===r));i.splice(e,1);break}i=[]}0===i.length&&(t.element.removeEventListener(o,t.handlers[o]),t.events[o]=[],delete t.handlers[o])}}getAttributeValue(e,t){const n=this,r=n.element.getAttribute(e);if(n.isNativeElement)return n.deserialize(r,t);const o=n.element.propertyByAttributeName[e];return void 0===o.deserialize?n.deserialize(r,t,o.nullable):n.element[o.deserialize](r)}setAttributeValue(e,t,n){const r=this;let o,i=!1;if(r.isNativeElement){if(o=r.serialize(t,n),"boolean"===n&&["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(e)>=0)return void(t?r.element.setAttribute(e,""):r.element.removeAttribute(e))}else{const s=r.element.propertyByAttributeName[e];i=!s||s.nullable,o=s&&s.serialize?r.element[s.serialize](t):r.serialize(t,n,i)}"array"!==n&&"object"!==n||"[]"!==o&&"{}"!==o?void 0===o?(r.element.removeAttribute(e),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.removeAttribute(e)):(r.element.setAttribute(e,o),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.setAttribute(e,o)):r.element.removeAttribute(e)}serialize(e,t,n){if(void 0===t&&(t=y.Types.getType(e)),void 0!==e&&(n||null!==e)){if(n&&null===e)return"null";if("string"===t)return e;if("boolean"===t||"bool"===t){if(!0===e||"true"===e||1===e||"1"===e)return"";if(!1===e||"false"===e||0===e||"0"===e)return}return"array"===t?JSON.stringify(e):["string","number","int","integer","float","date","any","function"].indexOf(t)>=0?e.toString():"object"===t?JSON.stringify(e):void 0}}deserialize(e,t,n){const r="null"===e;if(void 0!==e&&(!r||n)){if(r&&n)return null;if("boolean"===t||"bool"===t)return null!==e;if("number"===t||"float"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseFloat(e);if("int"===t||"integer"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseInt(e);if("string"===t)return e;if("any"===t)return e;if("date"===t)return new Date(e);if("function"===t){if("function"==typeof window[e])return window[e]}else if("array"===t||"object"===t)try{const t=JSON.parse(e);if(t)return t}catch(n){if(window[e]&&"object"==typeof window[e])return window[e];if("object"===t&&e.indexOf("{")>=0){let t=(e=e.replace(/{/gi,"").replace(/}/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim()).trim().split(","),n={};for(let e=0;e<t.length;e++){const r=t[e].split(":")[0].trim(),o=t[e].split(":")[1].trim();n[r]=o}return n}if("array"===t&&e.indexOf("[")>=0){if(e.indexOf("{")>=0){let t=e.replace(/{/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim();t=t.split("},");for(let e=0;e<t.length;e++){let n={},r=t[e].trim().split(",");for(let e=0;e<r.length;e++){const t=r[e].split(":")[0].trim(),o=r[e].split(":")[1].trim();n[t]=o}t[e]=n}return t}return e.replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim().split(",")}}}}}class g{static get Ripple(){return i}static get Easings(){return s}}class y{static get Types(){return o}static get Core(){return a}static get Animation(){return g}static get Scroll(){return m}static get InputEvents(){return h}static Extend(e){return new f(e)}static Assign(e,t){if(e.indexOf(".")>=0){const n=e.split(".");return y[n[0]]||(y[n[0]]={}),void(y[n[0]][n[1]]=t)}y[e]=t}}const w=y.Extend(document);let b=null;document.addEventListener("click",(()=>{d.start(),b&&clearTimeout(b),b=setTimeout((()=>{d.stop()}),1e4)})),document.addEventListener("mouseenter",(()=>{d.start()})),document.addEventListener("mouseleave",(()=>{d.stop()}));class v{}v.cache={};class _ extends HTMLElement{static get properties(){return{animation:{value:"advanced",type:"string",allowedValues:["none","simple","advanced"]},unfocusable:{value:!1,type:"boolean"},disabled:{value:!1,type:"boolean"},dataContext:{value:null,reflectToAttribute:!1,type:"any"},debugMode:{value:!0,type:"boolean",reflectToAttribute:!1},locale:{value:"en",type:"string",reflectToAttribute:!1},localizeFormatFunction:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{propertyUnknownName:"Invalid property name: '{{name}}'!",propertyUnknownType:"'{{name}}' property is with undefined 'type' member!",propertyInvalidValue:"Invalid '{{name}}' property value! Actual value: '{{actualValue}}', Expected value: '{{value}}'!",propertyInvalidValueType:"Invalid '{{name}}' property value type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",methodInvalidValueType:"Invalid '{{name}}' method argument value type! Actual type: '{{actualType}}', Expected type: '{{type}}' for argument with index: '{{argumentIndex}}'!",methodInvalidArgumentsCount:"Invalid '{{name}}' method arguments count! Actual arguments count: '{{actualArgumentsCount}}', Expected at least: '{{argumentsCount}}' argument(s)!",methodInvalidReturnType:"Invalid '{{name}}' method return type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",elementNotInDOM:"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",moduleUndefined:"Module is undefined.",missingReference:"{{elementType}}: Missing reference to '{{files}}'.",htmlTemplateNotSuported:"{{elementType}}: Web Browser doesn't support HTMLTemplate elements.",invalidTemplate:"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM."}},reflectToAttribute:!1,inherit:!0,type:"object"},props:{value:null,reflectToAttribute:!1,isHierarchicalProperty:!0,type:"any"},readonly:{value:!1,type:"boolean"},renderMode:{value:"auto",type:"string",reflectToAttribute:!1,allowedValues:["auto","manual"]},rightToLeft:{value:!1,type:"boolean"},rethrowError:{value:!0,type:"boolean",reflectToAttribute:!1},theme:{value:window[n].Theme,type:"string"},visibility:{value:"visible",allowedValues:["visible","collapsed","hidden"],type:"string"},wait:{value:!1,type:"boolean"}}}getBindings(e,t){const n=this;let r=0,o={},i=(e=>{if(e instanceof HTMLElement)return n.parseAttributes(e);{let t=n.parseProperty(e.data?e.data.trim():null,"textContent",e);if(t)return n&&e.parentNode===n.$.content&&(t.value=""!==n.$.html?n.$.html:void 0,n.innerHTML=""),{textContent:t}}})(e);i&&(o.data=i),t||(o.mapping=[],t=o),e.getAttribute&&(o.nodeId=e.getAttribute("jqx-id"),t&&i&&(t.mapping[o.nodeId]=i)),o.node=e,e.firstChild&&(o.children={});for(let i=e.firstChild;i;i=i.nextSibling)o.children[r++]=n.getBindings(i,t);return o}_addRemovePropertyBinding(e,t,n,r,o){if(!e||!t||!n)return;const i=this,s=i.bindings,a=n.getAttribute("jqx-id"),l=e.indexOf("{{")>=0;let d=!1;(e=e.replace("{{","").replace("}}","").replace("[[","").replace("]]","")).indexOf("!")>=0&&(e=e.replace("!",""),d=!0);const c=i._properties[e],u={name:e,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};if(o&&!r){const n={},r={name:e,targetPropertyName:t,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};n[e]=r,s.mapping[a]=n}const p=function(e){for(let o in e){const s=e[o];if(s.nodeId===a){s.data||(s.data={}),r?(s.data[t]=null,delete s.data[t]):s.data[t]=u;break}if(s.children)p(s.children);else if(s.node&&s.node.children&&s.node===n.parentElement){const e=s.node;if(!e.firstChild)continue;s.children={};let t=0;for(let n=e.firstChild;n;n=n.nextSibling)s.children[t++]=i.getBindings(n);p(s.children)}}};p(s.children),r?delete i.boundProperties[e]:i.boundProperties[e]=!0,i.updateBoundNodes(e)}addPropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!1,r)}removePropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!0,r)}parseAttributes(e){const t=this;let n;for(let r=0;r<e.attributes.length;r++){const o=e.attributes[r],i=o.name,s=o.value;v.cache["toCamelCase"+i]||(v.cache["toCamelCase"+i]=y.Core.toCamelCase(i));const a=v.cache["toCamelCase"+i];if(i.indexOf("(")>=0){let r=i.substring(1,i.length-1);if(t&&!t.dataContext){t.templateListeners[e.getAttribute("jqx-id")+"."+r]=s,e.removeAttribute(i);continue}{n||(n={});const e=s.substring(0,s.indexOf("("));n[a]={isEvent:!0,name:r,value:e};continue}}let l=t.parseProperty(s,i,e);l&&(n||(n={}),n[a]=l)}return n}parseProperty(e,t){if(!e||!e.length)return;const n=this;let r,o=e.length,i=0,s=0,a=0,l=!0;for(;s<o;){i=e.indexOf("{{",s);let t=e.indexOf("[[",s),n="}}";if(t>=0&&(i<0||t<i)&&(i=t,l=!1,n="]]"),a=i<0?-1:e.indexOf(n,i+2),a<0)return;r=r||{};let o=e.slice(i+2,a).trim();r.name=o,s=a+2}const d=r.name,c=n?n._properties[d]:null;return r.twoWay=l,r.ready=!1,n&&(d.indexOf("::")>=0?n.boundProperties[d.substring(0,d.indexOf("::"))]=!0:n.boundProperties[d]=!0),c?(r.type=c.type,r.reflectToAttribute=c.reflectToAttribute):(["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(t)>=0?r.type="boolean":r.type="string",r.reflectToAttribute=!0),r}updateTextNodes(){const e=this;e.updateTextNode(e.shadowRoot||e,e.bindings,e)}updateTextNode(e,t,n){const r=this;if(!t)return;let o=0;for(let i=e.firstChild;i&&t.children;i=i.nextSibling)r.updateTextNode(i,t.children[o++],n);if(t&&t.data)for(let e in t.data){const r=t.data[e],o=r.name;"textContent"===e&&r.twoWay&&!r.updating&&void 0!==r.value&&(n[o]=r.value)}}updateBoundProperty(e,t){if(t.updating)return;const n=this;t.updating=!0,n[e]=t.value,t.updating=!1}updateBoundNodes(e){const t=this;if(t.updateBoundNode(t.shadowRoot||t,t.bindings,t,e),t.detachedChildren.length>0)for(let n=0;n<t.detachedChildren.length;n++){const r=t.detachedChildren[n],o=r.getAttribute("jqx-id"),i=function(e){if(e.nodeId===o)return e;for(let t in e.children){const n=e.children[t];if((n.getAttribute?n.getAttribute("jqx-id"):"")===o)return e;if(n.children){const e=i(n);if(e)return e}}return null},s=i(t.bindings);if(s)t.updateBoundNode(r,s,t,e,!0);else if(r.getAttribute&&t.bindings.mapping){const n=t,r=t.bindings;if(r)for(let o in r.mapping){const i=n.querySelector('[jqx-id="'+o+'"]');if(i){const s=r.mapping[o];t.updateBoundData(i,s,n,e)}}}}}updateBoundMappedNodes(){const e=this,t=e.bindings,n=e;if(t.mapping)for(let r in t.mapping){let o=n.querySelector('[jqx-id="'+r+'"]');if(n.shadowRoot&&(o=n.querySelector('[id="'+r+'"]'),o||(o=n.shadowRoot.querySelector('[id="'+r+'"]')||n.shadowRoot.querySelector('[jqx-id="'+r+'"]'))),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}else if(n.getAttribute("aria-controls")){let i=document.getElementById(n.getAttribute("aria-controls"));if(!i&&n.shadowRoot&&(i=n.shadowRoot.getElementById(n.getAttribute("aria-controls"))),o=i.querySelector('[jqx-id="'+r+'"]'),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}}}}updateBoundNode(e,t,n,r,o){const i=this;if(!t)return;let s=0;if(o){if(o&&!t.data)for(let a=e.firstChild;a&&t.children;a=a.nextSibling)if(a.getAttribute){const e=a.getAttribute("jqx-id"),o=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(a,o,n,r),s++}else i.updateBoundNode(a,t.children[s++],n,r,o)}else for(let o=e.firstChild;o&&t.children;o=o.nextSibling)if(o.getAttribute){const e=o.getAttribute("jqx-id"),a=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(o,a,n,r),s++}else i.updateBoundNode(o,t.children[s++],n,r);if(!t||!t.data)return;const a=t.data;i.updateBoundData(e,a,n,r)}updateBoundData(e,t,n,r){const o=this;for(let i in t){const s=t[i];let a=s.name;if(!s.updating&&(a.indexOf("::")>=0&&(a=a.substring(0,a.indexOf("::"))),void 0===r||r===a)){if(a.indexOf("(")>=0){let e=a.substring(a.indexOf("("));const t=a.substring(0,a.indexOf("("));if(e=e.substring(1,e.length-1),e=e.replace(/ /gi,""),e=e.split(","),e.length>0&&""!==e[0]){let r=[];for(let t=0;t<e.length;t++)r.push(n[e[t]]);s.value=n[t].apply(n,r)}else s.value=n[t]();s.type=typeof s.value}else s.value=n[a];if("innerHTML"===a){if(e[i].toString().trim()!==n[a].toString().trim()){if(window.jqxBlazor&&e[i].indexOf("\x3c!--")>=0){(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString());continue}(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString().trim())}}else s.not?(e[i]=!s.value,s.targetPropertyName&&(e[s.targetPropertyName]=!s.value)):(e[i]=s.value,s.targetPropertyName&&(e[s.targetPropertyName]=s.value));if(e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);!s.reflectToAttribute||n===s.value&&s.ready||e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}if(!s.ready){if(e.$&&e.$.isCustomElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i];e._properties||(e._beforeCreatedProperties=e._properties=e.propertyByAttributeName=[]),e._properties[i]||(e._properties[i]={attributeName:t},e._beforeCreatedProperties&&(e._beforeCreatedProperties[i]=e._properties[i]),e.propertyByAttributeName[t]=e._properties[i]);const n=e._properties[i];n.isUpdating=!0,s.reflectToAttribute&&(s.not?e.$.setAttributeValue(n.attributeName,!s.value,s.type):e.$.setAttributeValue(n.attributeName,s.value,s.type)),s.reflectToAttribute||e.$.setAttributeValue(n.attributeName,null,s.type),n.isUpdating=!1}if(s.twoWay){const t=function(t){if(s.value=t,e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);s.reflectToAttribute&&n!==s.value&&e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}};if(s.name.indexOf("::")>=0){const n=s.name.indexOf("::"),r=s.name.substring(n+2);o["$"+e.getAttribute("jqx-id")].listen(r,(function(){t(e[i]);const n=s.name.substring(0,s.name.indexOf("::"));o.updateBoundProperty(n,s)}))}if(e.$&&e.$.isCustomElement){e._properties[i]&&(e._properties[i].notify=!0),v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const n=v.cache["toDash"+i];o["$"+e.getAttribute("jqx-id")].listen(n+"-changed",(function(e){let n=e.detail;t(n.value);const r=o.context;e.context!==document&&(o.context=o),o.updateBoundProperty(s.name,s),o.context=r}))}}}s.ready=!0}}}static clearCache(){this.cache={}}addMessages(e,t){Object.assign(this.messages[e],t)}localize(e,t){const n=this;if(!n.messages||!n.messages[n.locale])return;let r=n.messages[n.locale][e];if(""===r)return"";if(!r){const r=n.messages.en;if(r){let n=r[e];if(n){for(let e in t){let r=t[e];n=n.replace(new RegExp("{{"+e+"}}","g"),r)}return n}return e}}const o=r;for(let e in t){let n=t[e];r=r.replace(new RegExp("{{"+e+"}}","g"),n)}if(n.localizeFormatFunction){const i=n.localizeFormatFunction(o,r,t,e);if(void 0!==i)return i}return r}static get requires(){return{}}static get listeners(){return{"theme-changed":function(e){this.theme=e.detail.newValue}}}static get methods(){return{}}get classNamesMap(){return{animation:"jqx-animate",rippleAnimation:"jqx-ripple"}}get hasAnimation(){return"none"!==this.animation}get hasRippleAnimation(){return"none"!==this.animation&&"advanced"===this.animation}static get modules(){return window[n].Modules}get properties(){const e=this;return e._properties||(e._properties=[]),e._properties}get parents(){const e=this;let t=[],r=e.parentNode;for(;r&&9!==r.nodeType;)r instanceof HTMLElement==1&&t.push(r),r=r.parentNode;const o=e.getRootNode();if(o.host){const e=e=>{let t=[e],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t=t.concat(e(o.host))}return window[n].EnableShadowDOM&&e.isInShadowDOM&&e.shadowParent&&(t=t.concat(e.shadowParent.parents)),t}log(e){this._logger("log",e)}warn(e){this._logger("warn",e)}error(e){this._logger("error",e)}_logger(e,t){if(this.debugMode){const n=t instanceof Error?t.message:t.toString();console[e](n)}if(this.rethrowError&&"error"===e)throw t}get focused(){return this.contains(document.activeElement)}template(){return"<div></div>"}registered(){const e=this;e.onRegistered&&e.onRegistered()}created(){const e=this;e.isReady=!1,e._initElement(e),e._setModuleState("created"),e.onCreated&&e.onCreated()}completed(){const e=this;e.isCompleted=!0,e._onCompleted&&e._onCompleted(),e.onCompleted&&e.onCompleted()}whenReady(e){const t=this;t.isCompleted?e():(t.whenReadyCallbacks||(t.whenReadyCallbacks=[]),t.whenReadyCallbacks.push(e))}whenRendered(e){const t=this;t.isRendered?e():(t.whenRenderedCallbacks||(t.whenRenderedCallbacks=[]),t.whenRenderedCallbacks.push(e))}addThemeClass(){const e=this;""!==e.theme&&e.classList.add("jqx-"+e.theme)}addDefaultClass(){const e=this;e.classList.add(n.toLowerCase()+"-element"),e.classList.add(e.nodeName.toLowerCase())}_renderShadowRoot(){const e=this;if(e.shadowRoot){e.$.root.classList.add(e.nodeName.toLowerCase());for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t];"class"===n.name||"id"===n.name||"style"===n.name||"tabindex"===n.name||n.name.indexOf("aria")>=0||e.$.root.setAttribute(n.name,n.value)}for(let t=0;t<e.classList.length;t++){const n=e.classList[t];"jqx-element-init"!==n&&"jqx-element"!==n&&"jqx-hidden"!==n&&"jqx-visibility-hidden"!==n&&e.$.root.classList.add(n)}}}render(){const e=this;if(!e.isRendered&&(e.isRendered=!0,e.isRendering=!1,e.context=document,e._renderShadowRoot(),e.whenRenderedCallbacks)){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}e.onRender&&e.onRender(),e.disabled&&e.setAttribute("aria-disabled",!0),e.readonly&&-1!==["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(e.getAttribute("role"))&&e.setAttribute("aria-readonly",!0)}ready(){const e=this;if(e._setId(),e.addThemeClass(),e.addDefaultClass(),"collapsed"===e.visibility?e.classList.add("jqx-hidden"):"hidden"===e.visibility&&e.classList.add("jqx-visibility-hidden"),e.dataContext&&e.applyDataContext(),e.onReady&&e.onReady(),e.shadowRoot&&JQX(e._selector)){if(JQX(e._selector).styleUrls){const t=JQX(e._selector).styleUrls;for(let n=0;n<t.length;n++)e.importStyle(t[n])}if(JQX(e._selector).styles){const t=document.createElement("style");t.innerHTML=JQX(e._selector).styles,e.shadowRoot.insertBefore(t,e.shadowRoot.firstChild)}}JQX(e._selector)&&JQX(e._selector).ready&&JQX(e._selector).ready()}_setId(){const e=this;if(!e.id){const t=e.elementName;e.id=t.slice(0,1).toLowerCase()+t.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}}checkLicense(){const e=this;"Evaluation"===window[n].License&&-1===window.location.hostname.indexOf("htmlelements")&&(e.logWatermark(),e.logLicense(),window[n].License="")}logWatermark(){const e=document.createElement("a");e.href="https://www.htmlelements.com/",e.innerHTML="https://www.htmlelements.com/",e.style.position="absolute",e.style.right="5px",e.style.bottom="5px",e.style.color="#fff",e.style.padding="20px",e.style.borderRadius="5px",e.style.background="#0C3D78",e.style.cursor="pointer",e.style.zIndex="999999",e.style.display="block",e.style.fontSize="24px",e.style.textDecoration="none",e.style.fontWeight="bold",e.style.opacity=0,e.style.transition="opacity .35s ease-in-out",e.id="watermark",document.getElementById("watermark")||setTimeout((()=>{document.getElementById("watermark")||(document.body.appendChild(e),setTimeout((()=>{e.style.opacity=1})),setTimeout((()=>{e.style.opacity=0,setTimeout((()=>{e.parentNode.removeChild(e)}),350)}),6e3))}),1e3)}logLicense(){console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("*jQWidgets License Key Not Found."),console.log("*This is an EVALUATION only Version, it is NOT Licensed for software projects intended for PRODUCTION."),console.log("*if you want to hide this message, please send an email to: sales@jqwidgets.com for a license."),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************")}get _selector(){const e=this;return e.id?"#"+e.id:e.classList.length>0?"."+e.classList[0]:""}applyDataContext(e){const t=this;let n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext;if(e&&(n=e,t.dataContext=e),n){if(!n._uid){n._uid=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),n._properties=[];for(let e in n){const r=n[e];"function"!=typeof r&&"_properties"!==e&&"_uid"!==e&&(n._properties[e]=r,Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:()=>n._properties[e],set(r){const o=n._properties[e];n._properties[e]=r;let i=[];i[e]={oldValue:o,value:r},i.length++,t.updatingDataContext=!0,w.fireEvent("dataContextPropertyChanged",{dataContext:n,properties:i},{bubbles:!1,cancelable:!0}),t.updatingDataContext=!1}}))}}if(t.dataContextProperties=t.parseAttributes(t),t.dataContextPropertiesMap={},t.dataContextListeners={},t.dataContextProperties){t.updatingDataContext=!0;for(let e in t.dataContextProperties){const r=t.dataContextProperties[e],o=r.name;if(r.propertyName=e,t.dataContextPropertiesMap[o]=e,v.cache["toDash"+e]||(v.cache["toDash"+e]=y.Core.toDash(o)),r.isEvent){const e=r.value;t.dataContextListeners[o]&&t.removeEventListener(o,t.dataContextListeners[o]),t.dataContextListeners[o]=function(t){n[e](t)},t.addEventListener(o,t.dataContextListeners[o])}if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(t[e]=i)}else t[e]=n[o]}t.dataContextPropertyChangedHandler=function(e){const n=e.detail.properties;if(e.detail.dataContext===("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext))for(let e in n){const r=t.dataContextPropertiesMap[e],o=t.context;r&&(t.context=document,t[r]=n[e].value,t.context=o)}},w.listen("dataContextPropertyChanged",t.dataContextPropertyChangedHandler),t.updatingDataContext=!1}else t.dataContextProperties=null}else{t.dataContextProperties=null;const e=function(){("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext)&&(t.applyDataContext(),window.removeEventListener("load",e))};window.addEventListener("load",e)}}updateDataContextProperty(e){const t=this,n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext,r=t.dataContextProperties[e];if(!t.updatingDataContext&&r.twoWay){const o=r.name;if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(i=t[e],c[n._uid]&&(c[n._uid][e]=i))}else n[o]=t[e],c[n._uid]&&(c[n._uid][e]=n[o])}}static get version(){return window[n].Version}initProperties(){const e=this;if(JQX(e._selector)&&JQX(e._selector).properties&&(e._initProperties=JQX(e._selector).properties),e.hasAttribute("props")&&!e.props?e._initProperties=window[e.getAttribute("props")]:e.props&&(e._initProperties=e.props),e._initProperties){const t=Object.keys(e._initProperties);for(let n=0;n<t.length;n++){const r=t[n],o=e._initProperties[r];if(void 0!==o){if(o.constructor===JQX.ObservableArray||o instanceof JQX.ObservableArray){e[r]=o.toArray();continue}if(o.constructor===JQX.DataAdapter||"jqxDataAdapter"===o.constructor.name||"object"==typeof o&&JQX.DataAdapter&&o instanceof JQX.DataAdapter||o instanceof JQX.Observable||o.constructor===JQX.Observable||"object"!=typeof o||y.Types.isArray(o)||o instanceof Date){if(void 0===e[r]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(r)){const t=e.localize("propertyUnknownName",{name:r});e.log(t)}e[r]=o;continue}}if("messages"!==r)if("dataSourceMap"!==r&&"rowCSSRules"!==r){if(o&&"object"==typeof o){const t=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=e._properties[r+"_"+s];if(l&&null===l.value){if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)t(a,r+"_"+s);else{if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}}};t(o,r)}}else e[r]=o;else e[r]=Object.assign(e[r],o)}}}setProperties(e){const t=this,n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o];if(i.constructor===JQX.ObservableArray||i instanceof JQX.ObservableArray)t[o]=i.toArray();else if(i.constructor===JQX.DataAdapter||"jqxDataAdapter"===i.constructor.name||"object"==typeof i&&JQX.DataAdapter&&i instanceof JQX.DataAdapter||i instanceof JQX.Observable||i.constructor===JQX.Observable||"object"!=typeof i||y.Types.isArray(i)||i instanceof Date){if(void 0===t[o]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(o))continue;const e=t._properties[o];"int"===e.type||"number"===e.type&&"string"==typeof subPropertyValue?"int"===e.type?t[o]=parseInt(i):t[o]=parseFloat(i):t[o]=i}else if("messages"!==o&&"dataSourceMap"!==o){if("object"==typeof i){const e=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=t._properties[r+"_"+s];if(l&&null===l.value){if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)e(a,r+"_"+s);else{if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}}};e(i,o)}}else t[o]=i}}setup(){const e=this;if(e.context=this,e.isReady&&!e.isCompleted)return;if(e.isReady)return e._setModuleState("attached"),e.isAttached=!0,e.attached(),e._handleListeners("listen"),void(e.context=document);e.ownerElement&&e.ownerElement.detachedChildren.indexOf(e)>=0&&e.ownerElement.detachedChildren.splice(e.ownerElement.detachedChildren.indexOf(e),1),e.isReady=!0,e.methods=e.getStaticMember("methods"),e.initProperties(),a.isMobile&&e.classList.add("jqx-mobile");for(let t=0;t<e.attributes.length;t+=1){const n=e.propertyByAttributeName[e.attributes[t].name];if(!n)continue;let r=e.$.getAttributeValue(n.attributeName,n.type);const o=r?r.toString():"";if(!(o.indexOf("{{")>=0||o.indexOf("[[")>=0||"object"!==n.type&&"array"!==n.type&&(e.attributes[t].value.indexOf("{{")>=0||e.attributes[t].value.indexOf("[[")>=0)||void 0===r||n.value===r)){const o=y.Types.getType(r),i=e.attributes[t].value;if(("any"===n.type||"object"===n.type)&&""+e[n.name]===r)continue;if("array"===n.type&&e[n.name]&&JSON.stringify(e[n.name])===r)continue;if("number"===o&&isNaN(r)&&"NaN"!==i&&"Infinity"!==i&&"-Infinity"!==i){const t=e.localize("propertyInvalidValueType",{name:n.name,actualType:"string",type:n.type});e.log(t)}n.isUpdatingFromAttribute=!0,e[n.name]=r,n.isUpdatingFromAttribute=!1}}for(let t in e._properties){const n=e._properties[t];if("innerHTML"===t&&n.value===n.defaultValue&&(n.value=n.defaultValue=y.Core.html(e)),"boolean"!==n.type&&"bool"!==n.type||"false"===e.getAttribute(n.attributeName)&&(n.isUpdating=!0,e.setAttribute(n.attributeName,""),n.isUpdating=!1),n.defaultReflectToAttribute&&n.reflectToAttribute){if(n.defaultReflectToAttribute&&n.defaultReflectToAttributeConditions){let t=!0;for(let r=0;r<n.defaultReflectToAttributeConditions.length;r++){const o=n.defaultReflectToAttributeConditions[r];let i,s;for(let e in o)i=e,s=o[e];e._properties[i]&&e._properties[i].value!==s&&(t=!1)}if(!t)continue}n.isUpdating=!0,e.$.setAttributeValue(n.attributeName,n.value,n.type),n.isUpdating=!1}}const t=[];if(e.children.length>0)for(let n=0;n<e.children.length;n++){const r=e.children[n];y.Extend(r).isCustomElement&&t.push(r)}e.applyTemplate(),e.complete=function(){if(!e.templateBindingsReady){const t=e=>{e.templateBindingsReady||(e.templateBindingsReady=!0,e.updateTextNodes(),e.updateBoundNodes())};if(e.ownerElement){let n=e.ownerElement,r=[];for(;n;)r.push(n),n=n.ownerElement;for(let e=r.length-1;e>=0;e--)t(r[e]);t(e)}else t(e)}const t=()=>{if(e._setModuleState("ready"),e.ready(),"auto"!==e.renderMode||e.isRendered||e.render(),e.isAttached=!0,e._setModuleState("attached"),e.attached(),e._handleListeners("listen"),e.isHidden||0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0),e.completed(),e.isRendered&&(e.context=document),e.whenReadyCallbacks){for(let t=0;t<e.whenReadyCallbacks.length;t++)e.whenReadyCallbacks[t]();e.whenReadyCallbacks=[]}};if(e.wait)e.classList.add("jqx-visibility-hidden");else if(e.classList.contains("jqx-async"))requestAnimationFrame((()=>{t()}));else{const n=e.shadowParent;e.shadowParent=null;const r=e.parents;if(e.shadowParent=n,0===r.length)return;const o=()=>{let t=e.ownerElement,n=[];for(;t;)n.push(t),t=t.ownerElement;for(let e=n.length-1;e>=0;e--)n[e].updateBoundMappedNodes()};e.ownerElement&&"HTML"!==r[r.length-1].nodeName?e.getRootNode().host?t():e.ownerElement&&"HTML"===e.ownerElement.parents[e.ownerElement.parents.length-1].nodeName?(o(),t()):e.checkIsInDomInterval=setInterval((()=>{const n=e.parents;"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomInterval),o(),t())}),100):t()}};let r=[].slice.call(e.querySelectorAll("[jqx-id]")).concat(t);if(window[n].EnableShadowDOM&&!0!==e.isInShadowDOM&&(r=[].slice.call(e.shadowRoot.querySelectorAll("[jqx-id]")).concat(t)),0===r.length)e.complete();else{e._completeListeners=0;for(let t=0;t<r.length;t++){const n=r[t];if(y.Extend(n).isCustomElement){const t=function(){e._completeListeners--,0===e._completeListeners&&(e.complete(),delete e._completeListeners)}.bind(e);n.isCompleted||n.isUtilityElement||!0===n.wait||(e._completeListeners++,n._onCompleted||(n.completeHandlers=[],n._onCompleted=function(){for(let e=0;e<n.completeHandlers.length;e++)n.completeHandlers[e]()}),n.completeHandlers.push(t))}}0===e._completeListeners&&e.complete()}}visibilityChangedHandler(){const e=this;e.isReady&&requestAnimationFrame((()=>{0===e.offsetWidth||0===e.offsetHeight?e.isHidden=!0:(e.isHidden=!1,e.$.fireEvent("resize",e,{bubbles:!1,cancelable:!0}))}))}attributeChangedCallback(e,t,n){const r=this,o=r.propertyByAttributeName[e];if("class"!==e&&"style"!==e||r.visibilityChangedHandler(),o||r.attributeChanged(e,t,n),r.onAttributeChanged&&r.onAttributeChanged(e,t,n),!o||o&&o.isUpdating)return;let i=r.$.getAttributeValue(o.attributeName,o.type);void 0!==n&&r[o.name]!==i&&(o.isUpdatingFromAttribute=!0,r[o.name]=void 0!==i?i:r._properties[o.name].defaultValue,o.isUpdatingFromAttribute=!1)}attributeChanged(e,t,n){}set hasStyleObserver(e){const t=this;void 0===t._hasStyleObserver&&(t._hasStyleObserver=e),e?d.watch(t):d.unwatch(t)}get hasStyleObserver(){const e=this;return void 0===e._hasStyleObserver||e._hasStyleObserver}attached(){const e=this;e.hasStyleObserver&&d.watch(e),e.onAttached&&e.onAttached(),JQX(e._selector)&&JQX(e._selector).attached&&JQX(e._selector).attached()}detached(){const e=this;e.hasStyleObserver&&d.unwatch(e),e._setModuleState("detached"),e.isAttached=!1,e.ownerElement&&-1===e.ownerElement.detachedChildren.indexOf(e)&&e.ownerElement.detachedChildren.push(e),e._handleListeners("unlisten"),e.onDetached&&e.onDetached(),JQX(e._selector)&&JQX(e._selector).detached&&JQX(e._selector).detached(),u&&u[e._selector]&&delete u[e._selector]}propertyChangedHandler(e,t,n){const r=this;t!==n&&("theme"===e&&(""!==t&&r.classList.remove("jqx-"+t),""!==n&&r.classList.add("jqx-"+n)),"visibility"===e?("collapsed"===t?r.classList.remove("jqx-hidden"):"hidden"===t&&r.classList.remove("jqx-visibility-hidden"),"collapsed"===n?r.classList.add("jqx-hidden"):"hidden"===n&&r.classList.add("jqx-visibility-hidden")):("disabled"===e||"readonly"===e)&&r._ariaPropertyChangedHandler(e,n),r.propertyChanged&&r.propertyChanged(e,t,n))}_ariaPropertyChangedHandler(e,t){const n=this;"readonly"===e&&-1===["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(n.getAttribute("role"))||(t?n.setAttribute("aria-"+e,!0):n.removeAttribute("aria-"+e))}_handleListeners(e){const t=this,n=t.tagName.toLowerCase(),r=r=>{for(let o in r){const i=o.split(".");let s=i[0],a=t.$;if(i[1])if(s=i[1],a=t["$"+i[0]],"document"===i[0]){let e=t.jqxId;""===e&&(e=y.Core.toCamelCase(n)),s=s+"."+e}else t.jqxId&&(s=s+"."+t.jqxId+"_"+t.parents.length);else t.jqxId&&(s=s+"."+t.jqxId);const l=r[o],d=function(e){const n=t.context;t.context=t,t[l]&&t[l].apply(t,[e]),t.context=n};a&&a[e](s,d)}};r(t.getStaticMember("listeners")),r(t.templateListeners),JQX(t._selector)&&JQX(t._selector).properties&&r(JQX(t._selector).listeners)}parseTemplate(){const e=this,n=e.template(),o=document.createDocumentFragment();if(t[e.nodeName]&&!r)return t[e.nodeName].cloneNode(!0);if(""===n)return null;let i=document.createElement("div");o.appendChild(i),i.innerHTML=n;let s=i.childNodes;i.parentNode.removeChild(i);for(let e=0;e<s.length;e++)o.appendChild(s[e]);return t[e.nodeName]=o,r?o:o.cloneNode(!0)}applyTemplate(){const e=this,t=e.parseTemplate();if(!t)return;if(!t.hasChildNodes)return;const n=t.childNodes[0],r=(t,n)=>{e["$"+t]=n.$=y.Extend(n),e.$[t]=n,n.ownerElement=e};let o=n;if(n.getElementsByTagName("content").length>0){let e=n.getElementsByTagName("content")[0];o=e.parentNode,o.removeChild(e)}else{const e=t.querySelectorAll("[inner-h-t-m-l]");e&&e.length>0&&(o=e[0])}e.$.template="template"===n.nodeName.toLowerCase()?n:n.querySelector("template");let i=t.querySelectorAll("[id]");0===i.length&&(i=t.querySelectorAll("*")),r("root",n),r("content",o),e.$.html=e.innerHTML.toString().trim();for(let t=0;t<i.length;t+=1){let n=i[t];""===n.id&&(n.id="child"+t),r(n.id,n),n.setAttribute("jqx-id",n.id),e.shadowRoot?n.shadowParent=e:n.removeAttribute("id")}for(!1!==e.hasTemplateBindings?e.bindings=e.getBindings(t):e.bindings=[],e.$root.addClass("jqx-container");e.childNodes.length;)o.appendChild(e.firstChild);if(e.appendTemplate(t),e.$.template){const t=document.createElement("div");t.classList.add("jqx-template-container"),e.$.templateContainer=t,e.$.template.parentNode.insertBefore(t,e.$.template),e.refreshTemplate()}}refreshTemplate(){const e=this;if(!e.$.templateContainer)return;e.templateDetached(e.$.templateContainer);const t=e.$.template.content.cloneNode(!0);e.templateBindings=e.getBindings(t),e.templateProperties=[];let n=document.createDocumentFragment();const r=function(t,n,o){for(let i in t){const s=t[i],a=s.node.cloneNode();n.appendChild(a);let l=[],d=!1;if(s.data)for(let t in s.data){const r=s.data[t],i=r.name;if(e.templateProperties[i]=!0,a.removeAttribute(y.Core.toDash(t)),"*items"===t)l=e[i],d=!0;else if(i.indexOf("item.")>=0&&void 0!==o)r.value=o[i.substring("item.".length)],a[t]=r.value;else if(i.indexOf("item")>=0&&void 0!==o)r.value=o,a[t]=r.value;else if("*if"===t)if(i.indexOf("(")>=0){let t,r=i.substring(i.indexOf("("));const o=i.substring(0,i.indexOf("("));if(r=r.substring(1,r.length-1),r=r.replace(/ /gi,""),r=r.split(","),r.length>0&&""!==r[0]){let n=[];for(let t=0;t<r.length;t++)n.push(e[r[t]]);t=e[o].apply(e,n)}else t=e[o]();!1===t&&n.removeChild(a)}else e[i]||n.removeChild(a);else e.updateBoundNode(a,s,e,i)}if(l.length>0||d){for(let e=0;e<l.length;e++)s.children&&r(s.children,a,l[e]);if("number"==typeof l)for(let e=0;e<l;e++)s.children&&r(s.children,a,e)}else s.children&&r(s.children,a,o)}};r(e.templateBindings.children,n),e.$.templateContainer.innerHTML="",e.$.templateContainer.appendChild(n),e.templateAttached(e.$.templateContainer)}templateAttached(){}templateDetached(){}appendTemplate(e){this.appendChild(e)}defineElementModules(){const e=this,t=e.constructor.prototype;if("BaseElement"===t.elementName){t.modules=e.constructor.modules;const n=t.modules;for(let t=0;t<n.length;t+=1)e.addModule(n[t])}else{const n=t.modules;if(!n)return;for(let t=0;t<n.length;t+=1){const r=n[t],o=r.prototype;e.defineElementMethods(o.methodNames,o),e.defineElementProperties(r.properties)}}}watch(e,t){const n=this;n._watch=null!==e&&null!==t?{properties:e,propertyChangedCallback:t}:null}unwatch(){this._watch=null}set(e,t,n){const r=this,o=r.context;r.context=!0===n?document:r,r[e]=t,r.context=o}get(e){return this[e]}_setModuleState(e,t){const n=this,r="is"+e.substring(0,1).toUpperCase()+e.substring(1),o="on"+e.substring(0,1).toUpperCase()+e.substring(1);for(let i=0;i<n.modulesList.length;i++){const s=n.modulesList[i];s[r]=!0,s[e]&&s[e](t),s[o]&&s[o](t)}}addModule(e,t){const n=this;if(!e)return;const r=n.modules.slice(0),o=e.prototype,i=Object.getPrototypeOf(e);if(i.name&&i.name!==e.name&&n.addModule(i),!e.moduleName&&e.name&&(e.moduleName=e.name),-1===r.findIndex((t=>e.moduleName===t.moduleName))&&r.push(e),n.defineModule(e),n.defineElementMethods(o.methodNames,o),n.defineElementProperties(e.properties),n.constructor.prototype.modules=r,t)for(let t in JQX.Elements.tagNames){const r=JQX.Elements.tagNames[t];let o=Object.getPrototypeOf(r),i=[];for(;o!==HTMLElement;)i.push(o.prototype),o=Object.getPrototypeOf(o);i.indexOf(n)>=0&&r!==n&&r.prototype.addModule(e)}}defineModule(e){if(e.isDefined)return;e.prototype._initModule=function(e){this.ownerElement=e};const t=e.properties||{},n=Object.keys(t),r=Object.getOwnPropertyNames(e.prototype);e.prototype.methodNames=r;for(let r=0;r<n.length;r+=1){const o=n[r],i=t[o];Object.defineProperty(e.prototype,o,{configurable:!1,enumerable:!0,get(){return this.ownerElement?this.ownerElement[o]:i.value},set(e){this.ownerElement[o]=e}})}e.isDefined=!0}getStaticMember(e,t){const r=window[n][this.elementName],o=r[e];t||(t="");let i="array"===t?[]:"string"===t?"":{},s=Object.getPrototypeOf(r),a=[];for(;s[e];)a.push(s[e]),s=Object.getPrototypeOf(s);for(let e=a.length-1;e>=0;e--)if("array"===t)for(let t=0;t<a[e].length;t++)-1===i.indexOf(a[e][t])&&i.push(a[e][t]);else"string"===t?-1===i.indexOf(a[e])&&(i+=a[e]):i=y.Core.assign(i,a[e]);if("array"===t){for(let e=0;e<o.length;e++)-1===i.indexOf(o[e])&&i.push(o[e]);return i}return"string"===t?(-1===i.indexOf(o)&&(i+=o),i):y.Core.assign(i,o)}defineElementHierarchicalProperties(e,t){const n=this,r=[];!function(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if("messages"===i)continue;const s=e[i],a=Object.keys(s),l=a.indexOf("value")>=0&&a.indexOf("type")>=0&&"object"==typeof s.value;if("propertyObject"===s.type||l){const e=function(n,o){if(!n.value)return;const i=Object.keys(n.value);for(let s=0;s<i.length;s++){const a=i[s],l=n.value[a],d=o+"_"+a;if("object"!=typeof l||null===l)break;const c=Object.keys(l);if(!(c.indexOf("value")>=0&&c.indexOf("type")>=0))break;if("array"!==n.type&&(n.isHierarchicalProperty=!0),l.parentPropertyName=o,t){const e=t._properties[d];if(n.value.hasOwnProperty(a)){if(e.isDefined)continue;delete n.value[a]}e.isDefined=!0,Object.defineProperty(n.value,a,{configurable:!1,enumerable:!0,get:()=>t._properties[d].value,set(e){t.updateProperty(t,t._properties[d],e)}})}r[d]||(r[d]=l,r.length++),("propertyObject"===l.type||"object"==typeof l.value&&"array"!==l.type)&&e(t?t._properties[d]:l,d)}};e(s,i)}}}(e),r.length>0&&!t&&n.defineElementProperties(r)}defineElement(){const e=this,t=e.constructor.prototype,r=e.getStaticMember("properties"),o=Object.getOwnPropertyNames(t);t.extendedProperties={},t.boundProperties={},t.templateListeners={},e.defineElementModules(),e.defineElementMethods(o,t),e.defineElementProperties(r),e.defineElementHierarchicalProperties(e.extendedProperties),t._initElement=function(){const e=this,r=t.extendedProperties,o=Object.keys(r),i=e.modules;e.$=y.Extend(e),e.$document=w,e.jqxId=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),e.isCreated||(e.modulesList=[],e._properties=[],e._beforeCreatedProperties&&(e._properties=e._beforeCreatedProperties,delete e._beforeCreatedProperties),e.detachedChildren=[],e.propertyByAttributeName=[]);for(let t=0;t<i.length;t+=1){let n=new(0,i[t]);n._initModule(e),e.modulesList.push(n)}const s=[];for(let t=0;t<o.length;t+=1){const n=o[t],i=r[n];let a=i.value;if(e._properties[n]){if(void 0!==e._properties[n].notify)continue;delete e._properties[n]}if(E&&"innerHTML"===n&&delete e[n],-1===window.navigator.userAgent.indexOf("PhantomJS")&&e.hasOwnProperty(n))if(i.isHierarchicalProperty&&e[n]){const t=e[n];s.push({name:n,value:t}),a=i.value,delete e[n]}else a=e[n],delete e[n];if("array"===i.type&&null!=a&&(a=a.slice(0)),"object"===i.type&&null!=a&&(a=Array.isArray(a)?a.slice(0):Object.assign({},a)),e._properties[n]={name:n,notify:i.notify,allowedValues:i.allowedValues,type:i.type,nullable:i.nullable,reflectToAttribute:i.reflectToAttribute,defaultReflectToAttribute:i.defaultReflectToAttribute,defaultReflectToAttributeConditions:i.defaultReflectToAttributeConditions,value:a,readOnly:i.readOnly,defaultValue:a,attributeName:i.attributeName,observer:i.observer,inherit:i.inherit,extend:i.extend,validator:i.validator},e.propertyByAttributeName[i.attributeName]=e._properties[n],!i.hasOwnProperty("type")){const t=e.localize("propertyUnknownType",{name:n});e.log(t)}if("any"===i.type||"propertyObject"===i.type)continue;const l=y.Types.getType(a);if(null!=a&&i.type!==l&&!i.validator){if("object"===i.type&&"array"===l)continue;if("number"===l&&["integer","int","float"].findIndex((e=>e===i.type))>=0)continue;const t=e.localize("propertyInvalidValueType",{name:n,actualType:l,type:i.type});e.log(t)}}if(e.defineElementHierarchicalProperties(e._properties,e),s.length&&"manual"!==window[n].RenderMode)for(let t=0;t<s.length;t++){const n=s[t];e[n.name]=n.value}e.isCreated=!0},t.registered()}defineElementMethods(e,t){const n=this.constructor.prototype,r=function(e,t){const n=Array.prototype.slice.call(arguments,2);return function(){if(!this.isReady&&"localize"!==t&&"localize"!==t&&"cloneNode"!==t&&"importStyle"!==t&&"log"!==t&&"parseAttributes"!==t){const e=this.localize("elementNotInDOM");this.log(e)}let r=this;for(let e=0;e<this.modulesList.length;e++){let n=this.modulesList[e];if(t in n){r=n;break}}const o=this.context,i=n.concat(Array.prototype.slice.call(arguments));let s=null;const a=function(e,t){return e===t||"number"===e&&("int"===t||"integer"===t||"float"===t)||"bool"===e&&"boolean"===t||"boolean"===e&&"bool"===t||"object"===e&&"any"===t||void 0};if(this.methods){const e=this.methods[t];if(e){const n=e.split(":");s=n[n.length-1].trim();const r=[],o=e.substring(1+e.indexOf("("),e.lastIndexOf(")")).split(",");let l="";for(let e=0;e<o.length;e++){const t=o[e];l+=t,t.indexOf(":")>=0?(r.push(l),l=""):l+=","}let d=r.length;for(let e=0;e<r.length;e++){const n=r[e].trim().split(":"),o=n[0].split("=")[0].trim().indexOf("?")>=0,s=n[1].indexOf("?")>=0,l=n[1].replace(/\?/gi,"").trim(),c=l.split("|");let u=n[0].split("=")[1];const p=y.Types.getType(i[e]);if(void 0===i[e]&&u){switch(u=u.trim(),l[0]){case"date":{let e=u.substring(u.indexOf("(")+1,u.lastIndexOf(")"));e=e.length>0?e.split(",").map((e=>parseInt(e))):[],u=0===e.length?new Date:new Date(e[0],e[1],e[2]);break}case"bool":case"boolean":u="true"===u||"1"===u;break;case"int":case"integer":u=parseInt(u);break;case"float":case"number":u=parseFloat(u);break;case"any":case"object":u=u.indexOf("{")>=0?JSON.parse(u):u}i.push(u)}else o&&d--;if(l!==p&&p){let n=!0;for(let e=0;e<c.length;e++)if(a(p,c[e])){n=!1;break}if(n&&(null!==i[e]||!s)){const n=this.localize("methodInvalidValueType",{name:t,actualType:p,type:l,argumentIndex:e});this.log(n)}}if(i.length<d){const e=this.localize("methodInvalidArgumentsCount",{name:t,actualArgumentsCount:i.length,argumentsCount:d});this.log(e)}}}}this.context=this;const l=e.apply(r,i);if(s){const e=void 0===y.Types.getType(l)?"void":y.Types.getType(l);if(!a(e,s)){const n=this.localize("methodInvalidReturnType",{name:t,actualType:e,type:s});this.log(n)}}return this.context=o,l}},o=["constructor","ready","created","render","attached","detached","appendChild","insertBefore","removeChild","connect","disconnectedCallback","connectedCallback","attributeChangedCallback","propertyChangedHandler","enableShadowDOM","isInShadowDOM","addPropertyBindings"];for(let i in e){let s=e[i];s&&s.startsWith&&s.startsWith("_")||void 0!==o.find((e=>e===s))||n.extendedProperties[s]||y.Types.isFunction(t[s])&&(n[s]=r(t[s],s))}}defineElementProperties(e){if(!e)return;const t=this,n=t.constructor.prototype,r=Object.keys(e),o=t.getStaticMember("properties");Object.assign(n.extendedProperties,e),t.updateProperty=function(e,t,n){const r=e;if(!t||t.readOnly)return;if(t.allowedValues){let e=!1;for(let r=0;r<t.allowedValues.length;r++)if(t.allowedValues[r]===n){e=!0;break}if(!e){const e=JSON.stringify(t.allowedValues).replace(/\[|\]/gi,"").replace(",",", ").replace(/"/gi,"'"),o="'"+n+"'",i=r.localize("propertyInvalidValue",{name:t.name,actualValue:o,value:e});return void r.log(i)}}const o=t.name,i=r._properties[o].value;if(t.validator&&r[t.validator]){const e=r.context;r.context=r;const o=r[t.validator](i,n);void 0!==o&&(n=o),r.context=e}if(i!==n){if(r.propertyChanging){const e=r.propertyChanging(o,i,n);if(!1===e||null===e)return}if(!t.hasOwnProperty("type")){const e=r.localize("propertyUnknownType",{name:o});r.log(e)}if("array"!==t.type||JSON.stringify(i)!==JSON.stringify(n)){if(null!=n&&"any"!==t.type&&"propertyObject"!==t.type&&t.type!==y.Types.getType(n)&&!t.validator||null===n&&!t.nullable){let e=!0;if("object"===t.type&&"array"===y.Types.getType(n)&&(e=!1),"number"===y.Types.getType(n)&&["integer","int","float"].findIndex((e=>e===t.type))>=0&&(e=!1),e){const e=r.localize("propertyInvalidValueType",{name:o,actualType:y.Types.getType(n),type:t.type});return void r.error(e)}}if(t.isUpdating=!0,t.isHierarchicalProperty){const e=function(t,n){if(!t)return;const o=Object.keys(t);for(let i=0;i<o.length;i++){const s=o[i],a=t[s];"object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date?e(a,n+"_"+s):r[n+"_"+s]=a}};e(n,o)}else r._properties[o].value=n;if(!t.isUpdatingFromAttribute&&t.reflectToAttribute&&r.$.setAttributeValue(t.attributeName,n,t.type),r.isReady&&(!r.ownerElement||r.ownerElement&&r.ownerElement.isReady)){if("wait"===o&&(n||!i||r.isCompleted||(r.classList.remove("jqx-visibility-hidden"),r.ownerElement&&r.ownerElement.updateBoundMappedNodes(),r.updateBoundMappedNodes(),r.complete())),"renderMode"===o)return;if(r.context!==r&&!r.wait){const e=r.context;r.context=r,r.propertyChangedHandler(o,i,n),r.context=e,t.observer&&r[t.observer]&&(r.context=r,r[t.observer](i,n),r.context=document),r._watch&&r._watch.properties.indexOf(o)>=0&&r._watch.propertyChangedCallback(o,i,n)}const e=t.notify||r.boundProperties[o];e&&(r.$.fireEvent(t.attributeName+"-changed",{context:r.context,oldValue:i,value:r[o]}),r.boundProperties[o]&&r.updateBoundNodes(o)),e&&r.templateProperties&&r.templateProperties[o]&&r.refreshTemplate(),r.dataContextProperties&&("dataContext"===o?r.applyDataContext():r.dataContextProperties[o]&&r.updateDataContextProperty(o))}t.isUpdating=!1}}};for(let t=0;t<r.length;t+=1){const i=r[t],s=e[i],a=y.Core.toDash(i),l=s.type||"any",d=l.indexOf("?")>=0||"any"===l;d&&"any"!==l&&(s.type=l.substring(0,l.length-1)),s.nullable=d,s.attributeName=a.toLowerCase(),s.name=i,s.reflectToAttribute=void 0===s.reflectToAttribute||s.reflectToAttribute,s.inherit&&o[i]&&(s.value=o[i].value),s.extend&&o[i]&&y.Core.assign(s.value,o[i].value),n.hasOwnProperty(i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get(){if(this._properties[i])return this._properties[i].value},set(e){const t=this;t.updateProperty(t,t._properties[i],e)}})}}}let C=[],S=[],x=[],E=!1;const A=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A&&parseInt(A[2],10)<=50&&(E=!0);class P{static register(e,t){const r=t.prototype;let o=a.toCamelCase(e).replace(/[a-z]+/,""),i=t.version||window[n].Version;if(window.customElements.get(e)&&window.customElements.get(e).version===i)return;let s=e;for(i=i.split(".");window.customElements.get(e);)e=s+"-"+i.join("."),i[2]=parseInt(i[2])+1;if(!C[e]){if(e.startsWith(n.toLowerCase()))C[e]=window[n][o]=window[n.toLowerCase()+o]=t;else{let r=e.split("-")[0];r=r.substring(0,1).toUpperCase()+r.substring(1),window[n][r]||(window[n][r]={}),C[e]=window[n][r][o]=window[r.toLowerCase()+o]=t,window[n][o]&&(o=a.toCamelCase(e)),window[n][o]=t}r.elementName=o,r.defineElement(),S[e]&&S[e](r),window.customElements.define(e,t)}}static registerElements(){const e=this;if(e.toRegister){e.isRegistering=!0;for(let t=0;t<e.toRegister.length;t++){const n=e.toRegister[t];e.register(n.tagName,n.element)}e.isRegistering=!1}}static get(e){if(C[e])return C[e]}static whenRegistered(e,t){if(!e)throw new Error("Syntax Error: Invalid tag name");const n=S[e],r=this.get(e),o=r?r.modules.length:3;try{n||r?!n&&r?(t(r.prototype),S[e]=void 0):n&&!r?S[e]=function(e){n(e),t(e)}:n&&r&&(r.proto&&(n(r.proto),t(r.proto)),S[e]=void 0):S[e]=function(e){try{t(e)}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}}}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}if(r&&o!==r.prototype.modules.length){const t=document.querySelectorAll(e);for(let e=0;e<t.length;e++){const n=t[e];n.isCreated&&n._initElement()}}}}P.lazyRegister=!1,P.tagNames=[];class T{constructor(){const e=this;e.name="observableArray",e.observables=arguments.length<3?null:arguments[2];const t=new Proxy(e,{deleteProperty:function(e,t){return delete e[t],!0},apply:function(e,t,n){return e.apply(t,n)},get:function(t,n){return"symbol"==typeof(r=n)||"object"==typeof r&&"[object Symbol]"===Object.prototype.toString.call(r)||t[n]||isNaN(parseInt(n))?t[n]:e.getItem(parseInt(n));var r},set:function(t,n,r){return t[n]||isNaN(parseInt(n))?(t[n]=r,!0):(e.setItem(parseInt(n),r),!0)}});if(e._addArgs={eventName:"change",object:t,action:"add",index:null,removed:new Array,addedCount:1},e._removeArgs={eventName:"change",object:t,action:"remove",index:null,removed:null,addedCount:0},arguments.length>=1&&Array.isArray(arguments[0])){e._array=[];const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else e._array=Array.apply(null,arguments);return 2===arguments.length&&(e.notifyFn=arguments[1]),t}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){return this._array}_getItem(e,t){const n=this;return"string"==typeof t||"number"==typeof t||void 0===t?t:new Proxy(t,{deleteProperty:function(e,t){return delete e[t],!0},set:function(t,r,o){const i=t[r];return t[r]=o,!n._canNotify||!1===t.canNotify||(n.observables&&!n.observables[r]||n._notify({eventName:"change",object:n,target:t,action:"update",index:e,path:e+"."+r,oldValue:i,newValue:o,propertyName:r}),!0)}})}getItem(e){return this._array[e]}setItem(e,t){const n=this,r=n._array[e];n._array[e]=n._getItem(e,t),n._notify({eventName:"change",object:n._array,action:"update",index:e,removed:[r],addedCount:1})}get length(){return this._array.length}set length(e){const t=this;o.isNumber(e)&&t._array&&t._array.length!==e&&t.splice(e,t._array.length-e)}toString(){return this._array.toString()}toLocaleString(){return this._array.toLocaleString()}concat(){const e=this;e._addArgs.index=e._array.length;const t=e._array.concat.apply(e._array,arguments);return new JQX.ObservableArray(t)}join(e){return this._array.join(e)}pop(){const e=this;e._removeArgs.index=e._array.length-1,delete e[e._array.length-1];const t=e._array.pop();return e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}push(){const e=this;if(e._addArgs.index=e._array.length,1===arguments.length&&Array.isArray(arguments[0])){const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else{const t=e._getItem(e._addArgs.index,arguments[0]);e._array.push.apply(e._array,[t])}return e._addArgs.addedCount=e._array.length-e._addArgs.index,e._notify(e._addArgs),e._notifyLengthChange(),e._array.length}_notifyLengthChange(){const e=this;if(!e.canNotify)return;const t=e._createPropertyChangeData("length",e._array.length);e._notify(t)}_createPropertyChangeData(e,t,n){return{eventName:"change",object:this,action:e,value:t,oldValue:n}}reverse(){return this._array.reverse()}shift(){const e=this,t=e._array.shift();return e._removeArgs.index=0,e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}slice(e,t){return this._array.slice(e,t)}sort(e){return this._array.sort(e)}splice(e,t,n){const r=this,o=r._array.length;let i;if(n&&n.length)for(let o=0;o<n.length;o++)i=r._array.splice(e+o,t,n[o]);else i=r._array.splice.apply(r._array,arguments);if(n){let t=r.canNotify;if(r.canNotify=!1,n.length)for(let t=0;t<n.length;t++)r.setItem(e+t,n[t]);else r.setItem(e,n);r.canNotify=t,r._notify({eventName:"change",object:this,action:"add",index:e,added:i,addedCount:r._array.length>o?r._array.length-o:0})}else r._notify({eventName:"change",object:this,action:"remove",index:e,removed:i,addedCount:r._array.length>o?r._array.length-o:0});return r._array.length!==o&&r._notifyLengthChange(),i}unshift(){const e=this,t=e._array.length,n=e._array.unshift.apply(e._array,arguments);return e._addArgs.index=0,e._addArgs.addedCount=n-t,e._notify(this._addArgs),e._notifyLengthChange(),n}indexOf(e,t){const n=this;for(let r=t||0,o=n._array.length;r<o;r++)if(n._array[r]===e)return r;return-1}lastIndexOf(e,t){const n=this;for(let r=t||n._array.length-1;r>=0;r--)if(n._array[r]===e)return r;return-1}find(e,t){return this._array.find(e,t)}findIndex(e,t){return this._array.findIndex(e,t)}every(e,t){return this._array.every(e,t)}some(e,t){return this._array.some(e,t)}forEach(e,t){this._array.forEach(e,t)}map(e,t){return this._array.map(e,t)}filter(e,t){return this._array.filter(e,t)}reduce(e,t){return void 0!==t?this._array.reduce(e,t):this._array.reduce(e)}reduceRight(e,t){return void 0!==t?this._array.reduceRight(e,t):this._array.reduceRight(e)}move(e,t){this.splice(t,0,this.splice(e,1)[0])}}let D={};window[n]&&(D=window[n]),window[n]=function(e,t){let r=e;if(e){if(e.indexOf("#")>=0||e.indexOf(".")>=0)return u[e]?u[e]:t?(u[e]=new t,function(e,t){const n=t.properties;t._properties=[];const r=function(n,o){const i=Object.keys(n);for(let s=0;s<i.length;s++){const a=i[s],l=n[a];t._properties[o+a]=l,Array.isArray(l)?t._properties[o+a]=new T(l,(function(t){const n=a+"."+t.path,r=t.newValue,o=document.querySelector(e);if(o){const e=n.split(".");let t=o;for(let n=0;n<e.length;n++)t=t[e[n]];t=r}})):(Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>t._properties[o+a],set(e){t._properties[o+a]=e}}),l&&"DataAdapter"===l.constructor.name||l&&"object"==typeof l&&JQX.DataAdapter&&l instanceof JQX.DataAdapter||"object"==typeof l&&l&&Object.keys(l).length>0&&r(l,o+a+"."))}};r(n,""),Object.defineProperty(t,"properties",{configurable:!1,enumerable:!0,get:()=>n});const o=document.querySelector(e);if(o&&o.isReady)for(let e in n)if("properties"===e){const t=n[e];for(let e in t)o[e]=t[e]}else o[e]=n[e];else if(o){o.props={};for(let e in n)o.props[e]=n[e]}}(e,u[e]),u[e]):void 0;if(t){if(P.tagNames[e]=t,P.lazyRegister){P.toRegister||(P.toRegister=[]);const e=a.toCamelCase(r).replace(/[a-z]+/,"");return window[n][e]=t,void P.toRegister.push({tagName:r,element:t})}P.register(r,t)}}},window.addEventListener("load",(function(){const e=window[n].Elements.tagNames;let t=[];for(let r in e){const o=e[r];let i=document.querySelectorAll("["+r+"]");for(let e=0;e<i.length;e++){const t=i[e];t instanceof HTMLDivElement&&(t.__proto__=o.prototype,t.created(),t.connectedCallback()),t.classList.add("jqx-element-ready")}let s=o.name;"Item"===s&&(s="ListItem"),i=document.querySelectorAll('[is="'+n.toLocaleLowerCase()+s+'"]');for(let e=0;e<i.length;e++)t.push(i[e])}if(t.length>0){const e=e=>{let t=[],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t.sort((function(t,n){let r=e(t).length,o=e(n).length;return r<o?1:r>o?-1:0}));for(let e=0;e<t.length;e++){const n=t[e],r=n.getAttribute("is");let o;o="jqxItem"===r?new window.jqxListItem(n):new window[r](n),o.removeAttribute("is")}}}));const L=function(){if("complete"===document.readyState&&"manual"!==window[n].RenderMode){x.sort((function(e,t){let n=e.element.parents.length,r=t.element.parents.length;return n<r?-1:n>r?1:0}));for(let e=0;e<x.length;e++)window[n].RenderMode="",x[e].element.isLoading=!1,x[e].callback(),window[n].RenderMode="";x=[],document.removeEventListener("readystatechange",L)}};Object.assign(window[n],{Elements:P,Modules:[],BaseElement:class extends _{static get observedAttributes(){let e=this,t=["external-style"];for(let n in e.prototype.extendedProperties){const r=e.prototype.extendedProperties[n];t.push(r.attributeName)}return t}static get styleUrls(){return[]}static get styles(){return""}get styleUrl(){return this._styleUrl}set styleUrl(e){this._styleUrl=e}get isInShadowDOM(){const e=this,t=e.getRootNode();return!e.hasAttribute("jqx-blazor")&&t!==document&&t!==e}getShadowRootOrBody(){const e=this;return e.isInShadowDOM&&e.getRootNode().host?e.getRootNode().host.shadowRoot:document.body}get enableShadowDOM(){return window[n].EnableShadowDOM}importStyle(e,t){this._importStyle(e,t)}_importStyle(e,t){const n=this;if(!n.shadowRoot||!e)return;const r=e=>{const r=n.shadowRoot.children;for(let n=0;n<r.length;n++){const o=r[n];if(o instanceof HTMLLinkElement&&o.href===e)return t&&t(),null}const o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.onload=t,o},o=(()=>{const e=n.shadowRoot.children;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r instanceof HTMLLinkElement&&(t=r)}return t})(),i=(e,t)=>{t.parentNode.insertBefore(e,t.nextSibling)};if(Array.isArray(e)){const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=r(e[n]);o&&t.appendChild(o)}o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}else{const t=r(e);if(!t)return;o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}}attributeChanged(e,t,n){"style-url"===e&&(this.styleUrl=n)}attributeChangedCallback(e,t,n){this.isReady&&super.attributeChangedCallback(e,t,n)}constructor(e,t){super();const n=this;if(e){t&&(n._initProperties=t);const r=e=>{if("string"==typeof e?document.querySelector(e):e){const r="string"==typeof e?document.querySelector(e):e;if(r instanceof HTMLDivElement){const o=document.createElement(n.tagName);for(let e of r.attributes)o.setAttribute(e.name,r.getAttribute(e.name));for(;r.childNodes.length;)o.appendChild(r.firstChild);return"string"==typeof e&&(o.id=e.substring(1)),o._initProperties=t,r.parentNode&&r.parentNode.replaceChild(o,r),o}if(t){const e=r.context;if(r._initProperties=t,r.isReady){r.context=r;const n={},o={};for(let e in t)n[e]=r[e],o[e]=t[e];Object.getOwnPropertyNames(t).length>0&&(r.initProperties(),r.propertyChangedHandler(t,n,o)),r.context=e}}return r}};if("string"==typeof e){const t=document.querySelectorAll(e),n=[];if(t.length>1){for(let e=0;e<t.length;e++){const o=r(t[e]);n.push(o)}return n}}else if(e&&e.length>0){const t=e;if(t.length>1){for(let e=0;e<t.length;e++){const n=r(t[e]);C.push(n)}return C}}return r(e)}n._styleUrl="",n.isUtilityElement||n.created()}_getRootShadowParent(){let e=this.shadowParent;for(;e;){if(!e.shadowParent)return e;e=e.shadowParent}return e||this.shadowParent}_getStyleUrl(e){let t=y.Core.getScriptLocation()+window[n].StyleBaseUrl+e;return this.shadowParent&&(t=t.replace("scoped/","")),t}_getStyleUrls(){const e=this;e.nodeName.startsWith(n);const t=e.getStaticMember("styleUrls","array"),r=[];for(let n=0;n<t.length;n++){const o=t[n],i=e._getStyleUrl(o);r.push(i)}return r}_setupShadowRoot(){const e=this;e.classList.add("jqx-element-init");const t=t=>{t.$.root&&(t.$.root.classList.add(n.toLowerCase()+"-element"),t.$.root.classList.add(e.nodeName.toLowerCase())),t.setup(),t.classList.remove("jqx-element-init")};if(document.adoptedStyleSheets)if(window[n].AdoptedStyleSheets)window[n].AdoptedStyleSheetsLoaded?(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,t(e)):(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,window[n].AdoptedStyleSheetsLoadedQueue||(window[n].AdoptedStyleSheetsLoadedQueue=[]),window[n].AdoptedStyleSheetsLoadedQueue.push(e));else{const r=new CSSStyleSheet;let o=y.Core.getScriptLocation()+"/styles/jqx.default.css";r.replace('@import url("'+o+'")').then((()=>{if(t(e),window[n].AdoptedStyleSheetsLoaded=!0,window[n].AdoptedStyleSheetsLoadedQueue){const e=window[n].AdoptedStyleSheetsLoadedQueue;for(let n=0;n<e.length;n++){const r=e[n];t(r)}delete window[n].AdoptedStyleSheetsLoadedQueue}})).catch((e=>{console.error("Failed to load:",e)})),window[n].AdoptedStyleSheets=[r],document.adoptedStyleSheets=[r],e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets}}connect(){const e=this;window[n].EnableShadowDOM&&!e.shadowRoot&&!0!==e.isInShadowDOM&&(e.attachShadow({mode:"open"}),e.shadowRoot&&e.$.root&&(e.shadowRoot.appendChild(e.$.root),e.$.root.classList.add(e.nodeName.toLowerCase()))),e.shadowRoot||e.shadowParent?e.shadowRoot?e._setupShadowRoot():(e.shadowParent&&window[n].EnableShadowDOM,e.setup()):e.setup()}connectedCallback(){const e=this;if(e.isLoading||e.isUtilityElement)return;e.classList.add("jqx-element-init");const t=function(){e.classList.remove("jqx-element-init")};if("complete"===document.readyState&&(void 0===window[n].isAngular&&(window[n].isAngular=null!==document.body.querySelector("[ng-version]")),void 0===window[n].isVue&&(window[n].isVue=null!==document.querySelector(".vue-root")),window[n].isAngular))for(let t=0;t<e.parents.length&&!e.parents[t].nodeName.toLowerCase().startsWith(n.toLowerCase()+"-");t++)if(e.parents[t].hasAttribute("ng-version")&&!e.classList.contains("jqx-angular")){window[n].RenderMode="manual";break}if("complete"===document.readyState&&"manual"!==window[n].RenderMode){const n=e.parents;n.length&&"HTML"===n[n.length-1].nodeName||e.getRootNode().host?(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),t(),e.connect()):(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),n.length>0&&(e.checkIsInDomTimer=setInterval((()=>{const n=e.parents;0===n.length&&clearInterval(e.checkIsInDomTimer),n.length>0&&"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomTimer),t(),e.connect())}),100)))}else e.isLoading=!0,x.push({element:this,callback:function(){this.isReady||(t(),this.connect())}.bind(e)})}disconnectedCallback(){const e=this;e.isAttached?(e.shadowParent=null,e.detached()):e._resetShadowParent()}adoptedCallback(){this.setup()}appendTemplate(e){const t=this;t.shadowRoot?t.shadowRoot.appendChild(e):t.appendChild(e)}_resetShadowParent(){const e=this;if(!window[n].EnableShadowDOM||null===e.shadowParent)return;const t=[];let r=e.parentNode;for(;r&&9!==r.nodeType;){if(r instanceof HTMLElement==1)t.push(r);else if(11===r.nodeType&&r.host){r=r.host;continue}r=r.parentNode}for(let n=0;n<t.length;n++)if(t[n]===e.shadowParent)return;t.length>0&&"HTML"===t[t.length-1].nodeName&&(e.shadowParent=null)}},Utilities:y,Import:function(e,t){let n=0;const r=function(e,t){return new Promise((n=>{const r=document.createElement("script");r.src=e,r.onload=n;for(let e=0;e<document.head.children.length;e++){const r=document.head.children[e];if(r.src&&r.src.toString().indexOf(t)>=0)return void n()}document.head.appendChild(r)}))};return new Promise((o=>{const i=y.Core.getScriptLocation(),s=function(t){if(!e[t])return;const a=i+"/"+e[t];r(a,e[t]).then((function(){n++,n===e.length&&o(),s(t+1)}))};if(t)for(let t=0;t<e.length;t++){const s=i+"/"+e[t];r(s,e[t]).then((function(){n++,n===e.length&&o()}))}else s(0)}))},ObservableArray:T,Observable:class{constructor(e,t){const n=this;var r;return this.name="observable",e&&Object.assign(n,e),r=e,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((e=>"constructor"===e||!!e.startsWith("_")||void(n[e]=r[e]))),new Proxy(n,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){return e[t]},set:function(e,r,o){const i=e[r];return i===o||(e[r]=o,!("notifyFn"!==r&&!r.startsWith("_")&&"canNotify"!==r&&(!t||-1!==t.indexOf(r))&&n.canNotify&&(n._notify({target:e,propertyName:r,oldValue:i,newValue:o}),0)))}})}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;if(t.canNotify&&t.notifyFn)for(let n=0;n<t.notifyFn.length;n++)t.notifyFn[n](e)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}},Component:class{constructor(e,t){const n=this.name;let r=null;return e?r=new window[n](e,t):(r=new window[n],r._initProperties=t),this._element=r,r}get name(){return"Component"}get element(){return this._element}},Theme:D.Theme||"",EnableShadowDOM:D.ShadowDom||!1,BaseUrl:"./",StyleBaseUrl:"/styles/default/",Version:e,Templates:t,RenderMode:D.RenderMode||"auto",Render:function(){const e=()=>{window[n].RenderMode="",L()};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))},Data:u,Mode:D.Mode||"production",License:D.License||"Evaluation"});let O=window[n].Theme;"manual"!==window[n].RenderMode&&document.addEventListener("readystatechange",L),Object.defineProperty(window[n],"Theme",{configurable:!1,enumerable:!0,get:()=>O,set(e){const t=O;O=e,w.fireEvent("theme-changed",{oldValue:t,newValue:e},{bubbles:!0,cancelable:!0})}}),window[n]("jqx-base-element",window[n].BaseElement),window[n]("jqx-content-element",class extends window[n].BaseElement{static get properties(){return{content:{type:"any",reflectToAttribute:!1},innerHTML:{type:"string",reflectToAttribute:!1}}}template(){return"<div inner-h-t-m-l='[[innerHTML]]'></div>"}ready(){super.ready(),this.applyContent()}refresh(){}clearContent(){const e=this;for(;e.$.content.firstChild;)e.$.content.removeChild(e.$.content.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.content);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let n=document.createElement("div");t.appendChild(n),e.content instanceof HTMLElement?n.appendChild(e.content):n.innerHTML=e.content;let r=Array.from(n.childNodes);n.parentNode.removeChild(n);for(let e=0;e<r.length;e++)t.appendChild(r[e]);e.clearContent(),e.$.content.appendChild(t)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const r=this;t!==n&&("innerHTML"===e&&(r.content=n,r.applyContent(),r.innerHTML=r.content=y.Core.html(r.$.content)),"content"===e&&r.applyContent())}}),window[n]("jqx-scroll-viewer",class extends window[n].ContentElement{static get properties(){return{autoRefresh:{type:"boolean",value:!1},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},touchScrollRatio:{type:"any",value:null},touchVelocityCoefficient:{type:"number",value:50},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{touchmove:"_touchmoveHandler",touchstart:"_touchstartHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler"}}static get styleUrls(){return["jqx.scrollviewer.css"]}template(){return'<div id="container" class="jqx-container" role="presentation">\n <div id="scrollViewerContainer" class="jqx-scroll-viewer-container" role="presentation">\n <div id="scrollViewerContentContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-scroll-viewer-content-container" role="presentation">\n <content></content>\n </div>\n </div>\n <jqx-scroll-bar id="verticalScrollBar" theme="[[theme]]" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></jqx-scroll-bar>\n <jqx-scroll-bar id="horizontalScrollBar" theme="[[theme]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></jqx-scroll-bar>\n </div>'}appendChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.appendChild(e)}}removeChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.removeChild(e)}}removeAll(){const e=this;e.isCompleted&&(e.$.scrollViewerContentContainer.innerHTML="")}_horizontalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.left=(t.rightToLeft?1:-1)*t.scrollLeft+"px",e.stopPropagation&&e.stopPropagation(),t.onHorizontalChange&&t.onHorizontalChange(e)}_verticalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.top=-t.scrollTop+"px",e.stopPropagation&&e.stopPropagation(),t.onVerticalChange&&t.onVerticalChange(e)}_touchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const n=t.scrollHeight>0,r=t.scrollWidth>0,o=t._touchCoords;if(!n&&!r||!o)return;const i=e.touches[0];let s,a,l,d;t._touchCoords=[i.pageX,i.pageY],n?(s=t.scrollTop,a=t.scrollHeight,l=i.pageY,d=o[1]):(s=t.scrollLeft,a=t.scrollWidth,l=i.pageX,d=o[0]);const c=parseFloat(l.toFixed(5)),u=parseFloat(d.toFixed(5));0===s&&c>=u||s===a&&c<=u||(l!==d&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_touchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_mouseWheelHandler(e){const t=this;if(!t.disabled&&(t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)){if(e.shiftKey&&t.computedHorizontalScrollBarVisibility){const n=t.scrollLeft;if(0===n&&e.deltaX<0||n===t.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth)))}if(t.computedVerticalScrollBarVisibility){const n=t.scrollTop;if(0===n&&e.deltaY<0||n===t.scrollHeight&&e.deltaY>0)return;if(e.stopPropagation(),e.preventDefault(),t.scrollHeight>0){t._wheelrafId=0;const n=()=>{t.scrollTop+=e.deltaY};cancelAnimationFrame(t._wheelrafId),t._wheelrafId=0,t._wheelrafId=requestAnimationFrame(n)}}}}_overriddenHandler(){}_upHandler(){delete this._touchCoords,delete this._touchmoveInside}_getScrollCoefficient(e,t){const n=e.deltaMode,r=Math.abs(e.deltaY);let o;return 0===n?o=r<100/3?r:t:1===n?o=r<1?r*(100/3):t:2===n&&(o=t),e.deltaY<0?-o:o}applyContent(){super.applyContent(),this.refresh()}get computedHorizontalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?!e._scrollView.hScrollBar.$.hasClass("jqx-hidden"):null}get computedVerticalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?!e._scrollView.vScrollBar.$.hasClass("jqx-hidden"):null}scrollTo(e,t){const n=this;n._scrollView&&(void 0!==e&&n._scrollView.scrollTo(e),void 0!==t&&n._scrollView.scrollTo(t,!1))}refreshScrollBarsVisibility(){const e=this;e._scrollView&&(e._scrollView.hScrollBar.disabled=e.disabled,e._scrollView.vScrollBar.disabled=e.disabled,"disabled"===e.horizontalScrollBarVisibility&&(e._scrollView.hScrollBar.disabled=!0),"disabled"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.disabled=!0),e.scrollWidth>0?e._scrollView.hScrollBar.$.removeClass("jqx-hidden"):"visible"!==e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("jqx-hidden"),e.scrollHeight>0?e._scrollView.vScrollBar.$.removeClass("jqx-hidden"):"visible"!==e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("jqx-hidden"),"hidden"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("jqx-hidden"),"hidden"===e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("jqx-hidden"),"visible"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.removeClass("jqx-hidden"),"visible"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.$.removeClass("jqx-hidden"),e.disabled||(e._scrollView.vScrollBar.disabled=e.scrollHeight<=0)),e.computedHorizontalScrollBarVisibility&&e.computedVerticalScrollBarVisibility?(e._scrollView.hScrollBar.$.addClass("bottom-corner"),e._scrollView.vScrollBar.$.addClass("bottom-corner")):(e._scrollView.hScrollBar.$.removeClass("bottom-corner"),e._scrollView.vScrollBar.$.removeClass("bottom-corner")))}ready(){super.ready();const e=this;e.$.verticalScrollBar.onChange=t=>{t.detail=t,e._verticalScrollbarHandler(t)},e.$.horizontalScrollBar.onChange=t=>{t.detail=t,e._horizontalScrollbarHandler(t)},e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._customScrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.refresh()}refresh(){const e=this;function t(){const t=e.$.scrollViewerContainer.classList.contains("vscroll");e.$.scrollViewerContainer.classList.remove("vscroll");const n=e.$.scrollViewerContentContainer.offsetWidth-e.$.scrollViewerContainer.offsetWidth;return n>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("hscroll"):e.$.scrollViewerContainer.classList.remove("hscroll"),t&&e.$.scrollViewerContainer.classList.add("vscroll"),n}function n(){let t;const n=e.$.scrollViewerContainer.classList.contains("hscroll");if(e.$.scrollViewerContainer.classList.remove("hscroll"),JQX.Utilities.Core.Browser.Safari){const n=e.$.scrollViewerContentContainer.getBoundingClientRect().height,r=e.$.scrollViewerContainer.getBoundingClientRect().height;t=n&&r?parseInt(n)-parseInt(r):e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight}else t=e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight;return e.virtualScrollHeight&&(t=e.virtualScrollHeight),t>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("vscroll"):e.$.scrollViewerContainer.classList.remove("vscroll"),n&&e.$.scrollViewerContainer.classList.add("hscroll"),t}if(!e.$.scrollViewerContentContainer)return;"hidden"===e.verticalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-vertical",""),"hidden"===e.horizontalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-horizontal","");let r=e.scrollWidth,o=e.scrollHeight;e.scrollWidth=t(),e.scrollHeight=n(),e.scrollHeight&&o===e.scrollHeight||(e.scrollWidth=t()),e.scrollWidth&&r===e.scrollWidth||(e.scrollHeight=n()),e.computedVerticalScrollBarVisibility&&(e.scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.computedHorizontalScrollBarVisibility&&(e.scrollWidth+=e._scrollView.vScrollBar.offsetWidth),0===e.scrollHeight&&e.scrollWidth>0&&e.$.container.offsetHeight-e.$.content.offsetHeight<5&&(e.$.container.style.paddingBottom=e._scrollView.hScrollBar.offsetHeight+"px"),e.autoRefresh&&(e.$.scrollViewerContainer.scrollLeft=0,e.$.scrollViewerContainer.scrollTop=0)}attached(){const e=this;super.attached(),e._scrollView||e._customScrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar))}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView)}get scrollWidth(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?1===e._scrollView.hScrollBar.max&&"visible"===e.horizontalScrollBarVisibility?0:e._scrollView.hScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(0===e&&"visible"===t.horizontalScrollBarVisibility?t._scrollView.hScrollBar.max=0:t._scrollView.hScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollHeight(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?1===e._scrollView.vScrollBar.max&&"visible"===e.verticalScrollBarVisibility?0:e._scrollView.vScrollBar.max:0}set scrollHeight(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(0===e&&"visible"===t.verticalScrollBarVisibility?t._scrollView.vScrollBar.max=1:t._scrollView.vScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollLeft(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?e._scrollView.hScrollBar.value:0}set scrollLeft(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(t._scrollView.hScrollBar.value=e)}get scrollTop(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?e._scrollView.vScrollBar.value:0}set scrollTop(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(t._scrollView.vScrollBar.value=e)}propertyChangedHandler(e,t,n){const r=this;super.propertyChangedHandler(e,t,n),"animation"!==e&&"theme"!==e&&r.refresh()}}),window[n].Utilities.Assign("PositionDetection",class{constructor(e,t,n,r){const o=this;if(t){const n="dropDown"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);t.id=n,e.setAttribute("aria-owns",n)}o.context=e,o.dropDown=t,o.defaultParent=n,o.closeMethod=r}handleAutoPositioning(){const e=this,t=e.context;if("auto"!==t.dropDownPosition||t.disabled||t.isHidden)return;const n=window.requestAnimationFrame;let r,o=Date.now();return r=n((function i(){t.isHidden||document.hidden||(r=n(i),"auto"===t.dropDownPosition&&!t.disabled&&(t.isInShadowDOM?document.body.contains(t.shadowParent):document.body.contains(t))||cancelAnimationFrame(r),t.isHidden&&cancelAnimationFrame(r),Date.now()-o>=200&&(e.scrollHandler(),o=Date.now()))}))}checkBrowserBounds(e){const t=this.context;if("auto"===t.dropDownPosition&&!t.disabled)switch(e){case"vertically":this.checkBrowserBoundsVertically();break;case"horizontally":this.checkBrowserBoundsHorizontally();break;default:this.checkBrowserBoundsVertically(),this.checkBrowserBoundsHorizontally()}}checkBrowserBoundsHorizontally(){const e=this.context,t=this.dropDown;let n,r=0;a.isMobile||window.innerWidth===document.documentElement.clientWidth||(r=window.innerWidth-document.documentElement.clientWidth),null!==e._dropDownParent?n=!0:t.style.left="";const o=window.innerWidth-r;let i=e.getBoundingClientRect().left;if(i<0&&(t.style.left=(n?0:Math.abs(i))+"px",i=parseFloat(t.style.left)),i+t.offsetWidth>o){let e=i-Math.abs(o-i-t.offsetWidth);n&&(e+=window.pageXOffset),t.style.left=(n?e:e-i)+"px",window.innerWidth===document.documentElement.clientWidth&&(t.style.left=parseFloat(t.style.left)+r+"px"),n&&window.innerHeight===document.documentElement.clientHeight&&this.positionDropDown(!0)}}checkBrowserBoundsVertically(e){const t=this.context,n=this.dropDown,r=t._dropDownListPosition;e||(e=t.getBoundingClientRect()),0!==e.height&&(document.documentElement.clientHeight-Math.abs(e.top+e.height+n.offsetHeight)>=0?t._dropDownListPosition="bottom":e.top-n.offsetHeight>=0?t._dropDownListPosition="top":t._dropDownListPosition="overlay-center",this.updatePositionAttribute(r,t._dropDownListPosition))}scrollHandler(){const e=this.context;if(!e.parentElement)return;const t=e.getBoundingClientRect();if(t.top===e._positionTop)return;const n=e._dropDownListPosition;this.checkBrowserBoundsVertically(t),e._dropDownListPosition!==n&&this.positionDropDown(),e._positionTop=t.top}getDropDownParent(e){const t=this.context,n=this.dropDown;let r=t.dropDownAppendTo;t._positionedParent=null,null===r?t._dropDownParent=null:"body"===r||r===document.body?t.getRootNode().host?t._dropDownParent=t.getRootNode().host.shadowRoot:t._dropDownParent=document.body:r instanceof HTMLElement?t._dropDownParent=r:"string"==typeof r?(r=document.getElementById(r),r instanceof HTMLElement?t._dropDownParent=r:(t.dropDownAppendTo=null,t._dropDownParent=null)):(t.dropDownAppendTo=null,t._dropDownParent=null);let o=t._dropDownParent;if(null!==o){for(;o&&o instanceof HTMLElement&&"static"===window.getComputedStyle(o).position&&o!==t.getShadowRootOrBody();)o=o.parentElement;o===document.body?t._positionedParent=null:t._positionedParent=o,n&&(n.setAttribute("animation",t.animation),""!==t.theme&&n.$.addClass(t.theme),e&&(t._dropDownParent.appendChild(n),n.$.addClass("jqx-drop-down-repositioned")),-1===t.detachedChildren.indexOf(n)&&t.detachedChildren.push(n))}}dropDownAppendToChangedHandler(){const e=this.context,t=this.dropDown,n=e._dropDownParent;this.getDropDownParent(),e._dropDownParent!==n&&(e[this.closeMethod](),["left","top","font-size","font-family","font-style","font-weight"].forEach((e=>t.style[e]=null)),null===e._dropDownParent?(this.defaultParent.appendChild(t),t.$.removeClass("jqx-drop-down-repositioned")):(e._dropDownParent.appendChild(t),t.$.addClass("jqx-drop-down-repositioned")))}dropDownPositionChangedHandler(){const e=this;e.dropDown.style.transition="none",e.context[e.closeMethod](),e.setDropDownPosition(),e.handleAutoPositioning()}dropDownAttached(e){const t=this.context;null!==t._dropDownParent&&(t._dropDownParent.appendChild(this.dropDown),this.handleAutoPositioning(),e&&t[e]())}dropDownDetached(){const e=this.context;null!==e._dropDownParent&&document.body.contains(this.dropDown)&&document.body.contains(e._dropDownParent)&&e._dropDownParent.removeChild(this.dropDown)}setDropDownPosition(){const e=this.context,t=e.dropDownPosition,n=e._dropDownListPosition;"auto"===t?this.checkBrowserBounds():e._dropDownListPosition=t,this.updatePositionAttribute(n,e._dropDownListPosition)}updatePositionAttribute(e,t){const n=this.context,r=this.dropDown;n.$.dropDownButton&&!n.$.dropDownButton.hasAttribute(t)&&(n.$.dropDownButton.removeAttribute(e),n.$.dropDownButton.setAttribute(t,"")),r.hasAttribute(t)||(r.style.transition="none",r.removeAttribute(e),r.setAttribute(t,""),requestAnimationFrame((function(){r.style.transition=null})))}positionDropDown(e){const t=this.context,n=this.dropDown;if(!t.opened||null===t._dropDownParent)return;const r=t.getBoundingClientRect();let o,i;if(this.customPositionDropDown){const e=this.customPositionDropDown(r);o=e.left,i=e.top}else switch(o=r.left,i=r.top,t._dropDownListPosition){case"bottom":i+=t.$.container.offsetHeight-1;break;case"center-bottom":i+=t.$.container.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"center-top":i-=n.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"top":i-=n.offsetHeight-1;break;case"overlay-bottom":break;case"overlay-center":i-=n.offsetHeight/2-t.offsetHeight/2;break;case"overlay-top":i-=n.offsetHeight-t.offsetHeight}const s=this.getDropDownOffset();n.style.top=i+s.y+"px",e||(n.style.left=o+s.x+"px")}getDropDownOffset(){const e=this.context._positionedParent;let t,n;if(e&&"#document-fragment"!==e.nodeName){const r=e.getBoundingClientRect();t=-r.left,n=-r.top}else t=window.pageXOffset,n=window.pageYOffset;return{x:t,y:n}}placeOverlay(){const e=this.context;if(!e.dropDownOverlay||e._overlay)return;const t=document.createElement("div");t.classList.add("jqx-drop-down-overlay"),t.style.width=document.documentElement.scrollWidth+"px",t.style.height=document.documentElement.scrollHeight+"px",document.body.appendChild(t),e._overlay=t}removeOverlay(e){const t=this,n=t.context;n._overlay&&(n.hasAnimation&&e?requestAnimationFrame((function e(){t.dropDown.getBoundingClientRect().height>0?requestAnimationFrame(e):(document.body.removeChild(n._overlay),delete n._overlay)})):(document.body.removeChild(n._overlay),delete n._overlay))}}),window.JQX.Color=class{constructor(e){if(window.JQX._colors||(window.JQX._colors=[]),window.JQX._colors[e]){const t=window.JQX._colors[e];return this.hex=t.hex,this.r=t.r,this.g=t.g,void(this.b=t.b)}this.r=this.g=this.b=0,this.hex="";const t=this.getStandardizedColor(e);t&&(this.setHex(t.substring(1)),window.JQX._colors[e]={hex:this.hex,r:this.r,g:this.g,b:this.b})}getStandardizedColor(e){const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle}getInvertedColor(){return""===this.hex?"transparent":255-(.299*this.r+.587*this.g+.114*this.b)<105?"Black":"White"}hexToRgb(e){let t="00",n="00",r="00";return 6===(e=this.validateHex(e)).length?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r)}}validateHex(e){return(e=(e=new String(e).toUpperCase()).replace(/[^A-F0-9]/g,"0")).length>6&&(e=e.substring(0,6)),e}webSafeDec(e){return e=Math.round(e/51),e*=51}hexToWebSafe(e){let t,n,r;return 3===e.length?(t=e.substring(0,1),n=e.substring(1,1),r=e.substring(2,1)):(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)),this.intToHex(this.webSafeDec(this.hexToInt(t)))+this.intToHex(this.webSafeDec(this.hexToInt(n)))+this.intToHex(this.webSafeDec(this.hexToInt(r)))}rgbToWebSafe(e){return{r:this.webSafeDec(e.r),g:this.webSafeDec(e.g),b:this.webSafeDec(e.b)}}rgbToHex(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)}intToHex(e){let t=parseInt(e).toString(16);return 1===t.length&&(t="0"+t),t.toUpperCase()}hexToInt(e){return parseInt(e,16)}setRgb(e,t,n){let r=function(e){return e<0||e>255||isNaN(parseInt(e))?0:e};this.r=r(e),this.g=r(t),this.b=r(n),this.hex=this.rgbToHex(this)}setHex(e){this.hex=e;let t=this.hexToRgb(this.hex);this.r=t.r,this.g=t.g,this.b=t.b}}}();
62
+ !function(){const e="16.0.0",t=[];let n="JQX";if(window[n]&&window[n].Version){if(window[n].Version===e)return;if(window[n].Version!==e)n+=e;else{let e=2;for(;window[n];)n+=e.toString(),e++}}const r=navigator.userAgent.indexOf("Edge")>-1&&navigator.appVersion.indexOf("Edge")>-1;document.elementsFromPoint||(document.elementsFromPoint=document.msElementsFromPoint);class o{static isBoolean(e){return"boolean"==typeof e}static isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)}static isArray(e){return Array.isArray(e)}static isObject(e){return e&&("object"==typeof e||this.isFunction(e))||!1}static isDate(e){return e instanceof Date}static isString(e){return"string"==typeof e}static isNumber(e){return"number"==typeof e}static getType(e){const t=this,n=["Boolean","Number","String","Function","Array","Date","Object"].find((n=>{if(t["is"+n](e))return n}));return n?n.toLowerCase():void 0}}class i{static animate(e,t,r,o){const i=e;if(!i||i instanceof HTMLElement==0)return;if(0===i.getElementsByClassName("jqx-ripple").length){const e=document.createElement("span");e.classList.add("jqx-ripple"),e.setAttribute("role","presentation");let t=!0,r=null;if(window[n].EnableShadowDOM&&i.enableShadowDOM&&!0!==i.isInShadowDOM){for(let e=0;e<i.shadowRoot.host.shadowRoot.children.length;e++)"link"!==i.shadowRoot.host.shadowRoot.children[e].tagName.toLowerCase()&&(r=i.shadowRoot.host.shadowRoot.children[e]);i.shadowRoot.host.shadowRoot.querySelector(".jqx-ripple")&&(t=!1)}else r=i.firstElementChild;t&&(r&&!r.noRipple&&r.offsetHeight>0?r.appendChild(e):i.appendChild(e))}let s=null;if(s=window[n].EnableShadowDOM&&i.shadowRoot?i.shadowRoot.host.shadowRoot.querySelector(".jqx-ripple"):i.getElementsByClassName("jqx-ripple")[0],!s)return;s.innerHTML="",s.classList.remove("jqx-animate"),s.style.height=s.style.width=Math.max(i.offsetHeight,i.offsetWidth)+"px";const a=window.getComputedStyle(s.parentElement),l=parseInt(a.borderLeftWidth)||0,d=parseInt(a.borderTopWidth)||0,c=i.getBoundingClientRect(),u=t-(c.left+window.pageXOffset)-s.offsetWidth/2-l,p=r-(c.top+window.pageYOffset)-s.offsetHeight/2-d;s.style.left=u+"px",s.style.top=p+"px",s.classList.add("jqx-animate"),s.addEventListener("animationend",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationend",e),s.removeEventListener("animationcancel",e)})),s.addEventListener("animationcancel",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationcancel",e),s.removeEventListener("animationend",e)}))}}class s{static easeInQuad(e,t,n,r){return n*(e/=r)*e+t}static easeOutQuad(e,t,n,r){return-n*(e/=r)*(e-2)+t}static easeInOutQuad(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}static easeInCubic(e,t,n,r){return n*(e/=r)*e*e+t}static easeOutCubic(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}static easeInOutCubic(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t}static easeInQuart(e,t,n,r){return n*(e/=r)*e*e*e+t}static easeOutQuart(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t}static easeInOutQuart(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}static easeInQuint(e,t,n,r){return n*(e/=r)*e*e*e*e+t}static easeOutQuint(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t}static easeInOutQuint(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t}static easeInSine(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}static easeOutSine(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t}static easeInOutSine(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t}static easeInExpo(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t}static easeOutExpo(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t}static easeInOutExpo(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t}static easeInCirc(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t}static easeOutCirc(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t}static easeInOutCirc(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t}static easeInElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),-s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)+t)}static easeOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),s*Math.pow(2,-10*e)*Math.sin((e*r-o)*(2*Math.PI)/i)+n+t)}static easeInOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:2==(e/=r/2)?t+n:(i||(i=r*(.3*1.5)),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*.5+n+t)}static easeInBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*(e/=r)*e*((o+1)*e-o)+t}static easeOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*((e=e/r-1)*e*((o+1)*e+o)+1)+t}static easeInOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t}static easeInBounce(e,t,n,r){return n-this.easeOutBounce(r-e,0,n,r)+t}static easeOutBounce(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}static easeInOutBounce(e,t,n,r){return e<r/2?.5*this.easeInBounce(2*e,0,n,r)+t:.5*this.easeOutBounce(2*e-r,0,n,r)+.5*n+t}}class a{static get isMobile(){const e=/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());return e||["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}static get Browser(){let e;const t=function(t){let n=t.indexOf(e);if(-1===n)return;const r=t.indexOf("rv:");return"Trident"===e&&-1!==r?parseFloat(t.substring(r+3)):parseFloat(t.substring(n+e.length+1))};let n={};return n[function(){const t=[{string:navigator.userAgent,subString:"Edge",identity:"Edge"},{string:navigator.userAgent,subString:"MSIE",identity:"IE"},{string:navigator.userAgent,subString:"Trident",identity:"IE"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Opera",identity:"Opera"},{string:navigator.userAgent,subString:"OPR",identity:"Opera"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"Safari",identity:"Safari"}];for(let n=0;n<t.length;n++){let r=t[n].string;if(e=t[n].subString,-1!==r.indexOf(t[n].subString))return t[n].identity}return"Other"}()]=!0,n.version=t(navigator.userAgent)||t(navigator.appVersion)||"Unknown",n}static toCamelCase(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}static toDash(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}static unescapeHTML(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}static escapeHTML(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(e).replace(/[&<>"'`=\/]/g,(e=>t[e]))}static sanitizeHTML(e){if(e&&(e.indexOf("onclick")>=0||e.indexOf("onload")>=0||e.indexOf("onerror")>=0))return this.escapeHTML(e);const t=new RegExp("<s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<s*/s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>","ig");return String(e).replace(t,(e=>this.escapeHTML(e)))}static createGUID(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}static getScriptLocation(){return"./"!==window[n].BaseUrl?window[n].BaseUrl:function(){if(document.currentScript){let e=document.currentScript.src,t=e.lastIndexOf("/");return e=e.substring(0,t),e}const e=new Error;let t="(",n=")";if(JQX.Utilities.Core.Browser.Safari&&(t="@",n="\n"),e.fileName)return e.fileName.replace("/jqx.element.js","");let r=e.stack.split(t);return r=r[1],r=r.split(n)[0],r=r.split(":"),r.splice(-2,2),r=r.join(":"),r.replace("/jqx.element.js","")}()}static CSSVariablesSupport(){return window.CSS&&window.CSS.supports&&window.CSS.supports("(--fake-var: 0)")}static assign(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&null!==e;let r=Object.assign({},e);return n(e)&&n(t)&&Object.keys(t).forEach((o=>{n(t[o])?o in e?r[o]=this.assign(e[o],t[o]):Object.assign(r,{[o]:t[o]}):Object.assign(r,{[o]:t[o]})})),r}static html(e,t){const n=this;let r="",o=e.childNodes;if(!t){for(let e,t=0,i=o.length;t<i&&(e=o[t]);t++){const t=["strong"];if(e instanceof HTMLElement||e.tagName&&t.indexOf(e.tagName.toLowerCase())>=0){const t=e.tagName.toLowerCase(),o=e.attributes;let i="<"+t;for(let e,t=0;e=o[t];t++)i+=" "+e.name+'="'+e.value.replace(/[&\u00A0"]/g,y.Core.escapeHTML)+'"';i+=">",["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"][t]&&(r+=i),r=r+i+n.html(e)+"</"+t+">"}else{if(8===e.nodeType)continue;r+=e.textContent.replace(/[&\u00A0<>]/g,y.Core.escapeHTML)}}return r}{const n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;e.innerHTML=t.replace(n,"<$1></$2>")}}}let l=[];class d{static watch(e){switch(e.nodeName.toLowerCase()){case"jqx-grid":case"jqx-kanban":case"jqx-table":case"jqx-pivot-table":case"jqx-scheduler":case"jqx-tabs":case"jqx-card-view":case"jqx-list-box":case"jqx-combo-box":case"jqx-drop-down-list":case"jqx-calendar":case"jqx-gauge":case"jqx-numeric-text-box":case"jqx-menu":case"jqx-tree":l.push(e);break;default:return}d.start()}static start(){d.isStarted||(d.isStarted=!0,d.interval&&clearInterval(d.interval),0===l.length||document.hidden?d.isStarted=!1:d.interval=setInterval((function(){d.observe()}),100))}static stop(){d.isStarted=!1,d.interval&&clearInterval(d.interval)}static observeElement(e){const t=e;if("test"===window.JQX.Mode||document.hidden)return void(d.interval&&clearInterval(d.interval));let n=e._computedStyle||"resize"!==t.hasStyleObserver?document.defaultView.getComputedStyle(t,null):{},r=!0,o="resize"!==t.hasStyleObserver?["paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","display","visibility","font-size","font-family","font-style","font-weight","max-height","min-height","max-width","min-width","overflow","overflow-x","overflow-y"]:[];if(e.styleProperties&&(o=o.concat(e.styleProperties)),e.observableStyleProperties&&(o=e.observableStyleProperties),!t._styleInfo){t._styleInfo=[];for(let e=0;e<o.length;e++){const r=o[e],i=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]=i}return}if(e.isHidden||"none"!==n.display&&(0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0)),e.isHidden){if(e.visibilityChangedHandler(),e.isHidden)return;r=!1}let i=[];for(let e=0;e<o.length;e++){const r=o[e],s=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]!==s&&(i[r]={oldValue:t._styleInfo[r],value:s},i.length++),t._styleInfo[r]=s}i.length>0&&(t.$.fireEvent("styleChanged",{styleProperties:i},{bubbles:!1,cancelable:!0}),i.display&&r&&t.$.fireEvent("resize",t,{bubbles:!1,cancelable:!0}))}static observe(){for(let e=0;e<l.length;e++){const t=l[e];this.observeElement(t)}}static unwatch(e){d.stop();const t=l.indexOf(e);-1!==t&&l.splice(t,1),d.start()}}let c=[];const u=[],p=["resize","down","up","move","tap","taphold","swipeleft","swiperight","swipetop","swipebottom"];class h{constructor(e){const t=this;t.target=e,t.$target=new f(e),t.$document=e.$document?e.$document:new f(document),t.id=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase();let n={handlers:{},boundEventTypes:[],listen:t.listen.bind(t),unlisten:t.unlisten.bind(t)};return t.tapHoldDelay=750,t.swipeMin=10,t.swipeMax=5e3,t.swipeDelay=1e3,t.tapHoldDelay=750,t.inputEventProperties=["clientX","clientY","pageX","pageY","screenX","screenY"],p.forEach((e=>{n[e]=t=>{n.handlers[e]=t},t[e]=e=>{if(!n.handlers[e.type]){if(("mousemove"===e.type||"pointermove"===e.type||"touchmove"===e.type)&&n.handlers.move){const r=t.createEvent(e,"move");n.handlers.move(r)}return!0}return n.handlers[e.type](e)}})),t.listen(),t.handlers=n.handlers,n}listen(e){const t=this;if("resize"===e&&t.target!==document&&t.target!==window&&!1!==t.target.hasResizeObserver)if(JQX.Utilities.Core.Browser.Firefox){if(!t.target.resizeObserver){let e,n,r,o=!1,i=t.target.offsetWidth,s=t.target.offsetHeight;const a=new ResizeObserver((()=>{if(!o)return void(o=!0);const a=new CustomEvent("resize",{bubbles:!1,cancelable:!0});n=t.target.offsetWidth,r=t.target.offsetHeight,e=n!==i||r!==s,t.target.requiresLayout&&(e=!0),e&&(t.resize(a),t.target.requiresLayout=!1)}));a.observe(t.target),t.target.resizeObserver=a}}else if(!t.target.resizeTrigger){const e=document.createElement("div");e.className="jqx-resize-trigger-container",e.innerHTML='<div class="jqx-resize-trigger-container"><div class="jqx-resize-trigger"></div></div><div class="jqx-resize-trigger-container"><div class="jqx-resize-trigger-shrink"></div></div>',e.setAttribute("aria-hidden",!0),window[n].EnableShadowDOM&&t.target.shadowRoot?t.target.shadowRoot.appendChild(e):t.target.appendChild(e),t.target.resizeTrigger=e;const r=e.childNodes[0],o=r.childNodes[0],i=e.childNodes[1],s=function(){o.style.width="100000px",o.style.height="100000px",r.scrollLeft=1e5,r.scrollTop=1e5,i.scrollLeft=1e5,i.scrollTop=1e5};let a,l,d,c,u=t.target.offsetWidth,p=t.target.offsetHeight;if(0===u||0===p){const e=function(){s(),t.target.removeEventListener("resize",e)};t.target.addEventListener("resize",e),s()}else s();t.target.resizeHandler=function(){l||(l=requestAnimationFrame((function(){if(l=0,d=t.target.offsetWidth,c=t.target.offsetHeight,a=d!==u||c!==p,t.target.requiresLayout&&(a=!0),!a)return;u=d,p=c;const e=new CustomEvent("resize",{bubbles:!1,cancelable:!0});t.resize(e),t.target.requiresLayout=!1}))),s()},r.addEventListener("scroll",t.target.resizeHandler),i.addEventListener("scroll",t.target.resizeHandler)}t.isListening||(t.isListening=!0,t.isPressed=!1,t.isReleased=!1,t.isInBounds=!1,window.PointerEvent?(t.$target.listen("pointerdown.inputEvents"+t.id,t.pointerDown.bind(t)),t.$target.listen("pointerup.inputEvents"+t.id,t.pointerUp.bind(t)),t.$target.listen("pointermove.inputEvents"+t.id,t.pointerMove.bind(t)),t.$target.listen("pointercancel.inputEvents"+t.id,t.pointerCancel.bind(t))):("ontouchstart"in window&&(t.$target.listen("touchmove.inputEvents"+t.id,t.touchMove.bind(t)),t.$target.listen("touchstart.inputEvents"+t.id,t.touchStart.bind(t)),t.$target.listen("touchend.inputEvents"+t.id,t.touchEnd.bind(t)),t.$target.listen("touchcancel.inputEvents"+t.id,t.touchCancel.bind(t))),t.$target.listen("mousedown.inputEvents"+t.id,t.mouseDown.bind(t)),t.$target.listen("mouseup.inputEvents"+t.id,t.mouseUp.bind(t)),t.$target.listen("mousemove.inputEvents"+t.id,t.mouseMove.bind(t)),t.$target.listen("mouseleave.inputEvents"+t.id,t.mouseLeave.bind(t))),t.target._handleDocumentUp||(t.target._handleDocumentUp=t.handleDocumentUp.bind(t),t.target._handleDocumentUpId=t.id,t.$document.listen("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp)))}unlisten(e){const t=this;if(t.isListening=!1,window.PointerEvent?(t.$target.unlisten("pointerdown.inputEvents"+t.id),t.$target.unlisten("pointerup.inputEvents"+t.id),t.$target.unlisten("pointermove.inputEvents"+t.id),t.$target.unlisten("pointercancel.inputEvents"+t.id)):("ontouchstart"in window&&(t.$target.unlisten("touchstart.inputEvents"+t.id),t.$target.unlisten("touchmove.inputEvents"+t.id),t.$target.unlisten("touchend.inputEvents"+t.id),t.$target.unlisten("touchcancel.inputEvents"+t.id)),t.$target.unlisten("mousedown.inputEvents"+t.id),t.$target.unlisten("mouseup.inputEvents"+t.id),t.$target.unlisten("mousemove.inputEvents"+t.id),t.$target.unlisten("mouseleave.inputEvents"+t.id)),t.target._handleDocumentUp&&(t.$document.unlisten("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp),delete t.target._handleDocumentUp,delete t.target._handleDocumentUpId),"resize"===e)if(JQX.Utilities.Core.Browser.Firefox)t.target.resizeObserver&&(t.target.resizeObserver.unobserve(t.target),delete t.target.resizeObserver);else if(t.target.resizeTrigger){const e=t.target.resizeTrigger,n=e.childNodes[0],r=e.childNodes[1];n.removeEventListener("scroll",t.target.resizeHandler),r.removeEventListener("scroll",t.target.resizeHandler),t.target.resizeHandler=null,e.parentNode.removeChild(e),delete t.target.resizeTrigger}}handleDocumentUp(e){const t=this;t.isPressed=!1,t.isReleased=!1,t.resetSwipe(e)}createEvent(e,t){const n=this,r=e.touches,o=e.changedTouches,i=r&&r.length?r[0]:o&&o.length?o[0]:void 0,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:void 0!==n.$target.element.getRootNode().host});if(s.originalEvent=e,i){for(let e=0;e<n.inputEventProperties.length;e++){const t=n.inputEventProperties[e];s[t]=i[t]}return s}for(let t in e)t in s||(s[t]=e[t]);return s}fireTap(e){const t=this;if(clearTimeout(this.tapHoldTimeout),!this.tapHoldFired&&this.isInBounds){const n=t.createEvent(e,"tap");t.tap(n)}}initTap(e){const t=this;t.isInBounds=!0,t.tapHoldFired=!1,t.tapHoldTimeout=setTimeout((function(){if(t.isInBounds){t.tapHoldFired=!0;const n=t.createEvent(e,"taphold");t.taphold(n)}}),t.tapHoldDelay)}pointerDown(e){return this.handleDown(e)}mouseDown(e){const t=this;if(!(t.isPressed||t.touchStartTime&&new Date-t.touchStartTime<500))return t.handleDown(e)}touchStart(e){const t=this;return t.touchStartTime=new Date,t.isTouchMoved=!0,t.handleDown(e)}mouseUp(e){const t=this;if(!(t.isReleased||t.touchEndTime&&new Date-t.touchEndTime<500))return t.handleUp(e)}handleDown(e){const t=this;t.isReleased=!1,t.isPressed=!0;const n=t.createEvent(e,"down");return(t.handlers.tap||t.handlers.taphold)&&t.initTap(n),(t.handlers.swipeleft||t.handlers.swiperight||t.handlers.swipetop||t.handlers.swipebottom)&&t.initSwipe(n),t.down(n)}handleUp(e){const t=this;t.isReleased=!0,t.isPressed=!1;const n=t.createEvent(e,"up"),r=t.up(n);return(t.handlers.tap||t.handlers.taphold)&&t.fireTap(n),t.resetSwipe(n),r}handleMove(e){const t=this;let n=t.move(e);return t.isPressed&&(t._maxSwipeVerticalDistance=Math.max(t._maxSwipeVerticalDistance,Math.abs(t._startY-e.pageY)),t._maxSwipeHorizontalDistance=Math.max(t._maxSwipeHorizontalDistance,Math.abs(t._startX-e.pageX)),n=t.handleSwipeEvents(e)),n}touchEnd(e){return this.touchEndTime=new Date,this.handleUp(e)}pointerUp(e){return this.handleUp(e)}pointerCancel(e){this.pointerUp(e)}touchCancel(e){this.touchEnd(e)}mouseLeave(){this.isInBounds=!1}mouseMove(e){if(!this.isTouchMoved)return this.handleMove(e)}pointerMove(e){return this.handleMove(e)}touchMove(e){const t=this,n=e.touches,r=e.changedTouches,o=n&&n.length?n[0]:r&&r.length?r[0]:void 0;for(let n=0;n<t.inputEventProperties.length;n++){const r=t.inputEventProperties[n];void 0===e[r]&&(e[r]=o[r])}return t.isTouchMoved=!0,t.handleMove(e)}handleSwipeEvents(e){const t=this;let n=!0;return(t.handlers.swipetop||t.handlers.swipebottom)&&(n=this.handleVerticalSwipeEvents(e)),!1===n||(t.handlers.swipeleft||t.handlers.swiperight)&&(n=this.handleHorizontalSwipeEvents(e)),n}handleVerticalSwipeEvents(e){let t,n;return t=e.pageY,n=t-this._startY,this.swiped(e,n,"vertical")}handleHorizontalSwipeEvents(e){let t,n;return t=e.pageX,n=t-this._startX,this.swiped(e,n,"horizontal")}swiped(e,t,n){const r=this;if(n=n||0,Math.abs(t)>=r.swipeMin&&!r._swipeEvent&&!r._swipeLocked){let o=t<0?"swipeleft":"swiperight";if("horizontal"===n?r._swipeEvent=r.createEvent(e,o):(o=t<0?"swipetop":"swipebottom",r._swipeEvent=r.createEvent(e,t<0?"swipetop":"swipebottom")),r[o]&&(r[o](this._swipeEvent),Math.abs(t)<=this.swipeMax))return e.stopImmediatePropagation(),!1}return!0}resetSwipe(){this._swipeEvent=null,clearTimeout(this._swipeTimeout)}initSwipe(e){const t=this;t._maxSwipeVerticalDistance=0,t._maxSwipeHorizontalDistance=0,t._startX=e.pageX,t._startY=e.pageY,t._swipeLocked=!1,t._swipeEvent=null,t._swipeTimeout=setTimeout((function(){t._swipeLocked=!0}),t.swipeDelay)}}class m{get scrollWidth(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.max=e)}get scrollHeight(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.max:-1}set scrollHeight(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.max=e)}get scrollLeft(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.value:-1}set scrollLeft(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.value=e)}get scrollTop(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.value:-1}set scrollTop(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.value=e)}get vScrollBar(){return this.verticalScrollBar}get hScrollBar(){return this.horizontalScrollBar}constructor(e,t,n){const r=this;r.container=e,r.horizontalScrollBar=t,r.verticalScrollBar=n,r.disableSwipeScroll=!1,r.listen()}listen(){const e=this,t=a.isMobile,n=e.horizontalScrollBar,r=e.verticalScrollBar;let o,i,s,l,d,c,u,p;e.inputEvents=new h(e.container);const m=function(e){return{amplitude:0,delta:0,initialValue:0,min:0,max:e.max,previousValue:0,pointerPosition:0,targetValue:0,scrollBar:e,value:0,velocity:0}},f=m(n),g=m(r),w=function(){const t=e.container.touchVelocityCoefficient||50;c=Date.now(),u=c-l,l=c;const n=function(e){e.delta=e.value-e.previousValue,e.previousValue=e.value;let n=t*e.delta/(1+u);e.velocity=.8*n+.2*e.velocity};n(g),n(f)},b=function(e){return p.value=e>p.max?p.max:e<p.min?p.min:e,p.scrollBar.value=p.value,e>p.max?"max":e<p.min?"min":"value"};function v(){let t,n;p.amplitude&&(e.container.$.fireEvent("kineticScroll"),t=Date.now()-l,n=-p.amplitude*Math.exp(-t/500),n>5||n<-5?(b(p.targetValue+n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(v)):b(p.targetValue))}let _;e.inputEvents.down((function(n){if(!t)return;const r=n.originalEvent.target,i=r&&r.closest?r.closest("jqx-scroll-bar"):void 0;if(i===e.horizontalScrollBar||i===e.verticalScrollBar)return;s=!0,o=!1;const a=function(e,t){e.amplitude=0,e.pointerPosition=t,e.previousValue=e.value,e.value=e.scrollBar.value,e.initialValue=e.value,e.max=e.scrollBar.max};a(g,n.clientY),a(f,n.clientX),l=Date.now(),clearInterval(d),d=setInterval(w,500)})),e.inputEvents.up((function(){if(!s)return!0;if(clearInterval(d),e.disableSwipeScroll)return void(s=!1);const t=function(e){p=e,e.amplitude=.8*e.velocity,e.targetValue=Math.round(e.value+e.amplitude),l=Date.now(),cancelAnimationFrame(i),i=requestAnimationFrame(v),e.velocity=0};g.velocity>10||g.velocity<-10?t(g):(f.velocity>10||f.velocity<-10)&&t(f),s=!1})),e.inputEvents.move((function(t){if(!s)return!0;if(e.disableSwipeScroll)return;if(o&&(t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()),f.visible=e.scrollWidth>0,g.visible=e.scrollHeight>0,!s||!f.visible&&!g.visible)return;const n=e.container.touchScrollRatio,r=e.container;let i,a;n&&("number"==typeof n?(i=-n,a=-n):"function"==typeof n&&(i=n(g.max,r.offsetHeight),a=n(f.max,r.offsetWidth))),g.ratio=i||-g.max/r.offsetHeight,g.delta=(t.clientY-g.pointerPosition)*g.ratio,f.ratio=a||-f.max/r.offsetWidth,f.delta=(t.clientX-f.pointerPosition)*f.ratio;let l="value";const d=function(t,n,r){return t.delta>5||t.delta<-5?(p=t,l=t.initialValue+t.delta>p.max?"max":t.initialValue+t.delta<p.min?"min":"value","min"===l&&0===t.initialValue||"max"===l&&t.initialValue===t.max||!t.visible||(e.container.$.fireEvent("kineticScroll"),b(t.initialValue+t.delta),w(),r.originalEvent.preventDefault(),r.originalEvent.stopPropagation(),o=!0,!1)):null};let c=d(g,t.clientY,t);if(null!==c)return c;{let e=d(f,t.clientX,t);if(null!==e)return e}})),e.scrollTo=function(t,n){const r=!1===n?f:g;let o=!1;l||(l=Date.now()),_||(_=Date.now()),Math.abs(Date.now()-_)>375?l=Date.now():o=!0,_=Date.now(),r.value=r.scrollBar.value,r.delta=t-r.value,r.max=r.scrollBar.max,t<=r.min&&(t=r.min),t>=r.max&&(t=r.max),r.targetValue=t;const s=t;let a=r.value;r.velocity=100*r.delta/(1+r.max),r.from=a;const d=function(e){return r.value=e>r.max?r.max:e<r.min?r.min:e,r.scrollBar.value=r.value,e>r.max?"max":e<r.min?"min":"value"},c=function(){let n,u=Date.now()-_,p=Math.min(1e3,Date.now()-l),h=r.velocity*Math.exp(p/175);if(o)(h<0&&r.value<=t||h>0&&r.value>=t)&&(h=0),(r.value+h<=r.min||r.value+h>=r.max)&&(h=0),h>.5||h<-.5?(d(r.value+h),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)):d(r.targetValue);else{if(u>=175)return cancelAnimationFrame(i),e.container.$.fireEvent("kineticScroll"),void(i=0);n=y.Animation.Easings.easeInSine(u,a,s-a,175),d(n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)}};cancelAnimationFrame(i),i=requestAnimationFrame(c)},e.inputEvents.listen()}unlisten(){const e=this;e.inputEvents&&e.inputEvents.unlisten(),delete e.inputEvents}}class f{constructor(e){this.events={},this.handlers={},this.element=e}hasClass(e){const t=this,n=e.split(" ");for(let e=0;e<n.length;e++)if(!t.element.classList.contains(n[e]))return!1;return!0}addClass(e){const t=this;if(t.hasClass(e))return;const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.add(n[e]);t.isNativeElement||d.observeElement(t.element)}removeClass(e){const t=this;if(0===arguments.length)return void t.element.removeAttribute("class");const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.remove(n[e]);""===t.element.className&&t.element.removeAttribute("class"),t.isNativeElement||d.observeElement(t.element)}get isCustomElement(){const e=this;return!!e.element.tagName.startsWith(n)||e.element instanceof window[n].BaseElement==1||"DIV"!==e.element.tagName&&"SPAN"!==e.element.tagName&&"BUTTON"!==e.element.tagName&&"INPUT"!==e.element.tagName&&"UL"!==e.element.tagName&&"LI"!==e.element.tagName&&document.createElement(e.element.nodeName)instanceof window[n].BaseElement==1}get isNativeElement(){return!this.isCustomElement}dispatch(e){const t=this,n=t.events[e.type];let r=!1;if(n.length>1)for(let e=0;e<n.length;e++){const t=n[e];if(t.namespace&&t.namespace.indexOf("_")>=0){r=!0;break}}r&&n.sort((function(e,t){let n=e.namespace,r=t.namespace;return n=-1===n.indexOf("_")?0:parseInt(n.substring(n.indexOf("_")+1)),r=-1===r.indexOf("_")?0:parseInt(r.substring(r.indexOf("_")+1)),n<r?-1:n>r?1:0}));for(let r=0;r<n.length;r++){const o=n[r];if(e.namespace=o.namespace,e.context=o.context,e.defaultPrevented)break;const i=o.handler.apply(t.element,[e]);if(void 0!==i&&(e.result=i,!1===i)){e.preventDefault(),e.stopPropagation();break}}return e.result}fireEvent(e,t,r){const o=this;r||(r={bubbles:!0,cancelable:!0,composed:null!==o.element.getRootNode().host}),r.detail=t||{};const i=new CustomEvent(e,r);if(i.originalStopPropagation=i.stopPropagation,i.stopPropagation=function(){return i.isPropagationStopped=!0,i.originalStopPropagation()},o.dispatchEvent(i),window[n].isVue){const t=y.Core.toDash(e);if(t!==e){const e=new CustomEvent(t,r);e.originalStopPropagation=i.stopPropagation,e.stopPropagation=function(){return e.isPropagationStopped=!0,e.originalStopPropagation()},o.dispatchEvent(e)}}return i}get isPassiveSupported(){const e=this;if(void 0!==e.supportsPassive)return e.supportsPassive;e.supportsPassive=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e.supportsPassive=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e.supportsPassive}dispatchEvent(e){const t=this,n=e.type,r=t.element.context,o=n.substring(0,1).toUpperCase()+n.substring(1);t.element.context=document,t.element["on"+o]?t.element["on"+o](e):t.element["on"+n.toLowerCase()]?t.element["on"+n.toLowerCase()](e):t.element.dispatchEvent(e),t.element.context=r}listen(e,t){const n=this,r=e.split("."),o=r.slice(1).join("."),i=r[0];n.events[i]||(n.events[i]=[]);const s={type:i,handler:t,context:n.element,namespace:o};p.indexOf(i)>=0&&(n.inputEvents||(n.inputEvents=new h(n.element)),n.inputEvents[i]((function(e){n.dispatchEvent(e)})),n.inputEvents.boundEventTypes.push(i),n.inputEvents.listen(i)),0===n.events[i].length&&(n.handlers[i]=n.dispatch.bind(n),"wheel"===i?n.element.addEventListener("wheel",n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):"touchmove"===i||"touchstart"===i||"touchend"===i?n.element.addEventListener(i,n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):n.element.addEventListener(i,n.handlers[i],!1)),n.events[i].push(s)}unlisten(e){const t=this,n=e.split("."),r=n.slice(1).join("."),o=n[0];let i=t.events[o];if(t.inputEvents&&t.inputEvents.boundEventTypes.indexOf(o)>=0&&(t.inputEvents.boundEventTypes.splice(t.inputEvents.boundEventTypes.indexOf(o),1),0===t.inputEvents.boundEventTypes.length&&t.inputEvents.unlisten(o)),i){for(let e=0;e<i.length;e++){if(""!==r){let e=i.findIndex((e=>e.namespace===r));i.splice(e,1);break}i=[]}0===i.length&&(t.element.removeEventListener(o,t.handlers[o]),t.events[o]=[],delete t.handlers[o])}}getAttributeValue(e,t){const n=this,r=n.element.getAttribute(e);if(n.isNativeElement)return n.deserialize(r,t);const o=n.element.propertyByAttributeName[e];return void 0===o.deserialize?n.deserialize(r,t,o.nullable):n.element[o.deserialize](r)}setAttributeValue(e,t,n){const r=this;let o,i=!1;if(r.isNativeElement){if(o=r.serialize(t,n),"boolean"===n&&["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(e)>=0)return void(t?r.element.setAttribute(e,""):r.element.removeAttribute(e))}else{const s=r.element.propertyByAttributeName[e];i=!s||s.nullable,o=s&&s.serialize?r.element[s.serialize](t):r.serialize(t,n,i)}"array"!==n&&"object"!==n||"[]"!==o&&"{}"!==o?void 0===o?(r.element.removeAttribute(e),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.removeAttribute(e)):(r.element.setAttribute(e,o),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.setAttribute(e,o)):r.element.removeAttribute(e)}serialize(e,t,n){if(void 0===t&&(t=y.Types.getType(e)),void 0!==e&&(n||null!==e)){if(n&&null===e)return"null";if("string"===t)return e;if("boolean"===t||"bool"===t){if(!0===e||"true"===e||1===e||"1"===e)return"";if(!1===e||"false"===e||0===e||"0"===e)return}return"array"===t?JSON.stringify(e):["string","number","int","integer","float","date","any","function"].indexOf(t)>=0?e.toString():"object"===t?JSON.stringify(e):void 0}}deserialize(e,t,n){const r="null"===e;if(void 0!==e&&(!r||n)){if(r&&n)return null;if("boolean"===t||"bool"===t)return null!==e;if("number"===t||"float"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseFloat(e);if("int"===t||"integer"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseInt(e);if("string"===t)return e;if("any"===t)return e;if("date"===t)return new Date(e);if("function"===t){if("function"==typeof window[e])return window[e]}else if("array"===t||"object"===t)try{const t=JSON.parse(e);if(t)return t}catch(n){if(window[e]&&"object"==typeof window[e])return window[e];if("object"===t&&e.indexOf("{")>=0){let t=(e=e.replace(/{/gi,"").replace(/}/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim()).trim().split(","),n={};for(let e=0;e<t.length;e++){const r=t[e].split(":")[0].trim(),o=t[e].split(":")[1].trim();n[r]=o}return n}if("array"===t&&e.indexOf("[")>=0){if(e.indexOf("{")>=0){let t=e.replace(/{/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim();t=t.split("},");for(let e=0;e<t.length;e++){let n={},r=t[e].trim().split(",");for(let e=0;e<r.length;e++){const t=r[e].split(":")[0].trim(),o=r[e].split(":")[1].trim();n[t]=o}t[e]=n}return t}return e.replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim().split(",")}}}}}class g{static get Ripple(){return i}static get Easings(){return s}}class y{static get Types(){return o}static get Core(){return a}static get Animation(){return g}static get Scroll(){return m}static get InputEvents(){return h}static Extend(e){return new f(e)}static Assign(e,t){if(e.indexOf(".")>=0){const n=e.split(".");return y[n[0]]||(y[n[0]]={}),void(y[n[0]][n[1]]=t)}y[e]=t}}const w=y.Extend(document);let b=null;document.addEventListener("click",(()=>{d.start(),b&&clearTimeout(b),b=setTimeout((()=>{d.stop()}),1e4)})),document.addEventListener("mouseenter",(()=>{d.start()})),document.addEventListener("mouseleave",(()=>{d.stop()}));class v{}v.cache={};class _ extends HTMLElement{static get properties(){return{animation:{value:"advanced",type:"string",allowedValues:["none","simple","advanced"]},unfocusable:{value:!1,type:"boolean"},disabled:{value:!1,type:"boolean"},dataContext:{value:null,reflectToAttribute:!1,type:"any"},debugMode:{value:!0,type:"boolean",reflectToAttribute:!1},locale:{value:"en",type:"string",reflectToAttribute:!1},localizeFormatFunction:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{propertyUnknownName:"Invalid property name: '{{name}}'!",propertyUnknownType:"'{{name}}' property is with undefined 'type' member!",propertyInvalidValue:"Invalid '{{name}}' property value! Actual value: '{{actualValue}}', Expected value: '{{value}}'!",propertyInvalidValueType:"Invalid '{{name}}' property value type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",methodInvalidValueType:"Invalid '{{name}}' method argument value type! Actual type: '{{actualType}}', Expected type: '{{type}}' for argument with index: '{{argumentIndex}}'!",methodInvalidArgumentsCount:"Invalid '{{name}}' method arguments count! Actual arguments count: '{{actualArgumentsCount}}', Expected at least: '{{argumentsCount}}' argument(s)!",methodInvalidReturnType:"Invalid '{{name}}' method return type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",elementNotInDOM:"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",moduleUndefined:"Module is undefined.",missingReference:"{{elementType}}: Missing reference to '{{files}}'.",htmlTemplateNotSuported:"{{elementType}}: Web Browser doesn't support HTMLTemplate elements.",invalidTemplate:"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM."}},reflectToAttribute:!1,inherit:!0,type:"object"},props:{value:null,reflectToAttribute:!1,isHierarchicalProperty:!0,type:"any"},readonly:{value:!1,type:"boolean"},renderMode:{value:"auto",type:"string",reflectToAttribute:!1,allowedValues:["auto","manual"]},rightToLeft:{value:!1,type:"boolean"},rethrowError:{value:!0,type:"boolean",reflectToAttribute:!1},theme:{value:window[n].Theme,type:"string"},visibility:{value:"visible",allowedValues:["visible","collapsed","hidden"],type:"string"},wait:{value:!1,type:"boolean"}}}getBindings(e,t){const n=this;let r=0,o={},i=(e=>{if(e instanceof HTMLElement)return n.parseAttributes(e);{let t=n.parseProperty(e.data?e.data.trim():null,"textContent",e);if(t)return n&&e.parentNode===n.$.content&&(t.value=""!==n.$.html?n.$.html:void 0,n.innerHTML=""),{textContent:t}}})(e);i&&(o.data=i),t||(o.mapping=[],t=o),e.getAttribute&&(o.nodeId=e.getAttribute("jqx-id"),t&&i&&(t.mapping[o.nodeId]=i)),o.node=e,e.firstChild&&(o.children={});for(let i=e.firstChild;i;i=i.nextSibling)o.children[r++]=n.getBindings(i,t);return o}_addRemovePropertyBinding(e,t,n,r,o){if(!e||!t||!n)return;const i=this,s=i.bindings,a=n.getAttribute("jqx-id"),l=e.indexOf("{{")>=0;let d=!1;(e=e.replace("{{","").replace("}}","").replace("[[","").replace("]]","")).indexOf("!")>=0&&(e=e.replace("!",""),d=!0);const c=i._properties[e],u={name:e,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};if(o&&!r){const n={},r={name:e,targetPropertyName:t,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};n[e]=r,s.mapping[a]=n}const p=function(e){for(let o in e){const s=e[o];if(s.nodeId===a){s.data||(s.data={}),r?(s.data[t]=null,delete s.data[t]):s.data[t]=u;break}if(s.children)p(s.children);else if(s.node&&s.node.children&&s.node===n.parentElement){const e=s.node;if(!e.firstChild)continue;s.children={};let t=0;for(let n=e.firstChild;n;n=n.nextSibling)s.children[t++]=i.getBindings(n);p(s.children)}}};p(s.children),r?delete i.boundProperties[e]:i.boundProperties[e]=!0,i.updateBoundNodes(e)}addPropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!1,r)}removePropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!0,r)}parseAttributes(e){const t=this;let n;for(let r=0;r<e.attributes.length;r++){const o=e.attributes[r],i=o.name,s=o.value;v.cache["toCamelCase"+i]||(v.cache["toCamelCase"+i]=y.Core.toCamelCase(i));const a=v.cache["toCamelCase"+i];if(i.indexOf("(")>=0){let r=i.substring(1,i.length-1);if(t&&!t.dataContext){t.templateListeners[e.getAttribute("jqx-id")+"."+r]=s,e.removeAttribute(i);continue}{n||(n={});const e=s.substring(0,s.indexOf("("));n[a]={isEvent:!0,name:r,value:e};continue}}let l=t.parseProperty(s,i,e);l&&(n||(n={}),n[a]=l)}return n}parseProperty(e,t){if(!e||!e.length)return;const n=this;let r,o=e.length,i=0,s=0,a=0,l=!0;for(;s<o;){i=e.indexOf("{{",s);let t=e.indexOf("[[",s),n="}}";if(t>=0&&(i<0||t<i)&&(i=t,l=!1,n="]]"),a=i<0?-1:e.indexOf(n,i+2),a<0)return;r=r||{};let o=e.slice(i+2,a).trim();r.name=o,s=a+2}const d=r.name,c=n?n._properties[d]:null;return r.twoWay=l,r.ready=!1,n&&(d.indexOf("::")>=0?n.boundProperties[d.substring(0,d.indexOf("::"))]=!0:n.boundProperties[d]=!0),c?(r.type=c.type,r.reflectToAttribute=c.reflectToAttribute):(["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(t)>=0?r.type="boolean":r.type="string",r.reflectToAttribute=!0),r}updateTextNodes(){const e=this;e.updateTextNode(e.shadowRoot||e,e.bindings,e)}updateTextNode(e,t,n){const r=this;if(!t)return;let o=0;for(let i=e.firstChild;i&&t.children;i=i.nextSibling)r.updateTextNode(i,t.children[o++],n);if(t&&t.data)for(let e in t.data){const r=t.data[e],o=r.name;"textContent"===e&&r.twoWay&&!r.updating&&void 0!==r.value&&(n[o]=r.value)}}updateBoundProperty(e,t){if(t.updating)return;const n=this;t.updating=!0,n[e]=t.value,t.updating=!1}updateBoundNodes(e){const t=this;if(t.updateBoundNode(t.shadowRoot||t,t.bindings,t,e),t.detachedChildren.length>0)for(let n=0;n<t.detachedChildren.length;n++){const r=t.detachedChildren[n],o=r.getAttribute("jqx-id"),i=function(e){if(e.nodeId===o)return e;for(let t in e.children){const n=e.children[t];if((n.getAttribute?n.getAttribute("jqx-id"):"")===o)return e;if(n.children){const e=i(n);if(e)return e}}return null},s=i(t.bindings);if(s)t.updateBoundNode(r,s,t,e,!0);else if(r.getAttribute&&t.bindings.mapping){const n=t,r=t.bindings;if(r)for(let o in r.mapping){const i=n.querySelector('[jqx-id="'+o+'"]');if(i){const s=r.mapping[o];t.updateBoundData(i,s,n,e)}}}}}updateBoundMappedNodes(){const e=this,t=e.bindings,n=e;if(t.mapping)for(let r in t.mapping){let o=n.querySelector('[jqx-id="'+r+'"]');if(n.shadowRoot&&(o=n.querySelector('[id="'+r+'"]'),o||(o=n.shadowRoot.querySelector('[id="'+r+'"]')||n.shadowRoot.querySelector('[jqx-id="'+r+'"]'))),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}else if(n.getAttribute("aria-controls")){let i=document.getElementById(n.getAttribute("aria-controls"));if(!i&&n.shadowRoot&&(i=n.shadowRoot.getElementById(n.getAttribute("aria-controls"))),o=i.querySelector('[jqx-id="'+r+'"]'),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}}}}updateBoundNode(e,t,n,r,o){const i=this;if(!t)return;let s=0;if(o){if(o&&!t.data)for(let a=e.firstChild;a&&t.children;a=a.nextSibling)if(a.getAttribute){const e=a.getAttribute("jqx-id"),o=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(a,o,n,r),s++}else i.updateBoundNode(a,t.children[s++],n,r,o)}else for(let o=e.firstChild;o&&t.children;o=o.nextSibling)if(o.getAttribute){const e=o.getAttribute("jqx-id"),a=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(o,a,n,r),s++}else i.updateBoundNode(o,t.children[s++],n,r);if(!t||!t.data)return;const a=t.data;i.updateBoundData(e,a,n,r)}updateBoundData(e,t,n,r){const o=this;for(let i in t){const s=t[i];let a=s.name;if(!s.updating&&(a.indexOf("::")>=0&&(a=a.substring(0,a.indexOf("::"))),void 0===r||r===a)){if(a.indexOf("(")>=0){let e=a.substring(a.indexOf("("));const t=a.substring(0,a.indexOf("("));if(e=e.substring(1,e.length-1),e=e.replace(/ /gi,""),e=e.split(","),e.length>0&&""!==e[0]){let r=[];for(let t=0;t<e.length;t++)r.push(n[e[t]]);s.value=n[t].apply(n,r)}else s.value=n[t]();s.type=typeof s.value}else s.value=n[a];if("innerHTML"===a){if(e[i].toString().trim()!==n[a].toString().trim()){if(window.smartBlazor&&e[i].indexOf("\x3c!--")>=0){(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString());continue}(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString().trim())}}else s.not?(e[i]=!s.value,s.targetPropertyName&&(e[s.targetPropertyName]=!s.value)):(e[i]=s.value,s.targetPropertyName&&(e[s.targetPropertyName]=s.value));if(e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);!s.reflectToAttribute||n===s.value&&s.ready||e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}if(!s.ready){if(e.$&&e.$.isCustomElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i];e._properties||(e._beforeCreatedProperties=e._properties=e.propertyByAttributeName=[]),e._properties[i]||(e._properties[i]={attributeName:t},e._beforeCreatedProperties&&(e._beforeCreatedProperties[i]=e._properties[i]),e.propertyByAttributeName[t]=e._properties[i]);const n=e._properties[i];n.isUpdating=!0,s.reflectToAttribute&&(s.not?e.$.setAttributeValue(n.attributeName,!s.value,s.type):e.$.setAttributeValue(n.attributeName,s.value,s.type)),s.reflectToAttribute||e.$.setAttributeValue(n.attributeName,null,s.type),n.isUpdating=!1}if(s.twoWay){const t=function(t){if(s.value=t,e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);s.reflectToAttribute&&n!==s.value&&e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}};if(s.name.indexOf("::")>=0){const n=s.name.indexOf("::"),r=s.name.substring(n+2);o["$"+e.getAttribute("jqx-id")].listen(r,(function(){t(e[i]);const n=s.name.substring(0,s.name.indexOf("::"));o.updateBoundProperty(n,s)}))}if(e.$&&e.$.isCustomElement){e._properties[i]&&(e._properties[i].notify=!0),v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const n=v.cache["toDash"+i];o["$"+e.getAttribute("jqx-id")].listen(n+"-changed",(function(e){let n=e.detail;t(n.value);const r=o.context;e.context!==document&&(o.context=o),o.updateBoundProperty(s.name,s),o.context=r}))}}}s.ready=!0}}}static clearCache(){this.cache={}}addMessages(e,t){Object.assign(this.messages[e],t)}localize(e,t){const n=this;if(!n.messages||!n.messages[n.locale])return;let r=n.messages[n.locale][e];if(""===r)return"";if(!r){const r=n.messages.en;if(r){let n=r[e];if(n){for(let e in t){let r=t[e];n=n.replace(new RegExp("{{"+e+"}}","g"),r)}return n}return e}}const o=r;for(let e in t){let n=t[e];r=r.replace(new RegExp("{{"+e+"}}","g"),n)}if(n.localizeFormatFunction){const i=n.localizeFormatFunction(o,r,t,e);if(void 0!==i)return i}return r}static get requires(){return{}}static get listeners(){return{"theme-changed":function(e){this.theme=e.detail.newValue}}}static get methods(){return{}}get classNamesMap(){return{animation:"jqx-animate",rippleAnimation:"jqx-ripple"}}get hasAnimation(){return"none"!==this.animation}get hasRippleAnimation(){return"none"!==this.animation&&"advanced"===this.animation}static get modules(){return window[n].Modules}get properties(){const e=this;return e._properties||(e._properties=[]),e._properties}get parents(){const e=this;let t=[],r=e.parentNode;for(;r&&9!==r.nodeType;)r instanceof HTMLElement==1&&t.push(r),r=r.parentNode;const o=e.getRootNode();if(o.host){const e=e=>{let t=[e],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t=t.concat(e(o.host))}return window[n].EnableShadowDOM&&e.isInShadowDOM&&e.shadowParent&&(t=t.concat(e.shadowParent.parents)),t}log(e){this._logger("log",e)}warn(e){this._logger("warn",e)}error(e){this._logger("error",e)}_logger(e,t){if(this.debugMode){const n=t instanceof Error?t.message:t.toString();console[e](n)}if(this.rethrowError&&"error"===e)throw t}get focused(){return this.contains(document.activeElement)}template(){return"<div></div>"}registered(){const e=this;e.onRegistered&&e.onRegistered()}created(){const e=this;e.isReady=!1,e._initElement(e),e._setModuleState("created"),e.onCreated&&e.onCreated()}completed(){const e=this;e.isCompleted=!0,e._onCompleted&&e._onCompleted(),e.onCompleted&&e.onCompleted()}whenReady(e){const t=this;t.isCompleted?e():(t.whenReadyCallbacks||(t.whenReadyCallbacks=[]),t.whenReadyCallbacks.push(e))}whenRendered(e){const t=this;t.isRendered?e():(t.whenRenderedCallbacks||(t.whenRenderedCallbacks=[]),t.whenRenderedCallbacks.push(e))}addThemeClass(){const e=this;""!==e.theme&&e.classList.add("jqx-"+e.theme)}addDefaultClass(){const e=this;e.classList.add(n.toLowerCase()+"-element"),e.classList.add(e.nodeName.toLowerCase())}_renderShadowRoot(){const e=this;if(e.shadowRoot){e.$.root.classList.add(e.nodeName.toLowerCase());for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t];"class"===n.name||"id"===n.name||"style"===n.name||"tabindex"===n.name||n.name.indexOf("aria")>=0||e.$.root.setAttribute(n.name,n.value)}for(let t=0;t<e.classList.length;t++){const n=e.classList[t];"jqx-element-init"!==n&&"jqx-element"!==n&&"jqx-hidden"!==n&&"jqx-visibility-hidden"!==n&&e.$.root.classList.add(n)}}}render(){const e=this;if(!e.isRendered&&(e.isRendered=!0,e.isRendering=!1,e.context=document,e._renderShadowRoot(),e.whenRenderedCallbacks)){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}e.onRender&&e.onRender(),e.disabled&&e.setAttribute("aria-disabled",!0),e.readonly&&-1!==["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(e.getAttribute("role"))&&e.setAttribute("aria-readonly",!0)}ready(){const e=this;if(e._setId(),e.addThemeClass(),e.addDefaultClass(),"collapsed"===e.visibility?e.classList.add("jqx-hidden"):"hidden"===e.visibility&&e.classList.add("jqx-visibility-hidden"),e.dataContext&&e.applyDataContext(),e.onReady&&e.onReady(),e.shadowRoot&&JQX(e._selector)){if(JQX(e._selector).styleUrls){const t=JQX(e._selector).styleUrls;for(let n=0;n<t.length;n++)e.importStyle(t[n])}if(JQX(e._selector).styles){const t=document.createElement("style");t.innerHTML=JQX(e._selector).styles,e.shadowRoot.insertBefore(t,e.shadowRoot.firstChild)}}JQX(e._selector)&&JQX(e._selector).ready&&JQX(e._selector).ready()}_setId(){const e=this;if(!e.id){const t=e.elementName;e.id=t.slice(0,1).toLowerCase()+t.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}}checkLicense(){const e=this;"Evaluation"===window[n].License&&-1===window.location.hostname.indexOf("htmlelements")&&(e.logWatermark(),e.logLicense(),window[n].License="")}logWatermark(){const e=document.createElement("a");e.href="https://www.htmlelements.com/",e.innerHTML="https://www.htmlelements.com/",e.style.position="absolute",e.style.right="5px",e.style.bottom="5px",e.style.color="#fff",e.style.padding="20px",e.style.borderRadius="5px",e.style.background="#0C3D78",e.style.cursor="pointer",e.style.zIndex="999999",e.style.display="block",e.style.fontSize="24px",e.style.textDecoration="none",e.style.fontWeight="bold",e.style.opacity=0,e.style.transition="opacity .35s ease-in-out",e.id="watermark",document.getElementById("watermark")||setTimeout((()=>{document.getElementById("watermark")||(document.body.appendChild(e),setTimeout((()=>{e.style.opacity=1})),setTimeout((()=>{e.style.opacity=0,setTimeout((()=>{e.parentNode.removeChild(e)}),350)}),6e3))}),1e3)}logLicense(){console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("*jQWidgets License Key Not Found."),console.log("*This is an EVALUATION only Version, it is NOT Licensed for software projects intended for PRODUCTION."),console.log("*if you want to hide this message, please send an email to: sales@jqwidgets.com for a license."),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************")}get _selector(){const e=this;return e.id?"#"+e.id:e.classList.length>0?"."+e.classList[0]:""}applyDataContext(e){const t=this;let n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext;if(e&&(n=e,t.dataContext=e),n){if(!n._uid){n._uid=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),n._properties=[];for(let e in n){const r=n[e];"function"!=typeof r&&"_properties"!==e&&"_uid"!==e&&(n._properties[e]=r,Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:()=>n._properties[e],set(r){const o=n._properties[e];n._properties[e]=r;let i=[];i[e]={oldValue:o,value:r},i.length++,t.updatingDataContext=!0,w.fireEvent("dataContextPropertyChanged",{dataContext:n,properties:i},{bubbles:!1,cancelable:!0}),t.updatingDataContext=!1}}))}}if(t.dataContextProperties=t.parseAttributes(t),t.dataContextPropertiesMap={},t.dataContextListeners={},t.dataContextProperties){t.updatingDataContext=!0;for(let e in t.dataContextProperties){const r=t.dataContextProperties[e],o=r.name;if(r.propertyName=e,t.dataContextPropertiesMap[o]=e,v.cache["toDash"+e]||(v.cache["toDash"+e]=y.Core.toDash(o)),r.isEvent){const e=r.value;t.dataContextListeners[o]&&t.removeEventListener(o,t.dataContextListeners[o]),t.dataContextListeners[o]=function(t){n[e](t)},t.addEventListener(o,t.dataContextListeners[o])}if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(t[e]=i)}else t[e]=n[o]}t.dataContextPropertyChangedHandler=function(e){const n=e.detail.properties;if(e.detail.dataContext===("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext))for(let e in n){const r=t.dataContextPropertiesMap[e],o=t.context;r&&(t.context=document,t[r]=n[e].value,t.context=o)}},w.listen("dataContextPropertyChanged",t.dataContextPropertyChangedHandler),t.updatingDataContext=!1}else t.dataContextProperties=null}else{t.dataContextProperties=null;const e=function(){("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext)&&(t.applyDataContext(),window.removeEventListener("load",e))};window.addEventListener("load",e)}}updateDataContextProperty(e){const t=this,n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext,r=t.dataContextProperties[e];if(!t.updatingDataContext&&r.twoWay){const o=r.name;if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(i=t[e],c[n._uid]&&(c[n._uid][e]=i))}else n[o]=t[e],c[n._uid]&&(c[n._uid][e]=n[o])}}static get version(){return window[n].Version}initProperties(){const e=this;if(JQX(e._selector)&&JQX(e._selector).properties&&(e._initProperties=JQX(e._selector).properties),e.hasAttribute("props")&&!e.props?e._initProperties=window[e.getAttribute("props")]:e.props&&(e._initProperties=e.props),e._initProperties){const t=Object.keys(e._initProperties);for(let n=0;n<t.length;n++){const r=t[n],o=e._initProperties[r];if(void 0!==o){if(o.constructor===JQX.ObservableArray||o instanceof JQX.ObservableArray){e[r]=o.toArray();continue}if(o.constructor===JQX.DataAdapter||"smartDataAdapter"===o.constructor.name||"object"==typeof o&&JQX.DataAdapter&&o instanceof JQX.DataAdapter||o instanceof JQX.Observable||o.constructor===JQX.Observable||"object"!=typeof o||y.Types.isArray(o)||o instanceof Date){if(void 0===e[r]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(r)){const t=e.localize("propertyUnknownName",{name:r});e.log(t)}e[r]=o;continue}}if("messages"!==r)if("dataSourceMap"!==r&&"rowCSSRules"!==r){if(o&&"object"==typeof o){const t=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=e._properties[r+"_"+s];if(l&&null===l.value){if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)t(a,r+"_"+s);else{if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}}};t(o,r)}}else e[r]=o;else e[r]=Object.assign(e[r],o)}}}setProperties(e){const t=this,n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o];if(i.constructor===JQX.ObservableArray||i instanceof JQX.ObservableArray)t[o]=i.toArray();else if(i.constructor===JQX.DataAdapter||"smartDataAdapter"===i.constructor.name||"object"==typeof i&&JQX.DataAdapter&&i instanceof JQX.DataAdapter||i instanceof JQX.Observable||i.constructor===JQX.Observable||"object"!=typeof i||y.Types.isArray(i)||i instanceof Date){if(void 0===t[o]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(o))continue;const e=t._properties[o];"int"===e.type||"number"===e.type&&"string"==typeof subPropertyValue?"int"===e.type?t[o]=parseInt(i):t[o]=parseFloat(i):t[o]=i}else if("messages"!==o&&"dataSourceMap"!==o){if("object"==typeof i){const e=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=t._properties[r+"_"+s];if(l&&null===l.value){if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)e(a,r+"_"+s);else{if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}}};e(i,o)}}else t[o]=i}}setup(){const e=this;if(e.context=this,e.isReady&&!e.isCompleted)return;if(e.isReady)return e._setModuleState("attached"),e.isAttached=!0,e.attached(),e._handleListeners("listen"),void(e.context=document);e.ownerElement&&e.ownerElement.detachedChildren.indexOf(e)>=0&&e.ownerElement.detachedChildren.splice(e.ownerElement.detachedChildren.indexOf(e),1),e.isReady=!0,e.methods=e.getStaticMember("methods"),e.initProperties(),a.isMobile&&e.classList.add("jqx-mobile");for(let t=0;t<e.attributes.length;t+=1){const n=e.propertyByAttributeName[e.attributes[t].name];if(!n)continue;let r=e.$.getAttributeValue(n.attributeName,n.type);const o=r?r.toString():"";if(!(o.indexOf("{{")>=0||o.indexOf("[[")>=0||"object"!==n.type&&"array"!==n.type&&(e.attributes[t].value.indexOf("{{")>=0||e.attributes[t].value.indexOf("[[")>=0)||void 0===r||n.value===r)){const o=y.Types.getType(r),i=e.attributes[t].value;if(("any"===n.type||"object"===n.type)&&""+e[n.name]===r)continue;if("array"===n.type&&e[n.name]&&JSON.stringify(e[n.name])===r)continue;if("number"===o&&isNaN(r)&&"NaN"!==i&&"Infinity"!==i&&"-Infinity"!==i){const t=e.localize("propertyInvalidValueType",{name:n.name,actualType:"string",type:n.type});e.log(t)}n.isUpdatingFromAttribute=!0,e[n.name]=r,n.isUpdatingFromAttribute=!1}}for(let t in e._properties){const n=e._properties[t];if("innerHTML"===t&&n.value===n.defaultValue&&(n.value=n.defaultValue=y.Core.html(e)),"boolean"!==n.type&&"bool"!==n.type||"false"===e.getAttribute(n.attributeName)&&(n.isUpdating=!0,e.setAttribute(n.attributeName,""),n.isUpdating=!1),n.defaultReflectToAttribute&&n.reflectToAttribute){if(n.defaultReflectToAttribute&&n.defaultReflectToAttributeConditions){let t=!0;for(let r=0;r<n.defaultReflectToAttributeConditions.length;r++){const o=n.defaultReflectToAttributeConditions[r];let i,s;for(let e in o)i=e,s=o[e];e._properties[i]&&e._properties[i].value!==s&&(t=!1)}if(!t)continue}n.isUpdating=!0,e.$.setAttributeValue(n.attributeName,n.value,n.type),n.isUpdating=!1}}const t=[];if(e.children.length>0)for(let n=0;n<e.children.length;n++){const r=e.children[n];y.Extend(r).isCustomElement&&t.push(r)}e.applyTemplate(),e.complete=function(){if(!e.templateBindingsReady){const t=e=>{e.templateBindingsReady||(e.templateBindingsReady=!0,e.updateTextNodes(),e.updateBoundNodes())};if(e.ownerElement){let n=e.ownerElement,r=[];for(;n;)r.push(n),n=n.ownerElement;for(let e=r.length-1;e>=0;e--)t(r[e]);t(e)}else t(e)}const t=()=>{if(e._setModuleState("ready"),e.ready(),"auto"!==e.renderMode||e.isRendered||e.render(),e.isAttached=!0,e._setModuleState("attached"),e.attached(),e._handleListeners("listen"),e.isHidden||0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0),e.completed(),e.isRendered&&(e.context=document),e.whenReadyCallbacks){for(let t=0;t<e.whenReadyCallbacks.length;t++)e.whenReadyCallbacks[t]();e.whenReadyCallbacks=[]}};if(e.wait)e.classList.add("jqx-visibility-hidden");else if(e.classList.contains("jqx-async"))requestAnimationFrame((()=>{t()}));else{const n=e.shadowParent;e.shadowParent=null;const r=e.parents;if(e.shadowParent=n,0===r.length)return;const o=()=>{let t=e.ownerElement,n=[];for(;t;)n.push(t),t=t.ownerElement;for(let e=n.length-1;e>=0;e--)n[e].updateBoundMappedNodes()};e.ownerElement&&"HTML"!==r[r.length-1].nodeName?e.getRootNode().host?t():e.ownerElement&&"HTML"===e.ownerElement.parents[e.ownerElement.parents.length-1].nodeName?(o(),t()):e.checkIsInDomInterval=setInterval((()=>{const n=e.parents;"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomInterval),o(),t())}),100):t()}};let r=[].slice.call(e.querySelectorAll("[jqx-id]")).concat(t);if(window[n].EnableShadowDOM&&!0!==e.isInShadowDOM&&(r=[].slice.call(e.shadowRoot.querySelectorAll("[jqx-id]")).concat(t)),0===r.length)e.complete();else{e._completeListeners=0;for(let t=0;t<r.length;t++){const n=r[t];if(y.Extend(n).isCustomElement){const t=function(){e._completeListeners--,0===e._completeListeners&&(e.complete(),delete e._completeListeners)}.bind(e);n.isCompleted||n.isUtilityElement||!0===n.wait||(e._completeListeners++,n._onCompleted||(n.completeHandlers=[],n._onCompleted=function(){for(let e=0;e<n.completeHandlers.length;e++)n.completeHandlers[e]()}),n.completeHandlers.push(t))}}0===e._completeListeners&&e.complete()}}visibilityChangedHandler(){const e=this;e.isReady&&requestAnimationFrame((()=>{0===e.offsetWidth||0===e.offsetHeight?e.isHidden=!0:(e.isHidden=!1,e.$.fireEvent("resize",e,{bubbles:!1,cancelable:!0}))}))}attributeChangedCallback(e,t,n){const r=this,o=r.propertyByAttributeName[e];if("class"!==e&&"style"!==e||r.visibilityChangedHandler(),o||r.attributeChanged(e,t,n),r.onAttributeChanged&&r.onAttributeChanged(e,t,n),!o||o&&o.isUpdating)return;let i=r.$.getAttributeValue(o.attributeName,o.type);void 0!==n&&r[o.name]!==i&&(o.isUpdatingFromAttribute=!0,r[o.name]=void 0!==i?i:r._properties[o.name].defaultValue,o.isUpdatingFromAttribute=!1)}attributeChanged(e,t,n){}set hasStyleObserver(e){const t=this;void 0===t._hasStyleObserver&&(t._hasStyleObserver=e),e?d.watch(t):d.unwatch(t)}get hasStyleObserver(){const e=this;return void 0===e._hasStyleObserver||e._hasStyleObserver}attached(){const e=this;e.hasStyleObserver&&d.watch(e),e.onAttached&&e.onAttached(),JQX(e._selector)&&JQX(e._selector).attached&&JQX(e._selector).attached()}detached(){const e=this;e.hasStyleObserver&&d.unwatch(e),e._setModuleState("detached"),e.isAttached=!1,e.ownerElement&&-1===e.ownerElement.detachedChildren.indexOf(e)&&e.ownerElement.detachedChildren.push(e),e._handleListeners("unlisten"),e.onDetached&&e.onDetached(),JQX(e._selector)&&JQX(e._selector).detached&&JQX(e._selector).detached(),u&&u[e._selector]&&delete u[e._selector]}propertyChangedHandler(e,t,n){const r=this;t!==n&&("theme"===e&&(""!==t&&r.classList.remove("jqx-"+t),""!==n&&r.classList.add("jqx-"+n)),"visibility"===e?("collapsed"===t?r.classList.remove("jqx-hidden"):"hidden"===t&&r.classList.remove("jqx-visibility-hidden"),"collapsed"===n?r.classList.add("jqx-hidden"):"hidden"===n&&r.classList.add("jqx-visibility-hidden")):("disabled"===e||"readonly"===e)&&r._ariaPropertyChangedHandler(e,n),r.propertyChanged&&r.propertyChanged(e,t,n))}_ariaPropertyChangedHandler(e,t){const n=this;"readonly"===e&&-1===["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(n.getAttribute("role"))||(t?n.setAttribute("aria-"+e,!0):n.removeAttribute("aria-"+e))}_handleListeners(e){const t=this,n=t.tagName.toLowerCase(),r=r=>{for(let o in r){const i=o.split(".");let s=i[0],a=t.$;if(i[1])if(s=i[1],a=t["$"+i[0]],"document"===i[0]){let e=t.smartId;""===e&&(e=y.Core.toCamelCase(n)),s=s+"."+e}else t.smartId&&(s=s+"."+t.smartId+"_"+t.parents.length);else t.smartId&&(s=s+"."+t.smartId);const l=r[o],d=function(e){const n=t.context;t.context=t,t[l]&&t[l].apply(t,[e]),t.context=n};a&&a[e](s,d)}};r(t.getStaticMember("listeners")),r(t.templateListeners),JQX(t._selector)&&JQX(t._selector).properties&&r(JQX(t._selector).listeners)}parseTemplate(){const e=this,n=e.template(),o=document.createDocumentFragment();if(t[e.nodeName]&&!r)return t[e.nodeName].cloneNode(!0);if(""===n)return null;let i=document.createElement("div");o.appendChild(i),i.innerHTML=n;let s=i.childNodes;i.parentNode.removeChild(i);for(let e=0;e<s.length;e++)o.appendChild(s[e]);return t[e.nodeName]=o,r?o:o.cloneNode(!0)}applyTemplate(){const e=this,t=e.parseTemplate();if(!t)return;if(!t.hasChildNodes)return;const n=t.childNodes[0],r=(t,n)=>{e["$"+t]=n.$=y.Extend(n),e.$[t]=n,n.ownerElement=e};let o=n;if(n.getElementsByTagName("content").length>0){let e=n.getElementsByTagName("content")[0];o=e.parentNode,o.removeChild(e)}else{const e=t.querySelectorAll("[inner-h-t-m-l]");e&&e.length>0&&(o=e[0])}e.$.template="template"===n.nodeName.toLowerCase()?n:n.querySelector("template");let i=t.querySelectorAll("[id]");0===i.length&&(i=t.querySelectorAll("*")),r("root",n),r("content",o),e.$.html=e.innerHTML.toString().trim();for(let t=0;t<i.length;t+=1){let n=i[t];""===n.id&&(n.id="child"+t),r(n.id,n),n.setAttribute("jqx-id",n.id),e.shadowRoot?n.shadowParent=e:n.removeAttribute("id")}for(!1!==e.hasTemplateBindings?e.bindings=e.getBindings(t):e.bindings=[],e.$root.addClass("jqx-container");e.childNodes.length;)o.appendChild(e.firstChild);if(e.appendTemplate(t),e.$.template){const t=document.createElement("div");t.classList.add("jqx-template-container"),e.$.templateContainer=t,e.$.template.parentNode.insertBefore(t,e.$.template),e.refreshTemplate()}}refreshTemplate(){const e=this;if(!e.$.templateContainer)return;e.templateDetached(e.$.templateContainer);const t=e.$.template.content.cloneNode(!0);e.templateBindings=e.getBindings(t),e.templateProperties=[];let n=document.createDocumentFragment();const r=function(t,n,o){for(let i in t){const s=t[i],a=s.node.cloneNode();n.appendChild(a);let l=[],d=!1;if(s.data)for(let t in s.data){const r=s.data[t],i=r.name;if(e.templateProperties[i]=!0,a.removeAttribute(y.Core.toDash(t)),"*items"===t)l=e[i],d=!0;else if(i.indexOf("item.")>=0&&void 0!==o)r.value=o[i.substring("item.".length)],a[t]=r.value;else if(i.indexOf("item")>=0&&void 0!==o)r.value=o,a[t]=r.value;else if("*if"===t)if(i.indexOf("(")>=0){let t,r=i.substring(i.indexOf("("));const o=i.substring(0,i.indexOf("("));if(r=r.substring(1,r.length-1),r=r.replace(/ /gi,""),r=r.split(","),r.length>0&&""!==r[0]){let n=[];for(let t=0;t<r.length;t++)n.push(e[r[t]]);t=e[o].apply(e,n)}else t=e[o]();!1===t&&n.removeChild(a)}else e[i]||n.removeChild(a);else e.updateBoundNode(a,s,e,i)}if(l.length>0||d){for(let e=0;e<l.length;e++)s.children&&r(s.children,a,l[e]);if("number"==typeof l)for(let e=0;e<l;e++)s.children&&r(s.children,a,e)}else s.children&&r(s.children,a,o)}};r(e.templateBindings.children,n),e.$.templateContainer.innerHTML="",e.$.templateContainer.appendChild(n),e.templateAttached(e.$.templateContainer)}templateAttached(){}templateDetached(){}appendTemplate(e){this.appendChild(e)}defineElementModules(){const e=this,t=e.constructor.prototype;if("BaseElement"===t.elementName){t.modules=e.constructor.modules;const n=t.modules;for(let t=0;t<n.length;t+=1)e.addModule(n[t])}else{const n=t.modules;if(!n)return;for(let t=0;t<n.length;t+=1){const r=n[t],o=r.prototype;e.defineElementMethods(o.methodNames,o),e.defineElementProperties(r.properties)}}}watch(e,t){const n=this;n._watch=null!==e&&null!==t?{properties:e,propertyChangedCallback:t}:null}unwatch(){this._watch=null}set(e,t,n){const r=this,o=r.context;r.context=!0===n?document:r,r[e]=t,r.context=o}get(e){return this[e]}_setModuleState(e,t){const n=this,r="is"+e.substring(0,1).toUpperCase()+e.substring(1),o="on"+e.substring(0,1).toUpperCase()+e.substring(1);for(let i=0;i<n.modulesList.length;i++){const s=n.modulesList[i];s[r]=!0,s[e]&&s[e](t),s[o]&&s[o](t)}}addModule(e,t){const n=this;if(!e)return;const r=n.modules.slice(0),o=e.prototype,i=Object.getPrototypeOf(e);if(i.name&&i.name!==e.name&&n.addModule(i),!e.moduleName&&e.name&&(e.moduleName=e.name),-1===r.findIndex((t=>e.moduleName===t.moduleName))&&r.push(e),n.defineModule(e),n.defineElementMethods(o.methodNames,o),n.defineElementProperties(e.properties),n.constructor.prototype.modules=r,t)for(let t in JQX.Elements.tagNames){const r=JQX.Elements.tagNames[t];let o=Object.getPrototypeOf(r),i=[];for(;o!==HTMLElement;)i.push(o.prototype),o=Object.getPrototypeOf(o);i.indexOf(n)>=0&&r!==n&&r.prototype.addModule(e)}}defineModule(e){if(e.isDefined)return;e.prototype._initModule=function(e){this.ownerElement=e};const t=e.properties||{},n=Object.keys(t),r=Object.getOwnPropertyNames(e.prototype);e.prototype.methodNames=r;for(let r=0;r<n.length;r+=1){const o=n[r],i=t[o];Object.defineProperty(e.prototype,o,{configurable:!1,enumerable:!0,get(){return this.ownerElement?this.ownerElement[o]:i.value},set(e){this.ownerElement[o]=e}})}e.isDefined=!0}getStaticMember(e,t){const r=window[n][this.elementName],o=r[e];t||(t="");let i="array"===t?[]:"string"===t?"":{},s=Object.getPrototypeOf(r),a=[];for(;s[e];)a.push(s[e]),s=Object.getPrototypeOf(s);for(let e=a.length-1;e>=0;e--)if("array"===t)for(let t=0;t<a[e].length;t++)-1===i.indexOf(a[e][t])&&i.push(a[e][t]);else"string"===t?-1===i.indexOf(a[e])&&(i+=a[e]):i=y.Core.assign(i,a[e]);if("array"===t){for(let e=0;e<o.length;e++)-1===i.indexOf(o[e])&&i.push(o[e]);return i}return"string"===t?(-1===i.indexOf(o)&&(i+=o),i):y.Core.assign(i,o)}defineElementHierarchicalProperties(e,t){const n=this,r=[];!function(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if("messages"===i)continue;const s=e[i],a=Object.keys(s),l=a.indexOf("value")>=0&&a.indexOf("type")>=0&&"object"==typeof s.value;if("propertyObject"===s.type||l){const e=function(n,o){if(!n.value)return;const i=Object.keys(n.value);for(let s=0;s<i.length;s++){const a=i[s],l=n.value[a],d=o+"_"+a;if("object"!=typeof l||null===l)break;const c=Object.keys(l);if(!(c.indexOf("value")>=0&&c.indexOf("type")>=0))break;if("array"!==n.type&&(n.isHierarchicalProperty=!0),l.parentPropertyName=o,t){const e=t._properties[d];if(n.value.hasOwnProperty(a)){if(e.isDefined)continue;delete n.value[a]}e.isDefined=!0,Object.defineProperty(n.value,a,{configurable:!1,enumerable:!0,get:()=>t._properties[d].value,set(e){t.updateProperty(t,t._properties[d],e)}})}r[d]||(r[d]=l,r.length++),("propertyObject"===l.type||"object"==typeof l.value&&"array"!==l.type)&&e(t?t._properties[d]:l,d)}};e(s,i)}}}(e),r.length>0&&!t&&n.defineElementProperties(r)}defineElement(){const e=this,t=e.constructor.prototype,r=e.getStaticMember("properties"),o=Object.getOwnPropertyNames(t);t.extendedProperties={},t.boundProperties={},t.templateListeners={},e.defineElementModules(),e.defineElementMethods(o,t),e.defineElementProperties(r),e.defineElementHierarchicalProperties(e.extendedProperties),t._initElement=function(){const e=this,r=t.extendedProperties,o=Object.keys(r),i=e.modules;e.$=y.Extend(e),e.$document=w,e.smartId=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),e.isCreated||(e.modulesList=[],e._properties=[],e._beforeCreatedProperties&&(e._properties=e._beforeCreatedProperties,delete e._beforeCreatedProperties),e.detachedChildren=[],e.propertyByAttributeName=[]);for(let t=0;t<i.length;t+=1){let n=new(0,i[t]);n._initModule(e),e.modulesList.push(n)}const s=[];for(let t=0;t<o.length;t+=1){const n=o[t],i=r[n];let a=i.value;if(e._properties[n]){if(void 0!==e._properties[n].notify)continue;delete e._properties[n]}if(E&&"innerHTML"===n&&delete e[n],-1===window.navigator.userAgent.indexOf("PhantomJS")&&e.hasOwnProperty(n))if(i.isHierarchicalProperty&&e[n]){const t=e[n];s.push({name:n,value:t}),a=i.value,delete e[n]}else a=e[n],delete e[n];if("array"===i.type&&null!=a&&(a=a.slice(0)),"object"===i.type&&null!=a&&(a=Array.isArray(a)?a.slice(0):Object.assign({},a)),e._properties[n]={name:n,notify:i.notify,allowedValues:i.allowedValues,type:i.type,nullable:i.nullable,reflectToAttribute:i.reflectToAttribute,defaultReflectToAttribute:i.defaultReflectToAttribute,defaultReflectToAttributeConditions:i.defaultReflectToAttributeConditions,value:a,readOnly:i.readOnly,defaultValue:a,attributeName:i.attributeName,observer:i.observer,inherit:i.inherit,extend:i.extend,validator:i.validator},e.propertyByAttributeName[i.attributeName]=e._properties[n],!i.hasOwnProperty("type")){const t=e.localize("propertyUnknownType",{name:n});e.log(t)}if("any"===i.type||"propertyObject"===i.type)continue;const l=y.Types.getType(a);if(null!=a&&i.type!==l&&!i.validator){if("object"===i.type&&"array"===l)continue;if("number"===l&&["integer","int","float"].findIndex((e=>e===i.type))>=0)continue;const t=e.localize("propertyInvalidValueType",{name:n,actualType:l,type:i.type});e.log(t)}}if(e.defineElementHierarchicalProperties(e._properties,e),s.length&&"manual"!==window[n].RenderMode)for(let t=0;t<s.length;t++){const n=s[t];e[n.name]=n.value}e.isCreated=!0},t.registered()}defineElementMethods(e,t){const n=this.constructor.prototype,r=function(e,t){const n=Array.prototype.slice.call(arguments,2);return function(){if(!this.isReady&&"localize"!==t&&"localize"!==t&&"cloneNode"!==t&&"importStyle"!==t&&"log"!==t&&"parseAttributes"!==t){const e=this.localize("elementNotInDOM");this.log(e)}let r=this;for(let e=0;e<this.modulesList.length;e++){let n=this.modulesList[e];if(t in n){r=n;break}}const o=this.context,i=n.concat(Array.prototype.slice.call(arguments));let s=null;const a=function(e,t){return e===t||"number"===e&&("int"===t||"integer"===t||"float"===t)||"bool"===e&&"boolean"===t||"boolean"===e&&"bool"===t||"object"===e&&"any"===t||void 0};if(this.methods){const e=this.methods[t];if(e){const n=e.split(":");s=n[n.length-1].trim();const r=[],o=e.substring(1+e.indexOf("("),e.lastIndexOf(")")).split(",");let l="";for(let e=0;e<o.length;e++){const t=o[e];l+=t,t.indexOf(":")>=0?(r.push(l),l=""):l+=","}let d=r.length;for(let e=0;e<r.length;e++){const n=r[e].trim().split(":"),o=n[0].split("=")[0].trim().indexOf("?")>=0,s=n[1].indexOf("?")>=0,l=n[1].replace(/\?/gi,"").trim(),c=l.split("|");let u=n[0].split("=")[1];const p=y.Types.getType(i[e]);if(void 0===i[e]&&u){switch(u=u.trim(),l[0]){case"date":{let e=u.substring(u.indexOf("(")+1,u.lastIndexOf(")"));e=e.length>0?e.split(",").map((e=>parseInt(e))):[],u=0===e.length?new Date:new Date(e[0],e[1],e[2]);break}case"bool":case"boolean":u="true"===u||"1"===u;break;case"int":case"integer":u=parseInt(u);break;case"float":case"number":u=parseFloat(u);break;case"any":case"object":u=u.indexOf("{")>=0?JSON.parse(u):u}i.push(u)}else o&&d--;if(l!==p&&p){let n=!0;for(let e=0;e<c.length;e++)if(a(p,c[e])){n=!1;break}if(n&&(null!==i[e]||!s)){const n=this.localize("methodInvalidValueType",{name:t,actualType:p,type:l,argumentIndex:e});this.log(n)}}if(i.length<d){const e=this.localize("methodInvalidArgumentsCount",{name:t,actualArgumentsCount:i.length,argumentsCount:d});this.log(e)}}}}this.context=this;const l=e.apply(r,i);if(s){const e=void 0===y.Types.getType(l)?"void":y.Types.getType(l);if(!a(e,s)){const n=this.localize("methodInvalidReturnType",{name:t,actualType:e,type:s});this.log(n)}}return this.context=o,l}},o=["constructor","ready","created","render","attached","detached","appendChild","insertBefore","removeChild","connect","disconnectedCallback","connectedCallback","attributeChangedCallback","propertyChangedHandler","enableShadowDOM","isInShadowDOM","addPropertyBindings"];for(let i in e){let s=e[i];s&&s.startsWith&&s.startsWith("_")||void 0!==o.find((e=>e===s))||n.extendedProperties[s]||y.Types.isFunction(t[s])&&(n[s]=r(t[s],s))}}defineElementProperties(e){if(!e)return;const t=this,n=t.constructor.prototype,r=Object.keys(e),o=t.getStaticMember("properties");Object.assign(n.extendedProperties,e),t.updateProperty=function(e,t,n){const r=e;if(!t||t.readOnly)return;if(t.allowedValues){let e=!1;for(let r=0;r<t.allowedValues.length;r++)if(t.allowedValues[r]===n){e=!0;break}if(!e){const e=JSON.stringify(t.allowedValues).replace(/\[|\]/gi,"").replace(",",", ").replace(/"/gi,"'"),o="'"+n+"'",i=r.localize("propertyInvalidValue",{name:t.name,actualValue:o,value:e});return void r.log(i)}}const o=t.name,i=r._properties[o].value;if(t.validator&&r[t.validator]){const e=r.context;r.context=r;const o=r[t.validator](i,n);void 0!==o&&(n=o),r.context=e}if(i!==n){if(r.propertyChanging){const e=r.propertyChanging(o,i,n);if(!1===e||null===e)return}if(!t.hasOwnProperty("type")){const e=r.localize("propertyUnknownType",{name:o});r.log(e)}if("array"!==t.type||JSON.stringify(i)!==JSON.stringify(n)){if(null!=n&&"any"!==t.type&&"propertyObject"!==t.type&&t.type!==y.Types.getType(n)&&!t.validator||null===n&&!t.nullable){let e=!0;if("object"===t.type&&"array"===y.Types.getType(n)&&(e=!1),"number"===y.Types.getType(n)&&["integer","int","float"].findIndex((e=>e===t.type))>=0&&(e=!1),e){const e=r.localize("propertyInvalidValueType",{name:o,actualType:y.Types.getType(n),type:t.type});return void r.error(e)}}if(t.isUpdating=!0,t.isHierarchicalProperty){const e=function(t,n){if(!t)return;const o=Object.keys(t);for(let i=0;i<o.length;i++){const s=o[i],a=t[s];"object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date?e(a,n+"_"+s):r[n+"_"+s]=a}};e(n,o)}else r._properties[o].value=n;if(!t.isUpdatingFromAttribute&&t.reflectToAttribute&&r.$.setAttributeValue(t.attributeName,n,t.type),r.isReady&&(!r.ownerElement||r.ownerElement&&r.ownerElement.isReady)){if("wait"===o&&(n||!i||r.isCompleted||(r.classList.remove("jqx-visibility-hidden"),r.ownerElement&&r.ownerElement.updateBoundMappedNodes(),r.updateBoundMappedNodes(),r.complete())),"renderMode"===o)return;if(r.context!==r&&!r.wait){const e=r.context;r.context=r,r.propertyChangedHandler(o,i,n),r.context=e,t.observer&&r[t.observer]&&(r.context=r,r[t.observer](i,n),r.context=document),r._watch&&r._watch.properties.indexOf(o)>=0&&r._watch.propertyChangedCallback(o,i,n)}const e=t.notify||r.boundProperties[o];e&&(r.$.fireEvent(t.attributeName+"-changed",{context:r.context,oldValue:i,value:r[o]}),r.boundProperties[o]&&r.updateBoundNodes(o)),e&&r.templateProperties&&r.templateProperties[o]&&r.refreshTemplate(),r.dataContextProperties&&("dataContext"===o?r.applyDataContext():r.dataContextProperties[o]&&r.updateDataContextProperty(o))}t.isUpdating=!1}}};for(let t=0;t<r.length;t+=1){const i=r[t],s=e[i],a=y.Core.toDash(i),l=s.type||"any",d=l.indexOf("?")>=0||"any"===l;d&&"any"!==l&&(s.type=l.substring(0,l.length-1)),s.nullable=d,s.attributeName=a.toLowerCase(),s.name=i,s.reflectToAttribute=void 0===s.reflectToAttribute||s.reflectToAttribute,s.inherit&&o[i]&&(s.value=o[i].value),s.extend&&o[i]&&y.Core.assign(s.value,o[i].value),n.hasOwnProperty(i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get(){if(this._properties[i])return this._properties[i].value},set(e){const t=this;t.updateProperty(t,t._properties[i],e)}})}}}let C=[],S=[],x=[],E=!1;const A=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A&&parseInt(A[2],10)<=50&&(E=!0);class P{static register(e,t){const r=t.prototype;let o=a.toCamelCase(e).replace(/[a-z]+/,""),i=t.version||window[n].Version;if(window.customElements.get(e)&&window.customElements.get(e).version===i)return;let s=e;for(i=i.split(".");window.customElements.get(e);)e=s+"-"+i.join("."),i[2]=parseInt(i[2])+1;if(!C[e]){if(e.startsWith(n.toLowerCase()))C[e]=window[n][o]=window[n.toLowerCase()+o]=t;else{let r=e.split("-")[0];r=r.substring(0,1).toUpperCase()+r.substring(1),window[n][r]||(window[n][r]={}),C[e]=window[n][r][o]=window[r.toLowerCase()+o]=t,window[n][o]&&(o=a.toCamelCase(e)),window[n][o]=t}r.elementName=o,r.defineElement(),S[e]&&S[e](r),window.customElements.define(e,t)}}static registerElements(){const e=this;if(e.toRegister){e.isRegistering=!0;for(let t=0;t<e.toRegister.length;t++){const n=e.toRegister[t];e.register(n.tagName,n.element)}e.isRegistering=!1}}static get(e){if(C[e])return C[e]}static whenRegistered(e,t){if(!e)throw new Error("Syntax Error: Invalid tag name");const n=S[e],r=this.get(e),o=r?r.modules.length:3;try{n||r?!n&&r?(t(r.prototype),S[e]=void 0):n&&!r?S[e]=function(e){n(e),t(e)}:n&&r&&(r.proto&&(n(r.proto),t(r.proto)),S[e]=void 0):S[e]=function(e){try{t(e)}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}}}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}if(r&&o!==r.prototype.modules.length){const t=document.querySelectorAll(e);for(let e=0;e<t.length;e++){const n=t[e];n.isCreated&&n._initElement()}}}}P.lazyRegister=!1,P.tagNames=[];class T{constructor(){const e=this;e.name="observableArray",e.observables=arguments.length<3?null:arguments[2];const t=new Proxy(e,{deleteProperty:function(e,t){return delete e[t],!0},apply:function(e,t,n){return e.apply(t,n)},get:function(t,n){return"symbol"==typeof(r=n)||"object"==typeof r&&"[object Symbol]"===Object.prototype.toString.call(r)||t[n]||isNaN(parseInt(n))?t[n]:e.getItem(parseInt(n));var r},set:function(t,n,r){return t[n]||isNaN(parseInt(n))?(t[n]=r,!0):(e.setItem(parseInt(n),r),!0)}});if(e._addArgs={eventName:"change",object:t,action:"add",index:null,removed:new Array,addedCount:1},e._removeArgs={eventName:"change",object:t,action:"remove",index:null,removed:null,addedCount:0},arguments.length>=1&&Array.isArray(arguments[0])){e._array=[];const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else e._array=Array.apply(null,arguments);return 2===arguments.length&&(e.notifyFn=arguments[1]),t}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){return this._array}_getItem(e,t){const n=this;return"string"==typeof t||"number"==typeof t||void 0===t?t:new Proxy(t,{deleteProperty:function(e,t){return delete e[t],!0},set:function(t,r,o){const i=t[r];return t[r]=o,!n._canNotify||!1===t.canNotify||(n.observables&&!n.observables[r]||n._notify({eventName:"change",object:n,target:t,action:"update",index:e,path:e+"."+r,oldValue:i,newValue:o,propertyName:r}),!0)}})}getItem(e){return this._array[e]}setItem(e,t){const n=this,r=n._array[e];n._array[e]=n._getItem(e,t),n._notify({eventName:"change",object:n._array,action:"update",index:e,removed:[r],addedCount:1})}get length(){return this._array.length}set length(e){const t=this;o.isNumber(e)&&t._array&&t._array.length!==e&&t.splice(e,t._array.length-e)}toString(){return this._array.toString()}toLocaleString(){return this._array.toLocaleString()}concat(){const e=this;e._addArgs.index=e._array.length;const t=e._array.concat.apply(e._array,arguments);return new JQX.ObservableArray(t)}join(e){return this._array.join(e)}pop(){const e=this;e._removeArgs.index=e._array.length-1,delete e[e._array.length-1];const t=e._array.pop();return e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}push(){const e=this;if(e._addArgs.index=e._array.length,1===arguments.length&&Array.isArray(arguments[0])){const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else{const t=e._getItem(e._addArgs.index,arguments[0]);e._array.push.apply(e._array,[t])}return e._addArgs.addedCount=e._array.length-e._addArgs.index,e._notify(e._addArgs),e._notifyLengthChange(),e._array.length}_notifyLengthChange(){const e=this;if(!e.canNotify)return;const t=e._createPropertyChangeData("length",e._array.length);e._notify(t)}_createPropertyChangeData(e,t,n){return{eventName:"change",object:this,action:e,value:t,oldValue:n}}reverse(){return this._array.reverse()}shift(){const e=this,t=e._array.shift();return e._removeArgs.index=0,e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}slice(e,t){return this._array.slice(e,t)}sort(e){return this._array.sort(e)}splice(e,t,n){const r=this,o=r._array.length;let i;if(n&&n.length)for(let o=0;o<n.length;o++)i=r._array.splice(e+o,t,n[o]);else i=r._array.splice.apply(r._array,arguments);if(n){let t=r.canNotify;if(r.canNotify=!1,n.length)for(let t=0;t<n.length;t++)r.setItem(e+t,n[t]);else r.setItem(e,n);r.canNotify=t,r._notify({eventName:"change",object:this,action:"add",index:e,added:i,addedCount:r._array.length>o?r._array.length-o:0})}else r._notify({eventName:"change",object:this,action:"remove",index:e,removed:i,addedCount:r._array.length>o?r._array.length-o:0});return r._array.length!==o&&r._notifyLengthChange(),i}unshift(){const e=this,t=e._array.length,n=e._array.unshift.apply(e._array,arguments);return e._addArgs.index=0,e._addArgs.addedCount=n-t,e._notify(this._addArgs),e._notifyLengthChange(),n}indexOf(e,t){const n=this;for(let r=t||0,o=n._array.length;r<o;r++)if(n._array[r]===e)return r;return-1}lastIndexOf(e,t){const n=this;for(let r=t||n._array.length-1;r>=0;r--)if(n._array[r]===e)return r;return-1}find(e,t){return this._array.find(e,t)}findIndex(e,t){return this._array.findIndex(e,t)}every(e,t){return this._array.every(e,t)}some(e,t){return this._array.some(e,t)}forEach(e,t){this._array.forEach(e,t)}map(e,t){return this._array.map(e,t)}filter(e,t){return this._array.filter(e,t)}reduce(e,t){return void 0!==t?this._array.reduce(e,t):this._array.reduce(e)}reduceRight(e,t){return void 0!==t?this._array.reduceRight(e,t):this._array.reduceRight(e)}move(e,t){this.splice(t,0,this.splice(e,1)[0])}}let D={};window[n]&&(D=window[n]),window[n]=function(e,t){let r=e;if(e){if(e.indexOf("#")>=0||e.indexOf(".")>=0)return u[e]?u[e]:t?(u[e]=new t,function(e,t){const n=t.properties;t._properties=[];const r=function(n,o){const i=Object.keys(n);for(let s=0;s<i.length;s++){const a=i[s],l=n[a];t._properties[o+a]=l,Array.isArray(l)?t._properties[o+a]=new T(l,(function(t){const n=a+"."+t.path,r=t.newValue,o=document.querySelector(e);if(o){const e=n.split(".");let t=o;for(let n=0;n<e.length;n++)t=t[e[n]];t=r}})):(Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>t._properties[o+a],set(e){t._properties[o+a]=e}}),l&&"DataAdapter"===l.constructor.name||l&&"object"==typeof l&&JQX.DataAdapter&&l instanceof JQX.DataAdapter||"object"==typeof l&&l&&Object.keys(l).length>0&&r(l,o+a+"."))}};r(n,""),Object.defineProperty(t,"properties",{configurable:!1,enumerable:!0,get:()=>n});const o=document.querySelector(e);if(o&&o.isReady)for(let e in n)if("properties"===e){const t=n[e];for(let e in t)o[e]=t[e]}else o[e]=n[e];else if(o){o.props={};for(let e in n)o.props[e]=n[e]}}(e,u[e]),u[e]):void 0;if(t){if(P.tagNames[e]=t,P.lazyRegister){P.toRegister||(P.toRegister=[]);const e=a.toCamelCase(r).replace(/[a-z]+/,"");return window[n][e]=t,void P.toRegister.push({tagName:r,element:t})}P.register(r,t)}}},window.addEventListener("load",(function(){const e=window[n].Elements.tagNames;let t=[];for(let r in e){const o=e[r];let i=document.querySelectorAll("["+r+"]");for(let e=0;e<i.length;e++){const t=i[e];t instanceof HTMLDivElement&&(t.__proto__=o.prototype,t.created(),t.connectedCallback()),t.classList.add("jqx-element-ready")}let s=o.name;"Item"===s&&(s="ListItem"),i=document.querySelectorAll('[is="'+n.toLocaleLowerCase()+s+'"]');for(let e=0;e<i.length;e++)t.push(i[e])}if(t.length>0){const e=e=>{let t=[],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t.sort((function(t,n){let r=e(t).length,o=e(n).length;return r<o?1:r>o?-1:0}));for(let e=0;e<t.length;e++){const n=t[e],r=n.getAttribute("is");let o;o="smartItem"===r?new window.smartListItem(n):new window[r](n),o.removeAttribute("is")}}}));const L=function(){if("complete"===document.readyState&&"manual"!==window[n].RenderMode){x.sort((function(e,t){let n=e.element.parents.length,r=t.element.parents.length;return n<r?-1:n>r?1:0}));for(let e=0;e<x.length;e++)window[n].RenderMode="",x[e].element.isLoading=!1,x[e].callback(),window[n].RenderMode="";x=[],document.removeEventListener("readystatechange",L)}};Object.assign(window[n],{Elements:P,Modules:[],BaseElement:class extends _{static get observedAttributes(){let e=this,t=["external-style"];for(let n in e.prototype.extendedProperties){const r=e.prototype.extendedProperties[n];t.push(r.attributeName)}return t}static get styleUrls(){return[]}static get styles(){return""}get styleUrl(){return this._styleUrl}set styleUrl(e){this._styleUrl=e}get isInShadowDOM(){const e=this,t=e.getRootNode();return!e.hasAttribute("jqx-blazor")&&t!==document&&t!==e}getShadowRootOrBody(){const e=this;return e.isInShadowDOM&&e.getRootNode().host?e.getRootNode().host.shadowRoot:document.body}get enableShadowDOM(){return window[n].EnableShadowDOM}importStyle(e,t){this._importStyle(e,t)}_importStyle(e,t){const n=this;if(!n.shadowRoot||!e)return;const r=e=>{const r=n.shadowRoot.children;for(let n=0;n<r.length;n++){const o=r[n];if(o instanceof HTMLLinkElement&&o.href===e)return t&&t(),null}const o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.onload=t,o},o=(()=>{const e=n.shadowRoot.children;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r instanceof HTMLLinkElement&&(t=r)}return t})(),i=(e,t)=>{t.parentNode.insertBefore(e,t.nextSibling)};if(Array.isArray(e)){const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=r(e[n]);o&&t.appendChild(o)}o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}else{const t=r(e);if(!t)return;o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}}attributeChanged(e,t,n){"style-url"===e&&(this.styleUrl=n)}attributeChangedCallback(e,t,n){this.isReady&&super.attributeChangedCallback(e,t,n)}constructor(e,t){super();const n=this;if(e){t&&(n._initProperties=t);const r=e=>{if("string"==typeof e?document.querySelector(e):e){const r="string"==typeof e?document.querySelector(e):e;if(r instanceof HTMLDivElement){const o=document.createElement(n.tagName);for(let e of r.attributes)o.setAttribute(e.name,r.getAttribute(e.name));for(;r.childNodes.length;)o.appendChild(r.firstChild);return"string"==typeof e&&(o.id=e.substring(1)),o._initProperties=t,r.parentNode&&r.parentNode.replaceChild(o,r),o}if(t){const e=r.context;if(r._initProperties=t,r.isReady){r.context=r;const n={},o={};for(let e in t)n[e]=r[e],o[e]=t[e];Object.getOwnPropertyNames(t).length>0&&(r.initProperties(),r.propertyChangedHandler(t,n,o)),r.context=e}}return r}};if("string"==typeof e){const t=document.querySelectorAll(e),n=[];if(t.length>1){for(let e=0;e<t.length;e++){const o=r(t[e]);n.push(o)}return n}}else if(e&&e.length>0){const t=e;if(t.length>1){for(let e=0;e<t.length;e++){const n=r(t[e]);C.push(n)}return C}}return r(e)}n._styleUrl="",n.isUtilityElement||n.created()}_getRootShadowParent(){let e=this.shadowParent;for(;e;){if(!e.shadowParent)return e;e=e.shadowParent}return e||this.shadowParent}_getStyleUrl(e){let t=y.Core.getScriptLocation()+window[n].StyleBaseUrl+e;return this.shadowParent&&(t=t.replace("scoped/","")),t}_getStyleUrls(){const e=this;e.nodeName.startsWith(n);const t=e.getStaticMember("styleUrls","array"),r=[];for(let n=0;n<t.length;n++){const o=t[n],i=e._getStyleUrl(o);r.push(i)}return r}_setupShadowRoot(){const e=this;e.classList.add("jqx-element-init");const t=t=>{t.$.root&&(t.$.root.classList.add(n.toLowerCase()+"-element"),t.$.root.classList.add(e.nodeName.toLowerCase())),t.setup(),t.classList.remove("jqx-element-init")};if(document.adoptedStyleSheets)if(window[n].AdoptedStyleSheets)window[n].AdoptedStyleSheetsLoaded?(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,t(e)):(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,window[n].AdoptedStyleSheetsLoadedQueue||(window[n].AdoptedStyleSheetsLoadedQueue=[]),window[n].AdoptedStyleSheetsLoadedQueue.push(e));else{const r=new CSSStyleSheet;let o=y.Core.getScriptLocation()+"/styles/jqx.default.css";r.replace('@import url("'+o+'")').then((()=>{if(t(e),window[n].AdoptedStyleSheetsLoaded=!0,window[n].AdoptedStyleSheetsLoadedQueue){const e=window[n].AdoptedStyleSheetsLoadedQueue;for(let n=0;n<e.length;n++){const r=e[n];t(r)}delete window[n].AdoptedStyleSheetsLoadedQueue}})).catch((e=>{console.error("Failed to load:",e)})),window[n].AdoptedStyleSheets=[r],document.adoptedStyleSheets=[r],e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets}}connect(){const e=this;window[n].EnableShadowDOM&&!e.shadowRoot&&!0!==e.isInShadowDOM&&(e.attachShadow({mode:"open"}),e.shadowRoot&&e.$.root&&(e.shadowRoot.appendChild(e.$.root),e.$.root.classList.add(e.nodeName.toLowerCase()))),e.shadowRoot||e.shadowParent?e.shadowRoot?e._setupShadowRoot():(e.shadowParent&&window[n].EnableShadowDOM,e.setup()):e.setup()}connectedCallback(){const e=this;if(e.isLoading||e.isUtilityElement)return;e.classList.add("jqx-element-init");const t=function(){e.classList.remove("jqx-element-init")};if("complete"===document.readyState&&(void 0===window[n].isAngular&&(window[n].isAngular=null!==document.body.querySelector("[ng-version]")),void 0===window[n].isVue&&(window[n].isVue=null!==document.querySelector(".vue-root")),window[n].isAngular))for(let t=0;t<e.parents.length&&!e.parents[t].nodeName.toLowerCase().startsWith(n.toLowerCase()+"-");t++)if(e.parents[t].hasAttribute("ng-version")&&!e.classList.contains("jqx-angular")){window[n].RenderMode="manual";break}if("complete"===document.readyState&&"manual"!==window[n].RenderMode){const n=e.parents;n.length&&"HTML"===n[n.length-1].nodeName||e.getRootNode().host?(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),t(),e.connect()):(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),n.length>0&&(e.checkIsInDomTimer=setInterval((()=>{const n=e.parents;0===n.length&&clearInterval(e.checkIsInDomTimer),n.length>0&&"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomTimer),t(),e.connect())}),100)))}else e.isLoading=!0,x.push({element:this,callback:function(){this.isReady||(t(),this.connect())}.bind(e)})}disconnectedCallback(){const e=this;e.isAttached?(e.shadowParent=null,e.detached()):e._resetShadowParent()}adoptedCallback(){this.setup()}appendTemplate(e){const t=this;t.shadowRoot?t.shadowRoot.appendChild(e):t.appendChild(e)}_resetShadowParent(){const e=this;if(!window[n].EnableShadowDOM||null===e.shadowParent)return;const t=[];let r=e.parentNode;for(;r&&9!==r.nodeType;){if(r instanceof HTMLElement==1)t.push(r);else if(11===r.nodeType&&r.host){r=r.host;continue}r=r.parentNode}for(let n=0;n<t.length;n++)if(t[n]===e.shadowParent)return;t.length>0&&"HTML"===t[t.length-1].nodeName&&(e.shadowParent=null)}},Utilities:y,Import:function(e,t){let n=0;const r=function(e,t){return new Promise((n=>{const r=document.createElement("script");r.src=e,r.onload=n;for(let e=0;e<document.head.children.length;e++){const r=document.head.children[e];if(r.src&&r.src.toString().indexOf(t)>=0)return void n()}document.head.appendChild(r)}))};return new Promise((o=>{const i=y.Core.getScriptLocation(),s=function(t){if(!e[t])return;const a=i+"/"+e[t];r(a,e[t]).then((function(){n++,n===e.length&&o(),s(t+1)}))};if(t)for(let t=0;t<e.length;t++){const s=i+"/"+e[t];r(s,e[t]).then((function(){n++,n===e.length&&o()}))}else s(0)}))},ObservableArray:T,Observable:class{constructor(e,t){const n=this;var r;return this.name="observable",e&&Object.assign(n,e),r=e,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((e=>"constructor"===e||!!e.startsWith("_")||void(n[e]=r[e]))),new Proxy(n,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){return e[t]},set:function(e,r,o){const i=e[r];return i===o||(e[r]=o,!("notifyFn"!==r&&!r.startsWith("_")&&"canNotify"!==r&&(!t||-1!==t.indexOf(r))&&n.canNotify&&(n._notify({target:e,propertyName:r,oldValue:i,newValue:o}),0)))}})}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;if(t.canNotify&&t.notifyFn)for(let n=0;n<t.notifyFn.length;n++)t.notifyFn[n](e)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}},Component:class{constructor(e,t){const n=this.name;let r=null;return e?r=new window[n](e,t):(r=new window[n],r._initProperties=t),this._element=r,r}get name(){return"Component"}get element(){return this._element}},Theme:D.Theme||"",EnableShadowDOM:D.ShadowDom||!1,BaseUrl:"./",StyleBaseUrl:"/styles/default/",Version:e,Templates:t,RenderMode:D.RenderMode||"auto",Render:function(){const e=()=>{window[n].RenderMode="",L()};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))},Data:u,Mode:D.Mode||"production",License:D.License||"Evaluation"});let O=window[n].Theme;"manual"!==window[n].RenderMode&&document.addEventListener("readystatechange",L),Object.defineProperty(window[n],"Theme",{configurable:!1,enumerable:!0,get:()=>O,set(e){const t=O;O=e,w.fireEvent("theme-changed",{oldValue:t,newValue:e},{bubbles:!0,cancelable:!0})}}),window[n]("jqx-base-element",window[n].BaseElement),window[n]("jqx-content-element",class extends window[n].BaseElement{static get properties(){return{content:{type:"any",reflectToAttribute:!1},innerHTML:{type:"string",reflectToAttribute:!1}}}template(){return"<div inner-h-t-m-l='[[innerHTML]]'></div>"}ready(){super.ready(),this.applyContent()}refresh(){}clearContent(){const e=this;for(;e.$.content.firstChild;)e.$.content.removeChild(e.$.content.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.content);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let n=document.createElement("div");t.appendChild(n),e.content instanceof HTMLElement?n.appendChild(e.content):n.innerHTML=e.content;let r=Array.from(n.childNodes);n.parentNode.removeChild(n);for(let e=0;e<r.length;e++)t.appendChild(r[e]);e.clearContent(),e.$.content.appendChild(t)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const r=this;t!==n&&("innerHTML"===e&&(r.content=n,r.applyContent(),r.innerHTML=r.content=y.Core.html(r.$.content)),"content"===e&&r.applyContent())}}),window[n]("jqx-scroll-viewer",class extends window[n].ContentElement{static get properties(){return{autoRefresh:{type:"boolean",value:!1},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},touchScrollRatio:{type:"any",value:null},touchVelocityCoefficient:{type:"number",value:50},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{touchmove:"_touchmoveHandler",touchstart:"_touchstartHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler"}}static get styleUrls(){return["jqx.scrollviewer.css"]}template(){return'<div id="container" class="jqx-container" role="presentation">\n <div id="scrollViewerContainer" class="jqx-scroll-viewer-container" role="presentation">\n <div id="scrollViewerContentContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-scroll-viewer-content-container" role="presentation">\n <content></content>\n </div>\n </div>\n <jqx-scroll-bar id="verticalScrollBar" theme="[[theme]]" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></jqx-scroll-bar>\n <jqx-scroll-bar id="horizontalScrollBar" theme="[[theme]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></jqx-scroll-bar>\n </div>'}appendChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.appendChild(e)}}removeChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.removeChild(e)}}removeAll(){const e=this;e.isCompleted&&(e.$.scrollViewerContentContainer.innerHTML="")}_horizontalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.left=(t.rightToLeft?1:-1)*t.scrollLeft+"px",e.stopPropagation&&e.stopPropagation(),t.onHorizontalChange&&t.onHorizontalChange(e)}_verticalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.top=-t.scrollTop+"px",e.stopPropagation&&e.stopPropagation(),t.onVerticalChange&&t.onVerticalChange(e)}_touchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const n=t.scrollHeight>0,r=t.scrollWidth>0,o=t._touchCoords;if(!n&&!r||!o)return;const i=e.touches[0];let s,a,l,d;t._touchCoords=[i.pageX,i.pageY],n?(s=t.scrollTop,a=t.scrollHeight,l=i.pageY,d=o[1]):(s=t.scrollLeft,a=t.scrollWidth,l=i.pageX,d=o[0]);const c=parseFloat(l.toFixed(5)),u=parseFloat(d.toFixed(5));0===s&&c>=u||s===a&&c<=u||(l!==d&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_touchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_mouseWheelHandler(e){const t=this;if(!t.disabled&&(t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)){if(e.shiftKey&&t.computedHorizontalScrollBarVisibility){const n=t.scrollLeft;if(0===n&&e.deltaX<0||n===t.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth)))}if(t.computedVerticalScrollBarVisibility){const n=t.scrollTop;if(0===n&&e.deltaY<0||n===t.scrollHeight&&e.deltaY>0)return;if(e.stopPropagation(),e.preventDefault(),t.scrollHeight>0){t._wheelrafId=0;const n=()=>{t.scrollTop+=e.deltaY};cancelAnimationFrame(t._wheelrafId),t._wheelrafId=0,t._wheelrafId=requestAnimationFrame(n)}}}}_overriddenHandler(){}_upHandler(){delete this._touchCoords,delete this._touchmoveInside}_getScrollCoefficient(e,t){const n=e.deltaMode,r=Math.abs(e.deltaY);let o;return 0===n?o=r<100/3?r:t:1===n?o=r<1?r*(100/3):t:2===n&&(o=t),e.deltaY<0?-o:o}applyContent(){super.applyContent(),this.refresh()}get computedHorizontalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?!e._scrollView.hScrollBar.$.hasClass("jqx-hidden"):null}get computedVerticalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?!e._scrollView.vScrollBar.$.hasClass("jqx-hidden"):null}scrollTo(e,t){const n=this;n._scrollView&&(void 0!==e&&n._scrollView.scrollTo(e),void 0!==t&&n._scrollView.scrollTo(t,!1))}refreshScrollBarsVisibility(){const e=this;e._scrollView&&(e._scrollView.hScrollBar.disabled=e.disabled,e._scrollView.vScrollBar.disabled=e.disabled,"disabled"===e.horizontalScrollBarVisibility&&(e._scrollView.hScrollBar.disabled=!0),"disabled"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.disabled=!0),e.scrollWidth>0?e._scrollView.hScrollBar.$.removeClass("jqx-hidden"):"visible"!==e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("jqx-hidden"),e.scrollHeight>0?e._scrollView.vScrollBar.$.removeClass("jqx-hidden"):"visible"!==e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("jqx-hidden"),"hidden"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("jqx-hidden"),"hidden"===e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("jqx-hidden"),"visible"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.removeClass("jqx-hidden"),"visible"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.$.removeClass("jqx-hidden"),e.disabled||(e._scrollView.vScrollBar.disabled=e.scrollHeight<=0)),e.computedHorizontalScrollBarVisibility&&e.computedVerticalScrollBarVisibility?(e._scrollView.hScrollBar.$.addClass("bottom-corner"),e._scrollView.vScrollBar.$.addClass("bottom-corner")):(e._scrollView.hScrollBar.$.removeClass("bottom-corner"),e._scrollView.vScrollBar.$.removeClass("bottom-corner")))}ready(){super.ready();const e=this;e.$.verticalScrollBar.onChange=t=>{t.detail=t,e._verticalScrollbarHandler(t)},e.$.horizontalScrollBar.onChange=t=>{t.detail=t,e._horizontalScrollbarHandler(t)},e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._customScrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.refresh()}refresh(){const e=this;function t(){const t=e.$.scrollViewerContainer.classList.contains("vscroll");e.$.scrollViewerContainer.classList.remove("vscroll");const n=e.$.scrollViewerContentContainer.offsetWidth-e.$.scrollViewerContainer.offsetWidth;return n>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("hscroll"):e.$.scrollViewerContainer.classList.remove("hscroll"),t&&e.$.scrollViewerContainer.classList.add("vscroll"),n}function n(){let t;const n=e.$.scrollViewerContainer.classList.contains("hscroll");if(e.$.scrollViewerContainer.classList.remove("hscroll"),JQX.Utilities.Core.Browser.Safari){const n=e.$.scrollViewerContentContainer.getBoundingClientRect().height,r=e.$.scrollViewerContainer.getBoundingClientRect().height;t=n&&r?parseInt(n)-parseInt(r):e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight}else t=e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight;return e.virtualScrollHeight&&(t=e.virtualScrollHeight),t>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("vscroll"):e.$.scrollViewerContainer.classList.remove("vscroll"),n&&e.$.scrollViewerContainer.classList.add("hscroll"),t}if(!e.$.scrollViewerContentContainer)return;"hidden"===e.verticalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-vertical",""),"hidden"===e.horizontalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-horizontal","");let r=e.scrollWidth,o=e.scrollHeight;e.scrollWidth=t(),e.scrollHeight=n(),e.scrollHeight&&o===e.scrollHeight||(e.scrollWidth=t()),e.scrollWidth&&r===e.scrollWidth||(e.scrollHeight=n()),e.computedVerticalScrollBarVisibility&&(e.scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.computedHorizontalScrollBarVisibility&&(e.scrollWidth+=e._scrollView.vScrollBar.offsetWidth),0===e.scrollHeight&&e.scrollWidth>0&&e.$.container.offsetHeight-e.$.content.offsetHeight<5&&(e.$.container.style.paddingBottom=e._scrollView.hScrollBar.offsetHeight+"px"),e.autoRefresh&&(e.$.scrollViewerContainer.scrollLeft=0,e.$.scrollViewerContainer.scrollTop=0)}attached(){const e=this;super.attached(),e._scrollView||e._customScrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar))}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView)}get scrollWidth(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?1===e._scrollView.hScrollBar.max&&"visible"===e.horizontalScrollBarVisibility?0:e._scrollView.hScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(0===e&&"visible"===t.horizontalScrollBarVisibility?t._scrollView.hScrollBar.max=0:t._scrollView.hScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollHeight(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?1===e._scrollView.vScrollBar.max&&"visible"===e.verticalScrollBarVisibility?0:e._scrollView.vScrollBar.max:0}set scrollHeight(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(0===e&&"visible"===t.verticalScrollBarVisibility?t._scrollView.vScrollBar.max=1:t._scrollView.vScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollLeft(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?e._scrollView.hScrollBar.value:0}set scrollLeft(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(t._scrollView.hScrollBar.value=e)}get scrollTop(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?e._scrollView.vScrollBar.value:0}set scrollTop(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(t._scrollView.vScrollBar.value=e)}propertyChangedHandler(e,t,n){const r=this;super.propertyChangedHandler(e,t,n),"animation"!==e&&"theme"!==e&&r.refresh()}}),window[n].Utilities.Assign("PositionDetection",class{constructor(e,t,n,r){const o=this;if(t){const n="dropDown"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);t.id=n,e.setAttribute("aria-owns",n)}o.context=e,o.dropDown=t,o.defaultParent=n,o.closeMethod=r}handleAutoPositioning(){const e=this,t=e.context;if("auto"!==t.dropDownPosition||t.disabled||t.isHidden)return;const n=window.requestAnimationFrame;let r,o=Date.now();return r=n((function i(){t.isHidden||document.hidden||(r=n(i),"auto"===t.dropDownPosition&&!t.disabled&&(t.isInShadowDOM?document.body.contains(t.shadowParent):document.body.contains(t))||cancelAnimationFrame(r),t.isHidden&&cancelAnimationFrame(r),Date.now()-o>=200&&(e.scrollHandler(),o=Date.now()))}))}checkBrowserBounds(e){const t=this.context;if("auto"===t.dropDownPosition&&!t.disabled)switch(e){case"vertically":this.checkBrowserBoundsVertically();break;case"horizontally":this.checkBrowserBoundsHorizontally();break;default:this.checkBrowserBoundsVertically(),this.checkBrowserBoundsHorizontally()}}checkBrowserBoundsHorizontally(){const e=this.context,t=this.dropDown;let n,r=0;a.isMobile||window.innerWidth===document.documentElement.clientWidth||(r=window.innerWidth-document.documentElement.clientWidth),null!==e._dropDownParent?n=!0:t.style.left="";const o=window.innerWidth-r;let i=e.getBoundingClientRect().left;if(i<0&&(t.style.left=(n?0:Math.abs(i))+"px",i=parseFloat(t.style.left)),i+t.offsetWidth>o){let e=i-Math.abs(o-i-t.offsetWidth);n&&(e+=window.pageXOffset),t.style.left=(n?e:e-i)+"px",window.innerWidth===document.documentElement.clientWidth&&(t.style.left=parseFloat(t.style.left)+r+"px"),n&&window.innerHeight===document.documentElement.clientHeight&&this.positionDropDown(!0)}}checkBrowserBoundsVertically(e){const t=this.context,n=this.dropDown,r=t._dropDownListPosition;e||(e=t.getBoundingClientRect()),0!==e.height&&(document.documentElement.clientHeight-Math.abs(e.top+e.height+n.offsetHeight)>=0?t._dropDownListPosition="bottom":e.top-n.offsetHeight>=0?t._dropDownListPosition="top":t._dropDownListPosition="overlay-center",this.updatePositionAttribute(r,t._dropDownListPosition))}scrollHandler(){const e=this.context;if(!e.parentElement)return;const t=e.getBoundingClientRect();if(t.top===e._positionTop)return;const n=e._dropDownListPosition;this.checkBrowserBoundsVertically(t),e._dropDownListPosition!==n&&this.positionDropDown(),e._positionTop=t.top}getDropDownParent(e){const t=this.context,n=this.dropDown;let r=t.dropDownAppendTo;t._positionedParent=null,null===r?t._dropDownParent=null:"body"===r||r===document.body?t.getRootNode().host?t._dropDownParent=t.getRootNode().host.shadowRoot:t._dropDownParent=document.body:r instanceof HTMLElement?t._dropDownParent=r:"string"==typeof r?(r=document.getElementById(r),r instanceof HTMLElement?t._dropDownParent=r:(t.dropDownAppendTo=null,t._dropDownParent=null)):(t.dropDownAppendTo=null,t._dropDownParent=null);let o=t._dropDownParent;if(null!==o){for(;o&&o instanceof HTMLElement&&"static"===window.getComputedStyle(o).position&&o!==t.getShadowRootOrBody();)o=o.parentElement;o===document.body?t._positionedParent=null:t._positionedParent=o,n&&(n.setAttribute("animation",t.animation),""!==t.theme&&n.$.addClass(t.theme),e&&(t._dropDownParent.appendChild(n),n.$.addClass("jqx-drop-down-repositioned")),-1===t.detachedChildren.indexOf(n)&&t.detachedChildren.push(n))}}dropDownAppendToChangedHandler(){const e=this.context,t=this.dropDown,n=e._dropDownParent;this.getDropDownParent(),e._dropDownParent!==n&&(e[this.closeMethod](),["left","top","font-size","font-family","font-style","font-weight"].forEach((e=>t.style[e]=null)),null===e._dropDownParent?(this.defaultParent.appendChild(t),t.$.removeClass("jqx-drop-down-repositioned")):(e._dropDownParent.appendChild(t),t.$.addClass("jqx-drop-down-repositioned")))}dropDownPositionChangedHandler(){const e=this;e.dropDown.style.transition="none",e.context[e.closeMethod](),e.setDropDownPosition(),e.handleAutoPositioning()}dropDownAttached(e){const t=this.context;null!==t._dropDownParent&&(t._dropDownParent.appendChild(this.dropDown),this.handleAutoPositioning(),e&&t[e]())}dropDownDetached(){const e=this.context;null!==e._dropDownParent&&document.body.contains(this.dropDown)&&document.body.contains(e._dropDownParent)&&e._dropDownParent.removeChild(this.dropDown)}setDropDownPosition(){const e=this.context,t=e.dropDownPosition,n=e._dropDownListPosition;"auto"===t?this.checkBrowserBounds():e._dropDownListPosition=t,this.updatePositionAttribute(n,e._dropDownListPosition)}updatePositionAttribute(e,t){const n=this.context,r=this.dropDown;n.$.dropDownButton&&!n.$.dropDownButton.hasAttribute(t)&&(n.$.dropDownButton.removeAttribute(e),n.$.dropDownButton.setAttribute(t,"")),r.hasAttribute(t)||(r.style.transition="none",r.removeAttribute(e),r.setAttribute(t,""),requestAnimationFrame((function(){r.style.transition=null})))}positionDropDown(e){const t=this.context,n=this.dropDown;if(!t.opened||null===t._dropDownParent)return;const r=t.getBoundingClientRect();let o,i;if(this.customPositionDropDown){const e=this.customPositionDropDown(r);o=e.left,i=e.top}else switch(o=r.left,i=r.top,t._dropDownListPosition){case"bottom":i+=t.$.container.offsetHeight-1;break;case"center-bottom":i+=t.$.container.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"center-top":i-=n.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"top":i-=n.offsetHeight-1;break;case"overlay-bottom":break;case"overlay-center":i-=n.offsetHeight/2-t.offsetHeight/2;break;case"overlay-top":i-=n.offsetHeight-t.offsetHeight}const s=this.getDropDownOffset();n.style.top=i+s.y+"px",e||(n.style.left=o+s.x+"px")}getDropDownOffset(){const e=this.context._positionedParent;let t,n;if(e&&"#document-fragment"!==e.nodeName){const r=e.getBoundingClientRect();t=-r.left,n=-r.top}else t=window.pageXOffset,n=window.pageYOffset;return{x:t,y:n}}placeOverlay(){const e=this.context;if(!e.dropDownOverlay||e._overlay)return;const t=document.createElement("div");t.classList.add("jqx-drop-down-overlay"),t.style.width=document.documentElement.scrollWidth+"px",t.style.height=document.documentElement.scrollHeight+"px",document.body.appendChild(t),e._overlay=t}removeOverlay(e){const t=this,n=t.context;n._overlay&&(n.hasAnimation&&e?requestAnimationFrame((function e(){t.dropDown.getBoundingClientRect().height>0?requestAnimationFrame(e):(document.body.removeChild(n._overlay),delete n._overlay)})):(document.body.removeChild(n._overlay),delete n._overlay))}}),window.JQX.Color=class{constructor(e){if(window.JQX._colors||(window.JQX._colors=[]),window.JQX._colors[e]){const t=window.JQX._colors[e];return this.hex=t.hex,this.r=t.r,this.g=t.g,void(this.b=t.b)}this.r=this.g=this.b=0,this.hex="";const t=this.getStandardizedColor(e);t&&(this.setHex(t.substring(1)),window.JQX._colors[e]={hex:this.hex,r:this.r,g:this.g,b:this.b})}getStandardizedColor(e){const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle}getInvertedColor(){return""===this.hex?"transparent":255-(.299*this.r+.587*this.g+.114*this.b)<105?"Black":"White"}hexToRgb(e){let t="00",n="00",r="00";return 6===(e=this.validateHex(e)).length?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r)}}validateHex(e){return(e=(e=new String(e).toUpperCase()).replace(/[^A-F0-9]/g,"0")).length>6&&(e=e.substring(0,6)),e}webSafeDec(e){return e=Math.round(e/51),e*=51}hexToWebSafe(e){let t,n,r;return 3===e.length?(t=e.substring(0,1),n=e.substring(1,1),r=e.substring(2,1)):(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)),this.intToHex(this.webSafeDec(this.hexToInt(t)))+this.intToHex(this.webSafeDec(this.hexToInt(n)))+this.intToHex(this.webSafeDec(this.hexToInt(r)))}rgbToWebSafe(e){return{r:this.webSafeDec(e.r),g:this.webSafeDec(e.g),b:this.webSafeDec(e.b)}}rgbToHex(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)}intToHex(e){let t=parseInt(e).toString(16);return 1===t.length&&(t="0"+t),t.toUpperCase()}hexToInt(e){return parseInt(e,16)}setRgb(e,t,n){let r=function(e){return e<0||e>255||isNaN(parseInt(e))?0:e};this.r=r(e),this.g=r(t),this.b=r(n),this.hex=this.rgbToHex(this)}setHex(e){this.hex=e;let t=this.hexToRgb(this.hex);this.r=t.r,this.g=t.g,this.b=t.b}}}();
63
63
 
64
64
  /***/ }),
65
65
 
@@ -73,7 +73,7 @@ JQX.Utilities.Assign("DataExporter",class{constructor(e,t,a,o){const l=this;e||(
73
73
  /***/ 6170:
74
74
  /***/ (() => {
75
75
 
76
- JQX.Utilities.Assign("FilterGroup",class t{constructor(){const t=this;t.stringConditions=["EMPTY","NOT_EMPTY","CONTAINS","CONTAINS_CASE_SENSITIVE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_CASE_SENSITIVE","STARTS_WITH","STARTS_WITH_CASE_SENSITIVE","ENDS_WITH","ENDS_WITH_CASE_SENSITIVE","EQUAL","NOT_EQUAL","EQUAL_CASE_SENSITIVE","NOT_EQUAL_CASE_SENSITIVE","NULL","NOT_NULL"],t.numericConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"],t.dateConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"],t.booleanConditions=["EQUAL","NOT_EQUAL","NULL","NOT_NULL"],t.filters=new Array,t.logicalOperators=new Array}toString(){const t=this;let e="";for(let r=0;r<t.filters.length;r++)r>0&&(e+=" "+t.logicalOperators[r-1]+" "),e+=t.filters[r].toString();return e}evaluate(t){const e=this;let r=!0;for(let n=0;n<e.filters.length;n++){if(!e.filters[n].evaluate)continue;let i=e.filters[n].evaluate(t);r=0===n?i:1===e.logicalOperators[n]||"or"===e.logicalOperators[n]?r||i:r&&i}return r}getFiltersCount(){return this.filters.length}setConditions(t,e){const r=this;switch(t){case"numeric":r.numericConditions=e;break;case"string":r.stringConditions=e;break;case"date":case"time":r.dateConditions=e;break;case"bool":case"boolean":r.booleanConditions=e}}getConditions(t){const e=this;let r=new Array;switch(t){case"numeric":r=e.numericConditions.slice(0);break;case"string":r=e.stringConditions.slice(0);break;case"date":case"time":r=e.dateConditions.slice(0);break;case"bool":case"boolean":r=e.booleanConditions.slice(0)}return r}generateFilterKey(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+"-"+t()+"-"+t()}createFilter(t,e,r,n,i,s,l){if(null==t)return null;switch(t){case"int":case"float":case"int64":case"double":case"numeric":case"number":case"numericFilter":return new JQX.Utilities.NumericFilter(e,r.toUpperCase());case"string":case"stringFilter":return new JQX.Utilities.StringFilter(e,r.toUpperCase(),s);case"date":case"time":case"dateFilter":return new JQX.Utilities.DateFilter(e,r.toUpperCase(),i,s,l);case"bool":case"boolean":case"booleanFilter":return new JQX.Utilities.BooleanFilter(e,r.toUpperCase());case"custom":return new JQX.Utilities.CustomFilter(e,r.toUpperCase(),n)}throw new Error('jqxGrid: There is no such filter type. The available filter types are: "numericFilter", "stringFilter", "dateFilter" and "booleanFilter"')}getFilters(){const e=this;let r=new Array;for(let n=0;n<e.filters.length;n++){const i=e.filters[n];if(i instanceof t){let t=i.getFilters();r.push({value:t,logicalOperator:e.logicalOperators[n],type:"FilterGroup"})}else{const t={value:i.value,condition:i.condition,logicalOperator:e.logicalOperators[n],type:i.type};i.data&&(t.id=i.data),r.push(t)}}return r}addFilter(t,e){const r=this;r.filters[r.filters.length]=e,e.key=r.generateFilterKey(),r.logicalOperators[r.logicalOperators.length]=t}removeFilter(t){const e=this;for(let r=0;r<e.filters.length;r++)if(e.filters[r].key===t.key){e.filters.splice(r,1),e.logicalOperators.splice(r,1);break}}getOperatorAt(t){return null==t||t<0||t>this.filters.length?null:this.logicalOperators[t]}setOperatorAt(t,e){return null==t||t<0||t>this.filters.length?null:void(this.logicalOperators[e]=e)}getFilterAt(t){return null==t||t<0||t>this.filters.length?null:this.filters[t]}setFilterAt(t,e){const r=this;return null==t||t<0||t>r.filters.length?null:(e.key=r.generateFilterKey(),void(r.filters[t]=e))}clear(){this.filters=new Array,this.logicalOperators=new Array}getUniqueValues(t,e){const r=t.data,n=[],i=[],s="dateFilter"===t.filterType&&"timePicker"===t.displayMode;let l,a=!1;for(let e=0;e<r.length;e++){let l,o=r[e][t.dataField];""!==o&&null!=o?(l=s?new JQX.Utilities.DateTime(o).toString(t.formatString):o.toString(),-1===n.indexOf(l)&&(n.push(l),i.push({label:l,value:o,customAttribute:"default-item"}))):a=!0}switch(t.filterType){case"numericFilter":case"booleanFilter":l=function(t,e){return t.value-e.value};break;case"stringFilter":l=function(t,e){return(new Intl.Collator).compare(t.value,e.value)};break;case"dateFilter":l=s?function(t,e){try{const r=t.value.getHours(),n=e.value.getHours();if(r!==n)return r-n;const i=t.value.getMinutes(),s=e.value.getMinutes();if(i!==s)return i-s;const l=t.value.getSeconds(),a=e.value.getSeconds();return l!==a?l-a:0}catch(t){return-1}}:function(t,e){try{return t.value.getTime()-e.value.getTime()}catch(t){return-1}}}return i.sort(l),"booleanFilter"===t.filterType&&i.map((function(t){t.label=t.label.toUpperCase()})),a&&i.push({label:e.localize("blanks"),value:"",customAttribute:"default-item"}),i}}),JQX.Utilities.Assign("StringFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.locale=r||"en",n.type="stringFilter"}toString(){return this.condition+' "'+this.value+'"'}evaluate(t){const e=this,r=e.value,n=e.condition;if(null==t||""===t){if("NULL"===n)return!0;if("EQUAL"===n&&t===r)return!0;if("NOT_EQUAL"===n&&t!==r)return!0;if("CONTAINS"===n&&t===r)return!0;if("EMPTY"!==n)return!1;if(""===t)return!0}let i="";try{i=t.toString()}catch(t){return!0}const s=function(t,r){const i=e.locale;switch(n){case"EQUAL":return 0===t.localeCompare(r,i,{sensitivity:"accent"});case"EQUAL_CASE_SENSITIVE":return 0===t.localeCompare(r,i,{sensitivity:"variant"});case"NOT_EQUAL":return 0!==t.localeCompare(r,i,{sensitivity:"accent"});case"NOT_EQUAL_CASE_SENSITIVE":return 0!==t.localeCompare(r,i,{sensitivity:"variant"});case"CONTAINS":return"number"==typeof r?t===r:-1!==t.toLowerCase().indexOf(r.toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.indexOf(r);case"DOES_NOT_CONTAIN":return-1===t.toLowerCase().indexOf(r.toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.indexOf(r);case"EMPTY":return""===t;case"NOT_EMPTY":return""!==t;case"NOT_NULL":return null!==t;case"STARTS_WITH":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"variant"});case"STARTS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"variant"});default:return!1}},l=new Array;if(r&&r.indexOf&&(r.indexOf("|")>=0||r.indexOf(" AND ")>=0||r.indexOf(" OR ")>=0||r.indexOf(" and ")>=0||r.indexOf(" or ")>=0)){const t=s(i,r);if(t)return t;const e=r.indexOf(" and ")>=0?r.split(" and "):new Array,n=r.indexOf(" or ")>=0?r.split(" or "):new Array,a=r.indexOf("|")>=0?r.split("|"):new Array;let o=r.indexOf(" AND ")>=0?r.split(" AND "):new Array,c=r.indexOf(" OR ")>=0?r.split(" OR "):new Array;if(a.length>0)for(let t=0;t<a.length;t++)a[t]=a[t].trim;const u=r.indexOf(" ")>=0?r.split(" "):new Array;if(u.length>0)for(let t=0;t<u.length;t++)u[t]=u[t].trim;if(o=o.concat(u),o=o.concat(e),c=c.concat(a),c=c.concat(n),o.length>0)for(let t=0;t<o.length;t++)!o[t].indexOf(" OR ")>=0&&l.push(o[t]);if(c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" AND ")>=0&&l.push(c[t]);let S;for(let t=0;t<l.length;t++){const e=s(i,l[t]),r=t<o.length?"and":"or";S=void 0===S?e:"or"===r?S||e:S&&e}return S}return s(i,r)}}),JQX.Utilities.Assign("BooleanFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="booleanFilter"}toString(){return this.condition+" "+this.value}evaluate(t){const e=this.value,r=t;switch(this.condition){case"EQUAL":return r===e;case"NOT_EQUAL":return r!==e;case"NULL":return null==t||""===t;case"NOT_NULL":return!(null==t||""===t);default:return!1}}}),JQX.Utilities.Assign("NumericFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="numericFilter"}toString(){return this.condition+" "+this.value}evaluate(t){let e=this.value,r=this.condition;if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let n=t;try{n=parseFloat(n)}catch(e){if(null!==t&&""!==t.toString())return!1}const i=function(t,e){switch("number"==typeof t&&"number"!=typeof e&&(e=parseFloat(e)),r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e;case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());default:return!0}};let s=new Array;if(e&&e.indexOf&&(e.indexOf("|")>=0||e.indexOf(" AND ")>=0||e.indexOf(" OR ")>=0||e.indexOf(" and ")>=0||e.indexOf(" or ")>=0)){let t=i(n,e);if(t)return t;e=e.toString();const r=e.indexOf(" and ")>=0?e.split(" and "):new Array,l=e.indexOf(" or ")>=0?e.split(" or "):new Array,a=e.indexOf("|")>=0?e.split("|"):new Array;let o,c=e.indexOf(" AND ")>=0?e.split(" AND "):new Array,u=e.indexOf(" OR ")>=0?e.split(" OR "):new Array;if(c=c.concat(r),u=u.concat(l),a.length>0)for(let t=0;t<a.length;t++)a[t]=a[t].trim;if(u=u.concat(a),c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" OR ")>=0&&s.push(c[t]);if(u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" AND ")>=0&&s.push(u[t]);for(let e=0;e<s.length;e++){const r=s[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=n>=e[0]&&n<=e[1])}else t=i(n,r);const l=e<c.length?"and":"or";o=void 0===o?t:"or"===l?o||t:o&&t}return o}return e&&e.indexOf&&e.indexOf("..")>=0&&(s=e.toString().split(".."),2===s.length)?n>=s[0]&&n<=s[1]:i(n,e)}}),JQX.Utilities.Assign("DateFilter",class{constructor(t,e,r,n,i){const s=this,l=new JQX.Utilities.DateTime;if(s.value=t,s.type="dateFilter",void 0!==r){const e=l.parseDate(t,r);if(null!==e)s.filterdate=e;else{const e=l.tryparseDate(t);null!==e&&(s.filterdate=e)}}else{const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=l.tryparseDate(t):s.filterdate=e}if(!s.filterdate){const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=l.tryparseDate(t):s.filterdate=e}s.condition=e,s.formatString=r,s.timeOnly=i}toString(){return this.value&&this.value instanceof Date?this.condition+' "'+this.value.toISOString()+'"':this.condition+" "+this.value}evaluate(t){const e=this,r=e.condition,n=e.formatString;let i=e.value;if(e.timeOnly)return e.evaluateTimeOnly(t);if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===i;case"NOT_EQUAL":return t!==i}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let s,l=new Date;l.setFullYear(1900,0,1),l.setHours(12,0,0,0);try{const r=new JQX.Utilities.DateTime,a=new Date(t);if(l=t="NaN"===a.toString()||"Invalid Date"===a.toString()?r.tryparseDate(t):a,s=!1,void 0!==n&&(n.indexOf("t")>=0||n.indexOf("T")>=0||n.indexOf(":")>=0||n.indexOf("f")>=0)&&(s=!0,i&&-1===i.toString().indexOf(":"))){const t=r.tryparseDate(i.toString()+":00");null!==t&&(e.filterdate=t)}s||(l.setHours(0),l.setMinutes(0),l.setSeconds(0))}catch(e){if(null!==t&&""!==t.toString())return!1}if(null!==e.filterdate)i=e.filterdate;else if(i&&i.indexOf&&(-1!==i.indexOf(":")||!isNaN(parseInt(i)))){const t=new Date(l);t.setHours(12,0,0,0);const e=i.split(":");for(let r=0;r<e.length;r++)0===r&&t.setHours(e[r]),1===r&&t.setMinutes(e[r]),2===r&&t.setSeconds(e[r]);i=t}s&&i&&i.setFullYear&&l&&l.getFullYear&&-1===n.indexOf("d")&&-1===n.indexOf("M")&&-1===n.indexOf("y")&&i.setFullYear(l.getFullYear(),l.getMonth(),l.getDate());const a=function(t,e){switch(null===t&&(t=""),r){case"EQUAL":return t.toString()===e.toString();case"NOT_EQUAL":return t.toString()!==e.toString();case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());default:return!0}};let o=new Array;if(i&&i.indexOf&&(i.indexOf("|")>=0||i.indexOf(" AND ")>=0||i.indexOf(" OR ")>=0||i.indexOf(" and ")>=0||i.indexOf(" or ")>=0)){let t=a(l,i);if(t)return t;const e=i.indexOf(" and ")>=0?i.split(" and "):new Array,r=i.indexOf(" or ")>=0?i.split(" or "):new Array,n=i.indexOf("|")>=0?i.split("|"):new Array;let s,c=i.indexOf(" AND ")>=0?i.split(" AND "):new Array,u=i.indexOf(" OR ")>=0?i.split(" OR "):new Array;if(c=c.concat(e),u=u.concat(r),n.length>0)for(let t=0;t<n.length;t++)n[t]=n[t].trim;if(u=u.concat(n),c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" OR ")>=0&&o.push(c[t]);if(u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" AND ")>=0&&o.push(u[t]);for(let e=0;e<o.length;e++){const r=o[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=l>=e[0]&&l<=e[1])}else t=a(l,r);const n=e<c.length?"and":"or";s=void 0===s?t:"or"===n?s||t:s&&t}return s}return i&&i.indexOf&&i.indexOf("..")>=0&&(o=i.toString().split(".."),2===o.length)?l>=o[0]&&l<=o[1]:a(l,i)}evaluateTimeOnly(t){const e=this.value;return e?!!(t&&t instanceof Date)&&(t.getHours()===e.getHours()&&(t.getMinutes()===e.getMinutes()&&t.getSeconds()===e.getSeconds())):!t}}),JQX.Utilities.Assign("CustomFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.customfilter=r}toString(){return this.condition+" "+this.value}evaluate(t){const e=this;return e.customfilter(e.value,t,e.condition)}}),JQX.FilterGroup=JQX.Utilities.FilterGroup,JQX.StringFilter=JQX.Utilities.StringFilter,JQX.NumericFilter=JQX.Utilities.NumericFilter,JQX.DateFilter=JQX.Utilities.DateFilter,JQX.CustomFilter=JQX.Utilities.CustomFilter;
76
+ JQX.Utilities.Assign("FilterGroup",class t{constructor(){const t=this;t.stringConditions=["EMPTY","NOT_EMPTY","CONTAINS","CONTAINS_CASE_SENSITIVE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_CASE_SENSITIVE","STARTS_WITH","STARTS_WITH_CASE_SENSITIVE","ENDS_WITH","ENDS_WITH_CASE_SENSITIVE","EQUAL","NOT_EQUAL","EQUAL_CASE_SENSITIVE","NOT_EQUAL_CASE_SENSITIVE","NULL","NOT_NULL"],t.numericConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"],t.dateConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"],t.booleanConditions=["EQUAL","NOT_EQUAL","NULL","NOT_NULL"],t.filters=new Array,t.logicalOperators=new Array}toString(){const t=this;let e="";for(let r=0;r<t.filters.length;r++)r>0&&(e+=" "+t.logicalOperators[r-1]+" "),e+=t.filters[r].toString();return e}evaluate(t){const e=this;let r=!0;for(let n=0;n<e.filters.length;n++){if(!e.filters[n].evaluate)continue;let i=e.filters[n].evaluate(t);r=0===n?i:1===e.logicalOperators[n]||"or"===e.logicalOperators[n]?r||i:r&&i}return r}getFiltersCount(){return this.filters.length}setConditions(t,e){const r=this;switch(t){case"numeric":r.numericConditions=e;break;case"string":r.stringConditions=e;break;case"date":case"time":r.dateConditions=e;break;case"bool":case"boolean":r.booleanConditions=e}}getConditions(t){const e=this;let r=new Array;switch(t){case"numeric":r=e.numericConditions.slice(0);break;case"string":r=e.stringConditions.slice(0);break;case"date":case"time":r=e.dateConditions.slice(0);break;case"bool":case"boolean":r=e.booleanConditions.slice(0)}return r}generateFilterKey(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+"-"+t()+"-"+t()}createFilter(t,e,r,n,i,s,l){if(null==t)return null;switch(t){case"int":case"float":case"int64":case"double":case"numeric":case"number":case"numericFilter":return new JQX.Utilities.NumericFilter(e,r.toUpperCase());case"string":case"stringFilter":return new JQX.Utilities.StringFilter(e,r.toUpperCase(),s);case"date":case"time":case"dateFilter":return new JQX.Utilities.DateFilter(e,r.toUpperCase(),i,s,l);case"bool":case"boolean":case"booleanFilter":return new JQX.Utilities.BooleanFilter(e,r.toUpperCase());case"custom":return new JQX.Utilities.CustomFilter(e,r.toUpperCase(),n)}throw new Error('smartGrid: There is no such filter type. The available filter types are: "numericFilter", "stringFilter", "dateFilter" and "booleanFilter"')}getFilters(){const e=this;let r=new Array;for(let n=0;n<e.filters.length;n++){const i=e.filters[n];if(i instanceof t){let t=i.getFilters();r.push({value:t,logicalOperator:e.logicalOperators[n],type:"FilterGroup"})}else{const t={value:i.value,condition:i.condition,logicalOperator:e.logicalOperators[n],type:i.type};i.data&&(t.id=i.data),r.push(t)}}return r}addFilter(t,e){const r=this;r.filters[r.filters.length]=e,e.key=r.generateFilterKey(),r.logicalOperators[r.logicalOperators.length]=t}removeFilter(t){const e=this;for(let r=0;r<e.filters.length;r++)if(e.filters[r].key===t.key){e.filters.splice(r,1),e.logicalOperators.splice(r,1);break}}getOperatorAt(t){return null==t||t<0||t>this.filters.length?null:this.logicalOperators[t]}setOperatorAt(t,e){return null==t||t<0||t>this.filters.length?null:void(this.logicalOperators[e]=e)}getFilterAt(t){return null==t||t<0||t>this.filters.length?null:this.filters[t]}setFilterAt(t,e){const r=this;return null==t||t<0||t>r.filters.length?null:(e.key=r.generateFilterKey(),void(r.filters[t]=e))}clear(){this.filters=new Array,this.logicalOperators=new Array}getUniqueValues(t,e){const r=t.data,n=[],i=[],s="dateFilter"===t.filterType&&"timePicker"===t.displayMode;let l,a=!1;for(let e=0;e<r.length;e++){let l,o=r[e][t.dataField];""!==o&&null!=o?(l=s?new JQX.Utilities.DateTime(o).toString(t.formatString):o.toString(),-1===n.indexOf(l)&&(n.push(l),i.push({label:l,value:o,customAttribute:"default-item"}))):a=!0}switch(t.filterType){case"numericFilter":case"booleanFilter":l=function(t,e){return t.value-e.value};break;case"stringFilter":l=function(t,e){return(new Intl.Collator).compare(t.value,e.value)};break;case"dateFilter":l=s?function(t,e){try{const r=t.value.getHours(),n=e.value.getHours();if(r!==n)return r-n;const i=t.value.getMinutes(),s=e.value.getMinutes();if(i!==s)return i-s;const l=t.value.getSeconds(),a=e.value.getSeconds();return l!==a?l-a:0}catch(t){return-1}}:function(t,e){try{return t.value.getTime()-e.value.getTime()}catch(t){return-1}}}return i.sort(l),"booleanFilter"===t.filterType&&i.map((function(t){t.label=t.label.toUpperCase()})),a&&i.push({label:e.localize("blanks"),value:"",customAttribute:"default-item"}),i}}),JQX.Utilities.Assign("StringFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.locale=r||"en",n.type="stringFilter"}toString(){return this.condition+' "'+this.value+'"'}evaluate(t){const e=this,r=e.value,n=e.condition;if(null==t||""===t){if("NULL"===n)return!0;if("EQUAL"===n&&t===r)return!0;if("NOT_EQUAL"===n&&t!==r)return!0;if("CONTAINS"===n&&t===r)return!0;if("EMPTY"!==n)return!1;if(""===t)return!0}let i="";try{i=t.toString()}catch(t){return!0}const s=function(t,r){const i=e.locale;switch(n){case"EQUAL":return 0===t.localeCompare(r,i,{sensitivity:"accent"});case"EQUAL_CASE_SENSITIVE":return 0===t.localeCompare(r,i,{sensitivity:"variant"});case"NOT_EQUAL":return 0!==t.localeCompare(r,i,{sensitivity:"accent"});case"NOT_EQUAL_CASE_SENSITIVE":return 0!==t.localeCompare(r,i,{sensitivity:"variant"});case"CONTAINS":return"number"==typeof r?t===r:-1!==t.toLowerCase().indexOf(r.toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.indexOf(r);case"DOES_NOT_CONTAIN":return-1===t.toLowerCase().indexOf(r.toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.indexOf(r);case"EMPTY":return""===t;case"NOT_EMPTY":return""!==t;case"NOT_NULL":return null!==t;case"STARTS_WITH":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"variant"});case"STARTS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"variant"});default:return!1}},l=new Array;if(r&&r.indexOf&&(r.indexOf("|")>=0||r.indexOf(" AND ")>=0||r.indexOf(" OR ")>=0||r.indexOf(" and ")>=0||r.indexOf(" or ")>=0)){const t=s(i,r);if(t)return t;const e=r.indexOf(" and ")>=0?r.split(" and "):new Array,n=r.indexOf(" or ")>=0?r.split(" or "):new Array,a=r.indexOf("|")>=0?r.split("|"):new Array;let o=r.indexOf(" AND ")>=0?r.split(" AND "):new Array,c=r.indexOf(" OR ")>=0?r.split(" OR "):new Array;if(a.length>0)for(let t=0;t<a.length;t++)a[t]=a[t].trim;const u=r.indexOf(" ")>=0?r.split(" "):new Array;if(u.length>0)for(let t=0;t<u.length;t++)u[t]=u[t].trim;if(o=o.concat(u),o=o.concat(e),c=c.concat(a),c=c.concat(n),o.length>0)for(let t=0;t<o.length;t++)!o[t].indexOf(" OR ")>=0&&l.push(o[t]);if(c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" AND ")>=0&&l.push(c[t]);let S;for(let t=0;t<l.length;t++){const e=s(i,l[t]),r=t<o.length?"and":"or";S=void 0===S?e:"or"===r?S||e:S&&e}return S}return s(i,r)}}),JQX.Utilities.Assign("BooleanFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="booleanFilter"}toString(){return this.condition+" "+this.value}evaluate(t){const e=this.value,r=t;switch(this.condition){case"EQUAL":return r===e;case"NOT_EQUAL":return r!==e;case"NULL":return null==t||""===t;case"NOT_NULL":return!(null==t||""===t);default:return!1}}}),JQX.Utilities.Assign("NumericFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="numericFilter"}toString(){return this.condition+" "+this.value}evaluate(t){let e=this.value,r=this.condition;if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let n=t;try{n=parseFloat(n)}catch(e){if(null!==t&&""!==t.toString())return!1}const i=function(t,e){switch("number"==typeof t&&"number"!=typeof e&&(e=parseFloat(e)),r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e;case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());default:return!0}};let s=new Array;if(e&&e.indexOf&&(e.indexOf("|")>=0||e.indexOf(" AND ")>=0||e.indexOf(" OR ")>=0||e.indexOf(" and ")>=0||e.indexOf(" or ")>=0)){let t=i(n,e);if(t)return t;e=e.toString();const r=e.indexOf(" and ")>=0?e.split(" and "):new Array,l=e.indexOf(" or ")>=0?e.split(" or "):new Array,a=e.indexOf("|")>=0?e.split("|"):new Array;let o,c=e.indexOf(" AND ")>=0?e.split(" AND "):new Array,u=e.indexOf(" OR ")>=0?e.split(" OR "):new Array;if(c=c.concat(r),u=u.concat(l),a.length>0)for(let t=0;t<a.length;t++)a[t]=a[t].trim;if(u=u.concat(a),c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" OR ")>=0&&s.push(c[t]);if(u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" AND ")>=0&&s.push(u[t]);for(let e=0;e<s.length;e++){const r=s[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=n>=e[0]&&n<=e[1])}else t=i(n,r);const l=e<c.length?"and":"or";o=void 0===o?t:"or"===l?o||t:o&&t}return o}return e&&e.indexOf&&e.indexOf("..")>=0&&(s=e.toString().split(".."),2===s.length)?n>=s[0]&&n<=s[1]:i(n,e)}}),JQX.Utilities.Assign("DateFilter",class{constructor(t,e,r,n,i){const s=this,l=new JQX.Utilities.DateTime;if(s.value=t,s.type="dateFilter",void 0!==r){const e=l.parseDate(t,r);if(null!==e)s.filterdate=e;else{const e=l.tryparseDate(t);null!==e&&(s.filterdate=e)}}else{const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=l.tryparseDate(t):s.filterdate=e}if(!s.filterdate){const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=l.tryparseDate(t):s.filterdate=e}s.condition=e,s.formatString=r,s.timeOnly=i}toString(){return this.value&&this.value instanceof Date?this.condition+' "'+this.value.toISOString()+'"':this.condition+" "+this.value}evaluate(t){const e=this,r=e.condition,n=e.formatString;let i=e.value;if(e.timeOnly)return e.evaluateTimeOnly(t);if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===i;case"NOT_EQUAL":return t!==i}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let s,l=new Date;l.setFullYear(1900,0,1),l.setHours(12,0,0,0);try{const r=new JQX.Utilities.DateTime,a=new Date(t);if(l=t="NaN"===a.toString()||"Invalid Date"===a.toString()?r.tryparseDate(t):a,s=!1,void 0!==n&&(n.indexOf("t")>=0||n.indexOf("T")>=0||n.indexOf(":")>=0||n.indexOf("f")>=0)&&(s=!0,i&&-1===i.toString().indexOf(":"))){const t=r.tryparseDate(i.toString()+":00");null!==t&&(e.filterdate=t)}s||(l.setHours(0),l.setMinutes(0),l.setSeconds(0))}catch(e){if(null!==t&&""!==t.toString())return!1}if(null!==e.filterdate)i=e.filterdate;else if(i&&i.indexOf&&(-1!==i.indexOf(":")||!isNaN(parseInt(i)))){const t=new Date(l);t.setHours(12,0,0,0);const e=i.split(":");for(let r=0;r<e.length;r++)0===r&&t.setHours(e[r]),1===r&&t.setMinutes(e[r]),2===r&&t.setSeconds(e[r]);i=t}s&&i&&i.setFullYear&&l&&l.getFullYear&&-1===n.indexOf("d")&&-1===n.indexOf("M")&&-1===n.indexOf("y")&&i.setFullYear(l.getFullYear(),l.getMonth(),l.getDate());const a=function(t,e){switch(null===t&&(t=""),r){case"EQUAL":return t.toString()===e.toString();case"NOT_EQUAL":return t.toString()!==e.toString();case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());default:return!0}};let o=new Array;if(i&&i.indexOf&&(i.indexOf("|")>=0||i.indexOf(" AND ")>=0||i.indexOf(" OR ")>=0||i.indexOf(" and ")>=0||i.indexOf(" or ")>=0)){let t=a(l,i);if(t)return t;const e=i.indexOf(" and ")>=0?i.split(" and "):new Array,r=i.indexOf(" or ")>=0?i.split(" or "):new Array,n=i.indexOf("|")>=0?i.split("|"):new Array;let s,c=i.indexOf(" AND ")>=0?i.split(" AND "):new Array,u=i.indexOf(" OR ")>=0?i.split(" OR "):new Array;if(c=c.concat(e),u=u.concat(r),n.length>0)for(let t=0;t<n.length;t++)n[t]=n[t].trim;if(u=u.concat(n),c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" OR ")>=0&&o.push(c[t]);if(u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" AND ")>=0&&o.push(u[t]);for(let e=0;e<o.length;e++){const r=o[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=l>=e[0]&&l<=e[1])}else t=a(l,r);const n=e<c.length?"and":"or";s=void 0===s?t:"or"===n?s||t:s&&t}return s}return i&&i.indexOf&&i.indexOf("..")>=0&&(o=i.toString().split(".."),2===o.length)?l>=o[0]&&l<=o[1]:a(l,i)}evaluateTimeOnly(t){const e=this.value;return e?!!(t&&t instanceof Date)&&(t.getHours()===e.getHours()&&(t.getMinutes()===e.getMinutes()&&t.getSeconds()===e.getSeconds())):!t}}),JQX.Utilities.Assign("CustomFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.customfilter=r}toString(){return this.condition+" "+this.value}evaluate(t){const e=this;return e.customfilter(e.value,t,e.condition)}}),JQX.FilterGroup=JQX.Utilities.FilterGroup,JQX.StringFilter=JQX.Utilities.StringFilter,JQX.NumericFilter=JQX.Utilities.NumericFilter,JQX.DateFilter=JQX.Utilities.DateFilter,JQX.CustomFilter=JQX.Utilities.CustomFilter;
77
77
 
78
78
  /***/ }),
79
79
 
@@ -87,7 +87,7 @@ JQX.Utilities.Assign("ConditionalFormatter",class{constructor(e){const t=this;t.
87
87
  /***/ 859:
88
88
  /***/ (() => {
89
89
 
90
- JQX("jqx-gantt-chart",class extends JQX.ScrollViewer{static get properties(){return{adjustToNonworkingTime:{value:!1,type:"boolean"},autoSchedule:{value:!1,type:"boolean"},autoScheduleStrictMode:{value:!1,type:"boolean"},autoScrollStep:{value:5,type:"number"},columnMenu:{value:!1,type:"boolean"},columnMinWidth:{value:"50px",type:"any"},columnResize:{value:!1,type:"boolean"},columnResizeFeedback:{value:!1,type:"boolean"},currentTime:{value:new Date,type:"any",validator:"_dateValidator"},currentTimeIndicator:{value:!1,type:"boolean"},currentTimeIndicatorInterval:{value:1,validator:"_currentTimeIndicatorIntervalValidator",type:"number"},dataExport:{value:{exportFiltered:{value:!1,type:"boolean"},itemType:{value:"task",type:"string"},fileName:{value:"jqxGanttChart",type:"string?"}},type:"object"},dataSource:{value:[],type:"any",reflectToAttribute:!1},dateEnd:{value:"",type:"any",validator:"_dateValidator"},dateStart:{value:"",type:"any",validator:"_dateValidator"},dateMarkers:{value:[],reflectToAttribute:!1,type:"array"},dayFormat:{value:"short",allowedValues:["2-digit","numeric","long","short","narrow"],type:"string"},dayScale:{value:"hour",allowedValues:["hour","halfHour","quarterHour"],type:"string"},disableAutoScroll:{value:!1,type:"boolean"},disableTaskDrag:{value:!1,type:"boolean"},disableTaskProgressChange:{value:!1,type:"boolean"},disableTaskResize:{value:!1,type:"boolean"},disableSelection:{value:!1,type:"boolean"},disableSegmentDrag:{value:!1,type:"boolean"},disableSegmentResize:{value:!1,type:"boolean"},disableWindowEditor:{value:!1,type:"boolean"},durationUnit:{value:"milisecond",allowedValues:["day","week","hour","minute","second","milisecond"],type:"string"},filterRow:{value:!1,type:"boolean"},firstDayOfWeek:{value:-1,type:"number"},groupByResources:{value:!1,type:"boolean"},headerTemplate:{value:null,type:"any"},hourFormat:{value:"default",allowedValues:["default","2-digit","numeric"],type:"string"},hideDateMarkers:{value:!1,type:"boolean"},hideTimelineHeaderDetails:{value:!1,type:"boolean"},hideTimelineSecondHeaderDetails:{value:!0,type:"boolean"},hideTimelineHeader:{value:!1,type:"boolean"},hideResourcePanel:{value:!1,type:"boolean"},showSelectionColumn:{value:!1,type:"boolean"},infiniteTimeline:{value:!1,type:"boolean"},infiniteTimelineStep:{value:5,type:"number"},inverted:{value:!1,type:"boolean"},keyboardNavigation:{value:!1,type:"boolean"},messages:{extend:!0,value:{en:{duplicateIds:"{{elementType}}: DataSource contains duplicate ids. Tasks should have unique ids. The following ids are duplicating: {{duplicates}}.",invalidNonworkingRange:"{{elementType}}: Invalid {{property}} value. {{property}} should not contain all possible days/hours because it will result in an endless timeline. The value has been validated by removing the last item from the new value range.",invalidValue:"{{elementType}}: Invalid {{property}} value. {{property}} should be of type {{typeOne}} or {{typeTwo}}.",incorrectArgument:"{{elementType}}: Incorrect argument {{argumentName}} in method {{methodName}}.",outOfBounds:"{{elementType}}: Out of bounds argument {{argumentName}} in method {{methodName}}.",missingReference:"{{elementType}}: Missing reference to {{file}} in method {{methodName}}.",alreadyExists:"{{elementType}}: The item already exists when calling the {{methodName}} method.",notExisting:"{{elementType}}: The item does not exists when calling the {{methodName}} method.",notAProject:"{{elementType}}: The {{argumentName}} argument in {{methodName}} method does not reference an item of type 'project'.",noId:"jqxGanttChart requires an id in order to save/load/clear a state.",ok:"Ok",add:"Add",remove:"Remove",cancel:"Cancel",delete:"Delete",confirm:"{{componentName}} will be deleted permanently, <b>are you sure? </b>",taskColumnLabel:"Task Name",resourceColumnLabel:"Resource Name",deleteLink:"Delete link",unassigned:"Unassigned",generalTab:"General",dependencyTab:"Dependency",segmentsTab:"Segments",segment:"Segment",dependencyValidation:"*The Task cannot be connected to itself.",segmentsCountValidation:"*Segmented Tasks must have at least 2 segments. ",segmentConflictError:'*The Segment "{{label}}" is in conflict, because it starts on/before and ends on/after the {{dateConflict}} of Segment "{{conflictLabel}}." ',segmentStartError:'*The Segment "{{label}}" cannot start before it ends and cannot end before it starts.',segmentEndError:'*The Segment "{{label}}" cannot start when it ends.',segmentRangeError:'*The Segment "{{label}}" is out of Task date range. The first segment must start when the task starts and the last segment must end when the task ends.',label:"Label",duration:"Duration",dateStart:"Date Start",dateEnd:"Date End",id:"Id",name:"Name",type:"Type",lag:"Lag",startToStart:"Start-To-Start",endToStart:"End-To-Start",endToEnd:"End-To-End",startToEnd:"Start-To-End",overdue:"Overdue",weeks:"week(s)",days:"day(s)",hours:"hour(s)",minutes:"minute(s)",seconds:"second(s)",miliseconds:"milisecond(s)",task:"Task",resource:"Resource",assignments:"Assignments",startTask:"Task Start",endTask:"Task End",deadline:"Deadline",quarter:"Quarter",quarterShort:"Q"}},type:"object"},monthFormat:{value:"short",allowedValues:["2-digit","numeric","long","short","narrow"],type:"string"},monthScale:{value:"week",allowedValues:["day","week"],type:"string"},max:{value:new Date(2100,0,1),type:"any",validator:"_dateValidator"},min:{value:new Date(1900,0,1),type:"any",validator:"_dateValidator"},nonworkingDays:{value:[],type:"array",validator:"_nonworkingDayValidator"},nonworkingHours:{value:[],type:"array",validator:"_nonworkingTimeValidator"},onTaskRender:{value:null,reflectToAttribute:!1,type:"function?"},popupWindowCustomizationFunction:{value:null,reflectToAttribute:!1,type:"function?"},popupWindowTabs:{value:["general","dependency","segments"],reflectToAttribute:!1,type:"array"},progressLabelFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resizeHandlesVisibility:{allowedValues:["auto","hidden","visible"],value:"auto",type:"string"},quarterFormat:{value:"short",allowedValues:["long","short","numeric"],type:"string"},resourceColumns:{value:[{label:"resourceColumnLabel",value:"label"}],type:"array",reflectToAttribute:!1},resourceFiltering:{value:!1,type:"boolean"},resourceGroupFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resourcePanelHeaderTemplate:{value:null,type:"any"},resourcePanelMin:{value:100,type:"any"},resourcePanelSize:{value:"",type:"any"},resourcePanelRefreshRate:{value:0,reflectToAttribute:!1,type:"number"},resourceTimelineFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resourceTimelineMode:{allowedValues:["diagram","histogram","custom"],value:"diagram",type:"string"},resourceTimelineView:{allowedValues:["hours","tasks","custom"],value:"hours",type:"string"},selectedTaskIds:{value:[],type:"array"},selectedResourceIds:{value:[],type:"array"},shadeUntilCurrentTime:{value:!1,type:"boolean"},showBaseline:{value:!1,type:"boolean"},showProgressLabel:{value:!1,type:"boolean"},snapToNearest:{value:!1,type:"boolean"},sortFunction:{value:null,type:"function?",reflectToAttribute:!1},sortMode:{value:"none",allowedValues:["none","one","many"],type:"string"},taskColumns:{value:[{label:"taskColumnLabel",value:"label"}],type:"array",reflectToAttribute:!1},taskFiltering:{value:!1,type:"boolean"},taskPanelMin:{value:200,type:"any"},taskPanelSize:{value:"",type:"any"},timelineHeaderFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},timelineMin:{value:200,type:"any"},treeMin:{value:100,type:"any"},treeSize:{value:"20%",type:"any"},tooltip:{value:{enabled:{value:!1,type:"boolean"},arrow:{value:!1,type:"boolean"},delay:{value:50,type:"number"},offset:{value:[0,5],type:"array"}},type:"object"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},view:{value:"year",allowedValues:["day","week","month","quarter","year"],type:"any"},yearFormat:{value:"numeric",allowedValues:["2-digit","numeric"],type:"string"},weekFormat:{value:"long",allowedValues:["long","numeric"],type:"string"}}}template(){return'<div id="container" role="presentation">\n <jqx-splitter id="mainSplitter" auto-fit-mode="end" keep-proportions-on-resize right-to-left="[[rightToLeft]]" animation="[[animation]]" orientation="horizontal">\n <jqx-splitter-item id="taskSplitterItem" class="jqx-task-splitter-item">\n <div id="taskSplitterItemHeader" class="jqx-task-panel-header"></div>\n <jqx-splitter id="taskSplitter" class="jqx-task-splitter" auto-fit-mode="end">\n <jqx-splitter-item id="tableSplitterItem">\n <jqx-table right-to-left="[[rightToLeft]]" wait id="taskTable" class="jqx-task-table" virtualization animation="none" deferred-scroll-delay="0" ></jqx-table>\n </jqx-splitter-item>\n <jqx-splitter-item id="timelineSplitterItem" class="jqx-timeline-splitter-item">\n <div id="timeline" class="jqx-timeline">\n <div id="timelineHeader" class="jqx-timeline-header" role="rowgroup">\n <div id="timelineHeaderContent" class="jqx-timeline-header-content">\n <div class="jqx-timeline-view-details" id="timelineViewDetails" role="row"></div>\n <div class="jqx-timeline-view-details jqx-hidden" id="timelineViewSubDetails" role="row"></div>\n <div class="jqx-timeline-view-cells" id="timelineViewCells" role="row"></div>\n </div>\n </div>\n <div id="taskTimelineContainer" class="jqx-timeline-content-container">\n <div id="timelineContent" class="jqx-timeline-content">\n <div id="taskTimelineCellsContainer" class="jqx-timeline-cells-container" aria-hidden="true"></div>\n <div id="taskIndicatorsContainer" class="jqx-timeline-indicators-container" role="group"></div>\n <div id="timelineConnectionsContainer" class="jqx-timeline-connections-container" role="group"></div>\n <div id="timelineBaselinesContainer" class="jqx-timeline-baselines-container" role="group"></div>\n <div id="timelineTasksContainer" class="jqx-timeline-tasks-container" role="group"></div>\n <div id="timelineMarkers" class="jqx-timeline-markers-container" role="group"></div>\n <div id="timelineDeadlines" class="jqx-timeline-deadlines-container" role="group"></div>\n </div>\n </div>\n </div>\n <jqx-scroll-bar id="verticalScrollBar" class="jqx-timeline-scroll-bar" orientation="vertical"\n right-to-left="[[rightToLeft]]" aria-controls="[[id]]">\n </jqx-scroll-bar>\n </jqx-splitter-item>\n </jqx-splitter>\n </jqx-splitter-item>\n </jqx-splitter>\n <jqx-scroll-bar wait id="horizontalScrollBar" class="jqx-timeline-scroll-bar"></jqx-scroll-bar>\n </div>'}static get listeners(){return{down:"_downHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.dragstart":"_dragStartHandler","container.wheel":"_mouseWheelHandler","horizontalScrollBar.change":"_horizontalScrollbarHandler","verticalScrollBar.change":"_verticalScrollbarHandler","resourceVerticalScrollBar.change":"_verticalScrollbarHandler","mainSplitter.resizeEnd":"_resizeEventHandler","mainSplitter.resize":"_resizeEventHandler",move:"_moveHandler","mainSplitter.change":"_tableChangeHandler","mainSplitter.filter":"_tableSortFilterHandler","mainSplitter.sort":"_tableSortFilterHandler","mainSplitter.columnResize":"_tableColumnResizeHandler","taskTable.group":"_taskTableGroupEventHandler","taskTable.collapse":"_taskTableExpandHandler","taskTable.expand":"_taskTableExpandHandler","taskTable.keydown":"_taskTableKeyDownHandler"}}static get styleUrls(){return["jqx.ganttchart.css"]}attached(){const e=this;if(super.attached(),e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e.$.taskSplitterItem,e.$.horizontalScrollBar,e.$.verticalScrollBar)),!e._resourceScrollView&&e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._resourceScrollView=new JQX.Utilities.Scroll(e.$.resourceSplitterItem,e.$.horizontalScrollBar,e.$.resourceVerticalScrollBar)),e.scrollLeft){const t=e._getScrollLeft(e.scrollLeft);e.$.timelineHeader.scrollLeft=e.$.taskTimelineContainer.scrollLeft=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineHeader.scrollLeft=e.$.resourceTimelineContent.scrollLeft=t)}if(e.scrollTop){const t=e.scrollTop;e.$.taskTimelineContainer.scrollTop=t,e.$.timelineContent.scrollTop=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollTop=t)}const t=["taskPopupWindow","connectionPopupWindow","confirmPopupWindow"];for(let i=0;i<t.length;i++){const a=t[i];if(e.$[a]&&e.$[a].opened){const t=e["$"+a];e._handleModal(!0),t.listen("close",e._popupWindowCloseHandler.bind(e)),t.listen("closing",e._popupWindowClosingHandler.bind(e)),t.listen("open",e._popupWindowOpenHandler.bind(e)),t.listen("click",e._popupWindowClickHandler.bind(e)),t.listen("change",e._popupWindowChangeHandler.bind(e)),t.listen("transitionend",e._popupWindowTransitionendHandler.bind(e)),e.getShadowRootOrBody().appendChild(e.$[a])}}e._handleTooltipEvents(!0),e._currentTimeIndicatorInterval||!e.currentTimeIndicator&&!e.shadeUntilCurrentTime||e._setCurrentTimeIndicators()}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),e._resourceScrollView&&(e._resourceScrollView.unlisten(),delete e._resourceScrollView);const t=["taskPopupWindow","connectionPopupWindow","confirmPopupWindow"];e._handleModal();for(let i=0;i<t.length;i++){const a=t[i],n=e["$"+a];e.$[a]&&e.$[a].remove(),n&&(n.unlisten("open"),n.unlisten("close"),n.unlisten("closing"),n.unlisten("click"),n.unlisten("change"),n.unlisten("transitionend"))}e._handleTooltipEvents(),clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval}propertyChangedHandler(e,t,i){const a=this;switch(e){case"adjustToNonworkingTime":for(let e=0;e<a._tasks.length;e++){const t=a._tasks[e],i=t.$.project;a._validateTaskDates(t,i),a._validateTaskSegments(t),a._synchronizeProjectDates(t,i),a._refreshTableColumnsData(t,["dateEnd","duration"])}a._refreshTimeline();break;case"animation":break;case"autoSchedule":i?a._autoSchedule():a._autoScheduleRestore();break;case"autoScheduleStrictMode":i&&(a._autoSchedule(),a._refreshTimeline());break;case"columnMinWidth":case"columnResizeFeedback":case"columnResize":{const t=a.$.taskTable,n=a.$.resourceTable;t[e]=i,n&&(n[e]=i);break}case"currentTimeIndicator":case"shadeUntilCurrentTime":a._setCurrentTimeIndicators();break;case"dataSource":a.scrollLeft=a.scrollTop=0,a._createTasks(),a._refreshTableDataSource(),a._createTimeline(),a._createResourceTimeline(),a._setAriaControls();break;case"dateMarkers":a._createDateMarkers();break;case"hideDateMarkers":a._recycleDateMarkers();break;case"disableSelection":{const e=a.$.taskTable,t=a.$.resourceTable;e&&(e.selection=!a.disableSelection),t&&(t.selection=!a.disableSelection);break}case"durationUnit":for(let e=0;e<a._tasks.length;e++){const t=a._tasks[e],i=t.$.project;a._validateTaskDuration(t),a._validateTaskDates(t,i),a._validateTaskSegments(t),a._synchronizeProjectDates(t,i)}a._createTimelineCells(),a._insertTimelineTasks(),a.taskColumns.some((e=>(e.value+"").toLowerCase().indexOf("duration")>-1))&&a._refreshTableDataSource();break;case"filterRow":a.$.taskTable[e]=i;break;case"groupByResources":a._setTable(a.$.taskTable),a._createTimelineContent(),a._recycleTimelineTasks(),a._refresh();break;case"infiniteTimeline":i?a._scrollView.hScrollBar.value===a._scrollView.hScrollBar.max&&a._handleInfiniteTimeline():a.set("dateEnd","");break;case"keyboardNavigation":case"columnMenu":case"hideSelectionColumn":case"sortMode":a.$.taskTable[e]=i,a.$.resourceTable&&(a.$.resourceTable[e]=i);break;case"popupWindowTabs":case"popupWindowCustomizationFunction":{const e=a.$.taskPopupWindow;e&&(e.opened&&(e.close(),delete e._target),e.clear());break}case"taskFiltering":a.$.taskTable.filtering=i,a._refresh();break;case"resourceFiltering":{const e=a.$.resourceTable;e&&(e.filtering=i,a._refresh());break}case"tooltip_enabled":{const e=a.$.tooltip;e&&(i||e.remove(),a._handleTooltipEvents(i));break}case"tooltip_arrow":case"tooltip_delay":case"tooltip_offset":{const t=a.$.tooltip;t&&(t[e.replace("tooltip_","")]=i);break}case"headerTemplate":a._handleHeaderTemplate();break;case"inverted":if(a._handleInverted(),a.scrollLeft){const e=a._getScrollLeft(a.scrollLeft);a.$.timelineHeader.scrollLeft=a.$.taskTimelineContainer.scrollLeft=e,a.$.mainSplitter.contains(a.$.resourceTimelineHeader)&&(a.$.resourceTimelineHeader.scrollLeft=a.$.resourceTimelineContent.scrollLeft=e)}break;case"rightToLeft":Array.from(a.querySelectorAll("jqx-splitter, jqx-table, jqx-scroll-bar")).forEach((t=>t[e]=i)),a.closeWindow(),a._handleInverted(),a._refreshTimeline();break;case"firstDayOfWeek":case"dateStart":case"dateEnd":a._refreshTimeline();break;case"messages":case"locale":case"dayFormat":case"hourFormat":case"timelineHeaderFormatFunction":case"monthFormat":case"yearFormat":a._refreshHeaderDate(!0),a._refreshColumnsHeaders(),a._recycleResourceHeaderCells();break;case"hideResourcePanel":a._createResourceTimeline(),a._refreshTimeline();break;case"nonworkingDays":case"nonworkingHours":a._refreshAfterWorkingTimeChange();break;case"selectedTaskIds":a.$.taskTable.selected=a._getSelection("task",i);break;case"selectedResourceIds":a.$.resourceTable&&(a.$.resourceTable.selected=a._getSelection("resource",i));break;case"resourceColumns":a._setTable(a.$.resourceTable),a._highlightAssignedItem("task",a._getSelection("task",a.selectedTaskIds));break;case"resourcePanelHeaderTemplate":a._handleHeaderTemplate("resource");break;case"resourceTimelineView":case"resourceTimelineMode":case"resourceTimelineFormatFunction":a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._resources.forEach((e=>a._refreshResourceTimelineContent(e)));break;case"showProgressLabel":case"progressLabelFormatFunction":a._tasks.forEach((e=>a._setTaskBarProgress(e)));break;case"sortFunction":a.$.taskTable.sort=i,a.$.resourceTable&&(a.$.resourceTable.sort=i);break;case"showSelectionColumn":a.$.taskTable.hideSelectionColumn=!i,a.$.resourceTable&&(a.$.resourceTable.hideSelectionColumn=!i);break;case"taskColumns":a._setTable(a.$.taskTable);break;case"timelineMin":a.$.timelineSplitterItem.min=i,a.$.taskSplitter.refresh(),a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._synchronizeSplitters(a.$.taskSplitter,a.$.resourceSplitter);break;case"treeMin":case"treeSize":{const t=e.toLowerCase().indexOf("size")>-1?"size":"min";a.$.tableSplitterItem[t]=i,a.$.taskSplitter.refresh(),a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._synchronizeSplitters(a.$.taskSplitter,a.$.resourceSplitter);break}case"taskPanelMin":case"taskPanelSize":case"resourcePanelSize":case"resourcePanelMin":{const t=e.indexOf("Min")>-1?"min":"size",n=e.indexOf("resource")>-1?"resource":"task";a.$.mainSplitter.contains(a.$.resourceSplitter)&&(a.$[`${n}SplitterItem`][t]=i,a.$.taskSplitterItem._setSize("size",a.taskPanelSize),a.refresh());break}case"unfocusable":a._setFocusable();break;case"monthScale":case"dayScale":case"view":a._refreshTimeline(t);break;default:super.propertyChangedHandler(e,t,i)}}_predefPropertyGetter(e){const t=this;Object.defineProperty(t,e,{get:function(){switch(e){case"dataSource":{if(t.context===t)return t.properties[e].value;const i=function(e){if(!e.length)return e;for(let a=0;a<e.length;a++){const n=e[a];let s=t._getProjectTasks(n);s&&Array.isArray(s)&&(s=i(s.filter((e=>e.$&&e.$.project===n)))),e[a]=t._cloneObject(n),s&&s.length?e[a].tasks=s:delete e[a].tasks}return e},a=t.properties[e].value;return a instanceof JQX.DataAdapter?a:i(a.slice(0))}case"dateStart":case"dateEnd":{const i=t._timelineCells;if(i.length){const a=t._getCellDateRange({_date:i["dateStart"===e?0:i.length-1].date});return new Date(a[e])}return t.properties[e].value}default:return t.properties[e].value}},set(i){t.updateProperty(t,t._properties[e],i)}})}ready(){this._customScrollView=!0,super.ready()}render(){const e=this,t=window.getComputedStyle(e),i=JQX.Utilities.Core;e._isMobile=i.isMobile,e._isFirefox=i.Firefox,e._taskBarMinWidth=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-task-min-width"))||0,e._taskDefaultHeight=parseFloat(t.getPropertyValue("--jqx-gantt-chart-task-default-height"))||30,e._timelineCellSize=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-cell-size"))||0,e._timelineCellMinSize=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-cell-min-size"))||0,e._taskConnectionWidth=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-task-connection-width"))||1,e._baselineProportion=parseFloat(t.getPropertyValue("--jqx-gantt-chart-baseline-proportion"))||0,e._predefPropertyGetter("dataSource"),e._predefPropertyGetter("dateStart"),e._predefPropertyGetter("dateEnd"),e.$.tableSplitterItem.size=e.treeSize,e.$.tableSplitterItem.min=e.treeMin,e.$.timelineSplitterItem.min=e.timelineMin,e._setScrollBars(),e._handleHeaderTemplate(),e._handleInverted(!0),e._createTasks(),e._setTable(),e._createTimeline(),e._createResourceTimeline(),e._setAriaControls(),e._setFocusable(),e.checkLicense(),(e.shadowRoot||e._isFirefox)&&requestAnimationFrame((()=>e.refresh())),super.render()}refresh(e){const t=this;if(e)return t._refreshTimeline(),t._setTable(t.$.taskTable),void t._createResourceTimeline();t.isRendered&&t._resizeEventHandler()}addFilter(e,t){const i=this;if(!i.taskFiltering&&!i.resourceFiltering||!(t instanceof JQX.Utilities.FilterGroup))return;Array.isArray(e)||(e="object"==typeof e?[e]:[]);const a=i.taskColumns,n=i.resourceColumns,s=i.$.taskTable,r=i.$.resourceTable;for(let i=0;i<e.length;i++){const o=e[i],l=o.type,[d,c]="resource"===l||n.includes(o)?[r,n]:[s,a],m=c.find((e=>o.value&&e.value===o.value));m&&d.addFilter(m.value,t)}}clearSelection(){this._unselectAll("task"),this._unselectAll("resource")}static get requires(){return{"JQX.Splitter":"jqx.splitter.js","JQX.Tree":"jqx.tree.js","JQX.Window":"jqx.window.js"}}ensureVisible(e,t="task"){const i=this,a=i._getValidItemAndIndex(e,t);(e=a?a.item:void 0)&&(i._ensureVisible(e,t),i._scrollTo(e.dateStart,!0))}removeAllConnections(){const e=this;e.isCompleted&&(e.$.timelineConnectionsContainer.innerHTML="",e._connections=[],e._tasks.map((e=>e.connections=[])))}removeConnection(){const e=this,t=Array.from(arguments).filter((e=>void 0!==e));if(!e.isCompleted)return;let i;if(1===t.length){if("string"==typeof t[0]){const e=document.getElementById(t[0]);e&&(i=e.getAttribute("connection-id"))}i||(i=(t[0]+"").split("-"),i=e._getValidConnectionId(i[0],i[1],i[2],"removeConnection"))}else 3===t.length&&(i=e._getValidConnectionId(t[0],t[1],t[2],"removeConnection"));i&&(e._removeConnection(i),e.$.fireEvent("itemRemove",{type:"connection",id:`${i[0]}-${i[1]}-${i[2]}`,item:{source:i[0],target:i[1],type:i[2]}}))}removeTaskConnection(e,t){const i=this;if(!i.isCompleted)return;if((e+="").indexOf("-")>-1&&!t){const i=e.split("-");t=i[1],e=i[0]}const a=i._getValidItemAndIndex(e),n=i._getValidItemAndIndex(t);e=a?a.index:void 0,t=n?n.index:void 0,isNaN(e)?i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"removeTaskConnection",argumentName:"taskEndIndex"})):i._removeConnection(""+e+(isNaN(t)?"":t))}beginUpdate(){this._isUpdating={started:!0,type:{}},this.$.fireEvent("beginUpdate")}endUpdate(){const e=this;function t(){e._refreshTableDataSource(),e._createTimelineContent(),e._recycleTimelineTasks(),e._setAriaControls();const t=e._resources;for(let i=0;i<t.length;i++)e._refreshTableColumnsData(t[i],void 0,"resource")}function i(){if(e.hideResourcePanel)return;e._refreshTableDataSource("resource"),e._recycleResourceHeaderCells(),e._createResourceTimelineContent(),e._refresh();const t=e._tasks;for(let i=0;i<t.length;i++)e._refreshTableColumnsData(t[i])}if(!e._isUpdating)return;const a=1===Object.keys(e._isUpdating.type).length?Object.keys(e._isUpdating.type)[0]:void 0;let n,s;switch(e._selected&&({task:n,resource:s}=e._selected),delete e._isUpdating,a){case"task":t();break;case"resource":i();break;default:t(),i()}n&&(e._refreshSelectedItems("task",n),e.$.taskTable.selected=e._getSelection("task",e.selectedTaskIds)),s&&(e._refreshSelectedItems("resource",s),e.$.resourceTable.selected=e._getSelection("resource",e.selectedResourceIds)),e.$.fireEvent("endUpdate")}clearFilters(e){this._resetFromAction(e,"clearFilters")}clearSort(e){const t=this;"task"!==e&&"resource"!==e?(t._resetFromAction("task","clearSort"),t._resetFromAction("resource","clearSort")):t._resetFromAction(e,"clearSort")}clearTasks(){this._clearTasks()}_clearTasks(){const e=this;e._selected&&delete e._selected.task,e.set("selectedTaskIds",[]),e._tasks=[],e._timelineCells=[],e._timelineVCells=[],e._timelineHeaderCells=[],e.$.timelineContent.style.width="",e.$.container.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height"),e.$.timelineViewDetails.innerHTML="",e.$.timelineViewCells.innerHTML="",e.$.taskTimelineCellsContainer.innerHTML="",e.$.timelineConnectionsContainer.innerHTML="",e.$.timelineTasksContainer.innerHTML="",e.$.taskIndicatorsContainer.innerHTML="",e.$.timelineContent.style.height="",delete e._hoveredItem,e.$.taskTable.dataSource=[],e._closeTooltip(),e.closeWindow(),e._refresh()}clearResources(){const e=this;e._unselectAll("resource"),e._resources=[],e.$.resourceTable&&(e.$.resourceTable.dataSource=[]),e.$.resourceTimelineCellsContainer.innerHTML="",e._tasks.forEach((t=>{t.resources=[],e._refreshTableColumnsData(t,["resources"])})),e._refreshTimeline(),e._createResourceTimeline()}createConnection(){const e=this,t=e._tasks;let i,a=Array.from(arguments).filter((e=>void 0!==e));if(!e.isCompleted||0===t.length)return;if(i=1===a.length?(a[0]+"").split("-"):a,!e._getValidConnectionId(i[0],i[1],i[2],"createConnection"))return;const n=parseInt(i[3]);e._connectTask([i[0],i[1],i[2],isNaN(n)?0:n]),e._recycleConnections(),e.$.fireEvent("itemInsert",{type:"connection",item:{source:i[0],target:i[1],type:i[2],lag:n}})}collapse(e){this._handleCollapseExpandMethods(e,"collapse")}expand(e){this._handleCollapseExpandMethods(e,"expand")}exportData(e,t){const i=this;if(!JQX.Utilities.DataExporter)return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"jqx.export.js"}));try{new JSZip}catch(e){return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"jszip.min.js"}))}if("pdf"===e&!window.pdfMake)return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"pdfMake.min.js"}));const a="task"===i.dataExport.itemType?i.$.taskTable:i.$.resourceTable;return a?a.exportData(e,i.dataExport.fileName,i.dataExport.exportFiltered,t):void 0}print(){const e=this,t=e.dataExport.fileName;e.dataExport.fileName=null;const i=e.exportData("html"),a=window.open("","","width=800,height=500"),n=a.document.open(),s='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>'+t+"</title></head><body>"+i+"</body></html>";try{n.write(s),n.close(),setTimeout((function(){a.print(),a.close()}),100)}catch(e){}e.dataExport.fileName=t}getConnectionDetails(e){const t=this;if("string"!=typeof e)return;const i=t._getConnectionObjById(e);if(!i)return;const a=i.startTask,n=i.endTask,s={startTask:t._cloneObject(i.startTask),endTask:t._cloneObject(i.endTask),startTaskId:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,endTaskId:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,type:i.type};return void 0!==i.lag&&(s.lag=i.lag),s}getConnections(){const e=this;return e._connections.map((t=>{const i=t.startTask,a=t.endTask;return{id:t.startIndex+"-"+t.endIndex+"-"+t.type,startTask:e._cloneObject(i),endTask:e._cloneObject(a),startIndex:t.startIndex,startTaskId:"string"==typeof i.id||"number"==typeof i.id?i.id:i.$.id,endTaskId:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,endIndex:t.endIndex,type:t.type,lag:t.lag}}))}getState(){const e=this,t=e._getTasksJSON(!0)||[];return{tasks:JSON.parse(JSON.stringify(t)),selectedTaskIds:e.selectedTaskIds.slice(0),resources:JSON.parse(JSON.stringify(e._resources.slice(0))),scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}get tasks(){return this.isReady?this.getTasks():[]}get resources(){return this.isReady?this.getResources():[]}getTask(e){const t=this,i=t._getValidItemAndIndex(e);if(i.item)return t._cloneObject(i.item)}getTasks(){const e=this,t=e._tasks;return e.isReady&&t&&t.length?t.map((t=>e._cloneObject(t))):[]}getResource(e){const t=this,i=t._getValidItemAndIndex(e,"resource");if(i.item)return t._cloneObject(i.item)}getResources(){const e=this,t=e._resources;return e.isReady&&t&&t.length?t.map((t=>e._cloneObject(t))):[]}getItemPath(e){if(!e||void 0===e.type)return;const t="string"==typeof e.type?"task":"resource",i=this._getValidItemAndIndex(e,t);return i.item?i.item.$.id:void 0}getTaskIndex(e){const t=this;return"string"==typeof e?t._getTaskIndexById(e):t._getItemIndex(e,"task")}getTaskProject(e){const t=this;if((e=t._tasks[t._getItemIndex(e,"task")])&&e.$&&e.$.project)return t._cloneObject(e.$.project)}getTaskConnections(e){const t=this._getValidItemAndIndex(e,"task");return t&&t.item?this._getTaskConnections(t.item).taskConnections.map((e=>({target:e.endIndex,type:e.type,lag:e.lag}))):[]}getResourceIndex(e){return this._getItemIndex(e,"resource")}getResourceTasks(e){const t=this._getValidItemAndIndex(e,"resource");if(e=t?t.item:void 0)return this._getTasksAssigned(e)}getSelectedIds(){const e=this,t=e.selectedTaskIds,i=e.selectedResourceIds;return e.disableSelection||!t.length&&!i.length?null:{task:t.slice(),resources:i.slice()}}getSelectedTasks(){return this._getSelectedItems("task")}getSelectedResources(){return this._getSelectedItems("resource")}getWorkingHours(){const e=this.nonworkingHours;let t=[];for(let i=0,a=23;i<a;i+=1)e.indexOf(i)<0&&t.push(i);return t}isWorkingDay(e){return e=new Date(e),!isNaN(e.getTime())&&this.nonworkingDays.indexOf(e.getDay())<0}clearState(){const e=this;e.id?window.localStorage.removeItem("jqxGanttChart"+e.id):e.warn(e.localize("noId"))}loadState(e){const t=this;if(!e){if(!t.id)return;e=JSON.parse(window.localStorage.getItem("jqxGanttChart"+t.id))}if(!e)return;let i=JSON.stringify(e.tasks),a=JSON.stringify(e.selectedTaskIds),n=JSON.stringify(e.resources);if(i&&(i=JSON.parse(i)),a&&(a=JSON.parse(a)),n&&(n=JSON.parse(n)),t._noChangeEvent=!0,Array.isArray(i)&&(t._createTasks(i),t.set("dataSource",i)),Array.isArray(n)){let e=n;for(let i=0;i<e.length;i++){const e=n[i];let a=t._resources.find((t=>t.id&&t.id.toString()===e.id.toString()))||{};t._setResource(a,e),Object.values(a).length&&!t._resources.includes(a)&&t._resources.push(a)}t._refreshItemIds("resource")}"number"==typeof e.scrollLeft&&(t.scrollLeft=e.scrollLeft),"number"==typeof e.scrollTop&&(t.scrollTop=e.scrollTop),t._setTable(t.$.taskTable),t._createTimeline(),t._createResourceTimeline(),Array.isArray(a)&&(t.$.taskTable.selected=t._getSelection("task",a)),delete t._noChangeEvent}saveState(){const e=this;e.id?window.localStorage.setItem("jqxGanttChart"+e.id,JSON.stringify(e.getState())):e.warn(e.localize("noId"))}insertTask(e,t,i){const a=this;if("object"!=typeof e)return void a.error(a.localize("incorrectArgument",{elementType:a.nodeName.toLowerCase(),methodName:"insertTask",argumentName:"newTask"}));const n=a._tasks;if(n.indexOf(e)>-1)return void a.error(a.localize("alreadyExists",{elementType:a.nodeName.toLowerCase(),methodName:"insertTask"}));const s=a._createTasks([e],!0);if(!n)return;let r,o,l;const d=a._getSelection("task",a.selectedTaskIds);if("string"==typeof i&&i.indexOf(!1)){const e=i.split(".");i=parseInt(e.slice(-1)),null==t&&(t=e.slice(0,-1).join("."))}if("string"==typeof t?(r=n.find((e=>e.id&&e.id.toString()===t)),r||(r=a._getItemByTableId("task",t))):"number"==typeof t&&(r=n[t]),r){if("project"!==r.type)return void a.error(a.localize("notAProject",{elementType:a.nodeName.toLowerCase(),argumentName:"project",methodName:"insertTask"}));s[0].$.project=r}return a._synchronizeProjectVisibility(s[0].$.project,s[0]),a._insertTasks(s,r,i),a._refreshItemIds(),a._refreshConnectionIds(),a._isUpdating?(a._isUpdating.type.task=!0,void(a._isUpdating.type.resource=!0)):(a._selected&&a._selected.task&&a._setSelection("task",l=a._selected.task.map((e=>e.$.id))),a._refreshTableDataSource(),a._refreshTimeline(),l&&d.toString()!==l.toString()&&(a.$.taskTable.selected=l.slice(0)),a._refreshTaskResources(o),a._ensureVisible(o),a.$.fireEvent("itemInsert",{type:"task",item:a._cloneObject(s[0])}),s[0].id||s[0].$.id+"")}openWindow(e){const t=this;if(t.disableWindowEditor)return;if("string"==typeof e){if(e.indexOf(".")>-1){const i=t._getVCellById("task",e),a=i?i.task:void 0;return void(a&&t._openPopupWindow(a))}if(e.indexOf("-")>-1){let e=(arguments[0]+"").split("-");if(e=t._getValidConnectionId(e[0],e[1],e[2],"openEditor"),e)return void t._openPopupWindow(e)}}const i=t._getValidItemAndIndex(e);i&&t._openPopupWindow(i.item)}closeWindow(){const e=this,t=["confirm","task","connection"];for(let i=0;i<t.length;i++){const a=e.$[t[i]+"PopupWindow"];a&&(a.close(),delete a._target)}}updateTask(e,t){const i=this,a=i._getValidItemAndIndex(e),n=a?a.item:void 0;"object"==typeof n?"object"==typeof t?i._updateTask(n,t):i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"updateTask",argumentName:"taskDetails"})):i.error(i.localize("notExisting",{elementType:i.nodeName.toLowerCase(),methodName:"updateTask",argumentName:"newTask"}))}removeTask(e){const t=this,i=t._tasks,a=t._getValidItemAndIndex(e),n=a?a.item:void 0;i&&i.length&&("object"==typeof n?t._removeTask(n):t.error(t.localize("notExisting",{elementType:t.nodeName.toLowerCase(),methodName:"removeTask",argumentName:"index"})))}setWorkTime(e){this._setWorkTime(e,(function(e,t){for(let i=0,a=e.length;i<a;i+=1){const a=parseInt(e[i]),n=t.indexOf(a);n>-1&&t.splice(n,1)}return t}))}selectTask(e){this._handleItemSelection(e,"task")}selectResource(e){const t=this;t.$.mainSplitter.contains(t.$.resourceTable)&&t._handleItemSelection(e,"resource")}sort(e){const t=this;if("none"===t.sortMode)return;Array.isArray(e)||(e="object"==typeof e?[e]:[]);const i=t.taskColumns,a=t.resourceColumns,n=t.$.taskTable,s=t.$.resourceTable;for(let t=0;t<e.length;t++){const r=e[t],o="desc"===r.sortOrder?"desc":"asc",[l,d]="resource"===r.type||a.includes(r)?[s,a]:[n,i],c=d.find((e=>r.value&&e.value===r.value));c&&l.sortBy(c.value,o)}}unselectTask(e){this._handleItemSelection(e,"task",!0)}unselectResource(e){const t=this;t.$.mainSplitter.contains(t.$.resourceTable)&&t._handleItemSelection(e,"resource",!0)}unsetWorkTime(e){this._setWorkTime(e,(function(e,t){for(let i=0,a=e.length;i<a;i+=1){const a=parseInt(e[i]);t.indexOf(a)<0&&t.push(a)}return t}),!0)}hideTooltip(){this._closeTooltip()}showTooltip(e,t){this._openTooltip(e,void 0,t)}_getSelectedItems(e="task"){const t=this,i=t[`_${e}s`],a=t._getSelection(e,"task"===e?t.selectedTaskIds:t.selectedResourceIds);if(!a.length)return[];let n=[];for(let e=0,s=i.length;e<s;e+=1){const s=i[e];a.indexOf(s.$.id)>-1&&n.push(t._cloneObject(s))}return n}_getTasksAssigned(e){const t=this,i=t._tasks||[];let a=[];for(let n=0;n<i.length;n++){const s=i[n];!s.disableResources&&s.resources.find((t=>t===e.id))&&a.push(t._cloneObject(s))}return a}_getItemIndex(e,t){t||(t="task");const i=this[`_${t}s`];if(e instanceof HTMLElement&&e.classList.contains("jqx-timeline-task"))return i.indexOf(e._cellObj[`_${t}`]);const a="resource"===t?["id","label","value","progress"]:["id","label","type","class","dateStart","dateEnd","resources","connections"];if("object"==typeof e)for(let t=0;t<i.length;t++)if(a.every((a=>Array.isArray(e[a])?JSON.stringify(e[a])===JSON.stringify(i[t][a]):a.indexOf("date")>-1?new Date(e[a]).getTime()===new Date(i[t][a]).getTime():e[a]===i[t][a])))return i.indexOf(i[t]);return-1}_handleItemSelection(e,t="task",i){const a=this,n=a._getValidItemAndIndex(e,t);if(n.item){const s=n.item,r=a._getSelection(t,"task"===t?a.selectedTaskIds:a.selectedResourceIds);if(e=s.$.id,i){const i=r.indexOf(e);i>-1&&(r.splice(i,1),a.$[`${t}Table`].selected=r)}else r.indexOf(e)<0&&(r.push(e),a.$[`${t}Table`].selected=r);return"string"==typeof s.id||"number"==typeof s.id?s.id:s.$.id}}_refreshAfterWorkingTimeChange(){const e=this;if(e.adjustToNonworkingTime)for(let t=0;t<e._tasks.length;t++){const i=e._tasks[t],a=i.$.project;e._validateTaskDates(i,a),e._synchronizeProjectDates(i,a),e._refreshTableColumnsData(i,["dateEnd","duration"])}e._refreshTimeline()}_refreshItemIds(e="task"){const t=this[`_${e}s`];if(!t)return;let i={},a=0;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],s=n.$.project;if(void 0!==s){const e=s.$.id;i[e]||(i[e]=0),n.$.id=e+"."+i[e],i[e]++}else n.$.id=a+"",a++}}_refreshConnectionIds(){const e=this._tasks,t=this._connections;if(t&&t.length)for(let i=0,a=t.length;i<a;i+=1){const n=t[i],s=e.indexOf(n.startTask),r=e.indexOf(n.endTask);(s<0||r<0)&&(t.splice(i,1),a--),n.startIndex=s,n.endIndex=r}}_refreshSelectedItems(e="task",t){const i=this,a=i[`_${e}s`];if(a&&(!t&&i._selected&&i._selected[e]&&(t=i._selected[e]),t)){for(let e=0,i=t.length;e<i;e+=1){const n=t[e];(a.indexOf(n)<0||n.hidden)&&(t.splice(e,1),e-=1,i--)}i._setSelection(e,t.map((e=>e.$.id)))}}_resetFromAction(e="task",t="clearSort"){const i=this;function a(){i.$.taskTable[t](),i._createTimelineContent(),i._recycleTimelineTasks()}function n(){const e=i.$.resourceTable;e&&(e[t](),i._createResourceTimelineVCells(),i._recycleResourceContent())}"resource"===e?n():"task"===e?a():(a(),n())}_setWorkTime(e,t,i){const a=this;if("object"!=typeof e)return;let n,s=e.days,r=e.hours;null!=s&&(Array.isArray(s)||(s=[s]),s=a._nonworkingDayValidator(void 0,s),n=t(s,i?a.nonworkingDays:[0,1,2,3,4,5,6]),a.set("nonworkingDays",7===n.length?[]:n),a._refreshAfterWorkingTimeChange()),null!=r&&(Array.isArray(r)||(r=[r]),r=a._nonworkingTimeValidator(void 0,r),n=t(r,i?a.nonworkingHours:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),a.set("nonworkingHours",24===n.length?[]:n),a._refreshAfterWorkingTimeChange())}_getValidConnectionId(e,t,i,a){const n=this,s=n._tasks,r=0===a.indexOf("_");let o;if("string"==typeof e&&(o=n._getTaskIndexById(e),o>=0&&(e=o)),"string"==typeof t&&(o=n._getTaskIndexById(t),o>=0&&(t=o)),e=parseInt(e),t=parseInt(t),i=parseInt(i),isNaN(e)||isNaN(t)||e===t)r||n.error(n.localize("incorrectArgument",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"taskIndex"}));else if(e>=s.length||e<0||t>=s.length||t<0)r||n.error(n.localize("outOfBounds",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"taskIndex"}));else{if(!(isNaN(i)||i<0||i>3))return r?[e,t,i]:e+"-"+t+"-"+i;r||n.error(n.localize("incorrectArgument",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"connectionType"}))}}_autoSchedule(e){const t=this,i=t._tasks;if(t.autoSchedule){e?Array.isArray(e)||(e=[e]):e=i;for(let i=0;i<e.length;i++){const a=e[i];"project"===a.type&&a.synchronized||(a.minDateStart=a.minDateEnd=void 0,t._autoScheduleTasks(a))}t._isUpdateRequired&&(t._createTimelineCells(),t._recycleTimelineTasks(!0),delete t._isUpdateRequired)}}_getTaskConnections(e){const t=this._tasks,i=this._connections;let a=[],n=[];if(t&&t.length&&i&&i.length){const s=t.indexOf(e);for(let e=0;e<i.length;e+=1){const t=i[e];t.startIndex===s?a.push(t):t.endIndex===s&&n.push(t)}}return{taskConnections:a,connectedTasks:n}}_autoScheduleTasks(e){const t=this,i=t._tasks,a=t._getTaskConnections(e),n=a.taskConnections,s=a.connectedTasks;let r,o,l;for(let a=0;a<n.length;a++)t._isAutoScheduled(e,i[n[a].endIndex],!0);for(let a=0;a<s.length;a++){const n=s[a],d=i[n.startIndex],c=n.type,m=n.lag,u=e.$.project;d&&"project"===d.type&&d.synchronized||(0===c||1===c?(l=new Date((0===c?d.dateStart:d.dateEnd).getTime()+m),e.minDateStart=new Date(e.minDateStart?Math.max(e.minDateStart.getTime(),l.getTime()):l),o=e.minDateStart.getTime()-e.dateStart.getTime(),r=new Date(e.dateEnd.getTime()+(t.autoScheduleStrictMode?o:Math.max(0,o))),r.getTime()!==e.dateEnd.getTime()&&(e.dateEnd=r,t._isUpdateRequired=!0),t.autoScheduleStrictMode&&e.minDateStart.getTime()!==e.dateStart.getTime()&&(e.dateStart=e.minDateStart,t._isUpdateRequired=!0)):(l=new Date((2===c?d.dateEnd:d.dateStart).getTime()+m),e.minDateEnd=new Date(e.minDateEnd?Math.min(e.minDateEnd.getTime(),l.getTime()):l),o=e.minDateEnd.getTime()-e.dateEnd.getTime(),r=new Date(e.dateStart.getTime()+(t.autoScheduleStrictMode?o:Math.max(0,o))),r.getTime()!==e.dateStart.getTime()&&(e.dateStart=r,t._isUpdateRequired=!0),t.autoScheduleStrictMode&&e.minDateEnd.getTime()!==e.dateEnd.getTime()&&(e.dateEnd=e.minDateEnd,t._isUpdateRequired=!0)),t._validateTaskDates(e,u),t._synchronizeProjectDates(e,u))}for(let e=0;e<n.length;e++){const a=i[n[e].endIndex];!a||"project"===a.type&&a.synchronized||(a.minDateStart=a.minDateEnd=void 0,t._autoScheduleTasks(a))}}_autoScheduleRestore(e,t){const i=this._tasks;e||(e=i),Array.isArray(e)||(e=[e]);for(let a=0;a<e.length;a++){const n=e[a];i.indexOf(e[a])>-1&&(t?0===t||1===t?n.minDateStart=void 0:n.minDateEnd=void 0:n.minDateStart=n.minDateEnd=void 0)}}_autoScroll(e){const t=this,i=t.hasAttribute("dragged"),a=t.hasAttribute("resized");function n(n,s){if(!t._dragDetails)return clearInterval(t._scrollInterval),t._scrollInterval=void 0,void delete t._autoScrolling;t._autoScrolling=!0,s?i||(t.scrollTop-=t.autoScrollStep*n,t._dragDetails.coordinates.y+=t.autoScrollStep*n):(t.scrollLeft-=(t.rightToLeft?-1:1)*t.autoScrollStep*n,t._dragDetails.coordinates.x+=t.autoScrollStep*n),i?t._handleTaskBarDrag(e):a&&t._handleTaskBarResize(e)}if(t.disableAutoScroll||!e||!i&&!a&&!t.hasAttribute("connecting-task"))return;const s=t.$.timeline.getBoundingClientRect();t._scrollInterval&&clearInterval(t._scrollInterval),t._scrollInterval=setInterval((function(){(t.scrollLeft||t.rightToLeft)&&e.clientX<=s.left+20?n(1):t.scrollLeft!==(t.rightToLeft?0:t.scrollWidth)&&e.clientX>=s.left+s.width-20?n(-1):t.scrollTop&&e.clientY<=s.top+20?n(1,!0):t.scrollTop!==t.scrollHeight&&e.clientY>=s.top+s.height-20?n(-1,!0):(clearInterval(t._scrollInterval),t._scrollInterval=void 0,delete t._autoScrolling)}),1)}_checkTaskBarResizability(e){const t=this;let i=e.originalEvent.target;t.shadowRoot&&i===t&&(i=e.originalEvent.composedPath()[0]);const a=t.$.timeline;if(!i.closest)return void a.removeAttribute("task-bar-hovered");let n,s=i.closest(".jqx-timeline-row")||i.closest(".jqx-timeline-task");if(t.disabled||t.disableTaskResize||!s||!a.contains(s))return void a.removeAttribute("task-bar-hovered");const r=s._cellObj.task,o=t._getTaskDOMIndex(r);if(s.classList.contains("jqx-timeline-row")?n=t.$.timelineTasksContainer.children[o]:s.classList.contains("jqx-timeline-task")&&(n=s,s=t.$.taskTimelineCellsContainer.children[o]),!n||n.classList.contains("milestone")||r.synchronized||r.disableResize)return;const l=i.closest(".jqx-task-segment"),d=r.segments?r.segments.length:1;if(i.classList&&i.classList.contains("jqx-task-connection-point")||l&&(d>1&&t.disableSegmentResize||l._segmentObj&&l._segmentObj.disableResize))return void a.removeAttribute("task-bar-hovered");const c=e.pageX-window.pageXOffset,m="visible"===t.resizeHandlesVisibility||t._isMobile?20:5,u=(l||n).getBoundingClientRect(),h=s.getBoundingClientRect(),g=Math.min(m,c-h.left),f=Math.min(m,h.left+h.width-c);Math.round(u.left)+g>=c&&Math.round(u.left)-g<=c?a.setAttribute("task-bar-hovered","left"):Math.round(u.left+u.width)+f>=c&&Math.round(u.left+u.width)-f<=c?a.setAttribute("task-bar-hovered","right"):a.removeAttribute("task-bar-hovered")}_onShadowDomLoaded(e,t,i){requestAnimationFrame((function a(){const n=(e.shadowRoot||e.getRootNode()).querySelectorAll("link");for(let e=0;e<n.length;e++)if(-1!==n[e].href.indexOf(t))return void i();requestAnimationFrame(a)}))}_getConnectionObjById(e){const t=this._connections;if(!e||!t||!t.length)return;const i=e.split("-"),a=parseInt(i[0]),n=parseInt(i[1]),s=parseInt(i[2]);for(let e=0,i=t.length;e<i;e+=1){const i=t[e];if(i.startIndex===a&&i.endIndex===n&&i.type===s)return i}}_positionWindow(){const e=this,t=e.getShadowRootOrBody(),i=[e.$.taskPopupWindow,e.$.connectionPopupWindow,e.$.confirmPopupWindow];for(let a=0;a<i.length;a++){const n=i[a];if(!n||!t.contains(n))continue;const s=e.getBoundingClientRect();n.opened||(n.style.left=n.style.top=""),e._isMobile?(n.setAttribute("mobile",""),n.style.left=s.left+window.pageXOffset+"px",n.style.top=s.top+window.pageYOffset+"px",n.style.width=s.width+"px",n.style.height=s.height+"px"):(n.style.left=Math.max(s.left+window.pageXOffset,s.left+window.pageXOffset+s.width/2-n.offsetWidth/2)+"px",n.style.top=Math.max(s.top+window.pageYOffset,s.top+window.pageYOffset+s.height/2-n.offsetHeight/2)+"px")}}_openPopupWindow(e,t){const i=this;function a(){function t(){i._positionWindow(),s.opened?(s.bringToFront(),s._onOpenCallback?s._onOpenCallback():s._handleActiveState()):s.open()}if(i.popupWindowCustomizationFunction?i.popupWindowCustomizationFunction(s,n,"connection"===n?e.startIndex+"-"+e.endIndex+"-"+e.type:i._cloneObject(e)):s._onOpenCallback=()=>{const e=(s.shadowRoot||s).querySelectorAll(".jqx-gantt-chart-popup-window-editor .jqx-input, .jqx-popup-window-button");(e[0]||e[1]||s).focus({preventScroll:!0}),s._handleActiveState()},i._setPopupWindowTemplate("header",n,e),i._setPopupWindowTemplate("footer",n,e),i._setPopupWindowTemplate("content",n,e),!i._popupWindow[n+"PopupWindow"]){const e=i["$"+n+"PopupWindow"];e.unlisten("transitionend"),e.unlisten("open"),e.unlisten("close"),e.unlisten("closing"),e.unlisten("click"),e.unlisten("change"),e.listen("transitionend",i._popupWindowTransitionendHandler.bind(i)),e.listen("open",i._popupWindowOpenHandler.bind(i)),e.listen("close",i._popupWindowCloseHandler.bind(i)),e.listen("closing",i._popupWindowClosingHandler.bind(i)),e.listen("click",i._popupWindowClickHandler.bind(i)),e.listen("change",i._popupWindowChangeHandler.bind(i))}s.shadowRoot?(s.importStyle(JQX.Utilities.Core.getScriptLocation()+JQX.StyleBaseUrl.replace("/scoped/","/jqx.textbox.css")),i._onShadowDomLoaded(s,"jqx.window.css",t)):t();const a=(i.getAttribute("aria-owns")||"")+" "+s.id;i.setAttribute("aria-owns",a.trim()),i._popupWindow[n+"PopupWindow"]=s}if(e&&e.classList)if(e.classList.contains("jqx-task-connection"))e=i._getConnectionObjById(e.getAttribute("connection-id"));else if("TR"===e.nodeType){const t=e?"task":"resource",a=i._getVCellById(t,e.getAttribute("row-id"));e=a?a[t]:void 0}else e=e._cellObj.task;if(!e||e.isGroup)return;const n=t?"confirm":"string"==typeof e.type?"task":"connection",s=i._createPopupWindow(n);!t&&i.$.fireEvent("opening",{target:s,type:n}).defaultPrevented||(i._closeTooltip(),s._target=e,i._popupWindow||(i._popupWindow={}),s.parentElement||i.getShadowRootOrBody().appendChild(s),s.isCompleted?a():s.whenReady((()=>a())))}_createPopupWindow(e){const t=this,i=e+"PopupWindow";if(t.$[i])return t.$[i];const a=document.createElement("jqx-window");return a.classList.add("jqx-"+e+"-popup-window"),a.classList.add("jqx-gantt-chart-popup-window"),a.setAttribute("jqx-id",i),t.$[i]=a,t["$"+i]=JQX.Utilities.Extend(a),a.rightToLeft=t.rightToLeft,a.theme=t.theme,a.animation=t.animation,a.disableSnap=!0,a.headerButtons=["close"],a}_popupWindowOpenHandler(e){const t=this,i=t["$"+e.target.getAttribute("jqx-id")];if(i){const a=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";t._handleModal(!0),t.$.fireEvent(e.type,Object.assign({type:a,target:e.target},e.detail)),i.unlisten("open")}}_popupWindowClosingHandler(e){const t=this["$"+e.target.getAttribute("jqx-id")];if(!t)return;const i=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";this.$.fireEvent(e.type,{target:e.target,type:i}).defaultPrevented?e.preventDefault():t.unlisten(e.type)}_popupWindowCloseHandler(e){const t=this,i=e.target.getAttribute("jqx-id"),a=t["$"+i];if(a){const n=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";if(t._handleModal(),t.$.fireEvent(e.type,Object.assign({type:n,target:e.target},e.detail)),a.unlisten("close"),a.unlisten("click"),t.hasAttribute("aria-owns")){const e=t.getAttribute("aria-owns").replace(t._popupWindow[i].id,"").trim();e?t.setAttribute("aria-owns",e):t.removeAttribute("aria-owns")}delete t._popupWindow[i];const s=Object.keys(t._popupWindow);1===s.length&&t._popupWindow.confirmPopupWindow&&(delete t._popupWindow.confirmPopupWindow._target,t._popupWindow.confirmPopupWindow.close()),s.length?requestAnimationFrame((()=>{const e=t._popupWindow[s[s.length-1]];e&&e.focus()})):t.keyboardNavigation&&t.$.taskTable.focus({preventScroll:!0})}}_popupWindowTransitionendHandler(e){const t=this,i=e.target;i instanceof JQX.Window&&!i.opened&&"visibility"===e.propertyName&&(t["$"+i.getAttribute("jqx-id")].unlisten("transitionend"),i.parentElement&&i.parentElement.removeChild(i))}_handleModal(e){const t=this;let i=(t.shadowRoot||t).querySelector(".jqx-popup-window-modal");e?(i||(i=document.createElement("div"),i.classList.add("jqx-popup-window-modal")),i.parentElement||(t.$.container.appendChild(i),t.setAttribute("modal",""))):i&&i.parentElement&&Object.keys(t._popupWindow).length<2&&(i.parentElement.removeChild(i),t.removeAttribute("modal"))}_findTaskEditor(e,t){if(!e||!t)return;const i=t.children;for(let t=0,a=i.length;t<a;t+=1){const a=i[t];if(a.getAttribute("value")===e)return a}}_createTaskEditor(e,t,i){const a=this,n=e.value,s=t[e.value];let r,o,l=i.find((e=>e._label===n));if(l)r=l.querySelector(".jqx-gantt-chart-label-container"),o=l.lastElementChild;else{const t="editorLabel"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);if(r=document.createElement("div"),r.classList.add("jqx-gantt-chart-label-container"),r.innerHTML=`<label id="${t}"></label>`,"deadline"===n){const e=document.createElement("span");e.classList.add("jqx-popup-window-editor-toggle"),r.appendChild(e)}if(l=document.createElement("div"),l.classList.add("jqx-gantt-chart-popup-window-editor"),l.setAttribute("value",n||""),l._label=n,e.customEditor)return l.appendChild(e.customEditor(n,s)),l;if("number"==typeof s||"string"==typeof s)o=document.createElement("input"),o.classList.add("jqx-input");else if(s instanceof Date||"deadline"===n)JQX.DateTimePicker?(o=document.createElement("jqx-date-time-picker"),o.locale=a.locale,o.dropDownAppendTo="body",o.calendarButton=!0,o.dropDownDisplayMode="auto",o.enableMouseWheelAction=!0,o.formatString="yyyy-MMM-dd HH:mm:ss"):(o=document.createElement("input"),o.type="datetime-local");else if(Array.isArray(s))if(JQX.DropDownList)o=document.createElement("jqx-drop-down-list"),o.virtualized=!0,o.dropDownAppendTo="body",o.selectionMode="zeroOrMany";else{o=document.createElement("input"),o.classList.add("jqx-input");const e=document.createElement("datalist");e.id="resourceList",o.setAttribute("list",e.id),l.appendChild(e)}o&&o.setAttribute("aria-labelledby",t)}if(!l.parentElement)return r&&l.appendChild(r),o&&l.appendChild(o),l;a._setPopupWindowEditors(e,t,l)}_setAriaControls(){this.setAttribute("role","treegrid")}_setPopupWindowEditors(e,t,i){const a=this,n=i.querySelector("label"),s=i.querySelector(".jqx-popup-window-editor-toggle"),r=i.lastElementChild,o=e.value+"",l=o.split(/(?=[A-Z])/).join(" "),d=t[o];if(e.customEditor)e.setCustomEditorValue&&e.setCustomEditorValue(i,l,d);else{if(n.innerHTML=a.localize(e.value)||l.charAt(0).toUpperCase()+l.slice(1),s)if("deadline"===o){const e=null==d?"add":"remove";r.classList[e]("jqx-hidden"),s.textContent=a.localize(e)}else s.remove();if("number"==typeof d)r.value=parseFloat(d);else if("string"==typeof d)r.value=d;else if(d instanceof Date)r.value=new Date(d);else if(Array.isArray(d)){const e=a._resources;if(r.placeholder=a.localize("unassigned"),JQX.DropDownList&&r instanceof JQX.DropDownList)r.dataSource=e.map((e=>({label:e.label,value:e.id}))),r.selectedValues=t.disableResources?[]:t.resources.map((e=>e.toString()));else{let a=i.querySelector("datalist"),n=document.createDocumentFragment();a.innerHTML="";for(let t=0;t<e.length;t++){const i=e[t],a=document.createElement("option");a.value=i.id,a.innerHTML=i.label,n.appendChild(a)}r.value=t.resources.toString(),a.appendChild(n)}}"project"===t.type&&t.synchronized&&["duration","date"].indexOf(l.toLowerCase())>-1||"resources"===l&&t.disableResources?r.disabled=!0:r.disabled=!!e.disableEdit,r.rightToLeft=a.rightToLeft,r.animation=a.animation,r.theme=a.theme}}_setupPopupWindowTabs(e,t){const i=this,a=i.popupWindowTabs,n="milestone"===t.type,s=[{label:i.localize("generalTab"),value:"general"},{label:i.localize("dependencyTab"),value:"dependency"},{label:i.localize("segmentsTab"),value:"segments"}];let r=e.querySelector(".jqx-gantt-chart-popup-window-tabs");r||(r=document.createElement("jqx-tabs"),r.classList.add("jqx-gantt-chart-popup-window-tabs"),e.clear(),e.appendChild(r)),r.animation=i.animation,r.rightToLeft=i.rightToLeft,r.theme=i.theme;const o=r.getTabs().slice(0);for(let e=0,t=s.length;e<t;e+=1){const t=s[e],i=t.value;let l=o[e];a.indexOf(i)<0?l&&r.removeChild(l):(l||(l=document.createElement("jqx-tab-item"),r.appendChild(l)),l.label=t.label,l.setAttribute("value",i||""),l.disabled=n&&"segments"===i)}return r}_setPopupWindowContent(e,t){const i=this,a=i.$[e+"PopupWindow"],n=[].slice.call(a.querySelectorAll(".jqx-gantt-chart-popup-window-editor"));if(a.content&&(!a.content.innerHTML||n.length))if("task"===e&&t){const e=i.taskColumns;let s=[];const r=i._setupPopupWindowTabs(a,t);0!==r.selectedIndex&&(r.selectedIndex=0);const o=r.getTabs()[0];if("general"!==o.getAttribute("value"))return void i._handleTabsContent(o,a);"string"==typeof o.content?o.content="":o.content.innerHTML="";for(let a=0;a<e.length;a++){const r=e[a],l=r.value;if(void 0===t[l]&&"deadline"!==l||"overdue"===l)continue;let d=i._findTaskEditor(l,o);d||(d=i._createTaskEditor(r,t,n),d&&o.appendChild(d)),d&&(i._setPopupWindowEditors(r,t,d),s.push(d))}for(let e=0,t=n.length;e<t;e+=1){const t=n[e];s.indexOf(t)<0&&t.remove()}t.id&&a.setAttribute("aria-controls",t.id)}else if("confirm"===e){if(a.innerHTML='<div class="jqx-gantt-chart-popup-window-editor">'+i.localize("confirm",{componentName:"The task"})+"</div >",i._popupWindow){const e=Object.keys(i._popupWindow);e.length&&a.setAttribute("aria-controls",i._popupWindow[e[e.length-1]].id)}}else{const e=t.startTask,n=t.endTask;a.innerHTML='<div class="jqx-gantt-chart-popup-window-editor">'+i.localize("deleteLink")+"<b> "+e.label+" - "+n.label+"?</b></div>"}}_setPopupWindowTemplate(e,t,i){const a=this,n=a.$[t+"PopupWindow"];if("content"!==e){if(n[e+"Template"]||(n[e+"Template"]=a._createPopupWindowTemplate(e,t)),"header"===e&&i&&"string"==typeof i.type){const e=(n.shadowRoot||n).querySelector(".jqx-popup-window-label");e&&(e.innerHTML=i.label)}else if("footer"===e){const e=(n.shadowRoot||n).querySelectorAll(".jqx-popup-window-button");for(let i=0;i<e.length;i++){const n=e[i];n.innerHTML="task"===t?'<span class="jqx-icon"></span>':"",n.theme=a.theme,n.rightToLeft=a.rightToLeft,n.animation=a.animation,n.disabled=!1,n.classList.contains("ok")?(n.innerHTML+=a.localize("ok"),n.setAttribute("aria-label","ok")):n.classList.contains("cancel")?(n.innerHTML+=a.localize("cancel"),n.setAttribute("aria-label","cancel")):n.classList.contains("delete")&&(n.innerHTML+=a.localize("delete"),n.setAttribute("aria-label","delete"));const s=n.querySelector(".jqx-ripple");s&&s.parentElement.removeChild(s)}}}else a._setPopupWindowContent(t,i)}_createPopupWindowTemplate(e,t){const i=this,a=document.createElement("template");if("footer"===e)switch(t){case"task":a.innerHTML=`<jqx-button class="jqx-popup-window-button ok primary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button cancel"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button delete secondary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>`;break;case"connection":case"confirm":a.innerHTML=`<jqx-button class="jqx-popup-window-button ok primary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button cancel"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>`}else"header"!==e||"task"!==t&&"confirm"!==t||(a.innerHTML='<span class="jqx-popup-window-label"></span>');return a}_handleTabsContent(e,t){const i=this,a=t._target;if(!e|!a)return;const n=e.getAttribute("value");if("general"===n)return;let s=e.querySelector(".jqx-gantt-popup-window-table"),r=e.querySelector(".jqx-gantt-window-table-buttons"),o=e.querySelector(".jqx-gantt-window-validation-message");r||(r=document.createElement("div"),r.classList.add("jqx-gantt-window-table-buttons"),r.innerHTML=`<jqx-button class="jqx-gantt-chart-button" action="add">${i.localize("add")}</jqx-button>\n <jqx-button class="jqx-gantt-chart-button" disabled action="delete">${i.localize("delete")}</jqx-button>`,e.insertBefore(r,s)),s||(s=document.createElement("jqx-table"),s.classList.add("jqx-gantt-popup-window-table"),s.editing=!0,s.editMode="row",s.keyboardNavigation=!0,s.wait=!0,s.hideSelectionColumn=!0,s.selection=!0,s.selectionMode="one",s.columnMinWidth="10px",s.addEventListener("rowEndEdit",(r=>{const o=r.detail.row;switch(n){case"dependency":{const e=i._tasks,t=o.name,n=e.indexOf(a),r=e.findIndex((e=>e.$.id===t));r>-1&&s.updateRow(o.$.id,{id:`${r}-${n}-${o.type}`});break}case"segments":{const e=o.dateStart,t=o.dateEnd;e.getTime&&t.getTime&&s.updateRow(o.$.id,{duration:parseFloat(i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e,t):t.getTime()-e.getTime(),!0).toFixed(2))});break}}i._applyTableValidation(e,s,t),i._isPopupWindowTableModified=!0})),e.innerHTML&&(e.innerHTML=""),e.appendChild(s));const l=i._getTabsTableData(n,a);s.selected.length&&(s.selected=[]),s.dataSource=l.source,s.columns=l.columns,s.wait=!1,delete i._isPopupWindowTableModified,o||(o=document.createElement("label"),o.classList.add("jqx-gantt-window-validation-message"),e.appendChild(o)),o.textContent=""}_applyTableValidation(e,t,i){const a=this,n=e.getAttribute("value"),s=e.querySelector(".jqx-gantt-window-validation-message"),r=i.querySelector(".jqx-popup-window-button.ok"),o=t.dataSource,l=o.length;if(!s)return void(r&&(r.disabled=!1));if(!l)return s.textContent="",void(r&&(r.disabled=!1));let d="";if("segments"===n)if(l<2)d=a.localize("segmentsCountValidation");else{const e=i._target,t=e.dateStart.getTime(),n=e.dateEnd.getTime();let s={};for(let e=0;e<l;e+=1){const i=o[e],r=i.label,l=i.dateStart.getTime(),c=i.dateEnd.getTime();for(let e in s){const t=s[e],n=t.timeStart,r=t.timeEnd,o=l<=n&&c>=n;(o||l<=r&&c>=r)&&(d+=a.localize("segmentConflictError",{dateConflict:o?"dateStart":"dateEnd",label:i.label,conflictLabel:t.label})+"\r\n")}l>c?d+=a.localize("segmentStartError",{label:i.label})+"\r\n":l===c&&(d+=a.localize("segmentEndError",{label:i.label})+"\r\n"),(l<t||c>n)&&(d+=a.localize("segmentRangeError",{label:i.label})+"\r\n"),void 0===s[e]&&(s[e]={label:r,timeStart:l,timeEnd:c})}}else if("dependency"===n)for(let e=0;e<l;e+=1){const t=o[e].id.split("-");t[0]===t[1]&&(d+=a.localize("dependencyValidation")+"\r\n")}s.textContent=d,r&&(r.disabled=d.length>0)}_getTabsTableData(e,t){const i=this;if("dependency"===e){const e=i._getTaskConnections(t).connectedTasks,a={connectionTypes:[{label:i.localize("startToStart"),value:0},{label:i.localize("endToStart"),value:1},{label:i.localize("endToEnd"),value:2},{label:i.localize("startToEnd"),value:3}],tasks:(()=>{const e=i._tasks;let a=[];for(let i=0,n=e.length;i<n;i+=1){const n=e[i];n!==t&&a.push({value:n.$.id,label:n.label})}return a})()};return{source:new window.JQX.DataAdapter({dataSource:e&&e.length?e.map((e=>({id:e.startIndex+"-"+e.endIndex+"-"+e.type,name:e.startTask.$.id||"",type:e.type,lag:e.lag||0}))):[],dataFields:["id: any","name: any","type: number","lag: number"]}),columns:[{label:i.localize("id"),dataField:"id",dataType:"any",autoWidth:!1,allowEdit:!1},{label:i.localize("name"),dataField:"name",dataType:"any",width:"35%",autoWidth:!1,editor:i._getColumnEditorSetup("name",a),formatFunction:e=>{const t=a.tasks.find((t=>t.value===e.value));t&&(e.value=t.label)}},{label:i.localize("type"),dataField:"type",dataType:"number",width:"25%",autoWidth:!1,editor:i._getColumnEditorSetup("type",a),formatFunction:e=>{const t=a.connectionTypes.find((t=>t.value===e.value));t&&(e.value=t.label)}},{label:i.localize("lag"),dataField:"lag",dataType:"number",autoWidth:!1}]}}if("segments"===e){const e={task:t};return{source:new window.JQX.DataAdapter({dataSource:t.segments,dataFields:["label: string","dateStart: date","dateEnd: date","duration: number"]}),columns:[{label:i.localize("name"),dataField:"label",dataType:"string",autoWidth:!1,width:"20%"},{label:i.localize("dateStart"),dataField:"dateStart",dataType:"date",autoWidth:!1,editor:i._getColumnEditorSetup("dateStart",e),formatFunction:e=>{e.value=i._formatDate(e.data.dateStart)}},{label:i.localize("dateEnd"),dataField:"dateEnd",dataType:"date",autoWidth:!1,editor:i._getColumnEditorSetup("dateEnd",e),formatFunction:e=>{e.value=i._formatDate(e.data.dateEnd)}},{label:i.localize("duration"),dataField:"duration",dataType:"number",autoWidth:!1,width:"15%",allowEdit:!1}]}}return{source:[],columns:[]}}_getColumnEditorSetup(e,t){const i=this;switch(e){case"dateStart":case"dateEnd":return{template:'<jqx-date-time-picker drop-down-append-to="body" wait></jqx-date-time-picker>',onInit:(e,a,n,s)=>{const r=t.task;s||(s=new Date(r.dateStart)),n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.min=r.dateStart,n.max=r.dateEnd,n.locale=i.locale,n.calendarButton=!0,n.dropDownDisplayMode="auto",n.enableMouseWheelAction=!0,n.formatString="yyyy-MMM-dd HH:mm:ss",n.value=new Date(Math.max(r.dateStart.getTime(),Math.min(r.dateEnd.getTime(),s.getTime()))),n.removeAttribute("wait")},getValue:e=>e.value.toDate()};case"name":return{template:'<jqx-drop-down-list virtualized drop-down-append-to="body" wait></jqx-drop-down-list>',onInit:(e,a,n,s)=>{n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.dataSource=t.tasks,n.selectedValues=[s],n.removeAttribute("wait")},getValue:e=>e.selectedValues[0]};case"type":return{template:"<jqx-input wait></jqx-input>",onInit:(e,a,n,s)=>{const r=t.connectionTypes,o=r.find((e=>e.value===s));n.readonly=!0,n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.dropDownButtonPosition="right",n.dataSource=r,n.value=(o||r[0]).label+"",n.removeAttribute("wait")},getValue:e=>{if(e.selectedValues.length)return e.selectedValues[0];const i=t.connectionTypes.find((t=>t.label===e.value));return i?i.value:void 0}}}}_popupWindowChangeHandler(e){const t=this,i=e.target,a=i.closest("jqx-window")||(i.getRootNode()&&i.getRootNode().host?i.getRootNode().host:void 0);if(a._target)if(i.classList.contains("jqx-gantt-chart-popup-window-tabs")){const n=a.querySelector(".jqx-popup-window-button.ok");n&&(n.disabled=!1),t._handleTabsContent(i.getTabs()[e.detail.index],a)}else if(i.classList.contains("jqx-gantt-popup-window-table")){const e=i.closest("jqx-tab-item").querySelector('.jqx-gantt-chart-button[action="delete"]');e&&(e.disabled=0===i.selected.length)}}_popupWindowClickHandler(e){const t=this;let i=(e.originalEvent||e).target;i.shadowRoot&&(i=(e.originalEvent||e).composedPath()[0]);const a=i.closest("jqx-window")||(i.getRootNode()&&i.getRootNode().host?i.getRootNode().host:void 0),n=a._target;if(i.closest(".jqx-popup-window-button.cancel"))return t._popupWindow&&t._popupWindow.confirmPopupWindow&&a!==t._popupWindow.confirmPopupWindow&&t._popupWindow.confirmPopupWindow.close(),a.close(),void delete a._target;if(i.closest(".jqx-popup-window-button.ok")){if(a===t.$.connectionPopupWindow&&"number"==typeof n.type)t._removeConnection(n.startIndex+"-"+n.endIndex+"-"+n.type);else if(a===t.$.confirmPopupWindow){const e=n;void 0!==e.$._resourceId?t._removeResource(e):t._removeTask(e),a.close(),t.$.taskPopupWindow&&t.$.taskPopupWindow.close(),delete a._target}else{const e=a.shadowRoot||a,i=e.querySelectorAll(".jqx-gantt-chart-popup-window-editor"),s=n;let r={};for(let e=0;e<i.length;e++){const a=i[e]._label,n=t.taskColumns.find((e=>e.value===a));if(n.customEditor&&n.getCustomEditorValue)r[a]=n.getCustomEditorValue(i[e]);else{const t=i[e].lastElementChild;let n;if(!t)continue;if(t.classList.contains("jqx-hidden")){r[a]=void 0;continue}n=JQX.DateTimePicker&&t instanceof JQX.DateTimePicker?t.value.toDate?t.value.toDate():t.value:t instanceof HTMLInputElement&&"datetime-local"===t.type?new Date(t.value):JQX.DropDownList&&t instanceof JQX.DropDownList?t.selectedValues.slice(0):t.hasAttribute("list")?t.value.split(",").map((e=>e.trim())):t.value,n instanceof Date&&isNaN(n.getTime())&&(n=void 0),null!=n&&(r[a]=n)}}if(void 0!==s.$._resourceId)t._updateResource(s,r);else{const i=r.dateStart?r.dateStart:void 0,a=r.dateEnd?r.dateEnd:void 0;if((i&&i.getTime&&i.getTime()!==s.dateStart.getTime()||a&&a.getTime&&a.getTime()!==s.dateEnd.getTime())&&(r.duration=void 0),t._isPopupWindowTableModified){const i=e.querySelectorAll(".jqx-gantt-popup-window-table");for(let e=0,a=i.length;e<a;e+=1){const a=i[e];a.closest('.jqx-tab-item[value="dependency"]')?t._updateTaskDependencies(a,s):a.closest('.jqx-tab-item[value="segments"]')&&t._updateTaskSegments(a,s)}}t._updateTask(s,r)}}return t._popupWindow&&t._popupWindow.confirmPopupWindow&&a!==t._popupWindow.confirmPopupWindow&&t._popupWindow.confirmPopupWindow.close(),a.close(),void delete a._target}if(i.closest(".jqx-popup-window-button.delete"))return void t._openPopupWindow(a._target,!0);if(i.closest(".jqx-popup-window-editor-toggle")){const e=i.closest('.jqx-gantt-chart-popup-window-editor[value="deadline"]'),a=e?e.lastElementChild:void 0;if(a){const e=a.classList.contains("jqx-hidden")?"remove":"add";a.classList[e]("jqx-hidden"),i.textContent=t.localize(e)}return}const s=i.closest(".jqx-gantt-chart-button");if(s){const e=i.closest("jqx-tab-item"),r=e.querySelector(".jqx-gantt-popup-window-table");if(!r)return;const o=s.getAttribute("action"),l=e.getAttribute("value"),d=n;switch(o){case"add":{let e;e="segments"===l?{label:`${t.localize("segment")} ${r.dataSource.length+1}`,dateStart:new Date(d.dateStart),dateEnd:new Date(d.dateEnd),duration:parseFloat((d.duration||0).toFixed(2))}:{id:"",name:"",type:0,lag:0},r.addRow(e),r.beginEdit(r.rows.length-1),t._isPopupWindowTableModified=!0;break}case"delete":{const e=r.selected;r.beginUpdate();for(let t=0,i=e.length;t<i;t+=1)r.removeRow(e[t]);r.endUpdate(),t._isPopupWindowTableModified=!0;break}}t._applyTableValidation(e,r,a)}}_updateTaskDependencies(e,t){const i=this,a=i._tasks.indexOf(t),n=i._getTaskConnections(t).connectedTasks,s=e.rows;for(let e=0,t=n.length;e<t;e+=1){const t=n[e];i._removeConnection(`${t.startIndex}-${t.endIndex}-${t.type}`)}for(let e=0,t=s.length;e<t;e+=1){const t=s[e].data,n=t.name,r=t.type;if(!i._getValidConnectionId(n,a,r,"_"))continue;const o=parseInt(t.lag);i._connectTask([n,a,r,isNaN(o)?0:o])}i._recycleConnections()}_updateTaskSegments(e,t){const i=e.rows;let a=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e].data,n=t.label,s=new Date(t.dateStart),r=new Date(t.dateEnd);isNaN(s)||isNaN(r)||a.push({label:"string"==typeof n?n:"",dateStart:s,dateEnd:r})}t.segments=a,this._validateTaskSegments(t)}_createTasks(e,t){const i=this,a={},n=[];e||(e=i.dataSource),i.dataSource instanceof JQX.DataAdapter&&(e=i._parseAdapterData(i.dataSource.toArray())),t||i.clearTasks();let s=[];if(function e(r,o){let l=[];if(!r||0===r.length)return[];for(let d=0;d<r.length;d++){let c,m=r[d];if("object"!=typeof m)continue;if(m=i._validateTaskProperties(m,o),!m)continue;const u=m.tasks,h=m.id;m.$.project=o,m.$.id=o?o.$.id+"."+d:d+"","string"!=typeof h&&"number"!=typeof h||(a[h]?n.push(h):a[h]=1),u instanceof Array&&u.length>0&&(m.synchronized&&(m.dateStart=m.minDateStart=m.maxDateStart=void 0,m.dateEnd=m.minDateEnd=m.maxDateEnd=void 0),m.type="project",c=e(u,m),c.length&&(m.hidden=!c.some((e=>!e.hidden)),m.hidden?c.forEach((e=>e.hidden=m.hidden)):i._synchronizeProjectVisibility(o,m))),(!m.type||["project","task","milestone"].indexOf(m.type)<0)&&(m.type="task"),o&&"project"===m.type&&c&&c.length>0?(l.push(m),l=l.concat(c)):(o||((t&&"project"===m.type&&m.synchronized||m.dateStart&&m.dateEnd&&!isNaN(m.dateStart.getTime())&&!isNaN(m.dateEnd.getTime()))&&s.push(m),c&&(s=s.concat(c))),l.push(m))}return o&&i._synchronizeProjectDates(o,l),l}(e),t)return s.slice(0);n.length&&console.warn(i.localize("duplicateIds",{elementType:i.nodeName.toLowerCase(),duplicates:n.toString()})),i._tasks=s.slice(0),i._handleResources()}_createTimeline(){const e=this;e._tasks&&0!==e._tasks.length?(delete e.__tasks,e._createConnections(),e._autoSchedule(),e._createTimelineCells(),e._insertTimelineTasks(),e.$.taskSplitter.refresh()):e._clearTasks()}_createConnections(){const e=this,t=e._tasks;e._connections=[];for(let i=0,a=t.length;i<a;i+=1)t[i].connections&&e._handleTaskConnections(i)}_createTooltip(){const e=this,t=e.tooltip;let i=e.$.tooltip;if(t.enabled)return i||(e.$.tooltip=i=document.createElement("jqx-tooltip"),i.classList.add("jqx-gantt-chart-tooltip"),i.setAttribute("jqx-id","tooltip")),e.$tooltip||e._handleTooltipEvents(!0),i.rightToLeft=e.rightToLeft,i.theme=e.theme,i.openMode="manual",i.arrow=t.arrow,i.delay=t.delay,i.parentElement||e.$.container.appendChild(i),i;i&&(i.close(),i.remove())}_handleTooltipEvents(e){const t=this,i=t.$.tooltip;if(!i)return;let a=t.$tooltip;e?(a=t.$tooltip=JQX.Utilities.Extend(i),a.listen("close",t._tooltipVisibilityHandler.bind(t)),a.listen("closing",t._tooltipVisibilityHandler.bind(t)),a.listen("open",t._tooltipVisibilityHandler.bind(t)),a.listen("opening",t._tooltipVisibilityHandler.bind(t))):a&&(a.unlisten("close"),a.unlisten("closing"),a.unlisten("open"),a.unlisten("opening"),delete t.$tooltip)}_toggleTooltip(e){const t=this;if(t._dragDetails||!t.tooltip.enabled||!t.$.container.contains(e.target))return void t._closeTooltip();const i=t.getRootNode(),a={"jqx-task-segment":null,"jqx-timeline-task":null,"jqx-gantt-chart-task-indicator":null,"jqx-resource-timeline-view-cell":null,"jqx-task-connection":null},n=(i.host?i.host.shadowRoot:i).elementsFromPoint(e.clientX,e.clientY);let s;for(let e=0,t=n.length;e<t;e+=1){const t=n[e],i=t.classList;if(i.contains("jqx-task-container"))a["jqx-timeline-task"]=t.closest(".jqx-timeline-task");else for(let e in a)i.contains(e)&&(a[e]=t)}if(a["jqx-task-segment"]){const e=a["jqx-timeline-task"],t=e?e._cellObj.task:void 0;s=t&&t.segments&&t.segments.length?a["jqx-task-segment"]:e}else if(a["jqx-gantt-chart-task-indicator"])s=a["jqx-gantt-chart-task-indicator"];else for(let e in a)if(a[e]){s=a[e];break}s?t._openTooltip(s,e):t._closeTooltip()}_getConnectionTypeName(e){const t=this;switch(e){case 0:return t.localize("startToStart");case 1:return t.localize("endToStart");case 2:return t.localize("endToEnd");case 3:return t.localize("startToEnd");default:return""}}_getSegmentTask(e){const t=this._tasks;for(let i=0,a=t.length;i<a;i+=1){const a=t[i];if(Array.isArray(a.segments)&&a.segments.indexOf(e)>-1)return a}}_getTooltipContent(e){const t=this;if(!e)return;const i=e.classList;let a,n;if(i.contains("jqx-task-segment")){if(n=e._segmentObj,n){let e=n.label;if(void 0===e){const i=t._getSegmentTask(n);i&&(e=i.label)}a=`<label><b>${t.localize("segment")}</b>: ${e||""}</label>\n <label><b>${t.localize("dateStart")}</b>: ${t._formatDate(n.dateStart)||""}</label>\n <label><b>${t.localize("dateEnd")}</b>: ${t._formatDate(n.dateEnd)||""}</label>`}}else if(i.contains("jqx-timeline-task"))n=e._cellObj.task,n&&!n.segments&&(a=`<label><b>${t.localize("task")}</b>: ${n.label||""}</label>\n <label><b>${t.localize("dateStart")}</b>: ${t._formatDate(n.dateStart)||""}</label>\n <label><b>${t.localize("dateEnd")}</b>: ${t._formatDate(n.dateEnd)||""}</label>`);else if(i.contains("jqx-gantt-chart-task-indicator"))n=e._indicatorObj,n&&(a=n.label||"");else if(i.contains("jqx-resource-timeline-view-cell")){if(!e.hasAttribute("load"))return;const i=e.closest(".jqx-timeline-cell");if((e=e.closest(".jqx-timeline-row"))&&e._cellObj&&(n=e._cellObj.resource),n){const s=t._getResourceTasks(n),r="hours"===t.resourceTimelineView?"h":"",o=t._tasks,l=t.$.resourceTimelineViewCells.children,d=Array.from(e.children).findIndex((e=>e===i));a=`<label><b>${t.localize("resource")}</b>: ${n.label||""}</label>\n <label><b>${t.localize("assignments")}</b>:</label>`;for(let e=0,i=s.length;e<i;e+=1){const i=s[e],c=o.indexOf(i),m=t._getResourceCellCapacity({cellDateRange:t._getCellDateRange(l[d]),cellTaskIndexAssigned:[c],index:d,resource:n,task:i,cellIndex:d});void 0!==m&&(a+=`<label>${t.localize("task")} #${c}: (${parseFloat(m.capacity.toFixed(1))}${r}) ${i.label||""}</label>`)}}}else i.contains("jqx-task-connection")&&(n=t.getConnectionDetails(e.getAttribute("connection-id")),void 0!==n&&(a=`<label><b>${t.localize("startTask")}</b>: ${n.startTask.label||""}</label>\n <label><b>${t.localize("endTask")}</b>: ${n.endTask.label||""}</label>\n <label><b>${t.localize("type")}</b>: ${t._getConnectionTypeName(n.type)||""}</label>`,n.lag&&(a+=`<label><b>${t.localize("lag")}</b>: ${parseFloat(n.lag.toFixed(1))}</label>`)));return n?n.tooltip?n.tooltip+"":a||"":void 0}_openTooltip(e,t,i){const a=this,n=a.tooltip;if(i="string"==typeof i?i:a._getTooltipContent(e),!(n.enabled&&i&&e&&e.nodeName))return void a._closeTooltip();const s=a.$.tooltip||a._createTooltip();let r,o;if(i&&s.value!==i&&(s.value=i),s.selector=e,t&&t.pageX){const i=document.body.getBoundingClientRect(),a=e.getBoundingClientRect(),l=n,d=l.offset[0]||0,c=l.offset[1]||0,m=s.offsetWidth,u=s.offsetHeight;let h="bottom";"absolute"!==s.position&&(s.position="absolute",s.offset=[]),o=Math.min(i.left+i.width-m,t.pageX-m/2-d),r=a.top-u-c,r<i.top&&(r=a.bottom+c,h="top"),o<i.left&&(o=i.left+d,h="left"),h!==s.arrowDirection&&(s.arrowDirection=h),s.style.left=o+"px",s.style.top=r+"px"}else"auto"!==s.position&&(s.position="auto",s.offset=n.offset);s.visible||(a.getShadowRootOrBody().appendChild(s),s.open())}_closeTooltip(){const e=this.$.tooltip;e&&e.visible&&e.close()}_tooltipVisibilityHandler(e){const t=this,i=e.type,a=t.$.tooltip;e.target===a&&(e.stopPropagation(),t._fireTooltipVisibilityEvent(e)?e.preventDefault():"opening"===i?a.classList.remove("jqx-visibility-hidden"):"closing"===i&&(a.hasAnimation?a.addEventListener("transitionend",(()=>{a.visible||(a.classList.add("jqx-visibility-hidden"),a.style.top=a.style.left=0,t.$.container.appendChild(a))}),{once:!0}):t.$.container.appendChild(a)))}_fireTooltipVisibilityEvent(e){const t=this,i=e.type,a=t.$.tooltip,n=e.detail.owner;let s={target:a,owner:n};if(n)if(n.classList.contains("jqx-task-connection")){s.type="connection";const e=t.getConnectionDetails(n.getAttribute("connection-id"));e&&(s.item=e)}else if(n.classList.contains("jqx-gantt-chart-task-indicator"))s.type="indicator",n._indicatorObj&&(s.item=t._cloneObject(n._indicatorObj));else if(n.classList.contains("jqx-task-segment"))s.type="segment",n._segmentObj&&(s.item=t._cloneObject(n._segmentObj));else if(n.classList.contains("jqx-timeline-task"))s.type="task",n._cellObj&&n._cellObj.task&&(s.item=t._cloneObject(n._cellObj.task));else if(n.classList.contains("jqx-resource-timeline-view-cell")){s.type="resource";const e=n.closest(".jqx-timeline-row");e._cellObj&&(s.item=t._cloneObject(e._cellObj.resource))}let r=t.getAttribute("aria-owns")||"";switch(i){case"open":t.setAttribute("aria-owns",(r+" "+a.id).trim()),t.$.fireEvent(i,s);break;case"close":r=r.replace(a.id,"").trim(),r?t.setAttribute("aria-owns",r):t.removeAttribute("aria-owns"),t.$.fireEvent(i,s);break;case"closing":case"opening":if(t.$.fireEvent(i,s).defaultPrevented)return!0}}_parseAdapterData(e){let t={};for(let i=0,a=e.length;i<a;i+=1){const a=e[i],n=Object.assign({},a),s=a.parent,r=a.$.id;if(s&&s!==a){const e=s.$.id;t[e]||(t[e]=Object.assign({},s));const i=t[e];i.tasks||(i.tasks=[]),i.tasks.push(n)}else t[r]=n;delete n.parent,delete n.children,delete n.$}return Object.values(t)}_handleTaskConnections(e){const t=this,i=t._tasks;let a;if("number"==typeof e&&(a=e,e=i[e]),!e)return;void 0===a&&(a=i.indexOf(e));const n=e.connections,s=i.length;for(let e=0;e<n.length;e++){const i=n[e],r=t._getTaskIndexById(i.target);null==r||isNaN(r)||r<0||r>=s||r===a||t._connectTask([a,r,i.type,i.lag])}delete e.connections}_insertTasks(e,t,i){const a=this,n=a._tasks;if(t){const s=a._getProjectTasks(t,!0);if(s.length){const t=s[s.length-1];let r,o;"number"==typeof i&&i<s.length?r=s[i=Math.max(0,i)]:(r=t,o=!0);const l=a._getProjectTasks(r);i=o&&l.length?n.indexOf(l[l.length-1]):n.indexOf(r),n.splice.apply(n,[i+(o?1:0),0].concat(e))}else n.splice.apply(n,[n.indexOf(t)+1,0].concat(e))}else"number"==typeof i?(i+="",(i=n.findIndex((e=>e.$.id===i)))<0&&(i=n.length)):i=n.length,n.splice.apply(n,[i,0].concat(e))}_insertTimelineTasks(){const e=this,t=e._timelineVCells;t&&t.length?(e._recycleTimelineTasks(),e._refresh()):e._resetTimeline()}_recycleTimelineTasks(e){const t=this,i=t.$.taskIndicatorsContainer,a=i.children,n=t.$.taskTimelineCellsContainer.childElementCount,s=t._timelineVCells;for(;i.childElementCount>n;)i.firstElementChild.remove();if(t._closeTooltip(),!s||!s.length)return;const r=s.indexOf(t._getFirstContentCellInView()),o=t._getSelection("task",t.selectedTaskIds),l={timelineStart:t.dateStart.getTime(),timelineEnd:t.dateEnd.getTime()};for(let i=0,d=n;i<d;i++){const n=a[i],d=s[r+i];if(!d){n&&n.remove();continue}const c=d.task;t._snapToNearestDates(c),t._recycleTaskBars(d,i,o),t._setTimelineTaskBar(d,i),t._setTimelineTaskBaseline(d,i),t._setTaskBarProgress(c,i),t._setTaskBarLabel(c,i),t._setTaskIndicators(d,i,l),t._setTaskDeadline(d,i,l),e&&t._refreshTableColumnsData(c)}t._recycleConnections()}_ensureVisible(e,t="task"){const i=this;if(null==e)return;let a,n="task"===t?i._timelineVCells:i._timelineResourceVCells;a||(a=i.$[`${t}Table`]);const s=n.find((i=>i[t]===e));if(!s)return;let r,o;if("task"===t){const t=i._getTimelineTaskCellByDate(e.dateStart);if(r=i.$.taskTimelineContainer.offsetHeight,o=i,t){const e=i.scrollLeft,a=i.$.taskTimelineContainer.offsetWidth;t.left+t.width>e+a?i.scrollLeft=Math.max(0,t.left+t.width-a):t.left<e&&(i.scrollLeft=Math.max(0,t.left))}}else r=i.$.resourceTimelineContent.offsetHeight,o=i._resourceScrollView;const l=o.scrollTop;s.top+s.height>l+r?o.scrollTop=Math.max(0,s.top+s.height-r):s.top<l&&(o.scrollTop=Math.max(0,s.top))}_isTaskExpanded(e,t){if(!e||!e.$)return;let i,a=e.$[this.groupByResources?"group":"project"];if(!a)return!0;for(;a;){if(i=a.expanded,!i)return!1;if(a=a.$.project,a===t)break}return i}_getItemByTreeIndex(e,t,i){if(!t)return;const a=t.split(".");let n=this[`_${e}s`].filter((e=>!e.$.project))[t.split(".")[0]];if(n){if(!n[`${e}s`]||!n[`${e}s`].length)return i?null:n;for(let t=1;t<a.length;t++){const s=n[`${e}s`].filter((e=>!e.hidden&&e.$.project===n))[a[t]];if(!s||i&&"project"!==s.type)break;if(n=s,"project"!==n.type)break}return i?n&&"project"===n.type?n:void 0:n}}_getItemByTableId(e,t,i){if(null==t)return;const a=this[`_${e}s`];let n;for(let e=0,i=a.length;e<i;e+=1){const i=a[e];if(i.$.id===t){n=i;break}}return n?i?"project"===n.type?n:void 0:n:void 0}_tableChangeHandler(e){const t=e.target;(t.classList.contains("jqx-task-table")||t.classList.contains("jqx-resource-table"))&&(e.stopPropagation(),this._handleTableSelection(t===this.$.taskTable?"task":"resource",t.selected))}_tableColumnResizeHandler(e){const t=e.target,i=e.detail,a=t.classList.contains("jqx-task-table");if(!a&&!t.classList.contains("jqx-resource-table"))return;e.stopPropagation();const n=i.dataField,s=this[(a?"task":"resource")+"Columns"].find((e=>e.value===n));s&&(s.size=i.width),this.$.fireEvent("columnResize",i)}_tableSortFilterHandler(e){const t=this,i=e.target;let a;i.classList.contains("jqx-task-table")?(a="task",t._createTimelineContent(),t._recycleTimelineTasks()):i.classList.contains("jqx-resource-table")&&(a="resource",t._createResourceTimelineContent(),t._recycleResourceContent()),a&&(t._refresh(),e.stopPropagation(),t.$.fireEvent(e.type,Object.assign({type:a},e.detail)))}_taskTableExpandHandler(e){const t=this,i=e.target;if(!i.classList.contains("jqx-task-table")&&!i.classList.contains("jqx-resource-table"))return;const a=i===t.$.taskTable?"task":"resource";if(e.stopPropagation(),!t[`${a}s`]||!t[`${a}s`].length)return;const n=e.detail.record.itemId,s=t._getItemByTableId(a,n,!0);s&&(delete t._hoveredItem,s.expanded="collapse"!==e.type,t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks(),t.$.fireEvent(e.type,{item:t._cloneObject(s),id:s.id||s.$.id,index:t._tasks.indexOf(s),label:s.label,value:s.value}))}_taskTableKeyDownHandler(e){const t=this,i=e.key;if(t.keyboardNavigation&&!t.disabled&&!t.readonly)switch(i){case"Delete":case"Enter":{const e=t.$.taskTable._focusedCell;if(!e||!e.closest)return;const a=e.closest("tbody tr");if(!a)return;const n=t._getVCellById("task",a.getAttribute("row-id"));n&&t._openPopupWindow(n.task,"Delete"===i);break}}}_getVCellById(e="task",t){const i="task"===e?this._timelineVCells:this._timelineResourceVCells;if(i&&i.length)for(let a=0,n=i.length;a<n;a+=1){const n=i[a][e];if(n.$&&n.$.id===t)return i[a]}}_getGroupVCellByPath(e,t){const i="task"===e?this._timelineVCells:this._timelineResourceVCells;if(i&&i.length)for(let a=0,n=i.length;a<n;a+=1){const n=i[a][e];if(n.$&&n.$.id===t)return i[a]}}_taskTableGroupEventHandler(e){const t=this,i=e.detail.action,a=e.target;if(["collapse","expand"].indexOf(i)<0||!a.classList.contains("jqx-task-table")&&!a.classList.contains("jqx-resource-table"))return;const n=a===t.$.taskTable?"task":"resource",s=t.$.taskTable._getGroupByIndex(e.detail.path),r=t._getGroupVCellByPath(n,s.$.id);if(!r||!r[n].isGroup)return;const o=r[n];e.stopPropagation(),o.expanded="collapse"!==i,t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks(),t.$.fireEvent(i,{isGroup:!0,item:t._cloneObject(o),id:o.$.id,label:o.label})}_resetTimeline(){const e=this,t=e.$.taskTimelineContainer;if(e.$.taskTimelineCellsContainer.innerHTML="",e.$.timelineTasksContainer.innerHTML="",e.$.timelineConnectionsContainer.innerHTML="",e.$.timelineContent.style.height="",e.$.taskIndicatorsContainer.innerHTML="",e.rightToLeft&&e.scrollLeft!==t.scrollLeft){const i=e._getScrollLeft(e.scrollLeft);t.scrollLeft=i,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollLeft=i)}e._closeTooltip(),e.$.container.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height")}_refreshTimeline(e){const t=this;e||(e=t.view);const i=t._getDateFromCell(t.scrollLeft,t._getFirstCellObjInView(),e),a=t.scrollTop;t._refreshing=!0,t.scrollLeft=0,t.scrollTop=0,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&t._resourceScrollView&&(t._resourceScrollView.scrollLeft=0),t._resetTimeline(),t._createTimelineCells(),t._recycleTimelineTasks(!0),t.$.mainSplitter.contains(t.$.resourceSplitter)&&t._refreshResourceTimeline(),t._refresh(),t._refreshing=!1,t._scrollTo(i),t.scrollTop=a}_scrollTo(e,t){const i=this,a=i._timelineCells;let n;if(void 0!==e&&!isNaN(new Date(e).getTime()))for(let s=0;s<a.length;s++){const r=a[s],o=r.date;switch(i.view){case"quarter":case"year":if(o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()){if(t){n=r.left;break}let i=new Date(e);i.setMonth(e.getMonth()+1),i.setDate(0),i=i.getDate(),n=r.left+(e.getDate()-1)/i*r.width}break;case"month":{let i=new Date(o),a=new Date(o);i.setDate(i.getDate()-i.getDay()),a.setDate(a.getDate()+(6-a.getDay())+1),a.setMilliseconds(a.getMilliseconds()-1),e.getTime()>=i.getTime()&&e.getTime()<=a.getTime()&&(n=r.left+(t||t?0:e.getDay()/7*r.width));break}case"week":o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()&&o.getDate()===e.getDate()&&(n=r.left+parseFloat(e.getHours()+"."+e.getMinutes()+e.getSeconds())/24*r.width);break;case"day":o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()&&o.getDate()===e.getDate()&&o.getHours()===e.getHours()&&(n=r.left+(t?0:parseFloat(e.getMinutes()+e.getSeconds())/60*r.width))}if(void 0!==n)return i.scrollLeft=n,void(i.$.mainSplitter.contains(i.$.resourceTimelineHeader)&&(i.$.resourceTimelineHeader.scrollLeft=i.$.resourceTimelineContent.scrollLeft=n,i._refreshResourceTimeline()))}}_updateConnection(e,t){const i=this,a=i._tasks,[n,s,r,o]=e,l=a[n],d=a[s];if(!l||!d||"number"!=typeof r)return;let c=i._connections,m=-1;c||(c=i._connections=[]);for(let e=0,t=c.length;e<t;e+=1){const t=c[e],i=t.startIndex,a=t.endIndex;if(i===n&&a===s||i===s&&a===n){m=e;break}}if(!t){if(m<0)c.push({startTask:a[n],endTask:a[s],startIndex:n,endIndex:s,type:r,lag:o});else{const e=c[m];if(!e)return;if(e.startIndex=n,e.startTask=a[n],e.endIndex=s,e.endTask=a[s],e.type=r,o!==e.lag){const t=parseInt(o);isNaN(t)||(e.lag=t)}}return!0}m>-1&&c.splice(m,1)}_createTimelineCells(){const e=this,t=e._tasks,i=new Date(e.properties.dateStart.value),a=new Date(e.properties.dateEnd.value);let n,s;if(isNaN(i.getTime())||(n=i),isNaN(a.getTime())||(s=a),t.length>0){let e=t[0].dateStart,i=t[0].dateEnd;for(let a=0;a<t.length;a++)t[a].dateStart&&t[a].dateEnd&&(e||(e=t[a].dateStart),i||(i=t[a].dateEnd),e.getTime()>t[a].dateStart.getTime()&&(e=t[a].dateStart),i.getTime()<t[a].dateEnd.getTime()&&(i=t[a].dateEnd));(!n||n.getTime()>e.getTime())&&(n=e),(!s||s.getTime()<i.getTime())&&(s=i)}n&&s&&(n=e._minMaxDateValidator(n),s=e._minMaxDateValidator(s),e._createTimelineHeader(n,e._getCellsCount(n,s)),e._createTimelineContent(),e._createDateMarkers(),e._refresh())}_getCellsCount(e,t,i){let a,n,s,r,o,l,d=new Date(e),c=new Date(t);const m=this,u=t.getFullYear()-e.getFullYear();if(n=a=Math.round(u)+1,"year"===i)return{year:n};if(d.setHours(d.getHours(),0,0,0),c.setHours(c.getHours(),0,0,0),l=Math.floor((t.getTime()-e.getTime())/36e5),l>0){let e=new Date(d);if(l=1,d.getFullYear()!==c.getFullYear()){let t=new Date(d.getFullYear()+1,0,1,0,0,0,0);for(;e.getTime()!==t.getTime();){const t=e.getTime();e.setHours(e.getHours()+1),e.getTime()===t&&e.setHours(e.getHours()+2),l++}const i=c.getFullYear()-t.getFullYear();for(let t=0;t<i;t++){const t=e.getFullYear();l+=24*((t%100==0?t%400==0:t%4==0)?366:365)-1,e.setFullYear(t+1)}}for(;e.getTime()<c.getTime();){const t=e.getTime();e.setHours(e.getHours()+1),e.getTime()===t&&e.setHours(e.getHours()+2),l++}}if("hour"===i)return{hour:l};if(d.setHours(0,0,0,0),c.setHours(23,59,59,999),o=a=Math.round((c.getTime()-d.getTime())/864e5),"day"===i)return{day:o};if(d.setDate(d.getDate()-d.getDay()),c.setDate(c.getDate()+6-c.getDay()),r=a=Math.round((c.getTime()-d.getTime())/6048e5),"week"===i){if(-1!==m.firstDayOfWeek){const t=e.getDay()-m.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+m.firstDayOfWeek-(t>=0?0:7))}return{week:r}}if("month"===this.view&&(0!==e.getDay()&&(e=new Date(e.setDate(e.getDate()-e.getDay()))),6!==t.getDay()&&(t=new Date(t.setDate(t.getDate()+6-t.getDay()))),-1!==m.firstDayOfWeek)){const t=e.getDay()-m.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+m.firstDayOfWeek-(t>=0?0:7))}if(e.getFullYear()!==t.getFullYear()){a=12-e.getMonth();const i=t.getFullYear();for(let n=e.getFullYear()+1;n<=i;n++)a+=n===t.getFullYear()?t.getMonth()+1:12}else a=t.getMonth()-e.getMonth()+1;return s=Math.ceil(a),"months"===i?{month:s}:("day"===this.view&&0===l&&(l=1),{year:n,month:s,week:r,day:o,hour:l})}_recycleTaskBars(e,t,i){const a=this,n=e.task,s=a.$.timelineTasksContainer,r=a.$.taskTimelineCellsContainer,o="project"===n.type&&n.synchronized,l=n.type,d=n.$.id,c=s.children[t],m=r.children[t];m._cellObj=e,m.setAttribute("row-id",d),m.style.top=e.top+"px",m.removeAttribute("hover"),c.removeAttribute("hover"),c.classList.contains(l)||(c.innerHTML="milestone"===l?'<div class="jqx-task-container" aria-hidden="true">\n <div class="jqx-task-connection-point start"></div>\n <div class="jqx-task-segments"></div>\n <div class="jqx-task-connection-point end"></div>\n </div>':'<div class="jqx-task-container" aria-hidden="true">\n <div class="jqx-task-connection-point start"></div>\n <div class="jqx-task-segments"></div>\n <div class="jqx-timeline-task-progress-thumb"></div>\n <div class="jqx-task-connection-point end"></div>\n </div>'),n.connectionType&&(n.connectionType.includes("start")||c.querySelector(".start").classList.add("jqx-hidden"),n.connectionType.includes("end")||c.querySelector(".end").classList.add("jqx-hidden")),a._recycleSegments(n,c),delete c._cellStart,delete c._cellEnd,n.disableDrag||o&&!n.dragProject?c.setAttribute("disable-drag",""):c.removeAttribute("disable-drag"),n.disableResize||o?c.setAttribute("disable-resize",""):c.removeAttribute("disable-resize"),n.isGroup?c.setAttribute("resource-group",""):c.removeAttribute("resource-group"),i&&(i.indexOf(d)>-1?(c.setAttribute("selected",""),m.setAttribute("selected","")):(c.removeAttribute("selected"),m.removeAttribute("selected"))),n.id?c.id=n.id:c.id="ganttTask"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),c._cellObj=e,c.className="jqx-timeline-task "+l,c.setAttribute("row-id",d),n.class&&c.classList.add(n.class),c.setAttribute("aria-label",n.label+" Start date: "+a._toISODate(n.dateStart)+", End date: "+a._toISODate(n.dateEnd)),c.setAttribute("aria-selected","false")}_toISODate(e){const t=e.getFullYear(),i=e.getMonth()+1,a=e.getDate();return t+"-"+(i<10?"0"+i:i)+"-"+(a<10?"0"+a:a)}_recycleSegments(e,t){const i=this,a=t.querySelector(".jqx-task-segments");let n,s=e.segments;if(!a)return;for(Array.isArray(s)&&s&&s.length&&"task"===e.type||(s=[e]);a.childElementCount>s.length;)a.children[0].remove();const r=document.createDocumentFragment(),o=a.children,l="milestone"===e.type?'<div class="jqx-timeline-task-fill"></div>':'<div class="jqx-timeline-task-fill">\n <div class="jqx-timeline-task-progress"></div>\n </div>\n <div class="jqx-timeline-task-label"></div>';for(let t=0,a=s.length;t<a;t+=1){const a=s[t];let d=o[t];a.dateStart=new Date(Math.max(e.dateStart.getTime(),a.dateStart.getTime())),a.dateEnd=new Date(Math.min(e.dateEnd.getTime(),a.dateEnd.getTime())),d?(delete d._cellStart,delete d._cellEnd):(d=document.createElement("div"),d.classList.add("jqx-task-segment"),d.innerHTML=l,r.appendChild(d)),a.disableDrag?d.setAttribute("disable-drag",""):d.removeAttribute("disable-drag"),a.disableResize?d.setAttribute("disable-resize",""):d.removeAttribute("disable-resize"),d._segmentObj=a,d.setAttribute("aria-label",(a.label||"")+" Start date: "+i._toISODate(a.dateStart)+", End date: "+i._toISODate(a.dateEnd)),n=d}r.childElementCount&&a.appendChild(r),i._setTaskBarDeadline(e,n)}_createCells(e){let t,i=document.createDocumentFragment();for(let a=0;a<e;a++)t=document.createElement("div"),t.classList.add("jqx-timeline-view-cell"),t.setAttribute("role","columnheader"),i.appendChild(t);return i}_getTimelineVisibleCellsCount(){const e=this,t=e._timelineCells;if(!t)return;const i=e._getFirstCellObjInView();if(!i)return t.length;const a=1-(i.left+i.width-e.scrollLeft)/t[0].width;return Math.min(t.length,Math.ceil(parseFloat((e.$.timeline.offsetWidth/i.width).toFixed(2))+a))}_getHeaderVisibleCellsCount(){const e=this;if(!e._timelineHeaderCells)return;const t=Math.abs(e.scrollLeft),i=e.$.timeline.offsetWidth,a=e._timelineHeaderCells;let n=0;for(let e=0;e<a.length;e++){const s=a[e];s.left+s.width>t&&s.left<i+t&&n++}return n}_getHeaderSubVisibleCellsCount(){const e=this;if(!e._timelineHeaderSubCells)return;const t=Math.abs(e.scrollLeft),i=e.$.timeline.offsetWidth,a=e._timelineHeaderSubCells;let n=0;for(let e=0;e<a.length;e++){const s=a[e];s.left+s.width>t&&s.left<i+t&&n++}return n}_refreshHeaderDate(e){const t=this,i=t._getCellsViewType(),a=t.$.timelineHeader.scrollLeft,n=t.$.timelineViewCells.children,s=t._timelineCells;let r;t._refreshHeaderSubDetailsDate(e),t._refreshHeaderDetailsDate(e);for(let e=0;e<s.length;e++){const t=s[e];if(a<=t.left+t.width){r=e;break}}for(let a=0;a<n.length;a++){const o=n[a],l=s[r];if(!l)break;r++;const d=l.date;o.innerHTML=`<div>${t._getDateString(new Date(d),i)}</div>`,e||(o._date=new Date(d),o.setAttribute("date",d.toLocaleDateString()),o.style.width=l.width+"px",o.style[t.rightToLeft?"right":"left"]=l.left+"px",l.weekend?o.setAttribute("weekend",""):o.removeAttribute("weekend"),l.nonworking?o.setAttribute("nonworking",""):o.removeAttribute("nonworking"))}}_getDateString(e,t,i){const a=this,n=["2-digit","numeric"][a.dayFormat]||"numeric";let s;if("year"===t||"quarter"===t)s=e.toLocaleDateString(a.locale,{year:a.yearFormat});else if("month"===t)s=e.toLocaleDateString(a.locale,{month:a.monthFormat}),"month"===a.view&&(s+=" "+e.toLocaleDateString(a.locale,{year:a.yearFormat}));else if("week"===t)s="numeric"!==a.weekFormat&&i?e.toLocaleDateString(a.locale,{day:n,month:a.monthFormat,year:a.yearFormat}):a._getWeekNumber(e);else if("day"===t)s="month"===a.view?"numeric"!==a.dayFormat&&"2-digit"!==a.dayFormat?e.toLocaleDateString(a.locale,{day:"numeric"})+" "+e.toLocaleDateString(a.locale,{weekday:a.dayFormat}):e.toLocaleDateString(a.locale,{day:"numeric"})+" "+e.toLocaleDateString(a.locale,{weekday:"short"}):e.toLocaleDateString(a.locale,"day"===a.view?{day:n,month:a.monthFormat,year:a.yearFormat}:["long","short","narrow"].indexOf(a.dayFormat)>-1?{weekday:a.dayFormat}:{day:a.dayFormat});else if("hour"===t)if(s="default"===a.hourFormat?e.toLocaleTimeString(a.locale,{hour12:!1}):e.toLocaleDateString(a.locale,{hour:a.hourFormat}),"default"!==a.hourFormat)s.indexOf(",")>=0&&(s=s.substring(s.indexOf(",")+1).trim());else if(s.indexOf(":")!==s.lastIndexOf(":")&&s.indexOf(":")>=0){let e=s.toLowerCase().indexOf("am")>=0?" AM":"";e=s.toLowerCase().indexOf("pm")>=0?" PM":e,s=s.substring(0,s.lastIndexOf(":"))+e}return a.timelineHeaderFormatFunction?a.timelineHeaderFormatFunction(new Date(e),t,i,s):s}_refreshHeaderSubDetailsDate(e){const t=this,i=(t.view,t.scrollLeft),a=t.$.timelineViewSubDetails.children,n=t._timelineHeaderSubCells;let s;if(t.$.timelineViewSubDetails.classList.contains("jqx-hidden"))return;for(let e=0;e<n.length;e++){const t=n[e];if(i<=t.left+t.width){s=e;break}}let r=[],o=0;for(let i=0;i<a.length;i++){const l=n[s],d=a[i];if(!l)continue;let c=new Date(l.date);"week"===t.view&&c.setDate(c.getDate()-c.getDay()),s++,c=new Date(Math.max(l.date.getTime(),c.getTime()));const m=e=>{var i,a=e.getMonth();return i=a>=9?4:a>=6?3:a>=3?2:1,"long"===t.quarterFormat?t.localize("quarter")+" "+i:"numeric"===t.quarterFormat?i:t.localize("quarterShort")+i};let u="";"quarter"===t.view||"year"===t.view?(u=m(c),"quarter"===t.view&&t.hideTimelineSecondHeaderDetails&&(u+=" "+c.getFullYear())):"month"===t.view&&(-1===t.firstDayOfWeek?u=t._getWeekNumber(c):((c.getDay()-t.firstDayOfWeek)%7==0&&i>0&&o++,u=o));const h=u+"_"+c.getFullYear();r[h]||(r[h]=[]),d.classList.remove("jqx-visibility-hidden"),r[h].push({element:d,cell:l}),d.innerHTML=`<div>${u}</div>`,d.classList.add("middle"),e||(d._date=c,d.style[t.rightToLeft?"right":"left"]=l.left+"px",d.style.width=l.width+"px")}for(let e in r){const i=r[e];let a=0;for(let e=0;e<i.length;e++)a+=i[e].cell.width;if(i[0].element.style.width=a+"px","year"===t.view){const e=i[0].cell.date.toLocaleDateString(t.locale,{month:t.monthFormat}),a=i[i.length-1].cell.date.toLocaleDateString(t.locale,{month:t.monthFormat});i.length>1?i[0].element.innerHTML=`<div>${e}-${a}</div>`:i[0].element.innerHTML=`<div>${e}</div>`}else if("month"===t.view){const e="numeric"!==t.dayFormat&&"2-digit"!==t.dayFormat?t.dayFormat:"short",a=i[0].cell.date.toLocaleDateString(t.locale,{day:"numeric"})+" "+i[0].cell.date.toLocaleDateString(t.locale,{weekday:e}),n=i[i.length-1].cell.date.toLocaleDateString(t.locale,{day:"numeric"})+" "+i[i.length-1].cell.date.toLocaleDateString(t.locale,{weekday:e});i.length>1?i[0].element.innerHTML=`<div>${a}-${n}</div>`:i[0].element.innerHTML=`<div>${a}</div>`,"numeric"===t.weekFormat&&(i[0].element.innerHTML=t._getWeekNumber(i[0].cell.date))}if(t.timelineHeaderFormatFunction){const e=t.timelineHeaderFormatFunction(new Date(i[0].cell.date),t.view,!0,i[0].element.innerHTML);i[0].element.innerHTML!==e&&(i[0].element.innerHTML=e)}for(let e=1;e<i.length;e++)i[e].element.classList.add("jqx-visibility-hidden")}}_refreshHeaderDetailsDate(e){const t=this,i=t.view,a=t.scrollLeft,n=t.$.timelineViewDetails.children,s=t._timelineHeaderCells;let r;for(let e=0;e<s.length;e++){const t=s[e];if(a<=t.left+t.width){r=e;break}}for(let a=0;a<n.length;a++){const o=s[r],l=n[a];let d=new Date(o.date);if("week"===t.view)if(-1!==t.firstDayOfWeek){const e=d.getDay()-t.firstDayOfWeek;d.setDate(d.getDate()-d.getDay()+t.firstDayOfWeek-(e>=0?0:7))}else d.setDate(d.getDate()-d.getDay());r++,d=new Date(Math.max(o.date.getTime(),d.getTime())),l.innerHTML=`<div>${t._getDateString(d,i,!0)}</div>`,e||(l._date=d,l.style[t.rightToLeft?"right":"left"]=o.left+"px",l.style.width=o.width+"px")}}_getWeekNumber(e){let t,i=new Date(e.getFullYear(),0,1),a=Math.round((e.getTime()-i.getTime()-6e4*(e.getTimezoneOffset()-i.getTimezoneOffset()))/864e5)+1,n=i.getDay();if(n=n>=0?n:n+7,n<4)t=Math.floor((a+n-1)/7)+1,t>52&&(i=new Date(e.getFullYear()+1,0,1),n=i.getDay(),n=n>=0?n:n+7,t=n<4?1:53);else if("week"===this.view){const i=function(e){var t=new Date(e.valueOf()),i=(e.getDay()+6)%7;t.setDate(t.getDate()-i+3);var a=t.valueOf();return t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7),1+Math.ceil((a-t)/6048e5)};t=i(e)}else t=Math.round((a+n-1)/7);return t}_convertDuration(e,t){if(!e)return 0;let i;switch(this.durationUnit){case"day":i=864e5;break;case"hour":i=36e5;break;case"minute":i=6e4;break;case"second":i=1e3;break;case"milisecond":return e;case"week":i=6048e5}return Math.max(0,t?e/i:e*i)}_createTimelineHeader(e,t){const i=this,a=i._getCellsViewType();if(!e){const t=i.$.timelineViewCells.children;if(0===t.length)return;e=t[0]._date}if("day"!==i.view&&e.setHours(0,0,0,0),-1!==i.firstDayOfWeek){const t=e.getDay()-i.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+i.firstDayOfWeek-(t>=0?0:7))}if(i.$.timelineContent.offsetWidth===i.$.timeline.offsetWidth&&i._timelineCells&&i._timelineCells[0]&&i._timelineCells[0].date.getTime()===e.getTime()&&i._timelineCells.length===t[i._getCellsViewType()])return void i._refresh();i.$.timelineContent.style.width=i.$.timelineHeaderContent.style.width="",i._createTimelineCellsObj(e,t),i._createTimelineHeaderCellsObj(e,t),i._createTimelineHeaderSubCellsObj(e,t),i.$.timelineViewDetails.innerHTML="",i.$.timelineViewDetails.appendChild(i._createCells(i._getHeaderVisibleCellsCount())),i.$.timelineViewSubDetails.innerHTML="",i.$.timelineViewCells.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.classList.add("jqx-hidden");let n=2;"quarter"===i.view?(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(i._getTimelineVisibleCellsCount()))):"month"===i.view&&"day"===i.monthScale?(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(t.day))):"year"===i.view&&(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(t.month))),i.hideTimelineHeader&&(i.$.timelineViewCells.classList.add("jqx-hidden"),n--),i.hideTimelineHeaderDetails&&(i.$.timelineViewDetails.classList.add("jqx-hidden"),n--),i.hideTimelineSecondHeaderDetails&&("quarter"===i.view?i.$.timelineViewDetails.classList.add("jqx-hidden"):i.$.timelineViewSubDetails.classList.add("jqx-hidden"),("year"===i.view||"month"===i.view&&"day"===i.monthScale||"quarter"===i.view)&&n--),i.$.taskTable.style.setProperty("--jqx-table-column-header-height","calc("+n+" * var(--jqx-gantt-chart-task-default-height) - calc("+n+" * var(--jqx-border-width) / "+n+"))"),i.$.timelineViewCells.innerHTML="",i.$.timelineViewCells.appendChild(i._createCells(i._getTimelineVisibleCellsCount()));let s=t[a];if("hour"===a&&("halfHour"===i.dayScale?s*=2:"quarterHour"===i.dayScale&&(s*=4)),i.$.timelineContent.style.width=i.$.timelineHeaderContent.style.width=Math.max(s*i._timelineCells[0].width,i.$.timeline.parentElement.offsetWidth)+"px",i.scrollLeft){const e=i._getScrollLeft(i.scrollLeft);i.$.timelineHeader.scrollLeft=e,i.$.mainSplitter.contains(i.$.resourceTimelineHeader)&&(i.$.resourceTimelineHeader.scrollLeft=e)}i._refreshHeaderDate(),i._setCurrentTimeIndicators()}_createTimelineContent(){const e=this,t=e.$.container,i=e.$.timelineContent,a=e._taskDefaultHeight,n=e.$.taskTimelineContainer,s=e.scrollLeft;if(i.style.height="",t.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height"),e._createTimelineVCells(a),i.style.height=e._timelineVCells.length*a+"px",t.style.setProperty("--jqx-gantt-chart-task-timeline-content-height",e.$.timeline.offsetHeight+"px"),s||s!==n.scrollLeft){const t=e._getScrollLeft(e.scrollLeft);n.scrollLeft=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollLeft=t)}e.scrollTop&&(n.scrollTop=e.scrollTop),e._recycleContentCells()}_createDateMarkers(){const e=this,t=e.dateMarkers;let i=[];delete e._markers;for(let a=0,n=t.length;a<n;a+=1){const n=t[a],s=e._dateValidator(void 0,n.date);if(s){const e={date:s},t=n.label,a=n.className;("string"==typeof t||"number"==typeof t&&!isNaN(t))&&(e.label=t),"string"==typeof a&&(e.className=a),i.push(e)}}i.length&&(e._markers=i),e._recycleDateMarkers()}_createTimelineRowCells(e,t){const i=this,a=e.children,n=e.querySelectorAll(".jqx-task-bar-limiter"),s=document.createDocumentFragment(),[r,o]=i.rightToLeft?["right","left"]:["left","right"];t||(t=i.$.timelineViewCells.children);for(let e=0,t=n.length;e<t;e+=1)n[e].remove();const l=t.length;for(;e.childElementCount>l;)e.lastElementChild.remove();for(let t=e.childElementCount;t<l;t+=1){const e=document.createElement("div");e.classList.add("jqx-timeline-cell"),s.appendChild(e)}s.childElementCount&&e.appendChild(s);for(let e=0;e<l;e+=1){const i=t[e],n=a[e];i.hasAttribute("weekend")?n.setAttribute("weekend",""):n.removeAttribute("weekend"),i.hasAttribute("nonworking")?n.setAttribute("nonworking",""):n.removeAttribute("nonworking"),n.style[o]=i.style[o],n.style[r]=i.style[r],n.style.width=i.style.width}for(let t=0,i=n.length;t<i;t+=1)e.appendChild(n[t])}_recycleTimelineRowCells(){const e=this,t=e.$.timelineViewCells.children,i=e.$.taskTimelineCellsContainer.children;for(let a=0,n=i.length;a<n;a+=1)e._createTimelineRowCells(i[a],t)}_createTimelineVCells(e){const t=this,i=t._tasks,a=t.$.taskTable.rows,n=t.groupByResources;let s=0,r={};t._timelineVCells=[];for(let o=0,l=a.length;o<l;o++){const l=a[o].data;let d=i[l.itemIndex];if(n)if(!d&&l.groupDataField){const e=l.$.id;d={$:{id:e,project:void 0},label:t._formatResourceGroupLabel(l.label),value:l.label,expanded:l.expanded,synchronized:!0,isGroup:!0,type:"project"},r[e]=d}else l.parent?(d.$.group=r[l.parent.$.id],t._synchronizeProjectDates(d.$.group,[d])):delete d.$.group;else delete d.$.group;!d.hidden&&t._isTaskExpanded(d)&&(t._timelineVCells.push({top:s,height:e,task:d}),s=parseFloat((s+e).toFixed(2)))}}_getCellsViewType(){const e=this;switch(e.view){case"quarter":case"year":return"month";case"month":return"day"===e.monthScale?"day":"week";case"week":return"day";case"day":return"hour"}}_dateAdd(e,t,i){if(e instanceof Date){var a=new Date(e),n=function(){a.getDate()!==e.getDate()&&a.setDate(0)};switch(String(t).toLowerCase()){case"year":a.setFullYear(a.getFullYear()+i),n();break;case"quarter":a.setMonth(a.getMonth()+3*i),n();break;case"month":a.setMonth(a.getMonth()+i),n();break;case"week":a.setDate(a.getDate()+7*i);break;case"day":a.setDate(a.getDate()+i);break;case"hour":a.setTime(a.getTime()+36e5*i);break;case"minute":a.setTime(a.getTime()+6e4*i);break;case"second":a.setTime(a.getTime()+1e3*i);break;default:a=void 0}return a}}_createTimelineCellsObj(e,t){const i=this,a=i._getCellsViewType();t=t[a],"hour"===a&&"halfHour"===i.dayScale?t*=2:"hour"===a&&"quarterHour"===i.dayScale&&(t*=4);const n=i.$.timeline.parentElement.offsetWidth;let s=Math.max(i._timelineCellSize,i._timelineCellMinSize),r=0,o=new Date(e);t*s<n&&(s=n/t),s=parseFloat(s.toFixed(2)),i._timelineCells=[];for(let e=0;e<t;e++){const t={left:r,width:s};if("year"===a||"quarter"===a)o.setMonth(0),t.date=new Date(o),o.setFullYear(o.getFullYear()+1);else if("month"===a)o.setDate(1),t.date=new Date(o),o.setMonth(o.getMonth()+1);else if("week"===a)o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),t.date=new Date(o),o.setDate(o.getDate()+7);else if("day"===a)i.nonworkingDays.indexOf(o.getDay())>-1&&(t.nonworking=!0),o.setHours(0,0,0,0),t.date=new Date(o),o.setDate(o.getDate()+1),t.weekend=0===t.date.getDay()||6===t.date.getDay();else if("hour"===a){(i.nonworkingHours.indexOf(o.getHours())>-1||i.nonworkingDays.indexOf(o.getDay())>-1)&&(t.nonworking=!0),"hour"!==i.dayScale&&0!==e||o.setHours(o.getHours(),0,0,0),t.date=new Date(o);const a=o.getTime();"hour"===i.dayScale?o.setHours(o.getHours()+1):"halfHour"===i.dayScale?o=i._dateAdd(o,"minute",30):"quarterHour"===i.dayScale&&(o=i._dateAdd(o,"minute",15)),a===o.getTime()&&o.setHours(o.getHours()+2),t.weekend=0===t.date.getDay()||6===t.date.getDay()}i._timelineCells.push(t),r=parseFloat((r+s).toFixed(2))}}_createTimelineHeaderSubCellsObj(e,t){const i=this,a=i._getCellsViewType();t="month"===i.view&&"day"===i.monthScale?t.day:t[a],"hour"===a&&"halfHour"===i.dayScale?t*=2:"hour"===a&&"quarterHour"===i.dayScale&&(t*=4);const n=i.$.timeline.parentElement.offsetWidth;let s=Math.max(i._timelineCellSize,i._timelineCellMinSize),r=0,o=new Date(e);t*s<n&&(s=n/t),s=parseFloat(s.toFixed(2)),i._timelineHeaderSubCells=[];for(let e=0;e<t;e++){const t={left:r,width:s};if("year"===a||"quarter"===a)o.setMonth(0),t.date=new Date(o),o.setFullYear(o.getFullYear()+1);else if("month"===a)o.setDate(1),t.date=new Date(o),o.setMonth(o.getMonth()+1);else if("week"===a)o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),t.date=new Date(o),o.setDate(o.getDate()+7);else if("day"===a)i.nonworkingDays.indexOf(o.getDay())>-1&&(t.nonworking=!0),o.setHours(0,0,0,0),t.date=new Date(o),o.setDate(o.getDate()+1),t.weekend=0===t.date.getDay()||6===t.date.getDay();else if("hour"===a){(i.nonworkingHours.indexOf(o.getHours())>-1||i.nonworkingDays.indexOf(o.getDay())>-1)&&(t.nonworking=!0),"hour"!==i.dayScale&&0!==e||o.setHours(o.getHours(),0,0,0),t.date=new Date(o);const a=o.getTime();"hour"===i.dayScale?o.setHours(o.getHours()+1):"halfHour"===i.dayScale?o=i._dateAdd(o,"minute",30):"quarterHour"===i.dayScale&&(o=i._dateAdd(o,"minute",15)),a===o.getTime()&&o.setHours(o.getHours()+2),t.weekend=0===t.date.getDay()||6===t.date.getDay()}i._timelineHeaderSubCells.push(t),r=parseFloat((r+s).toFixed(2))}}_createTimelineHeaderCellsObj(e,t){const i=this;let a=i.view,n=0,s=new Date(e);"quarter"===a&&(a="year"),t=t[a],i._timelineHeaderCells=[];for(let e=0;e<t;e++){const t={};switch(t.date=new Date(s),a){case"quarter":case"year":s.setFullYear(s.getFullYear()+1);break;case"month":s.setDate(1),s.setMonth(s.getMonth()+1);break;case"week":s.setDate(s.getDate()+7);break;case"day":s.setDate(s.getDate()+1)}n=i._refreshViewDetailCell(t,n,e),i._timelineHeaderCells.push(t)}}_minMaxDateValidator(e){if(!e||isNaN(e.getTime()))return e;const t=new Date(this.min),i=new Date(this.max);return t&&(e=new Date(Math.max(t.getTime(),e.getTime()))),i&&(e=new Date(Math.min(i.getTime(),e.getTime()))),e}_dateValidator(e,t){const i=this;let a;if(t instanceof Date)return i._minMaxDateValidator(t);if(JQX.Utilities.DateTime&&t instanceof JQX.Utilities.DateTime)return i._minMaxDateValidator(t.toDate());if("string"!=typeof t)return i._minMaxDateValidator(e);{const e=/\d+:\d+:\d+/;if("new Date()"===t.trim()||"new JQX.Utilities.DateTime()"===t.trim())return i._minMaxDateValidator(new Date);if(isNaN(Date.parse(t))){const i=/(\d+[,-.\/]{1}\s*\d+[,-.\/]{1}\s*\d+)/;if(i.test(t)){const n=i.exec(t)[0].replace(/[,-.\/]/g,",").split(",");if(3===n.length){const[i,s]=parseInt(n[0])<parseInt(n[2])?[n[0],n[2]]:[n[2],n[0]];if(a=new Date(parseInt(s),parseInt(n[1])-1,parseInt(i)),e.test(t)){const i=e.exec(t)[0].split(":");a.setHours(i[0]||0,i[1]||0,i[2]||0)}t=a}}}else a=new Date(Date.parse(t)),e.test(t)||a.setHours(0,0,0,0),t=a}return i._minMaxDateValidator(new Date(t))}_currentTimeIndicatorIntervalValidator(e,t){return Math.max(1,t)}_getTaskBarPositionLimits(e,t){const i=this;function a(e){const t=i._getTimelineTaskCellByDate(e);if(t)return t.left+i._getTimelineTaskOffset(t,e)||0}return{min:a(e["min"+t]),max:a(e["max"+t])}}_getTimelineTaskOffset(e,t){if(!e)return;let i,a;switch(this.view){case"quarter":case"year":{const n=t.getHours()/24+t.getMinutes()/1440+t.getSeconds()/86400;i=new Date(e.date.getFullYear(),e.date.getMonth()+1,0),a=(t.getDate()-1+n)/i.getDate()*e.width;break}case"month":a=t.getDay()/7*e.width;break;case"week":a=parseFloat(t.getHours()+t.getMinutes()/60+t.getSeconds()/3600)/24*e.width;break;case"day":a=parseFloat(t.getMinutes()+t.getSeconds()/60)/60*e.width}return a}_getTaskBarSizeLimits(e,t){const i=this,a=i._getTaskBarDateRange(e);let n,s=0,r=i._convertDuration(e._cellObj.task.minDuration)||i._getMinDuration(e,t),o=i._convertDuration(e._cellObj.task.maxDuration);function l(n,s){if(!n)return;let r,o;"left"===t&&!i.rightToLeft||"right"===t&&i.rightToLeft?(n*=-1,o=a.dateEnd):o=a.dateStart,s&&Math.abs(r)===Math.abs(n)&&(r=0);let l=i._getTaskWorkingDateEnd({dateStart:o},n);const d=l.getTime()+60*(l.getTimezoneOffset()-o.getTimezoneOffset())*1e3,c=i._getTimelineTaskCellByDate(new Date(d));if(!c)return;const m=i._getTimelineTaskOffset(c,new Date(d));return i.rightToLeft?"left"===t?m-(i.$.timelineContent.offsetWidth-e.offsetLeft-e.offsetWidth-c.left):i.$.timelineContent.offsetWidth-e.offsetLeft-c.left-m:"left"===t?e.offsetLeft+e.offsetWidth-c.left-m:c.left-e.offsetLeft+m}if("left"===t&&!i.rightToLeft||"right"===t&&i.rightToLeft){const t=e._cellObj.task.maxDateStart,i=e._cellObj.task.minDateStart;i&&(s=60*(i.getTimezoneOffset()-a.dateEnd.getTimezoneOffset())*1e3,n=Math.abs(i.getTime()-a.dateEnd.getTime())+s,o=o?Math.min(n,o):n),t&&(s=60*(t.getTimezoneOffset()-a.dateEnd.getTimezoneOffset())*1e3,n=Math.abs(t.getTime()-a.dateEnd.getTime())+s,r=r?Math.max(n,r):n)}else{const t=e._cellObj.task.maxDateEnd,i=e._cellObj.task.minDateEnd;i&&(s=60*(i.getTimezoneOffset()-a.dateStart.getTimezoneOffset())*1e3,n=Math.abs(i.getTime()-a.dateStart.getTime())+s,r=r?Math.max(n,r):n),t&&(s=60*(t.getTimezoneOffset()-a.dateStart.getTimezoneOffset())*1e3,n=Math.abs(t.getTime()-a.dateStart.getTime())+s,o=o?Math.min(n,o):n)}return o&&(r=Math.min(r,o)),{min:l(r,!0),max:l(o)}}_getMinDuration(e,t){const i=this,a=i._taskBarMinWidth;if(!a||!i._timelineCells||0===i._timelineCells.length)return;const n=e._cellObj.task;let s,r,o=1;r=i.rightToLeft?parseFloat(e.style.right)||i.$.timelineContent.offsetWidth-e.offsetLeft-e.offsetWidth:parseFloat(e.style.left)||e.offsetLeft,"left"===t?(s=n.dateEnd,r+=parseFloat(e.style.width)||e.offsetWidth,o=-1):s=n.dateStart;const l=r+o*a;let d;for(let e=0;e<i._timelineCells.length;e++){const t=i._timelineCells[e];if(l<t.left)break;d=t}const c=i._getDateFromCell(l,d);return c?Math.abs(s.getTime()-c.getTime()):void 0}_createDelimiter(e,t){const i=this,a=i._dragDetails,n=a.segment,s=e.slice(0,3),r=document.createElement("div");if(r.classList.add("jqx-task-bar-limiter",e),e.indexOf("date")>-1){if(!a[s]||!a[s].left)return;const[e,t]=n?[n.element,n.originalPosition.x]:[a.timelineTask,0],o=i.$.taskTimelineCellsContainer.children[i._getTaskDOMIndex(a.task)];s.indexOf("max")>-1?r.style.width=o.offsetWidth-a[s].left-t-e.offsetWidth+"px":r.style.width=a[s].left+t+"px"}else{if(!a[s].width)return;r.style["left"===t?"right":"left"]=a[s].width+"px"}return r}_doubleClickHandler(e){const t=this;let i=e.target;if(t.disabled||t.disableWindowEditor)return;t.shadowRoot&&i===t&&(i=e.composedPath()[0]);let a=i.closest?i.closest(".jqx-task-connection"):void 0;if(a)t._openPopupWindow(a);else if(a=i.closest(".jqx-timeline-task")||i.closest(".jqx-table tbody tr[row-id]"),a&&t.$.taskSplitter.contains(a))if(a.classList.contains("jqx-timeline-task"))t._openPopupWindow(a._cellObj.task);else{const e=t._getVCellById("task",a.getAttribute("row-id"));e&&t._openPopupWindow(e.task)}}_checkDoubleClick(e){const t=this;let i=e.target;if(t.shadowRoot&&i===t&&(i=e.composedPath()[0]),void 0===t._dblClickDetails&&(t._dblClickDetails={clicks:0}),clearTimeout(t._dblClickDetails.timeOut),i!==t._dblClickDetails.target&&(t._dblClickDetails.clicks=0),t._dblClickDetails.target=i,t._dblClickDetails.clicks++,t._dblClickDetails.timeOut=setTimeout((function(){t._dblClickDetails&&(t._dblClickDetails.clicks=0)}),250),2===t._dblClickDetails.clicks)return t._doubleClickHandler(e),t._dblClickDetails.clicks=0,!0}_downHandler(e){const t=this,i=e.originalEvent,a=t.shadowRoot||t.isInShadowDOM?i.composedPath()[0]:i.target,n=a.closest?a.closest(".jqx-timeline-row")||a.closest(".jqx-timeline-task"):null;if(e.stopPropagation(),delete t._itemClickDetails,t._dragDetails)return delete t._dragDetails,void t._setConnectionFeedback();const s=t.$.taskSplitter.contains(a)?"task":"resource";if((a.closest(".jqx-timeline-content")||a.closest(`.jqx-${s}-table`))&&requestAnimationFrame((()=>t.$[`${s}Table`].focus({preventScroll:!0}))),t._itemClickDetails={target:a},!t._isMobile&&0!==e.button)return;if(!n){if(a.classList.contains("jqx-popup-window-modal")){if(t._popupWindow){const e=Object.keys(t._popupWindow);requestAnimationFrame((()=>t._popupWindow[e[e.length-1]].focus()))}return}return void((a.closest(".jqx-table tbody tr[row-id]")&&!a.classList.contains("jqx-arrow")||a.closest(".jqx-task-connection"))&&t._checkDoubleClick(i))}if(a.closest(".jqx-resource-timeline-view-cell")||t.disabled)return;const r=Array.from(t.$.timelineTasksContainer.children).find((e=>e._cellObj.task===n._cellObj.task));if(!r)return;const o=r._cellObj.task;if(!o)return;const l=t.$.timeline.getAttribute("task-bar-hovered");if(r.getElementsByClassName("jqx-timeline-task-fill")[0]||l){if((a.closest(".jqx-timeline-task-fill")||r.classList.contains("milestone")&&a.closest(".jqx-task-container"))&&t._checkDoubleClick(i))return;const n=a.closest(".jqx-timeline-task-progress-thumb"),s=e.pageX-window.pageXOffset,d=e.pageY-window.pageYOffset,c=t._dragDetails={},m=t.rightToLeft;let u,h=a.closest(".jqx-task-segment");if(l&&!h){const e=r.querySelectorAll(".jqx-task-segment");c.segments=e,h="left"===l&&!m||"right"===l&&m?e[0]:e[e.length-1]}if(c.target=(n||a).className,c.timelineTask=r,c.task=r._cellObj.task,c.taskDimensions={width:r.offsetWidth,height:r.offsetHeight,left:r.offsetLeft,top:r.offsetTop},c.coordinates={x:s,y:d},!e.ctrlKey&&h&&o.segments&&o.segments.length>1&&!t.disableSegmentDrag){const e=h.getBoundingClientRect(),t=h._segmentObj,i=c.task.segments,a=i.indexOf(t);c.segment={element:h,dimensions:{width:e.width,left:h.offsetLeft},offset:{x:s-e.left},originalSize:{width:e.width},isFirstSegment:0===a,isLastSegment:a===i.length-1,min:{},max:{}},u=c.segment.dimensions}const g=c.taskDimensions;t.rightToLeft?(g.right=t.$.timelineContent.offsetWidth-(g.left+g.width),c.originalPosition={x:g.right,y:g.top},c.segment&&(u.right=g.width-(u.left+u.width),c.segment.originalPosition={x:u.right})):(c.originalPosition={x:g.left,y:g.top},c.segment&&(c.segment.originalPosition={x:u.left}));const f=(n||r).getBoundingClientRect();if(c.offset={x:s-f.left,y:d-f.top},c.originalSize={width:g.width,height:g.height},n||!n&&"project"===o.type&&o.synchronized&&!o.dragProject)return void(a.closest(".jqx-task-connection-point")&&(c.timelineTask=void 0,c.relatedConnections={}));("visible"===t.resizeHandlesVisibility||t._isMobile&&"auto"===t.resizeHandlesVisibility)&&(a.closest(".jqx-timeline-task-fill")?t._checkTaskBarResizability(e):t.$.timeline.removeAttribute("task-bar-hovered")),c.min={},c.max={},t._setDragLimits(a)}}_documentMoveHandler(e){const t=this;if(!t._dragDetails||!t._dragDetails.target){let i=e.originalEvent.target;t.shadowRoot&&i===t&&(i=e.originalEvent.composedPath()[0]);const a=i.closest&&i.closest(".jqx-table tbody tr[row-id]");return a&&a.data?t._handleTableItemHover(a.data.itemId,i):t._handleTimelineHover(e),t._checkTaskBarResizability(e),void t._toggleTooltip(e.originalEvent)}if(t._dragDetails.target.includes("jqx-task-connection-point"))return t._setConnectionFeedback(e),t._handleTimelineHover(e),void t._autoScroll(e);if(t._dragDetails.target.includes("jqx-timeline-task-progress-thumb"))t._handleTaskProgressChange(e);else if(t._autoScroll(e),!t._autoScrolling)if(t.$.timeline.hasAttribute("task-bar-hovered"))t._handleTaskBarResize(e);else if(t._dragDetails.target.includes("jqx-timeline-task-fill")){const i=t._dragDetails.task;if(!i||i.disableDrag||"project"===i.type&&i.synchronized&&!i.dragProject)return;t._handleTaskBarDrag(e)}}_documentUpHandler(e){const t=this,i=e.originalEvent;let a=i.target;if(t._upHandler(),!t._dragDetails)return void t._handleItemClick(i);if(t._scrollView.disableSwipeScroll=t._touchmoveInside=!1,t.shadowRoot&&a===t&&(a=i.composedPath()[0]),t.hasAttribute("connecting-task")){const i=t._connectTask(e),a=t._tasks;if(t._setConnectionFeedback(),i){const e=i.taskStart,n=i.taskEnd,[s,r,o]=[a.indexOf(i.taskStart),a.indexOf(i.taskEnd),i.type];t.$.fireEvent("connectionEnd",{id:`${s}-${r}-${o}`,startIndex:s,startTaskId:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,endIndex:r,endTaskId:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,type:o}),t._autoSchedule(i.taskStart)}return t._isMobile&&t._handleTimelineHover(e,!0),void delete t._dragDetails}const n=t._dragDetails.task;if(!n)return void delete t._dragDetails;let s;const r=t._dragDetails.segment?t._dragDetails.segment.element:void 0;if(s||(s=Array.from(t.$.timelineTasksContainer.children).find((e=>e._cellObj.task===n))),t.hasAttribute("dragged")){t._snapToNearest(s,r),r||t._checkWorkingDays(s,r),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),t._autoSchedule(n),t._resourceTreeRefreshTimeout?(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n)):(t.snapToNearest||t.nonworkingDays.length>0||t.nonworkingHours.length>0)&&t._refreshAssignedResources(n),t.removeAttribute("dragged");const e={id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:new Date(n.dateStart),dateEnd:new Date(n.dateEnd)};r&&(e.segment=t._cloneObject(r._segmentObj)),t.$.fireEvent("dragEnd",e)}else if(t.hasAttribute("progress-change"))t._resourceTreeRefreshTimeout&&(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n,["progress"])),t.removeAttribute("progress-change"),t.$.fireEvent("progressChangeEnd",{id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),progress:n.progress||0});else if(t.hasAttribute("resized")){t._snapToNearest(s,r),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),t._resourceTreeRefreshTimeout?(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n,["workload"])):t.snapToNearest&&t._refreshAssignedResources(n,["workload"]),t.removeAttribute("resized");const e={id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:n.dateStart,dateEnd:n.dateEnd};r&&(e.segment=t._cloneObject(r._segmentObj)),t.$.fireEvent("resizeEnd",e),t._autoSchedule(n)}else a.closest(".jqx-timeline-task")===s&&(t._select("task",n.$.id,!0),delete t._dragDetails,t._handleItemClick(i));const o=t.$.timelineContent.querySelectorAll(".jqx-task-bar-limiter");for(let e=0,t=o.length;e<t;e+=1)o[e].remove();delete t._dragDetails}_handleItemClick(e){const t=this,i=e.target;if(t._dragDetails||!t._itemClickDetails||t._itemClickDetails.target!==i)return void delete t._itemClickDetails;let a,n,s;if(i.closest(".jqx-timeline-task-fill"))n=i.closest(".jqx-timeline-task")._cellObj.task,s="task";else if(a=i.closest(".jqx-task-connection"),a)n=a.getAttribute("connection-id").split("-"),n={source:n[0],target:n[1],type:n[2]},s="connection";else if(i.closest(".milestone"))n=i.closest(".milestone")._cellObj.task,s="milestone";else if(a=i.closest(".jqx-table tbody tr"),a){const e=t._getVCellById(s,a.getAttribute("row-id"));s=t.$.taskTable.contains(a)?"task":"resource",n=e?e[s]:void 0}if(!n)return;const r={originalEvent:e,type:s,item:t._cloneObject(n)};r.id="connection"===s?`${n.source}-${n.target}-${n.type}`:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,delete t._itemClickDetails,t.$.fireEvent("itemClick",r)}_moveHandler(e){const t=this;t._isMobile||e.stopPropagation(),(t.hasAttribute("dragged")||t.hasAttribute("progress-change"))&&"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_handleTableItemHover(e,t){const i=this,a=i._hoveredItem;let n,s;if(t&&([n,s]=i.$.taskSplitter.contains(t)?[i.$.taskTable,"task"]:[i.$.resourceTable,"resource"]),a&&"itemType"===a.type&&a.id===e)return;const r=i.$.mainSplitter.querySelectorAll("table tbody tr[hover]");for(let e=0;e<r.length;e++)r[e].removeAttribute("hover");if(void 0===e)return void i._handleTimelineHover({target:i});if(!n)return;i._setTableHoverState(n,e);const o=i.$["task"===s?"taskTimelineCellsContainer":"resourceTimelineCellsContainer"].children;for(let t=0,a=o.length;t<a;t+=1){const a=o[t];if(a._cellObj[s].$.id===e){i._handleTimelineHover({target:a});break}}}_setTableHoverState(e,t){const i=this;e||(e=i.$.taskTable);const a=e===i.$.taskTable?"task":"resource",n=e.querySelectorAll("table tbody tr");if(!i._isMobile&&i[a+"Columns"].length)for(let e=0;e<n.length;e++){let i=n[e];const a=i.data;a&&a.itemId===t&&i.setAttribute("hover","")}}_checkWorkingDays(e){const t=this,i=t._dragDetails;if(!(i&&i._taskDuration||t._timelineCells.length))return;if(!e.classList||!e.classList.contains("jqx-timeline-task")||!t.hasAttribute("dragged")||0===t.nonworkingDays.length&&0===t.nonworkingHours.length||!i||!i._taskDuration)return;const a=e._cellObj,n=a.task,s=t._getTaskWorkingDateEnd(n),r=n.segments;let o=new Date(t._timelineCells[t._timelineCells.length-1].date);if("year"===t.view||"quarter"===t.view?(o.setMonth(o.getMonth()+1),o.setDate(0),o.setHours(23,59,59,999)):"month"===t.view?(o.setDate(o.getDate()+6-o.getDay()),o.setHours(23,59,59,999)):"week"===t.view?o.setHours(23,59,59,999):o.setHours(o.getHours(),59,59,999),s&&(n.dateEnd=n.maxDateEnd?new Date(Math.min(s.getTime(),n.maxDateEnd.getTime())):s),n.dateEnd=new Date(Math.min(o.getTime(),n.dateEnd.getTime())),n.duration=t._convertDuration(t.nonworkingDays.length>0||t.nonworkingHours.length>0?t._getWorkingTime(n.dateStart,n.dateEnd):n.dateEnd.getTime()-n.dateStart.getTime(),!0),r&&r.length>1){for(let e=0,i=r.length;e<i;e+=1)t._snapToNearestDates(r[e],!0);t._validateTaskSegments(n),n.segments.length!==r.length&&t._recycleSegments(n,e),t._setTaskBarSegments(a,e,!0),t._setTaskBarProgress(n)}t._setTimelineTaskBar(a,void 0,!0),t._refreshTaskConnections(a.task),t._refreshTableColumnsData(n,["dateEnd","duration","overdue"])}_getTaskWorkingDateEnd(e,t){const i=this;if(!e||!e.dateStart)return;let a,n,s=new Date(e.dateStart);if(t||(t=i._dragDetails?i._dragDetails._taskDuration:i._getWorkingTime(e.dateStart,e.dateEnd)),!i.adjustToNonworkingTime)return new Date(e.dateStart.getTime()+t);const r=t<0?-1:1,o=i.nonworkingDays,l=i.nonworkingHours;for(t=Math.abs(t);t>0;){const e=Math.min(t,36e5-(60*s.getMinutes()*1e3+1e3*s.getSeconds()+s.getMilliseconds()));if(o.indexOf(s.getDay())>-1)n=new Date(s),n.setHours(0,0,0,0),n.setDate(s.getDate()+1*r),a=Math.min(e,n.getTime()-s.getTime()),s=new Date(s.getTime()+a);else if(l.indexOf(s.getHours())>-1){n=new Date(s);const t=n.getTime();n.setHours(s.getHours()+1*r,0,0,0),t===n.getTime()&&n.setHours(s.getHours()+2*r,0,0,0),a=Math.min(e,n.getTime()-s.getTime()),s=new Date(s.getTime()+a)}else t-=e,s=new Date(s.getTime()+r*e)}return s}_createConnectingElement(e,t,i,a,n){const s=this;if(!s._connectionDetails||!s._connectionDetails.start)return;const r=s._connectionDetails,o=r.type,l=s.$.timelineConnectionsContainer;let d=r.connections.shift();d||(d=document.createElement("div"),d.classList.add("jqx-task-connection")),d.style.width=d.style.width="","horizontal"===a?(d.style.width=Math.abs(i)+"px",d.style.height=""):(d.style.width="",d.style.height=Math.abs(i)+"px"),d.style[s.rightToLeft?"left":"right"]="",d.style[s.rightToLeft?"right":"left"]=e+"px",d.style.top=t+"px",d.setAttribute("connection-id",r.id);const c=r.start.task.label,m=0===o||3===o?"start":"end",u=r.end.task.label,h=0===o||1===o?"start":"end";if(d.setAttribute("aria-label","Connection between "+c+" ("+m+") and "+u+" ("+h+")"),n){let e=0===o||1===o?"right":"left";s.rightToLeft&&(e="left"===e?"right":"left"),d.setAttribute("arrow-direction",e)}else d.removeAttribute("arrow-direction");d.parentElement||l.appendChild(d)}_getConnectionType(e,t){if(!e||!t)return;let i,a;return"string"==typeof e?i=!e.includes("end"):e instanceof HTMLElement&&(i=!e.classList.contains("end")),"string"==typeof t?a=t.includes("end"):t instanceof HTMLElement&&(a=t.classList.contains("end")),i&&!a?0:i||a?!i&&a?2:i&&a?3:void 0:1}_setConnectionFeedback(e){const t=this,i=t._dragDetails;if(!i||!i.target||!e){const e=t._connectionFeedback;return e&&e.parentElement&&e.remove(),t.removeAttribute("connecting-task"),void delete t._connectionFeedback}if(!i.target||!i.target.includes("jqx-task-connection-point"))return;const a=i.task,n=i.taskDimensions;if(!a)return;if(!t.hasAttribute("connecting-task")){if(t.$.fireEvent("connectionStart",{startIndex:t._tasks.indexOf(a)}).defaultPrevented)return void delete t._dragDetails.target;t.setAttribute("connecting-task",""),t._isMobile&&(t._scrollView.disableSwipeScroll=t._touchmoveInside=!0)}const s="milestone"===a.type,r=t.rightToLeft;let o=s?-1*n.height/2:0;t._dragDetails.target.includes("end")&&(o=s?-1*o:n.width),t._connectionFeedback||(t._connectionFeedback=document.createElement("div"),t._connectionFeedback.classList.add("jqx-task-connection-feedback"));const l=t._dragDetails.coordinates.x+(r?-1:1)*o,d=t._dragDetails.coordinates.y,c=t._dragDetails.offset.x-(r?n.width:0),m=t._dragDetails.offset.y,u=e.pageX-window.pageXOffset+c,h=e.pageY-window.pageYOffset+m-n.height/2;r?(t._connectionFeedback.style.left="",t._connectionFeedback.style.right=n.right+o+"px"):(t._connectionFeedback.style.left=n.left+o+"px",t._connectionFeedback.style.right=""),t._connectionFeedback.style.top=n.top+n.height/2+"px",t._connectionFeedback.style.width=Math.sqrt(Math.pow(Math.abs(u-l),2)+Math.pow(Math.abs(h-d),2))+"px",t._connectionFeedback.style.transform=t.rightToLeft?"rotate("+180*(Math.atan2(d-h,l-u)||0)/Math.PI+"deg)":"rotate("+180*(Math.atan2(h-d,u-l)||0)/Math.PI+"deg)",t._connectionFeedback.parentElement||t.$.timelineContent.appendChild(t._connectionFeedback)}_connectTask(e){const t=this,i=t._tasks;let a,n,s,r,o,l,d,c,m;if(e.originalEvent){const r=e.originalEvent;let o=t._isMobile?document.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset):r.target;if(!(t._dragDetails&&t._dragDetails.target&&o&&o.classList))return;if(t.shadowRoot&&o===t&&(o=t._isMobile?t.shadowRoot.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset):r.composedPath()[0]),a=t._dragDetails.target.includes("jqx-task-connection-point")?t._dragDetails.target:void 0,n=o.classList.contains("jqx-task-connection-point")?o:void 0,a&&(l=t._dragDetails.task),n)s=n.closest(".jqx-timeline-task");else if(t._isMobile&&o.classList.contains("jqx-timeline-task-fill")&&(s=o.closest(".jqx-timeline-task"),s)){const e=r.pageX-window.pageXOffset-s.getBoundingClientRect().left;n=s.querySelector(".jqx-task-connection-point."+(e>=s.offsetWidth/2?"end":"start"))}if(!l||!s)return;d=s._cellObj.task;for(let e=0,t=i.length;e<t;e+=1){const t=i[e];if(t!==l)if(t!==d){if(void 0!==c&&void 0!==m)break}else m=e;else c=e}}else{if(!e||e.length<3)return;const a=t._getValidConnectionId(e[0],e[1],e[2],"_connectTask");if(void 0===a)return;[c,m]=[parseInt(a[0]),parseInt(a[1])],[l,d]=[i[c],i[m]],r=parseInt(e[2]),o=e[4]||0}if(!l||!d||l===d||l.isGroup||d.isGroup||t._isAutoScheduled(l,d)||t.hasAttribute("dragged")||t.hasAttribute("resized"))return;void 0===r&&(r=t._getConnectionType(a,n));let u=t._connections;return u||(t._connections=u=[]),t._updateConnection([c,m,r,o])?(e.originalEvent&&t._recycleConnections([{startIndex:c,endIndex:m,type:r}]),e.originalEvent&&t.$.fireEvent("itemInsert",{type:"connection",item:{source:c,target:m,type:r}}),{taskStart:l,taskEnd:d,type:r}):void 0}_recycleConnections(e){const t=this,i=t._tasks;if(e?Array.isArray(e)||(e=[e]):e=t._connections,!i||!i.length||!e)return;const a=t.$.timelineTasksContainer.children,n=t.$.timelineConnectionsContainer;let s,r=[];if(a.length){const n=a[0],o=(()=>{let e=[];for(let t=0,n=a.length;t<n;t+=1)e.push(i.indexOf(a[t]._cellObj.task));return e})(),l=n.querySelector(".jqx-task-connection-point."+(t.rightToLeft?"end":"start")),d=t._baselineProportion,c=t.showBaseline?t._taskDefaultHeight/d:0;s={top:l.offsetTop,width:l.offsetWidth},s.offset=Math.abs(l.offsetLeft)-s.width;for(let a=0,n=e.length;a<n;a+=1){const n=e[a],l=n.startIndex,d=n.endIndex;if(o.indexOf(l)<0&&o.indexOf(d)<0)continue;const m=i[l],u=i[d],{vCellStart:h,vCellEnd:g}=t._getTasksVCell(m,u);if(!h||!g)continue;const f=n.type,p={start:{width:s.width,top:s.top,index:l,task:m},end:{width:s.width,top:s.top,index:d,task:u},type:f},_=t._getTaskBarDetails(h,t._getTimelineCellByDate(m.dateStart),t._getTimelineCellByDate(m.dateEnd)),T=t._getTaskBarDetails(g,t._getTimelineCellByDate(u.dateStart),t._getTimelineCellByDate(u.dateEnd));"milestone"===m.type&&(_.width=h.height-c),"milestone"===u.type&&(T.width=h.height-c),p.start.left=0===f||3===f?-1*(s.width+s.offset):_.width+s.offset,p.end.left=0===f||1===f?-1*(s.width+s.offset):T.width+s.offset,t._connectionDetails=p,_.height=T.height=h.height-c,_.type=m.type,T.type=u.type,t._setConnectionDetails(_,T),t._createTaskConnection(),r.push(t._connectionDetails.id),delete t._connectionDetails}}if(arguments.length)return;const o=Array.from(n.children);for(let e=0,t=o.length;e<t;e+=1){const t=o[e];r.indexOf(t.getAttribute("connection-id"))<0&&t.remove()}}_getTasksVCell(e,t){const i=this._timelineVCells;let a,n;for(let s=0,r=i.length;s<r;s+=1){const r=i[s];if(r.task===e&&(a=r),r.task===t&&(n=r),a&&n)break}return{vCellStart:a,vCellEnd:n}}_isAutoScheduled(e,t,i){const a=this,n=a._tasks;let s={};if(a.autoSchedule)return e instanceof HTMLElement&&(e=e._cellObj.task),t instanceof HTMLElement&&(t=t._cellObj.task),function e(t,r){const o=a._getTaskConnections().taskConnections,l=n.indexOf(t);s[l]=!0;for(let t=0;t<o.length;t++){const d=o[t],c=d.endIndex;if(c===r)return i&&a._removeConnection(l+"-"+c+"-"+d.type,!0),!0;if(!s[c]&&e(n[c],r))return!0}}(t,n.indexOf(e))}_setConnectionDetails(e,t){const i=this;if(!i._connectionDetails)return;const a=i._connectionDetails,n=a.start,s=a.end,r=a.type;if(!n||!s)return;let o,l=e.width,d=t.width,c=e.left,m=t.left,u=e.top,h=t.top,g=n.left,f=s.left;const p=n.index,_=s.index;if("milestone"===e.type&&(l=e.height,c-=l/2),"milestone"===t.type&&(d=t.height,m-=d/2),a.id=p+"-"+_+"-"+r,!a.connectionStartOffset||!a.connectionEndOffset){switch(r){case 0:g=Math.abs(g)-n.width,f=Math.abs(f)-s.width;break;case 1:g-=l,f=Math.abs(f)-s.width;break;case 2:g-=l,f-=d;break;default:g=Math.abs(g)-n.width,f-=d}a.start.offset=g+=n.width/2,a.end.offset=f+=s.width/2}if(0===r&&c>m||1===r&&c+l+g>m-f&&h>u||2===r&&m+d>c+l||3===r&&(c-g<m+d+f&&h>u||c-g>m+d+f&&u>h)){o=!0;let i=e;e=t,t=i,i=g,g=f,f=i,i=l,l=d,d=i,i=c,c=m,m=i,i=u,u=h,h=i}let T=c,b=m;!o&&1===r||o&&3===r?T+=l:!o&&3===r||o&&1===r?b+=d:2===r&&(T+=l,b+=d);let k=i.$.timelineConnectionsContainer.querySelectorAll('.jqx-task-connection[connection-id^="'+p+"-"+_+'-"]');0===k.length&&(k=i.$.timelineConnectionsContainer.querySelectorAll('.jqx-task-connection[connection-id^="'+_+"-"+p+'"]')),a.connections=[].slice.call(k),a.start.x=T,a.start.y=u+n.top,a.end.x=b,a.end.y=h+s.top,a.type=r,a.inverted=o}_createTaskConnection(){const e=this,t=e._connectionDetails;if(!t)return;const i=2*e._taskConnectionWidth,a=t.start.x,n=t.start.y,s=t.start.offset,r=t.start.top,o=t.end.x,l=t.end.y,d=t.end.offset,c=t.type,m=t.inverted,u=!m&&3===c||m&&1===c,h=!m&&1===c||m&&3===c;let g,f,p,_=a,T=o;u?(_=a-d,T=o+d):h&&(_=a+s,T=o-d);const b=_<=T&&u,k=_>=T&&h,y=2===c||h;!function d(u){g!==o&&(u?"horizontal"===u?(p=g-o+(b?-1:1)*s,g=_>T?g-Math.abs(p):g,e._createConnectingElement(g,f,(_===T?0:Math.abs(p))+(y?i:0),"horizontal"),g=_<T?g-p:g,d("vertical")):(p=Math.abs(f-l),f+=n<l?0:-1*p,g-=m&&1===c||!m&&3===c&&n>l?i:0,e._createConnectingElement(g,f,p,"vertical"),d()):(g?(p=Math.abs(g-o),g>=o&&(g+=-1*p,p+=i),e._createConnectingElement(g,f+(n<l?Math.abs(f-l):0),p,"horizontal",!t.inverted),g=o):(g=a,f=n,(0===c||!m&&3===c||m&&1===c)&&(g-=s),e._createConnectingElement(g,f,s,"horizontal",t.inverted),y&&(g+=s-i),b||k?(e._createConnectingElement(g,f-=n>l?r:0,r,"vertical"),f+=n<l?r:0):d("vertical")),d("horizontal")))}(),t.connections.map((e=>e.parentElement.removeChild(e)))}_getTaskIndexById(e,t){const i=this;if(t||(t=i._tasks),"number"==typeof e)return isNaN(parseInt(e))?-1:parseInt(e);if("object"==typeof e)return i._getItemIndex(e,"task");for(let i=0,a=t.length;i<a;i+=1)if(t[i].id===e)return i;return-1}_refreshTaskConnections(e){const t=this,i=e instanceof HTMLElement?e._cellObj.task:e,a=t._tasks.indexOf(i);if(void 0===a||e.classList&&e.classList.contains("jqx-visibility-hidden"))return;let n;if(t._dragDetails&&(n=t._dragDetails.relatedConnections[a]),!n){n=[];const e=t._connections;if(!e||!e.length)return;for(let t=0,i=e.length;t<i;t+=1){const i=e[t];i.startIndex!==a&&i.endIndex!==a||n.push(i)}t._dragDetails&&(t._dragDetails.relatedConnections[a]=n)}t._recycleConnections(n)}_dragStartHandler(e){const t=this,i=e.target.closest;(t._dragDetails||i&&i.call(t,"jqx-gantt-chart")===t)&&e.preventDefault()}_getFirstCellObjInView(e){const t=this;if(e||(e=t._timelineCells),!e)return;const i=Math.abs(t.scrollLeft);let a,n;for(let t=0;t<e.length;t++){const s=e[t];if(s.left+s.width>i){a=s;break}n=s}return!a&&n&&(a=i>n.left?n:e[0]),a}_getFirstContentCellInView(e="task"){const t=this;let i,a,n,s;if("task"===e?(i=t._timelineVCells,a=t.scrollTop):(i=t._timelineResourceVCells,a=t.$.resourceVerticalScrollBar.value),!i)return 0;for(let e=0;e<i.length;e++){const t=i[e];if(t.top+t.height>a){n=t;break}s=t}return!n&&s&&(n=a>s.left?s:i[0]),n}_getProjectTasks(e,t){const i=this,a=i.groupByResources&&e.isGroup?"group":"project",n=i._tasks;if(!e||"project"!==e.type)return[];let s=[];for(let r=0,o=n.length;r<o;r+=1){const o=n[r];o.$[a]===e&&(s.push(o),"project"!==o.type||t||(s=s.concat(i._getProjectTasks(o,t))))}return s}_getSubTaskLimits(e){const t=this;if(!e)return;const i=e._cellObj.task,a=t._getProjectTasks(i);let n,s;if(!a.length)return;let r=a[0],o=a[0];for(let e=0;e<a.length;e++){const t=a[e];a[e].dateEnd&&a[e].dateStart&&(r.dateStart||(r=t[e]),o.dateEnd||(o=t[e]),a[e].dateEnd.getTime()>o.dateEnd.getTime()&&(o=a[e]),a[e].dateStart.getTime()<r.dateStart.getTime()&&(r=a[e]))}const l=t.$.timelineContent.offsetWidth;let d,c,m;if(r&&(d=t._getTimelineSubTaskOffset(r),d&&(c=d.left,m=d.width,n=Math.max(0,t.rightToLeft?l-e.offsetLeft-e.offsetWidth-(l-c-m):e.offsetLeft-c))),o&&(d=t._getTimelineSubTaskOffset(o),d))if(c=d.left,m=d.width,t.rightToLeft){const t=l-e.offsetLeft-e.offsetWidth;s=Math.max(t,t+l-(l-c))}else s=Math.max(e.offsetLeft,e.offsetLeft+l-(c+m));return{min:n,max:s}}_getTimelineSubTaskOffset(e){const t=this,i=t.$.timelineTasksContainer.children[t._tasks.filter((e=>!e.hidden)).indexOf(e)];let a,n,s;if(i)a=i.offsetLeft,s=i.offsetWidth;else{const i=t._getTimelineTaskCellByDate(e.dateStart),r=t._getTimelineTaskCellByDate(e.dateEnd);i&&(a=i.left+t._getTimelineTaskOffset(i,e.dateStart)||0),r&&(n=r.left+t._getTimelineTaskOffset(r,e.dateEnd)||0),s=n-a}return{left:a,width:s}}_getTaskDragLimits(e){const t=this,i=t._dragDetails,a=i.segment?i.segment.element:void 0,n=a&&a.previousElementSibling?{}:t._getTaskBarPositionLimits(e._cellObj.task,"DateStart"),s=a&&a.nextElementSibling?{}:t._getTaskBarPositionLimits(e._cellObj.task,"DateEnd"),r=t._dragDetails.taskDimensions;let o={};return(n.min||s.min)&&(o.min=Math.max(n.min||0,Math.max(0,(s.min||0)-r.width))),s.max&&(o.max=Math.max(0,s.max-r.width)),n.max&&(o.max=o.max?Math.min(n.max,o.max):n.max),o}_getTaskBarDateRange(e){if(!e)return;const t=this,i=e.classList.contains("milestone"),a=parseFloat(e.style.width)||e.offsetWidth,n=i?a/2:a,s=t.rightToLeft?parseFloat(e.style.right)||t.$.timelineContent.offsetWidth-e.offsetLeft-n:parseFloat(e.style.left)||e.offsetLeft,r=e._cellStart,o=e._cellEnd,l=e._cellObj.task,d=l.minDateStart,c=l.maxDateEnd;let m,u;return m=t._getDateFromCell(s,r),!d||"project"===e._cellObj.task.type&&e._cellObj.task.synchronized||(m=new Date(Math.max(d.getTime(),m.getTime()))),u=i?new Date(m):t._getDateFromCell(s+n,o),!c||"project"===e._cellObj.task.type&&e._cellObj.task.synchronized||(u=new Date(Math.min(c.getTime(),u.getTime()))),{dateStart:m,dateEnd:u}}_getTaskBarDetails(e,t,i){const a=this,n=e.task;if(!e)return;let s=new Date(n.dateStart);const r=new Date(n.dateEnd);if(!a._dragDetails&&a.snapToNearest){let s,r,o=n.dateStart,l=n.dateEnd;const d=new Date(t.date),c=a._getDateFromCell(t.left+t.width,t),m=new Date(i.date),u=a._getDateFromCell(i.left+i.width,i);return s=c.getTime()-o.getTime()>=c.getTime()-d.getTime()?t.left:t.left+t.width,"milestone"!==n.type&&(r=u.getTime()-l.getTime()>=l.getTime()-m.getTime()?i.left-s:i.left-s+i.width),{left:s,width:r,top:e.top}}let o,l,d,c,m,u;switch(a.view){case"quarter":case"year":{d=new Date(s.getFullYear(),s.getMonth()+1,0).getDate(),c=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();const e=s.getHours()/24+s.getMinutes()/1440+s.getSeconds()/86400,a=r.getHours()/24+r.getMinutes()/1440+r.getSeconds()/86400;o=t.left+(s.getDate()-1+e)/d*t.width,l=i.left+(r.getDate()-1+a)/c*i.width-o;break}case"month":"day"===a.monthScale?(m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*t.width,u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*t.width,o=t.left+m,l=i.left+(u-m)-t.left):(m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*(t.width/7),u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*(t.width/7),o=t.left+s.getDay()/7*t.width+m,l=i.left+r.getDay()/7*i.width-o+u);break;case"week":m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*t.width,u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*t.width,o=t.left+m,l=i.left+(u-m)-t.left;break;case"day":m=parseFloat(s.getMinutes()+s.getSeconds()/60)/60*t.width,u=parseFloat(r.getMinutes()+r.getSeconds()/60)/60*t.width,o=t.left+m,l=i.left+(u-m)-t.left}return{width:"milestone"===n.type?"":l,left:o,top:e.top}}_snapToNearestDates(e,t){const i=this;if(!i.snapToNearest)return;if(e.classList&&e._cellObj&&(e=e._cellObj.task),!e)return;let a=e.dateStart,n=e.dateEnd;const{cellStart:s,cellEnd:r}={cellStart:i._getTimelineCellByDate(a),cellEnd:i._getTimelineCellByDate(n)},o=new Date(s.date),l=i._getDateFromCell(s.left+s.width,s),d=new Date(r.date),c=i._getDateFromCell(r.left+r.width,r);if(a=l.getTime()-a.getTime()>=l.getTime()-o.getTime()?o:l,"milestone"!==e.type&&(n=c.getTime()-n.getTime()>=c.getTime()-d.getTime()?d:c),e.dateEnd=n,n.getTime()<a.getTime()&&(a=new Date(n)),e.dateStart=a,e.duration=e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0),!t&&e.segments&&e.segments.length>1){const t=e.segments;for(let e=0,a=t.length;e<a;e+=1)i._snapToNearestDates(t[e],!0);i._validateTaskSegments(e)}}_getTimelineTaskCellByDate(e){if(!e)return;const t=this,i=t.view,a=t._timelineCells;for(let n=0;n<a.length;n++){const s=a[n];if(t._isDateInCell(s.date,e,i))return s}}_isDateInCell(e,t,i){const a=this;switch(i){case"quarter":case"year":if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth())return!0;break;case"month":{let i=new Date(e);if(i.setDate(i.getDate()+(6-i.getDay())+1),i.setMilliseconds(i.getMilliseconds()-1),t.getTime()>=e.getTime()&&t.getTime()<=i.getTime())return!0;break}case"week":if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())return!0;break;case"day":if("hour"!==a.dayScale){if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes())return!0}else if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours())return!0}}_handleInverted(e){const t=this;function i(e){e||(e="task");const i=t.$[`${e}Splitter`];if(!t.$.mainSplitter.contains(i))return;const[a,n,s,r,o]="task"===e?[t.$.tableSplitterItem,t.$.timelineSplitterItem,t,t.$.taskTimelineContainer,"scrollTop"]:[t.$.resourceTableItem,t.$.resourceTimelineSplitterItem,t.$.resourceVerticalScrollBar,t.$.resourceTimelineContent,"value"],l=t.treeSize!==a.size?a.style[i._measurements.dimension]:t.treeSize;a.size="",i.removeChild(n),t.inverted&&!t.rightToLeft||!t.inverted&&t.rightToLeft?i.insertBefore(n,a):i.appendChild(n),a.size=l,r.scrollTop=s[o]}(!e||t.inverted||t.rightToLeft)&&(i("task"),i("resource"))}_createResourceTimeline(){const e=this;if(e._handleResourcePanelVisibility(),e.$.taskSplitterItem._setSize("size",e.taskPanelSize),!e._resources||!e.$.mainSplitter.contains(e.$.resourceTable))return;const t=e.$.resourceSplitterItemHeader.innerHTML;(e.resourcePanelHeaderTemplate&&!t||!e.resourcePanelHeaderTemplate&&t)&&e._handleHeaderTemplate("resource"),e._setTable(e.$.resourceTable),e._recycleResourceHeaderCells(),e._createResourceTimelineContent(),e._synchronizeSplitters(e.$.taskSplitter,e.$.resourceSplitter),e.$.resourceTimelineContent.scrollLeft=e.$.resourceTimelineHeader.scrollLeft=e.$.timelineHeader.scrollLeft,e.$.resourceSplitter.refresh(),e._refresh(),e._highlightAssignedItem("task",e._getSelection("task",e.selectedTaskIds))}_createResourceTimelineContent(){const e=this,t=e._timelineVCells,i=t.length?t[0].height:e._taskDefaultHeight;e._createResourceTimelineVCells(i);const a=e._timelineResourceVCells.length*i;e.$.resourceTimelineCellsContainer.style.height=a+"px",e.$.container.style.setProperty("--jqx-gantt-chart-resource-timeline-content-height",a+"px"),e._recycleResourceContent()}_recycleResourceContent(){const e=this;if(!e.$.mainSplitter.contains(e.$.resourceSplitterItem))return;const t=e._timelineResourceVCells,i=e.$.resourceTimelineCellsContainer,a=e._getFirstContentCellInView("resource"),n=e.$.tooltip;if(n&&i.contains(n.selector)&&e._closeTooltip(),!a)return void(i.innerHTML="");const s=t.indexOf(a),r=a.height,o=1-(a.top+r-Math.abs(e.$.resourceVerticalScrollBar.value))/r,l=t?t.length:0,d=!e.$.resourceSplitter.offsetHeight,c=e.$.resourceTimelineContent.offsetHeight,m=!d&&c?Math.min(l,Math.ceil((parseFloat((c/r).toFixed(2))+o).toFixed(2))):l,u=i.children,h=e.$.timelineViewCells.children,g=document.createDocumentFragment();for(;i.childElementCount>m;)i.lastElementChild.remove();for(let t=0;t<m;t+=1){let i=u[t];i||(i=document.createElement("div"),i.classList.add("jqx-timeline-row"),g.appendChild(i)),e._createTimelineRowCells(i,h)}g.childElementCount&&i.appendChild(g);const f=i.children,p=e._getSelection("resource",e.selectedResourceIds);for(let i=0;i<m;i+=1){const a=t[s+i],n=f[i];if(!a){n&&n.remove();continue}const r=a.resource,o=r.$.id;p.indexOf(o)>-1?n.setAttribute("selected",""):n.removeAttribute("selected"),n._cellObj=a,n.setAttribute("row-id",o),n.style.top=a.top+"px",e._refreshResourceTimelineContent(r,n)}}_createResourceTimelineVCells(e){const t=this,i=t._resources,a=t.$.resourceTable.rows,n=t._timelineResourceVCells=[];let s=0;if(void 0===e){const i=t._timelineVCells;e=i.length?i[0].height:t._taskDefaultHeight}for(let t=0,r=a.length;t<r;t+=1){const r=i[a[t].data.itemIndex];r.hidden||(n.push({top:s,height:e,resource:r}),s=parseFloat((s+e).toFixed(2)))}}_handleResourcePanelVisibility(){const e=this,t=e.$.container,i=e._resources.filter((e=>!e.hidden)),a=e.$.mainSplitter,n=e.$.resourceSplitterItem,s=e.$.taskSplitterItem;if(!i||!i.length||e.hideResourcePanel)return n&&!n.size&&(n._size=n.style[a._measurements.dimension]),e._resourceScrollView&&(e._resourceScrollView.unlisten(),delete e._resourceScrollView),s.size="",s.min="",e.$.resourceTable&&e.$.resourceTable.clearSelection(),a.contains(n)&&(a.removeChild(n),e._refresh()),e._highlightAssignedItem("resource"),void t.removeAttribute("show-resource-panel");a.contains(n)||(s.min=e.taskPanelMin,e._createResourcePanel(),e._setupResourcePanel(),e._resourceScrollView=new JQX.Utilities.Scroll(e.$.resourceSplitterItem,e.$.horizontalScrollBar,e.$.resourceVerticalScrollBar)),t.setAttribute("show-resource-panel",""),e._synchronizeSplitters(e.$.taskSplitter,e.$.resourceSplitter)}_createResourcePanel(){const e=this,t=e.$.mainSplitter;let i=e.$.resourceSplitterItem;if(!i){i=document.createElement("jqx-splitter-item"),i.classList.add("jqx-resource-splitter-item"),i.innerHTML=`<div jqx-id="resourceSplitterItemHeader" class="jqx-resource-panel-header"></div>\n <jqx-splitter jqx-id="resourceSplitter" wait class="jqx-resource-splitter" auto-fit-mode="end">\n <jqx-splitter-item jqx-id="resourceTableItem" class="jqx-resource-table-item">\n <jqx-table wait jqx-id="resourceTable" class="jqx-resource-table" virtualization deferred-scroll-delay="0"></jqx-table>\n </jqx-splitter-item>\n <jqx-splitter-item jqx-id="resourceTimelineSplitterItem" class="jqx-timeline-splitter-item">\n <div class="jqx-timeline" jqx-id="resourceTimeline">\n <div class="jqx-timeline-container" role="presentation">\n <div class="jqx-timeline-header" jqx-id="resourceTimelineHeader" role="rowgroup">\n <div class="jqx-timeline-view-cells" jqx-id="resourceTimelineViewCells" role="row"></div>\n </div>\n <div jqx-id="resourceTimelineContent" class="jqx-timeline-content" role="rowgroup">\n <div jqx-id="resourceTimelineCellsContainer" class="jqx-timeline-cells-container" aria-hidden="true"></div>\n </div>\n </div>\n </div>\n <jqx-scroll-bar wait jqx-id="resourceVerticalScrollBar" class="jqx-timeline-scroll-bar jqx-resource-scroll-bar" \n orientation="vertical" aria-controls="[[${e.id||""}]]">\n </jqx-scroll-bar>\n </jqx-splitter-item>\n </jqx-splitter>`,t.contains(i)||t.appendChild(i);const a=JQX.Utilities,n=i.querySelectorAll(".jqx-resource-panel-header, .jqx-resource-splitter, .jqx-resource-table-item, \n .jqx-resource-table, .jqx-timeline-splitter-item, .jqx-timeline, .jqx-timeline-header, .jqx-timeline-view-cells, .jqx-timeline-content,\n .jqx-timeline-cells-container, .jqx-timeline-scroll-bar"),[s,r,o,l,d,c,m,u,h,g,f]=n;e.$.resourceSplitterItem=i,e.$resourceSplitterItem=a.Extend(i),e.$.resourceSplitterItemHeader=s,e.$resourceSplitterItemHeader=a.Extend(s),e.$.resourceSplitter=r,r.hasResizeObserver=!1,r.wait=!1,e.$resourceSplitter=a.Extend(r),e.$.resourceTableItem=o,e.$resourceTableItem=a.Extend(o),e.$.resourceTable=l,l.hasResizeObserver=!1,e.$resourceTable=a.Extend(l),e.$.resourceTimelineSplitterItem=d,e.$resourceTimelineSplitterItem=a.Extend(d),e.$.resourceTimelineViewCells=u,e.$resourceTimelineViewCells=a.Extend(u),e.$.resourceTimeline=c,e.$resourceTimeline=a.Extend(c),e.$.resourceTimelineContent=h,e.$resourceTimelineContent=a.Extend(h),e.$.resourceTimelineHeader=m,e.$resourceTimelineHeader=a.Extend(m),e.$.resourceTimelineCellsContainer=g,e.$resourceTimelineCellsContainer=a.Extend(g),e.$.resourceVerticalScrollBar=f,e.$resourceVerticalScrollBar=a.Extend(f)}}_setupResourcePanel(){const e=this,t=e.rightToLeft,i=e.$.resourceSplitterItem,a=e.$.resourceTableItem,n=e.$.resourceTable,s=e.$.resourceTimelineSplitterItem,r=e.$.resourceVerticalScrollBar;e.$.mainSplitter.contains(i)?([e.$.resourceSplitter,n,e.$.resourceVerticalScrollBar].forEach((e=>e.rightToLeft=t)),n.$.virtualizationContainer._scrollView.disableSwipeScroll=!0,n.$.virtualizationContainer.verticalScrollBarVisibility="hidden",n.$.virtualizationContainer.disabled=!0,a.size=e.treeSize,a.min=e.treeMin,s.min=e.timelineMin,i.min=e.resourcePanelMin,i.size=i._size||e.resourcePanelSize,r.hasStyleObserver=!1,r.hasResizeObserver=!1,r.wait=!1):e.$.mainSplitter.appendChild(i)}_refreshResourceTimeline(){const e=this;e._resources&&e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._recycleResourceHeaderCells(),e._recycleResourceContent())}_getResourceCellWorkTime(e,t){const i=e.dateStart,a=e.dateEnd,n=t.dateStart,s=t.dateEnd,r=e.dateStart.getTime()<n.getTime()?n:i,o=a.getTime()>s.getTime()?s:a,l=Math.round(this._getWorkingTime(r,o)/36e5);return{value:Math.max(0,l),max:r.getTime()===n.getTime()&&o.getTime()===s.getTime()?l:Math.round(this._getWorkingTime(n,s)/36e5)}}_refreshResourceTimelineContent(e,t){const i=this,a=i._resources.indexOf(e),n=i._getResourceTasks(e);if(t||(t=(()=>{const t=i.$.resourceTimelineCellsContainer.children;for(let i=0,a=t.length;i<a;i+=1){const a=t[i];if(a._cellObj&&a._cellObj.resource===e)return a}})()),a<0||!t||!t.childElementCount)return;let s=t.children;const r=i.$.resourceTimelineViewCells.children,o=i._tasks.filter((e=>!e.hidden));for(let t=0,l=s.length;t<l;t+=1){const l=s[t];let d,c=l.firstElementChild;n.length&&!e.hidden?(c?(c.classList.remove("hide-left-border","hide-right-border"),c.removeAttribute("load"),c.innerHTML=c.style.height=""):(c=document.createElement("div"),c.classList.add("jqx-resource-timeline-view-cell"),d=!0),e.class&&c.classList.add(e.class),i._setResourceCellLoad({cell:c,cellIndex:t,resource:e,resourceCell:l,resourceIndex:a,resourceTasks:n,tasks:o,viewCells:r}),c.hasAttribute("load")?d&&l.appendChild(c):c.remove()):c&&c.remove()}}_setResourceCellLoad(e){const t=this,i=t.resourceTimelineFormatFunction,{cell:a,cellIndex:n,resource:s,resourceCell:r,resourceIndex:o,resourceTasks:l,tasks:d,viewCells:c}=e;let m={};for(let e=0,u=l.length;e<u;e+=1){const u=l[e];if(u.hidden)continue;const h=d.indexOf(u),g=t._getCellDateRange(c[n]),{dateStart:f,dateEnd:p}=g;if(!f||f.getTime()>=u.dateEnd.getTime()||p.getTime()<=u.dateStart.getTime())continue;if(m[n]&&m[n].indexOf(h)<0?m[n].push(h):m[a]||(m[n]=[h]),"custom"===t.resourceTimelineMode){i&&(a.innerHTML=i.call(t,m[n]||[],o,new Date(f))||"");continue}const _=t._getResourceCellCapacity({cell:a,cellDateRange:g,cellTaskIndexAssigned:m,index:o,resource:s,task:u,cellIndex:n});if(!_)continue;const{capacity:T,maxCapacity:b}=_,k=parseFloat(((parseFloat(a.getAttribute("load"))||0)+(T||0)).toFixed(1));k>b?a.classList.add("warning"):a.classList.remove("warning"),"histogram"!==t.resourceTimelineMode?k&&a.setAttribute("load",k):t._setCellHistogram({cell:a,load:k,maxCapacity:b,previousViewCell:r.previousElementSibling})}}_getResourceCellCapacity(e){const t=this,i=t.resourceTimelineView,{cell:a,cellDateRange:n,cellTaskIndexAssigned:s,index:r,resource:o,task:l,cellIndex:d}=e;let c,m;if("tasks"===i)c=1,m=o.maxCapacity;else if("hours"===i){const e=t._getResourceCellWorkTime(l,n),i=e.max/24;c=parseFloat((e.value/e.max*o.capacity*i).toFixed(1)),m=Math.min(e.max,parseFloat((o.maxCapacity*i).toFixed(1)))}else{const e=t.resourceTimelineFormatFunction;if(!e)return;let i=e.call(t,s[d]||[],r,new Date(n.dateStart));if(null!=i)if(i="object"!=typeof i?[i]:Object.values(i),2===i.length)c=parseFloat(i[0])||0,m=parseFloat(i[1])||0;else if(1===i.length)return void(a&&a.setAttribute("load",i[0]))}return{capacity:c,maxCapacity:m}}_setCellHistogram(e){const{load:t,cell:i,maxCapacity:a,previousViewCell:n}=e,s=Math.min(100,100*parseFloat((t/a).toFixed(2))),r=n?n.firstElementChild:void 0;if(r){const e=parseFloat(r.style.height)||0;s?e===s?(i.classList.add("hide-left-border"),r.classList.add("hide-right-border")):e>s?(i.classList.add("hide-left-border"),r.classList.remove("hide-right-border")):e<s&&(i.classList.remove("hide-left-border"),r.classList.add("hide-right-border")):(i.classList.remove("hide-left-border"),r.classList.remove("hide-right-border"))}i.style.height=s+"%",t&&i.setAttribute("load",t+"/"+a)}_recycleResourceHeaderCells(){const e=this;if(!e.$.mainSplitter.contains(e.$.resourceSplitterItem))return;const t=e.$.resourceTimelineViewCells,i=t.children,a=e.$.timelineViewCells.children;let n=document.createDocumentFragment();for(;i.length>a.length;)i[0].remove();for(let e=0;e<a.length;e++){const t=a[e];let s=i[e];s||(s=t.cloneNode(!0),n.appendChild(s)),s.style.left=t.style.left,s.style.right=t.style.right,s.style.width=t.style.width,s.innerHTML=t.innerHTML,s._date=t._date,t.hasAttribute("weekend")?s.setAttribute("weekend",""):s.removeAttribute("weekend"),t.hasAttribute("nonworking")?s.setAttribute("nonworking",""):s.removeAttribute("nonworking")}n.childElementCount&&t.appendChild(n),e.$.resourceTimelineCellsContainer.style.width=e.$.resourceTimelineViewCells.style.width=e.$.timelineContent.style.width}_refreshResourceScrollBar(){const e=this,t=e.$.resourceVerticalScrollBar;if(!e.$.mainSplitter.contains(e.$.resourceSplitter))return;const i=Math.max(0,e.$.resourceTimelineCellsContainer.offsetHeight-e.$.resourceTimelineContent.offsetHeight);0===i&&"visible"===e.verticalScrollBarVisibility?(t.max=1,e.scrollHeight||e.$container.removeClass("vscroll")):i&&e.$container.addClass("vscroll"),t.max=i,t.disabled="disabled"===e.verticalScrollBarVisibility||e.disabled||i<=0,!e.$.container.classList.contains("vscroll")&&t.disabled?t.classList.add("jqx-hidden"):(t.classList.remove("jqx-hidden"),t.refresh(),e.$.container.classList.contains("hscroll")?e.$.horizontalScrollBar.classList.add("bottom-corner"):e.$.container.classList.contains("vscroll")||e.$.horizontalScrollBar.classList.remove("bottom-corner"))}_handleResources(e){const t=this,i=e?[e]:t._tasks;t._resources||(t._resources=[]);for(let e=0;e<i.length;e++){let a=i[e].resources;Array.isArray(a)||(a=[a].reduce(((e,t)=>e.concat(t)),[]));for(let n=0;n<a.length;n++){let s=a[n];if("object"!=typeof s||!s||void 0===s.id||null===s.id){"number"==typeof s&&(a[n]=s+"");continue}let r=t._resources.find((e=>e.id&&e.id.toString()===s.id.toString()))||{};t._setResource(r,s,i[e]),a[n]=r.id,Object.values(r).length&&!t._resources.includes(r)&&t._resources.push(r)}}t._refreshItemIds("resource");const a=t._resources;for(let e=0,i=a.length;e<i;e+=1)t._refreshResource(a[e])}_refreshAssignedResources(e,t=[]){const i=this;if(!e.$.id||i._tasks.indexOf(e)<0)return;const a=i._getTaskResources(e);for(let e=0;e<a.length;e++){const n=a[e];let s=[];i.resourceColumns.forEach((e=>{void 0!==e.formatFunction&&s.push(e.value)})),s.concat(t),i.$.mainSplitter.contains(i.$.resourceSplitter)&&i._refreshResourceTimelineContent(n),t.includes("workload")?i._refreshResource(n,"workload"):t.includes("progress")&&i._refreshResource(n,"progress"),s.length&&i._refreshTableColumnsData(n,s,"resource")}}_refreshResource(e,t){const i=this;if(!i._resources.length)return;const a=i._getResourceTasks(e),n=864e5;switch(t){case"progress":e.progress=parseFloat((a.reduce(((e,t)=>e+t.progress),0)/a.length).toFixed(2));break;case"workload":e.workload=parseFloat((i._convertDuration(a.reduce(((e,t)=>e+t.duration),0))/n*e.maxCapacity).toFixed(2));break;default:e.progress=parseFloat((a.reduce(((e,t)=>e+t.progress),0)/a.length).toFixed(2)),e.workload=parseFloat((i._convertDuration(a.reduce(((e,t)=>e+t.duration),0))/n*e.maxCapacity).toFixed(2))}i.$.mainSplitter.contains(i.$.resourceSplitter)&&i._refreshResourceTimelineContent(e)}_setResource(e,t){if(t&&"object"==typeof t)return e.id?e.id=e.id.trim():e.id=(t.id+"").trim(),e.$||(e.$={}),e.class=t.class||e.class,e.minCapacity=t.minCapacity||e.minCapacity||0,e.maxCapacity=t.maxCapacity||e.maxCapacity||24,e.progress=t.progress||e.progress||0,e.capacity=t.capacity||e.capacity||8,e.type=t.type||e.type,e.hidden=!!("boolean"==typeof t.hidden?t.hidden:e.hidden),e.workload=e.workload||0,t.label?e.label=t.label:void 0===e.label&&(e.label=""),t.value&&(e.value=t.value),e}insertResource(e,t){const i=this,a=Array.from(arguments).filter((e=>void 0!==e));let n,s=i._resources;if(1===a.length&&(t=a[0]),"object"!=typeof t)return void i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"insertResources",argumentName:"resource"}));if(t.id&&s.find((e=>e.id&&e.id.toString()===t.id.toString())))return void i.updateResource(t.id,t);if(t.assignedTo&&(n=[t.assignedTo].reduce(((e,t)=>e.concat(t,[])))),!(t=i._setResource({},t)))return;i._refreshItemIds("resource"),s=i._resources;const r=i._getValidItemAndIndex(e,"resource").index;if(r<0?s.push(t):s.splice(r,0,t),i._tasks.length){if(void 0!==n){Array.isArray(n)||(n=[n]);for(let e=0,a=n.length;e<a;e+=1){const a=i._getValidItemAndIndex(n[e],"task");if(a){const e=a.item;!e||e.disableResources||e.resources.includes(t.id.toString())||e.resources.push(t.id)}}if(i._isUpdating)return void(i._isUpdating.type.resource=!0);i._highlightAssignedItem("task",i._getSelection("task",i.selectedTaskIds)),i._refreshResource(t)}if(i._isUpdating)return i._isUpdating.type.resource=!0,void(i._isUpdating.type.task=!0);if(i.groupByResources)i._refreshTableDataSource(),i._refreshTimeline();else if(i.taskColumns.find((e=>"resources"===e.value))){const e=i._tasks.filter((e=>e.resources.includes(t.id)));for(let t=0;t<e.length;t++)i._refreshTableColumnsData(e[t],["resources"])}}i._isUpdating?i._isUpdating.type.resource=!0:(i._createResourceTimeline(),i.$.fireEvent("itemInsert",{type:"resource",item:i._cloneObject(t)}))}_insertTimelineResource(e,t,i){const a=this,n=a.$.resourceTimelineCellsContainer,s=document.createElement("div");s.classList.add("jqx-timeline-row"),s._resource=t,a._refreshResourceTimelineContent(t,s),a.$.resourceTimelineCellsContainer.insertBefore(s,e>-1?n.children[e]:void 0),a.$.container.style.setProperty("--jqx-gantt-chart-resource-timeline-content-height",n.offsetHeight+"px"),a._refreshResourceScrollBar(),a._insertNewTreeItem(e,t,i,"resource"),a.$.resourceTree.refresh(),a._highlightAssignedItem("task",a._getSelection("task",a.selectedTaskIds))}updateResource(e,t){if(void 0===e)return;const i=this._getValidItemAndIndex(e,"resource");i&&i.item&&this._updateResource(i.item,t)}removeResource(e){if(void 0===e)return;const t=this._getValidItemAndIndex(e,"resource");t&&t.item&&this._removeResource(t.item)}_getResourceTasks(e){const t=this._resources,i=this._tasks;if(!e||!t.length||!i.length)return;let a=[];for(let t=0;t<i.length;t++)i[t].resources.includes(e.id)&&a.push(i[t]);return a}_getTaskResources(e){const t=this;if(!e)return[];const i=[e.resources].reduce(((e,t)=>e.concat(t)),[]);let a=[];for(let e=0;e<i.length;e++){const n=t._resources.find((t=>t.id&&t.id.toString()===i[e].toString()));n&&a.push(n)}return a}_resourceValidator(e,t){const i=this;return Array.isArray(t)||t instanceof JQX.ObservableArray||"number"==typeof t||"string"==typeof t||null==t?t:(i.error(i.localize("invalidValue",{elementType:i.nodeName.toLowerCase(),property:"resources",typeOne:"array",typeTwo:"number"})),null)}_handleTaskProgressChange(e){const t=this,i=t._dragDetails.task,a=t._dragDetails.timelineTask;if(t.disableTaskProgressChange)return;if(!t.hasAttribute("progress-change")){if(t.$.fireEvent("progressChangeStart",{id:"string"==typeof i.id||"number"==typeof i.id?i.id:i.$.id,item:t._cloneObject(i),progress:i.progress||0}).defaultPrevented)return void delete t._dragDetails.target;t._closeTooltip(),t.setAttribute("progress-change",""),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}const{left:n,width:s}=a.getBoundingClientRect(),r=e.pageX-window.pageXOffset;t._dragDetails.progress||(t._dragDetails.progress=i.progress/100*s),t._dragDetails.progress=Math.max(0,Math.min(s,t._dragDetails.progress+(t.rightToLeft?-1:1)*(r-t._dragDetails.coordinates.x))),t._dragDetails.coordinates.x=Math.max(n+t._dragDetails.offset.x,Math.min(n+s+t._dragDetails.offset.x,r));const o=t._dragDetails.task.progress=t._dragDetails.progress/s*100;i.progress=parseFloat(o.toFixed(2)),t._setTaskBarProgress(i,a),t._refreshTableColumnsData(i,["progress"]),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(i,["progress"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleTaskSegmentDrag(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=n._segmentObj;if(!s||s.disableDrag)return;const r=i.task,o=t._dragDetails.timelineTask,l=a.isFirstSegment,d=a.isLastSegment,c=t.rightToLeft,m=c?"right":"left";i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===r)));const u=i.timelineRow;if(!t.hasAttribute("dragged")){if(t.$.fireEvent("dragStart",{id:"string"==typeof r.id||"number"==typeof r.id?r.id:r.$.id,item:t._cloneObject(r),dateStart:r.dateStart,dateEnd:r.dateEnd,segment:t._cloneObject(s)}).defaultPrevented)return void delete i.timelineTask;if(t.setAttribute("dragged",""),t._closeTooltip(),t._touchmoveInside=!0,l||d){const e=t._createDelimiter("min-date"),i=t._createDelimiter("max-date");e&&u.appendChild(e),i&&u.appendChild(i)}}if(l){const a=i.size?i.size.width:i.originalSize.width;t._handleTaskResize(e,c?"right":"left"),i.segments||(i.segments=o.querySelectorAll(".jqx-task-segment"));const n=i.size.width-a,s=i.segments;for(let e=0,t=s.length;e<t;e+=1){const t=s[e];0!==e&&(t.style[m]=(parseFloat(t.style[m])||t.offsetLeft)+n+"px")}}else{if(!d)return void t._handleSegmentDrag(e);{const s=a.dimensions;t._handleTaskResize(e,c?"left":"right"),n.style[m]=i.size.width-s.width+"px"}}t._refreshTask(o,[n]),t._refreshProject(r.$.project),t.groupByResources&&t._refreshProject(r.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(o._cellObj.task),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleSegmentDrag(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=i.task,r=t._dragDetails.timelineTask,o=t.rightToLeft,l=o?"right":"left";i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===s)));const d=i.timelineRow,{left:c}=d.getBoundingClientRect(),m=i.taskDimensions.left;a.position||(a.position={x:a.originalPosition.x});const u=r.offsetWidth,h=e.pageX-window.pageXOffset;let g=0,f=a.min.left||0,p=a.max.left;o&&(f=u-(f+a.dimensions.width),p=u-p),a.position.x=Math.max(f,Math.min(p,a.position.x+(o?-1:1)*(h-i.coordinates.x))),void 0!==p&&(g=o?m+a.min.left:m+a.max.left,a.position.x=Math.min(p,a.position.x)),f=m+(o?a.max.left-a.dimensions.width:f),i.coordinates.x=Math.max(c+a.offset.x+f,Math.min(c+a.offset.x+g,h)),n.style[l]=a.position.x+"px",t._refreshTaskSegments(r,[n])}_handleTaskBarDrag(e){const t=this;if(t.disableTaskDrag)return;const i=t._dragDetails;if(Math.abs(e.pageX-i.coordinates.x)<=5)return void(t._scrollView.disableSwipeScroll=!0);if(i.segment)return void t._handleTaskSegmentDrag(e);const a=i.task,n=i.timelineTask;i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===a)));const s=i.timelineRow;if(!t.hasAttribute("dragged")){if(t.$.fireEvent("dragStart",{id:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,item:t._cloneObject(a),dateStart:a.dateStart,dateEnd:a.dateEnd}).defaultPrevented)return void delete i.timelineTask;t.setAttribute("dragged",""),t._closeTooltip(),t._touchmoveInside=!0;const e=t._createDelimiter("min-date"),n=t._createDelimiter("max-date");e&&s.appendChild(e),n&&s.appendChild(n)}i.position||(i.position={x:i.originalPosition.x,y:i.originalPosition.y});const r=s.getBoundingClientRect().left,o=s.offsetWidth,l=n.offsetWidth,d=i.min.left||0,c=i.max.left,m=e.pageX-window.pageXOffset,u=t.rightToLeft;let h=0;i.position.x=Math.max(d,Math.min(o-l,i.position.x+(u?-1:1)*(m-i.coordinates.x))),void 0!==c&&(i.position.x=Math.min(c,i.position.x),h=o-l-c),i.coordinates.x=u?Math.max(r+i.offset.x+h,Math.min(r+o-(l-i.offset.x+d),m)):Math.max(r+i.offset.x+d,Math.min(r+o-(l-i.offset.x+h),m));const g=a.dateStart.getTime(),f=a.dateEnd.getTime();n.style[u?"right":"left"]=i.position.x+"px",t._refreshTask(n),t._refreshProject(a.$.project),t.groupByResources&&t._refreshProject(a.$.group),"project"===a.type&&a.dragProject&&t._refreshProjectTasks(a,{startTime:a.dateStart.getTime()-g,endTime:a.dateEnd.getTime()-f}),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(n._cellObj.task),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleTaskBarResize(e){const t=this;if(t.disableTaskResize)return;const i=t._dragDetails;if(i.segment)return void t._handleTaskSegmentResize(e);const a=i.timelineTask,n=i.task;if(!t.hasAttribute("resized")){if(t.$.fireEvent("resizeStart",{id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:n.dateStart,dateEnd:n.dateEnd}).defaultPrevented)return void t.$.timeline.removeAttribute("task-bar-hovered");t.setAttribute("resized",""),t._closeTooltip(),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}t._handleTaskResize(e,t.$.timeline.getAttribute("task-bar-hovered")),t._updateSegmentsOnTaskResize(),t._refreshTask(a),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(a._cellObj.task,["workload"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_updateSegmentsOnTaskResize(){const e=this,t=e._dragDetails,i=t.task,a=t.timelineTask;if(!i||!i.segments)return;let n;t&&t.segments?n=t.segments:t.segments=n=a.querySelectorAll(".jqx-task-segment");const s=n.length,r=t.size.width,o=e.rightToLeft?"right":"left";for(let t=0;t<s;t+=1){const i=n[t],a=i.style.width?parseFloat(i.style.width):i.offsetWidth,l=i.style[o]?parseFloat(i.style[o]):0;if(l+a>r){const t=r-(l+a),n=a+t;n<e._taskBarMinWidth&&(i.style[o]=l+t+"px"),i.style.width=n+"px"}else t===s-1&&(i.style.width=r-l+"px")}}_handleTaskSegmentResize(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=n._segmentObj;if(!s||s.disableResize)return;const r=i.task,o=t._dragDetails.timelineTask,l=a.isFirstSegment,d=a.isLastSegment,c=t.rightToLeft,m=c?"right":"left";if(!t.hasAttribute("resized")){if(t.$.fireEvent("resizeStart",{id:"string"==typeof r.id||"number"==typeof r.id?r.id:r.$.id,item:t._cloneObject(r),dateStart:r.dateStart,dateEnd:r.dateEnd,segment:t._cloneObject(s)}).defaultPrevented)return void t.$.timeline.removeAttribute("task-bar-hovered");t.setAttribute("resized",""),t._closeTooltip(),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}const u=t.$.timeline.getAttribute("task-bar-hovered");if(l&&("left"===u&&!c||"right"===u&&c)){const s=i.size?i.size.width:i.originalSize.width;void 0===a.size&&(a.size={width:a.originalSize.width}),t._handleTaskResize(e,u),i.segments||(i.segments=o.querySelectorAll(".jqx-task-segment"));const r=i.size.width-s,l=i.segments;for(let e=0,t=l.length;e<t;e+=1){const t=l[e];0!==e&&(t.style[m]=(parseFloat(t.style[m])||t.offsetLeft)+r+"px")}n.style.width=(a.size.width+=r)+"px"}else{if(!d||!("right"===u&&!c||"left"===u&&c))return t._handleSegmentResize(e,u),void t._refreshTaskSegments(o,[n]);{const s=i.size?i.size.width:i.originalSize.width;void 0===a.size&&(a.size={width:a.originalSize.width}),t._handleTaskResize(e,u),n.style.width=(a.size.width+=i.size.width-s)+"px"}}t._refreshTask(o,[n]),t._refreshProject(r.$.project),t.groupByResources&&t._refreshProject(r.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(o._cellObj.task,["workload"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleSegmentResize(e,t){const i=this,a=i._dragDetails,n=a.task,s=a.segment,r=s.element,o=i.rightToLeft,l=a.taskDimensions.left;a.timelineRow||(a.timelineRow=Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===n)));const d=a.timelineRow;s.position||(s.position={x:s.originalPosition.x}),s.size||(s.size={width:s.originalSize.width});const c=e.pageX-window.pageXOffset;let m=s.size.width,u=s.min.width||0,h=s.max.width,g=s.min.left||0,f=s.max.left,p=r.offsetLeft,{left:_}=d.getBoundingClientRect(),T="object"==typeof e?c-a.coordinates.x:e;if(_+=l,"left"===t&&!o||"right"===t&&o)if(o){const e=a.taskDimensions.width;T=T<0?-1*Math.min(Math.abs(T),m-u):Math.min(h-m,Math.abs(T)),m=Math.max(u,Math.min(h,m+T)),r.style.left="",r.style.right=(p=Math.max(e-g,(parseFloat(r.style.right)||d.offsetWidth-p-m)-T))+"px",a.coordinates.x=Math.max(_+e-p+u,Math.min(_+e-p,c))}else T=T>0?Math.min(T,m-(u||0)):-1*Math.min(h-m,Math.abs(T)),m=Math.max(u,Math.min(p+m,m-T)),r.style.right="",r.style.left=(p=Math.max(g,(parseFloat(r.style.left)||p)+T))+"px",a.coordinates.x=Math.max(_+g+u,Math.min(_+p+m-u,c));else o?(T<0&&(T=-1*Math.min(h-m,Math.abs(T))),m=Math.max(u,Math.min(p+m,m-T)),f-=s.dimensions.width,a.coordinates.x=Math.max(_+f,Math.min(_+f+h,c))):(T>0&&(T=Math.min(h-m,T)),m=Math.max(u,Math.min(h,m+T)),a.coordinates.x=Math.max(_+p+u,Math.min(_+p+h,c)));r.style.width=(s.size.width=m)+"px"}_handleTaskResize(e,t){const i=this,a=i._dragDetails,n=a.task;a.position||(a.position={x:a.originalPosition.x,y:a.originalPosition.y}),a.size||(a.size={width:a.originalSize.width}),a.timelineRow||(a.timelineRow=Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===n)));const s=a.timelineRow,r=a.timelineTask,o=a.segment,l=e.pageX-window.pageXOffset;let d=a.size.width,c=a.min.width||0,m=a.max.width,u=s.getBoundingClientRect().left,h=i.rightToLeft,g="object"==typeof e?l-a.coordinates.x:e;if("left"===t&&!h||"right"===t&&h)if(o&&(h?(u-=o.dimensions.width-o.offset.x,c=Math.max(o.max.left+o.min.width,c)):(u+=o.offset.x,c=Math.max(a.taskDimensions.width-o.max.left+o.min.width,c))),h){g<0?g=-1*Math.min(Math.abs(g),d-(c||0)):void 0!==m&&(g=Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(s.offsetWidth-r.offsetLeft,d+g));const e=r.offsetLeft;r.style.left="",r.style.right=(a.position.x=Math.max(0,(parseFloat(r.style.right)||s.offsetWidth-r.offsetLeft-r.offsetWidth)-g))+"px",a.coordinates.x=Math.max(u+r.offsetLeft+c,Math.min(u+e+d,l))}else g>0?g=Math.min(g,d-(c||0)):void 0!==m&&(g=-1*Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(r.offsetLeft+d,d-g)),r.style.right="",r.style.left=(a.position.x=Math.max(0,(parseFloat(r.style.left)||r.offsetLeft)+g))+"px",a.coordinates.x=Math.max(u+r.offsetLeft,Math.min(u+r.offsetLeft+d-c,l));else h?(o&&(u+=o.offset.x,c=Math.max(a.taskDimensions.width-o.min.left+o.min.width,c)),g<0&&void 0!==m&&(g=-1*Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(r.offsetLeft+r.offsetWidth,d-g)),r.style.width=a.size.width+"px",a.coordinates.x=Math.max(u+r.offsetLeft,Math.min(u+r.offsetLeft+d-c,l))):(o&&(u-=o.dimensions.width-o.offset.x,c=Math.max(o.min.left+o.min.width,c)),g>0&&void 0!==m&&(g=Math.min(m-d,g)),d=a.size.width=Math.max(c,Math.min(s.offsetWidth-r.offsetLeft,d+g)),a.coordinates.x=Math.max(u+r.offsetLeft+c,Math.min(u+r.offsetLeft+(m||d),l)));r.style.width=a.size.width+"px"}_handleTimelineConnectionHover(e){const t=this;if(!(t.shadowRoot||t).contains(e))return;const i=t.$.timelineConnectionsContainer.children,a=e.closest(".jqx-task-connection");if(a||!t.$.timelineConnectionsContainer.querySelector(".jqx-task-connection[hover]")){if(a){const e=a.getAttribute("connection-id");for(let t=0;t<i.length;t++){const a=i[t];a.getAttribute("connection-id")===e?a.setAttribute("hover",""):a.removeAttribute("hover")}t._hoveredConnectionTasks=a.tasks}}else for(let e=0;e<i.length;e++)i[e].removeAttribute("hover")}_resetItemHover(){const e=this;if(e._hoveredItem){const t=e.$.mainSplitter.querySelectorAll(".jqx-timeline-task[hover], .jqx-timeline-row[hover], tr[hover]");for(let e=0;e<t.length;e++)t[e].removeAttribute("hover");e.$.timeline.removeAttribute("task-bar-hovered"),delete e._hoveredItem}}_handleTimelineHover(e,t){const i=this,a=i._isMobile;if(!e||a)return void i._resetItemHover();const n=e.originalEvent||e;let s="task",r=n.pageX&&a?document.elementFromPoint(n.pageX-window.pageXOffset,n.pageY-window.pageYOffset):n.target;if(n.pageX&&i.shadowRoot&&r===i&&(r=n.pageX&&a?i.shadowRoot.elementFromPoint(n.pageX-window.pageXOffset,n.pageY-window.pageYOffset):n.composedPath()[0]),!r||!r.closest||r===i||t)return void i._resetItemHover();i.$.resourceSplitter&&i.$.resourceSplitter.contains(r)?s="resource":i._handleTimelineConnectionHover(r);let o=r.closest(".jqx-timeline-row")||r.closest(".jqx-timeline-task");if(!o||!(i.shadowRoot||i).contains(o))return void i._resetItemHover();const l=o._cellObj[s],d=l.$.id,c=i._hoveredItem;if(!(c&&c.type===s&&c.id===d||(i._resetItemHover(),l.isGroup||("task"===s&&o.classList.contains("jqx-timeline-row")&&(o=i.$.timelineTasksContainer.querySelector(`.jqx-timeline-task[row-id="${d}"]`)),!o||i._connectionFeedback&&o.contains(i._connectionFeedback)||(o.setAttribute("hover",""),i._hoveredItem={id:d,type:s},a))))){const e=("task"===s?i.$.taskTimelineCellsContainer:i.$.resourceTimelineCellsContainer).querySelector(`.jqx-timeline-row[row-id="${d}"]`);e&&(e.setAttribute("hover",""),i._handleTableItemHover(d,r))}}_getScrollLeft(e){return this.rightToLeft?e*=-1:e}_synchronizeSplitters(e,t){if(this.$.mainSplitter.contains(this.$.resourceSplitter)){const i=e._measurements,a=e.items,n=t.items,[s,r,o]=[i.dimension,i.minDimension,i.maxDimension],[l,d]=[n[0],a[0]],[c,m]=[n[1],a[1]];t.keepProportionsOnResize=!0,t.setAttribute("orientation-change",""),[r,o,s].forEach((e=>{const t=e===s?"size":e===r?"min":"max";l.set(t,""),c.set(t,""),l[t]=d.style[e],c[t]=m.style[e]})),t.removeAttribute("orientation-change"),t.keepProportionsOnResize=!1}}_resizeEventHandler(e){const t=this,i=t.$.taskSplitter;function a(e){e.refresh(),e===i&&t._synchronizeSplitters(i,t.$.resourceSplitter)}if(e&&"resizeEnd"===e.type){if(e.target===t.$.taskTreeSplitter||e.target===t.$.resourceTreeSplitter)return void a(e.target);e.target===t.$.resourceSplitter&&t._synchronizeSplitters(t.$.resourceSplitter,i)}if(!t._timelineCells)return void t._refresh();t.$.mainSplitter.refresh(),a(i);const n=t._getScrollLeft(t.scrollLeft);t._autoSchedule(),t._createTimelineCells(),t._recycleTimelineTasks(),t._recycleTimelineRowCells(),t._refreshResourceTimeline(),t._refresh(),t.$.taskTable.refresh(),t.$.timelineHeader.scrollLeft=t.$.taskTimelineContainer.scrollLeft=n,t.$.taskTable.scrollTop=t.$.taskTimelineContainer.scrollTop=t.scrollTop,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&(t.$.resourceTimelineHeader.scrollLeft=t.$.resourceTimelineContent.scrollLeft=n,t.$.resourceTable.refresh(),t.$.resourceTable.scrollTop=t.$.resourceTimelineContent.scrollTop=t.$.resourceVerticalScrollBar.value),t._positionWindow()}_recycle(e){const t=this,i=e&&"horizontal"===e.context.orientation;if(e&&!i||(t._recycleHeaderCells(t.$.timelineViewCells),t._recycleHeaderCells(t.$.timelineViewDetails),t.$.timelineViewSubDetails.classList.contains("jqx-hidden")||t._recycleHeaderSubCells(t.$.timelineViewSubDetails),t._recycleResourceContent()),i)return;if(t._recycleResourceContent(),t._recycleContentCells(),t._recycleTimelineTasks(),!e)return;const a=Math.round(e.detail.value);e.target!==t.$.resourceVerticalScrollBar?t._refreshTableScrollTop(t.$.taskTable,a):t._refreshTableScrollTop(t.$.resourceTable,a)}_recycleContentCells(){const e=this,t=e._getFirstContentCellInView(),i=e.$.taskTimelineCellsContainer,a=e.$.timelineTasksContainer;if(!t)return void(i.innerHTML=a.innerHTML="");const n=t.height,s=1-(t.top+n-Math.abs(e.scrollTop))/n,r=e._timelineVCells?e._timelineVCells.length:0,o=!e.$.taskSplitter.offsetHeight,l=e.$.taskTimelineContainer.offsetHeight,d=!o&&l?Math.min(r,Math.ceil((parseFloat((l/n).toFixed(2))+s).toFixed(2))):r,c=e.$.timelineViewCells.children,m=document.createDocumentFragment();for(;i.childElementCount>d;)i.lastElementChild.remove();for(;a.childElementCount>d;)a.lastElementChild.remove();for(let t=i.childElementCount;t<d;t+=1){const t=document.createElement("div");t.classList.add("jqx-timeline-row"),e._createTimelineRowCells(t,c),m.appendChild(t)}m.childElementCount&&i.appendChild(m);for(let e=a.childElementCount;e<d;e+=1){const e=document.createElement("div");e.classList.add("jqx-timeline-task"),m.appendChild(e)}m.childElementCount&&a.appendChild(m)}_getCellIndexByDate(e){const t=this._timelineCells;let i=[];if(e&&e.length&&t){Array.isArray(e)||(e=[e]);for(let t=0,a=e.length;t<a;t+=1){const a=e[t];e[t]=a.getTime?a.getTime():a,i[t]=-1}for(let a=0,n=t.length;a<n;a+=1){const n=t[a],s=e.indexOf(n.date.getTime());if(s>-1&&(i[s]=a,i.every((e=>-1!==e))))break}return 1===i.length?i[0]:i}}_recycleDateMarkers(){const e=this,t=e.$.timelineMarkers,i=e._markers;if(!i||e.hideDateMarkers)return void(t.childElementCount&&(t.innerHTML=""));const a=e.$.timelineViewCells.children,n=a[0]._date,s=a[a.length-1]._date,[r,o]=e._getCellIndexByDate([n,s]);if(!n||!s)return;const l=n.getTime(),d=e._getCellDateRange({_date:s}).dateEnd.getTime(),c=t.children,[m,u]=e.rightToLeft?["right","left"]:["left","right"],h=document.createDocumentFragment();let g=0;for(let t=0,a=i.length;t<a;t+=1){const a=i[t],n=i[t].date,s=n.getTime();if(s<l||s>d)continue;const f=e._getTimelineCellByDate(n,r,o);if(f){const t=f.left+e._getTimelineTaskOffset(f,n),i=a.label,s=a.className;let r=c[g];r||(r=document.createElement("div"),h.appendChild(r)),r.className="jqx-gantt-chart-date-marker",void 0!==i&&(r.firstElementChild||(r.innerHTML='<div class="jqx-gantt-chart-marker-label"></div>'),r.firstElementChild.textContent=i+""),void 0!==s&&r.classList.add(s),r.style[u]="",r.style[m]=t+"px",g++}}for(h.childElementCount&&t.insertBefore(h,t.firstElementChild);c.length>g;)c[c.length-1].remove()}_refreshTableScrollTop(e,t){this.$.mainSplitter.contains(e)&&void 0!==t&&(e.scrollTop=t)}_recycleHeaderCells(e){let t=this,i=e.children,a=t.scrollLeft,n=e===t.$.timelineViewCells,s=n?t._timelineCells:t._timelineHeaderCells;if(e===t.$.timelineViewSubDetails&&(n=!1,s=t._timelineHeaderSubCells),!s.length)return;let r=document.createDocumentFragment();for(;i.length;)r.appendChild(e.firstElementChild);let o=t._getFirstCellObjInView(s),l=1-(o.left+o.width-Math.abs(a))/s[0].width,d=r.children.length,c=n?Math.ceil((parseFloat((t.$.timeline.offsetWidth/o.width).toFixed(2))+l).toFixed(2)):t._getHeaderVisibleCellsCount();if(e===t.$.timelineViewSubDetails&&(c=t._getHeaderSubVisibleCellsCount()),d>c)for(;r.children.length&&r.children.length!==c;)r.removeChild(r.firstElementChild);else if(d<c){const e=t._createCells(c-d);for(;e.children.length;)r.appendChild(e.firstElementChild)}const m=[t.rightToLeft?"right":"left"],u=n?t._getCellsViewType():t.view;let h=s.indexOf(o);for(let e=0;e<r.children.length;e++){const i=r.children[e],a=s[h];if(!a)break;let o=new Date(a.date);n||"week"!==t.view||(o.setDate(o.getDate()-o.getDay()),o=new Date(Math.max(a.date.getTime(),o.getTime()))),i.style[m]=a.left+"px",i.style.width=a.width+"px",i._date=o,i.innerHTML=`<div>${t._getDateString(o,u,!n)}</div>`,a.weekend?i.setAttribute("weekend",""):i.removeAttribute("weekend"),a.nonworking?i.setAttribute("nonworking",""):i.removeAttribute("nonworking"),h++}e.appendChild(r),n&&(t._recycleTimelineRowCells(),t._recycleResourceHeaderCells(),t._recycleDateMarkers(),t._setTodayCell())}_recycleHeaderSubCells(e){let t=this,i=e.children,a=t.scrollLeft,n=t._timelineHeaderSubCells;if(!n.length)return;let s=document.createDocumentFragment();for(;i.length;)s.appendChild(e.firstElementChild);let r=t._getFirstCellObjInView(n),o=(r.left,r.width,Math.abs(a),n[0].width,s.children.length),l=t._getHeaderSubVisibleCellsCount();if(o>l)for(;s.children.length&&s.children.length!==l;)s.removeChild(s.firstElementChild);else if(o<l){const e=t._createCells(l-o);for(;e.children.length;)s.appendChild(e.firstElementChild)}const d=[t.rightToLeft?"right":"left"],c=t.view;let m=n.indexOf(r);for(let e=0;e<s.children.length;e++){const i=s.children[e],a=n[m];if(!a)break;let r=new Date(a.date);"week"===t.view&&(r.setDate(r.getDate()-r.getDay()),r=new Date(Math.max(a.date.getTime(),r.getTime()))),i.style[d]=a.left+"px",i.style.width=a.width+"px",i._date=r,i.innerHTML=`<div>${t._getDateString(r,c,!0)}</div>`,a.weekend?i.setAttribute("weekend",""):i.removeAttribute("weekend"),a.nonworking?i.setAttribute("nonworking",""):i.removeAttribute("nonworking"),m++}e.appendChild(s),t._refreshHeaderSubDetailsDate()}_refresh(){const e=this;let t="disabled"===e.verticalScrollBarVisibility;function i(){const t=e.$.timelineHeader,i=t.scrollWidth-t.offsetWidth;return i>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$container.addClass("hscroll"):e.$container.removeClass("hscroll"),i}function a(){let i=Math.max(0,e.$.timelineContent.offsetHeight-e.$.taskTimelineContainer.offsetHeight);return i>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$container.addClass("vscroll"):e.$.mainSplitter.contains(e.$.resourceSplitter)?(i=1,t=!0,e.$.resourceVerticalScrollBar.max||e.$container.removeClass("vscroll")):e.$container.removeClass("vscroll"),i}const n=e.scrollWidth,s=e.scrollHeight;let r=i(),o=a();o&&s===o||(r=i()),r&&n===r||(o=a()),e.scrollWidth=r,e.scrollHeight=o,e.$.verticalScrollBar.disabled=t,e.$.horizontalScrollBar.refresh(),e.$.verticalScrollBar.refresh(),e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._refreshResourceScrollBar(),e._refreshTableScrollTop(e.$.resourceTable))}_refreshProjectTasks(e,t){const i=this,a=i._getProjectTasks(e);if(!a.length)return;const n=i.nonworkingDays,s=i.nonworkingHours,r=i._timelineVCells;for(let e=0,o=a.length;e<o;e++){const o=a[e];if(o){const e=i._getTaskDOMIndex(o),a=r[e],l=o.segments;if(o.dateStart=new Date(Math.max(i.dateStart.getTime(),o.dateStart.getTime()+t.startTime)),o.dateEnd=new Date(Math.min(i.dateEnd.getTime(),o.dateEnd.getTime()+t.endTime)),o.duration=i._convertDuration(n.length>0||s.length>0?i._getWorkingTime(o.dateStart,o.dateEnd):o.dateEnd.getTime()-o.dateStart.getTime(),!0),l&&l.length>1){for(let e=0,i=l.length;e<i;e+=1){const i=l[e];i.dateStart=new Date(i.dateStart.getTime()+t.startTime),i.dateEnd=new Date(i.dateEnd.getTime()+t.endTime)}i._validateTaskSegments(o)}a&&(i._recycleTaskBars(a,e),i._setTimelineTaskBar(a,e),l&&l.length>1&&i._setTaskBarProgress(o),i._refreshTaskConnections(o),i._refreshTableColumnsData(o,["dateStart","dateEnd","duration","overdue"]))}}}_refreshProject(e){const t=this;function i(e){let i,a,n;if(e instanceof HTMLElement)i=e.offsetLeft,n=e.offsetWidth;else if(e){const s=t._getTimelineTaskCellByDate(e.dateStart),r=t._getTimelineTaskCellByDate(e.dateEnd);s&&r&&(i=s.left+t._getTimelineTaskOffset(s,e.dateStart)||0,a=r.left+t._getTimelineTaskOffset(r,e.dateEnd)||0,n=a-i)}return[i,n]}if(!e)return;const a=t.groupByResources&&e.isGroup?"group":"project";if(e.synchronized)for(;e&&e.synchronized;){const n=t._getProjectTasks(e);let s=n[0],r=n[0];for(let e=0;e<n.length;e++)s.dateStart.getTime()>=n[e].dateStart.getTime()&&(s=n[e]),r.dateEnd.getTime()<=n[e].dateEnd.getTime()&&(r=n[e]);const o=t.$.timelineTasksContainer.children,l=t.$.timelineContent.offsetWidth;let d,c,m;for(let t=0,i=o.length;t<i;t+=1){const i=o[t],a=i._cellObj?i._cellObj.task:void 0;a&&(a===e?d=i:a===s?c=i:a===e&&(m=i))}if(!d){s&&(e.dateStart=s.dateStart),r&&(e.dateEnd=r.dateEnd),e=e.$[a];continue}s&&(e.dateStart=s.dateStart);let[u,h]=i(c||s);void 0!==u&&void 0!==h&&(t.rightToLeft?(d.style.width=d.offsetWidth-(l-u-h-(l-d.offsetLeft-d.offsetWidth))+"px",d.style.right=c?c.style.right:u+"px"):(d.style.width=d.offsetWidth-(u-d.offsetLeft)+"px",d.style.left=c?c.style.left:u+"px")),r&&(e.dateEnd=r.dateEnd),[u,h]=i(m||r),void 0!==u&&void 0!==h&&(t.rightToLeft?d.style.width=Math.max(0,d.offsetWidth-(l-d.offsetLeft-(l-u)))+"px":d.style.width=Math.max(0,d.offsetWidth-(d.offsetLeft+d.offsetWidth-(u+h)))+"px"),t._refreshTask(d),e=e.$[a]}else t._refreshProject(e.$[a])}_refreshTask(e,t){const i=this,a=i._getTaskBarCellRange(e),n=a.cellStart,s=a.cellEnd;if(!a||!n||!s)return;e._cellStart=n,e._cellEnd=s;const r=i._getTaskBarDateRange(e);if(!r)return;const o=e._cellObj.task;if(Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===o))){if(o.dateStart=r.dateStart,o.dateEnd=r.dateEnd,o.duration=o.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(o.dateStart,o.dateEnd):o.dateEnd.getTime()-o.dateStart.getTime(),!0),e.setAttribute("aria-label",o.label+" Start date: "+i._toISODate(o.dateStart)+", End date: "+i._toISODate(o.dateEnd)),i._refreshTaskConnections(e),t)Array.isArray(t)&&i._refreshTaskSegments(e,t);else{const t=i._dragDetails;let a;e.classList.contains("task")?t&&t.segments?a=t.segments:t.segments=a=e.querySelectorAll(".jqx-task-segment"):a=e.querySelectorAll(".jqx-task-segment"),i._refreshTaskSegments(e,a)}i._refreshTableColumnsData(o,["dateStart","dateEnd","duration","overdue"])}}_refreshTaskSegments(e,t){const i=this,a=e._cellObj.task;if(!a||!a.segments||!a.segments.length)return void i._setTaskBarDeadline(a,t?t[0]:void 0);const n=i.nonworkingDays.length>0||i.nonworkingHours.length>0,s=i.rightToLeft,r=s?"right":"left",o=parseFloat(e.style[r])||e.offsetLeft;let l;for(let a=0,d=t.length;a<d;a+=1){const d=t[a],c=d._segmentObj,m=i._getSegmentCellRange(d),u=m.cellStart,h=m.cellEnd;if(!m||!u||!h)continue;const g=parseFloat(d.style.width)||d.offsetWidth,f=o+parseFloat(d.style[r])||(s?(parseFloat(e.style.width)||e.offsetWidth)-(d.offsetLeft+d.offsetWidth):d.offsetLeft);d._cellStart=u,d._cellEnd=h,l=d;let p=i._getDateFromCell(f,u),_=i._getDateFromCell(f+g,h);c.dateStart=p,c.dateEnd=_,c.duration=i._convertDuration(n?i._getWorkingTime(p,_):_.getTime()-p.getTime(),!0),e.setAttribute("aria-label",(c.label||"")+" Start date: "+i._toISODate(p)+", End date: "+i._toISODate(_))}i._setTaskBarProgress(a,e),i._setTaskBarDeadline(a,l)}_refreshTaskResources(e,t=[]){const i=this;if(e&&(t||(t=i._getTaskResources(e)),t.length))for(let e=0;e<t.length;e++){const a=t[e];i._refreshResource(a),i._refreshTableColumnsData(a,void 0,"resource")}}_refreshTableColumnsData(e,t,i){const a=this;if(i||(i="task"),!e)return;const n=a[`${i}Columns`],s=a.$[`${i}Table`];if(!a.$.mainSplitter.contains(s))return;const r=e.$.id;t=t?t.map((e=>n.find((t=>t.value===e)))):n;for(let i=0;i<t.length;i++){const n=t[i];n&&s.setValue(r,n.value,a._formatColumnData(e,n))}a.$[`${i}Splitter`].refresh()}_removeConnection(e,t){const i=this,a=i.$.connectionPopupWindow,n=i.$.timelineConnectionsContainer;if(e.classList&&e.classList.contains("jqx-task-connection")?e=e.getAttribute("connection-id"):e+="",void 0===e)return;const s=n.querySelectorAll('.jqx-task-connection[connection-id^="'+e+(e.indexOf("-")<0?"-":"")+'"]'),r=i._tasks,o=e.split("-"),l=parseInt(o[1]);for(let e=0;e<s.length;e++)n.removeChild(s[e]);let d;const c=parseInt(o[0]),m=parseInt(o[1]),u=parseInt(o[2]);if(a&&void 0!==a._target&&"number"==typeof a._target.type){const t=a._target;d=t.startIndex+"-"+t.endIndex+"-"+t.type===e}i._updateConnection([c,m,u],!0),!t&&i.autoSchedule&&(i._autoScheduleRestore(r[l],parseInt(o[2])),i._autoSchedule(r[l])),d&&i.$.fireEvent("itemRemove",{type:"connection",id:`${c}-${m}-${u}`,item:{source:c,target:m,type:u}})}_removeTaskConnections(e,t){const i=this,a=i._connections;if(a&&a.length){for(let t=0,i=a.length;t<i;t+=1)a[t].startTask===e&&(a.splice(t,1),i--);e.connections=[],t&&i._recycleConnections()}}_removeTask(e){const t=this,i=t._tasks;if(!e||!i||!i.length)return;const a=t._getSelection("task",t.selectedTaskIds),n=t.$.taskPopupWindow;let s;if(t._highlightAssignedItem("task",[e]),n&&n._target===e&&n.close(),"project"===e.type){const a=t._getProjectTasks(e);for(let e=0,t=a.length;e<t;e+=1)i.splice(i.indexOf(a[e]),1)}if(i.splice(i.indexOf(e),1),t._refreshItemIds(),t._refreshConnectionIds(),t._isUpdating)return t._isUpdating.type.task=!0,void(t._isUpdating.type.resource=!0);t._refreshSelectedItems(),t._refreshTableDataSource(),t._refreshTimeline(),t._selected&&t._selected.task&&(s=t._selected.task.map((e=>e.$.id)),a.toString()!==s.toString()&&(t.$.taskTable.selected=t._getSelection("task",t.selectedTaskIds))),t.$.fireEvent("itemRemove",{type:"task",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:t._cloneObject(e)})}_removeResource(e){const t=this,i=t._resources,a=i.indexOf(e);if(e&&!(a<0)){if(t._isUpdating)return i.splice(a,1),t._isUpdating.type.resource=!0,void(t._isUpdating.type.task=!0);if(i.splice(a,1),t.groupByResources)t._refreshTableDataSource(),t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks();else if(t.taskColumns.find((e=>"resources"===e.value))){const i=t._tasks.filter((t=>t.resources.includes(e.id)));for(let e=0;e<i.length;e++)t._refreshTableColumnsData(i[e],["resources"])}if(!i.filter((e=>!e.hidden)).length)return t._createResourceTimeline(),t._resizeEventHandler(),void n();t._refreshResourceTimeline(),t._refreshTableDataSource("resource"),t.$.mainSplitter.contains(t.$.resourceSplitter)?(t._refreshResourceScrollBar(),t._resizeEventHandler(),n()):n()}function n(){t.$.fireEvent("itemRemove",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:t._cloneObject(e)})}}_updateTask(e,t){const i=this,a=i._tasks;if(!e||!a||!a.length)return;const n=i.$.taskPopupWindow,s=i._getSelection("task",i.selectedTaskIds);n&&n._target===e&&n.close();let r,o=i._getTaskResources(e);for(let n in t){let s=e[n],l=t[n];if("type"===n&&s!==l&&["task","project","milestone"].indexOf(l)>-1&&"project"===s){const t=i._getProjectTasks(e);for(let e=0,i=t.length;e<i;e+=1)a.splice(a.indexOf(t[e]),1);delete e.tasks}if("project"!==e.type||!e.synchronized||!(n.toLowerCase().indexOf("date")>-1||n.toLowerCase().indexOf("duration")>-1))if("dateEnd"===n&&new Date(s).getTime()!==new Date(l).getTime()&&(r=!0),"tasks"!==n)"connections"===n&&(i._removeTaskConnections(e),i._handleTaskConnections(e)),e[n]=l,"resources"===n&&(i._handleResources(e),e.disableResources||(o=o.concat(i._getTaskResources(e)),o=o.filter(((e,t)=>o.indexOf(e)===t)))),"milestone"!==e.type||"dateStart"!==n&&"dateEnd"!==n||(e.dateEnd=e.dateStart=l);else if("project"===e.type){const t=i._getProjectTasks(e);for(let e=0,i=t.length;e<i;e+=1)a.splice(a.indexOf(t[e]),1);const n=i._createTasks(l,!0);for(let t=0,i=n.length;t<i;t+=1)n[t].$.project=e;i._insertTasks(n,e,a.indexOf(e))}}r&&delete e.duration;const l=e.$,d=e.$.project;if(i._validateTaskProperties(e,d),e.$=l,d&&i._synchronizeProjectDates(d),"project"===e.type&&e.hidden&&i._getProjectTasks(e).forEach((t=>t.hidden=e.hidden)),i._synchronizeProjectVisibility(e.$.project,e),i._refreshItemIds(),i._refreshConnectionIds(),i._isUpdating)return void(i._isUpdating.type.task=!0);let c;i._selected&&i._selected.task&&i._setSelection("task",c=i._selected.task.map((e=>e.$.id))),i._refreshTableDataSource(),i._refreshTimeline(),i._ensureVisible(e),c&&s.toString()!==c.toString()&&(i.$.taskTable.selected=c.slice(0)),i._refreshTaskResources(e,o),i._highlightAssignedItem("task",i._getSelection("task",i.selectedTaskIds)),i.$.fireEvent("itemUpdate",{type:"task",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)})}_updateResource(e,t){const i=this;if(!e)return;const a=e.hidden;if(i._setResource(e,t),i._isUpdating)i._isUpdating.type.resource=!0;else{if(i.groupByResources)i._refreshTableDataSource(),i._refreshTimeline();else if(i.taskColumns.find((e=>"resources"===e.value))){const t=i._tasks.filter((t=>t.resources.includes(e.id)));for(let e=0;e<t.length;e++)i._refreshTableColumnsData(t[e],["resources"])}if(a!==e.hidden)return i._createResourceTimeline(),void i.$.fireEvent("itemUpdate",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)});if(i._refreshTableColumnsData(e,void 0,"resource"),i.$.mainSplitter.contains(i.$.resourceTimelineCellsContainer)){const t=i.$.resourceTimelineCellsContainer.children;for(let a=0;a<t.length;a++){const n=t[a];n._resource===e&&i._refreshResourceTimelineContent(e,n)}}i.$.fireEvent("itemUpdate",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)})}}_select(e="task",t){const i=this;if(i.disableSelection||!t)return void i._unselectAll(e);let a,n;"task"===e?(a="selectedTaskIds",n=i._tasks):(a="selectedResourceIds",n=i._resources);const s=n.findIndex((e=>e.$.id===t)),r=i._getSelection(e,i[a]);s<0||(r.indexOf(t)>-1?i.$[`${e}Table`].unselect(t):i.$[`${e}Table`].select(t))}_handleTableSelection(e="task",t){const i=this;if(i.disableSelection||!t.length)return void i._unselectAll(e);let a,n,s,r,o,l=i._selected;l||(l=i._selected={});const d=t[t.length-1],c=l[e]=[];"task"===e?(o=i._tasks,a="selectedTaskIds",n=i.$.taskTimelineCellsContainer.children,s=i.$.timelineTasksContainer.children):(o=i._resources,a="selectedResourceIds",n=i.$.resourceTimelineCellsContainer.children,s=[]);for(let e=0,i=o.length;e<i;e+=1){const i=o[e];t.indexOf(i.$.id)>-1&&c.push(i)}for(let i=0,a=n.length;i<a;i+=1){const a=n[i],o=s[i],l=a._cellObj[e].$.id;d===l&&(r=s[i]),t.indexOf(l)>-1?(a.setAttribute("selected",""),a.setAttribute("aria-selected","true"),o&&o.setAttribute("selected","")):(a.removeAttribute("selected"),a.setAttribute("aria-selected","false"),o&&o.removeAttribute("selected"))}const m=i[a].slice(0);if(i._setSelection(e,t),!i._tableChangeEventFired){const a=document.scrollingElement||document.documentElement,n=a.scrollLeft,s=a.scrollTop;i._highlightAssignedItem(e,t),i.$[`${e}Table`].focus({preventScroll:!0}),window.scrollTo(n,s)}if("task"===e&&r){const e=r._cellStart;if(i.scrollLeft>e.left||e.left+r.offsetWidth>i.scrollLeft+i.$.timeline.offsetWidth){const t=i._timelineCells.indexOf(e);i._scrollTo((i._timelineCells[t-1]?i._timelineCells[t-1]:e).date)}}i._noChangeEvent||i.$.fireEvent("change",{type:e,value:i[a].slice(0),oldValue:m})}_setSelection(e="task",t){const i=this;let[a,n]="task"===e?[i._tasks,"selectedTaskIds"]:[i._resources,"selectedResourceIds"],s=[];for(let e=0,i=t.length;e<i;e+=1){const i=t[e],n=a.find((e=>e.$.id===i));n&&s.push(void 0!==n.id?n.id:i)}i.set(n,s)}_getSelection(e="task",t){const i="task"===e?this._tasks:this._resources;let a=t.slice(0);if(!t||!t.length)return a;for(let e=0,n=i.length;e<n;e+=1){const n=i[e],s=t.indexOf(n.id);s>-1&&(a[s]=n.$.id)}return a}_highlightAssignedItem(e,t){const i=this,[a,n]="task"===e?["resource","_getTaskResources"]:["task","_getResourceTasks"],s=i.$[`${a}Table`],r=i[`_${a}s`];if(!s||!i.$.mainSplitter.contains(s)||!r.length)return;t&&Array.isArray(t)||(t=[]);let o=[];for(let a=0,s=t.length;a<s;a+=1){const s=i._getValidItemAndIndex(t[a],e);s&&(o=o.concat(i[n](s.item).filter((e=>!e.hidden))))}i._tableChangeEventFired=!0,s.selected=o.map((e=>e.$.id)),o.length&&i._ensureVisible(o[0],a),delete i._tableChangeEventFired}_selectResource(e){const t=this,i=t._resources.indexOf(e);if(i<0)return void t._unselectAll("resource");const a=t.$.resourceTimelineCellsContainer.children[i];a&&a.hasAttribute("selected")?t._unselectAllTasks():t.$.resourceTree.focus({preventScroll:!0})}_snapToNearest(e,t){const i=this;if(!(i.snapToNearest&&e&&e.classList&&e.classList.contains("jqx-timeline-task")&&e._cellObj))return;const a=e._cellObj.task,n=a.segments;if(t&&t.classList.contains("jqx-task-segment")){const a=n.indexOf(t._segmentObj),s=0===a,r=a===n.length-1;if(i._handleSnapToNearestSegment(e,t,s?"first":r?"last":void 0),i._refreshTaskSegments(e,[t]),!s&&!r)return;i._refreshTask(e,!0)}else i._handleSnapToNearest(i._getTaskBarCellRange(e),e),i._refreshTask(e);if(n&&n.length>1){for(let e=0,t=n.length;e<t;e+=1)i._snapToNearestDates(n[e],!0);i._validateTaskSegments(a),a.segments.length!==n.length&&i._recycleSegments(a,e),i._setTaskBarSegments(e._cellObj,e,!0),i._setTaskBarProgress(a)}if("project"!==a.type||!a.dragProject)return;const s=i._getProjectTasks(a);if(s&&Array.isArray(s))for(let e=0;e<s.length;e++){const t=i.$.timelineTasksContainer.children[i._tasks.indexOf(s[e])];t&&i._snapToNearest(t)}}_handleSnapToNearestSegment(e,t,i){const a=this,n=a.rightToLeft,s=n?"right":"left",r=parseFloat(e.style[s])||0,o=t,l=a._getSegmentCellRange(t),d=l.cellStart,c=l.cellEnd,m="first"===i,u="last"===i;let h=parseFloat(o.style.width)||o.offsetWidth,g=parseFloat(o.style[s])||0,f=r+g;if(a.hasAttribute("dragged")){const t=c.width-(f+h-c.left);let a;if(f-d.left<=t?(a=d.left-r,o.style[s]=Math.max(0,m?0:a)+"px"):(a=g+t,o.style[s]=Math.max(0,m?0:a)+"px"),i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&(e.style[s]=r+(a-g)+"px"),e.style.width=t+(m?-1:1)*(a-g)+"px"}}else if(a.hasAttribute("resized")){const t=d===c?a._taskBarMinWidth:0;let l;if("left"===a.$.timeline.getAttribute("task-bar-hovered")){if(l=f-d.left,l-=l>=d.width/2?d.width-t:0,f-=l,o.style[s]=Math.max(0,m?0:f-r)+"px",l=f+h>c.left+c.width/2?c.left+c.width-(f+h):c.left-(f+h),o.style.width=Math.max(t,h+l)+"px",i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&!n&&(e.style[s]=f+"px",e.style.width=t+l+"px"),u&&n&&(e.style.width=t+l+"px")}}else if(f>d.left+d.width/2?(f=d.left+d.width,o.style[s]=Math.max(0,m?0:f-r)+"px"):(f=d.left,o.style[s]=Math.max(0,m?0:f-r)+"px"),l=f+h-c.left,l=-1*(l-(l>=d.width/2?c.width:t)),o.style.width=h+l+"px",i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&n&&(e.style[s]=f+"px",e.style.width=t+l+"px"),u&&!n&&(e.style.width=t+l+"px")}}}_handleSnapToNearest(e,t){const i=this;if(!e)return;const a=i.rightToLeft?"right":"left",n=e.cellStart,s=e.cellEnd;let r=parseFloat(t.style.width)||t.offsetWidth,o=parseFloat(t.style[a])||0;if(i.hasAttribute("dragged")){const e=s.width-(o+r-s.left);o-n.left<=e?t.style[a]=n.left+"px":t.style[a]=o+e+"px"}else if(i.hasAttribute("resized")){const e=n===s?i._taskBarMinWidth:0;let l;"left"===i.$.timeline.getAttribute("task-bar-hovered")?(l=o-n.left,l-=l>=n.width/2?n.width-e:0,t.style[a]=(o-=l)+"px",l=o+r>s.left+s.width/2?s.left+s.width-(o+r):s.left-(o+r),t.style.width=Math.max(e,r+l)+"px"):(o>n.left+n.width/2?t.style[a]=n.left+n.width+"px":t.style[a]=n.left+"px",o=parseFloat(t.style[a])||0,l=o+r-s.left,l=-1*(l-(l>=n.width/2?s.width:e)),t.style.width=r+l+"px")}}_setDragLimits(e){const t=this,i=t._dragDetails;if(!i)return;const a=i.timelineTask;if(!a||!e)return;const n=t.$.timeline.getAttribute("task-bar-hovered"),s=a._cellObj.task;if(n){if(s.disableResize)return void delete t._dragDetails;const e=t._getTaskBarSizeLimits(a,n);i.min.width=e.min,i.max.width=e.max,t._setSegmentLimits(n);const r=t._createDelimiter("min",n),o=t._createDelimiter("max",n);r&&a.appendChild(r),o&&a.appendChild(o)}else if(e.closest(".jqx-task-connection-point"))i.timelineTask=void 0;else if(e.closest(".jqx-timeline-task")===a){let e;if(t._connections){const i=t._tasks.indexOf(a._cellObj.task);e=t._connections.some((e=>e.startIndex===i||e.endIndex===i))}if(s.disableDrag||e&&t.autoSchedule&&t.autoScheduleStrictMode)return void delete i.target;i._taskDuration=t._getWorkingTime(s.dateStart,s.dateEnd),a.classList.contains("milestone")&&(i.target="jqx-timeline-task-fill");const n=t._getTaskDragLimits(a),r=t.rightToLeft?t.$.timelineContent.offsetWidth-a.offsetLeft-a.offsetWidth:a.offsetLeft;if(void 0!==n.min&&(i.min.left=n.min,"project"===a._cellObj.task.type&&n.min>r&&(i.min.left=r)),void 0!==n.max&&(i.max.left=n.max,"project"===a._cellObj.task.type&&n.max<r&&(i.max.left=r)),"project"===s.type&&s.dragProject&&!t.synchronized){const e=t._getSubTaskLimits(a);void 0!==e.min&&(i.min.left=i.min.left?Math.max(i.min.left,e.min):e.min),void 0!==e.max&&(i.max.left=i.max.left?Math.min(i.max.left,e.max):e.max)}else"milestone"===s.type&&(i.target="jqx-timeline-task-fill");t._setSegmentLimits()}else i.timelineTask=void 0;i.relatedConnections={}}_setSegmentLimits(e){const t=this,i=t._dragDetails;if(!i||!i.segment)return;const a=i.segment;if(a){const n=a.element,s=a.dimensions,r=n.previousElementSibling,o=n.nextElementSibling;if(a.min.width=e?t._taskBarMinWidth:0,t.rightToLeft){if(r)a.min.left="left"===e?s.left+s.width:r.offsetLeft-(e?0:s.width),"right"===e&&(a.max.width=r.offsetLeft-s.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"right");i.min.width=e.min,i.max.width=e.max}if(o)a.max.left="right"===e?a.dimensions.left:o.offsetLeft+o.offsetWidth+s.width,e&&"left"!==e||(a.max.width=s.left+s.width-(o.offsetLeft+o.offsetWidth));else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"left");i.min.width=e.min,i.max.width=e.max}}else{if(r)a.min.left="right"===e?s.left:r.offsetLeft+r.offsetWidth+(e||o?0:s.width),"left"===e&&(a.max.width=s.left+s.width-a.min.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"left");i.min.width=e.min,i.max.width=e.max}if(o)a.max.left="left"===e?s.left+s.width:o.offsetLeft-s.width,e&&"right"!==e||(a.max.width=o.offsetLeft-s.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"right");i.min.width=e.min,i.max.width=e.max}}}}_setScrollBars(){const e=this;e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e.$.taskSplitterItem,e.$.horizontalScrollBar,e.$.verticalScrollBar));const t=e._scrollView.vScrollBar,i=e._scrollView.hScrollBar;i.$.addClass("jqx-hidden"),t.$.addClass("jqx-hidden"),t.hasStyleObserver=!1,i.hasStyleObserver=!1,t.hasResizeObserver=!1,i.hasResizeObserver=!1,t.rightToLeft=i.rightToLeft=e.rightToLeft,i.wait=!1,e._refresh()}_getWorkingTime(e,t){const i=this;if(!e||!t)return;if(!i.adjustToNonworkingTime)return t.getTime()-e.getTime();const a=i.nonworkingHours,n=i.nonworkingDays;function s(e,t){let i,s,r=t.getTime()-e.getTime(),o=new Date(e),l=0;for(;r>0;){const e=Math.min(r,36e5-(60*o.getMinutes()*1e3+1e3*o.getSeconds()+o.getMilliseconds()));if(n.indexOf(o.getDay())>-1)s=new Date(o),s.setHours(0,0,0,0),s.setDate(o.getDate()+1),i=Math.min(e,s.getTime()-o.getTime()),o=new Date(o.getTime()+i),r-=i;else if(a.indexOf(o.getHours())>-1){s=new Date(o);const t=s.getTime();s.setHours(o.getHours()+1,0,0,0),t===s.getTime()&&s.setHours(o.getHours()+2,0,0,0),i=Math.min(e,s.getTime()-o.getTime()),o=new Date(o.getTime()+i),r-=i}else l+=e,r-=e,o=new Date(o.getTime()+e)}return l}if(e.getFullYear()===t.getFullYear())return s(e,t);let r=new Date(e.getFullYear()+1,0,1,0,0,0,0),o=s(e,r);if(t.getFullYear()>r.getFullYear()){const e=Math.max(0,t.getFullYear()-r.getFullYear());for(let t=0;t<e;t++){let e=i._getWorkingDaysBetweenDays(r);o+=60*(24*e-e*i.nonworkingHours.length)*60*1e3,r.setFullYear(r.getFullYear()+1)}}return o+=s(r,t),o}_getWorkingDaysBetweenDays(e){const t=this,i=e.getFullYear(),a=(i%100==0?i%400==0:i%4==0)?366:365;let n=new Date(e),s=0;for(let e=0;e<a;e++)t.nonworkingDays.indexOf(n.getDay())<0&&s++,n.setDate(n.getDate()+1);return s}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.tabIndex=-1:e.tabIndex=e.tabIndex>0?e.tabIndex:0}_setTaskBarLabel(e,t){const i=this;void 0===t&&(t=i._getTaskDOMIndex(e));const a=i.$.timelineTasksContainer.children[t];if(!a)return;const n=a.querySelector(".jqx-task-segments").children;let s=e.segments;Array.isArray(s)&&s&&s.length&&"task"===e.type||(s=[e]);for(let r=0,o=s.length;r<o;r+=1){const o=s[r],l=n[r],d=l?l.getElementsByClassName("jqx-timeline-task-label")[0]:void 0;if(!d)continue;d.firstElementChild||(d.innerHTML="<div></div>");let c=d.firstElementChild;"string"==typeof o.label||"number"==typeof o.label?c.textContent=o.formatFunction?o.formatFunction(o.label||"",t)||"":o.label||"":c.textContent=e.formatFunction?o.formatFunction(e.label||"",t)||"":e.label||"",i.onTaskRender&&i.onTaskRender(e,o,a,l,c),e.onRender&&e.onRender(e,o,a,l,c)}}_setTaskBarProgress(e,t){const i=this;if("number"==typeof t?t=i.$.timelineTasksContainer.children[t]:void 0===t&&(t=i.$.timelineTasksContainer.children[i._getTaskDOMIndex(e)]),!t||!e)return;let a=e.progress;const n=t.querySelector(".jqx-timeline-task-progress-thumb");if(!n)return;a=Math.min(100,Math.max(0,a))||0;const s=e.dateStart.getTime(),r=e.dateEnd.getTime(),o=t.querySelector(".jqx-task-segments").children;let l,d,c=e.segments,m=0;c&&c.length||(c=[e]);for(let e=0,t=c.length;e<t;e+=1){const t=c[e],i=o[e],n=i?i.querySelector(".jqx-timeline-task-progress"):void 0;if(!n)continue;const u=(t.dateStart.getTime()-s)/(r-s)*100,h=(t.dateEnd.getTime()-s)/(r-s)*100,g=Math.max(0,Math.min(100,(a-u)/(h-u)*100));n.style.width=g+"%",n.removeAttribute("value"),i.removeAttribute("show-progress-label"),a>=u?(m=Math.max(u,Math.min(a,h)),l=n,d=i):l||(l=n,d=i)}if(n.style[i.rightToLeft?"left":"right"]="",n.style[i.rightToLeft?"right":"left"]=m+"%",!l||!i.showProgressLabel)return;const u=i.progressLabelFormatFunction;d.setAttribute("show-progress-label",""),l.setAttribute("value",u?u(a)+"":parseFloat(a.toFixed(2))+"%")}_setTaskDeadline(e,t,i){const a=this,n=e.task,{timelineStart:s,timelineEnd:r}=i,o=n.deadline,l=a.$.timelineDeadlines,d=l.children,c=o&&o.getTime&&!isNaN(o.getTime())?o.getTime():void 0;let m;for(let e=0,i=d.length;e<i;e+=1){const i=d[e];if(parseInt(i.getAttribute("task-index"))===t){m=i;break}}if(!c||c<s||c>r)return void(m&&m.remove());const u=a._getTimelineCellByDate(o),[h,g]=a.rightToLeft?["right","left"]:["left","right"];m||(m=document.createElement("div"),m.classList.add("jqx-gantt-chart-task-deadline"),m.setAttribute("task-index",t),l.appendChild(m)),m.setAttribute("date",o.toString()),m.setAttribute("title",a._formatDate(o)),m.style.top=e.top+"px",m.style[g]="",m.style[h]=u.left+(a._getTimelineTaskOffset(u,o)||0)+"px"}_setTaskBarDeadline(e,t){const i=this,a=e.deadline;if(!a||!a.getTime||isNaN(a)||!t)return;const n=e.deadline.getTime()-e.dateEnd.getTime();if(!e.deadline||n>0)return t.removeAttribute("deadline"),void(e.overdue=!1);e.overdue=!0,t.setAttribute("deadline",`${i.localize("overdue")}: ${Math.round(i._convertDuration(Math.abs(n),!0))} ${i.durationUnit+"s"}`)}_setTaskIndicators(e,t,i){const a=this,n=e.task,{timelineStart:s,timelineEnd:r}=i,[o,l]=a.rightToLeft?["right","left"]:["left","right"],d=a.$.taskIndicatorsContainer,c=d.children,m=n.indicators;let u;for(let e=0,i=c.length;e<i;e+=1){const i=c[e];if(parseInt(i.getAttribute("task-index"))===t){u=i;break}}if(!Array.isArray(m))return void(u&&u.remove());const h=document.createDocumentFragment(),g=document.createDocumentFragment();u||(u=document.createElement("div"),u.classList.add("jqx-gantt-chart-indicator"),u.setAttribute("task-index",t),h.appendChild(u));const f=u.children;for(;f.childElementCount>m.length;)f.firstElementChild.remove();for(let t=0,i=m.length;t<i;t+=1){let i=f[t];const n=m[t],d=n.date;if(!d||!d.getTime){i&&i.remove();continue}const c=d.getTime();if(c<s||c>r){i&&i.remove();continue}const u=a._getTimelineCellByDate(d),h=n.label,p=n.className,_=n.icon;i||(i=document.createElement("div"),g.appendChild(i)),i.className="jqx-gantt-chart-task-indicator",i._indicatorObj=n;const T=i.classList;"string"==typeof p&&T.add(p),_?(T.add("icon"),i.style.setProperty("--jqx-gantt-chart-indicator-icon",`'${_}'`)):T.contains("icon")&&(T.remove("icon"),i.style.removeProperty("--jqx-gantt-chart-indicator-icon")),i.textContent=h||"",i.style.top=e.top+"px",i.style[l]="",i.style[o]=u.left+(a._getTimelineTaskOffset(u,d)||0)+"px"}g.childElementCount&&u.appendChild(g),h.childElementCount&&d.appendChild(h)}_setTimelineTaskBar(e,t,i){const a=this,n=e.task,s=void 0===t?a._getTaskDOMIndex(n):t,r=a.$.timelineTasksContainer.children,o=r[s];let l,d;if(0===r.length||!o||!o.classList||!o.classList.contains("jqx-timeline-task"))return;const c=n.dateStart instanceof Date?n.dateStart:new Date(n.dateStart),m=n.dateEnd instanceof Date?n.dateEnd:new Date(n.dateEnd);if(l=!i&&o._cellStart||a._getTimelineCellByDate(c),d=!i&&o._cellEnd||a._getTimelineCellByDate(m),!l||!d)return void o.classList.add("jqx-visibility-hidden");o._cellStart=l,o._cellEnd=d,o.classList.remove("jqx-visibility-hidden");const u=a._getTaskBarDetails(e,l,d);u&&(o.style[a.rightToLeft?"left":"right"]="",o.style[a.rightToLeft?"right":"left"]=u.left+"px",o.style.width=u.width?u.width+"px":"",o.style.top=u.top+"px"),a._setTaskBarSegments(e,o,i)}_setTimelineTaskBaseline(e,t){const i=this,a=e.task,n=i.$.timelineBaselinesContainer;if(!i.showBaseline)return void(n.innerHTML&&(n.innerHTML=""));const s=a.planned,r=n.children;let o;for(let e=0,i=r.length;e<i;e+=1){const i=r[e];if(parseInt(i.getAttribute("task-index"))===t){o=i;break}}if(!s||"milestone"===a.type||!s.dateStart||!s.dateEnd)return void(o&&o.remove());const l=s.dateStart,d=s.dateEnd,c=i._getTimelineCellByDate(l),m=i._getTimelineCellByDate(d);if(!c||!m)return;o||(o=document.createElement("div"),o.classList.add("jqx-gantt-chart-task-baseline"),o.setAttribute("task-index",t),n.appendChild(o));const[u,h]=i.rightToLeft?["right","left"]:["left","right"],g=i._getTaskBarDetails(e,c,m);if(g){const e=o.style;e.width=g.width?g.width+"px":"",e.top=g.top+"px",e[u]=g.left+"px",e[h]=""}o.setAttribute("aria-label",a.label+" Start date: "+i._toISODate(l)+", End date: "+i._toISODate(d))}_setTaskBarSegments(e,t,i){const a=this,n=e.task,s=t.querySelector(".jqx-task-segments").children;let r,o,l=n.segments;if(Array.isArray(l)&&l&&l.length&&"task"===n.type||(l=[n]),1===l.length){const e=s[0].style;return void(e.right=e.left=e.width="")}const d=a.rightToLeft,c=parseFloat(t.style[d?"right":"left"]);let m;for(let e=0,t=l.length;e<t;e+=1){const t=l[e],n=s[e];if(!n)continue;const u=t.dateStart instanceof Date?t.dateStart:new Date(t.dateStart),h=t.dateEnd instanceof Date?t.dateEnd:new Date(t.dateEnd);r=!i&&n._cellStart||a._getTimelineCellByDate(u),o=!i&&n._cellEnd||a._getTimelineCellByDate(h),n._cellStart=r,n._cellEnd=o;const g=a._getTaskBarDetails({task:t},r,o);g&&(n.style[d?"left":"right"]="",n.style[d?"right":"left"]=Math.max(0,g.left-c)+"px",n.style.width=g.width+"px"),m=n}a._setTaskBarDeadline(n,m)}_setCurrentTimeIndicators(){const e=this;if(clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval,e.currentTimeIndicator||e.shadeUntilCurrentTime)e._refreshTimeIndicators(),e._currentTimeIndicatorInterval=setInterval(e._refreshTimeIndicators.bind(e),1e3*e.currentTimeIndicatorInterval);else{const t=e.$.timelineIndicatorsContainer;t&&t.remove()}}_refreshTimeIndicators(){const e=this,t=e.currentTime,i=e.view,a=e._getTodayCellObj(t);let n=e.$.timelineIndicatorsContainer;if(!a)return n&&n.remove(),clearInterval(e._currentTimeIndicatorInterval),void delete e._currentTimeIndicatorInterval;n||(e.$.timelineIndicatorsContainer=n=document.createElement("div"),n.classList.add("jqx-gantt-chart-time-indicators-container"),n.setAttribute("role","presentation")),new Date(a.date);let s,r,o=t.getMinutes();switch(i){case"quarter":case"year":{const e=new Date(t.getFullYear(),t.getMonth()+1,1,0,0,0,0);e.setDate(0),o+=24*t.getDate()*60,s=24*e.getDate()*60;break}case"month":o+=24*(t.getDay()+1)*60,s=10080;break;case"week":o+=60*t.getHours(),s=1440;break;case"day":s=60}r={cellObj:a,minutes:o,max:s,today:t},e._refreshCurrentTimeShader(r),e._refreshCurrentTimeIndicator(r),n.childElementCount||(clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval),n.parentElement||e.$.timelineContent.appendChild(n)}_refreshCurrentTimeIndicator(e){const t=this,i=t.$.timelineIndicatorsContainer;let a=i.querySelector(".jqx-gantt-chart-current-time-indicator");if(!t.currentTimeIndicator||!e)return void(a&&a.remove());const{cellObj:n,minutes:s,max:r}=e;a||(a=document.createElement("div"),a.classList.add("jqx-gantt-chart-current-time-indicator")),t.rightToLeft?a.style.right=n.left+n.width*(s/r)+"px":a.style.left=n.left+n.width*(s/r)+"px",a.setAttribute("aria-label","Current Time Indicator"),a.parentElement||i.appendChild(a),t._setTodayCell(n.date)}_refreshCurrentTimeShader(e){const t=this.$.timelineIndicatorsContainer;let i=t.querySelector(".jqx-gantt-chart-current-time-shader");if(!this.shadeUntilCurrentTime||!e)return void(i&&i.remove());const{cellObj:a,minutes:n,max:s}=e;i||(i=document.createElement("div"),i.classList.add("jqx-gantt-chart-current-time-shader")),i.style.width=a.left+a.width*(n/s)+"px",i.setAttribute("aria-label","Current Time Shader"),i.parentElement||t.appendChild(i)}_setTodayCell(e){const t=this;if(e)e instanceof Date&&(e=e.getTime());else{let i=0;e=t.currentTime,"day"===t.view&&(i=e.getHours()),e.setHours(i,0,0,0),e=e.getTime()}if("number"!=typeof e)return;const i=t.$.timelineViewCells.children;for(let t=0;t<i.length;t++){const a=i[t],n=new Date(a._date);n&&(n.getTime()===e?a.setAttribute("current",""):a.removeAttribute("current"))}}_getTodayCellObj(e){const t=this,i=t.view,a=t._timelineCells;e&&e.getTime||(e=t.currentTime);for(let t=0,n=a.length;t<n;t+=1){const n=a[t],s=n.date;switch(i){case"quarter":case"year":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth())return n;break;case"month":{const t=new Date(e);if(t.setDate(e.getDate()-e.getDay()),e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&t.getDate()===s.getDate())return n;break}case"week":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate())return n;break;case"day":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate()&&s.getHours()===e.getHours())return n}}}_getTaskDOMIndex(e){const t=this.$.timelineTasksContainer.children;if(!e||void 0===e.$.id)return-1;for(let i=0,a=t.length;i<a;i+=1)if(t[i]._cellObj.task===e)return i;return-1}_getTimelineCellByDate(e,t,i){const a=this,n=a._timelineCells;if(!n||0===n.length)return;const s=n.length-1;i=Math.min(s,"number"==typeof i?i:s);for(let s=t=Math.min(i,Math.max(0,"number"==typeof t?t:0));s<=i;s++){const t=n[s];if(!t)continue;const i=t.date;switch(a.view){case"quarter":case"year":if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth())return t;break;case"month":if("day"===a.monthScale){if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate())return t}else{const a=new Date(i);let n=new Date(i);if(n.setDate(n.getDate()+(6-n.getDay())+1),n.setMilliseconds(n.getMilliseconds()-1),e.getTime()>=a.getTime()&&e.getTime()<=n.getTime())return t}break;case"week":if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate())return t;break;case"day":if("hour"!==a.dayScale){if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate()&&i.getHours()===e.getHours()&&i.getMinutes()<=e.getMinutes())return t}else if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate()&&i.getHours()===e.getHours())return t}}const r=n[0],o=n[n.length-1];return e.getTime()<r.date.getTime()?r:e.getTime()>o.date.getTime()?o:void 0}_refreshViewDetailCell(e,t,i){const a=this,n=a._timelineCells,s=e.date;let r=0,o=0===i?0:void 0;for(void 0===t&&(t=0);t<n.length;t++){const e=n[t],i=a._getCellWidth(e,s);if(i)void 0===o&&(o=e.left+e.width-i),r+=i;else if(e.date.getTime()>s.getTime())break}return a._isLastWeekCellNotFull&&(delete a._isLastWeekCellNotFull,t--),e.width=r,e.left=o,t}_getCellWidth(e,t){const i=this,a=e.date,n=(e,t)=>e.getFullYear()===t.getFullYear(),s=(e,t)=>e.getMonth()===t.getMonth(),r=e.width;switch(i.view){case"month":{let e=new Date(a),o=new Date(e),l=0;for(o.setDate(o.getDate()+(6-e.getDay())+1),o.setMilliseconds(o.getMilliseconds()-1);e.getTime()<=o.getTime();)n(e,t)&&s(e,t)&&l++,e.setDate(e.getDate()+1);if(0===l)return;"day"!==i.monthScale&&(i._isLastWeekCellNotFull=l/7!=1);let d=r*l/7;return d<70?70:d}case"quarter":case"year":if(n(a,t))return r;break;case"week":{const e=new Date(t),n=new Date(t);if(-1!==i.firstDayOfWeek){const t=e.getDay()-i.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+i.firstDayOfWeek-(t>=0?0:7)),n.setDate(e.getDate()+6)}else e.setDate(t.getDate()-t.getDay()),n.setDate(t.getDate()+(6-t.getDay()));if(a.getTime()>=e.getTime()&&a.getTime()<=n.getTime())return r;break}case"day":if(n(a,t)&&s(a,t)&&a.getDate()===t.getDate())return r}}_getCellByOffsetLeft(e){const t=this._timelineCells;if(!e)return;let i;for(let a=0;a<t.length&&!(t[a].left>=e);a++)i=t[a];return i}_unselectAll(e,t){const i=this,a=i.$[`${e}TimelineCellsContainer`];let n;delete i._selected;const s=a.querySelectorAll(".jqx-timeline-row[selected]");for(let e=0;e<s.length;e++)s[e].removeAttribute("selected");if("task"===e){n="selectedTaskIds";const e=i.$.timelineTasksContainer.querySelectorAll(".jqx-timeline-task[selected]");for(let t=0;t<e.length;t++)e[t].removeAttribute("selected"),e[t].setAttribute("aria-selected","false")}else n="selectedResourceIds";if(i[`_${e}TreeChangeEventFired`]||i.$[e+"Table"].clearSelection(),i._highlightAssignedItem(e),t)return;const r=i[n].slice(0);r.length&&(i[n]=[],i._noChangeEvent||i.$.fireEvent("change",{value:[],oldValue:r,type:e}))}_getSegmentCellRange(e){const t=this;if(!e.classList||!e.classList.contains("jqx-task-segment"))return;const i=e.closest(".jqx-timeline-task");if(!i)return;let a,n,s=i._cellStart,r=i._cellEnd;s&&r||({cellStart:s,cellEnd:r}=t._getTaskBarCellRange(i));const o=t.rightToLeft,l=parseFloat(e.style.width)||e.offsetWidth,d=t._timelineCells;let c=parseFloat(i.style[o?"right":"left"]);c&&!isNaN(c)||(c=i.offsetLeft,o&&(c=t.$.timelineContent.offsetWidth-c));const m=c+parseFloat(e.style[o?"right":"left"])||(o?(parseFloat(i.style.width)||i.offsetWidth)-(e.offsetLeft+e.offsetWidth):e.offsetLeft),u=parseFloat((m+l).toFixed(2));for(let e=d.indexOf(s),t=d.indexOf(r);e<=t;e++){const t=d[e],i=t.left,s=t.width,r=parseFloat((i+s).toFixed(2));if(m>=i&&m<=r&&(a=t),!n&&u>i&&u<=r&&(n=t),a&&n)break}return a||(a=n||d[0]),n||(n=d[d.length-1]),{cellStart:a,cellEnd:n}}_getTaskBarCellRange(e){const t=this;if(!e.classList||!e.classList.contains("jqx-timeline-task"))return;let i=parseFloat(e.style.width)||e.offsetWidth;const a=t._timelineCells,n=t.$.timelineContent,s=parseFloat(e.style[t.rightToLeft?"right":"left"])||(t.rightToLeft?(parseFloat(n.style.width)||n.offsetWidth)-(e.offsetLeft+e.offsetWidth):e.offsetLeft);let r,o;e.classList.contains("milestone")&&(i/=2);const l=parseFloat((s+i).toFixed(2));for(let e=0;e<a.length;e++){const t=a[e],i=t.left,n=t.width,d=parseFloat((i+n).toFixed(2));if(s>=i&&s<=d&&(r=t),!o&&l>i&&l<=d&&(o=t),r&&o)break}return r||(r=e.classList.contains("milestone")&&o?o:a[0]),o||(o=a[a.length-1]),{cellStart:r,cellEnd:o}}_getDateFromCell(e,t,i){if(!t)return new Date;const a=this,n=new Date(t.date);let s,r=0,o=0,l=new Date(n);switch(l.setHours(0,0,0,0),i||(i=a.view),i){case"quarter":case"year":s=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),r=1,l.setDate(s);break;case"month":"day"===a.monthScale?(r=n.getDate(),s=1):(r=n.getDate(),s=7,l.setDate(l.getDate()+6));break;case"week":s=1,r=n.getDate();break;case"day":s=1/24,r=n.getDate(),o=n.getHours()}l.setHours(23,59,59,999);const d=parseFloat(((e-t.left)/t.width*s).toFixed(12)),c=Math.min(s,Math.floor(d)),m=d%1*24,u=Math.floor(m),h=60*Math.abs(m-u),g=Math.floor(h),f=60*Math.abs(h-g),p=Math.floor(f),_=1e3*Math.abs(f-p),T=Math.floor(_),b=new Date(n.getFullYear(),n.getMonth(),r+c,o+u,g,p,T);return b.getTime()>l?l:b}_getCellDateRange(e){if(!e||!e._date)return;const t=new Date(e._date);let i=new Date(t);switch(i.setHours(0,0,0,0),this.view){case"quarter":case"year":i.setDate(1),i.setMonth(i.getMonth()+1),i.setDate(0);break;case"month":i.setDate(i.getDate()+6);break;case"day":return i.setHours(t.getHours(),59,59,999),{dateStart:t,dateEnd:i}}return i.setHours(23,59,59,999),{dateStart:t,dateEnd:i}}_getTasksJSON(){const e=this;let t=e._tasks,i="project";return function t(a,n){if(!a)return;let s=[];for(let r=0;r<a.length;r++){const o=a[r];let l;if(!o.$[i]&&!n||o.$[i]===n){const i=e._getTaskConnections(o).taskConnections;l=e._cloneObject(o,!0),i.length&&(l.connections=i.map((e=>{const t={target:e.endIndex,type:e.type};return e.lag&&(t.lag=e.lag),t}))),l.tasks=t(e._getProjectTasks(o),o),delete l.$,s.push(l)}}return s}(t)}_cloneObject(e,t){let i={};for(let a in e){let n=e[a];"tasks"!==a&&("connections"!==a?n instanceof Date?i[a]=t?n.toISOString():new Date(n):i[a]=n:i[a]=JSON.parse(JSON.stringify(n)))}return t||delete i.$,i}_setTable(e){const t=this;e||(e=t.$.taskTable);const[i,a]=e===t.$.taskTable?[t.taskColumns,"task"]:[t.resourceColumns,"resource"];if(!t.contains(e))return;if(!i.length)return void(t.$[a+"Table"].dataSource=[]);const n=t._getTableColumns(a);"task"===a&&(e.filterRow=t.filterRow,[e.grouping,e.groupFormatFunction]=t.groupByResources?[!0,t._formatResourceGroups.bind(t)]:[!1,null]),e.isRendered&&e.resetState("expanded"),e.style.setProperty("--jqx-table-row-height",""),e.columns=n,e.dataSource=t._getTableDataSource(a,n),e.wait&&(t.$.taskTable.hasResizeObserver=!1,e.$.virtualizationContainer._scrollView.disableSwipeScroll=!0,e.$.virtualizationContainer.verticalScrollBarVisibility="hidden",e.$.virtualizationContainer.disabled=!0,e.columnMinWidth=t.columnMinWidth,e.columnResize=t.columnResize,e.columnResizeFeedback=t.columnResizeFeedback,e.filtering=t[`${a}Filtering`],e.sort=t.sortFunction,e.sortMode=t.sortMode,e.keyboardNavigation=t.keyboardNavigation,e.selectionByHierarchy=!1,e.selection=!t.disableSelection,e.hideSelectionColumn=!t.showSelectionColumn,e.onKeyboardScroll=(i,a)=>{const n=e===t.$.taskTable?t:t._resourceScrollView;a!==n.scrollTop&&(n.scrollTop=a)},e.wait=!1),e.$.virtualizationContainer.scrollTop="task"===a?t.scrollTop:t.$.resourceVerticalScrollBar.value,t._refresh()}_formatResourceGroups(e){const t=this,i=t._resources,a=e.data.data.resources.split(",");let n=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e],s=t.id+"";a.indexOf(s)>-1&&n.push(t.label||t.value||t.id)}t.resourceGroupFormatFunction?e.template=t.resourceGroupFormatFunction(a):e.template="<strong>"+(n.length?n.join(", "):t.localize("unassigned"))+"</strong>"}_formatResourceGroupLabel(e){const t=this,i=t._resources,a=e.split(",");if(!e)return t.localize("unassigned");let n=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e],s=t.id+"";a.indexOf(s)>-1&&n.push(t.label||t.value||t.id)}return n.length?n.join(", "):t.localize("unassigned")}_getTableColumns(e="task"){const t=this,i=["dateStart","dateEnd","minDateStart","maxDateStart","minDateEnd","maxDateEnd"],a=["progress","capacity","workload","maxCapacity","minCapacity"];let n="task"===e?t.taskColumns:t.resourceColumns,s=[];"task"===e&&t.groupByResources&&!n.find((e=>"resources"===e.value))&&(n=n.slice(0),n.push({label:"",value:"resources",hidden:!0}));for(let r=0,o=n.length;r<o;r++){const o=n[r],l=o.value,d={};d.label=t.localize(o.label)||o.label,d.dataField=l,l.startsWith("date")||i.indexOf(l)>-1?d.dataType="date":d.dataType="overdue"===l?"boolean":l.startsWith("duration")||a.indexOf(l)>-1?"number":"string",o.hidden&&(d.visible=!1),"function"==typeof o.formatFunction?d.formatFunction=i=>{const a=t._getValidItemAndIndex(i.data.itemId,e).item,n=i.column.toLowerCase();let s=i.value;n.indexOf("date")>-1?s=new Date(s):"resources"===n&&(s=s?s.split(","):[]),i.template=o.formatFunction.call(t,s,a?t._cloneObject(a):void 0)}:["date","number"].indexOf(d.dataType)>-1?d.formatFunction=i=>{const a=t._getValidItemAndIndex(i.data.itemId,e).item,n=t._formatColumnData(t._cloneObject(a),o);i.template=n}:"overdue"===l&&(d.formatFunction=e=>{const t=e.cell;e.value+""=="true"?t.setAttribute("overdue",""):t.removeAttribute("overdue"),e.value=""},d.width=t._taskDefaultHeight),o.size&&(d.width=o.size),s.push(d)}return s}_getTableDataSource(e="task",t){const i=this,a="task"===e?i._getTableData(i._tasks,i.taskColumns,e):i._getTableData(i._resources,i.resourceColumns,e),n=i.groupByResources,s=(()=>{let e=[];e.push("itemId: string"),e.push("projectId: string"),e.push("itemIndex: number"),n&&e.push("resources: string");for(let i=0,a=t.length;i<a;i+=1){const a=t[i];e.push(`${a.dataField}: ${a.dataType}`)}return e})();return i.groupByResources?new window.JQX.DataAdapter({dataFields:s,dataSource:a,groupBy:["resources"],id:"itemId"}):new window.JQX.DataAdapter({dataFields:s,dataSource:a,keyDataField:"itemId",parentDataField:"projectId",id:"itemId"})}_refreshTableDataSource(e="task"){const t=this,i="task"===e?t.$.taskTable:t.$.resourceTable;t.contains(i)&&(i.resetState("expanded"),i.dataSource=t._getTableDataSource(e,t._getTableColumns(e)))}_refreshColumnsHeaders(e){const t=this;e||(e="task");const i=t.$[`${e}Table`].columns,a=t[`${e}Columns`];for(let e=0,n=i.length;e<n;e++)i[e].label=t.localize(a[e].label)||a[e].label;!arguments.length&&t.$.mainSplitter.contains(t.$.resourceSplitter)&&t._refreshColumnsHeaders("resource")}_getTaskResourceIds(e){const t=e.resources,i=this._resources.map((e=>e.id));let a=[];if(Array.isArray(t))for(let e=0,n=t.length;e<n;e+=1){const n=t[e].id||t[e];i.indexOf(n)>-1&&a.push(n)}return a.sort()}_getTableData(e,t,i){const a=this,n=a.groupByResources;i||(i="task");const s=t.map((e=>e.value));let r=[],o=[];for(let l=0,d=e.length;l<d;l+=1){const d=e[l];if(d.hidden||n&&d.disableResources)continue;const c={},m=d.$.project,u=a._getTaskResourceIds(d);for(let e=0,n=s.length;e<n;e+=1)c[s[e]]=a._formatColumnData(d,t[e],i);c.expanded=n||d.expanded,c.itemId=d.$.id||d.id||"",c.itemIndex=l,u&&u.length?c.resources=u.toString():delete c.resources,d.$&&m&&(m.$.id?c.projectId=d.$.project.$.id:o.push(((e,t)=>{e.projectId=t.$.id}).bind(null,d,m))),r.push(c)}for(let e=0,t=o.length;e<t;e+=1)o[e]();return r}_formatColumnData(e,t){const i=this,a=t.value;let n=e[a];if(a){const e=(a+"").toLowerCase();if(e.indexOf("date")>-1||t.dateFormat)return i._formatDate(n,t);if(e.indexOf("duration")>-1||t.numberFormat){const e=parseFloat(n.toFixed(1));return t.numberFormat?i._formatNumber(e,t.numberFormat):e}}return null!=n?n.toString():i.localize("unassigned")}_formatDate(e,t){const i=this;if(e=Date.parse(e),!isNaN(e)){let a=t?t.dateFormat:void 0;if("string"==typeof a)return new JQX.Utilities.DateTime(new Date(e)).toString(a);if("object"==typeof a)a=t.dateFormat;else{const e=i.view;a={year:"numeric",month:"2-digit",day:"numeric"},["day","week"].indexOf(e)>-1&&(a.hour="numeric",a.minute="numeric",a.second="numeric")}return new Intl.DateTimeFormat(i.locale,a).format(new Date(e))}}_formatNumber(e,t,i){const a=this;if("object"==typeof t)return new Intl.NumberFormat(a.locale,t).format(""+e);i||(i={percentSymbol:"%",currencySymbol:"$",currencySymbolPosition:"before",decimalSeparator:".",thousandsSeparator:","});const n=e=>"number"==typeof e&&isFinite(e);if(""===t||null===t)return e;let s;n(e)||(e*=1),t.length>1&&(s=parseInt(t.slice(1),10));let r={},o=t.charAt(0).toUpperCase();switch(r.thousandsSeparator=i.thousandsSeparator,r.decimalSeparator=i.decimalSeparator,o){case"D":case"d":case"F":case"f":r.decimalPlaces=s;break;case"N":case"n":r.decimalPlaces=0;break;case"C":case"c":r.decimalPlaces=s,"before"===i.currencySymbolPosition?r.prefix=i.currencySymbol:r.suffix=i.currencySymbol;break;case"P":case"p":r.suffix=i.percentSymbol,r.decimalPlaces=s;break;default:throw"Bad number format specifier: "+o}if(n(e)){const t=e<0;let i=e+"";const a=r.decimalSeparator?r.decimalSeparator:".";let s;if(n(r.decimalPlaces)){var l=r.decimalPlaces,d=Math.pow(10,l);if(i=(e*d).toFixed(0)/d+"",s=i.lastIndexOf("."),l>0)for(s<0?(i+=a,s=i.length-1):"."!==a&&(i=i.replace(".",a));i.length-1-s<l;)i+="0"}else{let t=e+"";s=t.lastIndexOf("."),s>0&&void 0===l&&"."!==a&&(t=t.replace(".",a))}if(r.thousandsSeparator){const e=r.thousandsSeparator;s=i.lastIndexOf(a),s=s>-1?s:i.length;let n=i.substring(s),o=-1;for(var c=s;c>0;c--)o++,o%3==0&&c!==s&&(!t||c>1)&&(n=e+n),n=i.charAt(c-1)+n;i=n}return i=r.prefix?r.prefix+i:i,i=r.suffix?i+r.suffix:i,i}return e}_validateDate(e,t){return e[t]=this._dateValidator(void 0,e[t]),e[t]&&!isNaN(e[t].getTime())||(e[t]=void 0),e[t]}_validateTaskProperties(e,t){const i=this;if(e.$={},e.tasks instanceof Array&&e.tasks.length>0?e.type="project":(!e.type||["project","task","milestone"].indexOf(e.type)<0)&&(e.type="task"),i._validateTaskDuration(e),void 0===e.hidden&&t&&(e.hidden=t.hidden),e.hidden=!!e.hidden,void 0===e.resources?e.resources=[]:e.resources=[e.resources].reduce(((e,t)=>e.concat(t)),[]),"project"===e.type?e.expanded=!!e.expanded:delete e.expanded,e.progress=Math.min(Math.max(0,parseFloat(e.progress)||0),100),i._validateTaskDates(e,t),i._validateTaskSegments(e),i._validateTaskIndicators(e),i._validateTaskPlannedDates(e),e.deadline){const t=i._validateDate(e,"deadline");!t||isNaN(t.getTime())?delete e.deadline:e.dateEnd&&(e.overdue=e.deadline.getTime()-e.dateEnd.getTime()<0)}else e.overdue=!1,delete e.deadline;if(!e.dateStart&&!e.dateEnd&&"project"===e.type&&!e.synchronized)return;const a=e.connections;if(a instanceof Array){for(let e=0;e<a.length;e++){const t=a[e],i=t.target="string"==typeof t.target?t.target:parseInt(t.target),n=t.type=parseInt(t.type);null==i||"number"==typeof i&&isNaN(i)||isNaN(n)?(a.splice(a.indexOf(t),1),e--):t.lag=parseInt(t.lag)||0}e.connections=e.connections.map((e=>Object.assign({},e)))}else e.connections=[];return e.class=e.class?e.class+"":"",e.class=void 0!==e.class&&null!==e.class?e.class:"",e}_validateTaskIndicators(e){const t=this,i=e.indicators;if(!i||!Array.isArray(i)||!i.length)return void delete e.indicators;let a=[];for(let e=0,n=i.length;e<n;e+=1){const n=i[e];if("object"!=typeof n)continue;const s=t._validateDate(n,"date");s&&s.getTime&&!isNaN(s.getTime())&&a.push(n)}e.indicators=a}_validateTaskSegments(e){const t=this,i=e.segments;if(!i||!Array.isArray(i)||i.length<2||"task"!==e.type)return void delete e.segments;const a=t.nonworkingDays.length>0||t.nonworkingHours.length>0;let n,s=[],r=[];for(let e=0,a=i.length;e<a;e+=1){const a=i[e];if("object"!=typeof a)continue;let n=parseFloat(a.duration);isNaN(n)&&delete a.duration,t._validateTaskDates(a),a.dateStart&&a.dateEnd&&s.push(a)}s.sort(((e,t)=>e.dateStart.getTime()-t.dateStart.getTime()));for(let i=0,o=s.length;i<o;i+=1){const o=s[i];let l=o.dateStart,d=o.dateEnd;o.dateStart=l=new Date(Math.max(e.dateStart.getTime(),l.getTime())),o.dateEnd=d=new Date(Math.min(e.dateEnd.getTime(),d.getTime())),n&&n.dateEnd.getTime()>l.getTime()&&(o.dateStart=l=new Date(n.dateEnd.getTime()+1e3),l.getTime()>=d.getTime())||l.getTime()>d.getTime()||(o.duration=t._convertDuration(a?t._getWorkingTime(l,d):d.getTime()-l.getTime(),!0),n=o,r.push(o))}r.length<2?delete e.segments:(r[0].dateStart=new Date(e.dateStart),r[r.length-1].dateEnd=new Date(e.dateEnd),e.segments=r)}_validateTaskDuration(e){const t=this;let i=t._convertDuration(parseFloat(e.duration))||0,a=t._convertDuration(parseFloat(e.minDuration))||0,n=t._convertDuration(parseFloat(e.maxDuration))||0;a&&n&&(n=Math.max(a,n)),i&&(a?i=Math.max(a,i):n&&(i=Math.min(i,n))),e.duration=t._convertDuration(i,!0),e.minDuration=t._convertDuration(a,!0),e.maxDuration=t._convertDuration(n,!0)}_validateTaskDates(e,t){const i=this,a=i._convertDuration(e.minDuration),n=i._convertDuration(e.maxDuration);let s=i._convertDuration(e.duration);if(void 0!==e.minDateStart&&(e.minDateStart=i._validateDate(e,"minDateStart")),void 0!==e.maxDateStart&&(e.maxDateStart=i._validateDate(e,"maxDateStart")),e.minDateStart&&e.maxDateStart&&(e.maxDateStart=new Date(Math.max(e.minDateStart.getTime(),e.maxDateStart.getTime()))),void 0!==e.minDateEnd&&(e.minDateEnd=i._validateDate(e,"minDateEnd")),void 0!==e.maxDateEnd&&(e.maxDateEnd=i._validateDate(e,"maxDateEnd")),e.minDateEnd&&e.maxDateEnd&&(e.maxDateEnd=new Date(Math.max(e.minDateEnd.getTime(),e.maxDateEnd.getTime()))),e.dateStart=i._validateDate(e,"dateStart"),e.dateEnd=i._validateDate(e,"dateEnd"),e.dateStart||(e.minDateStart?e.dateStart=e.minDateStart:e.maxDateStart?e.dateStart=e.maxDateStart:e.dateStart=i.dateStart),e.dateEnd||(e.minDateEnd?e.dateEnd=e.minDateEnd:e.maxDateEnd&&(e.dateEnd=e.maxDateEnd)),e.minDateStart&&(e.dateStart=new Date(Math.max(e.minDateStart.getTime(),e.dateStart.getTime()))),e.maxDateStart&&(e.dateStart=new Date(Math.min(e.maxDateStart.getTime(),e.dateStart.getTime()))),e.minDateEnd&&(e.dateEnd=new Date(Math.max(e.minDateEnd.getTime(),e.dateEnd.getTime()))),e.maxDateEnd&&(e.dateEnd=new Date(Math.min(e.maxDateEnd.getTime(),e.dateEnd.getTime()))),e.dateStart&&(i.min&&(s=Math.min(e.dateStart.getTime()-i.min.getTime(),s),e.duration=i._convertDuration(s,!0)),i.max&&(s=Math.min(i.max.getTime()-e.dateStart.getTime(),s),e.duration=i._convertDuration(s,!0))),!e.dateStart&&s&&e.dateEnd&&(e.dateStart=new Date(e.dateEnd.getTime()-s)),"task"!==e.type||e.dateStart&&!isNaN(e.dateStart.getTime())||!t||(e.dateStart=new Date(t.dateStart)),a&&e.dateStart)if(i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)){const t=i._getTaskWorkingDateEnd(e,a);e.dateEnd=new Date(Math.max(e.dateEnd?e.dateEnd.getTime():0,t.getTime()))}else e.dateEnd=new Date(Math.max(e.dateEnd?e.dateEnd.getTime():0,e.dateStart.getTime()+a));if(s&&e.dateStart&&(i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)?e.dateEnd=i._getTaskWorkingDateEnd(e,s):e.dateEnd=new Date(e.dateStart.getTime()+s)),s||n){let t;t=i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)?i._getTaskWorkingDateEnd(e,Math.max(s,n)):new Date(e.dateStart.getTime()+Math.max(s,n)),e.dateEnd.getTime()>t.getTime()&&(e.dateEnd=t)}"task"===e.type&&!e.dateEnd&&t&&(e.dateEnd=new Date(t.dateEnd)),e.dateStart=i._minMaxDateValidator(e.dateStart),e.dateEnd=i._minMaxDateValidator(e.dateEnd),"milestone"===e.type&&(e.dateStart=i._validateDate(e,"dateStart"),e.dateEnd=i._validateDate(e,"dateEnd"),e.dateStart=e.dateEnd=new Date(Math.max(e.dateStart?e.dateStart.getTime():0,e.dateEnd?e.dateEnd.getTime():0))),(e.dateStart||e.dateEnd||"project"!==e.type||e.synchronized)&&("milestone"!==e.type&&e.dateStart&&(e.dateEnd&&e.dateStart.getTime()>e.dateEnd.getTime()||!e.dateEnd)&&(e.dateEnd=new Date(e.dateStart.getTime()+36e5*("day"===i.view?1:24))),e.dateStart&&e.dateEnd&&(e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0)))}_validateTaskPlannedDates(e){const t=this;if(!e)return;const i=e.type,a=e.planned;if("milestone"===i||!a)return;const n=t._validateDate(a,"dateStart"),s=t._validateDate(a,"dateEnd");n&&s&&(a.duration=t._convertDuration(t.nonworkingDays.length>0||t.nonworkingHours.length>0?t._getWorkingTime(n,s):s.getTime()-n.getTime(),!0))}_synchronizeProjectDates(e,t){const i=this;if(e){void 0===t&&(t=i._getProjectTasks(e));for(let n=0,s=t.length;n<s;n+=1){const s=t[n];e.synchronized&&(s.dateStart&&(e.dateStart=a(s,"dateStart","min")),s.dateEnd&&(e.dateEnd=a(s,"dateEnd","max")),s.minDateStart&&(e.minDateStart=a(s,"minDateStart","max")),s.maxDateStart&&(e.maxDateStart=a(s,"maxDateStart","min")),s.minDateEnd&&(e.minDateEnd=a(s,"minDateEnd","max")),s.maxDateEnd&&(e.maxDateEnd=a(s,"maxDateEnd","min")),e.dateStart&&e.dateEnd&&(e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0)))}e.$&&i._synchronizeProjectDates(e.$.project,t)}function a(t,i,a){const n=e[i];let s=t[i];return void 0===n?new Date(s):s instanceof Date?new Date(Math[a](n.getTime(),s.getTime())):void 0}}_synchronizeProjectVisibility(e,t){const i=this;e&&e.hidden&&!t.hidden&&(e.hidden=t.hidden,e.$&&i._synchronizeProjectVisibility(e.$.project,e))}_mouseWheelHandler(e){const t=this,i=(t.shadowRoot||t).querySelector(".jqx-task-popup-window");if(i&&i.modal&&i.opened)return void e.stopPropagation();if(t.disabled||!t.computedHorizontalScrollBarVisibility&&!t.computedVerticalScrollBarVisibility)return;if(e.shiftKey)return void t._handleHorizontalScroll(e);const a=t.$.resourceSplitterItem;t.$.mainSplitter.contains(a)&&a.contains(e.target)?t._handleVerticalScroll(e,!0):t.$.taskSplitterItem.contains(e.target)&&t._handleVerticalScroll(e)}_handleVerticalScroll(e,t){const i=this;let a,n,s,r;if(t){if(a=i.$.resourceVerticalScrollBar,a.classList.contains("jqx-hidden")||a.disabled)return!0;n=a.value,s=a.max,r=i._resourceScrollView}else{if(!i.computedVerticalScrollBarVisibility||i.$.verticalScrollBar.disabled)return!0;n=i.scrollTop,s=i.scrollHeight,r=i}if(0===n&&e.deltaY<0||n===s&&e.deltaY>0)return void e.stopPropagation();const o=i.$[t?"resourceTable":"taskTable"];if(e.stopPropagation(),e.preventDefault(),n+=i._getScrollCoefficient(e,i.offsetHeight),r){const e=o.$.virtualizationContainer;e.scrollHeight!==r.scrollHeight&&(e.scrollHeight=r.scrollHeight),r.scrollTo(n,void 0)}o.scrollTop=n,i._hoveredItem&&i._handleTableItemHover()}_handleHorizontalScroll(e){const t=this;if(!t.computedHorizontalScrollBarVisibility)return!0;const i=t.scrollLeft;(0===i&&e.deltaX<0||i===t.scrollHeight&&e.deltaX>0)&&e.stopPropagation(),e.stopPropagation(),e.preventDefault(),t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth))}_handleHeaderTemplate(e="task"){const t=this;if(!("content"in document.createElement("template")))return void t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}));const i=t.$[`${e}SplitterItemHeader`],a=t.$[`${e}SplitterItem`],n="task"===e?"headerTemplate":"resourcePanelHeaderTemplate";let s=t[n];if(a.removeAttribute("show-header"),i.innerHTML="",!s)return;if("function"==typeof s)return s(i,{}),void(i.innerHTML?a.setAttribute("show-header",""):a.removeAttribute("show-header"));if("string"==typeof s&&(s=document.getElementById(s)),null===s||!("content"in s))return void t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:n}));let r=document.importNode(s.content,!0);if(a.setAttribute("show-header",""),t.shadowRoot)return i.innerHTML="<slot></slot>",void t.appendChild(r);i.appendChild(r)}_handleCollapseExpandMethods(e,t){const i=this,a=i._tasks;if(null==e||!a||!a.length)return;const n=i._getValidItemAndIndex(e);if(!n||!n.item)return void i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"collapse",argumentName:"task"}));let s=n.item;"project"!==s.type&&(s=s.$.project),s&&(s.hidden?s.expanded="expand"===t:i.$.taskTable["expand"===t?"expandRow":"collapseRow"](s.$.id))}_getValidItemAndIndex(e,t="task"){const i=this,a="task"===t?i._tasks:i._resources;let n;if(null==e||!a||!a.length)return{};if("string"==typeof e||"number"==typeof e){const t=e.toString();let i,s;for(let n=0,r=a.length;n<r;n+=1){const r=a[n];if(!i){const a=r.id;if(null!=a&&a.toString&&a.toString()===t){i=r,e=n;break}}r.$.id===t&&(s=r,e=n)}n=i||s}else"object"==typeof e&&(n=a[i._getItemIndex(e,t)],e=a.indexOf(n));return{item:n,index:e}}_horizontalScrollbarHandler(e){const t=this,i=t._getScrollLeft(e.detail.value);e.stopPropagation&&e.stopPropagation(),t.$.timelineHeader.scrollLeft=t.$.taskTimelineContainer.scrollLeft=i,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&(t.$.resourceTimelineHeader.scrollLeft=t.$.resourceTimelineContent.scrollLeft=i),t._recycle(e),e.context.min!==e.context.value?e.context.max===e.context.value&&(t._handleInfiniteTimeline(),t.$.fireEvent("scrollRightReached")):t.$.fireEvent("scrollLeftReached")}_verticalScrollbarHandler(e){const t=this,i=e.target,a=Math.round(e.detail.value);e.stopPropagation&&e.stopPropagation(),t._refreshing||(i&&i===t.$.resourceVerticalScrollBar?t.$.resourceTable.scrollTop=t.$.resourceTimelineContent.scrollTop=a:(t.$.taskTimelineContainer.scrollTop=a,t.$.taskTable.scrollTop=a),t._recycle(e),e.context.max!==e.context.value?e.context.min===e.context.value&&t.$.fireEvent("scrollTopReached"):t.$.fireEvent("scrollBottomReached"))}_handleInfiniteTimeline(){const e=this,t=e._timelineCells;if(!e.infiniteTimeline||!t||!t.length)return;const i=e.infiniteTimelineStep,a=t[t.length-1].date;switch(e.view){case"quarter":case"year":a.setMonth(a.getMonth()+i);break;case"month":a.setDate(a.getDate()+7*i);break;case"week":a.setDate(a.getDate()+i);break;case"day":a.setHours(a.getHours()+i)}e.set("dateEnd",a),e._createTimelineCells(),e._recycleTimelineTasks(!0),e.$.mainSplitter.contains(e.$.resourceSplitter)&&e._refreshResourceTimeline(),e._refresh()}_nonworkingDayValidator(e,t){return this._nonworkingDateTimeValidator(e,t)}_nonworkingTimeValidator(e,t){return this._nonworkingDateTimeValidator(e,t,!0)}_nonworkingDateTimeValidator(e,t,i){const a=this,[n,s,r]=i?[0,23,24]:[0,6,7];let o=[];function l(e){let t=Math.max(n,Math.min(s,parseInt(e[0]))),i=Math.max(n,Math.min(s,parseInt(e[1])));if(!isNaN(t)&&!isNaN(i)){for(;t!==i;)o.push(t),t=t===s?n:++t;o.push(t)}return o}for(let e=0;e<t.length;e++){const i=t[e];"number"!=typeof i||isNaN(i)?"string"==typeof i?o=l(i.split("-").map((e=>parseInt(e)))):Array.isArray(i)&&(o=l(i)):o.push(Math.max(n,Math.min(s,parseInt(i))))}return o.length===r&&(o.pop(),a.warn(a.localize("invalidNonworkingRange",{elementType:a.nodeName.toLowerCase(),property:i?"nonworkingHours":"nonworkingDays"}))),o}});
90
+ JQX("jqx-gantt-chart",class extends JQX.ScrollViewer{static get properties(){return{adjustToNonworkingTime:{value:!1,type:"boolean"},autoSchedule:{value:!1,type:"boolean"},autoScheduleStrictMode:{value:!1,type:"boolean"},autoScrollStep:{value:5,type:"number"},columnMenu:{value:!1,type:"boolean"},columnMinWidth:{value:"50px",type:"any"},columnResize:{value:!1,type:"boolean"},columnResizeFeedback:{value:!1,type:"boolean"},currentTime:{value:new Date,type:"any",validator:"_dateValidator"},currentTimeIndicator:{value:!1,type:"boolean"},currentTimeIndicatorInterval:{value:1,validator:"_currentTimeIndicatorIntervalValidator",type:"number"},dataExport:{value:{exportFiltered:{value:!1,type:"boolean"},itemType:{value:"task",type:"string"},fileName:{value:"smartGanttChart",type:"string?"}},type:"object"},dataSource:{value:[],type:"any",reflectToAttribute:!1},dateEnd:{value:"",type:"any",validator:"_dateValidator"},dateStart:{value:"",type:"any",validator:"_dateValidator"},dateMarkers:{value:[],reflectToAttribute:!1,type:"array"},dayFormat:{value:"short",allowedValues:["2-digit","numeric","long","short","narrow"],type:"string"},dayScale:{value:"hour",allowedValues:["hour","halfHour","quarterHour"],type:"string"},disableAutoScroll:{value:!1,type:"boolean"},disableTaskDrag:{value:!1,type:"boolean"},disableTaskProgressChange:{value:!1,type:"boolean"},disableTaskResize:{value:!1,type:"boolean"},disableSelection:{value:!1,type:"boolean"},disableSegmentDrag:{value:!1,type:"boolean"},disableSegmentResize:{value:!1,type:"boolean"},disableWindowEditor:{value:!1,type:"boolean"},durationUnit:{value:"milisecond",allowedValues:["day","week","hour","minute","second","milisecond"],type:"string"},filterRow:{value:!1,type:"boolean"},firstDayOfWeek:{value:-1,type:"number"},groupByResources:{value:!1,type:"boolean"},headerTemplate:{value:null,type:"any"},hourFormat:{value:"default",allowedValues:["default","2-digit","numeric"],type:"string"},hideDateMarkers:{value:!1,type:"boolean"},hideTimelineHeaderDetails:{value:!1,type:"boolean"},hideTimelineSecondHeaderDetails:{value:!0,type:"boolean"},hideTimelineHeader:{value:!1,type:"boolean"},hideResourcePanel:{value:!1,type:"boolean"},showSelectionColumn:{value:!1,type:"boolean"},infiniteTimeline:{value:!1,type:"boolean"},infiniteTimelineStep:{value:5,type:"number"},inverted:{value:!1,type:"boolean"},keyboardNavigation:{value:!1,type:"boolean"},messages:{extend:!0,value:{en:{duplicateIds:"{{elementType}}: DataSource contains duplicate ids. Tasks should have unique ids. The following ids are duplicating: {{duplicates}}.",invalidNonworkingRange:"{{elementType}}: Invalid {{property}} value. {{property}} should not contain all possible days/hours because it will result in an endless timeline. The value has been validated by removing the last item from the new value range.",invalidValue:"{{elementType}}: Invalid {{property}} value. {{property}} should be of type {{typeOne}} or {{typeTwo}}.",incorrectArgument:"{{elementType}}: Incorrect argument {{argumentName}} in method {{methodName}}.",outOfBounds:"{{elementType}}: Out of bounds argument {{argumentName}} in method {{methodName}}.",missingReference:"{{elementType}}: Missing reference to {{file}} in method {{methodName}}.",alreadyExists:"{{elementType}}: The item already exists when calling the {{methodName}} method.",notExisting:"{{elementType}}: The item does not exists when calling the {{methodName}} method.",notAProject:"{{elementType}}: The {{argumentName}} argument in {{methodName}} method does not reference an item of type 'project'.",noId:"smartGanttChart requires an id in order to save/load/clear a state.",ok:"Ok",add:"Add",remove:"Remove",cancel:"Cancel",delete:"Delete",confirm:"{{componentName}} will be deleted permanently, <b>are you sure? </b>",taskColumnLabel:"Task Name",resourceColumnLabel:"Resource Name",deleteLink:"Delete link",unassigned:"Unassigned",generalTab:"General",dependencyTab:"Dependency",segmentsTab:"Segments",segment:"Segment",dependencyValidation:"*The Task cannot be connected to itself.",segmentsCountValidation:"*Segmented Tasks must have at least 2 segments. ",segmentConflictError:'*The Segment "{{label}}" is in conflict, because it starts on/before and ends on/after the {{dateConflict}} of Segment "{{conflictLabel}}." ',segmentStartError:'*The Segment "{{label}}" cannot start before it ends and cannot end before it starts.',segmentEndError:'*The Segment "{{label}}" cannot start when it ends.',segmentRangeError:'*The Segment "{{label}}" is out of Task date range. The first segment must start when the task starts and the last segment must end when the task ends.',label:"Label",duration:"Duration",dateStart:"Date Start",dateEnd:"Date End",id:"Id",name:"Name",type:"Type",lag:"Lag",startToStart:"Start-To-Start",endToStart:"End-To-Start",endToEnd:"End-To-End",startToEnd:"Start-To-End",overdue:"Overdue",weeks:"week(s)",days:"day(s)",hours:"hour(s)",minutes:"minute(s)",seconds:"second(s)",miliseconds:"milisecond(s)",task:"Task",resource:"Resource",assignments:"Assignments",startTask:"Task Start",endTask:"Task End",deadline:"Deadline",quarter:"Quarter",quarterShort:"Q"}},type:"object"},monthFormat:{value:"short",allowedValues:["2-digit","numeric","long","short","narrow"],type:"string"},monthScale:{value:"week",allowedValues:["day","week"],type:"string"},max:{value:new Date(2100,0,1),type:"any",validator:"_dateValidator"},min:{value:new Date(1900,0,1),type:"any",validator:"_dateValidator"},nonworkingDays:{value:[],type:"array",validator:"_nonworkingDayValidator"},nonworkingHours:{value:[],type:"array",validator:"_nonworkingTimeValidator"},onTaskRender:{value:null,reflectToAttribute:!1,type:"function?"},popupWindowCustomizationFunction:{value:null,reflectToAttribute:!1,type:"function?"},popupWindowTabs:{value:["general","dependency","segments"],reflectToAttribute:!1,type:"array"},progressLabelFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resizeHandlesVisibility:{allowedValues:["auto","hidden","visible"],value:"auto",type:"string"},quarterFormat:{value:"short",allowedValues:["long","short","numeric"],type:"string"},resourceColumns:{value:[{label:"resourceColumnLabel",value:"label"}],type:"array",reflectToAttribute:!1},resourceFiltering:{value:!1,type:"boolean"},resourceGroupFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resourcePanelHeaderTemplate:{value:null,type:"any"},resourcePanelMin:{value:100,type:"any"},resourcePanelSize:{value:"",type:"any"},resourcePanelRefreshRate:{value:0,reflectToAttribute:!1,type:"number"},resourceTimelineFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},resourceTimelineMode:{allowedValues:["diagram","histogram","custom"],value:"diagram",type:"string"},resourceTimelineView:{allowedValues:["hours","tasks","custom"],value:"hours",type:"string"},selectedTaskIds:{value:[],type:"array"},selectedResourceIds:{value:[],type:"array"},shadeUntilCurrentTime:{value:!1,type:"boolean"},showBaseline:{value:!1,type:"boolean"},showProgressLabel:{value:!1,type:"boolean"},snapToNearest:{value:!1,type:"boolean"},sortFunction:{value:null,type:"function?",reflectToAttribute:!1},sortMode:{value:"none",allowedValues:["none","one","many"],type:"string"},taskColumns:{value:[{label:"taskColumnLabel",value:"label"}],type:"array",reflectToAttribute:!1},taskFiltering:{value:!1,type:"boolean"},taskPanelMin:{value:200,type:"any"},taskPanelSize:{value:"",type:"any"},timelineHeaderFormatFunction:{value:null,reflectToAttribute:!1,type:"function?"},timelineMin:{value:200,type:"any"},treeMin:{value:100,type:"any"},treeSize:{value:"20%",type:"any"},tooltip:{value:{enabled:{value:!1,type:"boolean"},arrow:{value:!1,type:"boolean"},delay:{value:50,type:"number"},offset:{value:[0,5],type:"array"}},type:"object"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},view:{value:"year",allowedValues:["day","week","month","quarter","year"],type:"any"},yearFormat:{value:"numeric",allowedValues:["2-digit","numeric"],type:"string"},weekFormat:{value:"long",allowedValues:["long","numeric"],type:"string"}}}template(){return'<div id="container" role="presentation">\n <jqx-splitter id="mainSplitter" auto-fit-mode="end" keep-proportions-on-resize right-to-left="[[rightToLeft]]" animation="[[animation]]" orientation="horizontal">\n <jqx-splitter-item id="taskSplitterItem" class="jqx-task-splitter-item">\n <div id="taskSplitterItemHeader" class="jqx-task-panel-header"></div>\n <jqx-splitter id="taskSplitter" class="jqx-task-splitter" auto-fit-mode="end">\n <jqx-splitter-item id="tableSplitterItem">\n <jqx-table right-to-left="[[rightToLeft]]" wait id="taskTable" class="jqx-task-table" virtualization animation="none" deferred-scroll-delay="0" ></jqx-table>\n </jqx-splitter-item>\n <jqx-splitter-item id="timelineSplitterItem" class="jqx-timeline-splitter-item">\n <div id="timeline" class="jqx-timeline">\n <div id="timelineHeader" class="jqx-timeline-header" role="rowgroup">\n <div id="timelineHeaderContent" class="jqx-timeline-header-content">\n <div class="jqx-timeline-view-details" id="timelineViewDetails" role="row"></div>\n <div class="jqx-timeline-view-details jqx-hidden" id="timelineViewSubDetails" role="row"></div>\n <div class="jqx-timeline-view-cells" id="timelineViewCells" role="row"></div>\n </div>\n </div>\n <div id="taskTimelineContainer" class="jqx-timeline-content-container">\n <div id="timelineContent" class="jqx-timeline-content">\n <div id="taskTimelineCellsContainer" class="jqx-timeline-cells-container" aria-hidden="true"></div>\n <div id="taskIndicatorsContainer" class="jqx-timeline-indicators-container" role="group"></div>\n <div id="timelineConnectionsContainer" class="jqx-timeline-connections-container" role="group"></div>\n <div id="timelineBaselinesContainer" class="jqx-timeline-baselines-container" role="group"></div>\n <div id="timelineTasksContainer" class="jqx-timeline-tasks-container" role="group"></div>\n <div id="timelineMarkers" class="jqx-timeline-markers-container" role="group"></div>\n <div id="timelineDeadlines" class="jqx-timeline-deadlines-container" role="group"></div>\n </div>\n </div>\n </div>\n <jqx-scroll-bar id="verticalScrollBar" class="jqx-timeline-scroll-bar" orientation="vertical"\n right-to-left="[[rightToLeft]]" aria-controls="[[id]]">\n </jqx-scroll-bar>\n </jqx-splitter-item>\n </jqx-splitter>\n </jqx-splitter-item>\n </jqx-splitter>\n <jqx-scroll-bar wait id="horizontalScrollBar" class="jqx-timeline-scroll-bar"></jqx-scroll-bar>\n </div>'}static get listeners(){return{down:"_downHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.dragstart":"_dragStartHandler","container.wheel":"_mouseWheelHandler","horizontalScrollBar.change":"_horizontalScrollbarHandler","verticalScrollBar.change":"_verticalScrollbarHandler","resourceVerticalScrollBar.change":"_verticalScrollbarHandler","mainSplitter.resizeEnd":"_resizeEventHandler","mainSplitter.resize":"_resizeEventHandler",move:"_moveHandler","mainSplitter.change":"_tableChangeHandler","mainSplitter.filter":"_tableSortFilterHandler","mainSplitter.sort":"_tableSortFilterHandler","mainSplitter.columnResize":"_tableColumnResizeHandler","taskTable.group":"_taskTableGroupEventHandler","taskTable.collapse":"_taskTableExpandHandler","taskTable.expand":"_taskTableExpandHandler","taskTable.keydown":"_taskTableKeyDownHandler"}}static get styleUrls(){return["jqx.ganttchart.css"]}attached(){const e=this;if(super.attached(),e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e.$.taskSplitterItem,e.$.horizontalScrollBar,e.$.verticalScrollBar)),!e._resourceScrollView&&e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._resourceScrollView=new JQX.Utilities.Scroll(e.$.resourceSplitterItem,e.$.horizontalScrollBar,e.$.resourceVerticalScrollBar)),e.scrollLeft){const t=e._getScrollLeft(e.scrollLeft);e.$.timelineHeader.scrollLeft=e.$.taskTimelineContainer.scrollLeft=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineHeader.scrollLeft=e.$.resourceTimelineContent.scrollLeft=t)}if(e.scrollTop){const t=e.scrollTop;e.$.taskTimelineContainer.scrollTop=t,e.$.timelineContent.scrollTop=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollTop=t)}const t=["taskPopupWindow","connectionPopupWindow","confirmPopupWindow"];for(let i=0;i<t.length;i++){const a=t[i];if(e.$[a]&&e.$[a].opened){const t=e["$"+a];e._handleModal(!0),t.listen("close",e._popupWindowCloseHandler.bind(e)),t.listen("closing",e._popupWindowClosingHandler.bind(e)),t.listen("open",e._popupWindowOpenHandler.bind(e)),t.listen("click",e._popupWindowClickHandler.bind(e)),t.listen("change",e._popupWindowChangeHandler.bind(e)),t.listen("transitionend",e._popupWindowTransitionendHandler.bind(e)),e.getShadowRootOrBody().appendChild(e.$[a])}}e._handleTooltipEvents(!0),e._currentTimeIndicatorInterval||!e.currentTimeIndicator&&!e.shadeUntilCurrentTime||e._setCurrentTimeIndicators()}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),e._resourceScrollView&&(e._resourceScrollView.unlisten(),delete e._resourceScrollView);const t=["taskPopupWindow","connectionPopupWindow","confirmPopupWindow"];e._handleModal();for(let i=0;i<t.length;i++){const a=t[i],n=e["$"+a];e.$[a]&&e.$[a].remove(),n&&(n.unlisten("open"),n.unlisten("close"),n.unlisten("closing"),n.unlisten("click"),n.unlisten("change"),n.unlisten("transitionend"))}e._handleTooltipEvents(),clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval}propertyChangedHandler(e,t,i){const a=this;switch(e){case"adjustToNonworkingTime":for(let e=0;e<a._tasks.length;e++){const t=a._tasks[e],i=t.$.project;a._validateTaskDates(t,i),a._validateTaskSegments(t),a._synchronizeProjectDates(t,i),a._refreshTableColumnsData(t,["dateEnd","duration"])}a._refreshTimeline();break;case"animation":break;case"autoSchedule":i?a._autoSchedule():a._autoScheduleRestore();break;case"autoScheduleStrictMode":i&&(a._autoSchedule(),a._refreshTimeline());break;case"columnMinWidth":case"columnResizeFeedback":case"columnResize":{const t=a.$.taskTable,n=a.$.resourceTable;t[e]=i,n&&(n[e]=i);break}case"currentTimeIndicator":case"shadeUntilCurrentTime":a._setCurrentTimeIndicators();break;case"dataSource":a.scrollLeft=a.scrollTop=0,a._createTasks(),a._refreshTableDataSource(),a._createTimeline(),a._createResourceTimeline(),a._setAriaControls();break;case"dateMarkers":a._createDateMarkers();break;case"hideDateMarkers":a._recycleDateMarkers();break;case"disableSelection":{const e=a.$.taskTable,t=a.$.resourceTable;e&&(e.selection=!a.disableSelection),t&&(t.selection=!a.disableSelection);break}case"durationUnit":for(let e=0;e<a._tasks.length;e++){const t=a._tasks[e],i=t.$.project;a._validateTaskDuration(t),a._validateTaskDates(t,i),a._validateTaskSegments(t),a._synchronizeProjectDates(t,i)}a._createTimelineCells(),a._insertTimelineTasks(),a.taskColumns.some((e=>(e.value+"").toLowerCase().indexOf("duration")>-1))&&a._refreshTableDataSource();break;case"filterRow":a.$.taskTable[e]=i;break;case"groupByResources":a._setTable(a.$.taskTable),a._createTimelineContent(),a._recycleTimelineTasks(),a._refresh();break;case"infiniteTimeline":i?a._scrollView.hScrollBar.value===a._scrollView.hScrollBar.max&&a._handleInfiniteTimeline():a.set("dateEnd","");break;case"keyboardNavigation":case"columnMenu":case"hideSelectionColumn":case"sortMode":a.$.taskTable[e]=i,a.$.resourceTable&&(a.$.resourceTable[e]=i);break;case"popupWindowTabs":case"popupWindowCustomizationFunction":{const e=a.$.taskPopupWindow;e&&(e.opened&&(e.close(),delete e._target),e.clear());break}case"taskFiltering":a.$.taskTable.filtering=i,a._refresh();break;case"resourceFiltering":{const e=a.$.resourceTable;e&&(e.filtering=i,a._refresh());break}case"tooltip_enabled":{const e=a.$.tooltip;e&&(i||e.remove(),a._handleTooltipEvents(i));break}case"tooltip_arrow":case"tooltip_delay":case"tooltip_offset":{const t=a.$.tooltip;t&&(t[e.replace("tooltip_","")]=i);break}case"headerTemplate":a._handleHeaderTemplate();break;case"inverted":if(a._handleInverted(),a.scrollLeft){const e=a._getScrollLeft(a.scrollLeft);a.$.timelineHeader.scrollLeft=a.$.taskTimelineContainer.scrollLeft=e,a.$.mainSplitter.contains(a.$.resourceTimelineHeader)&&(a.$.resourceTimelineHeader.scrollLeft=a.$.resourceTimelineContent.scrollLeft=e)}break;case"rightToLeft":Array.from(a.querySelectorAll("jqx-splitter, jqx-table, jqx-scroll-bar")).forEach((t=>t[e]=i)),a.closeWindow(),a._handleInverted(),a._refreshTimeline();break;case"firstDayOfWeek":case"dateStart":case"dateEnd":a._refreshTimeline();break;case"messages":case"locale":case"dayFormat":case"hourFormat":case"timelineHeaderFormatFunction":case"monthFormat":case"yearFormat":a._refreshHeaderDate(!0),a._refreshColumnsHeaders(),a._recycleResourceHeaderCells();break;case"hideResourcePanel":a._createResourceTimeline(),a._refreshTimeline();break;case"nonworkingDays":case"nonworkingHours":a._refreshAfterWorkingTimeChange();break;case"selectedTaskIds":a.$.taskTable.selected=a._getSelection("task",i);break;case"selectedResourceIds":a.$.resourceTable&&(a.$.resourceTable.selected=a._getSelection("resource",i));break;case"resourceColumns":a._setTable(a.$.resourceTable),a._highlightAssignedItem("task",a._getSelection("task",a.selectedTaskIds));break;case"resourcePanelHeaderTemplate":a._handleHeaderTemplate("resource");break;case"resourceTimelineView":case"resourceTimelineMode":case"resourceTimelineFormatFunction":a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._resources.forEach((e=>a._refreshResourceTimelineContent(e)));break;case"showProgressLabel":case"progressLabelFormatFunction":a._tasks.forEach((e=>a._setTaskBarProgress(e)));break;case"sortFunction":a.$.taskTable.sort=i,a.$.resourceTable&&(a.$.resourceTable.sort=i);break;case"showSelectionColumn":a.$.taskTable.hideSelectionColumn=!i,a.$.resourceTable&&(a.$.resourceTable.hideSelectionColumn=!i);break;case"taskColumns":a._setTable(a.$.taskTable);break;case"timelineMin":a.$.timelineSplitterItem.min=i,a.$.taskSplitter.refresh(),a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._synchronizeSplitters(a.$.taskSplitter,a.$.resourceSplitter);break;case"treeMin":case"treeSize":{const t=e.toLowerCase().indexOf("size")>-1?"size":"min";a.$.tableSplitterItem[t]=i,a.$.taskSplitter.refresh(),a.$.mainSplitter.contains(a.$.resourceSplitter)&&a._synchronizeSplitters(a.$.taskSplitter,a.$.resourceSplitter);break}case"taskPanelMin":case"taskPanelSize":case"resourcePanelSize":case"resourcePanelMin":{const t=e.indexOf("Min")>-1?"min":"size",n=e.indexOf("resource")>-1?"resource":"task";a.$.mainSplitter.contains(a.$.resourceSplitter)&&(a.$[`${n}SplitterItem`][t]=i,a.$.taskSplitterItem._setSize("size",a.taskPanelSize),a.refresh());break}case"unfocusable":a._setFocusable();break;case"monthScale":case"dayScale":case"view":a._refreshTimeline(t);break;default:super.propertyChangedHandler(e,t,i)}}_predefPropertyGetter(e){const t=this;Object.defineProperty(t,e,{get:function(){switch(e){case"dataSource":{if(t.context===t)return t.properties[e].value;const i=function(e){if(!e.length)return e;for(let a=0;a<e.length;a++){const n=e[a];let s=t._getProjectTasks(n);s&&Array.isArray(s)&&(s=i(s.filter((e=>e.$&&e.$.project===n)))),e[a]=t._cloneObject(n),s&&s.length?e[a].tasks=s:delete e[a].tasks}return e},a=t.properties[e].value;return a instanceof JQX.DataAdapter?a:i(a.slice(0))}case"dateStart":case"dateEnd":{const i=t._timelineCells;if(i.length){const a=t._getCellDateRange({_date:i["dateStart"===e?0:i.length-1].date});return new Date(a[e])}return t.properties[e].value}default:return t.properties[e].value}},set(i){t.updateProperty(t,t._properties[e],i)}})}ready(){this._customScrollView=!0,super.ready()}render(){const e=this,t=window.getComputedStyle(e),i=JQX.Utilities.Core;e._isMobile=i.isMobile,e._isFirefox=i.Firefox,e._taskBarMinWidth=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-task-min-width"))||0,e._taskDefaultHeight=parseFloat(t.getPropertyValue("--jqx-gantt-chart-task-default-height"))||30,e._timelineCellSize=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-cell-size"))||0,e._timelineCellMinSize=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-cell-min-size"))||0,e._taskConnectionWidth=parseFloat(t.getPropertyValue("--jqx-gantt-chart-timeline-task-connection-width"))||1,e._baselineProportion=parseFloat(t.getPropertyValue("--jqx-gantt-chart-baseline-proportion"))||0,e._predefPropertyGetter("dataSource"),e._predefPropertyGetter("dateStart"),e._predefPropertyGetter("dateEnd"),e.$.tableSplitterItem.size=e.treeSize,e.$.tableSplitterItem.min=e.treeMin,e.$.timelineSplitterItem.min=e.timelineMin,e._setScrollBars(),e._handleHeaderTemplate(),e._handleInverted(!0),e._createTasks(),e._setTable(),e._createTimeline(),e._createResourceTimeline(),e._setAriaControls(),e._setFocusable(),e.checkLicense(),(e.shadowRoot||e._isFirefox)&&requestAnimationFrame((()=>e.refresh())),super.render()}refresh(e){const t=this;if(e)return t._refreshTimeline(),t._setTable(t.$.taskTable),void t._createResourceTimeline();t.isRendered&&t._resizeEventHandler()}addFilter(e,t){const i=this;if(!i.taskFiltering&&!i.resourceFiltering||!(t instanceof JQX.Utilities.FilterGroup))return;Array.isArray(e)||(e="object"==typeof e?[e]:[]);const a=i.taskColumns,n=i.resourceColumns,s=i.$.taskTable,r=i.$.resourceTable;for(let i=0;i<e.length;i++){const o=e[i],l=o.type,[d,c]="resource"===l||n.includes(o)?[r,n]:[s,a],m=c.find((e=>o.value&&e.value===o.value));m&&d.addFilter(m.value,t)}}clearSelection(){this._unselectAll("task"),this._unselectAll("resource")}static get requires(){return{"JQX.Splitter":"jqx.splitter.js","JQX.Tree":"jqx.tree.js","JQX.Window":"jqx.window.js"}}ensureVisible(e,t="task"){const i=this,a=i._getValidItemAndIndex(e,t);(e=a?a.item:void 0)&&(i._ensureVisible(e,t),i._scrollTo(e.dateStart,!0))}removeAllConnections(){const e=this;e.isCompleted&&(e.$.timelineConnectionsContainer.innerHTML="",e._connections=[],e._tasks.map((e=>e.connections=[])))}removeConnection(){const e=this,t=Array.from(arguments).filter((e=>void 0!==e));if(!e.isCompleted)return;let i;if(1===t.length){if("string"==typeof t[0]){const e=document.getElementById(t[0]);e&&(i=e.getAttribute("connection-id"))}i||(i=(t[0]+"").split("-"),i=e._getValidConnectionId(i[0],i[1],i[2],"removeConnection"))}else 3===t.length&&(i=e._getValidConnectionId(t[0],t[1],t[2],"removeConnection"));i&&(e._removeConnection(i),e.$.fireEvent("itemRemove",{type:"connection",id:`${i[0]}-${i[1]}-${i[2]}`,item:{source:i[0],target:i[1],type:i[2]}}))}removeTaskConnection(e,t){const i=this;if(!i.isCompleted)return;if((e+="").indexOf("-")>-1&&!t){const i=e.split("-");t=i[1],e=i[0]}const a=i._getValidItemAndIndex(e),n=i._getValidItemAndIndex(t);e=a?a.index:void 0,t=n?n.index:void 0,isNaN(e)?i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"removeTaskConnection",argumentName:"taskEndIndex"})):i._removeConnection(""+e+(isNaN(t)?"":t))}beginUpdate(){this._isUpdating={started:!0,type:{}},this.$.fireEvent("beginUpdate")}endUpdate(){const e=this;function t(){e._refreshTableDataSource(),e._createTimelineContent(),e._recycleTimelineTasks(),e._setAriaControls();const t=e._resources;for(let i=0;i<t.length;i++)e._refreshTableColumnsData(t[i],void 0,"resource")}function i(){if(e.hideResourcePanel)return;e._refreshTableDataSource("resource"),e._recycleResourceHeaderCells(),e._createResourceTimelineContent(),e._refresh();const t=e._tasks;for(let i=0;i<t.length;i++)e._refreshTableColumnsData(t[i])}if(!e._isUpdating)return;const a=1===Object.keys(e._isUpdating.type).length?Object.keys(e._isUpdating.type)[0]:void 0;let n,s;switch(e._selected&&({task:n,resource:s}=e._selected),delete e._isUpdating,a){case"task":t();break;case"resource":i();break;default:t(),i()}n&&(e._refreshSelectedItems("task",n),e.$.taskTable.selected=e._getSelection("task",e.selectedTaskIds)),s&&(e._refreshSelectedItems("resource",s),e.$.resourceTable.selected=e._getSelection("resource",e.selectedResourceIds)),e.$.fireEvent("endUpdate")}clearFilters(e){this._resetFromAction(e,"clearFilters")}clearSort(e){const t=this;"task"!==e&&"resource"!==e?(t._resetFromAction("task","clearSort"),t._resetFromAction("resource","clearSort")):t._resetFromAction(e,"clearSort")}clearTasks(){this._clearTasks()}_clearTasks(){const e=this;e._selected&&delete e._selected.task,e.set("selectedTaskIds",[]),e._tasks=[],e._timelineCells=[],e._timelineVCells=[],e._timelineHeaderCells=[],e.$.timelineContent.style.width="",e.$.container.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height"),e.$.timelineViewDetails.innerHTML="",e.$.timelineViewCells.innerHTML="",e.$.taskTimelineCellsContainer.innerHTML="",e.$.timelineConnectionsContainer.innerHTML="",e.$.timelineTasksContainer.innerHTML="",e.$.taskIndicatorsContainer.innerHTML="",e.$.timelineContent.style.height="",delete e._hoveredItem,e.$.taskTable.dataSource=[],e._closeTooltip(),e.closeWindow(),e._refresh()}clearResources(){const e=this;e._unselectAll("resource"),e._resources=[],e.$.resourceTable&&(e.$.resourceTable.dataSource=[]),e.$.resourceTimelineCellsContainer.innerHTML="",e._tasks.forEach((t=>{t.resources=[],e._refreshTableColumnsData(t,["resources"])})),e._refreshTimeline(),e._createResourceTimeline()}createConnection(){const e=this,t=e._tasks;let i,a=Array.from(arguments).filter((e=>void 0!==e));if(!e.isCompleted||0===t.length)return;if(i=1===a.length?(a[0]+"").split("-"):a,!e._getValidConnectionId(i[0],i[1],i[2],"createConnection"))return;const n=parseInt(i[3]);e._connectTask([i[0],i[1],i[2],isNaN(n)?0:n]),e._recycleConnections(),e.$.fireEvent("itemInsert",{type:"connection",item:{source:i[0],target:i[1],type:i[2],lag:n}})}collapse(e){this._handleCollapseExpandMethods(e,"collapse")}expand(e){this._handleCollapseExpandMethods(e,"expand")}exportData(e,t){const i=this;if(!JQX.Utilities.DataExporter)return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"jqx.export.js"}));try{new JSZip}catch(e){return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"jszip.min.js"}))}if("pdf"===e&!window.pdfMake)return void i.error(i.localize("missingReference",{elementType:i.nodeName.toLowerCase(),methodName:"exportData",file:"pdfMake.min.js"}));const a="task"===i.dataExport.itemType?i.$.taskTable:i.$.resourceTable;return a?a.exportData(e,i.dataExport.fileName,i.dataExport.exportFiltered,t):void 0}print(){const e=this,t=e.dataExport.fileName;e.dataExport.fileName=null;const i=e.exportData("html"),a=window.open("","","width=800,height=500"),n=a.document.open(),s='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>'+t+"</title></head><body>"+i+"</body></html>";try{n.write(s),n.close(),setTimeout((function(){a.print(),a.close()}),100)}catch(e){}e.dataExport.fileName=t}getConnectionDetails(e){const t=this;if("string"!=typeof e)return;const i=t._getConnectionObjById(e);if(!i)return;const a=i.startTask,n=i.endTask,s={startTask:t._cloneObject(i.startTask),endTask:t._cloneObject(i.endTask),startTaskId:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,endTaskId:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,type:i.type};return void 0!==i.lag&&(s.lag=i.lag),s}getConnections(){const e=this;return e._connections.map((t=>{const i=t.startTask,a=t.endTask;return{id:t.startIndex+"-"+t.endIndex+"-"+t.type,startTask:e._cloneObject(i),endTask:e._cloneObject(a),startIndex:t.startIndex,startTaskId:"string"==typeof i.id||"number"==typeof i.id?i.id:i.$.id,endTaskId:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,endIndex:t.endIndex,type:t.type,lag:t.lag}}))}getState(){const e=this,t=e._getTasksJSON(!0)||[];return{tasks:JSON.parse(JSON.stringify(t)),selectedTaskIds:e.selectedTaskIds.slice(0),resources:JSON.parse(JSON.stringify(e._resources.slice(0))),scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}get tasks(){return this.isReady?this.getTasks():[]}get resources(){return this.isReady?this.getResources():[]}getTask(e){const t=this,i=t._getValidItemAndIndex(e);if(i.item)return t._cloneObject(i.item)}getTasks(){const e=this,t=e._tasks;return e.isReady&&t&&t.length?t.map((t=>e._cloneObject(t))):[]}getResource(e){const t=this,i=t._getValidItemAndIndex(e,"resource");if(i.item)return t._cloneObject(i.item)}getResources(){const e=this,t=e._resources;return e.isReady&&t&&t.length?t.map((t=>e._cloneObject(t))):[]}getItemPath(e){if(!e||void 0===e.type)return;const t="string"==typeof e.type?"task":"resource",i=this._getValidItemAndIndex(e,t);return i.item?i.item.$.id:void 0}getTaskIndex(e){const t=this;return"string"==typeof e?t._getTaskIndexById(e):t._getItemIndex(e,"task")}getTaskProject(e){const t=this;if((e=t._tasks[t._getItemIndex(e,"task")])&&e.$&&e.$.project)return t._cloneObject(e.$.project)}getTaskConnections(e){const t=this._getValidItemAndIndex(e,"task");return t&&t.item?this._getTaskConnections(t.item).taskConnections.map((e=>({target:e.endIndex,type:e.type,lag:e.lag}))):[]}getResourceIndex(e){return this._getItemIndex(e,"resource")}getResourceTasks(e){const t=this._getValidItemAndIndex(e,"resource");if(e=t?t.item:void 0)return this._getTasksAssigned(e)}getSelectedIds(){const e=this,t=e.selectedTaskIds,i=e.selectedResourceIds;return e.disableSelection||!t.length&&!i.length?null:{task:t.slice(),resources:i.slice()}}getSelectedTasks(){return this._getSelectedItems("task")}getSelectedResources(){return this._getSelectedItems("resource")}getWorkingHours(){const e=this.nonworkingHours;let t=[];for(let i=0,a=23;i<a;i+=1)e.indexOf(i)<0&&t.push(i);return t}isWorkingDay(e){return e=new Date(e),!isNaN(e.getTime())&&this.nonworkingDays.indexOf(e.getDay())<0}clearState(){const e=this;e.id?window.localStorage.removeItem("smartGanttChart"+e.id):e.warn(e.localize("noId"))}loadState(e){const t=this;if(!e){if(!t.id)return;e=JSON.parse(window.localStorage.getItem("smartGanttChart"+t.id))}if(!e)return;let i=JSON.stringify(e.tasks),a=JSON.stringify(e.selectedTaskIds),n=JSON.stringify(e.resources);if(i&&(i=JSON.parse(i)),a&&(a=JSON.parse(a)),n&&(n=JSON.parse(n)),t._noChangeEvent=!0,Array.isArray(i)&&(t._createTasks(i),t.set("dataSource",i)),Array.isArray(n)){let e=n;for(let i=0;i<e.length;i++){const e=n[i];let a=t._resources.find((t=>t.id&&t.id.toString()===e.id.toString()))||{};t._setResource(a,e),Object.values(a).length&&!t._resources.includes(a)&&t._resources.push(a)}t._refreshItemIds("resource")}"number"==typeof e.scrollLeft&&(t.scrollLeft=e.scrollLeft),"number"==typeof e.scrollTop&&(t.scrollTop=e.scrollTop),t._setTable(t.$.taskTable),t._createTimeline(),t._createResourceTimeline(),Array.isArray(a)&&(t.$.taskTable.selected=t._getSelection("task",a)),delete t._noChangeEvent}saveState(){const e=this;e.id?window.localStorage.setItem("smartGanttChart"+e.id,JSON.stringify(e.getState())):e.warn(e.localize("noId"))}insertTask(e,t,i){const a=this;if("object"!=typeof e)return void a.error(a.localize("incorrectArgument",{elementType:a.nodeName.toLowerCase(),methodName:"insertTask",argumentName:"newTask"}));const n=a._tasks;if(n.indexOf(e)>-1)return void a.error(a.localize("alreadyExists",{elementType:a.nodeName.toLowerCase(),methodName:"insertTask"}));const s=a._createTasks([e],!0);if(!n)return;let r,o,l;const d=a._getSelection("task",a.selectedTaskIds);if("string"==typeof i&&i.indexOf(!1)){const e=i.split(".");i=parseInt(e.slice(-1)),null==t&&(t=e.slice(0,-1).join("."))}if("string"==typeof t?(r=n.find((e=>e.id&&e.id.toString()===t)),r||(r=a._getItemByTableId("task",t))):"number"==typeof t&&(r=n[t]),r){if("project"!==r.type)return void a.error(a.localize("notAProject",{elementType:a.nodeName.toLowerCase(),argumentName:"project",methodName:"insertTask"}));s[0].$.project=r}return a._synchronizeProjectVisibility(s[0].$.project,s[0]),a._insertTasks(s,r,i),a._refreshItemIds(),a._refreshConnectionIds(),a._isUpdating?(a._isUpdating.type.task=!0,void(a._isUpdating.type.resource=!0)):(a._selected&&a._selected.task&&a._setSelection("task",l=a._selected.task.map((e=>e.$.id))),a._refreshTableDataSource(),a._refreshTimeline(),l&&d.toString()!==l.toString()&&(a.$.taskTable.selected=l.slice(0)),a._refreshTaskResources(o),a._ensureVisible(o),a.$.fireEvent("itemInsert",{type:"task",item:a._cloneObject(s[0])}),s[0].id||s[0].$.id+"")}openWindow(e){const t=this;if(t.disableWindowEditor)return;if("string"==typeof e){if(e.indexOf(".")>-1){const i=t._getVCellById("task",e),a=i?i.task:void 0;return void(a&&t._openPopupWindow(a))}if(e.indexOf("-")>-1){let e=(arguments[0]+"").split("-");if(e=t._getValidConnectionId(e[0],e[1],e[2],"openEditor"),e)return void t._openPopupWindow(e)}}const i=t._getValidItemAndIndex(e);i&&t._openPopupWindow(i.item)}closeWindow(){const e=this,t=["confirm","task","connection"];for(let i=0;i<t.length;i++){const a=e.$[t[i]+"PopupWindow"];a&&(a.close(),delete a._target)}}updateTask(e,t){const i=this,a=i._getValidItemAndIndex(e),n=a?a.item:void 0;"object"==typeof n?"object"==typeof t?i._updateTask(n,t):i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"updateTask",argumentName:"taskDetails"})):i.error(i.localize("notExisting",{elementType:i.nodeName.toLowerCase(),methodName:"updateTask",argumentName:"newTask"}))}removeTask(e){const t=this,i=t._tasks,a=t._getValidItemAndIndex(e),n=a?a.item:void 0;i&&i.length&&("object"==typeof n?t._removeTask(n):t.error(t.localize("notExisting",{elementType:t.nodeName.toLowerCase(),methodName:"removeTask",argumentName:"index"})))}setWorkTime(e){this._setWorkTime(e,(function(e,t){for(let i=0,a=e.length;i<a;i+=1){const a=parseInt(e[i]),n=t.indexOf(a);n>-1&&t.splice(n,1)}return t}))}selectTask(e){this._handleItemSelection(e,"task")}selectResource(e){const t=this;t.$.mainSplitter.contains(t.$.resourceTable)&&t._handleItemSelection(e,"resource")}sort(e){const t=this;if("none"===t.sortMode)return;Array.isArray(e)||(e="object"==typeof e?[e]:[]);const i=t.taskColumns,a=t.resourceColumns,n=t.$.taskTable,s=t.$.resourceTable;for(let t=0;t<e.length;t++){const r=e[t],o="desc"===r.sortOrder?"desc":"asc",[l,d]="resource"===r.type||a.includes(r)?[s,a]:[n,i],c=d.find((e=>r.value&&e.value===r.value));c&&l.sortBy(c.value,o)}}unselectTask(e){this._handleItemSelection(e,"task",!0)}unselectResource(e){const t=this;t.$.mainSplitter.contains(t.$.resourceTable)&&t._handleItemSelection(e,"resource",!0)}unsetWorkTime(e){this._setWorkTime(e,(function(e,t){for(let i=0,a=e.length;i<a;i+=1){const a=parseInt(e[i]);t.indexOf(a)<0&&t.push(a)}return t}),!0)}hideTooltip(){this._closeTooltip()}showTooltip(e,t){this._openTooltip(e,void 0,t)}_getSelectedItems(e="task"){const t=this,i=t[`_${e}s`],a=t._getSelection(e,"task"===e?t.selectedTaskIds:t.selectedResourceIds);if(!a.length)return[];let n=[];for(let e=0,s=i.length;e<s;e+=1){const s=i[e];a.indexOf(s.$.id)>-1&&n.push(t._cloneObject(s))}return n}_getTasksAssigned(e){const t=this,i=t._tasks||[];let a=[];for(let n=0;n<i.length;n++){const s=i[n];!s.disableResources&&s.resources.find((t=>t===e.id))&&a.push(t._cloneObject(s))}return a}_getItemIndex(e,t){t||(t="task");const i=this[`_${t}s`];if(e instanceof HTMLElement&&e.classList.contains("jqx-timeline-task"))return i.indexOf(e._cellObj[`_${t}`]);const a="resource"===t?["id","label","value","progress"]:["id","label","type","class","dateStart","dateEnd","resources","connections"];if("object"==typeof e)for(let t=0;t<i.length;t++)if(a.every((a=>Array.isArray(e[a])?JSON.stringify(e[a])===JSON.stringify(i[t][a]):a.indexOf("date")>-1?new Date(e[a]).getTime()===new Date(i[t][a]).getTime():e[a]===i[t][a])))return i.indexOf(i[t]);return-1}_handleItemSelection(e,t="task",i){const a=this,n=a._getValidItemAndIndex(e,t);if(n.item){const s=n.item,r=a._getSelection(t,"task"===t?a.selectedTaskIds:a.selectedResourceIds);if(e=s.$.id,i){const i=r.indexOf(e);i>-1&&(r.splice(i,1),a.$[`${t}Table`].selected=r)}else r.indexOf(e)<0&&(r.push(e),a.$[`${t}Table`].selected=r);return"string"==typeof s.id||"number"==typeof s.id?s.id:s.$.id}}_refreshAfterWorkingTimeChange(){const e=this;if(e.adjustToNonworkingTime)for(let t=0;t<e._tasks.length;t++){const i=e._tasks[t],a=i.$.project;e._validateTaskDates(i,a),e._synchronizeProjectDates(i,a),e._refreshTableColumnsData(i,["dateEnd","duration"])}e._refreshTimeline()}_refreshItemIds(e="task"){const t=this[`_${e}s`];if(!t)return;let i={},a=0;for(let e=0,n=t.length;e<n;e+=1){const n=t[e],s=n.$.project;if(void 0!==s){const e=s.$.id;i[e]||(i[e]=0),n.$.id=e+"."+i[e],i[e]++}else n.$.id=a+"",a++}}_refreshConnectionIds(){const e=this._tasks,t=this._connections;if(t&&t.length)for(let i=0,a=t.length;i<a;i+=1){const n=t[i],s=e.indexOf(n.startTask),r=e.indexOf(n.endTask);(s<0||r<0)&&(t.splice(i,1),a--),n.startIndex=s,n.endIndex=r}}_refreshSelectedItems(e="task",t){const i=this,a=i[`_${e}s`];if(a&&(!t&&i._selected&&i._selected[e]&&(t=i._selected[e]),t)){for(let e=0,i=t.length;e<i;e+=1){const n=t[e];(a.indexOf(n)<0||n.hidden)&&(t.splice(e,1),e-=1,i--)}i._setSelection(e,t.map((e=>e.$.id)))}}_resetFromAction(e="task",t="clearSort"){const i=this;function a(){i.$.taskTable[t](),i._createTimelineContent(),i._recycleTimelineTasks()}function n(){const e=i.$.resourceTable;e&&(e[t](),i._createResourceTimelineVCells(),i._recycleResourceContent())}"resource"===e?n():"task"===e?a():(a(),n())}_setWorkTime(e,t,i){const a=this;if("object"!=typeof e)return;let n,s=e.days,r=e.hours;null!=s&&(Array.isArray(s)||(s=[s]),s=a._nonworkingDayValidator(void 0,s),n=t(s,i?a.nonworkingDays:[0,1,2,3,4,5,6]),a.set("nonworkingDays",7===n.length?[]:n),a._refreshAfterWorkingTimeChange()),null!=r&&(Array.isArray(r)||(r=[r]),r=a._nonworkingTimeValidator(void 0,r),n=t(r,i?a.nonworkingHours:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]),a.set("nonworkingHours",24===n.length?[]:n),a._refreshAfterWorkingTimeChange())}_getValidConnectionId(e,t,i,a){const n=this,s=n._tasks,r=0===a.indexOf("_");let o;if("string"==typeof e&&(o=n._getTaskIndexById(e),o>=0&&(e=o)),"string"==typeof t&&(o=n._getTaskIndexById(t),o>=0&&(t=o)),e=parseInt(e),t=parseInt(t),i=parseInt(i),isNaN(e)||isNaN(t)||e===t)r||n.error(n.localize("incorrectArgument",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"taskIndex"}));else if(e>=s.length||e<0||t>=s.length||t<0)r||n.error(n.localize("outOfBounds",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"taskIndex"}));else{if(!(isNaN(i)||i<0||i>3))return r?[e,t,i]:e+"-"+t+"-"+i;r||n.error(n.localize("incorrectArgument",{elementType:n.nodeName.toLowerCase(),methodName:a,argumentName:"connectionType"}))}}_autoSchedule(e){const t=this,i=t._tasks;if(t.autoSchedule){e?Array.isArray(e)||(e=[e]):e=i;for(let i=0;i<e.length;i++){const a=e[i];"project"===a.type&&a.synchronized||(a.minDateStart=a.minDateEnd=void 0,t._autoScheduleTasks(a))}t._isUpdateRequired&&(t._createTimelineCells(),t._recycleTimelineTasks(!0),delete t._isUpdateRequired)}}_getTaskConnections(e){const t=this._tasks,i=this._connections;let a=[],n=[];if(t&&t.length&&i&&i.length){const s=t.indexOf(e);for(let e=0;e<i.length;e+=1){const t=i[e];t.startIndex===s?a.push(t):t.endIndex===s&&n.push(t)}}return{taskConnections:a,connectedTasks:n}}_autoScheduleTasks(e){const t=this,i=t._tasks,a=t._getTaskConnections(e),n=a.taskConnections,s=a.connectedTasks;let r,o,l;for(let a=0;a<n.length;a++)t._isAutoScheduled(e,i[n[a].endIndex],!0);for(let a=0;a<s.length;a++){const n=s[a],d=i[n.startIndex],c=n.type,m=n.lag,u=e.$.project;d&&"project"===d.type&&d.synchronized||(0===c||1===c?(l=new Date((0===c?d.dateStart:d.dateEnd).getTime()+m),e.minDateStart=new Date(e.minDateStart?Math.max(e.minDateStart.getTime(),l.getTime()):l),o=e.minDateStart.getTime()-e.dateStart.getTime(),r=new Date(e.dateEnd.getTime()+(t.autoScheduleStrictMode?o:Math.max(0,o))),r.getTime()!==e.dateEnd.getTime()&&(e.dateEnd=r,t._isUpdateRequired=!0),t.autoScheduleStrictMode&&e.minDateStart.getTime()!==e.dateStart.getTime()&&(e.dateStart=e.minDateStart,t._isUpdateRequired=!0)):(l=new Date((2===c?d.dateEnd:d.dateStart).getTime()+m),e.minDateEnd=new Date(e.minDateEnd?Math.min(e.minDateEnd.getTime(),l.getTime()):l),o=e.minDateEnd.getTime()-e.dateEnd.getTime(),r=new Date(e.dateStart.getTime()+(t.autoScheduleStrictMode?o:Math.max(0,o))),r.getTime()!==e.dateStart.getTime()&&(e.dateStart=r,t._isUpdateRequired=!0),t.autoScheduleStrictMode&&e.minDateEnd.getTime()!==e.dateEnd.getTime()&&(e.dateEnd=e.minDateEnd,t._isUpdateRequired=!0)),t._validateTaskDates(e,u),t._synchronizeProjectDates(e,u))}for(let e=0;e<n.length;e++){const a=i[n[e].endIndex];!a||"project"===a.type&&a.synchronized||(a.minDateStart=a.minDateEnd=void 0,t._autoScheduleTasks(a))}}_autoScheduleRestore(e,t){const i=this._tasks;e||(e=i),Array.isArray(e)||(e=[e]);for(let a=0;a<e.length;a++){const n=e[a];i.indexOf(e[a])>-1&&(t?0===t||1===t?n.minDateStart=void 0:n.minDateEnd=void 0:n.minDateStart=n.minDateEnd=void 0)}}_autoScroll(e){const t=this,i=t.hasAttribute("dragged"),a=t.hasAttribute("resized");function n(n,s){if(!t._dragDetails)return clearInterval(t._scrollInterval),t._scrollInterval=void 0,void delete t._autoScrolling;t._autoScrolling=!0,s?i||(t.scrollTop-=t.autoScrollStep*n,t._dragDetails.coordinates.y+=t.autoScrollStep*n):(t.scrollLeft-=(t.rightToLeft?-1:1)*t.autoScrollStep*n,t._dragDetails.coordinates.x+=t.autoScrollStep*n),i?t._handleTaskBarDrag(e):a&&t._handleTaskBarResize(e)}if(t.disableAutoScroll||!e||!i&&!a&&!t.hasAttribute("connecting-task"))return;const s=t.$.timeline.getBoundingClientRect();t._scrollInterval&&clearInterval(t._scrollInterval),t._scrollInterval=setInterval((function(){(t.scrollLeft||t.rightToLeft)&&e.clientX<=s.left+20?n(1):t.scrollLeft!==(t.rightToLeft?0:t.scrollWidth)&&e.clientX>=s.left+s.width-20?n(-1):t.scrollTop&&e.clientY<=s.top+20?n(1,!0):t.scrollTop!==t.scrollHeight&&e.clientY>=s.top+s.height-20?n(-1,!0):(clearInterval(t._scrollInterval),t._scrollInterval=void 0,delete t._autoScrolling)}),1)}_checkTaskBarResizability(e){const t=this;let i=e.originalEvent.target;t.shadowRoot&&i===t&&(i=e.originalEvent.composedPath()[0]);const a=t.$.timeline;if(!i.closest)return void a.removeAttribute("task-bar-hovered");let n,s=i.closest(".jqx-timeline-row")||i.closest(".jqx-timeline-task");if(t.disabled||t.disableTaskResize||!s||!a.contains(s))return void a.removeAttribute("task-bar-hovered");const r=s._cellObj.task,o=t._getTaskDOMIndex(r);if(s.classList.contains("jqx-timeline-row")?n=t.$.timelineTasksContainer.children[o]:s.classList.contains("jqx-timeline-task")&&(n=s,s=t.$.taskTimelineCellsContainer.children[o]),!n||n.classList.contains("milestone")||r.synchronized||r.disableResize)return;const l=i.closest(".jqx-task-segment"),d=r.segments?r.segments.length:1;if(i.classList&&i.classList.contains("jqx-task-connection-point")||l&&(d>1&&t.disableSegmentResize||l._segmentObj&&l._segmentObj.disableResize))return void a.removeAttribute("task-bar-hovered");const c=e.pageX-window.pageXOffset,m="visible"===t.resizeHandlesVisibility||t._isMobile?20:5,u=(l||n).getBoundingClientRect(),h=s.getBoundingClientRect(),g=Math.min(m,c-h.left),f=Math.min(m,h.left+h.width-c);Math.round(u.left)+g>=c&&Math.round(u.left)-g<=c?a.setAttribute("task-bar-hovered","left"):Math.round(u.left+u.width)+f>=c&&Math.round(u.left+u.width)-f<=c?a.setAttribute("task-bar-hovered","right"):a.removeAttribute("task-bar-hovered")}_onShadowDomLoaded(e,t,i){requestAnimationFrame((function a(){const n=(e.shadowRoot||e.getRootNode()).querySelectorAll("link");for(let e=0;e<n.length;e++)if(-1!==n[e].href.indexOf(t))return void i();requestAnimationFrame(a)}))}_getConnectionObjById(e){const t=this._connections;if(!e||!t||!t.length)return;const i=e.split("-"),a=parseInt(i[0]),n=parseInt(i[1]),s=parseInt(i[2]);for(let e=0,i=t.length;e<i;e+=1){const i=t[e];if(i.startIndex===a&&i.endIndex===n&&i.type===s)return i}}_positionWindow(){const e=this,t=e.getShadowRootOrBody(),i=[e.$.taskPopupWindow,e.$.connectionPopupWindow,e.$.confirmPopupWindow];for(let a=0;a<i.length;a++){const n=i[a];if(!n||!t.contains(n))continue;const s=e.getBoundingClientRect();n.opened||(n.style.left=n.style.top=""),e._isMobile?(n.setAttribute("mobile",""),n.style.left=s.left+window.pageXOffset+"px",n.style.top=s.top+window.pageYOffset+"px",n.style.width=s.width+"px",n.style.height=s.height+"px"):(n.style.left=Math.max(s.left+window.pageXOffset,s.left+window.pageXOffset+s.width/2-n.offsetWidth/2)+"px",n.style.top=Math.max(s.top+window.pageYOffset,s.top+window.pageYOffset+s.height/2-n.offsetHeight/2)+"px")}}_openPopupWindow(e,t){const i=this;function a(){function t(){i._positionWindow(),s.opened?(s.bringToFront(),s._onOpenCallback?s._onOpenCallback():s._handleActiveState()):s.open()}if(i.popupWindowCustomizationFunction?i.popupWindowCustomizationFunction(s,n,"connection"===n?e.startIndex+"-"+e.endIndex+"-"+e.type:i._cloneObject(e)):s._onOpenCallback=()=>{const e=(s.shadowRoot||s).querySelectorAll(".jqx-gantt-chart-popup-window-editor .jqx-input, .jqx-popup-window-button");(e[0]||e[1]||s).focus({preventScroll:!0}),s._handleActiveState()},i._setPopupWindowTemplate("header",n,e),i._setPopupWindowTemplate("footer",n,e),i._setPopupWindowTemplate("content",n,e),!i._popupWindow[n+"PopupWindow"]){const e=i["$"+n+"PopupWindow"];e.unlisten("transitionend"),e.unlisten("open"),e.unlisten("close"),e.unlisten("closing"),e.unlisten("click"),e.unlisten("change"),e.listen("transitionend",i._popupWindowTransitionendHandler.bind(i)),e.listen("open",i._popupWindowOpenHandler.bind(i)),e.listen("close",i._popupWindowCloseHandler.bind(i)),e.listen("closing",i._popupWindowClosingHandler.bind(i)),e.listen("click",i._popupWindowClickHandler.bind(i)),e.listen("change",i._popupWindowChangeHandler.bind(i))}s.shadowRoot?(s.importStyle(JQX.Utilities.Core.getScriptLocation()+JQX.StyleBaseUrl.replace("/scoped/","/jqx.textbox.css")),i._onShadowDomLoaded(s,"jqx.window.css",t)):t();const a=(i.getAttribute("aria-owns")||"")+" "+s.id;i.setAttribute("aria-owns",a.trim()),i._popupWindow[n+"PopupWindow"]=s}if(e&&e.classList)if(e.classList.contains("jqx-task-connection"))e=i._getConnectionObjById(e.getAttribute("connection-id"));else if("TR"===e.nodeType){const t=e?"task":"resource",a=i._getVCellById(t,e.getAttribute("row-id"));e=a?a[t]:void 0}else e=e._cellObj.task;if(!e||e.isGroup)return;const n=t?"confirm":"string"==typeof e.type?"task":"connection",s=i._createPopupWindow(n);!t&&i.$.fireEvent("opening",{target:s,type:n}).defaultPrevented||(i._closeTooltip(),s._target=e,i._popupWindow||(i._popupWindow={}),s.parentElement||i.getShadowRootOrBody().appendChild(s),s.isCompleted?a():s.whenReady((()=>a())))}_createPopupWindow(e){const t=this,i=e+"PopupWindow";if(t.$[i])return t.$[i];const a=document.createElement("jqx-window");return a.classList.add("jqx-"+e+"-popup-window"),a.classList.add("jqx-gantt-chart-popup-window"),a.setAttribute("jqx-id",i),t.$[i]=a,t["$"+i]=JQX.Utilities.Extend(a),a.rightToLeft=t.rightToLeft,a.theme=t.theme,a.animation=t.animation,a.disableSnap=!0,a.headerButtons=["close"],a}_popupWindowOpenHandler(e){const t=this,i=t["$"+e.target.getAttribute("jqx-id")];if(i){const a=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";t._handleModal(!0),t.$.fireEvent(e.type,Object.assign({type:a,target:e.target},e.detail)),i.unlisten("open")}}_popupWindowClosingHandler(e){const t=this["$"+e.target.getAttribute("jqx-id")];if(!t)return;const i=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";this.$.fireEvent(e.type,{target:e.target,type:i}).defaultPrevented?e.preventDefault():t.unlisten(e.type)}_popupWindowCloseHandler(e){const t=this,i=e.target.getAttribute("jqx-id"),a=t["$"+i];if(a){const n=e.target.classList.contains("jqx-confirm-popup-window")?"confirm":e.target.classList.contains("jqx-connection-popup-window")?"connection":"task";if(t._handleModal(),t.$.fireEvent(e.type,Object.assign({type:n,target:e.target},e.detail)),a.unlisten("close"),a.unlisten("click"),t.hasAttribute("aria-owns")){const e=t.getAttribute("aria-owns").replace(t._popupWindow[i].id,"").trim();e?t.setAttribute("aria-owns",e):t.removeAttribute("aria-owns")}delete t._popupWindow[i];const s=Object.keys(t._popupWindow);1===s.length&&t._popupWindow.confirmPopupWindow&&(delete t._popupWindow.confirmPopupWindow._target,t._popupWindow.confirmPopupWindow.close()),s.length?requestAnimationFrame((()=>{const e=t._popupWindow[s[s.length-1]];e&&e.focus()})):t.keyboardNavigation&&t.$.taskTable.focus({preventScroll:!0})}}_popupWindowTransitionendHandler(e){const t=this,i=e.target;i instanceof JQX.Window&&!i.opened&&"visibility"===e.propertyName&&(t["$"+i.getAttribute("jqx-id")].unlisten("transitionend"),i.parentElement&&i.parentElement.removeChild(i))}_handleModal(e){const t=this;let i=(t.shadowRoot||t).querySelector(".jqx-popup-window-modal");e?(i||(i=document.createElement("div"),i.classList.add("jqx-popup-window-modal")),i.parentElement||(t.$.container.appendChild(i),t.setAttribute("modal",""))):i&&i.parentElement&&Object.keys(t._popupWindow).length<2&&(i.parentElement.removeChild(i),t.removeAttribute("modal"))}_findTaskEditor(e,t){if(!e||!t)return;const i=t.children;for(let t=0,a=i.length;t<a;t+=1){const a=i[t];if(a.getAttribute("value")===e)return a}}_createTaskEditor(e,t,i){const a=this,n=e.value,s=t[e.value];let r,o,l=i.find((e=>e._label===n));if(l)r=l.querySelector(".jqx-gantt-chart-label-container"),o=l.lastElementChild;else{const t="editorLabel"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);if(r=document.createElement("div"),r.classList.add("jqx-gantt-chart-label-container"),r.innerHTML=`<label id="${t}"></label>`,"deadline"===n){const e=document.createElement("span");e.classList.add("jqx-popup-window-editor-toggle"),r.appendChild(e)}if(l=document.createElement("div"),l.classList.add("jqx-gantt-chart-popup-window-editor"),l.setAttribute("value",n||""),l._label=n,e.customEditor)return l.appendChild(e.customEditor(n,s)),l;if("number"==typeof s||"string"==typeof s)o=document.createElement("input"),o.classList.add("jqx-input");else if(s instanceof Date||"deadline"===n)JQX.DateTimePicker?(o=document.createElement("jqx-date-time-picker"),o.locale=a.locale,o.dropDownAppendTo="body",o.calendarButton=!0,o.dropDownDisplayMode="auto",o.enableMouseWheelAction=!0,o.formatString="yyyy-MMM-dd HH:mm:ss"):(o=document.createElement("input"),o.type="datetime-local");else if(Array.isArray(s))if(JQX.DropDownList)o=document.createElement("jqx-drop-down-list"),o.virtualized=!0,o.dropDownAppendTo="body",o.selectionMode="zeroOrMany";else{o=document.createElement("input"),o.classList.add("jqx-input");const e=document.createElement("datalist");e.id="resourceList",o.setAttribute("list",e.id),l.appendChild(e)}o&&o.setAttribute("aria-labelledby",t)}if(!l.parentElement)return r&&l.appendChild(r),o&&l.appendChild(o),l;a._setPopupWindowEditors(e,t,l)}_setAriaControls(){this.setAttribute("role","treegrid")}_setPopupWindowEditors(e,t,i){const a=this,n=i.querySelector("label"),s=i.querySelector(".jqx-popup-window-editor-toggle"),r=i.lastElementChild,o=e.value+"",l=o.split(/(?=[A-Z])/).join(" "),d=t[o];if(e.customEditor)e.setCustomEditorValue&&e.setCustomEditorValue(i,l,d);else{if(n.innerHTML=a.localize(e.value)||l.charAt(0).toUpperCase()+l.slice(1),s)if("deadline"===o){const e=null==d?"add":"remove";r.classList[e]("jqx-hidden"),s.textContent=a.localize(e)}else s.remove();if("number"==typeof d)r.value=parseFloat(d);else if("string"==typeof d)r.value=d;else if(d instanceof Date)r.value=new Date(d);else if(Array.isArray(d)){const e=a._resources;if(r.placeholder=a.localize("unassigned"),JQX.DropDownList&&r instanceof JQX.DropDownList)r.dataSource=e.map((e=>({label:e.label,value:e.id}))),r.selectedValues=t.disableResources?[]:t.resources.map((e=>e.toString()));else{let a=i.querySelector("datalist"),n=document.createDocumentFragment();a.innerHTML="";for(let t=0;t<e.length;t++){const i=e[t],a=document.createElement("option");a.value=i.id,a.innerHTML=i.label,n.appendChild(a)}r.value=t.resources.toString(),a.appendChild(n)}}"project"===t.type&&t.synchronized&&["duration","date"].indexOf(l.toLowerCase())>-1||"resources"===l&&t.disableResources?r.disabled=!0:r.disabled=!!e.disableEdit,r.rightToLeft=a.rightToLeft,r.animation=a.animation,r.theme=a.theme}}_setupPopupWindowTabs(e,t){const i=this,a=i.popupWindowTabs,n="milestone"===t.type,s=[{label:i.localize("generalTab"),value:"general"},{label:i.localize("dependencyTab"),value:"dependency"},{label:i.localize("segmentsTab"),value:"segments"}];let r=e.querySelector(".jqx-gantt-chart-popup-window-tabs");r||(r=document.createElement("jqx-tabs"),r.classList.add("jqx-gantt-chart-popup-window-tabs"),e.clear(),e.appendChild(r)),r.animation=i.animation,r.rightToLeft=i.rightToLeft,r.theme=i.theme;const o=r.getTabs().slice(0);for(let e=0,t=s.length;e<t;e+=1){const t=s[e],i=t.value;let l=o[e];a.indexOf(i)<0?l&&r.removeChild(l):(l||(l=document.createElement("jqx-tab-item"),r.appendChild(l)),l.label=t.label,l.setAttribute("value",i||""),l.disabled=n&&"segments"===i)}return r}_setPopupWindowContent(e,t){const i=this,a=i.$[e+"PopupWindow"],n=[].slice.call(a.querySelectorAll(".jqx-gantt-chart-popup-window-editor"));if(a.content&&(!a.content.innerHTML||n.length))if("task"===e&&t){const e=i.taskColumns;let s=[];const r=i._setupPopupWindowTabs(a,t);0!==r.selectedIndex&&(r.selectedIndex=0);const o=r.getTabs()[0];if("general"!==o.getAttribute("value"))return void i._handleTabsContent(o,a);"string"==typeof o.content?o.content="":o.content.innerHTML="";for(let a=0;a<e.length;a++){const r=e[a],l=r.value;if(void 0===t[l]&&"deadline"!==l||"overdue"===l)continue;let d=i._findTaskEditor(l,o);d||(d=i._createTaskEditor(r,t,n),d&&o.appendChild(d)),d&&(i._setPopupWindowEditors(r,t,d),s.push(d))}for(let e=0,t=n.length;e<t;e+=1){const t=n[e];s.indexOf(t)<0&&t.remove()}t.id&&a.setAttribute("aria-controls",t.id)}else if("confirm"===e){if(a.innerHTML='<div class="jqx-gantt-chart-popup-window-editor">'+i.localize("confirm",{componentName:"The task"})+"</div >",i._popupWindow){const e=Object.keys(i._popupWindow);e.length&&a.setAttribute("aria-controls",i._popupWindow[e[e.length-1]].id)}}else{const e=t.startTask,n=t.endTask;a.innerHTML='<div class="jqx-gantt-chart-popup-window-editor">'+i.localize("deleteLink")+"<b> "+e.label+" - "+n.label+"?</b></div>"}}_setPopupWindowTemplate(e,t,i){const a=this,n=a.$[t+"PopupWindow"];if("content"!==e){if(n[e+"Template"]||(n[e+"Template"]=a._createPopupWindowTemplate(e,t)),"header"===e&&i&&"string"==typeof i.type){const e=(n.shadowRoot||n).querySelector(".jqx-popup-window-label");e&&(e.innerHTML=i.label)}else if("footer"===e){const e=(n.shadowRoot||n).querySelectorAll(".jqx-popup-window-button");for(let i=0;i<e.length;i++){const n=e[i];n.innerHTML="task"===t?'<span class="jqx-icon"></span>':"",n.theme=a.theme,n.rightToLeft=a.rightToLeft,n.animation=a.animation,n.disabled=!1,n.classList.contains("ok")?(n.innerHTML+=a.localize("ok"),n.setAttribute("aria-label","ok")):n.classList.contains("cancel")?(n.innerHTML+=a.localize("cancel"),n.setAttribute("aria-label","cancel")):n.classList.contains("delete")&&(n.innerHTML+=a.localize("delete"),n.setAttribute("aria-label","delete"));const s=n.querySelector(".jqx-ripple");s&&s.parentElement.removeChild(s)}}}else a._setPopupWindowContent(t,i)}_createPopupWindowTemplate(e,t){const i=this,a=document.createElement("template");if("footer"===e)switch(t){case"task":a.innerHTML=`<jqx-button class="jqx-popup-window-button ok primary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button cancel"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button delete secondary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>`;break;case"connection":case"confirm":a.innerHTML=`<jqx-button class="jqx-popup-window-button ok primary"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>\n <jqx-button class="jqx-popup-window-button cancel"\n animation="${i.animation}" theme="${i.theme}" ${i.rightToLeft?"right-to-left":""}>\n </jqx-button>`}else"header"!==e||"task"!==t&&"confirm"!==t||(a.innerHTML='<span class="jqx-popup-window-label"></span>');return a}_handleTabsContent(e,t){const i=this,a=t._target;if(!e|!a)return;const n=e.getAttribute("value");if("general"===n)return;let s=e.querySelector(".jqx-gantt-popup-window-table"),r=e.querySelector(".jqx-gantt-window-table-buttons"),o=e.querySelector(".jqx-gantt-window-validation-message");r||(r=document.createElement("div"),r.classList.add("jqx-gantt-window-table-buttons"),r.innerHTML=`<jqx-button class="jqx-gantt-chart-button" action="add">${i.localize("add")}</jqx-button>\n <jqx-button class="jqx-gantt-chart-button" disabled action="delete">${i.localize("delete")}</jqx-button>`,e.insertBefore(r,s)),s||(s=document.createElement("jqx-table"),s.classList.add("jqx-gantt-popup-window-table"),s.editing=!0,s.editMode="row",s.keyboardNavigation=!0,s.wait=!0,s.hideSelectionColumn=!0,s.selection=!0,s.selectionMode="one",s.columnMinWidth="10px",s.addEventListener("rowEndEdit",(r=>{const o=r.detail.row;switch(n){case"dependency":{const e=i._tasks,t=o.name,n=e.indexOf(a),r=e.findIndex((e=>e.$.id===t));r>-1&&s.updateRow(o.$.id,{id:`${r}-${n}-${o.type}`});break}case"segments":{const e=o.dateStart,t=o.dateEnd;e.getTime&&t.getTime&&s.updateRow(o.$.id,{duration:parseFloat(i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e,t):t.getTime()-e.getTime(),!0).toFixed(2))});break}}i._applyTableValidation(e,s,t),i._isPopupWindowTableModified=!0})),e.innerHTML&&(e.innerHTML=""),e.appendChild(s));const l=i._getTabsTableData(n,a);s.selected.length&&(s.selected=[]),s.dataSource=l.source,s.columns=l.columns,s.wait=!1,delete i._isPopupWindowTableModified,o||(o=document.createElement("label"),o.classList.add("jqx-gantt-window-validation-message"),e.appendChild(o)),o.textContent=""}_applyTableValidation(e,t,i){const a=this,n=e.getAttribute("value"),s=e.querySelector(".jqx-gantt-window-validation-message"),r=i.querySelector(".jqx-popup-window-button.ok"),o=t.dataSource,l=o.length;if(!s)return void(r&&(r.disabled=!1));if(!l)return s.textContent="",void(r&&(r.disabled=!1));let d="";if("segments"===n)if(l<2)d=a.localize("segmentsCountValidation");else{const e=i._target,t=e.dateStart.getTime(),n=e.dateEnd.getTime();let s={};for(let e=0;e<l;e+=1){const i=o[e],r=i.label,l=i.dateStart.getTime(),c=i.dateEnd.getTime();for(let e in s){const t=s[e],n=t.timeStart,r=t.timeEnd,o=l<=n&&c>=n;(o||l<=r&&c>=r)&&(d+=a.localize("segmentConflictError",{dateConflict:o?"dateStart":"dateEnd",label:i.label,conflictLabel:t.label})+"\r\n")}l>c?d+=a.localize("segmentStartError",{label:i.label})+"\r\n":l===c&&(d+=a.localize("segmentEndError",{label:i.label})+"\r\n"),(l<t||c>n)&&(d+=a.localize("segmentRangeError",{label:i.label})+"\r\n"),void 0===s[e]&&(s[e]={label:r,timeStart:l,timeEnd:c})}}else if("dependency"===n)for(let e=0;e<l;e+=1){const t=o[e].id.split("-");t[0]===t[1]&&(d+=a.localize("dependencyValidation")+"\r\n")}s.textContent=d,r&&(r.disabled=d.length>0)}_getTabsTableData(e,t){const i=this;if("dependency"===e){const e=i._getTaskConnections(t).connectedTasks,a={connectionTypes:[{label:i.localize("startToStart"),value:0},{label:i.localize("endToStart"),value:1},{label:i.localize("endToEnd"),value:2},{label:i.localize("startToEnd"),value:3}],tasks:(()=>{const e=i._tasks;let a=[];for(let i=0,n=e.length;i<n;i+=1){const n=e[i];n!==t&&a.push({value:n.$.id,label:n.label})}return a})()};return{source:new window.JQX.DataAdapter({dataSource:e&&e.length?e.map((e=>({id:e.startIndex+"-"+e.endIndex+"-"+e.type,name:e.startTask.$.id||"",type:e.type,lag:e.lag||0}))):[],dataFields:["id: any","name: any","type: number","lag: number"]}),columns:[{label:i.localize("id"),dataField:"id",dataType:"any",autoWidth:!1,allowEdit:!1},{label:i.localize("name"),dataField:"name",dataType:"any",width:"35%",autoWidth:!1,editor:i._getColumnEditorSetup("name",a),formatFunction:e=>{const t=a.tasks.find((t=>t.value===e.value));t&&(e.value=t.label)}},{label:i.localize("type"),dataField:"type",dataType:"number",width:"25%",autoWidth:!1,editor:i._getColumnEditorSetup("type",a),formatFunction:e=>{const t=a.connectionTypes.find((t=>t.value===e.value));t&&(e.value=t.label)}},{label:i.localize("lag"),dataField:"lag",dataType:"number",autoWidth:!1}]}}if("segments"===e){const e={task:t};return{source:new window.JQX.DataAdapter({dataSource:t.segments,dataFields:["label: string","dateStart: date","dateEnd: date","duration: number"]}),columns:[{label:i.localize("name"),dataField:"label",dataType:"string",autoWidth:!1,width:"20%"},{label:i.localize("dateStart"),dataField:"dateStart",dataType:"date",autoWidth:!1,editor:i._getColumnEditorSetup("dateStart",e),formatFunction:e=>{e.value=i._formatDate(e.data.dateStart)}},{label:i.localize("dateEnd"),dataField:"dateEnd",dataType:"date",autoWidth:!1,editor:i._getColumnEditorSetup("dateEnd",e),formatFunction:e=>{e.value=i._formatDate(e.data.dateEnd)}},{label:i.localize("duration"),dataField:"duration",dataType:"number",autoWidth:!1,width:"15%",allowEdit:!1}]}}return{source:[],columns:[]}}_getColumnEditorSetup(e,t){const i=this;switch(e){case"dateStart":case"dateEnd":return{template:'<jqx-date-time-picker drop-down-append-to="body" wait></jqx-date-time-picker>',onInit:(e,a,n,s)=>{const r=t.task;s||(s=new Date(r.dateStart)),n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.min=r.dateStart,n.max=r.dateEnd,n.locale=i.locale,n.calendarButton=!0,n.dropDownDisplayMode="auto",n.enableMouseWheelAction=!0,n.formatString="yyyy-MMM-dd HH:mm:ss",n.value=new Date(Math.max(r.dateStart.getTime(),Math.min(r.dateEnd.getTime(),s.getTime()))),n.removeAttribute("wait")},getValue:e=>e.value.toDate()};case"name":return{template:'<jqx-drop-down-list virtualized drop-down-append-to="body" wait></jqx-drop-down-list>',onInit:(e,a,n,s)=>{n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.dataSource=t.tasks,n.selectedValues=[s],n.removeAttribute("wait")},getValue:e=>e.selectedValues[0]};case"type":return{template:"<jqx-input wait></jqx-input>",onInit:(e,a,n,s)=>{const r=t.connectionTypes,o=r.find((e=>e.value===s));n.readonly=!0,n.rightToLeft=i.rightToLeft,n.animation=i.animation,n.theme=i.theme,n.dropDownButtonPosition="right",n.dataSource=r,n.value=(o||r[0]).label+"",n.removeAttribute("wait")},getValue:e=>{if(e.selectedValues.length)return e.selectedValues[0];const i=t.connectionTypes.find((t=>t.label===e.value));return i?i.value:void 0}}}}_popupWindowChangeHandler(e){const t=this,i=e.target,a=i.closest("jqx-window")||(i.getRootNode()&&i.getRootNode().host?i.getRootNode().host:void 0);if(a._target)if(i.classList.contains("jqx-gantt-chart-popup-window-tabs")){const n=a.querySelector(".jqx-popup-window-button.ok");n&&(n.disabled=!1),t._handleTabsContent(i.getTabs()[e.detail.index],a)}else if(i.classList.contains("jqx-gantt-popup-window-table")){const e=i.closest("jqx-tab-item").querySelector('.jqx-gantt-chart-button[action="delete"]');e&&(e.disabled=0===i.selected.length)}}_popupWindowClickHandler(e){const t=this;let i=(e.originalEvent||e).target;i.shadowRoot&&(i=(e.originalEvent||e).composedPath()[0]);const a=i.closest("jqx-window")||(i.getRootNode()&&i.getRootNode().host?i.getRootNode().host:void 0),n=a._target;if(i.closest(".jqx-popup-window-button.cancel"))return t._popupWindow&&t._popupWindow.confirmPopupWindow&&a!==t._popupWindow.confirmPopupWindow&&t._popupWindow.confirmPopupWindow.close(),a.close(),void delete a._target;if(i.closest(".jqx-popup-window-button.ok")){if(a===t.$.connectionPopupWindow&&"number"==typeof n.type)t._removeConnection(n.startIndex+"-"+n.endIndex+"-"+n.type);else if(a===t.$.confirmPopupWindow){const e=n;void 0!==e.$._resourceId?t._removeResource(e):t._removeTask(e),a.close(),t.$.taskPopupWindow&&t.$.taskPopupWindow.close(),delete a._target}else{const e=a.shadowRoot||a,i=e.querySelectorAll(".jqx-gantt-chart-popup-window-editor"),s=n;let r={};for(let e=0;e<i.length;e++){const a=i[e]._label,n=t.taskColumns.find((e=>e.value===a));if(n.customEditor&&n.getCustomEditorValue)r[a]=n.getCustomEditorValue(i[e]);else{const t=i[e].lastElementChild;let n;if(!t)continue;if(t.classList.contains("jqx-hidden")){r[a]=void 0;continue}n=JQX.DateTimePicker&&t instanceof JQX.DateTimePicker?t.value.toDate?t.value.toDate():t.value:t instanceof HTMLInputElement&&"datetime-local"===t.type?new Date(t.value):JQX.DropDownList&&t instanceof JQX.DropDownList?t.selectedValues.slice(0):t.hasAttribute("list")?t.value.split(",").map((e=>e.trim())):t.value,n instanceof Date&&isNaN(n.getTime())&&(n=void 0),null!=n&&(r[a]=n)}}if(void 0!==s.$._resourceId)t._updateResource(s,r);else{const i=r.dateStart?r.dateStart:void 0,a=r.dateEnd?r.dateEnd:void 0;if((i&&i.getTime&&i.getTime()!==s.dateStart.getTime()||a&&a.getTime&&a.getTime()!==s.dateEnd.getTime())&&(r.duration=void 0),t._isPopupWindowTableModified){const i=e.querySelectorAll(".jqx-gantt-popup-window-table");for(let e=0,a=i.length;e<a;e+=1){const a=i[e];a.closest('.jqx-tab-item[value="dependency"]')?t._updateTaskDependencies(a,s):a.closest('.jqx-tab-item[value="segments"]')&&t._updateTaskSegments(a,s)}}t._updateTask(s,r)}}return t._popupWindow&&t._popupWindow.confirmPopupWindow&&a!==t._popupWindow.confirmPopupWindow&&t._popupWindow.confirmPopupWindow.close(),a.close(),void delete a._target}if(i.closest(".jqx-popup-window-button.delete"))return void t._openPopupWindow(a._target,!0);if(i.closest(".jqx-popup-window-editor-toggle")){const e=i.closest('.jqx-gantt-chart-popup-window-editor[value="deadline"]'),a=e?e.lastElementChild:void 0;if(a){const e=a.classList.contains("jqx-hidden")?"remove":"add";a.classList[e]("jqx-hidden"),i.textContent=t.localize(e)}return}const s=i.closest(".jqx-gantt-chart-button");if(s){const e=i.closest("jqx-tab-item"),r=e.querySelector(".jqx-gantt-popup-window-table");if(!r)return;const o=s.getAttribute("action"),l=e.getAttribute("value"),d=n;switch(o){case"add":{let e;e="segments"===l?{label:`${t.localize("segment")} ${r.dataSource.length+1}`,dateStart:new Date(d.dateStart),dateEnd:new Date(d.dateEnd),duration:parseFloat((d.duration||0).toFixed(2))}:{id:"",name:"",type:0,lag:0},r.addRow(e),r.beginEdit(r.rows.length-1),t._isPopupWindowTableModified=!0;break}case"delete":{const e=r.selected;r.beginUpdate();for(let t=0,i=e.length;t<i;t+=1)r.removeRow(e[t]);r.endUpdate(),t._isPopupWindowTableModified=!0;break}}t._applyTableValidation(e,r,a)}}_updateTaskDependencies(e,t){const i=this,a=i._tasks.indexOf(t),n=i._getTaskConnections(t).connectedTasks,s=e.rows;for(let e=0,t=n.length;e<t;e+=1){const t=n[e];i._removeConnection(`${t.startIndex}-${t.endIndex}-${t.type}`)}for(let e=0,t=s.length;e<t;e+=1){const t=s[e].data,n=t.name,r=t.type;if(!i._getValidConnectionId(n,a,r,"_"))continue;const o=parseInt(t.lag);i._connectTask([n,a,r,isNaN(o)?0:o])}i._recycleConnections()}_updateTaskSegments(e,t){const i=e.rows;let a=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e].data,n=t.label,s=new Date(t.dateStart),r=new Date(t.dateEnd);isNaN(s)||isNaN(r)||a.push({label:"string"==typeof n?n:"",dateStart:s,dateEnd:r})}t.segments=a,this._validateTaskSegments(t)}_createTasks(e,t){const i=this,a={},n=[];e||(e=i.dataSource),i.dataSource instanceof JQX.DataAdapter&&(e=i._parseAdapterData(i.dataSource.toArray())),t||i.clearTasks();let s=[];if(function e(r,o){let l=[];if(!r||0===r.length)return[];for(let d=0;d<r.length;d++){let c,m=r[d];if("object"!=typeof m)continue;if(m=i._validateTaskProperties(m,o),!m)continue;const u=m.tasks,h=m.id;m.$.project=o,m.$.id=o?o.$.id+"."+d:d+"","string"!=typeof h&&"number"!=typeof h||(a[h]?n.push(h):a[h]=1),u instanceof Array&&u.length>0&&(m.synchronized&&(m.dateStart=m.minDateStart=m.maxDateStart=void 0,m.dateEnd=m.minDateEnd=m.maxDateEnd=void 0),m.type="project",c=e(u,m),c.length&&(m.hidden=!c.some((e=>!e.hidden)),m.hidden?c.forEach((e=>e.hidden=m.hidden)):i._synchronizeProjectVisibility(o,m))),(!m.type||["project","task","milestone"].indexOf(m.type)<0)&&(m.type="task"),o&&"project"===m.type&&c&&c.length>0?(l.push(m),l=l.concat(c)):(o||((t&&"project"===m.type&&m.synchronized||m.dateStart&&m.dateEnd&&!isNaN(m.dateStart.getTime())&&!isNaN(m.dateEnd.getTime()))&&s.push(m),c&&(s=s.concat(c))),l.push(m))}return o&&i._synchronizeProjectDates(o,l),l}(e),t)return s.slice(0);n.length&&console.warn(i.localize("duplicateIds",{elementType:i.nodeName.toLowerCase(),duplicates:n.toString()})),i._tasks=s.slice(0),i._handleResources()}_createTimeline(){const e=this;e._tasks&&0!==e._tasks.length?(delete e.__tasks,e._createConnections(),e._autoSchedule(),e._createTimelineCells(),e._insertTimelineTasks(),e.$.taskSplitter.refresh()):e._clearTasks()}_createConnections(){const e=this,t=e._tasks;e._connections=[];for(let i=0,a=t.length;i<a;i+=1)t[i].connections&&e._handleTaskConnections(i)}_createTooltip(){const e=this,t=e.tooltip;let i=e.$.tooltip;if(t.enabled)return i||(e.$.tooltip=i=document.createElement("jqx-tooltip"),i.classList.add("jqx-gantt-chart-tooltip"),i.setAttribute("jqx-id","tooltip")),e.$tooltip||e._handleTooltipEvents(!0),i.rightToLeft=e.rightToLeft,i.theme=e.theme,i.openMode="manual",i.arrow=t.arrow,i.delay=t.delay,i.parentElement||e.$.container.appendChild(i),i;i&&(i.close(),i.remove())}_handleTooltipEvents(e){const t=this,i=t.$.tooltip;if(!i)return;let a=t.$tooltip;e?(a=t.$tooltip=JQX.Utilities.Extend(i),a.listen("close",t._tooltipVisibilityHandler.bind(t)),a.listen("closing",t._tooltipVisibilityHandler.bind(t)),a.listen("open",t._tooltipVisibilityHandler.bind(t)),a.listen("opening",t._tooltipVisibilityHandler.bind(t))):a&&(a.unlisten("close"),a.unlisten("closing"),a.unlisten("open"),a.unlisten("opening"),delete t.$tooltip)}_toggleTooltip(e){const t=this;if(t._dragDetails||!t.tooltip.enabled||!t.$.container.contains(e.target))return void t._closeTooltip();const i=t.getRootNode(),a={"jqx-task-segment":null,"jqx-timeline-task":null,"jqx-gantt-chart-task-indicator":null,"jqx-resource-timeline-view-cell":null,"jqx-task-connection":null},n=(i.host?i.host.shadowRoot:i).elementsFromPoint(e.clientX,e.clientY);let s;for(let e=0,t=n.length;e<t;e+=1){const t=n[e],i=t.classList;if(i.contains("jqx-task-container"))a["jqx-timeline-task"]=t.closest(".jqx-timeline-task");else for(let e in a)i.contains(e)&&(a[e]=t)}if(a["jqx-task-segment"]){const e=a["jqx-timeline-task"],t=e?e._cellObj.task:void 0;s=t&&t.segments&&t.segments.length?a["jqx-task-segment"]:e}else if(a["jqx-gantt-chart-task-indicator"])s=a["jqx-gantt-chart-task-indicator"];else for(let e in a)if(a[e]){s=a[e];break}s?t._openTooltip(s,e):t._closeTooltip()}_getConnectionTypeName(e){const t=this;switch(e){case 0:return t.localize("startToStart");case 1:return t.localize("endToStart");case 2:return t.localize("endToEnd");case 3:return t.localize("startToEnd");default:return""}}_getSegmentTask(e){const t=this._tasks;for(let i=0,a=t.length;i<a;i+=1){const a=t[i];if(Array.isArray(a.segments)&&a.segments.indexOf(e)>-1)return a}}_getTooltipContent(e){const t=this;if(!e)return;const i=e.classList;let a,n;if(i.contains("jqx-task-segment")){if(n=e._segmentObj,n){let e=n.label;if(void 0===e){const i=t._getSegmentTask(n);i&&(e=i.label)}a=`<label><b>${t.localize("segment")}</b>: ${e||""}</label>\n <label><b>${t.localize("dateStart")}</b>: ${t._formatDate(n.dateStart)||""}</label>\n <label><b>${t.localize("dateEnd")}</b>: ${t._formatDate(n.dateEnd)||""}</label>`}}else if(i.contains("jqx-timeline-task"))n=e._cellObj.task,n&&!n.segments&&(a=`<label><b>${t.localize("task")}</b>: ${n.label||""}</label>\n <label><b>${t.localize("dateStart")}</b>: ${t._formatDate(n.dateStart)||""}</label>\n <label><b>${t.localize("dateEnd")}</b>: ${t._formatDate(n.dateEnd)||""}</label>`);else if(i.contains("jqx-gantt-chart-task-indicator"))n=e._indicatorObj,n&&(a=n.label||"");else if(i.contains("jqx-resource-timeline-view-cell")){if(!e.hasAttribute("load"))return;const i=e.closest(".jqx-timeline-cell");if((e=e.closest(".jqx-timeline-row"))&&e._cellObj&&(n=e._cellObj.resource),n){const s=t._getResourceTasks(n),r="hours"===t.resourceTimelineView?"h":"",o=t._tasks,l=t.$.resourceTimelineViewCells.children,d=Array.from(e.children).findIndex((e=>e===i));a=`<label><b>${t.localize("resource")}</b>: ${n.label||""}</label>\n <label><b>${t.localize("assignments")}</b>:</label>`;for(let e=0,i=s.length;e<i;e+=1){const i=s[e],c=o.indexOf(i),m=t._getResourceCellCapacity({cellDateRange:t._getCellDateRange(l[d]),cellTaskIndexAssigned:[c],index:d,resource:n,task:i,cellIndex:d});void 0!==m&&(a+=`<label>${t.localize("task")} #${c}: (${parseFloat(m.capacity.toFixed(1))}${r}) ${i.label||""}</label>`)}}}else i.contains("jqx-task-connection")&&(n=t.getConnectionDetails(e.getAttribute("connection-id")),void 0!==n&&(a=`<label><b>${t.localize("startTask")}</b>: ${n.startTask.label||""}</label>\n <label><b>${t.localize("endTask")}</b>: ${n.endTask.label||""}</label>\n <label><b>${t.localize("type")}</b>: ${t._getConnectionTypeName(n.type)||""}</label>`,n.lag&&(a+=`<label><b>${t.localize("lag")}</b>: ${parseFloat(n.lag.toFixed(1))}</label>`)));return n?n.tooltip?n.tooltip+"":a||"":void 0}_openTooltip(e,t,i){const a=this,n=a.tooltip;if(i="string"==typeof i?i:a._getTooltipContent(e),!(n.enabled&&i&&e&&e.nodeName))return void a._closeTooltip();const s=a.$.tooltip||a._createTooltip();let r,o;if(i&&s.value!==i&&(s.value=i),s.selector=e,t&&t.pageX){const i=document.body.getBoundingClientRect(),a=e.getBoundingClientRect(),l=n,d=l.offset[0]||0,c=l.offset[1]||0,m=s.offsetWidth,u=s.offsetHeight;let h="bottom";"absolute"!==s.position&&(s.position="absolute",s.offset=[]),o=Math.min(i.left+i.width-m,t.pageX-m/2-d),r=a.top-u-c,r<i.top&&(r=a.bottom+c,h="top"),o<i.left&&(o=i.left+d,h="left"),h!==s.arrowDirection&&(s.arrowDirection=h),s.style.left=o+"px",s.style.top=r+"px"}else"auto"!==s.position&&(s.position="auto",s.offset=n.offset);s.visible||(a.getShadowRootOrBody().appendChild(s),s.open())}_closeTooltip(){const e=this.$.tooltip;e&&e.visible&&e.close()}_tooltipVisibilityHandler(e){const t=this,i=e.type,a=t.$.tooltip;e.target===a&&(e.stopPropagation(),t._fireTooltipVisibilityEvent(e)?e.preventDefault():"opening"===i?a.classList.remove("jqx-visibility-hidden"):"closing"===i&&(a.hasAnimation?a.addEventListener("transitionend",(()=>{a.visible||(a.classList.add("jqx-visibility-hidden"),a.style.top=a.style.left=0,t.$.container.appendChild(a))}),{once:!0}):t.$.container.appendChild(a)))}_fireTooltipVisibilityEvent(e){const t=this,i=e.type,a=t.$.tooltip,n=e.detail.owner;let s={target:a,owner:n};if(n)if(n.classList.contains("jqx-task-connection")){s.type="connection";const e=t.getConnectionDetails(n.getAttribute("connection-id"));e&&(s.item=e)}else if(n.classList.contains("jqx-gantt-chart-task-indicator"))s.type="indicator",n._indicatorObj&&(s.item=t._cloneObject(n._indicatorObj));else if(n.classList.contains("jqx-task-segment"))s.type="segment",n._segmentObj&&(s.item=t._cloneObject(n._segmentObj));else if(n.classList.contains("jqx-timeline-task"))s.type="task",n._cellObj&&n._cellObj.task&&(s.item=t._cloneObject(n._cellObj.task));else if(n.classList.contains("jqx-resource-timeline-view-cell")){s.type="resource";const e=n.closest(".jqx-timeline-row");e._cellObj&&(s.item=t._cloneObject(e._cellObj.resource))}let r=t.getAttribute("aria-owns")||"";switch(i){case"open":t.setAttribute("aria-owns",(r+" "+a.id).trim()),t.$.fireEvent(i,s);break;case"close":r=r.replace(a.id,"").trim(),r?t.setAttribute("aria-owns",r):t.removeAttribute("aria-owns"),t.$.fireEvent(i,s);break;case"closing":case"opening":if(t.$.fireEvent(i,s).defaultPrevented)return!0}}_parseAdapterData(e){let t={};for(let i=0,a=e.length;i<a;i+=1){const a=e[i],n=Object.assign({},a),s=a.parent,r=a.$.id;if(s&&s!==a){const e=s.$.id;t[e]||(t[e]=Object.assign({},s));const i=t[e];i.tasks||(i.tasks=[]),i.tasks.push(n)}else t[r]=n;delete n.parent,delete n.children,delete n.$}return Object.values(t)}_handleTaskConnections(e){const t=this,i=t._tasks;let a;if("number"==typeof e&&(a=e,e=i[e]),!e)return;void 0===a&&(a=i.indexOf(e));const n=e.connections,s=i.length;for(let e=0;e<n.length;e++){const i=n[e],r=t._getTaskIndexById(i.target);null==r||isNaN(r)||r<0||r>=s||r===a||t._connectTask([a,r,i.type,i.lag])}delete e.connections}_insertTasks(e,t,i){const a=this,n=a._tasks;if(t){const s=a._getProjectTasks(t,!0);if(s.length){const t=s[s.length-1];let r,o;"number"==typeof i&&i<s.length?r=s[i=Math.max(0,i)]:(r=t,o=!0);const l=a._getProjectTasks(r);i=o&&l.length?n.indexOf(l[l.length-1]):n.indexOf(r),n.splice.apply(n,[i+(o?1:0),0].concat(e))}else n.splice.apply(n,[n.indexOf(t)+1,0].concat(e))}else"number"==typeof i?(i+="",(i=n.findIndex((e=>e.$.id===i)))<0&&(i=n.length)):i=n.length,n.splice.apply(n,[i,0].concat(e))}_insertTimelineTasks(){const e=this,t=e._timelineVCells;t&&t.length?(e._recycleTimelineTasks(),e._refresh()):e._resetTimeline()}_recycleTimelineTasks(e){const t=this,i=t.$.taskIndicatorsContainer,a=i.children,n=t.$.taskTimelineCellsContainer.childElementCount,s=t._timelineVCells;for(;i.childElementCount>n;)i.firstElementChild.remove();if(t._closeTooltip(),!s||!s.length)return;const r=s.indexOf(t._getFirstContentCellInView()),o=t._getSelection("task",t.selectedTaskIds),l={timelineStart:t.dateStart.getTime(),timelineEnd:t.dateEnd.getTime()};for(let i=0,d=n;i<d;i++){const n=a[i],d=s[r+i];if(!d){n&&n.remove();continue}const c=d.task;t._snapToNearestDates(c),t._recycleTaskBars(d,i,o),t._setTimelineTaskBar(d,i),t._setTimelineTaskBaseline(d,i),t._setTaskBarProgress(c,i),t._setTaskBarLabel(c,i),t._setTaskIndicators(d,i,l),t._setTaskDeadline(d,i,l),e&&t._refreshTableColumnsData(c)}t._recycleConnections()}_ensureVisible(e,t="task"){const i=this;if(null==e)return;let a,n="task"===t?i._timelineVCells:i._timelineResourceVCells;a||(a=i.$[`${t}Table`]);const s=n.find((i=>i[t]===e));if(!s)return;let r,o;if("task"===t){const t=i._getTimelineTaskCellByDate(e.dateStart);if(r=i.$.taskTimelineContainer.offsetHeight,o=i,t){const e=i.scrollLeft,a=i.$.taskTimelineContainer.offsetWidth;t.left+t.width>e+a?i.scrollLeft=Math.max(0,t.left+t.width-a):t.left<e&&(i.scrollLeft=Math.max(0,t.left))}}else r=i.$.resourceTimelineContent.offsetHeight,o=i._resourceScrollView;const l=o.scrollTop;s.top+s.height>l+r?o.scrollTop=Math.max(0,s.top+s.height-r):s.top<l&&(o.scrollTop=Math.max(0,s.top))}_isTaskExpanded(e,t){if(!e||!e.$)return;let i,a=e.$[this.groupByResources?"group":"project"];if(!a)return!0;for(;a;){if(i=a.expanded,!i)return!1;if(a=a.$.project,a===t)break}return i}_getItemByTreeIndex(e,t,i){if(!t)return;const a=t.split(".");let n=this[`_${e}s`].filter((e=>!e.$.project))[t.split(".")[0]];if(n){if(!n[`${e}s`]||!n[`${e}s`].length)return i?null:n;for(let t=1;t<a.length;t++){const s=n[`${e}s`].filter((e=>!e.hidden&&e.$.project===n))[a[t]];if(!s||i&&"project"!==s.type)break;if(n=s,"project"!==n.type)break}return i?n&&"project"===n.type?n:void 0:n}}_getItemByTableId(e,t,i){if(null==t)return;const a=this[`_${e}s`];let n;for(let e=0,i=a.length;e<i;e+=1){const i=a[e];if(i.$.id===t){n=i;break}}return n?i?"project"===n.type?n:void 0:n:void 0}_tableChangeHandler(e){const t=e.target;(t.classList.contains("jqx-task-table")||t.classList.contains("jqx-resource-table"))&&(e.stopPropagation(),this._handleTableSelection(t===this.$.taskTable?"task":"resource",t.selected))}_tableColumnResizeHandler(e){const t=e.target,i=e.detail,a=t.classList.contains("jqx-task-table");if(!a&&!t.classList.contains("jqx-resource-table"))return;e.stopPropagation();const n=i.dataField,s=this[(a?"task":"resource")+"Columns"].find((e=>e.value===n));s&&(s.size=i.width),this.$.fireEvent("columnResize",i)}_tableSortFilterHandler(e){const t=this,i=e.target;let a;i.classList.contains("jqx-task-table")?(a="task",t._createTimelineContent(),t._recycleTimelineTasks()):i.classList.contains("jqx-resource-table")&&(a="resource",t._createResourceTimelineContent(),t._recycleResourceContent()),a&&(t._refresh(),e.stopPropagation(),t.$.fireEvent(e.type,Object.assign({type:a},e.detail)))}_taskTableExpandHandler(e){const t=this,i=e.target;if(!i.classList.contains("jqx-task-table")&&!i.classList.contains("jqx-resource-table"))return;const a=i===t.$.taskTable?"task":"resource";if(e.stopPropagation(),!t[`${a}s`]||!t[`${a}s`].length)return;const n=e.detail.record.itemId,s=t._getItemByTableId(a,n,!0);s&&(delete t._hoveredItem,s.expanded="collapse"!==e.type,t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks(),t.$.fireEvent(e.type,{item:t._cloneObject(s),id:s.id||s.$.id,index:t._tasks.indexOf(s),label:s.label,value:s.value}))}_taskTableKeyDownHandler(e){const t=this,i=e.key;if(t.keyboardNavigation&&!t.disabled&&!t.readonly)switch(i){case"Delete":case"Enter":{const e=t.$.taskTable._focusedCell;if(!e||!e.closest)return;const a=e.closest("tbody tr");if(!a)return;const n=t._getVCellById("task",a.getAttribute("row-id"));n&&t._openPopupWindow(n.task,"Delete"===i);break}}}_getVCellById(e="task",t){const i="task"===e?this._timelineVCells:this._timelineResourceVCells;if(i&&i.length)for(let a=0,n=i.length;a<n;a+=1){const n=i[a][e];if(n.$&&n.$.id===t)return i[a]}}_getGroupVCellByPath(e,t){const i="task"===e?this._timelineVCells:this._timelineResourceVCells;if(i&&i.length)for(let a=0,n=i.length;a<n;a+=1){const n=i[a][e];if(n.$&&n.$.id===t)return i[a]}}_taskTableGroupEventHandler(e){const t=this,i=e.detail.action,a=e.target;if(["collapse","expand"].indexOf(i)<0||!a.classList.contains("jqx-task-table")&&!a.classList.contains("jqx-resource-table"))return;const n=a===t.$.taskTable?"task":"resource",s=t.$.taskTable._getGroupByIndex(e.detail.path),r=t._getGroupVCellByPath(n,s.$.id);if(!r||!r[n].isGroup)return;const o=r[n];e.stopPropagation(),o.expanded="collapse"!==i,t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks(),t.$.fireEvent(i,{isGroup:!0,item:t._cloneObject(o),id:o.$.id,label:o.label})}_resetTimeline(){const e=this,t=e.$.taskTimelineContainer;if(e.$.taskTimelineCellsContainer.innerHTML="",e.$.timelineTasksContainer.innerHTML="",e.$.timelineConnectionsContainer.innerHTML="",e.$.timelineContent.style.height="",e.$.taskIndicatorsContainer.innerHTML="",e.rightToLeft&&e.scrollLeft!==t.scrollLeft){const i=e._getScrollLeft(e.scrollLeft);t.scrollLeft=i,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollLeft=i)}e._closeTooltip(),e.$.container.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height")}_refreshTimeline(e){const t=this;e||(e=t.view);const i=t._getDateFromCell(t.scrollLeft,t._getFirstCellObjInView(),e),a=t.scrollTop;t._refreshing=!0,t.scrollLeft=0,t.scrollTop=0,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&t._resourceScrollView&&(t._resourceScrollView.scrollLeft=0),t._resetTimeline(),t._createTimelineCells(),t._recycleTimelineTasks(!0),t.$.mainSplitter.contains(t.$.resourceSplitter)&&t._refreshResourceTimeline(),t._refresh(),t._refreshing=!1,t._scrollTo(i),t.scrollTop=a}_scrollTo(e,t){const i=this,a=i._timelineCells;let n;if(void 0!==e&&!isNaN(new Date(e).getTime()))for(let s=0;s<a.length;s++){const r=a[s],o=r.date;switch(i.view){case"quarter":case"year":if(o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()){if(t){n=r.left;break}let i=new Date(e);i.setMonth(e.getMonth()+1),i.setDate(0),i=i.getDate(),n=r.left+(e.getDate()-1)/i*r.width}break;case"month":{let i=new Date(o),a=new Date(o);i.setDate(i.getDate()-i.getDay()),a.setDate(a.getDate()+(6-a.getDay())+1),a.setMilliseconds(a.getMilliseconds()-1),e.getTime()>=i.getTime()&&e.getTime()<=a.getTime()&&(n=r.left+(t||t?0:e.getDay()/7*r.width));break}case"week":o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()&&o.getDate()===e.getDate()&&(n=r.left+parseFloat(e.getHours()+"."+e.getMinutes()+e.getSeconds())/24*r.width);break;case"day":o.getFullYear()===e.getFullYear()&&o.getMonth()===e.getMonth()&&o.getDate()===e.getDate()&&o.getHours()===e.getHours()&&(n=r.left+(t?0:parseFloat(e.getMinutes()+e.getSeconds())/60*r.width))}if(void 0!==n)return i.scrollLeft=n,void(i.$.mainSplitter.contains(i.$.resourceTimelineHeader)&&(i.$.resourceTimelineHeader.scrollLeft=i.$.resourceTimelineContent.scrollLeft=n,i._refreshResourceTimeline()))}}_updateConnection(e,t){const i=this,a=i._tasks,[n,s,r,o]=e,l=a[n],d=a[s];if(!l||!d||"number"!=typeof r)return;let c=i._connections,m=-1;c||(c=i._connections=[]);for(let e=0,t=c.length;e<t;e+=1){const t=c[e],i=t.startIndex,a=t.endIndex;if(i===n&&a===s||i===s&&a===n){m=e;break}}if(!t){if(m<0)c.push({startTask:a[n],endTask:a[s],startIndex:n,endIndex:s,type:r,lag:o});else{const e=c[m];if(!e)return;if(e.startIndex=n,e.startTask=a[n],e.endIndex=s,e.endTask=a[s],e.type=r,o!==e.lag){const t=parseInt(o);isNaN(t)||(e.lag=t)}}return!0}m>-1&&c.splice(m,1)}_createTimelineCells(){const e=this,t=e._tasks,i=new Date(e.properties.dateStart.value),a=new Date(e.properties.dateEnd.value);let n,s;if(isNaN(i.getTime())||(n=i),isNaN(a.getTime())||(s=a),t.length>0){let e=t[0].dateStart,i=t[0].dateEnd;for(let a=0;a<t.length;a++)t[a].dateStart&&t[a].dateEnd&&(e||(e=t[a].dateStart),i||(i=t[a].dateEnd),e.getTime()>t[a].dateStart.getTime()&&(e=t[a].dateStart),i.getTime()<t[a].dateEnd.getTime()&&(i=t[a].dateEnd));(!n||n.getTime()>e.getTime())&&(n=e),(!s||s.getTime()<i.getTime())&&(s=i)}n&&s&&(n=e._minMaxDateValidator(n),s=e._minMaxDateValidator(s),e._createTimelineHeader(n,e._getCellsCount(n,s)),e._createTimelineContent(),e._createDateMarkers(),e._refresh())}_getCellsCount(e,t,i){let a,n,s,r,o,l,d=new Date(e),c=new Date(t);const m=this,u=t.getFullYear()-e.getFullYear();if(n=a=Math.round(u)+1,"year"===i)return{year:n};if(d.setHours(d.getHours(),0,0,0),c.setHours(c.getHours(),0,0,0),l=Math.floor((t.getTime()-e.getTime())/36e5),l>0){let e=new Date(d);if(l=1,d.getFullYear()!==c.getFullYear()){let t=new Date(d.getFullYear()+1,0,1,0,0,0,0);for(;e.getTime()!==t.getTime();){const t=e.getTime();e.setHours(e.getHours()+1),e.getTime()===t&&e.setHours(e.getHours()+2),l++}const i=c.getFullYear()-t.getFullYear();for(let t=0;t<i;t++){const t=e.getFullYear();l+=24*((t%100==0?t%400==0:t%4==0)?366:365)-1,e.setFullYear(t+1)}}for(;e.getTime()<c.getTime();){const t=e.getTime();e.setHours(e.getHours()+1),e.getTime()===t&&e.setHours(e.getHours()+2),l++}}if("hour"===i)return{hour:l};if(d.setHours(0,0,0,0),c.setHours(23,59,59,999),o=a=Math.round((c.getTime()-d.getTime())/864e5),"day"===i)return{day:o};if(d.setDate(d.getDate()-d.getDay()),c.setDate(c.getDate()+6-c.getDay()),r=a=Math.round((c.getTime()-d.getTime())/6048e5),"week"===i){if(-1!==m.firstDayOfWeek){const t=e.getDay()-m.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+m.firstDayOfWeek-(t>=0?0:7))}return{week:r}}if("month"===this.view&&"day"!==m.monthScale&&(0!==e.getDay()&&(e=new Date(e.setDate(e.getDate()-e.getDay()))),6!==t.getDay()&&(t=new Date(t.setDate(t.getDate()+6-t.getDay()))),-1!==m.firstDayOfWeek)){const t=e.getDay()-m.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+m.firstDayOfWeek-(t>=0?0:7))}if(e.getFullYear()!==t.getFullYear()){a=12-e.getMonth();const i=t.getFullYear();for(let n=e.getFullYear()+1;n<=i;n++)a+=n===t.getFullYear()?t.getMonth()+1:12}else a=t.getMonth()-e.getMonth()+1;return s=Math.ceil(a),"months"===i?{month:s}:("day"===this.view&&0===l&&(l=1),{year:n,month:s,week:r,day:o,hour:l})}_recycleTaskBars(e,t,i){const a=this,n=e.task,s=a.$.timelineTasksContainer,r=a.$.taskTimelineCellsContainer,o="project"===n.type&&n.synchronized,l=n.type,d=n.$.id,c=s.children[t],m=r.children[t];m._cellObj=e,m.setAttribute("row-id",d),m.style.top=e.top+"px",m.removeAttribute("hover"),c.removeAttribute("hover"),c.classList.contains(l)||(c.innerHTML="milestone"===l?'<div class="jqx-task-container" aria-hidden="true">\n <div class="jqx-task-connection-point start"></div>\n <div class="jqx-task-segments"></div>\n <div class="jqx-task-connection-point end"></div>\n </div>':'<div class="jqx-task-container" aria-hidden="true">\n <div class="jqx-task-connection-point start"></div>\n <div class="jqx-task-segments"></div>\n <div class="jqx-timeline-task-progress-thumb"></div>\n <div class="jqx-task-connection-point end"></div>\n </div>'),n.connectionType&&(n.connectionType.includes("start")||c.querySelector(".start").classList.add("jqx-hidden"),n.connectionType.includes("end")||c.querySelector(".end").classList.add("jqx-hidden")),a._recycleSegments(n,c),delete c._cellStart,delete c._cellEnd,n.disableDrag||o&&!n.dragProject?c.setAttribute("disable-drag",""):c.removeAttribute("disable-drag"),n.disableResize||o?c.setAttribute("disable-resize",""):c.removeAttribute("disable-resize"),n.isGroup?c.setAttribute("resource-group",""):c.removeAttribute("resource-group"),i&&(i.indexOf(d)>-1?(c.setAttribute("selected",""),m.setAttribute("selected","")):(c.removeAttribute("selected"),m.removeAttribute("selected"))),n.id?c.id=n.id:c.id="ganttTask"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),c._cellObj=e,c.className="jqx-timeline-task "+l,c.setAttribute("row-id",d),n.class&&c.classList.add(n.class),c.setAttribute("aria-label",n.label+" Start date: "+a._toISODate(n.dateStart)+", End date: "+a._toISODate(n.dateEnd)),c.setAttribute("aria-selected","false")}_toISODate(e){const t=e.getFullYear(),i=e.getMonth()+1,a=e.getDate();return t+"-"+(i<10?"0"+i:i)+"-"+(a<10?"0"+a:a)}_recycleSegments(e,t){const i=this,a=t.querySelector(".jqx-task-segments");let n,s=e.segments;if(!a)return;for(Array.isArray(s)&&s&&s.length&&"task"===e.type||(s=[e]);a.childElementCount>s.length;)a.children[0].remove();const r=document.createDocumentFragment(),o=a.children,l="milestone"===e.type?'<div class="jqx-timeline-task-fill"></div>':'<div class="jqx-timeline-task-fill">\n <div class="jqx-timeline-task-progress"></div>\n </div>\n <div class="jqx-timeline-task-label"></div>';for(let t=0,a=s.length;t<a;t+=1){const a=s[t];let d=o[t];a.dateStart=new Date(Math.max(e.dateStart.getTime(),a.dateStart.getTime())),a.dateEnd=new Date(Math.min(e.dateEnd.getTime(),a.dateEnd.getTime())),d?(delete d._cellStart,delete d._cellEnd):(d=document.createElement("div"),d.classList.add("jqx-task-segment"),d.innerHTML=l,r.appendChild(d)),a.disableDrag?d.setAttribute("disable-drag",""):d.removeAttribute("disable-drag"),a.disableResize?d.setAttribute("disable-resize",""):d.removeAttribute("disable-resize"),d._segmentObj=a,d.setAttribute("aria-label",(a.label||"")+" Start date: "+i._toISODate(a.dateStart)+", End date: "+i._toISODate(a.dateEnd)),n=d}r.childElementCount&&a.appendChild(r),i._setTaskBarDeadline(e,n)}_createCells(e){let t,i=document.createDocumentFragment();for(let a=0;a<e;a++)t=document.createElement("div"),t.classList.add("jqx-timeline-view-cell"),t.setAttribute("role","columnheader"),i.appendChild(t);return i}_getTimelineVisibleCellsCount(){const e=this,t=e._timelineCells;if(!t)return;const i=e._getFirstCellObjInView();if(!i)return t.length;const a=1-(i.left+i.width-e.scrollLeft)/t[0].width;return Math.min(t.length,Math.ceil(parseFloat((e.$.timeline.offsetWidth/i.width).toFixed(2))+a))}_getHeaderVisibleCellsCount(){const e=this;if(!e._timelineHeaderCells)return;const t=Math.abs(e.scrollLeft),i=e.$.timeline.offsetWidth,a=e._timelineHeaderCells;let n=0;for(let e=0;e<a.length;e++){const s=a[e];s.left+s.width>t&&s.left<i+t&&n++}return n}_getHeaderSubVisibleCellsCount(){const e=this;if(!e._timelineHeaderSubCells)return;const t=Math.abs(e.scrollLeft),i=e.$.timeline.offsetWidth,a=e._timelineHeaderSubCells;let n=0;for(let e=0;e<a.length;e++){const s=a[e];s.left+s.width>t&&s.left<i+t&&n++}return n}_refreshHeaderDate(e){const t=this,i=t._getCellsViewType(),a=t.$.timelineHeader.scrollLeft,n=t.$.timelineViewCells.children,s=t._timelineCells;let r;t._refreshHeaderSubDetailsDate(e),t._refreshHeaderDetailsDate(e);for(let e=0;e<s.length;e++){const t=s[e];if(a<=t.left+t.width){r=e;break}}for(let a=0;a<n.length;a++){const o=n[a],l=s[r];if(!l)break;r++;const d=l.date;o.innerHTML=`<div>${t._getDateString(new Date(d),i)}</div>`,e||(o._date=new Date(d),o.setAttribute("date",d.toLocaleDateString()),o.style.width=l.width+"px",o.style[t.rightToLeft?"right":"left"]=l.left+"px",l.weekend?o.setAttribute("weekend",""):o.removeAttribute("weekend"),l.nonworking?o.setAttribute("nonworking",""):o.removeAttribute("nonworking"))}}_getDateString(e,t,i){const a=this,n=["2-digit","numeric"][a.dayFormat]||"numeric";let s;if("year"===t||"quarter"===t)s=e.toLocaleDateString(a.locale,{year:a.yearFormat});else if("month"===t)s=e.toLocaleDateString(a.locale,{month:a.monthFormat}),"month"===a.view&&(s+=" "+e.toLocaleDateString(a.locale,{year:a.yearFormat}));else if("week"===t)s="numeric"!==a.weekFormat&&i?e.toLocaleDateString(a.locale,{day:n,month:a.monthFormat,year:a.yearFormat}):a._getWeekNumber(e);else if("day"===t)s="month"===a.view?"numeric"!==a.dayFormat&&"2-digit"!==a.dayFormat?e.toLocaleDateString(a.locale,{day:"numeric"})+" "+e.toLocaleDateString(a.locale,{weekday:a.dayFormat}):e.toLocaleDateString(a.locale,{day:"numeric"})+" "+e.toLocaleDateString(a.locale,{weekday:"short"}):e.toLocaleDateString(a.locale,"day"===a.view?{day:n,month:a.monthFormat,year:a.yearFormat}:["long","short","narrow"].indexOf(a.dayFormat)>-1?{weekday:a.dayFormat}:{day:a.dayFormat});else if("hour"===t)if(s="default"===a.hourFormat?e.toLocaleTimeString(a.locale,{hour12:!1}):e.toLocaleDateString(a.locale,{hour:a.hourFormat}),"default"!==a.hourFormat)s.indexOf(",")>=0&&(s=s.substring(s.indexOf(",")+1).trim());else if(s.indexOf(":")!==s.lastIndexOf(":")&&s.indexOf(":")>=0){let e=s.toLowerCase().indexOf("am")>=0?" AM":"";e=s.toLowerCase().indexOf("pm")>=0?" PM":e,s=s.substring(0,s.lastIndexOf(":"))+e}return a.timelineHeaderFormatFunction?a.timelineHeaderFormatFunction(new Date(e),t,i,s):s}_refreshHeaderSubDetailsDate(e){const t=this,i=(t.view,t.scrollLeft),a=t.$.timelineViewSubDetails.children,n=t._timelineHeaderSubCells;let s;if(t.$.timelineViewSubDetails.classList.contains("jqx-hidden"))return;for(let e=0;e<n.length;e++){const t=n[e];if(i<=t.left+t.width){s=e;break}}let r=[],o=0;for(let i=0;i<a.length;i++){const l=n[s],d=a[i];if(!l)continue;let c=new Date(l.date);"week"===t.view&&c.setDate(c.getDate()-c.getDay()),s++,c=new Date(Math.max(l.date.getTime(),c.getTime()));const m=e=>{var i,a=e.getMonth();return i=a>=9?4:a>=6?3:a>=3?2:1,"long"===t.quarterFormat?t.localize("quarter")+" "+i:"numeric"===t.quarterFormat?i:t.localize("quarterShort")+i};let u="";"quarter"===t.view||"year"===t.view?(u=m(c),"quarter"===t.view&&t.hideTimelineSecondHeaderDetails&&(u+=" "+c.getFullYear())):"month"===t.view&&(-1===t.firstDayOfWeek?u=t._getWeekNumber(c):((c.getDay()-t.firstDayOfWeek)%7==0&&i>0&&o++,u=o));const h=u+"_"+c.getFullYear();r[h]||(r[h]=[]),d.classList.remove("jqx-visibility-hidden"),r[h].push({element:d,cell:l}),d.innerHTML=`<div>${u}</div>`,d.classList.add("middle"),e||(d._date=c,d.style[t.rightToLeft?"right":"left"]=l.left+"px",d.style.width=l.width+"px")}for(let e in r){const i=r[e];let a=0;for(let e=0;e<i.length;e++)a+=i[e].cell.width;if(i[0].element.style.width=a+"px","year"===t.view){const e=i[0].cell.date.toLocaleDateString(t.locale,{month:t.monthFormat}),a=i[i.length-1].cell.date.toLocaleDateString(t.locale,{month:t.monthFormat});i.length>1?i[0].element.innerHTML=`<div>${e}-${a}</div>`:i[0].element.innerHTML=`<div>${e}</div>`}else if("month"===t.view){const e="numeric"!==t.dayFormat&&"2-digit"!==t.dayFormat?t.dayFormat:"short",a=i[0].cell.date.toLocaleDateString(t.locale,{day:"numeric"})+" "+i[0].cell.date.toLocaleDateString(t.locale,{weekday:e}),n=i[i.length-1].cell.date.toLocaleDateString(t.locale,{day:"numeric"})+" "+i[i.length-1].cell.date.toLocaleDateString(t.locale,{weekday:e});i.length>1?i[0].element.innerHTML=`<div>${a}-${n}</div>`:i[0].element.innerHTML=`<div>${a}</div>`,"numeric"===t.weekFormat&&(i[0].element.innerHTML=t._getWeekNumber(i[0].cell.date))}if(t.timelineHeaderFormatFunction){const e=t.timelineHeaderFormatFunction(new Date(i[0].cell.date),t.view,!0,i[0].element.innerHTML);i[0].element.innerHTML!==e&&(i[0].element.innerHTML=e)}for(let e=1;e<i.length;e++)i[e].element.classList.add("jqx-visibility-hidden")}}_refreshHeaderDetailsDate(e){const t=this,i=t.view,a=t.scrollLeft,n=t.$.timelineViewDetails.children,s=t._timelineHeaderCells;let r;for(let e=0;e<s.length;e++){const t=s[e];if(a<=t.left+t.width){r=e;break}}for(let a=0;a<n.length;a++){const o=s[r],l=n[a];let d=new Date(o.date);if("week"===t.view)if(-1!==t.firstDayOfWeek){const e=d.getDay()-t.firstDayOfWeek;d.setDate(d.getDate()-d.getDay()+t.firstDayOfWeek-(e>=0?0:7))}else d.setDate(d.getDate()-d.getDay());r++,d=new Date(Math.max(o.date.getTime(),d.getTime())),l.innerHTML=`<div>${t._getDateString(d,i,!0)}</div>`,e||(l._date=d,l.style[t.rightToLeft?"right":"left"]=o.left+"px",l.style.width=o.width+"px")}}_getWeekNumber(e){let t,i=new Date(e.getFullYear(),0,1),a=Math.round((e.getTime()-i.getTime()-6e4*(e.getTimezoneOffset()-i.getTimezoneOffset()))/864e5)+1,n=i.getDay();if(n=n>=0?n:n+7,n<4)t=Math.floor((a+n-1)/7)+1,t>52&&(i=new Date(e.getFullYear()+1,0,1),n=i.getDay(),n=n>=0?n:n+7,t=n<4?1:53);else if("week"===this.view){const i=function(e){var t=new Date(e.valueOf()),i=(e.getDay()+6)%7;t.setDate(t.getDate()-i+3);var a=t.valueOf();return t.setMonth(0,1),4!==t.getDay()&&t.setMonth(0,1+(4-t.getDay()+7)%7),1+Math.ceil((a-t)/6048e5)};t=i(e)}else t=Math.round((a+n-1)/7);return t}_convertDuration(e,t){if(!e)return 0;let i;switch(this.durationUnit){case"day":i=864e5;break;case"hour":i=36e5;break;case"minute":i=6e4;break;case"second":i=1e3;break;case"milisecond":return e;case"week":i=6048e5}return Math.max(0,t?e/i:e*i)}_createTimelineHeader(e,t){const i=this,a=i._getCellsViewType();if(!e){const t=i.$.timelineViewCells.children;if(0===t.length)return;e=t[0]._date}if("day"!==i.view&&e.setHours(0,0,0,0),-1!==i.firstDayOfWeek){const t=e.getDay()-i.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+i.firstDayOfWeek-(t>=0?0:7))}if(i.$.timelineContent.offsetWidth===i.$.timeline.offsetWidth&&i._timelineCells&&i._timelineCells[0]&&i._timelineCells[0].date.getTime()===e.getTime()&&i._timelineCells.length===t[i._getCellsViewType()])return void i._refresh();i.$.timelineContent.style.width=i.$.timelineHeaderContent.style.width="",i._createTimelineCellsObj(e,t),i._createTimelineHeaderCellsObj(e,t),i._createTimelineHeaderSubCellsObj(e,t),i.$.timelineViewDetails.innerHTML="",i.$.timelineViewDetails.appendChild(i._createCells(i._getHeaderVisibleCellsCount())),i.$.timelineViewSubDetails.innerHTML="",i.$.timelineViewCells.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.classList.add("jqx-hidden");let n=2;"quarter"===i.view?(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(i._getTimelineVisibleCellsCount()))):"month"===i.view&&"day"===i.monthScale?(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(t.day))):"year"===i.view&&(n=3,i.$.timelineViewSubDetails.classList.remove("jqx-hidden"),i.$.timelineViewSubDetails.appendChild(i._createCells(t.month))),i.hideTimelineHeader&&(i.$.timelineViewCells.classList.add("jqx-hidden"),n--),i.hideTimelineHeaderDetails&&(i.$.timelineViewDetails.classList.add("jqx-hidden"),n--),i.hideTimelineSecondHeaderDetails&&("quarter"===i.view?i.$.timelineViewDetails.classList.add("jqx-hidden"):i.$.timelineViewSubDetails.classList.add("jqx-hidden"),("year"===i.view||"month"===i.view&&"day"===i.monthScale||"quarter"===i.view)&&n--),i.$.taskTable.style.setProperty("--jqx-table-column-header-height","calc("+n+" * var(--jqx-gantt-chart-task-default-height) - calc("+n+" * var(--jqx-border-width) / "+n+"))"),i.$.timelineViewCells.innerHTML="",i.$.timelineViewCells.appendChild(i._createCells(i._getTimelineVisibleCellsCount()));let s=t[a];if("hour"===a&&("halfHour"===i.dayScale?s*=2:"quarterHour"===i.dayScale&&(s*=4)),i.$.timelineContent.style.width=i.$.timelineHeaderContent.style.width=Math.max(s*i._timelineCells[0].width,i.$.timeline.parentElement.offsetWidth)+"px",i.scrollLeft){const e=i._getScrollLeft(i.scrollLeft);i.$.timelineHeader.scrollLeft=e,i.$.mainSplitter.contains(i.$.resourceTimelineHeader)&&(i.$.resourceTimelineHeader.scrollLeft=e)}i._refreshHeaderDate(),i._setCurrentTimeIndicators()}_createTimelineContent(){const e=this,t=e.$.container,i=e.$.timelineContent,a=e._taskDefaultHeight,n=e.$.taskTimelineContainer,s=e.scrollLeft;if(i.style.height="",t.style.removeProperty("--jqx-gantt-chart-task-timeline-content-height"),e._createTimelineVCells(a),i.style.height=e._timelineVCells.length*a+"px",t.style.setProperty("--jqx-gantt-chart-task-timeline-content-height",e.$.timeline.offsetHeight+"px"),s||s!==n.scrollLeft){const t=e._getScrollLeft(e.scrollLeft);n.scrollLeft=t,e.$.mainSplitter.contains(e.$.resourceTimelineHeader)&&(e.$.resourceTimelineContent.scrollLeft=t)}e.scrollTop&&(n.scrollTop=e.scrollTop),e._recycleContentCells()}_createDateMarkers(){const e=this,t=e.dateMarkers;let i=[];delete e._markers;for(let a=0,n=t.length;a<n;a+=1){const n=t[a],s=e._dateValidator(void 0,n.date);if(s){const e={date:s},t=n.label,a=n.className;("string"==typeof t||"number"==typeof t&&!isNaN(t))&&(e.label=t),"string"==typeof a&&(e.className=a),i.push(e)}}i.length&&(e._markers=i),e._recycleDateMarkers()}_createTimelineRowCells(e,t){const i=this,a=e.children,n=e.querySelectorAll(".jqx-task-bar-limiter"),s=document.createDocumentFragment(),[r,o]=i.rightToLeft?["right","left"]:["left","right"];t||(t=i.$.timelineViewCells.children);for(let e=0,t=n.length;e<t;e+=1)n[e].remove();const l=t.length;for(;e.childElementCount>l;)e.lastElementChild.remove();for(let t=e.childElementCount;t<l;t+=1){const e=document.createElement("div");e.classList.add("jqx-timeline-cell"),s.appendChild(e)}s.childElementCount&&e.appendChild(s);for(let e=0;e<l;e+=1){const i=t[e],n=a[e];i.hasAttribute("weekend")?n.setAttribute("weekend",""):n.removeAttribute("weekend"),i.hasAttribute("nonworking")?n.setAttribute("nonworking",""):n.removeAttribute("nonworking"),n.style[o]=i.style[o],n.style[r]=i.style[r],n.style.width=i.style.width}for(let t=0,i=n.length;t<i;t+=1)e.appendChild(n[t])}_recycleTimelineRowCells(){const e=this,t=e.$.timelineViewCells.children,i=e.$.taskTimelineCellsContainer.children;for(let a=0,n=i.length;a<n;a+=1)e._createTimelineRowCells(i[a],t)}_createTimelineVCells(e){const t=this,i=t._tasks,a=t.$.taskTable.rows,n=t.groupByResources;let s=0,r={};t._timelineVCells=[];for(let o=0,l=a.length;o<l;o++){const l=a[o].data;let d=i[l.itemIndex];if(n)if(!d&&l.groupDataField){const e=l.$.id;d={$:{id:e,project:void 0},label:t._formatResourceGroupLabel(l.label),value:l.label,expanded:l.expanded,synchronized:!0,isGroup:!0,type:"project"},r[e]=d}else l.parent?(d.$.group=r[l.parent.$.id],t._synchronizeProjectDates(d.$.group,[d])):delete d.$.group;else delete d.$.group;!d.hidden&&t._isTaskExpanded(d)&&(t._timelineVCells.push({top:s,height:e,task:d}),s=parseFloat((s+e).toFixed(2)))}}_getCellsViewType(){const e=this;switch(e.view){case"quarter":case"year":return"month";case"month":return"day"===e.monthScale?"day":"week";case"week":return"day";case"day":return"hour"}}_dateAdd(e,t,i){if(e instanceof Date){var a=new Date(e),n=function(){a.getDate()!==e.getDate()&&a.setDate(0)};switch(String(t).toLowerCase()){case"year":a.setFullYear(a.getFullYear()+i),n();break;case"quarter":a.setMonth(a.getMonth()+3*i),n();break;case"month":a.setMonth(a.getMonth()+i),n();break;case"week":a.setDate(a.getDate()+7*i);break;case"day":a.setDate(a.getDate()+i);break;case"hour":a.setTime(a.getTime()+36e5*i);break;case"minute":a.setTime(a.getTime()+6e4*i);break;case"second":a.setTime(a.getTime()+1e3*i);break;default:a=void 0}return a}}_createTimelineCellsObj(e,t){const i=this,a=i._getCellsViewType();t=t[a],"hour"===a&&"halfHour"===i.dayScale?t*=2:"hour"===a&&"quarterHour"===i.dayScale&&(t*=4);const n=i.$.timeline.parentElement.offsetWidth;let s=Math.max(i._timelineCellSize,i._timelineCellMinSize),r=0,o=new Date(e);t*s<n&&(s=n/t),s=parseFloat(s.toFixed(2)),i._timelineCells=[];for(let e=0;e<t;e++){const t={left:r,width:s};if("year"===a||"quarter"===a)o.setMonth(0),t.date=new Date(o),o.setFullYear(o.getFullYear()+1);else if("month"===a)o.setDate(1),t.date=new Date(o),o.setMonth(o.getMonth()+1);else if("week"===a)o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),t.date=new Date(o),o.setDate(o.getDate()+7);else if("day"===a)i.nonworkingDays.indexOf(o.getDay())>-1&&(t.nonworking=!0),o.setHours(0,0,0,0),t.date=new Date(o),o.setDate(o.getDate()+1),t.weekend=0===t.date.getDay()||6===t.date.getDay();else if("hour"===a){(i.nonworkingHours.indexOf(o.getHours())>-1||i.nonworkingDays.indexOf(o.getDay())>-1)&&(t.nonworking=!0),"hour"!==i.dayScale&&0!==e||o.setHours(o.getHours(),0,0,0),t.date=new Date(o);const a=o.getTime();"hour"===i.dayScale?o.setHours(o.getHours()+1):"halfHour"===i.dayScale?o=i._dateAdd(o,"minute",30):"quarterHour"===i.dayScale&&(o=i._dateAdd(o,"minute",15)),a===o.getTime()&&o.setHours(o.getHours()+2),t.weekend=0===t.date.getDay()||6===t.date.getDay()}i._timelineCells.push(t),r=parseFloat((r+s).toFixed(2))}}_createTimelineHeaderSubCellsObj(e,t){const i=this,a=i._getCellsViewType();t="month"===i.view&&"day"===i.monthScale?t.day:t[a],"hour"===a&&"halfHour"===i.dayScale?t*=2:"hour"===a&&"quarterHour"===i.dayScale&&(t*=4);const n=i.$.timeline.parentElement.offsetWidth;let s=Math.max(i._timelineCellSize,i._timelineCellMinSize),r=0,o=new Date(e);t*s<n&&(s=n/t),s=parseFloat(s.toFixed(2)),i._timelineHeaderSubCells=[];for(let e=0;e<t;e++){const t={left:r,width:s};if("year"===a||"quarter"===a)o.setMonth(0),t.date=new Date(o),o.setFullYear(o.getFullYear()+1);else if("month"===a)o.setDate(1),t.date=new Date(o),o.setMonth(o.getMonth()+1);else if("week"===a)o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),t.date=new Date(o),o.setDate(o.getDate()+7);else if("day"===a)i.nonworkingDays.indexOf(o.getDay())>-1&&(t.nonworking=!0),o.setHours(0,0,0,0),t.date=new Date(o),o.setDate(o.getDate()+1),t.weekend=0===t.date.getDay()||6===t.date.getDay();else if("hour"===a){(i.nonworkingHours.indexOf(o.getHours())>-1||i.nonworkingDays.indexOf(o.getDay())>-1)&&(t.nonworking=!0),"hour"!==i.dayScale&&0!==e||o.setHours(o.getHours(),0,0,0),t.date=new Date(o);const a=o.getTime();"hour"===i.dayScale?o.setHours(o.getHours()+1):"halfHour"===i.dayScale?o=i._dateAdd(o,"minute",30):"quarterHour"===i.dayScale&&(o=i._dateAdd(o,"minute",15)),a===o.getTime()&&o.setHours(o.getHours()+2),t.weekend=0===t.date.getDay()||6===t.date.getDay()}i._timelineHeaderSubCells.push(t),r=parseFloat((r+s).toFixed(2))}}_createTimelineHeaderCellsObj(e,t){const i=this;let a=i.view,n=0,s=new Date(e);"quarter"===a&&(a="year"),t=t[a],i._timelineHeaderCells=[];for(let e=0;e<t;e++){const t={};switch(t.date=new Date(s),a){case"quarter":case"year":s.setFullYear(s.getFullYear()+1);break;case"month":s.setDate(1),s.setMonth(s.getMonth()+1);break;case"week":s.setDate(s.getDate()+7);break;case"day":s.setDate(s.getDate()+1)}n=i._refreshViewDetailCell(t,n,e),i._timelineHeaderCells.push(t)}}_minMaxDateValidator(e){if(!e||isNaN(e.getTime()))return e;const t=new Date(this.min),i=new Date(this.max);return t&&(e=new Date(Math.max(t.getTime(),e.getTime()))),i&&(e=new Date(Math.min(i.getTime(),e.getTime()))),e}_dateValidator(e,t){const i=this;let a;if(t instanceof Date)return i._minMaxDateValidator(t);if(JQX.Utilities.DateTime&&t instanceof JQX.Utilities.DateTime)return i._minMaxDateValidator(t.toDate());if("string"!=typeof t)return i._minMaxDateValidator(e);{const e=/\d+:\d+:\d+/;if("new Date()"===t.trim()||"new JQX.Utilities.DateTime()"===t.trim())return i._minMaxDateValidator(new Date);if(isNaN(Date.parse(t))){const i=/(\d+[,-.\/]{1}\s*\d+[,-.\/]{1}\s*\d+)/;if(i.test(t)){const n=i.exec(t)[0].replace(/[,-.\/]/g,",").split(",");if(3===n.length){const[i,s]=parseInt(n[0])<parseInt(n[2])?[n[0],n[2]]:[n[2],n[0]];if(a=new Date(parseInt(s),parseInt(n[1])-1,parseInt(i)),e.test(t)){const i=e.exec(t)[0].split(":");a.setHours(i[0]||0,i[1]||0,i[2]||0)}t=a}}}else a=new Date(Date.parse(t)),e.test(t)||a.setHours(0,0,0,0),t=a}return i._minMaxDateValidator(new Date(t))}_currentTimeIndicatorIntervalValidator(e,t){return Math.max(1,t)}_getTaskBarPositionLimits(e,t){const i=this;function a(e){const t=i._getTimelineTaskCellByDate(e);if(t)return t.left+i._getTimelineTaskOffset(t,e)||0}return{min:a(e["min"+t]),max:a(e["max"+t])}}_getTimelineTaskOffset(e,t){if(!e)return;let i,a;switch(this.view){case"quarter":case"year":{const n=t.getHours()/24+t.getMinutes()/1440+t.getSeconds()/86400;i=new Date(e.date.getFullYear(),e.date.getMonth()+1,0),a=(t.getDate()-1+n)/i.getDate()*e.width;break}case"month":a=t.getDay()/7*e.width;break;case"week":a=parseFloat(t.getHours()+t.getMinutes()/60+t.getSeconds()/3600)/24*e.width;break;case"day":a=parseFloat(t.getMinutes()+t.getSeconds()/60)/60*e.width}return a}_getTaskBarSizeLimits(e,t){const i=this,a=i._getTaskBarDateRange(e);let n,s=0,r=i._convertDuration(e._cellObj.task.minDuration)||i._getMinDuration(e,t),o=i._convertDuration(e._cellObj.task.maxDuration);function l(n,s){if(!n)return;let r,o;"left"===t&&!i.rightToLeft||"right"===t&&i.rightToLeft?(n*=-1,o=a.dateEnd):o=a.dateStart,s&&Math.abs(r)===Math.abs(n)&&(r=0);let l=i._getTaskWorkingDateEnd({dateStart:o},n);const d=l.getTime()+60*(l.getTimezoneOffset()-o.getTimezoneOffset())*1e3,c=i._getTimelineTaskCellByDate(new Date(d));if(!c)return;const m=i._getTimelineTaskOffset(c,new Date(d));return i.rightToLeft?"left"===t?m-(i.$.timelineContent.offsetWidth-e.offsetLeft-e.offsetWidth-c.left):i.$.timelineContent.offsetWidth-e.offsetLeft-c.left-m:"left"===t?e.offsetLeft+e.offsetWidth-c.left-m:c.left-e.offsetLeft+m}if("left"===t&&!i.rightToLeft||"right"===t&&i.rightToLeft){const t=e._cellObj.task.maxDateStart,i=e._cellObj.task.minDateStart;i&&(s=60*(i.getTimezoneOffset()-a.dateEnd.getTimezoneOffset())*1e3,n=Math.abs(i.getTime()-a.dateEnd.getTime())+s,o=o?Math.min(n,o):n),t&&(s=60*(t.getTimezoneOffset()-a.dateEnd.getTimezoneOffset())*1e3,n=Math.abs(t.getTime()-a.dateEnd.getTime())+s,r=r?Math.max(n,r):n)}else{const t=e._cellObj.task.maxDateEnd,i=e._cellObj.task.minDateEnd;i&&(s=60*(i.getTimezoneOffset()-a.dateStart.getTimezoneOffset())*1e3,n=Math.abs(i.getTime()-a.dateStart.getTime())+s,r=r?Math.max(n,r):n),t&&(s=60*(t.getTimezoneOffset()-a.dateStart.getTimezoneOffset())*1e3,n=Math.abs(t.getTime()-a.dateStart.getTime())+s,o=o?Math.min(n,o):n)}return o&&(r=Math.min(r,o)),{min:l(r,!0),max:l(o)}}_getMinDuration(e,t){const i=this,a=i._taskBarMinWidth;if(!a||!i._timelineCells||0===i._timelineCells.length)return;const n=e._cellObj.task;let s,r,o=1;r=i.rightToLeft?parseFloat(e.style.right)||i.$.timelineContent.offsetWidth-e.offsetLeft-e.offsetWidth:parseFloat(e.style.left)||e.offsetLeft,"left"===t?(s=n.dateEnd,r+=parseFloat(e.style.width)||e.offsetWidth,o=-1):s=n.dateStart;const l=r+o*a;let d;for(let e=0;e<i._timelineCells.length;e++){const t=i._timelineCells[e];if(l<t.left)break;d=t}const c=i._getDateFromCell(l,d);return c?Math.abs(s.getTime()-c.getTime()):void 0}_createDelimiter(e,t){const i=this,a=i._dragDetails,n=a.segment,s=e.slice(0,3),r=document.createElement("div");if(r.classList.add("jqx-task-bar-limiter",e),e.indexOf("date")>-1){if(!a[s]||!a[s].left)return;const[e,t]=n?[n.element,n.originalPosition.x]:[a.timelineTask,0],o=i.$.taskTimelineCellsContainer.children[i._getTaskDOMIndex(a.task)];s.indexOf("max")>-1?r.style.width=o.offsetWidth-a[s].left-t-e.offsetWidth+"px":r.style.width=a[s].left+t+"px"}else{if(!a[s].width)return;r.style["left"===t?"right":"left"]=a[s].width+"px"}return r}_doubleClickHandler(e){const t=this;let i=e.target;if(t.disabled||t.disableWindowEditor)return;t.shadowRoot&&i===t&&(i=e.composedPath()[0]);let a=i.closest?i.closest(".jqx-task-connection"):void 0;if(a)t._openPopupWindow(a);else if(a=i.closest(".jqx-timeline-task")||i.closest(".jqx-table tbody tr[row-id]"),a&&t.$.taskSplitter.contains(a))if(a.classList.contains("jqx-timeline-task"))t._openPopupWindow(a._cellObj.task);else{const e=t._getVCellById("task",a.getAttribute("row-id"));e&&t._openPopupWindow(e.task)}}_checkDoubleClick(e){const t=this;let i=e.target;if(t.shadowRoot&&i===t&&(i=e.composedPath()[0]),void 0===t._dblClickDetails&&(t._dblClickDetails={clicks:0}),clearTimeout(t._dblClickDetails.timeOut),i!==t._dblClickDetails.target&&(t._dblClickDetails.clicks=0),t._dblClickDetails.target=i,t._dblClickDetails.clicks++,t._dblClickDetails.timeOut=setTimeout((function(){t._dblClickDetails&&(t._dblClickDetails.clicks=0)}),250),2===t._dblClickDetails.clicks)return t._doubleClickHandler(e),t._dblClickDetails.clicks=0,!0}_downHandler(e){const t=this,i=e.originalEvent,a=t.shadowRoot||t.isInShadowDOM?i.composedPath()[0]:i.target,n=a.closest?a.closest(".jqx-timeline-row")||a.closest(".jqx-timeline-task"):null;if(e.stopPropagation(),delete t._itemClickDetails,t._dragDetails)return delete t._dragDetails,void t._setConnectionFeedback();const s=t.$.taskSplitter.contains(a)?"task":"resource";if((a.closest(".jqx-timeline-content")||a.closest(`.jqx-${s}-table`))&&requestAnimationFrame((()=>t.$[`${s}Table`].focus({preventScroll:!0}))),t._itemClickDetails={target:a},!t._isMobile&&0!==e.button)return;if(!n){if(a.classList.contains("jqx-popup-window-modal")){if(t._popupWindow){const e=Object.keys(t._popupWindow);requestAnimationFrame((()=>t._popupWindow[e[e.length-1]].focus()))}return}return void((a.closest(".jqx-table tbody tr[row-id]")&&!a.classList.contains("jqx-arrow")||a.closest(".jqx-task-connection"))&&t._checkDoubleClick(i))}if(a.closest(".jqx-resource-timeline-view-cell")||t.disabled)return;const r=Array.from(t.$.timelineTasksContainer.children).find((e=>e._cellObj.task===n._cellObj.task));if(!r)return;const o=r._cellObj.task;if(!o)return;const l=t.$.timeline.getAttribute("task-bar-hovered");if(r.getElementsByClassName("jqx-timeline-task-fill")[0]||l){if((a.closest(".jqx-timeline-task-fill")||r.classList.contains("milestone")&&a.closest(".jqx-task-container"))&&t._checkDoubleClick(i))return;const n=a.closest(".jqx-timeline-task-progress-thumb"),s=e.pageX-window.pageXOffset,d=e.pageY-window.pageYOffset,c=t._dragDetails={},m=t.rightToLeft;let u,h=a.closest(".jqx-task-segment");if(l&&!h){const e=r.querySelectorAll(".jqx-task-segment");c.segments=e,h="left"===l&&!m||"right"===l&&m?e[0]:e[e.length-1]}if(c.target=(n||a).className,c.timelineTask=r,c.task=r._cellObj.task,c.taskDimensions={width:r.offsetWidth,height:r.offsetHeight,left:r.offsetLeft,top:r.offsetTop},c.coordinates={x:s,y:d},!e.ctrlKey&&h&&o.segments&&o.segments.length>1&&!t.disableSegmentDrag){const e=h.getBoundingClientRect(),t=h._segmentObj,i=c.task.segments,a=i.indexOf(t);c.segment={element:h,dimensions:{width:e.width,left:h.offsetLeft},offset:{x:s-e.left},originalSize:{width:e.width},isFirstSegment:0===a,isLastSegment:a===i.length-1,min:{},max:{}},u=c.segment.dimensions}const g=c.taskDimensions;t.rightToLeft?(g.right=t.$.timelineContent.offsetWidth-(g.left+g.width),c.originalPosition={x:g.right,y:g.top},c.segment&&(u.right=g.width-(u.left+u.width),c.segment.originalPosition={x:u.right})):(c.originalPosition={x:g.left,y:g.top},c.segment&&(c.segment.originalPosition={x:u.left}));const f=(n||r).getBoundingClientRect();if(c.offset={x:s-f.left,y:d-f.top},c.originalSize={width:g.width,height:g.height},n||!n&&"project"===o.type&&o.synchronized&&!o.dragProject)return void(a.closest(".jqx-task-connection-point")&&(c.timelineTask=void 0,c.relatedConnections={}));("visible"===t.resizeHandlesVisibility||t._isMobile&&"auto"===t.resizeHandlesVisibility)&&(a.closest(".jqx-timeline-task-fill")?t._checkTaskBarResizability(e):t.$.timeline.removeAttribute("task-bar-hovered")),c.min={},c.max={},t._setDragLimits(a)}}_documentMoveHandler(e){const t=this;if(!t._dragDetails||!t._dragDetails.target){let i=e.originalEvent.target;t.shadowRoot&&i===t&&(i=e.originalEvent.composedPath()[0]);const a=i.closest&&i.closest(".jqx-table tbody tr[row-id]");return a&&a.data?t._handleTableItemHover(a.data.itemId,i):t._handleTimelineHover(e),t._checkTaskBarResizability(e),void t._toggleTooltip(e.originalEvent)}if(t._dragDetails.target.includes("jqx-task-connection-point"))return t._setConnectionFeedback(e),t._handleTimelineHover(e),void t._autoScroll(e);if(t._dragDetails.target.includes("jqx-timeline-task-progress-thumb"))t._handleTaskProgressChange(e);else if(t._autoScroll(e),!t._autoScrolling)if(t.$.timeline.hasAttribute("task-bar-hovered"))t._handleTaskBarResize(e);else if(t._dragDetails.target.includes("jqx-timeline-task-fill")){const i=t._dragDetails.task;if(!i||i.disableDrag||"project"===i.type&&i.synchronized&&!i.dragProject)return;t._handleTaskBarDrag(e)}}_documentUpHandler(e){const t=this,i=e.originalEvent;let a=i.target;if(t._upHandler(),!t._dragDetails)return void t._handleItemClick(i);if(t._scrollView.disableSwipeScroll=t._touchmoveInside=!1,t.shadowRoot&&a===t&&(a=i.composedPath()[0]),t.hasAttribute("connecting-task")){const i=t._connectTask(e),a=t._tasks;if(t._setConnectionFeedback(),i){const e=i.taskStart,n=i.taskEnd,[s,r,o]=[a.indexOf(i.taskStart),a.indexOf(i.taskEnd),i.type];t.$.fireEvent("connectionEnd",{id:`${s}-${r}-${o}`,startIndex:s,startTaskId:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,endIndex:r,endTaskId:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,type:o}),t._autoSchedule(i.taskStart)}return t._isMobile&&t._handleTimelineHover(e,!0),void delete t._dragDetails}const n=t._dragDetails.task;if(!n)return void delete t._dragDetails;let s;const r=t._dragDetails.segment?t._dragDetails.segment.element:void 0;if(s||(s=Array.from(t.$.timelineTasksContainer.children).find((e=>e._cellObj.task===n))),t.hasAttribute("dragged")){t._snapToNearest(s,r),r||t._checkWorkingDays(s,r),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),t._autoSchedule(n),t._resourceTreeRefreshTimeout?(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n)):(t.snapToNearest||t.nonworkingDays.length>0||t.nonworkingHours.length>0)&&t._refreshAssignedResources(n),t.removeAttribute("dragged");const e={id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:new Date(n.dateStart),dateEnd:new Date(n.dateEnd)};r&&(e.segment=t._cloneObject(r._segmentObj)),t.$.fireEvent("dragEnd",e)}else if(t.hasAttribute("progress-change"))t._resourceTreeRefreshTimeout&&(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n,["progress"])),t.removeAttribute("progress-change"),t.$.fireEvent("progressChangeEnd",{id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),progress:n.progress||0});else if(t.hasAttribute("resized")){t._snapToNearest(s,r),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),t._resourceTreeRefreshTimeout?(clearTimeout(t._resourceTreeRefreshTimeout),delete t._resourceTreeRefreshTimeout,t._refreshAssignedResources(n,["workload"])):t.snapToNearest&&t._refreshAssignedResources(n,["workload"]),t.removeAttribute("resized");const e={id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:n.dateStart,dateEnd:n.dateEnd};r&&(e.segment=t._cloneObject(r._segmentObj)),t.$.fireEvent("resizeEnd",e),t._autoSchedule(n)}else a.closest(".jqx-timeline-task")===s&&(t._select("task",n.$.id,!0),delete t._dragDetails,t._handleItemClick(i));const o=t.$.timelineContent.querySelectorAll(".jqx-task-bar-limiter");for(let e=0,t=o.length;e<t;e+=1)o[e].remove();delete t._dragDetails}_handleItemClick(e){const t=this,i=e.target;if(t._dragDetails||!t._itemClickDetails||t._itemClickDetails.target!==i)return void delete t._itemClickDetails;let a,n,s;if(i.closest(".jqx-timeline-task-fill"))n=i.closest(".jqx-timeline-task")._cellObj.task,s="task";else if(a=i.closest(".jqx-task-connection"),a)n=a.getAttribute("connection-id").split("-"),n={source:n[0],target:n[1],type:n[2]},s="connection";else if(i.closest(".milestone"))n=i.closest(".milestone")._cellObj.task,s="milestone";else if(a=i.closest(".jqx-table tbody tr"),a){const e=t._getVCellById(s,a.getAttribute("row-id"));s=t.$.taskTable.contains(a)?"task":"resource",n=e?e[s]:void 0}if(!n)return;const r={originalEvent:e,type:s,item:t._cloneObject(n)};r.id="connection"===s?`${n.source}-${n.target}-${n.type}`:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,delete t._itemClickDetails,t.$.fireEvent("itemClick",r)}_moveHandler(e){const t=this;t._isMobile||e.stopPropagation(),(t.hasAttribute("dragged")||t.hasAttribute("progress-change"))&&"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_handleTableItemHover(e,t){const i=this,a=i._hoveredItem;let n,s;if(t&&([n,s]=i.$.taskSplitter.contains(t)?[i.$.taskTable,"task"]:[i.$.resourceTable,"resource"]),a&&"itemType"===a.type&&a.id===e)return;const r=i.$.mainSplitter.querySelectorAll("table tbody tr[hover]");for(let e=0;e<r.length;e++)r[e].removeAttribute("hover");if(void 0===e)return void i._handleTimelineHover({target:i});if(!n)return;i._setTableHoverState(n,e);const o=i.$["task"===s?"taskTimelineCellsContainer":"resourceTimelineCellsContainer"].children;for(let t=0,a=o.length;t<a;t+=1){const a=o[t];if(a._cellObj[s].$.id===e){i._handleTimelineHover({target:a});break}}}_setTableHoverState(e,t){const i=this;e||(e=i.$.taskTable);const a=e===i.$.taskTable?"task":"resource",n=e.querySelectorAll("table tbody tr");if(!i._isMobile&&i[a+"Columns"].length)for(let e=0;e<n.length;e++){let i=n[e];const a=i.data;a&&a.itemId===t&&i.setAttribute("hover","")}}_checkWorkingDays(e){const t=this,i=t._dragDetails;if(!(i&&i._taskDuration||t._timelineCells.length))return;if(!e.classList||!e.classList.contains("jqx-timeline-task")||!t.hasAttribute("dragged")||0===t.nonworkingDays.length&&0===t.nonworkingHours.length||!i||!i._taskDuration)return;const a=e._cellObj,n=a.task,s=t._getTaskWorkingDateEnd(n),r=n.segments;let o=new Date(t._timelineCells[t._timelineCells.length-1].date);if("year"===t.view||"quarter"===t.view?(o.setMonth(o.getMonth()+1),o.setDate(0),o.setHours(23,59,59,999)):"month"===t.view?(o.setDate(o.getDate()+6-o.getDay()),o.setHours(23,59,59,999)):"week"===t.view?o.setHours(23,59,59,999):o.setHours(o.getHours(),59,59,999),s&&(n.dateEnd=n.maxDateEnd?new Date(Math.min(s.getTime(),n.maxDateEnd.getTime())):s),n.dateEnd=new Date(Math.min(o.getTime(),n.dateEnd.getTime())),n.duration=t._convertDuration(t.nonworkingDays.length>0||t.nonworkingHours.length>0?t._getWorkingTime(n.dateStart,n.dateEnd):n.dateEnd.getTime()-n.dateStart.getTime(),!0),r&&r.length>1){for(let e=0,i=r.length;e<i;e+=1)t._snapToNearestDates(r[e],!0);t._validateTaskSegments(n),n.segments.length!==r.length&&t._recycleSegments(n,e),t._setTaskBarSegments(a,e,!0),t._setTaskBarProgress(n)}t._setTimelineTaskBar(a,void 0,!0),t._refreshTaskConnections(a.task),t._refreshTableColumnsData(n,["dateEnd","duration","overdue"])}_getTaskWorkingDateEnd(e,t){const i=this;if(!e||!e.dateStart)return;let a,n,s=new Date(e.dateStart);if(t||(t=i._dragDetails?i._dragDetails._taskDuration:i._getWorkingTime(e.dateStart,e.dateEnd)),!i.adjustToNonworkingTime)return new Date(e.dateStart.getTime()+t);const r=t<0?-1:1,o=i.nonworkingDays,l=i.nonworkingHours;for(t=Math.abs(t);t>0;){const e=Math.min(t,36e5-(60*s.getMinutes()*1e3+1e3*s.getSeconds()+s.getMilliseconds()));if(o.indexOf(s.getDay())>-1)n=new Date(s),n.setHours(0,0,0,0),n.setDate(s.getDate()+1*r),a=Math.min(e,n.getTime()-s.getTime()),s=new Date(s.getTime()+a);else if(l.indexOf(s.getHours())>-1){n=new Date(s);const t=n.getTime();n.setHours(s.getHours()+1*r,0,0,0),t===n.getTime()&&n.setHours(s.getHours()+2*r,0,0,0),a=Math.min(e,n.getTime()-s.getTime()),s=new Date(s.getTime()+a)}else t-=e,s=new Date(s.getTime()+r*e)}return s}_createConnectingElement(e,t,i,a,n){const s=this;if(!s._connectionDetails||!s._connectionDetails.start)return;const r=s._connectionDetails,o=r.type,l=s.$.timelineConnectionsContainer;let d=r.connections.shift();d||(d=document.createElement("div"),d.classList.add("jqx-task-connection")),d.style.width=d.style.width="","horizontal"===a?(d.style.width=Math.abs(i)+"px",d.style.height=""):(d.style.width="",d.style.height=Math.abs(i)+"px"),d.style[s.rightToLeft?"left":"right"]="",d.style[s.rightToLeft?"right":"left"]=e+"px",d.style.top=t+"px",d.setAttribute("connection-id",r.id);const c=r.start.task.label,m=0===o||3===o?"start":"end",u=r.end.task.label,h=0===o||1===o?"start":"end";if(d.setAttribute("aria-label","Connection between "+c+" ("+m+") and "+u+" ("+h+")"),n){let e=0===o||1===o?"right":"left";s.rightToLeft&&(e="left"===e?"right":"left"),d.setAttribute("arrow-direction",e)}else d.removeAttribute("arrow-direction");d.parentElement||l.appendChild(d)}_getConnectionType(e,t){if(!e||!t)return;let i,a;return"string"==typeof e?i=!e.includes("end"):e instanceof HTMLElement&&(i=!e.classList.contains("end")),"string"==typeof t?a=t.includes("end"):t instanceof HTMLElement&&(a=t.classList.contains("end")),i&&!a?0:i||a?!i&&a?2:i&&a?3:void 0:1}_setConnectionFeedback(e){const t=this,i=t._dragDetails;if(!i||!i.target||!e){const e=t._connectionFeedback;return e&&e.parentElement&&e.remove(),t.removeAttribute("connecting-task"),void delete t._connectionFeedback}if(!i.target||!i.target.includes("jqx-task-connection-point"))return;const a=i.task,n=i.taskDimensions;if(!a)return;if(!t.hasAttribute("connecting-task")){if(t.$.fireEvent("connectionStart",{startIndex:t._tasks.indexOf(a)}).defaultPrevented)return void delete t._dragDetails.target;t.setAttribute("connecting-task",""),t._isMobile&&(t._scrollView.disableSwipeScroll=t._touchmoveInside=!0)}const s="milestone"===a.type,r=t.rightToLeft;let o=s?-1*n.height/2:0;t._dragDetails.target.includes("end")&&(o=s?-1*o:n.width),t._connectionFeedback||(t._connectionFeedback=document.createElement("div"),t._connectionFeedback.classList.add("jqx-task-connection-feedback"));const l=t._dragDetails.coordinates.x+(r?-1:1)*o,d=t._dragDetails.coordinates.y,c=t._dragDetails.offset.x-(r?n.width:0),m=t._dragDetails.offset.y,u=e.pageX-window.pageXOffset+c,h=e.pageY-window.pageYOffset+m-n.height/2;r?(t._connectionFeedback.style.left="",t._connectionFeedback.style.right=n.right+o+"px"):(t._connectionFeedback.style.left=n.left+o+"px",t._connectionFeedback.style.right=""),t._connectionFeedback.style.top=n.top+n.height/2+"px",t._connectionFeedback.style.width=Math.sqrt(Math.pow(Math.abs(u-l),2)+Math.pow(Math.abs(h-d),2))+"px",t._connectionFeedback.style.transform=t.rightToLeft?"rotate("+180*(Math.atan2(d-h,l-u)||0)/Math.PI+"deg)":"rotate("+180*(Math.atan2(h-d,u-l)||0)/Math.PI+"deg)",t._connectionFeedback.parentElement||t.$.timelineContent.appendChild(t._connectionFeedback)}_connectTask(e){const t=this,i=t._tasks;let a,n,s,r,o,l,d,c,m;if(e.originalEvent){const r=e.originalEvent;let o=t._isMobile?document.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset):r.target;if(!(t._dragDetails&&t._dragDetails.target&&o&&o.classList))return;if(t.shadowRoot&&o===t&&(o=t._isMobile?t.shadowRoot.elementFromPoint(r.pageX-window.pageXOffset,r.pageY-window.pageYOffset):r.composedPath()[0]),a=t._dragDetails.target.includes("jqx-task-connection-point")?t._dragDetails.target:void 0,n=o.classList.contains("jqx-task-connection-point")?o:void 0,a&&(l=t._dragDetails.task),n)s=n.closest(".jqx-timeline-task");else if(t._isMobile&&o.classList.contains("jqx-timeline-task-fill")&&(s=o.closest(".jqx-timeline-task"),s)){const e=r.pageX-window.pageXOffset-s.getBoundingClientRect().left;n=s.querySelector(".jqx-task-connection-point."+(e>=s.offsetWidth/2?"end":"start"))}if(!l||!s)return;d=s._cellObj.task;for(let e=0,t=i.length;e<t;e+=1){const t=i[e];if(t!==l)if(t!==d){if(void 0!==c&&void 0!==m)break}else m=e;else c=e}}else{if(!e||e.length<3)return;const a=t._getValidConnectionId(e[0],e[1],e[2],"_connectTask");if(void 0===a)return;[c,m]=[parseInt(a[0]),parseInt(a[1])],[l,d]=[i[c],i[m]],r=parseInt(e[2]),o=e[4]||0}if(!l||!d||l===d||l.isGroup||d.isGroup||t._isAutoScheduled(l,d)||t.hasAttribute("dragged")||t.hasAttribute("resized"))return;void 0===r&&(r=t._getConnectionType(a,n));let u=t._connections;return u||(t._connections=u=[]),t._updateConnection([c,m,r,o])?(e.originalEvent&&t._recycleConnections([{startIndex:c,endIndex:m,type:r}]),e.originalEvent&&t.$.fireEvent("itemInsert",{type:"connection",item:{source:c,target:m,type:r}}),{taskStart:l,taskEnd:d,type:r}):void 0}_recycleConnections(e){const t=this,i=t._tasks;if(e?Array.isArray(e)||(e=[e]):e=t._connections,!i||!i.length||!e)return;const a=t.$.timelineTasksContainer.children,n=t.$.timelineConnectionsContainer;let s,r=[];if(a.length){const n=a[0],o=(()=>{let e=[];for(let t=0,n=a.length;t<n;t+=1)e.push(i.indexOf(a[t]._cellObj.task));return e})(),l=n.querySelector(".jqx-task-connection-point."+(t.rightToLeft?"end":"start")),d=t._baselineProportion,c=t.showBaseline?t._taskDefaultHeight/d:0;s={top:l.offsetTop,width:l.offsetWidth},s.offset=Math.abs(l.offsetLeft)-s.width;for(let a=0,n=e.length;a<n;a+=1){const n=e[a],l=n.startIndex,d=n.endIndex;if(o.indexOf(l)<0&&o.indexOf(d)<0)continue;const m=i[l],u=i[d],{vCellStart:h,vCellEnd:g}=t._getTasksVCell(m,u);if(!h||!g)continue;const f=n.type,p={start:{width:s.width,top:s.top,index:l,task:m},end:{width:s.width,top:s.top,index:d,task:u},type:f},_=t._getTaskBarDetails(h,t._getTimelineCellByDate(m.dateStart),t._getTimelineCellByDate(m.dateEnd)),T=t._getTaskBarDetails(g,t._getTimelineCellByDate(u.dateStart),t._getTimelineCellByDate(u.dateEnd));"milestone"===m.type&&(_.width=h.height-c),"milestone"===u.type&&(T.width=h.height-c),p.start.left=0===f||3===f?-1*(s.width+s.offset):_.width+s.offset,p.end.left=0===f||1===f?-1*(s.width+s.offset):T.width+s.offset,t._connectionDetails=p,_.height=T.height=h.height-c,_.type=m.type,T.type=u.type,t._setConnectionDetails(_,T),t._createTaskConnection(),r.push(t._connectionDetails.id),delete t._connectionDetails}}if(arguments.length)return;const o=Array.from(n.children);for(let e=0,t=o.length;e<t;e+=1){const t=o[e];r.indexOf(t.getAttribute("connection-id"))<0&&t.remove()}}_getTasksVCell(e,t){const i=this._timelineVCells;let a,n;for(let s=0,r=i.length;s<r;s+=1){const r=i[s];if(r.task===e&&(a=r),r.task===t&&(n=r),a&&n)break}return{vCellStart:a,vCellEnd:n}}_isAutoScheduled(e,t,i){const a=this,n=a._tasks;let s={};if(a.autoSchedule)return e instanceof HTMLElement&&(e=e._cellObj.task),t instanceof HTMLElement&&(t=t._cellObj.task),function e(t,r){const o=a._getTaskConnections().taskConnections,l=n.indexOf(t);s[l]=!0;for(let t=0;t<o.length;t++){const d=o[t],c=d.endIndex;if(c===r)return i&&a._removeConnection(l+"-"+c+"-"+d.type,!0),!0;if(!s[c]&&e(n[c],r))return!0}}(t,n.indexOf(e))}_setConnectionDetails(e,t){const i=this;if(!i._connectionDetails)return;const a=i._connectionDetails,n=a.start,s=a.end,r=a.type;if(!n||!s)return;let o,l=e.width,d=t.width,c=e.left,m=t.left,u=e.top,h=t.top,g=n.left,f=s.left;const p=n.index,_=s.index;if("milestone"===e.type&&(l=e.height,c-=l/2),"milestone"===t.type&&(d=t.height,m-=d/2),a.id=p+"-"+_+"-"+r,!a.connectionStartOffset||!a.connectionEndOffset){switch(r){case 0:g=Math.abs(g)-n.width,f=Math.abs(f)-s.width;break;case 1:g-=l,f=Math.abs(f)-s.width;break;case 2:g-=l,f-=d;break;default:g=Math.abs(g)-n.width,f-=d}a.start.offset=g+=n.width/2,a.end.offset=f+=s.width/2}if(0===r&&c>m||1===r&&c+l+g>m-f&&h>u||2===r&&m+d>c+l||3===r&&(c-g<m+d+f&&h>u||c-g>m+d+f&&u>h)){o=!0;let i=e;e=t,t=i,i=g,g=f,f=i,i=l,l=d,d=i,i=c,c=m,m=i,i=u,u=h,h=i}let T=c,b=m;!o&&1===r||o&&3===r?T+=l:!o&&3===r||o&&1===r?b+=d:2===r&&(T+=l,b+=d);let k=i.$.timelineConnectionsContainer.querySelectorAll('.jqx-task-connection[connection-id^="'+p+"-"+_+'-"]');0===k.length&&(k=i.$.timelineConnectionsContainer.querySelectorAll('.jqx-task-connection[connection-id^="'+_+"-"+p+'"]')),a.connections=[].slice.call(k),a.start.x=T,a.start.y=u+n.top,a.end.x=b,a.end.y=h+s.top,a.type=r,a.inverted=o}_createTaskConnection(){const e=this,t=e._connectionDetails;if(!t)return;const i=2*e._taskConnectionWidth,a=t.start.x,n=t.start.y,s=t.start.offset,r=t.start.top,o=t.end.x,l=t.end.y,d=t.end.offset,c=t.type,m=t.inverted,u=!m&&3===c||m&&1===c,h=!m&&1===c||m&&3===c;let g,f,p,_=a,T=o;u?(_=a-d,T=o+d):h&&(_=a+s,T=o-d);const b=_<=T&&u,k=_>=T&&h,y=2===c||h;!function d(u){g!==o&&(u?"horizontal"===u?(p=g-o+(b?-1:1)*s,g=_>T?g-Math.abs(p):g,e._createConnectingElement(g,f,(_===T?0:Math.abs(p))+(y?i:0),"horizontal"),g=_<T?g-p:g,d("vertical")):(p=Math.abs(f-l),f+=n<l?0:-1*p,g-=m&&1===c||!m&&3===c&&n>l?i:0,e._createConnectingElement(g,f,p,"vertical"),d()):(g?(p=Math.abs(g-o),g>=o&&(g+=-1*p,p+=i),e._createConnectingElement(g,f+(n<l?Math.abs(f-l):0),p,"horizontal",!t.inverted),g=o):(g=a,f=n,(0===c||!m&&3===c||m&&1===c)&&(g-=s),e._createConnectingElement(g,f,s,"horizontal",t.inverted),y&&(g+=s-i),b||k?(e._createConnectingElement(g,f-=n>l?r:0,r,"vertical"),f+=n<l?r:0):d("vertical")),d("horizontal")))}(),t.connections.map((e=>e.parentElement.removeChild(e)))}_getTaskIndexById(e,t){const i=this;if(t||(t=i._tasks),"number"==typeof e)return isNaN(parseInt(e))?-1:parseInt(e);if("object"==typeof e)return i._getItemIndex(e,"task");for(let i=0,a=t.length;i<a;i+=1)if(t[i].id===e)return i;return-1}_refreshTaskConnections(e){const t=this,i=e instanceof HTMLElement?e._cellObj.task:e,a=t._tasks.indexOf(i);if(void 0===a||e.classList&&e.classList.contains("jqx-visibility-hidden"))return;let n;if(t._dragDetails&&(n=t._dragDetails.relatedConnections[a]),!n){n=[];const e=t._connections;if(!e||!e.length)return;for(let t=0,i=e.length;t<i;t+=1){const i=e[t];i.startIndex!==a&&i.endIndex!==a||n.push(i)}t._dragDetails&&(t._dragDetails.relatedConnections[a]=n)}t._recycleConnections(n)}_dragStartHandler(e){const t=this,i=e.target.closest;(t._dragDetails||i&&i.call(t,"jqx-gantt-chart")===t)&&e.preventDefault()}_getFirstCellObjInView(e){const t=this;if(e||(e=t._timelineCells),!e)return;const i=Math.abs(t.scrollLeft);let a,n;for(let t=0;t<e.length;t++){const s=e[t];if(s.left+s.width>i){a=s;break}n=s}return!a&&n&&(a=i>n.left?n:e[0]),a}_getFirstContentCellInView(e="task"){const t=this;let i,a,n,s;if("task"===e?(i=t._timelineVCells,a=t.scrollTop):(i=t._timelineResourceVCells,a=t.$.resourceVerticalScrollBar.value),!i)return 0;for(let e=0;e<i.length;e++){const t=i[e];if(t.top+t.height>a){n=t;break}s=t}return!n&&s&&(n=a>s.left?s:i[0]),n}_getProjectTasks(e,t){const i=this,a=i.groupByResources&&e.isGroup?"group":"project",n=i._tasks;if(!e||"project"!==e.type)return[];let s=[];for(let r=0,o=n.length;r<o;r+=1){const o=n[r];o.$[a]===e&&(s.push(o),"project"!==o.type||t||(s=s.concat(i._getProjectTasks(o,t))))}return s}_getSubTaskLimits(e){const t=this;if(!e)return;const i=e._cellObj.task,a=t._getProjectTasks(i);let n,s;if(!a.length)return;let r=a[0],o=a[0];for(let e=0;e<a.length;e++){const t=a[e];a[e].dateEnd&&a[e].dateStart&&(r.dateStart||(r=t[e]),o.dateEnd||(o=t[e]),a[e].dateEnd.getTime()>o.dateEnd.getTime()&&(o=a[e]),a[e].dateStart.getTime()<r.dateStart.getTime()&&(r=a[e]))}const l=t.$.timelineContent.offsetWidth;let d,c,m;if(r&&(d=t._getTimelineSubTaskOffset(r),d&&(c=d.left,m=d.width,n=Math.max(0,t.rightToLeft?l-e.offsetLeft-e.offsetWidth-(l-c-m):e.offsetLeft-c))),o&&(d=t._getTimelineSubTaskOffset(o),d))if(c=d.left,m=d.width,t.rightToLeft){const t=l-e.offsetLeft-e.offsetWidth;s=Math.max(t,t+l-(l-c))}else s=Math.max(e.offsetLeft,e.offsetLeft+l-(c+m));return{min:n,max:s}}_getTimelineSubTaskOffset(e){const t=this,i=t.$.timelineTasksContainer.children[t._tasks.filter((e=>!e.hidden)).indexOf(e)];let a,n,s;if(i)a=i.offsetLeft,s=i.offsetWidth;else{const i=t._getTimelineTaskCellByDate(e.dateStart),r=t._getTimelineTaskCellByDate(e.dateEnd);i&&(a=i.left+t._getTimelineTaskOffset(i,e.dateStart)||0),r&&(n=r.left+t._getTimelineTaskOffset(r,e.dateEnd)||0),s=n-a}return{left:a,width:s}}_getTaskDragLimits(e){const t=this,i=t._dragDetails,a=i.segment?i.segment.element:void 0,n=a&&a.previousElementSibling?{}:t._getTaskBarPositionLimits(e._cellObj.task,"DateStart"),s=a&&a.nextElementSibling?{}:t._getTaskBarPositionLimits(e._cellObj.task,"DateEnd"),r=t._dragDetails.taskDimensions;let o={};return(n.min||s.min)&&(o.min=Math.max(n.min||0,Math.max(0,(s.min||0)-r.width))),s.max&&(o.max=Math.max(0,s.max-r.width)),n.max&&(o.max=o.max?Math.min(n.max,o.max):n.max),o}_getTaskBarDateRange(e){if(!e)return;const t=this,i=e.classList.contains("milestone"),a=parseFloat(e.style.width)||e.offsetWidth,n=i?a/2:a,s=t.rightToLeft?parseFloat(e.style.right)||t.$.timelineContent.offsetWidth-e.offsetLeft-n:parseFloat(e.style.left)||e.offsetLeft,r=e._cellStart,o=e._cellEnd,l=e._cellObj.task,d=l.minDateStart,c=l.maxDateEnd;let m,u;return m=t._getDateFromCell(s,r),!d||"project"===e._cellObj.task.type&&e._cellObj.task.synchronized||(m=new Date(Math.max(d.getTime(),m.getTime()))),u=i?new Date(m):t._getDateFromCell(s+n,o),!c||"project"===e._cellObj.task.type&&e._cellObj.task.synchronized||(u=new Date(Math.min(c.getTime(),u.getTime()))),{dateStart:m,dateEnd:u}}_getTaskBarDetails(e,t,i){const a=this,n=e.task;if(!e)return;let s=new Date(n.dateStart);const r=new Date(n.dateEnd);if(!a._dragDetails&&a.snapToNearest){let s,r,o=n.dateStart,l=n.dateEnd;const d=new Date(t.date),c=a._getDateFromCell(t.left+t.width,t),m=new Date(i.date),u=a._getDateFromCell(i.left+i.width,i);return s=c.getTime()-o.getTime()>=c.getTime()-d.getTime()?t.left:t.left+t.width,"milestone"!==n.type&&(r=u.getTime()-l.getTime()>=l.getTime()-m.getTime()?i.left-s:i.left-s+i.width),{left:s,width:r,top:e.top}}let o,l,d,c,m,u;switch(a.view){case"quarter":case"year":{d=new Date(s.getFullYear(),s.getMonth()+1,0).getDate(),c=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();const e=s.getHours()/24+s.getMinutes()/1440+s.getSeconds()/86400,a=r.getHours()/24+r.getMinutes()/1440+r.getSeconds()/86400;o=t.left+(s.getDate()-1+e)/d*t.width,l=i.left+(r.getDate()-1+a)/c*i.width-o;break}case"month":"day"===a.monthScale?(m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*t.width,u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*t.width,o=t.left+m,l=i.left+(u-m)-t.left):(m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*(t.width/7),u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*(t.width/7),o=t.left+s.getDay()/7*t.width+m,l=i.left+r.getDay()/7*i.width-o+u);break;case"week":m=parseFloat(s.getHours()+"."+s.getMinutes()+s.getSeconds())/24*t.width,u=parseFloat(r.getHours()+"."+r.getMinutes()+r.getSeconds())/24*t.width,o=t.left+m,l=i.left+(u-m)-t.left;break;case"day":m=parseFloat(s.getMinutes()+s.getSeconds()/60)/60*t.width,u=parseFloat(r.getMinutes()+r.getSeconds()/60)/60*t.width,o=t.left+m,l=i.left+(u-m)-t.left}return{width:"milestone"===n.type?"":l,left:o,top:e.top}}_snapToNearestDates(e,t){const i=this;if(!i.snapToNearest)return;if(e.classList&&e._cellObj&&(e=e._cellObj.task),!e)return;let a=e.dateStart,n=e.dateEnd;const{cellStart:s,cellEnd:r}={cellStart:i._getTimelineCellByDate(a),cellEnd:i._getTimelineCellByDate(n)},o=new Date(s.date),l=i._getDateFromCell(s.left+s.width,s),d=new Date(r.date),c=i._getDateFromCell(r.left+r.width,r);if(a=l.getTime()-a.getTime()>=l.getTime()-o.getTime()?o:l,"milestone"!==e.type&&(n=c.getTime()-n.getTime()>=c.getTime()-d.getTime()?d:c),e.dateEnd=n,n.getTime()<a.getTime()&&(a=new Date(n)),e.dateStart=a,e.duration=e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0),!t&&e.segments&&e.segments.length>1){const t=e.segments;for(let e=0,a=t.length;e<a;e+=1)i._snapToNearestDates(t[e],!0);i._validateTaskSegments(e)}}_getTimelineTaskCellByDate(e){if(!e)return;let t=this,i=t.view,a=t._timelineCells;"month"===i&&"day"===t.monthScale&&(i="day");for(let n=0;n<a.length;n++){const s=a[n];if(t._isDateInCell(s.date,e,i))return s}}_isDateInCell(e,t,i){const a=this;switch(i){case"quarter":case"year":if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth())return!0;break;case"month":{let i=new Date(e);if(i.setDate(i.getDate()+(6-i.getDay())+1),i.setMilliseconds(i.getMilliseconds()-1),t.getTime()>=e.getTime()&&t.getTime()<=i.getTime())return!0;break}case"week":if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())return!0;break;case"day":if("hour"!==a.dayScale){if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()&&e.getMinutes()===t.getMinutes())return!0}else if(e.getYear()===t.getYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours())return!0}}_handleInverted(e){const t=this;function i(e){e||(e="task");const i=t.$[`${e}Splitter`];if(!t.$.mainSplitter.contains(i))return;const[a,n,s,r,o]="task"===e?[t.$.tableSplitterItem,t.$.timelineSplitterItem,t,t.$.taskTimelineContainer,"scrollTop"]:[t.$.resourceTableItem,t.$.resourceTimelineSplitterItem,t.$.resourceVerticalScrollBar,t.$.resourceTimelineContent,"value"],l=t.treeSize!==a.size?a.style[i._measurements.dimension]:t.treeSize;a.size="",i.removeChild(n),t.inverted&&!t.rightToLeft||!t.inverted&&t.rightToLeft?i.insertBefore(n,a):i.appendChild(n),a.size=l,r.scrollTop=s[o]}(!e||t.inverted||t.rightToLeft)&&(i("task"),i("resource"))}_createResourceTimeline(){const e=this;if(e._handleResourcePanelVisibility(),e.$.taskSplitterItem._setSize("size",e.taskPanelSize),!e._resources||!e.$.mainSplitter.contains(e.$.resourceTable))return;const t=e.$.resourceSplitterItemHeader.innerHTML;(e.resourcePanelHeaderTemplate&&!t||!e.resourcePanelHeaderTemplate&&t)&&e._handleHeaderTemplate("resource"),e._setTable(e.$.resourceTable),e._recycleResourceHeaderCells(),e._createResourceTimelineContent(),e._synchronizeSplitters(e.$.taskSplitter,e.$.resourceSplitter),e.$.resourceTimelineContent.scrollLeft=e.$.resourceTimelineHeader.scrollLeft=e.$.timelineHeader.scrollLeft,e.$.resourceSplitter.refresh(),e._refresh(),e._highlightAssignedItem("task",e._getSelection("task",e.selectedTaskIds))}_createResourceTimelineContent(){const e=this,t=e._timelineVCells,i=t.length?t[0].height:e._taskDefaultHeight;e._createResourceTimelineVCells(i);const a=e._timelineResourceVCells.length*i;e.$.resourceTimelineCellsContainer.style.height=a+"px",e.$.container.style.setProperty("--jqx-gantt-chart-resource-timeline-content-height",a+"px"),e._recycleResourceContent()}_recycleResourceContent(){const e=this;if(!e.$.mainSplitter.contains(e.$.resourceSplitterItem))return;const t=e._timelineResourceVCells,i=e.$.resourceTimelineCellsContainer,a=e._getFirstContentCellInView("resource"),n=e.$.tooltip;if(n&&i.contains(n.selector)&&e._closeTooltip(),!a)return void(i.innerHTML="");const s=t.indexOf(a),r=a.height,o=1-(a.top+r-Math.abs(e.$.resourceVerticalScrollBar.value))/r,l=t?t.length:0,d=!e.$.resourceSplitter.offsetHeight,c=e.$.resourceTimelineContent.offsetHeight,m=!d&&c?Math.min(l,Math.ceil((parseFloat((c/r).toFixed(2))+o).toFixed(2))):l,u=i.children,h=e.$.timelineViewCells.children,g=document.createDocumentFragment();for(;i.childElementCount>m;)i.lastElementChild.remove();for(let t=0;t<m;t+=1){let i=u[t];i||(i=document.createElement("div"),i.classList.add("jqx-timeline-row"),g.appendChild(i)),e._createTimelineRowCells(i,h)}g.childElementCount&&i.appendChild(g);const f=i.children,p=e._getSelection("resource",e.selectedResourceIds);for(let i=0;i<m;i+=1){const a=t[s+i],n=f[i];if(!a){n&&n.remove();continue}const r=a.resource,o=r.$.id;p.indexOf(o)>-1?n.setAttribute("selected",""):n.removeAttribute("selected"),n._cellObj=a,n.setAttribute("row-id",o),n.style.top=a.top+"px",e._refreshResourceTimelineContent(r,n)}}_createResourceTimelineVCells(e){const t=this,i=t._resources,a=t.$.resourceTable.rows,n=t._timelineResourceVCells=[];let s=0;if(void 0===e){const i=t._timelineVCells;e=i.length?i[0].height:t._taskDefaultHeight}for(let t=0,r=a.length;t<r;t+=1){const r=i[a[t].data.itemIndex];r.hidden||(n.push({top:s,height:e,resource:r}),s=parseFloat((s+e).toFixed(2)))}}_handleResourcePanelVisibility(){const e=this,t=e.$.container,i=e._resources.filter((e=>!e.hidden)),a=e.$.mainSplitter,n=e.$.resourceSplitterItem,s=e.$.taskSplitterItem;if(!i||!i.length||e.hideResourcePanel)return n&&!n.size&&(n._size=n.style[a._measurements.dimension]),e._resourceScrollView&&(e._resourceScrollView.unlisten(),delete e._resourceScrollView),s.size="",s.min="",e.$.resourceTable&&e.$.resourceTable.clearSelection(),a.contains(n)&&(a.removeChild(n),e._refresh()),e._highlightAssignedItem("resource"),void t.removeAttribute("show-resource-panel");a.contains(n)||(s.min=e.taskPanelMin,e._createResourcePanel(),e._setupResourcePanel(),e._resourceScrollView=new JQX.Utilities.Scroll(e.$.resourceSplitterItem,e.$.horizontalScrollBar,e.$.resourceVerticalScrollBar)),t.setAttribute("show-resource-panel",""),e._synchronizeSplitters(e.$.taskSplitter,e.$.resourceSplitter)}_createResourcePanel(){const e=this,t=e.$.mainSplitter;let i=e.$.resourceSplitterItem;if(!i){i=document.createElement("jqx-splitter-item"),i.classList.add("jqx-resource-splitter-item"),i.innerHTML=`<div jqx-id="resourceSplitterItemHeader" class="jqx-resource-panel-header"></div>\n <jqx-splitter jqx-id="resourceSplitter" wait class="jqx-resource-splitter" auto-fit-mode="end">\n <jqx-splitter-item jqx-id="resourceTableItem" class="jqx-resource-table-item">\n <jqx-table wait jqx-id="resourceTable" class="jqx-resource-table" virtualization deferred-scroll-delay="0"></jqx-table>\n </jqx-splitter-item>\n <jqx-splitter-item jqx-id="resourceTimelineSplitterItem" class="jqx-timeline-splitter-item">\n <div class="jqx-timeline" jqx-id="resourceTimeline">\n <div class="jqx-timeline-container" role="presentation">\n <div class="jqx-timeline-header" jqx-id="resourceTimelineHeader" role="rowgroup">\n <div class="jqx-timeline-view-cells" jqx-id="resourceTimelineViewCells" role="row"></div>\n </div>\n <div jqx-id="resourceTimelineContent" class="jqx-timeline-content" role="rowgroup">\n <div jqx-id="resourceTimelineCellsContainer" class="jqx-timeline-cells-container" aria-hidden="true"></div>\n </div>\n </div>\n </div>\n <jqx-scroll-bar wait jqx-id="resourceVerticalScrollBar" class="jqx-timeline-scroll-bar jqx-resource-scroll-bar" \n orientation="vertical" aria-controls="[[${e.id||""}]]">\n </jqx-scroll-bar>\n </jqx-splitter-item>\n </jqx-splitter>`,t.contains(i)||t.appendChild(i);const a=JQX.Utilities,n=i.querySelectorAll(".jqx-resource-panel-header, .jqx-resource-splitter, .jqx-resource-table-item, \n .jqx-resource-table, .jqx-timeline-splitter-item, .jqx-timeline, .jqx-timeline-header, .jqx-timeline-view-cells, .jqx-timeline-content,\n .jqx-timeline-cells-container, .jqx-timeline-scroll-bar"),[s,r,o,l,d,c,m,u,h,g,f]=n;e.$.resourceSplitterItem=i,e.$resourceSplitterItem=a.Extend(i),e.$.resourceSplitterItemHeader=s,e.$resourceSplitterItemHeader=a.Extend(s),e.$.resourceSplitter=r,r.hasResizeObserver=!1,r.wait=!1,e.$resourceSplitter=a.Extend(r),e.$.resourceTableItem=o,e.$resourceTableItem=a.Extend(o),e.$.resourceTable=l,l.hasResizeObserver=!1,e.$resourceTable=a.Extend(l),e.$.resourceTimelineSplitterItem=d,e.$resourceTimelineSplitterItem=a.Extend(d),e.$.resourceTimelineViewCells=u,e.$resourceTimelineViewCells=a.Extend(u),e.$.resourceTimeline=c,e.$resourceTimeline=a.Extend(c),e.$.resourceTimelineContent=h,e.$resourceTimelineContent=a.Extend(h),e.$.resourceTimelineHeader=m,e.$resourceTimelineHeader=a.Extend(m),e.$.resourceTimelineCellsContainer=g,e.$resourceTimelineCellsContainer=a.Extend(g),e.$.resourceVerticalScrollBar=f,e.$resourceVerticalScrollBar=a.Extend(f)}}_setupResourcePanel(){const e=this,t=e.rightToLeft,i=e.$.resourceSplitterItem,a=e.$.resourceTableItem,n=e.$.resourceTable,s=e.$.resourceTimelineSplitterItem,r=e.$.resourceVerticalScrollBar;e.$.mainSplitter.contains(i)?([e.$.resourceSplitter,n,e.$.resourceVerticalScrollBar].forEach((e=>e.rightToLeft=t)),n.$.virtualizationContainer._scrollView.disableSwipeScroll=!0,n.$.virtualizationContainer.verticalScrollBarVisibility="hidden",n.$.virtualizationContainer.disabled=!0,a.size=e.treeSize,a.min=e.treeMin,s.min=e.timelineMin,i.min=e.resourcePanelMin,i.size=i._size||e.resourcePanelSize,r.hasStyleObserver=!1,r.hasResizeObserver=!1,r.wait=!1):e.$.mainSplitter.appendChild(i)}_refreshResourceTimeline(){const e=this;e._resources&&e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._recycleResourceHeaderCells(),e._recycleResourceContent())}_getResourceCellWorkTime(e,t){const i=e.dateStart,a=e.dateEnd,n=t.dateStart,s=t.dateEnd,r=e.dateStart.getTime()<n.getTime()?n:i,o=a.getTime()>s.getTime()?s:a,l=Math.round(this._getWorkingTime(r,o)/36e5);return{value:Math.max(0,l),max:r.getTime()===n.getTime()&&o.getTime()===s.getTime()?l:Math.round(this._getWorkingTime(n,s)/36e5)}}_refreshResourceTimelineContent(e,t){const i=this,a=i._resources.indexOf(e),n=i._getResourceTasks(e);if(t||(t=(()=>{const t=i.$.resourceTimelineCellsContainer.children;for(let i=0,a=t.length;i<a;i+=1){const a=t[i];if(a._cellObj&&a._cellObj.resource===e)return a}})()),a<0||!t||!t.childElementCount)return;let s=t.children;const r=i.$.resourceTimelineViewCells.children,o=i._tasks.filter((e=>!e.hidden));for(let t=0,l=s.length;t<l;t+=1){const l=s[t];let d,c=l.firstElementChild;n.length&&!e.hidden?(c?(c.classList.remove("hide-left-border","hide-right-border"),c.removeAttribute("load"),c.innerHTML=c.style.height=""):(c=document.createElement("div"),c.classList.add("jqx-resource-timeline-view-cell"),d=!0),e.class&&c.classList.add(e.class),i._setResourceCellLoad({cell:c,cellIndex:t,resource:e,resourceCell:l,resourceIndex:a,resourceTasks:n,tasks:o,viewCells:r}),c.hasAttribute("load")?d&&l.appendChild(c):c.remove()):c&&c.remove()}}_setResourceCellLoad(e){const t=this,i=t.resourceTimelineFormatFunction,{cell:a,cellIndex:n,resource:s,resourceCell:r,resourceIndex:o,resourceTasks:l,tasks:d,viewCells:c}=e;let m={};for(let e=0,u=l.length;e<u;e+=1){const u=l[e];if(u.hidden)continue;const h=d.indexOf(u),g=t._getCellDateRange(c[n]),{dateStart:f,dateEnd:p}=g;if(!f||f.getTime()>=u.dateEnd.getTime()||p.getTime()<=u.dateStart.getTime())continue;if(m[n]&&m[n].indexOf(h)<0?m[n].push(h):m[a]||(m[n]=[h]),"custom"===t.resourceTimelineMode){i&&(a.innerHTML=i.call(t,m[n]||[],o,new Date(f))||"");continue}const _=t._getResourceCellCapacity({cell:a,cellDateRange:g,cellTaskIndexAssigned:m,index:o,resource:s,task:u,cellIndex:n});if(!_)continue;const{capacity:T,maxCapacity:b}=_,k=parseFloat(((parseFloat(a.getAttribute("load"))||0)+(T||0)).toFixed(1));k>b?a.classList.add("warning"):a.classList.remove("warning"),"histogram"!==t.resourceTimelineMode?k&&a.setAttribute("load",k):t._setCellHistogram({cell:a,load:k,maxCapacity:b,previousViewCell:r.previousElementSibling})}}_getResourceCellCapacity(e){const t=this,i=t.resourceTimelineView,{cell:a,cellDateRange:n,cellTaskIndexAssigned:s,index:r,resource:o,task:l,cellIndex:d}=e;let c,m;if("tasks"===i)c=1,m=o.maxCapacity;else if("hours"===i){const e=t._getResourceCellWorkTime(l,n),i=e.max/24;c=parseFloat((e.value/e.max*o.capacity*i).toFixed(1)),m=Math.min(e.max,parseFloat((o.maxCapacity*i).toFixed(1)))}else{const e=t.resourceTimelineFormatFunction;if(!e)return;let i=e.call(t,s[d]||[],r,new Date(n.dateStart));if(null!=i)if(i="object"!=typeof i?[i]:Object.values(i),2===i.length)c=parseFloat(i[0])||0,m=parseFloat(i[1])||0;else if(1===i.length)return void(a&&a.setAttribute("load",i[0]))}return{capacity:c,maxCapacity:m}}_setCellHistogram(e){const{load:t,cell:i,maxCapacity:a,previousViewCell:n}=e,s=Math.min(100,100*parseFloat((t/a).toFixed(2))),r=n?n.firstElementChild:void 0;if(r){const e=parseFloat(r.style.height)||0;s?e===s?(i.classList.add("hide-left-border"),r.classList.add("hide-right-border")):e>s?(i.classList.add("hide-left-border"),r.classList.remove("hide-right-border")):e<s&&(i.classList.remove("hide-left-border"),r.classList.add("hide-right-border")):(i.classList.remove("hide-left-border"),r.classList.remove("hide-right-border"))}i.style.height=s+"%",t&&i.setAttribute("load",t+"/"+a)}_recycleResourceHeaderCells(){const e=this;if(!e.$.mainSplitter.contains(e.$.resourceSplitterItem))return;const t=e.$.resourceTimelineViewCells,i=t.children,a=e.$.timelineViewCells.children;let n=document.createDocumentFragment();for(;i.length>a.length;)i[0].remove();for(let e=0;e<a.length;e++){const t=a[e];let s=i[e];s||(s=t.cloneNode(!0),n.appendChild(s)),s.style.left=t.style.left,s.style.right=t.style.right,s.style.width=t.style.width,s.innerHTML=t.innerHTML,s._date=t._date,t.hasAttribute("weekend")?s.setAttribute("weekend",""):s.removeAttribute("weekend"),t.hasAttribute("nonworking")?s.setAttribute("nonworking",""):s.removeAttribute("nonworking")}n.childElementCount&&t.appendChild(n),e.$.resourceTimelineCellsContainer.style.width=e.$.resourceTimelineViewCells.style.width=e.$.timelineContent.style.width}_refreshResourceScrollBar(){const e=this,t=e.$.resourceVerticalScrollBar;if(!e.$.mainSplitter.contains(e.$.resourceSplitter))return;const i=Math.max(0,e.$.resourceTimelineCellsContainer.offsetHeight-e.$.resourceTimelineContent.offsetHeight);0===i&&"visible"===e.verticalScrollBarVisibility?(t.max=1,e.scrollHeight||e.$container.removeClass("vscroll")):i&&e.$container.addClass("vscroll"),t.max=i,t.disabled="disabled"===e.verticalScrollBarVisibility||e.disabled||i<=0,!e.$.container.classList.contains("vscroll")&&t.disabled?t.classList.add("jqx-hidden"):(t.classList.remove("jqx-hidden"),t.refresh(),e.$.container.classList.contains("hscroll")?e.$.horizontalScrollBar.classList.add("bottom-corner"):e.$.container.classList.contains("vscroll")||e.$.horizontalScrollBar.classList.remove("bottom-corner"))}_handleResources(e){const t=this,i=e?[e]:t._tasks;t._resources||(t._resources=[]);for(let e=0;e<i.length;e++){let a=i[e].resources;Array.isArray(a)||(a=[a].reduce(((e,t)=>e.concat(t)),[]));for(let n=0;n<a.length;n++){let s=a[n];if("object"!=typeof s||!s||void 0===s.id||null===s.id){"number"==typeof s&&(a[n]=s+"");continue}let r=t._resources.find((e=>e.id&&e.id.toString()===s.id.toString()))||{};t._setResource(r,s,i[e]),a[n]=r.id,Object.values(r).length&&!t._resources.includes(r)&&t._resources.push(r)}}t._refreshItemIds("resource");const a=t._resources;for(let e=0,i=a.length;e<i;e+=1)t._refreshResource(a[e])}_refreshAssignedResources(e,t=[]){const i=this;if(!e.$.id||i._tasks.indexOf(e)<0)return;const a=i._getTaskResources(e);for(let e=0;e<a.length;e++){const n=a[e];let s=[];i.resourceColumns.forEach((e=>{void 0!==e.formatFunction&&s.push(e.value)})),s.concat(t),i.$.mainSplitter.contains(i.$.resourceSplitter)&&i._refreshResourceTimelineContent(n),t.includes("workload")?i._refreshResource(n,"workload"):t.includes("progress")&&i._refreshResource(n,"progress"),s.length&&i._refreshTableColumnsData(n,s,"resource")}}_refreshResource(e,t){const i=this;if(!i._resources.length)return;const a=i._getResourceTasks(e),n=864e5;switch(t){case"progress":e.progress=parseFloat((a.reduce(((e,t)=>e+t.progress),0)/a.length).toFixed(2));break;case"workload":e.workload=parseFloat((i._convertDuration(a.reduce(((e,t)=>e+t.duration),0))/n*e.maxCapacity).toFixed(2));break;default:e.progress=parseFloat((a.reduce(((e,t)=>e+t.progress),0)/a.length).toFixed(2)),e.workload=parseFloat((i._convertDuration(a.reduce(((e,t)=>e+t.duration),0))/n*e.maxCapacity).toFixed(2))}i.$.mainSplitter.contains(i.$.resourceSplitter)&&i._refreshResourceTimelineContent(e)}_setResource(e,t){if(t&&"object"==typeof t)return e.id?e.id=e.id.trim():e.id=(t.id+"").trim(),e.$||(e.$={}),e.class=t.class||e.class,e.minCapacity=t.minCapacity||e.minCapacity||0,e.maxCapacity=t.maxCapacity||e.maxCapacity||24,e.progress=t.progress||e.progress||0,e.capacity=t.capacity||e.capacity||8,e.type=t.type||e.type,e.hidden=!!("boolean"==typeof t.hidden?t.hidden:e.hidden),e.workload=e.workload||0,t.label?e.label=t.label:void 0===e.label&&(e.label=""),t.value&&(e.value=t.value),e}insertResource(e,t){const i=this,a=Array.from(arguments).filter((e=>void 0!==e));let n,s=i._resources;if(1===a.length&&(t=a[0]),"object"!=typeof t)return void i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"insertResources",argumentName:"resource"}));if(t.id&&s.find((e=>e.id&&e.id.toString()===t.id.toString())))return void i.updateResource(t.id,t);if(t.assignedTo&&(n=[t.assignedTo].reduce(((e,t)=>e.concat(t,[])))),!(t=i._setResource({},t)))return;i._refreshItemIds("resource"),s=i._resources;const r=i._getValidItemAndIndex(e,"resource").index;if(r<0?s.push(t):s.splice(r,0,t),i._tasks.length){if(void 0!==n){Array.isArray(n)||(n=[n]);for(let e=0,a=n.length;e<a;e+=1){const a=i._getValidItemAndIndex(n[e],"task");if(a){const e=a.item;!e||e.disableResources||e.resources.includes(t.id.toString())||e.resources.push(t.id)}}if(i._isUpdating)return void(i._isUpdating.type.resource=!0);i._highlightAssignedItem("task",i._getSelection("task",i.selectedTaskIds)),i._refreshResource(t)}if(i._isUpdating)return i._isUpdating.type.resource=!0,void(i._isUpdating.type.task=!0);if(i.groupByResources)i._refreshTableDataSource(),i._refreshTimeline();else if(i.taskColumns.find((e=>"resources"===e.value))){const e=i._tasks.filter((e=>e.resources.includes(t.id)));for(let t=0;t<e.length;t++)i._refreshTableColumnsData(e[t],["resources"])}}i._isUpdating?i._isUpdating.type.resource=!0:(i._createResourceTimeline(),i.$.fireEvent("itemInsert",{type:"resource",item:i._cloneObject(t)}))}_insertTimelineResource(e,t,i){const a=this,n=a.$.resourceTimelineCellsContainer,s=document.createElement("div");s.classList.add("jqx-timeline-row"),s._resource=t,a._refreshResourceTimelineContent(t,s),a.$.resourceTimelineCellsContainer.insertBefore(s,e>-1?n.children[e]:void 0),a.$.container.style.setProperty("--jqx-gantt-chart-resource-timeline-content-height",n.offsetHeight+"px"),a._refreshResourceScrollBar(),a._insertNewTreeItem(e,t,i,"resource"),a.$.resourceTree.refresh(),a._highlightAssignedItem("task",a._getSelection("task",a.selectedTaskIds))}updateResource(e,t){if(void 0===e)return;const i=this._getValidItemAndIndex(e,"resource");i&&i.item&&this._updateResource(i.item,t)}removeResource(e){if(void 0===e)return;const t=this._getValidItemAndIndex(e,"resource");t&&t.item&&this._removeResource(t.item)}_getResourceTasks(e){const t=this._resources,i=this._tasks;if(!e||!t.length||!i.length)return;let a=[];for(let t=0;t<i.length;t++)i[t].resources.includes(e.id)&&a.push(i[t]);return a}_getTaskResources(e){const t=this;if(!e)return[];const i=[e.resources].reduce(((e,t)=>e.concat(t)),[]);let a=[];for(let e=0;e<i.length;e++){const n=t._resources.find((t=>t.id&&t.id.toString()===i[e].toString()));n&&a.push(n)}return a}_resourceValidator(e,t){const i=this;return Array.isArray(t)||t instanceof JQX.ObservableArray||"number"==typeof t||"string"==typeof t||null==t?t:(i.error(i.localize("invalidValue",{elementType:i.nodeName.toLowerCase(),property:"resources",typeOne:"array",typeTwo:"number"})),null)}_handleTaskProgressChange(e){const t=this,i=t._dragDetails.task,a=t._dragDetails.timelineTask;if(t.disableTaskProgressChange)return;if(!t.hasAttribute("progress-change")){if(t.$.fireEvent("progressChangeStart",{id:"string"==typeof i.id||"number"==typeof i.id?i.id:i.$.id,item:t._cloneObject(i),progress:i.progress||0}).defaultPrevented)return void delete t._dragDetails.target;t._closeTooltip(),t.setAttribute("progress-change",""),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}const{left:n,width:s}=a.getBoundingClientRect(),r=e.pageX-window.pageXOffset;t._dragDetails.progress||(t._dragDetails.progress=i.progress/100*s),t._dragDetails.progress=Math.max(0,Math.min(s,t._dragDetails.progress+(t.rightToLeft?-1:1)*(r-t._dragDetails.coordinates.x))),t._dragDetails.coordinates.x=Math.max(n+t._dragDetails.offset.x,Math.min(n+s+t._dragDetails.offset.x,r));const o=t._dragDetails.task.progress=t._dragDetails.progress/s*100;i.progress=parseFloat(o.toFixed(2)),t._setTaskBarProgress(i,a),t._refreshTableColumnsData(i,["progress"]),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(i,["progress"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleTaskSegmentDrag(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=n._segmentObj;if(!s||s.disableDrag)return;const r=i.task,o=t._dragDetails.timelineTask,l=a.isFirstSegment,d=a.isLastSegment,c=t.rightToLeft,m=c?"right":"left";i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===r)));const u=i.timelineRow;if(!t.hasAttribute("dragged")){if(t.$.fireEvent("dragStart",{id:"string"==typeof r.id||"number"==typeof r.id?r.id:r.$.id,item:t._cloneObject(r),dateStart:r.dateStart,dateEnd:r.dateEnd,segment:t._cloneObject(s)}).defaultPrevented)return void delete i.timelineTask;if(t.setAttribute("dragged",""),t._closeTooltip(),t._touchmoveInside=!0,l||d){const e=t._createDelimiter("min-date"),i=t._createDelimiter("max-date");e&&u.appendChild(e),i&&u.appendChild(i)}}if(l){const a=i.size?i.size.width:i.originalSize.width;t._handleTaskResize(e,c?"right":"left"),i.segments||(i.segments=o.querySelectorAll(".jqx-task-segment"));const n=i.size.width-a,s=i.segments;for(let e=0,t=s.length;e<t;e+=1){const t=s[e];0!==e&&(t.style[m]=(parseFloat(t.style[m])||t.offsetLeft)+n+"px")}}else{if(!d)return void t._handleSegmentDrag(e);{const s=a.dimensions;t._handleTaskResize(e,c?"left":"right"),n.style[m]=i.size.width-s.width+"px"}}t._refreshTask(o,[n]),t._refreshProject(r.$.project),t.groupByResources&&t._refreshProject(r.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(o._cellObj.task),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleSegmentDrag(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=i.task,r=t._dragDetails.timelineTask,o=t.rightToLeft,l=o?"right":"left";i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===s)));const d=i.timelineRow,{left:c}=d.getBoundingClientRect(),m=i.taskDimensions.left;a.position||(a.position={x:a.originalPosition.x});const u=r.offsetWidth,h=e.pageX-window.pageXOffset;let g=0,f=a.min.left||0,p=a.max.left;o&&(f=u-(f+a.dimensions.width),p=u-p),a.position.x=Math.max(f,Math.min(p,a.position.x+(o?-1:1)*(h-i.coordinates.x))),void 0!==p&&(g=o?m+a.min.left:m+a.max.left,a.position.x=Math.min(p,a.position.x)),f=m+(o?a.max.left-a.dimensions.width:f),i.coordinates.x=Math.max(c+a.offset.x+f,Math.min(c+a.offset.x+g,h)),n.style[l]=a.position.x+"px",t._refreshTaskSegments(r,[n])}_handleTaskBarDrag(e){const t=this;if(t.disableTaskDrag)return;const i=t._dragDetails;if(Math.abs(e.pageX-i.coordinates.x)<=5)return void(t._scrollView.disableSwipeScroll=!0);if(i.segment)return void t._handleTaskSegmentDrag(e);const a=i.task,n=i.timelineTask;i.timelineRow||(i.timelineRow=Array.from(t.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===a)));const s=i.timelineRow;if(!t.hasAttribute("dragged")){if(t.$.fireEvent("dragStart",{id:"string"==typeof a.id||"number"==typeof a.id?a.id:a.$.id,item:t._cloneObject(a),dateStart:a.dateStart,dateEnd:a.dateEnd}).defaultPrevented)return void delete i.timelineTask;t.setAttribute("dragged",""),t._closeTooltip(),t._touchmoveInside=!0;const e=t._createDelimiter("min-date"),n=t._createDelimiter("max-date");e&&s.appendChild(e),n&&s.appendChild(n)}i.position||(i.position={x:i.originalPosition.x,y:i.originalPosition.y});const r=s.getBoundingClientRect().left,o=s.offsetWidth,l=n.offsetWidth,d=i.min.left||0,c=i.max.left,m=e.pageX-window.pageXOffset,u=t.rightToLeft;let h=0;i.position.x=Math.max(d,Math.min(o-l,i.position.x+(u?-1:1)*(m-i.coordinates.x))),void 0!==c&&(i.position.x=Math.min(c,i.position.x),h=o-l-c),i.coordinates.x=u?Math.max(r+i.offset.x+h,Math.min(r+o-(l-i.offset.x+d),m)):Math.max(r+i.offset.x+d,Math.min(r+o-(l-i.offset.x+h),m));const g=a.dateStart.getTime(),f=a.dateEnd.getTime();n.style[u?"right":"left"]=i.position.x+"px",t._refreshTask(n),t._refreshProject(a.$.project),t.groupByResources&&t._refreshProject(a.$.group),"project"===a.type&&a.dragProject&&t._refreshProjectTasks(a,{startTime:a.dateStart.getTime()-g,endTime:a.dateEnd.getTime()-f}),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(n._cellObj.task),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleTaskBarResize(e){const t=this;if(t.disableTaskResize)return;const i=t._dragDetails;if(i.segment)return void t._handleTaskSegmentResize(e);const a=i.timelineTask,n=i.task;if(!t.hasAttribute("resized")){if(t.$.fireEvent("resizeStart",{id:"string"==typeof n.id||"number"==typeof n.id?n.id:n.$.id,item:t._cloneObject(n),dateStart:n.dateStart,dateEnd:n.dateEnd}).defaultPrevented)return void t.$.timeline.removeAttribute("task-bar-hovered");t.setAttribute("resized",""),t._closeTooltip(),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}t._handleTaskResize(e,t.$.timeline.getAttribute("task-bar-hovered")),t._updateSegmentsOnTaskResize(),t._refreshTask(a),t._refreshProject(n.$.project),t.groupByResources&&t._refreshProject(n.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(a._cellObj.task,["workload"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_updateSegmentsOnTaskResize(){const e=this,t=e._dragDetails,i=t.task,a=t.timelineTask;if(!i||!i.segments)return;let n;t&&t.segments?n=t.segments:t.segments=n=a.querySelectorAll(".jqx-task-segment");const s=n.length,r=t.size.width,o=e.rightToLeft?"right":"left";for(let t=0;t<s;t+=1){const i=n[t],a=i.style.width?parseFloat(i.style.width):i.offsetWidth,l=i.style[o]?parseFloat(i.style[o]):0;if(l+a>r){const t=r-(l+a),n=a+t;n<e._taskBarMinWidth&&(i.style[o]=l+t+"px"),i.style.width=n+"px"}else t===s-1&&(i.style.width=r-l+"px")}}_handleTaskSegmentResize(e){const t=this,i=t._dragDetails,a=i.segment,n=a.element,s=n._segmentObj;if(!s||s.disableResize)return;const r=i.task,o=t._dragDetails.timelineTask,l=a.isFirstSegment,d=a.isLastSegment,c=t.rightToLeft,m=c?"right":"left";if(!t.hasAttribute("resized")){if(t.$.fireEvent("resizeStart",{id:"string"==typeof r.id||"number"==typeof r.id?r.id:r.$.id,item:t._cloneObject(r),dateStart:r.dateStart,dateEnd:r.dateEnd,segment:t._cloneObject(s)}).defaultPrevented)return void t.$.timeline.removeAttribute("task-bar-hovered");t.setAttribute("resized",""),t._closeTooltip(),t._scrollView.disableSwipeScroll=t._touchmoveInside=!0}const u=t.$.timeline.getAttribute("task-bar-hovered");if(l&&("left"===u&&!c||"right"===u&&c)){const s=i.size?i.size.width:i.originalSize.width;void 0===a.size&&(a.size={width:a.originalSize.width}),t._handleTaskResize(e,u),i.segments||(i.segments=o.querySelectorAll(".jqx-task-segment"));const r=i.size.width-s,l=i.segments;for(let e=0,t=l.length;e<t;e+=1){const t=l[e];0!==e&&(t.style[m]=(parseFloat(t.style[m])||t.offsetLeft)+r+"px")}n.style.width=(a.size.width+=r)+"px"}else{if(!d||!("right"===u&&!c||"left"===u&&c))return t._handleSegmentResize(e,u),void t._refreshTaskSegments(o,[n]);{const s=i.size?i.size.width:i.originalSize.width;void 0===a.size&&(a.size={width:a.originalSize.width}),t._handleTaskResize(e,u),n.style.width=(a.size.width+=i.size.width-s)+"px"}}t._refreshTask(o,[n]),t._refreshProject(r.$.project),t.groupByResources&&t._refreshProject(r.$.group),clearTimeout(t._resourceTreeRefreshTimeout),t.$.mainSplitter.contains(t.$.resourceSplitter)&&(t._resourceTreeRefreshTimeout=setTimeout((function(){t._refreshAssignedResources(o._cellObj.task,["workload"]),delete t._resourceTreeRefreshTimeout}),t.resourcePanelRefreshRate))}_handleSegmentResize(e,t){const i=this,a=i._dragDetails,n=a.task,s=a.segment,r=s.element,o=i.rightToLeft,l=a.taskDimensions.left;a.timelineRow||(a.timelineRow=Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===n)));const d=a.timelineRow;s.position||(s.position={x:s.originalPosition.x}),s.size||(s.size={width:s.originalSize.width});const c=e.pageX-window.pageXOffset;let m=s.size.width,u=s.min.width||0,h=s.max.width,g=s.min.left||0,f=s.max.left,p=r.offsetLeft,{left:_}=d.getBoundingClientRect(),T="object"==typeof e?c-a.coordinates.x:e;if(_+=l,"left"===t&&!o||"right"===t&&o)if(o){const e=a.taskDimensions.width;T=T<0?-1*Math.min(Math.abs(T),m-u):Math.min(h-m,Math.abs(T)),m=Math.max(u,Math.min(h,m+T)),r.style.left="",r.style.right=(p=Math.max(e-g,(parseFloat(r.style.right)||d.offsetWidth-p-m)-T))+"px",a.coordinates.x=Math.max(_+e-p+u,Math.min(_+e-p,c))}else T=T>0?Math.min(T,m-(u||0)):-1*Math.min(h-m,Math.abs(T)),m=Math.max(u,Math.min(p+m,m-T)),r.style.right="",r.style.left=(p=Math.max(g,(parseFloat(r.style.left)||p)+T))+"px",a.coordinates.x=Math.max(_+g+u,Math.min(_+p+m-u,c));else o?(T<0&&(T=-1*Math.min(h-m,Math.abs(T))),m=Math.max(u,Math.min(p+m,m-T)),f-=s.dimensions.width,a.coordinates.x=Math.max(_+f,Math.min(_+f+h,c))):(T>0&&(T=Math.min(h-m,T)),m=Math.max(u,Math.min(h,m+T)),a.coordinates.x=Math.max(_+p+u,Math.min(_+p+h,c)));r.style.width=(s.size.width=m)+"px"}_handleTaskResize(e,t){const i=this,a=i._dragDetails,n=a.task;a.position||(a.position={x:a.originalPosition.x,y:a.originalPosition.y}),a.size||(a.size={width:a.originalSize.width}),a.timelineRow||(a.timelineRow=Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===n)));const s=a.timelineRow,r=a.timelineTask,o=a.segment,l=e.pageX-window.pageXOffset;let d=a.size.width,c=a.min.width||0,m=a.max.width,u=s.getBoundingClientRect().left,h=i.rightToLeft,g="object"==typeof e?l-a.coordinates.x:e;if("left"===t&&!h||"right"===t&&h)if(o&&(h?(u-=o.dimensions.width-o.offset.x,c=Math.max(o.max.left+o.min.width,c)):(u+=o.offset.x,c=Math.max(a.taskDimensions.width-o.max.left+o.min.width,c))),h){g<0?g=-1*Math.min(Math.abs(g),d-(c||0)):void 0!==m&&(g=Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(s.offsetWidth-r.offsetLeft,d+g));const e=r.offsetLeft;r.style.left="",r.style.right=(a.position.x=Math.max(0,(parseFloat(r.style.right)||s.offsetWidth-r.offsetLeft-r.offsetWidth)-g))+"px",a.coordinates.x=Math.max(u+r.offsetLeft+c,Math.min(u+e+d,l))}else g>0?g=Math.min(g,d-(c||0)):void 0!==m&&(g=-1*Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(r.offsetLeft+d,d-g)),r.style.right="",r.style.left=(a.position.x=Math.max(0,(parseFloat(r.style.left)||r.offsetLeft)+g))+"px",a.coordinates.x=Math.max(u+r.offsetLeft,Math.min(u+r.offsetLeft+d-c,l));else h?(o&&(u+=o.offset.x,c=Math.max(a.taskDimensions.width-o.min.left+o.min.width,c)),g<0&&void 0!==m&&(g=-1*Math.min(m-d,Math.abs(g))),d=a.size.width=Math.max(c,Math.min(r.offsetLeft+r.offsetWidth,d-g)),r.style.width=a.size.width+"px",a.coordinates.x=Math.max(u+r.offsetLeft,Math.min(u+r.offsetLeft+d-c,l))):(o&&(u-=o.dimensions.width-o.offset.x,c=Math.max(o.min.left+o.min.width,c)),g>0&&void 0!==m&&(g=Math.min(m-d,g)),d=a.size.width=Math.max(c,Math.min(s.offsetWidth-r.offsetLeft,d+g)),a.coordinates.x=Math.max(u+r.offsetLeft+c,Math.min(u+r.offsetLeft+(m||d),l)));r.style.width=a.size.width+"px"}_handleTimelineConnectionHover(e){const t=this;if(!(t.shadowRoot||t).contains(e))return;const i=t.$.timelineConnectionsContainer.children,a=e.closest(".jqx-task-connection");if(a||!t.$.timelineConnectionsContainer.querySelector(".jqx-task-connection[hover]")){if(a){const e=a.getAttribute("connection-id");for(let t=0;t<i.length;t++){const a=i[t];a.getAttribute("connection-id")===e?a.setAttribute("hover",""):a.removeAttribute("hover")}t._hoveredConnectionTasks=a.tasks}}else for(let e=0;e<i.length;e++)i[e].removeAttribute("hover")}_resetItemHover(){const e=this;if(e._hoveredItem){const t=e.$.mainSplitter.querySelectorAll(".jqx-timeline-task[hover], .jqx-timeline-row[hover], tr[hover]");for(let e=0;e<t.length;e++)t[e].removeAttribute("hover");e.$.timeline.removeAttribute("task-bar-hovered"),delete e._hoveredItem}}_handleTimelineHover(e,t){const i=this,a=i._isMobile;if(!e||a)return void i._resetItemHover();const n=e.originalEvent||e;let s="task",r=n.pageX&&a?document.elementFromPoint(n.pageX-window.pageXOffset,n.pageY-window.pageYOffset):n.target;if(n.pageX&&i.shadowRoot&&r===i&&(r=n.pageX&&a?i.shadowRoot.elementFromPoint(n.pageX-window.pageXOffset,n.pageY-window.pageYOffset):n.composedPath()[0]),!r||!r.closest||r===i||t)return void i._resetItemHover();i.$.resourceSplitter&&i.$.resourceSplitter.contains(r)?s="resource":i._handleTimelineConnectionHover(r);let o=r.closest(".jqx-timeline-row")||r.closest(".jqx-timeline-task");if(!o||!(i.shadowRoot||i).contains(o))return void i._resetItemHover();const l=o._cellObj[s],d=l.$.id,c=i._hoveredItem;if(!(c&&c.type===s&&c.id===d||(i._resetItemHover(),l.isGroup||("task"===s&&o.classList.contains("jqx-timeline-row")&&(o=i.$.timelineTasksContainer.querySelector(`.jqx-timeline-task[row-id="${d}"]`)),!o||i._connectionFeedback&&o.contains(i._connectionFeedback)||(o.setAttribute("hover",""),i._hoveredItem={id:d,type:s},a))))){const e=("task"===s?i.$.taskTimelineCellsContainer:i.$.resourceTimelineCellsContainer).querySelector(`.jqx-timeline-row[row-id="${d}"]`);e&&(e.setAttribute("hover",""),i._handleTableItemHover(d,r))}}_getScrollLeft(e){return this.rightToLeft?e*=-1:e}_synchronizeSplitters(e,t){if(this.$.mainSplitter.contains(this.$.resourceSplitter)){const i=e._measurements,a=e.items,n=t.items,[s,r,o]=[i.dimension,i.minDimension,i.maxDimension],[l,d]=[n[0],a[0]],[c,m]=[n[1],a[1]];t.keepProportionsOnResize=!0,t.setAttribute("orientation-change",""),[r,o,s].forEach((e=>{const t=e===s?"size":e===r?"min":"max";l.set(t,""),c.set(t,""),l[t]=d.style[e],c[t]=m.style[e]})),t.removeAttribute("orientation-change"),t.keepProportionsOnResize=!1}}_resizeEventHandler(e){const t=this,i=t.$.taskSplitter;function a(e){e.refresh(),e===i&&t._synchronizeSplitters(i,t.$.resourceSplitter)}if(e&&"resizeEnd"===e.type){if(e.target===t.$.taskTreeSplitter||e.target===t.$.resourceTreeSplitter)return void a(e.target);e.target===t.$.resourceSplitter&&t._synchronizeSplitters(t.$.resourceSplitter,i)}if(!t._timelineCells)return void t._refresh();t.$.mainSplitter.refresh(),a(i);const n=t._getScrollLeft(t.scrollLeft);t._autoSchedule(),t._createTimelineCells(),t._recycleTimelineTasks(),t._recycleTimelineRowCells(),t._refreshResourceTimeline(),t._refresh(),t.$.taskTable.refresh(),t.$.timelineHeader.scrollLeft=t.$.taskTimelineContainer.scrollLeft=n,t.$.taskTable.scrollTop=t.$.taskTimelineContainer.scrollTop=t.scrollTop,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&(t.$.resourceTimelineHeader.scrollLeft=t.$.resourceTimelineContent.scrollLeft=n,t.$.resourceTable.refresh(),t.$.resourceTable.scrollTop=t.$.resourceTimelineContent.scrollTop=t.$.resourceVerticalScrollBar.value),t._positionWindow()}_recycle(e){const t=this,i=e&&"horizontal"===e.context.orientation;if(e&&!i||(t._recycleHeaderCells(t.$.timelineViewCells),t._recycleHeaderCells(t.$.timelineViewDetails),t.$.timelineViewSubDetails.classList.contains("jqx-hidden")||t._recycleHeaderSubCells(t.$.timelineViewSubDetails),t._recycleResourceContent()),i)return;if(t._recycleResourceContent(),t._recycleContentCells(),t._recycleTimelineTasks(),!e)return;const a=Math.round(e.detail.value);e.target!==t.$.resourceVerticalScrollBar?t._refreshTableScrollTop(t.$.taskTable,a):t._refreshTableScrollTop(t.$.resourceTable,a)}_recycleContentCells(){const e=this,t=e._getFirstContentCellInView(),i=e.$.taskTimelineCellsContainer,a=e.$.timelineTasksContainer;if(!t)return void(i.innerHTML=a.innerHTML="");const n=t.height,s=1-(t.top+n-Math.abs(e.scrollTop))/n,r=e._timelineVCells?e._timelineVCells.length:0,o=!e.$.taskSplitter.offsetHeight,l=e.$.taskTimelineContainer.offsetHeight,d=!o&&l?Math.min(r,Math.ceil((parseFloat((l/n).toFixed(2))+s).toFixed(2))):r,c=e.$.timelineViewCells.children,m=document.createDocumentFragment();for(;i.childElementCount>d;)i.lastElementChild.remove();for(;a.childElementCount>d;)a.lastElementChild.remove();for(let t=i.childElementCount;t<d;t+=1){const t=document.createElement("div");t.classList.add("jqx-timeline-row"),e._createTimelineRowCells(t,c),m.appendChild(t)}m.childElementCount&&i.appendChild(m);for(let e=a.childElementCount;e<d;e+=1){const e=document.createElement("div");e.classList.add("jqx-timeline-task"),m.appendChild(e)}m.childElementCount&&a.appendChild(m)}_getCellIndexByDate(e){const t=this._timelineCells;let i=[];if(e&&e.length&&t){Array.isArray(e)||(e=[e]);for(let t=0,a=e.length;t<a;t+=1){const a=e[t];e[t]=a.getTime?a.getTime():a,i[t]=-1}for(let a=0,n=t.length;a<n;a+=1){const n=t[a],s=e.indexOf(n.date.getTime());if(s>-1&&(i[s]=a,i.every((e=>-1!==e))))break}return 1===i.length?i[0]:i}}_recycleDateMarkers(){const e=this,t=e.$.timelineMarkers,i=e._markers;if(!i||e.hideDateMarkers)return void(t.childElementCount&&(t.innerHTML=""));const a=e.$.timelineViewCells.children,n=a[0]._date,s=a[a.length-1]._date,[r,o]=e._getCellIndexByDate([n,s]);if(!n||!s)return;const l=n.getTime(),d=e._getCellDateRange({_date:s}).dateEnd.getTime(),c=t.children,[m,u]=e.rightToLeft?["right","left"]:["left","right"],h=document.createDocumentFragment();let g=0;for(let t=0,a=i.length;t<a;t+=1){const a=i[t],n=i[t].date,s=n.getTime();if(s<l||s>d)continue;const f=e._getTimelineCellByDate(n,r,o);if(f){const t=f.left+e._getTimelineTaskOffset(f,n),i=a.label,s=a.className;let r=c[g];r||(r=document.createElement("div"),h.appendChild(r)),r.className="jqx-gantt-chart-date-marker",void 0!==i&&(r.firstElementChild||(r.innerHTML='<div class="jqx-gantt-chart-marker-label"></div>'),r.firstElementChild.textContent=i+""),void 0!==s&&r.classList.add(s),r.style[u]="",r.style[m]=t+"px",g++}}for(h.childElementCount&&t.insertBefore(h,t.firstElementChild);c.length>g;)c[c.length-1].remove()}_refreshTableScrollTop(e,t){this.$.mainSplitter.contains(e)&&void 0!==t&&(e.scrollTop=t)}_recycleHeaderCells(e){let t=this,i=e.children,a=t.scrollLeft,n=e===t.$.timelineViewCells,s=n?t._timelineCells:t._timelineHeaderCells;if(e===t.$.timelineViewSubDetails&&(n=!1,s=t._timelineHeaderSubCells),!s.length)return;let r=document.createDocumentFragment();for(;i.length;)r.appendChild(e.firstElementChild);let o=t._getFirstCellObjInView(s),l=1-(o.left+o.width-Math.abs(a))/s[0].width,d=r.children.length,c=n?Math.ceil((parseFloat((t.$.timeline.offsetWidth/o.width).toFixed(2))+l).toFixed(2)):t._getHeaderVisibleCellsCount();if(e===t.$.timelineViewSubDetails&&(c=t._getHeaderSubVisibleCellsCount()),d>c)for(;r.children.length&&r.children.length!==c;)r.removeChild(r.firstElementChild);else if(d<c){const e=t._createCells(c-d);for(;e.children.length;)r.appendChild(e.firstElementChild)}const m=[t.rightToLeft?"right":"left"],u=n?t._getCellsViewType():t.view;let h=s.indexOf(o);for(let e=0;e<r.children.length;e++){const i=r.children[e],a=s[h];if(!a)break;let o=new Date(a.date);n||"week"!==t.view||(o.setDate(o.getDate()-o.getDay()),o=new Date(Math.max(a.date.getTime(),o.getTime()))),i.style[m]=a.left+"px",i.style.width=a.width+"px",i._date=o,i.innerHTML=`<div>${t._getDateString(o,u,!n)}</div>`,a.weekend?i.setAttribute("weekend",""):i.removeAttribute("weekend"),a.nonworking?i.setAttribute("nonworking",""):i.removeAttribute("nonworking"),h++}e.appendChild(r),n&&(t._recycleTimelineRowCells(),t._recycleResourceHeaderCells(),t._recycleDateMarkers(),t._setTodayCell())}_recycleHeaderSubCells(e){let t=this,i=e.children,a=t.scrollLeft,n=t._timelineHeaderSubCells;if(!n.length)return;let s=document.createDocumentFragment();for(;i.length;)s.appendChild(e.firstElementChild);let r=t._getFirstCellObjInView(n),o=(r.left,r.width,Math.abs(a),n[0].width,s.children.length),l=t._getHeaderSubVisibleCellsCount();if(o>l)for(;s.children.length&&s.children.length!==l;)s.removeChild(s.firstElementChild);else if(o<l){const e=t._createCells(l-o);for(;e.children.length;)s.appendChild(e.firstElementChild)}const d=[t.rightToLeft?"right":"left"],c=t.view;let m=n.indexOf(r);for(let e=0;e<s.children.length;e++){const i=s.children[e],a=n[m];if(!a)break;let r=new Date(a.date);"week"===t.view&&(r.setDate(r.getDate()-r.getDay()),r=new Date(Math.max(a.date.getTime(),r.getTime()))),i.style[d]=a.left+"px",i.style.width=a.width+"px",i._date=r,i.innerHTML=`<div>${t._getDateString(r,c,!0)}</div>`,a.weekend?i.setAttribute("weekend",""):i.removeAttribute("weekend"),a.nonworking?i.setAttribute("nonworking",""):i.removeAttribute("nonworking"),m++}e.appendChild(s),t._refreshHeaderSubDetailsDate()}_refresh(){const e=this;let t="disabled"===e.verticalScrollBarVisibility;function i(){const t=e.$.timelineHeader,i=t.scrollWidth-t.offsetWidth;return i>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$container.addClass("hscroll"):e.$container.removeClass("hscroll"),i}function a(){let i=Math.max(0,e.$.timelineContent.offsetHeight-e.$.taskTimelineContainer.offsetHeight);return i>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$container.addClass("vscroll"):e.$.mainSplitter.contains(e.$.resourceSplitter)?(i=1,t=!0,e.$.resourceVerticalScrollBar.max||e.$container.removeClass("vscroll")):e.$container.removeClass("vscroll"),i}const n=e.scrollWidth,s=e.scrollHeight;let r=i(),o=a();o&&s===o||(r=i()),r&&n===r||(o=a()),e.scrollWidth=r,e.scrollHeight=o,e.$.verticalScrollBar.disabled=t,e.$.horizontalScrollBar.refresh(),e.$.verticalScrollBar.refresh(),e.$.mainSplitter.contains(e.$.resourceSplitter)&&(e._refreshResourceScrollBar(),e._refreshTableScrollTop(e.$.resourceTable))}_refreshProjectTasks(e,t){const i=this,a=i._getProjectTasks(e);if(!a.length)return;const n=i.nonworkingDays,s=i.nonworkingHours,r=i._timelineVCells;for(let e=0,o=a.length;e<o;e++){const o=a[e];if(o){const e=i._getTaskDOMIndex(o),a=r[e],l=o.segments;if(o.dateStart=new Date(Math.max(i.dateStart.getTime(),o.dateStart.getTime()+t.startTime)),o.dateEnd=new Date(Math.min(i.dateEnd.getTime(),o.dateEnd.getTime()+t.endTime)),o.duration=i._convertDuration(n.length>0||s.length>0?i._getWorkingTime(o.dateStart,o.dateEnd):o.dateEnd.getTime()-o.dateStart.getTime(),!0),l&&l.length>1){for(let e=0,i=l.length;e<i;e+=1){const i=l[e];i.dateStart=new Date(i.dateStart.getTime()+t.startTime),i.dateEnd=new Date(i.dateEnd.getTime()+t.endTime)}i._validateTaskSegments(o)}a&&(i._recycleTaskBars(a,e),i._setTimelineTaskBar(a,e),l&&l.length>1&&i._setTaskBarProgress(o),i._refreshTaskConnections(o),i._refreshTableColumnsData(o,["dateStart","dateEnd","duration","overdue"]))}}}_refreshProject(e){const t=this;function i(e){let i,a,n;if(e instanceof HTMLElement)i=e.offsetLeft,n=e.offsetWidth;else if(e){const s=t._getTimelineTaskCellByDate(e.dateStart),r=t._getTimelineTaskCellByDate(e.dateEnd);s&&r&&(i=s.left+t._getTimelineTaskOffset(s,e.dateStart)||0,a=r.left+t._getTimelineTaskOffset(r,e.dateEnd)||0,n=a-i)}return[i,n]}if(!e)return;const a=t.groupByResources&&e.isGroup?"group":"project";if(e.synchronized)for(;e&&e.synchronized;){const n=t._getProjectTasks(e);let s=n[0],r=n[0];for(let e=0;e<n.length;e++)s.dateStart.getTime()>=n[e].dateStart.getTime()&&(s=n[e]),r.dateEnd.getTime()<=n[e].dateEnd.getTime()&&(r=n[e]);const o=t.$.timelineTasksContainer.children,l=t.$.timelineContent.offsetWidth;let d,c,m;for(let t=0,i=o.length;t<i;t+=1){const i=o[t],a=i._cellObj?i._cellObj.task:void 0;a&&(a===e?d=i:a===s?c=i:a===e&&(m=i))}if(!d){s&&(e.dateStart=s.dateStart),r&&(e.dateEnd=r.dateEnd),e=e.$[a];continue}s&&(e.dateStart=s.dateStart);let[u,h]=i(c||s);void 0!==u&&void 0!==h&&(t.rightToLeft?(d.style.width=d.offsetWidth-(l-u-h-(l-d.offsetLeft-d.offsetWidth))+"px",d.style.right=c?c.style.right:u+"px"):(d.style.width=d.offsetWidth-(u-d.offsetLeft)+"px",d.style.left=c?c.style.left:u+"px")),r&&(e.dateEnd=r.dateEnd),[u,h]=i(m||r),void 0!==u&&void 0!==h&&(t.rightToLeft?d.style.width=Math.max(0,d.offsetWidth-(l-d.offsetLeft-(l-u)))+"px":d.style.width=Math.max(0,d.offsetWidth-(d.offsetLeft+d.offsetWidth-(u+h)))+"px"),t._refreshTask(d),e=e.$[a]}else t._refreshProject(e.$[a])}_refreshTask(e,t){const i=this,a=i._getTaskBarCellRange(e),n=a.cellStart,s=a.cellEnd;if(!a||!n||!s)return;e._cellStart=n,e._cellEnd=s;const r=i._getTaskBarDateRange(e);if(!r)return;const o=e._cellObj.task;if(Array.from(i.$.taskTimelineCellsContainer.children).find((e=>e._cellObj.task===o))){if(o.dateStart=r.dateStart,o.dateEnd=r.dateEnd,o.duration=o.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(o.dateStart,o.dateEnd):o.dateEnd.getTime()-o.dateStart.getTime(),!0),e.setAttribute("aria-label",o.label+" Start date: "+i._toISODate(o.dateStart)+", End date: "+i._toISODate(o.dateEnd)),i._refreshTaskConnections(e),t)Array.isArray(t)&&i._refreshTaskSegments(e,t);else{const t=i._dragDetails;let a;e.classList.contains("task")?t&&t.segments?a=t.segments:t.segments=a=e.querySelectorAll(".jqx-task-segment"):a=e.querySelectorAll(".jqx-task-segment"),i._refreshTaskSegments(e,a)}i._refreshTableColumnsData(o,["dateStart","dateEnd","duration","overdue"])}}_refreshTaskSegments(e,t){const i=this,a=e._cellObj.task;if(!a||!a.segments||!a.segments.length)return void i._setTaskBarDeadline(a,t?t[0]:void 0);const n=i.nonworkingDays.length>0||i.nonworkingHours.length>0,s=i.rightToLeft,r=s?"right":"left",o=parseFloat(e.style[r])||e.offsetLeft;let l;for(let a=0,d=t.length;a<d;a+=1){const d=t[a],c=d._segmentObj,m=i._getSegmentCellRange(d),u=m.cellStart,h=m.cellEnd;if(!m||!u||!h)continue;const g=parseFloat(d.style.width)||d.offsetWidth,f=o+parseFloat(d.style[r])||(s?(parseFloat(e.style.width)||e.offsetWidth)-(d.offsetLeft+d.offsetWidth):d.offsetLeft);d._cellStart=u,d._cellEnd=h,l=d;let p=i._getDateFromCell(f,u),_=i._getDateFromCell(f+g,h);c.dateStart=p,c.dateEnd=_,c.duration=i._convertDuration(n?i._getWorkingTime(p,_):_.getTime()-p.getTime(),!0),e.setAttribute("aria-label",(c.label||"")+" Start date: "+i._toISODate(p)+", End date: "+i._toISODate(_))}i._setTaskBarProgress(a,e),i._setTaskBarDeadline(a,l)}_refreshTaskResources(e,t=[]){const i=this;if(e&&(t||(t=i._getTaskResources(e)),t.length))for(let e=0;e<t.length;e++){const a=t[e];i._refreshResource(a),i._refreshTableColumnsData(a,void 0,"resource")}}_refreshTableColumnsData(e,t,i){const a=this;if(i||(i="task"),!e)return;const n=a[`${i}Columns`],s=a.$[`${i}Table`];if(!a.$.mainSplitter.contains(s))return;const r=e.$.id;t=t?t.map((e=>n.find((t=>t.value===e)))):n;for(let i=0;i<t.length;i++){const n=t[i];n&&s.setValue(r,n.value,a._formatColumnData(e,n))}a.$[`${i}Splitter`].refresh()}_removeConnection(e,t){const i=this,a=i.$.connectionPopupWindow,n=i.$.timelineConnectionsContainer;if(e.classList&&e.classList.contains("jqx-task-connection")?e=e.getAttribute("connection-id"):e+="",void 0===e)return;const s=n.querySelectorAll('.jqx-task-connection[connection-id^="'+e+(e.indexOf("-")<0?"-":"")+'"]'),r=i._tasks,o=e.split("-"),l=parseInt(o[1]);for(let e=0;e<s.length;e++)n.removeChild(s[e]);let d;const c=parseInt(o[0]),m=parseInt(o[1]),u=parseInt(o[2]);if(a&&void 0!==a._target&&"number"==typeof a._target.type){const t=a._target;d=t.startIndex+"-"+t.endIndex+"-"+t.type===e}i._updateConnection([c,m,u],!0),!t&&i.autoSchedule&&(i._autoScheduleRestore(r[l],parseInt(o[2])),i._autoSchedule(r[l])),d&&i.$.fireEvent("itemRemove",{type:"connection",id:`${c}-${m}-${u}`,item:{source:c,target:m,type:u}})}_removeTaskConnections(e,t){const i=this,a=i._connections;if(a&&a.length){for(let t=0,i=a.length;t<i;t+=1)a[t].startTask===e&&(a.splice(t,1),i--);e.connections=[],t&&i._recycleConnections()}}_removeTask(e){const t=this,i=t._tasks;if(!e||!i||!i.length)return;const a=t._getSelection("task",t.selectedTaskIds),n=t.$.taskPopupWindow;let s;if(t._highlightAssignedItem("task",[e]),n&&n._target===e&&n.close(),"project"===e.type){const a=t._getProjectTasks(e);for(let e=0,t=a.length;e<t;e+=1)i.splice(i.indexOf(a[e]),1)}if(i.splice(i.indexOf(e),1),t._refreshItemIds(),t._refreshConnectionIds(),t._isUpdating)return t._isUpdating.type.task=!0,void(t._isUpdating.type.resource=!0);t._refreshSelectedItems(),t._refreshTableDataSource(),t._refreshTimeline(),t._selected&&t._selected.task&&(s=t._selected.task.map((e=>e.$.id)),a.toString()!==s.toString()&&(t.$.taskTable.selected=t._getSelection("task",t.selectedTaskIds))),t.$.fireEvent("itemRemove",{type:"task",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:t._cloneObject(e)})}_removeResource(e){const t=this,i=t._resources,a=i.indexOf(e);if(e&&!(a<0)){if(t._isUpdating)return i.splice(a,1),t._isUpdating.type.resource=!0,void(t._isUpdating.type.task=!0);if(i.splice(a,1),t.groupByResources)t._refreshTableDataSource(),t._createTimelineContent(),t._refresh(),t._recycleTimelineTasks();else if(t.taskColumns.find((e=>"resources"===e.value))){const i=t._tasks.filter((t=>t.resources.includes(e.id)));for(let e=0;e<i.length;e++)t._refreshTableColumnsData(i[e],["resources"])}if(!i.filter((e=>!e.hidden)).length)return t._createResourceTimeline(),t._resizeEventHandler(),void n();t._refreshResourceTimeline(),t._refreshTableDataSource("resource"),t.$.mainSplitter.contains(t.$.resourceSplitter)?(t._refreshResourceScrollBar(),t._resizeEventHandler(),n()):n()}function n(){t.$.fireEvent("itemRemove",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:t._cloneObject(e)})}}_updateTask(e,t){const i=this,a=i._tasks;if(!e||!a||!a.length)return;const n=i.$.taskPopupWindow,s=i._getSelection("task",i.selectedTaskIds);n&&n._target===e&&n.close();let r,o=i._getTaskResources(e);for(let n in t){let s=e[n],l=t[n];if("type"===n&&s!==l&&["task","project","milestone"].indexOf(l)>-1&&"project"===s){const t=i._getProjectTasks(e);for(let e=0,i=t.length;e<i;e+=1)a.splice(a.indexOf(t[e]),1);delete e.tasks}if("project"!==e.type||!e.synchronized||!(n.toLowerCase().indexOf("date")>-1||n.toLowerCase().indexOf("duration")>-1))if("dateEnd"===n&&new Date(s).getTime()!==new Date(l).getTime()&&(r=!0),"tasks"!==n)"connections"===n&&(i._removeTaskConnections(e),i._handleTaskConnections(e)),e[n]=l,"resources"===n&&(i._handleResources(e),e.disableResources||(o=o.concat(i._getTaskResources(e)),o=o.filter(((e,t)=>o.indexOf(e)===t)))),"milestone"!==e.type||"dateStart"!==n&&"dateEnd"!==n||(e.dateEnd=e.dateStart=l);else if("project"===e.type){const t=i._getProjectTasks(e);for(let e=0,i=t.length;e<i;e+=1)a.splice(a.indexOf(t[e]),1);const n=i._createTasks(l,!0);for(let t=0,i=n.length;t<i;t+=1)n[t].$.project=e;i._insertTasks(n,e,a.indexOf(e))}}r&&delete e.duration;const l=e.$,d=e.$.project;if(i._validateTaskProperties(e,d),e.$=l,d&&i._synchronizeProjectDates(d),"project"===e.type&&e.hidden&&i._getProjectTasks(e).forEach((t=>t.hidden=e.hidden)),i._synchronizeProjectVisibility(e.$.project,e),i._refreshItemIds(),i._refreshConnectionIds(),i._isUpdating)return void(i._isUpdating.type.task=!0);let c;i._selected&&i._selected.task&&i._setSelection("task",c=i._selected.task.map((e=>e.$.id))),i._refreshTableDataSource(),i._refreshTimeline(),i._ensureVisible(e),c&&s.toString()!==c.toString()&&(i.$.taskTable.selected=c.slice(0)),i._refreshTaskResources(e,o),i._highlightAssignedItem("task",i._getSelection("task",i.selectedTaskIds)),i.$.fireEvent("itemUpdate",{type:"task",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)})}_updateResource(e,t){const i=this;if(!e)return;const a=e.hidden;if(i._setResource(e,t),i._isUpdating)i._isUpdating.type.resource=!0;else{if(i.groupByResources)i._refreshTableDataSource(),i._refreshTimeline();else if(i.taskColumns.find((e=>"resources"===e.value))){const t=i._tasks.filter((t=>t.resources.includes(e.id)));for(let e=0;e<t.length;e++)i._refreshTableColumnsData(t[e],["resources"])}if(a!==e.hidden)return i._createResourceTimeline(),void i.$.fireEvent("itemUpdate",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)});if(i._refreshTableColumnsData(e,void 0,"resource"),i.$.mainSplitter.contains(i.$.resourceTimelineCellsContainer)){const t=i.$.resourceTimelineCellsContainer.children;for(let a=0;a<t.length;a++){const n=t[a];n._resource===e&&i._refreshResourceTimelineContent(e,n)}}i.$.fireEvent("itemUpdate",{type:"resource",id:"string"==typeof e.id||"number"==typeof e.id?e.id:e.$.id,item:i._cloneObject(e)})}}_select(e="task",t){const i=this;if(i.disableSelection||!t)return void i._unselectAll(e);let a,n;"task"===e?(a="selectedTaskIds",n=i._tasks):(a="selectedResourceIds",n=i._resources);const s=n.findIndex((e=>e.$.id===t)),r=i._getSelection(e,i[a]);s<0||(r.indexOf(t)>-1?i.$[`${e}Table`].unselect(t):i.$[`${e}Table`].select(t))}_handleTableSelection(e="task",t){const i=this;if(i.disableSelection||!t.length)return void i._unselectAll(e);let a,n,s,r,o,l=i._selected;l||(l=i._selected={});const d=t[t.length-1],c=l[e]=[];"task"===e?(o=i._tasks,a="selectedTaskIds",n=i.$.taskTimelineCellsContainer.children,s=i.$.timelineTasksContainer.children):(o=i._resources,a="selectedResourceIds",n=i.$.resourceTimelineCellsContainer.children,s=[]);for(let e=0,i=o.length;e<i;e+=1){const i=o[e];t.indexOf(i.$.id)>-1&&c.push(i)}for(let i=0,a=n.length;i<a;i+=1){const a=n[i],o=s[i],l=a._cellObj[e].$.id;d===l&&(r=s[i]),t.indexOf(l)>-1?(a.setAttribute("selected",""),a.setAttribute("aria-selected","true"),o&&o.setAttribute("selected","")):(a.removeAttribute("selected"),a.setAttribute("aria-selected","false"),o&&o.removeAttribute("selected"))}const m=i[a].slice(0);if(i._setSelection(e,t),!i._tableChangeEventFired){const a=document.scrollingElement||document.documentElement,n=a.scrollLeft,s=a.scrollTop;i._highlightAssignedItem(e,t),i.$[`${e}Table`].focus({preventScroll:!0}),window.scrollTo(n,s)}if("task"===e&&r){const e=r._cellStart;if(i.scrollLeft>e.left||e.left+r.offsetWidth>i.scrollLeft+i.$.timeline.offsetWidth){const t=i._timelineCells.indexOf(e);i._scrollTo((i._timelineCells[t-1]?i._timelineCells[t-1]:e).date)}}i._noChangeEvent||i.$.fireEvent("change",{type:e,value:i[a].slice(0),oldValue:m})}_setSelection(e="task",t){const i=this;let[a,n]="task"===e?[i._tasks,"selectedTaskIds"]:[i._resources,"selectedResourceIds"],s=[];for(let e=0,i=t.length;e<i;e+=1){const i=t[e],n=a.find((e=>e.$.id===i));n&&s.push(void 0!==n.id?n.id:i)}i.set(n,s)}_getSelection(e="task",t){const i="task"===e?this._tasks:this._resources;let a=t.slice(0);if(!t||!t.length)return a;for(let e=0,n=i.length;e<n;e+=1){const n=i[e],s=t.indexOf(n.id);s>-1&&(a[s]=n.$.id)}return a}_highlightAssignedItem(e,t){const i=this,[a,n]="task"===e?["resource","_getTaskResources"]:["task","_getResourceTasks"],s=i.$[`${a}Table`],r=i[`_${a}s`];if(!s||!i.$.mainSplitter.contains(s)||!r.length)return;t&&Array.isArray(t)||(t=[]);let o=[];for(let a=0,s=t.length;a<s;a+=1){const s=i._getValidItemAndIndex(t[a],e);s&&(o=o.concat(i[n](s.item).filter((e=>!e.hidden))))}i._tableChangeEventFired=!0,s.selected=o.map((e=>e.$.id)),o.length&&i._ensureVisible(o[0],a),delete i._tableChangeEventFired}_selectResource(e){const t=this,i=t._resources.indexOf(e);if(i<0)return void t._unselectAll("resource");const a=t.$.resourceTimelineCellsContainer.children[i];a&&a.hasAttribute("selected")?t._unselectAllTasks():t.$.resourceTree.focus({preventScroll:!0})}_snapToNearest(e,t){const i=this;if(!(i.snapToNearest&&e&&e.classList&&e.classList.contains("jqx-timeline-task")&&e._cellObj))return;const a=e._cellObj.task,n=a.segments;if(t&&t.classList.contains("jqx-task-segment")){const a=n.indexOf(t._segmentObj),s=0===a,r=a===n.length-1;if(i._handleSnapToNearestSegment(e,t,s?"first":r?"last":void 0),i._refreshTaskSegments(e,[t]),!s&&!r)return;i._refreshTask(e,!0)}else i._handleSnapToNearest(i._getTaskBarCellRange(e),e),i._refreshTask(e);if(n&&n.length>1){for(let e=0,t=n.length;e<t;e+=1)i._snapToNearestDates(n[e],!0);i._validateTaskSegments(a),a.segments.length!==n.length&&i._recycleSegments(a,e),i._setTaskBarSegments(e._cellObj,e,!0),i._setTaskBarProgress(a)}if("project"!==a.type||!a.dragProject)return;const s=i._getProjectTasks(a);if(s&&Array.isArray(s))for(let e=0;e<s.length;e++){const t=i.$.timelineTasksContainer.children[i._tasks.indexOf(s[e])];t&&i._snapToNearest(t)}}_handleSnapToNearestSegment(e,t,i){const a=this,n=a.rightToLeft,s=n?"right":"left",r=parseFloat(e.style[s])||0,o=t,l=a._getSegmentCellRange(t),d=l.cellStart,c=l.cellEnd,m="first"===i,u="last"===i;let h=parseFloat(o.style.width)||o.offsetWidth,g=parseFloat(o.style[s])||0,f=r+g;if(a.hasAttribute("dragged")){const t=c.width-(f+h-c.left);let a;if(f-d.left<=t?(a=d.left-r,o.style[s]=Math.max(0,m?0:a)+"px"):(a=g+t,o.style[s]=Math.max(0,m?0:a)+"px"),i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&(e.style[s]=r+(a-g)+"px"),e.style.width=t+(m?-1:1)*(a-g)+"px"}}else if(a.hasAttribute("resized")){const t=d===c?a._taskBarMinWidth:0;let l;if("left"===a.$.timeline.getAttribute("task-bar-hovered")){if(l=f-d.left,l-=l>=d.width/2?d.width-t:0,f-=l,o.style[s]=Math.max(0,m?0:f-r)+"px",l=f+h>c.left+c.width/2?c.left+c.width-(f+h):c.left-(f+h),o.style.width=Math.max(t,h+l)+"px",i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&!n&&(e.style[s]=f+"px",e.style.width=t+l+"px"),u&&n&&(e.style.width=t+l+"px")}}else if(f>d.left+d.width/2?(f=d.left+d.width,o.style[s]=Math.max(0,m?0:f-r)+"px"):(f=d.left,o.style[s]=Math.max(0,m?0:f-r)+"px"),l=f+h-c.left,l=-1*(l-(l>=d.width/2?c.width:t)),o.style.width=h+l+"px",i){const t=parseFloat(e.style.width)||e.offsetWidth;m&&n&&(e.style[s]=f+"px",e.style.width=t+l+"px"),u&&!n&&(e.style.width=t+l+"px")}}}_handleSnapToNearest(e,t){const i=this;if(!e)return;const a=i.rightToLeft?"right":"left",n=e.cellStart,s=e.cellEnd;let r=parseFloat(t.style.width)||t.offsetWidth,o=parseFloat(t.style[a])||0;if(i.hasAttribute("dragged")){const e=s.width-(o+r-s.left);o-n.left<=e?t.style[a]=n.left+"px":t.style[a]=o+e+"px"}else if(i.hasAttribute("resized")){const e=n===s?i._taskBarMinWidth:0;let l;"left"===i.$.timeline.getAttribute("task-bar-hovered")?(l=o-n.left,l-=l>=n.width/2?n.width-e:0,t.style[a]=(o-=l)+"px",l=o+r>s.left+s.width/2?s.left+s.width-(o+r):s.left-(o+r),t.style.width=Math.max(e,r+l)+"px"):(o>n.left+n.width/2?t.style[a]=n.left+n.width+"px":t.style[a]=n.left+"px",o=parseFloat(t.style[a])||0,l=o+r-s.left,l=-1*(l-(l>=n.width/2?s.width:e)),t.style.width=r+l+"px")}}_setDragLimits(e){const t=this,i=t._dragDetails;if(!i)return;const a=i.timelineTask;if(!a||!e)return;const n=t.$.timeline.getAttribute("task-bar-hovered"),s=a._cellObj.task;if(n){if(s.disableResize)return void delete t._dragDetails;const e=t._getTaskBarSizeLimits(a,n);i.min.width=e.min,i.max.width=e.max,t._setSegmentLimits(n);const r=t._createDelimiter("min",n),o=t._createDelimiter("max",n);r&&a.appendChild(r),o&&a.appendChild(o)}else if(e.closest(".jqx-task-connection-point"))i.timelineTask=void 0;else if(e.closest(".jqx-timeline-task")===a){let e;if(t._connections){const i=t._tasks.indexOf(a._cellObj.task);e=t._connections.some((e=>e.startIndex===i||e.endIndex===i))}if(s.disableDrag||e&&t.autoSchedule&&t.autoScheduleStrictMode)return void delete i.target;i._taskDuration=t._getWorkingTime(s.dateStart,s.dateEnd),a.classList.contains("milestone")&&(i.target="jqx-timeline-task-fill");const n=t._getTaskDragLimits(a),r=t.rightToLeft?t.$.timelineContent.offsetWidth-a.offsetLeft-a.offsetWidth:a.offsetLeft;if(void 0!==n.min&&(i.min.left=n.min,"project"===a._cellObj.task.type&&n.min>r&&(i.min.left=r)),void 0!==n.max&&(i.max.left=n.max,"project"===a._cellObj.task.type&&n.max<r&&(i.max.left=r)),"project"===s.type&&s.dragProject&&!t.synchronized){const e=t._getSubTaskLimits(a);void 0!==e.min&&(i.min.left=i.min.left?Math.max(i.min.left,e.min):e.min),void 0!==e.max&&(i.max.left=i.max.left?Math.min(i.max.left,e.max):e.max)}else"milestone"===s.type&&(i.target="jqx-timeline-task-fill");t._setSegmentLimits()}else i.timelineTask=void 0;i.relatedConnections={}}_setSegmentLimits(e){const t=this,i=t._dragDetails;if(!i||!i.segment)return;const a=i.segment;if(a){const n=a.element,s=a.dimensions,r=n.previousElementSibling,o=n.nextElementSibling;if(a.min.width=e?t._taskBarMinWidth:0,t.rightToLeft){if(r)a.min.left="left"===e?s.left+s.width:r.offsetLeft-(e?0:s.width),"right"===e&&(a.max.width=r.offsetLeft-s.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"right");i.min.width=e.min,i.max.width=e.max}if(o)a.max.left="right"===e?a.dimensions.left:o.offsetLeft+o.offsetWidth+s.width,e&&"left"!==e||(a.max.width=s.left+s.width-(o.offsetLeft+o.offsetWidth));else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"left");i.min.width=e.min,i.max.width=e.max}}else{if(r)a.min.left="right"===e?s.left:r.offsetLeft+r.offsetWidth+(e||o?0:s.width),"left"===e&&(a.max.width=s.left+s.width-a.min.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"left");i.min.width=e.min,i.max.width=e.max}if(o)a.max.left="left"===e?s.left+s.width:o.offsetLeft-s.width,e&&"right"!==e||(a.max.width=o.offsetLeft-s.left);else if(!e){const e=t._getTaskBarSizeLimits(i.timelineTask,"right");i.min.width=e.min,i.max.width=e.max}}}}_setScrollBars(){const e=this;e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e.$.taskSplitterItem,e.$.horizontalScrollBar,e.$.verticalScrollBar));const t=e._scrollView.vScrollBar,i=e._scrollView.hScrollBar;i.$.addClass("jqx-hidden"),t.$.addClass("jqx-hidden"),t.hasStyleObserver=!1,i.hasStyleObserver=!1,t.hasResizeObserver=!1,i.hasResizeObserver=!1,t.rightToLeft=i.rightToLeft=e.rightToLeft,i.wait=!1,e._refresh()}_getWorkingTime(e,t){const i=this;if(!e||!t)return;if(!i.adjustToNonworkingTime)return t.getTime()-e.getTime();const a=i.nonworkingHours,n=i.nonworkingDays;function s(e,t){let i,s,r=t.getTime()-e.getTime(),o=new Date(e),l=0;for(;r>0;){const e=Math.min(r,36e5-(60*o.getMinutes()*1e3+1e3*o.getSeconds()+o.getMilliseconds()));if(n.indexOf(o.getDay())>-1)s=new Date(o),s.setHours(0,0,0,0),s.setDate(o.getDate()+1),i=Math.min(e,s.getTime()-o.getTime()),o=new Date(o.getTime()+i),r-=i;else if(a.indexOf(o.getHours())>-1){s=new Date(o);const t=s.getTime();s.setHours(o.getHours()+1,0,0,0),t===s.getTime()&&s.setHours(o.getHours()+2,0,0,0),i=Math.min(e,s.getTime()-o.getTime()),o=new Date(o.getTime()+i),r-=i}else l+=e,r-=e,o=new Date(o.getTime()+e)}return l}if(e.getFullYear()===t.getFullYear())return s(e,t);let r=new Date(e.getFullYear()+1,0,1,0,0,0,0),o=s(e,r);if(t.getFullYear()>r.getFullYear()){const e=Math.max(0,t.getFullYear()-r.getFullYear());for(let t=0;t<e;t++){let e=i._getWorkingDaysBetweenDays(r);o+=60*(24*e-e*i.nonworkingHours.length)*60*1e3,r.setFullYear(r.getFullYear()+1)}}return o+=s(r,t),o}_getWorkingDaysBetweenDays(e){const t=this,i=e.getFullYear(),a=(i%100==0?i%400==0:i%4==0)?366:365;let n=new Date(e),s=0;for(let e=0;e<a;e++)t.nonworkingDays.indexOf(n.getDay())<0&&s++,n.setDate(n.getDate()+1);return s}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.tabIndex=-1:e.tabIndex=e.tabIndex>0?e.tabIndex:0}_setTaskBarLabel(e,t){const i=this;void 0===t&&(t=i._getTaskDOMIndex(e));const a=i.$.timelineTasksContainer.children[t];if(!a)return;const n=a.querySelector(".jqx-task-segments").children;let s=e.segments;Array.isArray(s)&&s&&s.length&&"task"===e.type||(s=[e]);for(let r=0,o=s.length;r<o;r+=1){const o=s[r],l=n[r],d=l?l.getElementsByClassName("jqx-timeline-task-label")[0]:void 0;if(!d)continue;d.firstElementChild||(d.innerHTML="<div></div>");let c=d.firstElementChild;"string"==typeof o.label||"number"==typeof o.label?c.textContent=o.formatFunction?o.formatFunction(o.label||"",t)||"":o.label||"":c.textContent=e.formatFunction?o.formatFunction(e.label||"",t)||"":e.label||"",i.onTaskRender&&i.onTaskRender(e,o,a,l,c),e.onRender&&e.onRender(e,o,a,l,c)}}_setTaskBarProgress(e,t){const i=this;if("number"==typeof t?t=i.$.timelineTasksContainer.children[t]:void 0===t&&(t=i.$.timelineTasksContainer.children[i._getTaskDOMIndex(e)]),!t||!e)return;let a=e.progress;const n=t.querySelector(".jqx-timeline-task-progress-thumb");if(!n)return;a=Math.min(100,Math.max(0,a))||0;const s=e.dateStart.getTime(),r=e.dateEnd.getTime(),o=t.querySelector(".jqx-task-segments").children;let l,d,c=e.segments,m=0;c&&c.length||(c=[e]);for(let e=0,t=c.length;e<t;e+=1){const t=c[e],i=o[e],n=i?i.querySelector(".jqx-timeline-task-progress"):void 0;if(!n)continue;const u=(t.dateStart.getTime()-s)/(r-s)*100,h=(t.dateEnd.getTime()-s)/(r-s)*100,g=Math.max(0,Math.min(100,(a-u)/(h-u)*100));n.style.width=g+"%",n.removeAttribute("value"),i.removeAttribute("show-progress-label"),a>=u?(m=Math.max(u,Math.min(a,h)),l=n,d=i):l||(l=n,d=i)}if(n.style[i.rightToLeft?"left":"right"]="",n.style[i.rightToLeft?"right":"left"]=m+"%",!l||!i.showProgressLabel)return;const u=i.progressLabelFormatFunction;d.setAttribute("show-progress-label",""),l.setAttribute("value",u?u(a)+"":parseFloat(a.toFixed(2))+"%")}_setTaskDeadline(e,t,i){const a=this,n=e.task,{timelineStart:s,timelineEnd:r}=i,o=n.deadline,l=a.$.timelineDeadlines,d=l.children,c=o&&o.getTime&&!isNaN(o.getTime())?o.getTime():void 0;let m;for(let e=0,i=d.length;e<i;e+=1){const i=d[e];if(parseInt(i.getAttribute("task-index"))===t){m=i;break}}if(!c||c<s||c>r)return void(m&&m.remove());const u=a._getTimelineCellByDate(o),[h,g]=a.rightToLeft?["right","left"]:["left","right"];m||(m=document.createElement("div"),m.classList.add("jqx-gantt-chart-task-deadline"),m.setAttribute("task-index",t),l.appendChild(m)),m.setAttribute("date",o.toString()),m.setAttribute("title",a._formatDate(o)),m.style.top=e.top+"px",m.style[g]="",m.style[h]=u.left+(a._getTimelineTaskOffset(u,o)||0)+"px"}_setTaskBarDeadline(e,t){const i=this,a=e.deadline;if(!a||!a.getTime||isNaN(a)||!t)return;const n=e.deadline.getTime()-e.dateEnd.getTime();if(!e.deadline||n>0)return t.removeAttribute("deadline"),void(e.overdue=!1);e.overdue=!0,t.setAttribute("deadline",`${i.localize("overdue")}: ${Math.round(i._convertDuration(Math.abs(n),!0))} ${i.durationUnit+"s"}`)}_setTaskIndicators(e,t,i){const a=this,n=e.task,{timelineStart:s,timelineEnd:r}=i,[o,l]=a.rightToLeft?["right","left"]:["left","right"],d=a.$.taskIndicatorsContainer,c=d.children,m=n.indicators;let u;for(let e=0,i=c.length;e<i;e+=1){const i=c[e];if(parseInt(i.getAttribute("task-index"))===t){u=i;break}}if(!Array.isArray(m))return void(u&&u.remove());const h=document.createDocumentFragment(),g=document.createDocumentFragment();u||(u=document.createElement("div"),u.classList.add("jqx-gantt-chart-indicator"),u.setAttribute("task-index",t),h.appendChild(u));const f=u.children;for(;f.childElementCount>m.length;)f.firstElementChild.remove();for(let t=0,i=m.length;t<i;t+=1){let i=f[t];const n=m[t],d=n.date;if(!d||!d.getTime){i&&i.remove();continue}const c=d.getTime();if(c<s||c>r){i&&i.remove();continue}const u=a._getTimelineCellByDate(d),h=n.label,p=n.className,_=n.icon;i||(i=document.createElement("div"),g.appendChild(i)),i.className="jqx-gantt-chart-task-indicator",i._indicatorObj=n;const T=i.classList;"string"==typeof p&&T.add(p),_?(T.add("icon"),i.style.setProperty("--jqx-gantt-chart-indicator-icon",`'${_}'`)):T.contains("icon")&&(T.remove("icon"),i.style.removeProperty("--jqx-gantt-chart-indicator-icon")),i.textContent=h||"",i.style.top=e.top+"px",i.style[l]="",i.style[o]=u.left+(a._getTimelineTaskOffset(u,d)||0)+"px"}g.childElementCount&&u.appendChild(g),h.childElementCount&&d.appendChild(h)}_setTimelineTaskBar(e,t,i){const a=this,n=e.task,s=void 0===t?a._getTaskDOMIndex(n):t,r=a.$.timelineTasksContainer.children,o=r[s];let l,d;if(0===r.length||!o||!o.classList||!o.classList.contains("jqx-timeline-task"))return;const c=n.dateStart instanceof Date?n.dateStart:new Date(n.dateStart),m=n.dateEnd instanceof Date?n.dateEnd:new Date(n.dateEnd);if(l=!i&&o._cellStart||a._getTimelineCellByDate(c),d=!i&&o._cellEnd||a._getTimelineCellByDate(m),!l||!d)return void o.classList.add("jqx-visibility-hidden");o._cellStart=l,o._cellEnd=d,o.classList.remove("jqx-visibility-hidden");const u=a._getTaskBarDetails(e,l,d);u&&(o.style[a.rightToLeft?"left":"right"]="",o.style[a.rightToLeft?"right":"left"]=u.left+"px",o.style.width=u.width?u.width+"px":"",o.style.top=u.top+"px"),a._setTaskBarSegments(e,o,i)}_setTimelineTaskBaseline(e,t){const i=this,a=e.task,n=i.$.timelineBaselinesContainer;if(!i.showBaseline)return void(n.innerHTML&&(n.innerHTML=""));const s=a.planned,r=n.children;let o;for(let e=0,i=r.length;e<i;e+=1){const i=r[e];if(parseInt(i.getAttribute("task-index"))===t){o=i;break}}if(!s||"milestone"===a.type||!s.dateStart||!s.dateEnd)return void(o&&o.remove());const l=s.dateStart,d=s.dateEnd,c=i._getTimelineCellByDate(l),m=i._getTimelineCellByDate(d);if(!c||!m)return;o||(o=document.createElement("div"),o.classList.add("jqx-gantt-chart-task-baseline"),o.setAttribute("task-index",t),n.appendChild(o));const[u,h]=i.rightToLeft?["right","left"]:["left","right"],g=i._getTaskBarDetails(e,c,m);if(g){const e=o.style;e.width=g.width?g.width+"px":"",e.top=g.top+"px",e[u]=g.left+"px",e[h]=""}o.setAttribute("aria-label",a.label+" Start date: "+i._toISODate(l)+", End date: "+i._toISODate(d))}_setTaskBarSegments(e,t,i){const a=this,n=e.task,s=t.querySelector(".jqx-task-segments").children;let r,o,l=n.segments;if(Array.isArray(l)&&l&&l.length&&"task"===n.type||(l=[n]),1===l.length){const e=s[0].style;return void(e.right=e.left=e.width="")}const d=a.rightToLeft,c=parseFloat(t.style[d?"right":"left"]);let m;for(let e=0,t=l.length;e<t;e+=1){const t=l[e],n=s[e];if(!n)continue;const u=t.dateStart instanceof Date?t.dateStart:new Date(t.dateStart),h=t.dateEnd instanceof Date?t.dateEnd:new Date(t.dateEnd);r=!i&&n._cellStart||a._getTimelineCellByDate(u),o=!i&&n._cellEnd||a._getTimelineCellByDate(h),n._cellStart=r,n._cellEnd=o;const g=a._getTaskBarDetails({task:t},r,o);g&&(n.style[d?"left":"right"]="",n.style[d?"right":"left"]=Math.max(0,g.left-c)+"px",n.style.width=g.width+"px"),m=n}a._setTaskBarDeadline(n,m)}_setCurrentTimeIndicators(){const e=this;if(clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval,e.currentTimeIndicator||e.shadeUntilCurrentTime)e._refreshTimeIndicators(),e._currentTimeIndicatorInterval=setInterval(e._refreshTimeIndicators.bind(e),1e3*e.currentTimeIndicatorInterval);else{const t=e.$.timelineIndicatorsContainer;t&&t.remove()}}_refreshTimeIndicators(){const e=this,t=e.currentTime,i=e.view,a=e._getTodayCellObj(t);let n=e.$.timelineIndicatorsContainer;if(!a)return n&&n.remove(),clearInterval(e._currentTimeIndicatorInterval),void delete e._currentTimeIndicatorInterval;n||(e.$.timelineIndicatorsContainer=n=document.createElement("div"),n.classList.add("jqx-gantt-chart-time-indicators-container"),n.setAttribute("role","presentation")),new Date(a.date);let s,r,o=t.getMinutes();switch(i){case"quarter":case"year":{const e=new Date(t.getFullYear(),t.getMonth()+1,1,0,0,0,0);e.setDate(0),o+=24*t.getDate()*60,s=24*e.getDate()*60;break}case"month":o+=24*(t.getDay()+1)*60,s=10080;break;case"week":o+=60*t.getHours(),s=1440;break;case"day":s=60}r={cellObj:a,minutes:o,max:s,today:t},e._refreshCurrentTimeShader(r),e._refreshCurrentTimeIndicator(r),n.childElementCount||(clearInterval(e._currentTimeIndicatorInterval),delete e._currentTimeIndicatorInterval),n.parentElement||e.$.timelineContent.appendChild(n)}_refreshCurrentTimeIndicator(e){const t=this,i=t.$.timelineIndicatorsContainer;let a=i.querySelector(".jqx-gantt-chart-current-time-indicator");if(!t.currentTimeIndicator||!e)return void(a&&a.remove());const{cellObj:n,minutes:s,max:r}=e;a||(a=document.createElement("div"),a.classList.add("jqx-gantt-chart-current-time-indicator")),t.rightToLeft?a.style.right=n.left+n.width*(s/r)+"px":a.style.left=n.left+n.width*(s/r)+"px",a.setAttribute("aria-label","Current Time Indicator"),a.parentElement||i.appendChild(a),t._setTodayCell(n.date)}_refreshCurrentTimeShader(e){const t=this.$.timelineIndicatorsContainer;let i=t.querySelector(".jqx-gantt-chart-current-time-shader");if(!this.shadeUntilCurrentTime||!e)return void(i&&i.remove());const{cellObj:a,minutes:n,max:s}=e;i||(i=document.createElement("div"),i.classList.add("jqx-gantt-chart-current-time-shader")),i.style.width=a.left+a.width*(n/s)+"px",i.setAttribute("aria-label","Current Time Shader"),i.parentElement||t.appendChild(i)}_setTodayCell(e){const t=this;if(e)e instanceof Date&&(e=e.getTime());else{let i=0;e=t.currentTime,"day"===t.view&&(i=e.getHours()),e.setHours(i,0,0,0),e=e.getTime()}if("number"!=typeof e)return;const i=t.$.timelineViewCells.children;for(let t=0;t<i.length;t++){const a=i[t],n=new Date(a._date);n&&(n.getTime()===e?a.setAttribute("current",""):a.removeAttribute("current"))}}_getTodayCellObj(e){const t=this,i=t.view,a=t._timelineCells;e&&e.getTime||(e=t.currentTime);for(let t=0,n=a.length;t<n;t+=1){const n=a[t],s=n.date;switch(i){case"quarter":case"year":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth())return n;break;case"month":{const t=new Date(e);if(t.setDate(e.getDate()-e.getDay()),e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&t.getDate()===s.getDate())return n;break}case"week":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate())return n;break;case"day":if(e.getFullYear()===s.getFullYear()&&e.getMonth()===s.getMonth()&&e.getDate()===s.getDate()&&s.getHours()===e.getHours())return n}}}_getTaskDOMIndex(e){const t=this.$.timelineTasksContainer.children;if(!e||void 0===e.$.id)return-1;for(let i=0,a=t.length;i<a;i+=1)if(t[i]._cellObj.task===e)return i;return-1}_getTimelineCellByDate(e,t,i){const a=this,n=a._timelineCells;if(!n||0===n.length)return;const s=n.length-1;i=Math.min(s,"number"==typeof i?i:s);for(let s=t=Math.min(i,Math.max(0,"number"==typeof t?t:0));s<=i;s++){const t=n[s];if(!t)continue;const i=t.date;switch(a.view){case"quarter":case"year":if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth())return t;break;case"month":if("day"===a.monthScale){if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate())return t}else{const a=new Date(i);let n=new Date(i);if(n.setDate(n.getDate()+(6-n.getDay())+1),n.setMilliseconds(n.getMilliseconds()-1),e.getTime()>=a.getTime()&&e.getTime()<=n.getTime())return t}break;case"week":if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate())return t;break;case"day":if("hour"!==a.dayScale){if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate()&&i.getHours()===e.getHours()&&i.getMinutes()<=e.getMinutes())return t}else if(i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()&&i.getDate()===e.getDate()&&i.getHours()===e.getHours())return t}}const r=n[0],o=n[n.length-1];return e.getTime()<r.date.getTime()?r:e.getTime()>o.date.getTime()?o:void 0}_refreshViewDetailCell(e,t,i){const a=this,n=a._timelineCells,s=e.date;let r=0,o=0===i?0:void 0;for(void 0===t&&(t=0);t<n.length;t++){const e=n[t],i=a._getCellWidth(e,s);if(i){if("month"===a.view&&"day"===a.monthScale&&s.getMonth()!==e.date.getMonth())break;void 0===o&&(o=e.left+e.width-i),r+=i}else if(e.date.getTime()>s.getTime())break}return a._isLastWeekCellNotFull&&(delete a._isLastWeekCellNotFull,t--),e.width=r,e.left=o,t}_getCellWidth(e,t){const i=this,a=e.date,n=(e,t)=>e.getFullYear()===t.getFullYear(),s=(e,t)=>e.getMonth()===t.getMonth(),r=e.width;switch(i.view){case"month":{if("day"===i.monthScale)return r;let e=new Date(a),o=new Date(e),l=0;for(o.setDate(o.getDate()+(6-e.getDay())+1),o.setMilliseconds(o.getMilliseconds()-1);e.getTime()<=o.getTime();)n(e,t)&&s(e,t)&&l++,e.setDate(e.getDate()+1);if(0===l)return;"day"!==i.monthScale&&(i._isLastWeekCellNotFull=l/7!=1);let d=r*l/7;return d<70?70:d}case"quarter":case"year":if(n(a,t))return r;break;case"week":{const e=new Date(t),n=new Date(t);if(-1!==i.firstDayOfWeek){const t=e.getDay()-i.firstDayOfWeek;e.setDate(e.getDate()-e.getDay()+i.firstDayOfWeek-(t>=0?0:7)),n.setDate(e.getDate()+6)}else e.setDate(t.getDate()-t.getDay()),n.setDate(t.getDate()+(6-t.getDay()));if(a.getTime()>=e.getTime()&&a.getTime()<=n.getTime())return r;break}case"day":if(n(a,t)&&s(a,t)&&a.getDate()===t.getDate())return r}}_getCellByOffsetLeft(e){const t=this._timelineCells;if(!e)return;let i;for(let a=0;a<t.length&&!(t[a].left>=e);a++)i=t[a];return i}_unselectAll(e,t){const i=this,a=i.$[`${e}TimelineCellsContainer`];let n;delete i._selected;const s=a.querySelectorAll(".jqx-timeline-row[selected]");for(let e=0;e<s.length;e++)s[e].removeAttribute("selected");if("task"===e){n="selectedTaskIds";const e=i.$.timelineTasksContainer.querySelectorAll(".jqx-timeline-task[selected]");for(let t=0;t<e.length;t++)e[t].removeAttribute("selected"),e[t].setAttribute("aria-selected","false")}else n="selectedResourceIds";if(i[`_${e}TreeChangeEventFired`]||i.$[e+"Table"].clearSelection(),i._highlightAssignedItem(e),t)return;const r=i[n].slice(0);r.length&&(i[n]=[],i._noChangeEvent||i.$.fireEvent("change",{value:[],oldValue:r,type:e}))}_getSegmentCellRange(e){const t=this;if(!e.classList||!e.classList.contains("jqx-task-segment"))return;const i=e.closest(".jqx-timeline-task");if(!i)return;let a,n,s=i._cellStart,r=i._cellEnd;s&&r||({cellStart:s,cellEnd:r}=t._getTaskBarCellRange(i));const o=t.rightToLeft,l=parseFloat(e.style.width)||e.offsetWidth,d=t._timelineCells;let c=parseFloat(i.style[o?"right":"left"]);c&&!isNaN(c)||(c=i.offsetLeft,o&&(c=t.$.timelineContent.offsetWidth-c));const m=c+parseFloat(e.style[o?"right":"left"])||(o?(parseFloat(i.style.width)||i.offsetWidth)-(e.offsetLeft+e.offsetWidth):e.offsetLeft),u=parseFloat((m+l).toFixed(2));for(let e=d.indexOf(s),t=d.indexOf(r);e<=t;e++){const t=d[e],i=t.left,s=t.width,r=parseFloat((i+s).toFixed(2));if(m>=i&&m<=r&&(a=t),!n&&u>i&&u<=r&&(n=t),a&&n)break}return a||(a=n||d[0]),n||(n=d[d.length-1]),{cellStart:a,cellEnd:n}}_getTaskBarCellRange(e){const t=this;if(!e.classList||!e.classList.contains("jqx-timeline-task"))return;let i=parseFloat(e.style.width)||e.offsetWidth;const a=t._timelineCells,n=t.$.timelineContent,s=parseFloat(e.style[t.rightToLeft?"right":"left"])||(t.rightToLeft?(parseFloat(n.style.width)||n.offsetWidth)-(e.offsetLeft+e.offsetWidth):e.offsetLeft);let r,o;e.classList.contains("milestone")&&(i/=2);const l=parseFloat((s+i).toFixed(2));for(let e=0;e<a.length;e++){const t=a[e],i=t.left,n=t.width,d=parseFloat((i+n).toFixed(2));if(s>=i&&s<=d&&(r=t),!o&&l>i&&l<=d&&(o=t),r&&o)break}return r||(r=e.classList.contains("milestone")&&o?o:a[0]),o||(o=a[a.length-1]),{cellStart:r,cellEnd:o}}_getDateFromCell(e,t,i){if(!t)return new Date;const a=this,n=new Date(t.date);let s,r=0,o=0,l=new Date(n);switch(l.setHours(0,0,0,0),i||(i=a.view),i){case"quarter":case"year":s=new Date(n.getFullYear(),n.getMonth()+1,0).getDate(),r=1,l.setDate(s);break;case"month":"day"===a.monthScale?(r=n.getDate(),s=1):(r=n.getDate(),s=7,l.setDate(l.getDate()+6));break;case"week":s=1,r=n.getDate();break;case"day":s=1/24,r=n.getDate(),o=n.getHours()}l.setHours(23,59,59,999);const d=parseFloat(((e-t.left)/t.width*s).toFixed(12)),c=Math.min(s,Math.floor(d)),m=d%1*24,u=Math.floor(m),h=60*Math.abs(m-u),g=Math.floor(h),f=60*Math.abs(h-g),p=Math.floor(f),_=1e3*Math.abs(f-p),T=Math.floor(_),b=new Date(n.getFullYear(),n.getMonth(),r+c,o+u,g,p,T);return b.getTime()>l?l:b}_getCellDateRange(e){if(!e||!e._date)return;const t=new Date(e._date);let i=new Date(t);switch(i.setHours(0,0,0,0),this.view){case"quarter":case"year":i.setDate(1),i.setMonth(i.getMonth()+1),i.setDate(0);break;case"month":i.setDate(i.getDate()+6);break;case"day":return i.setHours(t.getHours(),59,59,999),{dateStart:t,dateEnd:i}}return i.setHours(23,59,59,999),{dateStart:t,dateEnd:i}}_getTasksJSON(){const e=this;let t=e._tasks,i="project";return function t(a,n){if(!a)return;let s=[];for(let r=0;r<a.length;r++){const o=a[r];let l;if(!o.$[i]&&!n||o.$[i]===n){const i=e._getTaskConnections(o).taskConnections;l=e._cloneObject(o,!0),i.length&&(l.connections=i.map((e=>{const t={target:e.endIndex,type:e.type};return e.lag&&(t.lag=e.lag),t}))),l.tasks=t(e._getProjectTasks(o),o),delete l.$,s.push(l)}}return s}(t)}_cloneObject(e,t){let i={};for(let a in e){let n=e[a];"tasks"!==a&&("connections"!==a?n instanceof Date?i[a]=t?n.toISOString():new Date(n):i[a]=n:i[a]=JSON.parse(JSON.stringify(n)))}return t||delete i.$,i}_setTable(e){const t=this;e||(e=t.$.taskTable);const[i,a]=e===t.$.taskTable?[t.taskColumns,"task"]:[t.resourceColumns,"resource"];if(!t.contains(e))return;if(!i.length)return void(t.$[a+"Table"].dataSource=[]);const n=t._getTableColumns(a);"task"===a&&(e.filterRow=t.filterRow,[e.grouping,e.groupFormatFunction]=t.groupByResources?[!0,t._formatResourceGroups.bind(t)]:[!1,null]),e.isRendered&&e.resetState("expanded"),e.style.setProperty("--jqx-table-row-height",""),e.columns=n,e.dataSource=t._getTableDataSource(a,n),e.wait&&(t.$.taskTable.hasResizeObserver=!1,e.$.virtualizationContainer._scrollView.disableSwipeScroll=!0,e.$.virtualizationContainer.verticalScrollBarVisibility="hidden",e.$.virtualizationContainer.disabled=!0,e.columnMinWidth=t.columnMinWidth,e.columnResize=t.columnResize,e.columnResizeFeedback=t.columnResizeFeedback,e.filtering=t[`${a}Filtering`],e.sort=t.sortFunction,e.sortMode=t.sortMode,e.keyboardNavigation=t.keyboardNavigation,e.selectionByHierarchy=!1,e.selection=!t.disableSelection,e.hideSelectionColumn=!t.showSelectionColumn,e.onKeyboardScroll=(i,a)=>{const n=e===t.$.taskTable?t:t._resourceScrollView;a!==n.scrollTop&&(n.scrollTop=a)},e.wait=!1),e.$.virtualizationContainer.scrollTop="task"===a?t.scrollTop:t.$.resourceVerticalScrollBar.value,t._refresh()}_formatResourceGroups(e){const t=this,i=t._resources,a=e.data.data.resources.split(",");let n=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e],s=t.id+"";a.indexOf(s)>-1&&n.push(t.label||t.value||t.id)}t.resourceGroupFormatFunction?e.template=t.resourceGroupFormatFunction(a):e.template="<strong>"+(n.length?n.join(", "):t.localize("unassigned"))+"</strong>"}_formatResourceGroupLabel(e){const t=this,i=t._resources,a=e.split(",");if(!e)return t.localize("unassigned");let n=[];for(let e=0,t=i.length;e<t;e+=1){const t=i[e],s=t.id+"";a.indexOf(s)>-1&&n.push(t.label||t.value||t.id)}return n.length?n.join(", "):t.localize("unassigned")}_getTableColumns(e="task"){const t=this,i=["dateStart","dateEnd","minDateStart","maxDateStart","minDateEnd","maxDateEnd"],a=["progress","capacity","workload","maxCapacity","minCapacity"];let n="task"===e?t.taskColumns:t.resourceColumns,s=[];"task"===e&&t.groupByResources&&!n.find((e=>"resources"===e.value))&&(n=n.slice(0),n.push({label:"",value:"resources",hidden:!0}));for(let r=0,o=n.length;r<o;r++){const o=n[r],l=o.value,d={};d.label=t.localize(o.label)||o.label,d.dataField=l,l.startsWith("date")||i.indexOf(l)>-1?d.dataType="date":d.dataType="overdue"===l?"boolean":l.startsWith("duration")||a.indexOf(l)>-1?"number":"string",o.hidden&&(d.visible=!1),"function"==typeof o.formatFunction?d.formatFunction=i=>{const a=t._getValidItemAndIndex(i.data.itemId,e).item,n=i.column.toLowerCase();let s=i.value;n.indexOf("date")>-1?s=new Date(s):"resources"===n&&(s=s?s.split(","):[]),i.template=o.formatFunction.call(t,s,a?t._cloneObject(a):void 0)}:["date","number"].indexOf(d.dataType)>-1?d.formatFunction=i=>{const a=t._getValidItemAndIndex(i.data.itemId,e).item,n=t._formatColumnData(t._cloneObject(a),o);i.template=n}:"overdue"===l&&(d.formatFunction=e=>{const t=e.cell;e.value+""=="true"?t.setAttribute("overdue",""):t.removeAttribute("overdue"),e.value=""},d.width=t._taskDefaultHeight),o.size&&(d.width=o.size),s.push(d)}return s}_getTableDataSource(e="task",t){const i=this,a="task"===e?i._getTableData(i._tasks,i.taskColumns,e):i._getTableData(i._resources,i.resourceColumns,e),n=i.groupByResources,s=(()=>{let e=[];e.push("itemId: string"),e.push("projectId: string"),e.push("itemIndex: number"),n&&e.push("resources: string");for(let i=0,a=t.length;i<a;i+=1){const a=t[i];e.push(`${a.dataField}: ${a.dataType}`)}return e})();return i.groupByResources?new window.JQX.DataAdapter({dataFields:s,dataSource:a,groupBy:["resources"],id:"itemId"}):new window.JQX.DataAdapter({dataFields:s,dataSource:a,keyDataField:"itemId",parentDataField:"projectId",id:"itemId"})}_refreshTableDataSource(e="task"){const t=this,i="task"===e?t.$.taskTable:t.$.resourceTable;t.contains(i)&&(i.resetState("expanded"),i.dataSource=t._getTableDataSource(e,t._getTableColumns(e)))}_refreshColumnsHeaders(e){const t=this;e||(e="task");const i=t.$[`${e}Table`].columns,a=t[`${e}Columns`];for(let e=0,n=i.length;e<n;e++)i[e].label=t.localize(a[e].label)||a[e].label;!arguments.length&&t.$.mainSplitter.contains(t.$.resourceSplitter)&&t._refreshColumnsHeaders("resource")}_getTaskResourceIds(e){const t=e.resources,i=this._resources.map((e=>e.id));let a=[];if(Array.isArray(t))for(let e=0,n=t.length;e<n;e+=1){const n=t[e].id||t[e];i.indexOf(n)>-1&&a.push(n)}return a.sort()}_getTableData(e,t,i){const a=this,n=a.groupByResources;i||(i="task");const s=t.map((e=>e.value));let r=[],o=[];for(let l=0,d=e.length;l<d;l+=1){const d=e[l];if(d.hidden||n&&d.disableResources)continue;const c={},m=d.$.project,u=a._getTaskResourceIds(d);for(let e=0,n=s.length;e<n;e+=1)c[s[e]]=a._formatColumnData(d,t[e],i);c.expanded=n||d.expanded,c.itemId=d.$.id||d.id||"",c.itemIndex=l,u&&u.length?c.resources=u.toString():delete c.resources,d.$&&m&&(m.$.id?c.projectId=d.$.project.$.id:o.push(((e,t)=>{e.projectId=t.$.id}).bind(null,d,m))),r.push(c)}for(let e=0,t=o.length;e<t;e+=1)o[e]();return r}_formatColumnData(e,t){const i=this,a=t.value;let n=e[a];if(a){const e=(a+"").toLowerCase();if(e.indexOf("date")>-1||t.dateFormat)return i._formatDate(n,t);if(e.indexOf("duration")>-1||t.numberFormat){const e=parseFloat(n.toFixed(1));return t.numberFormat?i._formatNumber(e,t.numberFormat):e}}return null!=n?n.toString():i.localize("unassigned")}_formatDate(e,t){const i=this;if(e=Date.parse(e),!isNaN(e)){let a=t?t.dateFormat:void 0;if("string"==typeof a)return new JQX.Utilities.DateTime(new Date(e)).toString(a);if("object"==typeof a)a=t.dateFormat;else{const e=i.view;a={year:"numeric",month:"2-digit",day:"numeric"},["day","week"].indexOf(e)>-1&&(a.hour="numeric",a.minute="numeric",a.second="numeric")}return new Intl.DateTimeFormat(i.locale,a).format(new Date(e))}}_formatNumber(e,t,i){const a=this;if("object"==typeof t)return new Intl.NumberFormat(a.locale,t).format(""+e);i||(i={percentSymbol:"%",currencySymbol:"$",currencySymbolPosition:"before",decimalSeparator:".",thousandsSeparator:","});const n=e=>"number"==typeof e&&isFinite(e);if(""===t||null===t)return e;let s;n(e)||(e*=1),t.length>1&&(s=parseInt(t.slice(1),10));let r={},o=t.charAt(0).toUpperCase();switch(r.thousandsSeparator=i.thousandsSeparator,r.decimalSeparator=i.decimalSeparator,o){case"D":case"d":case"F":case"f":r.decimalPlaces=s;break;case"N":case"n":r.decimalPlaces=0;break;case"C":case"c":r.decimalPlaces=s,"before"===i.currencySymbolPosition?r.prefix=i.currencySymbol:r.suffix=i.currencySymbol;break;case"P":case"p":r.suffix=i.percentSymbol,r.decimalPlaces=s;break;default:throw"Bad number format specifier: "+o}if(n(e)){const t=e<0;let i=e+"";const a=r.decimalSeparator?r.decimalSeparator:".";let s;if(n(r.decimalPlaces)){var l=r.decimalPlaces,d=Math.pow(10,l);if(i=(e*d).toFixed(0)/d+"",s=i.lastIndexOf("."),l>0)for(s<0?(i+=a,s=i.length-1):"."!==a&&(i=i.replace(".",a));i.length-1-s<l;)i+="0"}else{let t=e+"";s=t.lastIndexOf("."),s>0&&void 0===l&&"."!==a&&(t=t.replace(".",a))}if(r.thousandsSeparator){const e=r.thousandsSeparator;s=i.lastIndexOf(a),s=s>-1?s:i.length;let n=i.substring(s),o=-1;for(var c=s;c>0;c--)o++,o%3==0&&c!==s&&(!t||c>1)&&(n=e+n),n=i.charAt(c-1)+n;i=n}return i=r.prefix?r.prefix+i:i,i=r.suffix?i+r.suffix:i,i}return e}_validateDate(e,t){return e[t]=this._dateValidator(void 0,e[t]),e[t]&&!isNaN(e[t].getTime())||(e[t]=void 0),e[t]}_validateTaskProperties(e,t){const i=this;if(e.$={},e.tasks instanceof Array&&e.tasks.length>0?e.type="project":(!e.type||["project","task","milestone"].indexOf(e.type)<0)&&(e.type="task"),i._validateTaskDuration(e),void 0===e.hidden&&t&&(e.hidden=t.hidden),e.hidden=!!e.hidden,void 0===e.resources?e.resources=[]:e.resources=[e.resources].reduce(((e,t)=>e.concat(t)),[]),"project"===e.type?e.expanded=!!e.expanded:delete e.expanded,e.progress=Math.min(Math.max(0,parseFloat(e.progress)||0),100),i._validateTaskDates(e,t),i._validateTaskSegments(e),i._validateTaskIndicators(e),i._validateTaskPlannedDates(e),e.deadline){const t=i._validateDate(e,"deadline");!t||isNaN(t.getTime())?delete e.deadline:e.dateEnd&&(e.overdue=e.deadline.getTime()-e.dateEnd.getTime()<0)}else e.overdue=!1,delete e.deadline;if(!e.dateStart&&!e.dateEnd&&"project"===e.type&&!e.synchronized)return;const a=e.connections;if(a instanceof Array){for(let e=0;e<a.length;e++){const t=a[e],i=t.target="string"==typeof t.target?t.target:parseInt(t.target),n=t.type=parseInt(t.type);null==i||"number"==typeof i&&isNaN(i)||isNaN(n)?(a.splice(a.indexOf(t),1),e--):t.lag=parseInt(t.lag)||0}e.connections=e.connections.map((e=>Object.assign({},e)))}else e.connections=[];return e.class=e.class?e.class+"":"",e.class=void 0!==e.class&&null!==e.class?e.class:"",e}_validateTaskIndicators(e){const t=this,i=e.indicators;if(!i||!Array.isArray(i)||!i.length)return void delete e.indicators;let a=[];for(let e=0,n=i.length;e<n;e+=1){const n=i[e];if("object"!=typeof n)continue;const s=t._validateDate(n,"date");s&&s.getTime&&!isNaN(s.getTime())&&a.push(n)}e.indicators=a}_validateTaskSegments(e){const t=this,i=e.segments;if(!i||!Array.isArray(i)||i.length<2||"task"!==e.type)return void delete e.segments;const a=t.nonworkingDays.length>0||t.nonworkingHours.length>0;let n,s=[],r=[];for(let e=0,a=i.length;e<a;e+=1){const a=i[e];if("object"!=typeof a)continue;let n=parseFloat(a.duration);isNaN(n)&&delete a.duration,t._validateTaskDates(a),a.dateStart&&a.dateEnd&&s.push(a)}s.sort(((e,t)=>e.dateStart.getTime()-t.dateStart.getTime()));for(let i=0,o=s.length;i<o;i+=1){const o=s[i];let l=o.dateStart,d=o.dateEnd;o.dateStart=l=new Date(Math.max(e.dateStart.getTime(),l.getTime())),o.dateEnd=d=new Date(Math.min(e.dateEnd.getTime(),d.getTime())),n&&n.dateEnd.getTime()>l.getTime()&&(o.dateStart=l=new Date(n.dateEnd.getTime()+1e3),l.getTime()>=d.getTime())||l.getTime()>d.getTime()||(o.duration=t._convertDuration(a?t._getWorkingTime(l,d):d.getTime()-l.getTime(),!0),n=o,r.push(o))}r.length<2?delete e.segments:(r[0].dateStart=new Date(e.dateStart),r[r.length-1].dateEnd=new Date(e.dateEnd),e.segments=r)}_validateTaskDuration(e){const t=this;let i=t._convertDuration(parseFloat(e.duration))||0,a=t._convertDuration(parseFloat(e.minDuration))||0,n=t._convertDuration(parseFloat(e.maxDuration))||0;a&&n&&(n=Math.max(a,n)),i&&(a?i=Math.max(a,i):n&&(i=Math.min(i,n))),e.duration=t._convertDuration(i,!0),e.minDuration=t._convertDuration(a,!0),e.maxDuration=t._convertDuration(n,!0)}_validateTaskDates(e,t){const i=this,a=i._convertDuration(e.minDuration),n=i._convertDuration(e.maxDuration);let s=i._convertDuration(e.duration);if(void 0!==e.minDateStart&&(e.minDateStart=i._validateDate(e,"minDateStart")),void 0!==e.maxDateStart&&(e.maxDateStart=i._validateDate(e,"maxDateStart")),e.minDateStart&&e.maxDateStart&&(e.maxDateStart=new Date(Math.max(e.minDateStart.getTime(),e.maxDateStart.getTime()))),void 0!==e.minDateEnd&&(e.minDateEnd=i._validateDate(e,"minDateEnd")),void 0!==e.maxDateEnd&&(e.maxDateEnd=i._validateDate(e,"maxDateEnd")),e.minDateEnd&&e.maxDateEnd&&(e.maxDateEnd=new Date(Math.max(e.minDateEnd.getTime(),e.maxDateEnd.getTime()))),e.dateStart=i._validateDate(e,"dateStart"),e.dateEnd=i._validateDate(e,"dateEnd"),e.dateStart||(e.minDateStart?e.dateStart=e.minDateStart:e.maxDateStart?e.dateStart=e.maxDateStart:e.dateStart=i.dateStart),e.dateEnd||(e.minDateEnd?e.dateEnd=e.minDateEnd:e.maxDateEnd&&(e.dateEnd=e.maxDateEnd)),e.minDateStart&&(e.dateStart=new Date(Math.max(e.minDateStart.getTime(),e.dateStart.getTime()))),e.maxDateStart&&(e.dateStart=new Date(Math.min(e.maxDateStart.getTime(),e.dateStart.getTime()))),e.minDateEnd&&(e.dateEnd=new Date(Math.max(e.minDateEnd.getTime(),e.dateEnd.getTime()))),e.maxDateEnd&&(e.dateEnd=new Date(Math.min(e.maxDateEnd.getTime(),e.dateEnd.getTime()))),e.dateStart&&(i.min&&(s=Math.min(e.dateStart.getTime()-i.min.getTime(),s),e.duration=i._convertDuration(s,!0)),i.max&&(s=Math.min(i.max.getTime()-e.dateStart.getTime(),s),e.duration=i._convertDuration(s,!0))),!e.dateStart&&s&&e.dateEnd&&(e.dateStart=new Date(e.dateEnd.getTime()-s)),"task"!==e.type||e.dateStart&&!isNaN(e.dateStart.getTime())||!t||(e.dateStart=new Date(t.dateStart)),a&&e.dateStart)if(i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)){const t=i._getTaskWorkingDateEnd(e,a);e.dateEnd=new Date(Math.max(e.dateEnd?e.dateEnd.getTime():0,t.getTime()))}else e.dateEnd=new Date(Math.max(e.dateEnd?e.dateEnd.getTime():0,e.dateStart.getTime()+a));if(s&&e.dateStart&&(i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)?e.dateEnd=i._getTaskWorkingDateEnd(e,s):e.dateEnd=new Date(e.dateStart.getTime()+s)),s||n){let t;t=i.adjustToNonworkingTime&&(i.nonworkingDays.length>0||i.nonworkingHours.length>0)?i._getTaskWorkingDateEnd(e,Math.max(s,n)):new Date(e.dateStart.getTime()+Math.max(s,n)),e.dateEnd.getTime()>t.getTime()&&(e.dateEnd=t)}"task"===e.type&&!e.dateEnd&&t&&(e.dateEnd=new Date(t.dateEnd)),e.dateStart=i._minMaxDateValidator(e.dateStart),e.dateEnd=i._minMaxDateValidator(e.dateEnd),"milestone"===e.type&&(e.dateStart=i._validateDate(e,"dateStart"),e.dateEnd=i._validateDate(e,"dateEnd"),e.dateStart=e.dateEnd=new Date(Math.max(e.dateStart?e.dateStart.getTime():0,e.dateEnd?e.dateEnd.getTime():0))),(e.dateStart||e.dateEnd||"project"!==e.type||e.synchronized)&&("milestone"!==e.type&&e.dateStart&&(e.dateEnd&&e.dateStart.getTime()>e.dateEnd.getTime()||!e.dateEnd)&&(e.dateEnd=new Date(e.dateStart.getTime()+36e5*("day"===i.view?1:24))),e.dateStart&&e.dateEnd&&(e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0)))}_validateTaskPlannedDates(e){const t=this;if(!e)return;const i=e.type,a=e.planned;if("milestone"===i||!a)return;const n=t._validateDate(a,"dateStart"),s=t._validateDate(a,"dateEnd");n&&s&&(a.duration=t._convertDuration(t.nonworkingDays.length>0||t.nonworkingHours.length>0?t._getWorkingTime(n,s):s.getTime()-n.getTime(),!0))}_synchronizeProjectDates(e,t){const i=this;if(e){void 0===t&&(t=i._getProjectTasks(e));for(let n=0,s=t.length;n<s;n+=1){const s=t[n];e.synchronized&&(s.dateStart&&(e.dateStart=a(s,"dateStart","min")),s.dateEnd&&(e.dateEnd=a(s,"dateEnd","max")),s.minDateStart&&(e.minDateStart=a(s,"minDateStart","max")),s.maxDateStart&&(e.maxDateStart=a(s,"maxDateStart","min")),s.minDateEnd&&(e.minDateEnd=a(s,"minDateEnd","max")),s.maxDateEnd&&(e.maxDateEnd=a(s,"maxDateEnd","min")),e.dateStart&&e.dateEnd&&(e.duration=i._convertDuration(i.nonworkingDays.length>0||i.nonworkingHours.length>0?i._getWorkingTime(e.dateStart,e.dateEnd):e.dateEnd.getTime()-e.dateStart.getTime(),!0)))}e.$&&i._synchronizeProjectDates(e.$.project,t)}function a(t,i,a){const n=e[i];let s=t[i];return void 0===n?new Date(s):s instanceof Date?new Date(Math[a](n.getTime(),s.getTime())):void 0}}_synchronizeProjectVisibility(e,t){const i=this;e&&e.hidden&&!t.hidden&&(e.hidden=t.hidden,e.$&&i._synchronizeProjectVisibility(e.$.project,e))}_mouseWheelHandler(e){const t=this,i=(t.shadowRoot||t).querySelector(".jqx-task-popup-window");if(i&&i.modal&&i.opened)return void e.stopPropagation();if(t.disabled||!t.computedHorizontalScrollBarVisibility&&!t.computedVerticalScrollBarVisibility)return;if(e.shiftKey)return void t._handleHorizontalScroll(e);const a=t.$.resourceSplitterItem;t.$.mainSplitter.contains(a)&&a.contains(e.target)?t._handleVerticalScroll(e,!0):t.$.taskSplitterItem.contains(e.target)&&t._handleVerticalScroll(e)}_handleVerticalScroll(e,t){const i=this;let a,n,s,r;if(t){if(a=i.$.resourceVerticalScrollBar,a.classList.contains("jqx-hidden")||a.disabled)return!0;n=a.value,s=a.max,r=i._resourceScrollView}else{if(!i.computedVerticalScrollBarVisibility||i.$.verticalScrollBar.disabled)return!0;n=i.scrollTop,s=i.scrollHeight,r=i}if(0===n&&e.deltaY<0||n===s&&e.deltaY>0)return void e.stopPropagation();const o=i.$[t?"resourceTable":"taskTable"];if(e.stopPropagation(),e.preventDefault(),n+=i._getScrollCoefficient(e,i.offsetHeight),r){const e=o.$.virtualizationContainer;e.scrollHeight!==r.scrollHeight&&(e.scrollHeight=r.scrollHeight),r.scrollTo(n,void 0)}o.scrollTop=n,i._hoveredItem&&i._handleTableItemHover()}_handleHorizontalScroll(e){const t=this;if(!t.computedHorizontalScrollBarVisibility)return!0;const i=t.scrollLeft;(0===i&&e.deltaX<0||i===t.scrollHeight&&e.deltaX>0)&&e.stopPropagation(),e.stopPropagation(),e.preventDefault(),t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth))}_handleHeaderTemplate(e="task"){const t=this;if(!("content"in document.createElement("template")))return void t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}));const i=t.$[`${e}SplitterItemHeader`],a=t.$[`${e}SplitterItem`],n="task"===e?"headerTemplate":"resourcePanelHeaderTemplate";let s=t[n];if(a.removeAttribute("show-header"),i.innerHTML="",!s)return;if("function"==typeof s)return s(i,{}),void(i.innerHTML?a.setAttribute("show-header",""):a.removeAttribute("show-header"));if("string"==typeof s&&(s=document.getElementById(s)),null===s||!("content"in s))return void t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:n}));let r=document.importNode(s.content,!0);if(a.setAttribute("show-header",""),t.shadowRoot)return i.innerHTML="<slot></slot>",void t.appendChild(r);i.appendChild(r)}_handleCollapseExpandMethods(e,t){const i=this,a=i._tasks;if(null==e||!a||!a.length)return;const n=i._getValidItemAndIndex(e);if(!n||!n.item)return void i.error(i.localize("incorrectArgument",{elementType:i.nodeName.toLowerCase(),methodName:"collapse",argumentName:"task"}));let s=n.item;"project"!==s.type&&(s=s.$.project),s&&(s.hidden?s.expanded="expand"===t:i.$.taskTable["expand"===t?"expandRow":"collapseRow"](s.$.id))}_getValidItemAndIndex(e,t="task"){const i=this,a="task"===t?i._tasks:i._resources;let n;if(null==e||!a||!a.length)return{};if("string"==typeof e||"number"==typeof e){const t=e.toString();let i,s;for(let n=0,r=a.length;n<r;n+=1){const r=a[n];if(!i){const a=r.id;if(null!=a&&a.toString&&a.toString()===t){i=r,e=n;break}}r.$.id===t&&(s=r,e=n)}n=i||s}else"object"==typeof e&&(n=a[i._getItemIndex(e,t)],e=a.indexOf(n));return{item:n,index:e}}_horizontalScrollbarHandler(e){const t=this,i=t._getScrollLeft(e.detail.value);e.stopPropagation&&e.stopPropagation(),t.$.timelineHeader.scrollLeft=t.$.taskTimelineContainer.scrollLeft=i,t.$.mainSplitter.contains(t.$.resourceTimelineHeader)&&(t.$.resourceTimelineHeader.scrollLeft=t.$.resourceTimelineContent.scrollLeft=i),t._recycle(e),e.context.min!==e.context.value?e.context.max===e.context.value&&(t._handleInfiniteTimeline(),t.$.fireEvent("scrollRightReached")):t.$.fireEvent("scrollLeftReached")}_verticalScrollbarHandler(e){const t=this,i=e.target,a=Math.round(e.detail.value);e.stopPropagation&&e.stopPropagation(),t._refreshing||(i&&i===t.$.resourceVerticalScrollBar?t.$.resourceTable.scrollTop=t.$.resourceTimelineContent.scrollTop=a:(t.$.taskTimelineContainer.scrollTop=a,t.$.taskTable.scrollTop=a),t._recycle(e),e.context.max!==e.context.value?e.context.min===e.context.value&&t.$.fireEvent("scrollTopReached"):t.$.fireEvent("scrollBottomReached"))}_handleInfiniteTimeline(){const e=this,t=e._timelineCells;if(!e.infiniteTimeline||!t||!t.length)return;const i=e.infiniteTimelineStep,a=t[t.length-1].date;switch(e.view){case"quarter":case"year":a.setMonth(a.getMonth()+i);break;case"month":a.setDate(a.getDate()+7*i);break;case"week":a.setDate(a.getDate()+i);break;case"day":a.setHours(a.getHours()+i)}e.set("dateEnd",a),e._createTimelineCells(),e._recycleTimelineTasks(!0),e.$.mainSplitter.contains(e.$.resourceSplitter)&&e._refreshResourceTimeline(),e._refresh()}_nonworkingDayValidator(e,t){return this._nonworkingDateTimeValidator(e,t)}_nonworkingTimeValidator(e,t){return this._nonworkingDateTimeValidator(e,t,!0)}_nonworkingDateTimeValidator(e,t,i){const a=this,[n,s,r]=i?[0,23,24]:[0,6,7];let o=[];function l(e){let t=Math.max(n,Math.min(s,parseInt(e[0]))),i=Math.max(n,Math.min(s,parseInt(e[1])));if(!isNaN(t)&&!isNaN(i)){for(;t!==i;)o.push(t),t=t===s?n:++t;o.push(t)}return o}for(let e=0;e<t.length;e++){const i=t[e];"number"!=typeof i||isNaN(i)?"string"==typeof i?o=l(i.split("-").map((e=>parseInt(e)))):Array.isArray(i)&&(o=l(i)):o.push(Math.max(n,Math.min(s,parseInt(i))))}return o.length===r&&(o.pop(),a.warn(a.localize("invalidNonworkingRange",{elementType:a.nodeName.toLowerCase(),property:i?"nonworkingHours":"nonworkingDays"}))),o}});
91
91
 
92
92
  /***/ }),
93
93
 
@@ -108,7 +108,7 @@ JQX("jqx-input",class extends JQX.BaseElement{static get properties(){return{aut
108
108
  /***/ 5707:
109
109
  /***/ (() => {
110
110
 
111
- JQX("jqx-list-item",class extends JQX.ContentElement{static get properties(){return{alternationIndex:{value:-1,type:"int"},color:{value:"",type:"string"},displayMode:{allowedValues:["plain","checkBox","radioButton"],value:"plain",type:"string"},grouped:{value:!1,type:"boolean"},selected:{value:!1,type:"boolean"},value:{value:"",type:"string"},label:{value:"",type:"string"},details:{value:"",type:"string"},group:{value:"",type:"string"},hidden:{value:!1,type:"boolean"},readonly:{value:!1,type:"boolean"}}}get hasStyleObserver(){return!1}get enableShadowDOM(){return!1}get _focused(){const e=this;return void 0===e.__focused&&(e.__focused=!1),e.__focused}set _focused(e){const t=this;t.__focused=e,e?(t.setAttribute("focus",""),t.ownerListBox&&t.ownerListBox.ownerElement&&JQX.ComboBox&&t.ownerListBox.ownerElement instanceof JQX.ComboBox&&t.ownerListBox.ownerElement.$.input.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focus")}template(){return'<div id="container">\n <span id=\'itemInput\' class=\'jqx-input jqx-hidden\'></span>\n <span class="jqx-overlay" id="overlay"></span>\n <div id="itemContainer" class="jqx-content jqx-list-item-container"><span class="jqx-content-label" inner-h-t-m-l=\'[[innerHTML]]\' role="presentation"><content></content></span><span inner-h-t-m-l=\'[[details]]\' id="details" class="jqx-content-details"></span></div>\n </div>'}appendChild(e){const t=this;if(!t.isCompleted||e.classList&&e.classList.contains("jqx-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}window.jqxBlazor?t.$.itemContainer.appendChild(e):(t.$.itemContainer.innerHTML="",e instanceof HTMLElement&&t.$.itemContainer.appendChild(e))}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}t.parentNode.insertBefore(e,t)}removeChild(e){const t=this;if(!t.isCompleted||e.classList.contains("jqx-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.itemContainer.removeChild(e)}attached(){super.attached(),this.ownerListBox=this.getListBox()}static get listeners(){return{mouseenter:"_itemOnMouseEnter",mouseleave:"_itemOnMouseLeave"}}ready(){super.ready();const e=this;if(e.setAttribute("role","option"),""!==e.label){let t=e.label;t&&"string"==typeof t&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),e.innerHTML=t}else""!==e.innerHTML&&(e.label=e.innerHTML);e._setDisplayMode(e.displayMode),e._setItemColor(),e.$.container.noRipple=!0;const t=e.closest("jqx-list-box");if(t&&t.isRendered){if(cancelAnimationFrame(JQX.ListBox.processTimer),t._inLazyInit||t._isUpdating)return;JQX.ListBox.processTimer=requestAnimationFrame((()=>{t._lazyInitItems()}))}}propertyChangedHandler(e,t,i){const r=this;if(super.propertyChangedHandler(e,t,i),"hidden"===e)i?r.$.addClass("jqx-hidden"):r.$.removeClass("jqx-hidden");else if("color"===e)r._setItemColor();else if("displayMode"===e)r._setDisplayMode(i);else if("label"===e||"value"===e){const t=r.context;r.context=document,"label"===e&&(r.innerHTML=i);const o=r.getListBox();o&&(o._applyTemplate(r),o.onItemUpdated(r)),r.context=t}else if("details"===e){const e=r.context;r.context=document,r.$.details.innerHTML=i;const t=r.getListBox();t&&t.onItemUpdated(r),r.context=e}else if("innerHTML"===e){const e=r.getListBox();e&&e.onItemUpdated(r)}else if("selected"===e)if(i)r.setAttribute("aria-selected",!0);else{const e=r.getListBox();r.readonly||r.disabled||!e||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(e.selectionMode)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}getListBox(){const e=this;if(!JQX.ListBox)return e.getRootNode().host;let t=e.parentNode;for(;t instanceof JQX.ListBox==0&&null!==t;)t=t.parentNode;return!t&&JQX.EnableShadowDOM?e.getRootNode().host:t}_itemOnMouseEnter(){const e=this;!e.disabled&&e.ownerListBox&&(JQX.ListBox.DragDrop.Dragging&&e.ownerListBox.allowDrop&&(JQX.ListBox.DragDrop.DropDetails={item:e,position:"bottom"}),e.ownerListBox.$.verticalScrollBar.thumbCapture||e.ownerListBox.$.horizontalScrollBar.thumbCapture||e.setAttribute("hover",""))}_itemOnMouseMove(e){const t=this;if(t.ownerListBox&&JQX.ListBox.DragDrop.Dragging&&t.ownerListBox.allowDrop&&!JQX.Utilities.Core.isMobile){const i=[].slice.call(t.ownerListBox.getElementsByClassName("jqx-list-item-bottom-line-feedback"));for(let e=0;e<i.length;e++)i[e].$.removeClass("jqx-list-item-line-feedback"),i[e].$.removeClass("jqx-list-item-bottom-line-feedback");if(JQX.ListBox.DragDrop.DropDetails={item:t,position:"top"},!t.ownerListBox._areCSSVarsSupported){if(t.ownerListBox._indexOf(t)===t.ownerListBox._items.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1&&(JQX.ListBox.DragDrop.DropDetails={item:t,position:"bottom"})}return}if(t.$.removeClass("jqx-list-item-line-feedback"),t.$.removeClass("jqx-list-item-bottom-line-feedback"),t.ownerListBox.sorted&&t.ownerListBox.autoSort)return;const r=t.ownerListBox._items.filter((e=>!e.hidden));if(r.indexOf(t)===r.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1?(t.$.addClass("jqx-list-item-bottom-line-feedback"),JQX.ListBox.DragDrop.DropDetails={item:t,position:"bottom"}):arguments[1]||t.$.addClass("jqx-list-item-line-feedback")}else arguments[1]||t.$.addClass("jqx-list-item-line-feedback")}}_itemOnMouseLeave(){const e=this;e.ownerListBox&&(JQX.ListBox.DragDrop.Dragging&&(e.$.removeClass("jqx-list-item-line-feedback"),e.$.removeClass("jqx-list-item-bottom-line-feedback")),e.removeAttribute("hover"))}_setDisplayMode(e){const t=this,i=t.getListBox();if(i){const r="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain";t.displayMode=e=r}"plain"!==e?t.$itemInput.removeClass("jqx-hidden"):t.$itemInput.addClass("jqx-hidden")}_setItemColor(){const e=this,t=e.querySelector(".jqx-content-label"),i=/(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(e.color)?e.color:"";t.style.backgroundColor=i,t.style.color=e._getContrastColor(i)}_getContrastColor(e){if(!e)return"";let t=(i=e.slice(1,3),r=e.slice(3,5),o=e.slice(5,7),[parseInt(i,16),parseInt(r,16),parseInt(o,16)]);var i,r,o;return parseFloat(((.299*t[0]+.61*t[1]+.114*t[2])/255).toFixed(2))>.65?"#000000":"#FFFFFF"}}),JQX("jqx-list-items-group",class extends JQX.ContentElement{static get properties(){return{label:{value:"",type:"string"}}}get enableShadowDOM(){return!1}template(){return'<div id="container" role="presentation">\n <span id="itemsLabel" class="jqx-list-items-group-label">[[label]]</span>\n <div id="listItemsGroupContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-list-items-group-container" role="presentation">\n <content></content>\n </div>\n </div>'}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.appendChild(e)}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.removeChild(e)}getListBox(){let e=this.parentNode;for(;e instanceof JQX.ListBox==0&&null!==e;)e=e.parentNode;return e}attached(){const e=this;super.attached(),e.ownerListBox||(e.ownerListBox=e.getListBox()),e.setAttribute("role","group"),e.$.itemsLabel.id||(e.$.itemsLabel.id=e.id+"Label"),e.setAttribute("aria-labelledby",e.$.itemsLabel.id)}}),JQX("jqx-list-box",class extends JQX.ScrollViewer{static get properties(){return{allowDrag:{value:!1,type:"boolean"},allowDrop:{value:!1,type:"boolean"},alternationStart:{value:0,type:"int"},alternationEnd:{value:0,type:"int"},alternationCount:{value:0,type:"int"},autoSort:{value:!0,type:"boolean"},dataSource:{value:null,type:"any?",reflectToAttribute:!1},dragFeedbackFormatFunction:{value:null,type:"function?"},dragOffset:{value:[10,10],type:"array"},displayLoadingIndicator:{value:!1,type:"boolean"},displayMember:{value:"",type:"string"},shadowDomMode:{allowedValues:["light","shadow"],value:"shadow",type:"string"},dropAction:{value:"move",type:"string",allowedValues:["copy","move","none"]},editable:{value:!1,type:"boolean"},filterable:{value:!1,type:"boolean"},filterCallback:{value:null,type:"function?"},filterMode:{value:"containsIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase","custom"],type:"string"},filterInputPlaceholder:{value:"",type:"string"},grouped:{value:!1,type:"boolean"},groupMember:{value:"",type:"string"},itemTemplate:{value:null,type:"any"},itemHeight:{value:null,type:"number?"},incrementalSearchDelay:{value:700,type:"number?"},incrementalSearchMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string"},itemMeasureMode:{value:"auto",allowedValues:["auto","precise"],type:"string"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},messages:{extend:!0,value:{en:{overridingProperties:'{{elementType}}: Overriding properties {{property1}} and {{property2}} applied. The "{{property1}}" property is used by default.',invalidIndex:'{{elementType}}: "{{method}}" method accepts an index of type number or an Array of numbers.',indexOutOfBound:'{{elementType}}: Out of bound index/indexes in "{{method}}" method.',invalidItem:'{{elementType}}: "{{method}}" method accepts an object or an array of objects as it\'s second parameter.',invalidSettings:'{{elementType}}: "{{method}}" method accepts a string or an object as it\'s second parameter.'}},type:"object"},name:{value:"",type:"string"},placeholder:{value:"No Items",type:"string"},selectedIndexes:{value:[],type:"array"},selectedValues:{value:[],type:"array"},selectionMode:{value:"oneOrManyExtended",allowedValues:["none","oneOrManyExtended","zeroOrMany","oneOrMany","zeroOrOne","zeroAndOne","one","checkBox","radioButton"],type:"string"},selectionChangeAction:{value:"release",allowedValues:["press","release"],type:"string"},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},topVisibleIndex:{value:-1,type:"int"},type:{value:"list",type:"string",defaultReflectToAttribute:!0,readonly:!0},valueMember:{value:"",type:"string"},virtualized:{value:!1,type:"boolean"}}}static get requires(){return{"JQX.ScrollBar":"jqx.scrollbar.js"}}static get styleUrls(){return["jqx.listbox.css","jqx.dropdown.css","jqx.scrollbar.css"]}static get listeners(){return{focus:"_focusHandler",blur:"_blurHandler","container.wheel":"_mouseWheelHandler","editInput.change":"_editInputEventHandler","editInput.blur":"_editInputEventHandler","editInput.keydown":"_editInputEventHandler","horizontalScrollBar.change":"_horizontalScrollbarHandler","itemsInnerContainer.down":"_downHandler","itemsInnerContainer.dblclick":"_dblclickEventHandler","itemsInnerContainer.move":"_itemsContainerMoveHandler","itemsContainer.mouseleave":"_mouseLeaveHandler","itemsInnerContainer.touchmove":"_touchmoveHandler","itemsInnerContainer.touchstart":"_touchstartHandler","document.move":"_moveHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",resize:"_resizeHandler",selectstart:"_selectStartHandler",styleChanged:"_styleChangedHandler",swipeleft:"_swipeLeftHandler",swiperight:"_swipeRightHandler",touchmove:"_overriddenHandler",touchstart:"_overriddenHandler","verticalScrollBar.change":"_verticalScrollbarHandler"}}template(){return'<div id="container" class="jqx-container" role="presentation">\n <div class="jqx-list-box-filter-input-container jqx-hidden" id="filterInputContainer" role="presentation"><input id="filterInput" disabled="[[disabled]]" placeholder=\'[[filterInputPlaceholder]]\' role="searchbox" aria-label="[[filterInputPlaceholder]]"></div>\n <div id="itemsContainer" class="jqx-list-items-container" role="presentation">\n <div id="placeholder" class="jqx-placeholder" role="presentation" aria-hidden="true">[[placeholder]]</div>\n <div id="itemsInnerContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-list-items-inner-container" role="presentation">\n <content></content>\n </div>\n <input type="text" id="editInput" class= "jqx-hidden"/>\n </div>\n <jqx-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="verticalScrollBar" disabled="[[disabled]]" orientation="vertical"></jqx-scroll-bar>\n <jqx-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="horizontalScrollBar" disabled="[[disabled]]"></jqx-scroll-bar>\n <div id="loadingIndicatorContainer" class="jqx-loader-container" role="presentation">\n <span id="loadingIndicator" class="jqx-loader" role="img" aria-label="[[loadingIndicatorPlaceholder]]"></span>\n <span id="loadingIndicatorPlaceHolder" class="jqx-loader-label jqx-hidden">[[loadingIndicatorPlaceholder]]</span>\n </div>\n <input id="hiddenInput" type="hidden" name="[[name]]">\n </div>'}get value(){const e=this;return e.isRendered&&e._selectedItems.length>0?e._selectedItems.map((e=>({label:e.label,value:e.value}))):null}set value(e){const t=this;if(Array.isArray(e)){const i=t.context;t.context=t,t._isUpdating++,t.selectedValues=[],t.clearSelection();for(let i=0;i<e.length;i++){const r=e[i],o=t.getItem(r);o&&("oneOrManyExtended"===t.selectionMode?t._select(o):t.select(o))}return t.context=i,void t._isUpdating--}const i=t.getItem(e);i&&t.select(i)}get _selectedItems(){const e=this,t=[];if(e.isRendered)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected&&t.push(r)}return t}_mouseLeaveHandler(){const e=[].slice.call(this.getElementsByClassName("jqx-list-item-bottom-line-feedback"));for(let t=0;t<e.length;t++)e[t].$.removeClass("jqx-list-item-line-feedback"),e[t].$.removeClass("jqx-list-item-bottom-line-feedback")}_downHandler(e){const t=this;if(t.disabled||t.displayLoadingIndicator||t.readonly)return;let i=e.originalEvent.target,r=null;if(!(i instanceof JQX.ListItem)||i.disabled||i.hidden||i instanceof JQX.ListItemsGroup)for(;i.parentElement;){if(i instanceof JQX.ListItem&&!i.disabled&&!i.hidden&&!(i instanceof JQX.ListItemsGroup)){r=i.dataItem;break}i=i.parentElement}else r=i.dataItem;JQX.ListBox.DragDrop.StartTime=new Date,JQX.ListBox.DragDrop.StartPosition={left:e.pageX,top:e.pageY},r&&(e.stopPropagation(),t.hasRippleAnimation&&(r.readonly||r.disabled||JQX.Utilities.Animation.Ripple.animate(i.$.overlay,e.pageX,e.pageY)),JQX.Utilities.Core.isMobile||"press"!==t.selectionChangeAction||(t._focus(r),t.select(r)),!JQX.ListBox.DragDrop.Feedback&&t.allowDrag&&(JQX.ListBox.DragDrop.DraggedFrom=t,JQX.ListBox.DragDrop.Feedback=document.createElement("span"),t.rightToLeft?JQX.ListBox.DragDrop.Feedback.setAttribute("right-to-left",!0):JQX.ListBox.DragDrop.Feedback.removeAttribute("right-to-left"),t.dragFeedbackFormatFunction?JQX.ListBox.DragDrop.Feedback.innerHTML=t.dragFeedbackFormatFunction(r):JQX.ListBox.DragDrop.Feedback.appendChild(r.offsetHeight?r.cloneNode(!0):t._createItem(r)),JQX.ListBox.DragDrop.Item=r,JQX.Utilities.Extend(JQX.ListBox.DragDrop.Feedback).addClass("jqx-popup jqx-list-item jqx-list-item-feedback")))}_dblclickEventHandler(e){const t=this;if(!t.editable)return;const i=e.target.closest("jqx-list-item");i instanceof JQX.ListItem&&!i.disabled&&!i.readonly?(t.$.editInput.dir=t.rightToLeft?"rtl":"ltr",t.$.editInput.style.width=t.$.itemsInnerContainer.offsetWidth+"px",t.$.editInput.owner=i,t.$.editInput.value=i.label,t.$.editInput.style.height=i.offsetHeight+"px",t.$.editInput.style.top=i.offsetTop+t.$.itemsInnerContainer.offsetTop+"px",t.$.editInput.setAttribute("aria-label","Edit item "+i.label),t.$editInput.hasClass("jqx-hidden")&&t.$editInput.removeClass("jqx-hidden"),t.$.editInput.focus({preventScroll:!0})):t.$editInput.addClass("jqx-hidden")}_editInputEventHandler(e){const t=this;if("blur"===e.type||"keydown"===e.type&&"Escape"===e.key)return t.$editInput.hasClass("jqx-hidden")||t.$editInput.addClass("jqx-hidden"),void t.focus();if("keydown"===e.type||t.$editInput.hasClass("jqx-hidden"))return;const i=e.target;if(e.stopPropagation(),i.owner.label!==i.value&&(i.owner.label=i.value,t.itemTemplate&&t._applyTemplate(i.owner),t.dataSource)){const e=i.owner.dataIndex,r=t.dataSource[e];r&&(t.displayMember?r[t.displayMember]=i.value:r.label=i.value)}t.$editInput.addClass("jqx-hidden"),t.$.fireEvent("itemLabelChange",{selected:i.owner.selected,disabled:i.owner.disabled,index:t._indexOf(i.owner),label:i.owner.label,value:i.owner.value})}_pointerUpHandler(e){const t=this;let i=e.originalEvent,r=i.target;(t.shadowRoot||t.isInShadowDOM)&&(r=i.originalEvent?i.originalEvent.composedPath()[0]:i.composedPath()[0]);const o=e=>{const i=e.ownerListBox;i.disabled||i!==t||i.displayLoadingIndicator||"none"===i.selectionMode||e.grouped||e.readonly||(i._focus(e),i.select(e),JQX.ListBox.DragDrop.StartPosition=null,t.$.fireEvent("itemClick",{selected:r.selected,disabled:r.disabled,index:t._indexOf(r),label:r.label,value:r.value}))};if(!(i.target instanceof JQX.ListItem)||i.target.disabled||i.target instanceof JQX.ListItemsGroup){for(;r&&r.parentElement;){if(r instanceof JQX.ListItem&&!r.disabled&&!(r instanceof JQX.ListItemsGroup))return void o(r.dataItem);r=r.parentElement}if(this.shadowRoot&&"shadow"===this.shadowDomMode){const e=i.composedPath();for(let t=0;t<e.length;t++){const i=e[t];i instanceof JQX.ListItem&&!i.disabled&&o(i.dataItem)}}}else o(r.dataItem)}_upHandler(e){const t=this;if(super._upHandler(),!t.disabled&&!t.readonly&&JQX.ListBox.DragDrop.StartPosition){if(JQX.Utilities.Core.isMobile&&!JQX.ListBox.DragDrop.Dragging){const i=Math.abs(e.pageX-JQX.ListBox.DragDrop.StartPosition.left),r=Math.abs(e.pageY-JQX.ListBox.DragDrop.StartPosition.top);let o=i>=0&&i<=3&&r>=0&&r<=3;if(JQX.Utilities.Core.isMobile&&new Date-JQX.ListBox.DragDrop.StartTime>=300&&(o=!1,JQX.ListBox.DragDrop.StartTime=null),o){const i=e.originalEvent.target.closest("jqx-list-box");i?i._pointerUpHandler(e):t._pointerUpHandler(e),JQX.ListBox.DragDrop.StartPosition=null}else{let t=e.originalEvent.target;if(!(e.target instanceof JQX.ListItem)||t.readonly||e.target.disabled||e.target instanceof JQX.ListItemsGroup)for(;t.parentElement;){if(t instanceof JQX.ListItem&&!t.readonly&&!t.disabled&&!(t instanceof JQX.ListItemsGroup)){e.stopPropagation();break}t=t.parentElement}else e.stopPropagation()}}else if(!JQX.Utilities.Core.isMobile&&!JQX.ListBox.DragDrop.Dragging&&"release"===t.selectionChangeAction){const i=(t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target).closest("jqx-list-box");i&&(i.upTimer&&clearTimeout(i.upTimer),t.isInShadowDOM?i?i._pointerUpHandler(e):t._pointerUpHandler(e):i.upTimer=setTimeout((()=>{i?i._pointerUpHandler(e):t._pointerUpHandler(e)})))}if(JQX.ListBox.DragDrop.Feedback){let i;if(JQX.ListBox.DragDrop.Feedback.parentNode&&JQX.ListBox.DragDrop.Feedback.parentNode.removeChild(JQX.ListBox.DragDrop.Feedback),JQX.ListBox.DragDrop.Feedback=null,JQX.Utilities.Core.isMobile&&JQX.ListBox.DragDrop.Dragging)for(let t=0;t<JQX.ListBox.DragDrop.ListBoxes.length;t++){const r=JQX.ListBox.DragDrop.ListBoxes[t],o=r.getBoundingClientRect();if(r.allowDrop&&!r.closest(".jqx-visibility-hidden")&&o.left<=e.clientX&&e.clientX<=o.left+o.width&&o.top<=e.clientY&&e.clientY<=o.top+o.height){i=r;const t=r._items.filter((e=>!e.hidden));for(let i=0;i<t.length;i++){const s=t[i],n=s.getBoundingClientRect();if((t.indexOf(s)===t.length-1||s.parentNode.lastElementChild===s)&&e.clientY>=o.top+s.offsetTop-r.scrollTop+n.height/2&&e.clientY<=o.top-r.scrollTop+s.offsetTop+n.height){JQX.ListBox.DragDrop.DropDetails={item:s,position:"bottom"};break}if(e.clientY>=o.top+s.offsetTop-r.scrollTop&&e.clientY<=o.top+s.offsetTop+n.height-r.scrollTop){JQX.ListBox.DragDrop.DropDetails={item:s,position:"top"};break}}}}if(JQX.ListBox.DragDrop.Dragging){if(JQX.ListBox.DragDrop.DropDetails){let r=JQX.ListBox.DragDrop.DropDetails.item,o=JQX.ListBox.DragDrop.Item;const s=o.ownerListBox;let n=e.originalEvent.target;if(t.isInShadowDOM&&(n=e.originalEvent?e.originalEvent.composedPath()[0]:e.composedPath()[0]),i=!i&&n.closest?n.closest("jqx-list-box"):i,document.body.classList.remove("jqx-dragging"),r.$.removeClass("jqx-list-item-line-feedback"),r.$.removeClass("jqx-list-item-bottom-line-feedback"),i&&r.ownerListBox!==i&&i.items.length>0&&(r=i.items[i.items.length-1]),JQX.ListBox.DragDrop.Item===r||i!==r.ownerListBox&&!JQX.Utilities.Core.isMobile)i&&0===i._items.length&&"none"!==i.dropAction&&("move"===i.dropAction?JQX.ListBox.DragDrop.Item.ownerListBox.removeChild(JQX.ListBox.DragDrop.Item):"copy"===i.dropAction&&(o=o.cloneNode(!0)),i.appendChild(o));else if("none"!==o.ownerListBox.dropAction){r.ownerListBox!==o.ownerListBox&&"move"===o.ownerListBox.dropAction&&JQX.ListBox.DragDrop.Item.ownerListBox.removeChild(JQX.ListBox.DragDrop.Item),"copy"===o.ownerListBox.dropAction&&(o=o.cloneNode(!0)),JQX.ListBox.DragDrop.Item.group=r.group;const e=r.ownerListBox;"checkBox"!==e.selectionMode&&"radioButton"!==e.selectionMode&&e.clearSelection(),"top"===JQX.ListBox.DragDrop.DropDetails.position?e.insertBefore(o,r):r.parentNode.lastElementChild===r?e.appendChild(o):e.appendChild(o,r),e.ensureVisible(o),"checkBox"===e.selectionMode||"radioButton"===e.selectionMode?(e._focus(o),e._refreshSelection()):(e.clearSelection(),e.select(o))}o.selected&&i!==s&&s._refreshSelection();const l=JQX.ListBox.DragDrop.Item,a=l.ownerListBox;l.displayMode="checkBox"===a.selectionMode||"radioButton"===a.selectionMode?a.selectionMode:"plain",a.$.fireEvent("dragEnd",{item:l,target:r,data:JQX.ListBox.DragDrop,previousContainer:s,container:i,originalEvent:e}),a._focus(l)}else{const t=JQX.ListBox.DragDrop.Item,i=t.ownerListBox;t.displayMode="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain",document.body.classList.remove("jqx-dragging"),i.$.fireEvent("dragEnd",{item:t,target:null,data:JQX.ListBox.DragDrop,previousContainer:i,container:i,originalEvent:e}),i._focus(t)}e.preventDefault()}delete JQX.ListBox.DragDrop.DraggedFrom,JQX.ListBox.DragDrop.Dragging=!1,JQX.ListBox.DragDrop.Item=null,JQX.ListBox.DragDrop.DropDetails=null}for(let e=0;e<JQX.ListBox.DragDrop.ListBoxes.length;e++){const t=JQX.ListBox.DragDrop.ListBoxes[e];t._dragInterval&&clearInterval(t._dragInterval)}}}_itemsContainerMoveHandler(e){const t=this;if(JQX.ListBox.DragDrop.Dragging)return t._applyItemFeedback(e),t._moveHandler(e),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}_touchmoveHandler(e){if(JQX.ListBox.DragDrop.Dragging&&e.cancelable)return e.preventDefault(),void e.stopPropagation();super._touchmoveHandler(e)}_applyItemFeedback(e){const t=this,i=e.originalEvent.target,r=i.closest?i.closest("jqx-list-item"):i;JQX.Utilities.Core.isMobile?JQX.ListBox.DragDrop.DropDetails={item:JQX.ListBox.DragDrop.Item,position:"bottom"}:0!==t.items.length&&(r?r._itemOnMouseMove(e):t.items[t.items.length-1]._itemOnMouseMove(e,!0))}_moveHandler(e){const t=this;if(!JQX.ListBox.DragDrop.Feedback||JQX.ListBox.DragDrop.DraggedFrom!==t)return;const i=t.dragOffset;if(JQX.ListBox.DragDrop.Dragging){JQX.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",JQX.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.$.fireEvent("dragging",{item:JQX.ListBox.DragDrop.Item,data:JQX.ListBox.DragDrop,originalEvent:e.originalEvent});for(let t=0;t<JQX.ListBox.DragDrop.ListBoxes.length;t++){const i=JQX.ListBox.DragDrop.ListBoxes[t];i._dragInterval&&clearInterval(i._dragInterval),i._dragInterval=setInterval((function(){const t=i.getBoundingClientRect();t.left<=e.clientX&&t.left+t.width>=e.clientX&&(e.clientY>=t.top&&e.clientY<=t.top+20?i.scrollTop-=2:e.clientY>=t.top+t.height-20&&e.clientY<=t.top+t.height&&(i.scrollTop+=2))}),1)}return e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}{const r=Math.abs(e.pageX-JQX.ListBox.DragDrop.StartPosition.left),o=Math.abs(e.pageY-JQX.ListBox.DragDrop.StartPosition.top),s=new Date-JQX.ListBox.DragDrop.StartTime;let n=r>=5&&r<=15||o>=5&&o<=15;if(JQX.Utilities.Core.isMobile&&(s<300||s>1e3)&&(n=!1),n){JQX.ListBox.DragDrop.Dragging=!0,JQX.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",JQX.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.getShadowRootOrBody().appendChild(JQX.ListBox.DragDrop.Feedback),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation();const r=JQX.ListBox.DragDrop.Item,o=r.ownerListBox;o.$.fireEvent("dragStart",{item:r,data:JQX.ListBox.DragDrop,container:o,previousContainer:o,originalEvent:e.originalEvent}),document.body.classList.add("jqx-dragging")}}}_focusHandler(){this._focused=!0,this.setAttribute("focus","")}_blurHandler(){this._focused=!1,this.removeAttribute("focus")}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.isVirtualized?(t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)):(e.dataItem=e,t.shadowRoot&&"light"===t.shadowDomMode?t.appendChild(e):t.$.itemsInnerContainer.appendChild(e),t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)),t._isUpdating||(t._refreshItems(),t._refreshSelection())}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}i.isVirtualized?(i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)):(e.dataItem=e,t.parentNode.insertBefore(e,t),i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)),i._refreshItems(),i._refreshSelection()}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}if(t.isVirtualized)t._items.splice(t._indexOf(e),1);else if(e.parentNode){const i=t.selectedIndexes.slice(0),r=t.selectedValues.slice(0),o=i.indexOf(e.dataIndex);e.parentNode.removeChild(e),o>-1&&(i.splice(o,1),r.splice(o,1),t.selectedIndexes=i,t.selectedValues=r)}t._refreshItems()}propertyChangedHandler(e,t,i){if("dataSource"===e&&(!i||i&&Array.isArray(i)&&0===i.length))return void this.clearItems();super.propertyChangedHandler(e,t,i);const r=this;switch(e){case"innerHTML":r.clearSelection(),r._dataBind(),r.innerHTML=r.content=JQX.Utilities.Core.html(r.$.content);break;case"dataSource":case"valueMember":case"groupMember":case"displayMember":r.clearSelection(),r._dataBind(),r._applyDefaultSelection();break;case"disabled":case"unfocusable":r._setFocusable();break;case"displayLoadingIndicator":r._setLoadingIndicatorVisibility();break;case"filterable":r._refreshFilter(),r._refreshLayout();break;case"grouped":if(i?r._group():r._ungroup(),"radioButton"===r.selectionMode){if(r.selectedValues.length>0){const e=r.selectedValues;r.clearSelection(),r.select(e[0])}}else r._refreshSelection();r._refreshLayout();break;case"itemTemplate":{if(null===i||""===i)return r._items.map((e=>e.innerHTML=e.label)),delete r._bindingDetails,void r._refreshLayout();const e=r.querySelectorAll("jqx-list-item"),t=function(){r._handleItemTemplate(i)&&(r._items.map((e=>r._applyTemplate(e))),r._refreshLayout()),r.ownerElement&&r.ownerElement._setDropDownSize&&r.ownerElement._setDropDownSize(),r.$.fireEvent("bindingComplete")};0===e.length?t():r._ensureItemsReady(e,t);break}case"selectedIndexes":case"selectedValues":{let o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);if(!r._items||0===r._items.length)return r.selectedIndexes=[],r.selectedValues=[],void(r.$.hiddenInput.value=r.selectedValues.toString());if(r._propertyChanging=!0,"selectedIndexes"===e){o=t.slice(0),r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r._items[t];o&&("oneOrManyExtended"===r.selectionMode||"oneOrMany"===r.selectionMode?(r.selectedIndexes.length>0&&0===e&&r.clearSelection(),r._select(o)):r.select(o))}}else{s=t.slice(0),r.selectedValues=[],r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r.getItem(t);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}}if(r.selectedIndexes.length>0&&r._focus(r._items[r.selectedIndexes[0]]),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(r.selectedIndexes.length>0){const e=r._items[r.selectedIndexes[r.selectedIndexes.length-1]];void 0!==e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}else i.selected=!1,i.disabled=!1,i.index=-1,i.label="",i.value="";r.$.fireEvent("change",i),r._updateTargetValue()}break}case"selectionMode":{const e="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);r._propertyChanging=!0;const n=r.selectedValues;r.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(i)),r.selectedValues=[],r.clearSelection();for(let e=0;e<n.length;e++){const t=n[e],i=r.getItem(t);i&&("oneOrManyExtended"===r.selectionMode?r._select(i):r.select(i))}if(r._items.forEach((t=>t.displayMode=e)),r._recycle(),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(o.length>0){const e=r._items[o[o.length-1]];e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}r.$.fireEvent("change",i),r._updateTargetValue()}r._applyAriaSelected(),"checkBox"!==i&&"radioButton"!==i&&"checkBox"!==t&&"radioButton"!==t||r._refreshLayout();break}case"topVisibleIndex":r._setTopVisibleIndex(i);break;case"autoSort":r._canSort=i;break;case"alternationStart":case"alternationEnd":case"alternationCount":r._refreshItems(),r._refreshLayout();break;case"sortDirection":case"sorted":{r._canSort=!0,i?r._sort():r._unsort();const e=r.selectedValues;r.selectedValues=[],r._refreshSelection();for(let t=0;t<e.length;t++){const i=e[t],o=r.getItem(i);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}r._refreshLayout(),r._canSort=r.autoSort;break}}}_refreshSelection(){const e=this;if(!e._items||0===e._items.length)return;const t=e.selectedValues;e.selectedIndexes=[],e.selectedValues=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected=!1,t.indexOf(r.value)>-1&&e.select(r)}e._recycle()}clearSelection(){const e=this;if(!e._items||0===e._items.length)return;let t=[];for(let i=0;i<e._items.length;i++)e._items[i].selected&&t.push(e._items[i]);e._items.map((e=>e.selected=!1)),e.selectedValues.slice(0);const i=e.selectedIndexes.slice(0);if(e.selectedIndexes=[],e.selectedValues=[],e.$.hiddenInput.value=e.selectedValues.toString(),e._recycle(),e.context!==e){let r={addedItems:[],removedItems:t};if(i.length>0){const t=e._items[i[i.length-1]];t&&(r.selected=t.selected,r.disabled=t.disabled,r.index=e._indexOf(t),r.label=t.label,r.value=t.value)}e.$.fireEvent("change",r),e._updateTargetValue()}}ensureVisible(e){const t=this;if(e)return!("string"==typeof e&&!(e=t.getItem(e))||(t.isVirtualized||t.$.itemsContainer.scrollTop===t.scrollTop||(t.scrollTop=t.$.itemsContainer.scrollTop),e.top+e.height>=t.scrollTop+t.offsetHeight&&(t.scrollTop=t.scrollTop+e.height,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),(e.top<=t.scrollTop||e.top>=t.scrollTop+t.$.itemsContainer.offsetHeight)&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0===t._indexOf(e)||1===t._indexOf(e)&&t._items.length>1&&t._items[0].grouped?(t.scrollTop=0,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)):t._indexOf(e)===t._items.length-1&&(t.scrollTop=t.scrollHeight,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0))}get items(){const e=this;if(!window.__karma__&&!window.karma&&e instanceof Element&&e.isRendered&&e.hasAttribute&&e.hasAttribute("jqx-blazor")){let t=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];t.push({label:r.label,value:r.value})}return t}return e._filteredItems?e._filteredItems:e._items}getItems(){const e=this,t=e._filteredItems?e._filteredItems:e._items;let i=[];if(t&&t.length>0)for(let e=0;e<t.length;e++){const r=t[e];i.push({label:r.label,value:r.value})}return i}ready(){super.ready();const e=this;if(e.shadowRoot&&"light"===e.shadowDomMode){const t=document.createDocumentFragment();[].slice.call(e.$.itemsInnerContainer.children).map((e=>t.appendChild(e))),e.appendChild(t),e.$.itemsInnerContainer.appendChild(document.createElement("slot"))}e._areCSSVarsSupported=JQX.Utilities.Core.CSSVariablesSupport(),e.isUpdating=0,e._scrollView&&(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar),e._scrollView.hScrollBar.$.addClass("jqx-hidden"),e._scrollView.vScrollBar.$.addClass("jqx-hidden"));const t=e._scrollView.vScrollBar,i=e._scrollView.hScrollBar;t.hasStyleObserver=!1,i.hasStyleObserver=!1,t.hasResizeObserver=!1,i.hasResizeObserver=!1,t.wait=!1,i.wait=!1,e._setFocusable()}render(){const e=this;e.setAttribute("role","listbox"),e.setAttribute("aria-orientation","vertical"),e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._keysPressed={},e._incrementalSearchQuery="",e._incrementalSearchItems=[],e._canSort=!0,e._previousEntry="",e._setLoadingIndicatorVisibility(),e._refreshFilter(),e._initializeInnerHTML(),e._dataBind(),e._applyDefaultSelection(),e.enableShadowDOM&&HTMLElement.prototype.appendChild.apply(e,[e.$.hiddenInput]),e.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(e.selectionMode)),super.render()}_lazyInitItems(){const e=this;if(e._inLazyInit)return cancelAnimationFrame(JQX.ListBox.processTimer),void delete JQX.ListBox.processTimer;e._inLazyInit=!0,e.dataSource||(e.clearSelection(),e._dataBind(),e._applyDefaultSelection()),cancelAnimationFrame(JQX.ListBox.processTimer),delete JQX.ListBox.processTimer,e._inLazyInit=!1}_applyDefaultSelection(){const e=this;!e._focusedItem&&e._items&&e._items.length>0&&0===e.selectedIndexes.length&&("one"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"oneOrManyExtended"!==e.selectionMode||e.select(e._items[0]))}attached(){const e=this;super.attached(),JQX.ListBox.DragDrop||(JQX.ListBox.DragDrop={ListBoxes:[]}),JQX.ListBox.DragDrop.ListBoxes.push(e),e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.selectedIndexes.length>0&&e._items&&e.ensureVisible(e._items[e.selectedIndexes[0]])}detached(){const e=this;if(super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),JQX.ListBox.DragDrop&&JQX.ListBox.DragDrop.ListBoxes){const t=JQX.ListBox.DragDrop.ListBoxes.indexOf(e);JQX.ListBox.DragDrop.ListBoxes.splice(t,1)}}_createItem(e,t,i){const r=this,o="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",s=i?{}:document.createElement("jqx-list-item");s.ownerListBox=r,"number"==typeof e&&(e=""+e);const n=function(t,i){return void 0!==e[t]?""+e[t]:e[i]};let l="string"==typeof e?e:n(r.displayMember,"label"),a="string"==typeof e?e:n(r.valueMember,"value"),d=n(r.groupMember,"group");return void 0===l&&(l=void 0!==t?""+t:""),s.label=s.innerHTML=""+l,void 0===a&&(a=void 0!==t?""+t:l),e.color&&(s.color=e.color),s.value=""+a,s.displayMode=o,s.selected=!!e.selected&&e.selected,s.disabled=!!e.disabled&&e.disabled,s.dataItem=s,void 0!==t&&(s.dataIndex=t),r._alternateItem(s),e.title&&(s.title=e.title),d&&(s.group=""+d),s}_alternateItem(e){const t=this,i=t.alternationStart,r=t.alternationEnd>0?t.alternationEnd:1/0;t.alternationCount<=0||(void 0===t._alternationIndexCounter&&(t._alternationIndexCounter=0),e.dataIndex>=i&&e.dataIndex<=r&&(e.alternationIndex=t._alternationIndexCounter++,t._alternationIndexCounter===t.alternationCount&&(t._alternationIndexCounter=0)))}_beginUpdate(){this.isUpdating++}_isUpdating(){return this.isUpdating>0}_endUpdate(){this.isUpdating--}get _scrollHeight(){const e=this;if(0===e._items.length||e._items.filter((e=>!e.hidden)).length<1)return 0;let t=0;if(e.isVirtualized){if(e.__scrollHeight)return e.__scrollHeight;if(0===e._items.length)return 0;e.isUpdating++;const i=e._createItem(e._items[0]);e.$.itemsInnerContainer.appendChild(i);for(let r=0;r<e._items.length;r++){const o=e._items[r];o.hidden?(o.height=0,o.top=t):(e.itemHeight?(e.itemHeight<32&&(e.itemHeight=32),o.height=e.itemHeight):(i.$&&i.$.itemContainer?i.$.itemContainer.firstElementChild.innerHTML=o.label:i.label=o.label,o.height=i.offsetHeight),o.top=t,t+=o.height)}e.$.itemsInnerContainer.removeChild(i),e.__scrollHeight=t-e.$.itemsInnerContainer.offsetHeight,e.filterable&&(e.__scrollHeight+=e.$.filterInput.offsetHeight),t=e.__scrollHeight,e.isUpdating--}else{for(let i=0;i<e._items.length;i++){const r=e._items[i];r.hidden?(r.height=0,r.top=t):(e.itemHeight?"auto"!==e.itemHeight&&(r.height=e.itemHeight,r.style.height=r.height+"px"):r.height=r.offsetHeight,r.top=r.offsetTop,t+=r.height)}t=e.$.itemsInnerContainer.scrollHeight-e.$.itemsInnerContainer.offsetHeight,e.filterable&&t>0&&(t+=e.$.filterInput.offsetHeight),e.__scrollHeight=t}return t}_initializeRecyclingItems(){const e=this;if(!e.dataSource||e.dataSource&&0===e.dataSource.length||!e.isVirtualized)return;let t=0,i=e.offsetHeight||400;e.$.itemsInnerContainer.innerHTML="",e._recyclingItems=[];const r=function(r){for(let o=0;o<r.length;o++){const s=r[o],n=e._createItem(s);if(e.itemHeight&&"auto"!==e.itemHeight&&(n.style.height=e.itemHeight+"px"),e.$.itemsInnerContainer.appendChild(n),t+=n.offsetHeight,n.dataItem=e._items[o],e._recyclingItems.push(n),t>1.5*i)break}};if("function"==typeof e.dataSource){let e=[];for(let t=0;t<100;t++)e.push("");r(e)}else{r(e.dataSource);let o=0;for(;t<1.5*i&&++o<5;)r(e.dataSource)}}dataBind(){const e=this;e.clearSelection(),e._dataBind(),e._applyDefaultSelection()}_dataBind(){const e=this;if(e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),"function"==typeof e.dataSource){e._items=[],delete e._filteredItems;const t=e.dataSource("",(t=>{e.clearItems(),e.insert(0,t)}));t&&Array.isArray(t)&&(e.clearItems(),e.insert(0,t))}if("string"==typeof e.dataSource&&(e.dataSource=JSON.parse(e.dataSource)),null!==e.dataSource&&Array.isArray(e.dataSource)){e.isUpdating++;const t=t=>{e._items=[],e._groups=[],delete e._filteredItems;const i=e.dataSource;for(let r=0;r<i.length;r++){const o=i[r],s=e._createItem(o,r,!t);e._items[r]=s,t&&t.appendChild(s)}};if(e.isVirtualized)t(),e._initializeRecyclingItems();else{const i=document.createDocumentFragment();e.$.itemsInnerContainer.innerHTML="",t(i),e.$.itemsInnerContainer.appendChild(i)}e.isUpdating--}const t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item"),i=function(){e.isUpdating++,e.dataSource||(e._initializeHtmlListItems(),e._initializeHtmlListGroups()),e.grouped&&e._group(),e.sorted&&e._sort(),e._refreshLayout(),e._initializeSelection(),e.isInitialized=!0,e._canSort=e.autoSort,e.isUpdating--,e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&(e._items.map((t=>e._applyTemplate(t))),e._refreshLayout()),e.__onCompleted&&(e._onCompleted=e.__onCompleted,e.__onCompleted=null,e._onCompleted()),e.topVisibleIndex>-1&&e._setTopVisibleIndex(e.topVisibleIndex),e.$.fireEvent("bindingComplete"),e._updateTopVisibleIndex(),0===e._items.length&&e.clearItems(),e._applyAriaSelected()};0===t.length?i():(e._onCompleted&&(e.__onCompleted=e._onCompleted,e._onCompleted=null),e._ensureItemsReady(t,i))}_ensureItemsReady(e,t){const i=this,r=function(){const i=function(t){for(let i=0;i<e.length;i++)e[i].context="node"===t?e[i]:document};i("node"),t(),i()};if(0===e.length)r();else{i._nodesReadyListeners=0;for(let t=0;t<e.length;t++){const o=e[t],s=function(){i._nodesReadyListeners--,0===i._nodesReadyListeners&&(r(),delete i._nodesReadyListeners)}.bind(i);o.isCompleted||(i._nodesReadyListeners++,o._onCompleted=s)}0===i._nodesReadyListeners&&r()}}_initializeInnerHTML(){const e=this;e.$.itemsInnerContainer.innerHTML.indexOf("<option")>=0?e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<optgroup/gi,"<jqx-list-items-group").replace(/<\/optgroup/gi,"</jqx-list-items-group").replace(/<option/gi,"<jqx-list-item").replace(/<\/option/gi,"</jqx-list-item"):e.$.itemsInnerContainer.innerHTML.indexOf("<ul")>=0&&(e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<ul/gi,"<jqx-list-items-group").replace(/<\/ul/gi,"</jqx-list-items-group").replace(/<li/gi,"<jqx-list-item").replace(/<\/li/gi,"</jqx-list-item"))}_initializeHtmlListItems(){const e=this,t=e.shadowRoot&&"shadow"===e.shadowDomMode?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item"),i="checkBox"===e.selectionMode||"radioButton"===e.selectionMode?e.selectionMode:"plain",r=function(e,t,i){return void 0!==e[t]?""+e[t]:e[i]};e._items=[];let o=0;for(let s=0;s<t.length;s++){const n=t[s];n.dataIndex=s,n.label=n.innerHTML,n.dataItem=n,n.top||(n.top=o),n.height||(n.height=n.offsetHeight),o+=n.height,n.value||(n.value=""+s);const l=r(n,e.displayMember,"label"),a=r(n,e.valueMember,"value"),d=r(n,e.groupMember,"group");n.label!==l&&(n.label=l),n.value!==a&&(n.value=a),n.group!==d&&(n.group=d);const c=n.context;n.context=document,n.displayMode=i,n.context=c,e._alternateItem(n),n.selected&&(e.selectedIndexes.push(s),e.selectedValues.push(n.value)),e._items.push(n)}e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._items.map((t=>e._applyTemplate(t)))}_group(){const e=this;e.isUpdating++;let t=[],i=[];e._canSort&&e._unsort();for(let i=0;i<e._items.length;i++){const r=e._items[i];let o=r.group?r.group.trim():r.innerHTML.charAt(0)||r.label.charAt(0);o+=" ",t[o]?t[o].items.push(r):t[t.length++]=t[o]={items:[r],label:o}}if(e.isVirtualized){e._groups=[];for(let e=0;e<t.length;e++){const r=t[e];r.dataIndex=e,r.grouped=!0,r.hidden=!1,r.displayMode="plain",i.push(r);for(let o=0;o<t[e].items.length;o++){const e=r.items[o];e.group=r,i.push(e)}}e._groups=t,e._items=i}else{for(;e.$.itemsInnerContainer.firstChild;)e.$.itemsInnerContainer.removeChild(e.$.itemsInnerContainer.firstChild);const r=document.createDocumentFragment();e._groups=[];for(let o=0;o<t.length;o++){const s=t[o],n=document.createElement("jqx-list-items-group");n.label=s.label,n.dataIndex=o;for(let e=0;e<t[o].items.length;e++){const t=s.items[e];i.push(t),t.group=s.label,n.appendChild(t)}e._groups.push(n),r.appendChild(n)}e._items=i,/Trident|Edge/.test(navigator.userAgent)?setTimeout((function(){e.$.itemsInnerContainer.appendChild(r)}),50):e.$.itemsInnerContainer.appendChild(r)}e.sorted&&e._sort(),e.isUpdating--}_ungroup(){const e=this;e.isUpdating++,e._groups=[],e._canSort&&e._unsort();let t=[];if(e.isVirtualized)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.grouped||t.push(r)}else{const i=document.createDocumentFragment();for(let r=0;r<e._items.length;r++){const o=e._items[r];i.appendChild(o),t.push(o)}t.length>0&&(e.$.itemsInnerContainer.innerHTML="",e.$.itemsInnerContainer.appendChild(i))}e._items=t,e.sorted&&e._sort(),e.isUpdating--}_initializeHtmlListGroups(){const e=this,t=e.$.itemsInnerContainer.querySelectorAll("jqx-list-items-group");e._groups=[];for(let i=0;i<t.length;i++){const r=t[i];r.dataIndex=i,e._groups.push(r)}}_initializeSelection(){const e=this,t=e.selectedIndexes.slice(0),i=e.selectedValues.slice(0);e.clearSelection(),"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!0);for(let r=0;r<e._items.length;r++){const o=e._items[r];(t.indexOf(r)>=0||i.indexOf(o.value||o.label)>=0)&&(e._focusedItem&&(e._focusedItem._focused=!1),e._focusedItem=null,e.select(o))}"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!1)}onItemUpdated(){const e=this;e.isInitialized&&!e._isUpdating()&&(e.isUpdating++,e._refreshLayout(),e.isUpdating--)}_refreshItems(){const e=this;if(e.isInitialized&&!e._isUpdating()){if(e.isUpdating++,e.grouped?e._ungroup():e.sorted&&e._canSort&&e._unsort(),!e.isVirtualized){e._items=[];const t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item");for(let i=0;i<t.length;i++)t[i].dataIndex=i,e._alternateItem(t[i]),e._items.push(t[i])}e.grouped?e._group():e.sorted&&e._sort(),e._refreshLayout(),e.isUpdating--}}_applyIncrementalSearch(e){const t=this;null===t.incrementalSearchDelay||isNaN(t.incrementalSearchDelay)||["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control","Home","End","PageUp","PageDown"].indexOf(e)>-1||(0!==t._incrementalSearchQuery.indexOf(e)&&(t._incrementalSearchQuery+=e),t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t._incrementalSearch(),t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),t.incrementalSearchDelay))}select(e){const t=this;if(("string"!=typeof e||(e=t.getItem(e)))&&("number"!=typeof e||(e=t.getItem(e)))&&!(e.grouped||e.readonly||!t._items.length||e instanceof HTMLElement&&!t.contains(e)&&!t.virtualized)){if("none"===t.selectionMode)return t.selectedIndexes=[],void(t.selectedValues=[]);switch(!t._focusedItem!==e&&"none"!==t.selectionMode&&(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,e._focused=!0),t.selectionMode){case"one":case"zeroAndOne":return(1!==t.selectedIndexes.length||t.selectedIndexes[0]!==t._indexOf(e))&&(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"zeroOrOne":return 1===t.selectedIndexes.length&&t.selectedIndexes[0]===t._indexOf(e)?(t.unselect(e),!0):(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"radioButton":if(t._previouslySelectedIndexes=t.selectedIndexes,t.$.itemsInnerContainer.querySelectorAll("jqx-list-items-group").length>0){const i=e.parentNode;if(!e.selected){for(let e in i.children){const r=i.children[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}if(t.isVirtualized&&t._groups.length>0){const i=e.group;if(!e.selected){for(let e in i.items){const r=i.items[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}return e.selected||(t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e)),delete t._previouslySelectedIndexes,!0;case"oneOrMany":return e.selected?t.selectedIndexes.length>1&&t.unselect(e):t._select(e),!0;case"zeroOrMany":case"checkBox":return e.selected?t.unselect(e):t._select(e),!0;case"oneOrManyExtended":{const i=t.selectedValues;if(t._keysPressed.Control)return t.selectedIndexes.length>1&&e.selected?(t.unselect(e),t._focus(t._items[t.selectedIndexes[0]])):t._select(e),!0;if(t._keysPressed.Shift){const r=t._items[t.selectedIndexes[0]];let o;t.clearSelection();const s=i.indexOf(r.value)>=0||r.selected;if(t._select(r,s),t._indexOf(r)>t._indexOf(e))for(o=t._indexOf(r)-1;o>=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o--}else for(o=t._indexOf(r)+1;o<=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o++}const n=[];for(let e=0;e<i.length;e++)n.push(t.getItem(i[e]));if(n.length>0&&!t._propertyChanging){let r=[];for(let e=0;e<t.selectedValues.length;e++){const o=t.selectedValues[e];i.indexOf(o)<0&&r.push(t.getItem(o))}t.$.fireEvent("change",{addedItems:r,removedItems:n,selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue()}return!0}for(let r=0;r<i.length;r++){const o=i[r],s=t.getItem(o);e!==s&&t.unselect(s)}return t.clearSelection(),t._select(e,i.indexOf(e.value)>=0),!0}}return!1}}_applyTemplate(e,t){const i=this;if(null===i.itemTemplate)return;if("function"==typeof i.itemTemplate)return void i.itemTemplate(e,{label:e.label,value:e.value,index:i._items.indexOf(e)});if(!i._bindingDetails||0===i._bindingDetails.length)return;const r=i._bindingDetails.length;let o,s,n=document.importNode(i._template.content,!0);for(let t=0;t<r;t++){o=n.childNodes[i._bindingDetails[t].childNodeIndex],s=i._bindingDetails[t].bindingString.length;for(let r=0;r<s;r++){const s=i._bindingDetails[t].bindingString[r],n=s.indexOf("label")>=0?e.label:e.value;o.innerHTML=o.innerHTML.replace(s,n)}}e.innerHTML="";for(let t=0;t<n.childNodes.length;t++)n.childNodes[t].outerHTML&&(e.innerHTML+=n.childNodes[t].outerHTML);!1!==t&&(i._scrollHeightTimer&&(clearInterval(i._scrollHeightTimer),i._scrollHeightCounter=0),i._scrollHeightTimer=setInterval((function(){i._lastScrollHeight===i.$.itemsInnerContainer.scrollHeight&&10!==i._scrollHeightCounter||(i._refreshLayout(),clearInterval(i._scrollHeightTimer)),i._lastScrollHeight=i.$.itemsInnerContainer.scrollHeight,i._scrollHeightCounter++}),50))}_filterItems(e,t,i){const r=this,o=r.$.filterInput.value;let s,n;const l=function(){if(0===n.length)return r._filteredItems=[],void(t&&t());s=r._queryItems(o,r.filterMode);for(let e=0;e<n.length;e++)n[e].hidden=!0,n[e].$&&n[e].$.addClass("jqx-hidden");for(let e=0;e<s.length;e++){const t=s[e];t.hidden=!1,n[e].$&&t.$.removeClass("jqx-hidden")}if(r.grouped&&r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=t.items;let o=!0;for(let e=0;e<i.length;e++)i[e].hidden||(o=!1);o&&(t.hidden=!0)}if(r.grouped&&!r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=[].concat(...t.querySelectorAll("jqx-list-item"));let o=!0;for(let e=0;e<i.length;e++)i[e].$.hasClass("jqx-hidden")||(o=!1);o?t.$.addClass("jqx-hidden"):t.$.removeClass("jqx-hidden")}if(r._filteredItems=s,r._refreshLayout(),t&&t(),e)return;const i=r._propertyChanging;r._propertyChanging=!0,r._refreshSelection(),r._propertyChanging=i};if("function"==typeof r.dataSource)if(o||i){const e=function(e){(o||i)&&r.isAttached&&(r._updateListBoxAfterQuery=function(){s=n=r._items,l()},r.clearItems(),r.insert(0,e))},t=r.dataSource(o,e);if(t){if(!o&&!i)return;r._updateListBoxAfterQuery=function(){s=n=r._items,l()},r.clearItems(),r.insert(0,t)}}else r.clearItems(),s=n=r._items,l(),r.$.fireEvent("bindingComplete");else{if(n=r._items,0===n.length)return;l()}}_getNextItem(e){const t=this._items,i=this._items.length;let r=Math.max(e+1,0);for(;r<i;){const e=t[r];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;r++}return t[e]}_getPreviousItem(e){const t=this._items;let i=Math.max(e-1,0);for(;i>-1;){const e=t[i];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;i--}return t[e]}get _scrollWidth(){const e=this,t=e._items;return e.__scrollWidth||(e.__scrollWidth=(()=>{const e=this,i=e.virtualized,r=e.itemMeasureMode;let o=0,s="";function n(t){const i=e._createItem({label:t});i.style.position="absolute",e.$.itemsContainer.appendChild(i),i.label=t,i.style.width="auto",i.isCompleted&&(i.$.itemContainer.style.width="auto");const r=getComputedStyle(i),o=parseInt(r.paddingLeft)+parseInt(r.paddingRight),s=i.$.itemContainer||i,n=s.offsetWidth+s.offsetLeft+o;return i.parentNode.removeChild(i),n}for(let e=0;e<t.length;e++){const l=t[e];if(!l.hidden)if("auto"===r){const e=i?l.label:l.textContent.trim();e.length>s.length&&(s=e)}else o=Math.max(o,n(l.label))}return"auto"===r?n(s):o})()),e.__scrollWidth}update(e,t){const i=this,r=i._items[e];if(r){if("string"==typeof t)r.label=t,void 0===r.value&&(r.value=t);else for(let e in t)"selected"===e&&r[e]!==t[e]?i.select(r):r[e]=t[e],"group"===e&&i._refreshItems();(i.sorted||i.grouped||i.isVirtualized)&&(i._refreshItems(),i._refreshSelection())}else i.error(i.localize("indexOutOfBound",{elementType:i.nodeName.toLowerCase(),method:"update"}))}insert(e,t){const i=this;let r=[];if((!e||e<0)&&(e=0),Array.isArray(t)){i.isUpdating++;const o=0===i._items.length;for(let s=0;s<t.length;s++){const n=t[s],l=i._createItem(n);r.push(l),e>=i._items.length||0===i._items.length||o?i.appendChild(l):i.insertBefore(l,i._items[e])}i.isUpdating--}else{const o=i._createItem(t);r.push(o),e>=i._items.length||0===i._items.length?i.appendChild(o):i.insertBefore(o,i._items[e])}if(r.length>0?(r.map((e=>i._applyTemplate(e))),i._ensureItemsReady(r,(function(){i._refreshItems(),0!==i._items.length&&(i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i._refreshSelection(),i.$.fireEvent("bindingComplete"))}))):i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i.virtualized&&i.filterable){const e=i.context;i.context=i,i.filterable&&(i.$.filterInput.value="",i._filterItems()),i.scrollTop=i.$.itemsContainer.scrollTop=0,i.scrollLeft=i.$.itemsContainer.scrollLeft=i._getScrollLeft(0),i.context=e}}add(e){const t=this;let i=[];if(e&&(!e||0!==e.length)){if(Array.isArray(e)){t.isUpdating++;for(let r=0;r<e.length;r++){const o=e[r],s=t._createItem(o);i.push(s),t.appendChild(s)}t.isUpdating--}else{const r=t._createItem(e);i.push(r),t.appendChild(r)}if(i.length>0?(i.map((e=>t._applyTemplate(e))),t._ensureItemsReady(i,(function(){t._refreshItems(),0!==t._items.length&&(t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t._refreshSelection(),t.$.fireEvent("bindingComplete"))}))):t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t.virtualized&&t.filterable){const e=t.context;t.context=t,t.filterable&&(t.$.filterInput.value="",t._filterItems()),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}else t.virtualized&&t._refreshLayout()}}removeAt(e){const t=this,i=t._items[e];i?(i.selected&&t.unselect(i),t.isVirtualized?t._items.splice(e,1):i.parentNode.removeChild(i),t._refreshItems(),t._refreshSelection(),0===t.selectedIndexes.length&&t._items.length>0&&("oneOrMany"!==t.selectionMode&&"one"!==t.selectionMode&&"oneOrManyExtended"!==t.selectionMode||t.select(t._items[0]))):t.error(t.localize("indexOutOfBound",{elementType:t.nodeName.toLowerCase(),method:"remove"}))}_queryItems(e,t){const i=this,r=[],o=function(r,o){if(r.grouped)return r;switch(t){case"startsWith":if(0===r.label.indexOf(o))return r;break;case"startsWithIgnoreCase":if(0===r.label.toLowerCase().indexOf(o.toLowerCase()))return r;break;case"doesNotContain":if(r.label.indexOf(o)<0)return r;break;case"doesNotContainIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())<0)return r;break;case"contains":if(r.label.indexOf(o)>-1)return r;break;case"containsIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())>-1)return r;break;case"equals":if(0===r.label.localeCompare(o))return r;break;case"equalsIgnoreCase":if(0===r.label.toLowerCase().localeCompare(o.toLowerCase()))return r;break;case"endsWith":if(r.label.endsWith(o))return r;break;case"endsWithIgnoreCase":if(r.label.toLowerCase().endsWith(o.toLowerCase()))return r;break;case"custom":if(i.filterCallback(r,e))return r}return null};if(0===e.length)return i._items;for(let t=0;t<i._items.length;t++){const s=o(i._items[t],e);s&&r.push(s)}return r}_select(e,t){const i=this,r=i.selectedIndexes.indexOf(i._indexOf(e)),o=i.selectedIndexes.slice(0),s=i.selectedValues.slice(0);if(e.selected=!0,-1!==r)return i._recycle(),!1;if(o.push(i._indexOf(e)),s.push(e.value||e.label),i.selectedIndexes=o,i.selectedValues=s,i._recycle(),i.$.hiddenInput.value=s.toString(),!i.isCompleted||t||!i.isInitialized||i._propertyChanging)return;let n=[];if(i._previouslySelectedIndexes){for(let e=0;e<i._previouslySelectedIndexes.length;e++)i.selectedIndexes.indexOf(i._previouslySelectedIndexes[e])<0&&n.push(i._items[i._previouslySelectedIndexes[e]]);delete i._previouslySelectedIndexes}return i.$.fireEvent("change",{addedItems:[e],removedItems:n,selected:e.selected,disabled:e.disabled,index:i._indexOf(e),label:e.label,value:e.value}),i._updateTargetValue(),!0}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const i=e.dataset.property,r=e.value;i&&void 0!==t[i]&&(t[i]=r)}}}_setTopVisibleIndex(e){const t=this;if("number"==typeof e&&(t.topVisibleIndex=Math.max(0,e),e=t._items[t.topVisibleIndex]),!e)return!1;e.top!==t.scrollTop&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop),t.scrollHeight===t.scrollTop&&t._updateTopVisibleIndex())}_updateTopVisibleIndex(){const e=this,t=e.scrollTop+e._scrollView.verticalScrollBar.offsetHeight-e.offsetHeight;let i;if(e.scrollTop<e.scrollHeight/2){for(let r=0;r<e._items.length;r++)if(e._items[r].top>=t){i=e._items[r];break}}else for(let r=e._items.length-1;r>=0&&!(e._items[r].top<t);r--)i=e._items[r];if(i){const t=e.context;e.context=e,e.topVisibleIndex=i.dataIndex,e.context=t}}unselect(e){const t=this;if(!e)return;if("string"==typeof e&&!(e=t.getItem(e)))return;if("none"===t.selectionMode)return void t.clearSelection();const i=t.selectedIndexes.indexOf(t._indexOf(e)),r=t.selectedIndexes.slice(0),o=t.selectedValues.slice(0);return e.selected=!1,i>=0&&(r.splice(i,1),o.splice(i,1),t.selectedIndexes=r,t.selectedValues=o,t.$.hiddenInput.value=o.toString(),t.isCompleted&&!t._propertyChanging?(t.$.fireEvent("change",{addedItems:[],removedItems:[e],selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue(),t._recycle(),!0):void 0)}_handleItemTemplate(e){if(null===e||!e)return;if("function"==typeof e)return e;const t=this;if(!("content"in document.createElement("template")))return t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()})),void(t.itemTemplate=null);if(null===(e=document.getElementById(e))||!("content"in e))return t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"itemTemplate"})),void(t.itemTemplate=null);const i=e.content,r=i.childNodes.length,o=/{{\w+}}/g;let s,n;t._bindingDetails=[],t._template=e;for(let e=0;e<r;e++){for(n=[];s=o.exec(i.childNodes[e].innerHTML);)n.push(s[0]);n.length>0&&t._bindingDetails.push({childNodeIndex:e,bindingString:n})}return!0}_handleKeyStrokes(e){const t=this,i="radioButton"===t.selectionMode||"checkBox"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode;let r=t._items;if(t.filterable&&t.$.filterInput.value.length>0&&(r=t._filteredItems),!t.disabled&&!t.readonly&&r.length){switch(e){case"ArrowLeft":case"ArrowUp":t._handleArrowKeys(!0);break;case"ArrowRight":case"ArrowDown":t._handleArrowKeys(!1);break;case" ":{if(t.selectedIndexes.length<1&&!t._focusedItem)return;const e=t._focusedItem?t._focusedItem:t._items[t.selectedIndexes[t.selectedIndexes.length-1]],i=e=>{e.selected&&"radioButton"!==t.selectionMode?t.unselect(e):t.select(e)};if("oneOrMany"===t.selectionMode)return void(e.selected&&t.selectedIndexes.length>1?i(e):e.selected||i(e));i(e);break}case"Home":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[0])),t._focus(r[0]),t.scrollTop=0;break;case"End":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[r.length-1])),t._focus(r[r.length-1]),t.scrollTop=t.scrollHeight;break;case"PageUp":t._pageUpKeyHandler(r);break;case"PageDown":t._pageDownKeyHandler(r)}t._recycle()}}_horizontalScrollbarHandler(e){const t=this;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollLeft=t._getScrollLeft(e.detail.value)}_getScrollLeft(e,t){const i=this;if(!i.rightToLeft)return e;if(JQX.Utilities.Core.Browser.Chrome){if(!t){const e=2*(parseInt(getComputedStyle(i.$.itemsInnerContainer).getPropertyValue("--jqx-list-item-horizontal-offset"))||0);t=i._scrollWidth-i.$.itemsContainer.offsetWidth-e}e=t-e}else e*=-1;return e}_unsort(){const e=this;e.isUpdating++;const t=function(e,t){let i=e.dataIndex,r=t.dataIndex;return i<r?-1:i>r?1:0};if(e.isVirtualized)if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);s.sort(t),i.push(o),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("jqx-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}_applySortOrder(){const e=function(e){for(let t=0;t<e.length;t++){const i=e[t],r=i.parentNode;r&&r.appendChild(i)}};e(this._items),e(this._groups)}_sort(){const e=this;if(!e._canSort)return;e.isUpdating++;const t=function(t,i){let r=t.label,o=i.label;if("asc"===e.sortDirection){if(r<o)return-1;if(r>o)return 1}else{if(r<o)return 1;if(r>o)return-1}return 0};if(e._groups.sort(t),e.isVirtualized)if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);i.push(o),s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("jqx-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}getItem(e){const t=this;for(let i=0;i<t._items.length;i++)if(t._items[i].value===e)return t._items[i];return null}_focus(e){const t=this;!e||"none"===t.selectionMode||t.disabled||t.readonly||(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,t._focusedItem._focused=!0)}_keyDownHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;let r=e.key;if(e.metaKey&&(r="Control"),!t.disabled&&!t.readonly&&(!t.filterable||t.$.filterInput!==i)&&t._focused&&0!==t._items.length&&!t.disabled&&!t.displayLoadingIndicator){if(t.editable){if("F2"===r)return void t._dblclickEventHandler({target:t._focusedItem});if(t.$.editInput===i)return}if("none"!==t.selectionMode){switch(e.stopPropagation(),r){case"Down":case"Right":case"Left":case"Up":r="Arrow"+r}if(t.filterable)switch(r){case"ArrowLeft":case"ArrowRight":return;case"ArrowUp":case"ArrowDown":e.preventDefault()}if(t._applyIncrementalSearch(r),!(["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","Home","End","PageUp","PageDown"].indexOf(r)<0))if(e.preventDefault(),!t._focusedItem&&t._items.length>0)"one"===t.selectionMode||"oneOrMany"===t.selectionMode||"oneOrManyExtended"===t.selectionMode?t.select(t._items[0]):t._focus(t._items[0]);else switch(t.selectionMode){case"one":case"zeroAndOne":if("Shift"===r||"Control"===r||" "===r)return;t._handleKeyStrokes(r);break;case"oneOrMany":case"zeroOrOne":case"zeroOrMany":case"radioButton":case"checkBox":if("Shift"===r||"Control"===r)return;t._handleKeyStrokes(r);break;case"oneOrManyExtended":if(" "===r)return;t._keysPressed[r]="keydown"===e.type,t._handleKeyStrokes(r)}}}}_keyUpHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;if(!t.editable||t.$.editInput!==i){if(t.filterable&&t.$.filterInput===i)return t._filterTimer&&clearTimeout(t._filterTimer),void(t._filterTimer=setTimeout((function(){const e=t.context;t.context=t,t._filterItems(void 0,void 0,!0),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}),300));if(t._focused){if(t._focusedItem&&t._focusedItem.hidden&&t._filteredItems.length>0){let e=t._filteredItems[0];e.grouped&&t._filteredItems.length>1&&(e=t._filteredItems[1]),t._focus(e),t._recycle()}e.stopPropagation(),e.preventDefault(),t.disabled||("Escape"===e.key&&JQX.ListBox.DragDrop.Dragging&&t._cancelDrag(),["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","PageUp","PageDown"].indexOf(e.key)<0||(t._keysPressed[e.key]=!1))}}}_cancelDrag(){if(!JQX.ListBox.DragDrop.Dragging)return;JQX.ListBox.DragDrop.Feedback.parentNode&&JQX.ListBox.DragDrop.Feedback.parentNode.removeChild(JQX.ListBox.DragDrop.Feedback);const e=JQX.ListBox.DragDrop.Item,t=e.ownerListBox;if(t.$.fireEvent("dragCancel",{item:e,data:JQX.ListBox.DragDrop,container:t,previousContainer:t}),JQX.ListBox.DragDrop.Feedback=null,JQX.ListBox.DragDrop.DropDetails){let e=JQX.ListBox.DragDrop.DropDetails.item;e&&(e.$.removeClass("jqx-list-item-line-feedback"),e.$.removeClass("jqx-list-item-bottom-line-feedback"))}document.body.classList.remove("jqx-dragging"),delete JQX.ListBox.DragDrop.DraggedFrom,JQX.ListBox.DragDrop.Dragging=!1,JQX.ListBox.DragDrop.Item=null,JQX.ListBox.DragDrop.DropDetails=null}_mouseWheelHandler(e){const t=this;if((t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)&&!t.disabled&&t.computedVerticalScrollBarVisibility){const i=t.scrollTop;if(0===i&&e.deltaY<0||i===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollTo(i+t._getScrollCoefficient(e,t.offsetHeight))}}_pageDownKeyHandler(e){const t=this;if(0===e.length)return;let i,r=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(r=t._focusedItem),!r)return;const o=t._indexOf(r);let s=r.top+t.$.itemsContainer.offsetHeight-r.height;for(let t=o;t<e.length;t++)if(e[t].top>=s){i=e[t];break}i||(i=e[e.length-1]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(i):i.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(i),t._focus(i)),(i.height+i.top>t.$.itemsContainer.scrollTop+t.$.itemsContainer.offsetHeight||i.top<t.$.itemsContainer.scrollTop)&&(t.scrollTop=i.top-t.$.itemsContainer.offsetHeight+i.height)}_pageUpKeyHandler(e){const t=this;if(0===e.length)return;let i=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(i=t._focusedItem),!i)return;const r=i.top-t.$.itemsContainer.offsetHeight;let o;for(let s=t._indexOf(i);s>0;s--)if(e[s].top<=r){o=e[s];break}o||(o=e[0]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(o):o.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(o),t._focus(o)),t.scrollTop=o.top,0===t._indexOf(o)&&(t.scrollTop=0)}clearItems(){const e=this;e.clearSelection(),e.$.itemsInnerContainer.innerHTML="",e._items=[],delete e._focusedItem,e.$placeholder.removeClass("jqx-hidden"),e.refresh()}_resizeHandler(e){this.refresh(e)}refresh(e){const t=this;if(!e&&!t._isUpdatingScrollBars&&t.isInitialized)return t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),void(t._isUpdatingScrollBars=!1);e&&e.target===t&&!t._isUpdatingScrollBars&&(t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),t._isUpdatingScrollBars=!1)}_indexOf(e){const t=this;if(!e)return-1;let i=t._items.indexOf(e);return-1===i&&(i=t._items.indexOf(t.getItem(e.value))),i}_incrementalSearch(){const e=this,t="radioButton"!==e.selectionMode&&"checkBox"!==e.selectionMode&&"zeroOrMany"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode;let i,r=0;switch(e.incrementalSearchMode){case"containsIgnoreCase":case"equalsIgnoreCase":case"startsWithIgnoreCase":case"endsWithIgnoreCase":i=e._incrementalSearchQuery.toLowerCase();break;default:i=e._incrementalSearchQuery}const o=function(i){i.grouped||i.readonly||(t?(e.selectedIndexes.length>0&&e.clearSelection(),e._focus(i),e.select(i)):e._focus(i),(i.height+i.top>e.$.itemsContainer.scrollTop+e.$.itemsContainer.offsetHeight||i.top<e.scrollTop)&&(e.scrollTop=i.top),0===e._indexOf(i)&&(e.scrollTop=0),e._indexOf(i)===e._items.length-1&&(e.scrollTop=e.scrollHeight))};0!==e._previousEntry.localeCompare(i)&&(e._incrementalSearchItems=e._queryItems(e._incrementalSearchQuery,e.incrementalSearchMode),delete e._itemPosition),e._previousEntry=i;const s=e._incrementalSearchItems.length;if(0!==s)if(1!==s)for(void 0!==e._itemPosition?e._itemPosition<s-1?r=e._itemPosition:(r=0,t?(e._incrementalSearchItems[e._itemPosition].selected=!1,e.selectedIndexes=[],e.selectedValues=[]):e._incrementalSearchItems[e._itemPosition]._focused=!1):t&&e.clearSelection();r<s;r++)if(e._incrementalSearchItems[r].selected&&t)e._incrementalSearchItems[r].selected=!1,e.selectedIndexes=[],e.selectedValues=[];else{if(t||!e._incrementalSearchItems[r]._focused)return o(e._incrementalSearchItems[r]),void(e._itemPosition=r);e._incrementalSearchItems[r]._focused=!1}else o(e._incrementalSearchItems[0])}_selectStartHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement;t.$.filterInput!==i&&t.$.editInput!==i&&e.preventDefault()}_handleArrowKeys(e){const t=this,i="radioButton"!==t.selectionMode&&"checkBox"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode;if(t.disabled||t.readonly)return;let r;if(t._focusedItem&&!t._keysPressed.Shift)r=t._indexOf(t._focusedItem),t._focusedItem._focused=!1;else{if(0===t.selectedIndexes.length)return;r=t.selectedIndexes[t.selectedIndexes.length-1]}const o=e?t._getPreviousItem(r):t._getNextItem(r);t._focus(o),i&&(t._keysPressed.Shift?t.select(o):t._items[r]!==o&&(t.clearSelection(),t.select(o))),t.ensureVisible(o)}_refreshFilter(){const e=this;if(e.filterable)return e.$.filterInput.disabled=!(!e.disabled&&!e.displayLoadingIndicator),e.$filterInputContainer.removeClass("jqx-hidden"),void e.$itemsContainer.addClass("filter");e.$.filterInput.disabled=!0,e.$filterInputContainer.addClass("jqx-hidden"),e.$itemsContainer.removeClass("filter")}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):e.tabIndex=e.tabIndex>0?e.tabIndex:0}_setLoadingIndicatorVisibility(){const e=this;e.displayLoadingIndicator?e.$loadingIndicatorContainer.hasClass("jqx-visibility-hidden")?e.$loadingIndicatorContainer.removeClass("jqx-visibility-hidden"):e.$loadingIndicatorContainer.removeClass("jqx-hidden"):e._areCSSVarsSupported?e.$loadingIndicatorContainer.addClass("jqx-hidden"):e.$loadingIndicatorContainer.addClass("jqx-visibility-hidden")}_refreshLayout(){const e=this,t=e._filteredItems||e._items;if(e.__scrollHeight=null,e.__scrollWidth=null,e._height=null,e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.$itemsContainer.removeClass("hscroll"),e.$itemsContainer.removeClass("vscroll"),!t||null===t||0===t.length)return e.scrollWidth=0,e.scrollHeight=0,e.$filterInputContainer.removeClass("vscroll"),e.$placeholder.removeClass("jqx-hidden"),e.isVirtualized&&e._recycle(),void(e.$.itemsInnerContainer.style.width="");e.$placeholder.addClass("jqx-hidden");const i=2*(parseInt(getComputedStyle(e.$.itemsContainer).getPropertyValue("--jqx-list-item-horizontal-offset"))||0);let r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,o=e._scrollHeight;if(e._refreshHorizontalScrollBarVisibility(r),e._refreshVerticalScrollBarVisibility(o),e.$.itemsInnerContainer.style.width="","hidden"===e.horizontalScrollBarVisibility?e.$.itemsInnerContainer.style.width=e.$.itemsContainer.offsetWidth-i:e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px",e.computedVerticalScrollBarVisibility)return r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),"hidden"!==e.horizontalScrollBarVisibility&&(e.$.itemsInnerContainer.style.width="",e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px"),e.computedHorizontalScrollBarVisibility&&(("visible"!==e.horizontalScrollBarVisibility||0!==e.scrollWidth||"visible"===e.horizontalScrollBarVisibility)&&(e.__scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.scrollHeight=e.__scrollHeight,e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),void(e.isVirtualized&&e._recycle());r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),e.computedHorizontalScrollBarVisibility&&(e.scrollHeight=e._scrollHeight,e._refreshVerticalScrollBarVisibility(e.scrollHeight),e.computedVerticalScrollBarVisibility&&(r=e._scrollWidth-e.$.itemsContainer.offsetWidth-e._scrollView.vScrollBar.offsetWidth,e._refreshHorizontalScrollBarVisibility(r)),e._scrollView.vScrollBar.$.hasClass("bottom-corner")&&e._scrollView.vScrollBar.refresh(),e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),e.isVirtualized&&e._recycle();const s=/Trident|Edge/.test(navigator.userAgent);!e.isRefreshing&&s&&setTimeout((function(){e.isRefreshing=!0,e._refreshLayout(),e.isRefreshing=!1}),50)}_styleChangedHandler(){this._refreshLayout()}_swipeLeftHandler(){}_swipeRightHandler(){}_refreshHorizontalScrollBarVisibility(e){const t=this;t.scrollWidth=e,t.$.horizontalScrollBar.refresh(),t.computedHorizontalScrollBarVisibility?(t.scrollLeft=t._getScrollLeft(t.$.itemsContainer.scrollLeft,e),t.$itemsContainer.addClass("hscroll")):t.$itemsContainer.removeClass("hscroll")}_refreshVerticalScrollBarVisibility(e){const t=this;t.scrollHeight=e,t.$.verticalScrollBar.refresh(),t.computedVerticalScrollBarVisibility?(t.$itemsContainer.addClass("vscroll"),t.$filterInputContainer.addClass("vscroll")):(t.$itemsContainer.removeClass("vscroll"),t.$filterInputContainer.removeClass("vscroll"))}_validateTemplate(e,t){if(null===t||!t)return;const i=this;return"content"in document.createElement("template")?null!==(t=document.getElementById(t))&&"content"in t?t:(i.error(i.localize("invalidTemplate",{elementType:i.nodeName.toLowerCase(),property:e})),void(i[e]=null)):(i.error(i.localize("htmlTemplateNotSuported",{elementType:i.nodeName.toLowerCase()})),void(i[e]=null))}_getItemIndexByPosition(e){const t=this,i=(i=>{let r=0,o=i.length-1;if(e<=0)return 0;if(i[i.length-1].top<=e)return i.length-1;for(;;){const s=Math.floor((r+o)/2),n=i[s];if(t._isItemInPosition(n,e))return s;n.top<e?r=s+1:n.top>e&&(o=s-1)}})(t.$.filterInput.value.length>0?t._filteredItems:t._items);return i}_isItemInPosition(e,t){const i=e.top,r=e.top+e.height;return i<=t&&r>t}get isVirtualized(){const e=this;return e.virtualized&&e.dataSource&&e.dataSource.length>0}_recycle(){const e=this;if(!e._recyclingItems)return;let t=e._height;e._height||(t=e._height=e.$.itemsContainer.offsetHeight);let i=0;const r=e.scrollTop,o=e._getItemIndexByPosition(r),s=e.filterable&&e.$.filterInput.value.length>0?e._filteredItems:e._items,n=s[o];let l=n?n.top:0;if(e.$.itemsInnerContainer.style.left=-e.scrollLeft+"px",e.$.itemsInnerContainer.style.top=-r+l+"px",e.isUpdating++,o>=0){const n=s.length;for(let a=o;a<n;a++){const o=s[a];if(0!==o.height){if(!(l+o.height>=r&&l<=r+t))break;{const t=e._recyclingItems[i++];if(!t)break;t.setAttribute("aria-setsize",n),t.setAttribute("aria-posinset",a),t.context=document,t.dataItem=o,t.label=o.label,t.value=o.value,t.selected=o.selected,t._focused=o._focused,t.hidden=o.hidden,t.grouped=o.grouped,t.readonly=o.readonly,t.style.height=o.height+"px",e._alternateItem(t),o.title?t.title=o.title:t.title="",o.grouped?t.displayMode="plain":t.displayMode=o.displayMode,e.scrollWidth>0&&(t.style.width=e.$.itemsInnerContainer.offsetWidth+e.scrollWidth+"px"),e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._applyTemplate(t,!1)}l+=o.height}}}if(i<e._recyclingItems.length)for(let t=i;t<e._recyclingItems.length;t++){const t=e._recyclingItems[i++],r=t.context;t.context=document,t.hidden=!0,t.context=r}e.isUpdating--}_verticalScrollbarHandler(e){const t=this,i=e.detail.value;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollTop=i,t._updateTopVisibleIndex(),e.context.max!==e.context.value?e.context.min===e.context.value&&t.$.fireEvent("scrollTopReached"):t.$.fireEvent("scrollBottomReached")}_applyAriaSelected(){const e=this,t=e.isVirtualized?e._recyclingItems:e._items,i=e.selectionMode;for(let e=0;e<t.length;e++){const r=t[e];r.selected?r.setAttribute("aria-selected",!0):r.readonly||r.disabled||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(i)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}});
111
+ JQX("jqx-list-item",class extends JQX.ContentElement{static get properties(){return{alternationIndex:{value:-1,type:"int"},color:{value:"",type:"string"},displayMode:{allowedValues:["plain","checkBox","radioButton"],value:"plain",type:"string"},grouped:{value:!1,type:"boolean"},selected:{value:!1,type:"boolean"},value:{value:"",type:"string"},label:{value:"",type:"string"},details:{value:"",type:"string"},group:{value:"",type:"string"},hidden:{value:!1,type:"boolean"},readonly:{value:!1,type:"boolean"}}}get hasStyleObserver(){return!1}get enableShadowDOM(){return!1}get _focused(){const e=this;return void 0===e.__focused&&(e.__focused=!1),e.__focused}set _focused(e){const t=this;t.__focused=e,e?(t.setAttribute("focus",""),t.ownerListBox&&t.ownerListBox.ownerElement&&JQX.ComboBox&&t.ownerListBox.ownerElement instanceof JQX.ComboBox&&t.ownerListBox.ownerElement.$.input.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focus")}template(){return'<div id="container">\n <span id=\'itemInput\' class=\'jqx-input jqx-hidden\'></span>\n <span class="jqx-overlay" id="overlay"></span>\n <div id="itemContainer" class="jqx-content jqx-list-item-container"><span class="jqx-content-label" inner-h-t-m-l=\'[[innerHTML]]\' role="presentation"><content></content></span><span inner-h-t-m-l=\'[[details]]\' id="details" class="jqx-content-details"></span></div>\n </div>'}appendChild(e){const t=this;if(!t.isCompleted||e.classList&&e.classList.contains("jqx-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}window.smartBlazor?t.$.itemContainer.appendChild(e):(t.$.itemContainer.innerHTML="",e instanceof HTMLElement&&t.$.itemContainer.appendChild(e))}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}t.parentNode.insertBefore(e,t)}removeChild(e){const t=this;if(!t.isCompleted||e.classList.contains("jqx-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.itemContainer.removeChild(e)}attached(){super.attached(),this.ownerListBox=this.getListBox()}static get listeners(){return{mouseenter:"_itemOnMouseEnter",mouseleave:"_itemOnMouseLeave"}}ready(){super.ready();const e=this;if(e.setAttribute("role","option"),""!==e.label){let t=e.label;t&&"string"==typeof t&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),e.innerHTML=t}else""!==e.innerHTML&&(e.label=e.innerHTML);e._setDisplayMode(e.displayMode),e._setItemColor(),e.$.container.noRipple=!0;const t=e.closest("jqx-list-box");if(t&&t.isRendered){if(cancelAnimationFrame(JQX.ListBox.processTimer),t._inLazyInit||t._isUpdating)return;JQX.ListBox.processTimer=requestAnimationFrame((()=>{t._lazyInitItems()}))}}propertyChangedHandler(e,t,i){const r=this;if(super.propertyChangedHandler(e,t,i),"hidden"===e)i?r.$.addClass("jqx-hidden"):r.$.removeClass("jqx-hidden");else if("color"===e)r._setItemColor();else if("displayMode"===e)r._setDisplayMode(i);else if("label"===e||"value"===e){const t=r.context;r.context=document,"label"===e&&(r.innerHTML=i);const o=r.getListBox();o&&(o._applyTemplate(r),o.onItemUpdated(r)),r.context=t}else if("details"===e){const e=r.context;r.context=document,r.$.details.innerHTML=i;const t=r.getListBox();t&&t.onItemUpdated(r),r.context=e}else if("innerHTML"===e){const e=r.getListBox();e&&e.onItemUpdated(r)}else if("selected"===e)if(i)r.setAttribute("aria-selected",!0);else{const e=r.getListBox();r.readonly||r.disabled||!e||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(e.selectionMode)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}getListBox(){const e=this;if(!JQX.ListBox)return e.getRootNode().host;let t=e.parentNode;for(;t instanceof JQX.ListBox==0&&null!==t;)t=t.parentNode;return!t&&JQX.EnableShadowDOM?e.getRootNode().host:t}_itemOnMouseEnter(){const e=this;!e.disabled&&e.ownerListBox&&(JQX.ListBox.DragDrop.Dragging&&e.ownerListBox.allowDrop&&(JQX.ListBox.DragDrop.DropDetails={item:e,position:"bottom"}),e.ownerListBox.$.verticalScrollBar.thumbCapture||e.ownerListBox.$.horizontalScrollBar.thumbCapture||e.setAttribute("hover",""))}_itemOnMouseMove(e){const t=this;if(t.ownerListBox&&JQX.ListBox.DragDrop.Dragging&&t.ownerListBox.allowDrop&&!JQX.Utilities.Core.isMobile){const i=[].slice.call(t.ownerListBox.getElementsByClassName("jqx-list-item-bottom-line-feedback"));for(let e=0;e<i.length;e++)i[e].$.removeClass("jqx-list-item-line-feedback"),i[e].$.removeClass("jqx-list-item-bottom-line-feedback");if(JQX.ListBox.DragDrop.DropDetails={item:t,position:"top"},!t.ownerListBox._areCSSVarsSupported){if(t.ownerListBox._indexOf(t)===t.ownerListBox._items.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1&&(JQX.ListBox.DragDrop.DropDetails={item:t,position:"bottom"})}return}if(t.$.removeClass("jqx-list-item-line-feedback"),t.$.removeClass("jqx-list-item-bottom-line-feedback"),t.ownerListBox.sorted&&t.ownerListBox.autoSort)return;const r=t.ownerListBox._items.filter((e=>!e.hidden));if(r.indexOf(t)===r.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1?(t.$.addClass("jqx-list-item-bottom-line-feedback"),JQX.ListBox.DragDrop.DropDetails={item:t,position:"bottom"}):arguments[1]||t.$.addClass("jqx-list-item-line-feedback")}else arguments[1]||t.$.addClass("jqx-list-item-line-feedback")}}_itemOnMouseLeave(){const e=this;e.ownerListBox&&(JQX.ListBox.DragDrop.Dragging&&(e.$.removeClass("jqx-list-item-line-feedback"),e.$.removeClass("jqx-list-item-bottom-line-feedback")),e.removeAttribute("hover"))}_setDisplayMode(e){const t=this,i=t.getListBox();if(i){const r="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain";t.displayMode=e=r}"plain"!==e?t.$itemInput.removeClass("jqx-hidden"):t.$itemInput.addClass("jqx-hidden")}_setItemColor(){const e=this,t=e.querySelector(".jqx-content-label"),i=/(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(e.color)?e.color:"";t.style.backgroundColor=i,t.style.color=e._getContrastColor(i)}_getContrastColor(e){if(!e)return"";let t=(i=e.slice(1,3),r=e.slice(3,5),o=e.slice(5,7),[parseInt(i,16),parseInt(r,16),parseInt(o,16)]);var i,r,o;return parseFloat(((.299*t[0]+.61*t[1]+.114*t[2])/255).toFixed(2))>.65?"#000000":"#FFFFFF"}}),JQX("jqx-list-items-group",class extends JQX.ContentElement{static get properties(){return{label:{value:"",type:"string"}}}get enableShadowDOM(){return!1}template(){return'<div id="container" role="presentation">\n <span id="itemsLabel" class="jqx-list-items-group-label">[[label]]</span>\n <div id="listItemsGroupContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-list-items-group-container" role="presentation">\n <content></content>\n </div>\n </div>'}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.appendChild(e)}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.removeChild(e)}getListBox(){let e=this.parentNode;for(;e instanceof JQX.ListBox==0&&null!==e;)e=e.parentNode;return e}attached(){const e=this;super.attached(),e.ownerListBox||(e.ownerListBox=e.getListBox()),e.setAttribute("role","group"),e.$.itemsLabel.id||(e.$.itemsLabel.id=e.id+"Label"),e.setAttribute("aria-labelledby",e.$.itemsLabel.id)}}),JQX("jqx-list-box",class extends JQX.ScrollViewer{static get properties(){return{allowDrag:{value:!1,type:"boolean"},allowDrop:{value:!1,type:"boolean"},alternationStart:{value:0,type:"int"},alternationEnd:{value:0,type:"int"},alternationCount:{value:0,type:"int"},autoSort:{value:!0,type:"boolean"},dataSource:{value:null,type:"any?",reflectToAttribute:!1},dragFeedbackFormatFunction:{value:null,type:"function?"},dragOffset:{value:[10,10],type:"array"},displayLoadingIndicator:{value:!1,type:"boolean"},displayMember:{value:"",type:"string"},shadowDomMode:{allowedValues:["light","shadow"],value:"shadow",type:"string"},dropAction:{value:"move",type:"string",allowedValues:["copy","move","none"]},editable:{value:!1,type:"boolean"},filterable:{value:!1,type:"boolean"},filterCallback:{value:null,type:"function?"},filterMode:{value:"containsIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase","custom"],type:"string"},filterInputPlaceholder:{value:"",type:"string"},grouped:{value:!1,type:"boolean"},groupMember:{value:"",type:"string"},itemTemplate:{value:null,type:"any"},itemHeight:{value:null,type:"number?"},incrementalSearchDelay:{value:700,type:"number?"},incrementalSearchMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string"},itemMeasureMode:{value:"auto",allowedValues:["auto","precise"],type:"string"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},messages:{extend:!0,value:{en:{overridingProperties:'{{elementType}}: Overriding properties {{property1}} and {{property2}} applied. The "{{property1}}" property is used by default.',invalidIndex:'{{elementType}}: "{{method}}" method accepts an index of type number or an Array of numbers.',indexOutOfBound:'{{elementType}}: Out of bound index/indexes in "{{method}}" method.',invalidItem:'{{elementType}}: "{{method}}" method accepts an object or an array of objects as it\'s second parameter.',invalidSettings:'{{elementType}}: "{{method}}" method accepts a string or an object as it\'s second parameter.'}},type:"object"},name:{value:"",type:"string"},placeholder:{value:"No Items",type:"string"},selectedIndexes:{value:[],type:"array"},selectedValues:{value:[],type:"array"},selectionMode:{value:"oneOrManyExtended",allowedValues:["none","oneOrManyExtended","zeroOrMany","oneOrMany","zeroOrOne","zeroAndOne","one","checkBox","radioButton"],type:"string"},selectionChangeAction:{value:"release",allowedValues:["press","release"],type:"string"},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},topVisibleIndex:{value:-1,type:"int"},type:{value:"list",type:"string",defaultReflectToAttribute:!0,readonly:!0},valueMember:{value:"",type:"string"},virtualized:{value:!1,type:"boolean"}}}static get requires(){return{"JQX.ScrollBar":"jqx.scrollbar.js"}}static get styleUrls(){return["jqx.listbox.css","jqx.dropdown.css","jqx.scrollbar.css"]}static get listeners(){return{focus:"_focusHandler",blur:"_blurHandler","container.wheel":"_mouseWheelHandler","editInput.change":"_editInputEventHandler","editInput.blur":"_editInputEventHandler","editInput.keydown":"_editInputEventHandler","horizontalScrollBar.change":"_horizontalScrollbarHandler","itemsInnerContainer.down":"_downHandler","itemsInnerContainer.dblclick":"_dblclickEventHandler","itemsInnerContainer.move":"_itemsContainerMoveHandler","itemsContainer.mouseleave":"_mouseLeaveHandler","itemsInnerContainer.touchmove":"_touchmoveHandler","itemsInnerContainer.touchstart":"_touchstartHandler","document.move":"_moveHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",resize:"_resizeHandler",selectstart:"_selectStartHandler",styleChanged:"_styleChangedHandler",swipeleft:"_swipeLeftHandler",swiperight:"_swipeRightHandler",touchmove:"_overriddenHandler",touchstart:"_overriddenHandler","verticalScrollBar.change":"_verticalScrollbarHandler"}}template(){return'<div id="container" class="jqx-container" role="presentation">\n <div class="jqx-list-box-filter-input-container jqx-hidden" id="filterInputContainer" role="presentation"><input id="filterInput" disabled="[[disabled]]" placeholder=\'[[filterInputPlaceholder]]\' role="searchbox" aria-label="[[filterInputPlaceholder]]"></div>\n <div id="itemsContainer" class="jqx-list-items-container" role="presentation">\n <div id="placeholder" class="jqx-placeholder" role="presentation" aria-hidden="true">[[placeholder]]</div>\n <div id="itemsInnerContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-list-items-inner-container" role="presentation">\n <content></content>\n </div>\n <input type="text" id="editInput" class= "jqx-hidden"/>\n </div>\n <jqx-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="verticalScrollBar" disabled="[[disabled]]" orientation="vertical"></jqx-scroll-bar>\n <jqx-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="horizontalScrollBar" disabled="[[disabled]]"></jqx-scroll-bar>\n <div id="loadingIndicatorContainer" class="jqx-loader-container" role="presentation">\n <span id="loadingIndicator" class="jqx-loader" role="img" aria-label="[[loadingIndicatorPlaceholder]]"></span>\n <span id="loadingIndicatorPlaceHolder" class="jqx-loader-label jqx-hidden">[[loadingIndicatorPlaceholder]]</span>\n </div>\n <input id="hiddenInput" type="hidden" name="[[name]]">\n </div>'}get value(){const e=this;return e.isRendered&&e._selectedItems.length>0?e._selectedItems.map((e=>({label:e.label,value:e.value}))):null}set value(e){const t=this;if(Array.isArray(e)){const i=t.context;t.context=t,t._isUpdating++,t.selectedValues=[],t.clearSelection();for(let i=0;i<e.length;i++){const r=e[i],o=t.getItem(r);o&&("oneOrManyExtended"===t.selectionMode?t._select(o):t.select(o))}return t.context=i,void t._isUpdating--}const i=t.getItem(e);i&&t.select(i)}get _selectedItems(){const e=this,t=[];if(e.isRendered)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected&&t.push(r)}return t}_mouseLeaveHandler(){const e=[].slice.call(this.getElementsByClassName("jqx-list-item-bottom-line-feedback"));for(let t=0;t<e.length;t++)e[t].$.removeClass("jqx-list-item-line-feedback"),e[t].$.removeClass("jqx-list-item-bottom-line-feedback")}_downHandler(e){const t=this;if(t.disabled||t.displayLoadingIndicator||t.readonly)return;let i=e.originalEvent.target,r=null;if(!(i instanceof JQX.ListItem)||i.disabled||i.hidden||i instanceof JQX.ListItemsGroup)for(;i.parentElement;){if(i instanceof JQX.ListItem&&!i.disabled&&!i.hidden&&!(i instanceof JQX.ListItemsGroup)){r=i.dataItem;break}i=i.parentElement}else r=i.dataItem;JQX.ListBox.DragDrop.StartTime=new Date,JQX.ListBox.DragDrop.StartPosition={left:e.pageX,top:e.pageY},r&&(e.stopPropagation(),t.hasRippleAnimation&&(r.readonly||r.disabled||JQX.Utilities.Animation.Ripple.animate(i.$.overlay,e.pageX,e.pageY)),JQX.Utilities.Core.isMobile||"press"!==t.selectionChangeAction||(t._focus(r),t.select(r)),!JQX.ListBox.DragDrop.Feedback&&t.allowDrag&&(JQX.ListBox.DragDrop.DraggedFrom=t,JQX.ListBox.DragDrop.Feedback=document.createElement("span"),t.rightToLeft?JQX.ListBox.DragDrop.Feedback.setAttribute("right-to-left",!0):JQX.ListBox.DragDrop.Feedback.removeAttribute("right-to-left"),t.dragFeedbackFormatFunction?JQX.ListBox.DragDrop.Feedback.innerHTML=t.dragFeedbackFormatFunction(r):JQX.ListBox.DragDrop.Feedback.appendChild(r.offsetHeight?r.cloneNode(!0):t._createItem(r)),JQX.ListBox.DragDrop.Item=r,JQX.Utilities.Extend(JQX.ListBox.DragDrop.Feedback).addClass("jqx-popup jqx-list-item jqx-list-item-feedback")))}_dblclickEventHandler(e){const t=this;if(!t.editable)return;const i=e.target.closest("jqx-list-item");i instanceof JQX.ListItem&&!i.disabled&&!i.readonly?(t.$.editInput.dir=t.rightToLeft?"rtl":"ltr",t.$.editInput.style.width=t.$.itemsInnerContainer.offsetWidth+"px",t.$.editInput.owner=i,t.$.editInput.value=i.label,t.$.editInput.style.height=i.offsetHeight+"px",t.$.editInput.style.top=i.offsetTop+t.$.itemsInnerContainer.offsetTop+"px",t.$.editInput.setAttribute("aria-label","Edit item "+i.label),t.$editInput.hasClass("jqx-hidden")&&t.$editInput.removeClass("jqx-hidden"),t.$.editInput.focus({preventScroll:!0})):t.$editInput.addClass("jqx-hidden")}_editInputEventHandler(e){const t=this;if("blur"===e.type||"keydown"===e.type&&"Escape"===e.key)return t.$editInput.hasClass("jqx-hidden")||t.$editInput.addClass("jqx-hidden"),void t.focus();if("keydown"===e.type||t.$editInput.hasClass("jqx-hidden"))return;const i=e.target;if(e.stopPropagation(),i.owner.label!==i.value&&(i.owner.label=i.value,t.itemTemplate&&t._applyTemplate(i.owner),t.dataSource)){const e=i.owner.dataIndex,r=t.dataSource[e];r&&(t.displayMember?r[t.displayMember]=i.value:r.label=i.value)}t.$editInput.addClass("jqx-hidden"),t.$.fireEvent("itemLabelChange",{selected:i.owner.selected,disabled:i.owner.disabled,index:t._indexOf(i.owner),label:i.owner.label,value:i.owner.value})}_pointerUpHandler(e){const t=this;let i=e.originalEvent,r=i.target;(t.shadowRoot||t.isInShadowDOM)&&(r=i.originalEvent?i.originalEvent.composedPath()[0]:i.composedPath()[0]);const o=e=>{const i=e.ownerListBox;i.disabled||i!==t||i.displayLoadingIndicator||"none"===i.selectionMode||e.grouped||e.readonly||(i._focus(e),i.select(e),JQX.ListBox.DragDrop.StartPosition=null,t.$.fireEvent("itemClick",{selected:r.selected,disabled:r.disabled,index:t._indexOf(r),label:r.label,value:r.value}))};if(!(i.target instanceof JQX.ListItem)||i.target.disabled||i.target instanceof JQX.ListItemsGroup){for(;r&&r.parentElement;){if(r instanceof JQX.ListItem&&!r.disabled&&!(r instanceof JQX.ListItemsGroup))return void o(r.dataItem);r=r.parentElement}if(this.shadowRoot&&"shadow"===this.shadowDomMode){const e=i.composedPath();for(let t=0;t<e.length;t++){const i=e[t];i instanceof JQX.ListItem&&!i.disabled&&o(i.dataItem)}}}else o(r.dataItem)}_upHandler(e){const t=this;if(super._upHandler(),!t.disabled&&!t.readonly&&JQX.ListBox.DragDrop.StartPosition){if(JQX.Utilities.Core.isMobile&&!JQX.ListBox.DragDrop.Dragging){const i=Math.abs(e.pageX-JQX.ListBox.DragDrop.StartPosition.left),r=Math.abs(e.pageY-JQX.ListBox.DragDrop.StartPosition.top);let o=i>=0&&i<=3&&r>=0&&r<=3;if(JQX.Utilities.Core.isMobile&&new Date-JQX.ListBox.DragDrop.StartTime>=300&&(o=!1,JQX.ListBox.DragDrop.StartTime=null),o){const i=e.originalEvent.target.closest("jqx-list-box");i?i._pointerUpHandler(e):t._pointerUpHandler(e),JQX.ListBox.DragDrop.StartPosition=null}else{let t=e.originalEvent.target;if(!(e.target instanceof JQX.ListItem)||t.readonly||e.target.disabled||e.target instanceof JQX.ListItemsGroup)for(;t.parentElement;){if(t instanceof JQX.ListItem&&!t.readonly&&!t.disabled&&!(t instanceof JQX.ListItemsGroup)){e.stopPropagation();break}t=t.parentElement}else e.stopPropagation()}}else if(!JQX.Utilities.Core.isMobile&&!JQX.ListBox.DragDrop.Dragging&&"release"===t.selectionChangeAction){const i=(t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target).closest("jqx-list-box");i&&(i.upTimer&&clearTimeout(i.upTimer),t.isInShadowDOM?i?i._pointerUpHandler(e):t._pointerUpHandler(e):i.upTimer=setTimeout((()=>{i?i._pointerUpHandler(e):t._pointerUpHandler(e)})))}if(JQX.ListBox.DragDrop.Feedback){let i;if(JQX.ListBox.DragDrop.Feedback.parentNode&&JQX.ListBox.DragDrop.Feedback.parentNode.removeChild(JQX.ListBox.DragDrop.Feedback),JQX.ListBox.DragDrop.Feedback=null,JQX.Utilities.Core.isMobile&&JQX.ListBox.DragDrop.Dragging)for(let t=0;t<JQX.ListBox.DragDrop.ListBoxes.length;t++){const r=JQX.ListBox.DragDrop.ListBoxes[t],o=r.getBoundingClientRect();if(r.allowDrop&&!r.closest(".jqx-visibility-hidden")&&o.left<=e.clientX&&e.clientX<=o.left+o.width&&o.top<=e.clientY&&e.clientY<=o.top+o.height){i=r;const t=r._items.filter((e=>!e.hidden));for(let i=0;i<t.length;i++){const s=t[i],n=s.getBoundingClientRect();if((t.indexOf(s)===t.length-1||s.parentNode.lastElementChild===s)&&e.clientY>=o.top+s.offsetTop-r.scrollTop+n.height/2&&e.clientY<=o.top-r.scrollTop+s.offsetTop+n.height){JQX.ListBox.DragDrop.DropDetails={item:s,position:"bottom"};break}if(e.clientY>=o.top+s.offsetTop-r.scrollTop&&e.clientY<=o.top+s.offsetTop+n.height-r.scrollTop){JQX.ListBox.DragDrop.DropDetails={item:s,position:"top"};break}}}}if(JQX.ListBox.DragDrop.Dragging){if(JQX.ListBox.DragDrop.DropDetails){let r=JQX.ListBox.DragDrop.DropDetails.item,o=JQX.ListBox.DragDrop.Item;const s=o.ownerListBox;let n=e.originalEvent.target;if(t.isInShadowDOM&&(n=e.originalEvent?e.originalEvent.composedPath()[0]:e.composedPath()[0]),i=!i&&n.closest?n.closest("jqx-list-box"):i,document.body.classList.remove("jqx-dragging"),r.$.removeClass("jqx-list-item-line-feedback"),r.$.removeClass("jqx-list-item-bottom-line-feedback"),i&&r.ownerListBox!==i&&i.items.length>0&&(r=i.items[i.items.length-1]),JQX.ListBox.DragDrop.Item===r||i!==r.ownerListBox&&!JQX.Utilities.Core.isMobile)i&&0===i._items.length&&"none"!==i.dropAction&&("move"===i.dropAction?JQX.ListBox.DragDrop.Item.ownerListBox.removeChild(JQX.ListBox.DragDrop.Item):"copy"===i.dropAction&&(o=o.cloneNode(!0)),i.appendChild(o));else if("none"!==o.ownerListBox.dropAction){r.ownerListBox!==o.ownerListBox&&"move"===o.ownerListBox.dropAction&&JQX.ListBox.DragDrop.Item.ownerListBox.removeChild(JQX.ListBox.DragDrop.Item),"copy"===o.ownerListBox.dropAction&&(o=o.cloneNode(!0)),JQX.ListBox.DragDrop.Item.group=r.group;const e=r.ownerListBox;"checkBox"!==e.selectionMode&&"radioButton"!==e.selectionMode&&e.clearSelection(),"top"===JQX.ListBox.DragDrop.DropDetails.position?e.insertBefore(o,r):r.parentNode.lastElementChild===r?e.appendChild(o):e.appendChild(o,r),e.ensureVisible(o),"checkBox"===e.selectionMode||"radioButton"===e.selectionMode?(e._focus(o),e._refreshSelection()):(e.clearSelection(),e.select(o))}o.selected&&i!==s&&s._refreshSelection();const l=JQX.ListBox.DragDrop.Item,a=l.ownerListBox;l.displayMode="checkBox"===a.selectionMode||"radioButton"===a.selectionMode?a.selectionMode:"plain",a.$.fireEvent("dragEnd",{item:l,target:r,data:JQX.ListBox.DragDrop,previousContainer:s,container:i,originalEvent:e}),a._focus(l)}else{const t=JQX.ListBox.DragDrop.Item,i=t.ownerListBox;t.displayMode="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain",document.body.classList.remove("jqx-dragging"),i.$.fireEvent("dragEnd",{item:t,target:null,data:JQX.ListBox.DragDrop,previousContainer:i,container:i,originalEvent:e}),i._focus(t)}e.preventDefault()}delete JQX.ListBox.DragDrop.DraggedFrom,JQX.ListBox.DragDrop.Dragging=!1,JQX.ListBox.DragDrop.Item=null,JQX.ListBox.DragDrop.DropDetails=null}for(let e=0;e<JQX.ListBox.DragDrop.ListBoxes.length;e++){const t=JQX.ListBox.DragDrop.ListBoxes[e];t._dragInterval&&clearInterval(t._dragInterval)}}}_itemsContainerMoveHandler(e){const t=this;if(JQX.ListBox.DragDrop.Dragging)return t._applyItemFeedback(e),t._moveHandler(e),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}_touchmoveHandler(e){if(JQX.ListBox.DragDrop.Dragging&&e.cancelable)return e.preventDefault(),void e.stopPropagation();super._touchmoveHandler(e)}_applyItemFeedback(e){const t=this,i=e.originalEvent.target,r=i.closest?i.closest("jqx-list-item"):i;JQX.Utilities.Core.isMobile?JQX.ListBox.DragDrop.DropDetails={item:JQX.ListBox.DragDrop.Item,position:"bottom"}:0!==t.items.length&&(r?r._itemOnMouseMove(e):t.items[t.items.length-1]._itemOnMouseMove(e,!0))}_moveHandler(e){const t=this;if(!JQX.ListBox.DragDrop.Feedback||JQX.ListBox.DragDrop.DraggedFrom!==t)return;const i=t.dragOffset;if(JQX.ListBox.DragDrop.Dragging){JQX.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",JQX.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.$.fireEvent("dragging",{item:JQX.ListBox.DragDrop.Item,data:JQX.ListBox.DragDrop,originalEvent:e.originalEvent});for(let t=0;t<JQX.ListBox.DragDrop.ListBoxes.length;t++){const i=JQX.ListBox.DragDrop.ListBoxes[t];i._dragInterval&&clearInterval(i._dragInterval),i._dragInterval=setInterval((function(){const t=i.getBoundingClientRect();t.left<=e.clientX&&t.left+t.width>=e.clientX&&(e.clientY>=t.top&&e.clientY<=t.top+20?i.scrollTop-=2:e.clientY>=t.top+t.height-20&&e.clientY<=t.top+t.height&&(i.scrollTop+=2))}),1)}return e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}{const r=Math.abs(e.pageX-JQX.ListBox.DragDrop.StartPosition.left),o=Math.abs(e.pageY-JQX.ListBox.DragDrop.StartPosition.top),s=new Date-JQX.ListBox.DragDrop.StartTime;let n=r>=5&&r<=15||o>=5&&o<=15;if(JQX.Utilities.Core.isMobile&&(s<300||s>1e3)&&(n=!1),n){JQX.ListBox.DragDrop.Dragging=!0,JQX.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",JQX.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.getShadowRootOrBody().appendChild(JQX.ListBox.DragDrop.Feedback),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation();const r=JQX.ListBox.DragDrop.Item,o=r.ownerListBox;o.$.fireEvent("dragStart",{item:r,data:JQX.ListBox.DragDrop,container:o,previousContainer:o,originalEvent:e.originalEvent}),document.body.classList.add("jqx-dragging")}}}_focusHandler(){this._focused=!0,this.setAttribute("focus","")}_blurHandler(){this._focused=!1,this.removeAttribute("focus")}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.isVirtualized?(t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)):(e.dataItem=e,t.shadowRoot&&"light"===t.shadowDomMode?t.appendChild(e):t.$.itemsInnerContainer.appendChild(e),t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)),t._isUpdating||(t._refreshItems(),t._refreshSelection())}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}i.isVirtualized?(i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)):(e.dataItem=e,t.parentNode.insertBefore(e,t),i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)),i._refreshItems(),i._refreshSelection()}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}if(t.isVirtualized)t._items.splice(t._indexOf(e),1);else if(e.parentNode){const i=t.selectedIndexes.slice(0),r=t.selectedValues.slice(0),o=i.indexOf(e.dataIndex);e.parentNode.removeChild(e),o>-1&&(i.splice(o,1),r.splice(o,1),t.selectedIndexes=i,t.selectedValues=r)}t._refreshItems()}propertyChangedHandler(e,t,i){if("dataSource"===e&&(!i||i&&Array.isArray(i)&&0===i.length))return void this.clearItems();super.propertyChangedHandler(e,t,i);const r=this;switch(e){case"innerHTML":r.clearSelection(),r._dataBind(),r.innerHTML=r.content=JQX.Utilities.Core.html(r.$.content);break;case"dataSource":case"valueMember":case"groupMember":case"displayMember":r.clearSelection(),r._dataBind(),r._applyDefaultSelection();break;case"disabled":case"unfocusable":r._setFocusable();break;case"displayLoadingIndicator":r._setLoadingIndicatorVisibility();break;case"filterable":r._refreshFilter(),r._refreshLayout();break;case"grouped":if(i?r._group():r._ungroup(),"radioButton"===r.selectionMode){if(r.selectedValues.length>0){const e=r.selectedValues;r.clearSelection(),r.select(e[0])}}else r._refreshSelection();r._refreshLayout();break;case"itemTemplate":{if(null===i||""===i)return r._items.map((e=>e.innerHTML=e.label)),delete r._bindingDetails,void r._refreshLayout();const e=r.querySelectorAll("jqx-list-item"),t=function(){r._handleItemTemplate(i)&&(r._items.map((e=>r._applyTemplate(e))),r._refreshLayout()),r.ownerElement&&r.ownerElement._setDropDownSize&&r.ownerElement._setDropDownSize(),r.$.fireEvent("bindingComplete")};0===e.length?t():r._ensureItemsReady(e,t);break}case"selectedIndexes":case"selectedValues":{let o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);if(!r._items||0===r._items.length)return r.selectedIndexes=[],r.selectedValues=[],void(r.$.hiddenInput.value=r.selectedValues.toString());if(r._propertyChanging=!0,"selectedIndexes"===e){o=t.slice(0),r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r._items[t];o&&("oneOrManyExtended"===r.selectionMode||"oneOrMany"===r.selectionMode?(r.selectedIndexes.length>0&&0===e&&r.clearSelection(),r._select(o)):r.select(o))}}else{s=t.slice(0),r.selectedValues=[],r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r.getItem(t);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}}if(r.selectedIndexes.length>0&&r._focus(r._items[r.selectedIndexes[0]]),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(r.selectedIndexes.length>0){const e=r._items[r.selectedIndexes[r.selectedIndexes.length-1]];void 0!==e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}else i.selected=!1,i.disabled=!1,i.index=-1,i.label="",i.value="";r.$.fireEvent("change",i),r._updateTargetValue()}break}case"selectionMode":{const e="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);r._propertyChanging=!0;const n=r.selectedValues;r.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(i)),r.selectedValues=[],r.clearSelection();for(let e=0;e<n.length;e++){const t=n[e],i=r.getItem(t);i&&("oneOrManyExtended"===r.selectionMode?r._select(i):r.select(i))}if(r._items.forEach((t=>t.displayMode=e)),r._recycle(),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(o.length>0){const e=r._items[o[o.length-1]];e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}r.$.fireEvent("change",i),r._updateTargetValue()}r._applyAriaSelected(),"checkBox"!==i&&"radioButton"!==i&&"checkBox"!==t&&"radioButton"!==t||r._refreshLayout();break}case"topVisibleIndex":r._setTopVisibleIndex(i);break;case"autoSort":r._canSort=i;break;case"alternationStart":case"alternationEnd":case"alternationCount":r._refreshItems(),r._refreshLayout();break;case"sortDirection":case"sorted":{r._canSort=!0,i?r._sort():r._unsort();const e=r.selectedValues;r.selectedValues=[],r._refreshSelection();for(let t=0;t<e.length;t++){const i=e[t],o=r.getItem(i);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}r._refreshLayout(),r._canSort=r.autoSort;break}}}_refreshSelection(){const e=this;if(!e._items||0===e._items.length)return;const t=e.selectedValues;e.selectedIndexes=[],e.selectedValues=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected=!1,t.indexOf(r.value)>-1&&e.select(r)}e._recycle()}clearSelection(){const e=this;if(!e._items||0===e._items.length)return;let t=[];for(let i=0;i<e._items.length;i++)e._items[i].selected&&t.push(e._items[i]);e._items.map((e=>e.selected=!1)),e.selectedValues.slice(0);const i=e.selectedIndexes.slice(0);if(e.selectedIndexes=[],e.selectedValues=[],e.$.hiddenInput.value=e.selectedValues.toString(),e._recycle(),e.context!==e){let r={addedItems:[],removedItems:t};if(i.length>0){const t=e._items[i[i.length-1]];t&&(r.selected=t.selected,r.disabled=t.disabled,r.index=e._indexOf(t),r.label=t.label,r.value=t.value)}e.$.fireEvent("change",r),e._updateTargetValue()}}ensureVisible(e){const t=this;if(e)return!("string"==typeof e&&!(e=t.getItem(e))||(t.isVirtualized||t.$.itemsContainer.scrollTop===t.scrollTop||(t.scrollTop=t.$.itemsContainer.scrollTop),e.top+e.height>=t.scrollTop+t.offsetHeight&&(t.scrollTop=t.scrollTop+e.height,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),(e.top<=t.scrollTop||e.top>=t.scrollTop+t.$.itemsContainer.offsetHeight)&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0===t._indexOf(e)||1===t._indexOf(e)&&t._items.length>1&&t._items[0].grouped?(t.scrollTop=0,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)):t._indexOf(e)===t._items.length-1&&(t.scrollTop=t.scrollHeight,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0))}get items(){const e=this;if(!window.__karma__&&!window.karma&&e instanceof Element&&e.isRendered&&e.hasAttribute&&e.hasAttribute("jqx-blazor")){let t=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];t.push({label:r.label,value:r.value})}return t}return e._filteredItems?e._filteredItems:e._items}getItems(){const e=this,t=e._filteredItems?e._filteredItems:e._items;let i=[];if(t&&t.length>0)for(let e=0;e<t.length;e++){const r=t[e];i.push({label:r.label,value:r.value})}return i}ready(){super.ready();const e=this;if(e.shadowRoot&&"light"===e.shadowDomMode){const t=document.createDocumentFragment();[].slice.call(e.$.itemsInnerContainer.children).map((e=>t.appendChild(e))),e.appendChild(t),e.$.itemsInnerContainer.appendChild(document.createElement("slot"))}e._areCSSVarsSupported=JQX.Utilities.Core.CSSVariablesSupport(),e.isUpdating=0,e._scrollView&&(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar),e._scrollView.hScrollBar.$.addClass("jqx-hidden"),e._scrollView.vScrollBar.$.addClass("jqx-hidden"));const t=e._scrollView.vScrollBar,i=e._scrollView.hScrollBar;t.hasStyleObserver=!1,i.hasStyleObserver=!1,t.hasResizeObserver=!1,i.hasResizeObserver=!1,t.wait=!1,i.wait=!1,e._setFocusable()}render(){const e=this;e.setAttribute("role","listbox"),e.setAttribute("aria-orientation","vertical"),e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._keysPressed={},e._incrementalSearchQuery="",e._incrementalSearchItems=[],e._canSort=!0,e._previousEntry="",e._setLoadingIndicatorVisibility(),e._refreshFilter(),e._initializeInnerHTML(),e._dataBind(),e._applyDefaultSelection(),e.enableShadowDOM&&HTMLElement.prototype.appendChild.apply(e,[e.$.hiddenInput]),e.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(e.selectionMode)),super.render()}_lazyInitItems(){const e=this;if(e._inLazyInit)return cancelAnimationFrame(JQX.ListBox.processTimer),void delete JQX.ListBox.processTimer;e._inLazyInit=!0,e.dataSource||(e.clearSelection(),e._dataBind(),e._applyDefaultSelection()),cancelAnimationFrame(JQX.ListBox.processTimer),delete JQX.ListBox.processTimer,e._inLazyInit=!1}_applyDefaultSelection(){const e=this;!e._focusedItem&&e._items&&e._items.length>0&&0===e.selectedIndexes.length&&("one"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"oneOrManyExtended"!==e.selectionMode||e.select(e._items[0]))}attached(){const e=this;super.attached(),JQX.ListBox.DragDrop||(JQX.ListBox.DragDrop={ListBoxes:[]}),JQX.ListBox.DragDrop.ListBoxes.push(e),e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.selectedIndexes.length>0&&e._items&&e.ensureVisible(e._items[e.selectedIndexes[0]])}detached(){const e=this;if(super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),JQX.ListBox.DragDrop&&JQX.ListBox.DragDrop.ListBoxes){const t=JQX.ListBox.DragDrop.ListBoxes.indexOf(e);JQX.ListBox.DragDrop.ListBoxes.splice(t,1)}}_createItem(e,t,i){const r=this,o="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",s=i?{}:document.createElement("jqx-list-item");s.ownerListBox=r,"number"==typeof e&&(e=""+e);const n=function(t,i){return void 0!==e[t]?""+e[t]:e[i]};let l="string"==typeof e?e:n(r.displayMember,"label"),a="string"==typeof e?e:n(r.valueMember,"value"),d=n(r.groupMember,"group");return void 0===l&&(l=void 0!==t?""+t:""),s.label=s.innerHTML=""+l,void 0===a&&(a=void 0!==t?""+t:l),e.color&&(s.color=e.color),s.value=""+a,s.displayMode=o,s.selected=!!e.selected&&e.selected,s.disabled=!!e.disabled&&e.disabled,s.dataItem=s,void 0!==t&&(s.dataIndex=t),r._alternateItem(s),e.title&&(s.title=e.title),d&&(s.group=""+d),s}_alternateItem(e){const t=this,i=t.alternationStart,r=t.alternationEnd>0?t.alternationEnd:1/0;t.alternationCount<=0||(void 0===t._alternationIndexCounter&&(t._alternationIndexCounter=0),e.dataIndex>=i&&e.dataIndex<=r&&(e.alternationIndex=t._alternationIndexCounter++,t._alternationIndexCounter===t.alternationCount&&(t._alternationIndexCounter=0)))}_beginUpdate(){this.isUpdating++}_isUpdating(){return this.isUpdating>0}_endUpdate(){this.isUpdating--}get _scrollHeight(){const e=this;if(0===e._items.length||e._items.filter((e=>!e.hidden)).length<1)return 0;let t=0;if(e.isVirtualized){if(e.__scrollHeight)return e.__scrollHeight;if(0===e._items.length)return 0;e.isUpdating++;const i=e._createItem(e._items[0]);e.$.itemsInnerContainer.appendChild(i);for(let r=0;r<e._items.length;r++){const o=e._items[r];o.hidden?(o.height=0,o.top=t):(e.itemHeight?(e.itemHeight<32&&(e.itemHeight=32),o.height=e.itemHeight):(i.$&&i.$.itemContainer?i.$.itemContainer.firstElementChild.innerHTML=o.label:i.label=o.label,o.height=i.offsetHeight),o.top=t,t+=o.height)}e.$.itemsInnerContainer.removeChild(i),e.__scrollHeight=t-e.$.itemsInnerContainer.offsetHeight,e.filterable&&(e.__scrollHeight+=e.$.filterInput.offsetHeight),t=e.__scrollHeight,e.isUpdating--}else{for(let i=0;i<e._items.length;i++){const r=e._items[i];r.hidden?(r.height=0,r.top=t):(e.itemHeight?"auto"!==e.itemHeight&&(r.height=e.itemHeight,r.style.height=r.height+"px"):r.height=r.offsetHeight,r.top=r.offsetTop,t+=r.height)}t=e.$.itemsInnerContainer.scrollHeight-e.$.itemsInnerContainer.offsetHeight,e.filterable&&t>0&&(t+=e.$.filterInput.offsetHeight),e.__scrollHeight=t}return t}_initializeRecyclingItems(){const e=this;if(!e.dataSource||e.dataSource&&0===e.dataSource.length||!e.isVirtualized)return;let t=0,i=e.offsetHeight||400;e.$.itemsInnerContainer.innerHTML="",e._recyclingItems=[];const r=function(r){for(let o=0;o<r.length;o++){const s=r[o],n=e._createItem(s);if(e.itemHeight&&"auto"!==e.itemHeight&&(n.style.height=e.itemHeight+"px"),e.$.itemsInnerContainer.appendChild(n),t+=n.offsetHeight,n.dataItem=e._items[o],e._recyclingItems.push(n),t>1.5*i)break}};if("function"==typeof e.dataSource){let e=[];for(let t=0;t<100;t++)e.push("");r(e)}else{r(e.dataSource);let o=0;for(;t<1.5*i&&++o<5;)r(e.dataSource)}}dataBind(){const e=this;e.clearSelection(),e._dataBind(),e._applyDefaultSelection()}_dataBind(){const e=this;if(e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),"function"==typeof e.dataSource){e._items=[],delete e._filteredItems;const t=e.dataSource("",(t=>{e.clearItems(),e.insert(0,t)}));t&&Array.isArray(t)&&(e.clearItems(),e.insert(0,t))}if("string"==typeof e.dataSource&&(e.dataSource=JSON.parse(e.dataSource)),null!==e.dataSource&&Array.isArray(e.dataSource)){e.isUpdating++;const t=t=>{e._items=[],e._groups=[],delete e._filteredItems;const i=e.dataSource;for(let r=0;r<i.length;r++){const o=i[r],s=e._createItem(o,r,!t);e._items[r]=s,t&&t.appendChild(s)}};if(e.isVirtualized)t(),e._initializeRecyclingItems();else{const i=document.createDocumentFragment();e.$.itemsInnerContainer.innerHTML="",t(i),e.$.itemsInnerContainer.appendChild(i)}e.isUpdating--}const t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item"),i=function(){e.isUpdating++,e.dataSource||(e._initializeHtmlListItems(),e._initializeHtmlListGroups()),e.grouped&&e._group(),e.sorted&&e._sort(),e._refreshLayout(),e._initializeSelection(),e.isInitialized=!0,e._canSort=e.autoSort,e.isUpdating--,e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&(e._items.map((t=>e._applyTemplate(t))),e._refreshLayout()),e.__onCompleted&&(e._onCompleted=e.__onCompleted,e.__onCompleted=null,e._onCompleted()),e.topVisibleIndex>-1&&e._setTopVisibleIndex(e.topVisibleIndex),e.$.fireEvent("bindingComplete"),e._updateTopVisibleIndex(),0===e._items.length&&e.clearItems(),e._applyAriaSelected()};0===t.length?i():(e._onCompleted&&(e.__onCompleted=e._onCompleted,e._onCompleted=null),e._ensureItemsReady(t,i))}_ensureItemsReady(e,t){const i=this,r=function(){const i=function(t){for(let i=0;i<e.length;i++)e[i].context="node"===t?e[i]:document};i("node"),t(),i()};if(0===e.length)r();else{i._nodesReadyListeners=0;for(let t=0;t<e.length;t++){const o=e[t],s=function(){i._nodesReadyListeners--,0===i._nodesReadyListeners&&(r(),delete i._nodesReadyListeners)}.bind(i);o.isCompleted||(i._nodesReadyListeners++,o._onCompleted=s)}0===i._nodesReadyListeners&&r()}}_initializeInnerHTML(){const e=this;e.$.itemsInnerContainer.innerHTML.indexOf("<option")>=0?e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<optgroup/gi,"<jqx-list-items-group").replace(/<\/optgroup/gi,"</jqx-list-items-group").replace(/<option/gi,"<jqx-list-item").replace(/<\/option/gi,"</jqx-list-item"):e.$.itemsInnerContainer.innerHTML.indexOf("<ul")>=0&&(e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<ul/gi,"<jqx-list-items-group").replace(/<\/ul/gi,"</jqx-list-items-group").replace(/<li/gi,"<jqx-list-item").replace(/<\/li/gi,"</jqx-list-item"))}_initializeHtmlListItems(){const e=this,t=e.shadowRoot&&"shadow"===e.shadowDomMode?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item"),i="checkBox"===e.selectionMode||"radioButton"===e.selectionMode?e.selectionMode:"plain",r=function(e,t,i){return void 0!==e[t]?""+e[t]:e[i]};e._items=[];let o=0;for(let s=0;s<t.length;s++){const n=t[s];n.dataIndex=s,n.label=n.innerHTML,n.dataItem=n,n.top||(n.top=o),n.height||(n.height=n.offsetHeight),o+=n.height,n.value||(n.value=""+s);const l=r(n,e.displayMember,"label"),a=r(n,e.valueMember,"value"),d=r(n,e.groupMember,"group");n.label!==l&&(n.label=l),n.value!==a&&(n.value=a),n.group!==d&&(n.group=d);const c=n.context;n.context=document,n.displayMode=i,n.context=c,e._alternateItem(n),n.selected&&(e.selectedIndexes.push(s),e.selectedValues.push(n.value)),e._items.push(n)}e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._items.map((t=>e._applyTemplate(t)))}_group(){const e=this;e.isUpdating++;let t=[],i=[];e._canSort&&e._unsort();for(let i=0;i<e._items.length;i++){const r=e._items[i];let o=r.group?r.group.trim():r.innerHTML.charAt(0)||r.label.charAt(0);o+=" ",t[o]?t[o].items.push(r):t[t.length++]=t[o]={items:[r],label:o}}if(e.isVirtualized){e._groups=[];for(let e=0;e<t.length;e++){const r=t[e];r.dataIndex=e,r.grouped=!0,r.hidden=!1,r.displayMode="plain",i.push(r);for(let o=0;o<t[e].items.length;o++){const e=r.items[o];e.group=r,i.push(e)}}e._groups=t,e._items=i}else{for(;e.$.itemsInnerContainer.firstChild;)e.$.itemsInnerContainer.removeChild(e.$.itemsInnerContainer.firstChild);const r=document.createDocumentFragment();e._groups=[];for(let o=0;o<t.length;o++){const s=t[o],n=document.createElement("jqx-list-items-group");n.label=s.label,n.dataIndex=o;for(let e=0;e<t[o].items.length;e++){const t=s.items[e];i.push(t),t.group=s.label,n.appendChild(t)}e._groups.push(n),r.appendChild(n)}e._items=i,/Trident|Edge/.test(navigator.userAgent)?setTimeout((function(){e.$.itemsInnerContainer.appendChild(r)}),50):e.$.itemsInnerContainer.appendChild(r)}e.sorted&&e._sort(),e.isUpdating--}_ungroup(){const e=this;e.isUpdating++,e._groups=[],e._canSort&&e._unsort();let t=[];if(e.isVirtualized)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.grouped||t.push(r)}else{const i=document.createDocumentFragment();for(let r=0;r<e._items.length;r++){const o=e._items[r];i.appendChild(o),t.push(o)}t.length>0&&(e.$.itemsInnerContainer.innerHTML="",e.$.itemsInnerContainer.appendChild(i))}e._items=t,e.sorted&&e._sort(),e.isUpdating--}_initializeHtmlListGroups(){const e=this,t=e.$.itemsInnerContainer.querySelectorAll("jqx-list-items-group");e._groups=[];for(let i=0;i<t.length;i++){const r=t[i];r.dataIndex=i,e._groups.push(r)}}_initializeSelection(){const e=this,t=e.selectedIndexes.slice(0),i=e.selectedValues.slice(0);e.clearSelection(),"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!0);for(let r=0;r<e._items.length;r++){const o=e._items[r];(t.indexOf(r)>=0||i.indexOf(o.value||o.label)>=0)&&(e._focusedItem&&(e._focusedItem._focused=!1),e._focusedItem=null,e.select(o))}"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!1)}onItemUpdated(){const e=this;e.isInitialized&&!e._isUpdating()&&(e.isUpdating++,e._refreshLayout(),e.isUpdating--)}_refreshItems(){const e=this;if(e.isInitialized&&!e._isUpdating()){if(e.isUpdating++,e.grouped?e._ungroup():e.sorted&&e._canSort&&e._unsort(),!e.isVirtualized){e._items=[];const t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-list-item"):e.querySelectorAll("jqx-list-item");for(let i=0;i<t.length;i++)t[i].dataIndex=i,e._alternateItem(t[i]),e._items.push(t[i])}e.grouped?e._group():e.sorted&&e._sort(),e._refreshLayout(),e.isUpdating--}}_applyIncrementalSearch(e){const t=this;null===t.incrementalSearchDelay||isNaN(t.incrementalSearchDelay)||["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control","Home","End","PageUp","PageDown"].indexOf(e)>-1||(0!==t._incrementalSearchQuery.indexOf(e)&&(t._incrementalSearchQuery+=e),t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t._incrementalSearch(),t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),t.incrementalSearchDelay))}select(e){const t=this;if(("string"!=typeof e||(e=t.getItem(e)))&&("number"!=typeof e||(e=t.getItem(e)))&&!(e.grouped||e.readonly||!t._items.length||e instanceof HTMLElement&&!t.contains(e)&&!t.virtualized)){if("none"===t.selectionMode)return t.selectedIndexes=[],void(t.selectedValues=[]);switch(!t._focusedItem!==e&&"none"!==t.selectionMode&&(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,e._focused=!0),t.selectionMode){case"one":case"zeroAndOne":return(1!==t.selectedIndexes.length||t.selectedIndexes[0]!==t._indexOf(e))&&(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"zeroOrOne":return 1===t.selectedIndexes.length&&t.selectedIndexes[0]===t._indexOf(e)?(t.unselect(e),!0):(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"radioButton":if(t._previouslySelectedIndexes=t.selectedIndexes,t.$.itemsInnerContainer.querySelectorAll("jqx-list-items-group").length>0){const i=e.parentNode;if(!e.selected){for(let e in i.children){const r=i.children[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}if(t.isVirtualized&&t._groups.length>0){const i=e.group;if(!e.selected){for(let e in i.items){const r=i.items[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}return e.selected||(t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e)),delete t._previouslySelectedIndexes,!0;case"oneOrMany":return e.selected?t.selectedIndexes.length>1&&t.unselect(e):t._select(e),!0;case"zeroOrMany":case"checkBox":return e.selected?t.unselect(e):t._select(e),!0;case"oneOrManyExtended":{const i=t.selectedValues;if(t._keysPressed.Control)return t.selectedIndexes.length>1&&e.selected?(t.unselect(e),t._focus(t._items[t.selectedIndexes[0]])):t._select(e),!0;if(t._keysPressed.Shift){const r=t._items[t.selectedIndexes[0]];let o;t.clearSelection();const s=i.indexOf(r.value)>=0||r.selected;if(t._select(r,s),t._indexOf(r)>t._indexOf(e))for(o=t._indexOf(r)-1;o>=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o--}else for(o=t._indexOf(r)+1;o<=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o++}const n=[];for(let e=0;e<i.length;e++)n.push(t.getItem(i[e]));if(n.length>0&&!t._propertyChanging){let r=[];for(let e=0;e<t.selectedValues.length;e++){const o=t.selectedValues[e];i.indexOf(o)<0&&r.push(t.getItem(o))}t.$.fireEvent("change",{addedItems:r,removedItems:n,selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue()}return!0}for(let r=0;r<i.length;r++){const o=i[r],s=t.getItem(o);e!==s&&t.unselect(s)}return t.clearSelection(),t._select(e,i.indexOf(e.value)>=0),!0}}return!1}}_applyTemplate(e,t){const i=this;if(null===i.itemTemplate)return;if("function"==typeof i.itemTemplate)return void i.itemTemplate(e,{label:e.label,value:e.value,index:i._items.indexOf(e)});if(!i._bindingDetails||0===i._bindingDetails.length)return;const r=i._bindingDetails.length;let o,s,n=document.importNode(i._template.content,!0);for(let t=0;t<r;t++){o=n.childNodes[i._bindingDetails[t].childNodeIndex],s=i._bindingDetails[t].bindingString.length;for(let r=0;r<s;r++){const s=i._bindingDetails[t].bindingString[r],n=s.indexOf("label")>=0?e.label:e.value;o.innerHTML=o.innerHTML.replace(s,n)}}e.innerHTML="";for(let t=0;t<n.childNodes.length;t++)n.childNodes[t].outerHTML&&(e.innerHTML+=n.childNodes[t].outerHTML);!1!==t&&(i._scrollHeightTimer&&(clearInterval(i._scrollHeightTimer),i._scrollHeightCounter=0),i._scrollHeightTimer=setInterval((function(){i._lastScrollHeight===i.$.itemsInnerContainer.scrollHeight&&10!==i._scrollHeightCounter||(i._refreshLayout(),clearInterval(i._scrollHeightTimer)),i._lastScrollHeight=i.$.itemsInnerContainer.scrollHeight,i._scrollHeightCounter++}),50))}_filterItems(e,t,i){const r=this,o=r.$.filterInput.value;let s,n;const l=function(){if(0===n.length)return r._filteredItems=[],void(t&&t());s=r._queryItems(o,r.filterMode);for(let e=0;e<n.length;e++)n[e].hidden=!0,n[e].$&&n[e].$.addClass("jqx-hidden");for(let e=0;e<s.length;e++){const t=s[e];t.hidden=!1,n[e].$&&t.$.removeClass("jqx-hidden")}if(r.grouped&&r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=t.items;let o=!0;for(let e=0;e<i.length;e++)i[e].hidden||(o=!1);o&&(t.hidden=!0)}if(r.grouped&&!r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=[].concat(...t.querySelectorAll("jqx-list-item"));let o=!0;for(let e=0;e<i.length;e++)i[e].$.hasClass("jqx-hidden")||(o=!1);o?t.$.addClass("jqx-hidden"):t.$.removeClass("jqx-hidden")}if(r._filteredItems=s,r._refreshLayout(),t&&t(),e)return;const i=r._propertyChanging;r._propertyChanging=!0,r._refreshSelection(),r._propertyChanging=i};if("function"==typeof r.dataSource)if(o||i){const e=function(e){(o||i)&&r.isAttached&&(r._updateListBoxAfterQuery=function(){s=n=r._items,l()},r.clearItems(),r.insert(0,e))},t=r.dataSource(o,e);if(t){if(!o&&!i)return;r._updateListBoxAfterQuery=function(){s=n=r._items,l()},r.clearItems(),r.insert(0,t)}}else r.clearItems(),s=n=r._items,l(),r.$.fireEvent("bindingComplete");else{if(n=r._items,0===n.length)return;l()}}_getNextItem(e){const t=this._items,i=this._items.length;let r=Math.max(e+1,0);for(;r<i;){const e=t[r];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;r++}return t[e]}_getPreviousItem(e){const t=this._items;let i=Math.max(e-1,0);for(;i>-1;){const e=t[i];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;i--}return t[e]}get _scrollWidth(){const e=this,t=e._items;return e.__scrollWidth||(e.__scrollWidth=(()=>{const e=this,i=e.virtualized,r=e.itemMeasureMode;let o=0,s="";function n(t){const i=e._createItem({label:t});i.style.position="absolute",e.$.itemsContainer.appendChild(i),i.label=t,i.style.width="auto",i.isCompleted&&(i.$.itemContainer.style.width="auto");const r=getComputedStyle(i),o=parseInt(r.paddingLeft)+parseInt(r.paddingRight),s=i.$.itemContainer||i,n=s.offsetWidth+s.offsetLeft+o;return i.parentNode.removeChild(i),n}for(let e=0;e<t.length;e++){const l=t[e];if(!l.hidden)if("auto"===r){const e=i?l.label:l.textContent.trim();e.length>s.length&&(s=e)}else o=Math.max(o,n(l.label))}return"auto"===r?n(s):o})()),e.__scrollWidth}update(e,t){const i=this,r=i._items[e];if(r){if("string"==typeof t)r.label=t,void 0===r.value&&(r.value=t);else for(let e in t)"selected"===e&&r[e]!==t[e]?i.select(r):r[e]=t[e],"group"===e&&i._refreshItems();(i.sorted||i.grouped||i.isVirtualized)&&(i._refreshItems(),i._refreshSelection())}else i.error(i.localize("indexOutOfBound",{elementType:i.nodeName.toLowerCase(),method:"update"}))}insert(e,t){const i=this;let r=[];if((!e||e<0)&&(e=0),Array.isArray(t)){i.isUpdating++;const o=0===i._items.length;for(let s=0;s<t.length;s++){const n=t[s],l=i._createItem(n);r.push(l),e>=i._items.length||0===i._items.length||o?i.appendChild(l):i.insertBefore(l,i._items[e])}i.isUpdating--}else{const o=i._createItem(t);r.push(o),e>=i._items.length||0===i._items.length?i.appendChild(o):i.insertBefore(o,i._items[e])}if(r.length>0?(r.map((e=>i._applyTemplate(e))),i._ensureItemsReady(r,(function(){i._refreshItems(),0!==i._items.length&&(i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i._refreshSelection(),i.$.fireEvent("bindingComplete"))}))):i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i.virtualized&&i.filterable){const e=i.context;i.context=i,i.filterable&&(i.$.filterInput.value="",i._filterItems()),i.scrollTop=i.$.itemsContainer.scrollTop=0,i.scrollLeft=i.$.itemsContainer.scrollLeft=i._getScrollLeft(0),i.context=e}}add(e){const t=this;let i=[];if(e&&(!e||0!==e.length)){if(Array.isArray(e)){t.isUpdating++;for(let r=0;r<e.length;r++){const o=e[r],s=t._createItem(o);i.push(s),t.appendChild(s)}t.isUpdating--}else{const r=t._createItem(e);i.push(r),t.appendChild(r)}if(i.length>0?(i.map((e=>t._applyTemplate(e))),t._ensureItemsReady(i,(function(){t._refreshItems(),0!==t._items.length&&(t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t._refreshSelection(),t.$.fireEvent("bindingComplete"))}))):t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t.virtualized&&t.filterable){const e=t.context;t.context=t,t.filterable&&(t.$.filterInput.value="",t._filterItems()),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}else t.virtualized&&t._refreshLayout()}}removeAt(e){const t=this,i=t._items[e];i?(i.selected&&t.unselect(i),t.isVirtualized?t._items.splice(e,1):i.parentNode.removeChild(i),t._refreshItems(),t._refreshSelection(),0===t.selectedIndexes.length&&t._items.length>0&&("oneOrMany"!==t.selectionMode&&"one"!==t.selectionMode&&"oneOrManyExtended"!==t.selectionMode||t.select(t._items[0]))):t.error(t.localize("indexOutOfBound",{elementType:t.nodeName.toLowerCase(),method:"remove"}))}_queryItems(e,t){const i=this,r=[],o=function(r,o){if(r.grouped)return r;switch(t){case"startsWith":if(0===r.label.indexOf(o))return r;break;case"startsWithIgnoreCase":if(0===r.label.toLowerCase().indexOf(o.toLowerCase()))return r;break;case"doesNotContain":if(r.label.indexOf(o)<0)return r;break;case"doesNotContainIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())<0)return r;break;case"contains":if(r.label.indexOf(o)>-1)return r;break;case"containsIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())>-1)return r;break;case"equals":if(0===r.label.localeCompare(o))return r;break;case"equalsIgnoreCase":if(0===r.label.toLowerCase().localeCompare(o.toLowerCase()))return r;break;case"endsWith":if(r.label.endsWith(o))return r;break;case"endsWithIgnoreCase":if(r.label.toLowerCase().endsWith(o.toLowerCase()))return r;break;case"custom":if(i.filterCallback(r,e))return r}return null};if(0===e.length)return i._items;for(let t=0;t<i._items.length;t++){const s=o(i._items[t],e);s&&r.push(s)}return r}_select(e,t){const i=this,r=i.selectedIndexes.indexOf(i._indexOf(e)),o=i.selectedIndexes.slice(0),s=i.selectedValues.slice(0);if(e.selected=!0,-1!==r)return i._recycle(),!1;if(o.push(i._indexOf(e)),s.push(e.value||e.label),i.selectedIndexes=o,i.selectedValues=s,i._recycle(),i.$.hiddenInput.value=s.toString(),!i.isCompleted||t||!i.isInitialized||i._propertyChanging)return;let n=[];if(i._previouslySelectedIndexes){for(let e=0;e<i._previouslySelectedIndexes.length;e++)i.selectedIndexes.indexOf(i._previouslySelectedIndexes[e])<0&&n.push(i._items[i._previouslySelectedIndexes[e]]);delete i._previouslySelectedIndexes}return i.$.fireEvent("change",{addedItems:[e],removedItems:n,selected:e.selected,disabled:e.disabled,index:i._indexOf(e),label:e.label,value:e.value}),i._updateTargetValue(),!0}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const i=e.dataset.property,r=e.value;i&&void 0!==t[i]&&(t[i]=r)}}}_setTopVisibleIndex(e){const t=this;if("number"==typeof e&&(t.topVisibleIndex=Math.max(0,e),e=t._items[t.topVisibleIndex]),!e)return!1;e.top!==t.scrollTop&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop),t.scrollHeight===t.scrollTop&&t._updateTopVisibleIndex())}_updateTopVisibleIndex(){const e=this,t=e.scrollTop+e._scrollView.verticalScrollBar.offsetHeight-e.offsetHeight;let i;if(e.scrollTop<e.scrollHeight/2){for(let r=0;r<e._items.length;r++)if(e._items[r].top>=t){i=e._items[r];break}}else for(let r=e._items.length-1;r>=0&&!(e._items[r].top<t);r--)i=e._items[r];if(i){const t=e.context;e.context=e,e.topVisibleIndex=i.dataIndex,e.context=t}}unselect(e){const t=this;if(!e)return;if("string"==typeof e&&!(e=t.getItem(e)))return;if("none"===t.selectionMode)return void t.clearSelection();const i=t.selectedIndexes.indexOf(t._indexOf(e)),r=t.selectedIndexes.slice(0),o=t.selectedValues.slice(0);return e.selected=!1,i>=0&&(r.splice(i,1),o.splice(i,1),t.selectedIndexes=r,t.selectedValues=o,t.$.hiddenInput.value=o.toString(),t.isCompleted&&!t._propertyChanging?(t.$.fireEvent("change",{addedItems:[],removedItems:[e],selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue(),t._recycle(),!0):void 0)}_handleItemTemplate(e){if(null===e||!e)return;if("function"==typeof e)return e;const t=this;if(!("content"in document.createElement("template")))return t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()})),void(t.itemTemplate=null);if(null===(e=document.getElementById(e))||!("content"in e))return t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"itemTemplate"})),void(t.itemTemplate=null);const i=e.content,r=i.childNodes.length,o=/{{\w+}}/g;let s,n;t._bindingDetails=[],t._template=e;for(let e=0;e<r;e++){for(n=[];s=o.exec(i.childNodes[e].innerHTML);)n.push(s[0]);n.length>0&&t._bindingDetails.push({childNodeIndex:e,bindingString:n})}return!0}_handleKeyStrokes(e){const t=this,i="radioButton"===t.selectionMode||"checkBox"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode;let r=t._items;if(t.filterable&&t.$.filterInput.value.length>0&&(r=t._filteredItems),!t.disabled&&!t.readonly&&r.length){switch(e){case"ArrowLeft":case"ArrowUp":t._handleArrowKeys(!0);break;case"ArrowRight":case"ArrowDown":t._handleArrowKeys(!1);break;case" ":{if(t.selectedIndexes.length<1&&!t._focusedItem)return;const e=t._focusedItem?t._focusedItem:t._items[t.selectedIndexes[t.selectedIndexes.length-1]],i=e=>{e.selected&&"radioButton"!==t.selectionMode?t.unselect(e):t.select(e)};if("oneOrMany"===t.selectionMode)return void(e.selected&&t.selectedIndexes.length>1?i(e):e.selected||i(e));i(e);break}case"Home":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[0])),t._focus(r[0]),t.scrollTop=0;break;case"End":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[r.length-1])),t._focus(r[r.length-1]),t.scrollTop=t.scrollHeight;break;case"PageUp":t._pageUpKeyHandler(r);break;case"PageDown":t._pageDownKeyHandler(r)}t._recycle()}}_horizontalScrollbarHandler(e){const t=this;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollLeft=t._getScrollLeft(e.detail.value)}_getScrollLeft(e,t){const i=this;if(!i.rightToLeft)return e;if(JQX.Utilities.Core.Browser.Chrome){if(!t){const e=2*(parseInt(getComputedStyle(i.$.itemsInnerContainer).getPropertyValue("--jqx-list-item-horizontal-offset"))||0);t=i._scrollWidth-i.$.itemsContainer.offsetWidth-e}e=t-e}else e*=-1;return e}_unsort(){const e=this;e.isUpdating++;const t=function(e,t){let i=e.dataIndex,r=t.dataIndex;return i<r?-1:i>r?1:0};if(e.isVirtualized)if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);s.sort(t),i.push(o),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("jqx-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}_applySortOrder(){const e=function(e){for(let t=0;t<e.length;t++){const i=e[t],r=i.parentNode;r&&r.appendChild(i)}};e(this._items),e(this._groups)}_sort(){const e=this;if(!e._canSort)return;e.isUpdating++;const t=function(t,i){let r=t.label,o=i.label;if("asc"===e.sortDirection){if(r<o)return-1;if(r>o)return 1}else{if(r<o)return 1;if(r>o)return-1}return 0};if(e._groups.sort(t),e.isVirtualized)if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);i.push(o),s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("jqx-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}getItem(e){const t=this;for(let i=0;i<t._items.length;i++)if(t._items[i].value===e)return t._items[i];return null}_focus(e){const t=this;!e||"none"===t.selectionMode||t.disabled||t.readonly||(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,t._focusedItem._focused=!0)}_keyDownHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;let r=e.key;if(e.metaKey&&(r="Control"),!t.disabled&&!t.readonly&&(!t.filterable||t.$.filterInput!==i)&&t._focused&&0!==t._items.length&&!t.disabled&&!t.displayLoadingIndicator){if(t.editable){if("F2"===r)return void t._dblclickEventHandler({target:t._focusedItem});if(t.$.editInput===i)return}if("none"!==t.selectionMode){switch(e.stopPropagation(),r){case"Down":case"Right":case"Left":case"Up":r="Arrow"+r}if(t.filterable)switch(r){case"ArrowLeft":case"ArrowRight":return;case"ArrowUp":case"ArrowDown":e.preventDefault()}if(t._applyIncrementalSearch(r),!(["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","Home","End","PageUp","PageDown"].indexOf(r)<0))if(e.preventDefault(),!t._focusedItem&&t._items.length>0)"one"===t.selectionMode||"oneOrMany"===t.selectionMode||"oneOrManyExtended"===t.selectionMode?t.select(t._items[0]):t._focus(t._items[0]);else switch(t.selectionMode){case"one":case"zeroAndOne":if("Shift"===r||"Control"===r||" "===r)return;t._handleKeyStrokes(r);break;case"oneOrMany":case"zeroOrOne":case"zeroOrMany":case"radioButton":case"checkBox":if("Shift"===r||"Control"===r)return;t._handleKeyStrokes(r);break;case"oneOrManyExtended":if(" "===r)return;t._keysPressed[r]="keydown"===e.type,t._handleKeyStrokes(r)}}}}_keyUpHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;if(!t.editable||t.$.editInput!==i){if(t.filterable&&t.$.filterInput===i)return t._filterTimer&&clearTimeout(t._filterTimer),void(t._filterTimer=setTimeout((function(){const e=t.context;t.context=t,t._filterItems(void 0,void 0,!0),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}),300));if(t._focused){if(t._focusedItem&&t._focusedItem.hidden&&t._filteredItems.length>0){let e=t._filteredItems[0];e.grouped&&t._filteredItems.length>1&&(e=t._filteredItems[1]),t._focus(e),t._recycle()}e.stopPropagation(),e.preventDefault(),t.disabled||("Escape"===e.key&&JQX.ListBox.DragDrop.Dragging&&t._cancelDrag(),["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","PageUp","PageDown"].indexOf(e.key)<0||(t._keysPressed[e.key]=!1))}}}_cancelDrag(){if(!JQX.ListBox.DragDrop.Dragging)return;JQX.ListBox.DragDrop.Feedback.parentNode&&JQX.ListBox.DragDrop.Feedback.parentNode.removeChild(JQX.ListBox.DragDrop.Feedback);const e=JQX.ListBox.DragDrop.Item,t=e.ownerListBox;if(t.$.fireEvent("dragCancel",{item:e,data:JQX.ListBox.DragDrop,container:t,previousContainer:t}),JQX.ListBox.DragDrop.Feedback=null,JQX.ListBox.DragDrop.DropDetails){let e=JQX.ListBox.DragDrop.DropDetails.item;e&&(e.$.removeClass("jqx-list-item-line-feedback"),e.$.removeClass("jqx-list-item-bottom-line-feedback"))}document.body.classList.remove("jqx-dragging"),delete JQX.ListBox.DragDrop.DraggedFrom,JQX.ListBox.DragDrop.Dragging=!1,JQX.ListBox.DragDrop.Item=null,JQX.ListBox.DragDrop.DropDetails=null}_mouseWheelHandler(e){const t=this;if((t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)&&!t.disabled&&t.computedVerticalScrollBarVisibility){const i=t.scrollTop;if(0===i&&e.deltaY<0||i===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollTo(i+t._getScrollCoefficient(e,t.offsetHeight))}}_pageDownKeyHandler(e){const t=this;if(0===e.length)return;let i,r=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(r=t._focusedItem),!r)return;const o=t._indexOf(r);let s=r.top+t.$.itemsContainer.offsetHeight-r.height;for(let t=o;t<e.length;t++)if(e[t].top>=s){i=e[t];break}i||(i=e[e.length-1]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(i):i.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(i),t._focus(i)),(i.height+i.top>t.$.itemsContainer.scrollTop+t.$.itemsContainer.offsetHeight||i.top<t.$.itemsContainer.scrollTop)&&(t.scrollTop=i.top-t.$.itemsContainer.offsetHeight+i.height)}_pageUpKeyHandler(e){const t=this;if(0===e.length)return;let i=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(i=t._focusedItem),!i)return;const r=i.top-t.$.itemsContainer.offsetHeight;let o;for(let s=t._indexOf(i);s>0;s--)if(e[s].top<=r){o=e[s];break}o||(o=e[0]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(o):o.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(o),t._focus(o)),t.scrollTop=o.top,0===t._indexOf(o)&&(t.scrollTop=0)}clearItems(){const e=this;e.clearSelection(),e.$.itemsInnerContainer.innerHTML="",e._items=[],delete e._focusedItem,e.$placeholder.removeClass("jqx-hidden"),e.refresh()}_resizeHandler(e){this.refresh(e)}refresh(e){const t=this;if(!e&&!t._isUpdatingScrollBars&&t.isInitialized)return t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),void(t._isUpdatingScrollBars=!1);e&&e.target===t&&!t._isUpdatingScrollBars&&(t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),t._isUpdatingScrollBars=!1)}_indexOf(e){const t=this;if(!e)return-1;let i=t._items.indexOf(e);return-1===i&&(i=t._items.indexOf(t.getItem(e.value))),i}_incrementalSearch(){const e=this,t="radioButton"!==e.selectionMode&&"checkBox"!==e.selectionMode&&"zeroOrMany"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode;let i,r=0;switch(e.incrementalSearchMode){case"containsIgnoreCase":case"equalsIgnoreCase":case"startsWithIgnoreCase":case"endsWithIgnoreCase":i=e._incrementalSearchQuery.toLowerCase();break;default:i=e._incrementalSearchQuery}const o=function(i){i.grouped||i.readonly||(t?(e.selectedIndexes.length>0&&e.clearSelection(),e._focus(i),e.select(i)):e._focus(i),(i.height+i.top>e.$.itemsContainer.scrollTop+e.$.itemsContainer.offsetHeight||i.top<e.scrollTop)&&(e.scrollTop=i.top),0===e._indexOf(i)&&(e.scrollTop=0),e._indexOf(i)===e._items.length-1&&(e.scrollTop=e.scrollHeight))};0!==e._previousEntry.localeCompare(i)&&(e._incrementalSearchItems=e._queryItems(e._incrementalSearchQuery,e.incrementalSearchMode),delete e._itemPosition),e._previousEntry=i;const s=e._incrementalSearchItems.length;if(0!==s)if(1!==s)for(void 0!==e._itemPosition?e._itemPosition<s-1?r=e._itemPosition:(r=0,t?(e._incrementalSearchItems[e._itemPosition].selected=!1,e.selectedIndexes=[],e.selectedValues=[]):e._incrementalSearchItems[e._itemPosition]._focused=!1):t&&e.clearSelection();r<s;r++)if(e._incrementalSearchItems[r].selected&&t)e._incrementalSearchItems[r].selected=!1,e.selectedIndexes=[],e.selectedValues=[];else{if(t||!e._incrementalSearchItems[r]._focused)return o(e._incrementalSearchItems[r]),void(e._itemPosition=r);e._incrementalSearchItems[r]._focused=!1}else o(e._incrementalSearchItems[0])}_selectStartHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement;t.$.filterInput!==i&&t.$.editInput!==i&&e.preventDefault()}_handleArrowKeys(e){const t=this,i="radioButton"!==t.selectionMode&&"checkBox"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode;if(t.disabled||t.readonly)return;let r;if(t._focusedItem&&!t._keysPressed.Shift)r=t._indexOf(t._focusedItem),t._focusedItem._focused=!1;else{if(0===t.selectedIndexes.length)return;r=t.selectedIndexes[t.selectedIndexes.length-1]}const o=e?t._getPreviousItem(r):t._getNextItem(r);t._focus(o),i&&(t._keysPressed.Shift?t.select(o):t._items[r]!==o&&(t.clearSelection(),t.select(o))),t.ensureVisible(o)}_refreshFilter(){const e=this;if(e.filterable)return e.$.filterInput.disabled=!(!e.disabled&&!e.displayLoadingIndicator),e.$filterInputContainer.removeClass("jqx-hidden"),void e.$itemsContainer.addClass("filter");e.$.filterInput.disabled=!0,e.$filterInputContainer.addClass("jqx-hidden"),e.$itemsContainer.removeClass("filter")}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):e.tabIndex=e.tabIndex>0?e.tabIndex:0}_setLoadingIndicatorVisibility(){const e=this;e.displayLoadingIndicator?e.$loadingIndicatorContainer.hasClass("jqx-visibility-hidden")?e.$loadingIndicatorContainer.removeClass("jqx-visibility-hidden"):e.$loadingIndicatorContainer.removeClass("jqx-hidden"):e._areCSSVarsSupported?e.$loadingIndicatorContainer.addClass("jqx-hidden"):e.$loadingIndicatorContainer.addClass("jqx-visibility-hidden")}_refreshLayout(){const e=this,t=e._filteredItems||e._items;if(e.__scrollHeight=null,e.__scrollWidth=null,e._height=null,e._scrollView||(e._scrollView=new JQX.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.$itemsContainer.removeClass("hscroll"),e.$itemsContainer.removeClass("vscroll"),!t||null===t||0===t.length)return e.scrollWidth=0,e.scrollHeight=0,e.$filterInputContainer.removeClass("vscroll"),e.$placeholder.removeClass("jqx-hidden"),e.isVirtualized&&e._recycle(),void(e.$.itemsInnerContainer.style.width="");e.$placeholder.addClass("jqx-hidden");const i=2*(parseInt(getComputedStyle(e.$.itemsContainer).getPropertyValue("--jqx-list-item-horizontal-offset"))||0);let r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,o=e._scrollHeight;if(e._refreshHorizontalScrollBarVisibility(r),e._refreshVerticalScrollBarVisibility(o),e.$.itemsInnerContainer.style.width="","hidden"===e.horizontalScrollBarVisibility?e.$.itemsInnerContainer.style.width=e.$.itemsContainer.offsetWidth-i:e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px",e.computedVerticalScrollBarVisibility)return r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),"hidden"!==e.horizontalScrollBarVisibility&&(e.$.itemsInnerContainer.style.width="",e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px"),e.computedHorizontalScrollBarVisibility&&(("visible"!==e.horizontalScrollBarVisibility||0!==e.scrollWidth||"visible"===e.horizontalScrollBarVisibility)&&(e.__scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.scrollHeight=e.__scrollHeight,e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),void(e.isVirtualized&&e._recycle());r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),e.computedHorizontalScrollBarVisibility&&(e.scrollHeight=e._scrollHeight,e._refreshVerticalScrollBarVisibility(e.scrollHeight),e.computedVerticalScrollBarVisibility&&(r=e._scrollWidth-e.$.itemsContainer.offsetWidth-e._scrollView.vScrollBar.offsetWidth,e._refreshHorizontalScrollBarVisibility(r)),e._scrollView.vScrollBar.$.hasClass("bottom-corner")&&e._scrollView.vScrollBar.refresh(),e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),e.isVirtualized&&e._recycle();const s=/Trident|Edge/.test(navigator.userAgent);!e.isRefreshing&&s&&setTimeout((function(){e.isRefreshing=!0,e._refreshLayout(),e.isRefreshing=!1}),50)}_styleChangedHandler(){this._refreshLayout()}_swipeLeftHandler(){}_swipeRightHandler(){}_refreshHorizontalScrollBarVisibility(e){const t=this;t.scrollWidth=e,t.$.horizontalScrollBar.refresh(),t.computedHorizontalScrollBarVisibility?(t.scrollLeft=t._getScrollLeft(t.$.itemsContainer.scrollLeft,e),t.$itemsContainer.addClass("hscroll")):t.$itemsContainer.removeClass("hscroll")}_refreshVerticalScrollBarVisibility(e){const t=this;t.scrollHeight=e,t.$.verticalScrollBar.refresh(),t.computedVerticalScrollBarVisibility?(t.$itemsContainer.addClass("vscroll"),t.$filterInputContainer.addClass("vscroll")):(t.$itemsContainer.removeClass("vscroll"),t.$filterInputContainer.removeClass("vscroll"))}_validateTemplate(e,t){if(null===t||!t)return;const i=this;return"content"in document.createElement("template")?null!==(t=document.getElementById(t))&&"content"in t?t:(i.error(i.localize("invalidTemplate",{elementType:i.nodeName.toLowerCase(),property:e})),void(i[e]=null)):(i.error(i.localize("htmlTemplateNotSuported",{elementType:i.nodeName.toLowerCase()})),void(i[e]=null))}_getItemIndexByPosition(e){const t=this,i=(i=>{let r=0,o=i.length-1;if(e<=0)return 0;if(i[i.length-1].top<=e)return i.length-1;for(;;){const s=Math.floor((r+o)/2),n=i[s];if(t._isItemInPosition(n,e))return s;n.top<e?r=s+1:n.top>e&&(o=s-1)}})(t.$.filterInput.value.length>0?t._filteredItems:t._items);return i}_isItemInPosition(e,t){const i=e.top,r=e.top+e.height;return i<=t&&r>t}get isVirtualized(){const e=this;return e.virtualized&&e.dataSource&&e.dataSource.length>0}_recycle(){const e=this;if(!e._recyclingItems)return;let t=e._height;e._height||(t=e._height=e.$.itemsContainer.offsetHeight);let i=0;const r=e.scrollTop,o=e._getItemIndexByPosition(r),s=e.filterable&&e.$.filterInput.value.length>0?e._filteredItems:e._items,n=s[o];let l=n?n.top:0;if(e.$.itemsInnerContainer.style.left=-e.scrollLeft+"px",e.$.itemsInnerContainer.style.top=-r+l+"px",e.isUpdating++,o>=0){const n=s.length;for(let a=o;a<n;a++){const o=s[a];if(0!==o.height){if(!(l+o.height>=r&&l<=r+t))break;{const t=e._recyclingItems[i++];if(!t)break;t.setAttribute("aria-setsize",n),t.setAttribute("aria-posinset",a),t.context=document,t.dataItem=o,t.label=o.label,t.value=o.value,t.selected=o.selected,t._focused=o._focused,t.hidden=o.hidden,t.grouped=o.grouped,t.readonly=o.readonly,t.style.height=o.height+"px",e._alternateItem(t),o.title?t.title=o.title:t.title="",o.grouped?t.displayMode="plain":t.displayMode=o.displayMode,e.scrollWidth>0&&(t.style.width=e.$.itemsInnerContainer.offsetWidth+e.scrollWidth+"px"),e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._applyTemplate(t,!1)}l+=o.height}}}if(i<e._recyclingItems.length)for(let t=i;t<e._recyclingItems.length;t++){const t=e._recyclingItems[i++],r=t.context;t.context=document,t.hidden=!0,t.context=r}e.isUpdating--}_verticalScrollbarHandler(e){const t=this,i=e.detail.value;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollTop=i,t._updateTopVisibleIndex(),e.context.max!==e.context.value?e.context.min===e.context.value&&t.$.fireEvent("scrollTopReached"):t.$.fireEvent("scrollBottomReached")}_applyAriaSelected(){const e=this,t=e.isVirtualized?e._recyclingItems:e._items,i=e.selectionMode;for(let e=0;e<t.length;e++){const r=t[e];r.selected?r.setAttribute("aria-selected",!0):r.readonly||r.disabled||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(i)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}});
112
112
 
113
113
  /***/ }),
114
114
 
@@ -150,14 +150,14 @@ JQX("jqx-splitter-item",class extends JQX.ContentElement{static get properties()
150
150
  /***/ 5523:
151
151
  /***/ (() => {
152
152
 
153
- JQX("jqx-table",class extends JQX.ContentElement{static get properties(){return{autoLoadState:{value:!1,type:"boolean"},autoSaveState:{value:!1,type:"boolean"},columnGroups:{value:null,type:"array?"},columnMinWidth:{value:"50px",type:"any"},columnReorder:{value:!1,type:"boolean"},columnResize:{value:!1,type:"boolean"},columnResizeFeedback:{value:!1,type:"boolean"},columnResizeNormalize:{value:!1,type:"boolean"},columns:{value:[],type:"any?",reflectToAttribute:!1},columnSizeMode:{value:"default",allowedValues:["auto","default"],type:"string"},conditionalFormatting:{value:null,type:"array?",reflectToAttribute:!1},conditionalFormattingButton:{value:!1,type:"boolean"},deferredScrollDelay:{value:1,type:"number"},dataRowId:{value:null,type:"string?"},dataSource:{value:null,type:"any?",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},sanitizeHTMLRender:{value:"text",allowedValues:["text","html"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},dataTransform:{value:null,type:"function?",reflectToAttribute:!1},editing:{value:!1,type:"boolean"},editMode:{value:"cell",allowedValues:["cell","row"],type:"string"},expandHierarchy:{value:!1,type:"boolean"},filtering:{value:!1,type:"boolean"},columnMenu:{value:!1,type:"boolean"},filterRow:{value:!1,type:"boolean"},filterTemplate:{value:null,type:"string?"},filterOperator:{value:"and",type:"string?"},footerRow:{value:null,type:"string?"},formulas:{value:!1,type:"boolean"},freezeFooter:{value:!1,type:"boolean"},freezeHeader:{value:!1,type:"boolean"},grouping:{value:!1,type:"boolean"},groupFormatFunction:{value:null,type:"any"},headerRow:{value:null,type:"any"},hideSelectionColumn:{value:!1,type:"boolean"},keyboardNavigation:{value:!1,type:"boolean"},loadColumnStateBehavior:{value:"implementationOnly",allowedValues:["stateOnly","implementationOnly","intersection"],type:"string"},messages:{value:{en:{add:"Add condition",all:"All columns",apply:"Apply",between:"Between",cancel:"Cancel",clearFilter:"Clear filter",close:"Close",column:"Column:",condition:"Condition:",conditionalFormatting:"Conditional Formatting",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",equal:"Equal To",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filterCondition:"Filter condition",filterPlaceholder:"Filter",firstButton:"First",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",formatColumn:"Format Column",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",greaterThan:"Greater Than",highlight:"Highlight",invalidValue:"Invalid value",itemsPerPage:"Items per page:",lastButton:"Last",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",lessThan:"Less Than",nextButton:"Next",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",notEqual:"Not Equal To",NULL:"null",ok:"OK",previousButton:"Previous",remove:"Remove condition",secondValue:"Second value:",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",summaryPrefix:"of",text:"Text",value:"Value:",with:"with",columnMenuItemSortAsc:"Sort Ascending",columnMenuItemSortDesc:"Sort Descending",columnMenuItemReset:"Reset",columnMenuItemRemoveSort:"Remove Sort",columnMenuItemFilter:"Show rows where:",columnMenuItemRemoveFilter:"Remove Filter",columnMenuItemColumns:"Columns",grouping:"Group field name is not found in the dataFields collection!"}},type:"object",extend:!0},onCellRender:{value:null,type:"function?",reflectToAttribute:!1},onColumnRender:{value:null,type:"function?",reflectToAttribute:!1},onUpdateComplete:{value:null,type:"function?",reflectToAttribute:!1},onInit:{value:null,type:"function?",reflectToAttribute:!1},onLoad:{value:null,type:"function?",reflectToAttribute:!1},pageSize:{value:10,allowedValues:[10,25,50],type:"int"},pageIndex:{value:0,type:"int"},paging:{value:!1,type:"boolean"},rowDetailTemplate:{value:null,type:"string?"},selected:{value:[],type:"array",reflectToAttribute:!1},selection:{value:!1,type:"boolean"},selectionMode:{value:"many",type:"string",allowedValues:["one","many","extended"]},selectionByHierarchy:{value:!0,type:"boolean"},sort:{value:null,type:"function?",reflectToAttribute:!1},sortMode:{value:"none",type:"string",allowedValues:["none","one","many"]},stateSettings:{value:["columns","expanded","filtered","grouped","selected","sorted"],type:"array"},tooltip:{value:!1,type:"boolean"},virtualization:{value:!1,type:"boolean"}}}static get listeners(){return{resize:"_resizeHandler","conditionalFormattingButton.click":"_conditionalFormattingButtonClickHandler","filterInput.keyup":"_filterInputKeyupHandler","pager.change":"_pagerChangeHandler","pager.pageSizeChanged":"_pagerPageSizeChanged","tableContainer.change":"_tableContainerChangeHandler","tableContainer.click":"_tableContainerClickHandler","tableContainer.down":"_tableContainerDownHandler","tableContainer.focus":"_tableContainerFocusHandler","tableContainer.pointerover":"_tableContainerPointeroverHandler","document.down":"_documentDownHandler","document.keydown":"_tableContainerKeydownHandler","document.keyup":"_tableContainerKeyupHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}template(){return JQX.Templates[this.nodeName]&&delete JQX.Templates[this.nodeName],this.virtualization?'<div id="container" class="jqx-container" role="presentation">\n <div id="header" class="jqx-table-header" role="toolbar">\n <jqx-input id="filterInput" class="underlined" animation="[[animation]]" locale="[[locale]]" right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-input>\n <div id="filterTemplateContainer" class="jqx-table-filter-template-container jqx-hidden"></div>\n <jqx-button id="conditionalFormattingButton" class="jqx-table-toolbar-button conditional-formatting" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" aria-label="Conditional Formatting"></jqx-button>\n </div>\n <jqx-scroll-viewer style="opacity: 0.99" id="virtualizationContainer" class="jqx-table-virtualization-container" right-to-left="[[rightToLeft]]" theme="[[theme]]">\n <table id="tableContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-table-container">\n <content></content>\n </table>\n </jqx-scroll-viewer>\n <jqx-pager id="pager" animation="[[animation]]" locale="[[locale]]" page-index="[[pageIndex]]" page-size="[[pageSize]]" pages-count="null" show-first-last-navigation-buttons show-page-size-selector show-prev-next-navigation-buttons show-summary right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-pager>\n <div id="loadingIndicatorContainer" class="jqx-loader-container jqx-hidden" aria-label="Loading">\n <span id="loadingIndicator" class="jqx-loader" role="presentation"></span>\n </div>\n </div>':'<div id="container" class="jqx-container" role="presentation">\n <div id="header" class="jqx-table-header" role="toolbar">\n <jqx-input id="filterInput" class="underlined" animation="[[animation]]" locale="[[locale]]" right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-input>\n <div id="filterTemplateContainer" class="jqx-table-filter-template-container jqx-hidden"></div>\n <jqx-button id="conditionalFormattingButton" class="jqx-table-toolbar-button conditional-formatting" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" aria-label="Conditional Formatting"></jqx-button>\n </div>\n <table id="tableContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-table-container">\n <content></content>\n </table>\n <jqx-pager id="pager" animation="[[animation]]" locale="[[locale]]" page-index="[[pageIndex]]" page-size="[[pageSize]]" pages-count="null" show-first-last-navigation-buttons show-page-size-selector show-prev-next-navigation-buttons show-summary right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-pager>\n <div id="loadingIndicatorContainer" class="jqx-loader-container jqx-hidden" aria-label="Loading">\n <span id="loadingIndicator" class="jqx-loader" role="presentation"></span>\n </div>\n </div>'}resetState(e){const t=this;switch(e){case"expanded":t._expandedIds=[],t._expandedIdsAlt=[],t._state.expanded=[];break;case"selected":t._selectedIds=[],t._disabledSelection=[],t._selectableGroupRecords=[],t.set("selected",[]),t._state.selected=[];break;default:t._dblclickObject={numberOfClicks:0},t._expandedIds=[],t._expandedIdsAlt=[],t._selectedIds=[],t._disabledSelection=[],t._selectableGroupRecords=[],t._state={expanded:[],selected:[],sorted:[]},t.set("selected",[])}}render(){this._render(),super.render()}_render(){const e=this,t=getComputedStyle(e);if(e.setAttribute("role","presentation"),e.$.tableContainer.id=e.id+"TableContainer",e._cachedWidth=e.offsetWidth,e._cachedHeight=e.offsetHeight,e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)},e._isMobile=JQX.Utilities.Core.isMobile,e._autoScrollCoefficient=JQX.Utilities.Core.Browser.Firefox?8:JQX.Utilities.Core.Browser.Edge?16:4,e._dblclickObject={numberOfClicks:0},e._expandedIds=[],e._expandedIdsAlt=[],e._selectedIds=[],e._collapsedIds=[],e._disabledSelection=[],e._selectableGroupRecords=[],e._state={expanded:[],selected:[],sorted:[]},e._rowHeight=parseFloat(t.getPropertyValue("--jqx-table-row-height")),e._rowDetailHeight=parseFloat(t.getPropertyValue("--jqx-table-row-detail-height")),e._animation=e.animation,e._setFocusable(),e.selection&&e.$.tableContainer.setAttribute("aria-multiselectable",!0),e.virtualization){const t=e.$.virtualizationContainer,a=e;t&&(t._mouseWheelHandler=function(e){const l=t;if(!l.disabled&&(l.computedHorizontalScrollBarVisibility||l.computedVerticalScrollBarVisibility)){if(e.shiftKey&&l.computedHorizontalScrollBarVisibility){const t=l.scrollLeft;if(0===t&&e.deltaX<0||t===l.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(l.scrollWidth>0&&l.scrollTo(void 0,l.scrollLeft+l._getScrollCoefficient(e,l.offsetWidth)))}if(l.computedVerticalScrollBarVisibility){const t=l.scrollTop;if(0===t&&e.deltaY<0||t===l.scrollHeight&&e.deltaY>0)return;if(e.stopPropagation(),e.preventDefault(),l.scrollHeight>0){let t=3*a._rowHeight;e.deltaY<=0&&(t=-3*a._rowHeight),Math.abs(e.deltaY)>=100?l.scrollTop+=t:l.scrollTop+=e.deltaY}}}},t._verticalScrollbarHandler=function(t){0===e.deferredScrollDelay?e._onVerticalChange(t):(e._verticalScrollTimer&&(clearTimeout(e._verticalScrollTimer),delete e._verticalScrollTimer),e._verticalScrollTimer=setTimeout((()=>{e._onVerticalChange(t),delete e._verticalScrollTimer}),e.deferredScrollDelay))}),t.hasStyleObserver=!1,t.$.verticalScrollBar.hasStyleObserver=!1,t.$.horizontalScrollBar.hasStyleObserver=!1,e.freezeHeader=!0,e.freezeFooter=!0}e.isRendered?e.innerHTML&&e.innerHTML.trim().length>1?e._initDataSourceFromHTML():e._fullRefresh():(e._createElement(),setTimeout((()=>{const t=e.querySelectorAll("tr[row-id]");if(t.length>0){let a=!1;for(let l=0;l<t.length;l++){const i=t[l];e._rowHeight<i.offsetHeight&&(e._rowHeight=i.offsetHeight,a=!0)}a&&(e.style.setProperty("--jqx-table-row-height",e._rowHeight+"px"),e._refreshDataRows())}e.onLoad&&e.onLoad()}),500),e.columnMenu&&(e._initialState=e.getState()),super.render())}_initDataSourceFromHTML(){const e=this,t=e.context;e.context=e,e.hasAttribute("jqx-blazor")&&(e.$.tableContainer.innerHTML="");const a=e.columns;e.dataSource=null,e.rows=null,e.columns=null;const l=e.querySelectorAll("th");let i=[],n=[],r=[];for(let e=0;e<l.length;e++){const t=l[e].innerHTML.trim();let a={label:t,dataField:t,dataType:"string"};i.push(a),n.push(t)}if(0===l.length&&a&&a.length>0)for(let e=0;e<a.length;e++){const t=a[e];let l={label:t.label,dataField:t.dataField,dataType:t.dataType};t.width&&(l.width=t.width),t.allowResize&&(l.allowResize=t.allowResize),t.allowFilter&&(l.allowFilter=t.allowFilter),t.allowSort&&(l.allowSort=t.allowSort),t.allowHide&&(l.allowHide=t.allowHide),t.allowMenu&&(l.allowMenu=t.allowMenu),t.freeze&&(l.freeze=t.freeze),t.responsivePriority&&(l.responsivePriority=t.responsivePriority),t.columnGroup&&(l.columnGroup=t.columnGroup),i.push(l),n.push({name:t.dataField,dataType:t.dataType})}const o=e.querySelectorAll("tr");for(let e=0;e<o.length;e++){const t={},a=o[e].querySelectorAll("td");if(a.length>0){for(let e=0;e<i.length;e++)t[i[e].dataField]=a[e].innerHTML.trim();r.push(t)}}const s=new JQX.DataAdapter({dataSource:r,expandHierarchy:e.expandHierarchy,dataFields:n,id:e.dataRowId});e.$.tableContainer.innerHTML="",e.columns=i,e.context=t,e.dataSource=s}attached(){const e=this;super.attached(),e.isCompleted&&e._dialog&&(e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(e._dialog)),e.isRendered&&e.isCompleted&&e.endUpdate()}detached(){const e=this;if(super.detached(),e._focusedCell&&!e.$.tableContainer.contains(e._focusedCell)&&delete e._focusedCell,!e._dialog)return;e._detachCachedTemplates();const t=e._dialog;t.removeEventListener("change",e._dialogEventHandler),t.removeEventListener("clear",e._dialogEventHandler),t.removeEventListener("click",e._dialogEventHandler),t.removeEventListener("close",e._dialogEventHandler),t.removeEventListener("filter",e._dialogEventHandler),t.remove()}addFilter(e,t){const a=this,l=a.columnByDataField[e];"string"==typeof t?t=a.dataSource._createFilter(l.dataType,[t]):Array.isArray(t)&&(t=a.dataSource._createFilter(l.dataType,t)),l&&!1!==l.allowFilter&&t instanceof JQX.Utilities.FilterGroup!=0&&(e=l.dataField,a._clearSortByRow&&a._clearSortByRow(!0),a._designerFiltersApplied&&a._clearDesignerFilters(),a._filterInfo.appliedFilters||(a._filterInfo.appliedFilters={}),a._filterInfo.appliedFilters[e]=t,a._refreshFilters("add"),l.headerCellElement&&l.headerCellElement.setAttribute("filter",""),a.$.filterInput&&t&&!a.filterRow&&!a.columnMenu&&(a.$.filterInput.value=t.filters[t.filters.length-1].value,a._filterInfo.query=a.$.filterInput.value),a._originalDynamicColumnsOrder&&(a._originalDynamicColumnsOrder=a._dynamicColumns.map((e=>e.id))))}addGroup(e){const t=this;if(!t.grouping)return;const a=t.columnByDataField[e];if(!a||!1===a.allowGroup)return;const l=t.dataSource,i=l.groupBy;e=a.dataField,-1===i.indexOf(e)&&(i.push(e),l.refreshHierarchy(),t._getSelectableGroupRecords(),t._fullRefresh(),t._updateState("grouped"),t._doNotFireEvent||t.$.fireEvent("group",{action:"add",dataField:e}))}beginEdit(e,t){const a=this;if(!a.editing)return;const l=a.columnByDataField[t];if(t=l?l.dataField:void 0,"cell"===a.editMode&&!t||l&&!1===l.allowEdit)return;const i=a.rowById[e];if(!i)return;const n=i.data.$.id;a._editing&&a.endEdit(),a._beginEdit({rowId:n,rowObject:i,dataField:t})}cancelEdit(){const e=this,t=e._editing;if(t){for(let a=0;a<t.cells.length;a++){const l=t.cells[a];l.editor.contains(e.getRootNode().activeElement)&&e._focusCell(l.element),l.editor.remove(),e._setCellContent(l.element,e._formatCellValue(t.row,e.columnByDataField[l.dataField],l.element)),l.element.classList.remove("editing")}delete e._editing}}clearFilters(e=null){const t=this,a=t._filterInfo;(a.inputFilters||a.rowFilters||a.appliedFilters)&&(t._clearFilterInput(),t._clearRowFilters(e),delete t._filterInfo.appliedFilters,t.dataSource.virtualDataSource||t.dataSource.clearFilter(),t._fullRefresh("filter"),t._updateState("filtered"),t._doNotFireEvent||t.$.fireEvent("filter",{action:"remove"}))}clearGrouping(){const e=this,t=e.dataSource;0!==t.groupBy.length&&(t.groupBy=[],t.refreshHierarchy(),e._getSelectableGroupRecords(),e._fullRefresh(),e._updateState("grouped"),e.$.fireEvent("group",{action:"remove"}))}clearSelection(){this._clearSelection(!0)}collapseAllRows(){const e=this;e._isExpandCollapseForbidden()||(function t(a){for(let l=0;l<a.length;l++){const i=a[l];if(!i.leaf&&(i.children&&t(i.children),i.expanded)){if(e.virtualization){const t=i.$.id,a=e.rowById?e.rowById[t]:e.rows.dataItemById[t];(a.data||a).expanded=!1,e._collapsedIds[t]=!0;continue}e.collapseRow(i.$.id)}}}(e["jqx-table"===e.nodeName.toLowerCase()?"dataSource":"rows"].boundHierarchy),e.virtualization&&(e._expandedIds=[],e._expandedIdsAlt=[],e.dataSource.refreshHierarchy(),e._refreshDataRows(),e._updateState("expanded")))}collapseGroup(e){const t=this;if(!t.grouping||0===t.dataSource.groupBy.length)return;const a=t._getGroupByIndex(e);if(!a||!a.expanded)return;const l=t.$.tableContainer.querySelector(`tr[row-id="${a.$.id}"]:not([unused])`);if(!l){a.expanded=!1;let e=a.$.id;return null==e?void t.refresh():e.replace?(e=e.replace("Item","").replace(/_/gi,"."),void t.$.fireEvent("group",{action:"collapse",path:e,dataField:a.groupDataField,label:a.label})):(t.refresh(),void t.$.fireEvent("group",{action:"collapse",path:e,dataField:a.groupDataField,label:a.label}))}if(t._isCollapsed(a))return l.setAttribute("aria-expanded",!1),l.classList.remove("expanded"),void(a.expanded=!1);t._hierarchyArrowClickHandler(l)}collapseRow(e){const t=this;if(t._isExpandCollapseForbidden())return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||l.leaf||!l.expanded)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);return i?t._isCollapsed(l)?(i.setAttribute("aria-expanded",!1),i.classList.remove("expanded"),l.expanded=!1,t._expandedIds=t._expandedIds.filter((e=>e!==l.$.id)),t._updateState("expanded"),void t.$.fireEvent("collapse",{record:l})):void t._hierarchyArrowClickHandler(i):(l.expanded=!1,t._expandedIds=t._expandedIds.filter((e=>e!==l.$.id)),void t._updateState("expanded"))}collapseRowDetails(e){const t=this;if(!t.rowDetailTemplate)return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||!l)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return;const n=i.nextElementSibling;n&&n.classList.contains("jqx-table-row-detail")&&!n.classList.contains("collapsed")&&t._toggleRowDetail(i,l.$.id)}collapseAllRowDetails(){const e=this;if(!e.rowDetailTemplate||!e.dataSource)return;let t=e.dataSource.boundSource;t||(t=e.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])"));for(let a=0;a<t.length;a++)e.collapseRowDetails(t[a].$.id)}expandAllRowDetails(){const e=this;if(!e.rowDetailTemplate||!e.dataSource)return;let t=e.dataSource.boundSource;t||(t=e.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])"));for(let a=0;a<t.length;a++)e.expandRowDetails(t[a].$.id)}updateRow(e,t,a){const l=this,i=l.rowById?l.rowById[e]:l.rows.dataItemById[e];if(!i)return;const n=l._selectedIds.slice(0);l._editing=!0,l.__updatedRows=!0;let r=[];l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.toArray&&(r=l.dataSource.groupBy.toArray().slice(0));const o=l.dataSource.boundSource.canNotify;l.dataSource.boundSource.canNotify=!1;const s=e=>{if(i.data[e]=t[e],l.dataSource.id&&i&&i.data&&i.data.$&&(i.data.$.id=t[l.dataSource.id]),i&&i.data.$&&void 0!==i.data.$.index){const a=i.data.$.index,n=l.dataSource.dataSource,o=()=>{const a=t[e];if(null==a){const t=l.columnByDataField[e];return t?"number"===t.dataType?0:"boolean"!==t.dataType&&("date"===t.dataType?new Date:""):""}return a};if(n&&n[a]&&(n[a][e]=o()),l.dataSource[a]){if(r.length>0&&!l._dirtyHierarchy&&l.dataSource[a][e]!==o()&&r.indexOf(e)>=0){const e=l._getExpandedGroups(l.dataSource.boundHierarchy);l._dirtyHierarchy=e}l.dataSource[a][e]=o()}}};for(let e=0;e<l.columns.length;e++){const a=l.columns[e];void 0!==t[a.dataField]&&s(a.dataField)}if(a){const e=l.dataSource.dataFields;if(e)for(let t=0;t<e.length;t++)e[t].map?s(e[t].map):s(e[t].name)}l._editing=!1,l.dataSource.boundSource.canNotify=o,l.__updating||(l.dataSource.refreshHierarchy(),l._fullRefresh(void 0,n,"update"))}addRow(e){const t=this;let a=[];const l=t.dataSource.boundSource.canNotify;if(t.dataSource.boundSource.canNotify=!1,t._editing=!0,t.__updatedRows=!0,t.dataSource&&t.dataSource.groupBy&&t.dataSource.groupBy.toArray&&(a=t.dataSource.groupBy.toArray().slice(0),a.length>0&&t.dataSource.beginUpdate()),a.length>0)t.dataSource?t.dataSource.add(e,!0):t._addNewRow(e,0);else if(t.dataSource)if(t.dataSource.boundHierarchy&&t.$.tableContainer&&"treegrid"===t.$.tableContainer.getAttribute("role")){const a=e[t.dataSource.parentDataField];t.dataSource.add(e,a)}else t.dataSource.add(e,!0);else t._addNewRow(e,0);t.dataSource.boundSource.canNotify=l,t._editing=!1,t._updateSelectAllState(),a.length>0||t.dataSource.boundHierarchy&&t.$.tableContainer&&"treegrid"===t.$.tableContainer.getAttribute("role")?(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{t._doNotFireEvent=!0;const e=t._getExpandedGroups(t.dataSource.boundHierarchy);a.forEach((e=>t.addGroup(e))),t.dataSource.endUpdate(),t._restoreExpandedGroups(e),t._fullRefresh("update"),t._doNotFireEvent=!1}),50)):(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{t._doNotFireEvent=!0,t._fullRefresh("update"),t._doNotFireEvent=!1})))}removeRow(e){const t=this,a=t.rowById?t.rowById[e]:t.rows.dataItemById[e];if(!a){if(t.dataSource&&t.dataSource.dataItemById){const a=t.dataSource.dataItemById[e];if(a){const l=void 0!==a.$?a.$.index:0;t.dataSource.removeAt(l),t._selectedIds.indexOf(e)>=0&&(t._selectedIds.splice(t._selectedIds.indexOf(e),1),t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:"remove"})),t.virtualization&&t.__updating||t._fullRefresh("update")}}return}const l=a.data||a,i=void 0!==l.$?l.$.index:0,n=t.dataSource.boundSource.canNotify;t.dataSource.boundSource.canNotify=!1,t._editing=!0,t.__updatedRows=!0;let r=[];t.dataSource&&t.dataSource.groupBy&&t.dataSource.groupBy.toArray&&(r=t.dataSource.groupBy.toArray().slice(0),r.length>0&&t.dataSource.beginUpdate()),t._doNotFireEvent=!0,t._sortColumns&&t._sortColumns.length?t.dataSource.remove(l):t.dataSource.removeAt(i),t._selectedIds.indexOf(e)>=0&&(t._selectedIds.splice(t._selectedIds.indexOf(e),1),t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:"remove"})),t._doNotFireEvent=!1,t.dataSource.boundSource.canNotify=n,t._editing=!1,r.length>0&&(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{const e=t._getExpandedGroups(t.dataSource.boundHierarchy);r.forEach((e=>t.addGroup(e))),t.dataSource.endUpdate(),t._restoreExpandedGroups(e),t._fullRefresh("update")}),50)),t.virtualization&&t.__updating||t._fullRefresh("update")}expandRowDetails(e){const t=this;if(!t.rowDetailTemplate)return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data||a;if(!a||!l)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return;const n=i.nextElementSibling;!n&&!t.virtualization||n&&n.classList.contains("jqx-table-row-detail")&&!n.classList.contains("collapsed")||t._toggleRowDetail(i,l.$.id)}endEdit(){const e=this,t=e._editing;if(!t)return;const a=t.row,l=a.data,i=[];let n=!0;for(let a=0;a<t.cells.length;a++){const l=t.cells[a],r=e.columnByDataField[l.dataField],o=l.element,s=l.editor;let d;if(r.editor&&r.editor.template?r.editor.getValue&&(d=r.editor.getValue(s)):(d=s.value,s instanceof HTMLInputElement&&("number"===s.type?d=parseFloat(d):"date"===s.type&&(d=new Date(d),isNaN(d.getTime())&&(d=null)))),r.validation){const t=r.validation(d),a=void 0!==t&&!0!==t;if(a){let a;a="object"==typeof t&&t.message?t.message:e.localize("invalidValue"),o.setAttribute("validation-message",a)}else o.removeAttribute("validation-message");o.classList.toggle("invalid",a),n=n&&!a}i.push({column:r,newValue:d})}if(n){if(e.dataSource.virtualDataSource){const a=Object.assign({},l);for(let e=0;e<t.cells.length;e++){const l=t.cells[e],n=i[e],r=n.column;a[l.dataField]=n.newValue,r.transform&&(a[r.dataField]=r.transform(n.newValue))}for(const t of e._columns)a[t.dataField]instanceof Date&&(a[t.dataField]=a[t.dataField].toISOString().slice(0,10));e._editing.row.data=a,e._requestVirtualDataSource("update",(function(t){return t?r(!1,a):(e._editing.row.data=l,e.cancelEdit()),t}))}else r(!0,l);delete e._editing}function r(l,n){for(let r=0;r<t.cells.length;r++){const o=t.cells[r],s=i[r],d=s.column,c=o.editor;c.contains(e.getRootNode().activeElement)&&e._focusCell(o.element),c.remove(),l&&(n[o.dataField]=s.newValue,d.transform&&(n[d.dataField]=d.transform(s.newValue))),e._setCellContent(o.element,e._formatCellValue(a,d,o.element)),o.element.classList.remove("editing"),e.$.fireEvent("cellEndEdit",{id:n.$.id,row:n,value:n[o.dataField],dataField:o.dataField})}e._updateCellsWithFormulas(),"row"===e.editMode&&e.$.fireEvent("rowEndEdit",{id:n.$.id,row:n})}}expandAllRows(){const e=this;if(e._isExpandCollapseForbidden())return;e.beginUpdate();const t=e["jqx-table"===e.nodeName.toLowerCase()?"dataSource":"rows"].boundHierarchy;if(e._collapsedIds=[],t)for(let a=0;a<t.length;a++){const l=t[a],i=t=>{if(!t.leaf&&(t.expanded=!0,e._expandedIds.push(t.$.id),e._expandedIdsAlt[t.$.id]=!0,t.children))for(let e=0;e<t.children.length;e++){const a=t.children[e];i(a)}};i(l)}e.endUpdate()}isGroupExpanded(e){const t=this,a=t.dataSource;if(!t.grouping||0===a.groupBy.length)return;const l=t._getGroupByIndex(e);return!!l&&l.expanded}expandGroup(e){const t=this,a=t.dataSource;if(!t.grouping||0===a.groupBy.length)return;const l=t._getGroupByIndex(e);if(!l)return;const i=t._doNotFireEvent,n=t.animation,r=t.$.tableContainer.querySelector(`tr[row-id="${l.$.id}"]:not([unused])`);let o=!1;if(i&&(t.animation="none"),r){if(t._isCollapsed(l))if(i)o=!0;else{let e=l.parent;e&&!e.expanded&&t.expandGroup(l.parent.$.id.replace("Item","").replace(/_/g,"."))}l.expanded||(o||i?(l.expanded=!0,r.setAttribute("aria-expanded",!0),r.classList.add("expanded")):t._hierarchyArrowClickHandler(r,i)),i&&(l.expanded=!0,r.setAttribute("aria-expanded",!0),r.classList.add("expanded"),requestAnimationFrame((()=>t.animation=n)))}else if(l.expanded=!0,!l.expanded&&!i){let e=l.$.id;e=e.replace("Item","").replace(/_/gi,"."),t.$.fireEvent("group",{action:"expand",path:e,dataField:l.groupDataField,label:l.label})}}expandAllRootGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++)t[e].expanded=!0;e.endUpdate()}expandAllGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++){const a=t[e],l=e=>{if(e.expanded=!0,e.children)for(let t=0;t<e.children.length;t++){const a=e.children[t];l(a)}};l(a)}e.endUpdate()}collapseAllGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++)t[e].expanded=!1;e.endUpdate()}expandRow(e){const t=this;if(t._isExpandCollapseForbidden())return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||l.leaf)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return l.expanded=!0,-1===t._expandedIds.indexOf(l.$.id)&&t._expandedIds.push(l.$.id),t._expandedIdsAlt[l.$.id]=!0,t._updateState("expanded"),void t.$.fireEvent("expand",{id:l.$.id,record:l});if(t._isCollapsed(l)){let e=l.parent;e&&!e.expanded&&t.expandRow(e.$.id)}l.expanded||t._hierarchyArrowClickHandler(i)}exportData(e,t,a,l){const i=this,n=i._columns.filter((e=>e.visible)),r=i.columnGroups,o=i.dataSource,s=getComputedStyle(i),d=s.borderRightColor,c=new JQX.Utilities.DataExporter(void 0,o.groupBy.toArray()),u={};let f,m=Array.from(i.$.tableContainer.firstElementChild.querySelectorAll("th"));if(o.virtualDataSource){f=[];for(let e=0;e<i.rows.length;e++)f.push(i.rows[e].data)}else o.boundHierarchy&&!i.grouping?(c.hierarchical=!0,f=function e(t){const l=[];return t.forEach((t=>{a&&!1===t.$.filtered||(l.push(t),t.leaf||(t._expanded=t.expanded,t.children&&(t.children=e(t.children),0===t.children.length&&(t._expanded=void 0,t.children=void 0,t.leaf=!0))))})),l}(JSON.parse(JSON.stringify(o.boundHierarchy,((e,t)=>{if("parent"!==e)return t}))))):(f=Array.from(o.toArray()),a&&(f=f.filter((e=>!1!==e.$.filtered))));c.style={border:"1px solid "+d,borderCollapse:"collapse",backgroundColor:s.backgroundColor,color:s.color,fontFamily:"Helvetica",header:{border:"1px solid "+d,fontWeight:"bold"},columns:{border:"1px solid "+d}},m=m.filter((e=>!1===e.classList.contains("jqx-table-select-all")));for(let e=0;e<n.length;e++){const t=n[e],a={},l={};let i=m[e].offsetWidth+"px";u[t.dataField]=t.label,"date"===t.dataType&&(l.format="d"),a.width=i,c.style.header[t.dataField]=a,c.style.columns[t.dataField]=l}return r?c.header={columns:n,columngroups:r}:f.unshift(u),c.exportData(f,e,t,l)}getRowIndexById(e){const t=this.rowById[e];return this.dataSource&&t&&t.data&&t.data.$?t.data.$.index:-1}getSelection(){const e=this;return 0===e._selectableGroupRecords.length?e._selectedIds.filter((e=>!(""+e).startsWith("Item"))):e._selectedIds.filter((t=>-1===e._selectableGroupRecords.indexOf(t)&&!(""+t).startsWith("Item")))}getState(){return JSON.parse(this._stringifyState())}getValue(e,t){const a=this,l=a.columnByDataField[t];if(!l)return;let i=a.rowById[e];return i?i.data[l.dataField]:(i=a.dataSource.dataItemById[e],i?i[l.dataField]:void 0)}loadState(e){const t=this;if(!e&&!(e=window.localStorage.getItem("jqxTable"+t.id)))return;const a=t.stateSettings;let l=!1;if(t._loadingState=!0,"string"==typeof e&&(e=JSON.parse(e)),-1!==a.indexOf("columns")){const a=t.loadColumnStateBehavior,i=t._columns,n=[],r=e.columns;for(let e=0;e<r.length;e++){let t=Object.assign({},r[e]);const l=i.find((e=>e.dataField===t.dataField));if(!l){"implementationOnly"!==a&&n.push(t);continue}const o=l.label,s=["editor","formatFunction","templateElement","templateElementSettings","transform","validation"];"stateOnly"!==a&&s.push("label");for(let e in l)-1===s.indexOf(e)&&delete l[e];t=Object.assign(l,t),"stateOnly"!==a&&o&&(t.label=o),n.push(t)}if("stateOnly"!==a)for(let e=0;e<i.length;e++){const t=i[e];n.find((e=>e.dataField===t.dataField))||n.push(t)}t.columns=n,t._initColumns(!0),l=!0,t._formattingPanel&&(t._formattingPanel.columns=t._columns)}if(t.grouping){const a=t.dataSource,i=t.dataSource.groupBy;e.grouped=e.grouped||[],JSON.stringify(i._array)!==JSON.stringify(e.grouped)&&(t.dataSource.groupBy=e.grouped,a.refreshHierarchy(),l=!0)}else t.hasAttribute("hierarchy")&&-1!==a.indexOf("expanded")&&JSON.stringify(t._expandedIds.slice(0).sort())!==JSON.stringify(e.expanded.slice(0).sort())&&(t.collapseAllRows(),t._expandedIds=e.expanded,l=!0);-1!==a.indexOf("selected")&&e.selected.slice&&JSON.stringify(t._selectedIds.slice(0).sort())!==JSON.stringify(e.selected.slice(0).sort())&&(t._selectedIds=e.selected,l=!0),l&&(t._initRows(),t.refresh());e:if(-1!==a.indexOf("filtered")){const a=t.filtering,l=e.filtered;if(t.clearFilters(),!l)break e;if(a&&t.filterRow&&l.rowFilters){const a=t.$.tableContainer.querySelector(".jqx-table-filter-row"),l=Number(t.selection),i=e.filtered.filterRowValues;for(let e=0;e<t._columns.length;e++){const n=i[e];if(!n)continue;const r=t._columns[e].dataType,o=a.children[e+l].firstElementChild,s=t._filterInfo["string"===r?"stringConditions":"numberAndDateConditions"].find((e=>e.value===n.condition));if(-1===["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(s.value))if("date"===r){const e=new Date(n.value),t=(e.getMonth()+1).toString(),a=e.getDate().toString();o.children[0].value=`${e.getFullYear()}-${"0".repeat(2-t.length)}${t}-${"0".repeat(2-a.length)}${a}`}else o.children[0].value=n.value;o.children[1].value=s.label,o.children[1].$.input.dataValue=s.value}t._applyRowFilters()}else if(a&&l.inputFilters)t.$.filterInput.value=l.query,t._filterByAll(l.query);else if(l.appliedFilters){t._filterInfo.appliedFilters||(t._filterInfo.appliedFilters={});for(let e in l.appliedFilters){const a=l.appliedFilters[e],i=new window.JQX.Utilities.FilterGroup;a.filters.forEach(((e,t)=>{const l=i.createFilter(e.type.replace("Filter",""),e.value,e.condition);i.addFilter(a.logicalOperators[t],l)})),t._filterInfo.appliedFilters[e]=i}t._refreshFilters("add")}}-1!==a.indexOf("sorted")&&(t.clearSort(),e.sorted.forEach&&e.sorted.forEach((e=>{t.sortBy(e.dataField,e.direction)}))),a.forEach((e=>t._updateState(e,!1))),t.autoSaveState&&window.localStorage.setItem("jqxTable"+t.id,t._stringifyState()),delete t._loadingState}navigateTo(e){const t=this;if(isNaN(e)||null===e)return;const a=t.pageIndex;t.pageIndex=Math.max(Math.min(Math.round(e),t.$.pager.pagesCount-1),0),t.paging&&t.pageIndex!==a&&(t._fullRefresh("pageIndexChange"),t.$.fireEvent("page",{action:"pageIndexChange"}))}removeFilter(e){const t=this,a=t.columnByDataField[e];a&&t.filterRow&&t.clearFilters(e),t._filterInfo.appliedFilters&&a&&(e=a.dataField,t._clearSortByRow&&t._clearSortByRow(!0),t._designerFiltersApplied&&t._clearDesignerFilters(e),delete t._filterInfo.appliedFilters[e],t._refreshFilters("remove"),t._originalDynamicColumnsOrder&&(t._originalDynamicColumnsOrder=t._dynamicColumns.map((e=>e.id))))}removeGroup(e){const t=this,a=t.columnByDataField[e];if(!t.grouping||!a)return;e=a.dataField;const l=t.dataSource,i=l.groupBy,n=i.indexOf(e);-1!==n&&(i.splice(n,1),l.refreshHierarchy(),t._getSelectableGroupRecords(),t._fullRefresh(),t._updateState("grouped"),t.$.fireEvent("group",{action:"remove",dataField:e}))}saveState(){const e=this._stringifyState();return window.localStorage.setItem("jqxTable"+this.id,e),JSON.parse(e)}enableSelect(e){const t=this;t.selection&&t._disabledSelection.indexOf(e)>=0&&(t._disabledSelection.splice(t._disabledSelection.indexOf(e),1),t._fullRefresh("update"))}disableSelect(e){const t=this;t.selection&&(t._disabledSelection.push(e),t._fullRefresh("update"))}select(e){const t=this;t.selection&&(Array.isArray(e)?t._changeSelectionOfMultiple(e,"select"):t._selectSingle(e)&&(t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:t._interaction?"interaction":"programmatic"})))}setValue(e,t,a){const l=this,i=l.columnByDataField[t];if(!i)return;let n,r=l.rowById[e];if(r)n=r.data;else{if(r=l.dataSource.dataItemById[e],!r)return;n=r}t=i.dataField,l.dataSource._updating=!0,i.transform?(n[i.originalDataField]=a,n[t]=i.transform(a)):n[t]=a;const o=l.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused]) td[data-field="${t}"]`);if(o&&(l._setCellContent(o,l._formatCellValue(r,i,o),o.classList.contains("tree-cell")),i.templateElement&&i.templateElementSettings)){const e=o.classList.contains("tree-cell"),t=o,a=e?t.children[0].children[1]:t,r=n.$.id;l._cachedTemplates&&l._cachedTemplates[i.dataField+"_"+r]&&(0===l._cachedTemplates[i.dataField+"_"+r].innerHTML.length?delete l._cachedTemplates[i.dataField+"_"+r]:(a.innerHTML="",a.appendChild(l._cachedTemplates[i.dataField+"_"+r]))),i.templateElementSettings(n[i.dataField],r,a.firstElementChild),l._cachedTemplates||(l._cachedTemplates=[]),l._cachedTemplates[i.dataField+"_"+r]||(l._cachedTemplates[i.dataField+"_"+r]=a.firstElementChild)}l._updateCellsWithFormulas(),delete l.dataSource._updating}unselect(e){const t=this;t.selection&&(Array.isArray(e)?t._changeSelectionOfMultiple(e,"unselect"):t._unselectSingle(e)&&(t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:t._interaction&&-1===t._disabledSelection.indexOf(e)?"interaction":"programmatic"})))}set scrollTop(e){const t=this;t.isRendered&&(e=parseInt(e),isNaN(e)||((t.virtualization?t.$.virtualizationContainer:t.$.container).scrollTop=e))}get scrollTop(){const e=this;return e.isRendered?(e.virtualization?e.$.virtualizationContainer:e.$.container).scrollTop:0}set scrollLeft(e){const t=this;t.isRendered&&(e=parseInt(e),isNaN(e)||((t.virtualization?t.$.virtualizationContainer:t.$.container).scrollLeft=e))}get scrollLeft(){const e=this;return e.isRendered?(e.virtualization?e.$.virtualizationContainer:e.$.container).scrollLeft:0}clearContent(){const e=this;for(;e.$.tableContainer.firstChild;)e.$.tableContainer.removeChild(e.$.tableContainer.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.tableContainer);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let a=document.createElement("div");t.appendChild(a),e.content instanceof HTMLElement?a.appendChild(e.content):a.innerHTML=e.content;let l=Array.from(a.childNodes);a.parentNode.removeChild(a);for(let e=0;e<l.length;e++)t.appendChild(l[e]);e.clearContent(),e.$.tableContainer.appendChild(t)}propertyChangedHandler(e,t,a){const l=this;if(super.propertyChangedHandler(e,t,a),"innerHTML"!==e)switch(e){case"animation":case"theme":if("theme"===e){const e=getComputedStyle(l);l._defaults.text=l._toHex(e.color),l._defaults.highlight=l._toHex(e.backgroundColor)}if(l.filterRow){const t=l.$.tableContainer.querySelector(".jqx-table-filter-row");Array.from(t.querySelectorAll("jqx-input, jqx-button")).forEach((t=>t[e]=a))}i(e,a);break;case"autoSaveState":a&&window.localStorage.setItem("jqxTable"+l.id,l._stringifyState());break;case"columnGroups":a&&(l.columnResize&&(l.columnResize=!1),"auto"===l.columnSizeMode&&(l.removeAttribute("resize-max-reached"),l.columnSizeMode="default")),l.refresh();break;case"columnMinWidth":if(isNaN(parseFloat(a)))return void(l.columnMinWidth=t);l._handleAutoSizeMode(),l._handleFrozenColumnPositions(),l._refreshHorizontalScrollbar();break;case"columnResize":a&&l.columnGroups&&(l.columnResize=!1);break;case"columnResizeNormalize":l._columns&&l._columns.length>0&&""===l._columns[l._columns.length-1].dataField&&(l._columns.pop(),l.columns.pop()),l._initColumns(!0),l.refresh();break;case"columns":{l._conditionalFormatting&&delete l._conditionalFormatting;const e=l._sortColumns,t=l._filterInfo;if(l._clearFilterInput(),l._clearRowFilters(),delete l._filterInfo.appliedFilters,l._sortColumns=[],l._initColumns(!0),l.refresh(),l._formattingPanel&&(l._formattingPanel.columns=l._columns),l.dataSource.dataFields){let a=l.dataSource.dataFields||[];const i=l.columns;let n=!1;if(i.forEach((e=>{if(e.dataType){const t=a.find((t=>t.name===e.dataField));t?t.dataType=e.dataType:e.map?a.find((t=>e.map.indexOf(t.name)>=0?t:null))&&(l.dataSource.dataFields.push({name:e.dataField,map:e.map,dataType:e.dataType}),n=!0):(l.dataSource.dataFields.push({name:e.dataField,dataType:e.dataType}),n=!0)}})),n&&l.dataSource.dataBind){let a=[],i=[];if(l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.toArray&&(a=l.dataSource.groupBy.toArray().slice(0)),a.length>0&&(i=l._getExpandedGroups(l.dataSource.boundHierarchy)),l.dataSource.bindingCompleted=!1,l.dataSource.dataBind(),l._doNotFireEvent=!0,a.length>0&&(a.forEach((e=>l.addGroup(e))),l.dataSource.boundHierarchy&&l.dataSource.refreshHierarchy(),l._restoreExpandedGroups(i)),t.inputFilters?l._filterByAll(t.query):t.rowFilters?l._applyRowFilters():t.appliedFilters&&l._refreshFilters(),e&&(l._sortColumns=[],e.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)}))),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}l.virtualization&&setTimeout((()=>{const e=l.columns&&l.columns.length>0?l.columns[0].dataField:"";if(e){const t=l.querySelector('td[data-field="'+e+'"]');t&&l._rowHeight<t.offsetHeight&&(l._rowHeight=t.offsetHeight,l.style.setProperty("--jqx-table-row-height",l._rowHeight+"px"),l._refreshDataRows())}}),300),delete l._doNotFireEvent}else t.inputFilters?l._filterByAll(t.query):t.rowFilters?l._applyRowFilters():t.appliedFilters&&l._refreshFilters(),e&&(l._sortColumns=[],e.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)})))}break}case"columnSizeMode":if("auto"===a){if(l.columnGroups)return void(l.columnSizeMode="default");l._handleAutoSizeMode()}else l.removeAttribute("resize-max-reached"),l._columns.forEach((e=>{e.visible&&(e._isResponsive?e.headerCellElement.style.width=e.width||e._manualPercentageWidth?l._getColumnWidth(e.width||e._manualPercentageWidth,!0,e):null:e.headerCellElement.style.width=e.width||e._manualWidth?l._getColumnWidth(e.width||e._manualWidth,!0,e):null)}));l._handleFrozenColumnPositions(),l._refreshHorizontalScrollbar();break;case"conditionalFormatting":l._applyInitialConditionalFormatting(l.dataSource),l._refreshDataRows();break;case"conditionalFormattingButton":l.$.header.classList.toggle("jqx-hidden",(!l.filtering||l.filterRow)&&!a),!a&&l._dialog&&l._dialog.close();break;case"dataSource":case"dataSourceSettings":{const i=l._sortColumns,n=l._filterInfo;if("dataSource"===e&&null===a&&(l.dataSource=[]),"dataSource"===e&&t&&a&&l.virtualization&&!document.hidden&&t instanceof JQX.DataAdapter&&t.length===a.length&&t.length>0&&a.length>0&&!l.dataSourceSettings.parentDataField&&!t.parentDataField){if(l.dataSource=t,l._cachedDataSource===a)return;l.beginUpdate();for(let e=0;e<a.length;e++){const t=a[e],i=l.dataSource[e].$.id;l.updateRow(i,t,!0)}return i?l.endUpdate(!0,!0):l.endUpdate(void 0,!0),void(l._cachedDataSource=a)}const r=l.$.virtualizationContainer?l.$.virtualizationContainer.scrollTop:0,o=void 0!==l.$.virtualizationContainer&&l.$.virtualizationContainer.$?l.$.virtualizationContainer.$.verticalScrollBar:null;o&&o.beginUpdate();let s=[];if(t&&t.groupBy&&t.groupBy.toArray&&(s=t.groupBy.toArray().slice(0)),l._dataBind(!0),l._doNotFireEvent=!0,s.length>0){const e=l._getExpandedGroups(t.boundHierarchy);if(l.__updating=!0,l.dataSource._groupBy&&(l.dataSource._groupBy.canNotify=!1),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),s.forEach((e=>l.addGroup(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}else s.forEach((e=>l.addGroup(e)));l.dataSource.boundHierarchy&&l.dataSource.refreshHierarchy(),l.dataSource._groupBy&&(l.dataSource._groupBy.canNotify=!0),l.__updating=!1,l._restoreExpandedGroups(e),l._fullRefresh("update")}else if(l.dataSource.boundHierarchy&&l.dataSource.boundHierarchy.length&&t&&t.toArray){const e=t.toArray();for(let t=0;t<e.length;t++){const a=e[t];a.expanded&&(l._expandedIdsAlt[a.$.id]=!0,l._expandedIds.push(a.$.id))}if(l.expandHierarchy){if(l.dataSource&&l.dataSource.toArray){const e=l.dataSource.toArray();for(let t=0;t<e.length;t++){const a=e[t];a.expanded&&(l._expandedIdsAlt[a.$.id]=!0,l._expandedIds.push(a.$.id))}}l._expandedIds=l._expandedIds.filter((e=>!l._collapsedIds||!l._collapsedIds[e])),Object.keys(l._collapsedIds).forEach((e=>{delete l._expandedIdsAlt[e]}))}const a=(e,t,l)=>{const i=this;for(let n=t;n<l;n++){const t=e[n];if(!t)break;t.leaf||(i._expandedIdsAlt[t.$.id]?t.expanded=!0:(t.expanded,t.expanded=!1),t.children.length&&!1!==t.$.filtered&&a(t.children,0,t.children.length))}};a(l.dataSource.boundHierarchy,0,l.dataSource.boundHierarchy.length),l._fullRefresh("update")}if(n.inputFilters?l._filterByAll(n.query):n.rowFilters?l._applyRowFilters():n.appliedFilters&&l._refreshFilters(),i&&(l._sortColumns=[],i.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)}))),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}l.virtualization&&(setTimeout((()=>{const e=l.columns&&l.columns.length>0?l.columns[0].dataField:"";if(e){const t=l.querySelector('td[data-field="'+e+'"]');t&&l._rowHeight<t.offsetHeight&&(l._rowHeight=t.offsetHeight,l.style.setProperty("--jqx-table-row-height",l._rowHeight+"px"),l._refreshDataRows())}}),300),l.$.virtualizationContainer.scrollTop=r,o&&(o.endUpdate(),l._onVerticalChange({detail:{value:o.value}},!0))),delete l._doNotFireEvent;break}case"disabled":case"unfocusable":case"keyboardNavigation":l._setFocusable(),i("unfocusable",l.disabled||l.unfocusable||!l.keyboardNavigation),"disabled"===e&&l._dialog&&l._dialog.close();break;case"hideSelectionColumn":l.refresh();break;case"columnMenu":l.$.header.classList.toggle("jqx-hidden",(!l.filtering||l.filterRow||l.columnMenu)&&!l.conditionalFormattingButton),l.columnMenu&&(l._initialState=l.getState()),l.refresh();break;case"editing":a?l.$.tableContainer.removeAttribute("aria-readonly"):l.$.tableContainer.setAttribute("aria-readonly",!0);break;case"filtering":l.columnMenu||l.$.header.classList.toggle("jqx-hidden",(!a||l.filterRow)&&!l.conditionalFormattingButton),a&&l.filterRow?l._createFilterRow():!1===a&&(l.filterRow&&l.$.tableContainer.querySelector(".jqx-table-filter-row").remove(),(l._filterInfo.query||l._filterInfo.rowFilters||l._filterInfo.appliedFilters)&&l.clearFilters()),l.virtualization&&l.refresh();break;case"filterRow":if(l.$.header.classList.toggle("jqx-hidden",(!l.filtering||a)&&!l.conditionalFormattingButton),!l.filtering)return;a?l._createFilterRow():(l.$.tableContainer.querySelector(".jqx-table-filter-row").remove(),l._filterInfo.rowFilters&&l.clearFilters());break;case"filterTemplate":l._applyFilterTemplate();break;case"footerRow":{const e=l.$.tableContainer.querySelector("tfoot");e&&e.remove(),a&&l._createFooterRow();break}case"formulas":a?l._formulaParser=new JQX.FormulaParser(l):delete l._formulaParser,l._updateCellsWithFormulas(!0);break;case"freezeHeader":case"freezeFooter":l.virtualization&&(l[e]=!0);break;case"grouping":a||l.clearGrouping();break;case"headerRow":{const e=Array.from(l.$.tableContainer.firstElementChild.children);for(let t=1;t<e.length;t++)e[t].remove();a&&l._createCustomHeaderRow();break}case"locale":case"messages":{const e=l._dialog;if(l._localize(),l.filterRow){const e=l.$.tableContainer.querySelector(".jqx-table-filter-row"),t=Array.from(e.querySelectorAll("jqx-input.string-filter")),a=Array.from(e.querySelectorAll("jqx-input.num-date-filter")),i=Array.from(e.querySelectorAll("jqx-button"));t.concat(a).forEach((e=>e.title=l.localize("filterCondition"))),t.forEach((e=>{e.dataSource=l._filterInfo.stringConditions,void 0===e.$.input.dataValue?e.value=l.localize("CONTAINS"):e.value=l._filterInfo.stringConditions.find((t=>t.value===e.$.input.dataValue)).label})),a.forEach((e=>{e.dataSource=l._filterInfo.numberAndDateConditions,void 0===e.$.input.dataValue?e.value=l.localize("EQUAL"):e.value=l._filterInfo.numberAndDateConditions.find((t=>t.value===e.$.input.dataValue)).label})),i.forEach((e=>e.title=l.localize("clearFilter")))}e&&(e.$.footer.firstElementChild.innerHTML=l.localize("ok"),e.$.footer.children[1].innerHTML=l.localize("cancel"),e.classList.contains("conditional-formatting")?e.label=l.localize("conditionalFormatting"):e.classList.contains("drill-down")&&(e.label=l.localize("details"))),l._formattingPanel&&(l._formattingPanel.messages=l.messages,l._formattingPanel.locale=l.locale),Array.from(l.$.tableContainer.querySelectorAll(".group-label-value>.placeholder")).forEach((e=>{e.textContent=l.localize("EMPTY")}));break}case"pageIndex":l.pageIndex=Math.max(Math.min(Math.round(a),l.$.pager.pagesCount-1),0),l.paging&&l.pageIndex!==t&&(l._fullRefresh("pageIndexChange"),l.$.fireEvent("page",{action:"pageIndexChange"}));break;case"pageSize":l.paging&&(l._fullRefresh("pageSizeChange"),l.$.fireEvent("page",{action:"pageSizeChange"}));break;case"paging":if(!1===a){if(l.dataSource.virtualDataSource)return void(l.paging=!0);if(1===l.$.pager.pagesCount)return}l._fullRefresh();break;case"rowDetailTemplate":l._fullRefresh();break;case"rightToLeft":Array.from(l.$.tableContainer.querySelectorAll(".freeze-near, .freeze-far")).forEach((e=>{e.style.left=null,e.style.right=null,e.style.zIndex=null})),l._handleFrozenColumnPositions(),i("rightToLeft",a);break;case"selected":{const e=l._selectedIds.slice(0);l._clearSelection(),l._changeSelectionOfMultiple(a,"select","programmatic",e);break}case"selection":if(l.filterRow){const e=l.$.tableContainer.querySelector(".jqx-table-filter-row");a?e.insertBefore(document.createElement("td"),e.firstElementChild):e.firstElementChild.remove()}l.refresh(),a?(l.$.tableContainer.setAttribute("aria-multiselectable",!0),l._updateSelectAllState()):l.$.tableContainer.removeAttribute("aria-multiselectable");break;case"selectionMode":{l.$.tableContainer.classList.remove("jqx-unselectable");const e=l.querySelector(".jqx-table-select-all");e&&("one"===l.selectionMode?e.classList.add("jqx-visibility-hidden"):e.classList.remove("jqx-visibility-hidden"));break}case"sortMode":"none"===a&&l.clearSort();break;case"tooltip":if(!a){const e=l.$.tableContainer.querySelector(".tooltip");e&&(e.classList.remove("tooltip"),e.removeAttribute("title"))}break;case"virtualization":l.virtualization=t}else l._initDataSourceFromHTML();function i(e,t){const a=[];l._dialog&&a.push(l._dialog,l._dialog.$.footer.firstElementChild,l._dialog.$.footer.children[1]),l._formattingPanel&&a.push(l._formattingPanel),a.forEach((a=>a[e]=t))}}_createElement(){const e=this;if(e._expandedRowDetailIds=[],e._editors={},isNaN(parseFloat(e.columnMinWidth))&&(e.columnMinWidth="50px"),e.columnGroups&&(e.columnResize=!1,e.columnSizeMode="default"),e.formulas&&(e._formulaParser=new JQX.FormulaParser(e)),e._setupPagingAndFiltering(),e._localize(),e._selectedIds=e.selected.slice(0),"one"===e.selectionMode){e._selectedIds=e._selectedIds.slice(0,1);const t=e.querySelector(".jqx-table-select-all");t&&t.classList.add("jqx-visibility-hidden")}e._dataBind(),e.editing||e.$.tableContainer.setAttribute("aria-readonly",!0),e.autoLoadState&&e.loadState(),e.autoSaveState&&window.localStorage.setItem("jqxTable"+e.id,e._stringifyState())}_initColumns(e){const t=this,a=t.columns;if(!t.isRendered&&t.dataSource.length>0&&(!a||Array.isArray(a)&&0===a.length)&&(t.columns=t.dataSource.dataFields.map((e=>({label:e.name,dataField:e.name,dataType:e.dataType})))),t._filterInfo.stringDataFields=[],t._columns=[],t.columnByDataField={},t.columns.canNotify=!1,t.columns instanceof JQX.ObservableArray){const e=[];for(let a=0;a<t.columns.length;a++){let l=t.columns[a],i={};for(let e in l)i[e]=l[e];e.push(i)}t.columns=e}for(let a=0;a<t.columns.length;a++){let l=t.columns[a];if("string"==typeof l&&t.dataSource.dataFields){const e=t.dataSource.dataFields.find((e=>{if(e.name===l)return e}));l={label:l,dataField:l,dataType:e&&e.dataType||"string"}}void 0===l.label&&void 0===l.dataField||(void 0===l.label&&(l.label=l.dataField),void 0===l.dataField&&(l.dataField=l.label),l.dataType||(l.dataType="string"),"string"!==l.dataType&&"number"!==l.dataType||!1===l.allowFilter||!l.dataField||t._filterInfo.stringDataFields.push(l.dataField),l.visible=void 0===l.visible||!!l.visible,l.allowResize=void 0===l.allowResize||!!l.allowResize,t._transformColumnDataField(l,e),l.thHierarchy=[],t._columns.push(l),t.columnByDataField[l.dataField]=l)}if("default"===t.columnSizeMode&&t.selection){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width){e=!1,l._isResponsive=!0,l._isFillRemainingWidth=!0;break}}(!t.columnResizeNormalize&&e||t.columnResizeNormalize&&e)&&t._columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1})}else if("default"===t.columnSizeMode&&!t.selection&&t.columnResizeNormalize){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width){e=!1,l._isResponsive=!0,l._isFillRemainingWidth=!0;break}}e&&t._columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1})}t.columns=new JQX.ObservableArray(t._columns),t._updateState("columns"),t.columns.notify((function(e){if(!t.columns.canNotify)return;if("length"===e.action||"update"===e.action&&-1!==["allowGroup","allowSort","sortOrder"].indexOf(e.propertyName))return void t._updateState("columns");const a=e.target;if("update"===e.action){const l=a.dataField;if("allowEdit"===e.propertyName)return Array.from(t.$.tableContainer.querySelectorAll(`td[data-field="${l}"]`)).forEach((t=>{t.classList.toggle("no-edit",!1===e.newValue),!1===e.newValue?t.setAttribute("aria-readonly",!0):t.removeAttribute("aria-readonly")})),void t._updateState("columns");if("allowFilter"===e.propertyName)return"string"!==a.dataType&&"number"!==a.dataType||!l||(!1===e.newValue?t._filterInfo.stringDataFields=t._filterInfo.stringDataFields.filter((e=>e!==l)):!1===e.oldValue&&t._filterInfo.stringDataFields.push(l)),t.filterRow&&t.$.tableContainer.querySelector(`.jqx-table-filter-row td[filter-for="${l}"]`).classList.toggle("no-filter",!1===e.newValue),"jqx-pivot-table"===t.nodeName.toLowerCase()&&t._columnNotify(e),void t._updateState("columns");if("transform"===e.propertyName)a.sortOrder&&t.sortBy(a.dataField,null),t._transformColumnDataField(a,!0);else{if(-1!==["allowPivot","allowRowGroup","pivot","rowGroup","summary"].indexOf(e.propertyName)&&"jqx-pivot-table"===t.nodeName.toLowerCase())return t._columnNotify(e),void t._updateState("columns");if("visible"===e.propertyName){const e=t._expandedRowDetailIds,a=t.$.tableContainer;let l;return t.filterRow&&(l=a.querySelector(".jqx-table-filter-row"),l&&l.remove()),e&&e.length&&!t._columns.some((e=>e.visible))&&e.forEach((e=>t._toggleRowDetail(a.querySelector(`[row-id="${e}"]`),e))),t.$.tableContainer.setAttribute("aria-colcount",t._columns.filter((e=>e.visible)).length+ +t.selection),t.refresh(),void t._updateState("columns")}}}"add"===e.action&&(t.columns[t.columns.length-1].visible=!0),t._columns=t.columns._array,t.columnByDataField=[],t._columns.forEach((e=>{t.columnByDataField[e.dataField]=e,e.originalDataField&&(t.columnByDataField[e.originalDataField]=e)})),t.refresh(!0),t._updateState("columns")})),t.$.tableContainer.setAttribute("aria-colcount",t._columns.filter((e=>e.visible)).length+ +t.selection)}_transformColumnDataField(e,t){const a=this;if("function"==typeof e.transform){if(!a.isRendered||t){const l=a.dataSource,i=a.columns.canNotify;i&&(a.columns.canNotify=!1),t&&e.originalDataField&&(delete a.columnByDataField[e.dataField],e.dataField=e.originalDataField);const n=e.dataField,r=n+"Transformed";a.columnByDataField[n]=e,e.originalDataField=n,e.dataField=r,l.canNotify=!1;for(let t=0;t<l.length;t++){const a=l[t];a[r]=e.transform(a[n])}i&&(a.columns.canNotify=!0),l.canNotify=!0}}else e.transform&&(e.transform=void 0)}_initRows(){const e=this,t=e.dataSource,a=e.context;if(e.context=e,e.rows=[],e.rowById=[],t.virtualDataSource)return e._initRowsVirtualDataSource(),void(e.context=a);if(t.boundHierarchy)return e.$.tableContainer.setAttribute("role","treegrid"),e.setAttribute("hierarchy",""),e._initHierarchicalRows(),void(e.context=a);e.$.tableContainer.setAttribute("role","grid");let l=0,i=t.length,n=!1;if(e.removeAttribute("hierarchy"),e.paging){const a=e.pageSize;if(e._filterInfo.query||e._filterInfo.rowFilters||e._filterInfo.appliedFilters){let e=0;for(let a=0;a<i;a++)!1!==t[a].$.filtered&&e++;i=e,n=!0}const r=Math.max(Math.ceil(i/a),1);e.$.pager.pagesCount=r,e.$.pager.totalRecords=i,e.pageIndex=Math.max(Math.min(e.pageIndex,r-1),0),l=e.pageIndex*a,i=l+a}if(n){let a=-1;for(let n=0;n<t.length;n++){const r=t[n];if(r&&!1!==r.$.filtered){if(a++,a<l)continue;if(a>=i)break;e._addNewRow(r,n)}}}else for(let a=l;a<i;a++){const l=t[a];l&&!1!==l.$.filtered&&e._addNewRow(l,a)}e._observeRows(),e.context=a}_initRowsVirtualDataSource(){const e=this,t=e.dataSource;if(t.boundHierarchy)e.$.tableContainer.setAttribute("role","treegrid"),e.setAttribute("hierarchy",""),e._processHierarchy(t.boundHierarchy,0,t.boundHierarchy.length);else for(let a=0;a<t._dataSource.length;a++){const l=t[a];l&&!1!==l.$.filtered&&e._addNewRow(l,a)}if(e.paging){const a=t.length,l=e.pageSize,i=Math.max(Math.ceil(a/l),1),n=e.$.pager.pagesCount;if(e.$.pager.pagesCount=i,e.$.pager.totalRecords=a,e.pageIndex=Math.max(Math.min(e.pageIndex,i-1),0),null!==n&&n!==i)return void e._fullRefresh()}e._observeRows()}_initHierarchicalRows(){const e=this,t=e.dataSource.boundHierarchy;let a=0,l=t.length,i=!1;if(e.paging){const n=e.pageSize;if(e._filterInfo.query||e._filterInfo.rowFilters||e._filterInfo.appliedFilters){let e=0;for(let a=0;a<l;a++)!1!==t[a].$.filtered&&e++;l=e,i=!0}const r=Math.max(Math.ceil(l/n),1);e.$.pager.pagesCount=r,e.$.pager.totalRecords=l,e.pageIndex=Math.max(Math.min(e.pageIndex,r-1),0),a=e.pageIndex*n,l=a+n}if(i){let i=-1;for(let n=0;n<t.length;n++){const r=t[n];if(r&&!1!==r.$.filtered){if(i++,i<a)continue;if(i>=l)break;e._processHierarchy(t,n,n+1)}}}else e._processHierarchy(t,a,l);e._observeRows()}_processHierarchy(e,t,a){const l=this;for(let i=t;i<a;i++){const t=e[i];if(!t)break;t.leaf?t&&!1!==t.$.filtered&&l._addNewRow(t,i):(l._expandedIdsAlt[t.$.id]?t.expanded=!0:void 0===t.expanded&&(t.expanded=!1),!1!==t.$.filtered&&l._addNewRow(t,i),t.children.length&&!1!==t.$.filtered&&l._processHierarchy(t.children,0,t.children.length))}}_observeRows(){const e=this;e.rows=new JQX.ObservableArray(e.rows),e.rows.notify((function(t){if(!e.rows.canNotify||t.path||!e.dataSource)return;e.rows.canNotify=!1;const a=t.action,l=e._selectedIds.slice(0);switch(e.dataSource.canNotify=!1,a){case"add":{const a={};e.dataSource.dataFields.forEach((e=>a[e.name]=""));const l=Object.assign(a,e.rows[t.index]);e.dataSource.add(e.rows[t.index]),e._editing={row:{data:l}};break}case"update":e.dataSource.update(t.index,e.rows[t.index]),e._editing={row:{data:e.rows[t.index]}};break;case"remove":{const a=t.removed[0].data,l=a.$.id,i=e._selectedIds.indexOf(l);e.dataSource.removeAt(a.$.index),delete e.rowById[l],-1!==i&&e._selectedIds.splice(i,1),e._editing={row:t.removed[0]},e._updateSelectAllState();break}}e._fullRefresh(a,l,a),delete e._editing,e.dataSource.canNotify=!0,e.rows.canNotify=!0}))}beginUpdate(){const e=this;if("jqx-table"!==e.nodeName.toLowerCase())return;e.__updating=!0,e.__updatedRows=!1;const t=window.__karma__||window.karma;document.hidden&&!t||(e._dirtyHierarchy=!1,e.__updatingOldSelectedIds=e._selectedIds.slice(0),e.__updatingSortColumns=e._sortColumns,e.dataSource&&e.dataSource.clearSort&&e.dataSource.clearSort())}endUpdate(e,t){const a=this;if("jqx-table"!==a.nodeName.toLowerCase())return;a.__updating=!1;const l=window.__karma__||window.karma;if(document.hidden&&!l)return;if(!1===e)return;l&&(t=!0);const i=()=>{const t=a.__updatingOldSelectedIds?a.__updatingOldSelectedIds:a._selectedIds.slice(0);a.__updatingOldSelectedIds&&delete a.__updatingOldSelectedIds,a._dirtyHierarchy&&a.dataSource.refreshHierarchy();const l=a._sortColumns,i=a._filterInfo,n=a.dataSource.groupBy._array.slice(0),r=void 0!==a.$.virtualizationContainer&&a.$.virtualizationContainer.$?a.$.virtualizationContainer.$.verticalScrollBar:null;if(r&&r.beginUpdate(),a._doNotFireEvent=!0,a._fullRefresh("update",t,"update"),n.length>0){let e=a._getExpandedGroups(a.dataSource.boundHierarchy);a._dirtyHierarchy&&(e=a._dirtyHierarchy),n.forEach((e=>a.addGroup(e))),a._restoreExpandedGroups(e)}i.inputFilters?a._filterByAll(i.query):i.rowFilters?a._applyRowFilters():i.appliedFilters&&a._refreshFilters(),l&&(a.__updatingSortColumns&&JSON.stringify(a.__updatingSortColumns)!==JSON.stringify(l)||0===n.length||!0===e||!1===a.__updatedRows)&&(a._sortColumns=[],l.forEach((e=>{a.columnByDataField[e.dataField].sortOrder=null,a.sortBy(e.dataField,e.direction)}))),r&&(r.endUpdate(),a._onVerticalChange({detail:{value:r.value}},!0),a._dirtyHierarchy&&(a._rowsInDOM.length<a.rows.length&&0===a.$.virtualizationContainer.$.verticalScrollBar.max&&a._refreshDataRows(),a._dirtyHierarchy=!1)),a.onUpdateComplete&&a.onUpdateComplete(a.rows),delete a._doNotFireEvent};if(a._verticalScrollTimer)return a._scheduleUpdate&&clearInterval(a._scheduleUpdate),void(a._scheduleUpdate=setInterval((function(){a._verticalScrollTimer||(i(),clearInterval(a._scheduleUpdate),delete a._scheduleUpdate)}),100));t?i():requestAnimationFrame((()=>{i()}))}_addNewRow(e,t){const a=this,l=e.$.id,i=new JQX.Observable({data:e,boundIndex:t});-1!==a._disabledSelection.indexOf(l)&&(i.allowSelect=!1),i.canNotify=!0,i.notify((function(t){if(a._editing||a._hierarchyChange)return;const i=a.selection;if("allowSelect"===t.propertyName){const n=a._disabledSelection.indexOf(l);if(a._hierarchyChange=!0,t.newValue||-1!==n)t.newValue&&-1!==n&&function e(t){const l=t.$.id,n=a.$.tableContainer.querySelector(`[row-id="${l}"]:not([unused])`),r=a.rowById[l];if(t.parent&&-1!==a._disabledSelection.indexOf(t.parent.$.id))r.allowSelect=!1;else if(a._disabledSelection.splice(a._disabledSelection.indexOf(l),1),n&&(n.classList.remove("disable-select"),i&&(n.setAttribute("aria-selected",!1),n.firstElementChild.firstElementChild.removeAttribute("aria-disabled"))),r&&(r.allowSelect=!0),t.children)for(let a=0;a<t.children.length;a++)e(t.children[a])}(e);else{const t=[];!function e(t,l){const n=t.$.id,r=a.$.tableContainer.querySelector(`[row-id="${n}"]:not([unused])`),o=a.rowById[n];if(l.push(n),r&&(r.removeAttribute("aria-selected"),r.classList.add("disable-select"),i&&r.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),o&&(o.allowSelect=!1),t.children)for(let a=0;a<t.children.length;a++)e(t.children[a],l)}(e,t),a._disabledSelection=a._disabledSelection.concat(t),a.unselect(t)}delete a._hierarchyChange}})),a.rowById[l]=i,a.rows.push(i)}refresh(){const e=this;if(e.__updating)return;const t=e._columns.filter((e=>e.visible)),a=e.$.tableContainer,l=a.querySelector(".jqx-table-filter-row"),i=a.querySelector("tfoot"),n=document.createElement("tbody"),r=e._getFractionOfMax(),o=e.virtualization?e.$.virtualizationContainer:e.$.tableContainer.parentElement,s={top:o.scrollTop,left:o.scrollLeft};for(e.columns.canNotify=!1;a.childNodes.length>0;)a.childNodes[0].remove();e._createTableHeader(),e.isRendered||!e.onInit||e._loadingState||e.onInit(),e._createCustomHeaderRow(),e._createFooterRow(i),e._createDataRows(n),e._createFilterRow(l);const d=a.querySelectorAll("th[data-field]");for(let a=0;a<t.length;a++){const l=t[a];l.headerCellElement=d[a],l.headerCellElement&&(l.headerCellElement.onclick=function(){const t=this.dataField;e.$.fireEvent("columnClick",{dataField:t}),e.closeColumnMenu(),"none"===e.sortMode||!1===l.allowSort||e._preventClickSort||(e._addSortIconContainer(this),e._sortOnClick=!0,this.headerCellElement.sortIconContainerElement.classList.contains("asc")?e.sortBy(t,"desc"):this.headerCellElement.sortIconContainerElement.classList.contains("desc")?e.sortBy(t,null):e.sortBy(t,"asc"),e._sortOnClick=!1)}.bind(l))}if(e._sortColumns&&e._sortColumns.length>0)for(let t=0;t<e._sortColumns.length;t++){const a=e._sortColumns[t],l=e.columnByDataField[a.dataField];e._addSortIconContainer(l,a.direction,t+1)}e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),e.isRendered&&(e.selection&&e._updateSelectAllState(),e._setFractionOfMax(r)),[o.scrollTop,o.scrollLeft]=[s.top,s.left],e.columns.canNotify=!0}_createTableHeader(){const e=this,t=e.selection,a=document.createElement("thead"),l=e._columns.filter((e=>e.visible)),i=e._getColumnHeaderStructure(),n=window.innerWidth,r={};for(let o=0;o<i;o++){const s=document.createElement("tr"),d=document.createDocumentFragment();t&&(s.innerHTML=o<i-1?'<th class="empty"></th>':'<th class="jqx-table-select-all freeze-near" scope="col" aria-colindex="1"><div role="checkbox" aria-checked="false" aria-label="Toggle selection of all rows"></div></th>',e.virtualization&&s.querySelector("th").classList.add("sticky")),o<i-1&&s.classList.add("column-groups-header");for(let a=0;a<l.length;a++){const s=l[a];if(0===o&&(s.width&&isNaN(parseFloat(s.width))&&delete s.width,s.responsivePriority&&("number"!=typeof s.responsivePriority&&(s.responsivePriority=1),s.responsivePriority=Math.max(Math.min(Math.round(s.responsivePriority),5),1),i>1&&(r[a]=e._isColumnHidden(s.responsivePriority,n)))),o<i-1){if(r[a])continue;const t=l[a],i=t.headerStructure[o];if(a>0){let r=a-1,s=l[r];for(;s&&e._isColumnHidden(s.responsivePriority,n);)r--,s=l[r];if(s&&i===s.headerStructure[o]&&e._areColumnsWithSameFreezeSettings(t,s))continue}const s=document.createElement("th");if(s.includes=[t],a<l.length-1){let r=1,d=a+1,c=l[d];for(;c;){if(!e._isColumnHidden(c.responsivePriority,n)){if(i!==c.headerStructure[o]||!e._areColumnsWithSameFreezeSettings(t,c))break;r++,s.includes.push(c)}d++,c=l[d]}s.colSpan=r}0!==o&&t.headerStructure[o-1]===i||(s.textContent=i),s.includes.forEach((e=>e.thHierarchy[o]=s)),s.classList.add("column-header"),t.freeze&&s.classList.add("freeze-"+("far"===t.freeze?"far":"near")),e.virtualization&&s.classList.add("sticky"),d.appendChild(s)}else e._setupColumnHeaderCell(t,d,a,s)}s.appendChild(d),a.appendChild(s),e._tableHeader=a}if(e.$.tableContainer.appendChild(a),"default"===e.columnSizeMode){for(let t=0;t<e.columns.length;t++){const l=e.columns[t];if(!l.width){const t=a.querySelector('[data-field="'+l.dataField+'"]');t&&t.offsetWidth<5&&(t.style.width=parseInt(l.minWidth||e.columnMinWidth)+"px")}}if(t){const t=e.columns.filter((e=>e.visible));if(1===t.length){const e=t[0],l=a.querySelector('[data-field="'+e.dataField+'"]');l&&(l.style.width="")}}}}_getColumnHeaderStructure(){const e=this._columns,t=this.columnGroups;if(!t)return 1;let a=1;for(const l of e){let e=l.columnGroup;if(l.headerStructure=[],e&&(e=t.find((t=>t.name===e)),e))for(l.headerStructure.push(e.label||e.name);e.parentGroup&&(e=t.find((t=>t.name===e.parentGroup)),e);)l.headerStructure.unshift(e.label||e.name);l.headerStructure.push(l.label),a=Math.max(a,l.headerStructure.length)}for(const t of e){const e=t.headerStructure,l=e[0];for(;e.length<a;)e.unshift(l)}return a}_isColumnHidden(e,t){return!(!e||1===e||t>1280)&&(t<=640&&2===e||t<=800&&3===e||t<=1024&&4===e||t<=1280&&5===e)}_areColumnsWithSameFreezeSettings(e,t){return!e.freeze&&!t.freeze||e.freeze===t.freeze||!0===e.freeze&&"near"===t.freeze||"near"===e.freeze&&!0===t.freeze}getColumnProperty(e,t){const a=this,l=a.columnByDataField[e];return l?"width"===t?l.width?a._getColumnWidth(l.width,!0,l):l._isResponsive&&l._manualPercentageWidth?a._getColumnWidth(l._manualPercentageWidth+"%",!0,l):a._getColumnWidth(l._manualWidth,!0,l):l[t]:null}setColumnProperty(e,t,a){const l=this;if(!l.columnByDataField[e])return null;l.columns.forEach(((i,n)=>{i.dataField===e&&(l.columns[n][t]=a)}))}_getTableRemainingWidth(){const e=this;let t=e.offsetWidth;if(e.selection){const a=e.$.tableContainer.querySelector(".jqx-table-select-all");a&&(t=e.offsetWidth-a.offsetWidth),""===e.columns[e.columns.length-1].dataField&&(t-=parseInt(e.columnMinWidth))}e.virtualization&&e.$.virtualizationContainer&&e.$.virtualizationContainer.computedVerticalScrollBarVisibility&&(t-=20);let a=0;for(let t=0;t<e.columns.length;t++){const l=e.columns[t];l.visible&&l.width&&!(""+l.width).endsWith("%")&&(a+=e._getColumnWidth(l.width))}return t-=a,t}_getColumnWidth(e,t,a){const l=this,i=parseFloat(e);if((e=(e+"").trim()).endsWith("%")){let e=l.offsetWidth;if(l.selection){const t=l.$.tableContainer.querySelector(".jqx-table-select-all");t&&(e=l.offsetWidth-t.offsetWidth),""===l.columns[l.columns.length-1].dataField&&(e-=parseInt(l.columnMinWidth))}l.virtualization&&l.$.virtualizationContainer&&l.$.virtualizationContainer.computedVerticalScrollBarVisibility&&(e-=20);let n=0;for(let e=0;e<l.columns.length;e++){const t=l.columns[e];t.visible&&t.width&&!(""+t.width).endsWith("%")&&(n+=l._getColumnWidth(t.width))}e-=n;const r=a&&a.minWidth||l._getNumericMinWidth(),o=t?i+"%":e*(i/100);return r>o?r:o}return isNaN(i)?"auto":t?i+"px":i}_setupColumnHeaderCell(e,t,a,l){const i=this,n=document.createElement("th");if(n.setAttribute("aria-colindex",a+1+ +e),l.width){let e=l.width;"number"==typeof e&&l.minWidth&&(e=Math.max(e,l.minWidth)),n.style.width=i._getColumnWidth(e,!0,l)}else l._manualWidth&&(l._isResponsive?n.style.width=l._manualPercentageWidth+"%":n.style.width=l._manualWidth+"px");1!==i._columns.length&&l.allowResize||n.setAttribute("locked",""),l.freeze&&n.classList.add("freeze-"+("far"===l.freeze?"far":"near")),l.responsivePriority&&n.classList.add("priority-"+l.responsivePriority),i.virtualization&&n.classList.add("sticky"),n.setAttribute("data-field",l.dataField);let r=l.label;if((/<.+?>/.test(r)||/<./.test(r))&&r.replace&&("all"===i.dataSourceSettings.sanitizeHTML?r=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===i.dataSourceSettings.sanitizeHTML&&(r=window.JQX.Utilities.Core.sanitizeHTML(r))),n.innerHTML=`<div class="wrapper" role="presentation"><div class="label">${r}</div></div>`,i.columnMenu){const e=document.createElement("div");e.classList.add("column-menu"),e.setAttribute("aria-hidden",!0),n.firstElementChild.appendChild(e),e.onclick=e=>{i.activeColumnMenu&&i.activeColumnMenu.dataField===l.dataField?i.closeColumnMenu():i.openColumnMenu(l.dataField),e.preventDefault(),e.stopPropagation()}}i.onColumnRender&&i.onColumnRender(l.dataField,n),t.appendChild(n)}_refreshDataRows(){const e=this,t=window.scrollY,a=window.scrollX,l=e.$.tableContainer.children[1],i=Array.from(l.querySelectorAll("tr:not(.jqx-table-filter-row)"));if(e._clearCachedTemplates(),e.filterRow||e.footerRow||e.headerRow)for(let e=0;e<i.length;e++)i[e].remove();else l.innerHTML="";e._createDataRows(l),e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),(a||t)&&window.scroll(a,t)}_createDataRows(e){const t=this;if(t.virtualization)return void t._createVirtualDataRows(e);const a=t.rowDetailTemplate,l=t.selection,i=document.createDocumentFragment(),n=t.hasAttribute("hierarchy");for(let e=0;e<t.rows.length;e++){const r=t.rows[e],o=r.data;o.groupDataField?t._createGroupHeader(o,i):t._createDataRow(r,i,{hierarchical:n,rowDetailTemplate:a,selection:l,virtualization:!1})}if(i.appendChild(t._createLastRow()),e.appendChild(i),t._updateState("expanded"),e.parentElement||t.$.tableContainer.insertBefore(e,t.$.tableContainer.querySelector("tfoot")),t.getRootNode().activeElement===t.$.tableContainer&&t._tableContainerFocusHandler(),t._templateTags.length){const e=t.querySelectorAll("tr");for(let a=0;a<t._templateTags.length;a++){const l=t._templateTags[a],i=l.index,n=l.dataField,r=l.td;if(e[i]){const t=e[i].querySelector('[data-field="'+n+'"]'),a=[...t.querySelectorAll("jqx-button"),...t.querySelectorAll("button"),...t.querySelectorAll("a"),...t.querySelectorAll("span")],l=[...r.querySelectorAll("jqx-button"),...r.querySelectorAll("button"),...r.querySelectorAll("a"),...r.querySelectorAll("span")];for(let e=0;e<a.length;e++)"button"===a[e].nodeName.toLowerCase()&&a[e].classList.contains("jqx-button")||(a[e].onclick=()=>{l[e].click()})}}}}_createDataRow(e,t,a){const l=this,i=l._columns.filter((e=>e.visible)),n=e.data,r=n.$.id,o=document.createElement("tr"),s={row:o,detail:null};let d=0;o.setAttribute("aria-rowindex",n.$.index+1),l._processAndRenderSelection(n,o,a.hierarchical),a.selection&&d++;for(let t=0;t<i.length;t++){const s=document.createElement("td"),c=i[t];s.setAttribute("data-field",c.dataField),s.setAttribute("aria-colindex",t+1+ +a.selection);let u,f=l._formatCellValue(e,c,s);if(c.freeze&&s.classList.add("freeze-"+("far"===c.freeze?"far":"near")),c.responsivePriority&&s.classList.add("priority-"+c.responsivePriority),!1===c.allowEdit&&(s.classList.add("no-edit"),s.setAttribute("aria-readonly",!0)),0===t&&a.hierarchical){const e=l._areChildrenFiltered(n);n.leaf||(s.classList.add("tree-cell"),u=e),n.level&&(s.classList.add("outline-level-"+Math.min(n.level,10)),!n.leaf&&e||s.classList.add("tree-leaf"))}if(a.virtualization&&c.templateElement){const e=c.templateElement+"";u&&l._setCellContent(s,f,u);const t=u?s.children[0].children[1]:s;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+n[c.dataField]+"</div>"):t.innerHTML=e,c.templateElementSettings&&(l._cachedTemplates&&l._cachedTemplates[c.dataField+"_"+r]&&(0===l._cachedTemplates[c.dataField+"_"+r].innerHTML.length?delete l._cachedTemplates[c.dataField+"_"+r]:(t.innerHTML="",t.appendChild(l._cachedTemplates[c.dataField+"_"+r]))),c.templateElementSettings(n[c.dataField],r,t.firstElementChild),l._cachedTemplates||(l._cachedTemplates=[]),l._cachedTemplates[c.dataField+"_"+r]||(l._cachedTemplates[c.dataField+"_"+r]=t.firstElementChild))}else""===c.dataField&&void 0===f&&(f=""),l._setCellContent(s,f,u);l.onCellRender&&l.onCellRender(n,c.dataField,n[c.dataField],s),l._applyConditionalFormattingToCell(s,c.dataField,n.$.index),o.appendChild(s),d++}if(o.data=n,o.setAttribute("row-id",r),-1!==l._disabledSelection.indexOf(r)&&(o.removeAttribute("aria-selected"),o.classList.add("disable-select"),a.selection&&o.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),n.expanded?(-1===l._expandedIds.indexOf(r)&&l._expandedIds.push(r),l._expandedIdsAlt[r]=!0,o.setAttribute("aria-expanded",!0),o.classList.add("expanded")):!1===n.expanded&&o.setAttribute("aria-expanded",!1),n.level&&l._isCollapsed(n)&&(o.setAttribute("aria-hidden",!0),o.classList.add("collapsed","jqx-hidden")),t.appendChild(o),a.rowDetailTemplate){const i=document.createElement("tr");if(-1===l._expandedRowDetailIds.indexOf(r)){if(a.virtualization)return s;i.setAttribute("aria-hidden",!0),i.classList.add("collapsed")}else s.detail=i;i.data=Object.assign(n,{detail:!0}),i.classList.add("jqx-table-row-detail"),i.innerHTML=`<td colspan="${d}"><div class="jqx-table-detail-container">${l._applyRowDetailTemplate(e)}</div></td>`,t.appendChild(i)}return s}_processAndRenderSelection(e,t,a,l){const i=this,n=e.$.id,r=i._getChildCheckState(e).state;if(a&&i.selectionByHierarchy){const e=i._selectedIds.indexOf(n);!0===r&&-1===e?i._selectedIds.push(n):r||-1===e||i._selectedIds.splice(e,1)}if(!i.selection)return;let o,s;l?(o=t.firstElementChild,s=o.firstElementChild):(o=document.createElement("td"),s=document.createElement("div")),s.className="selection-checkbox",s.setAttribute("role","checkbox"),s.setAttribute("aria-checked",!!r||null===r&&"mixed"),s.setAttribute("aria-label","Toggle row selection"),o.className="jqx-table-select-row freeze-near"+(r?" selected":null===r?" indeterminate":""),o.setAttribute("aria-colindex",1),l||(o.appendChild(s),t.appendChild(o)),t.setAttribute("aria-selected",!0===r)}_applyConditionalFormattingToCell(e,t,a){const l=this;if(l._conditionalFormatting&&l._conditionalFormatting[t]){const i=l._conditionalFormatting[t][a];i&&(e.style.backgroundColor=i.background,e.style.color=i.color,e.style.fontFamily=i.fontFamily,e.style.fontSize=i.fontSize)}}_createLastRow(){const e=document.createElement("tr");e.setAttribute("aria-hidden",!0),e.classList.add("last-visible");try{new ResizeObserver((t=>{try{e.classList.toggle("sized",t[0].contentRect.height>0&&null!==e.previousSibling)}catch(e){}})).observe(e)}catch(e){}return e}_createGroupHeader(e,t,a){const l=this;l.columnByDataField[e.groupDataField]||console.error(l.localize("grouping"));const i=l.columnByDataField[e.groupDataField]?l.columnByDataField[e.groupDataField].label:`${l.localize("EMPTY")}`,n=a||document.createElement("tr"),r=document.createElement("td"),o=document.createElement("div"),s=document.createElement("div"),d=document.createElement("div");let c=e.label;if((/<.+?>/.test(c)||/<./.test(c))&&c.replace&&("all"===l.dataSourceSettings.sanitizeHTML?c=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===l.dataSourceSettings.sanitizeHTML&&(c=window.JQX.Utilities.Core.sanitizeHTML(c))),""!==c&&c||(c=`<em class="placeholder">${l.localize("EMPTY")}</em>`),n.removeAttribute("aria-rowindex"),n.data=e,s.classList.add("hierarchy-arrow","jqx-arrow","jqx-arrow-down"),s.setAttribute("role","button"),s.setAttribute("aria-label","Toggle row"),d.classList.add("group-label"),d.innerHTML=`<span class="group-label-name">${i}: </span>\n <span class="group-label-value">${c}</span>\n <span class="group-label-count">(${l._getLeafCount(e)})</span>`,r.colSpan=l._columns.filter((e=>e.visible)).length,r.classList.add("group-header"),e.level&&(r.classList.add("outline-level-"+Math.min(e.level,10)),l._isCollapsed(e)&&(n.setAttribute("aria-hidden",!0),n.classList.add("collapsed","jqx-hidden"))),n.setAttribute("row-id",e.$.id),n.setAttribute("role","group"),n.setAttribute("aria-level",e.level),o.appendChild(s),o.appendChild(d),r.appendChild(o),l._processAndRenderSelection(e,n,!0),n.appendChild(r),n.setAttribute("aria-expanded",e.expanded),n.classList.toggle("expanded",e.expanded),e&&e.$&&!1===e.$.filtered&&n.classList.add("jqx-hidden"),l.groupFormatFunction){const t={value:c,row:e.$.id,column:e.groupDataField,data:e,template:null};l.groupFormatFunction(t),c!==t.value&&(d.innerHTML=`<span class="group-label-name">${i}: </span>\n <span class="group-label-value">${t.value}</span>\n <span class="group-label-count">(${l._getLeafCount(e)})</span>`),t.template instanceof HTMLElement&&(d.innerHTML="",d.appendChild(t.template));const a=t.template;let n="";if(a&&a.startsWith("#")){const e=document.querySelector(a);let t=c;if(e&&e instanceof HTMLTemplateElement){const a=e.content.cloneNode(!0),l=document.createElement("div");l.appendChild(a),t=t.toString(),t=t.replace(/'/gi,"\\'"),t=t.replace(/"/gi,'\\"'),n=l.innerHTML.replace(/{{value}}/gi,t),n.indexOf("{{value=")>=0&&(t?(n=n.substring(0,n.indexOf("{{value="))+t+n.substring(n.indexOf("}")),n=n.replace(/}/gi,""),n=n.replace(/{/gi,"")):(n=n.replace(/{{value=/gi,""),n=n.replace(/}}/gi,""))),d.innerHTML=n}}else a&&"string"==typeof a&&(n=a.replace(/{{value}}/gi,c),d.innerHTML=n)}const u=l.selection?1:0;for(let e=0;e<l.columns.length;e++){const t=document.createElement("td"),a=l.columns[e];a.visible&&(t.setAttribute("data-field",a.dataField),t.setAttribute("aria-colindex",e+1+u),t.classList.add("jqx-hidden"),n.appendChild(t))}return a||t.appendChild(n),n}_getLeafCount(e){let t=0;return function e(a){for(const l of a)l.leaf?t++:l.children&&l.children.length>0&&e(l.children)}(e.children),t}_isCollapsed(e){let t=e.parent;for(;t;){if(!t.expanded)return!0;t=t.parent}return!1}_areChildrenFiltered(e){if(!e.leaf){if(0===e.children.length&&this.dataSource.virtualDataSource)return!0;for(let t=0;t<e.children.length;t++)if(!1!==e.children[t].$.filtered)return!0;return!1}}_applyRowDetailTemplate(e){const t=this,a=t.dataSource.dataFields;let l=t.rowDetailTemplate;for(let i=0;i<a.length;i++){const n=a[i].name,r=new RegExp(`{{${n}}}`,"g");let o=t.columnByDataField[n]||{dataField:n};if(r.test(l)){let a=t._formatCellValue(e,o,document.createElement("td"));"string"!=typeof a&&(a=e.data[o.dataField]),l=l.replace(r,a)}}return l}_handleFrozenColumnPositions(){const e=this,t=e.rightToLeft,a=e._columns.filter((e=>e.visible));let l=[],i=[],n=0;function r(t,l,i,r,o){const s=a[l-n],d=[s.headerCellElement];for(const e of s.thHierarchy)e.includes[0].dataField===s.dataField&&d.push(e);Array.from(e.$.tableContainer.querySelectorAll(`td:nth-child(${l+1})`)).concat(d).forEach((e=>{e.style[t]=i+"px",o&&(e.style.zIndex=2+r)}))}e.selection&&(t?i.push(0):l.push(0),n=1);for(let e=0+n;e<a.length+n;e++){const r=a[e-n];r.freeze&&(!t&&"far"===r.freeze||t&&"far"!==r.freeze?i.push(e):l.push(e))}if(l.length<2&&i.length<2)return;const o=[];e.selection&&o.push(40);for(const e of a){let t=e.width;t||(t=e.headerCellElement.offsetWidth),e.minWidth&&(t=Math.max(e.minWidth,t)),o.push(t)}if(t){for(let e=0;e<l.length-1;e++){const t=l[e];let a=0;for(let e=t+1;e<o.length;e++)-1!==l.indexOf(e)&&(a+=o[e]);r("left",t,a,e,!0)}for(let e=1;e<i.length;e++){const t=i[e];let a=0;for(let e=0;e<t;e++)-1!==i.indexOf(e)&&(a+=o[e]);r("right",t,a,e,!1)}}else{for(let e=1;e<l.length;e++){const t=l[e];let a=0;for(let e=0;e<t;e++)-1!==l.indexOf(e)&&(a+=o[e]);r("left",t,a,e,!1)}for(let e=0;e<i.length-1;e++){const t=i[e];let a=0;for(let e=t+1;e<o.length;e++)-1!==i.indexOf(e)&&(a+=o[e]);r("right",t,a,e,!0)}}}_formatCellValue(e,t,a,l){const i=this;let n=e&&e.data?e.data.$.id:e;if(void 0===l&&(l=e.data[t.dataField]),"string"==typeof l&&(l.indexOf(">")>=0||l.indexOf("<")>=0)&&l.replace&&("all"===i.dataSourceSettings.sanitizeHTML?l=l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===i.dataSourceSettings.sanitizeHTML&&(l=window.JQX.Utilities.Core.sanitizeHTML(l))),i._cellsWithFormulas){const e=t.dataField+":"+n;if("string"==typeof l&&/=.+/.test(l)){const t=i._formulaParser;i._cellsWithFormulas[e]=!0,t&&(l=t.parse(l.slice(1)))}else delete i._cellsWithFormulas[e]}if(t.formatFunction){const i={value:l,row:n,column:t.dataField,data:e.data,cell:a,template:null};if(t.formatFunction(i),l=i.value,i.template instanceof HTMLElement)return i.template;if(null===i.template||"string"!=typeof i.template)return l;const r=i.template;let o="";if(r.startsWith("#")){const e=document.querySelector(r);if(e&&e instanceof HTMLTemplateElement){const t=e.content.cloneNode(!0),a=document.createElement("div");return a.appendChild(t),l=(l=(l=l.toString()).replace(/'/gi,"\\'")).replace(/"/gi,'\\"'),o=a.innerHTML.replace(/{{value}}/gi,l),o.indexOf("{{value=")>=0&&(l?(o=o.substring(0,o.indexOf("{{value="))+l+o.substring(o.indexOf("}")),o=o.replace(/}/gi,""),o=o.replace(/{/gi,"")):(o=o.replace(/{{value=/gi,""),o=o.replace(/}}/gi,""))),o}}return o='<div class="jqx-table-cell-template">'+r.replace(/{{value}}/gi,l)+"</div>",o}return"date"===t.dataType&&l instanceof Date?l.toLocaleDateString():l}_setCellContent(e,t,a){if(t instanceof HTMLElement==1){for(;e.childNodes.length>0;)e.childNodes[0].remove();if(a){const a=document.createElement("div");a.innerHTML='<div class="hierarchy-arrow jqx-arrow jqx-arrow-down" role="button" aria-label="Toggle row"></div><div></div>',a.children[1].appendChild(t),e.appendChild(a)}else e.appendChild(t)}else if(a)e.innerHTML=t=`<div>\n <div class="hierarchy-arrow jqx-arrow jqx-arrow-down" role="button" aria-label="Toggle row"></div>\n <div>${t}</div>\n </div>`,e._content=t;else if("string"==typeof t&&t.indexOf(">")>=0)if(/<.+?>/.test(t)||/&\S+;/.test(t)){if(e._content===t)return;e.innerHTML=t,e._content=t}else e.textContent!==t&&(e.textContent=t);else"html"===this.dataSourceSettings.sanitizeHTMLRender?e.innerHTML!==t&&("string"==typeof t&&t.indexOf(" ")>=0&&(t=t.replaceAll(" ","&nbsp;")),void 0===t&&(t=""),e.innerHTML=t):e.textContent!==t&&(e.textContent=t)}_dataBind(e){const t=this;if(t._cellsWithFormulas={},t._templateTags=[],t.dataSource){if(t.dataSource instanceof JQX.DataAdapter==0){const e=t.dataSource;if(Array.isArray(e)){const a=t.columns;let l;if(e.length>0){const t=e[0];l=[];for(let e in t){const a=t[e];"number"==typeof a?l.push({name:e,dataType:"number"}):"boolean"==typeof a?l.push({name:e,dataType:"boolean"}):a instanceof Date?l.push({name:e,dataType:"date"}):a instanceof Object?l.push({name:e,dataType:"any"}):l.push({name:e,dataType:"string"})}}a&&a.length>0&&(l=l||[],a.forEach((e=>{if(e.dataType){const t=l.find((t=>t.name===e.dataField));t?t.dataType=e.dataType:e.map?l.find((t=>e.map.indexOf(t.name)>=0?t:null))&&l.push({name:e.dataField,map:e.map,dataType:e.dataType}):l.push({name:e.dataField,dataType:e.dataType})}}))),t.dataSourceSettings.dataFields&&t.dataSourceSettings.dataFields.length>0?t.dataSource=new JQX.DataAdapter({dataSource:t.dataSource,dataSourceType:t.dataSourceSettings.dataSourceType,dataFields:t.dataSourceSettings.dataFields,keyDataField:t.dataSourceSettings.keyDataField,parentDataField:t.dataSourceSettings.parentDataField,childrenDataField:t.dataSourceSettings.childrenDataField,groupBy:t.dataSourceSettings.groupBy,mapChar:t.dataSourceSettings.mapChar,root:t.dataSourceSettings.root,record:t.dataSourceSettings.record,autoGenerateColumns:t.autoGenerateColumns,id:t.dataSourceSettings.id||t.dataRowId,expandHierarchy:t.expandHierarchy,virtualDataSource:t.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:t.dataSourceSettings.virtualDataSourceOnExpand}):t.dataSource=new JQX.DataAdapter({dataSource:t.dataSource,dataFields:l,id:t.dataRowId||t.dataSourceSettings.id,dataSourceType:t.dataSourceSettings.dataSourceType,keyDataField:t.dataSourceSettings.keyDataField,parentDataField:t.dataSourceSettings.parentDataField,childrenDataField:t.dataSourceSettings.childrenDataField,groupBy:t.dataSourceSettings.groupBy,mapChar:t.dataSourceSettings.mapChar,root:t.dataSourceSettings.root,record:t.dataSourceSettings.record,autoGenerateColumns:t.autoGenerateColumns,expandHierarchy:t.expandHierarchy,virtualDataSource:t.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:t.dataSourceSettings.virtualDataSourceOnExpand})}else t.dataSource=new JQX.DataAdapter({dataSource:[],id:t.dataRowId,expandHierarchy:t.expandHierarchy})}}else{if(t.dataFields=[],!t.columns||Array.isArray(t.columns)&&0===t.columns.length){t.columns=[];const e=t.querySelectorAll("th");for(let a=0;a<e.length;a++){const l=e[a].innerHTML.trim();let i={label:l,dataField:l,dataType:"string"};t.columns.push(i),t.dataFields.push(l)}}else for(let e=0;e<t.columns.length;e++){const a=t.columns[e];"string"==typeof a?t.dataFields.push(a):"object"==typeof a&&t.dataFields.push(a.dataField+(a.dataType?": "+a.dataType:""))}let e=[];if(!t.rows){const a=t.querySelectorAll("tr");for(let l=0;l<a.length;l++){const i={},n=a[l].querySelectorAll("td");if(n.length>0){for(let e=0;e<t.columns.length;e++){const a=t.columns[e];i[a.dataField]=n[e].innerHTML.trim(),i[a.dataField].indexOf("<")>=0&&t._templateTags.push({index:l,dataField:a.dataField,td:n[e]})}e.push(i)}}t.dataSource=new JQX.DataAdapter({dataSource:e,expandHierarchy:t.expandHierarchy,dataFields:t.dataFields,id:t.dataRowId})}const a=t.$.container.querySelectorAll("table");a.length>1&&a[a.length-1].parentNode.removeChild(a[a.length-1])}t.dataSource.expandHierarchy=t.expandHierarchy,t._transformDataSource(),t._applyInitialConditionalFormatting(t.dataSource),t._initColumns(e),t._initRows(),t.dataSource.notify((function(e){if(t.dataSource._updating)return void delete t.dataSource._updating;if(t._editing)return;const a=e.data,l=t._selectedIds.slice(0);let i=e.action;switch(t.rows.canNotify=!1,e.action){case"add":if(a.length)for(let e=0;e<a.length;e++)t._addNewRow(a[e],t.dataSource.length-a.length+e);else t._addNewRow(a,t.dataSource.length-1);break;case"update":if(a.length)for(let l=0;l<a.length;l++){const i=e.index[l];t.rows[i].data=a[l]}break;case"insert":t._addNewRow(a,e.index);for(let e=0;e<t.rows.length;e++)t.rows[e].dataIndex=e;break;case"remove":case"removeLast":i="remove",function(e){const a=e.$.id,l=t._selectedIds.indexOf(a);delete t.rowById[a],t.rows.splice(e.$.index,1),-1!==l&&t._selectedIds.splice(l,1)}(a);break;case"bindingComplete":if(t.filtering&&t.filterRow){const e=t._filterInfo;e.inputFilters?t._filterByAll(e.query):e.rowFilters?t._applyRowFilters():e.appliedFilters&&t._refreshFilters()}}t.rows.canNotify=!0,this.refreshHierarchy(),t._fullRefresh(void 0,l,i)})),t.refresh(),t.dataSource.virtualDataSource&&(t.paging=!0,t._requestVirtualDataSource("dataBind")),t.$.tableContainer.setAttribute("aria-rowcount",t.dataSource.length)}_requestVirtualDataSource(e,t,a=null){const l=this,i=l.pageSize,n=Math.max(l.pageIndex*i,0),r=n+i,o=[],s=[],d={};let c=null;if(l.dataSource._updating=!0,l._sortColumns&&(l._sortColumns.forEach(((e,t)=>o[e.dataField]={sortOrder:e.direction,sortIndex:t})),o.length=l._sortColumns.length),l._filterInfo.appliedFilters){for(let e in l._filterInfo.appliedFilters)s[e]=l._filterInfo.appliedFilters[e];s.length=Object.keys(l._filterInfo.appliedFilters).length,c="and"}else{const e=l._filterInfo.inputFilters||l._filterInfo.rowFilters;e&&(e.forEach((e=>s[e[0]]=e[1])),s.length=e.length),c=l._filterInfo.inputFilters?"or":"and"}l._editing&&(d.row=l._editing.row.data),l.$.loadingIndicatorContainer.classList.remove("jqx-hidden"),l.setAttribute("loading",""),l.dataSource.onVirtualDataSourceRequested((function(i){let n=!0;-1!==["add","update","remove"].indexOf(e)&&t&&(n=t(i.result)),l.$.loadingIndicatorContainer.classList.add("jqx-hidden"),l.removeAttribute("loading"),n&&(a&&(a.expanded=!0),l._initRows(),l._refreshDataRows())}),{first:n,last:r,sorting:o,filtering:s,filterOperator:c,grouping:[],edit:d,row:a,action:e})}sortBy(e,t){const a=this,l=a.columnByDataField[e];if(l){if(!1===l.allowSort)return;e=l.dataField}if(a._sortBy({column:l,columnDataField:e,sortOrder:t,dataFields:a.dataSource.dataFields,columnByDataField:"columnByDataField"}),null===e){const e=!0===a._sortOnClick?"interaction":"programmatic";a.$.fireEvent("sort",{columns:[],sortDataFields:[],sortOrders:[],sortDataTypes:[],type:e})}}_sortBy(e){const t=this,a=e.column,l=e.columnDataField,i=e.sortOrder,n=e.dataFields,r=e.columnByDataField,o=[],s=[],d=[],c=function(e){t._addSortIconContainer(e),e.headerCellElement&&(e.headerCellElement.removeAttribute("aria-sort"),e.headerCellElement.sortIconContainerElement.classList.remove("desc"),e.headerCellElement.sortIconContainerElement.classList.remove("asc")),e.sortOrder=null},u=function(){if(t._sortColumns&&t._sortColumns.length>0)for(let e=0;e<t._sortColumns.length;e++){const a=t._sortColumns[e],l=t[r][a.dataField];c(l)}t._sortColumns=[]};if(null==a)return void(t._sortColumns&&t._sortColumns.length>0&&(u(),t._sortCallback(o,s,d),t._updateState("sorted")));if("none"===t.sortMode||!t.dataSource)return;if(i&&a.sortOrder===i)return;let f=i||"asc";null===i&&(f=null),c(a),t._sortColumns||(t._sortColumns=[]);let m="string";for(let e=0;e<n.length;e++){const t=n[e];if(t.name===l){m=t.dataType,"any"===m&&(m="number");break}}let h=!0;for(let e=0;e<t._sortColumns.length;e++){const n=t._sortColumns[e];if(n.dataField===l)if(h=!1,null===f&&(n.direction="desc"),"asc"===n.direction)n.direction="desc",f="desc";else if("desc"===n.direction){t._sortColumns.splice(e,1),c(a),f=i;break}}h&&("one"===t.sortMode&&u(),t._sortColumns.push({dataField:l,direction:f,dataType:m})),t._addSortIconContainer(a),null!==f?(a.headerCellElement&&(a.headerCellElement.sortIconContainerElement.classList.remove("asc"),a.headerCellElement.sortIconContainerElement.classList.remove("desc")),a.sortOrder=f,a.headerCellElement&&("desc"===f?(a.headerCellElement.sortIconContainerElement.classList.add("desc"),a.headerCellElement.setAttribute("aria-sort","descending")):(a.headerCellElement.sortIconContainerElement.classList.add("asc"),a.headerCellElement.setAttribute("aria-sort","ascending")))):a.headerCellElement&&(a.headerCellElement.sortIconContainerElement.classList.remove("asc"),a.headerCellElement.sortIconContainerElement.classList.remove("desc"),a.headerCellElement.removeAttribute("aria-sort"));for(let e=0;e<t._sortColumns.length;e++){const a=t._sortColumns[e],l=t[r][a.dataField];o.push(a.dataField),s.push(a.direction),d.push(a.dataType),l.headerCellElement&&l.headerCellElement.sortIconContainerElement.setAttribute("order",e+1)}if(t._sortCallback(o,s,d),t._updateState("sorted"),!t._doNotFireEvent){const e=!0===t._sortOnClick?"interaction":"programmatic";t.$.fireEvent("sort",{columns:t._sortColumns,sortDataFields:o,sortOrders:s,sortDataTypes:d,type:e})}}_addSortIconContainer(e,t,a){const l=e.headerCellElement;if(l&&!l.sortIconContainerElement){const e=document.createElement("div");e.classList.add("sort-by"),e.setAttribute("aria-hidden",!0),t&&e.classList.add(t),l.firstElementChild.appendChild(e),l.sortIconContainerElement=e,"asc"===t?l.setAttribute("aria-sort","ascending"):"desc"===t?l.setAttribute("aria-sort","descending"):l.removeAttribute("aria-sort"),void 0!==a&&e.setAttribute("order",a)}}_sortCallback(e,t,a){const l=this,i=l.dataSource;if(!i.virtualDataSource){let n=null;for(let e=0;e<l.columns.length;e++){const t=l.columns[e];t.sort&&(n||(n={}),n[t.dataField]=t.sort)}i._sort(l.dataSource.boundSource,e,t,a,l.sort,n);let r=[],o=[];if(i.groupBy&&i.groupBy.toArray&&(r=i.groupBy.toArray().slice(0)),r.length>0&&(o=l._getExpandedGroups(i.boundHierarchy)),i.refreshHierarchy(),r.length>0){const e=l._doNotFireEvent;l._doNotFireEvent=!0,l._restoreExpandedGroups(o),l._doNotFireEvent=e}}l._fullRefresh("sort")}clearSort(){this.sortBy(null)}_fullRefresh(e,t,a,l){const i=this;if(i.__updating)return;if(i.dataSource.virtualDataSource)return void i._requestVirtualDataSource(e,l);const n=i._getFractionOfMax();t||(t=i._selectedIds.slice(0)),t=JSON.stringify(t.sort()),i._initRows(),i._refreshDataRows(),i._setFractionOfMax(n),"filter"===e&&(i._updateSelectAllState(),a||(a="filter")),t!==JSON.stringify(i._selectedIds.slice(0).sort())&&("filter"!==e&&i._updateSelectAllState(),i._updateState("selected"),i.$.fireEvent("change",{type:a})),"string"==typeof e&&-1!==e.indexOf("page")&&i._fixFrozenHeaderFirefox()}_pagerChangeHandler(e){const t=this;(t.isInShadowDOM?e.composedPath()[0]:e.target)===t.$.pager&&(t.pageIndex=e.detail.index,t._fullRefresh("pageIndexChange"),t.$.fireEvent("page",{action:"pageIndexChange"}))}_pagerPageSizeChanged(e){const t=this;t.pageSize=e.detail.value,t._fullRefresh("pageSizeChange"),t.$.fireEvent("page",{action:"pageSizeChange"})}_filterInputKeyupHandler(){const e=this;clearTimeout(e._filterInputTimeout),e._filterInputTimeout=setTimeout((function(){if(e._filterInfo&&e.$.filterInput.value!==e._filterInfo.query){const t=e.context;e.context=e,e._filterByAll(e.$.filterInput.value),e.context=t}}),500)}_filterByAll(e){const t=this;if(t._filterInfo.query=e,""===e)return void t.clearFilters();const a=[];t._clearRowFilters(),delete t._filterInfo.appliedFilters,t._filterInfo.stringDataFields.forEach((t=>{const l=new JQX.Utilities.FilterGroup,i=l.createFilter("string",e,"CONTAINS");l.addFilter("or",i),a.push([t,l])})),t.dataSource.virtualDataSource||t.dataSource._filter(a,"or"),t._filterInfo.inputFilters=a,t._fullRefresh("filter"),t._updateState("filtered"),t._doNotFireEvent||t.$.fireEvent("filter",{action:"add",filters:a})}_setupPagingAndFiltering(){const e=this;e.$.pager.$.pageSizeSelector.classList.add("underlined"),e.$.pager.$.pageSizeSelector.dropDownAppendTo="body",e._filterInfo={query:""},e._applyFilterTemplate(),e.$.header.classList.toggle("jqx-hidden",(!e.filtering||e.filterRow||e.columnMenu)&&!e.conditionalFormattingButton)}_applyFilterTemplate(){const e=this,t=e.filterTemplate;if(e.$.filterTemplateContainer.innerHTML="",!t)return e.$.filterInput.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.classList.add("jqx-hidden"),void(e.filterTemplate=null);const a=document.getElementById(t);if(a&&a instanceof HTMLTemplateElement){const t=document.importNode(a.content,!0);e.$.filterInput.classList.add("jqx-hidden"),e.$.filterTemplateContainer.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.appendChild(t)}else e.filterTemplate=null,e.$.filterInput.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.classList.add("jqx-hidden")}_refreshFilters(e){const t=this,a=[];for(let e in t._filterInfo.appliedFilters){let l=t._filterInfo.appliedFilters[e];a.push([e,l])}0!==a.length?(t._clearFilterInput(),t._clearRowFilters(),t.dataSource.virtualDataSource||t.dataSource._filter(a,t.filterOperator),t._fullRefresh("filter"),t._updateState("filtered"),e&&!t._doNotFireEvent&&t.$.fireEvent("filter",{action:e,filters:a})):t.clearFilters()}_localize(){const e=this,t=e.$.pager;t.messages[e.locale]||(t.messages[e.locale]={}),t.messages[e.locale].pageSizeLabel=e.localize("itemsPerPage"),t.messages[e.locale].summaryPrefix=e.localize("summaryPrefix"),t.messages[e.locale].summarySuffix="",t.$.firstButton.setAttribute("tooltip",e.localize("firstButton")),t.$.previousButton.setAttribute("tooltip",e.localize("previousButton")),t.$.nextButton.setAttribute("tooltip",e.localize("nextButton")),t.$.lastButton.setAttribute("tooltip",e.localize("lastButton")),e.$.filterInput.placeholder=e.localize("filterPlaceholder"),e.$.conditionalFormattingButton.setAttribute("tooltip",e.localize("conditionalFormatting")),e._filterInfo.stringConditions=[{value:"EMPTY",label:e.localize("EMPTY")},{value:"NOT_EMPTY",label:e.localize("NOT_EMPTY")},{value:"CONTAINS",label:e.localize("CONTAINS")},{value:"CONTAINS_CASE_SENSITIVE",label:e.localize("CONTAINS_CASE_SENSITIVE")},{value:"DOES_NOT_CONTAIN",label:e.localize("DOES_NOT_CONTAIN")},{value:"DOES_NOT_CONTAIN_CASE_SENSITIVE",label:e.localize("DOES_NOT_CONTAIN_CASE_SENSITIVE")},{value:"STARTS_WITH",label:e.localize("STARTS_WITH")},{value:"STARTS_WITH_CASE_SENSITIVE",label:e.localize("STARTS_WITH_CASE_SENSITIVE")},{value:"ENDS_WITH",label:e.localize("ENDS_WITH")},{value:"ENDS_WITH_CASE_SENSITIVE",label:e.localize("ENDS_WITH_CASE_SENSITIVE")},{value:"EQUAL",label:e.localize("EQUAL")},{value:"EQUAL_CASE_SENSITIVE",label:e.localize("EQUAL_CASE_SENSITIVE")},{value:"NULL",label:e.localize("NULL")},{value:"NOT_NULL",label:e.localize("NOT_NULL")}],e._filterInfo.numberAndDateConditions=[{value:"EQUAL",label:e.localize("EQUAL")},{value:"NOT_EQUAL",label:e.localize("NOT_EQUAL")},{value:"LESS_THAN",label:e.localize("LESS_THAN")},{value:"LESS_THAN_OR_EQUAL",label:e.localize("LESS_THAN_OR_EQUAL")},{value:"GREATER_THAN",label:e.localize("GREATER_THAN")},{value:"GREATER_THAN_OR_EQUAL",label:e.localize("GREATER_THAN_OR_EQUAL")},{value:"NULL",label:e.localize("NULL")},{value:"NOT_NULL",label:e.localize("NOT_NULL")}]}_createFilterRow(e){const t=this;if(!t.filtering||!t.filterRow)return;if(e)return void t.$.tableContainer.children[1].insertBefore(e,t.$.tableContainer.children[1].firstElementChild);const a=document.createElement("tr"),l=t._columns.filter((e=>e.visible));let i="";a.className="jqx-table-filter-row",t.selection&&(i+='<td style="left: 0px; z-index: 99; position: sticky; background: var(--jqx-background);"></td>');for(let e=0;e<l.length;e++){const a=l[e];i+=t._createFilterRowInput(a)}a.innerHTML=i,t.$.tableContainer.children[1].insertBefore(a,t.$.tableContainer.children[1].firstElementChild)}_createFilterRowInput(e){const t=this,a=` animation="${t.animation}" `,l=t.rightToLeft?" right-to-left":"",i=[];let n,r,o,s;return"string"===e.dataType?(n=t._filterInfo.stringConditions,r="string",o="string-filter",s=t.localize("CONTAINS")):(n=t._filterInfo.numberAndDateConditions,r=e.dataType,o="num-date-filter",s=t.localize("EQUAL")),e.freeze&&i.push("freeze-"+("far"===e.freeze?"far":"near")),e.responsivePriority&&i.push("priority-"+e.responsivePriority),!1===e.allowFilter&&i.push("no-filter"),`<td${i.length?' class="'+i.join(" ")+'"':""} filter-for="${e.dataField}">\n <div>\n <input type="${r}" class="filter-value" aria-label="Filter value" />\n <jqx-input class="${o}${a}data-source='${JSON.stringify(n)}' drop-down-button-position="right" drop-down-width="auto" readonly${l} value="${s}" title="${t.localize("filterCondition")}" aria-label="Filter condition"></jqx-input>\n <jqx-button class="jqx-hidden" title="${t.localize("clearFilter")}"${a}${l} aria-label="Clear filter"></jqx-button>\n </div>\n </td>`}_tableContainerChangeHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target;a.classList.contains("filter-value")&&("date"===a.type||a instanceof JQX.Input&&(""!==a.previousElementSibling.value||-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(e.detail.value)))&&t._applyRowFilters(),(a.classList.contains("string-filter")||a.classList.contains("num-date-filter"))&&a instanceof JQX.Input&&(""!==a.previousElementSibling.value||-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(e.detail.value))&&t._applyRowFilters()}_tableContainerClickHandler(e){const t=this;if(t._editing)return;const a=t.isInShadowDOM?e.composedPath()[0]:e.target;if(!t.$.tableContainer.contains(a))return;const l=a.closest("tbody tr[row-id], tfoot tr.grand-total");if(l){t.closeColumnMenu();const i=a.closest("td");if(a.classList.contains("hierarchy-arrow")){const e=t.animation;return t.virtualization&&(t._animation="none"),t._hierarchyArrowClickHandler(l,i),void(t.virtualization&&(t._animation=e))}const n=l.getAttribute("row-id");let r;n&&(r=t.rowById?t.rowById[n].data:t.rows.dataItemById[n]);const o=r?r.$.id:void 0,s=i?i.getAttribute("data-field"):void 0;if(!r&&l.classList.contains("grand-total")&&(r=l.data),void 0!==s){const a={};for(let e=0;e<t.columns.length;e++){const l=t.columns[e];a[l.dataField]=r[l.dataField]}t.$.fireEvent("cellClick",{id:n,row:a,dataField:s,value:r[s],originalEvent:e})}if(t._toggleSelection(l,r,e,a),t.editing||t.drillDown){if(!s||i.classList.contains("no-edit"))return;clearTimeout(t._dblclickObject.timeout),t._dblclickObject.numberOfClicks++,2===t._dblclickObject.numberOfClicks?(t._dblclickObject.numberOfClicks=0,t._beginEdit({rowElement:l,cell:i,dataField:s})):t._dblclickObject.timeout=setTimeout((function(){t._dblclickObject.numberOfClicks=0}),300)}return void(t.rowDetailTemplate&&t._toggleRowDetail(l,o))}const i=a.closest(".jqx-table-select-all");if(i){if("one"===t.selectionMode)return;return void t._selectAllCheckboxClickHandler(i)}const n=a.closest(".jqx-table-filter-row jqx-button")||a.closest(".jqx-table-column-menu jqx-button");if(n){const e=n.parentElement.firstElementChild,a=n.parentElement.children[1];return e.value="",-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(a.$.input.dataValue)&&(a.value=t.localize("text"===e.type?"CONTAINS":"EQUAL"),delete a.$.input.dataValue),void t._applyRowFilters()}}_toggleSelection(e,t,a,l){const i=this;if(!i.selection||"cell"===i.selectionMode||e.classList.contains("disable-select")||e.classList.contains("grand-total"))return;function n(){i._selectedIds=[],Array.from(i.$.tableContainer.querySelectorAll(".jqx-table-select-row.selected")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)}))}const r=t.$.id;let o=-1!==i._selectedIds.indexOf(r);if(i._interaction=!0,"one"===i.selectionMode){if(o)return;n(),i.select(r)}if("many"===i.selectionMode)if(o)i.unselect(r);else{if(i._disabledSelection.length>0&&t.children&&t.children.length>0){let e=0,a=0,l=[];if(t.children.forEach((t=>{const n=t.$.id;-1===i._selectedIds.indexOf(n)?e++:l.push(n),-1!==i._disabledSelection.indexOf(n)&&a++})),e===a)return i.unselect(l),void delete i._interaction}i.select(r),i._selectionStart={data:t,element:e}}else{if(i._selectionStart&&a.shiftKey){let t,a,l;if(i.virtualization?(t=i.rows,a=t.findIndex((e=>e.data.$.id===r)),l=t.findIndex((e=>e.data.$.id===i._selectionStart.data.$.id))):(t=Array.from(i.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])")),a=t.indexOf(e),l=t.indexOf(i._selectionStart.element)),a!==l){const e=JSON.stringify(i._selectedIds.slice(0).sort()),r=Math.min(a,l),o=Math.max(a,l);n();const s=[];for(let e=r;e<=o;e++){const a=t[e];s.push(a.data.$.id)}return i._changeSelectionOfMultiple(s,"select","interaction",e),getSelection().removeAllRanges(),void delete i._interaction}if(1===i._selectedIds.length)return void delete i._interaction}const s=!!l&&(l.classList.contains("selection-checkbox")||l.classList.contains("jqx-table-select-row"));let d=!1;if(1===i._selectedIds.length)d=!0;else if(i.hasAttribute("hierarchy")&&i.selectionByHierarchy){const e=[];!function e(t,a){const l=t.$.id;-1!==i._selectedIds.indexOf(l)&&a.push(l),t.children&&t.children.forEach((t=>e(t,a)))}(t,e),i._selectedIds.length===e.length&&(d=!0),t&&t.leaf&&(d=!0),o=i._getChildCheckState(t).maxSelected}else i.hasAttribute("hierarchy")&&!i.selectionByHierarchy&&(d=!0);if(o&&(s||d||a.ctrlKey||a.metaKey))return delete i._selectionStart,i.unselect(r),void delete i._interaction;s||a.ctrlKey||a.metaKey||n(),i.select(r),i._selectionStart={data:t,element:e}}delete i._interaction}_selectAllCheckboxClickHandler(e,t){const a=this;if(void 0===t){const l=a._filterInfo;if(l.inputFilters||l.rowFilters||l.appliedFilters)return void a._selectAllCheckboxClickHandlerFiltering(e);if(t=a.dataSource,a.hasAttribute("hierarchy")&&a._disabledSelection.length>0){const e=t.boundHierarchy,l=a._getChildCheckState({children:e}).maxSelected;return void a._changeSelectionOfMultiple(e.map((e=>e.$.id)),l?"unselect":"select","interaction")}}const l=t.length,i=a._selectedIds.length===l-a._disabledSelection.length+a._selectableGroupRecords.length,n=a._selectedIds.slice(0);if(a._selectedIds=[],i)a._updateCSSOnUnselectAll(e);else{let i,n=0;for(let e=0;e<l;e++){const l=t[e].$.id;-1===a._disabledSelection.indexOf(l)&&(a._selectedIds.push(l),n++)}n===l?i=!0:0===n&&(i=!1),a._updateCSSOnSelectAll(e,i),a._selectableGroupRecords.length>0&&(a._selectedIds=a._selectedIds.concat(a._selectableGroupRecords))}n.length!==a._selectedIds.length&&(a._updateState("selected"),a.$.fireEvent("change",{type:"interaction"}))}_selectAllCheckboxClickHandlerFiltering(e){const t=this,a=t.dataSource,l=t._selectedIds.slice(0),i=[],n=[];let r=0;for(let e=0;e<a.length;e++){const o=a[e];if(!1===o.$.filtered)continue;const s=o.$.id;r++,-1!==l.indexOf(s)&&i.push(s),-1===t._disabledSelection.indexOf(s)&&n.push(s)}const o=i.length===n.length;if(t._selectedIds=t._selectedIds.filter((e=>-1===n.indexOf(e))),o)t._updateCSSOnUnselectAll(e);else{let a;t._selectedIds=t._selectedIds.concat(n),n.length===r?a=!0:0===n.length&&(a=!1),t._updateCSSOnSelectAll(e,a)}l.length!==t._selectedIds.length&&(t._updateState("selected"),t.$.fireEvent("change",{type:"interaction"}))}_updateCSSOnUnselectAll(e){e.classList.remove("indeterminate","selected"),e.firstElementChild.setAttribute("aria-checked",!1),Array.from(this.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)}))}_updateCSSOnSelectAll(e,t){t?(e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0)):!1===t?(e.classList.remove("indeterminate","selected"),e.firstElementChild.setAttribute("aria-checked",!1)):(e.classList.remove("selected"),e.classList.add("indeterminate"),e.firstElementChild.setAttribute("aria-checked","mixed")),Array.from(this.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||(e.parentElement.setAttribute("aria-selected",!0),e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0))}))}_beginEdit(e){const t=this,a=t.editMode,l=e.dataField;let i=e.rowId,n=e.rowElement,r=e.rowObject,o=e.cell,s=[],d=[];if(t.editing){n||(n=t.$.tableContainer.querySelector(`tr[row-id="${i}"]:not([unused])`)),r||(i=n.getAttribute("row-id"),r=t.rowById[i],i=r.data.$.id),"row"===a?(s=n.querySelectorAll("td[data-field]"),d=t._columns.filter((e=>e.visible)).map((e=>e.dataField)),o||(o=l?n.querySelector(`td[data-field="${l}"`):s[0])):(o||(o=n.querySelector(`td[data-field="${l}"`)),s=[o],d=[l]),t._editing={row:r,cells:[]};for(let e=0;e<d.length;e++){const a=s[e];let l=d[e];const n=t.columnByDataField[l];if(!1===n.allowEdit)continue;n.transform&&(l=n.originalDataField);const c=r.data[l],u=t._initEditor(n,i,l,c);let f=u instanceof HTMLInputElement&&"date"===u.type;if(n.editor&&n.editor.template)n.editor.onRender&&n.editor.onRender(i,l,u,c);else if(f)if(c instanceof Date&&!isNaN(c.getTime())){const e=(c.getMonth()+1).toString(),t=c.getDate().toString();u.value=`${c.getFullYear()}-${"0".repeat(2-e.length)}${e}-${"0".repeat(2-t.length)}${t}`}else u.value="";else u.value=void 0===c?"":c;a.classList.add("editing"),a.innerHTML="",a.appendChild(u),a===o&&u.focus&&(u.focus(),n.editor&&n.editor.template||f||!u.select||u.select()),t._editing.cells.push({dataField:l,editor:u,element:a}),t.$.fireEvent("cellBeginEdit",{id:r.data.$.id,row:r.data,value:r.data[l],dataField:l})}"row"===a&&t.$.fireEvent("rowBeginEdit",{id:r.data.$.id,row:r.data})}}_initEditor(e,t,a,l){let i=this._editors[a];if(i)return i;if(e.editor&&e.editor.template){const n=document.createElement("div");return n.innerHTML=e.editor.template,i=n.firstElementChild,i.className="jqx-table-editor",e.editor.onInit&&e.editor.onInit(t,a,i,l),i}return i=document.createElement("input"),i.className="jqx-table-editor standard","number"===e.dataType?i.type="number":"date"===e.dataType?i.type="date":i.type="text",this._editors[a]=i,i}_toggleRowDetail(e,t){const a=this;if(a.virtualization)return void a._toggleRowDetailVirtualization(e,t);const l=e.nextElementSibling;l.classList.toggle("collapsed"),l.classList.contains("collapsed")?(l.setAttribute("aria-hidden",!0),a._expandedRowDetailIds=a._expandedRowDetailIds.filter((e=>e!==t))):(l.removeAttribute("aria-hidden"),a._expandedRowDetailIds.push(t))}_toggleRowDetailVirtualization(e,t){const a=this;let l=e.nextElementSibling;function i(){let e=a.$.virtualizationContainer.$.verticalScrollBar,t=a.$.virtualizationContainer.$.verticalScrollBar.value;a._ignoreVerticalChange=!0,a._refreshDataRows(),t=Math.min(e.max,t),e.value=t,delete a._ignoreVerticalChange,a._onVerticalChange({detail:{value:t}},!0)}if(l&&l.classList.contains("jqx-table-row-detail")&&!l.classList.contains("collapsed"))return l.setAttribute("aria-hidden",!0),a._expandedRowDetailIds=a._expandedRowDetailIds.filter((e=>e!==t)),l.classList.add("collapsed"),l.remove(),void i();const n=e.data;l=document.createElement("tr"),l.classList.add("collapsed"),a._createRowDetailOnDemand(l,{data:n},n),e.parentElement.insertBefore(l,e.nextElementSibling),a._expandedRowDetailIds.push(t),l.classList.remove("collapsed"),i()}_setFocusable(){const e=this,t="jqx-table"===e.nodeName.toLowerCase();if(!e.keyboardNavigation||e.disabled||e.unfocusable||e.hasAttribute("modal"))return e.$.tableContainer.removeAttribute("tabindex"),t&&(e.$.filterInput.unfocusable=!0,e.$.pager.unfocusable=!0),void(e.$.conditionalFormattingButton.unfocusable=!0);const a=e.$.tableContainer.getAttribute("tabindex");(null===a||a<0)&&e.$.tableContainer.setAttribute("tabindex",0),t&&(e.$.filterInput.unfocusable=!1,e.$.pager.unfocusable=!1),e.$.conditionalFormattingButton.unfocusable=!1}_tableContainerFocusHandler(){const e=this;e._focusedCell&&e.$.tableContainer.contains(e._focusedCell)||e._focusCell(e.$.tableContainer.children[1].querySelector("tr:not([unused]) td[data-field], tr:not([unused]) td.group-header"))}_tableContainerDownHandler(e){const t=this.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;this._focusCell(t.closest("td[data-field], td.group-header")),e.stopPropagation()}_focusCell(e,t){const a=this;if(!e||!e.hasAttribute("data-field")&&!e.classList.contains("group-header")||e.parentElement.classList.contains("grand-total"))return!1;if(a._focusedCell){if(a._focusedCell===e)return!1;a._focusedCell.removeAttribute("focus")}if(a._focusedCell=e,e.setAttribute("focus",""),!t)return;const l=a.$.tableContainer.parentElement,i=a.$.header.offsetHeight,n=a.freezeHeader?a.$.tableContainer.firstElementChild.offsetHeight:0,r=l.scrollTop;let o=e.offsetTop-i-n;if(o<r)l.scrollTop=o;else{const t=a.footerRow&&a.freezeFooter?a.$.tableContainer.lastElementChild.offsetHeight:0,s=a.$.pager.offsetHeight,d=l.clientHeight-(i+n+t+s);o+=e.offsetHeight,o>r+d&&(l.scrollTop=o-d)}if(e.classList.contains("freeze-near")||e.classList.contains("freeze-far"))return;const s=l.scrollLeft,d=a.$.tableContainer.querySelector("tr[row-id]:not([unused])");let c,u=0;if(Array.from(d.children).forEach((e=>{e.classList.contains("freeze-near")&&(u+=e.offsetWidth)})),a.rightToLeft){let t=e.previousElementSibling;for(c=0;t;)t.classList.contains("freeze-near")||(c-=t.offsetWidth),t=t.previousElementSibling;if(c>s)l.scrollLeft=c;else{const t=l.clientWidth;c-=e.offsetWidth,c<s-t&&(l.scrollLeft=c+t-u)}}else if(c=e.offsetLeft-u,c<s)l.scrollLeft=c;else{const t=l.clientWidth;c+=e.offsetWidth+u,c>s+t&&(l.scrollLeft=c-t)}}focus(){const e=this;!e.keyboardNavigation||e.disabled||e.unfocusable||e.hasAttribute("modal")||e.$.tableContainer.focus()}blur(){this.$.tableContainer.blur()}_tableContainerKeydownHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target,l=e.key;if("Shift"===l)return void("extended"===t.selectionMode&&t.$.tableContainer.classList.add("jqx-unselectable"));if(!t.contains(a))return;if(a&&"INPUT"===a.nodeName&&!t._editing)return;const i=t._focusedCell;if(!i)return;const n=t.virtualization,r=i.classList.contains("group-header");if(r&&-1!==["ArrowRight","ArrowLeft","Home","End","Escape","F2"].indexOf(l))return void e.preventDefault();if(t._editing){switch(l){case"Enter":t.endEdit();break;case"Escape":t.cancelEdit();break;default:return}return t.$.tableContainer.focus(),void e.preventDefault()}const o=i.parentElement;if(n&&o){const e=t.$.virtualizationContainer.$.verticalScrollBar,a=e.value,i=o.data.$.id;if("ArrowUp"===l&&0===a&&i===t._rowsVirtual[0].data.$.id||"ArrowDown"===l&&a===e.max&&i===t._rowsVirtual[t._rowsVirtual.length-1].data.$.id)return}let s="ArrowRight",d="ArrowLeft";switch(t.rightToLeft&&(s="ArrowLeft",d="ArrowRight"),l){case s:case d:{const a=l===s?"nextElementSibling":"previousElementSibling";let r=i[a];for(;r&&r.classList.contains("jqx-hidden");)r=r[a];t._focusCell(r,!n,e),t._scrollToVirtualization(l===s?"nextArrow":"prevArrow",r);break}case"ArrowUp":case"ArrowDown":{const a="ArrowUp"===l?"previousElementSibling":"nextElementSibling";let s=o[a];for(;s&&(s.classList.contains("jqx-table-row-detail")||s.classList.contains("collapsed"));)s=s[a];s&&(r?t._focusCell(s.querySelector("td[data-field], .group-header"),!n,e):t._focusCell(s.querySelector(`td[data-field="${i.getAttribute("data-field")}"], .group-header`),!n,e),t._scrollToVirtualization(l,s));break}case"Home":t._focusCell(o.querySelector("td[data-field]"),!n,e),t._scrollToVirtualization(l);break;case"End":{const a=o.querySelectorAll("td[data-field]");let i=a.length-1,r=a[i];for(;r.classList.contains("jqx-hidden");)i--,r=a[i];t._focusCell(r,!n,e),t._scrollToVirtualization(l);break}case"PageDown":t._pageDownHandler(i,e);break;case"PageUp":t._pageUpHandler(i,e);break;case"Enter":{const a=o.data;t.dataSource.boundHierarchy&&t._areChildrenFiltered(a)?t._hierarchyArrowClickHandler(o,i,e):t.rowDetailTemplate&&t._toggleRowDetail(o,a.$.id);break}case" ":t._toggleSelection(o,o.data,e);break;case"F2":t.beginEdit(o.data.$.id,i.getAttribute("data-field"));break;default:return}if(e.preventDefault(),t.onKeyboardScroll){const e=n?t.$.virtualizationContainer:t.$.container;t.onKeyboardScroll(l,e.scrollTop,e.scrollLeft)}}_pageDownHandler(e,t){const a=this,l=a.paging;if(!l&&e.parentElement===e.parentElement.parentElement.lastElementChild)return;const i=a.virtualization,n=a.$.tableContainer,r=n.parentElement,o=i?a.$.virtualizationContainer:r;let s=e.getAttribute("data-field");function d(){const e=n.querySelectorAll("tr[row-id]:not([unused])");let t=i?0:a.$.header.offsetHeight+a.$.pager.offsetHeight;a.footerRow&&a.freezeFooter&&(t+=n.lastElementChild.offsetHeight);for(let a=e.length-1;a>=0;a--){const l=e[a];if(!l.classList.contains("collapsed")&&l.offsetTop+l.offsetHeight<=(i?-r.offsetTop:r.scrollTop)+o.clientHeight-t)return l.querySelector(`td[data-field${s}], .group-header`)}}s=s?`="${s}"`:"";let c=d();if(c)if(e===c){const u=(a.freezeHeader?n.firstElementChild.offsetHeight:0)+a._rowHeight;let f;if(i?(f=o.$.verticalScrollBar.value,o.$.verticalScrollBar.value+=o.clientHeight-u):r.scrollTop+=r.clientHeight-u,c=d(),l&&(i&&f===o.$.verticalScrollBar.value||!i&&e===c)){const e=a.pageIndex;a.navigateTo(a.pageIndex+1),a.pageIndex!==e&&(i&&(o.$.verticalScrollBar.value=0),a._focusCell(n.querySelector(`tr[row-id]:not([unused]) td[data-field${s}], tr[row-id]:not([unused]) .group-header`),!i,t))}else a._focusCell(c,void 0,t)}else a._focusCell(c,void 0,t)}_pageUpHandler(e,t){const a=this,l=a.virtualization,i=a.$.tableContainer,n=i.parentElement,r=l?a.$.virtualizationContainer:n;let o=e.getAttribute("data-field");function s(){const e=i.querySelectorAll("tr[row-id]:not([unused])");let t=0;a.freezeHeader&&(t=i.firstElementChild.offsetHeight);for(let a=0;a<e.length;a++){const i=e[a];if(!i.classList.contains("collapsed")&&i.offsetTop>=(l?-n.offsetTop:n.scrollTop)+t)return i.querySelector(`td[data-field${o}], .group-header`)}}o=o?`="${o}"`:"";let d=s();if(d)if(e===d){const c=(a.freezeHeader?i.firstElementChild.offsetHeight:0)+a._rowHeight;let u;if(l?(u=r.$.verticalScrollBar.value,r.$.verticalScrollBar.value-=r.clientHeight-c):n.scrollTop-=n.clientHeight-c,d=s(),a.paging&&(l&&u===r.$.verticalScrollBar.value||!l&&e===d)){const e=a.pageIndex;if(a.navigateTo(a.pageIndex-1),a.pageIndex!==e){l&&(r.$.verticalScrollBar.value=r.$.verticalScrollBar.max);const e=i.querySelectorAll(`tr[row-id]:not([aria-hidden="true"]) td[data-field${o}], tr[row-id]:not([aria-hidden="true"]) .group-header`);a._focusCell(e[e.length-1],!l,t)}}else a._focusCell(d,void 0,t)}else a._focusCell(d,void 0,t)}_tableContainerKeyupHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target;if("Shift"===e.key&&"extended"===t.selectionMode&&t.$.tableContainer.classList.remove("jqx-unselectable"),t.contains(a))return a.classList.contains("filter-value")&&"date"!==a.type?(clearTimeout(t._filterRowTimeout),void(t._filterRowTimeout=setTimeout((function(){const e=t.context;t.context=t,t._applyRowFilters(),t.context=e}),500))):void 0}_tableContainerPointeroverHandler(e){const t=this;if(!t.tooltip)return;const a=(t.isInShadowDOM?e.composedPath()[0]:e.target).closest("tbody td[data-field], thead th[data-field]");if(!a)return;const l=t.$.tableContainer.querySelector(".tooltip"),i=t.columnByDataField[a.getAttribute("data-field")],n=t.virtualization;if(l&&(l.classList.remove("tooltip"),l.removeAttribute("title")),"th"!==a.tagName.toLowerCase())(a.classList.contains("tree-cell")&&a.firstElementChild&&a.firstElementChild.children[1].scrollWidth>a.firstElementChild.children[1].offsetWidth||a.scrollWidth>a.offsetWidth)&&(a.classList.add("tooltip"),a.title=n&&i&&i.templateElement?"":a.innerText);else{const e=a.querySelector(".label");e&&e.scrollWidth>e.offsetWidth&&(a.classList.add("tooltip"),a.title=n&&i&&i.templateElement?"":e.innerText)}}_documentDownHandler(e){const t=this,a=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;function l(){"default"!==t.columnSizeMode&&(t._preventClickSort=!0,clearTimeout(t._dblclickObject.timeout),t._dblclickObject.numberOfClicks++,2===t._dblclickObject.numberOfClicks?(t._dblclickObject.numberOfClicks=0,t._autoResizeColumnOnDblclick()):t._dblclickObject.timeout=setTimeout((function(){t._dblclickObject.numberOfClicks=0}),300))}if(delete t._preventClickSort,t._editing&&!a.closest(".jqx-table-editor")){const e=a.closest(".jqx-drop-down")||a.closest(".jqx-input-drop-down-menu");if(!e)return void t.endEdit();const l=e.ownerElement;if(!l)return void t.endEdit();if(t.$.container.contains(l)&&l.classList.contains("jqx-table-editor"))return;return void t.endEdit()}const i=t.columnReorder,n=t.columnResize;if(i&&!t.columnTotals||n){const r=a.closest("th[data-field]:not(.jqx-pivot-table-total-header)");if(r&&t.$.tableContainer.contains(r)){if(t.$.tableContainer.classList.add("jqx-unselectable"),n&&t._columns.length>1&&!t.hasAttribute("resize-max-reached")){const a=t.rightToLeft,i=r.getBoundingClientRect();let n=null;if(!a&&e.clientX<=i.left+5||a&&e.clientX>=i.right-5){const i=r.previousElementSibling;if(i&&i.hasAttribute("data-field")){if(i.hasAttribute("locked"))return;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.headerCellElement===i){n=a;break}}const r=i.getBoundingClientRect(),o=n&&n.minWidth||t._getNumericMinWidth();return t._resizeDetails={FeedbackShown:!1,Item:i,ItemStart:r[a?"right":"left"]+window.scrollX,Min:o,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date},t._resizeDetails.Max=t._getCurrentResizeMax(),void l()}}if(!a&&e.clientX>=i.right-5||a&&e.clientX<=i.left+5){if(r.hasAttribute("locked"))return;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.headerCellElement===r){n=a;break}}const o=n&&n.minWidth||t._getNumericMinWidth();return t._resizeDetails={FeedbackShown:!1,Item:r,ItemStart:i[a?"right":"left"]+window.scrollX,Min:o,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date},t._resizeDetails.Max=t._getCurrentResizeMax(),void l()}}i&&(t._dragDetails={FeedbackShown:!1,Item:r,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date})}}}_documentMoveHandler(e){const t=this,a=t._dragDetails;if(!a)return void(t._resizeDetails&&t._handleResizeOnMove(e));if(!a.FeedbackShown){const l=(new Date).getTime()-a.StartTime.getTime()>500,i=Math.abs(a.StartPosition.left-e.pageX)>5||Math.abs(a.StartPosition.top-e.pageY)>5;if(!i||!(!t._isMobile||t._isMobile&&l))return void(t._isMobile&&i&&!l&&(delete t._dragDetails,t.$.tableContainer.classList.remove("jqx-unselectable")));t._hideBodyOverflow(),a.Feedback=t._addDragFeedback(),a.FeedbackShown=!0,a.Item.classList.add("dragged"),t.classList.add("jqx-unselectable")}const l=t.$.tableContainer.parentElement;a.Feedback.style.left=e.pageX+10+"px",a.Feedback.style.top=e.pageY+10+"px",a.HoveredItem&&(a.HoveredItem.classList.remove("drop-column","left","right"),delete a.HoveredItem),l.offsetWidth<l.scrollWidth&&(clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const a=l.getBoundingClientRect();a.left<=e.clientX&&a.left+a.width>=e.clientX?e.clientX>=a.left&&e.clientX<=a.left+25?l.scrollLeft-=t._autoScrollCoefficient:e.clientX>=a.left+a.width-25&&e.clientX<=a.left+a.width?l.scrollLeft+=t._autoScrollCoefficient:clearInterval(t._dragInterval):clearInterval(t._dragInterval)}),10));const i=t._getClosestThToHover(e);i&&(i.classList.add("drop-column"),a.HoveredItem=i)}_hideBodyOverflow(){const e=(document.scrollingElement||document.documentElement).scrollHeight>document.documentElement.clientHeight,t=(document.scrollingElement||document.documentElement).scrollWidth>document.documentElement.clientWidth;this._originalBodyOverflow={overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY,overflow:document.body.style.overflow},document.body.classList.add("jqx-dragging"),document.body.style.overflow=document.body.style.overflowX=document.body.style.overflowY="",e&&!t?document.body.style.overflowX="hidden":t&&!e?document.body.style.overflowY="hidden":t||e||(document.body.style.overflow="hidden")}_addDragFeedback(){const e=this,t=e._dragDetails.Item,a=document.createElement("div");return a.className="jqx-table-feedback",a.setAttribute("parent-table-id",e.id),a.innerHTML=e.columnByDataField[t.getAttribute("data-field")].label,e.theme&&a.setAttribute("theme",e.theme),document.body.appendChild(a),a}_getClosestThToHover(e){const t=e.clientX,a=Array.from(this.$.tableContainer.querySelectorAll("th[data-field]:not(.jqx-pivot-table-total-header)"));let l,i,n;for(let e=0;e<a.length;e++){const r=a[e];if(!r||this._dragDetails.Item===r)continue;const o=r.getBoundingClientRect(),s=Math.abs(t-o.left),d=Math.abs(t-o.right),c=Math.min(s,d);if(!(void 0===i||c<i))break;l=r,i=c,n=s<d?"left":"right"}return l&&l.classList.add(n),l}_handleResizeOnMove(e){const t=this,a=t._resizeDetails;if(!a.FeedbackShown){const l=(new Date).getTime()-a.StartTime.getTime()>500,i=Math.abs(a.StartPosition.left-e.pageX)>=1||Math.abs(a.StartPosition.top-e.pageY)>=1;if(!i||!(!t._isMobile||t._isMobile&&l))return void(t._isMobile&&i&&!l&&(delete t._resizeDetails,t.$.tableContainer.classList.remove("jqx-unselectable","resizing"),document.body.style.cursor=null));a.Feedback=t._addResizeFeedbacks(),a.FeedbackShown=!0,t.classList.add("jqx-unselectable","resizing"),document.body.style.cursor="col-resize"}const l=a.Feedback,i=a.ItemStart;let n;t.rightToLeft?(n=Math.min(a.Max,Math.max(a.Min,Math.round(i-e.pageX))),l.style.left=i-n+"px"):(n=Math.min(a.Max,Math.max(a.Min,Math.round(e.pageX-i))),l.style.left=i+n+"px"),l.classList.toggle("min",n===a.Min),l.classList.toggle("max",n===a.Max),t.columnResizeFeedback&&(l.innerHTML=n+"px"),a.Width=n}_addResizeFeedbacks(){const e=this,t=e._resizeDetails,a=e.$.container.getBoundingClientRect(),l=a.top+window.scrollY+"px",i=a.height+"px",n=document.createElement("div"),r=document.createElement("div");return r.className="jqx-table-resize-feedback static",r.setAttribute("parent-table-id",e.id),r.style.top=l,r.style.left=t.ItemStart+"px",r.style.height=i,e._resizeDetails.StaticFeedback=r,n.className="jqx-table-resize-feedback",n.setAttribute("parent-table-id",e.id),n.style.top=l,n.style.height=i,e.theme&&(r.setAttribute("theme",e.theme),n.setAttribute("theme",e.theme)),document.body.appendChild(n),document.body.appendChild(r),n}_resolveResize(e){const t=this,a=t._resizeDetails;if(delete t._resizeDetails,t.$.tableContainer.classList.remove("jqx-unselectable","resizing"),e){if(!a.FeedbackShown)return;a.StaticFeedback.remove(),a.Feedback.remove()}const l=t._columns.find((e=>e.headerCellElement===a.Item));t.classList.remove("jqx-unselectable","resizing"),document.body.style.cursor=null;let i=a.Width;i<parseInt(t.columnMinWidth)&&(i=parseInt(t.columnMinWidth));const n=t._getTableRemainingWidth();if(l){const e=l._isResponsive||!!(l.width&&l.width.toString().indexOf("%")>=0);if(delete l.width,l.minWidth&&i<l.minWidth&&(i=l.minWidth),l._manualWidth=i,l._manualPercentageWidth=parseFloat(i/n*100),l._isResponsive=e,a.Item.style.width=l._isResponsive?parseFloat(i/n*100)+"%":i+"px",l._isFillRemainingWidth){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width&&!l._manualWidth){e=!1;break}}!t.columnResizeNormalize&&e&&(t.columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1}),t._initColumns(!0),t.refresh())}}else a.Item.style.width=i+"px";t._handleAutoSizeMode(l),t._handleFrozenColumnPositions(),t._refreshHorizontalScrollbar();const r=parseFloat(i/n*100);l&&t.$.fireEvent("columnResize",{dataField:l.dataField,headerCellElement:a.Item,widthInPercentages:r,width:i})}openColumnMenu(e){const t=this,a=t.columnByDataField[e];if(!a)return;const l=a.headerCellElement;if(!l)return;if(a&&!1===a.allowMenu)return;const i=l.querySelector(".column-menu");if(!i)return;const n=()=>{const e=c.getBoundingClientRect(),a=t.activeColumnMenu;t._columnsSettingsMenu.style.top=e.top+window.scrollY+"px",t._columnsSettingsMenu.style.left=e.right+window.scrollX+"px",e.right-i.offsetWidth+window.scrollX+a.offsetWidth>t.getBoundingClientRect().right&&(t._columnsSettingsMenu.style.left=10+e.right-a.offsetWidth-t._columnsSettingsMenu.offsetWidth+window.scrollX+"px")},r=()=>{const e=a.headerCellElement;e.hasAttribute("column-menu-button")||e.setAttribute("column-menu-button","");const l=e.querySelector(".column-menu"),i=l.getBoundingClientRect();o.style.top=i.bottom+10+window.scrollY+"px",o.style.left=i.right-l.offsetWidth+window.scrollX+"px",i.right-l.offsetWidth+window.scrollX+o.offsetWidth>t.getBoundingClientRect().right&&(o.style.left=i.right-o.offsetWidth+window.scrollX+"px");const n=o.querySelector("input");n&&n.focus()};a.columnMenu&&a.columnMenu.remove(),t.closeColumnMenu();const o=document.createElement("div");o.classList.add("jqx-table-column-menu","wrapper"),o.owner=l,o.dataField=e;const s=document.createElement("div");s.innerHTML=`<span class='menu-icon sort-asc'></span><span class="label">${t.localize("columnMenuItemSortAsc")}</span>`,s.classList.add("jqx-table-menu-item");const d=document.createElement("div");d.innerHTML=`<span class='menu-icon sort-desc'></span><span class="label">${t.localize("columnMenuItemSortDesc")}</span>`,d.classList.add("jqx-table-menu-item");const c=document.createElement("div");c.innerHTML=`<span class='menu-icon columns'></span><span class="label">${t.localize("columnMenuItemColumns")}</span>`,c.classList.add("jqx-table-menu-item","columns-item");const u=document.createElement("div");u.innerHTML=`<span class='menu-icon filter-by'></span><span class="label">${t.localize("columnMenuItemFilter")}</span>`,u.classList.add("jqx-table-menu-item","filter-item");const f=document.createElement("div");f.innerHTML=`<span class='menu-icon filter-by-remove'></span><span class="label">${t.localize("columnMenuItemRemoveFilter")}</span>`,f.classList.add("jqx-table-menu-item","remove-filter-item","jqx-hidden");const m=document.createElement("div");m.innerHTML=`<span class='menu-icon sort-remove'></span><span class="label">${t.localize("columnMenuItemRemoveSort")}</span>`,m.classList.add("jqx-table-menu-item","remove-sort-item","jqx-hidden");const h=document.createElement("div");h.innerHTML=`<span class='menu-icon reset'></span><span class="label">${t.localize("columnMenuItemReset")}</span>`,h.classList.add("jqx-table-menu-item","reset-item"),c.onmouseleave=e=>{const a=t._columnsSettingsMenu.getBoundingClientRect();e.pageX>=a.left-20&&e.pageX<=a.right+20&&e.pageY>=a.top-20&&e.pageY<=a.bottom+20||t._columnsSettingsMenu&&t._columnsSettingsMenu.remove()},c.onmouseenter=()=>{t._columnsSettingsMenu=(()=>{t._columnsSettingsMenu&&t._columnsSettingsMenu.remove();const a=document.createElement("div");a.classList.add("jqx-table-column-menu","wrapper","jqx-table-columns-menu");let l=0,i=null;for(let o=0;o<t.columns.length;o++){const s=document.createElement("div");s.innerHTML=`<span class='column-item menu-icon'></span><span class="label">${t.columns[o].label}</span>`,s.classList.add("jqx-table-menu-item"),s.column=t.columns[o],e!==s.column.dataField&&!1!==s.column.allowHide&&(s.column.visible?(l++,i=s):s.firstElementChild.classList.add("off"),s.onpointerdown=e=>{s.column.visible=!s.column.visible,s.column.visible?s.firstElementChild.classList.remove("off"):s.firstElementChild.classList.add("off"),r(),n(),e.stopPropagation(),e.preventDefault()},a.appendChild(s))}return 1===l&&i&&i.classList.add("jqx-disabled"),document.body.appendChild(a),a})(),n()};const p=t._createFilterRowInput(a);if(t.filtering&&!1!==a.allowFilter)if(t.filterRow)o.insertBefore(f,o.firstElementChild);else{o.innerHTML=p,o.insertBefore(u,o.firstElementChild);const e=o.querySelector(".filter-value");e.onkeyup=a=>{"Enter"===a.key&&t.closeColumnMenu(),"Escape"===a.key&&(e.value="")},e.nextElementSibling.onchange=()=>{t._applyRowFilters()}}o.insertBefore(h,o.firstElementChild),o.insertBefore(c,o.firstElementChild),o.insertBefore(m,o.firstElementChild),!1!==a.allowSort&&"none"!==t.sortMode&&(o.insertBefore(d,o.firstElementChild),o.insertBefore(s,o.firstElementChild),a.headerCellElement.hasAttribute("aria-sort")&&(m.classList.remove("jqx-hidden"),"ascending"===a.headerCellElement.getAttribute("aria-sort")?s.classList.add("jqx-disabled"):d.classList.add("jqx-disabled")),m.onclick=()=>{t.sortBy(a.dataField,null),t.closeColumnMenu()},s.onclick=()=>{t.sortBy(a.dataField,"asc"),t.closeColumnMenu()},d.onclick=()=>{t.sortBy(a.dataField,"desc"),t.closeColumnMenu()}),h.onclick=()=>{if(t._initialState){if(t.loadState(t._initialState),t._filterInfo.filterRowValues&&delete t._filterInfo.filterRowValues,t.clearFilters(),t.filterRow){const e=t.$.tableContainer.querySelector(".jqx-table-filter-row");e&&e.remove()}t._initRows(),t.refresh()}t.closeColumnMenu()};const g=t.columns.findIndex((e=>e.dataField===a.dataField));t.appendChild(o);const _=o.lastElementChild.children[2];_&&(_.onclick=()=>{const e=_.parentElement.firstElementChild,a=_.parentElement.children[1];e.value="",-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(a.$.input.dataValue)&&(a.value=t.localize("text"===e.type?"CONTAINS":"EQUAL"),delete a.$.input.dataValue),t._applyRowFilters()});const b=t._filterInfo&&t._filterInfo.filterRowValues?t._filterInfo.filterRowValues[g]:null;if(b&&!t.filterRow){const e=o.lastElementChild,l=a.dataType,i=t._filterInfo["string"===l?"stringConditions":"numberAndDateConditions"].find((e=>e.value===b.condition));if(-1===["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(i.value))if("date"===l){const t=new Date(b.value),a=(t.getMonth()+1).toString(),l=t.getDate().toString();e.children[0].value=`${t.getFullYear()}-${"0".repeat(2-a.length)}${a}-${"0".repeat(2-l.length)}${l}`}else e.children[0].value=b.value;e.children[1].value=i.label,e.children[1].$.input.dataValue=i.value,e.children[2].classList.remove("jqx-hidden")}a.headerCellElement.hasAttribute("filter")&&f.classList.remove("jqx-hidden"),f.onclick=()=>{t.removeFilter(a.dataField),t.closeColumnMenu()},r(),a.columnMenu=t.activeColumnMenu=o,t.$.fireEvent("openColumnMenu",{dataField:e})}closeColumnMenu(){const e=this;e.activeColumnMenu&&(e.activeColumnMenu.owner.hasAttribute("column-menu-button")&&e.activeColumnMenu.owner.removeAttribute("column-menu-button"),e._columnsSettingsMenu&&e._columnsSettingsMenu.remove(),e.$.fireEvent("closeColumnMenu",{dataField:e.activeColumnMenu.dataField}),e.activeColumnMenu.remove(),delete e.activeColumnMenu)}_documentUpHandler(e){const t=this,a=t._dragDetails;if(t.activeColumnMenu){const a=e.originalEvent?e.originalEvent:e;if(a){let e=!1,l=a.target;for(;l;)if(l=l.parentNode,l===t){e=!0;break}(t.activeColumnMenu.contains(a.target)||t._columnsSettingsMenu&&t._columnsSettingsMenu.contains(a.target))&&(e=!0);const i=t.activeColumnMenu.querySelector("jqx-input");i&&i.$.scrollView.contains(a.target)&&(e=!0),e||t.closeColumnMenu()}}if(t._selectDrag)return t.$.main.classList.remove("prevent-scroll"),void delete t._selectDrag;if(!a)return t._resizeDetails&&t._resolveResize(!0),void t.$.tableContainer.classList.remove("jqx-unselectable");if(delete t._dragDetails,t.$.tableContainer.classList.remove("jqx-unselectable"),!a.FeedbackShown)return;const l=a.HoveredItem;document.body.classList.remove("jqx-dragging"),document.body.style.overflow=t._originalBodyOverflow.overflow,document.body.style.eoverflowX=t._originalBodyOverflow.overflowX,document.body.style.overflowY=t._originalBodyOverflow.overflowY,delete t._originalBodyOverflow,t.classList.remove("jqx-unselectable"),a.Item.classList.remove("dragged"),document.body.removeChild(a.Feedback),clearInterval(t._dragInterval),delete t._dragInterval,l&&t._applyColumnReorder(a,l),t._preventClickSort=!0,requestAnimationFrame((()=>delete t._preventClickSort))}_applyColumnReorder(e,t){const a=this,l=a.rightToLeft,i=a._columns,n=e.Item.getAttribute("data-field"),r=i.find((e=>e.dataField===n)),o=t.getAttribute("data-field"),s=t.classList.contains("right"),d=a._columns.filter((e=>e.dataField!==n)),c=d.findIndex((e=>e.dataField===o));t.classList.remove("drop-column","left","right"),s&&!l||!s&&l?d.splice(c+1,0,r):d.splice(c,0,r),i.map((e=>e.dataField)).join(",")!==d.map((e=>e.dataField)).join(",")&&(a.columns=d,a._initColumns(),a.refresh())}_applyRowFilters(){const e=this;if(!e.filtering||!e.filterRow&&!e.columnMenu)return;const t=e.filterRow?e.$.tableContainer.querySelector(".jqx-table-filter-row"):null,a=Number(e.selection),l=e._columns.filter((e=>e.visible)),i=[],n=[];for(let r=0;r<l.length;r++){const o=l[r].dataField,s=l[r].dataType;if(l[r].headerCellElement&&l[r].headerCellElement.hasAttribute("filter")&&l[r].headerCellElement.removeAttribute("filter"),!e.filterRow&&!l[r].columnMenu){n.push(null);continue}const d=e.filterRow?t.children[r+a].firstElementChild:l[r].columnMenu.lastElementChild,c=d.children[2];let u=d.firstElementChild.value,f=d.children[1].value;"string"===s?f=e._filterInfo.stringConditions.find((e=>e.label===f)).value:(f=e._filterInfo.numberAndDateConditions.find((e=>e.label===f)).value,""!==u&&("number"===s?(u=parseFloat(u),isNaN(u)&&(d.firstElementChild.value="",u="")):"date"===s&&(u=new Date(u),u.setHours(0,0,0))));const m=-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(f);if(""!==u||m){const e=new JQX.Utilities.FilterGroup,t=e.createFilter(s,u,f);e.addFilter("or",t),i.push([o,e]),c.classList.remove("jqx-hidden"),n.push({condition:f,value:u}),l[r].headerCellElement&&l[r].headerCellElement.setAttribute("filter","")}else c.classList.add("jqx-hidden"),n.push(null),l[r].headerCellElement&&l[r].headerCellElement.hasAttribute("filter")&&l[r].headerCellElement.removeAttribute("filter");m?d.firstElementChild.setAttribute("disabled",!0):d.firstElementChild.removeAttribute("disabled")}i.length>0?(e.dataSource.virtualDataSource||e.dataSource._filter(i,e.filterOperator),e._filterInfo.rowFilters=i,e._filterInfo.filterRowValues=n,delete e._filterInfo.appliedFilters,e._fullRefresh("filter"),e._updateState("filtered"),e._doNotFireEvent||e.$.fireEvent("filter",{action:"add",filters:i})):e._filterInfo.rowFilters?(e._filterInfo.filterRowValues&&delete e._filterInfo.filterRowValues,e.clearFilters()):e._filterInfo.filterRowValues&&delete e._filterInfo.filterRowValues}_clearFilterInput(){const e=this;e._filterInfo.query="",delete e._filterInfo.inputFilters,e.$.filterInput.value=""}_clearRowFilters(e){const t=this;if(!t._filterInfo.rowFilters)return;const a=t.$.tableContainer.querySelector(".jqx-table-filter-row"),l=t.selection?1:0;let i=t._columns.filter((e=>e.visible));if(e&&(i=t._columns.filter((t=>t.dataField===e))),a)for(let e=0;e<i.length;e++){const t=a.children[e+l]?a.children[e+l].firstElementChild:null;t&&(t.firstElementChild.value="",t.children[2].classList.add("jqx-hidden")),i[e].headerCellElement&&i[e].headerCellElement.hasAttribute("filter")&&i[e].headerCellElement.removeAttribute("filter")}delete t._filterInfo.rowFilters}_createFooterRow(e){const t=this,a=t.footerRow;if(!a)return;if(e)return void t.$.tableContainer.appendChild(e);const l=document.getElementById(a);if(l&&l instanceof HTMLTemplateElement){const e=document.createElement("tfoot"),a=document.importNode(l.content,!0);e.appendChild(a),t.$.tableContainer.appendChild(e)}else t.footerRow=null}_createCustomHeaderRow(){const e=this,t=e.$.tableContainer.firstElementChild;let a=e.headerRow;if(a){if("function"==typeof a)a.call(e,t);else if("string"==typeof a){const e=document.getElementById(a);if(!e)return void(t.innerHTML=`<tr><th>${a}</th></tr>`);a=e}a instanceof HTMLTemplateElement?t.appendChild(document.importNode(a.content,!0)):a.nodeName?t.appendChild(a):e.headerRow=null}}_updateSelectAllState(e){const t=this;if(!t.selection||"cell"===t.selectionMode)return;const a=t.$.tableContainer.querySelector(".jqx-table-select-all");let l;if(void 0===e){const a=t.dataSource,i=t._filterInfo;if(i.inputFilters||i.rowFilters||i.appliedFilters){const i=t._selectedIds;e=0,l=0;for(let t=0;t<a.length;t++){const n=a[t];if(!1===n.$.filtered)continue;const r=n.$.id;e++,-1!==i.indexOf(r)&&l++}}else e=t.dataSource.length}void 0===l&&(l=t._selectedIds.length),0===l||0===e?(a.classList.remove("selected","indeterminate"),a.firstElementChild.setAttribute("aria-checked",!1)):l===e+t._selectableGroupRecords.length?(a.classList.remove("indeterminate"),a.classList.add("selected"),a.firstElementChild.setAttribute("aria-checked",!0)):(a.classList.remove("selected"),a.classList.add("indeterminate"),a.firstElementChild.setAttribute("aria-checked","mixed"))}_resizeHandler(){const e=this;clearTimeout(e._resizeTimeout);const t=()=>{if(JQX.Utilities.Core.Browser.Firefox&&e.virtualization){const t=e.$.virtualizationContainer.$.verticalScrollBar.value;e._onVerticalChange({detail:{value:t}},!0)}};t(),"default"===e.columnSizeMode&&e._handleAutoSizeMode(),e._resizeTimeout=setTimeout((function(){if(e.columnGroups&&e._columns.some((e=>e.responsivePriority&&e.responsivePriority>1)))return void e.refresh();const a=e.offsetWidth,l=e.offsetHeight;if(e.virtualization&&e._cachedHeight!==l){const i=e._getFractionOfMax();return e._refreshDataRows(),e._setFractionOfMax(i),e._cachedWidth=a,e._cachedHeight=l,void t()}e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),e._cachedWidth=a,e._cachedHeight=l,t()}),75)}_hierarchyArrowClickHandler(e,t){const a=this,l=!a.grouping,i=e.data;if(a.animation=a._animation,a.expandHierarchy&&(a._collapsedIds||(a._collapsedIds=[]),!0===i.expanded?a._collapsedIds[i.$.id]=!0:delete a._collapsedIds[i.$.id],a.dataSource&&a.expandHierarchy&&(a.dataSource._collapsedIds=a._collapsedIds)),l&&a.dataSource.virtualDataSource&&!i.expanded&&i.children&&0===i.children.length)return a._requestVirtualDataSource("expand",void 0,i),void a.$.fireEvent("expand",{id:i.$.id,record:i});if(a.virtualization)return void a._hierarchyArrowClickHandlerVirtualization(e,t);const n=a.$.tableContainer,r=i.$.id;function o(e){e.forEach((e=>{a._expandSingleChildRow(n.querySelector(`tr[row-id="${e.$.id}"]:not([unused])`)),e.children&&e.expanded&&requestAnimationFrame((()=>o(e.children)))}))}if(i.expanded?function e(t){t.forEach((t=>{a._collapseSingleChildRow(n.querySelector(`tr[row-id="${t.$.id}"]:not([unused])`)),t.children&&e(t.children)}))}(i.children):requestAnimationFrame((()=>o(i.children))),i.expanded=!i.expanded,e.setAttribute("aria-expanded",i.expanded),e.classList.toggle("expanded",i.expanded),l)i.expanded?(-1===a._expandedIds.indexOf(r)&&a._expandedIds.push(r),a._expandedIdsAlt[r]=!0,a.$.fireEvent("expand",{id:i.$.id,record:i})):(a._expandedIds=a._expandedIds.filter((e=>e!==r)),delete a._expandedIdsAlt[r],a.$.fireEvent("collapse",{id:i.$.id,record:i})),a._updateState("expanded");else if(!0!==t){let e=""+i.$.id;e=e.replace("Item","").replace(/_/gi,"."),i.expanded?a.$.fireEvent("group",{action:"expand",path:e,dataField:i.groupDataField,label:i.label}):a.$.fireEvent("group",{action:"collapse",path:e,dataField:i.groupDataField,label:i.label})}}_expandSingleChildRow(e,t=[]){e&&(t.push(!1),"none"!==this.animation?(e.classList.remove("jqx-hidden"),requestAnimationFrame((()=>{e.classList.add("no-height"),e.ontransitionend=function(){e.classList.remove("no-height"),e.ontransitionend=null,t.pop()},e.removeAttribute("aria-hidden"),e.classList.remove("collapsed")}))):(e.removeAttribute("aria-hidden"),e.classList.remove("collapsed","jqx-hidden"),t.pop()))}_collapseSingleChildRow(e,t=[]){e&&(t.push(!1),"none"!==this.animation?e.ontransitionend=function(){e.classList.add("jqx-hidden"),e.ontransitionend=null,t.pop()}:(e.classList.add("jqx-hidden"),t.pop()),e.setAttribute("aria-hidden",!0),e.classList.add("collapsed"))}_getGroupByIndex(e){"number"==typeof e&&(e=e.toString());const t=this.dataSource.boundHierarchy,a=e.split(".");let l=t[a[0]];if(l){for(let e=1;e<a.length;e++)if(l=l.children[a[e]],!l||l.leaf)return;return l}}getGroupChildren(e){"number"==typeof e&&(e=e.toString());const t=this.dataSource.boundHierarchy,a=e.split(".");let l=t[a[0]];if(!l)return[];for(let e=1;e<a.length;e++)if(l=l.children[a[e]],!l||l.leaf)return[];return l.children}_createDialog(){const e=this,t=document.createElement("jqx-window"),a=document.createElement("template"),l=` animation=${e.animation} theme="${e.theme}"${e.rightToLeft?" right-to-left":""}${!e.keyboardNavigation||e.unfocusable?" unfocusable":""}`;a.innerHTML=`<jqx-button class="ok primary"${l}>${e.localize("ok")}</jqx-button>\n<jqx-button class="cancel"${l}>${e.localize("cancel")}</jqx-button>`,t.animation=e.animation,t.footerTemplate=a,t.headerButtons=["close"],t.rightToLeft=e.rightToLeft,t.theme=e.theme,t.unfocusable=!e.keyboardNavigation||e.unfocusable,t.className="jqx-table-window",t.ownerElement=e,e._dialog=t,e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(t),e.setAttribute("aria-owns",t.id)}_addDialogHandlers(){const e=this,t=e._dialog;t.addEventListener("close",e._dialogEventHandler),t.addEventListener("click",e._dialogEventHandler)}_dialogEventHandler(e){const t=this,a=t.ownerElement,l=t.isInShadowDOM?e.composedPath()[0]:e.target,i=e.type,n=a.context;if(a.context=a,"close"===i){if(l!==t)return void(a.context=n);const e=t.classList.contains("conditional-formatting"),i=t.classList.contains("fields");t.ok?(e&&a._applyConditionalFormatting(),delete t.ok):e&&JSON.stringify(a._formattingPanel.items)!==JSON.stringify(a._formattingPanel.getItems())&&(a._formattingPanel.$.itemsContainer.innerHTML="",a._formattingPanel._addDefaultItems()),t.content.innerHTML="",t.classList.remove("conditional-formatting","drill-down","fields"),!a.keyboardNavigation||a.disabled||a.unfocusable||(a.$.tableContainer.setAttribute("tabindex",0),"jqx-table"===a.nodeName.toLowerCase()&&(a.$.filterInput.unfocusable=!1,a.$.pager.unfocusable=!1),a.$.conditionalFormattingButton.unfocusable=!1),a.removeAttribute("modal"),e?a.$.conditionalFormattingButton.focus():i&&a.$.fieldsButton?a.$.fieldsButton.focus():a.$.tableContainer.focus()}else"click"===i&&t.$.footer.contains(l)&&(l.closest(".ok")?(t.ok=!0,t.close()):l.closest(".cancel")&&t.close());a.context=n}_openDialog(e,t,a){const l=this;l._dialog||l._createDialog();const i=l._dialog;i.label=e,i.classList.add(a),i.appendChild(t),l.$.tableContainer.removeAttribute("tabindex"),"jqx-table"===l.nodeName.toLowerCase()&&(l.$.filterInput.unfocusable=!0,l.$.pager.unfocusable=!0),"drill-down"!==a?i.setAttribute("aria-controls",l.$.tableContainer.id):i.removeAttribute("aria-controls"),l.$.conditionalFormattingButton.unfocusable=!0,l.setAttribute("modal",""),i.open()}_conditionalFormattingButtonClickHandler(e,t,a){const l=this;let i;l._formattingPanel?i=l._formattingPanel:(i=document.createElement("jqx-formatting-panel"),i.animation=l.animation,i.columns=t||l._columns,i.dataSource=a||l.dataSource,i.locale=l.locale,i.messages=l.messages,i.rightToLeft=l.rightToLeft,i.theme=l.theme,i.unfocusable=!l.keyboardNavigation||l.unfocusable,i.ownerElement=l,l._formattingPanel=i),l.conditionalFormatting&&(i.items=l.conditionalFormatting.slice(0)),l._openDialog(l.localize("conditionalFormatting"),i,"conditional-formatting")}_transformDataSource(){const e=this;if(!e.isRendered&&e.dataTransform){const t=e.dataSource;for(let a=0;a<t.length;a++)e.dataTransform(t[a])}}_applyInitialConditionalFormatting(e){const t=this,a=t.conditionalFormatting;if(!a||0===a.length)return void(t._conditionalFormatting=null);const l=t._defaults,i=new JQX.Utilities.ConditionalFormatter(e),n=[];let r;if("jqx-pivot-table"===t.nodeName.toLowerCase()){const e=t._dynamicColumns;r=function(t){return"all"===t?e.map((e=>e.id)):e.filter((e=>e.dataFields[e.dataFields.length-1].dataField===t)).map((e=>e.id))}}else r=function(e){return"all"===e?t._columns.map((e=>e.value)):[e]};for(let e=0;e<a.length;e++){a[e]=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:l.fontFamily,fontSize:l.fontSize,text:l.text,highlight:l.highlight},a[e]);const t=a[e],o=r(t.column),s=t.condition;i.color=t.highlight,i.comparator=t.firstValue,i.min=t.firstValue,i.max=t.secondValue;const d=i.format(s,o);for(let e in d){const a=d[e];for(let e in a){const l=a[e];l.color=t.text,l.fontFamily=t.fontFamily,l.fontSize=t.fontSize}}n.push(d)}if(t._formattingPanel&&(t._formattingPanel.items=a.slice(0)),0===n.length)return n[0];const o={};for(let e=0;e<n.length;e++){const t=n[e];for(let e in t){const a=t[e];o[e]||(o[e]={});for(let t in a)o[e][t]=Object.assign({},o[e][t],a[t])}}t._conditionalFormatting=o}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_applyConditionalFormatting(){const e=this,t=e._conditionalFormatting;e._conditionalFormatting=e._formattingPanel.apply(),e.conditionalFormatting=e._formattingPanel.getItems(),e._conditionalFormatting!==t&&e._refreshDataRows()}_updateState(e,t){const a=this;let l;if("selected"===e&&(l=a.getSelection(),a.selected=l),-1===a.stateSettings.indexOf(e))return;const i=a._state;switch(e){case"columns":i.columns=a._columns;break;case"expanded":i.expanded=a._expandedIds;break;case"filtered":i.filtered=a._filterInfo;break;case"grouped":i.grouped=a.dataSource.groupBy._array.slice(0);break;case"selected":i.selected=l;break;case"sorted":i.sorted=a._sortColumns||[]}a.autoSaveState&&a.isRendered&&!1!==t&&window.localStorage.setItem("jqxTable"+a.id,a._stringifyState())}_stringifyState(){const e=this,t=JSON.parse(JSON.stringify(e._state));return["columns","expanded","filtered","grouped","selected","sorted"].forEach((a=>{-1===e.stateSettings.indexOf(a)&&delete t[a]})),JSON.stringify(t,(function(e,t){if(!("function"==typeof t||t instanceof HTMLElement||"sortOrder"===e||"thHierarchy"===e))return t}))}_handleAutoSizeMode(){const e=this;if("default"===e.columnSizeMode){const t=e._columns.filter((e=>e.visible)),a=[],l=t=>{const a=t.headerCellElement;if(!a)return;const l=parseInt(t.minWidth||e.columnMinWidth);a.offsetWidth<l?a.style.width=l+"px":(a.style.width="",a.offsetWidth<l&&(a.style.width=l+"px"))};t.forEach((t=>{if(t.width||t._manualWidth||(l(t),a.push(t)),t.width&&"string"==typeof t.width&&t.width.endsWith("%")){const a=e._getColumnWidth(t.width,!1,t);!1===t.autoWidth?t.headerCellElement.style.width=t.width:(t.headerCellElement.setAttribute("responsive-width",t.width),t.headerCellElement.style.width=a+"px")}else if(t._manualPercentageWidth)if(t._isResponsive){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t);!1===t.autoWidth?t.headerCellElement.style.width=t.width:(t.headerCellElement.setAttribute("responsive-width",t._manualPercentageWidth+"%"),t.headerCellElement.style.width=a+"px")}else t.headerCellElement.style.width=t._manualWidth+"px"}));for(let e=0;e<a.length;e++)l(a[e]);if(e.columnResizeNormalize&&""===e._columns[e._columns.length-1].dataField){const t=e._columns[e._columns.length-1].headerCellElement.offsetWidth;if(t){let a=[];e._columns.forEach((e=>{e.width&&e.width.indexOf&&e.width.indexOf("%")>=0&&a.push(e)}));let l=t/a.length;a.forEach((e=>{e.width&&e.width.indexOf&&e.width.indexOf("%")>=0&&(e.headerCellElement.style.width=parseInt(e.headerCellElement.style.width)+l+"px")}))}}return}const t=e._columns.filter((e=>e.visible)),a=e._getNumericMinWidth();let l,i;t.forEach((e=>{e.width||e._manualWidth||(l||(l=e),i=e,e.headerCellElement.style.width=null)}));const n=e.$.tableContainer.offsetWidth-(e.selection?e.$.tableContainer.querySelector(".jqx-table-select-all").offsetWidth:0);let r=new Map,o=0,s=0,d=0;e.removeAttribute("resize-max-reached"),e.setAttribute("auto-size",""),l&&(l.headerCellElement.style.width="100%");for(let i=0;i<t.length;i++){const n=t[i];if(n===l){d++;continue}const c=n.headerCellElement;let u,f;n.width?(u=f=e._getColumnWidth(n.width,!1,n),n.minWidth&&u<f&&(u=n.minWidth,f=n.minWidth)):n._manualWidth?(u=n._manualWidth,f=n.minWidth||a,u<f&&(u=f)):(u=Math.max(c.offsetWidth,a),f=n.minWidth||a,d++),o+=u,s+=f,n._isResponsive&&(u=e._getColumnWidth(n._manualPercentageWidth+"%",!1,n),u<f&&(u=f)),r.set(n,{width:u,minWidth:f})}function c(){l.headerCellElement.style.width=null;const e=Math.max(l.headerCellElement.offsetWidth,a),t=l.minWidth||a;r.set(l,{width:e,minWidth:t}),o+=Math.max(e,t),s+=t}if(l)if(l!==i)i.headerCellElement.style.width="100%",c(),i.headerCellElement.style.width=null;else if(t.length>1){const e=t.find((e=>e!==l));e.headerCellElement.style.width="100%",c(),e._isResponsive?e.headerCellElement.style.width=r.get(e).width+"%":e.headerCellElement.style.width=r.get(e).width+"px"}else c();if(n<=s||0===d)t.forEach((t=>{if(t._isResponsive){if(t.headerCellElement.style.width=(t._manualPercentageWidth?t._manualPercentageWidth+"%":r.get(t).minWidth)+"px",t._manualPercentageWidth){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t),l=t.minWidth||e.columnMinWidth;a===l&&(t.headerCellElement.style.width=l+"px")}}else t.headerCellElement.style.width=(t._manualWidth?t._manualWidth:r.get(t).minWidth)+"px"})),n<=s&&e.setAttribute("resize-max-reached","");else if(n>s)if(n<o){const a=[];let l,i=o-n,s=d;for(;i>0&&s>0;)l=Math.ceil(i/s),t.forEach((e=>{if(e.width||e._manualWidth||-1!==a.indexOf(e))return;const t=r.get(e);let n=Math.max(t.width-l,t.minWidth);const o=t.width-n;i-=o,n===t.minWidth&&(s--,a.push(e)),t.width=n}));t.forEach((t=>{if(t._isResponsive){if(t.headerCellElement.style.width=r.get(t).width+"%",t._manualPercentageWidth){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t),l=t.minWidth||e.columnMinWidth;a===l&&(t.headerCellElement.style.width=l+"px")}}else t.headerCellElement.style.width=r.get(t).width+"px"}))}else n===o?t.forEach((e=>{e._isResponsive?e.headerCellElement.style.width=r.get(e).width+"%":e.headerCellElement.style.width=r.get(e).width+"px"})):t.forEach((e=>{const t=r.get(e).width;e.headerCellElement.style.width=e===l?n-o+t+"px":t+"px"}));e.removeAttribute("auto-size")}_getNumericMinWidth(){const e=this,t=e.columnMinWidth;return"string"==typeof t&&-1!==t.indexOf("%")?e.offsetWidth*(parseFloat(t)/100):parseFloat(t)}_getCurrentResizeMax(){const e=this;if("default"===e.columnSizeMode)return 1/0;const t=e._resizeDetails,a=e._columns,l=a.find((e=>e.headerCellElement===t.Item)),i=a.indexOf(l);let n,r=a.length-1;for(let e=a.length-1;e>=0;e--)if(a[e].visible){r=e;break}if(i===r)return t.Item.offsetWidth;for(let t=i+1;t<a.length;t++){const l=a[t];t===r&&l.headerCellElement&&(n=l.headerCellElement.getBoundingClientRect()[e.rightToLeft?"left":"right"]+window.scrollX)}return n}_autoResizeColumnOnDblclick(){const e=this,t=e._resizeDetails,a=t.Item,l=e._columns.find((e=>e.headerCellElement!==a)).headerCellElement,i=l.style.width;e.setAttribute("auto-size",""),a.style.width=null,l.style.width="100%";let n=a.offsetWidth;l.style.width=i,e.removeAttribute("auto-size",""),n=Math.min(t.Max,Math.max(t.Min,n)),t.Width=n,e._resolveResize()}_isExpandCollapseForbidden(){const e=this;return(!e.hasAttribute("hierarchy")||e.grouping)&&"jqx-pivot-table"!==e.nodeName.toLowerCase()}_selectSingle(e){const t=this,a=t.rowById?t.rowById[e]||t.dataSource.dataItemById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data?a.data.$.id:a.$.id;if(-1!==t._selectedIds.indexOf(l)||-1!==t._disabledSelection.indexOf(l))return;const i=t.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if("one"===t.selectionMode&&(t._clearSelection(),t._selectedIds=[]),t._selectedIds.push(l),i){const e=i.firstElementChild;e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0),i.setAttribute("aria-selected",!0)}return t._handleHierarchicalSelection(a,!0),!0}_unselectSingle(e){const t=this,a=t.rowById?t.rowById[e]||t.dataSource.dataItemById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data?a.data.$.id:a.$.id,i=t._selectedIds.indexOf(l),n=t.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if(-1!==i&&t._selectedIds.splice(i,1),n){const e=n.firstElementChild;e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1),n.setAttribute("aria-selected",!1)}return t._handleHierarchicalSelection(a,!1),!0}_changeSelectionOfMultiple(e,t,a="programmatic",l){const i=this;l||(l=JSON.stringify(i._selectedIds.slice(0).sort()));for(let a=0;a<e.length;a++)i[`_${t}Single`](e[a]);l!==JSON.stringify(i._selectedIds.slice(0).sort())&&(i._updateSelectAllState(),i._updateState("selected"),i.$.fireEvent("change",{type:a}))}_handleHierarchicalSelection(e,t){const a=this;if(!a.hasAttribute("hierarchy"))return;if(!1===a.selectionByHierarchy)return;const l=e.data;let i=l;for(l&&l.children&&function e(t,l){const i=t.children;let n=0;for(let t=0;t<i.length;t++){const r=i[t];if(!1===r.$.filtered)continue;let o=a._setThreeStateCheckbox(r,l);r.children&&r.children.length>0&&(o=e(r,l)),l&&!1===o&&n++}if(l&&n>0)return a._setThreeStateCheckbox(t,n!==i.length&&null)}(l,t);i&&i.parent;){const e=i.parent,t=a._getChildCheckState(e).state;a._setThreeStateCheckbox(e,t),i=e}}_getChildCheckState(e){const t=this,a=t._selectedIds,l=t._disabledSelection,i=e.children;if(!i||0===i.length||!t.selectionByHierarchy){const t=e.$.id,i=-1!==a.indexOf(t);return{state:i,maxSelected:!!i||-1!==l.indexOf(t)}}let n=!0,r=0,o=0,s=0;for(let e=0;e<i.length;e++){const a=i[e];if(!1===a.$.filtered)continue;const l=t._getChildCheckState(a);r++,l.state?o++:null===l.state?s++:!1===l.maxSelected&&(n=!1)}return 0!==o&&o===r?{state:!0,maxSelected:!0}:0===o&&0===s?{state:!1,maxSelected:n}:{state:null,maxSelected:n}}_setThreeStateCheckbox(e,t){const a=this,l=e.$.id,i=a._selectedIds,n=i.indexOf(l);t&&(-1!==a._disabledSelection.indexOf(l)?t=!1:-1===n&&i.push(l)),t||-1===n||i.splice(n,1);const r=a.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if(!r)return t;const o=r.firstElementChild,s=o.firstElementChild;return t?(o.classList.remove("indeterminate"),o.classList.add("selected"),s.setAttribute("aria-checked",!0),r.setAttribute("aria-selected",!0)):!1===t?(o.classList.remove("selected","indeterminate"),s.setAttribute("aria-checked",!1),r.setAttribute("aria-selected",!1)):(o.classList.remove("selected"),o.classList.add("indeterminate"),s.setAttribute("aria-checked","mixed"),r.setAttribute("aria-selected",!1)),t}_getSelectableGroupRecords(){const e=this,t=e.dataSource,a=t.boundHierarchy;e._selectableGroupRecords=[],a?(function t(a){a.forEach((a=>{a.groupDataField&&(e._selectableGroupRecords.push(a.$.id),t(a.children))}))}(a),e._selectedIds=e._selectedIds.filter((a=>void 0!==t.dataItemById[a]||-1!==e._selectableGroupRecords.indexOf(a)))):e._selectedIds=e._selectedIds.filter((e=>void 0!==t.dataItemById[e]))}_clearSelection(e){const t=this;if(0===t._selectedIds.length)return;const a=t.$.tableContainer.querySelector(".jqx-table-select-all");Array.from(t.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)})),a&&(a.classList.remove("indeterminate","selected"),a.firstElementChild.setAttribute("aria-checked",!1)),t._selectedIds=[],e&&(t._updateState("selected"),t.$.fireEvent("change",{type:"programmatic"}))}_updateCellsWithFormulas(e){const t=this,a=t.formulas,l=t._cellsWithFormulas;if(a||e)for(let e in l){const a=/(.+):(.+)/.exec(e),l=t.columnByDataField[a[1]],i=t.rowById[a[2]];if(!l||!i)continue;const n=t.$.tableContainer.querySelector(`tr[row-id="${i.data.$.id}"]:not([unused]) td[data-field="${l.dataField}"]`);n&&t._setCellContent(n,t._formatCellValue(i,l,n),n.classList.contains("tree-cell"))}}_createVirtualDataRows(e){const t=this,a=t.rowDetailTemplate,l=t.selection,i=t.hasAttribute("hierarchy"),n=document.createDocumentFragment(),r=t.$.virtualizationContainer,o=t.$.tableContainer,s=t._rowHeight;t.isRendered&&(r.scrollWidth=0,r.scrollHeight=0,r.$.scrollViewerContainer.classList.remove("hscroll","vscroll"));const d=r.$.scrollViewerContainer.offsetHeight-o.firstElementChild.offsetHeight-(t.filtering&&t.filterRow?s:0)-(t.footerRow?o.lastElementChild.offsetHeight:0),c=d<5,u=t._getVirtualRecords(i,c),f=u.length;let m=i?2*d:d+3*s,h=s*f,p=0;t._rowsVirtual=u,t._rowsInDOM=[];for(let e=0;e<f;e++){const r=u[e],o=r.data;if(!r.detail){if(o.groupDataField)t._rowsInDOM.push(t._createGroupHeader(o,n));else{const e=t._createDataRow(r,n,{hierarchical:i,rowDetailTemplate:a,selection:l,virtualization:!0});t._rowsInDOM.push(e.row),e.detail&&(t._rowsInDOM.push(e.detail),p+=t._rowDetailHeight,m+=t._rowDetailHeight)}if(p+=s,!c&&p>m)break}}e.appendChild(n),t._updateState("expanded"),e.parentElement||t.$.tableContainer.insertBefore(e,t.$.tableContainer.querySelector("tfoot")),r.refresh(),a&&(h+=t._expandedRowDetailIds.length*(t._rowDetailHeight-s));let g=Math.max(0,h-d);g>0&&r.computedHorizontalScrollBarVisibility&&(g+=r.$.horizontalScrollBar.offsetHeight),r.$.scrollViewerContentContainer.style.top=0,r.$.verticalScrollBar.max=g,t._scrollHeight=h,t._start={view:0,data:0},!c&&t._rowsInDOM.length>0&&r.$.scrollViewerContentContainer.offsetHeight<r.$.scrollViewerContainer.offsetHeight&&t._rowsInDOM[t._rowsInDOM.length-1].classList.add("last-row"),t._fixFrozenHeaderFirefox(),t._focusEquivalentCell()}_getVirtualRecords(e,t){const a=this,l=e&&!t?a.rows.filter((e=>0===e.data.level||!a._isCollapsed(e.data))):a.rows;if(e||!a.rowDetailTemplate)return l;const i=[];return l.forEach((e=>{i.push(e),-1!==a._expandedRowDetailIds.indexOf(e.data.$.id)&&i.push({detail:!0,data:e.data})})),i}_onVerticalChange(e,t){const a=this;if(a._ignoreVerticalChange)return;const l=a.rows,i=a._rowHeight,n=a.$.virtualizationContainer;let r,o,s=e.detail.value;if(JQX.Utilities.Core.Browser.Firefox&&a.virtualization&&(n.$.scrollViewerContentContainer.style.top=null),a.setAttribute("ignore-detail-animation",""),a._rowsInDOM.length===l.length||0===n.$.verticalScrollBar.max){const e=Math.floor(s/i);return a._start={view:e,data:e},n.$.scrollViewerContentContainer.style.top=-s+"px",requestAnimationFrame((()=>a.removeAttribute("ignore-detail-animation"))),void a._fixFrozenHeaderFirefox()}if(a._expandedRowDetailIds.length>0){let e,t=0;r=1;for(let l=0;l<a._rowsVirtual.length;l++){const i=t;if(a._rowsVirtual[l].detail?t+=a._rowDetailHeight:t+=a._rowHeight,void 0===o&&s<=t){o=l,e=s-i;break}}n.computedVerticalScrollBarVisibility?s=e+a._rowHeight:r=0}else{for(s=s%(2*i)+i,s<i&&(s+=i);s+n.$.scrollViewerContainer.offsetHeight>a.$.tableContainer.offsetHeight;)s-=i;r=Math.floor(s/i),o=Math.floor(e.detail.value/i),r<0&&(o-=r,r=0)}n.$.scrollViewerContentContainer.style.top=-s+"px",a._updateVisibleRows(r,o,t||a._expandedRowDetailIds.length>0),a._fixFrozenHeaderFirefox(),requestAnimationFrame((()=>a.removeAttribute("ignore-detail-animation")))}_fixFrozenHeaderFirefox(){const e=this;e.virtualization&&e.$.virtualizationContainer&&e.$.virtualizationContainer.$.scrollViewerContentContainer&&(e._tableHeader.style.top=-parseFloat(e.$.virtualizationContainer.$.scrollViewerContentContainer.style.top)+"px"),JQX.Utilities.Core.Browser.Firefox&&e.virtualization}_focusEquivalentCell(e){const t=this,a=t._focusedCell;if(!e&&!a)return;let l;if(!e){if(!a.parentElement)return;e={rowId:a.parentElement.data.$.id,dataField:a.getAttribute("data-field")}}l=e.dataField?t.$.tableContainer.querySelector(`tr[row-id="${e.rowId}"]:not([unused]) td[data-field="${e.dataField}"]`):t.$.tableContainer.querySelector(`tr[row-id="${e.rowId}"]:not([unused]) td.group-header`),t._focusCell(l)}_detachCachedTemplates(){const e=this;e._cachedTemplates&&(delete e._cachedTemplates,e._tableCachedTemplates&&(e._tableCachedTemplates.remove(),delete e._tableCachedTemplates))}_clearCachedTemplates(){const e=this;if(e._cachedTemplates&&Object.keys(e._cachedTemplates).length>0){e._tableCachedTemplates||(e._tableCachedTemplates=document.createElement("div"),e._tableCachedTemplates.style.display="none",document.body.appendChild(e._tableCachedTemplates));const t=document.createDocumentFragment();for(let a in e._cachedTemplates)t.appendChild(e._cachedTemplates[a]);e._tableCachedTemplates.appendChild(t)}}_updateVisibleRows(e,t,a){const l=this,i=t-e,n=l._rowsVirtual.length,r={hierarchical:l.hasAttribute("hierarchy"),selection:l.selection};let o;if(a=a&&(r.hierarchical||!!l.rowDetailTemplate),r.hierarchical&&!l.grouping&&(a=!0),l._sortColumns&&l._sortColumns.length>0&&(a=!0),l._focusedCell){const e=l._focusedCell.parentElement;e&&(o={rowId:e.data.$.id,dataField:l._focusedCell.getAttribute("data-field")})}for(let t=0;t<e;t++){const e=l._rowsInDOM[t];let n=i+t;n>=0&&(a||e.data.$.index!==n||e.data.detail)&&l._updateVisibleRow(e,n,r),e.setAttribute("unused",""),e.setAttribute("aria-hidden",!0),e.classList.remove("jqx-table-row-detail")}for(let t=e;t<l._rowsInDOM.length;t++){const e=l._rowsInDOM[t],o=i+t;o<n?(e.removeAttribute("unused"),e.removeAttribute("aria-hidden"),(a||e.data.$.index!==o||e.data.parent)&&l._updateVisibleRow(e,o,r)):e.setAttribute("aria-hidden",!0)}l._start={view:e,data:t},l._focusEquivalentCell(o)}_updateVisibleRow(e,t,a){const l=this,i=l._columns.filter((e=>e.visible));if(!i.length)return;const n=l._rowsVirtual[t],r=n.data,o=r.$.id,s=Number(a.selection),d=!r.groupDataField&&!e.firstElementChild.classList.contains("group-header")&&!n.detail&&!e.classList.contains("jqx-table-row-detail")&&e.childElementCount>1;if(e.className="",d){const t=e.attributes;for(;t.length>0;)e.removeAttribute(t[0].name)}else e.innerHTML="";if(r.groupDataField)l._createGroupHeader(r,void 0,e);else if(n.detail)l._createRowDetailOnDemand(e,n,r);else{e.setAttribute("aria-rowindex",r.$.index+1),l._processAndRenderSelection(r,e,a.hierarchical,d);for(let t=0;t<i.length;t++){const c=i[t];let u=d?e.children[t+s]:document.createElement("td"),f=!1;if(u&&(l.grouping&&!r.groupDataField||l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.length>0)&&u.removeAttribute("colspan"),!u){if(!d)continue;u=document.createElement("td"),f=!0,e.appendChild(u)}d&&(u.className=""),u.setAttribute("data-field",c.dataField),u.setAttribute("aria-colindex",t+1+s);let m,h=l._formatCellValue(n,c,u);if(f&&l._setCellContent(u,h,m),c.freeze&&u.classList.add("freeze-"+("far"===c.freeze?"far":"near")),c.responsivePriority&&u.classList.add("priority-"+c.responsivePriority),!1===c.allowEdit?(u.classList.add("no-edit"),u.setAttribute("aria-readonly",!0)):u.removeAttribute("aria-readonly"),0===t&&a.hierarchical){const e=l._areChildrenFiltered(r);r.leaf||(u.classList.add("tree-cell"),m=e),r.level&&(u.classList.add("outline-level-"+Math.min(r.level,10)),!r.leaf&&e||u.classList.add("tree-leaf"))}if(c.templateElement){if(f&&l.grouping){const e=c.templateElement+"",t=u;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e}else if(a.hierarchical&&l.grouping&&r.leaf){const e=c.templateElement+"",t=u;if((!t.firstElementChild||!(t.firstElementChild.hasAttribute("ng-version")||t.innerHTML.indexOf("ng-version")>=0))&&t.firstElementChild&&!t.firstElementChild.classList.contains(".jqx-table-cell-template")){const a=t.innerHTML;e.substring(e.lastIndexOf("</"))!==a.substring(a.lastIndexOf("</"))&&(e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e)}}if(m&&!u.querySelector(".hierarchy-arrow")){l._setCellContent(u,h,m);const e=u.children[0].children[1],t=c.templateElement+"";t.indexOf("{{value}}")>=0?e.innerHTML=t.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):e.innerHTML=t}else if(a.hierarchical&&!l.grouping&&r.leaf){const e=u;if(!e.firstElementChild||!(e.firstElementChild.hasAttribute("ng-version")||e.innerHTML.indexOf("ng-version")>=0)){l._setCellContent(u,h,!1);const t=c.templateElement+"";t.indexOf("{{value}}")>=0?e.innerHTML=t.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):e.innerHTML=t}}if(!d){const e=c.templateElement+"",t=m?u.children[0].children[1]:u;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e}let e=m?u.children[0].children[1].firstElementChild:u.firstElementChild;if(!e&&a.hierarchical){l._setCellContent(u,h,!1);const t=u,a=c.templateElement+"";a.indexOf("{{value}}")>=0?t.innerHTML=a.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=a,e=m?u.children[0].children[1].firstElementChild:u.firstElementChild}c.templateElementSettings?c.templateElementSettings(r[c.dataField],o,e):c.templateElement.indexOf("{{value}}")>=0&&(u.querySelector(".jqx-table-cell-template").textContent=r[c.dataField])}else c.formatFunction,l._setCellContent(u,h,m);l.onCellRender&&l.onCellRender(r,c.dataField,r[c.dataField],u),l._applyConditionalFormattingToCell(u,c.dataField,r.$.index),d||e.appendChild(u)}e.data=r,e.setAttribute("row-id",o),-1!==l._disabledSelection.indexOf(o)&&(e.removeAttribute("aria-selected"),e.classList.add("disable-select"),a.selection&&e.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),r.expanded?(-1===l._expandedIds.indexOf(o)&&l._expandedIds.push(o),l._expandedIdsAlt[o]=!0,e.setAttribute("aria-expanded",!0),e.classList.add("expanded")):!1===r.expanded&&e.setAttribute("aria-expanded",!1),r.level&&l._isCollapsed(r)&&(e.setAttribute("aria-hidden",!0),e.classList.add("collapsed","jqx-hidden"))}}_createRowDetailOnDemand(e,t,a){const l=this,i=Number(l.selection)+l._columns.filter((e=>e.visible)).length;e.data=Object.assign(a,{detail:!0}),e.classList.add("jqx-table-row-detail"),e.removeAttribute("aria-rowindex"),e.removeAttribute("row-id"),e.innerHTML=`<td colspan="${i}"><div class="jqx-table-detail-container">${l._applyRowDetailTemplate(t)}</div></td>`}_hierarchyArrowClickHandlerVirtualization(e,t){const a=this,l=!a.grouping,i=a.$.tableContainer,n={nextRow:e.nextElementSibling,tbody:i.children[1]},r=e.data,o=[],s=[],d=Math.ceil((a.$.virtualizationContainer.$.scrollViewerContainer.offsetHeight-i.firstElementChild.offsetHeight)/a._rowHeight);function c(){0===o.length?function(){if(a._ignoreVerticalChange=!0,r.expanded=!r.expanded,l)r.expanded?(-1===a._expandedIds.indexOf(r.$.id)&&a._expandedIds.push(r.$.id),a._expandedIdsAlt[r.$.id]=!0,a.$.fireEvent("expand",{id:r.$.id,record:r})):(a._expandedIds=a._expandedIds.filter((e=>e!==r.$.id)),delete a._expandedIdsAlt[r.$.id],a.$.fireEvent("collapse",{id:r.$.id,record:r})),a._updateState("expanded");else if(!0!==t){const e=t=>{for(let a=0;a<t.length;a++){const l=t[a];if(l.$.id===r.$.id)return l;if(l.children){let t=e(l.children);if(t)return t}}return null},t=e(a.dataSource.boundHierarchy);t&&(t.expanded=r.expanded);let l=""+r.$.id;l=l.replace("Item","").replace(/_/gi,"."),r.expanded?a.$.fireEvent("group",{action:"expand",path:l,dataField:r.groupDataField,label:r.label}):a.$.fireEvent("group",{action:"collapse",path:l,dataField:r.groupDataField,label:r.label})}for(const e of s)e.remove();let e=a.$.virtualizationContainer.$.verticalScrollBar,i=a.$.virtualizationContainer.$.verticalScrollBar.value;a._refreshDataRows(),i=Math.min(e.max,i),e.value=i,delete a._ignoreVerticalChange,a._onVerticalChange({detail:{value:i}},!0)}():requestAnimationFrame((()=>c()))}function u(e){for(const t of e){if(s.length>=d)break;!1!==t.$.filtered&&(s.push(a._expandSingleChildRowVirtualization(t,n,o)),t.children&&t.expanded&&u(t.children))}}r.expanded?function e(t){t.forEach((t=>{a._collapseSingleChildRow(i.querySelector(`tr[row-id="${t.$.id}"]:not([unused])`),o),t.children&&e(t.children)}))}(r.children):requestAnimationFrame((()=>u(r.children))),e.setAttribute("aria-expanded",!r.expanded),e.classList.toggle("expanded",!r.expanded),requestAnimationFrame((()=>c()))}_expandSingleChildRowVirtualization(e,t,a){const l=this,i=l.rowById[e.$.id],n=document.createDocumentFragment();let r;if(i){if(r=i.data.groupDataField?l._createGroupHeader(i.data,n):l._createDataRow(i,n,{virtualization:!0,hierarchical:!0,selection:l.selection}).row,-1===[...t.tbody.children].indexOf(t.nextRow)){let a=!1;e.children&&0===e.children.length&&(a=!0),e.children||(a=!0),l._rowsInDOM&&l._rowsInDOM.length===l.rows.length&&(a=!0),a||t.tbody.appendChild(n)}else t.tbody.insertBefore(n,t.nextRow);return l._expandSingleChildRow(r,a),r}}_getFractionOfMax(){const e=this;return e.isRendered&&e.virtualization?{vertical:function(){const t=e.$.virtualizationContainer.$.verticalScrollBar,a=t.max;return 0===a?0:t.value/a}(),horizontal:function(){const t=e.$.virtualizationContainer.$.horizontalScrollBar,a=t.max;return 0===a?0:t.value/a}()}:null}_setFractionOfMax(e){if(!this.virtualization||null===e)return;const t=this.$.virtualizationContainer,a=t.$.verticalScrollBar,l=t.$.horizontalScrollBar;a.value=a.max*e.vertical,l.value=l.max*e.horizontal}_refreshHorizontalScrollbar(){const e=this.$.virtualizationContainer;if(!e)return;const t=e.$.scrollViewerContainer,a=e.$.horizontalScrollBar,l=e.$.verticalScrollBar,i=e.$.scrollViewerContentContainer.offsetWidth-t.offsetWidth;let n,r;i>0&&!t.classList.contains("hscroll")?(t.classList.add("hscroll"),n="add"):i<=0&&t.classList.contains("hscroll")&&(r=a.offsetHeight,t.classList.remove("hscroll"),n="subtract"),e.scrollWidth!==i&&(e.scrollWidth=i),e.computedVerticalScrollBarVisibility&&("add"===n?(r=a.offsetHeight,l.max+=r):"subtract"===n&&(l.max-=r))}_scrollToVirtualization(e,t){const a=this;if(!a.virtualization)return;const l=a.$.virtualizationContainer,i=l.$.scrollViewerContentContainer,n=l.$.verticalScrollBar,r=l.$.horizontalScrollBar,o=a.$.tableContainer,s=i.offsetLeft,d=i.offsetTop,c=n.value;let u,f;switch(t&&(u=t.offsetLeft,f=t.offsetTop),e){case"nextArrow":{if(!t||!l.computedHorizontalScrollBarVisibility)return;const e=s+u+t.offsetWidth-l.offsetWidth;e>0&&(r.value+=e+n.offsetWidth);break}case"prevArrow":if(!t||!l.computedHorizontalScrollBarVisibility||u>=-s)return;r.value=u-s-r.value;break;case"ArrowUp":{const e=o.firstElementChild.offsetHeight-d-f;if(e<=0)return;let t;if(a._focusedCell){const e=a._focusedCell.parentElement;e&&(t={rowId:e.data.$.id,dataField:a._focusedCell.getAttribute("data-field")})}const l=Math.max(0,c-e);l!==c&&(n.value=l,a._focusEquivalentCell(t));break}case"ArrowDown":{const e=d+f+t.offsetHeight-l.offsetHeight;if(e<=0)return;const a=Math.min(n.max,c+e);a!==c&&(n.value=a);break}case"Home":case"End":if(!l.computedHorizontalScrollBarVisibility)return;r.value="Home"===e?0:r.max}}_getExpandedGroups(e){const t=this,a=[];return e?(function e(l){l.forEach((l=>{l.expanded&&a.push({groupDataField:l.groupDataField,label:l.label,ancestorSignature:t._getGroupAncestorSignature(l)}),l.children&&l.children.length>0&&!1===l.children[0].leaf&&e(l.children)}))}(e),a):[]}_getGroupAncestorSignature(e){const t=[];let a=e.parent;for(;a;)t.push({groupDataField:a.groupDataField,label:a.label}),a=a.parent;return JSON.stringify(t)}_restoreExpandedGroups(e){if(0===e.length)return;const t=this,a=t.dataSource,l=[];!function a(i){i&&i.forEach(((i,n)=>{if(e.some((e=>e.groupDataField===i.groupDataField&&e.label===i.label&&e.ancestorSignature===t._getGroupAncestorSignature(i)))){let e=i.$.id;"string"==typeof e&&(e=e.replace("Item","").replace(/_/g,".")),0===i.level?l.push(n):l.push(e)}i.children&&i.children.length>0&&!1===i.children[0].leaf&&a(i.children)}))}(a.boundHierarchy);const i=t._doNotFireEvent;t._doNotFireEvent=!0,l.forEach((e=>t.expandGroup(e))),t._doNotFireEvent=i}});
153
+ JQX("jqx-table",class extends JQX.ContentElement{static get properties(){return{autoLoadState:{value:!1,type:"boolean"},autoSaveState:{value:!1,type:"boolean"},columnGroups:{value:null,type:"array?"},columnMinWidth:{value:"50px",type:"any"},columnReorder:{value:!1,type:"boolean"},columnResize:{value:!1,type:"boolean"},columnResizeFeedback:{value:!1,type:"boolean"},columnResizeNormalize:{value:!1,type:"boolean"},columns:{value:[],type:"any?",reflectToAttribute:!1},columnSizeMode:{value:"default",allowedValues:["auto","default"],type:"string"},conditionalFormatting:{value:null,type:"array?",reflectToAttribute:!1},conditionalFormattingButton:{value:!1,type:"boolean"},deferredScrollDelay:{value:1,type:"number"},dataRowId:{value:null,type:"string?"},dataSource:{value:null,type:"any?",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},sanitizeHTMLRender:{value:"text",allowedValues:["text","html"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},dataTransform:{value:null,type:"function?",reflectToAttribute:!1},editing:{value:!1,type:"boolean"},editMode:{value:"cell",allowedValues:["cell","row"],type:"string"},expandHierarchy:{value:!1,type:"boolean"},filtering:{value:!1,type:"boolean"},columnMenu:{value:!1,type:"boolean"},filterRow:{value:!1,type:"boolean"},filterTemplate:{value:null,type:"string?"},filterOperator:{value:"and",type:"string?"},footerRow:{value:null,type:"string?"},formulas:{value:!1,type:"boolean"},freezeFooter:{value:!1,type:"boolean"},freezeHeader:{value:!1,type:"boolean"},grouping:{value:!1,type:"boolean"},groupFormatFunction:{value:null,type:"any"},headerRow:{value:null,type:"any"},hideSelectionColumn:{value:!1,type:"boolean"},keyboardNavigation:{value:!1,type:"boolean"},loadColumnStateBehavior:{value:"implementationOnly",allowedValues:["stateOnly","implementationOnly","intersection"],type:"string"},messages:{value:{en:{add:"Add condition",all:"All columns",apply:"Apply",between:"Between",cancel:"Cancel",clearFilter:"Clear filter",close:"Close",column:"Column:",condition:"Condition:",conditionalFormatting:"Conditional Formatting",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",equal:"Equal To",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filterCondition:"Filter condition",filterPlaceholder:"Filter",firstButton:"First",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",formatColumn:"Format Column",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",greaterThan:"Greater Than",highlight:"Highlight",invalidValue:"Invalid value",itemsPerPage:"Items per page:",lastButton:"Last",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",lessThan:"Less Than",nextButton:"Next",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",notEqual:"Not Equal To",NULL:"null",ok:"OK",previousButton:"Previous",remove:"Remove condition",secondValue:"Second value:",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",summaryPrefix:"of",text:"Text",value:"Value:",with:"with",columnMenuItemSortAsc:"Sort Ascending",columnMenuItemSortDesc:"Sort Descending",columnMenuItemReset:"Reset",columnMenuItemRemoveSort:"Remove Sort",columnMenuItemFilter:"Show rows where:",columnMenuItemRemoveFilter:"Remove Filter",columnMenuItemColumns:"Columns",grouping:"Group field name is not found in the dataFields collection!"}},type:"object",extend:!0},onCellRender:{value:null,type:"function?",reflectToAttribute:!1},onColumnRender:{value:null,type:"function?",reflectToAttribute:!1},onUpdateComplete:{value:null,type:"function?",reflectToAttribute:!1},onInit:{value:null,type:"function?",reflectToAttribute:!1},onLoad:{value:null,type:"function?",reflectToAttribute:!1},pageSize:{value:10,allowedValues:[10,25,50],type:"int"},pageIndex:{value:0,type:"int"},paging:{value:!1,type:"boolean"},rowDetailTemplate:{value:null,type:"string?"},selected:{value:[],type:"array",reflectToAttribute:!1},selection:{value:!1,type:"boolean"},selectionMode:{value:"many",type:"string",allowedValues:["one","many","extended"]},selectionByHierarchy:{value:!0,type:"boolean"},sort:{value:null,type:"function?",reflectToAttribute:!1},sortMode:{value:"none",type:"string",allowedValues:["none","one","many"]},stateSettings:{value:["columns","expanded","filtered","grouped","selected","sorted"],type:"array"},tooltip:{value:!1,type:"boolean"},virtualization:{value:!1,type:"boolean"}}}static get listeners(){return{resize:"_resizeHandler","conditionalFormattingButton.click":"_conditionalFormattingButtonClickHandler","filterInput.keyup":"_filterInputKeyupHandler","pager.change":"_pagerChangeHandler","pager.pageSizeChanged":"_pagerPageSizeChanged","tableContainer.change":"_tableContainerChangeHandler","tableContainer.click":"_tableContainerClickHandler","tableContainer.down":"_tableContainerDownHandler","tableContainer.focus":"_tableContainerFocusHandler","tableContainer.pointerover":"_tableContainerPointeroverHandler","document.down":"_documentDownHandler","document.keydown":"_tableContainerKeydownHandler","document.keyup":"_tableContainerKeyupHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}template(){return JQX.Templates[this.nodeName]&&delete JQX.Templates[this.nodeName],this.virtualization?'<div id="container" class="jqx-container" role="presentation">\n <div id="header" class="jqx-table-header" role="toolbar">\n <jqx-input id="filterInput" class="underlined" animation="[[animation]]" locale="[[locale]]" right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-input>\n <div id="filterTemplateContainer" class="jqx-table-filter-template-container jqx-hidden"></div>\n <jqx-button id="conditionalFormattingButton" class="jqx-table-toolbar-button conditional-formatting" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" aria-label="Conditional Formatting"></jqx-button>\n </div>\n <jqx-scroll-viewer style="opacity: 0.99" id="virtualizationContainer" class="jqx-table-virtualization-container" right-to-left="[[rightToLeft]]" theme="[[theme]]">\n <table id="tableContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-table-container">\n <content></content>\n </table>\n </jqx-scroll-viewer>\n <jqx-pager id="pager" animation="[[animation]]" locale="[[locale]]" page-index="[[pageIndex]]" page-size="[[pageSize]]" pages-count="null" show-first-last-navigation-buttons show-page-size-selector show-prev-next-navigation-buttons show-summary right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-pager>\n <div id="loadingIndicatorContainer" class="jqx-loader-container jqx-hidden" aria-label="Loading">\n <span id="loadingIndicator" class="jqx-loader" role="presentation"></span>\n </div>\n </div>':'<div id="container" class="jqx-container" role="presentation">\n <div id="header" class="jqx-table-header" role="toolbar">\n <jqx-input id="filterInput" class="underlined" animation="[[animation]]" locale="[[locale]]" right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-input>\n <div id="filterTemplateContainer" class="jqx-table-filter-template-container jqx-hidden"></div>\n <jqx-button id="conditionalFormattingButton" class="jqx-table-toolbar-button conditional-formatting" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" aria-label="Conditional Formatting"></jqx-button>\n </div>\n <table id="tableContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="jqx-table-container">\n <content></content>\n </table>\n <jqx-pager id="pager" animation="[[animation]]" locale="[[locale]]" page-index="[[pageIndex]]" page-size="[[pageSize]]" pages-count="null" show-first-last-navigation-buttons show-page-size-selector show-prev-next-navigation-buttons show-summary right-to-left="[[rightToLeft]]" theme="[[theme]]"></jqx-pager>\n <div id="loadingIndicatorContainer" class="jqx-loader-container jqx-hidden" aria-label="Loading">\n <span id="loadingIndicator" class="jqx-loader" role="presentation"></span>\n </div>\n </div>'}resetState(e){const t=this;switch(e){case"expanded":t._expandedIds=[],t._expandedIdsAlt=[],t._state.expanded=[];break;case"selected":t._selectedIds=[],t._disabledSelection=[],t._selectableGroupRecords=[],t.set("selected",[]),t._state.selected=[];break;default:t._dblclickObject={numberOfClicks:0},t._expandedIds=[],t._expandedIdsAlt=[],t._selectedIds=[],t._disabledSelection=[],t._selectableGroupRecords=[],t._state={expanded:[],selected:[],sorted:[]},t.set("selected",[])}}render(){this._render(),super.render()}_render(){const e=this,t=getComputedStyle(e);if(e.setAttribute("role","presentation"),e.$.tableContainer.id=e.id+"TableContainer",e._cachedWidth=e.offsetWidth,e._cachedHeight=e.offsetHeight,e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)},e._isMobile=JQX.Utilities.Core.isMobile,e._autoScrollCoefficient=JQX.Utilities.Core.Browser.Firefox?8:JQX.Utilities.Core.Browser.Edge?16:4,e._dblclickObject={numberOfClicks:0},e._expandedIds=[],e._expandedIdsAlt=[],e._selectedIds=[],e._collapsedIds=[],e._disabledSelection=[],e._selectableGroupRecords=[],e._state={expanded:[],selected:[],sorted:[]},e._rowHeight=parseFloat(t.getPropertyValue("--jqx-table-row-height")),e._rowDetailHeight=parseFloat(t.getPropertyValue("--jqx-table-row-detail-height")),e._animation=e.animation,e._setFocusable(),e.selection&&e.$.tableContainer.setAttribute("aria-multiselectable",!0),e.virtualization){const t=e.$.virtualizationContainer,a=e;t&&(t._mouseWheelHandler=function(e){const l=t;if(!l.disabled&&(l.computedHorizontalScrollBarVisibility||l.computedVerticalScrollBarVisibility)){if(e.shiftKey&&l.computedHorizontalScrollBarVisibility){const t=l.scrollLeft;if(0===t&&e.deltaX<0||t===l.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(l.scrollWidth>0&&l.scrollTo(void 0,l.scrollLeft+l._getScrollCoefficient(e,l.offsetWidth)))}if(l.computedVerticalScrollBarVisibility){const t=l.scrollTop;if(0===t&&e.deltaY<0||t===l.scrollHeight&&e.deltaY>0)return;if(e.stopPropagation(),e.preventDefault(),l.scrollHeight>0){let t=3*a._rowHeight;e.deltaY<=0&&(t=-3*a._rowHeight),Math.abs(e.deltaY)>=100?l.scrollTop+=t:l.scrollTop+=e.deltaY}}}},t._verticalScrollbarHandler=function(t){0===e.deferredScrollDelay?e._onVerticalChange(t):(e._verticalScrollTimer&&(clearTimeout(e._verticalScrollTimer),delete e._verticalScrollTimer),e._verticalScrollTimer=setTimeout((()=>{e._onVerticalChange(t),delete e._verticalScrollTimer}),e.deferredScrollDelay))}),t.hasStyleObserver=!1,t.$.verticalScrollBar.hasStyleObserver=!1,t.$.horizontalScrollBar.hasStyleObserver=!1,e.freezeHeader=!0,e.freezeFooter=!0}e.isRendered?e.innerHTML&&e.innerHTML.trim().length>1?e._initDataSourceFromHTML():e._fullRefresh():(e._createElement(),setTimeout((()=>{const t=e.querySelectorAll("tr[row-id]");if(t.length>0){let a=!1;for(let l=0;l<t.length;l++){const i=t[l];e._rowHeight<i.offsetHeight&&(e._rowHeight=i.offsetHeight,a=!0)}a&&(e.style.setProperty("--jqx-table-row-height",e._rowHeight+"px"),e._refreshDataRows())}e.onLoad&&e.onLoad()}),500),e.columnMenu&&(e._initialState=e.getState()),super.render())}_initDataSourceFromHTML(){const e=this,t=e.context;e.context=e,e.hasAttribute("jqx-blazor")&&(e.$.tableContainer.innerHTML="");const a=e.columns;e.dataSource=null,e.rows=null,e.columns=null;const l=e.querySelectorAll("th");let i=[],n=[],r=[];for(let e=0;e<l.length;e++){const t=l[e].innerHTML.trim();let a={label:t,dataField:t,dataType:"string"};i.push(a),n.push(t)}if(0===l.length&&a&&a.length>0)for(let e=0;e<a.length;e++){const t=a[e];let l={label:t.label,dataField:t.dataField,dataType:t.dataType};t.width&&(l.width=t.width),t.allowResize&&(l.allowResize=t.allowResize),t.allowFilter&&(l.allowFilter=t.allowFilter),t.allowSort&&(l.allowSort=t.allowSort),t.allowHide&&(l.allowHide=t.allowHide),t.allowMenu&&(l.allowMenu=t.allowMenu),t.freeze&&(l.freeze=t.freeze),t.responsivePriority&&(l.responsivePriority=t.responsivePriority),t.columnGroup&&(l.columnGroup=t.columnGroup),i.push(l),n.push({name:t.dataField,dataType:t.dataType})}const o=e.querySelectorAll("tr");for(let e=0;e<o.length;e++){const t={},a=o[e].querySelectorAll("td");if(a.length>0){for(let e=0;e<i.length;e++)t[i[e].dataField]=a[e].innerHTML.trim();r.push(t)}}const s=new JQX.DataAdapter({dataSource:r,expandHierarchy:e.expandHierarchy,dataFields:n,id:e.dataRowId});e.$.tableContainer.innerHTML="",e.columns=i,e.context=t,e.dataSource=s}attached(){const e=this;super.attached(),e.isCompleted&&e._dialog&&(e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(e._dialog)),e.isRendered&&e.isCompleted&&e.endUpdate()}detached(){const e=this;if(super.detached(),e._focusedCell&&!e.$.tableContainer.contains(e._focusedCell)&&delete e._focusedCell,!e._dialog)return;e._detachCachedTemplates();const t=e._dialog;t.removeEventListener("change",e._dialogEventHandler),t.removeEventListener("clear",e._dialogEventHandler),t.removeEventListener("click",e._dialogEventHandler),t.removeEventListener("close",e._dialogEventHandler),t.removeEventListener("filter",e._dialogEventHandler),t.remove()}addFilter(e,t){const a=this,l=a.columnByDataField[e];"string"==typeof t?t=a.dataSource._createFilter(l.dataType,[t]):Array.isArray(t)&&(t=a.dataSource._createFilter(l.dataType,t)),l&&!1!==l.allowFilter&&t instanceof JQX.Utilities.FilterGroup!=0&&(e=l.dataField,a._clearSortByRow&&a._clearSortByRow(!0),a._designerFiltersApplied&&a._clearDesignerFilters(),a._filterInfo.appliedFilters||(a._filterInfo.appliedFilters={}),a._filterInfo.appliedFilters[e]=t,a._refreshFilters("add"),l.headerCellElement&&l.headerCellElement.setAttribute("filter",""),a.$.filterInput&&t&&!a.filterRow&&!a.columnMenu&&(a.$.filterInput.value=t.filters[t.filters.length-1].value,a._filterInfo.query=a.$.filterInput.value),a._originalDynamicColumnsOrder&&(a._originalDynamicColumnsOrder=a._dynamicColumns.map((e=>e.id))))}addGroup(e){const t=this;if(!t.grouping)return;const a=t.columnByDataField[e];if(!a||!1===a.allowGroup)return;const l=t.dataSource,i=l.groupBy;e=a.dataField,-1===i.indexOf(e)&&(i.push(e),l.refreshHierarchy(),t._getSelectableGroupRecords(),t._fullRefresh(),t._updateState("grouped"),t._doNotFireEvent||t.$.fireEvent("group",{action:"add",dataField:e}))}beginEdit(e,t){const a=this;if(!a.editing)return;const l=a.columnByDataField[t];if(t=l?l.dataField:void 0,"cell"===a.editMode&&!t||l&&!1===l.allowEdit)return;const i=a.rowById[e];if(!i)return;const n=i.data.$.id;a._editing&&a.endEdit(),a._beginEdit({rowId:n,rowObject:i,dataField:t})}cancelEdit(){const e=this,t=e._editing;if(t){for(let a=0;a<t.cells.length;a++){const l=t.cells[a];l.editor.contains(e.getRootNode().activeElement)&&e._focusCell(l.element),l.editor.remove(),e._setCellContent(l.element,e._formatCellValue(t.row,e.columnByDataField[l.dataField],l.element)),l.element.classList.remove("editing")}delete e._editing}}clearFilters(e=null){const t=this,a=t._filterInfo;(a.inputFilters||a.rowFilters||a.appliedFilters)&&(t._clearFilterInput(),t._clearRowFilters(e),delete t._filterInfo.appliedFilters,t.dataSource.virtualDataSource||t.dataSource.clearFilter(),t._fullRefresh("filter"),t._updateState("filtered"),t._doNotFireEvent||t.$.fireEvent("filter",{action:"remove"}))}clearGrouping(){const e=this,t=e.dataSource;0!==t.groupBy.length&&(t.groupBy=[],t.refreshHierarchy(),e._getSelectableGroupRecords(),e._fullRefresh(),e._updateState("grouped"),e.$.fireEvent("group",{action:"remove"}))}clearSelection(){this._clearSelection(!0)}collapseAllRows(){const e=this;e._isExpandCollapseForbidden()||(function t(a){for(let l=0;l<a.length;l++){const i=a[l];if(!i.leaf&&(i.children&&t(i.children),i.expanded)){if(e.virtualization){const t=i.$.id,a=e.rowById?e.rowById[t]:e.rows.dataItemById[t];(a.data||a).expanded=!1,e._collapsedIds[t]=!0;continue}e.collapseRow(i.$.id)}}}(e["jqx-table"===e.nodeName.toLowerCase()?"dataSource":"rows"].boundHierarchy),e.virtualization&&(e._expandedIds=[],e._expandedIdsAlt=[],e.dataSource.refreshHierarchy(),e._refreshDataRows(),e._updateState("expanded")))}collapseGroup(e){const t=this;if(!t.grouping||0===t.dataSource.groupBy.length)return;const a=t._getGroupByIndex(e);if(!a||!a.expanded)return;const l=t.$.tableContainer.querySelector(`tr[row-id="${a.$.id}"]:not([unused])`);if(!l){a.expanded=!1;let e=a.$.id;return null==e?void t.refresh():e.replace?(e=e.replace("Item","").replace(/_/gi,"."),void t.$.fireEvent("group",{action:"collapse",path:e,dataField:a.groupDataField,label:a.label})):(t.refresh(),void t.$.fireEvent("group",{action:"collapse",path:e,dataField:a.groupDataField,label:a.label}))}if(t._isCollapsed(a))return l.setAttribute("aria-expanded",!1),l.classList.remove("expanded"),void(a.expanded=!1);t._hierarchyArrowClickHandler(l)}collapseRow(e){const t=this;if(t._isExpandCollapseForbidden())return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||l.leaf||!l.expanded)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);return i?t._isCollapsed(l)?(i.setAttribute("aria-expanded",!1),i.classList.remove("expanded"),l.expanded=!1,t._expandedIds=t._expandedIds.filter((e=>e!==l.$.id)),t._updateState("expanded"),void t.$.fireEvent("collapse",{record:l})):void t._hierarchyArrowClickHandler(i):(l.expanded=!1,t._expandedIds=t._expandedIds.filter((e=>e!==l.$.id)),void t._updateState("expanded"))}collapseRowDetails(e){const t=this;if(!t.rowDetailTemplate)return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||!l)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return;const n=i.nextElementSibling;n&&n.classList.contains("jqx-table-row-detail")&&!n.classList.contains("collapsed")&&t._toggleRowDetail(i,l.$.id)}collapseAllRowDetails(){const e=this;if(!e.rowDetailTemplate||!e.dataSource)return;let t=e.dataSource.boundSource;t||(t=e.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])"));for(let a=0;a<t.length;a++)e.collapseRowDetails(t[a].$.id)}expandAllRowDetails(){const e=this;if(!e.rowDetailTemplate||!e.dataSource)return;let t=e.dataSource.boundSource;t||(t=e.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])"));for(let a=0;a<t.length;a++)e.expandRowDetails(t[a].$.id)}updateRow(e,t,a){const l=this,i=l.rowById?l.rowById[e]:l.rows.dataItemById[e];if(!i)return;const n=l._selectedIds.slice(0);l._editing=!0,l.__updatedRows=!0;let r=[];l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.toArray&&(r=l.dataSource.groupBy.toArray().slice(0));const o=l.dataSource.boundSource.canNotify;l.dataSource.boundSource.canNotify=!1;const s=e=>{if(i.data[e]=t[e],l.dataSource.id&&i&&i.data&&i.data.$&&(i.data.$.id=t[l.dataSource.id]),i&&i.data.$&&void 0!==i.data.$.index){const a=i.data.$.index,n=l.dataSource.dataSource,o=()=>{const a=t[e];if(null==a){const t=l.columnByDataField[e];return t?"number"===t.dataType?0:"boolean"!==t.dataType&&("date"===t.dataType?new Date:""):""}return a};if(n&&n[a]&&(n[a][e]=o()),l.dataSource[a]){if(r.length>0&&!l._dirtyHierarchy&&l.dataSource[a][e]!==o()&&r.indexOf(e)>=0){const e=l._getExpandedGroups(l.dataSource.boundHierarchy);l._dirtyHierarchy=e}l.dataSource[a][e]=o()}}};for(let e=0;e<l.columns.length;e++){const a=l.columns[e];void 0!==t[a.dataField]&&s(a.dataField)}if(a){const e=l.dataSource.dataFields;if(e)for(let t=0;t<e.length;t++)e[t].map?s(e[t].map):s(e[t].name)}l._editing=!1,l.dataSource.boundSource.canNotify=o,l.__updating||(l.dataSource.refreshHierarchy(),l._fullRefresh(void 0,n,"update"))}addRow(e){const t=this;let a=[];const l=t.dataSource.boundSource.canNotify;if(t.dataSource.boundSource.canNotify=!1,t._editing=!0,t.__updatedRows=!0,t.dataSource&&t.dataSource.groupBy&&t.dataSource.groupBy.toArray&&(a=t.dataSource.groupBy.toArray().slice(0),a.length>0&&t.dataSource.beginUpdate()),a.length>0)t.dataSource?t.dataSource.add(e,!0):t._addNewRow(e,0);else if(t.dataSource)if(t.dataSource.boundHierarchy&&t.$.tableContainer&&"treegrid"===t.$.tableContainer.getAttribute("role")){const a=e[t.dataSource.parentDataField];t.dataSource.add(e,a)}else t.dataSource.add(e,!0);else t._addNewRow(e,0);t.dataSource.boundSource.canNotify=l,t._editing=!1,t._updateSelectAllState(),a.length>0||t.dataSource.boundHierarchy&&t.$.tableContainer&&"treegrid"===t.$.tableContainer.getAttribute("role")?(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{t._doNotFireEvent=!0;const e=t._getExpandedGroups(t.dataSource.boundHierarchy);a.forEach((e=>t.addGroup(e))),t.dataSource.endUpdate(),t._restoreExpandedGroups(e),t._fullRefresh("update"),t._doNotFireEvent=!1}),50)):(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{t._doNotFireEvent=!0,t._fullRefresh("update"),t._doNotFireEvent=!1})))}removeRow(e){const t=this,a=t.rowById?t.rowById[e]:t.rows.dataItemById[e];if(!a){if(t.dataSource&&t.dataSource.dataItemById){const a=t.dataSource.dataItemById[e];if(a){const l=void 0!==a.$?a.$.index:0;t.dataSource.removeAt(l),t._selectedIds.indexOf(e)>=0&&(t._selectedIds.splice(t._selectedIds.indexOf(e),1),t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:"remove"})),t.virtualization&&t.__updating||t._fullRefresh("update")}}return}const l=a.data||a,i=void 0!==l.$?l.$.index:0,n=t.dataSource.boundSource.canNotify;t.dataSource.boundSource.canNotify=!1,t._editing=!0,t.__updatedRows=!0;let r=[];t.dataSource&&t.dataSource.groupBy&&t.dataSource.groupBy.toArray&&(r=t.dataSource.groupBy.toArray().slice(0),r.length>0&&t.dataSource.beginUpdate()),t._doNotFireEvent=!0,t._sortColumns&&t._sortColumns.length?t.dataSource.remove(l):t.dataSource.removeAt(i),t._selectedIds.indexOf(e)>=0&&(t._selectedIds.splice(t._selectedIds.indexOf(e),1),t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:"remove"})),t._doNotFireEvent=!1,t.dataSource.boundSource.canNotify=n,t._editing=!1,r.length>0&&(t._dataSourceUpdatingTimer&&clearTimeout(t._dataSourceUpdatingTimer),t._dataSourceUpdatingTimer=setTimeout((()=>{const e=t._getExpandedGroups(t.dataSource.boundHierarchy);r.forEach((e=>t.addGroup(e))),t.dataSource.endUpdate(),t._restoreExpandedGroups(e),t._fullRefresh("update")}),50)),t.virtualization&&t.__updating||t._fullRefresh("update")}expandRowDetails(e){const t=this;if(!t.rowDetailTemplate)return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data||a;if(!a||!l)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return;const n=i.nextElementSibling;!n&&!t.virtualization||n&&n.classList.contains("jqx-table-row-detail")&&!n.classList.contains("collapsed")||t._toggleRowDetail(i,l.$.id)}endEdit(){const e=this,t=e._editing;if(!t)return;const a=t.row,l=a.data,i=[];let n=!0;for(let a=0;a<t.cells.length;a++){const l=t.cells[a],r=e.columnByDataField[l.dataField],o=l.element,s=l.editor;let d;if(r.editor&&r.editor.template?r.editor.getValue&&(d=r.editor.getValue(s)):(d=s.value,s instanceof HTMLInputElement&&("number"===s.type?d=parseFloat(d):"date"===s.type&&(d=new Date(d),isNaN(d.getTime())&&(d=null)))),r.validation){const t=r.validation(d),a=void 0!==t&&!0!==t;if(a){let a;a="object"==typeof t&&t.message?t.message:e.localize("invalidValue"),o.setAttribute("validation-message",a)}else o.removeAttribute("validation-message");o.classList.toggle("invalid",a),n=n&&!a}i.push({column:r,newValue:d})}if(n){if(e.dataSource.virtualDataSource){const a=Object.assign({},l);for(let e=0;e<t.cells.length;e++){const l=t.cells[e],n=i[e],r=n.column;a[l.dataField]=n.newValue,r.transform&&(a[r.dataField]=r.transform(n.newValue))}for(const t of e._columns)a[t.dataField]instanceof Date&&(a[t.dataField]=a[t.dataField].toISOString().slice(0,10));e._editing.row.data=a,e._requestVirtualDataSource("update",(function(t){return t?r(!1,a):(e._editing.row.data=l,e.cancelEdit()),t}))}else r(!0,l);delete e._editing}function r(l,n){for(let r=0;r<t.cells.length;r++){const o=t.cells[r],s=i[r],d=s.column,c=o.editor;c.contains(e.getRootNode().activeElement)&&e._focusCell(o.element),c.remove(),l&&(n[o.dataField]=s.newValue,d.transform&&(n[d.dataField]=d.transform(s.newValue))),e._setCellContent(o.element,e._formatCellValue(a,d,o.element)),o.element.classList.remove("editing"),e.$.fireEvent("cellEndEdit",{id:n.$.id,row:n,value:n[o.dataField],dataField:o.dataField})}e._updateCellsWithFormulas(),"row"===e.editMode&&e.$.fireEvent("rowEndEdit",{id:n.$.id,row:n})}}expandAllRows(){const e=this;if(e._isExpandCollapseForbidden())return;e.beginUpdate();const t=e["jqx-table"===e.nodeName.toLowerCase()?"dataSource":"rows"].boundHierarchy;if(e._collapsedIds=[],t)for(let a=0;a<t.length;a++){const l=t[a],i=t=>{if(!t.leaf&&(t.expanded=!0,e._expandedIds.push(t.$.id),e._expandedIdsAlt[t.$.id]=!0,t.children))for(let e=0;e<t.children.length;e++){const a=t.children[e];i(a)}};i(l)}e.endUpdate()}isGroupExpanded(e){const t=this,a=t.dataSource;if(!t.grouping||0===a.groupBy.length)return;const l=t._getGroupByIndex(e);return!!l&&l.expanded}expandGroup(e){const t=this,a=t.dataSource;if(!t.grouping||0===a.groupBy.length)return;const l=t._getGroupByIndex(e);if(!l)return;const i=t._doNotFireEvent,n=t.animation,r=t.$.tableContainer.querySelector(`tr[row-id="${l.$.id}"]:not([unused])`);let o=!1;if(i&&(t.animation="none"),r){if(t._isCollapsed(l))if(i)o=!0;else{let e=l.parent;e&&!e.expanded&&t.expandGroup(l.parent.$.id.replace("Item","").replace(/_/g,"."))}l.expanded||(o||i?(l.expanded=!0,r.setAttribute("aria-expanded",!0),r.classList.add("expanded")):t._hierarchyArrowClickHandler(r,i)),i&&(l.expanded=!0,r.setAttribute("aria-expanded",!0),r.classList.add("expanded"),requestAnimationFrame((()=>t.animation=n)))}else if(l.expanded=!0,!l.expanded&&!i){let e=l.$.id;e=e.replace("Item","").replace(/_/gi,"."),t.$.fireEvent("group",{action:"expand",path:e,dataField:l.groupDataField,label:l.label})}}expandAllRootGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++)t[e].expanded=!0;e.endUpdate()}expandAllGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++){const a=t[e],l=e=>{if(e.expanded=!0,e.children)for(let t=0;t<e.children.length;t++){const a=e.children[t];l(a)}};l(a)}e.endUpdate()}collapseAllGroups(){const e=this;if(!e.grouping)return;e.beginUpdate();const t=e.dataSource.boundHierarchy;if(t)for(let e=0;e<t.length;e++)t[e].expanded=!1;e.endUpdate()}expandRow(e){const t=this;if(t._isExpandCollapseForbidden())return;const a=t.rowById?t.rowById[e]:t.rows.dataItemById[e],l=a.data||a;if(!a||l.leaf)return;const i=t.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused])`);if(!i)return l.expanded=!0,-1===t._expandedIds.indexOf(l.$.id)&&t._expandedIds.push(l.$.id),t._expandedIdsAlt[l.$.id]=!0,t._updateState("expanded"),void t.$.fireEvent("expand",{id:l.$.id,record:l});if(t._isCollapsed(l)){let e=l.parent;e&&!e.expanded&&t.expandRow(e.$.id)}l.expanded||t._hierarchyArrowClickHandler(i)}exportData(e,t,a,l){const i=this,n=i._columns.filter((e=>e.visible)),r=i.columnGroups,o=i.dataSource,s=getComputedStyle(i),d=s.borderRightColor,c=new JQX.Utilities.DataExporter(void 0,o.groupBy.toArray()),u={};let f,m=Array.from(i.$.tableContainer.firstElementChild.querySelectorAll("th"));if(o.virtualDataSource){f=[];for(let e=0;e<i.rows.length;e++)f.push(i.rows[e].data)}else o.boundHierarchy&&!i.grouping?(c.hierarchical=!0,f=function e(t){const l=[];return t.forEach((t=>{a&&!1===t.$.filtered||(l.push(t),t.leaf||(t._expanded=t.expanded,t.children&&(t.children=e(t.children),0===t.children.length&&(t._expanded=void 0,t.children=void 0,t.leaf=!0))))})),l}(JSON.parse(JSON.stringify(o.boundHierarchy,((e,t)=>{if("parent"!==e)return t}))))):(f=Array.from(o.toArray()),a&&(f=f.filter((e=>!1!==e.$.filtered))));c.style={border:"1px solid "+d,borderCollapse:"collapse",backgroundColor:s.backgroundColor,color:s.color,fontFamily:"Helvetica",header:{border:"1px solid "+d,fontWeight:"bold"},columns:{border:"1px solid "+d}},m=m.filter((e=>!1===e.classList.contains("jqx-table-select-all")));for(let e=0;e<n.length;e++){const t=n[e],a={},l={};let i=m[e].offsetWidth+"px";u[t.dataField]=t.label,"date"===t.dataType&&(l.format="d"),a.width=i,c.style.header[t.dataField]=a,c.style.columns[t.dataField]=l}return r?c.header={columns:n,columngroups:r}:f.unshift(u),c.exportData(f,e,t,l)}getRowIndexById(e){const t=this.rowById[e];return this.dataSource&&t&&t.data&&t.data.$?t.data.$.index:-1}getSelection(){const e=this;return 0===e._selectableGroupRecords.length?e._selectedIds.filter((e=>!(""+e).startsWith("Item"))):e._selectedIds.filter((t=>-1===e._selectableGroupRecords.indexOf(t)&&!(""+t).startsWith("Item")))}getState(){return JSON.parse(this._stringifyState())}getValue(e,t){const a=this,l=a.columnByDataField[t];if(!l)return;let i=a.rowById[e];return i?i.data[l.dataField]:(i=a.dataSource.dataItemById[e],i?i[l.dataField]:void 0)}loadState(e){const t=this;if(!e&&!(e=window.localStorage.getItem("smartTable"+t.id)))return;const a=t.stateSettings;let l=!1;if(t._loadingState=!0,"string"==typeof e&&(e=JSON.parse(e)),-1!==a.indexOf("columns")){const a=t.loadColumnStateBehavior,i=t._columns,n=[],r=e.columns;for(let e=0;e<r.length;e++){let t=Object.assign({},r[e]);const l=i.find((e=>e.dataField===t.dataField));if(!l){"implementationOnly"!==a&&n.push(t);continue}const o=l.label,s=["editor","formatFunction","templateElement","templateElementSettings","transform","validation"];"stateOnly"!==a&&s.push("label");for(let e in l)-1===s.indexOf(e)&&delete l[e];t=Object.assign(l,t),"stateOnly"!==a&&o&&(t.label=o),n.push(t)}if("stateOnly"!==a)for(let e=0;e<i.length;e++){const t=i[e];n.find((e=>e.dataField===t.dataField))||n.push(t)}t.columns=n,t._initColumns(!0),l=!0,t._formattingPanel&&(t._formattingPanel.columns=t._columns)}if(t.grouping){const a=t.dataSource,i=t.dataSource.groupBy;e.grouped=e.grouped||[],JSON.stringify(i._array)!==JSON.stringify(e.grouped)&&(t.dataSource.groupBy=e.grouped,a.refreshHierarchy(),l=!0)}else t.hasAttribute("hierarchy")&&-1!==a.indexOf("expanded")&&JSON.stringify(t._expandedIds.slice(0).sort())!==JSON.stringify(e.expanded.slice(0).sort())&&(t.collapseAllRows(),t._expandedIds=e.expanded,l=!0);-1!==a.indexOf("selected")&&e.selected.slice&&JSON.stringify(t._selectedIds.slice(0).sort())!==JSON.stringify(e.selected.slice(0).sort())&&(t._selectedIds=e.selected,l=!0),l&&(t._initRows(),t.refresh());e:if(-1!==a.indexOf("filtered")){const a=t.filtering,l=e.filtered;if(t.clearFilters(),!l)break e;if(a&&t.filterRow&&l.rowFilters){const a=t.$.tableContainer.querySelector(".jqx-table-filter-row"),l=Number(t.selection),i=e.filtered.filterRowValues;for(let e=0;e<t._columns.length;e++){const n=i[e];if(!n)continue;const r=t._columns[e].dataType,o=a.children[e+l].firstElementChild,s=t._filterInfo["string"===r?"stringConditions":"numberAndDateConditions"].find((e=>e.value===n.condition));if(-1===["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(s.value))if("date"===r){const e=new Date(n.value),t=(e.getMonth()+1).toString(),a=e.getDate().toString();o.children[0].value=`${e.getFullYear()}-${"0".repeat(2-t.length)}${t}-${"0".repeat(2-a.length)}${a}`}else o.children[0].value=n.value;o.children[1].value=s.label,o.children[1].$.input.dataValue=s.value}t._applyRowFilters()}else if(a&&l.inputFilters)t.$.filterInput.value=l.query,t._filterByAll(l.query);else if(l.appliedFilters){t._filterInfo.appliedFilters||(t._filterInfo.appliedFilters={});for(let e in l.appliedFilters){const a=l.appliedFilters[e],i=new window.JQX.Utilities.FilterGroup;a.filters.forEach(((e,t)=>{const l=i.createFilter(e.type.replace("Filter",""),e.value,e.condition);i.addFilter(a.logicalOperators[t],l)})),t._filterInfo.appliedFilters[e]=i}t._refreshFilters("add")}}-1!==a.indexOf("sorted")&&(t.clearSort(),e.sorted.forEach&&e.sorted.forEach((e=>{t.sortBy(e.dataField,e.direction)}))),a.forEach((e=>t._updateState(e,!1))),t.autoSaveState&&window.localStorage.setItem("smartTable"+t.id,t._stringifyState()),delete t._loadingState}navigateTo(e){const t=this;if(isNaN(e)||null===e)return;const a=t.pageIndex;t.pageIndex=Math.max(Math.min(Math.round(e),t.$.pager.pagesCount-1),0),t.paging&&t.pageIndex!==a&&(t._fullRefresh("pageIndexChange"),t.$.fireEvent("page",{action:"pageIndexChange"}))}removeFilter(e){const t=this,a=t.columnByDataField[e];a&&t.filterRow&&t.clearFilters(e),t._filterInfo.appliedFilters&&a&&(e=a.dataField,t._clearSortByRow&&t._clearSortByRow(!0),t._designerFiltersApplied&&t._clearDesignerFilters(e),delete t._filterInfo.appliedFilters[e],t._refreshFilters("remove"),t._originalDynamicColumnsOrder&&(t._originalDynamicColumnsOrder=t._dynamicColumns.map((e=>e.id))))}removeGroup(e){const t=this,a=t.columnByDataField[e];if(!t.grouping||!a)return;e=a.dataField;const l=t.dataSource,i=l.groupBy,n=i.indexOf(e);-1!==n&&(i.splice(n,1),l.refreshHierarchy(),t._getSelectableGroupRecords(),t._fullRefresh(),t._updateState("grouped"),t.$.fireEvent("group",{action:"remove",dataField:e}))}saveState(){const e=this._stringifyState();return window.localStorage.setItem("smartTable"+this.id,e),JSON.parse(e)}enableSelect(e){const t=this;t.selection&&t._disabledSelection.indexOf(e)>=0&&(t._disabledSelection.splice(t._disabledSelection.indexOf(e),1),t._fullRefresh("update"))}disableSelect(e){const t=this;t.selection&&(t._disabledSelection.push(e),t._fullRefresh("update"))}select(e){const t=this;t.selection&&(Array.isArray(e)?t._changeSelectionOfMultiple(e,"select"):t._selectSingle(e)&&(t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:t._interaction?"interaction":"programmatic"})))}setValue(e,t,a){const l=this,i=l.columnByDataField[t];if(!i)return;let n,r=l.rowById[e];if(r)n=r.data;else{if(r=l.dataSource.dataItemById[e],!r)return;n=r}t=i.dataField,l.dataSource._updating=!0,i.transform?(n[i.originalDataField]=a,n[t]=i.transform(a)):n[t]=a;const o=l.$.tableContainer.querySelector(`tr[row-id="${e}"]:not([unused]) td[data-field="${t}"]`);if(o&&(l._setCellContent(o,l._formatCellValue(r,i,o),o.classList.contains("tree-cell")),i.templateElement&&i.templateElementSettings)){const e=o.classList.contains("tree-cell"),t=o,a=e?t.children[0].children[1]:t,r=n.$.id;l._cachedTemplates&&l._cachedTemplates[i.dataField+"_"+r]&&(0===l._cachedTemplates[i.dataField+"_"+r].innerHTML.length?delete l._cachedTemplates[i.dataField+"_"+r]:(a.innerHTML="",a.appendChild(l._cachedTemplates[i.dataField+"_"+r]))),i.templateElementSettings(n[i.dataField],r,a.firstElementChild),l._cachedTemplates||(l._cachedTemplates=[]),l._cachedTemplates[i.dataField+"_"+r]||(l._cachedTemplates[i.dataField+"_"+r]=a.firstElementChild)}l._updateCellsWithFormulas(),delete l.dataSource._updating}unselect(e){const t=this;t.selection&&(Array.isArray(e)?t._changeSelectionOfMultiple(e,"unselect"):t._unselectSingle(e)&&(t._updateSelectAllState(),t._updateState("selected"),t.$.fireEvent("change",{type:t._interaction&&-1===t._disabledSelection.indexOf(e)?"interaction":"programmatic"})))}set scrollTop(e){const t=this;t.isRendered&&(e=parseInt(e),isNaN(e)||((t.virtualization?t.$.virtualizationContainer:t.$.container).scrollTop=e))}get scrollTop(){const e=this;return e.isRendered?(e.virtualization?e.$.virtualizationContainer:e.$.container).scrollTop:0}set scrollLeft(e){const t=this;t.isRendered&&(e=parseInt(e),isNaN(e)||((t.virtualization?t.$.virtualizationContainer:t.$.container).scrollLeft=e))}get scrollLeft(){const e=this;return e.isRendered?(e.virtualization?e.$.virtualizationContainer:e.$.container).scrollLeft:0}clearContent(){const e=this;for(;e.$.tableContainer.firstChild;)e.$.tableContainer.removeChild(e.$.tableContainer.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.tableContainer);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let a=document.createElement("div");t.appendChild(a),e.content instanceof HTMLElement?a.appendChild(e.content):a.innerHTML=e.content;let l=Array.from(a.childNodes);a.parentNode.removeChild(a);for(let e=0;e<l.length;e++)t.appendChild(l[e]);e.clearContent(),e.$.tableContainer.appendChild(t)}propertyChangedHandler(e,t,a){const l=this;if(super.propertyChangedHandler(e,t,a),"innerHTML"!==e)switch(e){case"animation":case"theme":if("theme"===e){const e=getComputedStyle(l);l._defaults.text=l._toHex(e.color),l._defaults.highlight=l._toHex(e.backgroundColor)}if(l.filterRow){const t=l.$.tableContainer.querySelector(".jqx-table-filter-row");Array.from(t.querySelectorAll("jqx-input, jqx-button")).forEach((t=>t[e]=a))}i(e,a);break;case"autoSaveState":a&&window.localStorage.setItem("smartTable"+l.id,l._stringifyState());break;case"columnGroups":a&&(l.columnResize&&(l.columnResize=!1),"auto"===l.columnSizeMode&&(l.removeAttribute("resize-max-reached"),l.columnSizeMode="default")),l.refresh();break;case"columnMinWidth":if(isNaN(parseFloat(a)))return void(l.columnMinWidth=t);l._handleAutoSizeMode(),l._handleFrozenColumnPositions(),l._refreshHorizontalScrollbar();break;case"columnResize":a&&l.columnGroups&&(l.columnResize=!1);break;case"columnResizeNormalize":l._columns&&l._columns.length>0&&""===l._columns[l._columns.length-1].dataField&&(l._columns.pop(),l.columns.pop()),l._initColumns(!0),l.refresh();break;case"columns":{l._conditionalFormatting&&delete l._conditionalFormatting;const e=l._sortColumns,t=l._filterInfo;if(l._clearFilterInput(),l._clearRowFilters(),delete l._filterInfo.appliedFilters,l._sortColumns=[],l._initColumns(!0),l.refresh(),l._formattingPanel&&(l._formattingPanel.columns=l._columns),l.dataSource.dataFields){let a=l.dataSource.dataFields||[];const i=l.columns;let n=!1;if(i.forEach((e=>{if(e.dataType){const t=a.find((t=>t.name===e.dataField));t?t.dataType=e.dataType:e.map?a.find((t=>e.map.indexOf(t.name)>=0?t:null))&&(l.dataSource.dataFields.push({name:e.dataField,map:e.map,dataType:e.dataType}),n=!0):(l.dataSource.dataFields.push({name:e.dataField,dataType:e.dataType}),n=!0)}})),n&&l.dataSource.dataBind){let a=[],i=[];if(l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.toArray&&(a=l.dataSource.groupBy.toArray().slice(0)),a.length>0&&(i=l._getExpandedGroups(l.dataSource.boundHierarchy)),l.dataSource.bindingCompleted=!1,l.dataSource.dataBind(),l._doNotFireEvent=!0,a.length>0&&(a.forEach((e=>l.addGroup(e))),l.dataSource.boundHierarchy&&l.dataSource.refreshHierarchy(),l._restoreExpandedGroups(i)),t.inputFilters?l._filterByAll(t.query):t.rowFilters?l._applyRowFilters():t.appliedFilters&&l._refreshFilters(),e&&(l._sortColumns=[],e.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)}))),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}l.virtualization&&setTimeout((()=>{const e=l.columns&&l.columns.length>0?l.columns[0].dataField:"";if(e){const t=l.querySelector('td[data-field="'+e+'"]');t&&l._rowHeight<t.offsetHeight&&(l._rowHeight=t.offsetHeight,l.style.setProperty("--jqx-table-row-height",l._rowHeight+"px"),l._refreshDataRows())}}),300),delete l._doNotFireEvent}else t.inputFilters?l._filterByAll(t.query):t.rowFilters?l._applyRowFilters():t.appliedFilters&&l._refreshFilters(),e&&(l._sortColumns=[],e.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)})))}break}case"columnSizeMode":if("auto"===a){if(l.columnGroups)return void(l.columnSizeMode="default");l._handleAutoSizeMode()}else l.removeAttribute("resize-max-reached"),l._columns.forEach((e=>{e.visible&&(e._isResponsive?e.headerCellElement.style.width=e.width||e._manualPercentageWidth?l._getColumnWidth(e.width||e._manualPercentageWidth,!0,e):null:e.headerCellElement.style.width=e.width||e._manualWidth?l._getColumnWidth(e.width||e._manualWidth,!0,e):null)}));l._handleFrozenColumnPositions(),l._refreshHorizontalScrollbar();break;case"conditionalFormatting":l._applyInitialConditionalFormatting(l.dataSource),l._refreshDataRows();break;case"conditionalFormattingButton":l.$.header.classList.toggle("jqx-hidden",(!l.filtering||l.filterRow)&&!a),!a&&l._dialog&&l._dialog.close();break;case"dataSource":case"dataSourceSettings":{const i=l._sortColumns,n=l._filterInfo;if("dataSource"===e&&null===a&&(l.dataSource=[]),"dataSource"===e&&t&&a&&l.virtualization&&!document.hidden&&t instanceof JQX.DataAdapter&&t.length===a.length&&t.length>0&&a.length>0&&!l.dataSourceSettings.parentDataField&&!t.parentDataField){if(l.dataSource=t,l._cachedDataSource===a)return;l.beginUpdate();for(let e=0;e<a.length;e++){const t=a[e],i=l.dataSource[e].$.id;l.updateRow(i,t,!0)}return i?l.endUpdate(!0,!0):l.endUpdate(void 0,!0),void(l._cachedDataSource=a)}const r=l.$.virtualizationContainer?l.$.virtualizationContainer.scrollTop:0,o=void 0!==l.$.virtualizationContainer&&l.$.virtualizationContainer.$?l.$.virtualizationContainer.$.verticalScrollBar:null;o&&o.beginUpdate();let s=[];if(t&&t.groupBy&&t.groupBy.toArray&&(s=t.groupBy.toArray().slice(0)),l._dataBind(!0),l._doNotFireEvent=!0,s.length>0){const e=l._getExpandedGroups(t.boundHierarchy);if(l.__updating=!0,l.dataSource._groupBy&&(l.dataSource._groupBy.canNotify=!1),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),s.forEach((e=>l.addGroup(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}else s.forEach((e=>l.addGroup(e)));l.dataSource.boundHierarchy&&l.dataSource.refreshHierarchy(),l.dataSource._groupBy&&(l.dataSource._groupBy.canNotify=!0),l.__updating=!1,l._restoreExpandedGroups(e),l._fullRefresh("update")}else if(l.dataSource.boundHierarchy&&l.dataSource.boundHierarchy.length&&t&&t.toArray){const e=t.toArray();for(let t=0;t<e.length;t++){const a=e[t];a.expanded&&(l._expandedIdsAlt[a.$.id]=!0,l._expandedIds.push(a.$.id))}if(l.expandHierarchy){if(l.dataSource&&l.dataSource.toArray){const e=l.dataSource.toArray();for(let t=0;t<e.length;t++){const a=e[t];a.expanded&&(l._expandedIdsAlt[a.$.id]=!0,l._expandedIds.push(a.$.id))}}l._expandedIds=l._expandedIds.filter((e=>!l._collapsedIds||!l._collapsedIds[e])),Object.keys(l._collapsedIds).forEach((e=>{delete l._expandedIdsAlt[e]}))}const a=(e,t,l)=>{const i=this;for(let n=t;n<l;n++){const t=e[n];if(!t)break;t.leaf||(i._expandedIdsAlt[t.$.id]?t.expanded=!0:(t.expanded,t.expanded=!1),t.children.length&&!1!==t.$.filtered&&a(t.children,0,t.children.length))}};a(l.dataSource.boundHierarchy,0,l.dataSource.boundHierarchy.length),l._fullRefresh("update")}if(n.inputFilters?l._filterByAll(n.query):n.rowFilters?l._applyRowFilters():n.appliedFilters&&l._refreshFilters(),i&&(l._sortColumns=[],i.forEach((e=>{l.columnByDataField[e.dataField].sortOrder=null,l.sortBy(e.dataField,e.direction)}))),l._selectedIds.length>0){const e=JSON.stringify(l._selectedIds.slice(0).sort()),t=l.dataSource;l._selectedIds=l._selectedIds.filter((e=>void 0!==t.dataItemById[e]||-1!==l._selectableGroupRecords.indexOf(e))),e!==JSON.stringify(l._selectedIds.slice(0).sort())&&(l._updateSelectAllState(),l._updateState("selected"),l.$.fireEvent("change",{type:"remove"}))}l.virtualization&&(setTimeout((()=>{const e=l.columns&&l.columns.length>0?l.columns[0].dataField:"";if(e){const t=l.querySelector('td[data-field="'+e+'"]');t&&l._rowHeight<t.offsetHeight&&(l._rowHeight=t.offsetHeight,l.style.setProperty("--jqx-table-row-height",l._rowHeight+"px"),l._refreshDataRows())}}),300),l.$.virtualizationContainer.scrollTop=r,o&&(o.endUpdate(),l._onVerticalChange({detail:{value:o.value}},!0))),delete l._doNotFireEvent;break}case"disabled":case"unfocusable":case"keyboardNavigation":l._setFocusable(),i("unfocusable",l.disabled||l.unfocusable||!l.keyboardNavigation),"disabled"===e&&l._dialog&&l._dialog.close();break;case"hideSelectionColumn":l.refresh();break;case"columnMenu":l.$.header.classList.toggle("jqx-hidden",(!l.filtering||l.filterRow||l.columnMenu)&&!l.conditionalFormattingButton),l.columnMenu&&(l._initialState=l.getState()),l.refresh();break;case"editing":a?l.$.tableContainer.removeAttribute("aria-readonly"):l.$.tableContainer.setAttribute("aria-readonly",!0);break;case"filtering":l.columnMenu||l.$.header.classList.toggle("jqx-hidden",(!a||l.filterRow)&&!l.conditionalFormattingButton),a&&l.filterRow?l._createFilterRow():!1===a&&(l.filterRow&&l.$.tableContainer.querySelector(".jqx-table-filter-row").remove(),(l._filterInfo.query||l._filterInfo.rowFilters||l._filterInfo.appliedFilters)&&l.clearFilters()),l.virtualization&&l.refresh();break;case"filterRow":if(l.$.header.classList.toggle("jqx-hidden",(!l.filtering||a)&&!l.conditionalFormattingButton),!l.filtering)return;a?l._createFilterRow():(l.$.tableContainer.querySelector(".jqx-table-filter-row").remove(),l._filterInfo.rowFilters&&l.clearFilters());break;case"filterTemplate":l._applyFilterTemplate();break;case"footerRow":{const e=l.$.tableContainer.querySelector("tfoot");e&&e.remove(),a&&l._createFooterRow();break}case"formulas":a?l._formulaParser=new JQX.FormulaParser(l):delete l._formulaParser,l._updateCellsWithFormulas(!0);break;case"freezeHeader":case"freezeFooter":l.virtualization&&(l[e]=!0);break;case"grouping":a||l.clearGrouping();break;case"headerRow":{const e=Array.from(l.$.tableContainer.firstElementChild.children);for(let t=1;t<e.length;t++)e[t].remove();a&&l._createCustomHeaderRow();break}case"locale":case"messages":{const e=l._dialog;if(l._localize(),l.filterRow){const e=l.$.tableContainer.querySelector(".jqx-table-filter-row"),t=Array.from(e.querySelectorAll("jqx-input.string-filter")),a=Array.from(e.querySelectorAll("jqx-input.num-date-filter")),i=Array.from(e.querySelectorAll("jqx-button"));t.concat(a).forEach((e=>e.title=l.localize("filterCondition"))),t.forEach((e=>{e.dataSource=l._filterInfo.stringConditions,void 0===e.$.input.dataValue?e.value=l.localize("CONTAINS"):e.value=l._filterInfo.stringConditions.find((t=>t.value===e.$.input.dataValue)).label})),a.forEach((e=>{e.dataSource=l._filterInfo.numberAndDateConditions,void 0===e.$.input.dataValue?e.value=l.localize("EQUAL"):e.value=l._filterInfo.numberAndDateConditions.find((t=>t.value===e.$.input.dataValue)).label})),i.forEach((e=>e.title=l.localize("clearFilter")))}e&&(e.$.footer.firstElementChild.innerHTML=l.localize("ok"),e.$.footer.children[1].innerHTML=l.localize("cancel"),e.classList.contains("conditional-formatting")?e.label=l.localize("conditionalFormatting"):e.classList.contains("drill-down")&&(e.label=l.localize("details"))),l._formattingPanel&&(l._formattingPanel.messages=l.messages,l._formattingPanel.locale=l.locale),Array.from(l.$.tableContainer.querySelectorAll(".group-label-value>.placeholder")).forEach((e=>{e.textContent=l.localize("EMPTY")}));break}case"pageIndex":l.pageIndex=Math.max(Math.min(Math.round(a),l.$.pager.pagesCount-1),0),l.paging&&l.pageIndex!==t&&(l._fullRefresh("pageIndexChange"),l.$.fireEvent("page",{action:"pageIndexChange"}));break;case"pageSize":l.paging&&(l._fullRefresh("pageSizeChange"),l.$.fireEvent("page",{action:"pageSizeChange"}));break;case"paging":if(!1===a){if(l.dataSource.virtualDataSource)return void(l.paging=!0);if(1===l.$.pager.pagesCount)return}l._fullRefresh();break;case"rowDetailTemplate":l._fullRefresh();break;case"rightToLeft":Array.from(l.$.tableContainer.querySelectorAll(".freeze-near, .freeze-far")).forEach((e=>{e.style.left=null,e.style.right=null,e.style.zIndex=null})),l._handleFrozenColumnPositions(),i("rightToLeft",a);break;case"selected":{const e=l._selectedIds.slice(0);l._clearSelection(),l._changeSelectionOfMultiple(a,"select","programmatic",e);break}case"selection":if(l.filterRow){const e=l.$.tableContainer.querySelector(".jqx-table-filter-row");a?e.insertBefore(document.createElement("td"),e.firstElementChild):e.firstElementChild.remove()}l.refresh(),a?(l.$.tableContainer.setAttribute("aria-multiselectable",!0),l._updateSelectAllState()):l.$.tableContainer.removeAttribute("aria-multiselectable");break;case"selectionMode":{l.$.tableContainer.classList.remove("jqx-unselectable");const e=l.querySelector(".jqx-table-select-all");e&&("one"===l.selectionMode?e.classList.add("jqx-visibility-hidden"):e.classList.remove("jqx-visibility-hidden"));break}case"sortMode":"none"===a&&l.clearSort();break;case"tooltip":if(!a){const e=l.$.tableContainer.querySelector(".tooltip");e&&(e.classList.remove("tooltip"),e.removeAttribute("title"))}break;case"virtualization":l.virtualization=t}else l._initDataSourceFromHTML();function i(e,t){const a=[];l._dialog&&a.push(l._dialog,l._dialog.$.footer.firstElementChild,l._dialog.$.footer.children[1]),l._formattingPanel&&a.push(l._formattingPanel),a.forEach((a=>a[e]=t))}}_createElement(){const e=this;if(e._expandedRowDetailIds=[],e._editors={},isNaN(parseFloat(e.columnMinWidth))&&(e.columnMinWidth="50px"),e.columnGroups&&(e.columnResize=!1,e.columnSizeMode="default"),e.formulas&&(e._formulaParser=new JQX.FormulaParser(e)),e._setupPagingAndFiltering(),e._localize(),e._selectedIds=e.selected.slice(0),"one"===e.selectionMode){e._selectedIds=e._selectedIds.slice(0,1);const t=e.querySelector(".jqx-table-select-all");t&&t.classList.add("jqx-visibility-hidden")}e._dataBind(),e.editing||e.$.tableContainer.setAttribute("aria-readonly",!0),e.autoLoadState&&e.loadState(),e.autoSaveState&&window.localStorage.setItem("smartTable"+e.id,e._stringifyState())}_initColumns(e){const t=this,a=t.columns;if(!t.isRendered&&t.dataSource.length>0&&(!a||Array.isArray(a)&&0===a.length)&&(t.columns=t.dataSource.dataFields.map((e=>({label:e.name,dataField:e.name,dataType:e.dataType})))),t._filterInfo.stringDataFields=[],t._columns=[],t.columnByDataField={},t.columns.canNotify=!1,t.columns instanceof JQX.ObservableArray){const e=[];for(let a=0;a<t.columns.length;a++){let l=t.columns[a],i={};for(let e in l)i[e]=l[e];e.push(i)}t.columns=e}for(let a=0;a<t.columns.length;a++){let l=t.columns[a];if("string"==typeof l&&t.dataSource.dataFields){const e=t.dataSource.dataFields.find((e=>{if(e.name===l)return e}));l={label:l,dataField:l,dataType:e&&e.dataType||"string"}}void 0===l.label&&void 0===l.dataField||(void 0===l.label&&(l.label=l.dataField),void 0===l.dataField&&(l.dataField=l.label),l.dataType||(l.dataType="string"),"string"!==l.dataType&&"number"!==l.dataType||!1===l.allowFilter||!l.dataField||t._filterInfo.stringDataFields.push(l.dataField),l.visible=void 0===l.visible||!!l.visible,l.allowResize=void 0===l.allowResize||!!l.allowResize,t._transformColumnDataField(l,e),l.thHierarchy=[],t._columns.push(l),t.columnByDataField[l.dataField]=l)}if("default"===t.columnSizeMode&&t.selection){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width){e=!1,l._isResponsive=!0,l._isFillRemainingWidth=!0;break}}(!t.columnResizeNormalize&&e||t.columnResizeNormalize&&e)&&t._columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1})}else if("default"===t.columnSizeMode&&!t.selection&&t.columnResizeNormalize){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width){e=!1,l._isResponsive=!0,l._isFillRemainingWidth=!0;break}}e&&t._columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1})}t.columns=new JQX.ObservableArray(t._columns),t._updateState("columns"),t.columns.notify((function(e){if(!t.columns.canNotify)return;if("length"===e.action||"update"===e.action&&-1!==["allowGroup","allowSort","sortOrder"].indexOf(e.propertyName))return void t._updateState("columns");const a=e.target;if("update"===e.action){const l=a.dataField;if("allowEdit"===e.propertyName)return Array.from(t.$.tableContainer.querySelectorAll(`td[data-field="${l}"]`)).forEach((t=>{t.classList.toggle("no-edit",!1===e.newValue),!1===e.newValue?t.setAttribute("aria-readonly",!0):t.removeAttribute("aria-readonly")})),void t._updateState("columns");if("allowFilter"===e.propertyName)return"string"!==a.dataType&&"number"!==a.dataType||!l||(!1===e.newValue?t._filterInfo.stringDataFields=t._filterInfo.stringDataFields.filter((e=>e!==l)):!1===e.oldValue&&t._filterInfo.stringDataFields.push(l)),t.filterRow&&t.$.tableContainer.querySelector(`.jqx-table-filter-row td[filter-for="${l}"]`).classList.toggle("no-filter",!1===e.newValue),"jqx-pivot-table"===t.nodeName.toLowerCase()&&t._columnNotify(e),void t._updateState("columns");if("transform"===e.propertyName)a.sortOrder&&t.sortBy(a.dataField,null),t._transformColumnDataField(a,!0);else{if(-1!==["allowPivot","allowRowGroup","pivot","rowGroup","summary"].indexOf(e.propertyName)&&"jqx-pivot-table"===t.nodeName.toLowerCase())return t._columnNotify(e),void t._updateState("columns");if("visible"===e.propertyName){const e=t._expandedRowDetailIds,a=t.$.tableContainer;let l;return t.filterRow&&(l=a.querySelector(".jqx-table-filter-row"),l&&l.remove()),e&&e.length&&!t._columns.some((e=>e.visible))&&e.forEach((e=>t._toggleRowDetail(a.querySelector(`[row-id="${e}"]`),e))),t.$.tableContainer.setAttribute("aria-colcount",t._columns.filter((e=>e.visible)).length+ +t.selection),t.refresh(),void t._updateState("columns")}}}"add"===e.action&&(t.columns[t.columns.length-1].visible=!0),t._columns=t.columns._array,t.columnByDataField=[],t._columns.forEach((e=>{t.columnByDataField[e.dataField]=e,e.originalDataField&&(t.columnByDataField[e.originalDataField]=e)})),t.refresh(!0),t._updateState("columns")})),t.$.tableContainer.setAttribute("aria-colcount",t._columns.filter((e=>e.visible)).length+ +t.selection)}_transformColumnDataField(e,t){const a=this;if("function"==typeof e.transform){if(!a.isRendered||t){const l=a.dataSource,i=a.columns.canNotify;i&&(a.columns.canNotify=!1),t&&e.originalDataField&&(delete a.columnByDataField[e.dataField],e.dataField=e.originalDataField);const n=e.dataField,r=n+"Transformed";a.columnByDataField[n]=e,e.originalDataField=n,e.dataField=r,l.canNotify=!1;for(let t=0;t<l.length;t++){const a=l[t];a[r]=e.transform(a[n])}i&&(a.columns.canNotify=!0),l.canNotify=!0}}else e.transform&&(e.transform=void 0)}_initRows(){const e=this,t=e.dataSource,a=e.context;if(e.context=e,e.rows=[],e.rowById=[],t.virtualDataSource)return e._initRowsVirtualDataSource(),void(e.context=a);if(t.boundHierarchy)return e.$.tableContainer.setAttribute("role","treegrid"),e.setAttribute("hierarchy",""),e._initHierarchicalRows(),void(e.context=a);e.$.tableContainer.setAttribute("role","grid");let l=0,i=t.length,n=!1;if(e.removeAttribute("hierarchy"),e.paging){const a=e.pageSize;if(e._filterInfo.query||e._filterInfo.rowFilters||e._filterInfo.appliedFilters){let e=0;for(let a=0;a<i;a++)!1!==t[a].$.filtered&&e++;i=e,n=!0}const r=Math.max(Math.ceil(i/a),1);e.$.pager.pagesCount=r,e.$.pager.totalRecords=i,e.pageIndex=Math.max(Math.min(e.pageIndex,r-1),0),l=e.pageIndex*a,i=l+a}if(n){let a=-1;for(let n=0;n<t.length;n++){const r=t[n];if(r&&!1!==r.$.filtered){if(a++,a<l)continue;if(a>=i)break;e._addNewRow(r,n)}}}else for(let a=l;a<i;a++){const l=t[a];l&&!1!==l.$.filtered&&e._addNewRow(l,a)}e._observeRows(),e.context=a}_initRowsVirtualDataSource(){const e=this,t=e.dataSource;if(t.boundHierarchy)e.$.tableContainer.setAttribute("role","treegrid"),e.setAttribute("hierarchy",""),e._processHierarchy(t.boundHierarchy,0,t.boundHierarchy.length);else for(let a=0;a<t._dataSource.length;a++){const l=t[a];l&&!1!==l.$.filtered&&e._addNewRow(l,a)}if(e.paging){const a=t.length,l=e.pageSize,i=Math.max(Math.ceil(a/l),1),n=e.$.pager.pagesCount;if(e.$.pager.pagesCount=i,e.$.pager.totalRecords=a,e.pageIndex=Math.max(Math.min(e.pageIndex,i-1),0),null!==n&&n!==i)return void e._fullRefresh()}e._observeRows()}_initHierarchicalRows(){const e=this,t=e.dataSource.boundHierarchy;let a=0,l=t.length,i=!1;if(e.paging){const n=e.pageSize;if(e._filterInfo.query||e._filterInfo.rowFilters||e._filterInfo.appliedFilters){let e=0;for(let a=0;a<l;a++)!1!==t[a].$.filtered&&e++;l=e,i=!0}const r=Math.max(Math.ceil(l/n),1);e.$.pager.pagesCount=r,e.$.pager.totalRecords=l,e.pageIndex=Math.max(Math.min(e.pageIndex,r-1),0),a=e.pageIndex*n,l=a+n}if(i){let i=-1;for(let n=0;n<t.length;n++){const r=t[n];if(r&&!1!==r.$.filtered){if(i++,i<a)continue;if(i>=l)break;e._processHierarchy(t,n,n+1)}}}else e._processHierarchy(t,a,l);e._observeRows()}_processHierarchy(e,t,a){const l=this;for(let i=t;i<a;i++){const t=e[i];if(!t)break;t.leaf?t&&!1!==t.$.filtered&&l._addNewRow(t,i):(l._expandedIdsAlt[t.$.id]?t.expanded=!0:void 0===t.expanded&&(t.expanded=!1),!1!==t.$.filtered&&l._addNewRow(t,i),t.children.length&&!1!==t.$.filtered&&l._processHierarchy(t.children,0,t.children.length))}}_observeRows(){const e=this;e.rows=new JQX.ObservableArray(e.rows),e.rows.notify((function(t){if(!e.rows.canNotify||t.path||!e.dataSource)return;e.rows.canNotify=!1;const a=t.action,l=e._selectedIds.slice(0);switch(e.dataSource.canNotify=!1,a){case"add":{const a={};e.dataSource.dataFields.forEach((e=>a[e.name]=""));const l=Object.assign(a,e.rows[t.index]);e.dataSource.add(e.rows[t.index]),e._editing={row:{data:l}};break}case"update":e.dataSource.update(t.index,e.rows[t.index]),e._editing={row:{data:e.rows[t.index]}};break;case"remove":{const a=t.removed[0].data,l=a.$.id,i=e._selectedIds.indexOf(l);e.dataSource.removeAt(a.$.index),delete e.rowById[l],-1!==i&&e._selectedIds.splice(i,1),e._editing={row:t.removed[0]},e._updateSelectAllState();break}}e._fullRefresh(a,l,a),delete e._editing,e.dataSource.canNotify=!0,e.rows.canNotify=!0}))}beginUpdate(){const e=this;if("jqx-table"!==e.nodeName.toLowerCase())return;e.__updating=!0,e.__updatedRows=!1;const t=window.__karma__||window.karma;document.hidden&&!t||(e._dirtyHierarchy=!1,e.__updatingOldSelectedIds=e._selectedIds.slice(0),e.__updatingSortColumns=e._sortColumns,e.dataSource&&e.dataSource.clearSort&&e.dataSource.clearSort())}endUpdate(e,t){const a=this;if("jqx-table"!==a.nodeName.toLowerCase())return;a.__updating=!1;const l=window.__karma__||window.karma;if(document.hidden&&!l)return;if(!1===e)return;l&&(t=!0);const i=()=>{const t=a.__updatingOldSelectedIds?a.__updatingOldSelectedIds:a._selectedIds.slice(0);a.__updatingOldSelectedIds&&delete a.__updatingOldSelectedIds,a._dirtyHierarchy&&a.dataSource.refreshHierarchy();const l=a._sortColumns,i=a._filterInfo,n=a.dataSource.groupBy._array.slice(0),r=void 0!==a.$.virtualizationContainer&&a.$.virtualizationContainer.$?a.$.virtualizationContainer.$.verticalScrollBar:null;if(r&&r.beginUpdate(),a._doNotFireEvent=!0,a._fullRefresh("update",t,"update"),n.length>0){let e=a._getExpandedGroups(a.dataSource.boundHierarchy);a._dirtyHierarchy&&(e=a._dirtyHierarchy),n.forEach((e=>a.addGroup(e))),a._restoreExpandedGroups(e)}i.inputFilters?a._filterByAll(i.query):i.rowFilters?a._applyRowFilters():i.appliedFilters&&a._refreshFilters(),l&&(a.__updatingSortColumns&&JSON.stringify(a.__updatingSortColumns)!==JSON.stringify(l)||0===n.length||!0===e||!1===a.__updatedRows)&&(a._sortColumns=[],l.forEach((e=>{a.columnByDataField[e.dataField].sortOrder=null,a.sortBy(e.dataField,e.direction)}))),r&&(r.endUpdate(),a._onVerticalChange({detail:{value:r.value}},!0),a._dirtyHierarchy&&(a._rowsInDOM.length<a.rows.length&&0===a.$.virtualizationContainer.$.verticalScrollBar.max&&a._refreshDataRows(),a._dirtyHierarchy=!1)),a.onUpdateComplete&&a.onUpdateComplete(a.rows),delete a._doNotFireEvent};if(a._verticalScrollTimer)return a._scheduleUpdate&&clearInterval(a._scheduleUpdate),void(a._scheduleUpdate=setInterval((function(){a._verticalScrollTimer||(i(),clearInterval(a._scheduleUpdate),delete a._scheduleUpdate)}),100));t?i():requestAnimationFrame((()=>{i()}))}_addNewRow(e,t){const a=this,l=e.$.id,i=new JQX.Observable({data:e,boundIndex:t});-1!==a._disabledSelection.indexOf(l)&&(i.allowSelect=!1),i.canNotify=!0,i.notify((function(t){if(a._editing||a._hierarchyChange)return;const i=a.selection;if("allowSelect"===t.propertyName){const n=a._disabledSelection.indexOf(l);if(a._hierarchyChange=!0,t.newValue||-1!==n)t.newValue&&-1!==n&&function e(t){const l=t.$.id,n=a.$.tableContainer.querySelector(`[row-id="${l}"]:not([unused])`),r=a.rowById[l];if(t.parent&&-1!==a._disabledSelection.indexOf(t.parent.$.id))r.allowSelect=!1;else if(a._disabledSelection.splice(a._disabledSelection.indexOf(l),1),n&&(n.classList.remove("disable-select"),i&&(n.setAttribute("aria-selected",!1),n.firstElementChild.firstElementChild.removeAttribute("aria-disabled"))),r&&(r.allowSelect=!0),t.children)for(let a=0;a<t.children.length;a++)e(t.children[a])}(e);else{const t=[];!function e(t,l){const n=t.$.id,r=a.$.tableContainer.querySelector(`[row-id="${n}"]:not([unused])`),o=a.rowById[n];if(l.push(n),r&&(r.removeAttribute("aria-selected"),r.classList.add("disable-select"),i&&r.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),o&&(o.allowSelect=!1),t.children)for(let a=0;a<t.children.length;a++)e(t.children[a],l)}(e,t),a._disabledSelection=a._disabledSelection.concat(t),a.unselect(t)}delete a._hierarchyChange}})),a.rowById[l]=i,a.rows.push(i)}refresh(){const e=this;if(e.__updating)return;const t=e._columns.filter((e=>e.visible)),a=e.$.tableContainer,l=a.querySelector(".jqx-table-filter-row"),i=a.querySelector("tfoot"),n=document.createElement("tbody"),r=e._getFractionOfMax(),o=e.virtualization?e.$.virtualizationContainer:e.$.tableContainer.parentElement,s={top:o.scrollTop,left:o.scrollLeft};for(e.columns.canNotify=!1;a.childNodes.length>0;)a.childNodes[0].remove();e._createTableHeader(),e.isRendered||!e.onInit||e._loadingState||e.onInit(),e._createCustomHeaderRow(),e._createFooterRow(i),e._createDataRows(n),e._createFilterRow(l);const d=a.querySelectorAll("th[data-field]");for(let a=0;a<t.length;a++){const l=t[a];l.headerCellElement=d[a],l.headerCellElement&&(l.headerCellElement.onclick=function(){const t=this.dataField;e.$.fireEvent("columnClick",{dataField:t}),e.closeColumnMenu(),"none"===e.sortMode||!1===l.allowSort||e._preventClickSort||(e._addSortIconContainer(this),e._sortOnClick=!0,this.headerCellElement.sortIconContainerElement.classList.contains("asc")?e.sortBy(t,"desc"):this.headerCellElement.sortIconContainerElement.classList.contains("desc")?e.sortBy(t,null):e.sortBy(t,"asc"),e._sortOnClick=!1)}.bind(l))}if(e._sortColumns&&e._sortColumns.length>0)for(let t=0;t<e._sortColumns.length;t++){const a=e._sortColumns[t],l=e.columnByDataField[a.dataField];e._addSortIconContainer(l,a.direction,t+1)}e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),e.isRendered&&(e.selection&&e._updateSelectAllState(),e._setFractionOfMax(r)),[o.scrollTop,o.scrollLeft]=[s.top,s.left],e.columns.canNotify=!0}_createTableHeader(){const e=this,t=e.selection,a=document.createElement("thead"),l=e._columns.filter((e=>e.visible)),i=e._getColumnHeaderStructure(),n=window.innerWidth,r={};for(let o=0;o<i;o++){const s=document.createElement("tr"),d=document.createDocumentFragment();t&&(s.innerHTML=o<i-1?'<th class="empty"></th>':'<th class="jqx-table-select-all freeze-near" scope="col" aria-colindex="1"><div role="checkbox" aria-checked="false" aria-label="Toggle selection of all rows"></div></th>',e.virtualization&&s.querySelector("th").classList.add("sticky")),o<i-1&&s.classList.add("column-groups-header");for(let a=0;a<l.length;a++){const s=l[a];if(0===o&&(s.width&&isNaN(parseFloat(s.width))&&delete s.width,s.responsivePriority&&("number"!=typeof s.responsivePriority&&(s.responsivePriority=1),s.responsivePriority=Math.max(Math.min(Math.round(s.responsivePriority),5),1),i>1&&(r[a]=e._isColumnHidden(s.responsivePriority,n)))),o<i-1){if(r[a])continue;const t=l[a],i=t.headerStructure[o];if(a>0){let r=a-1,s=l[r];for(;s&&e._isColumnHidden(s.responsivePriority,n);)r--,s=l[r];if(s&&i===s.headerStructure[o]&&e._areColumnsWithSameFreezeSettings(t,s))continue}const s=document.createElement("th");if(s.includes=[t],a<l.length-1){let r=1,d=a+1,c=l[d];for(;c;){if(!e._isColumnHidden(c.responsivePriority,n)){if(i!==c.headerStructure[o]||!e._areColumnsWithSameFreezeSettings(t,c))break;r++,s.includes.push(c)}d++,c=l[d]}s.colSpan=r}0!==o&&t.headerStructure[o-1]===i||(s.textContent=i),s.includes.forEach((e=>e.thHierarchy[o]=s)),s.classList.add("column-header"),t.freeze&&s.classList.add("freeze-"+("far"===t.freeze?"far":"near")),e.virtualization&&s.classList.add("sticky"),d.appendChild(s)}else e._setupColumnHeaderCell(t,d,a,s)}s.appendChild(d),a.appendChild(s),e._tableHeader=a}if(e.$.tableContainer.appendChild(a),"default"===e.columnSizeMode){for(let t=0;t<e.columns.length;t++){const l=e.columns[t];if(!l.width){const t=a.querySelector('[data-field="'+l.dataField+'"]');t&&t.offsetWidth<5&&(t.style.width=parseInt(l.minWidth||e.columnMinWidth)+"px")}}if(t){const t=e.columns.filter((e=>e.visible));if(1===t.length){const e=t[0],l=a.querySelector('[data-field="'+e.dataField+'"]');l&&(l.style.width="")}}}}_getColumnHeaderStructure(){const e=this._columns,t=this.columnGroups;if(!t)return 1;let a=1;for(const l of e){let e=l.columnGroup;if(l.headerStructure=[],e&&(e=t.find((t=>t.name===e)),e))for(l.headerStructure.push(e.label||e.name);e.parentGroup&&(e=t.find((t=>t.name===e.parentGroup)),e);)l.headerStructure.unshift(e.label||e.name);l.headerStructure.push(l.label),a=Math.max(a,l.headerStructure.length)}for(const t of e){const e=t.headerStructure,l=e[0];for(;e.length<a;)e.unshift(l)}return a}_isColumnHidden(e,t){return!(!e||1===e||t>1280)&&(t<=640&&2===e||t<=800&&3===e||t<=1024&&4===e||t<=1280&&5===e)}_areColumnsWithSameFreezeSettings(e,t){return!e.freeze&&!t.freeze||e.freeze===t.freeze||!0===e.freeze&&"near"===t.freeze||"near"===e.freeze&&!0===t.freeze}getColumnProperty(e,t){const a=this,l=a.columnByDataField[e];return l?"width"===t?l.width?a._getColumnWidth(l.width,!0,l):l._isResponsive&&l._manualPercentageWidth?a._getColumnWidth(l._manualPercentageWidth+"%",!0,l):a._getColumnWidth(l._manualWidth,!0,l):l[t]:null}setColumnProperty(e,t,a){const l=this;if(!l.columnByDataField[e])return null;l.columns.forEach(((i,n)=>{i.dataField===e&&(l.columns[n][t]=a)}))}_getTableRemainingWidth(){const e=this;let t=e.offsetWidth;if(e.selection){const a=e.$.tableContainer.querySelector(".jqx-table-select-all");a&&(t=e.offsetWidth-a.offsetWidth),""===e.columns[e.columns.length-1].dataField&&(t-=parseInt(e.columnMinWidth))}e.virtualization&&e.$.virtualizationContainer&&e.$.virtualizationContainer.computedVerticalScrollBarVisibility&&(t-=20);let a=0;for(let t=0;t<e.columns.length;t++){const l=e.columns[t];l.visible&&l.width&&!(""+l.width).endsWith("%")&&(a+=e._getColumnWidth(l.width))}return t-=a,t}_getColumnWidth(e,t,a){const l=this,i=parseFloat(e);if((e=(e+"").trim()).endsWith("%")){let e=l.offsetWidth;if(l.selection){const t=l.$.tableContainer.querySelector(".jqx-table-select-all");t&&(e=l.offsetWidth-t.offsetWidth),""===l.columns[l.columns.length-1].dataField&&(e-=parseInt(l.columnMinWidth))}l.virtualization&&l.$.virtualizationContainer&&l.$.virtualizationContainer.computedVerticalScrollBarVisibility&&(e-=20);let n=0;for(let e=0;e<l.columns.length;e++){const t=l.columns[e];t.visible&&t.width&&!(""+t.width).endsWith("%")&&(n+=l._getColumnWidth(t.width))}e-=n;const r=a&&a.minWidth||l._getNumericMinWidth(),o=t?i+"%":e*(i/100);return r>o?r:o}return isNaN(i)?"auto":t?i+"px":i}_setupColumnHeaderCell(e,t,a,l){const i=this,n=document.createElement("th");if(n.setAttribute("aria-colindex",a+1+ +e),l.width){let e=l.width;"number"==typeof e&&l.minWidth&&(e=Math.max(e,l.minWidth)),n.style.width=i._getColumnWidth(e,!0,l)}else l._manualWidth&&(l._isResponsive?n.style.width=l._manualPercentageWidth+"%":n.style.width=l._manualWidth+"px");1!==i._columns.length&&l.allowResize||n.setAttribute("locked",""),l.freeze&&n.classList.add("freeze-"+("far"===l.freeze?"far":"near")),l.responsivePriority&&n.classList.add("priority-"+l.responsivePriority),i.virtualization&&n.classList.add("sticky"),n.setAttribute("data-field",l.dataField);let r=l.label;if((/<.+?>/.test(r)||/<./.test(r))&&r.replace&&("all"===i.dataSourceSettings.sanitizeHTML?r=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===i.dataSourceSettings.sanitizeHTML&&(r=window.JQX.Utilities.Core.sanitizeHTML(r))),n.innerHTML=`<div class="wrapper" role="presentation"><div class="label">${r}</div></div>`,i.columnMenu){const e=document.createElement("div");e.classList.add("column-menu"),e.setAttribute("aria-hidden",!0),n.firstElementChild.appendChild(e),e.onclick=e=>{i.activeColumnMenu&&i.activeColumnMenu.dataField===l.dataField?i.closeColumnMenu():i.openColumnMenu(l.dataField),e.preventDefault(),e.stopPropagation()}}i.onColumnRender&&i.onColumnRender(l.dataField,n),t.appendChild(n)}_refreshDataRows(){const e=this,t=window.scrollY,a=window.scrollX,l=e.$.tableContainer.children[1],i=Array.from(l.querySelectorAll("tr:not(.jqx-table-filter-row)"));if(e._clearCachedTemplates(),e.filterRow||e.footerRow||e.headerRow)for(let e=0;e<i.length;e++)i[e].remove();else l.innerHTML="";e._createDataRows(l),e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),(a||t)&&window.scroll(a,t)}_createDataRows(e){const t=this;if(t.virtualization)return void t._createVirtualDataRows(e);const a=t.rowDetailTemplate,l=t.selection,i=document.createDocumentFragment(),n=t.hasAttribute("hierarchy");for(let e=0;e<t.rows.length;e++){const r=t.rows[e],o=r.data;o.groupDataField?t._createGroupHeader(o,i):t._createDataRow(r,i,{hierarchical:n,rowDetailTemplate:a,selection:l,virtualization:!1})}if(i.appendChild(t._createLastRow()),e.appendChild(i),t._updateState("expanded"),e.parentElement||t.$.tableContainer.insertBefore(e,t.$.tableContainer.querySelector("tfoot")),t.getRootNode().activeElement===t.$.tableContainer&&t._tableContainerFocusHandler(),t._templateTags.length){const e=t.querySelectorAll("tr");for(let a=0;a<t._templateTags.length;a++){const l=t._templateTags[a],i=l.index,n=l.dataField,r=l.td;if(e[i]){const t=e[i].querySelector('[data-field="'+n+'"]'),a=[...t.querySelectorAll("jqx-button"),...t.querySelectorAll("button"),...t.querySelectorAll("a"),...t.querySelectorAll("span")],l=[...r.querySelectorAll("jqx-button"),...r.querySelectorAll("button"),...r.querySelectorAll("a"),...r.querySelectorAll("span")];for(let e=0;e<a.length;e++)"button"===a[e].nodeName.toLowerCase()&&a[e].classList.contains("jqx-button")||(a[e].onclick=()=>{l[e].click()})}}}}_createDataRow(e,t,a){const l=this,i=l._columns.filter((e=>e.visible)),n=e.data,r=n.$.id,o=document.createElement("tr"),s={row:o,detail:null};let d=0;o.setAttribute("aria-rowindex",n.$.index+1),l._processAndRenderSelection(n,o,a.hierarchical),a.selection&&d++;for(let t=0;t<i.length;t++){const s=document.createElement("td"),c=i[t];s.setAttribute("data-field",c.dataField),s.setAttribute("aria-colindex",t+1+ +a.selection);let u,f=l._formatCellValue(e,c,s);if(c.freeze&&s.classList.add("freeze-"+("far"===c.freeze?"far":"near")),c.responsivePriority&&s.classList.add("priority-"+c.responsivePriority),!1===c.allowEdit&&(s.classList.add("no-edit"),s.setAttribute("aria-readonly",!0)),0===t&&a.hierarchical){const e=l._areChildrenFiltered(n);n.leaf||(s.classList.add("tree-cell"),u=e),n.level&&(s.classList.add("outline-level-"+Math.min(n.level,10)),!n.leaf&&e||s.classList.add("tree-leaf"))}if(a.virtualization&&c.templateElement){const e=c.templateElement+"";u&&l._setCellContent(s,f,u);const t=u?s.children[0].children[1]:s;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+n[c.dataField]+"</div>"):t.innerHTML=e,c.templateElementSettings&&(l._cachedTemplates&&l._cachedTemplates[c.dataField+"_"+r]&&(0===l._cachedTemplates[c.dataField+"_"+r].innerHTML.length?delete l._cachedTemplates[c.dataField+"_"+r]:(t.innerHTML="",t.appendChild(l._cachedTemplates[c.dataField+"_"+r]))),c.templateElementSettings(n[c.dataField],r,t.firstElementChild),l._cachedTemplates||(l._cachedTemplates=[]),l._cachedTemplates[c.dataField+"_"+r]||(l._cachedTemplates[c.dataField+"_"+r]=t.firstElementChild))}else""===c.dataField&&void 0===f&&(f=""),l._setCellContent(s,f,u);l.onCellRender&&l.onCellRender(n,c.dataField,n[c.dataField],s),l._applyConditionalFormattingToCell(s,c.dataField,n.$.index),o.appendChild(s),d++}if(o.data=n,o.setAttribute("row-id",r),-1!==l._disabledSelection.indexOf(r)&&(o.removeAttribute("aria-selected"),o.classList.add("disable-select"),a.selection&&o.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),n.expanded?(-1===l._expandedIds.indexOf(r)&&l._expandedIds.push(r),l._expandedIdsAlt[r]=!0,o.setAttribute("aria-expanded",!0),o.classList.add("expanded")):!1===n.expanded&&o.setAttribute("aria-expanded",!1),n.level&&l._isCollapsed(n)&&(o.setAttribute("aria-hidden",!0),o.classList.add("collapsed","jqx-hidden")),t.appendChild(o),a.rowDetailTemplate){const i=document.createElement("tr");if(-1===l._expandedRowDetailIds.indexOf(r)){if(a.virtualization)return s;i.setAttribute("aria-hidden",!0),i.classList.add("collapsed")}else s.detail=i;i.data=Object.assign(n,{detail:!0}),i.classList.add("jqx-table-row-detail"),i.innerHTML=`<td colspan="${d}"><div class="jqx-table-detail-container">${l._applyRowDetailTemplate(e)}</div></td>`,t.appendChild(i)}return s}_processAndRenderSelection(e,t,a,l){const i=this,n=e.$.id,r=i._getChildCheckState(e).state;if(a&&i.selectionByHierarchy){const e=i._selectedIds.indexOf(n);!0===r&&-1===e?i._selectedIds.push(n):r||-1===e||i._selectedIds.splice(e,1)}if(!i.selection)return;let o,s;l?(o=t.firstElementChild,s=o.firstElementChild):(o=document.createElement("td"),s=document.createElement("div")),s.className="selection-checkbox",s.setAttribute("role","checkbox"),s.setAttribute("aria-checked",!!r||null===r&&"mixed"),s.setAttribute("aria-label","Toggle row selection"),o.className="jqx-table-select-row freeze-near"+(r?" selected":null===r?" indeterminate":""),o.setAttribute("aria-colindex",1),l||(o.appendChild(s),t.appendChild(o)),t.setAttribute("aria-selected",!0===r)}_applyConditionalFormattingToCell(e,t,a){const l=this;if(l._conditionalFormatting&&l._conditionalFormatting[t]){const i=l._conditionalFormatting[t][a];i&&(e.style.backgroundColor=i.background,e.style.color=i.color,e.style.fontFamily=i.fontFamily,e.style.fontSize=i.fontSize)}}_createLastRow(){const e=document.createElement("tr");e.setAttribute("aria-hidden",!0),e.classList.add("last-visible");try{new ResizeObserver((t=>{try{e.classList.toggle("sized",t[0].contentRect.height>0&&null!==e.previousSibling)}catch(e){}})).observe(e)}catch(e){}return e}_createGroupHeader(e,t,a){const l=this;l.columnByDataField[e.groupDataField]||console.error(l.localize("grouping"));const i=l.columnByDataField[e.groupDataField]?l.columnByDataField[e.groupDataField].label:`${l.localize("EMPTY")}`,n=a||document.createElement("tr"),r=document.createElement("td"),o=document.createElement("div"),s=document.createElement("div"),d=document.createElement("div");let c=e.label;if((/<.+?>/.test(c)||/<./.test(c))&&c.replace&&("all"===l.dataSourceSettings.sanitizeHTML?c=c.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===l.dataSourceSettings.sanitizeHTML&&(c=window.JQX.Utilities.Core.sanitizeHTML(c))),""!==c&&c||(c=`<em class="placeholder">${l.localize("EMPTY")}</em>`),n.removeAttribute("aria-rowindex"),n.data=e,s.classList.add("hierarchy-arrow","jqx-arrow","jqx-arrow-down"),s.setAttribute("role","button"),s.setAttribute("aria-label","Toggle row"),d.classList.add("group-label"),d.innerHTML=`<span class="group-label-name">${i}: </span>\n <span class="group-label-value">${c}</span>\n <span class="group-label-count">(${l._getLeafCount(e)})</span>`,r.colSpan=l._columns.filter((e=>e.visible)).length,r.classList.add("group-header"),e.level&&(r.classList.add("outline-level-"+Math.min(e.level,10)),l._isCollapsed(e)&&(n.setAttribute("aria-hidden",!0),n.classList.add("collapsed","jqx-hidden"))),n.setAttribute("row-id",e.$.id),n.setAttribute("role","group"),n.setAttribute("aria-level",e.level),o.appendChild(s),o.appendChild(d),r.appendChild(o),l._processAndRenderSelection(e,n,!0),n.appendChild(r),n.setAttribute("aria-expanded",e.expanded),n.classList.toggle("expanded",e.expanded),e&&e.$&&!1===e.$.filtered&&n.classList.add("jqx-hidden"),l.groupFormatFunction){const t={value:c,row:e.$.id,column:e.groupDataField,data:e,template:null};l.groupFormatFunction(t),c!==t.value&&(d.innerHTML=`<span class="group-label-name">${i}: </span>\n <span class="group-label-value">${t.value}</span>\n <span class="group-label-count">(${l._getLeafCount(e)})</span>`),t.template instanceof HTMLElement&&(d.innerHTML="",d.appendChild(t.template));const a=t.template;let n="";if(a&&a.startsWith("#")){const e=document.querySelector(a);let t=c;if(e&&e instanceof HTMLTemplateElement){const a=e.content.cloneNode(!0),l=document.createElement("div");l.appendChild(a),t=t.toString(),t=t.replace(/'/gi,"\\'"),t=t.replace(/"/gi,'\\"'),n=l.innerHTML.replace(/{{value}}/gi,t),n.indexOf("{{value=")>=0&&(t?(n=n.substring(0,n.indexOf("{{value="))+t+n.substring(n.indexOf("}")),n=n.replace(/}/gi,""),n=n.replace(/{/gi,"")):(n=n.replace(/{{value=/gi,""),n=n.replace(/}}/gi,""))),d.innerHTML=n}}else a&&"string"==typeof a&&(n=a.replace(/{{value}}/gi,c),d.innerHTML=n)}const u=l.selection?1:0;for(let e=0;e<l.columns.length;e++){const t=document.createElement("td"),a=l.columns[e];a.visible&&(t.setAttribute("data-field",a.dataField),t.setAttribute("aria-colindex",e+1+u),t.classList.add("jqx-hidden"),n.appendChild(t))}return a||t.appendChild(n),n}_getLeafCount(e){let t=0;return function e(a){for(const l of a)l.leaf?t++:l.children&&l.children.length>0&&e(l.children)}(e.children),t}_isCollapsed(e){let t=e.parent;for(;t;){if(!t.expanded)return!0;t=t.parent}return!1}_areChildrenFiltered(e){if(!e.leaf){if(0===e.children.length&&this.dataSource.virtualDataSource)return!0;for(let t=0;t<e.children.length;t++)if(!1!==e.children[t].$.filtered)return!0;return!1}}_applyRowDetailTemplate(e){const t=this,a=t.dataSource.dataFields;let l=t.rowDetailTemplate;for(let i=0;i<a.length;i++){const n=a[i].name,r=new RegExp(`{{${n}}}`,"g");let o=t.columnByDataField[n]||{dataField:n};if(r.test(l)){let a=t._formatCellValue(e,o,document.createElement("td"));"string"!=typeof a&&(a=e.data[o.dataField]),l=l.replace(r,a)}}return l}_handleFrozenColumnPositions(){const e=this,t=e.rightToLeft,a=e._columns.filter((e=>e.visible));let l=[],i=[],n=0;function r(t,l,i,r,o){const s=a[l-n],d=[s.headerCellElement];for(const e of s.thHierarchy)e.includes[0].dataField===s.dataField&&d.push(e);Array.from(e.$.tableContainer.querySelectorAll(`td:nth-child(${l+1})`)).concat(d).forEach((e=>{e.style[t]=i+"px",o&&(e.style.zIndex=2+r)}))}e.selection&&(t?i.push(0):l.push(0),n=1);for(let e=0+n;e<a.length+n;e++){const r=a[e-n];r.freeze&&(!t&&"far"===r.freeze||t&&"far"!==r.freeze?i.push(e):l.push(e))}if(l.length<2&&i.length<2)return;const o=[];e.selection&&o.push(40);for(const e of a){let t=e.width;t||(t=e.headerCellElement.offsetWidth),e.minWidth&&(t=Math.max(e.minWidth,t)),o.push(t)}if(t){for(let e=0;e<l.length-1;e++){const t=l[e];let a=0;for(let e=t+1;e<o.length;e++)-1!==l.indexOf(e)&&(a+=o[e]);r("left",t,a,e,!0)}for(let e=1;e<i.length;e++){const t=i[e];let a=0;for(let e=0;e<t;e++)-1!==i.indexOf(e)&&(a+=o[e]);r("right",t,a,e,!1)}}else{for(let e=1;e<l.length;e++){const t=l[e];let a=0;for(let e=0;e<t;e++)-1!==l.indexOf(e)&&(a+=o[e]);r("left",t,a,e,!1)}for(let e=0;e<i.length-1;e++){const t=i[e];let a=0;for(let e=t+1;e<o.length;e++)-1!==i.indexOf(e)&&(a+=o[e]);r("right",t,a,e,!0)}}}_formatCellValue(e,t,a,l){const i=this;let n=e&&e.data?e.data.$.id:e;if(void 0===l&&(l=e.data[t.dataField]),"string"==typeof l&&(l.indexOf(">")>=0||l.indexOf("<")>=0)&&l.replace&&("all"===i.dataSourceSettings.sanitizeHTML?l=l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===i.dataSourceSettings.sanitizeHTML&&(l=window.JQX.Utilities.Core.sanitizeHTML(l))),i._cellsWithFormulas){const e=t.dataField+":"+n;if("string"==typeof l&&/=.+/.test(l)){const t=i._formulaParser;i._cellsWithFormulas[e]=!0,t&&(l=t.parse(l.slice(1)))}else delete i._cellsWithFormulas[e]}if(t.formatFunction){const i={value:l,row:n,column:t.dataField,data:e.data,cell:a,template:null};if(t.formatFunction(i),l=i.value,i.template instanceof HTMLElement)return i.template;if(null===i.template||"string"!=typeof i.template)return l;const r=i.template;let o="";if(r.startsWith("#")){const e=document.querySelector(r);if(e&&e instanceof HTMLTemplateElement){const t=e.content.cloneNode(!0),a=document.createElement("div");return a.appendChild(t),l=(l=(l=l.toString()).replace(/'/gi,"\\'")).replace(/"/gi,'\\"'),o=a.innerHTML.replace(/{{value}}/gi,l),o.indexOf("{{value=")>=0&&(l?(o=o.substring(0,o.indexOf("{{value="))+l+o.substring(o.indexOf("}")),o=o.replace(/}/gi,""),o=o.replace(/{/gi,"")):(o=o.replace(/{{value=/gi,""),o=o.replace(/}}/gi,""))),o}}return o='<div class="jqx-table-cell-template">'+r.replace(/{{value}}/gi,l)+"</div>",o}return"date"===t.dataType&&l instanceof Date?l.toLocaleDateString():l}_setCellContent(e,t,a){if(t instanceof HTMLElement==1){for(;e.childNodes.length>0;)e.childNodes[0].remove();if(a){const a=document.createElement("div");a.innerHTML='<div class="hierarchy-arrow jqx-arrow jqx-arrow-down" role="button" aria-label="Toggle row"></div><div></div>',a.children[1].appendChild(t),e.appendChild(a)}else e.appendChild(t)}else if(a)e.innerHTML=t=`<div>\n <div class="hierarchy-arrow jqx-arrow jqx-arrow-down" role="button" aria-label="Toggle row"></div>\n <div>${t}</div>\n </div>`,e._content=t;else if("string"==typeof t&&t.indexOf(">")>=0)if(/<.+?>/.test(t)||/&\S+;/.test(t)){if(e._content===t)return;e.innerHTML=t,e._content=t}else e.textContent!==t&&(e.textContent=t);else"html"===this.dataSourceSettings.sanitizeHTMLRender?e.innerHTML!==t&&("string"==typeof t&&t.indexOf(" ")>=0&&(t=t.replaceAll(" ","&nbsp;")),void 0===t&&(t=""),e.innerHTML=t):e.textContent!==t&&(e.textContent=t)}_dataBind(e){const t=this;if(t._cellsWithFormulas={},t._templateTags=[],t.dataSource){if(t.dataSource instanceof JQX.DataAdapter==0){const e=t.dataSource;if(Array.isArray(e)){const a=t.columns;let l;if(e.length>0){const t=e[0];l=[];for(let e in t){const a=t[e];"number"==typeof a?l.push({name:e,dataType:"number"}):"boolean"==typeof a?l.push({name:e,dataType:"boolean"}):a instanceof Date?l.push({name:e,dataType:"date"}):a instanceof Object?l.push({name:e,dataType:"any"}):l.push({name:e,dataType:"string"})}}a&&a.length>0&&(l=l||[],a.forEach((e=>{if(e.dataType){const t=l.find((t=>t.name===e.dataField));t?t.dataType=e.dataType:e.map?l.find((t=>e.map.indexOf(t.name)>=0?t:null))&&l.push({name:e.dataField,map:e.map,dataType:e.dataType}):l.push({name:e.dataField,dataType:e.dataType})}}))),t.dataSourceSettings.dataFields&&t.dataSourceSettings.dataFields.length>0?t.dataSource=new JQX.DataAdapter({dataSource:t.dataSource,dataSourceType:t.dataSourceSettings.dataSourceType,dataFields:t.dataSourceSettings.dataFields,keyDataField:t.dataSourceSettings.keyDataField,parentDataField:t.dataSourceSettings.parentDataField,childrenDataField:t.dataSourceSettings.childrenDataField,groupBy:t.dataSourceSettings.groupBy,mapChar:t.dataSourceSettings.mapChar,root:t.dataSourceSettings.root,record:t.dataSourceSettings.record,autoGenerateColumns:t.autoGenerateColumns,id:t.dataSourceSettings.id||t.dataRowId,expandHierarchy:t.expandHierarchy,virtualDataSource:t.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:t.dataSourceSettings.virtualDataSourceOnExpand}):t.dataSource=new JQX.DataAdapter({dataSource:t.dataSource,dataFields:l,id:t.dataRowId||t.dataSourceSettings.id,dataSourceType:t.dataSourceSettings.dataSourceType,keyDataField:t.dataSourceSettings.keyDataField,parentDataField:t.dataSourceSettings.parentDataField,childrenDataField:t.dataSourceSettings.childrenDataField,groupBy:t.dataSourceSettings.groupBy,mapChar:t.dataSourceSettings.mapChar,root:t.dataSourceSettings.root,record:t.dataSourceSettings.record,autoGenerateColumns:t.autoGenerateColumns,expandHierarchy:t.expandHierarchy,virtualDataSource:t.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:t.dataSourceSettings.virtualDataSourceOnExpand})}else t.dataSource=new JQX.DataAdapter({dataSource:[],id:t.dataRowId,expandHierarchy:t.expandHierarchy})}}else{if(t.dataFields=[],!t.columns||Array.isArray(t.columns)&&0===t.columns.length){t.columns=[];const e=t.querySelectorAll("th");for(let a=0;a<e.length;a++){const l=e[a].innerHTML.trim();let i={label:l,dataField:l,dataType:"string"};t.columns.push(i),t.dataFields.push(l)}}else for(let e=0;e<t.columns.length;e++){const a=t.columns[e];"string"==typeof a?t.dataFields.push(a):"object"==typeof a&&t.dataFields.push(a.dataField+(a.dataType?": "+a.dataType:""))}let e=[];if(!t.rows){const a=t.querySelectorAll("tr");for(let l=0;l<a.length;l++){const i={},n=a[l].querySelectorAll("td");if(n.length>0){for(let e=0;e<t.columns.length;e++){const a=t.columns[e];i[a.dataField]=n[e].innerHTML.trim(),i[a.dataField].indexOf("<")>=0&&t._templateTags.push({index:l,dataField:a.dataField,td:n[e]})}e.push(i)}}t.dataSource=new JQX.DataAdapter({dataSource:e,expandHierarchy:t.expandHierarchy,dataFields:t.dataFields,id:t.dataRowId})}const a=t.$.container.querySelectorAll("table");a.length>1&&a[a.length-1].parentNode.removeChild(a[a.length-1])}t.dataSource.expandHierarchy=t.expandHierarchy,t._transformDataSource(),t._applyInitialConditionalFormatting(t.dataSource),t._initColumns(e),t._initRows(),t.dataSource.notify((function(e){if(t.dataSource._updating)return void delete t.dataSource._updating;if(t._editing)return;const a=e.data,l=t._selectedIds.slice(0);let i=e.action;switch(t.rows.canNotify=!1,e.action){case"add":if(a.length)for(let e=0;e<a.length;e++)t._addNewRow(a[e],t.dataSource.length-a.length+e);else t._addNewRow(a,t.dataSource.length-1);break;case"update":if(a.length)for(let l=0;l<a.length;l++){const i=e.index[l];t.rows[i].data=a[l]}break;case"insert":t._addNewRow(a,e.index);for(let e=0;e<t.rows.length;e++)t.rows[e].dataIndex=e;break;case"remove":case"removeLast":i="remove",function(e){const a=e.$.id,l=t._selectedIds.indexOf(a);delete t.rowById[a],t.rows.splice(e.$.index,1),-1!==l&&t._selectedIds.splice(l,1)}(a);break;case"bindingComplete":if(t.filtering&&t.filterRow){const e=t._filterInfo;e.inputFilters?t._filterByAll(e.query):e.rowFilters?t._applyRowFilters():e.appliedFilters&&t._refreshFilters()}}t.rows.canNotify=!0,this.refreshHierarchy(),t._fullRefresh(void 0,l,i)})),t.refresh(),t.dataSource.virtualDataSource&&(t.paging=!0,t._requestVirtualDataSource("dataBind")),t.$.tableContainer.setAttribute("aria-rowcount",t.dataSource.length)}_requestVirtualDataSource(e,t,a=null){const l=this,i=l.pageSize,n=Math.max(l.pageIndex*i,0),r=n+i,o=[],s=[],d={};let c=null;if(l.dataSource._updating=!0,l._sortColumns&&(l._sortColumns.forEach(((e,t)=>o[e.dataField]={sortOrder:e.direction,sortIndex:t})),o.length=l._sortColumns.length),l._filterInfo.appliedFilters){for(let e in l._filterInfo.appliedFilters)s[e]=l._filterInfo.appliedFilters[e];s.length=Object.keys(l._filterInfo.appliedFilters).length,c="and"}else{const e=l._filterInfo.inputFilters||l._filterInfo.rowFilters;e&&(e.forEach((e=>s[e[0]]=e[1])),s.length=e.length),c=l._filterInfo.inputFilters?"or":"and"}l._editing&&(d.row=l._editing.row.data),l.$.loadingIndicatorContainer.classList.remove("jqx-hidden"),l.setAttribute("loading",""),l.dataSource.onVirtualDataSourceRequested((function(i){let n=!0;-1!==["add","update","remove"].indexOf(e)&&t&&(n=t(i.result)),l.$.loadingIndicatorContainer.classList.add("jqx-hidden"),l.removeAttribute("loading"),n&&(a&&(a.expanded=!0),l._initRows(),l._refreshDataRows())}),{first:n,last:r,sorting:o,filtering:s,filterOperator:c,grouping:[],edit:d,row:a,action:e})}sortBy(e,t){const a=this,l=a.columnByDataField[e];if(l){if(!1===l.allowSort)return;e=l.dataField}if(a._sortBy({column:l,columnDataField:e,sortOrder:t,dataFields:a.dataSource.dataFields,columnByDataField:"columnByDataField"}),null===e){const e=!0===a._sortOnClick?"interaction":"programmatic";a.$.fireEvent("sort",{columns:[],sortDataFields:[],sortOrders:[],sortDataTypes:[],type:e})}}_sortBy(e){const t=this,a=e.column,l=e.columnDataField,i=e.sortOrder,n=e.dataFields,r=e.columnByDataField,o=[],s=[],d=[],c=function(e){t._addSortIconContainer(e),e.headerCellElement&&(e.headerCellElement.removeAttribute("aria-sort"),e.headerCellElement.sortIconContainerElement.classList.remove("desc"),e.headerCellElement.sortIconContainerElement.classList.remove("asc")),e.sortOrder=null},u=function(){if(t._sortColumns&&t._sortColumns.length>0)for(let e=0;e<t._sortColumns.length;e++){const a=t._sortColumns[e],l=t[r][a.dataField];c(l)}t._sortColumns=[]};if(null==a)return void(t._sortColumns&&t._sortColumns.length>0&&(u(),t._sortCallback(o,s,d),t._updateState("sorted")));if("none"===t.sortMode||!t.dataSource)return;if(i&&a.sortOrder===i)return;let f=i||"asc";null===i&&(f=null),c(a),t._sortColumns||(t._sortColumns=[]);let m="string";for(let e=0;e<n.length;e++){const t=n[e];if(t.name===l){m=t.dataType,"any"===m&&(m="number");break}}let h=!0;for(let e=0;e<t._sortColumns.length;e++){const n=t._sortColumns[e];if(n.dataField===l)if(h=!1,null===f&&(n.direction="desc"),"asc"===n.direction)n.direction="desc",f="desc";else if("desc"===n.direction){t._sortColumns.splice(e,1),c(a),f=i;break}}h&&("one"===t.sortMode&&u(),t._sortColumns.push({dataField:l,direction:f,dataType:m})),t._addSortIconContainer(a),null!==f?(a.headerCellElement&&(a.headerCellElement.sortIconContainerElement.classList.remove("asc"),a.headerCellElement.sortIconContainerElement.classList.remove("desc")),a.sortOrder=f,a.headerCellElement&&("desc"===f?(a.headerCellElement.sortIconContainerElement.classList.add("desc"),a.headerCellElement.setAttribute("aria-sort","descending")):(a.headerCellElement.sortIconContainerElement.classList.add("asc"),a.headerCellElement.setAttribute("aria-sort","ascending")))):a.headerCellElement&&(a.headerCellElement.sortIconContainerElement.classList.remove("asc"),a.headerCellElement.sortIconContainerElement.classList.remove("desc"),a.headerCellElement.removeAttribute("aria-sort"));for(let e=0;e<t._sortColumns.length;e++){const a=t._sortColumns[e],l=t[r][a.dataField];o.push(a.dataField),s.push(a.direction),d.push(a.dataType),l.headerCellElement&&l.headerCellElement.sortIconContainerElement.setAttribute("order",e+1)}if(t._sortCallback(o,s,d),t._updateState("sorted"),!t._doNotFireEvent){const e=!0===t._sortOnClick?"interaction":"programmatic";t.$.fireEvent("sort",{columns:t._sortColumns,sortDataFields:o,sortOrders:s,sortDataTypes:d,type:e})}}_addSortIconContainer(e,t,a){const l=e.headerCellElement;if(l&&!l.sortIconContainerElement){const e=document.createElement("div");e.classList.add("sort-by"),e.setAttribute("aria-hidden",!0),t&&e.classList.add(t),l.firstElementChild.appendChild(e),l.sortIconContainerElement=e,"asc"===t?l.setAttribute("aria-sort","ascending"):"desc"===t?l.setAttribute("aria-sort","descending"):l.removeAttribute("aria-sort"),void 0!==a&&e.setAttribute("order",a)}}_sortCallback(e,t,a){const l=this,i=l.dataSource;if(!i.virtualDataSource){let n=null;for(let e=0;e<l.columns.length;e++){const t=l.columns[e];t.sort&&(n||(n={}),n[t.dataField]=t.sort)}i._sort(l.dataSource.boundSource,e,t,a,l.sort,n);let r=[],o=[];if(i.groupBy&&i.groupBy.toArray&&(r=i.groupBy.toArray().slice(0)),r.length>0&&(o=l._getExpandedGroups(i.boundHierarchy)),i.refreshHierarchy(),r.length>0){const e=l._doNotFireEvent;l._doNotFireEvent=!0,l._restoreExpandedGroups(o),l._doNotFireEvent=e}}l._fullRefresh("sort")}clearSort(){this.sortBy(null)}_fullRefresh(e,t,a,l){const i=this;if(i.__updating)return;if(i.dataSource.virtualDataSource)return void i._requestVirtualDataSource(e,l);const n=i._getFractionOfMax();t||(t=i._selectedIds.slice(0)),t=JSON.stringify(t.sort()),i._initRows(),i._refreshDataRows(),i._setFractionOfMax(n),"filter"===e&&(i._updateSelectAllState(),a||(a="filter")),t!==JSON.stringify(i._selectedIds.slice(0).sort())&&("filter"!==e&&i._updateSelectAllState(),i._updateState("selected"),i.$.fireEvent("change",{type:a})),"string"==typeof e&&-1!==e.indexOf("page")&&i._fixFrozenHeaderFirefox()}_pagerChangeHandler(e){const t=this;(t.isInShadowDOM?e.composedPath()[0]:e.target)===t.$.pager&&(t.pageIndex=e.detail.index,t._fullRefresh("pageIndexChange"),t.$.fireEvent("page",{action:"pageIndexChange"}))}_pagerPageSizeChanged(e){const t=this;t.pageSize=e.detail.value,t._fullRefresh("pageSizeChange"),t.$.fireEvent("page",{action:"pageSizeChange"})}_filterInputKeyupHandler(){const e=this;clearTimeout(e._filterInputTimeout),e._filterInputTimeout=setTimeout((function(){if(e._filterInfo&&e.$.filterInput.value!==e._filterInfo.query){const t=e.context;e.context=e,e._filterByAll(e.$.filterInput.value),e.context=t}}),500)}_filterByAll(e){const t=this;if(t._filterInfo.query=e,""===e)return void t.clearFilters();const a=[];t._clearRowFilters(),delete t._filterInfo.appliedFilters,t._filterInfo.stringDataFields.forEach((t=>{const l=new JQX.Utilities.FilterGroup,i=l.createFilter("string",e,"CONTAINS");l.addFilter("or",i),a.push([t,l])})),t.dataSource.virtualDataSource||t.dataSource._filter(a,"or"),t._filterInfo.inputFilters=a,t._fullRefresh("filter"),t._updateState("filtered"),t._doNotFireEvent||t.$.fireEvent("filter",{action:"add",filters:a})}_setupPagingAndFiltering(){const e=this;e.$.pager.$.pageSizeSelector.classList.add("underlined"),e.$.pager.$.pageSizeSelector.dropDownAppendTo="body",e._filterInfo={query:""},e._applyFilterTemplate(),e.$.header.classList.toggle("jqx-hidden",(!e.filtering||e.filterRow||e.columnMenu)&&!e.conditionalFormattingButton)}_applyFilterTemplate(){const e=this,t=e.filterTemplate;if(e.$.filterTemplateContainer.innerHTML="",!t)return e.$.filterInput.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.classList.add("jqx-hidden"),void(e.filterTemplate=null);const a=document.getElementById(t);if(a&&a instanceof HTMLTemplateElement){const t=document.importNode(a.content,!0);e.$.filterInput.classList.add("jqx-hidden"),e.$.filterTemplateContainer.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.appendChild(t)}else e.filterTemplate=null,e.$.filterInput.classList.remove("jqx-hidden"),e.$.filterTemplateContainer.classList.add("jqx-hidden")}_refreshFilters(e){const t=this,a=[];for(let e in t._filterInfo.appliedFilters){let l=t._filterInfo.appliedFilters[e];a.push([e,l])}0!==a.length?(t._clearFilterInput(),t._clearRowFilters(),t.dataSource.virtualDataSource||t.dataSource._filter(a,t.filterOperator),t._fullRefresh("filter"),t._updateState("filtered"),e&&!t._doNotFireEvent&&t.$.fireEvent("filter",{action:e,filters:a})):t.clearFilters()}_localize(){const e=this,t=e.$.pager;t.messages[e.locale]||(t.messages[e.locale]={}),t.messages[e.locale].pageSizeLabel=e.localize("itemsPerPage"),t.messages[e.locale].summaryPrefix=e.localize("summaryPrefix"),t.messages[e.locale].summarySuffix="",t.$.firstButton.setAttribute("tooltip",e.localize("firstButton")),t.$.previousButton.setAttribute("tooltip",e.localize("previousButton")),t.$.nextButton.setAttribute("tooltip",e.localize("nextButton")),t.$.lastButton.setAttribute("tooltip",e.localize("lastButton")),e.$.filterInput.placeholder=e.localize("filterPlaceholder"),e.$.conditionalFormattingButton.setAttribute("tooltip",e.localize("conditionalFormatting")),e._filterInfo.stringConditions=[{value:"EMPTY",label:e.localize("EMPTY")},{value:"NOT_EMPTY",label:e.localize("NOT_EMPTY")},{value:"CONTAINS",label:e.localize("CONTAINS")},{value:"CONTAINS_CASE_SENSITIVE",label:e.localize("CONTAINS_CASE_SENSITIVE")},{value:"DOES_NOT_CONTAIN",label:e.localize("DOES_NOT_CONTAIN")},{value:"DOES_NOT_CONTAIN_CASE_SENSITIVE",label:e.localize("DOES_NOT_CONTAIN_CASE_SENSITIVE")},{value:"STARTS_WITH",label:e.localize("STARTS_WITH")},{value:"STARTS_WITH_CASE_SENSITIVE",label:e.localize("STARTS_WITH_CASE_SENSITIVE")},{value:"ENDS_WITH",label:e.localize("ENDS_WITH")},{value:"ENDS_WITH_CASE_SENSITIVE",label:e.localize("ENDS_WITH_CASE_SENSITIVE")},{value:"EQUAL",label:e.localize("EQUAL")},{value:"EQUAL_CASE_SENSITIVE",label:e.localize("EQUAL_CASE_SENSITIVE")},{value:"NULL",label:e.localize("NULL")},{value:"NOT_NULL",label:e.localize("NOT_NULL")}],e._filterInfo.numberAndDateConditions=[{value:"EQUAL",label:e.localize("EQUAL")},{value:"NOT_EQUAL",label:e.localize("NOT_EQUAL")},{value:"LESS_THAN",label:e.localize("LESS_THAN")},{value:"LESS_THAN_OR_EQUAL",label:e.localize("LESS_THAN_OR_EQUAL")},{value:"GREATER_THAN",label:e.localize("GREATER_THAN")},{value:"GREATER_THAN_OR_EQUAL",label:e.localize("GREATER_THAN_OR_EQUAL")},{value:"NULL",label:e.localize("NULL")},{value:"NOT_NULL",label:e.localize("NOT_NULL")}]}_createFilterRow(e){const t=this;if(!t.filtering||!t.filterRow)return;if(e)return void t.$.tableContainer.children[1].insertBefore(e,t.$.tableContainer.children[1].firstElementChild);const a=document.createElement("tr"),l=t._columns.filter((e=>e.visible));let i="";a.className="jqx-table-filter-row",t.selection&&(i+='<td style="left: 0px; z-index: 99; position: sticky; background: var(--jqx-background);"></td>');for(let e=0;e<l.length;e++){const a=l[e];i+=t._createFilterRowInput(a)}a.innerHTML=i,t.$.tableContainer.children[1].insertBefore(a,t.$.tableContainer.children[1].firstElementChild)}_createFilterRowInput(e){const t=this,a=` animation="${t.animation}" `,l=t.rightToLeft?" right-to-left":"",i=[];let n,r,o,s;return"string"===e.dataType?(n=t._filterInfo.stringConditions,r="string",o="string-filter",s=t.localize("CONTAINS")):(n=t._filterInfo.numberAndDateConditions,r=e.dataType,o="num-date-filter",s=t.localize("EQUAL")),e.freeze&&i.push("freeze-"+("far"===e.freeze?"far":"near")),e.responsivePriority&&i.push("priority-"+e.responsivePriority),!1===e.allowFilter&&i.push("no-filter"),`<td${i.length?' class="'+i.join(" ")+'"':""} filter-for="${e.dataField}">\n <div>\n <input type="${r}" class="filter-value" aria-label="Filter value" />\n <jqx-input class="${o}${a}data-source='${JSON.stringify(n)}' drop-down-button-position="right" drop-down-width="auto" readonly${l} value="${s}" title="${t.localize("filterCondition")}" aria-label="Filter condition"></jqx-input>\n <jqx-button class="jqx-hidden" title="${t.localize("clearFilter")}"${a}${l} aria-label="Clear filter"></jqx-button>\n </div>\n </td>`}_tableContainerChangeHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target;a.classList.contains("filter-value")&&("date"===a.type||a instanceof JQX.Input&&(""!==a.previousElementSibling.value||-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(e.detail.value)))&&t._applyRowFilters(),(a.classList.contains("string-filter")||a.classList.contains("num-date-filter"))&&a instanceof JQX.Input&&(""!==a.previousElementSibling.value||-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(e.detail.value))&&t._applyRowFilters()}_tableContainerClickHandler(e){const t=this;if(t._editing)return;const a=t.isInShadowDOM?e.composedPath()[0]:e.target;if(!t.$.tableContainer.contains(a))return;const l=a.closest("tbody tr[row-id], tfoot tr.grand-total");if(l){t.closeColumnMenu();const i=a.closest("td");if(a.classList.contains("hierarchy-arrow")){const e=t.animation;return t.virtualization&&(t._animation="none"),t._hierarchyArrowClickHandler(l,i),void(t.virtualization&&(t._animation=e))}const n=l.getAttribute("row-id");let r;n&&(r=t.rowById?t.rowById[n].data:t.rows.dataItemById[n]);const o=r?r.$.id:void 0,s=i?i.getAttribute("data-field"):void 0;if(!r&&l.classList.contains("grand-total")&&(r=l.data),void 0!==s){const a={};for(let e=0;e<t.columns.length;e++){const l=t.columns[e];a[l.dataField]=r[l.dataField]}t.$.fireEvent("cellClick",{id:n,row:a,dataField:s,value:r[s],originalEvent:e})}if(t._toggleSelection(l,r,e,a),t.editing||t.drillDown){if(!s||i.classList.contains("no-edit"))return;clearTimeout(t._dblclickObject.timeout),t._dblclickObject.numberOfClicks++,2===t._dblclickObject.numberOfClicks?(t._dblclickObject.numberOfClicks=0,t._beginEdit({rowElement:l,cell:i,dataField:s})):t._dblclickObject.timeout=setTimeout((function(){t._dblclickObject.numberOfClicks=0}),300)}return void(t.rowDetailTemplate&&t._toggleRowDetail(l,o))}const i=a.closest(".jqx-table-select-all");if(i){if("one"===t.selectionMode)return;return void t._selectAllCheckboxClickHandler(i)}const n=a.closest(".jqx-table-filter-row jqx-button")||a.closest(".jqx-table-column-menu jqx-button");if(n){const e=n.parentElement.firstElementChild,a=n.parentElement.children[1];return e.value="",-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(a.$.input.dataValue)&&(a.value=t.localize("text"===e.type?"CONTAINS":"EQUAL"),delete a.$.input.dataValue),void t._applyRowFilters()}}_toggleSelection(e,t,a,l){const i=this;if(!i.selection||"cell"===i.selectionMode||e.classList.contains("disable-select")||e.classList.contains("grand-total"))return;function n(){i._selectedIds=[],Array.from(i.$.tableContainer.querySelectorAll(".jqx-table-select-row.selected")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)}))}const r=t.$.id;let o=-1!==i._selectedIds.indexOf(r);if(i._interaction=!0,"one"===i.selectionMode){if(o)return;n(),i.select(r)}if("many"===i.selectionMode)if(o)i.unselect(r);else{if(i._disabledSelection.length>0&&t.children&&t.children.length>0){let e=0,a=0,l=[];if(t.children.forEach((t=>{const n=t.$.id;-1===i._selectedIds.indexOf(n)?e++:l.push(n),-1!==i._disabledSelection.indexOf(n)&&a++})),e===a)return i.unselect(l),void delete i._interaction}i.select(r),i._selectionStart={data:t,element:e}}else{if(i._selectionStart&&a.shiftKey){let t,a,l;if(i.virtualization?(t=i.rows,a=t.findIndex((e=>e.data.$.id===r)),l=t.findIndex((e=>e.data.$.id===i._selectionStart.data.$.id))):(t=Array.from(i.$.tableContainer.querySelectorAll("tr[row-id]:not([unused])")),a=t.indexOf(e),l=t.indexOf(i._selectionStart.element)),a!==l){const e=JSON.stringify(i._selectedIds.slice(0).sort()),r=Math.min(a,l),o=Math.max(a,l);n();const s=[];for(let e=r;e<=o;e++){const a=t[e];s.push(a.data.$.id)}return i._changeSelectionOfMultiple(s,"select","interaction",e),getSelection().removeAllRanges(),void delete i._interaction}if(1===i._selectedIds.length)return void delete i._interaction}const s=!!l&&(l.classList.contains("selection-checkbox")||l.classList.contains("jqx-table-select-row"));let d=!1;if(1===i._selectedIds.length)d=!0;else if(i.hasAttribute("hierarchy")&&i.selectionByHierarchy){const e=[];!function e(t,a){const l=t.$.id;-1!==i._selectedIds.indexOf(l)&&a.push(l),t.children&&t.children.forEach((t=>e(t,a)))}(t,e),i._selectedIds.length===e.length&&(d=!0),t&&t.leaf&&(d=!0),o=i._getChildCheckState(t).maxSelected}else i.hasAttribute("hierarchy")&&!i.selectionByHierarchy&&(d=!0);if(o&&(s||d||a.ctrlKey||a.metaKey))return delete i._selectionStart,i.unselect(r),void delete i._interaction;s||a.ctrlKey||a.metaKey||n(),i.select(r),i._selectionStart={data:t,element:e}}delete i._interaction}_selectAllCheckboxClickHandler(e,t){const a=this;if(void 0===t){const l=a._filterInfo;if(l.inputFilters||l.rowFilters||l.appliedFilters)return void a._selectAllCheckboxClickHandlerFiltering(e);if(t=a.dataSource,a.hasAttribute("hierarchy")&&a._disabledSelection.length>0){const e=t.boundHierarchy,l=a._getChildCheckState({children:e}).maxSelected;return void a._changeSelectionOfMultiple(e.map((e=>e.$.id)),l?"unselect":"select","interaction")}}const l=t.length,i=a._selectedIds.length===l-a._disabledSelection.length+a._selectableGroupRecords.length,n=a._selectedIds.slice(0);if(a._selectedIds=[],i)a._updateCSSOnUnselectAll(e);else{let i,n=0;for(let e=0;e<l;e++){const l=t[e].$.id;-1===a._disabledSelection.indexOf(l)&&(a._selectedIds.push(l),n++)}n===l?i=!0:0===n&&(i=!1),a._updateCSSOnSelectAll(e,i),a._selectableGroupRecords.length>0&&(a._selectedIds=a._selectedIds.concat(a._selectableGroupRecords))}n.length!==a._selectedIds.length&&(a._updateState("selected"),a.$.fireEvent("change",{type:"interaction"}))}_selectAllCheckboxClickHandlerFiltering(e){const t=this,a=t.dataSource,l=t._selectedIds.slice(0),i=[],n=[];let r=0;for(let e=0;e<a.length;e++){const o=a[e];if(!1===o.$.filtered)continue;const s=o.$.id;r++,-1!==l.indexOf(s)&&i.push(s),-1===t._disabledSelection.indexOf(s)&&n.push(s)}const o=i.length===n.length;if(t._selectedIds=t._selectedIds.filter((e=>-1===n.indexOf(e))),o)t._updateCSSOnUnselectAll(e);else{let a;t._selectedIds=t._selectedIds.concat(n),n.length===r?a=!0:0===n.length&&(a=!1),t._updateCSSOnSelectAll(e,a)}l.length!==t._selectedIds.length&&(t._updateState("selected"),t.$.fireEvent("change",{type:"interaction"}))}_updateCSSOnUnselectAll(e){e.classList.remove("indeterminate","selected"),e.firstElementChild.setAttribute("aria-checked",!1),Array.from(this.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)}))}_updateCSSOnSelectAll(e,t){t?(e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0)):!1===t?(e.classList.remove("indeterminate","selected"),e.firstElementChild.setAttribute("aria-checked",!1)):(e.classList.remove("selected"),e.classList.add("indeterminate"),e.firstElementChild.setAttribute("aria-checked","mixed")),Array.from(this.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||(e.parentElement.setAttribute("aria-selected",!0),e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0))}))}_beginEdit(e){const t=this,a=t.editMode,l=e.dataField;let i=e.rowId,n=e.rowElement,r=e.rowObject,o=e.cell,s=[],d=[];if(t.editing){n||(n=t.$.tableContainer.querySelector(`tr[row-id="${i}"]:not([unused])`)),r||(i=n.getAttribute("row-id"),r=t.rowById[i],i=r.data.$.id),"row"===a?(s=n.querySelectorAll("td[data-field]"),d=t._columns.filter((e=>e.visible)).map((e=>e.dataField)),o||(o=l?n.querySelector(`td[data-field="${l}"`):s[0])):(o||(o=n.querySelector(`td[data-field="${l}"`)),s=[o],d=[l]),t._editing={row:r,cells:[]};for(let e=0;e<d.length;e++){const a=s[e];let l=d[e];const n=t.columnByDataField[l];if(!1===n.allowEdit)continue;n.transform&&(l=n.originalDataField);const c=r.data[l],u=t._initEditor(n,i,l,c);let f=u instanceof HTMLInputElement&&"date"===u.type;if(n.editor&&n.editor.template)n.editor.onRender&&n.editor.onRender(i,l,u,c);else if(f)if(c instanceof Date&&!isNaN(c.getTime())){const e=(c.getMonth()+1).toString(),t=c.getDate().toString();u.value=`${c.getFullYear()}-${"0".repeat(2-e.length)}${e}-${"0".repeat(2-t.length)}${t}`}else u.value="";else u.value=void 0===c?"":c;a.classList.add("editing"),a.innerHTML="",a.appendChild(u),a===o&&u.focus&&(u.focus(),n.editor&&n.editor.template||f||!u.select||u.select()),t._editing.cells.push({dataField:l,editor:u,element:a}),t.$.fireEvent("cellBeginEdit",{id:r.data.$.id,row:r.data,value:r.data[l],dataField:l})}"row"===a&&t.$.fireEvent("rowBeginEdit",{id:r.data.$.id,row:r.data})}}_initEditor(e,t,a,l){let i=this._editors[a];if(i)return i;if(e.editor&&e.editor.template){const n=document.createElement("div");return n.innerHTML=e.editor.template,i=n.firstElementChild,i.className="jqx-table-editor",e.editor.onInit&&e.editor.onInit(t,a,i,l),i}return i=document.createElement("input"),i.className="jqx-table-editor standard","number"===e.dataType?i.type="number":"date"===e.dataType?i.type="date":i.type="text",this._editors[a]=i,i}_toggleRowDetail(e,t){const a=this;if(a.virtualization)return void a._toggleRowDetailVirtualization(e,t);const l=e.nextElementSibling;l.classList.toggle("collapsed"),l.classList.contains("collapsed")?(l.setAttribute("aria-hidden",!0),a._expandedRowDetailIds=a._expandedRowDetailIds.filter((e=>e!==t))):(l.removeAttribute("aria-hidden"),a._expandedRowDetailIds.push(t))}_toggleRowDetailVirtualization(e,t){const a=this;let l=e.nextElementSibling;function i(){let e=a.$.virtualizationContainer.$.verticalScrollBar,t=a.$.virtualizationContainer.$.verticalScrollBar.value;a._ignoreVerticalChange=!0,a._refreshDataRows(),t=Math.min(e.max,t),e.value=t,delete a._ignoreVerticalChange,a._onVerticalChange({detail:{value:t}},!0)}if(l&&l.classList.contains("jqx-table-row-detail")&&!l.classList.contains("collapsed"))return l.setAttribute("aria-hidden",!0),a._expandedRowDetailIds=a._expandedRowDetailIds.filter((e=>e!==t)),l.classList.add("collapsed"),l.remove(),void i();const n=e.data;l=document.createElement("tr"),l.classList.add("collapsed"),a._createRowDetailOnDemand(l,{data:n},n),e.parentElement.insertBefore(l,e.nextElementSibling),a._expandedRowDetailIds.push(t),l.classList.remove("collapsed"),i()}_setFocusable(){const e=this,t="jqx-table"===e.nodeName.toLowerCase();if(!e.keyboardNavigation||e.disabled||e.unfocusable||e.hasAttribute("modal"))return e.$.tableContainer.removeAttribute("tabindex"),t&&(e.$.filterInput.unfocusable=!0,e.$.pager.unfocusable=!0),void(e.$.conditionalFormattingButton.unfocusable=!0);const a=e.$.tableContainer.getAttribute("tabindex");(null===a||a<0)&&e.$.tableContainer.setAttribute("tabindex",0),t&&(e.$.filterInput.unfocusable=!1,e.$.pager.unfocusable=!1),e.$.conditionalFormattingButton.unfocusable=!1}_tableContainerFocusHandler(){const e=this;e._focusedCell&&e.$.tableContainer.contains(e._focusedCell)||e._focusCell(e.$.tableContainer.children[1].querySelector("tr:not([unused]) td[data-field], tr:not([unused]) td.group-header"))}_tableContainerDownHandler(e){const t=this.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;this._focusCell(t.closest("td[data-field], td.group-header")),e.stopPropagation()}_focusCell(e,t){const a=this;if(!e||!e.hasAttribute("data-field")&&!e.classList.contains("group-header")||e.parentElement.classList.contains("grand-total"))return!1;if(a._focusedCell){if(a._focusedCell===e)return!1;a._focusedCell.removeAttribute("focus")}if(a._focusedCell=e,e.setAttribute("focus",""),!t)return;const l=a.$.tableContainer.parentElement,i=a.$.header.offsetHeight,n=a.freezeHeader?a.$.tableContainer.firstElementChild.offsetHeight:0,r=l.scrollTop;let o=e.offsetTop-i-n;if(o<r)l.scrollTop=o;else{const t=a.footerRow&&a.freezeFooter?a.$.tableContainer.lastElementChild.offsetHeight:0,s=a.$.pager.offsetHeight,d=l.clientHeight-(i+n+t+s);o+=e.offsetHeight,o>r+d&&(l.scrollTop=o-d)}if(e.classList.contains("freeze-near")||e.classList.contains("freeze-far"))return;const s=l.scrollLeft,d=a.$.tableContainer.querySelector("tr[row-id]:not([unused])");let c,u=0;if(Array.from(d.children).forEach((e=>{e.classList.contains("freeze-near")&&(u+=e.offsetWidth)})),a.rightToLeft){let t=e.previousElementSibling;for(c=0;t;)t.classList.contains("freeze-near")||(c-=t.offsetWidth),t=t.previousElementSibling;if(c>s)l.scrollLeft=c;else{const t=l.clientWidth;c-=e.offsetWidth,c<s-t&&(l.scrollLeft=c+t-u)}}else if(c=e.offsetLeft-u,c<s)l.scrollLeft=c;else{const t=l.clientWidth;c+=e.offsetWidth+u,c>s+t&&(l.scrollLeft=c-t)}}focus(){const e=this;!e.keyboardNavigation||e.disabled||e.unfocusable||e.hasAttribute("modal")||e.$.tableContainer.focus()}blur(){this.$.tableContainer.blur()}_tableContainerKeydownHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target,l=e.key;if("Shift"===l)return void("extended"===t.selectionMode&&t.$.tableContainer.classList.add("jqx-unselectable"));if(!t.contains(a))return;if(a&&"INPUT"===a.nodeName&&!t._editing)return;const i=t._focusedCell;if(!i)return;const n=t.virtualization,r=i.classList.contains("group-header");if(r&&-1!==["ArrowRight","ArrowLeft","Home","End","Escape","F2"].indexOf(l))return void e.preventDefault();if(t._editing){switch(l){case"Enter":t.endEdit();break;case"Escape":t.cancelEdit();break;default:return}return t.$.tableContainer.focus(),void e.preventDefault()}const o=i.parentElement;if(n&&o){const e=t.$.virtualizationContainer.$.verticalScrollBar,a=e.value,i=o.data.$.id;if("ArrowUp"===l&&0===a&&i===t._rowsVirtual[0].data.$.id||"ArrowDown"===l&&a===e.max&&i===t._rowsVirtual[t._rowsVirtual.length-1].data.$.id)return}let s="ArrowRight",d="ArrowLeft";switch(t.rightToLeft&&(s="ArrowLeft",d="ArrowRight"),l){case s:case d:{const a=l===s?"nextElementSibling":"previousElementSibling";let r=i[a];for(;r&&r.classList.contains("jqx-hidden");)r=r[a];t._focusCell(r,!n,e),t._scrollToVirtualization(l===s?"nextArrow":"prevArrow",r);break}case"ArrowUp":case"ArrowDown":{const a="ArrowUp"===l?"previousElementSibling":"nextElementSibling";let s=o[a];for(;s&&(s.classList.contains("jqx-table-row-detail")||s.classList.contains("collapsed"));)s=s[a];s&&(r?t._focusCell(s.querySelector("td[data-field], .group-header"),!n,e):t._focusCell(s.querySelector(`td[data-field="${i.getAttribute("data-field")}"], .group-header`),!n,e),t._scrollToVirtualization(l,s));break}case"Home":t._focusCell(o.querySelector("td[data-field]"),!n,e),t._scrollToVirtualization(l);break;case"End":{const a=o.querySelectorAll("td[data-field]");let i=a.length-1,r=a[i];for(;r.classList.contains("jqx-hidden");)i--,r=a[i];t._focusCell(r,!n,e),t._scrollToVirtualization(l);break}case"PageDown":t._pageDownHandler(i,e);break;case"PageUp":t._pageUpHandler(i,e);break;case"Enter":{const a=o.data;t.dataSource.boundHierarchy&&t._areChildrenFiltered(a)?t._hierarchyArrowClickHandler(o,i,e):t.rowDetailTemplate&&t._toggleRowDetail(o,a.$.id);break}case" ":t._toggleSelection(o,o.data,e);break;case"F2":t.beginEdit(o.data.$.id,i.getAttribute("data-field"));break;default:return}if(e.preventDefault(),t.onKeyboardScroll){const e=n?t.$.virtualizationContainer:t.$.container;t.onKeyboardScroll(l,e.scrollTop,e.scrollLeft)}}_pageDownHandler(e,t){const a=this,l=a.paging;if(!l&&e.parentElement===e.parentElement.parentElement.lastElementChild)return;const i=a.virtualization,n=a.$.tableContainer,r=n.parentElement,o=i?a.$.virtualizationContainer:r;let s=e.getAttribute("data-field");function d(){const e=n.querySelectorAll("tr[row-id]:not([unused])");let t=i?0:a.$.header.offsetHeight+a.$.pager.offsetHeight;a.footerRow&&a.freezeFooter&&(t+=n.lastElementChild.offsetHeight);for(let a=e.length-1;a>=0;a--){const l=e[a];if(!l.classList.contains("collapsed")&&l.offsetTop+l.offsetHeight<=(i?-r.offsetTop:r.scrollTop)+o.clientHeight-t)return l.querySelector(`td[data-field${s}], .group-header`)}}s=s?`="${s}"`:"";let c=d();if(c)if(e===c){const u=(a.freezeHeader?n.firstElementChild.offsetHeight:0)+a._rowHeight;let f;if(i?(f=o.$.verticalScrollBar.value,o.$.verticalScrollBar.value+=o.clientHeight-u):r.scrollTop+=r.clientHeight-u,c=d(),l&&(i&&f===o.$.verticalScrollBar.value||!i&&e===c)){const e=a.pageIndex;a.navigateTo(a.pageIndex+1),a.pageIndex!==e&&(i&&(o.$.verticalScrollBar.value=0),a._focusCell(n.querySelector(`tr[row-id]:not([unused]) td[data-field${s}], tr[row-id]:not([unused]) .group-header`),!i,t))}else a._focusCell(c,void 0,t)}else a._focusCell(c,void 0,t)}_pageUpHandler(e,t){const a=this,l=a.virtualization,i=a.$.tableContainer,n=i.parentElement,r=l?a.$.virtualizationContainer:n;let o=e.getAttribute("data-field");function s(){const e=i.querySelectorAll("tr[row-id]:not([unused])");let t=0;a.freezeHeader&&(t=i.firstElementChild.offsetHeight);for(let a=0;a<e.length;a++){const i=e[a];if(!i.classList.contains("collapsed")&&i.offsetTop>=(l?-n.offsetTop:n.scrollTop)+t)return i.querySelector(`td[data-field${o}], .group-header`)}}o=o?`="${o}"`:"";let d=s();if(d)if(e===d){const c=(a.freezeHeader?i.firstElementChild.offsetHeight:0)+a._rowHeight;let u;if(l?(u=r.$.verticalScrollBar.value,r.$.verticalScrollBar.value-=r.clientHeight-c):n.scrollTop-=n.clientHeight-c,d=s(),a.paging&&(l&&u===r.$.verticalScrollBar.value||!l&&e===d)){const e=a.pageIndex;if(a.navigateTo(a.pageIndex-1),a.pageIndex!==e){l&&(r.$.verticalScrollBar.value=r.$.verticalScrollBar.max);const e=i.querySelectorAll(`tr[row-id]:not([aria-hidden="true"]) td[data-field${o}], tr[row-id]:not([aria-hidden="true"]) .group-header`);a._focusCell(e[e.length-1],!l,t)}}else a._focusCell(d,void 0,t)}else a._focusCell(d,void 0,t)}_tableContainerKeyupHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target;if("Shift"===e.key&&"extended"===t.selectionMode&&t.$.tableContainer.classList.remove("jqx-unselectable"),t.contains(a))return a.classList.contains("filter-value")&&"date"!==a.type?(clearTimeout(t._filterRowTimeout),void(t._filterRowTimeout=setTimeout((function(){const e=t.context;t.context=t,t._applyRowFilters(),t.context=e}),500))):void 0}_tableContainerPointeroverHandler(e){const t=this;if(!t.tooltip)return;const a=(t.isInShadowDOM?e.composedPath()[0]:e.target).closest("tbody td[data-field], thead th[data-field]");if(!a)return;const l=t.$.tableContainer.querySelector(".tooltip"),i=t.columnByDataField[a.getAttribute("data-field")],n=t.virtualization;if(l&&(l.classList.remove("tooltip"),l.removeAttribute("title")),"th"!==a.tagName.toLowerCase())(a.classList.contains("tree-cell")&&a.firstElementChild&&a.firstElementChild.children[1].scrollWidth>a.firstElementChild.children[1].offsetWidth||a.scrollWidth>a.offsetWidth)&&(a.classList.add("tooltip"),a.title=n&&i&&i.templateElement?"":a.innerText);else{const e=a.querySelector(".label");e&&e.scrollWidth>e.offsetWidth&&(a.classList.add("tooltip"),a.title=n&&i&&i.templateElement?"":e.innerText)}}_documentDownHandler(e){const t=this,a=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;function l(){"default"!==t.columnSizeMode&&(t._preventClickSort=!0,clearTimeout(t._dblclickObject.timeout),t._dblclickObject.numberOfClicks++,2===t._dblclickObject.numberOfClicks?(t._dblclickObject.numberOfClicks=0,t._autoResizeColumnOnDblclick()):t._dblclickObject.timeout=setTimeout((function(){t._dblclickObject.numberOfClicks=0}),300))}if(delete t._preventClickSort,t._editing&&!a.closest(".jqx-table-editor")){const e=a.closest(".jqx-drop-down")||a.closest(".jqx-input-drop-down-menu");if(!e)return void t.endEdit();const l=e.ownerElement;if(!l)return void t.endEdit();if(t.$.container.contains(l)&&l.classList.contains("jqx-table-editor"))return;return void t.endEdit()}const i=t.columnReorder,n=t.columnResize;if(i&&!t.columnTotals||n){const r=a.closest("th[data-field]:not(.jqx-pivot-table-total-header)");if(r&&t.$.tableContainer.contains(r)){if(t.$.tableContainer.classList.add("jqx-unselectable"),n&&t._columns.length>1&&!t.hasAttribute("resize-max-reached")){const a=t.rightToLeft,i=r.getBoundingClientRect();let n=null;if(!a&&e.clientX<=i.left+5||a&&e.clientX>=i.right-5){const i=r.previousElementSibling;if(i&&i.hasAttribute("data-field")){if(i.hasAttribute("locked"))return;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.headerCellElement===i){n=a;break}}const r=i.getBoundingClientRect(),o=n&&n.minWidth||t._getNumericMinWidth();return t._resizeDetails={FeedbackShown:!1,Item:i,ItemStart:r[a?"right":"left"]+window.scrollX,Min:o,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date},t._resizeDetails.Max=t._getCurrentResizeMax(),void l()}}if(!a&&e.clientX>=i.right-5||a&&e.clientX<=i.left+5){if(r.hasAttribute("locked"))return;for(let e=0;e<t.columns.length;e++){const a=t.columns[e];if(a.headerCellElement===r){n=a;break}}const o=n&&n.minWidth||t._getNumericMinWidth();return t._resizeDetails={FeedbackShown:!1,Item:r,ItemStart:i[a?"right":"left"]+window.scrollX,Min:o,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date},t._resizeDetails.Max=t._getCurrentResizeMax(),void l()}}i&&(t._dragDetails={FeedbackShown:!1,Item:r,StartPosition:{left:e.pageX,top:e.pageY},StartTime:new Date})}}}_documentMoveHandler(e){const t=this,a=t._dragDetails;if(!a)return void(t._resizeDetails&&t._handleResizeOnMove(e));if(!a.FeedbackShown){const l=(new Date).getTime()-a.StartTime.getTime()>500,i=Math.abs(a.StartPosition.left-e.pageX)>5||Math.abs(a.StartPosition.top-e.pageY)>5;if(!i||!(!t._isMobile||t._isMobile&&l))return void(t._isMobile&&i&&!l&&(delete t._dragDetails,t.$.tableContainer.classList.remove("jqx-unselectable")));t._hideBodyOverflow(),a.Feedback=t._addDragFeedback(),a.FeedbackShown=!0,a.Item.classList.add("dragged"),t.classList.add("jqx-unselectable")}const l=t.$.tableContainer.parentElement;a.Feedback.style.left=e.pageX+10+"px",a.Feedback.style.top=e.pageY+10+"px",a.HoveredItem&&(a.HoveredItem.classList.remove("drop-column","left","right"),delete a.HoveredItem),l.offsetWidth<l.scrollWidth&&(clearInterval(t._dragInterval),t._dragInterval=setInterval((function(){const a=l.getBoundingClientRect();a.left<=e.clientX&&a.left+a.width>=e.clientX?e.clientX>=a.left&&e.clientX<=a.left+25?l.scrollLeft-=t._autoScrollCoefficient:e.clientX>=a.left+a.width-25&&e.clientX<=a.left+a.width?l.scrollLeft+=t._autoScrollCoefficient:clearInterval(t._dragInterval):clearInterval(t._dragInterval)}),10));const i=t._getClosestThToHover(e);i&&(i.classList.add("drop-column"),a.HoveredItem=i)}_hideBodyOverflow(){const e=(document.scrollingElement||document.documentElement).scrollHeight>document.documentElement.clientHeight,t=(document.scrollingElement||document.documentElement).scrollWidth>document.documentElement.clientWidth;this._originalBodyOverflow={overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY,overflow:document.body.style.overflow},document.body.classList.add("jqx-dragging"),document.body.style.overflow=document.body.style.overflowX=document.body.style.overflowY="",e&&!t?document.body.style.overflowX="hidden":t&&!e?document.body.style.overflowY="hidden":t||e||(document.body.style.overflow="hidden")}_addDragFeedback(){const e=this,t=e._dragDetails.Item,a=document.createElement("div");return a.className="jqx-table-feedback",a.setAttribute("parent-table-id",e.id),a.innerHTML=e.columnByDataField[t.getAttribute("data-field")].label,e.theme&&a.setAttribute("theme",e.theme),document.body.appendChild(a),a}_getClosestThToHover(e){const t=e.clientX,a=Array.from(this.$.tableContainer.querySelectorAll("th[data-field]:not(.jqx-pivot-table-total-header)"));let l,i,n;for(let e=0;e<a.length;e++){const r=a[e];if(!r||this._dragDetails.Item===r)continue;const o=r.getBoundingClientRect(),s=Math.abs(t-o.left),d=Math.abs(t-o.right),c=Math.min(s,d);if(!(void 0===i||c<i))break;l=r,i=c,n=s<d?"left":"right"}return l&&l.classList.add(n),l}_handleResizeOnMove(e){const t=this,a=t._resizeDetails;if(!a.FeedbackShown){const l=(new Date).getTime()-a.StartTime.getTime()>500,i=Math.abs(a.StartPosition.left-e.pageX)>=1||Math.abs(a.StartPosition.top-e.pageY)>=1;if(!i||!(!t._isMobile||t._isMobile&&l))return void(t._isMobile&&i&&!l&&(delete t._resizeDetails,t.$.tableContainer.classList.remove("jqx-unselectable","resizing"),document.body.style.cursor=null));a.Feedback=t._addResizeFeedbacks(),a.FeedbackShown=!0,t.classList.add("jqx-unselectable","resizing"),document.body.style.cursor="col-resize"}const l=a.Feedback,i=a.ItemStart;let n;t.rightToLeft?(n=Math.min(a.Max,Math.max(a.Min,Math.round(i-e.pageX))),l.style.left=i-n+"px"):(n=Math.min(a.Max,Math.max(a.Min,Math.round(e.pageX-i))),l.style.left=i+n+"px"),l.classList.toggle("min",n===a.Min),l.classList.toggle("max",n===a.Max),t.columnResizeFeedback&&(l.innerHTML=n+"px"),a.Width=n}_addResizeFeedbacks(){const e=this,t=e._resizeDetails,a=e.$.container.getBoundingClientRect(),l=a.top+window.scrollY+"px",i=a.height+"px",n=document.createElement("div"),r=document.createElement("div");return r.className="jqx-table-resize-feedback static",r.setAttribute("parent-table-id",e.id),r.style.top=l,r.style.left=t.ItemStart+"px",r.style.height=i,e._resizeDetails.StaticFeedback=r,n.className="jqx-table-resize-feedback",n.setAttribute("parent-table-id",e.id),n.style.top=l,n.style.height=i,e.theme&&(r.setAttribute("theme",e.theme),n.setAttribute("theme",e.theme)),document.body.appendChild(n),document.body.appendChild(r),n}_resolveResize(e){const t=this,a=t._resizeDetails;if(delete t._resizeDetails,t.$.tableContainer.classList.remove("jqx-unselectable","resizing"),e){if(!a.FeedbackShown)return;a.StaticFeedback.remove(),a.Feedback.remove()}const l=t._columns.find((e=>e.headerCellElement===a.Item));t.classList.remove("jqx-unselectable","resizing"),document.body.style.cursor=null;let i=a.Width;i<parseInt(t.columnMinWidth)&&(i=parseInt(t.columnMinWidth));const n=t._getTableRemainingWidth();if(l){const e=l._isResponsive||!!(l.width&&l.width.toString().indexOf("%")>=0);if(delete l.width,l.minWidth&&i<l.minWidth&&(i=l.minWidth),l._manualWidth=i,l._manualPercentageWidth=parseFloat(i/n*100),l._isResponsive=e,a.Item.style.width=l._isResponsive?parseFloat(i/n*100)+"%":i+"px",l._isFillRemainingWidth){let e=!0;for(let a=0;a<t._columns.length;a++){const l=t._columns[a];if(!l.width&&!l._manualWidth){e=!1;break}}!t.columnResizeNormalize&&e&&(t.columns.push({dataField:"",label:"",visible:!0,allowResize:!1,allowFilter:!1,allowSort:!1}),t._initColumns(!0),t.refresh())}}else a.Item.style.width=i+"px";t._handleAutoSizeMode(l),t._handleFrozenColumnPositions(),t._refreshHorizontalScrollbar();const r=parseFloat(i/n*100);l&&t.$.fireEvent("columnResize",{dataField:l.dataField,headerCellElement:a.Item,widthInPercentages:r,width:i})}openColumnMenu(e){const t=this,a=t.columnByDataField[e];if(!a)return;const l=a.headerCellElement;if(!l)return;if(a&&!1===a.allowMenu)return;const i=l.querySelector(".column-menu");if(!i)return;const n=()=>{const e=c.getBoundingClientRect(),a=t.activeColumnMenu;t._columnsSettingsMenu.style.top=e.top+window.scrollY+"px",t._columnsSettingsMenu.style.left=e.right+window.scrollX+"px",e.right-i.offsetWidth+window.scrollX+a.offsetWidth>t.getBoundingClientRect().right&&(t._columnsSettingsMenu.style.left=10+e.right-a.offsetWidth-t._columnsSettingsMenu.offsetWidth+window.scrollX+"px")},r=()=>{const e=a.headerCellElement;e.hasAttribute("column-menu-button")||e.setAttribute("column-menu-button","");const l=e.querySelector(".column-menu"),i=l.getBoundingClientRect();o.style.top=i.bottom+10+window.scrollY+"px",o.style.left=i.right-l.offsetWidth+window.scrollX+"px",i.right-l.offsetWidth+window.scrollX+o.offsetWidth>t.getBoundingClientRect().right&&(o.style.left=i.right-o.offsetWidth+window.scrollX+"px");const n=o.querySelector("input");n&&n.focus()};a.columnMenu&&a.columnMenu.remove(),t.closeColumnMenu();const o=document.createElement("div");o.classList.add("jqx-table-column-menu","wrapper"),o.owner=l,o.dataField=e;const s=document.createElement("div");s.innerHTML=`<span class='menu-icon sort-asc'></span><span class="label">${t.localize("columnMenuItemSortAsc")}</span>`,s.classList.add("jqx-table-menu-item");const d=document.createElement("div");d.innerHTML=`<span class='menu-icon sort-desc'></span><span class="label">${t.localize("columnMenuItemSortDesc")}</span>`,d.classList.add("jqx-table-menu-item");const c=document.createElement("div");c.innerHTML=`<span class='menu-icon columns'></span><span class="label">${t.localize("columnMenuItemColumns")}</span>`,c.classList.add("jqx-table-menu-item","columns-item");const u=document.createElement("div");u.innerHTML=`<span class='menu-icon filter-by'></span><span class="label">${t.localize("columnMenuItemFilter")}</span>`,u.classList.add("jqx-table-menu-item","filter-item");const f=document.createElement("div");f.innerHTML=`<span class='menu-icon filter-by-remove'></span><span class="label">${t.localize("columnMenuItemRemoveFilter")}</span>`,f.classList.add("jqx-table-menu-item","remove-filter-item","jqx-hidden");const m=document.createElement("div");m.innerHTML=`<span class='menu-icon sort-remove'></span><span class="label">${t.localize("columnMenuItemRemoveSort")}</span>`,m.classList.add("jqx-table-menu-item","remove-sort-item","jqx-hidden");const h=document.createElement("div");h.innerHTML=`<span class='menu-icon reset'></span><span class="label">${t.localize("columnMenuItemReset")}</span>`,h.classList.add("jqx-table-menu-item","reset-item"),c.onmouseleave=e=>{const a=t._columnsSettingsMenu.getBoundingClientRect();e.pageX>=a.left-20&&e.pageX<=a.right+20&&e.pageY>=a.top-20&&e.pageY<=a.bottom+20||t._columnsSettingsMenu&&t._columnsSettingsMenu.remove()},c.onmouseenter=()=>{t._columnsSettingsMenu=(()=>{t._columnsSettingsMenu&&t._columnsSettingsMenu.remove();const a=document.createElement("div");a.classList.add("jqx-table-column-menu","wrapper","jqx-table-columns-menu");let l=0,i=null;for(let o=0;o<t.columns.length;o++){const s=document.createElement("div");s.innerHTML=`<span class='column-item menu-icon'></span><span class="label">${t.columns[o].label}</span>`,s.classList.add("jqx-table-menu-item"),s.column=t.columns[o],e!==s.column.dataField&&!1!==s.column.allowHide&&(s.column.visible?(l++,i=s):s.firstElementChild.classList.add("off"),s.onpointerdown=e=>{s.column.visible=!s.column.visible,s.column.visible?s.firstElementChild.classList.remove("off"):s.firstElementChild.classList.add("off"),r(),n(),e.stopPropagation(),e.preventDefault()},a.appendChild(s))}return 1===l&&i&&i.classList.add("jqx-disabled"),document.body.appendChild(a),a})(),n()};const p=t._createFilterRowInput(a);if(t.filtering&&!1!==a.allowFilter)if(t.filterRow)o.insertBefore(f,o.firstElementChild);else{o.innerHTML=p,o.insertBefore(u,o.firstElementChild);const e=o.querySelector(".filter-value");e.onkeyup=a=>{"Enter"===a.key&&t.closeColumnMenu(),"Escape"===a.key&&(e.value="")},e.nextElementSibling.onchange=()=>{t._applyRowFilters()}}o.insertBefore(h,o.firstElementChild),o.insertBefore(c,o.firstElementChild),o.insertBefore(m,o.firstElementChild),!1!==a.allowSort&&"none"!==t.sortMode&&(o.insertBefore(d,o.firstElementChild),o.insertBefore(s,o.firstElementChild),a.headerCellElement.hasAttribute("aria-sort")&&(m.classList.remove("jqx-hidden"),"ascending"===a.headerCellElement.getAttribute("aria-sort")?s.classList.add("jqx-disabled"):d.classList.add("jqx-disabled")),m.onclick=()=>{t.sortBy(a.dataField,null),t.closeColumnMenu()},s.onclick=()=>{t.sortBy(a.dataField,"asc"),t.closeColumnMenu()},d.onclick=()=>{t.sortBy(a.dataField,"desc"),t.closeColumnMenu()}),h.onclick=()=>{if(t._initialState){if(t.loadState(t._initialState),t._filterInfo.filterRowValues&&delete t._filterInfo.filterRowValues,t.clearFilters(),t.filterRow){const e=t.$.tableContainer.querySelector(".jqx-table-filter-row");e&&e.remove()}t._initRows(),t.refresh()}t.closeColumnMenu()};const g=t.columns.findIndex((e=>e.dataField===a.dataField));t.appendChild(o);const _=o.lastElementChild.children[2];_&&(_.onclick=()=>{const e=_.parentElement.firstElementChild,a=_.parentElement.children[1];e.value="",-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(a.$.input.dataValue)&&(a.value=t.localize("text"===e.type?"CONTAINS":"EQUAL"),delete a.$.input.dataValue),t._applyRowFilters()});const b=t._filterInfo&&t._filterInfo.filterRowValues?t._filterInfo.filterRowValues[g]:null;if(b&&!t.filterRow){const e=o.lastElementChild,l=a.dataType,i=t._filterInfo["string"===l?"stringConditions":"numberAndDateConditions"].find((e=>e.value===b.condition));if(-1===["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(i.value))if("date"===l){const t=new Date(b.value),a=(t.getMonth()+1).toString(),l=t.getDate().toString();e.children[0].value=`${t.getFullYear()}-${"0".repeat(2-a.length)}${a}-${"0".repeat(2-l.length)}${l}`}else e.children[0].value=b.value;e.children[1].value=i.label,e.children[1].$.input.dataValue=i.value,e.children[2].classList.remove("jqx-hidden")}a.headerCellElement.hasAttribute("filter")&&f.classList.remove("jqx-hidden"),f.onclick=()=>{t.removeFilter(a.dataField),t.closeColumnMenu()},r(),a.columnMenu=t.activeColumnMenu=o,t.$.fireEvent("openColumnMenu",{dataField:e})}closeColumnMenu(){const e=this;e.activeColumnMenu&&(e.activeColumnMenu.owner.hasAttribute("column-menu-button")&&e.activeColumnMenu.owner.removeAttribute("column-menu-button"),e._columnsSettingsMenu&&e._columnsSettingsMenu.remove(),e.$.fireEvent("closeColumnMenu",{dataField:e.activeColumnMenu.dataField}),e.activeColumnMenu.remove(),delete e.activeColumnMenu)}_documentUpHandler(e){const t=this,a=t._dragDetails;if(t.activeColumnMenu){const a=e.originalEvent?e.originalEvent:e;if(a){let e=!1,l=a.target;for(;l;)if(l=l.parentNode,l===t){e=!0;break}(t.activeColumnMenu.contains(a.target)||t._columnsSettingsMenu&&t._columnsSettingsMenu.contains(a.target))&&(e=!0);const i=t.activeColumnMenu.querySelector("jqx-input");i&&i.$.scrollView.contains(a.target)&&(e=!0),e||t.closeColumnMenu()}}if(t._selectDrag)return t.$.main.classList.remove("prevent-scroll"),void delete t._selectDrag;if(!a)return t._resizeDetails&&t._resolveResize(!0),void t.$.tableContainer.classList.remove("jqx-unselectable");if(delete t._dragDetails,t.$.tableContainer.classList.remove("jqx-unselectable"),!a.FeedbackShown)return;const l=a.HoveredItem;document.body.classList.remove("jqx-dragging"),document.body.style.overflow=t._originalBodyOverflow.overflow,document.body.style.eoverflowX=t._originalBodyOverflow.overflowX,document.body.style.overflowY=t._originalBodyOverflow.overflowY,delete t._originalBodyOverflow,t.classList.remove("jqx-unselectable"),a.Item.classList.remove("dragged"),document.body.removeChild(a.Feedback),clearInterval(t._dragInterval),delete t._dragInterval,l&&t._applyColumnReorder(a,l),t._preventClickSort=!0,requestAnimationFrame((()=>delete t._preventClickSort))}_applyColumnReorder(e,t){const a=this,l=a.rightToLeft,i=a._columns,n=e.Item.getAttribute("data-field"),r=i.find((e=>e.dataField===n)),o=t.getAttribute("data-field"),s=t.classList.contains("right"),d=a._columns.filter((e=>e.dataField!==n)),c=d.findIndex((e=>e.dataField===o));t.classList.remove("drop-column","left","right"),s&&!l||!s&&l?d.splice(c+1,0,r):d.splice(c,0,r),i.map((e=>e.dataField)).join(",")!==d.map((e=>e.dataField)).join(",")&&(a.columns=d,a._initColumns(),a.refresh())}_applyRowFilters(){const e=this;if(!e.filtering||!e.filterRow&&!e.columnMenu)return;const t=e.filterRow?e.$.tableContainer.querySelector(".jqx-table-filter-row"):null,a=Number(e.selection),l=e._columns.filter((e=>e.visible)),i=[],n=[];for(let r=0;r<l.length;r++){const o=l[r].dataField,s=l[r].dataType;if(l[r].headerCellElement&&l[r].headerCellElement.hasAttribute("filter")&&l[r].headerCellElement.removeAttribute("filter"),!e.filterRow&&!l[r].columnMenu){n.push(null);continue}const d=e.filterRow?t.children[r+a].firstElementChild:l[r].columnMenu.lastElementChild,c=d.children[2];let u=d.firstElementChild.value,f=d.children[1].value;"string"===s?f=e._filterInfo.stringConditions.find((e=>e.label===f)).value:(f=e._filterInfo.numberAndDateConditions.find((e=>e.label===f)).value,""!==u&&("number"===s?(u=parseFloat(u),isNaN(u)&&(d.firstElementChild.value="",u="")):"date"===s&&(u=new Date(u),u.setHours(0,0,0))));const m=-1!==["EMPTY","NOT_EMPTY","NULL","NOT_NULL"].indexOf(f);if(""!==u||m){const e=new JQX.Utilities.FilterGroup,t=e.createFilter(s,u,f);e.addFilter("or",t),i.push([o,e]),c.classList.remove("jqx-hidden"),n.push({condition:f,value:u}),l[r].headerCellElement&&l[r].headerCellElement.setAttribute("filter","")}else c.classList.add("jqx-hidden"),n.push(null),l[r].headerCellElement&&l[r].headerCellElement.hasAttribute("filter")&&l[r].headerCellElement.removeAttribute("filter");m?d.firstElementChild.setAttribute("disabled",!0):d.firstElementChild.removeAttribute("disabled")}i.length>0?(e.dataSource.virtualDataSource||e.dataSource._filter(i,e.filterOperator),e._filterInfo.rowFilters=i,e._filterInfo.filterRowValues=n,delete e._filterInfo.appliedFilters,e._fullRefresh("filter"),e._updateState("filtered"),e._doNotFireEvent||e.$.fireEvent("filter",{action:"add",filters:i})):e._filterInfo.rowFilters?(e._filterInfo.filterRowValues&&delete e._filterInfo.filterRowValues,e.clearFilters()):e._filterInfo.filterRowValues&&delete e._filterInfo.filterRowValues}_clearFilterInput(){const e=this;e._filterInfo.query="",delete e._filterInfo.inputFilters,e.$.filterInput.value=""}_clearRowFilters(e){const t=this;if(!t._filterInfo.rowFilters)return;const a=t.$.tableContainer.querySelector(".jqx-table-filter-row"),l=t.selection?1:0;let i=t._columns.filter((e=>e.visible));if(e&&(i=t._columns.filter((t=>t.dataField===e))),a)for(let e=0;e<i.length;e++){const t=a.children[e+l]?a.children[e+l].firstElementChild:null;t&&(t.firstElementChild.value="",t.children[2].classList.add("jqx-hidden")),i[e].headerCellElement&&i[e].headerCellElement.hasAttribute("filter")&&i[e].headerCellElement.removeAttribute("filter")}delete t._filterInfo.rowFilters}_createFooterRow(e){const t=this,a=t.footerRow;if(!a)return;if(e)return void t.$.tableContainer.appendChild(e);const l=document.getElementById(a);if(l&&l instanceof HTMLTemplateElement){const e=document.createElement("tfoot"),a=document.importNode(l.content,!0);e.appendChild(a),t.$.tableContainer.appendChild(e)}else t.footerRow=null}_createCustomHeaderRow(){const e=this,t=e.$.tableContainer.firstElementChild;let a=e.headerRow;if(a){if("function"==typeof a)a.call(e,t);else if("string"==typeof a){const e=document.getElementById(a);if(!e)return void(t.innerHTML=`<tr><th>${a}</th></tr>`);a=e}a instanceof HTMLTemplateElement?t.appendChild(document.importNode(a.content,!0)):a.nodeName?t.appendChild(a):e.headerRow=null}}_updateSelectAllState(e){const t=this;if(!t.selection||"cell"===t.selectionMode)return;const a=t.$.tableContainer.querySelector(".jqx-table-select-all");let l;if(void 0===e){const a=t.dataSource,i=t._filterInfo;if(i.inputFilters||i.rowFilters||i.appliedFilters){const i=t._selectedIds;e=0,l=0;for(let t=0;t<a.length;t++){const n=a[t];if(!1===n.$.filtered)continue;const r=n.$.id;e++,-1!==i.indexOf(r)&&l++}}else e=t.dataSource.length}void 0===l&&(l=t._selectedIds.length),0===l||0===e?(a.classList.remove("selected","indeterminate"),a.firstElementChild.setAttribute("aria-checked",!1)):l===e+t._selectableGroupRecords.length?(a.classList.remove("indeterminate"),a.classList.add("selected"),a.firstElementChild.setAttribute("aria-checked",!0)):(a.classList.remove("selected"),a.classList.add("indeterminate"),a.firstElementChild.setAttribute("aria-checked","mixed"))}_resizeHandler(){const e=this;clearTimeout(e._resizeTimeout);const t=()=>{if(JQX.Utilities.Core.Browser.Firefox&&e.virtualization){const t=e.$.virtualizationContainer.$.verticalScrollBar.value;e._onVerticalChange({detail:{value:t}},!0)}};t(),"default"===e.columnSizeMode&&e._handleAutoSizeMode(),e._resizeTimeout=setTimeout((function(){if(e.columnGroups&&e._columns.some((e=>e.responsivePriority&&e.responsivePriority>1)))return void e.refresh();const a=e.offsetWidth,l=e.offsetHeight;if(e.virtualization&&e._cachedHeight!==l){const i=e._getFractionOfMax();return e._refreshDataRows(),e._setFractionOfMax(i),e._cachedWidth=a,e._cachedHeight=l,void t()}e._handleAutoSizeMode(),e._handleFrozenColumnPositions(),e._refreshHorizontalScrollbar(),e._cachedWidth=a,e._cachedHeight=l,t()}),75)}_hierarchyArrowClickHandler(e,t){const a=this,l=!a.grouping,i=e.data;if(a.animation=a._animation,a.expandHierarchy&&(a._collapsedIds||(a._collapsedIds=[]),!0===i.expanded?a._collapsedIds[i.$.id]=!0:delete a._collapsedIds[i.$.id],a.dataSource&&a.expandHierarchy&&(a.dataSource._collapsedIds=a._collapsedIds)),l&&a.dataSource.virtualDataSource&&!i.expanded&&i.children&&0===i.children.length)return a._requestVirtualDataSource("expand",void 0,i),void a.$.fireEvent("expand",{id:i.$.id,record:i});if(a.virtualization)return void a._hierarchyArrowClickHandlerVirtualization(e,t);const n=a.$.tableContainer,r=i.$.id;function o(e){e.forEach((e=>{a._expandSingleChildRow(n.querySelector(`tr[row-id="${e.$.id}"]:not([unused])`)),e.children&&e.expanded&&requestAnimationFrame((()=>o(e.children)))}))}if(i.expanded?function e(t){t.forEach((t=>{a._collapseSingleChildRow(n.querySelector(`tr[row-id="${t.$.id}"]:not([unused])`)),t.children&&e(t.children)}))}(i.children):requestAnimationFrame((()=>o(i.children))),i.expanded=!i.expanded,e.setAttribute("aria-expanded",i.expanded),e.classList.toggle("expanded",i.expanded),l)i.expanded?(-1===a._expandedIds.indexOf(r)&&a._expandedIds.push(r),a._expandedIdsAlt[r]=!0,a.$.fireEvent("expand",{id:i.$.id,record:i})):(a._expandedIds=a._expandedIds.filter((e=>e!==r)),delete a._expandedIdsAlt[r],a.$.fireEvent("collapse",{id:i.$.id,record:i})),a._updateState("expanded");else if(!0!==t){let e=""+i.$.id;e=e.replace("Item","").replace(/_/gi,"."),i.expanded?a.$.fireEvent("group",{action:"expand",path:e,dataField:i.groupDataField,label:i.label}):a.$.fireEvent("group",{action:"collapse",path:e,dataField:i.groupDataField,label:i.label})}}_expandSingleChildRow(e,t=[]){e&&(t.push(!1),"none"!==this.animation?(e.classList.remove("jqx-hidden"),requestAnimationFrame((()=>{e.classList.add("no-height"),e.ontransitionend=function(){e.classList.remove("no-height"),e.ontransitionend=null,t.pop()},e.removeAttribute("aria-hidden"),e.classList.remove("collapsed")}))):(e.removeAttribute("aria-hidden"),e.classList.remove("collapsed","jqx-hidden"),t.pop()))}_collapseSingleChildRow(e,t=[]){e&&(t.push(!1),"none"!==this.animation?e.ontransitionend=function(){e.classList.add("jqx-hidden"),e.ontransitionend=null,t.pop()}:(e.classList.add("jqx-hidden"),t.pop()),e.setAttribute("aria-hidden",!0),e.classList.add("collapsed"))}_getGroupByIndex(e){"number"==typeof e&&(e=e.toString());const t=this.dataSource.boundHierarchy,a=e.split(".");let l=t[a[0]];if(l){for(let e=1;e<a.length;e++)if(l=l.children[a[e]],!l||l.leaf)return;return l}}getGroupChildren(e){"number"==typeof e&&(e=e.toString());const t=this.dataSource.boundHierarchy,a=e.split(".");let l=t[a[0]];if(!l)return[];for(let e=1;e<a.length;e++)if(l=l.children[a[e]],!l||l.leaf)return[];return l.children}_createDialog(){const e=this,t=document.createElement("jqx-window"),a=document.createElement("template"),l=` animation=${e.animation} theme="${e.theme}"${e.rightToLeft?" right-to-left":""}${!e.keyboardNavigation||e.unfocusable?" unfocusable":""}`;a.innerHTML=`<jqx-button class="ok primary"${l}>${e.localize("ok")}</jqx-button>\n<jqx-button class="cancel"${l}>${e.localize("cancel")}</jqx-button>`,t.animation=e.animation,t.footerTemplate=a,t.headerButtons=["close"],t.rightToLeft=e.rightToLeft,t.theme=e.theme,t.unfocusable=!e.keyboardNavigation||e.unfocusable,t.className="jqx-table-window",t.ownerElement=e,e._dialog=t,e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(t),e.setAttribute("aria-owns",t.id)}_addDialogHandlers(){const e=this,t=e._dialog;t.addEventListener("close",e._dialogEventHandler),t.addEventListener("click",e._dialogEventHandler)}_dialogEventHandler(e){const t=this,a=t.ownerElement,l=t.isInShadowDOM?e.composedPath()[0]:e.target,i=e.type,n=a.context;if(a.context=a,"close"===i){if(l!==t)return void(a.context=n);const e=t.classList.contains("conditional-formatting"),i=t.classList.contains("fields");t.ok?(e&&a._applyConditionalFormatting(),delete t.ok):e&&JSON.stringify(a._formattingPanel.items)!==JSON.stringify(a._formattingPanel.getItems())&&(a._formattingPanel.$.itemsContainer.innerHTML="",a._formattingPanel._addDefaultItems()),t.content.innerHTML="",t.classList.remove("conditional-formatting","drill-down","fields"),!a.keyboardNavigation||a.disabled||a.unfocusable||(a.$.tableContainer.setAttribute("tabindex",0),"jqx-table"===a.nodeName.toLowerCase()&&(a.$.filterInput.unfocusable=!1,a.$.pager.unfocusable=!1),a.$.conditionalFormattingButton.unfocusable=!1),a.removeAttribute("modal"),e?a.$.conditionalFormattingButton.focus():i&&a.$.fieldsButton?a.$.fieldsButton.focus():a.$.tableContainer.focus()}else"click"===i&&t.$.footer.contains(l)&&(l.closest(".ok")?(t.ok=!0,t.close()):l.closest(".cancel")&&t.close());a.context=n}_openDialog(e,t,a){const l=this;l._dialog||l._createDialog();const i=l._dialog;i.label=e,i.classList.add(a),i.appendChild(t),l.$.tableContainer.removeAttribute("tabindex"),"jqx-table"===l.nodeName.toLowerCase()&&(l.$.filterInput.unfocusable=!0,l.$.pager.unfocusable=!0),"drill-down"!==a?i.setAttribute("aria-controls",l.$.tableContainer.id):i.removeAttribute("aria-controls"),l.$.conditionalFormattingButton.unfocusable=!0,l.setAttribute("modal",""),i.open()}_conditionalFormattingButtonClickHandler(e,t,a){const l=this;let i;l._formattingPanel?i=l._formattingPanel:(i=document.createElement("jqx-formatting-panel"),i.animation=l.animation,i.columns=t||l._columns,i.dataSource=a||l.dataSource,i.locale=l.locale,i.messages=l.messages,i.rightToLeft=l.rightToLeft,i.theme=l.theme,i.unfocusable=!l.keyboardNavigation||l.unfocusable,i.ownerElement=l,l._formattingPanel=i),l.conditionalFormatting&&(i.items=l.conditionalFormatting.slice(0)),l._openDialog(l.localize("conditionalFormatting"),i,"conditional-formatting")}_transformDataSource(){const e=this;if(!e.isRendered&&e.dataTransform){const t=e.dataSource;for(let a=0;a<t.length;a++)e.dataTransform(t[a])}}_applyInitialConditionalFormatting(e){const t=this,a=t.conditionalFormatting;if(!a||0===a.length)return void(t._conditionalFormatting=null);const l=t._defaults,i=new JQX.Utilities.ConditionalFormatter(e),n=[];let r;if("jqx-pivot-table"===t.nodeName.toLowerCase()){const e=t._dynamicColumns;r=function(t){return"all"===t?e.map((e=>e.id)):e.filter((e=>e.dataFields[e.dataFields.length-1].dataField===t)).map((e=>e.id))}}else r=function(e){return"all"===e?t._columns.map((e=>e.value)):[e]};for(let e=0;e<a.length;e++){a[e]=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:l.fontFamily,fontSize:l.fontSize,text:l.text,highlight:l.highlight},a[e]);const t=a[e],o=r(t.column),s=t.condition;i.color=t.highlight,i.comparator=t.firstValue,i.min=t.firstValue,i.max=t.secondValue;const d=i.format(s,o);for(let e in d){const a=d[e];for(let e in a){const l=a[e];l.color=t.text,l.fontFamily=t.fontFamily,l.fontSize=t.fontSize}}n.push(d)}if(t._formattingPanel&&(t._formattingPanel.items=a.slice(0)),0===n.length)return n[0];const o={};for(let e=0;e<n.length;e++){const t=n[e];for(let e in t){const a=t[e];o[e]||(o[e]={});for(let t in a)o[e][t]=Object.assign({},o[e][t],a[t])}}t._conditionalFormatting=o}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_applyConditionalFormatting(){const e=this,t=e._conditionalFormatting;e._conditionalFormatting=e._formattingPanel.apply(),e.conditionalFormatting=e._formattingPanel.getItems(),e._conditionalFormatting!==t&&e._refreshDataRows()}_updateState(e,t){const a=this;let l;if("selected"===e&&(l=a.getSelection(),a.selected=l),-1===a.stateSettings.indexOf(e))return;const i=a._state;switch(e){case"columns":i.columns=a._columns;break;case"expanded":i.expanded=a._expandedIds;break;case"filtered":i.filtered=a._filterInfo;break;case"grouped":i.grouped=a.dataSource.groupBy._array.slice(0);break;case"selected":i.selected=l;break;case"sorted":i.sorted=a._sortColumns||[]}a.autoSaveState&&a.isRendered&&!1!==t&&window.localStorage.setItem("smartTable"+a.id,a._stringifyState())}_stringifyState(){const e=this,t=JSON.parse(JSON.stringify(e._state));return["columns","expanded","filtered","grouped","selected","sorted"].forEach((a=>{-1===e.stateSettings.indexOf(a)&&delete t[a]})),JSON.stringify(t,(function(e,t){if(!("function"==typeof t||t instanceof HTMLElement||"sortOrder"===e||"thHierarchy"===e))return t}))}_handleAutoSizeMode(){const e=this;if("default"===e.columnSizeMode){const t=e._columns.filter((e=>e.visible)),a=[],l=t=>{const a=t.headerCellElement;if(!a)return;const l=parseInt(t.minWidth||e.columnMinWidth);a.offsetWidth<l?a.style.width=l+"px":(a.style.width="",a.offsetWidth<l&&(a.style.width=l+"px"))};t.forEach((t=>{if(t.width||t._manualWidth||(l(t),a.push(t)),t.width&&"string"==typeof t.width&&t.width.endsWith("%")){const a=e._getColumnWidth(t.width,!1,t);!1===t.autoWidth?t.headerCellElement.style.width=t.width:(t.headerCellElement.setAttribute("responsive-width",t.width),t.headerCellElement.style.width=a+"px")}else if(t._manualPercentageWidth)if(t._isResponsive){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t);!1===t.autoWidth?t.headerCellElement.style.width=t.width:(t.headerCellElement.setAttribute("responsive-width",t._manualPercentageWidth+"%"),t.headerCellElement.style.width=a+"px")}else t.headerCellElement.style.width=t._manualWidth+"px"}));for(let e=0;e<a.length;e++)l(a[e]);if(e.columnResizeNormalize&&""===e._columns[e._columns.length-1].dataField){const t=e._columns[e._columns.length-1].headerCellElement.offsetWidth;if(t){let a=[];e._columns.forEach((e=>{e.width&&e.width.indexOf&&e.width.indexOf("%")>=0&&a.push(e)}));let l=t/a.length;a.forEach((e=>{e.width&&e.width.indexOf&&e.width.indexOf("%")>=0&&(e.headerCellElement.style.width=parseInt(e.headerCellElement.style.width)+l+"px")}))}}return}const t=e._columns.filter((e=>e.visible)),a=e._getNumericMinWidth();let l,i;t.forEach((e=>{e.width||e._manualWidth||(l||(l=e),i=e,e.headerCellElement.style.width=null)}));const n=e.$.tableContainer.offsetWidth-(e.selection?e.$.tableContainer.querySelector(".jqx-table-select-all").offsetWidth:0);let r=new Map,o=0,s=0,d=0;e.removeAttribute("resize-max-reached"),e.setAttribute("auto-size",""),l&&(l.headerCellElement.style.width="100%");for(let i=0;i<t.length;i++){const n=t[i];if(n===l){d++;continue}const c=n.headerCellElement;let u,f;n.width?(u=f=e._getColumnWidth(n.width,!1,n),n.minWidth&&u<f&&(u=n.minWidth,f=n.minWidth)):n._manualWidth?(u=n._manualWidth,f=n.minWidth||a,u<f&&(u=f)):(u=Math.max(c.offsetWidth,a),f=n.minWidth||a,d++),o+=u,s+=f,n._isResponsive&&(u=e._getColumnWidth(n._manualPercentageWidth+"%",!1,n),u<f&&(u=f)),r.set(n,{width:u,minWidth:f})}function c(){l.headerCellElement.style.width=null;const e=Math.max(l.headerCellElement.offsetWidth,a),t=l.minWidth||a;r.set(l,{width:e,minWidth:t}),o+=Math.max(e,t),s+=t}if(l)if(l!==i)i.headerCellElement.style.width="100%",c(),i.headerCellElement.style.width=null;else if(t.length>1){const e=t.find((e=>e!==l));e.headerCellElement.style.width="100%",c(),e._isResponsive?e.headerCellElement.style.width=r.get(e).width+"%":e.headerCellElement.style.width=r.get(e).width+"px"}else c();if(n<=s||0===d)t.forEach((t=>{if(t._isResponsive){if(t.headerCellElement.style.width=(t._manualPercentageWidth?t._manualPercentageWidth+"%":r.get(t).minWidth)+"px",t._manualPercentageWidth){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t),l=t.minWidth||e.columnMinWidth;a===l&&(t.headerCellElement.style.width=l+"px")}}else t.headerCellElement.style.width=(t._manualWidth?t._manualWidth:r.get(t).minWidth)+"px"})),n<=s&&e.setAttribute("resize-max-reached","");else if(n>s)if(n<o){const a=[];let l,i=o-n,s=d;for(;i>0&&s>0;)l=Math.ceil(i/s),t.forEach((e=>{if(e.width||e._manualWidth||-1!==a.indexOf(e))return;const t=r.get(e);let n=Math.max(t.width-l,t.minWidth);const o=t.width-n;i-=o,n===t.minWidth&&(s--,a.push(e)),t.width=n}));t.forEach((t=>{if(t._isResponsive){if(t.headerCellElement.style.width=r.get(t).width+"%",t._manualPercentageWidth){const a=e._getColumnWidth(t._manualPercentageWidth+"%",!1,t),l=t.minWidth||e.columnMinWidth;a===l&&(t.headerCellElement.style.width=l+"px")}}else t.headerCellElement.style.width=r.get(t).width+"px"}))}else n===o?t.forEach((e=>{e._isResponsive?e.headerCellElement.style.width=r.get(e).width+"%":e.headerCellElement.style.width=r.get(e).width+"px"})):t.forEach((e=>{const t=r.get(e).width;e.headerCellElement.style.width=e===l?n-o+t+"px":t+"px"}));e.removeAttribute("auto-size")}_getNumericMinWidth(){const e=this,t=e.columnMinWidth;return"string"==typeof t&&-1!==t.indexOf("%")?e.offsetWidth*(parseFloat(t)/100):parseFloat(t)}_getCurrentResizeMax(){const e=this;if("default"===e.columnSizeMode)return 1/0;const t=e._resizeDetails,a=e._columns,l=a.find((e=>e.headerCellElement===t.Item)),i=a.indexOf(l);let n,r=a.length-1;for(let e=a.length-1;e>=0;e--)if(a[e].visible){r=e;break}if(i===r)return t.Item.offsetWidth;for(let t=i+1;t<a.length;t++){const l=a[t];t===r&&l.headerCellElement&&(n=l.headerCellElement.getBoundingClientRect()[e.rightToLeft?"left":"right"]+window.scrollX)}return n}_autoResizeColumnOnDblclick(){const e=this,t=e._resizeDetails,a=t.Item,l=e._columns.find((e=>e.headerCellElement!==a)).headerCellElement,i=l.style.width;e.setAttribute("auto-size",""),a.style.width=null,l.style.width="100%";let n=a.offsetWidth;l.style.width=i,e.removeAttribute("auto-size",""),n=Math.min(t.Max,Math.max(t.Min,n)),t.Width=n,e._resolveResize()}_isExpandCollapseForbidden(){const e=this;return(!e.hasAttribute("hierarchy")||e.grouping)&&"jqx-pivot-table"!==e.nodeName.toLowerCase()}_selectSingle(e){const t=this,a=t.rowById?t.rowById[e]||t.dataSource.dataItemById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data?a.data.$.id:a.$.id;if(-1!==t._selectedIds.indexOf(l)||-1!==t._disabledSelection.indexOf(l))return;const i=t.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if("one"===t.selectionMode&&(t._clearSelection(),t._selectedIds=[]),t._selectedIds.push(l),i){const e=i.firstElementChild;e.classList.remove("indeterminate"),e.classList.add("selected"),e.firstElementChild.setAttribute("aria-checked",!0),i.setAttribute("aria-selected",!0)}return t._handleHierarchicalSelection(a,!0),!0}_unselectSingle(e){const t=this,a=t.rowById?t.rowById[e]||t.dataSource.dataItemById[e]:t.rows.dataItemById[e];if(!a)return;const l=a.data?a.data.$.id:a.$.id,i=t._selectedIds.indexOf(l),n=t.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if(-1!==i&&t._selectedIds.splice(i,1),n){const e=n.firstElementChild;e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1),n.setAttribute("aria-selected",!1)}return t._handleHierarchicalSelection(a,!1),!0}_changeSelectionOfMultiple(e,t,a="programmatic",l){const i=this;l||(l=JSON.stringify(i._selectedIds.slice(0).sort()));for(let a=0;a<e.length;a++)i[`_${t}Single`](e[a]);l!==JSON.stringify(i._selectedIds.slice(0).sort())&&(i._updateSelectAllState(),i._updateState("selected"),i.$.fireEvent("change",{type:a}))}_handleHierarchicalSelection(e,t){const a=this;if(!a.hasAttribute("hierarchy"))return;if(!1===a.selectionByHierarchy)return;const l=e.data;let i=l;for(l&&l.children&&function e(t,l){const i=t.children;let n=0;for(let t=0;t<i.length;t++){const r=i[t];if(!1===r.$.filtered)continue;let o=a._setThreeStateCheckbox(r,l);r.children&&r.children.length>0&&(o=e(r,l)),l&&!1===o&&n++}if(l&&n>0)return a._setThreeStateCheckbox(t,n!==i.length&&null)}(l,t);i&&i.parent;){const e=i.parent,t=a._getChildCheckState(e).state;a._setThreeStateCheckbox(e,t),i=e}}_getChildCheckState(e){const t=this,a=t._selectedIds,l=t._disabledSelection,i=e.children;if(!i||0===i.length||!t.selectionByHierarchy){const t=e.$.id,i=-1!==a.indexOf(t);return{state:i,maxSelected:!!i||-1!==l.indexOf(t)}}let n=!0,r=0,o=0,s=0;for(let e=0;e<i.length;e++){const a=i[e];if(!1===a.$.filtered)continue;const l=t._getChildCheckState(a);r++,l.state?o++:null===l.state?s++:!1===l.maxSelected&&(n=!1)}return 0!==o&&o===r?{state:!0,maxSelected:!0}:0===o&&0===s?{state:!1,maxSelected:n}:{state:null,maxSelected:n}}_setThreeStateCheckbox(e,t){const a=this,l=e.$.id,i=a._selectedIds,n=i.indexOf(l);t&&(-1!==a._disabledSelection.indexOf(l)?t=!1:-1===n&&i.push(l)),t||-1===n||i.splice(n,1);const r=a.$.tableContainer.querySelector(`tr[row-id="${l}"]:not([unused])`);if(!r)return t;const o=r.firstElementChild,s=o.firstElementChild;return t?(o.classList.remove("indeterminate"),o.classList.add("selected"),s.setAttribute("aria-checked",!0),r.setAttribute("aria-selected",!0)):!1===t?(o.classList.remove("selected","indeterminate"),s.setAttribute("aria-checked",!1),r.setAttribute("aria-selected",!1)):(o.classList.remove("selected"),o.classList.add("indeterminate"),s.setAttribute("aria-checked","mixed"),r.setAttribute("aria-selected",!1)),t}_getSelectableGroupRecords(){const e=this,t=e.dataSource,a=t.boundHierarchy;e._selectableGroupRecords=[],a?(function t(a){a.forEach((a=>{a.groupDataField&&(e._selectableGroupRecords.push(a.$.id),t(a.children))}))}(a),e._selectedIds=e._selectedIds.filter((a=>void 0!==t.dataItemById[a]||-1!==e._selectableGroupRecords.indexOf(a)))):e._selectedIds=e._selectedIds.filter((e=>void 0!==t.dataItemById[e]))}_clearSelection(e){const t=this;if(0===t._selectedIds.length)return;const a=t.$.tableContainer.querySelector(".jqx-table-select-all");Array.from(t.$.tableContainer.querySelectorAll(".jqx-table-select-row")).forEach((e=>{e.parentElement.classList.contains("disable-select")||e.parentElement.setAttribute("aria-selected",!1),e.classList.remove("selected","indeterminate"),e.firstElementChild.setAttribute("aria-checked",!1)})),a&&(a.classList.remove("indeterminate","selected"),a.firstElementChild.setAttribute("aria-checked",!1)),t._selectedIds=[],e&&(t._updateState("selected"),t.$.fireEvent("change",{type:"programmatic"}))}_updateCellsWithFormulas(e){const t=this,a=t.formulas,l=t._cellsWithFormulas;if(a||e)for(let e in l){const a=/(.+):(.+)/.exec(e),l=t.columnByDataField[a[1]],i=t.rowById[a[2]];if(!l||!i)continue;const n=t.$.tableContainer.querySelector(`tr[row-id="${i.data.$.id}"]:not([unused]) td[data-field="${l.dataField}"]`);n&&t._setCellContent(n,t._formatCellValue(i,l,n),n.classList.contains("tree-cell"))}}_createVirtualDataRows(e){const t=this,a=t.rowDetailTemplate,l=t.selection,i=t.hasAttribute("hierarchy"),n=document.createDocumentFragment(),r=t.$.virtualizationContainer,o=t.$.tableContainer,s=t._rowHeight;t.isRendered&&(r.scrollWidth=0,r.scrollHeight=0,r.$.scrollViewerContainer.classList.remove("hscroll","vscroll"));const d=r.$.scrollViewerContainer.offsetHeight-o.firstElementChild.offsetHeight-(t.filtering&&t.filterRow?s:0)-(t.footerRow?o.lastElementChild.offsetHeight:0),c=d<5,u=t._getVirtualRecords(i,c),f=u.length;let m=i?2*d:d+3*s,h=s*f,p=0;t._rowsVirtual=u,t._rowsInDOM=[];for(let e=0;e<f;e++){const r=u[e],o=r.data;if(!r.detail){if(o.groupDataField)t._rowsInDOM.push(t._createGroupHeader(o,n));else{const e=t._createDataRow(r,n,{hierarchical:i,rowDetailTemplate:a,selection:l,virtualization:!0});t._rowsInDOM.push(e.row),e.detail&&(t._rowsInDOM.push(e.detail),p+=t._rowDetailHeight,m+=t._rowDetailHeight)}if(p+=s,!c&&p>m)break}}e.appendChild(n),t._updateState("expanded"),e.parentElement||t.$.tableContainer.insertBefore(e,t.$.tableContainer.querySelector("tfoot")),r.refresh(),a&&(h+=t._expandedRowDetailIds.length*(t._rowDetailHeight-s));let g=Math.max(0,h-d);g>0&&r.computedHorizontalScrollBarVisibility&&(g+=r.$.horizontalScrollBar.offsetHeight),r.$.scrollViewerContentContainer.style.top=0,r.$.verticalScrollBar.max=g,t._scrollHeight=h,t._start={view:0,data:0},!c&&t._rowsInDOM.length>0&&r.$.scrollViewerContentContainer.offsetHeight<r.$.scrollViewerContainer.offsetHeight&&t._rowsInDOM[t._rowsInDOM.length-1].classList.add("last-row"),t._fixFrozenHeaderFirefox(),t._focusEquivalentCell()}_getVirtualRecords(e,t){const a=this,l=e&&!t?a.rows.filter((e=>0===e.data.level||!a._isCollapsed(e.data))):a.rows;if(e||!a.rowDetailTemplate)return l;const i=[];return l.forEach((e=>{i.push(e),-1!==a._expandedRowDetailIds.indexOf(e.data.$.id)&&i.push({detail:!0,data:e.data})})),i}_onVerticalChange(e,t){const a=this;if(a._ignoreVerticalChange)return;const l=a.rows,i=a._rowHeight,n=a.$.virtualizationContainer;let r,o,s=e.detail.value;if(JQX.Utilities.Core.Browser.Firefox&&a.virtualization&&(n.$.scrollViewerContentContainer.style.top=null),a.setAttribute("ignore-detail-animation",""),a._rowsInDOM.length===l.length||0===n.$.verticalScrollBar.max){const e=Math.floor(s/i);return a._start={view:e,data:e},n.$.scrollViewerContentContainer.style.top=-s+"px",requestAnimationFrame((()=>a.removeAttribute("ignore-detail-animation"))),void a._fixFrozenHeaderFirefox()}if(a._expandedRowDetailIds.length>0){let e,t=0;r=1;for(let l=0;l<a._rowsVirtual.length;l++){const i=t;if(a._rowsVirtual[l].detail?t+=a._rowDetailHeight:t+=a._rowHeight,void 0===o&&s<=t){o=l,e=s-i;break}}n.computedVerticalScrollBarVisibility?s=e+a._rowHeight:r=0}else{for(s=s%(2*i)+i,s<i&&(s+=i);s+n.$.scrollViewerContainer.offsetHeight>a.$.tableContainer.offsetHeight;)s-=i;r=Math.floor(s/i),o=Math.floor(e.detail.value/i),r<0&&(o-=r,r=0)}n.$.scrollViewerContentContainer.style.top=-s+"px",a._updateVisibleRows(r,o,t||a._expandedRowDetailIds.length>0),a._fixFrozenHeaderFirefox(),requestAnimationFrame((()=>a.removeAttribute("ignore-detail-animation")))}_fixFrozenHeaderFirefox(){const e=this;e.virtualization&&e.$.virtualizationContainer&&e.$.virtualizationContainer.$.scrollViewerContentContainer&&(e._tableHeader.style.top=-parseFloat(e.$.virtualizationContainer.$.scrollViewerContentContainer.style.top)+"px"),JQX.Utilities.Core.Browser.Firefox&&e.virtualization}_focusEquivalentCell(e){const t=this,a=t._focusedCell;if(!e&&!a)return;let l;if(!e){if(!a.parentElement)return;e={rowId:a.parentElement.data.$.id,dataField:a.getAttribute("data-field")}}l=e.dataField?t.$.tableContainer.querySelector(`tr[row-id="${e.rowId}"]:not([unused]) td[data-field="${e.dataField}"]`):t.$.tableContainer.querySelector(`tr[row-id="${e.rowId}"]:not([unused]) td.group-header`),t._focusCell(l)}_detachCachedTemplates(){const e=this;e._cachedTemplates&&(delete e._cachedTemplates,e._tableCachedTemplates&&(e._tableCachedTemplates.remove(),delete e._tableCachedTemplates))}_clearCachedTemplates(){const e=this;if(e._cachedTemplates&&Object.keys(e._cachedTemplates).length>0){e._tableCachedTemplates||(e._tableCachedTemplates=document.createElement("div"),e._tableCachedTemplates.style.display="none",document.body.appendChild(e._tableCachedTemplates));const t=document.createDocumentFragment();for(let a in e._cachedTemplates)t.appendChild(e._cachedTemplates[a]);e._tableCachedTemplates.appendChild(t)}}_updateVisibleRows(e,t,a){const l=this,i=t-e,n=l._rowsVirtual.length,r={hierarchical:l.hasAttribute("hierarchy"),selection:l.selection};let o;if(a=a&&(r.hierarchical||!!l.rowDetailTemplate),r.hierarchical&&!l.grouping&&(a=!0),l._sortColumns&&l._sortColumns.length>0&&(a=!0),l._focusedCell){const e=l._focusedCell.parentElement;e&&(o={rowId:e.data.$.id,dataField:l._focusedCell.getAttribute("data-field")})}for(let t=0;t<e;t++){const e=l._rowsInDOM[t];let n=i+t;n>=0&&(a||e.data.$.index!==n||e.data.detail)&&l._updateVisibleRow(e,n,r),e.setAttribute("unused",""),e.setAttribute("aria-hidden",!0),e.classList.remove("jqx-table-row-detail")}for(let t=e;t<l._rowsInDOM.length;t++){const e=l._rowsInDOM[t],o=i+t;o<n?(e.removeAttribute("unused"),e.removeAttribute("aria-hidden"),(a||e.data.$.index!==o||e.data.parent)&&l._updateVisibleRow(e,o,r)):e.setAttribute("aria-hidden",!0)}l._start={view:e,data:t},l._focusEquivalentCell(o)}_updateVisibleRow(e,t,a){const l=this,i=l._columns.filter((e=>e.visible));if(!i.length)return;const n=l._rowsVirtual[t],r=n.data,o=r.$.id,s=Number(a.selection),d=!r.groupDataField&&!e.firstElementChild.classList.contains("group-header")&&!n.detail&&!e.classList.contains("jqx-table-row-detail")&&e.childElementCount>1;if(e.className="",d){const t=e.attributes;for(;t.length>0;)e.removeAttribute(t[0].name)}else e.innerHTML="";if(r.groupDataField)l._createGroupHeader(r,void 0,e);else if(n.detail)l._createRowDetailOnDemand(e,n,r);else{e.setAttribute("aria-rowindex",r.$.index+1),l._processAndRenderSelection(r,e,a.hierarchical,d);for(let t=0;t<i.length;t++){const c=i[t];let u=d?e.children[t+s]:document.createElement("td"),f=!1;if(u&&(l.grouping&&!r.groupDataField||l.dataSource&&l.dataSource.groupBy&&l.dataSource.groupBy.length>0)&&u.removeAttribute("colspan"),!u){if(!d)continue;u=document.createElement("td"),f=!0,e.appendChild(u)}d&&(u.className=""),u.setAttribute("data-field",c.dataField),u.setAttribute("aria-colindex",t+1+s);let m,h=l._formatCellValue(n,c,u);if(f&&l._setCellContent(u,h,m),c.freeze&&u.classList.add("freeze-"+("far"===c.freeze?"far":"near")),c.responsivePriority&&u.classList.add("priority-"+c.responsivePriority),!1===c.allowEdit?(u.classList.add("no-edit"),u.setAttribute("aria-readonly",!0)):u.removeAttribute("aria-readonly"),0===t&&a.hierarchical){const e=l._areChildrenFiltered(r);r.leaf||(u.classList.add("tree-cell"),m=e),r.level&&(u.classList.add("outline-level-"+Math.min(r.level,10)),!r.leaf&&e||u.classList.add("tree-leaf"))}if(c.templateElement){if(f&&l.grouping){const e=c.templateElement+"",t=u;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e}else if(a.hierarchical&&l.grouping&&r.leaf){const e=c.templateElement+"",t=u;if((!t.firstElementChild||!(t.firstElementChild.hasAttribute("ng-version")||t.innerHTML.indexOf("ng-version")>=0))&&t.firstElementChild&&!t.firstElementChild.classList.contains(".jqx-table-cell-template")){const a=t.innerHTML;e.substring(e.lastIndexOf("</"))!==a.substring(a.lastIndexOf("</"))&&(e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e)}}if(m&&!u.querySelector(".hierarchy-arrow")){l._setCellContent(u,h,m);const e=u.children[0].children[1],t=c.templateElement+"";t.indexOf("{{value}}")>=0?e.innerHTML=t.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):e.innerHTML=t}else if(a.hierarchical&&!l.grouping&&r.leaf){const e=u;if(!e.firstElementChild||!(e.firstElementChild.hasAttribute("ng-version")||e.innerHTML.indexOf("ng-version")>=0)){l._setCellContent(u,h,!1);const t=c.templateElement+"";t.indexOf("{{value}}")>=0?e.innerHTML=t.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):e.innerHTML=t}}if(!d){const e=c.templateElement+"",t=m?u.children[0].children[1]:u;e.indexOf("{{value}}")>=0?t.innerHTML=e.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=e}let e=m?u.children[0].children[1].firstElementChild:u.firstElementChild;if(!e&&a.hierarchical){l._setCellContent(u,h,!1);const t=u,a=c.templateElement+"";a.indexOf("{{value}}")>=0?t.innerHTML=a.replace(/{{value}}/gi,'<div class="jqx-table-cell-template">'+r[c.dataField]+"</div>"):t.innerHTML=a,e=m?u.children[0].children[1].firstElementChild:u.firstElementChild}c.templateElementSettings?c.templateElementSettings(r[c.dataField],o,e):c.templateElement.indexOf("{{value}}")>=0&&(u.querySelector(".jqx-table-cell-template").textContent=r[c.dataField])}else c.formatFunction,l._setCellContent(u,h,m);l.onCellRender&&l.onCellRender(r,c.dataField,r[c.dataField],u),l._applyConditionalFormattingToCell(u,c.dataField,r.$.index),d||e.appendChild(u)}e.data=r,e.setAttribute("row-id",o),-1!==l._disabledSelection.indexOf(o)&&(e.removeAttribute("aria-selected"),e.classList.add("disable-select"),a.selection&&e.firstElementChild.firstElementChild.setAttribute("aria-disabled",!0)),r.expanded?(-1===l._expandedIds.indexOf(o)&&l._expandedIds.push(o),l._expandedIdsAlt[o]=!0,e.setAttribute("aria-expanded",!0),e.classList.add("expanded")):!1===r.expanded&&e.setAttribute("aria-expanded",!1),r.level&&l._isCollapsed(r)&&(e.setAttribute("aria-hidden",!0),e.classList.add("collapsed","jqx-hidden"))}}_createRowDetailOnDemand(e,t,a){const l=this,i=Number(l.selection)+l._columns.filter((e=>e.visible)).length;e.data=Object.assign(a,{detail:!0}),e.classList.add("jqx-table-row-detail"),e.removeAttribute("aria-rowindex"),e.removeAttribute("row-id"),e.innerHTML=`<td colspan="${i}"><div class="jqx-table-detail-container">${l._applyRowDetailTemplate(t)}</div></td>`}_hierarchyArrowClickHandlerVirtualization(e,t){const a=this,l=!a.grouping,i=a.$.tableContainer,n={nextRow:e.nextElementSibling,tbody:i.children[1]},r=e.data,o=[],s=[],d=Math.ceil((a.$.virtualizationContainer.$.scrollViewerContainer.offsetHeight-i.firstElementChild.offsetHeight)/a._rowHeight);function c(){0===o.length?function(){if(a._ignoreVerticalChange=!0,r.expanded=!r.expanded,l)r.expanded?(-1===a._expandedIds.indexOf(r.$.id)&&a._expandedIds.push(r.$.id),a._expandedIdsAlt[r.$.id]=!0,a.$.fireEvent("expand",{id:r.$.id,record:r})):(a._expandedIds=a._expandedIds.filter((e=>e!==r.$.id)),delete a._expandedIdsAlt[r.$.id],a.$.fireEvent("collapse",{id:r.$.id,record:r})),a._updateState("expanded");else if(!0!==t){const e=t=>{for(let a=0;a<t.length;a++){const l=t[a];if(l.$.id===r.$.id)return l;if(l.children){let t=e(l.children);if(t)return t}}return null},t=e(a.dataSource.boundHierarchy);t&&(t.expanded=r.expanded);let l=""+r.$.id;l=l.replace("Item","").replace(/_/gi,"."),r.expanded?a.$.fireEvent("group",{action:"expand",path:l,dataField:r.groupDataField,label:r.label}):a.$.fireEvent("group",{action:"collapse",path:l,dataField:r.groupDataField,label:r.label})}for(const e of s)e.remove();let e=a.$.virtualizationContainer.$.verticalScrollBar,i=a.$.virtualizationContainer.$.verticalScrollBar.value;a._refreshDataRows(),i=Math.min(e.max,i),e.value=i,delete a._ignoreVerticalChange,a._onVerticalChange({detail:{value:i}},!0)}():requestAnimationFrame((()=>c()))}function u(e){for(const t of e){if(s.length>=d)break;!1!==t.$.filtered&&(s.push(a._expandSingleChildRowVirtualization(t,n,o)),t.children&&t.expanded&&u(t.children))}}r.expanded?function e(t){t.forEach((t=>{a._collapseSingleChildRow(i.querySelector(`tr[row-id="${t.$.id}"]:not([unused])`),o),t.children&&e(t.children)}))}(r.children):requestAnimationFrame((()=>u(r.children))),e.setAttribute("aria-expanded",!r.expanded),e.classList.toggle("expanded",!r.expanded),requestAnimationFrame((()=>c()))}_expandSingleChildRowVirtualization(e,t,a){const l=this,i=l.rowById[e.$.id],n=document.createDocumentFragment();let r;if(i){if(r=i.data.groupDataField?l._createGroupHeader(i.data,n):l._createDataRow(i,n,{virtualization:!0,hierarchical:!0,selection:l.selection}).row,-1===[...t.tbody.children].indexOf(t.nextRow)){let a=!1;e.children&&0===e.children.length&&(a=!0),e.children||(a=!0),l._rowsInDOM&&l._rowsInDOM.length===l.rows.length&&(a=!0),a||t.tbody.appendChild(n)}else t.tbody.insertBefore(n,t.nextRow);return l._expandSingleChildRow(r,a),r}}_getFractionOfMax(){const e=this;return e.isRendered&&e.virtualization?{vertical:function(){const t=e.$.virtualizationContainer.$.verticalScrollBar,a=t.max;return 0===a?0:t.value/a}(),horizontal:function(){const t=e.$.virtualizationContainer.$.horizontalScrollBar,a=t.max;return 0===a?0:t.value/a}()}:null}_setFractionOfMax(e){if(!this.virtualization||null===e)return;const t=this.$.virtualizationContainer,a=t.$.verticalScrollBar,l=t.$.horizontalScrollBar;a.value=a.max*e.vertical,l.value=l.max*e.horizontal}_refreshHorizontalScrollbar(){const e=this.$.virtualizationContainer;if(!e)return;const t=e.$.scrollViewerContainer,a=e.$.horizontalScrollBar,l=e.$.verticalScrollBar,i=e.$.scrollViewerContentContainer.offsetWidth-t.offsetWidth;let n,r;i>0&&!t.classList.contains("hscroll")?(t.classList.add("hscroll"),n="add"):i<=0&&t.classList.contains("hscroll")&&(r=a.offsetHeight,t.classList.remove("hscroll"),n="subtract"),e.scrollWidth!==i&&(e.scrollWidth=i),e.computedVerticalScrollBarVisibility&&("add"===n?(r=a.offsetHeight,l.max+=r):"subtract"===n&&(l.max-=r))}_scrollToVirtualization(e,t){const a=this;if(!a.virtualization)return;const l=a.$.virtualizationContainer,i=l.$.scrollViewerContentContainer,n=l.$.verticalScrollBar,r=l.$.horizontalScrollBar,o=a.$.tableContainer,s=i.offsetLeft,d=i.offsetTop,c=n.value;let u,f;switch(t&&(u=t.offsetLeft,f=t.offsetTop),e){case"nextArrow":{if(!t||!l.computedHorizontalScrollBarVisibility)return;const e=s+u+t.offsetWidth-l.offsetWidth;e>0&&(r.value+=e+n.offsetWidth);break}case"prevArrow":if(!t||!l.computedHorizontalScrollBarVisibility||u>=-s)return;r.value=u-s-r.value;break;case"ArrowUp":{const e=o.firstElementChild.offsetHeight-d-f;if(e<=0)return;let t;if(a._focusedCell){const e=a._focusedCell.parentElement;e&&(t={rowId:e.data.$.id,dataField:a._focusedCell.getAttribute("data-field")})}const l=Math.max(0,c-e);l!==c&&(n.value=l,a._focusEquivalentCell(t));break}case"ArrowDown":{const e=d+f+t.offsetHeight-l.offsetHeight;if(e<=0)return;const a=Math.min(n.max,c+e);a!==c&&(n.value=a);break}case"Home":case"End":if(!l.computedHorizontalScrollBarVisibility)return;r.value="Home"===e?0:r.max}}_getExpandedGroups(e){const t=this,a=[];return e?(function e(l){l.forEach((l=>{l.expanded&&a.push({groupDataField:l.groupDataField,label:l.label,ancestorSignature:t._getGroupAncestorSignature(l)}),l.children&&l.children.length>0&&!1===l.children[0].leaf&&e(l.children)}))}(e),a):[]}_getGroupAncestorSignature(e){const t=[];let a=e.parent;for(;a;)t.push({groupDataField:a.groupDataField,label:a.label}),a=a.parent;return JSON.stringify(t)}_restoreExpandedGroups(e){if(0===e.length)return;const t=this,a=t.dataSource,l=[];!function a(i){i&&i.forEach(((i,n)=>{if(e.some((e=>e.groupDataField===i.groupDataField&&e.label===i.label&&e.ancestorSignature===t._getGroupAncestorSignature(i)))){let e=i.$.id;"string"==typeof e&&(e=e.replace("Item","").replace(/_/g,".")),0===i.level?l.push(n):l.push(e)}i.children&&i.children.length>0&&!1===i.children[0].leaf&&a(i.children)}))}(a.boundHierarchy);const i=t._doNotFireEvent;t._doNotFireEvent=!0,l.forEach((e=>t.expandGroup(e))),t._doNotFireEvent=i}});
154
154
 
155
155
  /***/ }),
156
156
 
157
157
  /***/ 9532:
158
158
  /***/ (() => {
159
159
 
160
- JQX("jqx-tab-item",class extends JQX.ContentElement{static get properties(){return{closeButtonHidden:{value:!1,type:"boolean"},draggable:{value:!0,type:"boolean",reflectToAttribute:!1},index:{value:null,type:"number?"},selected:{value:!1,type:"boolean"},label:{value:"",type:"string"},labelSize:{value:null,type:"number?"}}}get enableShadowDOM(){return!1}render(){this.setAttribute("role","tabpanel"),this.firstElementChild.setAttribute("role","presentation"),super.render()}attached(){const e=this;super.attached(),e.isCompleted&&(e.$.removeClass("right"),e.$.removeClass("left"),e.$.removeClass("top"),e.$.removeClass("bottom"),e.$.removeClass("animate"))}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;if(n._preventPropertyChangedHandler)delete n._preventPropertyChangedHandler;else switch(e){case"closeButtonHidden":n.$.fireEvent("closeButtonVisibilityChange",{hidden:o});break;case"disabled":{const e=n.tabLabelContainer;e&&(o?e.setAttribute("disabled",""):e.removeAttribute("disabled"));break}case"index":n.$.fireEvent("indexChange",{newIndex:o,oldIndex:t,tabItem:n});break;case"label":{const e=n.closest("jqx-tabs");e?e._updateTabLabel(n,o):n.setAttribute("aria-label",o);break}case"selected":n.tabLabelContainer&&n.tabLabelContainer.setAttribute("aria-selected",o);break;case"labelSize":n.$.fireEvent("labelSizeChange",{size:o})}}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.firstElementChild.appendChild(e)}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}o.firstElementChild.insertBefore(e,t)}_setIndex(e){const t=this,o=t.context;t.context=t,t.index=e,t.context=o}}),JQX("jqx-tab-items-group",class extends JQX.ContentElement{static get properties(){return{label:{value:"",type:"string"},labelSize:{value:null,type:"number?"}}}get enableShadowDOM(){return!1}template(){return""}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;if(n._preventPropertyChangedHandler)delete n._preventPropertyChangedHandler;else switch(e){case"label":{const e=n.closest("jqx-tabs");if(!e)return;const a=e._groups.indexOf(t);if(a<0)break;const r=Array.from(e.$.tabStrip.querySelectorAll(".jqx-tab-group-container")).find((e=>e.group===t));Array.from(n.querySelectorAll("jqx-tab-item")).forEach((e=>e.group=o)),r.querySelector(".jqx-tab-label-text-container").innerHTML=o,r.setAttribute("aria-label",o),r.group=o,e._groups[a]=o;break}case"labelSize":this.$.fireEvent("labelSizeChange",{size:o})}}}),JQX("jqx-tabs",class extends JQX.BaseElement{static get properties(){return{addNewTab:{value:!1,type:"boolean"},addNewTabAutoCreate:{value:!0,type:"boolean"},allowToggle:{value:!1,type:"boolean"},closeButtonMode:{value:"default",allowedValues:["default","selected"],type:"string"},closeButtons:{value:!1,type:"boolean"},collapsed:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},dataSource:{value:null,type:"array?",reflectToAttribute:!1},enableMouseWheelAction:{value:!1,type:"boolean"},messages:{value:{en:{ambiguousIndexes:"jqx-tabs: Initially set jqx-tab-item indexes are ambiguous and are ignored in favour of the HTML structure.",detailsObjectRequired:'jqx-tabs: The method "insert" requires a details Object to be passed as a second argument.',invalidIndex:'jqx-tabs: "{{method}}" method accepts an index of type number.',referenceNodeNotChild:"jqx-tabs: Passed {{argument}} is not part of this jqx-tabs element.",tabItemRequired:'jqx-tabs: The method "{{method}}" requires a "jqx-tab-item" element to be passed as an argument.'}},type:"object",extend:!0},name:{value:"",type:"string"},overflow:{value:"auto",allowedValues:["auto","hidden","scroll"],type:"string"},reorder:{value:!1,type:"boolean"},resize:{value:!1,type:"boolean"},scrollButtonsPosition:{value:"both",allowedValues:["near","far","both"],type:"string"},scrollMode:{value:"paging",allowedValues:["paging","continuous"],type:"string"},selectedIndex:{value:null,type:"number?"},selectionMode:{value:"click",allowedValues:["click","dblclick","mouseenter","none"],type:"string"},tabLayout:{value:"scroll",allowedValues:["scroll","dropDown","wrap","shrink"],type:"string",defaultReflectToAttribute:!0},tabPosition:{value:"top",allowedValues:["top","bottom","left","right","hidden"],type:"string"},tabTextOrientation:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"}}}static get listeners(){return{closeButtonVisibilityChange:"_closeButtonVisibilityChangeHandler",indexChange:"_indexChangeHandler",keydown:"_keydownHandler",labelSizeChange:"_labelSizeChangeHandler",resize:"_applyTabOverflow",styleChanged:"_applyTabOverflow","container.dblclick":"_containerHandler","container.down":"_containerHandler","container.mouseout":"_containerHandler","container.mouseover":"_containerHandler","scrollButtonFar.click":"_scrollButtonClickHandler","scrollButtonNear.click":"_scrollButtonClickHandler","tabContentSection.transitionend":"_tabContentSectionTransitionendHandler","tabsHeaderItems.wheel":"_tabsHeaderItemsWheelHandler","tabStrip.mouseleave":"_tabStripMouseleaveHandler","tabStrip.move":"_tabStripMoveHandler","tabStrip.touchmove":"_tabStripTouchmoveHandler","tabStrip.touchstart":"_tabStripTouchstartHandler","document.move":"_documentMoveHandler","document.selectstart":"_selectStartHandler","document.up":"_documentUpHandler"}}static get requires(){return{"JQX.RepeatButton":"jqx.button.js"}}static get styleUrls(){return["jqx.tabs.css"]}template(){return'<div id="container">\n <div id="tabsHeaderSection" class="jqx-header jqx-tabs-header-section">\n <div id="tabsHeaderItems" class="jqx-tabs-header-items">\n <jqx-repeat-button id="scrollButtonNear" class="jqx-tabs-scroll-button jqx-nav-button jqx-spin-button jqx-hidden" animation="[[animation]]" unfocusable>\n <div id="arrowNear" class="jqx-arrow" aria-hidden="true"></div>\n </jqx-repeat-button>\n <div id="tabStrip" class="jqx-tab-strip"></div>\n <jqx-repeat-button id="scrollButtonFar" class="jqx-tabs-scroll-button jqx-nav-button jqx-spin-button jqx-hidden" animation="[[animation]]" unfocusable>\n <div id="arrowFar" class="jqx-arrow" aria-hidden="true"></div>\n </jqx-repeat-button>\n <div id="dropDownButton" class="jqx-drop-down-button" role="button" aria-expanded="false" aria-label="Open tab selection popup">\n <div id="dropDownButtonArrow" class="jqx-drop-down-button-arrow jqx-unselectable" aria-hidden="true"></div>\n </div>\n <span id="tabSelectionBar" class="jqx-tabs-selection-bar" role="presentation"></span>\n <div id="resizeToken" class="jqx-tabs-resize-token jqx-hidden" role="presentation"></div>\n </div>\n <div id="tabHeaderControls" class="jqx-tabs-header-controls"></div>\n </div>\n <div id="tabContentSection" class="jqx-tabs-content-section">\n <content></content>\n </div>\n <div id="dropDownButtonDropDown" class="jqx-drop-down-button-drop-down jqx-hidden"></div>\n <input id="hiddenInput" type="hidden" name="[[name]]">\n </div>'}attached(){const e=this;super.attached(),e.isCompleted&&e.isRendered&&e._applyTabOverflow()}ready(){super.ready(),this._flexWritingModeNoFullSupport=!0}render(){this._createElement(),super.render()}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof JQX.TabItem||t.error(t.localize("tabItemRequired",{method:"appendChild"})),t.isRendered?t.insert(t._tabs.length,{node:e}):t.whenRendered((()=>t.insert(t._tabs.length,{node:e})))}collapse(){const e=this;e.collapsible&&!e.collapsed&&(e.collapsed=!0)}ensureVisible(e){const t=this;if(null===e||"wrap"===t.tabLayout||"shrink"===t.tabLayout||"hidden"===t.tabPosition)return;t._validateIndex(e,"ensureVisible"),e=Math.max(0,Math.min(e,t._tabs.length-1));const o=t._tabs[e].group,n=t.$.tabStrip,a=n.getBoundingClientRect(),r=(null===o?t._tabLabelContainers[e]:t._groupLabels[t._groups.indexOf(o)]).getBoundingClientRect();"top"===t.tabPosition||"bottom"===t.tabPosition?(a.left>r.left?n.scrollLeft+=Math.round(r.left-a.left):n.scrollLeft+=Math.round(r.right-a.right),t.addNewTab&&e===t._tabs.length-1&&(n.scrollLeft=n.scrollWidth-n.offsetWidth)):"left"!==t.tabPosition&&"right"!==t.tabPosition||!(a.top>r.top||a.bottom<r.bottom)?(n.scrollLeft=t._getScrollLeft(0),t.$.tabStrip.scrollTop=0):n.scrollTop+=Math.round(r.bottom-n.offsetHeight-a.top),t._updateScrollButtonVisibility(),t.resize&&t._getTabCoordinates()}expand(){const e=this;e.collapsible&&e.collapsed&&(e.collapsed=!1)}getOffsetFromEdgeOfElement(e){const t=this;t._validateIndex(e,"getOffsetFromEdgeOfElement"),e=Math.max(0,Math.min(e,t._tabs.length-1));const o=t._tabs[e],n=t.tabPosition;return"hidden"!==n?Math.abs(o.getBoundingClientRect()[n]-t.getBoundingClientRect()[n]):o.getBoundingClientRect().top-t.getBoundingClientRect().top}getTabs(){const e=this,t=e._tabs;return t?t.slice(0):Array.from(e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item"))}insert(e,t){const o=this;let n,a;if(o._validateIndex(e,"insert"),(void 0===t||void 0===t.label&&void 0===t.content&&void 0===t.node)&&o.error(o.localize("detailsObjectRequired")),void 0===t.node)n=t.group,a=document.createElement("jqx-tab-item"),a.label=void 0!==t.label?t.label:"",a.labelSize=void 0!==t.labelSize?t.labelSize:null,a.content=t.content;else if(a=t.node,void 0!==a.index&&null!==a.index){const e=a.context;a.context=a,a.index=null,a.context=e}a.$.addClass("jqx-visibility-hidden"),a.group=null;const r=o._addTabLabelContainer(a),s=r.tabLabelContainer,i=r.dropDownLabelContainer;s.tab=a,a.tabLabelContainer=s;const l={index:e,tab:a,tabLabelContainer:s,dropDownLabelContainer:i};if(o._setAriaRelations(a,s,i),0===o._groups.length&&void 0===n)o._insertNoGrouping(l);else if(null!=n){l.group=n;const e=o.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+n+'"]');null!==e?(l.jqxTabItemsGroup=e,o._insertIntoExistingGroup(l)):o._insertIntoNewGroup(l)}else o._insertNearAGroup(l);o._getReorderItems(),null===o.selectedIndex&&!o.allowToggle&&o._tabs.length&&o._select(0,!0),null!==a.group&&null!==a.labelSize&&"shrink"!==o.tabLayout&&s.style.removeProperty([o._orientationSettings.dimension]),o._applyTabOverflow()}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}let n;e instanceof JQX.TabItem&&(null==t||t instanceof JQX.TabItem)||o.error(o.localize("tabItemRequired",{method:"insertBefore"})),o.contains(e)&&(e.selected&&(n=!0),o.removeAt(e.index)),null!=t?(o.contains(t)||o.error(o.localize("referenceNodeNotChild",{argument:"referenceNode"})),o.insert(t.index,{node:e})):o.insert(o._tabs.length,{node:e}),n&&o._select(e.index,!1)}refreshTabHeader(){const e=this;"scroll"===e.tabLayout&&e._checkOverflowScroll(),e._positionTabSelectionBar(e._tabLabelContainers?e._tabLabelContainers[e.selectedIndex]:void 0,!0)}removeAt(e){const t=this,o=t._tabs.length;if(0===o)return;t._validateIndex(e,"remove"),e=Math.max(0,Math.min(e,o-1));const n=t._tabs[e],a=t._tabLabelContainers[e];if(a._lazyRemove?a.classList.add("jqx-hidden"):a.parentElement.removeChild(a),n.parentElement.removeChild(n),null!==n.group){const e=t.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+n.group+'"]');if(0===e.childElementCount){const o=t._groups.indexOf(n.group);t.$.tabStrip.removeChild(t._groupLabels[o]),t._groups.splice(o,1),t.$.container.removeChild(t._groupLabels[0].dropDown),t._groupLabels.splice(o,1),t.$.tabContentSection.removeChild(e)}}o>1?e<t.selectedIndex?t.selectedIndex--:e===t.selectedIndex&&(e===o-1?t._select(e-1,!1):(t._select(e+1,!1),t.selectedIndex--)):(t.selectedIndex=null,t.$.tabContentSection.innerHTML=""),t._tabLabelContainers.splice(e,1),t.$.dropDownButtonDropDown.removeChild(t.$.dropDownButtonDropDown.children[e]),t._tabs.splice(e,1),t._focusedItem===n&&(t._focusedItem=t._tabs[t._focusedItem.index]),t._updateTabIndexes(),t._getReorderItems(),t._applyTabOverflow(),t.ensureVisible(t.selectedIndex),t.$.hiddenInput.value=t.selectedIndex}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof JQX.TabItem||t.error(t.localize("tabItemRequired",{method:"removeChild"})),t.contains(e)||t.error(t.localize("referenceNodeNotChild",{argument:"node"})),t.removeAt(e.index)}select(e){const t=this;0!==t._tabs.length&&(t._validateIndex(e,"select"),e=Math.max(0,Math.min(e,t._tabs.length-1)),t.ensureVisible(e),t._select(e,!0))}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):(null===e.getAttribute("tabindex")||e.getAttribute("tabindex")<0)&&e.setAttribute("tabindex",0)}getTabContent(e){const t=this._getTabProperty(e,"content");return t&&t.innerHTML?t.innerHTML:t}getTabLabel(e){return this._getTabProperty(e,"label")}_getTabProperty(e,t){if(0===this._tabs.length)return null;const o=this._tabs[e];return o?o[t]:null}setTabLabel(e,t){const o=this;if(0===o._tabs.length)return;o._validateIndex(e,"update"),e=Math.max(0,Math.min(e,o._tabs.length-1));const n=o._tabs[e];void 0!==t&&n.label!==t&&o._updateTabLabel(n,t)}update(e,t,o){const n=this;if(0===n._tabs.length)return;n._validateIndex(e,"update"),e=Math.max(0,Math.min(e,n._tabs.length-1));const a=n._tabs[e];void 0!==t&&a.label!==t&&n._updateTabLabel(a,t),void 0!==o&&(a.content=o)}_createElement(){const e=this;e.$.dropDownButton.id||(e.$.dropDownButton.id=e.id+"DropDownButton"),e.$.dropDownButtonDropDown.id||(e.$.dropDownButtonDropDown.id=e.id+"DropDown"),e.setAttribute("role","tablist"),e.$.dropDownButton.setAttribute("role","button"),e.$.dropDownButton.setAttribute("aria-haspopup",!0),e.$.dropDownButton.setAttribute("aria-owns",e.$.dropDownButtonDropDown.id),e.$.dropDownButtonDropDown.setAttribute("role","menu"),e.disabled&&(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0),e.rightToLeft&&(e.$.tabsHeaderItems.removeChild(e.$.dropDownButton),"top"===e.tabPosition||"bottom"===e.tabPosition?e.$.tabsHeaderItems.insertBefore(e.$.dropDownButton,e.$.scrollButtonNear):e.$.tabsHeaderItems.insertBefore(e.$.dropDownButton,e.$.tabSelectionBar)),e._handlePosition(e.tabPosition),e._handleScrollButtonsPosition(e.scrollButtonsPosition,"both"),null!==e.dataSource&&e._processDataSource(),e._setFocusable(),e.collapsed&&!e.collapsible&&(e.collapsed=!1),e.collapsible&&e.allowToggle&&(e.allowToggle=!1),e._processHTML(),null===e.selectedIndex&&e.$.tabContentSection.setAttribute("show-placeholder",""),setTimeout((()=>e.refreshTabHeader()),300),e.$.hiddenInput.value=e.selectedIndex,e.enableShadowDOM&&HTMLElement.prototype.appendChild.apply(e,[e.$.hiddenInput])}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;switch(e){case"addNewTab":o?n._insertAddNewTab():(n.$.tabStrip.removeChild(n._addNewTab),delete n._addNewTab),n._applyTabOverflow();break;case"allowToggle":o&&n.collapsible?(n.collapsed&&n._toggleCollapsedState(),n.collapsible=!1):o||null!==n.selectedIndex||(n.ensureVisible(n.selectedIndex=0),n._select(n.selectedIndex,!0,null));break;case"closeButtonMode":if("selected"===o){for(let e=0;e<n._tabs.length;e++)n._disableCloseButton(e);n._enableCloseButton(n.selectedIndex)}else{n._disableCloseButton(n.selectedIndex);const e=n._tabLabelContainers;for(let t=0;t<e.length;t++){const o=e[t];o.closeButtonEnabled=!0!==n._tabs[t].closeButtonHidden,n._showCloseButton(o)}}n._applyTabOverflow();break;case"closeButtons":{const e=n._tabLabelContainers,t=o?n._showCloseButton:n._hideCloseButton;for(let o=0;o<e.length;o++)t(e[o]);n._applyTabOverflow();break}case"collapsed":if(!n.collapsible&&o)return void(n.collapsed=!1);break;case"collapsible":!o&&n.collapsed&&(n.collapsed=!1),n.allowToggle=!1,void 0===n.selectedIndex&&n.select(n._focusedItem.index);break;case"dataSource":n.selectedIndex=null;for(let e=0;e<n._groupLabels.length;e++)n.$.container.removeChild(n._groupLabels[e].dropDown);n.$.tabStrip.innerHTML="",n._processDataSource(),n._processHTML();break;case"disabled":n._setFocusable(),n.$.scrollButtonNear.disabled=o,n.$.scrollButtonFar.disabled=o,o||n._updateScrollButtonVisibility(),n._closeDropDownButtonDropDown();break;case"messages":case"scrollMode":case"selectionMode":case"readonly":case"reorder":break;case"overflow":if("scroll"!==n.tabLayout)return;n.$.tabStrip.scrollLeft=n._getScrollLeft(0),n.$.tabStrip.scrollTop=0,"hidden"===o?(n.$tabsHeaderSection.removeClass("scroll-buttons-shown"),n.$scrollButtonNear.addClass("jqx-hidden"),n.$scrollButtonFar.addClass("jqx-hidden")):n._checkOverflowScroll(),n._getTabCoordinates();break;case"tabPosition":n.$.tabSelectionBar.style.transition="none",n._tabPositionChanging=!0,n._closeGroupDropDown(),n._handlePosition(o,t),"shrink"!==n.tabLayout&&n._applyLabelSizes("tabPosition"),n.rightToLeft&&(n.$.tabsHeaderItems.removeChild(n.$.dropDownButton),"top"===n.tabPosition||"bottom"===n.tabPosition?n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.scrollButtonNear):n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.tabSelectionBar)),n._applyTabOverflow(),delete n._tabPositionChanging,requestAnimationFrame((function(){n.$.tabSelectionBar.style.transition=null}));break;case"resize":o&&n._getTabCoordinates();break;case"rightToLeft":n._positionTabSelectionBar(n._tabLabelContainers[n.selectedIndex],!0),n.$.tabsHeaderItems.removeChild(n.$.dropDownButton),!o||"top"!==n.tabPosition&&"bottom"!==n.tabPosition?n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.tabSelectionBar):n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.scrollButtonNear),n.ensureVisible(n.selectedIndex);break;case"scrollButtonsPosition":n._handleScrollButtonsPosition(o,t);break;case"selectedIndex":{if(isNaN(o)&&(n.selectedIndex=o=t),!n.allowToggle&&null===o)return void(n.selectedIndex=t);let e=o;null!==o&&(e=Math.max(0,Math.min(o,n._tabs.length-1)),n.ensureVisible(e)),n._select(e,!0,t);break}case"tabLayout":"scroll"===t&&(n.$tabsHeaderSection.removeClass("scroll-buttons-shown"),n.$scrollButtonNear.addClass("jqx-hidden"),n.$scrollButtonFar.addClass("jqx-hidden")),"shrink"===o?n._applyLabelSizes("shrink",!0):"shrink"===t&&n._applyLabelSizes("shrink",!1),n._applyTabOverflow(),"scroll"===o&&n.disabled&&(n.$.scrollButtonNear.disabled=!0,n.$.scrollButtonFar.disabled=!0),n.ensureVisible(n.selectedIndex);break;case"tabTextOrientation":n._applyTabOverflow(),n.ensureVisible(n.selectedIndex);break;case"unfocusable":n._setFocusable()}}_addGroupContainer(e,t){const o=this,n=document.createElement("div"),a=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div"),i=document.createElement("div");return n.className="jqx-tab-group-container jqx-unselectable",n.$=JQX.Utilities.Extend(n),n.setAttribute("role","group"),n.setAttribute("aria-expanded",!1),n.setAttribute("aria-haspopup",!0),n.setAttribute("aria-label",e),a.className="jqx-tab-label-text-wrapper",a.setAttribute("role","presentation"),a.setAttribute("aria-hidden",!0),null!==t&&"shrink"!==o.tabLayout&&(n.style[o._orientationSettings.dimension]=parseInt(t,10)+"px"),r.className="jqx-tab-label-text-container",r.innerHTML=e,s.className="jqx-tab-group-arrow",i.className="jqx-tab-group-drop-down jqx-hidden",i.$=JQX.Utilities.Extend(i),i.id=o.id+"GroupDropDown"+e,i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),n.setAttribute("aria-owns",i.id),a.appendChild(r),a.appendChild(s),n.appendChild(a),o.$.container.appendChild(i),n.group=e,n.dropDown=i,i.groupContainer=n,{label:n,dropDown:i}}_addGroupElements(e){const t=this,o=e.groups,n=e.groupLabels,a=e.group,r=o.indexOf(a),s=e.tabLabelContainer;let i;if(-1!==r)i=n[r],i.dropDown.appendChild(s);else{o.push(a);const r=t._addGroupContainer(a,e.jqxTabItemsGroup.labelSize),l=r.dropDown;i=r.label,l.appendChild(s),l.groupContainer=r.label,e.documentFragment.appendChild(i),n.push(i)}t.selectedIndex===e.i&&(t._selectedGroup=i,i.$.addClass("jqx-tab-group-selected"))}_addNewTabHandler(e,t,o){const n=this;n._swiping||(o?(e.removeAttribute("hover"),n.addNewTabAutoCreate&&(n.insert(n._tabs.length,{label:"New Tab",content:""}),n._select(n._tabs.length-1,!0)),n.$.fireEvent("addNewTabClick")):n._reordering||n._swiping||("mouseover"===t?e.setAttribute("hover",""):"mouseout"===t&&e.removeAttribute("hover")))}_addTabLabelContainer(e,t){const o=this,n=document.createElement("div"),a=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div");let i;return e&&(e.disabled?n.setAttribute("disabled",""):n.removeAttribute("disabled")),n.className="jqx-tab-label-container jqx-unselectable",a.className="jqx-tab-label-text-wrapper",r.className="jqx-tab-label-text-container",r.setAttribute("role","presentation"),s.className="jqx-tab-close-button",s.setAttribute("role","button"),s.setAttribute("aria-label","Close"),void 0===t?(o.closeButtons?"default"===o.closeButtonMode&&e.closeButtonHidden||"selected"===o.closeButtonMode&&!e.selected?(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!1):(r.classList.add("jqx-close-button-enabled"),n.closeButtonEnabled=!0):(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!0),i=document.createElement("div"),i.className="jqx-tab-label-container jqx-unselectable",e&&null===e.group&&null!==e.labelSize&&"shrink"!==o.tabLayout&&(n.style[o._orientationSettings.dimension]=parseInt(e.labelSize,10)+"px")):(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!1),o._setLabel(e?e.label:"+",r,i),r.$=JQX.Utilities.Extend(r),s.$=JQX.Utilities.Extend(s),a.appendChild(r),a.appendChild(s),n.appendChild(a),n.$=JQX.Utilities.Extend(n),{tabLabelContainer:n,dropDownLabelContainer:i}}_animateSelection(e,t,o){const n=this;let a="right",r="left";if(n.rightToLeft&&(a="left",a="right"),n._animatedTab=e,n._animatedOldTab=t,n._animatedTab&&n._animatedOldTab){"left"!==n.tabPosition&&"right"!==n.tabPosition||(a="top",r="bottom");for(let e=0;e<n._tabs.length;e++)n._tabs[e].$.removeClass(a),n._tabs[e].$.removeClass(r),n._tabs[e].$.removeClass("animate");if(e===t)return e.$.hasClass("jqx-visibility-hidden")?e.$.removeClass("jqx-visibility-hidden"):e.$.addClass("jqx-visibility-hidden"),void(n._animatedOldTab.classToRemove=a);o?(e.$.addClass(a),e.$.removeClass("jqx-visibility-hidden"),t.$.addClass("jqx-visibility-hidden"),requestAnimationFrame((()=>{t.$.addClass("animate"),e.$.addClass("animate"),requestAnimationFrame((()=>{t.$.addClass(r),e.$.removeClass(a)}))})),n._animatedOldTab.classToRemove=r):(e.$.addClass(r),e.$.removeClass("jqx-visibility-hidden"),t.$.addClass("jqx-visibility-hidden"),requestAnimationFrame((()=>{t.$.addClass("animate"),e.$.addClass("animate"),requestAnimationFrame((()=>{t.$.addClass(a),e.$.removeClass(r)}))})),n._animatedOldTab.classToRemove=a)}}_applyConditionalTabOverflow(){const e=this,t="left"===e.tabPosition||"right"===e.tabPosition,o=e.$.tabStrip;if("scroll"!==e.tabLayout){if(e._flexWritingModeNoFullSupport&&"shrink"===e.tabLayout&&t&&o.scrollHeight>o.offsetHeight){const t=o.children,n=100/t.length+"%";o.$.addClass("shrink-tabs-vertical");for(let e=0;e<t.length;e++)t[e].style.height=n,t[e].firstElementChild.firstElementChild.classList.add("jqx-tab-label-text-container-full-height");e._inlineStyleTabStripChildren=!0}}else e._checkOverflowScroll()}_applyLabelSizes(e,t){const o=this,n=o._orientationSettings.dimension,a="width"===n?"height":"width";for(let r=0;r<o._reorderItems.length;r++){const s=o._reorderItems[r],i=o._getCorrespondingCustomElement(s);null!==i.labelSize&&("tabPosition"===e&&s.style.removeProperty(a),t?s.style.removeProperty(n):s.style[n]=parseInt(i.labelSize,10)+"px")}}refresh(){this._applyTabOverflow()}_applyTabOverflow(){const e=this;if(!e._tabs)return;if(e._removeInlineStyle(),0===e._tabs.length)return void e._toggleNavigationElementsVisibility();const t=e.tabLayout,o=e.tabPosition,n="left"===o||"right"===o,a=e.$.tabStrip;switch(e._closeDropDownButtonDropDown(),t){case"scroll":case"dropDown":e._flexWritingModeNoFullSupport&&"vertical"===e.tabTextOrientation&&n&&e._fixTabStripNotChrome(a);break;case"wrap":if("vertical"===e.tabTextOrientation)if(e._flexWritingModeNoFullSupport)if(n)e._fixTabStripNotChrome(a);else{const t=a.children;let o=t[0].offsetHeight;for(let e=1;e<t.length;e++)o=Math.max(o,t[e].offsetHeight);for(let e=1;e<t.length;e++)t[e].style.height=o+"px";e._inlineStyleTabStripChildren=!0}else n||a.scrollHeight>a.offsetHeight&&(a.style.height=a.scrollHeight+"px",e._inlineStyleTabStrip=!0);else n&&a.scrollWidth>a.offsetWidth&&(a.style.width=a.scrollWidth+"px","right"===o&&(a.style.flexWrap="wrap-reverse"),e._inlineStyleTabStrip=!0);break;case"shrink":if(n){if(e._flexWritingModeNoFullSupport&&"vertical"===e.tabTextOrientation){const t=a.children,o=window.getComputedStyle(t[0].firstElementChild),n=parseInt(o.paddingLeft,10)+parseInt(o.paddingRight,10);let r=0;for(let e=0;e<t.length;e++)r=Math.max(r,t[e].firstElementChild.firstElementChild.offsetWidth);a.style.width=n+r+"px",e._inlineStyleTabStrip=!0;break}}else a.scrollWidth>a.offsetWidth&&a.$.addClass("shrink-tabs")}e._applyConditionalTabOverflow(),e._getTabCoordinates(),e._fixTabStripFlex(t),e._toggleNavigationElementsVisibility(),e._positionTabSelectionBar(e._tabLabelContainers[e.selectedIndex],!0)}_checkOverflowScroll(){const e=this,t=e.$tabsHeaderSection,o=e.$.tabStrip,n=e.overflow;if("hidden"===n)return;let a,r,s;if("left"!==e.tabPosition&&"right"!==e.tabPosition){const t=Math.abs(e._getScrollLeft());a=Math.round(o.scrollWidth)>Math.round(o.offsetWidth),e.rightToLeft?(s=Math.round(t)>0,r=Math.round(o.offsetWidth+t)<Math.round(o.scrollWidth)):(r=Math.round(t)>0,s=Math.round(o.offsetWidth+t)<Math.round(o.scrollWidth))}else a=Math.round(o.scrollHeight)>Math.round(o.offsetHeight),r=Math.round(o.scrollTop)>0,s=Math.round(o.offsetHeight+o.scrollTop)<Math.round(o.scrollHeight);"scroll"===n&&(t.addClass("scroll-buttons-shown"),e.$scrollButtonNear.removeClass("jqx-hidden"),e.$scrollButtonFar.removeClass("jqx-hidden")),a?"auto"===n?(t.hasClass("scroll-buttons-shown")||t.addClass("scroll-buttons-shown"),r?e.$scrollButtonNear.removeClass("jqx-hidden"):e.$scrollButtonNear.addClass("jqx-hidden"),s?e.$scrollButtonFar.removeClass("jqx-hidden"):e.$scrollButtonFar.addClass("jqx-hidden"),!1===(r&&s)?t.addClass("one-button-shown"):t.removeClass("one-button-shown"),e.disabled||(e.$.scrollButtonNear.disabled=!1,e.$.scrollButtonFar.disabled=!1)):(t.removeClass("one-button-shown"),e.disabled?(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0):(e.$.scrollButtonNear.disabled=!r,e.$.scrollButtonFar.disabled=!s)):!a&&"auto"===n&&t.hasClass("scroll-buttons-shown")?(t.removeClass("scroll-buttons-shown"),t.removeClass("one-button-shown"),e.$scrollButtonNear.addClass("jqx-hidden"),e.$scrollButtonFar.addClass("jqx-hidden")):a||"scroll"!==n||(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0)}_closeButtonVisibilityChangeHandler(e){const t=this,o=(JQX.EnableShadowDOM?e.composedPath()[0]:e.target).index;"selected"!==t.closeButtonMode?e.detail.hidden?t._disableCloseButton(o):t._enableCloseButton(o):t._tabLabelContainers[o].closeButtonEnabled=e.detail.hidden}_closeDropDownButtonDropDown(){const e=this;e._dropDownButtonDropDownOpened&&(e.$.dropDownButton.setAttribute("aria-expanded",!1),e.$dropDownButtonDropDown.addClass("jqx-hidden"),e._dropDownButtonDropDownOpened=!1)}_closeGroupDropDown(){const e=this;if(!e._openDropDown)return;const t=e._openDropDown.groupContainer;e._openDropDown.rippleInProgress?setTimeout((function(){e._openDropDown&&(t.setAttribute("aria-expanded",!1),e._openDropDown.$.addClass("jqx-hidden"),delete e._openDropDown.rippleInProgress,e._openDropDown=void 0)}),450):(t.setAttribute("aria-expanded",!1),e._openDropDown.$.addClass("jqx-hidden"),e._openDropDown=void 0)}_containerHandler(e){const t=this,o=e.type;if(t.disabled||t.readonly||t._resizing&&"mouseout"!==o||("down"===o||"up"===o)&&1!==e.which&&!JQX.Utilities.Core.isMobile)return;const n=t.shadowRoot||t.isInShadowDOM?(e.originalEvent||e).composedPath()[0]:(e.originalEvent||e).target;t.$.tabContentSection.contains(n)||(t.$.dropDownButton.contains(n)?t._dropDownButtonHandler(n,e):t.$.dropDownButtonDropDown.contains(n)?t._dropDownButtonHandler(n,e,!0):t._tabStripHandler(n,e))}_disableCloseButton(e){const t=this,o=t._tabLabelContainers[e];o.closeButtonEnabled=!1,t.closeButtons&&t._hideCloseButton(o)}_documentMoveHandler(e){const t=this,o=t._orientationSettings;if(t._reordering){t._reorderStartThrown||(t._fireDragEvent(e,"dragStart"),t._reorderStartThrown=!0);const n=e[o.coordinate],a="wrap"!==t.tabLayout?function(e){return n>=e[o.from]&&n<=e[o.to]}:function(t){return e.pageX>=t.fromX&&e.pageX<=t.toX&&e.pageY>=t.fromY&&e.pageY<=t.toY};let r=!1;for(let e=0;e<t._tabCoordinates.length;e++)if(a(t._tabCoordinates[e])){r=e;break}!0!==t._preventReorder&&!1!==r&&r!==t._draggedIndex&&(t._reorderTabs(t._draggedIndex,r),t._closeGroupDropDown(),t._draggedIndex=r,t._getReorderItems(),t._getTabCoordinates());const s=t._tabCoordinates[t._draggedIndex];"wrap"!==t.tabLayout&&(n<s[o.from]||n>s[o.to])||"wrap"===t.tabLayout&&(null!==e.originalEvent.target.closest(".jqx-tab-label-container")||null!==e.originalEvent.target.closest(".jqx-tab-group-container"))&&!(e.pageX>=s.fromX&&e.pageX<=s.toX&&e.pageY>=s.fromY&&e.pageY<=s.toY)?t._preventReorder=!0:t._preventReorder=!1}else t._resizing&&(t.$.resizeToken.style[o.edge]=e[o.coordinate]-t._tabsHeaderSectionCoordinate+"px",t.$resizeToken.removeClass("jqx-hidden"))}_documentUpHandler(e){const t=this;if(!e.originalEvent)return;let o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;t.$.container.contains(o)&&t._containerHandler(e),t._touchmoveInside?t._endSwiping(e,Date.now()):(delete t._dragStartDetails,delete t._swiping),delete t._touchCoords,delete t._touchmoveInside,!t._openDropDown||t._openDropDown.rippleInProgress||o!==document&&o.closest(".jqx-tab-group-container")===t._openDropDown.groupContainer||"pointercancel"===e.originalEvent.type||t._closeGroupDropDown(),t.$.dropDownButton.contains(o)||"pointercancel"===e.originalEvent.type||t._closeDropDownButtonDropDown(),t._endReordering(e,o),t._resize(e),void 0!==t._tabToResize&&(t._tabToResize=void 0),delete t._downTarget}_dropDownButtonHandler(e,t,o){const n=this,a=t.type;if(o){if(e.classList.contains("jqx-tab-label-container"))switch(a){case"down":n._downTarget=e;break;case"mouseout":e.removeAttribute("hover");break;case"mouseover":e.setAttribute("hover","");break;case"up":e===n._downTarget&&t.originalEvent&&"pointercancel"!==t.originalEvent.type&&(n.select(Array.from(n.$.dropDownButtonDropDown.children).indexOf(e)),n._closeDropDownButtonDropDown())}}else if("down"===a)n._downTarget=n.$.dropDownButton;else if("up"===a&&n._downTarget===n.$.dropDownButton)if(n._dropDownButtonDropDownOpened)n._closeDropDownButtonDropDown();else{const e=n.tabPosition;let t,o;switch(n.$.dropDownButton.setAttribute("aria-expanded",!0),e){case"top":t=n.$.dropDownButton.offsetLeft,o=n.$.tabsHeaderSection.offsetTop+n.$.dropDownButton.offsetHeight;break;case"bottom":t=n.$.dropDownButton.offsetLeft,o=n.$.tabsHeaderSection.offsetTop;break;case"left":t=n.$.dropDownButton.offsetWidth,o=n.$.dropDownButton.offsetTop;break;case"right":t=n.$.tabsHeaderSection.offsetLeft,o=n.$.dropDownButton.offsetTop}n.$.dropDownButtonDropDown.style.left=t+"px",n.$.dropDownButtonDropDown.style.top=o+"px",n.$dropDownButtonDropDown.removeClass("jqx-hidden"),n._dropDownButtonDropDownOpened=!0}}_enableCloseButton(e){const t=this,o=t._tabLabelContainers[e];o.closeButtonEnabled=!0,t.closeButtons&&t._showCloseButton(o)}_endReordering(e,t){const o=this;o._reordering&&(o._draggedHoveredTab&&(o._draggedHoveredTab.contains(t)||o._draggedHoveredTab.removeAttribute("hover"),delete o._draggedHoveredTab),o._reorderedIndex=void 0,o._reordering=!1,o._reorderStartThrown=!1,o.removeAttribute("dragged"),e&&o._fireDragEvent(e,"dragEnd"))}_endSwiping(e,t){const o=this;if(!o._dragStartDetails)return;const n=o._orientationSettings,a=o.$.tabStrip,r=Math.abs(o._dragStartDetails.startTime-t),s=200/r,i=(o._dragStartDetails[n.startCoordinate]-e[n.coordinate])*s;let l=Math.abs(i);const d=function(){if(o.rightToLeft&&"scrollLeft"===n.scrollDirection){const e=Math.abs(o._getScrollLeft());if(i<0&&e===a[n.scrollSize]-a[n.size]||i>0&&0===e)return!1}else if(i>0&&a[n.scrollDirection]===a[n.scrollSize]-a[n.size]||i<0&&0===a[n.scrollDirection])return!1;return!0};let c=.03*Math.abs(i)*s;const b=function(){if(c>5){const e=(l-c)/Math.abs(i);e<.1?c/=1.25:e<.15?c/=1.2:e<.2?c/=1.15:e<.25?c/=1.1:e<.3&&(c/=1.05)}c=Math.round(c);const e=a[n.scrollDirection];o.rightToLeft&&"scrollLeft"===n.scrollDirection?JQX.Utilities.Core.Browser.Chrome?a[n.scrollDirection]=i>0?Math.max(e+c,0):Math.min(e-c,a[n.scrollSize]-a[n.size]):a[n.scrollDirection]=i>0?Math.min(e+c,a[n.scrollSize]-a[n.size]):Math.min(e-c,0):a[n.scrollDirection]=i>0?Math.min(e+c,a[n.scrollSize]-a[n.size]):Math.max(e-c,0),l-=c,o._updateScrollButtonVisibility(!0);const t=d();l>0&&t?o._scrollingAnimationFrame=window.requestAnimationFrame(b):o._wheelInProgress=!1};o._scrollingAnimationFrame&&cancelAnimationFrame(o._scrollingAnimationFrame),r<500&&d()?o._scrollingAnimationFrame=window.requestAnimationFrame(b):o._wheelInProgress=!1,delete o._dragStartDetails,o._swiping&&delete o._swiping}_fireDragEvent(e,t){const o=this,n=o.$.tabStrip.children[o._draggedIndex],a=n.tab;let r,s,i;a?(r=a.selected,s=a.index,i=a.label):i=n.group,o.$.fireEvent(t,{position:{left:e.pageX,top:e.pageY},left:e.pageX,top:e.pageY,target:n,selected:r,index:s,label:i})}_fixTabStripNotChrome(e){const t=this;function o(){const o=[].slice.call(e.children).filter((e=>!e._lazyRemove));let n=o[0].getBoundingClientRect(),a=n.left,r=a+o[0].offsetWidth;for(let e=1;e<o.length;e++)n=o[e].getBoundingClientRect(),a=Math.min(a,n.left),r=Math.max(r,n.left+o[e].offsetWidth);e.style.width=r-a+"px",t._inlineStyleTabStrip=!0}0!==t._tabs.length&&(o(),JQX.Utilities.Core.Browser.Safari&&setTimeout((function(){e.parentElement.classList.add("jqx-hidden"),setTimeout((function(){e.parentElement.classList.remove("jqx-hidden"),o()}),10)}),10),t.$.fireEvent("tabStripResize"))}_fixTabStripFlex(e){const t=this;t._flexWritingModeNoFullSupport||"vertical"!==t.tabTextOrientation||"left"!==t.tabPosition&&"right"!==t.tabPosition||setTimeout((function(){t.$tabsHeaderSection.addClass("jqx-hidden"),setTimeout((function(){t.$tabsHeaderSection.removeClass("jqx-hidden"),t._getTabCoordinates(),"scroll"===e&&t._checkOverflowScroll()}),10)}),10)}_getCorrespondingCustomElement(e){return e.$.hasClass("jqx-tab-label-container")?e.tab:this.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+e.group+'"]')}_getReorderItems(){const e=this;let t;0===e._groups.length?t=e._tabLabelContainers:(t=Array.from(e.$.tabStrip.children),e.addNewTab&&t.pop()),e._reorderItems=t}_getTabCoordinates(){const e=this;if(!e.reorder&&!e.resize||"hidden"===e.tabPosition)return;const t=[],o=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;for(let a=0;a<e._reorderItems.length;a++){const r=e._reorderItems[a],s=r.getBoundingClientRect(),i=window.getComputedStyle(r),l=parseFloat(i.marginLeft),d=parseFloat(i.marginRight),c=parseFloat(i.marginTop),b=parseFloat(i.marginBottom);t.push({fromX:s.left-l+o,toX:s.right+d+o,fromY:s.top-c+n,toY:s.bottom+b+n})}e._tabCoordinates=t}_getTabs(){const e=this;let t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item");if(e.querySelector("jqx-tabs")){t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item");let o=[];const n=e.querySelector(".jqx-tabs-content-section");if(n){for(let e=0;e<t.length;e++)t[e].parentNode===n&&o.push(t[e]);t=o}}null!==e.selectedIndex&&(0===t.length?e.selectedIndex=null:e.selectedIndex=Math.max(0,Math.min(e.selectedIndex,t.length-1))),e._tabs=Array.from(t),e.$.hiddenInput.value=e.selectedIndex}_groupContainerHandler(e,t){const o=this,n=e.dropDown;if("down"===t)return o._downTarget=e,void(o.reorder&&o._reorderItems.length>1&&(o._getTabCoordinates(),o._reordering=!0,o.setAttribute("dragged",""),o._draggedIndex=Array.from(o.$.tabStrip.children).indexOf(e)));o._reordering||o._swiping||(n===o._openDropDown||"mouseover"!==t||e.classList.contains("jqx-tab-group-selected")?"mouseout"===t&&e.removeAttribute("hover"):e.setAttribute("hover","")),"up"!==t||o._downTarget!==e||void 0!==o._reorderedIndex||o._swiping||(n===o._openDropDown?(o._closeGroupDropDown(),e.classList.contains("jqx-tab-group-selected")||e.setAttribute("hover","")):o._openGroupDropDown(e))}_handlePosition(e,t){const o=this;if(-1===[void 0,"top","left","hidden"].indexOf(t)||"bottom"!==e&&"right"!==e?"bottom"!==t&&"right"!==t||-1===["top","left","hidden"].indexOf(e)||o.$.container.insertBefore(o.$.tabsHeaderSection,o.$.tabContentSection):o.$.container.insertBefore(o.$.tabContentSection,o.$.tabsHeaderSection),"hidden"===e)return o._orientationSettings={coordinate:"pageY",dimension:"height",edge:"top",from:"fromY",size:"offsetHeight",to:"toY",scrollDirection:"scrollTop",scrollSize:"scrollHeight",startCoordinate:"startY",wheelOffset:35},o.removeAttribute("horizontal"),o.removeAttribute("vertical"),void o.setAttribute("aria-orientation","horizontal");"top"===e||"bottom"===e?(o._orientationSettings={coordinate:"pageX",dimension:"width",edge:"left",from:"fromX",size:"offsetWidth",to:"toX",scrollDirection:"scrollLeft",scrollSize:"scrollWidth",startCoordinate:"startX",wheelOffset:70},o.removeAttribute("vertical"),o.setAttribute("horizontal",""),o.$arrowNear.removeClass("jqx-arrow-up"),o.$arrowNear.addClass("jqx-arrow-left"),o.$arrowFar.removeClass("jqx-arrow-down"),o.$arrowFar.addClass("jqx-arrow-right"),o.setAttribute("aria-orientation","horizontal"),o.$.scrollButtonNear.setAttribute("aria-label","Scroll left"),o.$.scrollButtonFar.setAttribute("aria-label","Scroll right")):(o._orientationSettings={coordinate:"pageY",dimension:"height",edge:"top",from:"fromY",size:"offsetHeight",to:"toY",scrollDirection:"scrollTop",scrollSize:"scrollHeight",startCoordinate:"startY",wheelOffset:35},o.removeAttribute("horizontal"),o.setAttribute("vertical",""),o.$arrowNear.removeClass("jqx-arrow-left"),o.$arrowNear.addClass("jqx-arrow-up"),o.$arrowFar.removeClass("jqx-arrow-right"),o.$arrowFar.addClass("jqx-arrow-down"),o.setAttribute("aria-orientation","vertical"),o.$.scrollButtonNear.setAttribute("aria-label","Scroll up"),o.$.scrollButtonFar.setAttribute("aria-label","Scroll down"))}_handleScrollButtonsPosition(e,t){const o=this,n=o.$.tabsHeaderItems;e!==t&&("both"===e?"near"===t?n.insertBefore(o.$.scrollButtonFar,o.$.dropDownButton):n.insertBefore(o.$.scrollButtonNear,o.$.tabStrip):"near"===e?("far"===t&&n.insertBefore(o.$.scrollButtonNear,o.$.tabStrip),n.insertBefore(o.$.scrollButtonFar,o.$.tabStrip)):("near"===t&&n.insertBefore(o.$.scrollButtonFar,o.$.dropDownButton),n.insertBefore(o.$.scrollButtonNear,o.$.scrollButtonFar)))}_hideCloseButton(e){e.firstElementChild.children[0].$.removeClass("jqx-close-button-enabled"),e.firstElementChild.children[1].$.addClass("jqx-hidden")}_indexChangeHandler(e){const t=this,o=e.detail.oldIndex,n=Math.max(0,Math.min(e.detail.newIndex,t._tabs.length-1));if(o!==n){if(0===t._groups.length)t._reorderTabs(o,n);else{const a=e.detail.tabItem;a._setIndex(o),t.removeAt(o),t.insert(n,{node:a}),t.selectedIndex===o&&t._select(n,!1)}t._reorderedIndex=void 0}}_insertAddNewTab(){const e=this,t=e._addTabLabelContainer(void 0,!0).tabLabelContainer;t.$.addClass("jqx-add-new-tab"),e.$.tabStrip.appendChild(t),e._addNewTab=t}_insertIntoExistingGroup(e){const t=this,o=e.jqxTabItemsGroup,n=e.tab,a=e.tabLabelContainer,r=e.group,s=t._groupLabels[t._groups.indexOf(r)].dropDown;let i=e.index;i=Math.max(0,Math.min(i,o.childElementCount)),s.insertBefore(a,s.children[i]);const l=o.children[i];let d;d=l?l.index:o.children[i-1].index+1,o.insertBefore(n,l),t._tabLabelContainers.splice(d,0,a),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[d]||null),t._tabs.splice(d,0,n),i=d,n.group=r,t._updateIndexes(i)}_insertIntoNewGroup(e){const t=this,o=e.tab,n=e.tabLabelContainer,a=e.group,r=t._addGroupContainer(a),s=r.label;r.dropDown.appendChild(n),t._groups.push(a);let i=Math.max(0,Math.min(e.index,t.$.tabStrip.childElementCount)),l=i;t._addNewTab&&l===t.$.tabStrip.childElementCount&&l--,t.$.tabStrip.insertBefore(s,t.$.tabStrip.children[l]||null),t._groupLabels.push(s);const d=document.createElement("jqx-tab-items-group");d.appendChild(o),t.$.tabContentSection.insertBefore(d,t.$.tabContentSection.children[i]),d.label=a;const c=d.previousElementSibling;let b=0;c&&(c instanceof JQX.TabItem?b=c.index+1:c&&(b=c.lastElementChild.index+1)),t._tabLabelContainers.splice(b,0,n),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[b]||null),t._tabs.splice(b,0,o),i=b,o.group=a,t._updateIndexes(i)}_insertNearAGroup(e){const t=this,o=e.tab,n=e.tabLabelContainer;let a=e.index;a=Math.max(0,Math.min(a,t._tabs.length));const r=t._tabs[a-1],s=t._tabs[a],i=s?s.group:void 0;r&&null!==r.group&&s&&null!==i?(s.tabLabelContainer.parentElement.insertBefore(n,s.tabLabelContainer),s.parentElement.insertBefore(o,s),o.group=i):s?null!==i?(t.$.tabStrip.insertBefore(n,t._groupLabels[t._groups.indexOf(i)]),t.$.tabContentSection.insertBefore(o,t.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+i+'"]'))):(t.$.tabStrip.insertBefore(n,s.tabLabelContainer),t.$.tabContentSection.insertBefore(o,s)):(t.$.tabStrip.insertBefore(n,t._addNewTab||null),t.$.tabContentSection.appendChild(o)),t._tabLabelContainers.splice(a,0,n),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[a]||null),t._tabs.splice(a,0,o),t._updateIndexes(a)}_insertNoGrouping(e){const t=this,o=Math.max(0,Math.min(e.index,t._tabs.length)),n=e.tab,a=e.tabLabelContainer;t.$.tabStrip.insertBefore(a,t._tabLabelContainers[o]||t._addNewTab||null),t.$.tabContentSection.insertBefore(n,t._tabs[o]||null),t._tabLabelContainers.splice(o,0,a),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[o]||null),t._tabs.splice(o,0,n),t._updateIndexes(o)}_keydownHandler(e){const t=this,o=e.key;if((t.isInShadowDOM?t.getRootNode().activeElement:document.activeElement)!==t||-1===["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","End","Home","Enter"," ","Escape"].indexOf(o)||t.disabled||t.readonly||"none"===t.selectionMode||!t.allowToggle&&null===t.selectedIndex||t._reordering||t._swiping)return;e.preventDefault();const n=t._tabs.length-1;let a,r,s,i,l=0;switch(t.rightToLeft?(s="ArrowRight",i="ArrowLeft"):(s="ArrowLeft",i="ArrowRight"),o){case s:case"ArrowUp":if(t.collapsible&&e.ctrlKey)return void(o===s?"right"===t.tabPosition?t.expand():"left"===t.tabPosition&&t.collapse():"ArrowUp"===o&&("bottom"===t.tabPosition?t.expand():"top"===t.tabPosition&&t.collapse()));if(l=-1,0===t.selectedIndex){r=!0;break}a=t.selectedIndex+l;break;case i:case"ArrowDown":if(t.collapsible&&e.ctrlKey)return void(o===i?"right"===t.tabPosition?t.collapse():"left"===t.tabPosition&&t.expand():"ArrowDown"===o&&("bottom"===t.tabPosition?t.collapse():"top"===t.tabPosition&&t.expand()));if(l=1,t.selectedIndex===n){r=!0;break}a=t.selectedIndex+l;break;case"End":if(t.selectedIndex===n){r=!0;break}a=n;break;case"Home":if(0===t.selectedIndex){r=!0;break}a=0;break;case"Enter":case" ":if(!t.allowToggle)return;if(t._focusedItem){t.select(t._focusedItem.index);const e=t._focusedItem.tabLabelContainer.closest(".jqx-tab-group-drop-down");e&&t._openGroupDropDown(e.groupContainer)}return;case"Escape":return void(t._openDropDown&&t._closeGroupDropDown())}if(t.allowToggle&&t._tabs.length>0){t._focusedItem?t._focusedItem.tabLabelContainer.removeAttribute("focus"):t._focusedItem=t._focusedItem||t._tabs[t.selectedIndex]||t._tabs[0],t._focusedItem=t._tabs[Math.min(Math.max(0,t._focusedItem.index+l),n)],t._focusedItem.tabLabelContainer.setAttribute("focus",""),t.ensureVisible(t._focusedItem.index);const e=t._focusedItem.tabLabelContainer.closest(".jqx-tab-group-drop-down");e&&e.groupContainer?(t._openDropDown&&t._openDropDown!==e.dropDown&&t._closeGroupDropDown(),t._openGroupDropDown(e.groupContainer)):t._openDropDown&&t._closeGroupDropDown()}else r||t.select(a)}_labelContainerHandler(e,t,o){const n=this,a="up"===o&&n._downTarget===e;if("down"===o&&(n._downTarget=e,"click"===n.selectionMode&&e!==n._addNewTab))if(JQX.Utilities.Core.isMobile&&null===e.tab.group){const o=n.$.tabStrip[n._orientationSettings.scrollDirection];setTimeout((function(){o===n.$.tabStrip[n._orientationSettings.scrollDirection]&&n._ripple(t,e)&&n._openDropDown&&n._openDropDown.contains(e)&&(n._openDropDown.rippleInProgress=!0)}),100)}else n._ripple(t,e)&&n._openDropDown&&n._openDropDown.contains(e)&&(n._openDropDown.rippleInProgress=!0);if(e===n._addNewTab)return void n._addNewTabHandler(e,o,a);const r=e.tab.index,s=!(n._reordering&&void 0!==n._reorderedIndex);a&&r===n.selectedIndex&&(n._closeGroupDropDown(),s&&null===e.tab.group&&n._toggleCollapsedState()),!n._swiping&&(s&&"click"===n.selectionMode&&a||!n._reordering&&(n.selectionMode===o||"mouseenter"===n.selectionMode&&"mouseover"===o))&&n._select(r,!0),n._reordering||n._swiping||"click"!==n.selectionMode&&"dblclick"!==n.selectionMode||("mouseover"!==o||e.hasAttribute("selected")?"mouseout"===o&&e.removeAttribute("hover"):e.setAttribute("hover","")),n.reorder&&"down"===o&&null===e.tab.group&&n._reorderItems.length>1&&(n._getTabCoordinates(),n._reordering=!0,n.setAttribute("dragged",""),e.hasAttribute("hover")&&(n._draggedHoveredTab=e),0===n._groups.length?n._draggedIndex=e.tab.index:n._draggedIndex=Array.from(n.$.tabStrip.children).indexOf(e))}_labelSizeChangeHandler(e){const t=this,o=e.detail.size;let n;"shrink"!==t.tabLayout&&(n=e.target instanceof JQX.TabItem?e.target.tabLabelContainer:t._groupLabels[t._groups.indexOf(e.target.label)],null!==o?n.style[t._orientationSettings.dimension]=parseInt(o,10)+"px":n.style.removeProperty(t._orientationSettings.dimension),t._applyTabOverflow())}_openGroupDropDown(e){const t=this;e&&(t._openDropDown&&t._openDropDown.$.addClass("jqx-hidden"),e.dropDown.$.removeClass("jqx-hidden"),t._positionGroupDropDown(e),t._openDropDown=e.dropDown,e.removeAttribute("hover"),e.setAttribute("aria-expanded",!0))}_orderTabs(){const e=this,t=[],o=[];let n=!0,a=!1;if(0===e.getElementsByTagName("jqx-tab-items-group").length)for(let r=0;r<e._tabs.length;r++){const s=e._tabs[r],i=s.index;if(n&&null!==i&&(n=!1),-1!==t.indexOf(i||0)&&(a=!0,null!==i))break;t.push(i||0),o.push({tab:s,index:i})}if(!a){const e=t.slice(0).sort((function(e,t){return e-t}));JSON.stringify(t)===JSON.stringify(e)&&(n=!0)}if(n||a){n||e.warn(e.localize("ambiguousIndexes"));for(let t=0;t<e._tabs.length;t++)e._tabs[t]._setIndex(t)}else{o.sort((function(e,t){return e.index-t.index}));for(let t=0;t<o.length;t++){const n=o[t].tab;n._setIndex(t),e.$.tabContentSection.removeChild(n)}for(let t=0;t<o.length;t++){const n=o[t].tab;e.$.tabContentSection.appendChild(n),e._tabs[t]=n}}}_populateTabStrip(){const e=this,t=document.createDocumentFragment(),o=[],n=[],a=[];let r=null;for(let s=0;s<e._tabs.length;s++){const i=e._tabs[s],l=i.parentElement,d=l instanceof JQX.TabItemsGroup?l.label:null;i.group=d;const c=e._addTabLabelContainer(i),b=c.tabLabelContainer,p=c.dropDownLabelContainer;e.selectedIndex===s&&(b.$.addClass("jqx-tab-selected"),b.setAttribute("selected",""),r=b),i.tabLabelContainer=b,b.tab=i,o.push(b),e._setAriaRelations(i,b,p),null===d?t.appendChild(b):e._addGroupElements({documentFragment:t,groups:n,groupLabels:a,i:s,group:d,tabLabelContainer:b,jqxTabItemsGroup:l}),e.$.dropDownButtonDropDown.appendChild(p)}e.$.tabStrip.appendChild(t),e._tabLabelContainers=o,e._groups=n,e._groupLabels=a,e._positionTabSelectionBar(r,!0)}_setAriaRelations(e,t,o){const n=this.id;e.id||(e.id=n+"TabItem"+e.index),t.id||(t.id=n+"TabLabelContainer"+e.index),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-label",e.label),t.setAttribute("aria-selected",e.selected),e.setAttribute("aria-label",e.label),o.setAttribute("role","menuitem"),o.setAttribute("aria-controls",e.id)}_positionTabSelectionBar(e,t){const o=this;if(!e)return;const n=o.tabPosition;let a,r,s,i;if(t&&(o.$.tabSelectionBar.style.transition="none"),e.tab.group&&(e=o._groupLabels[o._groups.indexOf(e.tab.group)]),"top"===n||"bottom"===n){if("wrap"===o.tabLayout?(r=e.offsetTop,"top"===n&&(r+=e.offsetHeight-o.$.tabSelectionBar.offsetHeight),r+="px"):r=null,i=null,o.rightToLeft&&"horizontal"===o.tabTextOrientation)if(JQX.Utilities.Core.Browser.Chrome){const t=o.$.tabStrip;a=-(t.scrollLeft-(t.scrollWidth-t.offsetWidth))+e.offsetLeft+"px"}else a=-o.$.tabStrip.scrollLeft+e.offsetLeft+"px";else a=-o.$.tabStrip.scrollLeft+e.offsetLeft+"px";s=e.offsetWidth+"px"}else"left"!==n&&"right"!==n||("wrap"===o.tabLayout?(a=e.offsetLeft,"left"===n&&(a+=e.offsetWidth-o.$.tabSelectionBar.offsetWidth),a+="px"):a=null,s=null,r=-o.$.tabStrip.scrollTop+e.offsetTop+"px",i=e.offsetHeight+"px");function l(){o.$.tabSelectionBar.style.top=r,o.$.tabSelectionBar.style.height=i,o.$.tabSelectionBar.style.left=a,o.$.tabSelectionBar.style.width=s}JQX.Utilities.Core.isMobile&&o.hasAnimation&&!t?requestAnimationFrame((function(){requestAnimationFrame(l)})):l(),t&&!o._tabPositionChanging&&requestAnimationFrame((()=>o.$.tabSelectionBar.style.transition=null))}_positionGroupDropDown(e){const t=this,o=t.tabPosition,n=e.dropDown,a=window.getComputedStyle(t.$.tabsHeaderSection),r=parseFloat(a[t.rightToLeft?"paddingRight":"paddingLeft"]),s=parseFloat(a.paddingTop);if("top"===o||"bottom"===o){const a=!1;if(t.rightToLeft?n.style.left=e.offsetLeft-t._getScrollLeft()-r-n.offsetWidth+e.offsetWidth+"px":n.style.left=e.offsetLeft-t.$.tabStrip.scrollLeft+r+"px","top"===o)a||(n.style.top=e.offsetTop+e.offsetHeight+s+"px");else{let o=e.getBoundingClientRect().top-t.$.container.getBoundingClientRect().top+s;a&&(o+=t.$.tabStrip.offsetHeight),n.style.top=o+"px"}}else n.style.top=e.offsetTop-t.$.tabStrip.scrollTop+s+"px",n.style.left="left"===o?e.offsetLeft+e.offsetWidth+r+"px":e.getBoundingClientRect().left-t.$.container.getBoundingClientRect().left+r+"px"}_processDataSource(){const e=this,t=e.dataSource;function o(e,t){let n;if(Array.isArray(e.items)&&e.items.length>0){n=document.createElement("jqx-tab-items-group");for(let t=0;t<e.items.length;t++)e.items[t].items||o(e.items[t],n)}else n=document.createElement("jqx-tab-item"),!0===e.closeButtonHidden&&(n.closeButtonHidden=!0),void 0!==e.content&&(n.innerHTML=e.content),void 0!==e.index&&(n.index=e.index),!0===e.selected&&(n.selected=e.selected);void 0!==e.label&&(n.label=e.label),void 0!==e.labelSize&&(n.labelSize=e.labelSize),t.appendChild(n)}if(e.$.tabContentSection.innerHTML="",null!==t)for(let n=0;n<t.length;n++)o(t[n],e.$.tabContentSection)}_processHTML(){const e=this;e._getTabs(),e._orderTabs(),e._validateInitialSelection(),e._populateTabStrip(),e.addNewTab&&e._insertAddNewTab(),e._getReorderItems(),e._applyTabOverflow(),e.ensureVisible(e.selectedIndex),e.$.hiddenInput.value=e.selectedIndex}_removeInlineStyle(){const e=this,t=e.$.tabStrip;if(e._inlineStyleTabStripChildren){const o=t.children;for(let e=0;e<o.length;e++)o[e].removeAttribute("style"),o[e].firstElementChild.firstElementChild.classList.remove("jqx-tab-label-text-container-full-height");delete e._inlineStyleTabStripChildren}e._inlineStyleTabStrip&&(t.removeAttribute("style"),delete e._inlineStyleTabStrip),t.$.removeClass("shrink-tabs"),t.$.removeClass("shrink-tabs-vertical")}_reorderTabs(e,t){function o(e,t,o){const n=e[t];e.splice(t,1),e.splice(o,0,n)}const n=this,a=n.$.tabStrip[n._orientationSettings.scrollDirection];if(0===n._groups.length){const a=n._tabs,r=n._tabLabelContainers,s=e>t?t:t+1;let i;n.selectedIndex===e?n.selectedIndex=t:n.selectedIndex<=t&&n.selectedIndex>e?n.selectedIndex--:n.selectedIndex>=t&&n.selectedIndex<e&&n.selectedIndex++,i=r[s]?r[s]:n.addNewTab?n._addNewTab:null,n.$.tabStrip.insertBefore(r[e],i),n.$.dropDownButtonDropDown.insertBefore(n.$.dropDownButtonDropDown.children[e],n.$.dropDownButtonDropDown.children[s]||null),n.$.tabContentSection.insertBefore(a[e],a[s]||null),o(a,e,t),o(r,e,t),n._updateTabIndexes()}else n._reorderTabsGrouping(e,t);n.$.tabStrip[n._orientationSettings.scrollDirection]=a,n.$.fireEvent("reorder",{index:t,oldIndex:e,newIndex:t,originalIndex:e}),n._reorderedIndex=t,n._positionTabSelectionBar(n._tabLabelContainers[n.selectedIndex],!0),n.$.hiddenInput.value=n.selectedIndex}_reorderTabsGrouping(e,t){const o=this,n=o.$.tabStrip.children,a=o.$.tabContentSection.children,r=e>t?t:t+1,s=o._tabs[o.selectedIndex];o.$.tabStrip.insertBefore(n[e],n[r]||null),o.$.tabContentSection.insertBefore(a[e],a[r]||null),o._groupLabels=Array.from(o.$.tabStrip.getElementsByClassName("jqx-tab-group-container")),o._groups=[];for(let e=0;e<o._groupLabels.length;e++)o._groups.push(o._groupLabels[e].group);o._tabs=Array.from(o.$.tabContentSection.getElementsByTagName("jqx-tab-item"));const i=document.createDocumentFragment();let l=[];for(let e=0;e<o._tabs.length;e++)i.appendChild(o.$.dropDownButtonDropDown.children[o._tabs[e].index].cloneNode(!0));o.$.dropDownButtonDropDown.innerHTML="",o.$.dropDownButtonDropDown.appendChild(i);for(let e=0;e<o.$.tabStrip.childElementCount;e++){const t=o.$.tabStrip.children[e];t.$.hasClass("jqx-tab-label-container")&&t!==o._addNewTab?l.push(t):t.$.hasClass("jqx-tab-group-container")&&(l=l.concat(Array.from(t.dropDown.children)))}o._tabLabelContainers=l,o._updateTabIndexes(),s&&(o.selectedIndex=s.index)}_resize(e){const t=this;if(!t._resizing)return;const o=t._orientationSettings,n=e[o.coordinate]-t._resizeFrom,a=t._getCorrespondingCustomElement(t._tabToResize);let r;r=null===a.labelSize?t._tabToResize[o.size]:a.labelSize;const s=Math.max(10,r+n);s!==r&&(a._preventPropertyChangedHandler=!0,a.labelSize=s,t._tabToResize.style[o.dimension]=parseInt(s,10)+"px"),t.$resizeToken.addClass("jqx-hidden"),t._applyTabOverflow(),t._resizing=!1,t.removeAttribute("resizing")}_ripple(e,t){if(this.hasRippleAnimation){const o=document.createElement("div");return o.className="ripple-agent",t.firstElementChild.appendChild(o),setTimeout((function(){t.firstElementChild.removeChild(o)}),1e3),JQX.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),!0}}_scrollButtonClickHandler(e){const t=this,o=t.$.tabStrip;let n=e.target.closest("jqx-repeat-button")===t.$.scrollButtonNear?-1:1;if("paging"===t.scrollMode){const a=t._orientationSettings,r={};return t._dragStartDetails={startX:0,startY:0,pageX:0,pageY:0,startTime:Date.now(),target:e.target},t._wheelInProgress=!0,r[a.coordinate]=-n*(o[a.size]/1.1428571428571428),void t._endSwiping(r,t._dragStartDetails.startTime+175)}t.hasAttribute("horizontal")?o.scrollLeft+=10*n:o.scrollTop+=10*n,t._updateScrollButtonVisibility(!0)}_getScrollLeft(e){const t=this,o=t.$.tabStrip;return void 0===e?t.rightToLeft&&JQX.Utilities.Core.Browser.Chrome?o.scrollLeft-(o.scrollWidth-o.offsetWidth):o.scrollLeft:(!t.rightToLeft||"top"!==t.tabPosition&&"bottom"!==t.tabPosition||(JQX.Utilities.Core.Browser.Chrome?e=o.scrollWidth-o.offsetWidth-e:e*=-1),e)}_select(e,t,o){const n=this,a=n.hasAnimation;void 0===o&&(o=n.selectedIndex);const r=n._tabs[e];if(!r||r.disabled||e===o&&(!n.allowToggle||n.allowToggle&&"mouseenter"===n.selectionMode))n.$.hiddenInput.value=n.selectedIndex;else{if(n._focusedItem&&n._focusedItem.tabLabelContainer.removeAttribute("focus"),null!==o){const t=n._tabs[o];a?n._animateSelection(r,t,e>o):t.$.addClass("jqx-visibility-hidden"),t.selected=!1,n._tabLabelContainers[o].$.removeClass("jqx-tab-selected"),n._tabLabelContainers[o].removeAttribute("selected"),n.closeButtons&&"selected"===n.closeButtonMode&&n._disableCloseButton(o)}null!==e&&(n._tabLabelContainers[e].removeAttribute("hover"),n.closeButtons&&"selected"===n.closeButtonMode&&n._enableCloseButton(e)),!n.allowToggle||null!==e&&(void 0!==arguments[2]?o:n.selectedIndex)!==e?(r.selected=!0,n.$.tabContentSection.removeAttribute("show-placeholder"),null!==o&&a||r.$.removeClass("jqx-visibility-hidden"),n.selectedIndex=e,n._focusedItem=n._tabs[e],n._focusedItem.tabLabelContainer.$.addClass("jqx-tab-selected"),n._focusedItem.tabLabelContainer.setAttribute("selected",""),n._positionTabSelectionBar(n._focusedItem.tabLabelContainer,null===o)):(n.selectedIndex=null,n.$.tabContentSection.setAttribute("show-placeholder",""),n.allowToggle&&(n._focusedItem=n._tabs[null===e?o:e],n._focusedItem&&n._focusedItem.tabLabelContainer.setAttribute("focus",""))),t&&(n.$.hiddenInput.value=n.selectedIndex,n.$.fireEvent("change",{index:n.selectedIndex,oldIndex:o})),n._closeGroupDropDown(),r&&null!==r.group?(n._selectedGroup&&n._selectedGroup.$.removeClass("jqx-tab-group-selected"),null!==n.selectedIndex&&(n._selectedGroup=n._groupLabels[n._groups.indexOf(r.group)],n._selectedGroup.$.addClass("jqx-tab-group-selected"))):n._selectedGroup&&(n._selectedGroup.$.removeClass("jqx-tab-group-selected"),delete n._selectedGroup),n.$.hiddenInput.value=n.selectedIndex}}_selectStartHandler(e){(this._reordering||this._resizing)&&e.preventDefault()}_setLabel(e,t,o){const n=e?document.getElementById(e):null;if(null!==n&&"template"===n.tagName.toLowerCase()){const e=document.importNode(n.content,!0);if(t.appendChild(e),o){const e=document.importNode(n.content,!0);o.appendChild(e)}}else""===e&&(e="&nbsp;"),t.innerHTML=e,o&&(o.innerHTML=e)}_showCloseButton(e){e.closeButtonEnabled&&(e.firstElementChild.children[0].$.addClass("jqx-close-button-enabled"),e.firstElementChild.children[1].$.removeClass("jqx-hidden"))}_tabContentSectionTransitionendHandler(e){const t=this,o=e.target;o instanceof JQX.TabItem&&(o===t._animatedOldTab?(o.$.addClass("jqx-hidden"),o.$.removeClass("animate"),o.$.removeClass(t._animatedOldTab.classToRemove),o.$.removeClass("jqx-hidden"),delete t._animatedOldTab):o===t._animatedTab&&(o.$.removeClass("animate"),delete t._animatedTab),o.classList.remove("left"),o.classList.remove("right"),o.classList.remove("top"),o.classList.remove("bottom"))}_tabsHeaderItemsWheelHandler(e){const t=this;if(!t.enableMouseWheelAction||t.disabled)return;const o=t.$.tabStrip,n=t._orientationSettings,a=o[n.size],r=o[n.scrollSize],s=o[n.scrollDirection],i=e.deltaY;if(a===r||0===s&&i<0||s+a===r&&i>0)return;if(e.preventDefault(),t._wheelInProgress)return;t._dragStartDetails={startX:e.pageX,startY:e.pageY,pageX:e.pageX,pageY:e.pageY,startTime:Date.now(),target:e.target},t._wheelInProgress=!0;const l={};l[n.coordinate]=e[n.coordinate]+(e.deltaY>0?-1:1)*n.wheelOffset,t._endSwiping(l,t._dragStartDetails.startTime+100)}_tabStripHandler(e,t){const o=this,n=t.type;if("down"===n&&void 0!==o._tabToResize)return o._resizing=!0,void(o._tabsHeaderSectionCoordinate=o.$.tabsHeaderSection.getBoundingClientRect()[o._orientationSettings.edge]);"down"===n&&JQX.Utilities.Core.isMobile&&(o._dragStartDetails={startX:t.pageX,startY:t.pageY,pageX:t.pageX,pageY:t.pageY,startTime:Date.now(),originalTime:Date.now(),target:t.originalEvent.target});const a=e.closest("jqx-repeat-button");if("up"===n&&a)return o.focus(),void(o.resize&&o._getTabCoordinates());if(e.classList.contains("jqx-tab-close-button"))if("up"===n){if(e===o._downTarget){const t=e.parentElement.parentElement.tab.index;return void(o.$.fireEvent("closing",{index:t}).defaultPrevented||(o.removeAt(t),o.$.fireEvent("close",{index:t})))}}else{if("down"===n)return void(o._downTarget=e);o._reordering||o._swiping||("mouseover"===n?e.setAttribute("hover",""):"mouseout"===n&&e.removeAttribute("hover"))}const r=e.closest(".jqx-tab-label-container");if(null!==r)return void(t.originalEvent&&"pointercancel"===t.originalEvent.type?r.tab.group&&delete r.parentElement.rippleInProgress:o._labelContainerHandler(r,t,n));const s=e.closest(".jqx-tab-group-container");null!==s&&o._groupContainerHandler(s,n)}_tabStripMouseleaveHandler(){const e=this;e.resize&&!e._resizing&&e.hasAttribute("resizing")&&e.removeAttribute("resizing")}_tabStripMoveHandler(e){const t=this;if(t._dragStartDetails&&!t._dragStartDetails.checked&&(Date.now()-t._dragStartDetails.originalTime<500?(t._endReordering(void 0,void 0),t._dragStartDetails.checked=!0):delete t._dragStartDetails),t._dragStartDetails&&(Math.abs(t._dragStartDetails.pageX-e.pageX)>=5||Math.abs(t._dragStartDetails.pageY-e.pageY)>=5)){const o=t._orientationSettings,n=t._dragStartDetails[o.coordinate]-e[o.coordinate],a=t.$.tabStrip[o.scrollDirection];return t.$.tabStrip[o.scrollDirection]+=n,a!==t.$.tabStrip[o.scrollDirection]&&t._updateScrollButtonVisibility(),t._dragStartDetails={startX:t._dragStartDetails.startX,startY:t._dragStartDetails.startY,pageX:e.pageX,pageY:e.pageY,startTime:t._dragStartDetails.startTime,originalTime:t._dragStartDetails.originalTime,target:e.originalEvent.target,checked:t._dragStartDetails.checked},void(t._swiping=!0)}if(!t.resize||t._resizing||t._reordering||"shrink"===t.tabLayout)return;const o=t._orientationSettings,n=e[o.coordinate],a=t._tabCoordinates;let r;for(let e=0;e<a.length;e++){const s=a[e][o.to];if(n>=s-4&&n<=s+4){r=t._reorderItems[e],t._resizeFrom=n;break}}void 0!==r?(t._tabToResize=r,t.setAttribute("resizing","")):(t._tabToResize=void 0,t.removeAttribute("resizing"))}_tabStripTouchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const o=t.$.tabStrip,n=t._orientationSettings,a=o[n.size],r=o[n.scrollSize],s=t._touchCoords;if(a===r||!s)return;const i=e.touches[0],l=o[n.scrollDirection],d=i[n.coordinate],c=parseFloat(d.toFixed(5)),b=s["pageY"===n.coordinate?1:0],p=parseFloat(b.toFixed(5));t._touchCoords=[i.pageX,i.pageY],0===l&&c>=p||l+a===r&&c<=p||(d!==b&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_tabStripTouchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_toggleCollapsedState(){const e=this;e.collapsible&&(e.collapsed?e.expand():e.collapse())}_toggleNavigationElementsVisibility(){const e=this,t=e._tabs.length;let o;if(0===t)o="addClass";else{if(1!==t)return;o="removeClass"}"scroll"===e.tabLayout&&"scroll"===e.overflow?(e.$scrollButtonNear[o]("jqx-hidden"),e.$scrollButtonFar[o]("jqx-hidden")):"dropDown"===e.tabLayout&&e.$dropDownButton[o]("jqx-hidden")}_updateIndexes(e){const t=this;null!==t.selectedIndex&&e<=t.selectedIndex&&t.selectedIndex++,t._updateTabIndexes()}_updateScrollButtonVisibility(e){const t=this;if("scroll"!==t.tabLayout||"hidden"===t.overflow)return void t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e);const o=t.$tabsHeaderSection,n=t.$.tabStrip,a=t._orientationSettings;let r=!0,s=!0;if(t.rightToLeft&&"scrollLeft"===a.scrollDirection){const e=Math.abs(t._getScrollLeft());0===Math.round(e)&&(s=!1),Math.round(n[a.size]+e)>=Math.round(n[a.scrollSize])-1&&(r=!1)}else 0===Math.round(n[a.scrollDirection])&&(r=!1),Math.round(n[a.size]+n[a.scrollDirection])>=Math.round(n[a.scrollSize])-1&&(s=!1);if("auto"===t.overflow){if(r&&s)return t.$scrollButtonNear.removeClass("jqx-hidden"),t.$scrollButtonFar.removeClass("jqx-hidden"),o.removeClass("one-button-shown"),void(t._tabLabelContainers[t.selectedIndex]&&t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e));r?t.$scrollButtonNear.removeClass("jqx-hidden"):t.$scrollButtonNear.addClass("jqx-hidden"),s?t.$scrollButtonFar.removeClass("jqx-hidden"):t.$scrollButtonFar.addClass("jqx-hidden"),o.addClass("one-button-shown"),t._getTabCoordinates()}else"scroll"!==t.overflow||t.disabled||(t.$.scrollButtonNear.disabled=!r,t.$.scrollButtonFar.disabled=!s);t._tabLabelContainers[t.selectedIndex]&&t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e)}_updateTabIndexes(){const e=this;if(e._tabs.length>0)for(let t=0;t<e._tabs.length;t++)e._tabs[t]._setIndex(t);else e.selectedIndex=null;e.$.hiddenInput.value=e.selectedIndex}_updateTabLabel(e,t){const o=this,n=e.index,a=o._tabLabelContainers[n].firstElementChild.children[0],r=o.$.dropDownButtonDropDown.children[n];e.set("label",t),a.innerHTML="",r.innerHTML="",o._setLabel(t,a,r),o._applyTabOverflow(),e.setAttribute("aria-label",t),e.tabLabelContainer&&e.tabLabelContainer.setAttribute("aria-label",t)}_validateIndex(e,t){if(isNaN(parseInt(e,10))||"object"==typeof e){const e=this;e.error(e.localize("invalidIndex",{method:t}))}}_validateInitialSelection(){const e=this;let t=e.selectedIndex;for(let o=0;o<e._tabs.length;o++){const n=e._tabs[o];t===o?(n.selected=!0,n.$.removeClass("jqx-visibility-hidden")):n.selected?null===t?(t=o,n.$.removeClass("jqx-visibility-hidden")):(n.selected=!1,n.$.addClass("jqx-visibility-hidden")):n.$.addClass("jqx-visibility-hidden")}e._tabs.length>0&&null===t&&!e.allowToggle&&(t=0,e._tabs[0].selected=!0,e._tabs[0].$.removeClass("jqx-visibility-hidden")),e.selectedIndex=t,null!==e.selectedIndex&&(e._focusedItem=e._tabs[e.selectedIndex])}});
160
+ JQX("jqx-tab-item",class extends JQX.ContentElement{static get properties(){return{closeButtonHidden:{value:!1,type:"boolean"},draggable:{value:!0,type:"boolean",reflectToAttribute:!1},index:{value:null,type:"number?"},selected:{value:!1,type:"boolean"},label:{value:"",type:"string"},labelSize:{value:null,type:"number?"}}}get enableShadowDOM(){return!1}render(){this.setAttribute("role","tabpanel"),this.firstElementChild.setAttribute("role","presentation"),super.render()}attached(){const e=this;super.attached(),e.isCompleted&&(e.$.removeClass("right"),e.$.removeClass("left"),e.$.removeClass("top"),e.$.removeClass("bottom"),e.$.removeClass("animate"))}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;if(n._preventPropertyChangedHandler)delete n._preventPropertyChangedHandler;else switch(e){case"closeButtonHidden":n.$.fireEvent("closeButtonVisibilityChange",{hidden:o});break;case"disabled":{const e=n.tabLabelContainer;e&&(o?e.setAttribute("disabled",""):e.removeAttribute("disabled"));break}case"index":n.$.fireEvent("indexChange",{newIndex:o,oldIndex:t,tabItem:n});break;case"label":{const e=n.closest("jqx-tabs");e?e._updateTabLabel(n,o):n.setAttribute("aria-label",o);break}case"selected":n.tabLabelContainer&&n.tabLabelContainer.setAttribute("aria-selected",o);break;case"labelSize":n.$.fireEvent("labelSizeChange",{size:o})}}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.firstElementChild.appendChild(e)}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}o.firstElementChild.insertBefore(e,t)}_setIndex(e){const t=this,o=t.context;t.context=t,t.index=e,t.context=o}}),JQX("jqx-tab-items-group",class extends JQX.ContentElement{static get properties(){return{label:{value:"",type:"string"},labelSize:{value:null,type:"number?"}}}get enableShadowDOM(){return!1}template(){return""}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;if(n._preventPropertyChangedHandler)delete n._preventPropertyChangedHandler;else switch(e){case"label":{const e=n.closest("jqx-tabs");if(!e)return;const a=e._groups.indexOf(t);if(a<0)break;const r=Array.from(e.$.tabStrip.querySelectorAll(".jqx-tab-group-container")).find((e=>e.group===t));Array.from(n.querySelectorAll("jqx-tab-item")).forEach((e=>e.group=o)),r.querySelector(".jqx-tab-label-text-container").innerHTML=o,r.setAttribute("aria-label",o),r.group=o,e._groups[a]=o;break}case"labelSize":this.$.fireEvent("labelSizeChange",{size:o})}}}),JQX("jqx-tabs",class extends JQX.BaseElement{static get properties(){return{addNewTab:{value:!1,type:"boolean"},addNewTabAutoCreate:{value:!0,type:"boolean"},allowToggle:{value:!1,type:"boolean"},closeButtonMode:{value:"default",allowedValues:["default","selected"],type:"string"},closeButtons:{value:!1,type:"boolean"},collapsed:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},dataSource:{value:null,type:"array?",reflectToAttribute:!1},enableMouseWheelAction:{value:!1,type:"boolean"},messages:{value:{en:{ambiguousIndexes:"jqx-tabs: Initially set jqx-tab-item indexes are ambiguous and are ignored in favour of the HTML structure.",detailsObjectRequired:'jqx-tabs: The method "insert" requires a details Object to be passed as a second argument.',invalidIndex:'jqx-tabs: "{{method}}" method accepts an index of type number.',referenceNodeNotChild:"jqx-tabs: Passed {{argument}} is not part of this jqx-tabs element.",tabItemRequired:'jqx-tabs: The method "{{method}}" requires a "jqx-tab-item" element to be passed as an argument.'}},type:"object",extend:!0},name:{value:"",type:"string"},overflow:{value:"auto",allowedValues:["auto","hidden","scroll"],type:"string"},reorder:{value:!1,type:"boolean"},resize:{value:!1,type:"boolean"},scrollButtonsPosition:{value:"both",allowedValues:["near","far","both"],type:"string"},scrollMode:{value:"paging",allowedValues:["paging","continuous"],type:"string"},selectedIndex:{value:null,type:"number?"},selectionMode:{value:"click",allowedValues:["click","dblclick","mouseenter","none"],type:"string"},tabLayout:{value:"scroll",allowedValues:["scroll","dropDown","wrap","shrink"],type:"string",defaultReflectToAttribute:!0},tabPosition:{value:"top",allowedValues:["top","bottom","left","right","hidden"],type:"string"},tabTextOrientation:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"}}}static get listeners(){return{closeButtonVisibilityChange:"_closeButtonVisibilityChangeHandler",indexChange:"_indexChangeHandler",keydown:"_keydownHandler",labelSizeChange:"_labelSizeChangeHandler",resize:"_applyTabOverflow",styleChanged:"_applyTabOverflow","container.dblclick":"_containerHandler","container.down":"_containerHandler","container.mouseout":"_containerHandler","container.mouseover":"_containerHandler","scrollButtonFar.click":"_scrollButtonClickHandler","scrollButtonNear.click":"_scrollButtonClickHandler","tabContentSection.transitionend":"_tabContentSectionTransitionendHandler","tabsHeaderItems.wheel":"_tabsHeaderItemsWheelHandler","tabStrip.mouseleave":"_tabStripMouseleaveHandler","tabStrip.move":"_tabStripMoveHandler","tabStrip.touchmove":"_tabStripTouchmoveHandler","tabStrip.touchstart":"_tabStripTouchstartHandler","document.move":"_documentMoveHandler","document.selectstart":"_selectStartHandler","document.up":"_documentUpHandler"}}static get requires(){return{"JQX.RepeatButton":"jqx.button.js"}}static get styleUrls(){return["jqx.tabs.css"]}template(){return'<div id="container">\n <div id="tabsHeaderSection" class="jqx-header jqx-tabs-header-section">\n <div id="tabsHeaderItems" class="jqx-tabs-header-items">\n <jqx-repeat-button id="scrollButtonNear" class="jqx-tabs-scroll-button jqx-nav-button jqx-spin-button jqx-hidden" animation="[[animation]]" unfocusable>\n <div id="arrowNear" class="jqx-arrow" aria-hidden="true"></div>\n </jqx-repeat-button>\n <div id="tabStrip" class="jqx-tab-strip"></div>\n <jqx-repeat-button id="scrollButtonFar" class="jqx-tabs-scroll-button jqx-nav-button jqx-spin-button jqx-hidden" animation="[[animation]]" unfocusable>\n <div id="arrowFar" class="jqx-arrow" aria-hidden="true"></div>\n </jqx-repeat-button>\n <div id="dropDownButton" class="jqx-drop-down-button" role="button" aria-expanded="false" aria-label="Open tab selection popup">\n <div id="dropDownButtonArrow" class="jqx-drop-down-button-arrow jqx-unselectable" aria-hidden="true"></div>\n </div>\n <span id="tabSelectionBar" class="jqx-tabs-selection-bar" role="presentation"></span>\n <div id="resizeToken" class="jqx-tabs-resize-token jqx-hidden" role="presentation"></div>\n </div>\n <div id="tabHeaderControls" class="jqx-tabs-header-controls"></div>\n </div>\n <div id="tabContentSection" class="jqx-tabs-content-section">\n <content></content>\n </div>\n <div id="dropDownButtonDropDown" class="jqx-drop-down-button-drop-down jqx-hidden"></div>\n <input id="hiddenInput" type="hidden" name="[[name]]">\n </div>'}attached(){const e=this;super.attached(),e.isCompleted&&e.isRendered&&e._applyTabOverflow()}ready(){super.ready(),this._flexWritingModeNoFullSupport=!0}render(){this._createElement(),super.render()}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof JQX.TabItem||t.error(t.localize("tabItemRequired",{method:"appendChild"})),t.isRendered?t.insert(t._tabs.length,{node:e}):t.whenRendered((()=>t.insert(t._tabs.length,{node:e})))}collapse(){const e=this;e.collapsible&&!e.collapsed&&(e.collapsed=!0)}ensureVisible(e){const t=this;if(null===e||"wrap"===t.tabLayout||"shrink"===t.tabLayout||"hidden"===t.tabPosition)return;t._validateIndex(e,"ensureVisible"),e=Math.max(0,Math.min(e,t._tabs.length-1));const o=t._tabs[e].group,n=t.$.tabStrip,a=n.getBoundingClientRect(),r=(null===o?t._tabLabelContainers[e]:t._groupLabels[t._groups.indexOf(o)]).getBoundingClientRect();"top"===t.tabPosition||"bottom"===t.tabPosition?(a.left>r.left?n.scrollLeft+=Math.round(r.left-a.left):n.scrollLeft+=Math.round(r.right-a.right),t.addNewTab&&e===t._tabs.length-1&&(n.scrollLeft=n.scrollWidth-n.offsetWidth)):"left"!==t.tabPosition&&"right"!==t.tabPosition||!(a.top>r.top||a.bottom<r.bottom)?(n.scrollLeft=t._getScrollLeft(0),t.$.tabStrip.scrollTop=0):n.scrollTop+=Math.round(r.bottom-n.offsetHeight-a.top),t._updateScrollButtonVisibility(),t.resize&&t._getTabCoordinates()}expand(){const e=this;e.collapsible&&e.collapsed&&(e.collapsed=!1)}getOffsetFromEdgeOfElement(e){const t=this;t._validateIndex(e,"getOffsetFromEdgeOfElement"),e=Math.max(0,Math.min(e,t._tabs.length-1));const o=t._tabs[e],n=t.tabPosition;return"hidden"!==n?Math.abs(o.getBoundingClientRect()[n]-t.getBoundingClientRect()[n]):o.getBoundingClientRect().top-t.getBoundingClientRect().top}getTabs(){const e=this,t=e._tabs;return t?t.slice(0):Array.from(e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item"))}insert(e,t){const o=this;let n,a;if(o._validateIndex(e,"insert"),(void 0===t||void 0===t.label&&void 0===t.content&&void 0===t.node)&&o.error(o.localize("detailsObjectRequired")),void 0===t.node)n=t.group,a=document.createElement("jqx-tab-item"),a.label=void 0!==t.label?t.label:"",a.labelSize=void 0!==t.labelSize?t.labelSize:null,a.content=t.content;else if(a=t.node,void 0!==a.index&&null!==a.index){const e=a.context;a.context=a,a.index=null,a.context=e}a.$.addClass("jqx-visibility-hidden"),a.group=null;const r=o._addTabLabelContainer(a),s=r.tabLabelContainer,i=r.dropDownLabelContainer;s.tab=a,a.tabLabelContainer=s;const l={index:e,tab:a,tabLabelContainer:s,dropDownLabelContainer:i};if(o._setAriaRelations(a,s,i),0===o._groups.length&&void 0===n)o._insertNoGrouping(l);else if(null!=n){l.group=n;const e=o.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+n+'"]');null!==e?(l.smartTabItemsGroup=e,o._insertIntoExistingGroup(l)):o._insertIntoNewGroup(l)}else o._insertNearAGroup(l);o._getReorderItems(),null===o.selectedIndex&&!o.allowToggle&&o._tabs.length&&o._select(0,!0),null!==a.group&&null!==a.labelSize&&"shrink"!==o.tabLayout&&s.style.removeProperty([o._orientationSettings.dimension]),o._applyTabOverflow()}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}let n;e instanceof JQX.TabItem&&(null==t||t instanceof JQX.TabItem)||o.error(o.localize("tabItemRequired",{method:"insertBefore"})),o.contains(e)&&(e.selected&&(n=!0),o.removeAt(e.index)),null!=t?(o.contains(t)||o.error(o.localize("referenceNodeNotChild",{argument:"referenceNode"})),o.insert(t.index,{node:e})):o.insert(o._tabs.length,{node:e}),n&&o._select(e.index,!1)}refreshTabHeader(){const e=this;"scroll"===e.tabLayout&&e._checkOverflowScroll(),e._positionTabSelectionBar(e._tabLabelContainers?e._tabLabelContainers[e.selectedIndex]:void 0,!0)}removeAt(e){const t=this,o=t._tabs.length;if(0===o)return;t._validateIndex(e,"remove"),e=Math.max(0,Math.min(e,o-1));const n=t._tabs[e],a=t._tabLabelContainers[e];if(a._lazyRemove?a.classList.add("jqx-hidden"):a.parentElement.removeChild(a),n.parentElement.removeChild(n),null!==n.group){const e=t.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+n.group+'"]');if(0===e.childElementCount){const o=t._groups.indexOf(n.group);t.$.tabStrip.removeChild(t._groupLabels[o]),t._groups.splice(o,1),t.$.container.removeChild(t._groupLabels[0].dropDown),t._groupLabels.splice(o,1),t.$.tabContentSection.removeChild(e)}}o>1?e<t.selectedIndex?t.selectedIndex--:e===t.selectedIndex&&(e===o-1?t._select(e-1,!1):(t._select(e+1,!1),t.selectedIndex--)):(t.selectedIndex=null,t.$.tabContentSection.innerHTML=""),t._tabLabelContainers.splice(e,1),t.$.dropDownButtonDropDown.removeChild(t.$.dropDownButtonDropDown.children[e]),t._tabs.splice(e,1),t._focusedItem===n&&(t._focusedItem=t._tabs[t._focusedItem.index]),t._updateTabIndexes(),t._getReorderItems(),t._applyTabOverflow(),t.ensureVisible(t.selectedIndex),t.$.hiddenInput.value=t.selectedIndex}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("jqx-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof JQX.TabItem||t.error(t.localize("tabItemRequired",{method:"removeChild"})),t.contains(e)||t.error(t.localize("referenceNodeNotChild",{argument:"node"})),t.removeAt(e.index)}select(e){const t=this;0!==t._tabs.length&&(t._validateIndex(e,"select"),e=Math.max(0,Math.min(e,t._tabs.length-1)),t.ensureVisible(e),t._select(e,!0))}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):(null===e.getAttribute("tabindex")||e.getAttribute("tabindex")<0)&&e.setAttribute("tabindex",0)}getTabContent(e){const t=this._getTabProperty(e,"content");return t&&t.innerHTML?t.innerHTML:t}getTabLabel(e){return this._getTabProperty(e,"label")}_getTabProperty(e,t){if(0===this._tabs.length)return null;const o=this._tabs[e];return o?o[t]:null}setTabLabel(e,t){const o=this;if(0===o._tabs.length)return;o._validateIndex(e,"update"),e=Math.max(0,Math.min(e,o._tabs.length-1));const n=o._tabs[e];void 0!==t&&n.label!==t&&o._updateTabLabel(n,t)}update(e,t,o){const n=this;if(0===n._tabs.length)return;n._validateIndex(e,"update"),e=Math.max(0,Math.min(e,n._tabs.length-1));const a=n._tabs[e];void 0!==t&&a.label!==t&&n._updateTabLabel(a,t),void 0!==o&&(a.content=o)}_createElement(){const e=this;e.$.dropDownButton.id||(e.$.dropDownButton.id=e.id+"DropDownButton"),e.$.dropDownButtonDropDown.id||(e.$.dropDownButtonDropDown.id=e.id+"DropDown"),e.setAttribute("role","tablist"),e.$.dropDownButton.setAttribute("role","button"),e.$.dropDownButton.setAttribute("aria-haspopup",!0),e.$.dropDownButton.setAttribute("aria-owns",e.$.dropDownButtonDropDown.id),e.$.dropDownButtonDropDown.setAttribute("role","menu"),e.disabled&&(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0),e.rightToLeft&&(e.$.tabsHeaderItems.removeChild(e.$.dropDownButton),"top"===e.tabPosition||"bottom"===e.tabPosition?e.$.tabsHeaderItems.insertBefore(e.$.dropDownButton,e.$.scrollButtonNear):e.$.tabsHeaderItems.insertBefore(e.$.dropDownButton,e.$.tabSelectionBar)),e._handlePosition(e.tabPosition),e._handleScrollButtonsPosition(e.scrollButtonsPosition,"both"),null!==e.dataSource&&e._processDataSource(),e._setFocusable(),e.collapsed&&!e.collapsible&&(e.collapsed=!1),e.collapsible&&e.allowToggle&&(e.allowToggle=!1),e._processHTML(),null===e.selectedIndex&&e.$.tabContentSection.setAttribute("show-placeholder",""),setTimeout((()=>e.refreshTabHeader()),300),e.$.hiddenInput.value=e.selectedIndex,e.enableShadowDOM&&HTMLElement.prototype.appendChild.apply(e,[e.$.hiddenInput])}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;switch(e){case"addNewTab":o?n._insertAddNewTab():(n.$.tabStrip.removeChild(n._addNewTab),delete n._addNewTab),n._applyTabOverflow();break;case"allowToggle":o&&n.collapsible?(n.collapsed&&n._toggleCollapsedState(),n.collapsible=!1):o||null!==n.selectedIndex||(n.ensureVisible(n.selectedIndex=0),n._select(n.selectedIndex,!0,null));break;case"closeButtonMode":if("selected"===o){for(let e=0;e<n._tabs.length;e++)n._disableCloseButton(e);n._enableCloseButton(n.selectedIndex)}else{n._disableCloseButton(n.selectedIndex);const e=n._tabLabelContainers;for(let t=0;t<e.length;t++){const o=e[t];o.closeButtonEnabled=!0!==n._tabs[t].closeButtonHidden,n._showCloseButton(o)}}n._applyTabOverflow();break;case"closeButtons":{const e=n._tabLabelContainers,t=o?n._showCloseButton:n._hideCloseButton;for(let o=0;o<e.length;o++)t(e[o]);n._applyTabOverflow();break}case"collapsed":if(!n.collapsible&&o)return void(n.collapsed=!1);break;case"collapsible":!o&&n.collapsed&&(n.collapsed=!1),n.allowToggle=!1,void 0===n.selectedIndex&&n.select(n._focusedItem.index);break;case"dataSource":n.selectedIndex=null;for(let e=0;e<n._groupLabels.length;e++)n.$.container.removeChild(n._groupLabels[e].dropDown);n.$.tabStrip.innerHTML="",n._processDataSource(),n._processHTML();break;case"disabled":n._setFocusable(),n.$.scrollButtonNear.disabled=o,n.$.scrollButtonFar.disabled=o,o||n._updateScrollButtonVisibility(),n._closeDropDownButtonDropDown();break;case"messages":case"scrollMode":case"selectionMode":case"readonly":case"reorder":break;case"overflow":if("scroll"!==n.tabLayout)return;n.$.tabStrip.scrollLeft=n._getScrollLeft(0),n.$.tabStrip.scrollTop=0,"hidden"===o?(n.$tabsHeaderSection.removeClass("scroll-buttons-shown"),n.$scrollButtonNear.addClass("jqx-hidden"),n.$scrollButtonFar.addClass("jqx-hidden")):n._checkOverflowScroll(),n._getTabCoordinates();break;case"tabPosition":n.$.tabSelectionBar.style.transition="none",n._tabPositionChanging=!0,n._closeGroupDropDown(),n._handlePosition(o,t),"shrink"!==n.tabLayout&&n._applyLabelSizes("tabPosition"),n.rightToLeft&&(n.$.tabsHeaderItems.removeChild(n.$.dropDownButton),"top"===n.tabPosition||"bottom"===n.tabPosition?n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.scrollButtonNear):n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.tabSelectionBar)),n._applyTabOverflow(),delete n._tabPositionChanging,requestAnimationFrame((function(){n.$.tabSelectionBar.style.transition=null}));break;case"resize":o&&n._getTabCoordinates();break;case"rightToLeft":n._positionTabSelectionBar(n._tabLabelContainers[n.selectedIndex],!0),n.$.tabsHeaderItems.removeChild(n.$.dropDownButton),!o||"top"!==n.tabPosition&&"bottom"!==n.tabPosition?n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.tabSelectionBar):n.$.tabsHeaderItems.insertBefore(n.$.dropDownButton,n.$.scrollButtonNear),n.ensureVisible(n.selectedIndex);break;case"scrollButtonsPosition":n._handleScrollButtonsPosition(o,t);break;case"selectedIndex":{if(isNaN(o)&&(n.selectedIndex=o=t),!n.allowToggle&&null===o)return void(n.selectedIndex=t);let e=o;null!==o&&(e=Math.max(0,Math.min(o,n._tabs.length-1)),n.ensureVisible(e)),n._select(e,!0,t);break}case"tabLayout":"scroll"===t&&(n.$tabsHeaderSection.removeClass("scroll-buttons-shown"),n.$scrollButtonNear.addClass("jqx-hidden"),n.$scrollButtonFar.addClass("jqx-hidden")),"shrink"===o?n._applyLabelSizes("shrink",!0):"shrink"===t&&n._applyLabelSizes("shrink",!1),n._applyTabOverflow(),"scroll"===o&&n.disabled&&(n.$.scrollButtonNear.disabled=!0,n.$.scrollButtonFar.disabled=!0),n.ensureVisible(n.selectedIndex);break;case"tabTextOrientation":n._applyTabOverflow(),n.ensureVisible(n.selectedIndex);break;case"unfocusable":n._setFocusable()}}_addGroupContainer(e,t){const o=this,n=document.createElement("div"),a=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div"),i=document.createElement("div");return n.className="jqx-tab-group-container jqx-unselectable",n.$=JQX.Utilities.Extend(n),n.setAttribute("role","group"),n.setAttribute("aria-expanded",!1),n.setAttribute("aria-haspopup",!0),n.setAttribute("aria-label",e),a.className="jqx-tab-label-text-wrapper",a.setAttribute("role","presentation"),a.setAttribute("aria-hidden",!0),null!==t&&"shrink"!==o.tabLayout&&(n.style[o._orientationSettings.dimension]=parseInt(t,10)+"px"),r.className="jqx-tab-label-text-container",r.innerHTML=e,s.className="jqx-tab-group-arrow",i.className="jqx-tab-group-drop-down jqx-hidden",i.$=JQX.Utilities.Extend(i),i.id=o.id+"GroupDropDown"+e,i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),n.setAttribute("aria-owns",i.id),a.appendChild(r),a.appendChild(s),n.appendChild(a),o.$.container.appendChild(i),n.group=e,n.dropDown=i,i.groupContainer=n,{label:n,dropDown:i}}_addGroupElements(e){const t=this,o=e.groups,n=e.groupLabels,a=e.group,r=o.indexOf(a),s=e.tabLabelContainer;let i;if(-1!==r)i=n[r],i.dropDown.appendChild(s);else{o.push(a);const r=t._addGroupContainer(a,e.smartTabItemsGroup.labelSize),l=r.dropDown;i=r.label,l.appendChild(s),l.groupContainer=r.label,e.documentFragment.appendChild(i),n.push(i)}t.selectedIndex===e.i&&(t._selectedGroup=i,i.$.addClass("jqx-tab-group-selected"))}_addNewTabHandler(e,t,o){const n=this;n._swiping||(o?(e.removeAttribute("hover"),n.addNewTabAutoCreate&&(n.insert(n._tabs.length,{label:"New Tab",content:""}),n._select(n._tabs.length-1,!0)),n.$.fireEvent("addNewTabClick")):n._reordering||n._swiping||("mouseover"===t?e.setAttribute("hover",""):"mouseout"===t&&e.removeAttribute("hover")))}_addTabLabelContainer(e,t){const o=this,n=document.createElement("div"),a=document.createElement("div"),r=document.createElement("div"),s=document.createElement("div");let i;return e&&(e.disabled?n.setAttribute("disabled",""):n.removeAttribute("disabled")),n.className="jqx-tab-label-container jqx-unselectable",a.className="jqx-tab-label-text-wrapper",r.className="jqx-tab-label-text-container",r.setAttribute("role","presentation"),s.className="jqx-tab-close-button",s.setAttribute("role","button"),s.setAttribute("aria-label","Close"),void 0===t?(o.closeButtons?"default"===o.closeButtonMode&&e.closeButtonHidden||"selected"===o.closeButtonMode&&!e.selected?(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!1):(r.classList.add("jqx-close-button-enabled"),n.closeButtonEnabled=!0):(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!0),i=document.createElement("div"),i.className="jqx-tab-label-container jqx-unselectable",e&&null===e.group&&null!==e.labelSize&&"shrink"!==o.tabLayout&&(n.style[o._orientationSettings.dimension]=parseInt(e.labelSize,10)+"px")):(s.classList.add("jqx-hidden"),n.closeButtonEnabled=!1),o._setLabel(e?e.label:"+",r,i),r.$=JQX.Utilities.Extend(r),s.$=JQX.Utilities.Extend(s),a.appendChild(r),a.appendChild(s),n.appendChild(a),n.$=JQX.Utilities.Extend(n),{tabLabelContainer:n,dropDownLabelContainer:i}}_animateSelection(e,t,o){const n=this;let a="right",r="left";if(n.rightToLeft&&(a="left",a="right"),n._animatedTab=e,n._animatedOldTab=t,n._animatedTab&&n._animatedOldTab){"left"!==n.tabPosition&&"right"!==n.tabPosition||(a="top",r="bottom");for(let e=0;e<n._tabs.length;e++)n._tabs[e].$.removeClass(a),n._tabs[e].$.removeClass(r),n._tabs[e].$.removeClass("animate");if(e===t)return e.$.hasClass("jqx-visibility-hidden")?e.$.removeClass("jqx-visibility-hidden"):e.$.addClass("jqx-visibility-hidden"),void(n._animatedOldTab.classToRemove=a);o?(e.$.addClass(a),e.$.removeClass("jqx-visibility-hidden"),t.$.addClass("jqx-visibility-hidden"),requestAnimationFrame((()=>{t.$.addClass("animate"),e.$.addClass("animate"),requestAnimationFrame((()=>{t.$.addClass(r),e.$.removeClass(a)}))})),n._animatedOldTab.classToRemove=r):(e.$.addClass(r),e.$.removeClass("jqx-visibility-hidden"),t.$.addClass("jqx-visibility-hidden"),requestAnimationFrame((()=>{t.$.addClass("animate"),e.$.addClass("animate"),requestAnimationFrame((()=>{t.$.addClass(a),e.$.removeClass(r)}))})),n._animatedOldTab.classToRemove=a)}}_applyConditionalTabOverflow(){const e=this,t="left"===e.tabPosition||"right"===e.tabPosition,o=e.$.tabStrip;if("scroll"!==e.tabLayout){if(e._flexWritingModeNoFullSupport&&"shrink"===e.tabLayout&&t&&o.scrollHeight>o.offsetHeight){const t=o.children,n=100/t.length+"%";o.$.addClass("shrink-tabs-vertical");for(let e=0;e<t.length;e++)t[e].style.height=n,t[e].firstElementChild.firstElementChild.classList.add("jqx-tab-label-text-container-full-height");e._inlineStyleTabStripChildren=!0}}else e._checkOverflowScroll()}_applyLabelSizes(e,t){const o=this,n=o._orientationSettings.dimension,a="width"===n?"height":"width";for(let r=0;r<o._reorderItems.length;r++){const s=o._reorderItems[r],i=o._getCorrespondingCustomElement(s);null!==i.labelSize&&("tabPosition"===e&&s.style.removeProperty(a),t?s.style.removeProperty(n):s.style[n]=parseInt(i.labelSize,10)+"px")}}refresh(){this._applyTabOverflow()}_applyTabOverflow(){const e=this;if(!e._tabs)return;if(e._removeInlineStyle(),0===e._tabs.length)return void e._toggleNavigationElementsVisibility();const t=e.tabLayout,o=e.tabPosition,n="left"===o||"right"===o,a=e.$.tabStrip;switch(e._closeDropDownButtonDropDown(),t){case"scroll":case"dropDown":e._flexWritingModeNoFullSupport&&"vertical"===e.tabTextOrientation&&n&&e._fixTabStripNotChrome(a);break;case"wrap":if("vertical"===e.tabTextOrientation)if(e._flexWritingModeNoFullSupport)if(n)e._fixTabStripNotChrome(a);else{const t=a.children;let o=t[0].offsetHeight;for(let e=1;e<t.length;e++)o=Math.max(o,t[e].offsetHeight);for(let e=1;e<t.length;e++)t[e].style.height=o+"px";e._inlineStyleTabStripChildren=!0}else n||a.scrollHeight>a.offsetHeight&&(a.style.height=a.scrollHeight+"px",e._inlineStyleTabStrip=!0);else n&&a.scrollWidth>a.offsetWidth&&(a.style.width=a.scrollWidth+"px","right"===o&&(a.style.flexWrap="wrap-reverse"),e._inlineStyleTabStrip=!0);break;case"shrink":if(n){if(e._flexWritingModeNoFullSupport&&"vertical"===e.tabTextOrientation){const t=a.children,o=window.getComputedStyle(t[0].firstElementChild),n=parseInt(o.paddingLeft,10)+parseInt(o.paddingRight,10);let r=0;for(let e=0;e<t.length;e++)r=Math.max(r,t[e].firstElementChild.firstElementChild.offsetWidth);a.style.width=n+r+"px",e._inlineStyleTabStrip=!0;break}}else a.scrollWidth>a.offsetWidth&&a.$.addClass("shrink-tabs")}e._applyConditionalTabOverflow(),e._getTabCoordinates(),e._fixTabStripFlex(t),e._toggleNavigationElementsVisibility(),e._positionTabSelectionBar(e._tabLabelContainers[e.selectedIndex],!0)}_checkOverflowScroll(){const e=this,t=e.$tabsHeaderSection,o=e.$.tabStrip,n=e.overflow;if("hidden"===n)return;let a,r,s;if("left"!==e.tabPosition&&"right"!==e.tabPosition){const t=Math.abs(e._getScrollLeft());a=Math.round(o.scrollWidth)>Math.round(o.offsetWidth),e.rightToLeft?(s=Math.round(t)>0,r=Math.round(o.offsetWidth+t)<Math.round(o.scrollWidth)):(r=Math.round(t)>0,s=Math.round(o.offsetWidth+t)<Math.round(o.scrollWidth))}else a=Math.round(o.scrollHeight)>Math.round(o.offsetHeight),r=Math.round(o.scrollTop)>0,s=Math.round(o.offsetHeight+o.scrollTop)<Math.round(o.scrollHeight);"scroll"===n&&(t.addClass("scroll-buttons-shown"),e.$scrollButtonNear.removeClass("jqx-hidden"),e.$scrollButtonFar.removeClass("jqx-hidden")),a?"auto"===n?(t.hasClass("scroll-buttons-shown")||t.addClass("scroll-buttons-shown"),r?e.$scrollButtonNear.removeClass("jqx-hidden"):e.$scrollButtonNear.addClass("jqx-hidden"),s?e.$scrollButtonFar.removeClass("jqx-hidden"):e.$scrollButtonFar.addClass("jqx-hidden"),!1===(r&&s)?t.addClass("one-button-shown"):t.removeClass("one-button-shown"),e.disabled||(e.$.scrollButtonNear.disabled=!1,e.$.scrollButtonFar.disabled=!1)):(t.removeClass("one-button-shown"),e.disabled?(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0):(e.$.scrollButtonNear.disabled=!r,e.$.scrollButtonFar.disabled=!s)):!a&&"auto"===n&&t.hasClass("scroll-buttons-shown")?(t.removeClass("scroll-buttons-shown"),t.removeClass("one-button-shown"),e.$scrollButtonNear.addClass("jqx-hidden"),e.$scrollButtonFar.addClass("jqx-hidden")):a||"scroll"!==n||(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0)}_closeButtonVisibilityChangeHandler(e){const t=this,o=(JQX.EnableShadowDOM?e.composedPath()[0]:e.target).index;"selected"!==t.closeButtonMode?e.detail.hidden?t._disableCloseButton(o):t._enableCloseButton(o):t._tabLabelContainers[o].closeButtonEnabled=e.detail.hidden}_closeDropDownButtonDropDown(){const e=this;e._dropDownButtonDropDownOpened&&(e.$.dropDownButton.setAttribute("aria-expanded",!1),e.$dropDownButtonDropDown.addClass("jqx-hidden"),e._dropDownButtonDropDownOpened=!1)}_closeGroupDropDown(){const e=this;if(!e._openDropDown)return;const t=e._openDropDown.groupContainer;e._openDropDown.rippleInProgress?setTimeout((function(){e._openDropDown&&(t.setAttribute("aria-expanded",!1),e._openDropDown.$.addClass("jqx-hidden"),delete e._openDropDown.rippleInProgress,e._openDropDown=void 0)}),450):(t.setAttribute("aria-expanded",!1),e._openDropDown.$.addClass("jqx-hidden"),e._openDropDown=void 0)}_containerHandler(e){const t=this,o=e.type;if(t.disabled||t.readonly||t._resizing&&"mouseout"!==o||("down"===o||"up"===o)&&1!==e.which&&!JQX.Utilities.Core.isMobile)return;const n=t.shadowRoot||t.isInShadowDOM?(e.originalEvent||e).composedPath()[0]:(e.originalEvent||e).target;t.$.tabContentSection.contains(n)||(t.$.dropDownButton.contains(n)?t._dropDownButtonHandler(n,e):t.$.dropDownButtonDropDown.contains(n)?t._dropDownButtonHandler(n,e,!0):t._tabStripHandler(n,e))}_disableCloseButton(e){const t=this,o=t._tabLabelContainers[e];o.closeButtonEnabled=!1,t.closeButtons&&t._hideCloseButton(o)}_documentMoveHandler(e){const t=this,o=t._orientationSettings;if(t._reordering){t._reorderStartThrown||(t._fireDragEvent(e,"dragStart"),t._reorderStartThrown=!0);const n=e[o.coordinate],a="wrap"!==t.tabLayout?function(e){return n>=e[o.from]&&n<=e[o.to]}:function(t){return e.pageX>=t.fromX&&e.pageX<=t.toX&&e.pageY>=t.fromY&&e.pageY<=t.toY};let r=!1;for(let e=0;e<t._tabCoordinates.length;e++)if(a(t._tabCoordinates[e])){r=e;break}!0!==t._preventReorder&&!1!==r&&r!==t._draggedIndex&&(t._reorderTabs(t._draggedIndex,r),t._closeGroupDropDown(),t._draggedIndex=r,t._getReorderItems(),t._getTabCoordinates());const s=t._tabCoordinates[t._draggedIndex];"wrap"!==t.tabLayout&&(n<s[o.from]||n>s[o.to])||"wrap"===t.tabLayout&&(null!==e.originalEvent.target.closest(".jqx-tab-label-container")||null!==e.originalEvent.target.closest(".jqx-tab-group-container"))&&!(e.pageX>=s.fromX&&e.pageX<=s.toX&&e.pageY>=s.fromY&&e.pageY<=s.toY)?t._preventReorder=!0:t._preventReorder=!1}else t._resizing&&(t.$.resizeToken.style[o.edge]=e[o.coordinate]-t._tabsHeaderSectionCoordinate+"px",t.$resizeToken.removeClass("jqx-hidden"))}_documentUpHandler(e){const t=this;if(!e.originalEvent)return;let o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;t.$.container.contains(o)&&t._containerHandler(e),t._touchmoveInside?t._endSwiping(e,Date.now()):(delete t._dragStartDetails,delete t._swiping),delete t._touchCoords,delete t._touchmoveInside,!t._openDropDown||t._openDropDown.rippleInProgress||o!==document&&o.closest(".jqx-tab-group-container")===t._openDropDown.groupContainer||"pointercancel"===e.originalEvent.type||t._closeGroupDropDown(),t.$.dropDownButton.contains(o)||"pointercancel"===e.originalEvent.type||t._closeDropDownButtonDropDown(),t._endReordering(e,o),t._resize(e),void 0!==t._tabToResize&&(t._tabToResize=void 0),delete t._downTarget}_dropDownButtonHandler(e,t,o){const n=this,a=t.type;if(o){if(e.classList.contains("jqx-tab-label-container"))switch(a){case"down":n._downTarget=e;break;case"mouseout":e.removeAttribute("hover");break;case"mouseover":e.setAttribute("hover","");break;case"up":e===n._downTarget&&t.originalEvent&&"pointercancel"!==t.originalEvent.type&&(n.select(Array.from(n.$.dropDownButtonDropDown.children).indexOf(e)),n._closeDropDownButtonDropDown())}}else if("down"===a)n._downTarget=n.$.dropDownButton;else if("up"===a&&n._downTarget===n.$.dropDownButton)if(n._dropDownButtonDropDownOpened)n._closeDropDownButtonDropDown();else{const e=n.tabPosition;let t,o;switch(n.$.dropDownButton.setAttribute("aria-expanded",!0),e){case"top":t=n.$.dropDownButton.offsetLeft,o=n.$.tabsHeaderSection.offsetTop+n.$.dropDownButton.offsetHeight;break;case"bottom":t=n.$.dropDownButton.offsetLeft,o=n.$.tabsHeaderSection.offsetTop;break;case"left":t=n.$.dropDownButton.offsetWidth,o=n.$.dropDownButton.offsetTop;break;case"right":t=n.$.tabsHeaderSection.offsetLeft,o=n.$.dropDownButton.offsetTop}n.$.dropDownButtonDropDown.style.left=t+"px",n.$.dropDownButtonDropDown.style.top=o+"px",n.$dropDownButtonDropDown.removeClass("jqx-hidden"),n._dropDownButtonDropDownOpened=!0}}_enableCloseButton(e){const t=this,o=t._tabLabelContainers[e];o.closeButtonEnabled=!0,t.closeButtons&&t._showCloseButton(o)}_endReordering(e,t){const o=this;o._reordering&&(o._draggedHoveredTab&&(o._draggedHoveredTab.contains(t)||o._draggedHoveredTab.removeAttribute("hover"),delete o._draggedHoveredTab),o._reorderedIndex=void 0,o._reordering=!1,o._reorderStartThrown=!1,o.removeAttribute("dragged"),e&&o._fireDragEvent(e,"dragEnd"))}_endSwiping(e,t){const o=this;if(!o._dragStartDetails)return;const n=o._orientationSettings,a=o.$.tabStrip,r=Math.abs(o._dragStartDetails.startTime-t),s=200/r,i=(o._dragStartDetails[n.startCoordinate]-e[n.coordinate])*s;let l=Math.abs(i);const d=function(){if(o.rightToLeft&&"scrollLeft"===n.scrollDirection){const e=Math.abs(o._getScrollLeft());if(i<0&&e===a[n.scrollSize]-a[n.size]||i>0&&0===e)return!1}else if(i>0&&a[n.scrollDirection]===a[n.scrollSize]-a[n.size]||i<0&&0===a[n.scrollDirection])return!1;return!0};let c=.03*Math.abs(i)*s;const b=function(){if(c>5){const e=(l-c)/Math.abs(i);e<.1?c/=1.25:e<.15?c/=1.2:e<.2?c/=1.15:e<.25?c/=1.1:e<.3&&(c/=1.05)}c=Math.round(c);const e=a[n.scrollDirection];o.rightToLeft&&"scrollLeft"===n.scrollDirection?JQX.Utilities.Core.Browser.Chrome?a[n.scrollDirection]=i>0?Math.max(e+c,0):Math.min(e-c,a[n.scrollSize]-a[n.size]):a[n.scrollDirection]=i>0?Math.min(e+c,a[n.scrollSize]-a[n.size]):Math.min(e-c,0):a[n.scrollDirection]=i>0?Math.min(e+c,a[n.scrollSize]-a[n.size]):Math.max(e-c,0),l-=c,o._updateScrollButtonVisibility(!0);const t=d();l>0&&t?o._scrollingAnimationFrame=window.requestAnimationFrame(b):o._wheelInProgress=!1};o._scrollingAnimationFrame&&cancelAnimationFrame(o._scrollingAnimationFrame),r<500&&d()?o._scrollingAnimationFrame=window.requestAnimationFrame(b):o._wheelInProgress=!1,delete o._dragStartDetails,o._swiping&&delete o._swiping}_fireDragEvent(e,t){const o=this,n=o.$.tabStrip.children[o._draggedIndex],a=n.tab;let r,s,i;a?(r=a.selected,s=a.index,i=a.label):i=n.group,o.$.fireEvent(t,{position:{left:e.pageX,top:e.pageY},left:e.pageX,top:e.pageY,target:n,selected:r,index:s,label:i})}_fixTabStripNotChrome(e){const t=this;function o(){const o=[].slice.call(e.children).filter((e=>!e._lazyRemove));let n=o[0].getBoundingClientRect(),a=n.left,r=a+o[0].offsetWidth;for(let e=1;e<o.length;e++)n=o[e].getBoundingClientRect(),a=Math.min(a,n.left),r=Math.max(r,n.left+o[e].offsetWidth);e.style.width=r-a+"px",t._inlineStyleTabStrip=!0}0!==t._tabs.length&&(o(),JQX.Utilities.Core.Browser.Safari&&setTimeout((function(){e.parentElement.classList.add("jqx-hidden"),setTimeout((function(){e.parentElement.classList.remove("jqx-hidden"),o()}),10)}),10),t.$.fireEvent("tabStripResize"))}_fixTabStripFlex(e){const t=this;t._flexWritingModeNoFullSupport||"vertical"!==t.tabTextOrientation||"left"!==t.tabPosition&&"right"!==t.tabPosition||setTimeout((function(){t.$tabsHeaderSection.addClass("jqx-hidden"),setTimeout((function(){t.$tabsHeaderSection.removeClass("jqx-hidden"),t._getTabCoordinates(),"scroll"===e&&t._checkOverflowScroll()}),10)}),10)}_getCorrespondingCustomElement(e){return e.$.hasClass("jqx-tab-label-container")?e.tab:this.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+e.group+'"]')}_getReorderItems(){const e=this;let t;0===e._groups.length?t=e._tabLabelContainers:(t=Array.from(e.$.tabStrip.children),e.addNewTab&&t.pop()),e._reorderItems=t}_getTabCoordinates(){const e=this;if(!e.reorder&&!e.resize||"hidden"===e.tabPosition)return;const t=[],o=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;for(let a=0;a<e._reorderItems.length;a++){const r=e._reorderItems[a],s=r.getBoundingClientRect(),i=window.getComputedStyle(r),l=parseFloat(i.marginLeft),d=parseFloat(i.marginRight),c=parseFloat(i.marginTop),b=parseFloat(i.marginBottom);t.push({fromX:s.left-l+o,toX:s.right+d+o,fromY:s.top-c+n,toY:s.bottom+b+n})}e._tabCoordinates=t}_getTabs(){const e=this;let t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item");if(e.querySelector("jqx-tabs")){t=e.shadowRoot?e.shadowRoot.querySelectorAll("jqx-tab-item"):e.getElementsByTagName("jqx-tab-item");let o=[];const n=e.querySelector(".jqx-tabs-content-section");if(n){for(let e=0;e<t.length;e++)t[e].parentNode===n&&o.push(t[e]);t=o}}null!==e.selectedIndex&&(0===t.length?e.selectedIndex=null:e.selectedIndex=Math.max(0,Math.min(e.selectedIndex,t.length-1))),e._tabs=Array.from(t),e.$.hiddenInput.value=e.selectedIndex}_groupContainerHandler(e,t){const o=this,n=e.dropDown;if("down"===t)return o._downTarget=e,void(o.reorder&&o._reorderItems.length>1&&(o._getTabCoordinates(),o._reordering=!0,o.setAttribute("dragged",""),o._draggedIndex=Array.from(o.$.tabStrip.children).indexOf(e)));o._reordering||o._swiping||(n===o._openDropDown||"mouseover"!==t||e.classList.contains("jqx-tab-group-selected")?"mouseout"===t&&e.removeAttribute("hover"):e.setAttribute("hover","")),"up"!==t||o._downTarget!==e||void 0!==o._reorderedIndex||o._swiping||(n===o._openDropDown?(o._closeGroupDropDown(),e.classList.contains("jqx-tab-group-selected")||e.setAttribute("hover","")):o._openGroupDropDown(e))}_handlePosition(e,t){const o=this;if(-1===[void 0,"top","left","hidden"].indexOf(t)||"bottom"!==e&&"right"!==e?"bottom"!==t&&"right"!==t||-1===["top","left","hidden"].indexOf(e)||o.$.container.insertBefore(o.$.tabsHeaderSection,o.$.tabContentSection):o.$.container.insertBefore(o.$.tabContentSection,o.$.tabsHeaderSection),"hidden"===e)return o._orientationSettings={coordinate:"pageY",dimension:"height",edge:"top",from:"fromY",size:"offsetHeight",to:"toY",scrollDirection:"scrollTop",scrollSize:"scrollHeight",startCoordinate:"startY",wheelOffset:35},o.removeAttribute("horizontal"),o.removeAttribute("vertical"),void o.setAttribute("aria-orientation","horizontal");"top"===e||"bottom"===e?(o._orientationSettings={coordinate:"pageX",dimension:"width",edge:"left",from:"fromX",size:"offsetWidth",to:"toX",scrollDirection:"scrollLeft",scrollSize:"scrollWidth",startCoordinate:"startX",wheelOffset:70},o.removeAttribute("vertical"),o.setAttribute("horizontal",""),o.$arrowNear.removeClass("jqx-arrow-up"),o.$arrowNear.addClass("jqx-arrow-left"),o.$arrowFar.removeClass("jqx-arrow-down"),o.$arrowFar.addClass("jqx-arrow-right"),o.setAttribute("aria-orientation","horizontal"),o.$.scrollButtonNear.setAttribute("aria-label","Scroll left"),o.$.scrollButtonFar.setAttribute("aria-label","Scroll right")):(o._orientationSettings={coordinate:"pageY",dimension:"height",edge:"top",from:"fromY",size:"offsetHeight",to:"toY",scrollDirection:"scrollTop",scrollSize:"scrollHeight",startCoordinate:"startY",wheelOffset:35},o.removeAttribute("horizontal"),o.setAttribute("vertical",""),o.$arrowNear.removeClass("jqx-arrow-left"),o.$arrowNear.addClass("jqx-arrow-up"),o.$arrowFar.removeClass("jqx-arrow-right"),o.$arrowFar.addClass("jqx-arrow-down"),o.setAttribute("aria-orientation","vertical"),o.$.scrollButtonNear.setAttribute("aria-label","Scroll up"),o.$.scrollButtonFar.setAttribute("aria-label","Scroll down"))}_handleScrollButtonsPosition(e,t){const o=this,n=o.$.tabsHeaderItems;e!==t&&("both"===e?"near"===t?n.insertBefore(o.$.scrollButtonFar,o.$.dropDownButton):n.insertBefore(o.$.scrollButtonNear,o.$.tabStrip):"near"===e?("far"===t&&n.insertBefore(o.$.scrollButtonNear,o.$.tabStrip),n.insertBefore(o.$.scrollButtonFar,o.$.tabStrip)):("near"===t&&n.insertBefore(o.$.scrollButtonFar,o.$.dropDownButton),n.insertBefore(o.$.scrollButtonNear,o.$.scrollButtonFar)))}_hideCloseButton(e){e.firstElementChild.children[0].$.removeClass("jqx-close-button-enabled"),e.firstElementChild.children[1].$.addClass("jqx-hidden")}_indexChangeHandler(e){const t=this,o=e.detail.oldIndex,n=Math.max(0,Math.min(e.detail.newIndex,t._tabs.length-1));if(o!==n){if(0===t._groups.length)t._reorderTabs(o,n);else{const a=e.detail.tabItem;a._setIndex(o),t.removeAt(o),t.insert(n,{node:a}),t.selectedIndex===o&&t._select(n,!1)}t._reorderedIndex=void 0}}_insertAddNewTab(){const e=this,t=e._addTabLabelContainer(void 0,!0).tabLabelContainer;t.$.addClass("jqx-add-new-tab"),e.$.tabStrip.appendChild(t),e._addNewTab=t}_insertIntoExistingGroup(e){const t=this,o=e.smartTabItemsGroup,n=e.tab,a=e.tabLabelContainer,r=e.group,s=t._groupLabels[t._groups.indexOf(r)].dropDown;let i=e.index;i=Math.max(0,Math.min(i,o.childElementCount)),s.insertBefore(a,s.children[i]);const l=o.children[i];let d;d=l?l.index:o.children[i-1].index+1,o.insertBefore(n,l),t._tabLabelContainers.splice(d,0,a),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[d]||null),t._tabs.splice(d,0,n),i=d,n.group=r,t._updateIndexes(i)}_insertIntoNewGroup(e){const t=this,o=e.tab,n=e.tabLabelContainer,a=e.group,r=t._addGroupContainer(a),s=r.label;r.dropDown.appendChild(n),t._groups.push(a);let i=Math.max(0,Math.min(e.index,t.$.tabStrip.childElementCount)),l=i;t._addNewTab&&l===t.$.tabStrip.childElementCount&&l--,t.$.tabStrip.insertBefore(s,t.$.tabStrip.children[l]||null),t._groupLabels.push(s);const d=document.createElement("jqx-tab-items-group");d.appendChild(o),t.$.tabContentSection.insertBefore(d,t.$.tabContentSection.children[i]),d.label=a;const c=d.previousElementSibling;let b=0;c&&(c instanceof JQX.TabItem?b=c.index+1:c&&(b=c.lastElementChild.index+1)),t._tabLabelContainers.splice(b,0,n),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[b]||null),t._tabs.splice(b,0,o),i=b,o.group=a,t._updateIndexes(i)}_insertNearAGroup(e){const t=this,o=e.tab,n=e.tabLabelContainer;let a=e.index;a=Math.max(0,Math.min(a,t._tabs.length));const r=t._tabs[a-1],s=t._tabs[a],i=s?s.group:void 0;r&&null!==r.group&&s&&null!==i?(s.tabLabelContainer.parentElement.insertBefore(n,s.tabLabelContainer),s.parentElement.insertBefore(o,s),o.group=i):s?null!==i?(t.$.tabStrip.insertBefore(n,t._groupLabels[t._groups.indexOf(i)]),t.$.tabContentSection.insertBefore(o,t.$.tabContentSection.querySelector('jqx-tab-items-group[label="'+i+'"]'))):(t.$.tabStrip.insertBefore(n,s.tabLabelContainer),t.$.tabContentSection.insertBefore(o,s)):(t.$.tabStrip.insertBefore(n,t._addNewTab||null),t.$.tabContentSection.appendChild(o)),t._tabLabelContainers.splice(a,0,n),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[a]||null),t._tabs.splice(a,0,o),t._updateIndexes(a)}_insertNoGrouping(e){const t=this,o=Math.max(0,Math.min(e.index,t._tabs.length)),n=e.tab,a=e.tabLabelContainer;t.$.tabStrip.insertBefore(a,t._tabLabelContainers[o]||t._addNewTab||null),t.$.tabContentSection.insertBefore(n,t._tabs[o]||null),t._tabLabelContainers.splice(o,0,a),t.$.dropDownButtonDropDown.insertBefore(e.dropDownLabelContainer,t.$.dropDownButtonDropDown.children[o]||null),t._tabs.splice(o,0,n),t._updateIndexes(o)}_keydownHandler(e){const t=this,o=e.key;if((t.isInShadowDOM?t.getRootNode().activeElement:document.activeElement)!==t||-1===["ArrowLeft","ArrowDown","ArrowRight","ArrowUp","End","Home","Enter"," ","Escape"].indexOf(o)||t.disabled||t.readonly||"none"===t.selectionMode||!t.allowToggle&&null===t.selectedIndex||t._reordering||t._swiping)return;e.preventDefault();const n=t._tabs.length-1;let a,r,s,i,l=0;switch(t.rightToLeft?(s="ArrowRight",i="ArrowLeft"):(s="ArrowLeft",i="ArrowRight"),o){case s:case"ArrowUp":if(t.collapsible&&e.ctrlKey)return void(o===s?"right"===t.tabPosition?t.expand():"left"===t.tabPosition&&t.collapse():"ArrowUp"===o&&("bottom"===t.tabPosition?t.expand():"top"===t.tabPosition&&t.collapse()));if(l=-1,0===t.selectedIndex){r=!0;break}a=t.selectedIndex+l;break;case i:case"ArrowDown":if(t.collapsible&&e.ctrlKey)return void(o===i?"right"===t.tabPosition?t.collapse():"left"===t.tabPosition&&t.expand():"ArrowDown"===o&&("bottom"===t.tabPosition?t.collapse():"top"===t.tabPosition&&t.expand()));if(l=1,t.selectedIndex===n){r=!0;break}a=t.selectedIndex+l;break;case"End":if(t.selectedIndex===n){r=!0;break}a=n;break;case"Home":if(0===t.selectedIndex){r=!0;break}a=0;break;case"Enter":case" ":if(!t.allowToggle)return;if(t._focusedItem){t.select(t._focusedItem.index);const e=t._focusedItem.tabLabelContainer.closest(".jqx-tab-group-drop-down");e&&t._openGroupDropDown(e.groupContainer)}return;case"Escape":return void(t._openDropDown&&t._closeGroupDropDown())}if(t.allowToggle&&t._tabs.length>0){t._focusedItem?t._focusedItem.tabLabelContainer.removeAttribute("focus"):t._focusedItem=t._focusedItem||t._tabs[t.selectedIndex]||t._tabs[0],t._focusedItem=t._tabs[Math.min(Math.max(0,t._focusedItem.index+l),n)],t._focusedItem.tabLabelContainer.setAttribute("focus",""),t.ensureVisible(t._focusedItem.index);const e=t._focusedItem.tabLabelContainer.closest(".jqx-tab-group-drop-down");e&&e.groupContainer?(t._openDropDown&&t._openDropDown!==e.dropDown&&t._closeGroupDropDown(),t._openGroupDropDown(e.groupContainer)):t._openDropDown&&t._closeGroupDropDown()}else r||t.select(a)}_labelContainerHandler(e,t,o){const n=this,a="up"===o&&n._downTarget===e;if("down"===o&&(n._downTarget=e,"click"===n.selectionMode&&e!==n._addNewTab))if(JQX.Utilities.Core.isMobile&&null===e.tab.group){const o=n.$.tabStrip[n._orientationSettings.scrollDirection];setTimeout((function(){o===n.$.tabStrip[n._orientationSettings.scrollDirection]&&n._ripple(t,e)&&n._openDropDown&&n._openDropDown.contains(e)&&(n._openDropDown.rippleInProgress=!0)}),100)}else n._ripple(t,e)&&n._openDropDown&&n._openDropDown.contains(e)&&(n._openDropDown.rippleInProgress=!0);if(e===n._addNewTab)return void n._addNewTabHandler(e,o,a);const r=e.tab.index,s=!(n._reordering&&void 0!==n._reorderedIndex);a&&r===n.selectedIndex&&(n._closeGroupDropDown(),s&&null===e.tab.group&&n._toggleCollapsedState()),!n._swiping&&(s&&"click"===n.selectionMode&&a||!n._reordering&&(n.selectionMode===o||"mouseenter"===n.selectionMode&&"mouseover"===o))&&n._select(r,!0),n._reordering||n._swiping||"click"!==n.selectionMode&&"dblclick"!==n.selectionMode||("mouseover"!==o||e.hasAttribute("selected")?"mouseout"===o&&e.removeAttribute("hover"):e.setAttribute("hover","")),n.reorder&&"down"===o&&null===e.tab.group&&n._reorderItems.length>1&&(n._getTabCoordinates(),n._reordering=!0,n.setAttribute("dragged",""),e.hasAttribute("hover")&&(n._draggedHoveredTab=e),0===n._groups.length?n._draggedIndex=e.tab.index:n._draggedIndex=Array.from(n.$.tabStrip.children).indexOf(e))}_labelSizeChangeHandler(e){const t=this,o=e.detail.size;let n;"shrink"!==t.tabLayout&&(n=e.target instanceof JQX.TabItem?e.target.tabLabelContainer:t._groupLabels[t._groups.indexOf(e.target.label)],null!==o?n.style[t._orientationSettings.dimension]=parseInt(o,10)+"px":n.style.removeProperty(t._orientationSettings.dimension),t._applyTabOverflow())}_openGroupDropDown(e){const t=this;e&&(t._openDropDown&&t._openDropDown.$.addClass("jqx-hidden"),e.dropDown.$.removeClass("jqx-hidden"),t._positionGroupDropDown(e),t._openDropDown=e.dropDown,e.removeAttribute("hover"),e.setAttribute("aria-expanded",!0))}_orderTabs(){const e=this,t=[],o=[];let n=!0,a=!1;if(0===e.getElementsByTagName("jqx-tab-items-group").length)for(let r=0;r<e._tabs.length;r++){const s=e._tabs[r],i=s.index;if(n&&null!==i&&(n=!1),-1!==t.indexOf(i||0)&&(a=!0,null!==i))break;t.push(i||0),o.push({tab:s,index:i})}if(!a){const e=t.slice(0).sort((function(e,t){return e-t}));JSON.stringify(t)===JSON.stringify(e)&&(n=!0)}if(n||a){n||e.warn(e.localize("ambiguousIndexes"));for(let t=0;t<e._tabs.length;t++)e._tabs[t]._setIndex(t)}else{o.sort((function(e,t){return e.index-t.index}));for(let t=0;t<o.length;t++){const n=o[t].tab;n._setIndex(t),e.$.tabContentSection.removeChild(n)}for(let t=0;t<o.length;t++){const n=o[t].tab;e.$.tabContentSection.appendChild(n),e._tabs[t]=n}}}_populateTabStrip(){const e=this,t=document.createDocumentFragment(),o=[],n=[],a=[];let r=null;for(let s=0;s<e._tabs.length;s++){const i=e._tabs[s],l=i.parentElement,d=l instanceof JQX.TabItemsGroup?l.label:null;i.group=d;const c=e._addTabLabelContainer(i),b=c.tabLabelContainer,p=c.dropDownLabelContainer;e.selectedIndex===s&&(b.$.addClass("jqx-tab-selected"),b.setAttribute("selected",""),r=b),i.tabLabelContainer=b,b.tab=i,o.push(b),e._setAriaRelations(i,b,p),null===d?t.appendChild(b):e._addGroupElements({documentFragment:t,groups:n,groupLabels:a,i:s,group:d,tabLabelContainer:b,smartTabItemsGroup:l}),e.$.dropDownButtonDropDown.appendChild(p)}e.$.tabStrip.appendChild(t),e._tabLabelContainers=o,e._groups=n,e._groupLabels=a,e._positionTabSelectionBar(r,!0)}_setAriaRelations(e,t,o){const n=this.id;e.id||(e.id=n+"TabItem"+e.index),t.id||(t.id=n+"TabLabelContainer"+e.index),t.setAttribute("role","tab"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-label",e.label),t.setAttribute("aria-selected",e.selected),e.setAttribute("aria-label",e.label),o.setAttribute("role","menuitem"),o.setAttribute("aria-controls",e.id)}_positionTabSelectionBar(e,t){const o=this;if(!e)return;const n=o.tabPosition;let a,r,s,i;if(t&&(o.$.tabSelectionBar.style.transition="none"),e.tab.group&&(e=o._groupLabels[o._groups.indexOf(e.tab.group)]),"top"===n||"bottom"===n){if("wrap"===o.tabLayout?(r=e.offsetTop,"top"===n&&(r+=e.offsetHeight-o.$.tabSelectionBar.offsetHeight),r+="px"):r=null,i=null,o.rightToLeft&&"horizontal"===o.tabTextOrientation)if(JQX.Utilities.Core.Browser.Chrome){const t=o.$.tabStrip;a=-(t.scrollLeft-(t.scrollWidth-t.offsetWidth))+e.offsetLeft+"px"}else a=-o.$.tabStrip.scrollLeft+e.offsetLeft+"px";else a=-o.$.tabStrip.scrollLeft+e.offsetLeft+"px";s=e.offsetWidth+"px"}else"left"!==n&&"right"!==n||("wrap"===o.tabLayout?(a=e.offsetLeft,"left"===n&&(a+=e.offsetWidth-o.$.tabSelectionBar.offsetWidth),a+="px"):a=null,s=null,r=-o.$.tabStrip.scrollTop+e.offsetTop+"px",i=e.offsetHeight+"px");function l(){o.$.tabSelectionBar.style.top=r,o.$.tabSelectionBar.style.height=i,o.$.tabSelectionBar.style.left=a,o.$.tabSelectionBar.style.width=s}JQX.Utilities.Core.isMobile&&o.hasAnimation&&!t?requestAnimationFrame((function(){requestAnimationFrame(l)})):l(),t&&!o._tabPositionChanging&&requestAnimationFrame((()=>o.$.tabSelectionBar.style.transition=null))}_positionGroupDropDown(e){const t=this,o=t.tabPosition,n=e.dropDown,a=window.getComputedStyle(t.$.tabsHeaderSection),r=parseFloat(a[t.rightToLeft?"paddingRight":"paddingLeft"]),s=parseFloat(a.paddingTop);if("top"===o||"bottom"===o){const a=!1;if(t.rightToLeft?n.style.left=e.offsetLeft-t._getScrollLeft()-r-n.offsetWidth+e.offsetWidth+"px":n.style.left=e.offsetLeft-t.$.tabStrip.scrollLeft+r+"px","top"===o)a||(n.style.top=e.offsetTop+e.offsetHeight+s+"px");else{let o=e.getBoundingClientRect().top-t.$.container.getBoundingClientRect().top+s;a&&(o+=t.$.tabStrip.offsetHeight),n.style.top=o+"px"}}else n.style.top=e.offsetTop-t.$.tabStrip.scrollTop+s+"px",n.style.left="left"===o?e.offsetLeft+e.offsetWidth+r+"px":e.getBoundingClientRect().left-t.$.container.getBoundingClientRect().left+r+"px"}_processDataSource(){const e=this,t=e.dataSource;function o(e,t){let n;if(Array.isArray(e.items)&&e.items.length>0){n=document.createElement("jqx-tab-items-group");for(let t=0;t<e.items.length;t++)e.items[t].items||o(e.items[t],n)}else n=document.createElement("jqx-tab-item"),!0===e.closeButtonHidden&&(n.closeButtonHidden=!0),void 0!==e.content&&(n.innerHTML=e.content),void 0!==e.index&&(n.index=e.index),!0===e.selected&&(n.selected=e.selected);void 0!==e.label&&(n.label=e.label),void 0!==e.labelSize&&(n.labelSize=e.labelSize),t.appendChild(n)}if(e.$.tabContentSection.innerHTML="",null!==t)for(let n=0;n<t.length;n++)o(t[n],e.$.tabContentSection)}_processHTML(){const e=this;e._getTabs(),e._orderTabs(),e._validateInitialSelection(),e._populateTabStrip(),e.addNewTab&&e._insertAddNewTab(),e._getReorderItems(),e._applyTabOverflow(),e.ensureVisible(e.selectedIndex),e.$.hiddenInput.value=e.selectedIndex}_removeInlineStyle(){const e=this,t=e.$.tabStrip;if(e._inlineStyleTabStripChildren){const o=t.children;for(let e=0;e<o.length;e++)o[e].removeAttribute("style"),o[e].firstElementChild.firstElementChild.classList.remove("jqx-tab-label-text-container-full-height");delete e._inlineStyleTabStripChildren}e._inlineStyleTabStrip&&(t.removeAttribute("style"),delete e._inlineStyleTabStrip),t.$.removeClass("shrink-tabs"),t.$.removeClass("shrink-tabs-vertical")}_reorderTabs(e,t){function o(e,t,o){const n=e[t];e.splice(t,1),e.splice(o,0,n)}const n=this,a=n.$.tabStrip[n._orientationSettings.scrollDirection];if(0===n._groups.length){const a=n._tabs,r=n._tabLabelContainers,s=e>t?t:t+1;let i;n.selectedIndex===e?n.selectedIndex=t:n.selectedIndex<=t&&n.selectedIndex>e?n.selectedIndex--:n.selectedIndex>=t&&n.selectedIndex<e&&n.selectedIndex++,i=r[s]?r[s]:n.addNewTab?n._addNewTab:null,n.$.tabStrip.insertBefore(r[e],i),n.$.dropDownButtonDropDown.insertBefore(n.$.dropDownButtonDropDown.children[e],n.$.dropDownButtonDropDown.children[s]||null),n.$.tabContentSection.insertBefore(a[e],a[s]||null),o(a,e,t),o(r,e,t),n._updateTabIndexes()}else n._reorderTabsGrouping(e,t);n.$.tabStrip[n._orientationSettings.scrollDirection]=a,n.$.fireEvent("reorder",{index:t,oldIndex:e,newIndex:t,originalIndex:e}),n._reorderedIndex=t,n._positionTabSelectionBar(n._tabLabelContainers[n.selectedIndex],!0),n.$.hiddenInput.value=n.selectedIndex}_reorderTabsGrouping(e,t){const o=this,n=o.$.tabStrip.children,a=o.$.tabContentSection.children,r=e>t?t:t+1,s=o._tabs[o.selectedIndex];o.$.tabStrip.insertBefore(n[e],n[r]||null),o.$.tabContentSection.insertBefore(a[e],a[r]||null),o._groupLabels=Array.from(o.$.tabStrip.getElementsByClassName("jqx-tab-group-container")),o._groups=[];for(let e=0;e<o._groupLabels.length;e++)o._groups.push(o._groupLabels[e].group);o._tabs=Array.from(o.$.tabContentSection.getElementsByTagName("jqx-tab-item"));const i=document.createDocumentFragment();let l=[];for(let e=0;e<o._tabs.length;e++)i.appendChild(o.$.dropDownButtonDropDown.children[o._tabs[e].index].cloneNode(!0));o.$.dropDownButtonDropDown.innerHTML="",o.$.dropDownButtonDropDown.appendChild(i);for(let e=0;e<o.$.tabStrip.childElementCount;e++){const t=o.$.tabStrip.children[e];t.$.hasClass("jqx-tab-label-container")&&t!==o._addNewTab?l.push(t):t.$.hasClass("jqx-tab-group-container")&&(l=l.concat(Array.from(t.dropDown.children)))}o._tabLabelContainers=l,o._updateTabIndexes(),s&&(o.selectedIndex=s.index)}_resize(e){const t=this;if(!t._resizing)return;const o=t._orientationSettings,n=e[o.coordinate]-t._resizeFrom,a=t._getCorrespondingCustomElement(t._tabToResize);let r;r=null===a.labelSize?t._tabToResize[o.size]:a.labelSize;const s=Math.max(10,r+n);s!==r&&(a._preventPropertyChangedHandler=!0,a.labelSize=s,t._tabToResize.style[o.dimension]=parseInt(s,10)+"px"),t.$resizeToken.addClass("jqx-hidden"),t._applyTabOverflow(),t._resizing=!1,t.removeAttribute("resizing")}_ripple(e,t){if(this.hasRippleAnimation){const o=document.createElement("div");return o.className="ripple-agent",t.firstElementChild.appendChild(o),setTimeout((function(){t.firstElementChild.removeChild(o)}),1e3),JQX.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),!0}}_scrollButtonClickHandler(e){const t=this,o=t.$.tabStrip;let n=e.target.closest("jqx-repeat-button")===t.$.scrollButtonNear?-1:1;if("paging"===t.scrollMode){const a=t._orientationSettings,r={};return t._dragStartDetails={startX:0,startY:0,pageX:0,pageY:0,startTime:Date.now(),target:e.target},t._wheelInProgress=!0,r[a.coordinate]=-n*(o[a.size]/1.1428571428571428),void t._endSwiping(r,t._dragStartDetails.startTime+175)}t.hasAttribute("horizontal")?o.scrollLeft+=10*n:o.scrollTop+=10*n,t._updateScrollButtonVisibility(!0)}_getScrollLeft(e){const t=this,o=t.$.tabStrip;return void 0===e?t.rightToLeft&&JQX.Utilities.Core.Browser.Chrome?o.scrollLeft-(o.scrollWidth-o.offsetWidth):o.scrollLeft:(!t.rightToLeft||"top"!==t.tabPosition&&"bottom"!==t.tabPosition||(JQX.Utilities.Core.Browser.Chrome?e=o.scrollWidth-o.offsetWidth-e:e*=-1),e)}_select(e,t,o){const n=this,a=n.hasAnimation;void 0===o&&(o=n.selectedIndex);const r=n._tabs[e];if(!r||r.disabled||e===o&&(!n.allowToggle||n.allowToggle&&"mouseenter"===n.selectionMode))n.$.hiddenInput.value=n.selectedIndex;else{if(n._focusedItem&&n._focusedItem.tabLabelContainer.removeAttribute("focus"),null!==o){const t=n._tabs[o];a?n._animateSelection(r,t,e>o):t.$.addClass("jqx-visibility-hidden"),t.selected=!1,n._tabLabelContainers[o].$.removeClass("jqx-tab-selected"),n._tabLabelContainers[o].removeAttribute("selected"),n.closeButtons&&"selected"===n.closeButtonMode&&n._disableCloseButton(o)}null!==e&&(n._tabLabelContainers[e].removeAttribute("hover"),n.closeButtons&&"selected"===n.closeButtonMode&&n._enableCloseButton(e)),!n.allowToggle||null!==e&&(void 0!==arguments[2]?o:n.selectedIndex)!==e?(r.selected=!0,n.$.tabContentSection.removeAttribute("show-placeholder"),null!==o&&a||r.$.removeClass("jqx-visibility-hidden"),n.selectedIndex=e,n._focusedItem=n._tabs[e],n._focusedItem.tabLabelContainer.$.addClass("jqx-tab-selected"),n._focusedItem.tabLabelContainer.setAttribute("selected",""),n._positionTabSelectionBar(n._focusedItem.tabLabelContainer,null===o)):(n.selectedIndex=null,n.$.tabContentSection.setAttribute("show-placeholder",""),n.allowToggle&&(n._focusedItem=n._tabs[null===e?o:e],n._focusedItem&&n._focusedItem.tabLabelContainer.setAttribute("focus",""))),t&&(n.$.hiddenInput.value=n.selectedIndex,n.$.fireEvent("change",{index:n.selectedIndex,oldIndex:o})),n._closeGroupDropDown(),r&&null!==r.group?(n._selectedGroup&&n._selectedGroup.$.removeClass("jqx-tab-group-selected"),null!==n.selectedIndex&&(n._selectedGroup=n._groupLabels[n._groups.indexOf(r.group)],n._selectedGroup.$.addClass("jqx-tab-group-selected"))):n._selectedGroup&&(n._selectedGroup.$.removeClass("jqx-tab-group-selected"),delete n._selectedGroup),n.$.hiddenInput.value=n.selectedIndex}}_selectStartHandler(e){(this._reordering||this._resizing)&&e.preventDefault()}_setLabel(e,t,o){const n=e?document.getElementById(e):null;if(null!==n&&"template"===n.tagName.toLowerCase()){const e=document.importNode(n.content,!0);if(t.appendChild(e),o){const e=document.importNode(n.content,!0);o.appendChild(e)}}else""===e&&(e="&nbsp;"),t.innerHTML=e,o&&(o.innerHTML=e)}_showCloseButton(e){e.closeButtonEnabled&&(e.firstElementChild.children[0].$.addClass("jqx-close-button-enabled"),e.firstElementChild.children[1].$.removeClass("jqx-hidden"))}_tabContentSectionTransitionendHandler(e){const t=this,o=e.target;o instanceof JQX.TabItem&&(o===t._animatedOldTab?(o.$.addClass("jqx-hidden"),o.$.removeClass("animate"),o.$.removeClass(t._animatedOldTab.classToRemove),o.$.removeClass("jqx-hidden"),delete t._animatedOldTab):o===t._animatedTab&&(o.$.removeClass("animate"),delete t._animatedTab),o.classList.remove("left"),o.classList.remove("right"),o.classList.remove("top"),o.classList.remove("bottom"))}_tabsHeaderItemsWheelHandler(e){const t=this;if(!t.enableMouseWheelAction||t.disabled)return;const o=t.$.tabStrip,n=t._orientationSettings,a=o[n.size],r=o[n.scrollSize],s=o[n.scrollDirection],i=e.deltaY;if(a===r||0===s&&i<0||s+a===r&&i>0)return;if(e.preventDefault(),t._wheelInProgress)return;t._dragStartDetails={startX:e.pageX,startY:e.pageY,pageX:e.pageX,pageY:e.pageY,startTime:Date.now(),target:e.target},t._wheelInProgress=!0;const l={};l[n.coordinate]=e[n.coordinate]+(e.deltaY>0?-1:1)*n.wheelOffset,t._endSwiping(l,t._dragStartDetails.startTime+100)}_tabStripHandler(e,t){const o=this,n=t.type;if("down"===n&&void 0!==o._tabToResize)return o._resizing=!0,void(o._tabsHeaderSectionCoordinate=o.$.tabsHeaderSection.getBoundingClientRect()[o._orientationSettings.edge]);"down"===n&&JQX.Utilities.Core.isMobile&&(o._dragStartDetails={startX:t.pageX,startY:t.pageY,pageX:t.pageX,pageY:t.pageY,startTime:Date.now(),originalTime:Date.now(),target:t.originalEvent.target});const a=e.closest("jqx-repeat-button");if("up"===n&&a)return o.focus(),void(o.resize&&o._getTabCoordinates());if(e.classList.contains("jqx-tab-close-button"))if("up"===n){if(e===o._downTarget){const t=e.parentElement.parentElement.tab.index;return void(o.$.fireEvent("closing",{index:t}).defaultPrevented||(o.removeAt(t),o.$.fireEvent("close",{index:t})))}}else{if("down"===n)return void(o._downTarget=e);o._reordering||o._swiping||("mouseover"===n?e.setAttribute("hover",""):"mouseout"===n&&e.removeAttribute("hover"))}const r=e.closest(".jqx-tab-label-container");if(null!==r)return void(t.originalEvent&&"pointercancel"===t.originalEvent.type?r.tab.group&&delete r.parentElement.rippleInProgress:o._labelContainerHandler(r,t,n));const s=e.closest(".jqx-tab-group-container");null!==s&&o._groupContainerHandler(s,n)}_tabStripMouseleaveHandler(){const e=this;e.resize&&!e._resizing&&e.hasAttribute("resizing")&&e.removeAttribute("resizing")}_tabStripMoveHandler(e){const t=this;if(t._dragStartDetails&&!t._dragStartDetails.checked&&(Date.now()-t._dragStartDetails.originalTime<500?(t._endReordering(void 0,void 0),t._dragStartDetails.checked=!0):delete t._dragStartDetails),t._dragStartDetails&&(Math.abs(t._dragStartDetails.pageX-e.pageX)>=5||Math.abs(t._dragStartDetails.pageY-e.pageY)>=5)){const o=t._orientationSettings,n=t._dragStartDetails[o.coordinate]-e[o.coordinate],a=t.$.tabStrip[o.scrollDirection];return t.$.tabStrip[o.scrollDirection]+=n,a!==t.$.tabStrip[o.scrollDirection]&&t._updateScrollButtonVisibility(),t._dragStartDetails={startX:t._dragStartDetails.startX,startY:t._dragStartDetails.startY,pageX:e.pageX,pageY:e.pageY,startTime:t._dragStartDetails.startTime,originalTime:t._dragStartDetails.originalTime,target:e.originalEvent.target,checked:t._dragStartDetails.checked},void(t._swiping=!0)}if(!t.resize||t._resizing||t._reordering||"shrink"===t.tabLayout)return;const o=t._orientationSettings,n=e[o.coordinate],a=t._tabCoordinates;let r;for(let e=0;e<a.length;e++){const s=a[e][o.to];if(n>=s-4&&n<=s+4){r=t._reorderItems[e],t._resizeFrom=n;break}}void 0!==r?(t._tabToResize=r,t.setAttribute("resizing","")):(t._tabToResize=void 0,t.removeAttribute("resizing"))}_tabStripTouchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const o=t.$.tabStrip,n=t._orientationSettings,a=o[n.size],r=o[n.scrollSize],s=t._touchCoords;if(a===r||!s)return;const i=e.touches[0],l=o[n.scrollDirection],d=i[n.coordinate],c=parseFloat(d.toFixed(5)),b=s["pageY"===n.coordinate?1:0],p=parseFloat(b.toFixed(5));t._touchCoords=[i.pageX,i.pageY],0===l&&c>=p||l+a===r&&c<=p||(d!==b&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_tabStripTouchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_toggleCollapsedState(){const e=this;e.collapsible&&(e.collapsed?e.expand():e.collapse())}_toggleNavigationElementsVisibility(){const e=this,t=e._tabs.length;let o;if(0===t)o="addClass";else{if(1!==t)return;o="removeClass"}"scroll"===e.tabLayout&&"scroll"===e.overflow?(e.$scrollButtonNear[o]("jqx-hidden"),e.$scrollButtonFar[o]("jqx-hidden")):"dropDown"===e.tabLayout&&e.$dropDownButton[o]("jqx-hidden")}_updateIndexes(e){const t=this;null!==t.selectedIndex&&e<=t.selectedIndex&&t.selectedIndex++,t._updateTabIndexes()}_updateScrollButtonVisibility(e){const t=this;if("scroll"!==t.tabLayout||"hidden"===t.overflow)return void t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e);const o=t.$tabsHeaderSection,n=t.$.tabStrip,a=t._orientationSettings;let r=!0,s=!0;if(t.rightToLeft&&"scrollLeft"===a.scrollDirection){const e=Math.abs(t._getScrollLeft());0===Math.round(e)&&(s=!1),Math.round(n[a.size]+e)>=Math.round(n[a.scrollSize])-1&&(r=!1)}else 0===Math.round(n[a.scrollDirection])&&(r=!1),Math.round(n[a.size]+n[a.scrollDirection])>=Math.round(n[a.scrollSize])-1&&(s=!1);if("auto"===t.overflow){if(r&&s)return t.$scrollButtonNear.removeClass("jqx-hidden"),t.$scrollButtonFar.removeClass("jqx-hidden"),o.removeClass("one-button-shown"),void(t._tabLabelContainers[t.selectedIndex]&&t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e));r?t.$scrollButtonNear.removeClass("jqx-hidden"):t.$scrollButtonNear.addClass("jqx-hidden"),s?t.$scrollButtonFar.removeClass("jqx-hidden"):t.$scrollButtonFar.addClass("jqx-hidden"),o.addClass("one-button-shown"),t._getTabCoordinates()}else"scroll"!==t.overflow||t.disabled||(t.$.scrollButtonNear.disabled=!r,t.$.scrollButtonFar.disabled=!s);t._tabLabelContainers[t.selectedIndex]&&t._positionTabSelectionBar(t._tabLabelContainers[t.selectedIndex],e)}_updateTabIndexes(){const e=this;if(e._tabs.length>0)for(let t=0;t<e._tabs.length;t++)e._tabs[t]._setIndex(t);else e.selectedIndex=null;e.$.hiddenInput.value=e.selectedIndex}_updateTabLabel(e,t){const o=this,n=e.index,a=o._tabLabelContainers[n].firstElementChild.children[0],r=o.$.dropDownButtonDropDown.children[n];e.set("label",t),a.innerHTML="",r.innerHTML="",o._setLabel(t,a,r),o._applyTabOverflow(),e.setAttribute("aria-label",t),e.tabLabelContainer&&e.tabLabelContainer.setAttribute("aria-label",t)}_validateIndex(e,t){if(isNaN(parseInt(e,10))||"object"==typeof e){const e=this;e.error(e.localize("invalidIndex",{method:t}))}}_validateInitialSelection(){const e=this;let t=e.selectedIndex;for(let o=0;o<e._tabs.length;o++){const n=e._tabs[o];t===o?(n.selected=!0,n.$.removeClass("jqx-visibility-hidden")):n.selected?null===t?(t=o,n.$.removeClass("jqx-visibility-hidden")):(n.selected=!1,n.$.addClass("jqx-visibility-hidden")):n.$.addClass("jqx-visibility-hidden")}e._tabs.length>0&&null===t&&!e.allowToggle&&(t=0,e._tabs[0].selected=!0,e._tabs[0].$.removeClass("jqx-visibility-hidden")),e.selectedIndex=t,null!==e.selectedIndex&&(e._focusedItem=e._tabs[e.selectedIndex])}});
161
161
 
162
162
  /***/ }),
163
163
 
@@ -243,57 +243,57 @@ var __webpack_exports__ = {};
243
243
  // This entry need to be wrapped in an IIFE because it need to be in strict mode.
244
244
  (() => {
245
245
  "use strict";
246
- /* unused harmony export jqxGanttChart */
247
- /* harmony import */ var _jqx_element_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6321);
248
- /* harmony import */ var _jqx_element_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jqx_element_js__WEBPACK_IMPORTED_MODULE_0__);
249
- /* harmony import */ var _jqx_button_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2612);
250
- /* harmony import */ var _jqx_button_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jqx_button_js__WEBPACK_IMPORTED_MODULE_1__);
251
- /* harmony import */ var _jqx_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9135);
252
- /* harmony import */ var _jqx_scrollbar_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jqx_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__);
253
- /* harmony import */ var _jqx_date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2052);
254
- /* harmony import */ var _jqx_date_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jqx_date_js__WEBPACK_IMPORTED_MODULE_3__);
255
- /* harmony import */ var _jqx_listbox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5707);
256
- /* harmony import */ var _jqx_listbox_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jqx_listbox_js__WEBPACK_IMPORTED_MODULE_4__);
257
- /* harmony import */ var _jqx_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7650);
258
- /* harmony import */ var _jqx_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jqx_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5__);
259
- /* harmony import */ var _jqx_draw_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9613);
260
- /* harmony import */ var _jqx_draw_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jqx_draw_js__WEBPACK_IMPORTED_MODULE_6__);
261
- /* harmony import */ var _jqx_numeric_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2754);
262
- /* harmony import */ var _jqx_numeric_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_jqx_numeric_js__WEBPACK_IMPORTED_MODULE_7__);
263
- /* harmony import */ var _jqx_math_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8687);
264
- /* harmony import */ var _jqx_math_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_jqx_math_js__WEBPACK_IMPORTED_MODULE_8__);
265
- /* harmony import */ var _jqx_tooltip_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6693);
266
- /* harmony import */ var _jqx_tooltip_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_jqx_tooltip_js__WEBPACK_IMPORTED_MODULE_9__);
267
- /* harmony import */ var _jqx_timepicker_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1419);
268
- /* harmony import */ var _jqx_timepicker_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_jqx_timepicker_js__WEBPACK_IMPORTED_MODULE_10__);
269
- /* harmony import */ var _jqx_calendar_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5810);
270
- /* harmony import */ var _jqx_calendar_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_jqx_calendar_js__WEBPACK_IMPORTED_MODULE_11__);
271
- /* harmony import */ var _jqx_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7054);
272
- /* harmony import */ var _jqx_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_jqx_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12__);
273
- /* harmony import */ var _jqx_data_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6057);
274
- /* harmony import */ var _jqx_data_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_jqx_data_js__WEBPACK_IMPORTED_MODULE_13__);
275
- /* harmony import */ var _jqx_input_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8588);
276
- /* harmony import */ var _jqx_input_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_jqx_input_js__WEBPACK_IMPORTED_MODULE_14__);
277
- /* harmony import */ var _jqx_filter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(6170);
278
- /* harmony import */ var _jqx_filter_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_jqx_filter_js__WEBPACK_IMPORTED_MODULE_15__);
279
- /* harmony import */ var _jqx_format_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2515);
280
- /* harmony import */ var _jqx_format_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_jqx_format_js__WEBPACK_IMPORTED_MODULE_16__);
281
- /* harmony import */ var _jqx_gridpanel_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(3176);
282
- /* harmony import */ var _jqx_gridpanel_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_jqx_gridpanel_js__WEBPACK_IMPORTED_MODULE_17__);
283
- /* harmony import */ var _jqx_pager_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9362);
284
- /* harmony import */ var _jqx_pager_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_jqx_pager_js__WEBPACK_IMPORTED_MODULE_18__);
285
- /* harmony import */ var _jqx_table_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(5523);
286
- /* harmony import */ var _jqx_table_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_jqx_table_js__WEBPACK_IMPORTED_MODULE_19__);
287
- /* harmony import */ var _jqx_export_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(6802);
288
- /* harmony import */ var _jqx_export_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_jqx_export_js__WEBPACK_IMPORTED_MODULE_20__);
289
- /* harmony import */ var _jqx_splitter_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(1066);
290
- /* harmony import */ var _jqx_splitter_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_jqx_splitter_js__WEBPACK_IMPORTED_MODULE_21__);
291
- /* harmony import */ var _jqx_window_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(8466);
292
- /* harmony import */ var _jqx_window_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_jqx_window_js__WEBPACK_IMPORTED_MODULE_22__);
293
- /* harmony import */ var _jqx_tabs_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(9532);
294
- /* harmony import */ var _jqx_tabs_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_jqx_tabs_js__WEBPACK_IMPORTED_MODULE_23__);
295
- /* harmony import */ var _jqx_ganttchart_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(859);
296
- /* harmony import */ var _jqx_ganttchart_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_jqx_ganttchart_js__WEBPACK_IMPORTED_MODULE_24__);
246
+ /* unused harmony export smartGanttChart */
247
+ /* harmony import */ var _smart_element_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6321);
248
+ /* harmony import */ var _smart_element_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_smart_element_js__WEBPACK_IMPORTED_MODULE_0__);
249
+ /* harmony import */ var _smart_button_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2612);
250
+ /* harmony import */ var _smart_button_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smart_button_js__WEBPACK_IMPORTED_MODULE_1__);
251
+ /* harmony import */ var _smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9135);
252
+ /* harmony import */ var _smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__);
253
+ /* harmony import */ var _smart_date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2052);
254
+ /* harmony import */ var _smart_date_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_smart_date_js__WEBPACK_IMPORTED_MODULE_3__);
255
+ /* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5707);
256
+ /* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_smart_listbox_js__WEBPACK_IMPORTED_MODULE_4__);
257
+ /* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7650);
258
+ /* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_5__);
259
+ /* harmony import */ var _smart_draw_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9613);
260
+ /* harmony import */ var _smart_draw_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_smart_draw_js__WEBPACK_IMPORTED_MODULE_6__);
261
+ /* harmony import */ var _smart_numeric_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2754);
262
+ /* harmony import */ var _smart_numeric_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_smart_numeric_js__WEBPACK_IMPORTED_MODULE_7__);
263
+ /* harmony import */ var _smart_math_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(8687);
264
+ /* harmony import */ var _smart_math_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_smart_math_js__WEBPACK_IMPORTED_MODULE_8__);
265
+ /* harmony import */ var _smart_tooltip_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6693);
266
+ /* harmony import */ var _smart_tooltip_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_smart_tooltip_js__WEBPACK_IMPORTED_MODULE_9__);
267
+ /* harmony import */ var _smart_timepicker_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1419);
268
+ /* harmony import */ var _smart_timepicker_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_smart_timepicker_js__WEBPACK_IMPORTED_MODULE_10__);
269
+ /* harmony import */ var _smart_calendar_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(5810);
270
+ /* harmony import */ var _smart_calendar_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_smart_calendar_js__WEBPACK_IMPORTED_MODULE_11__);
271
+ /* harmony import */ var _smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7054);
272
+ /* harmony import */ var _smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_12__);
273
+ /* harmony import */ var _smart_data_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(6057);
274
+ /* harmony import */ var _smart_data_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_smart_data_js__WEBPACK_IMPORTED_MODULE_13__);
275
+ /* harmony import */ var _smart_input_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8588);
276
+ /* harmony import */ var _smart_input_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_smart_input_js__WEBPACK_IMPORTED_MODULE_14__);
277
+ /* harmony import */ var _smart_filter_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(6170);
278
+ /* harmony import */ var _smart_filter_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_smart_filter_js__WEBPACK_IMPORTED_MODULE_15__);
279
+ /* harmony import */ var _smart_format_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(2515);
280
+ /* harmony import */ var _smart_format_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_smart_format_js__WEBPACK_IMPORTED_MODULE_16__);
281
+ /* harmony import */ var _smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(3176);
282
+ /* harmony import */ var _smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_17__);
283
+ /* harmony import */ var _smart_pager_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(9362);
284
+ /* harmony import */ var _smart_pager_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_smart_pager_js__WEBPACK_IMPORTED_MODULE_18__);
285
+ /* harmony import */ var _smart_table_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(5523);
286
+ /* harmony import */ var _smart_table_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_smart_table_js__WEBPACK_IMPORTED_MODULE_19__);
287
+ /* harmony import */ var _smart_export_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(6802);
288
+ /* harmony import */ var _smart_export_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_smart_export_js__WEBPACK_IMPORTED_MODULE_20__);
289
+ /* harmony import */ var _smart_splitter_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(1066);
290
+ /* harmony import */ var _smart_splitter_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_smart_splitter_js__WEBPACK_IMPORTED_MODULE_21__);
291
+ /* harmony import */ var _smart_window_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(8466);
292
+ /* harmony import */ var _smart_window_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_smart_window_js__WEBPACK_IMPORTED_MODULE_22__);
293
+ /* harmony import */ var _smart_tabs_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(9532);
294
+ /* harmony import */ var _smart_tabs_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_smart_tabs_js__WEBPACK_IMPORTED_MODULE_23__);
295
+ /* harmony import */ var _smart_ganttchart_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(859);
296
+ /* harmony import */ var _smart_ganttchart_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_smart_ganttchart_js__WEBPACK_IMPORTED_MODULE_24__);
297
297
 
298
298
  /* JQX UI v17.0.57 (2023-12-18)
299
299
  Copyright (c) 2011-2023 jQWidgets.
@@ -325,9 +325,9 @@ License: https://htmlelements.com/license/ */ //
325
325
 
326
326
 
327
327
 
328
- class jqxGanttChart extends JQX.Component {
328
+ class smartGanttChart extends JQX.Component {
329
329
  get name() {
330
- return 'jqxGanttChart';
330
+ return 'smartGanttChart';
331
331
  }
332
332
  }
333
333
 
@@ -343,4 +343,4 @@ delete window.jqxWindow;
343
343
  })();
344
344
 
345
345
  /******/ })()
346
- ;
346
+ ;