jebamo 0.0.1 → 0.0.2

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 (437) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  3. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  4. package/dist/cjs/index-d5fa9014.js +1722 -0
  5. package/dist/cjs/index-d5fa9014.js.map +1 -0
  6. package/dist/cjs/index.cjs.js +4 -0
  7. package/dist/cjs/index.cjs.js.map +1 -0
  8. package/dist/cjs/je-alert_31.cjs.entry.js +4772 -0
  9. package/dist/cjs/je-alert_31.cjs.entry.js.map +1 -0
  10. package/dist/cjs/je-branch.cjs.entry.js +22 -0
  11. package/dist/cjs/je-branch.cjs.entry.js.map +1 -0
  12. package/dist/cjs/je-column-group.cjs.entry.js +29 -0
  13. package/dist/cjs/je-column-group.cjs.entry.js.map +1 -0
  14. package/dist/cjs/je-column.cjs.entry.js +73 -0
  15. package/dist/cjs/je-column.cjs.entry.js.map +1 -0
  16. package/dist/cjs/je-infinite.cjs.entry.js +45 -0
  17. package/dist/cjs/je-infinite.cjs.entry.js.map +1 -0
  18. package/dist/cjs/je-menu-option.cjs.entry.js +22 -0
  19. package/dist/cjs/je-menu-option.cjs.entry.js.map +1 -0
  20. package/dist/cjs/je-menu.cjs.entry.js +22 -0
  21. package/dist/cjs/je-menu.cjs.entry.js.map +1 -0
  22. package/dist/cjs/je-tab.cjs.entry.js +22 -0
  23. package/dist/cjs/je-tab.cjs.entry.js.map +1 -0
  24. package/dist/cjs/je-tabs.cjs.entry.js +22 -0
  25. package/dist/cjs/je-tabs.cjs.entry.js.map +1 -0
  26. package/dist/cjs/je-toast.cjs.entry.js +22 -0
  27. package/dist/cjs/je-toast.cjs.entry.js.map +1 -0
  28. package/dist/cjs/je-tree.cjs.entry.js +22 -0
  29. package/dist/cjs/je-tree.cjs.entry.js.map +1 -0
  30. package/dist/cjs/jebamo.cjs.js +27 -0
  31. package/dist/cjs/jebamo.cjs.js.map +1 -0
  32. package/dist/cjs/loader.cjs.js +17 -0
  33. package/dist/cjs/loader.cjs.js.map +1 -0
  34. package/dist/collection/collection-manifest.json +52 -0
  35. package/dist/collection/components/checkbox-group/je-checkbox-group/je-checkbox-group.css +10 -0
  36. package/dist/collection/components/checkbox-group/je-checkbox-group/je-checkbox-group.js +141 -0
  37. package/dist/collection/components/checkbox-group/je-checkbox-group/je-checkbox-group.js.map +1 -0
  38. package/dist/collection/components/checkbox-group/je-checkbox-option/je-checkbox-option.css +13 -0
  39. package/dist/collection/components/checkbox-group/je-checkbox-option/je-checkbox-option.js +153 -0
  40. package/dist/collection/components/checkbox-group/je-checkbox-option/je-checkbox-option.js.map +1 -0
  41. package/dist/collection/components/column/je-column/je-column.css +10 -0
  42. package/dist/collection/components/column/je-column/je-column.js +187 -0
  43. package/dist/collection/components/column/je-column/je-column.js.map +1 -0
  44. package/dist/collection/components/column/je-column-group/je-column-group.css +4 -0
  45. package/dist/collection/components/column/je-column-group/je-column-group.js +49 -0
  46. package/dist/collection/components/column/je-column-group/je-column-group.js.map +1 -0
  47. package/dist/collection/components/je-alert/je-alert.css +84 -0
  48. package/dist/collection/components/je-alert/je-alert.js +339 -0
  49. package/dist/collection/components/je-alert/je-alert.js.map +1 -0
  50. package/dist/collection/components/je-button/je-button.css +180 -0
  51. package/dist/collection/components/je-button/je-button.js +252 -0
  52. package/dist/collection/components/je-button/je-button.js.map +1 -0
  53. package/dist/collection/components/je-card/je-card.css +113 -0
  54. package/dist/collection/components/je-card/je-card.js +67 -0
  55. package/dist/collection/components/je-card/je-card.js.map +1 -0
  56. package/dist/collection/components/je-checkbox/je-checkbox.css +14 -0
  57. package/dist/collection/components/je-checkbox/je-checkbox.js +191 -0
  58. package/dist/collection/components/je-checkbox/je-checkbox.js.map +1 -0
  59. package/dist/collection/components/je-color/je-color.css +39 -0
  60. package/dist/collection/components/je-color/je-color.js +116 -0
  61. package/dist/collection/components/je-color/je-color.js.map +1 -0
  62. package/dist/collection/components/je-datepicker/je-datepicker.css +56 -0
  63. package/dist/collection/components/je-datepicker/je-datepicker.js +129 -0
  64. package/dist/collection/components/je-datepicker/je-datepicker.js.map +1 -0
  65. package/dist/collection/components/je-details/je-details.css +39 -0
  66. package/dist/collection/components/je-details/je-details.js +63 -0
  67. package/dist/collection/components/je-details/je-details.js.map +1 -0
  68. package/dist/collection/components/je-divider/je-divider.css +32 -0
  69. package/dist/collection/components/je-divider/je-divider.js +63 -0
  70. package/dist/collection/components/je-divider/je-divider.js.map +1 -0
  71. package/dist/collection/components/je-drawer/je-drawer.css +51 -0
  72. package/dist/collection/components/je-drawer/je-drawer.js +71 -0
  73. package/dist/collection/components/je-drawer/je-drawer.js.map +1 -0
  74. package/dist/collection/components/je-dropzone/je-dropzone.css +21 -0
  75. package/dist/collection/components/je-dropzone/je-dropzone.js +86 -0
  76. package/dist/collection/components/je-dropzone/je-dropzone.js.map +1 -0
  77. package/dist/collection/components/je-form/je-form.css +12 -0
  78. package/dist/collection/components/je-form/je-form.js +95 -0
  79. package/dist/collection/components/je-form/je-form.js.map +1 -0
  80. package/dist/collection/components/je-icon/je-icon.css +60 -0
  81. package/dist/collection/components/je-icon/je-icon.js +122 -0
  82. package/dist/collection/components/je-icon/je-icon.js.map +1 -0
  83. package/dist/collection/components/je-infinite/je-infinite.css +18 -0
  84. package/dist/collection/components/je-infinite/je-infinite.js +119 -0
  85. package/dist/collection/components/je-infinite/je-infinite.js.map +1 -0
  86. package/dist/collection/components/je-input/je-input.css +96 -0
  87. package/dist/collection/components/je-input/je-input.js +862 -0
  88. package/dist/collection/components/je-input/je-input.js.map +1 -0
  89. package/dist/collection/components/je-link/je-link.css +15 -0
  90. package/dist/collection/components/je-link/je-link.js +207 -0
  91. package/dist/collection/components/je-link/je-link.js.map +1 -0
  92. package/dist/collection/components/je-loading/je-loading.css +50 -0
  93. package/dist/collection/components/je-loading/je-loading.js +48 -0
  94. package/dist/collection/components/je-loading/je-loading.js.map +1 -0
  95. package/dist/collection/components/je-modal/je-modal.css +75 -0
  96. package/dist/collection/components/je-modal/je-modal.js +220 -0
  97. package/dist/collection/components/je-modal/je-modal.js.map +1 -0
  98. package/dist/collection/components/je-page/je-page.css +202 -0
  99. package/dist/collection/components/je-page/je-page.js +129 -0
  100. package/dist/collection/components/je-page/je-page.js.map +1 -0
  101. package/dist/collection/components/je-pill/je-pill.css +43 -0
  102. package/dist/collection/components/je-pill/je-pill.js +82 -0
  103. package/dist/collection/components/je-pill/je-pill.js.map +1 -0
  104. package/dist/collection/components/je-placeholder/je-placeholder.css +39 -0
  105. package/dist/collection/components/je-placeholder/je-placeholder.js +44 -0
  106. package/dist/collection/components/je-placeholder/je-placeholder.js.map +1 -0
  107. package/dist/collection/components/je-popover/je-popover.css +60 -0
  108. package/dist/collection/components/je-popover/je-popover.js +499 -0
  109. package/dist/collection/components/je-popover/je-popover.js.map +1 -0
  110. package/dist/collection/components/je-textarea/je-textarea.css +59 -0
  111. package/dist/collection/components/je-textarea/je-textarea.js +171 -0
  112. package/dist/collection/components/je-textarea/je-textarea.js.map +1 -0
  113. package/dist/collection/components/je-toast/je-toast.css +3 -0
  114. package/dist/collection/components/je-toast/je-toast.js +19 -0
  115. package/dist/collection/components/je-toast/je-toast.js.map +1 -0
  116. package/dist/collection/components/je-toggle/je-toggle.css +48 -0
  117. package/dist/collection/components/je-toggle/je-toggle.js +105 -0
  118. package/dist/collection/components/je-toggle/je-toggle.js.map +1 -0
  119. package/dist/collection/components/je-toolbar/je-toolbar.css +16 -0
  120. package/dist/collection/components/je-toolbar/je-toolbar.js +19 -0
  121. package/dist/collection/components/je-toolbar/je-toolbar.js.map +1 -0
  122. package/dist/collection/components/menu/je-menu/je-menu.css +3 -0
  123. package/dist/collection/components/menu/je-menu/je-menu.js +19 -0
  124. package/dist/collection/components/menu/je-menu/je-menu.js.map +1 -0
  125. package/dist/collection/components/menu/je-menu-option/je-menu-option.css +3 -0
  126. package/dist/collection/components/menu/je-menu-option/je-menu-option.js +19 -0
  127. package/dist/collection/components/menu/je-menu-option/je-menu-option.js.map +1 -0
  128. package/dist/collection/components/multiselect/je-multiselect/je-multiselect.css +79 -0
  129. package/dist/collection/components/multiselect/je-multiselect/je-multiselect.js +244 -0
  130. package/dist/collection/components/multiselect/je-multiselect/je-multiselect.js.map +1 -0
  131. package/dist/collection/components/multiselect/je-multiselect-option/je-multiselect-option.css +31 -0
  132. package/dist/collection/components/multiselect/je-multiselect-option/je-multiselect-option.js +122 -0
  133. package/dist/collection/components/multiselect/je-multiselect-option/je-multiselect-option.js.map +1 -0
  134. package/dist/collection/components/radio/je-radio/je-radio.css +13 -0
  135. package/dist/collection/components/radio/je-radio/je-radio.js +128 -0
  136. package/dist/collection/components/radio/je-radio/je-radio.js.map +1 -0
  137. package/dist/collection/components/radio/je-radio-group/je-radio-group.css +10 -0
  138. package/dist/collection/components/radio/je-radio-group/je-radio-group.js +172 -0
  139. package/dist/collection/components/radio/je-radio-group/je-radio-group.js.map +1 -0
  140. package/dist/collection/components/select/je-select/je-select.css +20 -0
  141. package/dist/collection/components/select/je-select/je-select.js +289 -0
  142. package/dist/collection/components/select/je-select/je-select.js.map +1 -0
  143. package/dist/collection/components/select/je-select-option/je-select-option.css +31 -0
  144. package/dist/collection/components/select/je-select-option/je-select-option.js +102 -0
  145. package/dist/collection/components/select/je-select-option/je-select-option.js.map +1 -0
  146. package/dist/collection/components/tabs/je-tab/je-tab.css +3 -0
  147. package/dist/collection/components/tabs/je-tab/je-tab.js +19 -0
  148. package/dist/collection/components/tabs/je-tab/je-tab.js.map +1 -0
  149. package/dist/collection/components/tabs/je-tabs/je-tabs.css +3 -0
  150. package/dist/collection/components/tabs/je-tabs/je-tabs.js +19 -0
  151. package/dist/collection/components/tabs/je-tabs/je-tabs.js.map +1 -0
  152. package/dist/collection/components/tree/je-branch/je-branch.css +3 -0
  153. package/dist/collection/components/tree/je-branch/je-branch.js +19 -0
  154. package/dist/collection/components/tree/je-branch/je-branch.js.map +1 -0
  155. package/dist/collection/components/tree/je-tree/je-tree.css +3 -0
  156. package/dist/collection/components/tree/je-tree/je-tree.js +19 -0
  157. package/dist/collection/components/tree/je-tree/je-tree.js.map +1 -0
  158. package/dist/collection/index.js +2 -0
  159. package/dist/collection/index.js.map +1 -0
  160. package/dist/collection/utils/utils.js +18 -0
  161. package/dist/collection/utils/utils.js.map +1 -0
  162. package/dist/components/index.d.ts +33 -0
  163. package/dist/components/index.js +3 -0
  164. package/dist/components/index.js.map +1 -0
  165. package/dist/components/je-alert.d.ts +11 -0
  166. package/dist/components/je-alert.js +146 -0
  167. package/dist/components/je-alert.js.map +1 -0
  168. package/dist/components/je-branch.d.ts +11 -0
  169. package/dist/components/je-branch.js +37 -0
  170. package/dist/components/je-branch.js.map +1 -0
  171. package/dist/components/je-button.d.ts +11 -0
  172. package/dist/components/je-button.js +8 -0
  173. package/dist/components/je-button.js.map +1 -0
  174. package/dist/components/je-card.d.ts +11 -0
  175. package/dist/components/je-card.js +8 -0
  176. package/dist/components/je-card.js.map +1 -0
  177. package/dist/components/je-checkbox-group.d.ts +11 -0
  178. package/dist/components/je-checkbox-group.js +90 -0
  179. package/dist/components/je-checkbox-group.js.map +1 -0
  180. package/dist/components/je-checkbox-option.d.ts +11 -0
  181. package/dist/components/je-checkbox-option.js +65 -0
  182. package/dist/components/je-checkbox-option.js.map +1 -0
  183. package/dist/components/je-checkbox.d.ts +11 -0
  184. package/dist/components/je-checkbox.js +83 -0
  185. package/dist/components/je-checkbox.js.map +1 -0
  186. package/dist/components/je-color.d.ts +11 -0
  187. package/dist/components/je-color.js +8 -0
  188. package/dist/components/je-color.js.map +1 -0
  189. package/dist/components/je-column-group.d.ts +11 -0
  190. package/dist/components/je-column-group.js +46 -0
  191. package/dist/components/je-column-group.js.map +1 -0
  192. package/dist/components/je-column.d.ts +11 -0
  193. package/dist/components/je-column.js +95 -0
  194. package/dist/components/je-column.js.map +1 -0
  195. package/dist/components/je-datepicker.d.ts +11 -0
  196. package/dist/components/je-datepicker.js +3249 -0
  197. package/dist/components/je-datepicker.js.map +1 -0
  198. package/dist/components/je-details.d.ts +11 -0
  199. package/dist/components/je-details.js +49 -0
  200. package/dist/components/je-details.js.map +1 -0
  201. package/dist/components/je-divider.d.ts +11 -0
  202. package/dist/components/je-divider.js +42 -0
  203. package/dist/components/je-divider.js.map +1 -0
  204. package/dist/components/je-drawer.d.ts +11 -0
  205. package/dist/components/je-drawer.js +60 -0
  206. package/dist/components/je-drawer.js.map +1 -0
  207. package/dist/components/je-dropzone.d.ts +11 -0
  208. package/dist/components/je-dropzone.js +55 -0
  209. package/dist/components/je-dropzone.js.map +1 -0
  210. package/dist/components/je-form.d.ts +11 -0
  211. package/dist/components/je-form.js +8 -0
  212. package/dist/components/je-form.js.map +1 -0
  213. package/dist/components/je-icon.d.ts +11 -0
  214. package/dist/components/je-icon.js +8 -0
  215. package/dist/components/je-icon.js.map +1 -0
  216. package/dist/components/je-infinite.d.ts +11 -0
  217. package/dist/components/je-infinite.js +64 -0
  218. package/dist/components/je-infinite.js.map +1 -0
  219. package/dist/components/je-input.d.ts +11 -0
  220. package/dist/components/je-input.js +8 -0
  221. package/dist/components/je-input.js.map +1 -0
  222. package/dist/components/je-link.d.ts +11 -0
  223. package/dist/components/je-link.js +62 -0
  224. package/dist/components/je-link.js.map +1 -0
  225. package/dist/components/je-loading.d.ts +11 -0
  226. package/dist/components/je-loading.js +66 -0
  227. package/dist/components/je-loading.js.map +1 -0
  228. package/dist/components/je-menu-option.d.ts +11 -0
  229. package/dist/components/je-menu-option.js +37 -0
  230. package/dist/components/je-menu-option.js.map +1 -0
  231. package/dist/components/je-menu.d.ts +11 -0
  232. package/dist/components/je-menu.js +37 -0
  233. package/dist/components/je-menu.js.map +1 -0
  234. package/dist/components/je-modal.d.ts +11 -0
  235. package/dist/components/je-modal.js +104 -0
  236. package/dist/components/je-modal.js.map +1 -0
  237. package/dist/components/je-multiselect-option.d.ts +11 -0
  238. package/dist/components/je-multiselect-option.js +62 -0
  239. package/dist/components/je-multiselect-option.js.map +1 -0
  240. package/dist/components/je-multiselect.d.ts +11 -0
  241. package/dist/components/je-multiselect.js +146 -0
  242. package/dist/components/je-multiselect.js.map +1 -0
  243. package/dist/components/je-page.d.ts +11 -0
  244. package/dist/components/je-page.js +61 -0
  245. package/dist/components/je-page.js.map +1 -0
  246. package/dist/components/je-pill.d.ts +11 -0
  247. package/dist/components/je-pill.js +8 -0
  248. package/dist/components/je-pill.js.map +1 -0
  249. package/dist/components/je-placeholder.d.ts +11 -0
  250. package/dist/components/je-placeholder.js +40 -0
  251. package/dist/components/je-placeholder.js.map +1 -0
  252. package/dist/components/je-popover.d.ts +11 -0
  253. package/dist/components/je-popover.js +8 -0
  254. package/dist/components/je-popover.js.map +1 -0
  255. package/dist/components/je-radio-group.d.ts +11 -0
  256. package/dist/components/je-radio-group.js +92 -0
  257. package/dist/components/je-radio-group.js.map +1 -0
  258. package/dist/components/je-radio.d.ts +11 -0
  259. package/dist/components/je-radio.js +68 -0
  260. package/dist/components/je-radio.js.map +1 -0
  261. package/dist/components/je-select-option.d.ts +11 -0
  262. package/dist/components/je-select-option.js +56 -0
  263. package/dist/components/je-select-option.js.map +1 -0
  264. package/dist/components/je-select.d.ts +11 -0
  265. package/dist/components/je-select.js +208 -0
  266. package/dist/components/je-select.js.map +1 -0
  267. package/dist/components/je-tab.d.ts +11 -0
  268. package/dist/components/je-tab.js +37 -0
  269. package/dist/components/je-tab.js.map +1 -0
  270. package/dist/components/je-tabs.d.ts +11 -0
  271. package/dist/components/je-tabs.js +37 -0
  272. package/dist/components/je-tabs.js.map +1 -0
  273. package/dist/components/je-textarea.d.ts +11 -0
  274. package/dist/components/je-textarea.js +55 -0
  275. package/dist/components/je-textarea.js.map +1 -0
  276. package/dist/components/je-toast.d.ts +11 -0
  277. package/dist/components/je-toast.js +37 -0
  278. package/dist/components/je-toast.js.map +1 -0
  279. package/dist/components/je-toggle.d.ts +11 -0
  280. package/dist/components/je-toggle.js +57 -0
  281. package/dist/components/je-toggle.js.map +1 -0
  282. package/dist/components/je-toolbar.d.ts +11 -0
  283. package/dist/components/je-toolbar.js +37 -0
  284. package/dist/components/je-toolbar.js.map +1 -0
  285. package/dist/components/je-tree.d.ts +11 -0
  286. package/dist/components/je-tree.js +37 -0
  287. package/dist/components/je-tree.js.map +1 -0
  288. package/dist/components/p-1f3759e7.js +41 -0
  289. package/dist/components/p-1f3759e7.js.map +1 -0
  290. package/dist/components/p-243cc91b.js +50 -0
  291. package/dist/components/p-243cc91b.js.map +1 -0
  292. package/dist/components/p-2df369c4.js +265 -0
  293. package/dist/components/p-2df369c4.js.map +1 -0
  294. package/dist/components/p-41492a72.js +1514 -0
  295. package/dist/components/p-41492a72.js.map +1 -0
  296. package/dist/components/p-4b8ae8ef.js +51 -0
  297. package/dist/components/p-4b8ae8ef.js.map +1 -0
  298. package/dist/components/p-5dee004d.js +246 -0
  299. package/dist/components/p-5dee004d.js.map +1 -0
  300. package/dist/components/p-8401b4e4.js +48 -0
  301. package/dist/components/p-8401b4e4.js.map +1 -0
  302. package/dist/components/p-94327b0d.js +39 -0
  303. package/dist/components/p-94327b0d.js.map +1 -0
  304. package/dist/components/p-aa4caa39.js +76 -0
  305. package/dist/components/p-aa4caa39.js.map +1 -0
  306. package/dist/esm/app-globals-0f993ce5.js +5 -0
  307. package/dist/esm/app-globals-0f993ce5.js.map +1 -0
  308. package/dist/esm/index-a65634db.js +1692 -0
  309. package/dist/esm/index-a65634db.js.map +1 -0
  310. package/dist/esm/index.js +3 -0
  311. package/dist/esm/index.js.map +1 -0
  312. package/dist/esm/je-alert_31.entry.js +4738 -0
  313. package/dist/esm/je-alert_31.entry.js.map +1 -0
  314. package/dist/esm/je-branch.entry.js +18 -0
  315. package/dist/esm/je-branch.entry.js.map +1 -0
  316. package/dist/esm/je-column-group.entry.js +25 -0
  317. package/dist/esm/je-column-group.entry.js.map +1 -0
  318. package/dist/esm/je-column.entry.js +69 -0
  319. package/dist/esm/je-column.entry.js.map +1 -0
  320. package/dist/esm/je-infinite.entry.js +41 -0
  321. package/dist/esm/je-infinite.entry.js.map +1 -0
  322. package/dist/esm/je-menu-option.entry.js +18 -0
  323. package/dist/esm/je-menu-option.entry.js.map +1 -0
  324. package/dist/esm/je-menu.entry.js +18 -0
  325. package/dist/esm/je-menu.entry.js.map +1 -0
  326. package/dist/esm/je-tab.entry.js +18 -0
  327. package/dist/esm/je-tab.entry.js.map +1 -0
  328. package/dist/esm/je-tabs.entry.js +18 -0
  329. package/dist/esm/je-tabs.entry.js.map +1 -0
  330. package/dist/esm/je-toast.entry.js +18 -0
  331. package/dist/esm/je-toast.entry.js.map +1 -0
  332. package/dist/esm/je-tree.entry.js +18 -0
  333. package/dist/esm/je-tree.entry.js.map +1 -0
  334. package/dist/esm/jebamo.js +22 -0
  335. package/dist/esm/jebamo.js.map +1 -0
  336. package/dist/esm/loader.js +13 -0
  337. package/dist/esm/loader.js.map +1 -0
  338. package/dist/index.cjs.js +1 -0
  339. package/dist/index.js +1 -0
  340. package/dist/jebamo/index.esm.js +2 -0
  341. package/dist/jebamo/index.esm.js.map +1 -0
  342. package/dist/jebamo/jebamo.esm.js +2 -0
  343. package/dist/jebamo/jebamo.esm.js.map +1 -0
  344. package/dist/jebamo/p-0d0cb311.entry.js +2 -0
  345. package/dist/jebamo/p-0d0cb311.entry.js.map +1 -0
  346. package/dist/jebamo/p-254ac389.entry.js +2 -0
  347. package/dist/jebamo/p-254ac389.entry.js.map +1 -0
  348. package/dist/jebamo/p-286807aa.entry.js +2 -0
  349. package/dist/jebamo/p-286807aa.entry.js.map +1 -0
  350. package/dist/jebamo/p-44735e2f.entry.js +2 -0
  351. package/dist/jebamo/p-44735e2f.entry.js.map +1 -0
  352. package/dist/jebamo/p-456b52ee.js +3 -0
  353. package/dist/jebamo/p-456b52ee.js.map +1 -0
  354. package/dist/jebamo/p-5b8d9daf.entry.js +2 -0
  355. package/dist/jebamo/p-5b8d9daf.entry.js.map +1 -0
  356. package/dist/jebamo/p-c519a7a4.entry.js +2 -0
  357. package/dist/jebamo/p-c519a7a4.entry.js.map +1 -0
  358. package/dist/jebamo/p-c6111d19.entry.js +2 -0
  359. package/dist/jebamo/p-c6111d19.entry.js.map +1 -0
  360. package/dist/jebamo/p-c8615128.entry.js +2 -0
  361. package/dist/jebamo/p-c8615128.entry.js.map +1 -0
  362. package/dist/jebamo/p-e1255160.js +2 -0
  363. package/dist/jebamo/p-e1255160.js.map +1 -0
  364. package/dist/jebamo/p-e330c9bb.entry.js +2 -0
  365. package/dist/jebamo/p-e330c9bb.entry.js.map +1 -0
  366. package/dist/jebamo/p-f6e777be.entry.js +2 -0
  367. package/dist/jebamo/p-f6e777be.entry.js.map +1 -0
  368. package/dist/jebamo/p-ff27b55f.entry.js +2 -0
  369. package/dist/jebamo/p-ff27b55f.entry.js.map +1 -0
  370. package/dist/types/components/checkbox-group/je-checkbox-group/je-checkbox-group.d.ts +25 -0
  371. package/dist/types/components/checkbox-group/je-checkbox-option/je-checkbox-option.d.ts +30 -0
  372. package/dist/types/components/column/je-column/je-column.d.ts +31 -0
  373. package/dist/types/components/column/je-column-group/je-column-group.d.ts +9 -0
  374. package/dist/types/components/je-alert/je-alert.d.ts +77 -0
  375. package/dist/types/components/je-button/je-button.d.ts +28 -0
  376. package/dist/types/components/je-card/je-card.d.ts +6 -0
  377. package/dist/types/components/je-checkbox/je-checkbox.d.ts +38 -0
  378. package/dist/types/components/je-color/je-color.d.ts +12 -0
  379. package/dist/types/components/je-datepicker/je-datepicker.d.ts +18 -0
  380. package/dist/types/components/je-details/je-details.d.ts +6 -0
  381. package/dist/types/components/je-divider/je-divider.d.ts +5 -0
  382. package/dist/types/components/je-drawer/je-drawer.d.ts +10 -0
  383. package/dist/types/components/je-dropzone/je-dropzone.d.ts +10 -0
  384. package/dist/types/components/je-form/je-form.d.ts +12 -0
  385. package/dist/types/components/je-icon/je-icon.d.ts +15 -0
  386. package/dist/types/components/je-infinite/je-infinite.d.ts +25 -0
  387. package/dist/types/components/je-input/je-input.d.ts +155 -0
  388. package/dist/types/components/je-link/je-link.d.ts +22 -0
  389. package/dist/types/components/je-loading/je-loading.d.ts +22 -0
  390. package/dist/types/components/je-modal/je-modal.d.ts +28 -0
  391. package/dist/types/components/je-page/je-page.d.ts +12 -0
  392. package/dist/types/components/je-pill/je-pill.d.ts +6 -0
  393. package/dist/types/components/je-placeholder/je-placeholder.d.ts +7 -0
  394. package/dist/types/components/je-popover/je-popover.d.ts +70 -0
  395. package/dist/types/components/je-textarea/je-textarea.d.ts +11 -0
  396. package/dist/types/components/je-toast/je-toast.d.ts +3 -0
  397. package/dist/types/components/je-toggle/je-toggle.d.ts +18 -0
  398. package/dist/types/components/je-toolbar/je-toolbar.d.ts +3 -0
  399. package/dist/types/components/menu/je-menu/je-menu.d.ts +3 -0
  400. package/dist/types/components/menu/je-menu-option/je-menu-option.d.ts +3 -0
  401. package/dist/types/components/multiselect/je-multiselect/je-multiselect.d.ts +27 -0
  402. package/dist/types/components/multiselect/je-multiselect-option/je-multiselect-option.d.ts +11 -0
  403. package/dist/types/components/radio/je-radio/je-radio.d.ts +25 -0
  404. package/dist/types/components/radio/je-radio-group/je-radio-group.d.ts +32 -0
  405. package/dist/types/components/select/je-select/je-select.d.ts +23 -0
  406. package/dist/types/components/select/je-select-option/je-select-option.d.ts +10 -0
  407. package/dist/types/components/tabs/je-tab/je-tab.d.ts +3 -0
  408. package/dist/types/components/tabs/je-tabs/je-tabs.d.ts +3 -0
  409. package/dist/types/components/tree/je-branch/je-branch.d.ts +3 -0
  410. package/dist/types/components/tree/je-tree/je-tree.d.ts +3 -0
  411. package/dist/types/components.d.ts +1846 -0
  412. package/dist/types/index.d.ts +10 -0
  413. package/dist/types/stencil-public-runtime.d.ts +1674 -0
  414. package/dist/types/utils/utils.d.ts +4 -0
  415. package/loader/cdn.js +1 -0
  416. package/loader/index.cjs.js +1 -0
  417. package/loader/index.d.ts +24 -0
  418. package/loader/index.es2017.js +1 -0
  419. package/loader/index.js +2 -0
  420. package/loader/package.json +11 -0
  421. package/package.json +31 -26
  422. package/readme.md +114 -0
  423. package/README.md +0 -24
  424. package/esm2020/jebamo.mjs +0 -5
  425. package/esm2020/lib/jebamo.component.mjs +0 -19
  426. package/esm2020/lib/jebamo.module.mjs +0 -21
  427. package/esm2020/lib/jebamo.service.mjs +0 -14
  428. package/esm2020/public-api.mjs +0 -7
  429. package/fesm2015/jebamo.mjs +0 -60
  430. package/fesm2015/jebamo.mjs.map +0 -1
  431. package/fesm2020/jebamo.mjs +0 -60
  432. package/fesm2020/jebamo.mjs.map +0 -1
  433. package/index.d.ts +0 -5
  434. package/lib/jebamo.component.d.ts +0 -5
  435. package/lib/jebamo.module.d.ts +0 -7
  436. package/lib/jebamo.service.d.ts +0 -6
  437. package/public-api.d.ts +0 -3
@@ -0,0 +1,4738 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a65634db.js';
2
+
3
+ const jeAlertCss = ":host{display:block;--je-width:35%}@media (width < 1200px){:host{--je-width:75%}}.modal{display:flex;flex-direction:column;position:fixed;border-radius:var(--je-border-radius, 2px);overflow:hidden;top:20%;left:50%;transform:translate(-50%, -20%);z-index:910;width:var(--je-width);background-color:var(--je-background-color);color:var(--je-text-color);box-shadow:0px 0px 15px 5px rgba(77, 77, 77, 0.4509803922)}.content-container{display:flex;flex-direction:column;padding:24px}.content-container .header{display:flex;width:100%;align-items:center}.content-container .header .close{margin-left:auto;--je-background:var(--je-medium-850)}.content-container .controls{margin-top:16px}.content-container .buttons{margin-top:24px;display:flex;gap:var(--je-spacing);justify-content:flex-end}.modal-transition{opacity:0;transition:opacity 250ms ease-in-out}.modal.open{opacity:1}.backdrop{position:fixed;top:0;width:100%;height:100%;background:var(--je-backdrop-color);z-index:909}.backdrop-transition{opacity:0;transition:opacity 250ms ease-in-out}.backdrop.fade{opacity:1}.clear{background:rgba(0, 0, 0, 0)}";
4
+ const JeAlertStyle0 = jeAlertCss;
5
+
6
+ const JeAlert = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.didPresent = createEvent(this, "didPresent", 3);
10
+ this.didDismiss = createEvent(this, "didDismiss", 3);
11
+ this.didSubmit = createEvent(this, "didSubmit", 3);
12
+ this.handleBackdropClick = () => {
13
+ if (this.isOpen && this.backdropClose) {
14
+ this.dismiss('backdropClose');
15
+ }
16
+ };
17
+ this.isOpen = false;
18
+ this.header = undefined;
19
+ this.message = undefined;
20
+ this.icon = undefined;
21
+ this.buttons = undefined;
22
+ this.controls = undefined;
23
+ this.trigger = undefined;
24
+ this.showBackdrop = true;
25
+ this.backdropClose = true;
26
+ }
27
+ componentDidLoad() {
28
+ this.pageEl = this.el.closest('je-page');
29
+ this.parentEl = this.el.parentElement;
30
+ if (this.trigger) {
31
+ this.triggerElement = document.getElementById(this.trigger);
32
+ if (this.triggerElement) {
33
+ this.triggerElement.addEventListener('click', () => this.present());
34
+ }
35
+ else {
36
+ console.error('USS Core: Failed to find modal trigger element!');
37
+ }
38
+ }
39
+ }
40
+ async present() {
41
+ if (!this.isOpen) {
42
+ this.el.remove();
43
+ if (this.pageEl) {
44
+ this.pageEl.append(this.el);
45
+ }
46
+ else {
47
+ document.body.append(this.el);
48
+ }
49
+ this.isOpen = true;
50
+ return new Promise(resolve => {
51
+ this.contentEl.addEventListener('transitionend', () => {
52
+ this.didPresent.emit();
53
+ resolve();
54
+ }, { once: true });
55
+ this.backdropEl.classList.add('fade');
56
+ this.contentEl.classList.add('open');
57
+ });
58
+ }
59
+ }
60
+ async dismiss(role = 'manualClose', data) {
61
+ if (this.isOpen) {
62
+ return new Promise(resolve => {
63
+ this.contentEl.addEventListener('transitionend', () => {
64
+ this.el.remove();
65
+ this.parentEl.append(this.el);
66
+ this.isOpen = false;
67
+ this.didDismiss.emit({ role: role, data: data });
68
+ resolve();
69
+ }, { once: true });
70
+ this.backdropEl.classList.remove('fade');
71
+ this.contentEl.classList.remove('open');
72
+ });
73
+ }
74
+ }
75
+ render() {
76
+ const content = h("je-form", { key: 'b7046e7fa228538a683ec0d0611ad030b4fba1cb', onSubmit: (ev) => this.didSubmit.emit(ev) }, h("div", { key: '3880885a9dd3c61fc3eb1d0329ee8def64a2935e', class: "content-container" }, this.header && h("div", { key: 'a399b5ac5e3ccd7bea29826e8ffe92ff7969e701', class: "header" }, this.icon && h("je-icon", { key: '8e6226b9d40d1136c5ba164fb91dc56ec854d6dd', icon: this.icon }), h("h1", { key: '9b0865e01e3e0d527affb53e11754312f40c4dc7' }, this.header), h("je-button", { key: 'be0c3cdd9761f3a54c4f3f82339b16d9f22c4678', fill: 'clear', "icon-only": true, class: "close", onClick: () => this.dismiss() }, h("je-icon", { key: 'ff5ece6eb0678c017fe0474e8da58a19219baf71', icon: "close" }))), this.message && h("div", { key: '40b3a196ccbbc0e533f5054ded0989a27d5023a7', class: "message" }, this.message), this.controls && h("div", { key: 'fe9f0530966919f995fc7d90b22f408c2a16f09a', class: "controls" }, this.controls.map(control => (h("je-input", { type: control.type, required: control.required, label: control.label, placeholder: control.placeholder, validators: control.validators })))), this.buttons && h("div", { key: 'fa19ebc95e36955d4a2323d99d2856429203114b', class: "buttons" }, this.buttons.map(button => (h("je-button", { fill: button.fill, type: button.type, color: button.color, onClick: () => button.handler(this.el) }, button.text))))));
77
+ return (h(Host, { key: 'bf6df0e328fbe2785353b02e72dc85f18534be45', slot: 'overlay' }, h("div", { key: 'accdd9fc3059b7348fa342a166606fc2dfbe51f7', ref: el => this.contentEl = el, class: { 'modal-transition': true, 'modal': this.isOpen } }, this.isOpen && content), h("div", { key: 'bf2c4115d133199138d47520e6e12bec3bc76657', ref: el => this.backdropEl = el, onClick: this.handleBackdropClick, class: { 'backdrop-transition': true, 'backdrop': this.isOpen, 'clear': !this.showBackdrop && this.isOpen } })));
78
+ }
79
+ get el() { return getElement(this); }
80
+ };
81
+ JeAlert.style = JeAlertStyle0;
82
+
83
+ const jeButtonCss = ":host{display:block;width:fit-content;position:relative;--je-button-height:40px;--je-button-width:auto;--je-button-min-width:80px;--je-button-font-size:1.1em;--je-button-inline-padding:12px;--je-button-color:var(--je-primary-100, buttontext);--je-button-background:var(--je-primary-500, buttonface);--je-button-hover-background:var(--je-primary-600, buttonface);--je-button-active-background:var(--je-primary-700, buttonface)}:host([color=error]),:host([color=auto][error]){--je-button-color:var(--je-error-100);--je-button-background:var(--je-error-500);--je-button-hover-background:var(--je-error-600);--je-button-active-background:var(--je-error-700)}:host([color=secondary]),:host([color=auto][secondary]){--je-button-color:var(--je-secondary-100);--je-button-background:var(--je-secondary-500);--je-button-hover-background:var(--je-secondary-600);--je-button-active-background:var(--je-secondary-700)}:host([color=tertiary]),:host([color=auto][tertiary]){--je-button-color:var(--je-tertiary-100);--je-button-background:var(--je-tertiary-500);--je-button-hover-background:var(--je-tertiary-600);--je-button-active-background:var(--je-tertiary-700)}:host([color=warning]),:host([color=auto][warning]){--je-button-color:var(--je-warning-100);--je-button-background:var(--je-warning-500);--je-button-hover-background:var(--je-warning-600);--je-button-active-background:var(--je-warning-700)}:host([color=success]),:host([color=auto][success]){--je-button-color:var(--je-success-100);--je-button-background:var(--je-success-500);--je-button-hover-background:var(--je-success-600);--je-button-active-background:var(--je-success-700)}:host([color=medium]),:host([color=auto][medium]){--je-button-color:var(--je-medium-50);--je-button-background:var(--je-medium-500);--je-button-hover-background:var(--je-medium-600);--je-button-active-background:var(--je-medium-700)}:host([color=light]),:host([color=auto][light]){--je-button-color:var(--je-medium-900);--je-button-background:var(--je-medium-100);--je-button-hover-background:var(--je-medium-400);--je-button-active-background:var(--je-medium-500)}:host([color=dark]),:host([color=auto][dark]){--je-button-color:var(--je-medium-50);--je-button-background:var(--je-medium-850);--je-button-hover-background:var(--je-medium-850);--je-button-active-background:var(--je-medium-900)}:host([expand]){width:100%;--je-button-width:100%}:host([icon-only]){--je-button-min-width:2px;--je-button-inline-padding:0}:host([size=sm]){--je-button-min-width:60px;--je-button-height:30px;--je-button-font-size:0.9em;--je-button-inline-padding:8px}:host([size=lg]){--je-button-min-width:100px;--je-button-height:50px;--je-button-font-size:1.3em;--je-button-inline-padding:20px}button{display:flex;align-items:center;justify-content:center;gap:4px;position:relative;box-sizing:border-box;border:none;border-radius:var(--je-border-radius, 2px);padding-inline:var(--je-button-inline-padding);cursor:pointer;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;text-transform:uppercase;text-wrap:wrap;font-family:var(--je-font-family);font-size:var(--je-button-font-size);font-weight:var(--je-font-semi-bold);width:var(--je-button-width);height:var(--je-button-height);min-width:var(--je-button-min-width);color:var(--je-button-color);background-color:var(--je-button-background);transition:all 125ms ease-in-out}@media (hover: hover){button:hover{--je-button-background:var(--je-button-hover-background)}}button:active{--je-button-background:var(--je-button-active-background)}button:disabled{opacity:0.8;cursor:default}:host([fill=outline]) button{color:var(--je-button-background);background-color:transparent;border:solid 1px var(--je-button-background)}:host([fill=clear]) button{color:var(--je-button-background);background-color:transparent;font-weight:var(--je-font-bold)}@media (hover: hover){:host([fill=clear]) button:hover{opacity:0.8}}::slotted(je-icon){cursor:pointer}::slotted([slot=badge]){top:0;right:0;position:absolute;transform:translate(50%, -50%);border-radius:14px;color:var(--je-button-background);background-color:var(--je-button-color);padding-inline:4px;height:20px;display:flex;align-items:center;justify-content:center}";
84
+ const JeButtonStyle0 = jeButtonCss;
85
+
86
+ const JeButton = class {
87
+ constructor(hostRef) {
88
+ registerInstance(this, hostRef);
89
+ this.disabled = false;
90
+ this.type = 'button';
91
+ this.expand = false;
92
+ this.iconOnly = false;
93
+ this.fill = 'solid';
94
+ this.size = 'md';
95
+ this.color = 'primary';
96
+ this.lightModeColor = 'dark';
97
+ this.darkModeColor = 'light';
98
+ }
99
+ componentDidLoad() {
100
+ if (this.type == 'submit' || this.type == 'reset') {
101
+ this.formEl = this.el.closest('form');
102
+ if (this.formEl) {
103
+ this.formButtonEl = document.createElement('button');
104
+ this.formButtonEl.type = this.type;
105
+ this.formButtonEl.style.display = 'none';
106
+ this.formEl.append(this.formButtonEl);
107
+ }
108
+ }
109
+ }
110
+ handleThemeChange(e) {
111
+ if (this.color == 'auto') {
112
+ this.el.toggleAttribute(this.lightModeColor, e.detail == 'light');
113
+ this.el.toggleAttribute(this.darkModeColor, e.detail == 'dark');
114
+ }
115
+ }
116
+ handleClick() {
117
+ if (this.formButtonEl) {
118
+ this.formButtonEl.click();
119
+ }
120
+ }
121
+ render() {
122
+ return (h("button", { key: 'ebf16b4d043ac8346c34475bc6424f3f8d537bfb', part: 'inner-button', disabled: this.disabled, type: this.type }, h("slot", { key: '4a2f527ad436bcf5bdc1f9ae84034388bda0e674' }), h("slot", { key: '0e7d1c98c5b242a0f9c29cb47a893ac408557808', name: 'badge' })));
123
+ }
124
+ get el() { return getElement(this); }
125
+ };
126
+ JeButton.style = JeButtonStyle0;
127
+
128
+ const jeCardCss = ":host{display:block;border:solid 1px var(--je-card-border-color);border-radius:var(--je-border-radius, 2px);overflow:hidden;box-sizing:border-box;position:relative;color:var(--je-card-color);background-color:var(--je-card-background);--je-card-color:inherit;--je-card-background:inherit;--je-card-hover-background:#9f9e9e0e;--je-card-active-background:#9f9e9e19;--je-card-border-color:var(--je-medium-300)}:host([button]){cursor:pointer;user-select:none;-webkit-user-select:none;transition:all 125ms ease-in-out}:host([button]:hover){background-color:var(--je-card-hover-background)}:host([button]:active){background-color:var(--je-card-active-background)}:host([color=error]){--je-card-color:var(--je-error-100);--je-card-background:var(--je-error-500);--je-card-hover-background:var(--je-error-600);--je-card-active-background:var(--je-error-700);--je-card-border-color:var(--je-error-300)}:host([color=secondary]){--je-card-color:var(--je-secondary-100);--je-card-background:var(--je-secondary-500);--je-card-hover-background:var(--je-secondary-600);--je-card-active-background:var(--je-secondary-700);--je-card-border-color:var(--je-secondary-300)}:host([color=tertiary]){--je-card-color:var(--je-tertiary-100);--je-card-background:var(--je-tertiary-500);--je-card-hover-background:var(--je-tertiary-600);--je-card-active-background:var(--je-tertiary-700);--je-card-border-color:var(--je-tertiary-300)}:host([color=warning]){--je-card-color:var(--je-warning-100);--je-card-background:var(--je-warning-500);--je-card-hover-background:var(--je-warning-600);--je-card-active-background:var(--je-warning-700);--je-card-border-color:var(--je-warning-300)}:host([color=success]){--je-card-color:var(--je-success-100);--je-card-background:var(--je-success-500);--je-card-hover-background:var(--je-success-600);--je-card-active-background:var(--je-success-700);--je-card-border-color:var(--je-success-300)}:host([color=medium]){--je-card-color:var(--je-medium-50);--je-card-background:var(--je-medium-500);--je-card-hover-background:var(--je-medium-600);--je-card-active-background:var(--je-medium-700)}:host([color=light]){--je-card-color:var(--je-medium-900);--je-card-background:var(--je-medium-100);--je-card-hover-background:var(--je-medium-400);--je-card-active-background:var(--je-medium-500)}:host([color=dark]){--je-card-color:var(--je-medium-50);--je-card-background:var(--je-medium-850);--je-card-hover-background:var(--je-medium-850);--je-card-active-background:var(--je-medium-900)}::slotted([slot=media]){width:100%}::slotted([slot=header]){box-sizing:border-box;padding-inline:var(--je-spacing-xs, 10px);border-bottom:solid 1px var(--je-card-border-color)}::slotted([slot=footer]){box-sizing:border-box;display:flex;padding-block:var(--je-spacing-xs, 10px);gap:var(--je-spacing-2xs, 8px)}.container{box-sizing:border-box;padding:var(--je-spacing-xs, 10px)}";
129
+ const JeCardStyle0 = jeCardCss;
130
+
131
+ const JeCard = class {
132
+ constructor(hostRef) {
133
+ registerInstance(this, hostRef);
134
+ this.color = undefined;
135
+ this.button = undefined;
136
+ }
137
+ render() {
138
+ return (h(Host, { key: '33f8bed14daea376f91f0ae6c948235a54a7a135' }, h("slot", { key: '5a108e5cc5339c21ae02ce1913b632856787825c', name: 'media' }), h("slot", { key: 'a6d8fc7f088f3d7b9512e27292d890cf5198ece6', name: 'header' }), h("div", { key: '5edfea57c094c3ca6504c2657fbd014d11eb5889', class: 'container' }, h("slot", { key: '47646e973cee3cbcb526f12b65404034ace999ca' }), h("slot", { key: 'e34763d24d6652f18463aeceb06c3f5db729ac06', name: 'footer' }))));
139
+ }
140
+ };
141
+ JeCard.style = JeCardStyle0;
142
+
143
+ const jeCheckboxCss = ":host{display:flex;align-items:center;gap:var(--je-spacing-2xs);width:fit-content;cursor:pointer;-webkit-user-select:none;user-select:none}je-icon{cursor:pointer;color:var(--je-primary-500)}";
144
+ const JeCheckboxStyle0 = jeCheckboxCss;
145
+
146
+ const JeCheckbox = class {
147
+ constructor(hostRef) {
148
+ registerInstance(this, hostRef);
149
+ this.valueChange = createEvent(this, "valueChange", 3);
150
+ if (hostRef.$hostElement$["s-ei"]) {
151
+ this.internals = hostRef.$hostElement$["s-ei"];
152
+ }
153
+ else {
154
+ this.internals = hostRef.$hostElement$.attachInternals();
155
+ hostRef.$hostElement$["s-ei"] = this.internals;
156
+ }
157
+ this.value = undefined;
158
+ this.labelPlacement = 'end';
159
+ this.indeterminate = false;
160
+ this.labelOnly = false;
161
+ this.readonly = false;
162
+ this.disabled = false;
163
+ }
164
+ componentWillLoad() {
165
+ if (this.value === undefined && !this.indeterminate) {
166
+ this.value = false;
167
+ }
168
+ this.originalValue = this.value;
169
+ }
170
+ formResetCallback() {
171
+ if (this.value !== this.originalValue) {
172
+ this.value = this.originalValue;
173
+ }
174
+ }
175
+ onClick() {
176
+ if (!this.readonly && !this.disabled) {
177
+ if (!this.indeterminate) {
178
+ this.value = !this.value;
179
+ }
180
+ else {
181
+ // when indeterminate, the flow is false -> true -> null
182
+ this.value = this.value == false ? true : this.value == true ? null : false;
183
+ }
184
+ this.valueChange.emit(this.value);
185
+ }
186
+ }
187
+ render() {
188
+ return (h(Host, { key: '492df32418a1fad791e502a04dd1f4704af73c19' }, this.labelPlacement == 'start' && h("slot", { key: 'b1fe9f38f42da604059158012be57f08ea6c0223' }), h("je-icon", { key: 'de6acfe6dc089be11e12c7948a7be20b3d6af7f4', icon: this.value === true ? 'check_box' : this.value === false ? 'check_box_outline_blank' : 'indeterminate_check_box' }), this.labelPlacement == 'end' && h("slot", { key: '2f6b3feb823cc374566845bbc0a73c4280644376' })));
189
+ }
190
+ static get formAssociated() { return true; }
191
+ get el() { return getElement(this); }
192
+ };
193
+ JeCheckbox.style = JeCheckboxStyle0;
194
+
195
+ const jeCheckboxGroupCss = ":host{display:block;width:fit-content}label{display:block;font-weight:var(--je-font-semi-bold);margin-bottom:var(--je-spacing-2xs)}";
196
+ const JeCheckboxGroupStyle0 = jeCheckboxGroupCss;
197
+
198
+ const JeCheckboxGroup = class {
199
+ constructor(hostRef) {
200
+ registerInstance(this, hostRef);
201
+ this.valueChange = createEvent(this, "valueChange", 3);
202
+ this.label = undefined;
203
+ this.value = [];
204
+ }
205
+ componentWillLoad() {
206
+ if (!Array.isArray(this.value)) {
207
+ this.value = [];
208
+ }
209
+ this.originalValue = this.value;
210
+ if (this.label) {
211
+ this.el.setAttribute('name', this.label);
212
+ }
213
+ }
214
+ componentDidLoad() {
215
+ if (this.value) {
216
+ const checkboxes = this.getChecks();
217
+ for (let item of checkboxes) {
218
+ item.checked = this.value.includes(item.value);
219
+ }
220
+ }
221
+ }
222
+ formResetCallback() {
223
+ this.value = this.originalValue;
224
+ }
225
+ getChecks() {
226
+ const elements = this.el.querySelectorAll('je-checkbox-option');
227
+ return Array.from(elements);
228
+ }
229
+ handleValueChange() {
230
+ this.valueChange.emit(this.value);
231
+ const checkboxes = this.getChecks();
232
+ for (let checkbox of checkboxes) {
233
+ const includes = this.value.includes(checkbox.value);
234
+ if (checkbox.checked != includes) {
235
+ checkbox.checked = includes;
236
+ }
237
+ }
238
+ }
239
+ handleCheck(ev) {
240
+ this.value = [ev.detail, ...this.value];
241
+ }
242
+ handleUncheck(ev) {
243
+ this.value = this.value.filter(t => t !== ev.detail);
244
+ }
245
+ render() {
246
+ return (h(Host, { key: '7d3112f65038d79a8ca5ebbba5bceb7b07ff401d' }, this.label && h("label", { key: '7f71075409ca98d45e18974ee1bda4a6afec859a' }, this.label), h("slot", { key: '2473328de9c142d0c972a32228edac8f51b66b38' })));
247
+ }
248
+ static get formAssociated() { return true; }
249
+ get el() { return getElement(this); }
250
+ static get watchers() { return {
251
+ "value": ["handleValueChange"]
252
+ }; }
253
+ };
254
+ JeCheckboxGroup.style = JeCheckboxGroupStyle0;
255
+
256
+ const jeCheckboxOptionCss = ":host{display:flex;align-items:center;gap:var(--je-spacing-2xs);cursor:pointer;-webkit-user-select:none;user-select:none}je-icon{cursor:pointer;color:var(--je-primary-500)}";
257
+ const JeCheckboxOptionStyle0 = jeCheckboxOptionCss;
258
+
259
+ const JeCheckboxOption = class {
260
+ constructor(hostRef) {
261
+ registerInstance(this, hostRef);
262
+ this.check = createEvent(this, "check", 7);
263
+ this.uncheck = createEvent(this, "uncheck", 7);
264
+ this.value = undefined;
265
+ this.checked = false;
266
+ this.readonly = false;
267
+ this.disabled = false;
268
+ }
269
+ onClick() {
270
+ if (!this.readonly && !this.disabled) {
271
+ if (this.checked) {
272
+ this.uncheck.emit(this.value);
273
+ }
274
+ else {
275
+ this.check.emit(this.value);
276
+ }
277
+ }
278
+ }
279
+ render() {
280
+ return (h(Host, { key: '39b01f92be46d74b1efda5259bf766495694331b' }, h("je-icon", { key: '42ad722098b6094f4edbae636282a7b2fb0a4497', icon: this.checked ? 'check_box' : 'check_box_outline_blank' }), h("slot", { key: 'a7591297da5fa8b50576a21341c2480bfed86e07' })));
281
+ }
282
+ get el() { return getElement(this); }
283
+ };
284
+ JeCheckboxOption.style = JeCheckboxOptionStyle0;
285
+
286
+ const jeColorCss = ":host{display:inline-block}:host([color=primary]),:host([color=auto][primary]){color:var(--je-primary-500)}:host([color=error]),:host([color=auto][error]){color:var(--je-error-500)}:host([color=secondary]),:host([color=auto][secondary]){color:var(--je-secondary-500)}:host([color=tertiary]),:host([color=auto][tertiary]){color:var(--je-tertiary-500)}:host([color=warning]),:host([color=auto][warning]){color:var(--je-warning-500)}:host([color=success]),:host([color=auto][success]){color:var(--je-success-500)}:host([color=medium]),:host([color=auto][medium]){color:var(--je-medium-500)}:host([color=light]),:host([color=auto][light]){color:var(--je-medium-100)}:host([color=dark]),:host([color=auto][dark]){color:var(--je-medium-850)}";
287
+ const JeColorStyle0 = jeColorCss;
288
+
289
+ const JeColor = class {
290
+ constructor(hostRef) {
291
+ registerInstance(this, hostRef);
292
+ this.color = 'primary';
293
+ this.lightModeColor = 'dark';
294
+ this.darkModeColor = 'light';
295
+ }
296
+ handleThemeChange(e) {
297
+ if (this.color == 'auto') {
298
+ this.el.toggleAttribute(this.lightModeColor, e.detail == 'light');
299
+ this.el.toggleAttribute(this.darkModeColor, e.detail == 'dark');
300
+ }
301
+ }
302
+ render() {
303
+ return (h(Host, { key: 'f282f9cc373d41672e2f89d28ca63ae2eb68bead' }, h("slot", { key: '595b55df77aa90cd06c63e96a3eb2f2a1a5d300f' })));
304
+ }
305
+ get el() { return getElement(this); }
306
+ };
307
+ JeColor.style = JeColorStyle0;
308
+
309
+ /**
310
+ * @module constants
311
+ * @summary Useful constants
312
+ * @description
313
+ * Collection of useful date constants.
314
+ *
315
+ * The constants could be imported from `date-fns/constants`:
316
+ *
317
+ * ```ts
318
+ * import { maxTime, minTime } from "./constants/date-fns/constants";
319
+ *
320
+ * function isAllowedTime(time) {
321
+ * return time <= maxTime && time >= minTime;
322
+ * }
323
+ * ```
324
+ */
325
+
326
+ /**
327
+ * @constant
328
+ * @name millisecondsInWeek
329
+ * @summary Milliseconds in 1 week.
330
+ */
331
+ const millisecondsInWeek = 604800000;
332
+
333
+ /**
334
+ * @constant
335
+ * @name millisecondsInDay
336
+ * @summary Milliseconds in 1 day.
337
+ */
338
+ const millisecondsInDay = 86400000;
339
+
340
+ /**
341
+ * @constant
342
+ * @name constructFromSymbol
343
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
344
+ *
345
+ * The symbol is used to enable the `constructFrom` function to construct a date
346
+ * using a reference date and a value. It allows to transfer extra properties
347
+ * from the reference date to the new date. It's useful for extensions like
348
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
349
+ * a constructor argument.
350
+ */
351
+ const constructFromSymbol = Symbol.for("constructDateFrom");
352
+
353
+ /**
354
+ * @name constructFrom
355
+ * @category Generic Helpers
356
+ * @summary Constructs a date using the reference date and the value
357
+ *
358
+ * @description
359
+ * The function constructs a new date using the constructor from the reference
360
+ * date and the given value. It helps to build generic functions that accept
361
+ * date extensions.
362
+ *
363
+ * It defaults to `Date` if the passed reference date is a number or a string.
364
+ *
365
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
366
+ * enabling to transfer extra properties from the reference date to the new date.
367
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
368
+ * that accept a time zone as a constructor argument.
369
+ *
370
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
371
+ *
372
+ * @param date - The reference date to take constructor from
373
+ * @param value - The value to create the date
374
+ *
375
+ * @returns Date initialized using the given date and value
376
+ *
377
+ * @example
378
+ * import { constructFrom } from "./constructFrom/date-fns";
379
+ *
380
+ * // A function that clones a date preserving the original type
381
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
382
+ * return constructFrom(
383
+ * date, // Use constructor from the given date
384
+ * date.getTime() // Use the date value to create a new date
385
+ * );
386
+ * }
387
+ */
388
+ function constructFrom(date, value) {
389
+ if (typeof date === "function") return date(value);
390
+
391
+ if (date && typeof date === "object" && constructFromSymbol in date)
392
+ return date[constructFromSymbol](value);
393
+
394
+ if (date instanceof Date) return new date.constructor(value);
395
+
396
+ return new Date(value);
397
+ }
398
+
399
+ /**
400
+ * @name toDate
401
+ * @category Common Helpers
402
+ * @summary Convert the given argument to an instance of Date.
403
+ *
404
+ * @description
405
+ * Convert the given argument to an instance of Date.
406
+ *
407
+ * If the argument is an instance of Date, the function returns its clone.
408
+ *
409
+ * If the argument is a number, it is treated as a timestamp.
410
+ *
411
+ * If the argument is none of the above, the function returns Invalid Date.
412
+ *
413
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
414
+ * enabling to transfer extra properties from the reference date to the new date.
415
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
416
+ * that accept a time zone as a constructor argument.
417
+ *
418
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
419
+ *
420
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
421
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
422
+ *
423
+ * @param argument - The value to convert
424
+ *
425
+ * @returns The parsed date in the local time zone
426
+ *
427
+ * @example
428
+ * // Clone the date:
429
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
430
+ * //=> Tue Feb 11 2014 11:30:30
431
+ *
432
+ * @example
433
+ * // Convert the timestamp to date:
434
+ * const result = toDate(1392098430000)
435
+ * //=> Tue Feb 11 2014 11:30:30
436
+ */
437
+ function toDate(argument, context) {
438
+ // [TODO] Get rid of `toDate` or `constructFrom`?
439
+ return constructFrom(context || argument, argument);
440
+ }
441
+
442
+ /**
443
+ * The {@link addMonths} function options.
444
+ */
445
+
446
+ /**
447
+ * @name addMonths
448
+ * @category Month Helpers
449
+ * @summary Add the specified number of months to the given date.
450
+ *
451
+ * @description
452
+ * Add the specified number of months to the given date.
453
+ *
454
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
455
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
456
+ *
457
+ * @param date - The date to be changed
458
+ * @param amount - The amount of months to be added.
459
+ * @param options - The options object
460
+ *
461
+ * @returns The new date with the months added
462
+ *
463
+ * @example
464
+ * // Add 5 months to 1 September 2014:
465
+ * const result = addMonths(new Date(2014, 8, 1), 5)
466
+ * //=> Sun Feb 01 2015 00:00:00
467
+ *
468
+ * // Add one month to 30 January 2023:
469
+ * const result = addMonths(new Date(2023, 0, 30), 1)
470
+ * //=> Tue Feb 28 2023 00:00:00
471
+ */
472
+ function addMonths(date, amount, options) {
473
+ const _date = toDate(date, options?.in);
474
+ if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
475
+ if (!amount) {
476
+ // If 0 months, no-op to avoid changing times in the hour before end of DST
477
+ return _date;
478
+ }
479
+ const dayOfMonth = _date.getDate();
480
+
481
+ // The JS Date object supports date math by accepting out-of-bounds values for
482
+ // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and
483
+ // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we
484
+ // want except that dates will wrap around the end of a month, meaning that
485
+ // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So
486
+ // we'll default to the end of the desired month by adding 1 to the desired
487
+ // month and using a date of 0 to back up one day to the end of the desired
488
+ // month.
489
+ const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
490
+ endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
491
+ const daysInMonth = endOfDesiredMonth.getDate();
492
+ if (dayOfMonth >= daysInMonth) {
493
+ // If we're already at the end of the month, then this is the correct date
494
+ // and we're done.
495
+ return endOfDesiredMonth;
496
+ } else {
497
+ // Otherwise, we now know that setting the original day-of-month value won't
498
+ // cause an overflow, so set the desired day-of-month. Note that we can't
499
+ // just set the date of `endOfDesiredMonth` because that object may have had
500
+ // its time changed in the unusual case where where a DST transition was on
501
+ // the last day of the month and its local time was in the hour skipped or
502
+ // repeated next to a DST transition. So we use `date` instead which is
503
+ // guaranteed to still have the original time.
504
+ _date.setFullYear(
505
+ endOfDesiredMonth.getFullYear(),
506
+ endOfDesiredMonth.getMonth(),
507
+ dayOfMonth,
508
+ );
509
+ return _date;
510
+ }
511
+ }
512
+
513
+ let defaultOptions = {};
514
+
515
+ function getDefaultOptions() {
516
+ return defaultOptions;
517
+ }
518
+
519
+ /**
520
+ * The {@link startOfWeek} function options.
521
+ */
522
+
523
+ /**
524
+ * @name startOfWeek
525
+ * @category Week Helpers
526
+ * @summary Return the start of a week for the given date.
527
+ *
528
+ * @description
529
+ * Return the start of a week for the given date.
530
+ * The result will be in the local timezone.
531
+ *
532
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
533
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
534
+ *
535
+ * @param date - The original date
536
+ * @param options - An object with options
537
+ *
538
+ * @returns The start of a week
539
+ *
540
+ * @example
541
+ * // The start of a week for 2 September 2014 11:55:00:
542
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
543
+ * //=> Sun Aug 31 2014 00:00:00
544
+ *
545
+ * @example
546
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
547
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
548
+ * //=> Mon Sep 01 2014 00:00:00
549
+ */
550
+ function startOfWeek(date, options) {
551
+ const defaultOptions = getDefaultOptions();
552
+ const weekStartsOn =
553
+ options?.weekStartsOn ??
554
+ options?.locale?.options?.weekStartsOn ??
555
+ defaultOptions.weekStartsOn ??
556
+ defaultOptions.locale?.options?.weekStartsOn ??
557
+ 0;
558
+
559
+ const _date = toDate(date, options?.in);
560
+ const day = _date.getDay();
561
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
562
+
563
+ _date.setDate(_date.getDate() - diff);
564
+ _date.setHours(0, 0, 0, 0);
565
+ return _date;
566
+ }
567
+
568
+ /**
569
+ * The {@link startOfISOWeek} function options.
570
+ */
571
+
572
+ /**
573
+ * @name startOfISOWeek
574
+ * @category ISO Week Helpers
575
+ * @summary Return the start of an ISO week for the given date.
576
+ *
577
+ * @description
578
+ * Return the start of an ISO week for the given date.
579
+ * The result will be in the local timezone.
580
+ *
581
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
582
+ *
583
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
584
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
585
+ *
586
+ * @param date - The original date
587
+ * @param options - An object with options
588
+ *
589
+ * @returns The start of an ISO week
590
+ *
591
+ * @example
592
+ * // The start of an ISO week for 2 September 2014 11:55:00:
593
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
594
+ * //=> Mon Sep 01 2014 00:00:00
595
+ */
596
+ function startOfISOWeek(date, options) {
597
+ return startOfWeek(date, { ...options, weekStartsOn: 1 });
598
+ }
599
+
600
+ /**
601
+ * The {@link getISOWeekYear} function options.
602
+ */
603
+
604
+ /**
605
+ * @name getISOWeekYear
606
+ * @category ISO Week-Numbering Year Helpers
607
+ * @summary Get the ISO week-numbering year of the given date.
608
+ *
609
+ * @description
610
+ * Get the ISO week-numbering year of the given date,
611
+ * which always starts 3 days before the year's first Thursday.
612
+ *
613
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
614
+ *
615
+ * @param date - The given date
616
+ *
617
+ * @returns The ISO week-numbering year
618
+ *
619
+ * @example
620
+ * // Which ISO-week numbering year is 2 January 2005?
621
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
622
+ * //=> 2004
623
+ */
624
+ function getISOWeekYear(date, options) {
625
+ const _date = toDate(date, options?.in);
626
+ const year = _date.getFullYear();
627
+
628
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
629
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
630
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
631
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
632
+
633
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
634
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
635
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
636
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
637
+
638
+ if (_date.getTime() >= startOfNextYear.getTime()) {
639
+ return year + 1;
640
+ } else if (_date.getTime() >= startOfThisYear.getTime()) {
641
+ return year;
642
+ } else {
643
+ return year - 1;
644
+ }
645
+ }
646
+
647
+ /**
648
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
649
+ * They usually appear for dates that denote time before the timezones were introduced
650
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
651
+ * and GMT+01:00:00 after that date)
652
+ *
653
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
654
+ * which would lead to incorrect calculations.
655
+ *
656
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
657
+ */
658
+ function getTimezoneOffsetInMilliseconds(date) {
659
+ const _date = toDate(date);
660
+ const utcDate = new Date(
661
+ Date.UTC(
662
+ _date.getFullYear(),
663
+ _date.getMonth(),
664
+ _date.getDate(),
665
+ _date.getHours(),
666
+ _date.getMinutes(),
667
+ _date.getSeconds(),
668
+ _date.getMilliseconds(),
669
+ ),
670
+ );
671
+ utcDate.setUTCFullYear(_date.getFullYear());
672
+ return +date - +utcDate;
673
+ }
674
+
675
+ function normalizeDates(context, ...dates) {
676
+ const normalize = constructFrom.bind(
677
+ null,
678
+ context || dates.find((date) => typeof date === "object"),
679
+ );
680
+ return dates.map(normalize);
681
+ }
682
+
683
+ /**
684
+ * The {@link startOfDay} function options.
685
+ */
686
+
687
+ /**
688
+ * @name startOfDay
689
+ * @category Day Helpers
690
+ * @summary Return the start of a day for the given date.
691
+ *
692
+ * @description
693
+ * Return the start of a day for the given date.
694
+ * The result will be in the local timezone.
695
+ *
696
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
697
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
698
+ *
699
+ * @param date - The original date
700
+ * @param options - The options
701
+ *
702
+ * @returns The start of a day
703
+ *
704
+ * @example
705
+ * // The start of a day for 2 September 2014 11:55:00:
706
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
707
+ * //=> Tue Sep 02 2014 00:00:00
708
+ */
709
+ function startOfDay(date, options) {
710
+ const _date = toDate(date, options?.in);
711
+ _date.setHours(0, 0, 0, 0);
712
+ return _date;
713
+ }
714
+
715
+ /**
716
+ * The {@link differenceInCalendarDays} function options.
717
+ */
718
+
719
+ /**
720
+ * @name differenceInCalendarDays
721
+ * @category Day Helpers
722
+ * @summary Get the number of calendar days between the given dates.
723
+ *
724
+ * @description
725
+ * Get the number of calendar days between the given dates. This means that the times are removed
726
+ * from the dates and then the difference in days is calculated.
727
+ *
728
+ * @param laterDate - The later date
729
+ * @param earlierDate - The earlier date
730
+ * @param options - The options object
731
+ *
732
+ * @returns The number of calendar days
733
+ *
734
+ * @example
735
+ * // How many calendar days are between
736
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
737
+ * const result = differenceInCalendarDays(
738
+ * new Date(2012, 6, 2, 0, 0),
739
+ * new Date(2011, 6, 2, 23, 0)
740
+ * )
741
+ * //=> 366
742
+ * // How many calendar days are between
743
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
744
+ * const result = differenceInCalendarDays(
745
+ * new Date(2011, 6, 3, 0, 1),
746
+ * new Date(2011, 6, 2, 23, 59)
747
+ * )
748
+ * //=> 1
749
+ */
750
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
751
+ const [laterDate_, earlierDate_] = normalizeDates(
752
+ options?.in,
753
+ laterDate,
754
+ earlierDate,
755
+ );
756
+
757
+ const laterStartOfDay = startOfDay(laterDate_);
758
+ const earlierStartOfDay = startOfDay(earlierDate_);
759
+
760
+ const laterTimestamp =
761
+ +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
762
+ const earlierTimestamp =
763
+ +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
764
+
765
+ // Round the number of days to the nearest integer because the number of
766
+ // milliseconds in a day is not constant (e.g. it's different in the week of
767
+ // the daylight saving time clock shift).
768
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
769
+ }
770
+
771
+ /**
772
+ * The {@link startOfISOWeekYear} function options.
773
+ */
774
+
775
+ /**
776
+ * @name startOfISOWeekYear
777
+ * @category ISO Week-Numbering Year Helpers
778
+ * @summary Return the start of an ISO week-numbering year for the given date.
779
+ *
780
+ * @description
781
+ * Return the start of an ISO week-numbering year,
782
+ * which always starts 3 days before the year's first Thursday.
783
+ * The result will be in the local timezone.
784
+ *
785
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
786
+ *
787
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
788
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
789
+ *
790
+ * @param date - The original date
791
+ * @param options - An object with options
792
+ *
793
+ * @returns The start of an ISO week-numbering year
794
+ *
795
+ * @example
796
+ * // The start of an ISO week-numbering year for 2 July 2005:
797
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
798
+ * //=> Mon Jan 03 2005 00:00:00
799
+ */
800
+ function startOfISOWeekYear(date, options) {
801
+ const year = getISOWeekYear(date, options);
802
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
803
+ fourthOfJanuary.setFullYear(year, 0, 4);
804
+ fourthOfJanuary.setHours(0, 0, 0, 0);
805
+ return startOfISOWeek(fourthOfJanuary);
806
+ }
807
+
808
+ /**
809
+ * @name constructNow
810
+ * @category Generic Helpers
811
+ * @summary Constructs a new current date using the passed value constructor.
812
+ * @pure false
813
+ *
814
+ * @description
815
+ * The function constructs a new current date using the constructor from
816
+ * the reference date. It helps to build generic functions that accept date
817
+ * extensions and use the current date.
818
+ *
819
+ * It defaults to `Date` if the passed reference date is a number or a string.
820
+ *
821
+ * @param date - The reference date to take constructor from
822
+ *
823
+ * @returns Current date initialized using the given date constructor
824
+ *
825
+ * @example
826
+ * import { constructNow, isSameDay } from 'date-fns'
827
+ *
828
+ * function isToday<DateType extends Date>(
829
+ * date: DateArg<DateType>,
830
+ * ): boolean {
831
+ * // If we were to use `new Date()` directly, the function would behave
832
+ * // differently in different timezones and return false for the same date.
833
+ * return isSameDay(date, constructNow(date));
834
+ * }
835
+ */
836
+ function constructNow(date) {
837
+ return constructFrom(date, Date.now());
838
+ }
839
+
840
+ /**
841
+ * The {@link isSameDay} function options.
842
+ */
843
+
844
+ /**
845
+ * @name isSameDay
846
+ * @category Day Helpers
847
+ * @summary Are the given dates in the same day (and year and month)?
848
+ *
849
+ * @description
850
+ * Are the given dates in the same day (and year and month)?
851
+ *
852
+ * @param laterDate - The first date to check
853
+ * @param earlierDate - The second date to check
854
+ * @param options - An object with options
855
+ *
856
+ * @returns The dates are in the same day (and year and month)
857
+ *
858
+ * @example
859
+ * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?
860
+ * const result = isSameDay(new Date(2014, 8, 4, 6, 0), new Date(2014, 8, 4, 18, 0))
861
+ * //=> true
862
+ *
863
+ * @example
864
+ * // Are 4 September and 4 October in the same day?
865
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2014, 9, 4))
866
+ * //=> false
867
+ *
868
+ * @example
869
+ * // Are 4 September, 2014 and 4 September, 2015 in the same day?
870
+ * const result = isSameDay(new Date(2014, 8, 4), new Date(2015, 8, 4))
871
+ * //=> false
872
+ */
873
+ function isSameDay(laterDate, earlierDate, options) {
874
+ const [dateLeft_, dateRight_] = normalizeDates(
875
+ options?.in,
876
+ laterDate,
877
+ earlierDate,
878
+ );
879
+ return +startOfDay(dateLeft_) === +startOfDay(dateRight_);
880
+ }
881
+
882
+ /**
883
+ * @name isDate
884
+ * @category Common Helpers
885
+ * @summary Is the given value a date?
886
+ *
887
+ * @description
888
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
889
+ *
890
+ * @param value - The value to check
891
+ *
892
+ * @returns True if the given value is a date
893
+ *
894
+ * @example
895
+ * // For a valid date:
896
+ * const result = isDate(new Date())
897
+ * //=> true
898
+ *
899
+ * @example
900
+ * // For an invalid date:
901
+ * const result = isDate(new Date(NaN))
902
+ * //=> true
903
+ *
904
+ * @example
905
+ * // For some value:
906
+ * const result = isDate('2014-02-31')
907
+ * //=> false
908
+ *
909
+ * @example
910
+ * // For an object:
911
+ * const result = isDate({})
912
+ * //=> false
913
+ */
914
+ function isDate(value) {
915
+ return (
916
+ value instanceof Date ||
917
+ (typeof value === "object" &&
918
+ Object.prototype.toString.call(value) === "[object Date]")
919
+ );
920
+ }
921
+
922
+ /**
923
+ * @name isValid
924
+ * @category Common Helpers
925
+ * @summary Is the given date valid?
926
+ *
927
+ * @description
928
+ * Returns false if argument is Invalid Date and true otherwise.
929
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
930
+ * Invalid Date is a Date, whose time value is NaN.
931
+ *
932
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
933
+ *
934
+ * @param date - The date to check
935
+ *
936
+ * @returns The date is valid
937
+ *
938
+ * @example
939
+ * // For the valid date:
940
+ * const result = isValid(new Date(2014, 1, 31))
941
+ * //=> true
942
+ *
943
+ * @example
944
+ * // For the value, convertible into a date:
945
+ * const result = isValid(1393804800000)
946
+ * //=> true
947
+ *
948
+ * @example
949
+ * // For the invalid date:
950
+ * const result = isValid(new Date(''))
951
+ * //=> false
952
+ */
953
+ function isValid(date) {
954
+ return !((!isDate(date) && typeof date !== "number") || isNaN(+toDate(date)));
955
+ }
956
+
957
+ /**
958
+ * The {@link endOfMonth} function options.
959
+ */
960
+
961
+ /**
962
+ * @name endOfMonth
963
+ * @category Month Helpers
964
+ * @summary Return the end of a month for the given date.
965
+ *
966
+ * @description
967
+ * Return the end of a month for the given date.
968
+ * The result will be in the local timezone.
969
+ *
970
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
971
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
972
+ *
973
+ * @param date - The original date
974
+ * @param options - An object with options
975
+ *
976
+ * @returns The end of a month
977
+ *
978
+ * @example
979
+ * // The end of a month for 2 September 2014 11:55:00:
980
+ * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))
981
+ * //=> Tue Sep 30 2014 23:59:59.999
982
+ */
983
+ function endOfMonth(date, options) {
984
+ const _date = toDate(date, options?.in);
985
+ const month = _date.getMonth();
986
+ _date.setFullYear(_date.getFullYear(), month + 1, 0);
987
+ _date.setHours(23, 59, 59, 999);
988
+ return _date;
989
+ }
990
+
991
+ function normalizeInterval(context, interval) {
992
+ const [start, end] = normalizeDates(context, interval.start, interval.end);
993
+ return { start, end };
994
+ }
995
+
996
+ /**
997
+ * The {@link eachDayOfInterval} function options.
998
+ */
999
+
1000
+ /**
1001
+ * The {@link eachDayOfInterval} function result type. It resolves the proper data type.
1002
+ * It uses the first argument date object type, starting from the date argument,
1003
+ * then the start interval date, and finally the end interval date. If
1004
+ * a context function is passed, it uses the context function return type.
1005
+ */
1006
+
1007
+ /**
1008
+ * @name eachDayOfInterval
1009
+ * @category Interval Helpers
1010
+ * @summary Return the array of dates within the specified time interval.
1011
+ *
1012
+ * @description
1013
+ * Return the array of dates within the specified time interval.
1014
+ *
1015
+ * @typeParam IntervalType - Interval type.
1016
+ * @typeParam Options - Options type.
1017
+ *
1018
+ * @param interval - The interval.
1019
+ * @param options - An object with options.
1020
+ *
1021
+ * @returns The array with starts of days from the day of the interval start to the day of the interval end
1022
+ *
1023
+ * @example
1024
+ * // Each day between 6 October 2014 and 10 October 2014:
1025
+ * const result = eachDayOfInterval({
1026
+ * start: new Date(2014, 9, 6),
1027
+ * end: new Date(2014, 9, 10)
1028
+ * })
1029
+ * //=> [
1030
+ * // Mon Oct 06 2014 00:00:00,
1031
+ * // Tue Oct 07 2014 00:00:00,
1032
+ * // Wed Oct 08 2014 00:00:00,
1033
+ * // Thu Oct 09 2014 00:00:00,
1034
+ * // Fri Oct 10 2014 00:00:00
1035
+ * // ]
1036
+ */
1037
+ function eachDayOfInterval(interval, options) {
1038
+ const { start, end } = normalizeInterval(options?.in, interval);
1039
+
1040
+ let reversed = +start > +end;
1041
+ const endTime = reversed ? +start : +end;
1042
+ const date = reversed ? end : start;
1043
+ date.setHours(0, 0, 0, 0);
1044
+
1045
+ let step = options?.step ?? 1;
1046
+ if (!step) return [];
1047
+ if (step < 0) {
1048
+ step = -step;
1049
+ reversed = !reversed;
1050
+ }
1051
+
1052
+ const dates = [];
1053
+
1054
+ while (+date <= endTime) {
1055
+ dates.push(constructFrom(start, date));
1056
+ date.setDate(date.getDate() + step);
1057
+ date.setHours(0, 0, 0, 0);
1058
+ }
1059
+
1060
+ return reversed ? dates.reverse() : dates;
1061
+ }
1062
+
1063
+ /**
1064
+ * The {@link startOfMonth} function options.
1065
+ */
1066
+
1067
+ /**
1068
+ * @name startOfMonth
1069
+ * @category Month Helpers
1070
+ * @summary Return the start of a month for the given date.
1071
+ *
1072
+ * @description
1073
+ * Return the start of a month for the given date. The result will be in the local timezone.
1074
+ *
1075
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments.
1076
+ * Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1077
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed,
1078
+ * or inferred from the arguments.
1079
+ *
1080
+ * @param date - The original date
1081
+ * @param options - An object with options
1082
+ *
1083
+ * @returns The start of a month
1084
+ *
1085
+ * @example
1086
+ * // The start of a month for 2 September 2014 11:55:00:
1087
+ * const result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))
1088
+ * //=> Mon Sep 01 2014 00:00:00
1089
+ */
1090
+ function startOfMonth(date, options) {
1091
+ const _date = toDate(date, options?.in);
1092
+ _date.setDate(1);
1093
+ _date.setHours(0, 0, 0, 0);
1094
+ return _date;
1095
+ }
1096
+
1097
+ /**
1098
+ * The {@link startOfYear} function options.
1099
+ */
1100
+
1101
+ /**
1102
+ * @name startOfYear
1103
+ * @category Year Helpers
1104
+ * @summary Return the start of a year for the given date.
1105
+ *
1106
+ * @description
1107
+ * Return the start of a year for the given date.
1108
+ * The result will be in the local timezone.
1109
+ *
1110
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1111
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1112
+ *
1113
+ * @param date - The original date
1114
+ * @param options - The options
1115
+ *
1116
+ * @returns The start of a year
1117
+ *
1118
+ * @example
1119
+ * // The start of a year for 2 September 2014 11:55:00:
1120
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
1121
+ * //=> Wed Jan 01 2014 00:00:00
1122
+ */
1123
+ function startOfYear(date, options) {
1124
+ const date_ = toDate(date, options?.in);
1125
+ date_.setFullYear(date_.getFullYear(), 0, 1);
1126
+ date_.setHours(0, 0, 0, 0);
1127
+ return date_;
1128
+ }
1129
+
1130
+ const formatDistanceLocale = {
1131
+ lessThanXSeconds: {
1132
+ one: "less than a second",
1133
+ other: "less than {{count}} seconds",
1134
+ },
1135
+
1136
+ xSeconds: {
1137
+ one: "1 second",
1138
+ other: "{{count}} seconds",
1139
+ },
1140
+
1141
+ halfAMinute: "half a minute",
1142
+
1143
+ lessThanXMinutes: {
1144
+ one: "less than a minute",
1145
+ other: "less than {{count}} minutes",
1146
+ },
1147
+
1148
+ xMinutes: {
1149
+ one: "1 minute",
1150
+ other: "{{count}} minutes",
1151
+ },
1152
+
1153
+ aboutXHours: {
1154
+ one: "about 1 hour",
1155
+ other: "about {{count}} hours",
1156
+ },
1157
+
1158
+ xHours: {
1159
+ one: "1 hour",
1160
+ other: "{{count}} hours",
1161
+ },
1162
+
1163
+ xDays: {
1164
+ one: "1 day",
1165
+ other: "{{count}} days",
1166
+ },
1167
+
1168
+ aboutXWeeks: {
1169
+ one: "about 1 week",
1170
+ other: "about {{count}} weeks",
1171
+ },
1172
+
1173
+ xWeeks: {
1174
+ one: "1 week",
1175
+ other: "{{count}} weeks",
1176
+ },
1177
+
1178
+ aboutXMonths: {
1179
+ one: "about 1 month",
1180
+ other: "about {{count}} months",
1181
+ },
1182
+
1183
+ xMonths: {
1184
+ one: "1 month",
1185
+ other: "{{count}} months",
1186
+ },
1187
+
1188
+ aboutXYears: {
1189
+ one: "about 1 year",
1190
+ other: "about {{count}} years",
1191
+ },
1192
+
1193
+ xYears: {
1194
+ one: "1 year",
1195
+ other: "{{count}} years",
1196
+ },
1197
+
1198
+ overXYears: {
1199
+ one: "over 1 year",
1200
+ other: "over {{count}} years",
1201
+ },
1202
+
1203
+ almostXYears: {
1204
+ one: "almost 1 year",
1205
+ other: "almost {{count}} years",
1206
+ },
1207
+ };
1208
+
1209
+ const formatDistance = (token, count, options) => {
1210
+ let result;
1211
+
1212
+ const tokenValue = formatDistanceLocale[token];
1213
+ if (typeof tokenValue === "string") {
1214
+ result = tokenValue;
1215
+ } else if (count === 1) {
1216
+ result = tokenValue.one;
1217
+ } else {
1218
+ result = tokenValue.other.replace("{{count}}", count.toString());
1219
+ }
1220
+
1221
+ if (options?.addSuffix) {
1222
+ if (options.comparison && options.comparison > 0) {
1223
+ return "in " + result;
1224
+ } else {
1225
+ return result + " ago";
1226
+ }
1227
+ }
1228
+
1229
+ return result;
1230
+ };
1231
+
1232
+ function buildFormatLongFn(args) {
1233
+ return (options = {}) => {
1234
+ // TODO: Remove String()
1235
+ const width = options.width ? String(options.width) : args.defaultWidth;
1236
+ const format = args.formats[width] || args.formats[args.defaultWidth];
1237
+ return format;
1238
+ };
1239
+ }
1240
+
1241
+ const dateFormats = {
1242
+ full: "EEEE, MMMM do, y",
1243
+ long: "MMMM do, y",
1244
+ medium: "MMM d, y",
1245
+ short: "MM/dd/yyyy",
1246
+ };
1247
+
1248
+ const timeFormats = {
1249
+ full: "h:mm:ss a zzzz",
1250
+ long: "h:mm:ss a z",
1251
+ medium: "h:mm:ss a",
1252
+ short: "h:mm a",
1253
+ };
1254
+
1255
+ const dateTimeFormats = {
1256
+ full: "{{date}} 'at' {{time}}",
1257
+ long: "{{date}} 'at' {{time}}",
1258
+ medium: "{{date}}, {{time}}",
1259
+ short: "{{date}}, {{time}}",
1260
+ };
1261
+
1262
+ const formatLong = {
1263
+ date: buildFormatLongFn({
1264
+ formats: dateFormats,
1265
+ defaultWidth: "full",
1266
+ }),
1267
+
1268
+ time: buildFormatLongFn({
1269
+ formats: timeFormats,
1270
+ defaultWidth: "full",
1271
+ }),
1272
+
1273
+ dateTime: buildFormatLongFn({
1274
+ formats: dateTimeFormats,
1275
+ defaultWidth: "full",
1276
+ }),
1277
+ };
1278
+
1279
+ const formatRelativeLocale = {
1280
+ lastWeek: "'last' eeee 'at' p",
1281
+ yesterday: "'yesterday at' p",
1282
+ today: "'today at' p",
1283
+ tomorrow: "'tomorrow at' p",
1284
+ nextWeek: "eeee 'at' p",
1285
+ other: "P",
1286
+ };
1287
+
1288
+ const formatRelative = (token, _date, _baseDate, _options) =>
1289
+ formatRelativeLocale[token];
1290
+
1291
+ /**
1292
+ * The localize function argument callback which allows to convert raw value to
1293
+ * the actual type.
1294
+ *
1295
+ * @param value - The value to convert
1296
+ *
1297
+ * @returns The converted value
1298
+ */
1299
+
1300
+ /**
1301
+ * The map of localized values for each width.
1302
+ */
1303
+
1304
+ /**
1305
+ * The index type of the locale unit value. It types conversion of units of
1306
+ * values that don't start at 0 (i.e. quarters).
1307
+ */
1308
+
1309
+ /**
1310
+ * Converts the unit value to the tuple of values.
1311
+ */
1312
+
1313
+ /**
1314
+ * The tuple of localized era values. The first element represents BC,
1315
+ * the second element represents AD.
1316
+ */
1317
+
1318
+ /**
1319
+ * The tuple of localized quarter values. The first element represents Q1.
1320
+ */
1321
+
1322
+ /**
1323
+ * The tuple of localized day values. The first element represents Sunday.
1324
+ */
1325
+
1326
+ /**
1327
+ * The tuple of localized month values. The first element represents January.
1328
+ */
1329
+
1330
+ function buildLocalizeFn(args) {
1331
+ return (value, options) => {
1332
+ const context = options?.context ? String(options.context) : "standalone";
1333
+
1334
+ let valuesArray;
1335
+ if (context === "formatting" && args.formattingValues) {
1336
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
1337
+ const width = options?.width ? String(options.width) : defaultWidth;
1338
+
1339
+ valuesArray =
1340
+ args.formattingValues[width] || args.formattingValues[defaultWidth];
1341
+ } else {
1342
+ const defaultWidth = args.defaultWidth;
1343
+ const width = options?.width ? String(options.width) : args.defaultWidth;
1344
+
1345
+ valuesArray = args.values[width] || args.values[defaultWidth];
1346
+ }
1347
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
1348
+
1349
+ // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
1350
+ return valuesArray[index];
1351
+ };
1352
+ }
1353
+
1354
+ const eraValues = {
1355
+ narrow: ["B", "A"],
1356
+ abbreviated: ["BC", "AD"],
1357
+ wide: ["Before Christ", "Anno Domini"],
1358
+ };
1359
+
1360
+ const quarterValues = {
1361
+ narrow: ["1", "2", "3", "4"],
1362
+ abbreviated: ["Q1", "Q2", "Q3", "Q4"],
1363
+ wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
1364
+ };
1365
+
1366
+ // Note: in English, the names of days of the week and months are capitalized.
1367
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
1368
+ // Generally, formatted dates should look like they are in the middle of a sentence,
1369
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
1370
+ const monthValues = {
1371
+ narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
1372
+ abbreviated: [
1373
+ "Jan",
1374
+ "Feb",
1375
+ "Mar",
1376
+ "Apr",
1377
+ "May",
1378
+ "Jun",
1379
+ "Jul",
1380
+ "Aug",
1381
+ "Sep",
1382
+ "Oct",
1383
+ "Nov",
1384
+ "Dec",
1385
+ ],
1386
+
1387
+ wide: [
1388
+ "January",
1389
+ "February",
1390
+ "March",
1391
+ "April",
1392
+ "May",
1393
+ "June",
1394
+ "July",
1395
+ "August",
1396
+ "September",
1397
+ "October",
1398
+ "November",
1399
+ "December",
1400
+ ],
1401
+ };
1402
+
1403
+ const dayValues = {
1404
+ narrow: ["S", "M", "T", "W", "T", "F", "S"],
1405
+ short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
1406
+ abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
1407
+ wide: [
1408
+ "Sunday",
1409
+ "Monday",
1410
+ "Tuesday",
1411
+ "Wednesday",
1412
+ "Thursday",
1413
+ "Friday",
1414
+ "Saturday",
1415
+ ],
1416
+ };
1417
+
1418
+ const dayPeriodValues = {
1419
+ narrow: {
1420
+ am: "a",
1421
+ pm: "p",
1422
+ midnight: "mi",
1423
+ noon: "n",
1424
+ morning: "morning",
1425
+ afternoon: "afternoon",
1426
+ evening: "evening",
1427
+ night: "night",
1428
+ },
1429
+ abbreviated: {
1430
+ am: "AM",
1431
+ pm: "PM",
1432
+ midnight: "midnight",
1433
+ noon: "noon",
1434
+ morning: "morning",
1435
+ afternoon: "afternoon",
1436
+ evening: "evening",
1437
+ night: "night",
1438
+ },
1439
+ wide: {
1440
+ am: "a.m.",
1441
+ pm: "p.m.",
1442
+ midnight: "midnight",
1443
+ noon: "noon",
1444
+ morning: "morning",
1445
+ afternoon: "afternoon",
1446
+ evening: "evening",
1447
+ night: "night",
1448
+ },
1449
+ };
1450
+
1451
+ const formattingDayPeriodValues = {
1452
+ narrow: {
1453
+ am: "a",
1454
+ pm: "p",
1455
+ midnight: "mi",
1456
+ noon: "n",
1457
+ morning: "in the morning",
1458
+ afternoon: "in the afternoon",
1459
+ evening: "in the evening",
1460
+ night: "at night",
1461
+ },
1462
+ abbreviated: {
1463
+ am: "AM",
1464
+ pm: "PM",
1465
+ midnight: "midnight",
1466
+ noon: "noon",
1467
+ morning: "in the morning",
1468
+ afternoon: "in the afternoon",
1469
+ evening: "in the evening",
1470
+ night: "at night",
1471
+ },
1472
+ wide: {
1473
+ am: "a.m.",
1474
+ pm: "p.m.",
1475
+ midnight: "midnight",
1476
+ noon: "noon",
1477
+ morning: "in the morning",
1478
+ afternoon: "in the afternoon",
1479
+ evening: "in the evening",
1480
+ night: "at night",
1481
+ },
1482
+ };
1483
+
1484
+ const ordinalNumber = (dirtyNumber, _options) => {
1485
+ const number = Number(dirtyNumber);
1486
+
1487
+ // If ordinal numbers depend on context, for example,
1488
+ // if they are different for different grammatical genders,
1489
+ // use `options.unit`.
1490
+ //
1491
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
1492
+ // 'day', 'hour', 'minute', 'second'.
1493
+
1494
+ const rem100 = number % 100;
1495
+ if (rem100 > 20 || rem100 < 10) {
1496
+ switch (rem100 % 10) {
1497
+ case 1:
1498
+ return number + "st";
1499
+ case 2:
1500
+ return number + "nd";
1501
+ case 3:
1502
+ return number + "rd";
1503
+ }
1504
+ }
1505
+ return number + "th";
1506
+ };
1507
+
1508
+ const localize = {
1509
+ ordinalNumber,
1510
+
1511
+ era: buildLocalizeFn({
1512
+ values: eraValues,
1513
+ defaultWidth: "wide",
1514
+ }),
1515
+
1516
+ quarter: buildLocalizeFn({
1517
+ values: quarterValues,
1518
+ defaultWidth: "wide",
1519
+ argumentCallback: (quarter) => quarter - 1,
1520
+ }),
1521
+
1522
+ month: buildLocalizeFn({
1523
+ values: monthValues,
1524
+ defaultWidth: "wide",
1525
+ }),
1526
+
1527
+ day: buildLocalizeFn({
1528
+ values: dayValues,
1529
+ defaultWidth: "wide",
1530
+ }),
1531
+
1532
+ dayPeriod: buildLocalizeFn({
1533
+ values: dayPeriodValues,
1534
+ defaultWidth: "wide",
1535
+ formattingValues: formattingDayPeriodValues,
1536
+ defaultFormattingWidth: "wide",
1537
+ }),
1538
+ };
1539
+
1540
+ function buildMatchFn(args) {
1541
+ return (string, options = {}) => {
1542
+ const width = options.width;
1543
+
1544
+ const matchPattern =
1545
+ (width && args.matchPatterns[width]) ||
1546
+ args.matchPatterns[args.defaultMatchWidth];
1547
+ const matchResult = string.match(matchPattern);
1548
+
1549
+ if (!matchResult) {
1550
+ return null;
1551
+ }
1552
+ const matchedString = matchResult[0];
1553
+
1554
+ const parsePatterns =
1555
+ (width && args.parsePatterns[width]) ||
1556
+ args.parsePatterns[args.defaultParseWidth];
1557
+
1558
+ const key = Array.isArray(parsePatterns)
1559
+ ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))
1560
+ : // [TODO] -- I challenge you to fix the type
1561
+ findKey(parsePatterns, (pattern) => pattern.test(matchedString));
1562
+
1563
+ let value;
1564
+
1565
+ value = args.valueCallback ? args.valueCallback(key) : key;
1566
+ value = options.valueCallback
1567
+ ? // [TODO] -- I challenge you to fix the type
1568
+ options.valueCallback(value)
1569
+ : value;
1570
+
1571
+ const rest = string.slice(matchedString.length);
1572
+
1573
+ return { value, rest };
1574
+ };
1575
+ }
1576
+
1577
+ function findKey(object, predicate) {
1578
+ for (const key in object) {
1579
+ if (
1580
+ Object.prototype.hasOwnProperty.call(object, key) &&
1581
+ predicate(object[key])
1582
+ ) {
1583
+ return key;
1584
+ }
1585
+ }
1586
+ return undefined;
1587
+ }
1588
+
1589
+ function findIndex(array, predicate) {
1590
+ for (let key = 0; key < array.length; key++) {
1591
+ if (predicate(array[key])) {
1592
+ return key;
1593
+ }
1594
+ }
1595
+ return undefined;
1596
+ }
1597
+
1598
+ function buildMatchPatternFn(args) {
1599
+ return (string, options = {}) => {
1600
+ const matchResult = string.match(args.matchPattern);
1601
+ if (!matchResult) return null;
1602
+ const matchedString = matchResult[0];
1603
+
1604
+ const parseResult = string.match(args.parsePattern);
1605
+ if (!parseResult) return null;
1606
+ let value = args.valueCallback
1607
+ ? args.valueCallback(parseResult[0])
1608
+ : parseResult[0];
1609
+
1610
+ // [TODO] I challenge you to fix the type
1611
+ value = options.valueCallback ? options.valueCallback(value) : value;
1612
+
1613
+ const rest = string.slice(matchedString.length);
1614
+
1615
+ return { value, rest };
1616
+ };
1617
+ }
1618
+
1619
+ const matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
1620
+ const parseOrdinalNumberPattern = /\d+/i;
1621
+
1622
+ const matchEraPatterns = {
1623
+ narrow: /^(b|a)/i,
1624
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1625
+ wide: /^(before christ|before common era|anno domini|common era)/i,
1626
+ };
1627
+ const parseEraPatterns = {
1628
+ any: [/^b/i, /^(a|c)/i],
1629
+ };
1630
+
1631
+ const matchQuarterPatterns = {
1632
+ narrow: /^[1234]/i,
1633
+ abbreviated: /^q[1234]/i,
1634
+ wide: /^[1234](th|st|nd|rd)? quarter/i,
1635
+ };
1636
+ const parseQuarterPatterns = {
1637
+ any: [/1/i, /2/i, /3/i, /4/i],
1638
+ };
1639
+
1640
+ const matchMonthPatterns = {
1641
+ narrow: /^[jfmasond]/i,
1642
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1643
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i,
1644
+ };
1645
+ const parseMonthPatterns = {
1646
+ narrow: [
1647
+ /^j/i,
1648
+ /^f/i,
1649
+ /^m/i,
1650
+ /^a/i,
1651
+ /^m/i,
1652
+ /^j/i,
1653
+ /^j/i,
1654
+ /^a/i,
1655
+ /^s/i,
1656
+ /^o/i,
1657
+ /^n/i,
1658
+ /^d/i,
1659
+ ],
1660
+
1661
+ any: [
1662
+ /^ja/i,
1663
+ /^f/i,
1664
+ /^mar/i,
1665
+ /^ap/i,
1666
+ /^may/i,
1667
+ /^jun/i,
1668
+ /^jul/i,
1669
+ /^au/i,
1670
+ /^s/i,
1671
+ /^o/i,
1672
+ /^n/i,
1673
+ /^d/i,
1674
+ ],
1675
+ };
1676
+
1677
+ const matchDayPatterns = {
1678
+ narrow: /^[smtwf]/i,
1679
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1680
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1681
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i,
1682
+ };
1683
+ const parseDayPatterns = {
1684
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1685
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
1686
+ };
1687
+
1688
+ const matchDayPeriodPatterns = {
1689
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1690
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i,
1691
+ };
1692
+ const parseDayPeriodPatterns = {
1693
+ any: {
1694
+ am: /^a/i,
1695
+ pm: /^p/i,
1696
+ midnight: /^mi/i,
1697
+ noon: /^no/i,
1698
+ morning: /morning/i,
1699
+ afternoon: /afternoon/i,
1700
+ evening: /evening/i,
1701
+ night: /night/i,
1702
+ },
1703
+ };
1704
+
1705
+ const match = {
1706
+ ordinalNumber: buildMatchPatternFn({
1707
+ matchPattern: matchOrdinalNumberPattern,
1708
+ parsePattern: parseOrdinalNumberPattern,
1709
+ valueCallback: (value) => parseInt(value, 10),
1710
+ }),
1711
+
1712
+ era: buildMatchFn({
1713
+ matchPatterns: matchEraPatterns,
1714
+ defaultMatchWidth: "wide",
1715
+ parsePatterns: parseEraPatterns,
1716
+ defaultParseWidth: "any",
1717
+ }),
1718
+
1719
+ quarter: buildMatchFn({
1720
+ matchPatterns: matchQuarterPatterns,
1721
+ defaultMatchWidth: "wide",
1722
+ parsePatterns: parseQuarterPatterns,
1723
+ defaultParseWidth: "any",
1724
+ valueCallback: (index) => index + 1,
1725
+ }),
1726
+
1727
+ month: buildMatchFn({
1728
+ matchPatterns: matchMonthPatterns,
1729
+ defaultMatchWidth: "wide",
1730
+ parsePatterns: parseMonthPatterns,
1731
+ defaultParseWidth: "any",
1732
+ }),
1733
+
1734
+ day: buildMatchFn({
1735
+ matchPatterns: matchDayPatterns,
1736
+ defaultMatchWidth: "wide",
1737
+ parsePatterns: parseDayPatterns,
1738
+ defaultParseWidth: "any",
1739
+ }),
1740
+
1741
+ dayPeriod: buildMatchFn({
1742
+ matchPatterns: matchDayPeriodPatterns,
1743
+ defaultMatchWidth: "any",
1744
+ parsePatterns: parseDayPeriodPatterns,
1745
+ defaultParseWidth: "any",
1746
+ }),
1747
+ };
1748
+
1749
+ /**
1750
+ * @category Locales
1751
+ * @summary English locale (United States).
1752
+ * @language English
1753
+ * @iso-639-2 eng
1754
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
1755
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
1756
+ */
1757
+ const enUS = {
1758
+ code: "en-US",
1759
+ formatDistance: formatDistance,
1760
+ formatLong: formatLong,
1761
+ formatRelative: formatRelative,
1762
+ localize: localize,
1763
+ match: match,
1764
+ options: {
1765
+ weekStartsOn: 0 /* Sunday */,
1766
+ firstWeekContainsDate: 1,
1767
+ },
1768
+ };
1769
+
1770
+ /**
1771
+ * The {@link getDayOfYear} function options.
1772
+ */
1773
+
1774
+ /**
1775
+ * @name getDayOfYear
1776
+ * @category Day Helpers
1777
+ * @summary Get the day of the year of the given date.
1778
+ *
1779
+ * @description
1780
+ * Get the day of the year of the given date.
1781
+ *
1782
+ * @param date - The given date
1783
+ * @param options - The options
1784
+ *
1785
+ * @returns The day of year
1786
+ *
1787
+ * @example
1788
+ * // Which day of the year is 2 July 2014?
1789
+ * const result = getDayOfYear(new Date(2014, 6, 2))
1790
+ * //=> 183
1791
+ */
1792
+ function getDayOfYear(date, options) {
1793
+ const _date = toDate(date, options?.in);
1794
+ const diff = differenceInCalendarDays(_date, startOfYear(_date));
1795
+ const dayOfYear = diff + 1;
1796
+ return dayOfYear;
1797
+ }
1798
+
1799
+ /**
1800
+ * The {@link getISOWeek} function options.
1801
+ */
1802
+
1803
+ /**
1804
+ * @name getISOWeek
1805
+ * @category ISO Week Helpers
1806
+ * @summary Get the ISO week of the given date.
1807
+ *
1808
+ * @description
1809
+ * Get the ISO week of the given date.
1810
+ *
1811
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1812
+ *
1813
+ * @param date - The given date
1814
+ * @param options - The options
1815
+ *
1816
+ * @returns The ISO week
1817
+ *
1818
+ * @example
1819
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1820
+ * const result = getISOWeek(new Date(2005, 0, 2))
1821
+ * //=> 53
1822
+ */
1823
+ function getISOWeek(date, options) {
1824
+ const _date = toDate(date, options?.in);
1825
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1826
+
1827
+ // Round the number of weeks to the nearest integer because the number of
1828
+ // milliseconds in a week is not constant (e.g. it's different in the week of
1829
+ // the daylight saving time clock shift).
1830
+ return Math.round(diff / millisecondsInWeek) + 1;
1831
+ }
1832
+
1833
+ /**
1834
+ * The {@link getWeekYear} function options.
1835
+ */
1836
+
1837
+ /**
1838
+ * @name getWeekYear
1839
+ * @category Week-Numbering Year Helpers
1840
+ * @summary Get the local week-numbering year of the given date.
1841
+ *
1842
+ * @description
1843
+ * Get the local week-numbering year of the given date.
1844
+ * The exact calculation depends on the values of
1845
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1846
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1847
+ * the first week of the week-numbering year)
1848
+ *
1849
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1850
+ *
1851
+ * @param date - The given date
1852
+ * @param options - An object with options.
1853
+ *
1854
+ * @returns The local week-numbering year
1855
+ *
1856
+ * @example
1857
+ * // Which week numbering year is 26 December 2004 with the default settings?
1858
+ * const result = getWeekYear(new Date(2004, 11, 26))
1859
+ * //=> 2005
1860
+ *
1861
+ * @example
1862
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1863
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1864
+ * //=> 2004
1865
+ *
1866
+ * @example
1867
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1868
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1869
+ * //=> 2004
1870
+ */
1871
+ function getWeekYear(date, options) {
1872
+ const _date = toDate(date, options?.in);
1873
+ const year = _date.getFullYear();
1874
+
1875
+ const defaultOptions = getDefaultOptions();
1876
+ const firstWeekContainsDate =
1877
+ options?.firstWeekContainsDate ??
1878
+ options?.locale?.options?.firstWeekContainsDate ??
1879
+ defaultOptions.firstWeekContainsDate ??
1880
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
1881
+ 1;
1882
+
1883
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1884
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1885
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1886
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1887
+
1888
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1889
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1890
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1891
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1892
+
1893
+ if (+_date >= +startOfNextYear) {
1894
+ return year + 1;
1895
+ } else if (+_date >= +startOfThisYear) {
1896
+ return year;
1897
+ } else {
1898
+ return year - 1;
1899
+ }
1900
+ }
1901
+
1902
+ /**
1903
+ * The {@link startOfWeekYear} function options.
1904
+ */
1905
+
1906
+ /**
1907
+ * @name startOfWeekYear
1908
+ * @category Week-Numbering Year Helpers
1909
+ * @summary Return the start of a local week-numbering year for the given date.
1910
+ *
1911
+ * @description
1912
+ * Return the start of a local week-numbering year.
1913
+ * The exact calculation depends on the values of
1914
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1915
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1916
+ * the first week of the week-numbering year)
1917
+ *
1918
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1919
+ *
1920
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
1921
+ * @typeParam ResultDate - The result `Date` type.
1922
+ *
1923
+ * @param date - The original date
1924
+ * @param options - An object with options
1925
+ *
1926
+ * @returns The start of a week-numbering year
1927
+ *
1928
+ * @example
1929
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1930
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1931
+ * //=> Sun Dec 26 2004 00:00:00
1932
+ *
1933
+ * @example
1934
+ * // The start of a week-numbering year for 2 July 2005
1935
+ * // if Monday is the first day of week
1936
+ * // and 4 January is always in the first week of the year:
1937
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1938
+ * weekStartsOn: 1,
1939
+ * firstWeekContainsDate: 4
1940
+ * })
1941
+ * //=> Mon Jan 03 2005 00:00:00
1942
+ */
1943
+ function startOfWeekYear(date, options) {
1944
+ const defaultOptions = getDefaultOptions();
1945
+ const firstWeekContainsDate =
1946
+ options?.firstWeekContainsDate ??
1947
+ options?.locale?.options?.firstWeekContainsDate ??
1948
+ defaultOptions.firstWeekContainsDate ??
1949
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
1950
+ 1;
1951
+
1952
+ const year = getWeekYear(date, options);
1953
+ const firstWeek = constructFrom(options?.in || date, 0);
1954
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1955
+ firstWeek.setHours(0, 0, 0, 0);
1956
+ const _date = startOfWeek(firstWeek, options);
1957
+ return _date;
1958
+ }
1959
+
1960
+ /**
1961
+ * The {@link getWeek} function options.
1962
+ */
1963
+
1964
+ /**
1965
+ * @name getWeek
1966
+ * @category Week Helpers
1967
+ * @summary Get the local week index of the given date.
1968
+ *
1969
+ * @description
1970
+ * Get the local week index of the given date.
1971
+ * The exact calculation depends on the values of
1972
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1973
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1974
+ * the first week of the week-numbering year)
1975
+ *
1976
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1977
+ *
1978
+ * @param date - The given date
1979
+ * @param options - An object with options
1980
+ *
1981
+ * @returns The week
1982
+ *
1983
+ * @example
1984
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1985
+ * const result = getWeek(new Date(2005, 0, 2))
1986
+ * //=> 2
1987
+ *
1988
+ * @example
1989
+ * // Which week of the local week numbering year is 2 January 2005,
1990
+ * // if Monday is the first day of the week,
1991
+ * // and the first week of the year always contains 4 January?
1992
+ * const result = getWeek(new Date(2005, 0, 2), {
1993
+ * weekStartsOn: 1,
1994
+ * firstWeekContainsDate: 4
1995
+ * })
1996
+ * //=> 53
1997
+ */
1998
+ function getWeek(date, options) {
1999
+ const _date = toDate(date, options?.in);
2000
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
2001
+
2002
+ // Round the number of weeks to the nearest integer because the number of
2003
+ // milliseconds in a week is not constant (e.g. it's different in the week of
2004
+ // the daylight saving time clock shift).
2005
+ return Math.round(diff / millisecondsInWeek) + 1;
2006
+ }
2007
+
2008
+ function addLeadingZeros(number, targetLength) {
2009
+ const sign = number < 0 ? "-" : "";
2010
+ const output = Math.abs(number).toString().padStart(targetLength, "0");
2011
+ return sign + output;
2012
+ }
2013
+
2014
+ /*
2015
+ * | | Unit | | Unit |
2016
+ * |-----|--------------------------------|-----|--------------------------------|
2017
+ * | a | AM, PM | A* | |
2018
+ * | d | Day of month | D | |
2019
+ * | h | Hour [1-12] | H | Hour [0-23] |
2020
+ * | m | Minute | M | Month |
2021
+ * | s | Second | S | Fraction of second |
2022
+ * | y | Year (abs) | Y | |
2023
+ *
2024
+ * Letters marked by * are not implemented but reserved by Unicode standard.
2025
+ */
2026
+
2027
+ const lightFormatters = {
2028
+ // Year
2029
+ y(date, token) {
2030
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
2031
+ // | Year | y | yy | yyy | yyyy | yyyyy |
2032
+ // |----------|-------|----|-------|-------|-------|
2033
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
2034
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
2035
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
2036
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
2037
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
2038
+
2039
+ const signedYear = date.getFullYear();
2040
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
2041
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
2042
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
2043
+ },
2044
+
2045
+ // Month
2046
+ M(date, token) {
2047
+ const month = date.getMonth();
2048
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
2049
+ },
2050
+
2051
+ // Day of the month
2052
+ d(date, token) {
2053
+ return addLeadingZeros(date.getDate(), token.length);
2054
+ },
2055
+
2056
+ // AM or PM
2057
+ a(date, token) {
2058
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
2059
+
2060
+ switch (token) {
2061
+ case "a":
2062
+ case "aa":
2063
+ return dayPeriodEnumValue.toUpperCase();
2064
+ case "aaa":
2065
+ return dayPeriodEnumValue;
2066
+ case "aaaaa":
2067
+ return dayPeriodEnumValue[0];
2068
+ case "aaaa":
2069
+ default:
2070
+ return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
2071
+ }
2072
+ },
2073
+
2074
+ // Hour [1-12]
2075
+ h(date, token) {
2076
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
2077
+ },
2078
+
2079
+ // Hour [0-23]
2080
+ H(date, token) {
2081
+ return addLeadingZeros(date.getHours(), token.length);
2082
+ },
2083
+
2084
+ // Minute
2085
+ m(date, token) {
2086
+ return addLeadingZeros(date.getMinutes(), token.length);
2087
+ },
2088
+
2089
+ // Second
2090
+ s(date, token) {
2091
+ return addLeadingZeros(date.getSeconds(), token.length);
2092
+ },
2093
+
2094
+ // Fraction of second
2095
+ S(date, token) {
2096
+ const numberOfDigits = token.length;
2097
+ const milliseconds = date.getMilliseconds();
2098
+ const fractionalSeconds = Math.trunc(
2099
+ milliseconds * Math.pow(10, numberOfDigits - 3),
2100
+ );
2101
+ return addLeadingZeros(fractionalSeconds, token.length);
2102
+ },
2103
+ };
2104
+
2105
+ const dayPeriodEnum = {
2106
+ am: "am",
2107
+ pm: "pm",
2108
+ midnight: "midnight",
2109
+ noon: "noon",
2110
+ morning: "morning",
2111
+ afternoon: "afternoon",
2112
+ evening: "evening",
2113
+ night: "night",
2114
+ };
2115
+
2116
+ /*
2117
+ * | | Unit | | Unit |
2118
+ * |-----|--------------------------------|-----|--------------------------------|
2119
+ * | a | AM, PM | A* | Milliseconds in day |
2120
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
2121
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
2122
+ * | d | Day of month | D | Day of year |
2123
+ * | e | Local day of week | E | Day of week |
2124
+ * | f | | F* | Day of week in month |
2125
+ * | g* | Modified Julian day | G | Era |
2126
+ * | h | Hour [1-12] | H | Hour [0-23] |
2127
+ * | i! | ISO day of week | I! | ISO week of year |
2128
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
2129
+ * | k | Hour [1-24] | K | Hour [0-11] |
2130
+ * | l* | (deprecated) | L | Stand-alone month |
2131
+ * | m | Minute | M | Month |
2132
+ * | n | | N | |
2133
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
2134
+ * | p! | Long localized time | P! | Long localized date |
2135
+ * | q | Stand-alone quarter | Q | Quarter |
2136
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
2137
+ * | s | Second | S | Fraction of second |
2138
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
2139
+ * | u | Extended year | U* | Cyclic year |
2140
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
2141
+ * | w | Local week of year | W* | Week of month |
2142
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
2143
+ * | y | Year (abs) | Y | Local week-numbering year |
2144
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
2145
+ *
2146
+ * Letters marked by * are not implemented but reserved by Unicode standard.
2147
+ *
2148
+ * Letters marked by ! are non-standard, but implemented by date-fns:
2149
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
2150
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
2151
+ * i.e. 7 for Sunday, 1 for Monday, etc.
2152
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
2153
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
2154
+ * `R` is supposed to be used in conjunction with `I` and `i`
2155
+ * for universal ISO week-numbering date, whereas
2156
+ * `Y` is supposed to be used in conjunction with `w` and `e`
2157
+ * for week-numbering date specific to the locale.
2158
+ * - `P` is long localized date format
2159
+ * - `p` is long localized time format
2160
+ */
2161
+
2162
+ const formatters = {
2163
+ // Era
2164
+ G: function (date, token, localize) {
2165
+ const era = date.getFullYear() > 0 ? 1 : 0;
2166
+ switch (token) {
2167
+ // AD, BC
2168
+ case "G":
2169
+ case "GG":
2170
+ case "GGG":
2171
+ return localize.era(era, { width: "abbreviated" });
2172
+ // A, B
2173
+ case "GGGGG":
2174
+ return localize.era(era, { width: "narrow" });
2175
+ // Anno Domini, Before Christ
2176
+ case "GGGG":
2177
+ default:
2178
+ return localize.era(era, { width: "wide" });
2179
+ }
2180
+ },
2181
+
2182
+ // Year
2183
+ y: function (date, token, localize) {
2184
+ // Ordinal number
2185
+ if (token === "yo") {
2186
+ const signedYear = date.getFullYear();
2187
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
2188
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
2189
+ return localize.ordinalNumber(year, { unit: "year" });
2190
+ }
2191
+
2192
+ return lightFormatters.y(date, token);
2193
+ },
2194
+
2195
+ // Local week-numbering year
2196
+ Y: function (date, token, localize, options) {
2197
+ const signedWeekYear = getWeekYear(date, options);
2198
+ // Returns 1 for 1 BC (which is year 0 in JavaScript)
2199
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
2200
+
2201
+ // Two digit year
2202
+ if (token === "YY") {
2203
+ const twoDigitYear = weekYear % 100;
2204
+ return addLeadingZeros(twoDigitYear, 2);
2205
+ }
2206
+
2207
+ // Ordinal number
2208
+ if (token === "Yo") {
2209
+ return localize.ordinalNumber(weekYear, { unit: "year" });
2210
+ }
2211
+
2212
+ // Padding
2213
+ return addLeadingZeros(weekYear, token.length);
2214
+ },
2215
+
2216
+ // ISO week-numbering year
2217
+ R: function (date, token) {
2218
+ const isoWeekYear = getISOWeekYear(date);
2219
+
2220
+ // Padding
2221
+ return addLeadingZeros(isoWeekYear, token.length);
2222
+ },
2223
+
2224
+ // Extended year. This is a single number designating the year of this calendar system.
2225
+ // The main difference between `y` and `u` localizers are B.C. years:
2226
+ // | Year | `y` | `u` |
2227
+ // |------|-----|-----|
2228
+ // | AC 1 | 1 | 1 |
2229
+ // | BC 1 | 1 | 0 |
2230
+ // | BC 2 | 2 | -1 |
2231
+ // Also `yy` always returns the last two digits of a year,
2232
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
2233
+ u: function (date, token) {
2234
+ const year = date.getFullYear();
2235
+ return addLeadingZeros(year, token.length);
2236
+ },
2237
+
2238
+ // Quarter
2239
+ Q: function (date, token, localize) {
2240
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
2241
+ switch (token) {
2242
+ // 1, 2, 3, 4
2243
+ case "Q":
2244
+ return String(quarter);
2245
+ // 01, 02, 03, 04
2246
+ case "QQ":
2247
+ return addLeadingZeros(quarter, 2);
2248
+ // 1st, 2nd, 3rd, 4th
2249
+ case "Qo":
2250
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
2251
+ // Q1, Q2, Q3, Q4
2252
+ case "QQQ":
2253
+ return localize.quarter(quarter, {
2254
+ width: "abbreviated",
2255
+ context: "formatting",
2256
+ });
2257
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2258
+ case "QQQQQ":
2259
+ return localize.quarter(quarter, {
2260
+ width: "narrow",
2261
+ context: "formatting",
2262
+ });
2263
+ // 1st quarter, 2nd quarter, ...
2264
+ case "QQQQ":
2265
+ default:
2266
+ return localize.quarter(quarter, {
2267
+ width: "wide",
2268
+ context: "formatting",
2269
+ });
2270
+ }
2271
+ },
2272
+
2273
+ // Stand-alone quarter
2274
+ q: function (date, token, localize) {
2275
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
2276
+ switch (token) {
2277
+ // 1, 2, 3, 4
2278
+ case "q":
2279
+ return String(quarter);
2280
+ // 01, 02, 03, 04
2281
+ case "qq":
2282
+ return addLeadingZeros(quarter, 2);
2283
+ // 1st, 2nd, 3rd, 4th
2284
+ case "qo":
2285
+ return localize.ordinalNumber(quarter, { unit: "quarter" });
2286
+ // Q1, Q2, Q3, Q4
2287
+ case "qqq":
2288
+ return localize.quarter(quarter, {
2289
+ width: "abbreviated",
2290
+ context: "standalone",
2291
+ });
2292
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
2293
+ case "qqqqq":
2294
+ return localize.quarter(quarter, {
2295
+ width: "narrow",
2296
+ context: "standalone",
2297
+ });
2298
+ // 1st quarter, 2nd quarter, ...
2299
+ case "qqqq":
2300
+ default:
2301
+ return localize.quarter(quarter, {
2302
+ width: "wide",
2303
+ context: "standalone",
2304
+ });
2305
+ }
2306
+ },
2307
+
2308
+ // Month
2309
+ M: function (date, token, localize) {
2310
+ const month = date.getMonth();
2311
+ switch (token) {
2312
+ case "M":
2313
+ case "MM":
2314
+ return lightFormatters.M(date, token);
2315
+ // 1st, 2nd, ..., 12th
2316
+ case "Mo":
2317
+ return localize.ordinalNumber(month + 1, { unit: "month" });
2318
+ // Jan, Feb, ..., Dec
2319
+ case "MMM":
2320
+ return localize.month(month, {
2321
+ width: "abbreviated",
2322
+ context: "formatting",
2323
+ });
2324
+ // J, F, ..., D
2325
+ case "MMMMM":
2326
+ return localize.month(month, {
2327
+ width: "narrow",
2328
+ context: "formatting",
2329
+ });
2330
+ // January, February, ..., December
2331
+ case "MMMM":
2332
+ default:
2333
+ return localize.month(month, { width: "wide", context: "formatting" });
2334
+ }
2335
+ },
2336
+
2337
+ // Stand-alone month
2338
+ L: function (date, token, localize) {
2339
+ const month = date.getMonth();
2340
+ switch (token) {
2341
+ // 1, 2, ..., 12
2342
+ case "L":
2343
+ return String(month + 1);
2344
+ // 01, 02, ..., 12
2345
+ case "LL":
2346
+ return addLeadingZeros(month + 1, 2);
2347
+ // 1st, 2nd, ..., 12th
2348
+ case "Lo":
2349
+ return localize.ordinalNumber(month + 1, { unit: "month" });
2350
+ // Jan, Feb, ..., Dec
2351
+ case "LLL":
2352
+ return localize.month(month, {
2353
+ width: "abbreviated",
2354
+ context: "standalone",
2355
+ });
2356
+ // J, F, ..., D
2357
+ case "LLLLL":
2358
+ return localize.month(month, {
2359
+ width: "narrow",
2360
+ context: "standalone",
2361
+ });
2362
+ // January, February, ..., December
2363
+ case "LLLL":
2364
+ default:
2365
+ return localize.month(month, { width: "wide", context: "standalone" });
2366
+ }
2367
+ },
2368
+
2369
+ // Local week of year
2370
+ w: function (date, token, localize, options) {
2371
+ const week = getWeek(date, options);
2372
+
2373
+ if (token === "wo") {
2374
+ return localize.ordinalNumber(week, { unit: "week" });
2375
+ }
2376
+
2377
+ return addLeadingZeros(week, token.length);
2378
+ },
2379
+
2380
+ // ISO week of year
2381
+ I: function (date, token, localize) {
2382
+ const isoWeek = getISOWeek(date);
2383
+
2384
+ if (token === "Io") {
2385
+ return localize.ordinalNumber(isoWeek, { unit: "week" });
2386
+ }
2387
+
2388
+ return addLeadingZeros(isoWeek, token.length);
2389
+ },
2390
+
2391
+ // Day of the month
2392
+ d: function (date, token, localize) {
2393
+ if (token === "do") {
2394
+ return localize.ordinalNumber(date.getDate(), { unit: "date" });
2395
+ }
2396
+
2397
+ return lightFormatters.d(date, token);
2398
+ },
2399
+
2400
+ // Day of year
2401
+ D: function (date, token, localize) {
2402
+ const dayOfYear = getDayOfYear(date);
2403
+
2404
+ if (token === "Do") {
2405
+ return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
2406
+ }
2407
+
2408
+ return addLeadingZeros(dayOfYear, token.length);
2409
+ },
2410
+
2411
+ // Day of week
2412
+ E: function (date, token, localize) {
2413
+ const dayOfWeek = date.getDay();
2414
+ switch (token) {
2415
+ // Tue
2416
+ case "E":
2417
+ case "EE":
2418
+ case "EEE":
2419
+ return localize.day(dayOfWeek, {
2420
+ width: "abbreviated",
2421
+ context: "formatting",
2422
+ });
2423
+ // T
2424
+ case "EEEEE":
2425
+ return localize.day(dayOfWeek, {
2426
+ width: "narrow",
2427
+ context: "formatting",
2428
+ });
2429
+ // Tu
2430
+ case "EEEEEE":
2431
+ return localize.day(dayOfWeek, {
2432
+ width: "short",
2433
+ context: "formatting",
2434
+ });
2435
+ // Tuesday
2436
+ case "EEEE":
2437
+ default:
2438
+ return localize.day(dayOfWeek, {
2439
+ width: "wide",
2440
+ context: "formatting",
2441
+ });
2442
+ }
2443
+ },
2444
+
2445
+ // Local day of week
2446
+ e: function (date, token, localize, options) {
2447
+ const dayOfWeek = date.getDay();
2448
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2449
+ switch (token) {
2450
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
2451
+ case "e":
2452
+ return String(localDayOfWeek);
2453
+ // Padded numerical value
2454
+ case "ee":
2455
+ return addLeadingZeros(localDayOfWeek, 2);
2456
+ // 1st, 2nd, ..., 7th
2457
+ case "eo":
2458
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
2459
+ case "eee":
2460
+ return localize.day(dayOfWeek, {
2461
+ width: "abbreviated",
2462
+ context: "formatting",
2463
+ });
2464
+ // T
2465
+ case "eeeee":
2466
+ return localize.day(dayOfWeek, {
2467
+ width: "narrow",
2468
+ context: "formatting",
2469
+ });
2470
+ // Tu
2471
+ case "eeeeee":
2472
+ return localize.day(dayOfWeek, {
2473
+ width: "short",
2474
+ context: "formatting",
2475
+ });
2476
+ // Tuesday
2477
+ case "eeee":
2478
+ default:
2479
+ return localize.day(dayOfWeek, {
2480
+ width: "wide",
2481
+ context: "formatting",
2482
+ });
2483
+ }
2484
+ },
2485
+
2486
+ // Stand-alone local day of week
2487
+ c: function (date, token, localize, options) {
2488
+ const dayOfWeek = date.getDay();
2489
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
2490
+ switch (token) {
2491
+ // Numerical value (same as in `e`)
2492
+ case "c":
2493
+ return String(localDayOfWeek);
2494
+ // Padded numerical value
2495
+ case "cc":
2496
+ return addLeadingZeros(localDayOfWeek, token.length);
2497
+ // 1st, 2nd, ..., 7th
2498
+ case "co":
2499
+ return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
2500
+ case "ccc":
2501
+ return localize.day(dayOfWeek, {
2502
+ width: "abbreviated",
2503
+ context: "standalone",
2504
+ });
2505
+ // T
2506
+ case "ccccc":
2507
+ return localize.day(dayOfWeek, {
2508
+ width: "narrow",
2509
+ context: "standalone",
2510
+ });
2511
+ // Tu
2512
+ case "cccccc":
2513
+ return localize.day(dayOfWeek, {
2514
+ width: "short",
2515
+ context: "standalone",
2516
+ });
2517
+ // Tuesday
2518
+ case "cccc":
2519
+ default:
2520
+ return localize.day(dayOfWeek, {
2521
+ width: "wide",
2522
+ context: "standalone",
2523
+ });
2524
+ }
2525
+ },
2526
+
2527
+ // ISO day of week
2528
+ i: function (date, token, localize) {
2529
+ const dayOfWeek = date.getDay();
2530
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
2531
+ switch (token) {
2532
+ // 2
2533
+ case "i":
2534
+ return String(isoDayOfWeek);
2535
+ // 02
2536
+ case "ii":
2537
+ return addLeadingZeros(isoDayOfWeek, token.length);
2538
+ // 2nd
2539
+ case "io":
2540
+ return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
2541
+ // Tue
2542
+ case "iii":
2543
+ return localize.day(dayOfWeek, {
2544
+ width: "abbreviated",
2545
+ context: "formatting",
2546
+ });
2547
+ // T
2548
+ case "iiiii":
2549
+ return localize.day(dayOfWeek, {
2550
+ width: "narrow",
2551
+ context: "formatting",
2552
+ });
2553
+ // Tu
2554
+ case "iiiiii":
2555
+ return localize.day(dayOfWeek, {
2556
+ width: "short",
2557
+ context: "formatting",
2558
+ });
2559
+ // Tuesday
2560
+ case "iiii":
2561
+ default:
2562
+ return localize.day(dayOfWeek, {
2563
+ width: "wide",
2564
+ context: "formatting",
2565
+ });
2566
+ }
2567
+ },
2568
+
2569
+ // AM or PM
2570
+ a: function (date, token, localize) {
2571
+ const hours = date.getHours();
2572
+ const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2573
+
2574
+ switch (token) {
2575
+ case "a":
2576
+ case "aa":
2577
+ return localize.dayPeriod(dayPeriodEnumValue, {
2578
+ width: "abbreviated",
2579
+ context: "formatting",
2580
+ });
2581
+ case "aaa":
2582
+ return localize
2583
+ .dayPeriod(dayPeriodEnumValue, {
2584
+ width: "abbreviated",
2585
+ context: "formatting",
2586
+ })
2587
+ .toLowerCase();
2588
+ case "aaaaa":
2589
+ return localize.dayPeriod(dayPeriodEnumValue, {
2590
+ width: "narrow",
2591
+ context: "formatting",
2592
+ });
2593
+ case "aaaa":
2594
+ default:
2595
+ return localize.dayPeriod(dayPeriodEnumValue, {
2596
+ width: "wide",
2597
+ context: "formatting",
2598
+ });
2599
+ }
2600
+ },
2601
+
2602
+ // AM, PM, midnight, noon
2603
+ b: function (date, token, localize) {
2604
+ const hours = date.getHours();
2605
+ let dayPeriodEnumValue;
2606
+ if (hours === 12) {
2607
+ dayPeriodEnumValue = dayPeriodEnum.noon;
2608
+ } else if (hours === 0) {
2609
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
2610
+ } else {
2611
+ dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
2612
+ }
2613
+
2614
+ switch (token) {
2615
+ case "b":
2616
+ case "bb":
2617
+ return localize.dayPeriod(dayPeriodEnumValue, {
2618
+ width: "abbreviated",
2619
+ context: "formatting",
2620
+ });
2621
+ case "bbb":
2622
+ return localize
2623
+ .dayPeriod(dayPeriodEnumValue, {
2624
+ width: "abbreviated",
2625
+ context: "formatting",
2626
+ })
2627
+ .toLowerCase();
2628
+ case "bbbbb":
2629
+ return localize.dayPeriod(dayPeriodEnumValue, {
2630
+ width: "narrow",
2631
+ context: "formatting",
2632
+ });
2633
+ case "bbbb":
2634
+ default:
2635
+ return localize.dayPeriod(dayPeriodEnumValue, {
2636
+ width: "wide",
2637
+ context: "formatting",
2638
+ });
2639
+ }
2640
+ },
2641
+
2642
+ // in the morning, in the afternoon, in the evening, at night
2643
+ B: function (date, token, localize) {
2644
+ const hours = date.getHours();
2645
+ let dayPeriodEnumValue;
2646
+ if (hours >= 17) {
2647
+ dayPeriodEnumValue = dayPeriodEnum.evening;
2648
+ } else if (hours >= 12) {
2649
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
2650
+ } else if (hours >= 4) {
2651
+ dayPeriodEnumValue = dayPeriodEnum.morning;
2652
+ } else {
2653
+ dayPeriodEnumValue = dayPeriodEnum.night;
2654
+ }
2655
+
2656
+ switch (token) {
2657
+ case "B":
2658
+ case "BB":
2659
+ case "BBB":
2660
+ return localize.dayPeriod(dayPeriodEnumValue, {
2661
+ width: "abbreviated",
2662
+ context: "formatting",
2663
+ });
2664
+ case "BBBBB":
2665
+ return localize.dayPeriod(dayPeriodEnumValue, {
2666
+ width: "narrow",
2667
+ context: "formatting",
2668
+ });
2669
+ case "BBBB":
2670
+ default:
2671
+ return localize.dayPeriod(dayPeriodEnumValue, {
2672
+ width: "wide",
2673
+ context: "formatting",
2674
+ });
2675
+ }
2676
+ },
2677
+
2678
+ // Hour [1-12]
2679
+ h: function (date, token, localize) {
2680
+ if (token === "ho") {
2681
+ let hours = date.getHours() % 12;
2682
+ if (hours === 0) hours = 12;
2683
+ return localize.ordinalNumber(hours, { unit: "hour" });
2684
+ }
2685
+
2686
+ return lightFormatters.h(date, token);
2687
+ },
2688
+
2689
+ // Hour [0-23]
2690
+ H: function (date, token, localize) {
2691
+ if (token === "Ho") {
2692
+ return localize.ordinalNumber(date.getHours(), { unit: "hour" });
2693
+ }
2694
+
2695
+ return lightFormatters.H(date, token);
2696
+ },
2697
+
2698
+ // Hour [0-11]
2699
+ K: function (date, token, localize) {
2700
+ const hours = date.getHours() % 12;
2701
+
2702
+ if (token === "Ko") {
2703
+ return localize.ordinalNumber(hours, { unit: "hour" });
2704
+ }
2705
+
2706
+ return addLeadingZeros(hours, token.length);
2707
+ },
2708
+
2709
+ // Hour [1-24]
2710
+ k: function (date, token, localize) {
2711
+ let hours = date.getHours();
2712
+ if (hours === 0) hours = 24;
2713
+
2714
+ if (token === "ko") {
2715
+ return localize.ordinalNumber(hours, { unit: "hour" });
2716
+ }
2717
+
2718
+ return addLeadingZeros(hours, token.length);
2719
+ },
2720
+
2721
+ // Minute
2722
+ m: function (date, token, localize) {
2723
+ if (token === "mo") {
2724
+ return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
2725
+ }
2726
+
2727
+ return lightFormatters.m(date, token);
2728
+ },
2729
+
2730
+ // Second
2731
+ s: function (date, token, localize) {
2732
+ if (token === "so") {
2733
+ return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
2734
+ }
2735
+
2736
+ return lightFormatters.s(date, token);
2737
+ },
2738
+
2739
+ // Fraction of second
2740
+ S: function (date, token) {
2741
+ return lightFormatters.S(date, token);
2742
+ },
2743
+
2744
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2745
+ X: function (date, token, _localize) {
2746
+ const timezoneOffset = date.getTimezoneOffset();
2747
+
2748
+ if (timezoneOffset === 0) {
2749
+ return "Z";
2750
+ }
2751
+
2752
+ switch (token) {
2753
+ // Hours and optional minutes
2754
+ case "X":
2755
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2756
+
2757
+ // Hours, minutes and optional seconds without `:` delimiter
2758
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2759
+ // so this token always has the same output as `XX`
2760
+ case "XXXX":
2761
+ case "XX": // Hours and minutes without `:` delimiter
2762
+ return formatTimezone(timezoneOffset);
2763
+
2764
+ // Hours, minutes and optional seconds with `:` delimiter
2765
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2766
+ // so this token always has the same output as `XXX`
2767
+ case "XXXXX":
2768
+ case "XXX": // Hours and minutes with `:` delimiter
2769
+ default:
2770
+ return formatTimezone(timezoneOffset, ":");
2771
+ }
2772
+ },
2773
+
2774
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2775
+ x: function (date, token, _localize) {
2776
+ const timezoneOffset = date.getTimezoneOffset();
2777
+
2778
+ switch (token) {
2779
+ // Hours and optional minutes
2780
+ case "x":
2781
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2782
+
2783
+ // Hours, minutes and optional seconds without `:` delimiter
2784
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2785
+ // so this token always has the same output as `xx`
2786
+ case "xxxx":
2787
+ case "xx": // Hours and minutes without `:` delimiter
2788
+ return formatTimezone(timezoneOffset);
2789
+
2790
+ // Hours, minutes and optional seconds with `:` delimiter
2791
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2792
+ // so this token always has the same output as `xxx`
2793
+ case "xxxxx":
2794
+ case "xxx": // Hours and minutes with `:` delimiter
2795
+ default:
2796
+ return formatTimezone(timezoneOffset, ":");
2797
+ }
2798
+ },
2799
+
2800
+ // Timezone (GMT)
2801
+ O: function (date, token, _localize) {
2802
+ const timezoneOffset = date.getTimezoneOffset();
2803
+
2804
+ switch (token) {
2805
+ // Short
2806
+ case "O":
2807
+ case "OO":
2808
+ case "OOO":
2809
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2810
+ // Long
2811
+ case "OOOO":
2812
+ default:
2813
+ return "GMT" + formatTimezone(timezoneOffset, ":");
2814
+ }
2815
+ },
2816
+
2817
+ // Timezone (specific non-location)
2818
+ z: function (date, token, _localize) {
2819
+ const timezoneOffset = date.getTimezoneOffset();
2820
+
2821
+ switch (token) {
2822
+ // Short
2823
+ case "z":
2824
+ case "zz":
2825
+ case "zzz":
2826
+ return "GMT" + formatTimezoneShort(timezoneOffset, ":");
2827
+ // Long
2828
+ case "zzzz":
2829
+ default:
2830
+ return "GMT" + formatTimezone(timezoneOffset, ":");
2831
+ }
2832
+ },
2833
+
2834
+ // Seconds timestamp
2835
+ t: function (date, token, _localize) {
2836
+ const timestamp = Math.trunc(+date / 1000);
2837
+ return addLeadingZeros(timestamp, token.length);
2838
+ },
2839
+
2840
+ // Milliseconds timestamp
2841
+ T: function (date, token, _localize) {
2842
+ return addLeadingZeros(+date, token.length);
2843
+ },
2844
+ };
2845
+
2846
+ function formatTimezoneShort(offset, delimiter = "") {
2847
+ const sign = offset > 0 ? "-" : "+";
2848
+ const absOffset = Math.abs(offset);
2849
+ const hours = Math.trunc(absOffset / 60);
2850
+ const minutes = absOffset % 60;
2851
+ if (minutes === 0) {
2852
+ return sign + String(hours);
2853
+ }
2854
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
2855
+ }
2856
+
2857
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
2858
+ if (offset % 60 === 0) {
2859
+ const sign = offset > 0 ? "-" : "+";
2860
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
2861
+ }
2862
+ return formatTimezone(offset, delimiter);
2863
+ }
2864
+
2865
+ function formatTimezone(offset, delimiter = "") {
2866
+ const sign = offset > 0 ? "-" : "+";
2867
+ const absOffset = Math.abs(offset);
2868
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
2869
+ const minutes = addLeadingZeros(absOffset % 60, 2);
2870
+ return sign + hours + delimiter + minutes;
2871
+ }
2872
+
2873
+ const dateLongFormatter = (pattern, formatLong) => {
2874
+ switch (pattern) {
2875
+ case "P":
2876
+ return formatLong.date({ width: "short" });
2877
+ case "PP":
2878
+ return formatLong.date({ width: "medium" });
2879
+ case "PPP":
2880
+ return formatLong.date({ width: "long" });
2881
+ case "PPPP":
2882
+ default:
2883
+ return formatLong.date({ width: "full" });
2884
+ }
2885
+ };
2886
+
2887
+ const timeLongFormatter = (pattern, formatLong) => {
2888
+ switch (pattern) {
2889
+ case "p":
2890
+ return formatLong.time({ width: "short" });
2891
+ case "pp":
2892
+ return formatLong.time({ width: "medium" });
2893
+ case "ppp":
2894
+ return formatLong.time({ width: "long" });
2895
+ case "pppp":
2896
+ default:
2897
+ return formatLong.time({ width: "full" });
2898
+ }
2899
+ };
2900
+
2901
+ const dateTimeLongFormatter = (pattern, formatLong) => {
2902
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
2903
+ const datePattern = matchResult[1];
2904
+ const timePattern = matchResult[2];
2905
+
2906
+ if (!timePattern) {
2907
+ return dateLongFormatter(pattern, formatLong);
2908
+ }
2909
+
2910
+ let dateTimeFormat;
2911
+
2912
+ switch (datePattern) {
2913
+ case "P":
2914
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
2915
+ break;
2916
+ case "PP":
2917
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
2918
+ break;
2919
+ case "PPP":
2920
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
2921
+ break;
2922
+ case "PPPP":
2923
+ default:
2924
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
2925
+ break;
2926
+ }
2927
+
2928
+ return dateTimeFormat
2929
+ .replace("{{date}}", dateLongFormatter(datePattern, formatLong))
2930
+ .replace("{{time}}", timeLongFormatter(timePattern, formatLong));
2931
+ };
2932
+
2933
+ const longFormatters = {
2934
+ p: timeLongFormatter,
2935
+ P: dateTimeLongFormatter,
2936
+ };
2937
+
2938
+ const dayOfYearTokenRE = /^D+$/;
2939
+ const weekYearTokenRE = /^Y+$/;
2940
+
2941
+ const throwTokens = ["D", "DD", "YY", "YYYY"];
2942
+
2943
+ function isProtectedDayOfYearToken(token) {
2944
+ return dayOfYearTokenRE.test(token);
2945
+ }
2946
+
2947
+ function isProtectedWeekYearToken(token) {
2948
+ return weekYearTokenRE.test(token);
2949
+ }
2950
+
2951
+ function warnOrThrowProtectedError(token, format, input) {
2952
+ const _message = message(token, format, input);
2953
+ console.warn(_message);
2954
+ if (throwTokens.includes(token)) throw new RangeError(_message);
2955
+ }
2956
+
2957
+ function message(token, format, input) {
2958
+ const subject = token[0] === "Y" ? "years" : "days of the month";
2959
+ return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
2960
+ }
2961
+
2962
+ // This RegExp consists of three parts separated by `|`:
2963
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2964
+ // (one of the certain letters followed by `o`)
2965
+ // - (\w)\1* matches any sequences of the same letter
2966
+ // - '' matches two quote characters in a row
2967
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2968
+ // except a single quote symbol, which ends the sequence.
2969
+ // Two quote characters do not end the sequence.
2970
+ // If there is no matching single quote
2971
+ // then the sequence will continue until the end of the string.
2972
+ // - . matches any single character unmatched by previous parts of the RegExps
2973
+ const formattingTokensRegExp =
2974
+ /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
2975
+
2976
+ // This RegExp catches symbols escaped by quotes, and also
2977
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2978
+ const longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2979
+
2980
+ const escapedStringRegExp = /^'([^]*?)'?$/;
2981
+ const doubleQuoteRegExp = /''/g;
2982
+ const unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2983
+
2984
+ /**
2985
+ * The {@link format} function options.
2986
+ */
2987
+
2988
+ /**
2989
+ * @name format
2990
+ * @alias formatDate
2991
+ * @category Common Helpers
2992
+ * @summary Format the date.
2993
+ *
2994
+ * @description
2995
+ * Return the formatted date string in the given format. The result may vary by locale.
2996
+ *
2997
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2998
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2999
+ *
3000
+ * The characters wrapped between two single quotes characters (') are escaped.
3001
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
3002
+ * (see the last example)
3003
+ *
3004
+ * Format of the string is based on Unicode Technical Standard #35:
3005
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
3006
+ * with a few additions (see note 7 below the table).
3007
+ *
3008
+ * Accepted patterns:
3009
+ * | Unit | Pattern | Result examples | Notes |
3010
+ * |---------------------------------|---------|-----------------------------------|-------|
3011
+ * | Era | G..GGG | AD, BC | |
3012
+ * | | GGGG | Anno Domini, Before Christ | 2 |
3013
+ * | | GGGGG | A, B | |
3014
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
3015
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
3016
+ * | | yy | 44, 01, 00, 17 | 5 |
3017
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
3018
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
3019
+ * | | yyyyy | ... | 3,5 |
3020
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
3021
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
3022
+ * | | YY | 44, 01, 00, 17 | 5,8 |
3023
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
3024
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
3025
+ * | | YYYYY | ... | 3,5 |
3026
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
3027
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
3028
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
3029
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
3030
+ * | | RRRRR | ... | 3,5,7 |
3031
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
3032
+ * | | uu | -43, 01, 1900, 2017 | 5 |
3033
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
3034
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
3035
+ * | | uuuuu | ... | 3,5 |
3036
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
3037
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
3038
+ * | | QQ | 01, 02, 03, 04 | |
3039
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
3040
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
3041
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
3042
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
3043
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
3044
+ * | | qq | 01, 02, 03, 04 | |
3045
+ * | | qqq | Q1, Q2, Q3, Q4 | |
3046
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
3047
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
3048
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
3049
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
3050
+ * | | MM | 01, 02, ..., 12 | |
3051
+ * | | MMM | Jan, Feb, ..., Dec | |
3052
+ * | | MMMM | January, February, ..., December | 2 |
3053
+ * | | MMMMM | J, F, ..., D | |
3054
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
3055
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
3056
+ * | | LL | 01, 02, ..., 12 | |
3057
+ * | | LLL | Jan, Feb, ..., Dec | |
3058
+ * | | LLLL | January, February, ..., December | 2 |
3059
+ * | | LLLLL | J, F, ..., D | |
3060
+ * | Local week of year | w | 1, 2, ..., 53 | |
3061
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
3062
+ * | | ww | 01, 02, ..., 53 | |
3063
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
3064
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
3065
+ * | | II | 01, 02, ..., 53 | 7 |
3066
+ * | Day of month | d | 1, 2, ..., 31 | |
3067
+ * | | do | 1st, 2nd, ..., 31st | 7 |
3068
+ * | | dd | 01, 02, ..., 31 | |
3069
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
3070
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
3071
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
3072
+ * | | DDD | 001, 002, ..., 365, 366 | |
3073
+ * | | DDDD | ... | 3 |
3074
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
3075
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
3076
+ * | | EEEEE | M, T, W, T, F, S, S | |
3077
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
3078
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
3079
+ * | | io | 1st, 2nd, ..., 7th | 7 |
3080
+ * | | ii | 01, 02, ..., 07 | 7 |
3081
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
3082
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
3083
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
3084
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
3085
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
3086
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
3087
+ * | | ee | 02, 03, ..., 01 | |
3088
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
3089
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
3090
+ * | | eeeee | M, T, W, T, F, S, S | |
3091
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
3092
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
3093
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
3094
+ * | | cc | 02, 03, ..., 01 | |
3095
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
3096
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
3097
+ * | | ccccc | M, T, W, T, F, S, S | |
3098
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
3099
+ * | AM, PM | a..aa | AM, PM | |
3100
+ * | | aaa | am, pm | |
3101
+ * | | aaaa | a.m., p.m. | 2 |
3102
+ * | | aaaaa | a, p | |
3103
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
3104
+ * | | bbb | am, pm, noon, midnight | |
3105
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
3106
+ * | | bbbbb | a, p, n, mi | |
3107
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
3108
+ * | | BBBB | at night, in the morning, ... | 2 |
3109
+ * | | BBBBB | at night, in the morning, ... | |
3110
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
3111
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
3112
+ * | | hh | 01, 02, ..., 11, 12 | |
3113
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
3114
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
3115
+ * | | HH | 00, 01, 02, ..., 23 | |
3116
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
3117
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
3118
+ * | | KK | 01, 02, ..., 11, 00 | |
3119
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
3120
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
3121
+ * | | kk | 24, 01, 02, ..., 23 | |
3122
+ * | Minute | m | 0, 1, ..., 59 | |
3123
+ * | | mo | 0th, 1st, ..., 59th | 7 |
3124
+ * | | mm | 00, 01, ..., 59 | |
3125
+ * | Second | s | 0, 1, ..., 59 | |
3126
+ * | | so | 0th, 1st, ..., 59th | 7 |
3127
+ * | | ss | 00, 01, ..., 59 | |
3128
+ * | Fraction of second | S | 0, 1, ..., 9 | |
3129
+ * | | SS | 00, 01, ..., 99 | |
3130
+ * | | SSS | 000, 001, ..., 999 | |
3131
+ * | | SSSS | ... | 3 |
3132
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
3133
+ * | | XX | -0800, +0530, Z | |
3134
+ * | | XXX | -08:00, +05:30, Z | |
3135
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
3136
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
3137
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
3138
+ * | | xx | -0800, +0530, +0000 | |
3139
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
3140
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
3141
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
3142
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
3143
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
3144
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
3145
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
3146
+ * | Seconds timestamp | t | 512969520 | 7 |
3147
+ * | | tt | ... | 3,7 |
3148
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
3149
+ * | | TT | ... | 3,7 |
3150
+ * | Long localized date | P | 04/29/1453 | 7 |
3151
+ * | | PP | Apr 29, 1453 | 7 |
3152
+ * | | PPP | April 29th, 1453 | 7 |
3153
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
3154
+ * | Long localized time | p | 12:00 AM | 7 |
3155
+ * | | pp | 12:00:00 AM | 7 |
3156
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
3157
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
3158
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
3159
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
3160
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
3161
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
3162
+ * Notes:
3163
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
3164
+ * are the same as "stand-alone" units, but are different in some languages.
3165
+ * "Formatting" units are declined according to the rules of the language
3166
+ * in the context of a date. "Stand-alone" units are always nominative singular:
3167
+ *
3168
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
3169
+ *
3170
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
3171
+ *
3172
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
3173
+ * the single quote characters (see below).
3174
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
3175
+ * the output will be the same as default pattern for this unit, usually
3176
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
3177
+ * are marked with "2" in the last column of the table.
3178
+ *
3179
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
3180
+ *
3181
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
3182
+ *
3183
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
3184
+ *
3185
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
3186
+ *
3187
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
3188
+ *
3189
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
3190
+ * The output will be padded with zeros to match the length of the pattern.
3191
+ *
3192
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
3193
+ *
3194
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
3195
+ * These tokens represent the shortest form of the quarter.
3196
+ *
3197
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
3198
+ *
3199
+ * | Year | `y` | `u` |
3200
+ * |------|-----|-----|
3201
+ * | AC 1 | 1 | 1 |
3202
+ * | BC 1 | 1 | 0 |
3203
+ * | BC 2 | 2 | -1 |
3204
+ *
3205
+ * Also `yy` always returns the last two digits of a year,
3206
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
3207
+ *
3208
+ * | Year | `yy` | `uu` |
3209
+ * |------|------|------|
3210
+ * | 1 | 01 | 01 |
3211
+ * | 14 | 14 | 14 |
3212
+ * | 376 | 76 | 376 |
3213
+ * | 1453 | 53 | 1453 |
3214
+ *
3215
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
3216
+ * except local week-numbering years are dependent on `options.weekStartsOn`
3217
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
3218
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
3219
+ *
3220
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
3221
+ * so right now these tokens fall back to GMT timezones.
3222
+ *
3223
+ * 7. These patterns are not in the Unicode Technical Standard #35:
3224
+ * - `i`: ISO day of week
3225
+ * - `I`: ISO week of year
3226
+ * - `R`: ISO week-numbering year
3227
+ * - `t`: seconds timestamp
3228
+ * - `T`: milliseconds timestamp
3229
+ * - `o`: ordinal number modifier
3230
+ * - `P`: long localized date
3231
+ * - `p`: long localized time
3232
+ *
3233
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
3234
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3235
+ *
3236
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
3237
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3238
+ *
3239
+ * @param date - The original date
3240
+ * @param format - The string of tokens
3241
+ * @param options - An object with options
3242
+ *
3243
+ * @returns The formatted date string
3244
+ *
3245
+ * @throws `date` must not be Invalid Date
3246
+ * @throws `options.locale` must contain `localize` property
3247
+ * @throws `options.locale` must contain `formatLong` property
3248
+ * @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3249
+ * @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3250
+ * @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3251
+ * @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
3252
+ * @throws format string contains an unescaped latin alphabet character
3253
+ *
3254
+ * @example
3255
+ * // Represent 11 February 2014 in middle-endian format:
3256
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
3257
+ * //=> '02/11/2014'
3258
+ *
3259
+ * @example
3260
+ * // Represent 2 July 2014 in Esperanto:
3261
+ * import { eoLocale } from 'date-fns/locale/eo'
3262
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
3263
+ * locale: eoLocale
3264
+ * })
3265
+ * //=> '2-a de julio 2014'
3266
+ *
3267
+ * @example
3268
+ * // Escape string by single quote characters:
3269
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
3270
+ * //=> "3 o'clock"
3271
+ */
3272
+ function format(date, formatStr, options) {
3273
+ const defaultOptions = getDefaultOptions();
3274
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS;
3275
+
3276
+ const firstWeekContainsDate =
3277
+ options?.firstWeekContainsDate ??
3278
+ options?.locale?.options?.firstWeekContainsDate ??
3279
+ defaultOptions.firstWeekContainsDate ??
3280
+ defaultOptions.locale?.options?.firstWeekContainsDate ??
3281
+ 1;
3282
+
3283
+ const weekStartsOn =
3284
+ options?.weekStartsOn ??
3285
+ options?.locale?.options?.weekStartsOn ??
3286
+ defaultOptions.weekStartsOn ??
3287
+ defaultOptions.locale?.options?.weekStartsOn ??
3288
+ 0;
3289
+
3290
+ const originalDate = toDate(date, options?.in);
3291
+
3292
+ if (!isValid(originalDate)) {
3293
+ throw new RangeError("Invalid time value");
3294
+ }
3295
+
3296
+ let parts = formatStr
3297
+ .match(longFormattingTokensRegExp)
3298
+ .map((substring) => {
3299
+ const firstCharacter = substring[0];
3300
+ if (firstCharacter === "p" || firstCharacter === "P") {
3301
+ const longFormatter = longFormatters[firstCharacter];
3302
+ return longFormatter(substring, locale.formatLong);
3303
+ }
3304
+ return substring;
3305
+ })
3306
+ .join("")
3307
+ .match(formattingTokensRegExp)
3308
+ .map((substring) => {
3309
+ // Replace two single quote characters with one single quote character
3310
+ if (substring === "''") {
3311
+ return { isToken: false, value: "'" };
3312
+ }
3313
+
3314
+ const firstCharacter = substring[0];
3315
+ if (firstCharacter === "'") {
3316
+ return { isToken: false, value: cleanEscapedString(substring) };
3317
+ }
3318
+
3319
+ if (formatters[firstCharacter]) {
3320
+ return { isToken: true, value: substring };
3321
+ }
3322
+
3323
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
3324
+ throw new RangeError(
3325
+ "Format string contains an unescaped latin alphabet character `" +
3326
+ firstCharacter +
3327
+ "`",
3328
+ );
3329
+ }
3330
+
3331
+ return { isToken: false, value: substring };
3332
+ });
3333
+
3334
+ // invoke localize preprocessor (only for french locales at the moment)
3335
+ if (locale.localize.preprocessor) {
3336
+ parts = locale.localize.preprocessor(originalDate, parts);
3337
+ }
3338
+
3339
+ const formatterOptions = {
3340
+ firstWeekContainsDate,
3341
+ weekStartsOn,
3342
+ locale,
3343
+ };
3344
+
3345
+ return parts
3346
+ .map((part) => {
3347
+ if (!part.isToken) return part.value;
3348
+
3349
+ const token = part.value;
3350
+
3351
+ if (
3352
+ (!options?.useAdditionalWeekYearTokens &&
3353
+ isProtectedWeekYearToken(token)) ||
3354
+ (!options?.useAdditionalDayOfYearTokens &&
3355
+ isProtectedDayOfYearToken(token))
3356
+ ) {
3357
+ warnOrThrowProtectedError(token, formatStr, String(date));
3358
+ }
3359
+
3360
+ const formatter = formatters[token[0]];
3361
+ return formatter(originalDate, token, locale.localize, formatterOptions);
3362
+ })
3363
+ .join("");
3364
+ }
3365
+
3366
+ function cleanEscapedString(input) {
3367
+ const matched = input.match(escapedStringRegExp);
3368
+
3369
+ if (!matched) {
3370
+ return input;
3371
+ }
3372
+
3373
+ return matched[1].replace(doubleQuoteRegExp, "'");
3374
+ }
3375
+
3376
+ /**
3377
+ * The {@link getDay} function options.
3378
+ */
3379
+
3380
+ /**
3381
+ * @name getDay
3382
+ * @category Weekday Helpers
3383
+ * @summary Get the day of the week of the given date.
3384
+ *
3385
+ * @description
3386
+ * Get the day of the week of the given date.
3387
+ *
3388
+ * @param date - The given date
3389
+ * @param options - The options
3390
+ *
3391
+ * @returns The day of week, 0 represents Sunday
3392
+ *
3393
+ * @example
3394
+ * // Which day of the week is 29 February 2012?
3395
+ * const result = getDay(new Date(2012, 1, 29))
3396
+ * //=> 3
3397
+ */
3398
+ function getDay(date, options) {
3399
+ return toDate(date, options?.in).getDay();
3400
+ }
3401
+
3402
+ /**
3403
+ * The {@link isToday} function options.
3404
+ */
3405
+
3406
+ /**
3407
+ * @name isToday
3408
+ * @category Day Helpers
3409
+ * @summary Is the given date today?
3410
+ * @pure false
3411
+ *
3412
+ * @description
3413
+ * Is the given date today?
3414
+ *
3415
+ * @param date - The date to check
3416
+ * @param options - An object with options
3417
+ *
3418
+ * @returns The date is today
3419
+ *
3420
+ * @example
3421
+ * // If today is 6 October 2014, is 6 October 14:00:00 today?
3422
+ * const result = isToday(new Date(2014, 9, 6, 14, 0))
3423
+ * //=> true
3424
+ */
3425
+ function isToday(date, options) {
3426
+ return isSameDay(
3427
+ constructFrom(options?.in || date, date),
3428
+ constructNow(options?.in || date),
3429
+ );
3430
+ }
3431
+
3432
+ /**
3433
+ * The subMonths function options.
3434
+ */
3435
+
3436
+ /**
3437
+ * @name subMonths
3438
+ * @category Month Helpers
3439
+ * @summary Subtract the specified number of months from the given date.
3440
+ *
3441
+ * @description
3442
+ * Subtract the specified number of months from the given date.
3443
+ *
3444
+ * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
3445
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
3446
+ *
3447
+ * @param date - The date to be changed
3448
+ * @param amount - The amount of months to be subtracted.
3449
+ * @param options - An object with options
3450
+ *
3451
+ * @returns The new date with the months subtracted
3452
+ *
3453
+ * @example
3454
+ * // Subtract 5 months from 1 February 2015:
3455
+ * const result = subMonths(new Date(2015, 1, 1), 5)
3456
+ * //=> Mon Sep 01 2014 00:00:00
3457
+ */
3458
+ function subMonths(date, amount, options) {
3459
+ return addMonths(date, -amount, options);
3460
+ }
3461
+
3462
+ const jeDatepickerCss = ":host{display:block;padding:var(--je-spacing-xs);box-sizing:border-box}je-button.day{--je-button-min-width:20px;--je-button-height:20px;--je-button-inline-padding:0px}je-button.day::part(inner-button){font-weight:400}.header{display:flex;align-items:center;margin-bottom:10px}.header div{user-select:none;display:flex;cursor:pointer;flex:1;align-items:center}.weekdays-grid{display:grid;grid-template-columns:repeat(7, 1fr);gap:5px;margin-bottom:8px}.weekdays-grid div{height:20px;font-size:1em;font-weight:400;color:var(--je-medium-600);text-align:center;align-content:center}.days-grid{display:grid;grid-template-columns:repeat(7, 1fr);gap:5px}je-icon{transition:transform 250ms ease}je-icon.open{transform:rotate(180deg)}";
3463
+ const JeDatepickerStyle0 = jeDatepickerCss;
3464
+
3465
+ const JeDatepicker = class {
3466
+ constructor(hostRef) {
3467
+ registerInstance(this, hostRef);
3468
+ this.valueChange = createEvent(this, "valueChange", 7);
3469
+ this.nextMonth = () => {
3470
+ this.currentDate = addMonths(this.currentDate, 1);
3471
+ };
3472
+ this.prevMonth = () => {
3473
+ this.currentDate = subMonths(this.currentDate, 1);
3474
+ };
3475
+ this.currentDate = new Date();
3476
+ this.value = undefined;
3477
+ this.isDark = false;
3478
+ this.monthYearPicker = false;
3479
+ }
3480
+ handleThemeChange(e) {
3481
+ this.isDark = e.detail === 'dark';
3482
+ }
3483
+ valueChangeHandler() {
3484
+ this.valueChange.emit(this.value ? new Date(this.value) : undefined);
3485
+ }
3486
+ getDaysInMonth() {
3487
+ const start = startOfMonth(this.currentDate);
3488
+ const end = endOfMonth(this.currentDate);
3489
+ return eachDayOfInterval({ start, end });
3490
+ }
3491
+ render() {
3492
+ const daysOfWeek = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
3493
+ const firstDayOfMonth = startOfMonth(this.currentDate);
3494
+ const lastDayOfMonth = endOfMonth(this.currentDate);
3495
+ const firstDayOfWeek = getDay(firstDayOfMonth);
3496
+ const lastDayOfWeek = getDay(lastDayOfMonth);
3497
+ const daysInMonth = eachDayOfInterval({ start: firstDayOfMonth, end: lastDayOfMonth });
3498
+ const prevMonth = subMonths(this.currentDate, 1);
3499
+ const prevMonthEnd = endOfMonth(prevMonth);
3500
+ const daysBefore = Array.from({ length: firstDayOfWeek }).map((_, i) => subMonths(this.currentDate, 1).setDate(prevMonthEnd.getDate() - (firstDayOfWeek - i - 1)));
3501
+ const daysAfter = Array.from({ length: 6 - lastDayOfWeek }).map((_, i) => addMonths(this.currentDate, 1).setDate(i + 1));
3502
+ return (h(Host, { key: 'ff2ec54e4e3de84b80468820efa641a2922b93cf' }, h("div", { key: '44b43c08d7dcdb90d3db8ee837fe902e804b8255', class: "header" }, h("div", { key: '34649267bbeeab302a646017714da9f00aa3503a', onClick: () => this.monthYearPicker = !this.monthYearPicker }, h("span", { key: 'f83d4b65cc03662bdd7555113a0d367f263e30f6' }, format(this.currentDate, 'MMMM yyyy')), h("je-button", { key: 'c12c79e67bb19ce76b37ff122a9aba76c33d8627', fill: 'clear', iconOnly: true }, h("je-icon", { key: '7fd6737727798a895899015a30c295913c9c9077', class: { open: this.monthYearPicker }, icon: 'expand_more' }))), h("je-button", { key: '17d319c0c3120906ce733bee52eaf31e3ecfce77', iconOnly: true, fill: 'clear', onClick: this.prevMonth }, h("je-icon", { key: 'c6c86b0c4f0360a335903a0298e39f1db9658d51', fill: true, icon: 'arrow_left' })), h("je-button", { key: '21a79c20202fd0acd26589deab5746bfdda32a3c', iconOnly: true, fill: 'clear', onClick: this.nextMonth }, h("je-icon", { key: '508587d9cd3642520f6b58d197df066da15c10ab', icon: 'arrow_right', fill: true }))), h("div", { key: 'c40de53a4277adebef8c7077af02ab4e80491aea', class: "weekdays-grid" }, daysOfWeek.map(day => h("div", null, day))), h("div", { key: '90a3fea593cd4772cfa4006180532a79264e3502', class: "days-grid" }, daysBefore.map(day => (h("je-button", { expand: true, disabled: true, color: 'medium', fill: 'clear', class: 'day' }, format(day, 'd')))), daysInMonth.map(day => {
3503
+ const selected = this.value && isSameDay(day, this.value);
3504
+ const today = isToday(day);
3505
+ return (h("je-button", { expand: true, color: selected || today ? 'primary' : this.isDark ? 'light' : 'dark', fill: selected ? 'solid' : 'clear', class: 'day', onClick: () => this.value = day }, format(day, 'd')));
3506
+ }), daysAfter.map(day => (h("je-button", { expand: true, disabled: true, color: 'medium', fill: 'clear', class: 'day' }, format(day, 'd')))))));
3507
+ }
3508
+ get el() { return getElement(this); }
3509
+ static get watchers() { return {
3510
+ "value": ["valueChangeHandler"]
3511
+ }; }
3512
+ };
3513
+ JeDatepicker.style = JeDatepickerStyle0;
3514
+
3515
+ const jeDetailsCss = ":host{display:block}[part=summary-container]{display:flex;justify-content:space-between;cursor:pointer;user-select:none;-webkit-user-select:none;align-items:center}[part=details-icon]{height:24px;width:24px;transition:transform 250ms ease-in-out}[part=details-container]{box-sizing:border-box;display:grid;grid-template-rows:0fr;padding-top:0;opacity:0;transition:all 250ms ease-out}:host([state=open]) [part=details-container]{grid-template-rows:1fr;opacity:1;padding-top:var(--je-spacing)}:host([state=closed]) [part=details-icon]{height:24px;width:24px;transform:rotate(-180deg)}";
3516
+ const JeDetailsStyle0 = jeDetailsCss;
3517
+
3518
+ const JeDetails = class {
3519
+ constructor(hostRef) {
3520
+ registerInstance(this, hostRef);
3521
+ this.summary = undefined;
3522
+ this.state = 'closed';
3523
+ }
3524
+ render() {
3525
+ return (h("je-card", { key: 'f06bead6338803d66a638688e5999b5061bb8d89' }, h("div", { key: '05900c217e26e721c4f266525b79b87664fc3a43', part: 'summary-container', onClick: () => this.state = this.state == 'open' ? 'closed' : 'open' }, h("slot", { key: 'e641bb5f360cb268043e3e2dbfc0b5b147c5a8da', name: "summary" }, this.summary && h("summary", { key: '2cca006be4897431aeb8c13287d1db25d05e1295' }, this.summary)), h("div", { key: 'd77902ab93d12d79ca6dd705788a6be11badd209', part: 'details-icon' }, h("svg", { key: 'b2bcfdbc26f1b76fb21475a4cbe58b1a877a6883', xmlns: "XXXXXXXXXXXXXXXXXXXXXXXXXX", viewBox: "0 0 24 24" }, h("path", { key: '8d691bf302c104054d03a96f9a6493e4c7051083', d: "M0 0h24v24H0z", fill: "none" }), h("path", { key: 'de42815153c122e0a054c77ee9c752987da92cba', d: "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" })))), h("div", { key: '5bfe7b312601083e8855c9f23ee5a209f9468bba', part: 'details-container' }, h("div", { key: '1e6f0a4f17e44d59d8655e576b73ecc2c6c67d33', style: { overflow: 'hidden' } }, h("slot", { key: 'f4802e440f736f76f146a81149d1526b393c305f' })))));
3526
+ }
3527
+ get el() { return getElement(this); }
3528
+ };
3529
+ JeDetails.style = JeDetailsStyle0;
3530
+
3531
+ const jeDividerCss = ":host{--thickness:1px;--color:var(--je-medium-500);--spacing:var(--je-spacing-sm);background-color:var(--color)}:host([spacing=sm]){--spacing:var(--je-spacing-2xs)}:host([spacing=lg]){--spacing:var(--je-spacing-lg)}:host([spacing=none]){--spacing:0}:host([type=horizontal]){display:block;width:100%;height:var(--thickness);margin-block:var(--spacing)}:host([type=vertical]){display:inline-block;align-self:normal;width:var(--thickness);margin-inline:var(--spacing)}";
3532
+ const JeDividerStyle0 = jeDividerCss;
3533
+
3534
+ const JeDivider = class {
3535
+ constructor(hostRef) {
3536
+ registerInstance(this, hostRef);
3537
+ this.type = 'horizontal';
3538
+ this.spacing = 'md';
3539
+ }
3540
+ render() {
3541
+ return h(Host, { key: 'f8db6d54b81c4d874f0e837202ea79c8bad6d328' });
3542
+ }
3543
+ };
3544
+ JeDivider.style = JeDividerStyle0;
3545
+
3546
+ const jeDrawerCss = ":host{display:block;--je-drawer-width:500px;--je-drawer-shadow:0 4px 8px rgba(0, 0, 0, 0.1);--je-drawer-padding:var(--je-spacing-lg, 20px)}.backdrop{display:block;position:fixed;transition:all 250ms ease-in-out;cursor:pointer;background:var(--je-backdrop-color);top:0;left:0;height:100%;width:100%;z-index:-1}div[part=container]{display:block;position:fixed;left:0;top:0;height:100%;box-sizing:border-box;background-color:canvas;color:canvastext;overflow-y:auto;overflow-x:hidden;width:var(--je-drawer-width);transition:all 250ms ease-in-out;z-index:900;padding:var(--je-drawer-padding)}:host([state=closed]) .backdrop{opacity:0}:host([state=closed]) div[part=container]{margin-left:calc(var(--je-drawer-width) * -1)}:host([state=open]) .backdrop{opacity:1;z-index:899}:host([state=open]) div[part=container]{box-shadow:var(--je-drawer-shadow)}";
3547
+ const JeDrawerStyle0 = jeDrawerCss;
3548
+
3549
+ const JeDrawer = class {
3550
+ constructor(hostRef) {
3551
+ registerInstance(this, hostRef);
3552
+ this.state = 'closed';
3553
+ }
3554
+ componentDidLoad() {
3555
+ this.pageEl = this.el.closest('je-page');
3556
+ this.parentEl = this.el.parentElement;
3557
+ }
3558
+ async stateChangeHandler(newValue) {
3559
+ if (newValue == 'open') {
3560
+ this.el.remove();
3561
+ this.pageEl.append(this.el);
3562
+ }
3563
+ else {
3564
+ this.el.remove();
3565
+ this.parentEl.append(this.el);
3566
+ }
3567
+ }
3568
+ render() {
3569
+ return (h(Host, { key: 'af9feae455f378cb203bbb62eda5cc05d62dce70', slot: 'overlay' }, h("div", { key: '7ae88770955b96ff62bf63c035ea4c84a47e238e', part: 'container' }, h("slot", { key: 'd419fa2f162aab9ad14d25568363b0184dcc3031' })), h("div", { key: '389e815994b313640cd2efb85e6788219624cd77', onClick: () => this.state = 'closed', class: 'backdrop' })));
3570
+ }
3571
+ get el() { return getElement(this); }
3572
+ static get watchers() { return {
3573
+ "state": ["stateChangeHandler"]
3574
+ }; }
3575
+ };
3576
+ JeDrawer.style = JeDrawerStyle0;
3577
+
3578
+ const jeDropzoneCss = ":host{display:flex;align-items:center;justify-content:center;height:200px;width:300px;border:1px dashed var(--je-text-color);border-radius:var(--je-border-radius);color:var(--je-text-color);background-color:var(--je-background-color);transition:border-color 250ms, background-color 250ms}:host(.hover){border-color:var(--je-primary-500);background-color:var(--je-medium-100)}:host([darkmode].hover){background-color:var(--je-medium-850)}";
3579
+ const JeDropzoneStyle0 = jeDropzoneCss;
3580
+
3581
+ const JeDropzone = class {
3582
+ constructor(hostRef) {
3583
+ registerInstance(this, hostRef);
3584
+ this.dataDrop = createEvent(this, "dataDrop", 7);
3585
+ }
3586
+ handleThemeChange(e) {
3587
+ this.el.toggleAttribute('darkmode', e.detail == 'dark');
3588
+ }
3589
+ onDrop(e) {
3590
+ e.preventDefault();
3591
+ this.el.classList.remove('hover');
3592
+ this.dataDrop.emit(e.dataTransfer);
3593
+ }
3594
+ onDragOver(e) {
3595
+ e.preventDefault();
3596
+ this.el.classList.add('hover');
3597
+ }
3598
+ onDragLeave(e) {
3599
+ e.preventDefault();
3600
+ this.el.classList.remove('hover');
3601
+ }
3602
+ render() {
3603
+ return (h(Host, { key: '429fde45a6ef766fdb8d3212a92759ac3206aae1' }, h("div", { key: 'ea9a99fac7c311e0368de0af20141c6302f882c3', part: "content-container" }, h("slot", { key: '9132da72c448411aa8d4aa60a30d93d7dfd161fa' }))));
3604
+ }
3605
+ get el() { return getElement(this); }
3606
+ };
3607
+ JeDropzone.style = JeDropzoneStyle0;
3608
+
3609
+ const jeFormCss = ".sc-je-form-h{display:block}.sc-je-form-h:not([gap=none]) form.sc-je-form{gap:var(--je-spacing, 16px)}form.sc-je-form{display:flex;flex-direction:column}";
3610
+ const JeFormStyle0 = jeFormCss;
3611
+
3612
+ const JeForm = class {
3613
+ constructor(hostRef) {
3614
+ registerInstance(this, hostRef);
3615
+ this.formData = createEvent(this, "formData", 7);
3616
+ this.gap = 'default';
3617
+ }
3618
+ async handleSubmit(event) {
3619
+ event.preventDefault();
3620
+ const formData = new FormData(this.el);
3621
+ this.formData.emit(formData);
3622
+ }
3623
+ handleKeyup(event) {
3624
+ if (event.key === 'Enter') {
3625
+ const submitButton = this.el.querySelector('button[type=submit]');
3626
+ if (submitButton) {
3627
+ submitButton.click();
3628
+ }
3629
+ }
3630
+ }
3631
+ render() {
3632
+ return (h("form", { key: 'a1bdda6c842835ef6db2f81f09ac709606b77808', ref: el => this.el = el }, h("slot", { key: 'c191310d0efffc71bf16d17a33d92881bd653a9e' })));
3633
+ }
3634
+ };
3635
+ JeForm.style = JeFormStyle0;
3636
+
3637
+ const jeIconCss = ":host{--je-fill:0;--je-weight:400;--je-grade:0;--je-optical:24;display:block;cursor:default;font-family:\"Material Symbols Rounded\";font-weight:normal;font-style:normal;font-size:24px;line-height:unset;letter-spacing:normal;text-transform:none;user-select:none;-webkit-user-select:none;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;font-variation-settings:\"FILL\" var(--je-fill), \"wght\" var(--je-weight), \"GRAD\" var(--je-grade), \"opsz\" var(--je-optical)}:host([fill]){--je-fill:1}:host([size=sm]){--je-optical:20;font-size:20px}:host([size=md]){--je-optical:24;font-size:24px}:host([size=lg]){--je-optical:40;font-size:40px}:host([size=xl]){--je-optical:48;font-size:48px}:host([grade=low]){--je-grade:-25}:host([grade=high]){--je-grade:200}";
3638
+ const JeIconStyle0 = jeIconCss;
3639
+
3640
+ const JeIcon = class {
3641
+ constructor(hostRef) {
3642
+ registerInstance(this, hostRef);
3643
+ this.icon = undefined;
3644
+ this.size = 'md';
3645
+ this.fill = undefined;
3646
+ this.grade = undefined;
3647
+ this.weight = undefined;
3648
+ }
3649
+ componentDidLoad() {
3650
+ if (this.weight) {
3651
+ this.el.style.setProperty('--je-weight', this.weight.toString());
3652
+ }
3653
+ }
3654
+ render() {
3655
+ return (h(Host, { key: '97337aa9c29d8edcda89217af52c6263a286fd7b' }, this.icon));
3656
+ }
3657
+ get el() { return getElement(this); }
3658
+ };
3659
+ JeIcon.style = JeIconStyle0;
3660
+
3661
+ const animationUpdate = () => {
3662
+ return new Promise(resolve => requestAnimationFrame(() => resolve()));
3663
+ };
3664
+ const debounce = (func, wait = 0) => {
3665
+ let timer;
3666
+ return (...args) => {
3667
+ clearTimeout(timer);
3668
+ timer = setTimeout(func, wait, ...args);
3669
+ };
3670
+ };
3671
+ const debounceEvent = (event, wait) => {
3672
+ const original = event._original || event;
3673
+ return {
3674
+ _original: event,
3675
+ emit: debounce(original.emit.bind(original), wait),
3676
+ };
3677
+ };
3678
+
3679
+ const jeInputCss = ":host{display:block;width:fit-content;--je-height:42px;--je-border-color:transparent;--je-input-background:var(--je-medium-100);--je-input-color:var(--je-medium-900)}:host([darkmode]){--je-input-background:var(--je-medium-850);--je-input-color:var(--je-medium-50)}:host([expand]){width:100%}:host(:invalid) div[part=outer-container].touched{--je-border-color:var(--je-error-500, red)}div[part=outer-container]{display:flex;align-items:center;justify-content:center;gap:var(--je-spacing-2xs, 8px);height:var(--je-height);background-color:var(--je-input-background, field);color:var(--je-input-color, fieldtext);padding-inline:var(--je-spacing-xs, 10px);border-radius:var(--je-border-radius, 2px);overflow:hidden;border:solid 1px var(--je-border-color);transition:border 125ms ease-in-out}div[part=outer-container].focus{--je-border-color:var(--je-primary-500, accentcolor)}div[part=outer-container].disabled{opacity:0.6;cursor:default}div[part=start-container],div[part=end-container]{display:flex}label{font-weight:var(--je-font-semi-bold)}input{font-family:var(--je-font-family, inherit);font-size:var(--je-font-size, 1rem);background:transparent;color:inherit;flex:1;border:none;padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;width:inherit}input::placeholder{font-family:var(--je-font-family, inherit);font-size:var(--je-font-size, 1rem);color:var(--je-medium-600)}input:focus{outline:0}small.helper{display:block;margin-top:var(--je-spacing-2xs, 8px);padding-left:var(--je-spacing-xs, 10px);color:var(--je-medium-600)}input[type=password]::-ms-reveal,input[type=password]::-ms-clear{display:none !important}je-popover::part(content){width:var(--je-content-width, auto);box-sizing:border-box;padding:0px}";
3680
+ const JeInputStyle0 = jeInputCss;
3681
+
3682
+ const JeInput = class {
3683
+ constructor(hostRef) {
3684
+ registerInstance(this, hostRef);
3685
+ this.valueChange = createEvent(this, "valueChange", 3);
3686
+ if (hostRef.$hostElement$["s-ei"]) {
3687
+ this.internals = hostRef.$hostElement$["s-ei"];
3688
+ }
3689
+ else {
3690
+ this.internals = hostRef.$hostElement$.attachInternals();
3691
+ hostRef.$hostElement$["s-ei"] = this.internals;
3692
+ }
3693
+ this.dropdownActive = false;
3694
+ this.showPassword = false;
3695
+ this.errors = [];
3696
+ this.originalValue = '';
3697
+ this.togglePassword = () => {
3698
+ this.showPassword = !this.showPassword;
3699
+ this.type = this.type == 'text' ? 'password' : 'text';
3700
+ };
3701
+ this.formatInput = async (ev) => {
3702
+ const input = ev.target;
3703
+ if (input && this.format) {
3704
+ input.value = await this.format(input.value, this.value, ev);
3705
+ }
3706
+ };
3707
+ this.handleInput = (ev) => {
3708
+ const input = ev.target;
3709
+ if (input) {
3710
+ this.value = input.value;
3711
+ this.valueChange.emit(this.value);
3712
+ }
3713
+ };
3714
+ this.handleContainerClick = async () => {
3715
+ if (this.dropdown) {
3716
+ this.dropdownActive = true;
3717
+ this.hostEl.style.setProperty('--je-content-width', `${this.hostEl.clientWidth}px`);
3718
+ await this.popoverEl.present('element', this.hostEl);
3719
+ }
3720
+ };
3721
+ this.handleDismiss = () => {
3722
+ this.dropdownActive = false;
3723
+ this.containerEl.classList.remove('focus');
3724
+ };
3725
+ this.isTouched = false;
3726
+ this.label = '';
3727
+ this.disabled = false;
3728
+ this.autoCapitalize = 'off';
3729
+ this.autoComplete = 'off';
3730
+ this.autoCorrect = 'off';
3731
+ this.autoFocus = undefined;
3732
+ this.inputMode = undefined;
3733
+ this.min = undefined;
3734
+ this.max = undefined;
3735
+ this.minLength = undefined;
3736
+ this.maxLength = undefined;
3737
+ this.multiple = false;
3738
+ this.pattern = undefined;
3739
+ this.readOnly = false;
3740
+ this.required = false;
3741
+ this.spellcheck = false;
3742
+ this.step = undefined;
3743
+ this.type = 'text';
3744
+ this.value = '';
3745
+ this.placeholder = '';
3746
+ this.debounce = 0;
3747
+ this.format = undefined;
3748
+ this.validators = undefined;
3749
+ this.noTyping = false;
3750
+ this.helperText = undefined;
3751
+ this.dropdown = false;
3752
+ this.expand = undefined;
3753
+ this.dismissOnClick = undefined;
3754
+ }
3755
+ componentWillLoad() {
3756
+ if (this.label && !this.hostEl.getAttribute('name')) {
3757
+ this.hostEl.setAttribute('name', this.label.replace(' ', '-').toLowerCase());
3758
+ }
3759
+ }
3760
+ connectedCallback() {
3761
+ this.internals.setFormValue(this.value);
3762
+ }
3763
+ async componentDidLoad() {
3764
+ this.originalValue = this.value;
3765
+ const { valueChange, debounce } = this;
3766
+ if (debounce) {
3767
+ this.valueChange = debounceEvent(valueChange, debounce);
3768
+ }
3769
+ if (this.format) {
3770
+ this.value = await this.format(this.value);
3771
+ }
3772
+ else {
3773
+ this.validatorsChanged();
3774
+ }
3775
+ }
3776
+ async formResetCallback() {
3777
+ this.isTouched = false;
3778
+ if (this.value !== this.originalValue) {
3779
+ if (this.format) {
3780
+ this.value = await this.format(this.originalValue);
3781
+ }
3782
+ else {
3783
+ this.value = this.originalValue;
3784
+ }
3785
+ }
3786
+ }
3787
+ handleThemeChange(e) {
3788
+ this.hostEl.toggleAttribute('darkmode', e.detail == 'dark');
3789
+ }
3790
+ handleFocus() {
3791
+ this.containerEl.classList.add('focus');
3792
+ }
3793
+ handleBlur() {
3794
+ this.isTouched = true;
3795
+ if (!this.dropdownActive) {
3796
+ this.containerEl.classList.remove('focus');
3797
+ }
3798
+ }
3799
+ async validatorsChanged() {
3800
+ this.errors = [];
3801
+ if (this.validators) {
3802
+ for (const validator of this.validators) {
3803
+ const res = await validator(this.value);
3804
+ this.errors = [...this.errors, ...res];
3805
+ }
3806
+ }
3807
+ this.setValidity();
3808
+ }
3809
+ requiredChanged() {
3810
+ this.setValidity();
3811
+ }
3812
+ async valueChanged() {
3813
+ if (this.inputEl && this.inputEl.value !== this.value) {
3814
+ this.inputEl.value = this.value;
3815
+ }
3816
+ this.internals.setFormValue(this.value);
3817
+ this.validatorsChanged();
3818
+ }
3819
+ getInputElement() {
3820
+ return Promise.resolve(this.inputEl);
3821
+ }
3822
+ dismissDropdown(role = 'manualDismiss') {
3823
+ return this.popoverEl.dismiss(role);
3824
+ }
3825
+ markAsTouched() {
3826
+ return new Promise(resolve => {
3827
+ this.isTouched = true;
3828
+ resolve();
3829
+ });
3830
+ }
3831
+ hasError() {
3832
+ var _a;
3833
+ return Promise.resolve(this.errors.length > 0 || (this.required && (((_a = this.value) !== null && _a !== void 0 ? _a : '') === '')));
3834
+ }
3835
+ reset() {
3836
+ return this.formResetCallback();
3837
+ }
3838
+ setValidity() {
3839
+ var _a;
3840
+ const requiredError = this.required && (((_a = this.value) !== null && _a !== void 0 ? _a : '') === '');
3841
+ const hasError = this.errors.length > 0 || requiredError;
3842
+ if (hasError) {
3843
+ if (requiredError) {
3844
+ this.internals.setValidity({ valueMissing: true }, `${this.label || 'This field'} is required`, this.inputEl);
3845
+ }
3846
+ else {
3847
+ this.internals.setValidity({ customError: true }, this.errors[0], this.inputEl);
3848
+ }
3849
+ }
3850
+ else {
3851
+ this.internals.setValidity({});
3852
+ }
3853
+ }
3854
+ render() {
3855
+ var _a;
3856
+ const requiredIcon = h("je-icon", { key: 'b812ffd92e7fc689f2af87b10ee92c45e28a92bc', style: { fontSize: '10px', color: 'var(--je-error-500)' }, icon: "asterisk" });
3857
+ const label = h("label", { key: '05f40a7e7945974b35d005c4d06965e18c50702f', part: 'label', style: { display: 'flex' } }, this.label, " ", this.required && requiredIcon);
3858
+ const invalid = this.errors.length > 0 || (this.required && (((_a = this.value) !== null && _a !== void 0 ? _a : '') === ''));
3859
+ const containerClasses = {
3860
+ disabled: this.disabled,
3861
+ touched: this.isTouched
3862
+ };
3863
+ if (invalid && this.isTouched) {
3864
+ this.internals.reportValidity();
3865
+ }
3866
+ return (h(Host, { key: '0d7ad78c21a47bca8b35635269bf8f0c911ba0dd' }, h("div", { key: '5ea27cbabac48f622d72bd571655a5ec967acf4b', ref: el => this.containerEl = el, part: 'outer-container', onClick: this.handleContainerClick, class: containerClasses }, h("div", { key: 'd99e8aa93a05c65b7c7f4727027917e1e9056ee3', part: 'start-container' }, h("slot", { key: '2e59dda2daafcfcee06a463faf2684705eea0642', name: 'start' }), this.label && label), h("input", { key: '27a77375cecb8c9669619c964dfb0422d5650adf', part: "native-input", ref: el => this.inputEl = el, onInputCapture: this.formatInput, onInput: this.handleInput, disabled: this.disabled, autoCapitalize: this.autoCapitalize, autoComplete: this.autoComplete, autoCorrect: this.autoCorrect, autoFocus: this.autoFocus, inputMode: this.inputMode, min: this.min, max: this.max, minLength: this.minLength, maxLength: this.maxLength, multiple: this.multiple, pattern: this.pattern, readOnly: this.readOnly || this.noTyping, required: this.required, spellcheck: this.spellcheck, step: this.step, type: this.type, value: this.value, placeholder: this.placeholder }), h("div", { key: '3fcc3d84a01fc26fd11d7db45beee79ae5656af1', part: 'end-container' }, h("slot", { key: '2bf03124a793ec9ceb0cad951ac47693315acceb', name: 'end' }), !this.showPassword && this.type == 'password' && h("je-icon", { key: '3b4096d3cb432fd9614e90d43cf3367b365ce679', icon: "visibility", fill: true, onClick: this.togglePassword }), this.showPassword && this.type == 'text' && h("je-icon", { key: 'a4c1ec8f4e7ffdb64e906681389096b3da320485', icon: "visibility_off", fill: true, onClick: this.togglePassword }))), this.helperText && h("small", { key: '234252ad2c8c2b18b1c59d18c8bb451f97fcf269', class: "helper" }, this.helperText), this.dropdown && h("je-popover", { key: '132347f2bb1e31eb990e2f26381a5e2f111a4eaf', ref: el => this.popoverEl = el, exportparts: 'content', dismissOnClick: this.dismissOnClick, onDidDismiss: this.handleDismiss }, h("slot", { key: '03bf3efeddcfc701b680a5cb1fc473e80a44196e', name: 'dropdown' }))));
3867
+ }
3868
+ static get formAssociated() { return true; }
3869
+ get hostEl() { return getElement(this); }
3870
+ static get watchers() { return {
3871
+ "validators": ["validatorsChanged"],
3872
+ "required": ["requiredChanged"],
3873
+ "value": ["valueChanged"]
3874
+ }; }
3875
+ };
3876
+ JeInput.style = JeInputStyle0;
3877
+
3878
+ const jeLinkCss = ":host{display:inline-block}a{display:inline-block}.underline{text-decoration:underline}.bold{font-weight:var(--je-font-semi-bold)}";
3879
+ const JeLinkStyle0 = jeLinkCss;
3880
+
3881
+ const JeLink = class {
3882
+ constructor(hostRef) {
3883
+ registerInstance(this, hostRef);
3884
+ this.color = undefined;
3885
+ this.lightModeColor = undefined;
3886
+ this.darkModeColor = undefined;
3887
+ this.underline = true;
3888
+ this.bold = false;
3889
+ this.href = undefined;
3890
+ this.target = undefined;
3891
+ this.rel = undefined;
3892
+ this.download = undefined;
3893
+ }
3894
+ render() {
3895
+ return (h(Host, { key: 'e6ee6a71161ce3871e55b3cda15beab656c17910' }, h("a", { key: '98998f6dda359644563b531e4532e68882e273b6', href: this.href, target: this.target, rel: this.rel, download: this.download }, h("je-color", { key: '83600909f33b1dd9decf4d75c3abc2e3a8447e3a', class: { underline: this.underline, bold: this.bold }, color: this.color, "light-mode-color": this.lightModeColor, "dark-mode-color": this.darkModeColor }, h("slot", { key: '3caebb42da2d13dfc78b9237981d5c2c94cc96cb' })))));
3896
+ }
3897
+ };
3898
+ JeLink.style = JeLinkStyle0;
3899
+
3900
+ const jeLoadingCss = ":host{display:inline-block;position:relative;width:23px;height:23px;user-select:none}svg{position:absolute;top:0;left:0;width:100%;height:100%;transform:translateZ(0)}:host(.spinner-lines) line,:host(.spinner-lines-small) line{stroke-width:7px}:host(.spinner-lines-sharp) line,:host(.spinner-lines-sharp-small) line{stroke-width:4px}:host(.spinner-lines) line,:host(.spinner-lines-small) line,:host(.spinner-lines-sharp) line,:host(.spinner-lines-sharp-small) line{stroke-linecap:round;stroke:currentColor}:host(.spinner-lines) svg,:host(.spinner-lines-small) svg,:host(.spinner-lines-sharp) svg,:host(.spinner-lines-sharp-small) svg{animation:spinner-fade-out 1s linear infinite}@keyframes spinner-fade-out{0%{opacity:1}100%{opacity:0}}";
3901
+ const JeLoadingStyle0 = jeLoadingCss;
3902
+
3903
+ const spinners = {
3904
+ lines: {
3905
+ dur: 1000,
3906
+ lines: 8,
3907
+ fn: (dur, index, total) => {
3908
+ const transform = `rotate(${(360 / total) * index + (index < total / 2 ? 180 : -180)}deg)`;
3909
+ const animationDelay = `${(dur * index) / total - dur}ms`;
3910
+ return {
3911
+ y1: 14,
3912
+ y2: 26,
3913
+ style: {
3914
+ transform: transform,
3915
+ 'animation-delay': animationDelay,
3916
+ },
3917
+ };
3918
+ },
3919
+ },
3920
+ };
3921
+ const buildLine = (spinner, duration, index, total) => {
3922
+ const data = spinner.fn(duration, index, total);
3923
+ data.style['animation-duration'] = duration + 'ms';
3924
+ return (h("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, h("line", { transform: "translate(32,32)", y1: data.y1, y2: data.y2 })));
3925
+ };
3926
+ const JeLoading = class {
3927
+ constructor(hostRef) {
3928
+ registerInstance(this, hostRef);
3929
+ }
3930
+ render() {
3931
+ const spinner = spinners['lines'];
3932
+ const duration = spinner.dur;
3933
+ const svgs = [];
3934
+ for (let i = 0; i < spinner.lines; i++) {
3935
+ svgs.push(buildLine(spinner, duration, i, spinner.lines));
3936
+ }
3937
+ return (h(Host, { key: '7520159371b0c6ff774055d3f6eecf5af172d4df', class: { [`spinner-lines`]: true } }, svgs));
3938
+ }
3939
+ };
3940
+ JeLoading.style = JeLoadingStyle0;
3941
+
3942
+ const jeModalCss = ":host{display:flex}@media (width > 1200px){:host{--je-width:75%;--je-height:85%}}@media (992px < width < 1201px){:host{--je-width:80%;--je-height:90%}}@media (768px < width < 993px){:host{--je-width:85%;--je-height:95%}}@media (width < 769px){:host{--je-width:100%;--je-height:100%}}.modal{display:flex;flex-direction:column;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);z-index:910;width:var(--je-width);height:var(--je-height);background-color:var(--je-background-color, canvas);color:var(--je-text-color, canvastext);box-shadow:0px 0px 15px 5px rgba(60, 60, 60, 0.1647058824);border-radius:var(--je-border-radius, 2px);overflow:hidden}.modal-transition{opacity:0;transition:opacity 250ms ease-in-out}.modal.open{opacity:1}.backdrop{position:fixed;top:0;width:100%;height:100%;background:var(--je-backdrop-color, rgba(0, 0, 0, 0.5));z-index:909}.backdrop-transition{opacity:0;transition:opacity 250ms ease-in-out}.backdrop.fade{opacity:1}.clear{background:rgba(0, 0, 0, 0)}";
3943
+ const JeModalStyle0 = jeModalCss;
3944
+
3945
+ const JeModal = class {
3946
+ constructor(hostRef) {
3947
+ registerInstance(this, hostRef);
3948
+ this.didPresent = createEvent(this, "didPresent", 3);
3949
+ this.didDismiss = createEvent(this, "didDismiss", 3);
3950
+ this.handleBackdropClick = () => {
3951
+ if (this.isOpen && this.backdropClose) {
3952
+ this.dismiss('backdropClose');
3953
+ }
3954
+ };
3955
+ this.trigger = undefined;
3956
+ this.showBackdrop = true;
3957
+ this.backdropClose = true;
3958
+ this.isOpen = false;
3959
+ }
3960
+ componentDidLoad() {
3961
+ this.pageEl = this.el.closest('je-page');
3962
+ this.parentEl = this.el.parentElement;
3963
+ if (this.trigger) {
3964
+ this.triggerElement = document.getElementById(this.trigger);
3965
+ if (this.triggerElement) {
3966
+ this.triggerElement.addEventListener('click', () => this.present());
3967
+ }
3968
+ else {
3969
+ console.error('Failed to find modal trigger element!');
3970
+ }
3971
+ }
3972
+ }
3973
+ async present() {
3974
+ if (!this.isOpen) {
3975
+ this.el.remove();
3976
+ if (this.pageEl) {
3977
+ this.pageEl.append(this.el);
3978
+ }
3979
+ else {
3980
+ document.body.append(this.el);
3981
+ }
3982
+ this.isOpen = true;
3983
+ return new Promise(resolve => {
3984
+ this.contentEl.addEventListener('transitionend', () => {
3985
+ this.didPresent.emit();
3986
+ resolve();
3987
+ }, { once: true });
3988
+ this.backdropEl.classList.add('fade');
3989
+ this.contentEl.classList.add('open');
3990
+ });
3991
+ }
3992
+ }
3993
+ async dismiss(role = 'manualClose', data) {
3994
+ if (this.isOpen) {
3995
+ return new Promise(resolve => {
3996
+ this.contentEl.addEventListener('transitionend', () => {
3997
+ this.el.remove();
3998
+ this.parentEl.append(this.el);
3999
+ this.isOpen = false;
4000
+ this.didDismiss.emit({ role: role, data: data });
4001
+ resolve();
4002
+ }, { once: true });
4003
+ this.backdropEl.classList.remove('fade');
4004
+ this.contentEl.classList.remove('open');
4005
+ });
4006
+ }
4007
+ }
4008
+ render() {
4009
+ return (h(Host, { key: '14d2b7824b091c2f46ec8ea4c4aaaf4353b875e8', slot: "overlay" }, h("div", { key: 'c518ed82b72fa77ca7e8791fdc01e99124c751d8', ref: el => this.contentEl = el, class: { 'modal-transition': true, 'modal': this.isOpen } }, this.isOpen && h("slot", { key: '93abe76d598f72e64f1d3c438f98438333156aea' })), h("div", { key: '4564a790333dc48d29dbffb1d5ca957d92ad1af3', ref: el => this.backdropEl = el, onClick: this.handleBackdropClick, class: { 'backdrop-transition': true, 'backdrop': this.isOpen, 'clear': !this.showBackdrop && this.isOpen } })));
4010
+ }
4011
+ get el() { return getElement(this); }
4012
+ };
4013
+ JeModal.style = JeModalStyle0;
4014
+
4015
+ const jeMultiselectCss = ":host{display:block;width:207px;--je-height:42px;--je-border-color:transparent;--je-input-background:var(--je-medium-100);--je-input-color:var(--je-medium-900)}:host([darkmode]){--je-input-background:var(--je-medium-850);--je-input-color:var(--je-medium-50)}:host([expand]){width:100%}:host(:invalid) div[part=outer-container].touched{--je-border-color:var(--je-error-500, red)}div[part=outer-container]{display:flex;align-items:center;justify-content:space-between;gap:var(--je-spacing-2xs, 8px);height:var(--je-height);background-color:var(--je-input-background, field);color:var(--je-input-color, fieldtext);padding-inline:var(--je-spacing-xs, 10px);border-radius:var(--je-border-radius, 2px);overflow:hidden;border:solid 1px var(--je-border-color);transition:border 125ms ease-in-out}div[part=outer-container].focus{--je-border-color:var(--je-primary-500, accentcolor)}div[part=outer-container].disabled{opacity:0.6;cursor:default}div[part=start-container],div[part=end-container]{display:flex}div[part=main-container]{display:inline-block;overflow:hidden;color:var(--je-medium-600);text-wrap:nowrap;text-overflow:ellipsis;margin-right:auto}label{font-weight:var(--je-font-semi-bold)}je-popover::part(content){width:var(--je-content-width, auto);box-sizing:border-box;padding:0px}je-icon{transition:transform 250ms ease}je-icon.open{transform:rotate(180deg)}je-pill{margin-right:var(--je-spacing-3xs)}";
4016
+ const JeMultiselectStyle0 = jeMultiselectCss;
4017
+
4018
+ const JeMultiselect = class {
4019
+ constructor(hostRef) {
4020
+ registerInstance(this, hostRef);
4021
+ if (hostRef.$hostElement$["s-ei"]) {
4022
+ this.internals = hostRef.$hostElement$["s-ei"];
4023
+ }
4024
+ else {
4025
+ this.internals = hostRef.$hostElement$.attachInternals();
4026
+ hostRef.$hostElement$["s-ei"] = this.internals;
4027
+ }
4028
+ this.originalValue = [];
4029
+ this.handleContainerClick = async () => {
4030
+ this.el.style.setProperty('--je-content-width', `${this.el.clientWidth}px`);
4031
+ await this.popoverEl.present('element', this.el);
4032
+ };
4033
+ this.isTouched = false;
4034
+ this.open = false;
4035
+ this.label = undefined;
4036
+ this.placeholder = undefined;
4037
+ this.value = [];
4038
+ this.expand = undefined;
4039
+ this.required = undefined;
4040
+ }
4041
+ componentDidLoad() {
4042
+ this.originalValue = this.value;
4043
+ }
4044
+ componentWillLoad() {
4045
+ if (!this.el.getAttribute('name') && this.label) {
4046
+ this.el.setAttribute('name', this.label);
4047
+ }
4048
+ if (!Array.isArray(this.value)) {
4049
+ this.value = [this.value];
4050
+ }
4051
+ }
4052
+ formResetCallback() {
4053
+ this.value = this.originalValue;
4054
+ }
4055
+ handlePopoverPresent() {
4056
+ this.open = true;
4057
+ }
4058
+ handlePopoverDismiss() {
4059
+ this.open = false;
4060
+ this.el.style.removeProperty('--je-content-width');
4061
+ this.containerEl.classList.remove('focus');
4062
+ }
4063
+ handleThemeChange(e) {
4064
+ this.el.toggleAttribute('darkmode', e.detail == 'dark');
4065
+ }
4066
+ handleOptionChecked(event) {
4067
+ this.value = [...this.value, event.detail];
4068
+ }
4069
+ handleOptionUnchecked(event) {
4070
+ this.value = this.value.filter(t => t !== event.detail);
4071
+ }
4072
+ handleFocus() {
4073
+ this.containerEl.classList.add('focus');
4074
+ }
4075
+ handleBlur() {
4076
+ this.isTouched = true;
4077
+ if (!this.open) {
4078
+ this.containerEl.classList.remove('focus');
4079
+ }
4080
+ }
4081
+ handleValueChange() {
4082
+ const options = this.el.querySelectorAll('je-multiselect-option');
4083
+ options.forEach(option => {
4084
+ if (this.value.includes(option.value)) {
4085
+ option.checked = true;
4086
+ }
4087
+ else {
4088
+ option.checked = false;
4089
+ }
4090
+ });
4091
+ }
4092
+ render() {
4093
+ var _a;
4094
+ const options = Array.from(this.el.querySelectorAll('je-multiselect-option'));
4095
+ const requiredIcon = h("je-icon", { key: '980ad087f2037c624c834a999d68d5af7571c879', style: { fontSize: '10px', color: 'var(--je-error-500)' }, icon: "asterisk" });
4096
+ const label = h("label", { key: '0a570d461dfb85f605bcede7482551da079bb610', part: 'label', style: { display: 'flex' } }, this.label, " ", this.required && requiredIcon);
4097
+ const invalid = this.required && (((_a = this.value) !== null && _a !== void 0 ? _a : '') === '');
4098
+ const containerClasses = {
4099
+ //disabled: this.disabled,
4100
+ touched: this.isTouched
4101
+ };
4102
+ if (invalid && this.isTouched) {
4103
+ this.internals.reportValidity();
4104
+ }
4105
+ return (h(Host, { key: '31dc686422fd5bb829fdd3034ac1e2556dcb8624' }, h("div", { key: 'a208b2ebdede78095e9d5604d341e19310413b60', ref: el => this.containerEl = el, part: 'outer-container', onClick: this.handleContainerClick, class: containerClasses }, h("div", { key: '42683af62e175c43f4567348d65cada1138c1c59', part: 'start-container' }, h("slot", { key: '4cc5817c81442a06f148f03c59f70cd48c6b0206', name: 'start' }), this.label && label), h("div", { key: '56c08d003cc38e89164b94b87f32547a7812ee17', part: 'main-container' }, this.value.length > 0 && options.filter(t => this.value.includes(t.value)).map(t => h("je-pill", null, t.textContent)), (this.value.length < 1 && this.placeholder) && this.placeholder), h("div", { key: '495f68c15d7217e7b78bca9eee114b36fc08d328', part: 'end-container' }, h("slot", { key: '6838d86652f01b56a5409d9dee2b611318cb876e', name: 'end' }), h("je-icon", { key: '561c44792301b1adf11755737af1f56b3b3239b9', icon: 'expand_more', class: { open: this.open } }))), h("je-popover", { key: 'e0bf1b02ad6156a2212b3c81842cb08e86233ca8', ref: el => this.popoverEl = el, exportparts: 'content' }, h("slot", { key: '2314719361ba1f5908ce59d0526bef7efbb30d06' }))));
4106
+ }
4107
+ static get formAssociated() { return true; }
4108
+ get el() { return getElement(this); }
4109
+ static get watchers() { return {
4110
+ "value": ["handleValueChange"]
4111
+ }; }
4112
+ };
4113
+ JeMultiselect.style = JeMultiselectStyle0;
4114
+
4115
+ const jeMultiselectOptionCss = ":host{display:block;width:100%;--je-option-hover-color:var(--je-primary-100)}:host([darkmode]){--je-option-hover-color:var(--je-medium-850)}:host(:hover) span[part=container]{background-color:var(--je-option-hover-color)}span[part=container]{display:flex;align-items:center;gap:var(--je-spacing-2xs);user-select:none;-webkit-user-select:none;cursor:pointer;width:100%;padding:var(--je-spacing-xs, 10px);background-color:transparent;color:inherit;transition:background-color 75ms ease-in}je-icon{cursor:pointer}";
4116
+ const JeMultiselectOptionStyle0 = jeMultiselectOptionCss;
4117
+
4118
+ const JeMultiselectOption = class {
4119
+ constructor(hostRef) {
4120
+ registerInstance(this, hostRef);
4121
+ this.optionChecked = createEvent(this, "optionChecked", 7);
4122
+ this.optionUnchecked = createEvent(this, "optionUnchecked", 7);
4123
+ this.value = undefined;
4124
+ this.checked = false;
4125
+ }
4126
+ handleClick() {
4127
+ if (this.checked) {
4128
+ this.optionUnchecked.emit(this.value);
4129
+ }
4130
+ else {
4131
+ this.optionChecked.emit(this.value);
4132
+ }
4133
+ }
4134
+ handleThemeChange(e) {
4135
+ this.hostEl.toggleAttribute('darkmode', e.detail == 'dark');
4136
+ }
4137
+ render() {
4138
+ return (h("span", { key: '0e863f622655ec29084296aa28ad67b607c7e004', part: 'container' }, h("je-icon", { key: '34d5756b234d995a4797b26098e483e8a1d7e413', icon: this.checked ? 'check_box' : 'check_box_outline_blank' }), h("slot", { key: '0d543f3703dfcc2bb6355845ff91195a38f67fe0' })));
4139
+ }
4140
+ get hostEl() { return getElement(this); }
4141
+ };
4142
+ JeMultiselectOption.style = JeMultiselectOptionStyle0;
4143
+
4144
+ const jePageCss = ":host{display:block;height:100%;overflow:hidden;font-size:var(--je-font-size);font-family:var(--je-font-family);color:var(--je-text-color);background-color:var(--je-background-color);color-scheme:light;--je-font-size:13px;--je-font-family:system-ui, Roboto, \"Open Sans\", \"Helvetica Neue\", sans-serif;--je-font-light:400;--je-font-regular:500;--je-font-semi-bold:600;--je-font-bold:700;--je-border-radius:2px;--je-text-color:var(--je-medium-900);--je-background-color:var(--je-medium-50);--je-backdrop-color:rgba(0, 0, 0, 0.5);--je-spacing-3xs:4px;--je-spacing-2xs:8px;--je-spacing-xs:10px;--je-spacing-sm:12px;--je-spacing:16px;--je-spacing-lg:20px;--je-spacing-xl:24px;--je-spacing-2xl:32px;--je-spacing-3xl:40px;--je-primary-100:#e0e7ff;--je-primary-200:#c7d2fe;--je-primary-300:#a5b4fc;--je-primary-400:#818cf8;--je-primary-500:#6366f1;--je-primary-600:#4f46e5;--je-primary-700:#4338ca;--je-primary-800:#3730a3;--je-secondary-100:#e0f7ff;--je-secondary-200:#b3e9ff;--je-secondary-300:#80dbff;--je-secondary-400:#4dcfff;--je-secondary-500:#1ac3ff;--je-secondary-600:#00b0e6;--je-secondary-700:#0095bf;--je-secondary-800:#007a99;--je-tertiary-100:#ffe0f7;--je-tertiary-200:#ffb3e9;--je-tertiary-300:#ff80db;--je-tertiary-400:#ff4dce;--je-tertiary-500:#ff1ac0;--je-tertiary-600:#e600a9;--je-tertiary-700:#bf0090;--je-tertiary-800:#990078;--je-success-100:#e6f9e6;--je-success-200:#b3f0b3;--je-success-300:#80e680;--je-success-400:#4ddb4d;--je-success-500:#22c55e;--je-success-600:#16a34a;--je-success-700:#15803d;--je-success-800:#166534;--je-error-100:#ffe5e5;--je-error-200:#fdb8b8;--je-error-300:#f87171;--je-error-400:#f87171;--je-error-500:#ef4444;--je-error-600:#dc2626;--je-error-700:#b91c1c;--je-error-800:#8b0000;--je-warning-100:#fffbeb;--je-warning-200:#fef3c7;--je-warning-300:#fde68a;--je-warning-400:#fcd34d;--je-warning-500:#fbbf24;--je-warning-600:#f59e0b;--je-warning-700:#d97706;--je-warning-800:#b45309;--je-medium-50:#f7fafc;--je-medium-100:#edf2f7;--je-medium-200:#e8eef4;--je-medium-300:#e2e8f0;--je-medium-400:#cbd5e0;--je-medium-500:#a0aec0;--je-medium-600:#718096;--je-medium-700:#5f6b82;--je-medium-800:#4a5568;--je-medium-850:#2d3748;--je-medium-900:#17191d;--je-left-sidepanel-open-width:500px;--je-left-sidepanel-minimized-width:100px;--je-left-sidepanel-border:solid 1px var(--je-text-color);--je-right-sidepanel-open-width:500px;--je-right-sidepanel-minimized-width:100px;--je-right-sidepanel-border:solid 1px var(--je-text-color)}:host([theme=dark]){color-scheme:dark;--je-text-color:var(--je-medium-50);--je-background-color:var(--je-medium-900)}:host([theme=auto]){color-scheme:light dark}@media (prefers-color-scheme: dark){:host([theme=auto]){--je-text-color:var(--je-medium-50);--je-background-color:var(--je-medium-900)}}[part=page-container]{display:flex;flex-direction:column;height:100%;box-sizing:border-box;overflow:hidden}[part=body-container]{display:flex;flex:1;overflow:hidden}::slotted([slot=body]){flex:1;box-sizing:border-box;overflow-y:auto;overflow-x:hidden}::slotted([slot=header]){box-sizing:border-box;z-index:10;box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12)}::slotted([slot=footer]){box-sizing:border-box;box-shadow:rgba(0, 0, 0, 0.4117647059) 0px -5px 20px -10px;z-index:10}@supports (-webkit-touch-callout: none){::slotted([slot=header]){padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}::slotted([slot=footer]){padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}.body-container{padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);margin-left:env(safe-area-inset-left);margin-right:env(safe-area-inset-right)}}:host([left-panel=open]) ::slotted([slot=left-panel]){width:var(--je-left-sidepanel-open-width);border-right:var(--je-left-sidepanel-border)}:host([left-panel=minimized]) ::slotted([slot=left-panel]){width:var(--je-left-sidepanel-minimized-width);border-right:var(--je-left-sidepanel-border)}:host([right-panel=open]) ::slotted([slot=right-panel]){width:var(--je-right-sidepanel-open-width);border-left:var(--je-right-sidepanel-border)}:host([right-panel=minimized]) ::slotted([slot=right-panel]){width:var(--je-right-sidepanel-minimized-width);border-left:var(--je-right-sidepanel-border)}:host([left-panel=closed]) ::slotted([slot=left-panel]){padding:0 !important}:host([right-panel=closed]) ::slotted([slot=right-panel]){padding:0 !important}::slotted([slot=left-panel]),::slotted([slot=right-panel]){display:block;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;width:0px;border-right:none;border-left:none;transition:all 250ms ease-in-out;margin:0 !important}";
4145
+ const JePageStyle0 = jePageCss;
4146
+
4147
+ const JePage = class {
4148
+ constructor(hostRef) {
4149
+ registerInstance(this, hostRef);
4150
+ this.themeChange = createEvent(this, "themeChange", 7);
4151
+ this.leftPanel = 'closed';
4152
+ this.rightPanel = 'closed';
4153
+ this.theme = 'light';
4154
+ }
4155
+ componentDidLoad() {
4156
+ this.themeChangeHandler(this.theme);
4157
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => this.themeChangeHandler(this.theme));
4158
+ }
4159
+ themeChangeHandler(newValue) {
4160
+ if (newValue !== 'auto')
4161
+ this.themeChange.emit(newValue);
4162
+ else
4163
+ this.themeChange.emit(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
4164
+ }
4165
+ render() {
4166
+ return (h(Host, { key: 'fecb0aaf3870822893abbb410e37c9be72c67c39' }, h("div", { key: 'df76c6c8484ca41040b6fe0e2732739c7f3aba4d', part: 'page-container' }, h("slot", { key: 'c28f037b525481dc9c87ac3f7f4115af13532f9e', name: 'header' }), h("div", { key: '2845052c8cbb636d67f7f8be9afef48fdff2b5de', part: 'body-container' }, h("slot", { key: '1b863e147e1c411b292675cda5d0ff240048b371', name: 'left-panel' }), h("slot", { key: '7da5ce54ad0fc813826f347412e58f78e80f6d08', name: 'body' }), h("slot", { key: 'da128e14c58634365d940a9f630404fdea1d0458', name: 'right-panel' })), h("slot", { key: '2d0b1b03ede81177670cfaa0ad6b0a86b508f1f3', name: 'footer' })), h("div", { key: '742fe0a1282c0f4b37c139ee5be0529d4078bff1', part: 'overlay-container' }, h("slot", { key: 'df3aeb289c5a28c1d7c7fa838747e7c4a8077c53', name: 'overlay' }))));
4167
+ }
4168
+ get el() { return getElement(this); }
4169
+ static get watchers() { return {
4170
+ "theme": ["themeChangeHandler"]
4171
+ }; }
4172
+ };
4173
+ JePage.style = JePageStyle0;
4174
+
4175
+ const jePillCss = ":host{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;gap:var(--je-spacing-2xs);padding-inline:4px;border-radius:var(--je-border-radius, 2px);height:20px;min-width:40px;-webkit-user-select:none;user-select:none;transition:all 125ms ease-in-out;color:var(--je-pill-color);background-color:var(--je-pill-background);--je-pill-color:var(--je-primary-500, buttonface);--je-pill-background:var(--je-primary-100, buttontext);--je-pill-hover-background:var(--je-primary-200, buttontext)}:host(:not([button=false])){cursor:pointer}:host(:not([button=false])) ::slotted(je-icon){cursor:pointer}@media (hover: hover){:host(:not([button=false]):not([disabled]):hover){--je-pill-background:var(--je-pill-hover-background)}}:host([disabled]){opacity:0.8;cursor:default}:host([outline]){background-color:transparent;color:var(--je-pill-color);border:solid 1px var(--je-pill-background)}";
4176
+ const JePillStyle0 = jePillCss;
4177
+
4178
+ const JePill = class {
4179
+ constructor(hostRef) {
4180
+ registerInstance(this, hostRef);
4181
+ this.outline = false;
4182
+ this.button = true;
4183
+ this.disabled = false;
4184
+ }
4185
+ render() {
4186
+ return (h(Host, { key: '32a830f6eb0cb2602d6ccb0355afab3a4913f482' }, h("slot", { key: '9d3970fcbb79a849b79e6bb99cc525504b1a7aac' })));
4187
+ }
4188
+ };
4189
+ JePill.style = JePillStyle0;
4190
+
4191
+ const jePlaceholderCss = ":host{--je-background:#c7c7c7c5;--je-shimmer-color:#ffffff;border-radius:var(--je-border-radius, 2px);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--je-background);line-height:10px;user-select:none;pointer-events:none;opacity:0.7}:host(.animated){position:relative;background:linear-gradient(90deg, var(--je-background) 25%, var(--je-shimmer-color) 50%, var(--je-background) 75%);background-size:200% 100%;animation-duration:2.5s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}";
4192
+ const JePlaceholderStyle0 = jePlaceholderCss;
4193
+
4194
+ const JePlaceholder = class {
4195
+ constructor(hostRef) {
4196
+ registerInstance(this, hostRef);
4197
+ this.animated = true;
4198
+ }
4199
+ render() {
4200
+ return (h(Host, { key: '0a01cc9c0d7cadff4a449895c64c7761cf0b116d', class: { 'animated': this.animated } }, h("slot", { key: 'be3e6370db2d577bd64f053360cf893f9beec2f1' })));
4201
+ }
4202
+ };
4203
+ JePlaceholder.style = JePlaceholderStyle0;
4204
+
4205
+ const jePopoverCss = ":host{display:block;--je-popover-background-color:rgb(233, 236, 236);--je-popover-color:var(--je-medium-900);--je-popover-box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12);--je-popover-border:solid 1px rgb(197, 200, 204)}:host([darkmode]){--je-popover-background-color:rgb(41, 45, 46);--je-popover-color:var(--je-medium-50);--je-popover-box-shadow:0px 4px 16px 0px rgba(68, 68, 68, 0.12);--je-popover-border:solid 1px rgb(86, 87, 90)}.content{font-family:var(--je-font-family);position:absolute;background-color:var(--je-popover-background-color, canvas);color:var(--je-popover-color, canvastext);padding-inline:var(--je-spacing-xs, 10px);box-shadow:var(--je-popover-box-shadow);border:var(--je-popover-border);z-index:1000;border-radius:var(--je-border-radius, 2px);overflow:hidden}.content-transition{opacity:0;transition:opacity 250ms ease-in-out}.content.open{opacity:1}.backdrop{display:block;position:fixed;top:0;left:0;width:100%;height:100%;background:var(--je-backdrop-color, rgba(0, 0, 0, 0.5));z-index:999}.backdrop-transition{opacity:0;transition:opacity 250ms ease-in-out}.backdrop.fade{opacity:1}.clear{background:rgba(0, 0, 0, 0)}";
4206
+ const JePopoverStyle0 = jePopoverCss;
4207
+
4208
+ const JePopover = class {
4209
+ constructor(hostRef) {
4210
+ registerInstance(this, hostRef);
4211
+ this.didPresent = createEvent(this, "didPresent", 7);
4212
+ this.didDismiss = createEvent(this, "didDismiss", 7);
4213
+ this.handleContentClick = () => {
4214
+ if (this.isOpen && this.dismissOnClick) {
4215
+ this.dismiss('contentClickDismiss');
4216
+ }
4217
+ };
4218
+ this.handleBackdropClick = () => {
4219
+ if (this.isOpen && this.backdropDismiss) {
4220
+ this.dismiss('backdropDismiss');
4221
+ }
4222
+ };
4223
+ this.isOpen = false;
4224
+ this.trigger = undefined;
4225
+ this.showBackdrop = false;
4226
+ this.backdropDismiss = true;
4227
+ this.dismissOnClick = false;
4228
+ this.position = 'element';
4229
+ this.offsetX = 10;
4230
+ this.offsetY = 10;
4231
+ this.triggerAction = 'click';
4232
+ }
4233
+ componentDidLoad() {
4234
+ this.pagEl = this.el.closest('je-page');
4235
+ this.parentEl = this.el.parentElement;
4236
+ if (this.trigger) {
4237
+ this.triggerElement = document.getElementById(this.trigger);
4238
+ if (this.triggerElement && this.triggerAction == 'click') {
4239
+ this.triggerElement.addEventListener("click", () => this.present(this.position));
4240
+ }
4241
+ else if (this.triggerElement && this.triggerAction == 'hover') {
4242
+ this.triggerElement.addEventListener("mouseover", async (ev) => {
4243
+ await this.present(this.position, ev);
4244
+ this.triggerElement.addEventListener("mouseleave", () => this.dismiss('hoverDismiss'), { once: true });
4245
+ });
4246
+ }
4247
+ else if (this.triggerElement && this.triggerAction == 'context-menu') {
4248
+ this.triggerElement.addEventListener("contextmenu", ev => {
4249
+ ev.preventDefault();
4250
+ this.present(this.position, ev);
4251
+ });
4252
+ }
4253
+ else {
4254
+ console.error('Failed to find popover trigger element:', this.trigger);
4255
+ }
4256
+ }
4257
+ }
4258
+ handleThemeChange(e) {
4259
+ this.el.toggleAttribute('darkmode', e.detail == 'dark');
4260
+ }
4261
+ handleWindowClick(ev) {
4262
+ this.mouseEvent = ev;
4263
+ }
4264
+ /**
4265
+ * Used internally to present the popover. Can also be used to manually
4266
+ * present it if needed. Will auto position itself using the specified
4267
+ * position strategy. If no target is provided, it will use the last mouse
4268
+ * event on the window or the trigger element.
4269
+ * @param positionStrategy The strategy to use when positioning the popover
4270
+ * @param target Can optionally override the target the popover bases it's position off of
4271
+ */
4272
+ async present(positionStrategy, target) {
4273
+ var _a;
4274
+ if (!this.isOpen) {
4275
+ if (this.parentEl) {
4276
+ if (this.pagEl) {
4277
+ this.pagEl.append(this.el);
4278
+ }
4279
+ else {
4280
+ document.body.append(this.el);
4281
+ }
4282
+ }
4283
+ this.isOpen = true;
4284
+ if (positionStrategy !== 'none') {
4285
+ this.contentEl.removeAttribute('style');
4286
+ await animationUpdate();
4287
+ const { offsetX, offsetY } = this;
4288
+ const contentHeight = this.contentEl.clientHeight;
4289
+ const rightThreshold = window.innerWidth / 2;
4290
+ const bottomThreshold = window.innerHeight - 20 - contentHeight;
4291
+ if (positionStrategy == 'click') {
4292
+ target !== null && target !== void 0 ? target : (target = this.mouseEvent);
4293
+ const { pageX, pageY } = target;
4294
+ const isNearRight = pageX > rightThreshold;
4295
+ const isNearBottom = pageY > bottomThreshold;
4296
+ const isNearTop = pageY - offsetY - contentHeight < 0;
4297
+ if (isNearRight) {
4298
+ this.contentEl.style.left = `${pageX - offsetX - this.contentEl.clientWidth}px`;
4299
+ }
4300
+ else {
4301
+ this.contentEl.style.left = `${pageX + offsetX}px`;
4302
+ }
4303
+ if (isNearBottom && !isNearTop) {
4304
+ this.contentEl.style.top = `${pageY - offsetY - contentHeight}px`;
4305
+ }
4306
+ else if (isNearBottom && isNearTop) {
4307
+ this.contentEl.style.overflowY = 'auto';
4308
+ if (pageY > window.innerHeight - pageY) {
4309
+ this.contentEl.style.top = `${offsetY}px`;
4310
+ this.contentEl.style.maxHeight = `${pageY}px`;
4311
+ }
4312
+ else {
4313
+ this.contentEl.style.top = `${pageY + offsetY}px`;
4314
+ this.contentEl.style.maxHeight = `${window.innerHeight - 20 - pageY}px`;
4315
+ }
4316
+ }
4317
+ else {
4318
+ this.contentEl.style.top = `${pageY + offsetY}px`;
4319
+ }
4320
+ }
4321
+ else {
4322
+ target !== null && target !== void 0 ? target : (target = ((_a = this.triggerElement) !== null && _a !== void 0 ? _a : this.mouseEvent.target));
4323
+ const boundingRect = target.getBoundingClientRect();
4324
+ const { x: pageX, y: pageY } = boundingRect;
4325
+ const isNearRight = pageX > rightThreshold;
4326
+ const isNearBottom = pageY > bottomThreshold;
4327
+ const isNearTop = pageY - offsetY - contentHeight < 0;
4328
+ const triggerElement = target;
4329
+ const { left, bottom, top, right } = triggerElement.getBoundingClientRect();
4330
+ this.contentEl.style.boxSizing = 'border-box';
4331
+ if (isNearRight) {
4332
+ this.contentEl.style.left = `${right - this.contentEl.clientWidth}px`;
4333
+ }
4334
+ else {
4335
+ this.contentEl.style.left = `${left}px`;
4336
+ }
4337
+ if (isNearBottom && !isNearTop) {
4338
+ this.contentEl.style.top = `${top - offsetY - contentHeight}px`;
4339
+ }
4340
+ else if (isNearBottom && isNearTop) {
4341
+ this.contentEl.style.overflowY = 'auto';
4342
+ if (pageY > window.innerHeight - pageY) {
4343
+ this.contentEl.style.top = `${offsetY}px`;
4344
+ this.contentEl.style.maxHeight = `${top}px`;
4345
+ }
4346
+ else {
4347
+ this.contentEl.style.top = `${bottom + offsetY}px`;
4348
+ this.contentEl.style.maxHeight = `${window.innerHeight - 20 - bottom}px`;
4349
+ }
4350
+ }
4351
+ else {
4352
+ this.contentEl.style.top = `${bottom + offsetY}px`;
4353
+ }
4354
+ }
4355
+ }
4356
+ return new Promise(resolve => {
4357
+ this.contentEl.addEventListener('transitionend', () => {
4358
+ this.didPresent.emit();
4359
+ resolve();
4360
+ }, { once: true });
4361
+ if (this.triggerAction !== 'hover') {
4362
+ this.backdropEl.classList.add('fade');
4363
+ }
4364
+ this.contentEl.classList.add('open');
4365
+ });
4366
+ }
4367
+ }
4368
+ /** Manually dismisses the popover. Role and data get passed to the didDismiss event. */
4369
+ async dismiss(role = 'manualDismiss', data) {
4370
+ if (this.isOpen) {
4371
+ return new Promise(resolve => {
4372
+ this.contentEl.addEventListener('transitionend', () => {
4373
+ if (this.parentEl) {
4374
+ this.el.remove();
4375
+ this.parentEl.append(this.el);
4376
+ }
4377
+ this.isOpen = false;
4378
+ this.didDismiss.emit({ role: role, data: data });
4379
+ resolve();
4380
+ }, { once: true });
4381
+ if (this.triggerAction !== 'hover') {
4382
+ this.backdropEl.classList.remove('fade');
4383
+ }
4384
+ this.contentEl.classList.remove('open');
4385
+ });
4386
+ }
4387
+ }
4388
+ render() {
4389
+ return (h(Host, { key: '1de5a4aef076c6296b9c64b96028cc6f4998a40a', slot: "overlay" }, h("div", { key: '845a3c97b059371422707c785707aa499146f2dd', part: "content", ref: el => this.contentEl = el, onClick: this.handleContentClick, class: { 'content-transition': true, content: this.isOpen } }, this.isOpen && h("slot", { key: '436d0ed78d49a6471760da0057fcc75cfbd0dd44' })), this.triggerAction !== 'hover' &&
4390
+ h("div", { key: '1ec70ebb3246b78533e7250eda5d200212b795ad', ref: el => this.backdropEl = el, onClick: this.handleBackdropClick, class: {
4391
+ 'backdrop-transition': true,
4392
+ backdrop: this.isOpen,
4393
+ clear: !this.showBackdrop && this.isOpen
4394
+ } })));
4395
+ }
4396
+ get el() { return getElement(this); }
4397
+ };
4398
+ JePopover.style = JePopoverStyle0;
4399
+
4400
+ const jeRadioCss = ":host{display:flex;align-items:center;gap:var(--je-spacing-2xs, 8px);cursor:pointer;-webkit-user-select:none;user-select:none}je-icon{cursor:pointer;color:var(--je-primary-500)}";
4401
+ const JeRadioStyle0 = jeRadioCss;
4402
+
4403
+ const JeRadio = class {
4404
+ constructor(hostRef) {
4405
+ registerInstance(this, hostRef);
4406
+ this.radioSelect = createEvent(this, "radioSelect", 7);
4407
+ this.readonly = false;
4408
+ this.disabled = false;
4409
+ this.value = undefined;
4410
+ this.labelPlacement = 'end';
4411
+ this.selected = undefined;
4412
+ }
4413
+ connectedCallback() {
4414
+ const parent = this.el.closest('je-radio-group');
4415
+ if (parent) {
4416
+ this.disabled = parent.disabled;
4417
+ this.readonly = parent.readonly;
4418
+ }
4419
+ }
4420
+ handleClick() {
4421
+ if (!this.disabled && !this.readonly && this.selected !== true) {
4422
+ this.radioSelect.emit(this.value);
4423
+ }
4424
+ }
4425
+ render() {
4426
+ return (h(Host, { key: '1a0e6e3ae1a17ac4b29bb44a06de42e6a4a56f9b' }, this.labelPlacement == 'start' && h("slot", { key: 'ed2becb99697e46e485b02ed908a8e88100d58cb' }), h("je-icon", { key: 'c37d5f92ae5f59be880868cc865577bf6aab9b31', icon: this.selected ? 'radio_button_checked' : 'radio_button_unchecked' }), this.labelPlacement == 'end' && h("slot", { key: '3fdf2901786c28a575a8429d37ee79bf30cd9321' })));
4427
+ }
4428
+ get el() { return getElement(this); }
4429
+ };
4430
+ JeRadio.style = JeRadioStyle0;
4431
+
4432
+ const jeRadioGroupCss = ":host{display:block;width:fit-content}label{display:block;font-weight:var(--je-font-semi-bold);margin-bottom:var(--je-spacing-2xs)}";
4433
+ const JeRadioGroupStyle0 = jeRadioGroupCss;
4434
+
4435
+ const JeRadioGroup = class {
4436
+ constructor(hostRef) {
4437
+ registerInstance(this, hostRef);
4438
+ this.valueChange = createEvent(this, "valueChange", 3);
4439
+ this.label = undefined;
4440
+ this.value = undefined;
4441
+ this.readonly = false;
4442
+ this.disabled = false;
4443
+ }
4444
+ componentWillLoad() {
4445
+ if (this.label) {
4446
+ this.el.setAttribute('name', this.label);
4447
+ }
4448
+ }
4449
+ componentDidLoad() {
4450
+ this.originalValue = this.value;
4451
+ if (this.value) {
4452
+ const radios = this.getRadios();
4453
+ for (let item of radios) {
4454
+ if (item.value === this.value) {
4455
+ item.selected = true;
4456
+ }
4457
+ }
4458
+ }
4459
+ }
4460
+ formResetCallback() {
4461
+ if (this.value !== this.originalValue) {
4462
+ this.value = this.originalValue;
4463
+ }
4464
+ }
4465
+ getRadios() {
4466
+ const elements = this.el.querySelectorAll('je-radio');
4467
+ return Array.from(elements);
4468
+ }
4469
+ handleValueChange() {
4470
+ this.valueChange.emit(this.value);
4471
+ const radios = this.getRadios();
4472
+ for (let radio of radios) {
4473
+ if (radio.value !== this.value && radio.selected !== false)
4474
+ radio.selected = false;
4475
+ else if (radio.value === this.value && radio.selected !== true)
4476
+ radio.selected = true;
4477
+ }
4478
+ }
4479
+ handleNewValue(ev) {
4480
+ this.value = ev.detail;
4481
+ }
4482
+ render() {
4483
+ return (h(Host, { key: '70e9947ae0ea7b3747ef0470b0ce0e9491f43129' }, this.label && h("label", { key: 'db3fec8de716f25e8a8cf6dcbcd0d272417940f2' }, this.label), h("slot", { key: 'c2a03fa6a99928087f2815e51e47ab1eb61dcaa8' })));
4484
+ }
4485
+ static get formAssociated() { return true; }
4486
+ get el() { return getElement(this); }
4487
+ static get watchers() { return {
4488
+ "value": ["handleValueChange"]
4489
+ }; }
4490
+ };
4491
+ JeRadioGroup.style = JeRadioGroupStyle0;
4492
+
4493
+ const jeSelectCss = ":host{display:block;width:fit-content}je-input::part(native-input){cursor:pointer}:host([expand]){width:100%}je-icon{transition:transform 250ms ease}je-icon.open{transform:rotate(180deg)}";
4494
+ const JeSelectStyle0 = jeSelectCss;
4495
+
4496
+ const JeSelect = class {
4497
+ constructor(hostRef) {
4498
+ registerInstance(this, hostRef);
4499
+ this.open = false;
4500
+ this.label = undefined;
4501
+ this.placeholder = undefined;
4502
+ this.value = undefined;
4503
+ this.expand = undefined;
4504
+ this.required = undefined;
4505
+ }
4506
+ componentDidLoad() {
4507
+ this.originalValue = this.value;
4508
+ }
4509
+ componentWillLoad() {
4510
+ if (!this.el.getAttribute('name') && this.label) {
4511
+ this.el.setAttribute('name', this.label);
4512
+ }
4513
+ }
4514
+ formResetCallback() {
4515
+ this.value = this.originalValue;
4516
+ const options = Array.from(this.el.querySelectorAll('je-select-option'));
4517
+ if (!options.some(t => t.value === this.value)) {
4518
+ this.inputEl.value = '';
4519
+ }
4520
+ }
4521
+ handlePopoverPresent() {
4522
+ this.open = true;
4523
+ }
4524
+ handlePopoverDismiss() {
4525
+ this.open = false;
4526
+ const options = this.el.querySelectorAll('je-select-option');
4527
+ options.forEach(option => option.classList.remove('focus'));
4528
+ }
4529
+ handleOptionSelected(event) {
4530
+ this.value = event.detail;
4531
+ }
4532
+ handleValueChange() {
4533
+ const options = this.el.querySelectorAll('je-select-option');
4534
+ options.forEach(option => {
4535
+ if (option.value === this.value) {
4536
+ option.selected = true;
4537
+ this.inputEl.value = option.textContent || option.value;
4538
+ }
4539
+ else {
4540
+ option.selected = false;
4541
+ }
4542
+ });
4543
+ }
4544
+ focusOption(option) {
4545
+ option.classList.add('focus');
4546
+ }
4547
+ blurOption(option) {
4548
+ option.classList.remove('focus');
4549
+ }
4550
+ hasFocus(option) {
4551
+ return option.classList.contains('focus');
4552
+ }
4553
+ handleKeyDown(event) {
4554
+ var _a;
4555
+ if (this.open || (event.key !== 'Tab' && event.key !== 'Enter')) {
4556
+ event.preventDefault();
4557
+ event.stopPropagation();
4558
+ }
4559
+ const options = Array.from(this.el.querySelectorAll('je-select-option'));
4560
+ if (event.key == 'Enter' && this.open) {
4561
+ options.forEach(option => {
4562
+ if (this.hasFocus(option)) {
4563
+ this.value = option.value;
4564
+ }
4565
+ });
4566
+ this.inputEl.dismissDropdown();
4567
+ }
4568
+ else if (event.key == 'Escape') {
4569
+ this.inputEl.dismissDropdown();
4570
+ }
4571
+ else if ((event.key == 'ArrowDown' || event.key == 'ArrowUp') && !this.open) {
4572
+ this.inputEl.shadowRoot.querySelector("[part='outer-container']").click();
4573
+ }
4574
+ else if ((event.key == 'ArrowDown' || event.key == 'ArrowUp') && this.open) {
4575
+ if (!options.some(t => this.hasFocus(t))) {
4576
+ const indexToFocus = options.findIndex(t => t.selected);
4577
+ if (indexToFocus > -1) {
4578
+ this.focusOption(options[indexToFocus]);
4579
+ }
4580
+ else {
4581
+ this.focusOption(options[0]);
4582
+ }
4583
+ }
4584
+ else {
4585
+ if (event.key == 'ArrowUp') {
4586
+ options.forEach(option => {
4587
+ if (this.hasFocus(option)) {
4588
+ const prevOption = option.previousElementSibling;
4589
+ if (prevOption) {
4590
+ this.blurOption(option);
4591
+ this.focusOption(prevOption);
4592
+ }
4593
+ }
4594
+ });
4595
+ }
4596
+ else {
4597
+ const optionToFocus = (_a = options.find(t => this.hasFocus(t))) === null || _a === void 0 ? void 0 : _a.nextElementSibling;
4598
+ if (optionToFocus) {
4599
+ this.blurOption(options.find(t => this.hasFocus(t)));
4600
+ this.focusOption(optionToFocus);
4601
+ }
4602
+ }
4603
+ }
4604
+ }
4605
+ else if (event.key.length == 1) {
4606
+ const currentFocusedOption = options.find(t => this.hasFocus(t));
4607
+ const optionsWithKey = options.filter(t => t.textContent.toLowerCase().startsWith(event.key.toLowerCase()));
4608
+ if (optionsWithKey.length) {
4609
+ const currentFocuedIndex = optionsWithKey.findIndex(t => this.hasFocus(t));
4610
+ if (currentFocuedIndex > -1) {
4611
+ if (currentFocuedIndex < optionsWithKey.length - 1) {
4612
+ this.blurOption(optionsWithKey[currentFocuedIndex]);
4613
+ this.focusOption(optionsWithKey[currentFocuedIndex + 1]);
4614
+ }
4615
+ else {
4616
+ this.blurOption(optionsWithKey[currentFocuedIndex]);
4617
+ this.focusOption(optionsWithKey[0]);
4618
+ }
4619
+ }
4620
+ else {
4621
+ if (currentFocusedOption)
4622
+ this.blurOption(currentFocusedOption);
4623
+ this.focusOption(optionsWithKey[0]);
4624
+ }
4625
+ if (!this.open) {
4626
+ options.forEach(option => {
4627
+ if (this.hasFocus(option)) {
4628
+ this.value = option.value;
4629
+ }
4630
+ });
4631
+ }
4632
+ }
4633
+ else if (currentFocusedOption) {
4634
+ this.blurOption(currentFocusedOption);
4635
+ }
4636
+ }
4637
+ }
4638
+ render() {
4639
+ return (h(Host, { key: '66d25d96c778ac0183742b03ba55b104fb542191' }, h("je-input", { key: '01768d4f45c8431cbaee327edba4c97e727df9a9', ref: el => this.inputEl = el, exportparts: 'outer-container, start-container, end-container, native-input, content', dropdown: true, label: this.label, placeholder: this.placeholder, noTyping: true, expand: this.expand, dismissOnClick: true, required: this.required }, h("slot", { key: 'e31cfa87c8148c8ecda310b99ffd668c510a2149', onSlotchange: () => this.handleValueChange(), slot: 'dropdown' }), h("je-icon", { key: 'c3336499f1c8d8ba5150b5c91bb994ece0140c74', slot: 'end', icon: 'expand_more', class: { open: this.open } }))));
4640
+ }
4641
+ static get delegatesFocus() { return true; }
4642
+ static get formAssociated() { return true; }
4643
+ get el() { return getElement(this); }
4644
+ static get watchers() { return {
4645
+ "value": ["handleValueChange"]
4646
+ }; }
4647
+ };
4648
+ JeSelect.style = JeSelectStyle0;
4649
+
4650
+ const jeSelectOptionCss = ":host{display:block;width:100%;--je-option-hover-color:var(--je-primary-100)}:host([darkmode]){--je-option-hover-color:var(--je-medium-850)}:host(:hover) span[part=container],:host(.focus) span[part=container]{background-color:var(--je-option-hover-color)}span[part=container]{display:flex;align-items:center;gap:var(--je-spacing-2xs);user-select:none;-webkit-user-select:none;cursor:pointer;width:100%;padding:var(--je-spacing-xs, 10px);background-color:transparent;color:inherit;transition:background-color 75ms ease-in}je-icon{cursor:pointer}";
4651
+ const JeSelectOptionStyle0 = jeSelectOptionCss;
4652
+
4653
+ const JeSelectOption = class {
4654
+ constructor(hostRef) {
4655
+ registerInstance(this, hostRef);
4656
+ this.optionSelected = createEvent(this, "optionSelected", 7);
4657
+ this.value = undefined;
4658
+ this.selected = false;
4659
+ }
4660
+ handleClick() {
4661
+ this.optionSelected.emit(this.value);
4662
+ }
4663
+ handleThemeChange(e) {
4664
+ this.hostEl.toggleAttribute('darkmode', e.detail == 'dark');
4665
+ }
4666
+ render() {
4667
+ return (h("span", { key: '2aea5751eefe77f3ad5f1aadd76e5582f1481121', part: 'container' }, h("je-icon", { key: 'e03092f2bb061d9954df0503ca924bf287b683e9', icon: this.selected ? 'radio_button_checked' : 'radio_button_unchecked' }), h("slot", { key: '485755645a3bfa06eb79f4d6fc42501541da1712' })));
4668
+ }
4669
+ get hostEl() { return getElement(this); }
4670
+ };
4671
+ JeSelectOption.style = JeSelectOptionStyle0;
4672
+
4673
+ const jeTextareaCss = ":host{position:relative;display:flex;align-items:baseline;gap:var(--je-spacing-2xs, 8px);background-color:var(--je-input-background, field);color:var(--je-input-color, fieldtext);padding:var(--je-spacing-xs, 10px);border-radius:var(--je-border-radius, 2px);border:solid 1px var(--je-border-color);transition:border 125ms ease-in-out;--je-height:84px;--je-border-color:transparent;--je-input-background:var(--je-medium-100);--je-input-color:var(--je-medium-900)}:host([darkmode]){--je-input-background:var(--je-medium-850);--je-input-color:var(--je-medium-50)}::slotted([slot=top-right]){top:0;right:0;position:absolute;transform:translate(50%, -50%)}textarea{height:var(--je-height);font-family:var(--je-font-family, inherit);font-size:var(--je-font-size, 1rem);background:transparent;color:inherit;flex:1;border:none;padding-top:0;padding-bottom:0;padding-left:0;padding-right:0;margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;width:inherit}textarea::placeholder{font-family:var(--je-font-family, inherit);font-size:var(--je-font-size, 1rem);color:var(--je-medium-600)}textarea:focus{outline:0}label{font-weight:var(--je-font-semi-bold)}";
4674
+ const JeTextareaStyle0 = jeTextareaCss;
4675
+
4676
+ const JeTextarea = class {
4677
+ constructor(hostRef) {
4678
+ registerInstance(this, hostRef);
4679
+ this.label = undefined;
4680
+ this.placeholder = undefined;
4681
+ this.value = undefined;
4682
+ this.disabled = undefined;
4683
+ this.readonly = undefined;
4684
+ this.required = undefined;
4685
+ this.debounce = 0;
4686
+ this.maxLength = undefined;
4687
+ }
4688
+ render() {
4689
+ return (h(Host, { key: '1b04c1cc5e2e68ea2df63eb6ef1a3e80f0c8e4ee' }, this.label && h("label", { key: '98514a4abb324648adcffb321ae69f088435ed68' }, this.label), h("textarea", { key: '4c9c3187928ac210459fa0699e525f33b27efa67', value: this.value, placeholder: this.placeholder, disabled: this.disabled, readonly: this.readonly, maxLength: this.maxLength, title: this.label }), h("slot", { key: '2e382b7892148f42516526aff5d5d9f49bd22a33', name: "top-right" })));
4690
+ }
4691
+ static get formAssociated() { return true; }
4692
+ };
4693
+ JeTextarea.style = JeTextareaStyle0;
4694
+
4695
+ const jeToggleCss = ":host{display:flex;align-items:center;gap:5px;position:relative;width:fit-content;cursor:pointer;--inactive-background:var(--je-medium-500);--active-background:var(--je-primary-500)}:host([checked]) .toggle-container{background-color:var(--je-primary-500)}.toggle-container{display:flex;align-items:center;background-color:var(--inactive-background);transition:background-color 250ms ease-in-out;border-radius:var(--je-border-radius);padding:var(--je-spacing-3xs);width:40px;position:relative;cursor:pointer}.toggle-thumb{position:absolute;height:var(--je-spacing-lg);width:var(--je-spacing-lg);background-color:var(--je-background-color);border:solid 1px var(--inactive-background);border-radius:50%;transition:all 250ms ease-in-out;left:0;right:unset}.checked{border:solid 1px var(--active-background);left:100%;transform:translateX(-100%)}";
4696
+ const JeToggleStyle0 = jeToggleCss;
4697
+
4698
+ const JeToggle = class {
4699
+ constructor(hostRef) {
4700
+ registerInstance(this, hostRef);
4701
+ this.toggled = createEvent(this, "toggled", 7);
4702
+ this.checked = false;
4703
+ this.labelPlacement = 'end';
4704
+ }
4705
+ toggle() {
4706
+ this.checked = !this.checked;
4707
+ this.toggled.emit(this.checked);
4708
+ }
4709
+ onCheckedChange(newVal) {
4710
+ if (newVal !== this.checked) {
4711
+ this.checked = newVal;
4712
+ }
4713
+ }
4714
+ render() {
4715
+ return (h(Host, { key: 'ccf01db278f6873a9d88610d283bff3b08b50cf7' }, this.labelPlacement == 'start' && h("slot", { key: '61bf33abceeb25e552e86591b41261c379dab160' }), h("div", { key: 'b11204ef90a6b74fd66bb6260803727931a405c0', class: "toggle-container" }, h("div", { key: '63d76c00317e2383fa01b5159d886530c8ea4c3a', class: { 'toggle-thumb': true, 'checked': this.checked } })), this.labelPlacement == 'end' && h("slot", { key: 'feee84848b9274cd8d2b9b893f57763426bd2f0b' })));
4716
+ }
4717
+ static get watchers() { return {
4718
+ "checked": ["onCheckedChange"]
4719
+ }; }
4720
+ };
4721
+ JeToggle.style = JeToggleStyle0;
4722
+
4723
+ const jeToolbarCss = ":host{display:flex;width:100%;align-items:center;justify-content:space-around;gap:var(--je-toolbar-gap);color:var(--je-text-color, inherit);background-color:var(--je-background-color, inherit);--je-toolbar-gap:var(--je-spacing, 16px)}.center-container{flex:1;display:flex;gap:var(--je-toolbar-gap)}";
4724
+ const JeToolbarStyle0 = jeToolbarCss;
4725
+
4726
+ const JeToolbar = class {
4727
+ constructor(hostRef) {
4728
+ registerInstance(this, hostRef);
4729
+ }
4730
+ render() {
4731
+ return (h(Host, { key: '5cfe24be7e72a5d95da99cded5936ca19323884d' }, h("slot", { key: '6061fc949c06801c223d3543f57d623db5bb39e0', name: 'start' }), h("div", { key: '53584f2d947163b364514d97d0c8152d4cba3af5', class: 'center-container' }, h("slot", { key: 'd00dee4f0fa3eb140ecb1d325afe04f3ce67a6aa' })), h("slot", { key: 'ed218601bfe1886a6597fcd5cdbdf8a58a7ec876', name: 'end' })));
4732
+ }
4733
+ };
4734
+ JeToolbar.style = JeToolbarStyle0;
4735
+
4736
+ export { JeAlert as je_alert, JeButton as je_button, JeCard as je_card, JeCheckbox as je_checkbox, JeCheckboxGroup as je_checkbox_group, JeCheckboxOption as je_checkbox_option, JeColor as je_color, JeDatepicker as je_datepicker, JeDetails as je_details, JeDivider as je_divider, JeDrawer as je_drawer, JeDropzone as je_dropzone, JeForm as je_form, JeIcon as je_icon, JeInput as je_input, JeLink as je_link, JeLoading as je_loading, JeModal as je_modal, JeMultiselect as je_multiselect, JeMultiselectOption as je_multiselect_option, JePage as je_page, JePill as je_pill, JePlaceholder as je_placeholder, JePopover as je_popover, JeRadio as je_radio, JeRadioGroup as je_radio_group, JeSelect as je_select, JeSelectOption as je_select_option, JeTextarea as je_textarea, JeToggle as je_toggle, JeToolbar as je_toolbar };
4737
+
4738
+ //# sourceMappingURL=je-alert_31.entry.js.map