@limetech/lime-elements 38.37.0 → 38.38.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 (307) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cjs/{checkbox.template-92ae2e60.js → checkbox.template-db4cd6c5.js} +2 -2
  3. package/dist/cjs/{checkbox.template-92ae2e60.js.map → checkbox.template-db4cd6c5.js.map} +1 -1
  4. package/dist/cjs/{index-174a078a.js → index-1ed03b2b.js} +1 -14
  5. package/dist/cjs/index-1ed03b2b.js.map +1 -0
  6. package/dist/cjs/lime-elements.cjs.js +2 -2
  7. package/dist/cjs/limel-3d-hover-effect-glow.cjs.entry.js +1 -1
  8. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +2 -2
  9. package/dist/cjs/limel-action-bar_2.cjs.entry.js +1 -1
  10. package/dist/cjs/limel-ai-avatar.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-badge.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  13. package/dist/cjs/limel-breadcrumbs_7.cjs.entry.js +2 -2
  14. package/dist/cjs/limel-button-group.cjs.entry.js +1 -1
  15. package/dist/cjs/limel-button.cjs.entry.js +2 -2
  16. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  17. package/dist/cjs/limel-card.cjs.entry.js +1 -1
  18. package/dist/cjs/limel-chart.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-checkbox.cjs.entry.js +2 -2
  20. package/dist/cjs/limel-chip_2.cjs.entry.js +2 -2
  21. package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
  22. package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
  23. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
  24. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +1 -1
  25. package/dist/cjs/limel-color-picker.cjs.entry.js +1 -1
  26. package/dist/cjs/limel-config.cjs.entry.js +1 -1
  27. package/dist/cjs/limel-date-picker.cjs.entry.js +1 -1
  28. package/dist/cjs/limel-dialog.cjs.entry.js +1 -1
  29. package/dist/cjs/limel-dock-button.cjs.entry.js +1 -1
  30. package/dist/cjs/limel-dock.cjs.entry.js +1 -1
  31. package/dist/cjs/limel-drag-handle.cjs.entry.js +1 -1
  32. package/dist/cjs/limel-dynamic-label.cjs.entry.js +1 -1
  33. package/dist/cjs/limel-file-dropzone_2.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-file-viewer.cjs.entry.js +1 -1
  35. package/dist/cjs/limel-file.cjs.entry.js +1 -1
  36. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  37. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  38. package/dist/cjs/limel-form.cjs.entry.js +1 -1
  39. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  40. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  41. package/dist/cjs/limel-help-content.cjs.entry.js +1 -1
  42. package/dist/cjs/limel-help.cjs.entry.js +1 -1
  43. package/dist/cjs/limel-helper-line_2.cjs.entry.js +1 -1
  44. package/dist/cjs/limel-icon-button.cjs.entry.js +3 -3
  45. package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
  46. package/dist/cjs/limel-icon.cjs.entry.js +1 -1
  47. package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/limel-linear-progress.cjs.entry.js +1 -1
  49. package/dist/cjs/limel-list-item.cjs.entry.js +2 -2
  50. package/dist/cjs/limel-markdown.cjs.entry.js +1 -1
  51. package/dist/cjs/limel-menu-item-meta.cjs.entry.js +1 -1
  52. package/dist/cjs/limel-picker.cjs.entry.js +1 -1
  53. package/dist/cjs/limel-popover_2.cjs.entry.js +1 -1
  54. package/dist/cjs/limel-portal_3.cjs.entry.js +1 -1
  55. package/dist/cjs/limel-profile-picture.cjs.entry.js +1 -1
  56. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
  57. package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
  58. package/dist/cjs/limel-prosemirror-adapter.cjs.entry.js +1 -1
  59. package/dist/cjs/limel-radio-button-group.cjs.entry.js +1 -1
  60. package/dist/cjs/limel-radio-button.cjs.entry.js +1 -1
  61. package/dist/cjs/limel-select.cjs.entry.js +1 -1
  62. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  63. package/dist/cjs/limel-slider.cjs.entry.js +1 -1
  64. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  65. package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
  66. package/dist/cjs/limel-switch.cjs.entry.js +2 -2
  67. package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
  68. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  69. package/dist/cjs/limel-table.cjs.entry.js +26536 -20436
  70. package/dist/cjs/limel-table.cjs.entry.js.map +1 -1
  71. package/dist/cjs/limel-text-editor.cjs.entry.js +1 -1
  72. package/dist/cjs/loader.cjs.js +2 -2
  73. package/dist/cjs/{make-enter-clickable-39af24ec.js → make-enter-clickable-3369d31a.js} +28 -15
  74. package/dist/cjs/make-enter-clickable-3369d31a.js.map +1 -0
  75. package/dist/collection/components/icon-button/icon-button.css +1 -1
  76. package/dist/collection/components/table/columns.js.map +1 -1
  77. package/dist/collection/components/table/table-selection.js +3 -0
  78. package/dist/collection/components/table/table-selection.js.map +1 -1
  79. package/dist/collection/components/table/table.css +406 -163
  80. package/dist/collection/components/table/table.js +94 -44
  81. package/dist/collection/components/table/table.js.map +1 -1
  82. package/dist/collection/util/make-enter-clickable.js +27 -13
  83. package/dist/collection/util/make-enter-clickable.js.map +1 -1
  84. package/dist/esm/{checkbox.template-9acc6347.js → checkbox.template-024bb3b3.js} +2 -2
  85. package/dist/esm/{checkbox.template-9acc6347.js.map → checkbox.template-024bb3b3.js.map} +1 -1
  86. package/dist/esm/{index-2714248e.js → index-0c4503aa.js} +2 -14
  87. package/dist/esm/index-0c4503aa.js.map +1 -0
  88. package/dist/esm/lime-elements.js +3 -3
  89. package/dist/esm/limel-3d-hover-effect-glow.entry.js +1 -1
  90. package/dist/esm/limel-action-bar-item_2.entry.js +2 -2
  91. package/dist/esm/limel-action-bar_2.entry.js +1 -1
  92. package/dist/esm/limel-ai-avatar.entry.js +1 -1
  93. package/dist/esm/limel-badge.entry.js +1 -1
  94. package/dist/esm/limel-banner.entry.js +1 -1
  95. package/dist/esm/limel-breadcrumbs_7.entry.js +2 -2
  96. package/dist/esm/limel-button-group.entry.js +1 -1
  97. package/dist/esm/limel-button.entry.js +2 -2
  98. package/dist/esm/limel-callout.entry.js +1 -1
  99. package/dist/esm/limel-card.entry.js +1 -1
  100. package/dist/esm/limel-chart.entry.js +1 -1
  101. package/dist/esm/limel-checkbox.entry.js +2 -2
  102. package/dist/esm/limel-chip_2.entry.js +2 -2
  103. package/dist/esm/limel-circular-progress.entry.js +1 -1
  104. package/dist/esm/limel-code-editor.entry.js +1 -1
  105. package/dist/esm/limel-collapsible-section.entry.js +2 -2
  106. package/dist/esm/limel-color-picker-palette.entry.js +1 -1
  107. package/dist/esm/limel-color-picker.entry.js +1 -1
  108. package/dist/esm/limel-config.entry.js +1 -1
  109. package/dist/esm/limel-date-picker.entry.js +1 -1
  110. package/dist/esm/limel-dialog.entry.js +1 -1
  111. package/dist/esm/limel-dock-button.entry.js +1 -1
  112. package/dist/esm/limel-dock.entry.js +1 -1
  113. package/dist/esm/limel-drag-handle.entry.js +1 -1
  114. package/dist/esm/limel-dynamic-label.entry.js +1 -1
  115. package/dist/esm/limel-file-dropzone_2.entry.js +1 -1
  116. package/dist/esm/limel-file-viewer.entry.js +1 -1
  117. package/dist/esm/limel-file.entry.js +1 -1
  118. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  119. package/dist/esm/limel-flex-container.entry.js +1 -1
  120. package/dist/esm/limel-form.entry.js +1 -1
  121. package/dist/esm/limel-grid.entry.js +1 -1
  122. package/dist/esm/limel-header.entry.js +1 -1
  123. package/dist/esm/limel-help-content.entry.js +1 -1
  124. package/dist/esm/limel-help.entry.js +1 -1
  125. package/dist/esm/limel-helper-line_2.entry.js +1 -1
  126. package/dist/esm/limel-icon-button.entry.js +3 -3
  127. package/dist/esm/limel-icon-button.entry.js.map +1 -1
  128. package/dist/esm/limel-icon.entry.js +1 -1
  129. package/dist/esm/limel-info-tile.entry.js +1 -1
  130. package/dist/esm/limel-linear-progress.entry.js +1 -1
  131. package/dist/esm/limel-list-item.entry.js +2 -2
  132. package/dist/esm/limel-markdown.entry.js +1 -1
  133. package/dist/esm/limel-menu-item-meta.entry.js +1 -1
  134. package/dist/esm/limel-picker.entry.js +1 -1
  135. package/dist/esm/limel-popover_2.entry.js +1 -1
  136. package/dist/esm/limel-portal_3.entry.js +1 -1
  137. package/dist/esm/limel-profile-picture.entry.js +1 -1
  138. package/dist/esm/limel-progress-flow-item.entry.js +1 -1
  139. package/dist/esm/limel-progress-flow.entry.js +1 -1
  140. package/dist/esm/limel-prosemirror-adapter.entry.js +1 -1
  141. package/dist/esm/limel-radio-button-group.entry.js +1 -1
  142. package/dist/esm/limel-radio-button.entry.js +1 -1
  143. package/dist/esm/limel-select.entry.js +1 -1
  144. package/dist/esm/limel-shortcut.entry.js +1 -1
  145. package/dist/esm/limel-slider.entry.js +1 -1
  146. package/dist/esm/limel-snackbar.entry.js +1 -1
  147. package/dist/esm/limel-split-button.entry.js +1 -1
  148. package/dist/esm/limel-switch.entry.js +2 -2
  149. package/dist/esm/limel-tab-bar.entry.js +1 -1
  150. package/dist/esm/limel-tab-panel.entry.js +1 -1
  151. package/dist/esm/limel-table.entry.js +26536 -20436
  152. package/dist/esm/limel-table.entry.js.map +1 -1
  153. package/dist/esm/limel-text-editor.entry.js +1 -1
  154. package/dist/esm/loader.js +3 -3
  155. package/dist/esm/{make-enter-clickable-e0d24198.js → make-enter-clickable-1ab65ddc.js} +28 -15
  156. package/dist/esm/make-enter-clickable-1ab65ddc.js.map +1 -0
  157. package/dist/lime-elements/lime-elements.esm.js +1 -1
  158. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  159. package/dist/lime-elements/{p-8ded6465.js → p-03fd2774.js} +2 -2
  160. package/dist/lime-elements/{p-8539647d.entry.js → p-054daef5.entry.js} +2 -2
  161. package/dist/lime-elements/{p-4f85b3c4.entry.js → p-07c4def0.entry.js} +2 -2
  162. package/dist/lime-elements/{p-5b1cb891.entry.js → p-08f75835.entry.js} +2 -2
  163. package/dist/lime-elements/{p-eac0220e.entry.js → p-147b0a68.entry.js} +2 -2
  164. package/dist/lime-elements/{p-407a0e61.entry.js → p-19f525ba.entry.js} +2 -2
  165. package/dist/lime-elements/{p-ac55217a.entry.js → p-1a351a7f.entry.js} +2 -2
  166. package/dist/lime-elements/{p-bb0095c2.entry.js → p-1af74f5c.entry.js} +2 -2
  167. package/dist/lime-elements/{p-2116b3ce.entry.js → p-2356b938.entry.js} +2 -2
  168. package/dist/lime-elements/{p-8c667a56.entry.js → p-25158b9e.entry.js} +2 -2
  169. package/dist/lime-elements/{p-8e7d31b3.entry.js → p-263bac63.entry.js} +2 -2
  170. package/dist/lime-elements/{p-18256ad9.entry.js → p-280cbd66.entry.js} +2 -2
  171. package/dist/lime-elements/{p-3a36b862.entry.js → p-291cd743.entry.js} +2 -2
  172. package/dist/lime-elements/{p-aa159bd8.entry.js → p-2a616374.entry.js} +2 -2
  173. package/dist/lime-elements/{p-5f113a63.entry.js → p-312d104a.entry.js} +2 -2
  174. package/dist/lime-elements/{p-52fb3988.entry.js → p-317f00ea.entry.js} +2 -2
  175. package/dist/lime-elements/{p-c7ffe359.entry.js → p-32611964.entry.js} +2 -2
  176. package/dist/lime-elements/{p-416f25fc.entry.js → p-333ba7ca.entry.js} +2 -2
  177. package/dist/lime-elements/{p-b80a7353.entry.js → p-354c2d16.entry.js} +2 -2
  178. package/dist/lime-elements/{p-d497cac7.entry.js → p-36ae8adf.entry.js} +2 -2
  179. package/dist/lime-elements/{p-4ed15eb7.entry.js → p-3fcd15bd.entry.js} +2 -2
  180. package/dist/lime-elements/{p-2ff2186f.entry.js → p-4d225689.entry.js} +2 -2
  181. package/dist/lime-elements/p-4e77c9a5.js +2 -0
  182. package/dist/lime-elements/p-4e77c9a5.js.map +1 -0
  183. package/dist/lime-elements/{p-668e583c.entry.js → p-56c9bb65.entry.js} +2 -2
  184. package/dist/lime-elements/{p-745417ee.entry.js → p-5ca68424.entry.js} +2 -2
  185. package/dist/lime-elements/{p-b928421f.entry.js → p-5ef0a1fe.entry.js} +2 -2
  186. package/dist/lime-elements/p-5ef0a1fe.entry.js.map +1 -0
  187. package/dist/lime-elements/{p-4a9a6e16.entry.js → p-60a43c1d.entry.js} +2 -2
  188. package/dist/lime-elements/{p-ac334aa7.entry.js → p-67b697b4.entry.js} +2 -2
  189. package/dist/lime-elements/{p-b45cfa71.entry.js → p-6c5eea77.entry.js} +2 -2
  190. package/dist/lime-elements/{p-5ac43dbd.entry.js → p-6ce5a93f.entry.js} +2 -2
  191. package/dist/lime-elements/{p-d4a220eb.entry.js → p-6ddb0265.entry.js} +2 -2
  192. package/dist/lime-elements/{p-0115bb1e.entry.js → p-6ef87216.entry.js} +2 -2
  193. package/dist/lime-elements/{p-51d475d8.entry.js → p-6f3a34f1.entry.js} +2 -2
  194. package/dist/lime-elements/{p-54fc2316.entry.js → p-718d5311.entry.js} +2 -2
  195. package/dist/lime-elements/{p-e839ce5b.entry.js → p-72a79ebe.entry.js} +2 -2
  196. package/dist/lime-elements/{p-0d247b83.entry.js → p-7b681f7c.entry.js} +2 -2
  197. package/dist/lime-elements/{p-f8b6d7e1.entry.js → p-7d107fba.entry.js} +2 -2
  198. package/dist/lime-elements/{p-47da9c59.entry.js → p-81de7836.entry.js} +2 -2
  199. package/dist/lime-elements/{p-32572c31.entry.js → p-8535dc16.entry.js} +2 -2
  200. package/dist/lime-elements/{p-706c2e84.entry.js → p-9697010e.entry.js} +2 -2
  201. package/dist/lime-elements/{p-483ba5da.entry.js → p-9a64025b.entry.js} +2 -2
  202. package/dist/lime-elements/{p-f1ec1eeb.entry.js → p-9c9876f9.entry.js} +2 -2
  203. package/dist/lime-elements/{p-9b809f4d.entry.js → p-9e225545.entry.js} +2 -2
  204. package/dist/lime-elements/{p-4ddb8b05.entry.js → p-a92369cb.entry.js} +2 -2
  205. package/dist/lime-elements/{p-1e4ca584.entry.js → p-ae25ca92.entry.js} +2 -2
  206. package/dist/lime-elements/{p-580a29c5.entry.js → p-b076958e.entry.js} +2 -2
  207. package/dist/lime-elements/{p-20950d83.entry.js → p-b3f1f121.entry.js} +2 -2
  208. package/dist/lime-elements/{p-07988749.entry.js → p-b89cb5a3.entry.js} +2 -2
  209. package/dist/lime-elements/{p-6ef94d19.entry.js → p-b906e1c5.entry.js} +2 -2
  210. package/dist/lime-elements/p-bdfa539c.js +3 -0
  211. package/dist/lime-elements/p-bdfa539c.js.map +1 -0
  212. package/dist/lime-elements/{p-b43e8cb2.entry.js → p-c445aed7.entry.js} +2 -2
  213. package/dist/lime-elements/{p-489d7f63.entry.js → p-c64e86fd.entry.js} +2 -2
  214. package/dist/lime-elements/{p-cbbe129b.entry.js → p-cb81be35.entry.js} +2 -2
  215. package/dist/lime-elements/{p-9af45dec.entry.js → p-cd0010ba.entry.js} +2 -2
  216. package/dist/lime-elements/{p-250acfe4.entry.js → p-ce0e6d28.entry.js} +2 -2
  217. package/dist/lime-elements/{p-7528a002.entry.js → p-cecdb592.entry.js} +2 -2
  218. package/dist/lime-elements/{p-2fdb51de.entry.js → p-dd0f3190.entry.js} +2 -2
  219. package/dist/lime-elements/{p-10d1256b.entry.js → p-e1df39fc.entry.js} +2 -2
  220. package/dist/lime-elements/{p-c823d32b.entry.js → p-e22edc40.entry.js} +2 -2
  221. package/dist/lime-elements/{p-3a61deb1.entry.js → p-e4fd6591.entry.js} +2 -2
  222. package/dist/lime-elements/{p-e739d600.entry.js → p-e8370ee5.entry.js} +2 -2
  223. package/dist/lime-elements/{p-874f06f0.entry.js → p-ead08551.entry.js} +5 -5
  224. package/dist/lime-elements/{p-ae507565.entry.js → p-ec03874d.entry.js} +2 -2
  225. package/dist/lime-elements/{p-b5a96409.entry.js → p-f1c9089e.entry.js} +2 -2
  226. package/dist/lime-elements/p-f6d8811f.entry.js +2 -0
  227. package/dist/lime-elements/p-f6d8811f.entry.js.map +1 -0
  228. package/dist/lime-elements/{p-c2f922ba.entry.js → p-f8cbb607.entry.js} +2 -2
  229. package/dist/types/components/table/columns.d.ts +7 -11
  230. package/dist/types/components/table/table-selection.d.ts +4 -4
  231. package/dist/types/components/table/table.d.ts +15 -5
  232. package/dist/types/components.d.ts +12 -0
  233. package/dist/types/util/make-enter-clickable.d.ts +19 -3
  234. package/package.json +3 -3
  235. package/dist/cjs/index-174a078a.js.map +0 -1
  236. package/dist/cjs/make-enter-clickable-39af24ec.js.map +0 -1
  237. package/dist/esm/index-2714248e.js.map +0 -1
  238. package/dist/esm/make-enter-clickable-e0d24198.js.map +0 -1
  239. package/dist/lime-elements/p-288f0842.js +0 -3
  240. package/dist/lime-elements/p-288f0842.js.map +0 -1
  241. package/dist/lime-elements/p-533a3cfb.entry.js +0 -2
  242. package/dist/lime-elements/p-533a3cfb.entry.js.map +0 -1
  243. package/dist/lime-elements/p-b928421f.entry.js.map +0 -1
  244. package/dist/lime-elements/p-e127eaaa.js +0 -2
  245. package/dist/lime-elements/p-e127eaaa.js.map +0 -1
  246. /package/dist/lime-elements/{p-8ded6465.js.map → p-03fd2774.js.map} +0 -0
  247. /package/dist/lime-elements/{p-8539647d.entry.js.map → p-054daef5.entry.js.map} +0 -0
  248. /package/dist/lime-elements/{p-4f85b3c4.entry.js.map → p-07c4def0.entry.js.map} +0 -0
  249. /package/dist/lime-elements/{p-5b1cb891.entry.js.map → p-08f75835.entry.js.map} +0 -0
  250. /package/dist/lime-elements/{p-eac0220e.entry.js.map → p-147b0a68.entry.js.map} +0 -0
  251. /package/dist/lime-elements/{p-407a0e61.entry.js.map → p-19f525ba.entry.js.map} +0 -0
  252. /package/dist/lime-elements/{p-ac55217a.entry.js.map → p-1a351a7f.entry.js.map} +0 -0
  253. /package/dist/lime-elements/{p-bb0095c2.entry.js.map → p-1af74f5c.entry.js.map} +0 -0
  254. /package/dist/lime-elements/{p-2116b3ce.entry.js.map → p-2356b938.entry.js.map} +0 -0
  255. /package/dist/lime-elements/{p-8c667a56.entry.js.map → p-25158b9e.entry.js.map} +0 -0
  256. /package/dist/lime-elements/{p-8e7d31b3.entry.js.map → p-263bac63.entry.js.map} +0 -0
  257. /package/dist/lime-elements/{p-18256ad9.entry.js.map → p-280cbd66.entry.js.map} +0 -0
  258. /package/dist/lime-elements/{p-3a36b862.entry.js.map → p-291cd743.entry.js.map} +0 -0
  259. /package/dist/lime-elements/{p-aa159bd8.entry.js.map → p-2a616374.entry.js.map} +0 -0
  260. /package/dist/lime-elements/{p-5f113a63.entry.js.map → p-312d104a.entry.js.map} +0 -0
  261. /package/dist/lime-elements/{p-52fb3988.entry.js.map → p-317f00ea.entry.js.map} +0 -0
  262. /package/dist/lime-elements/{p-c7ffe359.entry.js.map → p-32611964.entry.js.map} +0 -0
  263. /package/dist/lime-elements/{p-416f25fc.entry.js.map → p-333ba7ca.entry.js.map} +0 -0
  264. /package/dist/lime-elements/{p-b80a7353.entry.js.map → p-354c2d16.entry.js.map} +0 -0
  265. /package/dist/lime-elements/{p-d497cac7.entry.js.map → p-36ae8adf.entry.js.map} +0 -0
  266. /package/dist/lime-elements/{p-4ed15eb7.entry.js.map → p-3fcd15bd.entry.js.map} +0 -0
  267. /package/dist/lime-elements/{p-2ff2186f.entry.js.map → p-4d225689.entry.js.map} +0 -0
  268. /package/dist/lime-elements/{p-668e583c.entry.js.map → p-56c9bb65.entry.js.map} +0 -0
  269. /package/dist/lime-elements/{p-745417ee.entry.js.map → p-5ca68424.entry.js.map} +0 -0
  270. /package/dist/lime-elements/{p-4a9a6e16.entry.js.map → p-60a43c1d.entry.js.map} +0 -0
  271. /package/dist/lime-elements/{p-ac334aa7.entry.js.map → p-67b697b4.entry.js.map} +0 -0
  272. /package/dist/lime-elements/{p-b45cfa71.entry.js.map → p-6c5eea77.entry.js.map} +0 -0
  273. /package/dist/lime-elements/{p-5ac43dbd.entry.js.map → p-6ce5a93f.entry.js.map} +0 -0
  274. /package/dist/lime-elements/{p-d4a220eb.entry.js.map → p-6ddb0265.entry.js.map} +0 -0
  275. /package/dist/lime-elements/{p-0115bb1e.entry.js.map → p-6ef87216.entry.js.map} +0 -0
  276. /package/dist/lime-elements/{p-51d475d8.entry.js.map → p-6f3a34f1.entry.js.map} +0 -0
  277. /package/dist/lime-elements/{p-54fc2316.entry.js.map → p-718d5311.entry.js.map} +0 -0
  278. /package/dist/lime-elements/{p-e839ce5b.entry.js.map → p-72a79ebe.entry.js.map} +0 -0
  279. /package/dist/lime-elements/{p-0d247b83.entry.js.map → p-7b681f7c.entry.js.map} +0 -0
  280. /package/dist/lime-elements/{p-f8b6d7e1.entry.js.map → p-7d107fba.entry.js.map} +0 -0
  281. /package/dist/lime-elements/{p-47da9c59.entry.js.map → p-81de7836.entry.js.map} +0 -0
  282. /package/dist/lime-elements/{p-32572c31.entry.js.map → p-8535dc16.entry.js.map} +0 -0
  283. /package/dist/lime-elements/{p-706c2e84.entry.js.map → p-9697010e.entry.js.map} +0 -0
  284. /package/dist/lime-elements/{p-483ba5da.entry.js.map → p-9a64025b.entry.js.map} +0 -0
  285. /package/dist/lime-elements/{p-f1ec1eeb.entry.js.map → p-9c9876f9.entry.js.map} +0 -0
  286. /package/dist/lime-elements/{p-9b809f4d.entry.js.map → p-9e225545.entry.js.map} +0 -0
  287. /package/dist/lime-elements/{p-4ddb8b05.entry.js.map → p-a92369cb.entry.js.map} +0 -0
  288. /package/dist/lime-elements/{p-1e4ca584.entry.js.map → p-ae25ca92.entry.js.map} +0 -0
  289. /package/dist/lime-elements/{p-580a29c5.entry.js.map → p-b076958e.entry.js.map} +0 -0
  290. /package/dist/lime-elements/{p-20950d83.entry.js.map → p-b3f1f121.entry.js.map} +0 -0
  291. /package/dist/lime-elements/{p-07988749.entry.js.map → p-b89cb5a3.entry.js.map} +0 -0
  292. /package/dist/lime-elements/{p-6ef94d19.entry.js.map → p-b906e1c5.entry.js.map} +0 -0
  293. /package/dist/lime-elements/{p-b43e8cb2.entry.js.map → p-c445aed7.entry.js.map} +0 -0
  294. /package/dist/lime-elements/{p-489d7f63.entry.js.map → p-c64e86fd.entry.js.map} +0 -0
  295. /package/dist/lime-elements/{p-cbbe129b.entry.js.map → p-cb81be35.entry.js.map} +0 -0
  296. /package/dist/lime-elements/{p-9af45dec.entry.js.map → p-cd0010ba.entry.js.map} +0 -0
  297. /package/dist/lime-elements/{p-250acfe4.entry.js.map → p-ce0e6d28.entry.js.map} +0 -0
  298. /package/dist/lime-elements/{p-7528a002.entry.js.map → p-cecdb592.entry.js.map} +0 -0
  299. /package/dist/lime-elements/{p-2fdb51de.entry.js.map → p-dd0f3190.entry.js.map} +0 -0
  300. /package/dist/lime-elements/{p-10d1256b.entry.js.map → p-e1df39fc.entry.js.map} +0 -0
  301. /package/dist/lime-elements/{p-c823d32b.entry.js.map → p-e22edc40.entry.js.map} +0 -0
  302. /package/dist/lime-elements/{p-3a61deb1.entry.js.map → p-e4fd6591.entry.js.map} +0 -0
  303. /package/dist/lime-elements/{p-e739d600.entry.js.map → p-e8370ee5.entry.js.map} +0 -0
  304. /package/dist/lime-elements/{p-874f06f0.entry.js.map → p-ead08551.entry.js.map} +0 -0
  305. /package/dist/lime-elements/{p-ae507565.entry.js.map → p-ec03874d.entry.js.map} +0 -0
  306. /package/dist/lime-elements/{p-b5a96409.entry.js.map → p-f1c9089e.entry.js.map} +0 -0
  307. /package/dist/lime-elements/{p-c2f922ba.entry.js.map → p-f8cbb607.entry.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ import{r as t,c as i,h as e,H as s,g as r}from"./p-bdfa539c.js";import{a}from"./p-669626e5.js";import{h as o,c as h,a as l,d as n,b as u}from"./p-18973354.js";import{a as f}from"./p-50bd0336.js";import{a as c}from"./p-9acf7b5d.js";import{i as d}from"./p-c93050d6.js";import{g as b}from"./p-7f49c7da.js";import{n as p}from"./p-64122988.js";import{i as m}from"./p-6ebb1f7c.js";import{t as g}from"./p-df36e1ae.js";import"./p-2cdaeb7b.js";import"./p-eda23c05.js";import"./p-4c3358cb.js";import"./p-0b1af919.js";import"./p-858c6b82.js";import"./p-d529bb7d.js";import"./p-5467ea06.js";import"./p-5fdb83c9.js";import"./p-4f093090.js";var v=Object.prototype;var w=v.hasOwnProperty;function y(t,i){return t!=null&&w.call(t,i)}function x(t,i){return t!=null&&o(t,i,y)}function k(t,i,e,s){if(!d(t)){return t}i=h(i,t);var r=-1,a=i.length,o=a-1,n=t;while(n!=null&&++r<a){var u=l(i[r]),b=e;if(u==="__proto__"||u==="constructor"||u==="prototype"){return t}if(r!=o){var p=n[u];b=s?s(p,u,n):undefined;if(b===undefined){b=d(p)?p:c(i[r+1])?[]:{}}}f(n,u,b);n=n[u]}return t}function C(t,i,e){var s=-1,r=i.length,a={};while(++s<r){var o=i[s],l=n(t,o);if(e(l,o)){k(a,h(o,t),l)}}return a}function R(t,i){if(t==null){return{}}var e=a(b(t),(function(t){return[t]}));i=u(i);return C(t,e,(function(t,e){return i(t,e[0])}))}class E{constructor(t){this.table=t}reloadData(t,i,e){return this.table.dataLoader.load(t,undefined,undefined,undefined,i,e)}langText(){return this.table.modules.localize.getText(...arguments)}langBind(){return this.table.modules.localize.bind(...arguments)}langLocale(){return this.table.modules.localize.getLocale(...arguments)}commsConnections(){return this.table.modules.comms.getConnections(...arguments)}commsSend(){return this.table.modules.comms.send(...arguments)}layoutMode(){return this.table.modules.layout.getMode()}layoutRefresh(t){return this.table.modules.layout.layout(t)}subscribe(){return this.table.eventBus.subscribe(...arguments)}unsubscribe(){return this.table.eventBus.unsubscribe(...arguments)}subscribed(t){return this.table.eventBus.subscribed(t)}subscriptionChange(){return this.table.eventBus.subscriptionChange(...arguments)}dispatch(){return this.table.eventBus.dispatch(...arguments)}chain(){return this.table.eventBus.chain(...arguments)}confirm(){return this.table.eventBus.confirm(...arguments)}dispatchExternal(){return this.table.externalEvents.dispatch(...arguments)}subscribedExternal(t){return this.table.externalEvents.subscribed(t)}subscriptionChangeExternal(){return this.table.externalEvents.subscriptionChange(...arguments)}options(t){return this.table.options[t]}setOption(t,i){if(typeof i!=="undefined"){this.table.options[t]=i}return this.table.options[t]}deprecationCheck(t,i,e){return this.table.deprecationAdvisor.check(t,i,e)}deprecationCheckMsg(t,i){return this.table.deprecationAdvisor.checkMsg(t,i)}deprecationMsg(t){return this.table.deprecationAdvisor.msg(t)}module(t){return this.table.module(t)}}class z{static elVisible(t){return!(t.offsetWidth<=0&&t.offsetHeight<=0)}static elOffset(t){var i=t.getBoundingClientRect();return{top:i.top+window.pageYOffset-document.documentElement.clientTop,left:i.left+window.pageXOffset-document.documentElement.clientLeft}}static retrieveNestedData(t,i,e){var s=t?i.split(t):[i],r=s.length,a;for(let t=0;t<r;t++){e=e[s[t]];a=e;if(!e){break}}return a}static deepClone(t,i,e=[]){var s={}.__proto__,r=[].__proto__;if(!i){i=Object.assign(Array.isArray(t)?[]:{},t)}for(var a in t){let o=t[a],h,l;if(o!=null&&typeof o==="object"&&(o.__proto__===s||o.__proto__===r)){h=e.findIndex((t=>t.subject===o));if(h>-1){i[a]=e[h].copy}else{l=Object.assign(Array.isArray(o)?[]:{},o);e.unshift({subject:o,copy:l});i[a]=this.deepClone(o,l,e)}}}return i}}let M=class t extends E{constructor(t,i,e){super(t);this.element=i;this.container=this._lookupContainer();this.parent=e;this.reversedX=false;this.childPopup=null;this.blurable=false;this.blurCallback=null;this.blurEventsBound=false;this.renderedCallback=null;this.visible=false;this.hideable=true;this.element.classList.add("tabulator-popup-container");this.blurEvent=this.hide.bind(this,false);this.escEvent=this._escapeCheck.bind(this);this.destroyBinding=this.tableDestroyed.bind(this);this.destroyed=false}tableDestroyed(){this.destroyed=true;this.hide(true)}_lookupContainer(){var t=this.table.options.popupContainer;if(typeof t==="string"){t=document.querySelector(t);if(!t){console.warn("Menu Error - no container element found matching selector:",this.table.options.popupContainer,"(defaulting to document body)")}}else if(t===true){t=this.table.element}if(t&&!this._checkContainerIsParent(t)){t=false;console.warn("Menu Error - container element does not contain this table:",this.table.options.popupContainer,"(defaulting to document body)")}if(!t){t=document.body}return t}_checkContainerIsParent(t,i=this.table.element){if(t===i){return true}else{return i.parentNode?this._checkContainerIsParent(t,i.parentNode):false}}renderCallback(t){this.renderedCallback=t}containerEventCoords(t){var i=!(t instanceof MouseEvent);var e=i?t.touches[0].pageX:t.pageX;var s=i?t.touches[0].pageY:t.pageY;if(this.container!==document.body){let t=z.elOffset(this.container);e-=t.left;s-=t.top}return{x:e,y:s}}elementPositionCoords(t,i="right"){var e=z.elOffset(t),s,r,a;if(this.container!==document.body){s=z.elOffset(this.container);e.left-=s.left;e.top-=s.top}switch(i){case"right":r=e.left+t.offsetWidth;a=e.top-1;break;case"bottom":r=e.left;a=e.top+t.offsetHeight;break;case"left":r=e.left;a=e.top-1;break;case"top":r=e.left;a=e.top;break;case"center":r=e.left+t.offsetWidth/2;a=e.top+t.offsetHeight/2;break}return{x:r,y:a,offset:e}}show(t,i){var e,s,r,a,o;if(this.destroyed||this.table.destroyed){return this}if(t instanceof HTMLElement){r=t;o=this.elementPositionCoords(t,i);a=o.offset;e=o.x;s=o.y}else if(typeof t==="number"){a={top:0,left:0};e=t;s=i}else{o=this.containerEventCoords(t);e=o.x;s=o.y;this.reversedX=false}this.element.style.top=s+"px";this.element.style.left=e+"px";this.container.appendChild(this.element);if(typeof this.renderedCallback==="function"){this.renderedCallback()}this._fitToScreen(e,s,r,a,i);this.visible=true;this.subscribe("table-destroy",this.destroyBinding);this.element.addEventListener("mousedown",(t=>{t.stopPropagation()}));return this}_fitToScreen(t,i,e,s,r){var a=this.container===document.body?document.documentElement.scrollTop:this.container.scrollTop;if(t+this.element.offsetWidth>=this.container.offsetWidth||this.reversedX){this.element.style.left="";if(e){this.element.style.right=this.container.offsetWidth-s.left+"px"}else{this.element.style.right=this.container.offsetWidth-t+"px"}this.reversedX=true}let o=Math.max(this.container.offsetHeight,a?this.container.scrollHeight:0);if(i+this.element.offsetHeight>o){if(e){switch(r){case"bottom":this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight-e.offsetHeight-1+"px";break;default:this.element.style.top=parseInt(this.element.style.top)-this.element.offsetHeight+e.offsetHeight+1+"px"}}else{this.element.style.height=o+"px"}}}isVisible(){return this.visible}hideOnBlur(t){this.blurable=true;if(this.visible){setTimeout((()=>{if(this.visible){this.table.rowManager.element.addEventListener("scroll",this.blurEvent);this.subscribe("cell-editing",this.blurEvent);document.body.addEventListener("click",this.blurEvent);document.body.addEventListener("contextmenu",this.blurEvent);document.body.addEventListener("mousedown",this.blurEvent);window.addEventListener("resize",this.blurEvent);document.body.addEventListener("keydown",this.escEvent);this.blurEventsBound=true}}),100);this.blurCallback=t}return this}_escapeCheck(t){if(t.keyCode==27){this.hide()}}blockHide(){this.hideable=false}restoreHide(){this.hideable=true}hide(t=false){if(this.visible&&this.hideable){if(this.blurable&&this.blurEventsBound){document.body.removeEventListener("keydown",this.escEvent);document.body.removeEventListener("click",this.blurEvent);document.body.removeEventListener("contextmenu",this.blurEvent);document.body.removeEventListener("mousedown",this.blurEvent);window.removeEventListener("resize",this.blurEvent);this.table.rowManager.element.removeEventListener("scroll",this.blurEvent);this.unsubscribe("cell-editing",this.blurEvent);this.blurEventsBound=false}if(this.childPopup){this.childPopup.hide()}if(this.parent){this.parent.childPopup=null}if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.visible=false;if(this.blurCallback&&!t){this.blurCallback()}this.unsubscribe("table-destroy",this.destroyBinding)}return this}child(i){if(this.childPopup){this.childPopup.hide()}this.childPopup=new t(this.table,i,this);return this.childPopup}};class S extends E{constructor(t,i){super(t);this._handler=null}initialize(){}registerTableOption(t,i){this.table.optionsList.register(t,i)}registerColumnOption(t,i){this.table.columnManager.optionsList.register(t,i)}registerTableFunction(t,i){if(typeof this.table[t]==="undefined"){this.table[t]=(...e)=>{this.table.initGuard(t);return i(...e)}}else{console.warn("Unable to bind table function, name already in use",t)}}registerComponentFunction(t,i,e){return this.table.componentFunctionBinder.bind(t,i,e)}registerDataHandler(t,i){this.table.rowManager.registerDataPipelineHandler(t,i);this._handler=t}registerDisplayHandler(t,i){this.table.rowManager.registerDisplayPipelineHandler(t,i);this._handler=t}displayRows(t){var i=this.table.rowManager.displayRows.length-1,e;if(this._handler){e=this.table.rowManager.displayPipeline.findIndex((t=>t.handler===this._handler));if(e>-1){i=e}}if(t){i=i+t}if(this._handler){if(i>-1){return this.table.rowManager.getDisplayRows(i)}else{return this.activeRows()}}}activeRows(){return this.table.rowManager.activeRows}refreshData(t,i){if(!i){i=this._handler}if(i){this.table.rowManager.refreshActiveData(i,false,t)}}footerAppend(t){return this.table.footerManager.append(t)}footerPrepend(t){return this.table.footerManager.prepend(t)}footerRemove(t){return this.table.footerManager.remove(t)}popup(t,i){return new M(this.table,t,i)}alert(t,i){return this.table.alertManager.alert(t,i)}clearAlert(){return this.table.alertManager.clear()}}var T={rownum:function(t,i,e,s,r,a){return a.getPosition()}};class D extends S{static moduleName="accessor";static accessors=T;constructor(t){super(t);this.allowedTypes=["","data","download","clipboard","print","htmlOutput"];this.registerColumnOption("accessor");this.registerColumnOption("accessorParams");this.registerColumnOption("accessorData");this.registerColumnOption("accessorDataParams");this.registerColumnOption("accessorDownload");this.registerColumnOption("accessorDownloadParams");this.registerColumnOption("accessorClipboard");this.registerColumnOption("accessorClipboardParams");this.registerColumnOption("accessorPrint");this.registerColumnOption("accessorPrintParams");this.registerColumnOption("accessorHtmlOutput");this.registerColumnOption("accessorHtmlOutputParams")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this));this.subscribe("row-data-retrieve",this.transformRow.bind(this))}initializeColumn(t){var i=false,e={};this.allowedTypes.forEach((s=>{var r="accessor"+(s.charAt(0).toUpperCase()+s.slice(1)),a;if(t.definition[r]){a=this.lookupAccessor(t.definition[r]);if(a){i=true;e[r]={accessor:a,params:t.definition[r+"Params"]||{}}}}}));if(i){t.modules.accessor=e}}lookupAccessor(t){var i=false;switch(typeof t){case"string":if(D.accessors[t]){i=D.accessors[t]}else{console.warn("Accessor Error - No such accessor found, ignoring: ",t)}break;case"function":i=t;break}return i}transformRow(t,i){var e="accessor"+(i.charAt(0).toUpperCase()+i.slice(1)),s=t.getComponent();var r=z.deepClone(t.data||{});this.table.columnManager.traverse((function(t){var a,o,h,l;if(t.modules.accessor){o=t.modules.accessor[e]||t.modules.accessor.accessor||false;if(o){a=t.getFieldValue(r);if(a!="undefined"){l=t.getComponent();h=typeof o.params==="function"?o.params(a,r,i,l,s):o.params;t.setFieldValue(r,o.accessor(a,r,i,h,l,s))}}}}));return r}}var P={method:"GET"};function F(t,i){var e=[];i=i||"";if(Array.isArray(t)){t.forEach(((t,s)=>{e=e.concat(F(t,i?i+"["+s+"]":s))}))}else if(typeof t==="object"){for(var s in t){e=e.concat(F(t[s],i?i+"["+s+"]":s))}}else{e.push({key:i,value:t})}return e}function j(t){var i=F(t),e=[];i.forEach((function(t){e.push(encodeURIComponent(t.key)+"="+encodeURIComponent(t.value))}));return e.join("&")}function N(t,i,e){if(t){if(e&&Object.keys(e).length){if(!i.method||i.method.toLowerCase()=="get"){i.method="get";t+=(t.includes("?")?"&":"?")+j(e)}}}return t}function O(t,i,e){var s;return new Promise(((r,a)=>{t=this.urlGenerator.call(this.table,t,i,e);if(i.method.toUpperCase()!="GET"){s=typeof this.table.options.ajaxContentType==="object"?this.table.options.ajaxContentType:this.contentTypeFormatters[this.table.options.ajaxContentType];if(s){for(var o in s.headers){if(!i.headers){i.headers={}}if(typeof i.headers[o]==="undefined"){i.headers[o]=s.headers[o]}}i.body=s.body.call(this,t,i,e)}else{console.warn("Ajax Error - Invalid ajaxContentType value:",this.table.options.ajaxContentType)}}if(t){if(typeof i.headers==="undefined"){i.headers={}}if(typeof i.headers.Accept==="undefined"){i.headers.Accept="application/json"}if(typeof i.headers["X-Requested-With"]==="undefined"){i.headers["X-Requested-With"]="XMLHttpRequest"}if(typeof i.mode==="undefined"){i.mode="cors"}if(i.mode=="cors"){if(typeof i.headers["Origin"]==="undefined"){i.headers["Origin"]=window.location.origin}if(typeof i.credentials==="undefined"){i.credentials="same-origin"}}else{if(typeof i.credentials==="undefined"){i.credentials="include"}}fetch(t,i).then((t=>{if(t.ok){t.json().then((t=>{r(t)})).catch((t=>{a(t);console.warn("Ajax Load Error - Invalid JSON returned",t)}))}else{console.error("Ajax Load Error - Connection Error: "+t.status,t.statusText);a(t)}})).catch((t=>{console.error("Ajax Load Error - Connection Error: ",t);a(t)}))}else{console.warn("Ajax Load Error - No URL Set");r([])}}))}function H(t,i){var e=[];i=i||"";if(Array.isArray(t)){t.forEach(((t,s)=>{e=e.concat(H(t,i?i+"["+s+"]":s))}))}else if(typeof t==="object"){for(var s in t){e=e.concat(H(t[s],i?i+"["+s+"]":s))}}else{e.push({key:i,value:t})}return e}var _={json:{headers:{"Content-Type":"application/json"},body:function(t,i,e){return JSON.stringify(e)}},form:{headers:{},body:function(t,i,e){var s=H(e),r=new FormData;s.forEach((function(t){r.append(t.key,t.value)}));return r}}};class L extends S{static moduleName="ajax";static defaultConfig=P;static defaultURLGenerator=N;static defaultLoaderPromise=O;static contentTypeFormatters=_;constructor(t){super(t);this.config={};this.url="";this.urlGenerator=false;this.params=false;this.loaderPromise=false;this.registerTableOption("ajaxURL",false);this.registerTableOption("ajaxURLGenerator",false);this.registerTableOption("ajaxParams",{});this.registerTableOption("ajaxConfig","get");this.registerTableOption("ajaxContentType","form");this.registerTableOption("ajaxRequestFunc",false);this.registerTableOption("ajaxRequesting",(function(){}));this.registerTableOption("ajaxResponse",false);this.contentTypeFormatters=L.contentTypeFormatters}initialize(){this.loaderPromise=this.table.options.ajaxRequestFunc||L.defaultLoaderPromise;this.urlGenerator=this.table.options.ajaxURLGenerator||L.defaultURLGenerator;if(this.table.options.ajaxURL){this.setUrl(this.table.options.ajaxURL)}this.setDefaultConfig(this.table.options.ajaxConfig);this.registerTableFunction("getAjaxUrl",this.getUrl.bind(this));this.subscribe("data-loading",this.requestDataCheck.bind(this));this.subscribe("data-params",this.requestParams.bind(this));this.subscribe("data-load",this.requestData.bind(this))}requestParams(t,i,e,s){var r=this.table.options.ajaxParams;if(r){if(typeof r==="function"){r=r.call(this.table)}s=Object.assign(Object.assign({},r),s)}return s}requestDataCheck(t,i,e,s){return!!(!t&&this.url||typeof t==="string")}requestData(t,i,e,s,r){var a;if(!r&&this.requestDataCheck(t)){if(t){this.setUrl(t)}a=this.generateConfig(e);return this.sendRequest(this.url,i,a)}else{return r}}setDefaultConfig(t={}){this.config=Object.assign({},L.defaultConfig);if(typeof t=="string"){this.config.method=t}else{Object.assign(this.config,t)}}generateConfig(t={}){var i=Object.assign({},this.config);if(typeof t=="string"){i.method=t}else{Object.assign(i,t)}return i}setUrl(t){this.url=t}getUrl(){return this.url}sendRequest(t,i,e){if(this.table.options.ajaxRequesting.call(this.table,t,i)!==false){return this.loaderPromise(t,e,i).then((e=>{if(this.table.options.ajaxResponse){e=this.table.options.ajaxResponse.call(this.table,t,i,e)}return e}))}else{return Promise.reject()}}}var A={replace:function(t){return this.table.setData(t)},update:function(t){return this.table.updateOrAddData(t)},insert:function(t){return this.table.addData(t)}};var I={table:function(t){var i=[],e=true,s=this.table.columnManager.columns,r=[],a=[];t=t.split("\n");t.forEach((function(t){i.push(t.split("\t"))}));if(i.length&&!(i.length===1&&i[0].length<2)){i[0].forEach((function(t){var i=s.find((function(i){return t&&i.definition.title&&t.trim()&&i.definition.title.trim()===t.trim()}));if(i){r.push(i)}else{e=false}}));if(!e){e=true;r=[];i[0].forEach((function(t){var i=s.find((function(i){return t&&i.field&&t.trim()&&i.field.trim()===t.trim()}));if(i){r.push(i)}else{e=false}}));if(!e){r=this.table.columnManager.columnsByIndex}}if(e){i.shift()}i.forEach((function(t){var i={};t.forEach((function(t,e){if(r[e]){i[r[e].field]=t}}));a.push(i)}));return a}else{return false}}};var V={copyToClipboard:["ctrl + 67","meta + 67"]};var U={copyToClipboard:function(t){if(!this.table.modules.edit.currentCell){if(this.table.modExists("clipboard",true)){this.table.modules.clipboard.copy(false,true)}}}};var B={keybindings:{bindings:V,actions:U}};class G extends S{static moduleName="clipboard";static moduleExtensions=B;static pasteActions=A;static pasteParsers=I;constructor(t){super(t);this.mode=true;this.pasteParser=function(){};this.pasteAction=function(){};this.customSelection=false;this.rowRange=false;this.blocked=true;this.registerTableOption("clipboard",false);this.registerTableOption("clipboardCopyStyled",true);this.registerTableOption("clipboardCopyConfig",false);this.registerTableOption("clipboardCopyFormatter",false);this.registerTableOption("clipboardCopyRowRange","active");this.registerTableOption("clipboardPasteParser","table");this.registerTableOption("clipboardPasteAction","insert");this.registerColumnOption("clipboard");this.registerColumnOption("titleClipboard")}initialize(){this.mode=this.table.options.clipboard;this.rowRange=this.table.options.clipboardCopyRowRange;if(this.mode===true||this.mode==="copy"){this.table.element.addEventListener("copy",(t=>{var i,e,s;if(!this.blocked){t.preventDefault();if(this.customSelection){i=this.customSelection;if(this.table.options.clipboardCopyFormatter){i=this.table.options.clipboardCopyFormatter("plain",i)}}else{s=this.table.modules.export.generateExportList(this.table.options.clipboardCopyConfig,this.table.options.clipboardCopyStyled,this.rowRange,"clipboard");e=this.table.modules.export.generateHTMLTable(s);i=e?this.generatePlainContent(s):"";if(this.table.options.clipboardCopyFormatter){i=this.table.options.clipboardCopyFormatter("plain",i);e=this.table.options.clipboardCopyFormatter("html",e)}}if(window.clipboardData&&window.clipboardData.setData){window.clipboardData.setData("Text",i)}else if(t.clipboardData&&t.clipboardData.setData){t.clipboardData.setData("text/plain",i);if(e){t.clipboardData.setData("text/html",e)}}else if(t.originalEvent&&t.originalEvent.clipboardData.setData){t.originalEvent.clipboardData.setData("text/plain",i);if(e){t.originalEvent.clipboardData.setData("text/html",e)}}this.dispatchExternal("clipboardCopied",i,e);this.reset()}}))}if(this.mode===true||this.mode==="paste"){this.table.element.addEventListener("paste",(t=>{this.paste(t)}))}this.setPasteParser(this.table.options.clipboardPasteParser);this.setPasteAction(this.table.options.clipboardPasteAction);this.registerTableFunction("copyToClipboard",this.copy.bind(this))}reset(){this.blocked=true;this.customSelection=false}generatePlainContent(t){var i=[];t.forEach((t=>{var e=[];t.columns.forEach((i=>{var s="";if(i){if(t.type==="group"){i.value=i.component.getKey()}if(i.value===null){s=""}else{switch(typeof i.value){case"object":s=JSON.stringify(i.value);break;case"undefined":s="";break;default:s=i.value}}}e.push(s)}));i.push(e.join("\t"))}));return i.join("\n")}copy(t,i){var e,s;this.blocked=false;this.customSelection=false;if(this.mode===true||this.mode==="copy"){this.rowRange=t||this.table.options.clipboardCopyRowRange;if(typeof window.getSelection!="undefined"&&typeof document.createRange!="undefined"){t=document.createRange();t.selectNodeContents(this.table.element);e=window.getSelection();if(e.toString()&&i){this.customSelection=e.toString()}e.removeAllRanges();e.addRange(t)}else if(typeof document.selection!="undefined"&&typeof document.body.createTextRange!="undefined"){s=document.body.createTextRange();s.moveToElementText(this.table.element);s.select()}document.execCommand("copy");if(e){e.removeAllRanges()}}}setPasteAction(t){switch(typeof t){case"string":this.pasteAction=G.pasteActions[t];if(!this.pasteAction){console.warn("Clipboard Error - No such paste action found:",t)}break;case"function":this.pasteAction=t;break}}setPasteParser(t){switch(typeof t){case"string":this.pasteParser=G.pasteParsers[t];if(!this.pasteParser){console.warn("Clipboard Error - No such paste parser found:",t)}break;case"function":this.pasteParser=t;break}}paste(t){var i,e,s;if(this.checkPasteOrigin(t)){i=this.getPasteData(t);e=this.pasteParser.call(this,i);if(e){t.preventDefault();if(this.table.modExists("mutator")){e=this.mutateData(e)}s=this.pasteAction.call(this,e);this.dispatchExternal("clipboardPasted",i,e,s)}else{this.dispatchExternal("clipboardPasteError",i)}}}mutateData(t){var i=[];if(Array.isArray(t)){t.forEach((t=>{i.push(this.table.modules.mutator.transformRow(t,"clipboard"))}))}else{i=t}return i}checkPasteOrigin(t){var i=true;var e=this.confirm("clipboard-paste",[t]);if(e||!["DIV","SPAN"].includes(t.target.tagName)){i=false}return i}getPasteData(t){var i;if(window.clipboardData&&window.clipboardData.getData){i=window.clipboardData.getData("Text")}else if(t.clipboardData&&t.clipboardData.getData){i=t.clipboardData.getData("text/plain")}else if(t.originalEvent&&t.originalEvent.clipboardData.getData){i=t.originalEvent.clipboardData.getData("text/plain")}return i}}class W{constructor(t){this._row=t;return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._row.table.componentFunctionBinder.handle("row",t._row,i)}}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getTable(){return this._row.table}getCells(){var t=[];this._row.getCells().forEach((function(i){t.push(i.getComponent())}));return t}getCell(t){var i=this._row.getCell(t);return i?i.getComponent():false}_getSelf(){return this._row}}class J{constructor(t){this._cell=t;return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._cell.table.componentFunctionBinder.handle("cell",t._cell,i)}}})}getValue(){return this._cell.getValue()}getOldValue(){return this._cell.getOldValue()}getInitialValue(){return this._cell.initialValue}getElement(){return this._cell.getElement()}getRow(){return this._cell.row.getComponent()}getData(t){return this._cell.row.getData(t)}getType(){return"cell"}getField(){return this._cell.column.getField()}getColumn(){return this._cell.column.getComponent()}setValue(t,i){if(typeof i=="undefined"){i=true}this._cell.setValue(t,i)}restoreOldValue(){this._cell.setValueActual(this._cell.getOldValue())}restoreInitialValue(){this._cell.setValueActual(this._cell.initialValue)}checkHeight(){this._cell.checkHeight()}getTable(){return this._cell.table}_getSelf(){return this._cell}}class q extends E{constructor(t,i){super(t.table);this.table=t.table;this.column=t;this.row=i;this.element=null;this.value=null;this.oldValue=null;this.modules={};this.height=null;this.width=null;this.minWidth=null;this.component=null;this.loaded=false;this.build()}build(){this.generateElement();this.setWidth();this._configureCell();this.setValueActual(this.column.getFieldValue(this.row.data));this.initialValue=this.value}generateElement(){this.element=document.createElement("div");this.element.className="tabulator-cell";this.element.setAttribute("role","gridcell");if(this.column.isRowHeader){this.element.classList.add("tabulator-row-header")}}_configureCell(){var t=this.element,i=this.column.getField(),e={top:"flex-start",bottom:"flex-end",middle:"center"},s={left:"flex-start",right:"flex-end",center:"center"};t.style.textAlign=this.column.hozAlign;if(this.column.vertAlign){t.style.display="inline-flex";t.style.alignItems=e[this.column.vertAlign]||"";if(this.column.hozAlign){t.style.justifyContent=s[this.column.hozAlign]||""}}if(i){t.setAttribute("tabulator-field",i)}if(this.column.definition.cssClass){var r=this.column.definition.cssClass.split(" ");r.forEach((i=>{t.classList.add(i)}))}this.dispatch("cell-init",this);if(!this.column.visible){this.hide()}}_generateContents(){var t;t=this.chain("cell-format",this,null,(()=>this.element.innerHTML=this.value));switch(typeof t){case"object":if(t instanceof Node){while(this.element.firstChild)this.element.removeChild(this.element.firstChild);this.element.appendChild(t)}else{this.element.innerHTML="";if(t!=null){console.warn("Format Error - Formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",t)}}break;case"undefined":this.element.innerHTML="";break;default:this.element.innerHTML=t}}cellRendered(){this.dispatch("cell-rendered",this)}getElement(t){if(!this.loaded){this.loaded=true;if(!t){this.layoutElement()}}return this.element}getValue(){return this.value}getOldValue(){return this.oldValue}setValue(t,i,e){var s=this.setValueProcessData(t,i,e);if(s){this.dispatch("cell-value-updated",this);this.cellRendered();if(this.column.definition.cellEdited){this.column.definition.cellEdited.call(this.table,this.getComponent())}this.dispatchExternal("cellEdited",this.getComponent());if(this.subscribedExternal("dataChanged")){this.dispatchExternal("dataChanged",this.table.rowManager.getData())}}}setValueProcessData(t,i,e){var s=false;if(this.value!==t||e){s=true;if(i){t=this.chain("cell-value-changing",[this,t],null,t)}}this.setValueActual(t);if(s){this.dispatch("cell-value-changed",this)}return s}setValueActual(t){this.oldValue=this.value;this.value=t;this.dispatch("cell-value-save-before",this);this.column.setFieldValue(this.row.data,t);this.dispatch("cell-value-save-after",this);if(this.loaded){this.layoutElement()}}layoutElement(){this._generateContents();this.dispatch("cell-layout",this)}setWidth(){this.width=this.column.width;this.element.style.width=this.column.widthStyled}clearWidth(){this.width="";this.element.style.width=""}getWidth(){return this.width||this.element.offsetWidth}setMinWidth(){this.minWidth=this.column.minWidth;this.element.style.minWidth=this.column.minWidthStyled}setMaxWidth(){this.maxWidth=this.column.maxWidth;this.element.style.maxWidth=this.column.maxWidthStyled}checkHeight(){this.row.reinitializeHeight()}clearHeight(){this.element.style.height="";this.height=null;this.dispatch("cell-height",this,"")}setHeight(){this.height=this.row.height;this.element.style.height=this.row.heightStyled;this.dispatch("cell-height",this,this.row.heightStyled)}getHeight(){return this.height||this.element.offsetHeight}show(){this.element.style.display=this.column.vertAlign?"inline-flex":""}hide(){this.element.style.display="none"}delete(){this.dispatch("cell-delete",this);if(!this.table.rowManager.redrawBlock&&this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.element=false;this.column.deleteCell(this);this.row.deleteCell(this);this.calcs={}}getIndex(){return this.row.getCellIndex(this)}getComponent(){if(!this.component){this.component=new J(this)}return this.component}}class K{constructor(t){this._column=t;this.type="ColumnComponent";return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._column.table.componentFunctionBinder.handle("column",t._column,i)}}})}getElement(){return this._column.getElement()}getDefinition(){return this._column.getDefinition()}getField(){return this._column.getField()}getTitleDownload(){return this._column.getTitleDownload()}getCells(){var t=[];this._column.cells.forEach((function(i){t.push(i.getComponent())}));return t}isVisible(){return this._column.visible}show(){if(this._column.isGroup){this._column.columns.forEach((function(t){t.show()}))}else{this._column.show()}}hide(){if(this._column.isGroup){this._column.columns.forEach((function(t){t.hide()}))}else{this._column.hide()}}toggle(){if(this._column.visible){this.hide()}else{this.show()}}delete(){return this._column.delete()}getSubColumns(){var t=[];if(this._column.columns.length){this._column.columns.forEach((function(i){t.push(i.getComponent())}))}return t}getParentColumn(){return this._column.getParentComponent()}_getSelf(){return this._column}scrollTo(t,i){return this._column.table.columnManager.scrollToColumn(this._column,t,i)}getTable(){return this._column.table}move(t,i){var e=this._column.table.columnManager.findColumn(t);if(e){this._column.table.columnManager.moveColumn(this._column,e,i)}else{console.warn("Move Error - No matching column found:",e)}}getNextColumn(){var t=this._column.nextColumn();return t?t.getComponent():false}getPrevColumn(){var t=this._column.prevColumn();return t?t.getComponent():false}updateDefinition(t){return this._column.updateDefinition(t)}getWidth(){return this._column.getWidth()}setWidth(t){var i;if(t===true){i=this._column.reinitializeWidth(true)}else{i=this._column.setWidth(t)}this._column.table.columnManager.rerenderColumns(true);return i}}var Z={title:undefined,field:undefined,columns:undefined,visible:undefined,hozAlign:undefined,vertAlign:undefined,width:undefined,minWidth:40,maxWidth:undefined,maxInitialWidth:undefined,cssClass:undefined,variableHeight:undefined,headerVertical:undefined,headerHozAlign:undefined,headerWordWrap:false,editableTitle:undefined};class $ extends E{static defaultOptionList=Z;constructor(t,i,e){super(i.table);this.definition=t;this.parent=i;this.type="column";this.columns=[];this.cells=[];this.isGroup=false;this.isRowHeader=e;this.element=this.createElement();this.contentElement=false;this.titleHolderElement=false;this.titleElement=false;this.groupElement=this.createGroupElement();this.hozAlign="";this.vertAlign="";this.field="";this.fieldStructure="";this.getFieldValue="";this.setFieldValue="";this.titleDownload=null;this.titleFormatterRendered=false;this.mapDefinitions();this.setField(this.definition.field);this.modules={};this.width=null;this.widthStyled="";this.maxWidth=null;this.maxWidthStyled="";this.maxInitialWidth=null;this.minWidth=null;this.minWidthStyled="";this.widthFixed=false;this.visible=true;this.component=null;if(this.definition.columns){this.isGroup=true;this.definition.columns.forEach(((t,i)=>{var e=new $(t,this);this.attachColumn(e)}));this.checkColumnVisibility()}else{i.registerColumnField(this)}this._initialize()}createElement(){var t=document.createElement("div");t.classList.add("tabulator-col");t.setAttribute("role","columnheader");t.setAttribute("aria-sort","none");if(this.isRowHeader){t.classList.add("tabulator-row-header")}switch(this.table.options.columnHeaderVertAlign){case"middle":t.style.justifyContent="center";break;case"bottom":t.style.justifyContent="flex-end";break}return t}createGroupElement(){var t=document.createElement("div");t.classList.add("tabulator-col-group-cols");return t}mapDefinitions(){var t=this.table.options.columnDefaults;if(t){for(let i in t){if(typeof this.definition[i]==="undefined"){this.definition[i]=t[i]}}}this.definition=this.table.columnManager.optionsList.generate($.defaultOptionList,this.definition)}checkDefinition(){Object.keys(this.definition).forEach((t=>{if($.defaultOptionList.indexOf(t)===-1){console.warn("Invalid column definition option in '"+(this.field||this.definition.title)+"' column:",t)}}))}setField(t){this.field=t;this.fieldStructure=t?this.table.options.nestedFieldSeparator?t.split(this.table.options.nestedFieldSeparator):[t]:[];this.getFieldValue=this.fieldStructure.length>1?this._getNestedData:this._getFlatData;this.setFieldValue=this.fieldStructure.length>1?this._setNestedData:this._setFlatData}registerColumnPosition(t){this.parent.registerColumnPosition(t)}registerColumnField(t){this.parent.registerColumnField(t)}reRegisterPosition(){if(this.isGroup){this.columns.forEach((function(t){t.reRegisterPosition()}))}else{this.registerColumnPosition(this)}}_initialize(){var t=this.definition;while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(t.headerVertical){this.element.classList.add("tabulator-col-vertical");if(t.headerVertical==="flip"){this.element.classList.add("tabulator-col-vertical-flip")}}this.contentElement=this._buildColumnHeaderContent();this.element.appendChild(this.contentElement);if(this.isGroup){this._buildGroupHeader()}else{this._buildColumnHeader()}this.dispatch("column-init",this)}_buildColumnHeader(){var t=this.definition;this.dispatch("column-layout",this);if(typeof t.visible!="undefined"){if(t.visible){this.show(true)}else{this.hide(true)}}if(t.cssClass){var i=t.cssClass.split(" ");i.forEach((t=>{this.element.classList.add(t)}))}if(t.field){this.element.setAttribute("tabulator-field",t.field)}this.setMinWidth(parseInt(t.minWidth));if(t.maxInitialWidth){this.maxInitialWidth=parseInt(t.maxInitialWidth)}if(t.maxWidth){this.setMaxWidth(parseInt(t.maxWidth))}this.reinitializeWidth();this.hozAlign=this.definition.hozAlign;this.vertAlign=this.definition.vertAlign;this.titleElement.style.textAlign=this.definition.headerHozAlign}_buildColumnHeaderContent(){var t=document.createElement("div");t.classList.add("tabulator-col-content");this.titleHolderElement=document.createElement("div");this.titleHolderElement.classList.add("tabulator-col-title-holder");t.appendChild(this.titleHolderElement);this.titleElement=this._buildColumnHeaderTitle();this.titleHolderElement.appendChild(this.titleElement);return t}_buildColumnHeaderTitle(){var t=this.definition;var i=document.createElement("div");i.classList.add("tabulator-col-title");if(t.headerWordWrap){i.classList.add("tabulator-col-title-wrap")}if(t.editableTitle){var e=document.createElement("input");e.classList.add("tabulator-title-editor");e.addEventListener("click",(t=>{t.stopPropagation();e.focus()}));e.addEventListener("mousedown",(t=>{t.stopPropagation()}));e.addEventListener("change",(()=>{t.title=e.value;this.dispatchExternal("columnTitleChanged",this.getComponent())}));i.appendChild(e);if(t.field){this.langBind("columns|"+t.field,(i=>{e.value=i||(t.title||"&nbsp;")}))}else{e.value=t.title||"&nbsp;"}}else{if(t.field){this.langBind("columns|"+t.field,(e=>{this._formatColumnHeaderTitle(i,e||(t.title||"&nbsp;"))}))}else{this._formatColumnHeaderTitle(i,t.title||"&nbsp;")}}return i}_formatColumnHeaderTitle(t,i){var e=this.chain("column-format",[this,i,t],null,(()=>i));switch(typeof e){case"object":if(e instanceof Node){t.appendChild(e)}else{t.innerHTML="";console.warn("Format Error - Title formatter has returned a type of object, the only valid formatter object return is an instance of Node, the formatter returned:",e)}break;case"undefined":t.innerHTML="";break;default:t.innerHTML=e}}_buildGroupHeader(){this.element.classList.add("tabulator-col-group");this.element.setAttribute("role","columngroup");this.element.setAttribute("aria-title",this.definition.title);if(this.definition.cssClass){var t=this.definition.cssClass.split(" ");t.forEach((t=>{this.element.classList.add(t)}))}this.titleElement.style.textAlign=this.definition.headerHozAlign;this.element.appendChild(this.groupElement)}_getFlatData(t){return t[this.field]}_getNestedData(t){var i=t,e=this.fieldStructure,s=e.length,r;for(let t=0;t<s;t++){i=i[e[t]];r=i;if(!i){break}}return r}_setFlatData(t,i){if(this.field){t[this.field]=i}}_setNestedData(t,i){var e=t,s=this.fieldStructure,r=s.length;for(let t=0;t<r;t++){if(t==r-1){e[s[t]]=i}else{if(!e[s[t]]){if(typeof i!=="undefined"){e[s[t]]={}}else{break}}e=e[s[t]]}}}attachColumn(t){if(this.groupElement){this.columns.push(t);this.groupElement.appendChild(t.getElement());t.columnRendered()}else{console.warn("Column Warning - Column being attached to another column instead of column group")}}verticalAlign(t,i){var e=this.parent.isGroup?this.parent.getGroupElement().clientHeight:i||this.parent.getHeadersElement().clientHeight;this.element.style.height=e+"px";this.dispatch("column-height",this,this.element.style.height);if(this.isGroup){this.groupElement.style.minHeight=e-this.contentElement.offsetHeight+"px"}this.columns.forEach((function(i){i.verticalAlign(t)}))}clearVerticalAlign(){this.element.style.paddingTop="";this.element.style.height="";this.element.style.minHeight="";this.groupElement.style.minHeight="";this.columns.forEach((function(t){t.clearVerticalAlign()}));this.dispatch("column-height",this,"")}getElement(){return this.element}getGroupElement(){return this.groupElement}getField(){return this.field}getTitleDownload(){return this.titleDownload}getFirstColumn(){if(!this.isGroup){return this}else{if(this.columns.length){return this.columns[0].getFirstColumn()}else{return false}}}getLastColumn(){if(!this.isGroup){return this}else{if(this.columns.length){return this.columns[this.columns.length-1].getLastColumn()}else{return false}}}getColumns(t){var i=[];if(t){this.columns.forEach((t=>{i.push(t);i=i.concat(t.getColumns(true))}))}else{i=this.columns}return i}getCells(){return this.cells}getTopColumn(){if(this.parent.isGroup){return this.parent.getTopColumn()}else{return this}}getDefinition(t){var i=[];if(this.isGroup&&t){this.columns.forEach((function(t){i.push(t.getDefinition(true))}));this.definition.columns=i}return this.definition}checkColumnVisibility(){var t=false;this.columns.forEach((function(i){if(i.visible){t=true}}));if(t){this.show();this.dispatchExternal("columnVisibilityChanged",this.getComponent(),false)}else{this.hide()}}show(t,i){if(!this.visible){this.visible=true;this.element.style.display="";if(this.parent.isGroup){this.parent.checkColumnVisibility()}this.cells.forEach((function(t){t.show()}));if(!this.isGroup&&this.width===null){this.reinitializeWidth()}this.table.columnManager.verticalAlignHeaders();this.dispatch("column-show",this,i);if(!t){this.dispatchExternal("columnVisibilityChanged",this.getComponent(),true)}if(this.parent.isGroup){this.parent.matchChildWidths()}if(!this.silent){this.table.columnManager.rerenderColumns()}}}hide(t,i){if(this.visible){this.visible=false;this.element.style.display="none";this.table.columnManager.verticalAlignHeaders();if(this.parent.isGroup){this.parent.checkColumnVisibility()}this.cells.forEach((function(t){t.hide()}));this.dispatch("column-hide",this,i);if(!t){this.dispatchExternal("columnVisibilityChanged",this.getComponent(),false)}if(this.parent.isGroup){this.parent.matchChildWidths()}if(!this.silent){this.table.columnManager.rerenderColumns()}}}matchChildWidths(){var t=0;if(this.contentElement&&this.columns.length){this.columns.forEach((function(i){if(i.visible){t+=i.getWidth()}}));this.contentElement.style.maxWidth=t-1+"px";if(this.table.initialized){this.element.style.width=t+"px"}if(this.parent.isGroup){this.parent.matchChildWidths()}}}removeChild(t){var i=this.columns.indexOf(t);if(i>-1){this.columns.splice(i,1)}if(!this.columns.length){this.delete()}}setWidth(t){this.widthFixed=true;this.setWidthActual(t)}setWidthActual(t){if(isNaN(t)){t=Math.floor(this.table.element.clientWidth/100*parseInt(t))}t=Math.max(this.minWidth,t);if(this.maxWidth){t=Math.min(this.maxWidth,t)}this.width=t;this.widthStyled=t?t+"px":"";this.element.style.width=this.widthStyled;if(!this.isGroup){this.cells.forEach((function(t){t.setWidth()}))}if(this.parent.isGroup){this.parent.matchChildWidths()}this.dispatch("column-width",this);if(this.subscribedExternal("columnWidth")){this.dispatchExternal("columnWidth",this.getComponent())}}checkCellHeights(){var t=[];this.cells.forEach((function(i){if(i.row.heightInitialized){if(i.row.getElement().offsetParent!==null){t.push(i.row);i.row.clearCellHeight()}else{i.row.heightInitialized=false}}}));t.forEach((function(t){t.calcHeight()}));t.forEach((function(t){t.setCellHeight()}))}getWidth(){var t=0;if(this.isGroup){this.columns.forEach((function(i){if(i.visible){t+=i.getWidth()}}))}else{t=this.width}return t}getLeftOffset(){var t=this.element.offsetLeft;if(this.parent.isGroup){t+=this.parent.getLeftOffset()}return t}getHeight(){return Math.ceil(this.element.getBoundingClientRect().height)}setMinWidth(t){if(this.maxWidth&&t>this.maxWidth){t=this.maxWidth;console.warn("the minWidth ("+t+"px) for column '"+this.field+"' cannot be bigger that its maxWidth ("+this.maxWidthStyled+")")}this.minWidth=t;this.minWidthStyled=t?t+"px":"";this.element.style.minWidth=this.minWidthStyled;this.cells.forEach((function(t){t.setMinWidth()}))}setMaxWidth(t){if(this.minWidth&&t<this.minWidth){t=this.minWidth;console.warn("the maxWidth ("+t+"px) for column '"+this.field+"' cannot be smaller that its minWidth ("+this.minWidthStyled+")")}this.maxWidth=t;this.maxWidthStyled=t?t+"px":"";this.element.style.maxWidth=this.maxWidthStyled;this.cells.forEach((function(t){t.setMaxWidth()}))}delete(){return new Promise(((t,i)=>{if(this.isGroup){this.columns.forEach((function(t){t.delete()}))}this.dispatch("column-delete",this);var e=this.cells.length;for(let t=0;t<e;t++){this.cells[0].delete()}if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.element=false;this.contentElement=false;this.titleElement=false;this.groupElement=false;if(this.parent.isGroup){this.parent.removeChild(this)}this.table.columnManager.deregisterColumn(this);this.table.columnManager.rerenderColumns(true);this.dispatch("column-deleted",this);t()}))}columnRendered(){if(this.titleFormatterRendered){this.titleFormatterRendered()}this.dispatch("column-rendered",this)}generateCell(t){var i=new q(this,t);this.cells.push(i);return i}nextColumn(){var t=this.table.columnManager.findColumnIndex(this);return t>-1?this._nextVisibleColumn(t+1):false}_nextVisibleColumn(t){var i=this.table.columnManager.getColumnByIndex(t);return!i||i.visible?i:this._nextVisibleColumn(t+1)}prevColumn(){var t=this.table.columnManager.findColumnIndex(this);return t>-1?this._prevVisibleColumn(t-1):false}_prevVisibleColumn(t){var i=this.table.columnManager.getColumnByIndex(t);return!i||i.visible?i:this._prevVisibleColumn(t-1)}reinitializeWidth(t){this.widthFixed=false;if(typeof this.definition.width!=="undefined"&&!t){this.setWidth(this.definition.width)}this.dispatch("column-width-fit-before",this);this.fitToData(t);this.dispatch("column-width-fit-after",this)}fitToData(t){if(this.isGroup){return}if(!this.widthFixed){this.element.style.width="";this.cells.forEach((t=>{t.clearWidth()}))}var i=this.element.offsetWidth;if(!this.width||!this.widthFixed){this.cells.forEach((t=>{var e=t.getWidth();if(e>i){i=e}}));if(i){var e=i+1;if(t){this.setWidth(e)}else{if(this.maxInitialWidth&&!t){e=Math.min(e,this.maxInitialWidth)}this.setWidthActual(e)}}}}updateDefinition(t){var i;if(!this.isGroup){if(!this.parent.isGroup){i=Object.assign({},this.getDefinition());i=Object.assign(i,t);return this.table.columnManager.addColumn(i,false,this).then((t=>{if(i.field==this.field){this.field=false}return this.delete().then((()=>t.getComponent()))}))}else{console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns");return Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")}}else{console.error("Column Update Error - The updateDefinition function is only available on ungrouped columns");return Promise.reject("Column Update Error - The updateDefinition function is only available on columns, not column groups")}}deleteCell(t){var i=this.cells.indexOf(t);if(i>-1){this.cells.splice(i,1)}}getComponent(){if(!this.component){this.component=new K(this)}return this.component}getPosition(){return this.table.columnManager.getVisibleColumnsByIndex().indexOf(this)+1}getParentComponent(){return this.parent instanceof $?this.parent.getComponent():false}}class X{constructor(t){this._row=t;return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._row.table.componentFunctionBinder.handle("row",t._row,i)}}})}getData(t){return this._row.getData(t)}getElement(){return this._row.getElement()}getCells(){var t=[];this._row.getCells().forEach((function(i){t.push(i.getComponent())}));return t}getCell(t){var i=this._row.getCell(t);return i?i.getComponent():false}getIndex(){return this._row.getData("data")[this._row.table.options.index]}getPosition(){return this._row.getPosition()}watchPosition(t){return this._row.watchPosition(t)}delete(){return this._row.delete()}scrollTo(t,i){return this._row.table.rowManager.scrollToRow(this._row,t,i)}move(t,i){this._row.moveToRow(t,i)}update(t){return this._row.updateData(t)}normalizeHeight(){this._row.normalizeHeight(true)}_getSelf(){return this._row}reformat(){return this._row.reinitialize()}getTable(){return this._row.table}getNextRow(){var t=this._row.nextRow();return t?t.getComponent():t}getPrevRow(){var t=this._row.prevRow();return t?t.getComponent():t}}class Y extends E{constructor(t,i,e="row"){super(i.table);this.parent=i;this.data={};this.type=e;this.element=false;this.modules={};this.cells=[];this.height=0;this.heightStyled="";this.manualHeight=false;this.outerHeight=0;this.initialized=false;this.heightInitialized=false;this.position=0;this.positionWatchers=[];this.component=null;this.created=false;this.setData(t)}create(){if(!this.created){this.created=true;this.generateElement()}}createElement(){var t=document.createElement("div");t.classList.add("tabulator-row");t.setAttribute("role","row");this.element=t}getElement(){this.create();return this.element}detachElement(){if(this.element&&this.element.parentNode){this.element.parentNode.removeChild(this.element)}}generateElement(){this.createElement();this.dispatch("row-init",this)}generateCells(){this.cells=this.table.columnManager.generateCells(this)}initialize(t,i){this.create();if(!this.initialized||t){this.deleteCells();while(this.element.firstChild)this.element.removeChild(this.element.firstChild);this.dispatch("row-layout-before",this);this.generateCells();this.initialized=true;this.table.columnManager.renderer.renderRowCells(this,i);if(t){this.normalizeHeight()}this.dispatch("row-layout",this);if(this.table.options.rowFormatter){this.table.options.rowFormatter(this.getComponent())}this.dispatch("row-layout-after",this)}else{this.table.columnManager.renderer.rerenderRowCells(this,i)}}rendered(){this.cells.forEach((t=>{t.cellRendered()}))}reinitializeHeight(){this.heightInitialized=false;if(this.element&&this.element.offsetParent!==null){this.normalizeHeight(true)}}deinitialize(){this.initialized=false}deinitializeHeight(){this.heightInitialized=false}reinitialize(t){this.initialized=false;this.heightInitialized=false;if(!this.manualHeight){this.height=0;this.heightStyled=""}if(this.element&&this.element.offsetParent!==null){this.initialize(true)}this.dispatch("row-relayout",this)}calcHeight(t){var i=0,e=0;if(this.table.options.rowHeight){this.height=this.table.options.rowHeight}else{e=this.calcMinHeight();i=this.calcMaxHeight();if(t){this.height=Math.max(i,e)}else{this.height=this.manualHeight?this.height:Math.max(i,e)}}this.heightStyled=this.height?this.height+"px":"";this.outerHeight=this.element.offsetHeight}calcMinHeight(){return this.table.options.resizableRows?this.element.clientHeight:0}calcMaxHeight(){var t=0;this.cells.forEach((function(i){var e=i.getHeight();if(e>t){t=e}}));return t}setCellHeight(){this.cells.forEach((function(t){t.setHeight()}));this.heightInitialized=true}clearCellHeight(){this.cells.forEach((function(t){t.clearHeight()}))}normalizeHeight(t){if(t&&!this.table.options.rowHeight){this.clearCellHeight()}this.calcHeight(t);this.setCellHeight()}setHeight(t,i){if(this.height!=t||i){this.manualHeight=true;this.height=t;this.heightStyled=t?t+"px":"";this.setCellHeight();this.outerHeight=this.element.offsetHeight;if(this.subscribedExternal("rowHeight")){this.dispatchExternal("rowHeight",this.getComponent())}}}getHeight(){return this.outerHeight}getWidth(){return this.element.offsetWidth}deleteCell(t){var i=this.cells.indexOf(t);if(i>-1){this.cells.splice(i,1)}}setData(t){this.data=this.chain("row-data-init-before",[this,t],undefined,t);this.dispatch("row-data-init-after",this)}updateData(t){var i=this.element&&z.elVisible(this.element),e={},s;return new Promise(((r,a)=>{if(typeof t==="string"){t=JSON.parse(t)}this.dispatch("row-data-save-before",this);if(this.subscribed("row-data-changing")){e=Object.assign(e,this.data);e=Object.assign(e,t)}s=this.chain("row-data-changing",[this,e,t],null,t);for(let t in s){this.data[t]=s[t]}this.dispatch("row-data-save-after",this);for(let e in t){let t=this.table.columnManager.getColumnsByFieldRoot(e);t.forEach((t=>{let e=this.getCell(t.getField());if(e){let r=t.getFieldValue(s);if(e.getValue()!==r){e.setValueProcessData(r);if(i){e.cellRendered()}}}}))}if(i){this.normalizeHeight(true);if(this.table.options.rowFormatter){this.table.options.rowFormatter(this.getComponent())}}else{this.initialized=false;this.height=0;this.heightStyled=""}this.dispatch("row-data-changed",this,i,t);this.dispatchExternal("rowUpdated",this.getComponent());if(this.subscribedExternal("dataChanged")){this.dispatchExternal("dataChanged",this.table.rowManager.getData())}r()}))}getData(t){if(t){return this.chain("row-data-retrieve",[this,t],null,this.data)}return this.data}getCell(t){var i=false;t=this.table.columnManager.findColumn(t);if(!this.initialized&&this.cells.length===0){this.generateCells()}i=this.cells.find((function(i){return i.column===t}));return i}getCellIndex(t){return this.cells.findIndex((function(i){return i===t}))}findCell(t){return this.cells.find((i=>i.element===t))}getCells(){if(!this.initialized&&this.cells.length===0){this.generateCells()}return this.cells}nextRow(){var t=this.table.rowManager.nextDisplayRow(this,true);return t||false}prevRow(){var t=this.table.rowManager.prevDisplayRow(this,true);return t||false}moveToRow(t,i){var e=this.table.rowManager.findRow(t);if(e){this.table.rowManager.moveRowActual(this,e,!i);this.table.rowManager.refreshActiveData("display",false,true)}else{console.warn("Move Error - No matching row found:",t)}}delete(){this.dispatch("row-delete",this);this.deleteActual();return Promise.resolve()}deleteActual(t){this.detachModules();this.table.rowManager.deleteRow(this,t);this.deleteCells();this.initialized=false;this.heightInitialized=false;this.element=false;this.dispatch("row-deleted",this)}detachModules(){this.dispatch("row-deleting",this)}deleteCells(){var t=this.cells.length;for(let i=0;i<t;i++){this.cells[0].delete()}}wipe(){this.detachModules();this.deleteCells();if(this.element){while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}}this.element=false;this.modules={}}isDisplayed(){return this.table.rowManager.getDisplayRows().includes(this)}getPosition(){return this.isDisplayed()?this.position:false}setPosition(t){if(t!=this.position){this.position=t;this.positionWatchers.forEach((t=>{t(this.position)}))}}watchPosition(t){this.positionWatchers.push(t);t(this.position)}getGroup(){return this.modules.group||false}getComponent(){if(!this.component){this.component=new X(this)}return this.component}}var Q={avg:function(t,i,e){var s=0,r=typeof e.precision!=="undefined"?e.precision:2;if(t.length){s=t.reduce((function(t,i){return Number(t)+Number(i)}));s=s/t.length;s=r!==false?s.toFixed(r):s}return parseFloat(s).toString()},max:function(t,i,e){var s=null,r=typeof e.precision!=="undefined"?e.precision:false;t.forEach((function(t){t=Number(t);if(t>s||s===null){s=t}}));return s!==null?r!==false?s.toFixed(r):s:""},min:function(t,i,e){var s=null,r=typeof e.precision!=="undefined"?e.precision:false;t.forEach((function(t){t=Number(t);if(t<s||s===null){s=t}}));return s!==null?r!==false?s.toFixed(r):s:""},sum:function(t,i,e){var s=0,r=typeof e.precision!=="undefined"?e.precision:false;if(t.length){t.forEach((function(t){t=Number(t);s+=!isNaN(t)?Number(t):0}))}return r!==false?s.toFixed(r):s},concat:function(t,i,e){var s=0;if(t.length){s=t.reduce((function(t,i){return String(t)+String(i)}))}return s},count:function(t,i,e){var s=0;if(t.length){t.forEach((function(t){if(t){s++}}))}return s},unique:function(t,i,e){var s=t.filter(((i,e)=>(t||i===0)&&t.indexOf(i)===e));return s.length}};class tt extends S{static moduleName="columnCalcs";static calculations=Q;constructor(t){super(t);this.topCalcs=[];this.botCalcs=[];this.genColumn=false;this.topElement=this.createElement();this.botElement=this.createElement();this.topRow=false;this.botRow=false;this.topInitialized=false;this.botInitialized=false;this.blocked=false;this.recalcAfterBlock=false;this.registerTableOption("columnCalcs",true);this.registerColumnOption("topCalc");this.registerColumnOption("topCalcParams");this.registerColumnOption("topCalcFormatter");this.registerColumnOption("topCalcFormatterParams");this.registerColumnOption("bottomCalc");this.registerColumnOption("bottomCalcParams");this.registerColumnOption("bottomCalcFormatter");this.registerColumnOption("bottomCalcFormatterParams")}createElement(){var t=document.createElement("div");t.classList.add("tabulator-calcs-holder");return t}initialize(){this.genColumn=new $({field:"value"},this);this.subscribe("cell-value-changed",this.cellValueChanged.bind(this));this.subscribe("column-init",this.initializeColumnCheck.bind(this));this.subscribe("row-deleted",this.rowsUpdated.bind(this));this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this));this.subscribe("row-added",this.rowsUpdated.bind(this));this.subscribe("column-moved",this.recalcActiveRows.bind(this));this.subscribe("column-add",this.recalcActiveRows.bind(this));this.subscribe("data-refreshed",this.recalcActiveRowsRefresh.bind(this));this.subscribe("table-redraw",this.tableRedraw.bind(this));this.subscribe("rows-visible",this.visibleRows.bind(this));this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this));this.subscribe("redraw-blocked",this.blockRedraw.bind(this));this.subscribe("redraw-restored",this.restoreRedraw.bind(this));this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this));this.subscribe("column-resized",this.resizeHolderWidth.bind(this));this.subscribe("column-show",this.resizeHolderWidth.bind(this));this.subscribe("column-hide",this.resizeHolderWidth.bind(this));this.registerTableFunction("getCalcResults",this.getResults.bind(this));this.registerTableFunction("recalc",this.userRecalc.bind(this));this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}tableRedraw(t){this.recalc(this.table.rowManager.activeRows);if(t){this.redraw()}}blockRedraw(){this.blocked=true;this.recalcAfterBlock=false}restoreRedraw(){this.blocked=false;if(this.recalcAfterBlock){this.recalcAfterBlock=false;this.recalcActiveRowsRefresh()}}userRecalc(){this.recalc(this.table.rowManager.activeRows)}blockCheck(){if(this.blocked){this.recalcAfterBlock=true}return this.blocked}visibleRows(t,i){if(this.topRow){i.unshift(this.topRow)}if(this.botRow){i.push(this.botRow)}return i}rowsUpdated(t){if(this.table.options.groupBy){this.recalcRowGroup(t)}else{this.recalcActiveRows()}}recalcActiveRowsRefresh(){if(this.table.options.groupBy&&this.table.options.dataTreeStartExpanded&&this.table.options.dataTree){this.recalcAll()}else{this.recalcActiveRows()}}recalcActiveRows(){this.recalc(this.table.rowManager.activeRows)}cellValueChanged(t){if(t.column.definition.topCalc||t.column.definition.bottomCalc){if(this.table.options.groupBy){if(this.table.options.columnCalcs=="table"||this.table.options.columnCalcs=="both"){this.recalcActiveRows()}if(this.table.options.columnCalcs!="table"){this.recalcRowGroup(t.row)}}else{this.recalcActiveRows()}}}initializeColumnCheck(t){if(t.definition.topCalc||t.definition.bottomCalc){this.initializeColumn(t)}}initializeColumn(t){var i=t.definition;var e={topCalcParams:i.topCalcParams||{},botCalcParams:i.bottomCalcParams||{}};if(i.topCalc){switch(typeof i.topCalc){case"string":if(tt.calculations[i.topCalc]){e.topCalc=tt.calculations[i.topCalc]}else{console.warn("Column Calc Error - No such calculation found, ignoring: ",i.topCalc)}break;case"function":e.topCalc=i.topCalc;break}if(e.topCalc){t.modules.columnCalcs=e;this.topCalcs.push(t);if(this.table.options.columnCalcs!="group"){this.initializeTopRow()}}}if(i.bottomCalc){switch(typeof i.bottomCalc){case"string":if(tt.calculations[i.bottomCalc]){e.botCalc=tt.calculations[i.bottomCalc]}else{console.warn("Column Calc Error - No such calculation found, ignoring: ",i.bottomCalc)}break;case"function":e.botCalc=i.bottomCalc;break}if(e.botCalc){t.modules.columnCalcs=e;this.botCalcs.push(t);if(this.table.options.columnCalcs!="group"){this.initializeBottomRow()}}}}registerColumnField(){}removeCalcs(){var t=false;if(this.topInitialized){this.topInitialized=false;this.topElement.parentNode.removeChild(this.topElement);t=true}if(this.botInitialized){this.botInitialized=false;this.footerRemove(this.botElement);t=true}if(t){this.table.rowManager.adjustTableSize()}}reinitializeCalcs(){if(this.topCalcs.length){this.initializeTopRow()}if(this.botCalcs.length){this.initializeBottomRow()}}initializeTopRow(){var t=document.createDocumentFragment();if(!this.topInitialized){t.appendChild(document.createElement("br"));t.appendChild(this.topElement);this.table.columnManager.getContentsElement().insertBefore(t,this.table.columnManager.headersElement.nextSibling);this.topInitialized=true}}initializeBottomRow(){if(!this.botInitialized){this.footerPrepend(this.botElement);this.botInitialized=true}}scrollHorizontal(t){if(this.botInitialized&&this.botRow){this.botElement.scrollLeft=t}}recalc(t){var i,e;if(!this.blockCheck()){if(this.topInitialized||this.botInitialized){i=this.rowsToData(t);if(this.topInitialized){if(this.topRow){this.topRow.deleteCells()}e=this.generateRow("top",i);this.topRow=e;while(this.topElement.firstChild)this.topElement.removeChild(this.topElement.firstChild);this.topElement.appendChild(e.getElement());e.initialize(true)}if(this.botInitialized){if(this.botRow){this.botRow.deleteCells()}e=this.generateRow("bottom",i);this.botRow=e;while(this.botElement.firstChild)this.botElement.removeChild(this.botElement.firstChild);this.botElement.appendChild(e.getElement());e.initialize(true)}this.table.rowManager.adjustTableSize();if(this.table.modExists("frozenColumns")){this.table.modules.frozenColumns.layout()}}}}recalcRowGroup(t){this.recalcGroup(this.table.modules.groupRows.getRowGroup(t))}recalcAll(){if(this.topCalcs.length||this.botCalcs.length){if(this.table.options.columnCalcs!=="group"){this.recalcActiveRows()}if(this.table.options.groupBy&&this.table.options.columnCalcs!=="table"){var t=this.table.modules.groupRows.getChildGroups();t.forEach((t=>{this.recalcGroup(t)}))}}}recalcGroup(t){var i,e;if(!this.blockCheck()){if(t){if(t.calcs){if(t.calcs.bottom){i=this.rowsToData(t.rows);e=this.generateRowData("bottom",i);t.calcs.bottom.updateData(e);t.calcs.bottom.reinitialize()}if(t.calcs.top){i=this.rowsToData(t.rows);e=this.generateRowData("top",i);t.calcs.top.updateData(e);t.calcs.top.reinitialize()}}}}}generateTopRow(t){return this.generateRow("top",this.rowsToData(t))}generateBottomRow(t){return this.generateRow("bottom",this.rowsToData(t))}rowsToData(t){var i=[],e=this.table.options.dataTree&&this.table.options.dataTreeChildColumnCalcs,s=this.table.modules.dataTree;t.forEach((t=>{i.push(t.getData());if(e&&t.modules.dataTree?.open){this.rowsToData(s.getFilteredTreeChildren(t)).forEach((e=>{i.push(t)}))}}));return i}generateRow(t,i){var e=this.generateRowData(t,i),s;if(this.table.modExists("mutator")){this.table.modules.mutator.disable()}s=new Y(e,this,"calc");if(this.table.modExists("mutator")){this.table.modules.mutator.enable()}s.getElement().classList.add("tabulator-calcs","tabulator-calcs-"+t);s.component=false;s.getComponent=()=>{if(!s.component){s.component=new W(s)}return s.component};s.generateCells=()=>{var i=[];this.table.columnManager.columnsByIndex.forEach((e=>{this.genColumn.setField(e.getField());this.genColumn.hozAlign=e.hozAlign;if(e.definition[t+"CalcFormatter"]&&this.table.modExists("format")){this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter(e.definition[t+"CalcFormatter"]),params:e.definition[t+"CalcFormatterParams"]||{}}}else{this.genColumn.modules.format={formatter:this.table.modules.format.lookupFormatter("plaintext"),params:{}}}this.genColumn.definition.cssClass=e.definition.cssClass;var r=new q(this.genColumn,s);r.getElement();r.column=e;r.setWidth();e.cells.push(r);i.push(r);if(!e.visible){r.hide()}}));s.cells=i};return s}generateRowData(t,i){var e={},s=t=="top"?this.topCalcs:this.botCalcs,r=t=="top"?"topCalc":"botCalc",a,o;s.forEach((function(t){var s=[];if(t.modules.columnCalcs&&t.modules.columnCalcs[r]){i.forEach((function(i){s.push(t.getFieldValue(i))}));o=r+"Params";a=typeof t.modules.columnCalcs[o]==="function"?t.modules.columnCalcs[o](s,i):t.modules.columnCalcs[o];t.setFieldValue(e,t.modules.columnCalcs[r](s,i,a))}}));return e}hasTopCalcs(){return!!this.topCalcs.length}hasBottomCalcs(){return!!this.botCalcs.length}redraw(){if(this.topRow){this.topRow.normalizeHeight(true)}if(this.botRow){this.botRow.normalizeHeight(true)}}getResults(){var t={},i;if(this.table.options.groupBy&&this.table.modExists("groupRows")){i=this.table.modules.groupRows.getGroups(true);i.forEach((i=>{t[i.getKey()]=this.getGroupResults(i)}))}else{t={top:this.topRow?this.topRow.getData():{},bottom:this.botRow?this.botRow.getData():{}}}return t}getGroupResults(t){var i=t._getSelf(),e=t.getSubGroups(),s={},r={};e.forEach((t=>{s[t.getKey()]=this.getGroupResults(t)}));r={top:i.calcs.top?i.calcs.top.getData():{},bottom:i.calcs.bottom?i.calcs.bottom.getData():{},groups:s};return r}adjustForScrollbar(t){if(this.botRow){if(this.table.rtl){this.botElement.style.paddingLeft=t+"px"}else{this.botElement.style.paddingRight=t+"px"}}}}class it extends S{static moduleName="dataTree";constructor(t){super(t);this.indent=10;this.field="";this.collapseEl=null;this.expandEl=null;this.branchEl=null;this.elementField=false;this.startOpen=function(){};this.registerTableOption("dataTree",false);this.registerTableOption("dataTreeFilter",true);this.registerTableOption("dataTreeSort",true);this.registerTableOption("dataTreeElementColumn",false);this.registerTableOption("dataTreeBranchElement",true);this.registerTableOption("dataTreeChildIndent",9);this.registerTableOption("dataTreeChildField","_children");this.registerTableOption("dataTreeCollapseElement",false);this.registerTableOption("dataTreeExpandElement",false);this.registerTableOption("dataTreeStartExpanded",false);this.registerTableOption("dataTreeChildColumnCalcs",false);this.registerTableOption("dataTreeSelectPropagate",false);this.registerComponentFunction("row","treeCollapse",this.collapseRow.bind(this));this.registerComponentFunction("row","treeExpand",this.expandRow.bind(this));this.registerComponentFunction("row","treeToggle",this.toggleRow.bind(this));this.registerComponentFunction("row","getTreeParent",this.getTreeParent.bind(this));this.registerComponentFunction("row","getTreeChildren",this.getRowChildren.bind(this));this.registerComponentFunction("row","addTreeChild",this.addTreeChildRow.bind(this));this.registerComponentFunction("row","isTreeExpanded",this.isRowExpanded.bind(this))}initialize(){if(this.table.options.dataTree){var t=null,i=this.table.options;this.field=i.dataTreeChildField;this.indent=i.dataTreeChildIndent;if(this.options("movableRows")){console.warn("The movableRows option is not available with dataTree enabled, moving of child rows could result in unpredictable behavior")}if(i.dataTreeBranchElement){if(i.dataTreeBranchElement===true){this.branchEl=document.createElement("div");this.branchEl.classList.add("tabulator-data-tree-branch")}else{if(typeof i.dataTreeBranchElement==="string"){t=document.createElement("div");t.innerHTML=i.dataTreeBranchElement;this.branchEl=t.firstChild}else{this.branchEl=i.dataTreeBranchElement}}}else{this.branchEl=document.createElement("div");this.branchEl.classList.add("tabulator-data-tree-branch-empty")}if(i.dataTreeCollapseElement){if(typeof i.dataTreeCollapseElement==="string"){t=document.createElement("div");t.innerHTML=i.dataTreeCollapseElement;this.collapseEl=t.firstChild}else{this.collapseEl=i.dataTreeCollapseElement}}else{this.collapseEl=document.createElement("div");this.collapseEl.classList.add("tabulator-data-tree-control");this.collapseEl.tabIndex=0;this.collapseEl.innerHTML="<div class='tabulator-data-tree-control-collapse'></div>"}if(i.dataTreeExpandElement){if(typeof i.dataTreeExpandElement==="string"){t=document.createElement("div");t.innerHTML=i.dataTreeExpandElement;this.expandEl=t.firstChild}else{this.expandEl=i.dataTreeExpandElement}}else{this.expandEl=document.createElement("div");this.expandEl.classList.add("tabulator-data-tree-control");this.expandEl.tabIndex=0;this.expandEl.innerHTML="<div class='tabulator-data-tree-control-expand'></div>"}switch(typeof i.dataTreeStartExpanded){case"boolean":this.startOpen=function(t,e){return i.dataTreeStartExpanded};break;case"function":this.startOpen=i.dataTreeStartExpanded;break;default:this.startOpen=function(t,e){return i.dataTreeStartExpanded[e]};break}this.subscribe("row-init",this.initializeRow.bind(this));this.subscribe("row-layout-after",this.layoutRow.bind(this));this.subscribe("row-deleting",this.rowDeleting.bind(this));this.subscribe("row-deleted",this.rowDelete.bind(this),0);this.subscribe("row-data-changed",this.rowDataChanged.bind(this),10);this.subscribe("cell-value-updated",this.cellValueChanged.bind(this));this.subscribe("edit-cancelled",this.cellValueChanged.bind(this));this.subscribe("column-moving-rows",this.columnMoving.bind(this));this.subscribe("table-built",this.initializeElementField.bind(this));this.subscribe("table-redrawing",this.tableRedrawing.bind(this));this.registerDisplayHandler(this.getRows.bind(this),30)}}tableRedrawing(t){var i;if(t){i=this.table.rowManager.getRows();i.forEach((t=>{this.reinitializeRowChildren(t)}))}}initializeElementField(){var t=this.table.columnManager.getFirstVisibleColumn();this.elementField=this.table.options.dataTreeElementColumn||(t?t.field:false)}getRowChildren(t){return this.getTreeChildren(t,true)}columnMoving(){var t=[];this.table.rowManager.rows.forEach((i=>{t=t.concat(this.getTreeChildren(i,false,true))}));return t}rowDataChanged(t,i,e){if(this.redrawNeeded(e)){this.initializeRow(t);if(i){this.layoutRow(t);this.refreshData(true)}}}cellValueChanged(t){var i=t.column.getField();if(i===this.elementField){this.layoutRow(t.row)}}initializeRow(t){var i=t.getData()[this.field];var e=Array.isArray(i);var s=e||!e&&typeof i==="object"&&i!==null;if(!s&&t.modules.dataTree&&t.modules.dataTree.branchEl){t.modules.dataTree.branchEl.parentNode.removeChild(t.modules.dataTree.branchEl)}if(!s&&t.modules.dataTree&&t.modules.dataTree.controlEl){t.modules.dataTree.controlEl.parentNode.removeChild(t.modules.dataTree.controlEl)}t.modules.dataTree={index:t.modules.dataTree?t.modules.dataTree.index:0,open:s?t.modules.dataTree?t.modules.dataTree.open:this.startOpen(t.getComponent(),0):false,controlEl:t.modules.dataTree&&s?t.modules.dataTree.controlEl:false,branchEl:t.modules.dataTree&&s?t.modules.dataTree.branchEl:false,parent:t.modules.dataTree?t.modules.dataTree.parent:false,children:s}}reinitializeRowChildren(t){var i=this.getTreeChildren(t,false,true);i.forEach((function(t){t.reinitialize(true)}))}layoutRow(t){var i=this.elementField?t.getCell(this.elementField):t.getCells()[0],e=i.getElement(),s=t.modules.dataTree;if(s.branchEl){if(s.branchEl.parentNode){s.branchEl.parentNode.removeChild(s.branchEl)}s.branchEl=false}if(s.controlEl){if(s.controlEl.parentNode){s.controlEl.parentNode.removeChild(s.controlEl)}s.controlEl=false}this.generateControlElement(t,e);t.getElement().classList.add("tabulator-tree-level-"+s.index);if(s.index){if(this.branchEl){s.branchEl=this.branchEl.cloneNode(true);e.insertBefore(s.branchEl,e.firstChild);if(this.table.rtl){s.branchEl.style.marginRight=(s.branchEl.offsetWidth+s.branchEl.style.marginLeft)*(s.index-1)+s.index*this.indent+"px"}else{s.branchEl.style.marginLeft=(s.branchEl.offsetWidth+s.branchEl.style.marginRight)*(s.index-1)+s.index*this.indent+"px"}}else{if(this.table.rtl){e.style.paddingRight=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-right"))+s.index*this.indent+"px"}else{e.style.paddingLeft=parseInt(window.getComputedStyle(e,null).getPropertyValue("padding-left"))+s.index*this.indent+"px"}}}}generateControlElement(t,i){var e=t.modules.dataTree,s=e.controlEl;i=i||t.getCells()[0].getElement();if(e.children!==false){if(e.open){e.controlEl=this.collapseEl.cloneNode(true);e.controlEl.addEventListener("click",(i=>{i.stopPropagation();this.collapseRow(t)}))}else{e.controlEl=this.expandEl.cloneNode(true);e.controlEl.addEventListener("click",(i=>{i.stopPropagation();this.expandRow(t)}))}e.controlEl.addEventListener("mousedown",(t=>{t.stopPropagation()}));if(s&&s.parentNode===i){s.parentNode.replaceChild(e.controlEl,s)}else{i.insertBefore(e.controlEl,i.firstChild)}}}getRows(t){var i=[];t.forEach(((t,e)=>{var s,r;i.push(t);if(t instanceof Y){t.create();s=t.modules.dataTree;if(!s.index&&s.children!==false){r=this.getChildren(t,false,true);r.forEach((t=>{t.create();i.push(t)}))}}}));return i}getChildren(t,i,e){var s=t.modules.dataTree,r=[],a=[];if(s.children!==false&&(s.open||i)){if(!Array.isArray(s.children)){s.children=this.generateChildren(t)}if(this.table.modExists("filter")&&this.table.options.dataTreeFilter){r=this.table.modules.filter.filter(s.children)}else{r=s.children}if(this.table.modExists("sort")&&this.table.options.dataTreeSort){this.table.modules.sort.sort(r,e)}r.forEach((t=>{a.push(t);var i=this.getChildren(t,false,true);i.forEach((t=>{a.push(t)}))}))}return a}generateChildren(t){var i=[];var e=t.getData()[this.field];if(!Array.isArray(e)){e=[e]}e.forEach((e=>{var s=new Y(e||{},this.table.rowManager);s.create();s.modules.dataTree.index=t.modules.dataTree.index+1;s.modules.dataTree.parent=t;if(s.modules.dataTree.children){s.modules.dataTree.open=this.startOpen(s.getComponent(),s.modules.dataTree.index)}i.push(s)}));return i}expandRow(t,i){var e=t.modules.dataTree;if(e.children!==false){e.open=true;t.reinitialize();this.refreshData(true);this.dispatchExternal("dataTreeRowExpanded",t.getComponent(),t.modules.dataTree.index)}}collapseRow(t){var i=t.modules.dataTree;if(i.children!==false){i.open=false;t.reinitialize();this.refreshData(true);this.dispatchExternal("dataTreeRowCollapsed",t.getComponent(),t.modules.dataTree.index)}}toggleRow(t){var i=t.modules.dataTree;if(i.children!==false){if(i.open){this.collapseRow(t)}else{this.expandRow(t)}}}isRowExpanded(t){return t.modules.dataTree.open}getTreeParent(t){return t.modules.dataTree.parent?t.modules.dataTree.parent.getComponent():false}getTreeParentRoot(t){return t.modules.dataTree&&t.modules.dataTree.parent?this.getTreeParentRoot(t.modules.dataTree.parent):t}getFilteredTreeChildren(t){var i=t.modules.dataTree,e=[],s;if(i.children){if(!Array.isArray(i.children)){i.children=this.generateChildren(t)}if(this.table.modExists("filter")&&this.table.options.dataTreeFilter){s=this.table.modules.filter.filter(i.children)}else{s=i.children}s.forEach((t=>{if(t instanceof Y){e.push(t)}}))}return e}rowDeleting(t){var i=t.modules.dataTree;if(i&&i.children&&Array.isArray(i.children)){i.children.forEach((t=>{if(t instanceof Y){t.wipe()}}))}}rowDelete(t){var i=t.modules.dataTree.parent,e;if(i){e=this.findChildIndex(t,i);if(e!==false){i.data[this.field].splice(e,1)}if(!i.data[this.field].length){delete i.data[this.field]}this.initializeRow(i);this.layoutRow(i)}this.refreshData(true)}addTreeChildRow(t,i,e,s){var r=false;if(typeof i==="string"){i=JSON.parse(i)}if(!Array.isArray(t.data[this.field])){t.data[this.field]=[];t.modules.dataTree.open=this.startOpen(t.getComponent(),t.modules.dataTree.index)}if(typeof s!=="undefined"){r=this.findChildIndex(s,t);if(r!==false){t.data[this.field].splice(e?r:r+1,0,i)}}if(r===false){if(e){t.data[this.field].unshift(i)}else{t.data[this.field].push(i)}}this.initializeRow(t);this.layoutRow(t);this.refreshData(true)}findChildIndex(t,i){var e=false;if(typeof t=="object"){if(t instanceof Y){e=t.data}else if(t instanceof X){e=t._getSelf().data}else if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement){if(i.modules.dataTree){e=i.modules.dataTree.children.find((i=>i instanceof Y?i.element===t:false));if(e){e=e.data}}}else if(t===null){e=false}}else if(typeof t=="undefined"){e=false}else{e=i.data[this.field].find((i=>i.data[this.table.options.index]==t))}if(e){if(Array.isArray(i.data[this.field])){e=i.data[this.field].indexOf(e)}if(e==-1){e=false}}return e}getTreeChildren(t,i,e){var s=t.modules.dataTree,r=[];if(s&&s.children){if(!Array.isArray(s.children)){s.children=this.generateChildren(t)}s.children.forEach((t=>{if(t instanceof Y){r.push(i?t.getComponent():t);if(e){this.getTreeChildren(t,i,e).forEach((t=>{r.push(t)}))}}}))}return r}getChildField(){return this.field}redrawNeeded(t){return(this.field?typeof t[this.field]!=="undefined":false)||(this.elementField?typeof t[this.elementField]!=="undefined":false)}}function et(t,i={},e){var s=i.delimiter?i.delimiter:",",r=[],a=[];t.forEach((t=>{var i=[];switch(t.type){case"group":console.warn("Download Warning - CSV downloader cannot process row groups");break;case"calc":console.warn("Download Warning - CSV downloader cannot process column calculations");break;case"header":t.columns.forEach(((t,i)=>{if(t&&t.depth===1){a[i]=typeof t.value=="undefined"||t.value===null?"":'"'+String(t.value).split('"').join('""')+'"'}}));break;case"row":t.columns.forEach((t=>{if(t){switch(typeof t.value){case"object":t.value=t.value!==null?JSON.stringify(t.value):"";break;case"undefined":t.value="";break}i.push('"'+String(t.value).split('"').join('""')+'"')}}));r.push(i.join(s));break}}));if(a.length){r.unshift(a.join(s))}r=r.join("\n");if(i.bom){r="\ufeff"+r}e(r,"text/csv")}function st(t,i,e){var s=[];t.forEach((t=>{var i={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach((t=>{if(t){i[t.component.getTitleDownload()||t.component.getField()]=t.value}}));s.push(i);break}}));s=JSON.stringify(s,null,"\t");e(s,"application/json")}function rt(t,i={},e){var s=[],r=[],a={},o=i.rowGroupStyles||{fontStyle:"bold",fontSize:12,cellPadding:6,fillColor:220},h=i.rowCalcStyles||{fontStyle:"bold",fontSize:10,cellPadding:4,fillColor:232},l=i.jsPDF||{},n=i.title?i.title:"",u,f;if(!l.orientation){l.orientation=i.orientation||"landscape"}if(!l.unit){l.unit="pt"}t.forEach((t=>{switch(t.type){case"header":s.push(c(t));break;case"group":r.push(c(t,o));break;case"calc":r.push(c(t,h));break;case"row":r.push(c(t));break}}));function c(t,i){var e=[];t.columns.forEach((t=>{var s;if(t){switch(typeof t.value){case"object":t.value=t.value!==null?JSON.stringify(t.value):"";break;case"undefined":t.value="";break}s={content:t.value,colSpan:t.width,rowSpan:t.height};if(i){s.styles=i}e.push(s)}}));return e}u=this.dependencyRegistry.lookup("jspdf","jsPDF");f=new u(l);if(i.autoTable){if(typeof i.autoTable==="function"){a=i.autoTable(f)||{}}else{a=i.autoTable}}if(n){a.didDrawPage=function(t){f.text(n,40,30)}}a.head=s;a.body=r;f.autoTable(a);if(i.documentProcessing){i.documentProcessing(f)}e(f.output("arraybuffer"),"application/pdf")}function at(t,i,e){var s=this,r=i.sheetName||"Sheet1",a=this.dependencyRegistry.lookup("XLSX"),o=a.utils.book_new(),h=new E(this),l="compress"in i?i.compress:true,n=i.writeOptions||{bookType:"xlsx",bookSST:true,compression:l},u;n.type="binary";o.SheetNames=[];o.Sheets={};function f(){var i=[],e=[],s={},r={s:{c:0,r:0},e:{c:t[0]?t[0].columns.reduce(((t,i)=>t+(i&&i.width?i.width:1)),0):0,r:t.length}};t.forEach(((t,s)=>{var r=[];t.columns.forEach((function(t,i){if(t){r.push(!(t.value instanceof Date)&&typeof t.value==="object"?JSON.stringify(t.value):t.value);if(t.width>1||t.height>-1){if(t.height>1||t.width>1){e.push({s:{r:s,c:i},e:{r:s+t.height-1,c:i+t.width-1}})}}}else{r.push("")}}));i.push(r)}));a.utils.sheet_add_aoa(s,i);s["!ref"]=a.utils.encode_range(r);if(e.length){s["!merges"]=e}return s}if(i.sheetOnly){e(f());return}if(i.sheets){for(var c in i.sheets){if(i.sheets[c]===true){o.SheetNames.push(c);o.Sheets[c]=f()}else{o.SheetNames.push(c);h.commsSend(i.sheets[c],"download","intercept",{type:"xlsx",options:{sheetOnly:true},active:s.active,intercept:function(t){o.Sheets[c]=t}})}}}else{o.SheetNames.push(r);o.Sheets[r]=f()}if(i.documentProcessing){o=i.documentProcessing(o)}function d(t){var i=new ArrayBuffer(t.length);var e=new Uint8Array(i);for(var s=0;s!=t.length;++s)e[s]=t.charCodeAt(s)&255;return i}u=a.write(o,n);e(d(u),"application/octet-stream")}function ot(t,i,e){if(this.modExists("export",true)){e(this.modules.export.generateHTMLTable(t),"text/html")}}function ht(t,i,e){const s=[];t.forEach((t=>{const i={};switch(t.type){case"header":break;case"group":console.warn("Download Warning - JSON downloader cannot process row groups");break;case"calc":console.warn("Download Warning - JSON downloader cannot process column calculations");break;case"row":t.columns.forEach((t=>{if(t){i[t.component.getTitleDownload()||t.component.getField()]=t.value}}));s.push(JSON.stringify(i));break}}));e(s.join("\n"),"application/x-ndjson")}var lt={csv:et,json:st,jsonLines:ht,pdf:rt,xlsx:at,html:ot};class nt extends S{static moduleName="download";static downloaders=lt;constructor(t){super(t);this.registerTableOption("downloadEncoder",(function(t,i){return new Blob([t],{type:i})}));this.registerTableOption("downloadConfig",{});this.registerTableOption("downloadRowRange","active");this.registerColumnOption("download");this.registerColumnOption("titleDownload")}initialize(){this.deprecatedOptionsCheck();this.registerTableFunction("download",this.download.bind(this));this.registerTableFunction("downloadToTab",this.downloadToTab.bind(this))}deprecatedOptionsCheck(){}downloadToTab(t,i,e,s){this.download(t,i,e,s,true)}download(t,i,e,s,r){var a=false;function o(e,s){if(r){if(r===true){this.triggerDownload(e,s,t,i,true)}else{r(e)}}else{this.triggerDownload(e,s,t,i)}}if(typeof t=="function"){a=t}else{if(nt.downloaders[t]){a=nt.downloaders[t]}else{console.warn("Download Error - No such download type found: ",t)}}if(a){var h=this.generateExportList(s);a.call(this.table,h,e||{},o.bind(this))}}generateExportList(t){var i=this.table.modules.export.generateExportList(this.table.options.downloadConfig,false,t||this.table.options.downloadRowRange,"download");var e=this.table.options.groupHeaderDownload;if(e&&!Array.isArray(e)){e=[e]}i.forEach((t=>{var i;if(t.type==="group"){i=t.columns[0];if(e&&e[t.indent]){i.value=e[t.indent](i.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)}}}));return i}triggerDownload(t,i,e,s,r){var a=document.createElement("a"),o=this.table.options.downloadEncoder(t,i);if(o){if(r){window.open(window.URL.createObjectURL(o))}else{s=s||"Tabulator."+(typeof e==="function"?"txt":e);if(navigator.msSaveOrOpenBlob){navigator.msSaveOrOpenBlob(o,s)}else{a.setAttribute("href",window.URL.createObjectURL(o));a.setAttribute("download",s);a.style.display="none";document.body.appendChild(a);a.click();document.body.removeChild(a)}}this.dispatchExternal("downloadComplete")}}commsReceived(t,i,e){switch(i){case"intercept":this.download(e.type,"",e.options,e.active,e.intercept);break}}}function ut(t,i){var e=i.mask,s=typeof i.maskLetterChar!=="undefined"?i.maskLetterChar:"A",r=typeof i.maskNumberChar!=="undefined"?i.maskNumberChar:"9",a=typeof i.maskWildcardChar!=="undefined"?i.maskWildcardChar:"*";function o(i){var h=e[i];if(typeof h!=="undefined"&&h!==a&&h!==s&&h!==r){t.value=t.value+""+h;o(i+1)}}t.addEventListener("keydown",(i=>{var o=t.value.length,h=i.key;if(i.keyCode>46&&!i.ctrlKey&&!i.metaKey){if(o>=e.length){i.preventDefault();i.stopPropagation();return false}else{switch(e[o]){case s:if(h.toUpperCase()==h.toLowerCase()){i.preventDefault();i.stopPropagation();return false}break;case r:if(isNaN(h)){i.preventDefault();i.stopPropagation();return false}break;case a:break;default:if(h!==e[o]){i.preventDefault();i.stopPropagation();return false}}}}return}));t.addEventListener("keyup",(e=>{if(e.keyCode>46){if(i.maskAutoFill){o(t.value.length)}}}));if(!t.placeholder){t.placeholder=e}if(i.maskAutoFill){o(t.value.length)}}function ft(t,i,e,s,r){var a=t.getValue(),o=document.createElement("input");o.setAttribute("type",r.search?"search":"text");o.style.padding="4px";o.style.width="100%";o.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);o.setAttribute(t,o.getAttribute(t)+r.elementAttributes["+"+t])}else{o.setAttribute(t,r.elementAttributes[t])}}}o.value=typeof a!=="undefined"?a:"";i((function(){if(t.getType()==="cell"){o.focus({preventScroll:true});o.style.height="100%";if(r.selectContents){o.select()}}}));function h(t){if((a===null||typeof a==="undefined")&&o.value!==""||o.value!==a){if(e(o.value)){a=o.value}}else{s()}}o.addEventListener("change",h);o.addEventListener("blur",h);o.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:h();break;case 27:s();break;case 35:case 36:t.stopPropagation();break}}));if(r.mask){ut(o,r)}return o}function ct(t,i,e,s,r){var a=t.getValue(),o=r.verticalNavigation||"hybrid",h=String(a!==null&&typeof a!=="undefined"?a:""),l=document.createElement("textarea"),n=0;l.style.display="block";l.style.padding="2px";l.style.height="100%";l.style.width="100%";l.style.boxSizing="border-box";l.style.whiteSpace="pre-wrap";l.style.resize="none";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);l.setAttribute(t,l.getAttribute(t)+r.elementAttributes["+"+t])}else{l.setAttribute(t,r.elementAttributes[t])}}}l.value=h;i((function(){if(t.getType()==="cell"){l.focus({preventScroll:true});l.style.height="100%";l.style.height=l.scrollHeight+"px";t.getRow().normalizeHeight();if(r.selectContents){l.select()}}}));function u(i){if((a===null||typeof a==="undefined")&&l.value!==""||l.value!==a){if(e(l.value)){a=l.value}setTimeout((function(){t.getRow().normalizeHeight()}),300)}else{s()}}l.addEventListener("change",u);l.addEventListener("blur",u);l.addEventListener("keyup",(function(){l.style.height="";var i=l.scrollHeight;l.style.height=i+"px";if(i!=n){n=i;t.getRow().normalizeHeight()}}));l.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:if(t.shiftKey&&r.shiftEnterSubmit){u()}break;case 27:s();break;case 38:if(o=="editor"||o=="hybrid"&&l.selectionStart){t.stopImmediatePropagation();t.stopPropagation()}break;case 40:if(o=="editor"||o=="hybrid"&&l.selectionStart!==l.value.length){t.stopImmediatePropagation();t.stopPropagation()}break;case 35:case 36:t.stopPropagation();break}}));if(r.mask){ut(l,r)}return l}function dt(t,i,e,s,r){var a=t.getValue(),o=r.verticalNavigation||"editor",h=document.createElement("input");h.setAttribute("type","number");if(typeof r.max!="undefined"){h.setAttribute("max",r.max)}if(typeof r.min!="undefined"){h.setAttribute("min",r.min)}if(typeof r.step!="undefined"){h.setAttribute("step",r.step)}h.style.padding="4px";h.style.width="100%";h.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);h.setAttribute(t,h.getAttribute(t)+r.elementAttributes["+"+t])}else{h.setAttribute(t,r.elementAttributes[t])}}}h.value=a;var l=function(t){n()};i((function(){if(t.getType()==="cell"){h.removeEventListener("blur",l);h.focus({preventScroll:true});h.style.height="100%";h.addEventListener("blur",l);if(r.selectContents){h.select()}}}));function n(){var t=h.value;if(!isNaN(t)&&t!==""){t=Number(t)}if(t!==a){if(e(t)){a=t}}else{s()}}h.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:n();break;case 27:s();break;case 38:case 40:if(o=="editor"){t.stopImmediatePropagation();t.stopPropagation()}break;case 35:case 36:t.stopPropagation();break}}));if(r.mask){ut(h,r)}return h}function bt(t,i,e,s,r){var a=t.getValue(),o=document.createElement("input");o.setAttribute("type","range");if(typeof r.max!="undefined"){o.setAttribute("max",r.max)}if(typeof r.min!="undefined"){o.setAttribute("min",r.min)}if(typeof r.step!="undefined"){o.setAttribute("step",r.step)}o.style.padding="4px";o.style.width="100%";o.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);o.setAttribute(t,o.getAttribute(t)+r.elementAttributes["+"+t])}else{o.setAttribute(t,r.elementAttributes[t])}}}o.value=a;i((function(){if(t.getType()==="cell"){o.focus({preventScroll:true});o.style.height="100%"}}));function h(){var t=o.value;if(!isNaN(t)&&t!==""){t=Number(t)}if(t!=a){if(e(t)){a=t}}else{s()}}o.addEventListener("blur",(function(t){h()}));o.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:h();break;case 27:s();break}}));return o}function pt(t,i,e,s,r){var a=r.format,o=r.verticalNavigation||"editor",h=a?window.DateTime||luxon.DateTime:null;var l=t.getValue(),n=document.createElement("input");function u(t){var i;if(h.isDateTime(t)){i=t}else if(a==="iso"){i=h.fromISO(String(t))}else{i=h.fromFormat(String(t),a)}return i.toFormat("yyyy-MM-dd")}n.type="date";n.style.padding="4px";n.style.width="100%";n.style.boxSizing="border-box";if(r.max){n.setAttribute("max",a?u(r.max):r.max)}if(r.min){n.setAttribute("min",a?u(r.min):r.min)}if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);n.setAttribute(t,n.getAttribute(t)+r.elementAttributes["+"+t])}else{n.setAttribute(t,r.elementAttributes[t])}}}l=typeof l!=="undefined"?l:"";if(a){if(h){l=u(l)}else{console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")}}n.value=l;i((function(){if(t.getType()==="cell"){n.focus({preventScroll:true});n.style.height="100%";if(r.selectContents){n.select()}}}));function f(){var t=n.value,i;if((l===null||typeof l==="undefined")&&t!==""||t!==l){if(t&&a){i=h.fromFormat(String(t),"yyyy-MM-dd");switch(a){case true:t=i;break;case"iso":t=i.toISO();break;default:t=i.toFormat(a)}}if(e(t)){l=n.value}}else{s()}}n.addEventListener("blur",(function(t){if(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==n){f()}}));n.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:f();break;case 27:s();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:if(o=="editor"){t.stopImmediatePropagation();t.stopPropagation()}break}}));return n}function mt(t,i,e,s,r){var a=r.format,o=r.verticalNavigation||"editor",h=a?window.DateTime||luxon.DateTime:null,l;var n=t.getValue(),u=document.createElement("input");u.type="time";u.style.padding="4px";u.style.width="100%";u.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);u.setAttribute(t,u.getAttribute(t)+r.elementAttributes["+"+t])}else{u.setAttribute(t,r.elementAttributes[t])}}}n=typeof n!=="undefined"?n:"";if(a){if(h){if(h.isDateTime(n)){l=n}else if(a==="iso"){l=h.fromISO(String(n))}else{l=h.fromFormat(String(n),a)}n=l.toFormat("HH:mm")}else{console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")}}u.value=n;i((function(){if(t.getType()=="cell"){u.focus({preventScroll:true});u.style.height="100%";if(r.selectContents){u.select()}}}));function f(){var t=u.value,i;if((n===null||typeof n==="undefined")&&t!==""||t!==n){if(t&&a){i=h.fromFormat(String(t),"hh:mm");switch(a){case true:t=i;break;case"iso":t=i.toISO();break;default:t=i.toFormat(a)}}if(e(t)){n=u.value}}else{s()}}u.addEventListener("blur",(function(t){if(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==u){f()}}));u.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:f();break;case 27:s();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:if(o=="editor"){t.stopImmediatePropagation();t.stopPropagation()}break}}));return u}function gt(t,i,e,s,r){var a=r.format,o=r.verticalNavigation||"editor",h=a?this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime"):null,l;var n=t.getValue(),u=document.createElement("input");u.type="datetime-local";u.style.padding="4px";u.style.width="100%";u.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);u.setAttribute(t,u.getAttribute(t)+r.elementAttributes["+"+t])}else{u.setAttribute(t,r.elementAttributes[t])}}}n=typeof n!=="undefined"?n:"";if(a){if(h){if(h.isDateTime(n)){l=n}else if(a==="iso"){l=h.fromISO(String(n))}else{l=h.fromFormat(String(n),a)}n=l.toFormat("yyyy-MM-dd")+"T"+l.toFormat("HH:mm")}else{console.error("Editor Error - 'date' editor 'format' param is dependant on luxon.js")}}u.value=n;i((function(){if(t.getType()==="cell"){u.focus({preventScroll:true});u.style.height="100%";if(r.selectContents){u.select()}}}));function f(){var t=u.value,i;if((n===null||typeof n==="undefined")&&t!==""||t!==n){if(t&&a){i=h.fromISO(String(t));switch(a){case true:t=i;break;case"iso":t=i.toISO();break;default:t=i.toFormat(a)}}if(e(t)){n=u.value}}else{s()}}u.addEventListener("blur",(function(t){if(t.relatedTarget||t.rangeParent||t.explicitOriginalTarget!==u){f()}}));u.addEventListener("keydown",(function(t){switch(t.keyCode){case 13:f();break;case 27:s();break;case 35:case 36:t.stopPropagation();break;case 38:case 40:if(o=="editor"){t.stopImmediatePropagation();t.stopPropagation()}break}}));return u}let vt=class t{constructor(t,i,e,s,r,a){this.edit=t;this.table=t.table;this.cell=i;this.params=this._initializeParams(a);this.data=[];this.displayItems=[];this.currentItems=[];this.focusedItem=null;this.input=this._createInputElement();this.listEl=this._createListElement();this.initialValues=null;this.isFilter=i.getType()==="header";this.filterTimeout=null;this.filtered=false;this.typing=false;this.values=[];this.popup=null;this.listIteration=0;this.lastAction="";this.filterTerm="";this.blurable=true;this.actions={success:s,cancel:r};this._deprecatedOptionsCheck();this._initializeValue();e(this._onRendered.bind(this))}_deprecatedOptionsCheck(){}_initializeValue(){var t=this.cell.getValue();if(typeof t==="undefined"&&typeof this.params.defaultValue!=="undefined"){t=this.params.defaultValue}this.initialValues=this.params.multiselect?t:[t];if(this.isFilter){this.input.value=this.initialValues?this.initialValues.join(","):"";this.headerFilterInitialListGen()}}_onRendered(){var t=this.cell.getElement();function i(t){t.stopPropagation()}if(!this.isFilter){this.input.style.height="100%";this.input.focus({preventScroll:true})}t.addEventListener("click",i);setTimeout((()=>{t.removeEventListener("click",i)}),1e3);this.input.addEventListener("mousedown",this._preventPopupBlur.bind(this))}_createListElement(){var t=document.createElement("div");t.classList.add("tabulator-edit-list");t.addEventListener("mousedown",this._preventBlur.bind(this));t.addEventListener("keydown",this._inputKeyDown.bind(this));return t}_setListWidth(){var t=this.isFilter?this.input:this.cell.getElement();this.listEl.style.minWidth=t.offsetWidth+"px";if(this.params.maxWidth){if(this.params.maxWidth===true){this.listEl.style.maxWidth=t.offsetWidth+"px"}else if(typeof this.params.maxWidth==="number"){this.listEl.style.maxWidth=this.params.maxWidth+"px"}else{this.listEl.style.maxWidth=this.params.maxWidth}}}_createInputElement(){var t=this.params.elementAttributes;var i=document.createElement("input");i.setAttribute("type",this.params.clearable?"search":"text");i.style.padding="4px";i.style.width="100%";i.style.boxSizing="border-box";if(!this.params.autocomplete){i.style.cursor="default";i.style.caretColor="transparent"}if(t&&typeof t=="object"){for(let e in t){if(e.charAt(0)=="+"){e=e.slice(1);i.setAttribute(e,i.getAttribute(e)+t["+"+e])}else{i.setAttribute(e,t[e])}}}if(this.params.mask){ut(i,this.params)}this._bindInputEvents(i);return i}_initializeParams(t){var i=["values","valuesURL","valuesLookup"],e;t=Object.assign({},t);t.verticalNavigation=t.verticalNavigation||"editor";t.placeholderLoading=typeof t.placeholderLoading==="undefined"?"Searching ...":t.placeholderLoading;t.placeholderEmpty=typeof t.placeholderEmpty==="undefined"?"No Results Found":t.placeholderEmpty;t.filterDelay=typeof t.filterDelay==="undefined"?300:t.filterDelay;t.emptyValue=Object.keys(t).includes("emptyValue")?t.emptyValue:"";e=Object.keys(t).filter((t=>i.includes(t))).length;if(!e){console.warn("list editor config error - either the values, valuesURL, or valuesLookup option must be set")}else if(e>1){console.warn("list editor config error - only one of the values, valuesURL, or valuesLookup options can be set on the same editor")}if(t.autocomplete){if(t.multiselect){t.multiselect=false;console.warn("list editor config error - multiselect option is not available when autocomplete is enabled")}}else{if(t.freetext){t.freetext=false;console.warn("list editor config error - freetext option is only available when autocomplete is enabled")}if(t.filterFunc){t.filterFunc=false;console.warn("list editor config error - filterFunc option is only available when autocomplete is enabled")}if(t.filterRemote){t.filterRemote=false;console.warn("list editor config error - filterRemote option is only available when autocomplete is enabled")}if(t.mask){t.mask=false;console.warn("list editor config error - mask option is only available when autocomplete is enabled")}if(t.allowEmpty){t.allowEmpty=false;console.warn("list editor config error - allowEmpty option is only available when autocomplete is enabled")}if(t.listOnEmpty){t.listOnEmpty=false;console.warn("list editor config error - listOnEmpty option is only available when autocomplete is enabled")}}if(t.filterRemote&&!(typeof t.valuesLookup==="function"||t.valuesURL)){t.filterRemote=false;console.warn("list editor config error - filterRemote option should only be used when values list is populated from a remote source")}return t}_bindInputEvents(t){t.addEventListener("focus",this._inputFocus.bind(this));t.addEventListener("click",this._inputClick.bind(this));t.addEventListener("blur",this._inputBlur.bind(this));t.addEventListener("keydown",this._inputKeyDown.bind(this));t.addEventListener("search",this._inputSearch.bind(this));if(this.params.autocomplete){t.addEventListener("keyup",this._inputKeyUp.bind(this))}}_inputFocus(t){this.rebuildOptionsList()}_filter(){if(this.params.filterRemote){clearTimeout(this.filterTimeout);this.filterTimeout=setTimeout((()=>{this.rebuildOptionsList()}),this.params.filterDelay)}else{this._filterList()}}_inputClick(t){t.stopPropagation()}_inputBlur(t){if(this.blurable){if(this.popup){this.popup.hide()}else{this._resolveValue(true)}}}_inputSearch(){this._clearChoices()}_inputKeyDown(t){switch(t.keyCode){case 38:this._keyUp(t);break;case 40:this._keyDown(t);break;case 37:case 39:this._keySide(t);break;case 13:this._keyEnter();break;case 27:this._keyEsc();break;case 36:case 35:this._keyHomeEnd(t);break;case 9:this._keyTab(t);break;default:this._keySelectLetter(t)}}_inputKeyUp(t){switch(t.keyCode){case 38:case 37:case 39:case 40:case 13:case 27:break;default:this._keyAutoCompLetter(t)}}_preventPopupBlur(){if(this.popup){this.popup.blockHide()}setTimeout((()=>{if(this.popup){this.popup.restoreHide()}}),10)}_preventBlur(){this.blurable=false;setTimeout((()=>{this.blurable=true}),10)}_keyTab(t){if(this.params.autocomplete&&this.lastAction==="typing"){this._resolveValue(true)}else{if(this.focusedItem){this._chooseItem(this.focusedItem,true)}}}_keyUp(t){var i=this.displayItems.indexOf(this.focusedItem);if(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&i){t.stopImmediatePropagation();t.stopPropagation();t.preventDefault();if(i>0){this._focusItem(this.displayItems[i-1])}}}_keyDown(t){var i=this.displayItems.indexOf(this.focusedItem);if(this.params.verticalNavigation=="editor"||this.params.verticalNavigation=="hybrid"&&i<this.displayItems.length-1){t.stopImmediatePropagation();t.stopPropagation();t.preventDefault();if(i<this.displayItems.length-1){if(i==-1){this._focusItem(this.displayItems[0])}else{this._focusItem(this.displayItems[i+1])}}}}_keySide(t){if(!this.params.autocomplete){t.stopImmediatePropagation();t.stopPropagation();t.preventDefault()}}_keyEnter(t){if(this.params.autocomplete&&this.lastAction==="typing"){this._resolveValue(true)}else{if(this.focusedItem){this._chooseItem(this.focusedItem)}}}_keyEsc(t){this._cancel()}_keyHomeEnd(t){if(this.params.autocomplete){t.stopImmediatePropagation()}}_keySelectLetter(t){if(!this.params.autocomplete){t.preventDefault();if(t.keyCode>=38&&t.keyCode<=90){this._scrollToValue(t.keyCode)}}}_keyAutoCompLetter(t){this._filter();this.lastAction="typing";this.typing=true}_scrollToValue(t){clearTimeout(this.filterTimeout);var i=String.fromCharCode(t).toLowerCase();this.filterTerm+=i.toLowerCase();var e=this.displayItems.find((t=>typeof t.label!=="undefined"&&t.label.toLowerCase().startsWith(this.filterTerm)));if(e){this._focusItem(e)}this.filterTimeout=setTimeout((()=>{this.filterTerm=""}),800)}_focusItem(t){this.lastAction="focus";if(this.focusedItem&&this.focusedItem.element){this.focusedItem.element.classList.remove("focused")}this.focusedItem=t;if(t&&t.element){t.element.classList.add("focused");t.element.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})}}headerFilterInitialListGen(){this._generateOptions(true)}rebuildOptionsList(){this._generateOptions().then(this._sortOptions.bind(this)).then(this._buildList.bind(this)).then(this._showList.bind(this)).catch((t=>{if(!Number.isInteger(t)){console.error("List generation error",t)}}))}_filterList(){this._buildList(this._filterOptions());this._showList()}_generateOptions(t){var i=[];var e=++this.listIteration;this.filtered=false;if(this.params.values){i=this.params.values}else if(this.params.valuesURL){i=this._ajaxRequest(this.params.valuesURL,this.input.value)}else{if(typeof this.params.valuesLookup==="function"){i=this.params.valuesLookup(this.cell,this.input.value)}else if(this.params.valuesLookup){i=this._uniqueColumnValues(this.params.valuesLookupField)}}if(i instanceof Promise){if(!t){this._addPlaceholder(this.params.placeholderLoading)}return i.then().then((t=>{if(this.listIteration===e){return this._parseList(t)}else{return Promise.reject(e)}}))}else{return Promise.resolve(this._parseList(i))}}_addPlaceholder(t){var i=document.createElement("div");if(typeof t==="function"){t=t(this.cell.getComponent(),this.listEl)}if(t){this._clearList();if(t instanceof HTMLElement){i=t}else{i.classList.add("tabulator-edit-list-placeholder");i.innerHTML=t}this.listEl.appendChild(i);this._showList()}}_ajaxRequest(t,i){var e=this.params.filterRemote?{term:i}:{};t=N(t,{},e);return fetch(t).then((t=>{if(t.ok){return t.json().catch((t=>{console.warn("List Ajax Load Error - Invalid JSON returned",t);return Promise.reject(t)}))}else{console.error("List Ajax Load Error - Connection Error: "+t.status,t.statusText);return Promise.reject(t)}})).catch((t=>{console.error("List Ajax Load Error - Connection Error: ",t);return Promise.reject(t)}))}_uniqueColumnValues(t){var i={},e=this.table.getData(this.params.valuesLookup),s;if(t){s=this.table.columnManager.getColumnByField(t)}else{s=this.cell.getColumn()._getSelf()}if(s){e.forEach((t=>{var e=s.getFieldValue(t);if(!this._emptyValueCheck(e)){if(this.params.multiselect&&Array.isArray(e)){e.forEach((t=>{if(!this._emptyValueCheck(t)){i[t]=true}}))}else{i[e]=true}}}))}else{console.warn("unable to find matching column to create select lookup list:",t);i=[]}return Object.keys(i)}_emptyValueCheck(t){return t===null||typeof t==="undefined"||t===""}_parseList(t){var i=[];if(!Array.isArray(t)){t=Object.entries(t).map((([t,i])=>({label:i,value:t})))}t.forEach((t=>{if(typeof t!=="object"){t={label:t,value:t}}this._parseListItem(t,i,0)}));if(!this.currentItems.length&&this.params.freetext){this.input.value=this.initialValues;this.typing=true;this.lastAction="typing"}this.data=i;return i}_parseListItem(t,i,e){var s={};if(t.options){s=this._parseListGroup(t,e+1)}else{s={label:t.label,value:t.value,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:false,selected:false,visible:true,level:e,original:t};if(this.initialValues&&this.initialValues.indexOf(t.value)>-1){this._chooseItem(s,true)}}i.push(s)}_parseListGroup(t,i){var e={label:t.label,group:true,itemParams:t.itemParams,elementAttributes:t.elementAttributes,element:false,visible:true,level:i,options:[],original:t};t.options.forEach((t=>{this._parseListItem(t,e.options,i)}));return e}_sortOptions(t){var i;if(this.params.sort){i=typeof this.params.sort==="function"?this.params.sort:this._defaultSortFunction.bind(this);this._sortGroup(i,t)}return t}_sortGroup(t,i){i.sort(((i,e)=>t(i.label,e.label,i.value,e.value,i.original,e.original)));i.forEach((i=>{if(i.group){this._sortGroup(t,i.options)}}))}_defaultSortFunction(t,i){var e,s,r,a,o=0,h,l=/(\d+)|(\D+)/g,n=/\d/;var u=0;if(this.params.sort==="desc"){[t,i]=[i,t]}if(!t&&t!==0){u=!i&&i!==0?0:-1}else if(!i&&i!==0){u=1}else{if(isFinite(t)&&isFinite(i))return t-i;e=String(t).toLowerCase();s=String(i).toLowerCase();if(e===s)return 0;if(!(n.test(e)&&n.test(s)))return e>s?1:-1;e=e.match(l);s=s.match(l);h=e.length>s.length?s.length:e.length;while(o<h){r=e[o];a=s[o++];if(r!==a){if(isFinite(r)&&isFinite(a)){if(r.charAt(0)==="0")r="."+r;if(a.charAt(0)==="0")a="."+a;return r-a}else return r>a?1:-1}}return e.length>s.length}return u}_filterOptions(){var t=this.params.filterFunc||this._defaultFilterFunc,i=this.input.value;if(i){this.filtered=true;this.data.forEach((e=>{this._filterItem(t,i,e)}))}else{this.filtered=false}return this.data}_filterItem(t,i,e){var s=false;if(!e.group){e.visible=t(i,e.label,e.value,e.original)}else{e.options.forEach((e=>{if(this._filterItem(t,i,e)){s=true}}));e.visible=s}return e.visible}_defaultFilterFunc(t,i,e,s){t=String(t).toLowerCase();if(i!==null&&typeof i!=="undefined"){if(String(i).toLowerCase().indexOf(t)>-1||String(e).toLowerCase().indexOf(t)>-1){return true}}return false}_clearList(){while(this.listEl.firstChild)this.listEl.removeChild(this.listEl.firstChild);this.displayItems=[]}_buildList(t){this._clearList();t.forEach((t=>{this._buildItem(t)}));if(!this.displayItems.length){this._addPlaceholder(this.params.placeholderEmpty)}}_buildItem(t){var i=t.element,e;if(!this.filtered||t.visible){if(!i){i=document.createElement("div");i.tabIndex=0;e=this.params.itemFormatter?this.params.itemFormatter(t.label,t.value,t.original,i):t.label;if(e instanceof HTMLElement){i.appendChild(e)}else{i.innerHTML=e}if(t.group){i.classList.add("tabulator-edit-list-group")}else{i.classList.add("tabulator-edit-list-item")}i.classList.add("tabulator-edit-list-group-level-"+t.level);if(t.elementAttributes&&typeof t.elementAttributes=="object"){for(let e in t.elementAttributes){if(e.charAt(0)=="+"){e=e.slice(1);i.setAttribute(e,this.input.getAttribute(e)+t.elementAttributes["+"+e])}else{i.setAttribute(e,t.elementAttributes[e])}}}if(t.group){i.addEventListener("click",this._groupClick.bind(this,t))}else{i.addEventListener("click",this._itemClick.bind(this,t))}i.addEventListener("mousedown",this._preventBlur.bind(this));t.element=i}this._styleItem(t);this.listEl.appendChild(i);if(t.group){t.options.forEach((t=>{this._buildItem(t)}))}else{this.displayItems.push(t)}}}_showList(){var t=this.popup&&this.popup.isVisible();if(this.input.parentNode){if(this.params.autocomplete&&this.input.value===""&&!this.params.listOnEmpty){if(this.popup){this.popup.hide(true)}return}this._setListWidth();if(!this.popup){this.popup=this.edit.popup(this.listEl)}this.popup.show(this.cell.getElement(),"bottom");if(!t){setTimeout((()=>{this.popup.hideOnBlur(this._resolveValue.bind(this,true))}),10)}}}_styleItem(t){if(t&&t.element){if(t.selected){t.element.classList.add("active")}else{t.element.classList.remove("active")}}}_itemClick(t,i){i.stopPropagation();this._chooseItem(t)}_groupClick(t,i){i.stopPropagation()}_cancel(){this.popup.hide(true);this.actions.cancel()}_clearChoices(){this.typing=true;this.currentItems.forEach((t=>{t.selected=false;this._styleItem(t)}));this.currentItems=[];this.focusedItem=null}_chooseItem(t,i){var e;this.typing=false;if(this.params.multiselect){e=this.currentItems.indexOf(t);if(e>-1){this.currentItems.splice(e,1);t.selected=false}else{this.currentItems.push(t);t.selected=true}this.input.value=this.currentItems.map((t=>t.label)).join(",");this._styleItem(t)}else{this.currentItems=[t];t.selected=true;this.input.value=t.label;this._styleItem(t);if(!i){this._resolveValue()}}this._focusItem(t)}_resolveValue(t){var i,e;if(this.popup){this.popup.hide(true)}if(this.params.multiselect){i=this.currentItems.map((t=>t.value))}else{if(t&&this.params.autocomplete&&this.typing){if(this.params.freetext||this.params.allowEmpty&&this.input.value===""){i=this.input.value}else{this.actions.cancel();return}}else{if(this.currentItems[0]){i=this.currentItems[0].value}else{e=Array.isArray(this.initialValues)?this.initialValues[0]:this.initialValues;if(e===null||typeof e==="undefined"||e===""){i=e}else{i=this.params.emptyValue}}}}if(i===""){i=this.params.emptyValue}this.actions.success(i);if(this.isFilter){this.initialValues=i&&!Array.isArray(i)?[i]:i;this.currentItems=[]}}};function wt(t,i,e,s,r){var a=new vt(this,t,i,e,s,r);return a.input}function yt(t,i,e,s,r){var a=this,o=t.getElement(),h=t.getValue(),l=o.getElementsByTagName("svg").length||5,n=o.getElementsByTagName("svg")[0]?o.getElementsByTagName("svg")[0].getAttribute("width"):14,u=[],f=document.createElement("div"),c=document.createElementNS("http://www.w3.org/2000/svg","svg");function d(t){u.forEach((function(i,e){if(e<t){if(a.table.browser=="ie"){i.setAttribute("class","tabulator-star-active")}else{i.classList.replace("tabulator-star-inactive","tabulator-star-active")}i.innerHTML='<polygon fill="#488CE9" stroke="#014AAE" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'}else{if(a.table.browser=="ie"){i.setAttribute("class","tabulator-star-inactive")}else{i.classList.replace("tabulator-star-active","tabulator-star-inactive")}i.innerHTML='<polygon fill="#010155" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>'}}))}function b(t){var i=document.createElement("span");var s=c.cloneNode(true);u.push(s);i.addEventListener("mouseenter",(function(i){i.stopPropagation();i.stopImmediatePropagation();d(t)}));i.addEventListener("mousemove",(function(t){t.stopPropagation();t.stopImmediatePropagation()}));i.addEventListener("click",(function(i){i.stopPropagation();i.stopImmediatePropagation();e(t);o.blur()}));i.appendChild(s);f.appendChild(i)}function p(t){h=t;d(t)}o.style.whiteSpace="nowrap";o.style.overflow="hidden";o.style.textOverflow="ellipsis";f.style.verticalAlign="middle";f.style.display="inline-block";f.style.padding="4px";c.setAttribute("width",n);c.setAttribute("height",n);c.setAttribute("viewBox","0 0 512 512");c.setAttribute("xml:space","preserve");c.style.padding="0 1px";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);f.setAttribute(t,f.getAttribute(t)+r.elementAttributes["+"+t])}else{f.setAttribute(t,r.elementAttributes[t])}}}for(var m=1;m<=l;m++){b(m)}h=Math.min(parseInt(h),l);d(h);f.addEventListener("mousemove",(function(t){d(0)}));f.addEventListener("click",(function(t){e(0)}));o.addEventListener("blur",(function(t){s()}));o.addEventListener("keydown",(function(t){switch(t.keyCode){case 39:p(h+1);break;case 37:p(h-1);break;case 13:e(h);break;case 27:s();break}}));return f}function xt(t,i,e,s,r){var a=t.getElement(),o=typeof r.max==="undefined"?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("max")||100:r.max,h=typeof r.min==="undefined"?a.getElementsByTagName("div")[0]&&a.getElementsByTagName("div")[0].getAttribute("min")||0:r.min,l=(o-h)/100,n=t.getValue()||0,u=document.createElement("div"),f=document.createElement("div"),c,d;function b(){var t=window.getComputedStyle(a,null);var i=l*Math.round(f.offsetWidth/((a.clientWidth-parseInt(t.getPropertyValue("padding-left"))-parseInt(t.getPropertyValue("padding-right")))/100))+h;e(i);a.setAttribute("aria-valuenow",i);a.setAttribute("aria-label",n)}u.style.position="absolute";u.style.right="0";u.style.top="0";u.style.bottom="0";u.style.width="5px";u.classList.add("tabulator-progress-handle");f.style.display="inline-block";f.style.position="relative";f.style.height="100%";f.style.backgroundColor="#488CE9";f.style.maxWidth="100%";f.style.minWidth="0%";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);f.setAttribute(t,f.getAttribute(t)+r.elementAttributes["+"+t])}else{f.setAttribute(t,r.elementAttributes[t])}}}a.style.padding="4px 4px";n=Math.min(parseFloat(n),o);n=Math.max(parseFloat(n),h);n=Math.round((n-h)/l);f.style.width=n+"%";a.setAttribute("aria-valuemin",h);a.setAttribute("aria-valuemax",o);f.appendChild(u);u.addEventListener("mousedown",(function(t){c=t.screenX;d=f.offsetWidth}));u.addEventListener("mouseover",(function(){u.style.cursor="ew-resize"}));a.addEventListener("mousemove",(function(t){if(c){f.style.width=d+t.screenX-c+"px"}}));a.addEventListener("mouseup",(function(t){if(c){t.stopPropagation();t.stopImmediatePropagation();c=false;d=false;b()}}));a.addEventListener("keydown",(function(t){switch(t.keyCode){case 39:t.preventDefault();f.style.width=f.clientWidth+a.clientWidth/100+"px";break;case 37:t.preventDefault();f.style.width=f.clientWidth-a.clientWidth/100+"px";break;case 9:case 13:b();break;case 27:s();break}}));a.addEventListener("blur",(function(){s()}));return f}function kt(t,i,e,s,r){var a=t.getValue(),o=document.createElement("input"),h=r.tristate,l=typeof r.indeterminateValue==="undefined"?null:r.indeterminateValue,n=false,u=Object.keys(r).includes("trueValue"),f=Object.keys(r).includes("falseValue");o.setAttribute("type","checkbox");o.style.marginTop="5px";o.style.boxSizing="border-box";if(r.elementAttributes&&typeof r.elementAttributes=="object"){for(let t in r.elementAttributes){if(t.charAt(0)=="+"){t=t.slice(1);o.setAttribute(t,o.getAttribute(t)+r.elementAttributes["+"+t])}else{o.setAttribute(t,r.elementAttributes[t])}}}o.value=a;if(h&&(typeof a==="undefined"||a===l||a==="")){n=true;o.indeterminate=true}if(this.table.browser!="firefox"&&this.table.browser!="safari"){i((function(){if(t.getType()==="cell"){o.focus({preventScroll:true})}}))}o.checked=u?a===r.trueValue:a===true||a==="true"||a==="True"||a===1;function c(t){var i=o.checked;if(u&&i){i=r.trueValue}else if(f&&!i){i=r.falseValue}if(h){if(!t){if(o.checked&&!n){o.checked=false;o.indeterminate=true;n=true;return l}else{n=false;return i}}else{if(n){return l}else{return i}}}else{return i}}o.addEventListener("change",(function(t){e(c())}));o.addEventListener("blur",(function(t){e(c(true))}));o.addEventListener("keydown",(function(t){if(t.keyCode==13){e(c())}if(t.keyCode==27){s()}}));return o}function Ct(t,i,e,s,r){var a=t._getSelf().column,o,h,l;function n(t){var i=t.getValue(),e="input";switch(typeof i){case"number":e="number";break;case"boolean":e="tickCross";break;case"string":if(i.includes("\n")){e="textarea"}break}return e}o=r.editorLookup?r.editorLookup(t):n(t);if(r.paramsLookup){l=typeof r.paramsLookup==="function"?r.paramsLookup(o,t):r.paramsLookup[o]}h=this.table.modules.edit.lookupEditor(o,a);return h.call(this,t,i,e,s,l||{})}var Rt={input:ft,textarea:ct,number:dt,range:bt,date:pt,time:mt,datetime:gt,list:wt,star:yt,progress:xt,tickCross:kt,adaptable:Ct};class Et extends S{static moduleName="edit";static editors=Rt;constructor(t){super(t);this.currentCell=false;this.mouseClick=false;this.recursionBlock=false;this.invalidEdit=false;this.editedCells=[];this.convertEmptyValues=false;this.editors=Et.editors;this.registerTableOption("editTriggerEvent","focus");this.registerTableOption("editorEmptyValue");this.registerTableOption("editorEmptyValueFunc",this.emptyValueCheck.bind(this));this.registerColumnOption("editable");this.registerColumnOption("editor");this.registerColumnOption("editorParams");this.registerColumnOption("editorEmptyValue");this.registerColumnOption("editorEmptyValueFunc");this.registerColumnOption("cellEditing");this.registerColumnOption("cellEdited");this.registerColumnOption("cellEditCancelled");this.registerTableFunction("getEditedCells",this.getEditedCells.bind(this));this.registerTableFunction("clearCellEdited",this.clearCellEdited.bind(this));this.registerTableFunction("navigatePrev",this.navigatePrev.bind(this));this.registerTableFunction("navigateNext",this.navigateNext.bind(this));this.registerTableFunction("navigateLeft",this.navigateLeft.bind(this));this.registerTableFunction("navigateRight",this.navigateRight.bind(this));this.registerTableFunction("navigateUp",this.navigateUp.bind(this));this.registerTableFunction("navigateDown",this.navigateDown.bind(this));this.registerComponentFunction("cell","isEdited",this.cellIsEdited.bind(this));this.registerComponentFunction("cell","clearEdited",this.clearEdited.bind(this));this.registerComponentFunction("cell","edit",this.editCell.bind(this));this.registerComponentFunction("cell","cancelEdit",this.cellCancelEdit.bind(this));this.registerComponentFunction("cell","navigatePrev",this.navigatePrev.bind(this));this.registerComponentFunction("cell","navigateNext",this.navigateNext.bind(this));this.registerComponentFunction("cell","navigateLeft",this.navigateLeft.bind(this));this.registerComponentFunction("cell","navigateRight",this.navigateRight.bind(this));this.registerComponentFunction("cell","navigateUp",this.navigateUp.bind(this));this.registerComponentFunction("cell","navigateDown",this.navigateDown.bind(this))}initialize(){this.subscribe("cell-init",this.bindEditor.bind(this));this.subscribe("cell-delete",this.clearEdited.bind(this));this.subscribe("cell-value-changed",this.updateCellClass.bind(this));this.subscribe("column-layout",this.initializeColumnCheck.bind(this));this.subscribe("column-delete",this.columnDeleteCheck.bind(this));this.subscribe("row-deleting",this.rowDeleteCheck.bind(this));this.subscribe("row-layout",this.rowEditableCheck.bind(this));this.subscribe("data-refreshing",this.cancelEdit.bind(this));this.subscribe("clipboard-paste",this.pasteBlocker.bind(this));this.subscribe("keybinding-nav-prev",this.navigatePrev.bind(this,undefined));this.subscribe("keybinding-nav-next",this.keybindingNavigateNext.bind(this));this.subscribe("keybinding-nav-up",this.navigateUp.bind(this,undefined));this.subscribe("keybinding-nav-down",this.navigateDown.bind(this,undefined));if(Object.keys(this.table.options).includes("editorEmptyValue")){this.convertEmptyValues=true}}pasteBlocker(t){if(this.currentCell){return true}}keybindingNavigateNext(t){var i=this.currentCell,e=this.options("tabEndNewRow");if(i){if(!this.navigateNext(i,t)){if(e){i.getElement().firstChild.blur();if(!this.invalidEdit){if(e===true){e=this.table.addRow({})}else{if(typeof e=="function"){e=this.table.addRow(e(i.row.getComponent()))}else{e=this.table.addRow(Object.assign({},e))}}e.then((()=>{setTimeout((()=>{i.getComponent().navigateNext()}))}))}}}}}cellIsEdited(t){return!!t.modules.edit&&t.modules.edit.edited}cellCancelEdit(t){if(t===this.currentCell){this.table.modules.edit.cancelEdit()}else{console.warn("Cancel Editor Error - This cell is not currently being edited ")}}updateCellClass(t){if(this.allowEdit(t)){t.getElement().classList.add("tabulator-editable")}else{t.getElement().classList.remove("tabulator-editable")}}clearCellEdited(t){if(!t){t=this.table.modules.edit.getEditedCells()}if(!Array.isArray(t)){t=[t]}t.forEach((t=>{this.table.modules.edit.clearEdited(t._getSelf())}))}navigatePrev(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=this.navigateLeft();if(e){return true}else{s=this.table.rowManager.prevDisplayRow(t.row,true);if(s){e=this.findPrevEditableCell(s,s.cells.length);if(e){e.getComponent().edit();return true}}}}return false}navigateNext(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=this.navigateRight();if(e){return true}else{s=this.table.rowManager.nextDisplayRow(t.row,true);if(s){e=this.findNextEditableCell(s,-1);if(e){e.getComponent().edit();return true}}}}return false}navigateLeft(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=t.getIndex();s=this.findPrevEditableCell(t.row,e);if(s){s.getComponent().edit();return true}}return false}navigateRight(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=t.getIndex();s=this.findNextEditableCell(t.row,e);if(s){s.getComponent().edit();return true}}return false}navigateUp(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=t.getIndex();s=this.table.rowManager.prevDisplayRow(t.row,true);if(s){s.cells[e].getComponent().edit();return true}}return false}navigateDown(t=this.currentCell,i){var e,s;if(t){if(i){i.preventDefault()}e=t.getIndex();s=this.table.rowManager.nextDisplayRow(t.row,true);if(s){s.cells[e].getComponent().edit();return true}}return false}findNextEditableCell(t,i){var e=false;if(i<t.cells.length-1){for(var s=i+1;s<t.cells.length;s++){let i=t.cells[s];if(i.column.modules.edit&&z.elVisible(i.getElement())){let t=this.allowEdit(i);if(t){e=i;break}}}}return e}findPrevEditableCell(t,i){var e=false;if(i>0){for(var s=i-1;s>=0;s--){let i=t.cells[s];if(i.column.modules.edit&&z.elVisible(i.getElement())){let t=this.allowEdit(i);if(t){e=i;break}}}}return e}initializeColumnCheck(t){if(typeof t.definition.editor!=="undefined"){this.initializeColumn(t)}}columnDeleteCheck(t){if(this.currentCell&&this.currentCell.column===t){this.cancelEdit()}}rowDeleteCheck(t){if(this.currentCell&&this.currentCell.row===t){this.cancelEdit()}}rowEditableCheck(t){t.getCells().forEach((t=>{if(t.column.modules.edit&&typeof t.column.modules.edit.check==="function"){this.updateCellClass(t)}}))}initializeColumn(t){var i=Object.keys(t.definition).includes("editorEmptyValue");var e={editor:false,blocked:false,check:t.definition.editable,params:t.definition.editorParams||{},convertEmptyValues:i,editorEmptyValue:t.definition.editorEmptyValue,editorEmptyValueFunc:t.definition.editorEmptyValueFunc};e.editor=this.lookupEditor(t.definition.editor,t);if(e.editor){t.modules.edit=e}}lookupEditor(t,i){var e;switch(typeof t){case"string":if(this.editors[t]){e=this.editors[t]}else{console.warn("Editor Error - No such editor found: ",t)}break;case"function":e=t;break;case"boolean":if(t===true){if(typeof i.definition.formatter!=="function"){if(this.editors[i.definition.formatter]){e=this.editors[i.definition.formatter]}else{e=this.editors["input"]}}else{console.warn("Editor Error - Cannot auto lookup editor for a custom formatter: ",i.definition.formatter)}}break}return e}getCurrentCell(){return this.currentCell?this.currentCell.getComponent():false}clearEditor(t){var i=this.currentCell,e;this.invalidEdit=false;if(i){this.currentCell=false;e=i.getElement();this.dispatch("edit-editor-clear",i,t);e.classList.remove("tabulator-editing");while(e.firstChild)e.removeChild(e.firstChild);i.row.getElement().classList.remove("tabulator-editing");i.table.element.classList.remove("tabulator-editing")}}cancelEdit(){if(this.currentCell){var t=this.currentCell;var i=this.currentCell.getComponent();this.clearEditor(true);t.setValueActual(t.getValue());t.cellRendered();if(t.column.definition.editor=="textarea"||t.column.definition.variableHeight){t.row.normalizeHeight(true)}if(t.column.definition.cellEditCancelled){t.column.definition.cellEditCancelled.call(this.table,i)}this.dispatch("edit-cancelled",t);this.dispatchExternal("cellEditCancelled",i)}}bindEditor(t){if(t.column.modules.edit){var i=this,e=t.getElement(true);this.updateCellClass(t);e.setAttribute("tabindex",0);e.addEventListener("mousedown",(function(t){if(t.button===2){t.preventDefault()}else{i.mouseClick=true}}));if(this.options("editTriggerEvent")==="dblclick"){e.addEventListener("dblclick",(function(s){if(!e.classList.contains("tabulator-editing")){e.focus({preventScroll:true});i.edit(t,s,false)}}))}if(this.options("editTriggerEvent")==="focus"||this.options("editTriggerEvent")==="click"){e.addEventListener("click",(function(s){if(!e.classList.contains("tabulator-editing")){e.focus({preventScroll:true});i.edit(t,s,false)}}))}if(this.options("editTriggerEvent")==="focus"){e.addEventListener("focus",(function(e){if(!i.recursionBlock){i.edit(t,e,false)}}))}}}focusCellNoEvent(t,i){this.recursionBlock=true;if(!(i&&this.table.browser==="ie")){t.getElement().focus({preventScroll:true})}this.recursionBlock=false}editCell(t,i){this.focusCellNoEvent(t);this.edit(t,false,i)}focusScrollAdjust(t){if(this.table.rowManager.getRenderMode()=="virtual"){var i=this.table.rowManager.element.scrollTop,e=this.table.rowManager.element.clientHeight+this.table.rowManager.element.scrollTop,s=t.row.getElement();if(s.offsetTop<i){this.table.rowManager.element.scrollTop-=i-s.offsetTop}else{if(s.offsetTop+s.offsetHeight>e){this.table.rowManager.element.scrollTop+=s.offsetTop+s.offsetHeight-e}}var r=this.table.rowManager.element.scrollLeft,a=this.table.rowManager.element.clientWidth+this.table.rowManager.element.scrollLeft,o=t.getElement();if(this.table.modExists("frozenColumns")){r+=parseInt(this.table.modules.frozenColumns.leftMargin||0);a-=parseInt(this.table.modules.frozenColumns.rightMargin||0)}if(this.table.options.renderHorizontal==="virtual"){r-=parseInt(this.table.columnManager.renderer.vDomPadLeft);a-=parseInt(this.table.columnManager.renderer.vDomPadLeft)}if(o.offsetLeft<r){this.table.rowManager.element.scrollLeft-=r-o.offsetLeft}else{if(o.offsetLeft+o.offsetWidth>a){this.table.rowManager.element.scrollLeft+=o.offsetLeft+o.offsetWidth-a}}}}allowEdit(t){var i=t.column.modules.edit?true:false;if(t.column.modules.edit){switch(typeof t.column.modules.edit.check){case"function":if(t.row.initialized){i=t.column.modules.edit.check(t.getComponent())}break;case"string":i=!!t.row.data[t.column.modules.edit.check];break;case"boolean":i=t.column.modules.edit.check;break}}return i}edit(t,i,e){var s=this,r=true,a=function(){},o=t.getElement(),h=false,l,n,u;if(this.currentCell){if(!this.invalidEdit&&this.currentCell!==t){this.cancelEdit()}return}function f(i){if(s.currentCell===t&&!h){var e=s.chain("edit-success",[t,i],true,true);if(e===true||s.table.options.validationMode==="highlight"){h=true;s.clearEditor();if(!t.modules.edit){t.modules.edit={}}t.modules.edit.edited=true;if(s.editedCells.indexOf(t)==-1){s.editedCells.push(t)}i=s.transformEmptyValues(i,t);t.setValue(i,true);return e===true}else{h=true;s.invalidEdit=true;s.focusCellNoEvent(t,true);a();setTimeout((()=>{h=false}),10);return false}}}function c(){if(s.currentCell===t&&!h){s.cancelEdit()}}function d(t){a=t}if(!t.column.modules.edit.blocked){if(i){i.stopPropagation()}r=this.allowEdit(t);if(r||e){s.cancelEdit();s.currentCell=t;this.focusScrollAdjust(t);n=t.getComponent();if(this.mouseClick){this.mouseClick=false;if(t.column.definition.cellClick){t.column.definition.cellClick.call(this.table,i,n)}}if(t.column.definition.cellEditing){t.column.definition.cellEditing.call(this.table,n)}this.dispatch("cell-editing",t);this.dispatchExternal("cellEditing",n);u=typeof t.column.modules.edit.params==="function"?t.column.modules.edit.params(n):t.column.modules.edit.params;l=t.column.modules.edit.editor.call(s,n,d,f,c,u);if(this.currentCell&&l!==false){if(l instanceof Node){o.classList.add("tabulator-editing");t.row.getElement().classList.add("tabulator-editing");t.table.element.classList.add("tabulator-editing");while(o.firstChild)o.removeChild(o.firstChild);o.appendChild(l);a();var b=o.children;for(var p=0;p<b.length;p++){b[p].addEventListener("click",(function(t){t.stopPropagation()}))}}else{console.warn("Edit Error - Editor should return an instance of Node, the editor returned:",l);this.blur(o);return false}}else{this.blur(o);return false}return true}else{this.mouseClick=false;this.blur(o);return false}}else{this.mouseClick=false;this.blur(o);return false}}emptyValueCheck(t){return t===""||t===null||typeof t==="undefined"}transformEmptyValues(t,i){var e=i.column.modules.edit,s=e.convertEmptyValues||this.convertEmptyValues,r;if(s){r=e.editorEmptyValueFunc||this.options("editorEmptyValueFunc");if(r&&r(t)){t=e.convertEmptyValues?e.editorEmptyValue:this.options("editorEmptyValue")}}return t}blur(t){if(!this.confirm("edit-blur",[t])){t.blur()}}getEditedCells(){var t=[];this.editedCells.forEach((i=>{t.push(i.getComponent())}));return t}clearEdited(t){var i;if(t.modules.edit&&t.modules.edit.edited){t.modules.edit.edited=false;this.dispatch("edit-edited-clear",t)}i=this.editedCells.indexOf(t);if(i>-1){this.editedCells.splice(i,1)}}}class zt{constructor(t,i,e,s){this.type=t;this.columns=i;this.component=e||false;this.indent=s||0}}class Mt{constructor(t,i,e,s,r){this.value=t;this.component=i||false;this.width=e;this.height=s;this.depth=r}}var St={};var Tt={visible:function(){return this.rowManager.getVisibleRows(false,true)},all:function(){return this.rowManager.rows},selected:function(){return this.modules.selectRow.selectedRows},active:function(){if(this.options.pagination){return this.rowManager.getDisplayRows(this.rowManager.displayRows.length-2)}else{return this.rowManager.getDisplayRows()}}};class Dt extends S{static moduleName="export";static columnLookups=St;static rowLookups=Tt;constructor(t){super(t);this.config={};this.cloneTableStyle=true;this.colVisProp="";this.colVisPropAttach="";this.registerTableOption("htmlOutputConfig",false);this.registerColumnOption("htmlOutput");this.registerColumnOption("titleHtmlOutput")}initialize(){this.registerTableFunction("getHtml",this.getHtml.bind(this))}generateExportList(t,i,e,s){var r,a,o,h;this.cloneTableStyle=i;this.config=t||{};this.colVisProp=s;this.colVisPropAttach=this.colVisProp.charAt(0).toUpperCase()+this.colVisProp.slice(1);h=Dt.columnLookups[e];if(h){o=h.call(this.table);o=o.filter((t=>this.columnVisCheck(t)))}r=this.config.columnHeaders!==false?this.headersToExportRows(this.generateColumnGroupHeaders(o)):[];if(o){o=o.map((t=>t.getComponent()))}a=this.bodyToExportRows(this.rowLookup(e),o);return r.concat(a)}generateTable(t,i,e,s){var r=this.generateExportList(t,i,e,s);return this.generateTableElement(r)}rowLookup(t){var i=[],e;if(typeof t=="function"){t.call(this.table).forEach((t=>{t=this.table.rowManager.findRow(t);if(t){i.push(t)}}))}else{e=Dt.rowLookups[t]||Dt.rowLookups["active"];i=e.call(this.table)}return Object.assign([],i)}generateColumnGroupHeaders(t){var i=[];if(!t){t=this.config.columnGroups!==false?this.table.columnManager.columns:this.table.columnManager.columnsByIndex}t.forEach((t=>{var e=this.processColumnGroup(t);if(e){i.push(e)}}));return i}processColumnGroup(t){var i=t.columns,e=0,s=t.definition["title"+this.colVisPropAttach]||t.definition.title;var r={title:s,column:t,depth:1};if(i.length){r.subGroups=[];r.width=0;i.forEach((t=>{var i=this.processColumnGroup(t);if(i){r.width+=i.width;r.subGroups.push(i);if(i.depth>e){e=i.depth}}}));r.depth+=e;if(!r.width){return false}}else{if(this.columnVisCheck(t)){r.width=1}else{return false}}return r}columnVisCheck(t){var i=t.definition[this.colVisProp];if(this.config.rowHeaders===false&&t.isRowHeader){return false}if(typeof i==="function"){i=i.call(this.table,t.getComponent())}if(i===false||i===true){return i}return t.visible&&t.field}headersToExportRows(t){var i=[],e=0,s=[];function r(t,s){var a=e-s;if(typeof i[s]==="undefined"){i[s]=[]}t.height=t.subGroups?1:a-t.depth+1;i[s].push(t);if(t.height>1){for(let e=1;e<t.height;e++){if(typeof i[s+e]==="undefined"){i[s+e]=[]}i[s+e].push(false)}}if(t.width>1){for(let e=1;e<t.width;e++){i[s].push(false)}}if(t.subGroups){t.subGroups.forEach((function(t){r(t,s+1)}))}}t.forEach((function(t){if(t.depth>e){e=t.depth}}));t.forEach((function(t){r(t,0)}));i.forEach((t=>{var i=[];t.forEach((t=>{if(t){let e=typeof t.title==="undefined"?"":t.title;i.push(new Mt(e,t.column.getComponent(),t.width,t.height,t.depth))}else{i.push(null)}}));s.push(new zt("header",i))}));return s}bodyToExportRows(t,i=[]){var e=[];if(i.length===0){this.table.columnManager.columnsByIndex.forEach((t=>{if(this.columnVisCheck(t)){i.push(t.getComponent())}}))}if(this.config.columnCalcs!==false&&this.table.modExists("columnCalcs")){if(this.table.modules.columnCalcs.topInitialized){t.unshift(this.table.modules.columnCalcs.topRow)}if(this.table.modules.columnCalcs.botInitialized){t.push(this.table.modules.columnCalcs.botRow)}}t=t.filter((t=>{switch(t.type){case"group":return this.config.rowGroups!==false;case"calc":return this.config.columnCalcs!==false;case"row":return!(this.table.options.dataTree&&this.config.dataTree===false&&t.modules.dataTree.parent)}return true}));t.forEach(((t,s)=>{var r=t.getData(this.colVisProp);var a=[];var o=0;switch(t.type){case"group":o=t.level;a.push(new Mt(t.key,t.getComponent(),i.length,1));break;case"calc":case"row":i.forEach((t=>{a.push(new Mt(t._column.getFieldValue(r),t,1,1))}));if(this.table.options.dataTree&&this.config.dataTree!==false){o=t.modules.dataTree.index}break}e.push(new zt(t.type,a,t.getComponent(),o))}));return e}generateTableElement(t){var i=document.createElement("table"),e=document.createElement("thead"),s=document.createElement("tbody"),r=this.lookupTableStyles(),a=this.table.options["rowFormatter"+this.colVisPropAttach],o={};o.rowFormatter=a!==null?a:this.table.options.rowFormatter;if(this.table.options.dataTree&&this.config.dataTree!==false&&this.table.modExists("columnCalcs")){o.treeElementField=this.table.modules.dataTree.elementField}o.groupHeader=this.table.options["groupHeader"+this.colVisPropAttach];if(o.groupHeader&&!Array.isArray(o.groupHeader)){o.groupHeader=[o.groupHeader]}i.classList.add("tabulator-print-table");this.mapElementStyles(this.table.columnManager.getHeadersElement(),e,["border-top","border-left","border-right","border-bottom","background-color","color","font-weight","font-family","font-size"]);if(t.length>1e3){console.warn("It may take a long time to render an HTML table with more than 1000 rows")}t.forEach(((t,i)=>{let a;switch(t.type){case"header":e.appendChild(this.generateHeaderElement(t,o,r));break;case"group":s.appendChild(this.generateGroupElement(t,o,r));break;case"calc":s.appendChild(this.generateCalcElement(t,o,r));break;case"row":a=this.generateRowElement(t,o,r);this.mapElementStyles(i%2&&r.evenRow?r.evenRow:r.oddRow,a,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]);s.appendChild(a);break}}));if(e.innerHTML){i.appendChild(e)}i.appendChild(s);this.mapElementStyles(this.table.element,i,["border-top","border-left","border-right","border-bottom"]);return i}lookupTableStyles(){var t={};if(this.cloneTableStyle&&window.getComputedStyle){t.oddRow=this.table.element.querySelector(".tabulator-row-odd:not(.tabulator-group):not(.tabulator-calcs)");t.evenRow=this.table.element.querySelector(".tabulator-row-even:not(.tabulator-group):not(.tabulator-calcs)");t.calcRow=this.table.element.querySelector(".tabulator-row.tabulator-calcs");t.firstRow=this.table.element.querySelector(".tabulator-row:not(.tabulator-group):not(.tabulator-calcs)");t.firstGroup=this.table.element.getElementsByClassName("tabulator-group")[0];if(t.firstRow){t.styleCells=t.firstRow.getElementsByClassName("tabulator-cell");t.styleRowHeader=t.firstRow.getElementsByClassName("tabulator-row-header")[0];t.firstCell=t.styleCells[0];t.lastCell=t.styleCells[t.styleCells.length-1]}}return t}generateHeaderElement(t,i,e){var s=document.createElement("tr");t.columns.forEach((t=>{if(t){var i=document.createElement("th");var e=t.component._column.definition.cssClass?t.component._column.definition.cssClass.split(" "):[];i.colSpan=t.width;i.rowSpan=t.height;i.innerHTML=t.value;if(this.cloneTableStyle){i.style.boxSizing="border-box"}e.forEach((function(t){i.classList.add(t)}));this.mapElementStyles(t.component.getElement(),i,["text-align","border-left","border-right","background-color","color","font-weight","font-family","font-size"]);this.mapElementStyles(t.component._column.contentElement,i,["padding-top","padding-left","padding-right","padding-bottom"]);if(t.component._column.visible){this.mapElementStyles(t.component.getElement(),i,["width"])}else{if(t.component._column.definition.width){i.style.width=t.component._column.definition.width+"px"}}if(t.component._column.parent&&t.component._column.parent.isGroup){this.mapElementStyles(t.component._column.parent.groupElement,i,["border-top"])}else{this.mapElementStyles(t.component.getElement(),i,["border-top"])}if(t.component._column.isGroup){this.mapElementStyles(t.component.getElement(),i,["border-bottom"])}else{this.mapElementStyles(this.table.columnManager.getElement(),i,["border-bottom"])}s.appendChild(i)}}));return s}generateGroupElement(t,i,e){var s=document.createElement("tr"),r=document.createElement("td"),a=t.columns[0];s.classList.add("tabulator-print-table-row");if(i.groupHeader&&i.groupHeader[t.indent]){a.value=i.groupHeader[t.indent](a.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)}else{if(i.groupHeader!==false){a.value=t.component._group.generator(a.value,t.component._group.getRowCount(),t.component._group.getData(),t.component)}}r.colSpan=a.width;r.innerHTML=a.value;s.classList.add("tabulator-print-table-group");s.classList.add("tabulator-group-level-"+t.indent);if(a.component.isVisible()){s.classList.add("tabulator-group-visible")}this.mapElementStyles(e.firstGroup,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]);this.mapElementStyles(e.firstGroup,r,["padding-top","padding-left","padding-right","padding-bottom"]);s.appendChild(r);return s}generateCalcElement(t,i,e){var s=this.generateRowElement(t,i,e);s.classList.add("tabulator-print-table-calcs");this.mapElementStyles(e.calcRow,s,["border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","background-color"]);return s}generateRowElement(t,i,e){var s=document.createElement("tr");s.classList.add("tabulator-print-table-row");t.columns.forEach(((r,a)=>{if(r){var o=document.createElement("td"),h=r.component._column,l=this.table,n=l.columnManager.findColumnIndex(h),u=r.value,f,c;var d={modules:{},getValue:function(){return u},getField:function(){return h.definition.field},getElement:function(){return o},getType:function(){return"cell"},getColumn:function(){return h.getComponent()},getData:function(){return t.component.getData()},getRow:function(){return t.component},getTable:function(){return l},getComponent:function(){return d},column:h};var b=h.definition.cssClass?h.definition.cssClass.split(" "):[];b.forEach((function(t){o.classList.add(t)}));if(this.table.modExists("format")&&this.config.formatCells!==false){u=this.table.modules.format.formatExportValue(d,this.colVisProp)}else{switch(typeof u){case"object":u=u!==null?JSON.stringify(u):"";break;case"undefined":u="";break}}if(u instanceof Node){o.appendChild(u)}else{o.innerHTML=u}c=["padding-top","padding-left","padding-right","padding-bottom","border-top","border-left","border-right","border-bottom","color","font-weight","font-family","font-size","text-align"];if(h.isRowHeader){f=e.styleRowHeader;c.push("background-color")}else{f=e.styleCells&&e.styleCells[n]?e.styleCells[n]:e.firstCell}if(f){this.mapElementStyles(f,o,c);if(h.definition.align){o.style.textAlign=h.definition.align}}if(this.table.options.dataTree&&this.config.dataTree!==false){if(i.treeElementField&&i.treeElementField==h.field||!i.treeElementField&&a==0){if(t.component._row.modules.dataTree.controlEl){o.insertBefore(t.component._row.modules.dataTree.controlEl.cloneNode(true),o.firstChild)}if(t.component._row.modules.dataTree.branchEl){o.insertBefore(t.component._row.modules.dataTree.branchEl.cloneNode(true),o.firstChild)}}}s.appendChild(o);if(d.modules.format&&d.modules.format.renderedCallback){d.modules.format.renderedCallback()}}}));if(i.rowFormatter&&t.type==="row"&&this.config.formatCells!==false){let e=Object.assign(t.component);e.getElement=function(){return s};i.rowFormatter(t.component)}return s}generateHTMLTable(t){var i=document.createElement("div");i.appendChild(this.generateTableElement(t));return i.innerHTML}getHtml(t,i,e,s){var r=this.generateExportList(e||this.table.options.htmlOutputConfig,i,t,s||"htmlOutput");return this.generateHTMLTable(r)}mapElementStyles(t,i,e){if(this.cloneTableStyle&&t&&i){var s={"background-color":"backgroundColor",color:"fontColor",width:"width","font-weight":"fontWeight","font-family":"fontFamily","font-size":"fontSize","text-align":"textAlign","border-top":"borderTop","border-left":"borderLeft","border-right":"borderRight","border-bottom":"borderBottom","padding-top":"paddingTop","padding-left":"paddingLeft","padding-right":"paddingRight","padding-bottom":"paddingBottom"};if(window.getComputedStyle){var r=window.getComputedStyle(t);e.forEach((function(t){if(!i.style[s[t]]){i.style[s[t]]=r.getPropertyValue(t)}}))}}}}var Pt={"=":function(t,i,e,s){return i==t?true:false},"<":function(t,i,e,s){return i<t?true:false},"<=":function(t,i,e,s){return i<=t?true:false},">":function(t,i,e,s){return i>t?true:false},">=":function(t,i,e,s){return i>=t?true:false},"!=":function(t,i,e,s){return i!=t?true:false},regex:function(t,i,e,s){if(typeof t=="string"){t=new RegExp(t)}return t.test(i)},like:function(t,i,e,s){if(t===null||typeof t==="undefined"){return i===t?true:false}else{if(typeof i!=="undefined"&&i!==null){return String(i).toLowerCase().indexOf(t.toLowerCase())>-1}else{return false}}},keywords:function(t,i,e,s){var r=t.toLowerCase().split(typeof s.separator==="undefined"?" ":s.separator),a=String(i===null||typeof i==="undefined"?"":i).toLowerCase(),o=[];r.forEach((t=>{if(a.includes(t)){o.push(true)}}));return s.matchAll?o.length===r.length:!!o.length},starts:function(t,i,e,s){if(t===null||typeof t==="undefined"){return i===t?true:false}else{if(typeof i!=="undefined"&&i!==null){return String(i).toLowerCase().startsWith(t.toLowerCase())}else{return false}}},ends:function(t,i,e,s){if(t===null||typeof t==="undefined"){return i===t?true:false}else{if(typeof i!=="undefined"&&i!==null){return String(i).toLowerCase().endsWith(t.toLowerCase())}else{return false}}},in:function(t,i,e,s){if(Array.isArray(t)){return t.length?t.indexOf(i)>-1:true}else{console.warn("Filter Error - filter value is not an array:",t);return false}}};class Ft extends S{static moduleName="filter";static filters=Pt;constructor(t){super(t);this.filterList=[];this.headerFilters={};this.headerFilterColumns=[];this.prevHeaderFilterChangeCheck="";this.prevHeaderFilterChangeCheck="{}";this.changed=false;this.tableInitialized=false;this.registerTableOption("filterMode","local");this.registerTableOption("initialFilter",false);this.registerTableOption("initialHeaderFilter",false);this.registerTableOption("headerFilterLiveFilterDelay",300);this.registerTableOption("placeholderHeaderFilter",false);this.registerColumnOption("headerFilter");this.registerColumnOption("headerFilterPlaceholder");this.registerColumnOption("headerFilterParams");this.registerColumnOption("headerFilterEmptyCheck");this.registerColumnOption("headerFilterFunc");this.registerColumnOption("headerFilterFuncParams");this.registerColumnOption("headerFilterLiveFilter");this.registerTableFunction("searchRows",this.searchRows.bind(this));this.registerTableFunction("searchData",this.searchData.bind(this));this.registerTableFunction("setFilter",this.userSetFilter.bind(this));this.registerTableFunction("refreshFilter",this.userRefreshFilter.bind(this));this.registerTableFunction("addFilter",this.userAddFilter.bind(this));this.registerTableFunction("getFilters",this.getFilters.bind(this));this.registerTableFunction("setHeaderFilterFocus",this.userSetHeaderFilterFocus.bind(this));this.registerTableFunction("getHeaderFilterValue",this.userGetHeaderFilterValue.bind(this));this.registerTableFunction("setHeaderFilterValue",this.userSetHeaderFilterValue.bind(this));this.registerTableFunction("getHeaderFilters",this.getHeaderFilters.bind(this));this.registerTableFunction("removeFilter",this.userRemoveFilter.bind(this));this.registerTableFunction("clearFilter",this.userClearFilter.bind(this));this.registerTableFunction("clearHeaderFilter",this.userClearHeaderFilter.bind(this));this.registerComponentFunction("column","headerFilterFocus",this.setHeaderFilterFocus.bind(this));this.registerComponentFunction("column","reloadHeaderFilter",this.reloadHeaderFilter.bind(this));this.registerComponentFunction("column","getHeaderFilterValue",this.getHeaderFilterValue.bind(this));this.registerComponentFunction("column","setHeaderFilterValue",this.setHeaderFilterValue.bind(this))}initialize(){this.subscribe("column-init",this.initializeColumnHeaderFilter.bind(this));this.subscribe("column-width-fit-before",this.hideHeaderFilterElements.bind(this));this.subscribe("column-width-fit-after",this.showHeaderFilterElements.bind(this));this.subscribe("table-built",this.tableBuilt.bind(this));this.subscribe("placeholder",this.generatePlaceholder.bind(this));if(this.table.options.filterMode==="remote"){this.subscribe("data-params",this.remoteFilterParams.bind(this))}this.registerDataHandler(this.filter.bind(this),10)}tableBuilt(){if(this.table.options.initialFilter){this.setFilter(this.table.options.initialFilter)}if(this.table.options.initialHeaderFilter){this.table.options.initialHeaderFilter.forEach((t=>{var i=this.table.columnManager.findColumn(t.field);if(i){this.setHeaderFilterValue(i,t.value)}else{console.warn("Column Filter Error - No matching column found:",t.field);return false}}))}this.tableInitialized=true}remoteFilterParams(t,i,e,s){s.filter=this.getFilters(true,true);return s}generatePlaceholder(t){if(this.table.options.placeholderHeaderFilter&&Object.keys(this.headerFilters).length){return this.table.options.placeholderHeaderFilter}}userSetFilter(t,i,e,s){this.setFilter(t,i,e,s);this.refreshFilter()}userRefreshFilter(){this.refreshFilter()}userAddFilter(t,i,e,s){this.addFilter(t,i,e,s);this.refreshFilter()}userSetHeaderFilterFocus(t){var i=this.table.columnManager.findColumn(t);if(i){this.setHeaderFilterFocus(i)}else{console.warn("Column Filter Focus Error - No matching column found:",t);return false}}userGetHeaderFilterValue(t){var i=this.table.columnManager.findColumn(t);if(i){return this.getHeaderFilterValue(i)}else{console.warn("Column Filter Error - No matching column found:",t)}}userSetHeaderFilterValue(t,i){var e=this.table.columnManager.findColumn(t);if(e){this.setHeaderFilterValue(e,i)}else{console.warn("Column Filter Error - No matching column found:",t);return false}}userRemoveFilter(t,i,e){this.removeFilter(t,i,e);this.refreshFilter()}userClearFilter(t){this.clearFilter(t);this.refreshFilter()}userClearHeaderFilter(){this.clearHeaderFilter();this.refreshFilter()}searchRows(t,i,e){return this.search("rows",t,i,e)}searchData(t,i,e){return this.search("data",t,i,e)}initializeColumnHeaderFilter(t){var i=t.definition;if(i.headerFilter){this.initializeColumn(t)}}initializeColumn(t,i){var e=this,s=t.getField();function r(i){var r=t.modules.filter.tagType=="input"&&t.modules.filter.attrType=="text"||t.modules.filter.tagType=="textarea"?"partial":"match",a="",o="",h;if(typeof t.modules.filter.prevSuccess==="undefined"||t.modules.filter.prevSuccess!==i){t.modules.filter.prevSuccess=i;if(!t.modules.filter.emptyFunc(i)){t.modules.filter.value=i;switch(typeof t.definition.headerFilterFunc){case"string":if(Ft.filters[t.definition.headerFilterFunc]){a=t.definition.headerFilterFunc;h=function(e){var s=t.definition.headerFilterFuncParams||{};var r=t.getFieldValue(e);s=typeof s==="function"?s(i,r,e):s;return Ft.filters[t.definition.headerFilterFunc](i,r,e,s)}}else{console.warn("Header Filter Error - Matching filter function not found: ",t.definition.headerFilterFunc)}break;case"function":h=function(e){var s=t.definition.headerFilterFuncParams||{};var r=t.getFieldValue(e);s=typeof s==="function"?s(i,r,e):s;return t.definition.headerFilterFunc(i,r,e,s)};a=h;break}if(!h){switch(r){case"partial":h=function(e){var s=t.getFieldValue(e);if(typeof s!=="undefined"&&s!==null){return String(s).toLowerCase().indexOf(String(i).toLowerCase())>-1}else{return false}};a="like";break;default:h=function(e){return t.getFieldValue(e)==i};a="="}}e.headerFilters[s]={value:i,func:h,type:a}}else{delete e.headerFilters[s]}t.modules.filter.value=i;o=JSON.stringify(e.headerFilters);if(e.prevHeaderFilterChangeCheck!==o){e.prevHeaderFilterChangeCheck=o;e.trackChanges();e.refreshFilter()}}return true}t.modules.filter={success:r,attrType:false,tagType:false,emptyFunc:false};this.generateHeaderFilterElement(t)}generateHeaderFilterElement(t,i,e){var s=this,r=t.modules.filter.success,a=t.getField(),o,h,l,n,u,f,c,d;t.modules.filter.value=i;function b(){}function p(t){d=t}if(t.modules.filter.headerElement&&t.modules.filter.headerElement.parentNode){t.contentElement.removeChild(t.modules.filter.headerElement.parentNode)}if(a){t.modules.filter.emptyFunc=t.definition.headerFilterEmptyCheck||function(t){return!t&&t!==0};o=document.createElement("div");o.classList.add("tabulator-header-filter");switch(typeof t.definition.headerFilter){case"string":if(s.table.modules.edit.editors[t.definition.headerFilter]){h=s.table.modules.edit.editors[t.definition.headerFilter];if((t.definition.headerFilter==="tick"||t.definition.headerFilter==="tickCross")&&!t.definition.headerFilterEmptyCheck){t.modules.filter.emptyFunc=function(t){return t!==true&&t!==false}}}else{console.warn("Filter Error - Cannot build header filter, No such editor found: ",t.definition.editor)}break;case"function":h=t.definition.headerFilter;break;case"boolean":if(t.modules.edit&&t.modules.edit.editor){h=t.modules.edit.editor}else{if(t.definition.formatter&&s.table.modules.edit.editors[t.definition.formatter]){h=s.table.modules.edit.editors[t.definition.formatter];if((t.definition.formatter==="tick"||t.definition.formatter==="tickCross")&&!t.definition.headerFilterEmptyCheck){t.modules.filter.emptyFunc=function(t){return t!==true&&t!==false}}}else{h=s.table.modules.edit.editors["input"]}}break}if(h){n={getValue:function(){return typeof i!=="undefined"?i:""},getField:function(){return t.definition.field},getElement:function(){return o},getColumn:function(){return t.getComponent()},getTable:()=>this.table,getType:()=>"header",getRow:function(){return{normalizeHeight:function(){}}}};c=t.definition.headerFilterParams||{};c=typeof c==="function"?c.call(s.table,n):c;l=h.call(this.table.modules.edit,n,p,r,b,c);if(!l){console.warn("Filter Error - Cannot add filter to "+a+" column, editor returned a value of false");return}if(!(l instanceof Node)){console.warn("Filter Error - Cannot add filter to "+a+" column, editor should return an instance of Node, the editor returned:",l);return}s.langBind("headerFilters|columns|"+t.definition.field,(function(i){l.setAttribute("placeholder",typeof i!=="undefined"&&i?i:t.definition.headerFilterPlaceholder||s.langText("headerFilters|default"))}));l.addEventListener("click",(function(t){t.stopPropagation();l.focus()}));l.addEventListener("focus",(t=>{var i=this.table.columnManager.contentsElement.scrollLeft;var e=this.table.rowManager.element.scrollLeft;if(i!==e){this.table.rowManager.scrollHorizontal(i);this.table.columnManager.scrollHorizontal(i)}}));u=false;f=function(t){if(u){clearTimeout(u)}u=setTimeout((function(){r(l.value)}),s.table.options.headerFilterLiveFilterDelay)};t.modules.filter.headerElement=l;t.modules.filter.attrType=l.hasAttribute("type")?l.getAttribute("type").toLowerCase():"";t.modules.filter.tagType=l.tagName.toLowerCase();if(t.definition.headerFilterLiveFilter!==false){if(!(t.definition.headerFilter==="autocomplete"||t.definition.headerFilter==="tickCross"||(t.definition.editor==="autocomplete"||t.definition.editor==="tickCross")&&t.definition.headerFilter===true)){l.addEventListener("keyup",f);l.addEventListener("search",f);if(t.modules.filter.attrType=="number"){l.addEventListener("change",(function(t){r(l.value)}))}if(t.modules.filter.attrType=="text"&&this.table.browser!=="ie"){l.setAttribute("type","search")}}if(t.modules.filter.tagType=="input"||t.modules.filter.tagType=="select"||t.modules.filter.tagType=="textarea"){l.addEventListener("mousedown",(function(t){t.stopPropagation()}))}}o.appendChild(l);t.contentElement.appendChild(o);if(!e){s.headerFilterColumns.push(t)}if(d){d()}}}else{console.warn("Filter Error - Cannot add header filter, column has no field set:",t.definition.title)}}hideHeaderFilterElements(){this.headerFilterColumns.forEach((function(t){if(t.modules.filter&&t.modules.filter.headerElement){t.modules.filter.headerElement.style.display="none"}}))}showHeaderFilterElements(){this.headerFilterColumns.forEach((function(t){if(t.modules.filter&&t.modules.filter.headerElement){t.modules.filter.headerElement.style.display=""}}))}setHeaderFilterFocus(t){if(t.modules.filter&&t.modules.filter.headerElement){t.modules.filter.headerElement.focus()}else{console.warn("Column Filter Focus Error - No header filter set on column:",t.getField())}}getHeaderFilterValue(t){if(t.modules.filter&&t.modules.filter.headerElement){return t.modules.filter.value}else{console.warn("Column Filter Error - No header filter set on column:",t.getField())}}setHeaderFilterValue(t,i){if(t){if(t.modules.filter&&t.modules.filter.headerElement){this.generateHeaderFilterElement(t,i,true);t.modules.filter.success(i)}else{console.warn("Column Filter Error - No header filter set on column:",t.getField())}}}reloadHeaderFilter(t){if(t){if(t.modules.filter&&t.modules.filter.headerElement){this.generateHeaderFilterElement(t,t.modules.filter.value,true)}else{console.warn("Column Filter Error - No header filter set on column:",t.getField())}}}refreshFilter(){if(this.tableInitialized){if(this.table.options.filterMode==="remote"){this.reloadData(null,false,false)}else{this.refreshData(true)}}}trackChanges(){this.changed=true;this.dispatch("filter-changed")}hasChanged(){var t=this.changed;this.changed=false;return t}setFilter(t,i,e,s){this.filterList=[];if(!Array.isArray(t)){t=[{field:t,type:i,value:e,params:s}]}this.addFilter(t)}addFilter(t,i,e,s){var r=false;if(!Array.isArray(t)){t=[{field:t,type:i,value:e,params:s}]}t.forEach((t=>{t=this.findFilter(t);if(t){this.filterList.push(t);r=true}}));if(r){this.trackChanges()}}findFilter(t){var i;if(Array.isArray(t)){return this.findSubFilters(t)}var e=false;if(typeof t.field=="function"){e=function(i){return t.field(i,t.type||{})}}else{if(Ft.filters[t.type]){i=this.table.columnManager.getColumnByField(t.field);if(i){e=function(e){return Ft.filters[t.type](t.value,i.getFieldValue(e),e,t.params||{})}}else{e=function(i){return Ft.filters[t.type](t.value,i[t.field],i,t.params||{})}}}else{console.warn("Filter Error - No such filter type found, ignoring: ",t.type)}}t.func=e;return t.func?t:false}findSubFilters(t){var i=[];t.forEach((t=>{t=this.findFilter(t);if(t){i.push(t)}}));return i.length?i:false}getFilters(t,i){var e=[];if(t){e=this.getHeaderFilters()}if(i){e.forEach((function(t){if(typeof t.type=="function"){t.type="function"}}))}e=e.concat(this.filtersToArray(this.filterList,i));return e}filtersToArray(t,i){var e=[];t.forEach((t=>{var s;if(Array.isArray(t)){e.push(this.filtersToArray(t,i))}else{s={field:t.field,type:t.type,value:t.value};if(i){if(typeof s.type=="function"){s.type="function"}}e.push(s)}}));return e}getHeaderFilters(){var t=[];for(var i in this.headerFilters){t.push({field:i,type:this.headerFilters[i].type,value:this.headerFilters[i].value})}return t}removeFilter(t,i,e){if(!Array.isArray(t)){t=[{field:t,type:i,value:e}]}t.forEach((t=>{var i=-1;if(typeof t.field=="object"){i=this.filterList.findIndex((i=>t===i))}else{i=this.filterList.findIndex((i=>t.field===i.field&&t.type===i.type&&t.value===i.value))}if(i>-1){this.filterList.splice(i,1)}else{console.warn("Filter Error - No matching filter type found, ignoring: ",t.type)}}));this.trackChanges()}clearFilter(t){this.filterList=[];if(t){this.clearHeaderFilter()}this.trackChanges()}clearHeaderFilter(){this.headerFilters={};this.prevHeaderFilterChangeCheck="{}";this.headerFilterColumns.forEach((t=>{if(typeof t.modules.filter.value!=="undefined"){delete t.modules.filter.value}t.modules.filter.prevSuccess=undefined;this.reloadHeaderFilter(t)}));this.trackChanges()}search(t,i,e,s){var r=[],a=[];if(!Array.isArray(i)){i=[{field:i,type:e,value:s}]}i.forEach((t=>{t=this.findFilter(t);if(t){a.push(t)}}));this.table.rowManager.rows.forEach((i=>{var e=true;a.forEach((t=>{if(!this.filterRecurse(t,i.getData())){e=false}}));if(e){r.push(t==="data"?i.getData("data"):i.getComponent())}}));return r}filter(t,i){var e=[],s=[];if(this.subscribedExternal("dataFiltering")){this.dispatchExternal("dataFiltering",this.getFilters(true))}if(this.table.options.filterMode!=="remote"&&(this.filterList.length||Object.keys(this.headerFilters).length)){t.forEach((t=>{if(this.filterRow(t)){e.push(t)}}))}else{e=t.slice(0)}if(this.subscribedExternal("dataFiltered")){e.forEach((t=>{s.push(t.getComponent())}));this.dispatchExternal("dataFiltered",this.getFilters(true),s)}return e}filterRow(t,i){var e=true,s=t.getData();this.filterList.forEach((t=>{if(!this.filterRecurse(t,s)){e=false}}));for(var r in this.headerFilters){if(!this.headerFilters[r].func(s)){e=false}}return e}filterRecurse(t,i){var e=false;if(Array.isArray(t)){t.forEach((t=>{if(this.filterRecurse(t,i)){e=true}}))}else{e=t.func(i)}return e}}function jt(t,i,e){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))}function Nt(t,i,e){return t.getValue()}function Ot(t,i,e){t.getElement().style.whiteSpace="pre-wrap";return this.emptyToSpace(this.sanitizeHTML(t.getValue()))}function Ht(t,i,e){var s=parseFloat(t.getValue()),r="",a,o,h,l,n;var u=i.decimal||".";var f=i.thousand||",";var c=i.negativeSign||"-";var d=i.symbol||"";var b=!!i.symbolAfter;var p=typeof i.precision!=="undefined"?i.precision:2;if(isNaN(s)){return this.emptyToSpace(this.sanitizeHTML(t.getValue()))}if(s<0){s=Math.abs(s);r=c}a=p!==false?s.toFixed(p):s;a=String(a).split(".");o=a[0];h=a.length>1?u+a[1]:"";if(i.thousand!==false){l=/(\d+)(\d{3})/;while(l.test(o)){o=o.replace(l,"$1"+f+"$2")}}n=o+h;if(r===true){n="("+n+")";return b?n+d:d+n}else{return b?r+n+d:r+d+n}}function _t(t,i,e){var s=t.getValue(),r=i.urlPrefix||"",a=i.download,o=s,h=document.createElement("a"),l;function n(t,i){var e=t.shift(),s=i[e];if(t.length&&typeof s==="object"){return n(t,s)}return s}if(i.labelField){l=t.getData();o=n(i.labelField.split(this.table.options.nestedFieldSeparator),l)}if(i.label){switch(typeof i.label){case"string":o=i.label;break;case"function":o=i.label(t);break}}if(o){if(i.urlField){l=t.getData();s=z.retrieveNestedData(this.table.options.nestedFieldSeparator,i.urlField,l)}if(i.url){switch(typeof i.url){case"string":s=i.url;break;case"function":s=i.url(t);break}}h.setAttribute("href",r+s);if(i.target){h.setAttribute("target",i.target)}if(i.download){if(typeof a=="function"){a=a(t)}else{a=a===true?"":a}h.setAttribute("download",a)}h.innerHTML=this.emptyToSpace(this.sanitizeHTML(o));return h}else{return"&nbsp;"}}function Lt(t,i,e){var s=document.createElement("img"),r=t.getValue();if(i.urlPrefix){r=i.urlPrefix+t.getValue()}if(i.urlSuffix){r=r+i.urlSuffix}s.setAttribute("src",r);switch(typeof i.height){case"number":s.style.height=i.height+"px";break;case"string":s.style.height=i.height;break}switch(typeof i.width){case"number":s.style.width=i.width+"px";break;case"string":s.style.width=i.width;break}s.addEventListener("load",(function(){t.getRow().normalizeHeight()}));return s}function At(t,i,e){var s=t.getValue(),r=t.getElement(),a=i.allowEmpty,o=i.allowTruthy,h=Object.keys(i).includes("trueValue"),l=typeof i.tickElement!=="undefined"?i.tickElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>',n=typeof i.crossElement!=="undefined"?i.crossElement:'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>';if(h&&s===i.trueValue||!h&&(o&&s||(s===true||s==="true"||s==="True"||s===1||s==="1"))){r.setAttribute("aria-checked",true);return l||""}else{if(a&&(s==="null"||s===""||s===null||typeof s==="undefined")){r.setAttribute("aria-checked","mixed");return""}else{r.setAttribute("aria-checked",false);return n||""}}}function It(t,i,e){var s=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime");var r=i.inputFormat||"yyyy-MM-dd HH:mm:ss";var a=i.outputFormat||"dd/MM/yyyy HH:mm:ss";var o=typeof i.invalidPlaceholder!=="undefined"?i.invalidPlaceholder:"";var h=t.getValue();if(typeof s!="undefined"){var l;if(s.isDateTime(h)){l=h}else if(r==="iso"){l=s.fromISO(String(h))}else{l=s.fromFormat(String(h),r)}if(l.isValid){if(i.timezone){l=l.setZone(i.timezone)}return l.toFormat(a)}else{if(o===true||!h){return h}else if(typeof o==="function"){return o(h)}else{return o}}}else{console.error("Format Error - 'datetime' formatter is dependant on luxon.js")}}function Vt(t,i,e){var s=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime");var r=i.inputFormat||"yyyy-MM-dd HH:mm:ss";var a=typeof i.invalidPlaceholder!=="undefined"?i.invalidPlaceholder:"";var o=typeof i.suffix!=="undefined"?i.suffix:false;var h=typeof i.unit!=="undefined"?i.unit:"days";var l=typeof i.humanize!=="undefined"?i.humanize:false;var n=typeof i.date!=="undefined"?i.date:s.now();var u=t.getValue();if(typeof s!="undefined"){var f;if(s.isDateTime(u)){f=u}else if(r==="iso"){f=s.fromISO(String(u))}else{f=s.fromFormat(String(u),r)}if(f.isValid){if(l){return f.diff(n,h).toHuman()+(o?" "+o:"")}else{return parseInt(f.diff(n,h)[h])+(o?" "+o:"")}}else{if(a===true){return u}else if(typeof a==="function"){return a(u)}else{return a}}}else{console.error("Format Error - 'datetimediff' formatter is dependant on luxon.js")}}function Ut(t,i,e){var s=t.getValue();if(typeof i[s]==="undefined"){console.warn("Missing display value for "+s);return s}return i[s]}function Bt(t,i,e){var s=t.getValue(),r=t.getElement(),a=i&&i.stars?i.stars:5,o=document.createElement("span"),h=document.createElementNS("http://www.w3.org/2000/svg","svg"),l='<polygon fill="#FFEA00" stroke="#C1AB60" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>',n='<polygon fill="#D2D2D2" stroke="#686868" stroke-width="37.6152" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" points="259.216,29.942 330.27,173.919 489.16,197.007 374.185,309.08 401.33,467.31 259.216,392.612 117.104,467.31 144.25,309.08 29.274,197.007 188.165,173.919 "/>';o.style.verticalAlign="middle";h.setAttribute("width","14");h.setAttribute("height","14");h.setAttribute("viewBox","0 0 512 512");h.setAttribute("xml:space","preserve");h.style.padding="0 1px";s=s&&!isNaN(s)?parseInt(s):0;s=Math.max(0,Math.min(s,a));for(var u=1;u<=a;u++){var f=h.cloneNode(true);f.innerHTML=u<=s?l:n;o.appendChild(f)}r.style.whiteSpace="nowrap";r.style.overflow="hidden";r.style.textOverflow="ellipsis";r.setAttribute("aria-label",s);return o}function Gt(t,i,e){var s=this.sanitizeHTML(t.getValue())||0,r=document.createElement("span"),a=i&&i.max?i.max:100,o=i&&i.min?i.min:0,h=i&&typeof i.color!=="undefined"?i.color:["red","orange","green"],l="#666666",n,u;if(isNaN(s)||typeof t.getValue()==="undefined"){return}r.classList.add("tabulator-traffic-light");u=parseFloat(s)<=a?parseFloat(s):a;u=parseFloat(u)>=o?parseFloat(u):o;n=(a-o)/100;u=Math.round((u-o)/n);switch(typeof h){case"string":l=h;break;case"function":l=h(s);break;case"object":if(Array.isArray(h)){var f=100/h.length;var c=Math.floor(u/f);c=Math.min(c,h.length-1);c=Math.max(c,0);l=h[c];break}}r.style.backgroundColor=l;return r}function Wt(t,i={},e){var s=this.sanitizeHTML(t.getValue())||0,r=t.getElement(),a=i.max?i.max:100,o=i.min?i.min:0,h=i.legendAlign?i.legendAlign:"center",l,n,u,f,c;n=parseFloat(s)<=a?parseFloat(s):a;n=parseFloat(n)>=o?parseFloat(n):o;l=(a-o)/100;n=Math.round((n-o)/l);switch(typeof i.color){case"string":u=i.color;break;case"function":u=i.color(s);break;case"object":if(Array.isArray(i.color)){let t=100/i.color.length;let e=Math.floor(n/t);e=Math.min(e,i.color.length-1);e=Math.max(e,0);u=i.color[e];break}default:u="#2DC214"}switch(typeof i.legend){case"string":f=i.legend;break;case"function":f=i.legend(s);break;case"boolean":f=s;break;default:f=false}switch(typeof i.legendColor){case"string":c=i.legendColor;break;case"function":c=i.legendColor(s);break;case"object":if(Array.isArray(i.legendColor)){let t=100/i.legendColor.length;let e=Math.floor(n/t);e=Math.min(e,i.legendColor.length-1);e=Math.max(e,0);c=i.legendColor[e]}break;default:c="#000"}r.style.minWidth="30px";r.style.position="relative";r.setAttribute("aria-label",n);var d=document.createElement("div");d.style.display="inline-block";d.style.width=n+"%";d.style.backgroundColor=u;d.style.height="100%";d.setAttribute("data-max",a);d.setAttribute("data-min",o);var b=document.createElement("div");b.style.position="relative";b.style.width="100%";b.style.height="100%";if(f){var p=document.createElement("div");p.style.position="absolute";p.style.top=0;p.style.left=0;p.style.textAlign=h;p.style.width="100%";p.style.color=c;p.innerHTML=f}e((function(){if(!(t instanceof J)){var i=document.createElement("div");i.style.position="absolute";i.style.top="4px";i.style.bottom="4px";i.style.left="4px";i.style.right="4px";r.appendChild(i);r=i}r.appendChild(b);b.appendChild(d);if(f){b.appendChild(p)}}));return""}function Jt(t,i,e){t.getElement().style.backgroundColor=this.sanitizeHTML(t.getValue());return""}function qt(t,i,e){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#2DC214" clip-rule="evenodd" d="M21.652,3.211c-0.293-0.295-0.77-0.295-1.061,0L9.41,14.34 c-0.293,0.297-0.771,0.297-1.062,0L3.449,9.351C3.304,9.203,3.114,9.13,2.923,9.129C2.73,9.128,2.534,9.201,2.387,9.351 l-2.165,1.946C0.078,11.445,0,11.63,0,11.823c0,0.194,0.078,0.397,0.223,0.544l4.94,5.184c0.292,0.296,0.771,0.776,1.062,1.07 l2.124,2.141c0.292,0.293,0.769,0.293,1.062,0l14.366-14.34c0.293-0.294,0.293-0.777,0-1.071L21.652,3.211z" fill-rule="evenodd"/></svg>'}function Kt(t,i,e){return'<svg enable-background="new 0 0 24 24" height="14" width="14" viewBox="0 0 24 24" xml:space="preserve" ><path fill="#CE1515" d="M22.245,4.015c0.313,0.313,0.313,0.826,0,1.139l-6.276,6.27c-0.313,0.312-0.313,0.826,0,1.14l6.273,6.272 c0.313,0.313,0.313,0.826,0,1.14l-2.285,2.277c-0.314,0.312-0.828,0.312-1.142,0l-6.271-6.271c-0.313-0.313-0.828-0.313-1.141,0 l-6.276,6.267c-0.313,0.313-0.828,0.313-1.141,0l-2.282-2.28c-0.313-0.313-0.313-0.826,0-1.14l6.278-6.269 c0.313-0.312,0.313-0.826,0-1.14L1.709,5.147c-0.314-0.313-0.314-0.827,0-1.14l2.284-2.278C4.308,1.417,4.821,1.417,5.135,1.73 L11.405,8c0.314,0.314,0.828,0.314,1.141,0.001l6.276-6.267c0.312-0.312,0.826-0.312,1.141,0L22.245,4.015z"/></svg>'}function Zt(t,i,e){var s=t.getValue(),r=i.size||15,a=r+"px",o,h,l=i.hasOwnProperty("onValue")?i.onValue:true,n=i.hasOwnProperty("offValue")?i.offValue:false,u=i.onTruthy?s:s===l;o=document.createElement("div");o.classList.add("tabulator-toggle");if(u){o.classList.add("tabulator-toggle-on");o.style.flexDirection="row-reverse";if(i.onColor){o.style.background=i.onColor}}else{if(i.offColor){o.style.background=i.offColor}}o.style.width=2.5*r+"px";o.style.borderRadius=a;if(i.clickable){o.addEventListener("click",(i=>{t.setValue(u?n:l)}))}h=document.createElement("div");h.classList.add("tabulator-toggle-switch");h.style.height=a;h.style.width=a;h.style.borderRadius=a;o.appendChild(h);return o}function $t(t,i,e){var s=document.createElement("span");var r=t.getRow();var a=t.getTable();r.watchPosition((t=>{if(i.relativeToPage){t+=a.modules.page.getPageSize()*(a.modules.page.getPage()-1)}s.innerText=t}));return s}function Xt(t,i,e){t.getElement().classList.add("tabulator-row-handle");return"<div class='tabulator-row-handle-box'><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div><div class='tabulator-row-handle-bar'></div></div>"}function Yt(t,i,e){var s,r,a;function o(t){var i=t.getValue(),e="plaintext";switch(typeof i){case"boolean":e="tickCross";break;case"string":if(i.includes("\n")){e="textarea"}break}return e}s=i.formatterLookup?i.formatterLookup(t):o(t);if(i.paramsLookup){a=typeof i.paramsLookup==="function"?i.paramsLookup(s,t):i.paramsLookup[s]}r=this.table.modules.format.lookupFormatter(s);return r.call(this,t,a||{},e)}function Qt(t,i,e){var s=i.delimiter||",",r=t.getValue(),a=this.table,o;if(i.valueMap){if(typeof i.valueMap==="string"){o=function(t){return t.map((t=>z.retrieveNestedData(a.options.nestedFieldSeparator,i.valueMap,t)))}}else{o=i.valueMap}}if(Array.isArray(r)){if(o){r=o(r)}return r.join(s)}else{return r}}function ti(t,i,e){var s=i.indent||"\t",r=typeof i.multiline==="undefined"?true:i.multiline,a=i.replacer||null,o=t.getValue();if(r){t.getElement().style.whiteSpace="pre-wrap"}return JSON.stringify(o,a,s)}var ii={plaintext:jt,html:Nt,textarea:Ot,money:Ht,link:_t,image:Lt,tickCross:At,datetime:It,datetimediff:Vt,lookup:Ut,star:Bt,traffic:Gt,progress:Wt,color:Jt,buttonTick:qt,buttonCross:Kt,toggle:Zt,rownum:$t,handle:Xt,adaptable:Yt,array:Qt,json:ti};class ei extends S{static moduleName="format";static formatters=ii;constructor(t){super(t);this.registerColumnOption("formatter");this.registerColumnOption("formatterParams");this.registerColumnOption("formatterPrint");this.registerColumnOption("formatterPrintParams");this.registerColumnOption("formatterClipboard");this.registerColumnOption("formatterClipboardParams");this.registerColumnOption("formatterHtmlOutput");this.registerColumnOption("formatterHtmlOutputParams");this.registerColumnOption("titleFormatter");this.registerColumnOption("titleFormatterParams")}initialize(){this.subscribe("cell-format",this.formatValue.bind(this));this.subscribe("cell-rendered",this.cellRendered.bind(this));this.subscribe("column-layout",this.initializeColumn.bind(this));this.subscribe("column-format",this.formatHeader.bind(this))}initializeColumn(t){t.modules.format=this.lookupTypeFormatter(t,"");if(typeof t.definition.formatterPrint!=="undefined"){t.modules.format.print=this.lookupTypeFormatter(t,"Print")}if(typeof t.definition.formatterClipboard!=="undefined"){t.modules.format.clipboard=this.lookupTypeFormatter(t,"Clipboard")}if(typeof t.definition.formatterHtmlOutput!=="undefined"){t.modules.format.htmlOutput=this.lookupTypeFormatter(t,"HtmlOutput")}}lookupTypeFormatter(t,i){var e={params:t.definition["formatter"+i+"Params"]||{}},s=t.definition["formatter"+i];e.formatter=this.lookupFormatter(s);return e}lookupFormatter(t){var i;switch(typeof t){case"string":if(ei.formatters[t]){i=ei.formatters[t]}else{console.warn("Formatter Error - No such formatter found: ",t);i=ei.formatters.plaintext}break;case"function":i=t;break;default:i=ei.formatters.plaintext;break}return i}cellRendered(t){if(t.modules.format&&t.modules.format.renderedCallback&&!t.modules.format.rendered){t.modules.format.renderedCallback();t.modules.format.rendered=true}}formatHeader(t,i,e){var s,r,a,o;if(t.definition.titleFormatter){s=this.lookupFormatter(t.definition.titleFormatter);a=i=>{t.titleFormatterRendered=i};o={getValue:function(){return i},getElement:function(){return e},getType:function(){return"header"},getColumn:function(){return t.getComponent()},getTable:()=>this.table};r=t.definition.titleFormatterParams||{};r=typeof r==="function"?r():r;return s.call(this,o,r,a)}else{return i}}formatValue(t){var i=t.getComponent(),e=typeof t.column.modules.format.params==="function"?t.column.modules.format.params(i):t.column.modules.format.params;function s(i){if(!t.modules.format){t.modules.format={}}t.modules.format.renderedCallback=i;t.modules.format.rendered=false}return t.column.modules.format.formatter.call(this,i,e,s)}formatExportValue(t,i){var e=t.column.modules.format[i],s;if(e){s=typeof e.params==="function"?e.params(t.getComponent()):e.params;function r(i){if(!t.modules.format){t.modules.format={}}t.modules.format.renderedCallback=i;t.modules.format.rendered=false}return e.formatter.call(this,t.getComponent(),s,r)}else{return this.formatValue(t)}}sanitizeHTML(t){if(t){var i={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};return String(t).replace(/[&<>"'`=/]/g,(function(t){return i[t]}))}else{return t}}emptyToSpace(t){return t===null||typeof t==="undefined"||t===""?"&nbsp;":t}}class si extends S{static moduleName="frozenColumns";constructor(t){super(t);this.leftColumns=[];this.rightColumns=[];this.initializationMode="left";this.active=false;this.blocked=true;this.registerColumnOption("frozen")}reset(){this.initializationMode="left";this.leftColumns=[];this.rightColumns=[];this.active=false}initialize(){this.subscribe("cell-layout",this.layoutCell.bind(this));this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("column-width",this.layout.bind(this));this.subscribe("row-layout-after",this.layoutRow.bind(this));this.subscribe("table-layout",this.layout.bind(this));this.subscribe("columns-loading",this.reset.bind(this));this.subscribe("column-add",this.reinitializeColumns.bind(this));this.subscribe("column-deleted",this.reinitializeColumns.bind(this));this.subscribe("column-hide",this.reinitializeColumns.bind(this));this.subscribe("column-show",this.reinitializeColumns.bind(this));this.subscribe("columns-loaded",this.reinitializeColumns.bind(this));this.subscribe("table-redraw",this.layout.bind(this));this.subscribe("layout-refreshing",this.blockLayout.bind(this));this.subscribe("layout-refreshed",this.unblockLayout.bind(this));this.subscribe("scrollbar-vertical",this.adjustForScrollbar.bind(this))}blockLayout(){this.blocked=true}unblockLayout(){this.blocked=false}layoutCell(t){this.layoutElement(t.element,t.column)}reinitializeColumns(){this.reset();this.table.columnManager.columnsByIndex.forEach((t=>{this.initializeColumn(t)}));this.layout()}initializeColumn(t){var i={margin:0,edge:false};if(!t.isGroup){if(this.frozenCheck(t)){i.position=this.initializationMode;if(this.initializationMode=="left"){this.leftColumns.push(t)}else{this.rightColumns.unshift(t)}this.active=true;t.modules.frozen=i}else{this.initializationMode="right"}}}frozenCheck(t){if(t.parent.isGroup&&t.definition.frozen){console.warn("Frozen Column Error - Parent column group must be frozen, not individual columns or sub column groups")}if(t.parent.isGroup){return this.frozenCheck(t.parent)}else{return t.definition.frozen}}layoutCalcRows(){if(this.table.modExists("columnCalcs")){if(this.table.modules.columnCalcs.topInitialized&&this.table.modules.columnCalcs.topRow){this.layoutRow(this.table.modules.columnCalcs.topRow)}if(this.table.modules.columnCalcs.botInitialized&&this.table.modules.columnCalcs.botRow){this.layoutRow(this.table.modules.columnCalcs.botRow)}if(this.table.modExists("groupRows")){this.layoutGroupCalcs(this.table.modules.groupRows.getGroups())}}}layoutGroupCalcs(t){t.forEach((t=>{if(t.calcs.top){this.layoutRow(t.calcs.top)}if(t.calcs.bottom){this.layoutRow(t.calcs.bottom)}if(t.groupList&&t.groupList.length){this.layoutGroupCalcs(t.groupList)}}))}layoutColumnPosition(t){var i=[];var e=0;var s=0;this.leftColumns.forEach(((s,r)=>{s.modules.frozen.marginValue=e;s.modules.frozen.margin=s.modules.frozen.marginValue+"px";if(s.visible){e+=s.getWidth()}if(r==this.leftColumns.length-1){s.modules.frozen.edge=true}else{s.modules.frozen.edge=false}if(s.parent.isGroup){var a=this.getColGroupParentElement(s);if(!i.includes(a)){this.layoutElement(a,s);i.push(a)}a.classList.toggle("tabulator-frozen-left",s.modules.frozen.edge&&s.modules.frozen.position==="left");a.classList.toggle("tabulator-frozen-right",s.modules.frozen.edge&&s.modules.frozen.position==="right")}else{this.layoutElement(s.getElement(),s)}if(t){s.cells.forEach((t=>{this.layoutElement(t.getElement(true),s)}))}}));this.rightColumns.forEach(((i,e)=>{i.modules.frozen.marginValue=s;i.modules.frozen.margin=i.modules.frozen.marginValue+"px";if(i.visible){s+=i.getWidth()}if(e==this.rightColumns.length-1){i.modules.frozen.edge=true}else{i.modules.frozen.edge=false}if(i.parent.isGroup){this.layoutElement(this.getColGroupParentElement(i),i)}else{this.layoutElement(i.getElement(),i)}if(t){i.cells.forEach((t=>{this.layoutElement(t.getElement(true),i)}))}}))}getColGroupParentElement(t){return t.parent.isGroup?this.getColGroupParentElement(t.parent):t.getElement()}layout(){if(this.active&&!this.blocked){this.layoutColumnPosition();this.reinitializeRows();this.layoutCalcRows()}}reinitializeRows(){var t=this.table.rowManager.getVisibleRows(true);var i=this.table.rowManager.getRows().filter((i=>!t.includes(i)));i.forEach((t=>{t.deinitialize()}));t.forEach((t=>{if(t.type==="row"){this.layoutRow(t)}}))}layoutRow(t){if(this.table.options.layout==="fitDataFill"&&this.rightColumns.length){this.table.rowManager.getTableElement().style.minWidth="calc(100% - "+this.rightMargin+")"}this.leftColumns.forEach((i=>{var e=t.getCell(i);if(e){this.layoutElement(e.getElement(true),i)}}));this.rightColumns.forEach((i=>{var e=t.getCell(i);if(e){this.layoutElement(e.getElement(true),i)}}))}layoutElement(t,i){var e;if(i.modules.frozen&&t){t.style.position="sticky";if(this.table.rtl){e=i.modules.frozen.position==="left"?"right":"left"}else{e=i.modules.frozen.position}t.style[e]=i.modules.frozen.margin;t.classList.add("tabulator-frozen");t.classList.toggle("tabulator-frozen-left",i.modules.frozen.edge&&i.modules.frozen.position==="left");t.classList.toggle("tabulator-frozen-right",i.modules.frozen.edge&&i.modules.frozen.position==="right")}}adjustForScrollbar(t){if(this.rightColumns.length){this.table.columnManager.getContentsElement().style.width="calc(100% - "+t+"px)"}}getFrozenColumns(){return this.leftColumns.concat(this.rightColumns)}_calcSpace(t,i){var e=0;for(let s=0;s<i;s++){if(t[s].visible){e+=t[s].getWidth()}}return e}}class ri extends S{static moduleName="frozenRows";constructor(t){super(t);this.topElement=document.createElement("div");this.rows=[];this.registerComponentFunction("row","freeze",this.freezeRow.bind(this));this.registerComponentFunction("row","unfreeze",this.unfreezeRow.bind(this));this.registerComponentFunction("row","isFrozen",this.isRowFrozen.bind(this));this.registerTableOption("frozenRowsField","id");this.registerTableOption("frozenRows",false)}initialize(){var t=document.createDocumentFragment();this.rows=[];this.topElement.classList.add("tabulator-frozen-rows-holder");t.appendChild(document.createElement("br"));t.appendChild(this.topElement);this.table.columnManager.getContentsElement().insertBefore(t,this.table.columnManager.headersElement.nextSibling);this.subscribe("row-deleting",this.detachRow.bind(this));this.subscribe("rows-visible",this.visibleRows.bind(this));this.registerDisplayHandler(this.getRows.bind(this),10);if(this.table.options.frozenRows){this.subscribe("data-processed",this.initializeRows.bind(this));this.subscribe("row-added",this.initializeRow.bind(this));this.subscribe("table-redrawing",this.resizeHolderWidth.bind(this));this.subscribe("column-resized",this.resizeHolderWidth.bind(this));this.subscribe("column-show",this.resizeHolderWidth.bind(this));this.subscribe("column-hide",this.resizeHolderWidth.bind(this))}this.resizeHolderWidth()}resizeHolderWidth(){this.topElement.style.minWidth=this.table.columnManager.headersElement.offsetWidth+"px"}initializeRows(){this.table.rowManager.getRows().forEach((t=>{this.initializeRow(t)}))}initializeRow(t){var i=this.table.options.frozenRows,e=typeof i;if(e==="number"){if(t.getPosition()&&t.getPosition()+this.rows.length<=i){this.freezeRow(t)}}else if(e==="function"){if(i.call(this.table,t.getComponent())){this.freezeRow(t)}}else if(Array.isArray(i)){if(i.includes(t.data[this.options("frozenRowsField")])){this.freezeRow(t)}}}isRowFrozen(t){var i=this.rows.indexOf(t);return i>-1}isFrozen(){return!!this.rows.length}visibleRows(t,i){this.rows.forEach((t=>{i.push(t)}));return i}getRows(t){var i=t.slice(0);this.rows.forEach((function(t){var e=i.indexOf(t);if(e>-1){i.splice(e,1)}}));return i}freezeRow(t){if(!t.modules.frozen){t.modules.frozen=true;this.topElement.appendChild(t.getElement());t.initialize();t.normalizeHeight();this.rows.push(t);this.refreshData(false,"display");this.table.rowManager.adjustTableSize();this.styleRows()}else{console.warn("Freeze Error - Row is already frozen")}}unfreezeRow(t){if(t.modules.frozen){t.modules.frozen=false;this.detachRow(t);this.table.rowManager.adjustTableSize();this.refreshData(false,"display");if(this.rows.length){this.styleRows()}}else{console.warn("Freeze Error - Row is already unfrozen")}}detachRow(t){var i=this.rows.indexOf(t);if(i>-1){var e=t.getElement();if(e.parentNode){e.parentNode.removeChild(e)}this.rows.splice(i,1)}}styleRows(t){this.rows.forEach(((t,i)=>{this.table.rowManager.styleRow(t,i)}))}}class ai{constructor(t){this._group=t;this.type="GroupComponent";return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._group.groupManager.table.componentFunctionBinder.handle("group",t._group,i)}}})}getKey(){return this._group.key}getField(){return this._group.field}getElement(){return this._group.element}getRows(){return this._group.getRows(true)}getSubGroups(){return this._group.getSubGroups(true)}getParentGroup(){return this._group.parent?this._group.parent.getComponent():false}isVisible(){return this._group.visible}show(){this._group.show()}hide(){this._group.hide()}toggle(){this._group.toggleVisibility()}scrollTo(t,i){return this._group.groupManager.table.rowManager.scrollToRow(this._group,t,i)}_getSelf(){return this._group}getTable(){return this._group.groupManager.table}}class oi{constructor(t,i,e,s,r,a,o){this.groupManager=t;this.parent=i;this.key=s;this.level=e;this.field=r;this.hasSubGroups=e<t.groupIDLookups.length-1;this.addRow=this.hasSubGroups?this._addRowToGroup:this._addRow;this.type="group";this.old=o;this.rows=[];this.groups=[];this.groupList=[];this.generator=a;this.element=false;this.elementContents=false;this.height=0;this.outerHeight=0;this.initialized=false;this.calcs={};this.initialized=false;this.modules={};this.arrowElement=false;this.visible=o?o.visible:typeof t.startOpen[e]!=="undefined"?t.startOpen[e]:t.startOpen[0];this.component=null;this.createElements();this.addBindings();this.createValueGroups()}wipe(t){if(!t){if(this.groupList.length){this.groupList.forEach((function(t){t.wipe()}))}else{this.rows.forEach((t=>{if(t.modules){delete t.modules.group}}))}}this.element=false;this.arrowElement=false;this.elementContents=false}createElements(){var t=document.createElement("div");t.classList.add("tabulator-arrow");this.element=document.createElement("div");this.element.classList.add("tabulator-row");this.element.classList.add("tabulator-group");this.element.classList.add("tabulator-group-level-"+this.level);this.element.setAttribute("role","rowgroup");this.arrowElement=document.createElement("div");this.arrowElement.classList.add("tabulator-group-toggle");this.arrowElement.appendChild(t);if(this.groupManager.table.options.movableRows!==false&&this.groupManager.table.modExists("moveRow")){this.groupManager.table.modules.moveRow.initializeGroupHeader(this)}}createValueGroups(){var t=this.level+1;if(this.groupManager.allowedValues&&this.groupManager.allowedValues[t]){this.groupManager.allowedValues[t].forEach((i=>{this._createGroup(i,t)}))}}addBindings(){var t;if(this.groupManager.table.options.groupToggleElement){t=this.groupManager.table.options.groupToggleElement=="arrow"?this.arrowElement:this.element;t.addEventListener("click",(t=>{if(this.groupManager.table.options.groupToggleElement==="arrow"){t.stopPropagation();t.stopImmediatePropagation()}setTimeout((()=>{this.toggleVisibility()}))}))}}_createGroup(t,i){var e=i+"_"+t;var s=new oi(this.groupManager,this,i,t,this.groupManager.groupIDLookups[i].field,this.groupManager.headerGenerator[i]||this.groupManager.headerGenerator[0],this.old?this.old.groups[e]:false);this.groups[e]=s;this.groupList.push(s)}_addRowToGroup(t){var i=this.level+1;if(this.hasSubGroups){var e=this.groupManager.groupIDLookups[i].func(t.getData()),s=i+"_"+e;if(this.groupManager.allowedValues&&this.groupManager.allowedValues[i]){if(this.groups[s]){this.groups[s].addRow(t)}}else{if(!this.groups[s]){this._createGroup(e,i)}this.groups[s].addRow(t)}}}_addRow(t){this.rows.push(t);t.modules.group=this}insertRow(t,i,e){var s=this.conformRowData({});t.updateData(s);var r=this.rows.indexOf(i);if(r>-1){if(e){this.rows.splice(r+1,0,t)}else{this.rows.splice(r,0,t)}}else{if(e){this.rows.push(t)}else{this.rows.unshift(t)}}t.modules.group=this;if(this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"){this.groupManager.table.modules.columnCalcs.recalcGroup(this)}this.groupManager.updateGroupRows(true)}scrollHeader(t){if(this.arrowElement){this.arrowElement.style.marginLeft=t;this.groupList.forEach((function(i){i.scrollHeader(t)}))}}getRowIndex(t){}conformRowData(t){if(this.field){t[this.field]=this.key}else{console.warn("Data Conforming Error - Cannot conform row data to match new group as groupBy is a function")}if(this.parent){t=this.parent.conformRowData(t)}return t}removeRow(t){var i=this.rows.indexOf(t);var e=t.getElement();if(i>-1){this.rows.splice(i,1)}if(!this.groupManager.table.options.groupValues&&!this.rows.length){if(this.parent){this.parent.removeGroup(this)}else{this.groupManager.removeGroup(this)}this.groupManager.updateGroupRows(true)}else{if(e.parentNode){e.parentNode.removeChild(e)}if(!this.groupManager.blockRedraw){this.generateGroupHeaderContents();if(this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.options.columnCalcs!="table"){this.groupManager.table.modules.columnCalcs.recalcGroup(this)}}}}removeGroup(t){var i=t.level+"_"+t.key,e;if(this.groups[i]){delete this.groups[i];e=this.groupList.indexOf(t);if(e>-1){this.groupList.splice(e,1)}if(!this.groupList.length){if(this.parent){this.parent.removeGroup(this)}else{this.groupManager.removeGroup(this)}}}}getHeadersAndRows(){var t=[];t.push(this);this._visSet();if(this.calcs.top){this.calcs.top.detachElement();this.calcs.top.deleteCells()}if(this.calcs.bottom){this.calcs.bottom.detachElement();this.calcs.bottom.deleteCells()}if(this.visible){if(this.groupList.length){this.groupList.forEach((function(i){t=t.concat(i.getHeadersAndRows())}))}else{if(this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasTopCalcs()){this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);t.push(this.calcs.top)}t=t.concat(this.rows);if(this.groupManager.table.options.columnCalcs!="table"&&this.groupManager.table.modExists("columnCalcs")&&this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);t.push(this.calcs.bottom)}}}else{if(!this.groupList.length&&this.groupManager.table.options.columnCalcs!="table"){if(this.groupManager.table.modExists("columnCalcs")){if(this.groupManager.table.modules.columnCalcs.hasTopCalcs()){if(this.groupManager.table.options.groupClosedShowCalcs){this.calcs.top=this.groupManager.table.modules.columnCalcs.generateTopRow(this.rows);t.push(this.calcs.top)}}if(this.groupManager.table.modules.columnCalcs.hasBottomCalcs()){if(this.groupManager.table.options.groupClosedShowCalcs){this.calcs.bottom=this.groupManager.table.modules.columnCalcs.generateBottomRow(this.rows);t.push(this.calcs.bottom)}}}}}return t}getData(t,i){var e=[];this._visSet();if(!t||t&&this.visible){this.rows.forEach((t=>{e.push(t.getData(i||"data"))}))}return e}getRowCount(){var t=0;if(this.groupList.length){this.groupList.forEach((i=>{t+=i.getRowCount()}))}else{t=this.rows.length}return t}toggleVisibility(){if(this.visible){this.hide()}else{this.show()}}hide(){this.visible=false;if(this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination){this.element.classList.remove("tabulator-group-visible");if(this.groupList.length){this.groupList.forEach((t=>{var i=t.getHeadersAndRows();i.forEach((t=>{t.detachElement()}))}))}else{this.rows.forEach((t=>{var i=t.getElement();i.parentNode.removeChild(i)}))}this.groupManager.updateGroupRows(true)}else{this.groupManager.updateGroupRows(true)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),false)}show(){this.visible=true;if(this.groupManager.table.rowManager.getRenderMode()=="basic"&&!this.groupManager.table.options.pagination){this.element.classList.add("tabulator-group-visible");var t=this.generateElement();if(this.groupList.length){this.groupList.forEach((i=>{var e=i.getHeadersAndRows();e.forEach((i=>{var e=i.getElement();t.parentNode.insertBefore(e,t.nextSibling);i.initialize();t=e}))}))}else{this.rows.forEach((i=>{var e=i.getElement();t.parentNode.insertBefore(e,t.nextSibling);i.initialize();t=e}))}this.groupManager.updateGroupRows(true)}else{this.groupManager.updateGroupRows(true)}this.groupManager.table.externalEvents.dispatch("groupVisibilityChanged",this.getComponent(),true)}_visSet(){var t=[];if(typeof this.visible=="function"){this.rows.forEach((function(i){t.push(i.getData())}));this.visible=this.visible(this.key,this.getRowCount(),t,this.getComponent())}}getRowGroup(t){var i=false;if(this.groupList.length){this.groupList.forEach((function(e){var s=e.getRowGroup(t);if(s){i=s}}))}else{if(this.rows.find((function(i){return i===t}))){i=this}}return i}getSubGroups(t){var i=[];this.groupList.forEach((function(e){i.push(t?e.getComponent():e)}));return i}getRows(t,i){var e=[];if(i&&this.groupList.length){this.groupList.forEach((s=>{e=e.concat(s.getRows(t,i))}))}else{this.rows.forEach((function(i){e.push(t?i.getComponent():i)}))}return e}generateGroupHeaderContents(){var t=[];var i=this.getRows(false,true);i.forEach((function(i){t.push(i.getData())}));this.elementContents=this.generator(this.key,this.getRowCount(),t,this.getComponent());while(this.element.firstChild)this.element.removeChild(this.element.firstChild);if(typeof this.elementContents==="string"){this.element.innerHTML=this.elementContents}else{this.element.appendChild(this.elementContents)}this.element.insertBefore(this.arrowElement,this.element.firstChild)}getPath(t=[]){t.unshift(this.key);if(this.parent){this.parent.getPath(t)}return t}getElement(){return this.elementContents?this.element:this.generateElement()}generateElement(){this.addBindings=false;this._visSet();if(this.visible){this.element.classList.add("tabulator-group-visible")}else{this.element.classList.remove("tabulator-group-visible")}for(var t=0;t<this.element.childNodes.length;++t){this.element.childNodes[t].parentNode.removeChild(this.element.childNodes[t])}this.generateGroupHeaderContents();return this.element}detachElement(){if(this.element&&this.element.parentNode){this.element.parentNode.removeChild(this.element)}}normalizeHeight(){this.setHeight(this.element.clientHeight)}initialize(t){if(!this.initialized||t){this.normalizeHeight();this.initialized=true}}reinitialize(){this.initialized=false;this.height=0;if(z.elVisible(this.element)){this.initialize(true)}}setHeight(t){if(this.height!=t){this.height=t;this.outerHeight=this.element.offsetHeight}}getHeight(){return this.outerHeight}getGroup(){return this}reinitializeHeight(){}calcHeight(){}setCellHeight(){}clearCellHeight(){}deinitializeHeight(){}rendered(){}getComponent(){if(!this.component){this.component=new ai(this)}return this.component}}class hi extends S{static moduleName="groupRows";constructor(t){super(t);this.groupIDLookups=false;this.startOpen=[function(){return false}];this.headerGenerator=[function(){return""}];this.groupList=[];this.allowedValues=false;this.groups={};this.displayHandler=this.getRows.bind(this);this.blockRedraw=false;this.registerTableOption("groupBy",false);this.registerTableOption("groupStartOpen",true);this.registerTableOption("groupValues",false);this.registerTableOption("groupUpdateOnCellEdit",false);this.registerTableOption("groupHeader",false);this.registerTableOption("groupHeaderPrint",null);this.registerTableOption("groupHeaderClipboard",null);this.registerTableOption("groupHeaderHtmlOutput",null);this.registerTableOption("groupHeaderDownload",null);this.registerTableOption("groupToggleElement","arrow");this.registerTableOption("groupClosedShowCalcs",false);this.registerTableFunction("setGroupBy",this.setGroupBy.bind(this));this.registerTableFunction("setGroupValues",this.setGroupValues.bind(this));this.registerTableFunction("setGroupStartOpen",this.setGroupStartOpen.bind(this));this.registerTableFunction("setGroupHeader",this.setGroupHeader.bind(this));this.registerTableFunction("getGroups",this.userGetGroups.bind(this));this.registerTableFunction("getGroupedData",this.userGetGroupedData.bind(this));this.registerComponentFunction("row","getGroup",this.rowGetGroup.bind(this))}initialize(){this.subscribe("table-destroy",this._blockRedrawing.bind(this));this.subscribe("rows-wipe",this._blockRedrawing.bind(this));this.subscribe("rows-wiped",this._restore_redrawing.bind(this));if(this.table.options.groupBy){if(this.table.options.groupUpdateOnCellEdit){this.subscribe("cell-value-updated",this.cellUpdated.bind(this));this.subscribe("row-data-changed",this.reassignRowToGroup.bind(this),0)}this.subscribe("table-built",this.configureGroupSetup.bind(this));this.subscribe("row-deleting",this.rowDeleting.bind(this));this.subscribe("row-deleted",this.rowsUpdated.bind(this));this.subscribe("scroll-horizontal",this.scrollHeaders.bind(this));this.subscribe("rows-wipe",this.wipe.bind(this));this.subscribe("rows-added",this.rowsUpdated.bind(this));this.subscribe("row-moving",this.rowMoving.bind(this));this.subscribe("row-adding-index",this.rowAddingIndex.bind(this));this.subscribe("rows-sample",this.rowSample.bind(this));this.subscribe("render-virtual-fill",this.virtualRenderFill.bind(this));this.registerDisplayHandler(this.displayHandler,20);this.initialized=true}}_blockRedrawing(){this.blockRedraw=true}_restore_redrawing(){this.blockRedraw=false}configureGroupSetup(){if(this.table.options.groupBy){var t=this.table.options.groupBy,i=this.table.options.groupStartOpen,e=this.table.options.groupHeader;this.allowedValues=this.table.options.groupValues;if(Array.isArray(t)&&Array.isArray(e)&&t.length>e.length){console.warn("Error creating group headers, groupHeader array is shorter than groupBy array")}this.headerGenerator=[function(){return""}];this.startOpen=[function(){return false}];this.langBind("groups|item",((t,i)=>{this.headerGenerator[0]=(e,s,r)=>(typeof e==="undefined"?"":e)+"<span>("+s+" "+(s===1?t:i.groups.items)+")</span>"}));this.groupIDLookups=[];if(t){if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="table"&&this.table.options.columnCalcs!="both"){this.table.modules.columnCalcs.removeCalcs()}}else{if(this.table.modExists("columnCalcs")&&this.table.options.columnCalcs!="group"){var s=this.table.columnManager.getRealColumns();s.forEach((t=>{if(t.definition.topCalc){this.table.modules.columnCalcs.initializeTopRow()}if(t.definition.bottomCalc){this.table.modules.columnCalcs.initializeBottomRow()}}))}}if(!Array.isArray(t)){t=[t]}t.forEach(((t,i)=>{var e,s;if(typeof t=="function"){e=t}else{s=this.table.columnManager.getColumnByField(t);if(s){e=function(t){return s.getFieldValue(t)}}else{e=function(i){return i[t]}}}this.groupIDLookups.push({field:typeof t==="function"?false:t,func:e,values:this.allowedValues?this.allowedValues[i]:false})}));if(i){if(!Array.isArray(i)){i=[i]}i.forEach((t=>{}));this.startOpen=i}if(e){this.headerGenerator=Array.isArray(e)?e:[e]}}else{this.groupList=[];this.groups={}}}rowSample(t,i){if(this.table.options.groupBy){var e=this.getGroups(false)[0];i.push(e.getRows(false)[0])}return i}virtualRenderFill(){var t=this.table.rowManager.tableElement;var i=this.table.rowManager.getVisibleRows();if(this.table.options.groupBy){i=i.filter((t=>t.type!=="group"));t.style.minWidth=!i.length?this.table.columnManager.getWidth()+"px":""}else{return i}}rowAddingIndex(t,i,e){if(this.table.options.groupBy){this.assignRowToGroup(t);var s=t.modules.group.rows;if(s.length>1){if(!i||i&&s.indexOf(i)==-1){if(e){if(s[0]!==t){i=s[0];this.table.rowManager.moveRowInArray(t.modules.group.rows,t,i,!e)}}else{if(s[s.length-1]!==t){i=s[s.length-1];this.table.rowManager.moveRowInArray(t.modules.group.rows,t,i,!e)}}}else{this.table.rowManager.moveRowInArray(t.modules.group.rows,t,i,!e)}}return i}}trackChanges(){this.dispatch("group-changed")}setGroupBy(t){this.table.options.groupBy=t;if(!this.initialized){this.initialize()}this.configureGroupSetup();if(!t&&this.table.modExists("columnCalcs")&&this.table.options.columnCalcs===true){this.table.modules.columnCalcs.reinitializeCalcs()}this.refreshData();this.trackChanges()}setGroupValues(t){this.table.options.groupValues=t;this.configureGroupSetup();this.refreshData();this.trackChanges()}setGroupStartOpen(t){this.table.options.groupStartOpen=t;this.configureGroupSetup();if(this.table.options.groupBy){this.refreshData();this.trackChanges()}else{console.warn("Grouping Update - cant refresh view, no groups have been set")}}setGroupHeader(t){this.table.options.groupHeader=t;this.configureGroupSetup();if(this.table.options.groupBy){this.refreshData();this.trackChanges()}else{console.warn("Grouping Update - cant refresh view, no groups have been set")}}userGetGroups(t){return this.getGroups(true)}userGetGroupedData(){return this.table.options.groupBy?this.getGroupedData():this.getData()}rowGetGroup(t){return t.modules.group?t.modules.group.getComponent():false}rowMoving(t,i,e){if(this.table.options.groupBy){if(!e&&i instanceof oi){i=this.table.rowManager.prevDisplayRow(t)||i}var s=i instanceof oi?i:i.modules.group;var r=t instanceof oi?t:t.modules.group;if(s===r){this.table.rowManager.moveRowInArray(s.rows,t,i,e)}else{if(r){r.removeRow(t)}s.insertRow(t,i,e)}}}rowDeleting(t){if(this.table.options.groupBy&&t.modules.group){t.modules.group.removeRow(t)}}rowsUpdated(t){if(this.table.options.groupBy){this.updateGroupRows(true)}}cellUpdated(t){if(this.table.options.groupBy){this.reassignRowToGroup(t.row)}}getRows(t){if(this.table.options.groupBy&&this.groupIDLookups.length){this.dispatchExternal("dataGrouping");this.generateGroups(t);if(this.subscribedExternal("dataGrouped")){this.dispatchExternal("dataGrouped",this.getGroups(true))}return this.updateGroupRows()}else{return t.slice(0)}}getGroups(t){var i=[];this.groupList.forEach((function(e){i.push(t?e.getComponent():e)}));return i}getChildGroups(t){var i=[];if(!t){t=this}t.groupList.forEach((t=>{if(t.groupList.length){i=i.concat(this.getChildGroups(t))}else{i.push(t)}}));return i}wipe(){if(this.table.options.groupBy){this.groupList.forEach((function(t){t.wipe()}));this.groupList=[];this.groups={}}}pullGroupListData(t){var i=[];t.forEach((t=>{var e={};e.level=0;e.rowCount=0;e.headerContent="";var s=[];if(t.hasSubGroups){s=this.pullGroupListData(t.groupList);e.level=t.level;e.rowCount=s.length-t.groupList.length;e.headerContent=t.generator(t.key,e.rowCount,t.rows,t);i.push(e);i=i.concat(s)}else{e.level=t.level;e.headerContent=t.generator(t.key,t.rows.length,t.rows,t);e.rowCount=t.getRows().length;i.push(e);t.getRows().forEach((t=>{i.push(t.getData("data"))}))}}));return i}getGroupedData(){return this.pullGroupListData(this.groupList)}getRowGroup(t){var i=false;if(this.options("dataTree")){t=this.table.modules.dataTree.getTreeParentRoot(t)}this.groupList.forEach((e=>{var s=e.getRowGroup(t);if(s){i=s}}));return i}countGroups(){return this.groupList.length}generateGroups(t){var i=this.groups;this.groups={};this.groupList=[];if(this.allowedValues&&this.allowedValues[0]){this.allowedValues[0].forEach((t=>{this.createGroup(t,0,i)}));t.forEach((t=>{this.assignRowToExistingGroup(t,i)}))}else{t.forEach((t=>{this.assignRowToGroup(t,i)}))}Object.values(i).forEach((t=>{t.wipe(true)}))}createGroup(t,i,e){var s=i+"_"+t,r;e=e||[];r=new oi(this,false,i,t,this.groupIDLookups[0].field,this.headerGenerator[0],e[s]);this.groups[s]=r;this.groupList.push(r)}assignRowToExistingGroup(t,i){var e=this.groupIDLookups[0].func(t.getData()),s="0_"+e;if(this.groups[s]){this.groups[s].addRow(t)}}assignRowToGroup(t,i){var e=this.groupIDLookups[0].func(t.getData()),s=!this.groups["0_"+e];if(s){this.createGroup(e,0,i)}this.groups["0_"+e].addRow(t);return!s}reassignRowToGroup(t){if(t.type==="row"){var i=t.modules.group,e=i.getPath(),s=this.getExpectedPath(t),r;r=e.length==s.length&&e.every(((t,i)=>t===s[i]));if(!r){i.removeRow(t);this.assignRowToGroup(t,this.groups);this.refreshData(true)}}}getExpectedPath(t){var i=[],e=t.getData();this.groupIDLookups.forEach((t=>{i.push(t.func(e))}));return i}updateGroupRows(t){var i=[];if(!this.blockRedraw){this.groupList.forEach((t=>{i=i.concat(t.getHeadersAndRows())}));if(t){this.refreshData(true)}}return i}scrollHeaders(t){if(this.table.options.groupBy){if(this.table.options.renderHorizontal==="virtual"){t-=this.table.columnManager.renderer.vDomPadLeft}t=t+"px";this.groupList.forEach((i=>{i.scrollHeader(t)}))}}removeGroup(t){var i=t.level+"_"+t.key,e;if(this.groups[i]){delete this.groups[i];e=this.groupList.indexOf(t);if(e>-1){this.groupList.splice(e,1)}}}checkBasicModeGroupHeaderWidth(){var t=this.table.rowManager.tableElement,i=true;this.table.rowManager.getDisplayRows().forEach(((e,s)=>{this.table.rowManager.styleRow(e,s);t.appendChild(e.getElement());e.initialize(true);if(e.type!=="group"){i=false}}));if(i){t.style.minWidth=this.table.columnManager.getWidth()+"px"}else{t.style.minWidth=""}}}var li={cellEdit:function(t){t.component.setValueProcessData(t.data.oldValue);t.component.cellRendered()},rowAdd:function(t){t.component.deleteActual();this.table.rowManager.checkPlaceholder()},rowDelete:function(t){var i=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);if(this.table.options.groupBy&&this.table.modExists("groupRows")){this.table.modules.groupRows.updateGroupRows(true)}this._rebindRow(t.component,i);this.table.rowManager.checkPlaceholder()},rowMove:function(t){var i=t.data.posFrom-t.data.posTo>0;this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posFrom),i);this.table.rowManager.regenerateRowPositions();this.table.rowManager.reRenderInPosition()}};var ni={cellEdit:function(t){t.component.setValueProcessData(t.data.newValue);t.component.cellRendered()},rowAdd:function(t){var i=this.table.rowManager.addRowActual(t.data.data,t.data.pos,t.data.index);if(this.table.options.groupBy&&this.table.modExists("groupRows")){this.table.modules.groupRows.updateGroupRows(true)}this._rebindRow(t.component,i);this.table.rowManager.checkPlaceholder()},rowDelete:function(t){t.component.deleteActual();this.table.rowManager.checkPlaceholder()},rowMove:function(t){this.table.rowManager.moveRowActual(t.component,this.table.rowManager.getRowFromPosition(t.data.posTo),t.data.after);this.table.rowManager.regenerateRowPositions();this.table.rowManager.reRenderInPosition()}};var ui={undo:["ctrl + 90","meta + 90"],redo:["ctrl + 89","meta + 89"]};var fi={undo:function(t){var i=false;if(this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")){i=this.table.modules.edit.currentCell;if(!i){t.preventDefault();this.table.modules.history.undo()}}},redo:function(t){var i=false;if(this.table.options.history&&this.table.modExists("history")&&this.table.modExists("edit")){i=this.table.modules.edit.currentCell;if(!i){t.preventDefault();this.table.modules.history.redo()}}}};var ci={keybindings:{bindings:ui,actions:fi}};class di extends S{static moduleName="history";static moduleExtensions=ci;static undoers=li;static redoers=ni;constructor(t){super(t);this.history=[];this.index=-1;this.registerTableOption("history",false)}initialize(){if(this.table.options.history){this.subscribe("cell-value-updated",this.cellUpdated.bind(this));this.subscribe("cell-delete",this.clearComponentHistory.bind(this));this.subscribe("row-delete",this.rowDeleted.bind(this));this.subscribe("rows-wipe",this.clear.bind(this));this.subscribe("row-added",this.rowAdded.bind(this));this.subscribe("row-move",this.rowMoved.bind(this))}this.registerTableFunction("undo",this.undo.bind(this));this.registerTableFunction("redo",this.redo.bind(this));this.registerTableFunction("getHistoryUndoSize",this.getHistoryUndoSize.bind(this));this.registerTableFunction("getHistoryRedoSize",this.getHistoryRedoSize.bind(this));this.registerTableFunction("clearHistory",this.clear.bind(this))}rowMoved(t,i,e){this.action("rowMove",t,{posFrom:t.getPosition(),posTo:i.getPosition(),to:i,after:e})}rowAdded(t,i,e,s){this.action("rowAdd",t,{data:i,pos:e,index:s})}rowDeleted(t){var i,e;if(this.table.options.groupBy){e=t.getComponent().getGroup()._getSelf().rows;i=e.indexOf(t);if(i){i=e[i-1]}}else{i=t.table.rowManager.getRowIndex(t);if(i){i=t.table.rowManager.rows[i-1]}}this.action("rowDelete",t,{data:t.getData(),pos:!i,index:i})}cellUpdated(t){this.action("cellEdit",t,{oldValue:t.oldValue,newValue:t.value})}clear(){this.history=[];this.index=-1}action(t,i,e){this.history=this.history.slice(0,this.index+1);this.history.push({type:t,component:i,data:e});this.index++}getHistoryUndoSize(){return this.index+1}getHistoryRedoSize(){return this.history.length-(this.index+1)}clearComponentHistory(t){var i=this.history.findIndex((function(i){return i.component===t}));if(i>-1){this.history.splice(i,1);if(i<=this.index){this.index--}this.clearComponentHistory(t)}}undo(){if(this.index>-1){let t=this.history[this.index];di.undoers[t.type].call(this,t);this.index--;this.dispatchExternal("historyUndo",t.type,t.component.getComponent(),t.data);return true}else{console.warn(this.options("history")?"History Undo Error - No more history to undo":"History module not enabled");return false}}redo(){if(this.history.length-1>this.index){this.index++;let t=this.history[this.index];di.redoers[t.type].call(this,t);this.dispatchExternal("historyRedo",t.type,t.component.getComponent(),t.data);return true}else{console.warn(this.options("history")?"History Redo Error - No more history to redo":"History module not enabled");return false}}_rebindRow(t,i){this.history.forEach((function(e){if(e.component instanceof Y){if(e.component===t){e.component=i}}else if(e.component instanceof q){if(e.component.row===t){var s=e.component.column.getField();if(s){e.component=i.getCell(s)}}}}))}}class bi extends S{static moduleName="htmlTableImport";constructor(t){super(t);this.fieldIndex=[];this.hasIndex=false}initialize(){this.tableElementCheck()}tableElementCheck(){if(this.table.originalElement&&this.table.originalElement.tagName==="TABLE"){if(this.table.originalElement.childNodes.length){this.parseTable()}else{console.warn("Unable to parse data from empty table tag, Tabulator should be initialized on a div tag unless importing data from a table element.")}}}parseTable(){var t=this.table.originalElement,i=this.table.options,e=t.getElementsByTagName("th"),s=t.getElementsByTagName("tbody")[0],r=[];this.hasIndex=false;this.dispatchExternal("htmlImporting");s=s?s.getElementsByTagName("tr"):[];this._extractOptions(t,i);if(e.length){this._extractHeaders(e,s)}else{this._generateBlankHeaders(e,s)}for(var a=0;a<s.length;a++){var o=s[a],h=o.getElementsByTagName("td"),l={};if(!this.hasIndex){l[i.index]=a}for(var n=0;n<h.length;n++){var u=h[n];if(typeof this.fieldIndex[n]!=="undefined"){l[this.fieldIndex[n]]=u.innerHTML}}r.push(l)}i.data=r;this.dispatchExternal("htmlImported")}_extractOptions(t,i,e){var s=t.attributes;var r=e?Object.keys(e):Object.keys(i);var a={};r.forEach((t=>{a[t.toLowerCase()]=t}));for(var o in s){var h=s[o];var l;if(h&&typeof h=="object"&&h.name&&h.name.indexOf("tabulator-")===0){l=h.name.replace("tabulator-","");if(typeof a[l]!=="undefined"){i[a[l]]=this._attribValue(h.value)}}}}_attribValue(t){if(t==="true"){return true}if(t==="false"){return false}return t}_findCol(t){var i=this.table.options.columns.find((i=>i.title===t));return i||false}_extractHeaders(t,i){for(var e=0;e<t.length;e++){var s=t[e],r=false,a=this._findCol(s.textContent),o;if(a){r=true}else{a={title:s.textContent.trim()}}if(!a.field){a.field=s.textContent.trim().toLowerCase().replaceAll(" ","_")}o=s.getAttribute("width");if(o&&!a.width){a.width=o}this._extractOptions(s,a,this.table.columnManager.optionsList.registeredDefaults);this.fieldIndex[e]=a.field;if(a.field==this.table.options.index){this.hasIndex=true}if(!r){this.table.options.columns.push(a)}}}_generateBlankHeaders(t,i){for(var e=0;e<t.length;e++){var s=t[e],r={title:"",field:"col"+e};this.fieldIndex[e]=r.field;var a=s.getAttribute("width");if(a){r.width=a}this.table.options.columns.push(r)}}}function pi(t){var i=[],e=0,s=0,r=false;for(let a=0;a<t.length;a++){let o=t[a],h=t[a+1];if(!i[e]){i[e]=[]}if(!i[e][s]){i[e][s]=""}if(o=='"'&&r&&h=='"'){i[e][s]+=o;a++;continue}if(o=='"'){r=!r;continue}if(o==","&&!r){s++;continue}if(o=="\r"&&h=="\n"&&!r){s=0;e++;a++;continue}if((o=="\r"||o=="\n")&&!r){s=0;e++;continue}i[e][s]+=o}return i}function mi(t){try{return JSON.parse(t)}catch(t){console.warn("JSON Import Error - File contents is invalid JSON",t);return Promise.reject()}}function gi(t){return t}function vi(t){var i=this.dependencyRegistry.lookup("XLSX"),e=i.read(t),s=e.Sheets[e.SheetNames[0]];return i.utils.sheet_to_json(s,{header:1})}var wi={csv:pi,json:mi,array:gi,xlsx:vi};class yi extends S{static moduleName="import";static importers=wi;constructor(t){super(t);this.registerTableOption("importFormat");this.registerTableOption("importReader","text");this.registerTableOption("importHeaderTransform");this.registerTableOption("importValueTransform");this.registerTableOption("importDataValidator");this.registerTableOption("importFileValidator")}initialize(){this.registerTableFunction("import",this.importFromFile.bind(this));if(this.table.options.importFormat){this.subscribe("data-loading",this.loadDataCheck.bind(this),10);this.subscribe("data-load",this.loadData.bind(this),10)}}loadDataCheck(t){return this.table.options.importFormat&&(typeof t==="string"||Array.isArray(t)&&t.length&&Array.isArray(t))}loadData(t,i,e,s,r){return this.importData(this.lookupImporter(),t).then(this.structureData.bind(this)).catch((t=>{console.error("Import Error:",t||"Unable to import data");return Promise.reject(t)}))}lookupImporter(t){var i;if(!t){t=this.table.options.importFormat}if(typeof t==="string"){i=yi.importers[t]}else{i=t}if(!i){console.error("Import Error - Importer not found:",t)}return i}importFromFile(t,i,e){var s=this.lookupImporter(t);if(s){return this.pickFile(i,e).then(this.importData.bind(this,s)).then(this.structureData.bind(this)).then(this.mutateData.bind(this)).then(this.validateData.bind(this)).then(this.setData.bind(this)).catch((t=>{this.dispatch("import-error",t);this.dispatchExternal("importError",t);console.error("Import Error:",t||"Unable to import file");this.table.dataLoader.alertError();setTimeout((()=>{this.table.dataLoader.clearAlert()}),3e3);return Promise.reject(t)}))}}pickFile(t,i){return new Promise(((e,s)=>{var r=document.createElement("input");r.type="file";r.accept=t;r.addEventListener("change",(t=>{var a=r.files[0],o=new FileReader,h=this.validateFile(a);if(h===true){this.dispatch("import-importing",r.files);this.dispatchExternal("importImporting",r.files);switch(i||this.table.options.importReader){case"buffer":o.readAsArrayBuffer(a);break;case"binary":o.readAsBinaryString(a);break;case"url":o.readAsDataURL(a);break;case"text":default:o.readAsText(a)}o.onload=t=>{e(o.result)};o.onerror=t=>{console.warn("File Load Error - Unable to read file");s(t)}}else{s(h)}}));this.dispatch("import-choose");this.dispatchExternal("importChoose");r.click()}))}importData(t,i){var e;this.table.dataLoader.alertLoader();return new Promise(((s,r)=>{setTimeout((()=>{e=t.call(this.table,i);if(e instanceof Promise){s(e)}else{e?s(e):r()}}),10)}))}structureData(t){var i=[];if(Array.isArray(t)&&t.length&&Array.isArray(t[0])){if(this.table.options.autoColumns){i=this.structureArrayToObject(t)}else{i=this.structureArrayToColumns(t)}return i}else{return t}}mutateData(t){var i=[];if(Array.isArray(t)){t.forEach((t=>{i.push(this.table.modules.mutator.transformRow(t,"import"))}))}else{i=t}return i}transformHeader(t){var i=[];if(this.table.options.importHeaderTransform){t.forEach((e=>{i.push(this.table.options.importHeaderTransform.call(this.table,e,t))}))}else{return t}return i}transformData(t){var i=[];if(this.table.options.importValueTransform){t.forEach((e=>{i.push(this.table.options.importValueTransform.call(this.table,e,t))}))}else{return t}return i}structureArrayToObject(t){var i=this.transformHeader(t.shift());var e=t.map((t=>{var e={};t=this.transformData(t);i.forEach(((i,s)=>{e[i]=t[s]}));return e}));return e}structureArrayToColumns(t){var i=[],e=this.transformHeader(t[0]),s=this.table.getColumns();if(s[0]&&e[0]){if(s[0].getDefinition().title===e[0]){t.shift()}}t.forEach((t=>{var e={};t=this.transformData(t);t.forEach(((t,i)=>{var r=s[i];if(r){e[r.getField()]=t}}));i.push(e)}));return i}validateFile(t){if(this.table.options.importFileValidator){return this.table.options.importFileValidator.call(this.table,t)}return true}validateData(t){var i;if(this.table.options.importDataValidator){i=this.table.options.importDataValidator.call(this.table,t);if(i===true){return t}else{return Promise.reject(i)}}return t}setData(t){this.dispatch("import-imported",t);this.dispatchExternal("importImported",t);this.table.dataLoader.clearAlert();return this.table.setData(t)}}class xi extends S{static moduleName="interaction";constructor(t){super(t);this.eventMap={rowClick:"row-click",rowDblClick:"row-dblclick",rowContext:"row-contextmenu",rowMouseEnter:"row-mouseenter",rowMouseLeave:"row-mouseleave",rowMouseOver:"row-mouseover",rowMouseOut:"row-mouseout",rowMouseMove:"row-mousemove",rowMouseDown:"row-mousedown",rowMouseUp:"row-mouseup",rowTap:"row",rowDblTap:"row",rowTapHold:"row",cellClick:"cell-click",cellDblClick:"cell-dblclick",cellContext:"cell-contextmenu",cellMouseEnter:"cell-mouseenter",cellMouseLeave:"cell-mouseleave",cellMouseOver:"cell-mouseover",cellMouseOut:"cell-mouseout",cellMouseMove:"cell-mousemove",cellMouseDown:"cell-mousedown",cellMouseUp:"cell-mouseup",cellTap:"cell",cellDblTap:"cell",cellTapHold:"cell",headerClick:"column-click",headerDblClick:"column-dblclick",headerContext:"column-contextmenu",headerMouseEnter:"column-mouseenter",headerMouseLeave:"column-mouseleave",headerMouseOver:"column-mouseover",headerMouseOut:"column-mouseout",headerMouseMove:"column-mousemove",headerMouseDown:"column-mousedown",headerMouseUp:"column-mouseup",headerTap:"column",headerDblTap:"column",headerTapHold:"column",groupClick:"group-click",groupDblClick:"group-dblclick",groupContext:"group-contextmenu",groupMouseEnter:"group-mouseenter",groupMouseLeave:"group-mouseleave",groupMouseOver:"group-mouseover",groupMouseOut:"group-mouseout",groupMouseMove:"group-mousemove",groupMouseDown:"group-mousedown",groupMouseUp:"group-mouseup",groupTap:"group",groupDblTap:"group",groupTapHold:"group"};this.subscribers={};this.touchSubscribers={};this.columnSubscribers={};this.touchWatchers={row:{tap:null,tapDbl:null,tapHold:null},cell:{tap:null,tapDbl:null,tapHold:null},column:{tap:null,tapDbl:null,tapHold:null},group:{tap:null,tapDbl:null,tapHold:null}};this.registerColumnOption("headerClick");this.registerColumnOption("headerDblClick");this.registerColumnOption("headerContext");this.registerColumnOption("headerMouseEnter");this.registerColumnOption("headerMouseLeave");this.registerColumnOption("headerMouseOver");this.registerColumnOption("headerMouseOut");this.registerColumnOption("headerMouseMove");this.registerColumnOption("headerMouseDown");this.registerColumnOption("headerMouseUp");this.registerColumnOption("headerTap");this.registerColumnOption("headerDblTap");this.registerColumnOption("headerTapHold");this.registerColumnOption("cellClick");this.registerColumnOption("cellDblClick");this.registerColumnOption("cellContext");this.registerColumnOption("cellMouseEnter");this.registerColumnOption("cellMouseLeave");this.registerColumnOption("cellMouseOver");this.registerColumnOption("cellMouseOut");this.registerColumnOption("cellMouseMove");this.registerColumnOption("cellMouseDown");this.registerColumnOption("cellMouseUp");this.registerColumnOption("cellTap");this.registerColumnOption("cellDblTap");this.registerColumnOption("cellTapHold")}initialize(){this.initializeExternalEvents();this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("cell-dblclick",this.cellContentsSelectionFixer.bind(this));this.subscribe("scroll-horizontal",this.clearTouchWatchers.bind(this));this.subscribe("scroll-vertical",this.clearTouchWatchers.bind(this))}clearTouchWatchers(){var t=Object.values(this.touchWatchers);t.forEach((t=>{for(let i in t){t[i]=null}}))}cellContentsSelectionFixer(t,i){var e;if(this.table.modExists("edit")){if(this.table.modules.edit.currentCell===i){return}}t.preventDefault();try{if(document.selection){e=document.body.createTextRange();e.moveToElementText(i.getElement());e.select()}else if(window.getSelection){e=document.createRange();e.selectNode(i.getElement());window.getSelection().removeAllRanges();window.getSelection().addRange(e)}}catch(t){}}initializeExternalEvents(){for(let t in this.eventMap){this.subscriptionChangeExternal(t,this.subscriptionChanged.bind(this,t))}}subscriptionChanged(t,i){if(i){if(!this.subscribers[t]){if(this.eventMap[t].includes("-")){this.subscribers[t]=this.handle.bind(this,t);this.subscribe(this.eventMap[t],this.subscribers[t])}else{this.subscribeTouchEvents(t)}}}else{if(this.eventMap[t].includes("-")){if(this.subscribers[t]&&!this.columnSubscribers[t]&&!this.subscribedExternal(t)){this.unsubscribe(this.eventMap[t],this.subscribers[t]);delete this.subscribers[t]}}else{this.unsubscribeTouchEvents(t)}}}subscribeTouchEvents(t){var i=this.eventMap[t];if(!this.touchSubscribers[i+"-touchstart"]){this.touchSubscribers[i+"-touchstart"]=this.handleTouch.bind(this,i,"start");this.touchSubscribers[i+"-touchend"]=this.handleTouch.bind(this,i,"end");this.subscribe(i+"-touchstart",this.touchSubscribers[i+"-touchstart"]);this.subscribe(i+"-touchend",this.touchSubscribers[i+"-touchend"])}this.subscribers[t]=true}unsubscribeTouchEvents(t){var i=true,e=this.eventMap[t];if(this.subscribers[t]&&!this.subscribedExternal(t)){delete this.subscribers[t];for(let t in this.eventMap){if(this.eventMap[t]===e){if(this.subscribers[t]){i=false}}}if(i){this.unsubscribe(e+"-touchstart",this.touchSubscribers[e+"-touchstart"]);this.unsubscribe(e+"-touchend",this.touchSubscribers[e+"-touchend"]);delete this.touchSubscribers[e+"-touchstart"];delete this.touchSubscribers[e+"-touchend"]}}}initializeColumn(t){var i=t.definition;for(let e in this.eventMap){if(i[e]){this.subscriptionChanged(e,true);if(!this.columnSubscribers[e]){this.columnSubscribers[e]=[]}this.columnSubscribers[e].push(t)}}}handle(t,i,e){this.dispatchEvent(t,i,e)}handleTouch(t,i,e,s){var r=this.touchWatchers[t];if(t==="column"){t="header"}switch(i){case"start":r.tap=true;clearTimeout(r.tapHold);r.tapHold=setTimeout((()=>{clearTimeout(r.tapHold);r.tapHold=null;r.tap=null;clearTimeout(r.tapDbl);r.tapDbl=null;this.dispatchEvent(t+"TapHold",e,s)}),1e3);break;case"end":if(r.tap){r.tap=null;this.dispatchEvent(t+"Tap",e,s)}if(r.tapDbl){clearTimeout(r.tapDbl);r.tapDbl=null;this.dispatchEvent(t+"DblTap",e,s)}else{r.tapDbl=setTimeout((()=>{clearTimeout(r.tapDbl);r.tapDbl=null}),300)}clearTimeout(r.tapHold);r.tapHold=null;break}}dispatchEvent(t,i,e){var s=e.getComponent(),r;if(this.columnSubscribers[t]){if(e instanceof q){r=e.column.definition[t]}else if(e instanceof $){r=e.definition[t]}if(r){r(i,s)}}this.dispatchExternal(t,i,s)}}var ki={navPrev:"shift + 9",navNext:9,navUp:38,navDown:40,navLeft:37,navRight:39,scrollPageUp:33,scrollPageDown:34,scrollToStart:36,scrollToEnd:35};var Ci={keyBlock:function(t){t.stopPropagation();t.preventDefault()},scrollPageUp:function(t){var i=this.table.rowManager,e=i.scrollTop-i.element.clientHeight;t.preventDefault();if(i.displayRowsCount){if(e>=0){i.element.scrollTop=e}else{i.scrollToRow(i.getDisplayRows()[0])}}this.table.element.focus()},scrollPageDown:function(t){var i=this.table.rowManager,e=i.scrollTop+i.element.clientHeight,s=i.element.scrollHeight;t.preventDefault();if(i.displayRowsCount){if(e<=s){i.element.scrollTop=e}else{i.scrollToRow(i.getDisplayRows()[i.displayRowsCount-1])}}this.table.element.focus()},scrollToStart:function(t){var i=this.table.rowManager;t.preventDefault();if(i.displayRowsCount){i.scrollToRow(i.getDisplayRows()[0])}this.table.element.focus()},scrollToEnd:function(t){var i=this.table.rowManager;t.preventDefault();if(i.displayRowsCount){i.scrollToRow(i.getDisplayRows()[i.displayRowsCount-1])}this.table.element.focus()},navPrev:function(t){this.dispatch("keybinding-nav-prev",t)},navNext:function(t){this.dispatch("keybinding-nav-next",t)},navLeft:function(t){this.dispatch("keybinding-nav-left",t)},navRight:function(t){this.dispatch("keybinding-nav-right",t)},navUp:function(t){this.dispatch("keybinding-nav-up",t)},navDown:function(t){this.dispatch("keybinding-nav-down",t)}};class Ri extends S{static moduleName="keybindings";static bindings=ki;static actions=Ci;constructor(t){super(t);this.watchKeys=null;this.pressedKeys=null;this.keyupBinding=false;this.keydownBinding=false;this.registerTableOption("keybindings",{});this.registerTableOption("tabEndNewRow",false)}initialize(){var t=this.table.options.keybindings,i={};this.watchKeys={};this.pressedKeys=[];if(t!==false){Object.assign(i,Ri.bindings);Object.assign(i,t);this.mapBindings(i);this.bindEvents()}this.subscribe("table-destroy",this.clearBindings.bind(this))}mapBindings(t){for(let i in t){if(Ri.actions[i]){if(t[i]){if(typeof t[i]!=="object"){t[i]=[t[i]]}t[i].forEach((t=>{var e=Array.isArray(t)?t:[t];e.forEach((t=>{this.mapBinding(i,t)}))}))}}else{console.warn("Key Binding Error - no such action:",i)}}}mapBinding(t,i){var e={action:Ri.actions[t],keys:[],ctrl:false,shift:false,meta:false};var s=i.toString().toLowerCase().split(" ").join("").split("+");s.forEach((t=>{switch(t){case"ctrl":e.ctrl=true;break;case"shift":e.shift=true;break;case"meta":e.meta=true;break;default:t=isNaN(t)?t.toUpperCase().charCodeAt(0):parseInt(t);e.keys.push(t);if(!this.watchKeys[t]){this.watchKeys[t]=[]}this.watchKeys[t].push(e)}}))}bindEvents(){var t=this;this.keyupBinding=function(i){var e=i.keyCode;var s=t.watchKeys[e];if(s){t.pressedKeys.push(e);s.forEach((function(e){t.checkBinding(i,e)}))}};this.keydownBinding=function(i){var e=i.keyCode;var s=t.watchKeys[e];if(s){var r=t.pressedKeys.indexOf(e);if(r>-1){t.pressedKeys.splice(r,1)}}};this.table.element.addEventListener("keydown",this.keyupBinding);this.table.element.addEventListener("keyup",this.keydownBinding)}clearBindings(){if(this.keyupBinding){this.table.element.removeEventListener("keydown",this.keyupBinding)}if(this.keydownBinding){this.table.element.removeEventListener("keyup",this.keydownBinding)}}checkBinding(t,i){var e=true;if(t.ctrlKey==i.ctrl&&t.shiftKey==i.shift&&t.metaKey==i.meta){i.keys.forEach((t=>{var i=this.pressedKeys.indexOf(t);if(i==-1){e=false}}));if(e){i.action.call(this,t)}return true}return false}}class Ei extends S{static moduleName="menu";constructor(t){super(t);this.menuContainer=null;this.nestedMenuBlock=false;this.currentComponent=null;this.rootPopup=null;this.columnSubscribers={};this.registerTableOption("rowContextMenu",false);this.registerTableOption("rowClickMenu",false);this.registerTableOption("rowDblClickMenu",false);this.registerTableOption("groupContextMenu",false);this.registerTableOption("groupClickMenu",false);this.registerTableOption("groupDblClickMenu",false);this.registerColumnOption("headerContextMenu");this.registerColumnOption("headerClickMenu");this.registerColumnOption("headerDblClickMenu");this.registerColumnOption("headerMenu");this.registerColumnOption("headerMenuIcon");this.registerColumnOption("contextMenu");this.registerColumnOption("clickMenu");this.registerColumnOption("dblClickMenu")}initialize(){this.deprecatedOptionsCheck();this.initializeRowWatchers();this.initializeGroupWatchers();this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeRowWatchers(){if(this.table.options.rowContextMenu){this.subscribe("row-contextmenu",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu));this.table.on("rowTapHold",this.loadMenuEvent.bind(this,this.table.options.rowContextMenu))}if(this.table.options.rowClickMenu){this.subscribe("row-click",this.loadMenuEvent.bind(this,this.table.options.rowClickMenu))}if(this.table.options.rowDblClickMenu){this.subscribe("row-dblclick",this.loadMenuEvent.bind(this,this.table.options.rowDblClickMenu))}}initializeGroupWatchers(){if(this.table.options.groupContextMenu){this.subscribe("group-contextmenu",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu));this.table.on("groupTapHold",this.loadMenuEvent.bind(this,this.table.options.groupContextMenu))}if(this.table.options.groupClickMenu){this.subscribe("group-click",this.loadMenuEvent.bind(this,this.table.options.groupClickMenu))}if(this.table.options.groupDblClickMenu){this.subscribe("group-dblclick",this.loadMenuEvent.bind(this,this.table.options.groupDblClickMenu))}}initializeColumn(t){var i=t.definition;if(i.headerContextMenu&&!this.columnSubscribers.headerContextMenu){this.columnSubscribers.headerContextMenu=this.loadMenuTableColumnEvent.bind(this,"headerContextMenu");this.subscribe("column-contextmenu",this.columnSubscribers.headerContextMenu);this.table.on("headerTapHold",this.loadMenuTableColumnEvent.bind(this,"headerContextMenu"))}if(i.headerClickMenu&&!this.columnSubscribers.headerClickMenu){this.columnSubscribers.headerClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerClickMenu");this.subscribe("column-click",this.columnSubscribers.headerClickMenu)}if(i.headerDblClickMenu&&!this.columnSubscribers.headerDblClickMenu){this.columnSubscribers.headerDblClickMenu=this.loadMenuTableColumnEvent.bind(this,"headerDblClickMenu");this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickMenu)}if(i.headerMenu){this.initializeColumnHeaderMenu(t)}if(i.contextMenu&&!this.columnSubscribers.contextMenu){this.columnSubscribers.contextMenu=this.loadMenuTableCellEvent.bind(this,"contextMenu");this.subscribe("cell-contextmenu",this.columnSubscribers.contextMenu);this.table.on("cellTapHold",this.loadMenuTableCellEvent.bind(this,"contextMenu"))}if(i.clickMenu&&!this.columnSubscribers.clickMenu){this.columnSubscribers.clickMenu=this.loadMenuTableCellEvent.bind(this,"clickMenu");this.subscribe("cell-click",this.columnSubscribers.clickMenu)}if(i.dblClickMenu&&!this.columnSubscribers.dblClickMenu){this.columnSubscribers.dblClickMenu=this.loadMenuTableCellEvent.bind(this,"dblClickMenu");this.subscribe("cell-dblclick",this.columnSubscribers.dblClickMenu)}}initializeColumnHeaderMenu(t){var i=t.definition.headerMenuIcon,e;e=document.createElement("span");e.classList.add("tabulator-header-popup-button");if(i){if(typeof i==="function"){i=i(t.getComponent())}if(i instanceof HTMLElement){e.appendChild(i)}else{e.innerHTML=i}}else{e.innerHTML="&vellip;"}e.addEventListener("click",(i=>{i.stopPropagation();i.preventDefault();this.loadMenuEvent(t.definition.headerMenu,i,t)}));t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadMenuTableCellEvent(t,i,e){if(e._cell){e=e._cell}if(e.column.definition[t]){this.loadMenuEvent(e.column.definition[t],i,e)}}loadMenuTableColumnEvent(t,i,e){if(e._column){e=e._column}if(e.definition[t]){this.loadMenuEvent(e.definition[t],i,e)}}loadMenuEvent(t,i,e){if(e._group){e=e._group}else if(e._row){e=e._row}t=typeof t=="function"?t.call(this.table,i,e.getComponent()):t;this.loadMenu(i,e,t)}loadMenu(t,i,e,s,r){var a=!(t instanceof MouseEvent),o=document.createElement("div"),h;o.classList.add("tabulator-menu");if(!a){t.preventDefault()}if(!e||!e.length){return}if(!s){if(this.nestedMenuBlock){if(this.rootPopup){return}}else{this.nestedMenuBlock=setTimeout((()=>{this.nestedMenuBlock=false}),100)}if(this.rootPopup){this.rootPopup.hide()}this.rootPopup=h=this.popup(o)}else{h=r.child(o)}e.forEach((t=>{var e=document.createElement("div"),s=t.label,r=t.disabled;if(t.separator){e.classList.add("tabulator-menu-separator")}else{e.classList.add("tabulator-menu-item");if(typeof s=="function"){s=s.call(this.table,i.getComponent())}if(s instanceof Node){e.appendChild(s)}else{e.innerHTML=s}if(typeof r=="function"){r=r.call(this.table,i.getComponent())}if(r){e.classList.add("tabulator-menu-item-disabled");e.addEventListener("click",(t=>{t.stopPropagation()}))}else{if(t.menu&&t.menu.length){e.addEventListener("click",(s=>{s.stopPropagation();this.loadMenu(s,i,t.menu,e,h)}))}else{if(t.action){e.addEventListener("click",(e=>{t.action(e,i.getComponent())}))}}}if(t.menu&&t.menu.length){e.classList.add("tabulator-menu-item-submenu")}}o.appendChild(e)}));o.addEventListener("click",(t=>{if(this.rootPopup){this.rootPopup.hide()}}));h.show(s||t);if(h===this.rootPopup){this.rootPopup.hideOnBlur((()=>{this.rootPopup=null;if(this.currentComponent){this.dispatch("menu-closed",e,h);this.dispatchExternal("menuClosed",this.currentComponent.getComponent());this.currentComponent=null}}));this.currentComponent=i;this.dispatch("menu-opened",e,h);this.dispatchExternal("menuOpened",i.getComponent())}}}class zi extends S{static moduleName="moveColumn";constructor(t){super(t);this.placeholderElement=this.createPlaceholderElement();this.hoverElement=false;this.checkTimeout=false;this.checkPeriod=250;this.moving=false;this.toCol=false;this.toColAfter=false;this.startX=0;this.autoScrollMargin=40;this.autoScrollStep=5;this.autoScrollTimeout=false;this.touchMove=false;this.moveHover=this.moveHover.bind(this);this.endMove=this.endMove.bind(this);this.registerTableOption("movableColumns",false)}createPlaceholderElement(){var t=document.createElement("div");t.classList.add("tabulator-col");t.classList.add("tabulator-col-placeholder");return t}initialize(){if(this.table.options.movableColumns){this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("alert-show",this.abortMove.bind(this))}}abortMove(){clearTimeout(this.checkTimeout)}initializeColumn(t){var i=this,e={},s;if(!t.modules.frozen&&!t.isGroup&&!t.isRowHeader){s=t.getElement();e.mousemove=function(e){if(t.parent===i.moving.parent){if((i.touchMove?e.touches[0].pageX:e.pageX)-z.elOffset(s).left+i.table.columnManager.contentsElement.scrollLeft>t.getWidth()/2){if(i.toCol!==t||!i.toColAfter){s.parentNode.insertBefore(i.placeholderElement,s.nextSibling);i.moveColumn(t,true)}}else{if(i.toCol!==t||i.toColAfter){s.parentNode.insertBefore(i.placeholderElement,s);i.moveColumn(t,false)}}}}.bind(i);s.addEventListener("mousedown",(function(e){i.touchMove=false;if(e.which===1){i.checkTimeout=setTimeout((function(){i.startMove(e,t)}),i.checkPeriod)}}));s.addEventListener("mouseup",(function(t){if(t.which===1){if(i.checkTimeout){clearTimeout(i.checkTimeout)}}}));i.bindTouchEvents(t)}t.modules.moveColumn=e}bindTouchEvents(t){var i=t.getElement(),e=false,s,r,a,o,h,l;i.addEventListener("touchstart",(i=>{this.checkTimeout=setTimeout((()=>{this.touchMove=true;s=t.nextColumn();a=s?s.getWidth()/2:0;r=t.prevColumn();o=r?r.getWidth()/2:0;h=0;l=0;e=false;this.startMove(i,t)}),this.checkPeriod)}),{passive:true});i.addEventListener("touchmove",(i=>{var n,u;if(this.moving){this.moveHover(i);if(!e){e=i.touches[0].pageX}n=i.touches[0].pageX-e;if(n>0){if(s&&n-h>a){u=s;if(u!==t){e=i.touches[0].pageX;u.getElement().parentNode.insertBefore(this.placeholderElement,u.getElement().nextSibling);this.moveColumn(u,true)}}}else{if(r&&-n-l>o){u=r;if(u!==t){e=i.touches[0].pageX;u.getElement().parentNode.insertBefore(this.placeholderElement,u.getElement());this.moveColumn(u,false)}}}if(u){s=u.nextColumn();h=a;a=s?s.getWidth()/2:0;r=u.prevColumn();l=o;o=r?r.getWidth()/2:0}}}),{passive:true});i.addEventListener("touchend",(t=>{if(this.checkTimeout){clearTimeout(this.checkTimeout)}if(this.moving){this.endMove(t)}}))}startMove(t,i){var e=i.getElement(),s=this.table.columnManager.getContentsElement(),r=this.table.columnManager.getHeadersElement();if(this.table.modules.selectRange&&this.table.modules.selectRange.columnSelection){if(this.table.modules.selectRange.mousedown&&this.table.modules.selectRange.selecting==="column"){return}}this.moving=i;this.startX=(this.touchMove?t.touches[0].pageX:t.pageX)-z.elOffset(e).left;this.table.element.classList.add("tabulator-block-select");this.placeholderElement.style.width=i.getWidth()+"px";this.placeholderElement.style.height=i.getHeight()+"px";e.parentNode.insertBefore(this.placeholderElement,e);e.parentNode.removeChild(e);this.hoverElement=e.cloneNode(true);this.hoverElement.classList.add("tabulator-moving");s.appendChild(this.hoverElement);this.hoverElement.style.left="0";this.hoverElement.style.bottom=s.clientHeight-r.offsetHeight+"px";if(!this.touchMove){this._bindMouseMove();document.body.addEventListener("mousemove",this.moveHover);document.body.addEventListener("mouseup",this.endMove)}this.moveHover(t);this.dispatch("column-moving",t,this.moving)}_bindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(t){if(t.modules.moveColumn.mousemove){t.getElement().addEventListener("mousemove",t.modules.moveColumn.mousemove)}}))}_unbindMouseMove(){this.table.columnManager.columnsByIndex.forEach((function(t){if(t.modules.moveColumn.mousemove){t.getElement().removeEventListener("mousemove",t.modules.moveColumn.mousemove)}}))}moveColumn(t,i){var e=this.moving.getCells();this.toCol=t;this.toColAfter=i;if(i){t.getCells().forEach((function(t,i){var s=t.getElement(true);if(s.parentNode&&e[i]){s.parentNode.insertBefore(e[i].getElement(),s.nextSibling)}}))}else{t.getCells().forEach((function(t,i){var s=t.getElement(true);if(s.parentNode&&e[i]){s.parentNode.insertBefore(e[i].getElement(),s)}}))}}endMove(t){if(t.which===1||this.touchMove){this._unbindMouseMove();this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling);this.placeholderElement.parentNode.removeChild(this.placeholderElement);this.hoverElement.parentNode.removeChild(this.hoverElement);this.table.element.classList.remove("tabulator-block-select");if(this.toCol){this.table.columnManager.moveColumnActual(this.moving,this.toCol,this.toColAfter)}this.moving=false;this.toCol=false;this.toColAfter=false;if(!this.touchMove){document.body.removeEventListener("mousemove",this.moveHover);document.body.removeEventListener("mouseup",this.endMove)}}}moveHover(t){var i=this.table.columnManager.getContentsElement(),e=i.scrollLeft,s=(this.touchMove?t.touches[0].pageX:t.pageX)-z.elOffset(i).left+e,r;this.hoverElement.style.left=s-this.startX+"px";if(s-e<this.autoScrollMargin){if(!this.autoScrollTimeout){this.autoScrollTimeout=setTimeout((()=>{r=Math.max(0,e-5);this.table.rowManager.getElement().scrollLeft=r;this.autoScrollTimeout=false}),1)}}if(e+i.clientWidth-s<this.autoScrollMargin){if(!this.autoScrollTimeout){this.autoScrollTimeout=setTimeout((()=>{r=Math.min(i.clientWidth,e+5);this.table.rowManager.getElement().scrollLeft=r;this.autoScrollTimeout=false}),1)}}}}var Mi={delete:function(t,i,e){t.delete()}};var Si={insert:function(t,i,e){this.table.addRow(t.getData(),undefined,i);return true},add:function(t,i,e){this.table.addRow(t.getData());return true},update:function(t,i,e){if(i){i.update(t.getData());return true}return false},replace:function(t,i,e){if(i){this.table.addRow(t.getData(),undefined,i);i.delete();return true}return false}};class Ti extends S{static moduleName="moveRow";static senders=Mi;static receivers=Si;constructor(t){super(t);this.placeholderElement=this.createPlaceholderElement();this.hoverElement=false;this.checkTimeout=false;this.checkPeriod=150;this.moving=false;this.toRow=false;this.toRowAfter=false;this.hasHandle=false;this.startY=0;this.startX=0;this.moveHover=this.moveHover.bind(this);this.endMove=this.endMove.bind(this);this.tableRowDropEvent=false;this.touchMove=false;this.connection=false;this.connectionSelectorsTables=false;this.connectionSelectorsElements=false;this.connectionElements=[];this.connections=[];this.connectedTable=false;this.connectedRow=false;this.registerTableOption("movableRows",false);this.registerTableOption("movableRowsConnectedTables",false);this.registerTableOption("movableRowsConnectedElements",false);this.registerTableOption("movableRowsSender",false);this.registerTableOption("movableRowsReceiver","insert");this.registerColumnOption("rowHandle")}createPlaceholderElement(){var t=document.createElement("div");t.classList.add("tabulator-row");t.classList.add("tabulator-row-placeholder");return t}initialize(){if(this.table.options.movableRows){this.connectionSelectorsTables=this.table.options.movableRowsConnectedTables;this.connectionSelectorsElements=this.table.options.movableRowsConnectedElements;this.connection=this.connectionSelectorsTables||this.connectionSelectorsElements;this.subscribe("cell-init",this.initializeCell.bind(this));this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("row-init",this.initializeRow.bind(this))}}initializeGroupHeader(t){var i=this,e={};e.mouseup=function(e){i.tableRowDrop(e,t)}.bind(i);e.mousemove=function(e){var s;if(e.pageY-z.elOffset(t.element).top+i.table.rowManager.element.scrollTop>t.getHeight()/2){if(i.toRow!==t||!i.toRowAfter){s=t.getElement();s.parentNode.insertBefore(i.placeholderElement,s.nextSibling);i.moveRow(t,true)}}else{if(i.toRow!==t||i.toRowAfter){s=t.getElement();if(s.previousSibling){s.parentNode.insertBefore(i.placeholderElement,s);i.moveRow(t,false)}}}}.bind(i);t.modules.moveRow=e}initializeRow(t){var i=this,e={},s;e.mouseup=function(e){i.tableRowDrop(e,t)}.bind(i);e.mousemove=function(e){var s=t.getElement();if(e.pageY-z.elOffset(s).top+i.table.rowManager.element.scrollTop>t.getHeight()/2){if(i.toRow!==t||!i.toRowAfter){s.parentNode.insertBefore(i.placeholderElement,s.nextSibling);i.moveRow(t,true)}}else{if(i.toRow!==t||i.toRowAfter){s.parentNode.insertBefore(i.placeholderElement,s);i.moveRow(t,false)}}}.bind(i);if(!this.hasHandle){s=t.getElement();s.addEventListener("mousedown",(function(e){if(e.which===1){i.checkTimeout=setTimeout((function(){i.startMove(e,t)}),i.checkPeriod)}}));s.addEventListener("mouseup",(function(t){if(t.which===1){if(i.checkTimeout){clearTimeout(i.checkTimeout)}}}));this.bindTouchEvents(t,t.getElement())}t.modules.moveRow=e}initializeColumn(t){if(t.definition.rowHandle&&this.table.options.movableRows!==false){this.hasHandle=true}}initializeCell(t){if(t.column.definition.rowHandle&&this.table.options.movableRows!==false){var i=this,e=t.getElement(true);e.addEventListener("mousedown",(function(e){if(e.which===1){i.checkTimeout=setTimeout((function(){i.startMove(e,t.row)}),i.checkPeriod)}}));e.addEventListener("mouseup",(function(t){if(t.which===1){if(i.checkTimeout){clearTimeout(i.checkTimeout)}}}));this.bindTouchEvents(t.row,e)}}bindTouchEvents(t,i){var e=false,s,r,a,o,h,l;i.addEventListener("touchstart",(i=>{this.checkTimeout=setTimeout((()=>{this.touchMove=true;s=t.nextRow();a=s?s.getHeight()/2:0;r=t.prevRow();o=r?r.getHeight()/2:0;h=0;l=0;e=false;this.startMove(i,t)}),this.checkPeriod)}),{passive:true});i.addEventListener("touchmove",(i=>{var n,u;if(this.moving){i.preventDefault();this.moveHover(i);if(!e){e=i.touches[0].pageY}n=i.touches[0].pageY-e;if(n>0){if(s&&n-h>a){u=s;if(u!==t){e=i.touches[0].pageY;u.getElement().parentNode.insertBefore(this.placeholderElement,u.getElement().nextSibling);this.moveRow(u,true)}}}else{if(r&&-n-l>o){u=r;if(u!==t){e=i.touches[0].pageY;u.getElement().parentNode.insertBefore(this.placeholderElement,u.getElement());this.moveRow(u,false)}}}if(u){s=u.nextRow();h=a;a=s?s.getHeight()/2:0;r=u.prevRow();l=o;o=r?r.getHeight()/2:0}}}));i.addEventListener("touchend",(t=>{if(this.checkTimeout){clearTimeout(this.checkTimeout)}if(this.moving){this.endMove(t);this.touchMove=false}}))}_bindMouseMove(){this.table.rowManager.getDisplayRows().forEach((t=>{if((t.type==="row"||t.type==="group")&&t.modules.moveRow&&t.modules.moveRow.mousemove){t.getElement().addEventListener("mousemove",t.modules.moveRow.mousemove)}}))}_unbindMouseMove(){this.table.rowManager.getDisplayRows().forEach((t=>{if((t.type==="row"||t.type==="group")&&t.modules.moveRow&&t.modules.moveRow.mousemove){t.getElement().removeEventListener("mousemove",t.modules.moveRow.mousemove)}}))}startMove(t,i){var e=i.getElement();this.setStartPosition(t,i);this.moving=i;this.table.element.classList.add("tabulator-block-select");this.placeholderElement.style.width=i.getWidth()+"px";this.placeholderElement.style.height=i.getHeight()+"px";if(!this.connection){e.parentNode.insertBefore(this.placeholderElement,e);e.parentNode.removeChild(e)}else{this.table.element.classList.add("tabulator-movingrow-sending");this.connectToTables(i)}this.hoverElement=e.cloneNode(true);this.hoverElement.classList.add("tabulator-moving");if(this.connection){document.body.appendChild(this.hoverElement);this.hoverElement.style.left="0";this.hoverElement.style.top="0";this.hoverElement.style.width=this.table.element.clientWidth+"px";this.hoverElement.style.whiteSpace="nowrap";this.hoverElement.style.overflow="hidden";this.hoverElement.style.pointerEvents="none"}else{this.table.rowManager.getTableElement().appendChild(this.hoverElement);this.hoverElement.style.left="0";this.hoverElement.style.top="0";this._bindMouseMove()}document.body.addEventListener("mousemove",this.moveHover);document.body.addEventListener("mouseup",this.endMove);this.dispatchExternal("rowMoving",i.getComponent());this.moveHover(t)}setStartPosition(t,i){var e=this.touchMove?t.touches[0].pageX:t.pageX,s=this.touchMove?t.touches[0].pageY:t.pageY,r,a;r=i.getElement();if(this.connection){a=r.getBoundingClientRect();this.startX=a.left-e+window.pageXOffset;this.startY=a.top-s+window.pageYOffset}else{this.startY=s-r.getBoundingClientRect().top}}endMove(t){if(!t||t.which===1||this.touchMove){this._unbindMouseMove();if(!this.connection){this.placeholderElement.parentNode.insertBefore(this.moving.getElement(),this.placeholderElement.nextSibling);this.placeholderElement.parentNode.removeChild(this.placeholderElement)}this.hoverElement.parentNode.removeChild(this.hoverElement);this.table.element.classList.remove("tabulator-block-select");if(this.toRow){this.table.rowManager.moveRow(this.moving,this.toRow,this.toRowAfter)}else{this.dispatchExternal("rowMoveCancelled",this.moving.getComponent())}this.moving=false;this.toRow=false;this.toRowAfter=false;document.body.removeEventListener("mousemove",this.moveHover);document.body.removeEventListener("mouseup",this.endMove);if(this.connection){this.table.element.classList.remove("tabulator-movingrow-sending");this.disconnectFromTables()}}}moveRow(t,i){this.toRow=t;this.toRowAfter=i}moveHover(t){if(this.connection){this.moveHoverConnections.call(this,t)}else{this.moveHoverTable.call(this,t)}}moveHoverTable(t){var i=this.table.rowManager.getElement(),e=i.scrollTop,s=(this.touchMove?t.touches[0].pageY:t.pageY)-i.getBoundingClientRect().top+e;this.hoverElement.style.top=Math.min(s-this.startY,this.table.rowManager.element.scrollHeight-this.hoverElement.offsetHeight)+"px"}moveHoverConnections(t){this.hoverElement.style.left=this.startX+(this.touchMove?t.touches[0].pageX:t.pageX)+"px";this.hoverElement.style.top=this.startY+(this.touchMove?t.touches[0].pageY:t.pageY)+"px"}elementRowDrop(t,i,e){this.dispatchExternal("movableRowsElementDrop",t,i,e?e.getComponent():false)}connectToTables(t){var i;if(this.connectionSelectorsTables){i=this.commsConnections(this.connectionSelectorsTables);this.dispatchExternal("movableRowsSendingStart",i);this.commsSend(this.connectionSelectorsTables,"moveRow","connect",{row:t})}if(this.connectionSelectorsElements){this.connectionElements=[];if(!Array.isArray(this.connectionSelectorsElements)){this.connectionSelectorsElements=[this.connectionSelectorsElements]}this.connectionSelectorsElements.forEach((t=>{if(typeof t==="string"){this.connectionElements=this.connectionElements.concat(Array.prototype.slice.call(document.querySelectorAll(t)))}else{this.connectionElements.push(t)}}));this.connectionElements.forEach((t=>{var i=i=>{this.elementRowDrop(i,t,this.moving)};t.addEventListener("mouseup",i);t.tabulatorElementDropEvent=i;t.classList.add("tabulator-movingrow-receiving")}))}}disconnectFromTables(){var t;if(this.connectionSelectorsTables){t=this.commsConnections(this.connectionSelectorsTables);this.dispatchExternal("movableRowsSendingStop",t);this.commsSend(this.connectionSelectorsTables,"moveRow","disconnect")}this.connectionElements.forEach((t=>{t.classList.remove("tabulator-movingrow-receiving");t.removeEventListener("mouseup",t.tabulatorElementDropEvent);delete t.tabulatorElementDropEvent}))}connect(t,i){if(!this.connectedTable){this.connectedTable=t;this.connectedRow=i;this.table.element.classList.add("tabulator-movingrow-receiving");this.table.rowManager.getDisplayRows().forEach((t=>{if(t.type==="row"&&t.modules.moveRow&&t.modules.moveRow.mouseup){t.getElement().addEventListener("mouseup",t.modules.moveRow.mouseup)}}));this.tableRowDropEvent=this.tableRowDrop.bind(this);this.table.element.addEventListener("mouseup",this.tableRowDropEvent);this.dispatchExternal("movableRowsReceivingStart",i,t);return true}else{console.warn("Move Row Error - Table cannot accept connection, already connected to table:",this.connectedTable);return false}}disconnect(t){if(t===this.connectedTable){this.connectedTable=false;this.connectedRow=false;this.table.element.classList.remove("tabulator-movingrow-receiving");this.table.rowManager.getDisplayRows().forEach((t=>{if(t.type==="row"&&t.modules.moveRow&&t.modules.moveRow.mouseup){t.getElement().removeEventListener("mouseup",t.modules.moveRow.mouseup)}}));this.table.element.removeEventListener("mouseup",this.tableRowDropEvent);this.dispatchExternal("movableRowsReceivingStop",t)}else{console.warn("Move Row Error - trying to disconnect from non connected table")}}dropComplete(t,i,e){var s=false;if(e){switch(typeof this.table.options.movableRowsSender){case"string":s=Ti.senders[this.table.options.movableRowsSender];break;case"function":s=this.table.options.movableRowsSender;break}if(s){s.call(this,this.moving?this.moving.getComponent():undefined,i?i.getComponent():undefined,t)}else{if(this.table.options.movableRowsSender){console.warn("Mover Row Error - no matching sender found:",this.table.options.movableRowsSender)}}this.dispatchExternal("movableRowsSent",this.moving.getComponent(),i?i.getComponent():undefined,t)}else{this.dispatchExternal("movableRowsSentFailed",this.moving.getComponent(),i?i.getComponent():undefined,t)}this.endMove()}tableRowDrop(t,i){var e=false,s=false;t.stopImmediatePropagation();switch(typeof this.table.options.movableRowsReceiver){case"string":e=Ti.receivers[this.table.options.movableRowsReceiver];break;case"function":e=this.table.options.movableRowsReceiver;break}if(e){s=e.call(this,this.connectedRow.getComponent(),i?i.getComponent():undefined,this.connectedTable)}else{console.warn("Mover Row Error - no matching receiver found:",this.table.options.movableRowsReceiver)}if(s){this.dispatchExternal("movableRowsReceived",this.connectedRow.getComponent(),i?i.getComponent():undefined,this.connectedTable)}else{this.dispatchExternal("movableRowsReceivedFailed",this.connectedRow.getComponent(),i?i.getComponent():undefined,this.connectedTable)}this.commsSend(this.connectedTable,"moveRow","dropcomplete",{row:i,success:s})}commsReceived(t,i,e){switch(i){case"connect":return this.connect(t,e.row);case"disconnect":return this.disconnect(t);case"dropcomplete":return this.dropComplete(t,e.row,e.success)}}}var Di={};class Pi extends S{static moduleName="mutator";static mutators=Di;constructor(t){super(t);this.allowedTypes=["","data","edit","clipboard","import"];this.enabled=true;this.registerColumnOption("mutator");this.registerColumnOption("mutatorParams");this.registerColumnOption("mutatorData");this.registerColumnOption("mutatorDataParams");this.registerColumnOption("mutatorEdit");this.registerColumnOption("mutatorEditParams");this.registerColumnOption("mutatorClipboard");this.registerColumnOption("mutatorClipboardParams");this.registerColumnOption("mutatorImport");this.registerColumnOption("mutatorImportParams");this.registerColumnOption("mutateLink")}initialize(){this.subscribe("cell-value-changing",this.transformCell.bind(this));this.subscribe("cell-value-changed",this.mutateLink.bind(this));this.subscribe("column-layout",this.initializeColumn.bind(this));this.subscribe("row-data-init-before",this.rowDataChanged.bind(this));this.subscribe("row-data-changing",this.rowDataChanged.bind(this))}rowDataChanged(t,i,e){return this.transformRow(i,"data",e)}initializeColumn(t){var i=false,e={};this.allowedTypes.forEach((s=>{var r="mutator"+(s.charAt(0).toUpperCase()+s.slice(1)),a;if(t.definition[r]){a=this.lookupMutator(t.definition[r]);if(a){i=true;e[r]={mutator:a,params:t.definition[r+"Params"]||{}}}}}));if(i){t.modules.mutate=e}}lookupMutator(t){var i=false;switch(typeof t){case"string":if(Pi.mutators[t]){i=Pi.mutators[t]}else{console.warn("Mutator Error - No such mutator found, ignoring: ",t)}break;case"function":i=t;break}return i}transformRow(t,i,e){var s="mutator"+(i.charAt(0).toUpperCase()+i.slice(1)),r;if(this.enabled){this.table.columnManager.traverse((a=>{var o,h,l;if(a.modules.mutate){o=a.modules.mutate[s]||a.modules.mutate.mutator||false;if(o){r=a.getFieldValue(typeof e!=="undefined"?e:t);if(i=="data"&&!e||typeof r!=="undefined"){l=a.getComponent();h=typeof o.params==="function"?o.params(r,t,i,l):o.params;a.setFieldValue(t,o.mutator(r,t,i,h,l))}}}}))}return t}transformCell(t,i){if(t.column.modules.mutate){var e=t.column.modules.mutate.mutatorEdit||t.column.modules.mutate.mutator||false,s={};if(e){s=Object.assign(s,t.row.getData());t.column.setFieldValue(s,i);return e.mutator(i,s,"edit",e.params,t.getComponent())}}return i}mutateLink(t){var i=t.column.definition.mutateLink;if(i){if(!Array.isArray(i)){i=[i]}i.forEach((i=>{var e=t.row.getCell(i);if(e){e.setValue(e.getValue(),true,true)}}))}}enable(){this.enabled=true}disable(){this.enabled=false}}function Fi(t,i,e,s,r){var a=document.createElement("span"),o=document.createElement("span"),h=document.createElement("span"),l=document.createElement("span"),n=document.createElement("span"),u=document.createElement("span");this.table.modules.localize.langBind("pagination|counter|showing",(t=>{o.innerHTML=t}));this.table.modules.localize.langBind("pagination|counter|of",(t=>{l.innerHTML=t}));this.table.modules.localize.langBind("pagination|counter|rows",(t=>{u.innerHTML=t}));if(s){h.innerHTML=" "+i+"-"+Math.min(i+t-1,s)+" ";n.innerHTML=" "+s+" ";a.appendChild(o);a.appendChild(h);a.appendChild(l);a.appendChild(n);a.appendChild(u)}else{h.innerHTML=" 0 ";a.appendChild(o);a.appendChild(h);a.appendChild(u)}return a}function ji(t,i,e,s,r){var a=document.createElement("span"),o=document.createElement("span"),h=document.createElement("span"),l=document.createElement("span"),n=document.createElement("span"),u=document.createElement("span");this.table.modules.localize.langBind("pagination|counter|showing",(t=>{o.innerHTML=t}));h.innerHTML=" "+e+" ";this.table.modules.localize.langBind("pagination|counter|of",(t=>{l.innerHTML=t}));n.innerHTML=" "+r+" ";this.table.modules.localize.langBind("pagination|counter|pages",(t=>{u.innerHTML=t}));a.appendChild(o);a.appendChild(h);a.appendChild(l);a.appendChild(n);a.appendChild(u);return a}var Ni={rows:Fi,pages:ji};class Oi extends S{static moduleName="page";static pageCounters=Ni;constructor(t){super(t);this.mode="local";this.progressiveLoad=false;this.element=null;this.pageCounterElement=null;this.pageCounter=null;this.size=0;this.page=1;this.count=5;this.max=1;this.remoteRowCountEstimate=null;this.initialLoad=true;this.dataChanging=false;this.pageSizes=[];this.registerTableOption("pagination",false);this.registerTableOption("paginationMode","local");this.registerTableOption("paginationSize",false);this.registerTableOption("paginationInitialPage",1);this.registerTableOption("paginationCounter",false);this.registerTableOption("paginationCounterElement",false);this.registerTableOption("paginationButtonCount",5);this.registerTableOption("paginationSizeSelector",false);this.registerTableOption("paginationElement",false);this.registerTableOption("paginationAddRow","page");this.registerTableOption("paginationOutOfRange",false);this.registerTableOption("progressiveLoad",false);this.registerTableOption("progressiveLoadDelay",0);this.registerTableOption("progressiveLoadScrollMargin",0);this.registerTableFunction("setMaxPage",this.setMaxPage.bind(this));this.registerTableFunction("setPage",this.setPage.bind(this));this.registerTableFunction("setPageToRow",this.userSetPageToRow.bind(this));this.registerTableFunction("setPageSize",this.userSetPageSize.bind(this));this.registerTableFunction("getPageSize",this.getPageSize.bind(this));this.registerTableFunction("previousPage",this.previousPage.bind(this));this.registerTableFunction("nextPage",this.nextPage.bind(this));this.registerTableFunction("getPage",this.getPage.bind(this));this.registerTableFunction("getPageMax",this.getPageMax.bind(this));this.registerComponentFunction("row","pageTo",this.setPageToRow.bind(this))}initialize(){if(this.table.options.pagination){this.subscribe("row-deleted",this.rowsUpdated.bind(this));this.subscribe("row-added",this.rowsUpdated.bind(this));this.subscribe("data-processed",this.initialLoadComplete.bind(this));this.subscribe("table-built",this.calculatePageSizes.bind(this));this.subscribe("footer-redraw",this.footerRedraw.bind(this));if(this.table.options.paginationAddRow=="page"){this.subscribe("row-adding-position",this.rowAddingPosition.bind(this))}if(this.table.options.paginationMode==="remote"){this.subscribe("data-params",this.remotePageParams.bind(this));this.subscribe("data-loaded",this._parseRemoteData.bind(this))}if(this.table.options.progressiveLoad){console.error("Progressive Load Error - Pagination and progressive load cannot be used at the same time")}this.registerDisplayHandler(this.restOnRenderBefore.bind(this),40);this.registerDisplayHandler(this.getRows.bind(this),50);this.createElements();this.initializePageCounter();this.initializePaginator()}else if(this.table.options.progressiveLoad){this.subscribe("data-params",this.remotePageParams.bind(this));this.subscribe("data-loaded",this._parseRemoteData.bind(this));this.subscribe("table-built",this.calculatePageSizes.bind(this));this.subscribe("data-processed",this.initialLoadComplete.bind(this));this.initializeProgressive(this.table.options.progressiveLoad);if(this.table.options.progressiveLoad==="scroll"){this.subscribe("scroll-vertical",this.scrollVertical.bind(this))}}}rowAddingPosition(t,i){var e=this.table.rowManager,s=e.getDisplayRows(),r;if(i){if(s.length){r=s[0]}else{if(e.activeRows.length){r=e.activeRows[e.activeRows.length-1];i=false}}}else{if(s.length){r=s[s.length-1];i=s.length<this.size?false:true}}return{index:r,top:i}}calculatePageSizes(){var t,i;if(this.table.options.paginationSize){this.size=this.table.options.paginationSize}else{t=document.createElement("div");t.classList.add("tabulator-row");t.style.visibility="hidden";i=document.createElement("div");i.classList.add("tabulator-cell");i.innerHTML="Page Row Test";t.appendChild(i);this.table.rowManager.getTableElement().appendChild(t);this.size=Math.floor(this.table.rowManager.getElement().clientHeight/t.offsetHeight);this.table.rowManager.getTableElement().removeChild(t)}this.dispatchExternal("pageSizeChanged",this.size);this.generatePageSizeSelectList()}initialLoadComplete(){this.initialLoad=false}remotePageParams(t,i,e,s){if(!this.initialLoad){if(this.progressiveLoad&&!e||!this.progressiveLoad&&!this.dataChanging){this.reset(true)}}s.page=this.page;if(this.size){s.size=this.size}return s}userSetPageToRow(t){if(this.table.options.pagination){t=this.table.rowManager.findRow(t);if(t){return this.setPageToRow(t)}}return Promise.reject()}userSetPageSize(t){if(this.table.options.pagination){this.setPageSize(t);return this.setPage(1)}else{return false}}scrollVertical(t,i){var e,s,r;if(!i&&!this.table.dataLoader.loading){e=this.table.rowManager.getElement();s=e.scrollHeight-e.clientHeight-t;r=this.table.options.progressiveLoadScrollMargin||e.clientHeight*2;if(s<r){this.nextPage().catch((()=>{}))}}}restOnRenderBefore(t,i){if(!i){if(this.mode==="local"){this.reset()}}return t}rowsUpdated(){this.refreshData(true,"all")}createElements(){var t;this.element=document.createElement("span");this.element.classList.add("tabulator-paginator");this.pagesElement=document.createElement("span");this.pagesElement.classList.add("tabulator-pages");t=document.createElement("button");t.classList.add("tabulator-page");t.setAttribute("type","button");t.setAttribute("role","button");t.setAttribute("aria-label","");t.setAttribute("title","");this.firstBut=t.cloneNode(true);this.firstBut.setAttribute("data-page","first");this.prevBut=t.cloneNode(true);this.prevBut.setAttribute("data-page","prev");this.nextBut=t.cloneNode(true);this.nextBut.setAttribute("data-page","next");this.lastBut=t.cloneNode(true);this.lastBut.setAttribute("data-page","last");if(this.table.options.paginationSizeSelector){this.pageSizeSelect=document.createElement("select");this.pageSizeSelect.classList.add("tabulator-page-size")}}generatePageSizeSelectList(){var t=[];if(this.pageSizeSelect){if(Array.isArray(this.table.options.paginationSizeSelector)){t=this.table.options.paginationSizeSelector;this.pageSizes=t;if(this.pageSizes.indexOf(this.size)==-1){t.unshift(this.size)}}else{if(this.pageSizes.indexOf(this.size)==-1){t=[];for(let i=1;i<5;i++){t.push(this.size*i)}this.pageSizes=t}else{t=this.pageSizes}}while(this.pageSizeSelect.firstChild)this.pageSizeSelect.removeChild(this.pageSizeSelect.firstChild);t.forEach((t=>{var i=document.createElement("option");i.value=t;if(t===true){this.langBind("pagination|all",(function(t){i.innerHTML=t}))}else{i.innerHTML=t}this.pageSizeSelect.appendChild(i)}));this.pageSizeSelect.value=this.size}}initializePageCounter(){var t=this.table.options.paginationCounter,i=null;if(t){if(typeof t==="function"){i=t}else{i=Oi.pageCounters[t]}if(i){this.pageCounter=i;this.pageCounterElement=document.createElement("span");this.pageCounterElement.classList.add("tabulator-page-counter")}else{console.warn("Pagination Error - No such page counter found: ",t)}}}initializePaginator(t){var i,e;if(!t){this.langBind("pagination|first",(t=>{this.firstBut.innerHTML=t}));this.langBind("pagination|first_title",(t=>{this.firstBut.setAttribute("aria-label",t);this.firstBut.setAttribute("title",t)}));this.langBind("pagination|prev",(t=>{this.prevBut.innerHTML=t}));this.langBind("pagination|prev_title",(t=>{this.prevBut.setAttribute("aria-label",t);this.prevBut.setAttribute("title",t)}));this.langBind("pagination|next",(t=>{this.nextBut.innerHTML=t}));this.langBind("pagination|next_title",(t=>{this.nextBut.setAttribute("aria-label",t);this.nextBut.setAttribute("title",t)}));this.langBind("pagination|last",(t=>{this.lastBut.innerHTML=t}));this.langBind("pagination|last_title",(t=>{this.lastBut.setAttribute("aria-label",t);this.lastBut.setAttribute("title",t)}));this.firstBut.addEventListener("click",(()=>{this.setPage(1)}));this.prevBut.addEventListener("click",(()=>{this.previousPage()}));this.nextBut.addEventListener("click",(()=>{this.nextPage()}));this.lastBut.addEventListener("click",(()=>{this.setPage(this.max)}));if(this.table.options.paginationElement){this.element=this.table.options.paginationElement}if(this.pageSizeSelect){i=document.createElement("label");this.langBind("pagination|page_size",(t=>{this.pageSizeSelect.setAttribute("aria-label",t);this.pageSizeSelect.setAttribute("title",t);i.innerHTML=t}));this.element.appendChild(i);this.element.appendChild(this.pageSizeSelect);this.pageSizeSelect.addEventListener("change",(t=>{this.setPageSize(this.pageSizeSelect.value=="true"?true:this.pageSizeSelect.value);this.setPage(1)}))}this.element.appendChild(this.firstBut);this.element.appendChild(this.prevBut);this.element.appendChild(this.pagesElement);this.element.appendChild(this.nextBut);this.element.appendChild(this.lastBut);if(!this.table.options.paginationElement){if(this.table.options.paginationCounter){if(this.table.options.paginationCounterElement){if(this.table.options.paginationCounterElement instanceof HTMLElement){this.table.options.paginationCounterElement.appendChild(this.pageCounterElement)}else if(typeof this.table.options.paginationCounterElement==="string"){e=document.querySelector(this.table.options.paginationCounterElement);if(e){e.appendChild(this.pageCounterElement)}else{console.warn("Pagination Error - Unable to find element matching paginationCounterElement selector:",this.table.options.paginationCounterElement)}}}else{this.footerAppend(this.pageCounterElement)}}this.footerAppend(this.element)}this.page=this.table.options.paginationInitialPage;this.count=this.table.options.paginationButtonCount}this.mode=this.table.options.paginationMode}initializeProgressive(t){this.initializePaginator(true);this.mode="progressive_"+t;this.progressiveLoad=true}trackChanges(){this.dispatch("page-changed")}setMaxRows(t){if(!t){this.max=1}else{this.max=this.size===true?1:Math.ceil(t/this.size)}if(this.page>this.max){this.page=this.max}}reset(t){if(!this.initialLoad){if(this.mode=="local"||t){this.page=1;this.trackChanges()}}}setMaxPage(t){t=parseInt(t);this.max=t||1;if(this.page>this.max){this.page=this.max;this.trigger()}}setPage(t){switch(t){case"first":return this.setPage(1);case"prev":return this.previousPage();case"next":return this.nextPage();case"last":return this.setPage(this.max)}t=parseInt(t);if(t>0&&t<=this.max||this.mode!=="local"){this.page=t;this.trackChanges();return this.trigger()}else{console.warn("Pagination Error - Requested page is out of range of 1 - "+this.max+":",t);return Promise.reject()}}setPageToRow(t){var i=this.displayRows(-1);var e=i.indexOf(t);if(e>-1){var s=this.size===true?1:Math.ceil((e+1)/this.size);return this.setPage(s)}else{console.warn("Pagination Error - Requested row is not visible");return Promise.reject()}}setPageSize(t){if(t!==true){t=parseInt(t)}if(t>0){this.size=t;this.dispatchExternal("pageSizeChanged",t)}if(this.pageSizeSelect){this.generatePageSizeSelectList()}this.trackChanges()}_setPageCounter(t,i,e){var s;if(this.pageCounter){if(this.mode==="remote"){i=this.size;e=(this.page-1)*this.size+1;t=this.remoteRowCountEstimate}s=this.pageCounter.call(this,i,e,this.page,t,this.max);switch(typeof s){case"object":if(s instanceof Node){while(this.pageCounterElement.firstChild)this.pageCounterElement.removeChild(this.pageCounterElement.firstChild);this.pageCounterElement.appendChild(s)}else{this.pageCounterElement.innerHTML="";if(s!=null){console.warn("Page Counter Error - Page Counter has returned a type of object, the only valid page counter object return is an instance of Node, the page counter returned:",s)}}break;case"undefined":this.pageCounterElement.innerHTML="";break;default:this.pageCounterElement.innerHTML=s}}}_setPageButtons(){let t=Math.floor((this.count-1)/2);let i=Math.ceil((this.count-1)/2);let e=this.max-this.page+t+1<this.count?this.max-this.count+1:Math.max(this.page-t,1);let s=this.page<=i?Math.min(this.count,this.max):Math.min(this.page+i,this.max);while(this.pagesElement.firstChild)this.pagesElement.removeChild(this.pagesElement.firstChild);if(this.page==1){this.firstBut.disabled=true;this.prevBut.disabled=true}else{this.firstBut.disabled=false;this.prevBut.disabled=false}if(this.page==this.max){this.lastBut.disabled=true;this.nextBut.disabled=true}else{this.lastBut.disabled=false;this.nextBut.disabled=false}for(let t=e;t<=s;t++){if(t>0&&t<=this.max){this.pagesElement.appendChild(this._generatePageButton(t))}}this.footerRedraw()}_generatePageButton(t){var i=document.createElement("button");i.classList.add("tabulator-page");if(t==this.page){i.classList.add("active")}i.setAttribute("type","button");i.setAttribute("role","button");this.langBind("pagination|page_title",(e=>{i.setAttribute("aria-label",e+" "+t);i.setAttribute("title",e+" "+t)}));i.setAttribute("data-page",t);i.textContent=t;i.addEventListener("click",(i=>{this.setPage(t)}));return i}previousPage(){if(this.page>1){this.page--;this.trackChanges();return this.trigger()}else{console.warn("Pagination Error - Previous page would be less than page 1:",0);return Promise.reject()}}nextPage(){if(this.page<this.max){this.page++;this.trackChanges();return this.trigger()}else{if(!this.progressiveLoad){console.warn("Pagination Error - Next page would be greater than maximum page of "+this.max+":",this.max+1)}return Promise.reject()}}getPage(){return this.page}getPageMax(){return this.max}getPageSize(t){return this.size}getMode(){return this.mode}getRows(t){var i=0,e,s,r,a;var o=t.filter((t=>t.type==="row"));if(this.mode=="local"){e=[];this.setMaxRows(t.length);if(this.size===true){s=0;r=t.length}else{s=this.size*(this.page-1);r=s+parseInt(this.size)}this._setPageButtons();for(let o=s;o<r;o++){let s=t[o];if(s){e.push(s);if(s.type==="row"){if(!a){a=s}i++}}}this._setPageCounter(o.length,i,a?o.indexOf(a)+1:0);return e}else{this._setPageButtons();this._setPageCounter(o.length);return t.slice(0)}}trigger(){var t;switch(this.mode){case"local":t=this.table.rowManager.scrollLeft;this.refreshData();this.table.rowManager.scrollHorizontal(t);this.dispatchExternal("pageLoaded",this.getPage());return Promise.resolve();case"remote":this.dataChanging=true;return this.reloadData(null).finally((()=>{this.dataChanging=false}));case"progressive_load":case"progressive_scroll":return this.reloadData(null,true);default:console.warn("Pagination Error - no such pagination mode:",this.mode);return Promise.reject()}}_parseRemoteData(t){var i,e;if(typeof t.last_page==="undefined"){console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").last_page||"last_page")+"' property")}if(t.data){this.max=parseInt(t.last_page)||1;this.remoteRowCountEstimate=typeof t.last_row!=="undefined"?t.last_row:t.last_page*this.size-(this.page==t.last_page?this.size-t.data.length:0);if(this.progressiveLoad){switch(this.mode){case"progressive_load":if(this.page==1){this.table.rowManager.setData(t.data,false,this.page==1)}else{this.table.rowManager.addRows(t.data)}if(this.page<this.max){setTimeout((()=>{this.nextPage()}),this.table.options.progressiveLoadDelay)}break;case"progressive_scroll":t=this.page===1?t.data:this.table.rowManager.getData().concat(t.data);this.table.rowManager.setData(t,this.page!==1,this.page==1);i=this.table.options.progressiveLoadScrollMargin||this.table.rowManager.element.clientHeight*2;if(this.table.rowManager.element.scrollHeight<=this.table.rowManager.element.clientHeight+i){if(this.page<this.max){setTimeout((()=>{this.nextPage()}))}}break}return false}else{if(this.page>this.max){console.warn("Remote Pagination Error - Server returned last page value lower than the current page");e=this.options("paginationOutOfRange");if(e){return this.setPage(typeof e==="function"?e.call(this,this.page,this.max):e)}}this.dispatchExternal("pageLoaded",this.getPage())}}else{console.warn("Remote Pagination Error - Server response missing '"+(this.options("dataReceiveParams").data||"data")+"' property")}return t.data}footerRedraw(){var t=this.table.footerManager.containerElement;if(Math.ceil(t.clientWidth)-t.scrollWidth<0){this.pagesElement.style.display="none"}else{this.pagesElement.style.display="";if(Math.ceil(t.clientWidth)-t.scrollWidth<0){this.pagesElement.style.display="none"}}}}var Hi={local:function(t,i){var e=localStorage.getItem(t+"-"+i);return e?JSON.parse(e):false},cookie:function(t,i){var e=document.cookie,s=t+"-"+i,r=e.indexOf(s+"="),a,o;if(r>-1){e=e.slice(r);a=e.indexOf(";");if(a>-1){e=e.slice(0,a)}o=e.replace(s+"=","")}return o?JSON.parse(o):false}};var _i={local:function(t,i,e){localStorage.setItem(t+"-"+i,JSON.stringify(e))},cookie:function(t,i,e){var s=new Date;s.setDate(s.getDate()+1e4);document.cookie=t+"-"+i+"="+JSON.stringify(e)+"; expires="+s.toUTCString()}};class Li extends S{static moduleName="persistence";static moduleInitOrder=-10;static readers=Hi;static writers=_i;constructor(t){super(t);this.mode="";this.id="";this.defWatcherBlock=false;this.config={};this.readFunc=false;this.writeFunc=false;this.registerTableOption("persistence",false);this.registerTableOption("persistenceID","");this.registerTableOption("persistenceMode",true);this.registerTableOption("persistenceReaderFunc",false);this.registerTableOption("persistenceWriterFunc",false)}localStorageTest(){var t="_tabulator_test";try{window.localStorage.setItem(t,t);window.localStorage.removeItem(t);return true}catch(t){return false}}initialize(){if(this.table.options.persistence){var t=this.table.options.persistenceMode,i=this.table.options.persistenceID,e;this.mode=t!==true?t:this.localStorageTest()?"local":"cookie";if(this.table.options.persistenceReaderFunc){if(typeof this.table.options.persistenceReaderFunc==="function"){this.readFunc=this.table.options.persistenceReaderFunc}else{if(Li.readers[this.table.options.persistenceReaderFunc]){this.readFunc=Li.readers[this.table.options.persistenceReaderFunc]}else{console.warn("Persistence Read Error - invalid reader set",this.table.options.persistenceReaderFunc)}}}else{if(Li.readers[this.mode]){this.readFunc=Li.readers[this.mode]}else{console.warn("Persistence Read Error - invalid reader set",this.mode)}}if(this.table.options.persistenceWriterFunc){if(typeof this.table.options.persistenceWriterFunc==="function"){this.writeFunc=this.table.options.persistenceWriterFunc}else{if(Li.writers[this.table.options.persistenceWriterFunc]){this.writeFunc=Li.writers[this.table.options.persistenceWriterFunc]}else{console.warn("Persistence Write Error - invalid reader set",this.table.options.persistenceWriterFunc)}}}else{if(Li.writers[this.mode]){this.writeFunc=Li.writers[this.mode]}else{console.warn("Persistence Write Error - invalid writer set",this.mode)}}this.id="tabulator-"+(i||(this.table.element.getAttribute("id")||""));this.config={sort:this.table.options.persistence===true||this.table.options.persistence.sort,filter:this.table.options.persistence===true||this.table.options.persistence.filter,headerFilter:this.table.options.persistence===true||this.table.options.persistence.headerFilter,group:this.table.options.persistence===true||this.table.options.persistence.group,page:this.table.options.persistence===true||this.table.options.persistence.page,columns:this.table.options.persistence===true?["title","width","visible"]:this.table.options.persistence.columns};if(this.config.page){e=this.retrieveData("page");if(e){if(typeof e.paginationSize!=="undefined"&&(this.config.page===true||this.config.page.size)){this.table.options.paginationSize=e.paginationSize}if(typeof e.paginationInitialPage!=="undefined"&&(this.config.page===true||this.config.page.page)){this.table.options.paginationInitialPage=e.paginationInitialPage}}}if(this.config.group){e=this.retrieveData("group");if(e){if(typeof e.groupBy!=="undefined"&&(this.config.group===true||this.config.group.groupBy)){this.table.options.groupBy=e.groupBy}if(typeof e.groupStartOpen!=="undefined"&&(this.config.group===true||this.config.group.groupStartOpen)){this.table.options.groupStartOpen=e.groupStartOpen}if(typeof e.groupHeader!=="undefined"&&(this.config.group===true||this.config.group.groupHeader)){this.table.options.groupHeader=e.groupHeader}}}if(this.config.columns){this.table.options.columns=this.load("columns",this.table.options.columns);this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("column-show",this.save.bind(this,"columns"));this.subscribe("column-hide",this.save.bind(this,"columns"));this.subscribe("column-moved",this.save.bind(this,"columns"))}this.subscribe("table-built",this.tableBuilt.bind(this),0);this.subscribe("table-redraw",this.tableRedraw.bind(this));this.subscribe("filter-changed",this.eventSave.bind(this,"filter"));this.subscribe("filter-changed",this.eventSave.bind(this,"headerFilter"));this.subscribe("sort-changed",this.eventSave.bind(this,"sort"));this.subscribe("group-changed",this.eventSave.bind(this,"group"));this.subscribe("page-changed",this.eventSave.bind(this,"page"));this.subscribe("column-resized",this.eventSave.bind(this,"columns"));this.subscribe("column-width",this.eventSave.bind(this,"columns"));this.subscribe("layout-refreshed",this.eventSave.bind(this,"columns"))}this.registerTableFunction("getColumnLayout",this.getColumnLayout.bind(this));this.registerTableFunction("setColumnLayout",this.setColumnLayout.bind(this))}eventSave(t){if(this.config[t]){this.save(t)}}tableBuilt(){var t,i,e;if(this.config.sort){t=this.load("sort");if(!t===false){this.table.options.initialSort=t}}if(this.config.filter){i=this.load("filter");if(!i===false){this.table.options.initialFilter=i}}if(this.config.headerFilter){e=this.load("headerFilter");if(!e===false){this.table.options.initialHeaderFilter=e}}}tableRedraw(t){if(t&&this.config.columns){this.save("columns")}}getColumnLayout(){return this.parseColumns(this.table.columnManager.getColumns())}setColumnLayout(t){this.table.columnManager.setColumns(this.mergeDefinition(this.table.options.columns,t,true));return true}initializeColumn(t){var i,e;if(this.config.columns){this.defWatcherBlock=true;i=t.getDefinition();e=this.config.columns===true?Object.keys(i):this.config.columns;e.forEach((t=>{var e=Object.getOwnPropertyDescriptor(i,t);var s=i[t];if(e){Object.defineProperty(i,t,{set:t=>{s=t;if(!this.defWatcherBlock){this.save("columns")}if(e.set){e.set(t)}},get:()=>{if(e.get){e.get()}return s}})}}));this.defWatcherBlock=false}}load(t,i){var e=this.retrieveData(t);if(i){e=e?this.mergeDefinition(i,e):i}return e}retrieveData(t){return this.readFunc?this.readFunc(this.id,t):false}mergeDefinition(t,i,e){var s=[];i=i||[];i.forEach(((i,r)=>{var a=this._findColumn(t,i),o;if(a){if(e){o=Object.keys(i)}else if(this.config.columns===true||this.config.columns==undefined){o=Object.keys(a);o.push("width")}else{o=this.config.columns}o.forEach((t=>{if(t!=="columns"&&typeof i[t]!=="undefined"){a[t]=i[t]}}));if(a.columns){a.columns=this.mergeDefinition(a.columns,i.columns)}s.push(a)}}));t.forEach(((t,e)=>{var r=this._findColumn(i,t);if(!r){if(s.length>e){s.splice(e,0,t)}else{s.push(t)}}}));return s}_findColumn(t,i){var e=i.columns?"group":i.field?"field":"object";return t.find((function(t){switch(e){case"group":return t.title===i.title&&t.columns.length===i.columns.length;case"field":return t.field===i.field;case"object":return t===i}}))}save(t){var i={};switch(t){case"columns":i=this.parseColumns(this.table.columnManager.getColumns());break;case"filter":i=this.table.modules.filter.getFilters();break;case"headerFilter":i=this.table.modules.filter.getHeaderFilters();break;case"sort":i=this.validateSorters(this.table.modules.sort.getSort());break;case"group":i=this.getGroupConfig();break;case"page":i=this.getPageConfig();break}if(this.writeFunc){this.writeFunc(this.id,t,i)}}validateSorters(t){t.forEach((function(t){t.column=t.field;delete t.field}));return t}getGroupConfig(){var t={};if(this.config.group){if(this.config.group===true||this.config.group.groupBy){t.groupBy=this.table.options.groupBy}if(this.config.group===true||this.config.group.groupStartOpen){t.groupStartOpen=this.table.options.groupStartOpen}if(this.config.group===true||this.config.group.groupHeader){t.groupHeader=this.table.options.groupHeader}}return t}getPageConfig(){var t={};if(this.config.page){if(this.config.page===true||this.config.page.size){t.paginationSize=this.table.modules.page.getPageSize()}if(this.config.page===true||this.config.page.page){t.paginationInitialPage=this.table.modules.page.getPage()}}return t}parseColumns(t){var i=[],e=["headerContextMenu","headerMenu","contextMenu","clickMenu"];t.forEach((t=>{var s={},r=t.getDefinition(),a;if(t.isGroup){s.title=r.title;s.columns=this.parseColumns(t.getColumns())}else{s.field=t.getField();if(this.config.columns===true||this.config.columns==undefined){a=Object.keys(r);a.push("width");a.push("visible")}else{a=this.config.columns}a.forEach((i=>{switch(i){case"width":s.width=t.getWidth();break;case"visible":s.visible=t.visible;break;default:if(typeof r[i]!=="function"&&e.indexOf(i)===-1){s[i]=r[i]}}}))}i.push(s)}));return i}}class Ai extends S{static moduleName="popup";constructor(t){super(t);this.columnSubscribers={};this.registerTableOption("rowContextPopup",false);this.registerTableOption("rowClickPopup",false);this.registerTableOption("rowDblClickPopup",false);this.registerTableOption("groupContextPopup",false);this.registerTableOption("groupClickPopup",false);this.registerTableOption("groupDblClickPopup",false);this.registerColumnOption("headerContextPopup");this.registerColumnOption("headerClickPopup");this.registerColumnOption("headerDblClickPopup");this.registerColumnOption("headerPopup");this.registerColumnOption("headerPopupIcon");this.registerColumnOption("contextPopup");this.registerColumnOption("clickPopup");this.registerColumnOption("dblClickPopup");this.registerComponentFunction("cell","popup",this._componentPopupCall.bind(this));this.registerComponentFunction("column","popup",this._componentPopupCall.bind(this));this.registerComponentFunction("row","popup",this._componentPopupCall.bind(this));this.registerComponentFunction("group","popup",this._componentPopupCall.bind(this))}initialize(){this.initializeRowWatchers();this.initializeGroupWatchers();this.subscribe("column-init",this.initializeColumn.bind(this))}_componentPopupCall(t,i,e){this.loadPopupEvent(i,null,t,e)}initializeRowWatchers(){if(this.table.options.rowContextPopup){this.subscribe("row-contextmenu",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup));this.table.on("rowTapHold",this.loadPopupEvent.bind(this,this.table.options.rowContextPopup))}if(this.table.options.rowClickPopup){this.subscribe("row-click",this.loadPopupEvent.bind(this,this.table.options.rowClickPopup))}if(this.table.options.rowDblClickPopup){this.subscribe("row-dblclick",this.loadPopupEvent.bind(this,this.table.options.rowDblClickPopup))}}initializeGroupWatchers(){if(this.table.options.groupContextPopup){this.subscribe("group-contextmenu",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup));this.table.on("groupTapHold",this.loadPopupEvent.bind(this,this.table.options.groupContextPopup))}if(this.table.options.groupClickPopup){this.subscribe("group-click",this.loadPopupEvent.bind(this,this.table.options.groupClickPopup))}if(this.table.options.groupDblClickPopup){this.subscribe("group-dblclick",this.loadPopupEvent.bind(this,this.table.options.groupDblClickPopup))}}initializeColumn(t){var i=t.definition;if(i.headerContextPopup&&!this.columnSubscribers.headerContextPopup){this.columnSubscribers.headerContextPopup=this.loadPopupTableColumnEvent.bind(this,"headerContextPopup");this.subscribe("column-contextmenu",this.columnSubscribers.headerContextPopup);this.table.on("headerTapHold",this.loadPopupTableColumnEvent.bind(this,"headerContextPopup"))}if(i.headerClickPopup&&!this.columnSubscribers.headerClickPopup){this.columnSubscribers.headerClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerClickPopup");this.subscribe("column-click",this.columnSubscribers.headerClickPopup)}if(i.headerDblClickPopup&&!this.columnSubscribers.headerDblClickPopup){this.columnSubscribers.headerDblClickPopup=this.loadPopupTableColumnEvent.bind(this,"headerDblClickPopup");this.subscribe("column-dblclick",this.columnSubscribers.headerDblClickPopup)}if(i.headerPopup){this.initializeColumnHeaderPopup(t)}if(i.contextPopup&&!this.columnSubscribers.contextPopup){this.columnSubscribers.contextPopup=this.loadPopupTableCellEvent.bind(this,"contextPopup");this.subscribe("cell-contextmenu",this.columnSubscribers.contextPopup);this.table.on("cellTapHold",this.loadPopupTableCellEvent.bind(this,"contextPopup"))}if(i.clickPopup&&!this.columnSubscribers.clickPopup){this.columnSubscribers.clickPopup=this.loadPopupTableCellEvent.bind(this,"clickPopup");this.subscribe("cell-click",this.columnSubscribers.clickPopup)}if(i.dblClickPopup&&!this.columnSubscribers.dblClickPopup){this.columnSubscribers.dblClickPopup=this.loadPopupTableCellEvent.bind(this,"dblClickPopup");this.subscribe("cell-click",this.columnSubscribers.dblClickPopup)}}initializeColumnHeaderPopup(t){var i=t.definition.headerPopupIcon,e;e=document.createElement("span");e.classList.add("tabulator-header-popup-button");if(i){if(typeof i==="function"){i=i(t.getComponent())}if(i instanceof HTMLElement){e.appendChild(i)}else{e.innerHTML=i}}else{e.innerHTML="&vellip;"}e.addEventListener("click",(i=>{i.stopPropagation();i.preventDefault();this.loadPopupEvent(t.definition.headerPopup,i,t)}));t.titleElement.insertBefore(e,t.titleElement.firstChild)}loadPopupTableCellEvent(t,i,e){if(e._cell){e=e._cell}if(e.column.definition[t]){this.loadPopupEvent(e.column.definition[t],i,e)}}loadPopupTableColumnEvent(t,i,e){if(e._column){e=e._column}if(e.definition[t]){this.loadPopupEvent(e.definition[t],i,e)}}loadPopupEvent(t,i,e,s){var r;function a(t){r=t}if(e._group){e=e._group}else if(e._row){e=e._row}t=typeof t=="function"?t.call(this.table,i,e.getComponent(),a):t;this.loadPopup(i,e,t,r,s)}loadPopup(t,i,e,s,r){var a=!(t instanceof MouseEvent),o,h;if(e instanceof HTMLElement){o=e}else{o=document.createElement("div");o.innerHTML=e}o.classList.add("tabulator-popup");o.addEventListener("click",(t=>{t.stopPropagation()}));if(!a){t.preventDefault()}h=this.popup(o);if(typeof s==="function"){h.renderCallback(s)}if(t){h.show(t)}else{h.show(i.getElement(),r||"center")}h.hideOnBlur((()=>{this.dispatchExternal("popupClosed",i.getComponent())}));this.dispatchExternal("popupOpened",i.getComponent())}}class Ii extends S{static moduleName="print";constructor(t){super(t);this.element=false;this.manualBlock=false;this.beforeprintEventHandler=null;this.afterprintEventHandler=null;this.registerTableOption("printAsHtml",false);this.registerTableOption("printFormatter",false);this.registerTableOption("printHeader",false);this.registerTableOption("printFooter",false);this.registerTableOption("printStyled",true);this.registerTableOption("printRowRange","visible");this.registerTableOption("printConfig",{});this.registerColumnOption("print");this.registerColumnOption("titlePrint")}initialize(){if(this.table.options.printAsHtml){this.beforeprintEventHandler=this.replaceTable.bind(this);this.afterprintEventHandler=this.cleanup.bind(this);window.addEventListener("beforeprint",this.beforeprintEventHandler);window.addEventListener("afterprint",this.afterprintEventHandler);this.subscribe("table-destroy",this.destroy.bind(this))}this.registerTableFunction("print",this.printFullscreen.bind(this))}destroy(){if(this.table.options.printAsHtml){window.removeEventListener("beforeprint",this.beforeprintEventHandler);window.removeEventListener("afterprint",this.afterprintEventHandler)}}replaceTable(){if(!this.manualBlock){this.element=document.createElement("div");this.element.classList.add("tabulator-print-table");this.element.appendChild(this.table.modules.export.generateTable(this.table.options.printConfig,this.table.options.printStyled,this.table.options.printRowRange,"print"));this.table.element.style.display="none";this.table.element.parentNode.insertBefore(this.element,this.table.element)}}cleanup(){document.body.classList.remove("tabulator-print-fullscreen-hide");if(this.element&&this.element.parentNode){this.element.parentNode.removeChild(this.element);this.table.element.style.display=""}}printFullscreen(t,i,e){var s=window.scrollX,r=window.scrollY,a=document.createElement("div"),o=document.createElement("div"),h=this.table.modules.export.generateTable(typeof e!="undefined"?e:this.table.options.printConfig,typeof i!="undefined"?i:this.table.options.printStyled,t||this.table.options.printRowRange,"print"),l,n;this.manualBlock=true;this.element=document.createElement("div");this.element.classList.add("tabulator-print-fullscreen");if(this.table.options.printHeader){a.classList.add("tabulator-print-header");l=typeof this.table.options.printHeader=="function"?this.table.options.printHeader.call(this.table):this.table.options.printHeader;if(typeof l=="string"){a.innerHTML=l}else{a.appendChild(l)}this.element.appendChild(a)}this.element.appendChild(h);if(this.table.options.printFooter){o.classList.add("tabulator-print-footer");n=typeof this.table.options.printFooter=="function"?this.table.options.printFooter.call(this.table):this.table.options.printFooter;if(typeof n=="string"){o.innerHTML=n}else{o.appendChild(n)}this.element.appendChild(o)}document.body.classList.add("tabulator-print-fullscreen-hide");document.body.appendChild(this.element);if(this.table.options.printFormatter){this.table.options.printFormatter(this.element,h)}window.print();this.cleanup();window.scrollTo(s,r);this.manualBlock=false}}class Vi extends S{static moduleName="reactiveData";constructor(t){super(t);this.data=false;this.blocked=false;this.origFuncs={};this.currentVersion=0;this.registerTableOption("reactiveData",false)}initialize(){if(this.table.options.reactiveData){this.subscribe("cell-value-save-before",this.block.bind(this,"cellsave"));this.subscribe("cell-value-save-after",this.unblock.bind(this,"cellsave"));this.subscribe("row-data-save-before",this.block.bind(this,"rowsave"));this.subscribe("row-data-save-after",this.unblock.bind(this,"rowsave"));this.subscribe("row-data-init-after",this.watchRow.bind(this));this.subscribe("data-processing",this.watchData.bind(this));this.subscribe("table-destroy",this.unwatchData.bind(this))}}watchData(t){var i=this,e;this.currentVersion++;e=this.currentVersion;this.unwatchData();this.data=t;this.origFuncs.push=t.push;Object.defineProperty(this.data,"push",{enumerable:false,configurable:true,value:function(){var s=Array.from(arguments),r;if(!i.blocked&&e===i.currentVersion){i.block("data-push");s.forEach((t=>{i.table.rowManager.addRowActual(t,false)}));r=i.origFuncs.push.apply(t,arguments);i.unblock("data-push")}return r}});this.origFuncs.unshift=t.unshift;Object.defineProperty(this.data,"unshift",{enumerable:false,configurable:true,value:function(){var s=Array.from(arguments),r;if(!i.blocked&&e===i.currentVersion){i.block("data-unshift");s.forEach((t=>{i.table.rowManager.addRowActual(t,true)}));r=i.origFuncs.unshift.apply(t,arguments);i.unblock("data-unshift")}return r}});this.origFuncs.shift=t.shift;Object.defineProperty(this.data,"shift",{enumerable:false,configurable:true,value:function(){var s,r;if(!i.blocked&&e===i.currentVersion){i.block("data-shift");if(i.data.length){s=i.table.rowManager.getRowFromDataObject(i.data[0]);if(s){s.deleteActual()}}r=i.origFuncs.shift.call(t);i.unblock("data-shift")}return r}});this.origFuncs.pop=t.pop;Object.defineProperty(this.data,"pop",{enumerable:false,configurable:true,value:function(){var s,r;if(!i.blocked&&e===i.currentVersion){i.block("data-pop");if(i.data.length){s=i.table.rowManager.getRowFromDataObject(i.data[i.data.length-1]);if(s){s.deleteActual()}}r=i.origFuncs.pop.call(t);i.unblock("data-pop")}return r}});this.origFuncs.splice=t.splice;Object.defineProperty(this.data,"splice",{enumerable:false,configurable:true,value:function(){var s=Array.from(arguments),r=s[0]<0?t.length+s[0]:s[0],a=s[1],o=s[2]?s.slice(2):false,h,l;if(!i.blocked&&e===i.currentVersion){i.block("data-splice");if(o){h=t[r]?i.table.rowManager.getRowFromDataObject(t[r]):false;if(h){o.forEach((t=>{i.table.rowManager.addRowActual(t,true,h,true)}))}else{o=o.slice().reverse();o.forEach((t=>{i.table.rowManager.addRowActual(t,true,false,true)}))}}if(a!==0){var n=t.slice(r,typeof s[1]==="undefined"?s[1]:r+a);n.forEach(((t,e)=>{var s=i.table.rowManager.getRowFromDataObject(t);if(s){s.deleteActual(e!==n.length-1)}}))}if(o||a!==0){i.table.rowManager.reRenderInPosition()}l=i.origFuncs.splice.apply(t,arguments);i.unblock("data-splice")}return l}})}unwatchData(){if(this.data!==false){for(var t in this.origFuncs){Object.defineProperty(this.data,t,{enumerable:true,configurable:true,writable:true,value:this.origFuncs.key})}}}watchRow(t){var i=t.getData();for(var e in i){this.watchKey(t,i,e)}if(this.table.options.dataTree){this.watchTreeChildren(t)}}watchTreeChildren(t){var i=this,e=t.getData()[this.table.options.dataTreeChildField],s={};if(e){s.push=e.push;Object.defineProperty(e,"push",{enumerable:false,configurable:true,value:()=>{if(!i.blocked){i.block("tree-push");var r=s.push.apply(e,arguments);this.rebuildTree(t);i.unblock("tree-push")}return r}});s.unshift=e.unshift;Object.defineProperty(e,"unshift",{enumerable:false,configurable:true,value:()=>{if(!i.blocked){i.block("tree-unshift");var r=s.unshift.apply(e,arguments);this.rebuildTree(t);i.unblock("tree-unshift")}return r}});s.shift=e.shift;Object.defineProperty(e,"shift",{enumerable:false,configurable:true,value:()=>{if(!i.blocked){i.block("tree-shift");var r=s.shift.call(e);this.rebuildTree(t);i.unblock("tree-shift")}return r}});s.pop=e.pop;Object.defineProperty(e,"pop",{enumerable:false,configurable:true,value:()=>{if(!i.blocked){i.block("tree-pop");var r=s.pop.call(e);this.rebuildTree(t);i.unblock("tree-pop")}return r}});s.splice=e.splice;Object.defineProperty(e,"splice",{enumerable:false,configurable:true,value:()=>{if(!i.blocked){i.block("tree-splice");var r=s.splice.apply(e,arguments);this.rebuildTree(t);i.unblock("tree-splice")}return r}})}}rebuildTree(t){this.table.modules.dataTree.initializeRow(t);this.table.modules.dataTree.layoutRow(t);this.table.rowManager.refreshActiveData("tree",false,true)}watchKey(t,i,e){var s=this,r=Object.getOwnPropertyDescriptor(i,e),a=i[e],o=this.currentVersion;Object.defineProperty(i,e,{set:i=>{a=i;if(!s.blocked&&o===s.currentVersion){s.block("key");var h={};h[e]=i;t.updateData(h);s.unblock("key")}if(r.set){r.set(i)}},get:()=>{if(r.get){r.get()}return a}})}unwatchRow(t){var i=t.getData();for(var e in i){Object.defineProperty(i,e,{value:i[e]})}}block(t){if(!this.blocked){this.blocked=t}}unblock(t){if(this.blocked===t){this.blocked=false}}}class Ui extends S{static moduleName="resizeColumns";constructor(t){super(t);this.startColumn=false;this.startX=false;this.startWidth=false;this.latestX=false;this.handle=null;this.initialNextColumn=null;this.nextColumn=null;this.initialized=false;this.registerColumnOption("resizable",true);this.registerTableOption("resizableColumnFit",false);this.registerTableOption("resizableColumnGuide",false)}initialize(){this.subscribe("column-rendered",this.layoutColumnHeader.bind(this))}initializeEventWatchers(){if(!this.initialized){this.subscribe("cell-rendered",this.layoutCellHandles.bind(this));this.subscribe("cell-delete",this.deInitializeComponent.bind(this));this.subscribe("cell-height",this.resizeHandle.bind(this));this.subscribe("column-moved",this.columnLayoutUpdated.bind(this));this.subscribe("column-hide",this.deInitializeColumn.bind(this));this.subscribe("column-show",this.columnLayoutUpdated.bind(this));this.subscribe("column-width",this.columnWidthUpdated.bind(this));this.subscribe("column-delete",this.deInitializeComponent.bind(this));this.subscribe("column-height",this.resizeHandle.bind(this));this.initialized=true}}layoutCellHandles(t){if(t.row.type==="row"){this.deInitializeComponent(t);this.initializeColumn("cell",t,t.column,t.element)}}layoutColumnHeader(t){if(t.definition.resizable){this.initializeEventWatchers();this.deInitializeComponent(t);this.initializeColumn("header",t,t,t.element)}}columnLayoutUpdated(t){var i=t.prevColumn();this.reinitializeColumn(t);if(i){this.reinitializeColumn(i)}}columnWidthUpdated(t){if(t.modules.frozen){if(this.table.modules.frozenColumns.leftColumns.includes(t)){this.table.modules.frozenColumns.leftColumns.forEach((t=>{this.reinitializeColumn(t)}))}else if(this.table.modules.frozenColumns.rightColumns.includes(t)){this.table.modules.frozenColumns.rightColumns.forEach((t=>{this.reinitializeColumn(t)}))}}}frozenColumnOffset(t){var i=false;if(t.modules.frozen){i=t.modules.frozen.marginValue;if(t.modules.frozen.position==="left"){i+=t.getWidth()-3}else{if(i){i-=3}}}return i!==false?i+"px":false}reinitializeColumn(t){var i=this.frozenColumnOffset(t);t.cells.forEach((e=>{if(e.modules.resize&&e.modules.resize.handleEl){if(i){e.modules.resize.handleEl.style[t.modules.frozen.position]=i;e.modules.resize.handleEl.style["z-index"]=11}e.element.after(e.modules.resize.handleEl)}}));if(t.modules.resize&&t.modules.resize.handleEl){if(i){t.modules.resize.handleEl.style[t.modules.frozen.position]=i}t.element.after(t.modules.resize.handleEl)}}initializeColumn(t,i,e,s){var r=this,a=false,o=e.definition.resizable,h={},l=e.getLastColumn();if(t==="header"){a=e.definition.formatter=="textarea"||e.definition.variableHeight;h={variableHeight:a}}if((o===true||o==t)&&this._checkResizability(l)){var n=document.createElement("span");n.className="tabulator-col-resize-handle";n.addEventListener("click",(function(t){t.stopPropagation()}));var u=function(t){r.startColumn=e;r.initialNextColumn=r.nextColumn=l.nextColumn();r._mouseDown(t,l,n)};n.addEventListener("mousedown",u);n.addEventListener("touchstart",u,{passive:true});n.addEventListener("dblclick",(t=>{var i=l.getWidth();t.stopPropagation();l.reinitializeWidth(true);if(i!==l.getWidth()){r.dispatch("column-resized",l);r.dispatchExternal("columnResized",l.getComponent())}}));if(e.modules.frozen){n.style.position="sticky";n.style[e.modules.frozen.position]=this.frozenColumnOffset(e)}h.handleEl=n;if(s.parentNode&&e.visible){s.after(n)}}i.modules.resize=h}deInitializeColumn(t){this.deInitializeComponent(t);t.cells.forEach((t=>{this.deInitializeComponent(t)}))}deInitializeComponent(t){var i;if(t.modules.resize){i=t.modules.resize.handleEl;if(i&&i.parentElement){i.parentElement.removeChild(i)}}}resizeHandle(t,i){if(t.modules.resize&&t.modules.resize.handleEl){t.modules.resize.handleEl.style.height=i}}resize(t,i){var e=typeof t.clientX==="undefined"?t.touches[0].clientX:t.clientX,s=e-this.startX,r=e-this.latestX,a,o;this.latestX=e;if(this.table.rtl){s=-s;r=-r}a=i.width==i.minWidth||i.width==i.maxWidth;i.setWidth(this.startWidth+s);o=i.width==i.minWidth||i.width==i.maxWidth;if(r<0){this.nextColumn=this.initialNextColumn}if(this.table.options.resizableColumnFit&&this.nextColumn&&!(a&&o)){let t=this.nextColumn.getWidth();if(r>0){if(t<=this.nextColumn.minWidth){this.nextColumn=this.nextColumn.nextColumn()}}if(this.nextColumn){this.nextColumn.setWidth(this.nextColumn.getWidth()-r)}}this.table.columnManager.rerenderColumns(true);if(!this.table.browserSlow&&i.modules.resize&&i.modules.resize.variableHeight){i.checkCellHeights()}}calcGuidePosition(t,i,e){var s=typeof t.clientX==="undefined"?t.touches[0].clientX:t.clientX,r=e.getBoundingClientRect().x-this.table.element.getBoundingClientRect().x,a=this.table.element.getBoundingClientRect().x,o=i.element.getBoundingClientRect().left-a,h=s-this.startX,l=Math.max(r+h,o+i.minWidth);if(i.maxWidth){l=Math.min(l,o+i.maxWidth)}return l}_checkResizability(t){return t.definition.resizable}_mouseDown(t,i,e){var s=this,r;this.dispatchExternal("columnResizing",i.getComponent());if(s.table.options.resizableColumnGuide){r=document.createElement("span");r.classList.add("tabulator-col-resize-guide");s.table.element.appendChild(r);setTimeout((()=>{r.style.left=s.calcGuidePosition(t,i,e)+"px"}))}s.table.element.classList.add("tabulator-block-select");function a(t){if(s.table.options.resizableColumnGuide){r.style.left=s.calcGuidePosition(t,i,e)+"px"}else{s.resize(t,i)}}function o(t){if(s.table.options.resizableColumnGuide){s.resize(t,i);r.remove()}if(s.startColumn.modules.edit){s.startColumn.modules.edit.blocked=false}if(s.table.browserSlow&&i.modules.resize&&i.modules.resize.variableHeight){i.checkCellHeights()}document.body.removeEventListener("mouseup",o);document.body.removeEventListener("mousemove",a);e.removeEventListener("touchmove",a);e.removeEventListener("touchend",o);s.table.element.classList.remove("tabulator-block-select");if(s.startWidth!==i.getWidth()){s.table.columnManager.verticalAlignHeaders();s.dispatch("column-resized",i);s.dispatchExternal("columnResized",i.getComponent())}}t.stopPropagation();if(s.startColumn.modules.edit){s.startColumn.modules.edit.blocked=true}s.startX=typeof t.clientX==="undefined"?t.touches[0].clientX:t.clientX;s.latestX=s.startX;s.startWidth=i.getWidth();document.body.addEventListener("mousemove",a);document.body.addEventListener("mouseup",o);e.addEventListener("touchmove",a,{passive:true});e.addEventListener("touchend",o)}}class Bi extends S{static moduleName="resizeRows";constructor(t){super(t);this.startColumn=false;this.startY=false;this.startHeight=false;this.handle=null;this.prevHandle=null;this.registerTableOption("resizableRows",false);this.registerTableOption("resizableRowGuide",false)}initialize(){if(this.table.options.resizableRows){this.subscribe("row-layout-after",this.initializeRow.bind(this))}}initializeRow(t){var i=this,e=t.getElement();var s=document.createElement("div");s.className="tabulator-row-resize-handle";var r=document.createElement("div");r.className="tabulator-row-resize-handle prev";s.addEventListener("click",(function(t){t.stopPropagation()}));var a=function(e){i.startRow=t;i._mouseDown(e,t,s)};s.addEventListener("mousedown",a);s.addEventListener("touchstart",a,{passive:true});r.addEventListener("click",(function(t){t.stopPropagation()}));var o=function(e){var s=i.table.rowManager.prevDisplayRow(t);if(s){i.startRow=s;i._mouseDown(e,s,r)}};r.addEventListener("mousedown",o);r.addEventListener("touchstart",o,{passive:true});e.appendChild(s);e.appendChild(r)}resize(t,i){i.setHeight(this.startHeight+((typeof t.screenY==="undefined"?t.touches[0].screenY:t.screenY)-this.startY))}calcGuidePosition(t,i,e){var s=typeof t.screenY==="undefined"?t.touches[0].screenY:t.screenY,r=e.getBoundingClientRect().y-this.table.element.getBoundingClientRect().y,a=this.table.element.getBoundingClientRect().y,o=i.element.getBoundingClientRect().top-a,h=s-this.startY;return Math.max(r+h,o)}_mouseDown(t,i,e){var s=this,r;s.dispatchExternal("rowResizing",i.getComponent());if(s.table.options.resizableRowGuide){r=document.createElement("span");r.classList.add("tabulator-row-resize-guide");s.table.element.appendChild(r);setTimeout((()=>{r.style.top=s.calcGuidePosition(t,i,e)+"px"}))}s.table.element.classList.add("tabulator-block-select");function a(t){if(s.table.options.resizableRowGuide){r.style.top=s.calcGuidePosition(t,i,e)+"px"}else{s.resize(t,i)}}function o(t){if(s.table.options.resizableRowGuide){s.resize(t,i);r.remove()}document.body.removeEventListener("mouseup",a);document.body.removeEventListener("mousemove",a);e.removeEventListener("touchmove",a);e.removeEventListener("touchend",o);s.table.element.classList.remove("tabulator-block-select");s.dispatchExternal("rowResized",i.getComponent())}t.stopPropagation();s.startY=typeof t.screenY==="undefined"?t.touches[0].screenY:t.screenY;s.startHeight=i.getHeight();document.body.addEventListener("mousemove",a);document.body.addEventListener("mouseup",o);e.addEventListener("touchmove",a,{passive:true});e.addEventListener("touchend",o)}}class Gi extends S{static moduleName="resizeTable";constructor(t){super(t);this.binding=false;this.visibilityObserver=false;this.resizeObserver=false;this.containerObserver=false;this.tableHeight=0;this.tableWidth=0;this.containerHeight=0;this.containerWidth=0;this.autoResize=false;this.visible=false;this.initialized=false;this.initialRedraw=false;this.registerTableOption("autoResize",true)}initialize(){if(this.table.options.autoResize){var t=this.table,i;this.tableHeight=t.element.clientHeight;this.tableWidth=t.element.clientWidth;if(t.element.parentNode){this.containerHeight=t.element.parentNode.clientHeight;this.containerWidth=t.element.parentNode.clientWidth}if(typeof IntersectionObserver!=="undefined"&&typeof ResizeObserver!=="undefined"&&t.rowManager.getRenderMode()==="virtual"){this.initializeVisibilityObserver();this.autoResize=true;this.resizeObserver=new ResizeObserver((i=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var e=Math.floor(i[0].contentRect.height);var s=Math.floor(i[0].contentRect.width);if(this.tableHeight!=e||this.tableWidth!=s){this.tableHeight=e;this.tableWidth=s;if(t.element.parentNode){this.containerHeight=t.element.parentNode.clientHeight;this.containerWidth=t.element.parentNode.clientWidth}this.redrawTable()}}}));this.resizeObserver.observe(t.element);i=window.getComputedStyle(t.element);if(this.table.element.parentNode&&!this.table.rowManager.fixedHeight&&(i.getPropertyValue("max-height")||i.getPropertyValue("min-height"))){this.containerObserver=new ResizeObserver((i=>{if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){var e=Math.floor(i[0].contentRect.height);var s=Math.floor(i[0].contentRect.width);if(this.containerHeight!=e||this.containerWidth!=s){this.containerHeight=e;this.containerWidth=s;this.tableHeight=t.element.clientHeight;this.tableWidth=t.element.clientWidth}this.redrawTable()}}));this.containerObserver.observe(this.table.element.parentNode)}this.subscribe("table-resize",this.tableResized.bind(this))}else{this.binding=function(){if(!t.browserMobile||t.browserMobile&&(!t.modules.edit||t.modules.edit&&!t.modules.edit.currentCell)){t.columnManager.rerenderColumns(true);t.redraw()}};window.addEventListener("resize",this.binding)}this.subscribe("table-destroy",this.clearBindings.bind(this))}}initializeVisibilityObserver(){this.visibilityObserver=new IntersectionObserver((t=>{this.visible=t[0].isIntersecting;if(!this.initialized){this.initialized=true;this.initialRedraw=!this.visible}else{if(this.visible){this.redrawTable(this.initialRedraw);this.initialRedraw=false}}}));this.visibilityObserver.observe(this.table.element)}redrawTable(t){if(this.initialized&&this.visible){this.table.columnManager.rerenderColumns(true);this.table.redraw(t)}}tableResized(){this.table.rowManager.redraw()}clearBindings(){if(this.binding){window.removeEventListener("resize",this.binding)}if(this.resizeObserver){this.resizeObserver.unobserve(this.table.element)}if(this.visibilityObserver){this.visibilityObserver.unobserve(this.table.element)}if(this.containerObserver){this.containerObserver.unobserve(this.table.element.parentNode)}}}function Wi(t,i,e){var s=document.createElement("div"),r=t.getRow()._row.modules.responsiveLayout;s.classList.add("tabulator-responsive-collapse-toggle");s.innerHTML=`<svg class='tabulator-responsive-collapse-toggle-open' viewbox="0 0 24 24">\n <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n <line y1="7" x1="12" y2="17" x2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>\n\n<svg class='tabulator-responsive-collapse-toggle-close' viewbox="0 0 24 24">\n <line x1="7" y1="12" x2="17" y2="12" fill="none" stroke-width="3" stroke-linecap="round" />\n</svg>`;t.getElement().classList.add("tabulator-row-handle");function a(t){var i=r.element;r.open=t;if(i){if(r.open){s.classList.add("open");i.style.display=""}else{s.classList.remove("open");i.style.display="none"}}}s.addEventListener("click",(function(i){i.stopImmediatePropagation();a(!r.open);t.getTable().rowManager.adjustTableSize()}));a(r.open);return s}var Ji={format:{formatters:{responsiveCollapse:Wi}}};class qi extends S{static moduleName="responsiveLayout";static moduleExtensions=Ji;constructor(t){super(t);this.columns=[];this.hiddenColumns=[];this.mode="";this.index=0;this.collapseFormatter=[];this.collapseStartOpen=true;this.collapseHandleColumn=false;this.registerTableOption("responsiveLayout",false);this.registerTableOption("responsiveLayoutCollapseStartOpen",true);this.registerTableOption("responsiveLayoutCollapseUseFormatters",true);this.registerTableOption("responsiveLayoutCollapseFormatter",false);this.registerColumnOption("responsive")}initialize(){if(this.table.options.responsiveLayout){this.subscribe("column-layout",this.initializeColumn.bind(this));this.subscribe("column-show",this.updateColumnVisibility.bind(this));this.subscribe("column-hide",this.updateColumnVisibility.bind(this));this.subscribe("columns-loaded",this.initializeResponsivity.bind(this));this.subscribe("column-moved",this.initializeResponsivity.bind(this));this.subscribe("column-add",this.initializeResponsivity.bind(this));this.subscribe("column-delete",this.initializeResponsivity.bind(this));this.subscribe("table-redrawing",this.tableRedraw.bind(this));if(this.table.options.responsiveLayout==="collapse"){this.subscribe("row-data-changed",this.generateCollapsedRowContent.bind(this));this.subscribe("row-init",this.initializeRow.bind(this));this.subscribe("row-layout",this.layoutRow.bind(this))}}}tableRedraw(t){if(["fitColumns","fitDataStretch"].indexOf(this.layoutMode())===-1){if(!t){this.update()}}}initializeResponsivity(){var t=[];this.mode=this.table.options.responsiveLayout;this.collapseFormatter=this.table.options.responsiveLayoutCollapseFormatter||this.formatCollapsedData;this.collapseStartOpen=this.table.options.responsiveLayoutCollapseStartOpen;this.hiddenColumns=[];if(this.collapseFormatter){this.collapseFormatter=this.collapseFormatter.bind(this.table)}this.table.columnManager.columnsByIndex.forEach(((i,e)=>{if(i.modules.responsive){if(i.modules.responsive.order&&i.modules.responsive.visible){i.modules.responsive.index=e;t.push(i);if(!i.visible&&this.mode==="collapse"){this.hiddenColumns.push(i)}}}}));t=t.reverse();t=t.sort(((t,i)=>{var e=i.modules.responsive.order-t.modules.responsive.order;return e||i.modules.responsive.index-t.modules.responsive.index}));this.columns=t;if(this.mode==="collapse"){this.generateCollapsedContent()}for(let t of this.table.columnManager.columnsByIndex){if(t.definition.formatter=="responsiveCollapse"){this.collapseHandleColumn=t;break}}if(this.collapseHandleColumn){if(this.hiddenColumns.length){this.collapseHandleColumn.show()}else{this.collapseHandleColumn.hide()}}}initializeColumn(t){var i=t.getDefinition();t.modules.responsive={order:typeof i.responsive==="undefined"?1:i.responsive,visible:i.visible===false?false:true}}initializeRow(t){var i;if(t.type!=="calc"){i=document.createElement("div");i.classList.add("tabulator-responsive-collapse");t.modules.responsiveLayout={element:i,open:this.collapseStartOpen};if(!this.collapseStartOpen){i.style.display="none"}}}layoutRow(t){var i=t.getElement();if(t.modules.responsiveLayout){i.appendChild(t.modules.responsiveLayout.element);this.generateCollapsedRowContent(t)}}updateColumnVisibility(t,i){if(!i&&t.modules.responsive){t.modules.responsive.visible=t.visible;this.initializeResponsivity()}}hideColumn(t){var i=this.hiddenColumns.length;t.hide(false,true);if(this.mode==="collapse"){this.hiddenColumns.unshift(t);this.generateCollapsedContent();if(this.collapseHandleColumn&&!i){this.collapseHandleColumn.show()}}}showColumn(t){var i;t.show(false,true);t.setWidth(t.getWidth());if(this.mode==="collapse"){i=this.hiddenColumns.indexOf(t);if(i>-1){this.hiddenColumns.splice(i,1)}this.generateCollapsedContent();if(this.collapseHandleColumn&&!this.hiddenColumns.length){this.collapseHandleColumn.hide()}}}update(){var t=true;while(t){let i=this.table.modules.layout.getMode()=="fitColumns"?this.table.columnManager.getFlexBaseWidth():this.table.columnManager.getWidth();let e=(this.table.options.headerVisible?this.table.columnManager.element.clientWidth:this.table.element.clientWidth)-i;if(e<0){let i=this.columns[this.index];if(i){this.hideColumn(i);this.index++}else{t=false}}else{let i=this.columns[this.index-1];if(i){if(e>0){if(e>=i.getWidth()){this.showColumn(i);this.index--}else{t=false}}else{t=false}}else{t=false}}if(!this.table.rowManager.activeRowsCount){this.table.rowManager.renderEmptyScroll()}}}generateCollapsedContent(){var t=this.table.rowManager.getDisplayRows();t.forEach((t=>{this.generateCollapsedRowContent(t)}))}generateCollapsedRowContent(t){var i,e;if(t.modules.responsiveLayout){i=t.modules.responsiveLayout.element;while(i.firstChild)i.removeChild(i.firstChild);e=this.collapseFormatter(this.generateCollapsedRowData(t));if(e){i.appendChild(e)}t.calcHeight(true)}}generateCollapsedRowData(t){var i=t.getData(),e=[],s;this.hiddenColumns.forEach((r=>{var a=r.getFieldValue(i);if(r.definition.title&&r.field){if(r.modules.format&&this.table.options.responsiveLayoutCollapseUseFormatters){s={value:false,data:{},getValue:function(){return a},getData:function(){return i},getType:function(){return"cell"},getElement:function(){return document.createElement("div")},getRow:function(){return t.getComponent()},getColumn:function(){return r.getComponent()},getTable:()=>this.table};function o(t){t()}e.push({field:r.field,title:r.definition.title,value:r.modules.format.formatter.call(this.table.modules.format,s,r.modules.format.params,o)})}else{e.push({field:r.field,title:r.definition.title,value:a})}}}));return e}formatCollapsedData(t){var i=document.createElement("table");t.forEach((t=>{var e=document.createElement("tr");var s=document.createElement("td");var r=document.createElement("td");var a;var o=document.createElement("strong");s.appendChild(o);this.modules.localize.bind("columns|"+t.field,(function(i){o.innerHTML=i||t.title}));if(t.value instanceof Node){a=document.createElement("div");a.appendChild(t.value);r.appendChild(a)}else{r.innerHTML=t.value}e.appendChild(s);e.appendChild(r);i.appendChild(e)}));return Object.keys(t).length?i:""}}function Ki(t,i,e){var s=document.createElement("input");var r=false;s.type="checkbox";s.setAttribute("aria-label","Select Row");if(this.table.modExists("selectRow",true)){s.addEventListener("click",(t=>{t.stopPropagation()}));if(typeof t.getRow=="function"){var a=t.getRow();if(a instanceof X){s.addEventListener("change",(t=>{if(this.table.options.selectableRowsRangeMode==="click"){if(!r){a.toggleSelect()}else{r=false}}else{a.toggleSelect()}}));if(this.table.options.selectableRowsRangeMode==="click"){s.addEventListener("click",(t=>{r=true;this.table.modules.selectRow.handleComplexRowClick(a._row,t)}))}s.checked=a.isSelected&&a.isSelected();this.table.modules.selectRow.registerRowSelectCheckbox(a,s)}else{s=""}}else{s.addEventListener("change",(t=>{if(this.table.modules.selectRow.selectedRows.length){this.table.deselectRow()}else{this.table.selectRow(i.rowRange)}}));this.table.modules.selectRow.registerHeaderSelectCheckbox(s)}}return s}var Zi={format:{formatters:{rowSelection:Ki}}};class $i extends S{static moduleName="selectRow";static moduleExtensions=Zi;constructor(t){super(t);this.selecting=false;this.lastClickedRow=false;this.selectPrev=[];this.selectedRows=[];this.headerCheckboxElement=null;this.registerTableOption("selectableRows","highlight");this.registerTableOption("selectableRowsRangeMode","drag");this.registerTableOption("selectableRowsRollingSelection",true);this.registerTableOption("selectableRowsPersistence",true);this.registerTableOption("selectableRowsCheck",(function(t,i){return true}));this.registerTableFunction("selectRow",this.selectRows.bind(this));this.registerTableFunction("deselectRow",this.deselectRows.bind(this));this.registerTableFunction("toggleSelectRow",this.toggleRow.bind(this));this.registerTableFunction("getSelectedRows",this.getSelectedRows.bind(this));this.registerTableFunction("getSelectedData",this.getSelectedData.bind(this));this.registerComponentFunction("row","select",this.selectRows.bind(this));this.registerComponentFunction("row","deselect",this.deselectRows.bind(this));this.registerComponentFunction("row","toggleSelect",this.toggleRow.bind(this));this.registerComponentFunction("row","isSelected",this.isRowSelected.bind(this))}initialize(){this.deprecatedOptionsCheck();if(this.table.options.selectableRows==="highlight"&&this.table.options.selectableRange){this.table.options.selectableRows=false}if(this.table.options.selectableRows!==false){this.subscribe("row-init",this.initializeRow.bind(this));this.subscribe("row-deleting",this.rowDeleted.bind(this));this.subscribe("rows-wipe",this.clearSelectionData.bind(this));this.subscribe("rows-retrieve",this.rowRetrieve.bind(this));if(this.table.options.selectableRows&&!this.table.options.selectableRowsPersistence){this.subscribe("data-refreshing",this.deselectRows.bind(this))}}}deprecatedOptionsCheck(){}rowRetrieve(t,i){return t==="selected"?this.selectedRows:i}rowDeleted(t){this._deselectRow(t,true)}clearSelectionData(t){var i=this.selectedRows.length;this.selecting=false;this.lastClickedRow=false;this.selectPrev=[];this.selectedRows=[];if(i&&t!==true){this._rowSelectionChanged()}}initializeRow(t){var i=this,e=i.checkRowSelectability(t),s=t.getElement();var r=function(){setTimeout((function(){i.selecting=false}),50);document.body.removeEventListener("mouseup",r)};t.modules.select={selected:false};s.classList.toggle("tabulator-selectable",e);s.classList.toggle("tabulator-unselectable",!e);if(i.checkRowSelectability(t)){if(i.table.options.selectableRows&&i.table.options.selectableRows!="highlight"){if(i.table.options.selectableRowsRangeMode==="click"){s.addEventListener("click",this.handleComplexRowClick.bind(this,t))}else{s.addEventListener("click",(function(e){if(!i.table.modExists("edit")||!i.table.modules.edit.getCurrentCell()){i.table._clearSelection()}if(!i.selecting){i.toggleRow(t)}}));s.addEventListener("mousedown",(function(e){if(e.shiftKey){i.table._clearSelection();i.selecting=true;i.selectPrev=[];document.body.addEventListener("mouseup",r);document.body.addEventListener("keyup",r);i.toggleRow(t);return false}}));s.addEventListener("mouseenter",(function(e){if(i.selecting){i.table._clearSelection();i.toggleRow(t);if(i.selectPrev[1]==t){i.toggleRow(i.selectPrev[0])}}}));s.addEventListener("mouseout",(function(e){if(i.selecting){i.table._clearSelection();i.selectPrev.unshift(t)}}))}}}}handleComplexRowClick(t,i){if(i.shiftKey){this.table._clearSelection();this.lastClickedRow=this.lastClickedRow||t;var e=this.table.rowManager.getDisplayRowIndex(this.lastClickedRow);var s=this.table.rowManager.getDisplayRowIndex(t);var r=e<=s?e:s;var a=e>=s?e:s;var o=this.table.rowManager.getDisplayRows().slice(0);var h=o.splice(r,a-r+1);if(i.ctrlKey||i.metaKey){h.forEach((i=>{if(i!==this.lastClickedRow){if(this.table.options.selectableRows!==true&&!this.isRowSelected(t)){if(this.selectedRows.length<this.table.options.selectableRows){this.toggleRow(i)}}else{this.toggleRow(i)}}}));this.lastClickedRow=t}else{this.deselectRows(undefined,true);if(this.table.options.selectableRows!==true){if(h.length>this.table.options.selectableRows){h=h.slice(0,this.table.options.selectableRows)}}this.selectRows(h)}this.table._clearSelection()}else if(i.ctrlKey||i.metaKey){this.toggleRow(t);this.lastClickedRow=t}else{this.deselectRows(undefined,true);this.selectRows(t);this.lastClickedRow=t}}checkRowSelectability(t){if(t&&t.type==="row"){return this.table.options.selectableRowsCheck.call(this.table,t.getComponent())}return false}toggleRow(t){if(this.checkRowSelectability(t)){if(t.modules.select&&t.modules.select.selected){this._deselectRow(t)}else{this._selectRow(t)}}}selectRows(t){var i=[],e,s;switch(typeof t){case"undefined":e=this.table.rowManager.rows;break;case"number":e=this.table.rowManager.findRow(t);break;case"string":e=this.table.rowManager.findRow(t);if(!e){e=this.table.rowManager.getRows(t)}break;default:e=t;break}if(Array.isArray(e)){if(e.length){e.forEach((t=>{s=this._selectRow(t,true,true);if(s){i.push(s)}}));this._rowSelectionChanged(false,i)}}else{if(e){this._selectRow(e,false,true)}}}_selectRow(t,i,e){if(!isNaN(this.table.options.selectableRows)&&this.table.options.selectableRows!==true&&!e){if(this.selectedRows.length>=this.table.options.selectableRows){if(this.table.options.selectableRowsRollingSelection){this._deselectRow(this.selectedRows[0])}else{return false}}}var s=this.table.rowManager.findRow(t);if(s){if(this.selectedRows.indexOf(s)==-1){s.getElement().classList.add("tabulator-selected");if(!s.modules.select){s.modules.select={}}s.modules.select.selected=true;if(s.modules.select.checkboxEl){s.modules.select.checkboxEl.checked=true}this.selectedRows.push(s);if(this.table.options.dataTreeSelectPropagate){this.childRowSelection(s,true)}this.dispatchExternal("rowSelected",s.getComponent());this._rowSelectionChanged(i,s);return s}}else{if(!i){console.warn("Selection Error - No such row found, ignoring selection:"+t)}}}isRowSelected(t){return this.selectedRows.indexOf(t)!==-1}deselectRows(t,i){var e=[],s,r;switch(typeof t){case"undefined":s=Object.assign([],this.selectedRows);break;case"number":s=this.table.rowManager.findRow(t);break;case"string":s=this.table.rowManager.findRow(t);if(!s){s=this.table.rowManager.getRows(t)}break;default:s=t;break}if(Array.isArray(s)){if(s.length){s.forEach((t=>{r=this._deselectRow(t,true,true);if(r){e.push(r)}}));this._rowSelectionChanged(i,[],e)}}else{if(s){this._deselectRow(s,i,true)}}}_deselectRow(t,i){var e=this,s=e.table.rowManager.findRow(t),r,a;if(s){r=e.selectedRows.findIndex((function(t){return t==s}));if(r>-1){a=s.getElement();if(a){a.classList.remove("tabulator-selected")}if(!s.modules.select){s.modules.select={}}s.modules.select.selected=false;if(s.modules.select.checkboxEl){s.modules.select.checkboxEl.checked=false}e.selectedRows.splice(r,1);if(this.table.options.dataTreeSelectPropagate){this.childRowSelection(s,false)}this.dispatchExternal("rowDeselected",s.getComponent());e._rowSelectionChanged(i,undefined,s);return s}}else{if(!i){console.warn("Deselection Error - No such row found, ignoring selection:"+t)}}}getSelectedData(){var t=[];this.selectedRows.forEach((function(i){t.push(i.getData())}));return t}getSelectedRows(){var t=[];this.selectedRows.forEach((function(i){t.push(i.getComponent())}));return t}_rowSelectionChanged(t,i=[],e=[]){if(this.headerCheckboxElement){if(this.selectedRows.length===0){this.headerCheckboxElement.checked=false;this.headerCheckboxElement.indeterminate=false}else if(this.table.rowManager.rows.length===this.selectedRows.length){this.headerCheckboxElement.checked=true;this.headerCheckboxElement.indeterminate=false}else{this.headerCheckboxElement.indeterminate=true;this.headerCheckboxElement.checked=false}}if(!t){if(!Array.isArray(i)){i=[i]}i=i.map((t=>t.getComponent()));if(!Array.isArray(e)){e=[e]}e=e.map((t=>t.getComponent()));this.dispatchExternal("rowSelectionChanged",this.getSelectedData(),this.getSelectedRows(),i,e)}}registerRowSelectCheckbox(t,i){if(!t._row.modules.select){t._row.modules.select={}}t._row.modules.select.checkboxEl=i}registerHeaderSelectCheckbox(t){this.headerCheckboxElement=t}childRowSelection(t,i){var e=this.table.modules.dataTree.getChildren(t,true,true);if(i){for(let t of e){this._selectRow(t,true)}}else{for(let t of e){this._deselectRow(t,true)}}}}class Xi{constructor(t){this._range=t;return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._range.table.componentFunctionBinder.handle("range",t._range,i)}}})}getElement(){return this._range.element}getData(){return this._range.getData()}getCells(){return this._range.getCells(true,true)}getStructuredCells(){return this._range.getStructuredCells()}getRows(){return this._range.getRows().map((t=>t.getComponent()))}getColumns(){return this._range.getColumns().map((t=>t.getComponent()))}getBounds(){return this._range.getBounds()}getTopEdge(){return this._range.top}getBottomEdge(){return this._range.bottom}getLeftEdge(){return this._range.left}getRightEdge(){return this._range.right}setBounds(t,i){if(this._range.destroyedGuard("setBounds")){this._range.setBounds(t?t._cell:t,i?i._cell:i)}}setStartBound(t){if(this._range.destroyedGuard("setStartBound")){this._range.setEndBound(t?t._cell:t);this._range.rangeManager.layoutElement()}}setEndBound(t){if(this._range.destroyedGuard("setEndBound")){this._range.setEndBound(t?t._cell:t);this._range.rangeManager.layoutElement()}}clearValues(){if(this._range.destroyedGuard("clearValues")){this._range.clearValues()}}remove(){if(this._range.destroyedGuard("remove")){this._range.destroy(true)}}}class Yi extends E{constructor(t,i,e,s){super(t);this.rangeManager=i;this.element=null;this.initialized=false;this.initializing={start:false,end:false};this.destroyed=false;this.top=0;this.bottom=0;this.left=0;this.right=0;this.table=t;this.start={row:0,col:0};this.end={row:0,col:0};if(this.rangeManager.rowHeader){this.left=1;this.right=1;this.start.col=1;this.end.col=1}this.initElement();setTimeout((()=>{this.initBounds(e,s)}))}initElement(){this.element=document.createElement("div");this.element.classList.add("tabulator-range")}initBounds(t,i){this._updateMinMax();if(t){this.setBounds(t,i||t)}}setStart(t,i){if(this.start.row!==t||this.start.col!==i){this.start.row=t;this.start.col=i;this.initializing.start=true;this._updateMinMax()}}setEnd(t,i){if(this.end.row!==t||this.end.col!==i){this.end.row=t;this.end.col=i;this.initializing.end=true;this._updateMinMax()}}setBounds(t,i,e){if(t){this.setStartBound(t)}this.setEndBound(i||t);this.rangeManager.layoutElement(e)}setStartBound(t){var i,e;if(t.type==="column"){if(this.rangeManager.columnSelection){this.setStart(0,t.getPosition()-1)}}else{i=t.row.position-1;e=t.column.getPosition()-1;if(t.column===this.rangeManager.rowHeader){this.setStart(i,1)}else{this.setStart(i,e)}}}setEndBound(t){var i=this._getTableRows().length,e,s,r;if(t.type==="column"){if(this.rangeManager.columnSelection){if(this.rangeManager.selecting==="column"){this.setEnd(i-1,t.getPosition()-1)}else if(this.rangeManager.selecting==="cell"){this.setEnd(0,t.getPosition()-1)}}}else{e=t.row.position-1;s=t.column.getPosition()-1;r=t.column===this.rangeManager.rowHeader;if(this.rangeManager.selecting==="row"){this.setEnd(e,this._getTableColumns().length-1)}else if(this.rangeManager.selecting!=="row"&&r){this.setEnd(e,0)}else if(this.rangeManager.selecting==="column"){this.setEnd(i-1,s)}else{this.setEnd(e,s)}}}_updateMinMax(){this.top=Math.min(this.start.row,this.end.row);this.bottom=Math.max(this.start.row,this.end.row);this.left=Math.min(this.start.col,this.end.col);this.right=Math.max(this.start.col,this.end.col);if(this.initialized){this.dispatchExternal("rangeChanged",this.getComponent())}else{if(this.initializing.start&&this.initializing.end){this.initialized=true;this.dispatchExternal("rangeAdded",this.getComponent())}}}_getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}_getTableRows(){return this.table.rowManager.getDisplayRows().filter((t=>t.type==="row"))}layout(){var t=this.table.rowManager.renderer.vDomTop,i=this.table.rowManager.renderer.vDomBottom,e=this.table.columnManager.renderer.leftCol,s=this.table.columnManager.renderer.rightCol,r,a,o,h,l,n,u,f,c,d;if(this.table.options.renderHorizontal==="virtual"&&this.rangeManager.rowHeader){s+=1}if(t==null){t=0}if(i==null){i=Infinity}if(e==null){e=0}if(s==null){s=Infinity}if(this.overlaps(e,t,s,i)){r=Math.max(this.top,t);a=Math.min(this.bottom,i);o=Math.max(this.left,e);h=Math.min(this.right,s);l=this.rangeManager.getCell(r,o);n=this.rangeManager.getCell(a,h);u=l.getElement();f=n.getElement();c=l.row.getElement();d=n.row.getElement();this.element.classList.add("tabulator-range-active");if(this.table.rtl){this.element.style.right=c.offsetWidth-u.offsetLeft-u.offsetWidth+"px";this.element.style.width=u.offsetLeft+u.offsetWidth-f.offsetLeft+"px"}else{this.element.style.left=c.offsetLeft+u.offsetLeft+"px";this.element.style.width=f.offsetLeft+f.offsetWidth-u.offsetLeft+"px"}this.element.style.top=c.offsetTop+"px";this.element.style.height=d.offsetTop+d.offsetHeight-c.offsetTop+"px"}}atTopLeft(t){return t.row.position-1===this.top&&t.column.getPosition()-1===this.left}atBottomRight(t){return t.row.position-1===this.bottom&&t.column.getPosition()-1===this.right}occupies(t){return this.occupiesRow(t.row)&&this.occupiesColumn(t.column)}occupiesRow(t){return this.top<=t.position-1&&t.position-1<=this.bottom}occupiesColumn(t){return this.left<=t.getPosition()-1&&t.getPosition()-1<=this.right}overlaps(t,i,e,s){if(this.left>e||t>this.right||(this.top>s||i>this.bottom)){return false}return true}getData(){var t=[],i=this.getRows(),e=this.getColumns();i.forEach((i=>{var s=i.getData(),r={};e.forEach((t=>{r[t.field]=s[t.field]}));t.push(r)}));return t}getCells(t,i){var e=[],s=this.getRows(),r=this.getColumns();if(t){e=s.map((t=>{var e=[];t.getCells().forEach((t=>{if(r.includes(t.column)){e.push(i?t.getComponent():t)}}));return e}))}else{s.forEach((t=>{t.getCells().forEach((t=>{if(r.includes(t.column)){e.push(i?t.getComponent():t)}}))}))}return e}getStructuredCells(){return this.getCells(true,true)}getRows(){return this._getTableRows().slice(this.top,this.bottom+1)}getColumns(){return this._getTableColumns().slice(this.left,this.right+1)}clearValues(){var t=this.getCells();var i=this.table.options.selectableRangeClearCellsValue;this.table.blockRedraw();t.forEach((t=>{t.setValue(i)}));this.table.restoreRedraw()}getBounds(t){var i=this.getCells(false,t),e={start:null,end:null};if(i.length){e.start=i[0];e.end=i[i.length-1]}else{console.warn("No bounds defined on range")}return e}getComponent(){if(!this.component){this.component=new Xi(this)}return this.component}destroy(t){this.destroyed=true;this.element.remove();if(t){this.rangeManager.rangeRemoved(this)}if(this.initialized){this.dispatchExternal("rangeRemoved",this.getComponent())}}destroyedGuard(t){if(this.destroyed){console.warn("You cannot call the "+t+" function on a destroyed range")}return!this.destroyed}}var Qi={rangeJumpUp:["ctrl + 38","meta + 38"],rangeJumpDown:["ctrl + 40","meta + 40"],rangeJumpLeft:["ctrl + 37","meta + 37"],rangeJumpRight:["ctrl + 39","meta + 39"],rangeExpandUp:"shift + 38",rangeExpandDown:"shift + 40",rangeExpandLeft:"shift + 37",rangeExpandRight:"shift + 39",rangeExpandJumpUp:["ctrl + shift + 38","meta + shift + 38"],rangeExpandJumpDown:["ctrl + shift + 40","meta + shift + 40"],rangeExpandJumpLeft:["ctrl + shift + 37","meta + shift + 37"],rangeExpandJumpRight:["ctrl + shift + 39","meta + shift + 39"]};var te={rangeJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",true,false)},rangeJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",true,false)},rangeJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",true,false)},rangeJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",true,false)},rangeExpandLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",false,true)},rangeExpandRight:function(t){this.dispatch("keybinding-nav-range",t,"right",false,true)},rangeExpandUp:function(t){this.dispatch("keybinding-nav-range",t,"up",false,true)},rangeExpandDown:function(t){this.dispatch("keybinding-nav-range",t,"down",false,true)},rangeExpandJumpLeft:function(t){this.dispatch("keybinding-nav-range",t,"left",true,true)},rangeExpandJumpRight:function(t){this.dispatch("keybinding-nav-range",t,"right",true,true)},rangeExpandJumpUp:function(t){this.dispatch("keybinding-nav-range",t,"up",true,true)},rangeExpandJumpDown:function(t){this.dispatch("keybinding-nav-range",t,"down",true,true)}};var ie={range:function(t){var i=[],e=this.table.modules.selectRange.activeRange,s=false,r,a,o,h,l;l=t.length;if(e){r=e.getBounds();a=r.start;if(r.start===r.end){s=true}if(a){i=this.table.rowManager.activeRows.slice();o=i.indexOf(a.row);if(s){h=t.length}else{h=i.indexOf(r.end.row)-o+1}if(o>-1){this.table.blockRedraw();i=i.slice(o,o+h);i.forEach(((i,e)=>{i.updateData(t[e%l])}));this.table.restoreRedraw()}}}return i}};var ee={range:function(t){var i=[],e=[],s=this.table.modules.selectRange.activeRange,r=false,a,o,h,l,n;if(s){a=s.getBounds();o=a.start;if(a.start===a.end){r=true}if(o){t=t.split("\n");t.forEach((function(t){i.push(t.split("\t"))}));if(i.length){l=this.table.columnManager.getVisibleColumnsByIndex();n=l.indexOf(o.column);if(n>-1){if(r){h=i[0].length}else{h=l.indexOf(a.end.column)-n+1}l=l.slice(n,n+h);i.forEach((t=>{var i={};var s=t.length;l.forEach((function(e,r){i[e.field]=t[r%s]}));e.push(i)}));return e}}}}return false}};var se={range:function(){var t=this.modules.selectRange.selectedColumns();if(this.columnManager.rowHeader){t.unshift(this.columnManager.rowHeader)}return t}};var re={range:function(){return this.modules.selectRange.selectedRows()}};var ae={keybindings:{bindings:Qi,actions:te},clipboard:{pasteActions:ie,pasteParsers:ee},export:{columnLookups:se,rowLookups:re}};class oe extends S{static moduleName="selectRange";static moduleInitOrder=1;static moduleExtensions=ae;constructor(t){super(t);this.selecting="cell";this.mousedown=false;this.ranges=[];this.overlay=null;this.rowHeader=null;this.layoutChangeTimeout=null;this.columnSelection=false;this.rowSelection=false;this.maxRanges=0;this.activeRange=false;this.blockKeydown=false;this.keyDownEvent=this._handleKeyDown.bind(this);this.mouseUpEvent=this._handleMouseUp.bind(this);this.registerTableOption("selectableRange",false);this.registerTableOption("selectableRangeColumns",false);this.registerTableOption("selectableRangeRows",false);this.registerTableOption("selectableRangeClearCells",false);this.registerTableOption("selectableRangeClearCellsValue",undefined);this.registerTableOption("selectableRangeAutoFocus",true);this.registerTableFunction("getRangesData",this.getRangesData.bind(this));this.registerTableFunction("getRanges",this.getRanges.bind(this));this.registerTableFunction("addRange",this.addRangeFromComponent.bind(this));this.registerComponentFunction("cell","getRanges",this.cellGetRanges.bind(this));this.registerComponentFunction("row","getRanges",this.rowGetRanges.bind(this));this.registerComponentFunction("column","getRanges",this.colGetRanges.bind(this))}initialize(){if(this.options("selectableRange")){if(!this.options("selectableRows")){this.maxRanges=this.options("selectableRange");this.initializeTable();this.initializeWatchers()}else{console.warn("SelectRange functionality cannot be used in conjunction with row selection")}if(this.options("columns").findIndex((t=>t.frozen))>0){console.warn("Having frozen column in arbitrary position with selectRange option may result in unpredictable behavior.")}if(this.options("columns").filter((t=>t.frozen))>1){console.warn("Having multiple frozen columns with selectRange option may result in unpredictable behavior.")}}}initializeTable(){this.overlay=document.createElement("div");this.overlay.classList.add("tabulator-range-overlay");this.rangeContainer=document.createElement("div");this.rangeContainer.classList.add("tabulator-range-container");this.activeRangeCellElement=document.createElement("div");this.activeRangeCellElement.classList.add("tabulator-range-cell-active");this.overlay.appendChild(this.rangeContainer);this.overlay.appendChild(this.activeRangeCellElement);this.table.rowManager.element.addEventListener("keydown",this.keyDownEvent);this.resetRanges();this.table.rowManager.element.appendChild(this.overlay);this.table.columnManager.element.setAttribute("tabindex",0);this.table.element.classList.add("tabulator-ranges")}initializeWatchers(){this.columnSelection=this.options("selectableRangeColumns");this.rowSelection=this.options("selectableRangeRows");this.subscribe("column-init",this.initializeColumn.bind(this));this.subscribe("column-mousedown",this.handleColumnMouseDown.bind(this));this.subscribe("column-mousemove",this.handleColumnMouseMove.bind(this));this.subscribe("column-resized",this.handleColumnResized.bind(this));this.subscribe("column-moving",this.handleColumnMoving.bind(this));this.subscribe("column-moved",this.handleColumnMoved.bind(this));this.subscribe("column-width",this.layoutChange.bind(this));this.subscribe("column-height",this.layoutChange.bind(this));this.subscribe("column-resized",this.layoutChange.bind(this));this.subscribe("columns-loaded",this.updateHeaderColumn.bind(this));this.subscribe("cell-height",this.layoutChange.bind(this));this.subscribe("cell-rendered",this.renderCell.bind(this));this.subscribe("cell-mousedown",this.handleCellMouseDown.bind(this));this.subscribe("cell-mousemove",this.handleCellMouseMove.bind(this));this.subscribe("cell-click",this.handleCellClick.bind(this));this.subscribe("cell-editing",this.handleEditingCell.bind(this));this.subscribe("page-changed",this.redraw.bind(this));this.subscribe("scroll-vertical",this.layoutChange.bind(this));this.subscribe("scroll-horizontal",this.layoutChange.bind(this));this.subscribe("data-destroy",this.tableDestroyed.bind(this));this.subscribe("data-processed",this.resetRanges.bind(this));this.subscribe("table-layout",this.layoutElement.bind(this));this.subscribe("table-redraw",this.redraw.bind(this));this.subscribe("table-destroy",this.tableDestroyed.bind(this));this.subscribe("edit-editor-clear",this.finishEditingCell.bind(this));this.subscribe("edit-blur",this.restoreFocus.bind(this));this.subscribe("keybinding-nav-prev",this.keyNavigate.bind(this,"left"));this.subscribe("keybinding-nav-next",this.keyNavigate.bind(this,"right"));this.subscribe("keybinding-nav-left",this.keyNavigate.bind(this,"left"));this.subscribe("keybinding-nav-right",this.keyNavigate.bind(this,"right"));this.subscribe("keybinding-nav-up",this.keyNavigate.bind(this,"up"));this.subscribe("keybinding-nav-down",this.keyNavigate.bind(this,"down"));this.subscribe("keybinding-nav-range",this.keyNavigateRange.bind(this))}initializeColumn(t){if(this.columnSelection&&t.definition.headerSort&&this.options("headerSortClickElement")!=="icon"){console.warn("Using column headerSort with selectableRangeColumns option may result in unpredictable behavior. Consider using headerSortClickElement: 'icon'.")}}updateHeaderColumn(){var t;if(this.rowSelection){this.rowHeader=this.table.columnManager.getVisibleColumnsByIndex()[0];if(this.rowHeader){this.rowHeader.definition.cssClass=this.rowHeader.definition.cssClass+" tabulator-range-row-header";if(this.rowHeader.definition.headerSort){console.warn("Using column headerSort with selectableRangeRows option may result in unpredictable behavior")}if(this.rowHeader.definition.editor){console.warn("Using column editor with selectableRangeRows option may result in unpredictable behavior")}}}if(this.table.modules.frozenColumns&&this.table.modules.frozenColumns.active){t=this.table.modules.frozenColumns.getFrozenColumns();if(t.length>1||t.length===1&&t[0]!==this.rowHeader){console.warn("Using frozen columns that are not the range header in combination with the selectRange option may result in unpredictable behavior")}}}getRanges(){return this.ranges.map((t=>t.getComponent()))}getRangesData(){return this.ranges.map((t=>t.getData()))}addRangeFromComponent(t,i){t=t?t._cell:null;i=i?i._cell:null;return this.addRange(t,i)}cellGetRanges(t){var i=[];if(t.column===this.rowHeader){i=this.ranges.filter((i=>i.occupiesRow(t.row)))}else{i=this.ranges.filter((i=>i.occupies(t)))}return i.map((t=>t.getComponent()))}rowGetRanges(t){var i=this.ranges.filter((i=>i.occupiesRow(t)));return i.map((t=>t.getComponent()))}colGetRanges(t){var i=this.ranges.filter((i=>i.occupiesColumn(t)));return i.map((t=>t.getComponent()))}_handleMouseUp(t){this.mousedown=false;document.removeEventListener("mouseup",this.mouseUpEvent)}_handleKeyDown(t){if(!this.blockKeydown&&(!this.table.modules.edit||this.table.modules.edit&&!this.table.modules.edit.currentCell)){if(t.key==="Enter"){if(this.table.modules.edit&&this.table.modules.edit.currentCell){return}this.table.modules.edit.editCell(this.getActiveCell());t.preventDefault()}if((t.key==="Backspace"||t.key==="Delete")&&this.options("selectableRangeClearCells")){if(this.activeRange){this.activeRange.clearValues()}}}}initializeFocus(t){var i;this.restoreFocus();try{if(document.selection){i=document.body.createTextRange();i.moveToElementText(t.getElement());i.select()}else if(window.getSelection){i=document.createRange();i.selectNode(t.getElement());window.getSelection().removeAllRanges();window.getSelection().addRange(i)}}catch(t){}}restoreFocus(t){this.table.rowManager.element.focus();return true}handleColumnResized(t){var i;if(this.selecting!=="column"&&this.selecting!=="all"){return}i=this.ranges.some((i=>i.occupiesColumn(t)));if(!i){return}this.ranges.forEach((i=>{var e=i.getColumns(true);e.forEach((i=>{if(i!==t){i.setWidth(t.width)}}))}))}handleColumnMoving(t,i){this.resetRanges().setBounds(i);this.overlay.style.visibility="hidden"}handleColumnMoved(t,i,e){this.activeRange.setBounds(t);this.layoutElement()}handleColumnMouseDown(t,i){if(t.button===2&&(this.selecting==="column"||this.selecting==="all")&&this.activeRange.occupiesColumn(i)){return}if(this.table.options.movableColumns&&this.selecting==="column"&&this.activeRange.occupiesColumn(i)){return}this.mousedown=true;document.addEventListener("mouseup",this.mouseUpEvent);this.newSelection(t,i)}handleColumnMouseMove(t,i){if(i===this.rowHeader||!this.mousedown||this.selecting==="all"){return}this.activeRange.setBounds(false,i,true)}renderCell(t){var i=t.getElement(),e=this.ranges.findIndex((i=>i.occupies(t)));i.classList.toggle("tabulator-range-selected",e!==-1);i.classList.toggle("tabulator-range-only-cell-selected",this.ranges.length===1&&this.ranges[0].atTopLeft(t)&&this.ranges[0].atBottomRight(t));i.dataset.range=e}handleCellMouseDown(t,i){if(t.button===2&&(this.activeRange.occupies(i)||(this.selecting==="row"||this.selecting==="all")&&this.activeRange.occupiesRow(i.row))){return}this.mousedown=true;document.addEventListener("mouseup",this.mouseUpEvent);this.newSelection(t,i)}handleCellMouseMove(t,i){if(!this.mousedown||this.selecting==="all"){return}this.activeRange.setBounds(false,i,true)}handleCellClick(t,i){this.initializeFocus(i)}handleEditingCell(t){if(this.activeRange){this.activeRange.setBounds(t)}}finishEditingCell(){this.blockKeydown=true;this.table.rowManager.element.focus();setTimeout((()=>{this.blockKeydown=false}),10)}keyNavigate(t,i){if(this.navigate(false,false,t));i.preventDefault()}keyNavigateRange(t,i,e,s){if(this.navigate(e,s,i));t.preventDefault()}navigate(t,i,e){var s=false,r,a,o,h,l,n,u,f,c,d,b;if(this.table.modules.edit&&this.table.modules.edit.currentCell){return false}if(this.ranges.length>1){this.ranges=this.ranges.filter((t=>{if(t===this.activeRange){t.setEnd(t.start.row,t.start.col);return true}t.destroy();return false}))}r=this.activeRange;o={top:r.top,bottom:r.bottom,left:r.left,right:r.right};a=i?r.end:r.start;h=a.row;l=a.col;if(t){switch(e){case"left":l=this.findJumpCellLeft(r.start.row,a.col);break;case"right":l=this.findJumpCellRight(r.start.row,a.col);break;case"up":h=this.findJumpCellUp(a.row,r.start.col);break;case"down":h=this.findJumpCellDown(a.row,r.start.col);break}}else{if(i){if(this.selecting==="row"&&(e==="left"||e==="right")||this.selecting==="column"&&(e==="up"||e==="down")){return}}switch(e){case"left":l=Math.max(l-1,0);break;case"right":l=Math.min(l+1,this.getTableColumns().length-1);break;case"up":h=Math.max(h-1,0);break;case"down":h=Math.min(h+1,this.getTableRows().length-1);break}}if(this.rowHeader&&l===0){l=1}if(!i){r.setStart(h,l)}r.setEnd(h,l);if(!i){this.selecting="cell"}s=o.top!==r.top||o.bottom!==r.bottom||o.left!==r.left||o.right!==r.right;if(s){n=this.getRowByRangePos(r.end.row);u=this.getColumnByRangePos(r.end.col);f=n.getElement().getBoundingClientRect();d=u.getElement().getBoundingClientRect();c=this.table.rowManager.getElement().getBoundingClientRect();b=this.table.columnManager.getElement().getBoundingClientRect();if(!(f.top>=c.top&&f.bottom<=c.bottom)){if(n.getElement().parentNode&&u.getElement().parentNode){this.autoScroll(r,n.getElement(),u.getElement())}else{n.getComponent().scrollTo(undefined,false)}}if(!(d.left>=b.left+this.getRowHeaderWidth()&&d.right<=b.right)){if(n.getElement().parentNode&&u.getElement().parentNode){this.autoScroll(r,n.getElement(),u.getElement())}else{u.getComponent().scrollTo(undefined,false)}}this.layoutElement();return true}}rangeRemoved(t){this.ranges=this.ranges.filter((i=>i!==t));if(this.activeRange===t){if(this.ranges.length){this.activeRange=this.ranges[this.ranges.length-1]}else{this.addRange()}}this.layoutElement()}findJumpRow(t,i,e,s,r){if(e){i=i.reverse()}return this.findJumpItem(s,r,i,(function(i){return i.getData()[t.getField()]}))}findJumpCol(t,i,e,s,r){if(e){i=i.reverse()}return this.findJumpItem(s,r,i,(function(i){return t.getData()[i.getField()]}))}findJumpItem(t,i,e,s){var r;for(let a of e){let e=s(a);if(t){r=a;if(e){break}}else{if(i){r=a;if(e){break}}else{if(e){r=a}else{break}}}}return r}findJumpCellLeft(t,i){var e=this.getRowByRangePos(t),s=this.getTableColumns(),r=this.isEmpty(e.getData()[s[i].getField()]),a=s[i-1]?this.isEmpty(e.getData()[s[i-1].getField()]):false,o=this.rowHeader?s.slice(1,i):s.slice(0,i),h=this.findJumpCol(e,o,true,r,a);if(h){return h.getPosition()-1}return i}findJumpCellRight(t,i){var e=this.getRowByRangePos(t),s=this.getTableColumns(),r=this.isEmpty(e.getData()[s[i].getField()]),a=s[i+1]?this.isEmpty(e.getData()[s[i+1].getField()]):false,o=this.findJumpCol(e,s.slice(i+1,s.length),false,r,a);if(o){return o.getPosition()-1}return i}findJumpCellUp(t,i){var e=this.getColumnByRangePos(i),s=this.getTableRows(),r=this.isEmpty(s[t].getData()[e.getField()]),a=s[t-1]?this.isEmpty(s[t-1].getData()[e.getField()]):false,o=this.findJumpRow(e,s.slice(0,t),true,r,a);if(o){return o.position-1}return t}findJumpCellDown(t,i){var e=this.getColumnByRangePos(i),s=this.getTableRows(),r=this.isEmpty(s[t].getData()[e.getField()]),a=s[t+1]?this.isEmpty(s[t+1].getData()[e.getField()]):false,o=this.findJumpRow(e,s.slice(t+1,s.length),false,r,a);if(o){return o.position-1}return t}newSelection(t,i){var e;if(i.type==="column"){if(!this.columnSelection){return}if(i===this.rowHeader){e=this.resetRanges();this.selecting="all";var s,r=this.getCell(-1,-1);if(this.rowHeader){s=this.getCell(0,1)}else{s=this.getCell(0,0)}e.setBounds(s,r);return}else{this.selecting="column"}}else if(i.column===this.rowHeader){this.selecting="row"}else{this.selecting="cell"}if(t.shiftKey){this.activeRange.setBounds(false,i)}else if(t.ctrlKey){this.addRange().setBounds(i)}else{this.resetRanges().setBounds(i)}}autoScroll(t,i,e){var s=this.table.rowManager.element,r,a,o,h;if(typeof i==="undefined"){i=this.getRowByRangePos(t.end.row).getElement()}if(typeof e==="undefined"){e=this.getColumnByRangePos(t.end.col).getElement()}r={left:e.offsetLeft,right:e.offsetLeft+e.offsetWidth,top:i.offsetTop,bottom:i.offsetTop+i.offsetHeight};a={left:s.scrollLeft+this.getRowHeaderWidth(),right:Math.ceil(s.scrollLeft+s.clientWidth),top:s.scrollTop,bottom:s.scrollTop+s.offsetHeight-this.table.rowManager.scrollbarWidth};o=a.left<r.left&&r.left<a.right&&a.left<r.right&&r.right<a.right;h=a.top<r.top&&r.top<a.bottom&&a.top<r.bottom&&r.bottom<a.bottom;if(!o){if(r.left<a.left){s.scrollLeft=r.left-this.getRowHeaderWidth()}else if(r.right>a.right){s.scrollLeft=Math.min(r.right-s.clientWidth,r.left-this.getRowHeaderWidth())}}if(!h){if(r.top<a.top){s.scrollTop=r.top}else if(r.bottom>a.bottom){s.scrollTop=r.bottom-s.clientHeight}}}layoutChange(){this.overlay.style.visibility="hidden";clearTimeout(this.layoutChangeTimeout);this.layoutChangeTimeout=setTimeout(this.layoutRanges.bind(this),200)}redraw(t){if(t){this.selecting="cell";this.resetRanges();this.layoutElement()}}layoutElement(t){var i;if(t){i=this.table.rowManager.getVisibleRows(true)}else{i=this.table.rowManager.getRows()}i.forEach((t=>{if(t.type==="row"){this.layoutRow(t);t.cells.forEach((t=>this.renderCell(t)))}}));this.getTableColumns().forEach((t=>{this.layoutColumn(t)}));this.layoutRanges()}layoutRow(t){var i=t.getElement(),e=false,s=this.ranges.some((i=>i.occupiesRow(t)));if(this.selecting==="row"){e=s}else if(this.selecting==="all"){e=true}i.classList.toggle("tabulator-range-selected",e);i.classList.toggle("tabulator-range-highlight",s)}layoutColumn(t){var i=t.getElement(),e=false,s=this.ranges.some((i=>i.occupiesColumn(t)));if(this.selecting==="column"){e=s}else if(this.selecting==="all"){e=true}i.classList.toggle("tabulator-range-selected",e);i.classList.toggle("tabulator-range-highlight",s)}layoutRanges(){var t,i,e;if(!this.table.initialized){return}t=this.getActiveCell();if(!t){return}i=t.getElement();e=t.row.getElement();if(this.table.rtl){this.activeRangeCellElement.style.right=e.offsetWidth-i.offsetLeft-i.offsetWidth+"px"}else{this.activeRangeCellElement.style.left=e.offsetLeft+i.offsetLeft+"px"}this.activeRangeCellElement.style.top=e.offsetTop+"px";this.activeRangeCellElement.style.width=i.offsetWidth+"px";this.activeRangeCellElement.style.height=e.offsetHeight+"px";this.ranges.forEach((t=>t.layout()));this.overlay.style.visibility="visible"}getCell(t,i){var e;if(i<0){i=this.getTableColumns().length+i;if(i<0){return null}}if(t<0){t=this.getTableRows().length+t}e=this.table.rowManager.getRowFromPosition(t+1);return e?e.getCells(false,true).filter((t=>t.column.visible))[i]:null}getActiveCell(){return this.getCell(this.activeRange.start.row,this.activeRange.start.col)}getRowByRangePos(t){return this.getTableRows()[t]}getColumnByRangePos(t){return this.getTableColumns()[t]}getTableRows(){return this.table.rowManager.getDisplayRows().filter((t=>t.type==="row"))}getTableColumns(){return this.table.columnManager.getVisibleColumnsByIndex()}addRange(t,i){var e;if(this.maxRanges!==true&&this.ranges.length>=this.maxRanges){this.ranges.shift().destroy()}e=new Yi(this.table,this,t,i);this.activeRange=e;this.ranges.push(e);this.rangeContainer.appendChild(e.element);return e}resetRanges(){var t,i,e;this.ranges.forEach((t=>t.destroy()));this.ranges=[];t=this.addRange();if(this.table.rowManager.activeRows.length){e=this.table.rowManager.activeRows[0].cells.filter((t=>t.column.visible));i=e[this.rowHeader?1:0];if(i){t.setBounds(i);if(this.options("selectableRangeAutoFocus")){this.initializeFocus(i)}}}return t}tableDestroyed(){document.removeEventListener("mouseup",this.mouseUpEvent);this.table.rowManager.element.removeEventListener("keydown",this.keyDownEvent)}selectedRows(t){return t?this.activeRange.getRows().map((t=>t.getComponent())):this.activeRange.getRows()}selectedColumns(t){return t?this.activeRange.getColumns().map((t=>t.getComponent())):this.activeRange.getColumns()}getRowHeaderWidth(){if(!this.rowHeader){return 0}return this.rowHeader.getElement().offsetWidth}isEmpty(t){return t===null||t===undefined||t===""}}function he(t,i,e,s,r,a,o){var h=o.alignEmptyValues;var l=o.decimalSeparator;var n=o.thousandSeparator;var u=0;t=String(t);i=String(i);if(n){t=t.split(n).join("");i=i.split(n).join("")}if(l){t=t.split(l).join(".");i=i.split(l).join(".")}t=parseFloat(t);i=parseFloat(i);if(isNaN(t)){u=isNaN(i)?0:-1}else if(isNaN(i)){u=1}else{return t-i}if(h==="top"&&a==="desc"||h==="bottom"&&a==="asc"){u*=-1}return u}function le(t,i,e,s,r,a,o){var h=o.alignEmptyValues;var l=0;var n;if(!t){l=!i?0:-1}else if(!i){l=1}else{switch(typeof o.locale){case"boolean":if(o.locale){n=this.langLocale()}break;case"string":n=o.locale;break}return String(t).toLowerCase().localeCompare(String(i).toLowerCase(),n)}if(h==="top"&&a==="desc"||h==="bottom"&&a==="asc"){l*=-1}return l}function ne(t,i,e,s,r,a,o){var h=this.table.dependencyRegistry.lookup(["luxon","DateTime"],"DateTime");var l=o.format||"dd/MM/yyyy HH:mm:ss",n=o.alignEmptyValues,u=0;if(typeof h!="undefined"){if(!h.isDateTime(t)){if(l==="iso"){t=h.fromISO(String(t))}else{t=h.fromFormat(String(t),l)}}if(!h.isDateTime(i)){if(l==="iso"){i=h.fromISO(String(i))}else{i=h.fromFormat(String(i),l)}}if(!t.isValid){u=!i.isValid?0:-1}else if(!i.isValid){u=1}else{return t-i}if(n==="top"&&a==="desc"||n==="bottom"&&a==="asc"){u*=-1}return u}else{console.error("Sort Error - 'datetime' sorter is dependant on luxon.js")}}function ue(t,i,e,s,r,a,o){if(!o.format){o.format="dd/MM/yyyy"}return ne.call(this,t,i,e,s,r,a,o)}function fe(t,i,e,s,r,a,o){if(!o.format){o.format="HH:mm"}return ne.call(this,t,i,e,s,r,a,o)}function ce(t,i,e,s,r,a,o){var h=t===true||t==="true"||t==="True"||t===1?1:0;var l=i===true||i==="true"||i==="True"||i===1?1:0;return h-l}function de(t,i,e,s,r,a,o){var h=o.type||"length",l=o.alignEmptyValues,n=0,u=this.table,f;if(o.valueMap){if(typeof o.valueMap==="string"){f=function(t){return t.map((t=>z.retrieveNestedData(u.options.nestedFieldSeparator,o.valueMap,t)))}}else{f=o.valueMap}}function c(t){var i;if(f){t=f(t)}switch(h){case"length":i=t.length;break;case"sum":i=t.reduce((function(t,i){return t+i}));break;case"max":i=Math.max.apply(null,t);break;case"min":i=Math.min.apply(null,t);break;case"avg":i=t.reduce((function(t,i){return t+i}))/t.length;break;case"string":i=t.join("");break}return i}if(!Array.isArray(t)){n=!Array.isArray(i)?0:-1}else if(!Array.isArray(i)){n=1}else{if(h==="string"){return String(c(t)).toLowerCase().localeCompare(String(c(i)).toLowerCase())}else{return c(i)-c(t)}}if(l==="top"&&a==="desc"||l==="bottom"&&a==="asc"){n*=-1}return n}function be(t,i,e,s,r,a,o){var h=typeof t=="undefined"?0:1;var l=typeof i=="undefined"?0:1;return h-l}function pe(t,i,e,s,r,a,o){var h,l,n,u,f=0,c,d=/(\d+)|(\D+)/g,b=/\d/;var p=o.alignEmptyValues;var m=0;if(!t&&t!==0){m=!i&&i!==0?0:-1}else if(!i&&i!==0){m=1}else{if(isFinite(t)&&isFinite(i))return t-i;h=String(t).toLowerCase();l=String(i).toLowerCase();if(h===l)return 0;if(!(b.test(h)&&b.test(l)))return h>l?1:-1;h=h.match(d);l=l.match(d);c=h.length>l.length?l.length:h.length;while(f<c){n=h[f];u=l[f++];if(n!==u){if(isFinite(n)&&isFinite(u)){if(n.charAt(0)==="0")n="."+n;if(u.charAt(0)==="0")u="."+u;return n-u}else return n>u?1:-1}}return h.length>l.length}if(p==="top"&&a==="desc"||p==="bottom"&&a==="asc"){m*=-1}return m}var me={number:he,string:le,date:ue,time:fe,datetime:ne,boolean:ce,array:de,exists:be,alphanum:pe};class ge extends S{static moduleName="sort";static sorters=me;constructor(t){super(t);this.sortList=[];this.changed=false;this.registerTableOption("sortMode","local");this.registerTableOption("initialSort",false);this.registerTableOption("columnHeaderSortMulti",true);this.registerTableOption("sortOrderReverse",false);this.registerTableOption("headerSortElement","<div class='tabulator-arrow'></div>");this.registerTableOption("headerSortClickElement","header");this.registerColumnOption("sorter");this.registerColumnOption("sorterParams");this.registerColumnOption("headerSort",true);this.registerColumnOption("headerSortStartingDir");this.registerColumnOption("headerSortTristate")}initialize(){this.subscribe("column-layout",this.initializeColumn.bind(this));this.subscribe("table-built",this.tableBuilt.bind(this));this.registerDataHandler(this.sort.bind(this),20);this.registerTableFunction("setSort",this.userSetSort.bind(this));this.registerTableFunction("getSorters",this.getSort.bind(this));this.registerTableFunction("clearSort",this.clearSort.bind(this));if(this.table.options.sortMode==="remote"){this.subscribe("data-params",this.remoteSortParams.bind(this))}}tableBuilt(){if(this.table.options.initialSort){this.setSort(this.table.options.initialSort)}}remoteSortParams(t,i,e,s){var r=this.getSort();r.forEach((t=>{delete t.column}));s.sort=r;return s}userSetSort(t,i){this.setSort(t,i);this.refreshSort()}clearSort(){this.clear();this.refreshSort()}initializeColumn(t){var i=false,e,s;switch(typeof t.definition.sorter){case"string":if(ge.sorters[t.definition.sorter]){i=ge.sorters[t.definition.sorter]}else{console.warn("Sort Error - No such sorter found: ",t.definition.sorter)}break;case"function":i=t.definition.sorter;break}t.modules.sort={sorter:i,dir:"none",params:t.definition.sorterParams||{},startingDir:t.definition.headerSortStartingDir||"asc",tristate:t.definition.headerSortTristate};if(t.definition.headerSort!==false){e=t.getElement();e.classList.add("tabulator-sortable");s=document.createElement("div");s.classList.add("tabulator-col-sorter");switch(this.table.options.headerSortClickElement){case"icon":s.classList.add("tabulator-col-sorter-element");break;case"header":e.classList.add("tabulator-col-sorter-element");break;default:e.classList.add("tabulator-col-sorter-element");break}switch(this.table.options.headerSortElement){case"function":break;case"object":s.appendChild(this.table.options.headerSortElement);break;default:s.innerHTML=this.table.options.headerSortElement}t.titleHolderElement.appendChild(s);t.modules.sort.element=s;this.setColumnHeaderSortIcon(t,"none");if(this.table.options.headerSortClickElement==="icon"){s.addEventListener("mousedown",(t=>{t.stopPropagation()}))}(this.table.options.headerSortClickElement==="icon"?s:e).addEventListener("click",(i=>{var e="",s=[],r=false;if(t.modules.sort){if(t.modules.sort.tristate){if(t.modules.sort.dir=="none"){e=t.modules.sort.startingDir}else{if(t.modules.sort.dir==t.modules.sort.startingDir){e=t.modules.sort.dir=="asc"?"desc":"asc"}else{e="none"}}}else{switch(t.modules.sort.dir){case"asc":e="desc";break;case"desc":e="asc";break;default:e=t.modules.sort.startingDir}}if(this.table.options.columnHeaderSortMulti&&(i.shiftKey||i.ctrlKey)){s=this.getSort();r=s.findIndex((i=>i.field===t.getField()));if(r>-1){s[r].dir=e;r=s.splice(r,1)[0];if(e!="none"){s.push(r)}}else{if(e!="none"){s.push({column:t,dir:e})}}this.setSort(s)}else{if(e=="none"){this.clear()}else{this.setSort(t,e)}}this.refreshSort()}}))}}refreshSort(){if(this.table.options.sortMode==="remote"){this.reloadData(null,false,false)}else{this.refreshData(true)}}hasChanged(){var t=this.changed;this.changed=false;return t}getSort(){var t=this,i=[];t.sortList.forEach((function(t){if(t.column){i.push({column:t.column.getComponent(),field:t.column.getField(),dir:t.dir})}}));return i}setSort(t,i){var e=this,s=[];if(!Array.isArray(t)){t=[{column:t,dir:i}]}t.forEach((function(t){var i;i=e.table.columnManager.findColumn(t.column);if(i){t.column=i;s.push(t);e.changed=true}else{console.warn("Sort Warning - Sort field does not exist and is being ignored: ",t.column)}}));e.sortList=s;this.dispatch("sort-changed")}clear(){this.setSort([])}findSorter(t){var i=this.table.rowManager.activeRows[0],e="string",s,r;if(i){i=i.getData();s=t.getField();if(s){r=t.getFieldValue(i);switch(typeof r){case"undefined":e="string";break;case"boolean":e="boolean";break;default:if(!isNaN(r)&&r!==""){e="number"}else{if(r.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){e="alphanum"}}break}}}return ge.sorters[e]}sort(t,i){var e=this,s=this.table.options.sortOrderReverse?e.sortList.slice().reverse():e.sortList,r=[],a=[];if(this.subscribedExternal("dataSorting")){this.dispatchExternal("dataSorting",e.getSort())}if(!i){e.clearColumnHeaders()}if(this.table.options.sortMode!=="remote"){s.forEach((function(t,s){var a;if(t.column){a=t.column.modules.sort;if(a){if(!a.sorter){a.sorter=e.findSorter(t.column)}t.params=typeof a.params==="function"?a.params(t.column.getComponent(),t.dir):a.params;r.push(t)}if(!i){e.setColumnHeader(t.column,t.dir)}}}));if(r.length){e._sortItems(t,r)}}else if(!i){s.forEach((function(t,i){e.setColumnHeader(t.column,t.dir)}))}if(this.subscribedExternal("dataSorted")){t.forEach((t=>{a.push(t.getComponent())}));this.dispatchExternal("dataSorted",e.getSort(),a)}return t}clearColumnHeaders(){this.table.columnManager.getRealColumns().forEach((t=>{if(t.modules.sort){t.modules.sort.dir="none";t.getElement().setAttribute("aria-sort","none");this.setColumnHeaderSortIcon(t,"none")}}))}setColumnHeader(t,i){t.modules.sort.dir=i;t.getElement().setAttribute("aria-sort",i==="asc"?"ascending":"descending");this.setColumnHeaderSortIcon(t,i)}setColumnHeaderSortIcon(t,i){var e=t.modules.sort.element,s;if(t.definition.headerSort&&typeof this.table.options.headerSortElement==="function"){while(e.firstChild)e.removeChild(e.firstChild);s=this.table.options.headerSortElement.call(this.table,t.getComponent(),i);if(typeof s==="object"){e.appendChild(s)}else{e.innerHTML=s}}}_sortItems(t,i){var e=i.length-1;t.sort(((t,s)=>{var r;for(var a=e;a>=0;a--){let e=i[a];r=this._sortRow(t,s,e.column,e.dir,e.params);if(r!==0){break}}return r}))}_sortRow(t,i,e,s,r){var a,o;var h=s=="asc"?t:i;var l=s=="asc"?i:t;t=e.getFieldValue(h.getData());i=e.getFieldValue(l.getData());t=typeof t!=="undefined"?t:"";i=typeof i!=="undefined"?i:"";a=h.getComponent();o=l.getComponent();return e.modules.sort.sorter.call(this,t,i,a,o,e.getComponent(),s,r)}}class ve{constructor(t,i){this.columnCount=t;this.rowCount=i;this.columnString=[];this.columns=[];this.rows=[]}genColumns(t){var i=Math.max(this.columnCount,Math.max(...t.map((t=>t.length))));this.columnString=[];this.columns=[];for(let t=1;t<=i;t++){this.incrementChar(this.columnString.length-1);this.columns.push(this.columnString.join(""))}return this.columns}genRows(t){var i=Math.max(this.rowCount,t.length);this.rows=[];for(let t=1;t<=i;t++){this.rows.push(t)}return this.rows}incrementChar(t){let i=this.columnString[t];if(i){if(i!=="Z"){this.columnString[t]=String.fromCharCode(this.columnString[t].charCodeAt(0)+1)}else{this.columnString[t]="A";if(t){this.incrementChar(t-1)}else{this.columnString.push("A")}}}else{this.columnString.push("A")}}setRowCount(t){this.rowCount=t}setColumnCount(t){this.columnCount=t}}class we{constructor(t){this._sheet=t;return new Proxy(this,{get:function(t,i,e){if(typeof t[i]!=="undefined"){return t[i]}else{return t._sheet.table.componentFunctionBinder.handle("sheet",t._sheet,i)}}})}getTitle(){return this._sheet.title}getKey(){return this._sheet.key}getDefinition(){return this._sheet.getDefinition()}getData(){return this._sheet.getData()}setData(t){return this._sheet.setData(t)}clear(){return this._sheet.clear()}remove(){return this._sheet.remove()}active(){return this._sheet.active()}setTitle(t){return this._sheet.setTitle(t)}setRows(t){return this._sheet.setRows(t)}setColumns(t){return this._sheet.setColumns(t)}}class ye extends E{constructor(t,i){super(t.table);this.spreadsheetManager=t;this.definition=i;this.title=this.definition.title||"";this.key=this.definition.key||this.definition.title;this.rowCount=this.definition.rows;this.columnCount=this.definition.columns;this.data=this.definition.data||[];this.element=null;this.isActive=false;this.grid=new ve(this.columnCount,this.rowCount);this.defaultColumnDefinition={width:100,headerHozAlign:"center",headerSort:false};this.columnDefinition=Object.assign(this.defaultColumnDefinition,this.options("spreadsheetColumnDefinition"));this.columnDefs=[];this.rowDefs=[];this.columnFields=[];this.columns=[];this.rows=[];this.scrollTop=null;this.scrollLeft=null;this.initialize();this.dispatchExternal("sheetAdded",this.getComponent())}initialize(){this.initializeElement();this.initializeColumns();this.initializeRows()}reinitialize(){this.initializeColumns();this.initializeRows()}initializeElement(){this.element=document.createElement("div");this.element.classList.add("tabulator-spreadsheet-tab");this.element.innerText=this.title;this.element.addEventListener("click",(()=>{this.spreadsheetManager.loadSheet(this)}))}initializeColumns(){this.grid.setColumnCount(this.columnCount);this.columnFields=this.grid.genColumns(this.data);this.columnDefs=[];this.columnFields.forEach((t=>{var i=Object.assign({},this.columnDefinition);i.field=t;i.title=t;this.columnDefs.push(i)}))}initializeRows(){var t;this.grid.setRowCount(this.rowCount);t=this.grid.genRows(this.data);this.rowDefs=[];t.forEach(((t,i)=>{var e={_id:t};var s=this.data[i];if(s){s.forEach(((t,i)=>{var s=this.columnFields[i];if(s){e[s]=t}}))}this.rowDefs.push(e)}))}unload(){this.isActive=false;this.scrollTop=this.table.rowManager.scrollTop;this.scrollLeft=this.table.rowManager.scrollLeft;this.data=this.getData(true);this.element.classList.remove("tabulator-spreadsheet-tab-active")}load(){var t=!this.isActive;this.isActive=true;this.table.blockRedraw();this.table.setData([]);this.table.setColumns(this.columnDefs);this.table.setData(this.rowDefs);this.table.restoreRedraw();if(t&&this.scrollTop!==null){this.table.rowManager.element.scrollLeft=this.scrollLeft;this.table.rowManager.element.scrollTop=this.scrollTop}this.element.classList.add("tabulator-spreadsheet-tab-active");this.dispatchExternal("sheetLoaded",this.getComponent())}getComponent(){return new we(this)}getDefinition(){return{title:this.title,key:this.key,rows:this.rowCount,columns:this.columnCount,data:this.getData()}}getData(t){var i=[],e,s,r;this.rowDefs.forEach((t=>{var e=[];this.columnFields.forEach((i=>{e.push(t[i])}));i.push(e)}));if(!t&&!this.options("spreadsheetOutputFull")){e=i.map((t=>t.findLastIndex((t=>typeof t!=="undefined"))+1));s=Math.max(...e);r=e.findLastIndex((t=>t>0))+1;i=i.slice(0,r);i=i.map((t=>t.slice(0,s)))}return i}setData(t){this.data=t;this.reinitialize();this.dispatchExternal("sheetUpdated",this.getComponent());if(this.isActive){this.load()}}clear(){this.setData([])}setTitle(t){this.title=t;this.element.innerText=t;this.dispatchExternal("sheetUpdated",this.getComponent())}setRows(t){this.rowCount=t;this.initializeRows();this.dispatchExternal("sheetUpdated",this.getComponent());if(this.isActive){this.load()}}setColumns(t){this.columnCount=t;this.reinitialize();this.dispatchExternal("sheetUpdated",this.getComponent());if(this.isActive){this.load()}}remove(){this.spreadsheetManager.removeSheet(this)}destroy(){if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.dispatchExternal("sheetRemoved",this.getComponent())}active(){this.spreadsheetManager.loadSheet(this)}}class xe extends S{static moduleName="spreadsheet";constructor(t){super(t);this.sheets=[];this.element=null;this.registerTableOption("spreadsheet",false);this.registerTableOption("spreadsheetRows",50);this.registerTableOption("spreadsheetColumns",50);this.registerTableOption("spreadsheetColumnDefinition",{});this.registerTableOption("spreadsheetOutputFull",false);this.registerTableOption("spreadsheetData",false);this.registerTableOption("spreadsheetSheets",false);this.registerTableOption("spreadsheetSheetTabs",false);this.registerTableOption("spreadsheetSheetTabsElement",false);this.registerTableFunction("setSheets",this.setSheets.bind(this));this.registerTableFunction("addSheet",this.addSheet.bind(this));this.registerTableFunction("getSheets",this.getSheets.bind(this));this.registerTableFunction("getSheetDefinitions",this.getSheetDefinitions.bind(this));this.registerTableFunction("setSheetData",this.setSheetData.bind(this));this.registerTableFunction("getSheet",this.getSheet.bind(this));this.registerTableFunction("getSheetData",this.getSheetData.bind(this));this.registerTableFunction("clearSheet",this.clearSheet.bind(this));this.registerTableFunction("removeSheet",this.removeSheetFunc.bind(this));this.registerTableFunction("activeSheet",this.activeSheetFunc.bind(this))}initialize(){if(this.options("spreadsheet")){this.subscribe("table-initialized",this.tableInitialized.bind(this));this.subscribe("data-loaded",this.loadRemoteData.bind(this));this.table.options.index="_id";if(this.options("spreadsheetData")&&this.options("spreadsheetSheets")){console.warn("You cannot use spreadsheetData and spreadsheetSheets at the same time, ignoring spreadsheetData");this.table.options.spreadsheetData=false}this.compatibilityCheck();if(this.options("spreadsheetSheetTabs")){this.initializeTabset()}}}compatibilityCheck(){if(this.options("data")){console.warn("Do not use the data option when working with spreadsheets, use either spreadsheetData or spreadsheetSheets to pass data into the table")}if(this.options("pagination")){console.warn("The spreadsheet module is not compatible with the pagination module")}if(this.options("groupBy")){console.warn("The spreadsheet module is not compatible with the row grouping module")}if(this.options("responsiveCollapse")){console.warn("The spreadsheet module is not compatible with the responsive collapse module")}}initializeTabset(){this.element=document.createElement("div");this.element.classList.add("tabulator-spreadsheet-tabs");var t=this.options("spreadsheetSheetTabsElement");if(t&&!(t instanceof HTMLElement)){t=document.querySelector(t);if(!t){console.warn("Unable to find element matching spreadsheetSheetTabsElement selector:",this.options("spreadsheetSheetTabsElement"))}}if(t){t.appendChild(this.element)}else{this.footerAppend(this.element)}}tableInitialized(){if(this.sheets.length){this.loadSheet(this.sheets[0])}else{if(this.options("spreadsheetSheets")){this.loadSheets(this.options("spreadsheetSheets"))}else if(this.options("spreadsheetData")){this.loadData(this.options("spreadsheetData"))}}}loadRemoteData(t,i,e){console.log("data",t,i,e);if(Array.isArray(t)){this.table.dataLoader.clearAlert();this.dispatchExternal("dataLoaded",t);if(!t.length||Array.isArray(t[0])){this.loadData(t)}else{this.loadSheets(t)}}else{console.error("Spreadsheet Loading Error - Unable to process remote data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData: ",t)}return false}loadData(t){var i={data:t};this.loadSheet(this.newSheet(i))}destroySheets(){this.sheets.forEach((t=>{t.destroy()}));this.sheets=[];this.activeSheet=null}loadSheets(t){if(!Array.isArray(t)){t=[]}this.destroySheets();t.forEach((t=>{this.newSheet(t)}));this.loadSheet(this.sheets[0])}loadSheet(t){if(this.activeSheet!==t){if(this.activeSheet){this.activeSheet.unload()}this.activeSheet=t;t.load()}}newSheet(t={}){var i;if(!t.rows){t.rows=this.options("spreadsheetRows")}if(!t.columns){t.columns=this.options("spreadsheetColumns")}i=new ye(this,t);this.sheets.push(i);if(this.element){this.element.appendChild(i.element)}return i}removeSheet(t){var i=this.sheets.indexOf(t),e;if(this.sheets.length>1){if(i>-1){this.sheets.splice(i,1);t.destroy();if(this.activeSheet===t){e=this.sheets[i-1]||this.sheets[0];if(e){this.loadSheet(e)}else{this.activeSheet=null}}}}else{console.warn("Unable to remove sheet, at least one sheet must be active")}}lookupSheet(t){if(!t){return this.activeSheet}else if(t instanceof ye){return t}else if(t instanceof we){return t._sheet}else{return this.sheets.find((i=>i.key===t))||false}}setSheets(t){this.loadSheets(t);return this.getSheets()}addSheet(t){return this.newSheet(t).getComponent()}getSheetDefinitions(){return this.sheets.map((t=>t.getDefinition()))}getSheets(){return this.sheets.map((t=>t.getComponent()))}getSheet(t){var i=this.lookupSheet(t);return i?i.getComponent():false}setSheetData(t,i){if(t&&!i){i=t;t=false}var e=this.lookupSheet(t);return e?e.setData(i):false}getSheetData(t){var i=this.lookupSheet(t);return i?i.getData():false}clearSheet(t){var i=this.lookupSheet(t);return i?i.clear():false}removeSheetFunc(t){var i=this.lookupSheet(t);if(i){this.removeSheet(i)}}activeSheetFunc(t){var i=this.lookupSheet(t);return i?this.loadSheet(i):false}}class ke extends S{static moduleName="tooltip";constructor(t){super(t);this.tooltipSubscriber=null,this.headerSubscriber=null,this.timeout=null;this.popupInstance=null;this.registerTableOption("tooltipDelay",300);this.registerColumnOption("tooltip");this.registerColumnOption("headerTooltip")}initialize(){this.deprecatedOptionsCheck();this.subscribe("column-init",this.initializeColumn.bind(this))}deprecatedOptionsCheck(){}initializeColumn(t){if(t.definition.headerTooltip&&!this.headerSubscriber){this.headerSubscriber=true;this.subscribe("column-mousemove",this.mousemoveCheck.bind(this,"headerTooltip"));this.subscribe("column-mouseout",this.mouseoutCheck.bind(this,"headerTooltip"))}if(t.definition.tooltip&&!this.tooltipSubscriber){this.tooltipSubscriber=true;this.subscribe("cell-mousemove",this.mousemoveCheck.bind(this,"tooltip"));this.subscribe("cell-mouseout",this.mouseoutCheck.bind(this,"tooltip"))}}mousemoveCheck(t,i,e){var s=t==="tooltip"?e.column.definition.tooltip:e.definition.headerTooltip;if(s){this.clearPopup();this.timeout=setTimeout(this.loadTooltip.bind(this,i,e,s),this.table.options.tooltipDelay)}}mouseoutCheck(t,i,e){if(!this.popupInstance){this.clearPopup()}}clearPopup(t,i,e){clearTimeout(this.timeout);this.timeout=null;if(this.popupInstance){this.popupInstance.hide()}}loadTooltip(t,i,e){var s,r,a;function o(t){r=t}if(typeof e==="function"){e=e(t,i.getComponent(),o)}if(e instanceof HTMLElement){s=e}else{s=document.createElement("div");if(e===true){if(i instanceof q){e=i.value}else{if(i.definition.field){this.langBind("columns|"+i.definition.field,(t=>{s.innerHTML=e=t||i.definition.title}))}else{e=i.definition.title}}}s.innerHTML=e}if(e||e===0||e===false){s.classList.add("tabulator-tooltip");s.addEventListener("mousemove",(t=>t.preventDefault()));this.popupInstance=this.popup(s);if(typeof r==="function"){this.popupInstance.renderCallback(r)}a=this.popupInstance.containerEventCoords(t);this.popupInstance.show(a.x+15,a.y+15).hideOnBlur((()=>{this.dispatchExternal("TooltipClosed",i.getComponent());this.popupInstance=null}));this.dispatchExternal("TooltipOpened",i.getComponent())}}}var Ce={integer:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}i=Number(i);return!isNaN(i)&&isFinite(i)&&Math.floor(i)===i},float:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}i=Number(i);return!isNaN(i)&&isFinite(i)&&i%1!==0},numeric:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return!isNaN(i)},string:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return isNaN(i)},alphanumeric:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}var s=new RegExp(/^[a-z0-9]+$/i);return s.test(i)},max:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return parseFloat(i)<=e},min:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return parseFloat(i)>=e},starts:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return String(i).toLowerCase().startsWith(String(e).toLowerCase())},ends:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return String(i).toLowerCase().endsWith(String(e).toLowerCase())},minLength:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return String(i).length>=e},maxLength:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}return String(i).length<=e},in:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}if(typeof e=="string"){e=e.split("|")}return e.indexOf(i)>-1},regex:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}var s=new RegExp(e);return s.test(i)},unique:function(t,i,e){if(i===""||i===null||typeof i==="undefined"){return true}var s=true;var r=t.getData();var a=t.getColumn()._getSelf();this.table.rowManager.rows.forEach((function(t){var e=t.getData();if(e!==r){if(i==a.getFieldValue(e)){s=false}}}));return s},required:function(t,i,e){return i!==""&&i!==null&&typeof i!=="undefined"}};class Re extends S{static moduleName="validate";static validators=Ce;constructor(t){super(t);this.invalidCells=[];this.registerTableOption("validationMode","blocking");this.registerColumnOption("validator");this.registerTableFunction("getInvalidCells",this.getInvalidCells.bind(this));this.registerTableFunction("clearCellValidation",this.userClearCellValidation.bind(this));this.registerTableFunction("validate",this.userValidate.bind(this));this.registerComponentFunction("cell","isValid",this.cellIsValid.bind(this));this.registerComponentFunction("cell","clearValidation",this.clearValidation.bind(this));this.registerComponentFunction("cell","validate",this.cellValidate.bind(this));this.registerComponentFunction("column","validate",this.columnValidate.bind(this));this.registerComponentFunction("row","validate",this.rowValidate.bind(this))}initialize(){this.subscribe("cell-delete",this.clearValidation.bind(this));this.subscribe("column-layout",this.initializeColumnCheck.bind(this));this.subscribe("edit-success",this.editValidate.bind(this));this.subscribe("edit-editor-clear",this.editorClear.bind(this));this.subscribe("edit-edited-clear",this.editedClear.bind(this))}editValidate(t,i,e){var s=this.table.options.validationMode!=="manual"?this.validate(t.column.modules.validate,t,i):true;if(s!==true){setTimeout((()=>{t.getElement().classList.add("tabulator-validation-fail");this.dispatchExternal("validationFailed",t.getComponent(),i,s)}))}return s}editorClear(t,i){if(i){if(t.column.modules.validate){this.cellValidate(t)}}t.getElement().classList.remove("tabulator-validation-fail")}editedClear(t){if(t.modules.validate){t.modules.validate.invalid=false}}cellIsValid(t){return t.modules.validate?t.modules.validate.invalid||true:true}cellValidate(t){return this.validate(t.column.modules.validate,t,t.getValue())}columnValidate(t){var i=[];t.cells.forEach((t=>{if(this.cellValidate(t)!==true){i.push(t.getComponent())}}));return i.length?i:true}rowValidate(t){var i=[];t.cells.forEach((t=>{if(this.cellValidate(t)!==true){i.push(t.getComponent())}}));return i.length?i:true}userClearCellValidation(t){if(!t){t=this.getInvalidCells()}if(!Array.isArray(t)){t=[t]}t.forEach((t=>{this.clearValidation(t._getSelf())}))}userValidate(t){var i=[];this.table.rowManager.rows.forEach((t=>{t=t.getComponent();var e=t.validate();if(e!==true){i=i.concat(e)}}));return i.length?i:true}initializeColumnCheck(t){if(typeof t.definition.validator!=="undefined"){this.initializeColumn(t)}}initializeColumn(t){var i=this,e=[],s;if(t.definition.validator){if(Array.isArray(t.definition.validator)){t.definition.validator.forEach((t=>{s=i._extractValidator(t);if(s){e.push(s)}}))}else{s=this._extractValidator(t.definition.validator);if(s){e.push(s)}}t.modules.validate=e.length?e:false}}_extractValidator(t){var i,e,s;switch(typeof t){case"string":s=t.indexOf(":");if(s>-1){i=t.substring(0,s);e=t.substring(s+1)}else{i=t}return this._buildValidator(i,e);case"function":return this._buildValidator(t);case"object":return this._buildValidator(t.type,t.parameters)}}_buildValidator(t,i){var e=typeof t=="function"?t:Re.validators[t];if(!e){console.warn("Validator Setup Error - No matching validator found:",t);return false}else{return{type:typeof t=="function"?"function":t,func:e,params:i}}}validate(t,i,e){var s=this,r=[],a=this.invalidCells.indexOf(i);if(t){t.forEach((t=>{if(!t.func.call(s,i.getComponent(),e,t.params)){r.push({type:t.type,parameters:t.params})}}))}if(!i.modules.validate){i.modules.validate={}}if(!r.length){i.modules.validate.invalid=false;i.getElement().classList.remove("tabulator-validation-fail");if(a>-1){this.invalidCells.splice(a,1)}}else{i.modules.validate.invalid=r;if(this.table.options.validationMode!=="manual"){i.getElement().classList.add("tabulator-validation-fail")}if(a==-1){this.invalidCells.push(i)}}return r.length?r:true}getInvalidCells(){var t=[];this.invalidCells.forEach((i=>{t.push(i.getComponent())}));return t}clearValidation(t){var i;if(t.modules.validate&&t.modules.validate.invalid){t.getElement().classList.remove("tabulator-validation-fail");t.modules.validate.invalid=false;i=this.invalidCells.indexOf(t);if(i>-1){this.invalidCells.splice(i,1)}}}}var Ee=Object.freeze({__proto__:null,AccessorModule:D,AjaxModule:L,ClipboardModule:G,ColumnCalcsModule:tt,DataTreeModule:it,DownloadModule:nt,EditModule:Et,ExportModule:Dt,FilterModule:Ft,FormatModule:ei,FrozenColumnsModule:si,FrozenRowsModule:ri,GroupRowsModule:hi,HistoryModule:di,HtmlTableImportModule:bi,ImportModule:yi,InteractionModule:xi,KeybindingsModule:Ri,MenuModule:Ei,MoveColumnsModule:zi,MoveRowsModule:Ti,MutatorModule:Pi,PageModule:Oi,PersistenceModule:Li,PopupModule:Ai,PrintModule:Ii,ReactiveDataModule:Vi,ResizeColumnsModule:Ui,ResizeRowsModule:Bi,ResizeTableModule:Gi,ResponsiveLayoutModule:qi,SelectRangeModule:oe,SelectRowModule:$i,SortModule:ge,SpreadsheetModule:xe,TooltipModule:ke,ValidateModule:Re});var ze={debugEventsExternal:false,debugEventsInternal:false,debugInvalidOptions:true,debugInvalidComponentFuncs:true,debugInitialization:true,debugDeprecation:true,height:false,minHeight:false,maxHeight:false,columnHeaderVertAlign:"top",popupContainer:false,columns:[],columnDefaults:{},rowHeader:false,data:false,autoColumns:false,autoColumnsDefinitions:false,nestedFieldSeparator:".",footerElement:false,index:"id",textDirection:"auto",addRowPos:"bottom",headerVisible:true,renderVertical:"virtual",renderHorizontal:"basic",renderVerticalBuffer:0,scrollToRowPosition:"top",scrollToRowIfVisible:true,scrollToColumnPosition:"left",scrollToColumnIfVisible:true,rowFormatter:false,rowFormatterPrint:null,rowFormatterClipboard:null,rowFormatterHtmlOutput:null,rowHeight:null,placeholder:false,dataLoader:true,dataLoaderLoading:false,dataLoaderError:false,dataLoaderErrorTimeout:3e3,dataSendParams:{},dataReceiveParams:{},dependencies:{}};class Me{constructor(t,i,e={}){this.table=t;this.msgType=i;this.registeredDefaults=Object.assign({},e)}register(t,i){this.registeredDefaults[t]=i}generate(t,i={}){var e=Object.assign({},this.registeredDefaults),s=this.table.options.debugInvalidOptions||i.debugInvalidOptions===true;Object.assign(e,t);for(let t in i){if(!e.hasOwnProperty(t)){if(s){console.warn("Invalid "+this.msgType+" option:",t)}e[t]=i.key}}for(let t in e){if(t in i){e[t]=i[t]}else{if(Array.isArray(e[t])){e[t]=Object.assign([],e[t])}else if(typeof e[t]==="object"&&e[t]!==null){e[t]=Object.assign({},e[t])}else if(typeof e[t]==="undefined"){delete e[t]}}}return e}}class Se extends E{constructor(t){super(t);this.elementVertical=t.rowManager.element;this.elementHorizontal=t.columnManager.element;this.tableElement=t.rowManager.tableElement;this.verticalFillMode="fit"}initialize(){}clearRows(){}clearColumns(){}reinitializeColumnWidths(t){}renderRows(){}renderColumns(){}rerenderRows(t){if(t){t()}}rerenderColumns(t,i){}renderRowCells(t){}rerenderRowCells(t,i){}scrollColumns(t,i){}scrollRows(t,i){}resize(){}scrollToRow(t){}scrollToRowNearestTop(t){}visibleRows(t){return[]}rows(){return this.table.rowManager.getDisplayRows()}styleRow(t,i){var e=t.getElement();if(i%2){e.classList.add("tabulator-row-even");e.classList.remove("tabulator-row-odd")}else{e.classList.add("tabulator-row-odd");e.classList.remove("tabulator-row-even")}}clear(){this.clearRows();this.clearColumns()}render(){this.renderRows();this.renderColumns()}rerender(t){this.rerenderRows();this.rerenderColumns()}scrollToRowPosition(t,i,e){var s=this.rows().indexOf(t),r=t.getElement(),a=0;return new Promise(((o,h)=>{if(s>-1){if(typeof e==="undefined"){e=this.table.options.scrollToRowIfVisible}if(!e){if(z.elVisible(r)){a=z.elOffset(r).top-z.elOffset(this.elementVertical).top;if(a>0&&a<this.elementVertical.clientHeight-r.offsetHeight){o();return false}}}if(typeof i==="undefined"){i=this.table.options.scrollToRowPosition}if(i==="nearest"){i=this.scrollToRowNearestTop(t)?"top":"bottom"}this.scrollToRow(t);switch(i){case"middle":case"center":if(this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight){this.elementVertical.scrollTop=this.elementVertical.scrollTop+(r.offsetTop-this.elementVertical.scrollTop)-(this.elementVertical.scrollHeight-r.offsetTop)/2}else{this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight/2}break;case"bottom":if(this.elementVertical.scrollHeight-this.elementVertical.scrollTop==this.elementVertical.clientHeight){this.elementVertical.scrollTop=this.elementVertical.scrollTop-(this.elementVertical.scrollHeight-r.offsetTop)+r.offsetHeight}else{this.elementVertical.scrollTop=this.elementVertical.scrollTop-this.elementVertical.clientHeight+r.offsetHeight}break;case"top":this.elementVertical.scrollTop=r.offsetTop;break}o()}else{console.warn("Scroll Error - Row not visible");h("Scroll Error - Row not visible")}}))}}class Te extends Se{constructor(t){super(t)}renderRowCells(t,i){const e=document.createDocumentFragment();t.cells.forEach((t=>{e.appendChild(t.getElement())}));t.element.appendChild(e);if(!i){t.cells.forEach((t=>{t.cellRendered()}))}}reinitializeColumnWidths(t){t.forEach((function(t){t.reinitializeWidth()}))}}class De extends Se{constructor(t){super(t);this.leftCol=0;this.rightCol=0;this.scrollLeft=0;this.vDomScrollPosLeft=0;this.vDomScrollPosRight=0;this.vDomPadLeft=0;this.vDomPadRight=0;this.fitDataColAvg=0;this.windowBuffer=200;this.visibleRows=null;this.initialized=false;this.isFitData=false;this.columns=[]}initialize(){this.compatibilityCheck();this.layoutCheck();this.vertScrollListen()}compatibilityCheck(){if(this.options("layout")=="fitDataTable"){console.warn("Horizontal Virtual DOM is not compatible with fitDataTable layout mode")}if(this.options("responsiveLayout")){console.warn("Horizontal Virtual DOM is not compatible with responsive columns")}if(this.options("rtl")){console.warn("Horizontal Virtual DOM is not currently compatible with RTL text direction")}}layoutCheck(){this.isFitData=this.options("layout").startsWith("fitData")}vertScrollListen(){this.subscribe("scroll-vertical",this.clearVisRowCache.bind(this));this.subscribe("data-refreshed",this.clearVisRowCache.bind(this))}clearVisRowCache(){this.visibleRows=null}renderColumns(t,i){this.dataChange()}scrollColumns(t,i){if(this.scrollLeft!=t){this.scrollLeft=t;this.scroll(t-(this.vDomScrollPosLeft+this.windowBuffer))}}calcWindowBuffer(){var t=this.elementVertical.clientWidth;this.table.columnManager.columnsByIndex.forEach((i=>{if(i.visible){var e=i.getWidth();if(e>t){t=e}}}));this.windowBuffer=t*2}rerenderColumns(t,i){var e={cols:this.columns,leftCol:this.leftCol,rightCol:this.rightCol},s=0;if(t&&!this.initialized){return}this.clear();this.calcWindowBuffer();this.scrollLeft=this.elementVertical.scrollLeft;this.vDomScrollPosLeft=this.scrollLeft-this.windowBuffer;this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer;this.table.columnManager.columnsByIndex.forEach((t=>{var i={},e;if(t.visible){if(!t.modules.frozen){e=t.getWidth();i.leftPos=s;i.rightPos=s+e;i.width=e;if(this.isFitData){i.fitDataCheck=t.modules.vdomHoz?t.modules.vdomHoz.fitDataCheck:true}if(s+e>this.vDomScrollPosLeft&&s<this.vDomScrollPosRight){if(this.leftCol==-1){this.leftCol=this.columns.length;this.vDomPadLeft=s}this.rightCol=this.columns.length}else{if(this.leftCol!==-1){this.vDomPadRight+=e}}this.columns.push(t);t.modules.vdomHoz=i;s+=e}}}));this.tableElement.style.paddingLeft=this.vDomPadLeft+"px";this.tableElement.style.paddingRight=this.vDomPadRight+"px";this.initialized=true;if(!i){if(!t||this.reinitChanged(e)){this.reinitializeRows()}}this.elementVertical.scrollLeft=this.scrollLeft}renderRowCells(t){if(this.initialized){this.initializeRow(t)}else{const i=document.createDocumentFragment();t.cells.forEach((t=>{i.appendChild(t.getElement())}));t.element.appendChild(i);t.cells.forEach((t=>{t.cellRendered()}))}}rerenderRowCells(t,i){this.reinitializeRow(t,i)}reinitializeColumnWidths(t){for(let t=this.leftCol;t<=this.rightCol;t++){let i=this.columns[t];if(i){i.reinitializeWidth()}}}deinitialize(){this.initialized=false}clear(){this.columns=[];this.leftCol=-1;this.rightCol=0;this.vDomScrollPosLeft=0;this.vDomScrollPosRight=0;this.vDomPadLeft=0;this.vDomPadRight=0}dataChange(){var t=false,i,e;if(this.isFitData){this.table.columnManager.columnsByIndex.forEach((i=>{if(!i.definition.width&&i.visible){t=true}}));if(t&&this.table.rowManager.getDisplayRows().length){this.vDomScrollPosRight=this.scrollLeft+this.elementVertical.clientWidth+this.windowBuffer;i=this.chain("rows-sample",[1],[],(()=>this.table.rowManager.getDisplayRows()))[0];if(i){e=i.getElement();i.generateCells();this.tableElement.appendChild(e);for(let t=0;t<i.cells.length;t++){let s=i.cells[t];e.appendChild(s.getElement());s.column.reinitializeWidth()}e.parentNode.removeChild(e);this.rerenderColumns(false,true)}}}else{if(this.options("layout")==="fitColumns"){this.layoutRefresh();this.rerenderColumns(false,true)}}}reinitChanged(t){var i=true;if(t.cols.length!==this.columns.length||t.leftCol!==this.leftCol||t.rightCol!==this.rightCol){return true}t.cols.forEach(((t,e)=>{if(t!==this.columns[e]){i=false}}));return!i}reinitializeRows(){var t=this.getVisibleRows(),i=this.table.rowManager.getRows().filter((i=>!t.includes(i)));t.forEach((t=>{this.reinitializeRow(t,true)}));i.forEach((t=>{t.deinitialize()}))}getVisibleRows(){if(!this.visibleRows){this.visibleRows=this.table.rowManager.getVisibleRows()}return this.visibleRows}scroll(t){this.vDomScrollPosLeft+=t;this.vDomScrollPosRight+=t;if(Math.abs(t)>this.windowBuffer/2){this.rerenderColumns()}else{if(t>0){this.addColRight();this.removeColLeft()}else{this.addColLeft();this.removeColRight()}}}colPositionAdjust(t,i,e){for(let s=t;s<i;s++){let t=this.columns[s];t.modules.vdomHoz.leftPos+=e;t.modules.vdomHoz.rightPos+=e}}addColRight(){var t=false,i=true;while(i){let e=this.columns[this.rightCol+1];if(e){if(e.modules.vdomHoz.leftPos<=this.vDomScrollPosRight){t=true;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){var i=t.getCell(e);t.getElement().insertBefore(i.getElement(),t.getCell(this.columns[this.rightCol]).getElement().nextSibling);i.cellRendered()}}));this.fitDataColActualWidthCheck(e);this.rightCol++;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){t.modules.vdomHoz.rightCol=this.rightCol}}));if(this.rightCol>=this.columns.length-1){this.vDomPadRight=0}else{this.vDomPadRight-=e.getWidth()}}else{i=false}}else{i=false}}if(t){this.tableElement.style.paddingRight=this.vDomPadRight+"px"}}addColLeft(){var t=false,i=true;while(i){let e=this.columns[this.leftCol-1];if(e){if(e.modules.vdomHoz.rightPos>=this.vDomScrollPosLeft){t=true;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){var i=t.getCell(e);t.getElement().insertBefore(i.getElement(),t.getCell(this.columns[this.leftCol]).getElement());i.cellRendered()}}));this.leftCol--;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){t.modules.vdomHoz.leftCol=this.leftCol}}));if(this.leftCol<=0){this.vDomPadLeft=0}else{this.vDomPadLeft-=e.getWidth()}let i=this.fitDataColActualWidthCheck(e);if(i){this.scrollLeft=this.elementVertical.scrollLeft=this.elementVertical.scrollLeft+i;this.vDomPadRight-=i}}else{i=false}}else{i=false}}if(t){this.tableElement.style.paddingLeft=this.vDomPadLeft+"px"}}removeColRight(){var t=false,i=true;while(i){let e=this.columns[this.rightCol];if(e){if(e.modules.vdomHoz.leftPos>this.vDomScrollPosRight){t=true;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){var i=t.getCell(e);try{t.getElement().removeChild(i.getElement())}catch(t){console.warn("Could not removeColRight",t.message)}}}));this.vDomPadRight+=e.getWidth();this.rightCol--;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){t.modules.vdomHoz.rightCol=this.rightCol}}))}else{i=false}}else{i=false}}if(t){this.tableElement.style.paddingRight=this.vDomPadRight+"px"}}removeColLeft(){var t=false,i=true;while(i){let e=this.columns[this.leftCol];if(e){if(e.modules.vdomHoz.rightPos<this.vDomScrollPosLeft){t=true;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){var i=t.getCell(e);try{t.getElement().removeChild(i.getElement())}catch(t){console.warn("Could not removeColLeft",t.message)}}}));this.vDomPadLeft+=e.getWidth();this.leftCol++;this.getVisibleRows().forEach((t=>{if(t.type!=="group"){t.modules.vdomHoz.leftCol=this.leftCol}}))}else{i=false}}else{i=false}}if(t){this.tableElement.style.paddingLeft=this.vDomPadLeft+"px"}}fitDataColActualWidthCheck(t){var i,e;if(t.modules.vdomHoz.fitDataCheck){t.reinitializeWidth();i=t.getWidth();e=i-t.modules.vdomHoz.width;if(e){t.modules.vdomHoz.rightPos+=e;t.modules.vdomHoz.width=i;this.colPositionAdjust(this.columns.indexOf(t)+1,this.columns.length,e)}t.modules.vdomHoz.fitDataCheck=false}return e}initializeRow(t){if(t.type!=="group"){t.modules.vdomHoz={leftCol:this.leftCol,rightCol:this.rightCol};if(this.table.modules.frozenColumns){this.table.modules.frozenColumns.leftColumns.forEach((i=>{this.appendCell(t,i)}))}for(let i=this.leftCol;i<=this.rightCol;i++){this.appendCell(t,this.columns[i])}if(this.table.modules.frozenColumns){this.table.modules.frozenColumns.rightColumns.forEach((i=>{this.appendCell(t,i)}))}}}appendCell(t,i){if(i&&i.visible){let e=t.getCell(i);t.getElement().appendChild(e.getElement());e.cellRendered()}}reinitializeRow(t,i){if(t.type!=="group"){if(i||!t.modules.vdomHoz||t.modules.vdomHoz.leftCol!==this.leftCol||t.modules.vdomHoz.rightCol!==this.rightCol){var e=t.getElement();while(e.firstChild)e.removeChild(e.firstChild);this.initializeRow(t)}}}}class Pe extends E{constructor(t){super(t);this.blockHozScrollEvent=false;this.headersElement=null;this.contentsElement=null;this.rowHeader=null;this.element=null;this.columns=[];this.columnsByIndex=[];this.columnsByField={};this.scrollLeft=0;this.optionsList=new Me(this.table,"column definition",Z);this.redrawBlock=false;this.redrawBlockUpdate=null;this.renderer=null}initialize(){this.initializeRenderer();this.headersElement=this.createHeadersElement();this.contentsElement=this.createHeaderContentsElement();this.element=this.createHeaderElement();this.contentsElement.insertBefore(this.headersElement,this.contentsElement.firstChild);this.element.insertBefore(this.contentsElement,this.element.firstChild);this.initializeScrollWheelWatcher();this.subscribe("scroll-horizontal",this.scrollHorizontal.bind(this));this.subscribe("scrollbar-vertical",this.padVerticalScrollbar.bind(this))}padVerticalScrollbar(t){if(this.table.rtl){this.headersElement.style.marginLeft=t+"px"}else{this.headersElement.style.marginRight=t+"px"}}initializeRenderer(){var t;var i={virtual:De,basic:Te};if(typeof this.table.options.renderHorizontal==="string"){t=i[this.table.options.renderHorizontal]}else{t=this.table.options.renderHorizontal}if(t){this.renderer=new t(this.table,this.element,this.tableElement);this.renderer.initialize()}else{console.error("Unable to find matching renderer:",this.table.options.renderHorizontal)}}createHeadersElement(){var t=document.createElement("div");t.classList.add("tabulator-headers");t.setAttribute("role","row");return t}createHeaderContentsElement(){var t=document.createElement("div");t.classList.add("tabulator-header-contents");t.setAttribute("role","rowgroup");return t}createHeaderElement(){var t=document.createElement("div");t.classList.add("tabulator-header");t.setAttribute("role","rowgroup");if(!this.table.options.headerVisible){t.classList.add("tabulator-header-hidden")}return t}getElement(){return this.element}getContentsElement(){return this.contentsElement}getHeadersElement(){return this.headersElement}scrollHorizontal(t){this.contentsElement.scrollLeft=t;this.scrollLeft=t;this.renderer.scrollColumns(t)}initializeScrollWheelWatcher(){this.contentsElement.addEventListener("wheel",(t=>{var i;if(t.deltaX){i=this.contentsElement.scrollLeft+t.deltaX;this.table.rowManager.scrollHorizontal(i);this.table.columnManager.scrollHorizontal(i)}}))}generateColumnsFromRowData(t){var i=[],e={},s=this.table.options.autoColumns==="full"?t:[t[0]],r=this.table.options.autoColumnsDefinitions;if(t&&t.length){s.forEach((t=>{Object.keys(t).forEach(((s,r)=>{let a=t[s],o;if(!e[s]){o={field:s,title:s,sorter:this.calculateSorterFromValue(a)};i.splice(r,0,o);e[s]=typeof a==="undefined"?o:true}else if(e[s]!==true){if(typeof a!=="undefined"){e[s].sorter=this.calculateSorterFromValue(a);e[s]=true}}}))}));if(r){switch(typeof r){case"function":this.table.options.columns=r.call(this.table,i);break;case"object":if(Array.isArray(r)){i.forEach((t=>{var i=r.find((i=>i.field===t.field));if(i){Object.assign(t,i)}}))}else{i.forEach((t=>{if(r[t.field]){Object.assign(t,r[t.field])}}))}this.table.options.columns=i;break}}else{this.table.options.columns=i}this.setColumns(this.table.options.columns)}}calculateSorterFromValue(t){var i;switch(typeof t){case"undefined":i="string";break;case"boolean":i="boolean";break;case"number":i="number";break;case"object":if(Array.isArray(t)){i="array"}else{i="string"}break;default:if(!isNaN(t)&&t!==""){i="number"}else{if(t.match(/((^[0-9]+[a-z]+)|(^[a-z]+[0-9]+))+$/i)){i="alphanum"}else{i="string"}}break}return i}setColumns(t,i){while(this.headersElement.firstChild)this.headersElement.removeChild(this.headersElement.firstChild);this.columns=[];this.columnsByIndex=[];this.columnsByField={};this.dispatch("columns-loading");this.dispatchExternal("columnsLoading");if(this.table.options.rowHeader){this.rowHeader=new $(this.table.options.rowHeader===true?{}:this.table.options.rowHeader,this,true);this.columns.push(this.rowHeader);this.headersElement.appendChild(this.rowHeader.getElement());this.rowHeader.columnRendered()}t.forEach(((t,i)=>{this._addColumn(t)}));this._reIndexColumns();this.dispatch("columns-loaded");if(this.subscribedExternal("columnsLoaded")){this.dispatchExternal("columnsLoaded",this.getComponents())}this.rerenderColumns(false,true);this.redraw(true)}_addColumn(t,i,e){var s=new $(t,this),r=s.getElement(),a=e?this.findColumnIndex(e):e;if(i&&this.rowHeader&&(!e||e===this.rowHeader)){i=false;e=this.rowHeader;a=0}if(e&&a>-1){var o=e.getTopColumn();var h=this.columns.indexOf(o);var l=o.getElement();if(i){this.columns.splice(h,0,s);l.parentNode.insertBefore(r,l)}else{this.columns.splice(h+1,0,s);l.parentNode.insertBefore(r,l.nextSibling)}}else{if(i){this.columns.unshift(s);this.headersElement.insertBefore(s.getElement(),this.headersElement.firstChild)}else{this.columns.push(s);this.headersElement.appendChild(s.getElement())}}s.columnRendered();return s}registerColumnField(t){if(t.definition.field){this.columnsByField[t.definition.field]=t}}registerColumnPosition(t){this.columnsByIndex.push(t)}_reIndexColumns(){this.columnsByIndex=[];this.columns.forEach((function(t){t.reRegisterPosition()}))}verticalAlignHeaders(){var t=0;if(!this.redrawBlock){this.headersElement.style.height="";this.columns.forEach((t=>{t.clearVerticalAlign()}));this.columns.forEach((i=>{var e=i.getHeight();if(e>t){t=e}}));this.headersElement.style.height=t+"px";this.columns.forEach((i=>{i.verticalAlign(this.table.options.columnHeaderVertAlign,t)}));this.table.rowManager.adjustTableSize()}}findColumn(t){var i;if(typeof t=="object"){if(t instanceof $){return t}else if(t instanceof K){return t._getSelf()||false}else if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement){i=[];this.columns.forEach((t=>{i.push(t);i=i.concat(t.getColumns(true))}));let e=i.find((i=>i.element===t));return e||false}}else{return this.columnsByField[t]||false}return false}getColumnByField(t){return this.columnsByField[t]}getColumnsByFieldRoot(t){var i=[];Object.keys(this.columnsByField).forEach((e=>{var s=this.table.options.nestedFieldSeparator?e.split(this.table.options.nestedFieldSeparator)[0]:e;if(s===t){i.push(this.columnsByField[e])}}));return i}getColumnByIndex(t){return this.columnsByIndex[t]}getFirstVisibleColumn(){var t=this.columnsByIndex.findIndex((t=>t.visible));return t>-1?this.columnsByIndex[t]:false}getVisibleColumnsByIndex(){return this.columnsByIndex.filter((t=>t.visible))}getColumns(){return this.columns}findColumnIndex(t){return this.columnsByIndex.findIndex((i=>t===i))}getRealColumns(){return this.columnsByIndex}traverse(t){this.columnsByIndex.forEach(((i,e)=>{t(i,e)}))}getDefinitions(t){var i=[];this.columnsByIndex.forEach((e=>{if(!t||t&&e.visible){i.push(e.getDefinition())}}));return i}getDefinitionTree(){var t=[];this.columns.forEach((i=>{t.push(i.getDefinition(true))}));return t}getComponents(t){var i=[],e=t?this.columns:this.columnsByIndex;e.forEach((t=>{i.push(t.getComponent())}));return i}getWidth(){var t=0;this.columnsByIndex.forEach((i=>{if(i.visible){t+=i.getWidth()}}));return t}moveColumn(t,i,e){i.element.parentNode.insertBefore(t.element,i.element);if(e){i.element.parentNode.insertBefore(i.element,t.element)}this.moveColumnActual(t,i,e);this.verticalAlignHeaders();this.table.rowManager.reinitialize()}moveColumnActual(t,i,e){if(t.parent.isGroup){this._moveColumnInArray(t.parent.columns,t,i,e)}else{this._moveColumnInArray(this.columns,t,i,e)}this._moveColumnInArray(this.columnsByIndex,t,i,e,true);this.rerenderColumns(true);this.dispatch("column-moved",t,i,e);if(this.subscribedExternal("columnMoved")){this.dispatchExternal("columnMoved",t.getComponent(),this.table.columnManager.getComponents())}}_moveColumnInArray(t,i,e,s,r){var a=t.indexOf(i),o,h=[];if(a>-1){t.splice(a,1);o=t.indexOf(e);if(o>-1){if(s){o=o+1}}else{o=a}t.splice(o,0,i);if(r){h=this.chain("column-moving-rows",[i,e,s],null,[])||[];h=h.concat(this.table.rowManager.rows);h.forEach((function(t){if(t.cells.length){var i=t.cells.splice(a,1)[0];t.cells.splice(o,0,i)}}))}}}scrollToColumn(t,i,e){var s=0,r=t.getLeftOffset(),a=0,o=t.getElement();return new Promise(((h,l)=>{if(typeof i==="undefined"){i=this.table.options.scrollToColumnPosition}if(typeof e==="undefined"){e=this.table.options.scrollToColumnIfVisible}if(t.visible){switch(i){case"middle":case"center":a=-this.element.clientWidth/2;break;case"right":a=o.clientWidth-this.headersElement.clientWidth;break}if(!e){if(r>0&&r+o.offsetWidth<this.element.clientWidth){return false}}s=r+a;s=Math.max(Math.min(s,this.table.rowManager.element.scrollWidth-this.table.rowManager.element.clientWidth),0);this.table.rowManager.scrollHorizontal(s);this.scrollHorizontal(s);h()}else{console.warn("Scroll Error - Column not visible");l("Scroll Error - Column not visible")}}))}generateCells(t){var i=[];this.columnsByIndex.forEach((e=>{i.push(e.generateCell(t))}));return i}getFlexBaseWidth(){var t=this.table.element.clientWidth,i=0;if(this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight){t-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth}this.columnsByIndex.forEach((function(e){var s,r,a;if(e.visible){s=e.definition.width||0;r=parseInt(e.minWidth);if(typeof s=="string"){if(s.indexOf("%")>-1){a=t/100*parseInt(s)}else{a=parseInt(s)}}else{a=s}i+=a>r?a:r}}));return i}addColumn(t,i,e){return new Promise(((s,r)=>{var a=this._addColumn(t,i,e);this._reIndexColumns();this.dispatch("column-add",t,i,e);if(this.layoutMode()!="fitColumns"){a.reinitializeWidth()}this.redraw(true);this.table.rowManager.reinitialize();this.rerenderColumns();s(a)}))}deregisterColumn(t){var i=t.getField(),e;if(i){delete this.columnsByField[i]}e=this.columnsByIndex.indexOf(t);if(e>-1){this.columnsByIndex.splice(e,1)}e=this.columns.indexOf(t);if(e>-1){this.columns.splice(e,1)}this.verticalAlignHeaders();this.redraw()}rerenderColumns(t,i){if(!this.redrawBlock){this.renderer.rerenderColumns(t,i)}else{if(t===false||t===true&&this.redrawBlockUpdate===null){this.redrawBlockUpdate=t}}}blockRedraw(){this.redrawBlock=true;this.redrawBlockUpdate=null}restoreRedraw(){this.redrawBlock=false;this.verticalAlignHeaders();this.renderer.rerenderColumns(this.redrawBlockUpdate)}redraw(t){if(z.elVisible(this.element)){this.verticalAlignHeaders()}if(t){this.table.rowManager.resetScroll();this.table.rowManager.reinitialize()}if(!this.confirm("table-redrawing",t)){this.layoutRefresh(t)}this.dispatch("table-redraw",t);this.table.footerManager.redraw()}}class Fe extends Se{constructor(t){super(t);this.verticalFillMode="fill";this.scrollTop=0;this.scrollLeft=0;this.scrollTop=0;this.scrollLeft=0}clearRows(){var t=this.tableElement;while(t.firstChild)t.removeChild(t.firstChild);t.scrollTop=0;t.scrollLeft=0;t.style.minWidth="";t.style.minHeight="";t.style.display="";t.style.visibility=""}renderRows(){var t=this.tableElement,i=true,e=document.createDocumentFragment(),s=this.rows();s.forEach(((t,s)=>{this.styleRow(t,s);t.initialize(false,true);if(t.type!=="group"){i=false}e.appendChild(t.getElement())}));t.appendChild(e);s.forEach((t=>{t.rendered();if(!t.heightInitialized){t.calcHeight(true)}}));s.forEach((t=>{if(!t.heightInitialized){t.setCellHeight()}}));if(i){t.style.minWidth=this.table.columnManager.getWidth()+"px"}else{t.style.minWidth=""}}rerenderRows(t){this.clearRows();if(t){t()}this.renderRows();if(!this.rows().length){this.table.rowManager.tableEmpty()}}scrollToRowNearestTop(t){var i=z.elOffset(t.getElement()).top;return!(Math.abs(this.elementVertical.scrollTop-i)>Math.abs(this.elementVertical.scrollTop+this.elementVertical.clientHeight-i))}scrollToRow(t){var i=t.getElement();this.elementVertical.scrollTop=z.elOffset(i).top-z.elOffset(this.elementVertical).top+this.elementVertical.scrollTop}visibleRows(t){return this.rows()}}class je extends Se{constructor(t){super(t);this.verticalFillMode="fill";this.scrollTop=0;this.scrollLeft=0;this.vDomRowHeight=20;this.vDomTop=0;this.vDomBottom=0;this.vDomScrollPosTop=0;this.vDomScrollPosBottom=0;this.vDomTopPad=0;this.vDomBottomPad=0;this.vDomMaxRenderChain=90;this.vDomWindowBuffer=0;this.vDomWindowMinTotalRows=20;this.vDomWindowMinMarginRows=5;this.vDomTopNewRows=[];this.vDomBottomNewRows=[]}clearRows(){var t=this.tableElement;while(t.firstChild)t.removeChild(t.firstChild);t.style.paddingTop="";t.style.paddingBottom="";t.style.minHeight="";t.style.display="";t.style.visibility="";this.elementVertical.scrollTop=0;this.elementVertical.scrollLeft=0;this.scrollTop=0;this.scrollLeft=0;this.vDomTop=0;this.vDomBottom=0;this.vDomTopPad=0;this.vDomBottomPad=0;this.vDomScrollPosTop=0;this.vDomScrollPosBottom=0}renderRows(){this._virtualRenderFill()}rerenderRows(t){var i=this.elementVertical.scrollTop;var e=false;var s=false;var r=this.table.rowManager.scrollLeft;var a=this.rows();for(var o=this.vDomTop;o<=this.vDomBottom;o++){if(a[o]){var h=i-a[o].getElement().offsetTop;if(s===false||Math.abs(h)<s){s=h;e=o}else{break}}}a.forEach((t=>{t.deinitializeHeight()}));if(t){t()}if(this.rows().length){this._virtualRenderFill(e===false?this.rows.length-1:e,true,s||0)}else{this.clear();this.table.rowManager.tableEmpty()}this.scrollColumns(r)}scrollColumns(t){this.table.rowManager.scrollHorizontal(t)}scrollRows(t,i){var e=t-this.vDomScrollPosTop;var s=t-this.vDomScrollPosBottom;var r=this.vDomWindowBuffer*2;var a=this.rows();this.scrollTop=t;if(-e>r||s>r){var o=this.table.rowManager.scrollLeft;this._virtualRenderFill(Math.floor(this.elementVertical.scrollTop/this.elementVertical.scrollHeight*a.length));this.scrollColumns(o)}else{if(i){if(e<0){this._addTopRow(a,-e)}if(s<0){if(this.vDomScrollHeight-this.scrollTop>this.vDomWindowBuffer){this._removeBottomRow(a,-s)}else{this.vDomScrollPosBottom=this.scrollTop}}}else{if(s>=0){this._addBottomRow(a,s)}if(e>=0){if(this.scrollTop>this.vDomWindowBuffer){this._removeTopRow(a,e)}else{this.vDomScrollPosTop=this.scrollTop}}}}}resize(){this.vDomWindowBuffer=this.table.options.renderVerticalBuffer||this.elementVertical.clientHeight}scrollToRowNearestTop(t){var i=this.rows().indexOf(t);return!(Math.abs(this.vDomTop-i)>Math.abs(this.vDomBottom-i))}scrollToRow(t){var i=this.rows().indexOf(t);if(i>-1){this._virtualRenderFill(i,true)}}visibleRows(t){var i=this.elementVertical.scrollTop,e=this.elementVertical.clientHeight+i,s=false,r=0,a=0,o=this.rows();if(t){r=this.vDomTop;a=this.vDomBottom}else{for(var h=this.vDomTop;h<=this.vDomBottom;h++){if(o[h]){if(!s){if(i-o[h].getElement().offsetTop>=0){r=h}else{s=true;if(e-o[h].getElement().offsetTop>=0){a=h}else{break}}}else{if(e-o[h].getElement().offsetTop>=0){a=h}else{break}}}}}return o.slice(r,a+1)}_virtualRenderFill(t,i,e){var s=this.tableElement,r=this.elementVertical,a=0,o=0,h=0,l=0,n=0,u=0,f=this.rows(),c=f.length,d=0,b,p,m=[],g=0,v=0,w=this.table.rowManager.fixedHeight,y=this.elementVertical.clientHeight,x=this.table.options.rowHeight,k=true;t=t||0;e=e||0;if(!t){this.clear()}else{while(s.firstChild)s.removeChild(s.firstChild);l=(c-t+1)*this.vDomRowHeight;if(l<y){t-=Math.ceil((y-l)/this.vDomRowHeight);if(t<0){t=0}}a=Math.min(Math.max(Math.floor(this.vDomWindowBuffer/this.vDomRowHeight),this.vDomWindowMinMarginRows),t);t-=a}if(c&&z.elVisible(this.elementVertical)){this.vDomTop=t;this.vDomBottom=t-1;if(w||this.table.options.maxHeight){if(x){v=y/x+this.vDomWindowBuffer/x}v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(v))}else{v=c}while((v==c||o<=y+this.vDomWindowBuffer||g<this.vDomWindowMinTotalRows)&&this.vDomBottom<c-1){m=[];p=document.createDocumentFragment();u=0;while(u<v&&this.vDomBottom<c-1){d=this.vDomBottom+1,b=f[d];this.styleRow(b,d);b.initialize(false,true);if(!b.heightInitialized&&!this.table.options.rowHeight){b.clearCellHeight()}p.appendChild(b.getElement());m.push(b);this.vDomBottom++;u++}if(!m.length){break}s.appendChild(p);m.forEach((t=>{t.rendered();if(!t.heightInitialized){t.calcHeight(true)}}));m.forEach((t=>{if(!t.heightInitialized){t.setCellHeight()}}));m.forEach((t=>{h=t.getHeight();if(g<a){n+=h}else{o+=h}if(h>this.vDomWindowBuffer){this.vDomWindowBuffer=h*2}g++}));k=this.table.rowManager.adjustTableSize();y=this.elementVertical.clientHeight;if(k&&(w||this.table.options.maxHeight)){x=o/g;v=Math.max(this.vDomWindowMinTotalRows,Math.ceil(y/x+this.vDomWindowBuffer/x))}}if(!t){this.vDomTopPad=0;this.vDomRowHeight=Math.floor((o+n)/g);this.vDomBottomPad=this.vDomRowHeight*(c-this.vDomBottom-1);this.vDomScrollHeight=n+o+this.vDomBottomPad-y}else{this.vDomTopPad=!i?this.scrollTop-n:this.vDomRowHeight*this.vDomTop+e;this.vDomBottomPad=this.vDomBottom==c-1?0:Math.max(this.vDomScrollHeight-this.vDomTopPad-o-n,0)}s.style.paddingTop=this.vDomTopPad+"px";s.style.paddingBottom=this.vDomBottomPad+"px";if(i){this.scrollTop=this.vDomTopPad+n+e-(this.elementVertical.scrollWidth>this.elementVertical.clientWidth?this.elementVertical.offsetHeight-y:0)}this.scrollTop=Math.min(this.scrollTop,this.elementVertical.scrollHeight-y);if(this.elementVertical.scrollWidth>this.elementVertical.clientWidth&&i){this.scrollTop+=this.elementVertical.offsetHeight-y}this.vDomScrollPosTop=this.scrollTop;this.vDomScrollPosBottom=this.scrollTop;r.scrollTop=this.scrollTop;this.dispatch("render-virtual-fill")}}_addTopRow(t,i){var e=this.tableElement,s=[],r=0,a=this.vDomTop-1,o=0,h=true;while(h){if(this.vDomTop){let l=t[a],n,u;if(l&&o<this.vDomMaxRenderChain){n=l.getHeight()||this.vDomRowHeight;u=l.initialized;if(i>=n){this.styleRow(l,a);e.insertBefore(l.getElement(),e.firstChild);if(!l.initialized||!l.heightInitialized){s.push(l)}l.initialize();if(!u){n=l.getElement().offsetHeight;if(n>this.vDomWindowBuffer){this.vDomWindowBuffer=n*2}}i-=n;r+=n;this.vDomTop--;a--;o++}else{h=false}}else{h=false}}else{h=false}}for(let t of s){t.clearCellHeight()}this._quickNormalizeRowHeight(s);if(r){this.vDomTopPad-=r;if(this.vDomTopPad<0){this.vDomTopPad=a*this.vDomRowHeight}if(a<1){this.vDomTopPad=0}e.style.paddingTop=this.vDomTopPad+"px";this.vDomScrollPosTop-=r}}_removeTopRow(t,i){var e=[],s=0,r=0,a=true;while(a){let o=t[this.vDomTop],h;if(o&&r<this.vDomMaxRenderChain){h=o.getHeight()||this.vDomRowHeight;if(i>=h){this.vDomTop++;i-=h;s+=h;e.push(o);r++}else{a=false}}else{a=false}}for(let t of e){let i=t.getElement();if(i.parentNode){i.parentNode.removeChild(i)}}if(s){this.vDomTopPad+=s;this.tableElement.style.paddingTop=this.vDomTopPad+"px";this.vDomScrollPosTop+=this.vDomTop?s:s+this.vDomWindowBuffer}}_addBottomRow(t,i){var e=this.tableElement,s=[],r=0,a=this.vDomBottom+1,o=0,h=true;while(h){let l=t[a],n,u;if(l&&o<this.vDomMaxRenderChain){n=l.getHeight()||this.vDomRowHeight;u=l.initialized;if(i>=n){this.styleRow(l,a);e.appendChild(l.getElement());if(!l.initialized||!l.heightInitialized){s.push(l)}l.initialize();if(!u){n=l.getElement().offsetHeight;if(n>this.vDomWindowBuffer){this.vDomWindowBuffer=n*2}}i-=n;r+=n;this.vDomBottom++;a++;o++}else{h=false}}else{h=false}}for(let t of s){t.clearCellHeight()}this._quickNormalizeRowHeight(s);if(r){this.vDomBottomPad-=r;if(this.vDomBottomPad<0||a==t.length-1){this.vDomBottomPad=0}e.style.paddingBottom=this.vDomBottomPad+"px";this.vDomScrollPosBottom+=r}}_removeBottomRow(t,i){var e=[],s=0,r=0,a=true;while(a){let o=t[this.vDomBottom],h;if(o&&r<this.vDomMaxRenderChain){h=o.getHeight()||this.vDomRowHeight;if(i>=h){this.vDomBottom--;i-=h;s+=h;e.push(o);r++}else{a=false}}else{a=false}}for(let t of e){let i=t.getElement();if(i.parentNode){i.parentNode.removeChild(i)}}if(s){this.vDomBottomPad+=s;if(this.vDomBottomPad<0){this.vDomBottomPad=0}this.tableElement.style.paddingBottom=this.vDomBottomPad+"px";this.vDomScrollPosBottom-=s}}_quickNormalizeRowHeight(t){for(let i of t){i.calcHeight()}for(let i of t){i.setCellHeight()}}}class Ne extends E{constructor(t){super(t);this.element=this.createHolderElement();this.tableElement=this.createTableElement();this.heightFixer=this.createTableElement();this.placeholder=null;this.placeholderContents=null;this.firstRender=false;this.renderMode="virtual";this.fixedHeight=false;this.rows=[];this.activeRowsPipeline=[];this.activeRows=[];this.activeRowsCount=0;this.displayRows=[];this.displayRowsCount=0;this.scrollTop=0;this.scrollLeft=0;this.redrawBlock=false;this.redrawBlockRestoreConfig=false;this.redrawBlockRenderInPosition=false;this.dataPipeline=[];this.displayPipeline=[];this.scrollbarWidth=0;this.renderer=null}createHolderElement(){var t=document.createElement("div");t.classList.add("tabulator-tableholder");t.setAttribute("tabindex",0);return t}createTableElement(){var t=document.createElement("div");t.classList.add("tabulator-table");t.setAttribute("role","rowgroup");return t}initializePlaceholder(){var t=this.table.options.placeholder;if(typeof t==="function"){t=t.call(this.table)}t=this.chain("placeholder",[t],t,t)||t;if(t){let i=document.createElement("div");i.classList.add("tabulator-placeholder");if(typeof t=="string"){let e=document.createElement("div");e.classList.add("tabulator-placeholder-contents");e.innerHTML=t;i.appendChild(e);this.placeholderContents=e}else if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement){i.appendChild(t);this.placeholderContents=t}else{console.warn("Invalid placeholder provided, must be string or HTML Element",t);this.el=null}this.placeholder=i}}getElement(){return this.element}getTableElement(){return this.tableElement}initialize(){this.initializePlaceholder();this.initializeRenderer();this.element.appendChild(this.tableElement);this.firstRender=true;this.element.addEventListener("scroll",(()=>{var t=this.element.scrollLeft,i=this.scrollLeft>t,e=this.element.scrollTop,s=this.scrollTop>e;if(this.scrollLeft!=t){this.scrollLeft=t;this.dispatch("scroll-horizontal",t,i);this.dispatchExternal("scrollHorizontal",t,i);this._positionPlaceholder()}if(this.scrollTop!=e){this.scrollTop=e;this.renderer.scrollRows(e,s);this.dispatch("scroll-vertical",e,s);this.dispatchExternal("scrollVertical",e,s)}}))}findRow(t){if(typeof t=="object"){if(t instanceof Y){return t}else if(t instanceof X){return t._getSelf()||false}else if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement){let i=this.rows.find((i=>i.getElement()===t));return i||false}else if(t===null){return false}}else if(typeof t=="undefined"){return false}else{let i=this.rows.find((i=>i.data[this.table.options.index]==t));return i||false}return false}getRowFromDataObject(t){var i=this.rows.find((i=>i.data===t));return i||false}getRowFromPosition(t){return this.getDisplayRows().find((i=>i.type==="row"&&i.getPosition()===t&&i.isDisplayed()))}scrollToRow(t,i,e){return this.renderer.scrollToRowPosition(t,i,e)}setData(t,i,e){return new Promise(((s,r)=>{if(i&&this.getDisplayRows().length){if(this.table.options.pagination){this._setDataActual(t,true)}else{this.reRenderInPosition((()=>{this._setDataActual(t)}))}}else{if(this.table.options.autoColumns&&e&&this.table.initialized){this.table.columnManager.generateColumnsFromRowData(t)}this.resetScroll();this._setDataActual(t)}s()}))}_setDataActual(t,i){this.dispatchExternal("dataProcessing",t);this._wipeElements();if(Array.isArray(t)){this.dispatch("data-processing",t);t.forEach(((t,i)=>{if(t&&typeof t==="object"){var e=new Y(t,this);this.rows.push(e)}else{console.warn("Data Loading Warning - Invalid row data detected and ignored, expecting object but received:",t)}}));this.refreshActiveData(false,false,i);this.dispatch("data-processed",t);this.dispatchExternal("dataProcessed",t)}else{console.error("Data Loading Error - Unable to process data due to invalid data type \nExpecting: array \nReceived: ",typeof t,"\nData: ",t)}}_wipeElements(){this.dispatch("rows-wipe");this.destroy();this.adjustTableSize();this.dispatch("rows-wiped")}destroy(){this.rows.forEach((t=>{t.wipe()}));this.rows=[];this.activeRows=[];this.activeRowsPipeline=[];this.activeRowsCount=0;this.displayRows=[];this.displayRowsCount=0}deleteRow(t,i){var e=this.rows.indexOf(t),s=this.activeRows.indexOf(t);if(s>-1){this.activeRows.splice(s,1)}if(e>-1){this.rows.splice(e,1)}this.setActiveRows(this.activeRows);this.displayRowIterator((i=>{var e=i.indexOf(t);if(e>-1){i.splice(e,1)}}));if(!i){this.reRenderInPosition()}this.regenerateRowPositions();this.dispatchExternal("rowDeleted",t.getComponent());if(!this.displayRowsCount){this.tableEmpty()}if(this.subscribedExternal("dataChanged")){this.dispatchExternal("dataChanged",this.getData())}}addRow(t,i,e,s){var r=this.addRowActual(t,i,e,s);return r}addRows(t,i,e,s){var r=[];return new Promise(((a,o)=>{i=this.findAddRowPos(i);if(!Array.isArray(t)){t=[t]}if(typeof e=="undefined"&&i||typeof e!=="undefined"&&!i){t.reverse()}t.forEach(((t,s)=>{var a=this.addRow(t,i,e,true);r.push(a);this.dispatch("row-added",a,t,i,e)}));this.refreshActiveData(s?"displayPipeline":false,false,true);this.regenerateRowPositions();if(this.displayRowsCount){this._clearPlaceholder()}a(r)}))}findAddRowPos(t){if(typeof t==="undefined"){t=this.table.options.addRowPos}if(t==="pos"){t=true}if(t==="bottom"){t=false}return t}addRowActual(t,i,e,s){var r=t instanceof Y?t:new Y(t||{},this),a=this.findAddRowPos(i),o=-1,h,l;if(!e){l=this.chain("row-adding-position",[r,a],null,{index:e,top:a});e=l.index;a=l.top}if(typeof e!=="undefined"){e=this.findRow(e)}e=this.chain("row-adding-index",[r,e,a],null,e);if(e){o=this.rows.indexOf(e)}if(e&&o>-1){h=this.activeRows.indexOf(e);this.displayRowIterator((function(t){var i=t.indexOf(e);if(i>-1){t.splice(a?i:i+1,0,r)}}));if(h>-1){this.activeRows.splice(a?h:h+1,0,r)}this.rows.splice(a?o:o+1,0,r)}else{if(a){this.displayRowIterator((function(t){t.unshift(r)}));this.activeRows.unshift(r);this.rows.unshift(r)}else{this.displayRowIterator((function(t){t.push(r)}));this.activeRows.push(r);this.rows.push(r)}}this.setActiveRows(this.activeRows);this.dispatchExternal("rowAdded",r.getComponent());if(this.subscribedExternal("dataChanged")){this.dispatchExternal("dataChanged",this.table.rowManager.getData())}if(!s){this.reRenderInPosition()}return r}moveRow(t,i,e){this.dispatch("row-move",t,i,e);this.moveRowActual(t,i,e);this.regenerateRowPositions();this.dispatch("row-moved",t,i,e);this.dispatchExternal("rowMoved",t.getComponent())}moveRowActual(t,i,e){this.moveRowInArray(this.rows,t,i,e);this.moveRowInArray(this.activeRows,t,i,e);this.displayRowIterator((s=>{this.moveRowInArray(s,t,i,e)}));this.dispatch("row-moving",t,i,e)}moveRowInArray(t,i,e,s){var r,a,o,h;if(i!==e){r=t.indexOf(i);if(r>-1){t.splice(r,1);a=t.indexOf(e);if(a>-1){if(s){t.splice(a+1,0,i)}else{t.splice(a,0,i)}}else{t.splice(r,0,i)}}if(t===this.getDisplayRows()){o=r<a?r:a;h=a>r?a:r+1;for(let i=o;i<=h;i++){if(t[i]){this.styleRow(t[i],i)}}}}}clearData(){this.setData([])}getRowIndex(t){return this.findRowIndex(t,this.rows)}getDisplayRowIndex(t){var i=this.getDisplayRows().indexOf(t);return i>-1?i:false}nextDisplayRow(t,i){var e=this.getDisplayRowIndex(t),s=false;if(e!==false&&e<this.displayRowsCount-1){s=this.getDisplayRows()[e+1]}if(s&&(!(s instanceof Y)||s.type!="row")){return this.nextDisplayRow(s,i)}return s}prevDisplayRow(t,i){var e=this.getDisplayRowIndex(t),s=false;if(e){s=this.getDisplayRows()[e-1]}if(i&&s&&(!(s instanceof Y)||s.type!="row")){return this.prevDisplayRow(s,i)}return s}findRowIndex(t,i){var e;t=this.findRow(t);if(t){e=i.indexOf(t);if(e>-1){return e}}return false}getData(t,i){var e=[],s=this.getRows(t);s.forEach((function(t){if(t.type=="row"){e.push(t.getData(i||"data"))}}));return e}getComponents(t){var i=[],e=this.getRows(t);e.forEach((function(t){i.push(t.getComponent())}));return i}getDataCount(t){var i=this.getRows(t);return i.length}scrollHorizontal(t){this.scrollLeft=t;this.element.scrollLeft=t;this.dispatch("scroll-horizontal",t)}registerDataPipelineHandler(t,i){if(typeof i!=="undefined"){this.dataPipeline.push({handler:t,priority:i});this.dataPipeline.sort(((t,i)=>t.priority-i.priority))}else{console.error("Data pipeline handlers must have a priority in order to be registered")}}registerDisplayPipelineHandler(t,i){if(typeof i!=="undefined"){this.displayPipeline.push({handler:t,priority:i});this.displayPipeline.sort(((t,i)=>t.priority-i.priority))}else{console.error("Display pipeline handlers must have a priority in order to be registered")}}refreshActiveData(t,i,e){var s=this.table,r="",a=0,o=["all","dataPipeline","display","displayPipeline","end"];if(!this.table.destroyed){if(typeof t==="function"){a=this.dataPipeline.findIndex((i=>i.handler===t));if(a>-1){r="dataPipeline";if(i){if(a==this.dataPipeline.length-1){r="display"}else{a++}}}else{a=this.displayPipeline.findIndex((i=>i.handler===t));if(a>-1){r="displayPipeline";if(i){if(a==this.displayPipeline.length-1){r="end"}else{a++}}}else{console.error("Unable to refresh data, invalid handler provided",t);return}}}else{r=t||"all";a=0}if(this.redrawBlock){if(!this.redrawBlockRestoreConfig||this.redrawBlockRestoreConfig&&(this.redrawBlockRestoreConfig.stage===r&&a<this.redrawBlockRestoreConfig.index||o.indexOf(r)<o.indexOf(this.redrawBlockRestoreConfig.stage))){this.redrawBlockRestoreConfig={handler:t,skipStage:i,renderInPosition:e,stage:r,index:a}}return}else{if(z.elVisible(this.element)){if(e){this.reRenderInPosition(this.refreshPipelines.bind(this,t,r,a,e))}else{this.refreshPipelines(t,r,a,e);if(!t){this.table.columnManager.renderer.renderColumns()}this.renderTable();if(s.options.layoutColumnsOnNewData){this.table.columnManager.redraw(true)}}}else{this.refreshPipelines(t,r,a,e)}this.dispatch("data-refreshed")}}}refreshPipelines(t,i,e,s){this.dispatch("data-refreshing");if(!t||!this.activeRowsPipeline[0]){this.activeRowsPipeline[0]=this.rows.slice(0)}switch(i){case"all":case"dataPipeline":for(let t=e;t<this.dataPipeline.length;t++){let i=this.dataPipeline[t].handler(this.activeRowsPipeline[t].slice(0));this.activeRowsPipeline[t+1]=i||this.activeRowsPipeline[t].slice(0)}this.setActiveRows(this.activeRowsPipeline[this.dataPipeline.length]);case"display":e=0;this.resetDisplayRows();case"displayPipeline":for(let t=e;t<this.displayPipeline.length;t++){let i=this.displayPipeline[t].handler((t?this.getDisplayRows(t-1):this.activeRows).slice(0),s);this.setDisplayRows(i||this.getDisplayRows(t-1).slice(0),t)}case"end":this.regenerateRowPositions()}if(this.getDisplayRows().length){this._clearPlaceholder()}}regenerateRowPositions(){var t=this.getDisplayRows();var i=1;t.forEach((t=>{if(t.type==="row"){t.setPosition(i);i++}}))}setActiveRows(t){this.activeRows=this.activeRows=Object.assign([],t);this.activeRowsCount=this.activeRows.length}resetDisplayRows(){this.displayRows=[];this.displayRows.push(this.activeRows.slice(0));this.displayRowsCount=this.displayRows[0].length}setDisplayRows(t,i){this.displayRows[i]=t;if(i==this.displayRows.length-1){this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}}getDisplayRows(t){if(typeof t=="undefined"){return this.displayRows.length?this.displayRows[this.displayRows.length-1]:[]}else{return this.displayRows[t]||[]}}getVisibleRows(t,i){var e=Object.assign([],this.renderer.visibleRows(!i));if(t){e=this.chain("rows-visible",[i],e,e)}return e}displayRowIterator(t){this.activeRowsPipeline.forEach(t);this.displayRows.forEach(t);this.displayRowsCount=this.displayRows[this.displayRows.length-1].length}getRows(t){var i=[];switch(t){case"active":i=this.activeRows;break;case"display":i=this.table.rowManager.getDisplayRows();break;case"visible":i=this.getVisibleRows(false,true);break;default:i=this.chain("rows-retrieve",t,null,this.rows)||this.rows}return i}reRenderInPosition(t){if(this.redrawBlock){if(t){t()}else{this.redrawBlockRenderInPosition=true}}else{this.dispatchExternal("renderStarted");this.renderer.rerenderRows(t);if(!this.fixedHeight){this.adjustTableSize()}this.scrollBarCheck();this.dispatchExternal("renderComplete")}}scrollBarCheck(){var t=0;if(this.element.scrollHeight>this.element.clientHeight){t=this.element.offsetWidth-this.element.clientWidth}if(t!==this.scrollbarWidth){this.scrollbarWidth=t;this.dispatch("scrollbar-vertical",t)}}initializeRenderer(){var t;var i={virtual:je,basic:Fe};if(typeof this.table.options.renderVertical==="string"){t=i[this.table.options.renderVertical]}else{t=this.table.options.renderVertical}if(t){this.renderMode=this.table.options.renderVertical;this.renderer=new t(this.table,this.element,this.tableElement);this.renderer.initialize();if((this.table.element.clientHeight||this.table.options.height)&&!(this.table.options.minHeight&&this.table.options.maxHeight)){this.fixedHeight=true}else{this.fixedHeight=false}}else{console.error("Unable to find matching renderer:",this.table.options.renderVertical)}}getRenderMode(){return this.renderMode}renderTable(){this.dispatchExternal("renderStarted");this.element.scrollTop=0;this._clearTable();if(this.displayRowsCount){this.renderer.renderRows();if(this.firstRender){this.firstRender=false;if(!this.fixedHeight){this.adjustTableSize()}this.layoutRefresh(true)}}else{this.renderEmptyScroll()}if(!this.fixedHeight){this.adjustTableSize()}this.dispatch("table-layout");if(!this.displayRowsCount){this._showPlaceholder()}this.scrollBarCheck();this.dispatchExternal("renderComplete")}renderEmptyScroll(){if(this.placeholder){this.tableElement.style.display="none"}else{this.tableElement.style.minWidth=this.table.columnManager.getWidth()+"px"}}_clearTable(){this._clearPlaceholder();this.scrollTop=0;this.scrollLeft=0;this.renderer.clearRows()}tableEmpty(){this.renderEmptyScroll();this._showPlaceholder()}checkPlaceholder(){if(this.displayRowsCount){this._clearPlaceholder()}else{this.tableEmpty()}}_showPlaceholder(){if(this.placeholder){if(this.placeholder&&this.placeholder.parentNode){this.placeholder.parentNode.removeChild(this.placeholder)}this.initializePlaceholder();this.placeholder.setAttribute("tabulator-render-mode",this.renderMode);this.getElement().appendChild(this.placeholder);this._positionPlaceholder();this.adjustTableSize()}}_clearPlaceholder(){if(this.placeholder&&this.placeholder.parentNode){this.placeholder.parentNode.removeChild(this.placeholder)}this.tableElement.style.minWidth="";this.tableElement.style.display=""}_positionPlaceholder(){if(this.placeholder&&this.placeholder.parentNode){this.placeholder.style.width=this.table.columnManager.getWidth()+"px";this.placeholderContents.style.width=this.table.rowManager.element.clientWidth+"px";this.placeholderContents.style.marginLeft=this.scrollLeft+"px"}}styleRow(t,i){var e=t.getElement();if(i%2){e.classList.add("tabulator-row-even");e.classList.remove("tabulator-row-odd")}else{e.classList.add("tabulator-row-odd");e.classList.remove("tabulator-row-even")}}normalizeHeight(t){this.activeRows.forEach((function(i){i.normalizeHeight(t)}))}adjustTableSize(){let t=this.element.clientHeight,i;let e=false;if(this.renderer.verticalFillMode==="fill"){let s=Math.floor(this.table.columnManager.getElement().getBoundingClientRect().height+(this.table.footerManager&&this.table.footerManager.active&&!this.table.footerManager.external?this.table.footerManager.getElement().getBoundingClientRect().height:0));if(this.fixedHeight){i=isNaN(this.table.options.minHeight)?this.table.options.minHeight:this.table.options.minHeight+"px";const t="calc(100% - "+s+"px)";this.element.style.minHeight=i||"calc(100% - "+s+"px)";this.element.style.height=t;this.element.style.maxHeight=t}else{this.element.style.height="";this.element.style.height=this.table.element.clientHeight-s+"px";this.element.scrollTop=this.scrollTop}this.renderer.resize();if(!this.fixedHeight&&t!=this.element.clientHeight){e=true;if(this.subscribed("table-resize")){this.dispatch("table-resize")}else{this.redraw()}}this.scrollBarCheck()}this._positionPlaceholder();return e}reinitialize(){this.rows.forEach((function(t){t.reinitialize(true)}))}blockRedraw(){this.redrawBlock=true;this.redrawBlockRestoreConfig=false}restoreRedraw(){this.redrawBlock=false;if(this.redrawBlockRestoreConfig){this.refreshActiveData(this.redrawBlockRestoreConfig.handler,this.redrawBlockRestoreConfig.skipStage,this.redrawBlockRestoreConfig.renderInPosition);this.redrawBlockRestoreConfig=false}else{if(this.redrawBlockRenderInPosition){this.reRenderInPosition()}}this.redrawBlockRenderInPosition=false}redraw(t){this.adjustTableSize();this.table.tableWidth=this.table.element.clientWidth;if(!t){this.reRenderInPosition();this.scrollHorizontal(this.scrollLeft)}else{this.renderTable()}}resetScroll(){this.element.scrollLeft=0;this.element.scrollTop=0;if(this.table.browser==="ie"){var t=document.createEvent("Event");t.initEvent("scroll",false,true);this.element.dispatchEvent(t)}else{this.element.dispatchEvent(new Event("scroll"))}}}class Oe extends E{constructor(t){super(t);this.active=false;this.element=this.createElement();this.containerElement=this.createContainerElement();this.external=false}initialize(){this.initializeElement()}createElement(){var t=document.createElement("div");t.classList.add("tabulator-footer");return t}createContainerElement(){var t=document.createElement("div");t.classList.add("tabulator-footer-contents");this.element.appendChild(t);return t}initializeElement(){if(this.table.options.footerElement){switch(typeof this.table.options.footerElement){case"string":if(this.table.options.footerElement[0]==="<"){this.containerElement.innerHTML=this.table.options.footerElement}else{this.external=true;this.containerElement=document.querySelector(this.table.options.footerElement)}break;default:this.element=this.table.options.footerElement;break}}}getElement(){return this.element}append(t){this.activate();this.containerElement.appendChild(t);this.table.rowManager.adjustTableSize()}prepend(t){this.activate();this.element.insertBefore(t,this.element.firstChild);this.table.rowManager.adjustTableSize()}remove(t){t.parentNode.removeChild(t);this.deactivate()}deactivate(t){if(!this.element.firstChild||t){if(!this.external){this.element.parentNode.removeChild(this.element)}this.active=false}}activate(){if(!this.active){this.active=true;if(!this.external){this.table.element.appendChild(this.getElement());this.table.element.style.display=""}}}redraw(){this.dispatch("footer-redraw")}}class He extends E{constructor(t){super(t);this.el=null;this.abortClasses=["tabulator-headers","tabulator-table"];this.previousTargets={};this.listeners=["click","dblclick","contextmenu","mouseenter","mouseleave","mouseover","mouseout","mousemove","mouseup","mousedown","touchstart","touchend"];this.componentMap={"tabulator-cell":"cell","tabulator-row":"row","tabulator-group":"group","tabulator-col":"column"};this.pseudoTrackers={row:{subscriber:null,target:null},cell:{subscriber:null,target:null},group:{subscriber:null,target:null},column:{subscriber:null,target:null}};this.pseudoTracking=false}initialize(){this.el=this.table.element;this.buildListenerMap();this.bindSubscriptionWatchers()}buildListenerMap(){var t={};this.listeners.forEach((i=>{t[i]={handler:null,components:[]}}));this.listeners=t}bindPseudoEvents(){Object.keys(this.pseudoTrackers).forEach((t=>{this.pseudoTrackers[t].subscriber=this.pseudoMouseEnter.bind(this,t);this.subscribe(t+"-mouseover",this.pseudoTrackers[t].subscriber)}));this.pseudoTracking=true}pseudoMouseEnter(t,i,e){if(this.pseudoTrackers[t].target!==e){if(this.pseudoTrackers[t].target){this.dispatch(t+"-mouseleave",i,this.pseudoTrackers[t].target)}this.pseudoMouseLeave(t,i);this.pseudoTrackers[t].target=e;this.dispatch(t+"-mouseenter",i,e)}}pseudoMouseLeave(t,i){var e=Object.keys(this.pseudoTrackers),s={row:["cell"],cell:["row"]};e=e.filter((i=>{var e=s[t];return i!==t&&(!e||e&&!e.includes(i))}));e.forEach((t=>{var e=this.pseudoTrackers[t].target;if(this.pseudoTrackers[t].target){this.dispatch(t+"-mouseleave",i,e);this.pseudoTrackers[t].target=null}}))}bindSubscriptionWatchers(){var t=Object.keys(this.listeners),i=Object.values(this.componentMap);for(let e of i){for(let i of t){let t=e+"-"+i;this.subscriptionChange(t,this.subscriptionChanged.bind(this,e,i))}}this.subscribe("table-destroy",this.clearWatchers.bind(this))}subscriptionChanged(t,i,e){var s=this.listeners[i].components,r=s.indexOf(t),a=false;if(e){if(r===-1){s.push(t);a=true}}else{if(!this.subscribed(t+"-"+i)){if(r>-1){s.splice(r,1);a=true}}}if((i==="mouseenter"||i==="mouseleave")&&!this.pseudoTracking){this.bindPseudoEvents()}if(a){this.updateEventListeners()}}updateEventListeners(){for(let t in this.listeners){let i=this.listeners[t];if(i.components.length){if(!i.handler){i.handler=this.track.bind(this,t);this.el.addEventListener(t,i.handler)}}else{if(i.handler){this.el.removeEventListener(t,i.handler);i.handler=null}}}}track(t,i){var e=i.composedPath&&i.composedPath()||i.path;var s=this.findTargets(e);s=this.bindComponents(t,s);this.triggerEvents(t,i,s);if(this.pseudoTracking&&(t=="mouseover"||t=="mouseleave")&&!Object.keys(s).length){this.pseudoMouseLeave("none",i)}}findTargets(t){var i={};let e=Object.keys(this.componentMap);for(let s of t){let t=s.classList?[...s.classList]:[];let r=t.filter((t=>this.abortClasses.includes(t)));if(r.length){break}let a=t.filter((t=>e.includes(t)));for(let t of a){if(!i[this.componentMap[t]]){i[this.componentMap[t]]=s}}}if(i.group&&i.group===i.row){delete i.row}return i}bindComponents(t,i){var e=Object.keys(i).reverse(),s=this.listeners[t],r={},a={},o={};for(let t of e){let e,a=i[t],h=this.previousTargets[t];if(h&&h.target===a){e=h.component}else{switch(t){case"row":case"group":if(s.components.includes("row")||s.components.includes("cell")||s.components.includes("group")){let s=this.table.rowManager.getVisibleRows(true);e=s.find((t=>t.getElement()===a));if(i["row"]&&i["row"].parentNode&&i["row"].parentNode.closest(".tabulator-row")){i[t]=false}}break;case"column":if(s.components.includes("column")){e=this.table.columnManager.findColumn(a)}break;case"cell":if(s.components.includes("cell")){if(r["row"]instanceof Y){e=r["row"].findCell(a)}else{if(i["row"]){console.warn("Event Target Lookup Error - The row this cell is attached to cannot be found, has the table been reinitialized without being destroyed first?")}}}break}}if(e){r[t]=e;o[t]={target:a,component:e}}}this.previousTargets=o;Object.keys(i).forEach((t=>{let i=r[t];a[t]=i}));return a}triggerEvents(t,i,e){var s=this.listeners[t];for(let r in e){if(e[r]&&s.components.includes(r)){this.dispatch(r+"-"+t,i,e[r])}}}clearWatchers(){for(let t in this.listeners){let i=this.listeners[t];if(i.handler){this.el.removeEventListener(t,i.handler);i.handler=null}}}}class _e{constructor(t){this.table=t;this.bindings={}}bind(t,i,e){if(!this.bindings[t]){this.bindings[t]={}}if(this.bindings[t][i]){console.warn("Unable to bind component handler, a matching function name is already bound",t,i,e)}else{this.bindings[t][i]=e}}handle(t,i,e){if(this.bindings[t]&&this.bindings[t][e]&&typeof this.bindings[t][e].bind==="function"){return this.bindings[t][e].bind(null,i)}else{if(e!=="then"&&typeof e==="string"&&!e.startsWith("_")){if(this.table.options.debugInvalidComponentFuncs){console.error("The "+t+" component does not have a "+e+" function, have you checked that you have the correct Tabulator module installed?")}}}}}class Le extends E{constructor(t){super(t);this.requestOrder=0;this.loading=false}initialize(){}load(t,i,e,s,r,a){var o=++this.requestOrder;if(this.table.destroyed){return Promise.resolve()}this.dispatchExternal("dataLoading",t);if(t&&(t.indexOf("{")==0||t.indexOf("[")==0)){t=JSON.parse(t)}if(this.confirm("data-loading",[t,i,e,r])){this.loading=true;if(!r){this.alertLoader()}i=this.chain("data-params",[t,e,r],i||{},i||{});i=this.mapParams(i,this.table.options.dataSendParams);var h=this.chain("data-load",[t,i,e,r],false,Promise.resolve([]));return h.then((t=>{if(!this.table.destroyed){if(!Array.isArray(t)&&typeof t=="object"){t=this.mapParams(t,this.objectInvert(this.table.options.dataReceiveParams))}var i=this.chain("data-loaded",[t],null,t);if(o==this.requestOrder){this.clearAlert();if(i!==false){this.dispatchExternal("dataLoaded",i);this.table.rowManager.setData(i,s,typeof a==="undefined"?!s:a)}}else{console.warn("Data Load Response Blocked - An active data load request was blocked by an attempt to change table data while the request was being made")}}else{console.warn("Data Load Response Blocked - Table has been destroyed")}})).catch((t=>{console.error("Data Load Error: ",t);this.dispatchExternal("dataLoadError",t);if(!r){this.alertError()}setTimeout((()=>{this.clearAlert()}),this.table.options.dataLoaderErrorTimeout)})).finally((()=>{this.loading=false}))}else{this.dispatchExternal("dataLoaded",t);if(!t){t=[]}this.table.rowManager.setData(t,s,typeof a==="undefined"?!s:a);return Promise.resolve()}}mapParams(t,i){var e={};for(let s in t){e[i.hasOwnProperty(s)?i[s]:s]=t[s]}return e}objectInvert(t){var i={};for(let e in t){i[t[e]]=e}return i}blockActiveLoad(){this.requestOrder++}alertLoader(){var t=typeof this.table.options.dataLoader==="function"?this.table.options.dataLoader():this.table.options.dataLoader;if(t){this.table.alertManager.alert(this.table.options.dataLoaderLoading||this.langText("data|loading"))}}alertError(){this.table.alertManager.alert(this.table.options.dataLoaderError||this.langText("data|error"),"error")}clearAlert(){this.table.alertManager.clear()}}class Ae{constructor(t,i,e){this.table=t;this.events={};this.optionsList=i||{};this.subscriptionNotifiers={};this.dispatch=e?this._debugDispatch.bind(this):this._dispatch.bind(this);this.debug=e}subscriptionChange(t,i){if(!this.subscriptionNotifiers[t]){this.subscriptionNotifiers[t]=[]}this.subscriptionNotifiers[t].push(i);if(this.subscribed(t)){this._notifySubscriptionChange(t,true)}}subscribe(t,i){if(!this.events[t]){this.events[t]=[]}this.events[t].push(i);this._notifySubscriptionChange(t,true)}unsubscribe(t,i){var e;if(this.events[t]){if(i){e=this.events[t].findIndex((t=>t===i));if(e>-1){this.events[t].splice(e,1)}else{console.warn("Cannot remove event, no matching event found:",t,i);return}}else{delete this.events[t]}}else{console.warn("Cannot remove event, no events set on:",t);return}this._notifySubscriptionChange(t,false)}subscribed(t){return this.events[t]&&this.events[t].length}_notifySubscriptionChange(t,i){var e=this.subscriptionNotifiers[t];if(e){e.forEach((t=>{t(i)}))}}_dispatch(){var t=Array.from(arguments),i=t.shift(),e;if(this.events[i]){this.events[i].forEach(((i,s)=>{let r=i.apply(this.table,t);if(!s){e=r}}))}return e}_debugDispatch(){var t=Array.from(arguments),i=t[0];t[0]="ExternalEvent:"+t[0];if(this.debug===true||this.debug.includes(i)){console.log(...t)}return this._dispatch(...arguments)}}class Ie{constructor(t){this.events={};this.subscriptionNotifiers={};this.dispatch=t?this._debugDispatch.bind(this):this._dispatch.bind(this);this.chain=t?this._debugChain.bind(this):this._chain.bind(this);this.confirm=t?this._debugConfirm.bind(this):this._confirm.bind(this);this.debug=t}subscriptionChange(t,i){if(!this.subscriptionNotifiers[t]){this.subscriptionNotifiers[t]=[]}this.subscriptionNotifiers[t].push(i);if(this.subscribed(t)){this._notifySubscriptionChange(t,true)}}subscribe(t,i,e=1e4){if(!this.events[t]){this.events[t]=[]}this.events[t].push({callback:i,priority:e});this.events[t].sort(((t,i)=>t.priority-i.priority));this._notifySubscriptionChange(t,true)}unsubscribe(t,i){var e;if(this.events[t]){if(i){e=this.events[t].findIndex((t=>t.callback===i));if(e>-1){this.events[t].splice(e,1)}else{console.warn("Cannot remove event, no matching event found:",t,i);return}}}else{console.warn("Cannot remove event, no events set on:",t);return}this._notifySubscriptionChange(t,false)}subscribed(t){return this.events[t]&&this.events[t].length}_chain(t,i,e,s){var r=e;if(!Array.isArray(i)){i=[i]}if(this.subscribed(t)){this.events[t].forEach(((t,e)=>{r=t.callback.apply(this,i.concat([r]))}));return r}else{return typeof s==="function"?s():s}}_confirm(t,i){var e=false;if(!Array.isArray(i)){i=[i]}if(this.subscribed(t)){this.events[t].forEach(((t,s)=>{if(t.callback.apply(this,i)){e=true}}))}return e}_notifySubscriptionChange(t,i){var e=this.subscriptionNotifiers[t];if(e){e.forEach((t=>{t(i)}))}}_dispatch(){var t=Array.from(arguments),i=t.shift();if(this.events[i]){this.events[i].forEach((i=>{i.callback.apply(this,t)}))}}_debugDispatch(){var t=Array.from(arguments),i=t[0];t[0]="InternalEvent:"+i;if(this.debug===true||this.debug.includes(i)){console.log(...t)}return this._dispatch(...arguments)}_debugChain(){var t=Array.from(arguments),i=t[0];t[0]="InternalEvent:"+i;if(this.debug===true||this.debug.includes(i)){console.log(...t)}return this._chain(...arguments)}_debugConfirm(){var t=Array.from(arguments),i=t[0];t[0]="InternalEvent:"+i;if(this.debug===true||this.debug.includes(i)){console.log(...t)}return this._confirm(...arguments)}}class Ve extends E{constructor(t){super(t)}_warnUser(){if(this.options("debugDeprecation")){console.warn(...arguments)}}check(t,i,e){var s="";if(typeof this.options(t)!=="undefined"){s="Deprecated Setup Option - Use of the %c"+t+"%c option is now deprecated";if(i){s=s+", Please use the %c"+i+"%c option instead";this._warnUser(s,"font-weight: bold;","font-weight: normal;","font-weight: bold;","font-weight: normal;");if(e){this.table.options[i]=this.table.options[t]}}else{this._warnUser(s,"font-weight: bold;","font-weight: normal;")}return false}else{return true}}checkMsg(t,i){if(typeof this.options(t)!=="undefined"){this._warnUser("%cDeprecated Setup Option - Use of the %c"+t+" %c option is now deprecated, "+i,"font-weight: normal;","font-weight: bold;","font-weight: normal;");return false}else{return true}}msg(t){this._warnUser(t)}}class Ue extends E{constructor(t){super(t);this.deps={};this.props={}}initialize(){this.deps=Object.assign({},this.options("dependencies"))}lookup(t,i,e){if(Array.isArray(t)){for(const e of t){var s=this.lookup(e,i,true);if(s){break}}if(s){return s}else{this.error(t)}}else{if(i){return this.lookupProp(t,i,e)}else{return this.lookupKey(t,e)}}}lookupProp(t,i,e){var s;if(this.props[t]&&this.props[t][i]){return this.props[t][i]}else{s=this.lookupKey(t,e);if(s){if(!this.props[t]){this.props[t]={}}this.props[t][i]=s[i]||s;return this.props[t][i]}}}lookupKey(t,i){var e;if(this.deps[t]){e=this.deps[t]}else if(window[t]){this.deps[t]=window[t];e=this.deps[t]}else{if(!i){this.error(t)}}return e}error(t){console.error("Unable to find dependency",t,"Please check documentation and ensure you have imported the required library into your project")}}function Be(t,i){if(i){this.table.columnManager.renderer.reinitializeColumnWidths(t)}if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",true)){this.table.modules.responsiveLayout.update()}}function Ge(t,i){t.forEach((function(t){t.reinitializeWidth()}));if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",true)){this.table.modules.responsiveLayout.update()}}function We(t,i){var e=0,s=this.table.rowManager.element.clientWidth,r=0,a=false;t.forEach(((t,i)=>{if(!t.widthFixed){t.reinitializeWidth()}if(this.table.options.responsiveLayout?t.modules.responsive.visible:t.visible){a=t}if(t.visible){e+=t.getWidth()}}));if(a){r=s-e+a.getWidth();if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",true)){a.setWidth(0);this.table.modules.responsiveLayout.update()}if(r>0){a.setWidth(r)}else{a.reinitializeWidth()}}else{if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",true)){this.table.modules.responsiveLayout.update()}}}function Je(t,i){var e=this.table.rowManager.element.getBoundingClientRect().width;var s=0;var r=0;var a=0;var o=0;var h=[];var l=[];var n=0;var u=0;var f=0;function c(t){var i;if(typeof t=="string"){if(t.indexOf("%")>-1){i=e/100*parseInt(t)}else{i=parseInt(t)}}else{i=t}return i}function d(t,i,e,s){var r=[],o=0,h=0,l=0,n=a,u=0,f=0,b=[];function p(t){return e*(t.column.definition.widthGrow||1)}function m(t){return c(t.width)-e*(t.column.definition.widthShrink||0)}t.forEach((function(t,a){var o=s?m(t):p(t);if(t.column.minWidth>=o){r.push(t)}else{if(t.column.maxWidth&&t.column.maxWidth<o){t.width=t.column.maxWidth;i-=t.column.maxWidth;n-=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1;if(n){e=Math.floor(i/n)}}else{b.push(t);f+=s?t.column.definition.widthShrink||1:t.column.definition.widthGrow||1}}}));if(r.length){r.forEach((function(t){o+=s?t.width-t.column.minWidth:t.column.minWidth;t.width=t.column.minWidth}));h=i-o;l=f?Math.floor(h/f):h;u=d(b,h,l,s)}else{u=f?i-Math.floor(i/f)*f:i;b.forEach((function(t){t.width=s?m(t):p(t)}))}return u}if(this.table.options.responsiveLayout&&this.table.modExists("responsiveLayout",true)){this.table.modules.responsiveLayout.update()}if(this.table.rowManager.element.scrollHeight>this.table.rowManager.element.clientHeight){e-=this.table.rowManager.element.offsetWidth-this.table.rowManager.element.clientWidth}t.forEach((function(t){var i,e,r;if(t.visible){i=t.definition.width;e=parseInt(t.minWidth);if(i){r=c(i);s+=r>e?r:e;if(t.definition.widthShrink){l.push({column:t,width:r>e?r:e});n+=t.definition.widthShrink}}else{h.push({column:t,width:0});a+=t.definition.widthGrow||1}}}));r=e-s;o=Math.floor(r/a);f=d(h,r,o,false);if(h.length&&f>0){h[h.length-1].width+=f}h.forEach((function(t){r-=t.width}));u=Math.abs(f)+r;if(u>0&&n){f=d(l,u,Math.floor(u/n),true)}if(f&&l.length){l[l.length-1].width-=f}h.forEach((function(t){t.column.setWidth(t.width)}));l.forEach((function(t){t.column.setWidth(t.width)}))}var qe={fitData:Be,fitDataFill:Ge,fitDataTable:Ge,fitDataStretch:We,fitColumns:Je};class Ke extends S{static moduleName="layout";static modes=qe;constructor(t){super(t,"layout");this.mode=null;this.registerTableOption("layout","fitData");this.registerTableOption("layoutColumnsOnNewData",false);this.registerColumnOption("widthGrow");this.registerColumnOption("widthShrink")}initialize(){var t=this.table.options.layout;if(Ke.modes[t]){this.mode=t}else{console.warn("Layout Error - invalid mode set, defaulting to 'fitData' : "+t);this.mode="fitData"}this.table.element.setAttribute("tabulator-layout",this.mode);this.subscribe("column-init",this.initializeColumn.bind(this))}initializeColumn(t){if(t.definition.widthGrow){t.definition.widthGrow=Number(t.definition.widthGrow)}if(t.definition.widthShrink){t.definition.widthShrink=Number(t.definition.widthShrink)}}getMode(){return this.mode}layout(t){var i=this.table.columnManager.columnsByIndex.find((t=>t.definition.variableHeight||t.definition.formatter==="textarea"));this.dispatch("layout-refreshing");Ke.modes[this.mode].call(this,this.table.columnManager.columnsByIndex,t);if(i){this.table.rowManager.normalizeHeight(true)}this.dispatch("layout-refreshed")}}var Ze={default:{groups:{item:"item",items:"items"},columns:{},data:{loading:"Loading",error:"Error"},pagination:{page_size:"Page Size",page_title:"Show Page",first:"First",first_title:"First Page",last:"Last",last_title:"Last Page",prev:"Prev",prev_title:"Prev Page",next:"Next",next_title:"Next Page",all:"All",counter:{showing:"Showing",of:"of",rows:"rows",pages:"pages"}},headerFilters:{default:"filter column...",columns:{}}}};class $e extends S{static moduleName="localize";static langs=Ze;constructor(t){super(t);this.locale="default";this.lang=false;this.bindings={};this.langList={};this.registerTableOption("locale",false);this.registerTableOption("langs",{})}initialize(){this.langList=z.deepClone($e.langs);if(this.table.options.columnDefaults.headerFilterPlaceholder!==false){this.setHeaderFilterPlaceholder(this.table.options.columnDefaults.headerFilterPlaceholder)}for(let t in this.table.options.langs){this.installLang(t,this.table.options.langs[t])}this.setLocale(this.table.options.locale);this.registerTableFunction("setLocale",this.setLocale.bind(this));this.registerTableFunction("getLocale",this.getLocale.bind(this));this.registerTableFunction("getLang",this.getLang.bind(this))}setHeaderFilterPlaceholder(t){this.langList.default.headerFilters.default=t}installLang(t,i){if(this.langList[t]){this._setLangProp(this.langList[t],i)}else{this.langList[t]=i}}_setLangProp(t,i){for(let e in i){if(t[e]&&typeof t[e]=="object"){this._setLangProp(t[e],i[e])}else{t[e]=i[e]}}}setLocale(t){t=t||"default";function i(t,e){for(var s in t){if(typeof t[s]=="object"){if(!e[s]){e[s]={}}i(t[s],e[s])}else{e[s]=t[s]}}}if(t===true&&navigator.language){t=navigator.language.toLowerCase()}if(t){if(!this.langList[t]){let i=t.split("-")[0];if(this.langList[i]){console.warn("Localization Error - Exact matching locale not found, using closest match: ",t,i);t=i}else{console.warn("Localization Error - Matching locale not found, using default: ",t);t="default"}}}this.locale=t;this.lang=z.deepClone(this.langList.default||{});if(t!="default"){i(this.langList[t],this.lang)}this.dispatchExternal("localized",this.locale,this.lang);this._executeBindings()}getLocale(t){return this.locale}getLang(t){return t?this.langList[t]:this.lang}getText(t,i){var e=i?t+"|"+i:t,s=e.split("|"),r=this._getLangElement(s,this.locale);return r||""}_getLangElement(t,i){var e=this.lang;t.forEach((function(t){var i;if(e){i=e[t];if(typeof i!="undefined"){e=i}else{e=false}}}));return e}bind(t,i){if(!this.bindings[t]){this.bindings[t]=[]}this.bindings[t].push(i);i(this.getText(t),this.lang)}_executeBindings(){for(let t in this.bindings){this.bindings[t].forEach((i=>{i(this.getText(t),this.lang)}))}}}class Xe extends S{static moduleName="comms";constructor(t){super(t)}initialize(){this.registerTableFunction("tableComms",this.receive.bind(this))}getConnections(t){var i=[],e;e=this.table.constructor.registry.lookupTable(t);e.forEach((t=>{if(this.table!==t){i.push(t)}}));return i}send(t,i,e,s){var r=this.getConnections(t);r.forEach((t=>{t.tableComms(this.table.element,i,e,s)}));if(!r.length&&t){console.warn("Table Connection Error - No tables matching selector found",t)}}receive(t,i,e,s){if(this.table.modExists(i)){return this.table.modules[i].commsReceived(t,e,s)}else{console.warn("Inter-table Comms Error - no such module:",i)}}}var Ye=Object.freeze({__proto__:null,CommsModule:Xe,LayoutModule:Ke,LocalizeModule:$e});class Qe{static registry={tables:[],register(t){Qe.registry.tables.push(t)},deregister(t){var i=Qe.registry.tables.indexOf(t);if(i>-1){Qe.registry.tables.splice(i,1)}},lookupTable(t,i){var e=[],s,r;if(typeof t==="string"){s=document.querySelectorAll(t);if(s.length){for(var a=0;a<s.length;a++){r=Qe.registry.matchElement(s[a]);if(r){e.push(r)}}}}else if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement||t instanceof Qe){r=Qe.registry.matchElement(t);if(r){e.push(r)}}else if(Array.isArray(t)){t.forEach((function(t){e=e.concat(Qe.registry.lookupTable(t))}))}else{if(!i){console.warn("Table Connection Error - Invalid Selector",t)}}return e},matchElement(t){return Qe.registry.tables.find((function(i){return t instanceof Qe?i===t:i.element===t}))}};static findTable(t){var i=Qe.registry.lookupTable(t,true);return Array.isArray(i)&&!i.length?false:i}}class ts extends Qe{static moduleBindings={};static moduleExtensions={};static modulesRegistered=false;static defaultModules=false;constructor(){super()}static initializeModuleBinder(t){if(!ts.modulesRegistered){ts.modulesRegistered=true;ts._registerModules(Ye,true);if(t){ts._registerModules(t)}}}static _extendModule(t,i,e){if(ts.moduleBindings[t]){var s=ts.moduleBindings[t][i];if(s){if(typeof e=="object"){for(let t in e){s[t]=e[t]}}else{console.warn("Module Error - Invalid value type, it must be an object")}}else{console.warn("Module Error - property does not exist:",i)}}else{console.warn("Module Error - module does not exist:",t)}}static _registerModules(t,i){var e=Object.values(t);if(i){e.forEach((t=>{t.prototype.moduleCore=true}))}ts._registerModule(e)}static _registerModule(t){if(!Array.isArray(t)){t=[t]}t.forEach((t=>{ts._registerModuleBinding(t);ts._registerModuleExtensions(t)}))}static _registerModuleBinding(t){if(t.moduleName){ts.moduleBindings[t.moduleName]=t}else{console.error("Unable to bind module, no moduleName defined",t.moduleName)}}static _registerModuleExtensions(t){var i=t.moduleExtensions;if(t.moduleExtensions){for(let t in i){let e=i[t];if(ts.moduleBindings[t]){for(let i in e){ts._extendModule(t,i,e[i])}}else{if(!ts.moduleExtensions[t]){ts.moduleExtensions[t]={}}for(let i in e){if(!ts.moduleExtensions[t][i]){ts.moduleExtensions[t][i]={}}Object.assign(ts.moduleExtensions[t][i],e[i])}}}}ts._extendModuleFromQueue(t)}static _extendModuleFromQueue(t){var i=ts.moduleExtensions[t.moduleName];if(i){for(let e in i){ts._extendModule(t.moduleName,e,i[e])}}}_bindModules(){var t=[],i=[],e=[];this.modules={};for(var s in ts.moduleBindings){let r=ts.moduleBindings[s];let a=new r(this);this.modules[s]=a;if(r.prototype.moduleCore){this.modulesCore.push(a)}else{if(r.moduleInitOrder){if(r.moduleInitOrder<0){t.push(a)}else{i.push(a)}}else{e.push(a)}}}t.sort(((t,i)=>t.moduleInitOrder>i.moduleInitOrder?1:-1));i.sort(((t,i)=>t.moduleInitOrder>i.moduleInitOrder?1:-1));this.modulesRegular=t.concat(e.concat(i))}}class is extends E{constructor(t){super(t);this.element=this._createAlertElement();this.msgElement=this._createMsgElement();this.type=null;this.element.appendChild(this.msgElement)}_createAlertElement(){var t=document.createElement("div");t.classList.add("tabulator-alert");return t}_createMsgElement(){var t=document.createElement("div");t.classList.add("tabulator-alert-msg");t.setAttribute("role","alert");return t}_typeClass(){return"tabulator-alert-state-"+this.type}alert(t,i="msg"){if(t){this.clear();this.dispatch("alert-show",i);this.type=i;while(this.msgElement.firstChild)this.msgElement.removeChild(this.msgElement.firstChild);this.msgElement.classList.add(this._typeClass());if(typeof t==="function"){t=t()}if(t instanceof HTMLElement){this.msgElement.appendChild(t)}else{this.msgElement.innerHTML=t}this.table.element.appendChild(this.element)}}clear(){this.dispatch("alert-hide",this.type);if(this.element.parentNode){this.element.parentNode.removeChild(this.element)}this.msgElement.classList.remove(this._typeClass())}}class es extends ts{static defaultOptions=ze;static extendModule(){es.initializeModuleBinder();es._extendModule(...arguments)}static registerModule(){es.initializeModuleBinder();es._registerModule(...arguments)}constructor(t,i,e){super();es.initializeModuleBinder(e);this.options={};this.columnManager=null;this.rowManager=null;this.footerManager=null;this.alertManager=null;this.vdomHoz=null;this.externalEvents=null;this.eventBus=null;this.interactionMonitor=false;this.browser="";this.browserSlow=false;this.browserMobile=false;this.rtl=false;this.originalElement=null;this.componentFunctionBinder=new _e(this);this.dataLoader=false;this.modules={};this.modulesCore=[];this.modulesRegular=[];this.deprecationAdvisor=new Ve(this);this.optionsList=new Me(this,"table constructor");this.dependencyRegistry=new Ue(this);this.initialized=false;this.destroyed=false;if(this.initializeElement(t)){this.initializeCoreSystems(i);setTimeout((()=>{this._create()}))}this.constructor.registry.register(this)}initializeElement(t){if(typeof HTMLElement!=="undefined"&&t instanceof HTMLElement){this.element=t;return true}else if(typeof t==="string"){this.element=document.querySelector(t);if(this.element){return true}else{console.error("Tabulator Creation Error - no element found matching selector: ",t);return false}}else{console.error("Tabulator Creation Error - Invalid element provided:",t);return false}}initializeCoreSystems(t){this.columnManager=new Pe(this);this.rowManager=new Ne(this);this.footerManager=new Oe(this);this.dataLoader=new Le(this);this.alertManager=new is(this);this._bindModules();this.options=this.optionsList.generate(es.defaultOptions,t);this._clearObjectPointers();this._mapDeprecatedFunctionality();this.externalEvents=new Ae(this,this.options,this.options.debugEventsExternal);this.eventBus=new Ie(this.options.debugEventsInternal);this.interactionMonitor=new He(this);this.dataLoader.initialize();this.footerManager.initialize();this.dependencyRegistry.initialize()}_mapDeprecatedFunctionality(){}_clearSelection(){this.element.classList.add("tabulator-block-select");if(window.getSelection){if(window.getSelection().empty){window.getSelection().empty()}else if(window.getSelection().removeAllRanges){window.getSelection().removeAllRanges()}}else if(document.selection){document.selection.empty()}this.element.classList.remove("tabulator-block-select")}_create(){this.externalEvents.dispatch("tableBuilding");this.eventBus.dispatch("table-building");this._rtlCheck();this._buildElement();this._initializeTable();this.initialized=true;this._loadInitialData().finally((()=>{this.eventBus.dispatch("table-initialized");this.externalEvents.dispatch("tableBuilt")}))}_rtlCheck(){var t=window.getComputedStyle(this.element);switch(this.options.textDirection){case"auto":if(t.direction!=="rtl"){break}case"rtl":this.element.classList.add("tabulator-rtl");this.rtl=true;break;case"ltr":this.element.classList.add("tabulator-ltr");default:this.rtl=false}}_clearObjectPointers(){this.options.columns=this.options.columns.slice(0);if(Array.isArray(this.options.data)&&!this.options.reactiveData){this.options.data=this.options.data.slice(0)}}_buildElement(){var t=this.element,i=this.options,e;if(t.tagName==="TABLE"){this.originalElement=this.element;e=document.createElement("div");var s=t.attributes;for(var r in s){if(typeof s[r]=="object"){e.setAttribute(s[r].name,s[r].value)}}t.parentNode.replaceChild(e,t);this.element=t=e}t.classList.add("tabulator");t.setAttribute("role","grid");while(t.firstChild)t.removeChild(t.firstChild);if(i.height){i.height=isNaN(i.height)?i.height:i.height+"px";t.style.height=i.height}if(i.minHeight!==false){i.minHeight=isNaN(i.minHeight)?i.minHeight:i.minHeight+"px";t.style.minHeight=i.minHeight}if(i.maxHeight!==false){i.maxHeight=isNaN(i.maxHeight)?i.maxHeight:i.maxHeight+"px";t.style.maxHeight=i.maxHeight}}_initializeTable(){var t=this.element,i=this.options;this.interactionMonitor.initialize();this.columnManager.initialize();this.rowManager.initialize();this._detectBrowser();this.modulesCore.forEach((t=>{t.initialize()}));t.appendChild(this.columnManager.getElement());t.appendChild(this.rowManager.getElement());if(i.footerElement){this.footerManager.activate()}if(i.autoColumns&&i.data){this.columnManager.generateColumnsFromRowData(this.options.data)}this.modulesRegular.forEach((t=>{t.initialize()}));this.columnManager.setColumns(i.columns);this.eventBus.dispatch("table-built")}_loadInitialData(){return this.dataLoader.load(this.options.data).finally((()=>{this.columnManager.verticalAlignHeaders()}))}destroy(){var t=this.element;this.destroyed=true;this.constructor.registry.deregister(this);this.eventBus.dispatch("table-destroy");this.rowManager.destroy();while(t.firstChild)t.removeChild(t.firstChild);t.classList.remove("tabulator");this.externalEvents.dispatch("tableDestroyed")}_detectBrowser(){var t=navigator.userAgent||navigator.vendor||window.opera;if(t.indexOf("Trident")>-1){this.browser="ie";this.browserSlow=true}else if(t.indexOf("Edge")>-1){this.browser="edge";this.browserSlow=true}else if(t.indexOf("Firefox")>-1){this.browser="firefox";this.browserSlow=false}else if(t.indexOf("Mac OS")>-1){this.browser="safari";this.browserSlow=false}else{this.browser="other";this.browserSlow=false}this.browserMobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(t.slice(0,4))}initGuard(t,i){var e,s;if(this.options.debugInitialization&&!this.initialized){if(!t){e=(new Error).stack.split("\n");s=e[0]=="Error"?e[2]:e[1];if(s[0]==" "){t=s.trim().split(" ")[1].split(".")[1]}else{t=s.trim().split("@")[0]}}console.warn("Table Not Initialized - Calling the "+t+" function before the table is initialized may result in inconsistent behavior, Please wait for the `tableBuilt` event before calling this function."+(i?" "+i:""))}return this.initialized}blockRedraw(){this.initGuard();this.eventBus.dispatch("redraw-blocking");this.rowManager.blockRedraw();this.columnManager.blockRedraw();this.eventBus.dispatch("redraw-blocked")}restoreRedraw(){this.initGuard();this.eventBus.dispatch("redraw-restoring");this.rowManager.restoreRedraw();this.columnManager.restoreRedraw();this.eventBus.dispatch("redraw-restored")}setData(t,i,e){this.initGuard(false,"To set initial data please use the 'data' property in the table constructor.");return this.dataLoader.load(t,i,e,false)}clearData(){this.initGuard();this.dataLoader.blockActiveLoad();this.rowManager.clearData()}getData(t){return this.rowManager.getData(t)}getDataCount(t){return this.rowManager.getDataCount(t)}replaceData(t,i,e){this.initGuard();return this.dataLoader.load(t,i,e,true,true)}updateData(t){var i=0;this.initGuard();return new Promise(((e,s)=>{this.dataLoader.blockActiveLoad();if(typeof t==="string"){t=JSON.parse(t)}if(t&&t.length>0){t.forEach((t=>{var r=this.rowManager.findRow(t[this.options.index]);if(r){i++;r.updateData(t).then((()=>{i--;if(!i){e()}})).catch((i=>{s("Update Error - Unable to update row",t,i)}))}else{s("Update Error - Unable to find row",t)}}))}else{console.warn("Update Error - No data provided");s("Update Error - No data provided")}}))}addData(t,i,e){this.initGuard();return new Promise(((s,r)=>{this.dataLoader.blockActiveLoad();if(typeof t==="string"){t=JSON.parse(t)}if(t){this.rowManager.addRows(t,i,e).then((t=>{var i=[];t.forEach((function(t){i.push(t.getComponent())}));s(i)}))}else{console.warn("Update Error - No data provided");r("Update Error - No data provided")}}))}updateOrAddData(t){var i=[],e=0;this.initGuard();return new Promise(((s,r)=>{this.dataLoader.blockActiveLoad();if(typeof t==="string"){t=JSON.parse(t)}if(t&&t.length>0){t.forEach((t=>{var r=this.rowManager.findRow(t[this.options.index]);e++;if(r){r.updateData(t).then((()=>{e--;i.push(r.getComponent());if(!e){s(i)}}))}else{this.rowManager.addRows(t).then((t=>{e--;i.push(t[0].getComponent());if(!e){s(i)}}))}}))}else{console.warn("Update Error - No data provided");r("Update Error - No data provided")}}))}getRow(t){var i=this.rowManager.findRow(t);if(i){return i.getComponent()}else{console.warn("Find Error - No matching row found:",t);return false}}getRowFromPosition(t){var i=this.rowManager.getRowFromPosition(t);if(i){return i.getComponent()}else{console.warn("Find Error - No matching row found:",t);return false}}deleteRow(t){var i=[];this.initGuard();if(!Array.isArray(t)){t=[t]}for(let e of t){let t=this.rowManager.findRow(e,true);if(t){i.push(t)}else{console.error("Delete Error - No matching row found:",e);return Promise.reject("Delete Error - No matching row found")}}i.sort(((t,i)=>this.rowManager.rows.indexOf(t)>this.rowManager.rows.indexOf(i)?1:-1));i.forEach((t=>{t.delete()}));this.rowManager.reRenderInPosition();return Promise.resolve()}addRow(t,i,e){this.initGuard();if(typeof t==="string"){t=JSON.parse(t)}return this.rowManager.addRows(t,i,e,true).then((t=>t[0].getComponent()))}updateOrAddRow(t,i){var e=this.rowManager.findRow(t);this.initGuard();if(typeof i==="string"){i=JSON.parse(i)}if(e){return e.updateData(i).then((()=>e.getComponent()))}else{return this.rowManager.addRows(i).then((t=>t[0].getComponent()))}}updateRow(t,i){var e=this.rowManager.findRow(t);this.initGuard();if(typeof i==="string"){i=JSON.parse(i)}if(e){return e.updateData(i).then((()=>Promise.resolve(e.getComponent())))}else{console.warn("Update Error - No matching row found:",t);return Promise.reject("Update Error - No matching row found")}}scrollToRow(t,i,e){var s=this.rowManager.findRow(t);if(s){return this.rowManager.scrollToRow(s,i,e)}else{console.warn("Scroll Error - No matching row found:",t);return Promise.reject("Scroll Error - No matching row found")}}moveRow(t,i,e){var s=this.rowManager.findRow(t);this.initGuard();if(s){s.moveToRow(i,e)}else{console.warn("Move Error - No matching row found:",t)}}getRows(t){return this.rowManager.getComponents(t)}getRowPosition(t){var i=this.rowManager.findRow(t);if(i){return i.getPosition()}else{console.warn("Position Error - No matching row found:",t);return false}}setColumns(t){this.initGuard(false,"To set initial columns please use the 'columns' property in the table constructor");this.columnManager.setColumns(t)}getColumns(t){return this.columnManager.getComponents(t)}getColumn(t){var i=this.columnManager.findColumn(t);if(i){return i.getComponent()}else{console.warn("Find Error - No matching column found:",t);return false}}getColumnDefinitions(){return this.columnManager.getDefinitionTree()}showColumn(t){var i=this.columnManager.findColumn(t);this.initGuard();if(i){i.show()}else{console.warn("Column Show Error - No matching column found:",t);return false}}hideColumn(t){var i=this.columnManager.findColumn(t);this.initGuard();if(i){i.hide()}else{console.warn("Column Hide Error - No matching column found:",t);return false}}toggleColumn(t){var i=this.columnManager.findColumn(t);this.initGuard();if(i){if(i.visible){i.hide()}else{i.show()}}else{console.warn("Column Visibility Toggle Error - No matching column found:",t);return false}}addColumn(t,i,e){var s=this.columnManager.findColumn(e);this.initGuard();return this.columnManager.addColumn(t,i,s).then((t=>t.getComponent()))}deleteColumn(t){var i=this.columnManager.findColumn(t);this.initGuard();if(i){return i.delete()}else{console.warn("Column Delete Error - No matching column found:",t);return Promise.reject()}}updateColumnDefinition(t,i){var e=this.columnManager.findColumn(t);this.initGuard();if(e){return e.updateDefinition(i)}else{console.warn("Column Update Error - No matching column found:",t);return Promise.reject()}}moveColumn(t,i,e){var s=this.columnManager.findColumn(t),r=this.columnManager.findColumn(i);this.initGuard();if(s){if(r){this.columnManager.moveColumn(s,r,e)}else{console.warn("Move Error - No matching column found:",r)}}else{console.warn("Move Error - No matching column found:",t)}}scrollToColumn(t,i,e){return new Promise(((s,r)=>{var a=this.columnManager.findColumn(t);if(a){return this.columnManager.scrollToColumn(a,i,e)}else{console.warn("Scroll Error - No matching column found:",t);return Promise.reject("Scroll Error - No matching column found")}}))}redraw(t){this.initGuard();this.columnManager.redraw(t);this.rowManager.redraw(t)}setHeight(t){this.options.height=isNaN(t)?t:t+"px";this.element.style.height=this.options.height;this.rowManager.initializeRenderer();this.rowManager.redraw(true)}on(t,i){this.externalEvents.subscribe(t,i)}off(t,i){this.externalEvents.unsubscribe(t,i)}dispatchEvent(){var t=Array.from(arguments);t.shift();this.externalEvents.dispatch(...arguments)}alert(t,i){this.initGuard();this.alertManager.alert(t,i)}clearAlert(){this.initGuard();this.alertManager.clear()}modExists(t,i){if(this.modules[t]){return true}else{if(i){console.error("Tabulator Module Not Installed: "+t)}return false}}module(t){var i=this.modules[t];if(!i){console.error("Tabulator module not installed: "+t)}return i}}var ss=es;class rs extends ss{static extendModule(){ss.initializeModuleBinder(Ee);ss._extendModule(...arguments)}static registerModule(){ss.initializeModuleBinder(Ee);ss._registerModule(...arguments)}constructor(t,i,e){super(t,i,Ee)}}var as=rs;const{replace:os}="";const hs=/[&<>'"]/g;const ls={"&":"&amp;","<":"&lt;",">":"&gt;","'":"&#39;",'"':"&quot;"};const ns=t=>ls[t];const us=t=>os.call(t,hs,ns);class fs{constructor(t){this.pool=t;this.create=this.create.bind(this)}create(t){var i;const e={title:t.title,field:t.field,hozAlign:t.horizontalAlign,headerSort:t.headerSort,headerSortStartingDir:"desc"};if(t.headerComponent){e.titleFormatter=cs(t)}if(((i=t.component)===null||i===void 0?void 0:i.name)||t.formatter){e.formatter=ds(t,this.pool);e.formatterParams=t}if(t.aggregator){e.bottomCalc=ks(t)}return e}}const cs=t=>()=>{const i=document.createElement("div");i.setAttribute("class","lime-col-title__custom-component");const e=document.createElement("span");e.setAttribute("class","title-component-text");e.textContent=t.title;const s=document.createElement(t.headerComponent.name);s.setAttribute("class","title-component-slot");let r=t.headerComponent.props||{};if(t.headerComponent.propsFactory){r=Object.assign(Object.assign({},r),t.headerComponent.propsFactory(null))}gs(s,r);i.append(e);i.append(s);return i};function ds(t,i){var e;if(!((e=t.component)===null||e===void 0?void 0:e.name)){return ps}if(!bs(t)){console.warn(`Failed to render custom component for column "${t.field.toString()}". Custom element <${t.component.name}/> does not exist. Using the default formatter.`);return ps}return e=>{const s=ps(e,t);return ms(e,t,s,i)}}function bs(t){const i=t.component.name;if(typeof i==="string"){const e=!i.includes("-");const s=customElements.get(t.component.name);return e||s}else{return false}}function ps(t,i){const e=t.getData();let s=t.getValue();if(i.formatter){s=i.formatter(s,e)}if(typeof s==="string"&&!i.component){s=us(s)}return s}function ms(t,i,e,s){const r=t.getField();const a=t.getData();const o=s.get(i.component.name);let h=i.component.props||{};if(i.component.propsFactory){h=Object.assign(Object.assign({},h),i.component.propsFactory(a))}h=Object.assign(Object.assign({},h),{field:r,value:e,data:a});o.style.display="inline-block";gs(o,h);ys(o,t.getColumn());return o}function gs(t,i){const e=R(i,p(vs));Object.assign(t,e);const s=R(i,vs);for(const[i,e]of Object.entries(s)){const s=ws(i);t.addEventListener(s,e)}}function vs(t,i){if(typeof t!=="function"){return false}return/^on[A-Z]/.test(i)}function ws(t){return t.charAt(2).toLowerCase()+t.slice(3)}function ys(t,i){if(!("ResizeObserver"in window)){return}const e=1e3;const s=16;const r=new ResizeObserver((()=>{const e=t.getBoundingClientRect().width;const r=e+s;if(r<i.getWidth()){return}i.setWidth(r)}));r.observe(t);setTimeout((()=>{r.unobserve(t)}),e)}const xs=t=>i=>{const e=t.find((t=>t.field===i.field));const s=i.dir.toUpperCase();return{column:e,direction:s}};function ks(t){const i=t.aggregator;if(Cs(i)){return(e,s)=>i(t,e,s)}return i}function Cs(t){return typeof t==="function"}class Rs{constructor(t){this.isFree=t=>!this.usedElements.has(t);this.document=t;this.releaseAll();this.clear()}get(t){var i;let e=(i=this.pool[t])===null||i===void 0?void 0:i.find(this.isFree);if(!e){e=this.createElement(t)}this.usedElements.set(e,true);return e}release(t){this.usedElements.delete(t)}releaseAll(){this.usedElements=new WeakMap}clear(){this.pool={}}createElement(t){const i=this.document.createElement(t);if(!(t in this.pool)){this.pool[t]=[]}this.pool[t].push(i);return i}}class Es{constructor(t){this.getDataByIndex=t;this.toggleRange=(t,i)=>{const e=!this.selectedItems.has(this.getDataByIndex(i));const s=Math.min(t,i);const r=Math.max(t,i);const a=[];const o=[];for(let t=s;t<=r;t++){const i=this.getDataByIndex(t);if(!i){continue}const s=this.selectedItems.has(i);if(s===e){continue}if(e){this.selectedItems.add(i)}else{this.selectedItems.delete(i)}a.push(t);o.push(i)}this.lastToggledIndex=i;return{selected:e,items:o,indexes:a}};this.clear()}get size(){return this.selectedItems.size}get items(){return[...this.selectedItems]}set items(t){this.selectedItems=new Set(t);this.lastToggledIndex=-1}has(t){return this.selectedItems.has(t)}toggleSelection(t){return this.toggleRange(t,t)}toggleSelectionFromLastIndex(t){if(this.lastToggledIndex<0){return this.toggleSelection(t)}return this.toggleRange(this.lastToggledIndex,t)}clear(){this.selectedItems=new Set;this.lastToggledIndex=-1}}const zs="limel-checkbox";const Ms=t=>{var i;return(i=t.id)!==null&&i!==void 0?i:t};class Ss{constructor(t,i,e,s){this.getTable=t;this.pool=i;this.selectEvent=e;this.getTranslation=s;this.rowSelectorCellClick=(t,i)=>{t.stopPropagation();t.preventDefault();const e=i.getRow();const s=e.getPosition(true);if(s===false){return}if(t.shiftKey){this.updateRowSelectors(this.selection.toggleSelectionFromLastIndex(s))}else{this.updateRowSelectors(this.selection.toggleSelection(s))}this.selectEvent.emit(this.selection.items.map(this.getRowData))};this.getRowData=t=>{if(typeof t==="object"){return t}return this.getTable().getRow(t).getData()};this.updateRowSelectors=t=>{for(const i of t.indexes.map(this.getRowByIndex))this.updateRowSelector(i,t.selected)};this.updateRowSelector=(t,i)=>{const e=t.getCells()[0];if(e){const t=e.getElement().querySelector(zs);t.checked=i}};this.getActiveRows=()=>{const t=this.getTable();if(!t){return[]}return t.getRows("active")};this.getRowByIndex=t=>this.getTable().getRowFromPosition(t,true);this.selection=new Es((t=>Ms(this.getRowByIndex(t).getData())))}get hasSelection(){return this.selection.size>0}clear(){this.selection.clear()}setSelection(t=[]){const i=t.map(Ms);if(this.selection.size===t.length&&this.selection.items.every(((t,e)=>t===i[e]))){return}this.selection.items=i;const e=this.getActiveRows();for(const t of e)this.updateRowSelector(t,this.selection.has(Ms(t.getData())))}getColumnDefinitions(t){return[this.getRowSelectorColumnDefinition(),...t]}getRowSelectorColumnDefinition(){return{title:"",formatter:this.getRowSelectorFormatter(),cellClick:this.rowSelectorCellClick,headerClick:this.headerClick,headerSort:false,cssClass:"limel-table--row-selector",resizable:false,htmlOutput:false,clipboard:false}}headerClick(t){t.stopPropagation()}getRowSelectorFormatter(){return t=>{const i=this.pool.get(zs);gs(i,{checked:this.selection.has(Ms(t.getData())),label:this.getTranslation("table.select-row")});i.classList.add("hide-label");i.style.display="inline-block";return i}}}function Ts(t){const i={stretchLastColumn:"fitDataStretch",stretchColumns:"fitColumns",lowDensity:"fitData"};return i[t]||"fitDataFill"}const Ds=(t,i)=>{if(t.length!==i.length){return false}return t.every(((t,e)=>m(t,i[e])))};const Ps='@charset "UTF-8";.tabulator{position:relative;border:1px solid #999;background-color:#888;font-size:14px;text-align:left;overflow:hidden;-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-ms-transform:translateZ(0);-o-transform:translateZ(0);transform:translateZ(0)}.tabulator[tabulator-layout=fitDataFill] .tabulator-tableholder .tabulator-table{min-width:100%}.tabulator[tabulator-layout=fitDataTable]{display:inline-block}.tabulator.tabulator-block-select{user-select:none}.tabulator.tabulator-ranges .tabulator-cell:not(.tabulator-editing){user-select:none}.tabulator .tabulator-header{position:relative;box-sizing:border-box;width:100%;border-bottom:1px solid #999;background-color:#e6e6e6;color:#555;font-weight:bold;white-space:nowrap;overflow:hidden;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;outline:none}.tabulator .tabulator-header.tabulator-header-hidden{display:none}.tabulator .tabulator-header .tabulator-header-contents{position:relative;overflow:hidden}.tabulator .tabulator-header .tabulator-header-contents .tabulator-headers{display:inline-block}.tabulator .tabulator-header .tabulator-col{display:inline-flex;position:relative;box-sizing:border-box;flex-direction:column;justify-content:flex-start;border-right:1px solid #aaa;background:#e6e6e6;text-align:left;vertical-align:bottom;overflow:hidden}.tabulator .tabulator-header .tabulator-col.tabulator-moving{position:absolute;border:1px solid #999;background:#cdcdcd;pointer-events:none}.tabulator .tabulator-header .tabulator-col.tabulator-range-highlight{background-color:#D6D6D6;color:#000000}.tabulator .tabulator-header .tabulator-col.tabulator-range-selected{background-color:#3876ca;color:#FFFFFF}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{box-sizing:border-box;position:relative;padding:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button{padding:0 8px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-header-popup-button:hover{cursor:pointer;opacity:0.6}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title-holder{position:relative}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title{box-sizing:border-box;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title.tabulator-col-title-wrap{white-space:normal;text-overflow:initial}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-title-editor{box-sizing:border-box;width:100%;border:1px solid #999;padding:1px;background:#fff}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-title .tabulator-header-popup-button+.tabulator-title-editor{width:calc(100% - 22px)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{display:flex;align-items:center;position:absolute;top:0;bottom:0;right:4px}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{position:relative;display:flex;border-top:1px solid #aaa;overflow:hidden;margin-right:-1px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter{position:relative;box-sizing:border-box;margin-top:2px;width:100%;text-align:center}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter textarea{height:auto !important}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter svg{margin-top:3px}.tabulator .tabulator-header .tabulator-col .tabulator-header-filter input::-ms-clear{width:0;height:0}.tabulator .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:25px}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{cursor:pointer;background-color:#cdcdcd}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter{color:#bbb}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-bottom:6px solid #555}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #bbb}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-bottom:6px solid #555}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=ascending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-top:none;border-bottom:6px solid #666}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter{color:#666}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter.tabulator-col-sorter-element .tabulator-arrow:hover{cursor:pointer;border-top:6px solid #555}}.tabulator .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=descending] .tabulator-col-content .tabulator-col-sorter .tabulator-arrow{border-bottom:none;border-top:6px solid #666;color:#666}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical .tabulator-col-content .tabulator-col-title{writing-mode:vertical-rl;text-orientation:mixed;display:flex;align-items:center;justify-content:center}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-col-vertical-flip .tabulator-col-title{transform:rotate(180deg)}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-title{padding-right:0;padding-top:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable.tabulator-col-vertical-flip .tabulator-col-title{padding-right:0;padding-bottom:20px}.tabulator .tabulator-header .tabulator-col.tabulator-col-vertical.tabulator-sortable .tabulator-col-sorter{justify-content:center;left:0;right:0;top:4px;bottom:auto}.tabulator .tabulator-header .tabulator-frozen{position:sticky;left:0;z-index:11}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator .tabulator-header .tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder{box-sizing:border-box;display:inline-block;background:#f3f3f3 !important;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row{background:#f3f3f3 !important}.tabulator .tabulator-header .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-header .tabulator-frozen-rows-holder{display:inline-block}.tabulator .tabulator-header .tabulator-frozen-rows-holder:empty{display:none}.tabulator .tabulator-tableholder{position:relative;width:100%;white-space:nowrap;overflow:auto;-webkit-overflow-scrolling:touch}.tabulator .tabulator-tableholder:focus{outline:none}.tabulator .tabulator-tableholder .tabulator-placeholder{box-sizing:border-box;display:flex;align-items:center;justify-content:center;min-width:100%;width:100%}.tabulator .tabulator-tableholder .tabulator-placeholder[tabulator-render-mode=virtual]{min-height:100%}.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents{display:inline-block;text-align:center;padding:10px;color:#ccc;font-weight:bold;font-size:20px;white-space:normal}.tabulator .tabulator-tableholder .tabulator-table{position:relative;display:inline-block;background-color:#fff;white-space:nowrap;overflow:visible;color:#333}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs{font-weight:bold;background:#e2e2e2 !important}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-top{border-bottom:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-table .tabulator-row.tabulator-calcs.tabulator-calcs-bottom{border-top:2px solid #aaa}.tabulator .tabulator-tableholder .tabulator-range-overlay{position:absolute;inset:0;z-index:10;pointer-events:none}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range{position:absolute;box-sizing:border-box;border:1px solid #2975DD}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active::after{content:"";position:absolute;right:-3px;bottom:-3px;width:6px;height:6px;background-color:#2975DD;border-radius:999px}.tabulator .tabulator-tableholder .tabulator-range-overlay .tabulator-range-cell-active{position:absolute;box-sizing:border-box;border:2px solid #2975DD}.tabulator .tabulator-footer{border-top:1px solid #999;background-color:#e6e6e6;color:#555;font-weight:bold;white-space:nowrap;user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator .tabulator-footer .tabulator-footer-contents{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:5px 10px}.tabulator .tabulator-footer .tabulator-footer-contents:empty{display:none}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs{margin-top:-5px;overflow-x:auto}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab{display:inline-block;padding:5px;border:#999 1px solid;border-top:none;border-bottom-left-radius:5px;border-bottom-right-radius:5px;font-size:0.9em}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab:hover{cursor:pointer;opacity:0.7}.tabulator .tabulator-footer .tabulator-spreadsheet-tabs .tabulator-spreadsheet-tab.tabulator-spreadsheet-tab-active{background:#fff}.tabulator .tabulator-footer .tabulator-calcs-holder{box-sizing:border-box;width:100%;text-align:left;background:#f3f3f3 !important;border-bottom:1px solid #aaa;border-top:1px solid #aaa;overflow:hidden}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{display:inline-block;background:#f3f3f3 !important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row .tabulator-col-resize-handle{display:none}.tabulator .tabulator-footer .tabulator-calcs-holder:only-child{margin-bottom:-5px;border-bottom:none}.tabulator .tabulator-footer>*+.tabulator-page-counter{margin-left:10px}.tabulator .tabulator-footer .tabulator-page-counter{font-weight:normal}.tabulator .tabulator-footer .tabulator-paginator{flex:1;text-align:right;color:#555;font-family:inherit;font-weight:inherit;font-size:inherit}.tabulator .tabulator-footer .tabulator-page-size{display:inline-block;margin:0 5px;padding:2px 5px;border:1px solid #aaa;border-radius:3px}.tabulator .tabulator-footer .tabulator-pages{margin:0 7px}.tabulator .tabulator-footer .tabulator-page{display:inline-block;margin:0 2px;padding:2px 5px;border:1px solid #aaa;border-radius:3px;background:rgba(255, 255, 255, 0.2)}.tabulator .tabulator-footer .tabulator-page.active{color:#d00}.tabulator .tabulator-footer .tabulator-page:disabled{opacity:0.5}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-footer .tabulator-page:not(disabled):hover{cursor:pointer;background:rgba(0, 0, 0, 0.2);color:#fff}}.tabulator .tabulator-col-resize-handle{position:relative;display:inline-block;width:6px;margin-left:-3px;margin-right:-3px;z-index:11;vertical-align:middle}@media (hover: hover) and (pointer: fine){.tabulator .tabulator-col-resize-handle:hover{cursor:ew-resize}}.tabulator .tabulator-col-resize-handle:last-of-type{width:3px;margin-right:0}.tabulator .tabulator-col-resize-guide{position:absolute;top:0;width:4px;height:100%;margin-left:-0.5px;background-color:#999;opacity:0.5}.tabulator .tabulator-row-resize-guide{position:absolute;left:0;width:100%;height:4px;margin-top:-0.5px;background-color:#999;opacity:0.5}.tabulator .tabulator-alert{position:absolute;display:flex;align-items:center;top:0;left:0;z-index:100;height:100%;width:100%;background:rgba(0, 0, 0, 0.4);text-align:center}.tabulator .tabulator-alert .tabulator-alert-msg{display:inline-block;margin:0 auto;padding:10px 20px;border-radius:10px;background:#fff;font-weight:bold;font-size:16px}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-msg{border:4px solid #333;color:#000}.tabulator .tabulator-alert .tabulator-alert-msg.tabulator-alert-state-error{border:4px solid #D00;color:#590000}.tabulator-row{position:relative;box-sizing:border-box;min-height:22px;background-color:#fff}.tabulator-row.tabulator-row-even{background-color:#EFEFEF}@media (hover: hover) and (pointer: fine){.tabulator-row.tabulator-selectable:hover{background-color:#bbb;cursor:pointer}}.tabulator-row.tabulator-selected{background-color:#9ABCEA}@media (hover: hover) and (pointer: fine){.tabulator-row.tabulator-selected:hover{background-color:#769BCC;cursor:pointer}}.tabulator-row.tabulator-row-moving{border:1px solid #000;background:#fff}.tabulator-row.tabulator-moving{position:absolute;border-top:1px solid #aaa;border-bottom:1px solid #aaa;pointer-events:none;z-index:15}.tabulator-row.tabulator-range-highlight .tabulator-cell.tabulator-range-row-header{background-color:#D6D6D6;color:#000000}.tabulator-row.tabulator-range-highlight.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#FFFFFF}.tabulator-row.tabulator-range-selected .tabulator-cell.tabulator-range-row-header{background-color:#3876ca;color:#FFFFFF}.tabulator-row .tabulator-row-resize-handle{position:absolute;right:0;bottom:0;left:0;height:5px}.tabulator-row .tabulator-row-resize-handle.prev{top:0;bottom:auto}@media (hover: hover) and (pointer: fine){.tabulator-row .tabulator-row-resize-handle:hover{cursor:ns-resize}}.tabulator-row .tabulator-responsive-collapse{box-sizing:border-box;padding:5px;border-top:1px solid #aaa;border-bottom:1px solid #aaa}.tabulator-row .tabulator-responsive-collapse:empty{display:none}.tabulator-row .tabulator-responsive-collapse table{font-size:14px}.tabulator-row .tabulator-responsive-collapse table tr td{position:relative}.tabulator-row .tabulator-responsive-collapse table tr td:first-of-type{padding-right:10px}.tabulator-row .tabulator-cell{display:inline-block;position:relative;box-sizing:border-box;padding:4px;border-right:1px solid #aaa;vertical-align:middle;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;outline:none}.tabulator-row .tabulator-cell.tabulator-row-header{border-right:1px solid #999;border-bottom:1px solid #aaa;background:#e6e6e6}.tabulator-row .tabulator-cell.tabulator-frozen{display:inline-block;position:sticky;left:0;background-color:inherit;z-index:11}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-right:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-left:2px solid #aaa}.tabulator-row .tabulator-cell.tabulator-editing{border:1px solid #1D68CD;outline:none;padding:0}.tabulator-row .tabulator-cell.tabulator-editing input,.tabulator-row .tabulator-cell.tabulator-editing select{border:1px;background:transparent;outline:none}.tabulator-row .tabulator-cell.tabulator-validation-fail{border:1px solid #dd0000}.tabulator-row .tabulator-cell.tabulator-validation-fail input,.tabulator-row .tabulator-cell.tabulator-validation-fail select{border:1px;background:transparent;color:#dd0000}.tabulator-row .tabulator-cell.tabulator-row-handle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box{width:80%}.tabulator-row .tabulator-cell.tabulator-row-handle .tabulator-row-handle-box .tabulator-row-handle-bar{width:100%;height:3px;margin-top:2px;background:#666}.tabulator-row .tabulator-cell.tabulator-range-selected:not(.tabulator-range-only-cell-selected):not(.tabulator-range-row-header){background-color:#9ABCEA}.tabulator-row .tabulator-cell .tabulator-data-tree-branch-empty{display:inline-block;width:7px}.tabulator-row .tabulator-cell .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-row .tabulator-cell .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0, 0, 0, 0.1);overflow:hidden}@media (hover: hover) and (pointer: fine){.tabulator-row .tabulator-cell .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0, 0, 0, 0.2)}}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-row .tabulator-cell .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle{display:inline-flex;align-items:center;justify-content:center;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;height:15px;width:15px;border-radius:20px;background:#666;color:#fff;font-weight:bold;font-size:1.1em}@media (hover: hover) and (pointer: fine){.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle:hover{opacity:0.7;cursor:pointer}}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-close{display:initial}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle.open .tabulator-responsive-collapse-toggle-open{display:none}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle svg{stroke:#fff}.tabulator-row .tabulator-cell .tabulator-responsive-collapse-toggle .tabulator-responsive-collapse-toggle-close{display:none}.tabulator-row .tabulator-cell .tabulator-traffic-light{display:inline-block;height:14px;width:14px;border-radius:14px}.tabulator-row.tabulator-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:bold;min-width:100%}@media (hover: hover) and (pointer: fine){.tabulator-row.tabulator-group:hover{cursor:pointer;background-color:rgba(0, 0, 0, 0.1)}}.tabulator-row.tabulator-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-row.tabulator-group.tabulator-group-level-1{padding-left:30px}.tabulator-row.tabulator-group.tabulator-group-level-2{padding-left:50px}.tabulator-row.tabulator-group.tabulator-group-level-3{padding-left:70px}.tabulator-row.tabulator-group.tabulator-group-level-4{padding-left:90px}.tabulator-row.tabulator-group.tabulator-group-level-5{padding-left:110px}.tabulator-row.tabulator-group .tabulator-group-toggle{display:inline-block}.tabulator-row.tabulator-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-row.tabulator-group span{margin-left:10px;color:#d00}.tabulator-toggle{box-sizing:border-box;display:flex;flex-direction:row;border:1px solid #ccc;background:#dcdcdc}.tabulator-toggle.tabulator-toggle-on{background:#1c6cc2}.tabulator-toggle .tabulator-toggle-switch{box-sizing:border-box;border:1px solid #ccc;background:#fff}.tabulator-popup-container{position:absolute;display:inline-block;box-sizing:border-box;background:#fff;border:1px solid #aaa;box-shadow:0 0 5px 0 rgba(0, 0, 0, 0.2);font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:10000}.tabulator-popup{padding:5px;border-radius:3px}.tabulator-tooltip{max-width:min(500px, 100%);padding:3px 5px;border-radius:2px;box-shadow:none;font-size:12px;pointer-events:none}.tabulator-menu .tabulator-menu-item{position:relative;box-sizing:border-box;padding:5px 10px;user-select:none}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-disabled{opacity:0.5}@media (hover: hover) and (pointer: fine){.tabulator-menu .tabulator-menu-item:not(.tabulator-menu-item-disabled):hover{cursor:pointer;background:#EFEFEF}}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu{padding-right:25px}.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu::after{display:inline-block;position:absolute;top:calc(5px + 0.4em);right:10px;height:7px;width:7px;content:"";border-width:1px 1px 0 0;border-style:solid;border-color:#aaa;vertical-align:top;transform:rotate(45deg)}.tabulator-menu .tabulator-menu-separator{border-top:1px solid #aaa}.tabulator-edit-list{max-height:200px;font-size:14px;overflow-y:auto;-webkit-overflow-scrolling:touch}.tabulator-edit-list .tabulator-edit-list-item{padding:4px;color:#333;outline:none}.tabulator-edit-list .tabulator-edit-list-item.active{color:#fff;background:#1D68CD}.tabulator-edit-list .tabulator-edit-list-item.active.focused{outline:1px solid rgba(255, 255, 255, 0.5)}.tabulator-edit-list .tabulator-edit-list-item.focused{outline:1px solid #1D68CD}@media (hover: hover) and (pointer: fine){.tabulator-edit-list .tabulator-edit-list-item:hover{cursor:pointer;color:#fff;background:#1D68CD}}.tabulator-edit-list .tabulator-edit-list-placeholder{padding:4px;color:#333;text-align:center}.tabulator-edit-list .tabulator-edit-list-group{border-bottom:1px solid #aaa;padding:4px;padding-top:6px;color:#333;font-weight:bold}.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-2,.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-2{padding-left:12px}.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-3,.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-3{padding-left:20px}.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-4,.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-4{padding-left:28px}.tabulator-edit-list .tabulator-edit-list-item.tabulator-edit-list-group-level-5,.tabulator-edit-list .tabulator-edit-list-group.tabulator-edit-list-group-level-5{padding-left:36px}.tabulator.tabulator-ltr{direction:ltr}.tabulator.tabulator-rtl{text-align:initial;direction:rtl}.tabulator.tabulator-rtl .tabulator-header .tabulator-col{text-align:initial;border-left:1px solid #aaa;border-right:initial}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-col-group .tabulator-col-group-cols{margin-right:initial;margin-left:-1px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col.tabulator-sortable .tabulator-col-title{padding-right:0;padding-left:25px}.tabulator.tabulator-rtl .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{left:8px;right:initial}.tabulator.tabulator-rtl .tabulator-tableholder .tabulator-range-overlay .tabulator-range.tabulator-range-active::after{content:"";position:absolute;left:-3px;right:initial;bottom:-3px;width:6px;height:6px;background-color:#2975DD;border-radius:999px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell{border-right:initial;border-left:1px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-branch{margin-right:initial;margin-left:5px;border-bottom-left-radius:initial;border-bottom-right-radius:1px;border-left:initial;border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell .tabulator-data-tree-control{margin-right:initial;margin-left:5px}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-left{border-left:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-cell.tabulator-frozen.tabulator-frozen-right{border-right:2px solid #aaa}.tabulator.tabulator-rtl .tabulator-row .tabulator-col-resize-handle:last-of-type{width:3px;margin-left:0;margin-right:-3px}.tabulator.tabulator-rtl .tabulator-footer .tabulator-calcs-holder{text-align:initial}.tabulator-print-fullscreen{position:absolute;top:0;bottom:0;left:0;right:0;z-index:10000}body.tabulator-print-fullscreen-hide>*:not(.tabulator-print-fullscreen){display:none !important}.tabulator-print-table{border-collapse:collapse}.tabulator-print-table .tabulator-data-tree-branch{display:inline-block;vertical-align:middle;height:9px;width:7px;margin-top:-9px;margin-right:5px;border-bottom-left-radius:1px;border-left:2px solid #aaa;border-bottom:2px solid #aaa}.tabulator-print-table .tabulator-print-table-group{box-sizing:border-box;border-bottom:1px solid #999;border-right:1px solid #aaa;border-top:1px solid #999;padding:5px;padding-left:10px;background:#ccc;font-weight:bold;min-width:100%}@media (hover: hover) and (pointer: fine){.tabulator-print-table .tabulator-print-table-group:hover{cursor:pointer;background-color:rgba(0, 0, 0, 0.1)}}.tabulator-print-table .tabulator-print-table-group.tabulator-group-visible .tabulator-arrow{margin-right:10px;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #666;border-bottom:0}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-1 td{padding-left:30px !important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-2 td{padding-left:50px !important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-3 td{padding-left:70px !important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-4 td{padding-left:90px !important}.tabulator-print-table .tabulator-print-table-group.tabulator-group-level-5 td{padding-left:110px !important}.tabulator-print-table .tabulator-print-table-group .tabulator-group-toggle{display:inline-block}.tabulator-print-table .tabulator-print-table-group .tabulator-arrow{display:inline-block;width:0;height:0;margin-right:16px;border-top:6px solid transparent;border-bottom:6px solid transparent;border-right:0;border-left:6px solid #666;vertical-align:middle}.tabulator-print-table .tabulator-print-table-group span{margin-left:10px;color:#d00}.tabulator-print-table .tabulator-data-tree-control{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;height:11px;width:11px;margin-right:5px;border:1px solid #333;border-radius:2px;background:rgba(0, 0, 0, 0.1);overflow:hidden}@media (hover: hover) and (pointer: fine){.tabulator-print-table .tabulator-data-tree-control:hover{cursor:pointer;background:rgba(0, 0, 0, 0.2)}}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse{display:inline-block;position:relative;height:7px;width:1px;background:transparent}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-collapse:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand{display:inline-block;position:relative;height:7px;width:1px;background:#333}.tabulator-print-table .tabulator-data-tree-control .tabulator-data-tree-control-expand:after{position:absolute;content:"";left:-3px;top:3px;height:1px;width:7px;background:#333}:host(limel-table){isolation:isolate;display:block;--table-header-background-color:var(--contrast-500);--table-header-background-color--hover:var(--contrast-400);--table-header-background-color-when-being-dragged:var(--contrast-100);--table-row-background-color--odd:var(--contrast-200);--table-row-background-color--even:var(--contrast-100);--table-row-background-color--hover:var(\n --lime-elevated-surface-background-color\n );--table-row-background-color--active:var(--mdc-theme-primary);--table-arrow-color:var(--contrast-800);--table-arrow-color--active:var(\n --lime-primary-color,\n var(--limel-theme-primary-color)\n );--table-text-color:var(--limel-theme-text-primary-on-background-color);--limel-chip-size:1.25rem}#tabulator-container,#tabulator-table{height:100%;width:100%}.tabulator{display:flex;flex-direction:column}.tabulator *{box-sizing:border-box}.tabulator .tabulator-header{flex-shrink:0}.tabulator .tabulator-tableholder{isolation:isolate;flex-grow:1;height:unset !important;max-height:unset !important;min-height:unset !important;padding-bottom:5rem}.tabulator .tabulator-footer{flex-shrink:0}#tabulator-container{position:relative}#tabulator-container,#tabulator-table{background-color:transparent;border:none}.tabulator .tabulator-header{color:var(--table-text-color)}.tabulator .tabulator-tableholder .tabulator-table{color:var(--table-text-color);background-color:transparent}.tabulator .tabulator-header{border-bottom:0;background-color:rgb(var(--table-header-background-color))}.tabulator .tabulator-header .tabulator-headers{width:fit-content}.tabulator .tabulator-header .tabulator-col{transition:background-color 0.2s ease;background-color:rgb(var(--table-header-background-color));border-right-color:rgb(var(--contrast-200))}.tabulator .tabulator-header .tabulator-col.tabulator-sortable.tabulator-col-sorter-element:hover{background-color:rgb(var(--table-header-background-color--hover))}.tabulator .tabulator-header .tabulator-col .tabulator-col-content{padding:0 0.5rem 0 0.25rem}.tabulator .tabulator-header .tabulator-col-title-holder{height:1.75rem;display:flex;align-items:center;gap:0.25rem}.tabulator .tabulator-header .tabulator-col-sorter{order:1}.tabulator .tabulator-header .tabulator-col-title{order:2;font-weight:500;padding-right:0 !important;line-height:1.25rem}.tabulator-row{height:2.25rem}.tabulator-row .tabulator-cell{border-right:transparent;padding:0.5rem;padding-left:1rem;height:inherit}.tabulator-row .tabulator-cell[style*="text-align: right;"]{justify-content:flex-end}.tabulator-row .tabulator-cell[style*="text-align: center;"]{justify-content:center}.tabulator-row .tabulator-col-resize-handle{display:none}.tabulator-col,.tabulator-cell{max-width:var(--table-max-column-width, 40rem)}#tabulator-loader,#tabulator-empty-text{position:absolute;width:100%;height:100%;z-index:1;display:flex;align-items:center;justify-content:center}#tabulator-loader{background-color:rgba(var(--contrast-100), 0.6);cursor:wait}#tabulator-empty-text{color:rgb(var(--contrast-800));font-weight:bold;font-size:1.25rem;pointer-events:none}limel-chip{transform:translateY(-0.15rem)}.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter{position:relative;cursor:pointer;transition:opacity 0.2s ease;right:0}.tabulator-sortable[aria-sort=none] .tabulator-col-sorter{opacity:0}.tabulator-sortable[aria-sort=none]:hover .tabulator-col-sorter{opacity:1}.tabulator-sortable[aria-sort=none]:hover .tabulator-col-sorter .tabulator-arrow{animation:indicate-sortable-unsorted-column 2s ease forwards}.tabulator-sortable[aria-sort=desc] .tabulator-col-sorter,.tabulator-sortable[aria-sort=asc] .tabulator-col-sorter{opacity:1}.tabulator-sortable[aria-sort=desc]:hover .tabulator-col-sorter,.tabulator-sortable[aria-sort=asc]:hover .tabulator-col-sorter{opacity:1;animation:indicate-sortable-sorted-column 0.5s ease}.tabulator-arrow{rotate:180deg;transition:border 0.2s ease;border-left:0.25rem solid transparent !important;border-right:0.25rem solid transparent !important}.tabulator#tabulator-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=none] .tabulator-arrow{height:0.75rem;border-top-width:0.25rem;border-top-style:solid;border-top-color:rgb(var(--table-arrow-color));border-bottom-width:0.25rem;border-bottom-style:solid;border-bottom-color:rgb(var(--table-arrow-color))}.tabulator#tabulator-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=desc] .tabulator-arrow{height:0;transform:translate3d(0, -0.2rem, 0);border-top-width:0.25rem;border-bottom-width:0;border-top-color:var(--table-arrow-color--active)}.tabulator#tabulator-table .tabulator-header .tabulator-col.tabulator-sortable[aria-sort=asc] .tabulator-arrow{height:0;transform:translate3d(0, 0.2rem, 0);border-top-width:0;border-bottom-width:0.25rem;border-bottom-color:var(--table-arrow-color--active)}@keyframes indicate-sortable-sorted-column{0%,100%{transform:translate3d(0, 0, 0)}30%{transform:translate3d(0, -0.0875rem, 0)}60%{transform:translate3d(0, 0.0875rem, 0)}}@keyframes indicate-sortable-unsorted-column{0%,15%,45%,75%{border-top-color:transparent;border-bottom-color:transparent;transform:translate3d(0, 0, 0)}30%{border-top-color:transparent;border-bottom-color:var(--table-arrow-color--active);transform:translate3d(0, -0.3125rem, 0)}60%{border-top-color:var(--table-arrow-color--active);border-bottom-color:transparent;transform:translate3d(0, 0.3125rem, 0)}100%{border-top-color:rgb(var(--table-arrow-color));border-bottom-color:rgb(var(--table-arrow-color))}}#tabulator-container:not(.has-pagination) .tabulator-paginator{display:var(--limel-table-single-page-paginator-display, grid)}.tabulator .tabulator-footer .tabulator-paginator{box-sizing:border-box;display:grid;grid-auto-flow:column;justify-content:end;padding-top:0.25rem;padding-bottom:0.25rem}.tabulator .tabulator-footer .tabulator-paginator .tabulator-pages{margin:0 0.5rem}.tabulator .tabulator-footer .tabulator-paginator .tabulator-pages .tabulator-page{margin:0 0rem}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page{position:relative;height:1.75rem;min-width:1.75rem;padding:0 0.5rem;margin:0;border:none;border-radius:2.5rem;background-color:transparent}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]){transition:color var(--limel-clickable-transition-speed, 0.4s) ease, background-color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);cursor:pointer;color:rgb(var(--contrast-1200)) !important;background-color:transparent}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):hover,.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):focus,.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):focus-visible{will-change:color, background-color, box-shadow, transform}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):hover,.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):focus-visible{transform:translate3d(0, 0.01rem, 0);color:var(--limel-theme-on-surface-color);background-color:var(--lime-elevated-surface-background-color)}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):hover{box-shadow:var(--button-shadow-hovered)}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):active{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n );transform:translate3d(0, 0.05rem, 0);box-shadow:var(--button-shadow-pressed)}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):hover,.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:not([disabled]):active{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page.active{background-color:var(--limel-theme-surface-background-color);box-shadow:var(--button-shadow-inset)}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:disabled{opacity:0.3;cursor:not-allowed}.tabulator .tabulator-footer .tabulator-paginator .tabulator-page:disabled:hover{background-color:transparent}button.tabulator-page{display:inline-flex !important;align-items:center;justify-content:center}button.tabulator-page[data-page=first],button.tabulator-page[data-page=prev],button.tabulator-page[data-page=next],button.tabulator-page[data-page=last]{font-size:0;color:transparent !important}button.tabulator-page[data-page=first]:before,button.tabulator-page[data-page=first]:after,button.tabulator-page[data-page=prev]:before,button.tabulator-page[data-page=prev]:after,button.tabulator-page[data-page=next]:before,button.tabulator-page[data-page=next]:after,button.tabulator-page[data-page=last]:before,button.tabulator-page[data-page=last]:after{content:"";transition:transform 0.2s ease;display:block;position:absolute}button.tabulator-page[data-page=first]:after,button.tabulator-page[data-page=prev]:after,button.tabulator-page[data-page=next]:after,button.tabulator-page[data-page=last]:after{border-style:solid;border-color:transparent;border-width:0.25rem 0 0.25rem 0.4rem;border-left-color:var(--limel-theme-on-surface-color)}button.tabulator-page[data-page=first]:before,button.tabulator-page[data-page=last]:before{height:0.5rem;width:0.125rem;background-color:var(--limel-theme-on-surface-color)}button.tabulator-page[data-page=first]:before{left:0.375rem}button.tabulator-page[data-page=last]:before{right:0.375rem}button.tabulator-page[data-page=first]:after,button.tabulator-page[data-page=prev]:after{transform:rotateZ(180deg)}button.tabulator-page[data-page=next]:not([disabled]):hover:after,button.tabulator-page[data-page=last]:not([disabled]):hover:after{transform:translate3d(0.09375rem, 0, 0)}button.tabulator-page[data-page=first]:not([disabled]):hover:after,button.tabulator-page[data-page=prev]:not([disabled]):hover:after{transform:translate3d(-0.09375rem, 0, 0) rotateZ(180deg)}@keyframes fade-in-tabulator-loader{0%{background:transparent}100%{background:rgba(var(--contrast-1400), 0.4)}}@keyframes spin-tabulator-loader{to{transform:rotate(360deg)}}.tabulator .tabulator-loader{animation:fade-in-tabulator-loader 0.5s ease 0.5s forwards;animation-iteration-count:1;cursor:progress;background:transparent}.tabulator .tabulator-loader .tabulator-loader-msg{animation:spin-tabulator-loader 0.4s linear infinite;color:transparent;font-size:0;border-radius:50%;border:0.1875rem solid rgb(var(--lime-brand-color-flexible-turquoise)) !important;border-top-color:transparent !important;width:1.25rem;height:1.25rem;background-color:transparent !important;padding:0}.interactive-feedback{position:absolute;inset:0;min-height:0.125rem;transition:color var(--limel-clickable-transition-speed, 0.4s) ease, box-shadow var(--limel-clickable-transform-speed, 0.4s) ease, transform var(--limel-clickable-transform-speed, 0.4s) var(--limel-clickable-transform-timing-function, ease);background-color:rgb(var(--limel-table-row-background-color))}.tabulator-row:active .interactive-feedback{--limel-clickable-transform-timing-function:cubic-bezier(\n 0.83,\n -0.15,\n 0.49,\n 1.16\n )}.tabulator-row:hover .interactive-feedback,.tabulator-row:active .interactive-feedback{--limel-clickable-transition-speed:0.2s;--limel-clickable-transform-speed:0.16s}.tabulator-row:not(.tabulator-calcs){background-color:transparent}.tabulator-row:not(.tabulator-calcs).tabulator-row-odd{--limel-table-row-background-color:var(\n --table-row-background-color--odd\n )}.tabulator-row:not(.tabulator-calcs).tabulator-row-even{--limel-table-row-background-color:var(\n --table-row-background-color--even\n )}.tabulator-row:not(.tabulator-calcs) .tabulator-cell{pointer-events:none}.tabulator-row:not(.tabulator-calcs) .tabulator-cell>*{pointer-events:auto}.tabulator-row:not(.tabulator-calcs).tabulator-selectable:hover{background-color:var(--table-row-background-color--hover);z-index:2}.tabulator-row:not(.tabulator-calcs).tabulator-selectable.active:before{content:"";display:inline-block;box-sizing:border-box;position:sticky;z-index:3;inset:0 0 auto 0;border:0.2rem solid var(--lime-primary-color, var(--limel-theme-primary-color));border-radius:1rem;margin-right:-0.4rem}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable .interactive-feedback:hover{box-shadow:var(--button-shadow-hovered)}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable:active .interactive-feedback{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.05rem, 0)}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable.active{--limel-table-row-background-color:var(\n --table-row-background-color--active\n )}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable.active .interactive-feedback{opacity:0.2;background-color:var(--table-row-background-color--active);box-shadow:var(--button-shadow-inset-pressed)}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable.active .interactive-feedback:hover{opacity:0.3}:host(.has-interactive-rows) .tabulator-row:not(.tabulator-calcs).tabulator-selectable:not(.active) .interactive-feedback:hover{background-color:var(--table-row-background-color--hover)}:host(.has-low-density) #tabulator-container{width:max-content;max-width:100%;margin:auto}:host(.has-low-density) .tabulator-table{background-color:transparent}:host(.has-low-density) .tabulator-header{border-radius:0.375rem}:host(.has-low-density) .tabulator-footer{border-radius:0.5rem}:host(.has-low-density) .tabulator-calcs-holder{border-radius:0.5rem 0.5rem 0 0}:host(.has-low-density) .tabulator-row{border-radius:0.5rem}:host(.has-low-density) .tabulator-row:not(.tabulator-calcs-bottom){margin-bottom:0.25rem}:host(.has-low-density) .tabulator-row:not(.tabulator-calcs-bottom):first-child{margin-top:0.75rem}:host(.has-low-density) .tabulator-row:not(.tabulator-calcs-bottom) .tabulator-cell{height:2.75rem !important}:host(.has-low-density) .tabulator-row:not(.tabulator-calcs-bottom) .tabulator-cell:first-child{border-radius:0.5rem 0 0 0.5rem}:host(.has-low-density) .tabulator-row:not(.tabulator-calcs-bottom) .tabulator-cell:last-child{border-radius:0 0.5rem 0.5rem 0}:host(.has-pagination-on-top) .tabulator .tabulator-header{order:2}:host(.has-pagination-on-top) .tabulator .tabulator-tableholder{order:3}:host(.has-pagination-on-top) .tabulator .tabulator-footer{order:1;background-color:transparent}:host(.has-pagination-on-top) .tabulator .tabulator-calcs-holder{position:absolute;bottom:0}:host(.has-pagination-on-top):has(.tabulator-calcs-holder) .tabulator-tableholder{margin-bottom:1.5rem}:host(.has-pagination-on-top) .select-all{top:2.5rem}.lime-col-title__custom-component{width:100%;display:flex;align-items:center;margin-right:1.25rem;gap:0.25rem}.title-component-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex-grow:1;flex-shrink:1;min-width:0}.title-component-slot{flex-shrink:0}@keyframes detach-a-column-header{0%{transform:rotate(0deg)}100%{transform:rotate(-2deg)}}.has-movable-columns .tabulator-header{overflow-y:visible}.has-movable-columns .tabulator-header .tabulator-col:not(.tabulator-frozen){cursor:move !important}.has-movable-columns .tabulator-header .tabulator-col:not(.tabulator-frozen).tabulator-sortable.tabulator-moving{animation:detach-a-column-header 0.2s ease forwards;opacity:0.9;border:none;border-radius:0.25rem;background-color:rgb(var(---table-header-background-color-when-being-dragged));box-shadow:var(--shadow-depth-16)}.has-movable-columns .tabulator-header .tabulator-col:not(.tabulator-frozen).tabulator-sortable.tabulator-moving:hover{background-color:rgb(var(---table-header-background-color-when-being-dragged))}.has-movable-columns .tabulator-header .tabulator-col:not(.tabulator-frozen).tabulator-sortable.tabulator-moving .tabulator-arrow:before{background-color:rgb(var(---table-header-background-color-when-being-dragged))}.tabulator .tabulator-footer{transition:transform 0.5s ease-out, opacity 0.35s ease;color:var(--table-text-color);background-color:rgb(var(--table-header-background-color--hover));border:none;user-select:auto}.tabulator .tabulator-footer .tabulator-footer-contents{padding:0 0.25rem}.tabulator .tabulator-footer .tabulator-calcs-holder{border-color:rgb(var(--contrast-500));background:rgb(var(--contrast-500)) !important;margin-top:0;margin-bottom:0}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row{height:1.5rem;background:transparent !important}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-calcs{cursor:default}.tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-cell{height:1.5rem !important;padding-top:0.25rem;padding-bottom:0}.select-all,.limel-table--row-selector{--limel-checkbox-min-height:1.25rem;display:inline-flex !important;align-items:center;justify-content:center;text-overflow:unset !important;padding:0 !important}.select-all{position:absolute;z-index:1;left:0.375rem;top:0.1875rem}.limel-table--row-selector{position:sticky !important;left:0;border-width:0;z-index:1}.limel-table--row-selector:before{content:"";inset:0.25rem 0;position:absolute;background-image:linear-gradient(to right, rgb(var(--limel-table-row-background-color)) 70%, rgb(var(--limel-table-row-background-color), 0))}.limel-table--row-selector limel-checkbox{transition:opacity 0.2s ease;opacity:0.3}.tabulator-row:hover .limel-table--row-selector limel-checkbox{opacity:1}.has-selection .limel-table--row-selector limel-checkbox{opacity:1}.limel-table--row-selector .tabulator-col-resize-handle{display:none}.limel-table--row-selector+.tabulator-col .tabulator-col-resize-handle.prev,.limel-table--row-selector+.tabulator-cell .tabulator-col-resize-handle.prev{display:none}.has-movable-columns .tabulator-header .tabulator-col.limel-table--row-selector{border:none;cursor:default !important;pointer-events:none;background-color:transparent;background-image:linear-gradient(to right, rgb(var(--table-header-background-color--hover)) 70%, rgb(var(--table-header-background-color--hover), 0));left:0}.has-selection .tabulator-calcs .tabulator-cell{color:var(--table-arrow-color--active)}';const Fs=1;const js=class{constructor(e){t(this,e);this.sort=i(this,"sort",7);this.changePage=i(this,"changePage",7);this.load=i(this,"load",7);this.activate=i(this,"activate",7);this.changeColumns=i(this,"changeColumns",7);this.select=i(this,"select",7);this.selectAll=i(this,"selectAll",7);this.initialized=false;this.destroyed=false;this.shouldSort=false;this.getActiveRows=()=>{if(!this.tabulator){return[]}return this.tabulator.getRows("active")};this.getActiveRowsData=()=>this.getActiveRows().map((t=>t.getData()));this.selectAllOnChange=t=>{const i=t.detail;t.stopPropagation();t.preventDefault();const e=i?this.getActiveRowsData():[];this.select.emit(e);this.tableSelection.setSelection(e);this.selectAll.emit(i)};this.getColumnOptions=()=>{if(!this.movableColumns){return{}}return{movableColumns:true}};this.handleMoveColumn=(t,i)=>{if(!this.movableColumns){return}const e=i.map(this.findColumn).filter(Boolean);this.changeColumns.emit(e)};this.findColumn=t=>this.columns.find((i=>i.field===t.getField()&&i.title===t.getDefinition().title));this.getTranslation=t=>g.get(t,this.language);this.data=[];this.columns=[];this.mode="local";this.layout=undefined;this.pageSize=undefined;this.totalRows=undefined;this.sorting=[];this.activeRow=undefined;this.movableColumns=undefined;this.sortableColumns=true;this.loading=false;this.page=Fs;this.emptyMessage=undefined;this.aggregates=undefined;this.selectable=undefined;this.selection=undefined;this.language="en";this.paginationLocation="bottom";this.handleDataSorting=this.handleDataSorting.bind(this);this.handlePageLoaded=this.handlePageLoaded.bind(this);this.handleRenderComplete=this.handleRenderComplete.bind(this);this.handleAjaxRequesting=this.handleAjaxRequesting.bind(this);this.requestData=this.requestData.bind(this);this.onClickRow=this.onClickRow.bind(this);this.formatRow=this.formatRow.bind(this);this.formatRows=this.formatRows.bind(this);this.updateMaxPage=this.updateMaxPage.bind(this);this.initTabulatorComponent=this.initTabulatorComponent.bind(this);this.setSelection=this.setSelection.bind(this);this.addColumnAggregator=this.addColumnAggregator.bind(this);this.pool=new Rs(document);this.columnFactory=new fs(this.pool)}componentWillLoad(){this.initTableSelection()}componentDidLoad(){this.destroyed=false;this.init()}disconnectedCallback(){this.destroyed=true;this.initialized=false;if(this.resizeObserver){this.resizeObserver.disconnect();this.resizeObserver=null}if(this.tabulator){this.tabulator.destroy();this.tabulator=null}this.pool.clear()}totalRowsChanged(){this.updateMaxPage()}pageSizeChanged(){this.updateMaxPage()}pageChanged(){if(!this.tabulator){return}if(this.tabulator.getPage()===this.page){return}this.tabulator.setPage(this.page)}activeRowChanged(){if(!this.tabulator){return}this.formatRows()}updateData(t=[],i=[]){const e=this.getRowIds(t);const s=this.getRowIds(i);const r=this.shouldReplaceData(e,s);const a=!Ds(t,i);setTimeout((()=>{if(!this.tabulator||!this.initialized){return}if(r){this.pool.releaseAll();this.tabulator.replaceData(t);this.setSelection();return}if(a){this.tabulator.updateData(t);this.setSelection();return}if(t.length>0){this.tabulator.updateOrAddData(t)}}))}updateColumns(t,i){if(!this.tabulator){return}if(this.areSameColumns(t,i)){return}const e=this.tabulator.getColumns().filter((t=>t.getField()));const s=e.map((t=>i.find((i=>i.field===t.getField()))));if(this.areSameColumns(t,s)){return}this.tabulator.setColumns(this.getColumnDefinitions());this.shouldSort=true}updateAggregates(t,i){if(!this.tabulator){return}if(m(t,i)){return}if(!this.haveSameAggregateFields(t,i)){this.init();return}this.tabulator.recalc();this.tabulator.rowManager.redraw()}updateSelection(t){if(!this.tableSelection){return}this.tableSelection.setSelection(t)}updateSelectable(){if(this.tableSelection&&!this.selectable){this.tableSelection=null}this.initTableSelection();this.init()}updateSortableColumns(){if(!this.tabulator){return}this.tabulator.setColumns(this.getColumnDefinitions());this.shouldSort=true}updateSorting(t,i){const e=this.getColumnSorter(t);const s=this.getColumnSorter(i);if(m(e,s)){return}this.tabulator.setSort(e)}shouldReplaceData(t,i){return!this.areEqualIds(t,i)||!this.isSameOrder(t,i)}getRowIds(t){return t.map((t=>{var i;return(i=t.id)!==null&&i!==void 0?i:t}))}areEqualIds(t,i){const e=new Set(t);const s=new Set(i);return e.size===s.size&&t.every((t=>s.has(t)))}isSameOrder(t,i){return t.every(((t,e)=>t===i[e]))}areSameColumns(t,i){return t.length===i.length&&t.every((t=>i.includes(t)))}haveSameAggregateFields(t,i){const e=(i===null||i===void 0?void 0:i.map((t=>t.field)))||[];return(t===null||t===void 0?void 0:t.length)===(i===null||i===void 0?void 0:i.length)&&!!(t===null||t===void 0?void 0:t.every((t=>e.includes(t.field))))}init(){if(this.tabulator){this.pool.releaseAll();this.tabulator.destroy();this.initialized=false}const t=this.host.shadowRoot.querySelector("#tabulator-table");this.initTabulatorComponent(t)}initTabulatorComponent(t){if(!("ResizeObserver"in window)){this.tabulator=this.createTabulator(t);this.setSelection();return}this.resizeObserver=new ResizeObserver((()=>{requestAnimationFrame((()=>{var i,e;if(this.destroyed){return}this.tabulator=this.createTabulator(t);this.setSelection();(i=this.resizeObserver)===null||i===void 0?void 0:i.unobserve(t);(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()}))}));this.resizeObserver.observe(t)}createTabulator(t){const i=new as(t,this.getOptions());i.on("rowClick",this.onClickRow);i.on("dataSorting",this.handleDataSorting);i.on("pageLoaded",this.handlePageLoaded);i.on("columnMoved",this.handleMoveColumn);i.on("renderComplete",this.handleRenderComplete);i.on("tableBuilt",(()=>{var t;if(this.destroyed){i.destroy();return}this.initialized=true;if(this.isRemoteMode()&&!((t=this.data)===null||t===void 0?void 0:t.length)){this.tabulator.setData()}else if(!this.isRemoteMode()){this.updateData(this.data,[])}}));return i}initTableSelection(){if(this.selectable){this.tableSelection=new Ss((()=>this.tabulator),this.pool,this.select,(t=>this.getTranslation(t)));this.tableSelection.setSelection(this.selection)}}setSelection(){if(!(this.tabulator&&this.tableSelection)){return}this.tableSelection.setSelection(this.selection)}updateMaxPage(){var t;(t=this.tabulator)===null||t===void 0?void 0:t.setMaxPage(this.calculatePageCount())}getOptions(){const t=this.getAjaxOptions();const i=this.getPaginationOptions();const e=this.getColumnOptions();return Object.assign(Object.assign(Object.assign(Object.assign({data:this.data,layout:Ts(this.layout),columns:this.getColumnDefinitions()},t),i),{rowFormatter:this.formatRow,initialSort:this.getInitialSorting(),nestedFieldSeparator:false}),e)}getInitialSorting(){if(this.currentSorting&&this.currentSorting.length>0){return this.getColumnSorter(this.currentSorting)}return this.getColumnSorter(this.sorting)}getColumnSorter(t){return t.map((t=>({column:String(t.column.field),dir:t.direction.toLocaleLowerCase()})))}getColumnDefinitions(){const t=this.columns.map(this.addColumnAggregator).map((t=>{var i;const e=this.columnFactory.create(t);const s=(i=t.headerSort)!==null&&i!==void 0?i:true;e.headerSort=this.sortableColumns&&s;return e}));if(this.tableSelection){return this.tableSelection.getColumnDefinitions(t)}return t}addColumnAggregator(t){var i;if(!((i=this.aggregates)===null||i===void 0?void 0:i.length)||t.aggregator){return t}const e=this.aggregates.find((i=>i.field===t.field));if(e){t.aggregator=t=>{var i;if(!t){return}const e=(i=this.aggregates.find((i=>i.field===t.field)))===null||i===void 0?void 0:i.value;if(t.formatter){return t.formatter(e)}return e}}return t}getAjaxOptions(){if(!this.isRemoteMode()){return{}}const t="https://localhost";return{ajaxSorting:true,ajaxURL:t,ajaxRequestFunc:this.requestData,ajaxRequesting:this.handleAjaxRequesting}}handleAjaxRequesting(){return!this.destroyed}getPaginationOptions(){if(!this.pageSize){return{}}return{pagination:true,paginationMode:this.isRemoteMode()?"remote":"local",paginationSize:this.pageSize,paginationInitialPage:this.page}}requestData(t,i,e){var s,r;if(this.destroyed){return Promise.reject()}const a=(s=e.sorters)!==null&&s!==void 0?s:[];const o=(r=e.page)!==null&&r!==void 0?r:Fs;if(this.page!==o){this.changePage.emit(o)}const h=a.map(xs(this.columns));const l={page:o,sorters:h};const n=Promise.resolve({last_page:this.calculatePageCount(),data:this.data});if(!m(this.currentLoad,l)){this.currentSorting=h;this.currentLoad=l;this.load.emit(l)}return n}isRemoteMode(){return this.mode==="remote"}handleDataSorting(t){if(this.isRemoteMode()){return}const i=t.map(xs(this.columns));if(i.length===0){return}this.sort.emit(i)}handlePageLoaded(t){if(this.isRemoteMode()){return}this.changePage.emit(t)}handleRenderComplete(){if(this.tabulator&&this.shouldSort){this.shouldSort=false;this.tabulator.setSort(this.getColumnSorter(this.sorting))}}onClickRow(t,i){if(i.getPosition===undefined){return}if(t.defaultPrevented){return}if(this.isActiveRow(i)){this.activeRow=null}else{this.activeRow=i.getData()}this.activate.emit(this.activeRow)}formatRows(){this.tabulator.getRows().forEach(this.formatRow)}formatRow(t){if(this.isActiveRow(t)){t.getElement().classList.add("active")}else{t.getElement().classList.remove("active")}const i=t.getElement().querySelectorAll(".interactive-feedback");if(i.length===0){const i=t.getElement().ownerDocument.createElement("div");i.classList.add("interactive-feedback");t.getElement().prepend(i)}}isActiveRow(t){var i;if(!this.activeRow){return false}const e=(i=this.activeRow.id)!==null&&i!==void 0?i:null;if(e!==null){return e===t.getData().id}return this.activeRow===t.getData()}calculatePageCount(){let t=this.totalRows;if(!t){t=this.data.length}return Math.ceil(t/this.pageSize)}hasAggregation(t){return t.some((t=>x(t,"aggregator")))}render(){var t,i;const r=(t=this.totalRows)!==null&&t!==void 0?t:this.data.length;return e(s,{class:{"has-low-density":this.layout==="lowDensity","has-pagination-on-top":this.paginationLocation==="top"}},e("div",{id:"tabulator-container",class:{"has-pagination":r>this.pageSize,"has-aggregation":this.hasAggregation(this.columns),"has-movable-columns":this.movableColumns,"has-rowselector":this.selectable,"has-selection":(i=this.tableSelection)===null||i===void 0?void 0:i.hasSelection}},e("div",{id:"tabulator-loader",style:{display:this.loading?"flex":"none"}},e("limel-spinner",{size:"large"})),this.renderEmptyMessage(),this.renderSelectAll(),e("div",{id:"tabulator-table"})))}renderSelectAll(){var t,i,s;if(!this.selectable){return}const r=!this.loading&&this.tableSelection;return e("div",{class:"select-all",style:{display:r?"inline-block":"none"}},e("limel-checkbox",{class:"hide-label",onChange:this.selectAllOnChange,disabled:this.data.length===0,checked:(t=this.tableSelection)===null||t===void 0?void 0:t.hasSelection,indeterminate:((i=this.tableSelection)===null||i===void 0?void 0:i.hasSelection)&&((s=this.selection)===null||s===void 0?void 0:s.length)<this.data.length,label:this.getTranslation("table.select-all")}))}renderEmptyMessage(){const t=!this.loading&&this.data.length===0&&this.emptyMessage;return e("div",{id:"tabulator-empty-text",style:{display:t?"flex":"none"}},e("span",null,this.emptyMessage))}get host(){return r(this)}static get watchers(){return{totalRows:["totalRowsChanged"],pageSize:["pageSizeChanged"],page:["pageChanged"],activeRow:["activeRowChanged"],data:["updateData"],columns:["updateColumns"],aggregates:["updateAggregates"],selection:["updateSelection"],selectable:["updateSelectable"],sortableColumns:["updateSortableColumns"],sorting:["updateSorting"]}}};js.style=Ps;export{js as limel_table};
2
+ //# sourceMappingURL=p-f6d8811f.entry.js.map