@designsystem-se/af 39.0.1-beta.dark-mode → 39.1.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 (493) hide show
  1. package/README.md +1 -1
  2. package/components/digi-badge-status.js +1 -1
  3. package/components/digi-bar-chart.js +1 -1
  4. package/components/digi-button.js +1 -1
  5. package/components/digi-calendar-datepicker.js +6 -6
  6. package/components/digi-calendar-week-view.js +1 -1
  7. package/components/digi-calendar.js +1 -1
  8. package/components/digi-chart-line.js +1 -1
  9. package/components/digi-code-block.js +1 -1
  10. package/components/digi-code-example.js +8 -8
  11. package/components/digi-context-menu.js +2 -2
  12. package/components/digi-dialog.js +5 -5
  13. package/components/digi-expandable-faq-item.js +1 -1
  14. package/components/digi-footer.js +3 -3
  15. package/components/digi-form-category-filter.js +1 -1
  16. package/components/digi-form-checkbox.js +1 -1
  17. package/components/digi-form-error-list.js +5 -5
  18. package/components/digi-form-file-upload.js +1 -1
  19. package/components/digi-form-filter.js +3 -3
  20. package/components/digi-form-input-search.js +1 -1
  21. package/components/digi-form-receipt.js +3 -3
  22. package/components/digi-form-select-filter.js +5 -5
  23. package/components/digi-form-select.js +1 -1
  24. package/components/digi-header-avatar.js +1 -1
  25. package/components/digi-header-navigation.js +4 -4
  26. package/components/digi-header.js +7 -7
  27. package/components/digi-info-card-multi.js +1 -1
  28. package/components/digi-info-card.js +2 -2
  29. package/components/digi-link-button.js +1 -1
  30. package/components/digi-link-internal.js +1 -1
  31. package/components/digi-navigation-pagination.js +4 -4
  32. package/components/digi-navigation-sidebar-button.js +1 -1
  33. package/components/digi-navigation-sidebar.js +1 -1
  34. package/components/digi-navigation-vertical-menu-item.js +1 -1
  35. package/components/digi-notification-alert.js +1 -1
  36. package/components/digi-notification-error-page.js +3 -3
  37. package/components/digi-progress-circle.js +12 -10
  38. package/components/digi-progress-indicator.js +8 -6
  39. package/components/digi-progress-list-item.js +1 -1
  40. package/components/digi-quote.js +1 -1
  41. package/components/digi-tag.js +1 -1
  42. package/components/digi-title-logo.js +3 -3
  43. package/components/digi-tools-feedback.js +5 -5
  44. package/components/digi-tools-theme-provider.js +5 -18
  45. package/components/index.js +3 -3
  46. package/components/{p-90f7d507.js → p-36826879.js} +5 -5
  47. package/components/p-4bad4fb0.js +7 -0
  48. package/components/p-70fad0ea.js +165 -0
  49. package/components/{p-0207ebef.js → p-9df35672.js} +1 -1
  50. package/components/{p-8562da9d.js → p-a1255d30.js} +4 -4
  51. package/components/p-ab07faba.js +66 -0
  52. package/components/{p-9dd5d6c8.js → p-d0f35bd6.js} +11 -1
  53. package/components/{p-99793659.js → p-dbb0665a.js} +2 -2
  54. package/components/{p-b94458ed.js → p-e2a68e2b.js} +1 -1
  55. package/components/p-f84f590e.js +177 -0
  56. package/components/p-fe63f0b9.js +17 -0
  57. package/custom-elements.json +8 -4
  58. package/dist/cjs/button-size.enum-1fd86b9e.js +7 -0
  59. package/dist/cjs/button-type.enum-406723db.js +8 -0
  60. package/dist/cjs/{code-example-variation.enum-1611825e.js → code-example-variation.enum-c6557727.js} +0 -6
  61. package/dist/cjs/digi-arbetsformedlingen.cjs.js +1 -1
  62. package/dist/cjs/digi-badge-status.cjs.entry.js +1 -1
  63. package/dist/cjs/digi-button.cjs.entry.js +130 -0
  64. package/dist/cjs/digi-calendar-datepicker.cjs.entry.js +2605 -0
  65. package/dist/cjs/digi-calendar-week-view.cjs.entry.js +51 -50
  66. package/dist/cjs/digi-calendar_2.cjs.entry.js +464 -0
  67. package/dist/cjs/{digi-code-block_2.cjs.entry.js → digi-code-block_3.cjs.entry.js} +140 -5
  68. package/dist/cjs/digi-code-example.cjs.entry.js +9 -8
  69. package/dist/cjs/digi-context-menu.cjs.entry.js +240 -0
  70. package/dist/cjs/digi-dialog.cjs.entry.js +26 -6
  71. package/dist/cjs/digi-expandable-faq-item.cjs.entry.js +97 -0
  72. package/dist/cjs/digi-footer-card.cjs.entry.js +29 -0
  73. package/dist/cjs/digi-footer.cjs.entry.js +78 -0
  74. package/dist/cjs/digi-form-category-filter.cjs.entry.js +121 -0
  75. package/dist/cjs/digi-form-checkbox.cjs.entry.js +139 -0
  76. package/dist/cjs/digi-form-error-list.cjs.entry.js +24 -4
  77. package/dist/cjs/digi-form-file-upload.cjs.entry.js +602 -0
  78. package/dist/cjs/digi-form-filter.cjs.entry.js +248 -0
  79. package/dist/cjs/digi-form-input-search.cjs.entry.js +8 -6
  80. package/dist/cjs/digi-form-input.cjs.entry.js +194 -0
  81. package/dist/cjs/digi-form-label_3.cjs.entry.js +129 -0
  82. package/dist/cjs/digi-form-receipt.cjs.entry.js +24 -4
  83. package/dist/cjs/digi-form-select-filter.cjs.entry.js +605 -0
  84. package/dist/cjs/digi-form-select_2.cjs.entry.js +186 -0
  85. package/dist/cjs/digi-header-avatar.cjs.entry.js +114 -0
  86. package/dist/cjs/digi-header-navigation-item.cjs.entry.js +27 -0
  87. package/dist/cjs/digi-header-navigation.cjs.entry.js +232 -0
  88. package/dist/cjs/digi-header-notification.cjs.entry.js +23 -0
  89. package/dist/cjs/digi-header.cjs.entry.js +119 -0
  90. package/dist/cjs/digi-icon-accessibility-universal.cjs.entry.js +30 -0
  91. package/dist/cjs/digi-icon-bars.cjs.entry.js +30 -0
  92. package/dist/cjs/digi-icon-bell-filled.cjs.entry.js +30 -0
  93. package/dist/cjs/digi-icon-check-circle-solid_4.cjs.entry.js +99 -0
  94. package/dist/cjs/digi-icon-check_6.cjs.entry.js +340 -0
  95. package/dist/cjs/digi-icon-chevron-down.cjs.entry.js +30 -0
  96. package/dist/cjs/digi-icon-chevron-left_2.cjs.entry.js +53 -0
  97. package/dist/cjs/digi-icon-copy.cjs.entry.js +30 -0
  98. package/dist/cjs/digi-icon-envelope.cjs.entry.js +30 -0
  99. package/dist/cjs/digi-icon-external-link-alt_2.cjs.entry.js +60 -0
  100. package/dist/cjs/digi-icon-globe.cjs.entry.js +30 -0
  101. package/dist/cjs/digi-icon-list-ul_6.cjs.entry.js +145 -0
  102. package/dist/cjs/digi-icon-minus_2.cjs.entry.js +53 -0
  103. package/dist/cjs/digi-icon-notification-error_4.cjs.entry.js +99 -0
  104. package/dist/cjs/digi-icon-sign.cjs.entry.js +30 -0
  105. package/dist/cjs/digi-icon-spinner.cjs.entry.js +31 -0
  106. package/dist/cjs/digi-icon-x.cjs.entry.js +30 -0
  107. package/dist/cjs/digi-info-card-multi-container.cjs.entry.js +22 -0
  108. package/dist/cjs/digi-info-card-multi.cjs.entry.js +58 -0
  109. package/dist/cjs/digi-info-card.cjs.entry.js +79 -0
  110. package/dist/cjs/digi-layout-block_2.cjs.entry.js +92 -0
  111. package/dist/cjs/digi-layout-columns.cjs.entry.js +33 -0
  112. package/dist/cjs/digi-link-button.cjs.entry.js +66 -0
  113. package/dist/cjs/digi-link-internal.cjs.entry.js +37 -0
  114. package/dist/cjs/digi-link.cjs.entry.js +75 -0
  115. package/dist/cjs/digi-logo.cjs.entry.js +49 -0
  116. package/dist/cjs/digi-media-image_2.cjs.entry.js +167 -0
  117. package/dist/cjs/digi-navigation-pagination.cjs.entry.js +24 -4
  118. package/dist/cjs/digi-navigation-sidebar-button.cjs.entry.js +30 -0
  119. package/dist/cjs/digi-navigation-vertical-menu-item.cjs.entry.js +150 -0
  120. package/dist/cjs/digi-navigation-vertical-menu.cjs.entry.js +177 -0
  121. package/dist/cjs/digi-notification-alert.cjs.entry.js +116 -0
  122. package/dist/cjs/digi-notification-error-page.cjs.entry.js +24 -4
  123. package/dist/cjs/digi-progress-list-item.cjs.entry.js +1 -1
  124. package/dist/cjs/digi-quote.cjs.entry.js +1 -1
  125. package/dist/cjs/digi-tag-media.cjs.entry.js +47 -0
  126. package/dist/cjs/digi-title-logo.cjs.entry.js +137 -0
  127. package/dist/cjs/digi-tools-feedback.cjs.entry.js +27 -7
  128. package/dist/cjs/digi-tools-theme-provider.cjs.entry.js +28 -0
  129. package/dist/cjs/digi-typography-heading-jumbo.cjs.entry.js +38 -0
  130. package/dist/cjs/digi-typography-preamble.cjs.entry.js +20 -0
  131. package/dist/cjs/digi-typography.cjs.entry.js +26 -0
  132. package/dist/cjs/digi-util-breakpoint-observer.cjs.entry.js +48 -0
  133. package/dist/cjs/digi-util-keydown-handler.cjs.entry.js +83 -0
  134. package/dist/cjs/expandable-faq-item-variation.enum-89427195.js +18 -0
  135. package/dist/cjs/footer-card-variation.enum-99555edc.js +8 -0
  136. package/dist/cjs/form-checkbox-variation.enum-d2ca879e.js +19 -0
  137. package/dist/cjs/form-file-upload-variation.enum-634cfae8.js +24 -0
  138. package/dist/cjs/form-input-search-variation.enum-c50239bc.js +8 -0
  139. package/dist/cjs/{form-input-type.enum-1fb2180a.js → form-input-type.enum-9c8ee12a.js} +0 -14
  140. package/dist/cjs/form-input-variation.enum-c750520c.js +29 -0
  141. package/dist/cjs/form-select-variation.enum-528c1bf0.js +16 -0
  142. package/dist/cjs/form-validation-message-variation.enum-855ae0be.js +8 -0
  143. package/dist/cjs/index-7a477838.js +236 -8
  144. package/dist/cjs/{index-acb7b350.js → index-ac8e01b4.js} +19 -189
  145. package/dist/cjs/index-cad91a90.js +66 -0
  146. package/dist/cjs/index-e8333bcc.js +174 -0
  147. package/dist/cjs/index.cjs.js +223 -197
  148. package/dist/cjs/info-card-multi-type.enum-14746572.js +8 -0
  149. package/dist/cjs/info-card-variation.enum-64cef637.js +24 -0
  150. package/dist/cjs/layout-columns-variation.enum-65675649.js +23 -0
  151. package/dist/cjs/layout-container-max-width.enum-7e637f44.js +21 -0
  152. package/dist/cjs/link-button-variation.enum-137785e3.js +9 -0
  153. package/dist/cjs/loader.cjs.js +1 -1
  154. package/dist/cjs/logo-color.enum-76f6c506.js +7 -0
  155. package/dist/cjs/navigation-vertical-menu-variation.enum-c237edd3.js +13 -0
  156. package/dist/cjs/progress-indicator-heading-level.enum-13c38ed0.js +39 -0
  157. package/dist/cjs/tag-media-icon.enum-372563c5.js +11 -0
  158. package/dist/cjs/tools-theme-provider.brand.enum-bc855272.js +7 -0
  159. package/dist/cjs/typography-heading-jumbo-variation.enum-8677e099.js +17 -0
  160. package/dist/cjs/typography-variation.enum-50512a4e.js +238 -0
  161. package/dist/collection/components/_badge/badge-status/badge-status.css +2 -2
  162. package/dist/collection/components/_button/button/button.css +14 -14
  163. package/dist/collection/components/_calendar/calendar/calendar.css +3 -8
  164. package/dist/collection/components/_calendar/calendar-datepicker/calendar-datepicker.css +107 -427
  165. package/dist/collection/components/_code/code-example/code-example.css +0 -6
  166. package/dist/collection/components/_code/code-example/code-example.js +5 -4
  167. package/dist/collection/components/_dialog/dialog/dialog.css +1 -1
  168. package/dist/collection/components/_expandable/expandable-faq-item/expandable-faq-item.css +2 -2
  169. package/dist/collection/components/_form/form-checkbox/form-checkbox.css +106 -426
  170. package/dist/collection/components/_form/form-file-upload/form-file-upload.css +5 -6
  171. package/dist/collection/components/_form/form-filter/form-filter.css +2 -2
  172. package/dist/collection/components/_form/form-select/form-select.css +2 -2
  173. package/dist/collection/components/_form/form-select-filter/form-select-filter.css +3 -3
  174. package/dist/collection/components/_header/header/header.js +2 -2
  175. package/dist/collection/components/_header/header-avatar/header-avatar.css +105 -425
  176. package/dist/collection/components/_info-card/info-card/info-card.css +2 -2
  177. package/dist/collection/components/_info-card/info-card-multi/info-card-multi.css +1 -1
  178. package/dist/collection/components/_link/link-button/link-button.css +3 -3
  179. package/dist/collection/components/_link/link-internal/link-internal.css +105 -425
  180. package/dist/collection/components/_navigation/navigation-context-menu/navigation-context-menu.css +2 -3
  181. package/dist/collection/components/_navigation/navigation-vertical-menu-item/navigation-vertical-menu-item.css +3 -3
  182. package/dist/collection/components/_notification/notification-alert/notification-alert.css +1 -1
  183. package/dist/collection/components/_progress/progress-circle/progress-circle-heading-level.enum.js +9 -0
  184. package/dist/collection/components/_progress/progress-circle/progress-circle.js +41 -9
  185. package/dist/collection/components/_progress/progress-indicator/progress-indicator-heading-level.enum.js +9 -0
  186. package/dist/collection/components/_progress/progress-indicator/progress-indicator.css +4 -5
  187. package/dist/collection/components/_progress/progress-indicator/progress-indicator.js +36 -4
  188. package/dist/collection/components/_progress/progress-list-item/progress-list-item.css +2 -2
  189. package/dist/collection/components/_quote/quote/quote.css +2 -2
  190. package/dist/collection/components/_tools/tools-feedback/tools-feedback.css +1 -1
  191. package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.css +2 -166
  192. package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.js +2 -43
  193. package/dist/collection/design-tokens/components/_badge-status.variables.scss +1 -1
  194. package/dist/collection/design-tokens/components/_button.variables.scss +14 -14
  195. package/dist/collection/design-tokens/components/_calendar-datepicker.variables.scss +1 -1
  196. package/dist/collection/design-tokens/components/_calendar.variables.scss +3 -4
  197. package/dist/collection/design-tokens/components/_dialog.variables.scss +1 -1
  198. package/dist/collection/design-tokens/components/_expandable-faq-item.variables.scss +2 -2
  199. package/dist/collection/design-tokens/components/_form-checkbox.variables.scss +1 -1
  200. package/dist/collection/design-tokens/components/_form-file-upload.variables.scss +0 -2
  201. package/dist/collection/design-tokens/components/_form-filter.variables.scss +2 -2
  202. package/dist/collection/design-tokens/components/_form-select-filter.variables.scss +3 -3
  203. package/dist/collection/design-tokens/components/_form-select.variables.scss +2 -2
  204. package/dist/collection/design-tokens/components/_info-card-multi.variables.scss +1 -1
  205. package/dist/collection/design-tokens/components/_info-card.variables.scss +2 -2
  206. package/dist/collection/design-tokens/components/_link-button.variables.scss +3 -3
  207. package/dist/collection/design-tokens/components/_navigation-context-menu.variables.scss +1 -1
  208. package/dist/collection/design-tokens/components/_navigation-vertical-menu-item.variables.scss +3 -3
  209. package/dist/collection/design-tokens/components/_notification-alert.variables.scss +1 -1
  210. package/dist/collection/design-tokens/components/_progress-indicator.variables.scss +1 -1
  211. package/dist/collection/design-tokens/components/_quote.variables.scss +2 -2
  212. package/dist/collection/design-tokens/components/_tools-feedback.variables.scss +1 -1
  213. package/dist/collection/enums.js +2 -1
  214. package/dist/collection/styles/src/_alias.mixin.scss +105 -252
  215. package/dist/collection/styles/src/themes/_brand-af18.mixin.scss +0 -19
  216. package/dist/collection/styles/src/themes/_brand-af25.mixin.scss +0 -144
  217. package/dist/collection/styles/src/themes/_brand-common.mixin.scss +0 -7
  218. package/dist/collection/styles/src/tokens-documentation/web-AF25.json +132 -442
  219. package/dist/digi-arbetsformedlingen/design-tokens/components/_badge-status.variables.scss +1 -1
  220. package/dist/digi-arbetsformedlingen/design-tokens/components/_button.variables.scss +14 -14
  221. package/dist/digi-arbetsformedlingen/design-tokens/components/_calendar-datepicker.variables.scss +1 -1
  222. package/dist/digi-arbetsformedlingen/design-tokens/components/_calendar.variables.scss +3 -4
  223. package/dist/digi-arbetsformedlingen/design-tokens/components/_dialog.variables.scss +1 -1
  224. package/dist/digi-arbetsformedlingen/design-tokens/components/_expandable-faq-item.variables.scss +2 -2
  225. package/dist/digi-arbetsformedlingen/design-tokens/components/_form-checkbox.variables.scss +1 -1
  226. package/dist/digi-arbetsformedlingen/design-tokens/components/_form-file-upload.variables.scss +0 -2
  227. package/dist/digi-arbetsformedlingen/design-tokens/components/_form-filter.variables.scss +2 -2
  228. package/dist/digi-arbetsformedlingen/design-tokens/components/_form-select-filter.variables.scss +3 -3
  229. package/dist/digi-arbetsformedlingen/design-tokens/components/_form-select.variables.scss +2 -2
  230. package/dist/digi-arbetsformedlingen/design-tokens/components/_info-card-multi.variables.scss +1 -1
  231. package/dist/digi-arbetsformedlingen/design-tokens/components/_info-card.variables.scss +2 -2
  232. package/dist/digi-arbetsformedlingen/design-tokens/components/_link-button.variables.scss +3 -3
  233. package/dist/digi-arbetsformedlingen/design-tokens/components/_logo.variables.scss +2 -0
  234. package/dist/digi-arbetsformedlingen/design-tokens/components/_navigation-context-menu.variables.scss +1 -1
  235. package/dist/digi-arbetsformedlingen/design-tokens/components/_navigation-vertical-menu-item.variables.scss +3 -3
  236. package/dist/digi-arbetsformedlingen/design-tokens/components/_notification-alert.variables.scss +1 -1
  237. package/dist/digi-arbetsformedlingen/design-tokens/components/_progress-indicator.variables.scss +1 -1
  238. package/dist/digi-arbetsformedlingen/design-tokens/components/_quote.variables.scss +2 -2
  239. package/dist/digi-arbetsformedlingen/design-tokens/components/_tools-feedback.variables.scss +1 -1
  240. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.css +1 -1
  241. package/dist/digi-arbetsformedlingen/digi-arbetsformedlingen.esm.js +1 -1
  242. package/dist/digi-arbetsformedlingen/index.esm.js +1 -1
  243. package/dist/digi-arbetsformedlingen/p-02854c3f.entry.js +1 -0
  244. package/dist/digi-arbetsformedlingen/p-04033c3a.entry.js +1 -0
  245. package/dist/digi-arbetsformedlingen/p-045a1bd6.entry.js +1 -0
  246. package/dist/digi-arbetsformedlingen/p-07303cb5.js +1 -0
  247. package/dist/digi-arbetsformedlingen/p-0b2e2c33.entry.js +1 -0
  248. package/dist/digi-arbetsformedlingen/p-0ef5ec06.entry.js +1 -0
  249. package/dist/digi-arbetsformedlingen/p-0f6c0360.js +1 -0
  250. package/dist/digi-arbetsformedlingen/p-0fbe6e50.entry.js +1 -0
  251. package/dist/digi-arbetsformedlingen/p-10261517.entry.js +1 -0
  252. package/dist/digi-arbetsformedlingen/p-111fb07d.entry.js +1 -0
  253. package/dist/digi-arbetsformedlingen/p-1486034d.entry.js +1 -0
  254. package/dist/digi-arbetsformedlingen/p-197903bf.entry.js +1 -0
  255. package/dist/digi-arbetsformedlingen/p-1f3345e9.js +1 -0
  256. package/dist/digi-arbetsformedlingen/p-1f956af8.js +1 -0
  257. package/dist/digi-arbetsformedlingen/p-21b5747f.entry.js +1 -0
  258. package/dist/digi-arbetsformedlingen/p-2295239c.entry.js +1 -0
  259. package/dist/digi-arbetsformedlingen/p-2788683e.entry.js +1 -0
  260. package/dist/digi-arbetsformedlingen/p-2a023831.js +1 -0
  261. package/dist/digi-arbetsformedlingen/p-2b134ff1.entry.js +1 -0
  262. package/dist/digi-arbetsformedlingen/p-2c685e4f.entry.js +1 -0
  263. package/dist/digi-arbetsformedlingen/p-300aa9ef.js +1 -0
  264. package/dist/digi-arbetsformedlingen/p-30dc159d.entry.js +1 -0
  265. package/dist/digi-arbetsformedlingen/p-366e18f4.entry.js +1 -0
  266. package/dist/digi-arbetsformedlingen/p-398d0f60.entry.js +1 -0
  267. package/dist/digi-arbetsformedlingen/p-3b20ec86.js +1 -0
  268. package/dist/digi-arbetsformedlingen/p-3efa2f0b.entry.js +1 -0
  269. package/dist/digi-arbetsformedlingen/p-3f9dfdb0.entry.js +1 -0
  270. package/dist/digi-arbetsformedlingen/p-408e9b2a.entry.js +1 -0
  271. package/dist/digi-arbetsformedlingen/p-416992c0.entry.js +1 -0
  272. package/dist/digi-arbetsformedlingen/p-44c75bab.entry.js +1 -0
  273. package/dist/digi-arbetsformedlingen/p-4b8cae8a.entry.js +1 -0
  274. package/dist/digi-arbetsformedlingen/p-4bad4fb0.js +1 -0
  275. package/dist/digi-arbetsformedlingen/p-4e9f2f05.entry.js +1 -0
  276. package/dist/digi-arbetsformedlingen/p-55bcba7c.entry.js +1 -0
  277. package/dist/digi-arbetsformedlingen/p-55d02ef7.entry.js +1 -0
  278. package/dist/digi-arbetsformedlingen/p-5a602122.js +1 -0
  279. package/dist/digi-arbetsformedlingen/p-5f20045a.entry.js +1 -0
  280. package/dist/digi-arbetsformedlingen/p-5f4ece29.entry.js +1 -0
  281. package/dist/digi-arbetsformedlingen/p-60916953.entry.js +1 -0
  282. package/dist/digi-arbetsformedlingen/p-69922ec2.entry.js +1 -0
  283. package/dist/digi-arbetsformedlingen/p-69aeb038.entry.js +1 -0
  284. package/dist/digi-arbetsformedlingen/p-6abd8d58.entry.js +1 -0
  285. package/dist/digi-arbetsformedlingen/p-6bd37def.entry.js +1 -0
  286. package/dist/digi-arbetsformedlingen/p-6fb0f1a4.entry.js +1 -0
  287. package/dist/digi-arbetsformedlingen/p-70da2307.entry.js +1 -0
  288. package/dist/digi-arbetsformedlingen/p-7933b555.js +1 -0
  289. package/dist/digi-arbetsformedlingen/p-7aacd45f.js +1 -0
  290. package/dist/digi-arbetsformedlingen/p-7e77bbe7.entry.js +1 -0
  291. package/dist/digi-arbetsformedlingen/p-7e85c9e3.entry.js +1 -0
  292. package/dist/digi-arbetsformedlingen/p-7ed49934.entry.js +1 -0
  293. package/dist/digi-arbetsformedlingen/p-8142cc73.js +1 -0
  294. package/dist/digi-arbetsformedlingen/p-814ca2ad.js +1 -0
  295. package/dist/digi-arbetsformedlingen/p-820e795b.js +1 -0
  296. package/dist/digi-arbetsformedlingen/p-82611050.entry.js +1 -0
  297. package/dist/digi-arbetsformedlingen/p-83643aa3.entry.js +1 -0
  298. package/dist/digi-arbetsformedlingen/p-84bff8ef.entry.js +1 -0
  299. package/dist/digi-arbetsformedlingen/p-8713df13.entry.js +1 -0
  300. package/dist/digi-arbetsformedlingen/p-88b4d03a.js +1 -0
  301. package/dist/digi-arbetsformedlingen/p-89ef4ec1.entry.js +1 -0
  302. package/dist/digi-arbetsformedlingen/p-8ef41ad9.entry.js +1 -0
  303. package/dist/digi-arbetsformedlingen/p-8fa50755.entry.js +1 -0
  304. package/dist/digi-arbetsformedlingen/p-905ccb30.js +1 -0
  305. package/dist/digi-arbetsformedlingen/p-915b2a14.entry.js +1 -0
  306. package/dist/digi-arbetsformedlingen/p-931057a8.entry.js +1 -0
  307. package/dist/digi-arbetsformedlingen/p-9dd41cc4.js +1 -0
  308. package/dist/digi-arbetsformedlingen/p-9e13d85b.js +1 -0
  309. package/dist/digi-arbetsformedlingen/p-9f47d4b7.entry.js +1 -0
  310. package/dist/digi-arbetsformedlingen/p-a2008b0a.entry.js +1 -0
  311. package/dist/digi-arbetsformedlingen/p-a48de93b.entry.js +1 -0
  312. package/dist/digi-arbetsformedlingen/p-a969ba67.entry.js +1 -0
  313. package/dist/digi-arbetsformedlingen/p-af72f16f.entry.js +1 -0
  314. package/dist/digi-arbetsformedlingen/p-b3d93b8b.entry.js +1 -0
  315. package/dist/digi-arbetsformedlingen/p-bc3d2778.js +1 -0
  316. package/dist/digi-arbetsformedlingen/p-bf80a488.entry.js +1 -0
  317. package/dist/digi-arbetsformedlingen/p-c04ae2fc.entry.js +1 -0
  318. package/dist/digi-arbetsformedlingen/p-c06930c2.entry.js +1 -0
  319. package/dist/digi-arbetsformedlingen/{p-03b818fc.entry.js → p-c1fd535b.entry.js} +1 -1
  320. package/dist/digi-arbetsformedlingen/p-c461917d.entry.js +1 -0
  321. package/dist/digi-arbetsformedlingen/p-c604694f.entry.js +1 -0
  322. package/dist/digi-arbetsformedlingen/p-c7949525.js +1 -0
  323. package/dist/digi-arbetsformedlingen/p-c7a512ee.entry.js +1 -0
  324. package/dist/digi-arbetsformedlingen/p-c7d079d0.entry.js +1 -0
  325. package/dist/digi-arbetsformedlingen/p-cb74e4f3.entry.js +1 -0
  326. package/dist/digi-arbetsformedlingen/p-cdf86efc.js +1 -0
  327. package/dist/digi-arbetsformedlingen/p-d182d8bb.entry.js +1 -0
  328. package/dist/digi-arbetsformedlingen/p-d1886fff.js +1 -0
  329. package/dist/digi-arbetsformedlingen/p-e23d905e.entry.js +1 -0
  330. package/dist/digi-arbetsformedlingen/p-ecc2e481.entry.js +1 -0
  331. package/dist/digi-arbetsformedlingen/p-ee4cb21a.js +1 -0
  332. package/dist/digi-arbetsformedlingen/p-ee88e3f1.js +1 -0
  333. package/dist/digi-arbetsformedlingen/p-ee9589e6.js +1 -0
  334. package/dist/digi-arbetsformedlingen/p-f2e16531.entry.js +1 -0
  335. package/dist/digi-arbetsformedlingen/p-f40f4b2a.js +1 -0
  336. package/dist/digi-arbetsformedlingen/p-f447b984.js +1 -0
  337. package/dist/digi-arbetsformedlingen/p-f4edca16.entry.js +1 -0
  338. package/dist/digi-arbetsformedlingen/p-f5bcd77b.entry.js +1 -0
  339. package/dist/digi-arbetsformedlingen/p-f87c0b45.entry.js +1 -0
  340. package/dist/digi-arbetsformedlingen/p-fb9b3544.entry.js +1 -0
  341. package/dist/digi-arbetsformedlingen/p-fdca581c.entry.js +1 -0
  342. package/dist/digi-arbetsformedlingen/styles/src/_alias.mixin.scss +105 -252
  343. package/dist/digi-arbetsformedlingen/styles/src/themes/_brand-af18.mixin.scss +0 -19
  344. package/dist/digi-arbetsformedlingen/styles/src/themes/_brand-af25.mixin.scss +0 -144
  345. package/dist/digi-arbetsformedlingen/styles/src/themes/_brand-common.mixin.scss +0 -7
  346. package/dist/digi-arbetsformedlingen/styles/src/tokens-documentation/web-AF25.json +132 -442
  347. package/dist/esm/button-size.enum-d5ff6ff3.js +7 -0
  348. package/dist/esm/button-type.enum-5250ae0b.js +8 -0
  349. package/dist/esm/{code-example-variation.enum-e656d235.js → code-example-variation.enum-e9f9fced.js} +1 -7
  350. package/dist/esm/digi-arbetsformedlingen.js +1 -1
  351. package/dist/esm/digi-badge-status.entry.js +1 -1
  352. package/dist/esm/digi-button.entry.js +126 -0
  353. package/dist/esm/digi-calendar-datepicker.entry.js +2601 -0
  354. package/dist/esm/digi-calendar-week-view.entry.js +2 -1
  355. package/dist/esm/digi-calendar_2.entry.js +459 -0
  356. package/dist/esm/{digi-code-block_2.entry.js → digi-code-block_3.entry.js} +140 -6
  357. package/dist/esm/digi-code-example.entry.js +7 -6
  358. package/dist/esm/digi-context-menu.entry.js +236 -0
  359. package/dist/esm/digi-dialog.entry.js +25 -5
  360. package/dist/esm/digi-expandable-faq-item.entry.js +93 -0
  361. package/dist/esm/digi-footer-card.entry.js +25 -0
  362. package/dist/esm/digi-footer.entry.js +74 -0
  363. package/dist/esm/digi-form-category-filter.entry.js +117 -0
  364. package/dist/esm/digi-form-checkbox.entry.js +135 -0
  365. package/dist/esm/digi-form-error-list.entry.js +24 -4
  366. package/dist/esm/digi-form-file-upload.entry.js +598 -0
  367. package/dist/esm/digi-form-filter.entry.js +244 -0
  368. package/dist/esm/digi-form-input-search.entry.js +3 -1
  369. package/dist/esm/digi-form-input.entry.js +190 -0
  370. package/dist/esm/digi-form-label_3.entry.js +123 -0
  371. package/dist/esm/digi-form-receipt.entry.js +24 -4
  372. package/dist/esm/digi-form-select-filter.entry.js +601 -0
  373. package/dist/esm/digi-form-select_2.entry.js +181 -0
  374. package/dist/esm/digi-header-avatar.entry.js +110 -0
  375. package/dist/esm/digi-header-navigation-item.entry.js +23 -0
  376. package/dist/esm/digi-header-navigation.entry.js +228 -0
  377. package/dist/esm/digi-header-notification.entry.js +19 -0
  378. package/dist/esm/digi-header.entry.js +115 -0
  379. package/dist/esm/digi-icon-accessibility-universal.entry.js +26 -0
  380. package/dist/esm/digi-icon-bars.entry.js +26 -0
  381. package/dist/esm/digi-icon-bell-filled.entry.js +26 -0
  382. package/dist/esm/digi-icon-check-circle-solid_4.entry.js +92 -0
  383. package/dist/esm/digi-icon-check_6.entry.js +331 -0
  384. package/dist/esm/digi-icon-chevron-down.entry.js +26 -0
  385. package/dist/esm/digi-icon-chevron-left_2.entry.js +48 -0
  386. package/dist/esm/digi-icon-copy.entry.js +26 -0
  387. package/dist/esm/digi-icon-envelope.entry.js +26 -0
  388. package/dist/esm/digi-icon-external-link-alt_2.entry.js +55 -0
  389. package/dist/esm/digi-icon-globe.entry.js +26 -0
  390. package/dist/esm/digi-icon-list-ul_6.entry.js +136 -0
  391. package/dist/esm/digi-icon-minus_2.entry.js +48 -0
  392. package/dist/esm/digi-icon-notification-error_4.entry.js +92 -0
  393. package/dist/esm/digi-icon-sign.entry.js +26 -0
  394. package/dist/esm/digi-icon-spinner.entry.js +27 -0
  395. package/dist/esm/digi-icon-x.entry.js +26 -0
  396. package/dist/esm/digi-info-card-multi-container.entry.js +18 -0
  397. package/dist/esm/digi-info-card-multi.entry.js +54 -0
  398. package/dist/esm/digi-info-card.entry.js +75 -0
  399. package/dist/esm/digi-layout-block_2.entry.js +87 -0
  400. package/dist/esm/digi-layout-columns.entry.js +29 -0
  401. package/dist/esm/digi-link-button.entry.js +62 -0
  402. package/dist/esm/digi-link-internal.entry.js +33 -0
  403. package/dist/esm/digi-link.entry.js +71 -0
  404. package/dist/esm/digi-logo.entry.js +45 -0
  405. package/dist/esm/digi-media-image_2.entry.js +162 -0
  406. package/dist/esm/digi-navigation-pagination.entry.js +24 -4
  407. package/dist/esm/digi-navigation-sidebar-button.entry.js +26 -0
  408. package/dist/esm/digi-navigation-vertical-menu-item.entry.js +146 -0
  409. package/dist/esm/digi-navigation-vertical-menu.entry.js +173 -0
  410. package/dist/esm/digi-notification-alert.entry.js +112 -0
  411. package/dist/esm/digi-notification-error-page.entry.js +24 -4
  412. package/dist/esm/digi-progress-list-item.entry.js +1 -1
  413. package/dist/esm/digi-quote.entry.js +1 -1
  414. package/dist/esm/digi-tag-media.entry.js +43 -0
  415. package/dist/esm/digi-title-logo.entry.js +133 -0
  416. package/dist/esm/digi-tools-feedback.entry.js +25 -5
  417. package/dist/esm/digi-tools-theme-provider.entry.js +24 -0
  418. package/dist/esm/digi-typography-heading-jumbo.entry.js +34 -0
  419. package/dist/esm/digi-typography-preamble.entry.js +16 -0
  420. package/dist/esm/digi-typography.entry.js +22 -0
  421. package/dist/esm/digi-util-breakpoint-observer.entry.js +44 -0
  422. package/dist/esm/digi-util-keydown-handler.entry.js +79 -0
  423. package/dist/esm/expandable-faq-item-variation.enum-a8cb225b.js +18 -0
  424. package/dist/esm/footer-card-variation.enum-cc732148.js +8 -0
  425. package/dist/esm/form-checkbox-variation.enum-83e906fc.js +19 -0
  426. package/dist/esm/form-file-upload-variation.enum-9c49ec5e.js +24 -0
  427. package/dist/esm/form-input-search-variation.enum-f9d669f2.js +8 -0
  428. package/dist/esm/{form-input-type.enum-a6bba983.js → form-input-type.enum-3da3db27.js} +1 -15
  429. package/dist/esm/form-input-variation.enum-64d9450f.js +29 -0
  430. package/dist/esm/form-select-variation.enum-f2f6098d.js +16 -0
  431. package/dist/esm/form-validation-message-variation.enum-bcef8a9d.js +8 -0
  432. package/dist/esm/index-148a7577.js +236 -8
  433. package/dist/esm/{index-dc6b83f7.js → index-2fce392f.js} +3 -170
  434. package/dist/esm/index-5b6c95c6.js +63 -0
  435. package/dist/esm/index-8685f88d.js +170 -0
  436. package/dist/esm/index.js +24 -4
  437. package/dist/esm/info-card-multi-type.enum-07ee124f.js +8 -0
  438. package/dist/esm/info-card-variation.enum-2ccc52c1.js +24 -0
  439. package/dist/esm/layout-columns-variation.enum-34f7754e.js +23 -0
  440. package/dist/esm/layout-container-max-width.enum-c40018ac.js +21 -0
  441. package/dist/esm/link-button-variation.enum-84d4976f.js +9 -0
  442. package/dist/esm/loader.js +1 -1
  443. package/dist/esm/logo-color.enum-8593dca6.js +7 -0
  444. package/dist/esm/navigation-vertical-menu-variation.enum-c30b0ea9.js +13 -0
  445. package/dist/esm/progress-indicator-heading-level.enum-ace13afe.js +39 -0
  446. package/dist/esm/tag-media-icon.enum-fefa191c.js +11 -0
  447. package/dist/esm/tools-theme-provider.brand.enum-8c5a98c9.js +7 -0
  448. package/dist/esm/typography-heading-jumbo-variation.enum-eb737f1b.js +17 -0
  449. package/dist/esm/typography-variation.enum-8c3ff25c.js +238 -0
  450. package/dist/types/components/_progress/progress-circle/progress-circle-heading-level.enum.d.ts +8 -0
  451. package/dist/types/components/_progress/progress-circle/progress-circle.d.ts +7 -0
  452. package/dist/types/components/_progress/progress-indicator/progress-indicator-heading-level.enum.d.ts +8 -0
  453. package/dist/types/components/_progress/progress-indicator/progress-indicator.d.ts +7 -0
  454. package/dist/types/components/_tools/tools-theme-provider/tools-theme-provider.d.ts +0 -9
  455. package/dist/types/components.d.ts +32 -12
  456. package/dist/types/enums.d.ts +2 -1
  457. package/hydrate/index.js +73 -66
  458. package/hydrate/index.mjs +73 -66
  459. package/package.json +1 -1
  460. package/components/p-24e68936.js +0 -165
  461. package/components/p-a162b186.js +0 -177
  462. package/components/p-be4fd246.js +0 -7
  463. package/components/p-d516f6af.js +0 -66
  464. package/components/p-d7ef9cb1.js +0 -13
  465. package/dist/cjs/digi-button_84.cjs.entry.js +0 -8458
  466. package/dist/cjs/digi-progress-circle.cjs.entry.js +0 -84
  467. package/dist/cjs/progress-circle-role.enum-b7fdcf0c.js +0 -7
  468. package/dist/cjs/typography-variation.enum-ad1b2403.js +0 -501
  469. package/dist/collection/components/_tools/tools-theme-provider/tools-theme-provider.theme.enum.js +0 -5
  470. package/dist/digi-arbetsformedlingen/p-06704534.entry.js +0 -1
  471. package/dist/digi-arbetsformedlingen/p-160165b9.entry.js +0 -1
  472. package/dist/digi-arbetsformedlingen/p-1efcad5b.entry.js +0 -1
  473. package/dist/digi-arbetsformedlingen/p-3ae13b8a.entry.js +0 -1
  474. package/dist/digi-arbetsformedlingen/p-47ab0b39.entry.js +0 -1
  475. package/dist/digi-arbetsformedlingen/p-501f9b16.entry.js +0 -1
  476. package/dist/digi-arbetsformedlingen/p-53880b04.entry.js +0 -1
  477. package/dist/digi-arbetsformedlingen/p-53d9556b.js +0 -1
  478. package/dist/digi-arbetsformedlingen/p-72ef7f99.entry.js +0 -1
  479. package/dist/digi-arbetsformedlingen/p-80500b2d.entry.js +0 -1
  480. package/dist/digi-arbetsformedlingen/p-8d055a17.js +0 -1
  481. package/dist/digi-arbetsformedlingen/p-a105d9fe.js +0 -1
  482. package/dist/digi-arbetsformedlingen/p-a2fb7d64.entry.js +0 -1
  483. package/dist/digi-arbetsformedlingen/p-be4fd246.js +0 -1
  484. package/dist/digi-arbetsformedlingen/p-c59e5f69.entry.js +0 -1
  485. package/dist/digi-arbetsformedlingen/p-c64b4626.js +0 -1
  486. package/dist/digi-arbetsformedlingen/p-ca8d7464.entry.js +0 -1
  487. package/dist/digi-arbetsformedlingen/p-f4b540e3.entry.js +0 -1
  488. package/dist/digi-arbetsformedlingen/p-f601908d.entry.js +0 -1
  489. package/dist/esm/digi-button_84.entry.js +0 -8371
  490. package/dist/esm/digi-progress-circle.entry.js +0 -80
  491. package/dist/esm/progress-circle-role.enum-7737a2c6.js +0 -7
  492. package/dist/esm/typography-variation.enum-7319240b.js +0 -501
  493. package/dist/types/components/_tools/tools-theme-provider/tools-theme-provider.theme.enum.d.ts +0 -4
@@ -0,0 +1,2605 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$2 = require('./index-7a477838.js');
6
+ const text = require('./text-65b1b58c.js');
7
+ require('./badge-notification-shape.enum-ff802554.js');
8
+ const typographyVariation_enum = require('./typography-variation.enum-50512a4e.js');
9
+ require('./badge-status-variation.enum-0a5adc21.js');
10
+ require('./button-size.enum-1fd86b9e.js');
11
+ require('./button-type.enum-406723db.js');
12
+ require('./button-variation.enum-bc521499.js');
13
+ require('./calendar-week-view-heading-level.enum-fd0c841b.js');
14
+ require('./bar-chart-variation.enum-a4e866b6.js');
15
+ require('./code-example-variation.enum-c6557727.js');
16
+ require('./code-variation.enum-c4a4e6fd.js');
17
+ require('./expandable-accordion-header-level.enum-45483252.js');
18
+ require('./expandable-faq-item-variation.enum-89427195.js');
19
+ require('./expandable-faq-variation.enum-af923f49.js');
20
+ require('./footer-card-variation.enum-99555edc.js');
21
+ require('./form-checkbox-variation.enum-d2ca879e.js');
22
+ require('./form-file-upload-variation.enum-634cfae8.js');
23
+ require('./form-input-search-variation.enum-c50239bc.js');
24
+ require('./form-input-type.enum-9c8ee12a.js');
25
+ const formInputVariation_enum = require('./form-input-variation.enum-c750520c.js');
26
+ require('./form-radiogroup-validation.enum-03a17d4d.js');
27
+ require('./form-select-variation.enum-528c1bf0.js');
28
+ require('./form-textarea-variation.enum-9c90d40f.js');
29
+ require('./form-validation-message-variation.enum-855ae0be.js');
30
+ require('./info-card-multi-type.enum-14746572.js');
31
+ require('./info-card-variation.enum-64cef637.js');
32
+ require('./layout-container-max-width.enum-7e637f44.js');
33
+ require('./layout-block-variation.enum-f6102119.js');
34
+ require('./layout-columns-variation.enum-65675649.js');
35
+ require('./link-button-variation.enum-137785e3.js');
36
+ require('./list-type.enum-aea4d012.js');
37
+ require('./loader-skeleton-variation.enum-d52ba55e.js');
38
+ require('./loader-spinner-size.enum-db2973f0.js');
39
+ require('./logo-color.enum-76f6c506.js');
40
+ require('./media-figure-alignment.enum-3885aba5.js');
41
+ require('./navigation-sidebar-variation.enum-1c0c3064.js');
42
+ require('./navigation-vertical-menu-variation.enum-c237edd3.js');
43
+ require('./progress-indicator-heading-level.enum-13c38ed0.js');
44
+ require('./progress-list-item-variation.enum-90e4c874.js');
45
+ require('./progress-list-variation.enum-06d5ce27.js');
46
+ require('./progressbar-variation.enum-aff9fa80.js');
47
+ require('./quote-image-inner-position.enum-e64e7a6d.js');
48
+ require('./table-variation.enum-25df2ad7.js');
49
+ require('./tag-media-icon.enum-372563c5.js');
50
+ require('./tag-size.enum-387c516c.js');
51
+ require('./tools-feedback-banner-type.enum-de373ba0.js');
52
+ require('./tools-feedback-rating-variation.enum-2f71e84d.js');
53
+ require('./tools-theme-provider.brand.enum-bc855272.js');
54
+ require('./typography-heading-jumbo-variation.enum-8677e099.js');
55
+ require('./typography-meta-variation.enum-13ac3538.js');
56
+ require('./typography-time-variation.enum-bce1d87e.js');
57
+ require('./util-breakpoint-observer-breakpoints.enum-e96d3a84.js');
58
+ const randomIdGenerator_util = require('./randomIdGenerator.util-e7f4b6de.js');
59
+ const detectClickOutside_util = require('./detectClickOutside.util-3e764eb3.js');
60
+ const index = require('./index-e8333bcc.js');
61
+ const index$1 = require('./index-ac8e01b4.js');
62
+ const index$3 = require('./index-cad91a90.js');
63
+ require('./detectClosest.util-85b3507b.js');
64
+
65
+ function assign(target, dirtyObject) {
66
+ if (target == null) {
67
+ throw new TypeError('assign requires that input parameter not be null or undefined');
68
+ }
69
+
70
+ dirtyObject = dirtyObject || {};
71
+
72
+ for (var property in dirtyObject) {
73
+ if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {
74
+ target[property] = dirtyObject[property];
75
+ }
76
+ }
77
+
78
+ return target;
79
+ }
80
+
81
+ // See issue: https://github.com/date-fns/date-fns/issues/376
82
+
83
+ function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {
84
+ index.requiredArgs(2, arguments);
85
+ var options = dirtyOptions || {};
86
+ var locale = options.locale;
87
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
88
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : index$1.toInteger(localeWeekStartsOn);
89
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : index$1.toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
90
+
91
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
92
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
93
+ }
94
+
95
+ var date = index.toDate(dirtyDate);
96
+ var day = index$1.toInteger(dirtyDay);
97
+ var currentDay = date.getUTCDay();
98
+ var remainder = day % 7;
99
+ var dayIndex = (remainder + 7) % 7;
100
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
101
+ date.setUTCDate(date.getUTCDate() + diff);
102
+ return date;
103
+ }
104
+
105
+ // See issue: https://github.com/date-fns/date-fns/issues/376
106
+
107
+ function setUTCISODay(dirtyDate, dirtyDay) {
108
+ index.requiredArgs(2, arguments);
109
+ var day = index$1.toInteger(dirtyDay);
110
+
111
+ if (day % 7 === 0) {
112
+ day = day - 7;
113
+ }
114
+
115
+ var weekStartsOn = 1;
116
+ var date = index.toDate(dirtyDate);
117
+ var currentDay = date.getUTCDay();
118
+ var remainder = day % 7;
119
+ var dayIndex = (remainder + 7) % 7;
120
+ var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
121
+ date.setUTCDate(date.getUTCDate() + diff);
122
+ return date;
123
+ }
124
+
125
+ // See issue: https://github.com/date-fns/date-fns/issues/376
126
+
127
+ function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
128
+ index.requiredArgs(2, arguments);
129
+ var date = index.toDate(dirtyDate);
130
+ var isoWeek = index$1.toInteger(dirtyISOWeek);
131
+ var diff = index$1.getUTCISOWeek(date) - isoWeek;
132
+ date.setUTCDate(date.getUTCDate() - diff * 7);
133
+ return date;
134
+ }
135
+
136
+ // See issue: https://github.com/date-fns/date-fns/issues/376
137
+
138
+ function setUTCWeek(dirtyDate, dirtyWeek, options) {
139
+ index.requiredArgs(2, arguments);
140
+ var date = index.toDate(dirtyDate);
141
+ var week = index$1.toInteger(dirtyWeek);
142
+ var diff = index$1.getUTCWeek(date, options) - week;
143
+ date.setUTCDate(date.getUTCDate() - diff * 7);
144
+ return date;
145
+ }
146
+
147
+ var MILLISECONDS_IN_HOUR = 3600000;
148
+ var MILLISECONDS_IN_MINUTE = 60000;
149
+ var MILLISECONDS_IN_SECOND = 1000;
150
+ var numericPatterns = {
151
+ month: /^(1[0-2]|0?\d)/,
152
+ // 0 to 12
153
+ date: /^(3[0-1]|[0-2]?\d)/,
154
+ // 0 to 31
155
+ dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
156
+ // 0 to 366
157
+ week: /^(5[0-3]|[0-4]?\d)/,
158
+ // 0 to 53
159
+ hour23h: /^(2[0-3]|[0-1]?\d)/,
160
+ // 0 to 23
161
+ hour24h: /^(2[0-4]|[0-1]?\d)/,
162
+ // 0 to 24
163
+ hour11h: /^(1[0-1]|0?\d)/,
164
+ // 0 to 11
165
+ hour12h: /^(1[0-2]|0?\d)/,
166
+ // 0 to 12
167
+ minute: /^[0-5]?\d/,
168
+ // 0 to 59
169
+ second: /^[0-5]?\d/,
170
+ // 0 to 59
171
+ singleDigit: /^\d/,
172
+ // 0 to 9
173
+ twoDigits: /^\d{1,2}/,
174
+ // 0 to 99
175
+ threeDigits: /^\d{1,3}/,
176
+ // 0 to 999
177
+ fourDigits: /^\d{1,4}/,
178
+ // 0 to 9999
179
+ anyDigitsSigned: /^-?\d+/,
180
+ singleDigitSigned: /^-?\d/,
181
+ // 0 to 9, -0 to -9
182
+ twoDigitsSigned: /^-?\d{1,2}/,
183
+ // 0 to 99, -0 to -99
184
+ threeDigitsSigned: /^-?\d{1,3}/,
185
+ // 0 to 999, -0 to -999
186
+ fourDigitsSigned: /^-?\d{1,4}/ // 0 to 9999, -0 to -9999
187
+
188
+ };
189
+ var timezonePatterns = {
190
+ basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
191
+ basic: /^([+-])(\d{2})(\d{2})|Z/,
192
+ basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
193
+ extended: /^([+-])(\d{2}):(\d{2})|Z/,
194
+ extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
195
+ };
196
+
197
+ function parseNumericPattern(pattern, string, valueCallback) {
198
+ var matchResult = string.match(pattern);
199
+
200
+ if (!matchResult) {
201
+ return null;
202
+ }
203
+
204
+ var value = parseInt(matchResult[0], 10);
205
+ return {
206
+ value: valueCallback ? valueCallback(value) : value,
207
+ rest: string.slice(matchResult[0].length)
208
+ };
209
+ }
210
+
211
+ function parseTimezonePattern(pattern, string) {
212
+ var matchResult = string.match(pattern);
213
+
214
+ if (!matchResult) {
215
+ return null;
216
+ } // Input is 'Z'
217
+
218
+
219
+ if (matchResult[0] === 'Z') {
220
+ return {
221
+ value: 0,
222
+ rest: string.slice(1)
223
+ };
224
+ }
225
+
226
+ var sign = matchResult[1] === '+' ? 1 : -1;
227
+ var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
228
+ var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
229
+ var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
230
+ return {
231
+ value: sign * (hours * MILLISECONDS_IN_HOUR + minutes * MILLISECONDS_IN_MINUTE + seconds * MILLISECONDS_IN_SECOND),
232
+ rest: string.slice(matchResult[0].length)
233
+ };
234
+ }
235
+
236
+ function parseAnyDigitsSigned(string, valueCallback) {
237
+ return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);
238
+ }
239
+
240
+ function parseNDigits(n, string, valueCallback) {
241
+ switch (n) {
242
+ case 1:
243
+ return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);
244
+
245
+ case 2:
246
+ return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);
247
+
248
+ case 3:
249
+ return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);
250
+
251
+ case 4:
252
+ return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);
253
+
254
+ default:
255
+ return parseNumericPattern(new RegExp('^\\d{1,' + n + '}'), string, valueCallback);
256
+ }
257
+ }
258
+
259
+ function parseNDigitsSigned(n, string, valueCallback) {
260
+ switch (n) {
261
+ case 1:
262
+ return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);
263
+
264
+ case 2:
265
+ return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);
266
+
267
+ case 3:
268
+ return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);
269
+
270
+ case 4:
271
+ return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);
272
+
273
+ default:
274
+ return parseNumericPattern(new RegExp('^-?\\d{1,' + n + '}'), string, valueCallback);
275
+ }
276
+ }
277
+
278
+ function dayPeriodEnumToHours(enumValue) {
279
+ switch (enumValue) {
280
+ case 'morning':
281
+ return 4;
282
+
283
+ case 'evening':
284
+ return 17;
285
+
286
+ case 'pm':
287
+ case 'noon':
288
+ case 'afternoon':
289
+ return 12;
290
+
291
+ case 'am':
292
+ case 'midnight':
293
+ case 'night':
294
+ default:
295
+ return 0;
296
+ }
297
+ }
298
+
299
+ function normalizeTwoDigitYear(twoDigitYear, currentYear) {
300
+ var isCommonEra = currentYear > 0; // Absolute number of the current year:
301
+ // 1 -> 1 AC
302
+ // 0 -> 1 BC
303
+ // -1 -> 2 BC
304
+
305
+ var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
306
+ var result;
307
+
308
+ if (absCurrentYear <= 50) {
309
+ result = twoDigitYear || 100;
310
+ } else {
311
+ var rangeEnd = absCurrentYear + 50;
312
+ var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
313
+ var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
314
+ result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
315
+ }
316
+
317
+ return isCommonEra ? result : 1 - result;
318
+ }
319
+
320
+ var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
321
+ var DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; // User for validation
322
+
323
+ function isLeapYearIndex(year) {
324
+ return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
325
+ }
326
+ /*
327
+ * | | Unit | | Unit |
328
+ * |-----|--------------------------------|-----|--------------------------------|
329
+ * | a | AM, PM | A* | Milliseconds in day |
330
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
331
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
332
+ * | d | Day of month | D | Day of year |
333
+ * | e | Local day of week | E | Day of week |
334
+ * | f | | F* | Day of week in month |
335
+ * | g* | Modified Julian day | G | Era |
336
+ * | h | Hour [1-12] | H | Hour [0-23] |
337
+ * | i! | ISO day of week | I! | ISO week of year |
338
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
339
+ * | k | Hour [1-24] | K | Hour [0-11] |
340
+ * | l* | (deprecated) | L | Stand-alone month |
341
+ * | m | Minute | M | Month |
342
+ * | n | | N | |
343
+ * | o! | Ordinal number modifier | O* | Timezone (GMT) |
344
+ * | p | | P | |
345
+ * | q | Stand-alone quarter | Q | Quarter |
346
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
347
+ * | s | Second | S | Fraction of second |
348
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
349
+ * | u | Extended year | U* | Cyclic year |
350
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
351
+ * | w | Local week of year | W* | Week of month |
352
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
353
+ * | y | Year (abs) | Y | Local week-numbering year |
354
+ * | z* | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
355
+ *
356
+ * Letters marked by * are not implemented but reserved by Unicode standard.
357
+ *
358
+ * Letters marked by ! are non-standard, but implemented by date-fns:
359
+ * - `o` modifies the previous token to turn it into an ordinal (see `parse` docs)
360
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
361
+ * i.e. 7 for Sunday, 1 for Monday, etc.
362
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
363
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
364
+ * `R` is supposed to be used in conjunction with `I` and `i`
365
+ * for universal ISO week-numbering date, whereas
366
+ * `Y` is supposed to be used in conjunction with `w` and `e`
367
+ * for week-numbering date specific to the locale.
368
+ */
369
+
370
+
371
+ var parsers = {
372
+ // Era
373
+ G: {
374
+ priority: 140,
375
+ parse: function (string, token, match, _options) {
376
+ switch (token) {
377
+ // AD, BC
378
+ case 'G':
379
+ case 'GG':
380
+ case 'GGG':
381
+ return match.era(string, {
382
+ width: 'abbreviated'
383
+ }) || match.era(string, {
384
+ width: 'narrow'
385
+ });
386
+ // A, B
387
+
388
+ case 'GGGGG':
389
+ return match.era(string, {
390
+ width: 'narrow'
391
+ });
392
+ // Anno Domini, Before Christ
393
+
394
+ case 'GGGG':
395
+ default:
396
+ return match.era(string, {
397
+ width: 'wide'
398
+ }) || match.era(string, {
399
+ width: 'abbreviated'
400
+ }) || match.era(string, {
401
+ width: 'narrow'
402
+ });
403
+ }
404
+ },
405
+ set: function (date, flags, value, _options) {
406
+ flags.era = value;
407
+ date.setUTCFullYear(value, 0, 1);
408
+ date.setUTCHours(0, 0, 0, 0);
409
+ return date;
410
+ },
411
+ incompatibleTokens: ['R', 'u', 't', 'T']
412
+ },
413
+ // Year
414
+ y: {
415
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns
416
+ // | Year | y | yy | yyy | yyyy | yyyyy |
417
+ // |----------|-------|----|-------|-------|-------|
418
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
419
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
420
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
421
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
422
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
423
+ priority: 130,
424
+ parse: function (string, token, match, _options) {
425
+ var valueCallback = function (year) {
426
+ return {
427
+ year: year,
428
+ isTwoDigitYear: token === 'yy'
429
+ };
430
+ };
431
+
432
+ switch (token) {
433
+ case 'y':
434
+ return parseNDigits(4, string, valueCallback);
435
+
436
+ case 'yo':
437
+ return match.ordinalNumber(string, {
438
+ unit: 'year',
439
+ valueCallback: valueCallback
440
+ });
441
+
442
+ default:
443
+ return parseNDigits(token.length, string, valueCallback);
444
+ }
445
+ },
446
+ validate: function (_date, value, _options) {
447
+ return value.isTwoDigitYear || value.year > 0;
448
+ },
449
+ set: function (date, flags, value, _options) {
450
+ var currentYear = date.getUTCFullYear();
451
+
452
+ if (value.isTwoDigitYear) {
453
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
454
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
455
+ date.setUTCHours(0, 0, 0, 0);
456
+ return date;
457
+ }
458
+
459
+ var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
460
+ date.setUTCFullYear(year, 0, 1);
461
+ date.setUTCHours(0, 0, 0, 0);
462
+ return date;
463
+ },
464
+ incompatibleTokens: ['Y', 'R', 'u', 'w', 'I', 'i', 'e', 'c', 't', 'T']
465
+ },
466
+ // Local week-numbering year
467
+ Y: {
468
+ priority: 130,
469
+ parse: function (string, token, match, _options) {
470
+ var valueCallback = function (year) {
471
+ return {
472
+ year: year,
473
+ isTwoDigitYear: token === 'YY'
474
+ };
475
+ };
476
+
477
+ switch (token) {
478
+ case 'Y':
479
+ return parseNDigits(4, string, valueCallback);
480
+
481
+ case 'Yo':
482
+ return match.ordinalNumber(string, {
483
+ unit: 'year',
484
+ valueCallback: valueCallback
485
+ });
486
+
487
+ default:
488
+ return parseNDigits(token.length, string, valueCallback);
489
+ }
490
+ },
491
+ validate: function (_date, value, _options) {
492
+ return value.isTwoDigitYear || value.year > 0;
493
+ },
494
+ set: function (date, flags, value, options) {
495
+ var currentYear = index$1.getUTCWeekYear(date, options);
496
+
497
+ if (value.isTwoDigitYear) {
498
+ var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
499
+ date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
500
+ date.setUTCHours(0, 0, 0, 0);
501
+ return index$1.startOfUTCWeek(date, options);
502
+ }
503
+
504
+ var year = !('era' in flags) || flags.era === 1 ? value.year : 1 - value.year;
505
+ date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
506
+ date.setUTCHours(0, 0, 0, 0);
507
+ return index$1.startOfUTCWeek(date, options);
508
+ },
509
+ incompatibleTokens: ['y', 'R', 'u', 'Q', 'q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']
510
+ },
511
+ // ISO week-numbering year
512
+ R: {
513
+ priority: 130,
514
+ parse: function (string, token, _match, _options) {
515
+ if (token === 'R') {
516
+ return parseNDigitsSigned(4, string);
517
+ }
518
+
519
+ return parseNDigitsSigned(token.length, string);
520
+ },
521
+ set: function (_date, _flags, value, _options) {
522
+ var firstWeekOfYear = new Date(0);
523
+ firstWeekOfYear.setUTCFullYear(value, 0, 4);
524
+ firstWeekOfYear.setUTCHours(0, 0, 0, 0);
525
+ return index$1.startOfUTCISOWeek(firstWeekOfYear);
526
+ },
527
+ incompatibleTokens: ['G', 'y', 'Y', 'u', 'Q', 'q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']
528
+ },
529
+ // Extended year
530
+ u: {
531
+ priority: 130,
532
+ parse: function (string, token, _match, _options) {
533
+ if (token === 'u') {
534
+ return parseNDigitsSigned(4, string);
535
+ }
536
+
537
+ return parseNDigitsSigned(token.length, string);
538
+ },
539
+ set: function (date, _flags, value, _options) {
540
+ date.setUTCFullYear(value, 0, 1);
541
+ date.setUTCHours(0, 0, 0, 0);
542
+ return date;
543
+ },
544
+ incompatibleTokens: ['G', 'y', 'Y', 'R', 'w', 'I', 'i', 'e', 'c', 't', 'T']
545
+ },
546
+ // Quarter
547
+ Q: {
548
+ priority: 120,
549
+ parse: function (string, token, match, _options) {
550
+ switch (token) {
551
+ // 1, 2, 3, 4
552
+ case 'Q':
553
+ case 'QQ':
554
+ // 01, 02, 03, 04
555
+ return parseNDigits(token.length, string);
556
+ // 1st, 2nd, 3rd, 4th
557
+
558
+ case 'Qo':
559
+ return match.ordinalNumber(string, {
560
+ unit: 'quarter'
561
+ });
562
+ // Q1, Q2, Q3, Q4
563
+
564
+ case 'QQQ':
565
+ return match.quarter(string, {
566
+ width: 'abbreviated',
567
+ context: 'formatting'
568
+ }) || match.quarter(string, {
569
+ width: 'narrow',
570
+ context: 'formatting'
571
+ });
572
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
573
+
574
+ case 'QQQQQ':
575
+ return match.quarter(string, {
576
+ width: 'narrow',
577
+ context: 'formatting'
578
+ });
579
+ // 1st quarter, 2nd quarter, ...
580
+
581
+ case 'QQQQ':
582
+ default:
583
+ return match.quarter(string, {
584
+ width: 'wide',
585
+ context: 'formatting'
586
+ }) || match.quarter(string, {
587
+ width: 'abbreviated',
588
+ context: 'formatting'
589
+ }) || match.quarter(string, {
590
+ width: 'narrow',
591
+ context: 'formatting'
592
+ });
593
+ }
594
+ },
595
+ validate: function (_date, value, _options) {
596
+ return value >= 1 && value <= 4;
597
+ },
598
+ set: function (date, _flags, value, _options) {
599
+ date.setUTCMonth((value - 1) * 3, 1);
600
+ date.setUTCHours(0, 0, 0, 0);
601
+ return date;
602
+ },
603
+ incompatibleTokens: ['Y', 'R', 'q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']
604
+ },
605
+ // Stand-alone quarter
606
+ q: {
607
+ priority: 120,
608
+ parse: function (string, token, match, _options) {
609
+ switch (token) {
610
+ // 1, 2, 3, 4
611
+ case 'q':
612
+ case 'qq':
613
+ // 01, 02, 03, 04
614
+ return parseNDigits(token.length, string);
615
+ // 1st, 2nd, 3rd, 4th
616
+
617
+ case 'qo':
618
+ return match.ordinalNumber(string, {
619
+ unit: 'quarter'
620
+ });
621
+ // Q1, Q2, Q3, Q4
622
+
623
+ case 'qqq':
624
+ return match.quarter(string, {
625
+ width: 'abbreviated',
626
+ context: 'standalone'
627
+ }) || match.quarter(string, {
628
+ width: 'narrow',
629
+ context: 'standalone'
630
+ });
631
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
632
+
633
+ case 'qqqqq':
634
+ return match.quarter(string, {
635
+ width: 'narrow',
636
+ context: 'standalone'
637
+ });
638
+ // 1st quarter, 2nd quarter, ...
639
+
640
+ case 'qqqq':
641
+ default:
642
+ return match.quarter(string, {
643
+ width: 'wide',
644
+ context: 'standalone'
645
+ }) || match.quarter(string, {
646
+ width: 'abbreviated',
647
+ context: 'standalone'
648
+ }) || match.quarter(string, {
649
+ width: 'narrow',
650
+ context: 'standalone'
651
+ });
652
+ }
653
+ },
654
+ validate: function (_date, value, _options) {
655
+ return value >= 1 && value <= 4;
656
+ },
657
+ set: function (date, _flags, value, _options) {
658
+ date.setUTCMonth((value - 1) * 3, 1);
659
+ date.setUTCHours(0, 0, 0, 0);
660
+ return date;
661
+ },
662
+ incompatibleTokens: ['Y', 'R', 'Q', 'M', 'L', 'w', 'I', 'd', 'D', 'i', 'e', 'c', 't', 'T']
663
+ },
664
+ // Month
665
+ M: {
666
+ priority: 110,
667
+ parse: function (string, token, match, _options) {
668
+ var valueCallback = function (value) {
669
+ return value - 1;
670
+ };
671
+
672
+ switch (token) {
673
+ // 1, 2, ..., 12
674
+ case 'M':
675
+ return parseNumericPattern(numericPatterns.month, string, valueCallback);
676
+ // 01, 02, ..., 12
677
+
678
+ case 'MM':
679
+ return parseNDigits(2, string, valueCallback);
680
+ // 1st, 2nd, ..., 12th
681
+
682
+ case 'Mo':
683
+ return match.ordinalNumber(string, {
684
+ unit: 'month',
685
+ valueCallback: valueCallback
686
+ });
687
+ // Jan, Feb, ..., Dec
688
+
689
+ case 'MMM':
690
+ return match.month(string, {
691
+ width: 'abbreviated',
692
+ context: 'formatting'
693
+ }) || match.month(string, {
694
+ width: 'narrow',
695
+ context: 'formatting'
696
+ });
697
+ // J, F, ..., D
698
+
699
+ case 'MMMMM':
700
+ return match.month(string, {
701
+ width: 'narrow',
702
+ context: 'formatting'
703
+ });
704
+ // January, February, ..., December
705
+
706
+ case 'MMMM':
707
+ default:
708
+ return match.month(string, {
709
+ width: 'wide',
710
+ context: 'formatting'
711
+ }) || match.month(string, {
712
+ width: 'abbreviated',
713
+ context: 'formatting'
714
+ }) || match.month(string, {
715
+ width: 'narrow',
716
+ context: 'formatting'
717
+ });
718
+ }
719
+ },
720
+ validate: function (_date, value, _options) {
721
+ return value >= 0 && value <= 11;
722
+ },
723
+ set: function (date, _flags, value, _options) {
724
+ date.setUTCMonth(value, 1);
725
+ date.setUTCHours(0, 0, 0, 0);
726
+ return date;
727
+ },
728
+ incompatibleTokens: ['Y', 'R', 'q', 'Q', 'L', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']
729
+ },
730
+ // Stand-alone month
731
+ L: {
732
+ priority: 110,
733
+ parse: function (string, token, match, _options) {
734
+ var valueCallback = function (value) {
735
+ return value - 1;
736
+ };
737
+
738
+ switch (token) {
739
+ // 1, 2, ..., 12
740
+ case 'L':
741
+ return parseNumericPattern(numericPatterns.month, string, valueCallback);
742
+ // 01, 02, ..., 12
743
+
744
+ case 'LL':
745
+ return parseNDigits(2, string, valueCallback);
746
+ // 1st, 2nd, ..., 12th
747
+
748
+ case 'Lo':
749
+ return match.ordinalNumber(string, {
750
+ unit: 'month',
751
+ valueCallback: valueCallback
752
+ });
753
+ // Jan, Feb, ..., Dec
754
+
755
+ case 'LLL':
756
+ return match.month(string, {
757
+ width: 'abbreviated',
758
+ context: 'standalone'
759
+ }) || match.month(string, {
760
+ width: 'narrow',
761
+ context: 'standalone'
762
+ });
763
+ // J, F, ..., D
764
+
765
+ case 'LLLLL':
766
+ return match.month(string, {
767
+ width: 'narrow',
768
+ context: 'standalone'
769
+ });
770
+ // January, February, ..., December
771
+
772
+ case 'LLLL':
773
+ default:
774
+ return match.month(string, {
775
+ width: 'wide',
776
+ context: 'standalone'
777
+ }) || match.month(string, {
778
+ width: 'abbreviated',
779
+ context: 'standalone'
780
+ }) || match.month(string, {
781
+ width: 'narrow',
782
+ context: 'standalone'
783
+ });
784
+ }
785
+ },
786
+ validate: function (_date, value, _options) {
787
+ return value >= 0 && value <= 11;
788
+ },
789
+ set: function (date, _flags, value, _options) {
790
+ date.setUTCMonth(value, 1);
791
+ date.setUTCHours(0, 0, 0, 0);
792
+ return date;
793
+ },
794
+ incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']
795
+ },
796
+ // Local week of year
797
+ w: {
798
+ priority: 100,
799
+ parse: function (string, token, match, _options) {
800
+ switch (token) {
801
+ case 'w':
802
+ return parseNumericPattern(numericPatterns.week, string);
803
+
804
+ case 'wo':
805
+ return match.ordinalNumber(string, {
806
+ unit: 'week'
807
+ });
808
+
809
+ default:
810
+ return parseNDigits(token.length, string);
811
+ }
812
+ },
813
+ validate: function (_date, value, _options) {
814
+ return value >= 1 && value <= 53;
815
+ },
816
+ set: function (date, _flags, value, options) {
817
+ return index$1.startOfUTCWeek(setUTCWeek(date, value, options), options);
818
+ },
819
+ incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'i', 't', 'T']
820
+ },
821
+ // ISO week of year
822
+ I: {
823
+ priority: 100,
824
+ parse: function (string, token, match, _options) {
825
+ switch (token) {
826
+ case 'I':
827
+ return parseNumericPattern(numericPatterns.week, string);
828
+
829
+ case 'Io':
830
+ return match.ordinalNumber(string, {
831
+ unit: 'week'
832
+ });
833
+
834
+ default:
835
+ return parseNDigits(token.length, string);
836
+ }
837
+ },
838
+ validate: function (_date, value, _options) {
839
+ return value >= 1 && value <= 53;
840
+ },
841
+ set: function (date, _flags, value, options) {
842
+ return index$1.startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);
843
+ },
844
+ incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'e', 'c', 't', 'T']
845
+ },
846
+ // Day of the month
847
+ d: {
848
+ priority: 90,
849
+ subPriority: 1,
850
+ parse: function (string, token, match, _options) {
851
+ switch (token) {
852
+ case 'd':
853
+ return parseNumericPattern(numericPatterns.date, string);
854
+
855
+ case 'do':
856
+ return match.ordinalNumber(string, {
857
+ unit: 'date'
858
+ });
859
+
860
+ default:
861
+ return parseNDigits(token.length, string);
862
+ }
863
+ },
864
+ validate: function (date, value, _options) {
865
+ var year = date.getUTCFullYear();
866
+ var isLeapYear = isLeapYearIndex(year);
867
+ var month = date.getUTCMonth();
868
+
869
+ if (isLeapYear) {
870
+ return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
871
+ } else {
872
+ return value >= 1 && value <= DAYS_IN_MONTH[month];
873
+ }
874
+ },
875
+ set: function (date, _flags, value, _options) {
876
+ date.setUTCDate(value);
877
+ date.setUTCHours(0, 0, 0, 0);
878
+ return date;
879
+ },
880
+ incompatibleTokens: ['Y', 'R', 'q', 'Q', 'w', 'I', 'D', 'i', 'e', 'c', 't', 'T']
881
+ },
882
+ // Day of year
883
+ D: {
884
+ priority: 90,
885
+ subPriority: 1,
886
+ parse: function (string, token, match, _options) {
887
+ switch (token) {
888
+ case 'D':
889
+ case 'DD':
890
+ return parseNumericPattern(numericPatterns.dayOfYear, string);
891
+
892
+ case 'Do':
893
+ return match.ordinalNumber(string, {
894
+ unit: 'date'
895
+ });
896
+
897
+ default:
898
+ return parseNDigits(token.length, string);
899
+ }
900
+ },
901
+ validate: function (date, value, _options) {
902
+ var year = date.getUTCFullYear();
903
+ var isLeapYear = isLeapYearIndex(year);
904
+
905
+ if (isLeapYear) {
906
+ return value >= 1 && value <= 366;
907
+ } else {
908
+ return value >= 1 && value <= 365;
909
+ }
910
+ },
911
+ set: function (date, _flags, value, _options) {
912
+ date.setUTCMonth(0, value);
913
+ date.setUTCHours(0, 0, 0, 0);
914
+ return date;
915
+ },
916
+ incompatibleTokens: ['Y', 'R', 'q', 'Q', 'M', 'L', 'w', 'I', 'd', 'E', 'i', 'e', 'c', 't', 'T']
917
+ },
918
+ // Day of week
919
+ E: {
920
+ priority: 90,
921
+ parse: function (string, token, match, _options) {
922
+ switch (token) {
923
+ // Tue
924
+ case 'E':
925
+ case 'EE':
926
+ case 'EEE':
927
+ return match.day(string, {
928
+ width: 'abbreviated',
929
+ context: 'formatting'
930
+ }) || match.day(string, {
931
+ width: 'short',
932
+ context: 'formatting'
933
+ }) || match.day(string, {
934
+ width: 'narrow',
935
+ context: 'formatting'
936
+ });
937
+ // T
938
+
939
+ case 'EEEEE':
940
+ return match.day(string, {
941
+ width: 'narrow',
942
+ context: 'formatting'
943
+ });
944
+ // Tu
945
+
946
+ case 'EEEEEE':
947
+ return match.day(string, {
948
+ width: 'short',
949
+ context: 'formatting'
950
+ }) || match.day(string, {
951
+ width: 'narrow',
952
+ context: 'formatting'
953
+ });
954
+ // Tuesday
955
+
956
+ case 'EEEE':
957
+ default:
958
+ return match.day(string, {
959
+ width: 'wide',
960
+ context: 'formatting'
961
+ }) || match.day(string, {
962
+ width: 'abbreviated',
963
+ context: 'formatting'
964
+ }) || match.day(string, {
965
+ width: 'short',
966
+ context: 'formatting'
967
+ }) || match.day(string, {
968
+ width: 'narrow',
969
+ context: 'formatting'
970
+ });
971
+ }
972
+ },
973
+ validate: function (_date, value, _options) {
974
+ return value >= 0 && value <= 6;
975
+ },
976
+ set: function (date, _flags, value, options) {
977
+ date = setUTCDay(date, value, options);
978
+ date.setUTCHours(0, 0, 0, 0);
979
+ return date;
980
+ },
981
+ incompatibleTokens: ['D', 'i', 'e', 'c', 't', 'T']
982
+ },
983
+ // Local day of week
984
+ e: {
985
+ priority: 90,
986
+ parse: function (string, token, match, options) {
987
+ var valueCallback = function (value) {
988
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
989
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
990
+ };
991
+
992
+ switch (token) {
993
+ // 3
994
+ case 'e':
995
+ case 'ee':
996
+ // 03
997
+ return parseNDigits(token.length, string, valueCallback);
998
+ // 3rd
999
+
1000
+ case 'eo':
1001
+ return match.ordinalNumber(string, {
1002
+ unit: 'day',
1003
+ valueCallback: valueCallback
1004
+ });
1005
+ // Tue
1006
+
1007
+ case 'eee':
1008
+ return match.day(string, {
1009
+ width: 'abbreviated',
1010
+ context: 'formatting'
1011
+ }) || match.day(string, {
1012
+ width: 'short',
1013
+ context: 'formatting'
1014
+ }) || match.day(string, {
1015
+ width: 'narrow',
1016
+ context: 'formatting'
1017
+ });
1018
+ // T
1019
+
1020
+ case 'eeeee':
1021
+ return match.day(string, {
1022
+ width: 'narrow',
1023
+ context: 'formatting'
1024
+ });
1025
+ // Tu
1026
+
1027
+ case 'eeeeee':
1028
+ return match.day(string, {
1029
+ width: 'short',
1030
+ context: 'formatting'
1031
+ }) || match.day(string, {
1032
+ width: 'narrow',
1033
+ context: 'formatting'
1034
+ });
1035
+ // Tuesday
1036
+
1037
+ case 'eeee':
1038
+ default:
1039
+ return match.day(string, {
1040
+ width: 'wide',
1041
+ context: 'formatting'
1042
+ }) || match.day(string, {
1043
+ width: 'abbreviated',
1044
+ context: 'formatting'
1045
+ }) || match.day(string, {
1046
+ width: 'short',
1047
+ context: 'formatting'
1048
+ }) || match.day(string, {
1049
+ width: 'narrow',
1050
+ context: 'formatting'
1051
+ });
1052
+ }
1053
+ },
1054
+ validate: function (_date, value, _options) {
1055
+ return value >= 0 && value <= 6;
1056
+ },
1057
+ set: function (date, _flags, value, options) {
1058
+ date = setUTCDay(date, value, options);
1059
+ date.setUTCHours(0, 0, 0, 0);
1060
+ return date;
1061
+ },
1062
+ incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'c', 't', 'T']
1063
+ },
1064
+ // Stand-alone local day of week
1065
+ c: {
1066
+ priority: 90,
1067
+ parse: function (string, token, match, options) {
1068
+ var valueCallback = function (value) {
1069
+ var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
1070
+ return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
1071
+ };
1072
+
1073
+ switch (token) {
1074
+ // 3
1075
+ case 'c':
1076
+ case 'cc':
1077
+ // 03
1078
+ return parseNDigits(token.length, string, valueCallback);
1079
+ // 3rd
1080
+
1081
+ case 'co':
1082
+ return match.ordinalNumber(string, {
1083
+ unit: 'day',
1084
+ valueCallback: valueCallback
1085
+ });
1086
+ // Tue
1087
+
1088
+ case 'ccc':
1089
+ return match.day(string, {
1090
+ width: 'abbreviated',
1091
+ context: 'standalone'
1092
+ }) || match.day(string, {
1093
+ width: 'short',
1094
+ context: 'standalone'
1095
+ }) || match.day(string, {
1096
+ width: 'narrow',
1097
+ context: 'standalone'
1098
+ });
1099
+ // T
1100
+
1101
+ case 'ccccc':
1102
+ return match.day(string, {
1103
+ width: 'narrow',
1104
+ context: 'standalone'
1105
+ });
1106
+ // Tu
1107
+
1108
+ case 'cccccc':
1109
+ return match.day(string, {
1110
+ width: 'short',
1111
+ context: 'standalone'
1112
+ }) || match.day(string, {
1113
+ width: 'narrow',
1114
+ context: 'standalone'
1115
+ });
1116
+ // Tuesday
1117
+
1118
+ case 'cccc':
1119
+ default:
1120
+ return match.day(string, {
1121
+ width: 'wide',
1122
+ context: 'standalone'
1123
+ }) || match.day(string, {
1124
+ width: 'abbreviated',
1125
+ context: 'standalone'
1126
+ }) || match.day(string, {
1127
+ width: 'short',
1128
+ context: 'standalone'
1129
+ }) || match.day(string, {
1130
+ width: 'narrow',
1131
+ context: 'standalone'
1132
+ });
1133
+ }
1134
+ },
1135
+ validate: function (_date, value, _options) {
1136
+ return value >= 0 && value <= 6;
1137
+ },
1138
+ set: function (date, _flags, value, options) {
1139
+ date = setUTCDay(date, value, options);
1140
+ date.setUTCHours(0, 0, 0, 0);
1141
+ return date;
1142
+ },
1143
+ incompatibleTokens: ['y', 'R', 'u', 'q', 'Q', 'M', 'L', 'I', 'd', 'D', 'E', 'i', 'e', 't', 'T']
1144
+ },
1145
+ // ISO day of week
1146
+ i: {
1147
+ priority: 90,
1148
+ parse: function (string, token, match, _options) {
1149
+ var valueCallback = function (value) {
1150
+ if (value === 0) {
1151
+ return 7;
1152
+ }
1153
+
1154
+ return value;
1155
+ };
1156
+
1157
+ switch (token) {
1158
+ // 2
1159
+ case 'i':
1160
+ case 'ii':
1161
+ // 02
1162
+ return parseNDigits(token.length, string);
1163
+ // 2nd
1164
+
1165
+ case 'io':
1166
+ return match.ordinalNumber(string, {
1167
+ unit: 'day'
1168
+ });
1169
+ // Tue
1170
+
1171
+ case 'iii':
1172
+ return match.day(string, {
1173
+ width: 'abbreviated',
1174
+ context: 'formatting',
1175
+ valueCallback: valueCallback
1176
+ }) || match.day(string, {
1177
+ width: 'short',
1178
+ context: 'formatting',
1179
+ valueCallback: valueCallback
1180
+ }) || match.day(string, {
1181
+ width: 'narrow',
1182
+ context: 'formatting',
1183
+ valueCallback: valueCallback
1184
+ });
1185
+ // T
1186
+
1187
+ case 'iiiii':
1188
+ return match.day(string, {
1189
+ width: 'narrow',
1190
+ context: 'formatting',
1191
+ valueCallback: valueCallback
1192
+ });
1193
+ // Tu
1194
+
1195
+ case 'iiiiii':
1196
+ return match.day(string, {
1197
+ width: 'short',
1198
+ context: 'formatting',
1199
+ valueCallback: valueCallback
1200
+ }) || match.day(string, {
1201
+ width: 'narrow',
1202
+ context: 'formatting',
1203
+ valueCallback: valueCallback
1204
+ });
1205
+ // Tuesday
1206
+
1207
+ case 'iiii':
1208
+ default:
1209
+ return match.day(string, {
1210
+ width: 'wide',
1211
+ context: 'formatting',
1212
+ valueCallback: valueCallback
1213
+ }) || match.day(string, {
1214
+ width: 'abbreviated',
1215
+ context: 'formatting',
1216
+ valueCallback: valueCallback
1217
+ }) || match.day(string, {
1218
+ width: 'short',
1219
+ context: 'formatting',
1220
+ valueCallback: valueCallback
1221
+ }) || match.day(string, {
1222
+ width: 'narrow',
1223
+ context: 'formatting',
1224
+ valueCallback: valueCallback
1225
+ });
1226
+ }
1227
+ },
1228
+ validate: function (_date, value, _options) {
1229
+ return value >= 1 && value <= 7;
1230
+ },
1231
+ set: function (date, _flags, value, options) {
1232
+ date = setUTCISODay(date, value, options);
1233
+ date.setUTCHours(0, 0, 0, 0);
1234
+ return date;
1235
+ },
1236
+ incompatibleTokens: ['y', 'Y', 'u', 'q', 'Q', 'M', 'L', 'w', 'd', 'D', 'E', 'e', 'c', 't', 'T']
1237
+ },
1238
+ // AM or PM
1239
+ a: {
1240
+ priority: 80,
1241
+ parse: function (string, token, match, _options) {
1242
+ switch (token) {
1243
+ case 'a':
1244
+ case 'aa':
1245
+ case 'aaa':
1246
+ return match.dayPeriod(string, {
1247
+ width: 'abbreviated',
1248
+ context: 'formatting'
1249
+ }) || match.dayPeriod(string, {
1250
+ width: 'narrow',
1251
+ context: 'formatting'
1252
+ });
1253
+
1254
+ case 'aaaaa':
1255
+ return match.dayPeriod(string, {
1256
+ width: 'narrow',
1257
+ context: 'formatting'
1258
+ });
1259
+
1260
+ case 'aaaa':
1261
+ default:
1262
+ return match.dayPeriod(string, {
1263
+ width: 'wide',
1264
+ context: 'formatting'
1265
+ }) || match.dayPeriod(string, {
1266
+ width: 'abbreviated',
1267
+ context: 'formatting'
1268
+ }) || match.dayPeriod(string, {
1269
+ width: 'narrow',
1270
+ context: 'formatting'
1271
+ });
1272
+ }
1273
+ },
1274
+ set: function (date, _flags, value, _options) {
1275
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1276
+ return date;
1277
+ },
1278
+ incompatibleTokens: ['b', 'B', 'H', 'K', 'k', 't', 'T']
1279
+ },
1280
+ // AM, PM, midnight
1281
+ b: {
1282
+ priority: 80,
1283
+ parse: function (string, token, match, _options) {
1284
+ switch (token) {
1285
+ case 'b':
1286
+ case 'bb':
1287
+ case 'bbb':
1288
+ return match.dayPeriod(string, {
1289
+ width: 'abbreviated',
1290
+ context: 'formatting'
1291
+ }) || match.dayPeriod(string, {
1292
+ width: 'narrow',
1293
+ context: 'formatting'
1294
+ });
1295
+
1296
+ case 'bbbbb':
1297
+ return match.dayPeriod(string, {
1298
+ width: 'narrow',
1299
+ context: 'formatting'
1300
+ });
1301
+
1302
+ case 'bbbb':
1303
+ default:
1304
+ return match.dayPeriod(string, {
1305
+ width: 'wide',
1306
+ context: 'formatting'
1307
+ }) || match.dayPeriod(string, {
1308
+ width: 'abbreviated',
1309
+ context: 'formatting'
1310
+ }) || match.dayPeriod(string, {
1311
+ width: 'narrow',
1312
+ context: 'formatting'
1313
+ });
1314
+ }
1315
+ },
1316
+ set: function (date, _flags, value, _options) {
1317
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1318
+ return date;
1319
+ },
1320
+ incompatibleTokens: ['a', 'B', 'H', 'K', 'k', 't', 'T']
1321
+ },
1322
+ // in the morning, in the afternoon, in the evening, at night
1323
+ B: {
1324
+ priority: 80,
1325
+ parse: function (string, token, match, _options) {
1326
+ switch (token) {
1327
+ case 'B':
1328
+ case 'BB':
1329
+ case 'BBB':
1330
+ return match.dayPeriod(string, {
1331
+ width: 'abbreviated',
1332
+ context: 'formatting'
1333
+ }) || match.dayPeriod(string, {
1334
+ width: 'narrow',
1335
+ context: 'formatting'
1336
+ });
1337
+
1338
+ case 'BBBBB':
1339
+ return match.dayPeriod(string, {
1340
+ width: 'narrow',
1341
+ context: 'formatting'
1342
+ });
1343
+
1344
+ case 'BBBB':
1345
+ default:
1346
+ return match.dayPeriod(string, {
1347
+ width: 'wide',
1348
+ context: 'formatting'
1349
+ }) || match.dayPeriod(string, {
1350
+ width: 'abbreviated',
1351
+ context: 'formatting'
1352
+ }) || match.dayPeriod(string, {
1353
+ width: 'narrow',
1354
+ context: 'formatting'
1355
+ });
1356
+ }
1357
+ },
1358
+ set: function (date, _flags, value, _options) {
1359
+ date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
1360
+ return date;
1361
+ },
1362
+ incompatibleTokens: ['a', 'b', 't', 'T']
1363
+ },
1364
+ // Hour [1-12]
1365
+ h: {
1366
+ priority: 70,
1367
+ parse: function (string, token, match, _options) {
1368
+ switch (token) {
1369
+ case 'h':
1370
+ return parseNumericPattern(numericPatterns.hour12h, string);
1371
+
1372
+ case 'ho':
1373
+ return match.ordinalNumber(string, {
1374
+ unit: 'hour'
1375
+ });
1376
+
1377
+ default:
1378
+ return parseNDigits(token.length, string);
1379
+ }
1380
+ },
1381
+ validate: function (_date, value, _options) {
1382
+ return value >= 1 && value <= 12;
1383
+ },
1384
+ set: function (date, _flags, value, _options) {
1385
+ var isPM = date.getUTCHours() >= 12;
1386
+
1387
+ if (isPM && value < 12) {
1388
+ date.setUTCHours(value + 12, 0, 0, 0);
1389
+ } else if (!isPM && value === 12) {
1390
+ date.setUTCHours(0, 0, 0, 0);
1391
+ } else {
1392
+ date.setUTCHours(value, 0, 0, 0);
1393
+ }
1394
+
1395
+ return date;
1396
+ },
1397
+ incompatibleTokens: ['H', 'K', 'k', 't', 'T']
1398
+ },
1399
+ // Hour [0-23]
1400
+ H: {
1401
+ priority: 70,
1402
+ parse: function (string, token, match, _options) {
1403
+ switch (token) {
1404
+ case 'H':
1405
+ return parseNumericPattern(numericPatterns.hour23h, string);
1406
+
1407
+ case 'Ho':
1408
+ return match.ordinalNumber(string, {
1409
+ unit: 'hour'
1410
+ });
1411
+
1412
+ default:
1413
+ return parseNDigits(token.length, string);
1414
+ }
1415
+ },
1416
+ validate: function (_date, value, _options) {
1417
+ return value >= 0 && value <= 23;
1418
+ },
1419
+ set: function (date, _flags, value, _options) {
1420
+ date.setUTCHours(value, 0, 0, 0);
1421
+ return date;
1422
+ },
1423
+ incompatibleTokens: ['a', 'b', 'h', 'K', 'k', 't', 'T']
1424
+ },
1425
+ // Hour [0-11]
1426
+ K: {
1427
+ priority: 70,
1428
+ parse: function (string, token, match, _options) {
1429
+ switch (token) {
1430
+ case 'K':
1431
+ return parseNumericPattern(numericPatterns.hour11h, string);
1432
+
1433
+ case 'Ko':
1434
+ return match.ordinalNumber(string, {
1435
+ unit: 'hour'
1436
+ });
1437
+
1438
+ default:
1439
+ return parseNDigits(token.length, string);
1440
+ }
1441
+ },
1442
+ validate: function (_date, value, _options) {
1443
+ return value >= 0 && value <= 11;
1444
+ },
1445
+ set: function (date, _flags, value, _options) {
1446
+ var isPM = date.getUTCHours() >= 12;
1447
+
1448
+ if (isPM && value < 12) {
1449
+ date.setUTCHours(value + 12, 0, 0, 0);
1450
+ } else {
1451
+ date.setUTCHours(value, 0, 0, 0);
1452
+ }
1453
+
1454
+ return date;
1455
+ },
1456
+ incompatibleTokens: ['a', 'b', 'h', 'H', 'k', 't', 'T']
1457
+ },
1458
+ // Hour [1-24]
1459
+ k: {
1460
+ priority: 70,
1461
+ parse: function (string, token, match, _options) {
1462
+ switch (token) {
1463
+ case 'k':
1464
+ return parseNumericPattern(numericPatterns.hour24h, string);
1465
+
1466
+ case 'ko':
1467
+ return match.ordinalNumber(string, {
1468
+ unit: 'hour'
1469
+ });
1470
+
1471
+ default:
1472
+ return parseNDigits(token.length, string);
1473
+ }
1474
+ },
1475
+ validate: function (_date, value, _options) {
1476
+ return value >= 1 && value <= 24;
1477
+ },
1478
+ set: function (date, _flags, value, _options) {
1479
+ var hours = value <= 24 ? value % 24 : value;
1480
+ date.setUTCHours(hours, 0, 0, 0);
1481
+ return date;
1482
+ },
1483
+ incompatibleTokens: ['a', 'b', 'h', 'H', 'K', 't', 'T']
1484
+ },
1485
+ // Minute
1486
+ m: {
1487
+ priority: 60,
1488
+ parse: function (string, token, match, _options) {
1489
+ switch (token) {
1490
+ case 'm':
1491
+ return parseNumericPattern(numericPatterns.minute, string);
1492
+
1493
+ case 'mo':
1494
+ return match.ordinalNumber(string, {
1495
+ unit: 'minute'
1496
+ });
1497
+
1498
+ default:
1499
+ return parseNDigits(token.length, string);
1500
+ }
1501
+ },
1502
+ validate: function (_date, value, _options) {
1503
+ return value >= 0 && value <= 59;
1504
+ },
1505
+ set: function (date, _flags, value, _options) {
1506
+ date.setUTCMinutes(value, 0, 0);
1507
+ return date;
1508
+ },
1509
+ incompatibleTokens: ['t', 'T']
1510
+ },
1511
+ // Second
1512
+ s: {
1513
+ priority: 50,
1514
+ parse: function (string, token, match, _options) {
1515
+ switch (token) {
1516
+ case 's':
1517
+ return parseNumericPattern(numericPatterns.second, string);
1518
+
1519
+ case 'so':
1520
+ return match.ordinalNumber(string, {
1521
+ unit: 'second'
1522
+ });
1523
+
1524
+ default:
1525
+ return parseNDigits(token.length, string);
1526
+ }
1527
+ },
1528
+ validate: function (_date, value, _options) {
1529
+ return value >= 0 && value <= 59;
1530
+ },
1531
+ set: function (date, _flags, value, _options) {
1532
+ date.setUTCSeconds(value, 0);
1533
+ return date;
1534
+ },
1535
+ incompatibleTokens: ['t', 'T']
1536
+ },
1537
+ // Fraction of second
1538
+ S: {
1539
+ priority: 30,
1540
+ parse: function (string, token, _match, _options) {
1541
+ var valueCallback = function (value) {
1542
+ return Math.floor(value * Math.pow(10, -token.length + 3));
1543
+ };
1544
+
1545
+ return parseNDigits(token.length, string, valueCallback);
1546
+ },
1547
+ set: function (date, _flags, value, _options) {
1548
+ date.setUTCMilliseconds(value);
1549
+ return date;
1550
+ },
1551
+ incompatibleTokens: ['t', 'T']
1552
+ },
1553
+ // Timezone (ISO-8601. +00:00 is `'Z'`)
1554
+ X: {
1555
+ priority: 10,
1556
+ parse: function (string, token, _match, _options) {
1557
+ switch (token) {
1558
+ case 'X':
1559
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
1560
+
1561
+ case 'XX':
1562
+ return parseTimezonePattern(timezonePatterns.basic, string);
1563
+
1564
+ case 'XXXX':
1565
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
1566
+
1567
+ case 'XXXXX':
1568
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
1569
+
1570
+ case 'XXX':
1571
+ default:
1572
+ return parseTimezonePattern(timezonePatterns.extended, string);
1573
+ }
1574
+ },
1575
+ set: function (date, flags, value, _options) {
1576
+ if (flags.timestampIsSet) {
1577
+ return date;
1578
+ }
1579
+
1580
+ return new Date(date.getTime() - value);
1581
+ },
1582
+ incompatibleTokens: ['t', 'T', 'x']
1583
+ },
1584
+ // Timezone (ISO-8601)
1585
+ x: {
1586
+ priority: 10,
1587
+ parse: function (string, token, _match, _options) {
1588
+ switch (token) {
1589
+ case 'x':
1590
+ return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
1591
+
1592
+ case 'xx':
1593
+ return parseTimezonePattern(timezonePatterns.basic, string);
1594
+
1595
+ case 'xxxx':
1596
+ return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
1597
+
1598
+ case 'xxxxx':
1599
+ return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
1600
+
1601
+ case 'xxx':
1602
+ default:
1603
+ return parseTimezonePattern(timezonePatterns.extended, string);
1604
+ }
1605
+ },
1606
+ set: function (date, flags, value, _options) {
1607
+ if (flags.timestampIsSet) {
1608
+ return date;
1609
+ }
1610
+
1611
+ return new Date(date.getTime() - value);
1612
+ },
1613
+ incompatibleTokens: ['t', 'T', 'X']
1614
+ },
1615
+ // Seconds timestamp
1616
+ t: {
1617
+ priority: 40,
1618
+ parse: function (string, _token, _match, _options) {
1619
+ return parseAnyDigitsSigned(string);
1620
+ },
1621
+ set: function (_date, _flags, value, _options) {
1622
+ return [new Date(value * 1000), {
1623
+ timestampIsSet: true
1624
+ }];
1625
+ },
1626
+ incompatibleTokens: '*'
1627
+ },
1628
+ // Milliseconds timestamp
1629
+ T: {
1630
+ priority: 20,
1631
+ parse: function (string, _token, _match, _options) {
1632
+ return parseAnyDigitsSigned(string);
1633
+ },
1634
+ set: function (_date, _flags, value, _options) {
1635
+ return [new Date(value), {
1636
+ timestampIsSet: true
1637
+ }];
1638
+ },
1639
+ incompatibleTokens: '*'
1640
+ }
1641
+ };
1642
+ const parsers$1 = parsers;
1643
+
1644
+ var TIMEZONE_UNIT_PRIORITY = 10; // This RegExp consists of three parts separated by `|`:
1645
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
1646
+ // (one of the certain letters followed by `o`)
1647
+ // - (\w)\1* matches any sequences of the same letter
1648
+ // - '' matches two quote characters in a row
1649
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
1650
+ // except a single quote symbol, which ends the sequence.
1651
+ // Two quote characters do not end the sequence.
1652
+ // If there is no matching single quote
1653
+ // then the sequence will continue until the end of the string.
1654
+ // - . matches any single character unmatched by previous parts of the RegExps
1655
+
1656
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
1657
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
1658
+
1659
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
1660
+ var escapedStringRegExp = /^'([^]*?)'?$/;
1661
+ var doubleQuoteRegExp = /''/g;
1662
+ var notWhitespaceRegExp = /\S/;
1663
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
1664
+ /**
1665
+ * @name parse
1666
+ * @category Common Helpers
1667
+ * @summary Parse the date.
1668
+ *
1669
+ * @description
1670
+ * Return the date parsed from string using the given format string.
1671
+ *
1672
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
1673
+ * > See: https://git.io/fxCyr
1674
+ *
1675
+ * The characters in the format string wrapped between two single quotes characters (') are escaped.
1676
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
1677
+ *
1678
+ * Format of the format string is based on Unicode Technical Standard #35:
1679
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
1680
+ * with a few additions (see note 5 below the table).
1681
+ *
1682
+ * Not all tokens are compatible. Combinations that don't make sense or could lead to bugs are prohibited
1683
+ * and will throw `RangeError`. For example usage of 24-hour format token with AM/PM token will throw an exception:
1684
+ *
1685
+ * ```javascript
1686
+ * parse('23 AM', 'HH a', new Date())
1687
+ * //=> RangeError: The format string mustn't contain `HH` and `a` at the same time
1688
+ * ```
1689
+ *
1690
+ * See the compatibility table: https://docs.google.com/spreadsheets/d/e/2PACX-1vQOPU3xUhplll6dyoMmVUXHKl_8CRDs6_ueLmex3SoqwhuolkuN3O05l4rqx5h1dKX8eb46Ul-CCSrq/pubhtml?gid=0&single=true
1691
+ *
1692
+ * Accepted format string patterns:
1693
+ * | Unit |Prior| Pattern | Result examples | Notes |
1694
+ * |---------------------------------|-----|---------|-----------------------------------|-------|
1695
+ * | Era | 140 | G..GGG | AD, BC | |
1696
+ * | | | GGGG | Anno Domini, Before Christ | 2 |
1697
+ * | | | GGGGG | A, B | |
1698
+ * | Calendar year | 130 | y | 44, 1, 1900, 2017, 9999 | 4 |
1699
+ * | | | yo | 44th, 1st, 1900th, 9999999th | 4,5 |
1700
+ * | | | yy | 44, 01, 00, 17 | 4 |
1701
+ * | | | yyy | 044, 001, 123, 999 | 4 |
1702
+ * | | | yyyy | 0044, 0001, 1900, 2017 | 4 |
1703
+ * | | | yyyyy | ... | 2,4 |
1704
+ * | Local week-numbering year | 130 | Y | 44, 1, 1900, 2017, 9000 | 4 |
1705
+ * | | | Yo | 44th, 1st, 1900th, 9999999th | 4,5 |
1706
+ * | | | YY | 44, 01, 00, 17 | 4,6 |
1707
+ * | | | YYY | 044, 001, 123, 999 | 4 |
1708
+ * | | | YYYY | 0044, 0001, 1900, 2017 | 4,6 |
1709
+ * | | | YYYYY | ... | 2,4 |
1710
+ * | ISO week-numbering year | 130 | R | -43, 1, 1900, 2017, 9999, -9999 | 4,5 |
1711
+ * | | | RR | -43, 01, 00, 17 | 4,5 |
1712
+ * | | | RRR | -043, 001, 123, 999, -999 | 4,5 |
1713
+ * | | | RRRR | -0043, 0001, 2017, 9999, -9999 | 4,5 |
1714
+ * | | | RRRRR | ... | 2,4,5 |
1715
+ * | Extended year | 130 | u | -43, 1, 1900, 2017, 9999, -999 | 4 |
1716
+ * | | | uu | -43, 01, 99, -99 | 4 |
1717
+ * | | | uuu | -043, 001, 123, 999, -999 | 4 |
1718
+ * | | | uuuu | -0043, 0001, 2017, 9999, -9999 | 4 |
1719
+ * | | | uuuuu | ... | 2,4 |
1720
+ * | Quarter (formatting) | 120 | Q | 1, 2, 3, 4 | |
1721
+ * | | | Qo | 1st, 2nd, 3rd, 4th | 5 |
1722
+ * | | | QQ | 01, 02, 03, 04 | |
1723
+ * | | | QQQ | Q1, Q2, Q3, Q4 | |
1724
+ * | | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
1725
+ * | | | QQQQQ | 1, 2, 3, 4 | 4 |
1726
+ * | Quarter (stand-alone) | 120 | q | 1, 2, 3, 4 | |
1727
+ * | | | qo | 1st, 2nd, 3rd, 4th | 5 |
1728
+ * | | | qq | 01, 02, 03, 04 | |
1729
+ * | | | qqq | Q1, Q2, Q3, Q4 | |
1730
+ * | | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
1731
+ * | | | qqqqq | 1, 2, 3, 4 | 3 |
1732
+ * | Month (formatting) | 110 | M | 1, 2, ..., 12 | |
1733
+ * | | | Mo | 1st, 2nd, ..., 12th | 5 |
1734
+ * | | | MM | 01, 02, ..., 12 | |
1735
+ * | | | MMM | Jan, Feb, ..., Dec | |
1736
+ * | | | MMMM | January, February, ..., December | 2 |
1737
+ * | | | MMMMM | J, F, ..., D | |
1738
+ * | Month (stand-alone) | 110 | L | 1, 2, ..., 12 | |
1739
+ * | | | Lo | 1st, 2nd, ..., 12th | 5 |
1740
+ * | | | LL | 01, 02, ..., 12 | |
1741
+ * | | | LLL | Jan, Feb, ..., Dec | |
1742
+ * | | | LLLL | January, February, ..., December | 2 |
1743
+ * | | | LLLLL | J, F, ..., D | |
1744
+ * | Local week of year | 100 | w | 1, 2, ..., 53 | |
1745
+ * | | | wo | 1st, 2nd, ..., 53th | 5 |
1746
+ * | | | ww | 01, 02, ..., 53 | |
1747
+ * | ISO week of year | 100 | I | 1, 2, ..., 53 | 5 |
1748
+ * | | | Io | 1st, 2nd, ..., 53th | 5 |
1749
+ * | | | II | 01, 02, ..., 53 | 5 |
1750
+ * | Day of month | 90 | d | 1, 2, ..., 31 | |
1751
+ * | | | do | 1st, 2nd, ..., 31st | 5 |
1752
+ * | | | dd | 01, 02, ..., 31 | |
1753
+ * | Day of year | 90 | D | 1, 2, ..., 365, 366 | 7 |
1754
+ * | | | Do | 1st, 2nd, ..., 365th, 366th | 5 |
1755
+ * | | | DD | 01, 02, ..., 365, 366 | 7 |
1756
+ * | | | DDD | 001, 002, ..., 365, 366 | |
1757
+ * | | | DDDD | ... | 2 |
1758
+ * | Day of week (formatting) | 90 | E..EEE | Mon, Tue, Wed, ..., Sun | |
1759
+ * | | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
1760
+ * | | | EEEEE | M, T, W, T, F, S, S | |
1761
+ * | | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
1762
+ * | ISO day of week (formatting) | 90 | i | 1, 2, 3, ..., 7 | 5 |
1763
+ * | | | io | 1st, 2nd, ..., 7th | 5 |
1764
+ * | | | ii | 01, 02, ..., 07 | 5 |
1765
+ * | | | iii | Mon, Tue, Wed, ..., Sun | 5 |
1766
+ * | | | iiii | Monday, Tuesday, ..., Sunday | 2,5 |
1767
+ * | | | iiiii | M, T, W, T, F, S, S | 5 |
1768
+ * | | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 5 |
1769
+ * | Local day of week (formatting) | 90 | e | 2, 3, 4, ..., 1 | |
1770
+ * | | | eo | 2nd, 3rd, ..., 1st | 5 |
1771
+ * | | | ee | 02, 03, ..., 01 | |
1772
+ * | | | eee | Mon, Tue, Wed, ..., Sun | |
1773
+ * | | | eeee | Monday, Tuesday, ..., Sunday | 2 |
1774
+ * | | | eeeee | M, T, W, T, F, S, S | |
1775
+ * | | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
1776
+ * | Local day of week (stand-alone) | 90 | c | 2, 3, 4, ..., 1 | |
1777
+ * | | | co | 2nd, 3rd, ..., 1st | 5 |
1778
+ * | | | cc | 02, 03, ..., 01 | |
1779
+ * | | | ccc | Mon, Tue, Wed, ..., Sun | |
1780
+ * | | | cccc | Monday, Tuesday, ..., Sunday | 2 |
1781
+ * | | | ccccc | M, T, W, T, F, S, S | |
1782
+ * | | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
1783
+ * | AM, PM | 80 | a..aaa | AM, PM | |
1784
+ * | | | aaaa | a.m., p.m. | 2 |
1785
+ * | | | aaaaa | a, p | |
1786
+ * | AM, PM, noon, midnight | 80 | b..bbb | AM, PM, noon, midnight | |
1787
+ * | | | bbbb | a.m., p.m., noon, midnight | 2 |
1788
+ * | | | bbbbb | a, p, n, mi | |
1789
+ * | Flexible day period | 80 | B..BBB | at night, in the morning, ... | |
1790
+ * | | | BBBB | at night, in the morning, ... | 2 |
1791
+ * | | | BBBBB | at night, in the morning, ... | |
1792
+ * | Hour [1-12] | 70 | h | 1, 2, ..., 11, 12 | |
1793
+ * | | | ho | 1st, 2nd, ..., 11th, 12th | 5 |
1794
+ * | | | hh | 01, 02, ..., 11, 12 | |
1795
+ * | Hour [0-23] | 70 | H | 0, 1, 2, ..., 23 | |
1796
+ * | | | Ho | 0th, 1st, 2nd, ..., 23rd | 5 |
1797
+ * | | | HH | 00, 01, 02, ..., 23 | |
1798
+ * | Hour [0-11] | 70 | K | 1, 2, ..., 11, 0 | |
1799
+ * | | | Ko | 1st, 2nd, ..., 11th, 0th | 5 |
1800
+ * | | | KK | 01, 02, ..., 11, 00 | |
1801
+ * | Hour [1-24] | 70 | k | 24, 1, 2, ..., 23 | |
1802
+ * | | | ko | 24th, 1st, 2nd, ..., 23rd | 5 |
1803
+ * | | | kk | 24, 01, 02, ..., 23 | |
1804
+ * | Minute | 60 | m | 0, 1, ..., 59 | |
1805
+ * | | | mo | 0th, 1st, ..., 59th | 5 |
1806
+ * | | | mm | 00, 01, ..., 59 | |
1807
+ * | Second | 50 | s | 0, 1, ..., 59 | |
1808
+ * | | | so | 0th, 1st, ..., 59th | 5 |
1809
+ * | | | ss | 00, 01, ..., 59 | |
1810
+ * | Seconds timestamp | 40 | t | 512969520 | |
1811
+ * | | | tt | ... | 2 |
1812
+ * | Fraction of second | 30 | S | 0, 1, ..., 9 | |
1813
+ * | | | SS | 00, 01, ..., 99 | |
1814
+ * | | | SSS | 000, 0001, ..., 999 | |
1815
+ * | | | SSSS | ... | 2 |
1816
+ * | Milliseconds timestamp | 20 | T | 512969520900 | |
1817
+ * | | | TT | ... | 2 |
1818
+ * | Timezone (ISO-8601 w/ Z) | 10 | X | -08, +0530, Z | |
1819
+ * | | | XX | -0800, +0530, Z | |
1820
+ * | | | XXX | -08:00, +05:30, Z | |
1821
+ * | | | XXXX | -0800, +0530, Z, +123456 | 2 |
1822
+ * | | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
1823
+ * | Timezone (ISO-8601 w/o Z) | 10 | x | -08, +0530, +00 | |
1824
+ * | | | xx | -0800, +0530, +0000 | |
1825
+ * | | | xxx | -08:00, +05:30, +00:00 | 2 |
1826
+ * | | | xxxx | -0800, +0530, +0000, +123456 | |
1827
+ * | | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
1828
+ * | Long localized date | NA | P | 05/29/1453 | 5,8 |
1829
+ * | | | PP | May 29, 1453 | |
1830
+ * | | | PPP | May 29th, 1453 | |
1831
+ * | | | PPPP | Sunday, May 29th, 1453 | 2,5,8 |
1832
+ * | Long localized time | NA | p | 12:00 AM | 5,8 |
1833
+ * | | | pp | 12:00:00 AM | |
1834
+ * | Combination of date and time | NA | Pp | 05/29/1453, 12:00 AM | |
1835
+ * | | | PPpp | May 29, 1453, 12:00:00 AM | |
1836
+ * | | | PPPpp | May 29th, 1453 at ... | |
1837
+ * | | | PPPPpp | Sunday, May 29th, 1453 at ... | 2,5,8 |
1838
+ * Notes:
1839
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
1840
+ * are the same as "stand-alone" units, but are different in some languages.
1841
+ * "Formatting" units are declined according to the rules of the language
1842
+ * in the context of a date. "Stand-alone" units are always nominative singular.
1843
+ * In `format` function, they will produce different result:
1844
+ *
1845
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
1846
+ *
1847
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
1848
+ *
1849
+ * `parse` will try to match both formatting and stand-alone units interchangably.
1850
+ *
1851
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
1852
+ * the single quote characters (see below).
1853
+ * If the sequence is longer than listed in table:
1854
+ * - for numerical units (`yyyyyyyy`) `parse` will try to match a number
1855
+ * as wide as the sequence
1856
+ * - for text units (`MMMMMMMM`) `parse` will try to match the widest variation of the unit.
1857
+ * These variations are marked with "2" in the last column of the table.
1858
+ *
1859
+ * 3. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
1860
+ * These tokens represent the shortest form of the quarter.
1861
+ *
1862
+ * 4. The main difference between `y` and `u` patterns are B.C. years:
1863
+ *
1864
+ * | Year | `y` | `u` |
1865
+ * |------|-----|-----|
1866
+ * | AC 1 | 1 | 1 |
1867
+ * | BC 1 | 1 | 0 |
1868
+ * | BC 2 | 2 | -1 |
1869
+ *
1870
+ * Also `yy` will try to guess the century of two digit year by proximity with `referenceDate`:
1871
+ *
1872
+ * `parse('50', 'yy', new Date(2018, 0, 1)) //=> Sat Jan 01 2050 00:00:00`
1873
+ *
1874
+ * `parse('75', 'yy', new Date(2018, 0, 1)) //=> Wed Jan 01 1975 00:00:00`
1875
+ *
1876
+ * while `uu` will just assign the year as is:
1877
+ *
1878
+ * `parse('50', 'uu', new Date(2018, 0, 1)) //=> Sat Jan 01 0050 00:00:00`
1879
+ *
1880
+ * `parse('75', 'uu', new Date(2018, 0, 1)) //=> Tue Jan 01 0075 00:00:00`
1881
+ *
1882
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
1883
+ * except local week-numbering years are dependent on `options.weekStartsOn`
1884
+ * and `options.firstWeekContainsDate` (compare [setISOWeekYear]{@link https://date-fns.org/docs/setISOWeekYear}
1885
+ * and [setWeekYear]{@link https://date-fns.org/docs/setWeekYear}).
1886
+ *
1887
+ * 5. These patterns are not in the Unicode Technical Standard #35:
1888
+ * - `i`: ISO day of week
1889
+ * - `I`: ISO week of year
1890
+ * - `R`: ISO week-numbering year
1891
+ * - `o`: ordinal number modifier
1892
+ * - `P`: long localized date
1893
+ * - `p`: long localized time
1894
+ *
1895
+ * 6. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
1896
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
1897
+ *
1898
+ * 7. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.
1899
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
1900
+ *
1901
+ * 8. `P+` tokens do not have a defined priority since they are merely aliases to other tokens based
1902
+ * on the given locale.
1903
+ *
1904
+ * using `en-US` locale: `P` => `MM/dd/yyyy`
1905
+ * using `en-US` locale: `p` => `hh:mm a`
1906
+ * using `pt-BR` locale: `P` => `dd/MM/yyyy`
1907
+ * using `pt-BR` locale: `p` => `HH:mm`
1908
+ *
1909
+ * Values will be assigned to the date in the descending order of its unit's priority.
1910
+ * Units of an equal priority overwrite each other in the order of appearance.
1911
+ *
1912
+ * If no values of higher priority are parsed (e.g. when parsing string 'January 1st' without a year),
1913
+ * the values will be taken from 3rd argument `referenceDate` which works as a context of parsing.
1914
+ *
1915
+ * `referenceDate` must be passed for correct work of the function.
1916
+ * If you're not sure which `referenceDate` to supply, create a new instance of Date:
1917
+ * `parse('02/11/2014', 'MM/dd/yyyy', new Date())`
1918
+ * In this case parsing will be done in the context of the current date.
1919
+ * If `referenceDate` is `Invalid Date` or a value not convertible to valid `Date`,
1920
+ * then `Invalid Date` will be returned.
1921
+ *
1922
+ * The result may vary by locale.
1923
+ *
1924
+ * If `formatString` matches with `dateString` but does not provides tokens, `referenceDate` will be returned.
1925
+ *
1926
+ * If parsing failed, `Invalid Date` will be returned.
1927
+ * Invalid Date is a Date, whose time value is NaN.
1928
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
1929
+ *
1930
+ * ### v2.0.0 breaking changes:
1931
+ *
1932
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
1933
+ *
1934
+ * - Old `parse` was renamed to `toDate`.
1935
+ * Now `parse` is a new function which parses a string using a provided format.
1936
+ *
1937
+ * ```javascript
1938
+ * // Before v2.0.0
1939
+ * parse('2016-01-01')
1940
+ *
1941
+ * // v2.0.0 onward (toDate no longer accepts a string)
1942
+ * toDate(1392098430000) // Unix to timestamp
1943
+ * toDate(new Date(2014, 1, 11, 11, 30, 30)) // Cloning the date
1944
+ * parse('2016-01-01', 'yyyy-MM-dd', new Date())
1945
+ * ```
1946
+ *
1947
+ * @param {String} dateString - the string to parse
1948
+ * @param {String} formatString - the string of tokens
1949
+ * @param {Date|Number} referenceDate - defines values missing from the parsed dateString
1950
+ * @param {Object} [options] - an object with options.
1951
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
1952
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
1953
+ * @param {1|2|3|4|5|6|7} [options.firstWeekContainsDate=1] - the day of January, which is always in the first week of the year
1954
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
1955
+ * see: https://git.io/fxCyr
1956
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
1957
+ * see: https://git.io/fxCyr
1958
+ * @returns {Date} the parsed date
1959
+ * @throws {TypeError} 3 arguments required
1960
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
1961
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
1962
+ * @throws {RangeError} `options.locale` must contain `match` property
1963
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
1964
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
1965
+ * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
1966
+ * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr
1967
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
1968
+ *
1969
+ * @example
1970
+ * // Parse 11 February 2014 from middle-endian format:
1971
+ * var result = parse('02/11/2014', 'MM/dd/yyyy', new Date())
1972
+ * //=> Tue Feb 11 2014 00:00:00
1973
+ *
1974
+ * @example
1975
+ * // Parse 28th of February in Esperanto locale in the context of 2010 year:
1976
+ * import eo from 'date-fns/locale/eo'
1977
+ * var result = parse('28-a de februaro', "do 'de' MMMM", new Date(2010, 0, 1), {
1978
+ * locale: eo
1979
+ * })
1980
+ * //=> Sun Feb 28 2010 00:00:00
1981
+ */
1982
+
1983
+ function parse(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {
1984
+ index.requiredArgs(3, arguments);
1985
+ var dateString = String(dirtyDateString);
1986
+ var formatString = String(dirtyFormatString);
1987
+ var options = dirtyOptions || {};
1988
+ var locale = options.locale || index$1.defaultLocale;
1989
+
1990
+ if (!locale.match) {
1991
+ throw new RangeError('locale must contain match property');
1992
+ }
1993
+
1994
+ var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
1995
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : index$1.toInteger(localeFirstWeekContainsDate);
1996
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : index$1.toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
1997
+
1998
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
1999
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2000
+ }
2001
+
2002
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
2003
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : index$1.toInteger(localeWeekStartsOn);
2004
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : index$1.toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2005
+
2006
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2007
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2008
+ }
2009
+
2010
+ if (formatString === '') {
2011
+ if (dateString === '') {
2012
+ return index.toDate(dirtyReferenceDate);
2013
+ } else {
2014
+ return new Date(NaN);
2015
+ }
2016
+ }
2017
+
2018
+ var subFnOptions = {
2019
+ firstWeekContainsDate: firstWeekContainsDate,
2020
+ weekStartsOn: weekStartsOn,
2021
+ locale: locale
2022
+ }; // If timezone isn't specified, it will be set to the system timezone
2023
+
2024
+ var setters = [{
2025
+ priority: TIMEZONE_UNIT_PRIORITY,
2026
+ subPriority: -1,
2027
+ set: dateToSystemTimezone,
2028
+ index: 0
2029
+ }];
2030
+ var i;
2031
+ var tokens = formatString.match(longFormattingTokensRegExp).map(function (substring) {
2032
+ var firstCharacter = substring[0];
2033
+
2034
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2035
+ var longFormatter = index$1.longFormatters[firstCharacter];
2036
+ return longFormatter(substring, locale.formatLong, subFnOptions);
2037
+ }
2038
+
2039
+ return substring;
2040
+ }).join('').match(formattingTokensRegExp);
2041
+ var usedTokens = [];
2042
+
2043
+ for (i = 0; i < tokens.length; i++) {
2044
+ var token = tokens[i];
2045
+
2046
+ if (!options.useAdditionalWeekYearTokens && index$1.isProtectedWeekYearToken(token)) {
2047
+ index$1.throwProtectedError(token, formatString, dirtyDateString);
2048
+ }
2049
+
2050
+ if (!options.useAdditionalDayOfYearTokens && index$1.isProtectedDayOfYearToken(token)) {
2051
+ index$1.throwProtectedError(token, formatString, dirtyDateString);
2052
+ }
2053
+
2054
+ var firstCharacter = token[0];
2055
+ var parser = parsers$1[firstCharacter];
2056
+
2057
+ if (parser) {
2058
+ var incompatibleTokens = parser.incompatibleTokens;
2059
+
2060
+ if (Array.isArray(incompatibleTokens)) {
2061
+ var incompatibleToken = void 0;
2062
+
2063
+ for (var _i = 0; _i < usedTokens.length; _i++) {
2064
+ var usedToken = usedTokens[_i].token;
2065
+
2066
+ if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {
2067
+ incompatibleToken = usedTokens[_i];
2068
+ break;
2069
+ }
2070
+ }
2071
+
2072
+ if (incompatibleToken) {
2073
+ throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
2074
+ }
2075
+ } else if (parser.incompatibleTokens === '*' && usedTokens.length) {
2076
+ throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
2077
+ }
2078
+
2079
+ usedTokens.push({
2080
+ token: firstCharacter,
2081
+ fullToken: token
2082
+ });
2083
+ var parseResult = parser.parse(dateString, token, locale.match, subFnOptions);
2084
+
2085
+ if (!parseResult) {
2086
+ return new Date(NaN);
2087
+ }
2088
+
2089
+ setters.push({
2090
+ priority: parser.priority,
2091
+ subPriority: parser.subPriority || 0,
2092
+ set: parser.set,
2093
+ validate: parser.validate,
2094
+ value: parseResult.value,
2095
+ index: setters.length
2096
+ });
2097
+ dateString = parseResult.rest;
2098
+ } else {
2099
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2100
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2101
+ } // Replace two single quote characters with one single quote character
2102
+
2103
+
2104
+ if (token === "''") {
2105
+ token = "'";
2106
+ } else if (firstCharacter === "'") {
2107
+ token = cleanEscapedString(token);
2108
+ } // Cut token from string, or, if string doesn't match the token, return Invalid Date
2109
+
2110
+
2111
+ if (dateString.indexOf(token) === 0) {
2112
+ dateString = dateString.slice(token.length);
2113
+ } else {
2114
+ return new Date(NaN);
2115
+ }
2116
+ }
2117
+ } // Check if the remaining input contains something other than whitespace
2118
+
2119
+
2120
+ if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
2121
+ return new Date(NaN);
2122
+ }
2123
+
2124
+ var uniquePrioritySetters = setters.map(function (setter) {
2125
+ return setter.priority;
2126
+ }).sort(function (a, b) {
2127
+ return b - a;
2128
+ }).filter(function (priority, index, array) {
2129
+ return array.indexOf(priority) === index;
2130
+ }).map(function (priority) {
2131
+ return setters.filter(function (setter) {
2132
+ return setter.priority === priority;
2133
+ }).sort(function (a, b) {
2134
+ return b.subPriority - a.subPriority;
2135
+ });
2136
+ }).map(function (setterArray) {
2137
+ return setterArray[0];
2138
+ });
2139
+ var date = index.toDate(dirtyReferenceDate);
2140
+
2141
+ if (isNaN(date)) {
2142
+ return new Date(NaN);
2143
+ } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2144
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2145
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/37
2146
+
2147
+
2148
+ var utcDate = index$1.subMilliseconds(date, index$1.getTimezoneOffsetInMilliseconds(date));
2149
+ var flags = {};
2150
+
2151
+ for (i = 0; i < uniquePrioritySetters.length; i++) {
2152
+ var setter = uniquePrioritySetters[i];
2153
+
2154
+ if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {
2155
+ return new Date(NaN);
2156
+ }
2157
+
2158
+ var result = setter.set(utcDate, flags, setter.value, subFnOptions); // Result is tuple (date, flags)
2159
+
2160
+ if (result[0]) {
2161
+ utcDate = result[0];
2162
+ assign(flags, result[1]); // Result is date
2163
+ } else {
2164
+ utcDate = result;
2165
+ }
2166
+ }
2167
+
2168
+ return utcDate;
2169
+ }
2170
+
2171
+ function dateToSystemTimezone(date, flags) {
2172
+ if (flags.timestampIsSet) {
2173
+ return date;
2174
+ }
2175
+
2176
+ var convertedDate = new Date(0);
2177
+ convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
2178
+ convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
2179
+ return convertedDate;
2180
+ }
2181
+
2182
+ function cleanEscapedString(input) {
2183
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
2184
+ }
2185
+
2186
+ const calendarDatepickerCss = ".sc-digi-calendar-datepicker:root{--digi--grayscale--0:#ffffff;--digi--grayscale--100:#f4f4f4;--digi--grayscale--1000:#000000;--digi--grayscale--200:#ededed;--digi--grayscale--300:#e4e4e4;--digi--grayscale--400:#dddddd;--digi--grayscale--50:#fbfbfb;--digi--grayscale--500:#cacaca;--digi--grayscale--600:#acacac;--digi--grayscale--700:#757575;--digi--grayscale--800:#5c5c5c;--digi--grayscale--900:#333333;--digi--misc--transparent:#ffffff00;--digi--sentiment--error--200:#fdeded;--digi--sentiment--error--500:#da0000;--digi--sentiment--error--700:#c7311a;--digi--sentiment--informative--200:#e9e9ff;--digi--sentiment--informative--500:#0a4dd1;--digi--sentiment--informative--700:#0058a3;--digi--sentiment--success--200:#e9f6ec;--digi--sentiment--success--500:#008a20;--digi--sentiment--success--700:#02703c;--digi--sentiment--warning--200:#fff398;--digi--sentiment--warning--50:#fffbdd;--digi--sentiment--warning--500:#ffe200;--digi--sentiment--warning--700:#ffc108;--digi--sentiment--warning--900:#664d00;--digi--animation--duration--base:var(--digi--global--animation--duration--base);--digi--animation--duration--small:var(--digi--global--animation--duration--short);--digi--animation--duration--large:var(--digi--global--animation--duration--longer);--digi--animation--duration--reduced:var(--digi--global--animation--duration--shortest);--digi--animation--duration--sweep:var(--digi--global--animation--duration--longest);--digi--animation--rotation--45:var(--digi--global--animation--rotation--smallest-2);--digi--animation--rotation--90:var(--digi--global--animation--rotation--smallest);--digi--animation--rotation--135:var(--digi--global--animation--rotation--smaller);--digi--animation--rotation--180:var(--digi--global--animation--rotation--small);--digi--animation--rotation--225:var(--digi--global--animation--rotation--base);--digi--animation--rotation--270:var(--digi--global--animation--rotation--large);--digi--animation--rotation--315:var(--digi--global--animation--rotation--larger);--digi--animation--rotation--360:var(--digi--global--animation--rotation--largest);--digi--global--animation--duration--base:0.3s;--digi--global--animation--duration--short:0.2s;--digi--global--animation--duration--shorter:0.1s;--digi--global--animation--duration--shortest:0.01s;--digi--global--animation--duration--long:0.4s;--digi--global--animation--duration--longer:0.5s;--digi--global--animation--duration--longest:4s;--digi--global--animation--rotation--smallest-2:0deg;--digi--global--animation--rotation--smallest:45deg;--digi--global--animation--rotation--smaller:90deg;--digi--global--animation--rotation--small:135deg;--digi--global--animation--rotation--base:180deg;--digi--global--animation--rotation--large:225deg;--digi--global--animation--rotation--larger:270deg;--digi--global--animation--rotation--largest:315deg;--digi--global--animation--rotation--largest-2:360deg;--digi--global--border-radius--base:6px;--digi--global--border-radius--small:4px;--digi--global--border-radius--smaller:3px;--digi--global--border-radius--smallest:2px;--digi--global--border-radius--smallest-2:1px;--digi--global--border-radius--smallest-3:0px;--digi--global--border-radius--large:8px;--digi--global--border-radius--larger:16px;--digi--global--border-radius--largest:32px;--digi--global--border-radius--largest-2:64px;--digi--global--border-width--base:2px;--digi--global--border-width--small:1px;--digi--global--border-width--smaller:0px;--digi--global--border-width--large:4px;--digi--global--border-width--larger:6px;--digi--global--border-width--largest:8px;--digi--global--border-width--largest-2:10px;--digi--global--border-style--solid:solid;--digi--global--border-style--none:none;--digi--global--border-style--dashed:dashed;--digi--global--spacing--base:16px;--digi--global--spacing--small:14px;--digi--global--spacing--smaller:12px;--digi--global--spacing--smallest:10px;--digi--global--spacing--smallest-2:8px;--digi--global--spacing--smallest-3:6px;--digi--global--spacing--smallest-4:4px;--digi--global--spacing--smallest-5:3px;--digi--global--spacing--smallest-6:2px;--digi--global--spacing--smallest-7:1px;--digi--global--spacing--large:18px;--digi--global--spacing--larger:20px;--digi--global--spacing---:22px;--digi--global--spacing--largest-2:24px;--digi--global--spacing--largest-3:28px;--digi--global--spacing--largest-4:32px;--digi--global--spacing--largest-5:40px;--digi--global--spacing--largest-6:48px;--digi--global--spacing--largest-7:56px;--digi--global--spacing--largest-8:64px;--digi--global--spacing--largest:22px;--digi--global--spacing--largest-3-5:30px;--digi--global--spacing--largest-9:72px;--digi--global--spacing--largest-10:80px;--digi--global--breakpoint--smallest-3:374px;--digi--global--breakpoint--smallest-2:375px;--digi--global--breakpoint--smallest:575px;--digi--global--breakpoint--smaller:576px;--digi--global--breakpoint--small:767px;--digi--global--breakpoint--medium:768px;--digi--global--breakpoint--large:991px;--digi--global--breakpoint--larger:992px;--digi--global--breakpoint--largest:1199px;--digi--global--breakpoint--largest-2:1200px;--digi--global--breakpoint--largest-3:1399px;--digi--global--breakpoint--largest-4:1400px;--digi--global--size--smaller:auto;--digi--global--size--small:36rem;--digi--global--size--base:48rem;--digi--global--size--large:62rem;--digi--global--size--larger:75rem;--digi--global--size--largest:87.5rem;--digi--global--text-width--small:31rem;--digi--global--text-width--base:35rem;--digi--global--text-width--large:40rem;--digi--global--text-width--larger:44rem;--digi--global--text-width--largest:48rem;--digi--global--text-width--largest-2:53rem;--digi--global--text-width--largest-3:61rem;--digi--global--text-width--largest-4:70rem;--digi--global--typography--line-height--base:1.5;--digi--global--typography--line-height--small:1;--digi--global--typography--line-height--large:2;--digi--global--typography--font-size--base:1rem;--digi--global--typography--font-size--small:0.875rem;--digi--global--typography--font-size--smaller:0.75rem;--digi--global--typography--font-size--large:1.125rem;--digi--global--typography--font-size--larger:1.25rem;--digi--global--typography--font-size--largest:1.375rem;--digi--global--typography--font-size--largest-2:1.5rem;--digi--global--typography--font-size--largest-3:1.75rem;--digi--global--typography--font-size--largest-4:2rem;--digi--global--typography--font-size--largest-5:2.25rem;--digi--global--typography--font-size--interaction-small:0.875rem;--digi--global--typography--font-size--interaction-medium:1rem;--digi--global--typography--font-size--interaction-large:1.125rem;--digi--global--typography--font-size--largest-6:2.5rem;--digi--global--typography--font-weight--regular:400;--digi--global--typography--font-weight--light:300;--digi--global--typography--font-weight--semibold:600;--digi--global--typography--font-weight--bold:700;--digi--global--typography--font-family--default:'Open Sans';--digi--global--typography--font-family--mono:Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;--digi--global--typography--text-decoration--default:none;--digi--global--typography--text-decoration--link:underline;--digi--border-radius--primary:var(--digi--global--border-radius--smallest-3);--digi--border-radius--secondary:var(--digi--global--border-radius--base);--digi--border-radius--tertiary:var(--digi--global--border-radius--smaller);--digi--border-radius--complementary-1:var(--digi--global--border-radius--largest);--digi--border-radius--complementary-2:var(--digi--global--border-radius--largest-2);--digi--border-radius--button:var(--digi--global--border-radius--base);--digi--border-radius--input:var(--digi--global--border-radius--smallest-3);--digi--border-radius--input-search:var(--digi--global--border-radius--base);--digi--border-radius--complementary-3:var(--digi--global--border-radius--larger);--digi--border-width--primary:var(--digi--global--border-width--small);--digi--border-width--secondary:var(--digi--global--border-width--base);--digi--border-width--complementary-1:var(--digi--global--border-width--largest);--digi--border-width--complementary-2:var(--digi--global--border-width--largest-2);--digi--border-width--input-regular:var(--digi--global--border-width--small);--digi--border-width--input-validation:var(--digi--global--border-width--base);--digi--border-width--button:var(--digi--global--border-width--small);--digi--border-style--primary:var(--digi--global--border-style--solid);--digi--border-style--secondary:var(--digi--global--border-style--none);--digi--padding--medium:var(--digi--global--spacing--base);--digi--padding--smaller:var(--digi--global--spacing--smallest-2);--digi--padding--small:var(--digi--global--spacing--smaller);--digi--padding--large:var(--digi--global--spacing--largest-2);--digi--padding--larger:var(--digi--global--spacing--largest-3);--digi--padding--largest:var(--digi--global--spacing--largest-4);--digi--padding--largest-2:var(--digi--global--spacing--largest-5);--digi--padding--largest-3:var(--digi--global--spacing--largest-6);--digi--margin--smaller:var(--digi--global--spacing--smallest-2);--digi--margin--small:var(--digi--global--spacing--smallest);--digi--margin--medium:var(--digi--global--spacing--base);--digi--margin--large:var(--digi--global--spacing--largest-2);--digi--margin--larger:var(--digi--global--spacing--largest-3);--digi--margin--largest:var(--digi--global--spacing--largest-4);--digi--margin--h1-small:var(--digi--global--spacing--base);--digi--margin--h1-medium:var(--digi--global--spacing--largest-2);--digi--margin--h1-large:var(--digi--global--spacing--largest-4);--digi--margin--h2-small:var(--digi--global--spacing--base);--digi--margin--h2-large:var(--digi--global--spacing--base);--digi--margin--h3-small:var(--digi--global--spacing--smallest-2);--digi--margin--h3-large:var(--digi--global--spacing--smallest-2);--digi--margin--h4-h6-small:var(--digi--global--spacing--smallest-2);--digi--margin--h4-h6-large:var(--digi--global--spacing--smallest-2);--digi--margin--text-small:var(--digi--global--spacing--largest-2);--digi--margin--text-large:var(--digi--global--spacing--largest-2);--digi--gutter--largest-3:var(--digi--global--spacing--largest-2);--digi--gutter--largest-2:var(--digi--global--spacing--larger);--digi--gutter--largest:var(--digi--global--spacing--base);--digi--gutter--larger:var(--digi--global--spacing--smaller);--digi--gutter--large:var(--digi--global--spacing--smallest);--digi--gutter--medium:var(--digi--global--spacing--smallest-2);--digi--gutter--small:var(--digi--global--spacing--smallest-3);--digi--gutter--smaller:var(--digi--global--spacing--smallest-4);--digi--gutter--smallest:var(--digi--global--spacing--smallest-5);--digi--gutter--smallest-2:var(--digi--global--spacing--smallest-6);--digi--gutter--smallest-3:var(--digi--global--spacing--smallest-7);--digi--gutter--button-block-small:var(--digi--global--spacing--smallest-3);--digi--gutter--button-block-medium:var(--digi--global--spacing--smallest-2);--digi--gutter--button-block-large:var(--digi--global--spacing--smallest);--digi--gutter--button-inline-small:var(--digi--global--spacing--smallest-2);--digi--gutter--button-inline-medium:var(--digi--global--spacing--base);--digi--gutter--button-inline-large:var(--digi--global--spacing--largest-2);--digi--gutter--icon:var(--digi--global--spacing--smallest);--digi--breakpoint--small-below:var(--digi--global--breakpoint--smallest);--digi--breakpoint--small:var(--digi--global--breakpoint--smaller);--digi--breakpoint--medium-below:var(--digi--global--breakpoint--small);--digi--breakpoint--medium:var(--digi--global--breakpoint--medium);--digi--breakpoint--large-below:var(--digi--global--breakpoint--large);--digi--breakpoint--large:var(--digi--global--breakpoint--larger);--digi--breakpoint--x-large-below:var(--digi--global--breakpoint--largest);--digi--breakpoint--x-large:var(--digi--global--breakpoint--largest-2);--digi--breakpoint--xx-large-below:var(--digi--global--breakpoint--largest-3);--digi--breakpoint--xx-large:var(--digi--global--breakpoint--largest-4);--digi--container-width--smaller:var(--digi--global--size--smaller);--digi--container-width--small:var(--digi--global--size--small);--digi--container-width--base:var(--digi--global--size--base);--digi--container-width--medium:var(--digi--global--size--base);--digi--container-width--large:var(--digi--global--size--large);--digi--container-width--larger:var(--digi--global--size--larger);--digi--container-width--largest:var(--digi--global--size--largest);--digi--container-gutter--smaller:var(--digi--global--spacing--base);--digi--container-gutter--small:var(--digi--global--spacing--large);--digi--container-gutter--base:var(--digi--global--spacing--base);--digi--container-gutter--medium:var(--digi--global--spacing--largest-2);--digi--container-gutter--large:var(--digi--global--spacing--base);--digi--container-gutter--larger:var(--digi--global--spacing--largest-3-5);--digi--container-gutter--largest:var(--digi--global--spacing--largest-5);--digi--paragraph-width--medium:var(--digi--global--text-width--base);--digi--paragraph-width--large:var(--digi--global--text-width--large);--digi--input-height--small:var(--digi--global--spacing--largest-4);--digi--input-height--medium:var(--digi--global--spacing--largest-5);--digi--input-height--large:var(--digi--global--spacing--largest-6);--digi--typography--body--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--body--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--body--font-size--mobile:var(--digi--global--typography--font-size--base);--digi--typography--body--font-weight--desktop:var(--digi--global--typography--font-weight--regular);--digi--typography--body--font-weight--desktop-large:var(--digi--global--typography--font-weight--regular);--digi--typography--body--font-weight--mobile:var(--digi--global--typography--font-weight--regular);--digi--typography--body--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--body--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--body--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--body--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--body--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--default);--digi--typography--body--text-decoration--mobile:var(--digi--global--typography--text-decoration--default);--digi--typography--description--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--description--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--description--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-1--font-size--desktop:var(--digi--global--typography--font-size--largest-4);--digi--typography--heading-1--font-size--desktop-large:var(--digi--global--typography--font-size--largest-6);--digi--typography--heading-1--font-size--mobile:var(--digi--global--typography--font-size--largest-3);--digi--typography--heading-1--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-1--font-weight--desktop-large:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-1--font-weight--mobile:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-1--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--heading-1--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--heading-1--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--heading-1--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-1--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-1--text-decoration--mobile:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-2--font-size--desktop:var(--digi--global--typography--font-size--largest-2);--digi--typography--heading-2--font-size--desktop-large:var(--digi--global--typography--font-size--largest-3);--digi--typography--heading-2--font-size--mobile:var(--digi--global--typography--font-size--largest);--digi--typography--heading-2--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-2--font-weight--desktop-large:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-2--font-weight--mobile:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-2--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--heading-2--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--heading-2--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--heading-2--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-2--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-2--text-decoration--mobile:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-3--font-size--desktop:var(--digi--global--typography--font-size--larger);--digi--typography--heading-3--font-size--desktop-large:var(--digi--global--typography--font-size--largest);--digi--typography--heading-3--font-size--mobile:var(--digi--global--typography--font-size--large);--digi--typography--heading-3--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-3--font-weight--desktop-large:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-3--font-weight--mobile:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-3--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--heading-3--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--heading-3--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--heading-3--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-3--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-3--text-decoration--mobile:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-4--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--heading-4--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--heading-4--font-size--mobile:var(--digi--global--typography--font-size--base);--digi--typography--heading-4--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-4--font-weight--desktop-large:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-4--font-weight--mobile:var(--digi--global--typography--font-weight--semibold);--digi--typography--heading-4--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--heading-4--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--heading-4--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--heading-4--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-4--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-4--text-decoration--mobile:var(--digi--global--typography--text-decoration--default);--digi--typography--heading-jumbo--font-size--desktop:var(--digi--global--typography--font-size--largest-4);--digi--typography--heading-jumbo--font-size--desktop-large:var(--digi--global--typography--font-size--largest-6);--digi--typography--heading-jumbo--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--input--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--label--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--label--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--label--font-weight--mobile:var(--digi--global--typography--font-weight--semibold);--digi--typography--label--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--label-description--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--label-description--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--link--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--link--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--link--font-size--mobile:var(--digi--global--typography--font-size--base);--digi--typography--link--font-weight--desktop:var(--digi--global--typography--font-weight--regular);--digi--typography--link--font-weight--desktop-large:var(--digi--global--typography--font-weight--regular);--digi--typography--link--font-weight--mobile:var(--digi--global--typography--font-weight--regular);--digi--typography--link--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--link--line-height--desktop-large:var(--digi--global--typography--line-height--base);--digi--typography--link--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--link--text-decoration--desktop:var(--digi--global--typography--text-decoration--link);--digi--typography--link--text-decoration--desktop-large:var(--digi--global--typography--text-decoration--link);--digi--typography--link--text-decoration--mobile:var(--digi--global--typography--text-decoration--link);--digi--typography--link-bold--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--preamble--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--preamble--font-size--mobile:var(--digi--global--typography--font-size--base);--digi--typography--preamble--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--preamble--line-height--mobile:var(--digi--global--typography--line-height--base);--digi--typography--preamble--line-height--desktop:var(--digi--global--typography--line-height--base);--digi--typography--accordion--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--accordion--font-size--mobile:var(--digi--global--typography--font-size--base);--digi--typography--accordion--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--typography--tag--font-size--desktop:var(--digi--global--typography--font-size--small);--digi--typography--tag--font-size--mobile:var(--digi--global--typography--font-size--small);--digi--typography--tag--font-weight--desktop:var(--digi--global--typography--font-weight--regular);--digi--typography--breadcrumbs--font-size--desktop:var(--digi--global--typography--font-size--small);--digi--typography--breadcrumbs--text-decoration--desktop:var(--digi--global--typography--text-decoration--default);--digi--typography--title-logo--font-size--desktop:var(--digi--global--typography--font-size--largest-5);--digi--typography--title-logo--font-size--desktop-large:var(--digi--global--typography--font-size--largest-5);--digi--typography--title-logo--font-size--mobile:var(--digi--global--typography--font-size--largest-3);--digi--typography--title-logo--font-weight--desktop:var(--digi--global--typography--font-weight--bold);--digi--typography--button--font-size--desktop:var(--digi--global--typography--font-size--base);--digi--typography--button--font-size--desktop-large:var(--digi--global--typography--font-size--large);--digi--typography--button--font-weight--desktop:var(--digi--global--typography--font-weight--semibold);--digi--color--amethyst--500:#822998;--digi--color--jade--100:#bddfda;--digi--color--jade--200:#7fc1b6;--digi--color--jade--400:#379d8d;--digi--color--jade--50:#ddeeec;--digi--color--jade--500:#058470;--digi--color--jade--600:#046a5a;--digi--color--jade--700:#035548;--digi--color--jade--900:#02372f;--digi--color--leaf--100:#f1f7e5;--digi--color--leaf--200:#ddebc1;--digi--color--leaf--400:#aace65;--digi--color--leaf--500:#95c23e;--digi--color--leaf--600:#779b32;--digi--color--pear--500:#b7ee4a;--digi--color--pear--600:#a7d943;--digi--color--rose--100:#f4cada;--digi--color--rose--200:#e997b7;--digi--color--rose--400:#dd5c8e;--digi--color--rose--50:#f9e4ec;--digi--color--rose--500:#d43372;--digi--color--rose--600:#bd2e65;--digi--color--rose--700:#882149;--digi--color--rose--900:#54172e;--digi--color--sapphire--500:#1616b2;--digi--color--stratos--100:#dddde9;--digi--color--stratos--400:#33337b;--digi--color--stratos--500:#00005a;--digi--color--stratos--600:#000048;--digi--color--water--200:#f1f8fe;--digi--color--water--500:#bdd3e7;--digi--color--water--700:#0058a3;--digi--color--background--brand-primary--light--af18:var(--digi--color--stratos--500);--digi--color--background--interactive--default--input-elements--light--af18:var(--digi--grayscale--0);--digi--color--background--interactive--default--pop-out--light--af18:var(--digi--color--leaf--100);--digi--color--background--interactive--default--primary--light--af18:var(--digi--color--stratos--500);--digi--color--background--interactive--default--primary-inverted--light--af18:var(--digi--color--leaf--500);--digi--color--background--interactive--default--quaternary--light--af18:var(--digi--grayscale--100);--digi--color--background--interactive--default--secondary--light--af18:var(--digi--grayscale--0);--digi--color--background--interactive--default--secondary-inverted--light--af18:var(--digi--misc--transparent);--digi--color--background--interactive--default--tertiary--light--af18:var(--digi--grayscale--200);--digi--color--background--interactive--hover--inverted--light--af18:var(--digi--color--pear--500);--digi--color--background--interactive--hover--primary--light--af18:var(--digi--color--water--700);--digi--color--background--interactive--hover--quarternary--light--af18:var(--digi--grayscale--200);--digi--color--background--interactive--hover--secondary--light--af18:var(--digi--color--water--500);--digi--color--background--interactive--hover--tertiary--light--af18:var(--digi--color--sapphire--500);--digi--color--background--interactive--selected--on-menu-minus-button--light--af18:var(--digi--color--leaf--200);--digi--color--background--interactive--selected--primary--light--af18:var(--digi--sentiment--success--500);--digi--color--background--interactive--selected--secondary--light--af18:var(--digi--color--stratos--500);--digi--color--background--interactive--selected--tertiary--light--af18:var(--digi--grayscale--200);--digi--color--background--interactive--validation--error--light--af18:var(--digi--sentiment--error--200);--digi--color--background--interactive--validation--success--light--af18:var(--digi--sentiment--success--200);--digi--color--background--interactive--validation--warning--light--af18:var(--digi--sentiment--warning--50);--digi--color--background--notification--light--af18:var(--digi--sentiment--error--500);--digi--color--background--pop-out--light--af18:var(--digi--color--leaf--100);--digi--color--background--primary--light--af18:var(--digi--grayscale--0);--digi--color--background--secondary--light--af18:var(--digi--grayscale--100);--digi--color--background--secondary-accent--light--af18:var(--digi--grayscale--400);--digi--color--background--secondary-muted--light--af18:var(--digi--grayscale--50);--digi--color--background--sentiment--beta--primary--light--af18:var(--digi--color--rose--500);--digi--color--background--sentiment--beta--secondary--light--af18:var(--digi--color--rose--100);--digi--color--background--sentiment--error--primary--light--af18:var(--digi--sentiment--error--500);--digi--color--background--sentiment--error--secondary--light--af18:var(--digi--sentiment--error--700);--digi--color--background--sentiment--error--tertiary--light--af18:var(--digi--sentiment--error--200);--digi--color--background--sentiment--info--primary--light--af18:var(--digi--sentiment--informative--500);--digi--color--background--sentiment--info--secondary--light--af18:var(--digi--sentiment--informative--700);--digi--color--background--sentiment--info--tertiary--light--af18:var(--digi--sentiment--informative--200);--digi--color--background--sentiment--neutral--primary--light--af18:var(--digi--grayscale--700);--digi--color--background--sentiment--neutral--secondary--light--af18:var(--digi--grayscale--400);--digi--color--background--sentiment--neutral--tertiary--light--af18:var(--digi--grayscale--900);--digi--color--background--sentiment--success--primary--light--af18:var(--digi--sentiment--success--500);--digi--color--background--sentiment--success--secondary--light--af18:var(--digi--sentiment--success--700);--digi--color--background--sentiment--success--tertiary--light--af18:var(--digi--sentiment--success--200);--digi--color--background--sentiment--warning--primary--light--af18:var(--digi--sentiment--warning--500);--digi--color--background--sentiment--warning--quarternary--light--af18:var(--digi--sentiment--warning--50);--digi--color--background--sentiment--warning--secondary--light--af18:var(--digi--sentiment--warning--700);--digi--color--background--sentiment--warning--tertiary--light--af18:var(--digi--sentiment--warning--200);--digi--color--background--transparent--light--af18:var(--digi--misc--transparent);--digi--color--border--accent--primary--light--af18:var(--digi--color--stratos--500);--digi--color--border--accent--secondary--light--af18:var(--digi--color--leaf--500);--digi--color--border--interactive--default--inverted--light--af18:var(--digi--color--leaf--500);--digi--color--border--interactive--default--on-input--light--af18:var(--digi--grayscale--900);--digi--color--border--interactive--default--on-input-nuance--light--af18:var(--digi--grayscale--800);--digi--color--border--interactive--default--primary--light--af18:var(--digi--color--stratos--500);--digi--color--border--interactive--hover--inverted--light--af18:var(--digi--color--pear--500);--digi--color--border--interactive--hover--primary--light--af18:var(--digi--color--water--700);--digi--color--border--interactive--hover--secondary--light--af18:var(--digi--color--stratos--500);--digi--color--border--interactive--selected--primary--light--af18:var(--digi--sentiment--success--500);--digi--color--border--interactive--selected--secondary--light--af18:var(--digi--color--stratos--500);--digi--color--border--interactive--validation--error--light--af18:var(--digi--sentiment--error--500);--digi--color--border--interactive--validation--success--light--af18:var(--digi--sentiment--success--500);--digi--color--border--interactive--validation--warning--light--af18:var(--digi--sentiment--warning--900);--digi--color--border--notification--light--af18:var(--digi--grayscale--0);--digi--color--border--sentiment--error--light--af18:var(--digi--sentiment--error--500);--digi--color--border--sentiment--info--light--af18:var(--digi--sentiment--informative--500);--digi--color--border--sentiment--success--light--af18:var(--digi--sentiment--success--500);--digi--color--border--sentiment--warning--light--af18:var(--digi--sentiment--warning--500);--digi--color--border--transparent--light--af18:var(--digi--misc--transparent);--digi--color--divider--cta--light--af18:var(--digi--color--sapphire--500);--digi--color--divider--on-brand-primary--light--af18:var(--digi--color--stratos--400);--digi--color--divider--primary--light--af18:var(--digi--grayscale--400);--digi--color--divider--secondary--light--af18:var(--digi--grayscale--200);--digi--color--icon--brand-primary--light--af18:var(--digi--color--stratos--500);--digi--color--icon--brand-secondary--light--af18:var(--digi--color--leaf--500);--digi--color--icon--cta--light--af18:var(--digi--color--sapphire--500);--digi--color--icon--primary--light--af18:var(--digi--grayscale--900);--digi--color--icon--secondary--light--af18:var(--digi--grayscale--0);--digi--color--icon--validation--error--light--af18:var(--digi--sentiment--error--500);--digi--color--icon--validation--success--light--af18:var(--digi--sentiment--success--500);--digi--color--icon--validation--warning--light--af18:var(--digi--sentiment--warning--500);--digi--color--infographic--background--light--af18:var(--digi--grayscale--0);--digi--color--infographic--brand--primary--light--af18:var(--digi--color--leaf--500);--digi--color--infographic--brand--primary-alt--light--af18:var(--digi--color--leaf--500);--digi--color--infographic--brand--secondary--light--af18:var(--digi--color--leaf--200);--digi--color--infographic--brand--secondary-alt--light--af18:var(--digi--color--leaf--200);--digi--color--infographic--lineart--light--af18:var(--digi--grayscale--900);--digi--color--logotype--primary--symbol--light--af18:var(--digi--color--leaf--500);--digi--color--logotype--primary--text--light--af18:var(--digi--color--stratos--500);--digi--color--logotype--secondary--symbol--light--af18:#1db920;--digi--color--logotype--secondary--text--light--af18:var(--digi--grayscale--0);--digi--color--marking--indication--primary--light--af18:var(--digi--sentiment--success--500);--digi--color--marking--indication--secondary--light--af18:var(--digi--color--stratos--500);--digi--color--marking--indication--tertiary--light--af18:var(--digi--grayscale--700);--digi--color--marking--navigation--level-active--light--af18:var(--digi--color--leaf--200);--digi--color--marking--navigation--level-inactive--light--af18:var(--digi--grayscale--100);--digi--color--marking--navigation--selected--light--af18:var(--digi--color--leaf--500);--digi--color--misc--skeleton--light--af18:var(--digi--grayscale--400);--digi--color--misc--spinner-path--light--af18:var(--digi--grayscale--400);--digi--color--text--description--light--af18:var(--digi--grayscale--800);--digi--color--text--interactive--brand-primary--light--af18:var(--digi--color--stratos--500);--digi--color--text--interactive--brand-secondary--light--af18:var(--digi--color--leaf--500);--digi--color--text--interactive--primary--light--af18:var(--digi--color--sapphire--500);--digi--color--text--interactive--secondary--light--af18:var(--digi--grayscale--0);--digi--color--text--interactive--tertiary--light--af18:var(--digi--grayscale--900);--digi--color--text--interactive--visited--light--af18:var(--digi--color--amethyst--500);--digi--color--text--primary--light--af18:var(--digi--grayscale--900);--digi--color--text--secondary--light--af18:var(--digi--grayscale--0);--digi--amethyst--500:#822998;--digi--granskott--150:#f2faf2;--digi--granskott--200:#ebf8eb;--digi--granskott--250:#ddf4dd;--digi--granskott--300:#cbecc9;--digi--granskott--350:#ace4ad;--digi--granskott--650:#1db920;--digi--granskott--700:#02a704;--digi--granskott--750:#018903;--digi--granskott--800:#016503;--digi--natthimmel--200:#e9f6fd;--digi--natthimmel--250:#ddf1fc;--digi--natthimmel--300:#c9e9fa;--digi--natthimmel--350:#abdef7;--digi--natthimmel--700:#043982;--digi--natthimmel--800:#091d54;--digi--natthimmel--900:#071744;--digi--norrsken--400:#aaf5ab;--digi--norrsken--500:#67ee6a;--digi--rallarros--300:#f8ddf5;--digi--rallarros--500:#ce1cbd;--digi--sapphire--500:#1616b2;--digi--color--background--brand-primary--light:var(--digi--natthimmel--800);--digi--color--background--interactive--default--input-elements--light:var(--digi--grayscale--0);--digi--color--background--interactive--default--pop-out--light:var(--digi--granskott--150);--digi--color--background--interactive--default--primary--light:var(--digi--natthimmel--800);--digi--color--background--interactive--default--primary-inverted--light:var(--digi--norrsken--500);--digi--color--background--interactive--default--quaternary--light:var(--digi--grayscale--100);--digi--color--background--interactive--default--secondary--light:var(--digi--grayscale--0);--digi--color--background--interactive--default--secondary-inverted--light:var(--digi--misc--transparent);--digi--color--background--interactive--default--tertiary--light:var(--digi--grayscale--200);--digi--color--background--interactive--hover--inverted--light:var(--digi--norrsken--400);--digi--color--background--interactive--hover--primary--light:var(--digi--natthimmel--700);--digi--color--background--interactive--hover--quarternary--light:var(--digi--grayscale--200);--digi--color--background--interactive--hover--secondary--light:var(--digi--natthimmel--250);--digi--color--background--interactive--hover--tertiary--light:var(--digi--sapphire--500);--digi--color--background--interactive--selected--on-menu-minus-button--light:var(--digi--granskott--250);--digi--color--background--interactive--selected--primary--light:var(--digi--sentiment--success--500);--digi--color--background--interactive--selected--secondary--light:var(--digi--natthimmel--800);--digi--color--background--interactive--selected--tertiary--light:var(--digi--grayscale--200);--digi--color--background--interactive--validation--error--light:var(--digi--sentiment--error--200);--digi--color--background--interactive--validation--success--light:var(--digi--sentiment--success--200);--digi--color--background--interactive--validation--warning--light:var(--digi--sentiment--warning--50);--digi--color--background--notification--light:var(--digi--sentiment--error--500);--digi--color--background--pop-out--light:var(--digi--granskott--200);--digi--color--background--primary--light:var(--digi--grayscale--0);--digi--color--background--secondary--light:var(--digi--grayscale--100);--digi--color--background--secondary-accent--light:var(--digi--grayscale--400);--digi--color--background--secondary-muted--light:var(--digi--grayscale--50);--digi--color--background--sentiment--beta--primary--light:var(--digi--rallarros--500);--digi--color--background--sentiment--beta--secondary--light:var(--digi--rallarros--300);--digi--color--background--sentiment--error--primary--light:var(--digi--sentiment--error--500);--digi--color--background--sentiment--error--secondary--light:var(--digi--sentiment--error--700);--digi--color--background--sentiment--error--tertiary--light:var(--digi--sentiment--error--200);--digi--color--background--sentiment--info--primary--light:var(--digi--sentiment--informative--500);--digi--color--background--sentiment--info--secondary--light:var(--digi--sentiment--informative--700);--digi--color--background--sentiment--info--tertiary--light:var(--digi--sentiment--informative--200);--digi--color--background--sentiment--neutral--primary--light:var(--digi--grayscale--700);--digi--color--background--sentiment--neutral--secondary--light:var(--digi--grayscale--400);--digi--color--background--sentiment--neutral--tertiary--light:var(--digi--grayscale--900);--digi--color--background--sentiment--success--primary--light:var(--digi--sentiment--success--500);--digi--color--background--sentiment--success--secondary--light:var(--digi--sentiment--success--700);--digi--color--background--sentiment--success--tertiary--light:var(--digi--sentiment--success--200);--digi--color--background--sentiment--warning--primary--light:var(--digi--sentiment--warning--500);--digi--color--background--sentiment--warning--quarternary--light:var(--digi--sentiment--warning--50);--digi--color--background--sentiment--warning--secondary--light:var(--digi--sentiment--warning--700);--digi--color--background--sentiment--warning--tertiary--light:var(--digi--sentiment--warning--200);--digi--color--background--transparent--light:var(--digi--misc--transparent);--digi--color--border--accent--primary--light:var(--digi--natthimmel--800);--digi--color--border--accent--secondary--light:var(--digi--granskott--700);--digi--color--border--interactive--default--inverted--light:var(--digi--norrsken--500);--digi--color--border--interactive--default--on-input--light:var(--digi--grayscale--900);--digi--color--border--interactive--default--on-input-nuance--light:var(--digi--grayscale--800);--digi--color--border--interactive--default--primary--light:var(--digi--natthimmel--800);--digi--color--border--interactive--hover--inverted--light:var(--digi--norrsken--400);--digi--color--border--interactive--hover--primary--light:var(--digi--natthimmel--700);--digi--color--border--interactive--hover--secondary--light:var(--digi--natthimmel--800);--digi--color--border--interactive--selected--primary--light:var(--digi--sentiment--success--500);--digi--color--border--interactive--selected--secondary--light:var(--digi--natthimmel--800);--digi--color--border--interactive--validation--error--light:var(--digi--sentiment--error--500);--digi--color--border--interactive--validation--success--light:var(--digi--sentiment--success--500);--digi--color--border--interactive--validation--warning--light:var(--digi--sentiment--warning--900);--digi--color--border--notification--light:var(--digi--grayscale--0);--digi--color--border--sentiment--error--light:var(--digi--sentiment--error--500);--digi--color--border--sentiment--info--light:var(--digi--sentiment--informative--500);--digi--color--border--sentiment--success--light:var(--digi--sentiment--success--500);--digi--color--border--sentiment--warning--light:var(--digi--sentiment--warning--500);--digi--color--border--transparent--light:var(--digi--misc--transparent);--digi--color--divider--cta--light:var(--digi--sapphire--500);--digi--color--divider--on-brand-primary--light:var(--digi--natthimmel--350);--digi--color--divider--primary--light:var(--digi--grayscale--400);--digi--color--divider--secondary--light:var(--digi--grayscale--200);--digi--color--icon--brand-primary--light:var(--digi--natthimmel--800);--digi--color--icon--brand-secondary--light:var(--digi--norrsken--500);--digi--color--icon--cta--light:var(--digi--sapphire--500);--digi--color--icon--primary--light:var(--digi--grayscale--900);--digi--color--icon--secondary--light:var(--digi--grayscale--0);--digi--color--icon--validation--error--light:var(--digi--sentiment--error--500);--digi--color--icon--validation--success--light:var(--digi--sentiment--success--500);--digi--color--icon--validation--warning--light:var(--digi--sentiment--warning--500);--digi--color--infographic--background--light:var(--digi--grayscale--0);--digi--color--infographic--brand--primary--light:var(--digi--granskott--700);--digi--color--infographic--brand--primary-alt--light:var(--digi--granskott--700);--digi--color--infographic--brand--secondary--light:var(--digi--granskott--300);--digi--color--infographic--brand--secondary-alt--light:var(--digi--granskott--300);--digi--color--infographic--lineart--light:var(--digi--grayscale--900);--digi--color--logotype--primary--symbol--light:var(--digi--granskott--700);--digi--color--logotype--primary--text--light:var(--digi--natthimmel--800);--digi--color--logotype--secondary--symbol--light:#1db920;--digi--color--logotype--secondary--text--light:var(--digi--grayscale--0);--digi--color--marking--indication--primary--light:var(--digi--sentiment--success--500);--digi--color--marking--indication--secondary--light:var(--digi--natthimmel--800);--digi--color--marking--indication--tertiary--light:var(--digi--grayscale--700);--digi--color--marking--navigation--level-active--light:var(--digi--granskott--250);--digi--color--marking--navigation--level-inactive--light:var(--digi--grayscale--100);--digi--color--marking--navigation--selected--light:var(--digi--granskott--700);--digi--color--misc--skeleton--light:var(--digi--grayscale--400);--digi--color--misc--spinner-path--light:var(--digi--grayscale--400);--digi--color--text--description--light:var(--digi--grayscale--800);--digi--color--text--interactive--brand-primary--light:var(--digi--natthimmel--800);--digi--color--text--interactive--brand-secondary--light:var(--digi--norrsken--500);--digi--color--text--interactive--primary--light:var(--digi--sapphire--500);--digi--color--text--interactive--secondary--light:var(--digi--grayscale--0);--digi--color--text--interactive--tertiary--light:var(--digi--grayscale--900);--digi--color--text--interactive--visited--light:var(--digi--amethyst--500);--digi--color--text--primary--light:var(--digi--grayscale--900);--digi--color--text--secondary--light:var(--digi--grayscale--0);--digi--color--background--brand-primary:var(--digi--color--background--brand-primary--light);--digi--color--background--interactive--default--input-elements:var(--digi--color--background--interactive--default--input-elements--light);--digi--color--background--interactive--default--pop-out:var(--digi--color--background--interactive--default--pop-out--light);--digi--color--background--interactive--default--primary:var(--digi--color--background--interactive--default--primary--light);--digi--color--background--interactive--default--primary-inverted:var(--digi--color--background--interactive--default--primary-inverted--light);--digi--color--background--interactive--default--quaternary:var(--digi--color--background--interactive--default--quaternary--light);--digi--color--background--interactive--default--secondary:var(--digi--color--background--interactive--default--secondary--light);--digi--color--background--interactive--default--secondary-inverted:var(--digi--color--background--interactive--default--secondary-inverted--light);--digi--color--background--interactive--default--tertiary:var(--digi--color--background--interactive--default--tertiary--light);--digi--color--background--interactive--hover--inverted:var(--digi--color--background--interactive--hover--inverted--light);--digi--color--background--interactive--hover--primary:var(--digi--color--background--interactive--hover--primary--light);--digi--color--background--interactive--hover--quarternary:var(--digi--color--background--interactive--hover--quarternary--light);--digi--color--background--interactive--hover--secondary:var(--digi--color--background--interactive--hover--secondary--light);--digi--color--background--interactive--hover--tertiary:var(--digi--color--background--interactive--hover--tertiary--light);--digi--color--background--interactive--selected--on-menu-minus-button:var(--digi--color--background--interactive--selected--on-menu-minus-button--light);--digi--color--background--interactive--selected--primary:var(--digi--color--background--interactive--selected--primary--light);--digi--color--background--interactive--selected--secondary:var(--digi--color--background--interactive--selected--secondary--light);--digi--color--background--interactive--selected--tertiary:var(--digi--color--background--interactive--selected--tertiary--light);--digi--color--background--interactive--validation--error:var(--digi--color--background--interactive--validation--error--light);--digi--color--background--interactive--validation--success:var(--digi--color--background--interactive--validation--success--light);--digi--color--background--interactive--validation--warning:var(--digi--color--background--interactive--validation--warning--light);--digi--color--background--notification:var(--digi--color--background--notification--light);--digi--color--background--pop-out:var(--digi--color--background--pop-out--light);--digi--color--background--primary:var(--digi--color--background--primary--light);--digi--color--background--secondary:var(--digi--color--background--secondary--light);--digi--color--background--secondary-accent:var(--digi--color--background--secondary-accent--light);--digi--color--background--secondary-muted:var(--digi--color--background--secondary-muted--light);--digi--color--background--sentiment--beta--primary:var(--digi--color--background--sentiment--beta--primary--light);--digi--color--background--sentiment--beta--secondary:var(--digi--color--background--sentiment--beta--secondary--light);--digi--color--background--sentiment--error--primary:var(--digi--color--background--sentiment--error--primary--light);--digi--color--background--sentiment--error--secondary:var(--digi--color--background--sentiment--error--secondary--light);--digi--color--background--sentiment--error--tertiary:var(--digi--color--background--sentiment--error--tertiary--light);--digi--color--background--sentiment--info--primary:var(--digi--color--background--sentiment--info--primary--light);--digi--color--background--sentiment--info--secondary:var(--digi--color--background--sentiment--info--secondary--light);--digi--color--background--sentiment--info--tertiary:var(--digi--color--background--sentiment--info--tertiary--light);--digi--color--background--sentiment--neutral--primary:var(--digi--color--background--sentiment--neutral--primary--light);--digi--color--background--sentiment--neutral--secondary:var(--digi--color--background--sentiment--neutral--secondary--light);--digi--color--background--sentiment--neutral--tertiary:var(--digi--color--background--sentiment--neutral--tertiary--light);--digi--color--background--sentiment--success--primary:var(--digi--color--background--sentiment--success--primary--light);--digi--color--background--sentiment--success--secondary:var(--digi--color--background--sentiment--success--secondary--light);--digi--color--background--sentiment--success--tertiary:var(--digi--color--background--sentiment--success--tertiary--light);--digi--color--background--sentiment--warning--primary:var(--digi--color--background--sentiment--warning--primary--light);--digi--color--background--sentiment--warning--quarternary:var(--digi--color--background--sentiment--warning--quarternary--light);--digi--color--background--sentiment--warning--secondary:var(--digi--color--background--sentiment--warning--secondary--light);--digi--color--background--sentiment--warning--tertiary:var(--digi--color--background--sentiment--warning--tertiary--light);--digi--color--background--transparent:var(--digi--color--background--transparent--light);--digi--color--border--accent--primary:var(--digi--color--border--accent--primary--light);--digi--color--border--accent--secondary:var(--digi--color--border--accent--secondary--light);--digi--color--border--interactive--default--inverted:var(--digi--color--border--interactive--default--inverted--light);--digi--color--border--interactive--default--on-input:var(--digi--color--border--interactive--default--on-input--light);--digi--color--border--interactive--default--on-input-nuance:var(--digi--color--border--interactive--default--on-input-nuance--light);--digi--color--border--interactive--default--primary:var(--digi--color--border--interactive--default--primary--light);--digi--color--border--interactive--hover--inverted:var(--digi--color--border--interactive--hover--inverted--light);--digi--color--border--interactive--hover--primary:var(--digi--color--border--interactive--hover--primary--light);--digi--color--border--interactive--hover--secondary:var(--digi--color--border--interactive--hover--secondary--light);--digi--color--border--interactive--selected--primary:var(--digi--color--border--interactive--selected--primary--light);--digi--color--border--interactive--selected--secondary:var(--digi--color--border--interactive--selected--secondary--light);--digi--color--border--interactive--validation--error:var(--digi--color--border--interactive--validation--error--light);--digi--color--border--interactive--validation--success:var(--digi--color--border--interactive--validation--success--light);--digi--color--border--interactive--validation--warning:var(--digi--color--border--interactive--validation--warning--light);--digi--color--border--notification:var(--digi--color--border--notification--light);--digi--color--border--sentiment--error:var(--digi--color--border--sentiment--error--light);--digi--color--border--sentiment--info:var(--digi--color--border--sentiment--info--light);--digi--color--border--sentiment--success:var(--digi--color--border--sentiment--success--light);--digi--color--border--sentiment--warning:var(--digi--color--border--sentiment--warning--light);--digi--color--border--transparent:var(--digi--color--border--transparent--light);--digi--color--divider--cta:var(--digi--color--divider--cta--light);--digi--color--divider--on-brand-primary:var(--digi--color--divider--on-brand-primary--light);--digi--color--divider--primary:var(--digi--color--divider--primary--light);--digi--color--divider--secondary:var(--digi--color--divider--secondary--light);--digi--color--icon--brand-primary:var(--digi--color--icon--brand-primary--light);--digi--color--icon--brand-secondary:var(--digi--color--icon--brand-secondary--light);--digi--color--icon--cta:var(--digi--color--icon--cta--light);--digi--color--icon--primary:var(--digi--color--icon--primary--light);--digi--color--icon--secondary:var(--digi--color--icon--secondary--light);--digi--color--icon--validation--error:var(--digi--color--icon--validation--error--light);--digi--color--icon--validation--success:var(--digi--color--icon--validation--success--light);--digi--color--icon--validation--warning:var(--digi--color--icon--validation--warning--light);--digi--color--infographic--background:var(--digi--color--infographic--background--light);--digi--color--infographic--brand--primary:var(--digi--color--infographic--brand--primary--light);--digi--color--infographic--brand--primary-alt:var(--digi--color--infographic--brand--primary-alt--light);--digi--color--infographic--brand--secondary:var(--digi--color--infographic--brand--secondary--light);--digi--color--infographic--brand--secondary-alt:var(--digi--color--infographic--brand--secondary-alt--light);--digi--color--infographic--lineart:var(--digi--color--infographic--lineart--light);--digi--color--logotype--primary--symbol:var(--digi--color--logotype--primary--symbol--light);--digi--color--logotype--primary--text:var(--digi--color--logotype--primary--text--light);--digi--color--logotype--secondary--symbol:var(--digi--color--logotype--secondary--symbol--light);--digi--color--logotype--secondary--text:var(--digi--color--logotype--secondary--text--light);--digi--color--marking--indication--primary:var(--digi--color--marking--indication--primary--light);--digi--color--marking--indication--secondary:var(--digi--color--marking--indication--secondary--light);--digi--color--marking--indication--tertiary:var(--digi--color--marking--indication--tertiary--light);--digi--color--marking--navigation--level-active:var(--digi--color--marking--navigation--level-active--light);--digi--color--marking--navigation--level-inactive:var(--digi--color--marking--navigation--level-inactive--light);--digi--color--marking--navigation--selected:var(--digi--color--marking--navigation--selected--light);--digi--color--misc--skeleton:var(--digi--color--misc--skeleton--light);--digi--color--misc--spinner-path:var(--digi--color--misc--spinner-path--light);--digi--color--text--description:var(--digi--color--text--description--light);--digi--color--text--interactive--brand-primary:var(--digi--color--text--interactive--brand-primary--light);--digi--color--text--interactive--brand-secondary:var(--digi--color--text--interactive--brand-secondary--light);--digi--color--text--interactive--primary:var(--digi--color--text--interactive--primary--light);--digi--color--text--interactive--secondary:var(--digi--color--text--interactive--secondary--light);--digi--color--text--interactive--tertiary:var(--digi--color--text--interactive--tertiary--light);--digi--color--text--interactive--visited:var(--digi--color--text--interactive--visited--light);--digi--color--text--primary:var(--digi--color--text--primary--light);--digi--color--text--secondary:var(--digi--color--text--secondary--light)}body.sc-digi-calendar-datepicker{font-size:1rem;font-family:\"Open Sans\", Arial, sans-serif}.sc-digi-calendar-datepicker-h{--digi--datepicker--max-width:18.75rem;--digi--datepicker--border-radius:0.25rem;--digi--datepicker--calendar--max-width:20.25rem;--digi--datepicker--calendar--show-week--max-width:23.375rem;--digi--datepicker--calendar-shadow:0 0.125rem 0.375rem 0 rgba(0, 0, 0, 0.7);--digi--datepicker--calendar--background-color:var(--digi--color--background--interactive--default--secondary);--digi--datepicker--input-icon--width:0.875rem;--digi--datepicker--input-icon--horizontal-padding:0.75rem;--digi--datepicker--input-icon--vertical-padding:var(--digi--global--spacing--smallest-2);--digi--datepicker--input--inline-start:var(--digi--gutter--medium);--digi--datepicker--input--inline-end:calc(var(--digi--datepicker--input-icon--width) + var(--digi--datepicker--input-icon--horizontal-padding) * 2);box-sizing:content-box}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker.sc-digi-calendar-datepicker{position:relative;pointer-events:none}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker{position:relative;max-width:var(--digi--datepicker--max-width);pointer-events:auto}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__inactive.sc-digi-calendar-datepicker{--digi--form-input--background--empty:var(--digi--datepicker--input--inactive-background)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker{background:var(--digi--color--background--primary);height:var(--digi--form-input--height--medium);color:inherit;border:1px solid var(--digi--color--border--interactive--default--on-input);border-left:none;padding:0;font:inherit;outline:inherit;cursor:pointer}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker .digi-calendar-datepicker__button-icon.sc-digi-calendar-datepicker{box-sizing:content-box;width:var(--digi--datepicker--input-icon--width);padding:var(--digi--datepicker--input-icon--vertical-padding) var(--digi--datepicker--input-icon--horizontal-padding)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker svg.sc-digi-calendar-datepicker{color:var(--digi--color--icon--brand-primary)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker:focus-visible{outline:2px solid black;outline-offset:2px;box-shadow:0px 0px 0px 5px white}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker:hover,.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-field.sc-digi-calendar-datepicker .digi-calendar-datepicker__input-button.sc-digi-calendar-datepicker:focus{background:var(--digi--color--background--interactive--hover--secondary)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__calendar.sc-digi-calendar-datepicker{max-width:var(--digi--datepicker--calendar--max-width);height:0px;border-radius:var(--digi--datepicker--border-radius);overflow:hidden;z-index:1}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__show-week-numbers.sc-digi-calendar-datepicker .digi-calendar-datepicker__calendar.sc-digi-calendar-datepicker{max-width:var(--digi--datepicker--calendar--show-week--max-width)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__show-calendar.sc-digi-calendar-datepicker .digi-calendar-datepicker__calendar.sc-digi-calendar-datepicker{height:auto;background-color:var(--digi--datepicker--calendar--background-color);box-shadow:var(--digi--datepicker--calendar-shadow);position:absolute;top:var(--digi--datepicker--calendar--popup-top);left:0;pointer-events:auto}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__input-component.sc-digi-calendar-datepicker{--digi--form-input--padding:0 var(--digi--datepicker--input--inline-end) 0 var(--digi--datepicker--input--inline-start)}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__selected-date-alert.sc-digi-calendar-datepicker{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}.sc-digi-calendar-datepicker-h .digi-calendar-datepicker__sr-instructions.sc-digi-calendar-datepicker{border:0;clip:rect(1px, 1px, 1px, 1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap}";
2187
+ const DigiCalendarDatepickerStyle0 = calendarDatepickerCss;
2188
+
2189
+ const CalendarDatepicker = class {
2190
+ constructor(hostRef) {
2191
+ index$2.registerInstance(this, hostRef);
2192
+ this.afOnDateChange = index$2.createEvent(this, "afOnDateChange", 7);
2193
+ this.afOnDateChangeRawText = index$2.createEvent(this, "afOnDateChangeRawText", 7);
2194
+ this.afOnValidationChange = index$2.createEvent(this, "afOnValidationChange", 7);
2195
+ this.futureYears = 10;
2196
+ this.screenReaderUpdateTrigger = false;
2197
+ this.showWrongFormatError = false;
2198
+ this.showDisabledDateError = false;
2199
+ this.showCalendar = false;
2200
+ this.userInput = '';
2201
+ this.afId = randomIdGenerator_util.randomIdGenerator('digi-calendar-datepicker');
2202
+ this.afLabel = text._t.calendar.datepicker.label;
2203
+ this.afLabelDescription = undefined;
2204
+ this.afName = undefined;
2205
+ this.afOpenCalendarAriaLabel = text._t.calendar.datepicker.openCalendarAriaLabel;
2206
+ this.afCloseCalendarAriaLabel = text._t.calendar.datepicker.closeCalendarAriaLabel;
2207
+ this.afValidation = typographyVariation_enum.CalendarDatepickerValidation.NEUTRAL;
2208
+ this.afValidationText = undefined;
2209
+ this.afValidationWrongFormat = text._t.calendar.datepicker.validationWrongFormat;
2210
+ this.afValidationDisabledDate = text._t.calendar.datepicker.validationDisabledDate;
2211
+ this.afRequired = undefined;
2212
+ this.afDisableValidation = false;
2213
+ this.afRequiredText = undefined;
2214
+ this.afSelectedDates = [];
2215
+ this.afYearSelect = false;
2216
+ this.value = [];
2217
+ this.afMinDate = undefined;
2218
+ this.afMaxDate = undefined;
2219
+ this.afShowWeekNumber = false;
2220
+ this.afMultipleDates = false;
2221
+ this.afCloseOnSelect = false;
2222
+ this.afOpenCalendarTo = undefined;
2223
+ this.afErrorMessageIsAlert = true;
2224
+ this.afAnnounceIfOptional = false;
2225
+ this.afAnnounceIfOptionalText = undefined;
2226
+ }
2227
+ afDisableValidationChangeHandler(newVal) {
2228
+ if (!newVal) {
2229
+ const dates = this.userInput !== ''
2230
+ ? this.parseInputString(this.userInput)
2231
+ : this.afSelectedDates;
2232
+ this.validateInputAndShowErrors(dates);
2233
+ }
2234
+ else {
2235
+ this.showWrongFormatError = false;
2236
+ this.showDisabledDateError = false;
2237
+ }
2238
+ }
2239
+ afSelectedDatesChangeHandler(newVal) {
2240
+ if (!this.afDisableValidation && newVal.length > 0) {
2241
+ this.validateInputAndShowErrors(newVal);
2242
+ }
2243
+ }
2244
+ valueChangeHandler(newVal) {
2245
+ if (this.afDisableValidation && this.afSelectedDates.length > 0) {
2246
+ this.afSelectedDates = [];
2247
+ }
2248
+ /**
2249
+ * Behövde lägga till den här förändringen för att angular med value accessor betedde sig märkligt vid onBlur av input-fält. Den reagerade när man lämnade fältet även fast fältet var tomt (pratar om watchern). Så behövde bygga en guard/gatekeeper som kontrollerar värdet först. Ska inte påverka manuell-, eller autovalidering.
2250
+ */
2251
+ if (Array.isArray(newVal) &&
2252
+ newVal.every((d) => d instanceof Date && !isNaN(d.getTime()))) {
2253
+ this.afSelectedDates = newVal;
2254
+ this.userInput = '';
2255
+ }
2256
+ }
2257
+ afMinDateChangeHandler(newVal) {
2258
+ if (!this.afDisableValidation && newVal) {
2259
+ this.validateInputAndShowErrors(this.afSelectedDates);
2260
+ }
2261
+ }
2262
+ afMaxDateChangeHandler(newVal) {
2263
+ if (!this.afDisableValidation && newVal) {
2264
+ this.validateInputAndShowErrors(this.afSelectedDates);
2265
+ }
2266
+ }
2267
+ afMultipleDatesChangeHandler() {
2268
+ var _a;
2269
+ if (!this.afMultipleDates && this.afSelectedDates.length > 1) {
2270
+ this.afSelectedDates = this.afSelectedDates.slice(-1);
2271
+ this.value = (_a = this.afSelectedDates) !== null && _a !== void 0 ? _a : [];
2272
+ }
2273
+ }
2274
+ get errorMessageIsAlert() {
2275
+ return (this.afErrorMessageIsAlert !== false &&
2276
+ this.afErrorMessageIsAlert !== 'false');
2277
+ }
2278
+ clickHandler(e) {
2279
+ const target = e.target;
2280
+ const selector = `#${this.afId}-datepicker`;
2281
+ if (detectClickOutside_util.detectClickOutside(target, selector)) {
2282
+ this.showCalendar = false;
2283
+ }
2284
+ }
2285
+ /**
2286
+ * Lyssnar på om fokus sätts på custom-elementet och propagerar ner det till själva input-elementet.
2287
+ * @en Listens for when focus is set on the custom element and propagates it down to the actual input element.
2288
+ */
2289
+ focusOnInput() {
2290
+ this._input.focus();
2291
+ }
2292
+ connectedCallback() {
2293
+ this.hostElement.addEventListener('keyup', this.keyUpHandler.bind(this));
2294
+ }
2295
+ disconnectedCallback() {
2296
+ this.hostElement.removeEventListener('keyup', this.keyUpHandler.bind(this));
2297
+ }
2298
+ componentDidLoad() {
2299
+ var _a;
2300
+ if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) {
2301
+ this.setValue(this.value);
2302
+ }
2303
+ }
2304
+ componentDidUpdate() {
2305
+ if (this.showCalendar) {
2306
+ this.positionCalendar();
2307
+ }
2308
+ }
2309
+ get cssModifiers() {
2310
+ return {
2311
+ 'digi-calendar-datepicker__show-week-numbers': this.afShowWeekNumber,
2312
+ 'digi-calendar-datepicker__show-error': this.hasBuiltInValidationError() || this.hasCustomValidationError(),
2313
+ 'digi-calendar-datepicker__show-calendar': this.showCalendar
2314
+ };
2315
+ }
2316
+ keyUpHandler(e) {
2317
+ if (e.key === 'Escape' && this.showCalendar) {
2318
+ this.showCalendar = false;
2319
+ this.focusOnCalendarButton();
2320
+ e.stopPropagation();
2321
+ }
2322
+ }
2323
+ focusOnCalendarInput() {
2324
+ const input = this.hostElement.querySelector(`#${this.afId}-datepicker input`);
2325
+ input === null || input === void 0 ? void 0 : input.focus();
2326
+ }
2327
+ focusOnCalendarButton() {
2328
+ const calendarButton = this.hostElement.querySelector(`#${this.afId}-button`);
2329
+ calendarButton.focus();
2330
+ }
2331
+ positionCalendar() {
2332
+ const btn = this.hostElement.querySelector(`#${this.afId}-button`);
2333
+ const datepickerEl = this.hostElement.querySelector(`#${this.afId}-datepicker`);
2334
+ if (!btn || !datepickerEl)
2335
+ return;
2336
+ const btnRect = btn.getBoundingClientRect();
2337
+ const containerRect = datepickerEl.getBoundingClientRect();
2338
+ datepickerEl.style.setProperty('--digi--datepicker--calendar--popup-top', `${btnRect.bottom - containerRect.top + 5}px`);
2339
+ }
2340
+ toggleCalendar() {
2341
+ if (!this.showCalendar) {
2342
+ this.positionCalendar();
2343
+ }
2344
+ this.showCalendar = !this.showCalendar;
2345
+ if (this.showCalendar) {
2346
+ this.screenReaderUpdateTrigger = !this.screenReaderUpdateTrigger;
2347
+ }
2348
+ }
2349
+ parseInputString(value) {
2350
+ return value
2351
+ .split(new RegExp(`[&,]|${text._t.and}`, 'g'))
2352
+ .map((text) => this.parseDateString(text.trim()));
2353
+ }
2354
+ resetValueAndState() {
2355
+ this.showWrongFormatError = false;
2356
+ this.showDisabledDateError = false;
2357
+ this.setValue([]);
2358
+ this.afOnDateChange.emit([]);
2359
+ this.afSelectedDates = [];
2360
+ }
2361
+ removeDuplicateDates(dates) {
2362
+ const seen = new Set();
2363
+ return dates.filter((date) => {
2364
+ if (!(date instanceof Date) || isNaN(date.getTime())) {
2365
+ return true;
2366
+ }
2367
+ const key = date.toISOString().split('T')[0]; // yyyy-mm-dd
2368
+ if (seen.has(key)) {
2369
+ return false;
2370
+ }
2371
+ seen.add(key);
2372
+ return true;
2373
+ });
2374
+ }
2375
+ validateInputAndShowErrors(dates) {
2376
+ this.showWrongFormatError = !!dates.find((date) => !index.isValid(date));
2377
+ this.showDisabledDateError = !!dates.find((date) => !this.isDateSelectable(date));
2378
+ const inputIsValid = !this.showWrongFormatError && !this.showDisabledDateError;
2379
+ this.afOnValidationChange.emit({
2380
+ isValid: inputIsValid,
2381
+ validationText: inputIsValid
2382
+ ? undefined
2383
+ : this.showWrongFormatError
2384
+ ? this.afValidationWrongFormat
2385
+ : this.afValidationDisabledDate
2386
+ });
2387
+ }
2388
+ setValue(value) {
2389
+ this.afSelectedDates = value;
2390
+ this.value = value;
2391
+ }
2392
+ parseInput(evt) {
2393
+ let newValue = '';
2394
+ if (evt.detail && typeof evt.detail.value === 'string') {
2395
+ newValue = evt.detail.value;
2396
+ }
2397
+ else if (evt.target && evt.target.value != null) {
2398
+ newValue = evt.target.value;
2399
+ }
2400
+ this.userInput = newValue;
2401
+ if (newValue === '') {
2402
+ this.resetValueAndState();
2403
+ return;
2404
+ }
2405
+ let dates = this.parseInputString(newValue);
2406
+ // Single dates - acceptera inte flera datum inskrivna
2407
+ if (!this.afDisableValidation &&
2408
+ !this.afMultipleDates &&
2409
+ dates.length > 1) {
2410
+ this.showWrongFormatError = true;
2411
+ this.afOnValidationChange.emit({
2412
+ isValid: false,
2413
+ validationText: this.afValidationWrongFormat
2414
+ });
2415
+ return;
2416
+ }
2417
+ // Multiple dates - filtrera bort dubbletter
2418
+ if (!this.afDisableValidation && this.afMultipleDates) {
2419
+ const uniqueDates = this.removeDuplicateDates(dates);
2420
+ if (uniqueDates.length !== dates.length) {
2421
+ dates = uniqueDates;
2422
+ this.userInput = this.datesToInputString(dates);
2423
+ }
2424
+ }
2425
+ this.setValue(dates);
2426
+ if (!this.afDisableValidation) {
2427
+ this.validateInputAndShowErrors(dates);
2428
+ }
2429
+ this.afOnDateChange.emit(dates);
2430
+ }
2431
+ parseCalendar(evt) {
2432
+ if (!(evt === null || evt === void 0 ? void 0 : evt.detail))
2433
+ return;
2434
+ if (!this.afDisableValidation) {
2435
+ this.showWrongFormatError = false;
2436
+ this.showDisabledDateError = false;
2437
+ }
2438
+ this.userInput = '';
2439
+ this.setValue(evt.detail);
2440
+ this.afOnDateChangeRawText.emit(this.inputValue);
2441
+ if (this.afCloseOnSelect) {
2442
+ this.toggleCalendar();
2443
+ this.focusOnCalendarButton();
2444
+ }
2445
+ this.afOnDateChange.emit(this.afSelectedDates);
2446
+ }
2447
+ /*
2448
+
2449
+ Metoden överskrider JavaScripts inbyggda "isValid"-funktion, då den tillåter att ex., "1" är rätt format medans ex., "13" är fel format vid YYYY-MM-DD krav på inmatat format.
2450
+
2451
+ */
2452
+ parseDateString(s) {
2453
+ const raw = s.trim().replace(/[./]/g, '-');
2454
+ // 1) yyyy-MM-dd
2455
+ if (/^\d{4}-\d{2}-\d{2}$/.test(raw)) {
2456
+ const d = parse(raw, 'yyyy-MM-dd', new Date());
2457
+ return index.isValid(d) ? d : new Date(NaN);
2458
+ }
2459
+ // 2) yyyymmdd
2460
+ if (/^\d{8}$/.test(raw)) {
2461
+ const yyyy = raw.slice(0, 4);
2462
+ const mm = raw.slice(4, 6);
2463
+ const dd = raw.slice(6, 8);
2464
+ const d = parse(`${yyyy}-${mm}-${dd}`, 'yyyy-MM-dd', new Date());
2465
+ return index.isValid(d) ? d : new Date(NaN);
2466
+ }
2467
+ // 3) yymmdd (map to full year using the previous futureYears logic)
2468
+ if (/^\d{6}$/.test(raw)) {
2469
+ const yy = raw.slice(0, 2);
2470
+ const mm = raw.slice(2, 4);
2471
+ const dd = raw.slice(4, 6);
2472
+ const yyyy = this.getFullYear(yy);
2473
+ const d = parse(`${yyyy}-${mm}-${dd}`, 'yyyy-MM-dd', new Date());
2474
+ return index.isValid(d) ? d : new Date(NaN);
2475
+ }
2476
+ // Everything else is invalid (so "1" and "25" will now be "Fel format")
2477
+ return new Date(NaN);
2478
+ }
2479
+ getFullYear(s) {
2480
+ if (s.length === 4)
2481
+ return s;
2482
+ const y = new Date().getFullYear().toString();
2483
+ return parseInt(s) > parseInt(y.slice(-2)) + this.futureYears
2484
+ ? parseInt(y.slice(0, -2)) - 1 + s
2485
+ : y.slice(0, -2) + s;
2486
+ }
2487
+ isDateSelectable(date) {
2488
+ if (this.afMinDate && this.isBefore(date, this.afMinDate))
2489
+ return false;
2490
+ if (this.afMaxDate && this.isAfter(date, this.afMaxDate))
2491
+ return false;
2492
+ return true;
2493
+ }
2494
+ isBefore(a, b) {
2495
+ return index$3.isBefore(this.dateWithoutTime(a), this.dateWithoutTime(b));
2496
+ }
2497
+ isAfter(a, b) {
2498
+ return index$3.isAfter(this.dateWithoutTime(a), this.dateWithoutTime(b));
2499
+ }
2500
+ dateWithoutTime(date) {
2501
+ return new Date(date.getFullYear(), date.getMonth(), date.getDate());
2502
+ }
2503
+ hasBuiltInValidationError() {
2504
+ return this.showWrongFormatError || this.showDisabledDateError;
2505
+ }
2506
+ hasCustomValidationError() {
2507
+ return (this.afValidation &&
2508
+ this.afValidation !== typographyVariation_enum.CalendarDatepickerValidation.NEUTRAL);
2509
+ }
2510
+ getErrorText() {
2511
+ if (this.hasBuiltInValidationError()) {
2512
+ return this.showWrongFormatError
2513
+ ? this.afValidationWrongFormat
2514
+ : this.afValidationDisabledDate;
2515
+ }
2516
+ if (this.hasCustomValidationError()) {
2517
+ return this.afValidationText;
2518
+ }
2519
+ }
2520
+ get inputValue() {
2521
+ if (this.userInput !== '') {
2522
+ return this.userInput;
2523
+ }
2524
+ // otherwise format your real selected dates
2525
+ const sorted = this.afSelectedDates
2526
+ .slice()
2527
+ .sort((a, b) => (this.isBefore(a, b) ? -1 : 1));
2528
+ return this.datesToInputString(sorted);
2529
+ }
2530
+ datesToInputString(dates) {
2531
+ return dates.every((date) => date instanceof Date && !isNaN(date.getTime()))
2532
+ ? dates
2533
+ .map((date) => date.toLocaleDateString(text._t.locale))
2534
+ .flatMap((date, index, all) => {
2535
+ const isLast = index == all.length - 1;
2536
+ const isFirst = index === 0;
2537
+ if (isFirst) {
2538
+ return date;
2539
+ }
2540
+ else if (isLast) {
2541
+ return [` ${text._t.and} `, date];
2542
+ }
2543
+ else {
2544
+ return [', ', date];
2545
+ }
2546
+ })
2547
+ .join('')
2548
+ : '';
2549
+ }
2550
+ get getSelectedDates() {
2551
+ if (!this.afDisableValidation && this.hasBuiltInValidationError()) {
2552
+ return [];
2553
+ }
2554
+ return this.afSelectedDates;
2555
+ }
2556
+ render() {
2557
+ return (index$2.h(index$2.Host, { key: 'a22b366eece8bdf2a6d66ba7b4561093391ad16d', tabindex: -1 }, index$2.h("div", { key: '5ec3557df78bb012f2e10f1852252e78e2470ee3', class: Object.assign({ 'digi-calendar-datepicker': true }, this.cssModifiers), id: `${this.afId}-datepicker` }, index$2.h("div", { key: '1215a13021718ac98ad2a4a7a5bae3c456385124', class: "digi-calendar-datepicker__input-field" }, index$2.h("digi-form-input", { key: '8794d312452fe11f0f9052bbdd238e5570ec55f0', ref: (el) => (this._input = el), class: 'digi-calendar-datepicker__input-component', afLabel: this.afLabel, afLabelDescription: this.afLabelDescription, afName: this.afName, afValue: this.inputValue, afValidation: this.hasBuiltInValidationError()
2558
+ ? formInputVariation_enum.FormInputValidation.ERROR
2559
+ : this.afValidation, afValidationText: this.getErrorText(), afId: this.afId, afAriaDescribedby: `${this.afId}--validation-message`, afRequired: this.afRequired, afRequiredText: this.afRequiredText, afAnnounceIfOptional: this.afAnnounceIfOptional, afAnnounceIfOptionalText: this.afAnnounceIfOptionalText, onAfOnChange: (evt) => {
2560
+ evt.stopImmediatePropagation();
2561
+ this.parseInput(evt);
2562
+ }, onAfOnBlur: (evt) => {
2563
+ evt.stopImmediatePropagation();
2564
+ this.afOnDateChangeRawText.emit(this.inputValue);
2565
+ }, onKeyDown: (e) => {
2566
+ // Focus trap: Catch backwards tab from input field and direct it to date button.
2567
+ if (!this.showCalendar || e.key !== 'Tab' || !e.shiftKey)
2568
+ return;
2569
+ if (e.target.tagName !== 'INPUT')
2570
+ return;
2571
+ e.preventDefault();
2572
+ const focusableDateButton = this.hostElement.querySelector('.digi-calendar__date[tabindex="0"]');
2573
+ focusableDateButton === null || focusableDateButton === void 0 ? void 0 : focusableDateButton.focus();
2574
+ } }, index$2.h("button", { key: 'c953ddf0c99cfd3b892941da7da4a887b342fd78', id: this.afId + '-button', class: "digi-calendar-datepicker__input-button", slot: "button", "aria-label": this.showCalendar
2575
+ ? this.afCloseCalendarAriaLabel
2576
+ : this.afOpenCalendarAriaLabel, "aria-controls": "calendar-popup", "aria-expanded": this.showCalendar ? 'true' : 'false', onClick: () => this.toggleCalendar(), type: "button" }, index$2.h("digi-icon-calendar-alt", { key: '46c7387d404b77911b97f31c10e7147bd436c7e3', class: "digi-calendar-datepicker__button-icon", slot: "icon" })))), index$2.h("div", { key: '91894a4219afa79d913f558f5d1cc6b410b535ce', class: "digi-calendar-datepicker__calendar", id: "calendar-popup" }, index$2.h("p", { key: '989fc17ea7a95aa014a26e09f7db7f59fe53a36b', role: "alert", class: "digi-calendar-datepicker__sr-instructions" }, this.showCalendar
2577
+ ? `${text._t.calendar.screenReaderInstructions}${this.screenReaderUpdateTrigger ? '\u200B' : ''}`
2578
+ : ''), index$2.h("digi-calendar", { key: '6e62fb845769eca0a9b8cb21e4a09a5620804d42', afActive: this.showCalendar, afShowWeekNumber: this.afShowWeekNumber, afMultipleDates: this.afMultipleDates, afYearSelect: this.afYearSelect, afSelectedDates: this.getSelectedDates, afMinDate: this.afMinDate, afMaxDate: this.afMaxDate, "aria-hidden": !this.showCalendar, afOpenCalendarTo: this.afOpenCalendarTo, onAfOnDateSelectedChange: (evt) => {
2579
+ evt.stopImmediatePropagation();
2580
+ this.parseCalendar(evt);
2581
+ }, onKeyDown: (e) => {
2582
+ // Focus trap: Catch forward tab from last focusable element in calendar and direct it to the input.
2583
+ if (!this.showCalendar || e.key !== 'Tab' || e.shiftKey)
2584
+ return;
2585
+ if (!e.target.classList.contains('digi-calendar__date'))
2586
+ return;
2587
+ e.preventDefault();
2588
+ this.focusOnCalendarInput();
2589
+ } })), this.afCloseOnSelect && !this.afMultipleDates && (index$2.h("div", { key: 'd9f3eb470b29a0ab96134f1e4666743efacd7448', class: "digi-calendar-datepicker__selected-date-alert", role: this.errorMessageIsAlert ? 'alert' : null }, this.afSelectedDates.length > 0
2590
+ ? `${text._t.calendar.datepicker.selectedDate}: ${this.datesToInputString(this.afSelectedDates)}`
2591
+ : '')))));
2592
+ }
2593
+ get hostElement() { return index$2.getElement(this); }
2594
+ static get watchers() { return {
2595
+ "afDisableValidation": ["afDisableValidationChangeHandler"],
2596
+ "afSelectedDates": ["afSelectedDatesChangeHandler"],
2597
+ "value": ["valueChangeHandler"],
2598
+ "afMinDate": ["afMinDateChangeHandler"],
2599
+ "afMaxDate": ["afMaxDateChangeHandler"],
2600
+ "afMultipleDates": ["afMultipleDatesChangeHandler"]
2601
+ }; }
2602
+ };
2603
+ CalendarDatepicker.style = DigiCalendarDatepickerStyle0;
2604
+
2605
+ exports.digi_calendar_datepicker = CalendarDatepicker;