@blateral/b.kit 2.3.0 → 2.3.2-beta.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 (831) hide show
  1. package/base/package.json +7 -0
  2. package/blocks/package.json +7 -0
  3. package/buttons/package.json +7 -0
  4. package/cjs/Actions-c7b16449.js +2 -0
  5. package/cjs/Actions-c7b16449.js.map +1 -0
  6. package/cjs/Bdot-5f8e0450.js +2 -0
  7. package/cjs/Bdot-5f8e0450.js.map +1 -0
  8. package/cjs/Button-51ea72b7.js +2 -0
  9. package/cjs/Button-51ea72b7.js.map +1 -0
  10. package/cjs/ButtonGhost-628bbd60.js +2 -0
  11. package/cjs/ButtonGhost-628bbd60.js.map +1 -0
  12. package/cjs/Callout-e506ab21.js +2 -0
  13. package/cjs/Callout-e506ab21.js.map +1 -0
  14. package/cjs/Checkbox-1c34c7e6.js +2 -0
  15. package/cjs/Checkbox-1c34c7e6.js.map +1 -0
  16. package/cjs/ClockFilled-2483aa4a.js +2 -0
  17. package/cjs/ClockFilled-2483aa4a.js.map +1 -0
  18. package/cjs/Control-08d09950.js +2 -0
  19. package/cjs/Control-08d09950.js.map +1 -0
  20. package/cjs/Copy-ea6ab025.js +2 -0
  21. package/cjs/Copy-ea6ab025.js.map +1 -0
  22. package/cjs/EventBlock-7e2ba24d.js +2 -0
  23. package/cjs/EventBlock-7e2ba24d.js.map +1 -0
  24. package/cjs/FileUpload-0a861caf.js +2 -0
  25. package/cjs/FileUpload-0a861caf.js.map +1 -0
  26. package/cjs/Filter-d6d90b8b.js +2 -0
  27. package/cjs/Filter-d6d90b8b.js.map +1 -0
  28. package/cjs/FilterField-cce38ffb.js +2 -0
  29. package/cjs/FilterField-cce38ffb.js.map +1 -0
  30. package/cjs/Grid-6f4f99bc.js +2 -0
  31. package/cjs/Grid-6f4f99bc.js.map +1 -0
  32. package/cjs/Image-c72f7a80.js +2 -0
  33. package/cjs/Image-c72f7a80.js.map +1 -0
  34. package/cjs/InfoList-71d3388a.js +2 -0
  35. package/cjs/InfoList-71d3388a.js.map +1 -0
  36. package/cjs/LanguageSwitcher-8fdd22ba.js +2 -0
  37. package/cjs/LanguageSwitcher-8fdd22ba.js.map +1 -0
  38. package/cjs/LibThemeProvider-4823de57.js +2 -0
  39. package/cjs/LibThemeProvider-4823de57.js.map +1 -0
  40. package/cjs/Link-5a6f1633.js +2 -0
  41. package/cjs/Link-5a6f1633.js.map +1 -0
  42. package/cjs/Navigation-d205ed34.js +2 -0
  43. package/cjs/Navigation-d205ed34.js.map +1 -0
  44. package/cjs/POICard-e46f9041.js +2 -0
  45. package/cjs/POICard-e46f9041.js.map +1 -0
  46. package/cjs/Pointer-fde7b548.js +2 -0
  47. package/cjs/Pointer-fde7b548.js.map +1 -0
  48. package/cjs/SocialList-1d5f75a8.js +2 -0
  49. package/cjs/SocialList-1d5f75a8.js.map +1 -0
  50. package/cjs/TableBlock-007f8e34.js +2 -0
  51. package/cjs/TableBlock-007f8e34.js.map +1 -0
  52. package/cjs/Tag-9238cf0c.js +2 -0
  53. package/cjs/Tag-9238cf0c.js.map +1 -0
  54. package/cjs/VideoBlock-cf9d7464.js +2 -0
  55. package/cjs/VideoBlock-cf9d7464.js.map +1 -0
  56. package/cjs/VideoCard-fed8d37c.js +2 -0
  57. package/cjs/VideoCard-fed8d37c.js.map +1 -0
  58. package/cjs/Wrapper-accf2622.js +2 -0
  59. package/cjs/Wrapper-accf2622.js.map +1 -0
  60. package/cjs/arrays-c272ed59.js +2 -0
  61. package/cjs/arrays-c272ed59.js.map +1 -0
  62. package/cjs/base.js +2 -0
  63. package/cjs/base.js.map +1 -0
  64. package/cjs/blocks.js +2 -0
  65. package/cjs/blocks.js.map +1 -0
  66. package/cjs/buttons.js +2 -0
  67. package/cjs/buttons.js.map +1 -0
  68. package/cjs/clamp-bd21d587.js +2 -0
  69. package/cjs/clamp-bd21d587.js.map +1 -0
  70. package/cjs/concat-f387d848.js +2 -0
  71. package/cjs/concat-f387d848.js.map +1 -0
  72. package/cjs/cookies.js +2 -0
  73. package/cjs/cookies.js.map +1 -0
  74. package/cjs/escape-1ef8dd83.js +2 -0
  75. package/cjs/escape-1ef8dd83.js.map +1 -0
  76. package/cjs/fields.js +2 -0
  77. package/cjs/fields.js.map +1 -0
  78. package/cjs/footer.js +2 -0
  79. package/cjs/footer.js.map +1 -0
  80. package/cjs/hexRgbConverter-91b28aea.js +2 -0
  81. package/cjs/hexRgbConverter-91b28aea.js.map +1 -0
  82. package/cjs/hooks.js +2 -0
  83. package/cjs/hooks.js.map +1 -0
  84. package/cjs/icons.js +2 -0
  85. package/cjs/icons.js.map +1 -0
  86. package/cjs/index.js +2 -0
  87. package/cjs/index.js.map +1 -0
  88. package/cjs/navigation-bf154e6e.js +2 -0
  89. package/cjs/navigation-bf154e6e.js.map +1 -0
  90. package/cjs/navigation.js +2 -0
  91. package/cjs/navigation.js.map +1 -0
  92. package/cjs/sections.js +2 -0
  93. package/cjs/sections.js.map +1 -0
  94. package/cjs/sections_events.js +2 -0
  95. package/cjs/sections_events.js.map +1 -0
  96. package/cjs/sections_forms.js +2 -0
  97. package/cjs/sections_forms.js.map +1 -0
  98. package/cjs/sections_jobs.js +2 -0
  99. package/cjs/sections_jobs.js.map +1 -0
  100. package/cjs/sections_news.js +2 -0
  101. package/cjs/sections_news.js.map +1 -0
  102. package/cjs/sections_pois.js +2 -0
  103. package/cjs/sections_pois.js.map +1 -0
  104. package/cjs/statusFormatter-0393122b.js +2 -0
  105. package/cjs/statusFormatter-0393122b.js.map +1 -0
  106. package/cjs/structuredData-0b1278a9.js +2 -0
  107. package/cjs/structuredData-0b1278a9.js.map +1 -0
  108. package/cjs/styles-3a495a2d.js +2 -0
  109. package/cjs/styles-3a495a2d.js.map +1 -0
  110. package/cjs/typography.js +2 -0
  111. package/cjs/typography.js.map +1 -0
  112. package/cjs/urlParams-7525f638.js +2 -0
  113. package/cjs/urlParams-7525f638.js.map +1 -0
  114. package/cjs/useCookieConsent-0bf94751.js +2 -0
  115. package/cjs/useCookieConsent-0bf94751.js.map +1 -0
  116. package/cjs/useEqualSheetHeight-501f4c5f.js +2 -0
  117. package/cjs/useEqualSheetHeight-501f4c5f.js.map +1 -0
  118. package/cjs/useGeolocation-d8946470.js +2 -0
  119. package/cjs/useGeolocation-d8946470.js.map +1 -0
  120. package/cjs/useIE-aef9decc.js +2 -0
  121. package/cjs/useIE-aef9decc.js.map +1 -0
  122. package/cjs/useLazyInput-f71c221b.js +2 -0
  123. package/cjs/useLazyInput-f71c221b.js.map +1 -0
  124. package/cjs/useLeafletMap-2e608b01.js +2 -0
  125. package/cjs/useLeafletMap-2e608b01.js.map +1 -0
  126. package/cjs/useMediaQuery-3d1054e5.js +2 -0
  127. package/cjs/useMediaQuery-3d1054e5.js.map +1 -0
  128. package/cjs/useMounted-0bba9869.js +2 -0
  129. package/cjs/useMounted-0bba9869.js.map +1 -0
  130. package/cjs/useObserverSupport-5ab320dd.js +2 -0
  131. package/cjs/useObserverSupport-5ab320dd.js.map +1 -0
  132. package/cjs/useScrollTo-fdd665da.js +2 -0
  133. package/cjs/useScrollTo-fdd665da.js.map +1 -0
  134. package/cjs/useUpdateEffect-4d233e2c.js +2 -0
  135. package/cjs/useUpdateEffect-4d233e2c.js.map +1 -0
  136. package/cookies/package.json +7 -0
  137. package/esm/Actions-8b4a4d2f.js +57 -0
  138. package/esm/Actions-8b4a4d2f.js.map +1 -0
  139. package/esm/Bdot-434dd994.js +24 -0
  140. package/esm/Bdot-434dd994.js.map +1 -0
  141. package/esm/Button-71376927.js +115 -0
  142. package/esm/Button-71376927.js.map +1 -0
  143. package/esm/ButtonGhost-6876b67f.js +112 -0
  144. package/esm/ButtonGhost-6876b67f.js.map +1 -0
  145. package/esm/Callout-08fb36a2.js +99 -0
  146. package/esm/Callout-08fb36a2.js.map +1 -0
  147. package/esm/Checkbox-4daef7a4.js +135 -0
  148. package/esm/Checkbox-4daef7a4.js.map +1 -0
  149. package/esm/ClockFilled-6bae80dc.js +1793 -0
  150. package/esm/ClockFilled-6bae80dc.js.map +1 -0
  151. package/esm/Control-dd0f76f1.js +52 -0
  152. package/esm/Control-dd0f76f1.js.map +1 -0
  153. package/esm/Copy-bca0854c.js +270 -0
  154. package/esm/Copy-bca0854c.js.map +1 -0
  155. package/esm/EventBlock-e07e7b51.js +132 -0
  156. package/esm/EventBlock-e07e7b51.js.map +1 -0
  157. package/esm/FileUpload-851d473a.js +4790 -0
  158. package/esm/FileUpload-851d473a.js.map +1 -0
  159. package/esm/Filter-fec6dc5c.js +32 -0
  160. package/esm/Filter-fec6dc5c.js.map +1 -0
  161. package/esm/FilterField-5f76c113.js +129 -0
  162. package/esm/FilterField-5f76c113.js.map +1 -0
  163. package/esm/Grid-172051a9.js +203 -0
  164. package/esm/Grid-172051a9.js.map +1 -0
  165. package/esm/Image-301c4433.js +193 -0
  166. package/esm/Image-301c4433.js.map +1 -0
  167. package/esm/InfoList-762f2b14.js +74 -0
  168. package/esm/InfoList-762f2b14.js.map +1 -0
  169. package/esm/LanguageSwitcher-57c4a924.js +70 -0
  170. package/esm/LanguageSwitcher-57c4a924.js.map +1 -0
  171. package/esm/LibThemeProvider-acf2e2bb.js +115 -0
  172. package/esm/LibThemeProvider-acf2e2bb.js.map +1 -0
  173. package/esm/Link-bccdb082.js +60 -0
  174. package/esm/Link-bccdb082.js.map +1 -0
  175. package/esm/Navigation-03339030.js +1664 -0
  176. package/esm/Navigation-03339030.js.map +1 -0
  177. package/esm/POICard-584a229c.js +116 -0
  178. package/esm/POICard-584a229c.js.map +1 -0
  179. package/esm/Pointer-2276308c.js +111 -0
  180. package/esm/Pointer-2276308c.js.map +1 -0
  181. package/esm/SocialList-f7864b30.js +61 -0
  182. package/esm/SocialList-f7864b30.js.map +1 -0
  183. package/esm/TableBlock-014f9821.js +159 -0
  184. package/esm/TableBlock-014f9821.js.map +1 -0
  185. package/esm/Tag-cb972e1b.js +67 -0
  186. package/esm/Tag-cb972e1b.js.map +1 -0
  187. package/esm/VideoBlock-ede11866.js +624 -0
  188. package/esm/VideoBlock-ede11866.js.map +1 -0
  189. package/esm/VideoCard-aced65ef.js +160 -0
  190. package/esm/VideoCard-aced65ef.js.map +1 -0
  191. package/esm/Wrapper-1cac758b.js +224 -0
  192. package/esm/Wrapper-1cac758b.js.map +1 -0
  193. package/esm/arrays-65b644ef.js +17 -0
  194. package/esm/arrays-65b644ef.js.map +1 -0
  195. package/esm/base.js +11 -0
  196. package/esm/base.js.map +1 -0
  197. package/esm/blocks.js +26 -0
  198. package/esm/blocks.js.map +1 -0
  199. package/esm/buttons.js +12 -0
  200. package/esm/buttons.js.map +1 -0
  201. package/esm/clamp-12d37b65.js +10 -0
  202. package/esm/clamp-12d37b65.js.map +1 -0
  203. package/esm/concat-ab3c66f2.js +40 -0
  204. package/esm/concat-ab3c66f2.js.map +1 -0
  205. package/esm/cookies.js +270 -0
  206. package/esm/cookies.js.map +1 -0
  207. package/esm/escape-cbff9c25.js +6 -0
  208. package/esm/escape-cbff9c25.js.map +1 -0
  209. package/esm/fields.js +190 -0
  210. package/esm/fields.js.map +1 -0
  211. package/esm/footer.js +301 -0
  212. package/esm/footer.js.map +1 -0
  213. package/esm/hexRgbConverter-edb91624.js +36 -0
  214. package/esm/hexRgbConverter-edb91624.js.map +1 -0
  215. package/esm/hooks.js +531 -0
  216. package/esm/hooks.js.map +1 -0
  217. package/esm/icons.js +4 -0
  218. package/esm/icons.js.map +1 -0
  219. package/esm/index.js +7 -0
  220. package/esm/index.js.map +1 -0
  221. package/esm/navigation-a2998143.js +132 -0
  222. package/esm/navigation-a2998143.js.map +1 -0
  223. package/esm/navigation.js +159 -0
  224. package/esm/navigation.js.map +1 -0
  225. package/esm/sections.js +3966 -0
  226. package/esm/sections.js.map +1 -0
  227. package/esm/sections_events.js +573 -0
  228. package/esm/sections_events.js.map +1 -0
  229. package/esm/sections_forms.js +1405 -0
  230. package/esm/sections_forms.js.map +1 -0
  231. package/esm/sections_jobs.js +508 -0
  232. package/esm/sections_jobs.js.map +1 -0
  233. package/esm/sections_news.js +1023 -0
  234. package/esm/sections_news.js.map +1 -0
  235. package/esm/sections_pois.js +719 -0
  236. package/esm/sections_pois.js.map +1 -0
  237. package/esm/statusFormatter-9be0fbff.js +255 -0
  238. package/esm/statusFormatter-9be0fbff.js.map +1 -0
  239. package/esm/structuredData-87423414.js +117 -0
  240. package/esm/structuredData-87423414.js.map +1 -0
  241. package/esm/styles-c387bdc6.js +467 -0
  242. package/esm/styles-c387bdc6.js.map +1 -0
  243. package/esm/typography.js +11 -0
  244. package/esm/typography.js.map +1 -0
  245. package/esm/urlParams-9cfdaf71.js +51 -0
  246. package/esm/urlParams-9cfdaf71.js.map +1 -0
  247. package/esm/useCookieConsent-8caef116.js +339 -0
  248. package/esm/useCookieConsent-8caef116.js.map +1 -0
  249. package/esm/useEqualSheetHeight-e68e1638.js +199 -0
  250. package/esm/useEqualSheetHeight-e68e1638.js.map +1 -0
  251. package/esm/useGeolocation-f9f073cc.js +95 -0
  252. package/esm/useGeolocation-f9f073cc.js.map +1 -0
  253. package/esm/useIE-a9c56989.js +15 -0
  254. package/esm/useIE-a9c56989.js.map +1 -0
  255. package/esm/useLazyInput-e66fc5be.js +85 -0
  256. package/esm/useLazyInput-e66fc5be.js.map +1 -0
  257. package/esm/useLeafletMap-6dea7a8e.js +300 -0
  258. package/esm/useLeafletMap-6dea7a8e.js.map +1 -0
  259. package/esm/useMediaQuery-388bd65e.js +159 -0
  260. package/esm/useMediaQuery-388bd65e.js.map +1 -0
  261. package/esm/useMounted-1e4cc87b.js +12 -0
  262. package/esm/useMounted-1e4cc87b.js.map +1 -0
  263. package/esm/useObserverSupport-02bce7f5.js +19 -0
  264. package/esm/useObserverSupport-02bce7f5.js.map +1 -0
  265. package/esm/useScrollTo-70af34bf.js +57 -0
  266. package/esm/useScrollTo-70af34bf.js.map +1 -0
  267. package/esm/useUpdateEffect-824c0c84.js +18 -0
  268. package/esm/useUpdateEffect-824c0c84.js.map +1 -0
  269. package/fields/package.json +7 -0
  270. package/footer/package.json +7 -0
  271. package/hooks/package.json +7 -0
  272. package/icons/package.json +7 -0
  273. package/navigation/package.json +7 -0
  274. package/package.json +19 -5
  275. package/sections/events/package.json +7 -0
  276. package/sections/forms/package.json +7 -0
  277. package/sections/jobs/package.json +7 -0
  278. package/sections/news/package.json +7 -0
  279. package/sections/package.json +7 -0
  280. package/sections/pois/package.json +7 -0
  281. package/types/base.d.ts +5 -0
  282. package/types/base.d.ts.map +1 -0
  283. package/types/blocks.d.ts +18 -0
  284. package/types/blocks.d.ts.map +1 -0
  285. package/types/buttons.d.ts +6 -0
  286. package/types/buttons.d.ts.map +1 -0
  287. package/types/components/sections/NumberList.d.ts.map +1 -0
  288. package/types/components/sections/header/Header.d.ts +92 -0
  289. package/types/components/sections/header/Header.d.ts.map +1 -0
  290. package/types/components/sections/navigation/menu/variations/MenuFlyout.d.ts.map +1 -0
  291. package/types/components/sections/navigation/menu/variations/MenuLarge.d.ts.map +1 -0
  292. package/types/components/typography/Callout.d.ts.map +1 -0
  293. package/types/cookies.d.ts +3 -0
  294. package/types/cookies.d.ts.map +1 -0
  295. package/types/fields.d.ts +14 -0
  296. package/types/fields.d.ts.map +1 -0
  297. package/types/footer.d.ts +4 -0
  298. package/types/footer.d.ts.map +1 -0
  299. package/types/hooks.d.ts +35 -0
  300. package/types/hooks.d.ts.map +1 -0
  301. package/types/icons.d.ts +66 -0
  302. package/types/icons.d.ts.map +1 -0
  303. package/types/index.d.ts +18 -0
  304. package/types/index.d.ts.map +1 -0
  305. package/types/navigation.d.ts +10 -0
  306. package/types/navigation.d.ts.map +1 -0
  307. package/types/sections.d.ts +32 -0
  308. package/types/sections.d.ts.map +1 -0
  309. package/types/sections_events.d.ts +4 -0
  310. package/types/sections_events.d.ts.map +1 -0
  311. package/types/sections_forms.d.ts +3 -0
  312. package/types/sections_forms.d.ts.map +1 -0
  313. package/types/sections_jobs.d.ts +3 -0
  314. package/types/sections_jobs.d.ts.map +1 -0
  315. package/types/sections_news.d.ts +10 -0
  316. package/types/sections_news.d.ts.map +1 -0
  317. package/types/sections_pois.d.ts +4 -0
  318. package/types/sections_pois.d.ts.map +1 -0
  319. package/types/typography.d.ts +6 -0
  320. package/types/typography.d.ts.map +1 -0
  321. package/typography/package.json +7 -0
  322. package/lib/components/base/icons/Icons.d.ts +0 -66
  323. package/lib/components/base/icons/Icons.d.ts.map +0 -1
  324. package/lib/components/sections/NumberList.d.ts.map +0 -1
  325. package/lib/components/sections/header/Header.d.ts +0 -92
  326. package/lib/components/sections/header/Header.d.ts.map +0 -1
  327. package/lib/components/sections/navigation/menu/variations/MenuFlyout.d.ts.map +0 -1
  328. package/lib/components/sections/navigation/menu/variations/MenuLarge.d.ts.map +0 -1
  329. package/lib/components/typography/Callout.d.ts.map +0 -1
  330. package/lib/index.d.ts +0 -158
  331. package/lib/index.d.ts.map +0 -1
  332. package/lib/index.es.js +0 -2
  333. package/lib/index.es.js.map +0 -1
  334. package/lib/index.js +0 -2
  335. package/lib/index.js.map +0 -1
  336. /package/{lib → types}/components/base/Grid.d.ts +0 -0
  337. /package/{lib → types}/components/base/Grid.d.ts.map +0 -0
  338. /package/{lib → types}/components/base/Section.d.ts +0 -0
  339. /package/{lib → types}/components/base/Section.d.ts.map +0 -0
  340. /package/{lib → types}/components/base/Wrapper.d.ts +0 -0
  341. /package/{lib → types}/components/base/Wrapper.d.ts.map +0 -0
  342. /package/{lib → types}/components/base/icons/AngleDown.d.ts +0 -0
  343. /package/{lib → types}/components/base/icons/AngleDown.d.ts.map +0 -0
  344. /package/{lib → types}/components/base/icons/AngleLeft.d.ts +0 -0
  345. /package/{lib → types}/components/base/icons/AngleLeft.d.ts.map +0 -0
  346. /package/{lib → types}/components/base/icons/AngleRight.d.ts +0 -0
  347. /package/{lib → types}/components/base/icons/AngleRight.d.ts.map +0 -0
  348. /package/{lib → types}/components/base/icons/AngleUp.d.ts +0 -0
  349. /package/{lib → types}/components/base/icons/AngleUp.d.ts.map +0 -0
  350. /package/{lib → types}/components/base/icons/ArrowDown.d.ts +0 -0
  351. /package/{lib → types}/components/base/icons/ArrowDown.d.ts.map +0 -0
  352. /package/{lib → types}/components/base/icons/ArrowLeft.d.ts +0 -0
  353. /package/{lib → types}/components/base/icons/ArrowLeft.d.ts.map +0 -0
  354. /package/{lib → types}/components/base/icons/ArrowLeftGhost.d.ts +0 -0
  355. /package/{lib → types}/components/base/icons/ArrowLeftGhost.d.ts.map +0 -0
  356. /package/{lib → types}/components/base/icons/ArrowLeftRight.d.ts +0 -0
  357. /package/{lib → types}/components/base/icons/ArrowLeftRight.d.ts.map +0 -0
  358. /package/{lib → types}/components/base/icons/ArrowRight.d.ts +0 -0
  359. /package/{lib → types}/components/base/icons/ArrowRight.d.ts.map +0 -0
  360. /package/{lib → types}/components/base/icons/ArrowRightGhost.d.ts +0 -0
  361. /package/{lib → types}/components/base/icons/ArrowRightGhost.d.ts.map +0 -0
  362. /package/{lib → types}/components/base/icons/ArrowUp.d.ts +0 -0
  363. /package/{lib → types}/components/base/icons/ArrowUp.d.ts.map +0 -0
  364. /package/{lib → types}/components/base/icons/BoxArrowUpRight.d.ts +0 -0
  365. /package/{lib → types}/components/base/icons/BoxArrowUpRight.d.ts.map +0 -0
  366. /package/{lib → types}/components/base/icons/CalendarToday.d.ts +0 -0
  367. /package/{lib → types}/components/base/icons/CalendarToday.d.ts.map +0 -0
  368. /package/{lib → types}/components/base/icons/Category.d.ts +0 -0
  369. /package/{lib → types}/components/base/icons/Category.d.ts.map +0 -0
  370. /package/{lib → types}/components/base/icons/Check.d.ts +0 -0
  371. /package/{lib → types}/components/base/icons/Check.d.ts.map +0 -0
  372. /package/{lib → types}/components/base/icons/Clock.d.ts +0 -0
  373. /package/{lib → types}/components/base/icons/Clock.d.ts.map +0 -0
  374. /package/{lib → types}/components/base/icons/ClockFilled.d.ts +0 -0
  375. /package/{lib → types}/components/base/icons/ClockFilled.d.ts.map +0 -0
  376. /package/{lib → types}/components/base/icons/Computer.d.ts +0 -0
  377. /package/{lib → types}/components/base/icons/Computer.d.ts.map +0 -0
  378. /package/{lib → types}/components/base/icons/Cross.d.ts +0 -0
  379. /package/{lib → types}/components/base/icons/Cross.d.ts.map +0 -0
  380. /package/{lib → types}/components/base/icons/CrossSmall.d.ts +0 -0
  381. /package/{lib → types}/components/base/icons/CrossSmall.d.ts.map +0 -0
  382. /package/{lib → types}/components/base/icons/CurrentLocation.d.ts +0 -0
  383. /package/{lib → types}/components/base/icons/CurrentLocation.d.ts.map +0 -0
  384. /package/{lib → types}/components/base/icons/DateRange.d.ts +0 -0
  385. /package/{lib → types}/components/base/icons/DateRange.d.ts.map +0 -0
  386. /package/{lib → types}/components/base/icons/DeleteForever.d.ts +0 -0
  387. /package/{lib → types}/components/base/icons/DeleteForever.d.ts.map +0 -0
  388. /package/{lib → types}/components/base/icons/External.d.ts +0 -0
  389. /package/{lib → types}/components/base/icons/External.d.ts.map +0 -0
  390. /package/{lib → types}/components/base/icons/Filter.d.ts +0 -0
  391. /package/{lib → types}/components/base/icons/Filter.d.ts.map +0 -0
  392. /package/{lib → types}/components/base/icons/FlyTo.d.ts +0 -0
  393. /package/{lib → types}/components/base/icons/FlyTo.d.ts.map +0 -0
  394. /package/{lib → types}/components/base/icons/Info.d.ts +0 -0
  395. /package/{lib → types}/components/base/icons/Info.d.ts.map +0 -0
  396. /package/{lib → types}/components/base/icons/Language.d.ts +0 -0
  397. /package/{lib → types}/components/base/icons/Language.d.ts.map +0 -0
  398. /package/{lib → types}/components/base/icons/LocationPin.d.ts +0 -0
  399. /package/{lib → types}/components/base/icons/LocationPin.d.ts.map +0 -0
  400. /package/{lib → types}/components/base/icons/LocationSearch.d.ts +0 -0
  401. /package/{lib → types}/components/base/icons/LocationSearch.d.ts.map +0 -0
  402. /package/{lib → types}/components/base/icons/Magnifier.d.ts +0 -0
  403. /package/{lib → types}/components/base/icons/Magnifier.d.ts.map +0 -0
  404. /package/{lib → types}/components/base/icons/Mail.d.ts +0 -0
  405. /package/{lib → types}/components/base/icons/Mail.d.ts.map +0 -0
  406. /package/{lib → types}/components/base/icons/Map.d.ts +0 -0
  407. /package/{lib → types}/components/base/icons/Map.d.ts.map +0 -0
  408. /package/{lib → types}/components/base/icons/MenuBurger.d.ts +0 -0
  409. /package/{lib → types}/components/base/icons/MenuBurger.d.ts.map +0 -0
  410. /package/{lib → types}/components/base/icons/Minus.d.ts +0 -0
  411. /package/{lib → types}/components/base/icons/Minus.d.ts.map +0 -0
  412. /package/{lib → types}/components/base/icons/Money.d.ts +0 -0
  413. /package/{lib → types}/components/base/icons/Money.d.ts.map +0 -0
  414. /package/{lib → types}/components/base/icons/MyLocation.d.ts +0 -0
  415. /package/{lib → types}/components/base/icons/MyLocation.d.ts.map +0 -0
  416. /package/{lib → types}/components/base/icons/Person.d.ts +0 -0
  417. /package/{lib → types}/components/base/icons/Person.d.ts.map +0 -0
  418. /package/{lib → types}/components/base/icons/Phone.d.ts +0 -0
  419. /package/{lib → types}/components/base/icons/Phone.d.ts.map +0 -0
  420. /package/{lib → types}/components/base/icons/Place.d.ts +0 -0
  421. /package/{lib → types}/components/base/icons/Place.d.ts.map +0 -0
  422. /package/{lib → types}/components/base/icons/Play.d.ts +0 -0
  423. /package/{lib → types}/components/base/icons/Play.d.ts.map +0 -0
  424. /package/{lib → types}/components/base/icons/Plus.d.ts +0 -0
  425. /package/{lib → types}/components/base/icons/Plus.d.ts.map +0 -0
  426. /package/{lib → types}/components/base/icons/Route.d.ts +0 -0
  427. /package/{lib → types}/components/base/icons/Route.d.ts.map +0 -0
  428. /package/{lib → types}/components/base/icons/Star.d.ts +0 -0
  429. /package/{lib → types}/components/base/icons/Star.d.ts.map +0 -0
  430. /package/{lib → types}/components/base/icons/ToggleOff.d.ts +0 -0
  431. /package/{lib → types}/components/base/icons/ToggleOff.d.ts.map +0 -0
  432. /package/{lib → types}/components/base/icons/ToggleOn.d.ts +0 -0
  433. /package/{lib → types}/components/base/icons/ToggleOn.d.ts.map +0 -0
  434. /package/{lib → types}/components/base/icons/UnfoldMore.d.ts +0 -0
  435. /package/{lib → types}/components/base/icons/UnfoldMore.d.ts.map +0 -0
  436. /package/{lib → types}/components/base/icons/files/Excel.d.ts +0 -0
  437. /package/{lib → types}/components/base/icons/files/Excel.d.ts.map +0 -0
  438. /package/{lib → types}/components/base/icons/files/Image.d.ts +0 -0
  439. /package/{lib → types}/components/base/icons/files/Image.d.ts.map +0 -0
  440. /package/{lib → types}/components/base/icons/files/Pdf.d.ts +0 -0
  441. /package/{lib → types}/components/base/icons/files/Pdf.d.ts.map +0 -0
  442. /package/{lib → types}/components/base/icons/files/PowerPoint.d.ts +0 -0
  443. /package/{lib → types}/components/base/icons/files/PowerPoint.d.ts.map +0 -0
  444. /package/{lib → types}/components/base/icons/files/UploadFile.d.ts +0 -0
  445. /package/{lib → types}/components/base/icons/files/UploadFile.d.ts.map +0 -0
  446. /package/{lib → types}/components/base/icons/files/Word.d.ts +0 -0
  447. /package/{lib → types}/components/base/icons/files/Word.d.ts.map +0 -0
  448. /package/{lib → types}/components/base/icons/files/Zip.d.ts +0 -0
  449. /package/{lib → types}/components/base/icons/files/Zip.d.ts.map +0 -0
  450. /package/{lib → types}/components/base/icons/socials/Facebook.d.ts +0 -0
  451. /package/{lib → types}/components/base/icons/socials/Facebook.d.ts.map +0 -0
  452. /package/{lib → types}/components/base/icons/socials/Instagram.d.ts +0 -0
  453. /package/{lib → types}/components/base/icons/socials/Instagram.d.ts.map +0 -0
  454. /package/{lib → types}/components/base/icons/socials/LinkedIn.d.ts +0 -0
  455. /package/{lib → types}/components/base/icons/socials/LinkedIn.d.ts.map +0 -0
  456. /package/{lib → types}/components/base/icons/socials/Twitter.d.ts +0 -0
  457. /package/{lib → types}/components/base/icons/socials/Twitter.d.ts.map +0 -0
  458. /package/{lib → types}/components/base/icons/socials/Xing.d.ts +0 -0
  459. /package/{lib → types}/components/base/icons/socials/Xing.d.ts.map +0 -0
  460. /package/{lib → types}/components/base/icons/socials/Youtube.d.ts +0 -0
  461. /package/{lib → types}/components/base/icons/socials/Youtube.d.ts.map +0 -0
  462. /package/{lib → types}/components/base/nl2br.d.ts +0 -0
  463. /package/{lib → types}/components/base/nl2br.d.ts.map +0 -0
  464. /package/{lib → types}/components/blocks/Actions.d.ts +0 -0
  465. /package/{lib → types}/components/blocks/Actions.d.ts.map +0 -0
  466. /package/{lib → types}/components/blocks/Alert.d.ts +0 -0
  467. /package/{lib → types}/components/blocks/Alert.d.ts.map +0 -0
  468. /package/{lib → types}/components/blocks/Bdot.d.ts +0 -0
  469. /package/{lib → types}/components/blocks/Bdot.d.ts.map +0 -0
  470. /package/{lib → types}/components/blocks/CookieConsent.d.ts +0 -0
  471. /package/{lib → types}/components/blocks/CookieConsent.d.ts.map +0 -0
  472. /package/{lib → types}/components/blocks/EventBlock.d.ts +0 -0
  473. /package/{lib → types}/components/blocks/EventBlock.d.ts.map +0 -0
  474. /package/{lib → types}/components/blocks/Fact.d.ts +0 -0
  475. /package/{lib → types}/components/blocks/Fact.d.ts.map +0 -0
  476. /package/{lib → types}/components/blocks/Feature.d.ts +0 -0
  477. /package/{lib → types}/components/blocks/Feature.d.ts.map +0 -0
  478. /package/{lib → types}/components/blocks/Image.d.ts +0 -0
  479. /package/{lib → types}/components/blocks/Image.d.ts.map +0 -0
  480. /package/{lib → types}/components/blocks/InfoList.d.ts +0 -0
  481. /package/{lib → types}/components/blocks/InfoList.d.ts.map +0 -0
  482. /package/{lib → types}/components/blocks/IntroBlock.d.ts +0 -0
  483. /package/{lib → types}/components/blocks/IntroBlock.d.ts.map +0 -0
  484. /package/{lib → types}/components/blocks/JobCard.d.ts +0 -0
  485. /package/{lib → types}/components/blocks/JobCard.d.ts.map +0 -0
  486. /package/{lib → types}/components/blocks/LanguageSwitcher.d.ts +0 -0
  487. /package/{lib → types}/components/blocks/LanguageSwitcher.d.ts.map +0 -0
  488. /package/{lib → types}/components/blocks/NavBlock.d.ts +0 -0
  489. /package/{lib → types}/components/blocks/NavBlock.d.ts.map +0 -0
  490. /package/{lib → types}/components/blocks/NewsCard.d.ts +0 -0
  491. /package/{lib → types}/components/blocks/NewsCard.d.ts.map +0 -0
  492. /package/{lib → types}/components/blocks/POICard.d.ts +0 -0
  493. /package/{lib → types}/components/blocks/POICard.d.ts.map +0 -0
  494. /package/{lib → types}/components/blocks/POIFacts.d.ts +0 -0
  495. /package/{lib → types}/components/blocks/POIFacts.d.ts.map +0 -0
  496. /package/{lib → types}/components/blocks/PriceTag.d.ts +0 -0
  497. /package/{lib → types}/components/blocks/PriceTag.d.ts.map +0 -0
  498. /package/{lib → types}/components/blocks/PromotionCard.d.ts +0 -0
  499. /package/{lib → types}/components/blocks/PromotionCard.d.ts.map +0 -0
  500. /package/{lib → types}/components/blocks/SocialList.d.ts +0 -0
  501. /package/{lib → types}/components/blocks/SocialList.d.ts.map +0 -0
  502. /package/{lib → types}/components/blocks/TableBlock.d.ts +0 -0
  503. /package/{lib → types}/components/blocks/TableBlock.d.ts.map +0 -0
  504. /package/{lib → types}/components/blocks/Tag.d.ts +0 -0
  505. /package/{lib → types}/components/blocks/Tag.d.ts.map +0 -0
  506. /package/{lib → types}/components/blocks/Title.d.ts +0 -0
  507. /package/{lib → types}/components/blocks/Title.d.ts.map +0 -0
  508. /package/{lib → types}/components/blocks/VideoBlock.d.ts +0 -0
  509. /package/{lib → types}/components/blocks/VideoBlock.d.ts.map +0 -0
  510. /package/{lib → types}/components/blocks/VideoCard.d.ts +0 -0
  511. /package/{lib → types}/components/blocks/VideoCard.d.ts.map +0 -0
  512. /package/{lib → types}/components/buttons/Button.d.ts +0 -0
  513. /package/{lib → types}/components/buttons/Button.d.ts.map +0 -0
  514. /package/{lib → types}/components/buttons/ButtonGhost.d.ts +0 -0
  515. /package/{lib → types}/components/buttons/ButtonGhost.d.ts.map +0 -0
  516. /package/{lib → types}/components/buttons/Control.d.ts +0 -0
  517. /package/{lib → types}/components/buttons/Control.d.ts.map +0 -0
  518. /package/{lib → types}/components/buttons/Pointer.d.ts +0 -0
  519. /package/{lib → types}/components/buttons/Pointer.d.ts.map +0 -0
  520. /package/{lib → types}/components/debug/DebugLines.d.ts +0 -0
  521. /package/{lib → types}/components/debug/DebugLines.d.ts.map +0 -0
  522. /package/{lib → types}/components/examples/hooks/ArrayHookExample.d.ts +0 -0
  523. /package/{lib → types}/components/examples/hooks/ArrayHookExample.d.ts.map +0 -0
  524. /package/{lib → types}/components/examples/hooks/IntervalHookExample.d.ts +0 -0
  525. /package/{lib → types}/components/examples/hooks/IntervalHookExample.d.ts.map +0 -0
  526. /package/{lib → types}/components/fields/Checkbox.d.ts +0 -0
  527. /package/{lib → types}/components/fields/Checkbox.d.ts.map +0 -0
  528. /package/{lib → types}/components/fields/CompactForm.d.ts +0 -0
  529. /package/{lib → types}/components/fields/CompactForm.d.ts.map +0 -0
  530. /package/{lib → types}/components/fields/Datepicker.d.ts +0 -0
  531. /package/{lib → types}/components/fields/Datepicker.d.ts.map +0 -0
  532. /package/{lib → types}/components/fields/FileUpload.d.ts +0 -0
  533. /package/{lib → types}/components/fields/FileUpload.d.ts.map +0 -0
  534. /package/{lib → types}/components/fields/FilterField.d.ts +0 -0
  535. /package/{lib → types}/components/fields/FilterField.d.ts.map +0 -0
  536. /package/{lib → types}/components/fields/FormField.d.ts +0 -0
  537. /package/{lib → types}/components/fields/FormField.d.ts.map +0 -0
  538. /package/{lib → types}/components/fields/LocationField.d.ts +0 -0
  539. /package/{lib → types}/components/fields/LocationField.d.ts.map +0 -0
  540. /package/{lib → types}/components/fields/Radio.d.ts +0 -0
  541. /package/{lib → types}/components/fields/Radio.d.ts.map +0 -0
  542. /package/{lib → types}/components/fields/SearchInput.d.ts +0 -0
  543. /package/{lib → types}/components/fields/SearchInput.d.ts.map +0 -0
  544. /package/{lib → types}/components/fields/SelectDropdown.d.ts +0 -0
  545. /package/{lib → types}/components/fields/SelectDropdown.d.ts.map +0 -0
  546. /package/{lib → types}/components/fields/Textarea.d.ts +0 -0
  547. /package/{lib → types}/components/fields/Textarea.d.ts.map +0 -0
  548. /package/{lib → types}/components/fields/Textfield.d.ts +0 -0
  549. /package/{lib → types}/components/fields/Textfield.d.ts.map +0 -0
  550. /package/{lib → types}/components/sections/Accordion.d.ts +0 -0
  551. /package/{lib → types}/components/sections/Accordion.d.ts.map +0 -0
  552. /package/{lib → types}/components/sections/AlertList.d.ts +0 -0
  553. /package/{lib → types}/components/sections/AlertList.d.ts.map +0 -0
  554. /package/{lib → types}/components/sections/Article.d.ts +0 -0
  555. /package/{lib → types}/components/sections/Article.d.ts.map +0 -0
  556. /package/{lib → types}/components/sections/CallToAction.d.ts +0 -0
  557. /package/{lib → types}/components/sections/CallToAction.d.ts.map +0 -0
  558. /package/{lib → types}/components/sections/CardList.d.ts +0 -0
  559. /package/{lib → types}/components/sections/CardList.d.ts.map +0 -0
  560. /package/{lib → types}/components/sections/ComparisonSlider.d.ts +0 -0
  561. /package/{lib → types}/components/sections/ComparisonSlider.d.ts.map +0 -0
  562. /package/{lib → types}/components/sections/CrossPromotion.d.ts +0 -0
  563. /package/{lib → types}/components/sections/CrossPromotion.d.ts.map +0 -0
  564. /package/{lib → types}/components/sections/FactGrid.d.ts +0 -0
  565. /package/{lib → types}/components/sections/FactGrid.d.ts.map +0 -0
  566. /package/{lib → types}/components/sections/FactList.d.ts +0 -0
  567. /package/{lib → types}/components/sections/FactList.d.ts.map +0 -0
  568. /package/{lib → types}/components/sections/FeatureList.d.ts +0 -0
  569. /package/{lib → types}/components/sections/FeatureList.d.ts.map +0 -0
  570. /package/{lib → types}/components/sections/Gallery.d.ts +0 -0
  571. /package/{lib → types}/components/sections/Gallery.d.ts.map +0 -0
  572. /package/{lib → types}/components/sections/IconList.d.ts +0 -0
  573. /package/{lib → types}/components/sections/IconList.d.ts.map +0 -0
  574. /package/{lib → types}/components/sections/IndexList.d.ts +0 -0
  575. /package/{lib → types}/components/sections/IndexList.d.ts.map +0 -0
  576. /package/{lib → types}/components/sections/Intro.d.ts +0 -0
  577. /package/{lib → types}/components/sections/Intro.d.ts.map +0 -0
  578. /package/{lib → types}/components/sections/Map.d.ts +0 -0
  579. /package/{lib → types}/components/sections/Map.d.ts.map +0 -0
  580. /package/{lib → types}/components/sections/NavList.d.ts +0 -0
  581. /package/{lib → types}/components/sections/NavList.d.ts.map +0 -0
  582. /package/{lib → types}/components/sections/NewsletterForm.d.ts +0 -0
  583. /package/{lib → types}/components/sections/NewsletterForm.d.ts.map +0 -0
  584. /package/{lib → types}/components/sections/NumberList.d.ts +0 -0
  585. /package/{lib → types}/components/sections/ParallaxBackground.d.ts +0 -0
  586. /package/{lib → types}/components/sections/ParallaxBackground.d.ts.map +0 -0
  587. /package/{lib → types}/components/sections/Poster.d.ts +0 -0
  588. /package/{lib → types}/components/sections/Poster.d.ts.map +0 -0
  589. /package/{lib → types}/components/sections/PriceList.d.ts +0 -0
  590. /package/{lib → types}/components/sections/PriceList.d.ts.map +0 -0
  591. /package/{lib → types}/components/sections/PriceTable.d.ts +0 -0
  592. /package/{lib → types}/components/sections/PriceTable.d.ts.map +0 -0
  593. /package/{lib → types}/components/sections/Quote.d.ts +0 -0
  594. /package/{lib → types}/components/sections/Quote.d.ts.map +0 -0
  595. /package/{lib → types}/components/sections/RawVideo.d.ts +0 -0
  596. /package/{lib → types}/components/sections/RawVideo.d.ts.map +0 -0
  597. /package/{lib → types}/components/sections/SimpleImage.d.ts +0 -0
  598. /package/{lib → types}/components/sections/SimpleImage.d.ts.map +0 -0
  599. /package/{lib → types}/components/sections/SocialWall.d.ts +0 -0
  600. /package/{lib → types}/components/sections/SocialWall.d.ts.map +0 -0
  601. /package/{lib → types}/components/sections/Table.d.ts +0 -0
  602. /package/{lib → types}/components/sections/Table.d.ts.map +0 -0
  603. /package/{lib → types}/components/sections/Teaser.d.ts +0 -0
  604. /package/{lib → types}/components/sections/Teaser.d.ts.map +0 -0
  605. /package/{lib → types}/components/sections/TeaserWide.d.ts +0 -0
  606. /package/{lib → types}/components/sections/TeaserWide.d.ts.map +0 -0
  607. /package/{lib → types}/components/sections/Timeline.d.ts +0 -0
  608. /package/{lib → types}/components/sections/Timeline.d.ts.map +0 -0
  609. /package/{lib → types}/components/sections/Video.d.ts +0 -0
  610. /package/{lib → types}/components/sections/Video.d.ts.map +0 -0
  611. /package/{lib → types}/components/sections/events/EventDetail.d.ts +0 -0
  612. /package/{lib → types}/components/sections/events/EventDetail.d.ts.map +0 -0
  613. /package/{lib → types}/components/sections/events/EventList.d.ts +0 -0
  614. /package/{lib → types}/components/sections/events/EventList.d.ts.map +0 -0
  615. /package/{lib → types}/components/sections/events/EventOverview.d.ts +0 -0
  616. /package/{lib → types}/components/sections/events/EventOverview.d.ts.map +0 -0
  617. /package/{lib → types}/components/sections/footer/Footer.d.ts +0 -0
  618. /package/{lib → types}/components/sections/footer/Footer.d.ts.map +0 -0
  619. /package/{lib → types}/components/sections/footer/partials/FooterBottomBar.d.ts +0 -0
  620. /package/{lib → types}/components/sections/footer/partials/FooterBottomBar.d.ts.map +0 -0
  621. /package/{lib → types}/components/sections/footer/partials/FooterColumn.d.ts +0 -0
  622. /package/{lib → types}/components/sections/footer/partials/FooterColumn.d.ts.map +0 -0
  623. /package/{lib → types}/components/sections/footer/partials/index.d.ts +0 -0
  624. /package/{lib → types}/components/sections/footer/partials/index.d.ts.map +0 -0
  625. /package/{lib → types}/components/sections/footer/skeletons/FooterArticle.d.ts +0 -0
  626. /package/{lib → types}/components/sections/footer/skeletons/FooterArticle.d.ts.map +0 -0
  627. /package/{lib → types}/components/sections/footer/skeletons/FooterBottomGrid.d.ts +0 -0
  628. /package/{lib → types}/components/sections/footer/skeletons/FooterBottomGrid.d.ts.map +0 -0
  629. /package/{lib → types}/components/sections/footer/skeletons/index.d.ts +0 -0
  630. /package/{lib → types}/components/sections/footer/skeletons/index.d.ts.map +0 -0
  631. /package/{lib → types}/components/sections/form/DynamicForm.d.ts +0 -0
  632. /package/{lib → types}/components/sections/form/DynamicForm.d.ts.map +0 -0
  633. /package/{lib → types}/components/sections/form/renderer/areaRenderer.d.ts +0 -0
  634. /package/{lib → types}/components/sections/form/renderer/areaRenderer.d.ts.map +0 -0
  635. /package/{lib → types}/components/sections/form/renderer/datepickerRenderer.d.ts +0 -0
  636. /package/{lib → types}/components/sections/form/renderer/datepickerRenderer.d.ts.map +0 -0
  637. /package/{lib → types}/components/sections/form/renderer/fieldGroupRenderer.d.ts +0 -0
  638. /package/{lib → types}/components/sections/form/renderer/fieldGroupRenderer.d.ts.map +0 -0
  639. /package/{lib → types}/components/sections/form/renderer/fieldRenderer.d.ts +0 -0
  640. /package/{lib → types}/components/sections/form/renderer/fieldRenderer.d.ts.map +0 -0
  641. /package/{lib → types}/components/sections/form/renderer/locationRenderer.d.ts +0 -0
  642. /package/{lib → types}/components/sections/form/renderer/locationRenderer.d.ts.map +0 -0
  643. /package/{lib → types}/components/sections/form/renderer/selectRenderer.d.ts +0 -0
  644. /package/{lib → types}/components/sections/form/renderer/selectRenderer.d.ts.map +0 -0
  645. /package/{lib → types}/components/sections/form/renderer/uploadRenderer.d.ts +0 -0
  646. /package/{lib → types}/components/sections/form/renderer/uploadRenderer.d.ts.map +0 -0
  647. /package/{lib → types}/components/sections/form/validators/areaValidator.d.ts +0 -0
  648. /package/{lib → types}/components/sections/form/validators/areaValidator.d.ts.map +0 -0
  649. /package/{lib → types}/components/sections/form/validators/datepickerValidator.d.ts +0 -0
  650. /package/{lib → types}/components/sections/form/validators/datepickerValidator.d.ts.map +0 -0
  651. /package/{lib → types}/components/sections/form/validators/fieldGroupValidator.d.ts +0 -0
  652. /package/{lib → types}/components/sections/form/validators/fieldGroupValidator.d.ts.map +0 -0
  653. /package/{lib → types}/components/sections/form/validators/fieldValidator.d.ts +0 -0
  654. /package/{lib → types}/components/sections/form/validators/fieldValidator.d.ts.map +0 -0
  655. /package/{lib → types}/components/sections/form/validators/locationValidator.d.ts +0 -0
  656. /package/{lib → types}/components/sections/form/validators/locationValidator.d.ts.map +0 -0
  657. /package/{lib → types}/components/sections/form/validators/selectValidator.d.ts +0 -0
  658. /package/{lib → types}/components/sections/form/validators/selectValidator.d.ts.map +0 -0
  659. /package/{lib → types}/components/sections/form/validators/uploadValidator.d.ts +0 -0
  660. /package/{lib → types}/components/sections/form/validators/uploadValidator.d.ts.map +0 -0
  661. /package/{lib → types}/components/sections/header/HeaderKenBurns.d.ts +0 -0
  662. /package/{lib → types}/components/sections/header/HeaderKenBurns.d.ts.map +0 -0
  663. /package/{lib → types}/components/sections/header/HeaderPoster.d.ts +0 -0
  664. /package/{lib → types}/components/sections/header/HeaderPoster.d.ts.map +0 -0
  665. /package/{lib → types}/components/sections/header/HeaderVideo.d.ts +0 -0
  666. /package/{lib → types}/components/sections/header/HeaderVideo.d.ts.map +0 -0
  667. /package/{lib → types}/components/sections/jobs/JobArticle.d.ts +0 -0
  668. /package/{lib → types}/components/sections/jobs/JobArticle.d.ts.map +0 -0
  669. /package/{lib → types}/components/sections/jobs/JobList.d.ts +0 -0
  670. /package/{lib → types}/components/sections/jobs/JobList.d.ts.map +0 -0
  671. /package/{lib → types}/components/sections/navigation/NavBar.d.ts +0 -0
  672. /package/{lib → types}/components/sections/navigation/NavBar.d.ts.map +0 -0
  673. /package/{lib → types}/components/sections/navigation/Navigation.d.ts +0 -0
  674. /package/{lib → types}/components/sections/navigation/Navigation.d.ts.map +0 -0
  675. /package/{lib → types}/components/sections/navigation/menu/Menu.d.ts +0 -0
  676. /package/{lib → types}/components/sections/navigation/menu/Menu.d.ts.map +0 -0
  677. /package/{lib → types}/components/sections/navigation/menu/variations/MenuFlyout.d.ts +0 -0
  678. /package/{lib → types}/components/sections/navigation/menu/variations/MenuLarge.d.ts +0 -0
  679. /package/{lib → types}/components/sections/navigation/partials/MenuFooter.d.ts +0 -0
  680. /package/{lib → types}/components/sections/navigation/partials/MenuFooter.d.ts.map +0 -0
  681. /package/{lib → types}/components/sections/navigation/partials/MenuHeader.d.ts +0 -0
  682. /package/{lib → types}/components/sections/navigation/partials/MenuHeader.d.ts.map +0 -0
  683. /package/{lib → types}/components/sections/navigation/partials/NavBarBottom.d.ts +0 -0
  684. /package/{lib → types}/components/sections/navigation/partials/NavBarBottom.d.ts.map +0 -0
  685. /package/{lib → types}/components/sections/navigation/partials/NavBarMain.d.ts +0 -0
  686. /package/{lib → types}/components/sections/navigation/partials/NavBarMain.d.ts.map +0 -0
  687. /package/{lib → types}/components/sections/navigation/partials/NavBarTop.d.ts +0 -0
  688. /package/{lib → types}/components/sections/navigation/partials/NavBarTop.d.ts.map +0 -0
  689. /package/{lib → types}/components/sections/navigation/partials/index.d.ts +0 -0
  690. /package/{lib → types}/components/sections/navigation/partials/index.d.ts.map +0 -0
  691. /package/{lib → types}/components/sections/navigation/skeletons/BarBreadCrumbs.d.ts +0 -0
  692. /package/{lib → types}/components/sections/navigation/skeletons/BarBreadCrumbs.d.ts.map +0 -0
  693. /package/{lib → types}/components/sections/navigation/skeletons/BarColumn.d.ts +0 -0
  694. /package/{lib → types}/components/sections/navigation/skeletons/BarColumn.d.ts.map +0 -0
  695. /package/{lib → types}/components/sections/navigation/skeletons/BarLogo.d.ts +0 -0
  696. /package/{lib → types}/components/sections/navigation/skeletons/BarLogo.d.ts.map +0 -0
  697. /package/{lib → types}/components/sections/navigation/skeletons/BarMenuToggle.d.ts +0 -0
  698. /package/{lib → types}/components/sections/navigation/skeletons/BarMenuToggle.d.ts.map +0 -0
  699. /package/{lib → types}/components/sections/navigation/skeletons/BarNavList.d.ts +0 -0
  700. /package/{lib → types}/components/sections/navigation/skeletons/BarNavList.d.ts.map +0 -0
  701. /package/{lib → types}/components/sections/navigation/skeletons/index.d.ts +0 -0
  702. /package/{lib → types}/components/sections/navigation/skeletons/index.d.ts.map +0 -0
  703. /package/{lib → types}/components/sections/news/NewsAuthorCard.d.ts +0 -0
  704. /package/{lib → types}/components/sections/news/NewsAuthorCard.d.ts.map +0 -0
  705. /package/{lib → types}/components/sections/news/NewsFooter.d.ts +0 -0
  706. /package/{lib → types}/components/sections/news/NewsFooter.d.ts.map +0 -0
  707. /package/{lib → types}/components/sections/news/NewsImages.d.ts +0 -0
  708. /package/{lib → types}/components/sections/news/NewsImages.d.ts.map +0 -0
  709. /package/{lib → types}/components/sections/news/NewsIntro.d.ts +0 -0
  710. /package/{lib → types}/components/sections/news/NewsIntro.d.ts.map +0 -0
  711. /package/{lib → types}/components/sections/news/NewsList.d.ts +0 -0
  712. /package/{lib → types}/components/sections/news/NewsList.d.ts.map +0 -0
  713. /package/{lib → types}/components/sections/news/NewsOverview.d.ts +0 -0
  714. /package/{lib → types}/components/sections/news/NewsOverview.d.ts.map +0 -0
  715. /package/{lib → types}/components/sections/news/NewsTable.d.ts +0 -0
  716. /package/{lib → types}/components/sections/news/NewsTable.d.ts.map +0 -0
  717. /package/{lib → types}/components/sections/news/NewsText.d.ts +0 -0
  718. /package/{lib → types}/components/sections/news/NewsText.d.ts.map +0 -0
  719. /package/{lib → types}/components/sections/news/NewsVideo.d.ts +0 -0
  720. /package/{lib → types}/components/sections/news/NewsVideo.d.ts.map +0 -0
  721. /package/{lib → types}/components/sections/pois/PointOfInterestDetail.d.ts +0 -0
  722. /package/{lib → types}/components/sections/pois/PointOfInterestDetail.d.ts.map +0 -0
  723. /package/{lib → types}/components/sections/pois/PointOfInterestMap.d.ts +0 -0
  724. /package/{lib → types}/components/sections/pois/PointOfInterestMap.d.ts.map +0 -0
  725. /package/{lib → types}/components/sections/pois/PointOfInterestOverview.d.ts +0 -0
  726. /package/{lib → types}/components/sections/pois/PointOfInterestOverview.d.ts.map +0 -0
  727. /package/{lib → types}/components/typography/Callout.d.ts +0 -0
  728. /package/{lib → types}/components/typography/Copy.d.ts +0 -0
  729. /package/{lib → types}/components/typography/Copy.d.ts.map +0 -0
  730. /package/{lib → types}/components/typography/Heading.d.ts +0 -0
  731. /package/{lib → types}/components/typography/Heading.d.ts.map +0 -0
  732. /package/{lib → types}/components/typography/Link.d.ts +0 -0
  733. /package/{lib → types}/components/typography/Link.d.ts.map +0 -0
  734. /package/{lib → types}/utils/LibThemeProvider.d.ts +0 -0
  735. /package/{lib → types}/utils/LibThemeProvider.d.ts.map +0 -0
  736. /package/{lib → types}/utils/arrays.d.ts +0 -0
  737. /package/{lib → types}/utils/arrays.d.ts.map +0 -0
  738. /package/{lib → types}/utils/backgroundImage.d.ts +0 -0
  739. /package/{lib → types}/utils/backgroundImage.d.ts.map +0 -0
  740. /package/{lib → types}/utils/clamp.d.ts +0 -0
  741. /package/{lib → types}/utils/clamp.d.ts.map +0 -0
  742. /package/{lib → types}/utils/concat.d.ts +0 -0
  743. /package/{lib → types}/utils/concat.d.ts.map +0 -0
  744. /package/{lib → types}/utils/cookie-consent/cookie.d.ts +0 -0
  745. /package/{lib → types}/utils/cookie-consent/cookie.d.ts.map +0 -0
  746. /package/{lib → types}/utils/cookie-consent/mutations.d.ts +0 -0
  747. /package/{lib → types}/utils/cookie-consent/mutations.d.ts.map +0 -0
  748. /package/{lib → types}/utils/cookie-consent/useCookieConsent.d.ts +0 -0
  749. /package/{lib → types}/utils/cookie-consent/useCookieConsent.d.ts.map +0 -0
  750. /package/{lib → types}/utils/dataURI.d.ts +0 -0
  751. /package/{lib → types}/utils/dataURI.d.ts.map +0 -0
  752. /package/{lib → types}/utils/escape.d.ts +0 -0
  753. /package/{lib → types}/utils/escape.d.ts.map +0 -0
  754. /package/{lib → types}/utils/filters.d.ts +0 -0
  755. /package/{lib → types}/utils/filters.d.ts.map +0 -0
  756. /package/{lib → types}/utils/fontLoading.d.ts +0 -0
  757. /package/{lib → types}/utils/fontLoading.d.ts.map +0 -0
  758. /package/{lib → types}/utils/formFieldText.d.ts +0 -0
  759. /package/{lib → types}/utils/formFieldText.d.ts.map +0 -0
  760. /package/{lib → types}/utils/getLinkIcon.d.ts +0 -0
  761. /package/{lib → types}/utils/getLinkIcon.d.ts.map +0 -0
  762. /package/{lib → types}/utils/hexRgbConverter.d.ts +0 -0
  763. /package/{lib → types}/utils/hexRgbConverter.d.ts.map +0 -0
  764. /package/{lib → types}/utils/menuHooks.d.ts +0 -0
  765. /package/{lib → types}/utils/menuHooks.d.ts.map +0 -0
  766. /package/{lib → types}/utils/navigation.d.ts +0 -0
  767. /package/{lib → types}/utils/navigation.d.ts.map +0 -0
  768. /package/{lib → types}/utils/statusFormatter.d.ts +0 -0
  769. /package/{lib → types}/utils/statusFormatter.d.ts.map +0 -0
  770. /package/{lib → types}/utils/storyHelpers.d.ts +0 -0
  771. /package/{lib → types}/utils/storyHelpers.d.ts.map +0 -0
  772. /package/{lib → types}/utils/structuredData.d.ts +0 -0
  773. /package/{lib → types}/utils/structuredData.d.ts.map +0 -0
  774. /package/{lib → types}/utils/styles.d.ts +0 -0
  775. /package/{lib → types}/utils/styles.d.ts.map +0 -0
  776. /package/{lib → types}/utils/types.d.ts +0 -0
  777. /package/{lib → types}/utils/types.d.ts.map +0 -0
  778. /package/{lib → types}/utils/urlParams.d.ts +0 -0
  779. /package/{lib → types}/utils/urlParams.d.ts.map +0 -0
  780. /package/{lib → types}/utils/useArray.d.ts +0 -0
  781. /package/{lib → types}/utils/useArray.d.ts.map +0 -0
  782. /package/{lib → types}/utils/useDebounce.d.ts +0 -0
  783. /package/{lib → types}/utils/useDebounce.d.ts.map +0 -0
  784. /package/{lib → types}/utils/useEqualSheetHeight.d.ts +0 -0
  785. /package/{lib → types}/utils/useEqualSheetHeight.d.ts.map +0 -0
  786. /package/{lib → types}/utils/useFontsLoaded.d.ts +0 -0
  787. /package/{lib → types}/utils/useFontsLoaded.d.ts.map +0 -0
  788. /package/{lib → types}/utils/useGeolocation.d.ts +0 -0
  789. /package/{lib → types}/utils/useGeolocation.d.ts.map +0 -0
  790. /package/{lib → types}/utils/useIE.d.ts +0 -0
  791. /package/{lib → types}/utils/useIE.d.ts.map +0 -0
  792. /package/{lib → types}/utils/useImgPreload.d.ts +0 -0
  793. /package/{lib → types}/utils/useImgPreload.d.ts.map +0 -0
  794. /package/{lib → types}/utils/useInterval.d.ts +0 -0
  795. /package/{lib → types}/utils/useInterval.d.ts.map +0 -0
  796. /package/{lib → types}/utils/useItemHeight.d.ts +0 -0
  797. /package/{lib → types}/utils/useItemHeight.d.ts.map +0 -0
  798. /package/{lib → types}/utils/useLazyInput.d.ts +0 -0
  799. /package/{lib → types}/utils/useLazyInput.d.ts.map +0 -0
  800. /package/{lib → types}/utils/useLeafletMap.d.ts +0 -0
  801. /package/{lib → types}/utils/useLeafletMap.d.ts.map +0 -0
  802. /package/{lib → types}/utils/useMediaQuery.d.ts +0 -0
  803. /package/{lib → types}/utils/useMediaQuery.d.ts.map +0 -0
  804. /package/{lib → types}/utils/useMounted.d.ts +0 -0
  805. /package/{lib → types}/utils/useMounted.d.ts.map +0 -0
  806. /package/{lib → types}/utils/useObserverSupport.d.ts +0 -0
  807. /package/{lib → types}/utils/useObserverSupport.d.ts.map +0 -0
  808. /package/{lib → types}/utils/usePageScroll.d.ts +0 -0
  809. /package/{lib → types}/utils/usePageScroll.d.ts.map +0 -0
  810. /package/{lib → types}/utils/useParams.d.ts +0 -0
  811. /package/{lib → types}/utils/useParams.d.ts.map +0 -0
  812. /package/{lib → types}/utils/usePoster.d.ts +0 -0
  813. /package/{lib → types}/utils/usePoster.d.ts.map +0 -0
  814. /package/{lib → types}/utils/usePrevious.d.ts +0 -0
  815. /package/{lib → types}/utils/usePrevious.d.ts.map +0 -0
  816. /package/{lib → types}/utils/useResizeThrottle.d.ts +0 -0
  817. /package/{lib → types}/utils/useResizeThrottle.d.ts.map +0 -0
  818. /package/{lib → types}/utils/useScroll.d.ts +0 -0
  819. /package/{lib → types}/utils/useScroll.d.ts.map +0 -0
  820. /package/{lib → types}/utils/useScrollIntoView.d.ts +0 -0
  821. /package/{lib → types}/utils/useScrollIntoView.d.ts.map +0 -0
  822. /package/{lib → types}/utils/useScrollThrottle.d.ts +0 -0
  823. /package/{lib → types}/utils/useScrollThrottle.d.ts.map +0 -0
  824. /package/{lib → types}/utils/useScrollTo.d.ts +0 -0
  825. /package/{lib → types}/utils/useScrollTo.d.ts.map +0 -0
  826. /package/{lib → types}/utils/useTimeout.d.ts +0 -0
  827. /package/{lib → types}/utils/useTimeout.d.ts.map +0 -0
  828. /package/{lib → types}/utils/useTouch.d.ts +0 -0
  829. /package/{lib → types}/utils/useTouch.d.ts.map +0 -0
  830. /package/{lib → types}/utils/useUpdateEffect.d.ts +0 -0
  831. /package/{lib → types}/utils/useUpdateEffect.d.ts.map +0 -0
@@ -0,0 +1,4790 @@
1
+ import { a as __makeTemplateObject, L as LocationPin, T as ToggleOn, w as ToggleOff, x as LocationSearch, y as CalendarToday, D as DateRange, f as __awaiter, g as __generator, z as AngleUp, F as AngleDown, e as __spreadArray, G as DeleteForever, U as UploadFile } from './ClockFilled-6bae80dc.js';
2
+ import * as React from 'react';
3
+ import React__default, { useState, useRef, useCallback, useEffect, forwardRef, useMemo } from 'react';
4
+ import styled, { css } from 'styled-components';
5
+ import { C as Copy, c as copyStyle } from './Copy-bca0854c.js';
6
+ import { s as spacings, a as getFonts, g as getColors, c as getGlobals, w as withRange, e as getSVGDataImg, m as mq } from './styles-c387bdc6.js';
7
+ import { u as useLeafletMap } from './useLeafletMap-6dea7a8e.js';
8
+ import { u as useLibTheme } from './LibThemeProvider-acf2e2bb.js';
9
+ import { b as useLazyInput } from './useLazyInput-e66fc5be.js';
10
+ import { u as useUpdateEffect } from './useUpdateEffect-824c0c84.js';
11
+ import { u as useGeolocation } from './useGeolocation-f9f073cc.js';
12
+ import { B as ButtonGhost } from './ButtonGhost-6876b67f.js';
13
+ import { B as Button } from './Button-71376927.js';
14
+ import ReactDatePicker from 'react-datepicker';
15
+ import { h as hexToRgba } from './hexRgbConverter-edb91624.js';
16
+ import { u as useMounted } from './useMounted-1e4cc87b.js';
17
+ import { i as isValidArray } from './arrays-65b644ef.js';
18
+ import { c as clampValue } from './clamp-12d37b65.js';
19
+
20
+ var View$1 = styled.label.withConfig({
21
+ displayName: "FormField__View",
22
+ componentId: "sc-1rjz0eq-0"
23
+ })(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n display: block;\n text-align: left;\n\n pointer-events: ", ";\n user-select: ", ";\n opacity: ", ";\n"], ["\n display: block;\n text-align: left;\n\n pointer-events: ", ";\n user-select: ", ";\n opacity: ", ";\n"])), function (_a) {
24
+ var isDisabled = _a.isDisabled;
25
+ return isDisabled && 'none';
26
+ }, function (_a) {
27
+ var isDisabled = _a.isDisabled;
28
+ return isDisabled && 'none';
29
+ }, function (_a) {
30
+ var isDisabled = _a.isDisabled;
31
+ return isDisabled ? 0.3 : 1;
32
+ });
33
+ var FieldHead = styled(Copy).withConfig({
34
+ displayName: "FormField__FieldHead",
35
+ componentId: "sc-1rjz0eq-1"
36
+ })(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n display: inline-flex;\n flex-direction: row;\n align-items: top;\n justify-content: space-between;\n padding-bottom: ", "px;\n"], ["\n display: inline-flex;\n flex-direction: row;\n align-items: top;\n justify-content: space-between;\n padding-bottom: ", "px;\n"])), spacings.nudge);
37
+ var FieldMessage = styled(Copy).withConfig({
38
+ displayName: "FormField__FieldMessage",
39
+ componentId: "sc-1rjz0eq-2"
40
+ })(templateObject_3$5 || (templateObject_3$5 = __makeTemplateObject(["\n margin-top: ", "px;\n"], ["\n margin-top: ", "px;\n"])), spacings.nudge);
41
+
42
+ var FieldWrapper = function (_a) {
43
+ var isDisabled = _a.isDisabled,
44
+ onClick = _a.onClick,
45
+ className = _a.className,
46
+ children = _a.children;
47
+ return React__default.createElement(View$1, {
48
+ onClick: onClick,
49
+ isDisabled: isDisabled,
50
+ className: className
51
+ }, children);
52
+ };
53
+
54
+ var Head = function (_a) {
55
+ var label = _a.label,
56
+ isRequired = _a.isRequired,
57
+ isInverted = _a.isInverted,
58
+ className = _a.className;
59
+ if (!label) return null;
60
+ return React__default.createElement(FieldHead, {
61
+ renderAs: "span",
62
+ isInverted: isInverted,
63
+ size: "small",
64
+ type: "copy-b",
65
+ className: className
66
+ }, "".concat(label).concat(isRequired ? ' *' : ''));
67
+ };
68
+
69
+ var Messages = function (_a) {
70
+ var errorMessage = _a.errorMessage,
71
+ infoMessage = _a.infoMessage,
72
+ isInverted = _a.isInverted;
73
+ var colors = useLibTheme().colors;
74
+ return React__default.createElement(React__default.Fragment, null, infoMessage && React__default.createElement(FieldMessage, {
75
+ size: "small",
76
+ type: "copy",
77
+ isInverted: isInverted
78
+ }, infoMessage), errorMessage && React__default.createElement(FieldMessage, {
79
+ size: "small",
80
+ type: "copy",
81
+ textColor: isInverted ? colors.text.errorInverted : colors.text.error
82
+ }, errorMessage ? errorMessage : 'Bitte geben Sie einen gültigen Text ein'));
83
+ };
84
+
85
+ var Content = function (_a) {
86
+ var children = _a.children;
87
+ var addWrapper = typeof children === 'string' || children instanceof String;
88
+ if (addWrapper) return React__default.createElement("span", null, children);
89
+ return React__default.createElement(React__default.Fragment, null, children);
90
+ };
91
+
92
+ var FieldWrapper$1 = {
93
+ View: FieldWrapper,
94
+ Head: Head,
95
+ Messages: Messages,
96
+ Content: Content
97
+ };
98
+ var templateObject_1$7, templateObject_2$5, templateObject_3$5;
99
+
100
+ var getFormFieldTextSize = function (theme) {
101
+ var min = clampValue(getFonts(theme).copy.small.size[0], 16);
102
+ var max = getFonts(theme).copy.small.size[1];
103
+ return [min, max];
104
+ };
105
+
106
+ var MapWrapper = styled.div.withConfig({
107
+ displayName: "LocationField__MapWrapper",
108
+ componentId: "sc-ipn926-0"
109
+ })(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n display: ", ";\n position: relative;\n"], ["\n display: ", ";\n position: relative;\n"])), function (_a) {
110
+ var isVisible = _a.isVisible;
111
+ return isVisible ? 'block' : 'none';
112
+ });
113
+ var MapContainer = styled.div.withConfig({
114
+ displayName: "LocationField__MapContainer",
115
+ componentId: "sc-ipn926-1"
116
+ })(templateObject_2$4 || (templateObject_2$4 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n height: 290px;\n z-index: 0;\n outline: none;\n"], ["\n position: relative;\n width: 100%;\n height: 290px;\n z-index: 0;\n outline: none;\n"])));
117
+ var ViewToggle = styled.button.withConfig({
118
+ displayName: "LocationField__ViewToggle",
119
+ componentId: "sc-ipn926-2"
120
+ })(templateObject_3$4 || (templateObject_3$4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n background: none;\n border: none;\n padding: ", "px 0;\n padding-bottom: ", "px;\n\n cursor: pointer;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n background: none;\n border: none;\n padding: ", "px 0;\n padding-bottom: ", "px;\n\n cursor: pointer;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge, spacings.nudge * 2, spacings.nudge * 2);
121
+ var ToggleText = styled(Copy).withConfig({
122
+ displayName: "LocationField__ToggleText",
123
+ componentId: "sc-ipn926-3"
124
+ })(templateObject_4$4 || (templateObject_4$4 = __makeTemplateObject(["\n line-height: 1;\n"], ["\n line-height: 1;\n"])));
125
+ var ResetMap = styled.div.withConfig({
126
+ displayName: "LocationField__ResetMap",
127
+ componentId: "sc-ipn926-4"
128
+ })(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject(["\n position: absolute;\n top: ", "px;\n right: ", "px;\n"], ["\n position: absolute;\n top: ", "px;\n right: ", "px;\n"])), spacings.nudge, spacings.nudge);
129
+ var ResetMapControl = styled.button.withConfig({
130
+ displayName: "LocationField__ResetMapControl",
131
+ componentId: "sc-ipn926-5"
132
+ })(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: 0;\n padding: ", "px;\n margin-top: -", "px;\n margin-right: -", "px;\n\n cursor: pointer;\n transition: color 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n color: ", ";\n }\n }\n\n &:focus {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: none;\n border: 0;\n padding: ", "px;\n margin-top: -", "px;\n margin-right: -", "px;\n\n cursor: pointer;\n transition: color 0.2s ease-in-out;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n color: ", ";\n }\n }\n\n &:focus {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), spacings.nudge, spacings.nudge, spacings.nudge, function (_a) {
133
+ var theme = _a.theme;
134
+ return getColors(theme).primary.default;
135
+ }, function (_a) {
136
+ var theme = _a.theme;
137
+ return getColors(theme).primary.default;
138
+ });
139
+ var TrackLocation = styled.div.withConfig({
140
+ displayName: "LocationField__TrackLocation",
141
+ componentId: "sc-ipn926-6"
142
+ })(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject(["\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"], ["\n position: absolute;\n bottom: ", "px;\n right: ", "px;\n"])), spacings.nudge * 2, spacings.nudge);
143
+ var TrackLocationControl = styled.button.withConfig({
144
+ displayName: "LocationField__TrackLocationControl",
145
+ componentId: "sc-ipn926-7"
146
+ })(templateObject_8$2 || (templateObject_8$2 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: ", ";\n border: none;\n padding: 0.7em;\n min-height: 40px;\n\n ", "\n color: ", ";\n cursor: pointer;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n }\n\n &:focus {\n text-decoration: underline;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n outline: none;\n box-shadow: none;\n }\n\n &:active {\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);\n }\n"], ["\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: ", ";\n border: none;\n padding: 0.7em;\n min-height: 40px;\n\n ", "\n color: ", ";\n cursor: pointer;\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n }\n\n &:focus {\n text-decoration: underline;\n box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.25);\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n outline: none;\n box-shadow: none;\n }\n\n &:active {\n box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.3);\n }\n"])), function (_a) {
147
+ var theme = _a.theme;
148
+ return getColors(theme).elementBg.dark;
149
+ }, copyStyle('copy', 'small'), function (_a) {
150
+ var theme = _a.theme;
151
+ return getFonts(theme).copy.small.colorInverted;
152
+ });
153
+ var FieldView$1 = styled.div.withConfig({
154
+ displayName: "LocationField__FieldView",
155
+ componentId: "sc-ipn926-8"
156
+ })(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n & > * + * {\n margin-left: 16px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n & > * + * {\n margin-left: 16px;\n }\n"])));
157
+ var Area$1 = styled.textarea.withConfig({
158
+ displayName: "LocationField__Area",
159
+ componentId: "sc-ipn926-9"
160
+ })(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), spacings.nudge, function (_a) {
161
+ var theme = _a.theme,
162
+ isInverted = _a.isInverted,
163
+ hasError = _a.hasError;
164
+
165
+ if (isInverted) {
166
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
167
+ }
168
+
169
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
170
+ }, function (_a) {
171
+ var theme = _a.theme;
172
+ return getGlobals(theme).sections.edgeRadius;
173
+ }, copyStyle('copy', 'small'), function (_a) {
174
+ var theme = _a.theme;
175
+ return withRange(getFormFieldTextSize(theme), 'font-size');
176
+ }, function (_a) {
177
+ var theme = _a.theme,
178
+ isInverted = _a.isInverted,
179
+ hasError = _a.hasError;
180
+
181
+ if (isInverted) {
182
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
183
+ }
184
+
185
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
186
+ }, function (_a) {
187
+ var theme = _a.theme,
188
+ isInverted = _a.isInverted;
189
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
190
+ }, function (_a) {
191
+ var theme = _a.theme,
192
+ isInverted = _a.isInverted;
193
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
194
+ }, function (_a) {
195
+ var theme = _a.theme,
196
+ isInverted = _a.isInverted;
197
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
198
+ });
199
+
200
+ var LocationField = function (_a) {
201
+ var _b, _c;
202
+
203
+ var label = _a.label,
204
+ errorMessage = _a.errorMessage,
205
+ infoMessage = _a.infoMessage,
206
+ isRequired = _a.isRequired,
207
+ isDisabled = _a.isDisabled,
208
+ isInverted = _a.isInverted,
209
+ placeholder = _a.placeholder,
210
+ value = _a.value,
211
+ name = _a.name,
212
+ marker = _a.marker,
213
+ initialMapCenter = _a.initialMapCenter,
214
+ _d = _a.zoom,
215
+ zoom = _d === void 0 ? 10 : _d,
216
+ onChange = _a.onChange,
217
+ onBlur = _a.onBlur,
218
+ customToggle = _a.customToggle,
219
+ customLocationControl = _a.customLocationControl,
220
+ customResetControl = _a.customResetControl,
221
+ _e = _a.toggleLabel,
222
+ toggleLabel = _e === void 0 ? 'Select location on map' : _e,
223
+ _f = _a.trackLocationLabel,
224
+ trackLocationLabel = _f === void 0 ? 'My location' : _f;
225
+
226
+ if (isDisabled) {
227
+ errorMessage = '';
228
+ }
229
+
230
+ var _g = useLibTheme(),
231
+ colors = _g.colors,
232
+ fonts = _g.fonts;
233
+
234
+ var _h = useState(false),
235
+ useMapView = _h[0],
236
+ setUseMapView = _h[1];
237
+
238
+ var _j = useState(value || {
239
+ description: ''
240
+ }),
241
+ getValue = _j[0],
242
+ setValue = _j[1];
243
+
244
+ var prevValue = useRef(null);
245
+
246
+ var _k = useState([]),
247
+ markers = _k[0],
248
+ setMarkers = _k[1];
249
+
250
+ var _l = useLazyInput(function (value) {
251
+ setValue({
252
+ description: value,
253
+ position: undefined
254
+ });
255
+ }, (value === null || value === void 0 ? void 0 : value.description) || ''),
256
+ descValue = _l.value,
257
+ setDescValue = _l.update,
258
+ forceUpdate = _l.forceUpdate;
259
+
260
+ var getMarkersFromPositions = useCallback(function (positions) {
261
+ /** Markers */
262
+ var defaultMarker = {
263
+ size: [28, 28],
264
+ anchor: [14, 28],
265
+ sizeActive: [70, 70],
266
+ anchorActive: [35, 70],
267
+ url: getSVGDataImg(React__default.createElement(LocationPin, null))
268
+ };
269
+ var markerList = [];
270
+
271
+ for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
272
+ var position = positions_1[_i];
273
+ markerList.push({
274
+ id: 'location',
275
+ position: position,
276
+ icon: marker || defaultMarker
277
+ });
278
+ }
279
+
280
+ return markerList;
281
+ }, [marker]);
282
+
283
+ var _m = useLeafletMap({
284
+ activeMarkerId: 'location',
285
+ markers: markers,
286
+ center: initialMapCenter,
287
+ zoom: zoom,
288
+ onClick: function (ev) {
289
+ mapClickHandler(ev);
290
+ }
291
+ }),
292
+ setMapContainer = _m.setContainer,
293
+ flyToPosition = _m.flyToPosition,
294
+ recalculateMapSize = _m.recalculateMapSize; // double click fix
295
+
296
+
297
+ var doubleClickTimerRef = useRef(null);
298
+
299
+ var _o = useGeolocation(true, false),
300
+ isGeolocationSupported = _o.isSupported,
301
+ isEnabled = _o.isEnabled,
302
+ location = _o.location,
303
+ error = _o.error,
304
+ resetLocationTracking = _o.reset,
305
+ cancelGeolocation = _o.cancel;
306
+
307
+ var setMapToInitial = useCallback(function () {
308
+ flyToPosition(initialMapCenter, zoom);
309
+ cancelGeolocation();
310
+ }, [cancelGeolocation, flyToPosition, initialMapCenter, zoom]);
311
+
312
+ var handleMapClick = function (newPos) {
313
+ cancelGeolocation(); // set marker
314
+
315
+ var markers = getMarkersFromPositions([newPos]);
316
+ setMarkers(markers);
317
+ setValue({
318
+ description: '',
319
+ position: newPos
320
+ });
321
+ };
322
+
323
+ var handleTrackClick = function () {
324
+ // if we have old location set marker, map and value
325
+ setToCurrentLocation();
326
+ resetLocationTracking();
327
+ };
328
+
329
+ var mapClickHandler = function (ev) {
330
+ var newPos = [ev.latlng.lat, ev.latlng.lng];
331
+
332
+ if (doubleClickTimerRef.current === null) {
333
+ doubleClickTimerRef.current = window.setTimeout(function () {
334
+ handleMapClick(newPos);
335
+ doubleClickTimerRef.current = null;
336
+ }, 300);
337
+ } else {
338
+ window.clearTimeout(doubleClickTimerRef.current);
339
+ doubleClickTimerRef.current = null;
340
+ }
341
+ };
342
+
343
+ var setToCurrentLocation = useCallback(function () {
344
+ if (!location) return;
345
+ var newPos = [location.coords.latitude, location.coords.longitude];
346
+ var marker = getMarkersFromPositions([newPos]);
347
+ setMarkers(marker);
348
+ flyToPosition(newPos, 14);
349
+ setValue({
350
+ description: '',
351
+ position: newPos
352
+ });
353
+ }, [flyToPosition, getMarkersFromPositions, location]);
354
+
355
+ var toggleViewState = function () {
356
+ setUseMapView(function (prev) {
357
+ return !prev;
358
+ });
359
+ };
360
+
361
+ useEffect(function () {
362
+ if (isEnabled && location && !error) {
363
+ setToCurrentLocation();
364
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
365
+
366
+ }, [error, location, isEnabled]);
367
+ useEffect(function () {
368
+ setValue({
369
+ description: '',
370
+ position: undefined
371
+ }); // recalculate map on view change
372
+
373
+ if (useMapView) {
374
+ recalculateMapSize();
375
+ setDescValue('');
376
+ } else {
377
+ setMarkers([]);
378
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
379
+
380
+ }, [useMapView, recalculateMapSize, descValue]);
381
+ useUpdateEffect(function () {
382
+ var _a, _b, _c, _d;
383
+
384
+ var prev = prevValue.current;
385
+
386
+ if (!prev || prev.description !== getValue.description || ((_a = prev.position) === null || _a === void 0 ? void 0 : _a[0]) !== ((_b = getValue.position) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = prev.position) === null || _c === void 0 ? void 0 : _c[1]) !== ((_d = getValue.position) === null || _d === void 0 ? void 0 : _d[1])) {
387
+ prevValue.current = getValue;
388
+ onChange === null || onChange === void 0 ? void 0 : onChange(getValue);
389
+ }
390
+ }, [getValue]);
391
+ return React__default.createElement(React__default.Fragment, null, name && React__default.createElement("input", {
392
+ type: "hidden",
393
+ name: "".concat(name, "[\"location\"]"),
394
+ value: "".concat((_b = getValue === null || getValue === void 0 ? void 0 : getValue.position) === null || _b === void 0 ? void 0 : _b[0], ",").concat((_c = getValue === null || getValue === void 0 ? void 0 : getValue.position) === null || _c === void 0 ? void 0 : _c[1])
395
+ }), React__default.createElement(FieldWrapper$1.View, {
396
+ isDisabled: isDisabled,
397
+ onClick: function (ev) {
398
+ return ev.preventDefault();
399
+ }
400
+ }, React__default.createElement(FieldWrapper$1.Head, {
401
+ label: label,
402
+ isRequired: isRequired,
403
+ isInverted: isInverted
404
+ }), customToggle ? customToggle({
405
+ isInverted: isInverted,
406
+ viewState: useMapView ? 'map' : 'desc',
407
+ handleClick: toggleViewState
408
+ }) : React__default.createElement(ViewToggle, {
409
+ type: "button",
410
+ onClick: toggleViewState
411
+ }, useMapView ? React__default.createElement(ToggleOn, {
412
+ iconColor: isInverted ? colors.primary.inverted : colors.primary.default
413
+ }) : React__default.createElement(ToggleOff, {
414
+ iconColor: isInverted ? fonts.copy.small.colorInverted : fonts.copy.small.color
415
+ }), React__default.createElement(ToggleText, {
416
+ size: "small",
417
+ renderAs: "span",
418
+ isInverted: isInverted
419
+ }, toggleLabel)), React__default.createElement(MapWrapper, {
420
+ isVisible: useMapView
421
+ }, React__default.createElement(MapContainer, {
422
+ ref: setMapContainer,
423
+ tabIndex: 0,
424
+ onClick: function () {
425
+ forceUpdate();
426
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(getValue);
427
+ }
428
+ }), React__default.createElement(ResetMap, null, customResetControl ? customResetControl({
429
+ isInverted: isInverted,
430
+ handleClick: setMapToInitial
431
+ }) : React__default.createElement(ResetMapControl, {
432
+ onClick: setMapToInitial
433
+ }, React__default.createElement(LocationSearch, null))), isGeolocationSupported && React__default.createElement(TrackLocation, null, customLocationControl ? customLocationControl({
434
+ isInverted: isInverted,
435
+ handleClick: handleTrackClick
436
+ }) : React__default.createElement(TrackLocationControl, {
437
+ onClick: handleTrackClick
438
+ }, trackLocationLabel))), !useMapView && React__default.createElement(React__default.Fragment, null, React__default.createElement(FieldView$1, null, React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(Area$1, {
439
+ placeholder: placeholder,
440
+ hasError: !!errorMessage,
441
+ isInverted: isInverted,
442
+ name: "".concat(name, "[\"description\"]"),
443
+ value: descValue,
444
+ required: isRequired,
445
+ onChange: function (ev) {
446
+ var value = ev.currentTarget.value;
447
+ setDescValue(value);
448
+ },
449
+ onBlur: function () {
450
+ forceUpdate();
451
+ onBlur === null || onBlur === void 0 ? void 0 : onBlur(getValue);
452
+ }
453
+ })))), React__default.createElement(FieldWrapper$1.Messages, {
454
+ infoMessage: infoMessage,
455
+ errorMessage: errorMessage,
456
+ isInverted: isInverted
457
+ })));
458
+ };
459
+ /**
460
+ * Function to compare both field prop states
461
+ * @param prev Previous props
462
+ * @param next Next props
463
+ * @returns
464
+ */
465
+
466
+
467
+ var areEqual$6 = function (prev, next) {
468
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; // only apply logic if memo functionality is enabled
469
+
470
+
471
+ if (!prev.enableMemo) return false;
472
+ if (prev.errorMessage !== next.errorMessage) return false;
473
+ if (prev.infoMessage !== next.infoMessage) return false;
474
+ if (prev.label !== next.label) return false;
475
+ if (prev.toggleLabel !== next.toggleLabel) return false;
476
+ if (prev.placeholder !== next.placeholder) return false;
477
+ if (((_a = prev.value) === null || _a === void 0 ? void 0 : _a.description) !== ((_b = next.value) === null || _b === void 0 ? void 0 : _b.description)) return false;
478
+
479
+ if (((_d = (_c = prev.value) === null || _c === void 0 ? void 0 : _c.position) === null || _d === void 0 ? void 0 : _d[0]) !== ((_f = (_e = next.value) === null || _e === void 0 ? void 0 : _e.position) === null || _f === void 0 ? void 0 : _f[0]) || ((_h = (_g = prev.value) === null || _g === void 0 ? void 0 : _g.position) === null || _h === void 0 ? void 0 : _h[1]) !== ((_k = (_j = next.value) === null || _j === void 0 ? void 0 : _j.position) === null || _k === void 0 ? void 0 : _k[1])) {
480
+ return false;
481
+ }
482
+
483
+ return true;
484
+ };
485
+
486
+ var LocationField$1 = React__default.memo(LocationField, areEqual$6);
487
+ var templateObject_1$6, templateObject_2$4, templateObject_3$4, templateObject_4$4, templateObject_5$4, templateObject_6$4, templateObject_7$3, templateObject_8$2, templateObject_9$2, templateObject_10;
488
+
489
+ function toInteger(dirtyNumber) {
490
+ if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
491
+ return NaN;
492
+ }
493
+
494
+ var number = Number(dirtyNumber);
495
+
496
+ if (isNaN(number)) {
497
+ return number;
498
+ }
499
+
500
+ return number < 0 ? Math.ceil(number) : Math.floor(number);
501
+ }
502
+
503
+ function requiredArgs(required, args) {
504
+ if (args.length < required) {
505
+ throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');
506
+ }
507
+ }
508
+
509
+ /**
510
+ * @name toDate
511
+ * @category Common Helpers
512
+ * @summary Convert the given argument to an instance of Date.
513
+ *
514
+ * @description
515
+ * Convert the given argument to an instance of Date.
516
+ *
517
+ * If the argument is an instance of Date, the function returns its clone.
518
+ *
519
+ * If the argument is a number, it is treated as a timestamp.
520
+ *
521
+ * If the argument is none of the above, the function returns Invalid Date.
522
+ *
523
+ * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.
524
+ *
525
+ * @param {Date|Number} argument - the value to convert
526
+ * @returns {Date} the parsed date in the local time zone
527
+ * @throws {TypeError} 1 argument required
528
+ *
529
+ * @example
530
+ * // Clone the date:
531
+ * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
532
+ * //=> Tue Feb 11 2014 11:30:30
533
+ *
534
+ * @example
535
+ * // Convert the timestamp to date:
536
+ * const result = toDate(1392098430000)
537
+ * //=> Tue Feb 11 2014 11:30:30
538
+ */
539
+
540
+ function toDate(argument) {
541
+ requiredArgs(1, arguments);
542
+ var argStr = Object.prototype.toString.call(argument); // Clone the date
543
+
544
+ if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {
545
+ // Prevent the date to lose the milliseconds when passed to new Date() in IE10
546
+ return new Date(argument.getTime());
547
+ } else if (typeof argument === 'number' || argStr === '[object Number]') {
548
+ return new Date(argument);
549
+ } else {
550
+ if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {
551
+ // eslint-disable-next-line no-console
552
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"); // eslint-disable-next-line no-console
553
+
554
+ console.warn(new Error().stack);
555
+ }
556
+
557
+ return new Date(NaN);
558
+ }
559
+ }
560
+
561
+ /**
562
+ * @name addMilliseconds
563
+ * @category Millisecond Helpers
564
+ * @summary Add the specified number of milliseconds to the given date.
565
+ *
566
+ * @description
567
+ * Add the specified number of milliseconds to the given date.
568
+ *
569
+ * ### v2.0.0 breaking changes:
570
+ *
571
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
572
+ *
573
+ * @param {Date|Number} date - the date to be changed
574
+ * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
575
+ * @returns {Date} the new date with the milliseconds added
576
+ * @throws {TypeError} 2 arguments required
577
+ *
578
+ * @example
579
+ * // Add 750 milliseconds to 10 July 2014 12:45:30.000:
580
+ * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
581
+ * //=> Thu Jul 10 2014 12:45:30.750
582
+ */
583
+
584
+ function addMilliseconds(dirtyDate, dirtyAmount) {
585
+ requiredArgs(2, arguments);
586
+ var timestamp = toDate(dirtyDate).getTime();
587
+ var amount = toInteger(dirtyAmount);
588
+ return new Date(timestamp + amount);
589
+ }
590
+
591
+ /**
592
+ * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.
593
+ * They usually appear for dates that denote time before the timezones were introduced
594
+ * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891
595
+ * and GMT+01:00:00 after that date)
596
+ *
597
+ * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,
598
+ * which would lead to incorrect calculations.
599
+ *
600
+ * This function returns the timezone offset in milliseconds that takes seconds in account.
601
+ */
602
+ function getTimezoneOffsetInMilliseconds(date) {
603
+ var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
604
+ utcDate.setUTCFullYear(date.getFullYear());
605
+ return date.getTime() - utcDate.getTime();
606
+ }
607
+
608
+ /**
609
+ * @name isDate
610
+ * @category Common Helpers
611
+ * @summary Is the given value a date?
612
+ *
613
+ * @description
614
+ * Returns true if the given value is an instance of Date. The function works for dates transferred across iframes.
615
+ *
616
+ * ### v2.0.0 breaking changes:
617
+ *
618
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
619
+ *
620
+ * @param {*} value - the value to check
621
+ * @returns {boolean} true if the given value is a date
622
+ * @throws {TypeError} 1 arguments required
623
+ *
624
+ * @example
625
+ * // For a valid date:
626
+ * const result = isDate(new Date())
627
+ * //=> true
628
+ *
629
+ * @example
630
+ * // For an invalid date:
631
+ * const result = isDate(new Date(NaN))
632
+ * //=> true
633
+ *
634
+ * @example
635
+ * // For some value:
636
+ * const result = isDate('2014-02-31')
637
+ * //=> false
638
+ *
639
+ * @example
640
+ * // For an object:
641
+ * const result = isDate({})
642
+ * //=> false
643
+ */
644
+
645
+ function isDate(value) {
646
+ requiredArgs(1, arguments);
647
+ return value instanceof Date || typeof value === 'object' && Object.prototype.toString.call(value) === '[object Date]';
648
+ }
649
+
650
+ /**
651
+ * @name isValid
652
+ * @category Common Helpers
653
+ * @summary Is the given date valid?
654
+ *
655
+ * @description
656
+ * Returns false if argument is Invalid Date and true otherwise.
657
+ * Argument is converted to Date using `toDate`. See [toDate]{@link https://date-fns.org/docs/toDate}
658
+ * Invalid Date is a Date, whose time value is NaN.
659
+ *
660
+ * Time value of Date: http://es5.github.io/#x15.9.1.1
661
+ *
662
+ * ### v2.0.0 breaking changes:
663
+ *
664
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
665
+ *
666
+ * - Now `isValid` doesn't throw an exception
667
+ * if the first argument is not an instance of Date.
668
+ * Instead, argument is converted beforehand using `toDate`.
669
+ *
670
+ * Examples:
671
+ *
672
+ * | `isValid` argument | Before v2.0.0 | v2.0.0 onward |
673
+ * |---------------------------|---------------|---------------|
674
+ * | `new Date()` | `true` | `true` |
675
+ * | `new Date('2016-01-01')` | `true` | `true` |
676
+ * | `new Date('')` | `false` | `false` |
677
+ * | `new Date(1488370835081)` | `true` | `true` |
678
+ * | `new Date(NaN)` | `false` | `false` |
679
+ * | `'2016-01-01'` | `TypeError` | `false` |
680
+ * | `''` | `TypeError` | `false` |
681
+ * | `1488370835081` | `TypeError` | `true` |
682
+ * | `NaN` | `TypeError` | `false` |
683
+ *
684
+ * We introduce this change to make *date-fns* consistent with ECMAScript behavior
685
+ * that try to coerce arguments to the expected type
686
+ * (which is also the case with other *date-fns* functions).
687
+ *
688
+ * @param {*} date - the date to check
689
+ * @returns {Boolean} the date is valid
690
+ * @throws {TypeError} 1 argument required
691
+ *
692
+ * @example
693
+ * // For the valid date:
694
+ * const result = isValid(new Date(2014, 1, 31))
695
+ * //=> true
696
+ *
697
+ * @example
698
+ * // For the value, convertable into a date:
699
+ * const result = isValid(1393804800000)
700
+ * //=> true
701
+ *
702
+ * @example
703
+ * // For the invalid date:
704
+ * const result = isValid(new Date(''))
705
+ * //=> false
706
+ */
707
+
708
+ function isValid(dirtyDate) {
709
+ requiredArgs(1, arguments);
710
+
711
+ if (!isDate(dirtyDate) && typeof dirtyDate !== 'number') {
712
+ return false;
713
+ }
714
+
715
+ var date = toDate(dirtyDate);
716
+ return !isNaN(Number(date));
717
+ }
718
+
719
+ var formatDistanceLocale$1 = {
720
+ lessThanXSeconds: {
721
+ one: 'less than a second',
722
+ other: 'less than {{count}} seconds'
723
+ },
724
+ xSeconds: {
725
+ one: '1 second',
726
+ other: '{{count}} seconds'
727
+ },
728
+ halfAMinute: 'half a minute',
729
+ lessThanXMinutes: {
730
+ one: 'less than a minute',
731
+ other: 'less than {{count}} minutes'
732
+ },
733
+ xMinutes: {
734
+ one: '1 minute',
735
+ other: '{{count}} minutes'
736
+ },
737
+ aboutXHours: {
738
+ one: 'about 1 hour',
739
+ other: 'about {{count}} hours'
740
+ },
741
+ xHours: {
742
+ one: '1 hour',
743
+ other: '{{count}} hours'
744
+ },
745
+ xDays: {
746
+ one: '1 day',
747
+ other: '{{count}} days'
748
+ },
749
+ aboutXWeeks: {
750
+ one: 'about 1 week',
751
+ other: 'about {{count}} weeks'
752
+ },
753
+ xWeeks: {
754
+ one: '1 week',
755
+ other: '{{count}} weeks'
756
+ },
757
+ aboutXMonths: {
758
+ one: 'about 1 month',
759
+ other: 'about {{count}} months'
760
+ },
761
+ xMonths: {
762
+ one: '1 month',
763
+ other: '{{count}} months'
764
+ },
765
+ aboutXYears: {
766
+ one: 'about 1 year',
767
+ other: 'about {{count}} years'
768
+ },
769
+ xYears: {
770
+ one: '1 year',
771
+ other: '{{count}} years'
772
+ },
773
+ overXYears: {
774
+ one: 'over 1 year',
775
+ other: 'over {{count}} years'
776
+ },
777
+ almostXYears: {
778
+ one: 'almost 1 year',
779
+ other: 'almost {{count}} years'
780
+ }
781
+ };
782
+
783
+ var formatDistance$1 = function (token, count, options) {
784
+ var result;
785
+ var tokenValue = formatDistanceLocale$1[token];
786
+
787
+ if (typeof tokenValue === 'string') {
788
+ result = tokenValue;
789
+ } else if (count === 1) {
790
+ result = tokenValue.one;
791
+ } else {
792
+ result = tokenValue.other.replace('{{count}}', count.toString());
793
+ }
794
+
795
+ if (options !== null && options !== void 0 && options.addSuffix) {
796
+ if (options.comparison && options.comparison > 0) {
797
+ return 'in ' + result;
798
+ } else {
799
+ return result + ' ago';
800
+ }
801
+ }
802
+
803
+ return result;
804
+ };
805
+
806
+ function buildFormatLongFn(args) {
807
+ return function () {
808
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; // TODO: Remove String()
809
+
810
+ var width = options.width ? String(options.width) : args.defaultWidth;
811
+ var format = args.formats[width] || args.formats[args.defaultWidth];
812
+ return format;
813
+ };
814
+ }
815
+
816
+ var dateFormats$1 = {
817
+ full: 'EEEE, MMMM do, y',
818
+ long: 'MMMM do, y',
819
+ medium: 'MMM d, y',
820
+ short: 'MM/dd/yyyy'
821
+ };
822
+ var timeFormats$1 = {
823
+ full: 'h:mm:ss a zzzz',
824
+ long: 'h:mm:ss a z',
825
+ medium: 'h:mm:ss a',
826
+ short: 'h:mm a'
827
+ };
828
+ var dateTimeFormats$1 = {
829
+ full: "{{date}} 'at' {{time}}",
830
+ long: "{{date}} 'at' {{time}}",
831
+ medium: '{{date}}, {{time}}',
832
+ short: '{{date}}, {{time}}'
833
+ };
834
+ var formatLong$1 = {
835
+ date: buildFormatLongFn({
836
+ formats: dateFormats$1,
837
+ defaultWidth: 'full'
838
+ }),
839
+ time: buildFormatLongFn({
840
+ formats: timeFormats$1,
841
+ defaultWidth: 'full'
842
+ }),
843
+ dateTime: buildFormatLongFn({
844
+ formats: dateTimeFormats$1,
845
+ defaultWidth: 'full'
846
+ })
847
+ };
848
+
849
+ var formatRelativeLocale$1 = {
850
+ lastWeek: "'last' eeee 'at' p",
851
+ yesterday: "'yesterday at' p",
852
+ today: "'today at' p",
853
+ tomorrow: "'tomorrow at' p",
854
+ nextWeek: "eeee 'at' p",
855
+ other: 'P'
856
+ };
857
+
858
+ var formatRelative$1 = function (token, _date, _baseDate, _options) {
859
+ return formatRelativeLocale$1[token];
860
+ };
861
+
862
+ function buildLocalizeFn(args) {
863
+ return function (dirtyIndex, dirtyOptions) {
864
+ var options = dirtyOptions || {};
865
+ var context = options.context ? String(options.context) : 'standalone';
866
+ var valuesArray;
867
+
868
+ if (context === 'formatting' && args.formattingValues) {
869
+ var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
870
+ var width = options.width ? String(options.width) : defaultWidth;
871
+ valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
872
+ } else {
873
+ var _defaultWidth = args.defaultWidth;
874
+
875
+ var _width = options.width ? String(options.width) : args.defaultWidth;
876
+
877
+ valuesArray = args.values[_width] || args.values[_defaultWidth];
878
+ }
879
+
880
+ var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex; // @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
881
+
882
+ return valuesArray[index];
883
+ };
884
+ }
885
+
886
+ var eraValues$1 = {
887
+ narrow: ['B', 'A'],
888
+ abbreviated: ['BC', 'AD'],
889
+ wide: ['Before Christ', 'Anno Domini']
890
+ };
891
+ var quarterValues$1 = {
892
+ narrow: ['1', '2', '3', '4'],
893
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
894
+ wide: ['1st quarter', '2nd quarter', '3rd quarter', '4th quarter']
895
+ }; // Note: in English, the names of days of the week and months are capitalized.
896
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
897
+ // Generally, formatted dates should look like they are in the middle of a sentence,
898
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
899
+
900
+ var monthValues$1 = {
901
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
902
+ abbreviated: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
903
+ wide: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
904
+ };
905
+ var dayValues$1 = {
906
+ narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
907
+ short: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
908
+ abbreviated: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
909
+ wide: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
910
+ };
911
+ var dayPeriodValues$1 = {
912
+ narrow: {
913
+ am: 'a',
914
+ pm: 'p',
915
+ midnight: 'mi',
916
+ noon: 'n',
917
+ morning: 'morning',
918
+ afternoon: 'afternoon',
919
+ evening: 'evening',
920
+ night: 'night'
921
+ },
922
+ abbreviated: {
923
+ am: 'AM',
924
+ pm: 'PM',
925
+ midnight: 'midnight',
926
+ noon: 'noon',
927
+ morning: 'morning',
928
+ afternoon: 'afternoon',
929
+ evening: 'evening',
930
+ night: 'night'
931
+ },
932
+ wide: {
933
+ am: 'a.m.',
934
+ pm: 'p.m.',
935
+ midnight: 'midnight',
936
+ noon: 'noon',
937
+ morning: 'morning',
938
+ afternoon: 'afternoon',
939
+ evening: 'evening',
940
+ night: 'night'
941
+ }
942
+ };
943
+ var formattingDayPeriodValues$1 = {
944
+ narrow: {
945
+ am: 'a',
946
+ pm: 'p',
947
+ midnight: 'mi',
948
+ noon: 'n',
949
+ morning: 'in the morning',
950
+ afternoon: 'in the afternoon',
951
+ evening: 'in the evening',
952
+ night: 'at night'
953
+ },
954
+ abbreviated: {
955
+ am: 'AM',
956
+ pm: 'PM',
957
+ midnight: 'midnight',
958
+ noon: 'noon',
959
+ morning: 'in the morning',
960
+ afternoon: 'in the afternoon',
961
+ evening: 'in the evening',
962
+ night: 'at night'
963
+ },
964
+ wide: {
965
+ am: 'a.m.',
966
+ pm: 'p.m.',
967
+ midnight: 'midnight',
968
+ noon: 'noon',
969
+ morning: 'in the morning',
970
+ afternoon: 'in the afternoon',
971
+ evening: 'in the evening',
972
+ night: 'at night'
973
+ }
974
+ };
975
+
976
+ var ordinalNumber$1 = function (dirtyNumber, _options) {
977
+ var number = Number(dirtyNumber); // If ordinal numbers depend on context, for example,
978
+ // if they are different for different grammatical genders,
979
+ // use `options.unit`.
980
+ //
981
+ // `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
982
+ // 'day', 'hour', 'minute', 'second'.
983
+
984
+ var rem100 = number % 100;
985
+
986
+ if (rem100 > 20 || rem100 < 10) {
987
+ switch (rem100 % 10) {
988
+ case 1:
989
+ return number + 'st';
990
+
991
+ case 2:
992
+ return number + 'nd';
993
+
994
+ case 3:
995
+ return number + 'rd';
996
+ }
997
+ }
998
+
999
+ return number + 'th';
1000
+ };
1001
+
1002
+ var localize$1 = {
1003
+ ordinalNumber: ordinalNumber$1,
1004
+ era: buildLocalizeFn({
1005
+ values: eraValues$1,
1006
+ defaultWidth: 'wide'
1007
+ }),
1008
+ quarter: buildLocalizeFn({
1009
+ values: quarterValues$1,
1010
+ defaultWidth: 'wide',
1011
+ argumentCallback: function (quarter) {
1012
+ return quarter - 1;
1013
+ }
1014
+ }),
1015
+ month: buildLocalizeFn({
1016
+ values: monthValues$1,
1017
+ defaultWidth: 'wide'
1018
+ }),
1019
+ day: buildLocalizeFn({
1020
+ values: dayValues$1,
1021
+ defaultWidth: 'wide'
1022
+ }),
1023
+ dayPeriod: buildLocalizeFn({
1024
+ values: dayPeriodValues$1,
1025
+ defaultWidth: 'wide',
1026
+ formattingValues: formattingDayPeriodValues$1,
1027
+ defaultFormattingWidth: 'wide'
1028
+ })
1029
+ };
1030
+
1031
+ function buildMatchFn(args) {
1032
+ return function (string) {
1033
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1034
+ var width = options.width;
1035
+ var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
1036
+ var matchResult = string.match(matchPattern);
1037
+
1038
+ if (!matchResult) {
1039
+ return null;
1040
+ }
1041
+
1042
+ var matchedString = matchResult[0];
1043
+ var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
1044
+ var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {
1045
+ return pattern.test(matchedString);
1046
+ }) : findKey(parsePatterns, function (pattern) {
1047
+ return pattern.test(matchedString);
1048
+ });
1049
+ var value;
1050
+ value = args.valueCallback ? args.valueCallback(key) : key;
1051
+ value = options.valueCallback ? options.valueCallback(value) : value;
1052
+ var rest = string.slice(matchedString.length);
1053
+ return {
1054
+ value: value,
1055
+ rest: rest
1056
+ };
1057
+ };
1058
+ }
1059
+
1060
+ function findKey(object, predicate) {
1061
+ for (var key in object) {
1062
+ if (object.hasOwnProperty(key) && predicate(object[key])) {
1063
+ return key;
1064
+ }
1065
+ }
1066
+
1067
+ return undefined;
1068
+ }
1069
+
1070
+ function findIndex(array, predicate) {
1071
+ for (var key = 0; key < array.length; key++) {
1072
+ if (predicate(array[key])) {
1073
+ return key;
1074
+ }
1075
+ }
1076
+
1077
+ return undefined;
1078
+ }
1079
+
1080
+ function buildMatchPatternFn(args) {
1081
+ return function (string) {
1082
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1083
+ var matchResult = string.match(args.matchPattern);
1084
+ if (!matchResult) return null;
1085
+ var matchedString = matchResult[0];
1086
+ var parseResult = string.match(args.parsePattern);
1087
+ if (!parseResult) return null;
1088
+ var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
1089
+ value = options.valueCallback ? options.valueCallback(value) : value;
1090
+ var rest = string.slice(matchedString.length);
1091
+ return {
1092
+ value: value,
1093
+ rest: rest
1094
+ };
1095
+ };
1096
+ }
1097
+
1098
+ var matchOrdinalNumberPattern$1 = /^(\d+)(th|st|nd|rd)?/i;
1099
+ var parseOrdinalNumberPattern$1 = /\d+/i;
1100
+ var matchEraPatterns$1 = {
1101
+ narrow: /^(b|a)/i,
1102
+ abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
1103
+ wide: /^(before christ|before common era|anno domini|common era)/i
1104
+ };
1105
+ var parseEraPatterns$1 = {
1106
+ any: [/^b/i, /^(a|c)/i]
1107
+ };
1108
+ var matchQuarterPatterns$1 = {
1109
+ narrow: /^[1234]/i,
1110
+ abbreviated: /^q[1234]/i,
1111
+ wide: /^[1234](th|st|nd|rd)? quarter/i
1112
+ };
1113
+ var parseQuarterPatterns$1 = {
1114
+ any: [/1/i, /2/i, /3/i, /4/i]
1115
+ };
1116
+ var matchMonthPatterns$1 = {
1117
+ narrow: /^[jfmasond]/i,
1118
+ abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
1119
+ wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
1120
+ };
1121
+ var parseMonthPatterns$1 = {
1122
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
1123
+ any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
1124
+ };
1125
+ var matchDayPatterns$1 = {
1126
+ narrow: /^[smtwf]/i,
1127
+ short: /^(su|mo|tu|we|th|fr|sa)/i,
1128
+ abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
1129
+ wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
1130
+ };
1131
+ var parseDayPatterns$1 = {
1132
+ narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
1133
+ any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
1134
+ };
1135
+ var matchDayPeriodPatterns$1 = {
1136
+ narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
1137
+ any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
1138
+ };
1139
+ var parseDayPeriodPatterns$1 = {
1140
+ any: {
1141
+ am: /^a/i,
1142
+ pm: /^p/i,
1143
+ midnight: /^mi/i,
1144
+ noon: /^no/i,
1145
+ morning: /morning/i,
1146
+ afternoon: /afternoon/i,
1147
+ evening: /evening/i,
1148
+ night: /night/i
1149
+ }
1150
+ };
1151
+ var match$1 = {
1152
+ ordinalNumber: buildMatchPatternFn({
1153
+ matchPattern: matchOrdinalNumberPattern$1,
1154
+ parsePattern: parseOrdinalNumberPattern$1,
1155
+ valueCallback: function (value) {
1156
+ return parseInt(value, 10);
1157
+ }
1158
+ }),
1159
+ era: buildMatchFn({
1160
+ matchPatterns: matchEraPatterns$1,
1161
+ defaultMatchWidth: 'wide',
1162
+ parsePatterns: parseEraPatterns$1,
1163
+ defaultParseWidth: 'any'
1164
+ }),
1165
+ quarter: buildMatchFn({
1166
+ matchPatterns: matchQuarterPatterns$1,
1167
+ defaultMatchWidth: 'wide',
1168
+ parsePatterns: parseQuarterPatterns$1,
1169
+ defaultParseWidth: 'any',
1170
+ valueCallback: function (index) {
1171
+ return index + 1;
1172
+ }
1173
+ }),
1174
+ month: buildMatchFn({
1175
+ matchPatterns: matchMonthPatterns$1,
1176
+ defaultMatchWidth: 'wide',
1177
+ parsePatterns: parseMonthPatterns$1,
1178
+ defaultParseWidth: 'any'
1179
+ }),
1180
+ day: buildMatchFn({
1181
+ matchPatterns: matchDayPatterns$1,
1182
+ defaultMatchWidth: 'wide',
1183
+ parsePatterns: parseDayPatterns$1,
1184
+ defaultParseWidth: 'any'
1185
+ }),
1186
+ dayPeriod: buildMatchFn({
1187
+ matchPatterns: matchDayPeriodPatterns$1,
1188
+ defaultMatchWidth: 'any',
1189
+ parsePatterns: parseDayPeriodPatterns$1,
1190
+ defaultParseWidth: 'any'
1191
+ })
1192
+ };
1193
+
1194
+ /**
1195
+ * @type {Locale}
1196
+ * @category Locales
1197
+ * @summary English locale (United States).
1198
+ * @language English
1199
+ * @iso-639-2 eng
1200
+ * @author Sasha Koss [@kossnocorp]{@link https://github.com/kossnocorp}
1201
+ * @author Lesha Koss [@leshakoss]{@link https://github.com/leshakoss}
1202
+ */
1203
+
1204
+ var locale$1 = {
1205
+ code: 'en-US',
1206
+ formatDistance: formatDistance$1,
1207
+ formatLong: formatLong$1,
1208
+ formatRelative: formatRelative$1,
1209
+ localize: localize$1,
1210
+ match: match$1,
1211
+ options: {
1212
+ weekStartsOn: 0
1213
+ /* Sunday */
1214
+ ,
1215
+ firstWeekContainsDate: 1
1216
+ }
1217
+ };
1218
+
1219
+ /**
1220
+ * @name subMilliseconds
1221
+ * @category Millisecond Helpers
1222
+ * @summary Subtract the specified number of milliseconds from the given date.
1223
+ *
1224
+ * @description
1225
+ * Subtract the specified number of milliseconds from the given date.
1226
+ *
1227
+ * ### v2.0.0 breaking changes:
1228
+ *
1229
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
1230
+ *
1231
+ * @param {Date|Number} date - the date to be changed
1232
+ * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.
1233
+ * @returns {Date} the new date with the milliseconds subtracted
1234
+ * @throws {TypeError} 2 arguments required
1235
+ *
1236
+ * @example
1237
+ * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:
1238
+ * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)
1239
+ * //=> Thu Jul 10 2014 12:45:29.250
1240
+ */
1241
+
1242
+ function subMilliseconds(dirtyDate, dirtyAmount) {
1243
+ requiredArgs(2, arguments);
1244
+ var amount = toInteger(dirtyAmount);
1245
+ return addMilliseconds(dirtyDate, -amount);
1246
+ }
1247
+
1248
+ var MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.
1249
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1250
+
1251
+ function getUTCDayOfYear(dirtyDate) {
1252
+ requiredArgs(1, arguments);
1253
+ var date = toDate(dirtyDate);
1254
+ var timestamp = date.getTime();
1255
+ date.setUTCMonth(0, 1);
1256
+ date.setUTCHours(0, 0, 0, 0);
1257
+ var startOfYearTimestamp = date.getTime();
1258
+ var difference = timestamp - startOfYearTimestamp;
1259
+ return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;
1260
+ }
1261
+
1262
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1263
+
1264
+ function startOfUTCISOWeek(dirtyDate) {
1265
+ requiredArgs(1, arguments);
1266
+ var weekStartsOn = 1;
1267
+ var date = toDate(dirtyDate);
1268
+ var day = date.getUTCDay();
1269
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1270
+ date.setUTCDate(date.getUTCDate() - diff);
1271
+ date.setUTCHours(0, 0, 0, 0);
1272
+ return date;
1273
+ }
1274
+
1275
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1276
+
1277
+ function getUTCISOWeekYear(dirtyDate) {
1278
+ requiredArgs(1, arguments);
1279
+ var date = toDate(dirtyDate);
1280
+ var year = date.getUTCFullYear();
1281
+ var fourthOfJanuaryOfNextYear = new Date(0);
1282
+ fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
1283
+ fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
1284
+ var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
1285
+ var fourthOfJanuaryOfThisYear = new Date(0);
1286
+ fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
1287
+ fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
1288
+ var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
1289
+
1290
+ if (date.getTime() >= startOfNextYear.getTime()) {
1291
+ return year + 1;
1292
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
1293
+ return year;
1294
+ } else {
1295
+ return year - 1;
1296
+ }
1297
+ }
1298
+
1299
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1300
+
1301
+ function startOfUTCISOWeekYear(dirtyDate) {
1302
+ requiredArgs(1, arguments);
1303
+ var year = getUTCISOWeekYear(dirtyDate);
1304
+ var fourthOfJanuary = new Date(0);
1305
+ fourthOfJanuary.setUTCFullYear(year, 0, 4);
1306
+ fourthOfJanuary.setUTCHours(0, 0, 0, 0);
1307
+ var date = startOfUTCISOWeek(fourthOfJanuary);
1308
+ return date;
1309
+ }
1310
+
1311
+ var MILLISECONDS_IN_WEEK$1 = 604800000; // This function will be a part of public API when UTC function will be implemented.
1312
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1313
+
1314
+ function getUTCISOWeek(dirtyDate) {
1315
+ requiredArgs(1, arguments);
1316
+ var date = toDate(dirtyDate);
1317
+ var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer
1318
+ // because the number of milliseconds in a week is not constant
1319
+ // (e.g. it's different in the week of the daylight saving time clock shift)
1320
+
1321
+ return Math.round(diff / MILLISECONDS_IN_WEEK$1) + 1;
1322
+ }
1323
+
1324
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1325
+
1326
+ function startOfUTCWeek(dirtyDate, dirtyOptions) {
1327
+ requiredArgs(1, arguments);
1328
+ var options = dirtyOptions || {};
1329
+ var locale = options.locale;
1330
+ var localeWeekStartsOn = locale && locale.options && locale.options.weekStartsOn;
1331
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
1332
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
1333
+
1334
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
1335
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
1336
+ }
1337
+
1338
+ var date = toDate(dirtyDate);
1339
+ var day = date.getUTCDay();
1340
+ var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
1341
+ date.setUTCDate(date.getUTCDate() - diff);
1342
+ date.setUTCHours(0, 0, 0, 0);
1343
+ return date;
1344
+ }
1345
+
1346
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1347
+
1348
+ function getUTCWeekYear(dirtyDate, dirtyOptions) {
1349
+ requiredArgs(1, arguments);
1350
+ var date = toDate(dirtyDate);
1351
+ var year = date.getUTCFullYear();
1352
+ var options = dirtyOptions || {};
1353
+ var locale = options.locale;
1354
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1355
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1356
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
1357
+
1358
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
1359
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
1360
+ }
1361
+
1362
+ var firstWeekOfNextYear = new Date(0);
1363
+ firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
1364
+ firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
1365
+ var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
1366
+ var firstWeekOfThisYear = new Date(0);
1367
+ firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
1368
+ firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
1369
+ var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
1370
+
1371
+ if (date.getTime() >= startOfNextYear.getTime()) {
1372
+ return year + 1;
1373
+ } else if (date.getTime() >= startOfThisYear.getTime()) {
1374
+ return year;
1375
+ } else {
1376
+ return year - 1;
1377
+ }
1378
+ }
1379
+
1380
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1381
+
1382
+ function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
1383
+ requiredArgs(1, arguments);
1384
+ var options = dirtyOptions || {};
1385
+ var locale = options.locale;
1386
+ var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;
1387
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
1388
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
1389
+ var year = getUTCWeekYear(dirtyDate, dirtyOptions);
1390
+ var firstWeek = new Date(0);
1391
+ firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
1392
+ firstWeek.setUTCHours(0, 0, 0, 0);
1393
+ var date = startOfUTCWeek(firstWeek, dirtyOptions);
1394
+ return date;
1395
+ }
1396
+
1397
+ var MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.
1398
+ // See issue: https://github.com/date-fns/date-fns/issues/376
1399
+
1400
+ function getUTCWeek(dirtyDate, options) {
1401
+ requiredArgs(1, arguments);
1402
+ var date = toDate(dirtyDate);
1403
+ var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer
1404
+ // because the number of milliseconds in a week is not constant
1405
+ // (e.g. it's different in the week of the daylight saving time clock shift)
1406
+
1407
+ return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
1408
+ }
1409
+
1410
+ function addLeadingZeros(number, targetLength) {
1411
+ var sign = number < 0 ? '-' : '';
1412
+ var output = Math.abs(number).toString();
1413
+
1414
+ while (output.length < targetLength) {
1415
+ output = '0' + output;
1416
+ }
1417
+
1418
+ return sign + output;
1419
+ }
1420
+
1421
+ /*
1422
+ * | | Unit | | Unit |
1423
+ * |-----|--------------------------------|-----|--------------------------------|
1424
+ * | a | AM, PM | A* | |
1425
+ * | d | Day of month | D | |
1426
+ * | h | Hour [1-12] | H | Hour [0-23] |
1427
+ * | m | Minute | M | Month |
1428
+ * | s | Second | S | Fraction of second |
1429
+ * | y | Year (abs) | Y | |
1430
+ *
1431
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1432
+ */
1433
+
1434
+ var formatters$1 = {
1435
+ // Year
1436
+ y: function (date, token) {
1437
+ // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
1438
+ // | Year | y | yy | yyy | yyyy | yyyyy |
1439
+ // |----------|-------|----|-------|-------|-------|
1440
+ // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
1441
+ // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
1442
+ // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
1443
+ // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
1444
+ // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
1445
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1446
+
1447
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1448
+ return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);
1449
+ },
1450
+ // Month
1451
+ M: function (date, token) {
1452
+ var month = date.getUTCMonth();
1453
+ return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);
1454
+ },
1455
+ // Day of the month
1456
+ d: function (date, token) {
1457
+ return addLeadingZeros(date.getUTCDate(), token.length);
1458
+ },
1459
+ // AM or PM
1460
+ a: function (date, token) {
1461
+ var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';
1462
+
1463
+ switch (token) {
1464
+ case 'a':
1465
+ case 'aa':
1466
+ return dayPeriodEnumValue.toUpperCase();
1467
+
1468
+ case 'aaa':
1469
+ return dayPeriodEnumValue;
1470
+
1471
+ case 'aaaaa':
1472
+ return dayPeriodEnumValue[0];
1473
+
1474
+ case 'aaaa':
1475
+ default:
1476
+ return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';
1477
+ }
1478
+ },
1479
+ // Hour [1-12]
1480
+ h: function (date, token) {
1481
+ return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
1482
+ },
1483
+ // Hour [0-23]
1484
+ H: function (date, token) {
1485
+ return addLeadingZeros(date.getUTCHours(), token.length);
1486
+ },
1487
+ // Minute
1488
+ m: function (date, token) {
1489
+ return addLeadingZeros(date.getUTCMinutes(), token.length);
1490
+ },
1491
+ // Second
1492
+ s: function (date, token) {
1493
+ return addLeadingZeros(date.getUTCSeconds(), token.length);
1494
+ },
1495
+ // Fraction of second
1496
+ S: function (date, token) {
1497
+ var numberOfDigits = token.length;
1498
+ var milliseconds = date.getUTCMilliseconds();
1499
+ var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
1500
+ return addLeadingZeros(fractionalSeconds, token.length);
1501
+ }
1502
+ };
1503
+
1504
+ var dayPeriodEnum = {
1505
+ am: 'am',
1506
+ pm: 'pm',
1507
+ midnight: 'midnight',
1508
+ noon: 'noon',
1509
+ morning: 'morning',
1510
+ afternoon: 'afternoon',
1511
+ evening: 'evening',
1512
+ night: 'night'
1513
+ };
1514
+ /*
1515
+ * | | Unit | | Unit |
1516
+ * |-----|--------------------------------|-----|--------------------------------|
1517
+ * | a | AM, PM | A* | Milliseconds in day |
1518
+ * | b | AM, PM, noon, midnight | B | Flexible day period |
1519
+ * | c | Stand-alone local day of week | C* | Localized hour w/ day period |
1520
+ * | d | Day of month | D | Day of year |
1521
+ * | e | Local day of week | E | Day of week |
1522
+ * | f | | F* | Day of week in month |
1523
+ * | g* | Modified Julian day | G | Era |
1524
+ * | h | Hour [1-12] | H | Hour [0-23] |
1525
+ * | i! | ISO day of week | I! | ISO week of year |
1526
+ * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |
1527
+ * | k | Hour [1-24] | K | Hour [0-11] |
1528
+ * | l* | (deprecated) | L | Stand-alone month |
1529
+ * | m | Minute | M | Month |
1530
+ * | n | | N | |
1531
+ * | o! | Ordinal number modifier | O | Timezone (GMT) |
1532
+ * | p! | Long localized time | P! | Long localized date |
1533
+ * | q | Stand-alone quarter | Q | Quarter |
1534
+ * | r* | Related Gregorian year | R! | ISO week-numbering year |
1535
+ * | s | Second | S | Fraction of second |
1536
+ * | t! | Seconds timestamp | T! | Milliseconds timestamp |
1537
+ * | u | Extended year | U* | Cyclic year |
1538
+ * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |
1539
+ * | w | Local week of year | W* | Week of month |
1540
+ * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |
1541
+ * | y | Year (abs) | Y | Local week-numbering year |
1542
+ * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |
1543
+ *
1544
+ * Letters marked by * are not implemented but reserved by Unicode standard.
1545
+ *
1546
+ * Letters marked by ! are non-standard, but implemented by date-fns:
1547
+ * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)
1548
+ * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,
1549
+ * i.e. 7 for Sunday, 1 for Monday, etc.
1550
+ * - `I` is ISO week of year, as opposed to `w` which is local week of year.
1551
+ * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.
1552
+ * `R` is supposed to be used in conjunction with `I` and `i`
1553
+ * for universal ISO week-numbering date, whereas
1554
+ * `Y` is supposed to be used in conjunction with `w` and `e`
1555
+ * for week-numbering date specific to the locale.
1556
+ * - `P` is long localized date format
1557
+ * - `p` is long localized time format
1558
+ */
1559
+
1560
+ var formatters = {
1561
+ // Era
1562
+ G: function (date, token, localize) {
1563
+ var era = date.getUTCFullYear() > 0 ? 1 : 0;
1564
+
1565
+ switch (token) {
1566
+ // AD, BC
1567
+ case 'G':
1568
+ case 'GG':
1569
+ case 'GGG':
1570
+ return localize.era(era, {
1571
+ width: 'abbreviated'
1572
+ });
1573
+ // A, B
1574
+
1575
+ case 'GGGGG':
1576
+ return localize.era(era, {
1577
+ width: 'narrow'
1578
+ });
1579
+ // Anno Domini, Before Christ
1580
+
1581
+ case 'GGGG':
1582
+ default:
1583
+ return localize.era(era, {
1584
+ width: 'wide'
1585
+ });
1586
+ }
1587
+ },
1588
+ // Year
1589
+ y: function (date, token, localize) {
1590
+ // Ordinal number
1591
+ if (token === 'yo') {
1592
+ var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1593
+
1594
+ var year = signedYear > 0 ? signedYear : 1 - signedYear;
1595
+ return localize.ordinalNumber(year, {
1596
+ unit: 'year'
1597
+ });
1598
+ }
1599
+
1600
+ return formatters$1.y(date, token);
1601
+ },
1602
+ // Local week-numbering year
1603
+ Y: function (date, token, localize, options) {
1604
+ var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)
1605
+
1606
+ var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year
1607
+
1608
+ if (token === 'YY') {
1609
+ var twoDigitYear = weekYear % 100;
1610
+ return addLeadingZeros(twoDigitYear, 2);
1611
+ } // Ordinal number
1612
+
1613
+
1614
+ if (token === 'Yo') {
1615
+ return localize.ordinalNumber(weekYear, {
1616
+ unit: 'year'
1617
+ });
1618
+ } // Padding
1619
+
1620
+
1621
+ return addLeadingZeros(weekYear, token.length);
1622
+ },
1623
+ // ISO week-numbering year
1624
+ R: function (date, token) {
1625
+ var isoWeekYear = getUTCISOWeekYear(date); // Padding
1626
+
1627
+ return addLeadingZeros(isoWeekYear, token.length);
1628
+ },
1629
+ // Extended year. This is a single number designating the year of this calendar system.
1630
+ // The main difference between `y` and `u` localizers are B.C. years:
1631
+ // | Year | `y` | `u` |
1632
+ // |------|-----|-----|
1633
+ // | AC 1 | 1 | 1 |
1634
+ // | BC 1 | 1 | 0 |
1635
+ // | BC 2 | 2 | -1 |
1636
+ // Also `yy` always returns the last two digits of a year,
1637
+ // while `uu` pads single digit years to 2 characters and returns other years unchanged.
1638
+ u: function (date, token) {
1639
+ var year = date.getUTCFullYear();
1640
+ return addLeadingZeros(year, token.length);
1641
+ },
1642
+ // Quarter
1643
+ Q: function (date, token, localize) {
1644
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1645
+
1646
+ switch (token) {
1647
+ // 1, 2, 3, 4
1648
+ case 'Q':
1649
+ return String(quarter);
1650
+ // 01, 02, 03, 04
1651
+
1652
+ case 'QQ':
1653
+ return addLeadingZeros(quarter, 2);
1654
+ // 1st, 2nd, 3rd, 4th
1655
+
1656
+ case 'Qo':
1657
+ return localize.ordinalNumber(quarter, {
1658
+ unit: 'quarter'
1659
+ });
1660
+ // Q1, Q2, Q3, Q4
1661
+
1662
+ case 'QQQ':
1663
+ return localize.quarter(quarter, {
1664
+ width: 'abbreviated',
1665
+ context: 'formatting'
1666
+ });
1667
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1668
+
1669
+ case 'QQQQQ':
1670
+ return localize.quarter(quarter, {
1671
+ width: 'narrow',
1672
+ context: 'formatting'
1673
+ });
1674
+ // 1st quarter, 2nd quarter, ...
1675
+
1676
+ case 'QQQQ':
1677
+ default:
1678
+ return localize.quarter(quarter, {
1679
+ width: 'wide',
1680
+ context: 'formatting'
1681
+ });
1682
+ }
1683
+ },
1684
+ // Stand-alone quarter
1685
+ q: function (date, token, localize) {
1686
+ var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
1687
+
1688
+ switch (token) {
1689
+ // 1, 2, 3, 4
1690
+ case 'q':
1691
+ return String(quarter);
1692
+ // 01, 02, 03, 04
1693
+
1694
+ case 'qq':
1695
+ return addLeadingZeros(quarter, 2);
1696
+ // 1st, 2nd, 3rd, 4th
1697
+
1698
+ case 'qo':
1699
+ return localize.ordinalNumber(quarter, {
1700
+ unit: 'quarter'
1701
+ });
1702
+ // Q1, Q2, Q3, Q4
1703
+
1704
+ case 'qqq':
1705
+ return localize.quarter(quarter, {
1706
+ width: 'abbreviated',
1707
+ context: 'standalone'
1708
+ });
1709
+ // 1, 2, 3, 4 (narrow quarter; could be not numerical)
1710
+
1711
+ case 'qqqqq':
1712
+ return localize.quarter(quarter, {
1713
+ width: 'narrow',
1714
+ context: 'standalone'
1715
+ });
1716
+ // 1st quarter, 2nd quarter, ...
1717
+
1718
+ case 'qqqq':
1719
+ default:
1720
+ return localize.quarter(quarter, {
1721
+ width: 'wide',
1722
+ context: 'standalone'
1723
+ });
1724
+ }
1725
+ },
1726
+ // Month
1727
+ M: function (date, token, localize) {
1728
+ var month = date.getUTCMonth();
1729
+
1730
+ switch (token) {
1731
+ case 'M':
1732
+ case 'MM':
1733
+ return formatters$1.M(date, token);
1734
+ // 1st, 2nd, ..., 12th
1735
+
1736
+ case 'Mo':
1737
+ return localize.ordinalNumber(month + 1, {
1738
+ unit: 'month'
1739
+ });
1740
+ // Jan, Feb, ..., Dec
1741
+
1742
+ case 'MMM':
1743
+ return localize.month(month, {
1744
+ width: 'abbreviated',
1745
+ context: 'formatting'
1746
+ });
1747
+ // J, F, ..., D
1748
+
1749
+ case 'MMMMM':
1750
+ return localize.month(month, {
1751
+ width: 'narrow',
1752
+ context: 'formatting'
1753
+ });
1754
+ // January, February, ..., December
1755
+
1756
+ case 'MMMM':
1757
+ default:
1758
+ return localize.month(month, {
1759
+ width: 'wide',
1760
+ context: 'formatting'
1761
+ });
1762
+ }
1763
+ },
1764
+ // Stand-alone month
1765
+ L: function (date, token, localize) {
1766
+ var month = date.getUTCMonth();
1767
+
1768
+ switch (token) {
1769
+ // 1, 2, ..., 12
1770
+ case 'L':
1771
+ return String(month + 1);
1772
+ // 01, 02, ..., 12
1773
+
1774
+ case 'LL':
1775
+ return addLeadingZeros(month + 1, 2);
1776
+ // 1st, 2nd, ..., 12th
1777
+
1778
+ case 'Lo':
1779
+ return localize.ordinalNumber(month + 1, {
1780
+ unit: 'month'
1781
+ });
1782
+ // Jan, Feb, ..., Dec
1783
+
1784
+ case 'LLL':
1785
+ return localize.month(month, {
1786
+ width: 'abbreviated',
1787
+ context: 'standalone'
1788
+ });
1789
+ // J, F, ..., D
1790
+
1791
+ case 'LLLLL':
1792
+ return localize.month(month, {
1793
+ width: 'narrow',
1794
+ context: 'standalone'
1795
+ });
1796
+ // January, February, ..., December
1797
+
1798
+ case 'LLLL':
1799
+ default:
1800
+ return localize.month(month, {
1801
+ width: 'wide',
1802
+ context: 'standalone'
1803
+ });
1804
+ }
1805
+ },
1806
+ // Local week of year
1807
+ w: function (date, token, localize, options) {
1808
+ var week = getUTCWeek(date, options);
1809
+
1810
+ if (token === 'wo') {
1811
+ return localize.ordinalNumber(week, {
1812
+ unit: 'week'
1813
+ });
1814
+ }
1815
+
1816
+ return addLeadingZeros(week, token.length);
1817
+ },
1818
+ // ISO week of year
1819
+ I: function (date, token, localize) {
1820
+ var isoWeek = getUTCISOWeek(date);
1821
+
1822
+ if (token === 'Io') {
1823
+ return localize.ordinalNumber(isoWeek, {
1824
+ unit: 'week'
1825
+ });
1826
+ }
1827
+
1828
+ return addLeadingZeros(isoWeek, token.length);
1829
+ },
1830
+ // Day of the month
1831
+ d: function (date, token, localize) {
1832
+ if (token === 'do') {
1833
+ return localize.ordinalNumber(date.getUTCDate(), {
1834
+ unit: 'date'
1835
+ });
1836
+ }
1837
+
1838
+ return formatters$1.d(date, token);
1839
+ },
1840
+ // Day of year
1841
+ D: function (date, token, localize) {
1842
+ var dayOfYear = getUTCDayOfYear(date);
1843
+
1844
+ if (token === 'Do') {
1845
+ return localize.ordinalNumber(dayOfYear, {
1846
+ unit: 'dayOfYear'
1847
+ });
1848
+ }
1849
+
1850
+ return addLeadingZeros(dayOfYear, token.length);
1851
+ },
1852
+ // Day of week
1853
+ E: function (date, token, localize) {
1854
+ var dayOfWeek = date.getUTCDay();
1855
+
1856
+ switch (token) {
1857
+ // Tue
1858
+ case 'E':
1859
+ case 'EE':
1860
+ case 'EEE':
1861
+ return localize.day(dayOfWeek, {
1862
+ width: 'abbreviated',
1863
+ context: 'formatting'
1864
+ });
1865
+ // T
1866
+
1867
+ case 'EEEEE':
1868
+ return localize.day(dayOfWeek, {
1869
+ width: 'narrow',
1870
+ context: 'formatting'
1871
+ });
1872
+ // Tu
1873
+
1874
+ case 'EEEEEE':
1875
+ return localize.day(dayOfWeek, {
1876
+ width: 'short',
1877
+ context: 'formatting'
1878
+ });
1879
+ // Tuesday
1880
+
1881
+ case 'EEEE':
1882
+ default:
1883
+ return localize.day(dayOfWeek, {
1884
+ width: 'wide',
1885
+ context: 'formatting'
1886
+ });
1887
+ }
1888
+ },
1889
+ // Local day of week
1890
+ e: function (date, token, localize, options) {
1891
+ var dayOfWeek = date.getUTCDay();
1892
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1893
+
1894
+ switch (token) {
1895
+ // Numerical value (Nth day of week with current locale or weekStartsOn)
1896
+ case 'e':
1897
+ return String(localDayOfWeek);
1898
+ // Padded numerical value
1899
+
1900
+ case 'ee':
1901
+ return addLeadingZeros(localDayOfWeek, 2);
1902
+ // 1st, 2nd, ..., 7th
1903
+
1904
+ case 'eo':
1905
+ return localize.ordinalNumber(localDayOfWeek, {
1906
+ unit: 'day'
1907
+ });
1908
+
1909
+ case 'eee':
1910
+ return localize.day(dayOfWeek, {
1911
+ width: 'abbreviated',
1912
+ context: 'formatting'
1913
+ });
1914
+ // T
1915
+
1916
+ case 'eeeee':
1917
+ return localize.day(dayOfWeek, {
1918
+ width: 'narrow',
1919
+ context: 'formatting'
1920
+ });
1921
+ // Tu
1922
+
1923
+ case 'eeeeee':
1924
+ return localize.day(dayOfWeek, {
1925
+ width: 'short',
1926
+ context: 'formatting'
1927
+ });
1928
+ // Tuesday
1929
+
1930
+ case 'eeee':
1931
+ default:
1932
+ return localize.day(dayOfWeek, {
1933
+ width: 'wide',
1934
+ context: 'formatting'
1935
+ });
1936
+ }
1937
+ },
1938
+ // Stand-alone local day of week
1939
+ c: function (date, token, localize, options) {
1940
+ var dayOfWeek = date.getUTCDay();
1941
+ var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
1942
+
1943
+ switch (token) {
1944
+ // Numerical value (same as in `e`)
1945
+ case 'c':
1946
+ return String(localDayOfWeek);
1947
+ // Padded numerical value
1948
+
1949
+ case 'cc':
1950
+ return addLeadingZeros(localDayOfWeek, token.length);
1951
+ // 1st, 2nd, ..., 7th
1952
+
1953
+ case 'co':
1954
+ return localize.ordinalNumber(localDayOfWeek, {
1955
+ unit: 'day'
1956
+ });
1957
+
1958
+ case 'ccc':
1959
+ return localize.day(dayOfWeek, {
1960
+ width: 'abbreviated',
1961
+ context: 'standalone'
1962
+ });
1963
+ // T
1964
+
1965
+ case 'ccccc':
1966
+ return localize.day(dayOfWeek, {
1967
+ width: 'narrow',
1968
+ context: 'standalone'
1969
+ });
1970
+ // Tu
1971
+
1972
+ case 'cccccc':
1973
+ return localize.day(dayOfWeek, {
1974
+ width: 'short',
1975
+ context: 'standalone'
1976
+ });
1977
+ // Tuesday
1978
+
1979
+ case 'cccc':
1980
+ default:
1981
+ return localize.day(dayOfWeek, {
1982
+ width: 'wide',
1983
+ context: 'standalone'
1984
+ });
1985
+ }
1986
+ },
1987
+ // ISO day of week
1988
+ i: function (date, token, localize) {
1989
+ var dayOfWeek = date.getUTCDay();
1990
+ var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
1991
+
1992
+ switch (token) {
1993
+ // 2
1994
+ case 'i':
1995
+ return String(isoDayOfWeek);
1996
+ // 02
1997
+
1998
+ case 'ii':
1999
+ return addLeadingZeros(isoDayOfWeek, token.length);
2000
+ // 2nd
2001
+
2002
+ case 'io':
2003
+ return localize.ordinalNumber(isoDayOfWeek, {
2004
+ unit: 'day'
2005
+ });
2006
+ // Tue
2007
+
2008
+ case 'iii':
2009
+ return localize.day(dayOfWeek, {
2010
+ width: 'abbreviated',
2011
+ context: 'formatting'
2012
+ });
2013
+ // T
2014
+
2015
+ case 'iiiii':
2016
+ return localize.day(dayOfWeek, {
2017
+ width: 'narrow',
2018
+ context: 'formatting'
2019
+ });
2020
+ // Tu
2021
+
2022
+ case 'iiiiii':
2023
+ return localize.day(dayOfWeek, {
2024
+ width: 'short',
2025
+ context: 'formatting'
2026
+ });
2027
+ // Tuesday
2028
+
2029
+ case 'iiii':
2030
+ default:
2031
+ return localize.day(dayOfWeek, {
2032
+ width: 'wide',
2033
+ context: 'formatting'
2034
+ });
2035
+ }
2036
+ },
2037
+ // AM or PM
2038
+ a: function (date, token, localize) {
2039
+ var hours = date.getUTCHours();
2040
+ var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
2041
+
2042
+ switch (token) {
2043
+ case 'a':
2044
+ case 'aa':
2045
+ return localize.dayPeriod(dayPeriodEnumValue, {
2046
+ width: 'abbreviated',
2047
+ context: 'formatting'
2048
+ });
2049
+
2050
+ case 'aaa':
2051
+ return localize.dayPeriod(dayPeriodEnumValue, {
2052
+ width: 'abbreviated',
2053
+ context: 'formatting'
2054
+ }).toLowerCase();
2055
+
2056
+ case 'aaaaa':
2057
+ return localize.dayPeriod(dayPeriodEnumValue, {
2058
+ width: 'narrow',
2059
+ context: 'formatting'
2060
+ });
2061
+
2062
+ case 'aaaa':
2063
+ default:
2064
+ return localize.dayPeriod(dayPeriodEnumValue, {
2065
+ width: 'wide',
2066
+ context: 'formatting'
2067
+ });
2068
+ }
2069
+ },
2070
+ // AM, PM, midnight, noon
2071
+ b: function (date, token, localize) {
2072
+ var hours = date.getUTCHours();
2073
+ var dayPeriodEnumValue;
2074
+
2075
+ if (hours === 12) {
2076
+ dayPeriodEnumValue = dayPeriodEnum.noon;
2077
+ } else if (hours === 0) {
2078
+ dayPeriodEnumValue = dayPeriodEnum.midnight;
2079
+ } else {
2080
+ dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';
2081
+ }
2082
+
2083
+ switch (token) {
2084
+ case 'b':
2085
+ case 'bb':
2086
+ return localize.dayPeriod(dayPeriodEnumValue, {
2087
+ width: 'abbreviated',
2088
+ context: 'formatting'
2089
+ });
2090
+
2091
+ case 'bbb':
2092
+ return localize.dayPeriod(dayPeriodEnumValue, {
2093
+ width: 'abbreviated',
2094
+ context: 'formatting'
2095
+ }).toLowerCase();
2096
+
2097
+ case 'bbbbb':
2098
+ return localize.dayPeriod(dayPeriodEnumValue, {
2099
+ width: 'narrow',
2100
+ context: 'formatting'
2101
+ });
2102
+
2103
+ case 'bbbb':
2104
+ default:
2105
+ return localize.dayPeriod(dayPeriodEnumValue, {
2106
+ width: 'wide',
2107
+ context: 'formatting'
2108
+ });
2109
+ }
2110
+ },
2111
+ // in the morning, in the afternoon, in the evening, at night
2112
+ B: function (date, token, localize) {
2113
+ var hours = date.getUTCHours();
2114
+ var dayPeriodEnumValue;
2115
+
2116
+ if (hours >= 17) {
2117
+ dayPeriodEnumValue = dayPeriodEnum.evening;
2118
+ } else if (hours >= 12) {
2119
+ dayPeriodEnumValue = dayPeriodEnum.afternoon;
2120
+ } else if (hours >= 4) {
2121
+ dayPeriodEnumValue = dayPeriodEnum.morning;
2122
+ } else {
2123
+ dayPeriodEnumValue = dayPeriodEnum.night;
2124
+ }
2125
+
2126
+ switch (token) {
2127
+ case 'B':
2128
+ case 'BB':
2129
+ case 'BBB':
2130
+ return localize.dayPeriod(dayPeriodEnumValue, {
2131
+ width: 'abbreviated',
2132
+ context: 'formatting'
2133
+ });
2134
+
2135
+ case 'BBBBB':
2136
+ return localize.dayPeriod(dayPeriodEnumValue, {
2137
+ width: 'narrow',
2138
+ context: 'formatting'
2139
+ });
2140
+
2141
+ case 'BBBB':
2142
+ default:
2143
+ return localize.dayPeriod(dayPeriodEnumValue, {
2144
+ width: 'wide',
2145
+ context: 'formatting'
2146
+ });
2147
+ }
2148
+ },
2149
+ // Hour [1-12]
2150
+ h: function (date, token, localize) {
2151
+ if (token === 'ho') {
2152
+ var hours = date.getUTCHours() % 12;
2153
+ if (hours === 0) hours = 12;
2154
+ return localize.ordinalNumber(hours, {
2155
+ unit: 'hour'
2156
+ });
2157
+ }
2158
+
2159
+ return formatters$1.h(date, token);
2160
+ },
2161
+ // Hour [0-23]
2162
+ H: function (date, token, localize) {
2163
+ if (token === 'Ho') {
2164
+ return localize.ordinalNumber(date.getUTCHours(), {
2165
+ unit: 'hour'
2166
+ });
2167
+ }
2168
+
2169
+ return formatters$1.H(date, token);
2170
+ },
2171
+ // Hour [0-11]
2172
+ K: function (date, token, localize) {
2173
+ var hours = date.getUTCHours() % 12;
2174
+
2175
+ if (token === 'Ko') {
2176
+ return localize.ordinalNumber(hours, {
2177
+ unit: 'hour'
2178
+ });
2179
+ }
2180
+
2181
+ return addLeadingZeros(hours, token.length);
2182
+ },
2183
+ // Hour [1-24]
2184
+ k: function (date, token, localize) {
2185
+ var hours = date.getUTCHours();
2186
+ if (hours === 0) hours = 24;
2187
+
2188
+ if (token === 'ko') {
2189
+ return localize.ordinalNumber(hours, {
2190
+ unit: 'hour'
2191
+ });
2192
+ }
2193
+
2194
+ return addLeadingZeros(hours, token.length);
2195
+ },
2196
+ // Minute
2197
+ m: function (date, token, localize) {
2198
+ if (token === 'mo') {
2199
+ return localize.ordinalNumber(date.getUTCMinutes(), {
2200
+ unit: 'minute'
2201
+ });
2202
+ }
2203
+
2204
+ return formatters$1.m(date, token);
2205
+ },
2206
+ // Second
2207
+ s: function (date, token, localize) {
2208
+ if (token === 'so') {
2209
+ return localize.ordinalNumber(date.getUTCSeconds(), {
2210
+ unit: 'second'
2211
+ });
2212
+ }
2213
+
2214
+ return formatters$1.s(date, token);
2215
+ },
2216
+ // Fraction of second
2217
+ S: function (date, token) {
2218
+ return formatters$1.S(date, token);
2219
+ },
2220
+ // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
2221
+ X: function (date, token, _localize, options) {
2222
+ var originalDate = options._originalDate || date;
2223
+ var timezoneOffset = originalDate.getTimezoneOffset();
2224
+
2225
+ if (timezoneOffset === 0) {
2226
+ return 'Z';
2227
+ }
2228
+
2229
+ switch (token) {
2230
+ // Hours and optional minutes
2231
+ case 'X':
2232
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2233
+ // Hours, minutes and optional seconds without `:` delimiter
2234
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2235
+ // so this token always has the same output as `XX`
2236
+
2237
+ case 'XXXX':
2238
+ case 'XX':
2239
+ // Hours and minutes without `:` delimiter
2240
+ return formatTimezone(timezoneOffset);
2241
+ // Hours, minutes and optional seconds with `:` delimiter
2242
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2243
+ // so this token always has the same output as `XXX`
2244
+
2245
+ case 'XXXXX':
2246
+ case 'XXX': // Hours and minutes with `:` delimiter
2247
+
2248
+ default:
2249
+ return formatTimezone(timezoneOffset, ':');
2250
+ }
2251
+ },
2252
+ // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
2253
+ x: function (date, token, _localize, options) {
2254
+ var originalDate = options._originalDate || date;
2255
+ var timezoneOffset = originalDate.getTimezoneOffset();
2256
+
2257
+ switch (token) {
2258
+ // Hours and optional minutes
2259
+ case 'x':
2260
+ return formatTimezoneWithOptionalMinutes(timezoneOffset);
2261
+ // Hours, minutes and optional seconds without `:` delimiter
2262
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2263
+ // so this token always has the same output as `xx`
2264
+
2265
+ case 'xxxx':
2266
+ case 'xx':
2267
+ // Hours and minutes without `:` delimiter
2268
+ return formatTimezone(timezoneOffset);
2269
+ // Hours, minutes and optional seconds with `:` delimiter
2270
+ // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
2271
+ // so this token always has the same output as `xxx`
2272
+
2273
+ case 'xxxxx':
2274
+ case 'xxx': // Hours and minutes with `:` delimiter
2275
+
2276
+ default:
2277
+ return formatTimezone(timezoneOffset, ':');
2278
+ }
2279
+ },
2280
+ // Timezone (GMT)
2281
+ O: function (date, token, _localize, options) {
2282
+ var originalDate = options._originalDate || date;
2283
+ var timezoneOffset = originalDate.getTimezoneOffset();
2284
+
2285
+ switch (token) {
2286
+ // Short
2287
+ case 'O':
2288
+ case 'OO':
2289
+ case 'OOO':
2290
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
2291
+ // Long
2292
+
2293
+ case 'OOOO':
2294
+ default:
2295
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
2296
+ }
2297
+ },
2298
+ // Timezone (specific non-location)
2299
+ z: function (date, token, _localize, options) {
2300
+ var originalDate = options._originalDate || date;
2301
+ var timezoneOffset = originalDate.getTimezoneOffset();
2302
+
2303
+ switch (token) {
2304
+ // Short
2305
+ case 'z':
2306
+ case 'zz':
2307
+ case 'zzz':
2308
+ return 'GMT' + formatTimezoneShort(timezoneOffset, ':');
2309
+ // Long
2310
+
2311
+ case 'zzzz':
2312
+ default:
2313
+ return 'GMT' + formatTimezone(timezoneOffset, ':');
2314
+ }
2315
+ },
2316
+ // Seconds timestamp
2317
+ t: function (date, token, _localize, options) {
2318
+ var originalDate = options._originalDate || date;
2319
+ var timestamp = Math.floor(originalDate.getTime() / 1000);
2320
+ return addLeadingZeros(timestamp, token.length);
2321
+ },
2322
+ // Milliseconds timestamp
2323
+ T: function (date, token, _localize, options) {
2324
+ var originalDate = options._originalDate || date;
2325
+ var timestamp = originalDate.getTime();
2326
+ return addLeadingZeros(timestamp, token.length);
2327
+ }
2328
+ };
2329
+
2330
+ function formatTimezoneShort(offset, dirtyDelimiter) {
2331
+ var sign = offset > 0 ? '-' : '+';
2332
+ var absOffset = Math.abs(offset);
2333
+ var hours = Math.floor(absOffset / 60);
2334
+ var minutes = absOffset % 60;
2335
+
2336
+ if (minutes === 0) {
2337
+ return sign + String(hours);
2338
+ }
2339
+
2340
+ var delimiter = dirtyDelimiter || '';
2341
+ return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
2342
+ }
2343
+
2344
+ function formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {
2345
+ if (offset % 60 === 0) {
2346
+ var sign = offset > 0 ? '-' : '+';
2347
+ return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
2348
+ }
2349
+
2350
+ return formatTimezone(offset, dirtyDelimiter);
2351
+ }
2352
+
2353
+ function formatTimezone(offset, dirtyDelimiter) {
2354
+ var delimiter = dirtyDelimiter || '';
2355
+ var sign = offset > 0 ? '-' : '+';
2356
+ var absOffset = Math.abs(offset);
2357
+ var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
2358
+ var minutes = addLeadingZeros(absOffset % 60, 2);
2359
+ return sign + hours + delimiter + minutes;
2360
+ }
2361
+
2362
+ function dateLongFormatter(pattern, formatLong) {
2363
+ switch (pattern) {
2364
+ case 'P':
2365
+ return formatLong.date({
2366
+ width: 'short'
2367
+ });
2368
+
2369
+ case 'PP':
2370
+ return formatLong.date({
2371
+ width: 'medium'
2372
+ });
2373
+
2374
+ case 'PPP':
2375
+ return formatLong.date({
2376
+ width: 'long'
2377
+ });
2378
+
2379
+ case 'PPPP':
2380
+ default:
2381
+ return formatLong.date({
2382
+ width: 'full'
2383
+ });
2384
+ }
2385
+ }
2386
+
2387
+ function timeLongFormatter(pattern, formatLong) {
2388
+ switch (pattern) {
2389
+ case 'p':
2390
+ return formatLong.time({
2391
+ width: 'short'
2392
+ });
2393
+
2394
+ case 'pp':
2395
+ return formatLong.time({
2396
+ width: 'medium'
2397
+ });
2398
+
2399
+ case 'ppp':
2400
+ return formatLong.time({
2401
+ width: 'long'
2402
+ });
2403
+
2404
+ case 'pppp':
2405
+ default:
2406
+ return formatLong.time({
2407
+ width: 'full'
2408
+ });
2409
+ }
2410
+ }
2411
+
2412
+ function dateTimeLongFormatter(pattern, formatLong) {
2413
+ var matchResult = pattern.match(/(P+)(p+)?/) || [];
2414
+ var datePattern = matchResult[1];
2415
+ var timePattern = matchResult[2];
2416
+
2417
+ if (!timePattern) {
2418
+ return dateLongFormatter(pattern, formatLong);
2419
+ }
2420
+
2421
+ var dateTimeFormat;
2422
+
2423
+ switch (datePattern) {
2424
+ case 'P':
2425
+ dateTimeFormat = formatLong.dateTime({
2426
+ width: 'short'
2427
+ });
2428
+ break;
2429
+
2430
+ case 'PP':
2431
+ dateTimeFormat = formatLong.dateTime({
2432
+ width: 'medium'
2433
+ });
2434
+ break;
2435
+
2436
+ case 'PPP':
2437
+ dateTimeFormat = formatLong.dateTime({
2438
+ width: 'long'
2439
+ });
2440
+ break;
2441
+
2442
+ case 'PPPP':
2443
+ default:
2444
+ dateTimeFormat = formatLong.dateTime({
2445
+ width: 'full'
2446
+ });
2447
+ break;
2448
+ }
2449
+
2450
+ return dateTimeFormat.replace('{{date}}', dateLongFormatter(datePattern, formatLong)).replace('{{time}}', timeLongFormatter(timePattern, formatLong));
2451
+ }
2452
+
2453
+ var longFormatters = {
2454
+ p: timeLongFormatter,
2455
+ P: dateTimeLongFormatter
2456
+ };
2457
+
2458
+ var protectedDayOfYearTokens = ['D', 'DD'];
2459
+ var protectedWeekYearTokens = ['YY', 'YYYY'];
2460
+ function isProtectedDayOfYearToken(token) {
2461
+ return protectedDayOfYearTokens.indexOf(token) !== -1;
2462
+ }
2463
+ function isProtectedWeekYearToken(token) {
2464
+ return protectedWeekYearTokens.indexOf(token) !== -1;
2465
+ }
2466
+ function throwProtectedError(token, format, input) {
2467
+ if (token === 'YYYY') {
2468
+ throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2469
+ } else if (token === 'YY') {
2470
+ throw new RangeError("Use `yy` instead of `YY` (in `".concat(format, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2471
+ } else if (token === 'D') {
2472
+ throw new RangeError("Use `d` instead of `D` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2473
+ } else if (token === 'DD') {
2474
+ throw new RangeError("Use `dd` instead of `DD` (in `".concat(format, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
2475
+ }
2476
+ }
2477
+
2478
+ // - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token
2479
+ // (one of the certain letters followed by `o`)
2480
+ // - (\w)\1* matches any sequences of the same letter
2481
+ // - '' matches two quote characters in a row
2482
+ // - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),
2483
+ // except a single quote symbol, which ends the sequence.
2484
+ // Two quote characters do not end the sequence.
2485
+ // If there is no matching single quote
2486
+ // then the sequence will continue until the end of the string.
2487
+ // - . matches any single character unmatched by previous parts of the RegExps
2488
+
2489
+ var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also
2490
+ // sequences of symbols P, p, and the combinations like `PPPPPPPppppp`
2491
+
2492
+ var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
2493
+ var escapedStringRegExp = /^'([^]*?)'?$/;
2494
+ var doubleQuoteRegExp = /''/g;
2495
+ var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
2496
+ /**
2497
+ * @name format
2498
+ * @category Common Helpers
2499
+ * @summary Format the date.
2500
+ *
2501
+ * @description
2502
+ * Return the formatted date string in the given format. The result may vary by locale.
2503
+ *
2504
+ * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
2505
+ * > See: https://git.io/fxCyr
2506
+ *
2507
+ * The characters wrapped between two single quotes characters (') are escaped.
2508
+ * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
2509
+ * (see the last example)
2510
+ *
2511
+ * Format of the string is based on Unicode Technical Standard #35:
2512
+ * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
2513
+ * with a few additions (see note 7 below the table).
2514
+ *
2515
+ * Accepted patterns:
2516
+ * | Unit | Pattern | Result examples | Notes |
2517
+ * |---------------------------------|---------|-----------------------------------|-------|
2518
+ * | Era | G..GGG | AD, BC | |
2519
+ * | | GGGG | Anno Domini, Before Christ | 2 |
2520
+ * | | GGGGG | A, B | |
2521
+ * | Calendar year | y | 44, 1, 1900, 2017 | 5 |
2522
+ * | | yo | 44th, 1st, 0th, 17th | 5,7 |
2523
+ * | | yy | 44, 01, 00, 17 | 5 |
2524
+ * | | yyy | 044, 001, 1900, 2017 | 5 |
2525
+ * | | yyyy | 0044, 0001, 1900, 2017 | 5 |
2526
+ * | | yyyyy | ... | 3,5 |
2527
+ * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
2528
+ * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
2529
+ * | | YY | 44, 01, 00, 17 | 5,8 |
2530
+ * | | YYY | 044, 001, 1900, 2017 | 5 |
2531
+ * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
2532
+ * | | YYYYY | ... | 3,5 |
2533
+ * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
2534
+ * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
2535
+ * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
2536
+ * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
2537
+ * | | RRRRR | ... | 3,5,7 |
2538
+ * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
2539
+ * | | uu | -43, 01, 1900, 2017 | 5 |
2540
+ * | | uuu | -043, 001, 1900, 2017 | 5 |
2541
+ * | | uuuu | -0043, 0001, 1900, 2017 | 5 |
2542
+ * | | uuuuu | ... | 3,5 |
2543
+ * | Quarter (formatting) | Q | 1, 2, 3, 4 | |
2544
+ * | | Qo | 1st, 2nd, 3rd, 4th | 7 |
2545
+ * | | QQ | 01, 02, 03, 04 | |
2546
+ * | | QQQ | Q1, Q2, Q3, Q4 | |
2547
+ * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
2548
+ * | | QQQQQ | 1, 2, 3, 4 | 4 |
2549
+ * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
2550
+ * | | qo | 1st, 2nd, 3rd, 4th | 7 |
2551
+ * | | qq | 01, 02, 03, 04 | |
2552
+ * | | qqq | Q1, Q2, Q3, Q4 | |
2553
+ * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
2554
+ * | | qqqqq | 1, 2, 3, 4 | 4 |
2555
+ * | Month (formatting) | M | 1, 2, ..., 12 | |
2556
+ * | | Mo | 1st, 2nd, ..., 12th | 7 |
2557
+ * | | MM | 01, 02, ..., 12 | |
2558
+ * | | MMM | Jan, Feb, ..., Dec | |
2559
+ * | | MMMM | January, February, ..., December | 2 |
2560
+ * | | MMMMM | J, F, ..., D | |
2561
+ * | Month (stand-alone) | L | 1, 2, ..., 12 | |
2562
+ * | | Lo | 1st, 2nd, ..., 12th | 7 |
2563
+ * | | LL | 01, 02, ..., 12 | |
2564
+ * | | LLL | Jan, Feb, ..., Dec | |
2565
+ * | | LLLL | January, February, ..., December | 2 |
2566
+ * | | LLLLL | J, F, ..., D | |
2567
+ * | Local week of year | w | 1, 2, ..., 53 | |
2568
+ * | | wo | 1st, 2nd, ..., 53th | 7 |
2569
+ * | | ww | 01, 02, ..., 53 | |
2570
+ * | ISO week of year | I | 1, 2, ..., 53 | 7 |
2571
+ * | | Io | 1st, 2nd, ..., 53th | 7 |
2572
+ * | | II | 01, 02, ..., 53 | 7 |
2573
+ * | Day of month | d | 1, 2, ..., 31 | |
2574
+ * | | do | 1st, 2nd, ..., 31st | 7 |
2575
+ * | | dd | 01, 02, ..., 31 | |
2576
+ * | Day of year | D | 1, 2, ..., 365, 366 | 9 |
2577
+ * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
2578
+ * | | DD | 01, 02, ..., 365, 366 | 9 |
2579
+ * | | DDD | 001, 002, ..., 365, 366 | |
2580
+ * | | DDDD | ... | 3 |
2581
+ * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
2582
+ * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
2583
+ * | | EEEEE | M, T, W, T, F, S, S | |
2584
+ * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
2585
+ * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
2586
+ * | | io | 1st, 2nd, ..., 7th | 7 |
2587
+ * | | ii | 01, 02, ..., 07 | 7 |
2588
+ * | | iii | Mon, Tue, Wed, ..., Sun | 7 |
2589
+ * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
2590
+ * | | iiiii | M, T, W, T, F, S, S | 7 |
2591
+ * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
2592
+ * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
2593
+ * | | eo | 2nd, 3rd, ..., 1st | 7 |
2594
+ * | | ee | 02, 03, ..., 01 | |
2595
+ * | | eee | Mon, Tue, Wed, ..., Sun | |
2596
+ * | | eeee | Monday, Tuesday, ..., Sunday | 2 |
2597
+ * | | eeeee | M, T, W, T, F, S, S | |
2598
+ * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
2599
+ * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
2600
+ * | | co | 2nd, 3rd, ..., 1st | 7 |
2601
+ * | | cc | 02, 03, ..., 01 | |
2602
+ * | | ccc | Mon, Tue, Wed, ..., Sun | |
2603
+ * | | cccc | Monday, Tuesday, ..., Sunday | 2 |
2604
+ * | | ccccc | M, T, W, T, F, S, S | |
2605
+ * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
2606
+ * | AM, PM | a..aa | AM, PM | |
2607
+ * | | aaa | am, pm | |
2608
+ * | | aaaa | a.m., p.m. | 2 |
2609
+ * | | aaaaa | a, p | |
2610
+ * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
2611
+ * | | bbb | am, pm, noon, midnight | |
2612
+ * | | bbbb | a.m., p.m., noon, midnight | 2 |
2613
+ * | | bbbbb | a, p, n, mi | |
2614
+ * | Flexible day period | B..BBB | at night, in the morning, ... | |
2615
+ * | | BBBB | at night, in the morning, ... | 2 |
2616
+ * | | BBBBB | at night, in the morning, ... | |
2617
+ * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
2618
+ * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
2619
+ * | | hh | 01, 02, ..., 11, 12 | |
2620
+ * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
2621
+ * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
2622
+ * | | HH | 00, 01, 02, ..., 23 | |
2623
+ * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
2624
+ * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
2625
+ * | | KK | 01, 02, ..., 11, 00 | |
2626
+ * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
2627
+ * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
2628
+ * | | kk | 24, 01, 02, ..., 23 | |
2629
+ * | Minute | m | 0, 1, ..., 59 | |
2630
+ * | | mo | 0th, 1st, ..., 59th | 7 |
2631
+ * | | mm | 00, 01, ..., 59 | |
2632
+ * | Second | s | 0, 1, ..., 59 | |
2633
+ * | | so | 0th, 1st, ..., 59th | 7 |
2634
+ * | | ss | 00, 01, ..., 59 | |
2635
+ * | Fraction of second | S | 0, 1, ..., 9 | |
2636
+ * | | SS | 00, 01, ..., 99 | |
2637
+ * | | SSS | 000, 001, ..., 999 | |
2638
+ * | | SSSS | ... | 3 |
2639
+ * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
2640
+ * | | XX | -0800, +0530, Z | |
2641
+ * | | XXX | -08:00, +05:30, Z | |
2642
+ * | | XXXX | -0800, +0530, Z, +123456 | 2 |
2643
+ * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
2644
+ * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
2645
+ * | | xx | -0800, +0530, +0000 | |
2646
+ * | | xxx | -08:00, +05:30, +00:00 | 2 |
2647
+ * | | xxxx | -0800, +0530, +0000, +123456 | |
2648
+ * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
2649
+ * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
2650
+ * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
2651
+ * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
2652
+ * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
2653
+ * | Seconds timestamp | t | 512969520 | 7 |
2654
+ * | | tt | ... | 3,7 |
2655
+ * | Milliseconds timestamp | T | 512969520900 | 7 |
2656
+ * | | TT | ... | 3,7 |
2657
+ * | Long localized date | P | 04/29/1453 | 7 |
2658
+ * | | PP | Apr 29, 1453 | 7 |
2659
+ * | | PPP | April 29th, 1453 | 7 |
2660
+ * | | PPPP | Friday, April 29th, 1453 | 2,7 |
2661
+ * | Long localized time | p | 12:00 AM | 7 |
2662
+ * | | pp | 12:00:00 AM | 7 |
2663
+ * | | ppp | 12:00:00 AM GMT+2 | 7 |
2664
+ * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
2665
+ * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
2666
+ * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
2667
+ * | | PPPppp | April 29th, 1453 at ... | 7 |
2668
+ * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
2669
+ * Notes:
2670
+ * 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
2671
+ * are the same as "stand-alone" units, but are different in some languages.
2672
+ * "Formatting" units are declined according to the rules of the language
2673
+ * in the context of a date. "Stand-alone" units are always nominative singular:
2674
+ *
2675
+ * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
2676
+ *
2677
+ * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
2678
+ *
2679
+ * 2. Any sequence of the identical letters is a pattern, unless it is escaped by
2680
+ * the single quote characters (see below).
2681
+ * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
2682
+ * the output will be the same as default pattern for this unit, usually
2683
+ * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
2684
+ * are marked with "2" in the last column of the table.
2685
+ *
2686
+ * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
2687
+ *
2688
+ * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
2689
+ *
2690
+ * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
2691
+ *
2692
+ * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
2693
+ *
2694
+ * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
2695
+ *
2696
+ * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
2697
+ * The output will be padded with zeros to match the length of the pattern.
2698
+ *
2699
+ * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
2700
+ *
2701
+ * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
2702
+ * These tokens represent the shortest form of the quarter.
2703
+ *
2704
+ * 5. The main difference between `y` and `u` patterns are B.C. years:
2705
+ *
2706
+ * | Year | `y` | `u` |
2707
+ * |------|-----|-----|
2708
+ * | AC 1 | 1 | 1 |
2709
+ * | BC 1 | 1 | 0 |
2710
+ * | BC 2 | 2 | -1 |
2711
+ *
2712
+ * Also `yy` always returns the last two digits of a year,
2713
+ * while `uu` pads single digit years to 2 characters and returns other years unchanged:
2714
+ *
2715
+ * | Year | `yy` | `uu` |
2716
+ * |------|------|------|
2717
+ * | 1 | 01 | 01 |
2718
+ * | 14 | 14 | 14 |
2719
+ * | 376 | 76 | 376 |
2720
+ * | 1453 | 53 | 1453 |
2721
+ *
2722
+ * The same difference is true for local and ISO week-numbering years (`Y` and `R`),
2723
+ * except local week-numbering years are dependent on `options.weekStartsOn`
2724
+ * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}
2725
+ * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).
2726
+ *
2727
+ * 6. Specific non-location timezones are currently unavailable in `date-fns`,
2728
+ * so right now these tokens fall back to GMT timezones.
2729
+ *
2730
+ * 7. These patterns are not in the Unicode Technical Standard #35:
2731
+ * - `i`: ISO day of week
2732
+ * - `I`: ISO week of year
2733
+ * - `R`: ISO week-numbering year
2734
+ * - `t`: seconds timestamp
2735
+ * - `T`: milliseconds timestamp
2736
+ * - `o`: ordinal number modifier
2737
+ * - `P`: long localized date
2738
+ * - `p`: long localized time
2739
+ *
2740
+ * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
2741
+ * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr
2742
+ *
2743
+ * 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
2744
+ * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr
2745
+ *
2746
+ * ### v2.0.0 breaking changes:
2747
+ *
2748
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2749
+ *
2750
+ * - The second argument is now required for the sake of explicitness.
2751
+ *
2752
+ * ```javascript
2753
+ * // Before v2.0.0
2754
+ * format(new Date(2016, 0, 1))
2755
+ *
2756
+ * // v2.0.0 onward
2757
+ * format(new Date(2016, 0, 1), "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")
2758
+ * ```
2759
+ *
2760
+ * - New format string API for `format` function
2761
+ * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).
2762
+ * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.
2763
+ *
2764
+ * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.
2765
+ *
2766
+ * @param {Date|Number} date - the original date
2767
+ * @param {String} format - the string of tokens
2768
+ * @param {Object} [options] - an object with options.
2769
+ * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}
2770
+ * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)
2771
+ * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is
2772
+ * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;
2773
+ * see: https://git.io/fxCyr
2774
+ * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;
2775
+ * see: https://git.io/fxCyr
2776
+ * @returns {String} the formatted date string
2777
+ * @throws {TypeError} 2 arguments required
2778
+ * @throws {RangeError} `date` must not be Invalid Date
2779
+ * @throws {RangeError} `options.locale` must contain `localize` property
2780
+ * @throws {RangeError} `options.locale` must contain `formatLong` property
2781
+ * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6
2782
+ * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7
2783
+ * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2784
+ * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr
2785
+ * @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
2786
+ * @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
2787
+ * @throws {RangeError} format string contains an unescaped latin alphabet character
2788
+ *
2789
+ * @example
2790
+ * // Represent 11 February 2014 in middle-endian format:
2791
+ * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
2792
+ * //=> '02/11/2014'
2793
+ *
2794
+ * @example
2795
+ * // Represent 2 July 2014 in Esperanto:
2796
+ * import { eoLocale } from 'date-fns/locale/eo'
2797
+ * var result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
2798
+ * locale: eoLocale
2799
+ * })
2800
+ * //=> '2-a de julio 2014'
2801
+ *
2802
+ * @example
2803
+ * // Escape string by single quote characters:
2804
+ * var result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
2805
+ * //=> "3 o'clock"
2806
+ */
2807
+
2808
+ function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
2809
+ requiredArgs(2, arguments);
2810
+ var formatStr = String(dirtyFormatStr);
2811
+ var options = dirtyOptions || {};
2812
+ var locale = options.locale || locale$1;
2813
+ var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;
2814
+ var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
2815
+ var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN
2816
+
2817
+ if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
2818
+ throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');
2819
+ }
2820
+
2821
+ var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;
2822
+ var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
2823
+ var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN
2824
+
2825
+ if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
2826
+ throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');
2827
+ }
2828
+
2829
+ if (!locale.localize) {
2830
+ throw new RangeError('locale must contain localize property');
2831
+ }
2832
+
2833
+ if (!locale.formatLong) {
2834
+ throw new RangeError('locale must contain formatLong property');
2835
+ }
2836
+
2837
+ var originalDate = toDate(dirtyDate);
2838
+
2839
+ if (!isValid(originalDate)) {
2840
+ throw new RangeError('Invalid time value');
2841
+ } // Convert the date in system timezone to the same date in UTC+00:00 timezone.
2842
+ // This ensures that when UTC functions will be implemented, locales will be compatible with them.
2843
+ // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
2844
+
2845
+
2846
+ var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
2847
+ var utcDate = subMilliseconds(originalDate, timezoneOffset);
2848
+ var formatterOptions = {
2849
+ firstWeekContainsDate: firstWeekContainsDate,
2850
+ weekStartsOn: weekStartsOn,
2851
+ locale: locale,
2852
+ _originalDate: originalDate
2853
+ };
2854
+ var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {
2855
+ var firstCharacter = substring[0];
2856
+
2857
+ if (firstCharacter === 'p' || firstCharacter === 'P') {
2858
+ var longFormatter = longFormatters[firstCharacter];
2859
+ return longFormatter(substring, locale.formatLong, formatterOptions);
2860
+ }
2861
+
2862
+ return substring;
2863
+ }).join('').match(formattingTokensRegExp).map(function (substring) {
2864
+ // Replace two single quote characters with one single quote character
2865
+ if (substring === "''") {
2866
+ return "'";
2867
+ }
2868
+
2869
+ var firstCharacter = substring[0];
2870
+
2871
+ if (firstCharacter === "'") {
2872
+ return cleanEscapedString(substring);
2873
+ }
2874
+
2875
+ var formatter = formatters[firstCharacter];
2876
+
2877
+ if (formatter) {
2878
+ if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
2879
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2880
+ }
2881
+
2882
+ if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
2883
+ throwProtectedError(substring, dirtyFormatStr, dirtyDate);
2884
+ }
2885
+
2886
+ return formatter(utcDate, substring, locale.localize, formatterOptions);
2887
+ }
2888
+
2889
+ if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
2890
+ throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');
2891
+ }
2892
+
2893
+ return substring;
2894
+ }).join('');
2895
+ return result;
2896
+ }
2897
+
2898
+ function cleanEscapedString(input) {
2899
+ return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
2900
+ }
2901
+
2902
+ /**
2903
+ * @name isBefore
2904
+ * @category Common Helpers
2905
+ * @summary Is the first date before the second one?
2906
+ *
2907
+ * @description
2908
+ * Is the first date before the second one?
2909
+ *
2910
+ * ### v2.0.0 breaking changes:
2911
+ *
2912
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2913
+ *
2914
+ * @param {Date|Number} date - the date that should be before the other one to return true
2915
+ * @param {Date|Number} dateToCompare - the date to compare with
2916
+ * @returns {Boolean} the first date is before the second date
2917
+ * @throws {TypeError} 2 arguments required
2918
+ *
2919
+ * @example
2920
+ * // Is 10 July 1989 before 11 February 1987?
2921
+ * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))
2922
+ * //=> false
2923
+ */
2924
+
2925
+ function isBefore(dirtyDate, dirtyDateToCompare) {
2926
+ requiredArgs(2, arguments);
2927
+ var date = toDate(dirtyDate);
2928
+ var dateToCompare = toDate(dirtyDateToCompare);
2929
+ return date.getTime() < dateToCompare.getTime();
2930
+ }
2931
+
2932
+ /**
2933
+ * @name isEqual
2934
+ * @category Common Helpers
2935
+ * @summary Are the given dates equal?
2936
+ *
2937
+ * @description
2938
+ * Are the given dates equal?
2939
+ *
2940
+ * ### v2.0.0 breaking changes:
2941
+ *
2942
+ * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
2943
+ *
2944
+ * @param {Date|Number} dateLeft - the first date to compare
2945
+ * @param {Date|Number} dateRight - the second date to compare
2946
+ * @returns {Boolean} the dates are equal
2947
+ * @throws {TypeError} 2 arguments required
2948
+ *
2949
+ * @example
2950
+ * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?
2951
+ * var result = isEqual(
2952
+ * new Date(2014, 6, 2, 6, 30, 45, 0),
2953
+ * new Date(2014, 6, 2, 6, 30, 45, 500)
2954
+ * )
2955
+ * //=> false
2956
+ */
2957
+
2958
+ function isEqual(dirtyLeftDate, dirtyRightDate) {
2959
+ requiredArgs(2, arguments);
2960
+ var dateLeft = toDate(dirtyLeftDate);
2961
+ var dateRight = toDate(dirtyRightDate);
2962
+ return dateLeft.getTime() === dateRight.getTime();
2963
+ }
2964
+
2965
+ var formatDistanceLocale = {
2966
+ lessThanXSeconds: {
2967
+ standalone: {
2968
+ one: 'weniger als 1 Sekunde',
2969
+ other: 'weniger als {{count}} Sekunden'
2970
+ },
2971
+ withPreposition: {
2972
+ one: 'weniger als 1 Sekunde',
2973
+ other: 'weniger als {{count}} Sekunden'
2974
+ }
2975
+ },
2976
+ xSeconds: {
2977
+ standalone: {
2978
+ one: '1 Sekunde',
2979
+ other: '{{count}} Sekunden'
2980
+ },
2981
+ withPreposition: {
2982
+ one: '1 Sekunde',
2983
+ other: '{{count}} Sekunden'
2984
+ }
2985
+ },
2986
+ halfAMinute: {
2987
+ standalone: 'halbe Minute',
2988
+ withPreposition: 'halben Minute'
2989
+ },
2990
+ lessThanXMinutes: {
2991
+ standalone: {
2992
+ one: 'weniger als 1 Minute',
2993
+ other: 'weniger als {{count}} Minuten'
2994
+ },
2995
+ withPreposition: {
2996
+ one: 'weniger als 1 Minute',
2997
+ other: 'weniger als {{count}} Minuten'
2998
+ }
2999
+ },
3000
+ xMinutes: {
3001
+ standalone: {
3002
+ one: '1 Minute',
3003
+ other: '{{count}} Minuten'
3004
+ },
3005
+ withPreposition: {
3006
+ one: '1 Minute',
3007
+ other: '{{count}} Minuten'
3008
+ }
3009
+ },
3010
+ aboutXHours: {
3011
+ standalone: {
3012
+ one: 'etwa 1 Stunde',
3013
+ other: 'etwa {{count}} Stunden'
3014
+ },
3015
+ withPreposition: {
3016
+ one: 'etwa 1 Stunde',
3017
+ other: 'etwa {{count}} Stunden'
3018
+ }
3019
+ },
3020
+ xHours: {
3021
+ standalone: {
3022
+ one: '1 Stunde',
3023
+ other: '{{count}} Stunden'
3024
+ },
3025
+ withPreposition: {
3026
+ one: '1 Stunde',
3027
+ other: '{{count}} Stunden'
3028
+ }
3029
+ },
3030
+ xDays: {
3031
+ standalone: {
3032
+ one: '1 Tag',
3033
+ other: '{{count}} Tage'
3034
+ },
3035
+ withPreposition: {
3036
+ one: '1 Tag',
3037
+ other: '{{count}} Tagen'
3038
+ }
3039
+ },
3040
+ aboutXWeeks: {
3041
+ standalone: {
3042
+ one: 'etwa 1 Woche',
3043
+ other: 'etwa {{count}} Wochen'
3044
+ },
3045
+ withPreposition: {
3046
+ one: 'etwa 1 Woche',
3047
+ other: 'etwa {{count}} Wochen'
3048
+ }
3049
+ },
3050
+ xWeeks: {
3051
+ standalone: {
3052
+ one: '1 Woche',
3053
+ other: '{{count}} Wochen'
3054
+ },
3055
+ withPreposition: {
3056
+ one: '1 Woche',
3057
+ other: '{{count}} Wochen'
3058
+ }
3059
+ },
3060
+ aboutXMonths: {
3061
+ standalone: {
3062
+ one: 'etwa 1 Monat',
3063
+ other: 'etwa {{count}} Monate'
3064
+ },
3065
+ withPreposition: {
3066
+ one: 'etwa 1 Monat',
3067
+ other: 'etwa {{count}} Monaten'
3068
+ }
3069
+ },
3070
+ xMonths: {
3071
+ standalone: {
3072
+ one: '1 Monat',
3073
+ other: '{{count}} Monate'
3074
+ },
3075
+ withPreposition: {
3076
+ one: '1 Monat',
3077
+ other: '{{count}} Monaten'
3078
+ }
3079
+ },
3080
+ aboutXYears: {
3081
+ standalone: {
3082
+ one: 'etwa 1 Jahr',
3083
+ other: 'etwa {{count}} Jahre'
3084
+ },
3085
+ withPreposition: {
3086
+ one: 'etwa 1 Jahr',
3087
+ other: 'etwa {{count}} Jahren'
3088
+ }
3089
+ },
3090
+ xYears: {
3091
+ standalone: {
3092
+ one: '1 Jahr',
3093
+ other: '{{count}} Jahre'
3094
+ },
3095
+ withPreposition: {
3096
+ one: '1 Jahr',
3097
+ other: '{{count}} Jahren'
3098
+ }
3099
+ },
3100
+ overXYears: {
3101
+ standalone: {
3102
+ one: 'mehr als 1 Jahr',
3103
+ other: 'mehr als {{count}} Jahre'
3104
+ },
3105
+ withPreposition: {
3106
+ one: 'mehr als 1 Jahr',
3107
+ other: 'mehr als {{count}} Jahren'
3108
+ }
3109
+ },
3110
+ almostXYears: {
3111
+ standalone: {
3112
+ one: 'fast 1 Jahr',
3113
+ other: 'fast {{count}} Jahre'
3114
+ },
3115
+ withPreposition: {
3116
+ one: 'fast 1 Jahr',
3117
+ other: 'fast {{count}} Jahren'
3118
+ }
3119
+ }
3120
+ };
3121
+
3122
+ var formatDistance = function (token, count, options) {
3123
+ var result;
3124
+ var tokenValue = options !== null && options !== void 0 && options.addSuffix ? formatDistanceLocale[token].withPreposition : formatDistanceLocale[token].standalone;
3125
+
3126
+ if (typeof tokenValue === 'string') {
3127
+ result = tokenValue;
3128
+ } else if (count === 1) {
3129
+ result = tokenValue.one;
3130
+ } else {
3131
+ result = tokenValue.other.replace('{{count}}', String(count));
3132
+ }
3133
+
3134
+ if (options !== null && options !== void 0 && options.addSuffix) {
3135
+ if (options.comparison && options.comparison > 0) {
3136
+ return 'in ' + result;
3137
+ } else {
3138
+ return 'vor ' + result;
3139
+ }
3140
+ }
3141
+
3142
+ return result;
3143
+ };
3144
+
3145
+ var dateFormats = {
3146
+ full: 'EEEE, do MMMM y',
3147
+ // Montag, 7. Januar 2018
3148
+ long: 'do MMMM y',
3149
+ // 7. Januar 2018
3150
+ medium: 'do MMM y',
3151
+ // 7. Jan. 2018
3152
+ short: 'dd.MM.y' // 07.01.2018
3153
+
3154
+ };
3155
+ var timeFormats = {
3156
+ full: 'HH:mm:ss zzzz',
3157
+ long: 'HH:mm:ss z',
3158
+ medium: 'HH:mm:ss',
3159
+ short: 'HH:mm'
3160
+ };
3161
+ var dateTimeFormats = {
3162
+ full: "{{date}} 'um' {{time}}",
3163
+ long: "{{date}} 'um' {{time}}",
3164
+ medium: '{{date}} {{time}}',
3165
+ short: '{{date}} {{time}}'
3166
+ };
3167
+ var formatLong = {
3168
+ date: buildFormatLongFn({
3169
+ formats: dateFormats,
3170
+ defaultWidth: 'full'
3171
+ }),
3172
+ time: buildFormatLongFn({
3173
+ formats: timeFormats,
3174
+ defaultWidth: 'full'
3175
+ }),
3176
+ dateTime: buildFormatLongFn({
3177
+ formats: dateTimeFormats,
3178
+ defaultWidth: 'full'
3179
+ })
3180
+ };
3181
+
3182
+ var formatRelativeLocale = {
3183
+ lastWeek: "'letzten' eeee 'um' p",
3184
+ yesterday: "'gestern um' p",
3185
+ today: "'heute um' p",
3186
+ tomorrow: "'morgen um' p",
3187
+ nextWeek: "eeee 'um' p",
3188
+ other: 'P'
3189
+ };
3190
+
3191
+ var formatRelative = function (token, _date, _baseDate, _options) {
3192
+ return formatRelativeLocale[token];
3193
+ };
3194
+
3195
+ var eraValues = {
3196
+ narrow: ['v.Chr.', 'n.Chr.'],
3197
+ abbreviated: ['v.Chr.', 'n.Chr.'],
3198
+ wide: ['vor Christus', 'nach Christus']
3199
+ };
3200
+ var quarterValues = {
3201
+ narrow: ['1', '2', '3', '4'],
3202
+ abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'],
3203
+ wide: ['1. Quartal', '2. Quartal', '3. Quartal', '4. Quartal']
3204
+ }; // Note: in German, the names of days of the week and months are capitalized.
3205
+ // If you are making a new locale based on this one, check if the same is true for the language you're working on.
3206
+ // Generally, formatted dates should look like they are in the middle of a sentence,
3207
+ // e.g. in Spanish language the weekdays and months should be in the lowercase.
3208
+
3209
+ var monthValues = {
3210
+ narrow: ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'],
3211
+ abbreviated: ['Jan', 'Feb', 'Mär', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez'],
3212
+ wide: ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember']
3213
+ }; // https://st.unicode.org/cldr-apps/v#/de/Gregorian/
3214
+
3215
+ var formattingMonthValues = {
3216
+ narrow: monthValues.narrow,
3217
+ abbreviated: ['Jan.', 'Feb.', 'März', 'Apr.', 'Mai', 'Juni', 'Juli', 'Aug.', 'Sep.', 'Okt.', 'Nov.', 'Dez.'],
3218
+ wide: monthValues.wide
3219
+ };
3220
+ var dayValues = {
3221
+ narrow: ['S', 'M', 'D', 'M', 'D', 'F', 'S'],
3222
+ short: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'],
3223
+ abbreviated: ['So.', 'Mo.', 'Di.', 'Mi.', 'Do.', 'Fr.', 'Sa.'],
3224
+ wide: ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag']
3225
+ }; // https://www.unicode.org/cldr/charts/32/summary/de.html#1881
3226
+
3227
+ var dayPeriodValues = {
3228
+ narrow: {
3229
+ am: 'vm.',
3230
+ pm: 'nm.',
3231
+ midnight: 'Mitternacht',
3232
+ noon: 'Mittag',
3233
+ morning: 'Morgen',
3234
+ afternoon: 'Nachm.',
3235
+ evening: 'Abend',
3236
+ night: 'Nacht'
3237
+ },
3238
+ abbreviated: {
3239
+ am: 'vorm.',
3240
+ pm: 'nachm.',
3241
+ midnight: 'Mitternacht',
3242
+ noon: 'Mittag',
3243
+ morning: 'Morgen',
3244
+ afternoon: 'Nachmittag',
3245
+ evening: 'Abend',
3246
+ night: 'Nacht'
3247
+ },
3248
+ wide: {
3249
+ am: 'vormittags',
3250
+ pm: 'nachmittags',
3251
+ midnight: 'Mitternacht',
3252
+ noon: 'Mittag',
3253
+ morning: 'Morgen',
3254
+ afternoon: 'Nachmittag',
3255
+ evening: 'Abend',
3256
+ night: 'Nacht'
3257
+ }
3258
+ };
3259
+ var formattingDayPeriodValues = {
3260
+ narrow: {
3261
+ am: 'vm.',
3262
+ pm: 'nm.',
3263
+ midnight: 'Mitternacht',
3264
+ noon: 'Mittag',
3265
+ morning: 'morgens',
3266
+ afternoon: 'nachm.',
3267
+ evening: 'abends',
3268
+ night: 'nachts'
3269
+ },
3270
+ abbreviated: {
3271
+ am: 'vorm.',
3272
+ pm: 'nachm.',
3273
+ midnight: 'Mitternacht',
3274
+ noon: 'Mittag',
3275
+ morning: 'morgens',
3276
+ afternoon: 'nachmittags',
3277
+ evening: 'abends',
3278
+ night: 'nachts'
3279
+ },
3280
+ wide: {
3281
+ am: 'vormittags',
3282
+ pm: 'nachmittags',
3283
+ midnight: 'Mitternacht',
3284
+ noon: 'Mittag',
3285
+ morning: 'morgens',
3286
+ afternoon: 'nachmittags',
3287
+ evening: 'abends',
3288
+ night: 'nachts'
3289
+ }
3290
+ };
3291
+
3292
+ var ordinalNumber = function (dirtyNumber) {
3293
+ var number = Number(dirtyNumber);
3294
+ return number + '.';
3295
+ };
3296
+
3297
+ var localize = {
3298
+ ordinalNumber: ordinalNumber,
3299
+ era: buildLocalizeFn({
3300
+ values: eraValues,
3301
+ defaultWidth: 'wide'
3302
+ }),
3303
+ quarter: buildLocalizeFn({
3304
+ values: quarterValues,
3305
+ defaultWidth: 'wide',
3306
+ argumentCallback: function (quarter) {
3307
+ return quarter - 1;
3308
+ }
3309
+ }),
3310
+ month: buildLocalizeFn({
3311
+ values: monthValues,
3312
+ formattingValues: formattingMonthValues,
3313
+ defaultWidth: 'wide'
3314
+ }),
3315
+ day: buildLocalizeFn({
3316
+ values: dayValues,
3317
+ defaultWidth: 'wide'
3318
+ }),
3319
+ dayPeriod: buildLocalizeFn({
3320
+ values: dayPeriodValues,
3321
+ defaultWidth: 'wide',
3322
+ formattingValues: formattingDayPeriodValues,
3323
+ defaultFormattingWidth: 'wide'
3324
+ })
3325
+ };
3326
+
3327
+ var matchOrdinalNumberPattern = /^(\d+)(\.)?/i;
3328
+ var parseOrdinalNumberPattern = /\d+/i;
3329
+ var matchEraPatterns = {
3330
+ narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
3331
+ abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
3332
+ wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
3333
+ };
3334
+ var parseEraPatterns = {
3335
+ any: [/^v/i, /^n/i]
3336
+ };
3337
+ var matchQuarterPatterns = {
3338
+ narrow: /^[1234]/i,
3339
+ abbreviated: /^q[1234]/i,
3340
+ wide: /^[1234](\.)? Quartal/i
3341
+ };
3342
+ var parseQuarterPatterns = {
3343
+ any: [/1/i, /2/i, /3/i, /4/i]
3344
+ };
3345
+ var matchMonthPatterns = {
3346
+ narrow: /^[jfmasond]/i,
3347
+ abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
3348
+ wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
3349
+ };
3350
+ var parseMonthPatterns = {
3351
+ narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
3352
+ any: [/^j[aä]/i, /^f/i, /^mär/i, /^ap/i, /^mai/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
3353
+ };
3354
+ var matchDayPatterns = {
3355
+ narrow: /^[smdmf]/i,
3356
+ short: /^(so|mo|di|mi|do|fr|sa)/i,
3357
+ abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
3358
+ wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
3359
+ };
3360
+ var parseDayPatterns = {
3361
+ any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
3362
+ };
3363
+ var matchDayPeriodPatterns = {
3364
+ narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
3365
+ abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
3366
+ wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
3367
+ };
3368
+ var parseDayPeriodPatterns = {
3369
+ any: {
3370
+ am: /^v/i,
3371
+ pm: /^n/i,
3372
+ midnight: /^Mitte/i,
3373
+ noon: /^Mitta/i,
3374
+ morning: /morgens/i,
3375
+ afternoon: /nachmittags/i,
3376
+ // will never be matched. Afternoon is matched by `pm`
3377
+ evening: /abends/i,
3378
+ night: /nachts/i // will never be matched. Night is matched by `pm`
3379
+
3380
+ }
3381
+ };
3382
+ var match = {
3383
+ ordinalNumber: buildMatchPatternFn({
3384
+ matchPattern: matchOrdinalNumberPattern,
3385
+ parsePattern: parseOrdinalNumberPattern,
3386
+ valueCallback: function (value) {
3387
+ return parseInt(value);
3388
+ }
3389
+ }),
3390
+ era: buildMatchFn({
3391
+ matchPatterns: matchEraPatterns,
3392
+ defaultMatchWidth: 'wide',
3393
+ parsePatterns: parseEraPatterns,
3394
+ defaultParseWidth: 'any'
3395
+ }),
3396
+ quarter: buildMatchFn({
3397
+ matchPatterns: matchQuarterPatterns,
3398
+ defaultMatchWidth: 'wide',
3399
+ parsePatterns: parseQuarterPatterns,
3400
+ defaultParseWidth: 'any',
3401
+ valueCallback: function (index) {
3402
+ return index + 1;
3403
+ }
3404
+ }),
3405
+ month: buildMatchFn({
3406
+ matchPatterns: matchMonthPatterns,
3407
+ defaultMatchWidth: 'wide',
3408
+ parsePatterns: parseMonthPatterns,
3409
+ defaultParseWidth: 'any'
3410
+ }),
3411
+ day: buildMatchFn({
3412
+ matchPatterns: matchDayPatterns,
3413
+ defaultMatchWidth: 'wide',
3414
+ parsePatterns: parseDayPatterns,
3415
+ defaultParseWidth: 'any'
3416
+ }),
3417
+ dayPeriod: buildMatchFn({
3418
+ matchPatterns: matchDayPeriodPatterns,
3419
+ defaultMatchWidth: 'wide',
3420
+ parsePatterns: parseDayPeriodPatterns,
3421
+ defaultParseWidth: 'any'
3422
+ })
3423
+ };
3424
+
3425
+ /**
3426
+ * @type {Locale}
3427
+ * @category Locales
3428
+ * @summary German locale.
3429
+ * @language German
3430
+ * @iso-639-2 deu
3431
+ * @author Thomas Eilmsteiner [@DeMuu]{@link https://github.com/DeMuu}
3432
+ * @author Asia [@asia-t]{@link https://github.com/asia-t}
3433
+ * @author Van Vuong Ngo [@vanvuongngo]{@link https://github.com/vanvuongngo}
3434
+ * @author RomanErnst [@pex]{@link https://github.com/pex}
3435
+ * @author Philipp Keck [@Philipp91]{@link https://github.com/Philipp91}
3436
+ */
3437
+
3438
+ var locale = {
3439
+ code: 'de',
3440
+ formatDistance: formatDistance,
3441
+ formatLong: formatLong,
3442
+ formatRelative: formatRelative,
3443
+ localize: localize,
3444
+ match: match,
3445
+ options: {
3446
+ weekStartsOn: 1
3447
+ /* Monday */
3448
+ ,
3449
+ firstWeekContainsDate: 4
3450
+ }
3451
+ };
3452
+
3453
+ var PickerView = styled.div.withConfig({
3454
+ displayName: "Datepicker__PickerView",
3455
+ componentId: "sc-1h58zop-0"
3456
+ })(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n position: relative;\n width: 100%;\n text-align: left;\n\n .react-datepicker-popper {\n right: ", "px;\n z-index: 9 !important;\n width: 100%;\n }\n\n @media ", " {\n .react-datepicker-popper {\n right: auto;\n width: auto;\n }\n }\n\n .react-datepicker {\n display: flex;\n flex-wrap: wrap;\n font-family: 'Roboto', sans-serif;\n border: 1px solid\n ", " !important;\n border-radius: ", " !important;\n padding: ", "px;\n width: 100%;\n\n box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.15);\n }\n\n .react-datepicker-wrapper {\n width: 100% !important;\n }\n\n .react-datepicker__header {\n border: none !important;\n background-color: transparent !important;\n margin: 0 ", "px;\n }\n\n /* Month */\n .react-datepicker__month-container {\n width: 100%;\n margin-bottom: ", "px;\n }\n\n @media ", " {\n .react-datepicker__month-container {\n max-width: 50%;\n }\n }\n\n .react-datepicker__month {\n margin-left: ", "px;\n margin-right: ", "px;\n }\n\n .react-datepicker__current-month {\n font-family: 'Roboto', sans-serif;\n font-weight: 600;\n font-size: 17px;\n line-height: 1.3;\n text-transform: uppercase;\n background-color: ", ";\n padding: 10px 15px;\n color: ", " !important;\n width: max-content;\n margin: 0 auto;\n }\n\n /* Day styles */\n\n .react-datepicker__day-names {\n display: flex;\n font-size: 11px;\n line-height: 1.25;\n background: transparent;\n }\n\n @media ", " {\n .react-datepicker__day-names {\n display: block;\n }\n }\n\n .react-datepicker__day-name {\n flex: 1 0 auto;\n }\n\n .react-datepicker__week {\n display: flex;\n margin: -2px !important;\n }\n\n @media ", " {\n .react-datepicker__week {\n display: block;\n }\n }\n\n .react-datepicker__day {\n flex: 1 0 auto;\n background-color: ", ";\n border-radius: 0 !important;\n font-weight: 600;\n\n margin: 2px !important;\n }\n\n @media ", " {\n .react-datepicker__day:hover {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n }\n\n .react-datepicker__day--outside-month {\n color: ", " !important;\n cursor: default;\n }\n\n .react-datepicker__day--selected {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n\n .react-datepicker__day--today {\n border: 1px solid\n ", " !important;\n border-radius: 0 !important;\n }\n\n /* Triangle Styles */\n\n .react-datepicker__triangle:before {\n border-bottom-color: ", " !important;\n }\n\n .react-datepicker__triangle:after {\n border-bottom-color: ", " !important;\n }\n\n /* Day Ranges */\n\n .react-datepicker__day--in-range {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--in-range:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-start {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-start:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-end {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-end:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--in-selecting-range {\n background-color: ", " !important;\n }\n\n /* Next-/Prev-Arrow */\n .react-datepicker__close-icon {\n display: none !important;\n }\n\n .react-datepicker__navigation {\n top: ", "px !important;\n }\n\n .react-datepicker__navigation-icon--next::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation-icon--previous::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation:focus {\n outline: 1px solid ", ";\n }\n\n /* Keyboard selection */\n .react-datepicker__day--keyboard-selected {\n outline: none;\n background: ", ";\n }\n"], ["\n position: relative;\n width: 100%;\n text-align: left;\n\n .react-datepicker-popper {\n right: ", "px;\n z-index: 9 !important;\n width: 100%;\n }\n\n @media ", " {\n .react-datepicker-popper {\n right: auto;\n width: auto;\n }\n }\n\n .react-datepicker {\n display: flex;\n flex-wrap: wrap;\n font-family: 'Roboto', sans-serif;\n border: 1px solid\n ", " !important;\n border-radius: ", " !important;\n padding: ", "px;\n width: 100%;\n\n box-shadow: 0px 3px 9px rgba(0, 0, 0, 0.15);\n }\n\n .react-datepicker-wrapper {\n width: 100% !important;\n }\n\n .react-datepicker__header {\n border: none !important;\n background-color: transparent !important;\n margin: 0 ", "px;\n }\n\n /* Month */\n .react-datepicker__month-container {\n width: 100%;\n margin-bottom: ", "px;\n }\n\n @media ", " {\n .react-datepicker__month-container {\n max-width: 50%;\n }\n }\n\n .react-datepicker__month {\n margin-left: ", "px;\n margin-right: ", "px;\n }\n\n .react-datepicker__current-month {\n font-family: 'Roboto', sans-serif;\n font-weight: 600;\n font-size: 17px;\n line-height: 1.3;\n text-transform: uppercase;\n background-color: ", ";\n padding: 10px 15px;\n color: ", " !important;\n width: max-content;\n margin: 0 auto;\n }\n\n /* Day styles */\n\n .react-datepicker__day-names {\n display: flex;\n font-size: 11px;\n line-height: 1.25;\n background: transparent;\n }\n\n @media ", " {\n .react-datepicker__day-names {\n display: block;\n }\n }\n\n .react-datepicker__day-name {\n flex: 1 0 auto;\n }\n\n .react-datepicker__week {\n display: flex;\n margin: -2px !important;\n }\n\n @media ", " {\n .react-datepicker__week {\n display: block;\n }\n }\n\n .react-datepicker__day {\n flex: 1 0 auto;\n background-color: ", ";\n border-radius: 0 !important;\n font-weight: 600;\n\n margin: 2px !important;\n }\n\n @media ", " {\n .react-datepicker__day:hover {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n }\n\n .react-datepicker__day--outside-month {\n color: ", " !important;\n cursor: default;\n }\n\n .react-datepicker__day--selected {\n background-color: ", " !important;\n border-radius: 0 !important;\n color: ", ";\n }\n\n .react-datepicker__day--today {\n border: 1px solid\n ", " !important;\n border-radius: 0 !important;\n }\n\n /* Triangle Styles */\n\n .react-datepicker__triangle:before {\n border-bottom-color: ", " !important;\n }\n\n .react-datepicker__triangle:after {\n border-bottom-color: ", " !important;\n }\n\n /* Day Ranges */\n\n .react-datepicker__day--in-range {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--in-range:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-start {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-start:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--range-end {\n background-color: ", " !important;\n }\n\n @media ", " {\n .react-datepicker__day--range-end:hover {\n background-color: ", " !important;\n }\n }\n\n .react-datepicker__day--in-selecting-range {\n background-color: ", " !important;\n }\n\n /* Next-/Prev-Arrow */\n .react-datepicker__close-icon {\n display: none !important;\n }\n\n .react-datepicker__navigation {\n top: ", "px !important;\n }\n\n .react-datepicker__navigation-icon--next::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation-icon--previous::before {\n left: 0 !important;\n }\n\n .react-datepicker__navigation:focus {\n outline: 1px solid ", ";\n }\n\n /* Keyboard selection */\n .react-datepicker__day--keyboard-selected {\n outline: none;\n background: ", ";\n }\n"])), spacings.spacer * 2, mq.medium, function (_a) {
3457
+ var theme = _a.theme;
3458
+ return hexToRgba(getColors(theme).elementBg.dark, 0.2);
3459
+ }, function (_a) {
3460
+ var theme = _a.theme;
3461
+ return getGlobals(theme).sections.edgeRadius || '0px';
3462
+ }, spacings.nudge * 2, spacings.nudge * 3, spacings.nudge * 3, mq.medium, spacings.nudge * 2, spacings.nudge * 2, function (_a) {
3463
+ var theme = _a.theme;
3464
+ return getColors(theme).primary.default;
3465
+ }, function (_a) {
3466
+ var theme = _a.theme;
3467
+ return getColors(theme).text.inverted;
3468
+ }, mq.medium, mq.medium, function (_a) {
3469
+ var theme = _a.theme;
3470
+ return getColors(theme).elementBg.light;
3471
+ }, mq.medium, function (_a) {
3472
+ var theme = _a.theme;
3473
+ return getColors(theme).elementBg.dark;
3474
+ }, function (_a) {
3475
+ var theme = _a.theme;
3476
+ return getColors(theme).text.inverted;
3477
+ }, function (_a) {
3478
+ var theme = _a.theme;
3479
+ return getColors(theme).elementBg.medium;
3480
+ }, function (_a) {
3481
+ var theme = _a.theme;
3482
+ return getColors(theme).primary.default;
3483
+ }, function (_a) {
3484
+ var theme = _a.theme;
3485
+ return getColors(theme).text.inverted;
3486
+ }, function (_a) {
3487
+ var theme = _a.theme;
3488
+ return hexToRgba(getColors(theme).elementBg.dark, 0.6);
3489
+ }, function (_a) {
3490
+ var theme = _a.theme;
3491
+ return hexToRgba(getColors(theme).elementBg.dark, 0.2);
3492
+ }, function (_a) {
3493
+ var theme = _a.theme;
3494
+ return getColors(theme).elementBg.light;
3495
+ }, function (_a) {
3496
+ var theme = _a.theme;
3497
+ return hexToRgba(getColors(theme).primary.default, 0.7);
3498
+ }, mq.medium, function (_a) {
3499
+ var theme = _a.theme;
3500
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3501
+ }, function (_a) {
3502
+ var theme = _a.theme;
3503
+ return getColors(theme).primary.default;
3504
+ }, mq.medium, function (_a) {
3505
+ var theme = _a.theme;
3506
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3507
+ }, function (_a) {
3508
+ var theme = _a.theme;
3509
+ return getColors(theme).primary.default;
3510
+ }, mq.medium, function (_a) {
3511
+ var theme = _a.theme;
3512
+ return hexToRgba(getColors(theme).primary.default, 0.25);
3513
+ }, function (_a) {
3514
+ var theme = _a.theme;
3515
+ return hexToRgba(getColors(theme).primary.default, 0.7);
3516
+ }, spacings.nudge, function (_a) {
3517
+ var theme = _a.theme;
3518
+ return getColors(theme).primary.default;
3519
+ }, function (_a) {
3520
+ var theme = _a.theme;
3521
+ return getColors(theme).elementBg.dark;
3522
+ });
3523
+ var Icon$1 = styled.div.withConfig({
3524
+ displayName: "Datepicker__Icon",
3525
+ componentId: "sc-1h58zop-1"
3526
+ })(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n height: 100%;\n min-width: 24px;\n color: ", ";\n\n & > * {\n height: 20px;\n }\n"], ["\n height: 100%;\n min-width: 24px;\n color: ", ";\n\n & > * {\n height: 20px;\n }\n"])), function (_a) {
3527
+ var theme = _a.theme,
3528
+ isInverted = _a.isInverted;
3529
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
3530
+ });
3531
+ var DatepickerButton = styled.button.withConfig({
3532
+ displayName: "Datepicker__DatepickerButton",
3533
+ componentId: "sc-1h58zop-2"
3534
+ })(templateObject_3$3 || (templateObject_3$3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: none;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n outline: none;\n pointer-events: ", ";\n\n position: relative;\n\n border: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: none;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n outline: none;\n pointer-events: ", ";\n\n position: relative;\n\n border: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), spacings.nudge, function (_a) {
3535
+ var theme = _a.theme,
3536
+ isInverted = _a.isInverted,
3537
+ hasError = _a.hasError;
3538
+
3539
+ if (isInverted) {
3540
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
3541
+ }
3542
+
3543
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
3544
+ }, function (_a) {
3545
+ var theme = _a.theme;
3546
+ return getGlobals(theme).sections.edgeRadius;
3547
+ }, copyStyle('copy', 'small'), function (_a) {
3548
+ var theme = _a.theme;
3549
+ return withRange(getFormFieldTextSize(theme), 'font-size');
3550
+ }, function (_a) {
3551
+ var theme = _a.theme,
3552
+ isInverted = _a.isInverted,
3553
+ hasError = _a.hasError,
3554
+ hasDateValue = _a.hasDateValue;
3555
+
3556
+ if (isInverted) {
3557
+ return hasError ? getColors(theme).text.errorInverted : !hasDateValue ? getColors(theme).text.subtileInverted : getFonts(theme).copy.small.colorInverted;
3558
+ }
3559
+
3560
+ return hasError ? getColors(theme).text.error : !hasDateValue ? getColors(theme).text.subtile : getFonts(theme).copy.small.color;
3561
+ }, function (_a) {
3562
+ var isActive = _a.isActive;
3563
+ return isActive ? 'none' : 'all';
3564
+ }, function (_a) {
3565
+ var theme = _a.theme,
3566
+ isInverted = _a.isInverted,
3567
+ isActive = _a.isActive;
3568
+ return isActive && "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3569
+ }, function (_a) {
3570
+ var theme = _a.theme,
3571
+ isInverted = _a.isInverted;
3572
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3573
+ }, function (_a) {
3574
+ var theme = _a.theme,
3575
+ isInverted = _a.isInverted;
3576
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
3577
+ });
3578
+ var DatepickerButtonMain = styled.div.withConfig({
3579
+ displayName: "Datepicker__DatepickerButtonMain",
3580
+ componentId: "sc-1h58zop-3"
3581
+ })(templateObject_4$3 || (templateObject_4$3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.spacer);
3582
+ var DatepickerFoot = styled.div.withConfig({
3583
+ displayName: "Datepicker__DatepickerFoot",
3584
+ componentId: "sc-1h58zop-4"
3585
+ })(templateObject_5$3 || (templateObject_5$3 = __makeTemplateObject(["\n display: block;\n width: 100%;\n\n /* margin-top: ", "px; */\n"], ["\n display: block;\n width: 100%;\n\n /* margin-top: ", "px; */\n"])), spacings.spacer * 14);
3586
+ var FootFlex = styled.div.withConfig({
3587
+ displayName: "Datepicker__FootFlex",
3588
+ componentId: "sc-1h58zop-5"
3589
+ })(templateObject_6$3 || (templateObject_6$3 = __makeTemplateObject(["\n clear: both;\n display: flex;\n flex-direction: column;\n\n & > * {\n width: 100%;\n }\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n align-items: center;\n flex-direction: row;\n\n & > * {\n width: auto;\n }\n\n & > * + * {\n margin-top: 0;\n margin-left: ", "px;\n }\n }\n"], ["\n clear: both;\n display: flex;\n flex-direction: column;\n\n & > * {\n width: 100%;\n }\n\n & > * + * {\n margin-top: ", "px;\n }\n\n @media ", " {\n align-items: center;\n flex-direction: row;\n\n & > * {\n width: auto;\n }\n\n & > * + * {\n margin-top: 0;\n margin-left: ", "px;\n }\n }\n"])), spacings.spacer * 0.5, mq.medium, spacings.spacer * 0.5);
3590
+ var ButtonLabel = styled(Button.Label).withConfig({
3591
+ displayName: "Datepicker__ButtonLabel",
3592
+ componentId: "sc-1h58zop-6"
3593
+ })(templateObject_7$2 || (templateObject_7$2 = __makeTemplateObject(["\n font-size: 12px;\n"], ["\n font-size: 12px;\n"])));
3594
+ var ButtonGhostLabel = styled(ButtonGhost.Label).withConfig({
3595
+ displayName: "Datepicker__ButtonGhostLabel",
3596
+ componentId: "sc-1h58zop-7"
3597
+ })(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n font-size: 12px;\n"], ["\n font-size: 12px;\n"])));
3598
+ var PickerButton = forwardRef(function (_a, ref) {
3599
+ var label = _a.label,
3600
+ errorMessage = _a.errorMessage,
3601
+ infoMessage = _a.infoMessage,
3602
+ isRequired = _a.isRequired,
3603
+ isInverted = _a.isInverted,
3604
+ isDisabled = _a.isDisabled,
3605
+ isFocused = _a.isFocused,
3606
+ name = _a.name,
3607
+ altText = _a.altText,
3608
+ startDate = _a.startDate,
3609
+ endDate = _a.endDate,
3610
+ setFocused = _a.setFocused,
3611
+ onClick = _a.onClick,
3612
+ _b = _a.dateFormat,
3613
+ dateFormat = _b === void 0 ? 'dd.MM.yyyy' : _b,
3614
+ customIcon = _a.customIcon,
3615
+ singleSelect = _a.singleSelect;
3616
+ return React__default.createElement(FieldWrapper$1.View, {
3617
+ isDisabled: isDisabled
3618
+ }, React__default.createElement(FieldWrapper$1.Head, {
3619
+ label: label,
3620
+ isRequired: isRequired,
3621
+ isInverted: isInverted
3622
+ }), React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(DatepickerButton, {
3623
+ ref: ref,
3624
+ type: "button",
3625
+ onClick: function (e) {
3626
+ setFocused && setFocused(true);
3627
+ onClick && onClick(e);
3628
+ },
3629
+ isActive: isFocused,
3630
+ hasDateValue: !!startDate,
3631
+ isInverted: isInverted,
3632
+ hasError: !!errorMessage,
3633
+ className: "myPickerButton"
3634
+ }, React__default.createElement(DatepickerButtonMain, null, startDate ? "".concat(format(startDate, dateFormat)).concat(endDate ? " \u2013 ".concat(format(endDate, dateFormat)) : '') : altText), React__default.createElement(Icon$1, {
3635
+ isInverted: isInverted
3636
+ }, customIcon ? customIcon({
3637
+ isInverted: isInverted,
3638
+ singleSelect: singleSelect
3639
+ }) : singleSelect ? React__default.createElement(CalendarToday, null) : React__default.createElement(DateRange, null))), name && React__default.createElement(React__default.Fragment, null, React__default.createElement("input", {
3640
+ type: "hidden",
3641
+ name: "".concat(name, "[\"start\"]"),
3642
+ value: startDate === null || startDate === void 0 ? void 0 : startDate.toString()
3643
+ }), React__default.createElement("input", {
3644
+ type: "hidden",
3645
+ name: "".concat(name, "[\"end\"]"),
3646
+ value: endDate === null || endDate === void 0 ? void 0 : endDate.toString()
3647
+ }))), React__default.createElement(FieldWrapper$1.Messages, {
3648
+ infoMessage: infoMessage,
3649
+ errorMessage: errorMessage,
3650
+ isInverted: isInverted
3651
+ }));
3652
+ });
3653
+ PickerButton.displayName = 'PickerButton';
3654
+ var PickerHeader = styled.div.withConfig({
3655
+ displayName: "Datepicker__PickerHeader",
3656
+ componentId: "sc-1h58zop-8"
3657
+ })(templateObject_9$1 || (templateObject_9$1 = __makeTemplateObject(["\n margin-bottom: ", "px;\n"], ["\n margin-bottom: ", "px;\n"])), spacings.nudge * 3);
3658
+
3659
+ var getPickerHeader = function (locale$1, prevMonthAction, nextMonthAction) {
3660
+ // eslint-disable-next-line react/display-name
3661
+ return function (_a) {
3662
+ var monthDate = _a.monthDate,
3663
+ customHeaderCount = _a.customHeaderCount,
3664
+ decreaseMonth = _a.decreaseMonth,
3665
+ increaseMonth = _a.increaseMonth;
3666
+ return React__default.createElement(PickerHeader, null, React__default.createElement("button", {
3667
+ "aria-label": "Previous Month",
3668
+ className: 'react-datepicker__navigation react-datepicker__navigation--previous',
3669
+ style: customHeaderCount === 1 ? {
3670
+ visibility: 'hidden'
3671
+ } : undefined,
3672
+ onClick: function (ev) {
3673
+ ev.preventDefault();
3674
+ decreaseMonth();
3675
+ }
3676
+ }, prevMonthAction ? typeof prevMonthAction === 'string' ? React__default.createElement("img", {
3677
+ src: prevMonthAction
3678
+ }) : prevMonthAction : React__default.createElement("span", {
3679
+ className: 'react-datepicker__navigation-icon react-datepicker__navigation-icon--previous'
3680
+ }, '<')), React__default.createElement("span", {
3681
+ className: "react-datepicker__current-month"
3682
+ }, format(monthDate, 'LLLL', {
3683
+ locale: locale
3684
+ })), React__default.createElement("button", {
3685
+ "aria-label": "Next Month",
3686
+ className: 'react-datepicker__navigation react-datepicker__navigation--next',
3687
+ style: customHeaderCount === 0 ? {
3688
+ visibility: 'hidden'
3689
+ } : undefined,
3690
+ onClick: function (ev) {
3691
+ ev.preventDefault();
3692
+ increaseMonth();
3693
+ }
3694
+ }, nextMonthAction ? typeof nextMonthAction === 'string' ? React__default.createElement("img", {
3695
+ src: nextMonthAction
3696
+ }) : nextMonthAction : React__default.createElement("span", {
3697
+ className: 'react-datepicker__navigation-icon react-datepicker__navigation-icon--next'
3698
+ }, '>')));
3699
+ };
3700
+ };
3701
+
3702
+ var Datepicker = function (_a) {
3703
+ var label = _a.label,
3704
+ errorMessage = _a.errorMessage,
3705
+ infoMessage = _a.infoMessage,
3706
+ isRequired = _a.isRequired,
3707
+ isDisabled = _a.isDisabled,
3708
+ isInverted = _a.isInverted,
3709
+ name = _a.name,
3710
+ dateSubmitLabel = _a.dateSubmitLabel,
3711
+ dateDeleteLabel = _a.dateDeleteLabel,
3712
+ placeholder = _a.placeholder,
3713
+ _b = _a.singleSelect,
3714
+ singleSelect = _b === void 0 ? false : _b,
3715
+ values = _a.values,
3716
+ _c = _a.minDate,
3717
+ minDate = _c === void 0 ? new Date() : _c,
3718
+ maxDate = _a.maxDate,
3719
+ onDataChange = _a.onDataChange,
3720
+ onSubmit = _a.onSubmit,
3721
+ deleteAction = _a.deleteAction,
3722
+ submitAction = _a.submitAction,
3723
+ customIcon = _a.customIcon,
3724
+ nextCtrlUrl = _a.nextCtrlUrl,
3725
+ prevCtrlUrl = _a.prevCtrlUrl;
3726
+ var globals = useLibTheme().globals;
3727
+ var locale$1 = globals.sections.datepickerLocaleKey;
3728
+ var dateFormat = globals.sections.datepickerDateFormat;
3729
+ var pickerRef = useRef(null);
3730
+ var pickerBtnRef = useRef(null);
3731
+
3732
+ var _d = useState(false),
3733
+ isSmall = _d[0],
3734
+ setIsSmall = _d[1];
3735
+
3736
+ var _e = useState(),
3737
+ startDate = _e[0],
3738
+ setStartDate = _e[1];
3739
+
3740
+ var _f = useState(),
3741
+ endDate = _f[0],
3742
+ setEndDate = _f[1];
3743
+
3744
+ var _g = useState(),
3745
+ focused = _g[0],
3746
+ setFocused = _g[1];
3747
+
3748
+ useEffect(function () {
3749
+ var x = function () {
3750
+ return __awaiter(void 0, void 0, void 0, function () {
3751
+ return __generator(this, function (_a) {
3752
+ switch (_a.label) {
3753
+ case 0:
3754
+ return [4
3755
+ /*yield*/
3756
+ , import('react-datepicker')];
3757
+
3758
+ case 1:
3759
+ _a.sent();
3760
+
3761
+ return [2
3762
+ /*return*/
3763
+ ];
3764
+ }
3765
+ });
3766
+ });
3767
+ };
3768
+
3769
+ if (!singleSelect) setIsSmall(!window.matchMedia(mq.medium).matches);
3770
+ x();
3771
+ }, [locale$1, singleSelect]);
3772
+ useEffect(function () {
3773
+ if (values) {
3774
+ if (values[0] && isValid(values[0])) {
3775
+ setStartDate(values[0]);
3776
+ }
3777
+
3778
+ if (values[1] && isValid(values[1])) {
3779
+ setEndDate(values[1]);
3780
+ }
3781
+ }
3782
+ }, [values]);
3783
+ useEffect(function () {
3784
+ var handleResize = function () {
3785
+ var shouldBeSmall = !window.matchMedia(mq.medium).matches;
3786
+
3787
+ if (shouldBeSmall !== isSmall) {
3788
+ setIsSmall(shouldBeSmall);
3789
+ }
3790
+ };
3791
+
3792
+ window.addEventListener('resize', handleResize);
3793
+ return function () {
3794
+ window.removeEventListener('resize', handleResize);
3795
+ };
3796
+ }, [isSmall]);
3797
+ useEffect(function () {
3798
+ var _a;
3799
+
3800
+ if (pickerRef.current && focused !== undefined) {
3801
+ (_a = pickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(focused);
3802
+ }
3803
+ }, [focused]);
3804
+ var handleSubmit = useCallback(function (ev) {
3805
+ ev.preventDefault();
3806
+ setFocused(false);
3807
+ onSubmit && onSubmit(startDate, endDate);
3808
+ }, // eslint-disable-next-line react-hooks/exhaustive-deps
3809
+ [endDate, startDate]);
3810
+ var handleReset = useCallback(function (ev) {
3811
+ ev.preventDefault();
3812
+ setStartDate(undefined);
3813
+ setEndDate(undefined);
3814
+ }, []);
3815
+ return React__default.createElement(PickerView, null, React__default.createElement(ReactDatePicker, {
3816
+ locale: locale$1 === 'de' ? locale : undefined,
3817
+ ref: pickerRef,
3818
+ dateFormat: dateFormat,
3819
+ onChange: function (date) {
3820
+ if (date) {
3821
+ if (singleSelect) {
3822
+ setStartDate(date);
3823
+ setFocused(false);
3824
+ onDataChange && onDataChange(date, null);
3825
+ } else if (startDate) {
3826
+ if (endDate) {
3827
+ setStartDate(date);
3828
+ setEndDate(null);
3829
+ onDataChange && onDataChange(date, null);
3830
+ } else if (isBefore(date, startDate)) {
3831
+ setEndDate(startDate);
3832
+ setStartDate(date);
3833
+ onDataChange && onDataChange(date, startDate);
3834
+ } else {
3835
+ setEndDate(date);
3836
+ onDataChange && onDataChange(startDate, date);
3837
+ }
3838
+ } else {
3839
+ setStartDate(date);
3840
+ onDataChange && onDataChange(date, endDate || null);
3841
+ }
3842
+ } else {
3843
+ setStartDate(undefined);
3844
+ onDataChange && onDataChange(null, null);
3845
+ }
3846
+ },
3847
+ selected: startDate,
3848
+ startDate: startDate,
3849
+ endDate: endDate,
3850
+ monthsShown: isSmall ? 1 : 2,
3851
+ shouldCloseOnSelect: singleSelect,
3852
+ customInput: React__default.createElement(PickerButton, {
3853
+ label: label,
3854
+ isInverted: isInverted,
3855
+ isDisabled: isDisabled,
3856
+ infoMessage: infoMessage,
3857
+ errorMessage: errorMessage,
3858
+ isRequired: isRequired,
3859
+ ref: pickerBtnRef,
3860
+ name: name,
3861
+ altText: placeholder,
3862
+ startDate: startDate,
3863
+ endDate: endDate,
3864
+ isFocused: focused,
3865
+ setFocused: setFocused,
3866
+ dateFormat: dateFormat,
3867
+ customIcon: customIcon,
3868
+ singleSelect: singleSelect
3869
+ }),
3870
+ showPopperArrow: true,
3871
+ minDate: minDate,
3872
+ maxDate: maxDate,
3873
+ disabledKeyboardNavigation: false,
3874
+ isClearable: true,
3875
+ onClickOutside: function (ev) {
3876
+ ev.stopPropagation();
3877
+ setFocused(false);
3878
+ onSubmit && onSubmit(startDate, endDate);
3879
+ },
3880
+ renderCustomHeader: getPickerHeader(locale$1, prevCtrlUrl, nextCtrlUrl)
3881
+ }, React__default.createElement(DatepickerFoot, null, React__default.createElement(FootFlex, null, deleteAction ? deleteAction(handleReset) : React__default.createElement(ButtonGhost.View, {
3882
+ as: "button",
3883
+ onClick: handleReset
3884
+ }, React__default.createElement(ButtonGhostLabel, null, dateDeleteLabel || 'Delete')), submitAction ? submitAction(handleSubmit) : React__default.createElement(Button.View, {
3885
+ as: "button",
3886
+ onClick: handleSubmit
3887
+ }, React__default.createElement(ButtonLabel, null, dateSubmitLabel || 'Submit'))))));
3888
+ };
3889
+ /**
3890
+ * Function to compare both field prop states
3891
+ * @param prev Previous props
3892
+ * @param next Next props
3893
+ * @returns
3894
+ */
3895
+
3896
+
3897
+ var areEqual$5 = function (prev, next) {
3898
+ var _a, _b, _c, _d; // only apply logic if memo functionality is enabled
3899
+
3900
+
3901
+ if (!prev.enableMemo) return false;
3902
+ if (prev.infoMessage !== next.infoMessage) return false;
3903
+ if (prev.errorMessage !== next.errorMessage) return false;
3904
+ if (prev.dateDeleteLabel !== next.dateDeleteLabel) return false;
3905
+ if (prev.dateSubmitLabel !== next.dateSubmitLabel) return false;
3906
+ if (prev.label !== next.label) return false;
3907
+ if (prev.placeholder !== next.placeholder) return false; // compare date values
3908
+
3909
+ var prevDateStart = (_a = prev.values) === null || _a === void 0 ? void 0 : _a[0];
3910
+ var prevDateEnd = (_b = prev.values) === null || _b === void 0 ? void 0 : _b[1];
3911
+ var nextDateStart = (_c = prev.values) === null || _c === void 0 ? void 0 : _c[0];
3912
+ var nextDateEnd = (_d = prev.values) === null || _d === void 0 ? void 0 : _d[1];
3913
+
3914
+ if (prevDateStart !== nextDateStart || !isEqual(prevDateStart || -1, nextDateStart || -1) || prevDateEnd !== nextDateEnd || !isEqual(prevDateEnd || -1, nextDateEnd || -1)) {
3915
+ return false;
3916
+ }
3917
+
3918
+ return true;
3919
+ };
3920
+
3921
+ var DatepickerCmp = React__default.memo(Datepicker, areEqual$5);
3922
+ var templateObject_1$5, templateObject_2$3, templateObject_3$3, templateObject_4$3, templateObject_5$3, templateObject_6$3, templateObject_7$2, templateObject_8$1, templateObject_9$1;
3923
+
3924
+ var View = styled.label.withConfig({
3925
+ displayName: "Radio__View",
3926
+ componentId: "sc-1h5e0q8-0"
3927
+ })(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge * 2);
3928
+ var RadioContainer = styled.div.withConfig({
3929
+ displayName: "Radio__RadioContainer",
3930
+ componentId: "sc-1h5e0q8-1"
3931
+ })(templateObject_2$2 || (templateObject_2$2 = __makeTemplateObject(["\n cursor: ", ";\n pointer-events: ", ";\n\n border: 2px solid transparent;\n border-radius: 50%;\n\n &:focus-within {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n"], ["\n cursor: ", ";\n pointer-events: ", ";\n\n border: 2px solid transparent;\n border-radius: 50%;\n\n &:focus-within {\n outline: 1px solid ", ";\n outline-offset: 0;\n }\n"])), function (_a) {
3932
+ var isDisabled = _a.isDisabled;
3933
+ return isDisabled ? 'default' : 'pointer';
3934
+ }, function (_a) {
3935
+ var isDisabled = _a.isDisabled;
3936
+ return isDisabled ? 'none' : 'all';
3937
+ }, function (_a) {
3938
+ var theme = _a.theme;
3939
+ return getColors(theme).primary.default;
3940
+ });
3941
+ var Original$1 = styled.input.withConfig({
3942
+ displayName: "Radio__Original",
3943
+ componentId: "sc-1h5e0q8-2"
3944
+ })(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n position: absolute;\n left: -9999px;\n opacity: 0;\n"], ["\n position: absolute;\n left: -9999px;\n opacity: 0;\n"])));
3945
+ var StyledRadioButton = styled.span.withConfig({
3946
+ displayName: "Radio__StyledRadioButton",
3947
+ componentId: "sc-1h5e0q8-3"
3948
+ })(templateObject_5$2 || (templateObject_5$2 = __makeTemplateObject(["\n background: transparent;\n border-radius: 50%;\n\n position: relative;\n\n width: 20px;\n height: 20px;\n display: block;\n\n border: 2px solid\n ", ";\n\n ", "\n"], ["\n background: transparent;\n border-radius: 50%;\n\n position: relative;\n\n width: 20px;\n height: 20px;\n display: block;\n\n border: 2px solid\n ", ";\n\n ", "\n"])), function (_a) {
3949
+ var isInverted = _a.isInverted,
3950
+ theme = _a.theme,
3951
+ isSelected = _a.isSelected;
3952
+ return isSelected ? getColors(theme).primary.default : isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.medium;
3953
+ }, function (_a) {
3954
+ var isSelected = _a.isSelected,
3955
+ theme = _a.theme;
3956
+ return isSelected ? css(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n background-color: ", ";\n\n &:before {\n content: '';\n position: absolute;\n display: block;\n height: 8px;\n width: 8px;\n background-color: ", ";\n border-radius: 50%;\n top: 50%;\n left: 50%;\n\n transform: translate(-50%, -50%);\n }\n "], ["\n background-color: ", ";\n\n &:before {\n content: '';\n position: absolute;\n display: block;\n height: 8px;\n width: 8px;\n background-color: ", ";\n border-radius: 50%;\n top: 50%;\n left: 50%;\n\n transform: translate(-50%, -50%);\n }\n "])), getColors(theme).primary.default, getColors(theme).elementBg.light) : 'none';
3957
+ });
3958
+ var Label = styled(Copy).withConfig({
3959
+ displayName: "Radio__Label",
3960
+ componentId: "sc-1h5e0q8-4"
3961
+ })(templateObject_6$2 || (templateObject_6$2 = __makeTemplateObject(["\n padding-top: 2px;\n text-align: left;\n user-select: none;\n\n & > * {\n margin: 0;\n }\n"], ["\n padding-top: 2px;\n text-align: left;\n user-select: none;\n\n & > * {\n margin: 0;\n }\n"])));
3962
+
3963
+ var RadioButton = function (_a) {
3964
+ var isDisabled = _a.isDisabled,
3965
+ isSelected = _a.isSelected,
3966
+ isInverted = _a.isInverted,
3967
+ onChange = _a.onChange,
3968
+ label = _a.label,
3969
+ id = _a.id,
3970
+ name = _a.name,
3971
+ value = _a.value;
3972
+ var colors = useLibTheme().colors;
3973
+ return React.createElement(View, null, React.createElement(RadioContainer, {
3974
+ isDisabled: isDisabled
3975
+ }, React.createElement(StyledRadioButton, {
3976
+ isSelected: isSelected,
3977
+ isInverted: isInverted
3978
+ }), React.createElement(Original$1, {
3979
+ type: "radio",
3980
+ name: name,
3981
+ id: id,
3982
+ value: value,
3983
+ checked: isSelected,
3984
+ onChange: onChange
3985
+ })), label && React.createElement(Label, {
3986
+ renderAs: "span",
3987
+ size: "small",
3988
+ type: "copy-b",
3989
+ textColor: isDisabled ? colors.elementBg.medium : isInverted ? colors.text.inverted : colors.text.default,
3990
+ innerHTML: label,
3991
+ isInverted: isInverted
3992
+ }));
3993
+ };
3994
+ /**
3995
+ * Function to compare both field prop states
3996
+ * @param prev Previous props
3997
+ * @param next Next props
3998
+ * @returns
3999
+ */
4000
+
4001
+
4002
+ var areEqual$4 = function (prev, next) {
4003
+ // only apply logic if memo functionality is enabled
4004
+ if (!prev.enableMemo) return false;
4005
+ if (prev.isSelected !== next.isSelected) return false;
4006
+ if (prev.label !== next.label) return false;
4007
+ if (prev.value !== next.value) return false;
4008
+ return true;
4009
+ };
4010
+
4011
+ var RadioButton$1 = React.memo(RadioButton, areEqual$4);
4012
+ var templateObject_1$4, templateObject_2$2, templateObject_3$2, templateObject_4$2, templateObject_5$2, templateObject_6$2;
4013
+
4014
+ var Area = styled.textarea.withConfig({
4015
+ displayName: "Textarea__Area",
4016
+ componentId: "sc-1hq47t-0"
4017
+ })(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n display: block;\n outline: none;\n width: 100%;\n min-height: 100px;\n box-shadow: none;\n border-radius: 0px;\n -webkit-appearance: none;\n\n resize: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), spacings.nudge, function (_a) {
4018
+ var theme = _a.theme,
4019
+ isInverted = _a.isInverted,
4020
+ hasError = _a.hasError;
4021
+
4022
+ if (isInverted) {
4023
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4024
+ }
4025
+
4026
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4027
+ }, function (_a) {
4028
+ var theme = _a.theme;
4029
+ return getGlobals(theme).sections.edgeRadius;
4030
+ }, copyStyle('copy', 'small'), function (_a) {
4031
+ var theme = _a.theme;
4032
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4033
+ }, function (_a) {
4034
+ var theme = _a.theme,
4035
+ isInverted = _a.isInverted,
4036
+ hasError = _a.hasError;
4037
+
4038
+ if (isInverted) {
4039
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
4040
+ }
4041
+
4042
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
4043
+ }, function (_a) {
4044
+ var theme = _a.theme,
4045
+ isInverted = _a.isInverted;
4046
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4047
+ }, function (_a) {
4048
+ var theme = _a.theme,
4049
+ isInverted = _a.isInverted;
4050
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4051
+ }, function (_a) {
4052
+ var theme = _a.theme,
4053
+ isInverted = _a.isInverted;
4054
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4055
+ });
4056
+
4057
+ var Textarea = function (_a) {
4058
+ var label = _a.label,
4059
+ isRequired = _a.isRequired,
4060
+ errorMessage = _a.errorMessage,
4061
+ infoMessage = _a.infoMessage,
4062
+ isDisabled = _a.isDisabled,
4063
+ isInverted = _a.isInverted,
4064
+ placeholder = _a.placeholder,
4065
+ value = _a.value,
4066
+ name = _a.name,
4067
+ onChange = _a.onChange,
4068
+ onBlur = _a.onBlur;
4069
+
4070
+ if (isDisabled) {
4071
+ errorMessage = '';
4072
+ }
4073
+
4074
+ return React__default.createElement(FieldWrapper$1.View, {
4075
+ isDisabled: isDisabled
4076
+ }, React__default.createElement(FieldWrapper$1.Head, {
4077
+ label: label,
4078
+ isRequired: isRequired,
4079
+ isInverted: isInverted
4080
+ }), React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(Area, {
4081
+ value: value,
4082
+ name: name,
4083
+ placeholder: placeholder,
4084
+ hasError: !!errorMessage,
4085
+ isDisabled: isDisabled,
4086
+ isInverted: isInverted,
4087
+ required: isRequired,
4088
+ onChange: onChange,
4089
+ onBlur: onBlur
4090
+ })), React__default.createElement(FieldWrapper$1.Messages, {
4091
+ infoMessage: infoMessage,
4092
+ errorMessage: errorMessage,
4093
+ isInverted: isInverted
4094
+ }));
4095
+ };
4096
+ /**
4097
+ * Function to compare both field prop states
4098
+ * @param prev Previous props
4099
+ * @param next Next props
4100
+ * @returns
4101
+ */
4102
+
4103
+
4104
+ var areEqual$3 = function (prev, next) {
4105
+ // only apply logic if memo functionality is enabled
4106
+ if (!prev.enableMemo) return false;
4107
+ if (prev.value !== next.value) return false;
4108
+ if (prev.errorMessage !== next.errorMessage) return false;
4109
+ if (prev.infoMessage !== next.infoMessage) return false;
4110
+ if (prev.label !== next.label) return false;
4111
+ if (prev.placeholder !== next.placeholder) return false;
4112
+ return true;
4113
+ };
4114
+
4115
+ var Textarea$1 = React__default.memo(Textarea, areEqual$3);
4116
+ var templateObject_1$3;
4117
+
4118
+ var InputField = styled.input.withConfig({
4119
+ displayName: "Textfield__InputField",
4120
+ componentId: "sc-11gw2iv-0"
4121
+ })(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n display: block;\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"], ["\n display: block;\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n &::placeholder {\n color: ", ";\n }\n"])), spacings.nudge, function (_a) {
4122
+ var theme = _a.theme,
4123
+ isInverted = _a.isInverted,
4124
+ hasError = _a.hasError;
4125
+
4126
+ if (isInverted) {
4127
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4128
+ }
4129
+
4130
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4131
+ }, function (_a) {
4132
+ var theme = _a.theme;
4133
+ return getGlobals(theme).sections.edgeRadius;
4134
+ }, copyStyle('copy', 'small'), function (_a) {
4135
+ var theme = _a.theme;
4136
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4137
+ }, function (_a) {
4138
+ var theme = _a.theme,
4139
+ isInverted = _a.isInverted,
4140
+ hasError = _a.hasError;
4141
+
4142
+ if (isInverted) {
4143
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
4144
+ }
4145
+
4146
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
4147
+ }, function (_a) {
4148
+ var theme = _a.theme,
4149
+ isInverted = _a.isInverted;
4150
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4151
+ }, function (_a) {
4152
+ var theme = _a.theme,
4153
+ isInverted = _a.isInverted;
4154
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4155
+ }, function (_a) {
4156
+ var theme = _a.theme,
4157
+ isInverted = _a.isInverted;
4158
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4159
+ });
4160
+
4161
+ var Textfield = function (_a) {
4162
+ var _b = _a.type,
4163
+ type = _b === void 0 ? 'text' : _b,
4164
+ label = _a.label,
4165
+ errorMessage = _a.errorMessage,
4166
+ infoMessage = _a.infoMessage,
4167
+ isRequired = _a.isRequired,
4168
+ isDisabled = _a.isDisabled,
4169
+ isInverted = _a.isInverted,
4170
+ placeholder = _a.placeholder,
4171
+ value = _a.value,
4172
+ name = _a.name,
4173
+ onChange = _a.onChange,
4174
+ onBlur = _a.onBlur;
4175
+
4176
+ if (isDisabled) {
4177
+ errorMessage = '';
4178
+ }
4179
+
4180
+ return React__default.createElement(FieldWrapper$1.View, {
4181
+ isDisabled: isDisabled
4182
+ }, React__default.createElement(FieldWrapper$1.Head, {
4183
+ label: label,
4184
+ isRequired: isRequired,
4185
+ isInverted: isInverted
4186
+ }), React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(InputField, {
4187
+ placeholder: placeholder,
4188
+ hasError: !!errorMessage,
4189
+ type: type,
4190
+ isInverted: isInverted,
4191
+ name: name,
4192
+ value: value,
4193
+ required: isRequired,
4194
+ onChange: onChange,
4195
+ onBlur: onBlur
4196
+ })), React__default.createElement(FieldWrapper$1.Messages, {
4197
+ infoMessage: infoMessage,
4198
+ errorMessage: errorMessage,
4199
+ isInverted: isInverted
4200
+ }));
4201
+ };
4202
+ /**
4203
+ * Function to compare both field prop states
4204
+ * @param prev Previous props
4205
+ * @param next Next props
4206
+ * @returns
4207
+ */
4208
+
4209
+
4210
+ var areEqual$2 = function (prev, next) {
4211
+ // only apply logic if memo functionality is enabled
4212
+ if (!prev.enableMemo) return false;
4213
+ if (prev.value !== next.value) return false;
4214
+ if (prev.errorMessage !== next.errorMessage) return false;
4215
+ if (prev.infoMessage !== next.infoMessage) return false;
4216
+ if (prev.label !== next.label) return false;
4217
+ if (prev.placeholder !== next.placeholder) return false;
4218
+ return true;
4219
+ };
4220
+
4221
+ var Textfield$1 = React__default.memo(Textfield, areEqual$2);
4222
+ var templateObject_1$2;
4223
+
4224
+ var Select = styled.button.withConfig({
4225
+ displayName: "SelectDropdown__Select",
4226
+ componentId: "sc-hnkdye-0"
4227
+ })(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n position: relative;\n\n -webkit-appearance: none;\n outline: none;\n cursor: pointer;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n position: relative;\n\n -webkit-appearance: none;\n outline: none;\n cursor: pointer;\n\n padding: ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n background: transparent;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n &:active {\n border: ", ";\n }\n\n &:focus {\n outline: ", ";\n outline-offset: 0;\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge, function (_a) {
4228
+ var theme = _a.theme,
4229
+ isInverted = _a.isInverted,
4230
+ hasError = _a.hasError,
4231
+ isOpen = _a.isOpen;
4232
+ if (isOpen) return 'transparent';
4233
+
4234
+ if (isInverted) {
4235
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4236
+ }
4237
+
4238
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4239
+ }, function (_a) {
4240
+ var theme = _a.theme;
4241
+ return getGlobals(theme).sections.edgeRadius;
4242
+ }, copyStyle('copy', 'small'), function (_a) {
4243
+ var theme = _a.theme;
4244
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4245
+ }, function (_a) {
4246
+ var theme = _a.theme,
4247
+ isInverted = _a.isInverted,
4248
+ hasError = _a.hasError,
4249
+ isSelected = _a.isSelected;
4250
+
4251
+ if (!isSelected) {
4252
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4253
+ }
4254
+
4255
+ if (isInverted) {
4256
+ return hasError ? getColors(theme).text.errorInverted : getFonts(theme).copy.small.colorInverted;
4257
+ }
4258
+
4259
+ return hasError ? getColors(theme).text.error : getFonts(theme).copy.small.color;
4260
+ }, function (_a) {
4261
+ var theme = _a.theme,
4262
+ isInverted = _a.isInverted,
4263
+ isOpen = _a.isOpen;
4264
+ return "1px solid ".concat(isOpen ? 'transparent' : isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4265
+ }, function (_a) {
4266
+ var theme = _a.theme,
4267
+ isInverted = _a.isInverted,
4268
+ isOpen = _a.isOpen;
4269
+ return "1px solid ".concat(isOpen ? 'transparent' : isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4270
+ }, spacings.nudge);
4271
+ var SelectMain = styled.span.withConfig({
4272
+ displayName: "SelectDropdown__SelectMain",
4273
+ componentId: "sc-hnkdye-1"
4274
+ })(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n display: block;\n user-select: none;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n\n & > * + * {\n margin-left: ", "px;\n }\n"], ["\n display: block;\n user-select: none;\n\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n\n & > * + * {\n margin-left: ", "px;\n }\n"])), spacings.nudge);
4275
+ var Indicator = styled.span.withConfig({
4276
+ displayName: "SelectDropdown__Indicator",
4277
+ componentId: "sc-hnkdye-2"
4278
+ })(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n display: block;\n pointer-events: none;\n"], ["\n display: block;\n pointer-events: none;\n"])));
4279
+ var Flyout = styled.ul.withConfig({
4280
+ displayName: "SelectDropdown__Flyout",
4281
+ componentId: "sc-hnkdye-3"
4282
+ })(templateObject_4$1 || (templateObject_4$1 = __makeTemplateObject(["\n list-style: none;\n padding: 0 !important;\n margin: 0 !important;\n\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2;\n\n display: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n max-height: 300px;\n overflow-y: auto;\n scrollbar-width: none;\n\n outline: ", ";\n outline-offset: 0;\n\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 14px;\n }\n\n ::-webkit-scrollbar-thumb {\n border-radius: 8px;\n background-color: ", ";\n border: 4px solid rgba(0, 0, 0, 0);\n background-clip: padding-box;\n }\n"], ["\n list-style: none;\n padding: 0 !important;\n margin: 0 !important;\n\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n z-index: 2;\n\n display: ", ";\n background: ", ";\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n max-height: 300px;\n overflow-y: auto;\n scrollbar-width: none;\n\n outline: ", ";\n outline-offset: 0;\n\n ::-webkit-scrollbar {\n -webkit-appearance: none;\n width: 14px;\n }\n\n ::-webkit-scrollbar-thumb {\n border-radius: 8px;\n background-color: ", ";\n border: 4px solid rgba(0, 0, 0, 0);\n background-clip: padding-box;\n }\n"])), function (_a) {
4283
+ var isVisible = _a.isVisible;
4284
+ return isVisible ? 'block' : 'none';
4285
+ }, function (_a) {
4286
+ var theme = _a.theme;
4287
+ return getColors(theme).elementBg.light;
4288
+ }, function (_a) {
4289
+ var theme = _a.theme,
4290
+ isInverted = _a.isInverted;
4291
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
4292
+ }, function (_a) {
4293
+ var theme = _a.theme;
4294
+ return getGlobals(theme).sections.edgeRadius;
4295
+ }, function (_a) {
4296
+ var theme = _a.theme,
4297
+ isInverted = _a.isInverted;
4298
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4299
+ }, function (_a) {
4300
+ var theme = _a.theme;
4301
+ return getColors(theme).elementBg.medium;
4302
+ });
4303
+ var ItemStyle = styled.li.withConfig({
4304
+ displayName: "SelectDropdown__ItemStyle",
4305
+ componentId: "sc-hnkdye-4"
4306
+ })(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n padding: ", "px;\n width: 100%;\n cursor: pointer;\n position: relative;\n"], ["\n padding: ", "px;\n width: 100%;\n cursor: pointer;\n position: relative;\n"])), spacings.nudge);
4307
+ var Item = styled(Copy).withConfig({
4308
+ displayName: "SelectDropdown__Item",
4309
+ componentId: "sc-hnkdye-5"
4310
+ })(templateObject_7$1 || (templateObject_7$1 = __makeTemplateObject(["\n z-index: 0;\n\n @media (hover: hover) and (pointer: fine) {\n ", ":hover & {\n &:before {\n content: '';\n background: ", ";\n opacity: 0.25;\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: -1;\n }\n }\n }\n\n ", "\n"], ["\n z-index: 0;\n\n @media (hover: hover) and (pointer: fine) {\n ", ":hover & {\n &:before {\n content: '';\n background: ", ";\n opacity: 0.25;\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: -1;\n }\n }\n }\n\n ", "\n"])), ItemStyle, function (_a) {
4311
+ var theme = _a.theme;
4312
+ return getColors(theme).primary.hover;
4313
+ }, function (_a) {
4314
+ var isSelected = _a.isSelected;
4315
+ return isSelected && css(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n &:before {\n content: '';\n background: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n z-index: -1;\n }\n "], ["\n &:before {\n content: '';\n background: ", ";\n position: absolute;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n\n z-index: -1;\n }\n "])), function (_a) {
4316
+ var theme = _a.theme;
4317
+ return getColors(theme).primary.default;
4318
+ });
4319
+ });
4320
+ var ClearItem = styled(Item).withConfig({
4321
+ displayName: "SelectDropdown__ClearItem",
4322
+ componentId: "sc-hnkdye-6"
4323
+ })(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: transparent;\n"], ["\n color: transparent;\n"])));
4324
+ var Container = styled.div.withConfig({
4325
+ displayName: "SelectDropdown__Container",
4326
+ componentId: "sc-hnkdye-7"
4327
+ })(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: relative;\n outline: none;\n"], ["\n position: relative;\n outline: none;\n"])));
4328
+
4329
+ var SelectDropdown = function (_a) {
4330
+ var label = _a.label,
4331
+ isRequired = _a.isRequired,
4332
+ errorMessage = _a.errorMessage,
4333
+ infoMessage = _a.infoMessage,
4334
+ isDisabled = _a.isDisabled,
4335
+ isInverted = _a.isInverted,
4336
+ items = _a.items,
4337
+ name = _a.name,
4338
+ selectedItem = _a.selectedItem,
4339
+ placeholder = _a.placeholder,
4340
+ onChange = _a.onChange,
4341
+ onBlur = _a.onBlur,
4342
+ indicator = _a.indicator;
4343
+ var colors = useLibTheme().colors;
4344
+
4345
+ var _b = useState(false),
4346
+ isOpen = _b[0],
4347
+ setIsOpen = _b[1];
4348
+
4349
+ var _c = useState((items === null || items === void 0 ? void 0 : items.findIndex(function (item) {
4350
+ return item.label === selectedItem;
4351
+ })) || -1),
4352
+ activeItemIndex = _c[0],
4353
+ setActiveItemIndex = _c[1];
4354
+
4355
+ var _d = useState(items || []),
4356
+ selectItems = _d[0],
4357
+ setSelectItems = _d[1];
4358
+
4359
+ var selectBtnRef = useRef(null);
4360
+ var isMounted = useMounted();
4361
+ var itemHasBeenClicked = useRef(false);
4362
+ useEffect(function () {
4363
+ var index = items === null || items === void 0 ? void 0 : items.findIndex(function (item) {
4364
+ return item.label === selectedItem;
4365
+ });
4366
+ if (index !== -1) setActiveItemIndex(index);
4367
+ setSelectItems(items || []);
4368
+ }, [items, selectedItem]);
4369
+ useEffect(function () {
4370
+ var newItem = selectItems[activeItemIndex];
4371
+
4372
+ if (isMounted) {
4373
+ onChange && onChange(newItem === null || newItem === void 0 ? void 0 : newItem.label, newItem === null || newItem === void 0 ? void 0 : newItem.value);
4374
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4375
+
4376
+ }, [selectItems, activeItemIndex, selectedItem]);
4377
+
4378
+ if (isDisabled) {
4379
+ errorMessage = '';
4380
+ }
4381
+
4382
+ var activeItem = useMemo(function () {
4383
+ return activeItemIndex >= 0 && activeItemIndex < selectItems.length ? selectItems[activeItemIndex] : undefined;
4384
+ }, [activeItemIndex, selectItems]);
4385
+ return React__default.createElement(FieldWrapper$1.View, {
4386
+ isDisabled: isDisabled
4387
+ }, React__default.createElement(FieldWrapper$1.Head, {
4388
+ label: label,
4389
+ isRequired: isRequired,
4390
+ isInverted: isInverted
4391
+ }), React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(Container, null, React__default.createElement(Select, {
4392
+ ref: selectBtnRef,
4393
+ type: "button",
4394
+ "aria-label": (activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || placeholder || 'Select item',
4395
+ isOpen: isOpen,
4396
+ isInverted: isInverted,
4397
+ isSelected: !!activeItem,
4398
+ hasError: !!errorMessage,
4399
+ onClick: function () {
4400
+ setIsOpen(function (prev) {
4401
+ return !prev;
4402
+ });
4403
+ },
4404
+ onBlur: function () {
4405
+ if (!itemHasBeenClicked.current) {
4406
+ setIsOpen(false);
4407
+ onBlur && onBlur();
4408
+ }
4409
+ },
4410
+ onKeyDown: function (ev) {
4411
+ if (ev.key === 'ArrowDown') {
4412
+ ev.preventDefault();
4413
+ setIsOpen(true);
4414
+
4415
+ if (isOpen && selectItems[activeItemIndex + 1]) {
4416
+ setActiveItemIndex(function (prev) {
4417
+ return prev + 1;
4418
+ });
4419
+ }
4420
+ } else if (ev.key === 'ArrowUp') {
4421
+ ev.preventDefault();
4422
+ setIsOpen(true);
4423
+
4424
+ if (isOpen && selectItems[activeItemIndex - 1]) {
4425
+ setActiveItemIndex(function (prev) {
4426
+ return prev - 1;
4427
+ });
4428
+ }
4429
+ }
4430
+ }
4431
+ }, React__default.createElement(SelectMain, null, (activeItem === null || activeItem === void 0 ? void 0 : activeItem.label) || placeholder), React__default.createElement(Indicator, null, indicator && indicator({
4432
+ isOpen: isOpen,
4433
+ isDisabled: isDisabled
4434
+ }), !indicator && (isOpen ? React__default.createElement(AngleUp, {
4435
+ iconColor: isDisabled ? colors.elementBg.medium : colors.elementBg.dark
4436
+ }) : React__default.createElement(AngleDown, {
4437
+ iconColor: isDisabled ? colors.elementBg.medium : colors.elementBg.dark
4438
+ })))), React__default.createElement(Flyout, {
4439
+ isVisible: isOpen
4440
+ }, isValidArray(items, false) && React__default.createElement(ItemStyle, {
4441
+ key: "key_0",
4442
+ onMouseDown: function () {
4443
+ itemHasBeenClicked.current = true;
4444
+ },
4445
+ onClick: function (ev) {
4446
+ var _a;
4447
+
4448
+ ev.preventDefault(); // set new item
4449
+
4450
+ setActiveItemIndex(-1); // set focus back to toggle
4451
+
4452
+ (_a = selectBtnRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // close flyout
4453
+
4454
+ setIsOpen(false);
4455
+ itemHasBeenClicked.current = false;
4456
+ }
4457
+ }, React__default.createElement(ClearItem, {
4458
+ renderAs: "span",
4459
+ size: "small"
4460
+ }, "Clear")), items.map(function (item, i) {
4461
+ return React__default.createElement(ItemStyle, {
4462
+ key: "key_".concat(i + 1),
4463
+ onMouseDown: function () {
4464
+ itemHasBeenClicked.current = true;
4465
+ },
4466
+ onClick: function (ev) {
4467
+ var _a;
4468
+
4469
+ ev.preventDefault(); // set new item
4470
+
4471
+ setActiveItemIndex(i); // set focus back to toggle
4472
+
4473
+ (_a = selectBtnRef.current) === null || _a === void 0 ? void 0 : _a.focus(); // close flyout
4474
+
4475
+ setIsOpen(false);
4476
+ itemHasBeenClicked.current = false;
4477
+ }
4478
+ }, React__default.createElement(Item, {
4479
+ renderAs: "span",
4480
+ isSelected: i === activeItemIndex,
4481
+ size: "small",
4482
+ textColor: i === activeItemIndex ? colors.elementBg.light : colors.elementBg.dark
4483
+ }, item.label));
4484
+ }))), activeItem && React__default.createElement("input", {
4485
+ type: "hidden",
4486
+ name: name,
4487
+ value: JSON.stringify(activeItem.value)
4488
+ })), React__default.createElement(FieldWrapper$1.Messages, {
4489
+ infoMessage: infoMessage,
4490
+ errorMessage: errorMessage,
4491
+ isInverted: isInverted
4492
+ }));
4493
+ };
4494
+ /**
4495
+ * Function to compare both field prop states
4496
+ * @param prev Previous props
4497
+ * @param next Next props
4498
+ * @returns
4499
+ */
4500
+
4501
+
4502
+ var areEqual$1 = function (prev, next) {
4503
+ // only apply logic if memo functionality is enabled
4504
+ if (!prev.enableMemo) return false;
4505
+ if (prev.selectedItem !== next.selectedItem) return false;
4506
+ if (prev.errorMessage !== next.errorMessage) return false;
4507
+ if (prev.infoMessage !== next.infoMessage) return false;
4508
+ if (prev.label !== next.label) return false;
4509
+ if (prev.placeholder !== next.placeholder) return false; // compare items
4510
+
4511
+ if (prev.items.length !== next.items.length) return false;
4512
+
4513
+ for (var i = 0; i < prev.items.length; i++) {
4514
+ if (prev.items[i].label !== next.items[i].label || prev.items[i].value !== next.items[i].value) {
4515
+ return false;
4516
+ }
4517
+ }
4518
+
4519
+ return true;
4520
+ };
4521
+
4522
+ var SelectDropdown$1 = React__default.memo(SelectDropdown, areEqual$1);
4523
+ var templateObject_1$1, templateObject_2$1, templateObject_3$1, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9;
4524
+
4525
+ var FieldView = styled(FieldWrapper$1.View).withConfig({
4526
+ displayName: "FileUpload__FieldView",
4527
+ componentId: "sc-8g38v4-0"
4528
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n pointer-events: none;\n"], ["\n pointer-events: none;\n"])));
4529
+ var FieldMain = styled.div.withConfig({
4530
+ displayName: "FileUpload__FieldMain",
4531
+ componentId: "sc-8g38v4-1"
4532
+ })(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n background: none;\n\n padding: 0 ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:focus-within {\n outline: ", ";\n outline-offset: 0;\n }\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: center;\n\n outline: none;\n width: 100%;\n min-height: 40px;\n box-shadow: none;\n\n border-radius: 0px;\n -webkit-appearance: none;\n background: none;\n\n padding: 0 ", "px;\n\n border: 1px solid\n ", ";\n border-radius: ", ";\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n color: ", ";\n\n &:focus-within {\n outline: ", ";\n outline-offset: 0;\n }\n"])), spacings.nudge, function (_a) {
4533
+ var theme = _a.theme,
4534
+ isInverted = _a.isInverted,
4535
+ hasError = _a.hasError;
4536
+
4537
+ if (isInverted) {
4538
+ return hasError ? getColors(theme).errorInverted : getColors(theme).elementBg.light;
4539
+ }
4540
+
4541
+ return hasError ? getColors(theme).error : getColors(theme).elementBg.dark;
4542
+ }, function (_a) {
4543
+ var theme = _a.theme;
4544
+ return getGlobals(theme).sections.edgeRadius;
4545
+ }, copyStyle('copy', 'small'), function (_a) {
4546
+ var theme = _a.theme;
4547
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4548
+ }, function (_a) {
4549
+ var theme = _a.theme,
4550
+ isInverted = _a.isInverted;
4551
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
4552
+ }, function (_a) {
4553
+ var theme = _a.theme,
4554
+ isInverted = _a.isInverted;
4555
+ return "1px solid ".concat(isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default);
4556
+ });
4557
+ var FileItem = styled.div.withConfig({
4558
+ displayName: "FileUpload__FileItem",
4559
+ componentId: "sc-8g38v4-2"
4560
+ })(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n padding: ", "px 0;\n width: 100%;\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n\n padding: ", "px 0;\n width: 100%;\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n"])), copyStyle('copy', 'small'), function (_a) {
4561
+ var theme = _a.theme;
4562
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4563
+ }, spacings.nudge, function (_a) {
4564
+ var theme = _a.theme,
4565
+ isInverted = _a.isInverted;
4566
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
4567
+ });
4568
+ var UploadItem = styled.button.withConfig({
4569
+ displayName: "FileUpload__UploadItem",
4570
+ componentId: "sc-8g38v4-3"
4571
+ })(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n padding: ", "px 0;\n background: none;\n outline: none;\n border: none;\n\n width: 100%;\n cursor: pointer;\n pointer-events: all;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &:focus {\n text-decoration: underline;\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n }\n"], ["\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n\n padding: ", "px 0;\n background: none;\n outline: none;\n border: none;\n\n width: 100%;\n cursor: pointer;\n pointer-events: all;\n\n ", "\n /** Clamping min font size to 16px to prevent browser zooming */\n ", "\n \n color: ", ";\n\n * + & {\n border-top: 1px dashed\n ", ";\n }\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &:focus {\n text-decoration: underline;\n }\n\n &:focus:not(:focus-visible) {\n text-decoration: none;\n }\n"])), spacings.nudge, copyStyle('copy', 'small'), function (_a) {
4572
+ var theme = _a.theme;
4573
+ return withRange(getFormFieldTextSize(theme), 'font-size');
4574
+ }, function (_a) {
4575
+ var theme = _a.theme,
4576
+ isInverted = _a.isInverted;
4577
+ return isInverted ? getColors(theme).text.subtileInverted : getColors(theme).text.subtile;
4578
+ }, function (_a) {
4579
+ var theme = _a.theme,
4580
+ isInverted = _a.isInverted;
4581
+ return isInverted ? getColors(theme).elementBg.light : getColors(theme).elementBg.dark;
4582
+ });
4583
+ var Icon = styled.span.withConfig({
4584
+ displayName: "FileUpload__Icon",
4585
+ componentId: "sc-8g38v4-4"
4586
+ })(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n color: ", ";\n\n pointer-events: none;\n\n & > * {\n height: 20px;\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n color: ", ";\n\n pointer-events: none;\n\n & > * {\n height: 20px;\n }\n"])), function (_a) {
4587
+ var theme = _a.theme,
4588
+ isInverted = _a.isInverted;
4589
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
4590
+ });
4591
+ var DeleteIcon = styled.button.withConfig({
4592
+ displayName: "FileUpload__DeleteIcon",
4593
+ componentId: "sc-8g38v4-5"
4594
+ })(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n pointer-events: all;\n\n color: ", ";\n\n transition: opacity 0.2s ease-in-out;\n\n & > * {\n height: 20px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.8;\n }\n }\n\n &:focus {\n outline: solid 2px\n ", ";\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n\n height: 100%;\n min-width: 24px;\n margin-left: auto;\n\n background: none;\n border: none;\n cursor: pointer;\n padding: 0;\n pointer-events: all;\n\n color: ", ";\n\n transition: opacity 0.2s ease-in-out;\n\n & > * {\n height: 20px;\n }\n\n @media (hover: hover) and (pointer: fine) {\n &:hover {\n opacity: 0.8;\n }\n }\n\n &:focus {\n outline: solid 2px\n ", ";\n }\n\n &:focus:not(:focus-visible) {\n outline: none;\n }\n"])), function (_a) {
4595
+ var theme = _a.theme,
4596
+ isInverted = _a.isInverted;
4597
+ return isInverted ? getFonts(theme).copy.small.colorInverted : getFonts(theme).copy.small.color;
4598
+ }, function (_a) {
4599
+ var theme = _a.theme,
4600
+ isInverted = _a.isInverted;
4601
+ return isInverted ? getColors(theme).primary.inverted : getColors(theme).primary.default;
4602
+ });
4603
+ var Original = styled.input.withConfig({
4604
+ displayName: "FileUpload__Original",
4605
+ componentId: "sc-8g38v4-6"
4606
+ })(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: none;\n"], ["\n display: none;\n"])));
4607
+
4608
+ var readFileAsync = function (file, uid) {
4609
+ return new Promise(function (resolve) {
4610
+ resolve({
4611
+ uid: uid,
4612
+ type: file.type,
4613
+ url: file.name,
4614
+ isUploading: true
4615
+ });
4616
+ var reader = new FileReader();
4617
+
4618
+ reader.onload = function () {
4619
+ resolve({
4620
+ uid: uid,
4621
+ type: file.type,
4622
+ url: file.name,
4623
+ isUploading: true
4624
+ });
4625
+ };
4626
+
4627
+ reader.readAsDataURL(file);
4628
+ });
4629
+ };
4630
+
4631
+ var FileUpload = function (_a) {
4632
+ var onUploadFiles = _a.onUploadFiles,
4633
+ label = _a.label,
4634
+ isInverted = _a.isInverted,
4635
+ isDisabled = _a.isDisabled,
4636
+ isRequired = _a.isRequired,
4637
+ infoMessage = _a.infoMessage,
4638
+ errorMessage = _a.errorMessage,
4639
+ acceptedFormats = _a.acceptedFormats,
4640
+ uploadLabel = _a.uploadLabel,
4641
+ customDeleteIcon = _a.customDeleteIcon,
4642
+ customUploadIcon = _a.customUploadIcon;
4643
+
4644
+ var _b = useState([]),
4645
+ selectedFiles = _b[0],
4646
+ setSelectedFiles = _b[1];
4647
+
4648
+ var fileInputRef = useRef(null);
4649
+
4650
+ var _c = useState([]),
4651
+ previews = _c[0],
4652
+ setPreviews = _c[1];
4653
+
4654
+ if (isDisabled) {
4655
+ errorMessage = '';
4656
+ }
4657
+
4658
+ useEffect(function () {
4659
+ if (selectedFiles) {
4660
+ onUploadFiles && onUploadFiles(selectedFiles.map(function (f) {
4661
+ return f.data;
4662
+ }));
4663
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
4664
+
4665
+ }, [selectedFiles]);
4666
+
4667
+ var handleClick = function (ev) {
4668
+ var _a;
4669
+
4670
+ ev.preventDefault();
4671
+ (_a = fileInputRef.current) === null || _a === void 0 ? void 0 : _a.click();
4672
+ };
4673
+
4674
+ var handleChange = function (e) {
4675
+ if (!e.currentTarget.files) return;
4676
+ var newFiles = Array.from(e.currentTarget.files).map(function (f, i) {
4677
+ return {
4678
+ uid: "".concat(new Date().getTime().toString(), "_").concat(i),
4679
+ data: f
4680
+ };
4681
+ });
4682
+ var promises = newFiles.map(function (file) {
4683
+ return readFileAsync(file.data, file.uid);
4684
+ });
4685
+ Promise.all(promises).then(function (p) {
4686
+ setPreviews(function (prev) {
4687
+ return __spreadArray(__spreadArray([], prev, true), p, true);
4688
+ });
4689
+ });
4690
+ setSelectedFiles(function (prev) {
4691
+ return __spreadArray(__spreadArray([], prev, true), newFiles, true);
4692
+ });
4693
+ };
4694
+
4695
+ var handleDelete = function (preview) {
4696
+ return function (ev) {
4697
+ ev.preventDefault();
4698
+ ev.stopPropagation();
4699
+ if (!fileInputRef.current) return;
4700
+ fileInputRef.current.value = ''; // remove element from previews
4701
+
4702
+ setPreviews(function (prev) {
4703
+ var index = prev.findIndex(function (p) {
4704
+ return p.uid === preview.uid;
4705
+ });
4706
+ if (index < 0) return prev;
4707
+
4708
+ var copy = __spreadArray([], prev, true);
4709
+
4710
+ copy.splice(index, 1);
4711
+ return copy;
4712
+ }); // remove alement from selected files
4713
+
4714
+ setSelectedFiles(function (prev) {
4715
+ var index = prev.findIndex(function (p) {
4716
+ return p.uid === preview.uid;
4717
+ });
4718
+ if (index < 0) return prev;
4719
+
4720
+ var copy = __spreadArray([], prev, true);
4721
+
4722
+ copy.splice(index, 1);
4723
+ return copy;
4724
+ });
4725
+ };
4726
+ };
4727
+
4728
+ return React__default.createElement(FieldView, {
4729
+ isDisabled: isDisabled
4730
+ }, React__default.createElement(FieldWrapper$1.Head, {
4731
+ label: label,
4732
+ isRequired: isRequired,
4733
+ isInverted: isInverted
4734
+ }), React__default.createElement(FieldWrapper$1.Content, null, React__default.createElement(FieldMain, {
4735
+ isInverted: isInverted,
4736
+ isDisabled: isDisabled,
4737
+ hasError: !!errorMessage
4738
+ }, previews.map(function (file) {
4739
+ var fileName = file.url && file.url.split('/') || [];
4740
+ return React__default.createElement(FileItem, {
4741
+ key: file.uid,
4742
+ isInverted: isInverted
4743
+ }, React__default.createElement("span", null, fileName), React__default.createElement(DeleteIcon, {
4744
+ "aria-label": "remove file",
4745
+ type: "button",
4746
+ isInverted: isInverted,
4747
+ onClick: handleDelete(file)
4748
+ }, customDeleteIcon ? customDeleteIcon(isInverted) : React__default.createElement(DeleteForever, null)));
4749
+ }), React__default.createElement(UploadItem, {
4750
+ type: "button",
4751
+ isInverted: isInverted,
4752
+ onClick: handleClick
4753
+ }, uploadLabel && React__default.createElement("span", null, uploadLabel), React__default.createElement(Icon, {
4754
+ isInverted: isInverted
4755
+ }, customUploadIcon ? customUploadIcon(isInverted) : React__default.createElement(UploadFile, null)))), React__default.createElement(Original, {
4756
+ type: "file",
4757
+ onChange: handleChange,
4758
+ ref: fileInputRef,
4759
+ multiple: true,
4760
+ required: isRequired,
4761
+ disabled: isDisabled,
4762
+ accept: acceptedFormats
4763
+ })), React__default.createElement(FieldWrapper$1.Messages, {
4764
+ infoMessage: infoMessage,
4765
+ errorMessage: errorMessage,
4766
+ isInverted: isInverted
4767
+ }));
4768
+ };
4769
+ /**
4770
+ * Function to compare both field prop states
4771
+ * @param prev Previous props
4772
+ * @param next Next props
4773
+ * @returns
4774
+ */
4775
+
4776
+
4777
+ var areEqual = function (prev, next) {
4778
+ // only apply logic if memo functionality is enabled
4779
+ if (!prev.enableMemo) return false;
4780
+ if (prev.errorMessage !== next.errorMessage) return false;
4781
+ if (prev.infoMessage !== next.infoMessage) return false;
4782
+ if (prev.label !== next.label) return false;
4783
+ return true;
4784
+ };
4785
+
4786
+ var FileUploadCmp = React__default.memo(FileUpload, areEqual);
4787
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
4788
+
4789
+ export { DatepickerCmp as D, FieldWrapper$1 as F, LocationField$1 as L, RadioButton$1 as R, SelectDropdown$1 as S, Textarea$1 as T, Textfield$1 as a, FileUploadCmp as b };
4790
+ //# sourceMappingURL=FileUpload-851d473a.js.map