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