snice 4.14.0 → 4.16.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 (384) hide show
  1. package/adapters/react/doc.d.ts +1 -0
  2. package/adapters/react/doc.d.ts.map +1 -1
  3. package/adapters/react/doc.js +1 -1
  4. package/adapters/react/doc.js.map +1 -1
  5. package/adapters/react/doc.tsx +2 -1
  6. package/adapters/react/input.d.ts +3 -0
  7. package/adapters/react/input.d.ts.map +1 -1
  8. package/adapters/react/input.js +1 -1
  9. package/adapters/react/input.js.map +1 -1
  10. package/adapters/react/input.tsx +4 -1
  11. package/adapters/react/modal.d.ts +2 -0
  12. package/adapters/react/modal.d.ts.map +1 -1
  13. package/adapters/react/modal.js +1 -1
  14. package/adapters/react/modal.js.map +1 -1
  15. package/adapters/react/modal.tsx +3 -1
  16. package/dist/cdn/accordion/snice-accordion.js +1 -1
  17. package/dist/cdn/accordion/snice-accordion.min.js +1 -1
  18. package/dist/cdn/alert/snice-alert.js +1 -1
  19. package/dist/cdn/alert/snice-alert.min.js +1 -1
  20. package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
  21. package/dist/cdn/app-tiles/snice-app-tiles.min.js +1 -1
  22. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  23. package/dist/cdn/audio-recorder/snice-audio-recorder.min.js +1 -1
  24. package/dist/cdn/avatar/snice-avatar.js +1 -1
  25. package/dist/cdn/avatar/snice-avatar.min.js +1 -1
  26. package/dist/cdn/badge/snice-badge.js +1 -1
  27. package/dist/cdn/badge/snice-badge.min.js +1 -1
  28. package/dist/cdn/banner/snice-banner.js +1 -1
  29. package/dist/cdn/banner/snice-banner.min.js +1 -1
  30. package/dist/cdn/book/README.md +2 -2
  31. package/dist/cdn/book/snice-book.js +29 -8
  32. package/dist/cdn/book/snice-book.js.map +1 -1
  33. package/dist/cdn/book/snice-book.min.js +3 -3
  34. package/dist/cdn/book/snice-book.min.js.map +1 -1
  35. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
  36. package/dist/cdn/breadcrumbs/snice-breadcrumbs.min.js +1 -1
  37. package/dist/cdn/button/snice-button.js +1 -1
  38. package/dist/cdn/button/snice-button.min.js +1 -1
  39. package/dist/cdn/calendar/snice-calendar.js +1 -1
  40. package/dist/cdn/calendar/snice-calendar.min.js +1 -1
  41. package/dist/cdn/camera/snice-camera.js +1 -1
  42. package/dist/cdn/camera/snice-camera.min.js +1 -1
  43. package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
  44. package/dist/cdn/camera-annotate/snice-camera-annotate.min.js +1 -1
  45. package/dist/cdn/candlestick/snice-candlestick.js +1 -1
  46. package/dist/cdn/candlestick/snice-candlestick.min.js +1 -1
  47. package/dist/cdn/card/snice-card.js +1 -1
  48. package/dist/cdn/card/snice-card.min.js +1 -1
  49. package/dist/cdn/carousel/snice-carousel.js +1 -1
  50. package/dist/cdn/carousel/snice-carousel.min.js +1 -1
  51. package/dist/cdn/chart/snice-chart.js +1 -1
  52. package/dist/cdn/chart/snice-chart.min.js +1 -1
  53. package/dist/cdn/chat/snice-chat.js +1 -1
  54. package/dist/cdn/chat/snice-chat.min.js +1 -1
  55. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  56. package/dist/cdn/checkbox/snice-checkbox.min.js +1 -1
  57. package/dist/cdn/chip/snice-chip.js +1 -1
  58. package/dist/cdn/chip/snice-chip.min.js +1 -1
  59. package/dist/cdn/code-block/snice-code-block.js +4 -4
  60. package/dist/cdn/code-block/snice-code-block.js.map +1 -1
  61. package/dist/cdn/code-block/snice-code-block.min.js +2 -2
  62. package/dist/cdn/code-block/snice-code-block.min.js.map +1 -1
  63. package/dist/cdn/color-display/snice-color-display.js +1 -1
  64. package/dist/cdn/color-display/snice-color-display.min.js +1 -1
  65. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  66. package/dist/cdn/color-picker/snice-color-picker.min.js +1 -1
  67. package/dist/cdn/command-palette/snice-command-palette.js +1 -1
  68. package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
  69. package/dist/cdn/comments/snice-comments.js +1 -1
  70. package/dist/cdn/comments/snice-comments.min.js +1 -1
  71. package/dist/cdn/countdown/snice-countdown.js +1 -1
  72. package/dist/cdn/countdown/snice-countdown.min.js +1 -1
  73. package/dist/cdn/cropper/snice-cropper.js +1 -1
  74. package/dist/cdn/cropper/snice-cropper.min.js +1 -1
  75. package/dist/cdn/date-picker/README.md +1 -1
  76. package/dist/cdn/date-picker/snice-date-picker.js +49 -39
  77. package/dist/cdn/date-picker/snice-date-picker.js.map +1 -1
  78. package/dist/cdn/date-picker/snice-date-picker.min.js +4 -4
  79. package/dist/cdn/date-picker/snice-date-picker.min.js.map +1 -1
  80. package/dist/cdn/diff/snice-diff.js +1 -1
  81. package/dist/cdn/diff/snice-diff.min.js +1 -1
  82. package/dist/cdn/divider/snice-divider.js +1 -1
  83. package/dist/cdn/divider/snice-divider.min.js +1 -1
  84. package/dist/cdn/doc/README.md +2 -2
  85. package/dist/cdn/doc/snice-doc.js +221 -35
  86. package/dist/cdn/doc/snice-doc.js.map +1 -1
  87. package/dist/cdn/doc/snice-doc.min.js +2 -2
  88. package/dist/cdn/doc/snice-doc.min.js.map +1 -1
  89. package/dist/cdn/draw/snice-draw.js +1 -1
  90. package/dist/cdn/draw/snice-draw.min.js +1 -1
  91. package/dist/cdn/drawer/snice-drawer.js +1 -1
  92. package/dist/cdn/drawer/snice-drawer.min.js +1 -1
  93. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  94. package/dist/cdn/empty-state/snice-empty-state.min.js +1 -1
  95. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  96. package/dist/cdn/file-gallery/snice-file-gallery.min.js +1 -1
  97. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  98. package/dist/cdn/file-upload/snice-file-upload.min.js +1 -1
  99. package/dist/cdn/flip-card/snice-flip-card.js +1 -1
  100. package/dist/cdn/flip-card/snice-flip-card.min.js +1 -1
  101. package/dist/cdn/flow/snice-flow.js +1 -1
  102. package/dist/cdn/flow/snice-flow.min.js +1 -1
  103. package/dist/cdn/funnel/snice-funnel.js +1 -1
  104. package/dist/cdn/funnel/snice-funnel.min.js +1 -1
  105. package/dist/cdn/gantt/snice-gantt.js +1 -1
  106. package/dist/cdn/gantt/snice-gantt.min.js +1 -1
  107. package/dist/cdn/gauge/snice-gauge.js +1 -1
  108. package/dist/cdn/gauge/snice-gauge.min.js +1 -1
  109. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  110. package/dist/cdn/heatmap/snice-heatmap.min.js +1 -1
  111. package/dist/cdn/image/snice-image.js +1 -1
  112. package/dist/cdn/image/snice-image.min.js +1 -1
  113. package/dist/cdn/input/README.md +2 -2
  114. package/dist/cdn/input/snice-input.js +21 -3
  115. package/dist/cdn/input/snice-input.js.map +1 -1
  116. package/dist/cdn/input/snice-input.min.js +3 -3
  117. package/dist/cdn/input/snice-input.min.js.map +1 -1
  118. package/dist/cdn/kanban/snice-kanban.js +1 -1
  119. package/dist/cdn/kanban/snice-kanban.min.js +1 -1
  120. package/dist/cdn/kpi/snice-kpi.js +1 -1
  121. package/dist/cdn/kpi/snice-kpi.min.js +1 -1
  122. package/dist/cdn/layout/snice-layout.js +1 -1
  123. package/dist/cdn/layout/snice-layout.min.js +1 -1
  124. package/dist/cdn/link/snice-link.js +1 -1
  125. package/dist/cdn/link/snice-link.min.js +1 -1
  126. package/dist/cdn/link-preview/snice-link-preview.js +2 -2
  127. package/dist/cdn/link-preview/snice-link-preview.js.map +1 -1
  128. package/dist/cdn/link-preview/snice-link-preview.min.js +2 -2
  129. package/dist/cdn/link-preview/snice-link-preview.min.js.map +1 -1
  130. package/dist/cdn/list/snice-list.js +4 -4
  131. package/dist/cdn/list/snice-list.js.map +1 -1
  132. package/dist/cdn/list/snice-list.min.js +2 -2
  133. package/dist/cdn/list/snice-list.min.js.map +1 -1
  134. package/dist/cdn/location/snice-location.js +1 -1
  135. package/dist/cdn/location/snice-location.min.js +1 -1
  136. package/dist/cdn/login/snice-login.js +1 -1
  137. package/dist/cdn/login/snice-login.min.js +1 -1
  138. package/dist/cdn/map/snice-map.js +1 -1
  139. package/dist/cdn/map/snice-map.min.js +1 -1
  140. package/dist/cdn/markdown/snice-markdown.js +1 -1
  141. package/dist/cdn/markdown/snice-markdown.min.js +1 -1
  142. package/dist/cdn/masonry/snice-masonry.js +1 -1
  143. package/dist/cdn/masonry/snice-masonry.min.js +1 -1
  144. package/dist/cdn/menu/snice-menu.js +2 -2
  145. package/dist/cdn/menu/snice-menu.js.map +1 -1
  146. package/dist/cdn/menu/snice-menu.min.js +2 -2
  147. package/dist/cdn/menu/snice-menu.min.js.map +1 -1
  148. package/dist/cdn/modal/README.md +2 -2
  149. package/dist/cdn/modal/snice-modal.js +34 -18
  150. package/dist/cdn/modal/snice-modal.js.map +1 -1
  151. package/dist/cdn/modal/snice-modal.min.js +24 -20
  152. package/dist/cdn/modal/snice-modal.min.js.map +1 -1
  153. package/dist/cdn/music-player/README.md +2 -2
  154. package/dist/cdn/music-player/snice-music-player.js +8 -1
  155. package/dist/cdn/music-player/snice-music-player.js.map +1 -1
  156. package/dist/cdn/music-player/snice-music-player.min.js +3 -3
  157. package/dist/cdn/music-player/snice-music-player.min.js.map +1 -1
  158. package/dist/cdn/nav/snice-nav.js +1 -1
  159. package/dist/cdn/nav/snice-nav.min.js +1 -1
  160. package/dist/cdn/network-graph/snice-network-graph.js +1 -1
  161. package/dist/cdn/network-graph/snice-network-graph.min.js +1 -1
  162. package/dist/cdn/notification-center/snice-notification-center.js +1 -1
  163. package/dist/cdn/notification-center/snice-notification-center.min.js +1 -1
  164. package/dist/cdn/org-chart/snice-org-chart.js +1 -1
  165. package/dist/cdn/org-chart/snice-org-chart.min.js +1 -1
  166. package/dist/cdn/pagination/snice-pagination.js +1 -1
  167. package/dist/cdn/pagination/snice-pagination.min.js +1 -1
  168. package/dist/cdn/paint/snice-paint.js +1 -1
  169. package/dist/cdn/paint/snice-paint.min.js +1 -1
  170. package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
  171. package/dist/cdn/pdf-viewer/snice-pdf-viewer.min.js +1 -1
  172. package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
  173. package/dist/cdn/podcast-player/snice-podcast-player.min.js +1 -1
  174. package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
  175. package/dist/cdn/pricing-table/snice-pricing-table.min.js +1 -1
  176. package/dist/cdn/progress/snice-progress.js +1 -1
  177. package/dist/cdn/progress/snice-progress.min.js +1 -1
  178. package/dist/cdn/qr-code/snice-qr-code.js +1 -1
  179. package/dist/cdn/qr-code/snice-qr-code.min.js +1 -1
  180. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  181. package/dist/cdn/qr-reader/snice-qr-reader.min.js +1 -1
  182. package/dist/cdn/radio/README.md +2 -2
  183. package/dist/cdn/radio/snice-radio.js +23 -3
  184. package/dist/cdn/radio/snice-radio.js.map +1 -1
  185. package/dist/cdn/radio/snice-radio.min.js +3 -3
  186. package/dist/cdn/radio/snice-radio.min.js.map +1 -1
  187. package/dist/cdn/rating/snice-rating.js +1 -1
  188. package/dist/cdn/rating/snice-rating.min.js +1 -1
  189. package/dist/cdn/recipe/snice-recipe.js +1 -1
  190. package/dist/cdn/recipe/snice-recipe.min.js +1 -1
  191. package/dist/cdn/runtime/README.md +2 -2
  192. package/dist/cdn/runtime/snice-runtime.esm.js +513 -46
  193. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  194. package/dist/cdn/runtime/snice-runtime.esm.min.js +6 -6
  195. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  196. package/dist/cdn/runtime/snice-runtime.js +6420 -5951
  197. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  198. package/dist/cdn/runtime/snice-runtime.min.js +18 -18
  199. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  200. package/dist/cdn/sankey/snice-sankey.js +1 -1
  201. package/dist/cdn/sankey/snice-sankey.min.js +1 -1
  202. package/dist/cdn/select/README.md +2 -2
  203. package/dist/cdn/select/snice-select.js +46 -92
  204. package/dist/cdn/select/snice-select.js.map +1 -1
  205. package/dist/cdn/select/snice-select.min.js +5 -13
  206. package/dist/cdn/select/snice-select.min.js.map +1 -1
  207. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  208. package/dist/cdn/skeleton/snice-skeleton.min.js +1 -1
  209. package/dist/cdn/slider/snice-slider.js +1 -1
  210. package/dist/cdn/slider/snice-slider.min.js +1 -1
  211. package/dist/cdn/sortable/snice-sortable.js +1 -1
  212. package/dist/cdn/sortable/snice-sortable.min.js +1 -1
  213. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  214. package/dist/cdn/sparkline/snice-sparkline.min.js +1 -1
  215. package/dist/cdn/spinner/snice-spinner.js +1 -1
  216. package/dist/cdn/spinner/snice-spinner.min.js +1 -1
  217. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  218. package/dist/cdn/split-pane/snice-split-pane.min.js +1 -1
  219. package/dist/cdn/spotlight/snice-spotlight.js +1 -1
  220. package/dist/cdn/spotlight/snice-spotlight.min.js +1 -1
  221. package/dist/cdn/spreadsheet/snice-spreadsheet.js +1 -1
  222. package/dist/cdn/spreadsheet/snice-spreadsheet.min.js +1 -1
  223. package/dist/cdn/stepper/snice-stepper.js +1 -1
  224. package/dist/cdn/stepper/snice-stepper.min.js +1 -1
  225. package/dist/cdn/switch/README.md +1 -1
  226. package/dist/cdn/switch/snice-switch.js +33 -23
  227. package/dist/cdn/switch/snice-switch.js.map +1 -1
  228. package/dist/cdn/switch/snice-switch.min.js +3 -3
  229. package/dist/cdn/switch/snice-switch.min.js.map +1 -1
  230. package/dist/cdn/table/README.md +2 -2
  231. package/dist/cdn/table/snice-table.js +2876 -111
  232. package/dist/cdn/table/snice-table.js.map +1 -1
  233. package/dist/cdn/table/snice-table.min.js +187 -47
  234. package/dist/cdn/table/snice-table.min.js.map +1 -1
  235. package/dist/cdn/tabs/snice-tabs.js +1 -1
  236. package/dist/cdn/tabs/snice-tabs.min.js +1 -1
  237. package/dist/cdn/tag-input/snice-tag-input.js +1 -1
  238. package/dist/cdn/tag-input/snice-tag-input.min.js +1 -1
  239. package/dist/cdn/terminal/snice-terminal.js +1 -1
  240. package/dist/cdn/terminal/snice-terminal.min.js +1 -1
  241. package/dist/cdn/testimonial/snice-testimonial.js +1 -1
  242. package/dist/cdn/testimonial/snice-testimonial.min.js +1 -1
  243. package/dist/cdn/textarea/snice-textarea.js +1 -1
  244. package/dist/cdn/textarea/snice-textarea.min.js +1 -1
  245. package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
  246. package/dist/cdn/time-range-picker/snice-time-range-picker.min.js +1 -1
  247. package/dist/cdn/timeline/snice-timeline.js +1 -1
  248. package/dist/cdn/timeline/snice-timeline.min.js +1 -1
  249. package/dist/cdn/timer/snice-timer.js +1 -1
  250. package/dist/cdn/timer/snice-timer.min.js +1 -1
  251. package/dist/cdn/toast/README.md +1 -1
  252. package/dist/cdn/toast/snice-toast.js +3 -3
  253. package/dist/cdn/toast/snice-toast.js.map +1 -1
  254. package/dist/cdn/toast/snice-toast.min.js +2 -2
  255. package/dist/cdn/toast/snice-toast.min.js.map +1 -1
  256. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  257. package/dist/cdn/tooltip/snice-tooltip.min.js +1 -1
  258. package/dist/cdn/tree/snice-tree.js +1 -1
  259. package/dist/cdn/tree/snice-tree.min.js +1 -1
  260. package/dist/cdn/treemap/snice-treemap.js +1 -1
  261. package/dist/cdn/treemap/snice-treemap.min.js +1 -1
  262. package/dist/cdn/video-player/snice-video-player.js +1 -1
  263. package/dist/cdn/video-player/snice-video-player.min.js +1 -1
  264. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
  265. package/dist/cdn/virtual-scroller/snice-virtual-scroller.min.js +1 -1
  266. package/dist/cdn/waterfall/snice-waterfall.js +1 -1
  267. package/dist/cdn/waterfall/snice-waterfall.min.js +1 -1
  268. package/dist/cdn/weather/snice-weather.js +1 -1
  269. package/dist/cdn/weather/snice-weather.min.js +1 -1
  270. package/dist/components/book/snice-book.d.ts +2 -0
  271. package/dist/components/book/snice-book.js +28 -7
  272. package/dist/components/book/snice-book.js.map +1 -1
  273. package/dist/components/book/snice-book.types.d.ts +7 -0
  274. package/dist/components/code-block/snice-code-block.js +3 -3
  275. package/dist/components/code-block/snice-code-block.js.map +1 -1
  276. package/dist/components/code-block/snice-code-block.types.d.ts +3 -3
  277. package/dist/components/date-picker/snice-date-picker.d.ts +2 -0
  278. package/dist/components/date-picker/snice-date-picker.js +49 -39
  279. package/dist/components/date-picker/snice-date-picker.js.map +1 -1
  280. package/dist/components/doc/snice-doc.d.ts +20 -0
  281. package/dist/components/doc/snice-doc.js +220 -34
  282. package/dist/components/doc/snice-doc.js.map +1 -1
  283. package/dist/components/input/snice-input.d.ts +3 -0
  284. package/dist/components/input/snice-input.js +20 -2
  285. package/dist/components/input/snice-input.js.map +1 -1
  286. package/dist/components/input/snice-input.types.d.ts +3 -0
  287. package/dist/components/link-preview/snice-link-preview.js +1 -1
  288. package/dist/components/link-preview/snice-link-preview.js.map +1 -1
  289. package/dist/components/list/snice-list.js +3 -3
  290. package/dist/components/list/snice-list.js.map +1 -1
  291. package/dist/components/menu/snice-menu.js +1 -1
  292. package/dist/components/menu/snice-menu.js.map +1 -1
  293. package/dist/components/modal/snice-modal.d.ts +2 -0
  294. package/dist/components/modal/snice-modal.js +33 -17
  295. package/dist/components/modal/snice-modal.js.map +1 -1
  296. package/dist/components/modal/snice-modal.types.d.ts +2 -0
  297. package/dist/components/music-player/snice-music-player.d.ts +1 -0
  298. package/dist/components/music-player/snice-music-player.js +7 -0
  299. package/dist/components/music-player/snice-music-player.js.map +1 -1
  300. package/dist/components/notification-center/snice-notification-center.d.ts +1 -1
  301. package/dist/components/notification-center/snice-notification-center.js.map +1 -1
  302. package/dist/components/notification-center/snice-notification-center.types.d.ts +1 -0
  303. package/dist/components/radio/snice-radio.d.ts +1 -0
  304. package/dist/components/radio/snice-radio.js +22 -2
  305. package/dist/components/radio/snice-radio.js.map +1 -1
  306. package/dist/components/select/snice-select.d.ts +2 -4
  307. package/dist/components/select/snice-select.js +46 -92
  308. package/dist/components/select/snice-select.js.map +1 -1
  309. package/dist/components/switch/snice-switch.d.ts +2 -0
  310. package/dist/components/switch/snice-switch.js +32 -22
  311. package/dist/components/switch/snice-switch.js.map +1 -1
  312. package/dist/components/table/snice-table.d.ts +2 -0
  313. package/dist/components/table/snice-table.js +17 -3
  314. package/dist/components/table/snice-table.js.map +1 -1
  315. package/dist/components/toast/snice-toast-container.js +2 -2
  316. package/dist/components/toast/snice-toast-container.js.map +1 -1
  317. package/dist/index.cjs +512 -43
  318. package/dist/index.cjs.map +1 -1
  319. package/dist/index.d.ts +1 -0
  320. package/dist/index.esm.js +511 -44
  321. package/dist/index.esm.js.map +1 -1
  322. package/dist/index.iife.js +512 -43
  323. package/dist/index.iife.js.map +1 -1
  324. package/dist/symbols.cjs +1 -1
  325. package/dist/symbols.esm.js +1 -1
  326. package/dist/tooltip-observer.d.ts +11 -0
  327. package/dist/transitions.cjs +1 -1
  328. package/dist/transitions.esm.js +1 -1
  329. package/docs/ai/DEVELOPMENT.md +1 -1
  330. package/docs/ai/api.md +14 -10
  331. package/docs/ai/architecture.md +18 -5
  332. package/docs/ai/components/app-tiles.md +1 -1
  333. package/docs/ai/components/book.md +5 -6
  334. package/docs/ai/components/camera-annotate.md +3 -3
  335. package/docs/ai/components/candlestick.md +3 -3
  336. package/docs/ai/components/chart.md +1 -1
  337. package/docs/ai/components/code-block.md +3 -3
  338. package/docs/ai/components/doc.md +26 -15
  339. package/docs/ai/components/file-gallery.md +1 -1
  340. package/docs/ai/components/input.md +10 -0
  341. package/docs/ai/components/link-preview.md +1 -1
  342. package/docs/ai/components/list.md +2 -2
  343. package/docs/ai/components/markdown.md +13 -6
  344. package/docs/ai/components/modal.md +2 -0
  345. package/docs/ai/components/music-player.md +3 -2
  346. package/docs/ai/components/network-graph.md +5 -5
  347. package/docs/ai/components/notification-center.md +1 -0
  348. package/docs/ai/components/pdf-viewer.md +1 -1
  349. package/docs/ai/components/radio.md +2 -2
  350. package/docs/ai/components/sankey.md +3 -3
  351. package/docs/ai/components/select.md +1 -1
  352. package/docs/ai/components/tooltip.md +54 -0
  353. package/docs/ai/decorators.md +4 -4
  354. package/docs/code-block.md +4 -4
  355. package/docs/components/app-tiles.md +1 -1
  356. package/docs/components/book.md +3 -4
  357. package/docs/components/button.md +2 -2
  358. package/docs/components/camera-annotate.md +6 -6
  359. package/docs/components/candlestick.md +6 -6
  360. package/docs/components/chart.md +4 -6
  361. package/docs/components/checkbox.md +3 -3
  362. package/docs/components/chip.md +4 -4
  363. package/docs/components/code-block.md +4 -3
  364. package/docs/components/doc.md +99 -58
  365. package/docs/components/file-gallery.md +25 -3
  366. package/docs/components/input.md +20 -0
  367. package/docs/components/kpi.md +2 -3
  368. package/docs/components/link-preview.md +2 -2
  369. package/docs/components/list.md +3 -3
  370. package/docs/components/markdown.md +14 -36
  371. package/docs/components/modal.md +2 -0
  372. package/docs/components/music-player.md +3 -2
  373. package/docs/components/network-graph.md +7 -7
  374. package/docs/components/notification-center.md +1 -0
  375. package/docs/components/pdf-viewer.md +1 -1
  376. package/docs/components/sankey.md +6 -6
  377. package/docs/components/switch.md +1 -1
  378. package/docs/components/table.md +2 -2
  379. package/docs/components/tooltip.md +133 -0
  380. package/docs/controllers.md +3 -14
  381. package/docs/elements.md +0 -1
  382. package/docs/events.md +3 -0
  383. package/docs/request-response.md +2 -0
  384. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  /*!
2
- * snice v4.13.0
2
+ * snice v4.15.0
3
3
  * Imperative TypeScript framework for building vanilla web components with decorators, differential rendering, routing, and controllers. No virtual DOM, no build complexity.
4
4
  * (c) 2024
5
5
  * Released under the MIT License.
6
6
  */
7
- void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-table.min.js");var SniceTable=function(e,t){"use strict";function a(e,t,a,i,s,n){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,o=i.kind,c="getter"===o?"get":"setter"===o?"set":"value",h=!t&&e?i.static?e:e.prototype:null,d=t||(h?Object.getOwnPropertyDescriptor(h,i.name):{}),u=!1,p=a.length-1;p>=0;p--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(e||null))};var v=(0,a[p])("accessor"===o?{get:d.get,set:d.set}:d[c],m);if("accessor"===o){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(r=l(v.get))&&(d.get=r),(r=l(v.set))&&(d.set=r),(r=l(v.init))&&s.unshift(r)}else(r=l(v))&&("field"===o?s.unshift(r):d[c]=r)}h&&Object.defineProperty(h,i.name,d),u=!0}function i(e,t,a){for(var i=arguments.length>2,s=0;s<t.length;s++)a=i?t[s].call(e,a):t[s].call(e);return i?a:void 0}function s(e,a="icon"){if(!e)return t.html``;if(e.startsWith("img://")){const i=e.slice(6);return t.html`<img class="${a}" src="${i}" alt="" part="icon" />`}if(e.startsWith("text://")){const i=e.slice(7);return t.html`<span class="${a}" part="icon">${i}</span>`}return/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(e)||/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)$/i.test(e)?t.html`<img class="${a}" src="${e}" alt="" part="icon" />`:t.html`<span class="${a}" part="icon">${e}</span>`}"function"==typeof SuppressedError&&SuppressedError;(()=>{let e,n,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x,S,C,E,$,D,A,T,L,O,N,B,z,M,V,j,F,I,q,P,R,H,Y,W,U,K,G,J,X,Z,Q,_,ee,te,ae=[t.element("snice-input",{formAssociated:!0})],ie=[],se=HTMLElement,ne=[],le=[],re=[],oe=[],ce=[],he=[],de=[],ue=[],pe=[],me=[],ge=[],ve=[],be=[],ye=[],fe=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],$e=[],De=[],Ae=[],Te=[],Le=[],Oe=[],Ne=[],Be=[],ze=[],Me=[],Ve=[],je=[],Fe=[],Ie=[],qe=[],Pe=[],Re=[],He=[],Ye=[],We=[],Ue=[],Ke=[],Ge=[],Je=[],Xe=[],Ze=[],Qe=[],_e=[],et=[],tt=[],at=[],it=[],st=[],nt=[],lt=[],rt=[];(class extends se{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(se[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({})],h=[t.property({})],d=[t.property({})],u=[t.property({attribute:"helper-text"})],p=[t.property({attribute:"error-text"})],m=[t.property({type:Boolean})],g=[t.property({type:Boolean})],v=[t.property({type:Boolean})],b=[t.property({type:Boolean})],y=[t.property({type:Boolean})],f=[t.property({type:Boolean})],w=[t.property({type:Boolean})],k=[t.property({})],x=[t.property({})],S=[t.property({})],C=[t.property({})],E=[t.property({type:Number})],$=[t.property({type:Number})],D=[t.property({})],A=[t.property({})],T=[t.property({attribute:"prefix-icon"})],L=[t.property({attribute:"suffix-icon"})],O=[t.query(".input")],N=[t.query(".clear-button")],B=[t.query(".password-toggle")],z=[t.render()],M=[t.styles()],V=[t.ready()],j=[t.watch("value")],F=[t.watch("invalid")],I=[t.watch("disabled")],q=[t.watch("loading")],P=[t.watch("readonly")],R=[t.watch("placeholder")],H=[t.watch("min")],Y=[t.watch("max")],W=[t.watch("step")],U=[t.watch("maxlength")],K=[t.watch("minlength")],G=[t.watch("pattern")],J=[t.watch("type")],X=[t.watch("label")],Z=[t.dispatch("input-input",{bubbles:!0,composed:!0})],Q=[t.dispatch("input-change",{bubbles:!0,composed:!0})],_=[t.dispatch("input-focus",{bubbles:!0,composed:!0})],ee=[t.dispatch("input-blur",{bubbles:!0,composed:!0})],te=[t.dispatch("input-clear",{bubbles:!0,composed:!0})],a(this,null,z,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:s},null,ne),a(this,null,M,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:s},null,ne),a(this,null,V,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:s},null,ne),a(this,null,j,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:s},null,ne),a(this,null,F,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:s},null,ne),a(this,null,I,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:s},null,ne),a(this,null,q,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:s},null,ne),a(this,null,P,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:e=>"handleReadonlyChange"in e,get:e=>e.handleReadonlyChange},metadata:s},null,ne),a(this,null,R,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:e=>"handlePlaceholderChange"in e,get:e=>e.handlePlaceholderChange},metadata:s},null,ne),a(this,null,H,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:e=>"handleMinChange"in e,get:e=>e.handleMinChange},metadata:s},null,ne),a(this,null,Y,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:e=>"handleMaxChange"in e,get:e=>e.handleMaxChange},metadata:s},null,ne),a(this,null,W,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:e=>"handleStepChange"in e,get:e=>e.handleStepChange},metadata:s},null,ne),a(this,null,U,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:e=>"handleMaxLengthChange"in e,get:e=>e.handleMaxLengthChange},metadata:s},null,ne),a(this,null,K,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:e=>"handleMinLengthChange"in e,get:e=>e.handleMinLengthChange},metadata:s},null,ne),a(this,null,G,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:e=>"handlePatternChange"in e,get:e=>e.handlePatternChange},metadata:s},null,ne),a(this,null,J,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:e=>"handleTypeChange"in e,get:e=>e.handleTypeChange},metadata:s},null,ne),a(this,null,X,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:e=>"handleLabelChange"in e,get:e=>e.handleLabelChange},metadata:s},null,ne),a(this,null,Z,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:e=>"dispatchInputEvent"in e,get:e=>e.dispatchInputEvent},metadata:s},null,ne),a(this,null,Q,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:s},null,ne),a(this,null,_,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:e=>"dispatchFocusEvent"in e,get:e=>e.dispatchFocusEvent},metadata:s},null,ne),a(this,null,ee,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:e=>"dispatchBlurEvent"in e,get:e=>e.dispatchBlurEvent},metadata:s},null,ne),a(this,null,te,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:e=>"dispatchClearEvent"in e,get:e=>e.dispatchClearEvent},metadata:s},null,ne),a(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:s},le,re),a(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:s},oe,ce),a(null,null,o,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:s},he,de),a(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:s},ue,pe),a(null,null,h,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:s},me,ge),a(null,null,d,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:s},ve,be),a(null,null,u,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:s},ye,fe),a(null,null,p,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:s},we,ke),a(null,null,m,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:s},xe,Se),a(null,null,g,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:s},Ce,Ee),a(null,null,v,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:s},$e,De),a(null,null,b,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:s},Ae,Te),a(null,null,y,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:s},Le,Oe),a(null,null,f,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:s},Ne,Be),a(null,null,w,{kind:"field",name:"password",static:!1,private:!1,access:{has:e=>"password"in e,get:e=>e.password,set:(e,t)=>{e.password=t}},metadata:s},ze,Me),a(null,null,k,{kind:"field",name:"min",static:!1,private:!1,access:{has:e=>"min"in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:s},Ve,je),a(null,null,x,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:s},Fe,Ie),a(null,null,S,{kind:"field",name:"step",static:!1,private:!1,access:{has:e=>"step"in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:s},qe,Pe),a(null,null,C,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:e=>"pattern"in e,get:e=>e.pattern,set:(e,t)=>{e.pattern=t}},metadata:s},Re,He),a(null,null,E,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:e=>"maxlength"in e,get:e=>e.maxlength,set:(e,t)=>{e.maxlength=t}},metadata:s},Ye,We),a(null,null,$,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:e=>"minlength"in e,get:e=>e.minlength,set:(e,t)=>{e.minlength=t}},metadata:s},Ue,Ke),a(null,null,D,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:s},Ge,Je),a(null,null,A,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:s},Xe,Ze),a(null,null,T,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:e=>"prefixIcon"in e,get:e=>e.prefixIcon,set:(e,t)=>{e.prefixIcon=t}},metadata:s},Qe,_e),a(null,null,L,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:e=>"suffixIcon"in e,get:e=>e.suffixIcon,set:(e,t)=>{e.suffixIcon=t}},metadata:s},et,tt),a(null,null,O,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:s},at,it),a(null,null,N,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:s},st,nt),a(null,null,B,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:e=>"passwordToggle"in e,get:e=>e.passwordToggle,set:(e,t)=>{e.passwordToggle=t}},metadata:s},lt,rt),a(null,e={value:n},ae,{kind:"class",name:n.name,metadata:s},null,ie),n=e.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),i(n,ie)}constructor(){super(),this.internals=i(this,ne),this.type=i(this,le,"text"),this.size=(i(this,re),i(this,oe,"medium")),this.variant=(i(this,ce),i(this,he,"outlined")),this.value=(i(this,de),i(this,ue,"")),this.placeholder=(i(this,pe),i(this,me,"")),this.label=(i(this,ge),i(this,ve,"")),this.helperText=(i(this,be),i(this,ye,"")),this.errorText=(i(this,fe),i(this,we,"")),this.disabled=(i(this,ke),i(this,xe,!1)),this.readonly=(i(this,Se),i(this,Ce,!1)),this.loading=(i(this,Ee),i(this,$e,!1)),this.required=(i(this,De),i(this,Ae,!1)),this.invalid=(i(this,Te),i(this,Le,!1)),this.clearable=(i(this,Oe),i(this,Ne,!1)),this.password=(i(this,Be),i(this,ze,!1)),this.min=(i(this,Me),i(this,Ve,"")),this.max=(i(this,je),i(this,Fe,"")),this.step=(i(this,Ie),i(this,qe,"")),this.pattern=(i(this,Pe),i(this,Re,"")),this.maxlength=(i(this,He),i(this,Ye,-1)),this.minlength=(i(this,We),i(this,Ue,-1)),this.autocomplete=(i(this,Ke),i(this,Ge,"")),this.name=(i(this,Je),i(this,Xe,"")),this.prefixIcon=(i(this,Ze),i(this,Qe,"")),this.suffixIcon=(i(this,_e),i(this,et,"")),this.input=(i(this,tt),i(this,at,void 0)),this.clearButton=(i(this,it),i(this,st,void 0)),this.passwordToggle=(i(this,nt),i(this,lt,void 0)),this.showPassword=(i(this,rt),!1),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}render(){const e=["input",`input--${this.size}`,`input--${this.variant}`,this.invalid?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),a=["label",this.required?"label--required":""].filter(Boolean).join(" "),i=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return t.html`
7
+ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-table.min.js");var SniceTable=function(t,e){"use strict";function a(t,e,a,i,s,n){function l(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var r,o=i.kind,c="getter"===o?"get":"setter"===o?"set":"value",h=!e&&t?i.static?t:t.prototype:null,d=e||(h?Object.getOwnPropertyDescriptor(h,i.name):{}),u=!1,p=a.length-1;p>=0;p--){var m={};for(var g in i)m[g]="access"===g?{}:i[g];for(var g in i.access)m.access[g]=i.access[g];m.addInitializer=function(t){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(t||null))};var y=(0,a[p])("accessor"===o?{get:d.get,set:d.set}:d[c],m);if("accessor"===o){if(void 0===y)continue;if(null===y||"object"!=typeof y)throw new TypeError("Object expected");(r=l(y.get))&&(d.get=r),(r=l(y.set))&&(d.set=r),(r=l(y.init))&&s.unshift(r)}else(r=l(y))&&("field"===o?s.unshift(r):d[c]=r)}h&&Object.defineProperty(h,i.name,d),u=!0}function i(t,e,a){for(var i=arguments.length>2,s=0;s<e.length;s++)a=i?e[s].call(t,a):e[s].call(t);return i?a:void 0}function s(t,a="icon"){if(!t)return e.html``;if(t.startsWith("img://")){const i=t.slice(6);return e.html`<img class="${a}" src="${i}" alt="" part="icon" />`}if(t.startsWith("text://")){const i=t.slice(7);return e.html`<span class="${a}" part="icon">${i}</span>`}return/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(t)||/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)$/i.test(t)?e.html`<img class="${a}" src="${t}" alt="" part="icon" />`:e.html`<span class="${a}" part="icon">${t}</span>`}"function"==typeof SuppressedError&&SuppressedError;(()=>{let t,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C,$,D,T,E,A,j,F,L,z,O,B,M,P,V,N,H,I,R,q,W,Y,U,J,K,G,_,X,Z,Q,tt,et,at,it,st,nt=[e.element("snice-input",{formAssociated:!0})],lt=[],rt=HTMLElement,ot=[],ct=[],ht=[],dt=[],ut=[],pt=[],mt=[],gt=[],yt=[],vt=[],bt=[],ft=[],wt=[],kt=[],xt=[],St=[],Ct=[],$t=[],Dt=[],Tt=[],Et=[],At=[],jt=[],Ft=[],Lt=[],zt=[],Ot=[],Bt=[],Mt=[],Pt=[],Vt=[],Nt=[],Ht=[],It=[],Rt=[],qt=[],Wt=[],Yt=[],Ut=[],Jt=[],Kt=[],Gt=[],_t=[],Xt=[],Zt=[],Qt=[],te=[],ee=[],ae=[],ie=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],he=[],de=[],ue=[],pe=[],me=[],ge=[],ye=[];(class extends rt{static{n=this}static{const s="function"==typeof Symbol&&Symbol.metadata?Object.create(rt[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({})],h=[e.property({})],d=[e.property({})],u=[e.property({attribute:"helper-text"})],p=[e.property({attribute:"error-text"})],m=[e.property({type:Boolean})],g=[e.property({type:Boolean})],y=[e.property({type:Boolean})],v=[e.property({type:Boolean})],b=[e.property({type:Boolean})],f=[e.property({type:Boolean})],w=[e.property({type:Boolean})],k=[e.property({})],x=[e.property({})],S=[e.property({})],C=[e.property({})],$=[e.property({type:Number})],D=[e.property({type:Number})],T=[e.property({})],E=[e.property({})],A=[e.property({})],j=[e.property({attribute:"label-align"})],F=[e.property({type:Boolean})],L=[e.property({attribute:"prefix-icon"})],z=[e.property({attribute:"suffix-icon"})],O=[e.query(".input")],B=[e.query(".clear-button")],M=[e.query(".password-toggle")],P=[e.render()],V=[e.styles()],N=[e.ready()],H=[e.watch("value")],I=[e.watch("invalid")],R=[e.watch("disabled")],q=[e.watch("loading")],W=[e.watch("readonly")],Y=[e.watch("placeholder")],U=[e.watch("min")],J=[e.watch("max")],K=[e.watch("step")],G=[e.watch("maxlength")],_=[e.watch("minlength")],X=[e.watch("pattern")],Z=[e.watch("type")],Q=[e.watch("label")],tt=[e.dispatch("input-input",{bubbles:!0,composed:!0})],et=[e.dispatch("input-change",{bubbles:!0,composed:!0})],at=[e.dispatch("input-focus",{bubbles:!0,composed:!0})],it=[e.dispatch("input-blur",{bubbles:!0,composed:!0})],st=[e.dispatch("input-clear",{bubbles:!0,composed:!0})],a(this,null,P,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:s},null,ot),a(this,null,V,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:s},null,ot),a(this,null,N,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:s},null,ot),a(this,null,H,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:t=>"handleValueChange"in t,get:t=>t.handleValueChange},metadata:s},null,ot),a(this,null,I,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:t=>"handleInvalidChange"in t,get:t=>t.handleInvalidChange},metadata:s},null,ot),a(this,null,R,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:t=>"handleDisabledChange"in t,get:t=>t.handleDisabledChange},metadata:s},null,ot),a(this,null,q,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:t=>"handleLoadingChange"in t,get:t=>t.handleLoadingChange},metadata:s},null,ot),a(this,null,W,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:t=>"handleReadonlyChange"in t,get:t=>t.handleReadonlyChange},metadata:s},null,ot),a(this,null,Y,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:t=>"handlePlaceholderChange"in t,get:t=>t.handlePlaceholderChange},metadata:s},null,ot),a(this,null,U,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:t=>"handleMinChange"in t,get:t=>t.handleMinChange},metadata:s},null,ot),a(this,null,J,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:t=>"handleMaxChange"in t,get:t=>t.handleMaxChange},metadata:s},null,ot),a(this,null,K,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:t=>"handleStepChange"in t,get:t=>t.handleStepChange},metadata:s},null,ot),a(this,null,G,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:t=>"handleMaxLengthChange"in t,get:t=>t.handleMaxLengthChange},metadata:s},null,ot),a(this,null,_,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:t=>"handleMinLengthChange"in t,get:t=>t.handleMinLengthChange},metadata:s},null,ot),a(this,null,X,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:t=>"handlePatternChange"in t,get:t=>t.handlePatternChange},metadata:s},null,ot),a(this,null,Z,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:t=>"handleTypeChange"in t,get:t=>t.handleTypeChange},metadata:s},null,ot),a(this,null,Q,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:t=>"handleLabelChange"in t,get:t=>t.handleLabelChange},metadata:s},null,ot),a(this,null,tt,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:t=>"dispatchInputEvent"in t,get:t=>t.dispatchInputEvent},metadata:s},null,ot),a(this,null,et,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:t=>"dispatchChangeEvent"in t,get:t=>t.dispatchChangeEvent},metadata:s},null,ot),a(this,null,at,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:t=>"dispatchFocusEvent"in t,get:t=>t.dispatchFocusEvent},metadata:s},null,ot),a(this,null,it,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:t=>"dispatchBlurEvent"in t,get:t=>t.dispatchBlurEvent},metadata:s},null,ot),a(this,null,st,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:t=>"dispatchClearEvent"in t,get:t=>t.dispatchClearEvent},metadata:s},null,ot),a(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:s},ct,ht),a(null,null,r,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:s},dt,ut),a(null,null,o,{kind:"field",name:"variant",static:!1,private:!1,access:{has:t=>"variant"in t,get:t=>t.variant,set:(t,e)=>{t.variant=e}},metadata:s},pt,mt),a(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:s},gt,yt),a(null,null,h,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:s},vt,bt),a(null,null,d,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:s},ft,wt),a(null,null,u,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:t=>"helperText"in t,get:t=>t.helperText,set:(t,e)=>{t.helperText=e}},metadata:s},kt,xt),a(null,null,p,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:t=>"errorText"in t,get:t=>t.errorText,set:(t,e)=>{t.errorText=e}},metadata:s},St,Ct),a(null,null,m,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:t=>"disabled"in t,get:t=>t.disabled,set:(t,e)=>{t.disabled=e}},metadata:s},$t,Dt),a(null,null,g,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:t=>"readonly"in t,get:t=>t.readonly,set:(t,e)=>{t.readonly=e}},metadata:s},Tt,Et),a(null,null,y,{kind:"field",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:s},At,jt),a(null,null,v,{kind:"field",name:"required",static:!1,private:!1,access:{has:t=>"required"in t,get:t=>t.required,set:(t,e)=>{t.required=e}},metadata:s},Ft,Lt),a(null,null,b,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:t=>"invalid"in t,get:t=>t.invalid,set:(t,e)=>{t.invalid=e}},metadata:s},zt,Ot),a(null,null,f,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:t=>"clearable"in t,get:t=>t.clearable,set:(t,e)=>{t.clearable=e}},metadata:s},Bt,Mt),a(null,null,w,{kind:"field",name:"password",static:!1,private:!1,access:{has:t=>"password"in t,get:t=>t.password,set:(t,e)=>{t.password=e}},metadata:s},Pt,Vt),a(null,null,k,{kind:"field",name:"min",static:!1,private:!1,access:{has:t=>"min"in t,get:t=>t.min,set:(t,e)=>{t.min=e}},metadata:s},Nt,Ht),a(null,null,x,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:s},It,Rt),a(null,null,S,{kind:"field",name:"step",static:!1,private:!1,access:{has:t=>"step"in t,get:t=>t.step,set:(t,e)=>{t.step=e}},metadata:s},qt,Wt),a(null,null,C,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:t=>"pattern"in t,get:t=>t.pattern,set:(t,e)=>{t.pattern=e}},metadata:s},Yt,Ut),a(null,null,$,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:t=>"maxlength"in t,get:t=>t.maxlength,set:(t,e)=>{t.maxlength=e}},metadata:s},Jt,Kt),a(null,null,D,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:t=>"minlength"in t,get:t=>t.minlength,set:(t,e)=>{t.minlength=e}},metadata:s},Gt,_t),a(null,null,T,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:t=>"autocomplete"in t,get:t=>t.autocomplete,set:(t,e)=>{t.autocomplete=e}},metadata:s},Xt,Zt),a(null,null,E,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:s},Qt,te),a(null,null,A,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:s},ee,ae),a(null,null,j,{kind:"field",name:"labelAlign",static:!1,private:!1,access:{has:t=>"labelAlign"in t,get:t=>t.labelAlign,set:(t,e)=>{t.labelAlign=e}},metadata:s},ie,se),a(null,null,F,{kind:"field",name:"stretch",static:!1,private:!1,access:{has:t=>"stretch"in t,get:t=>t.stretch,set:(t,e)=>{t.stretch=e}},metadata:s},ne,le),a(null,null,L,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:t=>"prefixIcon"in t,get:t=>t.prefixIcon,set:(t,e)=>{t.prefixIcon=e}},metadata:s},re,oe),a(null,null,z,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:t=>"suffixIcon"in t,get:t=>t.suffixIcon,set:(t,e)=>{t.suffixIcon=e}},metadata:s},ce,he),a(null,null,O,{kind:"field",name:"input",static:!1,private:!1,access:{has:t=>"input"in t,get:t=>t.input,set:(t,e)=>{t.input=e}},metadata:s},de,ue),a(null,null,B,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:t=>"clearButton"in t,get:t=>t.clearButton,set:(t,e)=>{t.clearButton=e}},metadata:s},pe,me),a(null,null,M,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:t=>"passwordToggle"in t,get:t=>t.passwordToggle,set:(t,e)=>{t.passwordToggle=e}},metadata:s},ge,ye),a(null,t={value:n},nt,{kind:"class",name:n.name,metadata:s},null,lt),n=t.value,s&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s}),i(n,lt)}constructor(){super(),this.internals=i(this,ot),this.type=i(this,ct,"text"),this.size=(i(this,ht),i(this,dt,"medium")),this.variant=(i(this,ut),i(this,pt,"outlined")),this.value=(i(this,mt),i(this,gt,"")),this.placeholder=(i(this,yt),i(this,vt,"")),this.label=(i(this,bt),i(this,ft,"")),this.helperText=(i(this,wt),i(this,kt,"")),this.errorText=(i(this,xt),i(this,St,"")),this.disabled=(i(this,Ct),i(this,$t,!1)),this.readonly=(i(this,Dt),i(this,Tt,!1)),this.loading=(i(this,Et),i(this,At,!1)),this.required=(i(this,jt),i(this,Ft,!1)),this.invalid=(i(this,Lt),i(this,zt,!1)),this.clearable=(i(this,Ot),i(this,Bt,!1)),this.password=(i(this,Mt),i(this,Pt,!1)),this.min=(i(this,Vt),i(this,Nt,"")),this.max=(i(this,Ht),i(this,It,"")),this.step=(i(this,Rt),i(this,qt,"")),this.pattern=(i(this,Wt),i(this,Yt,"")),this.maxlength=(i(this,Ut),i(this,Jt,-1)),this.minlength=(i(this,Kt),i(this,Gt,-1)),this.autocomplete=(i(this,_t),i(this,Xt,"")),this.name=(i(this,Zt),i(this,Qt,"")),this.align=(i(this,te),i(this,ee,"")),this.labelAlign=(i(this,ae),i(this,ie,"left")),this.stretch=(i(this,se),i(this,ne,!1)),this.prefixIcon=(i(this,le),i(this,re,"")),this.suffixIcon=(i(this,oe),i(this,ce,"")),this.input=(i(this,he),i(this,de,void 0)),this.clearButton=(i(this,ue),i(this,pe,void 0)),this.passwordToggle=(i(this,me),i(this,ge,void 0)),this.showPassword=(i(this,ye),!1),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}render(){const t=["input",`input--${this.size}`,`input--${this.variant}`,this.invalid?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),a=["label",this.required?"label--required":""].filter(Boolean).join(" "),i=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return e.html`
8
8
  <div class="input-wrapper">
9
9
  <if ${this.label}>
10
10
  <label class="${a}">
@@ -22,7 +22,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
22
22
  </span>
23
23
 
24
24
  <input
25
- class="${e}"
25
+ class="${t}"
26
26
  type="${this.type}"
27
27
  value="${this.value}"
28
28
  placeholder="${this.placeholder}"
@@ -102,9 +102,9 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
102
102
  </default>
103
103
  </case>
104
104
  </div>
105
- `}styles(){return t.css`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;box-sizing:border-box}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast) ease}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md);background:var(--snice-color-background-input,rgb(248 247 245));color:var(--snice-color-text);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-inset-sm);transition:all var(--snice-transition-fast) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus{border-color:var(--snice-color-primary);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-focus-ring-color),var(--snice-shadow-sm)}.input:disabled{background:var(--snice-color-background-secondary);color:var(--snice-color-text-secondary);cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary);opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm)}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md)}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg)}.input--outlined{background:var(--snice-color-background-input,rgb(248 247 245));border:1px solid var(--snice-color-border)}.input--filled{background:var(--snice-color-background-secondary);border:1px solid transparent;border-bottom-color:var(--snice-color-border);border-radius:var(--snice-border-radius-md) var(--snice-border-radius-md) 0 0}.input--filled:focus{background:var(--snice-color-background-hover);border-bottom-color:var(--snice-color-primary)}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border);border-radius:0;padding-left:0;padding-right:0}.input--underlined:focus{border-bottom-color:var(--snice-color-primary);box-shadow:none}.input--invalid{border-color:var(--snice-color-danger)}.input--invalid:focus{border-color:var(--snice-color-danger);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-color-danger-alpha,hsl(var(--snice-color-red-500) / .4)),var(--snice-shadow-sm)}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.25rem}.input--clearable,.input--with-suffix-icon{padding-right:2.25rem}.input--with-suffix-icon.input--clearable{padding-right:3.75rem}.label{display:block;margin-bottom:.375rem;font-size:var(--snice-font-size-sm);font-weight:500;color:var(--snice-color-text)}.label--required::after{content:' *';color:var(--snice-color-danger)}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs);min-height:1.125rem}.helper-text{color:var(--snice-color-text-secondary)}.error-text{color:var(--snice-color-danger)}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:var(--snice-color-text-secondary);pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:var(--snice-color-text-secondary);pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.25rem;height:1.25rem}.icon-slot ::slotted(img){width:1.25rem;height:1.25rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.input-container:hover .clear-button--visible,.input:focus~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease}.password-toggle:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){if(this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.disabled,this.input.readOnly=this.readonly,this.input.required=this.required)}handleInput(e){const t=e.target;this.value=t.value,this.dispatchInputEvent()}handleChange(e){const t=e.target;this.value=t.value,this.dispatchChangeEvent()}handleFocus(e){this.dispatchFocusEvent()}handleBlur(e){this.dispatchBlurEvent()}handleClear(e){this.clear()}handlePasswordToggle(e){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const e=this.passwordToggle.querySelector(".password-icon--hidden"),t=this.passwordToggle.querySelector(".password-icon--visible");e&&t&&(e.style.display=this.showPassword?"none":"",t.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleInvalidChange(){this.input&&(this.input.setAttribute("aria-invalid",String(this.invalid)),this.invalid?this.input.classList.add("input--invalid"):this.input.classList.remove("input--invalid"))}handleDisabledChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleLoadingChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.clearButton&&this.clearable){const e=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.input.min=this.min)}handleMaxChange(){this.input&&"number"===this.type&&(this.input.max=this.max)}handleStepChange(){this.input&&"number"===this.type&&(this.input.step=this.step)}handleMaxLengthChange(){this.input&&this.maxlength>0&&(this.input.maxLength=this.maxlength)}handleMinLengthChange(){this.input&&this.minlength>0&&(this.input.minLength=this.minlength)}handlePatternChange(){this.input&&(this.input.pattern=this.pattern)}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type)}handleLabelChange(){const e=this.shadowRoot?.querySelector(".label");if(e){e.textContent=this.label;const t=e.parentElement;t&&(t.style.display=this.label?"":"none")}}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}checkValidity(){return this.input?.checkValidity()??!0}reportValidity(){return this.input?.reportValidity()??!0}setCustomValidity(e){this.input?.setCustomValidity(e)}})})(),(()=>{let e,s,n,l,r,o,c,h,d,u,p=[t.element("snice-option")],m=[],g=HTMLElement,v=[],b=[],y=[],f=[],w=[],k=[],x=[],S=[],C=[],E=[],$=[];(class extends g{static{s=this}static{const D="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[t.property({})],l=[t.property({})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({})],h=[t.render()],d=[t.styles()],u=[t.ready()],a(this,null,h,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:D},null,v),a(this,null,d,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:D},null,v),a(this,null,u,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:D},null,v),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:D},b,y),a(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:D},f,w),a(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:D},k,x),a(null,null,o,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:D},S,C),a(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:D},E,$),a(null,e={value:s},p,{kind:"class",name:s.name,metadata:D},null,m),s=e.value,D&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:D}),i(s,m)}render(){return t.html``}styles(){return t.css`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(i(this,v),i(this,b,"")),this.label=(i(this,y),i(this,f,"")),this.disabled=(i(this,w),i(this,k,!1)),this.selected=(i(this,x),i(this,S,!1)),this.icon=(i(this,C),i(this,E,"")),i(this,$)}})})();(()=>{let e,s,n,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x,S,C,E,$,D,A,T,L,O,N,B,z,M,V,j,F,I,q,P,R,H=[t.element("snice-select")],Y=[],W=HTMLElement,U=[],K=[],G=[],J=[],X=[],Z=[],Q=[],_=[],ee=[],te=[],ae=[],ie=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],he=[],de=[],ue=[],pe=[],me=[],ge=[],ve=[],be=[],ye=[],fe=[],we=[],ke=[],xe=[],Se=[],Ce=[],Ee=[],$e=[],De=[],Ae=[],Te=[],Le=[],Oe=[],Ne=[],Be=[],ze=[],Me=[],Ve=[],je=[],Fe=[],Ie=[],qe=[],Pe=[],Re=[],He=[],Ye=[];(class extends W{static{s=this}constructor(){super(...arguments),this.disabled=(i(this,U),i(this,K,!1)),this.required=(i(this,G),i(this,J,!1)),this.invalid=(i(this,X),i(this,Z,!1)),this.readonly=(i(this,Q),i(this,_,!1)),this.loading=(i(this,ee),i(this,te,!1)),this.multiple=(i(this,ae),i(this,ie,!1)),this.searchable=(i(this,se),i(this,ne,!1)),this.clearable=(i(this,le),i(this,re,!1)),this.open=(i(this,oe),i(this,ce,!1)),this.size=(i(this,he),i(this,de,"medium")),this.name=(i(this,ue),i(this,pe,"")),this.value=(i(this,me),i(this,ge,"")),this.label=(i(this,ve),i(this,be,"")),this.placeholder=(i(this,ye),i(this,fe,"Select an option")),this.maxHeight=(i(this,we),i(this,ke,"200px")),this.options=(i(this,xe),[]),this.trigger=i(this,Se,void 0),this.dropdown=(i(this,Ce),i(this,Ee,void 0)),this.valueDisplay=(i(this,$e),i(this,De,void 0)),this.labelElement=(i(this,Ae),i(this,Te,void 0)),this.searchInput=(i(this,Le),i(this,Oe,void 0)),this.optionsList=(i(this,Ne),i(this,Be,void 0)),this.nativeSelect=(i(this,ze),i(this,Me,void 0)),this.clearButton=(i(this,Ve),i(this,je,void 0)),this.arrow=(i(this,Fe),i(this,Ie,void 0)),this.searchContainer=(i(this,qe),i(this,Pe,void 0)),this.optionElements=(i(this,Re),i(this,He,void 0)),this.filteredOptions=(i(this,Ye),[]),this.selectedValues=new Set,this.focusedIndex=-1}static{const We="function"==typeof Symbol&&Symbol.metadata?Object.create(W[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean})],l=[t.property({type:Boolean})],r=[t.property({type:Boolean})],o=[t.property({type:Boolean})],c=[t.property({type:Boolean})],h=[t.property({type:Boolean})],d=[t.property({type:Boolean})],u=[t.property({type:Boolean})],p=[t.property({type:Boolean})],m=[t.property({})],g=[t.property({})],v=[t.property({})],b=[t.property({})],y=[t.property({})],f=[t.property({attribute:"max-height"})],w=[t.query(".select-trigger")],k=[t.query(".select-dropdown")],x=[t.query(".select-value")],S=[t.query(".select-label")],C=[t.query(".select-search-input")],E=[t.query(".select-options")],$=[t.query(".select-native")],D=[t.query(".select-clear")],A=[t.query(".select-arrow")],T=[t.query(".select-search")],L=[t.queryAll(".select-option")],O=[t.render()],N=[t.styles()],B=[t.ready()],z=[t.dispose()],M=[t.watch("value")],V=[t.watch("disabled")],j=[t.watch("loading")],F=[t.watch("open")],I=[t.watch("multiple","name")],q=[t.dispatch("select-change",{bubbles:!0,composed:!0})],P=[t.dispatch("select-open",{bubbles:!0,composed:!0})],R=[t.dispatch("select-close",{bubbles:!0,composed:!0})],a(this,null,O,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:We},null,U),a(this,null,N,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:We},null,U),a(this,null,B,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:We},null,U),a(this,null,z,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:We},null,U),a(this,null,M,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:We},null,U),a(this,null,V,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:We},null,U),a(this,null,j,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:e=>"handleLoadingChange"in e,get:e=>e.handleLoadingChange},metadata:We},null,U),a(this,null,F,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:We},null,U),a(this,null,I,{kind:"method",name:"handleNativeSelectAttributeChange",static:!1,private:!1,access:{has:e=>"handleNativeSelectAttributeChange"in e,get:e=>e.handleNativeSelectAttributeChange},metadata:We},null,U),a(this,null,q,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:We},null,U),a(this,null,P,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:We},null,U),a(this,null,R,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:We},null,U),a(null,null,n,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:We},K,G),a(null,null,l,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:We},J,X),a(null,null,r,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:We},Z,Q),a(null,null,o,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:We},_,ee),a(null,null,c,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:We},te,ae),a(null,null,h,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:We},ie,se),a(null,null,d,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:We},ne,le),a(null,null,u,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:We},re,oe),a(null,null,p,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:We},ce,he),a(null,null,m,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:We},de,ue),a(null,null,g,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:We},pe,me),a(null,null,v,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:We},ge,ve),a(null,null,b,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:We},be,ye),a(null,null,y,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:We},fe,we),a(null,null,f,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:e=>"maxHeight"in e,get:e=>e.maxHeight,set:(e,t)=>{e.maxHeight=t}},metadata:We},ke,xe),a(null,null,w,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:e=>"trigger"in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:We},Se,Ce),a(null,null,k,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:e=>"dropdown"in e,get:e=>e.dropdown,set:(e,t)=>{e.dropdown=t}},metadata:We},Ee,$e),a(null,null,x,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:e=>"valueDisplay"in e,get:e=>e.valueDisplay,set:(e,t)=>{e.valueDisplay=t}},metadata:We},De,Ae),a(null,null,S,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:We},Te,Le),a(null,null,C,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:e=>"searchInput"in e,get:e=>e.searchInput,set:(e,t)=>{e.searchInput=t}},metadata:We},Oe,Ne),a(null,null,E,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:e=>"optionsList"in e,get:e=>e.optionsList,set:(e,t)=>{e.optionsList=t}},metadata:We},Be,ze),a(null,null,$,{kind:"field",name:"nativeSelect",static:!1,private:!1,access:{has:e=>"nativeSelect"in e,get:e=>e.nativeSelect,set:(e,t)=>{e.nativeSelect=t}},metadata:We},Me,Ve),a(null,null,D,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:We},je,Fe),a(null,null,A,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:e=>"arrow"in e,get:e=>e.arrow,set:(e,t)=>{e.arrow=t}},metadata:We},Ie,qe),a(null,null,T,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:e=>"searchContainer"in e,get:e=>e.searchContainer,set:(e,t)=>{e.searchContainer=t}},metadata:We},Pe,Re),a(null,null,L,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:e=>"optionElements"in e,get:e=>e.optionElements,set:(e,t)=>{e.optionElements=t}},metadata:We},He,Ye),a(null,e={value:s},H,{kind:"class",name:s.name,metadata:We},null,Y),s=e.value,We&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:We}),i(s,Y)}render(){const e=`select-label select-label--${this.size} ${this.required?"select-label--required":""}`,a=`select-trigger select-trigger--${this.size} ${this.loading?"select-trigger--loading":""}`,i=!this.searchable;return t.html`
105
+ `}styles(){return e.css`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;height:100%;box-sizing:border-box}:host([align]) .input-wrapper{display:flex;flex-direction:column}:host([align=top]) .input-wrapper{justify-content:flex-start}:host([align=center]) .input-wrapper{justify-content:center}:host([align=bottom]) .input-wrapper{justify-content:flex-end}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast) ease}:host([stretch]) .input-wrapper{display:flex;flex-direction:column}:host([stretch]) .input-container{flex:1}:host([stretch]) .input{height:100%}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md);background:var(--snice-color-background-input,rgb(248 247 245));color:var(--snice-color-text);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-inset-sm);transition:all var(--snice-transition-fast) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus{border-color:var(--snice-color-primary);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-focus-ring-color),var(--snice-shadow-sm)}.input:disabled{background:var(--snice-color-background-secondary);color:var(--snice-color-text-secondary);cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary);opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm)}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md)}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg)}.input--outlined{background:var(--snice-color-background-input,rgb(248 247 245));border:1px solid var(--snice-color-border)}.input--filled{background:var(--snice-color-background-secondary);border:1px solid transparent;border-bottom-color:var(--snice-color-border);border-radius:var(--snice-border-radius-md) var(--snice-border-radius-md) 0 0}.input--filled:focus{background:var(--snice-color-background-hover);border-bottom-color:var(--snice-color-primary)}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border);border-radius:0;padding-left:0;padding-right:0}.input--underlined:focus{border-bottom-color:var(--snice-color-primary);box-shadow:none}.input--invalid{border-color:var(--snice-color-danger)}.input--invalid:focus{border-color:var(--snice-color-danger);box-shadow:0 0 0 var(--snice-focus-ring-width) var(--snice-color-danger-alpha,hsl(var(--snice-color-red-500) / .4)),var(--snice-shadow-sm)}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.25rem}.input--clearable,.input--with-suffix-icon{padding-right:2.25rem}.input--with-suffix-icon.input--clearable{padding-right:3.75rem}.label{display:block;margin-bottom:.375rem;font-size:var(--snice-font-size-sm);font-weight:500;color:var(--snice-color-text);text-align:left}:host([label-align=center]) .label{text-align:center}:host([label-align=right]) .label{text-align:right}.label--required::after{content:' *';color:var(--snice-color-danger)}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs);min-height:1.125rem}.helper-text{color:var(--snice-color-text-secondary)}.error-text{color:var(--snice-color-danger)}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:var(--snice-color-text-secondary);pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:var(--snice-color-text-secondary);pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.25rem;height:1.25rem}.icon-slot ::slotted(img){width:1.25rem;height:1.25rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.input-container:hover .clear-button--visible,.input:focus~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm);color:var(--snice-color-text-secondary);cursor:pointer;transition:all var(--snice-transition-fast) ease}.password-toggle:hover{background:var(--snice-color-background-hover);color:var(--snice-color-text)}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){if(this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const t=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=t?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!t)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.disabled,this.input.readOnly=this.readonly,this.input.required=this.required)}handleInput(t){const e=t.target;this.value=e.value,this.dispatchInputEvent()}handleChange(t){const e=t.target;this.value=e.value,this.dispatchChangeEvent()}handleFocus(t){this.dispatchFocusEvent()}handleBlur(t){this.dispatchBlurEvent()}handleClear(t){this.clear()}handlePasswordToggle(t){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const t=this.passwordToggle.querySelector(".password-icon--hidden"),e=this.passwordToggle.querySelector(".password-icon--visible");t&&e&&(t.style.display=this.showPassword?"none":"",e.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.internals&&this.internals.setFormValue(this.value),this.clearButton&&this.clearable){const t=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=t?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!t)}}handleInvalidChange(){this.input&&(this.input.setAttribute("aria-invalid",String(this.invalid)),this.invalid?this.input.classList.add("input--invalid"):this.input.classList.remove("input--invalid"))}handleDisabledChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const t=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=t?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!t)}}handleLoadingChange(){if(this.input&&(this.input.disabled=this.disabled||this.loading),this.clearButton&&this.clearable){const t=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=t?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!t)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.clearButton&&this.clearable){const t=this.value&&!this.disabled&&!this.readonly&&!this.loading;this.clearButton.style.display=t?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!t)}}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.input.min=this.min)}handleMaxChange(){this.input&&"number"===this.type&&(this.input.max=this.max)}handleStepChange(){this.input&&"number"===this.type&&(this.input.step=this.step)}handleMaxLengthChange(){this.input&&this.maxlength>0&&(this.input.maxLength=this.maxlength)}handleMinLengthChange(){this.input&&this.minlength>0&&(this.input.minLength=this.minlength)}handlePatternChange(){this.input&&(this.input.pattern=this.pattern)}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type)}handleLabelChange(){const t=this.shadowRoot?.querySelector(".label");if(t){t.textContent=this.label;const e=t.parentElement;e&&(e.style.display=this.label?"":"none")}}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}checkValidity(){return this.input?.checkValidity()??!0}reportValidity(){return this.input?.reportValidity()??!0}setCustomValidity(t){this.input?.setCustomValidity(t)}})})(),(()=>{let t,s,n,l,r,o,c,h,d,u,p=[e.element("snice-option")],m=[],g=HTMLElement,y=[],v=[],b=[],f=[],w=[],k=[],x=[],S=[],C=[],$=[],D=[];(class extends g{static{s=this}static{const T="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[e.property({})],l=[e.property({})],r=[e.property({type:Boolean})],o=[e.property({type:Boolean})],c=[e.property({})],h=[e.render()],d=[e.styles()],u=[e.ready()],a(this,null,h,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:T},null,y),a(this,null,d,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:T},null,y),a(this,null,u,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:T},null,y),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:T},v,b),a(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:T},f,w),a(null,null,r,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:t=>"disabled"in t,get:t=>t.disabled,set:(t,e)=>{t.disabled=e}},metadata:T},k,x),a(null,null,o,{kind:"field",name:"selected",static:!1,private:!1,access:{has:t=>"selected"in t,get:t=>t.selected,set:(t,e)=>{t.selected=e}},metadata:T},S,C),a(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:t=>"icon"in t,get:t=>t.icon,set:(t,e)=>{t.icon=e}},metadata:T},$,D),a(null,t={value:s},p,{kind:"class",name:s.name,metadata:T},null,m),s=t.value,T&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:T}),i(s,m)}render(){return e.html``}styles(){return e.css`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(i(this,y),i(this,v,"")),this.label=(i(this,b),i(this,f,"")),this.disabled=(i(this,w),i(this,k,!1)),this.selected=(i(this,x),i(this,S,!1)),this.icon=(i(this,C),i(this,$,"")),i(this,D)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C,$,D,T,E,A,j,F,L,z,O,B,M,P,V,N,H,I=[e.element("snice-select",{formAssociated:!0})],R=[],q=HTMLElement,W=[],Y=[],U=[],J=[],K=[],G=[],_=[],X=[],Z=[],Q=[],tt=[],et=[],at=[],it=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],ht=[],dt=[],ut=[],pt=[],mt=[],gt=[],yt=[],vt=[],bt=[],ft=[],wt=[],kt=[],xt=[],St=[],Ct=[],$t=[],Dt=[],Tt=[],Et=[],At=[],jt=[],Ft=[],Lt=[],zt=[],Ot=[],Bt=[],Mt=[],Pt=[],Vt=[],Nt=[],Ht=[];(class extends q{static{s=this}static{const It="function"==typeof Symbol&&Symbol.metadata?Object.create(q[Symbol.metadata]??null):void 0;n=[e.property({type:Boolean})],l=[e.property({type:Boolean})],r=[e.property({type:Boolean})],o=[e.property({type:Boolean})],c=[e.property({type:Boolean})],h=[e.property({type:Boolean})],d=[e.property({type:Boolean})],u=[e.property({type:Boolean})],p=[e.property({type:Boolean})],m=[e.property({})],g=[e.property({})],y=[e.property({})],v=[e.property({})],b=[e.property({})],f=[e.property({attribute:"max-height"})],w=[e.query(".select-trigger")],k=[e.query(".select-dropdown")],x=[e.query(".select-value")],S=[e.query(".select-label")],C=[e.query(".select-search-input")],$=[e.query(".select-options")],D=[e.query(".select-clear")],T=[e.query(".select-arrow")],E=[e.query(".select-search")],A=[e.queryAll(".select-option")],j=[e.render()],F=[e.styles()],L=[e.ready()],z=[e.dispose()],O=[e.watch("value")],B=[e.watch("disabled")],M=[e.watch("loading")],P=[e.watch("open")],V=[e.dispatch("select-change",{bubbles:!0,composed:!0})],N=[e.dispatch("select-open",{bubbles:!0,composed:!0})],H=[e.dispatch("select-close",{bubbles:!0,composed:!0})],a(this,null,j,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:It},null,W),a(this,null,F,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:It},null,W),a(this,null,L,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:It},null,W),a(this,null,z,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:t=>"cleanup"in t,get:t=>t.cleanup},metadata:It},null,W),a(this,null,O,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:t=>"handleValueChange"in t,get:t=>t.handleValueChange},metadata:It},null,W),a(this,null,B,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:t=>"handleDisabledChange"in t,get:t=>t.handleDisabledChange},metadata:It},null,W),a(this,null,M,{kind:"method",name:"handleLoadingChange",static:!1,private:!1,access:{has:t=>"handleLoadingChange"in t,get:t=>t.handleLoadingChange},metadata:It},null,W),a(this,null,P,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:t=>"handleOpenChange"in t,get:t=>t.handleOpenChange},metadata:It},null,W),a(this,null,V,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:t=>"dispatchChangeEvent"in t,get:t=>t.dispatchChangeEvent},metadata:It},null,W),a(this,null,N,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:t=>"dispatchOpenEvent"in t,get:t=>t.dispatchOpenEvent},metadata:It},null,W),a(this,null,H,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:t=>"dispatchCloseEvent"in t,get:t=>t.dispatchCloseEvent},metadata:It},null,W),a(null,null,n,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:t=>"disabled"in t,get:t=>t.disabled,set:(t,e)=>{t.disabled=e}},metadata:It},Y,U),a(null,null,l,{kind:"field",name:"required",static:!1,private:!1,access:{has:t=>"required"in t,get:t=>t.required,set:(t,e)=>{t.required=e}},metadata:It},J,K),a(null,null,r,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:t=>"invalid"in t,get:t=>t.invalid,set:(t,e)=>{t.invalid=e}},metadata:It},G,_),a(null,null,o,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:t=>"readonly"in t,get:t=>t.readonly,set:(t,e)=>{t.readonly=e}},metadata:It},X,Z),a(null,null,c,{kind:"field",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:It},Q,tt),a(null,null,h,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:t=>"multiple"in t,get:t=>t.multiple,set:(t,e)=>{t.multiple=e}},metadata:It},et,at),a(null,null,d,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:t=>"searchable"in t,get:t=>t.searchable,set:(t,e)=>{t.searchable=e}},metadata:It},it,st),a(null,null,u,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:t=>"clearable"in t,get:t=>t.clearable,set:(t,e)=>{t.clearable=e}},metadata:It},nt,lt),a(null,null,p,{kind:"field",name:"open",static:!1,private:!1,access:{has:t=>"open"in t,get:t=>t.open,set:(t,e)=>{t.open=e}},metadata:It},rt,ot),a(null,null,m,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:It},ct,ht),a(null,null,g,{kind:"field",name:"name",static:!1,private:!1,access:{has:t=>"name"in t,get:t=>t.name,set:(t,e)=>{t.name=e}},metadata:It},dt,ut),a(null,null,y,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:It},pt,mt),a(null,null,v,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:It},gt,yt),a(null,null,b,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:t=>"placeholder"in t,get:t=>t.placeholder,set:(t,e)=>{t.placeholder=e}},metadata:It},vt,bt),a(null,null,f,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:t=>"maxHeight"in t,get:t=>t.maxHeight,set:(t,e)=>{t.maxHeight=e}},metadata:It},ft,wt),a(null,null,w,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:t=>"trigger"in t,get:t=>t.trigger,set:(t,e)=>{t.trigger=e}},metadata:It},kt,xt),a(null,null,k,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:t=>"dropdown"in t,get:t=>t.dropdown,set:(t,e)=>{t.dropdown=e}},metadata:It},St,Ct),a(null,null,x,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:t=>"valueDisplay"in t,get:t=>t.valueDisplay,set:(t,e)=>{t.valueDisplay=e}},metadata:It},$t,Dt),a(null,null,S,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:t=>"labelElement"in t,get:t=>t.labelElement,set:(t,e)=>{t.labelElement=e}},metadata:It},Tt,Et),a(null,null,C,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:t=>"searchInput"in t,get:t=>t.searchInput,set:(t,e)=>{t.searchInput=e}},metadata:It},At,jt),a(null,null,$,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:t=>"optionsList"in t,get:t=>t.optionsList,set:(t,e)=>{t.optionsList=e}},metadata:It},Ft,Lt),a(null,null,D,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:t=>"clearButton"in t,get:t=>t.clearButton,set:(t,e)=>{t.clearButton=e}},metadata:It},zt,Ot),a(null,null,T,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:t=>"arrow"in t,get:t=>t.arrow,set:(t,e)=>{t.arrow=e}},metadata:It},Bt,Mt),a(null,null,E,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:t=>"searchContainer"in t,get:t=>t.searchContainer,set:(t,e)=>{t.searchContainer=e}},metadata:It},Pt,Vt),a(null,null,A,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:t=>"optionElements"in t,get:t=>t.optionElements,set:(t,e)=>{t.optionElements=e}},metadata:It},Nt,Ht),a(null,t={value:s},I,{kind:"class",name:s.name,metadata:It},null,R),s=t.value,It&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:It}),i(s,R)}constructor(){super(),this.internals=i(this,W),this.disabled=i(this,Y,!1),this.required=(i(this,U),i(this,J,!1)),this.invalid=(i(this,K),i(this,G,!1)),this.readonly=(i(this,_),i(this,X,!1)),this.loading=(i(this,Z),i(this,Q,!1)),this.multiple=(i(this,tt),i(this,et,!1)),this.searchable=(i(this,at),i(this,it,!1)),this.clearable=(i(this,st),i(this,nt,!1)),this.open=(i(this,lt),i(this,rt,!1)),this.size=(i(this,ot),i(this,ct,"medium")),this.name=(i(this,ht),i(this,dt,"")),this.value=(i(this,ut),i(this,pt,"")),this.label=(i(this,mt),i(this,gt,"")),this.placeholder=(i(this,yt),i(this,vt,"Select an option")),this.maxHeight=(i(this,bt),i(this,ft,"200px")),this.options=(i(this,wt),[]),this.trigger=i(this,kt,void 0),this.dropdown=(i(this,xt),i(this,St,void 0)),this.valueDisplay=(i(this,Ct),i(this,$t,void 0)),this.labelElement=(i(this,Dt),i(this,Tt,void 0)),this.searchInput=(i(this,Et),i(this,At,void 0)),this.optionsList=(i(this,jt),i(this,Ft,void 0)),this.clearButton=(i(this,Lt),i(this,zt,void 0)),this.arrow=(i(this,Ot),i(this,Bt,void 0)),this.searchContainer=(i(this,Mt),i(this,Pt,void 0)),this.optionElements=(i(this,Vt),i(this,Nt,void 0)),this.filteredOptions=(i(this,Ht),[]),this.selectedValues=new Set,this.focusedIndex=-1,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}render(){const t=`select-label select-label--${this.size} ${this.required?"select-label--required":""}`,a=`select-trigger select-trigger--${this.size} ${this.loading?"select-trigger--loading":""}`,i=!this.searchable;return e.html`
106
106
  <div class="select-wrapper">
107
- <label class="${e}" part="label" ?hidden="${!this.label}">
107
+ <label class="${t}" part="label" ?hidden="${!this.label}">
108
108
  ${this.label}
109
109
  </label>
110
110
 
@@ -115,15 +115,15 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
115
115
  aria-expanded="false"
116
116
  aria-label="${this.label||"Select"}"
117
117
  part="trigger"
118
- @keydown="${e=>this.handleTriggerOpen(e)}"
119
- @click="${e=>this.handleTriggerClick(e)}">
118
+ @keydown="${t=>this.handleTriggerOpen(t)}"
119
+ @click="${t=>this.handleTriggerClick(t)}">
120
120
 
121
121
  <div class="select-value" part="value">
122
122
  <span class="select-placeholder">${this.placeholder}</span>
123
123
  </div>
124
124
 
125
125
  <span class="select-icons">
126
- <span class="select-clear" aria-label="Clear selection" style="display: none;" @click="${e=>this.handleClearClick(e)}">
126
+ <span class="select-clear" aria-label="Clear selection" style="display: none;" @click="${t=>this.handleClearClick(t)}">
127
127
  <svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor">
128
128
  <path d="M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"/>
129
129
  </svg>
@@ -145,7 +145,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
145
145
  role="listbox"
146
146
  aria-label="${this.label||"Options"}"
147
147
  part="dropdown"
148
- @click="${e=>this.handleOptionsClick(e)}">
148
+ @click="${t=>this.handleOptionsClick(t)}">
149
149
 
150
150
  <div class="select-search" part="search" ?hidden="${i}">
151
151
  <input
@@ -154,8 +154,8 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
154
154
  placeholder="Search..."
155
155
  aria-label="Search options"
156
156
  part="search-input"
157
- @keydown="${e=>this.handleSearchKeydown(e)}"
158
- @input="${e=>this.handleSearchInput(e)}" />
157
+ @keydown="${t=>this.handleSearchKeydown(t)}"
158
+ @input="${t=>this.handleSearchInput(t)}" />
159
159
  </div>
160
160
 
161
161
  <div class="select-options" part="options">
@@ -163,38 +163,30 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
163
163
  </div>
164
164
  </div>
165
165
 
166
- <!-- Hidden native select for form submission -->
167
- <select
168
- class="select-native"
169
- name="${this.name||""}"
170
- tabindex="-1"
171
- aria-hidden="true">
172
- <!-- Options will be added in @ready() -->
173
- </select>
174
166
  </div>
175
- `}renderOptions(){const e=this.searchable?this.filteredOptions:this.options;return 0===e.length?`\n <div class="select-no-options">\n <span class="select-no-options-text" data-search="true" ${!this.searchable||this.filteredOptions.length>0?"hidden":""}>No matches found</span>\n <span class="select-no-options-text" data-search="false" ${this.searchable&&0===this.filteredOptions.length?"hidden":""}>No options available</span>\n </div>\n `:e.map((e,t)=>{const a=this.multiple?this.selectedValues.has(e.value):e.value===this.value;return`\n <div class="select-option \n ${a?"select-option--selected":""}\n ${e.disabled?"select-option--disabled":""}\n ${t===this.focusedIndex?"select-option--focused":""}\n ${e.icon?"select-option--has-icon":""}"\n data-value="${e.value}"\n role="option"\n aria-selected="${a}"\n aria-disabled="${e.disabled}"\n part="option">\n <span class="select-option-check" ${this.multiple?"":"hidden"}>\n <span class="select-option-check-mark" ${a?"":"hidden"}>✓</span>\n </span>\n <img class="select-option-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n <span class="select-option-label">${e.label}</span>\n </div>\n `}).join("")}styles(){return t.css`${":host{display:inline-block;font-family:var(--snice-font-family);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;color:var(--snice-color-text);font-weight:500}.select-label--small{font-size:var(--snice-font-size-sm)}.select-label--medium{font-size:var(--snice-font-size-md)}.select-label--large{font-size:var(--snice-font-size-lg)}.select-label--required::after{content:' *';color:var(--snice-color-danger)}.select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);cursor:pointer;transition:all var(--snice-transition-fast) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text)}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover)}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-color:var(--snice-color-primary)}.select-trigger--open{border-color:var(--snice-color-primary)}.select-trigger--disabled{background:var(--snice-color-background-secondary);cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-background-secondary);cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger)}.select-placeholder{color:var(--snice-color-text-secondary)}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-light);color:var(--snice-color-primary);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-xs)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:2px;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary);display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm);pointer-events:auto}.select-clear:hover{background:var(--snice-color-background-secondary);color:var(--snice-color-text)}.select-arrow{transition:transform var(--snice-transition-fast) ease;color:var(--snice-color-text-secondary);pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:4px;left:0;right:0;background:var(--snice-color-background-element);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-lg);z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast) ease,transform var(--snice-transition-fast) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:8px;border-bottom:1px solid var(--snice-color-border);flex-shrink:0}.select-search-input{width:100%;padding:6px 10px;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-sm);font-family:inherit;color:var(--snice-color-text);box-sizing:border-box}.select-search-input:focus{outline:0;border-color:var(--snice-color-primary)}.select-options{max-height:200px;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border) var(--snice-color-background-secondary)}.select-options::-webkit-scrollbar-track{background:var(--snice-color-background-secondary);margin:4px 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border:2px solid var(--snice-color-background)}.select-option{padding:8px 12px;cursor:pointer;border-radius:var(--snice-border-radius-sm);transition:background var(--snice-transition-fast) ease;display:flex;align-items:center;gap:8px}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-background-secondary)}.select-option--selected{background:var(--snice-color-primary-light);color:var(--snice-color-primary);font-weight:500}.select-option--focused{background:var(--snice-color-background-secondary);outline:2px solid var(--snice-color-primary);outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:16px;height:16px;object-fit:contain;flex-shrink:0}.select-option-check{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:16px;text-align:center;color:var(--snice-color-text-secondary);font-size:var(--snice-font-size-sm)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-background-secondary);border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover)}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:14px;height:14px;margin-right:4px}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){this.readOptionsFromChildren(),this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(e=>e.trim()))),this.filteredOptions=[...this.options],requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.updateTriggerState(),this.updateDropdownState(),this.updateNativeSelectAttributes(),this.updateDropdownContent(),this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton()})}),this.observeChildren(),this.setupGlobalListeners()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect()}setupGlobalListeners(){this.outsideClickHandler=e=>{!this.contains(e.target)&&this.open&&this.closeDropdown()},this.globalKeyHandler=e=>{if(this.open)switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.options)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const e=new MutationObserver(e=>{this.handleChildrenChange(e)});e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=e}handleChildrenChange(e){e.some(e=>"childList"===e.type||!("attributes"!==e.type||!["value","label","disabled","selected"].includes(e.attributeName))&&"SNICE-OPTION"===e.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.options],this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton(),this.updateDropdownContent())}readOptionsFromChildren(){const e=Array.from(this.querySelectorAll("snice-option"));this.options=e.map(e=>{const t=e;return t.optionData?t.optionData:{value:e.getAttribute("value")||"",label:e.getAttribute("label")||e.textContent?.trim()||"",disabled:e.hasAttribute("disabled"),selected:e.hasAttribute("selected")}})}handleTriggerOpen(e){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),this.open||this.openDropdown())}handleSearchKeydown(e){switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.options)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}}focusNextOption(){const e=this.searchable?this.filteredOptions:this.options;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);e[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const e=this.searchable?this.filteredOptions:this.options;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);e[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);this.updateOptionFocus()}}updateOptionFocus(){this.optionElements&&this.optionElements.forEach((e,t)=>{e.classList.toggle("select-option--focused",t===this.focusedIndex)})}handleClearClick(e){e.preventDefault(),e.stopPropagation(),this.clear()}handleTriggerClick(e){e.target.closest(".select-clear")||(e.stopPropagation(),this.disabled||this.readonly||this.toggleDropdown())}handleOptionsClick(e){const t=e.target;if(t.closest(".select-tag-remove")){e.stopPropagation();const a=t.closest(".select-tag-remove").getAttribute("data-value");return void(a&&this.multiple&&(this.selectedValues.delete(a),this.value=Array.from(this.selectedValues).join(","),this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const a=t.closest(".select-option");if(!a)return;e.stopPropagation();const i=a.getAttribute("data-value");if(!i)return;const s=this.options.find(e=>e.value===i);s&&!s.disabled&&this.handleOptionSelect(s)}handleSearchInput(e){const t=e.target.value.toLowerCase();this.filteredOptions=t?this.options.filter(e=>e.label.toLowerCase().includes(t)):[...this.options],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(e){this.multiple?(this.selectedValues.has(e.value)?this.selectedValues.delete(e.value):this.selectedValues.add(e.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=e.value,this.closeDropdown()),this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(e)}handleValueChange(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(e=>e.trim()):[])),this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton()}handleDisabledChange(){this.updateTriggerState(),this.updateNativeSelectAttributes(),this.updateClearButton(),this.disabled&&this.open&&this.closeDropdown()}handleLoadingChange(){this.updateTriggerState(),this.updateNativeSelectAttributes(),this.updateClearButton(),this.loading&&this.open&&this.closeDropdown()}handleOpenChange(){this.updateDropdownState(),this.updateTriggerState(),this.open&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.open||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.options],this.updateDropdownContent()))}handleNativeSelectAttributeChange(){this.updateNativeSelectAttributes()}updateValueDisplay(){if(!this.valueDisplay)return;const e=this.options.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);if(this.multiple&&e.length>0)this.valueDisplay.innerHTML=`\n <div class="select-value--multiple">\n ${e.map(e=>`\n <span class="select-tag">\n <img class="select-tag-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n ${e.label}\n <span class="select-tag-remove" data-value="${e.value}" aria-label="Remove ${e.label}" ${this.disabled||this.readonly?"hidden":""}>×</span>\n </span>\n `).join("")}\n </div>\n `;else if(e.length>0){const t=e[0];this.valueDisplay.innerHTML=`\n <div class="select-value--single">\n <img class="select-value-icon" src="${t.icon||""}" alt="" ${t.icon?"":"hidden"} />\n <span>${t.label}</span>\n </div>\n `}else this.valueDisplay.innerHTML=`<span class="select-placeholder">${this.placeholder}</span>`}updateClearButton(){if(!this.clearButton)return;const e=this.options.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value),t=this.clearable&&e.length>0&&!this.disabled&&!this.readonly;this.clearButton.style.display=t?"":"none"}updateDropdownContent(){this.optionsList&&(this.optionsList.innerHTML=this.renderOptions())}updateNativeSelect(){this.nativeSelect&&(this.nativeSelect.innerHTML="",this.options.forEach(e=>{const t=document.createElement("option");t.value=e.value,t.textContent=e.label,t.selected=this.multiple?this.selectedValues.has(e.value):e.value===this.value,this.nativeSelect.appendChild(t)}))}dispatchChangeEvent(e){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:e,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.trigger?.focus()}blur(){this.trigger?.blur(),this.open&&this.closeDropdown()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.updateNativeSelect(),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()}openDropdown(){this.open||this.disabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.open&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.open?this.closeDropdown():this.openDropdown()}selectOption(e){const t=this.options.find(t=>t.value===e);t&&!t.disabled&&this.handleOptionSelect(t)}updateTriggerState(){this.trigger&&(this.trigger.classList.toggle("select-trigger--open",this.open),this.trigger.classList.toggle("select-trigger--disabled",this.disabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly),this.trigger.classList.toggle("select-trigger--invalid",this.invalid),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.open)),this.trigger.disabled=this.disabled||this.loading)}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.open),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.open))}updateNativeSelectAttributes(){this.nativeSelect&&(this.nativeSelect.disabled=this.disabled||this.loading,this.nativeSelect.required=this.required,this.nativeSelect.multiple=this.multiple,this.name?this.nativeSelect.name=this.name:this.nativeSelect.removeAttribute("name"))}})})();var n=":host{display:flex;align-items:center;padding:0 var(--snice-table-cell-padding,var(--snice-spacing-md,.75rem));min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text)}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:inline-flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:inline-flex;align-items:center;justify-content:center;gap:.125rem}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success)}:host(.negative){color:var(--snice-color-danger)}:host(.warning){color:var(--snice-color-warning);background-color:hsl(var(--snice-color-yellow-100))}:host(.danger){color:var(--snice-color-danger);background-color:hsl(var(--snice-color-red-100))}:host(.success){color:var(--snice-color-success);background-color:hsl(var(--snice-color-green-100))}:host(.info){color:var(--snice-color-primary);background-color:hsl(var(--snice-color-blue-100))}:host(.date--today){font-weight:var(--snice-font-weight-semibold);color:var(--snice-color-primary)}:host(.date--past){color:var(--snice-color-text-secondary)}:host(.date--future){color:var(--snice-color-success)}:host(.number--negative.number--negative-red){color:var(--snice-color-danger)}:host(.number--positive.number--highlighted){color:var(--snice-color-success);font-weight:var(--snice-font-weight-semibold)}:host(.number--zero){color:var(--snice-color-text-secondary)}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary)}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:2px solid var(--snice-color-primary);outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary);text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:hsl(var(--snice-color-green-100))}:host(.negative){background-color:hsl(var(--snice-color-red-100))}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b=[t.element("snice-cell")],y=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property()],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],v=[t.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,w),a(this,null,v,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},E,$),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},D,A),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},T,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},O,N),a(null,e={value:s},b,{kind:"class",name:s.name,metadata:n},null,y),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,y)}render(){return t.html`
167
+ `}renderOptions(){const t=this.searchable?this.filteredOptions:this.options;return 0===t.length?`\n <div class="select-no-options">\n <span class="select-no-options-text" data-search="true" ${!this.searchable||this.filteredOptions.length>0?"hidden":""}>No matches found</span>\n <span class="select-no-options-text" data-search="false" ${this.searchable&&0===this.filteredOptions.length?"hidden":""}>No options available</span>\n </div>\n `:t.map((t,e)=>{const a=this.multiple?this.selectedValues.has(t.value):t.value===this.value;return`\n <div class="select-option \n ${a?"select-option--selected":""}\n ${t.disabled?"select-option--disabled":""}\n ${e===this.focusedIndex?"select-option--focused":""}\n ${t.icon?"select-option--has-icon":""}"\n data-value="${t.value}"\n role="option"\n aria-selected="${a}"\n aria-disabled="${t.disabled}"\n part="option">\n <span class="select-option-check" ${this.multiple?"":"hidden"}>\n <span class="select-option-check-mark" ${a?"":"hidden"}>✓</span>\n </span>\n <img class="select-option-icon" src="${t.icon||""}" alt="" ${t.icon?"":"hidden"} />\n <span class="select-option-label">${t.label}</span>\n </div>\n `}).join("")}styles(){return e.css`${":host{display:inline-block;font-family:var(--snice-font-family);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;color:var(--snice-color-text);font-weight:500}.select-label--small{font-size:var(--snice-font-size-sm)}.select-label--medium{font-size:var(--snice-font-size-md)}.select-label--large{font-size:var(--snice-font-size-lg)}.select-label--required::after{content:' *';color:var(--snice-color-danger)}.select-trigger{width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);cursor:pointer;transition:all var(--snice-transition-fast) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text)}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover)}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-color:var(--snice-color-primary)}.select-trigger--open{border-color:var(--snice-color-primary)}.select-trigger--disabled{background:var(--snice-color-background-secondary);cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-background-secondary);cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger)}.select-placeholder{color:var(--snice-color-text-secondary)}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-light);color:var(--snice-color-primary);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-xs)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:2px;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary);display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm);pointer-events:auto}.select-clear:hover{background:var(--snice-color-background-secondary);color:var(--snice-color-text)}.select-arrow{transition:transform var(--snice-transition-fast) ease;color:var(--snice-color-text-secondary);pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:4px;left:0;right:0;background:var(--snice-color-background-element);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-md);box-shadow:var(--snice-shadow-lg);z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast) ease,transform var(--snice-transition-fast) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:8px;border-bottom:1px solid var(--snice-color-border);flex-shrink:0}.select-search-input{width:100%;padding:6px 10px;background:var(--snice-color-background-input);border:1px solid var(--snice-color-border);border-radius:var(--snice-border-radius-sm);font-size:var(--snice-font-size-sm);font-family:inherit;color:var(--snice-color-text);box-sizing:border-box}.select-search-input:focus{outline:0;border-color:var(--snice-color-primary)}.select-options{max-height:200px;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border) var(--snice-color-background-secondary)}.select-options::-webkit-scrollbar-track{background:var(--snice-color-background-secondary);margin:4px 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border:2px solid var(--snice-color-background)}.select-option{padding:8px 12px;cursor:pointer;border-radius:var(--snice-border-radius-sm);transition:background var(--snice-transition-fast) ease;display:flex;align-items:center;gap:8px}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-background-secondary)}.select-option--selected{background:var(--snice-color-primary-light);color:var(--snice-color-primary);font-weight:500}.select-option--focused{background:var(--snice-color-background-secondary);outline:2px solid var(--snice-color-primary);outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:16px;height:16px;object-fit:contain;flex-shrink:0}.select-option-check{width:16px;height:16px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:16px;text-align:center;color:var(--snice-color-text-secondary);font-size:var(--snice-font-size-sm)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-background-secondary);border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border);border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover)}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:14px;height:14px;margin-right:4px}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}"}`}init(){this.readOptionsFromChildren(),this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(t=>t.trim()))),this.filteredOptions=[...this.options],this.internals&&this.internals.setFormValue(this.value),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.updateTriggerState(),this.updateDropdownState(),this.updateDropdownContent(),this.updateValueDisplay(),this.updateClearButton()})}),this.observeChildren(),this.setupGlobalListeners()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect()}setupGlobalListeners(){this.outsideClickHandler=t=>{!this.contains(t.target)&&this.open&&this.closeDropdown()},this.globalKeyHandler=t=>{if(this.open)switch(t.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":t.preventDefault(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(t.preventDefault(),this.focusedIndex>=0){const t=(this.searchable?this.filteredOptions:this.options)[this.focusedIndex];t&&!t.disabled&&this.handleOptionSelect(t)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const t=new MutationObserver(t=>{this.handleChildrenChange(t)});t.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=t}handleChildrenChange(t){t.some(t=>"childList"===t.type||!("attributes"!==t.type||!["value","label","disabled","selected"].includes(t.attributeName))&&"SNICE-OPTION"===t.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.options],this.updateValueDisplay(),this.updateClearButton(),this.updateDropdownContent())}readOptionsFromChildren(){const t=Array.from(this.querySelectorAll("snice-option"));this.options=t.map(t=>{const e=t;return e.optionData?e.optionData:{value:t.getAttribute("value")||"",label:t.getAttribute("label")||t.textContent?.trim()||"",disabled:t.hasAttribute("disabled"),selected:t.hasAttribute("selected")}})}handleTriggerOpen(t){["Enter"," ","ArrowDown","ArrowUp"].includes(t.key)&&(t.preventDefault(),this.open||this.openDropdown())}handleSearchKeydown(t){switch(t.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":t.preventDefault(),this.focusNextOption();break;case"ArrowUp":t.preventDefault(),this.focusPreviousOption();break;case"Enter":if(t.preventDefault(),this.focusedIndex>=0){const t=(this.searchable?this.filteredOptions:this.options)[this.focusedIndex];t&&!t.disabled&&this.handleOptionSelect(t)}}}focusNextOption(){const t=this.searchable?this.filteredOptions:this.options;if(0!==t.filter(t=>!t.disabled).length){for(this.focusedIndex++,this.focusedIndex>=t.length&&(this.focusedIndex=0);t[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=t.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const t=this.searchable?this.filteredOptions:this.options;if(0!==t.filter(t=>!t.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=t.length-1);t[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=t.length-1);this.updateOptionFocus()}}updateOptionFocus(){this.optionElements&&this.optionElements.forEach((t,e)=>{t.classList.toggle("select-option--focused",e===this.focusedIndex)})}handleClearClick(t){t.preventDefault(),t.stopPropagation(),this.clear()}handleTriggerClick(t){t.target.closest(".select-clear")||(t.stopPropagation(),this.disabled||this.readonly||this.toggleDropdown())}handleOptionsClick(t){const e=t.target;if(e.closest(".select-tag-remove")){t.stopPropagation();const a=e.closest(".select-tag-remove").getAttribute("data-value");return void(a&&this.multiple&&(this.selectedValues.delete(a),this.value=Array.from(this.selectedValues).join(","),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const a=e.closest(".select-option");if(!a)return;t.stopPropagation();const i=a.getAttribute("data-value");if(!i)return;const s=this.options.find(t=>t.value===i);s&&!s.disabled&&this.handleOptionSelect(s)}handleSearchInput(t){const e=t.target.value.toLowerCase();this.filteredOptions=e?this.options.filter(t=>t.label.toLowerCase().includes(e)):[...this.options],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(t){this.multiple?(this.selectedValues.has(t.value)?this.selectedValues.delete(t.value):this.selectedValues.add(t.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=t.value,this.closeDropdown()),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(t)}handleValueChange(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(t=>t.trim()):[])),this.updateValueDisplay(),this.updateClearButton(),this.internals&&this.internals.setFormValue(this.value)}handleDisabledChange(){this.updateTriggerState(),this.updateClearButton(),this.disabled&&this.open&&this.closeDropdown()}handleLoadingChange(){this.updateTriggerState(),this.updateClearButton(),this.loading&&this.open&&this.closeDropdown()}handleOpenChange(){this.updateDropdownState(),this.updateTriggerState(),this.open&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.open||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.options],this.updateDropdownContent()))}updateValueDisplay(){if(!this.valueDisplay)return;const t=this.options.filter(t=>this.multiple?this.selectedValues.has(t.value):t.value===this.value);if(this.multiple&&t.length>0)this.valueDisplay.innerHTML=`\n <div class="select-value--multiple">\n ${t.map(t=>`\n <span class="select-tag">\n <img class="select-tag-icon" src="${t.icon||""}" alt="" ${t.icon?"":"hidden"} />\n ${t.label}\n <span class="select-tag-remove" data-value="${t.value}" aria-label="Remove ${t.label}" ${this.disabled||this.readonly?"hidden":""}>×</span>\n </span>\n `).join("")}\n </div>\n `;else if(t.length>0){const e=t[0];this.valueDisplay.innerHTML=`\n <div class="select-value--single">\n <img class="select-value-icon" src="${e.icon||""}" alt="" ${e.icon?"":"hidden"} />\n <span>${e.label}</span>\n </div>\n `}else this.valueDisplay.innerHTML=`<span class="select-placeholder">${this.placeholder}</span>`}updateClearButton(){if(!this.clearButton)return;const t=this.options.filter(t=>this.multiple?this.selectedValues.has(t.value):t.value===this.value),e=this.clearable&&t.length>0&&!this.disabled&&!this.readonly;this.clearButton.style.display=e?"":"none"}updateDropdownContent(){this.optionsList&&(this.optionsList.innerHTML=this.renderOptions())}dispatchChangeEvent(t){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:t,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.trigger?.focus()}blur(){this.trigger?.blur(),this.open&&this.closeDropdown()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()}openDropdown(){this.open||this.disabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.open&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.open?this.closeDropdown():this.openDropdown()}selectOption(t){const e=this.options.find(e=>e.value===t);e&&!e.disabled&&this.handleOptionSelect(e)}updateTriggerState(){this.trigger&&(this.trigger.classList.toggle("select-trigger--open",this.open),this.trigger.classList.toggle("select-trigger--disabled",this.disabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly),this.trigger.classList.toggle("select-trigger--invalid",this.invalid),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.open)),this.trigger.disabled=this.disabled||this.loading)}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.open),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.open))}})})();var n=":host{display:flex;align-items:center;padding:0 var(--snice-table-cell-padding,var(--snice-spacing-md,.75rem));min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text)}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:inline-flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:inline-flex;align-items:center;justify-content:center;gap:.125rem}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success)}:host(.negative){color:var(--snice-color-danger)}:host(.warning){color:var(--snice-color-warning);background-color:hsl(var(--snice-color-yellow-100))}:host(.danger){color:var(--snice-color-danger);background-color:hsl(var(--snice-color-red-100))}:host(.success){color:var(--snice-color-success);background-color:hsl(var(--snice-color-green-100))}:host(.info){color:var(--snice-color-primary);background-color:hsl(var(--snice-color-blue-100))}:host(.date--today){font-weight:var(--snice-font-weight-semibold);color:var(--snice-color-primary)}:host(.date--past){color:var(--snice-color-text-secondary)}:host(.date--future){color:var(--snice-color-success)}:host(.number--negative.number--negative-red){color:var(--snice-color-danger)}:host(.number--positive.number--highlighted){color:var(--snice-color-success);font-weight:var(--snice-font-weight-semibold)}:host(.number--zero){color:var(--snice-color-text-secondary)}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary)}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:2px solid var(--snice-color-primary);outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary);text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:hsl(var(--snice-color-green-100))}:host(.negative){background-color:hsl(var(--snice-color-red-100))}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property()],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("align")],y=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,w),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},$,D),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},T,E),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},A,j),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},F,L),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:n},null,b),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,b)}render(){return e.html`
176
168
  <div class="cell-content" part="content">
177
169
  ${this.formatValue()}
178
170
  </div>
179
- `}styles(){return t.css`${n}`}init(){this.applyAlignment(),this.applyConditionalFormatting()}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.formatValue()),this.applyConditionalFormatting()}applyAlignment(){this.style.textAlign=this.align}applyConditionalFormatting(){if(this.column&&this.column.conditionalFormats){this.removeAttribute("style"),this.className="snice-cell",this.applyAlignment(),this.column.style&&this.applyStyle(this.column.style);for(const e of this.column.conditionalFormats)if(e.condition(this.value,this.rowData)){e.style&&this.applyStyle(e.style),e.className&&this.classList.add(e.className);break}}}applyStyle(e){e.backgroundColor&&(this.style.backgroundColor=e.backgroundColor),e.color&&(this.style.color=e.color),e.fontWeight&&(this.style.fontWeight=e.fontWeight),e.fontStyle&&(this.style.fontStyle=e.fontStyle),e.fontSize&&(this.style.fontSize=e.fontSize),e.textDecoration&&(this.style.textDecoration=e.textDecoration)}formatValue(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);switch(this.type){case"text":return this.formatText();case"number":return this.formatNumber();case"currency":return this.formatCurrency();case"percent":return this.formatPercent();case"accounting":return this.formatAccounting();case"scientific":return this.formatScientific();case"fraction":return this.formatFraction();case"date":return this.formatDate();case"boolean":return this.formatBoolean();case"rating":return this.formatRating();case"progress":return this.formatProgress();case"sparkline":return this.formatSparkline();case"duration":return this.formatDuration();case"filesize":return this.formatFilesize();default:return String(this.value)}}formatText(){return String(this.value)}formatNumber(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let a=t.toFixed(e.decimals??0);if(e.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}return t<0&&"parentheses"===e.negativeStyle&&(a=`(${a.replace("-","")})`),e.prefix&&(a=e.prefix+a),e.suffix&&(a+=e.suffix),a}formatCurrency(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);const a={style:"currency",currency:"USD",minimumFractionDigits:e.decimals??2,maximumFractionDigits:e.decimals??2};return new Intl.NumberFormat("en-US",a).format(t)}formatPercent(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);const a={style:"percent",minimumFractionDigits:e.decimals??1,maximumFractionDigits:e.decimals??1};return new Intl.NumberFormat("en-US",a).format(t)}formatAccounting(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let a=Math.abs(t).toFixed(e.decimals??2);if(e.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}return a=t<0?`(${a})`:` ${a} `,a}formatScientific(){const e=this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):t.toExponential(e.decimals??2)}formatFraction(){const e=Number(this.value);if(isNaN(e))return String(this.value);let t=1,a=0,i=0,s=1,n=e;do{const e=Math.floor(n);let l=t;t=e*t+a,a=l,l=i,i=e*i+s,s=l,n=1/(n-e)}while(Math.abs(e-t/i)>1e-6*e);return`${t}/${i}`}formatDate(){const e=this.column.dateFormat||{},t=new Date(this.value);if(isNaN(t.getTime()))return String(this.value);if(e.customFormat)return e.customFormat.replace("YYYY",t.getFullYear().toString()).replace("MM",(t.getMonth()+1).toString().padStart(2,"0")).replace("DD",t.getDate().toString().padStart(2,"0"));const a={};switch(e.format){case"short":default:a.dateStyle="short";break;case"medium":a.dateStyle="medium";break;case"long":a.dateStyle="long";break;case"full":a.dateStyle="full"}return new Intl.DateTimeFormat(e.locale||"en-US",a).format(t)}formatBoolean(){const e=this.column.booleanFormat||{},t=Boolean(this.value);return e.useSymbols?t?e.trueSymbol||"✓":e.falseSymbol||"✗":t?e.trueValue||"true":e.falseValue||"false"}formatRating(){const e=this.column.ratingFormat||{},t=Number(this.value),a=e.max||5,i=e.symbol||"★",s=e.emptySymbol||"☆";if(isNaN(t))return String(this.value);let n="";const l=e.color||getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),r=getComputedStyle(this).getPropertyValue("--snice-color-border").trim();for(let e=0;e<a;e++)n+=e<t?`<span style="color: ${l}">${i}</span>`:`<span style="color: ${r}">${s}</span>`;return n}formatProgress(){const e=this.column.progressFormat||{},t=Number(this.value),a=e.max||100,i=Math.min(100,Math.max(0,t/a*100));if(isNaN(t))return String(this.value);const s=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=e.backgroundColor||getComputedStyle(this).getPropertyValue("--snice-color-border").trim();let l=`\n <div style="\n width: 100%; \n height: ${e.height||"1rem"}; \n background-color: ${n}; \n border-radius: 0.25rem; \n overflow: hidden;\n position: relative;\n ">\n <div style="\n width: ${i}%; \n height: 100%; \n background-color: ${s}; \n transition: width 0.3s ease;\n "></div>\n `;if(e.showPercentage){l+=`\n <span style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.75rem;\n font-weight: bold;\n color: ${i>50?getComputedStyle(this).getPropertyValue("--snice-color-text-inverse").trim():getComputedStyle(this).getPropertyValue("--snice-color-text").trim()};\n ">${Math.round(i)}%</span>\n `}return l+="</div>",l}formatSparkline(){const e=this.column.sparklineFormat||{},t=Array.isArray(this.value)?this.value:[];if(0===t.length)return"";const a=e.width||60,i=e.height||20,s=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=e.type||"line",l=Math.max(...t),r=Math.min(...t),o=l-r||1;if("line"===n){const e=t.map((e,s)=>`${s/(t.length-1)*a},${i-(e-r)/o*i}`).join(" ");return`\n <svg width="${a}" height="${i}" style="display: block;">\n <polyline \n points="${e}" \n fill="none" \n stroke="${s}" \n stroke-width="2"\n />\n </svg>\n `}if("bar"===n){const e=a/t.length,n=t.map((t,a)=>{const n=(t-r)/o*i;return`<rect x="${a*e}" y="${i-n}" width="${e-1}" height="${n}" fill="${s}" />`}).join("");return`\n <svg width="${a}" height="${i}" style="display: block;">\n ${n}\n </svg>\n `}return String(this.value)}formatDuration(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=Math.floor(e/3600),a=Math.floor(e%3600/60),i=e%60;return t>0?`${t}:${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${a}:${i.toString().padStart(2,"0")}`}formatFilesize(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let a=e,i=0;for(;a>=1024&&i<t.length-1;)a/=1024,i++;return`${a.toFixed(0===i?0:1)} ${t[i]}`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"left")),this.type=(i(this,x),i(this,S,"text")),this.value=(i(this,C),i(this,E,"")),this.column=(i(this,$),i(this,D,{key:"",label:"",type:"text",align:"left"})),this.rowData=(i(this,A),i(this,T,null)),this.contentElement=(i(this,L),i(this,O,void 0)),i(this,N)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b,y,f=[t.element("snice-cell-text")],w=[],k=HTMLElement,x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[],B=[],z=[],M=[],V=[],j=[],F=[];(class extends k{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.property({type:Boolean})],p=[t.property({type:Number,attribute:"max-lines"})],m=[t.render()],g=[t.styles()],v=[t.ready()],b=[t.watch("align")],y=[t.watch("value","column")],a(this,null,m,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,x),a(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,x),a(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,x),a(this,null,b,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,x),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,x),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},S,C),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},E,$),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},D,A),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},T,L),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},O,N),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},B,z),a(null,null,u,{kind:"field",name:"multiline",static:!1,private:!1,access:{has:e=>"multiline"in e,get:e=>e.multiline,set:(e,t)=>{e.multiline=t}},metadata:n},M,V),a(null,null,p,{kind:"field",name:"maxLines",static:!1,private:!1,access:{has:e=>"maxLines"in e,get:e=>e.maxLines,set:(e,t)=>{e.maxLines=t}},metadata:n},j,F),a(null,e={value:s},f,{kind:"class",name:s.name,metadata:n},null,w),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,w)}render(){const e=this.formatTextContent(),a=this.getTextStyles();return t.html`
171
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment(),this.applyConditionalFormatting()}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.formatValue()),this.applyConditionalFormatting()}applyAlignment(){this.style.textAlign=this.align}applyConditionalFormatting(){if(this.column&&this.column.conditionalFormats){this.removeAttribute("style"),this.className="snice-cell",this.applyAlignment(),this.column.style&&this.applyStyle(this.column.style);for(const t of this.column.conditionalFormats)if(t.condition(this.value,this.rowData)){t.style&&this.applyStyle(t.style),t.className&&this.classList.add(t.className);break}}}applyStyle(t){t.backgroundColor&&(this.style.backgroundColor=t.backgroundColor),t.color&&(this.style.color=t.color),t.fontWeight&&(this.style.fontWeight=t.fontWeight),t.fontStyle&&(this.style.fontStyle=t.fontStyle),t.fontSize&&(this.style.fontSize=t.fontSize),t.textDecoration&&(this.style.textDecoration=t.textDecoration)}formatValue(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);switch(this.type){case"text":return this.formatText();case"number":return this.formatNumber();case"currency":return this.formatCurrency();case"percent":return this.formatPercent();case"accounting":return this.formatAccounting();case"scientific":return this.formatScientific();case"fraction":return this.formatFraction();case"date":return this.formatDate();case"boolean":return this.formatBoolean();case"rating":return this.formatRating();case"progress":return this.formatProgress();case"sparkline":return this.formatSparkline();case"duration":return this.formatDuration();case"filesize":return this.formatFilesize();default:return String(this.value)}}formatText(){return String(this.value)}formatNumber(){const t=this.column.numberFormat||{},e=Number(this.value);if(isNaN(e))return String(this.value);let a=e.toFixed(t.decimals??0);if(t.thousandsSeparator){const t=a.split(".");t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=t.join(".")}return e<0&&"parentheses"===t.negativeStyle&&(a=`(${a.replace("-","")})`),t.prefix&&(a=t.prefix+a),t.suffix&&(a+=t.suffix),a}formatCurrency(){const t=this.column.numberFormat||{},e=Number(this.value);if(isNaN(e))return String(this.value);const a={style:"currency",currency:"USD",minimumFractionDigits:t.decimals??2,maximumFractionDigits:t.decimals??2};return new Intl.NumberFormat("en-US",a).format(e)}formatPercent(){const t=this.column.numberFormat||{},e=Number(this.value);if(isNaN(e))return String(this.value);const a={style:"percent",minimumFractionDigits:t.decimals??1,maximumFractionDigits:t.decimals??1};return new Intl.NumberFormat("en-US",a).format(e)}formatAccounting(){const t=this.column.numberFormat||{},e=Number(this.value);if(isNaN(e))return String(this.value);let a=Math.abs(e).toFixed(t.decimals??2);if(t.thousandsSeparator){const t=a.split(".");t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=t.join(".")}return a=e<0?`(${a})`:` ${a} `,a}formatScientific(){const t=this.column.numberFormat||{},e=Number(this.value);return isNaN(e)?String(this.value):e.toExponential(t.decimals??2)}formatFraction(){const t=Number(this.value);if(isNaN(t))return String(this.value);let e=1,a=0,i=0,s=1,n=t;do{const t=Math.floor(n);let l=e;e=t*e+a,a=l,l=i,i=t*i+s,s=l,n=1/(n-t)}while(Math.abs(t-e/i)>1e-6*t);return`${e}/${i}`}formatDate(){const t=this.column.dateFormat||{},e=new Date(this.value);if(isNaN(e.getTime()))return String(this.value);if(t.customFormat)return t.customFormat.replace("YYYY",e.getFullYear().toString()).replace("MM",(e.getMonth()+1).toString().padStart(2,"0")).replace("DD",e.getDate().toString().padStart(2,"0"));const a={};switch(t.format){case"short":default:a.dateStyle="short";break;case"medium":a.dateStyle="medium";break;case"long":a.dateStyle="long";break;case"full":a.dateStyle="full"}return new Intl.DateTimeFormat(t.locale||"en-US",a).format(e)}formatBoolean(){const t=this.column.booleanFormat||{},e=Boolean(this.value);return t.useSymbols?e?t.trueSymbol||"✓":t.falseSymbol||"✗":e?t.trueValue||"true":t.falseValue||"false"}formatRating(){const t=this.column.ratingFormat||{},e=Number(this.value),a=t.max||5,i=t.symbol||"★",s=t.emptySymbol||"☆";if(isNaN(e))return String(this.value);let n="";const l=t.color||getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),r=getComputedStyle(this).getPropertyValue("--snice-color-border").trim();for(let t=0;t<a;t++)n+=t<e?`<span style="color: ${l}">${i}</span>`:`<span style="color: ${r}">${s}</span>`;return n}formatProgress(){const t=this.column.progressFormat||{},e=Number(this.value),a=t.max||100,i=Math.min(100,Math.max(0,e/a*100));if(isNaN(e))return String(this.value);const s=t.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=t.backgroundColor||getComputedStyle(this).getPropertyValue("--snice-color-border").trim();let l=`\n <div style="\n width: 100%; \n height: ${t.height||"1rem"}; \n background-color: ${n}; \n border-radius: 0.25rem; \n overflow: hidden;\n position: relative;\n ">\n <div style="\n width: ${i}%; \n height: 100%; \n background-color: ${s}; \n transition: width 0.3s ease;\n "></div>\n `;if(t.showPercentage){l+=`\n <span style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.75rem;\n font-weight: bold;\n color: ${i>50?getComputedStyle(this).getPropertyValue("--snice-color-text-inverse").trim():getComputedStyle(this).getPropertyValue("--snice-color-text").trim()};\n ">${Math.round(i)}%</span>\n `}return l+="</div>",l}formatSparkline(){const t=this.column.sparklineFormat||{},e=Array.isArray(this.value)?this.value:[];if(0===e.length)return"";const a=t.width||60,i=t.height||20,s=t.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=t.type||"line",l=Math.max(...e),r=Math.min(...e),o=l-r||1;if("line"===n){const t=e.map((t,s)=>`${s/(e.length-1)*a},${i-(t-r)/o*i}`).join(" ");return`\n <svg width="${a}" height="${i}" style="display: block;">\n <polyline \n points="${t}" \n fill="none" \n stroke="${s}" \n stroke-width="2"\n />\n </svg>\n `}if("bar"===n){const t=a/e.length,n=e.map((e,a)=>{const n=(e-r)/o*i;return`<rect x="${a*t}" y="${i-n}" width="${t-1}" height="${n}" fill="${s}" />`}).join("");return`\n <svg width="${a}" height="${i}" style="display: block;">\n ${n}\n </svg>\n `}return String(this.value)}formatDuration(){const t=Number(this.value);if(isNaN(t))return String(this.value);const e=Math.floor(t/3600),a=Math.floor(t%3600/60),i=t%60;return e>0?`${e}:${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${a}:${i.toString().padStart(2,"0")}`}formatFilesize(){const t=Number(this.value);if(isNaN(t))return String(this.value);const e=["B","KB","MB","GB","TB"];let a=t,i=0;for(;a>=1024&&i<e.length-1;)a/=1024,i++;return`${a.toFixed(0===i?0:1)} ${e[i]}`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"left")),this.type=(i(this,x),i(this,S,"text")),this.value=(i(this,C),i(this,$,"")),this.column=(i(this,D),i(this,T,{key:"",label:"",type:"text",align:"left"})),this.rowData=(i(this,E),i(this,A,null)),this.contentElement=(i(this,j),i(this,F,void 0)),i(this,L)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f=[e.element("snice-cell-text")],w=[],k=HTMLElement,x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[];(class extends k{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({type:Boolean})],p=[e.property({type:Number,attribute:"max-lines"})],m=[e.render()],g=[e.styles()],y=[e.ready()],v=[e.watch("align")],b=[e.watch("value","column")],a(this,null,m,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,x),a(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,x),a(this,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,x),a(this,null,v,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,x),a(this,null,b,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,x),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},S,C),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},$,D),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},T,E),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},A,j),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},F,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},z,O),a(null,null,u,{kind:"field",name:"multiline",static:!1,private:!1,access:{has:t=>"multiline"in t,get:t=>t.multiline,set:(t,e)=>{t.multiline=e}},metadata:n},B,M),a(null,null,p,{kind:"field",name:"maxLines",static:!1,private:!1,access:{has:t=>"maxLines"in t,get:t=>t.maxLines,set:(t,e)=>{t.maxLines=e}},metadata:n},P,V),a(null,t={value:s},f,{kind:"class",name:s.name,metadata:n},null,w),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,w)}render(){const t=this.formatTextContent(),a=this.getTextStyles();return e.html`
180
172
  <div class="cell-content cell-content--text" part="content" style="${a}">
181
- ${e}
173
+ ${t}
182
174
  </div>
183
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatTextContent(),t=this.getTextStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatTextContent(){if(null===this.value||void 0===this.value)return"";let e=String(this.value);return this.column.formatter&&(e=this.column.formatter(this.value,this.rowData)),this.multiline&&(e=e.replace(/\n/g,"<br>")),!this.multiline&&this.column.ellipsis,e}getTextStyles(){let e=[];return this.multiline?(this.column.wrap&&(e.push("white-space: pre-wrap"),e.push("word-wrap: break-word")),this.maxLines&&(e.push("display: -webkit-box"),e.push("-webkit-box-orient: vertical"),e.push(`-webkit-line-clamp: ${this.maxLines}`),e.push("overflow: hidden"))):(e.push("white-space: nowrap"),this.column.ellipsis&&(e.push("overflow: hidden"),e.push("text-overflow: ellipsis"))),e.join("; ")}constructor(){super(...arguments),this.align=(i(this,x),i(this,S,"left")),this.type=(i(this,C),i(this,E,"text")),this.value=(i(this,$),i(this,D,"")),this.column=(i(this,A),i(this,T,{key:"",label:"",type:"text",align:"left"})),this.rowData=(i(this,L),i(this,O,null)),this.contentElement=(i(this,N),i(this,B,void 0)),this.multiline=(i(this,z),i(this,M,!1)),this.maxLines=(i(this,V),i(this,j,void 0)),i(this,F)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x,S=[t.element("snice-cell-number")],C=[],E=HTMLElement,$=[],D=[],A=[],T=[],L=[],O=[],N=[],B=[],z=[],M=[],V=[],j=[],F=[],I=[],q=[],P=[],R=[],H=[],Y=[],W=[],U=[],K=[],G=[],J=[],X=[];(class extends E{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(E[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.property({type:Number})],p=[t.property({type:Boolean,attribute:"thousands-separator"})],m=[t.property({})],g=[t.property({})],v=[t.property({attribute:"negative-style"})],b=[t.property({type:Boolean})],y=[t.render()],f=[t.styles()],w=[t.ready()],k=[t.watch("align")],x=[t.watch("value","column")],a(this,null,y,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,$),a(this,null,f,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,$),a(this,null,w,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,$),a(this,null,k,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,$),a(this,null,x,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,$),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},D,A),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},T,L),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},O,N),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},B,z),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},M,V),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},j,F),a(null,null,u,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:n},I,q),a(null,null,p,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:n},P,R),a(null,null,m,{kind:"field",name:"prefix",static:!1,private:!1,access:{has:e=>"prefix"in e,get:e=>e.prefix,set:(e,t)=>{e.prefix=t}},metadata:n},H,Y),a(null,null,g,{kind:"field",name:"suffix",static:!1,private:!1,access:{has:e=>"suffix"in e,get:e=>e.suffix,set:(e,t)=>{e.suffix=t}},metadata:n},W,U),a(null,null,v,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:n},K,G),a(null,null,b,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:e=>"highlight"in e,get:e=>e.highlight,set:(e,t)=>{e.highlight=t}},metadata:n},J,X),a(null,e={value:s},S,{kind:"class",name:s.name,metadata:n},null,C),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,C)}render(){const e=this.formatNumberValue(),a=this.getNumberStyles();return t.html`
175
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatTextContent(),e=this.getTextStyles();this.contentElement.innerHTML=t,this.contentElement.setAttribute("style",e)}}formatTextContent(){if(null===this.value||void 0===this.value)return"";let t=String(this.value);return this.column.formatter&&(t=this.column.formatter(this.value,this.rowData)),this.multiline&&(t=t.replace(/\n/g,"<br>")),!this.multiline&&this.column.ellipsis,t}getTextStyles(){let t=[];return this.multiline?(this.column.wrap&&(t.push("white-space: pre-wrap"),t.push("word-wrap: break-word")),this.maxLines&&(t.push("display: -webkit-box"),t.push("-webkit-box-orient: vertical"),t.push(`-webkit-line-clamp: ${this.maxLines}`),t.push("overflow: hidden"))):(t.push("white-space: nowrap"),this.column.ellipsis&&(t.push("overflow: hidden"),t.push("text-overflow: ellipsis"))),t.join("; ")}constructor(){super(...arguments),this.align=(i(this,x),i(this,S,"left")),this.type=(i(this,C),i(this,$,"text")),this.value=(i(this,D),i(this,T,"")),this.column=(i(this,E),i(this,A,{key:"",label:"",type:"text",align:"left"})),this.rowData=(i(this,j),i(this,F,null)),this.contentElement=(i(this,L),i(this,z,void 0)),this.multiline=(i(this,O),i(this,B,!1)),this.maxLines=(i(this,M),i(this,P,void 0)),i(this,V)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S=[e.element("snice-cell-number")],C=[],$=HTMLElement,D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[],K=[],G=[],_=[];(class extends ${static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create($[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({type:Number})],p=[e.property({type:Boolean,attribute:"thousands-separator"})],m=[e.property({})],g=[e.property({})],y=[e.property({attribute:"negative-style"})],v=[e.property({type:Boolean})],b=[e.render()],f=[e.styles()],w=[e.ready()],k=[e.watch("align")],x=[e.watch("value","column")],a(this,null,b,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,D),a(this,null,f,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,D),a(this,null,w,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,D),a(this,null,k,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,D),a(this,null,x,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,D),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},T,E),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},A,j),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},F,L),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},z,O),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},B,M),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},P,V),a(null,null,u,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:t=>"decimals"in t,get:t=>t.decimals,set:(t,e)=>{t.decimals=e}},metadata:n},N,H),a(null,null,p,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:t=>"thousandsSeparator"in t,get:t=>t.thousandsSeparator,set:(t,e)=>{t.thousandsSeparator=e}},metadata:n},I,R),a(null,null,m,{kind:"field",name:"prefix",static:!1,private:!1,access:{has:t=>"prefix"in t,get:t=>t.prefix,set:(t,e)=>{t.prefix=e}},metadata:n},q,W),a(null,null,g,{kind:"field",name:"suffix",static:!1,private:!1,access:{has:t=>"suffix"in t,get:t=>t.suffix,set:(t,e)=>{t.suffix=e}},metadata:n},Y,U),a(null,null,y,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:t=>"negativeStyle"in t,get:t=>t.negativeStyle,set:(t,e)=>{t.negativeStyle=e}},metadata:n},J,K),a(null,null,v,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:t=>"highlight"in t,get:t=>t.highlight,set:(t,e)=>{t.highlight=e}},metadata:n},G,_),a(null,t={value:s},S,{kind:"class",name:s.name,metadata:n},null,C),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,C)}render(){const t=this.formatNumberValue(),a=this.getNumberStyles();return e.html`
184
176
  <div class="cell-content cell-content--number" part="content" style="${a}">
185
- ${e}
177
+ ${t}
186
178
  </div>
187
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatNumberValue(),t=this.getNumberStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatNumberValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.numberFormat||{decimals:this.decimals,thousandsSeparator:this.thousandsSeparator,prefix:this.prefix,suffix:this.suffix,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);let a=t.toFixed(e.decimals??this.decimals);if(e.thousandsSeparator??this.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}if(t<0){const t=e.negativeStyle??this.negativeStyle;"parentheses"===t?a=`(${a.replace("-","")})`:"red"===t&&(a=a.replace("-",""))}const i=e.prefix??this.prefix,s=e.suffix??this.suffix;return i&&(a=i+a),s&&(a+=s),a}getNumberStyles(){const e=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0){this.classList.add("number--negative");"red"===(this.column.numberFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(i(this,$),i(this,D,"right")),this.type=(i(this,A),i(this,T,"number")),this.value=(i(this,L),i(this,O,"")),this.column=(i(this,N),i(this,B,{key:"",label:"",type:"number",align:"right"})),this.rowData=(i(this,z),i(this,M,null)),this.contentElement=(i(this,V),i(this,j,void 0)),this.decimals=(i(this,F),i(this,I,0)),this.thousandsSeparator=(i(this,q),i(this,P,!1)),this.prefix=(i(this,R),i(this,H,"")),this.suffix=(i(this,Y),i(this,W,"")),this.negativeStyle=(i(this,U),i(this,K,"minus")),this.highlight=(i(this,G),i(this,J,!1)),i(this,X)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x=[t.element("snice-cell-date")],S=[],C=HTMLElement,E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[],B=[],z=[],M=[],V=[],j=[],F=[],I=[],q=[],P=[],R=[],H=[],Y=[],W=[],U=[],K=[];(class extends C{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.property({attribute:"date-format"})],p=[t.property({attribute:"custom-format"})],m=[t.property({})],g=[t.property({type:Boolean,attribute:"relative-time"})],v=[t.property({type:Boolean,attribute:"show-time"})],b=[t.render()],y=[t.styles()],f=[t.ready()],w=[t.watch("align")],k=[t.watch("value","column")],a(this,null,b,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,E),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,E),a(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,E),a(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,E),a(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,E),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},$,D),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},A,T),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},L,O),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},N,B),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},z,M),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},V,j),a(null,null,u,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:n},F,I),a(null,null,p,{kind:"field",name:"customFormat",static:!1,private:!1,access:{has:e=>"customFormat"in e,get:e=>e.customFormat,set:(e,t)=>{e.customFormat=t}},metadata:n},q,P),a(null,null,m,{kind:"field",name:"locale",static:!1,private:!1,access:{has:e=>"locale"in e,get:e=>e.locale,set:(e,t)=>{e.locale=t}},metadata:n},R,H),a(null,null,g,{kind:"field",name:"relativeTime",static:!1,private:!1,access:{has:e=>"relativeTime"in e,get:e=>e.relativeTime,set:(e,t)=>{e.relativeTime=t}},metadata:n},Y,W),a(null,null,v,{kind:"field",name:"showTime",static:!1,private:!1,access:{has:e=>"showTime"in e,get:e=>e.showTime,set:(e,t)=>{e.showTime=t}},metadata:n},U,K),a(null,e={value:s},x,{kind:"class",name:s.name,metadata:n},null,S),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,S)}render(){const e=this.formatDateValue(),a=this.getDateStyles();return t.html`
179
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatNumberValue(),e=this.getNumberStyles();this.contentElement.innerHTML=t,this.contentElement.setAttribute("style",e)}}formatNumberValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=this.column.numberFormat||{decimals:this.decimals,thousandsSeparator:this.thousandsSeparator,prefix:this.prefix,suffix:this.suffix,negativeStyle:this.negativeStyle},e=Number(this.value);if(isNaN(e))return String(this.value);let a=e.toFixed(t.decimals??this.decimals);if(t.thousandsSeparator??this.thousandsSeparator){const t=a.split(".");t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=t.join(".")}if(e<0){const e=t.negativeStyle??this.negativeStyle;"parentheses"===e?a=`(${a.replace("-","")})`:"red"===e&&(a=a.replace("-",""))}const i=t.prefix??this.prefix,s=t.suffix??this.suffix;return i&&(a=i+a),s&&(a+=s),a}getNumberStyles(){const t=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),t<0){this.classList.add("number--negative");"red"===(this.column.numberFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else t>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===t&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(i(this,D),i(this,T,"right")),this.type=(i(this,E),i(this,A,"number")),this.value=(i(this,j),i(this,F,"")),this.column=(i(this,L),i(this,z,{key:"",label:"",type:"number",align:"right"})),this.rowData=(i(this,O),i(this,B,null)),this.contentElement=(i(this,M),i(this,P,void 0)),this.decimals=(i(this,V),i(this,N,0)),this.thousandsSeparator=(i(this,H),i(this,I,!1)),this.prefix=(i(this,R),i(this,q,"")),this.suffix=(i(this,W),i(this,Y,"")),this.negativeStyle=(i(this,U),i(this,J,"minus")),this.highlight=(i(this,K),i(this,G,!1)),i(this,_)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x=[e.element("snice-cell-date")],S=[],C=HTMLElement,$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[];(class extends C{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({attribute:"date-format"})],p=[e.property({attribute:"custom-format"})],m=[e.property({})],g=[e.property({type:Boolean,attribute:"relative-time"})],y=[e.property({type:Boolean,attribute:"show-time"})],v=[e.render()],b=[e.styles()],f=[e.ready()],w=[e.watch("align")],k=[e.watch("value","column")],a(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,$),a(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,$),a(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,$),a(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,$),a(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,$),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},D,T),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},E,A),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},j,F),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},L,z),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},O,B),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},M,P),a(null,null,u,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:t=>"dateFormat"in t,get:t=>t.dateFormat,set:(t,e)=>{t.dateFormat=e}},metadata:n},V,N),a(null,null,p,{kind:"field",name:"customFormat",static:!1,private:!1,access:{has:t=>"customFormat"in t,get:t=>t.customFormat,set:(t,e)=>{t.customFormat=e}},metadata:n},H,I),a(null,null,m,{kind:"field",name:"locale",static:!1,private:!1,access:{has:t=>"locale"in t,get:t=>t.locale,set:(t,e)=>{t.locale=e}},metadata:n},R,q),a(null,null,g,{kind:"field",name:"relativeTime",static:!1,private:!1,access:{has:t=>"relativeTime"in t,get:t=>t.relativeTime,set:(t,e)=>{t.relativeTime=e}},metadata:n},W,Y),a(null,null,y,{kind:"field",name:"showTime",static:!1,private:!1,access:{has:t=>"showTime"in t,get:t=>t.showTime,set:(t,e)=>{t.showTime=e}},metadata:n},U,J),a(null,t={value:s},x,{kind:"class",name:s.name,metadata:n},null,S),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,S)}render(){const t=this.formatDateValue(),a=this.getDateStyles();return e.html`
188
180
  <div class="cell-content cell-content--date" part="content" style="${a}">
189
- ${e}
181
+ ${t}
190
182
  </div>
191
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDateValue(),t=this.getDateStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatDateValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=new Date(this.value);if(isNaN(e.getTime()))return String(this.value);if(this.relativeTime)return this.formatRelativeTime(e);const t=this.column.dateFormat||{format:this.dateFormat,customFormat:this.customFormat,locale:this.locale};if(t.customFormat||this.customFormat)return this.formatCustomDate(e,t.customFormat||this.customFormat);const a={};switch(t.format??this.dateFormat){case"short":a.dateStyle="short";break;case"medium":a.dateStyle="medium";break;case"long":a.dateStyle="long";break;case"full":a.dateStyle="full"}this.showTime&&(a.timeStyle="short");const i=t.locale??this.locale;return new Intl.DateTimeFormat(i,a).format(e)}formatCustomDate(e,t){const a={YYYY:e.getFullYear().toString(),YY:e.getFullYear().toString().slice(-2),MM:(e.getMonth()+1).toString().padStart(2,"0"),M:(e.getMonth()+1).toString(),DD:e.getDate().toString().padStart(2,"0"),D:e.getDate().toString(),HH:e.getHours().toString().padStart(2,"0"),H:e.getHours().toString(),mm:e.getMinutes().toString().padStart(2,"0"),m:e.getMinutes().toString(),ss:e.getSeconds().toString().padStart(2,"0"),s:e.getSeconds().toString()};let i=t;for(const[e,t]of Object.entries(a))i=i.replace(new RegExp(e,"g"),t);return i}formatRelativeTime(e){const t=(new Date).getTime()-e.getTime(),a=Math.floor(t/1e3),i=Math.floor(a/60),s=Math.floor(i/60),n=Math.floor(s/24);return a<60?"Just now":i<60?`${i} minute${1===i?"":"s"} ago`:s<24?`${s} hour${1===s?"":"s"} ago`:n<7?`${n} day${1===n?"":"s"} ago`:new Intl.DateTimeFormat(this.locale,{dateStyle:"short"}).format(e)}getDateStyles(){const e=new Date(this.value),t=new Date,a=e.toDateString()===t.toDateString(),i=e<t,s=e>t;return this.classList.remove("date--today","date--past","date--future"),a?this.classList.add("date--today"):i?this.classList.add("date--past"):s&&this.classList.add("date--future"),""}constructor(){super(...arguments),this.align=(i(this,E),i(this,$,"left")),this.type=(i(this,D),i(this,A,"date")),this.value=(i(this,T),i(this,L,"")),this.column=(i(this,O),i(this,N,{key:"",label:"",type:"date",align:"left"})),this.rowData=(i(this,B),i(this,z,null)),this.contentElement=(i(this,M),i(this,V,void 0)),this.dateFormat=(i(this,j),i(this,F,"short")),this.customFormat=(i(this,I),i(this,q,void 0)),this.locale=(i(this,P),i(this,R,"en-US")),this.relativeTime=(i(this,H),i(this,Y,!1)),this.showTime=(i(this,W),i(this,U,!1)),i(this,K)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x=[t.element("snice-cell-boolean")],S=[],C=HTMLElement,E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[],B=[],z=[],M=[],V=[],j=[],F=[],I=[],q=[],P=[],R=[],H=[],Y=[],W=[],U=[],K=[];(class extends C{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.property({attribute:"true-value"})],p=[t.property({attribute:"false-value"})],m=[t.property({type:Boolean,attribute:"use-symbols"})],g=[t.property({attribute:"true-symbol"})],v=[t.property({attribute:"false-symbol"})],b=[t.render()],y=[t.styles()],f=[t.ready()],w=[t.watch("align")],k=[t.watch("value","column")],a(this,null,b,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,E),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,E),a(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,E),a(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,E),a(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,E),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},$,D),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},A,T),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},L,O),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},N,B),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},z,M),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},V,j),a(null,null,u,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:n},F,I),a(null,null,p,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:n},q,P),a(null,null,m,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:n},R,H),a(null,null,g,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:n},Y,W),a(null,null,v,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:n},U,K),a(null,e={value:s},x,{kind:"class",name:s.name,metadata:n},null,S),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,S)}render(){const e=this.formatBooleanContent();return t.html`
183
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatDateValue(),e=this.getDateStyles();this.contentElement.innerHTML=t,this.contentElement.setAttribute("style",e)}}formatDateValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=new Date(this.value);if(isNaN(t.getTime()))return String(this.value);if(this.relativeTime)return this.formatRelativeTime(t);const e=this.column.dateFormat||{format:this.dateFormat,customFormat:this.customFormat,locale:this.locale};if(e.customFormat||this.customFormat)return this.formatCustomDate(t,e.customFormat||this.customFormat);const a={};switch(e.format??this.dateFormat){case"short":a.dateStyle="short";break;case"medium":a.dateStyle="medium";break;case"long":a.dateStyle="long";break;case"full":a.dateStyle="full"}this.showTime&&(a.timeStyle="short");const i=e.locale??this.locale;return new Intl.DateTimeFormat(i,a).format(t)}formatCustomDate(t,e){const a={YYYY:t.getFullYear().toString(),YY:t.getFullYear().toString().slice(-2),MM:(t.getMonth()+1).toString().padStart(2,"0"),M:(t.getMonth()+1).toString(),DD:t.getDate().toString().padStart(2,"0"),D:t.getDate().toString(),HH:t.getHours().toString().padStart(2,"0"),H:t.getHours().toString(),mm:t.getMinutes().toString().padStart(2,"0"),m:t.getMinutes().toString(),ss:t.getSeconds().toString().padStart(2,"0"),s:t.getSeconds().toString()};let i=e;for(const[t,e]of Object.entries(a))i=i.replace(new RegExp(t,"g"),e);return i}formatRelativeTime(t){const e=(new Date).getTime()-t.getTime(),a=Math.floor(e/1e3),i=Math.floor(a/60),s=Math.floor(i/60),n=Math.floor(s/24);return a<60?"Just now":i<60?`${i} minute${1===i?"":"s"} ago`:s<24?`${s} hour${1===s?"":"s"} ago`:n<7?`${n} day${1===n?"":"s"} ago`:new Intl.DateTimeFormat(this.locale,{dateStyle:"short"}).format(t)}getDateStyles(){const t=new Date(this.value),e=new Date,a=t.toDateString()===e.toDateString(),i=t<e,s=t>e;return this.classList.remove("date--today","date--past","date--future"),a?this.classList.add("date--today"):i?this.classList.add("date--past"):s&&this.classList.add("date--future"),""}constructor(){super(...arguments),this.align=(i(this,$),i(this,D,"left")),this.type=(i(this,T),i(this,E,"date")),this.value=(i(this,A),i(this,j,"")),this.column=(i(this,F),i(this,L,{key:"",label:"",type:"date",align:"left"})),this.rowData=(i(this,z),i(this,O,null)),this.contentElement=(i(this,B),i(this,M,void 0)),this.dateFormat=(i(this,P),i(this,V,"short")),this.customFormat=(i(this,N),i(this,H,void 0)),this.locale=(i(this,I),i(this,R,"en-US")),this.relativeTime=(i(this,q),i(this,W,!1)),this.showTime=(i(this,Y),i(this,U,!1)),i(this,J)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x=[e.element("snice-cell-boolean")],S=[],C=HTMLElement,$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[];(class extends C{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({attribute:"true-value"})],p=[e.property({attribute:"false-value"})],m=[e.property({type:Boolean,attribute:"use-symbols"})],g=[e.property({attribute:"true-symbol"})],y=[e.property({attribute:"false-symbol"})],v=[e.render()],b=[e.styles()],f=[e.ready()],w=[e.watch("align")],k=[e.watch("value","column")],a(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,$),a(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,$),a(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,$),a(this,null,w,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,$),a(this,null,k,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,$),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},D,T),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},E,A),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},j,F),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},L,z),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},O,B),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},M,P),a(null,null,u,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:t=>"trueValue"in t,get:t=>t.trueValue,set:(t,e)=>{t.trueValue=e}},metadata:n},V,N),a(null,null,p,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:t=>"falseValue"in t,get:t=>t.falseValue,set:(t,e)=>{t.falseValue=e}},metadata:n},H,I),a(null,null,m,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:t=>"useSymbols"in t,get:t=>t.useSymbols,set:(t,e)=>{t.useSymbols=e}},metadata:n},R,q),a(null,null,g,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:t=>"trueSymbol"in t,get:t=>t.trueSymbol,set:(t,e)=>{t.trueSymbol=e}},metadata:n},W,Y),a(null,null,y,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:t=>"falseSymbol"in t,get:t=>t.falseSymbol,set:(t,e)=>{t.falseSymbol=e}},metadata:n},U,J),a(null,t={value:s},x,{kind:"class",name:s.name,metadata:n},null,S),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,S)}render(){const t=this.formatBooleanContent();return e.html`
192
184
  <div class="cell-content cell-content--boolean" part="content">
193
- ${t.unsafeHTML(e)}
185
+ ${e.unsafeHTML(t)}
194
186
  </div>
195
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatBooleanContent();this.contentElement.innerHTML=e}}formatBooleanContent(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.booleanFormat||{trueValue:this.trueValue,falseValue:this.falseValue,useSymbols:this.useSymbols,trueSymbol:this.trueSymbol,falseSymbol:this.falseSymbol},t=Boolean(this.value);if(e.useSymbols??this.useSymbols){return`<span class="${t?"boolean--true":"boolean--false"}">${t?e.trueSymbol??this.trueSymbol:e.falseSymbol??this.falseSymbol}</span>`}return`<span class="${t?"boolean--true":"boolean--false"}">${t?e.trueValue??this.trueValue:e.falseValue??this.falseValue}</span>`}constructor(){super(...arguments),this.align=(i(this,E),i(this,$,"center")),this.type=(i(this,D),i(this,A,"boolean")),this.value=(i(this,T),i(this,L,!1)),this.column=(i(this,O),i(this,N,{key:"",label:"",type:"boolean",align:"center"})),this.rowData=(i(this,B),i(this,z,null)),this.contentElement=(i(this,M),i(this,V,void 0)),this.trueValue=(i(this,j),i(this,F,"true")),this.falseValue=(i(this,I),i(this,q,"false")),this.useSymbols=(i(this,P),i(this,R,!0)),this.trueSymbol=(i(this,H),i(this,Y,"✓")),this.falseSymbol=(i(this,W),i(this,U,"✗")),i(this,K)}})})(),(()=>{let e,s,n,l,r,o,c,h,d,u=[t.element("snice-rating")],p=[],m=HTMLElement,g=[],v=[],b=[],y=[],f=[],w=[],k=[],x=[],S=[],C=[],E=[];(class extends m{static{s=this}static{const $="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;n=[t.property({type:Number})],l=[t.property({type:Number})],r=[t.property()],o=[t.property()],c=[t.property()],h=[t.render()],d=[t.styles()],a(this,null,h,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:$},null,g),a(this,null,d,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:$},null,g),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:$},v,b),a(null,null,l,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:$},y,f),a(null,null,r,{kind:"field",name:"symbol",static:!1,private:!1,access:{has:e=>"symbol"in e,get:e=>e.symbol,set:(e,t)=>{e.symbol=t}},metadata:$},w,k),a(null,null,o,{kind:"field",name:"emptySymbol",static:!1,private:!1,access:{has:e=>"emptySymbol"in e,get:e=>e.emptySymbol,set:(e,t)=>{e.emptySymbol=t}},metadata:$},x,S),a(null,null,c,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:$},C,E),a(null,e={value:s},u,{kind:"class",name:s.name,metadata:$},null,p),s=e.value,$&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:$}),i(s,p)}render(){const e=Math.round(this.value),a=this.max-e;return t.html`
196
- <span class="filled">${this.symbol.repeat(e)}</span><span class="empty">${this.emptySymbol.repeat(a)}</span>
197
- `}styles(){return t.css`
187
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatBooleanContent();this.contentElement.innerHTML=t}}formatBooleanContent(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=this.column.booleanFormat||{trueValue:this.trueValue,falseValue:this.falseValue,useSymbols:this.useSymbols,trueSymbol:this.trueSymbol,falseSymbol:this.falseSymbol},e=Boolean(this.value);if(t.useSymbols??this.useSymbols){return`<span class="${e?"boolean--true":"boolean--false"}">${e?t.trueSymbol??this.trueSymbol:t.falseSymbol??this.falseSymbol}</span>`}return`<span class="${e?"boolean--true":"boolean--false"}">${e?t.trueValue??this.trueValue:t.falseValue??this.falseValue}</span>`}constructor(){super(...arguments),this.align=(i(this,$),i(this,D,"center")),this.type=(i(this,T),i(this,E,"boolean")),this.value=(i(this,A),i(this,j,!1)),this.column=(i(this,F),i(this,L,{key:"",label:"",type:"boolean",align:"center"})),this.rowData=(i(this,z),i(this,O,null)),this.contentElement=(i(this,B),i(this,M,void 0)),this.trueValue=(i(this,P),i(this,V,"true")),this.falseValue=(i(this,N),i(this,H,"false")),this.useSymbols=(i(this,I),i(this,R,!0)),this.trueSymbol=(i(this,q),i(this,W,"✓")),this.falseSymbol=(i(this,Y),i(this,U,"✗")),i(this,J)}})})(),(()=>{let t,s,n,l,r,o,c,h,d,u=[e.element("snice-rating")],p=[],m=HTMLElement,g=[],y=[],v=[],b=[],f=[],w=[],k=[],x=[],S=[],C=[],$=[];(class extends m{static{s=this}static{const D="function"==typeof Symbol&&Symbol.metadata?Object.create(m[Symbol.metadata]??null):void 0;n=[e.property({type:Number})],l=[e.property({type:Number})],r=[e.property()],o=[e.property()],c=[e.property()],h=[e.render()],d=[e.styles()],a(this,null,h,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:D},null,g),a(this,null,d,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:D},null,g),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:D},y,v),a(null,null,l,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:D},b,f),a(null,null,r,{kind:"field",name:"symbol",static:!1,private:!1,access:{has:t=>"symbol"in t,get:t=>t.symbol,set:(t,e)=>{t.symbol=e}},metadata:D},w,k),a(null,null,o,{kind:"field",name:"emptySymbol",static:!1,private:!1,access:{has:t=>"emptySymbol"in t,get:t=>t.emptySymbol,set:(t,e)=>{t.emptySymbol=e}},metadata:D},x,S),a(null,null,c,{kind:"field",name:"color",static:!1,private:!1,access:{has:t=>"color"in t,get:t=>t.color,set:(t,e)=>{t.color=e}},metadata:D},C,$),a(null,t={value:s},u,{kind:"class",name:s.name,metadata:D},null,p),s=t.value,D&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:D}),i(s,p)}render(){const t=Math.round(this.value),a=this.max-t;return e.html`
188
+ <span class="filled">${this.symbol.repeat(t)}</span><span class="empty">${this.emptySymbol.repeat(a)}</span>
189
+ `}styles(){return e.css`
198
190
  :host {
199
191
  display: inline-block;
200
192
  font-size: 1.2em;
@@ -207,18 +199,18 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
207
199
  .empty {
208
200
  color: #d1d5db;
209
201
  }
210
- `}constructor(){super(...arguments),this.value=(i(this,g),i(this,v,0)),this.max=(i(this,b),i(this,y,5)),this.symbol=(i(this,f),i(this,w,"★")),this.emptySymbol=(i(this,k),i(this,x,"☆")),this.color=(i(this,S),i(this,C,"#facc15")),i(this,E)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b=[t.element("snice-cell-rating")],y=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],v=[t.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,w),a(this,null,v,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},E,$),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},D,A),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},T,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},O,N),a(null,e={value:s},b,{kind:"class",name:s.name,metadata:n},null,y),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,y)}render(){return t.html`
202
+ `}constructor(){super(...arguments),this.value=(i(this,g),i(this,y,0)),this.max=(i(this,v),i(this,b,5)),this.symbol=(i(this,f),i(this,w,"★")),this.emptySymbol=(i(this,k),i(this,x,"☆")),this.color=(i(this,S),i(this,C,"#facc15")),i(this,$)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell-rating")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("align")],y=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,w),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},$,D),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},T,E),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},A,j),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},F,L),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:n},null,b),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,b)}render(){return e.html`
211
203
  <div class="cell-content cell-content--rating" part="content">
212
204
  <!-- Rating component will be created here -->
213
205
  </div>
214
- `}styles(){return t.css`${n}`}init(){this.applyAlignment(),this.createRatingElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createRatingElement()}createRatingElement(){if(!this.contentElement)return;this.contentElement.innerHTML="";const e=document.createElement("snice-rating");e.value=Number(this.value)||0;const t=this.column.ratingFormat||{};e.max=t.max??5,e.symbol=t.symbol??"★",e.emptySymbol=t.emptySymbol??"☆",e.color=t.color??getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),this.contentElement.appendChild(e)}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"center")),this.type=(i(this,x),i(this,S,"rating")),this.value=(i(this,C),i(this,E,0)),this.column=(i(this,$),i(this,D,{key:"",label:"",type:"rating",align:"center"})),this.rowData=(i(this,A),i(this,T,null)),this.contentElement=(i(this,L),i(this,O,void 0)),i(this,N)}})})(),(()=>{let e,s,n,l,r,o,c,h,d,u,p=[t.element("snice-progress")],m=[],g=HTMLElement,v=[],b=[],y=[],f=[],w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[];(class extends g{static{s=this}static{const T="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[t.property({type:Number})],l=[t.property({type:Number})],r=[t.property()],o=[t.property()],c=[t.property()],h=[t.property({type:Boolean})],d=[t.render()],u=[t.styles()],a(this,null,d,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:T},null,v),a(this,null,u,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:T},null,v),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:T},b,y),a(null,null,l,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:T},f,w),a(null,null,r,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:T},k,x),a(null,null,o,{kind:"field",name:"backgroundColor",static:!1,private:!1,access:{has:e=>"backgroundColor"in e,get:e=>e.backgroundColor,set:(e,t)=>{e.backgroundColor=t}},metadata:T},S,C),a(null,null,c,{kind:"field",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height,set:(e,t)=>{e.height=t}},metadata:T},E,$),a(null,null,h,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:T},D,A),a(null,e={value:s},p,{kind:"class",name:s.name,metadata:T},null,m),s=e.value,T&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:T}),i(s,m)}render(){const e=Math.min(100,this.value/this.max*100);return t.html`
206
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment(),this.createRatingElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createRatingElement()}createRatingElement(){if(!this.contentElement)return;this.contentElement.innerHTML="";const t=document.createElement("snice-rating");t.value=Number(this.value)||0;const e=this.column.ratingFormat||{};t.max=e.max??5,t.symbol=e.symbol??"★",t.emptySymbol=e.emptySymbol??"☆",t.color=e.color??getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),this.contentElement.appendChild(t)}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"center")),this.type=(i(this,x),i(this,S,"rating")),this.value=(i(this,C),i(this,$,0)),this.column=(i(this,D),i(this,T,{key:"",label:"",type:"rating",align:"center"})),this.rowData=(i(this,E),i(this,A,null)),this.contentElement=(i(this,j),i(this,F,void 0)),i(this,L)}})})(),(()=>{let t,s,n,l,r,o,c,h,d,u,p=[e.element("snice-progress")],m=[],g=HTMLElement,y=[],v=[],b=[],f=[],w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[];(class extends g{static{s=this}static{const A="function"==typeof Symbol&&Symbol.metadata?Object.create(g[Symbol.metadata]??null):void 0;n=[e.property({type:Number})],l=[e.property({type:Number})],r=[e.property()],o=[e.property()],c=[e.property()],h=[e.property({type:Boolean})],d=[e.render()],u=[e.styles()],a(this,null,d,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:A},null,y),a(this,null,u,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:A},null,y),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:A},v,b),a(null,null,l,{kind:"field",name:"max",static:!1,private:!1,access:{has:t=>"max"in t,get:t=>t.max,set:(t,e)=>{t.max=e}},metadata:A},f,w),a(null,null,r,{kind:"field",name:"color",static:!1,private:!1,access:{has:t=>"color"in t,get:t=>t.color,set:(t,e)=>{t.color=e}},metadata:A},k,x),a(null,null,o,{kind:"field",name:"backgroundColor",static:!1,private:!1,access:{has:t=>"backgroundColor"in t,get:t=>t.backgroundColor,set:(t,e)=>{t.backgroundColor=e}},metadata:A},S,C),a(null,null,c,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:A},$,D),a(null,null,h,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:t=>"showPercentage"in t,get:t=>t.showPercentage,set:(t,e)=>{t.showPercentage=e}},metadata:A},T,E),a(null,t={value:s},p,{kind:"class",name:s.name,metadata:A},null,m),s=t.value,A&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:A}),i(s,m)}render(){const t=Math.min(100,this.value/this.max*100);return e.html`
215
207
  <div class="progress-container">
216
- <div class="progress-bar" style="width: ${e}%"></div>
208
+ <div class="progress-bar" style="width: ${t}%"></div>
217
209
  </div>
218
210
  <if ${this.showPercentage}>
219
- <span class="percentage">${e.toFixed(0)}%</span>
211
+ <span class="percentage">${t.toFixed(0)}%</span>
220
212
  </if>
221
- `}styles(){return t.css`
213
+ `}styles(){return e.css`
222
214
  :host {
223
215
  display: inline-flex;
224
216
  align-items: center;
@@ -245,23 +237,171 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
245
237
  color: #6b7280;
246
238
  min-width: 2.1875rem; /* 35px */
247
239
  }
248
- `}constructor(){super(...arguments),this.value=(i(this,v),i(this,b,0)),this.max=(i(this,y),i(this,f,100)),this.color=(i(this,w),i(this,k,"#3b82f6")),this.backgroundColor=(i(this,x),i(this,S,"#e5e7eb")),this.height=(i(this,C),i(this,E,"0.5rem")),this.showPercentage=(i(this,$),i(this,D,!1)),i(this,A)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b=[t.element("snice-cell-progress")],y=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],v=[t.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,w),a(this,null,v,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},E,$),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},D,A),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},T,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},O,N),a(null,e={value:s},b,{kind:"class",name:s.name,metadata:n},null,y),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,y)}render(){return t.html`
240
+ `}constructor(){super(...arguments),this.value=(i(this,y),i(this,v,0)),this.max=(i(this,b),i(this,f,100)),this.color=(i(this,w),i(this,k,"#3b82f6")),this.backgroundColor=(i(this,x),i(this,S,"#e5e7eb")),this.height=(i(this,C),i(this,$,"0.5rem")),this.showPercentage=(i(this,D),i(this,T,!1)),i(this,E)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell-progress")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("align")],y=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,w),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},$,D),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},T,E),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},A,j),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},F,L),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:n},null,b),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,b)}render(){return e.html`
249
241
  <div class="cell-content cell-content--progress" part="content">
250
242
  <!-- Progress component will be created here -->
251
243
  </div>
252
- `}styles(){return t.css`${n}`}init(){this.applyAlignment(),this.createProgressElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createProgressElement()}createProgressElement(){if(!this.contentElement)return;this.contentElement.innerHTML="";const e=document.createElement("snice-progress");e.value=Number(this.value)||0;const t=this.column.progressFormat||{};e.max=t.max??100,e.color=t.color??getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),e.backgroundColor=t.backgroundColor??getComputedStyle(this).getPropertyValue("--snice-color-border").trim(),e.height=t.height??"0.5rem",e.showPercentage=t.showPercentage??!1,this.contentElement.appendChild(e)}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"left")),this.type=(i(this,x),i(this,S,"progress")),this.value=(i(this,C),i(this,E,0)),this.column=(i(this,$),i(this,D,{key:"",label:"",type:"progress",align:"left"})),this.rowData=(i(this,A),i(this,T,null)),this.contentElement=(i(this,L),i(this,O,void 0)),i(this,N)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b=[t.element("snice-cell-duration")],y=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],v=[t.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,w),a(this,null,v,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},E,$),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},D,A),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},T,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},O,N),a(null,e={value:s},b,{kind:"class",name:s.name,metadata:n},null,y),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,y)}render(){const e=this.formatDuration();return t.html`
244
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment(),this.createProgressElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createProgressElement()}createProgressElement(){if(!this.contentElement)return;this.contentElement.innerHTML="";const t=document.createElement("snice-progress");t.value=Number(this.value)||0;const e=this.column.progressFormat||{};t.max=e.max??100,t.color=e.color??getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),t.backgroundColor=e.backgroundColor??getComputedStyle(this).getPropertyValue("--snice-color-border").trim(),t.height=e.height??"0.5rem",t.showPercentage=e.showPercentage??!1,this.contentElement.appendChild(t)}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"left")),this.type=(i(this,x),i(this,S,"progress")),this.value=(i(this,C),i(this,$,0)),this.column=(i(this,D),i(this,T,{key:"",label:"",type:"progress",align:"left"})),this.rowData=(i(this,E),i(this,A,null)),this.contentElement=(i(this,j),i(this,F,void 0)),i(this,L)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell-duration")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("align")],y=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,w),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},$,D),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},T,E),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},A,j),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},F,L),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:n},null,b),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,b)}render(){const t=this.formatDuration();return e.html`
253
245
  <div class="cell-content cell-content--duration" part="content">
254
- ${e}
246
+ ${t}
255
247
  </div>
256
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDuration();this.contentElement.innerHTML=e}}formatDuration(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=Math.floor(e/3600),a=Math.floor(e%3600/60),i=Math.floor(e%60);return t>0?`${t}h ${a}m ${i}s`:a>0?`${a}m ${i}s`:`${i}s`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"right")),this.type=(i(this,x),i(this,S,"duration")),this.value=(i(this,C),i(this,E,0)),this.column=(i(this,$),i(this,D,{key:"",label:"",type:"duration",align:"right"})),this.rowData=(i(this,A),i(this,T,null)),this.contentElement=(i(this,L),i(this,O,void 0)),i(this,N)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b=[t.element("snice-cell-filesize")],y=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],E=[],$=[],D=[],A=[],T=[],L=[],O=[],N=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.render()],p=[t.styles()],m=[t.ready()],g=[t.watch("align")],v=[t.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,w),a(this,null,v,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},E,$),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},D,A),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},T,L),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},O,N),a(null,e={value:s},b,{kind:"class",name:s.name,metadata:n},null,y),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,y)}render(){const e=this.formatFileSize();return t.html`
248
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatDuration();this.contentElement.innerHTML=t}}formatDuration(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=Number(this.value);if(isNaN(t))return String(this.value);const e=Math.floor(t/3600),a=Math.floor(t%3600/60),i=Math.floor(t%60);return e>0?`${e}h ${a}m ${i}s`:a>0?`${a}m ${i}s`:`${i}s`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"right")),this.type=(i(this,x),i(this,S,"duration")),this.value=(i(this,C),i(this,$,0)),this.column=(i(this,D),i(this,T,{key:"",label:"",type:"duration",align:"right"})),this.rowData=(i(this,E),i(this,A,null)),this.contentElement=(i(this,j),i(this,F,void 0)),i(this,L)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell-filesize")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[];(class extends f{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("align")],y=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,w),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,w),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,w),a(this,null,g,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,w),a(this,null,y,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,w),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},k,x),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},S,C),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},$,D),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},T,E),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},A,j),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},F,L),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:n},null,b),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,b)}render(){const t=this.formatFileSize();return e.html`
257
249
  <div class="cell-content cell-content--filesize" part="content">
258
- ${e}
250
+ ${t}
259
251
  </div>
260
- `}styles(){return t.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatFileSize();this.contentElement.innerHTML=e}}formatFileSize(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let a=e,i=0;for(;a>=1024&&i<t.length-1;)a/=1024,i++;return`${a.toFixed(1)} ${t[i]}`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"right")),this.type=(i(this,x),i(this,S,"filesize")),this.value=(i(this,C),i(this,E,0)),this.column=(i(this,$),i(this,D,{key:"",label:"",type:"filesize",align:"right"})),this.rowData=(i(this,A),i(this,T,null)),this.contentElement=(i(this,L),i(this,O,void 0)),i(this,N)}})})(),(()=>{let e,s,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x,S,C,E,$,D,A=[t.element("snice-cell-sparkline")],T=[],L=HTMLElement,O=[],N=[],B=[],z=[],M=[],V=[],j=[],F=[],I=[],q=[],P=[],R=[],H=[],Y=[],W=[],U=[],K=[],G=[],J=[],X=[],Z=[],Q=[],_=[],ee=[],te=[],ae=[],ie=[],se=[],ne=[],le=[],re=[],oe=[],ce=[];(class extends L{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(L[Symbol.metadata]??null):void 0;l=[t.property({})],r=[t.property({})],o=[t.property({})],c=[t.property({type:Object})],h=[t.property({type:Object})],d=[t.query(".cell-content")],u=[t.property({attribute:"chart-type"})],p=[t.property({})],m=[t.property({type:Number})],g=[t.property({type:Number})],v=[t.property({type:Boolean,attribute:"show-dots"})],b=[t.property({type:Boolean,attribute:"show-baseline"})],y=[t.property({type:Number,attribute:"stroke-width"})],f=[t.property({type:Number,attribute:"min-value"})],w=[t.property({type:Number,attribute:"max-value"})],k=[t.property({type:t.SimpleArray})],x=[t.render()],S=[t.styles()],C=[t.ready()],E=[t.watch("align")],$=[t.watch("value","data","column")],D=[t.watch("value","data","chartType","color","width","height","showDots","showBaseline","strokeWidth","minValue","maxValue")],a(this,null,x,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:n},null,O),a(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:n},null,O),a(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:n},null,O),a(this,null,E,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:n},null,O),a(this,null,$,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:n},null,O),a(this,null,D,{kind:"method",name:"updateSparkline",static:!1,private:!1,access:{has:e=>"updateSparkline"in e,get:e=>e.updateSparkline},metadata:n},null,O),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:n},N,B),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:n},z,M),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:n},V,j),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:n},F,I),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:n},q,P),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:n},R,H),a(null,null,u,{kind:"field",name:"chartType",static:!1,private:!1,access:{has:e=>"chartType"in e,get:e=>e.chartType,set:(e,t)=>{e.chartType=t}},metadata:n},Y,W),a(null,null,p,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:n},U,K),a(null,null,m,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:n},G,J),a(null,null,g,{kind:"field",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height,set:(e,t)=>{e.height=t}},metadata:n},X,Z),a(null,null,v,{kind:"field",name:"showDots",static:!1,private:!1,access:{has:e=>"showDots"in e,get:e=>e.showDots,set:(e,t)=>{e.showDots=t}},metadata:n},Q,_),a(null,null,b,{kind:"field",name:"showBaseline",static:!1,private:!1,access:{has:e=>"showBaseline"in e,get:e=>e.showBaseline,set:(e,t)=>{e.showBaseline=t}},metadata:n},ee,te),a(null,null,y,{kind:"field",name:"strokeWidth",static:!1,private:!1,access:{has:e=>"strokeWidth"in e,get:e=>e.strokeWidth,set:(e,t)=>{e.strokeWidth=t}},metadata:n},ae,ie),a(null,null,f,{kind:"field",name:"minValue",static:!1,private:!1,access:{has:e=>"minValue"in e,get:e=>e.minValue,set:(e,t)=>{e.minValue=t}},metadata:n},se,ne),a(null,null,w,{kind:"field",name:"maxValue",static:!1,private:!1,access:{has:e=>"maxValue"in e,get:e=>e.maxValue,set:(e,t)=>{e.maxValue=t}},metadata:n},le,re),a(null,null,k,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:n},oe,ce),a(null,e={value:s},A,{kind:"class",name:s.name,metadata:n},null,T),s=e.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,T)}render(){return t.html`
252
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatFileSize();this.contentElement.innerHTML=t}}formatFileSize(){if(null===this.value||void 0===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=Number(this.value);if(isNaN(t))return String(this.value);const e=["B","KB","MB","GB","TB"];let a=t,i=0;for(;a>=1024&&i<e.length-1;)a/=1024,i++;return`${a.toFixed(1)} ${e[i]}`}constructor(){super(...arguments),this.align=(i(this,w),i(this,k,"right")),this.type=(i(this,x),i(this,S,"filesize")),this.value=(i(this,C),i(this,$,0)),this.column=(i(this,D),i(this,T,{key:"",label:"",type:"filesize",align:"right"})),this.rowData=(i(this,E),i(this,A,null)),this.contentElement=(i(this,j),i(this,F,void 0)),i(this,L)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C,$,D,T,E=[e.element("snice-cell-sparkline")],A=[],j=HTMLElement,F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[],K=[],G=[],_=[],X=[],Z=[],Q=[],tt=[],et=[],at=[],it=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[];(class extends j{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(j[Symbol.metadata]??null):void 0;l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({attribute:"chart-type"})],p=[e.property({})],m=[e.property({type:Number})],g=[e.property({type:Number})],y=[e.property({type:Boolean,attribute:"show-dots"})],v=[e.property({type:Boolean,attribute:"show-baseline"})],b=[e.property({type:Number,attribute:"stroke-width"})],f=[e.property({type:Number,attribute:"min-value"})],w=[e.property({type:Number,attribute:"max-value"})],k=[e.property({type:e.SimpleArray})],x=[e.render()],S=[e.styles()],C=[e.ready()],$=[e.watch("align")],D=[e.watch("value","data","column")],T=[e.watch("value","data","chartType","color","width","height","showDots","showBaseline","strokeWidth","minValue","maxValue")],a(this,null,x,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,F),a(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,F),a(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,F),a(this,null,$,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,F),a(this,null,D,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,F),a(this,null,T,{kind:"method",name:"updateSparkline",static:!1,private:!1,access:{has:t=>"updateSparkline"in t,get:t=>t.updateSparkline},metadata:n},null,F),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},L,z),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},O,B),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},M,P),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},V,N),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},H,I),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},R,q),a(null,null,u,{kind:"field",name:"chartType",static:!1,private:!1,access:{has:t=>"chartType"in t,get:t=>t.chartType,set:(t,e)=>{t.chartType=e}},metadata:n},W,Y),a(null,null,p,{kind:"field",name:"color",static:!1,private:!1,access:{has:t=>"color"in t,get:t=>t.color,set:(t,e)=>{t.color=e}},metadata:n},U,J),a(null,null,m,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:n},K,G),a(null,null,g,{kind:"field",name:"height",static:!1,private:!1,access:{has:t=>"height"in t,get:t=>t.height,set:(t,e)=>{t.height=e}},metadata:n},_,X),a(null,null,y,{kind:"field",name:"showDots",static:!1,private:!1,access:{has:t=>"showDots"in t,get:t=>t.showDots,set:(t,e)=>{t.showDots=e}},metadata:n},Z,Q),a(null,null,v,{kind:"field",name:"showBaseline",static:!1,private:!1,access:{has:t=>"showBaseline"in t,get:t=>t.showBaseline,set:(t,e)=>{t.showBaseline=e}},metadata:n},tt,et),a(null,null,b,{kind:"field",name:"strokeWidth",static:!1,private:!1,access:{has:t=>"strokeWidth"in t,get:t=>t.strokeWidth,set:(t,e)=>{t.strokeWidth=e}},metadata:n},at,it),a(null,null,f,{kind:"field",name:"minValue",static:!1,private:!1,access:{has:t=>"minValue"in t,get:t=>t.minValue,set:(t,e)=>{t.minValue=e}},metadata:n},st,nt),a(null,null,w,{kind:"field",name:"maxValue",static:!1,private:!1,access:{has:t=>"maxValue"in t,get:t=>t.maxValue,set:(t,e)=>{t.maxValue=e}},metadata:n},lt,rt),a(null,null,k,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:n},ot,ct),a(null,t={value:s},E,{kind:"class",name:s.name,metadata:n},null,A),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,A)}render(){return e.html`
261
253
  <div class="cell-content cell-content--sparkline" part="content">
262
- ${t.unsafeHTML(this.renderSparkline())}
254
+ ${e.unsafeHTML(this.renderSparkline())}
255
+ </div>
256
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment(),this.updateSparkline()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}updateSparkline(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}renderSparkline(){if(!(null!==this.value&&void 0!==this.value||this.data&&0!==this.data.length))return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=this.parseData();if(0===t.length)return`<span style="color: ${getComputedStyle(this).getPropertyValue("--snice-color-text-secondary").trim()}; font-style: italic;">No data</span>`;const e=this.column.sparklineFormat||{type:this.chartType,color:this.color,width:this.width,height:this.height},a=e.width??this.width,i=e.height??this.height,s=e.color??this.color,n=e.type??this.chartType;return this.createCanvas(t,a,i,s,n)}parseData(){if(this.data&&Array.isArray(this.data)&&this.data.length>0)return this.data.map(t=>Number(t)).filter(t=>!isNaN(t));if(Array.isArray(this.value))return this.value.map(t=>Number(t)).filter(t=>!isNaN(t));if("string"==typeof this.value){if(this.value.startsWith("[")&&this.value.endsWith("]"))try{const t=JSON.parse(this.value);if(Array.isArray(t))return t.map(t=>Number(t)).filter(t=>!isNaN(t))}catch{}try{return this.value.split(",").map(t=>Number(t.trim())).filter(t=>!isNaN(t))}catch{return[]}}return[]}createCanvas(t,e,a,i,s){if(0===t.length)return"";const n=document.createElement("canvas");n.width=e,n.height=a;const l=n.getContext("2d");if(!l)return'<div style="color: red;">Canvas not supported</div>';const r=e-4,o=a-4,c=this.minValue??Math.min(...t),h=(this.maxValue??Math.max(...t))-c||1;l.clearRect(0,0,e,a);let d=i;if(i.startsWith("var(")){const t=i.match(/var\(([^)]+)\)/);t&&(d=getComputedStyle(this).getPropertyValue(t[1].split(",")[0].trim()).trim()||"#3b82f6")}if(l.strokeStyle=d,l.fillStyle=d,l.lineWidth=this.strokeWidth,l.lineCap="round",l.lineJoin="round","line"===s||"area"===s){const e=t.map((e,a)=>[2+a/(t.length-1)*r,2+o-(e-c)/h*o]);"area"===s&&(l.beginPath(),l.moveTo(e[0][0],e[0][1]),e.forEach(([t,e])=>l.lineTo(t,e)),l.lineTo(e[e.length-1][0],a-2),l.lineTo(e[0][0],a-2),l.closePath(),l.globalAlpha=.3,l.fill(),l.globalAlpha=1),l.beginPath(),l.moveTo(e[0][0],e[0][1]),e.forEach(([t,e])=>l.lineTo(t,e)),l.stroke(),this.showDots&&e.forEach(([t,e])=>{l.beginPath(),l.arc(t,e,1.5,0,2*Math.PI),l.fill()})}else if("bar"===s){const e=r/t.length*.8,a=r/t.length*.2;t.forEach((t,i)=>{const s=(t-c)/h*o,n=2+i*(e+a),r=2+o-s;l.fillRect(n,r,e,s)})}try{return`<img src="${n.toDataURL("image/png")}" width="${e}" height="${a}" alt="Sparkline chart" style="display: block; vertical-align: middle;">`}catch(t){return console.error("Error creating canvas image:",t),'<div style="color: red;">Canvas error</div>'}}constructor(){super(...arguments),this.align=(i(this,F),i(this,L,"left")),this.type=(i(this,z),i(this,O,"sparkline")),this.value=(i(this,B),i(this,M,"")),this.column=(i(this,P),i(this,V,{key:"",label:"",type:"sparkline",align:"left"})),this.rowData=(i(this,N),i(this,H,null)),this.contentElement=(i(this,I),i(this,R,void 0)),this.chartType=(i(this,q),i(this,W,"line")),this.color=(i(this,Y),i(this,U,"var(--snice-color-primary)")),this.width=(i(this,J),i(this,K,80)),this.height=(i(this,G),i(this,_,24)),this.showDots=(i(this,X),i(this,Z,!1)),this.showBaseline=(i(this,Q),i(this,tt,!1)),this.strokeWidth=(i(this,et),i(this,at,1.5)),this.minValue=(i(this,it),i(this,st,void 0)),this.maxValue=(i(this,nt),i(this,lt,void 0)),this.data=(i(this,rt),i(this,ot,[])),i(this,ct)}})})(),(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C,$,D,T,E,A,j,F,L,z,O,B,M,P,V,N,H,I,R,q,W,Y,U,J,K,G,_,X,Z,Q,tt,et,at=[e.element("snice-column")],it=[],st=HTMLElement,nt=[],lt=[],rt=[],ot=[],ct=[],ht=[],dt=[],ut=[],pt=[],mt=[],gt=[],yt=[],vt=[],bt=[],ft=[],wt=[],kt=[],xt=[],St=[],Ct=[],$t=[],Dt=[],Tt=[],Et=[],At=[],jt=[],Ft=[],Lt=[],zt=[],Ot=[],Bt=[],Mt=[],Pt=[],Vt=[],Nt=[],Ht=[],It=[],Rt=[],qt=[],Wt=[],Yt=[],Ut=[],Jt=[],Kt=[],Gt=[],_t=[],Xt=[],Zt=[],Qt=[],te=[],ee=[],ae=[],ie=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],he=[],de=[],ue=[],pe=[],me=[],ge=[],ye=[],ve=[],be=[],fe=[],we=[],ke=[],xe=[],Se=[],Ce=[],$e=[],De=[],Te=[],Ee=[],Ae=[],je=[],Fe=[],Le=[],ze=[],Oe=[],Be=[];(class extends st{static{s=this}constructor(){super(...arguments),this.key=(i(this,nt),i(this,lt,"")),this.label=(i(this,rt),i(this,ot,"")),this.type=(i(this,ct),i(this,ht,"text")),this.align=(i(this,dt),i(this,ut,"left")),this.width=(i(this,pt),i(this,mt,"")),this.sortable=(i(this,gt),i(this,yt,!0)),this.filterable=(i(this,vt),i(this,bt,!0)),this.wrap=(i(this,ft),i(this,wt,!1)),this.ellipsis=(i(this,kt),i(this,xt,!0)),this.tooltip=(i(this,St),i(this,Ct,!1)),this.decimals=(i(this,$t),i(this,Dt,void 0)),this.thousandsSeparator=(i(this,Tt),i(this,Et,void 0)),this.numberPrefix=(i(this,At),i(this,jt,void 0)),this.numberSuffix=(i(this,Ft),i(this,Lt,void 0)),this.negativeStyle=(i(this,zt),i(this,Ot,void 0)),this.dateFormat=(i(this,Bt),i(this,Mt,void 0)),this.customDateFormat=(i(this,Pt),i(this,Vt,void 0)),this.dateLocale=(i(this,Nt),i(this,Ht,void 0)),this.trueValue=(i(this,It),i(this,Rt,void 0)),this.falseValue=(i(this,qt),i(this,Wt,void 0)),this.useSymbols=(i(this,Yt),i(this,Ut,void 0)),this.trueSymbol=(i(this,Jt),i(this,Kt,void 0)),this.falseSymbol=(i(this,Gt),i(this,_t,void 0)),this.ratingMax=(i(this,Xt),i(this,Zt,void 0)),this.ratingSymbol=(i(this,Qt),i(this,te,void 0)),this.ratingEmptySymbol=(i(this,ee),i(this,ae,void 0)),this.ratingColor=(i(this,ie),i(this,se,void 0)),this.progressMax=(i(this,ne),i(this,le,void 0)),this.showPercentage=(i(this,re),i(this,oe,void 0)),this.progressColor=(i(this,ce),i(this,he,void 0)),this.progressBgColor=(i(this,de),i(this,ue,void 0)),this.progressHeight=(i(this,pe),i(this,me,void 0)),this.sparklineType=(i(this,ge),i(this,ye,void 0)),this.sparklineColor=(i(this,ve),i(this,be,void 0)),this.sparklineWidth=(i(this,fe),i(this,we,void 0)),this.sparklineHeight=(i(this,ke),i(this,xe,void 0)),this.cellBgColor=(i(this,Se),i(this,Ce,void 0)),this.cellColor=(i(this,$e),i(this,De,void 0)),this.cellFontWeight=(i(this,Te),i(this,Ee,void 0)),this.cellFontStyle=(i(this,Ae),i(this,je,void 0)),this.cellFontSize=(i(this,Fe),i(this,Le,void 0)),this.cellTextDecoration=(i(this,ze),i(this,Oe,void 0)),this.formatter=i(this,Be),this.conditionalFormats=[]}static{const Me="function"==typeof Symbol&&Symbol.metadata?Object.create(st[Symbol.metadata]??null):void 0;n=[e.property({})],l=[e.property({})],r=[e.property({})],o=[e.property({})],c=[e.property({})],h=[e.property({type:Boolean})],d=[e.property({type:Boolean})],u=[e.property({type:Boolean})],p=[e.property({type:Boolean})],m=[e.property({type:Boolean})],g=[e.property({type:Number,attribute:"decimals"})],y=[e.property({type:Boolean,attribute:"thousands-separator"})],v=[e.property({attribute:"number-prefix"})],b=[e.property({attribute:"number-suffix"})],f=[e.property({attribute:"negative-style"})],w=[e.property({attribute:"date-format"})],k=[e.property({attribute:"custom-date-format"})],x=[e.property({attribute:"date-locale"})],S=[e.property({attribute:"true-value"})],C=[e.property({attribute:"false-value"})],$=[e.property({type:Boolean,attribute:"use-symbols"})],D=[e.property({attribute:"true-symbol"})],T=[e.property({attribute:"false-symbol"})],E=[e.property({type:Number,attribute:"rating-max"})],A=[e.property({attribute:"rating-symbol"})],j=[e.property({attribute:"rating-empty-symbol"})],F=[e.property({attribute:"rating-color"})],L=[e.property({type:Number,attribute:"progress-max"})],z=[e.property({type:Boolean,attribute:"show-percentage"})],O=[e.property({attribute:"progress-color"})],B=[e.property({attribute:"progress-bg-color"})],M=[e.property({attribute:"progress-height"})],P=[e.property({attribute:"sparkline-type"})],V=[e.property({attribute:"sparkline-color"})],N=[e.property({type:Number,attribute:"sparkline-width"})],H=[e.property({type:Number,attribute:"sparkline-height"})],I=[e.property({attribute:"cell-bg-color"})],R=[e.property({attribute:"cell-color"})],q=[e.property({attribute:"cell-font-weight"})],W=[e.property({attribute:"cell-font-style"})],Y=[e.property({attribute:"cell-font-size"})],U=[e.property({attribute:"cell-text-decoration"})],J=[e.render()],K=[e.watch("key","label","type","align","width","sortable","filterable","wrap","ellipsis","tooltip")],G=[e.watch("decimals","thousandsSeparator","numberPrefix","numberSuffix","negativeStyle")],_=[e.watch("dateFormat","customDateFormat","dateLocale")],X=[e.watch("trueValue","falseValue","useSymbols","trueSymbol","falseSymbol")],Z=[e.watch("ratingMax","ratingSymbol","ratingEmptySymbol","ratingColor")],Q=[e.watch("progressMax","showPercentage","progressColor","progressBgColor","progressHeight")],tt=[e.watch("sparklineType","sparklineColor","sparklineWidth","sparklineHeight")],et=[e.watch("cellBgColor","cellColor","cellFontWeight","cellFontStyle","cellFontSize","cellTextDecoration")],a(this,null,J,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:Me},null,nt),a(this,null,K,{kind:"method",name:"handleBasicPropsChange",static:!1,private:!1,access:{has:t=>"handleBasicPropsChange"in t,get:t=>t.handleBasicPropsChange},metadata:Me},null,nt),a(this,null,G,{kind:"method",name:"handleNumberFormatChange",static:!1,private:!1,access:{has:t=>"handleNumberFormatChange"in t,get:t=>t.handleNumberFormatChange},metadata:Me},null,nt),a(this,null,_,{kind:"method",name:"handleDateFormatChange",static:!1,private:!1,access:{has:t=>"handleDateFormatChange"in t,get:t=>t.handleDateFormatChange},metadata:Me},null,nt),a(this,null,X,{kind:"method",name:"handleBooleanFormatChange",static:!1,private:!1,access:{has:t=>"handleBooleanFormatChange"in t,get:t=>t.handleBooleanFormatChange},metadata:Me},null,nt),a(this,null,Z,{kind:"method",name:"handleRatingFormatChange",static:!1,private:!1,access:{has:t=>"handleRatingFormatChange"in t,get:t=>t.handleRatingFormatChange},metadata:Me},null,nt),a(this,null,Q,{kind:"method",name:"handleProgressFormatChange",static:!1,private:!1,access:{has:t=>"handleProgressFormatChange"in t,get:t=>t.handleProgressFormatChange},metadata:Me},null,nt),a(this,null,tt,{kind:"method",name:"handleSparklineFormatChange",static:!1,private:!1,access:{has:t=>"handleSparklineFormatChange"in t,get:t=>t.handleSparklineFormatChange},metadata:Me},null,nt),a(this,null,et,{kind:"method",name:"handleStyleChange",static:!1,private:!1,access:{has:t=>"handleStyleChange"in t,get:t=>t.handleStyleChange},metadata:Me},null,nt),a(null,null,n,{kind:"field",name:"key",static:!1,private:!1,access:{has:t=>"key"in t,get:t=>t.key,set:(t,e)=>{t.key=e}},metadata:Me},lt,rt),a(null,null,l,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:Me},ot,ct),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:Me},ht,dt),a(null,null,o,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:Me},ut,pt),a(null,null,c,{kind:"field",name:"width",static:!1,private:!1,access:{has:t=>"width"in t,get:t=>t.width,set:(t,e)=>{t.width=e}},metadata:Me},mt,gt),a(null,null,h,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:t=>"sortable"in t,get:t=>t.sortable,set:(t,e)=>{t.sortable=e}},metadata:Me},yt,vt),a(null,null,d,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:t=>"filterable"in t,get:t=>t.filterable,set:(t,e)=>{t.filterable=e}},metadata:Me},bt,ft),a(null,null,u,{kind:"field",name:"wrap",static:!1,private:!1,access:{has:t=>"wrap"in t,get:t=>t.wrap,set:(t,e)=>{t.wrap=e}},metadata:Me},wt,kt),a(null,null,p,{kind:"field",name:"ellipsis",static:!1,private:!1,access:{has:t=>"ellipsis"in t,get:t=>t.ellipsis,set:(t,e)=>{t.ellipsis=e}},metadata:Me},xt,St),a(null,null,m,{kind:"field",name:"tooltip",static:!1,private:!1,access:{has:t=>"tooltip"in t,get:t=>t.tooltip,set:(t,e)=>{t.tooltip=e}},metadata:Me},Ct,$t),a(null,null,g,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:t=>"decimals"in t,get:t=>t.decimals,set:(t,e)=>{t.decimals=e}},metadata:Me},Dt,Tt),a(null,null,y,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:t=>"thousandsSeparator"in t,get:t=>t.thousandsSeparator,set:(t,e)=>{t.thousandsSeparator=e}},metadata:Me},Et,At),a(null,null,v,{kind:"field",name:"numberPrefix",static:!1,private:!1,access:{has:t=>"numberPrefix"in t,get:t=>t.numberPrefix,set:(t,e)=>{t.numberPrefix=e}},metadata:Me},jt,Ft),a(null,null,b,{kind:"field",name:"numberSuffix",static:!1,private:!1,access:{has:t=>"numberSuffix"in t,get:t=>t.numberSuffix,set:(t,e)=>{t.numberSuffix=e}},metadata:Me},Lt,zt),a(null,null,f,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:t=>"negativeStyle"in t,get:t=>t.negativeStyle,set:(t,e)=>{t.negativeStyle=e}},metadata:Me},Ot,Bt),a(null,null,w,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:t=>"dateFormat"in t,get:t=>t.dateFormat,set:(t,e)=>{t.dateFormat=e}},metadata:Me},Mt,Pt),a(null,null,k,{kind:"field",name:"customDateFormat",static:!1,private:!1,access:{has:t=>"customDateFormat"in t,get:t=>t.customDateFormat,set:(t,e)=>{t.customDateFormat=e}},metadata:Me},Vt,Nt),a(null,null,x,{kind:"field",name:"dateLocale",static:!1,private:!1,access:{has:t=>"dateLocale"in t,get:t=>t.dateLocale,set:(t,e)=>{t.dateLocale=e}},metadata:Me},Ht,It),a(null,null,S,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:t=>"trueValue"in t,get:t=>t.trueValue,set:(t,e)=>{t.trueValue=e}},metadata:Me},Rt,qt),a(null,null,C,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:t=>"falseValue"in t,get:t=>t.falseValue,set:(t,e)=>{t.falseValue=e}},metadata:Me},Wt,Yt),a(null,null,$,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:t=>"useSymbols"in t,get:t=>t.useSymbols,set:(t,e)=>{t.useSymbols=e}},metadata:Me},Ut,Jt),a(null,null,D,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:t=>"trueSymbol"in t,get:t=>t.trueSymbol,set:(t,e)=>{t.trueSymbol=e}},metadata:Me},Kt,Gt),a(null,null,T,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:t=>"falseSymbol"in t,get:t=>t.falseSymbol,set:(t,e)=>{t.falseSymbol=e}},metadata:Me},_t,Xt),a(null,null,E,{kind:"field",name:"ratingMax",static:!1,private:!1,access:{has:t=>"ratingMax"in t,get:t=>t.ratingMax,set:(t,e)=>{t.ratingMax=e}},metadata:Me},Zt,Qt),a(null,null,A,{kind:"field",name:"ratingSymbol",static:!1,private:!1,access:{has:t=>"ratingSymbol"in t,get:t=>t.ratingSymbol,set:(t,e)=>{t.ratingSymbol=e}},metadata:Me},te,ee),a(null,null,j,{kind:"field",name:"ratingEmptySymbol",static:!1,private:!1,access:{has:t=>"ratingEmptySymbol"in t,get:t=>t.ratingEmptySymbol,set:(t,e)=>{t.ratingEmptySymbol=e}},metadata:Me},ae,ie),a(null,null,F,{kind:"field",name:"ratingColor",static:!1,private:!1,access:{has:t=>"ratingColor"in t,get:t=>t.ratingColor,set:(t,e)=>{t.ratingColor=e}},metadata:Me},se,ne),a(null,null,L,{kind:"field",name:"progressMax",static:!1,private:!1,access:{has:t=>"progressMax"in t,get:t=>t.progressMax,set:(t,e)=>{t.progressMax=e}},metadata:Me},le,re),a(null,null,z,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:t=>"showPercentage"in t,get:t=>t.showPercentage,set:(t,e)=>{t.showPercentage=e}},metadata:Me},oe,ce),a(null,null,O,{kind:"field",name:"progressColor",static:!1,private:!1,access:{has:t=>"progressColor"in t,get:t=>t.progressColor,set:(t,e)=>{t.progressColor=e}},metadata:Me},he,de),a(null,null,B,{kind:"field",name:"progressBgColor",static:!1,private:!1,access:{has:t=>"progressBgColor"in t,get:t=>t.progressBgColor,set:(t,e)=>{t.progressBgColor=e}},metadata:Me},ue,pe),a(null,null,M,{kind:"field",name:"progressHeight",static:!1,private:!1,access:{has:t=>"progressHeight"in t,get:t=>t.progressHeight,set:(t,e)=>{t.progressHeight=e}},metadata:Me},me,ge),a(null,null,P,{kind:"field",name:"sparklineType",static:!1,private:!1,access:{has:t=>"sparklineType"in t,get:t=>t.sparklineType,set:(t,e)=>{t.sparklineType=e}},metadata:Me},ye,ve),a(null,null,V,{kind:"field",name:"sparklineColor",static:!1,private:!1,access:{has:t=>"sparklineColor"in t,get:t=>t.sparklineColor,set:(t,e)=>{t.sparklineColor=e}},metadata:Me},be,fe),a(null,null,N,{kind:"field",name:"sparklineWidth",static:!1,private:!1,access:{has:t=>"sparklineWidth"in t,get:t=>t.sparklineWidth,set:(t,e)=>{t.sparklineWidth=e}},metadata:Me},we,ke),a(null,null,H,{kind:"field",name:"sparklineHeight",static:!1,private:!1,access:{has:t=>"sparklineHeight"in t,get:t=>t.sparklineHeight,set:(t,e)=>{t.sparklineHeight=e}},metadata:Me},xe,Se),a(null,null,I,{kind:"field",name:"cellBgColor",static:!1,private:!1,access:{has:t=>"cellBgColor"in t,get:t=>t.cellBgColor,set:(t,e)=>{t.cellBgColor=e}},metadata:Me},Ce,$e),a(null,null,R,{kind:"field",name:"cellColor",static:!1,private:!1,access:{has:t=>"cellColor"in t,get:t=>t.cellColor,set:(t,e)=>{t.cellColor=e}},metadata:Me},De,Te),a(null,null,q,{kind:"field",name:"cellFontWeight",static:!1,private:!1,access:{has:t=>"cellFontWeight"in t,get:t=>t.cellFontWeight,set:(t,e)=>{t.cellFontWeight=e}},metadata:Me},Ee,Ae),a(null,null,W,{kind:"field",name:"cellFontStyle",static:!1,private:!1,access:{has:t=>"cellFontStyle"in t,get:t=>t.cellFontStyle,set:(t,e)=>{t.cellFontStyle=e}},metadata:Me},je,Fe),a(null,null,Y,{kind:"field",name:"cellFontSize",static:!1,private:!1,access:{has:t=>"cellFontSize"in t,get:t=>t.cellFontSize,set:(t,e)=>{t.cellFontSize=e}},metadata:Me},Le,ze),a(null,null,U,{kind:"field",name:"cellTextDecoration",static:!1,private:!1,access:{has:t=>"cellTextDecoration"in t,get:t=>t.cellTextDecoration,set:(t,e)=>{t.cellTextDecoration=e}},metadata:Me},Oe,Be),a(null,t={value:s},at,{kind:"class",name:s.name,metadata:Me},null,it),s=t.value,Me&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Me}),i(s,it)}render(){return e.html`<slot></slot>`}setFormatter(t){this.formatter=t,this.notifyTableOfChange()}addConditionalFormat(t){this.conditionalFormats.push(t),this.notifyTableOfChange()}removeConditionalFormat(t){this.conditionalFormats.splice(t,1),this.notifyTableOfChange()}clearConditionalFormats(){this.conditionalFormats=[],this.notifyTableOfChange()}getColumnDefinition(){const t={key:this.key,label:this.label,type:this.type,align:this.align,width:this.width,sortable:this.sortable,filterable:this.filterable,wrap:this.wrap,ellipsis:this.ellipsis,tooltip:this.tooltip,formatter:this.formatter,conditionalFormats:this.conditionalFormats};if("number"===this.type||"currency"===this.type||"percent"===this.type||"accounting"===this.type||"scientific"===this.type||"fraction"===this.type){const e={};void 0!==this.decimals&&(e.decimals=this.decimals),void 0!==this.thousandsSeparator&&(e.thousandsSeparator=this.thousandsSeparator),this.numberPrefix&&(e.prefix=this.numberPrefix),this.numberSuffix&&(e.suffix=this.numberSuffix),this.negativeStyle&&(e.negativeStyle=this.negativeStyle),Object.keys(e).length>0&&(t.numberFormat=e)}if("date"===this.type){const e={};this.dateFormat&&(e.format=this.dateFormat),this.customDateFormat&&(e.customFormat=this.customDateFormat),this.dateLocale&&(e.locale=this.dateLocale),Object.keys(e).length>0&&(t.dateFormat=e)}if("boolean"===this.type){const e={};this.trueValue&&(e.trueValue=this.trueValue),this.falseValue&&(e.falseValue=this.falseValue),void 0!==this.useSymbols&&(e.useSymbols=this.useSymbols),this.trueSymbol&&(e.trueSymbol=this.trueSymbol),this.falseSymbol&&(e.falseSymbol=this.falseSymbol),Object.keys(e).length>0&&(t.booleanFormat=e)}if("rating"===this.type){const e={};void 0!==this.ratingMax&&(e.max=this.ratingMax),this.ratingSymbol&&(e.symbol=this.ratingSymbol),this.ratingEmptySymbol&&(e.emptySymbol=this.ratingEmptySymbol),this.ratingColor&&(e.color=this.ratingColor),Object.keys(e).length>0&&(t.ratingFormat=e)}if("progress"===this.type){const e={};void 0!==this.progressMax&&(e.max=this.progressMax),void 0!==this.showPercentage&&(e.showPercentage=this.showPercentage),this.progressColor&&(e.color=this.progressColor),this.progressBgColor&&(e.backgroundColor=this.progressBgColor),this.progressHeight&&(e.height=this.progressHeight),Object.keys(e).length>0&&(t.progressFormat=e)}if("sparkline"===this.type){const e={};this.sparklineType&&(e.type=this.sparklineType),this.sparklineColor&&(e.color=this.sparklineColor),void 0!==this.sparklineWidth&&(e.width=this.sparklineWidth),void 0!==this.sparklineHeight&&(e.height=this.sparklineHeight),Object.keys(e).length>0&&(t.sparklineFormat=e)}const e={};return this.cellBgColor&&(e.backgroundColor=this.cellBgColor),this.cellColor&&(e.color=this.cellColor),this.cellFontWeight&&(e.fontWeight=this.cellFontWeight),this.cellFontStyle&&(e.fontStyle=this.cellFontStyle),this.cellFontSize&&(e.fontSize=this.cellFontSize),this.cellTextDecoration&&(e.textDecoration=this.cellTextDecoration),Object.keys(e).length>0&&(t.style=e),t}handleBasicPropsChange(){this.notifyTableOfChange()}handleNumberFormatChange(){"number"!==this.type&&"currency"!==this.type&&"percent"!==this.type&&"accounting"!==this.type&&"scientific"!==this.type&&"fraction"!==this.type||this.notifyTableOfChange()}handleDateFormatChange(){"date"===this.type&&this.notifyTableOfChange()}handleBooleanFormatChange(){"boolean"===this.type&&this.notifyTableOfChange()}handleRatingFormatChange(){"rating"===this.type&&this.notifyTableOfChange()}handleProgressFormatChange(){"progress"===this.type&&this.notifyTableOfChange()}handleSparklineFormatChange(){"sparkline"===this.type&&this.notifyTableOfChange()}handleStyleChange(){this.notifyTableOfChange()}notifyTableOfChange(){this.dispatchEvent(new CustomEvent("column-changed",{detail:{column:this.getColumnDefinition()},bubbles:!0,composed:!0}))}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f=[e.element("snice-cell-link")],w=[],k=HTMLElement,x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[];(class extends k{static{s=this}static{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:Boolean,attribute:"external"})],c=[e.property({type:String})],h=[e.property({type:String})],d=[e.property({type:Object})],u=[e.property({type:Object})],p=[e.property({type:String})],m=[e.property({type:String})],g=[e.render()],y=[e.styles()],v=[e.ready()],b=[e.watch("value","column")],a(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:q},null,x),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:q},null,x),a(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:q},null,x),a(this,null,b,{kind:"method",name:"updateCellAttributes",static:!1,private:!1,access:{has:t=>"updateCellAttributes"in t,get:t=>t.updateCellAttributes},metadata:q},null,x),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:q},S,C),a(null,null,l,{kind:"field",name:"href",static:!1,private:!1,access:{has:t=>"href"in t,get:t=>t.href,set:(t,e)=>{t.href=e}},metadata:q},$,D),a(null,null,r,{kind:"field",name:"target",static:!1,private:!1,access:{has:t=>"target"in t,get:t=>t.target,set:(t,e)=>{t.target=e}},metadata:q},T,E),a(null,null,o,{kind:"field",name:"external",static:!1,private:!1,access:{has:t=>"external"in t,get:t=>t.external,set:(t,e)=>{t.external=e}},metadata:q},A,j),a(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:t=>"icon"in t,get:t=>t.icon,set:(t,e)=>{t.icon=e}},metadata:q},F,L),a(null,null,h,{kind:"field",name:"text",static:!1,private:!1,access:{has:t=>"text"in t,get:t=>t.text,set:(t,e)=>{t.text=e}},metadata:q},z,O),a(null,null,d,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:q},B,M),a(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:q},P,V),a(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:q},N,H),a(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:q},I,R),a(null,t={value:s},f,{kind:"class",name:s.name,metadata:q},null,w),s=t.value,q&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),i(s,w)}render(){const t=this.href||this.value,a=this.text||this.value,i=this.external||"_blank"===this.target||t.startsWith("http"),s=this.icon?`<span class="link-icon">${this.icon}</span>`:"",n=i?'<span class="external-icon">↗</span>':"";return e.html`
257
+ <div class="cell-content cell-content--link" part="content">
258
+ <a
259
+ href="${t}"
260
+ target="${i?"_blank":this.target}"
261
+ rel="${i?"noopener noreferrer":""}"
262
+ class="cell-link"
263
+ part="link"
264
+ >
265
+ ${e.unsafeHTML(s)}
266
+ <span class="link-text">${a}</span>
267
+ ${e.unsafeHTML(n)}
268
+ </a>
269
+ </div>
270
+ `}styles(){return e.css`${':host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.cell-link{display:inline-flex;align-items:center;gap:.25rem;color:var(--snice-color-primary);text-decoration:none;transition:color .2s}.cell-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.cell-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.cell-link:visited{color:var(--snice-color-secondary)}.link-icon{display:inline-flex;align-items:center;font-size:1rem}.link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.external-icon{display:inline-flex;align-items:center;font-size:.75rem;opacity:.7}:host([align=left]){text-align:left;justify-content:flex-start}:host([align=center]){text-align:center;justify-content:center}:host([align=right]){text-align:right;justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}}@media print{.cell-link{text-decoration:underline}.cell-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary)}}'}`}init(){this.updateCellAttributes()}updateCellAttributes(){if(this.column?.linkFormat){const t=this.column.linkFormat;this.href=t.href||this.value,this.target=t.target||"_self",this.external=t.external||!1,this.icon=t.icon||"",this.text=t.text||this.value}}constructor(){super(...arguments),this.value=(i(this,x),i(this,S,"")),this.href=(i(this,C),i(this,$,"")),this.target=(i(this,D),i(this,T,"_self")),this.external=(i(this,E),i(this,A,!1)),this.icon=(i(this,j),i(this,F,"")),this.text=(i(this,L),i(this,z,"")),this.column=(i(this,O),i(this,B,null)),this.rowData=(i(this,M),i(this,P,null)),this.align=(i(this,V),i(this,N,"left")),this.type=(i(this,H),i(this,I,"link")),i(this,R)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y=[e.element("snice-cell-actions")],v=[],b=HTMLElement,f=[],w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[];(class extends b{static{s=this}static{const L="function"==typeof Symbol&&Symbol.metadata?Object.create(b[Symbol.metadata]??null):void 0;n=[e.property({type:Array})],l=[e.property({type:Object})],r=[e.property({type:Object})],o=[e.property({type:String})],c=[e.property({type:String})],h=[e.property({type:String})],d=[e.render()],u=[e.styles()],p=[e.ready()],m=[e.watch("column")],g=[e.dispatch("cell-action",{bubbles:!0,composed:!0})],a(this,null,d,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:L},null,f),a(this,null,u,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:L},null,f),a(this,null,p,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:L},null,f),a(this,null,m,{kind:"method",name:"extractActionsFromColumn",static:!1,private:!1,access:{has:t=>"extractActionsFromColumn"in t,get:t=>t.extractActionsFromColumn},metadata:L},null,f),a(this,null,g,{kind:"method",name:"dispatchAction",static:!1,private:!1,access:{has:t=>"dispatchAction"in t,get:t=>t.dispatchAction},metadata:L},null,f),a(null,null,n,{kind:"field",name:"actions",static:!1,private:!1,access:{has:t=>"actions"in t,get:t=>t.actions,set:(t,e)=>{t.actions=e}},metadata:L},w,k),a(null,null,l,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:L},x,S),a(null,null,r,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:L},C,$),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:L},D,T),a(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:L},E,A),a(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:L},j,F),a(null,t={value:s},y,{kind:"class",name:s.name,metadata:L},null,v),s=t.value,L&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:L}),i(s,v)}render(){return 0===this.actions.length?e.html`
271
+ <div class="cell-content cell-content--actions" part="content">
272
+ <div class="actions-container"></div>
273
+ </div>
274
+ `:e.html`
275
+ <div class="cell-content cell-content--actions" part="content">
276
+ <div class="actions-container">
277
+ ${this.actions.map(t=>this.renderActionButton(t))}
278
+ </div>
279
+ </div>
280
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.actions-container{display:inline-flex;gap:.5rem;align-items:center}.action-button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;border:1px solid transparent;border-radius:.25rem;background:0 0;cursor:pointer;transition:.2s;font-size:.875rem;line-height:1}.action-button:hover{background:hsl(0 0% 0% / .05)}.action-button:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px}.action-button:active{transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button:disabled:hover{background:0 0}.action-button--primary{color:var(--snice-color-primary)}.action-button--primary:hover:not(:disabled){background:hsl(var(--snice-color-blue-500) / .1)}.action-button--secondary{color:var(--snice-color-text)}.action-button--danger{color:var(--snice-color-danger)}.action-button--danger:hover:not(:disabled){background:hsl(var(--snice-color-red-500) / .1)}.action-button--success{color:var(--snice-color-success)}.action-button--success:hover:not(:disabled){background:hsl(var(--snice-color-green-500) / .1)}.action-icon{display:inline-flex;align-items:center;font-size:1rem}.action-icon--image{width:1rem;height:1rem}.action-icon--image img{width:100%;height:100%;object-fit:contain}.action-label{font-weight:500}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.action-button{padding:.25rem}.action-label{display:none}}@media print{.actions-container{display:none}}"}`}init(){this.extractActionsFromColumn()}extractActionsFromColumn(){this.column?.actionsFormat?.actions&&(this.actions=this.column.actionsFormat.actions)}renderActionButton(t){const a=t.icon||"",i=t.label||"",s=t.variant||"secondary",n=t.disabled||!1,l=a&&(a.startsWith("http://")||a.startsWith("https://")||a.startsWith("/")||a.startsWith("./"));let r="";return a&&(r=l?`<span class="action-icon action-icon--image"><img src="${a}" alt="" /></span>`:`<span class="action-icon">${a}</span>`),e.html`
281
+ <button
282
+ class="action-button action-button--${s}"
283
+ part="action-button"
284
+ title="${t.title||t.action}"
285
+ ?disabled=${n}
286
+ @click=${e=>this.handleActionClick(e,t.action)}
287
+ >
288
+ ${e.unsafeHTML(r)}
289
+ ${i?e.html`<span class="action-label">${i}</span>`:""}
290
+ </button>
291
+ `}handleActionClick(t,e){t.stopPropagation(),this.dispatchAction(e)}dispatchAction(t){return{action:t,rowData:this.rowData,column:this.column}}constructor(){super(...arguments),this.actions=(i(this,f),i(this,w,[])),this.column=(i(this,k),i(this,x,null)),this.rowData=(i(this,S),i(this,C,null)),this.value=(i(this,$),i(this,D,"")),this.align=(i(this,T),i(this,E,"left")),this.type=(i(this,A),i(this,j,"actions")),i(this,F)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y=[e.element("snice-cell-tag")],v=[],b=HTMLElement,f=[],w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[];(class extends b{static{s=this}static{const O="function"==typeof Symbol&&Symbol.metadata?Object.create(b[Symbol.metadata]??null):void 0;n=[e.property({type:Array})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:Object})],c=[e.property({type:Object})],h=[e.property({type:String})],d=[e.property({type:String})],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("value","column")],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:O},null,f),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:O},null,f),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:O},null,f),a(this,null,g,{kind:"method",name:"extractTagsFromColumn",static:!1,private:!1,access:{has:t=>"extractTagsFromColumn"in t,get:t=>t.extractTagsFromColumn},metadata:O},null,f),a(null,null,n,{kind:"field",name:"tags",static:!1,private:!1,access:{has:t=>"tags"in t,get:t=>t.tags,set:(t,e)=>{t.tags=e}},metadata:O},w,k),a(null,null,l,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:O},x,S),a(null,null,r,{kind:"field",name:"variant",static:!1,private:!1,access:{has:t=>"variant"in t,get:t=>t.variant,set:(t,e)=>{t.variant=e}},metadata:O},C,$),a(null,null,o,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:O},D,T),a(null,null,c,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:O},E,A),a(null,null,h,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:O},j,F),a(null,null,d,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:O},L,z),a(null,t={value:s},y,{kind:"class",name:s.name,metadata:O},null,v),s=t.value,O&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:O}),i(s,v)}render(){const t=this.tags.length>0?this.tags:this.parseValue();return e.html`
292
+ <div class="cell-content cell-content--tag" part="content">
293
+ <div class="tags-container">
294
+ ${t.map(t=>this.renderTag(t))}
295
+ </div>
296
+ </div>
297
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.tags-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;align-items:center}.tag{display:inline-flex;align-items:center;padding:.125rem .5rem;border-radius:.75rem;font-size:.75rem;font-weight:500;line-height:1.25;white-space:nowrap}.tag--default{background:hsl(0 0% 0% / .08);color:var(--snice-color-text)}.tag--primary{background:hsl(var(--snice-color-blue-500) / .1);color:var(--snice-color-primary)}.tag--success{background:hsl(var(--snice-color-green-500) / .1);color:var(--snice-color-success)}.tag--danger{background:hsl(var(--snice-color-red-500) / .1);color:var(--snice-color-danger)}.tag--warning{background:hsl(var(--snice-color-yellow-500) / .1);color:var(--snice-color-warning)}.tag--info{background:hsl(var(--snice-color-blue-400) / .1);color:var(--snice-color-primary)}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.tag{font-size:.6875rem;padding:.0625rem .375rem}}@media print{.tag{border:1px solid currentColor}}"}`}init(){this.extractTagsFromColumn()}extractTagsFromColumn(){this.column?.tagFormat&&(this.variant=this.column.tagFormat.variant||"default")}parseValue(){if(!this.value)return[];if(Array.isArray(this.value))return this.value;if("string"==typeof this.value){try{const t=JSON.parse(this.value);if(Array.isArray(t))return t}catch{}return this.value.split(",").map(t=>t.trim()).filter(t=>t)}return[String(this.value)]}renderTag(t){return e.html`
298
+ <span class="tag tag--${this.variant}" part="tag">
299
+ ${t}
300
+ </span>
301
+ `}constructor(){super(...arguments),this.tags=(i(this,f),i(this,w,[])),this.value=(i(this,k),i(this,x,"")),this.variant=(i(this,S),i(this,C,"default")),this.column=(i(this,$),i(this,D,null)),this.rowData=(i(this,T),i(this,E,null)),this.align=(i(this,A),i(this,j,"left")),this.type=(i(this,F),i(this,L,"tag")),i(this,z)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k=[e.element("snice-cell-image")],x=[],S=HTMLElement,C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[],K=[];(class extends S{static{s=this}static{const G="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:String})],c=[e.property({type:String})],h=[e.property({type:String})],d=[e.property({type:Boolean})],u=[e.property({type:Object})],p=[e.property({type:Object})],m=[e.property({type:String})],g=[e.property({type:String})],y=[e.property({type:Boolean})],v=[e.render()],b=[e.styles()],f=[e.ready()],w=[e.watch("column")],a(this,null,v,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:G},null,C),a(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:G},null,C),a(this,null,f,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:G},null,C),a(this,null,w,{kind:"method",name:"updateImageAttributes",static:!1,private:!1,access:{has:t=>"updateImageAttributes"in t,get:t=>t.updateImageAttributes},metadata:G},null,C),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:G},$,D),a(null,null,l,{kind:"field",name:"src",static:!1,private:!1,access:{has:t=>"src"in t,get:t=>t.src,set:(t,e)=>{t.src=e}},metadata:G},T,E),a(null,null,r,{kind:"field",name:"alt",static:!1,private:!1,access:{has:t=>"alt"in t,get:t=>t.alt,set:(t,e)=>{t.alt=e}},metadata:G},A,j),a(null,null,o,{kind:"field",name:"fallback",static:!1,private:!1,access:{has:t=>"fallback"in t,get:t=>t.fallback,set:(t,e)=>{t.fallback=e}},metadata:G},F,L),a(null,null,c,{kind:"field",name:"variant",static:!1,private:!1,access:{has:t=>"variant"in t,get:t=>t.variant,set:(t,e)=>{t.variant=e}},metadata:G},z,O),a(null,null,h,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:G},B,M),a(null,null,d,{kind:"field",name:"lazy",static:!1,private:!1,access:{has:t=>"lazy"in t,get:t=>t.lazy,set:(t,e)=>{t.lazy=e}},metadata:G},P,V),a(null,null,u,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:G},N,H),a(null,null,p,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:G},I,R),a(null,null,m,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:G},q,W),a(null,null,g,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:G},Y,U),a(null,null,y,{kind:"field",name:"imageError",static:!1,private:!1,access:{has:t=>"imageError"in t,get:t=>t.imageError,set:(t,e)=>{t.imageError=e}},metadata:G},J,K),a(null,t={value:s},k,{kind:"class",name:s.name,metadata:G},null,x),s=t.value,G&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:G}),i(s,x)}render(){const t=this.src||this.value,a=this.alt||"Image",i=this.lazy?"lazy":"eager",s=`cell-image ${`image--${this.variant}`} ${`image--${this.size}`}`;return this.imageError&&this.fallback?e.html`
302
+ <div class="cell-content cell-content--image" part="content">
303
+ <img src="${this.fallback}" alt="${a}" class="${s}" />
304
+ </div>
305
+ `:t?e.html`
306
+ <div class="cell-content cell-content--image" part="content">
307
+ <img src="${t}" alt="${a}" loading="${i}" class="${s}" @error=${this.handleImageError} />
308
+ </div>
309
+ `:e.html`
310
+ <div class="cell-content cell-content--image" part="content">
311
+ <div class="${s} cell-image--placeholder"></div>
312
+ </div>
313
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center}.cell-image{display:block;object-fit:cover;background-color:hsl(var(--snice-color-gray-100))}.image--small{width:1.5rem;height:1.5rem}.image--medium{width:2rem;height:2rem}.image--large{width:3rem;height:3rem}.image--rounded{border-radius:.25rem}.image--square{border-radius:0}.image--circle{border-radius:50%}.cell-image--placeholder{background:linear-gradient(135deg,hsl(var(--snice-color-gray-200)) 0,hsl(var(--snice-color-gray-300)) 100%);border:1px solid hsl(var(--snice-color-gray-300));position:relative}.cell-image--placeholder::after{content:'📷';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);font-size:.875rem;opacity:.5}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}:host(.loading) .cell-image{opacity:.6;animation:1.5s ease-in-out infinite image-pulse}@keyframes image-pulse{0%,100%{opacity:.6}50%{opacity:.3}}@media (max-width:768px){.image--small{width:1.25rem;height:1.25rem}.image--medium{width:1.75rem;height:1.75rem}.image--large{width:2.5rem;height:2.5rem}}@media (prefers-reduced-motion:reduce){:host(.loading) .cell-image{animation:none}}@media print{.cell-image{max-width:2rem;max-height:2rem}}"}`}init(){this.updateImageAttributes()}updateImageAttributes(){if(this.column?.imageFormat){const t=this.column.imageFormat;this.src=t.src||this.value,this.alt=t.alt||"",this.fallback=t.fallback||"",this.variant=t.variant||"rounded",this.size=t.size||"medium",this.lazy=t.lazy??!0}}handleImageError(){this.imageError=!0}constructor(){super(...arguments),this.value=(i(this,C),i(this,$,"")),this.src=(i(this,D),i(this,T,"")),this.alt=(i(this,E),i(this,A,"")),this.fallback=(i(this,j),i(this,F,"")),this.variant=(i(this,L),i(this,z,"rounded")),this.size=(i(this,O),i(this,B,"medium")),this.lazy=(i(this,M),i(this,P,!0)),this.column=(i(this,V),i(this,N,null)),this.rowData=(i(this,H),i(this,I,null)),this.align=(i(this,R),i(this,q,"center")),this.type=(i(this,W),i(this,Y,"image")),this.imageError=(i(this,U),i(this,J,!1)),i(this,K)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v=[e.element("snice-cell-email")],b=[],f=HTMLElement,w=[],k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[];(class extends f{static{s=this}static{const P="function"==typeof Symbol&&Symbol.metadata?Object.create(f[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:Boolean})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.property({type:String})],u=[e.property({type:String})],p=[e.render()],m=[e.styles()],g=[e.ready()],y=[e.watch("value","column")],a(this,null,p,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:P},null,w),a(this,null,m,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:P},null,w),a(this,null,g,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:P},null,w),a(this,null,y,{kind:"method",name:"updateEmailAttributes",static:!1,private:!1,access:{has:t=>"updateEmailAttributes"in t,get:t=>t.updateEmailAttributes},metadata:P},null,w),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:P},k,x),a(null,null,l,{kind:"field",name:"email",static:!1,private:!1,access:{has:t=>"email"in t,get:t=>t.email,set:(t,e)=>{t.email=e}},metadata:P},S,C),a(null,null,r,{kind:"field",name:"displayText",static:!1,private:!1,access:{has:t=>"displayText"in t,get:t=>t.displayText,set:(t,e)=>{t.displayText=e}},metadata:P},$,D),a(null,null,o,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:t=>"showIcon"in t,get:t=>t.showIcon,set:(t,e)=>{t.showIcon=e}},metadata:P},T,E),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:P},A,j),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:P},F,L),a(null,null,d,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:P},z,O),a(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:P},B,M),a(null,t={value:s},v,{kind:"class",name:s.name,metadata:P},null,b),s=t.value,P&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:P}),i(s,b)}render(){const t=this.email||this.value,a=this.displayText||t,i=this.showIcon?'<span class="email-icon">✉</span>':"";return t?e.html`
314
+ <div class="cell-content cell-content--email" part="content">
315
+ ${e.unsafeHTML(i)}
316
+ <a href="mailto:${t}" class="email-link" part="link">
317
+ ${a}
318
+ </a>
319
+ </div>
320
+ `:e.html`
321
+ <div class="cell-content cell-content--email" part="content">
322
+ <span class="email-empty"></span>
323
+ </div>
324
+ `}styles(){return e.css`${':host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary);text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.email-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.email-link:visited{color:var(--snice-color-secondary)}.email-empty{color:var(--snice-color-text-secondary);font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.email-icon{font-size:.75rem}}@media print{.email-link{text-decoration:underline}.email-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary)}.email-icon{display:none}}'}`}init(){this.updateEmailAttributes()}updateEmailAttributes(){if(this.column?.emailFormat){const t=this.column.emailFormat;this.email=t.email||this.value,this.displayText=t.displayText||"",this.showIcon=t.showIcon??!0}}constructor(){super(...arguments),this.value=(i(this,w),i(this,k,"")),this.email=(i(this,x),i(this,S,"")),this.displayText=(i(this,C),i(this,$,"")),this.showIcon=(i(this,D),i(this,T,!0)),this.column=(i(this,E),i(this,A,null)),this.rowData=(i(this,j),i(this,F,null)),this.align=(i(this,L),i(this,z,"left")),this.type=(i(this,O),i(this,B,"email")),i(this,M)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f=[e.element("snice-cell-phone")],w=[],k=HTMLElement,x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[];(class extends k{static{s=this}static{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:Boolean})],c=[e.property({type:Boolean})],h=[e.property({type:String})],d=[e.property({type:Object})],u=[e.property({type:Object})],p=[e.property({type:String})],m=[e.property({type:String})],g=[e.render()],y=[e.styles()],v=[e.ready()],b=[e.watch("value","column")],a(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:q},null,x),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:q},null,x),a(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:q},null,x),a(this,null,b,{kind:"method",name:"updatePhoneAttributes",static:!1,private:!1,access:{has:t=>"updatePhoneAttributes"in t,get:t=>t.updatePhoneAttributes},metadata:q},null,x),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:q},S,C),a(null,null,l,{kind:"field",name:"phone",static:!1,private:!1,access:{has:t=>"phone"in t,get:t=>t.phone,set:(t,e)=>{t.phone=e}},metadata:q},$,D),a(null,null,r,{kind:"field",name:"displayText",static:!1,private:!1,access:{has:t=>"displayText"in t,get:t=>t.displayText,set:(t,e)=>{t.displayText=e}},metadata:q},T,E),a(null,null,o,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:t=>"showIcon"in t,get:t=>t.showIcon,set:(t,e)=>{t.showIcon=e}},metadata:q},A,j),a(null,null,c,{kind:"field",name:"format",static:!1,private:!1,access:{has:t=>"format"in t,get:t=>t.format,set:(t,e)=>{t.format=e}},metadata:q},F,L),a(null,null,h,{kind:"field",name:"country",static:!1,private:!1,access:{has:t=>"country"in t,get:t=>t.country,set:(t,e)=>{t.country=e}},metadata:q},z,O),a(null,null,d,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:q},B,M),a(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:q},P,V),a(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:q},N,H),a(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:q},I,R),a(null,t={value:s},f,{kind:"class",name:s.name,metadata:q},null,w),s=t.value,q&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),i(s,w)}render(){const t=this.phone||this.value,a=this.displayText||(this.format?this.formatPhoneNumber(t):t),i=this.showIcon?'<span class="phone-icon">📞</span>':"";return t?e.html`
325
+ <div class="cell-content cell-content--phone" part="content">
326
+ ${e.unsafeHTML(i)}
327
+ <a href="tel:${t}" class="phone-link" part="link">
328
+ ${a}
329
+ </a>
330
+ </div>
331
+ `:e.html`
332
+ <div class="cell-content cell-content--phone" part="content">
333
+ <span class="phone-empty"></span>
334
+ </div>
335
+ `}styles(){return e.css`${':host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.phone-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.phone-link{color:var(--snice-color-primary);text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.phone-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.phone-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.phone-link:visited{color:var(--snice-color-secondary)}.phone-empty{color:var(--snice-color-text-secondary);font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.phone-icon{font-size:.75rem}}@media print{.phone-link{text-decoration:underline}.phone-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary)}.phone-icon{display:none}}'}`}init(){this.updatePhoneAttributes()}updatePhoneAttributes(){if(this.column?.phoneFormat){const t=this.column.phoneFormat;this.phone=t.phone||this.value,this.displayText=t.displayText||"",this.showIcon=t.showIcon??!0,this.format=t.format??!0,this.country=t.country||"US"}}formatPhoneNumber(t){const e=t.replace(/\D/g,"");return"US"===this.country&&10===e.length?`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6)}`:"US"===this.country&&11===e.length&&"1"===e[0]?`+1 (${e.slice(1,4)}) ${e.slice(4,7)}-${e.slice(7)}`:t}constructor(){super(...arguments),this.value=(i(this,x),i(this,S,"")),this.phone=(i(this,C),i(this,$,"")),this.displayText=(i(this,D),i(this,T,"")),this.showIcon=(i(this,E),i(this,A,!0)),this.format=(i(this,j),i(this,F,!0)),this.country=(i(this,L),i(this,z,"US")),this.column=(i(this,O),i(this,B,null)),this.rowData=(i(this,M),i(this,P,null)),this.align=(i(this,V),i(this,N,"left")),this.type=(i(this,H),i(this,I,"phone")),i(this,R)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b=[e.element("snice-cell-status")],f=[],w=HTMLElement,k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[];(class extends w{static{s=this}static{const H="function"==typeof Symbol&&Symbol.metadata?Object.create(w[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:Boolean})],c=[e.property({type:String})],h=[e.property({type:Object})],d=[e.property({type:Object})],u=[e.property({type:String})],p=[e.property({type:String})],m=[e.render()],g=[e.styles()],y=[e.ready()],v=[e.watch("value","column")],a(this,null,m,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:H},null,k),a(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:H},null,k),a(this,null,y,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:H},null,k),a(this,null,v,{kind:"method",name:"updateStatusAttributes",static:!1,private:!1,access:{has:t=>"updateStatusAttributes"in t,get:t=>t.updateStatusAttributes},metadata:H},null,k),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:H},x,S),a(null,null,l,{kind:"field",name:"status",static:!1,private:!1,access:{has:t=>"status"in t,get:t=>t.status,set:(t,e)=>{t.status=e}},metadata:H},C,$),a(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:t=>"label"in t,get:t=>t.label,set:(t,e)=>{t.label=e}},metadata:H},D,T),a(null,null,o,{kind:"field",name:"showDot",static:!1,private:!1,access:{has:t=>"showDot"in t,get:t=>t.showDot,set:(t,e)=>{t.showDot=e}},metadata:H},E,A),a(null,null,c,{kind:"field",name:"variant",static:!1,private:!1,access:{has:t=>"variant"in t,get:t=>t.variant,set:(t,e)=>{t.variant=e}},metadata:H},j,F),a(null,null,h,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:H},L,z),a(null,null,d,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:H},O,B),a(null,null,u,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:H},M,P),a(null,null,p,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:H},V,N),a(null,t={value:s},b,{kind:"class",name:s.name,metadata:H},null,f),s=t.value,H&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:H}),i(s,f)}render(){const t=this.status||this.value,a=this.label||t,i=this.getStatusVariant(t),s=this.showDot?`<span class="status-dot status-dot--${i}"></span>`:"";return e.html`
336
+ <div class="cell-content cell-content--status" part="content">
337
+ ${e.unsafeHTML(s)}
338
+ <span class="status-label status-label--${i}">${a}</span>
339
+ </div>
340
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.status-dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0;position:relative}.status-dot--online{background-color:var(--snice-color-success);box-shadow:0 0 0 2px hsl(var(--snice-color-green-500) / .2)}.status-dot--offline{background-color:hsl(var(--snice-color-gray-400));box-shadow:0 0 0 2px hsl(var(--snice-color-gray-500) / .2)}.status-dot--busy{background-color:var(--snice-color-danger);box-shadow:0 0 0 2px hsl(var(--snice-color-red-500) / .2)}.status-dot--away{background-color:var(--snice-color-warning);box-shadow:0 0 0 2px hsl(var(--snice-color-yellow-500) / .2)}.status-dot--custom{background-color:var(--snice-color-primary);box-shadow:0 0 0 2px hsl(var(--snice-color-blue-500) / .2)}.status-dot--online::after{content:'';position:absolute;top:-2px;left:-2px;right:-2px;bottom:-2px;border-radius:50%;border:2px solid var(--snice-color-success);animation:2s ease-in-out infinite status-pulse;opacity:0}@keyframes status-pulse{0%{transform:scale(1);opacity:1}100%{transform:scale(1.5);opacity:0}}.status-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-label--online{color:var(--snice-color-success)}.status-label--offline{color:var(--snice-color-text-secondary)}.status-label--busy{color:var(--snice-color-danger)}.status-label--away{color:var(--snice-color-warning)}.status-label--custom{color:var(--snice-color-text)}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.status-dot{width:.375rem;height:.375rem}}@media (prefers-reduced-motion:reduce){.status-dot--online::after{animation:none}}@media print{.status-dot{border:1px solid var(--snice-color-text)}.status-dot--online{background-color:var(--snice-color-background);border-color:var(--snice-color-success)}.status-dot--offline{background-color:var(--snice-color-background);border-color:var(--snice-color-neutral)}.status-dot--busy{background-color:var(--snice-color-background);border-color:var(--snice-color-danger)}.status-dot--away{background-color:var(--snice-color-background);border-color:var(--snice-color-warning)}}"}`}init(){this.updateStatusAttributes()}updateStatusAttributes(){if(this.column?.statusFormat){const t=this.column.statusFormat;this.status=t.status||this.value,this.label=t.label||this.value,this.showDot=t.showDot??!0,this.variant=t.variant||"custom"}}getStatusVariant(t){if("custom"!==this.variant)return this.variant;const e=t.toLowerCase();return"online"===e||"active"===e||"available"===e?"online":"offline"===e||"inactive"===e||"unavailable"===e?"offline":"busy"===e||"dnd"===e||"do not disturb"===e?"busy":"away"===e||"idle"===e?"away":"custom"}constructor(){super(...arguments),this.value=(i(this,k),i(this,x,"")),this.status=(i(this,S),i(this,C,"")),this.label=(i(this,$),i(this,D,"")),this.showDot=(i(this,T),i(this,E,!0)),this.variant=(i(this,A),i(this,j,"custom")),this.column=(i(this,F),i(this,L,null)),this.rowData=(i(this,z),i(this,O,null)),this.align=(i(this,B),i(this,M,"left")),this.type=(i(this,P),i(this,V,"status")),i(this,N)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f=[e.element("snice-cell-color")],w=[],k=HTMLElement,x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[];(class extends k{static{s=this}static{const q="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:Boolean})],o=[e.property({type:Boolean})],c=[e.property({type:Boolean})],h=[e.property({type:String})],d=[e.property({type:Object})],u=[e.property({type:Object})],p=[e.property({type:String})],m=[e.property({type:String})],g=[e.render()],y=[e.styles()],v=[e.ready()],b=[e.watch("value","column")],a(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:q},null,x),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:q},null,x),a(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:q},null,x),a(this,null,b,{kind:"method",name:"updateColorAttributes",static:!1,private:!1,access:{has:t=>"updateColorAttributes"in t,get:t=>t.updateColorAttributes},metadata:q},null,x),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:q},S,C),a(null,null,l,{kind:"field",name:"color",static:!1,private:!1,access:{has:t=>"color"in t,get:t=>t.color,set:(t,e)=>{t.color=e}},metadata:q},$,D),a(null,null,r,{kind:"field",name:"showSwatch",static:!1,private:!1,access:{has:t=>"showSwatch"in t,get:t=>t.showSwatch,set:(t,e)=>{t.showSwatch=e}},metadata:q},T,E),a(null,null,o,{kind:"field",name:"showHex",static:!1,private:!1,access:{has:t=>"showHex"in t,get:t=>t.showHex,set:(t,e)=>{t.showHex=e}},metadata:q},A,j),a(null,null,c,{kind:"field",name:"showRgb",static:!1,private:!1,access:{has:t=>"showRgb"in t,get:t=>t.showRgb,set:(t,e)=>{t.showRgb=e}},metadata:q},F,L),a(null,null,h,{kind:"field",name:"swatchSize",static:!1,private:!1,access:{has:t=>"swatchSize"in t,get:t=>t.swatchSize,set:(t,e)=>{t.swatchSize=e}},metadata:q},z,O),a(null,null,d,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:q},B,M),a(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:q},P,V),a(null,null,p,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:q},N,H),a(null,null,m,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:q},I,R),a(null,t={value:s},f,{kind:"class",name:s.name,metadata:q},null,w),s=t.value,q&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:q}),i(s,w)}render(){const t=this.color||this.value,a=this.showSwatch?`<span class="color-swatch color-swatch--${this.swatchSize}" style="background-color: ${t};"></span>`:"";let i="";if(this.showHex&&(i=t),this.showRgb&&t.startsWith("#")){const e=this.hexToRgb(t);i=e?`rgb(${e.r}, ${e.g}, ${e.b})`:t}return e.html`
341
+ <div class="cell-content cell-content--color" part="content">
342
+ ${e.unsafeHTML(a)}
343
+ ${i?e.html`<span class="color-text">${i}</span>`:""}
344
+ </div>
345
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.color-swatch{border:1px solid var(--snice-color-border);border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs)}.color-swatch--small{width:1rem;height:1rem}.color-swatch--medium{width:1.5rem;height:1.5rem}.color-swatch--large{width:2rem;height:2rem}.color-text{font-family:monospace;font-size:.875rem;color:var(--snice-color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.color-swatch--small{width:.875rem;height:.875rem}.color-swatch--medium{width:1.25rem;height:1.25rem}.color-swatch--large{width:1.75rem;height:1.75rem}.color-text{font-size:.75rem}}@media print{.color-swatch{border:2px solid var(--snice-color-text)}.color-text{font-size:.75rem}}"}`}init(){this.updateColorAttributes()}updateColorAttributes(){if(this.column?.colorFormat){const t=this.column.colorFormat;this.color=t.color||this.value,this.showSwatch=t.showSwatch??!0,this.showHex=t.showHex??!0,this.showRgb=t.showRgb??!1,this.swatchSize=t.swatchSize||"medium"}}hexToRgb(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}constructor(){super(...arguments),this.value=(i(this,x),i(this,S,"")),this.color=(i(this,C),i(this,$,"")),this.showSwatch=(i(this,D),i(this,T,!0)),this.showHex=(i(this,E),i(this,A,!0)),this.showRgb=(i(this,j),i(this,F,!1)),this.swatchSize=(i(this,L),i(this,z,"medium")),this.column=(i(this,O),i(this,B,null)),this.rowData=(i(this,M),i(this,P,null)),this.align=(i(this,V),i(this,N,"left")),this.type=(i(this,H),i(this,I,"color")),i(this,R)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b=[e.element("snice-cell-json")],f=[],w=HTMLElement,k=[],x=[],S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[];(class extends w{static{s=this}static{const V="function"==typeof Symbol&&Symbol.metadata?Object.create(w[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:Boolean})],r=[e.property({type:Number})],o=[e.property({type:Boolean})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.property({type:String})],u=[e.property({type:String})],p=[e.render()],m=[e.styles()],g=[e.ready()],y=[e.watch("value","column")],v=[e.on("click",".json-toggle")],a(this,null,p,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:V},null,k),a(this,null,m,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:V},null,k),a(this,null,g,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:V},null,k),a(this,null,y,{kind:"method",name:"updateJsonAttributes",static:!1,private:!1,access:{has:t=>"updateJsonAttributes"in t,get:t=>t.updateJsonAttributes},metadata:V},null,k),a(this,null,v,{kind:"method",name:"handleToggle",static:!1,private:!1,access:{has:t=>"handleToggle"in t,get:t=>t.handleToggle},metadata:V},null,k),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:V},x,S),a(null,null,l,{kind:"field",name:"collapsed",static:!1,private:!1,access:{has:t=>"collapsed"in t,get:t=>t.collapsed,set:(t,e)=>{t.collapsed=e}},metadata:V},C,$),a(null,null,r,{kind:"field",name:"maxDepth",static:!1,private:!1,access:{has:t=>"maxDepth"in t,get:t=>t.maxDepth,set:(t,e)=>{t.maxDepth=e}},metadata:V},D,T),a(null,null,o,{kind:"field",name:"showToggle",static:!1,private:!1,access:{has:t=>"showToggle"in t,get:t=>t.showToggle,set:(t,e)=>{t.showToggle=e}},metadata:V},E,A),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:V},j,F),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:V},L,z),a(null,null,d,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:V},O,B),a(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:V},M,P),a(null,t={value:s},b,{kind:"class",name:s.name,metadata:V},null,f),s=t.value,V&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:V}),i(s,f)}render(){const t="string"==typeof this.value?this.tryParseJson(this.value):this.value;if(null==t)return e.html`
346
+ <div class="cell-content cell-content--json" part="content">
347
+ <span class="json-empty">null</span>
348
+ </div>
349
+ `;const a=this.showToggle?`<button class="json-toggle" part="toggle" aria-label="${this.collapsed?"Expand":"Collapse"}">${this.collapsed?"▶":"▼"}</button>`:"",i=this.collapsed?this.renderCollapsed(t):this.renderExpanded(t);return e.html`
350
+ <div class="cell-content cell-content--json" part="content">
351
+ ${e.unsafeHTML(a)}
352
+ <div class="json-viewer ${this.collapsed?"json-viewer--collapsed":"json-viewer--expanded"}">
353
+ ${e.unsafeHTML(i)}
354
+ </div>
355
+ </div>
356
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:auto;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0}.json-toggle{background:0 0;border:none;color:var(--snice-color-text-secondary);cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0}.json-toggle:hover{background-color:var(--snice-color-background-hover)}.json-toggle:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px}.json-viewer{font-family:'Courier New',Consolas,monospace;font-size:.8125rem;overflow:hidden;flex:1}.json-viewer--collapsed{white-space:nowrap;text-overflow:ellipsis}.json-viewer--expanded{white-space:pre-wrap;word-break:break-word}.json-preview{color:var(--snice-color-text-secondary);font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary);font-weight:500;margin-right:.25rem}.json-string{color:var(--snice-color-success)}.json-number{color:var(--snice-color-info)}.json-boolean{color:var(--snice-color-warning)}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary);font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.json-viewer{font-size:.75rem}.json-toggle{font-size:.625rem}}@media print{.json-toggle{display:none}.json-viewer--collapsed{white-space:normal}.json-viewer{font-size:.625rem}}"}`}init(){this.updateJsonAttributes()}updateJsonAttributes(){if(this.column?.jsonFormat){const t=this.column.jsonFormat;this.collapsed=t.collapsed??!0,this.maxDepth=t.maxDepth??3,this.showToggle=t.showToggle??!0}}handleToggle(){this.collapsed=!this.collapsed}tryParseJson(t){try{return JSON.parse(t)}catch{return t}}renderCollapsed(t){if("object"==typeof t&&null!==t){if(Array.isArray(t))return`<span class="json-preview">[${t.length} items]</span>`;return`<span class="json-preview">{${Object.keys(t).length} keys}</span>`}return this.renderValue(t)}renderExpanded(t,e=0){if(e>=this.maxDepth)return this.renderCollapsed(t);if("object"==typeof t&&null!==t){if(Array.isArray(t)){return`<div class="json-object">[${t.map((t,a)=>`<div class="json-line"><span class="json-key">${a}:</span> ${this.renderExpanded(t,e+1)}</div>`).join("")}]</div>`}return`<div class="json-object">{${Object.entries(t).map(([t,a])=>`<div class="json-line"><span class="json-key">${t}:</span> ${this.renderExpanded(a,e+1)}</div>`).join("")}}</div>`}return this.renderValue(t)}renderValue(t){return null===t?'<span class="json-null">null</span>':void 0===t?'<span class="json-undefined">undefined</span>':"boolean"==typeof t?`<span class="json-boolean">${t}</span>`:"number"==typeof t?`<span class="json-number">${t}</span>`:"string"==typeof t?`<span class="json-string">"${t}"</span>`:String(t)}constructor(){super(...arguments),this.value=(i(this,k),i(this,x,null)),this.collapsed=(i(this,S),i(this,C,!0)),this.maxDepth=(i(this,$),i(this,D,3)),this.showToggle=(i(this,T),i(this,E,!0)),this.column=(i(this,A),i(this,j,null)),this.rowData=(i(this,F),i(this,L,null)),this.align=(i(this,z),i(this,O,"left")),this.type=(i(this,B),i(this,M,"json")),i(this,P)}})})(),(()=>{let t,s,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C=[e.element("snice-cell-currency")],$=[],D=HTMLElement,T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[],K=[],G=[],_=[],X=[],Z=[],Q=[];(class extends D{static{s=this}static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({})],c=[e.property({type:Object})],h=[e.property({type:Object})],d=[e.query(".cell-content")],u=[e.property({type:Number})],p=[e.property({type:Boolean,attribute:"thousands-separator"})],m=[e.property({type:String})],g=[e.property({type:String})],y=[e.property({type:String})],v=[e.property({type:String,attribute:"negative-style"})],b=[e.property({type:Boolean})],f=[e.render()],w=[e.styles()],k=[e.ready()],x=[e.watch("align")],S=[e.watch("value","column")],a(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:n},null,T),a(this,null,w,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:n},null,T),a(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:n},null,T),a(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:n},null,T),a(this,null,S,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:n},null,T),a(null,null,l,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:n},E,A),a(null,null,r,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:n},j,F),a(null,null,o,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:n},L,z),a(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:n},O,B),a(null,null,h,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:n},M,P),a(null,null,d,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:n},V,N),a(null,null,u,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:t=>"decimals"in t,get:t=>t.decimals,set:(t,e)=>{t.decimals=e}},metadata:n},H,I),a(null,null,p,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:t=>"thousandsSeparator"in t,get:t=>t.thousandsSeparator,set:(t,e)=>{t.thousandsSeparator=e}},metadata:n},R,q),a(null,null,m,{kind:"field",name:"currency",static:!1,private:!1,access:{has:t=>"currency"in t,get:t=>t.currency,set:(t,e)=>{t.currency=e}},metadata:n},W,Y),a(null,null,g,{kind:"field",name:"currencyDisplay",static:!1,private:!1,access:{has:t=>"currencyDisplay"in t,get:t=>t.currencyDisplay,set:(t,e)=>{t.currencyDisplay=e}},metadata:n},U,J),a(null,null,y,{kind:"field",name:"locale",static:!1,private:!1,access:{has:t=>"locale"in t,get:t=>t.locale,set:(t,e)=>{t.locale=e}},metadata:n},K,G),a(null,null,v,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:t=>"negativeStyle"in t,get:t=>t.negativeStyle,set:(t,e)=>{t.negativeStyle=e}},metadata:n},_,X),a(null,null,b,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:t=>"highlight"in t,get:t=>t.highlight,set:(t,e)=>{t.highlight=e}},metadata:n},Z,Q),a(null,t={value:s},C,{kind:"class",name:s.name,metadata:n},null,$),s=t.value,n&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),i(s,$)}render(){const t=this.formatCurrencyValue(),a=this.getCurrencyStyles();return e.html`
357
+ <div class="cell-content cell-content--number" part="content" style="${a}">
358
+ ${t}
359
+ </div>
360
+ `}styles(){return e.css`${n}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatCurrencyValue(),e=this.getCurrencyStyles();this.contentElement.innerHTML=t,this.contentElement.setAttribute("style",e)}}formatCurrencyValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const t=this.column.currencyFormat||{decimals:this.decimals,currency:this.currency,currencyDisplay:this.currencyDisplay,locale:this.locale,negativeStyle:this.negativeStyle},e=Number(this.value);if(isNaN(e))return String(this.value);try{let a=new Intl.NumberFormat(t.locale||this.locale,{style:"currency",currency:t.currency||this.currency,currencyDisplay:t.currencyDisplay||this.currencyDisplay,minimumFractionDigits:t.decimals??this.decimals,maximumFractionDigits:t.decimals??this.decimals}).format(Math.abs(e));if(e<0){const e=t.negativeStyle??this.negativeStyle;a="parentheses"===e?`(${a})`:`-${a}`}return a}catch(a){let i=e.toFixed(t.decimals??this.decimals);if(this.thousandsSeparator){const t=i.split(".");t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=t.join(".")}return`$${i}`}}getCurrencyStyles(){const t=Number(this.value);if(this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),t<0){this.classList.add("number--negative");"red"===(this.column.currencyFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")}else t>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===t&&this.classList.add("number--zero");return"text-align: right"}constructor(){super(...arguments),this.align=(i(this,T),i(this,E,"right")),this.type=(i(this,A),i(this,j,"currency")),this.value=(i(this,F),i(this,L,"")),this.column=(i(this,z),i(this,O,{key:"",label:"",type:"currency",align:"right"})),this.rowData=(i(this,B),i(this,M,null)),this.contentElement=(i(this,P),i(this,V,void 0)),this.decimals=(i(this,N),i(this,H,2)),this.thousandsSeparator=(i(this,I),i(this,R,!0)),this.currency=(i(this,q),i(this,W,"USD")),this.currencyDisplay=(i(this,Y),i(this,U,"symbol")),this.locale=(i(this,J),i(this,K,"en-US")),this.negativeStyle=(i(this,G),i(this,_,"red")),this.highlight=(i(this,X),i(this,Z,!1)),i(this,Q)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w=[e.element("snice-cell-percentage")],k=[],x=HTMLElement,S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[];(class extends x{static{s=this}static{const W="function"==typeof Symbol&&Symbol.metadata?Object.create(x[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({})],o=[e.property({type:Object})],c=[e.property({type:Object})],h=[e.query(".cell-content")],d=[e.property({type:Number})],u=[e.property({type:Boolean})],p=[e.property({type:Number})],m=[e.property({type:Boolean})],g=[e.render()],y=[e.styles()],v=[e.ready()],b=[e.watch("align")],f=[e.watch("value","column")],a(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:W},null,S),a(this,null,y,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:W},null,S),a(this,null,v,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:W},null,S),a(this,null,b,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:t=>"updateAlignment"in t,get:t=>t.updateAlignment},metadata:W},null,S),a(this,null,f,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:t=>"updateContent"in t,get:t=>t.updateContent},metadata:W},null,S),a(null,null,n,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:W},C,$),a(null,null,l,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:W},D,T),a(null,null,r,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:W},E,A),a(null,null,o,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:W},j,F),a(null,null,c,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:W},L,z),a(null,null,h,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:t=>"contentElement"in t,get:t=>t.contentElement,set:(t,e)=>{t.contentElement=e}},metadata:W},O,B),a(null,null,d,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:t=>"decimals"in t,get:t=>t.decimals,set:(t,e)=>{t.decimals=e}},metadata:W},M,P),a(null,null,u,{kind:"field",name:"showTrend",static:!1,private:!1,access:{has:t=>"showTrend"in t,get:t=>t.showTrend,set:(t,e)=>{t.showTrend=e}},metadata:W},V,N),a(null,null,p,{kind:"field",name:"trendValue",static:!1,private:!1,access:{has:t=>"trendValue"in t,get:t=>t.trendValue,set:(t,e)=>{t.trendValue=e}},metadata:W},H,I),a(null,null,m,{kind:"field",name:"colorize",static:!1,private:!1,access:{has:t=>"colorize"in t,get:t=>t.colorize,set:(t,e)=>{t.colorize=e}},metadata:W},R,q),a(null,t={value:s},w,{kind:"class",name:s.name,metadata:W},null,k),s=t.value,W&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:W}),i(s,k)}render(){const t=this.formatPercentageValue(),a=this.getTrendArrow(),i=this.getPercentageStyles();return e.html`
361
+ <div class="cell-content cell-content--percentage" part="content" style="${i}">
362
+ ${t}
363
+ ${this.showTrend&&a?e.unsafeHTML(`<span class="percentage-trend">${a}</span>`):""}
364
+ </div>
365
+ `}styles(){return e.css`${":host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;word-wrap:break-word;display:flex;align-items:center;justify-content:flex-end;gap:.375rem}.cell-content--percentage{font-feature-settings:'tnum'}.percentage-trend{display:inline-flex;align-items:center;font-size:1rem;margin-left:.25rem}:host(.percentage--positive){color:var(--snice-color-success)}:host(.percentage--negative){color:var(--snice-color-danger)}:host(.percentage--zero){color:var(--snice-color-text-secondary)}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success)}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger)}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary)}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text);font-size:.75rem}.percentage-trend{font-size:.875rem}}"}`}init(){this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const t=this.formatPercentageValue(),e=this.getTrendArrow(),a=this.getPercentageStyles(),i=this.showTrend&&e?`<span class="percentage-trend">${e}</span>`:"";this.contentElement.innerHTML=t+i,this.contentElement.setAttribute("style",a)}}formatPercentageValue(){if(null===this.value||void 0===this.value||""===this.value)return"";if(this.column?.formatter)return this.column.formatter(this.value,this.rowData);const t=this.column?.percentageFormat||{decimals:this.decimals,showTrend:this.showTrend,trendValue:this.trendValue,colorize:this.colorize},e=Number(this.value);if(isNaN(e))return String(this.value);return`${e.toFixed(t.decimals??this.decimals)}%`}getTrendArrow(){const t=this.column?.percentageFormat?.trendValue??this.trendValue;return null==t?"":t>0?"↑":t<0?"↓":"→"}getPercentageStyles(){const t=Number(this.value),e=this.column?.percentageFormat?.colorize??this.colorize;this.classList.remove("percentage--positive","percentage--negative","percentage--zero"),e&&(t>0?this.classList.add("percentage--positive"):t<0?this.classList.add("percentage--negative"):0===t&&this.classList.add("percentage--zero"));const a=this.column?.percentageFormat?.trendValue??this.trendValue;return this.classList.remove("percentage--trend-up","percentage--trend-down","percentage--trend-neutral"),null!=a&&(a>0?this.classList.add("percentage--trend-up"):a<0?this.classList.add("percentage--trend-down"):this.classList.add("percentage--trend-neutral")),"text-align: right"}constructor(){super(...arguments),this.align=(i(this,S),i(this,C,"right")),this.type=(i(this,$),i(this,D,"percentage")),this.value=(i(this,T),i(this,E,"")),this.column=(i(this,A),i(this,j,null)),this.rowData=(i(this,F),i(this,L,null)),this.contentElement=(i(this,z),i(this,O,void 0)),this.decimals=(i(this,B),i(this,M,2)),this.showTrend=(i(this,P),i(this,V,!1)),this.trendValue=(i(this,N),i(this,H,null)),this.colorize=(i(this,I),i(this,R,!0)),i(this,q)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w=[e.element("snice-cell-location")],k=[],x=HTMLElement,S=[],C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[],N=[],H=[],I=[],R=[],q=[],W=[],Y=[];(class extends x{static{s=this}static{const U="function"==typeof Symbol&&Symbol.metadata?Object.create(x[Symbol.metadata]??null):void 0;n=[e.property({type:String})],l=[e.property({type:String})],r=[e.property({type:String})],o=[e.property({type:String})],c=[e.property({type:Boolean})],h=[e.property({type:String})],d=[e.property({type:Boolean})],u=[e.property({type:Object})],p=[e.property({type:Object})],m=[e.property({type:String})],g=[e.property({type:String})],y=[e.render()],v=[e.styles()],b=[e.ready()],f=[e.watch("value","column")],a(this,null,y,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:U},null,S),a(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:U},null,S),a(this,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:U},null,S),a(this,null,f,{kind:"method",name:"updateLocationAttributes",static:!1,private:!1,access:{has:t=>"updateLocationAttributes"in t,get:t=>t.updateLocationAttributes},metadata:U},null,S),a(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:U},C,$),a(null,null,l,{kind:"field",name:"address",static:!1,private:!1,access:{has:t=>"address"in t,get:t=>t.address,set:(t,e)=>{t.address=e}},metadata:U},D,T),a(null,null,r,{kind:"field",name:"latitude",static:!1,private:!1,access:{has:t=>"latitude"in t,get:t=>t.latitude,set:(t,e)=>{t.latitude=e}},metadata:U},E,A),a(null,null,o,{kind:"field",name:"longitude",static:!1,private:!1,access:{has:t=>"longitude"in t,get:t=>t.longitude,set:(t,e)=>{t.longitude=e}},metadata:U},j,F),a(null,null,c,{kind:"field",name:"showMapLink",static:!1,private:!1,access:{has:t=>"showMapLink"in t,get:t=>t.showMapLink,set:(t,e)=>{t.showMapLink=e}},metadata:U},L,z),a(null,null,h,{kind:"field",name:"mapProvider",static:!1,private:!1,access:{has:t=>"mapProvider"in t,get:t=>t.mapProvider,set:(t,e)=>{t.mapProvider=e}},metadata:U},O,B),a(null,null,d,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:t=>"showIcon"in t,get:t=>t.showIcon,set:(t,e)=>{t.showIcon=e}},metadata:U},M,P),a(null,null,u,{kind:"field",name:"column",static:!1,private:!1,access:{has:t=>"column"in t,get:t=>t.column,set:(t,e)=>{t.column=e}},metadata:U},V,N),a(null,null,p,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:t=>"rowData"in t,get:t=>t.rowData,set:(t,e)=>{t.rowData=e}},metadata:U},H,I),a(null,null,m,{kind:"field",name:"align",static:!1,private:!1,access:{has:t=>"align"in t,get:t=>t.align,set:(t,e)=>{t.align=e}},metadata:U},R,q),a(null,null,g,{kind:"field",name:"type",static:!1,private:!1,access:{has:t=>"type"in t,get:t=>t.type,set:(t,e)=>{t.type=e}},metadata:U},W,Y),a(null,t={value:s},w,{kind:"class",name:s.name,metadata:U},null,k),s=t.value,U&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:U}),i(s,k)}render(){const t=this.address||this.value,a=this.showIcon?'<span class="location-icon">📍</span>':"",i=this.getMapLink();if(!t&&!this.latitude&&!this.longitude)return e.html`
366
+ <div class="cell-content cell-content--location" part="content">
367
+ <span class="location-empty"></span>
368
+ </div>
369
+ `;const s=t||`${this.latitude}, ${this.longitude}`;return e.html`
370
+ <div class="cell-content cell-content--location" part="content">
371
+ ${e.unsafeHTML(a)}
372
+ ${this.showMapLink&&i?e.html`<a href="${i}" target="_blank" rel="noopener noreferrer" class="location-link" part="link">
373
+ ${s}
374
+ </a>`:e.html`<span class="location-text">${s}</span>`}
375
+ </div>
376
+ `}styles(){return e.css`${':host{color:var(--snice-color-text);display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.location-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.location-link{color:var(--snice-color-primary);text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-dark);text-decoration:underline}.location-link:focus{outline:2px solid var(--snice-color-primary);outline-offset:2px;border-radius:2px}.location-link:visited{color:var(--snice-color-secondary)}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text)}.location-empty{color:var(--snice-color-text-secondary);font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text);font-size:.75rem;line-height:1rem}.location-icon{font-size:.75rem}}@media print{.location-link{text-decoration:underline}.location-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary)}.location-icon{display:none}}'}`}init(){this.updateLocationAttributes()}updateLocationAttributes(){if(this.column?.locationFormat){const t=this.column.locationFormat;this.address=t.address||this.value,this.latitude=t.latitude?String(t.latitude):"",this.longitude=t.longitude?String(t.longitude):"",this.showMapLink=t.showMapLink??!0,this.mapProvider=t.mapProvider||"google",this.showIcon=t.showIcon??!0}}getMapLink(){if(!this.showMapLink)return"";const t=this.address||this.value,e=this.latitude,a=this.longitude;switch(this.mapProvider){case"google":return e&&a?`https://www.google.com/maps?q=${e},${a}`:t?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(t)}`:"";case"openstreetmap":return e&&a?`https://www.openstreetmap.org/?mlat=${e}&mlon=${a}&zoom=15`:t?`https://www.openstreetmap.org/search?query=${encodeURIComponent(t)}`:"";case"apple":return e&&a?`https://maps.apple.com/?ll=${e},${a}`:t?`https://maps.apple.com/?address=${encodeURIComponent(t)}`:"";default:return""}}constructor(){super(...arguments),this.value=(i(this,S),i(this,C,"")),this.address=(i(this,$),i(this,D,"")),this.latitude=(i(this,T),i(this,E,"")),this.longitude=(i(this,A),i(this,j,"")),this.showMapLink=(i(this,F),i(this,L,!0)),this.mapProvider=(i(this,z),i(this,O,"google")),this.showIcon=(i(this,B),i(this,M,!0)),this.column=(i(this,P),i(this,V,null)),this.rowData=(i(this,N),i(this,H,null)),this.align=(i(this,I),i(this,R,"left")),this.type=(i(this,q),i(this,W,"location")),i(this,Y)}})})();(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k=[e.element("snice-row")],x=[],S=HTMLElement,C=[],$=[],D=[],T=[],E=[],A=[],j=[],F=[],L=[],z=[],O=[],B=[],M=[],P=[],V=[];(class extends S{static{s=this}static{const N="function"==typeof Symbol&&Symbol.metadata?Object.create(S[Symbol.metadata]??null):void 0;n=[e.property({type:Boolean})],l=[e.property({type:Boolean})],r=[e.property({type:Boolean})],o=[e.property({type:Boolean})],c=[e.property({type:Object})],h=[e.property({type:Number})],d=[e.property({type:Array})],u=[e.render()],p=[e.styles()],m=[e.ready()],g=[e.watch("selected")],y=[e.watch("hoverable","clickable","selectable")],v=[e.watch("data","columns")],b=[e.dispatch("row-click",{bubbles:!0,composed:!0})],f=[e.dispatch("row-select",{bubbles:!0,composed:!0})],w=[e.dispatch("row-hover",{bubbles:!0,composed:!0})],a(this,null,u,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:N},null,C),a(this,null,p,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:N},null,C),a(this,null,m,{kind:"method",name:"init",static:!1,private:!1,access:{has:t=>"init"in t,get:t=>t.init},metadata:N},null,C),a(this,null,g,{kind:"method",name:"updateSelection",static:!1,private:!1,access:{has:t=>"updateSelection"in t,get:t=>t.updateSelection},metadata:N},null,C),a(this,null,y,{kind:"method",name:"updateRowAttributes",static:!1,private:!1,access:{has:t=>"updateRowAttributes"in t,get:t=>t.updateRowAttributes},metadata:N},null,C),a(this,null,v,{kind:"method",name:"updateCells",static:!1,private:!1,access:{has:t=>"updateCells"in t,get:t=>t.updateCells},metadata:N},null,C),a(this,null,b,{kind:"method",name:"dispatchRowClick",static:!1,private:!1,access:{has:t=>"dispatchRowClick"in t,get:t=>t.dispatchRowClick},metadata:N},null,C),a(this,null,f,{kind:"method",name:"dispatchRowSelect",static:!1,private:!1,access:{has:t=>"dispatchRowSelect"in t,get:t=>t.dispatchRowSelect},metadata:N},null,C),a(this,null,w,{kind:"method",name:"dispatchRowHover",static:!1,private:!1,access:{has:t=>"dispatchRowHover"in t,get:t=>t.dispatchRowHover},metadata:N},null,C),a(null,null,n,{kind:"field",name:"selected",static:!1,private:!1,access:{has:t=>"selected"in t,get:t=>t.selected,set:(t,e)=>{t.selected=e}},metadata:N},$,D),a(null,null,l,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:t=>"hoverable"in t,get:t=>t.hoverable,set:(t,e)=>{t.hoverable=e}},metadata:N},T,E),a(null,null,r,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:t=>"clickable"in t,get:t=>t.clickable,set:(t,e)=>{t.clickable=e}},metadata:N},A,j),a(null,null,o,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:t=>"selectable"in t,get:t=>t.selectable,set:(t,e)=>{t.selectable=e}},metadata:N},F,L),a(null,null,c,{kind:"field",name:"data",static:!1,private:!1,access:{has:t=>"data"in t,get:t=>t.data,set:(t,e)=>{t.data=e}},metadata:N},z,O),a(null,null,h,{kind:"field",name:"index",static:!1,private:!1,access:{has:t=>"index"in t,get:t=>t.index,set:(t,e)=>{t.index=e}},metadata:N},B,M),a(null,null,d,{kind:"field",name:"columns",static:!1,private:!1,access:{has:t=>"columns"in t,get:t=>t.columns,set:(t,e)=>{t.columns=e}},metadata:N},P,V),a(null,t={value:s},k,{kind:"class",name:s.name,metadata:N},null,x),s=t.value,N&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:N}),i(s,x)}extractDataFromAttributes(){const t={};return this.getAttributeNames().filter(t=>t.startsWith("data-")&&"data-column-index"!==t).forEach(e=>{const a=e.slice(5),i=this.getAttribute(e);null!==i&&(t[a]=i)}),t}render(){return e.html`
377
+ <div class="row-container" part="container" @click=${t=>this.handleRowClick(t)} @keydown=${t=>this.handleKeyDown(t)}>
378
+ <if ${this.selectable}>
379
+ ${this.renderCheckbox()}
380
+ </if>
381
+ <div class="cells-container">
382
+ <if ${this.columns&&this.columns.length}>
383
+ ${this.columns.map((t,e)=>this.renderCell(t,e))}
384
+ </if>
385
+ <if ${!this.columns||!this.columns.length}>
386
+ <!-- No columns set yet -->
387
+ </if>
388
+ </div>
389
+ </div>
390
+ `}styles(){return e.css`${":host{display:block;width:100%;min-height:2.5rem}.row-container{display:flex;align-items:stretch;width:100%;min-height:2.5rem;height:2.5rem;background:0 0;color:var(--snice-color-text);border-bottom:1px solid var(--snice-color-border);transition:background-color .15s}.cell{display:flex;align-items:center;border-right:1px solid var(--snice-color-border);min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;word-wrap:break-word;overflow:hidden;color:var(--snice-color-text)}.cell:last-child{border-right:none}.cell--checkbox{width:3rem;min-width:3rem;max-width:3rem;padding:.75rem;justify-content:center}.row-checkbox{width:1rem;height:1rem;cursor:pointer}.cells-container{display:flex;flex:1;align-items:stretch}.cell--text{text-align:left}.cell--accounting,.cell--currency,.cell--fraction,.cell--number,.cell--percent,.cell--scientific{text-align:right;font-variant-numeric:tabular-nums}.cell--date{min-width:8rem;font-variant-numeric:tabular-nums}.cell--boolean{text-align:center;font-size:1rem}.cell--rating{text-align:center;min-width:6rem}.cell--progress{min-width:8rem}.cell--sparkline{text-align:center;min-width:6rem}.cell--duration,.cell--filesize{text-align:right;font-variant-numeric:tabular-nums}:host(.row--hoverable) .row-container:hover{background-color:var(--snice-color-background-secondary)}:host(.row--clickable) .row-container{cursor:pointer}:host(.row--clickable) .row-container:hover{background-color:var(--snice-color-background-tertiary)}:host(.row--selected) .row-container{background-color:var(--snice-color-primary-light)}:host(.row--selected.row--hoverable) .row-container:hover{background-color:var(--snice-color-primary-lighter)}:host(.row--highlighted) .row-container{background-color:var(--snice-color-warning-light)!important;animation:2s ease-out row-highlight-fade}@keyframes row-highlight-fade{0%{background-color:var(--snice-color-warning-lighter)}100%{background-color:var(--snice-color-warning-light)}}:host(:focus) .row-container{outline:2px solid var(--snice-color-primary);outline-offset:-2px}:host(.row--selectable){tabindex:0}:host(.row--striped) .row-container{background-color:var(--snice-color-background-secondary)}:host(.row--bordered) .row-container{border-bottom:1px solid var(--snice-color-border)}:host(.row--small) .cell{padding:.5rem .75rem;min-height:2rem;font-size:.75rem}:host(.row--small) .row-container{min-height:2rem}:host(.row--large) .cell{padding:1rem 1.25rem;min-height:3.5rem;font-size:1rem}:host(.row--large) .row-container{min-height:3.5rem}@media (max-width:768px){.cell{padding:.5rem .75rem;font-size:.875rem}.cell--checkbox{width:2.5rem;min-width:2.5rem;max-width:2.5rem;padding:.5rem}.row-checkbox{width:.875rem;height:.875rem}}:host(.row--loading) .row-container{opacity:.6;pointer-events:none}:host(.row--loading) .row-container::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,hsl(0 0% 100% / .6),transparent);animation:1.5s infinite loading-shimmer}@keyframes loading-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}@media (prefers-reduced-motion:reduce){.row-container{transition:none}:host(.row--highlighted) .row-container{animation:none;background-color:var(--snice-color-warning-light)!important}:host(.row--loading) .row-container::after{animation:none}}@media (prefers-contrast:high){.cell{border-right:1px solid}.row-container{border-bottom:1px solid}:host(.row--selected) .row-container{border:2px solid}}"}`}init(){this.data&&0!==Object.keys(this.data).length||(this.data=this.extractDataFromAttributes()),this.updateRowAttributes(),this.configureCells()}configureCells(){this.columns&&this.columns.forEach((t,e)=>{const a=this.shadowRoot?.querySelector(`[data-column-index="${e}"]`);if(a){const e=this.data[t.key];a.value=e,a.column=t,a.rowData=this.data,"sparkline"===t.type&&Array.isArray(e)&&(a.data=e)}})}updateSelection(){this.updateRowAttributes();const t=this.shadowRoot?.querySelector(".row-checkbox");t&&(t.checked=this.selected)}updateRowAttributes(){this.classList.toggle("row--hoverable",this.hoverable),this.classList.toggle("row--clickable",this.clickable),this.classList.toggle("row--selectable",this.selectable),this.classList.toggle("row--selected",this.selected)}updateCells(){setTimeout(()=>this.configureCells(),0)}handleRowClick(t){const e=t.target;e.matches(".row-checkbox")||e.matches("button, a, .interactive")||(this.clickable&&this.dispatchRowClick(),this.selectable&&this.toggleSelection())}handleChange(t){const e=t.target;if(!e.matches(".row-checkbox"))return;const a=e;this.selected=a.checked,this.dispatchRowSelect()}handleKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.selectable?this.toggleSelection():this.clickable&&this.dispatchRowClick())}renderCheckbox(){return e.html`
391
+ <div class="cell cell--checkbox" part="checkbox-cell">
392
+ <input
393
+ type="checkbox"
394
+ class="row-checkbox"
395
+ ?checked=${this.selected}
396
+ tabindex="-1"
397
+ @change=${t=>this.handleChange(t)}
398
+ />
399
+ </div>
400
+ `}renderCell(t,a){this.data[t.key];const i=this.getCellComponent(t.type);return e.html`
401
+ <div class="cell cell--${t.type}" part="cell" style="${this.getCellStyles(t)}">
402
+ ${e.unsafeHTML(`<${i}\n type="${t.type}"\n align="${t.align||"left"}"\n data-column-index="${a}"\n ></${i}>`)}
263
403
  </div>
264
- `}styles(){return t.css`${n}`}init(){this.applyAlignment(),this.updateSparkline()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}updateSparkline(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}renderSparkline(){if(!(null!==this.value&&void 0!==this.value||this.data&&0!==this.data.length))return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.parseData();if(0===e.length)return`<span style="color: ${getComputedStyle(this).getPropertyValue("--snice-color-text-secondary").trim()}; font-style: italic;">No data</span>`;const t=this.column.sparklineFormat||{type:this.chartType,color:this.color,width:this.width,height:this.height},a=t.width??this.width,i=t.height??this.height,s=t.color??this.color,n=t.type??this.chartType;return this.createCanvas(e,a,i,s,n)}parseData(){if(this.data&&Array.isArray(this.data)&&this.data.length>0)return this.data.map(e=>Number(e)).filter(e=>!isNaN(e));if(Array.isArray(this.value))return this.value.map(e=>Number(e)).filter(e=>!isNaN(e));if("string"==typeof this.value){if(this.value.startsWith("[")&&this.value.endsWith("]"))try{const e=JSON.parse(this.value);if(Array.isArray(e))return e.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}try{return this.value.split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e))}catch{return[]}}return[]}createCanvas(e,t,a,i,s){if(0===e.length)return"";const n=document.createElement("canvas");n.width=t,n.height=a;const l=n.getContext("2d");if(!l)return'<div style="color: red;">Canvas not supported</div>';const r=t-4,o=a-4,c=this.minValue??Math.min(...e),h=(this.maxValue??Math.max(...e))-c||1;l.clearRect(0,0,t,a);let d=i;if(i.startsWith("var(")){const e=i.match(/var\(([^)]+)\)/);e&&(d=getComputedStyle(this).getPropertyValue(e[1].split(",")[0].trim()).trim()||"#3b82f6")}if(l.strokeStyle=d,l.fillStyle=d,l.lineWidth=this.strokeWidth,l.lineCap="round",l.lineJoin="round","line"===s||"area"===s){const t=e.map((t,a)=>[2+a/(e.length-1)*r,2+o-(t-c)/h*o]);"area"===s&&(l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.lineTo(t[t.length-1][0],a-2),l.lineTo(t[0][0],a-2),l.closePath(),l.globalAlpha=.3,l.fill(),l.globalAlpha=1),l.beginPath(),l.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>l.lineTo(e,t)),l.stroke(),this.showDots&&t.forEach(([e,t])=>{l.beginPath(),l.arc(e,t,1.5,0,2*Math.PI),l.fill()})}else if("bar"===s){const t=r/e.length*.8,a=r/e.length*.2;e.forEach((e,i)=>{const s=(e-c)/h*o,n=2+i*(t+a),r=2+o-s;l.fillRect(n,r,t,s)})}try{return`<img src="${n.toDataURL("image/png")}" width="${t}" height="${a}" alt="Sparkline chart" style="display: block; vertical-align: middle;">`}catch(e){return console.error("Error creating canvas image:",e),'<div style="color: red;">Canvas error</div>'}}constructor(){super(...arguments),this.align=(i(this,O),i(this,N,"left")),this.type=(i(this,B),i(this,z,"sparkline")),this.value=(i(this,M),i(this,V,"")),this.column=(i(this,j),i(this,F,{key:"",label:"",type:"sparkline",align:"left"})),this.rowData=(i(this,I),i(this,q,null)),this.contentElement=(i(this,P),i(this,R,void 0)),this.chartType=(i(this,H),i(this,Y,"line")),this.color=(i(this,W),i(this,U,"var(--snice-color-primary)")),this.width=(i(this,K),i(this,G,80)),this.height=(i(this,J),i(this,X,24)),this.showDots=(i(this,Z),i(this,Q,!1)),this.showBaseline=(i(this,_),i(this,ee,!1)),this.strokeWidth=(i(this,te),i(this,ae,1.5)),this.minValue=(i(this,ie),i(this,se,void 0)),this.maxValue=(i(this,ne),i(this,le,void 0)),this.data=(i(this,re),i(this,oe,[])),i(this,ce)}})})();let l=(()=>{let e,s,n,l,r,o,c,h,d,u,p,m,g,v,b,y,f,w,k,x,S,C,E,$,D,A,T,L,O,N,B,z,M,V,j=[t.element("snice-table")],F=[],I=HTMLElement,q=[],P=[],R=[],H=[],Y=[],W=[],U=[],K=[],G=[],J=[],X=[],Z=[],Q=[],_=[],ee=[],te=[],ae=[],ie=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],he=[],de=[],ue=[],pe=[],me=[],ge=[],ve=[],be=[],ye=[],fe=[],we=[];return class extends I{static{s=this}constructor(){super(...arguments),this.striped=(i(this,q),i(this,P,!1)),this.searchable=(i(this,R),i(this,H,!1)),this.filterable=(i(this,Y),i(this,W,!1)),this.sortable=(i(this,U),i(this,K,!1)),this.selectable=(i(this,G),i(this,J,!1)),this.hoverable=(i(this,X),i(this,Z,!0)),this.clickable=(i(this,Q),i(this,_,!1)),this.list=(i(this,ee),i(this,te,!1)),this.searchDebounce=(i(this,ae),i(this,ie,500)),this.columns=(i(this,se),[]),this.data=[],this.currentSort=i(this,ne,[]),this.searchText=(i(this,le),""),this.selector=i(this,re,""),this.selectorOptions=(i(this,oe),i(this,ce,[])),this.loading=(i(this,he),i(this,de,!1)),this.selectedRows=(i(this,ue),i(this,pe,[])),this.table=(i(this,me),i(this,ge,void 0)),this.thead=(i(this,ve),i(this,be,void 0)),this.tbody=(i(this,ye),i(this,fe,void 0)),this.dataRequestTimeout=(i(this,we),null),this.handleClick=e=>{const t=e.target,a=t.closest("th.sortable");if(a){const e=a.getAttribute("data-key");return void(e&&this.toggleSort(e,!0))}const i=t.closest("tbody tr");if(i){if(t.matches('input[type="checkbox"], button, a, .interactive'))return;const e=parseInt(i.getAttribute("data-index")||"0"),a=this.data[e];if(this.selectable){const t=this.selectedRows.includes(e);this.selectedRows=t?this.selectedRows.filter(t=>t!==e):[...this.selectedRows,e],this.updateRowSelectionState(),this.updateSelectAllState(),this.dispatchRowSelectionChanged(e,!t)}this.clickable&&this.dispatchEvent(new CustomEvent("row-clicked",{detail:{rowData:a,rowIndex:e}}))}},this.handleChange=e=>{const t=e.target;if(t.matches(".row-select")){const e=t,a=parseInt(e.getAttribute("data-row-index")||"0");return e.checked?this.selectedRows.includes(a)||(this.selectedRows=[...this.selectedRows,a]):this.selectedRows=this.selectedRows.filter(e=>e!==a),this.updateRowSelectionState(),this.updateSelectAllState(),void this.dispatchRowSelectionChanged(a,e.checked)}if(t.matches(".select-all")){const e=t;e.checked?this.selectedRows=this.data.map((e,t)=>t):this.selectedRows=[],this.updateRowSelectionState(),this.dispatchSelectAllChanged(e.checked)}},this.onAttached=()=>{this.getTableConfig(),this.getTableData()},this.searchDebounceTimeout=null,this.handleSearchInput=e=>{const t=e.target;this.searchText=t.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},this.searchDebounce)},this.selectorDebounceTimeout=null,this.handleSelectorChange=e=>{this.selector=Array.isArray(e.detail.value)?e.detail.value.join(","):e.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)}}static{const ke="function"==typeof Symbol&&Symbol.metadata?Object.create(I[Symbol.metadata]??null):void 0;n=[t.property({type:Boolean,attribute:"striped"})],l=[t.property({type:Boolean,attribute:"searchable"})],r=[t.property({type:Boolean,attribute:"filterable"})],o=[t.property({type:Boolean,attribute:"sortable"})],c=[t.property({type:Boolean,attribute:"selectable"})],h=[t.property({type:Boolean,attribute:"hoverable"})],d=[t.property({type:Boolean,attribute:"clickable"})],u=[t.property({type:Boolean,attribute:"list"})],p=[t.property({type:Number,attribute:"search-debounce"})],m=[t.property({type:Array,attribute:"current-sort"})],g=[t.property({type:String,attribute:"selector"})],v=[t.property({type:Array,attribute:"selector-options"})],b=[t.property({type:Boolean,attribute:"loading"})],y=[t.property({type:Array,attribute:"selected-rows"})],f=[t.query("table")],w=[t.query("thead")],k=[t.query("tbody")],x=[t.request("@snice/table/config")],S=[t.request("@snice/table/data")],C=[t.styles()],E=[t.render()],$=[t.ready()],D=[t.watch("selector-options")],A=[t.watch("sortable")],T=[t.watch("selectable")],L=[t.watch("columns")],O=[t.watch("data","loading")],N=[t.watch("selected-rows")],B=[t.watch("current-sort")],z=[t.watch("searchable","filterable")],M=[t.dispatch("table-row-selection-changed",{bubbles:!0,composed:!0})],V=[t.dispatch("table-select-all-changed",{bubbles:!0,composed:!0})],a(this,null,x,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:e=>"getTableConfig"in e,get:e=>e.getTableConfig},metadata:ke},null,q),a(this,null,S,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:e=>"getTableData"in e,get:e=>e.getTableData},metadata:ke},null,q),a(this,null,C,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:ke},null,q),a(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:ke},null,q),a(this,null,$,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:ke},null,q),a(this,null,D,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:e=>"handleSelectorOptionsChange"in e,get:e=>e.handleSelectorOptionsChange},metadata:ke},null,q),a(this,null,A,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:e=>"handleSortableChange"in e,get:e=>e.handleSortableChange},metadata:ke},null,q),a(this,null,T,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:e=>"handleSelectableChange"in e,get:e=>e.handleSelectableChange},metadata:ke},null,q),a(this,null,L,{kind:"method",name:"handleColumnsChange",static:!1,private:!1,access:{has:e=>"handleColumnsChange"in e,get:e=>e.handleColumnsChange},metadata:ke},null,q),a(this,null,O,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:e=>"handleDataChange"in e,get:e=>e.handleDataChange},metadata:ke},null,q),a(this,null,N,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:e=>"handleSelectedRowsChange"in e,get:e=>e.handleSelectedRowsChange},metadata:ke},null,q),a(this,null,B,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:e=>"handleSortChange"in e,get:e=>e.handleSortChange},metadata:ke},null,q),a(this,null,z,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:e=>"handleControlsChange"in e,get:e=>e.handleControlsChange},metadata:ke},null,q),a(this,null,M,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchRowSelectionChanged"in e,get:e=>e.dispatchRowSelectionChanged},metadata:ke},null,q),a(this,null,V,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectAllChanged"in e,get:e=>e.dispatchSelectAllChanged},metadata:ke},null,q),a(null,null,n,{kind:"field",name:"striped",static:!1,private:!1,access:{has:e=>"striped"in e,get:e=>e.striped,set:(e,t)=>{e.striped=t}},metadata:ke},P,R),a(null,null,l,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:ke},H,Y),a(null,null,r,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:ke},W,U),a(null,null,o,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:ke},K,G),a(null,null,c,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:ke},J,X),a(null,null,h,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:ke},Z,Q),a(null,null,d,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:ke},_,ee),a(null,null,u,{kind:"field",name:"list",static:!1,private:!1,access:{has:e=>"list"in e,get:e=>e.list,set:(e,t)=>{e.list=t}},metadata:ke},te,ae),a(null,null,p,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:ke},ie,se),a(null,null,m,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:ke},ne,le),a(null,null,g,{kind:"field",name:"selector",static:!1,private:!1,access:{has:e=>"selector"in e,get:e=>e.selector,set:(e,t)=>{e.selector=t}},metadata:ke},re,oe),a(null,null,v,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:e=>"selectorOptions"in e,get:e=>e.selectorOptions,set:(e,t)=>{e.selectorOptions=t}},metadata:ke},ce,he),a(null,null,b,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:ke},de,ue),a(null,null,y,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:e=>"selectedRows"in e,get:e=>e.selectedRows,set:(e,t)=>{e.selectedRows=t}},metadata:ke},pe,me),a(null,null,f,{kind:"field",name:"table",static:!1,private:!1,access:{has:e=>"table"in e,get:e=>e.table,set:(e,t)=>{e.table=t}},metadata:ke},ge,ve),a(null,null,w,{kind:"field",name:"thead",static:!1,private:!1,access:{has:e=>"thead"in e,get:e=>e.thead,set:(e,t)=>{e.thead=t}},metadata:ke},be,ye),a(null,null,k,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:e=>"tbody"in e,get:e=>e.tbody,set:(e,t)=>{e.tbody=t}},metadata:ke},fe,we),a(null,e={value:s},j,{kind:"class",name:s.name,metadata:ke},null,F),s=e.value,ke&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:ke}),i(s,F)}setData(e){this.data=e,this.render()}setColumns(e){this.columns=e,this.render()}async*getTableConfig(){const e=await(yield{});return this.columns=e.columns||[],this.selectorOptions=e.selectorOptions||[],await new Promise(e=>requestAnimationFrame(e)),this.renderHeader(),this.renderControls(),e}async*getTableData(){this.loading=!0,this.selectedRows=[];try{const e={search:this.searchText,sort:this.currentSort,selector:this.selector},t=await(yield e);return this.data=t.data||[],this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody(),t}catch(e){console.error("Error loading table data:",e),this.data=[],this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody()}}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return t.css`
404
+ `}getCellComponent(t){switch(t){case"text":return"snice-cell-text";case"number":case"accounting":case"scientific":case"fraction":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"sparkline":return"snice-cell-sparkline";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"link":case"url":return"snice-cell-link";case"actions":return"snice-cell-actions";case"tag":case"tags":case"badge":case"badges":return"snice-cell-tag";case"image":case"avatar":case"thumbnail":return"snice-cell-image";case"email":return"snice-cell-email";case"phone":case"tel":case"telephone":return"snice-cell-phone";case"status":return"snice-cell-status";case"color":return"snice-cell-color";case"json":case"object":return"snice-cell-json";case"currency":case"money":return"snice-cell-currency";case"percent":case"percentage":return"snice-cell-percentage";case"location":case"address":case"coordinates":return"snice-cell-location";default:return"snice-cell"}}getCellStyles(t){let e=[];return t.width&&(e.push(`width: ${t.width}`),e.push(`min-width: ${t.width}`),e.push(`max-width: ${t.width}`)),t.align&&e.push(`text-align: ${t.align}`),e.join("; ")}escapeHtml(t){if(null==t)return"";const e=String(t),a=document.createElement("div");return a.textContent=e,a.innerHTML}toggleSelection(){this.selected=!this.selected,this.dispatchRowSelect()}dispatchRowClick(){return{data:this.data,index:this.index,element:this}}dispatchRowSelect(){return{selected:this.selected,data:this.data,index:this.index,element:this}}dispatchRowHover(){return{data:this.data,index:this.index,element:this}}select(){this.selected=!0,this.dispatchRowSelect()}deselect(){this.selected=!1,this.dispatchRowSelect()}focusRow(){super.focus(),this.scrollIntoView({behavior:"smooth",block:"nearest"})}getCellValue(t){return this.data[t]}setCellValue(t,e){this.data={...this.data,[t]:e},this.updateCells()}getCellElement(t){const e=this.columns.find(e=>e.key===t);if(!e)return null;const a=this.columns.indexOf(e);return this.shadowRoot?.querySelector(`[data-column-index="${a}"]`)||null}highlight(t=2e3){this.classList.add("row--highlighted"),setTimeout(()=>{this.classList.remove("row--highlighted")},t)}constructor(){super(...arguments),this.selected=(i(this,C),i(this,$,!1)),this.hoverable=(i(this,D),i(this,T,!0)),this.clickable=(i(this,E),i(this,A,!1)),this.selectable=(i(this,j),i(this,F,!1)),this.data=(i(this,L),i(this,z,{})),this.index=(i(this,O),i(this,B,0)),this.columns=(i(this,M),i(this,P,[])),i(this,V)}})})();let l=(()=>{let t,s,n,l,r,o,c,h,d,u,p,m,g,y,v,b,f,w,k,x,S,C,$,D,T,E,A,j,F,L,z,O,B,M,P=[e.element("snice-table")],V=[],N=HTMLElement,H=[],I=[],R=[],q=[],W=[],Y=[],U=[],J=[],K=[],G=[],_=[],X=[],Z=[],Q=[],tt=[],et=[],at=[],it=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],ht=[],dt=[],ut=[],pt=[],mt=[],gt=[],yt=[],vt=[],bt=[],ft=[],wt=[];return class extends N{static{s=this}constructor(){super(...arguments),this.striped=(i(this,H),i(this,I,!1)),this.searchable=(i(this,R),i(this,q,!1)),this.filterable=(i(this,W),i(this,Y,!1)),this.sortable=(i(this,U),i(this,J,!1)),this.selectable=(i(this,K),i(this,G,!1)),this.hoverable=(i(this,_),i(this,X,!0)),this.clickable=(i(this,Z),i(this,Q,!1)),this.list=(i(this,tt),i(this,et,!1)),this.searchDebounce=(i(this,at),i(this,it,500)),this.columns=(i(this,st),[]),this.data=[],this.currentSort=i(this,nt,[]),this.searchText=(i(this,lt),""),this.selector=i(this,rt,""),this.selectorOptions=(i(this,ot),i(this,ct,[])),this.loading=(i(this,ht),i(this,dt,!1)),this.selectedRows=(i(this,ut),i(this,pt,[])),this.table=(i(this,mt),i(this,gt,void 0)),this.thead=(i(this,yt),i(this,vt,void 0)),this.tbody=(i(this,bt),i(this,ft,void 0)),this.dataRequestTimeout=(i(this,wt),null),this.handleClick=t=>{const e=t.target,a=e.closest("th.sortable");if(a){const t=a.getAttribute("data-key");return void(t&&this.toggleSort(t,!0))}const i=e.closest("tbody tr");if(i){if(e.matches('input[type="checkbox"], button, a, .interactive'))return;const t=parseInt(i.getAttribute("data-index")||"0"),a=this.data[t];if(this.selectable){const e=this.selectedRows.includes(t);this.selectedRows=e?this.selectedRows.filter(e=>e!==t):[...this.selectedRows,t],this.updateRowSelectionState(),this.updateSelectAllState(),this.dispatchRowSelectionChanged(t,!e)}this.clickable&&this.dispatchEvent(new CustomEvent("row-clicked",{detail:{rowData:a,rowIndex:t}}))}},this.handleChange=t=>{const e=t.target;if(e.matches(".row-select")){const t=e,a=parseInt(t.getAttribute("data-row-index")||"0");return t.checked?this.selectedRows.includes(a)||(this.selectedRows=[...this.selectedRows,a]):this.selectedRows=this.selectedRows.filter(t=>t!==a),this.updateRowSelectionState(),this.updateSelectAllState(),void this.dispatchRowSelectionChanged(a,t.checked)}if(e.matches(".select-all")){const t=e;t.checked?this.selectedRows=this.data.map((t,e)=>e):this.selectedRows=[],this.updateRowSelectionState(),this.dispatchSelectAllChanged(t.checked)}},this.onAttached=()=>{this.getTableConfig(),this.getTableData()},this.searchDebounceTimeout=null,this.handleSearchInput=t=>{const e=t.target;this.searchText=e.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},this.searchDebounce)},this.selectorDebounceTimeout=null,this.handleSelectorChange=t=>{this.selector=Array.isArray(t.detail.value)?t.detail.value.join(","):t.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)}}static{const kt="function"==typeof Symbol&&Symbol.metadata?Object.create(N[Symbol.metadata]??null):void 0;n=[e.property({type:Boolean,attribute:"striped"})],l=[e.property({type:Boolean,attribute:"searchable"})],r=[e.property({type:Boolean,attribute:"filterable"})],o=[e.property({type:Boolean,attribute:"sortable"})],c=[e.property({type:Boolean,attribute:"selectable"})],h=[e.property({type:Boolean,attribute:"hoverable"})],d=[e.property({type:Boolean,attribute:"clickable"})],u=[e.property({type:Boolean,attribute:"list"})],p=[e.property({type:Number,attribute:"search-debounce"})],m=[e.property({type:Array,attribute:"current-sort"})],g=[e.property({type:String,attribute:"selector"})],y=[e.property({type:Array,attribute:"selector-options"})],v=[e.property({type:Boolean,attribute:"loading"})],b=[e.property({type:Array,attribute:"selected-rows"})],f=[e.query("table")],w=[e.query("thead")],k=[e.query("tbody")],x=[e.request("table/config")],S=[e.request("table/data")],C=[e.styles()],$=[e.render()],D=[e.ready()],T=[e.watch("selector-options")],E=[e.watch("sortable")],A=[e.watch("selectable")],j=[e.watch("columns")],F=[e.watch("data","loading")],L=[e.watch("selected-rows")],z=[e.watch("current-sort")],O=[e.watch("searchable","filterable")],B=[e.dispatch("table-row-selection-changed",{bubbles:!0,composed:!0})],M=[e.dispatch("table-select-all-changed",{bubbles:!0,composed:!0})],a(this,null,x,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:t=>"getTableConfig"in t,get:t=>t.getTableConfig},metadata:kt},null,H),a(this,null,S,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:t=>"getTableData"in t,get:t=>t.getTableData},metadata:kt},null,H),a(this,null,C,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:kt},null,H),a(this,null,$,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:kt},null,H),a(this,null,D,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:t=>"initialize"in t,get:t=>t.initialize},metadata:kt},null,H),a(this,null,T,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:t=>"handleSelectorOptionsChange"in t,get:t=>t.handleSelectorOptionsChange},metadata:kt},null,H),a(this,null,E,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:t=>"handleSortableChange"in t,get:t=>t.handleSortableChange},metadata:kt},null,H),a(this,null,A,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:t=>"handleSelectableChange"in t,get:t=>t.handleSelectableChange},metadata:kt},null,H),a(this,null,j,{kind:"method",name:"handleColumnsChange",static:!1,private:!1,access:{has:t=>"handleColumnsChange"in t,get:t=>t.handleColumnsChange},metadata:kt},null,H),a(this,null,F,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:t=>"handleDataChange"in t,get:t=>t.handleDataChange},metadata:kt},null,H),a(this,null,L,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:t=>"handleSelectedRowsChange"in t,get:t=>t.handleSelectedRowsChange},metadata:kt},null,H),a(this,null,z,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:t=>"handleSortChange"in t,get:t=>t.handleSortChange},metadata:kt},null,H),a(this,null,O,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:t=>"handleControlsChange"in t,get:t=>t.handleControlsChange},metadata:kt},null,H),a(this,null,B,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:t=>"dispatchRowSelectionChanged"in t,get:t=>t.dispatchRowSelectionChanged},metadata:kt},null,H),a(this,null,M,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:t=>"dispatchSelectAllChanged"in t,get:t=>t.dispatchSelectAllChanged},metadata:kt},null,H),a(null,null,n,{kind:"field",name:"striped",static:!1,private:!1,access:{has:t=>"striped"in t,get:t=>t.striped,set:(t,e)=>{t.striped=e}},metadata:kt},I,R),a(null,null,l,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:t=>"searchable"in t,get:t=>t.searchable,set:(t,e)=>{t.searchable=e}},metadata:kt},q,W),a(null,null,r,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:t=>"filterable"in t,get:t=>t.filterable,set:(t,e)=>{t.filterable=e}},metadata:kt},Y,U),a(null,null,o,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:t=>"sortable"in t,get:t=>t.sortable,set:(t,e)=>{t.sortable=e}},metadata:kt},J,K),a(null,null,c,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:t=>"selectable"in t,get:t=>t.selectable,set:(t,e)=>{t.selectable=e}},metadata:kt},G,_),a(null,null,h,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:t=>"hoverable"in t,get:t=>t.hoverable,set:(t,e)=>{t.hoverable=e}},metadata:kt},X,Z),a(null,null,d,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:t=>"clickable"in t,get:t=>t.clickable,set:(t,e)=>{t.clickable=e}},metadata:kt},Q,tt),a(null,null,u,{kind:"field",name:"list",static:!1,private:!1,access:{has:t=>"list"in t,get:t=>t.list,set:(t,e)=>{t.list=e}},metadata:kt},et,at),a(null,null,p,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:t=>"searchDebounce"in t,get:t=>t.searchDebounce,set:(t,e)=>{t.searchDebounce=e}},metadata:kt},it,st),a(null,null,m,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:t=>"currentSort"in t,get:t=>t.currentSort,set:(t,e)=>{t.currentSort=e}},metadata:kt},nt,lt),a(null,null,g,{kind:"field",name:"selector",static:!1,private:!1,access:{has:t=>"selector"in t,get:t=>t.selector,set:(t,e)=>{t.selector=e}},metadata:kt},rt,ot),a(null,null,y,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:t=>"selectorOptions"in t,get:t=>t.selectorOptions,set:(t,e)=>{t.selectorOptions=e}},metadata:kt},ct,ht),a(null,null,v,{kind:"field",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:kt},dt,ut),a(null,null,b,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:t=>"selectedRows"in t,get:t=>t.selectedRows,set:(t,e)=>{t.selectedRows=e}},metadata:kt},pt,mt),a(null,null,f,{kind:"field",name:"table",static:!1,private:!1,access:{has:t=>"table"in t,get:t=>t.table,set:(t,e)=>{t.table=e}},metadata:kt},gt,yt),a(null,null,w,{kind:"field",name:"thead",static:!1,private:!1,access:{has:t=>"thead"in t,get:t=>t.thead,set:(t,e)=>{t.thead=e}},metadata:kt},vt,bt),a(null,null,k,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:t=>"tbody"in t,get:t=>t.tbody,set:(t,e)=>{t.tbody=e}},metadata:kt},ft,wt),a(null,t={value:s},P,{kind:"class",name:s.name,metadata:kt},null,V),s=t.value,kt&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:kt}),i(s,V)}setData(t){this.data=t,this.render()}setColumns(t){this.columns=t,this.render()}async*getTableConfig(){const t=await(yield{});return this.columns=t.columns||[],this.selectorOptions=t.selectorOptions||[],await new Promise(t=>requestAnimationFrame(t)),this.renderHeader(),this.renderControls(),t}async*getTableData(){this.loading=!0,this.selectedRows=[];try{const t={search:this.searchText,sort:this.currentSort,selector:this.selector},e=await(yield t);return this.data=e.data||[],this.loading=!1,await new Promise(t=>requestAnimationFrame(t)),this.renderBody(),e}catch(t){console.error("Error loading table data:",t),this.data=[],this.loading=!1,await new Promise(t=>requestAnimationFrame(t)),this.renderBody()}}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return e.css`
265
405
  :host {
266
406
  display: block;
267
407
  }
@@ -497,7 +637,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
497
637
  :host([hoverable]) .snice-table--slotted .table-body::slotted(snice-row:hover) {
498
638
  background-color: var(--snice-color-background-tertiary);
499
639
  }
500
- `}render(){return this.querySelectorAll('snice-row[slot="rows"]').length>0?t.html`
640
+ `}render(){return this.querySelectorAll('snice-row[slot="rows"]').length>0?e.html`
501
641
  <div class="snice-table snice-table--slotted" @click=${this.handleClick} @change=${this.handleChange}>
502
642
  <div class="table-controls-container"></div>
503
643
  <div class="table-header" id="slotted-header"></div>
@@ -506,7 +646,7 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
506
646
  </div>
507
647
  <slot name="columns" style="display: none;"></slot>
508
648
  </div>
509
- `:t.html`
649
+ `:e.html`
510
650
  <div class="snice-table" @click=${this.handleClick} @change=${this.handleChange}>
511
651
  <div class="table-controls-container"></div>
512
652
  <table>
@@ -514,5 +654,5 @@ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be lo
514
654
  <tbody></tbody>
515
655
  </table>
516
656
  </div>
517
- `}renderControls(){const e=this.shadowRoot?.querySelector(".table-controls-container");if(!e)return;if(this.searchable||this.filterable){if(0===e.children.length){const t=document.createElement("div");if(t.className="table-controls",t.setAttribute("part","controls"),this.searchable){const e=document.createElement("snice-input");e.className="search-input",e.setAttribute("type","search"),e.setAttribute("placeholder","Search..."),e.setAttribute("size","medium"),e.addEventListener("input",this.handleSearchInput),t.appendChild(e)}if(this.filterable){const e=document.createElement("snice-select");e.className="selector-input",e.setAttribute("multiple",""),e.setAttribute("searchable",""),e.setAttribute("clearable",""),e.setAttribute("placeholder","Filter..."),e.setAttribute("size","medium"),this.selectorOptions.forEach(t=>{const a=document.createElement("snice-option");a.setAttribute("value",t.value),a.textContent=t.label,e.appendChild(a)}),t.appendChild(e)}e.appendChild(t)}}else e.innerHTML=""}async initialize(){this.addEventListener("@snice/controller-attached",this.onAttached),this.addEventListener("select-change",this.handleSelectorChange),await customElements.whenDefined("snice-column"),await customElements.whenDefined("snice-row"),await this.processSlottedContent(),this.renderControls()}async processSlottedContent(){const e=Array.from(this.querySelectorAll('snice-column[slot="columns"]'));if(e.length>0){this.columns=e.map(e=>e.getColumnDefinition());Array.from(this.querySelectorAll('snice-row[slot="rows"]')).forEach((e,t)=>{e.columns=this.columns,e.index=t,e.hoverable=this.hoverable,e.clickable=this.clickable,e.selectable=this.selectable}),requestAnimationFrame(()=>this.renderSlottedHeader())}}renderSlottedHeader(){const e=this.shadowRoot?.querySelector("#slotted-header");e&&0!==this.columns.length&&(e.innerHTML=this.columns.map(e=>`<div class="header-cell">${e.label}</div>`).join(""))}handleSelectorOptionsChange(){0===this.selectorOptions.length?this.classList.add("selector-options-empty"):this.classList.remove("selector-options-empty")}handleSortableChange(){this.renderHeader()}handleSelectableChange(){this.render()}handleColumnsChange(){this.renderHeader()}handleDataChange(){this.renderBody()}handleSelectedRowsChange(){this.updateRowSelectionState(),this.updateSelectAllState()}handleSortChange(){this.renderHeader()}handleControlsChange(){this.renderControls()}renderHeader(){if(!this.thead)return;const e=document.createElement("tr");if(this.selectable){const t=document.createElement("th");t.className="select-column";const a=this.selectedRows.length===this.data.length&&this.data.length>0,i=this.selectedRows.length>0&&this.selectedRows.length<this.data.length;t.innerHTML=`<input type="checkbox" class="select-all" ${a?"checked":""} />`,e.appendChild(t),setTimeout(()=>{const e=t.querySelector(".select-all");e&&(e.indeterminate=i)},0)}this.columns.forEach(t=>{const a=document.createElement("th");a.setAttribute("data-key",t.key),this.sortable&&!1!==t.sortable?(a.classList.add("sortable"),a.setAttribute("role","button"),a.innerHTML=this.renderSortableHeader(t)):a.textContent=t.label,e.appendChild(a)}),this.thead.innerHTML="",this.thead.appendChild(e)}renderSortableHeader(e){const t=this.currentSort.find(t=>t.column===e.key),a=this.currentSort.findIndex(t=>t.column===e.key),i=!!t;let s="▲▼",n="";t&&("asc"===t.direction?s="▲":"desc"===t.direction&&(s="▼"),this.currentSort.length>1&&(n=`<span class="sort-order">${a+1}</span>`));const l=["sort-indicator",i?"active":""].filter(Boolean).join(" ");return`\n <div class="sort-header">\n <span>${e.label}</span>\n <div class="${l}">\n ${s}\n ${n}\n </div>\n </div>\n `}renderBody(){if(!this.tbody)return;if(this.tbody.innerHTML="",0===this.data.length&&this.columns.length>0){if(this.loading){const e=document.createElement("tr"),t=document.createElement("td"),a=this.columns.length+(this.selectable?1:0);return t.colSpan=a,t.className="no-data",t.innerHTML='<snice-progress variant="circular" indeterminate size="small"></snice-progress>',e.appendChild(t),void this.tbody.appendChild(e)}{const e=document.createElement("tr"),t=document.createElement("td"),a=this.columns.length+(this.selectable?1:0);return t.colSpan=a,t.className="no-data",t.textContent="No Data",e.appendChild(t),void this.tbody.appendChild(e)}}const e=document.createDocumentFragment();this.data.forEach((t,a)=>{const i=document.createElement("tr");i.setAttribute("data-index",String(a));const s=this.selectedRows.includes(a);if(i.setAttribute("data-selected",String(s)),this.selectable){const e=document.createElement("td");e.className="select-column",e.innerHTML=`<input type="checkbox" class="row-select" ${s?"checked":""} data-row-index="${a}" />`,i.appendChild(e)}this.columns.forEach(e=>{const a=document.createElement("td"),s=t[e.key],n=this.getCellTagName(e.type),l=this.getCellAttributes(e,s);a.innerHTML=`<${n} ${l}></${n}>`,i.appendChild(a)}),e.appendChild(i)}),this.tbody.appendChild(e)}getCellAttributes(e,t){const a=[`type="${e.type}"`,`align="${e.align||"left"}"`,`value="${String(t||"").replace(/"/g,"&quot;")}"`,'in-table="true"'];return"number"!==e.type&&"currency"!==e.type||(void 0!==e.decimals&&a.push(`decimals="${e.decimals}"`),e.thousandsSeparator&&a.push('thousands-separator="true"'),e.prefix&&a.push(`prefix="${e.prefix}"`),e.suffix&&a.push(`suffix="${e.suffix}"`)),"date"===e.type&&e.dateFormat&&a.push(`date-format="${e.dateFormat}"`),"boolean"===e.type&&(e.useSymbols&&a.push('use-symbols="true"'),e.trueSymbol&&a.push(`true-symbol="${e.trueSymbol}"`),e.falseSymbol&&a.push(`false-symbol="${e.falseSymbol}"`),e.trueValue&&a.push(`true-value="${e.trueValue}"`),e.falseValue&&a.push(`false-value="${e.falseValue}"`)),a.join(" ")}getCellTagName(e){switch(e){case"text":return"snice-cell-text";case"number":case"currency":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"sparkline":return"snice-cell-sparkline";case"image":return"snice-cell-image";default:return"snice-cell"}}updateRowSelectionState(){if(!this.tbody)return;this.tbody.querySelectorAll("tr").forEach((e,t)=>{const a=this.selectedRows.includes(t);e.setAttribute("data-selected",String(a));const i=e.querySelector(".row-select");i&&(i.checked=a)})}updateSelectAllState(){const e=this.thead?.querySelector(".select-all");if(!e)return;const t=this.selectedRows.length===this.data.length,a=this.selectedRows.length>0&&this.selectedRows.length<this.data.length;e.checked=t,e.indeterminate=a}toggleSort(e,t=!1){if(t){const t=this.currentSort.findIndex(t=>t.column===e);if(-1===t)this.currentSort=[...this.currentSort,{column:e,direction:"asc"}];else{"asc"===this.currentSort[t].direction?this.currentSort=this.currentSort.map((e,a)=>a===t?{...e,direction:"desc"}:e):this.currentSort=this.currentSort.filter(t=>t.column!==e)}}else{const t=this.currentSort.find(t=>t.column===e);t?"asc"===t.direction?this.currentSort=[{column:e,direction:"desc"}]:this.currentSort=[]:this.currentSort=[{column:e,direction:"asc"}]}this.renderHeader(),this.debouncedDataRequest()}dispatchRowSelectionChanged(e,t){return{selectedRows:this.selectedRows,rowIndex:e,selected:t}}dispatchSelectAllChanged(e){return{selectedRows:this.selectedRows,allSelected:e}}},s})();return e.SniceTable=l,e}({},Snice);
657
+ `}renderControls(){const t=this.shadowRoot?.querySelector(".table-controls-container");if(!t)return;if(this.searchable||this.filterable){if(0===t.children.length){const e=document.createElement("div");if(e.className="table-controls",e.setAttribute("part","controls"),this.searchable){const t=document.createElement("snice-input");t.className="search-input",t.setAttribute("type","search"),t.setAttribute("placeholder","Search..."),t.setAttribute("size","medium"),t.addEventListener("input",this.handleSearchInput),e.appendChild(t)}if(this.filterable){const t=document.createElement("snice-select");t.className="selector-input",t.setAttribute("multiple",""),t.setAttribute("searchable",""),t.setAttribute("clearable",""),t.setAttribute("placeholder","Filter..."),t.setAttribute("size","medium"),this.selectorOptions.forEach(e=>{const a=document.createElement("snice-option");a.setAttribute("value",e.value),a.textContent=e.label,t.appendChild(a)}),e.appendChild(t)}t.appendChild(e)}}else t.innerHTML=""}async initialize(){this.addEventListener("controller-attached",this.onAttached),this.addEventListener("select-change",this.handleSelectorChange),await customElements.whenDefined("snice-column"),await customElements.whenDefined("snice-row"),await this.processSlottedContent(),this.renderControls()}async processSlottedContent(){const t=Array.from(this.querySelectorAll('snice-column[slot="columns"]'));if(t.length>0){this.columns=t.map(t=>t.getColumnDefinition());Array.from(this.querySelectorAll('snice-row[slot="rows"]')).forEach((t,e)=>{t.columns=this.columns,t.index=e,t.hoverable=this.hoverable,t.clickable=this.clickable,t.selectable=this.selectable}),requestAnimationFrame(()=>this.renderSlottedHeader())}}renderSlottedHeader(){const t=this.shadowRoot?.querySelector("#slotted-header");t&&0!==this.columns.length&&(t.innerHTML=this.columns.map(t=>`<div class="header-cell">${t.label}</div>`).join(""))}handleSelectorOptionsChange(){0===this.selectorOptions.length?this.classList.add("selector-options-empty"):this.classList.remove("selector-options-empty")}handleSortableChange(){this.renderHeader()}handleSelectableChange(){this.render()}handleColumnsChange(){this.renderHeader()}handleDataChange(){this.renderBody()}handleSelectedRowsChange(){this.updateRowSelectionState(),this.updateSelectAllState()}handleSortChange(){this.renderHeader()}handleControlsChange(){this.renderControls()}renderHeader(){if(!this.thead)return;const t=document.createElement("tr");if(this.selectable){const e=document.createElement("th");e.className="select-column";const a=this.selectedRows.length===this.data.length&&this.data.length>0,i=this.selectedRows.length>0&&this.selectedRows.length<this.data.length;e.innerHTML=`<input type="checkbox" class="select-all" ${a?"checked":""} />`,t.appendChild(e),setTimeout(()=>{const t=e.querySelector(".select-all");t&&(t.indeterminate=i)},0)}this.columns.forEach(e=>{const a=document.createElement("th");a.setAttribute("data-key",e.key),this.sortable&&!1!==e.sortable?(a.classList.add("sortable"),a.setAttribute("role","button"),a.innerHTML=this.renderSortableHeader(e)):a.textContent=e.label,t.appendChild(a)}),this.thead.innerHTML="",this.thead.appendChild(t)}renderSortableHeader(t){const e=this.currentSort.find(e=>e.column===t.key),a=this.currentSort.findIndex(e=>e.column===t.key),i=!!e;let s="▲▼",n="";e&&("asc"===e.direction?s="▲":"desc"===e.direction&&(s="▼"),this.currentSort.length>1&&(n=`<span class="sort-order">${a+1}</span>`));const l=["sort-indicator",i?"active":""].filter(Boolean).join(" ");return`\n <div class="sort-header">\n <span>${t.label}</span>\n <div class="${l}">\n ${s}\n ${n}\n </div>\n </div>\n `}renderBody(){if(!this.tbody)return;if(this.tbody.innerHTML="",0===this.data.length&&this.columns.length>0){if(this.loading){const t=document.createElement("tr"),e=document.createElement("td"),a=this.columns.length+(this.selectable?1:0);return e.colSpan=a,e.className="no-data",e.innerHTML='<snice-progress variant="circular" indeterminate size="small"></snice-progress>',t.appendChild(e),void this.tbody.appendChild(t)}{const t=document.createElement("tr"),e=document.createElement("td"),a=this.columns.length+(this.selectable?1:0);return e.colSpan=a,e.className="no-data",e.textContent="No Data",t.appendChild(e),void this.tbody.appendChild(t)}}const t=document.createDocumentFragment();this.data.forEach((e,a)=>{const i=document.createElement("tr");i.setAttribute("data-index",String(a));const s=this.selectedRows.includes(a);if(i.setAttribute("data-selected",String(s)),this.selectable){const t=document.createElement("td");t.className="select-column",t.innerHTML=`<input type="checkbox" class="row-select" ${s?"checked":""} data-row-index="${a}" />`,i.appendChild(t)}this.columns.forEach(t=>{const a=document.createElement("td"),s=e[t.key],n=this.getCellTagName(t.type),l=this.getCellAttributes(t,s);a.innerHTML=`<${n} ${l}></${n}>`,i.appendChild(a)}),t.appendChild(i)}),this.tbody.appendChild(t)}getCellAttributes(t,e){const a=[`type="${t.type}"`,`align="${t.align||"left"}"`,`value="${String(e||"").replace(/"/g,"&quot;")}"`,'in-table="true"'];return"number"!==t.type&&"currency"!==t.type||(void 0!==t.decimals&&a.push(`decimals="${t.decimals}"`),t.thousandsSeparator&&a.push('thousands-separator="true"'),t.prefix&&a.push(`prefix="${t.prefix}"`),t.suffix&&a.push(`suffix="${t.suffix}"`)),"date"===t.type&&t.dateFormat&&a.push(`date-format="${t.dateFormat}"`),"boolean"===t.type&&(t.useSymbols&&a.push('use-symbols="true"'),t.trueSymbol&&a.push(`true-symbol="${t.trueSymbol}"`),t.falseSymbol&&a.push(`false-symbol="${t.falseSymbol}"`),t.trueValue&&a.push(`true-value="${t.trueValue}"`),t.falseValue&&a.push(`false-value="${t.falseValue}"`)),a.join(" ")}getCellTagName(t){switch(t){case"text":return"snice-cell-text";case"number":case"currency":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"sparkline":return"snice-cell-sparkline";case"image":return"snice-cell-image";default:return"snice-cell"}}updateRowSelectionState(){if(!this.tbody)return;this.tbody.querySelectorAll("tr").forEach((t,e)=>{const a=this.selectedRows.includes(e);t.setAttribute("data-selected",String(a));const i=t.querySelector(".row-select");i&&(i.checked=a)})}updateSelectAllState(){const t=this.thead?.querySelector(".select-all");if(!t)return;const e=this.selectedRows.length===this.data.length,a=this.selectedRows.length>0&&this.selectedRows.length<this.data.length;t.checked=e,t.indeterminate=a}toggleSort(t,e=!1){if(e){const e=this.currentSort.findIndex(e=>e.column===t);if(-1===e)this.currentSort=[...this.currentSort,{column:t,direction:"asc"}];else{"asc"===this.currentSort[e].direction?this.currentSort=this.currentSort.map((t,a)=>a===e?{...t,direction:"desc"}:t):this.currentSort=this.currentSort.filter(e=>e.column!==t)}}else{const e=this.currentSort.find(e=>e.column===t);e?"asc"===e.direction?this.currentSort=[{column:t,direction:"desc"}]:this.currentSort=[]:this.currentSort=[{column:t,direction:"asc"}]}this.renderHeader(),this.debouncedDataRequest()}dispatchRowSelectionChanged(t,e){return{selectedRows:this.selectedRows,rowIndex:t,selected:e}}dispatchSelectAllChanged(t){return{selectedRows:this.selectedRows,allSelected:t}}},s})();return t.SniceTable=l,t}({},Snice);
518
658
  //# sourceMappingURL=snice-table.min.js.map