@vonage/vivid 5.16.0 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (564) hide show
  1. package/accordion/definition.cjs +6 -6
  2. package/accordion/definition.js +1 -1
  3. package/accordion/index.cjs +1 -1
  4. package/accordion/index.js +2 -2
  5. package/accordion-item/definition.cjs +5 -5
  6. package/accordion-item/definition.js +1 -1
  7. package/accordion-item/index.cjs +1 -1
  8. package/accordion-item/index.js +2 -2
  9. package/action-group/index.cjs +3 -3
  10. package/action-group/index.js +5 -5
  11. package/alert/definition.cjs +5 -5
  12. package/alert/definition.js +1 -1
  13. package/alert/index.cjs +3 -3
  14. package/alert/index.js +15 -14
  15. package/audio-player/definition.cjs +5 -5
  16. package/audio-player/definition.js +1 -1
  17. package/audio-player/index.cjs +16 -16
  18. package/audio-player/index.js +29 -28
  19. package/avatar/definition.cjs +5 -5
  20. package/avatar/definition.js +1 -1
  21. package/avatar/index.cjs +4 -4
  22. package/avatar/index.js +12 -11
  23. package/badge/definition.cjs +5 -5
  24. package/badge/definition.js +1 -1
  25. package/badge/index.cjs +1 -4
  26. package/badge/index.js +4 -20
  27. package/banner/definition.cjs +5 -5
  28. package/banner/definition.js +1 -1
  29. package/banner/index.cjs +3 -3
  30. package/banner/index.js +14 -13
  31. package/breadcrumb-item/definition.cjs +4 -4
  32. package/breadcrumb-item/definition.js +1 -1
  33. package/breadcrumb-item/index.cjs +1 -1
  34. package/breadcrumb-item/index.js +1 -0
  35. package/bundled/affix.cjs +1 -1
  36. package/bundled/affix.js +5 -5
  37. package/bundled/base-color-picker.cjs +2 -2
  38. package/bundled/base-color-picker.js +5 -5
  39. package/bundled/button.cjs +1 -1
  40. package/bundled/button.js +2 -2
  41. package/bundled/calendar-picker.template.cjs +2 -2
  42. package/bundled/calendar-picker.template.js +498 -498
  43. package/bundled/definition10.cjs +18 -30
  44. package/bundled/definition10.js +53 -155
  45. package/bundled/definition11.cjs +10 -19
  46. package/bundled/definition11.js +25 -74
  47. package/bundled/definition12.cjs +72 -18
  48. package/bundled/definition12.js +171 -107
  49. package/bundled/definition13.cjs +18 -17
  50. package/bundled/definition13.js +46 -66
  51. package/bundled/definition14.cjs +5 -10
  52. package/bundled/definition14.js +9 -27
  53. package/bundled/definition15.cjs +17 -71
  54. package/bundled/definition15.js +64 -181
  55. package/bundled/definition16.cjs +12 -4
  56. package/bundled/definition16.js +79 -14
  57. package/bundled/definition17.cjs +19 -13
  58. package/bundled/definition17.js +118 -69
  59. package/bundled/definition18.cjs +87 -12
  60. package/bundled/definition18.js +409 -52
  61. package/bundled/definition19.cjs +5 -87
  62. package/bundled/definition19.js +14 -422
  63. package/bundled/definition2.cjs +3 -14
  64. package/bundled/definition2.js +16 -49
  65. package/bundled/definition20.cjs +30 -5
  66. package/bundled/definition20.js +159 -9
  67. package/bundled/definition21.cjs +28 -19
  68. package/bundled/definition21.js +164 -47
  69. package/bundled/definition22.cjs +4 -24
  70. package/bundled/definition22.js +18 -88
  71. package/bundled/definition23.cjs +12 -0
  72. package/bundled/definition23.js +37 -0
  73. package/bundled/definition24.cjs +39 -0
  74. package/bundled/definition24.js +72 -0
  75. package/bundled/definition3.cjs +1 -1
  76. package/bundled/definition3.js +24 -21
  77. package/bundled/definition4.cjs +23 -38
  78. package/bundled/definition4.js +81 -63
  79. package/bundled/definition5.cjs +2 -2
  80. package/bundled/definition5.js +5 -5
  81. package/bundled/definition6.cjs +11 -11
  82. package/bundled/definition6.js +57 -41
  83. package/bundled/definition9.cjs +12 -30
  84. package/bundled/definition9.js +55 -148
  85. package/bundled/divider.cjs +1 -1
  86. package/bundled/divider.js +5 -5
  87. package/bundled/listbox.cjs +1 -1
  88. package/bundled/listbox.js +1 -1
  89. package/bundled/localized.cjs +1 -1
  90. package/bundled/localized.js +1 -0
  91. package/bundled/mixins.cjs +5 -5
  92. package/bundled/mixins.js +49 -49
  93. package/bundled/numberConverter.cjs +12 -0
  94. package/bundled/numberConverter.js +38 -0
  95. package/bundled/picker-field.template.cjs +8 -7
  96. package/bundled/picker-field.template.js +16 -15
  97. package/bundled/slider.template.cjs +7 -7
  98. package/bundled/slider.template.js +12 -12
  99. package/bundled/slottable-request.cjs +1 -1
  100. package/bundled/slottable-request.js +8 -38
  101. package/bundled/time-selection-picker.template.cjs +4 -4
  102. package/bundled/time-selection-picker.template.js +35 -35
  103. package/bundled/utils.cjs +1 -0
  104. package/bundled/utils.js +1420 -0
  105. package/bundled/vivid-element.cjs +1 -1
  106. package/bundled/vivid-element.js +1 -1
  107. package/button/definition.cjs +5 -5
  108. package/button/definition.js +1 -1
  109. package/button/index.cjs +1 -1
  110. package/button/index.js +1 -1
  111. package/calendar/index.cjs +11 -11
  112. package/calendar/index.js +30 -237
  113. package/calendar-event/index.cjs +3 -3
  114. package/calendar-event/index.js +4 -4
  115. package/card/definition.cjs +5 -5
  116. package/card/definition.js +1 -1
  117. package/card/index.cjs +15 -12
  118. package/card/index.js +17 -13
  119. package/checkbox/definition.cjs +5 -5
  120. package/checkbox/definition.js +1 -1
  121. package/checkbox/index.cjs +1 -1
  122. package/checkbox/index.js +2 -2
  123. package/color-picker/definition.cjs +5 -5
  124. package/color-picker/definition.js +2 -2
  125. package/color-picker/index.cjs +10 -10
  126. package/color-picker/index.js +58 -57
  127. package/combobox/definition.cjs +5 -5
  128. package/combobox/definition.js +2 -2
  129. package/combobox/index.cjs +9 -8
  130. package/combobox/index.js +40 -35
  131. package/contextual-help/definition.cjs +5 -5
  132. package/contextual-help/definition.js +2 -2
  133. package/contextual-help/index.cjs +1 -1
  134. package/contextual-help/index.js +2 -2
  135. package/country/definition.cjs +5 -5
  136. package/country/definition.js +1 -1
  137. package/country/index.cjs +1 -12
  138. package/country/index.js +4 -1216
  139. package/country-group/definition.cjs +6 -0
  140. package/country-group/definition.js +3 -0
  141. package/country-group/index.cjs +43 -0
  142. package/country-group/index.js +166 -0
  143. package/custom-elements.json +1274 -200
  144. package/data-grid/definition.cjs +9 -9
  145. package/data-grid/definition.js +2 -2
  146. package/data-grid/index.cjs +18 -18
  147. package/data-grid/index.js +260 -262
  148. package/date-picker/definition.cjs +5 -5
  149. package/date-picker/definition.js +2 -2
  150. package/date-picker/index.cjs +1 -1
  151. package/date-picker/index.js +13 -13
  152. package/date-range-picker/definition.cjs +5 -5
  153. package/date-range-picker/definition.js +2 -2
  154. package/date-range-picker/index.cjs +1 -1
  155. package/date-range-picker/index.js +8 -8
  156. package/date-time-picker/definition.cjs +5 -5
  157. package/date-time-picker/definition.js +2 -2
  158. package/date-time-picker/index.cjs +4 -4
  159. package/date-time-picker/index.js +25 -25
  160. package/dial-pad/definition.cjs +5 -5
  161. package/dial-pad/definition.js +2 -2
  162. package/dial-pad/index.cjs +6 -5
  163. package/dial-pad/index.js +14 -12
  164. package/dialog/definition.cjs +5 -5
  165. package/dialog/definition.js +2 -2
  166. package/dialog/index.cjs +6 -6
  167. package/dialog/index.js +17 -16
  168. package/divider/definition.cjs +1 -1
  169. package/divider/definition.js +1 -1
  170. package/divider/index.cjs +1 -1
  171. package/divider/index.js +1 -1
  172. package/empty-state/definition.cjs +5 -5
  173. package/empty-state/definition.js +2 -2
  174. package/empty-state/index.cjs +2 -2
  175. package/empty-state/index.js +6 -5
  176. package/fab/definition.cjs +5 -5
  177. package/fab/definition.js +2 -2
  178. package/fab/index.cjs +4 -4
  179. package/fab/index.js +13 -12
  180. package/file-picker/definition.cjs +5 -5
  181. package/file-picker/definition.js +2 -2
  182. package/file-picker/index.cjs +20 -17
  183. package/file-picker/index.js +40 -36
  184. package/flag/definition.cjs +6 -0
  185. package/flag/definition.js +3 -0
  186. package/flag/index.cjs +10 -0
  187. package/flag/index.js +61 -0
  188. package/header/definition.cjs +1 -1
  189. package/header/definition.js +1 -1
  190. package/header/index.cjs +4 -4
  191. package/header/index.js +5 -5
  192. package/icon/definition.cjs +1 -0
  193. package/icon/definition.js +1 -0
  194. package/icon/index.cjs +1 -1
  195. package/icon/index.js +1 -0
  196. package/index.cjs +204 -192
  197. package/index.js +55 -52
  198. package/layout/definition.cjs +1 -1
  199. package/layout/definition.js +1 -1
  200. package/lib/button/button.d.ts +1 -0
  201. package/lib/combobox/combobox.d.ts +0 -3
  202. package/lib/components.d.ts +2 -0
  203. package/lib/country/countries-data.d.ts +1 -0
  204. package/lib/country/{country-code-to-flag-icon.d.ts → utils.d.ts} +0 -3
  205. package/lib/country-group/country-group.d.ts +829 -0
  206. package/lib/country-group/country-group.template.d.ts +3 -0
  207. package/lib/country-group/definition.d.ts +3 -0
  208. package/lib/country-group/index.d.ts +1 -0
  209. package/lib/country-group/locale.d.ts +3 -0
  210. package/lib/date-picker/date-picker.d.ts +4 -0
  211. package/lib/date-range-picker/date-range-picker.d.ts +2 -0
  212. package/lib/date-time-picker/date-time-picker.d.ts +4 -4
  213. package/lib/dial-pad/dial-pad.d.ts +6 -2
  214. package/lib/dialog/dialog.d.ts +0 -1
  215. package/lib/flag/definition.d.ts +3 -0
  216. package/lib/flag/flag.d.ts +8 -0
  217. package/lib/flag/flag.template.d.ts +3 -0
  218. package/lib/flag/index.d.ts +1 -0
  219. package/lib/icon/icon.d.ts +1 -2
  220. package/lib/menu/menu.d.ts +0 -1
  221. package/lib/option/option.d.ts +0 -1
  222. package/lib/rich-text-editor/rte/exports.d.ts +1 -0
  223. package/lib/rich-text-editor/rte/features/alignment.d.ts +1 -1
  224. package/lib/rich-text-editor/rte/features/character-count.d.ts +21 -0
  225. package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +1 -1
  226. package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
  227. package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
  228. package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
  229. package/lib/rich-text-editor/rte/public-interface.d.ts +6 -0
  230. package/lib/searchable-select/option-tag.d.ts +3 -2
  231. package/lib/searchable-select/searchable-select.d.ts +3 -1
  232. package/lib/table/definition.d.ts +2 -1
  233. package/lib/table/table-header-cell.d.ts +3 -0
  234. package/lib/table/table-sorting-button.d.ts +415 -0
  235. package/lib/table/table-sorting-button.template.d.ts +3 -0
  236. package/lib/tag-name-map.d.ts +2 -1
  237. package/lib/time-picker/time-picker.d.ts +2 -0
  238. package/locales/de-DE.cjs +5 -178
  239. package/locales/de-DE.js +3 -179
  240. package/locales/en-GB.cjs +5 -9
  241. package/locales/en-GB.js +3 -10
  242. package/locales/en-US.cjs +269 -2
  243. package/locales/en-US.js +266 -1
  244. package/locales/ja-JP.cjs +5 -171
  245. package/locales/ja-JP.js +3 -172
  246. package/locales/zh-CN.cjs +5 -172
  247. package/locales/zh-CN.js +3 -173
  248. package/menu/definition.cjs +5 -5
  249. package/menu/definition.js +1 -1
  250. package/menu/index.cjs +1 -1
  251. package/menu/index.js +2 -2
  252. package/menu-item/definition.cjs +6 -6
  253. package/menu-item/definition.js +1 -1
  254. package/menu-item/index.cjs +1 -1
  255. package/menu-item/index.js +2 -2
  256. package/nav/definition.cjs +1 -1
  257. package/nav/definition.js +1 -1
  258. package/nav-disclosure/definition.cjs +5 -5
  259. package/nav-disclosure/definition.js +2 -2
  260. package/nav-disclosure/index.cjs +4 -4
  261. package/nav-disclosure/index.js +13 -12
  262. package/nav-item/definition.cjs +5 -5
  263. package/nav-item/definition.js +2 -2
  264. package/nav-item/index.cjs +2 -2
  265. package/nav-item/index.js +12 -11
  266. package/note/definition.cjs +5 -5
  267. package/note/definition.js +2 -2
  268. package/note/index.cjs +3 -3
  269. package/note/index.js +11 -10
  270. package/number-field/definition.cjs +5 -5
  271. package/number-field/definition.js +2 -2
  272. package/number-field/index.cjs +4 -4
  273. package/number-field/index.js +29 -28
  274. package/option/definition.cjs +5 -5
  275. package/option/definition.js +2 -2
  276. package/option/index.cjs +1 -1
  277. package/option/index.js +2 -2
  278. package/package.json +9 -10
  279. package/pagination/definition.cjs +5 -5
  280. package/pagination/definition.js +2 -2
  281. package/pagination/index.cjs +3 -3
  282. package/pagination/index.js +16 -16
  283. package/popover/definition.cjs +5 -5
  284. package/popover/definition.js +2 -2
  285. package/popover/index.cjs +7 -7
  286. package/popover/index.js +12 -11
  287. package/popup/definition.cjs +4 -4
  288. package/popup/definition.js +1 -1
  289. package/popup/index.cjs +1 -1
  290. package/popup/index.js +1 -1
  291. package/progress/definition.cjs +1 -1
  292. package/progress/definition.js +1 -1
  293. package/progress/index.cjs +2 -2
  294. package/progress/index.js +5 -5
  295. package/radio/definition.cjs +1 -1
  296. package/radio/definition.js +1 -1
  297. package/radio/index.cjs +1 -1
  298. package/radio/index.js +1 -1
  299. package/radio-group/definition.cjs +5 -5
  300. package/radio-group/definition.js +2 -2
  301. package/radio-group/index.cjs +4 -4
  302. package/radio-group/index.js +11 -11
  303. package/range-slider/definition.cjs +5 -5
  304. package/range-slider/definition.js +2 -2
  305. package/range-slider/index.cjs +4 -4
  306. package/range-slider/index.js +39 -36
  307. package/rich-text-editor/definition.cjs +32 -31
  308. package/rich-text-editor/definition.js +3 -3
  309. package/rich-text-editor/index.cjs +13 -13
  310. package/rich-text-editor/index.js +1887 -1830
  311. package/rich-text-view/definition.cjs +1 -1
  312. package/rich-text-view/definition.js +1 -1
  313. package/rich-text-view/index.cjs +1 -1
  314. package/rich-text-view/index.js +8 -8
  315. package/searchable-select/definition.cjs +4 -4
  316. package/searchable-select/definition.js +2 -2
  317. package/searchable-select/index.cjs +15 -13
  318. package/searchable-select/index.js +75 -72
  319. package/select/definition.cjs +5 -5
  320. package/select/definition.js +2 -2
  321. package/select/index.cjs +1 -1
  322. package/select/index.js +2 -2
  323. package/selectable-box/definition.cjs +5 -5
  324. package/selectable-box/definition.js +2 -2
  325. package/selectable-box/index.cjs +7 -7
  326. package/selectable-box/index.js +12 -12
  327. package/shared/foundation/test-utilities/fixture.d.ts +1 -1
  328. package/shared/icon/utils.d.ts +1 -0
  329. package/shared/localization/Locale.d.ts +2 -0
  330. package/shared/patterns/linkable.d.ts +1 -1
  331. package/shared/picker-field/mixins/calendar-picker.d.ts +1 -0
  332. package/shared/picker-field/mixins/calendar-picker.template.d.ts +1 -0
  333. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +1 -0
  334. package/shared/picker-field/mixins/single-date-picker.d.ts +1 -0
  335. package/shared/picker-field/mixins/single-value-picker.d.ts +1 -0
  336. package/shared/picker-field/mixins/time-selection-picker.d.ts +1 -0
  337. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +2 -0
  338. package/shared/picker-field/picker-field.d.ts +2 -0
  339. package/side-drawer/definition.cjs +1 -1
  340. package/side-drawer/definition.js +1 -1
  341. package/simple-color-picker/definition.cjs +5 -5
  342. package/simple-color-picker/definition.js +2 -2
  343. package/simple-color-picker/index.cjs +3 -3
  344. package/simple-color-picker/index.js +15 -14
  345. package/slider/definition.cjs +5 -5
  346. package/slider/definition.js +1 -1
  347. package/slider/index.cjs +1 -1
  348. package/slider/index.js +1 -1
  349. package/split-button/definition.cjs +5 -5
  350. package/split-button/definition.js +2 -2
  351. package/split-button/index.cjs +6 -6
  352. package/split-button/index.js +17 -16
  353. package/status/definition.cjs +5 -5
  354. package/status/definition.js +2 -2
  355. package/status/index.cjs +2 -2
  356. package/status/index.js +11 -10
  357. package/switch/definition.cjs +5 -5
  358. package/switch/definition.js +2 -2
  359. package/switch/index.cjs +4 -4
  360. package/switch/index.js +11 -10
  361. package/tab/definition.cjs +5 -5
  362. package/tab/definition.js +2 -2
  363. package/tab/index.cjs +1 -1
  364. package/tab/index.js +2 -2
  365. package/tab-panel/definition.cjs +1 -1
  366. package/tab-panel/definition.js +1 -1
  367. package/tab-panel/index.cjs +1 -1
  368. package/tab-panel/index.js +1 -1
  369. package/table/definition.cjs +4 -1
  370. package/table/definition.js +3 -2
  371. package/table/index.cjs +19 -10
  372. package/table/index.js +70 -21
  373. package/tabs/definition.cjs +6 -6
  374. package/tabs/definition.js +2 -2
  375. package/tabs/index.cjs +2 -2
  376. package/tabs/index.js +5 -5
  377. package/tag/definition.cjs +5 -5
  378. package/tag/definition.js +2 -2
  379. package/tag/index.cjs +8 -8
  380. package/tag/index.js +14 -13
  381. package/tag-group/definition.cjs +1 -1
  382. package/tag-group/definition.js +1 -1
  383. package/tag-group/index.cjs +3 -3
  384. package/tag-group/index.js +5 -5
  385. package/text-area/definition.cjs +5 -5
  386. package/text-area/definition.js +2 -2
  387. package/text-area/index.cjs +2 -2
  388. package/text-area/index.js +13 -13
  389. package/text-field/definition.cjs +5 -5
  390. package/text-field/definition.js +2 -2
  391. package/text-field/index.cjs +1 -1
  392. package/text-field/index.js +2 -2
  393. package/time-picker/definition.cjs +4 -4
  394. package/time-picker/definition.js +2 -2
  395. package/time-picker/index.cjs +1 -1
  396. package/time-picker/index.js +2 -2
  397. package/toggletip/definition.cjs +5 -5
  398. package/toggletip/definition.js +2 -2
  399. package/toggletip/index.cjs +1 -1
  400. package/toggletip/index.js +2 -2
  401. package/tooltip/definition.cjs +5 -5
  402. package/tooltip/definition.js +2 -2
  403. package/tooltip/index.cjs +1 -1
  404. package/tooltip/index.js +2 -2
  405. package/tree-item/definition.cjs +5 -5
  406. package/tree-item/definition.js +2 -2
  407. package/tree-item/index.cjs +1 -1
  408. package/tree-item/index.js +2 -2
  409. package/tree-view/definition.cjs +5 -5
  410. package/tree-view/definition.js +2 -2
  411. package/tree-view/index.cjs +3 -3
  412. package/tree-view/index.js +18 -18
  413. package/unbundled/button.cjs +2 -2
  414. package/unbundled/button.js +2 -2
  415. package/unbundled/calendar-picker.template.cjs +4347 -9
  416. package/unbundled/calendar-picker.template.js +4345 -7
  417. package/unbundled/chunk.cjs +0 -22
  418. package/unbundled/definition11.cjs +6 -0
  419. package/unbundled/definition11.js +6 -0
  420. package/unbundled/definition13.cjs +1 -8
  421. package/unbundled/definition13.js +1 -8
  422. package/unbundled/definition14.cjs +3 -2
  423. package/unbundled/definition14.js +3 -2
  424. package/unbundled/definition2.cjs +5 -75
  425. package/unbundled/definition2.js +1 -71
  426. package/unbundled/definition21.cjs +1 -2
  427. package/unbundled/definition21.js +1 -2
  428. package/unbundled/definition22.cjs +7 -2
  429. package/unbundled/definition22.js +7 -2
  430. package/unbundled/definition24.cjs +98 -979
  431. package/unbundled/definition24.js +93 -974
  432. package/unbundled/definition25.cjs +37 -322
  433. package/unbundled/definition25.js +33 -318
  434. package/unbundled/definition26.cjs +317 -91
  435. package/unbundled/definition26.js +313 -87
  436. package/unbundled/definition27.cjs +94 -192
  437. package/unbundled/definition27.js +91 -183
  438. package/unbundled/definition28.cjs +388 -395
  439. package/unbundled/definition28.js +388 -395
  440. package/unbundled/definition29.cjs +189 -110
  441. package/unbundled/definition29.js +180 -107
  442. package/unbundled/definition30.cjs +520 -36
  443. package/unbundled/definition30.js +519 -35
  444. package/unbundled/definition31.cjs +2 -1189
  445. package/unbundled/definition31.js +1 -1188
  446. package/unbundled/definition32.cjs +207 -1835
  447. package/unbundled/definition32.js +203 -1807
  448. package/unbundled/definition33.cjs +85 -228
  449. package/unbundled/definition33.js +82 -165
  450. package/unbundled/definition34.cjs +1887 -25
  451. package/unbundled/definition34.js +1857 -24
  452. package/unbundled/definition35.cjs +315 -121
  453. package/unbundled/definition35.js +236 -114
  454. package/unbundled/definition36.cjs +25 -405
  455. package/unbundled/definition36.js +22 -397
  456. package/unbundled/definition37.cjs +49 -140
  457. package/unbundled/definition37.js +46 -137
  458. package/unbundled/definition38.cjs +346 -329
  459. package/unbundled/definition38.js +343 -326
  460. package/unbundled/definition39.cjs +183 -234
  461. package/unbundled/definition39.js +181 -232
  462. package/unbundled/definition40.cjs +377 -47
  463. package/unbundled/definition40.js +372 -42
  464. package/unbundled/definition41.cjs +256 -57
  465. package/unbundled/definition41.js +255 -56
  466. package/unbundled/definition42.cjs +45 -421
  467. package/unbundled/definition42.js +41 -417
  468. package/unbundled/definition43.cjs +63 -49
  469. package/unbundled/definition43.js +61 -47
  470. package/unbundled/definition44.cjs +438 -30
  471. package/unbundled/definition44.js +434 -25
  472. package/unbundled/definition45.cjs +46 -84
  473. package/unbundled/definition45.js +43 -81
  474. package/unbundled/definition46.cjs +29 -54
  475. package/unbundled/definition46.js +24 -50
  476. package/unbundled/definition47.cjs +93 -21
  477. package/unbundled/definition47.js +91 -16
  478. package/unbundled/definition48.cjs +49 -33
  479. package/unbundled/definition48.js +46 -30
  480. package/unbundled/definition49.cjs +22 -347
  481. package/unbundled/definition49.js +16 -344
  482. package/unbundled/definition50.cjs +34 -211
  483. package/unbundled/definition50.js +30 -207
  484. package/unbundled/definition51.cjs +282 -242
  485. package/unbundled/definition51.js +275 -235
  486. package/unbundled/definition52.cjs +211 -51
  487. package/unbundled/definition52.js +209 -48
  488. package/unbundled/definition53.cjs +275 -131
  489. package/unbundled/definition53.js +272 -127
  490. package/unbundled/definition54.cjs +50 -261
  491. package/unbundled/definition54.js +48 -260
  492. package/unbundled/definition55.cjs +126 -443
  493. package/unbundled/definition55.js +123 -441
  494. package/unbundled/definition56.cjs +238 -12669
  495. package/unbundled/definition56.js +232 -12506
  496. package/unbundled/definition57.cjs +408 -729
  497. package/unbundled/definition57.js +406 -727
  498. package/unbundled/definition58.cjs +3619 -106
  499. package/unbundled/definition58.js +3449 -99
  500. package/unbundled/definition59.cjs +625 -868
  501. package/unbundled/definition59.js +620 -863
  502. package/unbundled/definition60.cjs +106 -108
  503. package/unbundled/definition60.js +102 -104
  504. package/unbundled/definition61.cjs +1040 -71
  505. package/unbundled/definition61.js +1035 -65
  506. package/unbundled/definition62.cjs +105 -169
  507. package/unbundled/definition62.js +101 -165
  508. package/unbundled/definition63.cjs +70 -113
  509. package/unbundled/definition63.js +65 -109
  510. package/unbundled/definition64.cjs +181 -53
  511. package/unbundled/definition64.js +178 -50
  512. package/unbundled/definition65.cjs +109 -76
  513. package/unbundled/definition65.js +109 -75
  514. package/unbundled/definition66.cjs +58 -21
  515. package/unbundled/definition66.js +55 -15
  516. package/unbundled/definition67.cjs +81 -74
  517. package/unbundled/definition67.js +79 -73
  518. package/unbundled/definition68.cjs +19 -344
  519. package/unbundled/definition68.js +14 -335
  520. package/unbundled/definition69.cjs +88 -26
  521. package/unbundled/definition69.js +85 -22
  522. package/unbundled/definition7.cjs +18 -3
  523. package/unbundled/definition7.js +18 -3
  524. package/unbundled/definition70.cjs +330 -111
  525. package/unbundled/definition70.js +320 -108
  526. package/unbundled/definition71.cjs +26 -271
  527. package/unbundled/definition71.js +21 -267
  528. package/unbundled/definition72.cjs +134 -28
  529. package/unbundled/definition72.js +125 -26
  530. package/unbundled/definition73.cjs +245 -113
  531. package/unbundled/definition73.js +242 -104
  532. package/unbundled/definition74.cjs +28 -212
  533. package/unbundled/definition74.js +26 -202
  534. package/unbundled/definition75.cjs +120 -52190
  535. package/unbundled/definition75.js +112 -52188
  536. package/unbundled/definition76.cjs +232 -0
  537. package/unbundled/definition76.js +213 -0
  538. package/unbundled/definition77.cjs +533 -0
  539. package/unbundled/definition77.js +513 -0
  540. package/unbundled/listbox.cjs +1 -1
  541. package/unbundled/listbox.js +1 -1
  542. package/unbundled/localized.cjs +2 -2
  543. package/unbundled/localized.js +1 -1
  544. package/unbundled/numberConverter.cjs +91 -0
  545. package/unbundled/numberConverter.js +74 -0
  546. package/unbundled/picker-field.template.cjs +3 -1
  547. package/unbundled/picker-field.template.js +3 -1
  548. package/unbundled/slottable-request.cjs +2 -3168
  549. package/unbundled/slottable-request.js +3 -3097
  550. package/unbundled/time-selection-picker.template.cjs +1 -1
  551. package/unbundled/time-selection-picker.template.js +1 -1
  552. package/unbundled/utils.cjs +1439 -0
  553. package/unbundled/utils.js +1428 -0
  554. package/unbundled/vivid-element.cjs +1 -1
  555. package/unbundled/vivid-element.js +1 -1
  556. package/video-player/definition.cjs +1 -1
  557. package/video-player/definition.js +1 -1
  558. package/video-player/index.cjs +3 -3
  559. package/video-player/index.js +9 -9
  560. package/vivid.api.json +860 -409
  561. package/unbundled/chunk.js +0 -33
  562. package/unbundled/en-US.cjs +0 -447
  563. package/unbundled/en-US.js +0 -443
  564. /package/{lib/icon/icon.placeholder.d.ts → shared/icon/icon-placeholder.d.ts} +0 -0
@@ -7,16 +7,249 @@ let _microsoft_fast_element = require("@microsoft/fast-element");
7
7
  let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
8
8
  let date_fns = require("date-fns");
9
9
  //#region src/shared/picker-field/mixins/calendar-picker.scss?inline
10
- var calendar_picker_default = ".segments{gap:24px}@media (width>=648px){.segments{display:inline-flex}}.segment{flex-direction:column;gap:12px;display:flex}.segment .header{align-items:center;padding-block:8px;display:flex}.segment .title{flex-grow:1;justify-content:center;display:flex}.segment .title-action{block-size:24px;font:var(--vvd-typography-base-extended);border-radius:8px;padding-inline:8px}.calendar{flex-direction:column;gap:4px;margin-top:8px;display:flex}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{justify-content:center;display:flex}.calendar .calendar-weekday{block-size:16px;font:var(--vvd-typography-base-condensed);justify-content:center;align-items:center;inline-size:40px;display:inline-flex}.calendar .calendar-week{justify-content:center;display:flex}.calendar .calendar-day{aspect-ratio:1;block-size:28px;font:var(--vvd-typography-base);border-radius:50%;justify-content:center;align-items:center;margin-inline:6px;display:inline-flex}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar:focus-visible .calendar .calendar-day.start,.calendar:focus-visible .calendar .calendar-day.end{border-width:3px}.calendar .calendar-day:before,.calendar .calendar-day:after{z-index:-1;width:20px;height:28px;display:block;position:absolute}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{flex-direction:column;gap:34px;display:flex}.month-grid .months-row{justify-content:center;gap:29px;display:flex}.month-grid .month{aspect-ratio:1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase;border-radius:50%;justify-content:center;align-items:center;display:inline-flex}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{--_connotation-color-primary:var(--vvd-date-picker-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-firm:var(--vvd-date-picker-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-date-picker-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-date-picker-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-dim:var(--vvd-date-picker-accent-dim,var(--vvd-color-neutral-200));--_connotation-color-pale:var(--vvd-date-picker-accent-pale,var(--vvd-color-neutral-300));--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.button:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.button.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.button:active:where(:not(.disabled,:disabled)),.button.active:where(:not(.disabled,:disabled)),.button.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.button.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.button.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.button.selected:disabled,.button.selected.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:transparent}.button{background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;border:none;padding:0;position:relative}.button:disabled{cursor:not-allowed}.button:focus:not(.title-action),.button.title-action:focus-visible{--focus-stroke-gap-color:transparent;color:var(--vvd-color-canvas-text);box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}.button:focus:not(.title-action).start,.button:focus:not(.title-action).end,.button.title-action:focus-visible.start,.button.title-action:focus-visible.end{border-width:3px}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button.selected{border:1px solid var(--vvd-color-neutral-900)}";
10
+ var calendar_picker_default = ".segments{gap:24px}@media (width>=648px){.segments{display:inline-flex}}.segment{flex-direction:column;gap:12px;display:flex}.segment .header{align-items:center;padding-block:8px;display:flex}.segment .title{flex-grow:1;justify-content:center;display:flex}.segment .title-action{block-size:24px;font:var(--vvd-typography-base-extended);border-radius:8px;padding-inline:8px}.calendar{flex-direction:column;gap:4px;margin-top:8px;display:flex}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{justify-content:center;display:flex}.calendar .calendar-weekday{block-size:16px;font:var(--vvd-typography-base-condensed);justify-content:center;align-items:center;inline-size:40px;display:inline-flex}.calendar .calendar-week{justify-content:center;display:flex}.calendar .calendar-day{aspect-ratio:1;block-size:28px;font:var(--vvd-typography-base);border-radius:50%;justify-content:center;align-items:center;margin-inline:6px;display:inline-flex}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar:focus-visible .calendar .calendar-day.start,.calendar:focus-visible .calendar .calendar-day.end{border-width:3px}.calendar .calendar-day:before,.calendar .calendar-day:after{z-index:-1;width:20px;height:28px;display:block;position:absolute}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{flex-direction:column;gap:34px;display:flex}.month-grid .months-row{justify-content:center;gap:29px;display:flex}.month-grid .month{aspect-ratio:1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase;border-radius:50%;justify-content:center;align-items:center;display:inline-flex}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{--_connotation-color-primary:var(--vvd-date-picker-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-firm:var(--vvd-date-picker-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-date-picker-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-date-picker-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-dim:var(--vvd-date-picker-accent-dim,var(--vvd-color-neutral-200));--_connotation-color-pale:var(--vvd-date-picker-accent-pale,var(--vvd-color-neutral-300));--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.button:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.button.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.button:active:where(:not(.disabled,:disabled)),.button.active:where(:not(.disabled,:disabled)),.button.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.button.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.button.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.button.selected:disabled,.button.selected.disabled{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:var(--vvd-color-neutral-200);--_appearance-color-outline:transparent}.button{background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;border:none;padding:0;position:relative}.button:disabled{cursor:not-allowed}.button:focus-visible{--focus-stroke-gap-color:transparent;color:var(--vvd-color-canvas-text);box-shadow:0 0 0 4px color-mix(in srgb, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}.button:focus-visible.start,.button:focus-visible.end{border-width:3px}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button.selected{border:1px solid var(--vvd-color-neutral-900)}";
11
+ //#endregion
12
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js
13
+ function addLeadingZeros(number, targetLength) {
14
+ return (number < 0 ? "-" : "") + Math.abs(number).toString().padStart(targetLength, "0");
15
+ }
16
+ //#endregion
17
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
18
+ /**
19
+ * @constant
20
+ * @name daysInYear
21
+ * @summary Days in 1 year.
22
+ *
23
+ * @description
24
+ * How many days in a year.
25
+ *
26
+ * One years equals 365.2425 days according to the formula:
27
+ *
28
+ * > Leap year occurs every 4 years, except for years that are divisible by 100 and not divisible by 400.
29
+ * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days
30
+ */
31
+ var daysInYear = 365.2425;
32
+ Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
33
+ /**
34
+ * @constant
35
+ * @name millisecondsInWeek
36
+ * @summary Milliseconds in 1 week.
37
+ */
38
+ var millisecondsInWeek = 6048e5;
39
+ /**
40
+ * @constant
41
+ * @name millisecondsInDay
42
+ * @summary Milliseconds in 1 day.
43
+ */
44
+ var millisecondsInDay = 864e5;
45
+ /**
46
+ * @constant
47
+ * @name millisecondsInMinute
48
+ * @summary Milliseconds in 1 minute
49
+ */
50
+ var millisecondsInMinute = 6e4;
51
+ /**
52
+ * @constant
53
+ * @name millisecondsInHour
54
+ * @summary Milliseconds in 1 hour
55
+ */
56
+ var millisecondsInHour = 36e5;
57
+ /**
58
+ * @constant
59
+ * @name millisecondsInSecond
60
+ * @summary Milliseconds in 1 second
61
+ */
62
+ var millisecondsInSecond = 1e3;
63
+ /**
64
+ * @constant
65
+ * @name secondsInDay
66
+ * @summary Seconds in 1 day.
67
+ */
68
+ var secondsInDay = 3600 * 24;
69
+ secondsInDay * 7;
70
+ secondsInDay * daysInYear / 12 * 3;
71
+ /**
72
+ * @constant
73
+ * @name constructFromSymbol
74
+ * @summary Symbol enabling Date extensions to inherit properties from the reference date.
75
+ *
76
+ * The symbol is used to enable the `constructFrom` function to construct a date
77
+ * using a reference date and a value. It allows to transfer extra properties
78
+ * from the reference date to the new date. It's useful for extensions like
79
+ * [`TZDate`](https://github.com/date-fns/tz) that accept a time zone as
80
+ * a constructor argument.
81
+ */
82
+ var constructFromSymbol = Symbol.for("constructDateFrom");
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
85
+ /**
86
+ * @name constructFrom
87
+ * @category Generic Helpers
88
+ * @summary Constructs a date using the reference date and the value
89
+ *
90
+ * @description
91
+ * The function constructs a new date using the constructor from the reference
92
+ * date and the given value. It helps to build generic functions that accept
93
+ * date extensions.
94
+ *
95
+ * It defaults to `Date` if the passed reference date is a number or a string.
96
+ *
97
+ * Starting from v3.7.0, it allows to construct a date using `[Symbol.for("constructDateFrom")]`
98
+ * enabling to transfer extra properties from the reference date to the new date.
99
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
100
+ * that accept a time zone as a constructor argument.
101
+ *
102
+ * @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).
103
+ *
104
+ * @param date - The reference date to take constructor from
105
+ * @param value - The value to create the date
106
+ *
107
+ * @returns Date initialized using the given date and value
108
+ *
109
+ * @example
110
+ * import { constructFrom } from "./constructFrom/date-fns";
111
+ *
112
+ * // A function that clones a date preserving the original type
113
+ * function cloneDate<DateType extends Date>(date: DateType): DateType {
114
+ * return constructFrom(
115
+ * date, // Use constructor from the given date
116
+ * date.getTime() // Use the date value to create a new date
117
+ * );
118
+ * }
119
+ */
120
+ function constructFrom(date, value) {
121
+ if (typeof date === "function") return date(value);
122
+ if (date && typeof date === "object" && constructFromSymbol in date) return date[constructFromSymbol](value);
123
+ if (date instanceof Date) return new date.constructor(value);
124
+ return new Date(value);
125
+ }
126
+ //#endregion
127
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
128
+ /**
129
+ * @name toDate
130
+ * @category Common Helpers
131
+ * @summary Convert the given argument to an instance of Date.
132
+ *
133
+ * @description
134
+ * Convert the given argument to an instance of Date.
135
+ *
136
+ * If the argument is an instance of Date, the function returns its clone.
137
+ *
138
+ * If the argument is a number, it is treated as a timestamp.
139
+ *
140
+ * If the argument is none of the above, the function returns Invalid Date.
141
+ *
142
+ * Starting from v3.7.0, it clones a date using `[Symbol.for("constructDateFrom")]`
143
+ * enabling to transfer extra properties from the reference date to the new date.
144
+ * It's useful for extensions like [`TZDate`](https://github.com/date-fns/tz)
145
+ * that accept a time zone as a constructor argument.
146
+ *
147
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
148
+ *
149
+ * @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).
150
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
151
+ *
152
+ * @param argument - The value to convert
153
+ *
154
+ * @returns The parsed date in the local time zone
155
+ *
156
+ * @example
157
+ * // Clone the date:
158
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
159
+ * //=> Tue Feb 11 2014 11:30:30
160
+ *
161
+ * @example
162
+ * // Convert the timestamp to date:
163
+ * const result = toDate(1392098430000)
164
+ * //=> Tue Feb 11 2014 11:30:30
165
+ */
166
+ function toDate(argument, context) {
167
+ return constructFrom(context || argument, argument);
168
+ }
169
+ //#endregion
170
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/formatISO.js
171
+ /**
172
+ * The {@link formatISO} function options.
173
+ */
174
+ /**
175
+ * @name formatISO
176
+ * @category Common Helpers
177
+ * @summary Format the date according to the ISO 8601 standard (https://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003169814.htm).
178
+ *
179
+ * @description
180
+ * Return the formatted date string in ISO 8601 format. Options may be passed to control the parts and notations of the date.
181
+ *
182
+ * @param date - The original date
183
+ * @param options - An object with options.
184
+ *
185
+ * @returns The formatted date string (in local time zone)
186
+ *
187
+ * @throws `date` must not be Invalid Date
188
+ *
189
+ * @example
190
+ * // Represent 18 September 2019 in ISO 8601 format (local time zone is UTC):
191
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52))
192
+ * //=> '2019-09-18T19:00:52Z'
193
+ *
194
+ * @example
195
+ * // Represent 18 September 2019 in ISO 8601, short format (local time zone is UTC):
196
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { format: 'basic' })
197
+ * //=> '20190918T190052'
198
+ *
199
+ * @example
200
+ * // Represent 18 September 2019 in ISO 8601 format, date only:
201
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'date' })
202
+ * //=> '2019-09-18'
203
+ *
204
+ * @example
205
+ * // Represent 18 September 2019 in ISO 8601 format, time only (local time zone is UTC):
206
+ * const result = formatISO(new Date(2019, 8, 18, 19, 0, 52), { representation: 'time' })
207
+ * //=> '19:00:52Z'
208
+ */
209
+ function formatISO(date, options) {
210
+ const date_ = toDate(date, options?.in);
211
+ if (isNaN(+date_)) throw new RangeError("Invalid time value");
212
+ const format = options?.format ?? "extended";
213
+ const representation = options?.representation ?? "complete";
214
+ let result = "";
215
+ let tzOffset = "";
216
+ const dateDelimiter = format === "extended" ? "-" : "";
217
+ const timeDelimiter = format === "extended" ? ":" : "";
218
+ if (representation !== "time") {
219
+ const day = addLeadingZeros(date_.getDate(), 2);
220
+ const month = addLeadingZeros(date_.getMonth() + 1, 2);
221
+ result = `${addLeadingZeros(date_.getFullYear(), 4)}${dateDelimiter}${month}${dateDelimiter}${day}`;
222
+ }
223
+ if (representation !== "date") {
224
+ const offset = date_.getTimezoneOffset();
225
+ if (offset !== 0) {
226
+ const absoluteOffset = Math.abs(offset);
227
+ const hourOffset = addLeadingZeros(Math.trunc(absoluteOffset / 60), 2);
228
+ const minuteOffset = addLeadingZeros(absoluteOffset % 60, 2);
229
+ tzOffset = `${offset < 0 ? "+" : "-"}${hourOffset}:${minuteOffset}`;
230
+ } else tzOffset = "Z";
231
+ const hour = addLeadingZeros(date_.getHours(), 2);
232
+ const minute = addLeadingZeros(date_.getMinutes(), 2);
233
+ const second = addLeadingZeros(date_.getSeconds(), 2);
234
+ const separator = result === "" ? "" : "T";
235
+ const time = [
236
+ hour,
237
+ minute,
238
+ second
239
+ ].join(timeDelimiter);
240
+ result = `${result}${separator}${time}${tzOffset}`;
241
+ }
242
+ return result;
243
+ }
11
244
  //#endregion
12
245
  //#region src/shared/datetime/dateStr.ts
13
- var formatDateStr = (date) => (0, date_fns.formatISO)(date, { representation: "date" });
246
+ var formatDateStr = (date) => formatISO(date, { representation: "date" });
14
247
  var currentDateStr = (now = /* @__PURE__ */ new Date()) => formatDateStr(now);
15
248
  var parseDateStr = (dateStr) => {
16
249
  const [year, month, day] = dateStr.split("-");
17
250
  return new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
18
251
  };
19
- var addDays$1 = (dateStr, days) => {
252
+ var addDays$2 = (dateStr, days) => {
20
253
  const date = parseDateStr(dateStr);
21
254
  const resultDate = new Date(date);
22
255
  resultDate.setDate(resultDate.getDate() + days);
@@ -37,9 +270,4114 @@ var isValidDateStr = (string) => {
37
270
  return hasThreeComponents(components) && allComponentsAreNumbers(components) && isValidDate(components);
38
271
  };
39
272
  //#endregion
273
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
274
+ var formatDistanceLocale = {
275
+ lessThanXSeconds: {
276
+ one: "less than a second",
277
+ other: "less than {{count}} seconds"
278
+ },
279
+ xSeconds: {
280
+ one: "1 second",
281
+ other: "{{count}} seconds"
282
+ },
283
+ halfAMinute: "half a minute",
284
+ lessThanXMinutes: {
285
+ one: "less than a minute",
286
+ other: "less than {{count}} minutes"
287
+ },
288
+ xMinutes: {
289
+ one: "1 minute",
290
+ other: "{{count}} minutes"
291
+ },
292
+ aboutXHours: {
293
+ one: "about 1 hour",
294
+ other: "about {{count}} hours"
295
+ },
296
+ xHours: {
297
+ one: "1 hour",
298
+ other: "{{count}} hours"
299
+ },
300
+ xDays: {
301
+ one: "1 day",
302
+ other: "{{count}} days"
303
+ },
304
+ aboutXWeeks: {
305
+ one: "about 1 week",
306
+ other: "about {{count}} weeks"
307
+ },
308
+ xWeeks: {
309
+ one: "1 week",
310
+ other: "{{count}} weeks"
311
+ },
312
+ aboutXMonths: {
313
+ one: "about 1 month",
314
+ other: "about {{count}} months"
315
+ },
316
+ xMonths: {
317
+ one: "1 month",
318
+ other: "{{count}} months"
319
+ },
320
+ aboutXYears: {
321
+ one: "about 1 year",
322
+ other: "about {{count}} years"
323
+ },
324
+ xYears: {
325
+ one: "1 year",
326
+ other: "{{count}} years"
327
+ },
328
+ overXYears: {
329
+ one: "over 1 year",
330
+ other: "over {{count}} years"
331
+ },
332
+ almostXYears: {
333
+ one: "almost 1 year",
334
+ other: "almost {{count}} years"
335
+ }
336
+ };
337
+ var formatDistance = (token, count, options) => {
338
+ let result;
339
+ const tokenValue = formatDistanceLocale[token];
340
+ if (typeof tokenValue === "string") result = tokenValue;
341
+ else if (count === 1) result = tokenValue.one;
342
+ else result = tokenValue.other.replace("{{count}}", count.toString());
343
+ if (options?.addSuffix) if (options.comparison && options.comparison > 0) return "in " + result;
344
+ else return result + " ago";
345
+ return result;
346
+ };
347
+ //#endregion
348
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
349
+ function buildFormatLongFn(args) {
350
+ return (options = {}) => {
351
+ const width = options.width ? String(options.width) : args.defaultWidth;
352
+ return args.formats[width] || args.formats[args.defaultWidth];
353
+ };
354
+ }
355
+ var formatLong = {
356
+ date: buildFormatLongFn({
357
+ formats: {
358
+ full: "EEEE, MMMM do, y",
359
+ long: "MMMM do, y",
360
+ medium: "MMM d, y",
361
+ short: "MM/dd/yyyy"
362
+ },
363
+ defaultWidth: "full"
364
+ }),
365
+ time: buildFormatLongFn({
366
+ formats: {
367
+ full: "h:mm:ss a zzzz",
368
+ long: "h:mm:ss a z",
369
+ medium: "h:mm:ss a",
370
+ short: "h:mm a"
371
+ },
372
+ defaultWidth: "full"
373
+ }),
374
+ dateTime: buildFormatLongFn({
375
+ formats: {
376
+ full: "{{date}} 'at' {{time}}",
377
+ long: "{{date}} 'at' {{time}}",
378
+ medium: "{{date}}, {{time}}",
379
+ short: "{{date}}, {{time}}"
380
+ },
381
+ defaultWidth: "full"
382
+ })
383
+ };
384
+ //#endregion
385
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
386
+ var formatRelativeLocale = {
387
+ lastWeek: "'last' eeee 'at' p",
388
+ yesterday: "'yesterday at' p",
389
+ today: "'today at' p",
390
+ tomorrow: "'tomorrow at' p",
391
+ nextWeek: "eeee 'at' p",
392
+ other: "P"
393
+ };
394
+ var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
395
+ //#endregion
396
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
397
+ /**
398
+ * The localize function argument callback which allows to convert raw value to
399
+ * the actual type.
400
+ *
401
+ * @param value - The value to convert
402
+ *
403
+ * @returns The converted value
404
+ */
405
+ /**
406
+ * The map of localized values for each width.
407
+ */
408
+ /**
409
+ * The index type of the locale unit value. It types conversion of units of
410
+ * values that don't start at 0 (i.e. quarters).
411
+ */
412
+ /**
413
+ * Converts the unit value to the tuple of values.
414
+ */
415
+ /**
416
+ * The tuple of localized era values. The first element represents BC,
417
+ * the second element represents AD.
418
+ */
419
+ /**
420
+ * The tuple of localized quarter values. The first element represents Q1.
421
+ */
422
+ /**
423
+ * The tuple of localized day values. The first element represents Sunday.
424
+ */
425
+ /**
426
+ * The tuple of localized month values. The first element represents January.
427
+ */
428
+ function buildLocalizeFn(args) {
429
+ return (value, options) => {
430
+ const context = options?.context ? String(options.context) : "standalone";
431
+ let valuesArray;
432
+ if (context === "formatting" && args.formattingValues) {
433
+ const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
434
+ const width = options?.width ? String(options.width) : defaultWidth;
435
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
436
+ } else {
437
+ const defaultWidth = args.defaultWidth;
438
+ const width = options?.width ? String(options.width) : args.defaultWidth;
439
+ valuesArray = args.values[width] || args.values[defaultWidth];
440
+ }
441
+ const index = args.argumentCallback ? args.argumentCallback(value) : value;
442
+ return valuesArray[index];
443
+ };
444
+ }
445
+ //#endregion
446
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
447
+ var eraValues = {
448
+ narrow: ["B", "A"],
449
+ abbreviated: ["BC", "AD"],
450
+ wide: ["Before Christ", "Anno Domini"]
451
+ };
452
+ var quarterValues = {
453
+ narrow: [
454
+ "1",
455
+ "2",
456
+ "3",
457
+ "4"
458
+ ],
459
+ abbreviated: [
460
+ "Q1",
461
+ "Q2",
462
+ "Q3",
463
+ "Q4"
464
+ ],
465
+ wide: [
466
+ "1st quarter",
467
+ "2nd quarter",
468
+ "3rd quarter",
469
+ "4th quarter"
470
+ ]
471
+ };
472
+ var monthValues = {
473
+ narrow: [
474
+ "J",
475
+ "F",
476
+ "M",
477
+ "A",
478
+ "M",
479
+ "J",
480
+ "J",
481
+ "A",
482
+ "S",
483
+ "O",
484
+ "N",
485
+ "D"
486
+ ],
487
+ abbreviated: [
488
+ "Jan",
489
+ "Feb",
490
+ "Mar",
491
+ "Apr",
492
+ "May",
493
+ "Jun",
494
+ "Jul",
495
+ "Aug",
496
+ "Sep",
497
+ "Oct",
498
+ "Nov",
499
+ "Dec"
500
+ ],
501
+ wide: [
502
+ "January",
503
+ "February",
504
+ "March",
505
+ "April",
506
+ "May",
507
+ "June",
508
+ "July",
509
+ "August",
510
+ "September",
511
+ "October",
512
+ "November",
513
+ "December"
514
+ ]
515
+ };
516
+ var dayValues = {
517
+ narrow: [
518
+ "S",
519
+ "M",
520
+ "T",
521
+ "W",
522
+ "T",
523
+ "F",
524
+ "S"
525
+ ],
526
+ short: [
527
+ "Su",
528
+ "Mo",
529
+ "Tu",
530
+ "We",
531
+ "Th",
532
+ "Fr",
533
+ "Sa"
534
+ ],
535
+ abbreviated: [
536
+ "Sun",
537
+ "Mon",
538
+ "Tue",
539
+ "Wed",
540
+ "Thu",
541
+ "Fri",
542
+ "Sat"
543
+ ],
544
+ wide: [
545
+ "Sunday",
546
+ "Monday",
547
+ "Tuesday",
548
+ "Wednesday",
549
+ "Thursday",
550
+ "Friday",
551
+ "Saturday"
552
+ ]
553
+ };
554
+ var dayPeriodValues = {
555
+ narrow: {
556
+ am: "a",
557
+ pm: "p",
558
+ midnight: "mi",
559
+ noon: "n",
560
+ morning: "morning",
561
+ afternoon: "afternoon",
562
+ evening: "evening",
563
+ night: "night"
564
+ },
565
+ abbreviated: {
566
+ am: "AM",
567
+ pm: "PM",
568
+ midnight: "midnight",
569
+ noon: "noon",
570
+ morning: "morning",
571
+ afternoon: "afternoon",
572
+ evening: "evening",
573
+ night: "night"
574
+ },
575
+ wide: {
576
+ am: "a.m.",
577
+ pm: "p.m.",
578
+ midnight: "midnight",
579
+ noon: "noon",
580
+ morning: "morning",
581
+ afternoon: "afternoon",
582
+ evening: "evening",
583
+ night: "night"
584
+ }
585
+ };
586
+ var formattingDayPeriodValues = {
587
+ narrow: {
588
+ am: "a",
589
+ pm: "p",
590
+ midnight: "mi",
591
+ noon: "n",
592
+ morning: "in the morning",
593
+ afternoon: "in the afternoon",
594
+ evening: "in the evening",
595
+ night: "at night"
596
+ },
597
+ abbreviated: {
598
+ am: "AM",
599
+ pm: "PM",
600
+ midnight: "midnight",
601
+ noon: "noon",
602
+ morning: "in the morning",
603
+ afternoon: "in the afternoon",
604
+ evening: "in the evening",
605
+ night: "at night"
606
+ },
607
+ wide: {
608
+ am: "a.m.",
609
+ pm: "p.m.",
610
+ midnight: "midnight",
611
+ noon: "noon",
612
+ morning: "in the morning",
613
+ afternoon: "in the afternoon",
614
+ evening: "in the evening",
615
+ night: "at night"
616
+ }
617
+ };
618
+ var ordinalNumber = (dirtyNumber, _options) => {
619
+ const number = Number(dirtyNumber);
620
+ const rem100 = number % 100;
621
+ if (rem100 > 20 || rem100 < 10) switch (rem100 % 10) {
622
+ case 1: return number + "st";
623
+ case 2: return number + "nd";
624
+ case 3: return number + "rd";
625
+ }
626
+ return number + "th";
627
+ };
628
+ var localize = {
629
+ ordinalNumber,
630
+ era: buildLocalizeFn({
631
+ values: eraValues,
632
+ defaultWidth: "wide"
633
+ }),
634
+ quarter: buildLocalizeFn({
635
+ values: quarterValues,
636
+ defaultWidth: "wide",
637
+ argumentCallback: (quarter) => quarter - 1
638
+ }),
639
+ month: buildLocalizeFn({
640
+ values: monthValues,
641
+ defaultWidth: "wide"
642
+ }),
643
+ day: buildLocalizeFn({
644
+ values: dayValues,
645
+ defaultWidth: "wide"
646
+ }),
647
+ dayPeriod: buildLocalizeFn({
648
+ values: dayPeriodValues,
649
+ defaultWidth: "wide",
650
+ formattingValues: formattingDayPeriodValues,
651
+ defaultFormattingWidth: "wide"
652
+ })
653
+ };
654
+ //#endregion
655
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
656
+ function buildMatchFn(args) {
657
+ return (string, options = {}) => {
658
+ const width = options.width;
659
+ const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
660
+ const matchResult = string.match(matchPattern);
661
+ if (!matchResult) return null;
662
+ const matchedString = matchResult[0];
663
+ const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
664
+ const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : findKey(parsePatterns, (pattern) => pattern.test(matchedString));
665
+ let value;
666
+ value = args.valueCallback ? args.valueCallback(key) : key;
667
+ value = options.valueCallback ? options.valueCallback(value) : value;
668
+ const rest = string.slice(matchedString.length);
669
+ return {
670
+ value,
671
+ rest
672
+ };
673
+ };
674
+ }
675
+ function findKey(object, predicate) {
676
+ for (const key in object) if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) return key;
677
+ }
678
+ function findIndex(array, predicate) {
679
+ for (let key = 0; key < array.length; key++) if (predicate(array[key])) return key;
680
+ }
681
+ //#endregion
682
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
683
+ function buildMatchPatternFn(args) {
684
+ return (string, options = {}) => {
685
+ const matchResult = string.match(args.matchPattern);
686
+ if (!matchResult) return null;
687
+ const matchedString = matchResult[0];
688
+ const parseResult = string.match(args.parsePattern);
689
+ if (!parseResult) return null;
690
+ let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
691
+ value = options.valueCallback ? options.valueCallback(value) : value;
692
+ const rest = string.slice(matchedString.length);
693
+ return {
694
+ value,
695
+ rest
696
+ };
697
+ };
698
+ }
699
+ //#endregion
700
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
701
+ /**
702
+ * @category Locales
703
+ * @summary English locale (United States).
704
+ * @language English
705
+ * @iso-639-2 eng
706
+ * @author Sasha Koss [@kossnocorp](https://github.com/kossnocorp)
707
+ * @author Lesha Koss [@leshakoss](https://github.com/leshakoss)
708
+ */
709
+ var enUS = {
710
+ code: "en-US",
711
+ formatDistance,
712
+ formatLong,
713
+ formatRelative,
714
+ localize,
715
+ match: {
716
+ ordinalNumber: buildMatchPatternFn({
717
+ matchPattern: /^(\d+)(th|st|nd|rd)?/i,
718
+ parsePattern: /\d+/i,
719
+ valueCallback: (value) => parseInt(value, 10)
720
+ }),
721
+ era: buildMatchFn({
722
+ matchPatterns: {
723
+ narrow: /^(b|a)/i,
724
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
725
+ wide: /^(before christ|before common era|anno domini|common era)/i
726
+ },
727
+ defaultMatchWidth: "wide",
728
+ parsePatterns: { any: [/^b/i, /^(a|c)/i] },
729
+ defaultParseWidth: "any"
730
+ }),
731
+ quarter: buildMatchFn({
732
+ matchPatterns: {
733
+ narrow: /^[1234]/i,
734
+ abbreviated: /^q[1234]/i,
735
+ wide: /^[1234](th|st|nd|rd)? quarter/i
736
+ },
737
+ defaultMatchWidth: "wide",
738
+ parsePatterns: { any: [
739
+ /1/i,
740
+ /2/i,
741
+ /3/i,
742
+ /4/i
743
+ ] },
744
+ defaultParseWidth: "any",
745
+ valueCallback: (index) => index + 1
746
+ }),
747
+ month: buildMatchFn({
748
+ matchPatterns: {
749
+ narrow: /^[jfmasond]/i,
750
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
751
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
752
+ },
753
+ defaultMatchWidth: "wide",
754
+ parsePatterns: {
755
+ narrow: [
756
+ /^j/i,
757
+ /^f/i,
758
+ /^m/i,
759
+ /^a/i,
760
+ /^m/i,
761
+ /^j/i,
762
+ /^j/i,
763
+ /^a/i,
764
+ /^s/i,
765
+ /^o/i,
766
+ /^n/i,
767
+ /^d/i
768
+ ],
769
+ any: [
770
+ /^ja/i,
771
+ /^f/i,
772
+ /^mar/i,
773
+ /^ap/i,
774
+ /^may/i,
775
+ /^jun/i,
776
+ /^jul/i,
777
+ /^au/i,
778
+ /^s/i,
779
+ /^o/i,
780
+ /^n/i,
781
+ /^d/i
782
+ ]
783
+ },
784
+ defaultParseWidth: "any"
785
+ }),
786
+ day: buildMatchFn({
787
+ matchPatterns: {
788
+ narrow: /^[smtwf]/i,
789
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
790
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
791
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
792
+ },
793
+ defaultMatchWidth: "wide",
794
+ parsePatterns: {
795
+ narrow: [
796
+ /^s/i,
797
+ /^m/i,
798
+ /^t/i,
799
+ /^w/i,
800
+ /^t/i,
801
+ /^f/i,
802
+ /^s/i
803
+ ],
804
+ any: [
805
+ /^su/i,
806
+ /^m/i,
807
+ /^tu/i,
808
+ /^w/i,
809
+ /^th/i,
810
+ /^f/i,
811
+ /^sa/i
812
+ ]
813
+ },
814
+ defaultParseWidth: "any"
815
+ }),
816
+ dayPeriod: buildMatchFn({
817
+ matchPatterns: {
818
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
819
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
820
+ },
821
+ defaultMatchWidth: "any",
822
+ parsePatterns: { any: {
823
+ am: /^a/i,
824
+ pm: /^p/i,
825
+ midnight: /^mi/i,
826
+ noon: /^no/i,
827
+ morning: /morning/i,
828
+ afternoon: /afternoon/i,
829
+ evening: /evening/i,
830
+ night: /night/i
831
+ } },
832
+ defaultParseWidth: "any"
833
+ })
834
+ },
835
+ options: {
836
+ weekStartsOn: 0,
837
+ firstWeekContainsDate: 1
838
+ }
839
+ };
840
+ //#endregion
841
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
842
+ var defaultOptions = {};
843
+ function getDefaultOptions$1() {
844
+ return defaultOptions;
845
+ }
846
+ //#endregion
847
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
848
+ /**
849
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
850
+ * They usually appear for dates that denote time before the timezones were introduced
851
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
852
+ * and GMT+01:00:00 after that date)
853
+ *
854
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
855
+ * which would lead to incorrect calculations.
856
+ *
857
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
858
+ */
859
+ function getTimezoneOffsetInMilliseconds(date) {
860
+ const _date = toDate(date);
861
+ const utcDate = new Date(Date.UTC(_date.getFullYear(), _date.getMonth(), _date.getDate(), _date.getHours(), _date.getMinutes(), _date.getSeconds(), _date.getMilliseconds()));
862
+ utcDate.setUTCFullYear(_date.getFullYear());
863
+ return +date - +utcDate;
864
+ }
865
+ //#endregion
866
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
867
+ function normalizeDates(context, ...dates) {
868
+ const normalize = constructFrom.bind(null, context || dates.find((date) => typeof date === "object"));
869
+ return dates.map(normalize);
870
+ }
871
+ //#endregion
872
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
873
+ /**
874
+ * The {@link startOfDay} function options.
875
+ */
876
+ /**
877
+ * @name startOfDay
878
+ * @category Day Helpers
879
+ * @summary Return the start of a day for the given date.
880
+ *
881
+ * @description
882
+ * Return the start of a day for the given date.
883
+ * The result will be in the local timezone.
884
+ *
885
+ * @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).
886
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
887
+ *
888
+ * @param date - The original date
889
+ * @param options - The options
890
+ *
891
+ * @returns The start of a day
892
+ *
893
+ * @example
894
+ * // The start of a day for 2 September 2014 11:55:00:
895
+ * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))
896
+ * //=> Tue Sep 02 2014 00:00:00
897
+ */
898
+ function startOfDay(date, options) {
899
+ const _date = toDate(date, options?.in);
900
+ _date.setHours(0, 0, 0, 0);
901
+ return _date;
902
+ }
903
+ //#endregion
904
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
905
+ /**
906
+ * The {@link differenceInCalendarDays} function options.
907
+ */
908
+ /**
909
+ * @name differenceInCalendarDays
910
+ * @category Day Helpers
911
+ * @summary Get the number of calendar days between the given dates.
912
+ *
913
+ * @description
914
+ * Get the number of calendar days between the given dates. This means that the times are removed
915
+ * from the dates and then the difference in days is calculated.
916
+ *
917
+ * @param laterDate - The later date
918
+ * @param earlierDate - The earlier date
919
+ * @param options - The options object
920
+ *
921
+ * @returns The number of calendar days
922
+ *
923
+ * @example
924
+ * // How many calendar days are between
925
+ * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?
926
+ * const result = differenceInCalendarDays(
927
+ * new Date(2012, 6, 2, 0, 0),
928
+ * new Date(2011, 6, 2, 23, 0)
929
+ * )
930
+ * //=> 366
931
+ * // How many calendar days are between
932
+ * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?
933
+ * const result = differenceInCalendarDays(
934
+ * new Date(2011, 6, 3, 0, 1),
935
+ * new Date(2011, 6, 2, 23, 59)
936
+ * )
937
+ * //=> 1
938
+ */
939
+ function differenceInCalendarDays(laterDate, earlierDate, options) {
940
+ const [laterDate_, earlierDate_] = normalizeDates(options?.in, laterDate, earlierDate);
941
+ const laterStartOfDay = startOfDay(laterDate_);
942
+ const earlierStartOfDay = startOfDay(earlierDate_);
943
+ const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
944
+ const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
945
+ return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
946
+ }
947
+ //#endregion
948
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js
949
+ /**
950
+ * The {@link startOfYear} function options.
951
+ */
952
+ /**
953
+ * @name startOfYear
954
+ * @category Year Helpers
955
+ * @summary Return the start of a year for the given date.
956
+ *
957
+ * @description
958
+ * Return the start of a year for the given date.
959
+ * The result will be in the local timezone.
960
+ *
961
+ * @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).
962
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
963
+ *
964
+ * @param date - The original date
965
+ * @param options - The options
966
+ *
967
+ * @returns The start of a year
968
+ *
969
+ * @example
970
+ * // The start of a year for 2 September 2014 11:55:00:
971
+ * const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
972
+ * //=> Wed Jan 01 2014 00:00:00
973
+ */
974
+ function startOfYear(date, options) {
975
+ const date_ = toDate(date, options?.in);
976
+ date_.setFullYear(date_.getFullYear(), 0, 1);
977
+ date_.setHours(0, 0, 0, 0);
978
+ return date_;
979
+ }
980
+ //#endregion
981
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js
982
+ /**
983
+ * The {@link getDayOfYear} function options.
984
+ */
985
+ /**
986
+ * @name getDayOfYear
987
+ * @category Day Helpers
988
+ * @summary Get the day of the year of the given date.
989
+ *
990
+ * @description
991
+ * Get the day of the year of the given date.
992
+ *
993
+ * @param date - The given date
994
+ * @param options - The options
995
+ *
996
+ * @returns The day of year
997
+ *
998
+ * @example
999
+ * // Which day of the year is 2 July 2014?
1000
+ * const result = getDayOfYear(new Date(2014, 6, 2))
1001
+ * //=> 183
1002
+ */
1003
+ function getDayOfYear(date, options) {
1004
+ const _date = toDate(date, options?.in);
1005
+ return differenceInCalendarDays(_date, startOfYear(_date)) + 1;
1006
+ }
1007
+ //#endregion
1008
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
1009
+ /**
1010
+ * The {@link startOfWeek} function options.
1011
+ */
1012
+ /**
1013
+ * @name startOfWeek
1014
+ * @category Week Helpers
1015
+ * @summary Return the start of a week for the given date.
1016
+ *
1017
+ * @description
1018
+ * Return the start of a week for the given date.
1019
+ * The result will be in the local timezone.
1020
+ *
1021
+ * @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).
1022
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1023
+ *
1024
+ * @param date - The original date
1025
+ * @param options - An object with options
1026
+ *
1027
+ * @returns The start of a week
1028
+ *
1029
+ * @example
1030
+ * // The start of a week for 2 September 2014 11:55:00:
1031
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))
1032
+ * //=> Sun Aug 31 2014 00:00:00
1033
+ *
1034
+ * @example
1035
+ * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:
1036
+ * const result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), { weekStartsOn: 1 })
1037
+ * //=> Mon Sep 01 2014 00:00:00
1038
+ */
1039
+ function startOfWeek(date, options) {
1040
+ const defaultOptions = getDefaultOptions$1();
1041
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
1042
+ const _date = toDate(date, options?.in);
1043
+ const day = _date.getDay();
1044
+ const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1045
+ _date.setDate(_date.getDate() - diff);
1046
+ _date.setHours(0, 0, 0, 0);
1047
+ return _date;
1048
+ }
1049
+ //#endregion
1050
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
1051
+ /**
1052
+ * The {@link startOfISOWeek} function options.
1053
+ */
1054
+ /**
1055
+ * @name startOfISOWeek
1056
+ * @category ISO Week Helpers
1057
+ * @summary Return the start of an ISO week for the given date.
1058
+ *
1059
+ * @description
1060
+ * Return the start of an ISO week for the given date.
1061
+ * The result will be in the local timezone.
1062
+ *
1063
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1064
+ *
1065
+ * @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).
1066
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1067
+ *
1068
+ * @param date - The original date
1069
+ * @param options - An object with options
1070
+ *
1071
+ * @returns The start of an ISO week
1072
+ *
1073
+ * @example
1074
+ * // The start of an ISO week for 2 September 2014 11:55:00:
1075
+ * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))
1076
+ * //=> Mon Sep 01 2014 00:00:00
1077
+ */
1078
+ function startOfISOWeek(date, options) {
1079
+ return startOfWeek(date, {
1080
+ ...options,
1081
+ weekStartsOn: 1
1082
+ });
1083
+ }
1084
+ //#endregion
1085
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
1086
+ /**
1087
+ * The {@link getISOWeekYear} function options.
1088
+ */
1089
+ /**
1090
+ * @name getISOWeekYear
1091
+ * @category ISO Week-Numbering Year Helpers
1092
+ * @summary Get the ISO week-numbering year of the given date.
1093
+ *
1094
+ * @description
1095
+ * Get the ISO week-numbering year of the given date,
1096
+ * which always starts 3 days before the year's first Thursday.
1097
+ *
1098
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1099
+ *
1100
+ * @param date - The given date
1101
+ *
1102
+ * @returns The ISO week-numbering year
1103
+ *
1104
+ * @example
1105
+ * // Which ISO-week numbering year is 2 January 2005?
1106
+ * const result = getISOWeekYear(new Date(2005, 0, 2))
1107
+ * //=> 2004
1108
+ */
1109
+ function getISOWeekYear(date, options) {
1110
+ const _date = toDate(date, options?.in);
1111
+ const year = _date.getFullYear();
1112
+ const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
1113
+ fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
1114
+ fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
1115
+ const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
1116
+ const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
1117
+ fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
1118
+ fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
1119
+ const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
1120
+ if (_date.getTime() >= startOfNextYear.getTime()) return year + 1;
1121
+ else if (_date.getTime() >= startOfThisYear.getTime()) return year;
1122
+ else return year - 1;
1123
+ }
1124
+ //#endregion
1125
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
1126
+ /**
1127
+ * The {@link startOfISOWeekYear} function options.
1128
+ */
1129
+ /**
1130
+ * @name startOfISOWeekYear
1131
+ * @category ISO Week-Numbering Year Helpers
1132
+ * @summary Return the start of an ISO week-numbering year for the given date.
1133
+ *
1134
+ * @description
1135
+ * Return the start of an ISO week-numbering year,
1136
+ * which always starts 3 days before the year's first Thursday.
1137
+ * The result will be in the local timezone.
1138
+ *
1139
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1140
+ *
1141
+ * @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).
1142
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
1143
+ *
1144
+ * @param date - The original date
1145
+ * @param options - An object with options
1146
+ *
1147
+ * @returns The start of an ISO week-numbering year
1148
+ *
1149
+ * @example
1150
+ * // The start of an ISO week-numbering year for 2 July 2005:
1151
+ * const result = startOfISOWeekYear(new Date(2005, 6, 2))
1152
+ * //=> Mon Jan 03 2005 00:00:00
1153
+ */
1154
+ function startOfISOWeekYear(date, options) {
1155
+ const year = getISOWeekYear(date, options);
1156
+ const fourthOfJanuary = constructFrom(options?.in || date, 0);
1157
+ fourthOfJanuary.setFullYear(year, 0, 4);
1158
+ fourthOfJanuary.setHours(0, 0, 0, 0);
1159
+ return startOfISOWeek(fourthOfJanuary);
1160
+ }
1161
+ //#endregion
1162
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js
1163
+ /**
1164
+ * The {@link getISOWeek} function options.
1165
+ */
1166
+ /**
1167
+ * @name getISOWeek
1168
+ * @category ISO Week Helpers
1169
+ * @summary Get the ISO week of the given date.
1170
+ *
1171
+ * @description
1172
+ * Get the ISO week of the given date.
1173
+ *
1174
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
1175
+ *
1176
+ * @param date - The given date
1177
+ * @param options - The options
1178
+ *
1179
+ * @returns The ISO week
1180
+ *
1181
+ * @example
1182
+ * // Which week of the ISO-week numbering year is 2 January 2005?
1183
+ * const result = getISOWeek(new Date(2005, 0, 2))
1184
+ * //=> 53
1185
+ */
1186
+ function getISOWeek(date, options) {
1187
+ const _date = toDate(date, options?.in);
1188
+ const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
1189
+ return Math.round(diff / millisecondsInWeek) + 1;
1190
+ }
1191
+ //#endregion
1192
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js
1193
+ /**
1194
+ * The {@link getWeekYear} function options.
1195
+ */
1196
+ /**
1197
+ * @name getWeekYear
1198
+ * @category Week-Numbering Year Helpers
1199
+ * @summary Get the local week-numbering year of the given date.
1200
+ *
1201
+ * @description
1202
+ * Get the local week-numbering year of the given date.
1203
+ * The exact calculation depends on the values of
1204
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1205
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1206
+ * the first week of the week-numbering year)
1207
+ *
1208
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1209
+ *
1210
+ * @param date - The given date
1211
+ * @param options - An object with options.
1212
+ *
1213
+ * @returns The local week-numbering year
1214
+ *
1215
+ * @example
1216
+ * // Which week numbering year is 26 December 2004 with the default settings?
1217
+ * const result = getWeekYear(new Date(2004, 11, 26))
1218
+ * //=> 2005
1219
+ *
1220
+ * @example
1221
+ * // Which week numbering year is 26 December 2004 if week starts on Saturday?
1222
+ * const result = getWeekYear(new Date(2004, 11, 26), { weekStartsOn: 6 })
1223
+ * //=> 2004
1224
+ *
1225
+ * @example
1226
+ * // Which week numbering year is 26 December 2004 if the first week contains 4 January?
1227
+ * const result = getWeekYear(new Date(2004, 11, 26), { firstWeekContainsDate: 4 })
1228
+ * //=> 2004
1229
+ */
1230
+ function getWeekYear(date, options) {
1231
+ const _date = toDate(date, options?.in);
1232
+ const year = _date.getFullYear();
1233
+ const defaultOptions = getDefaultOptions$1();
1234
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1235
+ const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
1236
+ firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
1237
+ firstWeekOfNextYear.setHours(0, 0, 0, 0);
1238
+ const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
1239
+ const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
1240
+ firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
1241
+ firstWeekOfThisYear.setHours(0, 0, 0, 0);
1242
+ const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
1243
+ if (+_date >= +startOfNextYear) return year + 1;
1244
+ else if (+_date >= +startOfThisYear) return year;
1245
+ else return year - 1;
1246
+ }
1247
+ //#endregion
1248
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js
1249
+ /**
1250
+ * The {@link startOfWeekYear} function options.
1251
+ */
1252
+ /**
1253
+ * @name startOfWeekYear
1254
+ * @category Week-Numbering Year Helpers
1255
+ * @summary Return the start of a local week-numbering year for the given date.
1256
+ *
1257
+ * @description
1258
+ * Return the start of a local week-numbering year.
1259
+ * The exact calculation depends on the values of
1260
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1261
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1262
+ * the first week of the week-numbering year)
1263
+ *
1264
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1265
+ *
1266
+ * @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).
1267
+ * @typeParam ResultDate - The result `Date` type.
1268
+ *
1269
+ * @param date - The original date
1270
+ * @param options - An object with options
1271
+ *
1272
+ * @returns The start of a week-numbering year
1273
+ *
1274
+ * @example
1275
+ * // The start of an a week-numbering year for 2 July 2005 with default settings:
1276
+ * const result = startOfWeekYear(new Date(2005, 6, 2))
1277
+ * //=> Sun Dec 26 2004 00:00:00
1278
+ *
1279
+ * @example
1280
+ * // The start of a week-numbering year for 2 July 2005
1281
+ * // if Monday is the first day of week
1282
+ * // and 4 January is always in the first week of the year:
1283
+ * const result = startOfWeekYear(new Date(2005, 6, 2), {
1284
+ * weekStartsOn: 1,
1285
+ * firstWeekContainsDate: 4
1286
+ * })
1287
+ * //=> Mon Jan 03 2005 00:00:00
1288
+ */
1289
+ function startOfWeekYear(date, options) {
1290
+ const defaultOptions = getDefaultOptions$1();
1291
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
1292
+ const year = getWeekYear(date, options);
1293
+ const firstWeek = constructFrom(options?.in || date, 0);
1294
+ firstWeek.setFullYear(year, 0, firstWeekContainsDate);
1295
+ firstWeek.setHours(0, 0, 0, 0);
1296
+ return startOfWeek(firstWeek, options);
1297
+ }
1298
+ //#endregion
1299
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js
1300
+ /**
1301
+ * The {@link getWeek} function options.
1302
+ */
1303
+ /**
1304
+ * @name getWeek
1305
+ * @category Week Helpers
1306
+ * @summary Get the local week index of the given date.
1307
+ *
1308
+ * @description
1309
+ * Get the local week index of the given date.
1310
+ * The exact calculation depends on the values of
1311
+ * `options.weekStartsOn` (which is the index of the first day of the week)
1312
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
1313
+ * the first week of the week-numbering year)
1314
+ *
1315
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
1316
+ *
1317
+ * @param date - The given date
1318
+ * @param options - An object with options
1319
+ *
1320
+ * @returns The week
1321
+ *
1322
+ * @example
1323
+ * // Which week of the local week numbering year is 2 January 2005 with default options?
1324
+ * const result = getWeek(new Date(2005, 0, 2))
1325
+ * //=> 2
1326
+ *
1327
+ * @example
1328
+ * // Which week of the local week numbering year is 2 January 2005,
1329
+ * // if Monday is the first day of the week,
1330
+ * // and the first week of the year always contains 4 January?
1331
+ * const result = getWeek(new Date(2005, 0, 2), {
1332
+ * weekStartsOn: 1,
1333
+ * firstWeekContainsDate: 4
1334
+ * })
1335
+ * //=> 53
1336
+ */
1337
+ function getWeek(date, options) {
1338
+ const _date = toDate(date, options?.in);
1339
+ const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
1340
+ return Math.round(diff / millisecondsInWeek) + 1;
1341
+ }
1342
+ //#endregion
1343
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js
1344
+ var lightFormatters = {
1345
+ y(date, token) {
1346
+ const signedYear = date.getFullYear();
1347
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1348
+ return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
1349
+ },
1350
+ M(date, token) {
1351
+ const month = date.getMonth();
1352
+ return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
1353
+ },
1354
+ d(date, token) {
1355
+ return addLeadingZeros(date.getDate(), token.length);
1356
+ },
1357
+ a(date, token) {
1358
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1359
+ switch (token) {
1360
+ case "a":
1361
+ case "aa": return dayPeriodEnumValue.toUpperCase();
1362
+ case "aaa": return dayPeriodEnumValue;
1363
+ case "aaaaa": return dayPeriodEnumValue[0];
1364
+ default: return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
1365
+ }
1366
+ },
1367
+ h(date, token) {
1368
+ return addLeadingZeros(date.getHours() % 12 || 12, token.length);
1369
+ },
1370
+ H(date, token) {
1371
+ return addLeadingZeros(date.getHours(), token.length);
1372
+ },
1373
+ m(date, token) {
1374
+ return addLeadingZeros(date.getMinutes(), token.length);
1375
+ },
1376
+ s(date, token) {
1377
+ return addLeadingZeros(date.getSeconds(), token.length);
1378
+ },
1379
+ S(date, token) {
1380
+ const numberOfDigits = token.length;
1381
+ const milliseconds = date.getMilliseconds();
1382
+ return addLeadingZeros(Math.trunc(milliseconds * Math.pow(10, numberOfDigits - 3)), token.length);
1383
+ }
1384
+ };
1385
+ //#endregion
1386
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js
1387
+ var dayPeriodEnum = {
1388
+ am: "am",
1389
+ pm: "pm",
1390
+ midnight: "midnight",
1391
+ noon: "noon",
1392
+ morning: "morning",
1393
+ afternoon: "afternoon",
1394
+ evening: "evening",
1395
+ night: "night"
1396
+ };
1397
+ var formatters = {
1398
+ G: function(date, token, localize) {
1399
+ const era = date.getFullYear() > 0 ? 1 : 0;
1400
+ switch (token) {
1401
+ case "G":
1402
+ case "GG":
1403
+ case "GGG": return localize.era(era, { width: "abbreviated" });
1404
+ case "GGGGG": return localize.era(era, { width: "narrow" });
1405
+ default: return localize.era(era, { width: "wide" });
1406
+ }
1407
+ },
1408
+ y: function(date, token, localize) {
1409
+ if (token === "yo") {
1410
+ const signedYear = date.getFullYear();
1411
+ const year = signedYear > 0 ? signedYear : 1 - signedYear;
1412
+ return localize.ordinalNumber(year, { unit: "year" });
1413
+ }
1414
+ return lightFormatters.y(date, token);
1415
+ },
1416
+ Y: function(date, token, localize, options) {
1417
+ const signedWeekYear = getWeekYear(date, options);
1418
+ const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
1419
+ if (token === "YY") return addLeadingZeros(weekYear % 100, 2);
1420
+ if (token === "Yo") return localize.ordinalNumber(weekYear, { unit: "year" });
1421
+ return addLeadingZeros(weekYear, token.length);
1422
+ },
1423
+ R: function(date, token) {
1424
+ return addLeadingZeros(getISOWeekYear(date), token.length);
1425
+ },
1426
+ u: function(date, token) {
1427
+ return addLeadingZeros(date.getFullYear(), token.length);
1428
+ },
1429
+ Q: function(date, token, localize) {
1430
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1431
+ switch (token) {
1432
+ case "Q": return String(quarter);
1433
+ case "QQ": return addLeadingZeros(quarter, 2);
1434
+ case "Qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1435
+ case "QQQ": return localize.quarter(quarter, {
1436
+ width: "abbreviated",
1437
+ context: "formatting"
1438
+ });
1439
+ case "QQQQQ": return localize.quarter(quarter, {
1440
+ width: "narrow",
1441
+ context: "formatting"
1442
+ });
1443
+ default: return localize.quarter(quarter, {
1444
+ width: "wide",
1445
+ context: "formatting"
1446
+ });
1447
+ }
1448
+ },
1449
+ q: function(date, token, localize) {
1450
+ const quarter = Math.ceil((date.getMonth() + 1) / 3);
1451
+ switch (token) {
1452
+ case "q": return String(quarter);
1453
+ case "qq": return addLeadingZeros(quarter, 2);
1454
+ case "qo": return localize.ordinalNumber(quarter, { unit: "quarter" });
1455
+ case "qqq": return localize.quarter(quarter, {
1456
+ width: "abbreviated",
1457
+ context: "standalone"
1458
+ });
1459
+ case "qqqqq": return localize.quarter(quarter, {
1460
+ width: "narrow",
1461
+ context: "standalone"
1462
+ });
1463
+ default: return localize.quarter(quarter, {
1464
+ width: "wide",
1465
+ context: "standalone"
1466
+ });
1467
+ }
1468
+ },
1469
+ M: function(date, token, localize) {
1470
+ const month = date.getMonth();
1471
+ switch (token) {
1472
+ case "M":
1473
+ case "MM": return lightFormatters.M(date, token);
1474
+ case "Mo": return localize.ordinalNumber(month + 1, { unit: "month" });
1475
+ case "MMM": return localize.month(month, {
1476
+ width: "abbreviated",
1477
+ context: "formatting"
1478
+ });
1479
+ case "MMMMM": return localize.month(month, {
1480
+ width: "narrow",
1481
+ context: "formatting"
1482
+ });
1483
+ default: return localize.month(month, {
1484
+ width: "wide",
1485
+ context: "formatting"
1486
+ });
1487
+ }
1488
+ },
1489
+ L: function(date, token, localize) {
1490
+ const month = date.getMonth();
1491
+ switch (token) {
1492
+ case "L": return String(month + 1);
1493
+ case "LL": return addLeadingZeros(month + 1, 2);
1494
+ case "Lo": return localize.ordinalNumber(month + 1, { unit: "month" });
1495
+ case "LLL": return localize.month(month, {
1496
+ width: "abbreviated",
1497
+ context: "standalone"
1498
+ });
1499
+ case "LLLLL": return localize.month(month, {
1500
+ width: "narrow",
1501
+ context: "standalone"
1502
+ });
1503
+ default: return localize.month(month, {
1504
+ width: "wide",
1505
+ context: "standalone"
1506
+ });
1507
+ }
1508
+ },
1509
+ w: function(date, token, localize, options) {
1510
+ const week = getWeek(date, options);
1511
+ if (token === "wo") return localize.ordinalNumber(week, { unit: "week" });
1512
+ return addLeadingZeros(week, token.length);
1513
+ },
1514
+ I: function(date, token, localize) {
1515
+ const isoWeek = getISOWeek(date);
1516
+ if (token === "Io") return localize.ordinalNumber(isoWeek, { unit: "week" });
1517
+ return addLeadingZeros(isoWeek, token.length);
1518
+ },
1519
+ d: function(date, token, localize) {
1520
+ if (token === "do") return localize.ordinalNumber(date.getDate(), { unit: "date" });
1521
+ return lightFormatters.d(date, token);
1522
+ },
1523
+ D: function(date, token, localize) {
1524
+ const dayOfYear = getDayOfYear(date);
1525
+ if (token === "Do") return localize.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
1526
+ return addLeadingZeros(dayOfYear, token.length);
1527
+ },
1528
+ E: function(date, token, localize) {
1529
+ const dayOfWeek = date.getDay();
1530
+ switch (token) {
1531
+ case "E":
1532
+ case "EE":
1533
+ case "EEE": return localize.day(dayOfWeek, {
1534
+ width: "abbreviated",
1535
+ context: "formatting"
1536
+ });
1537
+ case "EEEEE": return localize.day(dayOfWeek, {
1538
+ width: "narrow",
1539
+ context: "formatting"
1540
+ });
1541
+ case "EEEEEE": return localize.day(dayOfWeek, {
1542
+ width: "short",
1543
+ context: "formatting"
1544
+ });
1545
+ default: return localize.day(dayOfWeek, {
1546
+ width: "wide",
1547
+ context: "formatting"
1548
+ });
1549
+ }
1550
+ },
1551
+ e: function(date, token, localize, options) {
1552
+ const dayOfWeek = date.getDay();
1553
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1554
+ switch (token) {
1555
+ case "e": return String(localDayOfWeek);
1556
+ case "ee": return addLeadingZeros(localDayOfWeek, 2);
1557
+ case "eo": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1558
+ case "eee": return localize.day(dayOfWeek, {
1559
+ width: "abbreviated",
1560
+ context: "formatting"
1561
+ });
1562
+ case "eeeee": return localize.day(dayOfWeek, {
1563
+ width: "narrow",
1564
+ context: "formatting"
1565
+ });
1566
+ case "eeeeee": return localize.day(dayOfWeek, {
1567
+ width: "short",
1568
+ context: "formatting"
1569
+ });
1570
+ default: return localize.day(dayOfWeek, {
1571
+ width: "wide",
1572
+ context: "formatting"
1573
+ });
1574
+ }
1575
+ },
1576
+ c: function(date, token, localize, options) {
1577
+ const dayOfWeek = date.getDay();
1578
+ const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1579
+ switch (token) {
1580
+ case "c": return String(localDayOfWeek);
1581
+ case "cc": return addLeadingZeros(localDayOfWeek, token.length);
1582
+ case "co": return localize.ordinalNumber(localDayOfWeek, { unit: "day" });
1583
+ case "ccc": return localize.day(dayOfWeek, {
1584
+ width: "abbreviated",
1585
+ context: "standalone"
1586
+ });
1587
+ case "ccccc": return localize.day(dayOfWeek, {
1588
+ width: "narrow",
1589
+ context: "standalone"
1590
+ });
1591
+ case "cccccc": return localize.day(dayOfWeek, {
1592
+ width: "short",
1593
+ context: "standalone"
1594
+ });
1595
+ default: return localize.day(dayOfWeek, {
1596
+ width: "wide",
1597
+ context: "standalone"
1598
+ });
1599
+ }
1600
+ },
1601
+ i: function(date, token, localize) {
1602
+ const dayOfWeek = date.getDay();
1603
+ const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1604
+ switch (token) {
1605
+ case "i": return String(isoDayOfWeek);
1606
+ case "ii": return addLeadingZeros(isoDayOfWeek, token.length);
1607
+ case "io": return localize.ordinalNumber(isoDayOfWeek, { unit: "day" });
1608
+ case "iii": return localize.day(dayOfWeek, {
1609
+ width: "abbreviated",
1610
+ context: "formatting"
1611
+ });
1612
+ case "iiiii": return localize.day(dayOfWeek, {
1613
+ width: "narrow",
1614
+ context: "formatting"
1615
+ });
1616
+ case "iiiiii": return localize.day(dayOfWeek, {
1617
+ width: "short",
1618
+ context: "formatting"
1619
+ });
1620
+ default: return localize.day(dayOfWeek, {
1621
+ width: "wide",
1622
+ context: "formatting"
1623
+ });
1624
+ }
1625
+ },
1626
+ a: function(date, token, localize) {
1627
+ const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
1628
+ switch (token) {
1629
+ case "a":
1630
+ case "aa": return localize.dayPeriod(dayPeriodEnumValue, {
1631
+ width: "abbreviated",
1632
+ context: "formatting"
1633
+ });
1634
+ case "aaa": return localize.dayPeriod(dayPeriodEnumValue, {
1635
+ width: "abbreviated",
1636
+ context: "formatting"
1637
+ }).toLowerCase();
1638
+ case "aaaaa": return localize.dayPeriod(dayPeriodEnumValue, {
1639
+ width: "narrow",
1640
+ context: "formatting"
1641
+ });
1642
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1643
+ width: "wide",
1644
+ context: "formatting"
1645
+ });
1646
+ }
1647
+ },
1648
+ b: function(date, token, localize) {
1649
+ const hours = date.getHours();
1650
+ let dayPeriodEnumValue;
1651
+ if (hours === 12) dayPeriodEnumValue = dayPeriodEnum.noon;
1652
+ else if (hours === 0) dayPeriodEnumValue = dayPeriodEnum.midnight;
1653
+ else dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
1654
+ switch (token) {
1655
+ case "b":
1656
+ case "bb": return localize.dayPeriod(dayPeriodEnumValue, {
1657
+ width: "abbreviated",
1658
+ context: "formatting"
1659
+ });
1660
+ case "bbb": return localize.dayPeriod(dayPeriodEnumValue, {
1661
+ width: "abbreviated",
1662
+ context: "formatting"
1663
+ }).toLowerCase();
1664
+ case "bbbbb": return localize.dayPeriod(dayPeriodEnumValue, {
1665
+ width: "narrow",
1666
+ context: "formatting"
1667
+ });
1668
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1669
+ width: "wide",
1670
+ context: "formatting"
1671
+ });
1672
+ }
1673
+ },
1674
+ B: function(date, token, localize) {
1675
+ const hours = date.getHours();
1676
+ let dayPeriodEnumValue;
1677
+ if (hours >= 17) dayPeriodEnumValue = dayPeriodEnum.evening;
1678
+ else if (hours >= 12) dayPeriodEnumValue = dayPeriodEnum.afternoon;
1679
+ else if (hours >= 4) dayPeriodEnumValue = dayPeriodEnum.morning;
1680
+ else dayPeriodEnumValue = dayPeriodEnum.night;
1681
+ switch (token) {
1682
+ case "B":
1683
+ case "BB":
1684
+ case "BBB": return localize.dayPeriod(dayPeriodEnumValue, {
1685
+ width: "abbreviated",
1686
+ context: "formatting"
1687
+ });
1688
+ case "BBBBB": return localize.dayPeriod(dayPeriodEnumValue, {
1689
+ width: "narrow",
1690
+ context: "formatting"
1691
+ });
1692
+ default: return localize.dayPeriod(dayPeriodEnumValue, {
1693
+ width: "wide",
1694
+ context: "formatting"
1695
+ });
1696
+ }
1697
+ },
1698
+ h: function(date, token, localize) {
1699
+ if (token === "ho") {
1700
+ let hours = date.getHours() % 12;
1701
+ if (hours === 0) hours = 12;
1702
+ return localize.ordinalNumber(hours, { unit: "hour" });
1703
+ }
1704
+ return lightFormatters.h(date, token);
1705
+ },
1706
+ H: function(date, token, localize) {
1707
+ if (token === "Ho") return localize.ordinalNumber(date.getHours(), { unit: "hour" });
1708
+ return lightFormatters.H(date, token);
1709
+ },
1710
+ K: function(date, token, localize) {
1711
+ const hours = date.getHours() % 12;
1712
+ if (token === "Ko") return localize.ordinalNumber(hours, { unit: "hour" });
1713
+ return addLeadingZeros(hours, token.length);
1714
+ },
1715
+ k: function(date, token, localize) {
1716
+ let hours = date.getHours();
1717
+ if (hours === 0) hours = 24;
1718
+ if (token === "ko") return localize.ordinalNumber(hours, { unit: "hour" });
1719
+ return addLeadingZeros(hours, token.length);
1720
+ },
1721
+ m: function(date, token, localize) {
1722
+ if (token === "mo") return localize.ordinalNumber(date.getMinutes(), { unit: "minute" });
1723
+ return lightFormatters.m(date, token);
1724
+ },
1725
+ s: function(date, token, localize) {
1726
+ if (token === "so") return localize.ordinalNumber(date.getSeconds(), { unit: "second" });
1727
+ return lightFormatters.s(date, token);
1728
+ },
1729
+ S: function(date, token) {
1730
+ return lightFormatters.S(date, token);
1731
+ },
1732
+ X: function(date, token, _localize) {
1733
+ const timezoneOffset = date.getTimezoneOffset();
1734
+ if (timezoneOffset === 0) return "Z";
1735
+ switch (token) {
1736
+ case "X": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1737
+ case "XXXX":
1738
+ case "XX": return formatTimezone(timezoneOffset);
1739
+ default: return formatTimezone(timezoneOffset, ":");
1740
+ }
1741
+ },
1742
+ x: function(date, token, _localize) {
1743
+ const timezoneOffset = date.getTimezoneOffset();
1744
+ switch (token) {
1745
+ case "x": return formatTimezoneWithOptionalMinutes(timezoneOffset);
1746
+ case "xxxx":
1747
+ case "xx": return formatTimezone(timezoneOffset);
1748
+ default: return formatTimezone(timezoneOffset, ":");
1749
+ }
1750
+ },
1751
+ O: function(date, token, _localize) {
1752
+ const timezoneOffset = date.getTimezoneOffset();
1753
+ switch (token) {
1754
+ case "O":
1755
+ case "OO":
1756
+ case "OOO": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1757
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1758
+ }
1759
+ },
1760
+ z: function(date, token, _localize) {
1761
+ const timezoneOffset = date.getTimezoneOffset();
1762
+ switch (token) {
1763
+ case "z":
1764
+ case "zz":
1765
+ case "zzz": return "GMT" + formatTimezoneShort(timezoneOffset, ":");
1766
+ default: return "GMT" + formatTimezone(timezoneOffset, ":");
1767
+ }
1768
+ },
1769
+ t: function(date, token, _localize) {
1770
+ return addLeadingZeros(Math.trunc(+date / 1e3), token.length);
1771
+ },
1772
+ T: function(date, token, _localize) {
1773
+ return addLeadingZeros(+date, token.length);
1774
+ }
1775
+ };
1776
+ function formatTimezoneShort(offset, delimiter = "") {
1777
+ const sign = offset > 0 ? "-" : "+";
1778
+ const absOffset = Math.abs(offset);
1779
+ const hours = Math.trunc(absOffset / 60);
1780
+ const minutes = absOffset % 60;
1781
+ if (minutes === 0) return sign + String(hours);
1782
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
1783
+ }
1784
+ function formatTimezoneWithOptionalMinutes(offset, delimiter) {
1785
+ if (offset % 60 === 0) return (offset > 0 ? "-" : "+") + addLeadingZeros(Math.abs(offset) / 60, 2);
1786
+ return formatTimezone(offset, delimiter);
1787
+ }
1788
+ function formatTimezone(offset, delimiter = "") {
1789
+ const sign = offset > 0 ? "-" : "+";
1790
+ const absOffset = Math.abs(offset);
1791
+ const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
1792
+ const minutes = addLeadingZeros(absOffset % 60, 2);
1793
+ return sign + hours + delimiter + minutes;
1794
+ }
1795
+ //#endregion
1796
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js
1797
+ var dateLongFormatter = (pattern, formatLong) => {
1798
+ switch (pattern) {
1799
+ case "P": return formatLong.date({ width: "short" });
1800
+ case "PP": return formatLong.date({ width: "medium" });
1801
+ case "PPP": return formatLong.date({ width: "long" });
1802
+ default: return formatLong.date({ width: "full" });
1803
+ }
1804
+ };
1805
+ var timeLongFormatter = (pattern, formatLong) => {
1806
+ switch (pattern) {
1807
+ case "p": return formatLong.time({ width: "short" });
1808
+ case "pp": return formatLong.time({ width: "medium" });
1809
+ case "ppp": return formatLong.time({ width: "long" });
1810
+ default: return formatLong.time({ width: "full" });
1811
+ }
1812
+ };
1813
+ var dateTimeLongFormatter = (pattern, formatLong) => {
1814
+ const matchResult = pattern.match(/(P+)(p+)?/) || [];
1815
+ const datePattern = matchResult[1];
1816
+ const timePattern = matchResult[2];
1817
+ if (!timePattern) return dateLongFormatter(pattern, formatLong);
1818
+ let dateTimeFormat;
1819
+ switch (datePattern) {
1820
+ case "P":
1821
+ dateTimeFormat = formatLong.dateTime({ width: "short" });
1822
+ break;
1823
+ case "PP":
1824
+ dateTimeFormat = formatLong.dateTime({ width: "medium" });
1825
+ break;
1826
+ case "PPP":
1827
+ dateTimeFormat = formatLong.dateTime({ width: "long" });
1828
+ break;
1829
+ default:
1830
+ dateTimeFormat = formatLong.dateTime({ width: "full" });
1831
+ break;
1832
+ }
1833
+ return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong)).replace("{{time}}", timeLongFormatter(timePattern, formatLong));
1834
+ };
1835
+ var longFormatters = {
1836
+ p: timeLongFormatter,
1837
+ P: dateTimeLongFormatter
1838
+ };
1839
+ //#endregion
1840
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js
1841
+ var dayOfYearTokenRE = /^D+$/;
1842
+ var weekYearTokenRE = /^Y+$/;
1843
+ var throwTokens = [
1844
+ "D",
1845
+ "DD",
1846
+ "YY",
1847
+ "YYYY"
1848
+ ];
1849
+ function isProtectedDayOfYearToken(token) {
1850
+ return dayOfYearTokenRE.test(token);
1851
+ }
1852
+ function isProtectedWeekYearToken(token) {
1853
+ return weekYearTokenRE.test(token);
1854
+ }
1855
+ function warnOrThrowProtectedError(token, format, input) {
1856
+ const _message = message(token, format, input);
1857
+ console.warn(_message);
1858
+ if (throwTokens.includes(token)) throw new RangeError(_message);
1859
+ }
1860
+ function message(token, format, input) {
1861
+ const subject = token[0] === "Y" ? "years" : "days of the month";
1862
+ 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`;
1863
+ }
1864
+ //#endregion
1865
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
1866
+ /**
1867
+ * @name isDate
1868
+ * @category Common Helpers
1869
+ * @summary Is the given value a date?
1870
+ *
1871
+ * @description
1872
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
1873
+ *
1874
+ * @param value - The value to check
1875
+ *
1876
+ * @returns True if the given value is a date
1877
+ *
1878
+ * @example
1879
+ * // For a valid date:
1880
+ * const result = isDate(new Date())
1881
+ * //=> true
1882
+ *
1883
+ * @example
1884
+ * // For an invalid date:
1885
+ * const result = isDate(new Date(NaN))
1886
+ * //=> true
1887
+ *
1888
+ * @example
1889
+ * // For some value:
1890
+ * const result = isDate('2014-02-31')
1891
+ * //=> false
1892
+ *
1893
+ * @example
1894
+ * // For an object:
1895
+ * const result = isDate({})
1896
+ * //=> false
1897
+ */
1898
+ function isDate(value) {
1899
+ return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
1900
+ }
1901
+ //#endregion
1902
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
1903
+ /**
1904
+ * @name isValid
1905
+ * @category Common Helpers
1906
+ * @summary Is the given date valid?
1907
+ *
1908
+ * @description
1909
+ * Returns false if argument is Invalid Date and true otherwise.
1910
+ * Argument is converted to Date using `toDate`. See [toDate](https://date-fns.org/docs/toDate)
1911
+ * Invalid Date is a Date, whose time value is NaN.
1912
+ *
1913
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
1914
+ *
1915
+ * @param date - The date to check
1916
+ *
1917
+ * @returns The date is valid
1918
+ *
1919
+ * @example
1920
+ * // For the valid date:
1921
+ * const result = isValid(new Date(2014, 1, 31))
1922
+ * //=> true
1923
+ *
1924
+ * @example
1925
+ * // For the value, convertible into a date:
1926
+ * const result = isValid(1393804800000)
1927
+ * //=> true
1928
+ *
1929
+ * @example
1930
+ * // For the invalid date:
1931
+ * const result = isValid(new Date(''))
1932
+ * //=> false
1933
+ */
1934
+ function isValid(date) {
1935
+ return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
1936
+ }
1937
+ //#endregion
1938
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
1939
+ var formattingTokensRegExp$1 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
1940
+ var longFormattingTokensRegExp$1 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1941
+ var escapedStringRegExp$1 = /^'([^]*?)'?$/;
1942
+ var doubleQuoteRegExp$1 = /''/g;
1943
+ var unescapedLatinCharacterRegExp$1 = /[a-zA-Z]/;
1944
+ /**
1945
+ * The {@link format} function options.
1946
+ */
1947
+ /**
1948
+ * @name format
1949
+ * @alias formatDate
1950
+ * @category Common Helpers
1951
+ * @summary Format the date.
1952
+ *
1953
+ * @description
1954
+ * Return the formatted date string in the given format. The result may vary by locale.
1955
+ *
1956
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1957
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
1958
+ *
1959
+ * The characters wrapped between two single quotes characters (') are escaped.
1960
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1961
+ * (see the last example)
1962
+ *
1963
+ * Format of the string is based on Unicode Technical Standard #35:
1964
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1965
+ * with a few additions (see note 7 below the table).
1966
+ *
1967
+ * Accepted patterns:
1968
+ * | Unit | Pattern | Result examples | Notes |
1969
+ * |---------------------------------|---------|-----------------------------------|-------|
1970
+ * | Era | G..GGG | AD, BC | |
1971
+ * | | GGGG | Anno Domini, Before Christ | 2 |
1972
+ * | | GGGGG | A, B | |
1973
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
1974
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
1975
+ * | | yy | 44, 01, 00, 17 | 5 |
1976
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
1977
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
1978
+ * | | yyyyy | ... | 3,5 |
1979
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
1980
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
1981
+ * | | YY | 44, 01, 00, 17 | 5,8 |
1982
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
1983
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
1984
+ * | | YYYYY | ... | 3,5 |
1985
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
1986
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
1987
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
1988
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
1989
+ * | | RRRRR | ... | 3,5,7 |
1990
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
1991
+ * | | uu | -43, 01, 1900, 2017 | 5 |
1992
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
1993
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
1994
+ * | | uuuuu | ... | 3,5 |
1995
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
1996
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
1997
+ * | | QQ | 01, 02, 03, 04 | |
1998
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
1999
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2000
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2001
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2002
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2003
+ * | | qq | 01, 02, 03, 04 | |
2004
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2005
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2006
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2007
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2008
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2009
+ * | | MM | 01, 02, ..., 12 | |
2010
+ * | | MMM | Jan, Feb, ..., Dec | |
2011
+ * | | MMMM | January, February, ..., December | 2 |
2012
+ * | | MMMMM | J, F, ..., D | |
2013
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2014
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2015
+ * | | LL | 01, 02, ..., 12 | |
2016
+ * | | LLL | Jan, Feb, ..., Dec | |
2017
+ * | | LLLL | January, February, ..., December | 2 |
2018
+ * | | LLLLL | J, F, ..., D | |
2019
+ * | Local week of year | w | 1, 2, ..., 53 | |
2020
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2021
+ * | | ww | 01, 02, ..., 53 | |
2022
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2023
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2024
+ * | | II | 01, 02, ..., 53 | 7 |
2025
+ * | Day of month | d | 1, 2, ..., 31 | |
2026
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2027
+ * | | dd | 01, 02, ..., 31 | |
2028
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2029
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2030
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2031
+ * | | DDD | 001, 002, ..., 365, 366 | |
2032
+ * | | DDDD | ... | 3 |
2033
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2034
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2035
+ * | | EEEEE | M, T, W, T, F, S, S | |
2036
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2037
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2038
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2039
+ * | | ii | 01, 02, ..., 07 | 7 |
2040
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2041
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2042
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2043
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2044
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2045
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2046
+ * | | ee | 02, 03, ..., 01 | |
2047
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2048
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2049
+ * | | eeeee | M, T, W, T, F, S, S | |
2050
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2051
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2052
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2053
+ * | | cc | 02, 03, ..., 01 | |
2054
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2055
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2056
+ * | | ccccc | M, T, W, T, F, S, S | |
2057
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2058
+ * | AM, PM | a..aa | AM, PM | |
2059
+ * | | aaa | am, pm | |
2060
+ * | | aaaa | a.m., p.m. | 2 |
2061
+ * | | aaaaa | a, p | |
2062
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2063
+ * | | bbb | am, pm, noon, midnight | |
2064
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2065
+ * | | bbbbb | a, p, n, mi | |
2066
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2067
+ * | | BBBB | at night, in the morning, ... | 2 |
2068
+ * | | BBBBB | at night, in the morning, ... | |
2069
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2070
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2071
+ * | | hh | 01, 02, ..., 11, 12 | |
2072
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2073
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2074
+ * | | HH | 00, 01, 02, ..., 23 | |
2075
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2076
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2077
+ * | | KK | 01, 02, ..., 11, 00 | |
2078
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2079
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2080
+ * | | kk | 24, 01, 02, ..., 23 | |
2081
+ * | Minute | m | 0, 1, ..., 59 | |
2082
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2083
+ * | | mm | 00, 01, ..., 59 | |
2084
+ * | Second | s | 0, 1, ..., 59 | |
2085
+ * | | so | 0th, 1st, ..., 59th | 7 |
2086
+ * | | ss | 00, 01, ..., 59 | |
2087
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2088
+ * | | SS | 00, 01, ..., 99 | |
2089
+ * | | SSS | 000, 001, ..., 999 | |
2090
+ * | | SSSS | ... | 3 |
2091
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2092
+ * | | XX | -0800, +0530, Z | |
2093
+ * | | XXX | -08:00, +05:30, Z | |
2094
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2095
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2096
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2097
+ * | | xx | -0800, +0530, +0000 | |
2098
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2099
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2100
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2101
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2102
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2103
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2104
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2105
+ * | Seconds timestamp | t | 512969520 | 7 |
2106
+ * | | tt | ... | 3,7 |
2107
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2108
+ * | | TT | ... | 3,7 |
2109
+ * | Long localized date | P | 04/29/1453 | 7 |
2110
+ * | | PP | Apr 29, 1453 | 7 |
2111
+ * | | PPP | April 29th, 1453 | 7 |
2112
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2113
+ * | Long localized time | p | 12:00 AM | 7 |
2114
+ * | | pp | 12:00:00 AM | 7 |
2115
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2116
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2117
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2118
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2119
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2120
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2121
+ * Notes:
2122
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2123
+ * are the same as "stand-alone" units, but are different in some languages.
2124
+ * "Formatting" units are declined according to the rules of the language
2125
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2126
+ *
2127
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2128
+ *
2129
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2130
+ *
2131
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2132
+ * the single quote characters (see below).
2133
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2134
+ * the output will be the same as default pattern for this unit, usually
2135
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2136
+ * are marked with "2" in the last column of the table.
2137
+ *
2138
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2139
+ *
2140
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2141
+ *
2142
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2143
+ *
2144
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2145
+ *
2146
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2147
+ *
2148
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2149
+ * The output will be padded with zeros to match the length of the pattern.
2150
+ *
2151
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2152
+ *
2153
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2154
+ * These tokens represent the shortest form of the quarter.
2155
+ *
2156
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2157
+ *
2158
+ * | Year | `y` | `u` |
2159
+ * |------|-----|-----|
2160
+ * | AC 1 | 1 | 1 |
2161
+ * | BC 1 | 1 | 0 |
2162
+ * | BC 2 | 2 | -1 |
2163
+ *
2164
+ * Also `yy` always returns the last two digits of a year,
2165
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2166
+ *
2167
+ * | Year | `yy` | `uu` |
2168
+ * |------|------|------|
2169
+ * | 1 | 01 | 01 |
2170
+ * | 14 | 14 | 14 |
2171
+ * | 376 | 76 | 376 |
2172
+ * | 1453 | 53 | 1453 |
2173
+ *
2174
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2175
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2176
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
2177
+ * and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
2178
+ *
2179
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2180
+ * so right now these tokens fall back to GMT timezones.
2181
+ *
2182
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2183
+ * - `i`: ISO day of week
2184
+ * - `I`: ISO week of year
2185
+ * - `R`: ISO week-numbering year
2186
+ * - `t`: seconds timestamp
2187
+ * - `T`: milliseconds timestamp
2188
+ * - `o`: ordinal number modifier
2189
+ * - `P`: long localized date
2190
+ * - `p`: long localized time
2191
+ *
2192
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2193
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2194
+ *
2195
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2196
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
2197
+ *
2198
+ * @param date - The original date
2199
+ * @param format - The string of tokens
2200
+ * @param options - An object with options
2201
+ *
2202
+ * @returns The formatted date string
2203
+ *
2204
+ * @throws `date` must not be Invalid Date
2205
+ * @throws `options.locale` must contain `localize` property
2206
+ * @throws `options.locale` must contain `formatLong` property
2207
+ * @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
2208
+ * @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
2209
+ * @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
2210
+ * @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
2211
+ * @throws format string contains an unescaped latin alphabet character
2212
+ *
2213
+ * @example
2214
+ * // Represent 11 February 2014 in middle-endian format:
2215
+ * const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2216
+ * //=> '02/11/2014'
2217
+ *
2218
+ * @example
2219
+ * // Represent 2 July 2014 in Esperanto:
2220
+ * import { eoLocale } from 'date-fns/locale/eo'
2221
+ * const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2222
+ * locale: eoLocale
2223
+ * })
2224
+ * //=> '2-a de julio 2014'
2225
+ *
2226
+ * @example
2227
+ * // Escape string by single quote characters:
2228
+ * const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2229
+ * //=> "3 o'clock"
2230
+ */
2231
+ function format(date, formatStr, options) {
2232
+ const defaultOptions = getDefaultOptions$1();
2233
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS;
2234
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
2235
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
2236
+ const originalDate = toDate(date, options?.in);
2237
+ if (!isValid(originalDate)) throw new RangeError("Invalid time value");
2238
+ let parts = formatStr.match(longFormattingTokensRegExp$1).map((substring) => {
2239
+ const firstCharacter = substring[0];
2240
+ if (firstCharacter === "p" || firstCharacter === "P") {
2241
+ const longFormatter = longFormatters[firstCharacter];
2242
+ return longFormatter(substring, locale.formatLong);
2243
+ }
2244
+ return substring;
2245
+ }).join("").match(formattingTokensRegExp$1).map((substring) => {
2246
+ if (substring === "''") return {
2247
+ isToken: false,
2248
+ value: "'"
2249
+ };
2250
+ const firstCharacter = substring[0];
2251
+ if (firstCharacter === "'") return {
2252
+ isToken: false,
2253
+ value: cleanEscapedString$1(substring)
2254
+ };
2255
+ if (formatters[firstCharacter]) return {
2256
+ isToken: true,
2257
+ value: substring
2258
+ };
2259
+ if (firstCharacter.match(unescapedLatinCharacterRegExp$1)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
2260
+ return {
2261
+ isToken: false,
2262
+ value: substring
2263
+ };
2264
+ });
2265
+ if (locale.localize.preprocessor) parts = locale.localize.preprocessor(originalDate, parts);
2266
+ const formatterOptions = {
2267
+ firstWeekContainsDate,
2268
+ weekStartsOn,
2269
+ locale
2270
+ };
2271
+ return parts.map((part) => {
2272
+ if (!part.isToken) return part.value;
2273
+ const token = part.value;
2274
+ if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, String(date));
2275
+ const formatter = formatters[token[0]];
2276
+ return formatter(originalDate, token, locale.localize, formatterOptions);
2277
+ }).join("");
2278
+ }
2279
+ function cleanEscapedString$1(input) {
2280
+ const matched = input.match(escapedStringRegExp$1);
2281
+ if (!matched) return input;
2282
+ return matched[1].replace(doubleQuoteRegExp$1, "'");
2283
+ }
2284
+ //#endregion
2285
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDefaultOptions.js
2286
+ /**
2287
+ * @name getDefaultOptions
2288
+ * @category Common Helpers
2289
+ * @summary Get default options.
2290
+ * @pure false
2291
+ *
2292
+ * @description
2293
+ * Returns an object that contains defaults for
2294
+ * `options.locale`, `options.weekStartsOn` and `options.firstWeekContainsDate`
2295
+ * arguments for all functions.
2296
+ *
2297
+ * You can change these with [setDefaultOptions](https://date-fns.org/docs/setDefaultOptions).
2298
+ *
2299
+ * @returns The default options
2300
+ *
2301
+ * @example
2302
+ * const result = getDefaultOptions()
2303
+ * //=> {}
2304
+ *
2305
+ * @example
2306
+ * setDefaultOptions({ weekStarsOn: 1, firstWeekContainsDate: 4 })
2307
+ * const result = getDefaultOptions()
2308
+ * //=> { weekStarsOn: 1, firstWeekContainsDate: 4 }
2309
+ */
2310
+ function getDefaultOptions() {
2311
+ return Object.assign({}, getDefaultOptions$1());
2312
+ }
2313
+ //#endregion
2314
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/transpose.js
2315
+ /**
2316
+ * @name transpose
2317
+ * @category Generic Helpers
2318
+ * @summary Transpose the date to the given constructor.
2319
+ *
2320
+ * @description
2321
+ * The function transposes the date to the given constructor. It helps you
2322
+ * to transpose the date in the system time zone to say `UTCDate` or any other
2323
+ * date extension.
2324
+ *
2325
+ * @typeParam InputDate - The input `Date` type derived from the passed argument.
2326
+ * @typeParam ResultDate - The result `Date` type derived from the passed constructor.
2327
+ *
2328
+ * @param date - The date to use values from
2329
+ * @param constructor - The date constructor to use
2330
+ *
2331
+ * @returns Date transposed to the given constructor
2332
+ *
2333
+ * @example
2334
+ * // Create July 10, 2022 00:00 in locale time zone
2335
+ * const date = new Date(2022, 6, 10)
2336
+ * //=> 'Sun Jul 10 2022 00:00:00 GMT+0800 (Singapore Standard Time)'
2337
+ *
2338
+ * @example
2339
+ * // Transpose the date to July 10, 2022 00:00 in UTC
2340
+ * transpose(date, UTCDate)
2341
+ * //=> 'Sun Jul 10 2022 00:00:00 GMT+0000 (Coordinated Universal Time)'
2342
+ */
2343
+ function transpose(date, constructor) {
2344
+ const date_ = isConstructor(constructor) ? new constructor(0) : constructFrom(constructor, 0);
2345
+ date_.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
2346
+ date_.setHours(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
2347
+ return date_;
2348
+ }
2349
+ function isConstructor(constructor) {
2350
+ return typeof constructor === "function" && constructor.prototype?.constructor === constructor;
2351
+ }
2352
+ //#endregion
2353
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/Setter.js
2354
+ var TIMEZONE_UNIT_PRIORITY = 10;
2355
+ var Setter = class {
2356
+ subPriority = 0;
2357
+ validate(_utcDate, _options) {
2358
+ return true;
2359
+ }
2360
+ };
2361
+ var ValueSetter = class extends Setter {
2362
+ constructor(value, validateValue, setValue, priority, subPriority) {
2363
+ super();
2364
+ this.value = value;
2365
+ this.validateValue = validateValue;
2366
+ this.setValue = setValue;
2367
+ this.priority = priority;
2368
+ if (subPriority) this.subPriority = subPriority;
2369
+ }
2370
+ validate(date, options) {
2371
+ return this.validateValue(date, this.value, options);
2372
+ }
2373
+ set(date, flags, options) {
2374
+ return this.setValue(date, flags, this.value, options);
2375
+ }
2376
+ };
2377
+ var DateTimezoneSetter = class extends Setter {
2378
+ priority = TIMEZONE_UNIT_PRIORITY;
2379
+ subPriority = -1;
2380
+ constructor(context, reference) {
2381
+ super();
2382
+ this.context = context || ((date) => constructFrom(reference, date));
2383
+ }
2384
+ set(date, flags) {
2385
+ if (flags.timestampIsSet) return date;
2386
+ return constructFrom(date, transpose(date, this.context));
2387
+ }
2388
+ };
2389
+ //#endregion
2390
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/Parser.js
2391
+ var Parser = class {
2392
+ run(dateString, token, match, options) {
2393
+ const result = this.parse(dateString, token, match, options);
2394
+ if (!result) return null;
2395
+ return {
2396
+ setter: new ValueSetter(result.value, this.validate, this.set, this.priority, this.subPriority),
2397
+ rest: result.rest
2398
+ };
2399
+ }
2400
+ validate(_utcDate, _value, _options) {
2401
+ return true;
2402
+ }
2403
+ };
2404
+ //#endregion
2405
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/EraParser.js
2406
+ var EraParser = class extends Parser {
2407
+ priority = 140;
2408
+ parse(dateString, token, match) {
2409
+ switch (token) {
2410
+ case "G":
2411
+ case "GG":
2412
+ case "GGG": return match.era(dateString, { width: "abbreviated" }) || match.era(dateString, { width: "narrow" });
2413
+ case "GGGGG": return match.era(dateString, { width: "narrow" });
2414
+ default: return match.era(dateString, { width: "wide" }) || match.era(dateString, { width: "abbreviated" }) || match.era(dateString, { width: "narrow" });
2415
+ }
2416
+ }
2417
+ set(date, flags, value) {
2418
+ flags.era = value;
2419
+ date.setFullYear(value, 0, 1);
2420
+ date.setHours(0, 0, 0, 0);
2421
+ return date;
2422
+ }
2423
+ incompatibleTokens = [
2424
+ "R",
2425
+ "u",
2426
+ "t",
2427
+ "T"
2428
+ ];
2429
+ };
2430
+ //#endregion
2431
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/constants.js
2432
+ var numericPatterns = {
2433
+ month: /^(1[0-2]|0?\d)/,
2434
+ date: /^(3[0-1]|[0-2]?\d)/,
2435
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
2436
+ week: /^(5[0-3]|[0-4]?\d)/,
2437
+ hour23h: /^(2[0-3]|[0-1]?\d)/,
2438
+ hour24h: /^(2[0-4]|[0-1]?\d)/,
2439
+ hour11h: /^(1[0-1]|0?\d)/,
2440
+ hour12h: /^(1[0-2]|0?\d)/,
2441
+ minute: /^[0-5]?\d/,
2442
+ second: /^[0-5]?\d/,
2443
+ singleDigit: /^\d/,
2444
+ twoDigits: /^\d{1,2}/,
2445
+ threeDigits: /^\d{1,3}/,
2446
+ fourDigits: /^\d{1,4}/,
2447
+ anyDigitsSigned: /^-?\d+/,
2448
+ singleDigitSigned: /^-?\d/,
2449
+ twoDigitsSigned: /^-?\d{1,2}/,
2450
+ threeDigitsSigned: /^-?\d{1,3}/,
2451
+ fourDigitsSigned: /^-?\d{1,4}/
2452
+ };
2453
+ var timezonePatterns = {
2454
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
2455
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
2456
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
2457
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
2458
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
2459
+ };
2460
+ //#endregion
2461
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/utils.js
2462
+ function mapValue(parseFnResult, mapFn) {
2463
+ if (!parseFnResult) return parseFnResult;
2464
+ return {
2465
+ value: mapFn(parseFnResult.value),
2466
+ rest: parseFnResult.rest
2467
+ };
2468
+ }
2469
+ function parseNumericPattern(pattern, dateString) {
2470
+ const matchResult = dateString.match(pattern);
2471
+ if (!matchResult) return null;
2472
+ return {
2473
+ value: parseInt(matchResult[0], 10),
2474
+ rest: dateString.slice(matchResult[0].length)
2475
+ };
2476
+ }
2477
+ function parseTimezonePattern(pattern, dateString) {
2478
+ const matchResult = dateString.match(pattern);
2479
+ if (!matchResult) return null;
2480
+ if (matchResult[0] === "Z") return {
2481
+ value: 0,
2482
+ rest: dateString.slice(1)
2483
+ };
2484
+ const sign = matchResult[1] === "+" ? 1 : -1;
2485
+ const hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
2486
+ const minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
2487
+ const seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
2488
+ return {
2489
+ value: sign * (hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * millisecondsInSecond),
2490
+ rest: dateString.slice(matchResult[0].length)
2491
+ };
2492
+ }
2493
+ function parseAnyDigitsSigned(dateString) {
2494
+ return parseNumericPattern(numericPatterns.anyDigitsSigned, dateString);
2495
+ }
2496
+ function parseNDigits(n, dateString) {
2497
+ switch (n) {
2498
+ case 1: return parseNumericPattern(numericPatterns.singleDigit, dateString);
2499
+ case 2: return parseNumericPattern(numericPatterns.twoDigits, dateString);
2500
+ case 3: return parseNumericPattern(numericPatterns.threeDigits, dateString);
2501
+ case 4: return parseNumericPattern(numericPatterns.fourDigits, dateString);
2502
+ default: return parseNumericPattern(new RegExp("^\\d{1," + n + "}"), dateString);
2503
+ }
2504
+ }
2505
+ function parseNDigitsSigned(n, dateString) {
2506
+ switch (n) {
2507
+ case 1: return parseNumericPattern(numericPatterns.singleDigitSigned, dateString);
2508
+ case 2: return parseNumericPattern(numericPatterns.twoDigitsSigned, dateString);
2509
+ case 3: return parseNumericPattern(numericPatterns.threeDigitsSigned, dateString);
2510
+ case 4: return parseNumericPattern(numericPatterns.fourDigitsSigned, dateString);
2511
+ default: return parseNumericPattern(new RegExp("^-?\\d{1," + n + "}"), dateString);
2512
+ }
2513
+ }
2514
+ function dayPeriodEnumToHours(dayPeriod) {
2515
+ switch (dayPeriod) {
2516
+ case "morning": return 4;
2517
+ case "evening": return 17;
2518
+ case "pm":
2519
+ case "noon":
2520
+ case "afternoon": return 12;
2521
+ default: return 0;
2522
+ }
2523
+ }
2524
+ function normalizeTwoDigitYear(twoDigitYear, currentYear) {
2525
+ const isCommonEra = currentYear > 0;
2526
+ const absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
2527
+ let result;
2528
+ if (absCurrentYear <= 50) result = twoDigitYear || 100;
2529
+ else {
2530
+ const rangeEnd = absCurrentYear + 50;
2531
+ const rangeEndCentury = Math.trunc(rangeEnd / 100) * 100;
2532
+ const isPreviousCentury = twoDigitYear >= rangeEnd % 100;
2533
+ result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
2534
+ }
2535
+ return isCommonEra ? result : 1 - result;
2536
+ }
2537
+ function isLeapYearIndex(year) {
2538
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
2539
+ }
2540
+ //#endregion
2541
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/YearParser.js
2542
+ var YearParser = class extends Parser {
2543
+ priority = 130;
2544
+ incompatibleTokens = [
2545
+ "Y",
2546
+ "R",
2547
+ "u",
2548
+ "w",
2549
+ "I",
2550
+ "i",
2551
+ "e",
2552
+ "c",
2553
+ "t",
2554
+ "T"
2555
+ ];
2556
+ parse(dateString, token, match) {
2557
+ const valueCallback = (year) => ({
2558
+ year,
2559
+ isTwoDigitYear: token === "yy"
2560
+ });
2561
+ switch (token) {
2562
+ case "y": return mapValue(parseNDigits(4, dateString), valueCallback);
2563
+ case "yo": return mapValue(match.ordinalNumber(dateString, { unit: "year" }), valueCallback);
2564
+ default: return mapValue(parseNDigits(token.length, dateString), valueCallback);
2565
+ }
2566
+ }
2567
+ validate(_date, value) {
2568
+ return value.isTwoDigitYear || value.year > 0;
2569
+ }
2570
+ set(date, flags, value) {
2571
+ const currentYear = date.getFullYear();
2572
+ if (value.isTwoDigitYear) {
2573
+ const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
2574
+ date.setFullYear(normalizedTwoDigitYear, 0, 1);
2575
+ date.setHours(0, 0, 0, 0);
2576
+ return date;
2577
+ }
2578
+ const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
2579
+ date.setFullYear(year, 0, 1);
2580
+ date.setHours(0, 0, 0, 0);
2581
+ return date;
2582
+ }
2583
+ };
2584
+ //#endregion
2585
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js
2586
+ var LocalWeekYearParser = class extends Parser {
2587
+ priority = 130;
2588
+ parse(dateString, token, match) {
2589
+ const valueCallback = (year) => ({
2590
+ year,
2591
+ isTwoDigitYear: token === "YY"
2592
+ });
2593
+ switch (token) {
2594
+ case "Y": return mapValue(parseNDigits(4, dateString), valueCallback);
2595
+ case "Yo": return mapValue(match.ordinalNumber(dateString, { unit: "year" }), valueCallback);
2596
+ default: return mapValue(parseNDigits(token.length, dateString), valueCallback);
2597
+ }
2598
+ }
2599
+ validate(_date, value) {
2600
+ return value.isTwoDigitYear || value.year > 0;
2601
+ }
2602
+ set(date, flags, value, options) {
2603
+ const currentYear = getWeekYear(date, options);
2604
+ if (value.isTwoDigitYear) {
2605
+ const normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
2606
+ date.setFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
2607
+ date.setHours(0, 0, 0, 0);
2608
+ return startOfWeek(date, options);
2609
+ }
2610
+ const year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
2611
+ date.setFullYear(year, 0, options.firstWeekContainsDate);
2612
+ date.setHours(0, 0, 0, 0);
2613
+ return startOfWeek(date, options);
2614
+ }
2615
+ incompatibleTokens = [
2616
+ "y",
2617
+ "R",
2618
+ "u",
2619
+ "Q",
2620
+ "q",
2621
+ "M",
2622
+ "L",
2623
+ "I",
2624
+ "d",
2625
+ "D",
2626
+ "i",
2627
+ "t",
2628
+ "T"
2629
+ ];
2630
+ };
2631
+ //#endregion
2632
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js
2633
+ var ISOWeekYearParser = class extends Parser {
2634
+ priority = 130;
2635
+ parse(dateString, token) {
2636
+ if (token === "R") return parseNDigitsSigned(4, dateString);
2637
+ return parseNDigitsSigned(token.length, dateString);
2638
+ }
2639
+ set(date, _flags, value) {
2640
+ const firstWeekOfYear = constructFrom(date, 0);
2641
+ firstWeekOfYear.setFullYear(value, 0, 4);
2642
+ firstWeekOfYear.setHours(0, 0, 0, 0);
2643
+ return startOfISOWeek(firstWeekOfYear);
2644
+ }
2645
+ incompatibleTokens = [
2646
+ "G",
2647
+ "y",
2648
+ "Y",
2649
+ "u",
2650
+ "Q",
2651
+ "q",
2652
+ "M",
2653
+ "L",
2654
+ "w",
2655
+ "d",
2656
+ "D",
2657
+ "e",
2658
+ "c",
2659
+ "t",
2660
+ "T"
2661
+ ];
2662
+ };
2663
+ //#endregion
2664
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js
2665
+ var ExtendedYearParser = class extends Parser {
2666
+ priority = 130;
2667
+ parse(dateString, token) {
2668
+ if (token === "u") return parseNDigitsSigned(4, dateString);
2669
+ return parseNDigitsSigned(token.length, dateString);
2670
+ }
2671
+ set(date, _flags, value) {
2672
+ date.setFullYear(value, 0, 1);
2673
+ date.setHours(0, 0, 0, 0);
2674
+ return date;
2675
+ }
2676
+ incompatibleTokens = [
2677
+ "G",
2678
+ "y",
2679
+ "Y",
2680
+ "R",
2681
+ "w",
2682
+ "I",
2683
+ "i",
2684
+ "e",
2685
+ "c",
2686
+ "t",
2687
+ "T"
2688
+ ];
2689
+ };
2690
+ //#endregion
2691
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js
2692
+ var QuarterParser = class extends Parser {
2693
+ priority = 120;
2694
+ parse(dateString, token, match) {
2695
+ switch (token) {
2696
+ case "Q":
2697
+ case "QQ": return parseNDigits(token.length, dateString);
2698
+ case "Qo": return match.ordinalNumber(dateString, { unit: "quarter" });
2699
+ case "QQQ": return match.quarter(dateString, {
2700
+ width: "abbreviated",
2701
+ context: "formatting"
2702
+ }) || match.quarter(dateString, {
2703
+ width: "narrow",
2704
+ context: "formatting"
2705
+ });
2706
+ case "QQQQQ": return match.quarter(dateString, {
2707
+ width: "narrow",
2708
+ context: "formatting"
2709
+ });
2710
+ default: return match.quarter(dateString, {
2711
+ width: "wide",
2712
+ context: "formatting"
2713
+ }) || match.quarter(dateString, {
2714
+ width: "abbreviated",
2715
+ context: "formatting"
2716
+ }) || match.quarter(dateString, {
2717
+ width: "narrow",
2718
+ context: "formatting"
2719
+ });
2720
+ }
2721
+ }
2722
+ validate(_date, value) {
2723
+ return value >= 1 && value <= 4;
2724
+ }
2725
+ set(date, _flags, value) {
2726
+ date.setMonth((value - 1) * 3, 1);
2727
+ date.setHours(0, 0, 0, 0);
2728
+ return date;
2729
+ }
2730
+ incompatibleTokens = [
2731
+ "Y",
2732
+ "R",
2733
+ "q",
2734
+ "M",
2735
+ "L",
2736
+ "w",
2737
+ "I",
2738
+ "d",
2739
+ "D",
2740
+ "i",
2741
+ "e",
2742
+ "c",
2743
+ "t",
2744
+ "T"
2745
+ ];
2746
+ };
2747
+ //#endregion
2748
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js
2749
+ var StandAloneQuarterParser = class extends Parser {
2750
+ priority = 120;
2751
+ parse(dateString, token, match) {
2752
+ switch (token) {
2753
+ case "q":
2754
+ case "qq": return parseNDigits(token.length, dateString);
2755
+ case "qo": return match.ordinalNumber(dateString, { unit: "quarter" });
2756
+ case "qqq": return match.quarter(dateString, {
2757
+ width: "abbreviated",
2758
+ context: "standalone"
2759
+ }) || match.quarter(dateString, {
2760
+ width: "narrow",
2761
+ context: "standalone"
2762
+ });
2763
+ case "qqqqq": return match.quarter(dateString, {
2764
+ width: "narrow",
2765
+ context: "standalone"
2766
+ });
2767
+ default: return match.quarter(dateString, {
2768
+ width: "wide",
2769
+ context: "standalone"
2770
+ }) || match.quarter(dateString, {
2771
+ width: "abbreviated",
2772
+ context: "standalone"
2773
+ }) || match.quarter(dateString, {
2774
+ width: "narrow",
2775
+ context: "standalone"
2776
+ });
2777
+ }
2778
+ }
2779
+ validate(_date, value) {
2780
+ return value >= 1 && value <= 4;
2781
+ }
2782
+ set(date, _flags, value) {
2783
+ date.setMonth((value - 1) * 3, 1);
2784
+ date.setHours(0, 0, 0, 0);
2785
+ return date;
2786
+ }
2787
+ incompatibleTokens = [
2788
+ "Y",
2789
+ "R",
2790
+ "Q",
2791
+ "M",
2792
+ "L",
2793
+ "w",
2794
+ "I",
2795
+ "d",
2796
+ "D",
2797
+ "i",
2798
+ "e",
2799
+ "c",
2800
+ "t",
2801
+ "T"
2802
+ ];
2803
+ };
2804
+ //#endregion
2805
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.js
2806
+ var MonthParser = class extends Parser {
2807
+ incompatibleTokens = [
2808
+ "Y",
2809
+ "R",
2810
+ "q",
2811
+ "Q",
2812
+ "L",
2813
+ "w",
2814
+ "I",
2815
+ "D",
2816
+ "i",
2817
+ "e",
2818
+ "c",
2819
+ "t",
2820
+ "T"
2821
+ ];
2822
+ priority = 110;
2823
+ parse(dateString, token, match) {
2824
+ const valueCallback = (value) => value - 1;
2825
+ switch (token) {
2826
+ case "M": return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
2827
+ case "MM": return mapValue(parseNDigits(2, dateString), valueCallback);
2828
+ case "Mo": return mapValue(match.ordinalNumber(dateString, { unit: "month" }), valueCallback);
2829
+ case "MMM": return match.month(dateString, {
2830
+ width: "abbreviated",
2831
+ context: "formatting"
2832
+ }) || match.month(dateString, {
2833
+ width: "narrow",
2834
+ context: "formatting"
2835
+ });
2836
+ case "MMMMM": return match.month(dateString, {
2837
+ width: "narrow",
2838
+ context: "formatting"
2839
+ });
2840
+ default: return match.month(dateString, {
2841
+ width: "wide",
2842
+ context: "formatting"
2843
+ }) || match.month(dateString, {
2844
+ width: "abbreviated",
2845
+ context: "formatting"
2846
+ }) || match.month(dateString, {
2847
+ width: "narrow",
2848
+ context: "formatting"
2849
+ });
2850
+ }
2851
+ }
2852
+ validate(_date, value) {
2853
+ return value >= 0 && value <= 11;
2854
+ }
2855
+ set(date, _flags, value) {
2856
+ date.setMonth(value, 1);
2857
+ date.setHours(0, 0, 0, 0);
2858
+ return date;
2859
+ }
2860
+ };
2861
+ //#endregion
2862
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js
2863
+ var StandAloneMonthParser = class extends Parser {
2864
+ priority = 110;
2865
+ parse(dateString, token, match) {
2866
+ const valueCallback = (value) => value - 1;
2867
+ switch (token) {
2868
+ case "L": return mapValue(parseNumericPattern(numericPatterns.month, dateString), valueCallback);
2869
+ case "LL": return mapValue(parseNDigits(2, dateString), valueCallback);
2870
+ case "Lo": return mapValue(match.ordinalNumber(dateString, { unit: "month" }), valueCallback);
2871
+ case "LLL": return match.month(dateString, {
2872
+ width: "abbreviated",
2873
+ context: "standalone"
2874
+ }) || match.month(dateString, {
2875
+ width: "narrow",
2876
+ context: "standalone"
2877
+ });
2878
+ case "LLLLL": return match.month(dateString, {
2879
+ width: "narrow",
2880
+ context: "standalone"
2881
+ });
2882
+ default: return match.month(dateString, {
2883
+ width: "wide",
2884
+ context: "standalone"
2885
+ }) || match.month(dateString, {
2886
+ width: "abbreviated",
2887
+ context: "standalone"
2888
+ }) || match.month(dateString, {
2889
+ width: "narrow",
2890
+ context: "standalone"
2891
+ });
2892
+ }
2893
+ }
2894
+ validate(_date, value) {
2895
+ return value >= 0 && value <= 11;
2896
+ }
2897
+ set(date, _flags, value) {
2898
+ date.setMonth(value, 1);
2899
+ date.setHours(0, 0, 0, 0);
2900
+ return date;
2901
+ }
2902
+ incompatibleTokens = [
2903
+ "Y",
2904
+ "R",
2905
+ "q",
2906
+ "Q",
2907
+ "M",
2908
+ "w",
2909
+ "I",
2910
+ "D",
2911
+ "i",
2912
+ "e",
2913
+ "c",
2914
+ "t",
2915
+ "T"
2916
+ ];
2917
+ };
2918
+ //#endregion
2919
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setWeek.js
2920
+ /**
2921
+ * The {@link setWeek} function options.
2922
+ */
2923
+ /**
2924
+ * @name setWeek
2925
+ * @category Week Helpers
2926
+ * @summary Set the local week to the given date.
2927
+ *
2928
+ * @description
2929
+ * Set the local week to the given date, saving the weekday number.
2930
+ * The exact calculation depends on the values of
2931
+ * `options.weekStartsOn` (which is the index of the first day of the week)
2932
+ * and `options.firstWeekContainsDate` (which is the day of January, which is always in
2933
+ * the first week of the week-numbering year)
2934
+ *
2935
+ * Week numbering: https://en.wikipedia.org/wiki/Week#The_ISO_week_date_system
2936
+ *
2937
+ * @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).
2938
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
2939
+ *
2940
+ * @param date - The date to be changed
2941
+ * @param week - The week of the new date
2942
+ * @param options - An object with options
2943
+ *
2944
+ * @returns The new date with the local week set
2945
+ *
2946
+ * @example
2947
+ * // Set the 1st week to 2 January 2005 with default options:
2948
+ * const result = setWeek(new Date(2005, 0, 2), 1)
2949
+ * //=> Sun Dec 26 2004 00:00:00
2950
+ *
2951
+ * @example
2952
+ * // Set the 1st week to 2 January 2005,
2953
+ * // if Monday is the first day of the week,
2954
+ * // and the first week of the year always contains 4 January:
2955
+ * const result = setWeek(new Date(2005, 0, 2), 1, {
2956
+ * weekStartsOn: 1,
2957
+ * firstWeekContainsDate: 4
2958
+ * })
2959
+ * //=> Sun Jan 4 2004 00:00:00
2960
+ */
2961
+ function setWeek(date, week, options) {
2962
+ const date_ = toDate(date, options?.in);
2963
+ const diff = getWeek(date_, options) - week;
2964
+ date_.setDate(date_.getDate() - diff * 7);
2965
+ return toDate(date_, options?.in);
2966
+ }
2967
+ //#endregion
2968
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js
2969
+ var LocalWeekParser = class extends Parser {
2970
+ priority = 100;
2971
+ parse(dateString, token, match) {
2972
+ switch (token) {
2973
+ case "w": return parseNumericPattern(numericPatterns.week, dateString);
2974
+ case "wo": return match.ordinalNumber(dateString, { unit: "week" });
2975
+ default: return parseNDigits(token.length, dateString);
2976
+ }
2977
+ }
2978
+ validate(_date, value) {
2979
+ return value >= 1 && value <= 53;
2980
+ }
2981
+ set(date, _flags, value, options) {
2982
+ return startOfWeek(setWeek(date, value, options), options);
2983
+ }
2984
+ incompatibleTokens = [
2985
+ "y",
2986
+ "R",
2987
+ "u",
2988
+ "q",
2989
+ "Q",
2990
+ "M",
2991
+ "L",
2992
+ "I",
2993
+ "d",
2994
+ "D",
2995
+ "i",
2996
+ "t",
2997
+ "T"
2998
+ ];
2999
+ };
3000
+ //#endregion
3001
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISOWeek.js
3002
+ /**
3003
+ * The {@link setISOWeek} function options.
3004
+ */
3005
+ /**
3006
+ * @name setISOWeek
3007
+ * @category ISO Week Helpers
3008
+ * @summary Set the ISO week to the given date.
3009
+ *
3010
+ * @description
3011
+ * Set the ISO week to the given date, saving the weekday number.
3012
+ *
3013
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
3014
+ *
3015
+ * @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).
3016
+ * @typeParam ResultDate - The `Date` type of the context function.
3017
+ *
3018
+ * @param date - The date to be changed
3019
+ * @param week - The ISO week of the new date
3020
+ * @param options - An object with options
3021
+ *
3022
+ * @returns The new date with the ISO week set
3023
+ *
3024
+ * @example
3025
+ * // Set the 53rd ISO week to 7 August 2004:
3026
+ * const result = setISOWeek(new Date(2004, 7, 7), 53)
3027
+ * //=> Sat Jan 01 2005 00:00:00
3028
+ */
3029
+ function setISOWeek(date, week, options) {
3030
+ const _date = toDate(date, options?.in);
3031
+ const diff = getISOWeek(_date, options) - week;
3032
+ _date.setDate(_date.getDate() - diff * 7);
3033
+ return _date;
3034
+ }
3035
+ //#endregion
3036
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js
3037
+ var ISOWeekParser = class extends Parser {
3038
+ priority = 100;
3039
+ parse(dateString, token, match) {
3040
+ switch (token) {
3041
+ case "I": return parseNumericPattern(numericPatterns.week, dateString);
3042
+ case "Io": return match.ordinalNumber(dateString, { unit: "week" });
3043
+ default: return parseNDigits(token.length, dateString);
3044
+ }
3045
+ }
3046
+ validate(_date, value) {
3047
+ return value >= 1 && value <= 53;
3048
+ }
3049
+ set(date, _flags, value) {
3050
+ return startOfISOWeek(setISOWeek(date, value));
3051
+ }
3052
+ incompatibleTokens = [
3053
+ "y",
3054
+ "Y",
3055
+ "u",
3056
+ "q",
3057
+ "Q",
3058
+ "M",
3059
+ "L",
3060
+ "w",
3061
+ "d",
3062
+ "D",
3063
+ "e",
3064
+ "c",
3065
+ "t",
3066
+ "T"
3067
+ ];
3068
+ };
3069
+ //#endregion
3070
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/DateParser.js
3071
+ var DAYS_IN_MONTH = [
3072
+ 31,
3073
+ 28,
3074
+ 31,
3075
+ 30,
3076
+ 31,
3077
+ 30,
3078
+ 31,
3079
+ 31,
3080
+ 30,
3081
+ 31,
3082
+ 30,
3083
+ 31
3084
+ ];
3085
+ var DAYS_IN_MONTH_LEAP_YEAR = [
3086
+ 31,
3087
+ 29,
3088
+ 31,
3089
+ 30,
3090
+ 31,
3091
+ 30,
3092
+ 31,
3093
+ 31,
3094
+ 30,
3095
+ 31,
3096
+ 30,
3097
+ 31
3098
+ ];
3099
+ var DateParser = class extends Parser {
3100
+ priority = 90;
3101
+ subPriority = 1;
3102
+ parse(dateString, token, match) {
3103
+ switch (token) {
3104
+ case "d": return parseNumericPattern(numericPatterns.date, dateString);
3105
+ case "do": return match.ordinalNumber(dateString, { unit: "date" });
3106
+ default: return parseNDigits(token.length, dateString);
3107
+ }
3108
+ }
3109
+ validate(date, value) {
3110
+ const isLeapYear = isLeapYearIndex(date.getFullYear());
3111
+ const month = date.getMonth();
3112
+ if (isLeapYear) return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
3113
+ else return value >= 1 && value <= DAYS_IN_MONTH[month];
3114
+ }
3115
+ set(date, _flags, value) {
3116
+ date.setDate(value);
3117
+ date.setHours(0, 0, 0, 0);
3118
+ return date;
3119
+ }
3120
+ incompatibleTokens = [
3121
+ "Y",
3122
+ "R",
3123
+ "q",
3124
+ "Q",
3125
+ "w",
3126
+ "I",
3127
+ "D",
3128
+ "i",
3129
+ "e",
3130
+ "c",
3131
+ "t",
3132
+ "T"
3133
+ ];
3134
+ };
3135
+ //#endregion
3136
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js
3137
+ var DayOfYearParser = class extends Parser {
3138
+ priority = 90;
3139
+ subpriority = 1;
3140
+ parse(dateString, token, match) {
3141
+ switch (token) {
3142
+ case "D":
3143
+ case "DD": return parseNumericPattern(numericPatterns.dayOfYear, dateString);
3144
+ case "Do": return match.ordinalNumber(dateString, { unit: "date" });
3145
+ default: return parseNDigits(token.length, dateString);
3146
+ }
3147
+ }
3148
+ validate(date, value) {
3149
+ if (isLeapYearIndex(date.getFullYear())) return value >= 1 && value <= 366;
3150
+ else return value >= 1 && value <= 365;
3151
+ }
3152
+ set(date, _flags, value) {
3153
+ date.setMonth(0, value);
3154
+ date.setHours(0, 0, 0, 0);
3155
+ return date;
3156
+ }
3157
+ incompatibleTokens = [
3158
+ "Y",
3159
+ "R",
3160
+ "q",
3161
+ "Q",
3162
+ "M",
3163
+ "L",
3164
+ "w",
3165
+ "I",
3166
+ "d",
3167
+ "E",
3168
+ "i",
3169
+ "e",
3170
+ "c",
3171
+ "t",
3172
+ "T"
3173
+ ];
3174
+ };
3175
+ //#endregion
3176
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
3177
+ /**
3178
+ * The {@link addDays} function options.
3179
+ */
3180
+ /**
3181
+ * @name addDays
3182
+ * @category Day Helpers
3183
+ * @summary Add the specified number of days to the given date.
3184
+ *
3185
+ * @description
3186
+ * Add the specified number of days to the given date.
3187
+ *
3188
+ * @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).
3189
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
3190
+ *
3191
+ * @param date - The date to be changed
3192
+ * @param amount - The amount of days to be added.
3193
+ * @param options - An object with options
3194
+ *
3195
+ * @returns The new date with the days added
3196
+ *
3197
+ * @example
3198
+ * // Add 10 days to 1 September 2014:
3199
+ * const result = addDays(new Date(2014, 8, 1), 10)
3200
+ * //=> Thu Sep 11 2014 00:00:00
3201
+ */
3202
+ function addDays$1(date, amount, options) {
3203
+ const _date = toDate(date, options?.in);
3204
+ if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
3205
+ if (!amount) return _date;
3206
+ _date.setDate(_date.getDate() + amount);
3207
+ return _date;
3208
+ }
3209
+ //#endregion
3210
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setDay.js
3211
+ /**
3212
+ * The {@link setDay} function options.
3213
+ */
3214
+ /**
3215
+ * @name setDay
3216
+ * @category Weekday Helpers
3217
+ * @summary Set the day of the week to the given date.
3218
+ *
3219
+ * @description
3220
+ * Set the day of the week to the given date.
3221
+ *
3222
+ * @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).
3223
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
3224
+ *
3225
+ * @param date - The date to be changed
3226
+ * @param day - The day of the week of the new date
3227
+ * @param options - An object with options.
3228
+ *
3229
+ * @returns The new date with the day of the week set
3230
+ *
3231
+ * @example
3232
+ * // Set week day to Sunday, with the default weekStartsOn of Sunday:
3233
+ * const result = setDay(new Date(2014, 8, 1), 0)
3234
+ * //=> Sun Aug 31 2014 00:00:00
3235
+ *
3236
+ * @example
3237
+ * // Set week day to Sunday, with a weekStartsOn of Monday:
3238
+ * const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
3239
+ * //=> Sun Sep 07 2014 00:00:00
3240
+ */
3241
+ function setDay(date, day, options) {
3242
+ const defaultOptions = getDefaultOptions$1();
3243
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
3244
+ const date_ = toDate(date, options?.in);
3245
+ const currentDay = date_.getDay();
3246
+ const dayIndex = (day % 7 + 7) % 7;
3247
+ const delta = 7 - weekStartsOn;
3248
+ return addDays$1(date_, day < 0 || day > 6 ? day - (currentDay + delta) % 7 : (dayIndex + delta) % 7 - (currentDay + delta) % 7, options);
3249
+ }
3250
+ //#endregion
3251
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/DayParser.js
3252
+ var DayParser = class extends Parser {
3253
+ priority = 90;
3254
+ parse(dateString, token, match) {
3255
+ switch (token) {
3256
+ case "E":
3257
+ case "EE":
3258
+ case "EEE": return match.day(dateString, {
3259
+ width: "abbreviated",
3260
+ context: "formatting"
3261
+ }) || match.day(dateString, {
3262
+ width: "short",
3263
+ context: "formatting"
3264
+ }) || match.day(dateString, {
3265
+ width: "narrow",
3266
+ context: "formatting"
3267
+ });
3268
+ case "EEEEE": return match.day(dateString, {
3269
+ width: "narrow",
3270
+ context: "formatting"
3271
+ });
3272
+ case "EEEEEE": return match.day(dateString, {
3273
+ width: "short",
3274
+ context: "formatting"
3275
+ }) || match.day(dateString, {
3276
+ width: "narrow",
3277
+ context: "formatting"
3278
+ });
3279
+ default: return match.day(dateString, {
3280
+ width: "wide",
3281
+ context: "formatting"
3282
+ }) || match.day(dateString, {
3283
+ width: "abbreviated",
3284
+ context: "formatting"
3285
+ }) || match.day(dateString, {
3286
+ width: "short",
3287
+ context: "formatting"
3288
+ }) || match.day(dateString, {
3289
+ width: "narrow",
3290
+ context: "formatting"
3291
+ });
3292
+ }
3293
+ }
3294
+ validate(_date, value) {
3295
+ return value >= 0 && value <= 6;
3296
+ }
3297
+ set(date, _flags, value, options) {
3298
+ date = setDay(date, value, options);
3299
+ date.setHours(0, 0, 0, 0);
3300
+ return date;
3301
+ }
3302
+ incompatibleTokens = [
3303
+ "D",
3304
+ "i",
3305
+ "e",
3306
+ "c",
3307
+ "t",
3308
+ "T"
3309
+ ];
3310
+ };
3311
+ //#endregion
3312
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js
3313
+ var LocalDayParser = class extends Parser {
3314
+ priority = 90;
3315
+ parse(dateString, token, match, options) {
3316
+ const valueCallback = (value) => {
3317
+ const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
3318
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
3319
+ };
3320
+ switch (token) {
3321
+ case "e":
3322
+ case "ee": return mapValue(parseNDigits(token.length, dateString), valueCallback);
3323
+ case "eo": return mapValue(match.ordinalNumber(dateString, { unit: "day" }), valueCallback);
3324
+ case "eee": return match.day(dateString, {
3325
+ width: "abbreviated",
3326
+ context: "formatting"
3327
+ }) || match.day(dateString, {
3328
+ width: "short",
3329
+ context: "formatting"
3330
+ }) || match.day(dateString, {
3331
+ width: "narrow",
3332
+ context: "formatting"
3333
+ });
3334
+ case "eeeee": return match.day(dateString, {
3335
+ width: "narrow",
3336
+ context: "formatting"
3337
+ });
3338
+ case "eeeeee": return match.day(dateString, {
3339
+ width: "short",
3340
+ context: "formatting"
3341
+ }) || match.day(dateString, {
3342
+ width: "narrow",
3343
+ context: "formatting"
3344
+ });
3345
+ default: return match.day(dateString, {
3346
+ width: "wide",
3347
+ context: "formatting"
3348
+ }) || match.day(dateString, {
3349
+ width: "abbreviated",
3350
+ context: "formatting"
3351
+ }) || match.day(dateString, {
3352
+ width: "short",
3353
+ context: "formatting"
3354
+ }) || match.day(dateString, {
3355
+ width: "narrow",
3356
+ context: "formatting"
3357
+ });
3358
+ }
3359
+ }
3360
+ validate(_date, value) {
3361
+ return value >= 0 && value <= 6;
3362
+ }
3363
+ set(date, _flags, value, options) {
3364
+ date = setDay(date, value, options);
3365
+ date.setHours(0, 0, 0, 0);
3366
+ return date;
3367
+ }
3368
+ incompatibleTokens = [
3369
+ "y",
3370
+ "R",
3371
+ "u",
3372
+ "q",
3373
+ "Q",
3374
+ "M",
3375
+ "L",
3376
+ "I",
3377
+ "d",
3378
+ "D",
3379
+ "E",
3380
+ "i",
3381
+ "c",
3382
+ "t",
3383
+ "T"
3384
+ ];
3385
+ };
3386
+ //#endregion
3387
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js
3388
+ var StandAloneLocalDayParser = class extends Parser {
3389
+ priority = 90;
3390
+ parse(dateString, token, match, options) {
3391
+ const valueCallback = (value) => {
3392
+ const wholeWeekDays = Math.floor((value - 1) / 7) * 7;
3393
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
3394
+ };
3395
+ switch (token) {
3396
+ case "c":
3397
+ case "cc": return mapValue(parseNDigits(token.length, dateString), valueCallback);
3398
+ case "co": return mapValue(match.ordinalNumber(dateString, { unit: "day" }), valueCallback);
3399
+ case "ccc": return match.day(dateString, {
3400
+ width: "abbreviated",
3401
+ context: "standalone"
3402
+ }) || match.day(dateString, {
3403
+ width: "short",
3404
+ context: "standalone"
3405
+ }) || match.day(dateString, {
3406
+ width: "narrow",
3407
+ context: "standalone"
3408
+ });
3409
+ case "ccccc": return match.day(dateString, {
3410
+ width: "narrow",
3411
+ context: "standalone"
3412
+ });
3413
+ case "cccccc": return match.day(dateString, {
3414
+ width: "short",
3415
+ context: "standalone"
3416
+ }) || match.day(dateString, {
3417
+ width: "narrow",
3418
+ context: "standalone"
3419
+ });
3420
+ default: return match.day(dateString, {
3421
+ width: "wide",
3422
+ context: "standalone"
3423
+ }) || match.day(dateString, {
3424
+ width: "abbreviated",
3425
+ context: "standalone"
3426
+ }) || match.day(dateString, {
3427
+ width: "short",
3428
+ context: "standalone"
3429
+ }) || match.day(dateString, {
3430
+ width: "narrow",
3431
+ context: "standalone"
3432
+ });
3433
+ }
3434
+ }
3435
+ validate(_date, value) {
3436
+ return value >= 0 && value <= 6;
3437
+ }
3438
+ set(date, _flags, value, options) {
3439
+ date = setDay(date, value, options);
3440
+ date.setHours(0, 0, 0, 0);
3441
+ return date;
3442
+ }
3443
+ incompatibleTokens = [
3444
+ "y",
3445
+ "R",
3446
+ "u",
3447
+ "q",
3448
+ "Q",
3449
+ "M",
3450
+ "L",
3451
+ "I",
3452
+ "d",
3453
+ "D",
3454
+ "E",
3455
+ "i",
3456
+ "e",
3457
+ "t",
3458
+ "T"
3459
+ ];
3460
+ };
3461
+ //#endregion
3462
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISODay.js
3463
+ /**
3464
+ * The {@link getISODay} function options.
3465
+ */
3466
+ /**
3467
+ * @name getISODay
3468
+ * @category Weekday Helpers
3469
+ * @summary Get the day of the ISO week of the given date.
3470
+ *
3471
+ * @description
3472
+ * Get the day of the ISO week of the given date,
3473
+ * which is 7 for Sunday, 1 for Monday etc.
3474
+ *
3475
+ * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
3476
+ *
3477
+ * @param date - The given date
3478
+ * @param options - An object with options
3479
+ *
3480
+ * @returns The day of ISO week
3481
+ *
3482
+ * @example
3483
+ * // Which day of the ISO week is 26 February 2012?
3484
+ * const result = getISODay(new Date(2012, 1, 26))
3485
+ * //=> 7
3486
+ */
3487
+ function getISODay(date, options) {
3488
+ const day = toDate(date, options?.in).getDay();
3489
+ return day === 0 ? 7 : day;
3490
+ }
3491
+ //#endregion
3492
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/setISODay.js
3493
+ /**
3494
+ * The {@link setISODay} function options.
3495
+ */
3496
+ /**
3497
+ * @name setISODay
3498
+ * @category Weekday Helpers
3499
+ * @summary Set the day of the ISO week to the given date.
3500
+ *
3501
+ * @description
3502
+ * Set the day of the ISO week to the given date.
3503
+ * ISO week starts with Monday.
3504
+ * 7 is the index of Sunday, 1 is the index of Monday, etc.
3505
+ *
3506
+ * @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).
3507
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
3508
+ *
3509
+ * @param date - The date to be changed
3510
+ * @param day - The day of the ISO week of the new date
3511
+ * @param options - An object with options
3512
+ *
3513
+ * @returns The new date with the day of the ISO week set
3514
+ *
3515
+ * @example
3516
+ * // Set Sunday to 1 September 2014:
3517
+ * const result = setISODay(new Date(2014, 8, 1), 7)
3518
+ * //=> Sun Sep 07 2014 00:00:00
3519
+ */
3520
+ function setISODay(date, day, options) {
3521
+ const date_ = toDate(date, options?.in);
3522
+ return addDays$1(date_, day - getISODay(date_, options), options);
3523
+ }
3524
+ //#endregion
3525
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js
3526
+ var ISODayParser = class extends Parser {
3527
+ priority = 90;
3528
+ parse(dateString, token, match) {
3529
+ const valueCallback = (value) => {
3530
+ if (value === 0) return 7;
3531
+ return value;
3532
+ };
3533
+ switch (token) {
3534
+ case "i":
3535
+ case "ii": return parseNDigits(token.length, dateString);
3536
+ case "io": return match.ordinalNumber(dateString, { unit: "day" });
3537
+ case "iii": return mapValue(match.day(dateString, {
3538
+ width: "abbreviated",
3539
+ context: "formatting"
3540
+ }) || match.day(dateString, {
3541
+ width: "short",
3542
+ context: "formatting"
3543
+ }) || match.day(dateString, {
3544
+ width: "narrow",
3545
+ context: "formatting"
3546
+ }), valueCallback);
3547
+ case "iiiii": return mapValue(match.day(dateString, {
3548
+ width: "narrow",
3549
+ context: "formatting"
3550
+ }), valueCallback);
3551
+ case "iiiiii": return mapValue(match.day(dateString, {
3552
+ width: "short",
3553
+ context: "formatting"
3554
+ }) || match.day(dateString, {
3555
+ width: "narrow",
3556
+ context: "formatting"
3557
+ }), valueCallback);
3558
+ default: return mapValue(match.day(dateString, {
3559
+ width: "wide",
3560
+ context: "formatting"
3561
+ }) || match.day(dateString, {
3562
+ width: "abbreviated",
3563
+ context: "formatting"
3564
+ }) || match.day(dateString, {
3565
+ width: "short",
3566
+ context: "formatting"
3567
+ }) || match.day(dateString, {
3568
+ width: "narrow",
3569
+ context: "formatting"
3570
+ }), valueCallback);
3571
+ }
3572
+ }
3573
+ validate(_date, value) {
3574
+ return value >= 1 && value <= 7;
3575
+ }
3576
+ set(date, _flags, value) {
3577
+ date = setISODay(date, value);
3578
+ date.setHours(0, 0, 0, 0);
3579
+ return date;
3580
+ }
3581
+ incompatibleTokens = [
3582
+ "y",
3583
+ "Y",
3584
+ "u",
3585
+ "q",
3586
+ "Q",
3587
+ "M",
3588
+ "L",
3589
+ "w",
3590
+ "d",
3591
+ "D",
3592
+ "E",
3593
+ "e",
3594
+ "c",
3595
+ "t",
3596
+ "T"
3597
+ ];
3598
+ };
3599
+ //#endregion
3600
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js
3601
+ var AMPMParser = class extends Parser {
3602
+ priority = 80;
3603
+ parse(dateString, token, match) {
3604
+ switch (token) {
3605
+ case "a":
3606
+ case "aa":
3607
+ case "aaa": return match.dayPeriod(dateString, {
3608
+ width: "abbreviated",
3609
+ context: "formatting"
3610
+ }) || match.dayPeriod(dateString, {
3611
+ width: "narrow",
3612
+ context: "formatting"
3613
+ });
3614
+ case "aaaaa": return match.dayPeriod(dateString, {
3615
+ width: "narrow",
3616
+ context: "formatting"
3617
+ });
3618
+ default: return match.dayPeriod(dateString, {
3619
+ width: "wide",
3620
+ context: "formatting"
3621
+ }) || match.dayPeriod(dateString, {
3622
+ width: "abbreviated",
3623
+ context: "formatting"
3624
+ }) || match.dayPeriod(dateString, {
3625
+ width: "narrow",
3626
+ context: "formatting"
3627
+ });
3628
+ }
3629
+ }
3630
+ set(date, _flags, value) {
3631
+ date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
3632
+ return date;
3633
+ }
3634
+ incompatibleTokens = [
3635
+ "b",
3636
+ "B",
3637
+ "H",
3638
+ "k",
3639
+ "t",
3640
+ "T"
3641
+ ];
3642
+ };
3643
+ //#endregion
3644
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js
3645
+ var AMPMMidnightParser = class extends Parser {
3646
+ priority = 80;
3647
+ parse(dateString, token, match) {
3648
+ switch (token) {
3649
+ case "b":
3650
+ case "bb":
3651
+ case "bbb": return match.dayPeriod(dateString, {
3652
+ width: "abbreviated",
3653
+ context: "formatting"
3654
+ }) || match.dayPeriod(dateString, {
3655
+ width: "narrow",
3656
+ context: "formatting"
3657
+ });
3658
+ case "bbbbb": return match.dayPeriod(dateString, {
3659
+ width: "narrow",
3660
+ context: "formatting"
3661
+ });
3662
+ default: return match.dayPeriod(dateString, {
3663
+ width: "wide",
3664
+ context: "formatting"
3665
+ }) || match.dayPeriod(dateString, {
3666
+ width: "abbreviated",
3667
+ context: "formatting"
3668
+ }) || match.dayPeriod(dateString, {
3669
+ width: "narrow",
3670
+ context: "formatting"
3671
+ });
3672
+ }
3673
+ }
3674
+ set(date, _flags, value) {
3675
+ date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
3676
+ return date;
3677
+ }
3678
+ incompatibleTokens = [
3679
+ "a",
3680
+ "B",
3681
+ "H",
3682
+ "k",
3683
+ "t",
3684
+ "T"
3685
+ ];
3686
+ };
3687
+ //#endregion
3688
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js
3689
+ var DayPeriodParser = class extends Parser {
3690
+ priority = 80;
3691
+ parse(dateString, token, match) {
3692
+ switch (token) {
3693
+ case "B":
3694
+ case "BB":
3695
+ case "BBB": return match.dayPeriod(dateString, {
3696
+ width: "abbreviated",
3697
+ context: "formatting"
3698
+ }) || match.dayPeriod(dateString, {
3699
+ width: "narrow",
3700
+ context: "formatting"
3701
+ });
3702
+ case "BBBBB": return match.dayPeriod(dateString, {
3703
+ width: "narrow",
3704
+ context: "formatting"
3705
+ });
3706
+ default: return match.dayPeriod(dateString, {
3707
+ width: "wide",
3708
+ context: "formatting"
3709
+ }) || match.dayPeriod(dateString, {
3710
+ width: "abbreviated",
3711
+ context: "formatting"
3712
+ }) || match.dayPeriod(dateString, {
3713
+ width: "narrow",
3714
+ context: "formatting"
3715
+ });
3716
+ }
3717
+ }
3718
+ set(date, _flags, value) {
3719
+ date.setHours(dayPeriodEnumToHours(value), 0, 0, 0);
3720
+ return date;
3721
+ }
3722
+ incompatibleTokens = [
3723
+ "a",
3724
+ "b",
3725
+ "t",
3726
+ "T"
3727
+ ];
3728
+ };
3729
+ //#endregion
3730
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js
3731
+ var Hour1to12Parser = class extends Parser {
3732
+ priority = 70;
3733
+ parse(dateString, token, match) {
3734
+ switch (token) {
3735
+ case "h": return parseNumericPattern(numericPatterns.hour12h, dateString);
3736
+ case "ho": return match.ordinalNumber(dateString, { unit: "hour" });
3737
+ default: return parseNDigits(token.length, dateString);
3738
+ }
3739
+ }
3740
+ validate(_date, value) {
3741
+ return value >= 1 && value <= 12;
3742
+ }
3743
+ set(date, _flags, value) {
3744
+ const isPM = date.getHours() >= 12;
3745
+ if (isPM && value < 12) date.setHours(value + 12, 0, 0, 0);
3746
+ else if (!isPM && value === 12) date.setHours(0, 0, 0, 0);
3747
+ else date.setHours(value, 0, 0, 0);
3748
+ return date;
3749
+ }
3750
+ incompatibleTokens = [
3751
+ "H",
3752
+ "K",
3753
+ "k",
3754
+ "t",
3755
+ "T"
3756
+ ];
3757
+ };
3758
+ //#endregion
3759
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js
3760
+ var Hour0to23Parser = class extends Parser {
3761
+ priority = 70;
3762
+ parse(dateString, token, match) {
3763
+ switch (token) {
3764
+ case "H": return parseNumericPattern(numericPatterns.hour23h, dateString);
3765
+ case "Ho": return match.ordinalNumber(dateString, { unit: "hour" });
3766
+ default: return parseNDigits(token.length, dateString);
3767
+ }
3768
+ }
3769
+ validate(_date, value) {
3770
+ return value >= 0 && value <= 23;
3771
+ }
3772
+ set(date, _flags, value) {
3773
+ date.setHours(value, 0, 0, 0);
3774
+ return date;
3775
+ }
3776
+ incompatibleTokens = [
3777
+ "a",
3778
+ "b",
3779
+ "h",
3780
+ "K",
3781
+ "k",
3782
+ "t",
3783
+ "T"
3784
+ ];
3785
+ };
3786
+ //#endregion
3787
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js
3788
+ var Hour0To11Parser = class extends Parser {
3789
+ priority = 70;
3790
+ parse(dateString, token, match) {
3791
+ switch (token) {
3792
+ case "K": return parseNumericPattern(numericPatterns.hour11h, dateString);
3793
+ case "Ko": return match.ordinalNumber(dateString, { unit: "hour" });
3794
+ default: return parseNDigits(token.length, dateString);
3795
+ }
3796
+ }
3797
+ validate(_date, value) {
3798
+ return value >= 0 && value <= 11;
3799
+ }
3800
+ set(date, _flags, value) {
3801
+ if (date.getHours() >= 12 && value < 12) date.setHours(value + 12, 0, 0, 0);
3802
+ else date.setHours(value, 0, 0, 0);
3803
+ return date;
3804
+ }
3805
+ incompatibleTokens = [
3806
+ "h",
3807
+ "H",
3808
+ "k",
3809
+ "t",
3810
+ "T"
3811
+ ];
3812
+ };
3813
+ //#endregion
3814
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js
3815
+ var Hour1To24Parser = class extends Parser {
3816
+ priority = 70;
3817
+ parse(dateString, token, match) {
3818
+ switch (token) {
3819
+ case "k": return parseNumericPattern(numericPatterns.hour24h, dateString);
3820
+ case "ko": return match.ordinalNumber(dateString, { unit: "hour" });
3821
+ default: return parseNDigits(token.length, dateString);
3822
+ }
3823
+ }
3824
+ validate(_date, value) {
3825
+ return value >= 1 && value <= 24;
3826
+ }
3827
+ set(date, _flags, value) {
3828
+ const hours = value <= 24 ? value % 24 : value;
3829
+ date.setHours(hours, 0, 0, 0);
3830
+ return date;
3831
+ }
3832
+ incompatibleTokens = [
3833
+ "a",
3834
+ "b",
3835
+ "h",
3836
+ "H",
3837
+ "K",
3838
+ "t",
3839
+ "T"
3840
+ ];
3841
+ };
3842
+ //#endregion
3843
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js
3844
+ var MinuteParser = class extends Parser {
3845
+ priority = 60;
3846
+ parse(dateString, token, match) {
3847
+ switch (token) {
3848
+ case "m": return parseNumericPattern(numericPatterns.minute, dateString);
3849
+ case "mo": return match.ordinalNumber(dateString, { unit: "minute" });
3850
+ default: return parseNDigits(token.length, dateString);
3851
+ }
3852
+ }
3853
+ validate(_date, value) {
3854
+ return value >= 0 && value <= 59;
3855
+ }
3856
+ set(date, _flags, value) {
3857
+ date.setMinutes(value, 0, 0);
3858
+ return date;
3859
+ }
3860
+ incompatibleTokens = ["t", "T"];
3861
+ };
3862
+ //#endregion
3863
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.js
3864
+ var SecondParser = class extends Parser {
3865
+ priority = 50;
3866
+ parse(dateString, token, match) {
3867
+ switch (token) {
3868
+ case "s": return parseNumericPattern(numericPatterns.second, dateString);
3869
+ case "so": return match.ordinalNumber(dateString, { unit: "second" });
3870
+ default: return parseNDigits(token.length, dateString);
3871
+ }
3872
+ }
3873
+ validate(_date, value) {
3874
+ return value >= 0 && value <= 59;
3875
+ }
3876
+ set(date, _flags, value) {
3877
+ date.setSeconds(value, 0);
3878
+ return date;
3879
+ }
3880
+ incompatibleTokens = ["t", "T"];
3881
+ };
3882
+ //#endregion
3883
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js
3884
+ var FractionOfSecondParser = class extends Parser {
3885
+ priority = 30;
3886
+ parse(dateString, token) {
3887
+ const valueCallback = (value) => Math.trunc(value * Math.pow(10, -token.length + 3));
3888
+ return mapValue(parseNDigits(token.length, dateString), valueCallback);
3889
+ }
3890
+ set(date, _flags, value) {
3891
+ date.setMilliseconds(value);
3892
+ return date;
3893
+ }
3894
+ incompatibleTokens = ["t", "T"];
3895
+ };
3896
+ //#endregion
3897
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js
3898
+ var ISOTimezoneWithZParser = class extends Parser {
3899
+ priority = 10;
3900
+ parse(dateString, token) {
3901
+ switch (token) {
3902
+ case "X": return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
3903
+ case "XX": return parseTimezonePattern(timezonePatterns.basic, dateString);
3904
+ case "XXXX": return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
3905
+ case "XXXXX": return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
3906
+ default: return parseTimezonePattern(timezonePatterns.extended, dateString);
3907
+ }
3908
+ }
3909
+ set(date, flags, value) {
3910
+ if (flags.timestampIsSet) return date;
3911
+ return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
3912
+ }
3913
+ incompatibleTokens = [
3914
+ "t",
3915
+ "T",
3916
+ "x"
3917
+ ];
3918
+ };
3919
+ //#endregion
3920
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js
3921
+ var ISOTimezoneParser = class extends Parser {
3922
+ priority = 10;
3923
+ parse(dateString, token) {
3924
+ switch (token) {
3925
+ case "x": return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, dateString);
3926
+ case "xx": return parseTimezonePattern(timezonePatterns.basic, dateString);
3927
+ case "xxxx": return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, dateString);
3928
+ case "xxxxx": return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, dateString);
3929
+ default: return parseTimezonePattern(timezonePatterns.extended, dateString);
3930
+ }
3931
+ }
3932
+ set(date, flags, value) {
3933
+ if (flags.timestampIsSet) return date;
3934
+ return constructFrom(date, date.getTime() - getTimezoneOffsetInMilliseconds(date) - value);
3935
+ }
3936
+ incompatibleTokens = [
3937
+ "t",
3938
+ "T",
3939
+ "X"
3940
+ ];
3941
+ };
3942
+ //#endregion
3943
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js
3944
+ var TimestampSecondsParser = class extends Parser {
3945
+ priority = 40;
3946
+ parse(dateString) {
3947
+ return parseAnyDigitsSigned(dateString);
3948
+ }
3949
+ set(date, _flags, value) {
3950
+ return [constructFrom(date, value * 1e3), { timestampIsSet: true }];
3951
+ }
3952
+ incompatibleTokens = "*";
3953
+ };
3954
+ //#endregion
3955
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js
3956
+ var TimestampMillisecondsParser = class extends Parser {
3957
+ priority = 20;
3958
+ parse(dateString) {
3959
+ return parseAnyDigitsSigned(dateString);
3960
+ }
3961
+ set(date, _flags, value) {
3962
+ return [constructFrom(date, value), { timestampIsSet: true }];
3963
+ }
3964
+ incompatibleTokens = "*";
3965
+ };
3966
+ //#endregion
3967
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse/_lib/parsers.js
3968
+ var parsers = {
3969
+ G: new EraParser(),
3970
+ y: new YearParser(),
3971
+ Y: new LocalWeekYearParser(),
3972
+ R: new ISOWeekYearParser(),
3973
+ u: new ExtendedYearParser(),
3974
+ Q: new QuarterParser(),
3975
+ q: new StandAloneQuarterParser(),
3976
+ M: new MonthParser(),
3977
+ L: new StandAloneMonthParser(),
3978
+ w: new LocalWeekParser(),
3979
+ I: new ISOWeekParser(),
3980
+ d: new DateParser(),
3981
+ D: new DayOfYearParser(),
3982
+ E: new DayParser(),
3983
+ e: new LocalDayParser(),
3984
+ c: new StandAloneLocalDayParser(),
3985
+ i: new ISODayParser(),
3986
+ a: new AMPMParser(),
3987
+ b: new AMPMMidnightParser(),
3988
+ B: new DayPeriodParser(),
3989
+ h: new Hour1to12Parser(),
3990
+ H: new Hour0to23Parser(),
3991
+ K: new Hour0To11Parser(),
3992
+ k: new Hour1To24Parser(),
3993
+ m: new MinuteParser(),
3994
+ s: new SecondParser(),
3995
+ S: new FractionOfSecondParser(),
3996
+ X: new ISOTimezoneWithZParser(),
3997
+ x: new ISOTimezoneParser(),
3998
+ t: new TimestampSecondsParser(),
3999
+ T: new TimestampMillisecondsParser()
4000
+ };
4001
+ //#endregion
4002
+ //#region ../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/parse.js
4003
+ /**
4004
+ * The {@link parse} function options.
4005
+ */
4006
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
4007
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
4008
+ var escapedStringRegExp = /^'([^]*?)'?$/;
4009
+ var doubleQuoteRegExp = /''/g;
4010
+ var notWhitespaceRegExp = /\S/;
4011
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
4012
+ /**
4013
+ * @name parse
4014
+ * @category Common Helpers
4015
+ * @summary Parse the date.
4016
+ *
4017
+ * @description
4018
+ * Return the date parsed from string using the given format string.
4019
+ *
4020
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
4021
+ * > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
4022
+ *
4023
+ * The characters in the format string wrapped between two single quotes characters (') are escaped.
4024
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
4025
+ *
4026
+ * Format of the format string is based on Unicode Technical Standard #35:
4027
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
4028
+ * with a few additions (see note 5 below the table).
4029
+ *
4030
+ * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
4031
+ * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
4032
+ *
4033
+ * ```javascript
4034
+ * parse('23 AM', 'HH a', new Date())
4035
+ * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
4036
+ * ```
4037
+ *
4038
+ * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
4039
+ *
4040
+ * Accepted format string patterns:
4041
+ * | Unit |Prior| Pattern | Result examples | Notes |
4042
+ * |---------------------------------|-----|---------|-----------------------------------|-------|
4043
+ * | Era | 140 | G..GGG | AD, BC | |
4044
+ * | | | GGGG | Anno Domini, Before Christ | 2 |
4045
+ * | | | GGGGG | A, B | |
4046
+ * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
4047
+ * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
4048
+ * | | | yy | 44, 01, 00, 17 | 4 |
4049
+ * | | | yyy | 044, 001, 123, 999 | 4 |
4050
+ * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
4051
+ * | | | yyyyy | ... | 2,4 |
4052
+ * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
4053
+ * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
4054
+ * | | | YY | 44, 01, 00, 17 | 4,6 |
4055
+ * | | | YYY | 044, 001, 123, 999 | 4 |
4056
+ * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
4057
+ * | | | YYYYY | ... | 2,4 |
4058
+ * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
4059
+ * | | | RR | -43, 01, 00, 17 | 4,5 |
4060
+ * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
4061
+ * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
4062
+ * | | | RRRRR | ... | 2,4,5 |
4063
+ * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
4064
+ * | | | uu | -43, 01, 99, -99 | 4 |
4065
+ * | | | uuu | -043, 001, 123, 999, -999 | 4 |
4066
+ * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
4067
+ * | | | uuuuu | ... | 2,4 |
4068
+ * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
4069
+ * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
4070
+ * | | | QQ | 01, 02, 03, 04 | |
4071
+ * | | | QQQ | Q1, Q2, Q3, Q4 | |
4072
+ * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
4073
+ * | | | QQQQQ | 1, 2, 3, 4 | 4 |
4074
+ * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
4075
+ * | | | qo | 1st, 2nd, 3rd, 4th | 5 |
4076
+ * | | | qq | 01, 02, 03, 04 | |
4077
+ * | | | qqq | Q1, Q2, Q3, Q4 | |
4078
+ * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
4079
+ * | | | qqqqq | 1, 2, 3, 4 | 3 |
4080
+ * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
4081
+ * | | | Mo | 1st, 2nd, ..., 12th | 5 |
4082
+ * | | | MM | 01, 02, ..., 12 | |
4083
+ * | | | MMM | Jan, Feb, ..., Dec | |
4084
+ * | | | MMMM | January, February, ..., December | 2 |
4085
+ * | | | MMMMM | J, F, ..., D | |
4086
+ * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
4087
+ * | | | Lo | 1st, 2nd, ..., 12th | 5 |
4088
+ * | | | LL | 01, 02, ..., 12 | |
4089
+ * | | | LLL | Jan, Feb, ..., Dec | |
4090
+ * | | | LLLL | January, February, ..., December | 2 |
4091
+ * | | | LLLLL | J, F, ..., D | |
4092
+ * | Local week of year | 100 | w | 1, 2, ..., 53 | |
4093
+ * | | | wo | 1st, 2nd, ..., 53th | 5 |
4094
+ * | | | ww | 01, 02, ..., 53 | |
4095
+ * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
4096
+ * | | | Io | 1st, 2nd, ..., 53th | 5 |
4097
+ * | | | II | 01, 02, ..., 53 | 5 |
4098
+ * | Day of month | 90 | d | 1, 2, ..., 31 | |
4099
+ * | | | do | 1st, 2nd, ..., 31st | 5 |
4100
+ * | | | dd | 01, 02, ..., 31 | |
4101
+ * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
4102
+ * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
4103
+ * | | | DD | 01, 02, ..., 365, 366 | 7 |
4104
+ * | | | DDD | 001, 002, ..., 365, 366 | |
4105
+ * | | | DDDD | ... | 2 |
4106
+ * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
4107
+ * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
4108
+ * | | | EEEEE | M, T, W, T, F, S, S | |
4109
+ * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
4110
+ * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
4111
+ * | | | io | 1st, 2nd, ..., 7th | 5 |
4112
+ * | | | ii | 01, 02, ..., 07 | 5 |
4113
+ * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
4114
+ * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
4115
+ * | | | iiiii | M, T, W, T, F, S, S | 5 |
4116
+ * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
4117
+ * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
4118
+ * | | | eo | 2nd, 3rd, ..., 1st | 5 |
4119
+ * | | | ee | 02, 03, ..., 01 | |
4120
+ * | | | eee | Mon, Tue, Wed, ..., Sun | |
4121
+ * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
4122
+ * | | | eeeee | M, T, W, T, F, S, S | |
4123
+ * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
4124
+ * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
4125
+ * | | | co | 2nd, 3rd, ..., 1st | 5 |
4126
+ * | | | cc | 02, 03, ..., 01 | |
4127
+ * | | | ccc | Mon, Tue, Wed, ..., Sun | |
4128
+ * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
4129
+ * | | | ccccc | M, T, W, T, F, S, S | |
4130
+ * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
4131
+ * | AM, PM | 80 | a..aaa | AM, PM | |
4132
+ * | | | aaaa | a.m., p.m. | 2 |
4133
+ * | | | aaaaa | a, p | |
4134
+ * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
4135
+ * | | | bbbb | a.m., p.m., noon, midnight | 2 |
4136
+ * | | | bbbbb | a, p, n, mi | |
4137
+ * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
4138
+ * | | | BBBB | at night, in the morning, ... | 2 |
4139
+ * | | | BBBBB | at night, in the morning, ... | |
4140
+ * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
4141
+ * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
4142
+ * | | | hh | 01, 02, ..., 11, 12 | |
4143
+ * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
4144
+ * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
4145
+ * | | | HH | 00, 01, 02, ..., 23 | |
4146
+ * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
4147
+ * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
4148
+ * | | | KK | 01, 02, ..., 11, 00 | |
4149
+ * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
4150
+ * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
4151
+ * | | | kk | 24, 01, 02, ..., 23 | |
4152
+ * | Minute | 60 | m | 0, 1, ..., 59 | |
4153
+ * | | | mo | 0th, 1st, ..., 59th | 5 |
4154
+ * | | | mm | 00, 01, ..., 59 | |
4155
+ * | Second | 50 | s | 0, 1, ..., 59 | |
4156
+ * | | | so | 0th, 1st, ..., 59th | 5 |
4157
+ * | | | ss | 00, 01, ..., 59 | |
4158
+ * | Seconds timestamp | 40 | t | 512969520 | |
4159
+ * | | | tt | ... | 2 |
4160
+ * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
4161
+ * | | | SS | 00, 01, ..., 99 | |
4162
+ * | | | SSS | 000, 001, ..., 999 | |
4163
+ * | | | SSSS | ... | 2 |
4164
+ * | Milliseconds timestamp | 20 | T | 512969520900 | |
4165
+ * | | | TT | ... | 2 |
4166
+ * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
4167
+ * | | | XX | -0800, +0530, Z | |
4168
+ * | | | XXX | -08:00, +05:30, Z | |
4169
+ * | | | XXXX | -0800, +0530, Z, +123456 | 2 |
4170
+ * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
4171
+ * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
4172
+ * | | | xx | -0800, +0530, +0000 | |
4173
+ * | | | xxx | -08:00, +05:30, +00:00 | 2 |
4174
+ * | | | xxxx | -0800, +0530, +0000, +123456 | |
4175
+ * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
4176
+ * | Long localized date | NA | P | 05/29/1453 | 5,8 |
4177
+ * | | | PP | May 29, 1453 | |
4178
+ * | | | PPP | May 29th, 1453 | |
4179
+ * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
4180
+ * | Long localized time | NA | p | 12:00 AM | 5,8 |
4181
+ * | | | pp | 12:00:00 AM | |
4182
+ * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
4183
+ * | | | PPpp | May 29, 1453, 12:00:00 AM | |
4184
+ * | | | PPPpp | May 29th, 1453 at ... | |
4185
+ * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
4186
+ * Notes:
4187
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
4188
+ * are the same as "stand-alone" units, but are different in some languages.
4189
+ * "Formatting" units are declined according to the rules of the language
4190
+ * in the context of a date. "Stand-alone" units are always nominative singular.
4191
+ * In `format` function, they will produce different result:
4192
+ *
4193
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
4194
+ *
4195
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
4196
+ *
4197
+ * `parse` will try to match both formatting and stand-alone units interchangeably.
4198
+ *
4199
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
4200
+ * the single quote characters (see below).
4201
+ * If the sequence is longer than listed in table:
4202
+ * - for numerical units (`yyyyyyyy`) `parse` will try to match a number
4203
+ * as wide as the sequence
4204
+ * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
4205
+ * These variations are marked with "2" in the last column of the table.
4206
+ *
4207
+ * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
4208
+ * These tokens represent the shortest form of the quarter.
4209
+ *
4210
+ * 4. The main difference between `y` and `u` patterns are B.C. years:
4211
+ *
4212
+ * | Year | `y` | `u` |
4213
+ * |------|-----|-----|
4214
+ * | AC 1 | 1 | 1 |
4215
+ * | BC 1 | 1 | 0 |
4216
+ * | BC 2 | 2 | -1 |
4217
+ *
4218
+ * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
4219
+ *
4220
+ * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
4221
+ *
4222
+ * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
4223
+ *
4224
+ * while `uu` will just assign the year as is:
4225
+ *
4226
+ * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
4227
+ *
4228
+ * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
4229
+ *
4230
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
4231
+ * except local week-numbering years are dependent on `options.weekStartsOn`
4232
+ * and `options.firstWeekContainsDate` (compare [setISOWeekYear](https://date-fns.org/docs/setISOWeekYear)
4233
+ * and [setWeekYear](https://date-fns.org/docs/setWeekYear)).
4234
+ *
4235
+ * 5. These patterns are not in the Unicode Technical Standard #35:
4236
+ * - `i`: ISO day of week
4237
+ * - `I`: ISO week of year
4238
+ * - `R`: ISO week-numbering year
4239
+ * - `o`: ordinal number modifier
4240
+ * - `P`: long localized date
4241
+ * - `p`: long localized time
4242
+ *
4243
+ * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
4244
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
4245
+ *
4246
+ * 7. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
4247
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
4248
+ *
4249
+ * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
4250
+ * on the given locale.
4251
+ *
4252
+ * using `en-US` locale: `P` => `MM/dd/yyyy`
4253
+ * using `en-US` locale: `p` => `hh:mm a`
4254
+ * using `pt-BR` locale: `P` => `dd/MM/yyyy`
4255
+ * using `pt-BR` locale: `p` => `HH:mm`
4256
+ *
4257
+ * Values will be assigned to the date in the descending order of its unit's priority.
4258
+ * Units of an equal priority overwrite each other in the order of appearance.
4259
+ *
4260
+ * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
4261
+ * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
4262
+ *
4263
+ * `referenceDate` must be passed for correct work of the function.
4264
+ * If you're not sure which `referenceDate` to supply, create a new instance of Date:
4265
+ * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
4266
+ * In this case parsing will be done in the context of the current date.
4267
+ * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
4268
+ * then `Invalid Date` will be returned.
4269
+ *
4270
+ * The result may vary by locale.
4271
+ *
4272
+ * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
4273
+ *
4274
+ * If parsing failed, `Invalid Date` will be returned.
4275
+ * Invalid Date is a Date, whose time value is NaN.
4276
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
4277
+ *
4278
+ * @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).
4279
+ * @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
4280
+ *
4281
+ * @param dateStr - The string to parse
4282
+ * @param formatStr - The string of tokens
4283
+ * @param referenceDate - defines values missing from the parsed dateString
4284
+ * @param options - An object with options.
4285
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
4286
+ * see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
4287
+ *
4288
+ * @returns The parsed date
4289
+ *
4290
+ * @throws `options.locale` must contain `match` property
4291
+ * @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
4292
+ * @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
4293
+ * @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
4294
+ * @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
4295
+ * @throws format string contains an unescaped latin alphabet character
4296
+ *
4297
+ * @example
4298
+ * // Parse 11 February 2014 from middle-endian format:
4299
+ * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
4300
+ * //=> Tue Feb 11 2014 00:00:00
4301
+ *
4302
+ * @example
4303
+ * // Parse 28th of February in Esperanto locale in the context of 2010 year:
4304
+ * import eo from 'date-fns/locale/eo'
4305
+ * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
4306
+ * locale: eo
4307
+ * })
4308
+ * //=> Sun Feb 28 2010 00:00:00
4309
+ */
4310
+ function parse(dateStr, formatStr, referenceDate, options) {
4311
+ const invalidDate = () => constructFrom(options?.in || referenceDate, NaN);
4312
+ const defaultOptions = getDefaultOptions();
4313
+ const locale = options?.locale ?? defaultOptions.locale ?? enUS;
4314
+ const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions.firstWeekContainsDate ?? defaultOptions.locale?.options?.firstWeekContainsDate ?? 1;
4315
+ const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions.weekStartsOn ?? defaultOptions.locale?.options?.weekStartsOn ?? 0;
4316
+ if (!formatStr) return dateStr ? invalidDate() : toDate(referenceDate, options?.in);
4317
+ const subFnOptions = {
4318
+ firstWeekContainsDate,
4319
+ weekStartsOn,
4320
+ locale
4321
+ };
4322
+ const setters = [new DateTimezoneSetter(options?.in, referenceDate)];
4323
+ const tokens = formatStr.match(longFormattingTokensRegExp).map((substring) => {
4324
+ const firstCharacter = substring[0];
4325
+ if (firstCharacter in longFormatters) {
4326
+ const longFormatter = longFormatters[firstCharacter];
4327
+ return longFormatter(substring, locale.formatLong);
4328
+ }
4329
+ return substring;
4330
+ }).join("").match(formattingTokensRegExp);
4331
+ const usedTokens = [];
4332
+ for (let token of tokens) {
4333
+ if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) warnOrThrowProtectedError(token, formatStr, dateStr);
4334
+ if (!options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) warnOrThrowProtectedError(token, formatStr, dateStr);
4335
+ const firstCharacter = token[0];
4336
+ const parser = parsers[firstCharacter];
4337
+ if (parser) {
4338
+ const { incompatibleTokens } = parser;
4339
+ if (Array.isArray(incompatibleTokens)) {
4340
+ const incompatibleToken = usedTokens.find((usedToken) => incompatibleTokens.includes(usedToken.token) || usedToken.token === firstCharacter);
4341
+ if (incompatibleToken) throw new RangeError(`The format string mustn't contain \`${incompatibleToken.fullToken}\` and \`${token}\` at the same time`);
4342
+ } else if (parser.incompatibleTokens === "*" && usedTokens.length > 0) throw new RangeError(`The format string mustn't contain \`${token}\` and any other token at the same time`);
4343
+ usedTokens.push({
4344
+ token: firstCharacter,
4345
+ fullToken: token
4346
+ });
4347
+ const parseResult = parser.run(dateStr, token, locale.match, subFnOptions);
4348
+ if (!parseResult) return invalidDate();
4349
+ setters.push(parseResult.setter);
4350
+ dateStr = parseResult.rest;
4351
+ } else {
4352
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
4353
+ if (token === "''") token = "'";
4354
+ else if (firstCharacter === "'") token = cleanEscapedString(token);
4355
+ if (dateStr.indexOf(token) === 0) dateStr = dateStr.slice(token.length);
4356
+ else return invalidDate();
4357
+ }
4358
+ }
4359
+ if (dateStr.length > 0 && notWhitespaceRegExp.test(dateStr)) return invalidDate();
4360
+ const uniquePrioritySetters = setters.map((setter) => setter.priority).sort((a, b) => b - a).filter((priority, index, array) => array.indexOf(priority) === index).map((priority) => setters.filter((setter) => setter.priority === priority).sort((a, b) => b.subPriority - a.subPriority)).map((setterArray) => setterArray[0]);
4361
+ let date = toDate(referenceDate, options?.in);
4362
+ if (isNaN(+date)) return invalidDate();
4363
+ const flags = {};
4364
+ for (const setter of uniquePrioritySetters) {
4365
+ if (!setter.validate(date, subFnOptions)) return invalidDate();
4366
+ const result = setter.set(date, flags, subFnOptions);
4367
+ if (Array.isArray(result)) {
4368
+ date = result[0];
4369
+ Object.assign(flags, result[1]);
4370
+ } else date = result;
4371
+ }
4372
+ return date;
4373
+ }
4374
+ function cleanEscapedString(input) {
4375
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
4376
+ }
4377
+ //#endregion
40
4378
  //#region src/shared/datetime/presentationDate.ts
41
4379
  var formatPresentationDate = (dateStr, locale) => {
42
- return (0, date_fns.format)(parseDateStr(dateStr), locale.dateFormat);
4380
+ return format(parseDateStr(dateStr), locale.dateFormat);
43
4381
  };
44
4382
  /**
45
4383
  * Parse a presentation date, which is the locale specific format (e.g. DD/MM/YYYY for en-GB).
@@ -47,7 +4385,7 @@ var formatPresentationDate = (dateStr, locale) => {
47
4385
  * Will throw if the date is can't be parsed
48
4386
  */
49
4387
  var parsePresentationDate = (presentationDate, locale) => {
50
- return formatDateStr((0, date_fns.parse)(presentationDate, locale.dateFormat, /* @__PURE__ */ new Date()));
4388
+ return formatDateStr(parse(presentationDate, locale.dateFormat, /* @__PURE__ */ new Date()));
51
4389
  };
52
4390
  //#endregion
53
4391
  //#region src/shared/datetime/month.ts
@@ -356,10 +4694,10 @@ var CalendarPicker = (Base) => {
356
4694
  */
357
4695
  _onDateKeydown(date, event) {
358
4696
  let newDate = null;
359
- if (event.key === "ArrowUp") newDate = addDays$1(date, -7);
360
- else if (event.key === "ArrowDown") newDate = addDays$1(date, 7);
361
- else if (event.key === "ArrowLeft") newDate = addDays$1(date, -1);
362
- else if (event.key === "ArrowRight") newDate = addDays$1(date, 1);
4697
+ if (event.key === "ArrowUp") newDate = addDays$2(date, -7);
4698
+ else if (event.key === "ArrowDown") newDate = addDays$2(date, 7);
4699
+ else if (event.key === "ArrowLeft") newDate = addDays$2(date, -1);
4700
+ else if (event.key === "ArrowRight") newDate = addDays$2(date, 1);
363
4701
  if (newDate && this._isDateInValidRange(newDate)) {
364
4702
  if (this._adjustSelectedMonthToEnsureVisibilityOf(newDate)) _microsoft_fast_element.Updates.process();
365
4703
  this._dialogEl.querySelector(`[data-date="${newDate}"]`).focus();