@paperless/core 0.1.0-alpha.281 → 0.1.0-alpha.282

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 (399) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/build/p-07f28695.entry.js +1 -0
  3. package/dist/build/p-105940d9.entry.js +1 -0
  4. package/dist/build/p-12f5c483.entry.js +1 -0
  5. package/dist/build/{p-ad147b1b.entry.js → p-1ba7cadc.entry.js} +1 -1
  6. package/dist/build/{p-7b9cfce0.entry.js → p-1c0ec278.entry.js} +1 -1
  7. package/dist/build/{p-858f7490.entry.js → p-29388966.entry.js} +1 -1
  8. package/dist/build/p-2e47afc7.entry.js +1 -0
  9. package/dist/build/p-35c1d905.entry.js +1 -0
  10. package/dist/build/{p-c11282d2.entry.js → p-3946e0a3.entry.js} +1 -1
  11. package/dist/build/p-39e63e42.entry.js +1 -0
  12. package/dist/{paperless/p-7e40c097.entry.js → build/p-48fd3cac.entry.js} +1 -1
  13. package/dist/build/p-529ccaf7.entry.js +1 -0
  14. package/dist/{paperless/p-c6201d0d.entry.js → build/p-530ddb38.entry.js} +1 -1
  15. package/dist/build/p-56c90fca.entry.js +1 -0
  16. package/dist/build/p-5e574eab.entry.js +1 -0
  17. package/dist/build/p-62d49606.entry.js +1 -0
  18. package/dist/build/p-63de1c3d.entry.js +1 -0
  19. package/dist/build/p-644e6762.entry.js +1 -0
  20. package/dist/build/p-6cc16633.entry.js +1 -0
  21. package/dist/build/p-700b5ce6.entry.js +1 -0
  22. package/dist/build/{p-600a2f21.entry.js → p-7df6230f.entry.js} +1 -1
  23. package/dist/build/p-8f4ba2d4.entry.js +1 -0
  24. package/dist/build/p-91d032b2.entry.js +1 -0
  25. package/dist/build/{p-4588a510.entry.js → p-9315c1e2.entry.js} +1 -1
  26. package/dist/build/p-98e3dcd7.entry.js +1 -0
  27. package/dist/build/p-9f273f07.entry.js +1 -0
  28. package/dist/build/{p-52ab1f62.entry.js → p-ac5a17c4.entry.js} +1 -1
  29. package/dist/build/p-b3363052.entry.js +1 -0
  30. package/dist/build/p-b4af4b21.entry.js +1 -0
  31. package/dist/build/p-b8dd503c.entry.js +1 -0
  32. package/dist/build/p-c2da342f.entry.js +1 -0
  33. package/dist/build/p-c9f2fa8f.js +2 -0
  34. package/dist/{paperless/p-93476bf3.entry.js → build/p-d2cf5ab2.entry.js} +1 -1
  35. package/dist/build/p-d3eb4901.entry.js +1 -0
  36. package/dist/build/p-dbb409ab.entry.js +1 -0
  37. package/dist/build/{p-44d46765.entry.js → p-f499f696.entry.js} +1 -1
  38. package/dist/build/p-f86fcdf4.js +1 -0
  39. package/dist/build/p-fa3216a5.entry.js +1 -0
  40. package/dist/build/paperless.css +1 -392
  41. package/dist/build/paperless.esm.js +1 -1
  42. package/dist/cjs/{index-cf92051a.js → index-195002a8.js} +454 -269
  43. package/dist/cjs/loader.cjs.js +3 -3
  44. package/dist/cjs/p-accordion.cjs.entry.js +2 -10
  45. package/dist/cjs/p-avatar-group.cjs.entry.js +3 -2
  46. package/dist/cjs/p-avatar.cjs.entry.js +5 -8
  47. package/dist/cjs/p-backdrop.cjs.entry.js +4 -9
  48. package/dist/cjs/p-button_3.cjs.entry.js +14 -51
  49. package/dist/cjs/p-card-body.cjs.entry.js +1 -4
  50. package/dist/cjs/p-card-container.cjs.entry.js +2 -8
  51. package/dist/cjs/p-card-header.cjs.entry.js +2 -4
  52. package/dist/cjs/p-content-slider.cjs.entry.js +5 -16
  53. package/dist/cjs/p-counter.cjs.entry.js +2 -8
  54. package/dist/cjs/p-divider.cjs.entry.js +2 -2
  55. package/dist/cjs/p-drawer-body_3.cjs.entry.js +6 -11
  56. package/dist/cjs/p-drawer.cjs.entry.js +18 -18
  57. package/dist/cjs/p-dropdown_3.cjs.entry.js +8 -36
  58. package/dist/cjs/p-helper_2.cjs.entry.js +5 -26
  59. package/dist/cjs/p-illustration_6.cjs.entry.js +31 -82
  60. package/dist/cjs/p-info-panel.cjs.entry.js +3 -7
  61. package/dist/cjs/p-input-group_4.cjs.entry.js +20 -32
  62. package/dist/cjs/p-layout.cjs.entry.js +2 -5
  63. package/dist/cjs/p-modal-body_4.cjs.entry.js +7 -15
  64. package/dist/cjs/p-modal.cjs.entry.js +19 -28
  65. package/dist/cjs/p-navbar.cjs.entry.js +2 -8
  66. package/dist/cjs/p-navigation-item.cjs.entry.js +6 -5
  67. package/dist/cjs/p-page-size-select_3.cjs.entry.js +7 -42
  68. package/dist/cjs/p-profile.cjs.entry.js +2 -8
  69. package/dist/cjs/p-select.cjs.entry.js +12 -29
  70. package/dist/cjs/p-slider-indicator.cjs.entry.js +1 -4
  71. package/dist/cjs/p-status.cjs.entry.js +4 -4
  72. package/dist/cjs/p-stepper-item_2.cjs.entry.js +3 -21
  73. package/dist/cjs/p-stepper.cjs.entry.js +1 -7
  74. package/dist/cjs/p-tab-group.cjs.entry.js +1 -1
  75. package/dist/cjs/p-tab-item.cjs.entry.js +1 -4
  76. package/dist/cjs/p-table-column.cjs.entry.js +3 -13
  77. package/dist/cjs/p-table.cjs.entry.js +12 -57
  78. package/dist/cjs/p-toast-container.cjs.entry.js +2 -5
  79. package/dist/cjs/p-toast.cjs.entry.js +6 -11
  80. package/dist/cjs/paperless.cjs.js +3 -3
  81. package/dist/cjs/{popper-e0c4ed4c.js → popper-d7a0f999.js} +60 -49
  82. package/dist/collection/collection-manifest.json +2 -2
  83. package/dist/collection/components/atoms/avatar/avatar.component.css +1 -27
  84. package/dist/collection/components/atoms/avatar/avatar.component.js +97 -91
  85. package/dist/collection/components/atoms/avatar-group/avatar-group.component.css +1 -18
  86. package/dist/collection/components/atoms/avatar-group/avatar-group.component.js +36 -31
  87. package/dist/collection/components/atoms/backdrop/backdrop.component.css +1 -16
  88. package/dist/collection/components/atoms/backdrop/backdrop.component.js +98 -76
  89. package/dist/collection/components/atoms/button/button.component.css +1 -131
  90. package/dist/collection/components/atoms/button/button.component.js +300 -319
  91. package/dist/collection/components/atoms/card-body/card-body.component.css +1 -9
  92. package/dist/collection/components/atoms/card-body/card-body.component.js +34 -32
  93. package/dist/collection/components/atoms/card-container/card-container.component.css +1 -17
  94. package/dist/collection/components/atoms/card-container/card-container.component.js +51 -52
  95. package/dist/collection/components/atoms/card-header/card-header.component.css +1 -17
  96. package/dist/collection/components/atoms/card-header/card-header.component.js +51 -51
  97. package/dist/collection/components/atoms/counter/counter.component.css +1 -30
  98. package/dist/collection/components/atoms/counter/counter.component.js +51 -52
  99. package/dist/collection/components/atoms/divider/divider.component.css +1 -10
  100. package/dist/collection/components/atoms/divider/divider.component.js +12 -11
  101. package/dist/collection/components/atoms/drawer-body/drawer-body.component.css +1 -5
  102. package/dist/collection/components/atoms/drawer-body/drawer-body.component.js +34 -32
  103. package/dist/collection/components/atoms/drawer-container/drawer-container.component.css +1 -7
  104. package/dist/collection/components/atoms/drawer-container/drawer-container.component.js +37 -9
  105. package/dist/collection/components/atoms/drawer-header/drawer-header.component.css +1 -10
  106. package/dist/collection/components/atoms/drawer-header/drawer-header.component.js +54 -51
  107. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +1 -8
  108. package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +34 -32
  109. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +1 -16
  110. package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +72 -74
  111. package/dist/collection/components/atoms/helper/helper.component.css +1 -7
  112. package/dist/collection/components/atoms/helper/helper.component.js +38 -39
  113. package/dist/collection/components/atoms/icon/icon.component.css +1 -1
  114. package/dist/collection/components/atoms/icon/icon.component.js +98 -100
  115. package/dist/collection/components/atoms/illustration/illustration.component.js +28 -23
  116. package/dist/collection/components/atoms/info-panel/info-panel.component.css +1 -28
  117. package/dist/collection/components/atoms/info-panel/info-panel.component.js +85 -89
  118. package/dist/collection/components/atoms/label/label.component.css +1 -101
  119. package/dist/collection/components/atoms/label/label.component.js +149 -156
  120. package/dist/collection/components/atoms/layout/layout.component.css +1 -73
  121. package/dist/collection/components/atoms/layout/layout.component.js +34 -38
  122. package/dist/collection/components/atoms/loader/loader.component.css +1 -52
  123. package/dist/collection/components/atoms/loader/loader.component.js +108 -113
  124. package/dist/collection/components/atoms/modal-body/modal-body.component.css +1 -7
  125. package/dist/collection/components/atoms/modal-body/modal-body.component.js +34 -32
  126. package/dist/collection/components/atoms/modal-container/modal-container.component.css +1 -6
  127. package/dist/collection/components/atoms/modal-container/modal-container.component.js +52 -31
  128. package/dist/collection/components/atoms/modal-footer/modal-footer.component.css +1 -4
  129. package/dist/collection/components/atoms/modal-footer/modal-footer.component.js +12 -10
  130. package/dist/collection/components/atoms/modal-header/modal-header.component.css +1 -7
  131. package/dist/collection/components/atoms/modal-header/modal-header.component.js +54 -52
  132. package/dist/collection/components/atoms/pagination-item/pagination-item.component.css +1 -16
  133. package/dist/collection/components/atoms/pagination-item/pagination-item.component.js +34 -32
  134. package/dist/collection/components/atoms/segment-container/segment-container.component.css +1 -6
  135. package/dist/collection/components/atoms/segment-container/segment-container.component.js +12 -9
  136. package/dist/collection/components/atoms/segment-item/segment-item.component.css +1 -17
  137. package/dist/collection/components/atoms/segment-item/segment-item.component.js +96 -90
  138. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.css +1 -7
  139. package/dist/collection/components/atoms/slider-indicator/slider-indicator.component.js +33 -30
  140. package/dist/collection/components/atoms/status/status.component.css +1 -16
  141. package/dist/collection/components/atoms/status/status.component.js +97 -93
  142. package/dist/collection/components/atoms/stepper-item/stepper-item.component.css +1 -59
  143. package/dist/collection/components/atoms/stepper-item/stepper-item.component.js +85 -94
  144. package/dist/collection/components/atoms/stepper-line/stepper-line.component.css +1 -18
  145. package/dist/collection/components/atoms/stepper-line/stepper-line.component.js +50 -50
  146. package/dist/collection/components/atoms/tab-group/tab-group.component.css +1 -9
  147. package/dist/collection/components/atoms/tab-group/tab-group.component.js +12 -11
  148. package/dist/collection/components/atoms/tab-item/tab-item.component.css +1 -10
  149. package/dist/collection/components/atoms/tab-item/tab-item.component.js +34 -32
  150. package/dist/collection/components/atoms/table-container/table-container.component.css +1 -5
  151. package/dist/collection/components/atoms/table-container/table-container.component.js +12 -9
  152. package/dist/collection/components/atoms/toast-container/toast-container.component.css +1 -27
  153. package/dist/collection/components/atoms/toast-container/toast-container.component.js +34 -32
  154. package/dist/collection/components/atoms/tooltip/tooltip.component.css +1 -43
  155. package/dist/collection/components/atoms/tooltip/tooltip.component.js +184 -197
  156. package/dist/collection/components/helpers/table-column/table-column.component.js +128 -135
  157. package/dist/collection/components/molecules/accordion/accordion.component.css +1 -3
  158. package/dist/collection/components/molecules/accordion/accordion.component.js +102 -108
  159. package/dist/collection/components/molecules/content-slider/content-slider.component.css +1 -44
  160. package/dist/collection/components/molecules/content-slider/content-slider.component.js +119 -125
  161. package/dist/collection/components/molecules/dropdown/dropdown.component.css +1 -12
  162. package/dist/collection/components/molecules/dropdown/dropdown.component.js +194 -206
  163. package/dist/collection/components/molecules/input-group/input-group.component.css +1 -324
  164. package/dist/collection/components/molecules/input-group/input-group.component.js +276 -281
  165. package/dist/collection/components/molecules/navigation-item/navigation-item.component.css +1 -22
  166. package/dist/collection/components/molecules/navigation-item/navigation-item.component.js +106 -104
  167. package/dist/collection/components/molecules/page-size-select/page-size-select.component.js +161 -180
  168. package/dist/collection/components/molecules/pagination/pagination.component.css +1 -3
  169. package/dist/collection/components/molecules/pagination/pagination.component.js +116 -114
  170. package/dist/collection/components/molecules/profile/profile.component.css +1 -60
  171. package/dist/collection/components/molecules/profile/profile.component.js +57 -63
  172. package/dist/collection/components/molecules/select/select.component.css +1 -6
  173. package/dist/collection/components/molecules/select/select.component.js +418 -426
  174. package/dist/collection/components/molecules/stepper/stepper.component.css +1 -12
  175. package/dist/collection/components/molecules/stepper/stepper.component.js +50 -50
  176. package/dist/collection/components/molecules/table-cell/table-cell.component.css +1 -3
  177. package/dist/collection/components/molecules/table-cell/table-cell.component.js +160 -156
  178. package/dist/collection/components/molecules/table-footer/table-footer.component.css +1 -30
  179. package/dist/collection/components/molecules/table-footer/table-footer.component.js +219 -233
  180. package/dist/collection/components/molecules/table-header/table-header.component.css +1 -16
  181. package/dist/collection/components/molecules/table-header/table-header.component.js +296 -321
  182. package/dist/collection/components/molecules/table-row/table-row.component.css +1 -21
  183. package/dist/collection/components/molecules/table-row/table-row.component.js +51 -54
  184. package/dist/collection/components/molecules/toast/toast.component.css +1 -23
  185. package/dist/collection/components/molecules/toast/toast.component.js +168 -169
  186. package/dist/collection/components/organisms/drawer/drawer.component.js +147 -128
  187. package/dist/collection/components/organisms/modal/modal.component.js +206 -197
  188. package/dist/collection/components/organisms/navbar/navbar.component.css +1 -53
  189. package/dist/collection/components/organisms/navbar/navbar.component.js +71 -81
  190. package/dist/collection/components/organisms/table/table.component.css +1 -3
  191. package/dist/collection/components/organisms/table/table.component.js +828 -869
  192. package/dist/collection/tailwind/animation.js +64 -4
  193. package/dist/components/backdrop.component.js +5 -9
  194. package/dist/components/button.component.js +6 -28
  195. package/dist/components/counter.component.js +1 -7
  196. package/dist/components/divider.component.js +1 -1
  197. package/dist/components/drawer-body.component.js +1 -4
  198. package/dist/components/drawer-container.component.js +6 -3
  199. package/dist/components/drawer-header.component.js +1 -4
  200. package/dist/components/dropdown-menu-container.component.js +1 -4
  201. package/dist/components/dropdown-menu-item.component.js +2 -7
  202. package/dist/components/dropdown.component.js +3 -23
  203. package/dist/components/helper.component.js +1 -4
  204. package/dist/components/icon.component.js +2 -10
  205. package/dist/components/illustration.component.js +1 -0
  206. package/dist/components/input-group.component.js +10 -13
  207. package/dist/components/label.component.js +4 -13
  208. package/dist/components/loader.component.js +5 -12
  209. package/dist/components/modal-body.component.js +1 -4
  210. package/dist/components/modal-container.component.js +5 -6
  211. package/dist/components/modal-footer.component.js +1 -1
  212. package/dist/components/modal-header.component.js +1 -4
  213. package/dist/components/p-accordion.js +1 -9
  214. package/dist/components/p-avatar-group.js +2 -1
  215. package/dist/components/p-avatar.js +4 -7
  216. package/dist/components/p-card-body.js +0 -3
  217. package/dist/components/p-card-container.js +1 -7
  218. package/dist/components/p-card-header.js +1 -3
  219. package/dist/components/p-content-slider.js +4 -15
  220. package/dist/components/p-drawer.js +19 -18
  221. package/dist/components/p-info-panel.js +2 -6
  222. package/dist/components/p-layout.js +1 -4
  223. package/dist/components/p-modal.js +20 -28
  224. package/dist/components/p-navbar.js +1 -7
  225. package/dist/components/p-navigation-item.js +5 -4
  226. package/dist/components/p-profile.js +1 -7
  227. package/dist/components/p-select.js +11 -28
  228. package/dist/components/p-status.js +3 -3
  229. package/dist/components/p-stepper.js +0 -6
  230. package/dist/components/p-tab-item.js +0 -3
  231. package/dist/components/p-table-column.js +2 -12
  232. package/dist/components/p-table.js +11 -56
  233. package/dist/components/p-toast-container.js +1 -4
  234. package/dist/components/p-toast.js +5 -10
  235. package/dist/components/page-size-select.component.js +0 -24
  236. package/dist/components/pagination-item.component.js +1 -4
  237. package/dist/components/pagination.component.js +5 -13
  238. package/dist/components/popper.js +60 -49
  239. package/dist/components/segment-container.component.js +1 -1
  240. package/dist/components/segment-item.component.js +4 -4
  241. package/dist/components/slider-indicator.component.js +0 -3
  242. package/dist/components/stepper-item.component.js +1 -13
  243. package/dist/components/stepper-line.component.js +1 -7
  244. package/dist/components/table-cell.component.js +7 -7
  245. package/dist/components/table-container.component.js +1 -1
  246. package/dist/components/table-footer.component.js +2 -25
  247. package/dist/components/table-header.component.js +11 -33
  248. package/dist/components/table-row.component.js +1 -7
  249. package/dist/components/tooltip.component.js +2 -20
  250. package/dist/esm/{index-7c99f044.js → index-8170b4fb.js} +454 -269
  251. package/dist/esm/loader.js +3 -3
  252. package/dist/esm/p-accordion.entry.js +2 -10
  253. package/dist/esm/p-avatar-group.entry.js +3 -2
  254. package/dist/esm/p-avatar.entry.js +5 -8
  255. package/dist/esm/p-backdrop.entry.js +4 -9
  256. package/dist/esm/p-button_3.entry.js +14 -51
  257. package/dist/esm/p-card-body.entry.js +1 -4
  258. package/dist/esm/p-card-container.entry.js +2 -8
  259. package/dist/esm/p-card-header.entry.js +2 -4
  260. package/dist/esm/p-content-slider.entry.js +5 -16
  261. package/dist/esm/p-counter.entry.js +2 -8
  262. package/dist/esm/p-divider.entry.js +2 -2
  263. package/dist/esm/p-drawer-body_3.entry.js +6 -11
  264. package/dist/esm/p-drawer.entry.js +18 -18
  265. package/dist/esm/p-dropdown_3.entry.js +8 -36
  266. package/dist/esm/p-helper_2.entry.js +5 -26
  267. package/dist/esm/p-illustration_6.entry.js +31 -82
  268. package/dist/esm/p-info-panel.entry.js +3 -7
  269. package/dist/esm/p-input-group_4.entry.js +20 -32
  270. package/dist/esm/p-layout.entry.js +2 -5
  271. package/dist/esm/p-modal-body_4.entry.js +7 -15
  272. package/dist/esm/p-modal.entry.js +19 -28
  273. package/dist/esm/p-navbar.entry.js +2 -8
  274. package/dist/esm/p-navigation-item.entry.js +6 -5
  275. package/dist/esm/p-page-size-select_3.entry.js +7 -42
  276. package/dist/esm/p-profile.entry.js +2 -8
  277. package/dist/esm/p-select.entry.js +12 -29
  278. package/dist/esm/p-slider-indicator.entry.js +1 -4
  279. package/dist/esm/p-status.entry.js +4 -4
  280. package/dist/esm/p-stepper-item_2.entry.js +3 -21
  281. package/dist/esm/p-stepper.entry.js +1 -7
  282. package/dist/esm/p-tab-group.entry.js +1 -1
  283. package/dist/esm/p-tab-item.entry.js +1 -4
  284. package/dist/esm/p-table-column.entry.js +3 -13
  285. package/dist/esm/p-table.entry.js +12 -57
  286. package/dist/esm/p-toast-container.entry.js +2 -5
  287. package/dist/esm/p-toast.entry.js +6 -11
  288. package/dist/esm/paperless.js +3 -3
  289. package/dist/esm/polyfills/css-shim.js +1 -1
  290. package/dist/esm/{popper-41c6f9cd.js → popper-42db9fbd.js} +60 -49
  291. package/dist/index.html +1 -1
  292. package/dist/paperless/p-07f28695.entry.js +1 -0
  293. package/dist/paperless/p-105940d9.entry.js +1 -0
  294. package/dist/paperless/p-12f5c483.entry.js +1 -0
  295. package/dist/paperless/{p-ad147b1b.entry.js → p-1ba7cadc.entry.js} +1 -1
  296. package/dist/paperless/{p-7b9cfce0.entry.js → p-1c0ec278.entry.js} +1 -1
  297. package/dist/paperless/{p-858f7490.entry.js → p-29388966.entry.js} +1 -1
  298. package/dist/paperless/p-2e47afc7.entry.js +1 -0
  299. package/dist/paperless/p-35c1d905.entry.js +1 -0
  300. package/dist/paperless/{p-c11282d2.entry.js → p-3946e0a3.entry.js} +1 -1
  301. package/dist/paperless/p-39e63e42.entry.js +1 -0
  302. package/dist/{build/p-7e40c097.entry.js → paperless/p-48fd3cac.entry.js} +1 -1
  303. package/dist/paperless/p-529ccaf7.entry.js +1 -0
  304. package/dist/{build/p-c6201d0d.entry.js → paperless/p-530ddb38.entry.js} +1 -1
  305. package/dist/paperless/p-56c90fca.entry.js +1 -0
  306. package/dist/paperless/p-5e574eab.entry.js +1 -0
  307. package/dist/paperless/p-62d49606.entry.js +1 -0
  308. package/dist/paperless/p-63de1c3d.entry.js +1 -0
  309. package/dist/paperless/p-644e6762.entry.js +1 -0
  310. package/dist/paperless/p-6cc16633.entry.js +1 -0
  311. package/dist/paperless/p-700b5ce6.entry.js +1 -0
  312. package/dist/paperless/{p-600a2f21.entry.js → p-7df6230f.entry.js} +1 -1
  313. package/dist/paperless/p-8f4ba2d4.entry.js +1 -0
  314. package/dist/paperless/p-91d032b2.entry.js +1 -0
  315. package/dist/paperless/{p-4588a510.entry.js → p-9315c1e2.entry.js} +1 -1
  316. package/dist/paperless/p-98e3dcd7.entry.js +1 -0
  317. package/dist/paperless/p-9f273f07.entry.js +1 -0
  318. package/dist/paperless/{p-52ab1f62.entry.js → p-ac5a17c4.entry.js} +1 -1
  319. package/dist/paperless/p-b3363052.entry.js +1 -0
  320. package/dist/paperless/p-b4af4b21.entry.js +1 -0
  321. package/dist/paperless/p-b8dd503c.entry.js +1 -0
  322. package/dist/paperless/p-c2da342f.entry.js +1 -0
  323. package/dist/paperless/p-c9f2fa8f.js +2 -0
  324. package/dist/{build/p-93476bf3.entry.js → paperless/p-d2cf5ab2.entry.js} +1 -1
  325. package/dist/paperless/p-d3eb4901.entry.js +1 -0
  326. package/dist/paperless/p-dbb409ab.entry.js +1 -0
  327. package/dist/paperless/{p-44d46765.entry.js → p-f499f696.entry.js} +1 -1
  328. package/dist/paperless/p-f86fcdf4.js +1 -0
  329. package/dist/paperless/p-fa3216a5.entry.js +1 -0
  330. package/dist/paperless/paperless.css +678 -886
  331. package/dist/paperless/paperless.esm.js +1 -1
  332. package/dist/sw.js +1 -1
  333. package/dist/sw.js.map +1 -1
  334. package/dist/tailwind/animation.js +64 -4
  335. package/dist/types/components/atoms/backdrop/backdrop.component.d.ts +4 -0
  336. package/dist/types/components/atoms/drawer-container/drawer-container.component.d.ts +4 -0
  337. package/dist/types/components/atoms/modal-container/modal-container.component.d.ts +4 -0
  338. package/dist/types/components/organisms/drawer/drawer.component.d.ts +7 -1
  339. package/dist/types/components/organisms/modal/modal.component.d.ts +7 -1
  340. package/dist/types/components.d.ts +34 -2
  341. package/dist/types/stencil-public-runtime.d.ts +20 -4
  342. package/dist/{workbox-5fe694da.js → workbox-5b279812.js} +2 -2
  343. package/dist/{workbox-5fe694da.js.map → workbox-5b279812.js.map} +1 -1
  344. package/loader/package.json +1 -0
  345. package/package.json +2 -2
  346. package/dist/build/p-055b40ad.entry.js +0 -1
  347. package/dist/build/p-06899ffb.entry.js +0 -1
  348. package/dist/build/p-0818aeaa.entry.js +0 -1
  349. package/dist/build/p-08cd459b.entry.js +0 -1
  350. package/dist/build/p-13bb4d79.entry.js +0 -1
  351. package/dist/build/p-150aadaf.entry.js +0 -1
  352. package/dist/build/p-15d13147.entry.js +0 -1
  353. package/dist/build/p-197075c9.entry.js +0 -1
  354. package/dist/build/p-2a005223.entry.js +0 -1
  355. package/dist/build/p-3180c96e.entry.js +0 -1
  356. package/dist/build/p-337ad423.entry.js +0 -1
  357. package/dist/build/p-41588819.entry.js +0 -1
  358. package/dist/build/p-58dd41be.entry.js +0 -1
  359. package/dist/build/p-5a71d6ae.entry.js +0 -1
  360. package/dist/build/p-7e9a866e.entry.js +0 -1
  361. package/dist/build/p-8614bd10.entry.js +0 -1
  362. package/dist/build/p-86a6c56a.entry.js +0 -1
  363. package/dist/build/p-8f179b0d.entry.js +0 -1
  364. package/dist/build/p-a7086ffa.js +0 -1
  365. package/dist/build/p-b99f2f60.entry.js +0 -1
  366. package/dist/build/p-be2a7816.entry.js +0 -1
  367. package/dist/build/p-c4110c09.entry.js +0 -1
  368. package/dist/build/p-c7bebafd.entry.js +0 -1
  369. package/dist/build/p-d17b038f.entry.js +0 -1
  370. package/dist/build/p-d9c1fe13.js +0 -2
  371. package/dist/build/p-db69c965.entry.js +0 -1
  372. package/dist/build/p-ed78ef52.entry.js +0 -1
  373. package/dist/paperless/p-055b40ad.entry.js +0 -1
  374. package/dist/paperless/p-06899ffb.entry.js +0 -1
  375. package/dist/paperless/p-0818aeaa.entry.js +0 -1
  376. package/dist/paperless/p-08cd459b.entry.js +0 -1
  377. package/dist/paperless/p-13bb4d79.entry.js +0 -1
  378. package/dist/paperless/p-150aadaf.entry.js +0 -1
  379. package/dist/paperless/p-15d13147.entry.js +0 -1
  380. package/dist/paperless/p-197075c9.entry.js +0 -1
  381. package/dist/paperless/p-2a005223.entry.js +0 -1
  382. package/dist/paperless/p-3180c96e.entry.js +0 -1
  383. package/dist/paperless/p-337ad423.entry.js +0 -1
  384. package/dist/paperless/p-41588819.entry.js +0 -1
  385. package/dist/paperless/p-58dd41be.entry.js +0 -1
  386. package/dist/paperless/p-5a71d6ae.entry.js +0 -1
  387. package/dist/paperless/p-7e9a866e.entry.js +0 -1
  388. package/dist/paperless/p-8614bd10.entry.js +0 -1
  389. package/dist/paperless/p-86a6c56a.entry.js +0 -1
  390. package/dist/paperless/p-8f179b0d.entry.js +0 -1
  391. package/dist/paperless/p-a7086ffa.js +0 -1
  392. package/dist/paperless/p-b99f2f60.entry.js +0 -1
  393. package/dist/paperless/p-be2a7816.entry.js +0 -1
  394. package/dist/paperless/p-c4110c09.entry.js +0 -1
  395. package/dist/paperless/p-c7bebafd.entry.js +0 -1
  396. package/dist/paperless/p-d17b038f.entry.js +0 -1
  397. package/dist/paperless/p-d9c1fe13.js +0 -2
  398. package/dist/paperless/p-db69c965.entry.js +0 -1
  399. package/dist/paperless/p-ed78ef52.entry.js +0 -1
@@ -22,6 +22,14 @@ function _interopNamespace(e) {
22
22
 
23
23
  const NAMESPACE = 'paperless';
24
24
 
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
25
33
  let scopeId;
26
34
  let contentRef;
27
35
  let hostTagName;
@@ -30,66 +38,6 @@ let checkSlotFallbackVisibility = false;
30
38
  let checkSlotRelocate = false;
31
39
  let isSvgMode = false;
32
40
  let queuePending = false;
33
- const win = typeof window !== 'undefined' ? window : {};
34
- const doc = win.document || { head: {} };
35
- const plt = {
36
- $flags$: 0,
37
- $resourcesUrl$: '',
38
- jmp: (h) => h(),
39
- raf: (h) => requestAnimationFrame(h),
40
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
41
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
42
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
43
- };
44
- const promiseResolve = (v) => Promise.resolve(v);
45
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
46
- try {
47
- new CSSStyleSheet();
48
- return typeof new CSSStyleSheet().replaceSync === 'function';
49
- }
50
- catch (e) { }
51
- return false;
52
- })()
53
- ;
54
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
55
- if (listeners) {
56
- listeners.map(([flags, name, method]) => {
57
- const target = getHostListenerTarget(elm, flags) ;
58
- const handler = hostListenerProxy(hostRef, method);
59
- const opts = hostListenerOpts(flags);
60
- plt.ael(target, name, handler, opts);
61
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
62
- });
63
- }
64
- };
65
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
66
- try {
67
- {
68
- if (hostRef.$flags$ & 256 /* isListenReady */) {
69
- // instance is ready, let's call it's member method for this event
70
- hostRef.$lazyInstance$[methodName](ev);
71
- }
72
- else {
73
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
74
- }
75
- }
76
- }
77
- catch (e) {
78
- consoleError(e);
79
- }
80
- };
81
- const getHostListenerTarget = (elm, flags) => {
82
- if (flags & 4 /* TargetDocument */)
83
- return doc;
84
- if (flags & 8 /* TargetWindow */)
85
- return win;
86
- if (flags & 16 /* TargetBody */)
87
- return doc.body;
88
- return elm;
89
- };
90
- // prettier-ignore
91
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
92
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
93
41
  const createTime = (fnName, tagName = '') => {
94
42
  {
95
43
  return () => {
@@ -104,76 +52,7 @@ const uniqueTime = (key, measureText) => {
104
52
  };
105
53
  }
106
54
  };
107
- const rootAppliedStyles = new WeakMap();
108
- const registerStyle = (scopeId, cssText, allowCS) => {
109
- let style = styles.get(scopeId);
110
- if (supportsConstructableStylesheets && allowCS) {
111
- style = (style || new CSSStyleSheet());
112
- if (typeof style === 'string') {
113
- style = cssText;
114
- }
115
- else {
116
- style.replaceSync(cssText);
117
- }
118
- }
119
- else {
120
- style = cssText;
121
- }
122
- styles.set(scopeId, style);
123
- };
124
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
125
- let scopeId = getScopeId(cmpMeta);
126
- const style = styles.get(scopeId);
127
- // if an element is NOT connected then getRootNode() will return the wrong root node
128
- // so the fallback is to always use the document for the root node in those cases
129
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
130
- if (style) {
131
- if (typeof style === 'string') {
132
- styleContainerNode = styleContainerNode.head || styleContainerNode;
133
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
134
- let styleElm;
135
- if (!appliedStyles) {
136
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
137
- }
138
- if (!appliedStyles.has(scopeId)) {
139
- {
140
- {
141
- styleElm = doc.createElement('style');
142
- styleElm.innerHTML = style;
143
- }
144
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
145
- }
146
- if (appliedStyles) {
147
- appliedStyles.add(scopeId);
148
- }
149
- }
150
- }
151
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
152
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
153
- }
154
- }
155
- return scopeId;
156
- };
157
- const attachStyles = (hostRef) => {
158
- const cmpMeta = hostRef.$cmpMeta$;
159
- const elm = hostRef.$hostElement$;
160
- const flags = cmpMeta.$flags$;
161
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
162
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
163
- if (flags & 10 /* needsScopedEncapsulation */) {
164
- // only required when we're NOT using native shadow dom (slot)
165
- // or this browser doesn't support native shadow dom
166
- // and this host element was NOT created with SSR
167
- // let's pick out the inner content for slot projection
168
- // create a node to represent where the original
169
- // content was first placed, which is useful later on
170
- // DOM WRITE!!
171
- elm['s-sc'] = scopeId;
172
- elm.classList.add(scopeId + '-h');
173
- }
174
- endAttachStyles();
175
- };
176
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
55
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
177
56
  /**
178
57
  * Default style mode id
179
58
  */
@@ -306,6 +185,149 @@ const convertToPrivate = (node) => {
306
185
  vnode.$name$ = node.vname;
307
186
  return vnode;
308
187
  };
188
+ /**
189
+ * Parse a new property value for a given property type.
190
+ *
191
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
192
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
193
+ * 1. `any`, the type given to `propValue` in the function signature
194
+ * 2. the type stored from `propType`.
195
+ *
196
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
197
+ *
198
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
199
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
200
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
201
+ * ```tsx
202
+ * <my-cmp prop-val={0}></my-cmp>
203
+ * ```
204
+ *
205
+ * HTML prop values on the other hand, will always a string
206
+ *
207
+ * @param propValue the new value to coerce to some type
208
+ * @param propType the type of the prop, expressed as a binary number
209
+ * @returns the parsed/coerced value
210
+ */
211
+ const parsePropertyValue = (propValue, propType) => {
212
+ // ensure this value is of the correct prop type
213
+ if (propValue != null && !isComplexType(propValue)) {
214
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
215
+ // per the HTML spec, any string value means it is a boolean true value
216
+ // but we'll cheat here and say that the string "false" is the boolean false
217
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
218
+ }
219
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
220
+ // force it to be a number
221
+ return parseFloat(propValue);
222
+ }
223
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
224
+ // could have been passed as a number or boolean
225
+ // but we still want it as a string
226
+ return String(propValue);
227
+ }
228
+ // redundant return here for better minification
229
+ return propValue;
230
+ }
231
+ // not sure exactly what type we want
232
+ // so no need to change to a different type
233
+ return propValue;
234
+ };
235
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
236
+ const createEvent = (ref, name, flags) => {
237
+ const elm = getElement(ref);
238
+ return {
239
+ emit: (detail) => {
240
+ return emitEvent(elm, name, {
241
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
242
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
243
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
244
+ detail,
245
+ });
246
+ },
247
+ };
248
+ };
249
+ /**
250
+ * Helper function to create & dispatch a custom Event on a provided target
251
+ * @param elm the target of the Event
252
+ * @param name the name to give the custom Event
253
+ * @param opts options for configuring a custom Event
254
+ * @returns the custom Event
255
+ */
256
+ const emitEvent = (elm, name, opts) => {
257
+ const ev = plt.ce(name, opts);
258
+ elm.dispatchEvent(ev);
259
+ return ev;
260
+ };
261
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
262
+ const registerStyle = (scopeId, cssText, allowCS) => {
263
+ let style = styles.get(scopeId);
264
+ if (supportsConstructableStylesheets && allowCS) {
265
+ style = (style || new CSSStyleSheet());
266
+ if (typeof style === 'string') {
267
+ style = cssText;
268
+ }
269
+ else {
270
+ style.replaceSync(cssText);
271
+ }
272
+ }
273
+ else {
274
+ style = cssText;
275
+ }
276
+ styles.set(scopeId, style);
277
+ };
278
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
279
+ let scopeId = getScopeId(cmpMeta);
280
+ const style = styles.get(scopeId);
281
+ // if an element is NOT connected then getRootNode() will return the wrong root node
282
+ // so the fallback is to always use the document for the root node in those cases
283
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
284
+ if (style) {
285
+ if (typeof style === 'string') {
286
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
287
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
288
+ let styleElm;
289
+ if (!appliedStyles) {
290
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
291
+ }
292
+ if (!appliedStyles.has(scopeId)) {
293
+ {
294
+ {
295
+ styleElm = doc.createElement('style');
296
+ styleElm.innerHTML = style;
297
+ }
298
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
299
+ }
300
+ if (appliedStyles) {
301
+ appliedStyles.add(scopeId);
302
+ }
303
+ }
304
+ }
305
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
306
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
307
+ }
308
+ }
309
+ return scopeId;
310
+ };
311
+ const attachStyles = (hostRef) => {
312
+ const cmpMeta = hostRef.$cmpMeta$;
313
+ const elm = hostRef.$hostElement$;
314
+ const flags = cmpMeta.$flags$;
315
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
316
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
317
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
318
+ // only required when we're NOT using native shadow dom (slot)
319
+ // or this browser doesn't support native shadow dom
320
+ // and this host element was NOT created with SSR
321
+ // let's pick out the inner content for slot projection
322
+ // create a node to represent where the original
323
+ // content was first placed, which is useful later on
324
+ // DOM WRITE!!
325
+ elm['s-sc'] = scopeId;
326
+ elm.classList.add(scopeId + '-h');
327
+ }
328
+ endAttachStyles();
329
+ };
330
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
309
331
  /**
310
332
  * Production setAccessor() function based on Preact by
311
333
  * Jason Miller (@developit)
@@ -423,7 +445,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
423
445
  }
424
446
  }
425
447
  }
426
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
448
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
427
449
  newValue = newValue === true ? '' : newValue;
428
450
  {
429
451
  elm.setAttribute(memberName, newValue);
@@ -438,7 +460,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
438
460
  // if the element passed in is a shadow root, which is a document fragment
439
461
  // then we want to be adding attrs/props to the shadow root's "host" element
440
462
  // if it's not a shadow root, then we add attrs/props to the same element
441
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
463
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
442
464
  ? newVnode.$elm$.host
443
465
  : newVnode.$elm$;
444
466
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
@@ -456,6 +478,16 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
456
478
  setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
457
479
  }
458
480
  };
481
+ /**
482
+ * Create a DOM Node corresponding to one of the children of a given VNode.
483
+ *
484
+ * @param oldParentVNode the parent VNode from the previous render
485
+ * @param newParentVNode the parent VNode from the current render
486
+ * @param childIndex the index of the VNode, in the _new_ parent node's
487
+ * children, for which we will create a new DOM node
488
+ * @param parentElm the parent DOM node which our new node will be a child of
489
+ * @returns the newly created node
490
+ */
459
491
  const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
460
492
  // tslint:disable-next-line: prefer-const
461
493
  const newVNode = newParentVNode.$children$[childIndex];
@@ -473,23 +505,23 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
473
505
  }
474
506
  newVNode.$flags$ |= newVNode.$children$
475
507
  ? // slot element has fallback content
476
- 2 /* isSlotFallback */
508
+ 2 /* VNODE_FLAGS.isSlotFallback */
477
509
  : // slot element does not have fallback content
478
- 1 /* isSlotReference */;
510
+ 1 /* VNODE_FLAGS.isSlotReference */;
479
511
  }
480
512
  }
481
513
  if (newVNode.$text$ !== null) {
482
514
  // create text node
483
515
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
484
516
  }
485
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
517
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
486
518
  // create a slot reference node
487
519
  elm = newVNode.$elm$ =
488
520
  doc.createTextNode('');
489
521
  }
490
522
  else {
491
523
  // create element
492
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */
524
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
493
525
  ? 'slot-fb'
494
526
  : newVNode.$tag$));
495
527
  // add css classes, attrs, props, listeners, etc.
@@ -515,7 +547,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
515
547
  }
516
548
  {
517
549
  elm['s-hn'] = hostTagName;
518
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
550
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
519
551
  // remember the content reference comment
520
552
  elm['s-sr'] = true;
521
553
  // remember the content reference comment
@@ -534,7 +566,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
534
566
  return elm;
535
567
  };
536
568
  const putBackInOriginalLocation = (parentElm, recursive) => {
537
- plt.$flags$ |= 1 /* isTmpDisconnected */;
569
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
538
570
  const oldSlotChildNodes = parentElm.childNodes;
539
571
  for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
540
572
  const childNode = oldSlotChildNodes[i];
@@ -555,7 +587,7 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
555
587
  putBackInOriginalLocation(childNode, recursive);
556
588
  }
557
589
  }
558
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
590
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
559
591
  };
560
592
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
561
593
  let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
@@ -597,6 +629,74 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
597
629
  }
598
630
  }
599
631
  };
632
+ /**
633
+ * Reconcile the children of a new VNode with the children of an old VNode by
634
+ * traversing the two collections of children, identifying nodes that are
635
+ * conserved or changed, calling out to `patch` to make any necessary
636
+ * updates to the DOM, and rearranging DOM nodes as needed.
637
+ *
638
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
639
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
640
+ * 'windows' by storing start and end indices and references to the
641
+ * corresponding array entries. Initially the two 'windows' are basically equal
642
+ * to the entire array, but we progressively narrow the windows until there are
643
+ * no children left to update by doing the following:
644
+ *
645
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
646
+ * that if we have an initial array like the following we'll end up dealing
647
+ * only with a window bounded by the highlighted elements:
648
+ *
649
+ * [null, null, VNode1 , ... , VNode2, null, null]
650
+ * ^^^^^^ ^^^^^^
651
+ *
652
+ * 2. Check to see if the elements at the head and tail positions are equal
653
+ * across the windows. This will basically detect elements which haven't
654
+ * been added, removed, or changed position, i.e. if you had the following
655
+ * VNode elements (represented as HTML):
656
+ *
657
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
658
+ * newVNode: `<div><p><span>THERE</span></p></div>`
659
+ *
660
+ * Then when comparing the children of the `<div>` tag we check the equality
661
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
662
+ * same tag in the same position, we'd be able to avoid completely
663
+ * re-rendering the subtree under them with a new DOM element and would just
664
+ * call out to `patch` to handle reconciling their children and so on.
665
+ *
666
+ * 3. Check, for both windows, to see if the element at the beginning of the
667
+ * window corresponds to the element at the end of the other window. This is
668
+ * a heuristic which will let us identify _some_ situations in which
669
+ * elements have changed position, for instance it _should_ detect that the
670
+ * children nodes themselves have not changed but merely moved in the
671
+ * following example:
672
+ *
673
+ * oldVNode: `<div><element-one /><element-two /></div>`
674
+ * newVNode: `<div><element-two /><element-one /></div>`
675
+ *
676
+ * If we find cases like this then we also need to move the concrete DOM
677
+ * elements corresponding to the moved children to write the re-order to the
678
+ * DOM.
679
+ *
680
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
681
+ * nodes in the old children which have the same key as the first element in
682
+ * our window on the new children. If we find such a node we handle calling
683
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
684
+ * what we find.
685
+ *
686
+ * Finally, once we've narrowed our 'windows' to the point that either of them
687
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
688
+ * insertion or deletion that needs to happen to get a DOM state that correctly
689
+ * reflects the new child VNodes. If, for instance, after our window on the old
690
+ * children has collapsed we still have more nodes on the new children that
691
+ * we haven't dealt with yet then we need to add them, or if the new children
692
+ * collapse but we still have unhandled _old_ children then we need to make
693
+ * sure the corresponding DOM nodes are removed.
694
+ *
695
+ * @param parentElm the node into which the parent VNode is rendered
696
+ * @param oldCh the old children of the parent node
697
+ * @param newVNode the new VNode which will replace the parent
698
+ * @param newCh the new children of the parent node
699
+ */
600
700
  const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
601
701
  let oldStartIdx = 0;
602
702
  let newStartIdx = 0;
@@ -609,7 +709,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
609
709
  let node;
610
710
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
611
711
  if (oldStartVnode == null) {
612
- // Vnode might have been moved left
712
+ // VNode might have been moved left
613
713
  oldStartVnode = oldCh[++oldStartIdx];
614
714
  }
615
715
  else if (oldEndVnode == null) {
@@ -622,42 +722,102 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
622
722
  newEndVnode = newCh[--newEndIdx];
623
723
  }
624
724
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
725
+ // if the start nodes are the same then we should patch the new VNode
726
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
727
+ // indices to reflect that. We don't need to move any DOM Nodes around
728
+ // since things are matched up in order.
625
729
  patch(oldStartVnode, newStartVnode);
626
730
  oldStartVnode = oldCh[++oldStartIdx];
627
731
  newStartVnode = newCh[++newStartIdx];
628
732
  }
629
733
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
734
+ // likewise, if the end nodes are the same we patch new onto old and
735
+ // decrement our end indices, and also likewise in this case we don't
736
+ // need to move any DOM Nodes.
630
737
  patch(oldEndVnode, newEndVnode);
631
738
  oldEndVnode = oldCh[--oldEndIdx];
632
739
  newEndVnode = newCh[--newEndIdx];
633
740
  }
634
741
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
635
- // Vnode moved right
742
+ // case: "Vnode moved right"
743
+ //
744
+ // We've found that the last node in our window on the new children is
745
+ // the same VNode as the _first_ node in our window on the old children
746
+ // we're dealing with now. Visually, this is the layout of these two
747
+ // nodes:
748
+ //
749
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
750
+ // ^^^^^^^^^^^
751
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
752
+ // ^^^^^^^^^^^^^
753
+ //
754
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
755
+ // and move the DOM element for `oldStartVnode`.
636
756
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
637
757
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
638
758
  }
639
759
  patch(oldStartVnode, newEndVnode);
760
+ // We need to move the element for `oldStartVnode` into a position which
761
+ // will be appropriate for `newEndVnode`. For this we can use
762
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
763
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
764
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
765
+ //
766
+ // <old-start-node />
767
+ // <some-intervening-node />
768
+ // <old-end-node />
769
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
770
+ // <next-sibling />
771
+ //
772
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
773
+ // the node for `oldStartVnode` at the end of the children of
774
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
775
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
776
+ // append it to the children of the parent element.
640
777
  parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
641
778
  oldStartVnode = oldCh[++oldStartIdx];
642
779
  newEndVnode = newCh[--newEndIdx];
643
780
  }
644
781
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
645
- // Vnode moved left
782
+ // case: "Vnode moved left"
783
+ //
784
+ // We've found that the first node in our window on the new children is
785
+ // the same VNode as the _last_ node in our window on the old children.
786
+ // Visually, this is the layout of these two nodes:
787
+ //
788
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
789
+ // ^^^^^^^^^^^^^
790
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
791
+ // ^^^^^^^^^^^
792
+ //
793
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
794
+ // (which will handle updating any changed attributes, reconciling their
795
+ // children etc) but we also need to move the DOM node to which
796
+ // `oldEndVnode` corresponds.
646
797
  if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
647
798
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
648
799
  }
649
800
  patch(oldEndVnode, newStartVnode);
801
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
802
+ // the same node, so since we're here we know that they are not. Thus we
803
+ // can move the element for `oldEndVnode` _before_ the element for
804
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
805
+ // future.
650
806
  parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
651
807
  oldEndVnode = oldCh[--oldEndIdx];
652
808
  newStartVnode = newCh[++newStartIdx];
653
809
  }
654
810
  else {
655
811
  {
656
- // new element
812
+ // We either didn't find an element in the old children that matches
813
+ // the key of the first new child OR the build is not using `key`
814
+ // attributes at all. In either case we need to create a new element
815
+ // for the new node.
657
816
  node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
658
817
  newStartVnode = newCh[++newStartIdx];
659
818
  }
660
819
  if (node) {
820
+ // if we created a new node then handle inserting it to the DOM
661
821
  {
662
822
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
663
823
  }
@@ -665,18 +825,39 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
665
825
  }
666
826
  }
667
827
  if (oldStartIdx > oldEndIdx) {
828
+ // we have some more new nodes to add which don't match up with old nodes
668
829
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
669
830
  }
670
831
  else if (newStartIdx > newEndIdx) {
832
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
833
+ // in the new array, so lets remove them (which entails cleaning up the
834
+ // relevant DOM nodes)
671
835
  removeVnodes(oldCh, oldStartIdx, oldEndIdx);
672
836
  }
673
837
  };
674
- const isSameVnode = (vnode1, vnode2) => {
838
+ /**
839
+ * Compare two VNodes to determine if they are the same
840
+ *
841
+ * **NB**: This function is an equality _heuristic_ based on the available
842
+ * information set on the two VNodes and can be misleading under certain
843
+ * circumstances. In particular, if the two nodes do not have `key` attrs
844
+ * (available under `$key$` on VNodes) then the function falls back on merely
845
+ * checking that they have the same tag.
846
+ *
847
+ * So, in other words, if `key` attrs are not set on VNodes which may be
848
+ * changing order within a `children` array or something along those lines then
849
+ * we could obtain a false positive and then have to do needless re-rendering.
850
+ *
851
+ * @param leftVNode the first VNode to check
852
+ * @param rightVNode the second VNode to check
853
+ * @returns whether they're equal or not
854
+ */
855
+ const isSameVnode = (leftVNode, rightVNode) => {
675
856
  // compare if two vnode to see if they're "technically" the same
676
857
  // need to have the same element tag, and same key to be the same
677
- if (vnode1.$tag$ === vnode2.$tag$) {
678
- if (vnode1.$tag$ === 'slot') {
679
- return vnode1.$name$ === vnode2.$name$;
858
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
859
+ if (leftVNode.$tag$ === 'slot') {
860
+ return leftVNode.$name$ === rightVNode.$name$;
680
861
  }
681
862
  return true;
682
863
  }
@@ -690,6 +871,14 @@ const referenceNode = (node) => {
690
871
  return (node && node['s-ol']) || node;
691
872
  };
692
873
  const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
874
+ /**
875
+ * Handle reconciling an outdated VNode with a new one which corresponds to
876
+ * it. This function handles flushing updates to the DOM and reconciling the
877
+ * children of the two nodes (if any).
878
+ *
879
+ * @param oldVNode an old VNode whose DOM element and children we want to update
880
+ * @param newVNode a new VNode representing an updated version of the old one
881
+ */
693
882
  const patch = (oldVNode, newVNode) => {
694
883
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
695
884
  const oldChildren = oldVNode.$children$;
@@ -698,7 +887,6 @@ const patch = (oldVNode, newVNode) => {
698
887
  const text = newVNode.$text$;
699
888
  let defaultHolder;
700
889
  if (text === null) {
701
- // element node
702
890
  {
703
891
  if (tag === 'slot')
704
892
  ;
@@ -711,6 +899,7 @@ const patch = (oldVNode, newVNode) => {
711
899
  }
712
900
  if (oldChildren !== null && newChildren !== null) {
713
901
  // looks like there's child vnodes for both the old and new vnodes
902
+ // so we need to call `updateChildren` to reconcile them
714
903
  updateChildren(elm, oldChildren, newVNode, newChildren);
715
904
  }
716
905
  else if (newChildren !== null) {
@@ -748,7 +937,7 @@ const updateFallbackSlotVisibility = (elm) => {
748
937
  let nodeType;
749
938
  for (i = 0, ilen = childNodes.length; i < ilen; i++) {
750
939
  childNode = childNodes[i];
751
- if (childNode.nodeType === 1 /* ElementNode */) {
940
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
752
941
  if (childNode['s-sr']) {
753
942
  // this is a slot fallback node
754
943
  // get the slot name for this slot reference node
@@ -760,7 +949,7 @@ const updateFallbackSlotVisibility = (elm) => {
760
949
  nodeType = childNodes[j].nodeType;
761
950
  if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
762
951
  // this sibling node is from a different component OR is a named fallback slot node
763
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
952
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
764
953
  childNode.hidden = true;
765
954
  break;
766
955
  }
@@ -769,8 +958,8 @@ const updateFallbackSlotVisibility = (elm) => {
769
958
  // this is a default fallback slot node
770
959
  // any element or text node (with content)
771
960
  // should hide the default fallback slot node
772
- if (nodeType === 1 /* ElementNode */ ||
773
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
961
+ if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
962
+ (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
774
963
  childNode.hidden = true;
775
964
  break;
776
965
  }
@@ -848,13 +1037,13 @@ const relocateSlotContent = (elm) => {
848
1037
  }
849
1038
  }
850
1039
  }
851
- if (childNode.nodeType === 1 /* ElementNode */) {
1040
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
852
1041
  relocateSlotContent(childNode);
853
1042
  }
854
1043
  }
855
1044
  };
856
1045
  const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
857
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1046
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
858
1047
  if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
859
1048
  return true;
860
1049
  }
@@ -885,7 +1074,7 @@ const renderVdom = (hostRef, renderFnResults) => {
885
1074
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
886
1075
  }
887
1076
  rootVnode.$tag$ = null;
888
- rootVnode.$flags$ |= 4 /* isHost */;
1077
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
889
1078
  hostRef.$vnode$ = rootVnode;
890
1079
  rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
891
1080
  {
@@ -893,7 +1082,7 @@ const renderVdom = (hostRef, renderFnResults) => {
893
1082
  }
894
1083
  {
895
1084
  contentRef = hostElm['s-cr'];
896
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1085
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
897
1086
  // always reset
898
1087
  checkSlotFallbackVisibility = false;
899
1088
  }
@@ -902,7 +1091,7 @@ const renderVdom = (hostRef, renderFnResults) => {
902
1091
  {
903
1092
  // while we're moving nodes around existing nodes, temporarily disable
904
1093
  // the disconnectCallback from working
905
- plt.$flags$ |= 1 /* isTmpDisconnected */;
1094
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
906
1095
  if (checkSlotRelocate) {
907
1096
  relocateSlotContent(rootVnode.$elm$);
908
1097
  let relocateData;
@@ -960,7 +1149,7 @@ const renderVdom = (hostRef, renderFnResults) => {
960
1149
  }
961
1150
  else {
962
1151
  // this node doesn't have a slot home to go to, so let's hide it
963
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1152
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
964
1153
  nodeToRelocate.hidden = true;
965
1154
  }
966
1155
  }
@@ -971,37 +1160,11 @@ const renderVdom = (hostRef, renderFnResults) => {
971
1160
  }
972
1161
  // done moving nodes around
973
1162
  // allow the disconnect callback to work again
974
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
1163
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
975
1164
  // always reset
976
1165
  relocateNodes.length = 0;
977
1166
  }
978
1167
  };
979
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
980
- const createEvent = (ref, name, flags) => {
981
- const elm = getElement(ref);
982
- return {
983
- emit: (detail) => {
984
- return emitEvent(elm, name, {
985
- bubbles: !!(flags & 4 /* Bubbles */),
986
- composed: !!(flags & 2 /* Composed */),
987
- cancelable: !!(flags & 1 /* Cancellable */),
988
- detail,
989
- });
990
- },
991
- };
992
- };
993
- /**
994
- * Helper function to create & dispatch a custom Event on a provided target
995
- * @param elm the target of the Event
996
- * @param name the name to give the custom Event
997
- * @param opts options for configuring a custom Event
998
- * @returns the custom Event
999
- */
1000
- const emitEvent = (elm, name, opts) => {
1001
- const ev = plt.ce(name, opts);
1002
- elm.dispatchEvent(ev);
1003
- return ev;
1004
- };
1005
1168
  const attachToAncestor = (hostRef, ancestorComponent) => {
1006
1169
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1007
1170
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
@@ -1009,10 +1172,10 @@ const attachToAncestor = (hostRef, ancestorComponent) => {
1009
1172
  };
1010
1173
  const scheduleUpdate = (hostRef, isInitialLoad) => {
1011
1174
  {
1012
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1175
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1013
1176
  }
1014
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1015
- hostRef.$flags$ |= 512 /* needsRerender */;
1177
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1178
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1016
1179
  return;
1017
1180
  }
1018
1181
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
@@ -1028,7 +1191,7 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1028
1191
  let promise;
1029
1192
  if (isInitialLoad) {
1030
1193
  {
1031
- hostRef.$flags$ |= 256 /* isListenReady */;
1194
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1032
1195
  if (hostRef.$queuedListeners$) {
1033
1196
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1034
1197
  hostRef.$queuedListeners$ = null;
@@ -1074,7 +1237,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1074
1237
  }
1075
1238
  else {
1076
1239
  Promise.all(childrenPromises).then(postUpdate);
1077
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1240
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1078
1241
  childrenPromises.length = 0;
1079
1242
  }
1080
1243
  }
@@ -1083,10 +1246,10 @@ const callRender = (hostRef, instance, elm) => {
1083
1246
  try {
1084
1247
  instance = instance.render() ;
1085
1248
  {
1086
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1249
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1087
1250
  }
1088
1251
  {
1089
- hostRef.$flags$ |= 2 /* hasRendered */;
1252
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1090
1253
  }
1091
1254
  {
1092
1255
  {
@@ -1113,8 +1276,8 @@ const postUpdateComponent = (hostRef) => {
1113
1276
  {
1114
1277
  safeCall(instance, 'componentDidRender');
1115
1278
  }
1116
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1117
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1279
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1280
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1118
1281
  {
1119
1282
  // DOM WRITE!
1120
1283
  addHydratedFlag(elm);
@@ -1143,10 +1306,10 @@ const postUpdateComponent = (hostRef) => {
1143
1306
  hostRef.$onRenderResolve$();
1144
1307
  hostRef.$onRenderResolve$ = undefined;
1145
1308
  }
1146
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1309
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1147
1310
  nextTick(() => scheduleUpdate(hostRef, false));
1148
1311
  }
1149
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1312
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1150
1313
  }
1151
1314
  // ( •_•)
1152
1315
  // ( •_•)>⌐■-■
@@ -1176,53 +1339,6 @@ const then = (promise, thenFn) => {
1176
1339
  };
1177
1340
  const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1178
1341
  ;
1179
- /**
1180
- * Parse a new property value for a given property type.
1181
- *
1182
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
1183
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
1184
- * 1. `any`, the type given to `propValue` in the function signature
1185
- * 2. the type stored from `propType`.
1186
- *
1187
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
1188
- *
1189
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
1190
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
1191
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
1192
- * ```tsx
1193
- * <my-cmp prop-val={0}></my-cmp>
1194
- * ```
1195
- *
1196
- * HTML prop values on the other hand, will always a string
1197
- *
1198
- * @param propValue the new value to coerce to some type
1199
- * @param propType the type of the prop, expressed as a binary number
1200
- * @returns the parsed/coerced value
1201
- */
1202
- const parsePropertyValue = (propValue, propType) => {
1203
- // ensure this value is of the correct prop type
1204
- if (propValue != null && !isComplexType(propValue)) {
1205
- if (propType & 4 /* Boolean */) {
1206
- // per the HTML spec, any string value means it is a boolean true value
1207
- // but we'll cheat here and say that the string "false" is the boolean false
1208
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1209
- }
1210
- if (propType & 2 /* Number */) {
1211
- // force it to be a number
1212
- return parseFloat(propValue);
1213
- }
1214
- if (propType & 1 /* String */) {
1215
- // could have been passed as a number or boolean
1216
- // but we still want it as a string
1217
- return String(propValue);
1218
- }
1219
- // redundant return here for better minification
1220
- return propValue;
1221
- }
1222
- // not sure exactly what type we want
1223
- // so no need to change to a different type
1224
- return propValue;
1225
- };
1226
1342
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1227
1343
  const setValue = (ref, propName, newVal, cmpMeta) => {
1228
1344
  // check our new property value against our internal value
@@ -1235,13 +1351,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1235
1351
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1236
1352
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1237
1353
  const didValueChange = newVal !== oldVal && !areBothNaN;
1238
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1354
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1239
1355
  // gadzooks! the property's value has changed!!
1240
1356
  // set our new value!
1241
1357
  hostRef.$instanceValues$.set(propName, newVal);
1242
1358
  if (instance) {
1243
1359
  // get an array of method names of watch functions to call
1244
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1360
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1245
1361
  const watchMethods = cmpMeta.$watchers$[propName];
1246
1362
  if (watchMethods) {
1247
1363
  // this instance is watching for when this property changed
@@ -1256,7 +1372,7 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1256
1372
  });
1257
1373
  }
1258
1374
  }
1259
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1375
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1260
1376
  if (instance.componentShouldUpdate) {
1261
1377
  if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1262
1378
  return;
@@ -1271,6 +1387,16 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
1271
1387
  }
1272
1388
  }
1273
1389
  };
1390
+ /**
1391
+ * Attach a series of runtime constructs to a compiled Stencil component
1392
+ * constructor, including getters and setters for the `@Prop` and `@State`
1393
+ * decorators, callbacks for when attributes change, and so on.
1394
+ *
1395
+ * @param Cstr the constructor for a component that we need to process
1396
+ * @param cmpMeta metadata collected previously about the component
1397
+ * @param flags a number used to store a series of bit flags
1398
+ * @returns a reference to the same constructor passed in (but now mutated)
1399
+ */
1274
1400
  const proxyComponent = (Cstr, cmpMeta, flags) => {
1275
1401
  if (cmpMeta.$members$) {
1276
1402
  if (Cstr.watchers) {
@@ -1280,8 +1406,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1280
1406
  const members = Object.entries(cmpMeta.$members$);
1281
1407
  const prototype = Cstr.prototype;
1282
1408
  members.map(([memberName, [memberFlags]]) => {
1283
- if ((memberFlags & 31 /* Prop */ ||
1284
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1409
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1410
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1285
1411
  // proxyComponent - prop
1286
1412
  Object.defineProperty(prototype, memberName, {
1287
1413
  get() {
@@ -1297,7 +1423,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1297
1423
  });
1298
1424
  }
1299
1425
  });
1300
- if ((flags & 1 /* isElementConstructor */)) {
1426
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1301
1427
  const attrNameToPropName = new Map();
1302
1428
  prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1303
1429
  plt.jmp(() => {
@@ -1353,11 +1479,11 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1353
1479
  // create an array of attributes to observe
1354
1480
  // and also create a map of html attribute name to js property name
1355
1481
  Cstr.observedAttributes = members
1356
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1482
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1357
1483
  .map(([propName, m]) => {
1358
1484
  const attrName = m[1] || propName;
1359
1485
  attrNameToPropName.set(attrName, propName);
1360
- if (m[0] & 512 /* ReflectAttr */) {
1486
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1361
1487
  cmpMeta.$attrsToReflect$.push([propName, attrName]);
1362
1488
  }
1363
1489
  return attrName;
@@ -1368,10 +1494,10 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
1368
1494
  };
1369
1495
  const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1370
1496
  // initializeComponent
1371
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1497
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1372
1498
  {
1373
1499
  // we haven't initialized this element yet
1374
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1500
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1375
1501
  // lazy loaded components
1376
1502
  // request the component's implementation to be
1377
1503
  // wired up with the host element
@@ -1389,7 +1515,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1389
1515
  {
1390
1516
  cmpMeta.$watchers$ = Cstr.watchers;
1391
1517
  }
1392
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1518
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1393
1519
  Cstr.isProxied = true;
1394
1520
  }
1395
1521
  const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
@@ -1397,7 +1523,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1397
1523
  // but let's keep track of when we start and stop
1398
1524
  // so that the getters/setters don't incorrectly step on data
1399
1525
  {
1400
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1526
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1401
1527
  }
1402
1528
  // construct the lazy-loaded component implementation
1403
1529
  // passing the hostRef is very important during
@@ -1410,10 +1536,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1410
1536
  consoleError(e);
1411
1537
  }
1412
1538
  {
1413
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1539
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1414
1540
  }
1415
1541
  {
1416
- hostRef.$flags$ |= 128 /* isWatchReady */;
1542
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1417
1543
  }
1418
1544
  endNewInstance();
1419
1545
  }
@@ -1423,7 +1549,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1423
1549
  const scopeId = getScopeId(cmpMeta);
1424
1550
  if (!styles.has(scopeId)) {
1425
1551
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1426
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1552
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1427
1553
  endRegisterStyles();
1428
1554
  }
1429
1555
  }
@@ -1445,19 +1571,19 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) =>
1445
1571
  }
1446
1572
  };
1447
1573
  const connectedCallback = (elm) => {
1448
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1574
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1449
1575
  const hostRef = getHostRef(elm);
1450
1576
  const cmpMeta = hostRef.$cmpMeta$;
1451
1577
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1452
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1578
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1453
1579
  // first time this component has connected
1454
- hostRef.$flags$ |= 1 /* hasConnected */;
1580
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1455
1581
  {
1456
1582
  // initUpdate
1457
1583
  // if the slot polyfill is required we'll need to put some nodes
1458
1584
  // in here to act as original content anchors as we move nodes around
1459
1585
  // host element has been connected to the DOM
1460
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1586
+ if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1461
1587
  setContentReference(elm);
1462
1588
  }
1463
1589
  }
@@ -1480,7 +1606,7 @@ const connectedCallback = (elm) => {
1480
1606
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1481
1607
  if (cmpMeta.$members$) {
1482
1608
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1483
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1609
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1484
1610
  const value = elm[memberName];
1485
1611
  delete elm[memberName];
1486
1612
  elm[memberName] = value;
@@ -1512,7 +1638,7 @@ const setContentReference = (elm) => {
1512
1638
  elm.insertBefore(contentRefElm, elm.firstChild);
1513
1639
  };
1514
1640
  const disconnectedCallback = (elm) => {
1515
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1641
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1516
1642
  const hostRef = getHostRef(elm);
1517
1643
  const instance = hostRef.$lazyInstance$ ;
1518
1644
  {
@@ -1567,7 +1693,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1567
1693
  super(self);
1568
1694
  self = this;
1569
1695
  registerHost(self, cmpMeta);
1570
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1696
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1571
1697
  // this component is using shadow dom
1572
1698
  // and this browser supports shadow dom
1573
1699
  // add the read-only property "shadowRoot" to the host element
@@ -1602,7 +1728,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1602
1728
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
1603
1729
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1604
1730
  cmpTags.push(tagName);
1605
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1731
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1606
1732
  }
1607
1733
  });
1608
1734
  });
@@ -1624,7 +1750,45 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
1624
1750
  // Fallback appLoad event
1625
1751
  endBootstrap();
1626
1752
  };
1627
- const hostRefs = new WeakMap();
1753
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1754
+ if (listeners) {
1755
+ listeners.map(([flags, name, method]) => {
1756
+ const target = getHostListenerTarget(elm, flags) ;
1757
+ const handler = hostListenerProxy(hostRef, method);
1758
+ const opts = hostListenerOpts(flags);
1759
+ plt.ael(target, name, handler, opts);
1760
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1761
+ });
1762
+ }
1763
+ };
1764
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1765
+ try {
1766
+ {
1767
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1768
+ // instance is ready, let's call it's member method for this event
1769
+ hostRef.$lazyInstance$[methodName](ev);
1770
+ }
1771
+ else {
1772
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1773
+ }
1774
+ }
1775
+ }
1776
+ catch (e) {
1777
+ consoleError(e);
1778
+ }
1779
+ };
1780
+ const getHostListenerTarget = (elm, flags) => {
1781
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
1782
+ return doc;
1783
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1784
+ return win;
1785
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1786
+ return doc.body;
1787
+ return elm;
1788
+ };
1789
+ // prettier-ignore
1790
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1791
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1628
1792
  const getHostRef = (ref) => hostRefs.get(ref);
1629
1793
  const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1630
1794
  const registerHost = (elm, cmpMeta) => {
@@ -1819,14 +1983,35 @@ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1819
1983
  return importedModule[exportName];
1820
1984
  }, consoleError);
1821
1985
  };
1822
- const styles = new Map();
1986
+ const styles = /*@__PURE__*/ new Map();
1987
+ const win = typeof window !== 'undefined' ? window : {};
1988
+ const doc = win.document || { head: {} };
1989
+ const plt = {
1990
+ $flags$: 0,
1991
+ $resourcesUrl$: '',
1992
+ jmp: (h) => h(),
1993
+ raf: (h) => requestAnimationFrame(h),
1994
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1995
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1996
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1997
+ };
1998
+ const promiseResolve = (v) => Promise.resolve(v);
1999
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2000
+ try {
2001
+ new CSSStyleSheet();
2002
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2003
+ }
2004
+ catch (e) { }
2005
+ return false;
2006
+ })()
2007
+ ;
1823
2008
  const queueDomReads = [];
1824
2009
  const queueDomWrites = [];
1825
2010
  const queueTask = (queue, write) => (cb) => {
1826
2011
  queue.push(cb);
1827
2012
  if (!queuePending) {
1828
2013
  queuePending = true;
1829
- if (write && plt.$flags$ & 4 /* queueSync */) {
2014
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1830
2015
  nextTick(flush);
1831
2016
  }
1832
2017
  else {